[PATCH] D9524: [mips] [IAS] Add support for the DLA pseudo-instruction and fix problems with DLI

Vasileios Kalintiris via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 17 03:10:01 PDT 2015


vkalintiris accepted this revision.

================
Comment at: lib/Target/Mips/AsmParser/MipsAsmParser.cpp:2051-2055
@@ -2014,23 +2050,7 @@
+
+  // dla requires 64-bit addresses.
+  if (!Is32BitAddress && !ABI.ArePtrs64bit()) {
+    Error(IDLoc, "instruction requires a 64-bit architecture");
     return true;
-
-  return false;
-}
-
-bool
-MipsAsmParser::expandLoadAddressImm(MCInst &Inst, bool Is32BitImm, SMLoc IDLoc,
-                                    SmallVectorImpl<MCInst> &Instructions) {
-  const MCOperand &DstRegOp = Inst.getOperand(0);
-  assert(DstRegOp.isReg() && "expected register operand kind");
-
-  const MCOperand &ImmOp = Inst.getOperand(1);
-  assert((ImmOp.isImm() || ImmOp.isExpr()) &&
-         "expected immediate operand kind");
-  if (!ImmOp.isImm()) {
-    if (loadAndAddSymbolAddress(ImmOp.getExpr(), DstRegOp.getReg(),
-                                Mips::NoRegister, Is32BitImm, IDLoc,
-                                Instructions))
-      return true;
-
-    return false;
   }
 
----------------
dsanders wrote:
> vkalintiris wrote:
> > Could you add a test for this case? Maybe in macro-la-bad.s?
> > 
> > Also, the following test case currently fails for N32:
> > 
> > ```
> > dla $5, 0x000000000($6)
> > ```
> dla fails for N32 because dla is intended for 64-bit pointers. I believe N32 should use la. Do you agree?
Yes, that makes sense. You can go ahead and commit this.


http://reviews.llvm.org/D9524





More information about the llvm-commits mailing list