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 {
17531753 .aarch64_vfabi_sve,
17541754 => &.{ .aarch64, .aarch64_be },
17551755
1756 .arm_apcs,
17571756 .arm_aapcs,
17581757 .arm_aapcs_vfp,
1759 .arm_aapcs16_vfp,
17601758 .arm_interrupt,
17611759 => &.{ .arm, .armeb, .thumb, .thumbeb },
17621760
lib/std/builtin.zig-6
......@@ -220,8 +220,6 @@ pub const CallingConvention = union(enum(u8)) {
220220 };
221221 /// Deprecated; use `.x86_thiscall`.
222222 pub const Thiscall: CallingConvention = .{ .x86_thiscall = .{} };
223 /// Deprecated; do not use.
224 pub const APCS: CallingConvention = .{ .arm_apcs = .{} };
225223 /// Deprecated; use `.arm_aapcs`.
226224 pub const AAPCS: CallingConvention = .{ .arm_aapcs = .{} };
227225 /// Deprecated; use `.arm_aapcs_vfp`.
......@@ -284,14 +282,10 @@ pub const CallingConvention = union(enum(u8)) {
284282 aarch64_vfabi_sve: CommonOptions,
285283
286284 // 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.
289285 /// ARM Architecture Procedure Call Standard
290286 arm_aapcs: CommonOptions,
291287 /// ARM Architecture Procedure Call Standard Vector Floating-Point
292288 arm_aapcs_vfp: CommonOptions,
293 /// Deprecated; do not use.
294 arm_aapcs16_vfp: CommonOptions, // Removal of `arm_aapcs16_vfp` is blocked by #21842.
295289 arm_interrupt: ArmInterruptOptions,
296290
297291 // 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
94079407 .aarch64_aapcs_win,
94089408 .aarch64_vfabi,
94099409 .aarch64_vfabi_sve,
9410 .arm_apcs,
94119410 .arm_aapcs,
94129411 .arm_aapcs_vfp,
9413 .arm_aapcs16_vfp,
94149412 .mips64_n64,
94159413 .mips64_n32,
94169414 .mips_o32,
src/Zcu.zig+1-3
......@@ -4209,9 +4209,7 @@ pub fn callconvSupported(zcu: *Zcu, cc: std.builtin.CallingConvention) union(enu
42094209 => |opts| opts.incoming_stack_alignment == null,
42104210
42114211 .arm_aapcs_vfp,
4212 => |opts| opts.incoming_stack_alignment == null and target.os.tag != .watchos,
4213 .arm_aapcs16_vfp,
4214 => |opts| opts.incoming_stack_alignment == null and target.os.tag == .watchos,
4212 => |opts| opts.incoming_stack_alignment == null,
42154213
42164214 .arm_interrupt,
42174215 => |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
77257725 .aarch64_vfabi_sve => "aarch64_sve_pcs",
77267726
77277727 .arm_aapcs => "pcs(\"aapcs\")",
7728 .arm_aapcs_vfp, .arm_aapcs16_vfp => "pcs(\"aapcs-vfp\")",
7728 .arm_aapcs_vfp => "pcs(\"aapcs-vfp\")",
77297729
77307730 .arm_interrupt => |opts| switch (opts.type) {
77317731 .generic => "interrupt",
src/codegen/llvm.zig+4-12
......@@ -11766,16 +11766,8 @@ fn toLlvmCallConvTag(cc_tag: std.builtin.CallingConvention.Tag, target: std.Targ
1176611766 .x86_interrupt => .x86_intrcc,
1176711767 .aarch64_vfabi => .aarch64_vector_pcs,
1176811768 .aarch64_vfabi_sve => .aarch64_sve_vector_pcs,
11769 .arm_apcs => .arm_apcscc,
1177011769 .arm_aapcs => .arm_aapcscc,
11771 .arm_aapcs_vfp => if (target.os.tag != .watchos)
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,
11770 .arm_aapcs_vfp => .arm_aapcs_vfpcc,
1177911771 .riscv64_lp64_v => .riscv_vectorcallcc,
1178011772 .riscv32_ilp32_v => .riscv_vectorcallcc,
1178111773 .avr_builtin => .avr_builtincc,
......@@ -12001,7 +11993,7 @@ fn firstParamSRet(fn_info: InternPool.Key.FuncType, zcu: *Zcu, target: std.Targe
1200111993 .aarch64_aapcs_darwin,
1200211994 .aarch64_aapcs_win,
1200311995 => 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)) {
1200511997 .memory, .i64_array => true,
1200611998 .i32_array => |size| size != 1,
1200711999 .byval => false,
......@@ -12051,7 +12043,7 @@ fn lowerFnRetTy(o: *Object, fn_info: InternPool.Key.FuncType) Allocator.Error!Bu
1205112043 .integer => return o.builder.intType(@intCast(return_type.bitSize(zcu))),
1205212044 .double_integer => return o.builder.arrayType(2, .i64),
1205312045 },
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)) {
1205512047 .memory, .i64_array => return .void,
1205612048 .i32_array => |len| return if (len == 1) .i32 else .void,
1205712049 .byval => return o.lowerType(return_type),
......@@ -12300,7 +12292,7 @@ const ParamTypeIterator = struct {
1230012292 .double_integer => return Lowering{ .i64_array = 2 },
1230112293 }
1230212294 },
12303 .arm_aapcs, .arm_aapcs_vfp, .arm_aapcs16_vfp => {
12295 .arm_aapcs, .arm_aapcs_vfp => {
1230412296 it.zig_index += 1;
1230512297 it.llvm_index += 1;
1230612298 switch (arm_c_abi.classifyType(ty, zcu, .arg)) {
src/link/Dwarf.zig+1-4
......@@ -3538,11 +3538,8 @@ fn updateLazyType(
35383538 .aarch64_vfabi => .LLVM_AAPCS,
35393539 .aarch64_vfabi_sve => .LLVM_AAPCS,
35403540
3541 .arm_apcs => .normal,
35423541 .arm_aapcs => .LLVM_AAPCS,
3543 .arm_aapcs_vfp,
3544 .arm_aapcs16_vfp,
3545 => .LLVM_AAPCS_VFP,
3542 .arm_aapcs_vfp => .LLVM_AAPCS_VFP,
35463543
35473544 .riscv64_lp64_v,
35483545 .riscv32_ilp32_v,
test/cases/compile_errors/callconv_apcs_aapcs_aapcsvfp_on_unsupported_platform.zig+2-4
......@@ -1,10 +1,8 @@
1export fn entry1() callconv(.APCS) void {}
21export fn entry2() callconv(.AAPCS) void {}
32export fn entry3() callconv(.AAPCSVFP) void {}
43
54// error
65// target=x86_64-linux-none
76//
8// :1:30: error: calling convention 'arm_apcs' only available on architectures 'arm', 'armeb', 'thumb', 'thumbeb'
9// :2:30: error: calling convention 'arm_aapcs' 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'
7// :1: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'