[PATCH] D97568: [ARM] support symbolic expressions as branch target in b.w

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 26 15:46:39 PST 2021


MaskRay added a comment.

I made a very similar patch for RISC-V: D92293 <https://reviews.llvm.org/D92293>.

Patching `isSignedOffset` is fine since it fixes more instructions. It is also fine to restrict the lift on t2B currently as you don't have tests for others.



================
Comment at: llvm/test/MC/ARM/thumb2-b.w-target.s:1
+# RUN: llvm-mc -triple=thumbv7 -filetype=obj %s | llvm-objdump --triple=thumbv7 -d - | FileCheck %s
+
----------------
Use consistent comment marker in a test.


================
Comment at: llvm/test/MC/ARM/thumb2-b.w-target.s:5
+
+// arm-linux-gnueabihf-objdump produced
+//	b.w	fffffc <start+0xfffffc>
----------------
No need to say GNU objdump behavior. The specific llvm-objdump tests for the symbolization will do it.


================
Comment at: llvm/test/MC/ARM/thumb2-b.w-target.s:11
+// CHECK-LABEL: start
+// CHECK-NEXT:	b.w	#16777208 <start+0xfffffc>
+// CHECK-NEXT:  b.w	#2 <start+0xa>
----------------
`start+0xfffff` is undeeded detail. There should be specific llvm-objdump tests for the symbolization.


================
Comment at: llvm/test/MC/ARM/thumb2-branch-ranges.s:101
+// CHECK-NOT: error
+// CHECK: [[@LINE+1]]:{{[0-9]}}: error: Relocation out of range
+        b.w start8 - start7 + 0x1000000
----------------
`[[@LINE]]` is deprecated FileCheck syntax.

`[[#@LINE+1]]:[[#]]: error: ...`


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D97568/new/

https://reviews.llvm.org/D97568



More information about the llvm-commits mailing list