LLVM: zeroext/signext does happen on macos

Fixes a regression introduced in 3ce7fee9dd8bbb6f56e47758a9a8ada028400c71.
This commit is contained in:
Andrew Kelley 2024-05-01 18:57:09 -07:00
parent 7e1cba73fc
commit e9efed9ed1

View File

@ -11577,30 +11577,36 @@ fn ccAbiPromoteInt(
.Int, .Enum, .ErrorSet => ty.intInfo(mod),
else => return null,
};
return switch (target.cpu.arch) {
.riscv64 => switch (int_info.bits) {
0...16 => int_info.signedness,
32 => .signed, // LLVM always signextends 32 bit ints, unsure if bug.
17...31, 33...63 => int_info.signedness,
else => null,
},
.sparc64,
.powerpc64,
.powerpc64le,
=> switch (int_info.bits) {
0...63 => int_info.signedness,
else => null,
},
.aarch64,
.aarch64_be,
=> null,
else => switch (int_info.bits) {
return switch (target.os.tag) {
.macos => switch (int_info.bits) {
0...16 => int_info.signedness,
else => null,
},
else => switch (target.cpu.arch) {
.riscv64 => switch (int_info.bits) {
0...16 => int_info.signedness,
32 => .signed, // LLVM always signextends 32 bit ints, unsure if bug.
17...31, 33...63 => int_info.signedness,
else => null,
},
.sparc64,
.powerpc64,
.powerpc64le,
=> switch (int_info.bits) {
0...63 => int_info.signedness,
else => null,
},
.aarch64,
.aarch64_be,
=> null,
else => switch (int_info.bits) {
0...16 => int_info.signedness,
else => null,
},
},
};
}