[PATCH] D73664: [PowerPC][Future] Add Support For Functions That Do Not Use A TOC.

Anil Mahmud via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 4 18:31:28 PST 2020


anil9 added inline comments.


================
Comment at: llvm/lib/Target/PowerPC/MCTargetDesc/PPCAsmBackend.cpp:107
       { "fixup_ppc_br24",        2,      24,   MCFixupKindInfo::FKF_IsPCRel },
+      { "fixup_ppc_br24_notoc",  2,      24,   MCFixupKindInfo::FKF_IsPCRel },
       { "fixup_ppc_brcond14",    2,      14,   MCFixupKindInfo::FKF_IsPCRel },
----------------
Similar to the changes you made to this file, should you also be changing the function "shouldForceRelocation"


================
Comment at: llvm/lib/Target/PowerPC/MCTargetDesc/PPCELFObjectWriter.cpp:85
     case PPC::fixup_ppc_br24:
     case PPC::fixup_ppc_br24abs:
       switch (Modifier) {
----------------
Was wondering if you should be adding the case "case PPC::fixup_ppc_br24_notoc:" here or not.


================
Comment at: llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp:246
+      return 1 << ELF::STO_PPC64_LOCAL_BIT;
+    case 4:
+      return 2 << ELF::STO_PPC64_LOCAL_BIT;
----------------
If you really need to use log2, you can separate out the case of 0,1 and then use log2 or 4,8 ..... 64. 
But yes the error message still has to specify more information since 2 & 128 and above are not allowed and also 2^-(inf) = 0 is allowed.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73664/new/

https://reviews.llvm.org/D73664





More information about the llvm-commits mailing list