authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-06-19 11:48:14+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-06-19 11:48:14+02:00
log513b395f7f553e5caa3087d17c04f46b8bb407ef
tree6a85306cc4956092f43f7260e9989e8946c6b122
parent787a2c9d7a5fd0f6aaa10a406cda5bd2f4eb33a7
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

llvm: fix C ABI lowering for x32

closes https://codeberg.org/ziglang/zig/issues/35838

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

src/codegen/llvm/FuncGen.zig+3-3
...@@ -6663,7 +6663,7 @@ const ParamTypeIterator = struct {...@@ -6663,7 +6663,7 @@ const ParamTypeIterator = struct {
6663 .async => {6663 .async => {
6664 @panic("TODO implement async function lowering in the LLVM backend");6664 @panic("TODO implement async function lowering in the LLVM backend");
6665 },6665 },
6666 .x86_64_sysv => return it.nextSystemV(ty),6666 .x86_64_sysv, .x86_64_x32 => return it.nextSystemV(ty),
6667 .x86_64_win => return it.nextWin64(ty),6667 .x86_64_win => return it.nextWin64(ty),
6668 .x86_stdcall => {6668 .x86_stdcall => {
6669 it.zig_index += 1;6669 it.zig_index += 1;
...@@ -6940,7 +6940,7 @@ pub fn firstParamSRet(fn_info: InternPool.Key.FuncType, zcu: *Zcu, target: *cons...@@ -6940,7 +6940,7 @@ pub fn firstParamSRet(fn_info: InternPool.Key.FuncType, zcu: *Zcu, target: *cons
69406940
6941 return switch (fn_info.cc) {6941 return switch (fn_info.cc) {
6942 .auto => returnTypeByRef(zcu, target, return_type),6942 .auto => returnTypeByRef(zcu, target, return_type),
6943 .x86_64_sysv => firstParamSRetSystemV(return_type, zcu, target),6943 .x86_64_sysv, .x86_64_x32 => firstParamSRetSystemV(return_type, zcu, target),
6944 .x86_64_win => x86_64_abi.classifyWindows(return_type, zcu, target, .ret) == .memory,6944 .x86_64_win => x86_64_abi.classifyWindows(return_type, zcu, target, .ret) == .memory,
6945 .x86_sysv, .x86_win => isByRef(return_type, zcu),6945 .x86_sysv, .x86_win => isByRef(return_type, zcu),
6946 .x86_stdcall => !isScalar(zcu, return_type),6946 .x86_stdcall => !isScalar(zcu, return_type),
...@@ -6999,7 +6999,7 @@ pub fn lowerFnRetTy(o: *Object, fn_info: InternPool.Key.FuncType) Allocator.Erro...@@ -6999,7 +6999,7 @@ pub fn lowerFnRetTy(o: *Object, fn_info: InternPool.Key.FuncType) Allocator.Erro
6999 switch (fn_info.cc) {6999 switch (fn_info.cc) {
7000 .@"inline" => unreachable,7000 .@"inline" => unreachable,
7001 .auto => return if (returnTypeByRef(zcu, target, return_type)) .void else o.lowerType(return_type),7001 .auto => return if (returnTypeByRef(zcu, target, return_type)) .void else o.lowerType(return_type),
7002 .x86_64_sysv => return lowerSystemVFnRetTy(o, fn_info),7002 .x86_64_sysv, .x86_64_x32 => return lowerSystemVFnRetTy(o, fn_info),
7003 .x86_64_win => return lowerWin64FnRetTy(o, fn_info),7003 .x86_64_win => return lowerWin64FnRetTy(o, fn_info),
7004 .x86_stdcall => return if (isScalar(zcu, return_type)) o.lowerType(return_type) else .void,7004 .x86_stdcall => return if (isScalar(zcu, return_type)) o.lowerType(return_type) else .void,
7005 .x86_fastcall => return lowerX86FastcallFnRetTy(o, zcu, return_type),7005 .x86_fastcall => return lowerX86FastcallFnRetTy(o, zcu, return_type),