[PATCH] D130272: [Support] Handle SPARC in sys::getHostCPUName

Rainer Orth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 26 12:51:06 PDT 2022


ro added a comment.

In D130272#3680084 <https://reviews.llvm.org/D130272#3680084>, @efriedma wrote:

> LGTM, but I don't really know enough to review the Solaris-specific bits.

They are taken straight from my 2011 GCC patch (and follow-ups) <http://gcc.gnu.org/ml/gcc-patches/2011-07/msg02394.html> that introduced the code in `gcc/config/sparc/driver-sparc.cc`.  I've just adapted them to match LLVM coding conventions as far as necessary.

In D130272#3680192 <https://reviews.llvm.org/D130272#3680192>, @MaskRay wrote:

> The code style looks good to me, but I cannot verify the list. @glaubitz should have sparc machines and perform some verification.

Both lists are straight from `driver-sparc.cc`, with the noted exceptions of not emitting CPU types LLVM doesn't support (yet?).  On the Linux/sparc64 side I've meanwhile set up a Debian 11 LDom on a SPARC Enterprise T5220, where the values also match.  In addition, I've looked at current Linux kernel sources (`arch/sparc/kernel/cpu.c`, `arch/sparc/include/asm/spitfire.h`) and found three unhandled CPUs:

- `SPARC-M6`: might be handled as `niagara4`; GCC knows nothing about this
- `SPARC-SN`: never even heard of this
- `SPARC64-X`: Fujitsu SPARC CPU, no idea how to handle this either

Unless someone else can chime in on those, I'd leave them alone.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D130272



More information about the llvm-commits mailing list