@@ -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 ,
@@ -1430,6 +1445,7 @@ pub const Cpu = struct {
14301445 avr ,
14311446 bpf ,
14321447 csky ,
1448+ ez80 ,
14331449 hexagon ,
14341450 hppa ,
14351451 kalimba ,
@@ -1465,6 +1481,7 @@ pub const Cpu = struct {
14651481 .avr = > .avr ,
14661482 .bpfeb , .bpfel = > .bpf ,
14671483 .csky = > .csky ,
1484+ .ez80 = > .ez80 ,
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 ,
@@ -1951,6 +1969,10 @@ pub const Cpu = struct {
19511969 .spirv_fragment ,
19521970 .spirv_vertex ,
19531971 = > &.{ .spirv32 , .spirv64 },
1972+
1973+ .ez80_sysv ,
1974+ .ez80_tiflags ,
1975+ = > &.{.ez80 },
19541976 };
19551977 }
19561978 };
@@ -2224,6 +2246,7 @@ pub fn requiresLibC(target: *const Target) bool {
22242246 .plan9 ,
22252247 .other ,
22262248 .@"3ds" ,
2249+ .tios ,
22272250 = > false ,
22282251 };
22292252}
@@ -2385,6 +2408,8 @@ pub const DynamicLinker = struct {
23852408 .ps4 ,
23862409 .ps5 ,
23872410 .vita ,
2411+
2412+ .tios ,
23882413 = > .none ,
23892414 };
23902415 }
@@ -2802,6 +2827,8 @@ pub const DynamicLinker = struct {
28022827 .opencl ,
28032828 .opengl ,
28042829 .vulkan ,
2830+
2831+ .tios ,
28052832 = > none ,
28062833
28072834 // TODO go over each item in this list and either move it to the above list, or
@@ -2835,6 +2862,9 @@ pub fn ptrBitWidth_arch_abi(cpu_arch: Cpu.Arch, abi: Abi) u16 {
28352862 .msp430 ,
28362863 = > 16 ,
28372864
2865+ .ez80 ,
2866+ = > 24 ,
2867+
28382868 .arc ,
28392869 .arceb ,
28402870 .arm ,
@@ -2902,6 +2932,8 @@ pub fn ptrBitWidth(target: *const Target) u16 {
29022932pub fn stackAlignment (target : * const Target ) u16 {
29032933 // Overrides for when the stack alignment is not equal to the pointer width.
29042934 switch (target .cpu .arch ) {
2935+ .ez80 ,
2936+ = > return 1 ,
29052937 .m68k ,
29062938 = > return 2 ,
29072939 .amdgcn ,
@@ -2981,6 +3013,7 @@ pub fn cCharSignedness(target: *const Target) std.builtin.Signedness {
29813013 .arc ,
29823014 .arceb ,
29833015 .csky ,
3016+ .ez80 ,
29843017 .hexagon ,
29853018 .msp430 ,
29863019 .powerpc ,
@@ -3354,6 +3387,13 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 {
33543387 .long , .ulong = > return 64 ,
33553388 .longlong , .ulonglong , .double , .longdouble = > return 64 ,
33563389 },
3390+ .tios = > switch (c_type ) {
3391+ .char = > return 8 ,
3392+ .short , .ushort = > return 16 ,
3393+ .int , .uint = > return 24 ,
3394+ .long , .ulong , .float , .double = > return 32 ,
3395+ .longlong , .ulonglong , .longdouble = > return 64 ,
3396+ },
33573397
33583398 .ps3 ,
33593399 .contiki ,
@@ -3366,7 +3406,7 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 {
33663406pub fn cTypeAlignment (target : * const Target , c_type : CType ) u16 {
33673407 // Overrides for unusual alignments
33683408 switch (target .cpu .arch ) {
3369- .avr = > return 1 ,
3409+ .avr , .ez80 = > return 1 ,
33703410 .x86 = > switch (target .os .tag ) {
33713411 .windows , .uefi = > switch (c_type ) {
33723412 .longlong , .ulonglong , .double = > return 8 ,
@@ -3403,6 +3443,8 @@ pub fn cTypeAlignment(target: *const Target, c_type: CType) u16 {
34033443 return @min (
34043444 std .math .ceilPowerOfTwoAssert (u16 , (cTypeBitSize (target , c_type ) + 7 ) / 8 ),
34053445 @as (u16 , switch (target .cpu .arch ) {
3446+ .ez80 = > 1 ,
3447+
34063448 .msp430 ,
34073449 = > 2 ,
34083450
@@ -3479,7 +3521,7 @@ pub fn cTypePreferredAlignment(target: *const Target, c_type: CType) u16 {
34793521 .longdouble = > return 4 ,
34803522 else = > {},
34813523 },
3482- .avr = > return 1 ,
3524+ .avr , .ez80 = > return 1 ,
34833525 .x86 = > switch (target .os .tag ) {
34843526 .windows , .uefi = > switch (c_type ) {
34853527 .longdouble = > switch (target .abi ) {
@@ -3511,6 +3553,8 @@ pub fn cTypePreferredAlignment(target: *const Target, c_type: CType) u16 {
35113553 return @min (
35123554 std .math .ceilPowerOfTwoAssert (u16 , (cTypeBitSize (target , c_type ) + 7 ) / 8 ),
35133555 @as (u16 , switch (target .cpu .arch ) {
3556+ .ez80 = > 1 ,
3557+
35143558 .msp430 = > 2 ,
35153559
35163560 .arc ,
@@ -3581,7 +3625,9 @@ pub fn cTypePreferredAlignment(target: *const Target, c_type: CType) u16 {
35813625
35823626pub fn cMaxIntAlignment (target : * const Target ) u16 {
35833627 return switch (target .cpu .arch ) {
3584- .avr = > 1 ,
3628+ .avr ,
3629+ .ez80 ,
3630+ = > 1 ,
35853631
35863632 .msp430 = > 2 ,
35873633
@@ -3717,6 +3763,7 @@ pub fn cCallingConvention(target: *const Target) ?std.builtin.CallingConvention
37173763 .amdgcn = > .{ .amdgcn_device = .{} },
37183764 .nvptx , .nvptx64 = > .nvptx_device ,
37193765 .spirv32 , .spirv64 = > .spirv_device ,
3766+ .ez80 = > .ez80_sysv ,
37203767 };
37213768}
37223769
0 commit comments