@@ -205,6 +205,12 @@ def mimm : Operand<i32>, PatLeaf<(imm), [{
205
205
let PrintMethod = "printMImmOperand";
206
206
}
207
207
208
+ // zerofp - Generic fp immediate zero value.
209
+ def zerofp : Operand<i32>, PatLeaf<(fpimm), [{
210
+ return getFpImmVal(N) == 0; }]> {
211
+ let ParserMatchClass = ZeroAsmOperand;
212
+ }
213
+
208
214
// simm7fp - Generic fp immediate value.
209
215
def simm7fp : Operand<i32>, PatLeaf<(fpimm), [{
210
216
return isInt<7>(getFpImmVal(N));
@@ -827,10 +833,17 @@ multiclass BCRbpfm<string opcStr, string cmpStr, bits<8> opc, dag cond> {
827
833
!strconcat(opcStr, ".t ", cmpStr, "$imm32")>;
828
834
}
829
835
multiclass BCRm<string opcStr, string opcStrAt, string opcStrAf, bits<8> opc,
830
- RegisterClass RC, Operand immOp> {
836
+ RegisterClass RC, Operand immOp, Operand zeroOp > {
831
837
defm rr : BCRbpfm<opcStr, "$sy, $sz, ", opc, (ins CCOp:$cf, RC:$sy, RC:$sz)>;
832
838
let cy = 0 in
833
- defm ir : BCRbpfm<opcStr, "$sy, $sz, ", opc, (ins CCOp:$cf, immOp:$sy, RC:$sz)>;
839
+ defm ir : BCRbpfm<opcStr, "$sy, $sz, ", opc, (ins CCOp:$cf, immOp:$sy,
840
+ RC:$sz)>;
841
+ let cz = 0 in
842
+ defm rz : BCRbpfm<opcStr, "$sy, $sz, ", opc, (ins CCOp:$cf, RC:$sy,
843
+ zeroOp:$sz)>;
844
+ let cy = 0, cz = 0 in
845
+ defm iz : BCRbpfm<opcStr, "$sy, $sz, ", opc, (ins CCOp:$cf, immOp:$sy,
846
+ zeroOp:$sz)>;
834
847
let cy = 0, sy = 0, cz = 0, sz = 0, cf = 15 /* AT */, isBarrier = 1 in
835
848
defm a : BCRbpfm<opcStrAt, "", opc, (ins)>;
836
849
let cy = 0, sy = 0, cz = 0, sz = 0, cf = 0 /* AF */ in
@@ -1409,13 +1422,13 @@ defm BCFS : BCm<"b${cond}.s", "b.s", "baf.s", 0x1C, F32, simm7fp>;
1409
1422
1410
1423
// Section 8.8.4 - BCR (Branch on Condition Relative)
1411
1424
let cx = 0, cx2 = 0 in
1412
- defm BRCFL : BCRm<"br${cf}.l", "br.l", "braf.l", 0x18, I64, simm7>;
1425
+ defm BRCFL : BCRm<"br${cf}.l", "br.l", "braf.l", 0x18, I64, simm7, zero >;
1413
1426
let cx = 1, cx2 = 0 in
1414
- defm BRCFW : BCRm<"br${cf}.w", "br.w", "braf.w", 0x18, I32, simm7>;
1427
+ defm BRCFW : BCRm<"br${cf}.w", "br.w", "braf.w", 0x18, I32, simm7, zero >;
1415
1428
let cx = 0, cx2 = 1 in
1416
- defm BRCFD : BCRm<"br${cf}.d", "br.d", "braf.d", 0x18, I64, simm7fp>;
1429
+ defm BRCFD : BCRm<"br${cf}.d", "br.d", "braf.d", 0x18, I64, simm7fp, zerofp >;
1417
1430
let cx = 1, cx2 = 1 in
1418
- defm BRCFS : BCRm<"br${cf}.s", "br.s", "braf.s", 0x18, F32, simm7fp>;
1431
+ defm BRCFS : BCRm<"br${cf}.s", "br.s", "braf.s", 0x18, F32, simm7fp, zerofp >;
1419
1432
1420
1433
// Section 8.8.5 - BSIC (Branch and Save IC)
1421
1434
let isCall = 1, hasSideEffects = 0, DecoderMethod = "DecodeCall" in
0 commit comments