[llvm-commits] [llvm] r137891 - in /llvm/trunk: lib/Target/ARM/AsmParser/ARMAsmParser.cpp test/MC/ARM/basic-thumb-instructions.s
Jim Grosbach
grosbach at apple.com
Wed Aug 17 15:57:40 PDT 2011
Author: grosbach
Date: Wed Aug 17 17:57:40 2011
New Revision: 137891
URL: http://llvm.org/viewvc/llvm-project?rev=137891&view=rev
Log:
Thumb assembly parsing and encoding for B.
Modified:
llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
llvm/trunk/test/MC/ARM/basic-thumb-instructions.s
Modified: llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp?rev=137891&r1=137890&r2=137891&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp (original)
+++ llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp Wed Aug 17 17:57:40 2011
@@ -3035,6 +3035,10 @@
if (Inst.getOperand(3).getImm() < 8)
Inst.setOpcode(ARM::tADDi3);
break;
+ case ARM::tBcc:
+ // If the conditional is AL, we really want tB.
+ if (Inst.getOperand(1).getImm() == ARMCC::AL)
+ Inst.setOpcode(ARM::tB);
}
}
Modified: llvm/trunk/test/MC/ARM/basic-thumb-instructions.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ARM/basic-thumb-instructions.s?rev=137891&r1=137890&r2=137891&view=diff
==============================================================================
--- llvm/trunk/test/MC/ARM/basic-thumb-instructions.s (original)
+++ llvm/trunk/test/MC/ARM/basic-thumb-instructions.s Wed Aug 17 17:57:40 2011
@@ -76,3 +76,15 @@
asrs r5, r2
@ CHECK: asrs r5, r2 @ encoding: [0x15,0x41]
+
+
+ at ------------------------------------------------------------------------------
+@ B
+ at ------------------------------------------------------------------------------
+ b _baz
+ beq _bar
+
+@ CHECK: b _baz @ encoding: [A,0xe0'A']
+ @ fixup A - offset: 0, value: _baz, kind: fixup_arm_thumb_br
+@ CHECK: beq _bar @ encoding: [A,0xd0]
+ @ fixup A - offset: 0, value: _bar, kind: fixup_arm_thumb_bcc
More information about the llvm-commits
mailing list