authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-08-24 15:50:34-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-08-26 20:54:49-07:00
log7e643ae8ab105bf3c63d2879ee3fb4a57b5bfbe8
treec95bcfa5e32bbe2ad104d9a5106d1fa96bb35c64
parent03cc522fc0e3cd2434510eec7c39aa09282f4433

spork8: use snake2p calling convention


4 files changed, 10 insertions(+), 2 deletions(-)

lib/std/Target.zig+4-1
...@@ -2033,6 +2033,9 @@ pub const Cpu = struct {...@@ -2033,6 +2033,9 @@ pub const Cpu = struct {
2033 .ez80_cet,2033 .ez80_cet,
2034 .ez80_tiflags,2034 .ez80_tiflags,
2035 => &.{.ez80},2035 => &.{.ez80},
2036
2037 .spork8,
2038 => &.{.spork8},
2036 };2039 };
2037 }2040 }
2038 };2041 };
...@@ -3818,7 +3821,7 @@ pub fn cCallingConvention(target: *const Target) ?std.builtin.CallingConvention...@@ -3818,7 +3821,7 @@ pub fn cCallingConvention(target: *const Target) ?std.builtin.CallingConvention
3818 .nvptx, .nvptx64 => .nvptx_device,3821 .nvptx, .nvptx64 => .nvptx_device,
3819 .spirv32, .spirv64 => .spirv_device,3822 .spirv32, .spirv64 => .spirv_device,
3820 .ez80 => .ez80_cet,3823 .ez80 => .ez80_cet,
3821 .spork8 => .naked,3824 .spork8 => .spork8,
3822 };3825 };
3823}3826}
38243827
lib/std/lang.zig+4
...@@ -391,6 +391,10 @@ pub const CallingConvention = union(enum(u8)) {...@@ -391,6 +391,10 @@ pub const CallingConvention = union(enum(u8)) {
391 ez80_cet,391 ez80_cet,
392 ez80_tiflags,392 ez80_tiflags,
393393
394 // Calling convention used by
395 // [snake2p example program](https://github.com/benanderman/spork-8/blob/1bce10a2c3a3888a3f4ca8208112afbc5973fda4/Code/programs/snake2p.asm)
396 spork8,
397
394 /// Options shared across most calling conventions.398 /// Options shared across most calling conventions.
395 pub const CommonOptions = struct {399 pub const CommonOptions = struct {
396 /// The boundary the stack is aligned to when the function is called.400 /// The boundary the stack is aligned to when the function is called.
src/Zcu.zig+1-1
...@@ -4699,7 +4699,7 @@ pub fn callconvSupported(zcu: *Zcu, cc: std.lang.CallingConvention) union(enum)...@@ -4699,7 +4699,7 @@ pub fn callconvSupported(zcu: *Zcu, cc: std.lang.CallingConvention) union(enum)
4699 else => false,4699 else => false,
4700 },4700 },
4701 .zsf_spork8 => switch (cc) {4701 .zsf_spork8 => switch (cc) {
4702 .naked => true,4702 .spork8, .naked => true,
4703 else => false,4703 else => false,
4704 },4704 },
4705 };4705 };
src/codegen/llvm.zig+1
...@@ -4393,6 +4393,7 @@ pub fn toLlvmCallConvTag(cc_tag: std.lang.CallingConvention.Tag, target: *const...@@ -4393,6 +4393,7 @@ pub fn toLlvmCallConvTag(cc_tag: std.lang.CallingConvention.Tag, target: *const
4393 .spirv_vertex,4393 .spirv_vertex,
4394 .spirv_task,4394 .spirv_task,
4395 .spirv_mesh,4395 .spirv_mesh,
4396 .spork8,
4396 => null,4397 => null,
4397 };4398 };
4398}4399}