[PATCH] [mips] Expand JAL instructions when PIC is enabled.

Daniel Sanders daniel.sanders at imgtec.com
Thu Jan 29 08:48:26 PST 2015


================
Comment at: lib/Target/Mips/AsmParser/MipsAsmParser.cpp:1378-1387
@@ +1377,12 @@
+        LwInst.addOperand(MCOperand::CreateReg(Mips::GP));
+        if (inMicroMipsMode()) {
+          const MCSymbolRefExpr *GotDispRelocSymExpr = MCSymbolRefExpr::Create(
+              JalSym.getName(), MCSymbolRefExpr::VK_Mips_GOT_DISP,
+              getContext());
+          LwInst.addOperand(MCOperand::CreateExpr(GotDispRelocSymExpr));
+        } else {
+          const MCSymbolRefExpr *GotDispRelocSymExpr = MCSymbolRefExpr::Create(
+              ".text", MCSymbolRefExpr::VK_Mips_GOT_DISP, getContext());
+          LwInst.addOperand(MCOperand::CreateExpr(GotDispRelocSymExpr));
+        }
+        Instructions.push_back(LwInst);
----------------
dsanders wrote:
> Same as above
> Same as above

(I mean the above JalSym comment, not the N64 one)

http://reviews.llvm.org/D6231

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list