@@ -2294,11 +2294,15 @@ def : InstAlias<"move $dst, $src", (OR GPR:$dst, GPR:$src, R0)>;
2294
2294
def : InstAlias<"ret", (JIRL R0, R1, 0)>;
2295
2295
def : InstAlias<"jr $rj", (JIRL R0, GPR:$rj, 0)>;
2296
2296
2297
- // Branches implemented with alias.
2298
- // Always output the canonical mnemonic for the pseudo branch instructions.
2299
- // The GNU tools emit the canonical mnemonic for the branch pseudo instructions
2300
- // as well (e.g. "bgt" will be recognised by the assembler but never printed by
2301
- // objdump). Match this behaviour by setting a zero weight.
2297
+ // Branches implemented with aliases.
2298
+ // Disassemble branch instructions not having a $zero operand to the
2299
+ // canonical mnemonics respectively, but disassemble BLT/BGE with a $zero
2300
+ // operand to the corresponding pseudo-instruction.
2301
+ // GNU Binutils behave like this since 2.41, e.g. "bgt" will be recognised
2302
+ // by the assembler but always disassembles as "blt" by objdump, while "bgtz"
2303
+ // will come back intact.
2304
+ // Match this behaviour by setting a zero weight for the b{gt,le}{,u}
2305
+ // patterns only.
2302
2306
def : InstAlias<"bgt $rj, $rd, $imm16",
2303
2307
(BLT GPR:$rd, GPR:$rj, simm16_lsl2_br:$imm16), 0>;
2304
2308
def : InstAlias<"bgtu $rj, $rd, $imm16",
@@ -2308,13 +2312,13 @@ def : InstAlias<"ble $rj, $rd, $imm16",
2308
2312
def : InstAlias<"bleu $rj, $rd, $imm16",
2309
2313
(BGEU GPR:$rd, GPR:$rj, simm16_lsl2_br:$imm16), 0>;
2310
2314
def : InstAlias<"bltz $rd, $imm16",
2311
- (BLT GPR:$rd, R0, simm16_lsl2_br:$imm16), 0 >;
2315
+ (BLT GPR:$rd, R0, simm16_lsl2_br:$imm16)>;
2312
2316
def : InstAlias<"bgtz $rj, $imm16",
2313
- (BLT R0, GPR:$rj, simm16_lsl2_br:$imm16), 0 >;
2317
+ (BLT R0, GPR:$rj, simm16_lsl2_br:$imm16)>;
2314
2318
def : InstAlias<"blez $rj, $imm16",
2315
- (BGE R0, GPR:$rj, simm16_lsl2_br:$imm16), 0 >;
2319
+ (BGE R0, GPR:$rj, simm16_lsl2_br:$imm16)>;
2316
2320
def : InstAlias<"bgez $rd, $imm16",
2317
- (BGE GPR:$rd, R0, simm16_lsl2_br:$imm16), 0 >;
2321
+ (BGE GPR:$rd, R0, simm16_lsl2_br:$imm16)>;
2318
2322
2319
2323
// Load immediate.
2320
2324
let hasSideEffects = 0, mayLoad = 0, mayStore = 0, isCodeGenOnly = 0,
0 commit comments