aboutsummaryrefslogtreecommitdiff
path: root/src/target.zig
diff options
context:
space:
mode:
authorAlex Rønne Petersen <alex@alexrp.com>2024-07-30 02:31:25 +0200
committerAlex Rønne Petersen <alex@alexrp.com>2024-07-30 06:30:25 +0200
commitc8ca05e93a5ad482279c9dd95e330ed6c1027c3b (patch)
treec80cd59dea5f48141fa3c5d81889473cde1a0d66 /src/target.zig
parent1e9278d718f7eec0aaad4dc296757c70e7f0f68b (diff)
downloadzig-c8ca05e93a5ad482279c9dd95e330ed6c1027c3b.tar.gz
zig-c8ca05e93a5ad482279c9dd95e330ed6c1027c3b.zip
std.Target: Remove `sparcel` architecture tag.
What is `sparcel`, you might ask? Good question! If you take a peek in the SPARC v8 manual, §2.2, it is quite explicit that SPARC v8 is a big-endian architecture. No little-endian or mixed-endian support to be found here. On the other hand, the SPARC v9 manual, in §3.2.1.2, states that it has support for mixed-endian operation, with big-endian mode being the default. Ok, so `sparcel` must just be referring to SPARC v9 running in little-endian mode, surely? Nope: * https://github.com/llvm/llvm-project/blob/40b4fd7a3e81d32b29364a1b15337bcf817659c0/llvm/lib/Target/Sparc/SparcTargetMachine.cpp#L226 * https://github.com/llvm/llvm-project/blob/40b4fd7a3e81d32b29364a1b15337bcf817659c0/llvm/lib/Target/Sparc/SparcTargetMachine.cpp#L104 So, `sparcel` in LLVM is referring to some sort of fantastical little-endian SPARC v8 architecture. I've scoured the internet and I can find absolutely no evidence that such a thing exists or has ever existed. In fact, I can find no evidence that a little-endian implementation of SPARC v9 ever existed, either. Or any SPARC version, actually! The support was added here: https://reviews.llvm.org/D8741 Notably, there is no mention whatsoever of what CPU this might be referring to, and no justification given for the "but some are little" comment added in the patch. My best guess is that this might have been some private exercise in creating a little-endian version of SPARC that never saw the light of day. Given that SPARC v8 explicitly doesn't support little-endian operation (let alone little-endian instruction encoding!), and no CPU is known to be implemented as such, I think it's very reasonable for us to just remove this support.
Diffstat (limited to 'src/target.zig')
-rw-r--r--src/target.zig4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/target.zig b/src/target.zig
index e30743f65c..62f3e52cb8 100644
--- a/src/target.zig
+++ b/src/target.zig
@@ -138,7 +138,6 @@ pub fn hasLlvmSupport(target: std.Target, ofmt: std.Target.ObjectFormat) bool {
.riscv64,
.sparc,
.sparc64,
- .sparcel,
.s390x,
.thumb,
.thumbeb,
@@ -408,7 +407,7 @@ pub fn defaultFunctionAlignment(target: std.Target) Alignment {
return switch (target.cpu.arch) {
.arm, .armeb => .@"4",
.aarch64, .aarch64_be => .@"4",
- .sparc, .sparcel, .sparc64 => .@"4",
+ .sparc, .sparc64 => .@"4",
.riscv64 => .@"2",
else => .@"1",
};
@@ -423,7 +422,6 @@ pub fn minFunctionAlignment(target: std.Target) Alignment {
.riscv32,
.riscv64,
.sparc,
- .sparcel,
.sparc64,
=> .@"2",
else => .@"1",