[PATCH] D14770: [mips][microMIPS] Fix issue with offset operand of BALC and BC instructions

Daniel Sanders via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 27 02:01:56 PST 2015


dsanders accepted this revision.
dsanders added a comment.
This revision is now accepted and ready to land.

LGTM with a couple nits


================
Comment at: lib/Target/Mips/Disassembler/MipsDisassembler.cpp:1869
@@ +1868,3 @@
+  const void *Decoder) {
+  int32_t BranchOffset = SignExtend32<26>(Offset) * 2;
+
----------------
They're functionally the same thing but I'd slightly prefer '<< 1' over '* 2' since we're talking about shifting bits rather than arithmetic.

================
Comment at: lib/Target/Mips/MCTargetDesc/MipsMCCodeEmitter.cpp:356-359
@@ +355,6 @@
+/// record the relocation and return zero.
+unsigned MipsMCCodeEmitter::
+getBranchTarget26OpValueMM(const MCInst &MI, unsigned OpNo,
+SmallVectorImpl<MCFixup> &Fixups,
+const MCSubtargetInfo &STI) const {
+
----------------
Please format as clang-format would.


http://reviews.llvm.org/D14770





More information about the llvm-commits mailing list