authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-01-24 01:34:29+01:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-02-17 19:17:56+01:00
log9c015e6c2b7b153f1a5897caf872a9428f232b47
tree5c2b55dc3cbc03183407b399d26492ae6cfc7de8
parent2fe32ef847dd2f19113b86036357beeddbd08f05
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

std.builtin: Remove CallingConvention.arm_(apcs,aapcs16_vfp).

* arm_apcs is the long dead "OABI" which we never had working support for. * arm_aapcs16_vfp is for arm-watchos-none which is a dead target that we've dropped support for.

8 files changed, 9 insertions(+), 34 deletions(-)

lib/std/Target.zig-2
...@@ -1753,10 +1753,8 @@ pub const Cpu = struct {...@@ -1753,10 +1753,8 @@ pub const Cpu = struct {
1753 .aarch64_vfabi_sve,1753 .aarch64_vfabi_sve,
1754 => &.{ .aarch64, .aarch64_be },1754 => &.{ .aarch64, .aarch64_be },
17551755
1756 .arm_apcs,
1757 .arm_aapcs,1756 .arm_aapcs,
1758 .arm_aapcs_vfp,1757 .arm_aapcs_vfp,
1759 .arm_aapcs16_vfp,
1760 .arm_interrupt,1758 .arm_interrupt,
1761 => &.{ .arm, .armeb, .thumb, .thumbeb },1759 => &.{ .arm, .armeb, .thumb, .thumbeb },
17621760
lib/std/builtin.zig-6
...@@ -220,8 +220,6 @@ pub const CallingConvention = union(enum(u8)) {...@@ -220,8 +220,6 @@ pub const CallingConvention = union(enum(u8)) {
220 };220 };
221 /// Deprecated; use `.x86_thiscall`.221 /// Deprecated; use `.x86_thiscall`.
222 pub const Thiscall: CallingConvention = .{ .x86_thiscall = .{} };222 pub const Thiscall: CallingConvention = .{ .x86_thiscall = .{} };
223 /// Deprecated; do not use.
224 pub const APCS: CallingConvention = .{ .arm_apcs = .{} };
225 /// Deprecated; use `.arm_aapcs`.223 /// Deprecated; use `.arm_aapcs`.
226 pub const AAPCS: CallingConvention = .{ .arm_aapcs = .{} };224 pub const AAPCS: CallingConvention = .{ .arm_aapcs = .{} };
227 /// Deprecated; use `.arm_aapcs_vfp`.225 /// Deprecated; use `.arm_aapcs_vfp`.
...@@ -284,14 +282,10 @@ pub const CallingConvention = union(enum(u8)) {...@@ -284,14 +282,10 @@ pub const CallingConvention = union(enum(u8)) {
284 aarch64_vfabi_sve: CommonOptions,282 aarch64_vfabi_sve: CommonOptions,
285283
286 // Calling convetions for the `arm`, `armeb`, `thumb`, and `thumbeb` architectures.284 // Calling convetions for the `arm`, `armeb`, `thumb`, and `thumbeb` architectures.
287 /// Deprecated; do not use.
288 arm_apcs: CommonOptions, // Removal of `arm_apcs` is blocked by #21842.
289 /// ARM Architecture Procedure Call Standard285 /// ARM Architecture Procedure Call Standard
290 arm_aapcs: CommonOptions,286 arm_aapcs: CommonOptions,
291 /// ARM Architecture Procedure Call Standard Vector Floating-Point287 /// ARM Architecture Procedure Call Standard Vector Floating-Point
292 arm_aapcs_vfp: CommonOptions,288 arm_aapcs_vfp: CommonOptions,
293 /// Deprecated; do not use.
294 arm_aapcs16_vfp: CommonOptions, // Removal of `arm_aapcs16_vfp` is blocked by #21842.
295 arm_interrupt: ArmInterruptOptions,289 arm_interrupt: ArmInterruptOptions,
296290
297 // Calling conventions for the `mips64` and `mips64el` architectures.291 // Calling conventions for the `mips64` and `mips64el` architectures.
src/Sema.zig-2
...@@ -9407,10 +9407,8 @@ const calling_conventions_supporting_var_args = [_]std.builtin.CallingConvention...@@ -9407,10 +9407,8 @@ const calling_conventions_supporting_var_args = [_]std.builtin.CallingConvention
9407 .aarch64_aapcs_win,9407 .aarch64_aapcs_win,
9408 .aarch64_vfabi,9408 .aarch64_vfabi,
9409 .aarch64_vfabi_sve,9409 .aarch64_vfabi_sve,
9410 .arm_apcs,
9411 .arm_aapcs,9410 .arm_aapcs,
9412 .arm_aapcs_vfp,9411 .arm_aapcs_vfp,
9413 .arm_aapcs16_vfp,
9414 .mips64_n64,9412 .mips64_n64,
9415 .mips64_n32,9413 .mips64_n32,
9416 .mips_o32,9414 .mips_o32,
src/Zcu.zig+1-3
...@@ -4209,9 +4209,7 @@ pub fn callconvSupported(zcu: *Zcu, cc: std.builtin.CallingConvention) union(enu...@@ -4209,9 +4209,7 @@ pub fn callconvSupported(zcu: *Zcu, cc: std.builtin.CallingConvention) union(enu
4209 => |opts| opts.incoming_stack_alignment == null,4209 => |opts| opts.incoming_stack_alignment == null,
42104210
4211 .arm_aapcs_vfp,4211 .arm_aapcs_vfp,
4212 => |opts| opts.incoming_stack_alignment == null and target.os.tag != .watchos,4212 => |opts| opts.incoming_stack_alignment == null,
4213 .arm_aapcs16_vfp,
4214 => |opts| opts.incoming_stack_alignment == null and target.os.tag == .watchos,
42154213
4216 .arm_interrupt,4214 .arm_interrupt,
4217 => |opts| opts.incoming_stack_alignment == null,4215 => |opts| opts.incoming_stack_alignment == null,
src/codegen/c.zig+1-1
...@@ -7725,7 +7725,7 @@ fn toCallingConvention(cc: std.builtin.CallingConvention, zcu: *Zcu) ?[]const u8...@@ -7725,7 +7725,7 @@ fn toCallingConvention(cc: std.builtin.CallingConvention, zcu: *Zcu) ?[]const u8
7725 .aarch64_vfabi_sve => "aarch64_sve_pcs",7725 .aarch64_vfabi_sve => "aarch64_sve_pcs",
77267726
7727 .arm_aapcs => "pcs(\"aapcs\")",7727 .arm_aapcs => "pcs(\"aapcs\")",
7728 .arm_aapcs_vfp, .arm_aapcs16_vfp => "pcs(\"aapcs-vfp\")",7728 .arm_aapcs_vfp => "pcs(\"aapcs-vfp\")",
77297729
7730 .arm_interrupt => |opts| switch (opts.type) {7730 .arm_interrupt => |opts| switch (opts.type) {
7731 .generic => "interrupt",7731 .generic => "interrupt",
src/codegen/llvm.zig+4-12
...@@ -11766,16 +11766,8 @@ fn toLlvmCallConvTag(cc_tag: std.builtin.CallingConvention.Tag, target: std.Targ...@@ -11766,16 +11766,8 @@ fn toLlvmCallConvTag(cc_tag: std.builtin.CallingConvention.Tag, target: std.Targ
11766 .x86_interrupt => .x86_intrcc,11766 .x86_interrupt => .x86_intrcc,
11767 .aarch64_vfabi => .aarch64_vector_pcs,11767 .aarch64_vfabi => .aarch64_vector_pcs,
11768 .aarch64_vfabi_sve => .aarch64_sve_vector_pcs,11768 .aarch64_vfabi_sve => .aarch64_sve_vector_pcs,
11769 .arm_apcs => .arm_apcscc,
11770 .arm_aapcs => .arm_aapcscc,11769 .arm_aapcs => .arm_aapcscc,
11771 .arm_aapcs_vfp => if (target.os.tag != .watchos)11770 .arm_aapcs_vfp => .arm_aapcs_vfpcc,
11772 .arm_aapcs_vfpcc
11773 else
11774 null,
11775 .arm_aapcs16_vfp => if (target.os.tag == .watchos)
11776 .arm_aapcs_vfpcc
11777 else
11778 null,
11779 .riscv64_lp64_v => .riscv_vectorcallcc,11771 .riscv64_lp64_v => .riscv_vectorcallcc,
11780 .riscv32_ilp32_v => .riscv_vectorcallcc,11772 .riscv32_ilp32_v => .riscv_vectorcallcc,
11781 .avr_builtin => .avr_builtincc,11773 .avr_builtin => .avr_builtincc,
...@@ -12001,7 +11993,7 @@ fn firstParamSRet(fn_info: InternPool.Key.FuncType, zcu: *Zcu, target: std.Targe...@@ -12001,7 +11993,7 @@ fn firstParamSRet(fn_info: InternPool.Key.FuncType, zcu: *Zcu, target: std.Targe
12001 .aarch64_aapcs_darwin,11993 .aarch64_aapcs_darwin,
12002 .aarch64_aapcs_win,11994 .aarch64_aapcs_win,
12003 => aarch64_c_abi.classifyType(return_type, zcu) == .memory,11995 => aarch64_c_abi.classifyType(return_type, zcu) == .memory,
12004 .arm_aapcs, .arm_aapcs_vfp, .arm_aapcs16_vfp => switch (arm_c_abi.classifyType(return_type, zcu, .ret)) {11996 .arm_aapcs, .arm_aapcs_vfp => switch (arm_c_abi.classifyType(return_type, zcu, .ret)) {
12005 .memory, .i64_array => true,11997 .memory, .i64_array => true,
12006 .i32_array => |size| size != 1,11998 .i32_array => |size| size != 1,
12007 .byval => false,11999 .byval => false,
...@@ -12051,7 +12043,7 @@ fn lowerFnRetTy(o: *Object, fn_info: InternPool.Key.FuncType) Allocator.Error!Bu...@@ -12051,7 +12043,7 @@ fn lowerFnRetTy(o: *Object, fn_info: InternPool.Key.FuncType) Allocator.Error!Bu
12051 .integer => return o.builder.intType(@intCast(return_type.bitSize(zcu))),12043 .integer => return o.builder.intType(@intCast(return_type.bitSize(zcu))),
12052 .double_integer => return o.builder.arrayType(2, .i64),12044 .double_integer => return o.builder.arrayType(2, .i64),
12053 },12045 },
12054 .arm_aapcs, .arm_aapcs_vfp, .arm_aapcs16_vfp => switch (arm_c_abi.classifyType(return_type, zcu, .ret)) {12046 .arm_aapcs, .arm_aapcs_vfp => switch (arm_c_abi.classifyType(return_type, zcu, .ret)) {
12055 .memory, .i64_array => return .void,12047 .memory, .i64_array => return .void,
12056 .i32_array => |len| return if (len == 1) .i32 else .void,12048 .i32_array => |len| return if (len == 1) .i32 else .void,
12057 .byval => return o.lowerType(return_type),12049 .byval => return o.lowerType(return_type),
...@@ -12300,7 +12292,7 @@ const ParamTypeIterator = struct {...@@ -12300,7 +12292,7 @@ const ParamTypeIterator = struct {
12300 .double_integer => return Lowering{ .i64_array = 2 },12292 .double_integer => return Lowering{ .i64_array = 2 },
12301 }12293 }
12302 },12294 },
12303 .arm_aapcs, .arm_aapcs_vfp, .arm_aapcs16_vfp => {12295 .arm_aapcs, .arm_aapcs_vfp => {
12304 it.zig_index += 1;12296 it.zig_index += 1;
12305 it.llvm_index += 1;12297 it.llvm_index += 1;
12306 switch (arm_c_abi.classifyType(ty, zcu, .arg)) {12298 switch (arm_c_abi.classifyType(ty, zcu, .arg)) {
src/link/Dwarf.zig+1-4
...@@ -3538,11 +3538,8 @@ fn updateLazyType(...@@ -3538,11 +3538,8 @@ fn updateLazyType(
3538 .aarch64_vfabi => .LLVM_AAPCS,3538 .aarch64_vfabi => .LLVM_AAPCS,
3539 .aarch64_vfabi_sve => .LLVM_AAPCS,3539 .aarch64_vfabi_sve => .LLVM_AAPCS,
35403540
3541 .arm_apcs => .normal,
3542 .arm_aapcs => .LLVM_AAPCS,3541 .arm_aapcs => .LLVM_AAPCS,
3543 .arm_aapcs_vfp,3542 .arm_aapcs_vfp => .LLVM_AAPCS_VFP,
3544 .arm_aapcs16_vfp,
3545 => .LLVM_AAPCS_VFP,
35463543
3547 .riscv64_lp64_v,3544 .riscv64_lp64_v,
3548 .riscv32_ilp32_v,3545 .riscv32_ilp32_v,
test/cases/compile_errors/callconv_apcs_aapcs_aapcsvfp_on_unsupported_platform.zig+2-4
...@@ -1,10 +1,8 @@...@@ -1,10 +1,8 @@
1export fn entry1() callconv(.APCS) void {}
2export fn entry2() callconv(.AAPCS) void {}1export fn entry2() callconv(.AAPCS) void {}
3export fn entry3() callconv(.AAPCSVFP) void {}2export fn entry3() callconv(.AAPCSVFP) void {}
43
5// error4// error
6// target=x86_64-linux-none5// target=x86_64-linux-none
7//6//
8// :1:30: error: calling convention 'arm_apcs' only available on architectures 'arm', 'armeb', 'thumb', 'thumbeb'7// :1:30: error: calling convention 'arm_aapcs' only available on architectures 'arm', 'armeb', 'thumb', 'thumbeb'
9// :2:30: error: calling convention 'arm_aapcs' only available on architectures 'arm', 'armeb', 'thumb', 'thumbeb'8// :2:30: error: calling convention 'arm_aapcs_vfp' only available on architectures 'arm', 'armeb', 'thumb', 'thumbeb'
10// :3:30: error: calling convention 'arm_aapcs_vfp' only available on architectures 'arm', 'armeb', 'thumb', 'thumbeb'