@@ -70,6 +70,8 @@ pub const Os = struct {
70
70
opengl ,
71
71
vulkan ,
72
72
73
+ tios ,
74
+
73
75
// LLVM tags deliberately omitted:
74
76
// - bridgeos
75
77
// - cheriotrtos
@@ -214,6 +216,8 @@ pub const Os = struct {
214
216
.opencl ,
215
217
.opengl ,
216
218
.vulkan ,
219
+
220
+ .tios ,
217
221
= > .semver ,
218
222
219
223
.hurd = > .hurd ,
@@ -676,6 +680,12 @@ pub const Os = struct {
676
680
.max = .{ .major = 4 , .minor = 6 , .patch = 0 },
677
681
},
678
682
},
683
+ .tios = > .{
684
+ .semver = .{
685
+ .min = .{ .major = 5 , .minor = 0 , .patch = 0 },
686
+ .max = .{ .major = 5 , .minor = 8 , .patch = 4 },
687
+ },
688
+ },
679
689
.vulkan = > .{
680
690
.semver = .{
681
691
.min = .{ .major = 1 , .minor = 2 , .patch = 0 },
@@ -740,6 +750,7 @@ pub const arm = @import("Target/arm.zig");
740
750
pub const avr = @import ("Target/avr.zig" );
741
751
pub const bpf = @import ("Target/bpf.zig" );
742
752
pub const csky = @import ("Target/csky.zig" );
753
+ pub const ez80 = @import ("Target/generic.zig" );
743
754
pub const hexagon = @import ("Target/hexagon.zig" );
744
755
pub const hppa = @import ("Target/generic.zig" );
745
756
pub const kalimba = @import ("Target/generic.zig" );
@@ -950,6 +961,7 @@ pub const Abi = enum {
950
961
.opencl ,
951
962
.opengl ,
952
963
.vulkan ,
964
+ .tios ,
953
965
= > .none ,
954
966
};
955
967
}
@@ -1106,6 +1118,7 @@ pub fn toElfMachine(target: *const Target) std.elf.EM {
1106
1118
.xcore = > .XCORE ,
1107
1119
.xtensa , .xtensaeb = > .XTENSA ,
1108
1120
1121
+ .ez80 ,
1109
1122
.nvptx ,
1110
1123
.nvptx64 ,
1111
1124
.spirv32 ,
@@ -1143,6 +1156,7 @@ pub fn toCoffMachine(target: *const Target) std.coff.IMAGE.FILE.MACHINE {
1143
1156
.bpfeb ,
1144
1157
.bpfel ,
1145
1158
.csky ,
1159
+ .ez80 ,
1146
1160
.hexagon ,
1147
1161
.hppa ,
1148
1162
.hppa64 ,
@@ -1355,6 +1369,7 @@ pub const Cpu = struct {
1355
1369
bpfeb ,
1356
1370
bpfel ,
1357
1371
csky ,
1372
+ ez80 ,
1358
1373
hexagon ,
1359
1374
hppa ,
1360
1375
hppa64 ,
@@ -1453,6 +1468,7 @@ pub const Cpu = struct {
1453
1468
x86 ,
1454
1469
xcore ,
1455
1470
xtensa ,
1471
+ z80 ,
1456
1472
};
1457
1473
1458
1474
pub inline fn family (arch : Arch ) Family {
@@ -1465,6 +1481,7 @@ pub const Cpu = struct {
1465
1481
.avr = > .avr ,
1466
1482
.bpfeb , .bpfel = > .bpf ,
1467
1483
.csky = > .csky ,
1484
+ .ez80 = > .z80 ,
1468
1485
.hexagon = > .hexagon ,
1469
1486
.hppa , .hppa64 = > .hppa ,
1470
1487
.kalimba = > .kalimba ,
@@ -1691,6 +1708,7 @@ pub const Cpu = struct {
1691
1708
.x86_64 ,
1692
1709
.xcore ,
1693
1710
.xtensa ,
1711
+ .ez80 ,
1694
1712
= > .little ,
1695
1713
1696
1714
.aarch64_be ,
@@ -1730,13 +1748,15 @@ pub const Cpu = struct {
1730
1748
/// All CPU features Zig is aware of, sorted lexicographically by name.
1731
1749
pub fn allFeaturesList (arch : Arch ) []const Cpu.Feature {
1732
1750
return switch (arch .family ()) {
1751
+ .z80 = > & Target .ez80 .all_features ,
1733
1752
inline else = > | f | &@field (Target , @tagName (f )).all_features ,
1734
1753
};
1735
1754
}
1736
1755
1737
1756
/// All processors Zig is aware of, sorted lexicographically by name.
1738
1757
pub fn allCpuModels (arch : Arch ) []const * const Cpu.Model {
1739
1758
return switch (arch .family ()) {
1759
+ .z80 = > comptime allCpusFromDecls (Target .ez80 .cpu ),
1740
1760
inline else = > | f | comptime allCpusFromDecls (@field (Target , @tagName (f )).cpu ),
1741
1761
};
1742
1762
}
@@ -1951,6 +1971,10 @@ pub const Cpu = struct {
1951
1971
.spirv_fragment ,
1952
1972
.spirv_vertex ,
1953
1973
= > &.{ .spirv32 , .spirv64 },
1974
+
1975
+ .ez80_ti ,
1976
+ .ez80_tiflags ,
1977
+ = > &.{.ez80 },
1954
1978
};
1955
1979
}
1956
1980
};
@@ -1977,6 +2001,7 @@ pub const Cpu = struct {
1977
2001
return switch (arch ) {
1978
2002
.amdgcn = > & amdgcn .cpu .gfx600 ,
1979
2003
.avr = > & avr .cpu .avr1 ,
2004
+ .ez80 = > & ez80 .cpu .generic ,
1980
2005
.loongarch32 = > & loongarch .cpu .generic_la32 ,
1981
2006
.loongarch64 = > & loongarch .cpu .generic_la64 ,
1982
2007
.mips , .mipsel = > & mips .cpu .mips32 ,
@@ -2224,6 +2249,7 @@ pub fn requiresLibC(target: *const Target) bool {
2224
2249
.plan9 ,
2225
2250
.other ,
2226
2251
.@"3ds" ,
2252
+ .tios ,
2227
2253
= > false ,
2228
2254
};
2229
2255
}
@@ -2385,6 +2411,8 @@ pub const DynamicLinker = struct {
2385
2411
.ps4 ,
2386
2412
.ps5 ,
2387
2413
.vita ,
2414
+
2415
+ .tios ,
2388
2416
= > .none ,
2389
2417
};
2390
2418
}
@@ -2802,6 +2830,8 @@ pub const DynamicLinker = struct {
2802
2830
.opencl ,
2803
2831
.opengl ,
2804
2832
.vulkan ,
2833
+
2834
+ .tios ,
2805
2835
= > none ,
2806
2836
2807
2837
// 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 {
2835
2865
.msp430 ,
2836
2866
= > 16 ,
2837
2867
2868
+ .ez80 ,
2869
+ = > 24 ,
2870
+
2838
2871
.arc ,
2839
2872
.arceb ,
2840
2873
.arm ,
@@ -2902,6 +2935,8 @@ pub fn ptrBitWidth(target: *const Target) u16 {
2902
2935
pub fn stackAlignment (target : * const Target ) u16 {
2903
2936
// Overrides for when the stack alignment is not equal to the pointer width.
2904
2937
switch (target .cpu .arch ) {
2938
+ .ez80 ,
2939
+ = > return 1 ,
2905
2940
.m68k ,
2906
2941
= > return 2 ,
2907
2942
.amdgcn ,
@@ -2981,6 +3016,7 @@ pub fn cCharSignedness(target: *const Target) std.builtin.Signedness {
2981
3016
.arc ,
2982
3017
.arceb ,
2983
3018
.csky ,
3019
+ .ez80 ,
2984
3020
.hexagon ,
2985
3021
.msp430 ,
2986
3022
.powerpc ,
@@ -3354,6 +3390,13 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 {
3354
3390
.long , .ulong = > return 64 ,
3355
3391
.longlong , .ulonglong , .double , .longdouble = > return 64 ,
3356
3392
},
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
+ },
3357
3400
3358
3401
.ps3 ,
3359
3402
.contiki ,
@@ -3366,7 +3409,7 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 {
3366
3409
pub fn cTypeAlignment (target : * const Target , c_type : CType ) u16 {
3367
3410
// Overrides for unusual alignments
3368
3411
switch (target .cpu .arch ) {
3369
- .avr = > return 1 ,
3412
+ .avr , .ez80 = > return 1 ,
3370
3413
.x86 = > switch (target .os .tag ) {
3371
3414
.windows , .uefi = > switch (c_type ) {
3372
3415
.longlong , .ulonglong , .double = > return 8 ,
@@ -3403,6 +3446,8 @@ pub fn cTypeAlignment(target: *const Target, c_type: CType) u16 {
3403
3446
return @min (
3404
3447
std .math .ceilPowerOfTwoAssert (u16 , (cTypeBitSize (target , c_type ) + 7 ) / 8 ),
3405
3448
@as (u16 , switch (target .cpu .arch ) {
3449
+ .ez80 = > 1 ,
3450
+
3406
3451
.msp430 ,
3407
3452
= > 2 ,
3408
3453
@@ -3479,7 +3524,7 @@ pub fn cTypePreferredAlignment(target: *const Target, c_type: CType) u16 {
3479
3524
.longdouble = > return 4 ,
3480
3525
else = > {},
3481
3526
},
3482
- .avr = > return 1 ,
3527
+ .avr , .ez80 = > return 1 ,
3483
3528
.x86 = > switch (target .os .tag ) {
3484
3529
.windows , .uefi = > switch (c_type ) {
3485
3530
.longdouble = > switch (target .abi ) {
@@ -3511,6 +3556,8 @@ pub fn cTypePreferredAlignment(target: *const Target, c_type: CType) u16 {
3511
3556
return @min (
3512
3557
std .math .ceilPowerOfTwoAssert (u16 , (cTypeBitSize (target , c_type ) + 7 ) / 8 ),
3513
3558
@as (u16 , switch (target .cpu .arch ) {
3559
+ .ez80 = > 1 ,
3560
+
3514
3561
.msp430 = > 2 ,
3515
3562
3516
3563
.arc ,
@@ -3581,7 +3628,9 @@ pub fn cTypePreferredAlignment(target: *const Target, c_type: CType) u16 {
3581
3628
3582
3629
pub fn cMaxIntAlignment (target : * const Target ) u16 {
3583
3630
return switch (target .cpu .arch ) {
3584
- .avr = > 1 ,
3631
+ .avr ,
3632
+ .ez80 ,
3633
+ = > 1 ,
3585
3634
3586
3635
.msp430 = > 2 ,
3587
3636
@@ -3717,6 +3766,7 @@ pub fn cCallingConvention(target: *const Target) ?std.builtin.CallingConvention
3717
3766
.amdgcn = > .{ .amdgcn_device = .{} },
3718
3767
.nvptx , .nvptx64 = > .nvptx_device ,
3719
3768
.spirv32 , .spirv64 = > .spirv_device ,
3769
+ .ez80 = > .ez80_ti ,
3720
3770
};
3721
3771
}
3722
3772
0 commit comments