@@ -1845,7 +1845,8 @@ class DirectiveInsnVSI<dag outs, dag ins, string asmstr, list<dag> pattern>
1845
1845
//===----------------------------------------------------------------------===//
1846
1846
1847
1847
// A class to describe a variant of an instruction with condition mask.
1848
- class CondVariant<bits<4> ccmaskin, string suffixin, bit alternatein> {
1848
+ class CondVariant<bits<4> ccmaskin, string suffixin, bit alternatein,
1849
+ string asmvariantin = ""> {
1849
1850
// The fixed condition mask to use.
1850
1851
bits<4> ccmask = ccmaskin;
1851
1852
@@ -1854,6 +1855,11 @@ class CondVariant<bits<4> ccmaskin, string suffixin, bit alternatein> {
1854
1855
1855
1856
// Whether this is an alternate that needs to be marked isAsmParserOnly.
1856
1857
bit alternate = alternatein;
1858
+
1859
+ // Whether this needs be to restricted to a specific dialect.
1860
+ // Valid values are "att" and "hlasm", which when passed in
1861
+ // will set AsmVariantName.
1862
+ string asmvariant = asmvariantin;
1857
1863
}
1858
1864
1859
1865
// Condition mask 15 means "always true", which is used to define
@@ -1864,20 +1870,20 @@ def CondAlways : CondVariant<15, "", 0>;
1864
1870
def CondVariantO : CondVariant<1, "o", 0>;
1865
1871
def CondVariantH : CondVariant<2, "h", 0>;
1866
1872
def CondVariantP : CondVariant<2, "p", 1>;
1867
- def CondVariantNLE : CondVariant<3, "nle", 0>;
1873
+ def CondVariantNLE : CondVariant<3, "nle", 0, "att" >;
1868
1874
def CondVariantL : CondVariant<4, "l", 0>;
1869
1875
def CondVariantM : CondVariant<4, "m", 1>;
1870
- def CondVariantNHE : CondVariant<5, "nhe", 0>;
1871
- def CondVariantLH : CondVariant<6, "lh", 0>;
1876
+ def CondVariantNHE : CondVariant<5, "nhe", 0, "att" >;
1877
+ def CondVariantLH : CondVariant<6, "lh", 0, "att" >;
1872
1878
def CondVariantNE : CondVariant<7, "ne", 0>;
1873
1879
def CondVariantNZ : CondVariant<7, "nz", 1>;
1874
1880
def CondVariantE : CondVariant<8, "e", 0>;
1875
1881
def CondVariantZ : CondVariant<8, "z", 1>;
1876
- def CondVariantNLH : CondVariant<9, "nlh", 0>;
1877
- def CondVariantHE : CondVariant<10, "he", 0>;
1882
+ def CondVariantNLH : CondVariant<9, "nlh", 0, "att" >;
1883
+ def CondVariantHE : CondVariant<10, "he", 0, "att" >;
1878
1884
def CondVariantNL : CondVariant<11, "nl", 0>;
1879
1885
def CondVariantNM : CondVariant<11, "nm", 1>;
1880
- def CondVariantLE : CondVariant<12, "le", 0>;
1886
+ def CondVariantLE : CondVariant<12, "le", 0, "att" >;
1881
1887
def CondVariantNH : CondVariant<13, "nh", 0>;
1882
1888
def CondVariantNP : CondVariant<13, "np", 1>;
1883
1889
def CondVariantNO : CondVariant<14, "no", 0>;
@@ -1886,35 +1892,38 @@ def CondVariantNO : CondVariant<14, "no", 0>;
1886
1892
class CV<string name>
1887
1893
: CondVariant<!cast<CondVariant>("CondVariant"#name).ccmask,
1888
1894
!cast<CondVariant>("CondVariant"#name).suffix,
1889
- !cast<CondVariant>("CondVariant"#name).alternate>;
1895
+ !cast<CondVariant>("CondVariant"#name).alternate,
1896
+ !cast<CondVariant>("CondVariant"#name).asmvariant>;
1890
1897
1891
1898
// Condition masks for integer instructions (e.g. compare-and-branch).
1892
1899
// This is like the list above, except that condition 3 is not possible
1893
1900
// and that the low bit of the mask is therefore always 0. This means
1894
1901
// that each condition has two names. Conditions "o" and "no" are not used.
1895
1902
def IntCondVariantH : CondVariant<2, "h", 0>;
1896
- def IntCondVariantNLE : CondVariant<2, "nle", 1>;
1903
+ def IntCondVariantNLE : CondVariant<2, "nle", 1, "att" >;
1897
1904
def IntCondVariantL : CondVariant<4, "l", 0>;
1898
- def IntCondVariantNHE : CondVariant<4, "nhe", 1>;
1899
- def IntCondVariantLH : CondVariant<6, "lh", 0>;
1905
+ def IntCondVariantNHE : CondVariant<4, "nhe", 1, "att" >;
1906
+ def IntCondVariantLH : CondVariant<6, "lh", 0, "att" >;
1900
1907
def IntCondVariantNE : CondVariant<6, "ne", 1>;
1901
1908
def IntCondVariantE : CondVariant<8, "e", 0>;
1902
- def IntCondVariantNLH : CondVariant<8, "nlh", 1>;
1903
- def IntCondVariantHE : CondVariant<10, "he", 0>;
1909
+ def IntCondVariantNLH : CondVariant<8, "nlh", 1, "att" >;
1910
+ def IntCondVariantHE : CondVariant<10, "he", 0, "att" >;
1904
1911
def IntCondVariantNL : CondVariant<10, "nl", 1>;
1905
- def IntCondVariantLE : CondVariant<12, "le", 0>;
1912
+ def IntCondVariantLE : CondVariant<12, "le", 0, "att" >;
1906
1913
def IntCondVariantNH : CondVariant<12, "nh", 1>;
1907
1914
1908
1915
// A helper class to look up one of the above by name.
1909
1916
class ICV<string name>
1910
1917
: CondVariant<!cast<CondVariant>("IntCondVariant"#name).ccmask,
1911
1918
!cast<CondVariant>("IntCondVariant"#name).suffix,
1912
- !cast<CondVariant>("IntCondVariant"#name).alternate>;
1919
+ !cast<CondVariant>("IntCondVariant"#name).alternate,
1920
+ !cast<CondVariant>("IntCondVariant"#name).asmvariant>;
1913
1921
1914
1922
// Defines a class that makes it easier to define
1915
1923
// a MnemonicAlias when CondVariant's are involved.
1916
1924
class MnemonicCondBranchAlias<CondVariant V, string from, string to>
1917
- : MnemonicAlias<!subst("#", V.suffix, from), !subst("#", V.suffix, to)>;
1925
+ : MnemonicAlias<!subst("#", V.suffix, from), !subst("#", V.suffix, to),
1926
+ V.asmvariant>;
1918
1927
1919
1928
//===----------------------------------------------------------------------===//
1920
1929
// Instruction definitions with semantics
@@ -2125,6 +2134,7 @@ class FixedCondBranchRI<CondVariant V, string mnemonic, bits<12> opcode,
2125
2134
: InstRIc<opcode, (outs), (ins brtarget16:$RI2),
2126
2135
!subst("#", V.suffix, mnemonic)#"\t$RI2", [(operator bb:$RI2)]> {
2127
2136
let isAsmParserOnly = V.alternate;
2137
+ let AsmVariantName = V.asmvariant;
2128
2138
let M1 = V.ccmask;
2129
2139
}
2130
2140
@@ -2142,6 +2152,7 @@ class FixedCondBranchRIL<CondVariant V, string mnemonic, bits<12> opcode>
2142
2152
: InstRILc<opcode, (outs), (ins brtarget32:$RI2),
2143
2153
!subst("#", V.suffix, mnemonic)#"\t$RI2", []> {
2144
2154
let isAsmParserOnly = V.alternate;
2155
+ let AsmVariantName = V.asmvariant;
2145
2156
let M1 = V.ccmask;
2146
2157
}
2147
2158
@@ -2160,6 +2171,7 @@ class FixedCondBranchRR<CondVariant V, string mnemonic, bits<8> opcode,
2160
2171
: InstRR<opcode, (outs), (ins ADDR64:$R2),
2161
2172
!subst("#", V.suffix, mnemonic)#"\t$R2", [(operator ADDR64:$R2)]> {
2162
2173
let isAsmParserOnly = V.alternate;
2174
+ let AsmVariantName = V.asmvariant;
2163
2175
let R1 = V.ccmask;
2164
2176
}
2165
2177
@@ -2177,6 +2189,7 @@ class FixedCondBranchRX<CondVariant V, string mnemonic, bits<8> opcode>
2177
2189
: InstRXb<opcode, (outs), (ins bdxaddr12only:$XBD2),
2178
2190
!subst("#", V.suffix, mnemonic)#"\t$XBD2", []> {
2179
2191
let isAsmParserOnly = V.alternate;
2192
+ let AsmVariantName = V.asmvariant;
2180
2193
let M1 = V.ccmask;
2181
2194
}
2182
2195
@@ -2199,6 +2212,7 @@ class FixedCondBranchRXY<CondVariant V, string mnemonic, bits<16> opcode,
2199
2212
!subst("#", V.suffix, mnemonic)#"\t$XBD2",
2200
2213
[(operator (load bdxaddr20only:$XBD2))]> {
2201
2214
let isAsmParserOnly = V.alternate;
2215
+ let AsmVariantName = V.asmvariant;
2202
2216
let M1 = V.ccmask;
2203
2217
let mayLoad = 1;
2204
2218
}
@@ -2218,6 +2232,7 @@ class FixedCmpBranchRIEa<CondVariant V, string mnemonic, bits<16> opcode,
2218
2232
: InstRIEa<opcode, (outs), (ins cls:$R1, imm:$I2),
2219
2233
mnemonic#V.suffix#"\t$R1, $I2", []> {
2220
2234
let isAsmParserOnly = V.alternate;
2235
+ let AsmVariantName = V.asmvariant;
2221
2236
let M3 = V.ccmask;
2222
2237
}
2223
2238
@@ -2245,6 +2260,7 @@ class FixedCmpBranchRIEb<CondVariant V, string mnemonic, bits<16> opcode,
2245
2260
: InstRIEb<opcode, (outs), (ins cls:$R1, cls:$R2, brtarget16:$RI4),
2246
2261
mnemonic#V.suffix#"\t$R1, $R2, $RI4", []> {
2247
2262
let isAsmParserOnly = V.alternate;
2263
+ let AsmVariantName = V.asmvariant;
2248
2264
let M3 = V.ccmask;
2249
2265
}
2250
2266
@@ -2272,6 +2288,7 @@ class FixedCmpBranchRIEc<CondVariant V, string mnemonic, bits<16> opcode,
2272
2288
: InstRIEc<opcode, (outs), (ins cls:$R1, imm:$I2, brtarget16:$RI4),
2273
2289
mnemonic#V.suffix#"\t$R1, $I2, $RI4", []> {
2274
2290
let isAsmParserOnly = V.alternate;
2291
+ let AsmVariantName = V.asmvariant;
2275
2292
let M3 = V.ccmask;
2276
2293
}
2277
2294
@@ -2304,6 +2321,7 @@ class FixedCmpBranchRRFc<CondVariant V, string mnemonic, bits<16> opcode,
2304
2321
: InstRRFc<opcode, (outs), (ins cls:$R1, cls:$R2),
2305
2322
mnemonic#V.suffix#"\t$R1, $R2", []> {
2306
2323
let isAsmParserOnly = V.alternate;
2324
+ let AsmVariantName = V.asmvariant;
2307
2325
let M3 = V.ccmask;
2308
2326
}
2309
2327
@@ -2324,6 +2342,7 @@ class FixedCmpBranchRRS<CondVariant V, string mnemonic, bits<16> opcode,
2324
2342
: InstRRS<opcode, (outs), (ins cls:$R1, cls:$R2, bdaddr12only:$BD4),
2325
2343
mnemonic#V.suffix#"\t$R1, $R2, $BD4", []> {
2326
2344
let isAsmParserOnly = V.alternate;
2345
+ let AsmVariantName = V.asmvariant;
2327
2346
let M3 = V.ccmask;
2328
2347
}
2329
2348
@@ -2351,6 +2370,7 @@ class FixedCmpBranchRIS<CondVariant V, string mnemonic, bits<16> opcode,
2351
2370
: InstRIS<opcode, (outs), (ins cls:$R1, imm:$I2, bdaddr12only:$BD4),
2352
2371
mnemonic#V.suffix#"\t$R1, $I2, $BD4", []> {
2353
2372
let isAsmParserOnly = V.alternate;
2373
+ let AsmVariantName = V.asmvariant;
2354
2374
let M3 = V.ccmask;
2355
2375
}
2356
2376
@@ -2383,6 +2403,7 @@ class FixedCmpBranchRSYb<CondVariant V, string mnemonic, bits<16> opcode,
2383
2403
: InstRSYb<opcode, (outs), (ins cls:$R1, bdaddr20only:$BD2),
2384
2404
mnemonic#V.suffix#"\t$R1, $BD2", []> {
2385
2405
let isAsmParserOnly = V.alternate;
2406
+ let AsmVariantName = V.asmvariant;
2386
2407
let M3 = V.ccmask;
2387
2408
}
2388
2409
@@ -2717,6 +2738,7 @@ class FixedCondStoreRSY<CondVariant V, string mnemonic, bits<16> opcode,
2717
2738
let mayStore = 1;
2718
2739
let AccessBytes = bytes;
2719
2740
let isAsmParserOnly = V.alternate;
2741
+ let AsmVariantName = V.asmvariant;
2720
2742
let M3 = V.ccmask;
2721
2743
}
2722
2744
@@ -2891,6 +2913,7 @@ class FixedCondUnaryRSY<CondVariant V, string mnemonic, bits<16> opcode,
2891
2913
let mayLoad = 1;
2892
2914
let AccessBytes = bytes;
2893
2915
let isAsmParserOnly = V.alternate;
2916
+ let AsmVariantName = V.asmvariant;
2894
2917
let M3 = V.ccmask;
2895
2918
}
2896
2919
@@ -3294,6 +3317,7 @@ class FixedCondBinaryRRF<CondVariant V, string mnemonic, bits<16> opcode,
3294
3317
let Constraints = "$R1 = $R1src";
3295
3318
let DisableEncoding = "$R1src";
3296
3319
let isAsmParserOnly = V.alternate;
3320
+ let AsmVariantName = V.asmvariant;
3297
3321
let M3 = V.ccmask;
3298
3322
}
3299
3323
@@ -3332,6 +3356,7 @@ class FixedCondBinaryRRFa<CondVariant V, string mnemonic, bits<16> opcode,
3332
3356
: InstRRFa<opcode, (outs cls1:$R1), (ins cls3:$R3, cls2:$R2),
3333
3357
mnemonic#V.suffix#"\t$R1, $R2, $R3", []> {
3334
3358
let isAsmParserOnly = V.alternate;
3359
+ let AsmVariantName = V.asmvariant;
3335
3360
let M4 = V.ccmask;
3336
3361
}
3337
3362
@@ -3401,6 +3426,7 @@ class FixedCondBinaryRIE<CondVariant V, string mnemonic, bits<16> opcode,
3401
3426
let Constraints = "$R1 = $R1src";
3402
3427
let DisableEncoding = "$R1src";
3403
3428
let isAsmParserOnly = V.alternate;
3429
+ let AsmVariantName = V.asmvariant;
3404
3430
let M3 = V.ccmask;
3405
3431
}
3406
3432
0 commit comments