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 {
20332033 .ez80_cet,
20342034 .ez80_tiflags,
20352035 => &.{.ez80},
2036
2037 .spork8,
2038 => &.{.spork8},
20362039 };
20372040 }
20382041 };
......@@ -3818,7 +3821,7 @@ pub fn cCallingConvention(target: *const Target) ?std.builtin.CallingConvention
38183821 .nvptx, .nvptx64 => .nvptx_device,
38193822 .spirv32, .spirv64 => .spirv_device,
38203823 .ez80 => .ez80_cet,
3821 .spork8 => .naked,
3824 .spork8 => .spork8,
38223825 };
38233826}
38243827
lib/std/lang.zig+4
......@@ -391,6 +391,10 @@ pub const CallingConvention = union(enum(u8)) {
391391 ez80_cet,
392392 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
394398 /// Options shared across most calling conventions.
395399 pub const CommonOptions = struct {
396400 /// 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)
46994699 else => false,
47004700 },
47014701 .zsf_spork8 => switch (cc) {
4702 .naked => true,
4702 .spork8, .naked => true,
47034703 else => false,
47044704 },
47054705 };
src/codegen/llvm.zig+1
......@@ -4393,6 +4393,7 @@ pub fn toLlvmCallConvTag(cc_tag: std.lang.CallingConvention.Tag, target: *const
43934393 .spirv_vertex,
43944394 .spirv_task,
43954395 .spirv_mesh,
4396 .spork8,
43964397 => null,
43974398 };
43984399}