aboutsummaryrefslogtreecommitdiff
path: root/src/type.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2024-04-30 19:51:35 -0700
committerAndrew Kelley <andrew@ziglang.org>2024-05-08 19:37:29 -0700
commit200e06b2399d605c8d183e55649e39ba2c6b56f6 (patch)
tree9bdd2acf67740b9de522545abb8684e602181d22 /src/type.zig
parent927f24a6ff4af55f79df54c392b906413eae1459 (diff)
downloadzig-200e06b2399d605c8d183e55649e39ba2c6b56f6.tar.gz
zig-200e06b2399d605c8d183e55649e39ba2c6b56f6.zip
update maxIntAlignment for x86 to 16
LLVMABIAlignmentOfType(i128) reports 16 on this target, however the C ABI uses align(4). Clang in LLVM 17 does this: %struct.foo = type { i32, i128 } Clang in LLVM 18 does this: %struct.foo = type <{ i32, i128 }> Clang is working around the 16-byte alignment to use align(4) for the C ABI by making the LLVM struct packed.
Diffstat (limited to 'src/type.zig')
-rw-r--r--src/type.zig6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/type.zig b/src/type.zig
index 9fe95f99f7..2afff730a7 100644
--- a/src/type.zig
+++ b/src/type.zig
@@ -1572,11 +1572,6 @@ pub const Type = struct {
.wasm64,
=> 8,
- .x86 => if (target.ofmt == .c) 16 else return switch (target.os.tag) {
- .windows, .uefi => 8,
- else => 4,
- },
-
// For these, LLVMABIAlignmentOfType(i128) reports 8. Note that 16
// is a relevant number in three cases:
// 1. Different machine code instruction when loading into SIMD register.
@@ -1599,6 +1594,7 @@ pub const Type = struct {
},
// Even LLVMABIAlignmentOfType(i128) agrees on these targets.
+ .x86,
.aarch64,
.aarch64_be,
.aarch64_32,