[llvm] MIPS: fix emitDirectiveCpsetup on N32 (PR #80534)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 24 00:53:51 PST 2024


================
@@ -1288,8 +1291,11 @@ void MipsTargetELFStreamer::emitDirectiveCpsetup(unsigned RegNo,
   emitRRX(Mips::ADDiu, GPReg, GPReg, MCOperand::createExpr(LoExpr), SMLoc(),
           &STI);
 
-  // daddu  $gp, $gp, $funcreg
-  emitRRR(Mips::DADDu, GPReg, GPReg, RegNo, SMLoc(), &STI);
+  // (d)addu  $gp, $gp, $funcreg
+  if (getABI().IsN32())
+    emitRRR(Mips::ADDu, GPReg, GPReg, RegNo, SMLoc(), &STI);
----------------
MaskRay wrote:

Confirmed that this is correct.

https://github.com/llvm/llvm-project/pull/80534


More information about the llvm-commits mailing list