@@ -70,6 +70,8 @@ pub const Os = struct {
7070 opengl ,
7171 vulkan ,
7272
73+ tios ,
74+
7375 // LLVM tags deliberately omitted:
7476 // - bridgeos
7577 // - cheriotrtos
@@ -214,6 +216,8 @@ pub const Os = struct {
214216 .opencl ,
215217 .opengl ,
216218 .vulkan ,
219+
220+ .tios ,
217221 = > .semver ,
218222
219223 .hurd = > .hurd ,
@@ -676,6 +680,12 @@ pub const Os = struct {
676680 .max = .{ .major = 4 , .minor = 6 , .patch = 0 },
677681 },
678682 },
683+ .tios = > .{
684+ .semver = .{
685+ .min = .{ .major = 5 , .minor = 0 , .patch = 0 },
686+ .max = .{ .major = 5 , .minor = 8 , .patch = 4 },
687+ },
688+ },
679689 .vulkan = > .{
680690 .semver = .{
681691 .min = .{ .major = 1 , .minor = 2 , .patch = 0 },
@@ -740,6 +750,7 @@ pub const arm = @import("Target/arm.zig");
740750pub const avr = @import ("Target/avr.zig" );
741751pub const bpf = @import ("Target/bpf.zig" );
742752pub const csky = @import ("Target/csky.zig" );
753+ pub const ez80 = @import ("Target/generic.zig" );
743754pub const hexagon = @import ("Target/hexagon.zig" );
744755pub const hppa = @import ("Target/generic.zig" );
745756pub const kalimba = @import ("Target/generic.zig" );
@@ -950,6 +961,7 @@ pub const Abi = enum {
950961 .opencl ,
951962 .opengl ,
952963 .vulkan ,
964+ .tios ,
953965 = > .none ,
954966 };
955967 }
@@ -1106,6 +1118,7 @@ pub fn toElfMachine(target: *const Target) std.elf.EM {
11061118 .xcore = > .XCORE ,
11071119 .xtensa , .xtensaeb = > .XTENSA ,
11081120
1121+ .ez80 ,
11091122 .nvptx ,
11101123 .nvptx64 ,
11111124 .spirv32 ,
@@ -1143,6 +1156,7 @@ pub fn toCoffMachine(target: *const Target) std.coff.IMAGE.FILE.MACHINE {
11431156 .bpfeb ,
11441157 .bpfel ,
11451158 .csky ,
1159+ .ez80 ,
11461160 .hexagon ,
11471161 .hppa ,
11481162 .hppa64 ,
@@ -1355,6 +1369,7 @@ pub const Cpu = struct {
13551369 bpfeb ,
13561370 bpfel ,
13571371 csky ,
1372+ ez80 ,
13581373 hexagon ,
13591374 hppa ,
13601375 hppa64 ,
@@ -1453,6 +1468,7 @@ pub const Cpu = struct {
14531468 x86 ,
14541469 xcore ,
14551470 xtensa ,
1471+ z80 ,
14561472 };
14571473
14581474 pub inline fn family (arch : Arch ) Family {
@@ -1465,6 +1481,7 @@ pub const Cpu = struct {
14651481 .avr = > .avr ,
14661482 .bpfeb , .bpfel = > .bpf ,
14671483 .csky = > .csky ,
1484+ .ez80 = > .z80 ,
14681485 .hexagon = > .hexagon ,
14691486 .hppa , .hppa64 = > .hppa ,
14701487 .kalimba = > .kalimba ,
@@ -1691,6 +1708,7 @@ pub const Cpu = struct {
16911708 .x86_64 ,
16921709 .xcore ,
16931710 .xtensa ,
1711+ .ez80 ,
16941712 = > .little ,
16951713
16961714 .aarch64_be ,
@@ -1730,13 +1748,15 @@ pub const Cpu = struct {
17301748 /// All CPU features Zig is aware of, sorted lexicographically by name.
17311749 pub fn allFeaturesList (arch : Arch ) []const Cpu.Feature {
17321750 return switch (arch .family ()) {
1751+ .z80 = > & Target .ez80 .all_features ,
17331752 inline else = > | f | &@field (Target , @tagName (f )).all_features ,
17341753 };
17351754 }
17361755
17371756 /// All processors Zig is aware of, sorted lexicographically by name.
17381757 pub fn allCpuModels (arch : Arch ) []const * const Cpu.Model {
17391758 return switch (arch .family ()) {
1759+ .z80 = > comptime allCpusFromDecls (Target .ez80 .cpu ),
17401760 inline else = > | f | comptime allCpusFromDecls (@field (Target , @tagName (f )).cpu ),
17411761 };
17421762 }
@@ -1951,6 +1971,10 @@ pub const Cpu = struct {
19511971 .spirv_fragment ,
19521972 .spirv_vertex ,
19531973 = > &.{ .spirv32 , .spirv64 },
1974+
1975+ .ez80_ti ,
1976+ .ez80_tiflags ,
1977+ = > &.{.ez80 },
19541978 };
19551979 }
19561980 };
@@ -1977,6 +2001,7 @@ pub const Cpu = struct {
19772001 return switch (arch ) {
19782002 .amdgcn = > & amdgcn .cpu .gfx600 ,
19792003 .avr = > & avr .cpu .avr1 ,
2004+ .ez80 = > & ez80 .cpu .generic ,
19802005 .loongarch32 = > & loongarch .cpu .generic_la32 ,
19812006 .loongarch64 = > & loongarch .cpu .generic_la64 ,
19822007 .mips , .mipsel = > & mips .cpu .mips32 ,
@@ -2224,6 +2249,7 @@ pub fn requiresLibC(target: *const Target) bool {
22242249 .plan9 ,
22252250 .other ,
22262251 .@"3ds" ,
2252+ .tios ,
22272253 = > false ,
22282254 };
22292255}
@@ -2385,6 +2411,8 @@ pub const DynamicLinker = struct {
23852411 .ps4 ,
23862412 .ps5 ,
23872413 .vita ,
2414+
2415+ .tios ,
23882416 = > .none ,
23892417 };
23902418 }
@@ -2802,6 +2830,8 @@ pub const DynamicLinker = struct {
28022830 .opencl ,
28032831 .opengl ,
28042832 .vulkan ,
2833+
2834+ .tios ,
28052835 = > none ,
28062836
28072837 // TODO go over each item in this list and either move it to the above list, or
@@ -2835,6 +2865,9 @@ pub fn ptrBitWidth_arch_abi(cpu_arch: Cpu.Arch, abi: Abi) u16 {
28352865 .msp430 ,
28362866 = > 16 ,
28372867
2868+ .ez80 ,
2869+ = > 24 ,
2870+
28382871 .arc ,
28392872 .arceb ,
28402873 .arm ,
@@ -2902,6 +2935,8 @@ pub fn ptrBitWidth(target: *const Target) u16 {
29022935pub fn stackAlignment (target : * const Target ) u16 {
29032936 // Overrides for when the stack alignment is not equal to the pointer width.
29042937 switch (target .cpu .arch ) {
2938+ .ez80 ,
2939+ = > return 1 ,
29052940 .m68k ,
29062941 = > return 2 ,
29072942 .amdgcn ,
@@ -2981,6 +3016,7 @@ pub fn cCharSignedness(target: *const Target) std.builtin.Signedness {
29813016 .arc ,
29823017 .arceb ,
29833018 .csky ,
3019+ .ez80 ,
29843020 .hexagon ,
29853021 .msp430 ,
29863022 .powerpc ,
@@ -3354,6 +3390,13 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 {
33543390 .long , .ulong = > return 64 ,
33553391 .longlong , .ulonglong , .double , .longdouble = > return 64 ,
33563392 },
3393+ .tios = > switch (c_type ) {
3394+ .char = > return 8 ,
3395+ .short , .ushort = > return 16 ,
3396+ .int , .uint = > return 24 ,
3397+ .long , .ulong , .float , .double = > return 32 ,
3398+ .longlong , .ulonglong , .longdouble = > return 64 ,
3399+ },
33573400
33583401 .ps3 ,
33593402 .contiki ,
@@ -3366,7 +3409,7 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 {
33663409pub fn cTypeAlignment (target : * const Target , c_type : CType ) u16 {
33673410 // Overrides for unusual alignments
33683411 switch (target .cpu .arch ) {
3369- .avr = > return 1 ,
3412+ .avr , .ez80 = > return 1 ,
33703413 .x86 = > switch (target .os .tag ) {
33713414 .windows , .uefi = > switch (c_type ) {
33723415 .longlong , .ulonglong , .double = > return 8 ,
@@ -3403,6 +3446,8 @@ pub fn cTypeAlignment(target: *const Target, c_type: CType) u16 {
34033446 return @min (
34043447 std .math .ceilPowerOfTwoAssert (u16 , (cTypeBitSize (target , c_type ) + 7 ) / 8 ),
34053448 @as (u16 , switch (target .cpu .arch ) {
3449+ .ez80 = > 1 ,
3450+
34063451 .msp430 ,
34073452 = > 2 ,
34083453
@@ -3479,7 +3524,7 @@ pub fn cTypePreferredAlignment(target: *const Target, c_type: CType) u16 {
34793524 .longdouble = > return 4 ,
34803525 else = > {},
34813526 },
3482- .avr = > return 1 ,
3527+ .avr , .ez80 = > return 1 ,
34833528 .x86 = > switch (target .os .tag ) {
34843529 .windows , .uefi = > switch (c_type ) {
34853530 .longdouble = > switch (target .abi ) {
@@ -3511,6 +3556,8 @@ pub fn cTypePreferredAlignment(target: *const Target, c_type: CType) u16 {
35113556 return @min (
35123557 std .math .ceilPowerOfTwoAssert (u16 , (cTypeBitSize (target , c_type ) + 7 ) / 8 ),
35133558 @as (u16 , switch (target .cpu .arch ) {
3559+ .ez80 = > 1 ,
3560+
35143561 .msp430 = > 2 ,
35153562
35163563 .arc ,
@@ -3581,7 +3628,9 @@ pub fn cTypePreferredAlignment(target: *const Target, c_type: CType) u16 {
35813628
35823629pub fn cMaxIntAlignment (target : * const Target ) u16 {
35833630 return switch (target .cpu .arch ) {
3584- .avr = > 1 ,
3631+ .avr ,
3632+ .ez80 ,
3633+ = > 1 ,
35853634
35863635 .msp430 = > 2 ,
35873636
@@ -3717,6 +3766,7 @@ pub fn cCallingConvention(target: *const Target) ?std.builtin.CallingConvention
37173766 .amdgcn = > .{ .amdgcn_device = .{} },
37183767 .nvptx , .nvptx64 = > .nvptx_device ,
37193768 .spirv32 , .spirv64 = > .spirv_device ,
3769+ .ez80 = > .ez80_ti ,
37203770 };
37213771}
37223772
0 commit comments