aboutsummaryrefslogtreecommitdiff
path: root/src/codegen
diff options
context:
space:
mode:
authorAlex Rønne Petersen <alex@alexrp.com>2025-10-18 16:59:05 +0200
committerAlex Rønne Petersen <alex@alexrp.com>2025-10-19 22:27:19 +0200
commitdbf9c7b548a56653c9267dbb615d7119974ecca5 (patch)
tree91593852dcb3aaf381f64e25be289beb6370f305 /src/codegen
parent49eea79ec20b319ee2aa89bcbfd481111b5caa27 (diff)
downloadzig-dbf9c7b548a56653c9267dbb615d7119974ecca5.tar.gz
zig-dbf9c7b548a56653c9267dbb615d7119974ecca5.zip
compiler: add support for arc_interrupt calling convention
Only for use with the C backend at the moment.
Diffstat (limited to 'src/codegen')
-rw-r--r--src/codegen/c.zig4
-rw-r--r--src/codegen/llvm.zig2
2 files changed, 6 insertions, 0 deletions
diff --git a/src/codegen/c.zig b/src/codegen/c.zig
index d47c7657e6..bf9be70529 100644
--- a/src/codegen/c.zig
+++ b/src/codegen/c.zig
@@ -8077,6 +8077,10 @@ fn toCallingConvention(cc: std.builtin.CallingConvention, zcu: *Zcu) ?[]const u8
.arm_aapcs => "pcs(\"aapcs\")",
.arm_aapcs_vfp => "pcs(\"aapcs-vfp\")",
+ .arc_interrupt => |opts| switch (opts.type) {
+ inline else => |t| "interrupt(\"" ++ @tagName(t) ++ "\")",
+ },
+
.arm_interrupt => |opts| switch (opts.type) {
.generic => "interrupt",
.irq => "interrupt(\"IRQ\")",
diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig
index 5d0b87baee..8fae998492 100644
--- a/src/codegen/llvm.zig
+++ b/src/codegen/llvm.zig
@@ -11816,6 +11816,7 @@ pub fn toLlvmCallConv(cc: std.builtin.CallingConvention, target: *const std.Targ
const incoming_stack_alignment: ?u64, const register_params: u2 = switch (cc) {
inline else => |pl| switch (@TypeOf(pl)) {
void => .{ null, 0 },
+ std.builtin.CallingConvention.ArcInterruptOptions,
std.builtin.CallingConvention.ArmInterruptOptions,
std.builtin.CallingConvention.RiscvInterruptOptions,
std.builtin.CallingConvention.MipsInterruptOptions,
@@ -11919,6 +11920,7 @@ fn toLlvmCallConvTag(cc_tag: std.builtin.CallingConvention.Tag, target: *const s
.powerpc_aix_altivec,
.wasm_mvp,
.arc_sysv,
+ .arc_interrupt,
.avr_gnu,
.bpf_std,
.csky_sysv,