[PATCH] D17040: [mips] Expansion of BEQL and BNEL with immediate operands
Vasileios Kalintiris via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 21 09:33:42 PDT 2016
vkalintiris accepted this revision.
vkalintiris added a comment.
This revision is now accepted and ready to land.
LGTM, with two small comments inline.
================
Comment at: lib/Target/Mips/AsmParser/MipsAsmParser.cpp:2581
@@ +2580,3 @@
+ if (IsLikely) {
+ emitRRX(OpCode, DstRegOp.getReg(), ATReg, MCOperand::createExpr(MemOffsetOp.getExpr()), IDLoc,
+ Instructions);
----------------
This line is too big, can you split it?
================
Comment at: test/MC/Mips/macro-bcc-imm.s:6-37
@@ -6,1 +5,34 @@
+foo:
+ beql $a2, 16, foo # ALL: addiu $1, $zero, 16
+ # ALL: beql $6, $1, foo
+ # ALL: # fixup A - offset: 0, value: foo-4, kind: fixup_Mips_PC16
+ # ALL: nop
+ beql $a2, 16, bar # ALL: addiu $1, $zero, 16
+ # ALL: beql $6, $1, bar
+ # ALL: # fixup A - offset: 0, value: bar-4, kind: fixup_Mips_PC16
+ # ALL: nop
+ bnel $a2, 16, foo # ALL: addiu $1, $zero, 16
+ # ALL: bnel $6, $1, foo
+ # ALL: # fixup A - offset: 0, value: foo-4, kind: fixup_Mips_PC16
+ # ALL: nop
+ bnel $a2, 16, bar # ALL: addiu $1, $zero, 16
+ # ALL: bnel $6, $1, bar
+ # ALL: # fixup A - offset: 0, value: bar-4, kind: fixup_Mips_PC16
+ # ALL: nop
+ beql $a2, 32767, foo # ALL: addiu $1, $zero, 32767
+ # ALL: beql $6, $1, foo
+ # ALL: # fixup A - offset: 0, value: foo-4, kind: fixup_Mips_PC16
+ # ALL: nop
+ beql $a2, 32767, bar # ALL: addiu $1, $zero, 32767
+ # ALL: beql $6, $1, bar
+ # ALL: # fixup A - offset: 0, value: bar-4, kind: fixup_Mips_PC16
+ # ALL: nop
+ bnel $a2, 32768, foo # ALL: ori $1, $zero, 32768
+ # ALL: bnel $6, $1, foo
+ # ALL: # fixup A - offset: 0, value: foo-4, kind: fixup_Mips_PC16
+ # ALL: nop
+ bnel $a2, 32768, bar # ALL: ori $1, $zero, 32768
+ # ALL: bnel $6, $1, bar
+ # ALL: # fixup A - offset: 0, value: bar-4, kind: fixup_Mips_PC16
+ # ALL: nop
blt $a2, 16, foo # ALL: addiu $1, $zero, 16
----------------
We don't need the duplicate tests using the bar label.
http://reviews.llvm.org/D17040
More information about the llvm-commits
mailing list