================
@@ -3124,6 +3125,36 @@ bool PPCInstrInfo::expandPostRAPseudo(MachineInstr &MI) 
const {
         .addReg(Reg);
     return true;
   }
+  case PPC::PPCLdFixedAddr: {
+    assert(Subtarget.isTargetLinux() &&
+           "Only Linux target is expected to contain PPCLdFixedAddr");
+    int64_t Offset = 0;
+    const unsigned Reg = Subtarget.isPPC64() ? PPC::X13 : PPC::R2;
+    MI.setDesc(get(PPC::LWZ));
+    uint64_t FAType = MI.getOperand(1).getImm();
+#undef PPC_FEATURE
+#undef PPC_CPU
+#include "llvm/TargetParser/PPCTargetParser.def"
+    // The HWCAP and HWCAP2 word offsets are reversed on big endian Linux.
+    if ((FAType == PPC_FAWORD_HWCAP && Subtarget.isLittleEndian()) ||
+        (FAType == PPC_FAWORD_HWCAP2 && !Subtarget.isLittleEndian()))
+      Offset = Subtarget.isPPC64() ? -0x7064 : -0x703C;
----------------
diggerlin wrote:

suggest do not use integer here, it is not easy to know what the 0x7064 stand 
for.  please using a `constexpr int  Name=-0x7064` to explain what is the 
-0x7064 stand for.

https://github.com/llvm/llvm-project/pull/68919
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to