@@ -459,6 +459,7 @@ pub const Target = struct {
459
459
pub const bpf = @import ("target/bpf.zig" );
460
460
pub const csky = @import ("target/csky.zig" );
461
461
pub const hexagon = @import ("target/hexagon.zig" );
462
+ pub const loongarch = @import ("target/loongarch.zig" );
462
463
pub const m68k = @import ("target/m68k.zig" );
463
464
pub const mips = @import ("target/mips.zig" );
464
465
pub const msp430 = @import ("target/msp430.zig" );
@@ -471,6 +472,7 @@ pub const Target = struct {
471
472
pub const ve = @import ("target/ve.zig" );
472
473
pub const wasm = @import ("target/wasm.zig" );
473
474
pub const x86 = @import ("target/x86.zig" );
475
+ pub const xtensa = @import ("target/xtensa.zig" );
474
476
475
477
pub const Abi = enum {
476
478
none ,
@@ -1007,6 +1009,7 @@ pub const Target = struct {
1007
1009
.thumbeb = > .ARM ,
1008
1010
.x86 = > .@"386" ,
1009
1011
.xcore = > .XCORE ,
1012
+ .xtensa = > .XTENSA ,
1010
1013
.nvptx = > .NONE ,
1011
1014
.amdil = > .NONE ,
1012
1015
.hsail = > .NONE ,
@@ -1032,7 +1035,7 @@ pub const Target = struct {
1032
1035
.spir64 = > .NONE ,
1033
1036
.wasm64 = > .NONE ,
1034
1037
.renderscript64 = > .NONE ,
1035
- .amdgcn = > .NONE ,
1038
+ .amdgcn = > .AMDGPU ,
1036
1039
.bpfel = > .BPF ,
1037
1040
.bpfeb = > .BPF ,
1038
1041
.csky = > .CSKY ,
@@ -1122,6 +1125,7 @@ pub const Target = struct {
1122
1125
.amdil64 ,
1123
1126
.bpfel ,
1124
1127
.csky ,
1128
+ .xtensa ,
1125
1129
.hexagon ,
1126
1130
.hsail ,
1127
1131
.hsail64 ,
@@ -1236,6 +1240,7 @@ pub const Target = struct {
1236
1240
.spirv32 ,
1237
1241
.loongarch32 ,
1238
1242
.dxil ,
1243
+ .xtensa ,
1239
1244
= > return 32 ,
1240
1245
1241
1246
.aarch64 ,
@@ -1271,6 +1276,7 @@ pub const Target = struct {
1271
1276
.arm , .armeb , .thumb , .thumbeb = > "arm" ,
1272
1277
.aarch64 , .aarch64_be , .aarch64_32 = > "aarch64" ,
1273
1278
.bpfel , .bpfeb = > "bpf" ,
1279
+ .loongarch32 , .loongarch64 = > "loongarch" ,
1274
1280
.mips , .mipsel , .mips64 , .mips64el = > "mips" ,
1275
1281
.powerpc , .powerpcle , .powerpc64 , .powerpc64le = > "powerpc" ,
1276
1282
.amdgcn = > "amdgpu" ,
@@ -1290,9 +1296,13 @@ pub const Target = struct {
1290
1296
return switch (arch ) {
1291
1297
.arm , .armeb , .thumb , .thumbeb = > & arm .all_features ,
1292
1298
.aarch64 , .aarch64_be , .aarch64_32 = > & aarch64 .all_features ,
1299
+ .arc = > & arc .all_features ,
1293
1300
.avr = > & avr .all_features ,
1294
1301
.bpfel , .bpfeb = > & bpf .all_features ,
1302
+ .csky = > & csky .all_features ,
1295
1303
.hexagon = > & hexagon .all_features ,
1304
+ .loongarch32 , .loongarch64 = > & loongarch .all_features ,
1305
+ .m68k = > & m68k .all_features ,
1296
1306
.mips , .mipsel , .mips64 , .mips64el = > & mips .all_features ,
1297
1307
.msp430 = > & msp430 .all_features ,
1298
1308
.powerpc , .powerpcle , .powerpc64 , .powerpc64le = > & powerpc .all_features ,
@@ -1302,6 +1312,7 @@ pub const Target = struct {
1302
1312
.spirv32 , .spirv64 = > & spirv .all_features ,
1303
1313
.s390x = > & s390x .all_features ,
1304
1314
.x86 , .x86_64 = > & x86 .all_features ,
1315
+ .xtensa = > & xtensa .all_features ,
1305
1316
.nvptx , .nvptx64 = > & nvptx .all_features ,
1306
1317
.ve = > & ve .all_features ,
1307
1318
.wasm32 , .wasm64 = > & wasm .all_features ,
@@ -1313,11 +1324,15 @@ pub const Target = struct {
1313
1324
/// All processors Zig is aware of, sorted lexicographically by name.
1314
1325
pub fn allCpuModels (arch : Arch ) []const * const Cpu.Model {
1315
1326
return switch (arch ) {
1327
+ .arc = > comptime allCpusFromDecls (arc .cpu ),
1316
1328
.arm , .armeb , .thumb , .thumbeb = > comptime allCpusFromDecls (arm .cpu ),
1317
1329
.aarch64 , .aarch64_be , .aarch64_32 = > comptime allCpusFromDecls (aarch64 .cpu ),
1318
1330
.avr = > comptime allCpusFromDecls (avr .cpu ),
1319
1331
.bpfel , .bpfeb = > comptime allCpusFromDecls (bpf .cpu ),
1332
+ .csky = > comptime allCpusFromDecls (csky .cpu ),
1320
1333
.hexagon = > comptime allCpusFromDecls (hexagon .cpu ),
1334
+ .loongarch32 , .loongarch64 = > comptime allCpusFromDecls (loongarch .cpu ),
1335
+ .m68k = > comptime allCpusFromDecls (m68k .cpu ),
1321
1336
.mips , .mipsel , .mips64 , .mips64el = > comptime allCpusFromDecls (mips .cpu ),
1322
1337
.msp430 = > comptime allCpusFromDecls (msp430 .cpu ),
1323
1338
.powerpc , .powerpcle , .powerpc64 , .powerpc64le = > comptime allCpusFromDecls (powerpc .cpu ),
@@ -1326,6 +1341,7 @@ pub const Target = struct {
1326
1341
.sparc , .sparc64 , .sparcel = > comptime allCpusFromDecls (sparc .cpu ),
1327
1342
.s390x = > comptime allCpusFromDecls (s390x .cpu ),
1328
1343
.x86 , .x86_64 = > comptime allCpusFromDecls (x86 .cpu ),
1344
+ .xtensa = > comptime allCpusFromDecls (xtensa .cpu ),
1329
1345
.nvptx , .nvptx64 = > comptime allCpusFromDecls (nvptx .cpu ),
1330
1346
.ve = > comptime allCpusFromDecls (ve .cpu ),
1331
1347
.wasm32 , .wasm64 = > comptime allCpusFromDecls (wasm .cpu ),
@@ -1373,6 +1389,8 @@ pub const Target = struct {
1373
1389
.avr = > & avr .cpu .avr2 ,
1374
1390
.bpfel , .bpfeb = > & bpf .cpu .generic ,
1375
1391
.hexagon = > & hexagon .cpu .generic ,
1392
+ .loongarch32 = > & loongarch .cpu .generic_la32 ,
1393
+ .loongarch64 = > & loongarch .cpu .generic_la64 ,
1376
1394
.m68k = > & m68k .cpu .generic ,
1377
1395
.mips , .mipsel = > & mips .cpu .mips32 ,
1378
1396
.mips64 , .mips64el = > & mips .cpu .mips64 ,
@@ -1720,6 +1738,7 @@ pub const Target = struct {
1720
1738
.dxil ,
1721
1739
.loongarch32 ,
1722
1740
.loongarch64 ,
1741
+ .xtensa ,
1723
1742
= > return result ,
1724
1743
},
1725
1744
@@ -1884,6 +1903,7 @@ pub const Target = struct {
1884
1903
.dxil ,
1885
1904
.loongarch32 ,
1886
1905
.loongarch64 ,
1906
+ .xtensa ,
1887
1907
= > 16 ,
1888
1908
};
1889
1909
}
0 commit comments