authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-08-06 19:48:01+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-08-06 20:17:03+02:00
log23b5a6c71eb3229e0456a6900f3672c77b91d1f6
treeb9bb5fe16896ce16d15ed6f834f926a37882bc46
parent231f322a65acd353e4a88907cea7621b6adc2c4b
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

std.Target: Treat spirv as identical to spirv64 for ABI size/alignment purposes.

This is arbitrary since spirv (as opposed to spirv32/spirv64) refers to the version with logical memory layout, i.e. no 'real' pointers. This change at least matches what clang does.

1 files changed, 3 insertions(+), 6 deletions(-)

lib/std/Target.zig+3-6
......@@ -1875,11 +1875,10 @@ pub fn ptrBitWidth_cpu_abi(cpu: Cpu, abi: Abi) u16 {
18751875 .sparc64,
18761876 .s390x,
18771877 .ve,
1878 .spirv,
18781879 .spirv64,
18791880 .loongarch64,
18801881 => 64,
1881
1882 .spirv => @panic("TODO what should this value be?"),
18831882 };
18841883}
18851884
......@@ -2359,6 +2358,7 @@ pub fn c_type_alignment(target: Target, c_type: CType) u16 {
23592358 .nvptx,
23602359 .nvptx64,
23612360 .s390x,
2361 .spirv,
23622362 .spirv32,
23632363 .spirv64,
23642364 => 8,
......@@ -2380,8 +2380,6 @@ pub fn c_type_alignment(target: Target, c_type: CType) u16 {
23802380 .wasm32,
23812381 .wasm64,
23822382 => 16,
2383
2384 .spirv => @panic("TODO what should this value be?"),
23852383 }),
23862384 );
23872385}
......@@ -2471,6 +2469,7 @@ pub fn c_type_preferred_alignment(target: Target, c_type: CType) u16 {
24712469 .nvptx,
24722470 .nvptx64,
24732471 .s390x,
2472 .spirv,
24742473 .spirv32,
24752474 .spirv64,
24762475 => 8,
......@@ -2492,8 +2491,6 @@ pub fn c_type_preferred_alignment(target: Target, c_type: CType) u16 {
24922491 .wasm32,
24932492 .wasm64,
24942493 => 16,
2495
2496 .spirv => @panic("TODO what should this value be?"),
24972494 }),
24982495 );
24992496}