@@ -204,6 +204,7 @@ pub const CallingConvention = union(enum(u8)) {
204204
205205 // Calling conventions for the `x86_64` architecture.
206206 x86_64_sysv : CommonOptions ,
207+ x86_64_x32 : CommonOptions ,
207208 x86_64_win : CommonOptions ,
208209 x86_64_regcall_v3_sysv : CommonOptions ,
209210 x86_64_regcall_v4_win : CommonOptions ,
@@ -229,6 +230,9 @@ pub const CallingConvention = union(enum(u8)) {
229230 aarch64_vfabi : CommonOptions ,
230231 aarch64_vfabi_sve : CommonOptions ,
231232
233+ /// The standard `alpha` calling convention.
234+ alpha_osf : CommonOptions ,
235+
232236 // Calling convetions for the `arm`, `armeb`, `thumb`, and `thumbeb` architectures.
233237 /// ARM Architecture Procedure Call Standard
234238 arm_aapcs : CommonOptions ,
@@ -275,7 +279,7 @@ pub const CallingConvention = union(enum(u8)) {
275279 /// The standard `wasm32` and `wasm64` calling convention, as specified in the WebAssembly Tool Conventions.
276280 wasm_mvp : CommonOptions ,
277281
278- /// The standard `arc` calling convention.
282+ /// The standard `arc`/`arceb` calling convention.
279283 arc_sysv : CommonOptions ,
280284 arc_interrupt : ArcInterruptOptions ,
281285
@@ -296,6 +300,12 @@ pub const CallingConvention = union(enum(u8)) {
296300 hexagon_sysv : CommonOptions ,
297301 hexagon_sysv_hvx : CommonOptions ,
298302
303+ /// The standard `hppa` calling convention.
304+ hppa_elf : CommonOptions ,
305+
306+ /// The standard `hppa64` calling convention.
307+ hppa64_elf : CommonOptions ,
308+
299309 /// The standard `lanai` calling convention.
300310 lanai_sysv : CommonOptions ,
301311
@@ -311,8 +321,13 @@ pub const CallingConvention = union(enum(u8)) {
311321 m68k_rtd : CommonOptions ,
312322 m68k_interrupt : CommonOptions ,
313323
324+ /// The standard `microblaze`/`microblazeel` calling convention.
325+ microblaze_std : CommonOptions ,
326+ microblaze_interrupt : MicroblazeInterruptOptions ,
327+
314328 /// The standard `msp430` calling convention.
315329 msp430_eabi : CommonOptions ,
330+ msp430_interrupt : CommonOptions ,
316331
317332 /// The standard `or1k` calling convention.
318333 or1k_sysv : CommonOptions ,
@@ -324,14 +339,19 @@ pub const CallingConvention = union(enum(u8)) {
324339 s390x_sysv : CommonOptions ,
325340 s390x_sysv_vx : CommonOptions ,
326341
342+ // Calling conventions for the `sh`/`sheb` architecture.
343+ sh_gnu : CommonOptions ,
344+ sh_renesas : CommonOptions ,
345+ sh_interrupt : ShInterruptOptions ,
346+
327347 /// The standard `ve` calling convention.
328348 ve_sysv : CommonOptions ,
329349
330350 // Calling conventions for the `xcore` architecture.
331351 xcore_xs1 : CommonOptions ,
332352 xcore_xs2 : CommonOptions ,
333353
334- // Calling conventions for the `xtensa` architecture.
354+ // Calling conventions for the `xtensa`/`xtensaeb` architecture.
335355 xtensa_call0 : CommonOptions ,
336356 xtensa_windowed : CommonOptions ,
337357
@@ -403,6 +423,25 @@ pub const CallingConvention = union(enum(u8)) {
403423 };
404424 };
405425
426+ /// Options for the `microblaze_interrupt` calling convention.
427+ pub const MicroblazeInterruptOptions = struct {
428+ /// The boundary the stack is aligned to when the function is called.
429+ /// `null` means the default for this calling convention.
430+ incoming_stack_alignment : ? u64 = null ,
431+ type : InterruptType = .regular ,
432+
433+ pub const InterruptType = enum (u2 ) {
434+ /// User exception; return with `rtsd`.
435+ user ,
436+ /// Regular interrupt; return with `rtid`.
437+ regular ,
438+ /// Fast interrupt; return with `rtid`.
439+ fast ,
440+ /// Software breakpoint; return with `rtbd`.
441+ breakpoint ,
442+ };
443+ };
444+
406445 /// Options for the `mips_interrupt` and `mips64_interrupt` calling conventions.
407446 pub const MipsInterruptOptions = struct {
408447 /// The boundary the stack is aligned to when the function is called.
@@ -438,6 +477,25 @@ pub const CallingConvention = union(enum(u8)) {
438477 };
439478 };
440479
480+ /// Options for the `sh_interrupt` calling convention.
481+ pub const ShInterruptOptions = struct {
482+ /// The boundary the stack is aligned to when the function is called.
483+ /// `null` means the default for this calling convention.
484+ incoming_stack_alignment : ? u64 = null ,
485+ save : SaveBehavior = .full ,
486+
487+ pub const SaveBehavior = enum (u3 ) {
488+ /// Save only fpscr (if applicable).
489+ fpscr ,
490+ /// Save only high-numbered registers, i.e. r0 through r7 are *not* saved.
491+ high ,
492+ /// Save all registers normally.
493+ full ,
494+ /// Save all registers using the CPU's fast register bank.
495+ bank ,
496+ };
497+ };
498+
441499 /// Returns the array of `std.Target.Cpu.Arch` to which this `CallingConvention` applies.
442500 /// Asserts that `cc` is not `.auto`, `.@"async"`, `.naked`, or `.@"inline"`.
443501 pub fn archs (cc : CallingConvention ) []const std.Target.Cpu.Arch {
@@ -459,21 +517,6 @@ pub const CallingConvention = union(enum(u8)) {
459517/// This data structure is used by the Zig language code generation and
460518/// therefore must be kept in sync with the compiler implementation.
461519pub const AddressSpace = enum (u5 ) {
462- /// The places where a user can specify an address space attribute
463- pub const Context = enum {
464- /// A function is specified to be placed in a certain address space.
465- function ,
466- /// A (global) variable is specified to be placed in a certain address space.
467- /// In contrast to .constant, these values (and thus the address space they will be
468- /// placed in) are required to be mutable.
469- variable ,
470- /// A (global) constant value is specified to be placed in a certain address space.
471- /// In contrast to .variable, values placed in this address space are not required to be mutable.
472- constant ,
473- /// A pointer is ascripted to point into a certain address space.
474- pointer ,
475- };
476-
477520 // CPU address spaces.
478521 generic ,
479522 gs ,
@@ -858,6 +901,13 @@ pub const VaListAarch64 = extern struct {
858901 __vr_offs : c_int ,
859902};
860903
904+ /// This data structure is used by the Zig language code generation and
905+ /// therefore must be kept in sync with the compiler implementation.
906+ pub const VaListAlpha = extern struct {
907+ __base : * anyopaque ,
908+ __offset : c_int ,
909+ };
910+
861911/// This data structure is used by the Zig language code generation and
862912/// therefore must be kept in sync with the compiler implementation.
863913pub const VaListArm = extern struct {
@@ -891,6 +941,16 @@ pub const VaListS390x = extern struct {
891941 __overflow_area_pointer : * anyopaque ,
892942};
893943
944+ /// This data structure is used by the Zig language code generation and
945+ /// therefore must be kept in sync with the compiler implementation.
946+ pub const VaListSh = extern struct {
947+ __va_next_o : * anyopaque ,
948+ __va_next_o_limit : * anyopaque ,
949+ __va_next_fp : * anyopaque ,
950+ __va_next_fp_limit : * anyopaque ,
951+ __va_next_stack : * anyopaque ,
952+ };
953+
894954/// This data structure is used by the Zig language code generation and
895955/// therefore must be kept in sync with the compiler implementation.
896956pub const VaListX86_64 = extern struct {
@@ -920,14 +980,19 @@ pub const VaList = switch (builtin.cpu.arch) {
920980 .x86 ,
921981 = > * u8 ,
922982 .arc ,
983+ .arceb ,
923984 .avr ,
924985 .bpfel ,
925986 .bpfeb ,
926987 .csky ,
988+ .hppa ,
989+ .hppa64 ,
927990 .lanai ,
928991 .loongarch32 ,
929992 .loongarch64 ,
930993 .m68k ,
994+ .microblaze ,
995+ .microblazeel ,
931996 .mips ,
932997 .mipsel ,
933998 .mips64 ,
@@ -952,21 +1017,23 @@ pub const VaList = switch (builtin.cpu.arch) {
9521017 .stage2_llvm = > @compileError ("disabled due to miscompilations" ),
9531018 },
9541019 },
1020+ .alpha = > VaListAlpha ,
9551021 .arm , .armeb , .thumb , .thumbeb = > VaListArm ,
9561022 .hexagon = > if (builtin .target .abi .isMusl ()) VaListHexagon else * u8 ,
9571023 .powerpc , .powerpcle = > switch (builtin .os .tag ) {
9581024 .aix = > * u8 ,
9591025 else = > VaListPowerPc ,
9601026 },
9611027 .s390x = > VaListS390x ,
1028+ .sh , .sheb = > VaListSh , // This is wrong for `sh_renesas`: https://github.com/ziglang/zig/issues/24692#issuecomment-3150779829
9621029 .x86_64 = > switch (builtin .os .tag ) {
9631030 .uefi , .windows = > switch (builtin .zig_backend ) {
9641031 else = > * u8 ,
9651032 .stage2_llvm = > @compileError ("disabled due to miscompilations" ),
9661033 },
9671034 else = > VaListX86_64 ,
9681035 },
969- .xtensa = > VaListXtensa ,
1036+ .xtensa , .xtensaeb = > VaListXtensa ,
9701037 else = > @compileError ("VaList not supported for this target yet" ),
9711038};
9721039
0 commit comments