authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-08-06 15:51:40+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-08-06 20:17:03+02:00
logdb8f00e277016e12495bcc5217090052eea69eb3
tree9d452d6739856f69173fc73286e4f5f39b82b038
parentab154be7f0a89b271686d740f7e50545414a6024
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

std.Target: Fix ptrBitWidth_cpu_abi() for sparc32.

CPU feature set has nothing to do with ABI choice; the pointer bit width is determined only by looking at the choice of sparc vs sparc64.

1 files changed, 1 insertions(+), 2 deletions(-)

lib/std/Target.zig+1-2
...@@ -1852,6 +1852,7 @@ pub fn ptrBitWidth_cpu_abi(cpu: Cpu, abi: Abi) u16 {...@@ -1852,6 +1852,7 @@ pub fn ptrBitWidth_cpu_abi(cpu: Cpu, abi: Abi) u16 {
1852 .kalimba,1852 .kalimba,
1853 .lanai,1853 .lanai,
1854 .wasm32,1854 .wasm32,
1855 .sparc,
1855 .spirv32,1856 .spirv32,
1856 .loongarch32,1857 .loongarch32,
1857 .xtensa,1858 .xtensa,
...@@ -1878,8 +1879,6 @@ pub fn ptrBitWidth_cpu_abi(cpu: Cpu, abi: Abi) u16 {...@@ -1878,8 +1879,6 @@ pub fn ptrBitWidth_cpu_abi(cpu: Cpu, abi: Abi) u16 {
1878 .loongarch64,1879 .loongarch64,
1879 => 64,1880 => 64,
18801881
1881 .sparc => if (std.Target.sparc.featureSetHas(cpu.features, .v9)) 64 else 32,
1882
1883 .spirv => @panic("TODO what should this value be?"),1882 .spirv => @panic("TODO what should this value be?"),
1884 };1883 };
1885}1884}