[llvm] [M68k] add 32 bit branch instrs and relaxations (PR #117371)

Min-Yih Hsu via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 11 08:52:56 PST 2024


================
@@ -166,26 +225,37 @@ bool M68kAsmBackend::mayNeedRelaxation(const MCInst &Inst,
 }
 
 bool M68kAsmBackend::fixupNeedsRelaxation(const MCFixup &Fixup,
-                                          uint64_t Value) const {
-  // TODO Newer CPU can use 32 bit offsets, so check for this when ready
-  if (!isInt<16>(Value)) {
+                                          uint64_t UnsignedValue) const {
+  int64_t Value = static_cast<int64_t>(UnsignedValue);
+
+  if (!isInt<32>(Value) || (!Allows32BitBranch && !isInt<16>(Value))) {
----------------
mshockwave wrote:

nit: I know the curly braces were already here, but could you drop them? (single statement shouldn't have curly braces)

https://github.com/llvm/llvm-project/pull/117371


More information about the llvm-commits mailing list