[PATCH] D144012: [SPARC][MC] Fix encoding of backwards BPr branches

Koakuma via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 18 16:36:49 PDT 2023


koakuma added inline comments.


================
Comment at: llvm/lib/Target/Sparc/MCTargetDesc/SparcAsmBackend.cpp:167
+          // name                    offset bits  flags
+          {"fixup_sparc_call30", 2, 30, MCFixupKindInfo::FKF_IsPCRel},
+          {"fixup_sparc_br22", 10, 22, MCFixupKindInfo::FKF_IsPCRel},
----------------
jrtc27 wrote:
> Could you please commit this reformatting separately? Combining significant reformatting with functional changes isn't great.
Okay, will remove the formatting changes from this patch.


================
Comment at: llvm/lib/Target/Sparc/MCTargetDesc/SparcAsmBackend.cpp:353
 
+      // Shift the value into position.
+      if (Endian == support::little)
----------------
jrtc27 wrote:
> This seems unrelated?
I put this because I noticed that the offset/size values from the table is not used at all, so the upper part of the fixup bits aren't placed properly.
(This happens on the old version of the patch with split fixup_sparc_br16_2/fixup_sparc_br16_14, at least)

It's basically just adding what other architectures already do (but for some reason hasn't been done here in the SPARC backend)... should I submit this separately?


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

https://reviews.llvm.org/D144012



More information about the llvm-commits mailing list