[PATCH] D45020: [mips] Accept 32-bit offsets for lb and lbu commands

Simon Dardis via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 4 05:43:35 PDT 2018


sdardis added a comment.

I don't think this is quite the correct approach, especially if you're going to be implementing support for 64-bit pointers with those instructions, as we would need to modify the existing lb64 and friends to be available to the AsmParser with a different set of operands.

Instead, we should use the 'mem' operand for the lb and lbu instructions. That will allow the parser to match larger offsets than those instructions permit.

Then in MipsAsmParser during the expansion of the instruction, we can check the size of the offset and error out there if >32 bits. There's currently a bug there in that offsets are truncated to signed 32bit values before checking if they're out of range.

The other instructions in the base MIPS architecture which appear to have this issue are: ld, lh, lhu and sd.


Repository:
  rL LLVM

https://reviews.llvm.org/D45020





More information about the llvm-commits mailing list