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.
This commit is contained in:
Alex Rønne Petersen 2025-01-24 01:34:29 +01:00
parent 2fe32ef847
commit 9c015e6c2b
No known key found for this signature in database
8 changed files with 9 additions and 34 deletions

View File

@ -1753,10 +1753,8 @@ pub const Cpu = struct {
.aarch64_vfabi_sve,
=> &.{ .aarch64, .aarch64_be },
.arm_apcs,
.arm_aapcs,
.arm_aapcs_vfp,
.arm_aapcs16_vfp,
.arm_interrupt,
=> &.{ .arm, .armeb, .thumb, .thumbeb },

View File

@ -220,8 +220,6 @@ pub const CallingConvention = union(enum(u8)) {
};
/// Deprecated; use `.x86_thiscall`.
pub const Thiscall: CallingConvention = .{ .x86_thiscall = .{} };
/// Deprecated; do not use.
pub const APCS: CallingConvention = .{ .arm_apcs = .{} };
/// Deprecated; use `.arm_aapcs`.
pub const AAPCS: CallingConvention = .{ .arm_aapcs = .{} };
/// Deprecated; use `.arm_aapcs_vfp`.
@ -284,14 +282,10 @@ pub const CallingConvention = union(enum(u8)) {
aarch64_vfabi_sve: CommonOptions,
// Calling convetions for the `arm`, `armeb`, `thumb`, and `thumbeb` architectures.
/// Deprecated; do not use.
arm_apcs: CommonOptions, // Removal of `arm_apcs` is blocked by #21842.
/// ARM Architecture Procedure Call Standard
arm_aapcs: CommonOptions,
/// ARM Architecture Procedure Call Standard Vector Floating-Point
arm_aapcs_vfp: CommonOptions,
/// Deprecated; do not use.
arm_aapcs16_vfp: CommonOptions, // Removal of `arm_aapcs16_vfp` is blocked by #21842.
arm_interrupt: ArmInterruptOptions,
// Calling conventions for the `mips64` and `mips64el` architectures.

View File

@ -9407,10 +9407,8 @@ const calling_conventions_supporting_var_args = [_]std.builtin.CallingConvention
.aarch64_aapcs_win,
.aarch64_vfabi,
.aarch64_vfabi_sve,
.arm_apcs,
.arm_aapcs,
.arm_aapcs_vfp,
.arm_aapcs16_vfp,
.mips64_n64,
.mips64_n32,
.mips_o32,

View File

@ -4209,9 +4209,7 @@ pub fn callconvSupported(zcu: *Zcu, cc: std.builtin.CallingConvention) union(enu
=> |opts| opts.incoming_stack_alignment == null,
.arm_aapcs_vfp,
=> |opts| opts.incoming_stack_alignment == null and target.os.tag != .watchos,
.arm_aapcs16_vfp,
=> |opts| opts.incoming_stack_alignment == null and target.os.tag == .watchos,
=> |opts| opts.incoming_stack_alignment == null,
.arm_interrupt,
=> |opts| opts.incoming_stack_alignment == null,

View File

@ -7725,7 +7725,7 @@ fn toCallingConvention(cc: std.builtin.CallingConvention, zcu: *Zcu) ?[]const u8
.aarch64_vfabi_sve => "aarch64_sve_pcs",
.arm_aapcs => "pcs(\"aapcs\")",
.arm_aapcs_vfp, .arm_aapcs16_vfp => "pcs(\"aapcs-vfp\")",
.arm_aapcs_vfp => "pcs(\"aapcs-vfp\")",
.arm_interrupt => |opts| switch (opts.type) {
.generic => "interrupt",

View File

@ -11766,16 +11766,8 @@ fn toLlvmCallConvTag(cc_tag: std.builtin.CallingConvention.Tag, target: std.Targ
.x86_interrupt => .x86_intrcc,
.aarch64_vfabi => .aarch64_vector_pcs,
.aarch64_vfabi_sve => .aarch64_sve_vector_pcs,
.arm_apcs => .arm_apcscc,
.arm_aapcs => .arm_aapcscc,
.arm_aapcs_vfp => if (target.os.tag != .watchos)
.arm_aapcs_vfpcc
else
null,
.arm_aapcs16_vfp => if (target.os.tag == .watchos)
.arm_aapcs_vfpcc
else
null,
.arm_aapcs_vfp => .arm_aapcs_vfpcc,
.riscv64_lp64_v => .riscv_vectorcallcc,
.riscv32_ilp32_v => .riscv_vectorcallcc,
.avr_builtin => .avr_builtincc,
@ -12001,7 +11993,7 @@ fn firstParamSRet(fn_info: InternPool.Key.FuncType, zcu: *Zcu, target: std.Targe
.aarch64_aapcs_darwin,
.aarch64_aapcs_win,
=> aarch64_c_abi.classifyType(return_type, zcu) == .memory,
.arm_aapcs, .arm_aapcs_vfp, .arm_aapcs16_vfp => switch (arm_c_abi.classifyType(return_type, zcu, .ret)) {
.arm_aapcs, .arm_aapcs_vfp => switch (arm_c_abi.classifyType(return_type, zcu, .ret)) {
.memory, .i64_array => true,
.i32_array => |size| size != 1,
.byval => false,
@ -12051,7 +12043,7 @@ fn lowerFnRetTy(o: *Object, fn_info: InternPool.Key.FuncType) Allocator.Error!Bu
.integer => return o.builder.intType(@intCast(return_type.bitSize(zcu))),
.double_integer => return o.builder.arrayType(2, .i64),
},
.arm_aapcs, .arm_aapcs_vfp, .arm_aapcs16_vfp => switch (arm_c_abi.classifyType(return_type, zcu, .ret)) {
.arm_aapcs, .arm_aapcs_vfp => switch (arm_c_abi.classifyType(return_type, zcu, .ret)) {
.memory, .i64_array => return .void,
.i32_array => |len| return if (len == 1) .i32 else .void,
.byval => return o.lowerType(return_type),
@ -12300,7 +12292,7 @@ const ParamTypeIterator = struct {
.double_integer => return Lowering{ .i64_array = 2 },
}
},
.arm_aapcs, .arm_aapcs_vfp, .arm_aapcs16_vfp => {
.arm_aapcs, .arm_aapcs_vfp => {
it.zig_index += 1;
it.llvm_index += 1;
switch (arm_c_abi.classifyType(ty, zcu, .arg)) {

View File

@ -3538,11 +3538,8 @@ fn updateLazyType(
.aarch64_vfabi => .LLVM_AAPCS,
.aarch64_vfabi_sve => .LLVM_AAPCS,
.arm_apcs => .normal,
.arm_aapcs => .LLVM_AAPCS,
.arm_aapcs_vfp,
.arm_aapcs16_vfp,
=> .LLVM_AAPCS_VFP,
.arm_aapcs_vfp => .LLVM_AAPCS_VFP,
.riscv64_lp64_v,
.riscv32_ilp32_v,

View File

@ -1,10 +1,8 @@
export fn entry1() callconv(.APCS) void {}
export fn entry2() callconv(.AAPCS) void {}
export fn entry3() callconv(.AAPCSVFP) void {}
// error
// target=x86_64-linux-none
//
// :1:30: error: calling convention 'arm_apcs' only available on architectures 'arm', 'armeb', 'thumb', 'thumbeb'
// :2:30: error: calling convention 'arm_aapcs' only available on architectures 'arm', 'armeb', 'thumb', 'thumbeb'
// :3:30: error: calling convention 'arm_aapcs_vfp' only available on architectures 'arm', 'armeb', 'thumb', 'thumbeb'
// :1:30: error: calling convention 'arm_aapcs' only available on architectures 'arm', 'armeb', 'thumb', 'thumbeb'
// :2:30: error: calling convention 'arm_aapcs_vfp' only available on architectures 'arm', 'armeb', 'thumb', 'thumbeb'