Skip to content

Commit 859db0b

Browse files
committed
std.Target: Update CPU models/features for LLVM 20.
Closes #21818.
1 parent 2f7430f commit 859db0b

File tree

17 files changed

+2034
-400
lines changed

17 files changed

+2034
-400
lines changed

lib/std/Target/aarch64.zig

Lines changed: 279 additions & 64 deletions
Large diffs are not rendered by default.

lib/std/Target/amdgcn.zig

Lines changed: 327 additions & 36 deletions
Large diffs are not rendered by default.

lib/std/Target/arm.zig

Lines changed: 86 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ pub const Feature = enum {
1313
aes,
1414
atomics_32,
1515
avoid_movs_shop,
16+
avoid_muls,
1617
avoid_partial_cpsr,
1718
bf16,
1819
big_endian_instructions,
20+
branch_align_64,
1921
cde,
2022
cdecp0,
2123
cdecp1,
@@ -27,6 +29,7 @@ pub const Feature = enum {
2729
cdecp7,
2830
cheap_predicable_cpsr,
2931
clrbhb,
32+
cortex_a510,
3033
crc,
3134
crypto,
3235
d32,
@@ -84,6 +87,7 @@ pub const Feature = enum {
8487
has_v9_3a,
8588
has_v9_4a,
8689
has_v9_5a,
90+
has_v9_6a,
8791
has_v9a,
8892
hwdiv,
8993
hwdiv_arm,
@@ -93,6 +97,8 @@ pub const Feature = enum {
9397
lob,
9498
long_calls,
9599
loop_align,
100+
m55,
101+
m85,
96102
mclass,
97103
mp,
98104
muxed_units,
@@ -180,6 +186,7 @@ pub const Feature = enum {
180186
v9_3a,
181187
v9_4a,
182188
v9_5a,
189+
v9_6a,
183190
v9a,
184191
vfp2,
185192
vfp2sp,
@@ -252,6 +259,11 @@ pub const all_features = blk: {
252259
.description = "Avoid movs instructions with shifter operand",
253260
.dependencies = featureSet(&[_]Feature{}),
254261
};
262+
result[@intFromEnum(Feature.avoid_muls)] = .{
263+
.llvm_name = "avoid-muls",
264+
.description = "Avoid MULS instructions for M class cores",
265+
.dependencies = featureSet(&[_]Feature{}),
266+
};
255267
result[@intFromEnum(Feature.avoid_partial_cpsr)] = .{
256268
.llvm_name = "avoid-partial-cpsr",
257269
.description = "Avoid CPSR partial update for OOO execution",
@@ -269,6 +281,11 @@ pub const all_features = blk: {
269281
.description = "Expect instructions to be stored big-endian.",
270282
.dependencies = featureSet(&[_]Feature{}),
271283
};
284+
result[@intFromEnum(Feature.branch_align_64)] = .{
285+
.llvm_name = "branch-align-64",
286+
.description = "Prefer 64-bit alignment for branch targets",
287+
.dependencies = featureSet(&[_]Feature{}),
288+
};
272289
result[@intFromEnum(Feature.cde)] = .{
273290
.llvm_name = "cde",
274291
.description = "Support CDE instructions",
@@ -342,6 +359,11 @@ pub const all_features = blk: {
342359
.description = "Enable Clear BHB instruction",
343360
.dependencies = featureSet(&[_]Feature{}),
344361
};
362+
result[@intFromEnum(Feature.cortex_a510)] = .{
363+
.llvm_name = "cortex-a510",
364+
.description = "Cortex-A510 ARM processors",
365+
.dependencies = featureSet(&[_]Feature{}),
366+
};
345367
result[@intFromEnum(Feature.crc)] = .{
346368
.llvm_name = "crc",
347369
.description = "Enable support for CRC instructions",
@@ -719,6 +741,13 @@ pub const all_features = blk: {
719741
.has_v9_4a,
720742
}),
721743
};
744+
result[@intFromEnum(Feature.has_v9_6a)] = .{
745+
.llvm_name = "v9.6a",
746+
.description = "Support ARM v9.6a instructions",
747+
.dependencies = featureSet(&[_]Feature{
748+
.has_v9_5a,
749+
}),
750+
};
722751
result[@intFromEnum(Feature.has_v9a)] = .{
723752
.llvm_name = "v9a",
724753
.description = "Support ARM v9a instructions",
@@ -769,7 +798,17 @@ pub const all_features = blk: {
769798
};
770799
result[@intFromEnum(Feature.loop_align)] = .{
771800
.llvm_name = "loop-align",
772-
.description = "Prefer 32-bit alignment for loops",
801+
.description = "Prefer 32-bit alignment for branch targets",
802+
.dependencies = featureSet(&[_]Feature{}),
803+
};
804+
result[@intFromEnum(Feature.m55)] = .{
805+
.llvm_name = "m55",
806+
.description = "Cortex-M55 ARM processors",
807+
.dependencies = featureSet(&[_]Feature{}),
808+
};
809+
result[@intFromEnum(Feature.m85)] = .{
810+
.llvm_name = "m85",
811+
.description = "Cortex-M85 ARM processors",
773812
.dependencies = featureSet(&[_]Feature{}),
774813
};
775814
result[@intFromEnum(Feature.mclass)] = .{
@@ -1524,6 +1563,22 @@ pub const all_features = blk: {
15241563
.virtualization,
15251564
}),
15261565
};
1566+
result[@intFromEnum(Feature.v9_6a)] = .{
1567+
.llvm_name = "armv9.6-a",
1568+
.description = "ARMv96a architecture",
1569+
.dependencies = featureSet(&[_]Feature{
1570+
.aclass,
1571+
.crc,
1572+
.db,
1573+
.dsp,
1574+
.fp_armv8,
1575+
.has_v9_6a,
1576+
.mp,
1577+
.ras,
1578+
.trustzone,
1579+
.virtualization,
1580+
}),
1581+
};
15271582
result[@intFromEnum(Feature.v9a)] = .{
15281583
.llvm_name = "armv9-a",
15291584
.description = "ARMv9a architecture",
@@ -1950,6 +2005,16 @@ pub const cpu = struct {
19502005
.vmlx_forwarding,
19512006
}),
19522007
};
2008+
pub const cortex_a510: CpuModel = .{
2009+
.name = "cortex_a510",
2010+
.llvm_name = "cortex-a510",
2011+
.features = featureSet(&[_]Feature{
2012+
.bf16,
2013+
.fp16fml,
2014+
.i8mm,
2015+
.v9a,
2016+
}),
2017+
};
19532018
pub const cortex_a53: CpuModel = .{
19542019
.name = "cortex_a53",
19552020
.llvm_name = "cortex-a53",
@@ -2162,6 +2227,7 @@ pub const cpu = struct {
21622227
.name = "cortex_m33",
21632228
.llvm_name = "cortex-m33",
21642229
.features = featureSet(&[_]Feature{
2230+
.avoid_muls,
21652231
.fix_cmse_cve_2021_35465,
21662232
.loop_align,
21672233
.no_branch_predictor,
@@ -2218,6 +2284,7 @@ pub const cpu = struct {
22182284
.dsp,
22192285
.fix_cmse_cve_2021_35465,
22202286
.loop_align,
2287+
.m55,
22212288
.no_branch_predictor,
22222289
.slowfpvmlx,
22232290
.use_misched,
@@ -2228,6 +2295,7 @@ pub const cpu = struct {
22282295
.name = "cortex_m7",
22292296
.llvm_name = "cortex-m7",
22302297
.features = featureSet(&[_]Feature{
2298+
.branch_align_64,
22312299
.use_mipipeliner,
22322300
.use_misched,
22332301
.v7em,
@@ -2237,7 +2305,9 @@ pub const cpu = struct {
22372305
.name = "cortex_m85",
22382306
.llvm_name = "cortex-m85",
22392307
.features = featureSet(&[_]Feature{
2308+
.branch_align_64,
22402309
.dsp,
2310+
.m85,
22412311
.use_misched,
22422312
.v8_1m_main,
22432313
}),
@@ -2572,6 +2642,21 @@ pub const cpu = struct {
25722642
.v7m,
25732643
}),
25742644
};
2645+
pub const star_mc1: CpuModel = .{
2646+
.name = "star_mc1",
2647+
.llvm_name = "star-mc1",
2648+
.features = featureSet(&[_]Feature{
2649+
.dsp,
2650+
.fix_cmse_cve_2021_35465,
2651+
.fp_armv8d16sp,
2652+
.loop_align,
2653+
.no_branch_predictor,
2654+
.slowfpvfmx,
2655+
.slowfpvmlx,
2656+
.use_misched,
2657+
.v8m_main,
2658+
}),
2659+
};
25752660
pub const strongarm: CpuModel = .{
25762661
.name = "strongarm",
25772662
.llvm_name = "strongarm",

lib/std/Target/avr.zig

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ pub const Feature = enum {
3838
spmx,
3939
sram,
4040
tinyencoding,
41+
wrappingrjmp,
4142
xmega,
4243
xmega3,
4344
xmegau,
@@ -289,6 +290,11 @@ pub const all_features = blk: {
289290
.description = "The device has Tiny core specific instruction encodings",
290291
.dependencies = featureSet(&[_]Feature{}),
291292
};
293+
result[@intFromEnum(Feature.wrappingrjmp)] = .{
294+
.llvm_name = "wrappingrjmp",
295+
.description = "The device potentially requires emitting rjmp that wraps across the flash boundary",
296+
.dependencies = featureSet(&[_]Feature{}),
297+
};
292298
result[@intFromEnum(Feature.xmega)] = .{
293299
.llvm_name = "xmega",
294300
.description = "The device is a part of the xmega family",
@@ -381,6 +387,7 @@ pub const cpu = struct {
381387
.llvm_name = "at90c8534",
382388
.features = featureSet(&[_]Feature{
383389
.avr2,
390+
.wrappingrjmp,
384391
}),
385392
};
386393
pub const at90can128: CpuModel = .{
@@ -536,13 +543,15 @@ pub const cpu = struct {
536543
.llvm_name = "at90s8515",
537544
.features = featureSet(&[_]Feature{
538545
.avr2,
546+
.wrappingrjmp,
539547
}),
540548
};
541549
pub const at90s8535: CpuModel = .{
542550
.name = "at90s8535",
543551
.llvm_name = "at90s8535",
544552
.features = featureSet(&[_]Feature{
545553
.avr2,
554+
.wrappingrjmp,
546555
}),
547556
};
548557
pub const at90scr100: CpuModel = .{
@@ -609,6 +618,7 @@ pub const cpu = struct {
609618
.llvm_name = "ata5272",
610619
.features = featureSet(&[_]Feature{
611620
.avr25,
621+
.wrappingrjmp,
612622
}),
613623
};
614624
pub const ata5505: CpuModel = .{
@@ -672,6 +682,7 @@ pub const cpu = struct {
672682
.llvm_name = "ata6285",
673683
.features = featureSet(&[_]Feature{
674684
.avr4,
685+
.wrappingrjmp,
675686
}),
676687
};
677688
pub const ata6286: CpuModel = .{
@@ -714,6 +725,7 @@ pub const cpu = struct {
714725
.llvm_name = "ata6616c",
715726
.features = featureSet(&[_]Feature{
716727
.avr25,
728+
.wrappingrjmp,
717729
}),
718730
};
719731
pub const ata6617c: CpuModel = .{
@@ -1545,6 +1557,7 @@ pub const cpu = struct {
15451557
.movw,
15461558
.mul,
15471559
.spm,
1560+
.wrappingrjmp,
15481561
}),
15491562
};
15501563
pub const atmega808: CpuModel = .{
@@ -1570,6 +1583,7 @@ pub const cpu = struct {
15701583
.movw,
15711584
.mul,
15721585
.spm,
1586+
.wrappingrjmp,
15731587
}),
15741588
};
15751589
pub const atmega8535: CpuModel = .{
@@ -1581,6 +1595,7 @@ pub const cpu = struct {
15811595
.movw,
15821596
.mul,
15831597
.spm,
1598+
.wrappingrjmp,
15841599
}),
15851600
};
15861601
pub const atmega88: CpuModel = .{
@@ -1627,6 +1642,7 @@ pub const cpu = struct {
16271642
.movw,
16281643
.mul,
16291644
.spm,
1645+
.wrappingrjmp,
16301646
}),
16311647
};
16321648
pub const atmega8hva: CpuModel = .{
@@ -2091,62 +2107,71 @@ pub const cpu = struct {
20912107
.llvm_name = "attiny828",
20922108
.features = featureSet(&[_]Feature{
20932109
.avr25,
2110+
.wrappingrjmp,
20942111
}),
20952112
};
20962113
pub const attiny84: CpuModel = .{
20972114
.name = "attiny84",
20982115
.llvm_name = "attiny84",
20992116
.features = featureSet(&[_]Feature{
21002117
.avr25,
2118+
.wrappingrjmp,
21012119
}),
21022120
};
21032121
pub const attiny841: CpuModel = .{
21042122
.name = "attiny841",
21052123
.llvm_name = "attiny841",
21062124
.features = featureSet(&[_]Feature{
21072125
.avr25,
2126+
.wrappingrjmp,
21082127
}),
21092128
};
21102129
pub const attiny84a: CpuModel = .{
21112130
.name = "attiny84a",
21122131
.llvm_name = "attiny84a",
21132132
.features = featureSet(&[_]Feature{
21142133
.avr25,
2134+
.wrappingrjmp,
21152135
}),
21162136
};
21172137
pub const attiny85: CpuModel = .{
21182138
.name = "attiny85",
21192139
.llvm_name = "attiny85",
21202140
.features = featureSet(&[_]Feature{
21212141
.avr25,
2142+
.wrappingrjmp,
21222143
}),
21232144
};
21242145
pub const attiny861: CpuModel = .{
21252146
.name = "attiny861",
21262147
.llvm_name = "attiny861",
21272148
.features = featureSet(&[_]Feature{
21282149
.avr25,
2150+
.wrappingrjmp,
21292151
}),
21302152
};
21312153
pub const attiny861a: CpuModel = .{
21322154
.name = "attiny861a",
21332155
.llvm_name = "attiny861a",
21342156
.features = featureSet(&[_]Feature{
21352157
.avr25,
2158+
.wrappingrjmp,
21362159
}),
21372160
};
21382161
pub const attiny87: CpuModel = .{
21392162
.name = "attiny87",
21402163
.llvm_name = "attiny87",
21412164
.features = featureSet(&[_]Feature{
21422165
.avr25,
2166+
.wrappingrjmp,
21432167
}),
21442168
};
21452169
pub const attiny88: CpuModel = .{
21462170
.name = "attiny88",
21472171
.llvm_name = "attiny88",
21482172
.features = featureSet(&[_]Feature{
21492173
.avr25,
2174+
.wrappingrjmp,
21502175
}),
21512176
};
21522177
pub const attiny9: CpuModel = .{

0 commit comments

Comments
 (0)