From 23b5a6c71eb3229e0456a6900f3672c77b91d1f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Tue, 6 Aug 2024 19:48:01 +0200 Subject: [PATCH] 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. --- lib/std/Target.zig | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/std/Target.zig b/lib/std/Target.zig index dc20d63988..a88e161325 100644 --- a/lib/std/Target.zig +++ b/lib/std/Target.zig @@ -1875,11 +1875,10 @@ pub fn ptrBitWidth_cpu_abi(cpu: Cpu, abi: Abi) u16 { .sparc64, .s390x, .ve, + .spirv, .spirv64, .loongarch64, => 64, - - .spirv => @panic("TODO what should this value be?"), }; } @@ -2359,6 +2358,7 @@ pub fn c_type_alignment(target: Target, c_type: CType) u16 { .nvptx, .nvptx64, .s390x, + .spirv, .spirv32, .spirv64, => 8, @@ -2380,8 +2380,6 @@ pub fn c_type_alignment(target: Target, c_type: CType) u16 { .wasm32, .wasm64, => 16, - - .spirv => @panic("TODO what should this value be?"), }), ); } @@ -2471,6 +2469,7 @@ pub fn c_type_preferred_alignment(target: Target, c_type: CType) u16 { .nvptx, .nvptx64, .s390x, + .spirv, .spirv32, .spirv64, => 8, @@ -2492,8 +2491,6 @@ pub fn c_type_preferred_alignment(target: Target, c_type: CType) u16 { .wasm32, .wasm64, => 16, - - .spirv => @panic("TODO what should this value be?"), }), ); }