[PATCH] D94627: [PowerPC][PC Rel] Implement option to omit P10 instructions from stubs

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 27 17:14:45 PST 2021


MaskRay added a comment.

> Implement option to omit P10 <https://reviews.llvm.org/P10> instructions from stubs

Please mention the option name directly.
Please avoid P10 <https://reviews.llvm.org/P10> - the abbreviation is confusing.



================
Comment at: lld/ELF/Config.h:74
+// For --power10-stub
+enum class P10Stub { Default, No };
+
----------------
In this case it can be a simple boolean


================
Comment at: lld/ELF/Driver.cpp:767
+
+  // This handles the --no-power10-stubs option.
+  
----------------
Delete the comment. it is not useful


================
Comment at: lld/ELF/Driver.cpp:770
+
+  StringRef SelectedOpt = args.getLastArgValue(OPT_power10_stubs_eq);
+
----------------
`value`


================
Comment at: lld/ELF/Thunks.cpp:1005
+    nextInstOffset = 8;
+  } else { //CONVERT
+    uint32_t off = destination.getVA(addend) - getThunkTargetSym()->getVA() - 8;
----------------
Delete the stray comment or clarify.


================
Comment at: lld/ELF/Thunks.cpp:1052
+  int nextInstOffset;
+  if (config->Power10Stub == P10Stub::No) { //CONVERT
+    uint32_t off = destination.getVA(addend) - getThunkTargetSym()->getVA() - 8;
----------------
Delete the stray comment or clarify.


================
Comment at: lld/ELF/Thunks.cpp:1058
+    write32(buf + 12, 0x7d8803a6);                     // mtlr r12
+    write32(buf + 16, 0x3d8b0000 | computeHiBits(off));// addis r12,r11,off at ha
+    write32(buf + 20, 0x398c0000 | (off & 0xffff));    // addi r12,r12,off at l
----------------
space before `//`


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

https://reviews.llvm.org/D94627



More information about the cfe-commits mailing list