[PATCH] D34618: [LLD] Add basic 64-bit SPARC support

James Y Knight via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 26 12:21:22 PDT 2017


jyknight added inline comments.


================
Comment at: lld/ELF/Arch/SPARCV9.cpp:44
+
+  PageSize = 8192;
+  DefaultMaxPageSize = 0x100000;
----------------
fedor.sergeev wrote:
> kettenis wrote:
> > ruiu wrote:
> > > Is SPARC always 8k page?
> > Yes, for SPARV9 the minumum page size is 8k. Older (32-bit only) SPARV7 processor supported smaller page sizes. That hardware is now more than 20 years old and pretty much dead.  OpenBSD doesn't support 32-bit SPARC anymore, so I didn't write any code for it.  But if somebody else is interested in doing that, bits of the SPARCV9 code could be re-used.
> Yep, 8K page size is minimum.
> As for 32-bit SPARC - we on Solaris will be rather interested in getting V8 code later.
> Thanks for doing V9! :)
Just to keep the record straight, SparcV8 (via the LEON4 chip and others) is _far_ from dead. It sees quite active use in embedded processors, including ones still being developed and produced today.

Possibly it'll be dead someday, but that day has not yet come.

(Note, I do _not_ mean to imply any objection to this patch supporting only sparcv9 to start with).


================
Comment at: lld/ELF/Arch/SPARCV9.cpp:86
+    checkUInt<32>(Loc, Val, Type);
+    write32be(Loc, Val);
+    break;
----------------
kettenis wrote:
> ruiu wrote:
> > Is SPARCV9 big-endian only?
> Instruction access is always big-endian. In theory it is possible to run the processor in a mode where the default data access is little-endian, which could affect some of the relocations listed here. In practice nobody ever supported this. The GNU toolchain only ever supported little-endian 32-bit SPARC using the a.out format.
Little-endian sparcv8 exists in the wild, and is supported and used in clang upstream.

However, AFAIK, nobody has ever built a little-endian SparcV9 system. (and, I suspect, probably never will).



https://reviews.llvm.org/D34618





More information about the llvm-commits mailing list