[PATCH] D95966: [AIX][support] Implement getHostCPUName

Hubert Tong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 9 11:03:59 PST 2021


hubert.reinterpretcast added inline comments.


================
Comment at: llvm/lib/Support/Host.cpp:1227-1232
+  case POWER_4:
+    return "pwr4";
+  case POWER_5:
+    return "pwr5";
+  case POWER_6:
+    return "pwr6";
----------------
daltenty wrote:
> stevewan wrote:
> > hubert.reinterpretcast wrote:
> > > daltenty wrote:
> > > > daltenty wrote:
> > > > > hubert.reinterpretcast wrote:
> > > > > > I'm not entirely sure that "something is better than nothing" is necessarily true here for these. All three have variant implementations/modes (e.g., ppc970, pwr5x, pwr6e) that we aren't handling here.
> > > > > For pwr5x and pwr6e (IIUC don't think we can actually encounter ppc970), looking at the interfaces it seems that AIX won't distinguish the implementation mode, so I'm not sure if we can easily refine this in those case. Presumably this will still be better than returning 'generic' in those cases though though.
> > > > (Or rather ppc970 would presumable appear as POWER 4)
> > > What I was able to find internally seems to be that the `_system_configuration.version` field is `PV_4_3` for ppc970, `PV_5` exactly for pwr5 (and otherwise indicates pwr5x), and `PV_6_Compat` exactly for pwr6 (i.e., architected mode; and, if not exactly that value, indicates pwr6e).
> > > 
> > > Note that this does make sense with the historical background that POWER 6 went out with new instructions that were not going to be enshrined into the ISA going forward.
> > > `PV_6_Compat` exactly for pwr6 (i.e., architected mode; and, if not exactly that value, indicates pwr6e).
> > 
> > Noted that the accepted change returns `pwr6x` instead of `pwr6e` for versions not matching `PV_6_Compat`. Do we have a reasoning for that?
> Good question. This what it appears to be called for LLVM in `PPC.td`. Why this is the case, I'm not too sure. It's close to what GCC uses (i.e. 'power6x') but our options appear to be incompatible anyway, since we use shortnames and they use long ones, so there's probably a follow on item here if we wanted all the variants of a name to be accepted.
`pwr6x` is a suboption name used by Clang (probably based on GCC's `power6x`). The latter is [[https://gcc.gnu.org/onlinedocs/gcc/Basic-PowerPC-Built-in-Functions-Available-on-all-Configurations.html|documented]] as mainly being about the `mffgpr` and `mftgpr` opcodes. This would therefore map to the `pwr6e` suboption name used by IBM XL. See https://reviews.llvm.org/D58128 for more information.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D95966



More information about the llvm-commits mailing list