| author | |
| committer | |
| log | 84f1893c18c4ef12dbe268ed6d11a11966a9d447 |
| tree | e2c3e3600464c62589a63c7f1bb0f7ffda3fee16 |
| parent | 96f45c27b65307fe4abd5d1fb1cf314b1f493d8e |
| signature |
in favor of CPU features. Also rearrange the `std.Target`
data structure.
* note: `@import("builtin")` was already deprecated in favor of
`@import("std").builtin`.
* `std.builtin.arch` is now deprecated in favor of
`std.builtin.cpu.arch`.
* `std.Target.CpuFeatures.Cpu` is now `std.Target.Cpu.Model`.
* `std.Target.CpuFeatures` is now `std.Target.Cpu`.
* `std.Target` no longer has an `arch` field. Instead it has a
`cpu` field, which has `arch`, `model`, and `features`.
* `std.Target` no longer has a `cpu_features` field.
* `std.Target.Arch` is moved to `std.Target.Cpu.Arch` and
it is an enum instead of a tagged union.
* `std.Target.parseOs` is moved to `std.Target.Os.parse`.
* `std.Target.parseAbi` is moved to `std.Target.Abi.parse`.
* `std.Target.parseArchSub` is only for arch now and moved
to `std.Target.Cpu.Arch.parse`.
* `std.Target.parse` is improved to accept CPU name and features.
* `std.Target.Arch.getBaselineCpuFeatures` is moved to
`std.Target.Cpu.baseline`.
* `std.Target.allCpus` is renamed to `std.Target.allCpuModels`.
* `std.Target.defaultAbi` is moved to `std.Target.Abi.default`.
* Significant cleanup of aarch64 and arm CPU features, resulting in
the needed bit count for cpu feature set going from 174 to 138.
* Add `std.Target.Cpu.Feature.Set.addFeatureSet` for merging
feature sets together.
`-target-feature` and `-target-cpu` are removed in favor of
`-mcpu`, to conform to established conventions, and it gains
additional power to support cpu features. The syntax is:
-mcpu=name+on1+on2-off1-off2
closes #426128 files changed, 1739 insertions(+), 2225 deletions(-)
lib/std/builtin.zig+2-5| ... | ... | @@ -6,8 +6,8 @@ pub const Target = std.Target; |
| 6 | 6 | /// Deprecated: use `std.Target.Os`. |
| 7 | 7 | pub const Os = std.Target.Os; |
| 8 | 8 | |
| 9 | /// Deprecated: use `std.Target.Arch`. | |
| 10 | pub const Arch = std.Target.Arch; | |
| 9 | /// Deprecated: use `std.Target.Cpu.Arch`. | |
| 10 | pub const Arch = std.Target.Cpu.Arch; | |
| 11 | 11 | |
| 12 | 12 | /// Deprecated: use `std.Target.Abi`. |
| 13 | 13 | pub const Abi = std.Target.Abi; |
| ... | ... | @@ -18,9 +18,6 @@ pub const ObjectFormat = std.Target.ObjectFormat; |
| 18 | 18 | /// Deprecated: use `std.Target.SubSystem`. |
| 19 | 19 | pub const SubSystem = std.Target.SubSystem; |
| 20 | 20 | |
| 21 | /// Deprecated: use `std.Target.CpuFeatures`. | |
| 22 | pub const CpuFeatures = std.Target.CpuFeatures; | |
| 23 | ||
| 24 | 21 | /// Deprecated: use `std.Target.Cpu`. |
| 25 | 22 | pub const Cpu = std.Target.Cpu; |
| 26 | 23 |
lib/std/target.zig+550-642| ... | ... | @@ -47,6 +47,18 @@ pub const Target = union(enum) { |
| 47 | 47 | emscripten, |
| 48 | 48 | uefi, |
| 49 | 49 | other, |
| 50 | ||
| 51 | pub fn parse(text: []const u8) !Os { | |
| 52 | if (mem.eql(u8, text, "native")) return builtin.os; | |
| 53 | ||
| 54 | const info = @typeInfo(Os); | |
| 55 | inline for (info.Enum.fields) |field| { | |
| 56 | if (mem.eql(u8, text, field.name)) { | |
| 57 | return @field(Os, field.name); | |
| 58 | } | |
| 59 | } | |
| 60 | return error.UnknownOperatingSystem; | |
| 61 | } | |
| 50 | 62 | }; |
| 51 | 63 | |
| 52 | 64 | pub const aarch64 = @import("target/aarch64.zig"); |
| ... | ... | @@ -65,457 +77,6 @@ pub const Target = union(enum) { |
| 65 | 77 | pub const wasm = @import("target/wasm.zig"); |
| 66 | 78 | pub const x86 = @import("target/x86.zig"); |
| 67 | 79 | |
| 68 | pub const Arch = union(enum) { | |
| 69 | arm: Arm32, | |
| 70 | armeb: Arm32, | |
| 71 | aarch64: Arm64, | |
| 72 | aarch64_be: Arm64, | |
| 73 | aarch64_32: Arm64, | |
| 74 | arc, | |
| 75 | avr, | |
| 76 | bpfel, | |
| 77 | bpfeb, | |
| 78 | hexagon, | |
| 79 | mips, | |
| 80 | mipsel, | |
| 81 | mips64, | |
| 82 | mips64el, | |
| 83 | msp430, | |
| 84 | powerpc, | |
| 85 | powerpc64, | |
| 86 | powerpc64le, | |
| 87 | r600, | |
| 88 | amdgcn, | |
| 89 | riscv32, | |
| 90 | riscv64, | |
| 91 | sparc, | |
| 92 | sparcv9, | |
| 93 | sparcel, | |
| 94 | s390x, | |
| 95 | tce, | |
| 96 | tcele, | |
| 97 | thumb: Arm32, | |
| 98 | thumbeb: Arm32, | |
| 99 | i386, | |
| 100 | x86_64, | |
| 101 | xcore, | |
| 102 | nvptx, | |
| 103 | nvptx64, | |
| 104 | le32, | |
| 105 | le64, | |
| 106 | amdil, | |
| 107 | amdil64, | |
| 108 | hsail, | |
| 109 | hsail64, | |
| 110 | spir, | |
| 111 | spir64, | |
| 112 | kalimba: Kalimba, | |
| 113 | shave, | |
| 114 | lanai, | |
| 115 | wasm32, | |
| 116 | wasm64, | |
| 117 | renderscript32, | |
| 118 | renderscript64, | |
| 119 | ||
| 120 | pub const Arm32 = enum { | |
| 121 | v8_5a, | |
| 122 | v8_4a, | |
| 123 | v8_3a, | |
| 124 | v8_2a, | |
| 125 | v8_1a, | |
| 126 | v8a, | |
| 127 | v8r, | |
| 128 | v8m_baseline, | |
| 129 | v8m_mainline, | |
| 130 | v8_1m_mainline, | |
| 131 | v7a, | |
| 132 | v7em, | |
| 133 | v7m, | |
| 134 | v7s, | |
| 135 | v7k, | |
| 136 | v7ve, | |
| 137 | v6, | |
| 138 | v6m, | |
| 139 | v6k, | |
| 140 | v6t2, | |
| 141 | v5, | |
| 142 | v5te, | |
| 143 | v4t, | |
| 144 | ||
| 145 | pub fn version(version: Arm32) comptime_int { | |
| 146 | return switch (version) { | |
| 147 | .v8_5a, .v8_4a, .v8_3a, .v8_2a, .v8_1a, .v8a, .v8r, .v8m_baseline, .v8m_mainline, .v8_1m_mainline => 8, | |
| 148 | .v7a, .v7em, .v7m, .v7s, .v7k, .v7ve => 7, | |
| 149 | .v6, .v6m, .v6k, .v6t2 => 6, | |
| 150 | .v5, .v5te => 5, | |
| 151 | .v4t => 4, | |
| 152 | }; | |
| 153 | } | |
| 154 | }; | |
| 155 | pub const Arm64 = enum { | |
| 156 | v8_5a, | |
| 157 | v8_4a, | |
| 158 | v8_3a, | |
| 159 | v8_2a, | |
| 160 | v8_1a, | |
| 161 | v8a, | |
| 162 | }; | |
| 163 | pub const Kalimba = enum { | |
| 164 | v5, | |
| 165 | v4, | |
| 166 | v3, | |
| 167 | }; | |
| 168 | pub const Mips = enum { | |
| 169 | r6, | |
| 170 | }; | |
| 171 | ||
| 172 | pub fn subArchName(arch: Arch) ?[]const u8 { | |
| 173 | return switch (arch) { | |
| 174 | .arm, .armeb, .thumb, .thumbeb => |arm32| @tagName(arm32), | |
| 175 | .aarch64, .aarch64_be, .aarch64_32 => |arm64| @tagName(arm64), | |
| 176 | .kalimba => |kalimba| @tagName(kalimba), | |
| 177 | else => return null, | |
| 178 | }; | |
| 179 | } | |
| 180 | ||
| 181 | pub fn subArchFeature(arch: Arch) ?Cpu.Feature.Set.Index { | |
| 182 | return switch (arch) { | |
| 183 | .arm, .armeb, .thumb, .thumbeb => |arm32| switch (arm32) { | |
| 184 | .v8_5a => @enumToInt(arm.Feature.armv8_5_a), | |
| 185 | .v8_4a => @enumToInt(arm.Feature.armv8_4_a), | |
| 186 | .v8_3a => @enumToInt(arm.Feature.armv8_3_a), | |
| 187 | .v8_2a => @enumToInt(arm.Feature.armv8_2_a), | |
| 188 | .v8_1a => @enumToInt(arm.Feature.armv8_1_a), | |
| 189 | .v8a => @enumToInt(arm.Feature.armv8_a), | |
| 190 | .v8r => @enumToInt(arm.Feature.armv8_r), | |
| 191 | .v8m_baseline => @enumToInt(arm.Feature.armv8_m_base), | |
| 192 | .v8m_mainline => @enumToInt(arm.Feature.armv8_m_main), | |
| 193 | .v8_1m_mainline => @enumToInt(arm.Feature.armv8_1_m_main), | |
| 194 | .v7a => @enumToInt(arm.Feature.armv7_a), | |
| 195 | .v7em => @enumToInt(arm.Feature.armv7e_m), | |
| 196 | .v7m => @enumToInt(arm.Feature.armv7_m), | |
| 197 | .v7s => @enumToInt(arm.Feature.armv7s), | |
| 198 | .v7k => @enumToInt(arm.Feature.armv7k), | |
| 199 | .v7ve => @enumToInt(arm.Feature.armv7ve), | |
| 200 | .v6 => @enumToInt(arm.Feature.armv6), | |
| 201 | .v6m => @enumToInt(arm.Feature.armv6_m), | |
| 202 | .v6k => @enumToInt(arm.Feature.armv6k), | |
| 203 | .v6t2 => @enumToInt(arm.Feature.armv6t2), | |
| 204 | .v5 => @enumToInt(arm.Feature.armv5t), | |
| 205 | .v5te => @enumToInt(arm.Feature.armv5te), | |
| 206 | .v4t => @enumToInt(arm.Feature.armv4t), | |
| 207 | }, | |
| 208 | .aarch64, .aarch64_be, .aarch64_32 => |arm64| switch (arm64) { | |
| 209 | .v8_5a => @enumToInt(aarch64.Feature.v8_5a), | |
| 210 | .v8_4a => @enumToInt(aarch64.Feature.v8_4a), | |
| 211 | .v8_3a => @enumToInt(aarch64.Feature.v8_3a), | |
| 212 | .v8_2a => @enumToInt(aarch64.Feature.v8_2a), | |
| 213 | .v8_1a => @enumToInt(aarch64.Feature.v8_1a), | |
| 214 | .v8a => @enumToInt(aarch64.Feature.v8a), | |
| 215 | }, | |
| 216 | else => return null, | |
| 217 | }; | |
| 218 | } | |
| 219 | ||
| 220 | pub fn isARM(arch: Arch) bool { | |
| 221 | return switch (arch) { | |
| 222 | .arm, .armeb => true, | |
| 223 | else => false, | |
| 224 | }; | |
| 225 | } | |
| 226 | ||
| 227 | pub fn isThumb(arch: Arch) bool { | |
| 228 | return switch (arch) { | |
| 229 | .thumb, .thumbeb => true, | |
| 230 | else => false, | |
| 231 | }; | |
| 232 | } | |
| 233 | ||
| 234 | pub fn isWasm(arch: Arch) bool { | |
| 235 | return switch (arch) { | |
| 236 | .wasm32, .wasm64 => true, | |
| 237 | else => false, | |
| 238 | }; | |
| 239 | } | |
| 240 | ||
| 241 | pub fn isRISCV(arch: Arch) bool { | |
| 242 | return switch (arch) { | |
| 243 | .riscv32, .riscv64 => true, | |
| 244 | else => false, | |
| 245 | }; | |
| 246 | } | |
| 247 | ||
| 248 | pub fn isMIPS(arch: Arch) bool { | |
| 249 | return switch (arch) { | |
| 250 | .mips, .mipsel, .mips64, .mips64el => true, | |
| 251 | else => false, | |
| 252 | }; | |
| 253 | } | |
| 254 | ||
| 255 | pub fn parseCpu(arch: Arch, cpu_name: []const u8) !*const Cpu { | |
| 256 | for (arch.allCpus()) |cpu| { | |
| 257 | if (mem.eql(u8, cpu_name, cpu.name)) { | |
| 258 | return cpu; | |
| 259 | } | |
| 260 | } | |
| 261 | return error.UnknownCpu; | |
| 262 | } | |
| 263 | ||
| 264 | /// Comma-separated list of features, with + or - in front of each feature. This | |
| 265 | /// form represents a deviation from baseline CPU, which is provided as a parameter. | |
| 266 | /// Extra commas are ignored. | |
| 267 | pub fn parseCpuFeatureSet(arch: Arch, cpu: *const Cpu, features_text: []const u8) !Cpu.Feature.Set { | |
| 268 | const all_features = arch.allFeaturesList(); | |
| 269 | var set = cpu.features; | |
| 270 | var it = mem.tokenize(features_text, ","); | |
| 271 | while (it.next()) |item_text| { | |
| 272 | var feature_name: []const u8 = undefined; | |
| 273 | var op: enum { | |
| 274 | add, | |
| 275 | sub, | |
| 276 | } = undefined; | |
| 277 | if (mem.startsWith(u8, item_text, "+")) { | |
| 278 | op = .add; | |
| 279 | feature_name = item_text[1..]; | |
| 280 | } else if (mem.startsWith(u8, item_text, "-")) { | |
| 281 | op = .sub; | |
| 282 | feature_name = item_text[1..]; | |
| 283 | } else { | |
| 284 | return error.InvalidCpuFeatures; | |
| 285 | } | |
| 286 | for (all_features) |feature, index_usize| { | |
| 287 | const index = @intCast(Cpu.Feature.Set.Index, index_usize); | |
| 288 | if (mem.eql(u8, feature_name, feature.name)) { | |
| 289 | switch (op) { | |
| 290 | .add => set.addFeature(index), | |
| 291 | .sub => set.removeFeature(index), | |
| 292 | } | |
| 293 | break; | |
| 294 | } | |
| 295 | } else { | |
| 296 | return error.UnknownCpuFeature; | |
| 297 | } | |
| 298 | } | |
| 299 | return set; | |
| 300 | } | |
| 301 | ||
| 302 | pub fn toElfMachine(arch: Arch) std.elf.EM { | |
| 303 | return switch (arch) { | |
| 304 | .avr => ._AVR, | |
| 305 | .msp430 => ._MSP430, | |
| 306 | .arc => ._ARC, | |
| 307 | .arm => ._ARM, | |
| 308 | .armeb => ._ARM, | |
| 309 | .hexagon => ._HEXAGON, | |
| 310 | .le32 => ._NONE, | |
| 311 | .mips => ._MIPS, | |
| 312 | .mipsel => ._MIPS_RS3_LE, | |
| 313 | .powerpc => ._PPC, | |
| 314 | .r600 => ._NONE, | |
| 315 | .riscv32 => ._RISCV, | |
| 316 | .sparc => ._SPARC, | |
| 317 | .sparcel => ._SPARC, | |
| 318 | .tce => ._NONE, | |
| 319 | .tcele => ._NONE, | |
| 320 | .thumb => ._ARM, | |
| 321 | .thumbeb => ._ARM, | |
| 322 | .i386 => ._386, | |
| 323 | .xcore => ._XCORE, | |
| 324 | .nvptx => ._NONE, | |
| 325 | .amdil => ._NONE, | |
| 326 | .hsail => ._NONE, | |
| 327 | .spir => ._NONE, | |
| 328 | .kalimba => ._CSR_KALIMBA, | |
| 329 | .shave => ._NONE, | |
| 330 | .lanai => ._LANAI, | |
| 331 | .wasm32 => ._NONE, | |
| 332 | .renderscript32 => ._NONE, | |
| 333 | .aarch64_32 => ._AARCH64, | |
| 334 | .aarch64 => ._AARCH64, | |
| 335 | .aarch64_be => ._AARCH64, | |
| 336 | .mips64 => ._MIPS, | |
| 337 | .mips64el => ._MIPS_RS3_LE, | |
| 338 | .powerpc64 => ._PPC64, | |
| 339 | .powerpc64le => ._PPC64, | |
| 340 | .riscv64 => ._RISCV, | |
| 341 | .x86_64 => ._X86_64, | |
| 342 | .nvptx64 => ._NONE, | |
| 343 | .le64 => ._NONE, | |
| 344 | .amdil64 => ._NONE, | |
| 345 | .hsail64 => ._NONE, | |
| 346 | .spir64 => ._NONE, | |
| 347 | .wasm64 => ._NONE, | |
| 348 | .renderscript64 => ._NONE, | |
| 349 | .amdgcn => ._NONE, | |
| 350 | .bpfel => ._BPF, | |
| 351 | .bpfeb => ._BPF, | |
| 352 | .sparcv9 => ._SPARCV9, | |
| 353 | .s390x => ._S390, | |
| 354 | }; | |
| 355 | } | |
| 356 | ||
| 357 | pub fn endian(arch: Arch) builtin.Endian { | |
| 358 | return switch (arch) { | |
| 359 | .avr, | |
| 360 | .arm, | |
| 361 | .aarch64_32, | |
| 362 | .aarch64, | |
| 363 | .amdgcn, | |
| 364 | .amdil, | |
| 365 | .amdil64, | |
| 366 | .bpfel, | |
| 367 | .hexagon, | |
| 368 | .hsail, | |
| 369 | .hsail64, | |
| 370 | .kalimba, | |
| 371 | .le32, | |
| 372 | .le64, | |
| 373 | .mipsel, | |
| 374 | .mips64el, | |
| 375 | .msp430, | |
| 376 | .nvptx, | |
| 377 | .nvptx64, | |
| 378 | .sparcel, | |
| 379 | .tcele, | |
| 380 | .powerpc64le, | |
| 381 | .r600, | |
| 382 | .riscv32, | |
| 383 | .riscv64, | |
| 384 | .i386, | |
| 385 | .x86_64, | |
| 386 | .wasm32, | |
| 387 | .wasm64, | |
| 388 | .xcore, | |
| 389 | .thumb, | |
| 390 | .spir, | |
| 391 | .spir64, | |
| 392 | .renderscript32, | |
| 393 | .renderscript64, | |
| 394 | .shave, | |
| 395 | => .Little, | |
| 396 | ||
| 397 | .arc, | |
| 398 | .armeb, | |
| 399 | .aarch64_be, | |
| 400 | .bpfeb, | |
| 401 | .mips, | |
| 402 | .mips64, | |
| 403 | .powerpc, | |
| 404 | .powerpc64, | |
| 405 | .thumbeb, | |
| 406 | .sparc, | |
| 407 | .sparcv9, | |
| 408 | .tce, | |
| 409 | .lanai, | |
| 410 | .s390x, | |
| 411 | => .Big, | |
| 412 | }; | |
| 413 | } | |
| 414 | ||
| 415 | /// Returns a name that matches the lib/std/target/* directory name. | |
| 416 | pub fn genericName(arch: Arch) []const u8 { | |
| 417 | return switch (arch) { | |
| 418 | .arm, .armeb, .thumb, .thumbeb => "arm", | |
| 419 | .aarch64, .aarch64_be, .aarch64_32 => "aarch64", | |
| 420 | .avr => "avr", | |
| 421 | .bpfel, .bpfeb => "bpf", | |
| 422 | .hexagon => "hexagon", | |
| 423 | .mips, .mipsel, .mips64, .mips64el => "mips", | |
| 424 | .msp430 => "msp430", | |
| 425 | .powerpc, .powerpc64, .powerpc64le => "powerpc", | |
| 426 | .amdgcn => "amdgpu", | |
| 427 | .riscv32, .riscv64 => "riscv", | |
| 428 | .sparc, .sparcv9, .sparcel => "sparc", | |
| 429 | .s390x => "systemz", | |
| 430 | .i386, .x86_64 => "x86", | |
| 431 | .nvptx, .nvptx64 => "nvptx", | |
| 432 | .wasm32, .wasm64 => "wasm", | |
| 433 | else => @tagName(arch), | |
| 434 | }; | |
| 435 | } | |
| 436 | ||
| 437 | /// All CPU features Zig is aware of, sorted lexicographically by name. | |
| 438 | pub fn allFeaturesList(arch: Arch) []const Cpu.Feature { | |
| 439 | return switch (arch) { | |
| 440 | .arm, .armeb, .thumb, .thumbeb => &arm.all_features, | |
| 441 | .aarch64, .aarch64_be, .aarch64_32 => &aarch64.all_features, | |
| 442 | .avr => &avr.all_features, | |
| 443 | .bpfel, .bpfeb => &bpf.all_features, | |
| 444 | .hexagon => &hexagon.all_features, | |
| 445 | .mips, .mipsel, .mips64, .mips64el => &mips.all_features, | |
| 446 | .msp430 => &msp430.all_features, | |
| 447 | .powerpc, .powerpc64, .powerpc64le => &powerpc.all_features, | |
| 448 | .amdgcn => &amdgpu.all_features, | |
| 449 | .riscv32, .riscv64 => &riscv.all_features, | |
| 450 | .sparc, .sparcv9, .sparcel => &sparc.all_features, | |
| 451 | .s390x => &systemz.all_features, | |
| 452 | .i386, .x86_64 => &x86.all_features, | |
| 453 | .nvptx, .nvptx64 => &nvptx.all_features, | |
| 454 | .wasm32, .wasm64 => &wasm.all_features, | |
| 455 | ||
| 456 | else => &[0]Cpu.Feature{}, | |
| 457 | }; | |
| 458 | } | |
| 459 | ||
| 460 | /// The "default" set of CPU features for cross-compiling. A conservative set | |
| 461 | /// of features that is expected to be supported on most available hardware. | |
| 462 | pub fn getBaselineCpuFeatures(arch: Arch) CpuFeatures { | |
| 463 | const S = struct { | |
| 464 | const generic_cpu = Cpu{ | |
| 465 | .name = "generic", | |
| 466 | .llvm_name = null, | |
| 467 | .features = Cpu.Feature.Set.empty, | |
| 468 | }; | |
| 469 | }; | |
| 470 | const cpu = switch (arch) { | |
| 471 | .arm, .armeb, .thumb, .thumbeb => &arm.cpu.generic, | |
| 472 | .aarch64, .aarch64_be, .aarch64_32 => &aarch64.cpu.generic, | |
| 473 | .avr => &avr.cpu.avr1, | |
| 474 | .bpfel, .bpfeb => &bpf.cpu.generic, | |
| 475 | .hexagon => &hexagon.cpu.generic, | |
| 476 | .mips, .mipsel => &mips.cpu.mips32, | |
| 477 | .mips64, .mips64el => &mips.cpu.mips64, | |
| 478 | .msp430 => &msp430.cpu.generic, | |
| 479 | .powerpc, .powerpc64, .powerpc64le => &powerpc.cpu.generic, | |
| 480 | .amdgcn => &amdgpu.cpu.generic, | |
| 481 | .riscv32 => &riscv.cpu.baseline_rv32, | |
| 482 | .riscv64 => &riscv.cpu.baseline_rv64, | |
| 483 | .sparc, .sparcv9, .sparcel => &sparc.cpu.generic, | |
| 484 | .s390x => &systemz.cpu.generic, | |
| 485 | .i386 => &x86.cpu.pentium4, | |
| 486 | .x86_64 => &x86.cpu.x86_64, | |
| 487 | .nvptx, .nvptx64 => &nvptx.cpu.sm_20, | |
| 488 | .wasm32, .wasm64 => &wasm.cpu.generic, | |
| 489 | ||
| 490 | else => &S.generic_cpu, | |
| 491 | }; | |
| 492 | return CpuFeatures.initFromCpu(arch, cpu); | |
| 493 | } | |
| 494 | ||
| 495 | /// All CPUs Zig is aware of, sorted lexicographically by name. | |
| 496 | pub fn allCpus(arch: Arch) []const *const Cpu { | |
| 497 | return switch (arch) { | |
| 498 | .arm, .armeb, .thumb, .thumbeb => arm.all_cpus, | |
| 499 | .aarch64, .aarch64_be, .aarch64_32 => aarch64.all_cpus, | |
| 500 | .avr => avr.all_cpus, | |
| 501 | .bpfel, .bpfeb => bpf.all_cpus, | |
| 502 | .hexagon => hexagon.all_cpus, | |
| 503 | .mips, .mipsel, .mips64, .mips64el => mips.all_cpus, | |
| 504 | .msp430 => msp430.all_cpus, | |
| 505 | .powerpc, .powerpc64, .powerpc64le => powerpc.all_cpus, | |
| 506 | .amdgcn => amdgpu.all_cpus, | |
| 507 | .riscv32, .riscv64 => riscv.all_cpus, | |
| 508 | .sparc, .sparcv9, .sparcel => sparc.all_cpus, | |
| 509 | .s390x => systemz.all_cpus, | |
| 510 | .i386, .x86_64 => x86.all_cpus, | |
| 511 | .nvptx, .nvptx64 => nvptx.all_cpus, | |
| 512 | .wasm32, .wasm64 => wasm.all_cpus, | |
| 513 | ||
| 514 | else => &[0]*const Cpu{}, | |
| 515 | }; | |
| 516 | } | |
| 517 | }; | |
| 518 | ||
| 519 | 80 | pub const Abi = enum { |
| 520 | 81 | none, |
| 521 | 82 | gnu, |
| ... | ... | @@ -539,11 +100,104 @@ pub const Target = union(enum) { |
| 539 | 100 | coreclr, |
| 540 | 101 | simulator, |
| 541 | 102 | macabi, |
| 103 | ||
| 104 | pub fn default(arch: Cpu.Arch, target_os: Os) Abi { | |
| 105 | switch (arch) { | |
| 106 | .wasm32, .wasm64 => return .musl, | |
| 107 | else => {}, | |
| 108 | } | |
| 109 | switch (target_os) { | |
| 110 | .freestanding, | |
| 111 | .ananas, | |
| 112 | .cloudabi, | |
| 113 | .dragonfly, | |
| 114 | .lv2, | |
| 115 | .solaris, | |
| 116 | .haiku, | |
| 117 | .minix, | |
| 118 | .rtems, | |
| 119 | .nacl, | |
| 120 | .cnk, | |
| 121 | .aix, | |
| 122 | .cuda, | |
| 123 | .nvcl, | |
| 124 | .amdhsa, | |
| 125 | .ps4, | |
| 126 | .elfiamcu, | |
| 127 | .mesa3d, | |
| 128 | .contiki, | |
| 129 | .amdpal, | |
| 130 | .hermit, | |
| 131 | .other, | |
| 132 | => return .eabi, | |
| 133 | .openbsd, | |
| 134 | .macosx, | |
| 135 | .freebsd, | |
| 136 | .ios, | |
| 137 | .tvos, | |
| 138 | .watchos, | |
| 139 | .fuchsia, | |
| 140 | .kfreebsd, | |
| 141 | .netbsd, | |
| 142 | .hurd, | |
| 143 | => return .gnu, | |
| 144 | .windows, | |
| 145 | .uefi, | |
| 146 | => return .msvc, | |
| 147 | .linux, | |
| 148 | .wasi, | |
| 149 | .emscripten, | |
| 150 | => return .musl, | |
| 151 | } | |
| 152 | } | |
| 153 | ||
| 154 | pub fn parse(text: []const u8) !Abi { | |
| 155 | if (mem.eql(u8, text, "native")) return builtin.abi; | |
| 156 | ||
| 157 | const info = @typeInfo(Abi); | |
| 158 | inline for (info.Enum.fields) |field| { | |
| 159 | if (mem.eql(u8, text, field.name)) { | |
| 160 | return @field(Abi, field.name); | |
| 161 | } | |
| 162 | } | |
| 163 | return error.UnknownApplicationBinaryInterface; | |
| 164 | } | |
| 165 | }; | |
| 166 | ||
| 167 | pub const ObjectFormat = enum { | |
| 168 | unknown, | |
| 169 | coff, | |
| 170 | elf, | |
| 171 | macho, | |
| 172 | wasm, | |
| 173 | }; | |
| 174 | ||
| 175 | pub const SubSystem = enum { | |
| 176 | Console, | |
| 177 | Windows, | |
| 178 | Posix, | |
| 179 | Native, | |
| 180 | EfiApplication, | |
| 181 | EfiBootServiceDriver, | |
| 182 | EfiRom, | |
| 183 | EfiRuntimeDriver, | |
| 184 | }; | |
| 185 | ||
| 186 | pub const Cross = struct { | |
| 187 | cpu: Cpu, | |
| 188 | os: Os, | |
| 189 | abi: Abi, | |
| 542 | 190 | }; |
| 543 | 191 | |
| 544 | 192 | pub const Cpu = struct { |
| 545 | name: []const u8, | |
| 546 | llvm_name: ?[:0]const u8, | |
| 193 | /// Architecture | |
| 194 | arch: Arch, | |
| 195 | ||
| 196 | /// The CPU model to target. It has a set of features | |
| 197 | /// which are overridden with the `features` field. | |
| 198 | model: *const Model, | |
| 199 | ||
| 200 | /// An explicit list of the entire CPU feature set. It may differ from the specific CPU model's features. | |
| 547 | 201 | features: Feature.Set, |
| 548 | 202 | |
| 549 | 203 | pub const Feature = struct { |
| ... | ... | @@ -569,7 +223,7 @@ pub const Target = union(enum) { |
| 569 | 223 | pub const Set = struct { |
| 570 | 224 | ints: [usize_count]usize, |
| 571 | 225 | |
| 572 | pub const needed_bit_count = 174; | |
| 226 | pub const needed_bit_count = 138; | |
| 573 | 227 | pub const byte_count = (needed_bit_count + 7) / 8; |
| 574 | 228 | pub const usize_count = (byte_count + (@sizeOf(usize) - 1)) / @sizeOf(usize); |
| 575 | 229 | pub const Index = std.math.Log2Int(@IntType(false, usize_count * @bitSizeOf(usize))); |
| ... | ... | @@ -593,6 +247,12 @@ pub const Target = union(enum) { |
| 593 | 247 | set.ints[usize_index] |= @as(usize, 1) << bit_index; |
| 594 | 248 | } |
| 595 | 249 | |
| 250 | /// Adds the specified feature set but not its dependencies. | |
| 251 | pub fn addFeatureSet(set: *Set, other_set: Set) void { | |
| 252 | set.ints = @as(@Vector(usize_count, usize), set.ints) | | |
| 253 | @as(@Vector(usize_count, usize), other_set.ints); | |
| 254 | } | |
| 255 | ||
| 596 | 256 | /// Removes the specified feature but not its dependents. |
| 597 | 257 | pub fn removeFeature(set: *Set, arch_feature_index: Index) void { |
| 598 | 258 | const usize_index = arch_feature_index / @bitSizeOf(usize); |
| ... | ... | @@ -608,8 +268,7 @@ pub const Target = union(enum) { |
| 608 | 268 | for (all_features_list) |feature, index_usize| { |
| 609 | 269 | const index = @intCast(Index, index_usize); |
| 610 | 270 | if (set.isEnabled(index)) { |
| 611 | set.ints = @as(@Vector(usize_count, usize), set.ints) | | |
| 612 | @as(@Vector(usize_count, usize), feature.dependencies.ints); | |
| 271 | set.addFeatureSet(feature.dependencies); | |
| 613 | 272 | } |
| 614 | 273 | } |
| 615 | 274 | const nothing_changed = mem.eql(usize, &old, &set.ints); |
| ... | ... | @@ -644,77 +303,362 @@ pub const Target = union(enum) { |
| 644 | 303 | }; |
| 645 | 304 | } |
| 646 | 305 | }; |
| 647 | }; | |
| 648 | 306 | |
| 649 | pub const ObjectFormat = enum { | |
| 650 | unknown, | |
| 651 | coff, | |
| 652 | elf, | |
| 653 | macho, | |
| 654 | wasm, | |
| 655 | }; | |
| 307 | pub const Arch = enum { | |
| 308 | arm, | |
| 309 | armeb, | |
| 310 | aarch64, | |
| 311 | aarch64_be, | |
| 312 | aarch64_32, | |
| 313 | arc, | |
| 314 | avr, | |
| 315 | bpfel, | |
| 316 | bpfeb, | |
| 317 | hexagon, | |
| 318 | mips, | |
| 319 | mipsel, | |
| 320 | mips64, | |
| 321 | mips64el, | |
| 322 | msp430, | |
| 323 | powerpc, | |
| 324 | powerpc64, | |
| 325 | powerpc64le, | |
| 326 | r600, | |
| 327 | amdgcn, | |
| 328 | riscv32, | |
| 329 | riscv64, | |
| 330 | sparc, | |
| 331 | sparcv9, | |
| 332 | sparcel, | |
| 333 | s390x, | |
| 334 | tce, | |
| 335 | tcele, | |
| 336 | thumb, | |
| 337 | thumbeb, | |
| 338 | i386, | |
| 339 | x86_64, | |
| 340 | xcore, | |
| 341 | nvptx, | |
| 342 | nvptx64, | |
| 343 | le32, | |
| 344 | le64, | |
| 345 | amdil, | |
| 346 | amdil64, | |
| 347 | hsail, | |
| 348 | hsail64, | |
| 349 | spir, | |
| 350 | spir64, | |
| 351 | kalimba, | |
| 352 | shave, | |
| 353 | lanai, | |
| 354 | wasm32, | |
| 355 | wasm64, | |
| 356 | renderscript32, | |
| 357 | renderscript64, | |
| 358 | ||
| 359 | pub fn isARM(arch: Arch) bool { | |
| 360 | return switch (arch) { | |
| 361 | .arm, .armeb => true, | |
| 362 | else => false, | |
| 363 | }; | |
| 364 | } | |
| 656 | 365 | |
| 657 | pub const SubSystem = enum { | |
| 658 | Console, | |
| 659 | Windows, | |
| 660 | Posix, | |
| 661 | Native, | |
| 662 | EfiApplication, | |
| 663 | EfiBootServiceDriver, | |
| 664 | EfiRom, | |
| 665 | EfiRuntimeDriver, | |
| 666 | }; | |
| 366 | pub fn isThumb(arch: Arch) bool { | |
| 367 | return switch (arch) { | |
| 368 | .thumb, .thumbeb => true, | |
| 369 | else => false, | |
| 370 | }; | |
| 371 | } | |
| 667 | 372 | |
| 668 | pub const Cross = struct { | |
| 669 | arch: Arch, | |
| 670 | os: Os, | |
| 671 | abi: Abi, | |
| 672 | cpu_features: CpuFeatures, | |
| 673 | }; | |
| 373 | pub fn isWasm(arch: Arch) bool { | |
| 374 | return switch (arch) { | |
| 375 | .wasm32, .wasm64 => true, | |
| 376 | else => false, | |
| 377 | }; | |
| 378 | } | |
| 674 | 379 | |
| 675 | pub const CpuFeatures = struct { | |
| 676 | /// The CPU to target. It has a set of features | |
| 677 | /// which are overridden with the `features` field. | |
| 678 | cpu: *const Cpu, | |
| 380 | pub fn isRISCV(arch: Arch) bool { | |
| 381 | return switch (arch) { | |
| 382 | .riscv32, .riscv64 => true, | |
| 383 | else => false, | |
| 384 | }; | |
| 385 | } | |
| 386 | ||
| 387 | pub fn isMIPS(arch: Arch) bool { | |
| 388 | return switch (arch) { | |
| 389 | .mips, .mipsel, .mips64, .mips64el => true, | |
| 390 | else => false, | |
| 391 | }; | |
| 392 | } | |
| 393 | ||
| 394 | pub fn parseCpuModel(arch: Arch, cpu_name: []const u8) !*const Cpu.Model { | |
| 395 | for (arch.allCpuModels()) |cpu| { | |
| 396 | if (mem.eql(u8, cpu_name, cpu.name)) { | |
| 397 | return cpu; | |
| 398 | } | |
| 399 | } | |
| 400 | return error.UnknownCpu; | |
| 401 | } | |
| 402 | ||
| 403 | pub fn toElfMachine(arch: Arch) std.elf.EM { | |
| 404 | return switch (arch) { | |
| 405 | .avr => ._AVR, | |
| 406 | .msp430 => ._MSP430, | |
| 407 | .arc => ._ARC, | |
| 408 | .arm => ._ARM, | |
| 409 | .armeb => ._ARM, | |
| 410 | .hexagon => ._HEXAGON, | |
| 411 | .le32 => ._NONE, | |
| 412 | .mips => ._MIPS, | |
| 413 | .mipsel => ._MIPS_RS3_LE, | |
| 414 | .powerpc => ._PPC, | |
| 415 | .r600 => ._NONE, | |
| 416 | .riscv32 => ._RISCV, | |
| 417 | .sparc => ._SPARC, | |
| 418 | .sparcel => ._SPARC, | |
| 419 | .tce => ._NONE, | |
| 420 | .tcele => ._NONE, | |
| 421 | .thumb => ._ARM, | |
| 422 | .thumbeb => ._ARM, | |
| 423 | .i386 => ._386, | |
| 424 | .xcore => ._XCORE, | |
| 425 | .nvptx => ._NONE, | |
| 426 | .amdil => ._NONE, | |
| 427 | .hsail => ._NONE, | |
| 428 | .spir => ._NONE, | |
| 429 | .kalimba => ._CSR_KALIMBA, | |
| 430 | .shave => ._NONE, | |
| 431 | .lanai => ._LANAI, | |
| 432 | .wasm32 => ._NONE, | |
| 433 | .renderscript32 => ._NONE, | |
| 434 | .aarch64_32 => ._AARCH64, | |
| 435 | .aarch64 => ._AARCH64, | |
| 436 | .aarch64_be => ._AARCH64, | |
| 437 | .mips64 => ._MIPS, | |
| 438 | .mips64el => ._MIPS_RS3_LE, | |
| 439 | .powerpc64 => ._PPC64, | |
| 440 | .powerpc64le => ._PPC64, | |
| 441 | .riscv64 => ._RISCV, | |
| 442 | .x86_64 => ._X86_64, | |
| 443 | .nvptx64 => ._NONE, | |
| 444 | .le64 => ._NONE, | |
| 445 | .amdil64 => ._NONE, | |
| 446 | .hsail64 => ._NONE, | |
| 447 | .spir64 => ._NONE, | |
| 448 | .wasm64 => ._NONE, | |
| 449 | .renderscript64 => ._NONE, | |
| 450 | .amdgcn => ._NONE, | |
| 451 | .bpfel => ._BPF, | |
| 452 | .bpfeb => ._BPF, | |
| 453 | .sparcv9 => ._SPARCV9, | |
| 454 | .s390x => ._S390, | |
| 455 | }; | |
| 456 | } | |
| 457 | ||
| 458 | pub fn endian(arch: Arch) builtin.Endian { | |
| 459 | return switch (arch) { | |
| 460 | .avr, | |
| 461 | .arm, | |
| 462 | .aarch64_32, | |
| 463 | .aarch64, | |
| 464 | .amdgcn, | |
| 465 | .amdil, | |
| 466 | .amdil64, | |
| 467 | .bpfel, | |
| 468 | .hexagon, | |
| 469 | .hsail, | |
| 470 | .hsail64, | |
| 471 | .kalimba, | |
| 472 | .le32, | |
| 473 | .le64, | |
| 474 | .mipsel, | |
| 475 | .mips64el, | |
| 476 | .msp430, | |
| 477 | .nvptx, | |
| 478 | .nvptx64, | |
| 479 | .sparcel, | |
| 480 | .tcele, | |
| 481 | .powerpc64le, | |
| 482 | .r600, | |
| 483 | .riscv32, | |
| 484 | .riscv64, | |
| 485 | .i386, | |
| 486 | .x86_64, | |
| 487 | .wasm32, | |
| 488 | .wasm64, | |
| 489 | .xcore, | |
| 490 | .thumb, | |
| 491 | .spir, | |
| 492 | .spir64, | |
| 493 | .renderscript32, | |
| 494 | .renderscript64, | |
| 495 | .shave, | |
| 496 | => .Little, | |
| 497 | ||
| 498 | .arc, | |
| 499 | .armeb, | |
| 500 | .aarch64_be, | |
| 501 | .bpfeb, | |
| 502 | .mips, | |
| 503 | .mips64, | |
| 504 | .powerpc, | |
| 505 | .powerpc64, | |
| 506 | .thumbeb, | |
| 507 | .sparc, | |
| 508 | .sparcv9, | |
| 509 | .tce, | |
| 510 | .lanai, | |
| 511 | .s390x, | |
| 512 | => .Big, | |
| 513 | }; | |
| 514 | } | |
| 515 | ||
| 516 | /// Returns a name that matches the lib/std/target/* directory name. | |
| 517 | pub fn genericName(arch: Arch) []const u8 { | |
| 518 | return switch (arch) { | |
| 519 | .arm, .armeb, .thumb, .thumbeb => "arm", | |
| 520 | .aarch64, .aarch64_be, .aarch64_32 => "aarch64", | |
| 521 | .avr => "avr", | |
| 522 | .bpfel, .bpfeb => "bpf", | |
| 523 | .hexagon => "hexagon", | |
| 524 | .mips, .mipsel, .mips64, .mips64el => "mips", | |
| 525 | .msp430 => "msp430", | |
| 526 | .powerpc, .powerpc64, .powerpc64le => "powerpc", | |
| 527 | .amdgcn => "amdgpu", | |
| 528 | .riscv32, .riscv64 => "riscv", | |
| 529 | .sparc, .sparcv9, .sparcel => "sparc", | |
| 530 | .s390x => "systemz", | |
| 531 | .i386, .x86_64 => "x86", | |
| 532 | .nvptx, .nvptx64 => "nvptx", | |
| 533 | .wasm32, .wasm64 => "wasm", | |
| 534 | else => @tagName(arch), | |
| 535 | }; | |
| 536 | } | |
| 679 | 537 | |
| 680 | /// Explicitly provide the entire CPU feature set. | |
| 681 | features: Cpu.Feature.Set, | |
| 538 | /// All CPU features Zig is aware of, sorted lexicographically by name. | |
| 539 | pub fn allFeaturesList(arch: Arch) []const Cpu.Feature { | |
| 540 | return switch (arch) { | |
| 541 | .arm, .armeb, .thumb, .thumbeb => &arm.all_features, | |
| 542 | .aarch64, .aarch64_be, .aarch64_32 => &aarch64.all_features, | |
| 543 | .avr => &avr.all_features, | |
| 544 | .bpfel, .bpfeb => &bpf.all_features, | |
| 545 | .hexagon => &hexagon.all_features, | |
| 546 | .mips, .mipsel, .mips64, .mips64el => &mips.all_features, | |
| 547 | .msp430 => &msp430.all_features, | |
| 548 | .powerpc, .powerpc64, .powerpc64le => &powerpc.all_features, | |
| 549 | .amdgcn => &amdgpu.all_features, | |
| 550 | .riscv32, .riscv64 => &riscv.all_features, | |
| 551 | .sparc, .sparcv9, .sparcel => &sparc.all_features, | |
| 552 | .s390x => &systemz.all_features, | |
| 553 | .i386, .x86_64 => &x86.all_features, | |
| 554 | .nvptx, .nvptx64 => &nvptx.all_features, | |
| 555 | .wasm32, .wasm64 => &wasm.all_features, | |
| 556 | ||
| 557 | else => &[0]Cpu.Feature{}, | |
| 558 | }; | |
| 559 | } | |
| 560 | ||
| 561 | /// All processors Zig is aware of, sorted lexicographically by name. | |
| 562 | pub fn allCpuModels(arch: Arch) []const *const Cpu.Model { | |
| 563 | return switch (arch) { | |
| 564 | .arm, .armeb, .thumb, .thumbeb => arm.all_cpus, | |
| 565 | .aarch64, .aarch64_be, .aarch64_32 => aarch64.all_cpus, | |
| 566 | .avr => avr.all_cpus, | |
| 567 | .bpfel, .bpfeb => bpf.all_cpus, | |
| 568 | .hexagon => hexagon.all_cpus, | |
| 569 | .mips, .mipsel, .mips64, .mips64el => mips.all_cpus, | |
| 570 | .msp430 => msp430.all_cpus, | |
| 571 | .powerpc, .powerpc64, .powerpc64le => powerpc.all_cpus, | |
| 572 | .amdgcn => amdgpu.all_cpus, | |
| 573 | .riscv32, .riscv64 => riscv.all_cpus, | |
| 574 | .sparc, .sparcv9, .sparcel => sparc.all_cpus, | |
| 575 | .s390x => systemz.all_cpus, | |
| 576 | .i386, .x86_64 => x86.all_cpus, | |
| 577 | .nvptx, .nvptx64 => nvptx.all_cpus, | |
| 578 | .wasm32, .wasm64 => wasm.all_cpus, | |
| 579 | ||
| 580 | else => &[0]*const Model{}, | |
| 581 | }; | |
| 582 | } | |
| 583 | ||
| 584 | pub fn parse(text: []const u8) !Arch { | |
| 585 | if (mem.eql(u8, text, "native")) return builtin.arch; | |
| 586 | ||
| 587 | const info = @typeInfo(Arch); | |
| 588 | inline for (info.Enum.fields) |field| { | |
| 589 | if (mem.eql(u8, text, field.name)) { | |
| 590 | return @as(Arch, @field(Arch, field.name)); | |
| 591 | } | |
| 592 | } | |
| 593 | return error.UnknownArchitecture; | |
| 594 | } | |
| 595 | }; | |
| 682 | 596 | |
| 683 | pub fn initFromCpu(arch: Arch, cpu: *const Cpu) CpuFeatures { | |
| 684 | var features = cpu.features; | |
| 685 | if (arch.subArchFeature()) |sub_arch_index| { | |
| 686 | features.addFeature(sub_arch_index); | |
| 597 | pub const Model = struct { | |
| 598 | name: []const u8, | |
| 599 | llvm_name: ?[:0]const u8, | |
| 600 | features: Feature.Set, | |
| 601 | ||
| 602 | pub fn toCpu(model: *const Model, arch: Arch) Cpu { | |
| 603 | var features = model.features; | |
| 604 | features.populateDependencies(arch.allFeaturesList()); | |
| 605 | return .{ | |
| 606 | .arch = arch, | |
| 607 | .model = model, | |
| 608 | .features = features, | |
| 609 | }; | |
| 687 | 610 | } |
| 688 | features.populateDependencies(arch.allFeaturesList()); | |
| 689 | return CpuFeatures{ | |
| 690 | .cpu = cpu, | |
| 691 | .features = features, | |
| 611 | }; | |
| 612 | ||
| 613 | /// The "default" set of CPU features for cross-compiling. A conservative set | |
| 614 | /// of features that is expected to be supported on most available hardware. | |
| 615 | pub fn baseline(arch: Arch) Cpu { | |
| 616 | const S = struct { | |
| 617 | const generic_model = Model{ | |
| 618 | .name = "generic", | |
| 619 | .llvm_name = null, | |
| 620 | .features = Cpu.Feature.Set.empty, | |
| 621 | }; | |
| 622 | }; | |
| 623 | const model = switch (arch) { | |
| 624 | .arm, .armeb, .thumb, .thumbeb => &arm.cpu.baseline, | |
| 625 | .aarch64, .aarch64_be, .aarch64_32 => &aarch64.cpu.generic, | |
| 626 | .avr => &avr.cpu.avr1, | |
| 627 | .bpfel, .bpfeb => &bpf.cpu.generic, | |
| 628 | .hexagon => &hexagon.cpu.generic, | |
| 629 | .mips, .mipsel => &mips.cpu.mips32, | |
| 630 | .mips64, .mips64el => &mips.cpu.mips64, | |
| 631 | .msp430 => &msp430.cpu.generic, | |
| 632 | .powerpc, .powerpc64, .powerpc64le => &powerpc.cpu.generic, | |
| 633 | .amdgcn => &amdgpu.cpu.generic, | |
| 634 | .riscv32 => &riscv.cpu.baseline_rv32, | |
| 635 | .riscv64 => &riscv.cpu.baseline_rv64, | |
| 636 | .sparc, .sparcv9, .sparcel => &sparc.cpu.generic, | |
| 637 | .s390x => &systemz.cpu.generic, | |
| 638 | .i386 => &x86.cpu.pentium4, | |
| 639 | .x86_64 => &x86.cpu.x86_64, | |
| 640 | .nvptx, .nvptx64 => &nvptx.cpu.sm_20, | |
| 641 | .wasm32, .wasm64 => &wasm.cpu.generic, | |
| 642 | ||
| 643 | else => &S.generic_model, | |
| 692 | 644 | }; |
| 645 | return model.toCpu(arch); | |
| 693 | 646 | } |
| 694 | 647 | }; |
| 695 | 648 | |
| 696 | 649 | pub const current = Target{ |
| 697 | 650 | .Cross = Cross{ |
| 698 | .arch = builtin.arch, | |
| 651 | .cpu = builtin.cpu, | |
| 699 | 652 | .os = builtin.os, |
| 700 | 653 | .abi = builtin.abi, |
| 701 | .cpu_features = builtin.cpu_features, | |
| 702 | 654 | }, |
| 703 | 655 | }; |
| 704 | 656 | |
| 705 | 657 | pub const stack_align = 16; |
| 706 | 658 | |
| 707 | pub fn getCpuFeatures(self: Target) CpuFeatures { | |
| 708 | return switch (self) { | |
| 709 | .Native => builtin.cpu_features, | |
| 710 | .Cross => |cross| cross.cpu_features, | |
| 711 | }; | |
| 712 | } | |
| 713 | ||
| 714 | 659 | pub fn zigTriple(self: Target, allocator: *mem.Allocator) ![]u8 { |
| 715 | return std.fmt.allocPrint(allocator, "{}{}-{}-{}", .{ | |
| 660 | return std.fmt.allocPrint(allocator, "{}-{}-{}", .{ | |
| 716 | 661 | @tagName(self.getArch()), |
| 717 | Target.archSubArchName(self.getArch()), | |
| 718 | 662 | @tagName(self.getOs()), |
| 719 | 663 | @tagName(self.getAbi()), |
| 720 | 664 | }); |
| ... | ... | @@ -776,139 +720,81 @@ pub const Target = union(enum) { |
| 776 | 720 | }); |
| 777 | 721 | } |
| 778 | 722 | |
| 779 | /// TODO: Support CPU features here? | |
| 780 | /// https://github.com/ziglang/zig/issues/4261 | |
| 781 | pub fn parse(text: []const u8) !Target { | |
| 782 | var it = mem.separate(text, "-"); | |
| 723 | pub const ParseOptions = struct { | |
| 724 | /// This is sometimes called a "triple". It looks roughly like this: | |
| 725 | /// riscv64-linux-gnu | |
| 726 | /// The fields are, respectively: | |
| 727 | /// * CPU Architecture | |
| 728 | /// * Operating System | |
| 729 | /// * C ABI (optional) | |
| 730 | /// "native" can be used for any of the fields. | |
| 731 | arch_os_abi: []const u8, | |
| 732 | ||
| 733 | /// Looks like "name+a+b-c-d+e", where "name" is a CPU Model name, "a", "b", and "e" | |
| 734 | /// are examples of CPU features to add to the set, and "c" and "d" are examples of CPU features | |
| 735 | /// to remove from the set. | |
| 736 | /// The default value of `null` means to use the "baseline" feature set. | |
| 737 | /// "native" can be used to perform CPU introspection. | |
| 738 | cpu: ?[]const u8 = null, | |
| 739 | }; | |
| 740 | ||
| 741 | pub fn parse(args: ParseOptions) !Target { | |
| 742 | var it = mem.separate(args.arch_os_abi, "-"); | |
| 783 | 743 | const arch_name = it.next() orelse return error.MissingArchitecture; |
| 784 | 744 | const os_name = it.next() orelse return error.MissingOperatingSystem; |
| 785 | 745 | const abi_name = it.next(); |
| 786 | const arch = try parseArchSub(arch_name); | |
| 746 | if (it.next() != null) return error.UnexpectedExtraField; | |
| 787 | 747 | |
| 788 | var cross = Cross{ | |
| 789 | .arch = arch, | |
| 790 | .cpu_features = arch.getBaselineCpuFeatures(), | |
| 791 | .os = try parseOs(os_name), | |
| 792 | .abi = undefined, | |
| 793 | }; | |
| 794 | cross.abi = if (abi_name) |n| try parseAbi(n) else defaultAbi(cross.arch, cross.os); | |
| 795 | return Target{ .Cross = cross }; | |
| 796 | } | |
| 748 | const arch = try Cpu.Arch.parse(arch_name); | |
| 749 | const os = try Os.parse(os_name); | |
| 750 | const abi = if (abi_name) |n| try Abi.parse(n) else Abi.default(arch, os); | |
| 797 | 751 | |
| 798 | pub fn defaultAbi(arch: Arch, target_os: Os) Abi { | |
| 799 | switch (arch) { | |
| 800 | .wasm32, .wasm64 => return .musl, | |
| 801 | else => {}, | |
| 802 | } | |
| 803 | switch (target_os) { | |
| 804 | .freestanding, | |
| 805 | .ananas, | |
| 806 | .cloudabi, | |
| 807 | .dragonfly, | |
| 808 | .lv2, | |
| 809 | .solaris, | |
| 810 | .haiku, | |
| 811 | .minix, | |
| 812 | .rtems, | |
| 813 | .nacl, | |
| 814 | .cnk, | |
| 815 | .aix, | |
| 816 | .cuda, | |
| 817 | .nvcl, | |
| 818 | .amdhsa, | |
| 819 | .ps4, | |
| 820 | .elfiamcu, | |
| 821 | .mesa3d, | |
| 822 | .contiki, | |
| 823 | .amdpal, | |
| 824 | .hermit, | |
| 825 | .other, | |
| 826 | => return .eabi, | |
| 827 | .openbsd, | |
| 828 | .macosx, | |
| 829 | .freebsd, | |
| 830 | .ios, | |
| 831 | .tvos, | |
| 832 | .watchos, | |
| 833 | .fuchsia, | |
| 834 | .kfreebsd, | |
| 835 | .netbsd, | |
| 836 | .hurd, | |
| 837 | => return .gnu, | |
| 838 | .windows, | |
| 839 | .uefi, | |
| 840 | => return .msvc, | |
| 841 | .linux, | |
| 842 | .wasi, | |
| 843 | .emscripten, | |
| 844 | => return .musl, | |
| 845 | } | |
| 846 | } | |
| 847 | ||
| 848 | pub const ParseArchSubError = error{ | |
| 849 | UnknownArchitecture, | |
| 850 | UnknownSubArchitecture, | |
| 851 | }; | |
| 852 | ||
| 853 | pub fn parseArchSub(text: []const u8) ParseArchSubError!Arch { | |
| 854 | const info = @typeInfo(Arch); | |
| 855 | inline for (info.Union.fields) |field| { | |
| 856 | if (mem.startsWith(u8, text, field.name)) { | |
| 857 | if (field.field_type == void) { | |
| 858 | return @as(Arch, @field(Arch, field.name)); | |
| 859 | } else { | |
| 860 | const sub_info = @typeInfo(field.field_type); | |
| 861 | inline for (sub_info.Enum.fields) |sub_field| { | |
| 862 | const combined = field.name ++ sub_field.name; | |
| 863 | if (mem.eql(u8, text, combined)) { | |
| 864 | return @unionInit(Arch, field.name, @field(field.field_type, sub_field.name)); | |
| 752 | const all_features = arch.allFeaturesList(); | |
| 753 | const cpu: Cpu = if (args.cpu) |cpu_text| blk: { | |
| 754 | var index: usize = 0; | |
| 755 | while (index < cpu_text.len and cpu_text[index] != '+' and cpu_text[index] != '-') { | |
| 756 | index += 1; | |
| 757 | } | |
| 758 | const cpu_name = cpu_text[0..index]; | |
| 759 | const cpu_model = try arch.parseCpuModel(cpu_name); | |
| 760 | ||
| 761 | var set = cpu_model.features; | |
| 762 | while (index < cpu_text.len) { | |
| 763 | const op = cpu_text[index]; | |
| 764 | index += 1; | |
| 765 | const start = index; | |
| 766 | while (index < cpu_text.len and cpu_text[index] != '+' and cpu_text[index] != '-') { | |
| 767 | index += 1; | |
| 768 | } | |
| 769 | const feature_name = cpu_text[start..index]; | |
| 770 | for (all_features) |feature, feat_index_usize| { | |
| 771 | const feat_index = @intCast(Cpu.Feature.Set.Index, feat_index_usize); | |
| 772 | if (mem.eql(u8, feature_name, feature.name)) { | |
| 773 | switch (op) { | |
| 774 | '+' => set.addFeature(feat_index), | |
| 775 | '-' => set.removeFeature(feat_index), | |
| 776 | else => unreachable, | |
| 865 | 777 | } |
| 778 | break; | |
| 866 | 779 | } |
| 867 | return error.UnknownSubArchitecture; | |
| 780 | } else { | |
| 781 | return error.UnknownCpuFeature; | |
| 868 | 782 | } |
| 869 | 783 | } |
| 870 | } | |
| 871 | return error.UnknownArchitecture; | |
| 872 | } | |
| 873 | ||
| 874 | pub fn parseOs(text: []const u8) !Os { | |
| 875 | const info = @typeInfo(Os); | |
| 876 | inline for (info.Enum.fields) |field| { | |
| 877 | if (mem.eql(u8, text, field.name)) { | |
| 878 | return @field(Os, field.name); | |
| 879 | } | |
| 880 | } | |
| 881 | return error.UnknownOperatingSystem; | |
| 882 | } | |
| 883 | ||
| 884 | pub fn parseAbi(text: []const u8) !Abi { | |
| 885 | const info = @typeInfo(Abi); | |
| 886 | inline for (info.Enum.fields) |field| { | |
| 887 | if (mem.eql(u8, text, field.name)) { | |
| 888 | return @field(Abi, field.name); | |
| 889 | } | |
| 890 | } | |
| 891 | return error.UnknownApplicationBinaryInterface; | |
| 892 | } | |
| 784 | set.populateDependencies(all_features); | |
| 785 | break :blk .{ | |
| 786 | .arch = arch, | |
| 787 | .model = cpu_model, | |
| 788 | .features = set, | |
| 789 | }; | |
| 790 | } else Cpu.baseline(arch); | |
| 893 | 791 | |
| 894 | fn archSubArchName(arch: Arch) []const u8 { | |
| 895 | return switch (arch) { | |
| 896 | .arm => |sub| @tagName(sub), | |
| 897 | .armeb => |sub| @tagName(sub), | |
| 898 | .thumb => |sub| @tagName(sub), | |
| 899 | .thumbeb => |sub| @tagName(sub), | |
| 900 | .aarch64 => |sub| @tagName(sub), | |
| 901 | .aarch64_be => |sub| @tagName(sub), | |
| 902 | .kalimba => |sub| @tagName(sub), | |
| 903 | else => "", | |
| 792 | var cross = Cross{ | |
| 793 | .cpu = cpu, | |
| 794 | .os = os, | |
| 795 | .abi = abi, | |
| 904 | 796 | }; |
| 905 | } | |
| 906 | ||
| 907 | pub fn subArchName(self: Target) []const u8 { | |
| 908 | switch (self) { | |
| 909 | .Native => return archSubArchName(builtin.arch), | |
| 910 | .Cross => |cross| return archSubArchName(cross.arch), | |
| 911 | } | |
| 797 | return Target{ .Cross = cross }; | |
| 912 | 798 | } |
| 913 | 799 | |
| 914 | 800 | pub fn oFileExt(self: Target) []const u8 { |
| ... | ... | @@ -967,11 +853,15 @@ pub const Target = union(enum) { |
| 967 | 853 | }; |
| 968 | 854 | } |
| 969 | 855 | |
| 970 | pub fn getArch(self: Target) Arch { | |
| 971 | switch (self) { | |
| 972 | .Native => return builtin.arch, | |
| 973 | .Cross => |t| return t.arch, | |
| 974 | } | |
| 856 | pub fn getCpu(self: Target) Cpu { | |
| 857 | return switch (self) { | |
| 858 | .Native => builtin.cpu, | |
| 859 | .Cross => |cross| cross.cpu, | |
| 860 | }; | |
| 861 | } | |
| 862 | ||
| 863 | pub fn getArch(self: Target) Cpu.Arch { | |
| 864 | return self.getCpu().arch; | |
| 975 | 865 | } |
| 976 | 866 | |
| 977 | 867 | pub fn getAbi(self: Target) Abi { |
| ... | ... | @@ -1372,14 +1262,32 @@ pub const Target = union(enum) { |
| 1372 | 1262 | } |
| 1373 | 1263 | }; |
| 1374 | 1264 | |
| 1375 | test "parseCpuFeatureSet" { | |
| 1376 | const arch: Target.Arch = .x86_64; | |
| 1377 | const baseline = arch.getBaselineCpuFeatures(); | |
| 1378 | const set = try arch.parseCpuFeatureSet(baseline.cpu, "-sse,-avx,-cx8"); | |
| 1379 | std.testing.expect(!Target.x86.featureSetHas(set, .sse)); | |
| 1380 | std.testing.expect(!Target.x86.featureSetHas(set, .avx)); | |
| 1381 | std.testing.expect(!Target.x86.featureSetHas(set, .cx8)); | |
| 1382 | // These are expected because they are part of the baseline | |
| 1383 | std.testing.expect(Target.x86.featureSetHas(set, .cmov)); | |
| 1384 | std.testing.expect(Target.x86.featureSetHas(set, .fxsr)); | |
| 1265 | test "Target.parse" { | |
| 1266 | { | |
| 1267 | const target = (try Target.parse(.{ | |
| 1268 | .arch_os_abi = "x86_64-linux-gnu", | |
| 1269 | .cpu = "x86_64-sse-avx-cx8", | |
| 1270 | })).Cross; | |
| 1271 | ||
| 1272 | std.testing.expect(target.os == .linux); | |
| 1273 | std.testing.expect(target.abi == .gnu); | |
| 1274 | std.testing.expect(target.cpu.arch == .x86_64); | |
| 1275 | std.testing.expect(!Target.x86.featureSetHas(target.cpu.features, .sse)); | |
| 1276 | std.testing.expect(!Target.x86.featureSetHas(target.cpu.features, .avx)); | |
| 1277 | std.testing.expect(!Target.x86.featureSetHas(target.cpu.features, .cx8)); | |
| 1278 | std.testing.expect(Target.x86.featureSetHas(target.cpu.features, .cmov)); | |
| 1279 | std.testing.expect(Target.x86.featureSetHas(target.cpu.features, .fxsr)); | |
| 1280 | } | |
| 1281 | { | |
| 1282 | const target = (try Target.parse(.{ | |
| 1283 | .arch_os_abi = "arm-linux-musleabihf", | |
| 1284 | .cpu = "generic+v8a", | |
| 1285 | })).Cross; | |
| 1286 | ||
| 1287 | std.testing.expect(target.os == .linux); | |
| 1288 | std.testing.expect(target.abi == .musleabihf); | |
| 1289 | std.testing.expect(target.cpu.arch == .arm); | |
| 1290 | std.testing.expect(target.cpu.model == &Target.arm.cpu.generic); | |
| 1291 | std.testing.expect(Target.arm.featureSetHas(target.cpu.features, .v8a)); | |
| 1292 | } | |
| 1385 | 1293 | } |
lib/std/target/aarch64.zig+189-362| ... | ... | @@ -1,14 +1,8 @@ |
| 1 | 1 | const std = @import("../std.zig"); |
| 2 | const Cpu = std.Target.Cpu; | |
| 2 | const CpuFeature = std.Target.Cpu.Feature; | |
| 3 | const CpuModel = std.Target.Cpu.Model; | |
| 3 | 4 | |
| 4 | 5 | pub const Feature = enum { |
| 5 | a35, | |
| 6 | a53, | |
| 7 | a55, | |
| 8 | a57, | |
| 9 | a72, | |
| 10 | a73, | |
| 11 | a75, | |
| 12 | 6 | a76, |
| 13 | 7 | aes, |
| 14 | 8 | aggressive_fma, |
| ... | ... | @@ -40,11 +34,7 @@ pub const Feature = enum { |
| 40 | 34 | dit, |
| 41 | 35 | dotprod, |
| 42 | 36 | exynos_cheap_as_move, |
| 43 | exynosm1, | |
| 44 | exynosm2, | |
| 45 | exynosm3, | |
| 46 | 37 | exynosm4, |
| 47 | falkor, | |
| 48 | 38 | fmi, |
| 49 | 39 | force_32bit_jump_tables, |
| 50 | 40 | fp_armv8, |
| ... | ... | @@ -58,7 +48,6 @@ pub const Feature = enum { |
| 58 | 48 | fuse_csel, |
| 59 | 49 | fuse_literals, |
| 60 | 50 | jsconv, |
| 61 | kryo, | |
| 62 | 51 | lor, |
| 63 | 52 | lse, |
| 64 | 53 | lsl_fast, |
| ... | ... | @@ -103,7 +92,6 @@ pub const Feature = enum { |
| 103 | 92 | reserve_x6, |
| 104 | 93 | reserve_x7, |
| 105 | 94 | reserve_x9, |
| 106 | saphira, | |
| 107 | 95 | sb, |
| 108 | 96 | sel2, |
| 109 | 97 | sha2, |
| ... | ... | @@ -122,17 +110,11 @@ pub const Feature = enum { |
| 122 | 110 | sve2_bitperm, |
| 123 | 111 | sve2_sha3, |
| 124 | 112 | sve2_sm4, |
| 125 | thunderx, | |
| 126 | thunderx2t99, | |
| 127 | thunderxt81, | |
| 128 | thunderxt83, | |
| 129 | thunderxt88, | |
| 130 | 113 | tlb_rmi, |
| 131 | 114 | tpidr_el1, |
| 132 | 115 | tpidr_el2, |
| 133 | 116 | tpidr_el3, |
| 134 | 117 | tracev8_4, |
| 135 | tsv110, | |
| 136 | 118 | uaops, |
| 137 | 119 | use_aa, |
| 138 | 120 | use_postra_scheduler, |
| ... | ... | @@ -151,120 +133,20 @@ pub const Feature = enum { |
| 151 | 133 | zcz_gp, |
| 152 | 134 | }; |
| 153 | 135 | |
| 154 | pub usingnamespace Cpu.Feature.feature_set_fns(Feature); | |
| 136 | pub usingnamespace CpuFeature.feature_set_fns(Feature); | |
| 155 | 137 | |
| 156 | 138 | pub const all_features = blk: { |
| 157 | 139 | @setEvalBranchQuota(2000); |
| 158 | 140 | const len = @typeInfo(Feature).Enum.fields.len; |
| 159 | std.debug.assert(len <= Cpu.Feature.Set.needed_bit_count); | |
| 160 | var result: [len]Cpu.Feature = undefined; | |
| 161 | result[@enumToInt(Feature.a35)] = .{ | |
| 162 | .llvm_name = "a35", | |
| 163 | .description = "Cortex-A35 ARM processors", | |
| 164 | .dependencies = featureSet(&[_]Feature{ | |
| 165 | .crc, | |
| 166 | .crypto, | |
| 167 | .fp_armv8, | |
| 168 | .neon, | |
| 169 | .perfmon, | |
| 170 | }), | |
| 171 | }; | |
| 172 | result[@enumToInt(Feature.a53)] = .{ | |
| 173 | .llvm_name = "a53", | |
| 174 | .description = "Cortex-A53 ARM processors", | |
| 175 | .dependencies = featureSet(&[_]Feature{ | |
| 176 | .balance_fp_ops, | |
| 177 | .crc, | |
| 178 | .crypto, | |
| 179 | .custom_cheap_as_move, | |
| 180 | .fp_armv8, | |
| 181 | .fuse_aes, | |
| 182 | .neon, | |
| 183 | .perfmon, | |
| 184 | .use_aa, | |
| 185 | .use_postra_scheduler, | |
| 186 | }), | |
| 187 | }; | |
| 188 | result[@enumToInt(Feature.a55)] = .{ | |
| 189 | .llvm_name = "a55", | |
| 190 | .description = "Cortex-A55 ARM processors", | |
| 191 | .dependencies = featureSet(&[_]Feature{ | |
| 192 | .crypto, | |
| 193 | .dotprod, | |
| 194 | .fp_armv8, | |
| 195 | .fullfp16, | |
| 196 | .fuse_aes, | |
| 197 | .neon, | |
| 198 | .perfmon, | |
| 199 | .rcpc, | |
| 200 | .v8_2a, | |
| 201 | }), | |
| 202 | }; | |
| 203 | result[@enumToInt(Feature.a57)] = .{ | |
| 204 | .llvm_name = "a57", | |
| 205 | .description = "Cortex-A57 ARM processors", | |
| 206 | .dependencies = featureSet(&[_]Feature{ | |
| 207 | .balance_fp_ops, | |
| 208 | .crc, | |
| 209 | .crypto, | |
| 210 | .custom_cheap_as_move, | |
| 211 | .fp_armv8, | |
| 212 | .fuse_aes, | |
| 213 | .fuse_literals, | |
| 214 | .neon, | |
| 215 | .perfmon, | |
| 216 | .predictable_select_expensive, | |
| 217 | .use_postra_scheduler, | |
| 218 | }), | |
| 219 | }; | |
| 220 | result[@enumToInt(Feature.a72)] = .{ | |
| 221 | .llvm_name = "a72", | |
| 222 | .description = "Cortex-A72 ARM processors", | |
| 223 | .dependencies = featureSet(&[_]Feature{ | |
| 224 | .crc, | |
| 225 | .crypto, | |
| 226 | .fp_armv8, | |
| 227 | .fuse_aes, | |
| 228 | .neon, | |
| 229 | .perfmon, | |
| 230 | }), | |
| 231 | }; | |
| 232 | result[@enumToInt(Feature.a73)] = .{ | |
| 233 | .llvm_name = "a73", | |
| 234 | .description = "Cortex-A73 ARM processors", | |
| 235 | .dependencies = featureSet(&[_]Feature{ | |
| 236 | .crc, | |
| 237 | .crypto, | |
| 238 | .fp_armv8, | |
| 239 | .fuse_aes, | |
| 240 | .neon, | |
| 241 | .perfmon, | |
| 242 | }), | |
| 243 | }; | |
| 244 | result[@enumToInt(Feature.a75)] = .{ | |
| 245 | .llvm_name = "a75", | |
| 246 | .description = "Cortex-A75 ARM processors", | |
| 247 | .dependencies = featureSet(&[_]Feature{ | |
| 248 | .crypto, | |
| 249 | .dotprod, | |
| 250 | .fp_armv8, | |
| 251 | .fullfp16, | |
| 252 | .fuse_aes, | |
| 253 | .neon, | |
| 254 | .perfmon, | |
| 255 | .rcpc, | |
| 256 | .v8_2a, | |
| 257 | }), | |
| 258 | }; | |
| 141 | std.debug.assert(len <= CpuFeature.Set.needed_bit_count); | |
| 142 | var result: [len]CpuFeature = undefined; | |
| 259 | 143 | result[@enumToInt(Feature.a76)] = .{ |
| 260 | 144 | .llvm_name = "a76", |
| 261 | 145 | .description = "Cortex-A76 ARM processors", |
| 262 | 146 | .dependencies = featureSet(&[_]Feature{ |
| 263 | 147 | .crypto, |
| 264 | 148 | .dotprod, |
| 265 | .fp_armv8, | |
| 266 | 149 | .fullfp16, |
| 267 | .neon, | |
| 268 | 150 | .rcpc, |
| 269 | 151 | .ssbs, |
| 270 | 152 | .v8_2a, |
| ... | ... | @@ -412,11 +294,10 @@ pub const all_features = blk: { |
| 412 | 294 | .arith_cbz_fusion, |
| 413 | 295 | .crypto, |
| 414 | 296 | .disable_latency_sched_heuristic, |
| 415 | .fp_armv8, | |
| 416 | 297 | .fuse_aes, |
| 417 | 298 | .fuse_crypto_eor, |
| 418 | .neon, | |
| 419 | 299 | .perfmon, |
| 300 | .v8a, | |
| 420 | 301 | .zcm, |
| 421 | 302 | .zcz, |
| 422 | 303 | .zcz_fp_workaround, |
| ... | ... | @@ -444,58 +325,6 @@ pub const all_features = blk: { |
| 444 | 325 | .custom_cheap_as_move, |
| 445 | 326 | }), |
| 446 | 327 | }; |
| 447 | result[@enumToInt(Feature.exynosm1)] = .{ | |
| 448 | .llvm_name = "exynosm1", | |
| 449 | .description = "Samsung Exynos-M1 processors", | |
| 450 | .dependencies = featureSet(&[_]Feature{ | |
| 451 | .crc, | |
| 452 | .crypto, | |
| 453 | .exynos_cheap_as_move, | |
| 454 | .force_32bit_jump_tables, | |
| 455 | .fuse_aes, | |
| 456 | .perfmon, | |
| 457 | .slow_misaligned_128store, | |
| 458 | .slow_paired_128, | |
| 459 | .use_postra_scheduler, | |
| 460 | .use_reciprocal_square_root, | |
| 461 | .zcz_fp, | |
| 462 | }), | |
| 463 | }; | |
| 464 | result[@enumToInt(Feature.exynosm2)] = .{ | |
| 465 | .llvm_name = "exynosm2", | |
| 466 | .description = "Samsung Exynos-M2 processors", | |
| 467 | .dependencies = featureSet(&[_]Feature{ | |
| 468 | .crc, | |
| 469 | .crypto, | |
| 470 | .exynos_cheap_as_move, | |
| 471 | .force_32bit_jump_tables, | |
| 472 | .fuse_aes, | |
| 473 | .perfmon, | |
| 474 | .slow_misaligned_128store, | |
| 475 | .slow_paired_128, | |
| 476 | .use_postra_scheduler, | |
| 477 | .zcz_fp, | |
| 478 | }), | |
| 479 | }; | |
| 480 | result[@enumToInt(Feature.exynosm3)] = .{ | |
| 481 | .llvm_name = "exynosm3", | |
| 482 | .description = "Samsung Exynos-M3 processors", | |
| 483 | .dependencies = featureSet(&[_]Feature{ | |
| 484 | .crc, | |
| 485 | .crypto, | |
| 486 | .exynos_cheap_as_move, | |
| 487 | .force_32bit_jump_tables, | |
| 488 | .fuse_address, | |
| 489 | .fuse_aes, | |
| 490 | .fuse_csel, | |
| 491 | .fuse_literals, | |
| 492 | .lsl_fast, | |
| 493 | .perfmon, | |
| 494 | .predictable_select_expensive, | |
| 495 | .use_postra_scheduler, | |
| 496 | .zcz_fp, | |
| 497 | }), | |
| 498 | }; | |
| 499 | 328 | result[@enumToInt(Feature.exynosm4)] = .{ |
| 500 | 329 | .llvm_name = "exynosm4", |
| 501 | 330 | .description = "Samsung Exynos-M4 processors", |
| ... | ... | @@ -519,24 +348,6 @@ pub const all_features = blk: { |
| 519 | 348 | .zcz, |
| 520 | 349 | }), |
| 521 | 350 | }; |
| 522 | result[@enumToInt(Feature.falkor)] = .{ | |
| 523 | .llvm_name = "falkor", | |
| 524 | .description = "Qualcomm Falkor processors", | |
| 525 | .dependencies = featureSet(&[_]Feature{ | |
| 526 | .crc, | |
| 527 | .crypto, | |
| 528 | .custom_cheap_as_move, | |
| 529 | .fp_armv8, | |
| 530 | .lsl_fast, | |
| 531 | .neon, | |
| 532 | .perfmon, | |
| 533 | .predictable_select_expensive, | |
| 534 | .rdm, | |
| 535 | .slow_strqro_store, | |
| 536 | .use_postra_scheduler, | |
| 537 | .zcz, | |
| 538 | }), | |
| 539 | }; | |
| 540 | 351 | result[@enumToInt(Feature.fmi)] = .{ |
| 541 | 352 | .llvm_name = "fmi", |
| 542 | 353 | .description = "Enable v8.4-A Flag Manipulation Instructions", |
| ... | ... | @@ -608,22 +419,6 @@ pub const all_features = blk: { |
| 608 | 419 | .fp_armv8, |
| 609 | 420 | }), |
| 610 | 421 | }; |
| 611 | result[@enumToInt(Feature.kryo)] = .{ | |
| 612 | .llvm_name = "kryo", | |
| 613 | .description = "Qualcomm Kryo processors", | |
| 614 | .dependencies = featureSet(&[_]Feature{ | |
| 615 | .crc, | |
| 616 | .crypto, | |
| 617 | .custom_cheap_as_move, | |
| 618 | .fp_armv8, | |
| 619 | .lsl_fast, | |
| 620 | .neon, | |
| 621 | .perfmon, | |
| 622 | .predictable_select_expensive, | |
| 623 | .use_postra_scheduler, | |
| 624 | .zcz, | |
| 625 | }), | |
| 626 | }; | |
| 627 | 422 | result[@enumToInt(Feature.lor)] = .{ |
| 628 | 423 | .llvm_name = "lor", |
| 629 | 424 | .description = "Enables ARM v8.1 Limited Ordering Regions extension", |
| ... | ... | @@ -852,23 +647,6 @@ pub const all_features = blk: { |
| 852 | 647 | .description = "Reserve X9, making it unavailable as a GPR", |
| 853 | 648 | .dependencies = featureSet(&[_]Feature{}), |
| 854 | 649 | }; |
| 855 | result[@enumToInt(Feature.saphira)] = .{ | |
| 856 | .llvm_name = "saphira", | |
| 857 | .description = "Qualcomm Saphira processors", | |
| 858 | .dependencies = featureSet(&[_]Feature{ | |
| 859 | .crypto, | |
| 860 | .custom_cheap_as_move, | |
| 861 | .fp_armv8, | |
| 862 | .lsl_fast, | |
| 863 | .neon, | |
| 864 | .perfmon, | |
| 865 | .predictable_select_expensive, | |
| 866 | .spe, | |
| 867 | .use_postra_scheduler, | |
| 868 | .v8_4a, | |
| 869 | .zcz, | |
| 870 | }), | |
| 871 | }; | |
| 872 | 650 | result[@enumToInt(Feature.sb)] = .{ |
| 873 | 651 | .llvm_name = "sb", |
| 874 | 652 | .description = "Enable v8.5 Speculation Barrier", |
| ... | ... | @@ -979,74 +757,6 @@ pub const all_features = blk: { |
| 979 | 757 | .sve2, |
| 980 | 758 | }), |
| 981 | 759 | }; |
| 982 | result[@enumToInt(Feature.thunderx)] = .{ | |
| 983 | .llvm_name = "thunderx", | |
| 984 | .description = "Cavium ThunderX processors", | |
| 985 | .dependencies = featureSet(&[_]Feature{ | |
| 986 | .crc, | |
| 987 | .crypto, | |
| 988 | .fp_armv8, | |
| 989 | .neon, | |
| 990 | .perfmon, | |
| 991 | .predictable_select_expensive, | |
| 992 | .use_postra_scheduler, | |
| 993 | }), | |
| 994 | }; | |
| 995 | result[@enumToInt(Feature.thunderx2t99)] = .{ | |
| 996 | .llvm_name = "thunderx2t99", | |
| 997 | .description = "Cavium ThunderX2 processors", | |
| 998 | .dependencies = featureSet(&[_]Feature{ | |
| 999 | .aggressive_fma, | |
| 1000 | .arith_bcc_fusion, | |
| 1001 | .crc, | |
| 1002 | .crypto, | |
| 1003 | .fp_armv8, | |
| 1004 | .lse, | |
| 1005 | .neon, | |
| 1006 | .predictable_select_expensive, | |
| 1007 | .use_postra_scheduler, | |
| 1008 | .v8_1a, | |
| 1009 | }), | |
| 1010 | }; | |
| 1011 | result[@enumToInt(Feature.thunderxt81)] = .{ | |
| 1012 | .llvm_name = "thunderxt81", | |
| 1013 | .description = "Cavium ThunderX processors", | |
| 1014 | .dependencies = featureSet(&[_]Feature{ | |
| 1015 | .crc, | |
| 1016 | .crypto, | |
| 1017 | .fp_armv8, | |
| 1018 | .neon, | |
| 1019 | .perfmon, | |
| 1020 | .predictable_select_expensive, | |
| 1021 | .use_postra_scheduler, | |
| 1022 | }), | |
| 1023 | }; | |
| 1024 | result[@enumToInt(Feature.thunderxt83)] = .{ | |
| 1025 | .llvm_name = "thunderxt83", | |
| 1026 | .description = "Cavium ThunderX processors", | |
| 1027 | .dependencies = featureSet(&[_]Feature{ | |
| 1028 | .crc, | |
| 1029 | .crypto, | |
| 1030 | .fp_armv8, | |
| 1031 | .neon, | |
| 1032 | .perfmon, | |
| 1033 | .predictable_select_expensive, | |
| 1034 | .use_postra_scheduler, | |
| 1035 | }), | |
| 1036 | }; | |
| 1037 | result[@enumToInt(Feature.thunderxt88)] = .{ | |
| 1038 | .llvm_name = "thunderxt88", | |
| 1039 | .description = "Cavium ThunderX processors", | |
| 1040 | .dependencies = featureSet(&[_]Feature{ | |
| 1041 | .crc, | |
| 1042 | .crypto, | |
| 1043 | .fp_armv8, | |
| 1044 | .neon, | |
| 1045 | .perfmon, | |
| 1046 | .predictable_select_expensive, | |
| 1047 | .use_postra_scheduler, | |
| 1048 | }), | |
| 1049 | }; | |
| 1050 | 760 | result[@enumToInt(Feature.tlb_rmi)] = .{ |
| 1051 | 761 | .llvm_name = "tlb-rmi", |
| 1052 | 762 | .description = "Enable v8.4-A TLB Range and Maintenance Instructions", |
| ... | ... | @@ -1072,24 +782,6 @@ pub const all_features = blk: { |
| 1072 | 782 | .description = "Enable v8.4-A Trace extension", |
| 1073 | 783 | .dependencies = featureSet(&[_]Feature{}), |
| 1074 | 784 | }; |
| 1075 | result[@enumToInt(Feature.tsv110)] = .{ | |
| 1076 | .llvm_name = "tsv110", | |
| 1077 | .description = "HiSilicon TS-V110 processors", | |
| 1078 | .dependencies = featureSet(&[_]Feature{ | |
| 1079 | .crypto, | |
| 1080 | .custom_cheap_as_move, | |
| 1081 | .dotprod, | |
| 1082 | .fp_armv8, | |
| 1083 | .fp16fml, | |
| 1084 | .fullfp16, | |
| 1085 | .fuse_aes, | |
| 1086 | .neon, | |
| 1087 | .perfmon, | |
| 1088 | .spe, | |
| 1089 | .use_postra_scheduler, | |
| 1090 | .v8_2a, | |
| 1091 | }), | |
| 1092 | }; | |
| 1093 | 785 | result[@enumToInt(Feature.uaops)] = .{ |
| 1094 | 786 | .llvm_name = "uaops", |
| 1095 | 787 | .description = "Enable v8.2 UAO PState", |
| ... | ... | @@ -1229,190 +921,325 @@ pub const all_features = blk: { |
| 1229 | 921 | }; |
| 1230 | 922 | |
| 1231 | 923 | pub const cpu = struct { |
| 1232 | pub const apple_latest = Cpu{ | |
| 924 | pub const apple_latest = CpuModel{ | |
| 1233 | 925 | .name = "apple_latest", |
| 1234 | 926 | .llvm_name = "apple-latest", |
| 1235 | 927 | .features = featureSet(&[_]Feature{ |
| 1236 | 928 | .cyclone, |
| 1237 | 929 | }), |
| 1238 | 930 | }; |
| 1239 | pub const cortex_a35 = Cpu{ | |
| 931 | pub const cortex_a35 = CpuModel{ | |
| 1240 | 932 | .name = "cortex_a35", |
| 1241 | 933 | .llvm_name = "cortex-a35", |
| 1242 | 934 | .features = featureSet(&[_]Feature{ |
| 1243 | .a35, | |
| 935 | .crc, | |
| 936 | .crypto, | |
| 937 | .perfmon, | |
| 938 | .v8a, | |
| 1244 | 939 | }), |
| 1245 | 940 | }; |
| 1246 | pub const cortex_a53 = Cpu{ | |
| 941 | pub const cortex_a53 = CpuModel{ | |
| 1247 | 942 | .name = "cortex_a53", |
| 1248 | 943 | .llvm_name = "cortex-a53", |
| 1249 | 944 | .features = featureSet(&[_]Feature{ |
| 1250 | .a53, | |
| 945 | .balance_fp_ops, | |
| 946 | .crc, | |
| 947 | .crypto, | |
| 948 | .custom_cheap_as_move, | |
| 949 | .fuse_aes, | |
| 950 | .perfmon, | |
| 951 | .use_aa, | |
| 952 | .use_postra_scheduler, | |
| 953 | .v8a, | |
| 1251 | 954 | }), |
| 1252 | 955 | }; |
| 1253 | pub const cortex_a55 = Cpu{ | |
| 956 | pub const cortex_a55 = CpuModel{ | |
| 1254 | 957 | .name = "cortex_a55", |
| 1255 | 958 | .llvm_name = "cortex-a55", |
| 1256 | 959 | .features = featureSet(&[_]Feature{ |
| 1257 | .a55, | |
| 960 | .crypto, | |
| 961 | .dotprod, | |
| 962 | .fullfp16, | |
| 963 | .fuse_aes, | |
| 964 | .perfmon, | |
| 965 | .rcpc, | |
| 966 | .v8_2a, | |
| 1258 | 967 | }), |
| 1259 | 968 | }; |
| 1260 | pub const cortex_a57 = Cpu{ | |
| 969 | pub const cortex_a57 = CpuModel{ | |
| 1261 | 970 | .name = "cortex_a57", |
| 1262 | 971 | .llvm_name = "cortex-a57", |
| 1263 | 972 | .features = featureSet(&[_]Feature{ |
| 1264 | .a57, | |
| 973 | .balance_fp_ops, | |
| 974 | .crc, | |
| 975 | .crypto, | |
| 976 | .custom_cheap_as_move, | |
| 977 | .fuse_aes, | |
| 978 | .fuse_literals, | |
| 979 | .perfmon, | |
| 980 | .predictable_select_expensive, | |
| 981 | .use_postra_scheduler, | |
| 982 | .v8a, | |
| 1265 | 983 | }), |
| 1266 | 984 | }; |
| 1267 | pub const cortex_a72 = Cpu{ | |
| 985 | pub const cortex_a72 = CpuModel{ | |
| 1268 | 986 | .name = "cortex_a72", |
| 1269 | 987 | .llvm_name = "cortex-a72", |
| 1270 | 988 | .features = featureSet(&[_]Feature{ |
| 1271 | .a72, | |
| 989 | .crc, | |
| 990 | .crypto, | |
| 991 | .fuse_aes, | |
| 992 | .perfmon, | |
| 993 | .v8a, | |
| 1272 | 994 | }), |
| 1273 | 995 | }; |
| 1274 | pub const cortex_a73 = Cpu{ | |
| 996 | pub const cortex_a73 = CpuModel{ | |
| 1275 | 997 | .name = "cortex_a73", |
| 1276 | 998 | .llvm_name = "cortex-a73", |
| 1277 | 999 | .features = featureSet(&[_]Feature{ |
| 1278 | .a73, | |
| 1000 | .crc, | |
| 1001 | .crypto, | |
| 1002 | .fuse_aes, | |
| 1003 | .perfmon, | |
| 1004 | .v8a, | |
| 1279 | 1005 | }), |
| 1280 | 1006 | }; |
| 1281 | pub const cortex_a75 = Cpu{ | |
| 1007 | pub const cortex_a75 = CpuModel{ | |
| 1282 | 1008 | .name = "cortex_a75", |
| 1283 | 1009 | .llvm_name = "cortex-a75", |
| 1284 | 1010 | .features = featureSet(&[_]Feature{ |
| 1285 | .a75, | |
| 1011 | .crypto, | |
| 1012 | .dotprod, | |
| 1013 | .fullfp16, | |
| 1014 | .fuse_aes, | |
| 1015 | .perfmon, | |
| 1016 | .rcpc, | |
| 1017 | .v8_2a, | |
| 1286 | 1018 | }), |
| 1287 | 1019 | }; |
| 1288 | pub const cortex_a76 = Cpu{ | |
| 1020 | pub const cortex_a76 = CpuModel{ | |
| 1289 | 1021 | .name = "cortex_a76", |
| 1290 | 1022 | .llvm_name = "cortex-a76", |
| 1291 | 1023 | .features = featureSet(&[_]Feature{ |
| 1292 | 1024 | .a76, |
| 1293 | 1025 | }), |
| 1294 | 1026 | }; |
| 1295 | pub const cortex_a76ae = Cpu{ | |
| 1027 | pub const cortex_a76ae = CpuModel{ | |
| 1296 | 1028 | .name = "cortex_a76ae", |
| 1297 | 1029 | .llvm_name = "cortex-a76ae", |
| 1298 | 1030 | .features = featureSet(&[_]Feature{ |
| 1299 | 1031 | .a76, |
| 1300 | 1032 | }), |
| 1301 | 1033 | }; |
| 1302 | pub const cyclone = Cpu{ | |
| 1034 | pub const cyclone = CpuModel{ | |
| 1303 | 1035 | .name = "cyclone", |
| 1304 | 1036 | .llvm_name = "cyclone", |
| 1305 | 1037 | .features = featureSet(&[_]Feature{ |
| 1306 | 1038 | .cyclone, |
| 1307 | 1039 | }), |
| 1308 | 1040 | }; |
| 1309 | pub const exynos_m1 = Cpu{ | |
| 1041 | pub const exynos_m1 = CpuModel{ | |
| 1310 | 1042 | .name = "exynos_m1", |
| 1311 | 1043 | .llvm_name = "exynos-m1", |
| 1312 | 1044 | .features = featureSet(&[_]Feature{ |
| 1313 | .exynosm1, | |
| 1045 | .crc, | |
| 1046 | .crypto, | |
| 1047 | .exynos_cheap_as_move, | |
| 1048 | .force_32bit_jump_tables, | |
| 1049 | .fuse_aes, | |
| 1050 | .perfmon, | |
| 1051 | .slow_misaligned_128store, | |
| 1052 | .slow_paired_128, | |
| 1053 | .use_postra_scheduler, | |
| 1054 | .use_reciprocal_square_root, | |
| 1055 | .v8a, | |
| 1056 | .zcz_fp, | |
| 1314 | 1057 | }), |
| 1315 | 1058 | }; |
| 1316 | pub const exynos_m2 = Cpu{ | |
| 1059 | pub const exynos_m2 = CpuModel{ | |
| 1317 | 1060 | .name = "exynos_m2", |
| 1318 | 1061 | .llvm_name = "exynos-m2", |
| 1319 | 1062 | .features = featureSet(&[_]Feature{ |
| 1320 | .exynosm2, | |
| 1063 | .crc, | |
| 1064 | .crypto, | |
| 1065 | .exynos_cheap_as_move, | |
| 1066 | .force_32bit_jump_tables, | |
| 1067 | .fuse_aes, | |
| 1068 | .perfmon, | |
| 1069 | .slow_misaligned_128store, | |
| 1070 | .slow_paired_128, | |
| 1071 | .use_postra_scheduler, | |
| 1072 | .v8a, | |
| 1073 | .zcz_fp, | |
| 1321 | 1074 | }), |
| 1322 | 1075 | }; |
| 1323 | pub const exynos_m3 = Cpu{ | |
| 1076 | pub const exynos_m3 = CpuModel{ | |
| 1324 | 1077 | .name = "exynos_m3", |
| 1325 | 1078 | .llvm_name = "exynos-m3", |
| 1326 | 1079 | .features = featureSet(&[_]Feature{ |
| 1327 | .exynosm3, | |
| 1080 | .crc, | |
| 1081 | .crypto, | |
| 1082 | .exynos_cheap_as_move, | |
| 1083 | .force_32bit_jump_tables, | |
| 1084 | .fuse_address, | |
| 1085 | .fuse_aes, | |
| 1086 | .fuse_csel, | |
| 1087 | .fuse_literals, | |
| 1088 | .lsl_fast, | |
| 1089 | .perfmon, | |
| 1090 | .predictable_select_expensive, | |
| 1091 | .use_postra_scheduler, | |
| 1092 | .v8a, | |
| 1093 | .zcz_fp, | |
| 1328 | 1094 | }), |
| 1329 | 1095 | }; |
| 1330 | pub const exynos_m4 = Cpu{ | |
| 1096 | pub const exynos_m4 = CpuModel{ | |
| 1331 | 1097 | .name = "exynos_m4", |
| 1332 | 1098 | .llvm_name = "exynos-m4", |
| 1333 | 1099 | .features = featureSet(&[_]Feature{ |
| 1334 | 1100 | .exynosm4, |
| 1335 | 1101 | }), |
| 1336 | 1102 | }; |
| 1337 | pub const exynos_m5 = Cpu{ | |
| 1103 | pub const exynos_m5 = CpuModel{ | |
| 1338 | 1104 | .name = "exynos_m5", |
| 1339 | 1105 | .llvm_name = "exynos-m5", |
| 1340 | 1106 | .features = featureSet(&[_]Feature{ |
| 1341 | 1107 | .exynosm4, |
| 1342 | 1108 | }), |
| 1343 | 1109 | }; |
| 1344 | pub const falkor = Cpu{ | |
| 1110 | pub const falkor = CpuModel{ | |
| 1345 | 1111 | .name = "falkor", |
| 1346 | 1112 | .llvm_name = "falkor", |
| 1347 | 1113 | .features = featureSet(&[_]Feature{ |
| 1348 | .falkor, | |
| 1114 | .crc, | |
| 1115 | .crypto, | |
| 1116 | .custom_cheap_as_move, | |
| 1117 | .lsl_fast, | |
| 1118 | .perfmon, | |
| 1119 | .predictable_select_expensive, | |
| 1120 | .rdm, | |
| 1121 | .slow_strqro_store, | |
| 1122 | .use_postra_scheduler, | |
| 1123 | .v8a, | |
| 1124 | .zcz, | |
| 1349 | 1125 | }), |
| 1350 | 1126 | }; |
| 1351 | pub const generic = Cpu{ | |
| 1127 | pub const generic = CpuModel{ | |
| 1352 | 1128 | .name = "generic", |
| 1353 | 1129 | .llvm_name = "generic", |
| 1354 | 1130 | .features = featureSet(&[_]Feature{ |
| 1355 | .fp_armv8, | |
| 1356 | 1131 | .fuse_aes, |
| 1357 | .neon, | |
| 1358 | 1132 | .perfmon, |
| 1359 | 1133 | .use_postra_scheduler, |
| 1134 | .v8a, | |
| 1360 | 1135 | }), |
| 1361 | 1136 | }; |
| 1362 | pub const kryo = Cpu{ | |
| 1137 | pub const kryo = CpuModel{ | |
| 1363 | 1138 | .name = "kryo", |
| 1364 | 1139 | .llvm_name = "kryo", |
| 1365 | 1140 | .features = featureSet(&[_]Feature{ |
| 1366 | .kryo, | |
| 1141 | .crc, | |
| 1142 | .crypto, | |
| 1143 | .custom_cheap_as_move, | |
| 1144 | .lsl_fast, | |
| 1145 | .perfmon, | |
| 1146 | .predictable_select_expensive, | |
| 1147 | .use_postra_scheduler, | |
| 1148 | .zcz, | |
| 1149 | .v8a, | |
| 1367 | 1150 | }), |
| 1368 | 1151 | }; |
| 1369 | pub const saphira = Cpu{ | |
| 1152 | pub const saphira = CpuModel{ | |
| 1370 | 1153 | .name = "saphira", |
| 1371 | 1154 | .llvm_name = "saphira", |
| 1372 | 1155 | .features = featureSet(&[_]Feature{ |
| 1373 | .saphira, | |
| 1156 | .crypto, | |
| 1157 | .custom_cheap_as_move, | |
| 1158 | .lsl_fast, | |
| 1159 | .perfmon, | |
| 1160 | .predictable_select_expensive, | |
| 1161 | .spe, | |
| 1162 | .use_postra_scheduler, | |
| 1163 | .v8_4a, | |
| 1164 | .zcz, | |
| 1374 | 1165 | }), |
| 1375 | 1166 | }; |
| 1376 | pub const thunderx = Cpu{ | |
| 1167 | pub const thunderx = CpuModel{ | |
| 1377 | 1168 | .name = "thunderx", |
| 1378 | 1169 | .llvm_name = "thunderx", |
| 1379 | 1170 | .features = featureSet(&[_]Feature{ |
| 1380 | .thunderx, | |
| 1171 | .crc, | |
| 1172 | .crypto, | |
| 1173 | .perfmon, | |
| 1174 | .predictable_select_expensive, | |
| 1175 | .use_postra_scheduler, | |
| 1176 | .v8a, | |
| 1381 | 1177 | }), |
| 1382 | 1178 | }; |
| 1383 | pub const thunderx2t99 = Cpu{ | |
| 1179 | pub const thunderx2t99 = CpuModel{ | |
| 1384 | 1180 | .name = "thunderx2t99", |
| 1385 | 1181 | .llvm_name = "thunderx2t99", |
| 1386 | 1182 | .features = featureSet(&[_]Feature{ |
| 1387 | .thunderx2t99, | |
| 1183 | .aggressive_fma, | |
| 1184 | .arith_bcc_fusion, | |
| 1185 | .crc, | |
| 1186 | .crypto, | |
| 1187 | .lse, | |
| 1188 | .predictable_select_expensive, | |
| 1189 | .use_postra_scheduler, | |
| 1190 | .v8_1a, | |
| 1388 | 1191 | }), |
| 1389 | 1192 | }; |
| 1390 | pub const thunderxt81 = Cpu{ | |
| 1193 | pub const thunderxt81 = CpuModel{ | |
| 1391 | 1194 | .name = "thunderxt81", |
| 1392 | 1195 | .llvm_name = "thunderxt81", |
| 1393 | 1196 | .features = featureSet(&[_]Feature{ |
| 1394 | .thunderxt81, | |
| 1197 | .crc, | |
| 1198 | .crypto, | |
| 1199 | .perfmon, | |
| 1200 | .predictable_select_expensive, | |
| 1201 | .use_postra_scheduler, | |
| 1202 | .v8a, | |
| 1395 | 1203 | }), |
| 1396 | 1204 | }; |
| 1397 | pub const thunderxt83 = Cpu{ | |
| 1205 | pub const thunderxt83 = CpuModel{ | |
| 1398 | 1206 | .name = "thunderxt83", |
| 1399 | 1207 | .llvm_name = "thunderxt83", |
| 1400 | 1208 | .features = featureSet(&[_]Feature{ |
| 1401 | .thunderxt83, | |
| 1209 | .crc, | |
| 1210 | .crypto, | |
| 1211 | .perfmon, | |
| 1212 | .predictable_select_expensive, | |
| 1213 | .use_postra_scheduler, | |
| 1214 | .v8a, | |
| 1402 | 1215 | }), |
| 1403 | 1216 | }; |
| 1404 | pub const thunderxt88 = Cpu{ | |
| 1217 | pub const thunderxt88 = CpuModel{ | |
| 1405 | 1218 | .name = "thunderxt88", |
| 1406 | 1219 | .llvm_name = "thunderxt88", |
| 1407 | 1220 | .features = featureSet(&[_]Feature{ |
| 1408 | .thunderxt88, | |
| 1221 | .crc, | |
| 1222 | .crypto, | |
| 1223 | .perfmon, | |
| 1224 | .predictable_select_expensive, | |
| 1225 | .use_postra_scheduler, | |
| 1226 | .v8a, | |
| 1409 | 1227 | }), |
| 1410 | 1228 | }; |
| 1411 | pub const tsv110 = Cpu{ | |
| 1229 | pub const tsv110 = CpuModel{ | |
| 1412 | 1230 | .name = "tsv110", |
| 1413 | 1231 | .llvm_name = "tsv110", |
| 1414 | 1232 | .features = featureSet(&[_]Feature{ |
| 1415 | .tsv110, | |
| 1233 | .crypto, | |
| 1234 | .custom_cheap_as_move, | |
| 1235 | .dotprod, | |
| 1236 | .fp16fml, | |
| 1237 | .fullfp16, | |
| 1238 | .fuse_aes, | |
| 1239 | .perfmon, | |
| 1240 | .spe, | |
| 1241 | .use_postra_scheduler, | |
| 1242 | .v8_2a, | |
| 1416 | 1243 | }), |
| 1417 | 1244 | }; |
| 1418 | 1245 | }; |
| ... | ... | @@ -1420,7 +1247,7 @@ pub const cpu = struct { |
| 1420 | 1247 | /// All aarch64 CPUs, sorted alphabetically by name. |
| 1421 | 1248 | /// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1 |
| 1422 | 1249 | /// compiler has inefficient memory and CPU usage, affecting build times. |
| 1423 | pub const all_cpus = &[_]*const Cpu{ | |
| 1250 | pub const all_cpus = &[_]*const CpuModel{ | |
| 1424 | 1251 | &cpu.apple_latest, |
| 1425 | 1252 | &cpu.cortex_a35, |
| 1426 | 1253 | &cpu.cortex_a53, |
lib/std/target/amdgpu.zig+45-44| ... | ... | @@ -1,5 +1,6 @@ |
| 1 | 1 | const std = @import("../std.zig"); |
| 2 | const Cpu = std.Target.Cpu; | |
| 2 | const CpuFeature = std.Target.Cpu.Feature; | |
| 3 | const CpuModel = std.Target.Cpu.Model; | |
| 3 | 4 | |
| 4 | 5 | pub const Feature = enum { |
| 5 | 6 | @"16_bit_insts", |
| ... | ... | @@ -111,12 +112,12 @@ pub const Feature = enum { |
| 111 | 112 | xnack, |
| 112 | 113 | }; |
| 113 | 114 | |
| 114 | pub usingnamespace Cpu.Feature.feature_set_fns(Feature); | |
| 115 | pub usingnamespace CpuFeature.feature_set_fns(Feature); | |
| 115 | 116 | |
| 116 | 117 | pub const all_features = blk: { |
| 117 | 118 | const len = @typeInfo(Feature).Enum.fields.len; |
| 118 | std.debug.assert(len <= Cpu.Feature.Set.needed_bit_count); | |
| 119 | var result: [len]Cpu.Feature = undefined; | |
| 119 | std.debug.assert(len <= CpuFeature.Set.needed_bit_count); | |
| 120 | var result: [len]CpuFeature = undefined; | |
| 120 | 121 | result[@enumToInt(Feature.@"16_bit_insts")] = .{ |
| 121 | 122 | .llvm_name = "16-bit-insts", |
| 122 | 123 | .description = "Has i16/f16 instructions", |
| ... | ... | @@ -778,7 +779,7 @@ pub const all_features = blk: { |
| 778 | 779 | }; |
| 779 | 780 | |
| 780 | 781 | pub const cpu = struct { |
| 781 | pub const bonaire = Cpu{ | |
| 782 | pub const bonaire = CpuModel{ | |
| 782 | 783 | .name = "bonaire", |
| 783 | 784 | .llvm_name = "bonaire", |
| 784 | 785 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -788,7 +789,7 @@ pub const cpu = struct { |
| 788 | 789 | .sea_islands, |
| 789 | 790 | }), |
| 790 | 791 | }; |
| 791 | pub const carrizo = Cpu{ | |
| 792 | pub const carrizo = CpuModel{ | |
| 792 | 793 | .name = "carrizo", |
| 793 | 794 | .llvm_name = "carrizo", |
| 794 | 795 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -801,7 +802,7 @@ pub const cpu = struct { |
| 801 | 802 | .xnack, |
| 802 | 803 | }), |
| 803 | 804 | }; |
| 804 | pub const fiji = Cpu{ | |
| 805 | pub const fiji = CpuModel{ | |
| 805 | 806 | .name = "fiji", |
| 806 | 807 | .llvm_name = "fiji", |
| 807 | 808 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -812,14 +813,14 @@ pub const cpu = struct { |
| 812 | 813 | .volcanic_islands, |
| 813 | 814 | }), |
| 814 | 815 | }; |
| 815 | pub const generic = Cpu{ | |
| 816 | pub const generic = CpuModel{ | |
| 816 | 817 | .name = "generic", |
| 817 | 818 | .llvm_name = "generic", |
| 818 | 819 | .features = featureSet(&[_]Feature{ |
| 819 | 820 | .wavefrontsize64, |
| 820 | 821 | }), |
| 821 | 822 | }; |
| 822 | pub const generic_hsa = Cpu{ | |
| 823 | pub const generic_hsa = CpuModel{ | |
| 823 | 824 | .name = "generic_hsa", |
| 824 | 825 | .llvm_name = "generic-hsa", |
| 825 | 826 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -827,7 +828,7 @@ pub const cpu = struct { |
| 827 | 828 | .wavefrontsize64, |
| 828 | 829 | }), |
| 829 | 830 | }; |
| 830 | pub const gfx1010 = Cpu{ | |
| 831 | pub const gfx1010 = CpuModel{ | |
| 831 | 832 | .name = "gfx1010", |
| 832 | 833 | .llvm_name = "gfx1010", |
| 833 | 834 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -853,7 +854,7 @@ pub const cpu = struct { |
| 853 | 854 | .wavefrontsize32, |
| 854 | 855 | }), |
| 855 | 856 | }; |
| 856 | pub const gfx1011 = Cpu{ | |
| 857 | pub const gfx1011 = CpuModel{ | |
| 857 | 858 | .name = "gfx1011", |
| 858 | 859 | .llvm_name = "gfx1011", |
| 859 | 860 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -882,7 +883,7 @@ pub const cpu = struct { |
| 882 | 883 | .wavefrontsize32, |
| 883 | 884 | }), |
| 884 | 885 | }; |
| 885 | pub const gfx1012 = Cpu{ | |
| 886 | pub const gfx1012 = CpuModel{ | |
| 886 | 887 | .name = "gfx1012", |
| 887 | 888 | .llvm_name = "gfx1012", |
| 888 | 889 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -912,7 +913,7 @@ pub const cpu = struct { |
| 912 | 913 | .wavefrontsize32, |
| 913 | 914 | }), |
| 914 | 915 | }; |
| 915 | pub const gfx600 = Cpu{ | |
| 916 | pub const gfx600 = CpuModel{ | |
| 916 | 917 | .name = "gfx600", |
| 917 | 918 | .llvm_name = "gfx600", |
| 918 | 919 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -924,7 +925,7 @@ pub const cpu = struct { |
| 924 | 925 | .southern_islands, |
| 925 | 926 | }), |
| 926 | 927 | }; |
| 927 | pub const gfx601 = Cpu{ | |
| 928 | pub const gfx601 = CpuModel{ | |
| 928 | 929 | .name = "gfx601", |
| 929 | 930 | .llvm_name = "gfx601", |
| 930 | 931 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -934,7 +935,7 @@ pub const cpu = struct { |
| 934 | 935 | .southern_islands, |
| 935 | 936 | }), |
| 936 | 937 | }; |
| 937 | pub const gfx700 = Cpu{ | |
| 938 | pub const gfx700 = CpuModel{ | |
| 938 | 939 | .name = "gfx700", |
| 939 | 940 | .llvm_name = "gfx700", |
| 940 | 941 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -944,7 +945,7 @@ pub const cpu = struct { |
| 944 | 945 | .sea_islands, |
| 945 | 946 | }), |
| 946 | 947 | }; |
| 947 | pub const gfx701 = Cpu{ | |
| 948 | pub const gfx701 = CpuModel{ | |
| 948 | 949 | .name = "gfx701", |
| 949 | 950 | .llvm_name = "gfx701", |
| 950 | 951 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -956,7 +957,7 @@ pub const cpu = struct { |
| 956 | 957 | .sea_islands, |
| 957 | 958 | }), |
| 958 | 959 | }; |
| 959 | pub const gfx702 = Cpu{ | |
| 960 | pub const gfx702 = CpuModel{ | |
| 960 | 961 | .name = "gfx702", |
| 961 | 962 | .llvm_name = "gfx702", |
| 962 | 963 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -967,7 +968,7 @@ pub const cpu = struct { |
| 967 | 968 | .sea_islands, |
| 968 | 969 | }), |
| 969 | 970 | }; |
| 970 | pub const gfx703 = Cpu{ | |
| 971 | pub const gfx703 = CpuModel{ | |
| 971 | 972 | .name = "gfx703", |
| 972 | 973 | .llvm_name = "gfx703", |
| 973 | 974 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -977,7 +978,7 @@ pub const cpu = struct { |
| 977 | 978 | .sea_islands, |
| 978 | 979 | }), |
| 979 | 980 | }; |
| 980 | pub const gfx704 = Cpu{ | |
| 981 | pub const gfx704 = CpuModel{ | |
| 981 | 982 | .name = "gfx704", |
| 982 | 983 | .llvm_name = "gfx704", |
| 983 | 984 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -987,7 +988,7 @@ pub const cpu = struct { |
| 987 | 988 | .sea_islands, |
| 988 | 989 | }), |
| 989 | 990 | }; |
| 990 | pub const gfx801 = Cpu{ | |
| 991 | pub const gfx801 = CpuModel{ | |
| 991 | 992 | .name = "gfx801", |
| 992 | 993 | .llvm_name = "gfx801", |
| 993 | 994 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1000,7 +1001,7 @@ pub const cpu = struct { |
| 1000 | 1001 | .xnack, |
| 1001 | 1002 | }), |
| 1002 | 1003 | }; |
| 1003 | pub const gfx802 = Cpu{ | |
| 1004 | pub const gfx802 = CpuModel{ | |
| 1004 | 1005 | .name = "gfx802", |
| 1005 | 1006 | .llvm_name = "gfx802", |
| 1006 | 1007 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1012,7 +1013,7 @@ pub const cpu = struct { |
| 1012 | 1013 | .volcanic_islands, |
| 1013 | 1014 | }), |
| 1014 | 1015 | }; |
| 1015 | pub const gfx803 = Cpu{ | |
| 1016 | pub const gfx803 = CpuModel{ | |
| 1016 | 1017 | .name = "gfx803", |
| 1017 | 1018 | .llvm_name = "gfx803", |
| 1018 | 1019 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1023,7 +1024,7 @@ pub const cpu = struct { |
| 1023 | 1024 | .volcanic_islands, |
| 1024 | 1025 | }), |
| 1025 | 1026 | }; |
| 1026 | pub const gfx810 = Cpu{ | |
| 1027 | pub const gfx810 = CpuModel{ | |
| 1027 | 1028 | .name = "gfx810", |
| 1028 | 1029 | .llvm_name = "gfx810", |
| 1029 | 1030 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1033,7 +1034,7 @@ pub const cpu = struct { |
| 1033 | 1034 | .xnack, |
| 1034 | 1035 | }), |
| 1035 | 1036 | }; |
| 1036 | pub const gfx900 = Cpu{ | |
| 1037 | pub const gfx900 = CpuModel{ | |
| 1037 | 1038 | .name = "gfx900", |
| 1038 | 1039 | .llvm_name = "gfx900", |
| 1039 | 1040 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1045,7 +1046,7 @@ pub const cpu = struct { |
| 1045 | 1046 | .no_xnack_support, |
| 1046 | 1047 | }), |
| 1047 | 1048 | }; |
| 1048 | pub const gfx902 = Cpu{ | |
| 1049 | pub const gfx902 = CpuModel{ | |
| 1049 | 1050 | .name = "gfx902", |
| 1050 | 1051 | .llvm_name = "gfx902", |
| 1051 | 1052 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1057,7 +1058,7 @@ pub const cpu = struct { |
| 1057 | 1058 | .xnack, |
| 1058 | 1059 | }), |
| 1059 | 1060 | }; |
| 1060 | pub const gfx904 = Cpu{ | |
| 1061 | pub const gfx904 = CpuModel{ | |
| 1061 | 1062 | .name = "gfx904", |
| 1062 | 1063 | .llvm_name = "gfx904", |
| 1063 | 1064 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1069,7 +1070,7 @@ pub const cpu = struct { |
| 1069 | 1070 | .no_xnack_support, |
| 1070 | 1071 | }), |
| 1071 | 1072 | }; |
| 1072 | pub const gfx906 = Cpu{ | |
| 1073 | pub const gfx906 = CpuModel{ | |
| 1073 | 1074 | .name = "gfx906", |
| 1074 | 1075 | .llvm_name = "gfx906", |
| 1075 | 1076 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1084,7 +1085,7 @@ pub const cpu = struct { |
| 1084 | 1085 | .no_xnack_support, |
| 1085 | 1086 | }), |
| 1086 | 1087 | }; |
| 1087 | pub const gfx908 = Cpu{ | |
| 1088 | pub const gfx908 = CpuModel{ | |
| 1088 | 1089 | .name = "gfx908", |
| 1089 | 1090 | .llvm_name = "gfx908", |
| 1090 | 1091 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1106,7 +1107,7 @@ pub const cpu = struct { |
| 1106 | 1107 | .sram_ecc, |
| 1107 | 1108 | }), |
| 1108 | 1109 | }; |
| 1109 | pub const gfx909 = Cpu{ | |
| 1110 | pub const gfx909 = CpuModel{ | |
| 1110 | 1111 | .name = "gfx909", |
| 1111 | 1112 | .llvm_name = "gfx909", |
| 1112 | 1113 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1117,7 +1118,7 @@ pub const cpu = struct { |
| 1117 | 1118 | .xnack, |
| 1118 | 1119 | }), |
| 1119 | 1120 | }; |
| 1120 | pub const hainan = Cpu{ | |
| 1121 | pub const hainan = CpuModel{ | |
| 1121 | 1122 | .name = "hainan", |
| 1122 | 1123 | .llvm_name = "hainan", |
| 1123 | 1124 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1127,7 +1128,7 @@ pub const cpu = struct { |
| 1127 | 1128 | .southern_islands, |
| 1128 | 1129 | }), |
| 1129 | 1130 | }; |
| 1130 | pub const hawaii = Cpu{ | |
| 1131 | pub const hawaii = CpuModel{ | |
| 1131 | 1132 | .name = "hawaii", |
| 1132 | 1133 | .llvm_name = "hawaii", |
| 1133 | 1134 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1139,7 +1140,7 @@ pub const cpu = struct { |
| 1139 | 1140 | .sea_islands, |
| 1140 | 1141 | }), |
| 1141 | 1142 | }; |
| 1142 | pub const iceland = Cpu{ | |
| 1143 | pub const iceland = CpuModel{ | |
| 1143 | 1144 | .name = "iceland", |
| 1144 | 1145 | .llvm_name = "iceland", |
| 1145 | 1146 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1151,7 +1152,7 @@ pub const cpu = struct { |
| 1151 | 1152 | .volcanic_islands, |
| 1152 | 1153 | }), |
| 1153 | 1154 | }; |
| 1154 | pub const kabini = Cpu{ | |
| 1155 | pub const kabini = CpuModel{ | |
| 1155 | 1156 | .name = "kabini", |
| 1156 | 1157 | .llvm_name = "kabini", |
| 1157 | 1158 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1161,7 +1162,7 @@ pub const cpu = struct { |
| 1161 | 1162 | .sea_islands, |
| 1162 | 1163 | }), |
| 1163 | 1164 | }; |
| 1164 | pub const kaveri = Cpu{ | |
| 1165 | pub const kaveri = CpuModel{ | |
| 1165 | 1166 | .name = "kaveri", |
| 1166 | 1167 | .llvm_name = "kaveri", |
| 1167 | 1168 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1171,7 +1172,7 @@ pub const cpu = struct { |
| 1171 | 1172 | .sea_islands, |
| 1172 | 1173 | }), |
| 1173 | 1174 | }; |
| 1174 | pub const mullins = Cpu{ | |
| 1175 | pub const mullins = CpuModel{ | |
| 1175 | 1176 | .name = "mullins", |
| 1176 | 1177 | .llvm_name = "mullins", |
| 1177 | 1178 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1181,7 +1182,7 @@ pub const cpu = struct { |
| 1181 | 1182 | .sea_islands, |
| 1182 | 1183 | }), |
| 1183 | 1184 | }; |
| 1184 | pub const oland = Cpu{ | |
| 1185 | pub const oland = CpuModel{ | |
| 1185 | 1186 | .name = "oland", |
| 1186 | 1187 | .llvm_name = "oland", |
| 1187 | 1188 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1191,7 +1192,7 @@ pub const cpu = struct { |
| 1191 | 1192 | .southern_islands, |
| 1192 | 1193 | }), |
| 1193 | 1194 | }; |
| 1194 | pub const pitcairn = Cpu{ | |
| 1195 | pub const pitcairn = CpuModel{ | |
| 1195 | 1196 | .name = "pitcairn", |
| 1196 | 1197 | .llvm_name = "pitcairn", |
| 1197 | 1198 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1201,7 +1202,7 @@ pub const cpu = struct { |
| 1201 | 1202 | .southern_islands, |
| 1202 | 1203 | }), |
| 1203 | 1204 | }; |
| 1204 | pub const polaris10 = Cpu{ | |
| 1205 | pub const polaris10 = CpuModel{ | |
| 1205 | 1206 | .name = "polaris10", |
| 1206 | 1207 | .llvm_name = "polaris10", |
| 1207 | 1208 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1212,7 +1213,7 @@ pub const cpu = struct { |
| 1212 | 1213 | .volcanic_islands, |
| 1213 | 1214 | }), |
| 1214 | 1215 | }; |
| 1215 | pub const polaris11 = Cpu{ | |
| 1216 | pub const polaris11 = CpuModel{ | |
| 1216 | 1217 | .name = "polaris11", |
| 1217 | 1218 | .llvm_name = "polaris11", |
| 1218 | 1219 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1223,7 +1224,7 @@ pub const cpu = struct { |
| 1223 | 1224 | .volcanic_islands, |
| 1224 | 1225 | }), |
| 1225 | 1226 | }; |
| 1226 | pub const stoney = Cpu{ | |
| 1227 | pub const stoney = CpuModel{ | |
| 1227 | 1228 | .name = "stoney", |
| 1228 | 1229 | .llvm_name = "stoney", |
| 1229 | 1230 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1233,7 +1234,7 @@ pub const cpu = struct { |
| 1233 | 1234 | .xnack, |
| 1234 | 1235 | }), |
| 1235 | 1236 | }; |
| 1236 | pub const tahiti = Cpu{ | |
| 1237 | pub const tahiti = CpuModel{ | |
| 1237 | 1238 | .name = "tahiti", |
| 1238 | 1239 | .llvm_name = "tahiti", |
| 1239 | 1240 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1245,7 +1246,7 @@ pub const cpu = struct { |
| 1245 | 1246 | .southern_islands, |
| 1246 | 1247 | }), |
| 1247 | 1248 | }; |
| 1248 | pub const tonga = Cpu{ | |
| 1249 | pub const tonga = CpuModel{ | |
| 1249 | 1250 | .name = "tonga", |
| 1250 | 1251 | .llvm_name = "tonga", |
| 1251 | 1252 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1257,7 +1258,7 @@ pub const cpu = struct { |
| 1257 | 1258 | .volcanic_islands, |
| 1258 | 1259 | }), |
| 1259 | 1260 | }; |
| 1260 | pub const verde = Cpu{ | |
| 1261 | pub const verde = CpuModel{ | |
| 1261 | 1262 | .name = "verde", |
| 1262 | 1263 | .llvm_name = "verde", |
| 1263 | 1264 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1272,7 +1273,7 @@ pub const cpu = struct { |
| 1272 | 1273 | /// All amdgpu CPUs, sorted alphabetically by name. |
| 1273 | 1274 | /// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1 |
| 1274 | 1275 | /// compiler has inefficient memory and CPU usage, affecting build times. |
| 1275 | pub const all_cpus = &[_]*const Cpu{ | |
| 1276 | pub const all_cpus = &[_]*const CpuModel{ | |
| 1276 | 1277 | &cpu.bonaire, |
| 1277 | 1278 | &cpu.carrizo, |
| 1278 | 1279 | &cpu.fiji, |
lib/std/target/arm.zig+85-87| ... | ... | @@ -390,14 +390,14 @@ pub const all_features = blk: { |
| 390 | 390 | .llvm_name = "iwmmxt", |
| 391 | 391 | .description = "ARMv5te architecture", |
| 392 | 392 | .dependencies = featureSet(&[_]Feature{ |
| 393 | .armv5te, | |
| 393 | .v5te, | |
| 394 | 394 | }), |
| 395 | 395 | }; |
| 396 | 396 | result[@enumToInt(Feature.iwmmxt2)] = .{ |
| 397 | 397 | .llvm_name = "iwmmxt2", |
| 398 | 398 | .description = "ARMv5te architecture", |
| 399 | 399 | .dependencies = featureSet(&[_]Feature{ |
| 400 | .armv5te, | |
| 400 | .v5te, | |
| 401 | 401 | }), |
| 402 | 402 | }; |
| 403 | 403 | result[@enumToInt(Feature.lob)] = .{ |
| ... | ... | @@ -1089,7 +1089,7 @@ pub const all_features = blk: { |
| 1089 | 1089 | .llvm_name = "xscale", |
| 1090 | 1090 | .description = "ARMv5te architecture", |
| 1091 | 1091 | .dependencies = featureSet(&[_]Feature{ |
| 1092 | .armv5te, | |
| 1092 | .v5te, | |
| 1093 | 1093 | }), |
| 1094 | 1094 | }; |
| 1095 | 1095 | result[@enumToInt(Feature.zcz)] = .{ |
| ... | ... | @@ -1110,49 +1110,49 @@ pub const cpu = struct { |
| 1110 | 1110 | .name = "arm1020e", |
| 1111 | 1111 | .llvm_name = "arm1020e", |
| 1112 | 1112 | .features = featureSet(&[_]Feature{ |
| 1113 | .armv5te, | |
| 1113 | .v5te, | |
| 1114 | 1114 | }), |
| 1115 | 1115 | }; |
| 1116 | 1116 | pub const arm1020t = CpuModel{ |
| 1117 | 1117 | .name = "arm1020t", |
| 1118 | 1118 | .llvm_name = "arm1020t", |
| 1119 | 1119 | .features = featureSet(&[_]Feature{ |
| 1120 | .armv5t, | |
| 1120 | .v5t, | |
| 1121 | 1121 | }), |
| 1122 | 1122 | }; |
| 1123 | 1123 | pub const arm1022e = CpuModel{ |
| 1124 | 1124 | .name = "arm1022e", |
| 1125 | 1125 | .llvm_name = "arm1022e", |
| 1126 | 1126 | .features = featureSet(&[_]Feature{ |
| 1127 | .armv5te, | |
| 1127 | .v5te, | |
| 1128 | 1128 | }), |
| 1129 | 1129 | }; |
| 1130 | 1130 | pub const arm10e = CpuModel{ |
| 1131 | 1131 | .name = "arm10e", |
| 1132 | 1132 | .llvm_name = "arm10e", |
| 1133 | 1133 | .features = featureSet(&[_]Feature{ |
| 1134 | .armv5te, | |
| 1134 | .v5te, | |
| 1135 | 1135 | }), |
| 1136 | 1136 | }; |
| 1137 | 1137 | pub const arm10tdmi = CpuModel{ |
| 1138 | 1138 | .name = "arm10tdmi", |
| 1139 | 1139 | .llvm_name = "arm10tdmi", |
| 1140 | 1140 | .features = featureSet(&[_]Feature{ |
| 1141 | .armv5t, | |
| 1141 | .v5t, | |
| 1142 | 1142 | }), |
| 1143 | 1143 | }; |
| 1144 | 1144 | pub const arm1136j_s = CpuModel{ |
| 1145 | 1145 | .name = "arm1136j_s", |
| 1146 | 1146 | .llvm_name = "arm1136j-s", |
| 1147 | 1147 | .features = featureSet(&[_]Feature{ |
| 1148 | .armv6, | |
| 1148 | .v6, | |
| 1149 | 1149 | }), |
| 1150 | 1150 | }; |
| 1151 | 1151 | pub const arm1136jf_s = CpuModel{ |
| 1152 | 1152 | .name = "arm1136jf_s", |
| 1153 | 1153 | .llvm_name = "arm1136jf-s", |
| 1154 | 1154 | .features = featureSet(&[_]Feature{ |
| 1155 | .armv6, | |
| 1155 | .v6, | |
| 1156 | 1156 | .slowfpvmlx, |
| 1157 | 1157 | .vfp2, |
| 1158 | 1158 | }), |
| ... | ... | @@ -1161,14 +1161,14 @@ pub const cpu = struct { |
| 1161 | 1161 | .name = "arm1156t2_s", |
| 1162 | 1162 | .llvm_name = "arm1156t2-s", |
| 1163 | 1163 | .features = featureSet(&[_]Feature{ |
| 1164 | .armv6t2, | |
| 1164 | .v6t2, | |
| 1165 | 1165 | }), |
| 1166 | 1166 | }; |
| 1167 | 1167 | pub const arm1156t2f_s = CpuModel{ |
| 1168 | 1168 | .name = "arm1156t2f_s", |
| 1169 | 1169 | .llvm_name = "arm1156t2f-s", |
| 1170 | 1170 | .features = featureSet(&[_]Feature{ |
| 1171 | .armv6t2, | |
| 1171 | .v6t2, | |
| 1172 | 1172 | .slowfpvmlx, |
| 1173 | 1173 | .vfp2, |
| 1174 | 1174 | }), |
| ... | ... | @@ -1177,21 +1177,21 @@ pub const cpu = struct { |
| 1177 | 1177 | .name = "arm1176j_s", |
| 1178 | 1178 | .llvm_name = "arm1176j-s", |
| 1179 | 1179 | .features = featureSet(&[_]Feature{ |
| 1180 | .armv6kz, | |
| 1180 | .v6kz, | |
| 1181 | 1181 | }), |
| 1182 | 1182 | }; |
| 1183 | 1183 | pub const arm1176jz_s = CpuModel{ |
| 1184 | 1184 | .name = "arm1176jz_s", |
| 1185 | 1185 | .llvm_name = "arm1176jz-s", |
| 1186 | 1186 | .features = featureSet(&[_]Feature{ |
| 1187 | .armv6kz, | |
| 1187 | .v6kz, | |
| 1188 | 1188 | }), |
| 1189 | 1189 | }; |
| 1190 | 1190 | pub const arm1176jzf_s = CpuModel{ |
| 1191 | 1191 | .name = "arm1176jzf_s", |
| 1192 | 1192 | .llvm_name = "arm1176jzf-s", |
| 1193 | 1193 | .features = featureSet(&[_]Feature{ |
| 1194 | .armv6kz, | |
| 1194 | .v6kz, | |
| 1195 | 1195 | .slowfpvmlx, |
| 1196 | 1196 | .vfp2, |
| 1197 | 1197 | }), |
| ... | ... | @@ -1200,134 +1200,133 @@ pub const cpu = struct { |
| 1200 | 1200 | .name = "arm710t", |
| 1201 | 1201 | .llvm_name = "arm710t", |
| 1202 | 1202 | .features = featureSet(&[_]Feature{ |
| 1203 | .armv4t, | |
| 1203 | .v4t, | |
| 1204 | 1204 | }), |
| 1205 | 1205 | }; |
| 1206 | 1206 | pub const arm720t = CpuModel{ |
| 1207 | 1207 | .name = "arm720t", |
| 1208 | 1208 | .llvm_name = "arm720t", |
| 1209 | 1209 | .features = featureSet(&[_]Feature{ |
| 1210 | .armv4t, | |
| 1210 | .v4t, | |
| 1211 | 1211 | }), |
| 1212 | 1212 | }; |
| 1213 | 1213 | pub const arm7tdmi = CpuModel{ |
| 1214 | 1214 | .name = "arm7tdmi", |
| 1215 | 1215 | .llvm_name = "arm7tdmi", |
| 1216 | 1216 | .features = featureSet(&[_]Feature{ |
| 1217 | .armv4t, | |
| 1217 | .v4t, | |
| 1218 | 1218 | }), |
| 1219 | 1219 | }; |
| 1220 | 1220 | pub const arm7tdmi_s = CpuModel{ |
| 1221 | 1221 | .name = "arm7tdmi_s", |
| 1222 | 1222 | .llvm_name = "arm7tdmi-s", |
| 1223 | 1223 | .features = featureSet(&[_]Feature{ |
| 1224 | .armv4t, | |
| 1224 | .v4t, | |
| 1225 | 1225 | }), |
| 1226 | 1226 | }; |
| 1227 | 1227 | pub const arm8 = CpuModel{ |
| 1228 | 1228 | .name = "arm8", |
| 1229 | 1229 | .llvm_name = "arm8", |
| 1230 | 1230 | .features = featureSet(&[_]Feature{ |
| 1231 | .armv4, | |
| 1231 | .v4, | |
| 1232 | 1232 | }), |
| 1233 | 1233 | }; |
| 1234 | 1234 | pub const arm810 = CpuModel{ |
| 1235 | 1235 | .name = "arm810", |
| 1236 | 1236 | .llvm_name = "arm810", |
| 1237 | 1237 | .features = featureSet(&[_]Feature{ |
| 1238 | .armv4, | |
| 1238 | .v4, | |
| 1239 | 1239 | }), |
| 1240 | 1240 | }; |
| 1241 | 1241 | pub const arm9 = CpuModel{ |
| 1242 | 1242 | .name = "arm9", |
| 1243 | 1243 | .llvm_name = "arm9", |
| 1244 | 1244 | .features = featureSet(&[_]Feature{ |
| 1245 | .armv4t, | |
| 1245 | .v4t, | |
| 1246 | 1246 | }), |
| 1247 | 1247 | }; |
| 1248 | 1248 | pub const arm920 = CpuModel{ |
| 1249 | 1249 | .name = "arm920", |
| 1250 | 1250 | .llvm_name = "arm920", |
| 1251 | 1251 | .features = featureSet(&[_]Feature{ |
| 1252 | .armv4t, | |
| 1252 | .v4t, | |
| 1253 | 1253 | }), |
| 1254 | 1254 | }; |
| 1255 | 1255 | pub const arm920t = CpuModel{ |
| 1256 | 1256 | .name = "arm920t", |
| 1257 | 1257 | .llvm_name = "arm920t", |
| 1258 | 1258 | .features = featureSet(&[_]Feature{ |
| 1259 | .armv4t, | |
| 1259 | .v4t, | |
| 1260 | 1260 | }), |
| 1261 | 1261 | }; |
| 1262 | 1262 | pub const arm922t = CpuModel{ |
| 1263 | 1263 | .name = "arm922t", |
| 1264 | 1264 | .llvm_name = "arm922t", |
| 1265 | 1265 | .features = featureSet(&[_]Feature{ |
| 1266 | .armv4t, | |
| 1266 | .v4t, | |
| 1267 | 1267 | }), |
| 1268 | 1268 | }; |
| 1269 | 1269 | pub const arm926ej_s = CpuModel{ |
| 1270 | 1270 | .name = "arm926ej_s", |
| 1271 | 1271 | .llvm_name = "arm926ej-s", |
| 1272 | 1272 | .features = featureSet(&[_]Feature{ |
| 1273 | .armv5te, | |
| 1273 | .v5te, | |
| 1274 | 1274 | }), |
| 1275 | 1275 | }; |
| 1276 | 1276 | pub const arm940t = CpuModel{ |
| 1277 | 1277 | .name = "arm940t", |
| 1278 | 1278 | .llvm_name = "arm940t", |
| 1279 | 1279 | .features = featureSet(&[_]Feature{ |
| 1280 | .armv4t, | |
| 1280 | .v4t, | |
| 1281 | 1281 | }), |
| 1282 | 1282 | }; |
| 1283 | 1283 | pub const arm946e_s = CpuModel{ |
| 1284 | 1284 | .name = "arm946e_s", |
| 1285 | 1285 | .llvm_name = "arm946e-s", |
| 1286 | 1286 | .features = featureSet(&[_]Feature{ |
| 1287 | .armv5te, | |
| 1287 | .v5te, | |
| 1288 | 1288 | }), |
| 1289 | 1289 | }; |
| 1290 | 1290 | pub const arm966e_s = CpuModel{ |
| 1291 | 1291 | .name = "arm966e_s", |
| 1292 | 1292 | .llvm_name = "arm966e-s", |
| 1293 | 1293 | .features = featureSet(&[_]Feature{ |
| 1294 | .armv5te, | |
| 1294 | .v5te, | |
| 1295 | 1295 | }), |
| 1296 | 1296 | }; |
| 1297 | 1297 | pub const arm968e_s = CpuModel{ |
| 1298 | 1298 | .name = "arm968e_s", |
| 1299 | 1299 | .llvm_name = "arm968e-s", |
| 1300 | 1300 | .features = featureSet(&[_]Feature{ |
| 1301 | .armv5te, | |
| 1301 | .v5te, | |
| 1302 | 1302 | }), |
| 1303 | 1303 | }; |
| 1304 | 1304 | pub const arm9e = CpuModel{ |
| 1305 | 1305 | .name = "arm9e", |
| 1306 | 1306 | .llvm_name = "arm9e", |
| 1307 | 1307 | .features = featureSet(&[_]Feature{ |
| 1308 | .armv5te, | |
| 1308 | .v5te, | |
| 1309 | 1309 | }), |
| 1310 | 1310 | }; |
| 1311 | 1311 | pub const arm9tdmi = CpuModel{ |
| 1312 | 1312 | .name = "arm9tdmi", |
| 1313 | 1313 | .llvm_name = "arm9tdmi", |
| 1314 | 1314 | .features = featureSet(&[_]Feature{ |
| 1315 | .armv4t, | |
| 1315 | .v4t, | |
| 1316 | 1316 | }), |
| 1317 | 1317 | }; |
| 1318 | 1318 | pub const baseline = CpuModel{ |
| 1319 | 1319 | .name = "baseline", |
| 1320 | 1320 | .llvm_name = "generic", |
| 1321 | 1321 | .features = featureSet(&[_]Feature{ |
| 1322 | .armv6_m, | |
| 1322 | .v6m, | |
| 1323 | 1323 | }), |
| 1324 | 1324 | }; |
| 1325 | 1325 | pub const cortex_a12 = CpuModel{ |
| 1326 | 1326 | .name = "cortex_a12", |
| 1327 | 1327 | .llvm_name = "cortex-a12", |
| 1328 | 1328 | .features = featureSet(&[_]Feature{ |
| 1329 | .a12, | |
| 1330 | .armv7_a, | |
| 1329 | .v7a, | |
| 1331 | 1330 | .avoid_partial_cpsr, |
| 1332 | 1331 | .mp, |
| 1333 | 1332 | .ret_addr_stack, |
| ... | ... | @@ -1341,7 +1340,7 @@ pub const cpu = struct { |
| 1341 | 1340 | .name = "cortex_a15", |
| 1342 | 1341 | .llvm_name = "cortex-a15", |
| 1343 | 1342 | .features = featureSet(&[_]Feature{ |
| 1344 | .armv7_a, | |
| 1343 | .v7a, | |
| 1345 | 1344 | .avoid_partial_cpsr, |
| 1346 | 1345 | .dont_widen_vmovs, |
| 1347 | 1346 | .mp, |
| ... | ... | @@ -1358,7 +1357,7 @@ pub const cpu = struct { |
| 1358 | 1357 | .name = "cortex_a17", |
| 1359 | 1358 | .llvm_name = "cortex-a17", |
| 1360 | 1359 | .features = featureSet(&[_]Feature{ |
| 1361 | .armv7_a, | |
| 1360 | .v7a, | |
| 1362 | 1361 | .avoid_partial_cpsr, |
| 1363 | 1362 | .mp, |
| 1364 | 1363 | .ret_addr_stack, |
| ... | ... | @@ -1372,7 +1371,7 @@ pub const cpu = struct { |
| 1372 | 1371 | .name = "cortex_a32", |
| 1373 | 1372 | .llvm_name = "cortex-a32", |
| 1374 | 1373 | .features = featureSet(&[_]Feature{ |
| 1375 | .armv8_a, | |
| 1374 | .v8a, | |
| 1376 | 1375 | .crc, |
| 1377 | 1376 | .crypto, |
| 1378 | 1377 | .hwdiv, |
| ... | ... | @@ -1383,7 +1382,7 @@ pub const cpu = struct { |
| 1383 | 1382 | .name = "cortex_a35", |
| 1384 | 1383 | .llvm_name = "cortex-a35", |
| 1385 | 1384 | .features = featureSet(&[_]Feature{ |
| 1386 | .armv8_a, | |
| 1385 | .v8a, | |
| 1387 | 1386 | .crc, |
| 1388 | 1387 | .crypto, |
| 1389 | 1388 | .hwdiv, |
| ... | ... | @@ -1394,7 +1393,7 @@ pub const cpu = struct { |
| 1394 | 1393 | .name = "cortex_a5", |
| 1395 | 1394 | .llvm_name = "cortex-a5", |
| 1396 | 1395 | .features = featureSet(&[_]Feature{ |
| 1397 | .armv7_a, | |
| 1396 | .v7a, | |
| 1398 | 1397 | .mp, |
| 1399 | 1398 | .ret_addr_stack, |
| 1400 | 1399 | .slow_fp_brcc, |
| ... | ... | @@ -1408,7 +1407,7 @@ pub const cpu = struct { |
| 1408 | 1407 | .name = "cortex_a53", |
| 1409 | 1408 | .llvm_name = "cortex-a53", |
| 1410 | 1409 | .features = featureSet(&[_]Feature{ |
| 1411 | .armv8_a, | |
| 1410 | .v8a, | |
| 1412 | 1411 | .crc, |
| 1413 | 1412 | .crypto, |
| 1414 | 1413 | .fpao, |
| ... | ... | @@ -1420,7 +1419,7 @@ pub const cpu = struct { |
| 1420 | 1419 | .name = "cortex_a55", |
| 1421 | 1420 | .llvm_name = "cortex-a55", |
| 1422 | 1421 | .features = featureSet(&[_]Feature{ |
| 1423 | .armv8_2_a, | |
| 1422 | .v8_2a, | |
| 1424 | 1423 | .dotprod, |
| 1425 | 1424 | .hwdiv, |
| 1426 | 1425 | .hwdiv_arm, |
| ... | ... | @@ -1430,7 +1429,7 @@ pub const cpu = struct { |
| 1430 | 1429 | .name = "cortex_a57", |
| 1431 | 1430 | .llvm_name = "cortex-a57", |
| 1432 | 1431 | .features = featureSet(&[_]Feature{ |
| 1433 | .armv8_a, | |
| 1432 | .v8a, | |
| 1434 | 1433 | .avoid_partial_cpsr, |
| 1435 | 1434 | .cheap_predicable_cpsr, |
| 1436 | 1435 | .crc, |
| ... | ... | @@ -1444,7 +1443,7 @@ pub const cpu = struct { |
| 1444 | 1443 | .name = "cortex_a7", |
| 1445 | 1444 | .llvm_name = "cortex-a7", |
| 1446 | 1445 | .features = featureSet(&[_]Feature{ |
| 1447 | .armv7_a, | |
| 1446 | .v7a, | |
| 1448 | 1447 | .mp, |
| 1449 | 1448 | .ret_addr_stack, |
| 1450 | 1449 | .slow_fp_brcc, |
| ... | ... | @@ -1460,7 +1459,7 @@ pub const cpu = struct { |
| 1460 | 1459 | .name = "cortex_a72", |
| 1461 | 1460 | .llvm_name = "cortex-a72", |
| 1462 | 1461 | .features = featureSet(&[_]Feature{ |
| 1463 | .armv8_a, | |
| 1462 | .v8a, | |
| 1464 | 1463 | .crc, |
| 1465 | 1464 | .crypto, |
| 1466 | 1465 | .hwdiv, |
| ... | ... | @@ -1471,7 +1470,7 @@ pub const cpu = struct { |
| 1471 | 1470 | .name = "cortex_a73", |
| 1472 | 1471 | .llvm_name = "cortex-a73", |
| 1473 | 1472 | .features = featureSet(&[_]Feature{ |
| 1474 | .armv8_a, | |
| 1473 | .v8a, | |
| 1475 | 1474 | .crc, |
| 1476 | 1475 | .crypto, |
| 1477 | 1476 | .hwdiv, |
| ... | ... | @@ -1482,7 +1481,7 @@ pub const cpu = struct { |
| 1482 | 1481 | .name = "cortex_a75", |
| 1483 | 1482 | .llvm_name = "cortex-a75", |
| 1484 | 1483 | .features = featureSet(&[_]Feature{ |
| 1485 | .armv8_2_a, | |
| 1484 | .v8_2a, | |
| 1486 | 1485 | .dotprod, |
| 1487 | 1486 | .hwdiv, |
| 1488 | 1487 | .hwdiv_arm, |
| ... | ... | @@ -1493,7 +1492,7 @@ pub const cpu = struct { |
| 1493 | 1492 | .llvm_name = "cortex-a76", |
| 1494 | 1493 | .features = featureSet(&[_]Feature{ |
| 1495 | 1494 | .a76, |
| 1496 | .armv8_2_a, | |
| 1495 | .v8_2a, | |
| 1497 | 1496 | .crc, |
| 1498 | 1497 | .crypto, |
| 1499 | 1498 | .dotprod, |
| ... | ... | @@ -1507,7 +1506,7 @@ pub const cpu = struct { |
| 1507 | 1506 | .llvm_name = "cortex-a76ae", |
| 1508 | 1507 | .features = featureSet(&[_]Feature{ |
| 1509 | 1508 | .a76, |
| 1510 | .armv8_2_a, | |
| 1509 | .v8_2a, | |
| 1511 | 1510 | .crc, |
| 1512 | 1511 | .crypto, |
| 1513 | 1512 | .dotprod, |
| ... | ... | @@ -1520,7 +1519,7 @@ pub const cpu = struct { |
| 1520 | 1519 | .name = "cortex_a8", |
| 1521 | 1520 | .llvm_name = "cortex-a8", |
| 1522 | 1521 | .features = featureSet(&[_]Feature{ |
| 1523 | .armv7_a, | |
| 1522 | .v7a, | |
| 1524 | 1523 | .nonpipelined_vfp, |
| 1525 | 1524 | .ret_addr_stack, |
| 1526 | 1525 | .slow_fp_brcc, |
| ... | ... | @@ -1534,7 +1533,7 @@ pub const cpu = struct { |
| 1534 | 1533 | .name = "cortex_a9", |
| 1535 | 1534 | .llvm_name = "cortex-a9", |
| 1536 | 1535 | .features = featureSet(&[_]Feature{ |
| 1537 | .armv7_a, | |
| 1536 | .v7a, | |
| 1538 | 1537 | .avoid_partial_cpsr, |
| 1539 | 1538 | .expand_fp_mlx, |
| 1540 | 1539 | .fp16, |
| ... | ... | @@ -1553,28 +1552,28 @@ pub const cpu = struct { |
| 1553 | 1552 | .name = "cortex_m0", |
| 1554 | 1553 | .llvm_name = "cortex-m0", |
| 1555 | 1554 | .features = featureSet(&[_]Feature{ |
| 1556 | .armv6_m, | |
| 1555 | .v6m, | |
| 1557 | 1556 | }), |
| 1558 | 1557 | }; |
| 1559 | 1558 | pub const cortex_m0plus = CpuModel{ |
| 1560 | 1559 | .name = "cortex_m0plus", |
| 1561 | 1560 | .llvm_name = "cortex-m0plus", |
| 1562 | 1561 | .features = featureSet(&[_]Feature{ |
| 1563 | .armv6_m, | |
| 1562 | .v6m, | |
| 1564 | 1563 | }), |
| 1565 | 1564 | }; |
| 1566 | 1565 | pub const cortex_m1 = CpuModel{ |
| 1567 | 1566 | .name = "cortex_m1", |
| 1568 | 1567 | .llvm_name = "cortex-m1", |
| 1569 | 1568 | .features = featureSet(&[_]Feature{ |
| 1570 | .armv6_m, | |
| 1569 | .v6m, | |
| 1571 | 1570 | }), |
| 1572 | 1571 | }; |
| 1573 | 1572 | pub const cortex_m23 = CpuModel{ |
| 1574 | 1573 | .name = "cortex_m23", |
| 1575 | 1574 | .llvm_name = "cortex-m23", |
| 1576 | 1575 | .features = featureSet(&[_]Feature{ |
| 1577 | .armv8_m_base, | |
| 1576 | .v8m, | |
| 1578 | 1577 | .no_movt, |
| 1579 | 1578 | }), |
| 1580 | 1579 | }; |
| ... | ... | @@ -1582,7 +1581,7 @@ pub const cpu = struct { |
| 1582 | 1581 | .name = "cortex_m3", |
| 1583 | 1582 | .llvm_name = "cortex-m3", |
| 1584 | 1583 | .features = featureSet(&[_]Feature{ |
| 1585 | .armv7_m, | |
| 1584 | .v7m, | |
| 1586 | 1585 | .loop_align, |
| 1587 | 1586 | .m3, |
| 1588 | 1587 | .no_branch_predictor, |
| ... | ... | @@ -1594,7 +1593,7 @@ pub const cpu = struct { |
| 1594 | 1593 | .name = "cortex_m33", |
| 1595 | 1594 | .llvm_name = "cortex-m33", |
| 1596 | 1595 | .features = featureSet(&[_]Feature{ |
| 1597 | .armv8_m_main, | |
| 1596 | .v8m_main, | |
| 1598 | 1597 | .dsp, |
| 1599 | 1598 | .fp_armv8d16sp, |
| 1600 | 1599 | .loop_align, |
| ... | ... | @@ -1608,7 +1607,7 @@ pub const cpu = struct { |
| 1608 | 1607 | .name = "cortex_m35p", |
| 1609 | 1608 | .llvm_name = "cortex-m35p", |
| 1610 | 1609 | .features = featureSet(&[_]Feature{ |
| 1611 | .armv8_m_main, | |
| 1610 | .v8m_main, | |
| 1612 | 1611 | .dsp, |
| 1613 | 1612 | .fp_armv8d16sp, |
| 1614 | 1613 | .loop_align, |
| ... | ... | @@ -1622,7 +1621,7 @@ pub const cpu = struct { |
| 1622 | 1621 | .name = "cortex_m4", |
| 1623 | 1622 | .llvm_name = "cortex-m4", |
| 1624 | 1623 | .features = featureSet(&[_]Feature{ |
| 1625 | .armv7e_m, | |
| 1624 | .v7em, | |
| 1626 | 1625 | .loop_align, |
| 1627 | 1626 | .no_branch_predictor, |
| 1628 | 1627 | .slowfpvmlx, |
| ... | ... | @@ -1635,7 +1634,7 @@ pub const cpu = struct { |
| 1635 | 1634 | .name = "cortex_m7", |
| 1636 | 1635 | .llvm_name = "cortex-m7", |
| 1637 | 1636 | .features = featureSet(&[_]Feature{ |
| 1638 | .armv7e_m, | |
| 1637 | .v7em, | |
| 1639 | 1638 | .fp_armv8d16, |
| 1640 | 1639 | }), |
| 1641 | 1640 | }; |
| ... | ... | @@ -1643,7 +1642,7 @@ pub const cpu = struct { |
| 1643 | 1642 | .name = "cortex_r4", |
| 1644 | 1643 | .llvm_name = "cortex-r4", |
| 1645 | 1644 | .features = featureSet(&[_]Feature{ |
| 1646 | .armv7_r, | |
| 1645 | .v7r, | |
| 1647 | 1646 | .avoid_partial_cpsr, |
| 1648 | 1647 | .r4, |
| 1649 | 1648 | .ret_addr_stack, |
| ... | ... | @@ -1653,7 +1652,7 @@ pub const cpu = struct { |
| 1653 | 1652 | .name = "cortex_r4f", |
| 1654 | 1653 | .llvm_name = "cortex-r4f", |
| 1655 | 1654 | .features = featureSet(&[_]Feature{ |
| 1656 | .armv7_r, | |
| 1655 | .v7r, | |
| 1657 | 1656 | .avoid_partial_cpsr, |
| 1658 | 1657 | .r4, |
| 1659 | 1658 | .ret_addr_stack, |
| ... | ... | @@ -1666,7 +1665,7 @@ pub const cpu = struct { |
| 1666 | 1665 | .name = "cortex_r5", |
| 1667 | 1666 | .llvm_name = "cortex-r5", |
| 1668 | 1667 | .features = featureSet(&[_]Feature{ |
| 1669 | .armv7_r, | |
| 1668 | .v7r, | |
| 1670 | 1669 | .avoid_partial_cpsr, |
| 1671 | 1670 | .hwdiv_arm, |
| 1672 | 1671 | .ret_addr_stack, |
| ... | ... | @@ -1679,7 +1678,7 @@ pub const cpu = struct { |
| 1679 | 1678 | .name = "cortex_r52", |
| 1680 | 1679 | .llvm_name = "cortex-r52", |
| 1681 | 1680 | .features = featureSet(&[_]Feature{ |
| 1682 | .armv8_r, | |
| 1681 | .v8r, | |
| 1683 | 1682 | .fpao, |
| 1684 | 1683 | .use_aa, |
| 1685 | 1684 | .use_misched, |
| ... | ... | @@ -1689,7 +1688,7 @@ pub const cpu = struct { |
| 1689 | 1688 | .name = "cortex_r7", |
| 1690 | 1689 | .llvm_name = "cortex-r7", |
| 1691 | 1690 | .features = featureSet(&[_]Feature{ |
| 1692 | .armv7_r, | |
| 1691 | .v7r, | |
| 1693 | 1692 | .avoid_partial_cpsr, |
| 1694 | 1693 | .fp16, |
| 1695 | 1694 | .hwdiv_arm, |
| ... | ... | @@ -1704,7 +1703,7 @@ pub const cpu = struct { |
| 1704 | 1703 | .name = "cortex_r8", |
| 1705 | 1704 | .llvm_name = "cortex-r8", |
| 1706 | 1705 | .features = featureSet(&[_]Feature{ |
| 1707 | .armv7_r, | |
| 1706 | .v7r, | |
| 1708 | 1707 | .avoid_partial_cpsr, |
| 1709 | 1708 | .fp16, |
| 1710 | 1709 | .hwdiv_arm, |
| ... | ... | @@ -1719,7 +1718,7 @@ pub const cpu = struct { |
| 1719 | 1718 | .name = "cyclone", |
| 1720 | 1719 | .llvm_name = "cyclone", |
| 1721 | 1720 | .features = featureSet(&[_]Feature{ |
| 1722 | .armv8_a, | |
| 1721 | .v8a, | |
| 1723 | 1722 | .avoid_movs_shop, |
| 1724 | 1723 | .avoid_partial_cpsr, |
| 1725 | 1724 | .crypto, |
| ... | ... | @@ -1740,14 +1739,14 @@ pub const cpu = struct { |
| 1740 | 1739 | .name = "ep9312", |
| 1741 | 1740 | .llvm_name = "ep9312", |
| 1742 | 1741 | .features = featureSet(&[_]Feature{ |
| 1743 | .armv4t, | |
| 1742 | .v4t, | |
| 1744 | 1743 | }), |
| 1745 | 1744 | }; |
| 1746 | 1745 | pub const exynos_m1 = CpuModel{ |
| 1747 | 1746 | .name = "exynos_m1", |
| 1748 | 1747 | .llvm_name = "exynos-m1", |
| 1749 | 1748 | .features = featureSet(&[_]Feature{ |
| 1750 | .armv8_a, | |
| 1749 | .v8a, | |
| 1751 | 1750 | .exynos, |
| 1752 | 1751 | }), |
| 1753 | 1752 | }; |
| ... | ... | @@ -1755,7 +1754,7 @@ pub const cpu = struct { |
| 1755 | 1754 | .name = "exynos_m2", |
| 1756 | 1755 | .llvm_name = "exynos-m2", |
| 1757 | 1756 | .features = featureSet(&[_]Feature{ |
| 1758 | .armv8_a, | |
| 1757 | .v8a, | |
| 1759 | 1758 | .exynos, |
| 1760 | 1759 | }), |
| 1761 | 1760 | }; |
| ... | ... | @@ -1763,7 +1762,7 @@ pub const cpu = struct { |
| 1763 | 1762 | .name = "exynos_m3", |
| 1764 | 1763 | .llvm_name = "exynos-m3", |
| 1765 | 1764 | .features = featureSet(&[_]Feature{ |
| 1766 | .armv8_a, | |
| 1765 | .v8a, | |
| 1767 | 1766 | .exynos, |
| 1768 | 1767 | }), |
| 1769 | 1768 | }; |
| ... | ... | @@ -1771,7 +1770,7 @@ pub const cpu = struct { |
| 1771 | 1770 | .name = "exynos_m4", |
| 1772 | 1771 | .llvm_name = "exynos-m4", |
| 1773 | 1772 | .features = featureSet(&[_]Feature{ |
| 1774 | .armv8_2_a, | |
| 1773 | .v8_2a, | |
| 1775 | 1774 | .dotprod, |
| 1776 | 1775 | .exynos, |
| 1777 | 1776 | .fullfp16, |
| ... | ... | @@ -1781,10 +1780,10 @@ pub const cpu = struct { |
| 1781 | 1780 | .name = "exynos_m5", |
| 1782 | 1781 | .llvm_name = "exynos-m5", |
| 1783 | 1782 | .features = featureSet(&[_]Feature{ |
| 1784 | .armv8_2_a, | |
| 1785 | 1783 | .dotprod, |
| 1786 | 1784 | .exynos, |
| 1787 | 1785 | .fullfp16, |
| 1786 | .v8_2a, | |
| 1788 | 1787 | }), |
| 1789 | 1788 | }; |
| 1790 | 1789 | pub const generic = CpuModel{ |
| ... | ... | @@ -1796,20 +1795,20 @@ pub const cpu = struct { |
| 1796 | 1795 | .name = "iwmmxt", |
| 1797 | 1796 | .llvm_name = "iwmmxt", |
| 1798 | 1797 | .features = featureSet(&[_]Feature{ |
| 1799 | .armv5te, | |
| 1798 | .v5te, | |
| 1800 | 1799 | }), |
| 1801 | 1800 | }; |
| 1802 | 1801 | pub const krait = CpuModel{ |
| 1803 | 1802 | .name = "krait", |
| 1804 | 1803 | .llvm_name = "krait", |
| 1805 | 1804 | .features = featureSet(&[_]Feature{ |
| 1806 | .armv7_a, | |
| 1807 | 1805 | .avoid_partial_cpsr, |
| 1808 | 1806 | .fp16, |
| 1809 | 1807 | .hwdiv, |
| 1810 | 1808 | .hwdiv_arm, |
| 1811 | 1809 | .muxed_units, |
| 1812 | 1810 | .ret_addr_stack, |
| 1811 | .v7a, | |
| 1813 | 1812 | .vfp4, |
| 1814 | 1813 | .vldn_align, |
| 1815 | 1814 | .vmlx_forwarding, |
| ... | ... | @@ -1819,19 +1818,18 @@ pub const cpu = struct { |
| 1819 | 1818 | .name = "kryo", |
| 1820 | 1819 | .llvm_name = "kryo", |
| 1821 | 1820 | .features = featureSet(&[_]Feature{ |
| 1822 | .armv8_a, | |
| 1823 | 1821 | .crc, |
| 1824 | 1822 | .crypto, |
| 1825 | 1823 | .hwdiv, |
| 1826 | 1824 | .hwdiv_arm, |
| 1827 | .kryo, | |
| 1825 | .v8a, | |
| 1828 | 1826 | }), |
| 1829 | 1827 | }; |
| 1830 | 1828 | pub const mpcore = CpuModel{ |
| 1831 | 1829 | .name = "mpcore", |
| 1832 | 1830 | .llvm_name = "mpcore", |
| 1833 | 1831 | .features = featureSet(&[_]Feature{ |
| 1834 | .armv6k, | |
| 1832 | .v6k, | |
| 1835 | 1833 | .slowfpvmlx, |
| 1836 | 1834 | .vfp2, |
| 1837 | 1835 | }), |
| ... | ... | @@ -1840,21 +1838,21 @@ pub const cpu = struct { |
| 1840 | 1838 | .name = "mpcorenovfp", |
| 1841 | 1839 | .llvm_name = "mpcorenovfp", |
| 1842 | 1840 | .features = featureSet(&[_]Feature{ |
| 1843 | .armv6k, | |
| 1841 | .v6k, | |
| 1844 | 1842 | }), |
| 1845 | 1843 | }; |
| 1846 | 1844 | pub const sc000 = CpuModel{ |
| 1847 | 1845 | .name = "sc000", |
| 1848 | 1846 | .llvm_name = "sc000", |
| 1849 | 1847 | .features = featureSet(&[_]Feature{ |
| 1850 | .armv6_m, | |
| 1848 | .v6m, | |
| 1851 | 1849 | }), |
| 1852 | 1850 | }; |
| 1853 | 1851 | pub const sc300 = CpuModel{ |
| 1854 | 1852 | .name = "sc300", |
| 1855 | 1853 | .llvm_name = "sc300", |
| 1856 | 1854 | .features = featureSet(&[_]Feature{ |
| 1857 | .armv7_m, | |
| 1855 | .v7m, | |
| 1858 | 1856 | .m3, |
| 1859 | 1857 | .no_branch_predictor, |
| 1860 | 1858 | .use_aa, |
| ... | ... | @@ -1865,35 +1863,35 @@ pub const cpu = struct { |
| 1865 | 1863 | .name = "strongarm", |
| 1866 | 1864 | .llvm_name = "strongarm", |
| 1867 | 1865 | .features = featureSet(&[_]Feature{ |
| 1868 | .armv4, | |
| 1866 | .v4, | |
| 1869 | 1867 | }), |
| 1870 | 1868 | }; |
| 1871 | 1869 | pub const strongarm110 = CpuModel{ |
| 1872 | 1870 | .name = "strongarm110", |
| 1873 | 1871 | .llvm_name = "strongarm110", |
| 1874 | 1872 | .features = featureSet(&[_]Feature{ |
| 1875 | .armv4, | |
| 1873 | .v4, | |
| 1876 | 1874 | }), |
| 1877 | 1875 | }; |
| 1878 | 1876 | pub const strongarm1100 = CpuModel{ |
| 1879 | 1877 | .name = "strongarm1100", |
| 1880 | 1878 | .llvm_name = "strongarm1100", |
| 1881 | 1879 | .features = featureSet(&[_]Feature{ |
| 1882 | .armv4, | |
| 1880 | .v4, | |
| 1883 | 1881 | }), |
| 1884 | 1882 | }; |
| 1885 | 1883 | pub const strongarm1110 = CpuModel{ |
| 1886 | 1884 | .name = "strongarm1110", |
| 1887 | 1885 | .llvm_name = "strongarm1110", |
| 1888 | 1886 | .features = featureSet(&[_]Feature{ |
| 1889 | .armv4, | |
| 1887 | .v4, | |
| 1890 | 1888 | }), |
| 1891 | 1889 | }; |
| 1892 | 1890 | pub const swift = CpuModel{ |
| 1893 | 1891 | .name = "swift", |
| 1894 | 1892 | .llvm_name = "swift", |
| 1895 | 1893 | .features = featureSet(&[_]Feature{ |
| 1896 | .armv7_a, | |
| 1894 | .v7a, | |
| 1897 | 1895 | .avoid_movs_shop, |
| 1898 | 1896 | .avoid_partial_cpsr, |
| 1899 | 1897 | .disable_postra_scheduler, |
| ... | ... | @@ -1920,7 +1918,7 @@ pub const cpu = struct { |
| 1920 | 1918 | .name = "xscale", |
| 1921 | 1919 | .llvm_name = "xscale", |
| 1922 | 1920 | .features = featureSet(&[_]Feature{ |
| 1923 | .armv5te, | |
| 1921 | .v5te, | |
| 1924 | 1922 | }), |
| 1925 | 1923 | }; |
| 1926 | 1924 | }; |
lib/std/target/avr.zig+263-262| ... | ... | @@ -1,5 +1,6 @@ |
| 1 | 1 | const std = @import("../std.zig"); |
| 2 | const Cpu = std.Target.Cpu; | |
| 2 | const CpuFeature = std.Target.Cpu.Feature; | |
| 3 | const CpuModel = std.Target.Cpu.Model; | |
| 3 | 4 | |
| 4 | 5 | pub const Feature = enum { |
| 5 | 6 | addsubiw, |
| ... | ... | @@ -37,12 +38,12 @@ pub const Feature = enum { |
| 37 | 38 | xmegau, |
| 38 | 39 | }; |
| 39 | 40 | |
| 40 | pub usingnamespace Cpu.Feature.feature_set_fns(Feature); | |
| 41 | pub usingnamespace CpuFeature.feature_set_fns(Feature); | |
| 41 | 42 | |
| 42 | 43 | pub const all_features = blk: { |
| 43 | 44 | const len = @typeInfo(Feature).Enum.fields.len; |
| 44 | std.debug.assert(len <= Cpu.Feature.Set.needed_bit_count); | |
| 45 | var result: [len]Cpu.Feature = undefined; | |
| 45 | std.debug.assert(len <= CpuFeature.Set.needed_bit_count); | |
| 46 | var result: [len]CpuFeature = undefined; | |
| 46 | 47 | result[@enumToInt(Feature.addsubiw)] = .{ |
| 47 | 48 | .llvm_name = "addsubiw", |
| 48 | 49 | .description = "Enable 16-bit register-immediate addition and subtraction instructions", |
| ... | ... | @@ -293,28 +294,28 @@ pub const all_features = blk: { |
| 293 | 294 | }; |
| 294 | 295 | |
| 295 | 296 | pub const cpu = struct { |
| 296 | pub const at43usb320 = Cpu{ | |
| 297 | pub const at43usb320 = CpuModel{ | |
| 297 | 298 | .name = "at43usb320", |
| 298 | 299 | .llvm_name = "at43usb320", |
| 299 | 300 | .features = featureSet(&[_]Feature{ |
| 300 | 301 | .avr31, |
| 301 | 302 | }), |
| 302 | 303 | }; |
| 303 | pub const at43usb355 = Cpu{ | |
| 304 | pub const at43usb355 = CpuModel{ | |
| 304 | 305 | .name = "at43usb355", |
| 305 | 306 | .llvm_name = "at43usb355", |
| 306 | 307 | .features = featureSet(&[_]Feature{ |
| 307 | 308 | .avr3, |
| 308 | 309 | }), |
| 309 | 310 | }; |
| 310 | pub const at76c711 = Cpu{ | |
| 311 | pub const at76c711 = CpuModel{ | |
| 311 | 312 | .name = "at76c711", |
| 312 | 313 | .llvm_name = "at76c711", |
| 313 | 314 | .features = featureSet(&[_]Feature{ |
| 314 | 315 | .avr3, |
| 315 | 316 | }), |
| 316 | 317 | }; |
| 317 | pub const at86rf401 = Cpu{ | |
| 318 | pub const at86rf401 = CpuModel{ | |
| 318 | 319 | .name = "at86rf401", |
| 319 | 320 | .llvm_name = "at86rf401", |
| 320 | 321 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -323,217 +324,217 @@ pub const cpu = struct { |
| 323 | 324 | .movw, |
| 324 | 325 | }), |
| 325 | 326 | }; |
| 326 | pub const at90c8534 = Cpu{ | |
| 327 | pub const at90c8534 = CpuModel{ | |
| 327 | 328 | .name = "at90c8534", |
| 328 | 329 | .llvm_name = "at90c8534", |
| 329 | 330 | .features = featureSet(&[_]Feature{ |
| 330 | 331 | .avr2, |
| 331 | 332 | }), |
| 332 | 333 | }; |
| 333 | pub const at90can128 = Cpu{ | |
| 334 | pub const at90can128 = CpuModel{ | |
| 334 | 335 | .name = "at90can128", |
| 335 | 336 | .llvm_name = "at90can128", |
| 336 | 337 | .features = featureSet(&[_]Feature{ |
| 337 | 338 | .avr51, |
| 338 | 339 | }), |
| 339 | 340 | }; |
| 340 | pub const at90can32 = Cpu{ | |
| 341 | pub const at90can32 = CpuModel{ | |
| 341 | 342 | .name = "at90can32", |
| 342 | 343 | .llvm_name = "at90can32", |
| 343 | 344 | .features = featureSet(&[_]Feature{ |
| 344 | 345 | .avr5, |
| 345 | 346 | }), |
| 346 | 347 | }; |
| 347 | pub const at90can64 = Cpu{ | |
| 348 | pub const at90can64 = CpuModel{ | |
| 348 | 349 | .name = "at90can64", |
| 349 | 350 | .llvm_name = "at90can64", |
| 350 | 351 | .features = featureSet(&[_]Feature{ |
| 351 | 352 | .avr5, |
| 352 | 353 | }), |
| 353 | 354 | }; |
| 354 | pub const at90pwm1 = Cpu{ | |
| 355 | pub const at90pwm1 = CpuModel{ | |
| 355 | 356 | .name = "at90pwm1", |
| 356 | 357 | .llvm_name = "at90pwm1", |
| 357 | 358 | .features = featureSet(&[_]Feature{ |
| 358 | 359 | .avr4, |
| 359 | 360 | }), |
| 360 | 361 | }; |
| 361 | pub const at90pwm161 = Cpu{ | |
| 362 | pub const at90pwm161 = CpuModel{ | |
| 362 | 363 | .name = "at90pwm161", |
| 363 | 364 | .llvm_name = "at90pwm161", |
| 364 | 365 | .features = featureSet(&[_]Feature{ |
| 365 | 366 | .avr5, |
| 366 | 367 | }), |
| 367 | 368 | }; |
| 368 | pub const at90pwm2 = Cpu{ | |
| 369 | pub const at90pwm2 = CpuModel{ | |
| 369 | 370 | .name = "at90pwm2", |
| 370 | 371 | .llvm_name = "at90pwm2", |
| 371 | 372 | .features = featureSet(&[_]Feature{ |
| 372 | 373 | .avr4, |
| 373 | 374 | }), |
| 374 | 375 | }; |
| 375 | pub const at90pwm216 = Cpu{ | |
| 376 | pub const at90pwm216 = CpuModel{ | |
| 376 | 377 | .name = "at90pwm216", |
| 377 | 378 | .llvm_name = "at90pwm216", |
| 378 | 379 | .features = featureSet(&[_]Feature{ |
| 379 | 380 | .avr5, |
| 380 | 381 | }), |
| 381 | 382 | }; |
| 382 | pub const at90pwm2b = Cpu{ | |
| 383 | pub const at90pwm2b = CpuModel{ | |
| 383 | 384 | .name = "at90pwm2b", |
| 384 | 385 | .llvm_name = "at90pwm2b", |
| 385 | 386 | .features = featureSet(&[_]Feature{ |
| 386 | 387 | .avr4, |
| 387 | 388 | }), |
| 388 | 389 | }; |
| 389 | pub const at90pwm3 = Cpu{ | |
| 390 | pub const at90pwm3 = CpuModel{ | |
| 390 | 391 | .name = "at90pwm3", |
| 391 | 392 | .llvm_name = "at90pwm3", |
| 392 | 393 | .features = featureSet(&[_]Feature{ |
| 393 | 394 | .avr4, |
| 394 | 395 | }), |
| 395 | 396 | }; |
| 396 | pub const at90pwm316 = Cpu{ | |
| 397 | pub const at90pwm316 = CpuModel{ | |
| 397 | 398 | .name = "at90pwm316", |
| 398 | 399 | .llvm_name = "at90pwm316", |
| 399 | 400 | .features = featureSet(&[_]Feature{ |
| 400 | 401 | .avr5, |
| 401 | 402 | }), |
| 402 | 403 | }; |
| 403 | pub const at90pwm3b = Cpu{ | |
| 404 | pub const at90pwm3b = CpuModel{ | |
| 404 | 405 | .name = "at90pwm3b", |
| 405 | 406 | .llvm_name = "at90pwm3b", |
| 406 | 407 | .features = featureSet(&[_]Feature{ |
| 407 | 408 | .avr4, |
| 408 | 409 | }), |
| 409 | 410 | }; |
| 410 | pub const at90pwm81 = Cpu{ | |
| 411 | pub const at90pwm81 = CpuModel{ | |
| 411 | 412 | .name = "at90pwm81", |
| 412 | 413 | .llvm_name = "at90pwm81", |
| 413 | 414 | .features = featureSet(&[_]Feature{ |
| 414 | 415 | .avr4, |
| 415 | 416 | }), |
| 416 | 417 | }; |
| 417 | pub const at90s1200 = Cpu{ | |
| 418 | pub const at90s1200 = CpuModel{ | |
| 418 | 419 | .name = "at90s1200", |
| 419 | 420 | .llvm_name = "at90s1200", |
| 420 | 421 | .features = featureSet(&[_]Feature{ |
| 421 | 422 | .avr0, |
| 422 | 423 | }), |
| 423 | 424 | }; |
| 424 | pub const at90s2313 = Cpu{ | |
| 425 | pub const at90s2313 = CpuModel{ | |
| 425 | 426 | .name = "at90s2313", |
| 426 | 427 | .llvm_name = "at90s2313", |
| 427 | 428 | .features = featureSet(&[_]Feature{ |
| 428 | 429 | .avr2, |
| 429 | 430 | }), |
| 430 | 431 | }; |
| 431 | pub const at90s2323 = Cpu{ | |
| 432 | pub const at90s2323 = CpuModel{ | |
| 432 | 433 | .name = "at90s2323", |
| 433 | 434 | .llvm_name = "at90s2323", |
| 434 | 435 | .features = featureSet(&[_]Feature{ |
| 435 | 436 | .avr2, |
| 436 | 437 | }), |
| 437 | 438 | }; |
| 438 | pub const at90s2333 = Cpu{ | |
| 439 | pub const at90s2333 = CpuModel{ | |
| 439 | 440 | .name = "at90s2333", |
| 440 | 441 | .llvm_name = "at90s2333", |
| 441 | 442 | .features = featureSet(&[_]Feature{ |
| 442 | 443 | .avr2, |
| 443 | 444 | }), |
| 444 | 445 | }; |
| 445 | pub const at90s2343 = Cpu{ | |
| 446 | pub const at90s2343 = CpuModel{ | |
| 446 | 447 | .name = "at90s2343", |
| 447 | 448 | .llvm_name = "at90s2343", |
| 448 | 449 | .features = featureSet(&[_]Feature{ |
| 449 | 450 | .avr2, |
| 450 | 451 | }), |
| 451 | 452 | }; |
| 452 | pub const at90s4414 = Cpu{ | |
| 453 | pub const at90s4414 = CpuModel{ | |
| 453 | 454 | .name = "at90s4414", |
| 454 | 455 | .llvm_name = "at90s4414", |
| 455 | 456 | .features = featureSet(&[_]Feature{ |
| 456 | 457 | .avr2, |
| 457 | 458 | }), |
| 458 | 459 | }; |
| 459 | pub const at90s4433 = Cpu{ | |
| 460 | pub const at90s4433 = CpuModel{ | |
| 460 | 461 | .name = "at90s4433", |
| 461 | 462 | .llvm_name = "at90s4433", |
| 462 | 463 | .features = featureSet(&[_]Feature{ |
| 463 | 464 | .avr2, |
| 464 | 465 | }), |
| 465 | 466 | }; |
| 466 | pub const at90s4434 = Cpu{ | |
| 467 | pub const at90s4434 = CpuModel{ | |
| 467 | 468 | .name = "at90s4434", |
| 468 | 469 | .llvm_name = "at90s4434", |
| 469 | 470 | .features = featureSet(&[_]Feature{ |
| 470 | 471 | .avr2, |
| 471 | 472 | }), |
| 472 | 473 | }; |
| 473 | pub const at90s8515 = Cpu{ | |
| 474 | pub const at90s8515 = CpuModel{ | |
| 474 | 475 | .name = "at90s8515", |
| 475 | 476 | .llvm_name = "at90s8515", |
| 476 | 477 | .features = featureSet(&[_]Feature{ |
| 477 | 478 | .avr2, |
| 478 | 479 | }), |
| 479 | 480 | }; |
| 480 | pub const at90s8535 = Cpu{ | |
| 481 | pub const at90s8535 = CpuModel{ | |
| 481 | 482 | .name = "at90s8535", |
| 482 | 483 | .llvm_name = "at90s8535", |
| 483 | 484 | .features = featureSet(&[_]Feature{ |
| 484 | 485 | .avr2, |
| 485 | 486 | }), |
| 486 | 487 | }; |
| 487 | pub const at90scr100 = Cpu{ | |
| 488 | pub const at90scr100 = CpuModel{ | |
| 488 | 489 | .name = "at90scr100", |
| 489 | 490 | .llvm_name = "at90scr100", |
| 490 | 491 | .features = featureSet(&[_]Feature{ |
| 491 | 492 | .avr5, |
| 492 | 493 | }), |
| 493 | 494 | }; |
| 494 | pub const at90usb1286 = Cpu{ | |
| 495 | pub const at90usb1286 = CpuModel{ | |
| 495 | 496 | .name = "at90usb1286", |
| 496 | 497 | .llvm_name = "at90usb1286", |
| 497 | 498 | .features = featureSet(&[_]Feature{ |
| 498 | 499 | .avr51, |
| 499 | 500 | }), |
| 500 | 501 | }; |
| 501 | pub const at90usb1287 = Cpu{ | |
| 502 | pub const at90usb1287 = CpuModel{ | |
| 502 | 503 | .name = "at90usb1287", |
| 503 | 504 | .llvm_name = "at90usb1287", |
| 504 | 505 | .features = featureSet(&[_]Feature{ |
| 505 | 506 | .avr51, |
| 506 | 507 | }), |
| 507 | 508 | }; |
| 508 | pub const at90usb162 = Cpu{ | |
| 509 | pub const at90usb162 = CpuModel{ | |
| 509 | 510 | .name = "at90usb162", |
| 510 | 511 | .llvm_name = "at90usb162", |
| 511 | 512 | .features = featureSet(&[_]Feature{ |
| 512 | 513 | .avr35, |
| 513 | 514 | }), |
| 514 | 515 | }; |
| 515 | pub const at90usb646 = Cpu{ | |
| 516 | pub const at90usb646 = CpuModel{ | |
| 516 | 517 | .name = "at90usb646", |
| 517 | 518 | .llvm_name = "at90usb646", |
| 518 | 519 | .features = featureSet(&[_]Feature{ |
| 519 | 520 | .avr5, |
| 520 | 521 | }), |
| 521 | 522 | }; |
| 522 | pub const at90usb647 = Cpu{ | |
| 523 | pub const at90usb647 = CpuModel{ | |
| 523 | 524 | .name = "at90usb647", |
| 524 | 525 | .llvm_name = "at90usb647", |
| 525 | 526 | .features = featureSet(&[_]Feature{ |
| 526 | 527 | .avr5, |
| 527 | 528 | }), |
| 528 | 529 | }; |
| 529 | pub const at90usb82 = Cpu{ | |
| 530 | pub const at90usb82 = CpuModel{ | |
| 530 | 531 | .name = "at90usb82", |
| 531 | 532 | .llvm_name = "at90usb82", |
| 532 | 533 | .features = featureSet(&[_]Feature{ |
| 533 | 534 | .avr35, |
| 534 | 535 | }), |
| 535 | 536 | }; |
| 536 | pub const at94k = Cpu{ | |
| 537 | pub const at94k = CpuModel{ | |
| 537 | 538 | .name = "at94k", |
| 538 | 539 | .llvm_name = "at94k", |
| 539 | 540 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -543,133 +544,133 @@ pub const cpu = struct { |
| 543 | 544 | .mul, |
| 544 | 545 | }), |
| 545 | 546 | }; |
| 546 | pub const ata5272 = Cpu{ | |
| 547 | pub const ata5272 = CpuModel{ | |
| 547 | 548 | .name = "ata5272", |
| 548 | 549 | .llvm_name = "ata5272", |
| 549 | 550 | .features = featureSet(&[_]Feature{ |
| 550 | 551 | .avr25, |
| 551 | 552 | }), |
| 552 | 553 | }; |
| 553 | pub const ata5505 = Cpu{ | |
| 554 | pub const ata5505 = CpuModel{ | |
| 554 | 555 | .name = "ata5505", |
| 555 | 556 | .llvm_name = "ata5505", |
| 556 | 557 | .features = featureSet(&[_]Feature{ |
| 557 | 558 | .avr35, |
| 558 | 559 | }), |
| 559 | 560 | }; |
| 560 | pub const ata5790 = Cpu{ | |
| 561 | pub const ata5790 = CpuModel{ | |
| 561 | 562 | .name = "ata5790", |
| 562 | 563 | .llvm_name = "ata5790", |
| 563 | 564 | .features = featureSet(&[_]Feature{ |
| 564 | 565 | .avr5, |
| 565 | 566 | }), |
| 566 | 567 | }; |
| 567 | pub const ata5795 = Cpu{ | |
| 568 | pub const ata5795 = CpuModel{ | |
| 568 | 569 | .name = "ata5795", |
| 569 | 570 | .llvm_name = "ata5795", |
| 570 | 571 | .features = featureSet(&[_]Feature{ |
| 571 | 572 | .avr5, |
| 572 | 573 | }), |
| 573 | 574 | }; |
| 574 | pub const ata6285 = Cpu{ | |
| 575 | pub const ata6285 = CpuModel{ | |
| 575 | 576 | .name = "ata6285", |
| 576 | 577 | .llvm_name = "ata6285", |
| 577 | 578 | .features = featureSet(&[_]Feature{ |
| 578 | 579 | .avr4, |
| 579 | 580 | }), |
| 580 | 581 | }; |
| 581 | pub const ata6286 = Cpu{ | |
| 582 | pub const ata6286 = CpuModel{ | |
| 582 | 583 | .name = "ata6286", |
| 583 | 584 | .llvm_name = "ata6286", |
| 584 | 585 | .features = featureSet(&[_]Feature{ |
| 585 | 586 | .avr4, |
| 586 | 587 | }), |
| 587 | 588 | }; |
| 588 | pub const ata6289 = Cpu{ | |
| 589 | pub const ata6289 = CpuModel{ | |
| 589 | 590 | .name = "ata6289", |
| 590 | 591 | .llvm_name = "ata6289", |
| 591 | 592 | .features = featureSet(&[_]Feature{ |
| 592 | 593 | .avr4, |
| 593 | 594 | }), |
| 594 | 595 | }; |
| 595 | pub const atmega103 = Cpu{ | |
| 596 | pub const atmega103 = CpuModel{ | |
| 596 | 597 | .name = "atmega103", |
| 597 | 598 | .llvm_name = "atmega103", |
| 598 | 599 | .features = featureSet(&[_]Feature{ |
| 599 | 600 | .avr31, |
| 600 | 601 | }), |
| 601 | 602 | }; |
| 602 | pub const atmega128 = Cpu{ | |
| 603 | pub const atmega128 = CpuModel{ | |
| 603 | 604 | .name = "atmega128", |
| 604 | 605 | .llvm_name = "atmega128", |
| 605 | 606 | .features = featureSet(&[_]Feature{ |
| 606 | 607 | .avr51, |
| 607 | 608 | }), |
| 608 | 609 | }; |
| 609 | pub const atmega1280 = Cpu{ | |
| 610 | pub const atmega1280 = CpuModel{ | |
| 610 | 611 | .name = "atmega1280", |
| 611 | 612 | .llvm_name = "atmega1280", |
| 612 | 613 | .features = featureSet(&[_]Feature{ |
| 613 | 614 | .avr51, |
| 614 | 615 | }), |
| 615 | 616 | }; |
| 616 | pub const atmega1281 = Cpu{ | |
| 617 | pub const atmega1281 = CpuModel{ | |
| 617 | 618 | .name = "atmega1281", |
| 618 | 619 | .llvm_name = "atmega1281", |
| 619 | 620 | .features = featureSet(&[_]Feature{ |
| 620 | 621 | .avr51, |
| 621 | 622 | }), |
| 622 | 623 | }; |
| 623 | pub const atmega1284 = Cpu{ | |
| 624 | pub const atmega1284 = CpuModel{ | |
| 624 | 625 | .name = "atmega1284", |
| 625 | 626 | .llvm_name = "atmega1284", |
| 626 | 627 | .features = featureSet(&[_]Feature{ |
| 627 | 628 | .avr51, |
| 628 | 629 | }), |
| 629 | 630 | }; |
| 630 | pub const atmega1284p = Cpu{ | |
| 631 | pub const atmega1284p = CpuModel{ | |
| 631 | 632 | .name = "atmega1284p", |
| 632 | 633 | .llvm_name = "atmega1284p", |
| 633 | 634 | .features = featureSet(&[_]Feature{ |
| 634 | 635 | .avr51, |
| 635 | 636 | }), |
| 636 | 637 | }; |
| 637 | pub const atmega1284rfr2 = Cpu{ | |
| 638 | pub const atmega1284rfr2 = CpuModel{ | |
| 638 | 639 | .name = "atmega1284rfr2", |
| 639 | 640 | .llvm_name = "atmega1284rfr2", |
| 640 | 641 | .features = featureSet(&[_]Feature{ |
| 641 | 642 | .avr51, |
| 642 | 643 | }), |
| 643 | 644 | }; |
| 644 | pub const atmega128a = Cpu{ | |
| 645 | pub const atmega128a = CpuModel{ | |
| 645 | 646 | .name = "atmega128a", |
| 646 | 647 | .llvm_name = "atmega128a", |
| 647 | 648 | .features = featureSet(&[_]Feature{ |
| 648 | 649 | .avr51, |
| 649 | 650 | }), |
| 650 | 651 | }; |
| 651 | pub const atmega128rfa1 = Cpu{ | |
| 652 | pub const atmega128rfa1 = CpuModel{ | |
| 652 | 653 | .name = "atmega128rfa1", |
| 653 | 654 | .llvm_name = "atmega128rfa1", |
| 654 | 655 | .features = featureSet(&[_]Feature{ |
| 655 | 656 | .avr51, |
| 656 | 657 | }), |
| 657 | 658 | }; |
| 658 | pub const atmega128rfr2 = Cpu{ | |
| 659 | pub const atmega128rfr2 = CpuModel{ | |
| 659 | 660 | .name = "atmega128rfr2", |
| 660 | 661 | .llvm_name = "atmega128rfr2", |
| 661 | 662 | .features = featureSet(&[_]Feature{ |
| 662 | 663 | .avr51, |
| 663 | 664 | }), |
| 664 | 665 | }; |
| 665 | pub const atmega16 = Cpu{ | |
| 666 | pub const atmega16 = CpuModel{ | |
| 666 | 667 | .name = "atmega16", |
| 667 | 668 | .llvm_name = "atmega16", |
| 668 | 669 | .features = featureSet(&[_]Feature{ |
| 669 | 670 | .avr5, |
| 670 | 671 | }), |
| 671 | 672 | }; |
| 672 | pub const atmega161 = Cpu{ | |
| 673 | pub const atmega161 = CpuModel{ | |
| 673 | 674 | .name = "atmega161", |
| 674 | 675 | .llvm_name = "atmega161", |
| 675 | 676 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -680,14 +681,14 @@ pub const cpu = struct { |
| 680 | 681 | .spm, |
| 681 | 682 | }), |
| 682 | 683 | }; |
| 683 | pub const atmega162 = Cpu{ | |
| 684 | pub const atmega162 = CpuModel{ | |
| 684 | 685 | .name = "atmega162", |
| 685 | 686 | .llvm_name = "atmega162", |
| 686 | 687 | .features = featureSet(&[_]Feature{ |
| 687 | 688 | .avr5, |
| 688 | 689 | }), |
| 689 | 690 | }; |
| 690 | pub const atmega163 = Cpu{ | |
| 691 | pub const atmega163 = CpuModel{ | |
| 691 | 692 | .name = "atmega163", |
| 692 | 693 | .llvm_name = "atmega163", |
| 693 | 694 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -698,623 +699,623 @@ pub const cpu = struct { |
| 698 | 699 | .spm, |
| 699 | 700 | }), |
| 700 | 701 | }; |
| 701 | pub const atmega164a = Cpu{ | |
| 702 | pub const atmega164a = CpuModel{ | |
| 702 | 703 | .name = "atmega164a", |
| 703 | 704 | .llvm_name = "atmega164a", |
| 704 | 705 | .features = featureSet(&[_]Feature{ |
| 705 | 706 | .avr5, |
| 706 | 707 | }), |
| 707 | 708 | }; |
| 708 | pub const atmega164p = Cpu{ | |
| 709 | pub const atmega164p = CpuModel{ | |
| 709 | 710 | .name = "atmega164p", |
| 710 | 711 | .llvm_name = "atmega164p", |
| 711 | 712 | .features = featureSet(&[_]Feature{ |
| 712 | 713 | .avr5, |
| 713 | 714 | }), |
| 714 | 715 | }; |
| 715 | pub const atmega164pa = Cpu{ | |
| 716 | pub const atmega164pa = CpuModel{ | |
| 716 | 717 | .name = "atmega164pa", |
| 717 | 718 | .llvm_name = "atmega164pa", |
| 718 | 719 | .features = featureSet(&[_]Feature{ |
| 719 | 720 | .avr5, |
| 720 | 721 | }), |
| 721 | 722 | }; |
| 722 | pub const atmega165 = Cpu{ | |
| 723 | pub const atmega165 = CpuModel{ | |
| 723 | 724 | .name = "atmega165", |
| 724 | 725 | .llvm_name = "atmega165", |
| 725 | 726 | .features = featureSet(&[_]Feature{ |
| 726 | 727 | .avr5, |
| 727 | 728 | }), |
| 728 | 729 | }; |
| 729 | pub const atmega165a = Cpu{ | |
| 730 | pub const atmega165a = CpuModel{ | |
| 730 | 731 | .name = "atmega165a", |
| 731 | 732 | .llvm_name = "atmega165a", |
| 732 | 733 | .features = featureSet(&[_]Feature{ |
| 733 | 734 | .avr5, |
| 734 | 735 | }), |
| 735 | 736 | }; |
| 736 | pub const atmega165p = Cpu{ | |
| 737 | pub const atmega165p = CpuModel{ | |
| 737 | 738 | .name = "atmega165p", |
| 738 | 739 | .llvm_name = "atmega165p", |
| 739 | 740 | .features = featureSet(&[_]Feature{ |
| 740 | 741 | .avr5, |
| 741 | 742 | }), |
| 742 | 743 | }; |
| 743 | pub const atmega165pa = Cpu{ | |
| 744 | pub const atmega165pa = CpuModel{ | |
| 744 | 745 | .name = "atmega165pa", |
| 745 | 746 | .llvm_name = "atmega165pa", |
| 746 | 747 | .features = featureSet(&[_]Feature{ |
| 747 | 748 | .avr5, |
| 748 | 749 | }), |
| 749 | 750 | }; |
| 750 | pub const atmega168 = Cpu{ | |
| 751 | pub const atmega168 = CpuModel{ | |
| 751 | 752 | .name = "atmega168", |
| 752 | 753 | .llvm_name = "atmega168", |
| 753 | 754 | .features = featureSet(&[_]Feature{ |
| 754 | 755 | .avr5, |
| 755 | 756 | }), |
| 756 | 757 | }; |
| 757 | pub const atmega168a = Cpu{ | |
| 758 | pub const atmega168a = CpuModel{ | |
| 758 | 759 | .name = "atmega168a", |
| 759 | 760 | .llvm_name = "atmega168a", |
| 760 | 761 | .features = featureSet(&[_]Feature{ |
| 761 | 762 | .avr5, |
| 762 | 763 | }), |
| 763 | 764 | }; |
| 764 | pub const atmega168p = Cpu{ | |
| 765 | pub const atmega168p = CpuModel{ | |
| 765 | 766 | .name = "atmega168p", |
| 766 | 767 | .llvm_name = "atmega168p", |
| 767 | 768 | .features = featureSet(&[_]Feature{ |
| 768 | 769 | .avr5, |
| 769 | 770 | }), |
| 770 | 771 | }; |
| 771 | pub const atmega168pa = Cpu{ | |
| 772 | pub const atmega168pa = CpuModel{ | |
| 772 | 773 | .name = "atmega168pa", |
| 773 | 774 | .llvm_name = "atmega168pa", |
| 774 | 775 | .features = featureSet(&[_]Feature{ |
| 775 | 776 | .avr5, |
| 776 | 777 | }), |
| 777 | 778 | }; |
| 778 | pub const atmega169 = Cpu{ | |
| 779 | pub const atmega169 = CpuModel{ | |
| 779 | 780 | .name = "atmega169", |
| 780 | 781 | .llvm_name = "atmega169", |
| 781 | 782 | .features = featureSet(&[_]Feature{ |
| 782 | 783 | .avr5, |
| 783 | 784 | }), |
| 784 | 785 | }; |
| 785 | pub const atmega169a = Cpu{ | |
| 786 | pub const atmega169a = CpuModel{ | |
| 786 | 787 | .name = "atmega169a", |
| 787 | 788 | .llvm_name = "atmega169a", |
| 788 | 789 | .features = featureSet(&[_]Feature{ |
| 789 | 790 | .avr5, |
| 790 | 791 | }), |
| 791 | 792 | }; |
| 792 | pub const atmega169p = Cpu{ | |
| 793 | pub const atmega169p = CpuModel{ | |
| 793 | 794 | .name = "atmega169p", |
| 794 | 795 | .llvm_name = "atmega169p", |
| 795 | 796 | .features = featureSet(&[_]Feature{ |
| 796 | 797 | .avr5, |
| 797 | 798 | }), |
| 798 | 799 | }; |
| 799 | pub const atmega169pa = Cpu{ | |
| 800 | pub const atmega169pa = CpuModel{ | |
| 800 | 801 | .name = "atmega169pa", |
| 801 | 802 | .llvm_name = "atmega169pa", |
| 802 | 803 | .features = featureSet(&[_]Feature{ |
| 803 | 804 | .avr5, |
| 804 | 805 | }), |
| 805 | 806 | }; |
| 806 | pub const atmega16a = Cpu{ | |
| 807 | pub const atmega16a = CpuModel{ | |
| 807 | 808 | .name = "atmega16a", |
| 808 | 809 | .llvm_name = "atmega16a", |
| 809 | 810 | .features = featureSet(&[_]Feature{ |
| 810 | 811 | .avr5, |
| 811 | 812 | }), |
| 812 | 813 | }; |
| 813 | pub const atmega16hva = Cpu{ | |
| 814 | pub const atmega16hva = CpuModel{ | |
| 814 | 815 | .name = "atmega16hva", |
| 815 | 816 | .llvm_name = "atmega16hva", |
| 816 | 817 | .features = featureSet(&[_]Feature{ |
| 817 | 818 | .avr5, |
| 818 | 819 | }), |
| 819 | 820 | }; |
| 820 | pub const atmega16hva2 = Cpu{ | |
| 821 | pub const atmega16hva2 = CpuModel{ | |
| 821 | 822 | .name = "atmega16hva2", |
| 822 | 823 | .llvm_name = "atmega16hva2", |
| 823 | 824 | .features = featureSet(&[_]Feature{ |
| 824 | 825 | .avr5, |
| 825 | 826 | }), |
| 826 | 827 | }; |
| 827 | pub const atmega16hvb = Cpu{ | |
| 828 | pub const atmega16hvb = CpuModel{ | |
| 828 | 829 | .name = "atmega16hvb", |
| 829 | 830 | .llvm_name = "atmega16hvb", |
| 830 | 831 | .features = featureSet(&[_]Feature{ |
| 831 | 832 | .avr5, |
| 832 | 833 | }), |
| 833 | 834 | }; |
| 834 | pub const atmega16hvbrevb = Cpu{ | |
| 835 | pub const atmega16hvbrevb = CpuModel{ | |
| 835 | 836 | .name = "atmega16hvbrevb", |
| 836 | 837 | .llvm_name = "atmega16hvbrevb", |
| 837 | 838 | .features = featureSet(&[_]Feature{ |
| 838 | 839 | .avr5, |
| 839 | 840 | }), |
| 840 | 841 | }; |
| 841 | pub const atmega16m1 = Cpu{ | |
| 842 | pub const atmega16m1 = CpuModel{ | |
| 842 | 843 | .name = "atmega16m1", |
| 843 | 844 | .llvm_name = "atmega16m1", |
| 844 | 845 | .features = featureSet(&[_]Feature{ |
| 845 | 846 | .avr5, |
| 846 | 847 | }), |
| 847 | 848 | }; |
| 848 | pub const atmega16u2 = Cpu{ | |
| 849 | pub const atmega16u2 = CpuModel{ | |
| 849 | 850 | .name = "atmega16u2", |
| 850 | 851 | .llvm_name = "atmega16u2", |
| 851 | 852 | .features = featureSet(&[_]Feature{ |
| 852 | 853 | .avr35, |
| 853 | 854 | }), |
| 854 | 855 | }; |
| 855 | pub const atmega16u4 = Cpu{ | |
| 856 | pub const atmega16u4 = CpuModel{ | |
| 856 | 857 | .name = "atmega16u4", |
| 857 | 858 | .llvm_name = "atmega16u4", |
| 858 | 859 | .features = featureSet(&[_]Feature{ |
| 859 | 860 | .avr5, |
| 860 | 861 | }), |
| 861 | 862 | }; |
| 862 | pub const atmega2560 = Cpu{ | |
| 863 | pub const atmega2560 = CpuModel{ | |
| 863 | 864 | .name = "atmega2560", |
| 864 | 865 | .llvm_name = "atmega2560", |
| 865 | 866 | .features = featureSet(&[_]Feature{ |
| 866 | 867 | .avr6, |
| 867 | 868 | }), |
| 868 | 869 | }; |
| 869 | pub const atmega2561 = Cpu{ | |
| 870 | pub const atmega2561 = CpuModel{ | |
| 870 | 871 | .name = "atmega2561", |
| 871 | 872 | .llvm_name = "atmega2561", |
| 872 | 873 | .features = featureSet(&[_]Feature{ |
| 873 | 874 | .avr6, |
| 874 | 875 | }), |
| 875 | 876 | }; |
| 876 | pub const atmega2564rfr2 = Cpu{ | |
| 877 | pub const atmega2564rfr2 = CpuModel{ | |
| 877 | 878 | .name = "atmega2564rfr2", |
| 878 | 879 | .llvm_name = "atmega2564rfr2", |
| 879 | 880 | .features = featureSet(&[_]Feature{ |
| 880 | 881 | .avr6, |
| 881 | 882 | }), |
| 882 | 883 | }; |
| 883 | pub const atmega256rfr2 = Cpu{ | |
| 884 | pub const atmega256rfr2 = CpuModel{ | |
| 884 | 885 | .name = "atmega256rfr2", |
| 885 | 886 | .llvm_name = "atmega256rfr2", |
| 886 | 887 | .features = featureSet(&[_]Feature{ |
| 887 | 888 | .avr6, |
| 888 | 889 | }), |
| 889 | 890 | }; |
| 890 | pub const atmega32 = Cpu{ | |
| 891 | pub const atmega32 = CpuModel{ | |
| 891 | 892 | .name = "atmega32", |
| 892 | 893 | .llvm_name = "atmega32", |
| 893 | 894 | .features = featureSet(&[_]Feature{ |
| 894 | 895 | .avr5, |
| 895 | 896 | }), |
| 896 | 897 | }; |
| 897 | pub const atmega323 = Cpu{ | |
| 898 | pub const atmega323 = CpuModel{ | |
| 898 | 899 | .name = "atmega323", |
| 899 | 900 | .llvm_name = "atmega323", |
| 900 | 901 | .features = featureSet(&[_]Feature{ |
| 901 | 902 | .avr5, |
| 902 | 903 | }), |
| 903 | 904 | }; |
| 904 | pub const atmega324a = Cpu{ | |
| 905 | pub const atmega324a = CpuModel{ | |
| 905 | 906 | .name = "atmega324a", |
| 906 | 907 | .llvm_name = "atmega324a", |
| 907 | 908 | .features = featureSet(&[_]Feature{ |
| 908 | 909 | .avr5, |
| 909 | 910 | }), |
| 910 | 911 | }; |
| 911 | pub const atmega324p = Cpu{ | |
| 912 | pub const atmega324p = CpuModel{ | |
| 912 | 913 | .name = "atmega324p", |
| 913 | 914 | .llvm_name = "atmega324p", |
| 914 | 915 | .features = featureSet(&[_]Feature{ |
| 915 | 916 | .avr5, |
| 916 | 917 | }), |
| 917 | 918 | }; |
| 918 | pub const atmega324pa = Cpu{ | |
| 919 | pub const atmega324pa = CpuModel{ | |
| 919 | 920 | .name = "atmega324pa", |
| 920 | 921 | .llvm_name = "atmega324pa", |
| 921 | 922 | .features = featureSet(&[_]Feature{ |
| 922 | 923 | .avr5, |
| 923 | 924 | }), |
| 924 | 925 | }; |
| 925 | pub const atmega325 = Cpu{ | |
| 926 | pub const atmega325 = CpuModel{ | |
| 926 | 927 | .name = "atmega325", |
| 927 | 928 | .llvm_name = "atmega325", |
| 928 | 929 | .features = featureSet(&[_]Feature{ |
| 929 | 930 | .avr5, |
| 930 | 931 | }), |
| 931 | 932 | }; |
| 932 | pub const atmega3250 = Cpu{ | |
| 933 | pub const atmega3250 = CpuModel{ | |
| 933 | 934 | .name = "atmega3250", |
| 934 | 935 | .llvm_name = "atmega3250", |
| 935 | 936 | .features = featureSet(&[_]Feature{ |
| 936 | 937 | .avr5, |
| 937 | 938 | }), |
| 938 | 939 | }; |
| 939 | pub const atmega3250a = Cpu{ | |
| 940 | pub const atmega3250a = CpuModel{ | |
| 940 | 941 | .name = "atmega3250a", |
| 941 | 942 | .llvm_name = "atmega3250a", |
| 942 | 943 | .features = featureSet(&[_]Feature{ |
| 943 | 944 | .avr5, |
| 944 | 945 | }), |
| 945 | 946 | }; |
| 946 | pub const atmega3250p = Cpu{ | |
| 947 | pub const atmega3250p = CpuModel{ | |
| 947 | 948 | .name = "atmega3250p", |
| 948 | 949 | .llvm_name = "atmega3250p", |
| 949 | 950 | .features = featureSet(&[_]Feature{ |
| 950 | 951 | .avr5, |
| 951 | 952 | }), |
| 952 | 953 | }; |
| 953 | pub const atmega3250pa = Cpu{ | |
| 954 | pub const atmega3250pa = CpuModel{ | |
| 954 | 955 | .name = "atmega3250pa", |
| 955 | 956 | .llvm_name = "atmega3250pa", |
| 956 | 957 | .features = featureSet(&[_]Feature{ |
| 957 | 958 | .avr5, |
| 958 | 959 | }), |
| 959 | 960 | }; |
| 960 | pub const atmega325a = Cpu{ | |
| 961 | pub const atmega325a = CpuModel{ | |
| 961 | 962 | .name = "atmega325a", |
| 962 | 963 | .llvm_name = "atmega325a", |
| 963 | 964 | .features = featureSet(&[_]Feature{ |
| 964 | 965 | .avr5, |
| 965 | 966 | }), |
| 966 | 967 | }; |
| 967 | pub const atmega325p = Cpu{ | |
| 968 | pub const atmega325p = CpuModel{ | |
| 968 | 969 | .name = "atmega325p", |
| 969 | 970 | .llvm_name = "atmega325p", |
| 970 | 971 | .features = featureSet(&[_]Feature{ |
| 971 | 972 | .avr5, |
| 972 | 973 | }), |
| 973 | 974 | }; |
| 974 | pub const atmega325pa = Cpu{ | |
| 975 | pub const atmega325pa = CpuModel{ | |
| 975 | 976 | .name = "atmega325pa", |
| 976 | 977 | .llvm_name = "atmega325pa", |
| 977 | 978 | .features = featureSet(&[_]Feature{ |
| 978 | 979 | .avr5, |
| 979 | 980 | }), |
| 980 | 981 | }; |
| 981 | pub const atmega328 = Cpu{ | |
| 982 | pub const atmega328 = CpuModel{ | |
| 982 | 983 | .name = "atmega328", |
| 983 | 984 | .llvm_name = "atmega328", |
| 984 | 985 | .features = featureSet(&[_]Feature{ |
| 985 | 986 | .avr5, |
| 986 | 987 | }), |
| 987 | 988 | }; |
| 988 | pub const atmega328p = Cpu{ | |
| 989 | pub const atmega328p = CpuModel{ | |
| 989 | 990 | .name = "atmega328p", |
| 990 | 991 | .llvm_name = "atmega328p", |
| 991 | 992 | .features = featureSet(&[_]Feature{ |
| 992 | 993 | .avr5, |
| 993 | 994 | }), |
| 994 | 995 | }; |
| 995 | pub const atmega329 = Cpu{ | |
| 996 | pub const atmega329 = CpuModel{ | |
| 996 | 997 | .name = "atmega329", |
| 997 | 998 | .llvm_name = "atmega329", |
| 998 | 999 | .features = featureSet(&[_]Feature{ |
| 999 | 1000 | .avr5, |
| 1000 | 1001 | }), |
| 1001 | 1002 | }; |
| 1002 | pub const atmega3290 = Cpu{ | |
| 1003 | pub const atmega3290 = CpuModel{ | |
| 1003 | 1004 | .name = "atmega3290", |
| 1004 | 1005 | .llvm_name = "atmega3290", |
| 1005 | 1006 | .features = featureSet(&[_]Feature{ |
| 1006 | 1007 | .avr5, |
| 1007 | 1008 | }), |
| 1008 | 1009 | }; |
| 1009 | pub const atmega3290a = Cpu{ | |
| 1010 | pub const atmega3290a = CpuModel{ | |
| 1010 | 1011 | .name = "atmega3290a", |
| 1011 | 1012 | .llvm_name = "atmega3290a", |
| 1012 | 1013 | .features = featureSet(&[_]Feature{ |
| 1013 | 1014 | .avr5, |
| 1014 | 1015 | }), |
| 1015 | 1016 | }; |
| 1016 | pub const atmega3290p = Cpu{ | |
| 1017 | pub const atmega3290p = CpuModel{ | |
| 1017 | 1018 | .name = "atmega3290p", |
| 1018 | 1019 | .llvm_name = "atmega3290p", |
| 1019 | 1020 | .features = featureSet(&[_]Feature{ |
| 1020 | 1021 | .avr5, |
| 1021 | 1022 | }), |
| 1022 | 1023 | }; |
| 1023 | pub const atmega3290pa = Cpu{ | |
| 1024 | pub const atmega3290pa = CpuModel{ | |
| 1024 | 1025 | .name = "atmega3290pa", |
| 1025 | 1026 | .llvm_name = "atmega3290pa", |
| 1026 | 1027 | .features = featureSet(&[_]Feature{ |
| 1027 | 1028 | .avr5, |
| 1028 | 1029 | }), |
| 1029 | 1030 | }; |
| 1030 | pub const atmega329a = Cpu{ | |
| 1031 | pub const atmega329a = CpuModel{ | |
| 1031 | 1032 | .name = "atmega329a", |
| 1032 | 1033 | .llvm_name = "atmega329a", |
| 1033 | 1034 | .features = featureSet(&[_]Feature{ |
| 1034 | 1035 | .avr5, |
| 1035 | 1036 | }), |
| 1036 | 1037 | }; |
| 1037 | pub const atmega329p = Cpu{ | |
| 1038 | pub const atmega329p = CpuModel{ | |
| 1038 | 1039 | .name = "atmega329p", |
| 1039 | 1040 | .llvm_name = "atmega329p", |
| 1040 | 1041 | .features = featureSet(&[_]Feature{ |
| 1041 | 1042 | .avr5, |
| 1042 | 1043 | }), |
| 1043 | 1044 | }; |
| 1044 | pub const atmega329pa = Cpu{ | |
| 1045 | pub const atmega329pa = CpuModel{ | |
| 1045 | 1046 | .name = "atmega329pa", |
| 1046 | 1047 | .llvm_name = "atmega329pa", |
| 1047 | 1048 | .features = featureSet(&[_]Feature{ |
| 1048 | 1049 | .avr5, |
| 1049 | 1050 | }), |
| 1050 | 1051 | }; |
| 1051 | pub const atmega32a = Cpu{ | |
| 1052 | pub const atmega32a = CpuModel{ | |
| 1052 | 1053 | .name = "atmega32a", |
| 1053 | 1054 | .llvm_name = "atmega32a", |
| 1054 | 1055 | .features = featureSet(&[_]Feature{ |
| 1055 | 1056 | .avr5, |
| 1056 | 1057 | }), |
| 1057 | 1058 | }; |
| 1058 | pub const atmega32c1 = Cpu{ | |
| 1059 | pub const atmega32c1 = CpuModel{ | |
| 1059 | 1060 | .name = "atmega32c1", |
| 1060 | 1061 | .llvm_name = "atmega32c1", |
| 1061 | 1062 | .features = featureSet(&[_]Feature{ |
| 1062 | 1063 | .avr5, |
| 1063 | 1064 | }), |
| 1064 | 1065 | }; |
| 1065 | pub const atmega32hvb = Cpu{ | |
| 1066 | pub const atmega32hvb = CpuModel{ | |
| 1066 | 1067 | .name = "atmega32hvb", |
| 1067 | 1068 | .llvm_name = "atmega32hvb", |
| 1068 | 1069 | .features = featureSet(&[_]Feature{ |
| 1069 | 1070 | .avr5, |
| 1070 | 1071 | }), |
| 1071 | 1072 | }; |
| 1072 | pub const atmega32hvbrevb = Cpu{ | |
| 1073 | pub const atmega32hvbrevb = CpuModel{ | |
| 1073 | 1074 | .name = "atmega32hvbrevb", |
| 1074 | 1075 | .llvm_name = "atmega32hvbrevb", |
| 1075 | 1076 | .features = featureSet(&[_]Feature{ |
| 1076 | 1077 | .avr5, |
| 1077 | 1078 | }), |
| 1078 | 1079 | }; |
| 1079 | pub const atmega32m1 = Cpu{ | |
| 1080 | pub const atmega32m1 = CpuModel{ | |
| 1080 | 1081 | .name = "atmega32m1", |
| 1081 | 1082 | .llvm_name = "atmega32m1", |
| 1082 | 1083 | .features = featureSet(&[_]Feature{ |
| 1083 | 1084 | .avr5, |
| 1084 | 1085 | }), |
| 1085 | 1086 | }; |
| 1086 | pub const atmega32u2 = Cpu{ | |
| 1087 | pub const atmega32u2 = CpuModel{ | |
| 1087 | 1088 | .name = "atmega32u2", |
| 1088 | 1089 | .llvm_name = "atmega32u2", |
| 1089 | 1090 | .features = featureSet(&[_]Feature{ |
| 1090 | 1091 | .avr35, |
| 1091 | 1092 | }), |
| 1092 | 1093 | }; |
| 1093 | pub const atmega32u4 = Cpu{ | |
| 1094 | pub const atmega32u4 = CpuModel{ | |
| 1094 | 1095 | .name = "atmega32u4", |
| 1095 | 1096 | .llvm_name = "atmega32u4", |
| 1096 | 1097 | .features = featureSet(&[_]Feature{ |
| 1097 | 1098 | .avr5, |
| 1098 | 1099 | }), |
| 1099 | 1100 | }; |
| 1100 | pub const atmega32u6 = Cpu{ | |
| 1101 | pub const atmega32u6 = CpuModel{ | |
| 1101 | 1102 | .name = "atmega32u6", |
| 1102 | 1103 | .llvm_name = "atmega32u6", |
| 1103 | 1104 | .features = featureSet(&[_]Feature{ |
| 1104 | 1105 | .avr5, |
| 1105 | 1106 | }), |
| 1106 | 1107 | }; |
| 1107 | pub const atmega406 = Cpu{ | |
| 1108 | pub const atmega406 = CpuModel{ | |
| 1108 | 1109 | .name = "atmega406", |
| 1109 | 1110 | .llvm_name = "atmega406", |
| 1110 | 1111 | .features = featureSet(&[_]Feature{ |
| 1111 | 1112 | .avr5, |
| 1112 | 1113 | }), |
| 1113 | 1114 | }; |
| 1114 | pub const atmega48 = Cpu{ | |
| 1115 | pub const atmega48 = CpuModel{ | |
| 1115 | 1116 | .name = "atmega48", |
| 1116 | 1117 | .llvm_name = "atmega48", |
| 1117 | 1118 | .features = featureSet(&[_]Feature{ |
| 1118 | 1119 | .avr4, |
| 1119 | 1120 | }), |
| 1120 | 1121 | }; |
| 1121 | pub const atmega48a = Cpu{ | |
| 1122 | pub const atmega48a = CpuModel{ | |
| 1122 | 1123 | .name = "atmega48a", |
| 1123 | 1124 | .llvm_name = "atmega48a", |
| 1124 | 1125 | .features = featureSet(&[_]Feature{ |
| 1125 | 1126 | .avr4, |
| 1126 | 1127 | }), |
| 1127 | 1128 | }; |
| 1128 | pub const atmega48p = Cpu{ | |
| 1129 | pub const atmega48p = CpuModel{ | |
| 1129 | 1130 | .name = "atmega48p", |
| 1130 | 1131 | .llvm_name = "atmega48p", |
| 1131 | 1132 | .features = featureSet(&[_]Feature{ |
| 1132 | 1133 | .avr4, |
| 1133 | 1134 | }), |
| 1134 | 1135 | }; |
| 1135 | pub const atmega48pa = Cpu{ | |
| 1136 | pub const atmega48pa = CpuModel{ | |
| 1136 | 1137 | .name = "atmega48pa", |
| 1137 | 1138 | .llvm_name = "atmega48pa", |
| 1138 | 1139 | .features = featureSet(&[_]Feature{ |
| 1139 | 1140 | .avr4, |
| 1140 | 1141 | }), |
| 1141 | 1142 | }; |
| 1142 | pub const atmega64 = Cpu{ | |
| 1143 | pub const atmega64 = CpuModel{ | |
| 1143 | 1144 | .name = "atmega64", |
| 1144 | 1145 | .llvm_name = "atmega64", |
| 1145 | 1146 | .features = featureSet(&[_]Feature{ |
| 1146 | 1147 | .avr5, |
| 1147 | 1148 | }), |
| 1148 | 1149 | }; |
| 1149 | pub const atmega640 = Cpu{ | |
| 1150 | pub const atmega640 = CpuModel{ | |
| 1150 | 1151 | .name = "atmega640", |
| 1151 | 1152 | .llvm_name = "atmega640", |
| 1152 | 1153 | .features = featureSet(&[_]Feature{ |
| 1153 | 1154 | .avr5, |
| 1154 | 1155 | }), |
| 1155 | 1156 | }; |
| 1156 | pub const atmega644 = Cpu{ | |
| 1157 | pub const atmega644 = CpuModel{ | |
| 1157 | 1158 | .name = "atmega644", |
| 1158 | 1159 | .llvm_name = "atmega644", |
| 1159 | 1160 | .features = featureSet(&[_]Feature{ |
| 1160 | 1161 | .avr5, |
| 1161 | 1162 | }), |
| 1162 | 1163 | }; |
| 1163 | pub const atmega644a = Cpu{ | |
| 1164 | pub const atmega644a = CpuModel{ | |
| 1164 | 1165 | .name = "atmega644a", |
| 1165 | 1166 | .llvm_name = "atmega644a", |
| 1166 | 1167 | .features = featureSet(&[_]Feature{ |
| 1167 | 1168 | .avr5, |
| 1168 | 1169 | }), |
| 1169 | 1170 | }; |
| 1170 | pub const atmega644p = Cpu{ | |
| 1171 | pub const atmega644p = CpuModel{ | |
| 1171 | 1172 | .name = "atmega644p", |
| 1172 | 1173 | .llvm_name = "atmega644p", |
| 1173 | 1174 | .features = featureSet(&[_]Feature{ |
| 1174 | 1175 | .avr5, |
| 1175 | 1176 | }), |
| 1176 | 1177 | }; |
| 1177 | pub const atmega644pa = Cpu{ | |
| 1178 | pub const atmega644pa = CpuModel{ | |
| 1178 | 1179 | .name = "atmega644pa", |
| 1179 | 1180 | .llvm_name = "atmega644pa", |
| 1180 | 1181 | .features = featureSet(&[_]Feature{ |
| 1181 | 1182 | .avr5, |
| 1182 | 1183 | }), |
| 1183 | 1184 | }; |
| 1184 | pub const atmega644rfr2 = Cpu{ | |
| 1185 | pub const atmega644rfr2 = CpuModel{ | |
| 1185 | 1186 | .name = "atmega644rfr2", |
| 1186 | 1187 | .llvm_name = "atmega644rfr2", |
| 1187 | 1188 | .features = featureSet(&[_]Feature{ |
| 1188 | 1189 | .avr5, |
| 1189 | 1190 | }), |
| 1190 | 1191 | }; |
| 1191 | pub const atmega645 = Cpu{ | |
| 1192 | pub const atmega645 = CpuModel{ | |
| 1192 | 1193 | .name = "atmega645", |
| 1193 | 1194 | .llvm_name = "atmega645", |
| 1194 | 1195 | .features = featureSet(&[_]Feature{ |
| 1195 | 1196 | .avr5, |
| 1196 | 1197 | }), |
| 1197 | 1198 | }; |
| 1198 | pub const atmega6450 = Cpu{ | |
| 1199 | pub const atmega6450 = CpuModel{ | |
| 1199 | 1200 | .name = "atmega6450", |
| 1200 | 1201 | .llvm_name = "atmega6450", |
| 1201 | 1202 | .features = featureSet(&[_]Feature{ |
| 1202 | 1203 | .avr5, |
| 1203 | 1204 | }), |
| 1204 | 1205 | }; |
| 1205 | pub const atmega6450a = Cpu{ | |
| 1206 | pub const atmega6450a = CpuModel{ | |
| 1206 | 1207 | .name = "atmega6450a", |
| 1207 | 1208 | .llvm_name = "atmega6450a", |
| 1208 | 1209 | .features = featureSet(&[_]Feature{ |
| 1209 | 1210 | .avr5, |
| 1210 | 1211 | }), |
| 1211 | 1212 | }; |
| 1212 | pub const atmega6450p = Cpu{ | |
| 1213 | pub const atmega6450p = CpuModel{ | |
| 1213 | 1214 | .name = "atmega6450p", |
| 1214 | 1215 | .llvm_name = "atmega6450p", |
| 1215 | 1216 | .features = featureSet(&[_]Feature{ |
| 1216 | 1217 | .avr5, |
| 1217 | 1218 | }), |
| 1218 | 1219 | }; |
| 1219 | pub const atmega645a = Cpu{ | |
| 1220 | pub const atmega645a = CpuModel{ | |
| 1220 | 1221 | .name = "atmega645a", |
| 1221 | 1222 | .llvm_name = "atmega645a", |
| 1222 | 1223 | .features = featureSet(&[_]Feature{ |
| 1223 | 1224 | .avr5, |
| 1224 | 1225 | }), |
| 1225 | 1226 | }; |
| 1226 | pub const atmega645p = Cpu{ | |
| 1227 | pub const atmega645p = CpuModel{ | |
| 1227 | 1228 | .name = "atmega645p", |
| 1228 | 1229 | .llvm_name = "atmega645p", |
| 1229 | 1230 | .features = featureSet(&[_]Feature{ |
| 1230 | 1231 | .avr5, |
| 1231 | 1232 | }), |
| 1232 | 1233 | }; |
| 1233 | pub const atmega649 = Cpu{ | |
| 1234 | pub const atmega649 = CpuModel{ | |
| 1234 | 1235 | .name = "atmega649", |
| 1235 | 1236 | .llvm_name = "atmega649", |
| 1236 | 1237 | .features = featureSet(&[_]Feature{ |
| 1237 | 1238 | .avr5, |
| 1238 | 1239 | }), |
| 1239 | 1240 | }; |
| 1240 | pub const atmega6490 = Cpu{ | |
| 1241 | pub const atmega6490 = CpuModel{ | |
| 1241 | 1242 | .name = "atmega6490", |
| 1242 | 1243 | .llvm_name = "atmega6490", |
| 1243 | 1244 | .features = featureSet(&[_]Feature{ |
| 1244 | 1245 | .avr5, |
| 1245 | 1246 | }), |
| 1246 | 1247 | }; |
| 1247 | pub const atmega6490a = Cpu{ | |
| 1248 | pub const atmega6490a = CpuModel{ | |
| 1248 | 1249 | .name = "atmega6490a", |
| 1249 | 1250 | .llvm_name = "atmega6490a", |
| 1250 | 1251 | .features = featureSet(&[_]Feature{ |
| 1251 | 1252 | .avr5, |
| 1252 | 1253 | }), |
| 1253 | 1254 | }; |
| 1254 | pub const atmega6490p = Cpu{ | |
| 1255 | pub const atmega6490p = CpuModel{ | |
| 1255 | 1256 | .name = "atmega6490p", |
| 1256 | 1257 | .llvm_name = "atmega6490p", |
| 1257 | 1258 | .features = featureSet(&[_]Feature{ |
| 1258 | 1259 | .avr5, |
| 1259 | 1260 | }), |
| 1260 | 1261 | }; |
| 1261 | pub const atmega649a = Cpu{ | |
| 1262 | pub const atmega649a = CpuModel{ | |
| 1262 | 1263 | .name = "atmega649a", |
| 1263 | 1264 | .llvm_name = "atmega649a", |
| 1264 | 1265 | .features = featureSet(&[_]Feature{ |
| 1265 | 1266 | .avr5, |
| 1266 | 1267 | }), |
| 1267 | 1268 | }; |
| 1268 | pub const atmega649p = Cpu{ | |
| 1269 | pub const atmega649p = CpuModel{ | |
| 1269 | 1270 | .name = "atmega649p", |
| 1270 | 1271 | .llvm_name = "atmega649p", |
| 1271 | 1272 | .features = featureSet(&[_]Feature{ |
| 1272 | 1273 | .avr5, |
| 1273 | 1274 | }), |
| 1274 | 1275 | }; |
| 1275 | pub const atmega64a = Cpu{ | |
| 1276 | pub const atmega64a = CpuModel{ | |
| 1276 | 1277 | .name = "atmega64a", |
| 1277 | 1278 | .llvm_name = "atmega64a", |
| 1278 | 1279 | .features = featureSet(&[_]Feature{ |
| 1279 | 1280 | .avr5, |
| 1280 | 1281 | }), |
| 1281 | 1282 | }; |
| 1282 | pub const atmega64c1 = Cpu{ | |
| 1283 | pub const atmega64c1 = CpuModel{ | |
| 1283 | 1284 | .name = "atmega64c1", |
| 1284 | 1285 | .llvm_name = "atmega64c1", |
| 1285 | 1286 | .features = featureSet(&[_]Feature{ |
| 1286 | 1287 | .avr5, |
| 1287 | 1288 | }), |
| 1288 | 1289 | }; |
| 1289 | pub const atmega64hve = Cpu{ | |
| 1290 | pub const atmega64hve = CpuModel{ | |
| 1290 | 1291 | .name = "atmega64hve", |
| 1291 | 1292 | .llvm_name = "atmega64hve", |
| 1292 | 1293 | .features = featureSet(&[_]Feature{ |
| 1293 | 1294 | .avr5, |
| 1294 | 1295 | }), |
| 1295 | 1296 | }; |
| 1296 | pub const atmega64m1 = Cpu{ | |
| 1297 | pub const atmega64m1 = CpuModel{ | |
| 1297 | 1298 | .name = "atmega64m1", |
| 1298 | 1299 | .llvm_name = "atmega64m1", |
| 1299 | 1300 | .features = featureSet(&[_]Feature{ |
| 1300 | 1301 | .avr5, |
| 1301 | 1302 | }), |
| 1302 | 1303 | }; |
| 1303 | pub const atmega64rfr2 = Cpu{ | |
| 1304 | pub const atmega64rfr2 = CpuModel{ | |
| 1304 | 1305 | .name = "atmega64rfr2", |
| 1305 | 1306 | .llvm_name = "atmega64rfr2", |
| 1306 | 1307 | .features = featureSet(&[_]Feature{ |
| 1307 | 1308 | .avr5, |
| 1308 | 1309 | }), |
| 1309 | 1310 | }; |
| 1310 | pub const atmega8 = Cpu{ | |
| 1311 | pub const atmega8 = CpuModel{ | |
| 1311 | 1312 | .name = "atmega8", |
| 1312 | 1313 | .llvm_name = "atmega8", |
| 1313 | 1314 | .features = featureSet(&[_]Feature{ |
| 1314 | 1315 | .avr4, |
| 1315 | 1316 | }), |
| 1316 | 1317 | }; |
| 1317 | pub const atmega8515 = Cpu{ | |
| 1318 | pub const atmega8515 = CpuModel{ | |
| 1318 | 1319 | .name = "atmega8515", |
| 1319 | 1320 | .llvm_name = "atmega8515", |
| 1320 | 1321 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1325,7 +1326,7 @@ pub const cpu = struct { |
| 1325 | 1326 | .spm, |
| 1326 | 1327 | }), |
| 1327 | 1328 | }; |
| 1328 | pub const atmega8535 = Cpu{ | |
| 1329 | pub const atmega8535 = CpuModel{ | |
| 1329 | 1330 | .name = "atmega8535", |
| 1330 | 1331 | .llvm_name = "atmega8535", |
| 1331 | 1332 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1336,175 +1337,175 @@ pub const cpu = struct { |
| 1336 | 1337 | .spm, |
| 1337 | 1338 | }), |
| 1338 | 1339 | }; |
| 1339 | pub const atmega88 = Cpu{ | |
| 1340 | pub const atmega88 = CpuModel{ | |
| 1340 | 1341 | .name = "atmega88", |
| 1341 | 1342 | .llvm_name = "atmega88", |
| 1342 | 1343 | .features = featureSet(&[_]Feature{ |
| 1343 | 1344 | .avr4, |
| 1344 | 1345 | }), |
| 1345 | 1346 | }; |
| 1346 | pub const atmega88a = Cpu{ | |
| 1347 | pub const atmega88a = CpuModel{ | |
| 1347 | 1348 | .name = "atmega88a", |
| 1348 | 1349 | .llvm_name = "atmega88a", |
| 1349 | 1350 | .features = featureSet(&[_]Feature{ |
| 1350 | 1351 | .avr4, |
| 1351 | 1352 | }), |
| 1352 | 1353 | }; |
| 1353 | pub const atmega88p = Cpu{ | |
| 1354 | pub const atmega88p = CpuModel{ | |
| 1354 | 1355 | .name = "atmega88p", |
| 1355 | 1356 | .llvm_name = "atmega88p", |
| 1356 | 1357 | .features = featureSet(&[_]Feature{ |
| 1357 | 1358 | .avr4, |
| 1358 | 1359 | }), |
| 1359 | 1360 | }; |
| 1360 | pub const atmega88pa = Cpu{ | |
| 1361 | pub const atmega88pa = CpuModel{ | |
| 1361 | 1362 | .name = "atmega88pa", |
| 1362 | 1363 | .llvm_name = "atmega88pa", |
| 1363 | 1364 | .features = featureSet(&[_]Feature{ |
| 1364 | 1365 | .avr4, |
| 1365 | 1366 | }), |
| 1366 | 1367 | }; |
| 1367 | pub const atmega8a = Cpu{ | |
| 1368 | pub const atmega8a = CpuModel{ | |
| 1368 | 1369 | .name = "atmega8a", |
| 1369 | 1370 | .llvm_name = "atmega8a", |
| 1370 | 1371 | .features = featureSet(&[_]Feature{ |
| 1371 | 1372 | .avr4, |
| 1372 | 1373 | }), |
| 1373 | 1374 | }; |
| 1374 | pub const atmega8hva = Cpu{ | |
| 1375 | pub const atmega8hva = CpuModel{ | |
| 1375 | 1376 | .name = "atmega8hva", |
| 1376 | 1377 | .llvm_name = "atmega8hva", |
| 1377 | 1378 | .features = featureSet(&[_]Feature{ |
| 1378 | 1379 | .avr4, |
| 1379 | 1380 | }), |
| 1380 | 1381 | }; |
| 1381 | pub const atmega8u2 = Cpu{ | |
| 1382 | pub const atmega8u2 = CpuModel{ | |
| 1382 | 1383 | .name = "atmega8u2", |
| 1383 | 1384 | .llvm_name = "atmega8u2", |
| 1384 | 1385 | .features = featureSet(&[_]Feature{ |
| 1385 | 1386 | .avr35, |
| 1386 | 1387 | }), |
| 1387 | 1388 | }; |
| 1388 | pub const attiny10 = Cpu{ | |
| 1389 | pub const attiny10 = CpuModel{ | |
| 1389 | 1390 | .name = "attiny10", |
| 1390 | 1391 | .llvm_name = "attiny10", |
| 1391 | 1392 | .features = featureSet(&[_]Feature{ |
| 1392 | 1393 | .avrtiny, |
| 1393 | 1394 | }), |
| 1394 | 1395 | }; |
| 1395 | pub const attiny102 = Cpu{ | |
| 1396 | pub const attiny102 = CpuModel{ | |
| 1396 | 1397 | .name = "attiny102", |
| 1397 | 1398 | .llvm_name = "attiny102", |
| 1398 | 1399 | .features = featureSet(&[_]Feature{ |
| 1399 | 1400 | .avrtiny, |
| 1400 | 1401 | }), |
| 1401 | 1402 | }; |
| 1402 | pub const attiny104 = Cpu{ | |
| 1403 | pub const attiny104 = CpuModel{ | |
| 1403 | 1404 | .name = "attiny104", |
| 1404 | 1405 | .llvm_name = "attiny104", |
| 1405 | 1406 | .features = featureSet(&[_]Feature{ |
| 1406 | 1407 | .avrtiny, |
| 1407 | 1408 | }), |
| 1408 | 1409 | }; |
| 1409 | pub const attiny11 = Cpu{ | |
| 1410 | pub const attiny11 = CpuModel{ | |
| 1410 | 1411 | .name = "attiny11", |
| 1411 | 1412 | .llvm_name = "attiny11", |
| 1412 | 1413 | .features = featureSet(&[_]Feature{ |
| 1413 | 1414 | .avr1, |
| 1414 | 1415 | }), |
| 1415 | 1416 | }; |
| 1416 | pub const attiny12 = Cpu{ | |
| 1417 | pub const attiny12 = CpuModel{ | |
| 1417 | 1418 | .name = "attiny12", |
| 1418 | 1419 | .llvm_name = "attiny12", |
| 1419 | 1420 | .features = featureSet(&[_]Feature{ |
| 1420 | 1421 | .avr1, |
| 1421 | 1422 | }), |
| 1422 | 1423 | }; |
| 1423 | pub const attiny13 = Cpu{ | |
| 1424 | pub const attiny13 = CpuModel{ | |
| 1424 | 1425 | .name = "attiny13", |
| 1425 | 1426 | .llvm_name = "attiny13", |
| 1426 | 1427 | .features = featureSet(&[_]Feature{ |
| 1427 | 1428 | .avr25, |
| 1428 | 1429 | }), |
| 1429 | 1430 | }; |
| 1430 | pub const attiny13a = Cpu{ | |
| 1431 | pub const attiny13a = CpuModel{ | |
| 1431 | 1432 | .name = "attiny13a", |
| 1432 | 1433 | .llvm_name = "attiny13a", |
| 1433 | 1434 | .features = featureSet(&[_]Feature{ |
| 1434 | 1435 | .avr25, |
| 1435 | 1436 | }), |
| 1436 | 1437 | }; |
| 1437 | pub const attiny15 = Cpu{ | |
| 1438 | pub const attiny15 = CpuModel{ | |
| 1438 | 1439 | .name = "attiny15", |
| 1439 | 1440 | .llvm_name = "attiny15", |
| 1440 | 1441 | .features = featureSet(&[_]Feature{ |
| 1441 | 1442 | .avr1, |
| 1442 | 1443 | }), |
| 1443 | 1444 | }; |
| 1444 | pub const attiny1634 = Cpu{ | |
| 1445 | pub const attiny1634 = CpuModel{ | |
| 1445 | 1446 | .name = "attiny1634", |
| 1446 | 1447 | .llvm_name = "attiny1634", |
| 1447 | 1448 | .features = featureSet(&[_]Feature{ |
| 1448 | 1449 | .avr35, |
| 1449 | 1450 | }), |
| 1450 | 1451 | }; |
| 1451 | pub const attiny167 = Cpu{ | |
| 1452 | pub const attiny167 = CpuModel{ | |
| 1452 | 1453 | .name = "attiny167", |
| 1453 | 1454 | .llvm_name = "attiny167", |
| 1454 | 1455 | .features = featureSet(&[_]Feature{ |
| 1455 | 1456 | .avr35, |
| 1456 | 1457 | }), |
| 1457 | 1458 | }; |
| 1458 | pub const attiny20 = Cpu{ | |
| 1459 | pub const attiny20 = CpuModel{ | |
| 1459 | 1460 | .name = "attiny20", |
| 1460 | 1461 | .llvm_name = "attiny20", |
| 1461 | 1462 | .features = featureSet(&[_]Feature{ |
| 1462 | 1463 | .avrtiny, |
| 1463 | 1464 | }), |
| 1464 | 1465 | }; |
| 1465 | pub const attiny22 = Cpu{ | |
| 1466 | pub const attiny22 = CpuModel{ | |
| 1466 | 1467 | .name = "attiny22", |
| 1467 | 1468 | .llvm_name = "attiny22", |
| 1468 | 1469 | .features = featureSet(&[_]Feature{ |
| 1469 | 1470 | .avr2, |
| 1470 | 1471 | }), |
| 1471 | 1472 | }; |
| 1472 | pub const attiny2313 = Cpu{ | |
| 1473 | pub const attiny2313 = CpuModel{ | |
| 1473 | 1474 | .name = "attiny2313", |
| 1474 | 1475 | .llvm_name = "attiny2313", |
| 1475 | 1476 | .features = featureSet(&[_]Feature{ |
| 1476 | 1477 | .avr25, |
| 1477 | 1478 | }), |
| 1478 | 1479 | }; |
| 1479 | pub const attiny2313a = Cpu{ | |
| 1480 | pub const attiny2313a = CpuModel{ | |
| 1480 | 1481 | .name = "attiny2313a", |
| 1481 | 1482 | .llvm_name = "attiny2313a", |
| 1482 | 1483 | .features = featureSet(&[_]Feature{ |
| 1483 | 1484 | .avr25, |
| 1484 | 1485 | }), |
| 1485 | 1486 | }; |
| 1486 | pub const attiny24 = Cpu{ | |
| 1487 | pub const attiny24 = CpuModel{ | |
| 1487 | 1488 | .name = "attiny24", |
| 1488 | 1489 | .llvm_name = "attiny24", |
| 1489 | 1490 | .features = featureSet(&[_]Feature{ |
| 1490 | 1491 | .avr25, |
| 1491 | 1492 | }), |
| 1492 | 1493 | }; |
| 1493 | pub const attiny24a = Cpu{ | |
| 1494 | pub const attiny24a = CpuModel{ | |
| 1494 | 1495 | .name = "attiny24a", |
| 1495 | 1496 | .llvm_name = "attiny24a", |
| 1496 | 1497 | .features = featureSet(&[_]Feature{ |
| 1497 | 1498 | .avr25, |
| 1498 | 1499 | }), |
| 1499 | 1500 | }; |
| 1500 | pub const attiny25 = Cpu{ | |
| 1501 | pub const attiny25 = CpuModel{ | |
| 1501 | 1502 | .name = "attiny25", |
| 1502 | 1503 | .llvm_name = "attiny25", |
| 1503 | 1504 | .features = featureSet(&[_]Feature{ |
| 1504 | 1505 | .avr25, |
| 1505 | 1506 | }), |
| 1506 | 1507 | }; |
| 1507 | pub const attiny26 = Cpu{ | |
| 1508 | pub const attiny26 = CpuModel{ | |
| 1508 | 1509 | .name = "attiny26", |
| 1509 | 1510 | .llvm_name = "attiny26", |
| 1510 | 1511 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1512,602 +1513,602 @@ pub const cpu = struct { |
| 1512 | 1513 | .lpmx, |
| 1513 | 1514 | }), |
| 1514 | 1515 | }; |
| 1515 | pub const attiny261 = Cpu{ | |
| 1516 | pub const attiny261 = CpuModel{ | |
| 1516 | 1517 | .name = "attiny261", |
| 1517 | 1518 | .llvm_name = "attiny261", |
| 1518 | 1519 | .features = featureSet(&[_]Feature{ |
| 1519 | 1520 | .avr25, |
| 1520 | 1521 | }), |
| 1521 | 1522 | }; |
| 1522 | pub const attiny261a = Cpu{ | |
| 1523 | pub const attiny261a = CpuModel{ | |
| 1523 | 1524 | .name = "attiny261a", |
| 1524 | 1525 | .llvm_name = "attiny261a", |
| 1525 | 1526 | .features = featureSet(&[_]Feature{ |
| 1526 | 1527 | .avr25, |
| 1527 | 1528 | }), |
| 1528 | 1529 | }; |
| 1529 | pub const attiny28 = Cpu{ | |
| 1530 | pub const attiny28 = CpuModel{ | |
| 1530 | 1531 | .name = "attiny28", |
| 1531 | 1532 | .llvm_name = "attiny28", |
| 1532 | 1533 | .features = featureSet(&[_]Feature{ |
| 1533 | 1534 | .avr1, |
| 1534 | 1535 | }), |
| 1535 | 1536 | }; |
| 1536 | pub const attiny4 = Cpu{ | |
| 1537 | pub const attiny4 = CpuModel{ | |
| 1537 | 1538 | .name = "attiny4", |
| 1538 | 1539 | .llvm_name = "attiny4", |
| 1539 | 1540 | .features = featureSet(&[_]Feature{ |
| 1540 | 1541 | .avrtiny, |
| 1541 | 1542 | }), |
| 1542 | 1543 | }; |
| 1543 | pub const attiny40 = Cpu{ | |
| 1544 | pub const attiny40 = CpuModel{ | |
| 1544 | 1545 | .name = "attiny40", |
| 1545 | 1546 | .llvm_name = "attiny40", |
| 1546 | 1547 | .features = featureSet(&[_]Feature{ |
| 1547 | 1548 | .avrtiny, |
| 1548 | 1549 | }), |
| 1549 | 1550 | }; |
| 1550 | pub const attiny4313 = Cpu{ | |
| 1551 | pub const attiny4313 = CpuModel{ | |
| 1551 | 1552 | .name = "attiny4313", |
| 1552 | 1553 | .llvm_name = "attiny4313", |
| 1553 | 1554 | .features = featureSet(&[_]Feature{ |
| 1554 | 1555 | .avr25, |
| 1555 | 1556 | }), |
| 1556 | 1557 | }; |
| 1557 | pub const attiny43u = Cpu{ | |
| 1558 | pub const attiny43u = CpuModel{ | |
| 1558 | 1559 | .name = "attiny43u", |
| 1559 | 1560 | .llvm_name = "attiny43u", |
| 1560 | 1561 | .features = featureSet(&[_]Feature{ |
| 1561 | 1562 | .avr25, |
| 1562 | 1563 | }), |
| 1563 | 1564 | }; |
| 1564 | pub const attiny44 = Cpu{ | |
| 1565 | pub const attiny44 = CpuModel{ | |
| 1565 | 1566 | .name = "attiny44", |
| 1566 | 1567 | .llvm_name = "attiny44", |
| 1567 | 1568 | .features = featureSet(&[_]Feature{ |
| 1568 | 1569 | .avr25, |
| 1569 | 1570 | }), |
| 1570 | 1571 | }; |
| 1571 | pub const attiny44a = Cpu{ | |
| 1572 | pub const attiny44a = CpuModel{ | |
| 1572 | 1573 | .name = "attiny44a", |
| 1573 | 1574 | .llvm_name = "attiny44a", |
| 1574 | 1575 | .features = featureSet(&[_]Feature{ |
| 1575 | 1576 | .avr25, |
| 1576 | 1577 | }), |
| 1577 | 1578 | }; |
| 1578 | pub const attiny45 = Cpu{ | |
| 1579 | pub const attiny45 = CpuModel{ | |
| 1579 | 1580 | .name = "attiny45", |
| 1580 | 1581 | .llvm_name = "attiny45", |
| 1581 | 1582 | .features = featureSet(&[_]Feature{ |
| 1582 | 1583 | .avr25, |
| 1583 | 1584 | }), |
| 1584 | 1585 | }; |
| 1585 | pub const attiny461 = Cpu{ | |
| 1586 | pub const attiny461 = CpuModel{ | |
| 1586 | 1587 | .name = "attiny461", |
| 1587 | 1588 | .llvm_name = "attiny461", |
| 1588 | 1589 | .features = featureSet(&[_]Feature{ |
| 1589 | 1590 | .avr25, |
| 1590 | 1591 | }), |
| 1591 | 1592 | }; |
| 1592 | pub const attiny461a = Cpu{ | |
| 1593 | pub const attiny461a = CpuModel{ | |
| 1593 | 1594 | .name = "attiny461a", |
| 1594 | 1595 | .llvm_name = "attiny461a", |
| 1595 | 1596 | .features = featureSet(&[_]Feature{ |
| 1596 | 1597 | .avr25, |
| 1597 | 1598 | }), |
| 1598 | 1599 | }; |
| 1599 | pub const attiny48 = Cpu{ | |
| 1600 | pub const attiny48 = CpuModel{ | |
| 1600 | 1601 | .name = "attiny48", |
| 1601 | 1602 | .llvm_name = "attiny48", |
| 1602 | 1603 | .features = featureSet(&[_]Feature{ |
| 1603 | 1604 | .avr25, |
| 1604 | 1605 | }), |
| 1605 | 1606 | }; |
| 1606 | pub const attiny5 = Cpu{ | |
| 1607 | pub const attiny5 = CpuModel{ | |
| 1607 | 1608 | .name = "attiny5", |
| 1608 | 1609 | .llvm_name = "attiny5", |
| 1609 | 1610 | .features = featureSet(&[_]Feature{ |
| 1610 | 1611 | .avrtiny, |
| 1611 | 1612 | }), |
| 1612 | 1613 | }; |
| 1613 | pub const attiny828 = Cpu{ | |
| 1614 | pub const attiny828 = CpuModel{ | |
| 1614 | 1615 | .name = "attiny828", |
| 1615 | 1616 | .llvm_name = "attiny828", |
| 1616 | 1617 | .features = featureSet(&[_]Feature{ |
| 1617 | 1618 | .avr25, |
| 1618 | 1619 | }), |
| 1619 | 1620 | }; |
| 1620 | pub const attiny84 = Cpu{ | |
| 1621 | pub const attiny84 = CpuModel{ | |
| 1621 | 1622 | .name = "attiny84", |
| 1622 | 1623 | .llvm_name = "attiny84", |
| 1623 | 1624 | .features = featureSet(&[_]Feature{ |
| 1624 | 1625 | .avr25, |
| 1625 | 1626 | }), |
| 1626 | 1627 | }; |
| 1627 | pub const attiny84a = Cpu{ | |
| 1628 | pub const attiny84a = CpuModel{ | |
| 1628 | 1629 | .name = "attiny84a", |
| 1629 | 1630 | .llvm_name = "attiny84a", |
| 1630 | 1631 | .features = featureSet(&[_]Feature{ |
| 1631 | 1632 | .avr25, |
| 1632 | 1633 | }), |
| 1633 | 1634 | }; |
| 1634 | pub const attiny85 = Cpu{ | |
| 1635 | pub const attiny85 = CpuModel{ | |
| 1635 | 1636 | .name = "attiny85", |
| 1636 | 1637 | .llvm_name = "attiny85", |
| 1637 | 1638 | .features = featureSet(&[_]Feature{ |
| 1638 | 1639 | .avr25, |
| 1639 | 1640 | }), |
| 1640 | 1641 | }; |
| 1641 | pub const attiny861 = Cpu{ | |
| 1642 | pub const attiny861 = CpuModel{ | |
| 1642 | 1643 | .name = "attiny861", |
| 1643 | 1644 | .llvm_name = "attiny861", |
| 1644 | 1645 | .features = featureSet(&[_]Feature{ |
| 1645 | 1646 | .avr25, |
| 1646 | 1647 | }), |
| 1647 | 1648 | }; |
| 1648 | pub const attiny861a = Cpu{ | |
| 1649 | pub const attiny861a = CpuModel{ | |
| 1649 | 1650 | .name = "attiny861a", |
| 1650 | 1651 | .llvm_name = "attiny861a", |
| 1651 | 1652 | .features = featureSet(&[_]Feature{ |
| 1652 | 1653 | .avr25, |
| 1653 | 1654 | }), |
| 1654 | 1655 | }; |
| 1655 | pub const attiny87 = Cpu{ | |
| 1656 | pub const attiny87 = CpuModel{ | |
| 1656 | 1657 | .name = "attiny87", |
| 1657 | 1658 | .llvm_name = "attiny87", |
| 1658 | 1659 | .features = featureSet(&[_]Feature{ |
| 1659 | 1660 | .avr25, |
| 1660 | 1661 | }), |
| 1661 | 1662 | }; |
| 1662 | pub const attiny88 = Cpu{ | |
| 1663 | pub const attiny88 = CpuModel{ | |
| 1663 | 1664 | .name = "attiny88", |
| 1664 | 1665 | .llvm_name = "attiny88", |
| 1665 | 1666 | .features = featureSet(&[_]Feature{ |
| 1666 | 1667 | .avr25, |
| 1667 | 1668 | }), |
| 1668 | 1669 | }; |
| 1669 | pub const attiny9 = Cpu{ | |
| 1670 | pub const attiny9 = CpuModel{ | |
| 1670 | 1671 | .name = "attiny9", |
| 1671 | 1672 | .llvm_name = "attiny9", |
| 1672 | 1673 | .features = featureSet(&[_]Feature{ |
| 1673 | 1674 | .avrtiny, |
| 1674 | 1675 | }), |
| 1675 | 1676 | }; |
| 1676 | pub const atxmega128a1 = Cpu{ | |
| 1677 | pub const atxmega128a1 = CpuModel{ | |
| 1677 | 1678 | .name = "atxmega128a1", |
| 1678 | 1679 | .llvm_name = "atxmega128a1", |
| 1679 | 1680 | .features = featureSet(&[_]Feature{ |
| 1680 | 1681 | .xmega, |
| 1681 | 1682 | }), |
| 1682 | 1683 | }; |
| 1683 | pub const atxmega128a1u = Cpu{ | |
| 1684 | pub const atxmega128a1u = CpuModel{ | |
| 1684 | 1685 | .name = "atxmega128a1u", |
| 1685 | 1686 | .llvm_name = "atxmega128a1u", |
| 1686 | 1687 | .features = featureSet(&[_]Feature{ |
| 1687 | 1688 | .xmegau, |
| 1688 | 1689 | }), |
| 1689 | 1690 | }; |
| 1690 | pub const atxmega128a3 = Cpu{ | |
| 1691 | pub const atxmega128a3 = CpuModel{ | |
| 1691 | 1692 | .name = "atxmega128a3", |
| 1692 | 1693 | .llvm_name = "atxmega128a3", |
| 1693 | 1694 | .features = featureSet(&[_]Feature{ |
| 1694 | 1695 | .xmega, |
| 1695 | 1696 | }), |
| 1696 | 1697 | }; |
| 1697 | pub const atxmega128a3u = Cpu{ | |
| 1698 | pub const atxmega128a3u = CpuModel{ | |
| 1698 | 1699 | .name = "atxmega128a3u", |
| 1699 | 1700 | .llvm_name = "atxmega128a3u", |
| 1700 | 1701 | .features = featureSet(&[_]Feature{ |
| 1701 | 1702 | .xmegau, |
| 1702 | 1703 | }), |
| 1703 | 1704 | }; |
| 1704 | pub const atxmega128a4u = Cpu{ | |
| 1705 | pub const atxmega128a4u = CpuModel{ | |
| 1705 | 1706 | .name = "atxmega128a4u", |
| 1706 | 1707 | .llvm_name = "atxmega128a4u", |
| 1707 | 1708 | .features = featureSet(&[_]Feature{ |
| 1708 | 1709 | .xmegau, |
| 1709 | 1710 | }), |
| 1710 | 1711 | }; |
| 1711 | pub const atxmega128b1 = Cpu{ | |
| 1712 | pub const atxmega128b1 = CpuModel{ | |
| 1712 | 1713 | .name = "atxmega128b1", |
| 1713 | 1714 | .llvm_name = "atxmega128b1", |
| 1714 | 1715 | .features = featureSet(&[_]Feature{ |
| 1715 | 1716 | .xmegau, |
| 1716 | 1717 | }), |
| 1717 | 1718 | }; |
| 1718 | pub const atxmega128b3 = Cpu{ | |
| 1719 | pub const atxmega128b3 = CpuModel{ | |
| 1719 | 1720 | .name = "atxmega128b3", |
| 1720 | 1721 | .llvm_name = "atxmega128b3", |
| 1721 | 1722 | .features = featureSet(&[_]Feature{ |
| 1722 | 1723 | .xmegau, |
| 1723 | 1724 | }), |
| 1724 | 1725 | }; |
| 1725 | pub const atxmega128c3 = Cpu{ | |
| 1726 | pub const atxmega128c3 = CpuModel{ | |
| 1726 | 1727 | .name = "atxmega128c3", |
| 1727 | 1728 | .llvm_name = "atxmega128c3", |
| 1728 | 1729 | .features = featureSet(&[_]Feature{ |
| 1729 | 1730 | .xmegau, |
| 1730 | 1731 | }), |
| 1731 | 1732 | }; |
| 1732 | pub const atxmega128d3 = Cpu{ | |
| 1733 | pub const atxmega128d3 = CpuModel{ | |
| 1733 | 1734 | .name = "atxmega128d3", |
| 1734 | 1735 | .llvm_name = "atxmega128d3", |
| 1735 | 1736 | .features = featureSet(&[_]Feature{ |
| 1736 | 1737 | .xmega, |
| 1737 | 1738 | }), |
| 1738 | 1739 | }; |
| 1739 | pub const atxmega128d4 = Cpu{ | |
| 1740 | pub const atxmega128d4 = CpuModel{ | |
| 1740 | 1741 | .name = "atxmega128d4", |
| 1741 | 1742 | .llvm_name = "atxmega128d4", |
| 1742 | 1743 | .features = featureSet(&[_]Feature{ |
| 1743 | 1744 | .xmega, |
| 1744 | 1745 | }), |
| 1745 | 1746 | }; |
| 1746 | pub const atxmega16a4 = Cpu{ | |
| 1747 | pub const atxmega16a4 = CpuModel{ | |
| 1747 | 1748 | .name = "atxmega16a4", |
| 1748 | 1749 | .llvm_name = "atxmega16a4", |
| 1749 | 1750 | .features = featureSet(&[_]Feature{ |
| 1750 | 1751 | .xmega, |
| 1751 | 1752 | }), |
| 1752 | 1753 | }; |
| 1753 | pub const atxmega16a4u = Cpu{ | |
| 1754 | pub const atxmega16a4u = CpuModel{ | |
| 1754 | 1755 | .name = "atxmega16a4u", |
| 1755 | 1756 | .llvm_name = "atxmega16a4u", |
| 1756 | 1757 | .features = featureSet(&[_]Feature{ |
| 1757 | 1758 | .xmegau, |
| 1758 | 1759 | }), |
| 1759 | 1760 | }; |
| 1760 | pub const atxmega16c4 = Cpu{ | |
| 1761 | pub const atxmega16c4 = CpuModel{ | |
| 1761 | 1762 | .name = "atxmega16c4", |
| 1762 | 1763 | .llvm_name = "atxmega16c4", |
| 1763 | 1764 | .features = featureSet(&[_]Feature{ |
| 1764 | 1765 | .xmegau, |
| 1765 | 1766 | }), |
| 1766 | 1767 | }; |
| 1767 | pub const atxmega16d4 = Cpu{ | |
| 1768 | pub const atxmega16d4 = CpuModel{ | |
| 1768 | 1769 | .name = "atxmega16d4", |
| 1769 | 1770 | .llvm_name = "atxmega16d4", |
| 1770 | 1771 | .features = featureSet(&[_]Feature{ |
| 1771 | 1772 | .xmega, |
| 1772 | 1773 | }), |
| 1773 | 1774 | }; |
| 1774 | pub const atxmega16e5 = Cpu{ | |
| 1775 | pub const atxmega16e5 = CpuModel{ | |
| 1775 | 1776 | .name = "atxmega16e5", |
| 1776 | 1777 | .llvm_name = "atxmega16e5", |
| 1777 | 1778 | .features = featureSet(&[_]Feature{ |
| 1778 | 1779 | .xmega, |
| 1779 | 1780 | }), |
| 1780 | 1781 | }; |
| 1781 | pub const atxmega192a3 = Cpu{ | |
| 1782 | pub const atxmega192a3 = CpuModel{ | |
| 1782 | 1783 | .name = "atxmega192a3", |
| 1783 | 1784 | .llvm_name = "atxmega192a3", |
| 1784 | 1785 | .features = featureSet(&[_]Feature{ |
| 1785 | 1786 | .xmega, |
| 1786 | 1787 | }), |
| 1787 | 1788 | }; |
| 1788 | pub const atxmega192a3u = Cpu{ | |
| 1789 | pub const atxmega192a3u = CpuModel{ | |
| 1789 | 1790 | .name = "atxmega192a3u", |
| 1790 | 1791 | .llvm_name = "atxmega192a3u", |
| 1791 | 1792 | .features = featureSet(&[_]Feature{ |
| 1792 | 1793 | .xmegau, |
| 1793 | 1794 | }), |
| 1794 | 1795 | }; |
| 1795 | pub const atxmega192c3 = Cpu{ | |
| 1796 | pub const atxmega192c3 = CpuModel{ | |
| 1796 | 1797 | .name = "atxmega192c3", |
| 1797 | 1798 | .llvm_name = "atxmega192c3", |
| 1798 | 1799 | .features = featureSet(&[_]Feature{ |
| 1799 | 1800 | .xmegau, |
| 1800 | 1801 | }), |
| 1801 | 1802 | }; |
| 1802 | pub const atxmega192d3 = Cpu{ | |
| 1803 | pub const atxmega192d3 = CpuModel{ | |
| 1803 | 1804 | .name = "atxmega192d3", |
| 1804 | 1805 | .llvm_name = "atxmega192d3", |
| 1805 | 1806 | .features = featureSet(&[_]Feature{ |
| 1806 | 1807 | .xmega, |
| 1807 | 1808 | }), |
| 1808 | 1809 | }; |
| 1809 | pub const atxmega256a3 = Cpu{ | |
| 1810 | pub const atxmega256a3 = CpuModel{ | |
| 1810 | 1811 | .name = "atxmega256a3", |
| 1811 | 1812 | .llvm_name = "atxmega256a3", |
| 1812 | 1813 | .features = featureSet(&[_]Feature{ |
| 1813 | 1814 | .xmega, |
| 1814 | 1815 | }), |
| 1815 | 1816 | }; |
| 1816 | pub const atxmega256a3b = Cpu{ | |
| 1817 | pub const atxmega256a3b = CpuModel{ | |
| 1817 | 1818 | .name = "atxmega256a3b", |
| 1818 | 1819 | .llvm_name = "atxmega256a3b", |
| 1819 | 1820 | .features = featureSet(&[_]Feature{ |
| 1820 | 1821 | .xmega, |
| 1821 | 1822 | }), |
| 1822 | 1823 | }; |
| 1823 | pub const atxmega256a3bu = Cpu{ | |
| 1824 | pub const atxmega256a3bu = CpuModel{ | |
| 1824 | 1825 | .name = "atxmega256a3bu", |
| 1825 | 1826 | .llvm_name = "atxmega256a3bu", |
| 1826 | 1827 | .features = featureSet(&[_]Feature{ |
| 1827 | 1828 | .xmegau, |
| 1828 | 1829 | }), |
| 1829 | 1830 | }; |
| 1830 | pub const atxmega256a3u = Cpu{ | |
| 1831 | pub const atxmega256a3u = CpuModel{ | |
| 1831 | 1832 | .name = "atxmega256a3u", |
| 1832 | 1833 | .llvm_name = "atxmega256a3u", |
| 1833 | 1834 | .features = featureSet(&[_]Feature{ |
| 1834 | 1835 | .xmegau, |
| 1835 | 1836 | }), |
| 1836 | 1837 | }; |
| 1837 | pub const atxmega256c3 = Cpu{ | |
| 1838 | pub const atxmega256c3 = CpuModel{ | |
| 1838 | 1839 | .name = "atxmega256c3", |
| 1839 | 1840 | .llvm_name = "atxmega256c3", |
| 1840 | 1841 | .features = featureSet(&[_]Feature{ |
| 1841 | 1842 | .xmegau, |
| 1842 | 1843 | }), |
| 1843 | 1844 | }; |
| 1844 | pub const atxmega256d3 = Cpu{ | |
| 1845 | pub const atxmega256d3 = CpuModel{ | |
| 1845 | 1846 | .name = "atxmega256d3", |
| 1846 | 1847 | .llvm_name = "atxmega256d3", |
| 1847 | 1848 | .features = featureSet(&[_]Feature{ |
| 1848 | 1849 | .xmega, |
| 1849 | 1850 | }), |
| 1850 | 1851 | }; |
| 1851 | pub const atxmega32a4 = Cpu{ | |
| 1852 | pub const atxmega32a4 = CpuModel{ | |
| 1852 | 1853 | .name = "atxmega32a4", |
| 1853 | 1854 | .llvm_name = "atxmega32a4", |
| 1854 | 1855 | .features = featureSet(&[_]Feature{ |
| 1855 | 1856 | .xmega, |
| 1856 | 1857 | }), |
| 1857 | 1858 | }; |
| 1858 | pub const atxmega32a4u = Cpu{ | |
| 1859 | pub const atxmega32a4u = CpuModel{ | |
| 1859 | 1860 | .name = "atxmega32a4u", |
| 1860 | 1861 | .llvm_name = "atxmega32a4u", |
| 1861 | 1862 | .features = featureSet(&[_]Feature{ |
| 1862 | 1863 | .xmegau, |
| 1863 | 1864 | }), |
| 1864 | 1865 | }; |
| 1865 | pub const atxmega32c4 = Cpu{ | |
| 1866 | pub const atxmega32c4 = CpuModel{ | |
| 1866 | 1867 | .name = "atxmega32c4", |
| 1867 | 1868 | .llvm_name = "atxmega32c4", |
| 1868 | 1869 | .features = featureSet(&[_]Feature{ |
| 1869 | 1870 | .xmegau, |
| 1870 | 1871 | }), |
| 1871 | 1872 | }; |
| 1872 | pub const atxmega32d4 = Cpu{ | |
| 1873 | pub const atxmega32d4 = CpuModel{ | |
| 1873 | 1874 | .name = "atxmega32d4", |
| 1874 | 1875 | .llvm_name = "atxmega32d4", |
| 1875 | 1876 | .features = featureSet(&[_]Feature{ |
| 1876 | 1877 | .xmega, |
| 1877 | 1878 | }), |
| 1878 | 1879 | }; |
| 1879 | pub const atxmega32e5 = Cpu{ | |
| 1880 | pub const atxmega32e5 = CpuModel{ | |
| 1880 | 1881 | .name = "atxmega32e5", |
| 1881 | 1882 | .llvm_name = "atxmega32e5", |
| 1882 | 1883 | .features = featureSet(&[_]Feature{ |
| 1883 | 1884 | .xmega, |
| 1884 | 1885 | }), |
| 1885 | 1886 | }; |
| 1886 | pub const atxmega32x1 = Cpu{ | |
| 1887 | pub const atxmega32x1 = CpuModel{ | |
| 1887 | 1888 | .name = "atxmega32x1", |
| 1888 | 1889 | .llvm_name = "atxmega32x1", |
| 1889 | 1890 | .features = featureSet(&[_]Feature{ |
| 1890 | 1891 | .xmega, |
| 1891 | 1892 | }), |
| 1892 | 1893 | }; |
| 1893 | pub const atxmega384c3 = Cpu{ | |
| 1894 | pub const atxmega384c3 = CpuModel{ | |
| 1894 | 1895 | .name = "atxmega384c3", |
| 1895 | 1896 | .llvm_name = "atxmega384c3", |
| 1896 | 1897 | .features = featureSet(&[_]Feature{ |
| 1897 | 1898 | .xmegau, |
| 1898 | 1899 | }), |
| 1899 | 1900 | }; |
| 1900 | pub const atxmega384d3 = Cpu{ | |
| 1901 | pub const atxmega384d3 = CpuModel{ | |
| 1901 | 1902 | .name = "atxmega384d3", |
| 1902 | 1903 | .llvm_name = "atxmega384d3", |
| 1903 | 1904 | .features = featureSet(&[_]Feature{ |
| 1904 | 1905 | .xmega, |
| 1905 | 1906 | }), |
| 1906 | 1907 | }; |
| 1907 | pub const atxmega64a1 = Cpu{ | |
| 1908 | pub const atxmega64a1 = CpuModel{ | |
| 1908 | 1909 | .name = "atxmega64a1", |
| 1909 | 1910 | .llvm_name = "atxmega64a1", |
| 1910 | 1911 | .features = featureSet(&[_]Feature{ |
| 1911 | 1912 | .xmega, |
| 1912 | 1913 | }), |
| 1913 | 1914 | }; |
| 1914 | pub const atxmega64a1u = Cpu{ | |
| 1915 | pub const atxmega64a1u = CpuModel{ | |
| 1915 | 1916 | .name = "atxmega64a1u", |
| 1916 | 1917 | .llvm_name = "atxmega64a1u", |
| 1917 | 1918 | .features = featureSet(&[_]Feature{ |
| 1918 | 1919 | .xmegau, |
| 1919 | 1920 | }), |
| 1920 | 1921 | }; |
| 1921 | pub const atxmega64a3 = Cpu{ | |
| 1922 | pub const atxmega64a3 = CpuModel{ | |
| 1922 | 1923 | .name = "atxmega64a3", |
| 1923 | 1924 | .llvm_name = "atxmega64a3", |
| 1924 | 1925 | .features = featureSet(&[_]Feature{ |
| 1925 | 1926 | .xmega, |
| 1926 | 1927 | }), |
| 1927 | 1928 | }; |
| 1928 | pub const atxmega64a3u = Cpu{ | |
| 1929 | pub const atxmega64a3u = CpuModel{ | |
| 1929 | 1930 | .name = "atxmega64a3u", |
| 1930 | 1931 | .llvm_name = "atxmega64a3u", |
| 1931 | 1932 | .features = featureSet(&[_]Feature{ |
| 1932 | 1933 | .xmegau, |
| 1933 | 1934 | }), |
| 1934 | 1935 | }; |
| 1935 | pub const atxmega64a4u = Cpu{ | |
| 1936 | pub const atxmega64a4u = CpuModel{ | |
| 1936 | 1937 | .name = "atxmega64a4u", |
| 1937 | 1938 | .llvm_name = "atxmega64a4u", |
| 1938 | 1939 | .features = featureSet(&[_]Feature{ |
| 1939 | 1940 | .xmegau, |
| 1940 | 1941 | }), |
| 1941 | 1942 | }; |
| 1942 | pub const atxmega64b1 = Cpu{ | |
| 1943 | pub const atxmega64b1 = CpuModel{ | |
| 1943 | 1944 | .name = "atxmega64b1", |
| 1944 | 1945 | .llvm_name = "atxmega64b1", |
| 1945 | 1946 | .features = featureSet(&[_]Feature{ |
| 1946 | 1947 | .xmegau, |
| 1947 | 1948 | }), |
| 1948 | 1949 | }; |
| 1949 | pub const atxmega64b3 = Cpu{ | |
| 1950 | pub const atxmega64b3 = CpuModel{ | |
| 1950 | 1951 | .name = "atxmega64b3", |
| 1951 | 1952 | .llvm_name = "atxmega64b3", |
| 1952 | 1953 | .features = featureSet(&[_]Feature{ |
| 1953 | 1954 | .xmegau, |
| 1954 | 1955 | }), |
| 1955 | 1956 | }; |
| 1956 | pub const atxmega64c3 = Cpu{ | |
| 1957 | pub const atxmega64c3 = CpuModel{ | |
| 1957 | 1958 | .name = "atxmega64c3", |
| 1958 | 1959 | .llvm_name = "atxmega64c3", |
| 1959 | 1960 | .features = featureSet(&[_]Feature{ |
| 1960 | 1961 | .xmegau, |
| 1961 | 1962 | }), |
| 1962 | 1963 | }; |
| 1963 | pub const atxmega64d3 = Cpu{ | |
| 1964 | pub const atxmega64d3 = CpuModel{ | |
| 1964 | 1965 | .name = "atxmega64d3", |
| 1965 | 1966 | .llvm_name = "atxmega64d3", |
| 1966 | 1967 | .features = featureSet(&[_]Feature{ |
| 1967 | 1968 | .xmega, |
| 1968 | 1969 | }), |
| 1969 | 1970 | }; |
| 1970 | pub const atxmega64d4 = Cpu{ | |
| 1971 | pub const atxmega64d4 = CpuModel{ | |
| 1971 | 1972 | .name = "atxmega64d4", |
| 1972 | 1973 | .llvm_name = "atxmega64d4", |
| 1973 | 1974 | .features = featureSet(&[_]Feature{ |
| 1974 | 1975 | .xmega, |
| 1975 | 1976 | }), |
| 1976 | 1977 | }; |
| 1977 | pub const atxmega8e5 = Cpu{ | |
| 1978 | pub const atxmega8e5 = CpuModel{ | |
| 1978 | 1979 | .name = "atxmega8e5", |
| 1979 | 1980 | .llvm_name = "atxmega8e5", |
| 1980 | 1981 | .features = featureSet(&[_]Feature{ |
| 1981 | 1982 | .xmega, |
| 1982 | 1983 | }), |
| 1983 | 1984 | }; |
| 1984 | pub const avr1 = Cpu{ | |
| 1985 | pub const avr1 = CpuModel{ | |
| 1985 | 1986 | .name = "avr1", |
| 1986 | 1987 | .llvm_name = "avr1", |
| 1987 | 1988 | .features = featureSet(&[_]Feature{ |
| 1988 | 1989 | .avr1, |
| 1989 | 1990 | }), |
| 1990 | 1991 | }; |
| 1991 | pub const avr2 = Cpu{ | |
| 1992 | pub const avr2 = CpuModel{ | |
| 1992 | 1993 | .name = "avr2", |
| 1993 | 1994 | .llvm_name = "avr2", |
| 1994 | 1995 | .features = featureSet(&[_]Feature{ |
| 1995 | 1996 | .avr2, |
| 1996 | 1997 | }), |
| 1997 | 1998 | }; |
| 1998 | pub const avr25 = Cpu{ | |
| 1999 | pub const avr25 = CpuModel{ | |
| 1999 | 2000 | .name = "avr25", |
| 2000 | 2001 | .llvm_name = "avr25", |
| 2001 | 2002 | .features = featureSet(&[_]Feature{ |
| 2002 | 2003 | .avr25, |
| 2003 | 2004 | }), |
| 2004 | 2005 | }; |
| 2005 | pub const avr3 = Cpu{ | |
| 2006 | pub const avr3 = CpuModel{ | |
| 2006 | 2007 | .name = "avr3", |
| 2007 | 2008 | .llvm_name = "avr3", |
| 2008 | 2009 | .features = featureSet(&[_]Feature{ |
| 2009 | 2010 | .avr3, |
| 2010 | 2011 | }), |
| 2011 | 2012 | }; |
| 2012 | pub const avr31 = Cpu{ | |
| 2013 | pub const avr31 = CpuModel{ | |
| 2013 | 2014 | .name = "avr31", |
| 2014 | 2015 | .llvm_name = "avr31", |
| 2015 | 2016 | .features = featureSet(&[_]Feature{ |
| 2016 | 2017 | .avr31, |
| 2017 | 2018 | }), |
| 2018 | 2019 | }; |
| 2019 | pub const avr35 = Cpu{ | |
| 2020 | pub const avr35 = CpuModel{ | |
| 2020 | 2021 | .name = "avr35", |
| 2021 | 2022 | .llvm_name = "avr35", |
| 2022 | 2023 | .features = featureSet(&[_]Feature{ |
| 2023 | 2024 | .avr35, |
| 2024 | 2025 | }), |
| 2025 | 2026 | }; |
| 2026 | pub const avr4 = Cpu{ | |
| 2027 | pub const avr4 = CpuModel{ | |
| 2027 | 2028 | .name = "avr4", |
| 2028 | 2029 | .llvm_name = "avr4", |
| 2029 | 2030 | .features = featureSet(&[_]Feature{ |
| 2030 | 2031 | .avr4, |
| 2031 | 2032 | }), |
| 2032 | 2033 | }; |
| 2033 | pub const avr5 = Cpu{ | |
| 2034 | pub const avr5 = CpuModel{ | |
| 2034 | 2035 | .name = "avr5", |
| 2035 | 2036 | .llvm_name = "avr5", |
| 2036 | 2037 | .features = featureSet(&[_]Feature{ |
| 2037 | 2038 | .avr5, |
| 2038 | 2039 | }), |
| 2039 | 2040 | }; |
| 2040 | pub const avr51 = Cpu{ | |
| 2041 | pub const avr51 = CpuModel{ | |
| 2041 | 2042 | .name = "avr51", |
| 2042 | 2043 | .llvm_name = "avr51", |
| 2043 | 2044 | .features = featureSet(&[_]Feature{ |
| 2044 | 2045 | .avr51, |
| 2045 | 2046 | }), |
| 2046 | 2047 | }; |
| 2047 | pub const avr6 = Cpu{ | |
| 2048 | pub const avr6 = CpuModel{ | |
| 2048 | 2049 | .name = "avr6", |
| 2049 | 2050 | .llvm_name = "avr6", |
| 2050 | 2051 | .features = featureSet(&[_]Feature{ |
| 2051 | 2052 | .avr6, |
| 2052 | 2053 | }), |
| 2053 | 2054 | }; |
| 2054 | pub const avrtiny = Cpu{ | |
| 2055 | pub const avrtiny = CpuModel{ | |
| 2055 | 2056 | .name = "avrtiny", |
| 2056 | 2057 | .llvm_name = "avrtiny", |
| 2057 | 2058 | .features = featureSet(&[_]Feature{ |
| 2058 | 2059 | .avrtiny, |
| 2059 | 2060 | }), |
| 2060 | 2061 | }; |
| 2061 | pub const avrxmega1 = Cpu{ | |
| 2062 | pub const avrxmega1 = CpuModel{ | |
| 2062 | 2063 | .name = "avrxmega1", |
| 2063 | 2064 | .llvm_name = "avrxmega1", |
| 2064 | 2065 | .features = featureSet(&[_]Feature{ |
| 2065 | 2066 | .xmega, |
| 2066 | 2067 | }), |
| 2067 | 2068 | }; |
| 2068 | pub const avrxmega2 = Cpu{ | |
| 2069 | pub const avrxmega2 = CpuModel{ | |
| 2069 | 2070 | .name = "avrxmega2", |
| 2070 | 2071 | .llvm_name = "avrxmega2", |
| 2071 | 2072 | .features = featureSet(&[_]Feature{ |
| 2072 | 2073 | .xmega, |
| 2073 | 2074 | }), |
| 2074 | 2075 | }; |
| 2075 | pub const avrxmega3 = Cpu{ | |
| 2076 | pub const avrxmega3 = CpuModel{ | |
| 2076 | 2077 | .name = "avrxmega3", |
| 2077 | 2078 | .llvm_name = "avrxmega3", |
| 2078 | 2079 | .features = featureSet(&[_]Feature{ |
| 2079 | 2080 | .xmega, |
| 2080 | 2081 | }), |
| 2081 | 2082 | }; |
| 2082 | pub const avrxmega4 = Cpu{ | |
| 2083 | pub const avrxmega4 = CpuModel{ | |
| 2083 | 2084 | .name = "avrxmega4", |
| 2084 | 2085 | .llvm_name = "avrxmega4", |
| 2085 | 2086 | .features = featureSet(&[_]Feature{ |
| 2086 | 2087 | .xmega, |
| 2087 | 2088 | }), |
| 2088 | 2089 | }; |
| 2089 | pub const avrxmega5 = Cpu{ | |
| 2090 | pub const avrxmega5 = CpuModel{ | |
| 2090 | 2091 | .name = "avrxmega5", |
| 2091 | 2092 | .llvm_name = "avrxmega5", |
| 2092 | 2093 | .features = featureSet(&[_]Feature{ |
| 2093 | 2094 | .xmega, |
| 2094 | 2095 | }), |
| 2095 | 2096 | }; |
| 2096 | pub const avrxmega6 = Cpu{ | |
| 2097 | pub const avrxmega6 = CpuModel{ | |
| 2097 | 2098 | .name = "avrxmega6", |
| 2098 | 2099 | .llvm_name = "avrxmega6", |
| 2099 | 2100 | .features = featureSet(&[_]Feature{ |
| 2100 | 2101 | .xmega, |
| 2101 | 2102 | }), |
| 2102 | 2103 | }; |
| 2103 | pub const avrxmega7 = Cpu{ | |
| 2104 | pub const avrxmega7 = CpuModel{ | |
| 2104 | 2105 | .name = "avrxmega7", |
| 2105 | 2106 | .llvm_name = "avrxmega7", |
| 2106 | 2107 | .features = featureSet(&[_]Feature{ |
| 2107 | 2108 | .xmega, |
| 2108 | 2109 | }), |
| 2109 | 2110 | }; |
| 2110 | pub const m3000 = Cpu{ | |
| 2111 | pub const m3000 = CpuModel{ | |
| 2111 | 2112 | .name = "m3000", |
| 2112 | 2113 | .llvm_name = "m3000", |
| 2113 | 2114 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -2119,7 +2120,7 @@ pub const cpu = struct { |
| 2119 | 2120 | /// All avr CPUs, sorted alphabetically by name. |
| 2120 | 2121 | /// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1 |
| 2121 | 2122 | /// compiler has inefficient memory and CPU usage, affecting build times. |
| 2122 | pub const all_cpus = &[_]*const Cpu{ | |
| 2123 | pub const all_cpus = &[_]*const CpuModel{ | |
| 2123 | 2124 | &cpu.at43usb320, |
| 2124 | 2125 | &cpu.at43usb355, |
| 2125 | 2126 | &cpu.at76c711, |
lib/std/target/bpf.zig+11-10| ... | ... | @@ -1,5 +1,6 @@ |
| 1 | 1 | const std = @import("../std.zig"); |
| 2 | const Cpu = std.Target.Cpu; | |
| 2 | const CpuFeature = std.Target.Cpu.Feature; | |
| 3 | const CpuModel = std.Target.Cpu.Model; | |
| 3 | 4 | |
| 4 | 5 | pub const Feature = enum { |
| 5 | 6 | alu32, |
| ... | ... | @@ -7,12 +8,12 @@ pub const Feature = enum { |
| 7 | 8 | dwarfris, |
| 8 | 9 | }; |
| 9 | 10 | |
| 10 | pub usingnamespace Cpu.Feature.feature_set_fns(Feature); | |
| 11 | pub usingnamespace CpuFeature.feature_set_fns(Feature); | |
| 11 | 12 | |
| 12 | 13 | pub const all_features = blk: { |
| 13 | 14 | const len = @typeInfo(Feature).Enum.fields.len; |
| 14 | std.debug.assert(len <= Cpu.Feature.Set.needed_bit_count); | |
| 15 | var result: [len]Cpu.Feature = undefined; | |
| 15 | std.debug.assert(len <= CpuFeature.Set.needed_bit_count); | |
| 16 | var result: [len]CpuFeature = undefined; | |
| 16 | 17 | result[@enumToInt(Feature.alu32)] = .{ |
| 17 | 18 | .llvm_name = "alu32", |
| 18 | 19 | .description = "Enable ALU32 instructions", |
| ... | ... | @@ -37,27 +38,27 @@ pub const all_features = blk: { |
| 37 | 38 | }; |
| 38 | 39 | |
| 39 | 40 | pub const cpu = struct { |
| 40 | pub const generic = Cpu{ | |
| 41 | pub const generic = CpuModel{ | |
| 41 | 42 | .name = "generic", |
| 42 | 43 | .llvm_name = "generic", |
| 43 | 44 | .features = featureSet(&[_]Feature{}), |
| 44 | 45 | }; |
| 45 | pub const probe = Cpu{ | |
| 46 | pub const probe = CpuModel{ | |
| 46 | 47 | .name = "probe", |
| 47 | 48 | .llvm_name = "probe", |
| 48 | 49 | .features = featureSet(&[_]Feature{}), |
| 49 | 50 | }; |
| 50 | pub const v1 = Cpu{ | |
| 51 | pub const v1 = CpuModel{ | |
| 51 | 52 | .name = "v1", |
| 52 | 53 | .llvm_name = "v1", |
| 53 | 54 | .features = featureSet(&[_]Feature{}), |
| 54 | 55 | }; |
| 55 | pub const v2 = Cpu{ | |
| 56 | pub const v2 = CpuModel{ | |
| 56 | 57 | .name = "v2", |
| 57 | 58 | .llvm_name = "v2", |
| 58 | 59 | .features = featureSet(&[_]Feature{}), |
| 59 | 60 | }; |
| 60 | pub const v3 = Cpu{ | |
| 61 | pub const v3 = CpuModel{ | |
| 61 | 62 | .name = "v3", |
| 62 | 63 | .llvm_name = "v3", |
| 63 | 64 | .features = featureSet(&[_]Feature{}), |
| ... | ... | @@ -67,7 +68,7 @@ pub const cpu = struct { |
| 67 | 68 | /// All bpf CPUs, sorted alphabetically by name. |
| 68 | 69 | /// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1 |
| 69 | 70 | /// compiler has inefficient memory and CPU usage, affecting build times. |
| 70 | pub const all_cpus = &[_]*const Cpu{ | |
| 71 | pub const all_cpus = &[_]*const CpuModel{ | |
| 71 | 72 | &cpu.generic, |
| 72 | 73 | &cpu.probe, |
| 73 | 74 | &cpu.v1, |
lib/std/target/hexagon.zig+13-12| ... | ... | @@ -1,5 +1,6 @@ |
| 1 | 1 | const std = @import("../std.zig"); |
| 2 | const Cpu = std.Target.Cpu; | |
| 2 | const CpuFeature = std.Target.Cpu.Feature; | |
| 3 | const CpuModel = std.Target.Cpu.Model; | |
| 3 | 4 | |
| 4 | 5 | pub const Feature = enum { |
| 5 | 6 | duplex, |
| ... | ... | @@ -28,12 +29,12 @@ pub const Feature = enum { |
| 28 | 29 | zreg, |
| 29 | 30 | }; |
| 30 | 31 | |
| 31 | pub usingnamespace Cpu.Feature.feature_set_fns(Feature); | |
| 32 | pub usingnamespace CpuFeature.feature_set_fns(Feature); | |
| 32 | 33 | |
| 33 | 34 | pub const all_features = blk: { |
| 34 | 35 | const len = @typeInfo(Feature).Enum.fields.len; |
| 35 | std.debug.assert(len <= Cpu.Feature.Set.needed_bit_count); | |
| 36 | var result: [len]Cpu.Feature = undefined; | |
| 36 | std.debug.assert(len <= CpuFeature.Set.needed_bit_count); | |
| 37 | var result: [len]CpuFeature = undefined; | |
| 37 | 38 | result[@enumToInt(Feature.duplex)] = .{ |
| 38 | 39 | .llvm_name = "duplex", |
| 39 | 40 | .description = "Enable generation of duplex instruction", |
| ... | ... | @@ -186,7 +187,7 @@ pub const all_features = blk: { |
| 186 | 187 | }; |
| 187 | 188 | |
| 188 | 189 | pub const cpu = struct { |
| 189 | pub const generic = Cpu{ | |
| 190 | pub const generic = CpuModel{ | |
| 190 | 191 | .name = "generic", |
| 191 | 192 | .llvm_name = "generic", |
| 192 | 193 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -201,7 +202,7 @@ pub const cpu = struct { |
| 201 | 202 | .v60, |
| 202 | 203 | }), |
| 203 | 204 | }; |
| 204 | pub const hexagonv5 = Cpu{ | |
| 205 | pub const hexagonv5 = CpuModel{ | |
| 205 | 206 | .name = "hexagonv5", |
| 206 | 207 | .llvm_name = "hexagonv5", |
| 207 | 208 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -214,7 +215,7 @@ pub const cpu = struct { |
| 214 | 215 | .v5, |
| 215 | 216 | }), |
| 216 | 217 | }; |
| 217 | pub const hexagonv55 = Cpu{ | |
| 218 | pub const hexagonv55 = CpuModel{ | |
| 218 | 219 | .name = "hexagonv55", |
| 219 | 220 | .llvm_name = "hexagonv55", |
| 220 | 221 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -228,7 +229,7 @@ pub const cpu = struct { |
| 228 | 229 | .v55, |
| 229 | 230 | }), |
| 230 | 231 | }; |
| 231 | pub const hexagonv60 = Cpu{ | |
| 232 | pub const hexagonv60 = CpuModel{ | |
| 232 | 233 | .name = "hexagonv60", |
| 233 | 234 | .llvm_name = "hexagonv60", |
| 234 | 235 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -243,7 +244,7 @@ pub const cpu = struct { |
| 243 | 244 | .v60, |
| 244 | 245 | }), |
| 245 | 246 | }; |
| 246 | pub const hexagonv62 = Cpu{ | |
| 247 | pub const hexagonv62 = CpuModel{ | |
| 247 | 248 | .name = "hexagonv62", |
| 248 | 249 | .llvm_name = "hexagonv62", |
| 249 | 250 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -259,7 +260,7 @@ pub const cpu = struct { |
| 259 | 260 | .v62, |
| 260 | 261 | }), |
| 261 | 262 | }; |
| 262 | pub const hexagonv65 = Cpu{ | |
| 263 | pub const hexagonv65 = CpuModel{ | |
| 263 | 264 | .name = "hexagonv65", |
| 264 | 265 | .llvm_name = "hexagonv65", |
| 265 | 266 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -277,7 +278,7 @@ pub const cpu = struct { |
| 277 | 278 | .v65, |
| 278 | 279 | }), |
| 279 | 280 | }; |
| 280 | pub const hexagonv66 = Cpu{ | |
| 281 | pub const hexagonv66 = CpuModel{ | |
| 281 | 282 | .name = "hexagonv66", |
| 282 | 283 | .llvm_name = "hexagonv66", |
| 283 | 284 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -301,7 +302,7 @@ pub const cpu = struct { |
| 301 | 302 | /// All hexagon CPUs, sorted alphabetically by name. |
| 302 | 303 | /// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1 |
| 303 | 304 | /// compiler has inefficient memory and CPU usage, affecting build times. |
| 304 | pub const all_cpus = &[_]*const Cpu{ | |
| 305 | pub const all_cpus = &[_]*const CpuModel{ | |
| 305 | 306 | &cpu.generic, |
| 306 | 307 | &cpu.hexagonv5, |
| 307 | 308 | &cpu.hexagonv55, |
lib/std/target/mips.zig+23-22| ... | ... | @@ -1,5 +1,6 @@ |
| 1 | 1 | const std = @import("../std.zig"); |
| 2 | const Cpu = std.Target.Cpu; | |
| 2 | const CpuFeature = std.Target.Cpu.Feature; | |
| 3 | const CpuModel = std.Target.Cpu.Model; | |
| 3 | 4 | |
| 4 | 5 | pub const Feature = enum { |
| 5 | 6 | abs2008, |
| ... | ... | @@ -53,12 +54,12 @@ pub const Feature = enum { |
| 53 | 54 | virt, |
| 54 | 55 | }; |
| 55 | 56 | |
| 56 | pub usingnamespace Cpu.Feature.feature_set_fns(Feature); | |
| 57 | pub usingnamespace CpuFeature.feature_set_fns(Feature); | |
| 57 | 58 | |
| 58 | 59 | pub const all_features = blk: { |
| 59 | 60 | const len = @typeInfo(Feature).Enum.fields.len; |
| 60 | std.debug.assert(len <= Cpu.Feature.Set.needed_bit_count); | |
| 61 | var result: [len]Cpu.Feature = undefined; | |
| 61 | std.debug.assert(len <= CpuFeature.Set.needed_bit_count); | |
| 62 | var result: [len]CpuFeature = undefined; | |
| 62 | 63 | result[@enumToInt(Feature.abs2008)] = .{ |
| 63 | 64 | .llvm_name = "abs2008", |
| 64 | 65 | .description = "Disable IEEE 754-2008 abs.fmt mode", |
| ... | ... | @@ -372,112 +373,112 @@ pub const all_features = blk: { |
| 372 | 373 | }; |
| 373 | 374 | |
| 374 | 375 | pub const cpu = struct { |
| 375 | pub const mips1 = Cpu{ | |
| 376 | pub const mips1 = CpuModel{ | |
| 376 | 377 | .name = "mips1", |
| 377 | 378 | .llvm_name = "mips1", |
| 378 | 379 | .features = featureSet(&[_]Feature{ |
| 379 | 380 | .mips1, |
| 380 | 381 | }), |
| 381 | 382 | }; |
| 382 | pub const mips2 = Cpu{ | |
| 383 | pub const mips2 = CpuModel{ | |
| 383 | 384 | .name = "mips2", |
| 384 | 385 | .llvm_name = "mips2", |
| 385 | 386 | .features = featureSet(&[_]Feature{ |
| 386 | 387 | .mips2, |
| 387 | 388 | }), |
| 388 | 389 | }; |
| 389 | pub const mips3 = Cpu{ | |
| 390 | pub const mips3 = CpuModel{ | |
| 390 | 391 | .name = "mips3", |
| 391 | 392 | .llvm_name = "mips3", |
| 392 | 393 | .features = featureSet(&[_]Feature{ |
| 393 | 394 | .mips3, |
| 394 | 395 | }), |
| 395 | 396 | }; |
| 396 | pub const mips32 = Cpu{ | |
| 397 | pub const mips32 = CpuModel{ | |
| 397 | 398 | .name = "mips32", |
| 398 | 399 | .llvm_name = "mips32", |
| 399 | 400 | .features = featureSet(&[_]Feature{ |
| 400 | 401 | .mips32, |
| 401 | 402 | }), |
| 402 | 403 | }; |
| 403 | pub const mips32r2 = Cpu{ | |
| 404 | pub const mips32r2 = CpuModel{ | |
| 404 | 405 | .name = "mips32r2", |
| 405 | 406 | .llvm_name = "mips32r2", |
| 406 | 407 | .features = featureSet(&[_]Feature{ |
| 407 | 408 | .mips32r2, |
| 408 | 409 | }), |
| 409 | 410 | }; |
| 410 | pub const mips32r3 = Cpu{ | |
| 411 | pub const mips32r3 = CpuModel{ | |
| 411 | 412 | .name = "mips32r3", |
| 412 | 413 | .llvm_name = "mips32r3", |
| 413 | 414 | .features = featureSet(&[_]Feature{ |
| 414 | 415 | .mips32r3, |
| 415 | 416 | }), |
| 416 | 417 | }; |
| 417 | pub const mips32r5 = Cpu{ | |
| 418 | pub const mips32r5 = CpuModel{ | |
| 418 | 419 | .name = "mips32r5", |
| 419 | 420 | .llvm_name = "mips32r5", |
| 420 | 421 | .features = featureSet(&[_]Feature{ |
| 421 | 422 | .mips32r5, |
| 422 | 423 | }), |
| 423 | 424 | }; |
| 424 | pub const mips32r6 = Cpu{ | |
| 425 | pub const mips32r6 = CpuModel{ | |
| 425 | 426 | .name = "mips32r6", |
| 426 | 427 | .llvm_name = "mips32r6", |
| 427 | 428 | .features = featureSet(&[_]Feature{ |
| 428 | 429 | .mips32r6, |
| 429 | 430 | }), |
| 430 | 431 | }; |
| 431 | pub const mips4 = Cpu{ | |
| 432 | pub const mips4 = CpuModel{ | |
| 432 | 433 | .name = "mips4", |
| 433 | 434 | .llvm_name = "mips4", |
| 434 | 435 | .features = featureSet(&[_]Feature{ |
| 435 | 436 | .mips4, |
| 436 | 437 | }), |
| 437 | 438 | }; |
| 438 | pub const mips5 = Cpu{ | |
| 439 | pub const mips5 = CpuModel{ | |
| 439 | 440 | .name = "mips5", |
| 440 | 441 | .llvm_name = "mips5", |
| 441 | 442 | .features = featureSet(&[_]Feature{ |
| 442 | 443 | .mips5, |
| 443 | 444 | }), |
| 444 | 445 | }; |
| 445 | pub const mips64 = Cpu{ | |
| 446 | pub const mips64 = CpuModel{ | |
| 446 | 447 | .name = "mips64", |
| 447 | 448 | .llvm_name = "mips64", |
| 448 | 449 | .features = featureSet(&[_]Feature{ |
| 449 | 450 | .mips64, |
| 450 | 451 | }), |
| 451 | 452 | }; |
| 452 | pub const mips64r2 = Cpu{ | |
| 453 | pub const mips64r2 = CpuModel{ | |
| 453 | 454 | .name = "mips64r2", |
| 454 | 455 | .llvm_name = "mips64r2", |
| 455 | 456 | .features = featureSet(&[_]Feature{ |
| 456 | 457 | .mips64r2, |
| 457 | 458 | }), |
| 458 | 459 | }; |
| 459 | pub const mips64r3 = Cpu{ | |
| 460 | pub const mips64r3 = CpuModel{ | |
| 460 | 461 | .name = "mips64r3", |
| 461 | 462 | .llvm_name = "mips64r3", |
| 462 | 463 | .features = featureSet(&[_]Feature{ |
| 463 | 464 | .mips64r3, |
| 464 | 465 | }), |
| 465 | 466 | }; |
| 466 | pub const mips64r5 = Cpu{ | |
| 467 | pub const mips64r5 = CpuModel{ | |
| 467 | 468 | .name = "mips64r5", |
| 468 | 469 | .llvm_name = "mips64r5", |
| 469 | 470 | .features = featureSet(&[_]Feature{ |
| 470 | 471 | .mips64r5, |
| 471 | 472 | }), |
| 472 | 473 | }; |
| 473 | pub const mips64r6 = Cpu{ | |
| 474 | pub const mips64r6 = CpuModel{ | |
| 474 | 475 | .name = "mips64r6", |
| 475 | 476 | .llvm_name = "mips64r6", |
| 476 | 477 | .features = featureSet(&[_]Feature{ |
| 477 | 478 | .mips64r6, |
| 478 | 479 | }), |
| 479 | 480 | }; |
| 480 | pub const octeon = Cpu{ | |
| 481 | pub const octeon = CpuModel{ | |
| 481 | 482 | .name = "octeon", |
| 482 | 483 | .llvm_name = "octeon", |
| 483 | 484 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -485,7 +486,7 @@ pub const cpu = struct { |
| 485 | 486 | .mips64r2, |
| 486 | 487 | }), |
| 487 | 488 | }; |
| 488 | pub const p5600 = Cpu{ | |
| 489 | pub const p5600 = CpuModel{ | |
| 489 | 490 | .name = "p5600", |
| 490 | 491 | .llvm_name = "p5600", |
| 491 | 492 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -497,7 +498,7 @@ pub const cpu = struct { |
| 497 | 498 | /// All mips CPUs, sorted alphabetically by name. |
| 498 | 499 | /// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1 |
| 499 | 500 | /// compiler has inefficient memory and CPU usage, affecting build times. |
| 500 | pub const all_cpus = &[_]*const Cpu{ | |
| 501 | pub const all_cpus = &[_]*const CpuModel{ | |
| 501 | 502 | &cpu.mips1, |
| 502 | 503 | &cpu.mips2, |
| 503 | 504 | &cpu.mips3, |
lib/std/target/msp430.zig+9-8| ... | ... | @@ -1,5 +1,6 @@ |
| 1 | 1 | const std = @import("../std.zig"); |
| 2 | const Cpu = std.Target.Cpu; | |
| 2 | const CpuFeature = std.Target.Cpu.Feature; | |
| 3 | const CpuModel = std.Target.Cpu.Model; | |
| 3 | 4 | |
| 4 | 5 | pub const Feature = enum { |
| 5 | 6 | ext, |
| ... | ... | @@ -8,12 +9,12 @@ pub const Feature = enum { |
| 8 | 9 | hwmultf5, |
| 9 | 10 | }; |
| 10 | 11 | |
| 11 | pub usingnamespace Cpu.Feature.feature_set_fns(Feature); | |
| 12 | pub usingnamespace CpuFeature.feature_set_fns(Feature); | |
| 12 | 13 | |
| 13 | 14 | pub const all_features = blk: { |
| 14 | 15 | const len = @typeInfo(Feature).Enum.fields.len; |
| 15 | std.debug.assert(len <= Cpu.Feature.Set.needed_bit_count); | |
| 16 | var result: [len]Cpu.Feature = undefined; | |
| 16 | std.debug.assert(len <= CpuFeature.Set.needed_bit_count); | |
| 17 | var result: [len]CpuFeature = undefined; | |
| 17 | 18 | result[@enumToInt(Feature.ext)] = .{ |
| 18 | 19 | .llvm_name = "ext", |
| 19 | 20 | .description = "Enable MSP430-X extensions", |
| ... | ... | @@ -43,17 +44,17 @@ pub const all_features = blk: { |
| 43 | 44 | }; |
| 44 | 45 | |
| 45 | 46 | pub const cpu = struct { |
| 46 | pub const generic = Cpu{ | |
| 47 | pub const generic = CpuModel{ | |
| 47 | 48 | .name = "generic", |
| 48 | 49 | .llvm_name = "generic", |
| 49 | 50 | .features = featureSet(&[_]Feature{}), |
| 50 | 51 | }; |
| 51 | pub const msp430 = Cpu{ | |
| 52 | pub const msp430 = CpuModel{ | |
| 52 | 53 | .name = "msp430", |
| 53 | 54 | .llvm_name = "msp430", |
| 54 | 55 | .features = featureSet(&[_]Feature{}), |
| 55 | 56 | }; |
| 56 | pub const msp430x = Cpu{ | |
| 57 | pub const msp430x = CpuModel{ | |
| 57 | 58 | .name = "msp430x", |
| 58 | 59 | .llvm_name = "msp430x", |
| 59 | 60 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -65,7 +66,7 @@ pub const cpu = struct { |
| 65 | 66 | /// All msp430 CPUs, sorted alphabetically by name. |
| 66 | 67 | /// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1 |
| 67 | 68 | /// compiler has inefficient memory and CPU usage, affecting build times. |
| 68 | pub const all_cpus = &[_]*const Cpu{ | |
| 69 | pub const all_cpus = &[_]*const CpuModel{ | |
| 69 | 70 | &cpu.generic, |
| 70 | 71 | &cpu.msp430, |
| 71 | 72 | &cpu.msp430x, |
lib/std/target/nvptx.zig+21-20| ... | ... | @@ -1,5 +1,6 @@ |
| 1 | 1 | const std = @import("../std.zig"); |
| 2 | const Cpu = std.Target.Cpu; | |
| 2 | const CpuFeature = std.Target.Cpu.Feature; | |
| 3 | const CpuModel = std.Target.Cpu.Model; | |
| 3 | 4 | |
| 4 | 5 | pub const Feature = enum { |
| 5 | 6 | ptx32, |
| ... | ... | @@ -29,12 +30,12 @@ pub const Feature = enum { |
| 29 | 30 | sm_75, |
| 30 | 31 | }; |
| 31 | 32 | |
| 32 | pub usingnamespace Cpu.Feature.feature_set_fns(Feature); | |
| 33 | pub usingnamespace CpuFeature.feature_set_fns(Feature); | |
| 33 | 34 | |
| 34 | 35 | pub const all_features = blk: { |
| 35 | 36 | const len = @typeInfo(Feature).Enum.fields.len; |
| 36 | std.debug.assert(len <= Cpu.Feature.Set.needed_bit_count); | |
| 37 | var result: [len]Cpu.Feature = undefined; | |
| 37 | std.debug.assert(len <= CpuFeature.Set.needed_bit_count); | |
| 38 | var result: [len]CpuFeature = undefined; | |
| 38 | 39 | result[@enumToInt(Feature.ptx32)] = .{ |
| 39 | 40 | .llvm_name = "ptx32", |
| 40 | 41 | .description = "Use PTX version 3.2", |
| ... | ... | @@ -169,28 +170,28 @@ pub const all_features = blk: { |
| 169 | 170 | }; |
| 170 | 171 | |
| 171 | 172 | pub const cpu = struct { |
| 172 | pub const sm_20 = Cpu{ | |
| 173 | pub const sm_20 = CpuModel{ | |
| 173 | 174 | .name = "sm_20", |
| 174 | 175 | .llvm_name = "sm_20", |
| 175 | 176 | .features = featureSet(&[_]Feature{ |
| 176 | 177 | .sm_20, |
| 177 | 178 | }), |
| 178 | 179 | }; |
| 179 | pub const sm_21 = Cpu{ | |
| 180 | pub const sm_21 = CpuModel{ | |
| 180 | 181 | .name = "sm_21", |
| 181 | 182 | .llvm_name = "sm_21", |
| 182 | 183 | .features = featureSet(&[_]Feature{ |
| 183 | 184 | .sm_21, |
| 184 | 185 | }), |
| 185 | 186 | }; |
| 186 | pub const sm_30 = Cpu{ | |
| 187 | pub const sm_30 = CpuModel{ | |
| 187 | 188 | .name = "sm_30", |
| 188 | 189 | .llvm_name = "sm_30", |
| 189 | 190 | .features = featureSet(&[_]Feature{ |
| 190 | 191 | .sm_30, |
| 191 | 192 | }), |
| 192 | 193 | }; |
| 193 | pub const sm_32 = Cpu{ | |
| 194 | pub const sm_32 = CpuModel{ | |
| 194 | 195 | .name = "sm_32", |
| 195 | 196 | .llvm_name = "sm_32", |
| 196 | 197 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -198,14 +199,14 @@ pub const cpu = struct { |
| 198 | 199 | .sm_32, |
| 199 | 200 | }), |
| 200 | 201 | }; |
| 201 | pub const sm_35 = Cpu{ | |
| 202 | pub const sm_35 = CpuModel{ | |
| 202 | 203 | .name = "sm_35", |
| 203 | 204 | .llvm_name = "sm_35", |
| 204 | 205 | .features = featureSet(&[_]Feature{ |
| 205 | 206 | .sm_35, |
| 206 | 207 | }), |
| 207 | 208 | }; |
| 208 | pub const sm_37 = Cpu{ | |
| 209 | pub const sm_37 = CpuModel{ | |
| 209 | 210 | .name = "sm_37", |
| 210 | 211 | .llvm_name = "sm_37", |
| 211 | 212 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -213,7 +214,7 @@ pub const cpu = struct { |
| 213 | 214 | .sm_37, |
| 214 | 215 | }), |
| 215 | 216 | }; |
| 216 | pub const sm_50 = Cpu{ | |
| 217 | pub const sm_50 = CpuModel{ | |
| 217 | 218 | .name = "sm_50", |
| 218 | 219 | .llvm_name = "sm_50", |
| 219 | 220 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -221,7 +222,7 @@ pub const cpu = struct { |
| 221 | 222 | .sm_50, |
| 222 | 223 | }), |
| 223 | 224 | }; |
| 224 | pub const sm_52 = Cpu{ | |
| 225 | pub const sm_52 = CpuModel{ | |
| 225 | 226 | .name = "sm_52", |
| 226 | 227 | .llvm_name = "sm_52", |
| 227 | 228 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -229,7 +230,7 @@ pub const cpu = struct { |
| 229 | 230 | .sm_52, |
| 230 | 231 | }), |
| 231 | 232 | }; |
| 232 | pub const sm_53 = Cpu{ | |
| 233 | pub const sm_53 = CpuModel{ | |
| 233 | 234 | .name = "sm_53", |
| 234 | 235 | .llvm_name = "sm_53", |
| 235 | 236 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -237,7 +238,7 @@ pub const cpu = struct { |
| 237 | 238 | .sm_53, |
| 238 | 239 | }), |
| 239 | 240 | }; |
| 240 | pub const sm_60 = Cpu{ | |
| 241 | pub const sm_60 = CpuModel{ | |
| 241 | 242 | .name = "sm_60", |
| 242 | 243 | .llvm_name = "sm_60", |
| 243 | 244 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -245,7 +246,7 @@ pub const cpu = struct { |
| 245 | 246 | .sm_60, |
| 246 | 247 | }), |
| 247 | 248 | }; |
| 248 | pub const sm_61 = Cpu{ | |
| 249 | pub const sm_61 = CpuModel{ | |
| 249 | 250 | .name = "sm_61", |
| 250 | 251 | .llvm_name = "sm_61", |
| 251 | 252 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -253,7 +254,7 @@ pub const cpu = struct { |
| 253 | 254 | .sm_61, |
| 254 | 255 | }), |
| 255 | 256 | }; |
| 256 | pub const sm_62 = Cpu{ | |
| 257 | pub const sm_62 = CpuModel{ | |
| 257 | 258 | .name = "sm_62", |
| 258 | 259 | .llvm_name = "sm_62", |
| 259 | 260 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -261,7 +262,7 @@ pub const cpu = struct { |
| 261 | 262 | .sm_62, |
| 262 | 263 | }), |
| 263 | 264 | }; |
| 264 | pub const sm_70 = Cpu{ | |
| 265 | pub const sm_70 = CpuModel{ | |
| 265 | 266 | .name = "sm_70", |
| 266 | 267 | .llvm_name = "sm_70", |
| 267 | 268 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -269,7 +270,7 @@ pub const cpu = struct { |
| 269 | 270 | .sm_70, |
| 270 | 271 | }), |
| 271 | 272 | }; |
| 272 | pub const sm_72 = Cpu{ | |
| 273 | pub const sm_72 = CpuModel{ | |
| 273 | 274 | .name = "sm_72", |
| 274 | 275 | .llvm_name = "sm_72", |
| 275 | 276 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -277,7 +278,7 @@ pub const cpu = struct { |
| 277 | 278 | .sm_72, |
| 278 | 279 | }), |
| 279 | 280 | }; |
| 280 | pub const sm_75 = Cpu{ | |
| 281 | pub const sm_75 = CpuModel{ | |
| 281 | 282 | .name = "sm_75", |
| 282 | 283 | .llvm_name = "sm_75", |
| 283 | 284 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -290,7 +291,7 @@ pub const cpu = struct { |
| 290 | 291 | /// All nvptx CPUs, sorted alphabetically by name. |
| 291 | 292 | /// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1 |
| 292 | 293 | /// compiler has inefficient memory and CPU usage, affecting build times. |
| 293 | pub const all_cpus = &[_]*const Cpu{ | |
| 294 | pub const all_cpus = &[_]*const CpuModel{ | |
| 294 | 295 | &cpu.sm_20, |
| 295 | 296 | &cpu.sm_21, |
| 296 | 297 | &cpu.sm_30, |
lib/std/target/powerpc.zig+43-42| ... | ... | @@ -1,5 +1,6 @@ |
| 1 | 1 | const std = @import("../std.zig"); |
| 2 | const Cpu = std.Target.Cpu; | |
| 2 | const CpuFeature = std.Target.Cpu.Feature; | |
| 3 | const CpuModel = std.Target.Cpu.Model; | |
| 3 | 4 | |
| 4 | 5 | pub const Feature = enum { |
| 5 | 6 | @"64bit", |
| ... | ... | @@ -55,12 +56,12 @@ pub const Feature = enum { |
| 55 | 56 | vsx, |
| 56 | 57 | }; |
| 57 | 58 | |
| 58 | pub usingnamespace Cpu.Feature.feature_set_fns(Feature); | |
| 59 | pub usingnamespace CpuFeature.feature_set_fns(Feature); | |
| 59 | 60 | |
| 60 | 61 | pub const all_features = blk: { |
| 61 | 62 | const len = @typeInfo(Feature).Enum.fields.len; |
| 62 | std.debug.assert(len <= Cpu.Feature.Set.needed_bit_count); | |
| 63 | var result: [len]Cpu.Feature = undefined; | |
| 63 | std.debug.assert(len <= CpuFeature.Set.needed_bit_count); | |
| 64 | var result: [len]CpuFeature = undefined; | |
| 64 | 65 | result[@enumToInt(Feature.@"64bit")] = .{ |
| 65 | 66 | .llvm_name = "64bit", |
| 66 | 67 | .description = "Enable 64-bit instructions", |
| ... | ... | @@ -377,7 +378,7 @@ pub const all_features = blk: { |
| 377 | 378 | }; |
| 378 | 379 | |
| 379 | 380 | pub const cpu = struct { |
| 380 | pub const @"440" = Cpu{ | |
| 381 | pub const @"440" = CpuModel{ | |
| 381 | 382 | .name = "440", |
| 382 | 383 | .llvm_name = "440", |
| 383 | 384 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -389,7 +390,7 @@ pub const cpu = struct { |
| 389 | 390 | .msync, |
| 390 | 391 | }), |
| 391 | 392 | }; |
| 392 | pub const @"450" = Cpu{ | |
| 393 | pub const @"450" = CpuModel{ | |
| 393 | 394 | .name = "450", |
| 394 | 395 | .llvm_name = "450", |
| 395 | 396 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -401,21 +402,21 @@ pub const cpu = struct { |
| 401 | 402 | .msync, |
| 402 | 403 | }), |
| 403 | 404 | }; |
| 404 | pub const @"601" = Cpu{ | |
| 405 | pub const @"601" = CpuModel{ | |
| 405 | 406 | .name = "601", |
| 406 | 407 | .llvm_name = "601", |
| 407 | 408 | .features = featureSet(&[_]Feature{ |
| 408 | 409 | .fpu, |
| 409 | 410 | }), |
| 410 | 411 | }; |
| 411 | pub const @"602" = Cpu{ | |
| 412 | pub const @"602" = CpuModel{ | |
| 412 | 413 | .name = "602", |
| 413 | 414 | .llvm_name = "602", |
| 414 | 415 | .features = featureSet(&[_]Feature{ |
| 415 | 416 | .fpu, |
| 416 | 417 | }), |
| 417 | 418 | }; |
| 418 | pub const @"603" = Cpu{ | |
| 419 | pub const @"603" = CpuModel{ | |
| 419 | 420 | .name = "603", |
| 420 | 421 | .llvm_name = "603", |
| 421 | 422 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -423,7 +424,7 @@ pub const cpu = struct { |
| 423 | 424 | .frsqrte, |
| 424 | 425 | }), |
| 425 | 426 | }; |
| 426 | pub const @"603e" = Cpu{ | |
| 427 | pub const @"603e" = CpuModel{ | |
| 427 | 428 | .name = "603e", |
| 428 | 429 | .llvm_name = "603e", |
| 429 | 430 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -431,7 +432,7 @@ pub const cpu = struct { |
| 431 | 432 | .frsqrte, |
| 432 | 433 | }), |
| 433 | 434 | }; |
| 434 | pub const @"603ev" = Cpu{ | |
| 435 | pub const @"603ev" = CpuModel{ | |
| 435 | 436 | .name = "603ev", |
| 436 | 437 | .llvm_name = "603ev", |
| 437 | 438 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -439,7 +440,7 @@ pub const cpu = struct { |
| 439 | 440 | .frsqrte, |
| 440 | 441 | }), |
| 441 | 442 | }; |
| 442 | pub const @"604" = Cpu{ | |
| 443 | pub const @"604" = CpuModel{ | |
| 443 | 444 | .name = "604", |
| 444 | 445 | .llvm_name = "604", |
| 445 | 446 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -447,7 +448,7 @@ pub const cpu = struct { |
| 447 | 448 | .frsqrte, |
| 448 | 449 | }), |
| 449 | 450 | }; |
| 450 | pub const @"604e" = Cpu{ | |
| 451 | pub const @"604e" = CpuModel{ | |
| 451 | 452 | .name = "604e", |
| 452 | 453 | .llvm_name = "604e", |
| 453 | 454 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -455,7 +456,7 @@ pub const cpu = struct { |
| 455 | 456 | .frsqrte, |
| 456 | 457 | }), |
| 457 | 458 | }; |
| 458 | pub const @"620" = Cpu{ | |
| 459 | pub const @"620" = CpuModel{ | |
| 459 | 460 | .name = "620", |
| 460 | 461 | .llvm_name = "620", |
| 461 | 462 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -463,7 +464,7 @@ pub const cpu = struct { |
| 463 | 464 | .frsqrte, |
| 464 | 465 | }), |
| 465 | 466 | }; |
| 466 | pub const @"7400" = Cpu{ | |
| 467 | pub const @"7400" = CpuModel{ | |
| 467 | 468 | .name = "7400", |
| 468 | 469 | .llvm_name = "7400", |
| 469 | 470 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -472,7 +473,7 @@ pub const cpu = struct { |
| 472 | 473 | .frsqrte, |
| 473 | 474 | }), |
| 474 | 475 | }; |
| 475 | pub const @"7450" = Cpu{ | |
| 476 | pub const @"7450" = CpuModel{ | |
| 476 | 477 | .name = "7450", |
| 477 | 478 | .llvm_name = "7450", |
| 478 | 479 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -481,7 +482,7 @@ pub const cpu = struct { |
| 481 | 482 | .frsqrte, |
| 482 | 483 | }), |
| 483 | 484 | }; |
| 484 | pub const @"750" = Cpu{ | |
| 485 | pub const @"750" = CpuModel{ | |
| 485 | 486 | .name = "750", |
| 486 | 487 | .llvm_name = "750", |
| 487 | 488 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -489,7 +490,7 @@ pub const cpu = struct { |
| 489 | 490 | .frsqrte, |
| 490 | 491 | }), |
| 491 | 492 | }; |
| 492 | pub const @"970" = Cpu{ | |
| 493 | pub const @"970" = CpuModel{ | |
| 493 | 494 | .name = "970", |
| 494 | 495 | .llvm_name = "970", |
| 495 | 496 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -502,7 +503,7 @@ pub const cpu = struct { |
| 502 | 503 | .stfiwx, |
| 503 | 504 | }), |
| 504 | 505 | }; |
| 505 | pub const a2 = Cpu{ | |
| 506 | pub const a2 = CpuModel{ | |
| 506 | 507 | .name = "a2", |
| 507 | 508 | .llvm_name = "a2", |
| 508 | 509 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -527,7 +528,7 @@ pub const cpu = struct { |
| 527 | 528 | .stfiwx, |
| 528 | 529 | }), |
| 529 | 530 | }; |
| 530 | pub const a2q = Cpu{ | |
| 531 | pub const a2q = CpuModel{ | |
| 531 | 532 | .name = "a2q", |
| 532 | 533 | .llvm_name = "a2q", |
| 533 | 534 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -553,7 +554,7 @@ pub const cpu = struct { |
| 553 | 554 | .stfiwx, |
| 554 | 555 | }), |
| 555 | 556 | }; |
| 556 | pub const e500 = Cpu{ | |
| 557 | pub const e500 = CpuModel{ | |
| 557 | 558 | .name = "e500", |
| 558 | 559 | .llvm_name = "e500", |
| 559 | 560 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -562,7 +563,7 @@ pub const cpu = struct { |
| 562 | 563 | .isel, |
| 563 | 564 | }), |
| 564 | 565 | }; |
| 565 | pub const e500mc = Cpu{ | |
| 566 | pub const e500mc = CpuModel{ | |
| 566 | 567 | .name = "e500mc", |
| 567 | 568 | .llvm_name = "e500mc", |
| 568 | 569 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -572,7 +573,7 @@ pub const cpu = struct { |
| 572 | 573 | .stfiwx, |
| 573 | 574 | }), |
| 574 | 575 | }; |
| 575 | pub const e5500 = Cpu{ | |
| 576 | pub const e5500 = CpuModel{ | |
| 576 | 577 | .name = "e5500", |
| 577 | 578 | .llvm_name = "e5500", |
| 578 | 579 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -584,7 +585,7 @@ pub const cpu = struct { |
| 584 | 585 | .stfiwx, |
| 585 | 586 | }), |
| 586 | 587 | }; |
| 587 | pub const g3 = Cpu{ | |
| 588 | pub const g3 = CpuModel{ | |
| 588 | 589 | .name = "g3", |
| 589 | 590 | .llvm_name = "g3", |
| 590 | 591 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -592,7 +593,7 @@ pub const cpu = struct { |
| 592 | 593 | .frsqrte, |
| 593 | 594 | }), |
| 594 | 595 | }; |
| 595 | pub const g4 = Cpu{ | |
| 596 | pub const g4 = CpuModel{ | |
| 596 | 597 | .name = "g4", |
| 597 | 598 | .llvm_name = "g4", |
| 598 | 599 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -601,7 +602,7 @@ pub const cpu = struct { |
| 601 | 602 | .frsqrte, |
| 602 | 603 | }), |
| 603 | 604 | }; |
| 604 | pub const @"g4+" = Cpu{ | |
| 605 | pub const @"g4+" = CpuModel{ | |
| 605 | 606 | .name = "g4+", |
| 606 | 607 | .llvm_name = "g4+", |
| 607 | 608 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -610,7 +611,7 @@ pub const cpu = struct { |
| 610 | 611 | .frsqrte, |
| 611 | 612 | }), |
| 612 | 613 | }; |
| 613 | pub const g5 = Cpu{ | |
| 614 | pub const g5 = CpuModel{ | |
| 614 | 615 | .name = "g5", |
| 615 | 616 | .llvm_name = "g5", |
| 616 | 617 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -623,28 +624,28 @@ pub const cpu = struct { |
| 623 | 624 | .stfiwx, |
| 624 | 625 | }), |
| 625 | 626 | }; |
| 626 | pub const generic = Cpu{ | |
| 627 | pub const generic = CpuModel{ | |
| 627 | 628 | .name = "generic", |
| 628 | 629 | .llvm_name = "generic", |
| 629 | 630 | .features = featureSet(&[_]Feature{ |
| 630 | 631 | .hard_float, |
| 631 | 632 | }), |
| 632 | 633 | }; |
| 633 | pub const ppc = Cpu{ | |
| 634 | pub const ppc = CpuModel{ | |
| 634 | 635 | .name = "ppc", |
| 635 | 636 | .llvm_name = "ppc", |
| 636 | 637 | .features = featureSet(&[_]Feature{ |
| 637 | 638 | .hard_float, |
| 638 | 639 | }), |
| 639 | 640 | }; |
| 640 | pub const ppc32 = Cpu{ | |
| 641 | pub const ppc32 = CpuModel{ | |
| 641 | 642 | .name = "ppc32", |
| 642 | 643 | .llvm_name = "ppc32", |
| 643 | 644 | .features = featureSet(&[_]Feature{ |
| 644 | 645 | .hard_float, |
| 645 | 646 | }), |
| 646 | 647 | }; |
| 647 | pub const ppc64 = Cpu{ | |
| 648 | pub const ppc64 = CpuModel{ | |
| 648 | 649 | .name = "ppc64", |
| 649 | 650 | .llvm_name = "ppc64", |
| 650 | 651 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -657,7 +658,7 @@ pub const cpu = struct { |
| 657 | 658 | .stfiwx, |
| 658 | 659 | }), |
| 659 | 660 | }; |
| 660 | pub const ppc64le = Cpu{ | |
| 661 | pub const ppc64le = CpuModel{ | |
| 661 | 662 | .name = "ppc64le", |
| 662 | 663 | .llvm_name = "ppc64le", |
| 663 | 664 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -692,7 +693,7 @@ pub const cpu = struct { |
| 692 | 693 | .vsx, |
| 693 | 694 | }), |
| 694 | 695 | }; |
| 695 | pub const pwr3 = Cpu{ | |
| 696 | pub const pwr3 = CpuModel{ | |
| 696 | 697 | .name = "pwr3", |
| 697 | 698 | .llvm_name = "pwr3", |
| 698 | 699 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -704,7 +705,7 @@ pub const cpu = struct { |
| 704 | 705 | .stfiwx, |
| 705 | 706 | }), |
| 706 | 707 | }; |
| 707 | pub const pwr4 = Cpu{ | |
| 708 | pub const pwr4 = CpuModel{ | |
| 708 | 709 | .name = "pwr4", |
| 709 | 710 | .llvm_name = "pwr4", |
| 710 | 711 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -717,7 +718,7 @@ pub const cpu = struct { |
| 717 | 718 | .stfiwx, |
| 718 | 719 | }), |
| 719 | 720 | }; |
| 720 | pub const pwr5 = Cpu{ | |
| 721 | pub const pwr5 = CpuModel{ | |
| 721 | 722 | .name = "pwr5", |
| 722 | 723 | .llvm_name = "pwr5", |
| 723 | 724 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -732,7 +733,7 @@ pub const cpu = struct { |
| 732 | 733 | .stfiwx, |
| 733 | 734 | }), |
| 734 | 735 | }; |
| 735 | pub const pwr5x = Cpu{ | |
| 736 | pub const pwr5x = CpuModel{ | |
| 736 | 737 | .name = "pwr5x", |
| 737 | 738 | .llvm_name = "pwr5x", |
| 738 | 739 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -748,7 +749,7 @@ pub const cpu = struct { |
| 748 | 749 | .stfiwx, |
| 749 | 750 | }), |
| 750 | 751 | }; |
| 751 | pub const pwr6 = Cpu{ | |
| 752 | pub const pwr6 = CpuModel{ | |
| 752 | 753 | .name = "pwr6", |
| 753 | 754 | .llvm_name = "pwr6", |
| 754 | 755 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -768,7 +769,7 @@ pub const cpu = struct { |
| 768 | 769 | .stfiwx, |
| 769 | 770 | }), |
| 770 | 771 | }; |
| 771 | pub const pwr6x = Cpu{ | |
| 772 | pub const pwr6x = CpuModel{ | |
| 772 | 773 | .name = "pwr6x", |
| 773 | 774 | .llvm_name = "pwr6x", |
| 774 | 775 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -788,7 +789,7 @@ pub const cpu = struct { |
| 788 | 789 | .stfiwx, |
| 789 | 790 | }), |
| 790 | 791 | }; |
| 791 | pub const pwr7 = Cpu{ | |
| 792 | pub const pwr7 = CpuModel{ | |
| 792 | 793 | .name = "pwr7", |
| 793 | 794 | .llvm_name = "pwr7", |
| 794 | 795 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -816,7 +817,7 @@ pub const cpu = struct { |
| 816 | 817 | .vsx, |
| 817 | 818 | }), |
| 818 | 819 | }; |
| 819 | pub const pwr8 = Cpu{ | |
| 820 | pub const pwr8 = CpuModel{ | |
| 820 | 821 | .name = "pwr8", |
| 821 | 822 | .llvm_name = "pwr8", |
| 822 | 823 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -851,7 +852,7 @@ pub const cpu = struct { |
| 851 | 852 | .vsx, |
| 852 | 853 | }), |
| 853 | 854 | }; |
| 854 | pub const pwr9 = Cpu{ | |
| 855 | pub const pwr9 = CpuModel{ | |
| 855 | 856 | .name = "pwr9", |
| 856 | 857 | .llvm_name = "pwr9", |
| 857 | 858 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -897,7 +898,7 @@ pub const cpu = struct { |
| 897 | 898 | /// All powerpc CPUs, sorted alphabetically by name. |
| 898 | 899 | /// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1 |
| 899 | 900 | /// compiler has inefficient memory and CPU usage, affecting build times. |
| 900 | pub const all_cpus = &[_]*const Cpu{ | |
| 901 | pub const all_cpus = &[_]*const CpuModel{ | |
| 901 | 902 | &cpu.@"440", |
| 902 | 903 | &cpu.@"450", |
| 903 | 904 | &cpu.@"601", |
lib/std/target/riscv.zig+10-9| ... | ... | @@ -1,5 +1,6 @@ |
| 1 | 1 | const std = @import("../std.zig"); |
| 2 | const Cpu = std.Target.Cpu; | |
| 2 | const CpuFeature = std.Target.Cpu.Feature; | |
| 3 | const CpuModel = std.Target.Cpu.Model; | |
| 3 | 4 | |
| 4 | 5 | pub const Feature = enum { |
| 5 | 6 | @"64bit", |
| ... | ... | @@ -12,12 +13,12 @@ pub const Feature = enum { |
| 12 | 13 | relax, |
| 13 | 14 | }; |
| 14 | 15 | |
| 15 | pub usingnamespace Cpu.Feature.feature_set_fns(Feature); | |
| 16 | pub usingnamespace CpuFeature.feature_set_fns(Feature); | |
| 16 | 17 | |
| 17 | 18 | pub const all_features = blk: { |
| 18 | 19 | const len = @typeInfo(Feature).Enum.fields.len; |
| 19 | std.debug.assert(len <= Cpu.Feature.Set.needed_bit_count); | |
| 20 | var result: [len]Cpu.Feature = undefined; | |
| 20 | std.debug.assert(len <= CpuFeature.Set.needed_bit_count); | |
| 21 | var result: [len]CpuFeature = undefined; | |
| 21 | 22 | result[@enumToInt(Feature.@"64bit")] = .{ |
| 22 | 23 | .llvm_name = "64bit", |
| 23 | 24 | .description = "Implements RV64", |
| ... | ... | @@ -69,7 +70,7 @@ pub const all_features = blk: { |
| 69 | 70 | }; |
| 70 | 71 | |
| 71 | 72 | pub const cpu = struct { |
| 72 | pub const baseline_rv32 = Cpu{ | |
| 73 | pub const baseline_rv32 = CpuModel{ | |
| 73 | 74 | .name = "baseline_rv32", |
| 74 | 75 | .llvm_name = "generic-rv32", |
| 75 | 76 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -81,7 +82,7 @@ pub const cpu = struct { |
| 81 | 82 | }), |
| 82 | 83 | }; |
| 83 | 84 | |
| 84 | pub const baseline_rv64 = Cpu{ | |
| 85 | pub const baseline_rv64 = CpuModel{ | |
| 85 | 86 | .name = "baseline_rv64", |
| 86 | 87 | .llvm_name = "generic-rv64", |
| 87 | 88 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -94,13 +95,13 @@ pub const cpu = struct { |
| 94 | 95 | }), |
| 95 | 96 | }; |
| 96 | 97 | |
| 97 | pub const generic_rv32 = Cpu{ | |
| 98 | pub const generic_rv32 = CpuModel{ | |
| 98 | 99 | .name = "generic_rv32", |
| 99 | 100 | .llvm_name = "generic-rv32", |
| 100 | 101 | .features = featureSet(&[_]Feature{}), |
| 101 | 102 | }; |
| 102 | 103 | |
| 103 | pub const generic_rv64 = Cpu{ | |
| 104 | pub const generic_rv64 = CpuModel{ | |
| 104 | 105 | .name = "generic_rv64", |
| 105 | 106 | .llvm_name = "generic-rv64", |
| 106 | 107 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -112,7 +113,7 @@ pub const cpu = struct { |
| 112 | 113 | /// All riscv CPUs, sorted alphabetically by name. |
| 113 | 114 | /// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1 |
| 114 | 115 | /// compiler has inefficient memory and CPU usage, affecting build times. |
| 115 | pub const all_cpus = &[_]*const Cpu{ | |
| 116 | pub const all_cpus = &[_]*const CpuModel{ | |
| 116 | 117 | &cpu.baseline_rv32, |
| 117 | 118 | &cpu.baseline_rv64, |
| 118 | 119 | &cpu.generic_rv32, |
lib/std/target/sparc.zig+46-45| ... | ... | @@ -1,5 +1,6 @@ |
| 1 | 1 | const std = @import("../std.zig"); |
| 2 | const Cpu = std.Target.Cpu; | |
| 2 | const CpuFeature = std.Target.Cpu.Feature; | |
| 3 | const CpuModel = std.Target.Cpu.Model; | |
| 3 | 4 | |
| 4 | 5 | pub const Feature = enum { |
| 5 | 6 | deprecated_v8, |
| ... | ... | @@ -23,12 +24,12 @@ pub const Feature = enum { |
| 23 | 24 | vis3, |
| 24 | 25 | }; |
| 25 | 26 | |
| 26 | pub usingnamespace Cpu.Feature.feature_set_fns(Feature); | |
| 27 | pub usingnamespace CpuFeature.feature_set_fns(Feature); | |
| 27 | 28 | |
| 28 | 29 | pub const all_features = blk: { |
| 29 | 30 | const len = @typeInfo(Feature).Enum.fields.len; |
| 30 | std.debug.assert(len <= Cpu.Feature.Set.needed_bit_count); | |
| 31 | var result: [len]Cpu.Feature = undefined; | |
| 31 | std.debug.assert(len <= CpuFeature.Set.needed_bit_count); | |
| 32 | var result: [len]CpuFeature = undefined; | |
| 32 | 33 | result[@enumToInt(Feature.deprecated_v8)] = .{ |
| 33 | 34 | .llvm_name = "deprecated-v8", |
| 34 | 35 | .description = "Enable deprecated V8 instructions in V9 mode", |
| ... | ... | @@ -133,7 +134,7 @@ pub const all_features = blk: { |
| 133 | 134 | }; |
| 134 | 135 | |
| 135 | 136 | pub const cpu = struct { |
| 136 | pub const at697e = Cpu{ | |
| 137 | pub const at697e = CpuModel{ | |
| 137 | 138 | .name = "at697e", |
| 138 | 139 | .llvm_name = "at697e", |
| 139 | 140 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -141,7 +142,7 @@ pub const cpu = struct { |
| 141 | 142 | .leon, |
| 142 | 143 | }), |
| 143 | 144 | }; |
| 144 | pub const at697f = Cpu{ | |
| 145 | pub const at697f = CpuModel{ | |
| 145 | 146 | .name = "at697f", |
| 146 | 147 | .llvm_name = "at697f", |
| 147 | 148 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -149,17 +150,17 @@ pub const cpu = struct { |
| 149 | 150 | .leon, |
| 150 | 151 | }), |
| 151 | 152 | }; |
| 152 | pub const f934 = Cpu{ | |
| 153 | pub const f934 = CpuModel{ | |
| 153 | 154 | .name = "f934", |
| 154 | 155 | .llvm_name = "f934", |
| 155 | 156 | .features = featureSet(&[_]Feature{}), |
| 156 | 157 | }; |
| 157 | pub const generic = Cpu{ | |
| 158 | pub const generic = CpuModel{ | |
| 158 | 159 | .name = "generic", |
| 159 | 160 | .llvm_name = "generic", |
| 160 | 161 | .features = featureSet(&[_]Feature{}), |
| 161 | 162 | }; |
| 162 | pub const gr712rc = Cpu{ | |
| 163 | pub const gr712rc = CpuModel{ | |
| 163 | 164 | .name = "gr712rc", |
| 164 | 165 | .llvm_name = "gr712rc", |
| 165 | 166 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -167,7 +168,7 @@ pub const cpu = struct { |
| 167 | 168 | .leon, |
| 168 | 169 | }), |
| 169 | 170 | }; |
| 170 | pub const gr740 = Cpu{ | |
| 171 | pub const gr740 = CpuModel{ | |
| 171 | 172 | .name = "gr740", |
| 172 | 173 | .llvm_name = "gr740", |
| 173 | 174 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -178,19 +179,19 @@ pub const cpu = struct { |
| 178 | 179 | .leonpwrpsr, |
| 179 | 180 | }), |
| 180 | 181 | }; |
| 181 | pub const hypersparc = Cpu{ | |
| 182 | pub const hypersparc = CpuModel{ | |
| 182 | 183 | .name = "hypersparc", |
| 183 | 184 | .llvm_name = "hypersparc", |
| 184 | 185 | .features = featureSet(&[_]Feature{}), |
| 185 | 186 | }; |
| 186 | pub const leon2 = Cpu{ | |
| 187 | pub const leon2 = CpuModel{ | |
| 187 | 188 | .name = "leon2", |
| 188 | 189 | .llvm_name = "leon2", |
| 189 | 190 | .features = featureSet(&[_]Feature{ |
| 190 | 191 | .leon, |
| 191 | 192 | }), |
| 192 | 193 | }; |
| 193 | pub const leon3 = Cpu{ | |
| 194 | pub const leon3 = CpuModel{ | |
| 194 | 195 | .name = "leon3", |
| 195 | 196 | .llvm_name = "leon3", |
| 196 | 197 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -198,7 +199,7 @@ pub const cpu = struct { |
| 198 | 199 | .leon, |
| 199 | 200 | }), |
| 200 | 201 | }; |
| 201 | pub const leon4 = Cpu{ | |
| 202 | pub const leon4 = CpuModel{ | |
| 202 | 203 | .name = "leon4", |
| 203 | 204 | .llvm_name = "leon4", |
| 204 | 205 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -207,7 +208,7 @@ pub const cpu = struct { |
| 207 | 208 | .leon, |
| 208 | 209 | }), |
| 209 | 210 | }; |
| 210 | pub const ma2080 = Cpu{ | |
| 211 | pub const ma2080 = CpuModel{ | |
| 211 | 212 | .name = "ma2080", |
| 212 | 213 | .llvm_name = "ma2080", |
| 213 | 214 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -215,7 +216,7 @@ pub const cpu = struct { |
| 215 | 216 | .leon, |
| 216 | 217 | }), |
| 217 | 218 | }; |
| 218 | pub const ma2085 = Cpu{ | |
| 219 | pub const ma2085 = CpuModel{ | |
| 219 | 220 | .name = "ma2085", |
| 220 | 221 | .llvm_name = "ma2085", |
| 221 | 222 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -223,7 +224,7 @@ pub const cpu = struct { |
| 223 | 224 | .leon, |
| 224 | 225 | }), |
| 225 | 226 | }; |
| 226 | pub const ma2100 = Cpu{ | |
| 227 | pub const ma2100 = CpuModel{ | |
| 227 | 228 | .name = "ma2100", |
| 228 | 229 | .llvm_name = "ma2100", |
| 229 | 230 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -231,7 +232,7 @@ pub const cpu = struct { |
| 231 | 232 | .leon, |
| 232 | 233 | }), |
| 233 | 234 | }; |
| 234 | pub const ma2150 = Cpu{ | |
| 235 | pub const ma2150 = CpuModel{ | |
| 235 | 236 | .name = "ma2150", |
| 236 | 237 | .llvm_name = "ma2150", |
| 237 | 238 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -239,7 +240,7 @@ pub const cpu = struct { |
| 239 | 240 | .leon, |
| 240 | 241 | }), |
| 241 | 242 | }; |
| 242 | pub const ma2155 = Cpu{ | |
| 243 | pub const ma2155 = CpuModel{ | |
| 243 | 244 | .name = "ma2155", |
| 244 | 245 | .llvm_name = "ma2155", |
| 245 | 246 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -247,7 +248,7 @@ pub const cpu = struct { |
| 247 | 248 | .leon, |
| 248 | 249 | }), |
| 249 | 250 | }; |
| 250 | pub const ma2450 = Cpu{ | |
| 251 | pub const ma2450 = CpuModel{ | |
| 251 | 252 | .name = "ma2450", |
| 252 | 253 | .llvm_name = "ma2450", |
| 253 | 254 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -255,7 +256,7 @@ pub const cpu = struct { |
| 255 | 256 | .leon, |
| 256 | 257 | }), |
| 257 | 258 | }; |
| 258 | pub const ma2455 = Cpu{ | |
| 259 | pub const ma2455 = CpuModel{ | |
| 259 | 260 | .name = "ma2455", |
| 260 | 261 | .llvm_name = "ma2455", |
| 261 | 262 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -263,7 +264,7 @@ pub const cpu = struct { |
| 263 | 264 | .leon, |
| 264 | 265 | }), |
| 265 | 266 | }; |
| 266 | pub const ma2480 = Cpu{ | |
| 267 | pub const ma2480 = CpuModel{ | |
| 267 | 268 | .name = "ma2480", |
| 268 | 269 | .llvm_name = "ma2480", |
| 269 | 270 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -271,7 +272,7 @@ pub const cpu = struct { |
| 271 | 272 | .leon, |
| 272 | 273 | }), |
| 273 | 274 | }; |
| 274 | pub const ma2485 = Cpu{ | |
| 275 | pub const ma2485 = CpuModel{ | |
| 275 | 276 | .name = "ma2485", |
| 276 | 277 | .llvm_name = "ma2485", |
| 277 | 278 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -279,7 +280,7 @@ pub const cpu = struct { |
| 279 | 280 | .leon, |
| 280 | 281 | }), |
| 281 | 282 | }; |
| 282 | pub const ma2x5x = Cpu{ | |
| 283 | pub const ma2x5x = CpuModel{ | |
| 283 | 284 | .name = "ma2x5x", |
| 284 | 285 | .llvm_name = "ma2x5x", |
| 285 | 286 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -287,7 +288,7 @@ pub const cpu = struct { |
| 287 | 288 | .leon, |
| 288 | 289 | }), |
| 289 | 290 | }; |
| 290 | pub const ma2x8x = Cpu{ | |
| 291 | pub const ma2x8x = CpuModel{ | |
| 291 | 292 | .name = "ma2x8x", |
| 292 | 293 | .llvm_name = "ma2x8x", |
| 293 | 294 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -295,7 +296,7 @@ pub const cpu = struct { |
| 295 | 296 | .leon, |
| 296 | 297 | }), |
| 297 | 298 | }; |
| 298 | pub const myriad2 = Cpu{ | |
| 299 | pub const myriad2 = CpuModel{ | |
| 299 | 300 | .name = "myriad2", |
| 300 | 301 | .llvm_name = "myriad2", |
| 301 | 302 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -303,7 +304,7 @@ pub const cpu = struct { |
| 303 | 304 | .leon, |
| 304 | 305 | }), |
| 305 | 306 | }; |
| 306 | pub const myriad2_1 = Cpu{ | |
| 307 | pub const myriad2_1 = CpuModel{ | |
| 307 | 308 | .name = "myriad2_1", |
| 308 | 309 | .llvm_name = "myriad2.1", |
| 309 | 310 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -311,7 +312,7 @@ pub const cpu = struct { |
| 311 | 312 | .leon, |
| 312 | 313 | }), |
| 313 | 314 | }; |
| 314 | pub const myriad2_2 = Cpu{ | |
| 315 | pub const myriad2_2 = CpuModel{ | |
| 315 | 316 | .name = "myriad2_2", |
| 316 | 317 | .llvm_name = "myriad2.2", |
| 317 | 318 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -319,7 +320,7 @@ pub const cpu = struct { |
| 319 | 320 | .leon, |
| 320 | 321 | }), |
| 321 | 322 | }; |
| 322 | pub const myriad2_3 = Cpu{ | |
| 323 | pub const myriad2_3 = CpuModel{ | |
| 323 | 324 | .name = "myriad2_3", |
| 324 | 325 | .llvm_name = "myriad2.3", |
| 325 | 326 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -327,7 +328,7 @@ pub const cpu = struct { |
| 327 | 328 | .leon, |
| 328 | 329 | }), |
| 329 | 330 | }; |
| 330 | pub const niagara = Cpu{ | |
| 331 | pub const niagara = CpuModel{ | |
| 331 | 332 | .name = "niagara", |
| 332 | 333 | .llvm_name = "niagara", |
| 333 | 334 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -337,7 +338,7 @@ pub const cpu = struct { |
| 337 | 338 | .vis2, |
| 338 | 339 | }), |
| 339 | 340 | }; |
| 340 | pub const niagara2 = Cpu{ | |
| 341 | pub const niagara2 = CpuModel{ | |
| 341 | 342 | .name = "niagara2", |
| 342 | 343 | .llvm_name = "niagara2", |
| 343 | 344 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -348,7 +349,7 @@ pub const cpu = struct { |
| 348 | 349 | .vis2, |
| 349 | 350 | }), |
| 350 | 351 | }; |
| 351 | pub const niagara3 = Cpu{ | |
| 352 | pub const niagara3 = CpuModel{ | |
| 352 | 353 | .name = "niagara3", |
| 353 | 354 | .llvm_name = "niagara3", |
| 354 | 355 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -359,7 +360,7 @@ pub const cpu = struct { |
| 359 | 360 | .vis2, |
| 360 | 361 | }), |
| 361 | 362 | }; |
| 362 | pub const niagara4 = Cpu{ | |
| 363 | pub const niagara4 = CpuModel{ | |
| 363 | 364 | .name = "niagara4", |
| 364 | 365 | .llvm_name = "niagara4", |
| 365 | 366 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -371,32 +372,32 @@ pub const cpu = struct { |
| 371 | 372 | .vis3, |
| 372 | 373 | }), |
| 373 | 374 | }; |
| 374 | pub const sparclet = Cpu{ | |
| 375 | pub const sparclet = CpuModel{ | |
| 375 | 376 | .name = "sparclet", |
| 376 | 377 | .llvm_name = "sparclet", |
| 377 | 378 | .features = featureSet(&[_]Feature{}), |
| 378 | 379 | }; |
| 379 | pub const sparclite = Cpu{ | |
| 380 | pub const sparclite = CpuModel{ | |
| 380 | 381 | .name = "sparclite", |
| 381 | 382 | .llvm_name = "sparclite", |
| 382 | 383 | .features = featureSet(&[_]Feature{}), |
| 383 | 384 | }; |
| 384 | pub const sparclite86x = Cpu{ | |
| 385 | pub const sparclite86x = CpuModel{ | |
| 385 | 386 | .name = "sparclite86x", |
| 386 | 387 | .llvm_name = "sparclite86x", |
| 387 | 388 | .features = featureSet(&[_]Feature{}), |
| 388 | 389 | }; |
| 389 | pub const supersparc = Cpu{ | |
| 390 | pub const supersparc = CpuModel{ | |
| 390 | 391 | .name = "supersparc", |
| 391 | 392 | .llvm_name = "supersparc", |
| 392 | 393 | .features = featureSet(&[_]Feature{}), |
| 393 | 394 | }; |
| 394 | pub const tsc701 = Cpu{ | |
| 395 | pub const tsc701 = CpuModel{ | |
| 395 | 396 | .name = "tsc701", |
| 396 | 397 | .llvm_name = "tsc701", |
| 397 | 398 | .features = featureSet(&[_]Feature{}), |
| 398 | 399 | }; |
| 399 | pub const ultrasparc = Cpu{ | |
| 400 | pub const ultrasparc = CpuModel{ | |
| 400 | 401 | .name = "ultrasparc", |
| 401 | 402 | .llvm_name = "ultrasparc", |
| 402 | 403 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -405,7 +406,7 @@ pub const cpu = struct { |
| 405 | 406 | .vis, |
| 406 | 407 | }), |
| 407 | 408 | }; |
| 408 | pub const ultrasparc3 = Cpu{ | |
| 409 | pub const ultrasparc3 = CpuModel{ | |
| 409 | 410 | .name = "ultrasparc3", |
| 410 | 411 | .llvm_name = "ultrasparc3", |
| 411 | 412 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -415,7 +416,7 @@ pub const cpu = struct { |
| 415 | 416 | .vis2, |
| 416 | 417 | }), |
| 417 | 418 | }; |
| 418 | pub const ut699 = Cpu{ | |
| 419 | pub const ut699 = CpuModel{ | |
| 419 | 420 | .name = "ut699", |
| 420 | 421 | .llvm_name = "ut699", |
| 421 | 422 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -426,7 +427,7 @@ pub const cpu = struct { |
| 426 | 427 | .no_fsmuld, |
| 427 | 428 | }), |
| 428 | 429 | }; |
| 429 | pub const v7 = Cpu{ | |
| 430 | pub const v7 = CpuModel{ | |
| 430 | 431 | .name = "v7", |
| 431 | 432 | .llvm_name = "v7", |
| 432 | 433 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -434,12 +435,12 @@ pub const cpu = struct { |
| 434 | 435 | .soft_mul_div, |
| 435 | 436 | }), |
| 436 | 437 | }; |
| 437 | pub const v8 = Cpu{ | |
| 438 | pub const v8 = CpuModel{ | |
| 438 | 439 | .name = "v8", |
| 439 | 440 | .llvm_name = "v8", |
| 440 | 441 | .features = featureSet(&[_]Feature{}), |
| 441 | 442 | }; |
| 442 | pub const v9 = Cpu{ | |
| 443 | pub const v9 = CpuModel{ | |
| 443 | 444 | .name = "v9", |
| 444 | 445 | .llvm_name = "v9", |
| 445 | 446 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -451,7 +452,7 @@ pub const cpu = struct { |
| 451 | 452 | /// All sparc CPUs, sorted alphabetically by name. |
| 452 | 453 | /// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1 |
| 453 | 454 | /// compiler has inefficient memory and CPU usage, affecting build times. |
| 454 | pub const all_cpus = &[_]*const Cpu{ | |
| 455 | pub const all_cpus = &[_]*const CpuModel{ | |
| 455 | 456 | &cpu.at697e, |
| 456 | 457 | &cpu.at697f, |
| 457 | 458 | &cpu.f934, |
lib/std/target/systemz.zig+18-17| ... | ... | @@ -1,5 +1,6 @@ |
| 1 | 1 | const std = @import("../std.zig"); |
| 2 | const Cpu = std.Target.Cpu; | |
| 2 | const CpuFeature = std.Target.Cpu.Feature; | |
| 3 | const CpuModel = std.Target.Cpu.Model; | |
| 3 | 4 | |
| 4 | 5 | pub const Feature = enum { |
| 5 | 6 | deflate_conversion, |
| ... | ... | @@ -39,12 +40,12 @@ pub const Feature = enum { |
| 39 | 40 | vector_packed_decimal_enhancement, |
| 40 | 41 | }; |
| 41 | 42 | |
| 42 | pub usingnamespace Cpu.Feature.feature_set_fns(Feature); | |
| 43 | pub usingnamespace CpuFeature.feature_set_fns(Feature); | |
| 43 | 44 | |
| 44 | 45 | pub const all_features = blk: { |
| 45 | 46 | const len = @typeInfo(Feature).Enum.fields.len; |
| 46 | std.debug.assert(len <= Cpu.Feature.Set.needed_bit_count); | |
| 47 | var result: [len]Cpu.Feature = undefined; | |
| 47 | std.debug.assert(len <= CpuFeature.Set.needed_bit_count); | |
| 48 | var result: [len]CpuFeature = undefined; | |
| 48 | 49 | result[@enumToInt(Feature.deflate_conversion)] = .{ |
| 49 | 50 | .llvm_name = "deflate-conversion", |
| 50 | 51 | .description = "Assume that the deflate-conversion facility is installed", |
| ... | ... | @@ -229,7 +230,7 @@ pub const all_features = blk: { |
| 229 | 230 | }; |
| 230 | 231 | |
| 231 | 232 | pub const cpu = struct { |
| 232 | pub const arch10 = Cpu{ | |
| 233 | pub const arch10 = CpuModel{ | |
| 233 | 234 | .name = "arch10", |
| 234 | 235 | .llvm_name = "arch10", |
| 235 | 236 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -252,7 +253,7 @@ pub const cpu = struct { |
| 252 | 253 | .transactional_execution, |
| 253 | 254 | }), |
| 254 | 255 | }; |
| 255 | pub const arch11 = Cpu{ | |
| 256 | pub const arch11 = CpuModel{ | |
| 256 | 257 | .name = "arch11", |
| 257 | 258 | .llvm_name = "arch11", |
| 258 | 259 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -280,7 +281,7 @@ pub const cpu = struct { |
| 280 | 281 | .vector, |
| 281 | 282 | }), |
| 282 | 283 | }; |
| 283 | pub const arch12 = Cpu{ | |
| 284 | pub const arch12 = CpuModel{ | |
| 284 | 285 | .name = "arch12", |
| 285 | 286 | .llvm_name = "arch12", |
| 286 | 287 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -315,7 +316,7 @@ pub const cpu = struct { |
| 315 | 316 | .vector_packed_decimal, |
| 316 | 317 | }), |
| 317 | 318 | }; |
| 318 | pub const arch13 = Cpu{ | |
| 319 | pub const arch13 = CpuModel{ | |
| 319 | 320 | .name = "arch13", |
| 320 | 321 | .llvm_name = "arch13", |
| 321 | 322 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -356,12 +357,12 @@ pub const cpu = struct { |
| 356 | 357 | .vector_packed_decimal_enhancement, |
| 357 | 358 | }), |
| 358 | 359 | }; |
| 359 | pub const arch8 = Cpu{ | |
| 360 | pub const arch8 = CpuModel{ | |
| 360 | 361 | .name = "arch8", |
| 361 | 362 | .llvm_name = "arch8", |
| 362 | 363 | .features = featureSet(&[_]Feature{}), |
| 363 | 364 | }; |
| 364 | pub const arch9 = Cpu{ | |
| 365 | pub const arch9 = CpuModel{ | |
| 365 | 366 | .name = "arch9", |
| 366 | 367 | .llvm_name = "arch9", |
| 367 | 368 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -377,17 +378,17 @@ pub const cpu = struct { |
| 377 | 378 | .reset_reference_bits_multiple, |
| 378 | 379 | }), |
| 379 | 380 | }; |
| 380 | pub const generic = Cpu{ | |
| 381 | pub const generic = CpuModel{ | |
| 381 | 382 | .name = "generic", |
| 382 | 383 | .llvm_name = "generic", |
| 383 | 384 | .features = featureSet(&[_]Feature{}), |
| 384 | 385 | }; |
| 385 | pub const z10 = Cpu{ | |
| 386 | pub const z10 = CpuModel{ | |
| 386 | 387 | .name = "z10", |
| 387 | 388 | .llvm_name = "z10", |
| 388 | 389 | .features = featureSet(&[_]Feature{}), |
| 389 | 390 | }; |
| 390 | pub const z13 = Cpu{ | |
| 391 | pub const z13 = CpuModel{ | |
| 391 | 392 | .name = "z13", |
| 392 | 393 | .llvm_name = "z13", |
| 393 | 394 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -415,7 +416,7 @@ pub const cpu = struct { |
| 415 | 416 | .vector, |
| 416 | 417 | }), |
| 417 | 418 | }; |
| 418 | pub const z14 = Cpu{ | |
| 419 | pub const z14 = CpuModel{ | |
| 419 | 420 | .name = "z14", |
| 420 | 421 | .llvm_name = "z14", |
| 421 | 422 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -450,7 +451,7 @@ pub const cpu = struct { |
| 450 | 451 | .vector_packed_decimal, |
| 451 | 452 | }), |
| 452 | 453 | }; |
| 453 | pub const z196 = Cpu{ | |
| 454 | pub const z196 = CpuModel{ | |
| 454 | 455 | .name = "z196", |
| 455 | 456 | .llvm_name = "z196", |
| 456 | 457 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -466,7 +467,7 @@ pub const cpu = struct { |
| 466 | 467 | .reset_reference_bits_multiple, |
| 467 | 468 | }), |
| 468 | 469 | }; |
| 469 | pub const zEC12 = Cpu{ | |
| 470 | pub const zEC12 = CpuModel{ | |
| 470 | 471 | .name = "zEC12", |
| 471 | 472 | .llvm_name = "zEC12", |
| 472 | 473 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -494,7 +495,7 @@ pub const cpu = struct { |
| 494 | 495 | /// All systemz CPUs, sorted alphabetically by name. |
| 495 | 496 | /// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1 |
| 496 | 497 | /// compiler has inefficient memory and CPU usage, affecting build times. |
| 497 | pub const all_cpus = &[_]*const Cpu{ | |
| 498 | pub const all_cpus = &[_]*const CpuModel{ | |
| 498 | 499 | &cpu.arch10, |
| 499 | 500 | &cpu.arch11, |
| 500 | 501 | &cpu.arch12, |
lib/std/target/wasm.zig+9-8| ... | ... | @@ -1,5 +1,6 @@ |
| 1 | 1 | const std = @import("../std.zig"); |
| 2 | const Cpu = std.Target.Cpu; | |
| 2 | const CpuFeature = std.Target.Cpu.Feature; | |
| 3 | const CpuModel = std.Target.Cpu.Model; | |
| 3 | 4 | |
| 4 | 5 | pub const Feature = enum { |
| 5 | 6 | atomics, |
| ... | ... | @@ -14,12 +15,12 @@ pub const Feature = enum { |
| 14 | 15 | unimplemented_simd128, |
| 15 | 16 | }; |
| 16 | 17 | |
| 17 | pub usingnamespace Cpu.Feature.feature_set_fns(Feature); | |
| 18 | pub usingnamespace CpuFeature.feature_set_fns(Feature); | |
| 18 | 19 | |
| 19 | 20 | pub const all_features = blk: { |
| 20 | 21 | const len = @typeInfo(Feature).Enum.fields.len; |
| 21 | std.debug.assert(len <= Cpu.Feature.Set.needed_bit_count); | |
| 22 | var result: [len]Cpu.Feature = undefined; | |
| 22 | std.debug.assert(len <= CpuFeature.Set.needed_bit_count); | |
| 23 | var result: [len]CpuFeature = undefined; | |
| 23 | 24 | result[@enumToInt(Feature.atomics)] = .{ |
| 24 | 25 | .llvm_name = "atomics", |
| 25 | 26 | .description = "Enable Atomics", |
| ... | ... | @@ -81,7 +82,7 @@ pub const all_features = blk: { |
| 81 | 82 | }; |
| 82 | 83 | |
| 83 | 84 | pub const cpu = struct { |
| 84 | pub const bleeding_edge = Cpu{ | |
| 85 | pub const bleeding_edge = CpuModel{ | |
| 85 | 86 | .name = "bleeding_edge", |
| 86 | 87 | .llvm_name = "bleeding-edge", |
| 87 | 88 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -92,12 +93,12 @@ pub const cpu = struct { |
| 92 | 93 | .simd128, |
| 93 | 94 | }), |
| 94 | 95 | }; |
| 95 | pub const generic = Cpu{ | |
| 96 | pub const generic = CpuModel{ | |
| 96 | 97 | .name = "generic", |
| 97 | 98 | .llvm_name = "generic", |
| 98 | 99 | .features = featureSet(&[_]Feature{}), |
| 99 | 100 | }; |
| 100 | pub const mvp = Cpu{ | |
| 101 | pub const mvp = CpuModel{ | |
| 101 | 102 | .name = "mvp", |
| 102 | 103 | .llvm_name = "mvp", |
| 103 | 104 | .features = featureSet(&[_]Feature{}), |
| ... | ... | @@ -107,7 +108,7 @@ pub const cpu = struct { |
| 107 | 108 | /// All wasm CPUs, sorted alphabetically by name. |
| 108 | 109 | /// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1 |
| 109 | 110 | /// compiler has inefficient memory and CPU usage, affecting build times. |
| 110 | pub const all_cpus = &[_]*const Cpu{ | |
| 111 | pub const all_cpus = &[_]*const CpuModel{ | |
| 111 | 112 | &cpu.bleeding_edge, |
| 112 | 113 | &cpu.generic, |
| 113 | 114 | &cpu.mvp, |
lib/std/target/x86.zig+84-83| ... | ... | @@ -1,5 +1,6 @@ |
| 1 | 1 | const std = @import("../std.zig"); |
| 2 | const Cpu = std.Target.Cpu; | |
| 2 | const CpuFeature = std.Target.Cpu.Feature; | |
| 3 | const CpuModel = std.Target.Cpu.Model; | |
| 3 | 4 | |
| 4 | 5 | pub const Feature = enum { |
| 5 | 6 | @"3dnow", |
| ... | ... | @@ -125,12 +126,12 @@ pub const Feature = enum { |
| 125 | 126 | xsaves, |
| 126 | 127 | }; |
| 127 | 128 | |
| 128 | pub usingnamespace Cpu.Feature.feature_set_fns(Feature); | |
| 129 | pub usingnamespace CpuFeature.feature_set_fns(Feature); | |
| 129 | 130 | |
| 130 | 131 | pub const all_features = blk: { |
| 131 | 132 | const len = @typeInfo(Feature).Enum.fields.len; |
| 132 | std.debug.assert(len <= Cpu.Feature.Set.needed_bit_count); | |
| 133 | var result: [len]Cpu.Feature = undefined; | |
| 133 | std.debug.assert(len <= CpuFeature.Set.needed_bit_count); | |
| 134 | var result: [len]CpuFeature = undefined; | |
| 134 | 135 | result[@enumToInt(Feature.@"3dnow")] = .{ |
| 135 | 136 | .llvm_name = "3dnow", |
| 136 | 137 | .description = "Enable 3DNow! instructions", |
| ... | ... | @@ -829,7 +830,7 @@ pub const all_features = blk: { |
| 829 | 830 | }; |
| 830 | 831 | |
| 831 | 832 | pub const cpu = struct { |
| 832 | pub const amdfam10 = Cpu{ | |
| 833 | pub const amdfam10 = CpuModel{ | |
| 833 | 834 | .name = "amdfam10", |
| 834 | 835 | .llvm_name = "amdfam10", |
| 835 | 836 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -849,7 +850,7 @@ pub const cpu = struct { |
| 849 | 850 | .x87, |
| 850 | 851 | }), |
| 851 | 852 | }; |
| 852 | pub const athlon = Cpu{ | |
| 853 | pub const athlon = CpuModel{ | |
| 853 | 854 | .name = "athlon", |
| 854 | 855 | .llvm_name = "athlon", |
| 855 | 856 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -862,7 +863,7 @@ pub const cpu = struct { |
| 862 | 863 | .x87, |
| 863 | 864 | }), |
| 864 | 865 | }; |
| 865 | pub const athlon_4 = Cpu{ | |
| 866 | pub const athlon_4 = CpuModel{ | |
| 866 | 867 | .name = "athlon_4", |
| 867 | 868 | .llvm_name = "athlon-4", |
| 868 | 869 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -877,7 +878,7 @@ pub const cpu = struct { |
| 877 | 878 | .x87, |
| 878 | 879 | }), |
| 879 | 880 | }; |
| 880 | pub const athlon_fx = Cpu{ | |
| 881 | pub const athlon_fx = CpuModel{ | |
| 881 | 882 | .name = "athlon_fx", |
| 882 | 883 | .llvm_name = "athlon-fx", |
| 883 | 884 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -894,7 +895,7 @@ pub const cpu = struct { |
| 894 | 895 | .x87, |
| 895 | 896 | }), |
| 896 | 897 | }; |
| 897 | pub const athlon_mp = Cpu{ | |
| 898 | pub const athlon_mp = CpuModel{ | |
| 898 | 899 | .name = "athlon_mp", |
| 899 | 900 | .llvm_name = "athlon-mp", |
| 900 | 901 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -909,7 +910,7 @@ pub const cpu = struct { |
| 909 | 910 | .x87, |
| 910 | 911 | }), |
| 911 | 912 | }; |
| 912 | pub const athlon_tbird = Cpu{ | |
| 913 | pub const athlon_tbird = CpuModel{ | |
| 913 | 914 | .name = "athlon_tbird", |
| 914 | 915 | .llvm_name = "athlon-tbird", |
| 915 | 916 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -922,7 +923,7 @@ pub const cpu = struct { |
| 922 | 923 | .x87, |
| 923 | 924 | }), |
| 924 | 925 | }; |
| 925 | pub const athlon_xp = Cpu{ | |
| 926 | pub const athlon_xp = CpuModel{ | |
| 926 | 927 | .name = "athlon_xp", |
| 927 | 928 | .llvm_name = "athlon-xp", |
| 928 | 929 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -937,7 +938,7 @@ pub const cpu = struct { |
| 937 | 938 | .x87, |
| 938 | 939 | }), |
| 939 | 940 | }; |
| 940 | pub const athlon64 = Cpu{ | |
| 941 | pub const athlon64 = CpuModel{ | |
| 941 | 942 | .name = "athlon64", |
| 942 | 943 | .llvm_name = "athlon64", |
| 943 | 944 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -954,7 +955,7 @@ pub const cpu = struct { |
| 954 | 955 | .x87, |
| 955 | 956 | }), |
| 956 | 957 | }; |
| 957 | pub const athlon64_sse3 = Cpu{ | |
| 958 | pub const athlon64_sse3 = CpuModel{ | |
| 958 | 959 | .name = "athlon64_sse3", |
| 959 | 960 | .llvm_name = "athlon64-sse3", |
| 960 | 961 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -972,7 +973,7 @@ pub const cpu = struct { |
| 972 | 973 | .x87, |
| 973 | 974 | }), |
| 974 | 975 | }; |
| 975 | pub const atom = Cpu{ | |
| 976 | pub const atom = CpuModel{ | |
| 976 | 977 | .name = "atom", |
| 977 | 978 | .llvm_name = "atom", |
| 978 | 979 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -996,7 +997,7 @@ pub const cpu = struct { |
| 996 | 997 | .x87, |
| 997 | 998 | }), |
| 998 | 999 | }; |
| 999 | pub const barcelona = Cpu{ | |
| 1000 | pub const barcelona = CpuModel{ | |
| 1000 | 1001 | .name = "barcelona", |
| 1001 | 1002 | .llvm_name = "barcelona", |
| 1002 | 1003 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1016,7 +1017,7 @@ pub const cpu = struct { |
| 1016 | 1017 | .x87, |
| 1017 | 1018 | }), |
| 1018 | 1019 | }; |
| 1019 | pub const bdver1 = Cpu{ | |
| 1020 | pub const bdver1 = CpuModel{ | |
| 1020 | 1021 | .name = "bdver1", |
| 1021 | 1022 | .llvm_name = "bdver1", |
| 1022 | 1023 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1043,7 +1044,7 @@ pub const cpu = struct { |
| 1043 | 1044 | .xsave, |
| 1044 | 1045 | }), |
| 1045 | 1046 | }; |
| 1046 | pub const bdver2 = Cpu{ | |
| 1047 | pub const bdver2 = CpuModel{ | |
| 1047 | 1048 | .name = "bdver2", |
| 1048 | 1049 | .llvm_name = "bdver2", |
| 1049 | 1050 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1075,7 +1076,7 @@ pub const cpu = struct { |
| 1075 | 1076 | .xsave, |
| 1076 | 1077 | }), |
| 1077 | 1078 | }; |
| 1078 | pub const bdver3 = Cpu{ | |
| 1079 | pub const bdver3 = CpuModel{ | |
| 1079 | 1080 | .name = "bdver3", |
| 1080 | 1081 | .llvm_name = "bdver3", |
| 1081 | 1082 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1109,7 +1110,7 @@ pub const cpu = struct { |
| 1109 | 1110 | .xsaveopt, |
| 1110 | 1111 | }), |
| 1111 | 1112 | }; |
| 1112 | pub const bdver4 = Cpu{ | |
| 1113 | pub const bdver4 = CpuModel{ | |
| 1113 | 1114 | .name = "bdver4", |
| 1114 | 1115 | .llvm_name = "bdver4", |
| 1115 | 1116 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1146,7 +1147,7 @@ pub const cpu = struct { |
| 1146 | 1147 | .xsaveopt, |
| 1147 | 1148 | }), |
| 1148 | 1149 | }; |
| 1149 | pub const bonnell = Cpu{ | |
| 1150 | pub const bonnell = CpuModel{ | |
| 1150 | 1151 | .name = "bonnell", |
| 1151 | 1152 | .llvm_name = "bonnell", |
| 1152 | 1153 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1170,7 +1171,7 @@ pub const cpu = struct { |
| 1170 | 1171 | .x87, |
| 1171 | 1172 | }), |
| 1172 | 1173 | }; |
| 1173 | pub const broadwell = Cpu{ | |
| 1174 | pub const broadwell = CpuModel{ | |
| 1174 | 1175 | .name = "broadwell", |
| 1175 | 1176 | .llvm_name = "broadwell", |
| 1176 | 1177 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1214,7 +1215,7 @@ pub const cpu = struct { |
| 1214 | 1215 | .xsaveopt, |
| 1215 | 1216 | }), |
| 1216 | 1217 | }; |
| 1217 | pub const btver1 = Cpu{ | |
| 1218 | pub const btver1 = CpuModel{ | |
| 1218 | 1219 | .name = "btver1", |
| 1219 | 1220 | .llvm_name = "btver1", |
| 1220 | 1221 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1238,7 +1239,7 @@ pub const cpu = struct { |
| 1238 | 1239 | .x87, |
| 1239 | 1240 | }), |
| 1240 | 1241 | }; |
| 1241 | pub const btver2 = Cpu{ | |
| 1242 | pub const btver2 = CpuModel{ | |
| 1242 | 1243 | .name = "btver2", |
| 1243 | 1244 | .llvm_name = "btver2", |
| 1244 | 1245 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1274,7 +1275,7 @@ pub const cpu = struct { |
| 1274 | 1275 | .xsaveopt, |
| 1275 | 1276 | }), |
| 1276 | 1277 | }; |
| 1277 | pub const c3 = Cpu{ | |
| 1278 | pub const c3 = CpuModel{ | |
| 1278 | 1279 | .name = "c3", |
| 1279 | 1280 | .llvm_name = "c3", |
| 1280 | 1281 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1283,7 +1284,7 @@ pub const cpu = struct { |
| 1283 | 1284 | .x87, |
| 1284 | 1285 | }), |
| 1285 | 1286 | }; |
| 1286 | pub const c3_2 = Cpu{ | |
| 1287 | pub const c3_2 = CpuModel{ | |
| 1287 | 1288 | .name = "c3_2", |
| 1288 | 1289 | .llvm_name = "c3-2", |
| 1289 | 1290 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1296,7 +1297,7 @@ pub const cpu = struct { |
| 1296 | 1297 | .x87, |
| 1297 | 1298 | }), |
| 1298 | 1299 | }; |
| 1299 | pub const cannonlake = Cpu{ | |
| 1300 | pub const cannonlake = CpuModel{ | |
| 1300 | 1301 | .name = "cannonlake", |
| 1301 | 1302 | .llvm_name = "cannonlake", |
| 1302 | 1303 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1355,7 +1356,7 @@ pub const cpu = struct { |
| 1355 | 1356 | .xsaves, |
| 1356 | 1357 | }), |
| 1357 | 1358 | }; |
| 1358 | pub const cascadelake = Cpu{ | |
| 1359 | pub const cascadelake = CpuModel{ | |
| 1359 | 1360 | .name = "cascadelake", |
| 1360 | 1361 | .llvm_name = "cascadelake", |
| 1361 | 1362 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1413,7 +1414,7 @@ pub const cpu = struct { |
| 1413 | 1414 | .xsaves, |
| 1414 | 1415 | }), |
| 1415 | 1416 | }; |
| 1416 | pub const cooperlake = Cpu{ | |
| 1417 | pub const cooperlake = CpuModel{ | |
| 1417 | 1418 | .name = "cooperlake", |
| 1418 | 1419 | .llvm_name = "cooperlake", |
| 1419 | 1420 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1472,7 +1473,7 @@ pub const cpu = struct { |
| 1472 | 1473 | .xsaves, |
| 1473 | 1474 | }), |
| 1474 | 1475 | }; |
| 1475 | pub const core_avx_i = Cpu{ | |
| 1476 | pub const core_avx_i = CpuModel{ | |
| 1476 | 1477 | .name = "core_avx_i", |
| 1477 | 1478 | .llvm_name = "core-avx-i", |
| 1478 | 1479 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1504,7 +1505,7 @@ pub const cpu = struct { |
| 1504 | 1505 | .xsaveopt, |
| 1505 | 1506 | }), |
| 1506 | 1507 | }; |
| 1507 | pub const core_avx2 = Cpu{ | |
| 1508 | pub const core_avx2 = CpuModel{ | |
| 1508 | 1509 | .name = "core_avx2", |
| 1509 | 1510 | .llvm_name = "core-avx2", |
| 1510 | 1511 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1545,7 +1546,7 @@ pub const cpu = struct { |
| 1545 | 1546 | .xsaveopt, |
| 1546 | 1547 | }), |
| 1547 | 1548 | }; |
| 1548 | pub const core2 = Cpu{ | |
| 1549 | pub const core2 = CpuModel{ | |
| 1549 | 1550 | .name = "core2", |
| 1550 | 1551 | .llvm_name = "core2", |
| 1551 | 1552 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1563,7 +1564,7 @@ pub const cpu = struct { |
| 1563 | 1564 | .x87, |
| 1564 | 1565 | }), |
| 1565 | 1566 | }; |
| 1566 | pub const corei7 = Cpu{ | |
| 1567 | pub const corei7 = CpuModel{ | |
| 1567 | 1568 | .name = "corei7", |
| 1568 | 1569 | .llvm_name = "corei7", |
| 1569 | 1570 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1581,7 +1582,7 @@ pub const cpu = struct { |
| 1581 | 1582 | .x87, |
| 1582 | 1583 | }), |
| 1583 | 1584 | }; |
| 1584 | pub const corei7_avx = Cpu{ | |
| 1585 | pub const corei7_avx = CpuModel{ | |
| 1585 | 1586 | .name = "corei7_avx", |
| 1586 | 1587 | .llvm_name = "corei7-avx", |
| 1587 | 1588 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1610,7 +1611,7 @@ pub const cpu = struct { |
| 1610 | 1611 | .xsaveopt, |
| 1611 | 1612 | }), |
| 1612 | 1613 | }; |
| 1613 | pub const generic = Cpu{ | |
| 1614 | pub const generic = CpuModel{ | |
| 1614 | 1615 | .name = "generic", |
| 1615 | 1616 | .llvm_name = "generic", |
| 1616 | 1617 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1619,7 +1620,7 @@ pub const cpu = struct { |
| 1619 | 1620 | .x87, |
| 1620 | 1621 | }), |
| 1621 | 1622 | }; |
| 1622 | pub const geode = Cpu{ | |
| 1623 | pub const geode = CpuModel{ | |
| 1623 | 1624 | .name = "geode", |
| 1624 | 1625 | .llvm_name = "geode", |
| 1625 | 1626 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1629,7 +1630,7 @@ pub const cpu = struct { |
| 1629 | 1630 | .x87, |
| 1630 | 1631 | }), |
| 1631 | 1632 | }; |
| 1632 | pub const goldmont = Cpu{ | |
| 1633 | pub const goldmont = CpuModel{ | |
| 1633 | 1634 | .name = "goldmont", |
| 1634 | 1635 | .llvm_name = "goldmont", |
| 1635 | 1636 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1665,7 +1666,7 @@ pub const cpu = struct { |
| 1665 | 1666 | .xsaves, |
| 1666 | 1667 | }), |
| 1667 | 1668 | }; |
| 1668 | pub const goldmont_plus = Cpu{ | |
| 1669 | pub const goldmont_plus = CpuModel{ | |
| 1669 | 1670 | .name = "goldmont_plus", |
| 1670 | 1671 | .llvm_name = "goldmont-plus", |
| 1671 | 1672 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1703,7 +1704,7 @@ pub const cpu = struct { |
| 1703 | 1704 | .xsaves, |
| 1704 | 1705 | }), |
| 1705 | 1706 | }; |
| 1706 | pub const haswell = Cpu{ | |
| 1707 | pub const haswell = CpuModel{ | |
| 1707 | 1708 | .name = "haswell", |
| 1708 | 1709 | .llvm_name = "haswell", |
| 1709 | 1710 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1744,7 +1745,7 @@ pub const cpu = struct { |
| 1744 | 1745 | .xsaveopt, |
| 1745 | 1746 | }), |
| 1746 | 1747 | }; |
| 1747 | pub const _i386 = Cpu{ | |
| 1748 | pub const _i386 = CpuModel{ | |
| 1748 | 1749 | .name = "_i386", |
| 1749 | 1750 | .llvm_name = "i386", |
| 1750 | 1751 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1752,7 +1753,7 @@ pub const cpu = struct { |
| 1752 | 1753 | .x87, |
| 1753 | 1754 | }), |
| 1754 | 1755 | }; |
| 1755 | pub const _i486 = Cpu{ | |
| 1756 | pub const _i486 = CpuModel{ | |
| 1756 | 1757 | .name = "_i486", |
| 1757 | 1758 | .llvm_name = "i486", |
| 1758 | 1759 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1760,7 +1761,7 @@ pub const cpu = struct { |
| 1760 | 1761 | .x87, |
| 1761 | 1762 | }), |
| 1762 | 1763 | }; |
| 1763 | pub const _i586 = Cpu{ | |
| 1764 | pub const _i586 = CpuModel{ | |
| 1764 | 1765 | .name = "_i586", |
| 1765 | 1766 | .llvm_name = "i586", |
| 1766 | 1767 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1769,7 +1770,7 @@ pub const cpu = struct { |
| 1769 | 1770 | .x87, |
| 1770 | 1771 | }), |
| 1771 | 1772 | }; |
| 1772 | pub const _i686 = Cpu{ | |
| 1773 | pub const _i686 = CpuModel{ | |
| 1773 | 1774 | .name = "_i686", |
| 1774 | 1775 | .llvm_name = "i686", |
| 1775 | 1776 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1779,7 +1780,7 @@ pub const cpu = struct { |
| 1779 | 1780 | .x87, |
| 1780 | 1781 | }), |
| 1781 | 1782 | }; |
| 1782 | pub const icelake_client = Cpu{ | |
| 1783 | pub const icelake_client = CpuModel{ | |
| 1783 | 1784 | .name = "icelake_client", |
| 1784 | 1785 | .llvm_name = "icelake-client", |
| 1785 | 1786 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1847,7 +1848,7 @@ pub const cpu = struct { |
| 1847 | 1848 | .xsaves, |
| 1848 | 1849 | }), |
| 1849 | 1850 | }; |
| 1850 | pub const icelake_server = Cpu{ | |
| 1851 | pub const icelake_server = CpuModel{ | |
| 1851 | 1852 | .name = "icelake_server", |
| 1852 | 1853 | .llvm_name = "icelake-server", |
| 1853 | 1854 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1917,7 +1918,7 @@ pub const cpu = struct { |
| 1917 | 1918 | .xsaves, |
| 1918 | 1919 | }), |
| 1919 | 1920 | }; |
| 1920 | pub const ivybridge = Cpu{ | |
| 1921 | pub const ivybridge = CpuModel{ | |
| 1921 | 1922 | .name = "ivybridge", |
| 1922 | 1923 | .llvm_name = "ivybridge", |
| 1923 | 1924 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1949,7 +1950,7 @@ pub const cpu = struct { |
| 1949 | 1950 | .xsaveopt, |
| 1950 | 1951 | }), |
| 1951 | 1952 | }; |
| 1952 | pub const k6 = Cpu{ | |
| 1953 | pub const k6 = CpuModel{ | |
| 1953 | 1954 | .name = "k6", |
| 1954 | 1955 | .llvm_name = "k6", |
| 1955 | 1956 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1959,7 +1960,7 @@ pub const cpu = struct { |
| 1959 | 1960 | .x87, |
| 1960 | 1961 | }), |
| 1961 | 1962 | }; |
| 1962 | pub const k6_2 = Cpu{ | |
| 1963 | pub const k6_2 = CpuModel{ | |
| 1963 | 1964 | .name = "k6_2", |
| 1964 | 1965 | .llvm_name = "k6-2", |
| 1965 | 1966 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1969,7 +1970,7 @@ pub const cpu = struct { |
| 1969 | 1970 | .x87, |
| 1970 | 1971 | }), |
| 1971 | 1972 | }; |
| 1972 | pub const k6_3 = Cpu{ | |
| 1973 | pub const k6_3 = CpuModel{ | |
| 1973 | 1974 | .name = "k6_3", |
| 1974 | 1975 | .llvm_name = "k6-3", |
| 1975 | 1976 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1979,7 +1980,7 @@ pub const cpu = struct { |
| 1979 | 1980 | .x87, |
| 1980 | 1981 | }), |
| 1981 | 1982 | }; |
| 1982 | pub const k8 = Cpu{ | |
| 1983 | pub const k8 = CpuModel{ | |
| 1983 | 1984 | .name = "k8", |
| 1984 | 1985 | .llvm_name = "k8", |
| 1985 | 1986 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -1996,7 +1997,7 @@ pub const cpu = struct { |
| 1996 | 1997 | .x87, |
| 1997 | 1998 | }), |
| 1998 | 1999 | }; |
| 1999 | pub const k8_sse3 = Cpu{ | |
| 2000 | pub const k8_sse3 = CpuModel{ | |
| 2000 | 2001 | .name = "k8_sse3", |
| 2001 | 2002 | .llvm_name = "k8-sse3", |
| 2002 | 2003 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -2014,7 +2015,7 @@ pub const cpu = struct { |
| 2014 | 2015 | .x87, |
| 2015 | 2016 | }), |
| 2016 | 2017 | }; |
| 2017 | pub const knl = Cpu{ | |
| 2018 | pub const knl = CpuModel{ | |
| 2018 | 2019 | .name = "knl", |
| 2019 | 2020 | .llvm_name = "knl", |
| 2020 | 2021 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -2057,7 +2058,7 @@ pub const cpu = struct { |
| 2057 | 2058 | .xsaveopt, |
| 2058 | 2059 | }), |
| 2059 | 2060 | }; |
| 2060 | pub const knm = Cpu{ | |
| 2061 | pub const knm = CpuModel{ | |
| 2061 | 2062 | .name = "knm", |
| 2062 | 2063 | .llvm_name = "knm", |
| 2063 | 2064 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -2101,12 +2102,12 @@ pub const cpu = struct { |
| 2101 | 2102 | .xsaveopt, |
| 2102 | 2103 | }), |
| 2103 | 2104 | }; |
| 2104 | pub const lakemont = Cpu{ | |
| 2105 | pub const lakemont = CpuModel{ | |
| 2105 | 2106 | .name = "lakemont", |
| 2106 | 2107 | .llvm_name = "lakemont", |
| 2107 | 2108 | .features = featureSet(&[_]Feature{}), |
| 2108 | 2109 | }; |
| 2109 | pub const nehalem = Cpu{ | |
| 2110 | pub const nehalem = CpuModel{ | |
| 2110 | 2111 | .name = "nehalem", |
| 2111 | 2112 | .llvm_name = "nehalem", |
| 2112 | 2113 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -2124,7 +2125,7 @@ pub const cpu = struct { |
| 2124 | 2125 | .x87, |
| 2125 | 2126 | }), |
| 2126 | 2127 | }; |
| 2127 | pub const nocona = Cpu{ | |
| 2128 | pub const nocona = CpuModel{ | |
| 2128 | 2129 | .name = "nocona", |
| 2129 | 2130 | .llvm_name = "nocona", |
| 2130 | 2131 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -2140,7 +2141,7 @@ pub const cpu = struct { |
| 2140 | 2141 | .x87, |
| 2141 | 2142 | }), |
| 2142 | 2143 | }; |
| 2143 | pub const opteron = Cpu{ | |
| 2144 | pub const opteron = CpuModel{ | |
| 2144 | 2145 | .name = "opteron", |
| 2145 | 2146 | .llvm_name = "opteron", |
| 2146 | 2147 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -2157,7 +2158,7 @@ pub const cpu = struct { |
| 2157 | 2158 | .x87, |
| 2158 | 2159 | }), |
| 2159 | 2160 | }; |
| 2160 | pub const opteron_sse3 = Cpu{ | |
| 2161 | pub const opteron_sse3 = CpuModel{ | |
| 2161 | 2162 | .name = "opteron_sse3", |
| 2162 | 2163 | .llvm_name = "opteron-sse3", |
| 2163 | 2164 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -2175,7 +2176,7 @@ pub const cpu = struct { |
| 2175 | 2176 | .x87, |
| 2176 | 2177 | }), |
| 2177 | 2178 | }; |
| 2178 | pub const penryn = Cpu{ | |
| 2179 | pub const penryn = CpuModel{ | |
| 2179 | 2180 | .name = "penryn", |
| 2180 | 2181 | .llvm_name = "penryn", |
| 2181 | 2182 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -2193,7 +2194,7 @@ pub const cpu = struct { |
| 2193 | 2194 | .x87, |
| 2194 | 2195 | }), |
| 2195 | 2196 | }; |
| 2196 | pub const pentium = Cpu{ | |
| 2197 | pub const pentium = CpuModel{ | |
| 2197 | 2198 | .name = "pentium", |
| 2198 | 2199 | .llvm_name = "pentium", |
| 2199 | 2200 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -2202,7 +2203,7 @@ pub const cpu = struct { |
| 2202 | 2203 | .x87, |
| 2203 | 2204 | }), |
| 2204 | 2205 | }; |
| 2205 | pub const pentium_m = Cpu{ | |
| 2206 | pub const pentium_m = CpuModel{ | |
| 2206 | 2207 | .name = "pentium_m", |
| 2207 | 2208 | .llvm_name = "pentium-m", |
| 2208 | 2209 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -2216,7 +2217,7 @@ pub const cpu = struct { |
| 2216 | 2217 | .x87, |
| 2217 | 2218 | }), |
| 2218 | 2219 | }; |
| 2219 | pub const pentium_mmx = Cpu{ | |
| 2220 | pub const pentium_mmx = CpuModel{ | |
| 2220 | 2221 | .name = "pentium_mmx", |
| 2221 | 2222 | .llvm_name = "pentium-mmx", |
| 2222 | 2223 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -2226,7 +2227,7 @@ pub const cpu = struct { |
| 2226 | 2227 | .x87, |
| 2227 | 2228 | }), |
| 2228 | 2229 | }; |
| 2229 | pub const pentium2 = Cpu{ | |
| 2230 | pub const pentium2 = CpuModel{ | |
| 2230 | 2231 | .name = "pentium2", |
| 2231 | 2232 | .llvm_name = "pentium2", |
| 2232 | 2233 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -2239,7 +2240,7 @@ pub const cpu = struct { |
| 2239 | 2240 | .x87, |
| 2240 | 2241 | }), |
| 2241 | 2242 | }; |
| 2242 | pub const pentium3 = Cpu{ | |
| 2243 | pub const pentium3 = CpuModel{ | |
| 2243 | 2244 | .name = "pentium3", |
| 2244 | 2245 | .llvm_name = "pentium3", |
| 2245 | 2246 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -2253,7 +2254,7 @@ pub const cpu = struct { |
| 2253 | 2254 | .x87, |
| 2254 | 2255 | }), |
| 2255 | 2256 | }; |
| 2256 | pub const pentium3m = Cpu{ | |
| 2257 | pub const pentium3m = CpuModel{ | |
| 2257 | 2258 | .name = "pentium3m", |
| 2258 | 2259 | .llvm_name = "pentium3m", |
| 2259 | 2260 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -2267,7 +2268,7 @@ pub const cpu = struct { |
| 2267 | 2268 | .x87, |
| 2268 | 2269 | }), |
| 2269 | 2270 | }; |
| 2270 | pub const pentium4 = Cpu{ | |
| 2271 | pub const pentium4 = CpuModel{ | |
| 2271 | 2272 | .name = "pentium4", |
| 2272 | 2273 | .llvm_name = "pentium4", |
| 2273 | 2274 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -2281,7 +2282,7 @@ pub const cpu = struct { |
| 2281 | 2282 | .x87, |
| 2282 | 2283 | }), |
| 2283 | 2284 | }; |
| 2284 | pub const pentium4m = Cpu{ | |
| 2285 | pub const pentium4m = CpuModel{ | |
| 2285 | 2286 | .name = "pentium4m", |
| 2286 | 2287 | .llvm_name = "pentium4m", |
| 2287 | 2288 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -2295,7 +2296,7 @@ pub const cpu = struct { |
| 2295 | 2296 | .x87, |
| 2296 | 2297 | }), |
| 2297 | 2298 | }; |
| 2298 | pub const pentiumpro = Cpu{ | |
| 2299 | pub const pentiumpro = CpuModel{ | |
| 2299 | 2300 | .name = "pentiumpro", |
| 2300 | 2301 | .llvm_name = "pentiumpro", |
| 2301 | 2302 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -2306,7 +2307,7 @@ pub const cpu = struct { |
| 2306 | 2307 | .x87, |
| 2307 | 2308 | }), |
| 2308 | 2309 | }; |
| 2309 | pub const prescott = Cpu{ | |
| 2310 | pub const prescott = CpuModel{ | |
| 2310 | 2311 | .name = "prescott", |
| 2311 | 2312 | .llvm_name = "prescott", |
| 2312 | 2313 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -2320,7 +2321,7 @@ pub const cpu = struct { |
| 2320 | 2321 | .x87, |
| 2321 | 2322 | }), |
| 2322 | 2323 | }; |
| 2323 | pub const sandybridge = Cpu{ | |
| 2324 | pub const sandybridge = CpuModel{ | |
| 2324 | 2325 | .name = "sandybridge", |
| 2325 | 2326 | .llvm_name = "sandybridge", |
| 2326 | 2327 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -2349,7 +2350,7 @@ pub const cpu = struct { |
| 2349 | 2350 | .xsaveopt, |
| 2350 | 2351 | }), |
| 2351 | 2352 | }; |
| 2352 | pub const silvermont = Cpu{ | |
| 2353 | pub const silvermont = CpuModel{ | |
| 2353 | 2354 | .name = "silvermont", |
| 2354 | 2355 | .llvm_name = "silvermont", |
| 2355 | 2356 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -2377,7 +2378,7 @@ pub const cpu = struct { |
| 2377 | 2378 | .x87, |
| 2378 | 2379 | }), |
| 2379 | 2380 | }; |
| 2380 | pub const skx = Cpu{ | |
| 2381 | pub const skx = CpuModel{ | |
| 2381 | 2382 | .name = "skx", |
| 2382 | 2383 | .llvm_name = "skx", |
| 2383 | 2384 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -2434,7 +2435,7 @@ pub const cpu = struct { |
| 2434 | 2435 | .xsaves, |
| 2435 | 2436 | }), |
| 2436 | 2437 | }; |
| 2437 | pub const skylake = Cpu{ | |
| 2438 | pub const skylake = CpuModel{ | |
| 2438 | 2439 | .name = "skylake", |
| 2439 | 2440 | .llvm_name = "skylake", |
| 2440 | 2441 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -2485,7 +2486,7 @@ pub const cpu = struct { |
| 2485 | 2486 | .xsaves, |
| 2486 | 2487 | }), |
| 2487 | 2488 | }; |
| 2488 | pub const skylake_avx512 = Cpu{ | |
| 2489 | pub const skylake_avx512 = CpuModel{ | |
| 2489 | 2490 | .name = "skylake_avx512", |
| 2490 | 2491 | .llvm_name = "skylake-avx512", |
| 2491 | 2492 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -2542,7 +2543,7 @@ pub const cpu = struct { |
| 2542 | 2543 | .xsaves, |
| 2543 | 2544 | }), |
| 2544 | 2545 | }; |
| 2545 | pub const slm = Cpu{ | |
| 2546 | pub const slm = CpuModel{ | |
| 2546 | 2547 | .name = "slm", |
| 2547 | 2548 | .llvm_name = "slm", |
| 2548 | 2549 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -2570,7 +2571,7 @@ pub const cpu = struct { |
| 2570 | 2571 | .x87, |
| 2571 | 2572 | }), |
| 2572 | 2573 | }; |
| 2573 | pub const tremont = Cpu{ | |
| 2574 | pub const tremont = CpuModel{ | |
| 2574 | 2575 | .name = "tremont", |
| 2575 | 2576 | .llvm_name = "tremont", |
| 2576 | 2577 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -2613,7 +2614,7 @@ pub const cpu = struct { |
| 2613 | 2614 | .xsaves, |
| 2614 | 2615 | }), |
| 2615 | 2616 | }; |
| 2616 | pub const westmere = Cpu{ | |
| 2617 | pub const westmere = CpuModel{ | |
| 2617 | 2618 | .name = "westmere", |
| 2618 | 2619 | .llvm_name = "westmere", |
| 2619 | 2620 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -2632,7 +2633,7 @@ pub const cpu = struct { |
| 2632 | 2633 | .x87, |
| 2633 | 2634 | }), |
| 2634 | 2635 | }; |
| 2635 | pub const winchip_c6 = Cpu{ | |
| 2636 | pub const winchip_c6 = CpuModel{ | |
| 2636 | 2637 | .name = "winchip_c6", |
| 2637 | 2638 | .llvm_name = "winchip-c6", |
| 2638 | 2639 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -2641,7 +2642,7 @@ pub const cpu = struct { |
| 2641 | 2642 | .x87, |
| 2642 | 2643 | }), |
| 2643 | 2644 | }; |
| 2644 | pub const winchip2 = Cpu{ | |
| 2645 | pub const winchip2 = CpuModel{ | |
| 2645 | 2646 | .name = "winchip2", |
| 2646 | 2647 | .llvm_name = "winchip2", |
| 2647 | 2648 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -2650,7 +2651,7 @@ pub const cpu = struct { |
| 2650 | 2651 | .x87, |
| 2651 | 2652 | }), |
| 2652 | 2653 | }; |
| 2653 | pub const x86_64 = Cpu{ | |
| 2654 | pub const x86_64 = CpuModel{ | |
| 2654 | 2655 | .name = "x86_64", |
| 2655 | 2656 | .llvm_name = "x86-64", |
| 2656 | 2657 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -2667,7 +2668,7 @@ pub const cpu = struct { |
| 2667 | 2668 | .x87, |
| 2668 | 2669 | }), |
| 2669 | 2670 | }; |
| 2670 | pub const yonah = Cpu{ | |
| 2671 | pub const yonah = CpuModel{ | |
| 2671 | 2672 | .name = "yonah", |
| 2672 | 2673 | .llvm_name = "yonah", |
| 2673 | 2674 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -2681,7 +2682,7 @@ pub const cpu = struct { |
| 2681 | 2682 | .x87, |
| 2682 | 2683 | }), |
| 2683 | 2684 | }; |
| 2684 | pub const znver1 = Cpu{ | |
| 2685 | pub const znver1 = CpuModel{ | |
| 2685 | 2686 | .name = "znver1", |
| 2686 | 2687 | .llvm_name = "znver1", |
| 2687 | 2688 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -2725,7 +2726,7 @@ pub const cpu = struct { |
| 2725 | 2726 | .xsaves, |
| 2726 | 2727 | }), |
| 2727 | 2728 | }; |
| 2728 | pub const znver2 = Cpu{ | |
| 2729 | pub const znver2 = CpuModel{ | |
| 2729 | 2730 | .name = "znver2", |
| 2730 | 2731 | .llvm_name = "znver2", |
| 2731 | 2732 | .features = featureSet(&[_]Feature{ |
| ... | ... | @@ -2777,7 +2778,7 @@ pub const cpu = struct { |
| 2777 | 2778 | /// All x86 CPUs, sorted alphabetically by name. |
| 2778 | 2779 | /// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1 |
| 2779 | 2780 | /// compiler has inefficient memory and CPU usage, affecting build times. |
| 2780 | pub const all_cpus = &[_]*const Cpu{ | |
| 2781 | pub const all_cpus = &[_]*const CpuModel{ | |
| 2781 | 2782 | &cpu.amdfam10, |
| 2782 | 2783 | &cpu.athlon, |
| 2783 | 2784 | &cpu.athlon_4, |
src-self-hosted/libc_installation.zig+1-2| ... | ... | @@ -577,10 +577,9 @@ pub fn detectNativeDynamicLinker(allocator: *Allocator) error{ |
| 577 | 577 | // skip adding it to `ld_info_list`. |
| 578 | 578 | const target: Target = .{ |
| 579 | 579 | .Cross = .{ |
| 580 | .arch = Target.current.getArch(), | |
| 580 | .cpu = Target.Cpu.baseline(Target.current.getArch()), | |
| 581 | 581 | .os = Target.current.getOs(), |
| 582 | 582 | .abi = abi, |
| 583 | .cpu_features = Target.current.getArch().getBaselineCpuFeatures(), | |
| 584 | 583 | }, |
| 585 | 584 | }; |
| 586 | 585 | const standard_ld_path = target.getStandardDynamicLinkerPath(allocator) catch |err| switch (err) { |
src-self-hosted/print_targets.zig+34-50| ... | ... | @@ -113,37 +113,14 @@ pub fn cmdTargets( |
| 113 | 113 | try jws.beginObject(); |
| 114 | 114 | |
| 115 | 115 | try jws.objectField("arch"); |
| 116 | try jws.beginObject(); | |
| 116 | try jws.beginArray(); | |
| 117 | 117 | { |
| 118 | inline for (@typeInfo(Target.Arch).Union.fields) |field| { | |
| 119 | try jws.objectField(field.name); | |
| 120 | if (field.field_type == void) { | |
| 121 | try jws.emitNull(); | |
| 122 | } else { | |
| 123 | try jws.emitString(@typeName(field.field_type)); | |
| 124 | } | |
| 125 | } | |
| 126 | } | |
| 127 | try jws.endObject(); | |
| 128 | ||
| 129 | try jws.objectField("subArch"); | |
| 130 | try jws.beginObject(); | |
| 131 | const sub_arch_list = [_]type{ | |
| 132 | Target.Arch.Arm32, | |
| 133 | Target.Arch.Arm64, | |
| 134 | Target.Arch.Kalimba, | |
| 135 | Target.Arch.Mips, | |
| 136 | }; | |
| 137 | inline for (sub_arch_list) |SubArch| { | |
| 138 | try jws.objectField(@typeName(SubArch)); | |
| 139 | try jws.beginArray(); | |
| 140 | inline for (@typeInfo(SubArch).Enum.fields) |field| { | |
| 118 | inline for (@typeInfo(Target.Cpu.Arch).Enum.fields) |field| { | |
| 141 | 119 | try jws.arrayElem(); |
| 142 | 120 | try jws.emitString(field.name); |
| 143 | 121 | } |
| 144 | try jws.endArray(); | |
| 145 | 122 | } |
| 146 | try jws.endObject(); | |
| 123 | try jws.endArray(); | |
| 147 | 124 | |
| 148 | 125 | try jws.objectField("os"); |
| 149 | 126 | try jws.beginArray(); |
| ... | ... | @@ -179,15 +156,15 @@ pub fn cmdTargets( |
| 179 | 156 | |
| 180 | 157 | try jws.objectField("cpus"); |
| 181 | 158 | try jws.beginObject(); |
| 182 | inline for (@typeInfo(Target.Arch).Union.fields) |field| { | |
| 159 | inline for (@typeInfo(Target.Cpu.Arch).Enum.fields) |field| { | |
| 183 | 160 | try jws.objectField(field.name); |
| 184 | 161 | try jws.beginObject(); |
| 185 | const arch = @unionInit(Target.Arch, field.name, undefined); | |
| 186 | for (arch.allCpus()) |cpu| { | |
| 187 | try jws.objectField(cpu.name); | |
| 162 | const arch = @field(Target.Cpu.Arch, field.name); | |
| 163 | for (arch.allCpuModels()) |model| { | |
| 164 | try jws.objectField(model.name); | |
| 188 | 165 | try jws.beginArray(); |
| 189 | 166 | for (arch.allFeaturesList()) |feature, i| { |
| 190 | if (cpu.features.isEnabled(@intCast(u8, i))) { | |
| 167 | if (model.features.isEnabled(@intCast(u8, i))) { | |
| 191 | 168 | try jws.arrayElem(); |
| 192 | 169 | try jws.emitString(feature.name); |
| 193 | 170 | } |
| ... | ... | @@ -200,10 +177,10 @@ pub fn cmdTargets( |
| 200 | 177 | |
| 201 | 178 | try jws.objectField("cpuFeatures"); |
| 202 | 179 | try jws.beginObject(); |
| 203 | inline for (@typeInfo(Target.Arch).Union.fields) |field| { | |
| 180 | inline for (@typeInfo(Target.Cpu.Arch).Enum.fields) |field| { | |
| 204 | 181 | try jws.objectField(field.name); |
| 205 | 182 | try jws.beginArray(); |
| 206 | const arch = @unionInit(Target.Arch, field.name, undefined); | |
| 183 | const arch = @field(Target.Cpu.Arch, field.name); | |
| 207 | 184 | for (arch.allFeaturesList()) |feature| { |
| 208 | 185 | try jws.arrayElem(); |
| 209 | 186 | try jws.emitString(feature.name); |
| ... | ... | @@ -220,27 +197,34 @@ pub fn cmdTargets( |
| 220 | 197 | try jws.objectField("triple"); |
| 221 | 198 | try jws.emitString(triple); |
| 222 | 199 | } |
| 223 | try jws.objectField("arch"); | |
| 224 | try jws.emitString(@tagName(native_target.getArch())); | |
| 225 | try jws.objectField("os"); | |
| 226 | try jws.emitString(@tagName(native_target.getOs())); | |
| 227 | try jws.objectField("abi"); | |
| 228 | try jws.emitString(@tagName(native_target.getAbi())); | |
| 229 | try jws.objectField("cpuName"); | |
| 230 | const cpu_features = native_target.getCpuFeatures(); | |
| 231 | try jws.emitString(cpu_features.cpu.name); | |
| 232 | 200 | { |
| 233 | try jws.objectField("cpuFeatures"); | |
| 234 | try jws.beginArray(); | |
| 235 | for (native_target.getArch().allFeaturesList()) |feature, i_usize| { | |
| 236 | const index = @intCast(Target.Cpu.Feature.Set.Index, i_usize); | |
| 237 | if (cpu_features.features.isEnabled(index)) { | |
| 238 | try jws.arrayElem(); | |
| 239 | try jws.emitString(feature.name); | |
| 201 | try jws.objectField("cpu"); | |
| 202 | try jws.beginObject(); | |
| 203 | try jws.objectField("arch"); | |
| 204 | try jws.emitString(@tagName(native_target.getArch())); | |
| 205 | ||
| 206 | try jws.objectField("name"); | |
| 207 | const cpu = native_target.getCpu(); | |
| 208 | try jws.emitString(cpu.model.name); | |
| 209 | ||
| 210 | { | |
| 211 | try jws.objectField("features"); | |
| 212 | try jws.beginArray(); | |
| 213 | for (native_target.getArch().allFeaturesList()) |feature, i_usize| { | |
| 214 | const index = @intCast(Target.Cpu.Feature.Set.Index, i_usize); | |
| 215 | if (cpu.features.isEnabled(index)) { | |
| 216 | try jws.arrayElem(); | |
| 217 | try jws.emitString(feature.name); | |
| 218 | } | |
| 240 | 219 | } |
| 220 | try jws.endArray(); | |
| 241 | 221 | } |
| 242 | try jws.endArray(); | |
| 222 | try jws.endObject(); | |
| 243 | 223 | } |
| 224 | try jws.objectField("os"); | |
| 225 | try jws.emitString(@tagName(native_target.getOs())); | |
| 226 | try jws.objectField("abi"); | |
| 227 | try jws.emitString(@tagName(native_target.getAbi())); | |
| 244 | 228 | // TODO implement native glibc version detection in self-hosted |
| 245 | 229 | try jws.endObject(); |
| 246 | 230 |
src-self-hosted/stage2.zig+133-262| ... | ... | @@ -88,7 +88,6 @@ const Error = extern enum { |
| 88 | 88 | IsAsync, |
| 89 | 89 | ImportOutsidePkgPath, |
| 90 | 90 | UnknownCpu, |
| 91 | UnknownSubArchitecture, | |
| 92 | 91 | UnknownCpuFeature, |
| 93 | 92 | InvalidCpuFeatures, |
| 94 | 93 | InvalidLlvmCpuFeaturesFormat, |
| ... | ... | @@ -560,25 +559,26 @@ export fn stage2_progress_update_node(node: *std.Progress.Node, done_count: usiz |
| 560 | 559 | node.context.maybeRefresh(); |
| 561 | 560 | } |
| 562 | 561 | |
| 563 | fn cpuFeaturesFromLLVM( | |
| 564 | arch: Target.Arch, | |
| 562 | fn detectNativeCpuWithLLVM( | |
| 563 | arch: Target.Cpu.Arch, | |
| 565 | 564 | llvm_cpu_name_z: ?[*:0]const u8, |
| 566 | 565 | llvm_cpu_features_opt: ?[*:0]const u8, |
| 567 | ) !Target.CpuFeatures { | |
| 568 | var result = arch.getBaselineCpuFeatures(); | |
| 566 | ) !Target.Cpu { | |
| 567 | var result = Target.Cpu.baseline(arch); | |
| 569 | 568 | |
| 570 | 569 | if (llvm_cpu_name_z) |cpu_name_z| { |
| 571 | 570 | const llvm_cpu_name = mem.toSliceConst(u8, cpu_name_z); |
| 572 | 571 | |
| 573 | for (arch.allCpus()) |cpu| { | |
| 574 | const this_llvm_name = cpu.llvm_name orelse continue; | |
| 572 | for (arch.allCpuModels()) |model| { | |
| 573 | const this_llvm_name = model.llvm_name orelse continue; | |
| 575 | 574 | if (mem.eql(u8, this_llvm_name, llvm_cpu_name)) { |
| 576 | 575 | // Here we use the non-dependencies-populated set, |
| 577 | 576 | // so that subtracting features later in this function |
| 578 | 577 | // affect the prepopulated set. |
| 579 | result = Target.CpuFeatures{ | |
| 580 | .cpu = cpu, | |
| 581 | .features = cpu.features, | |
| 578 | result = Target.Cpu{ | |
| 579 | .arch = arch, | |
| 580 | .model = model, | |
| 581 | .features = model.features, | |
| 582 | 582 | }; |
| 583 | 583 | break; |
| 584 | 584 | } |
| ... | ... | @@ -632,12 +632,12 @@ export fn stage2_cmd_targets(zig_triple: [*:0]const u8) c_int { |
| 632 | 632 | } |
| 633 | 633 | |
| 634 | 634 | fn cmdTargets(zig_triple: [*:0]const u8) !void { |
| 635 | var target = try Target.parse(mem.toSliceConst(u8, zig_triple)); | |
| 636 | target.Cross.cpu_features = blk: { | |
| 635 | var target = try Target.parse(.{ .arch_os_abi = mem.toSliceConst(u8, zig_triple) }); | |
| 636 | target.Cross.cpu = blk: { | |
| 637 | 637 | const llvm = @import("llvm.zig"); |
| 638 | 638 | const llvm_cpu_name = llvm.GetHostCPUName(); |
| 639 | 639 | const llvm_cpu_features = llvm.GetNativeFeatures(); |
| 640 | break :blk try cpuFeaturesFromLLVM(target.Cross.arch, llvm_cpu_name, llvm_cpu_features); | |
| 640 | break :blk try detectNativeCpuWithLLVM(target.getArch(), llvm_cpu_name, llvm_cpu_features); | |
| 641 | 641 | }; |
| 642 | 642 | return @import("print_targets.zig").cmdTargets( |
| 643 | 643 | std.heap.c_allocator, |
| ... | ... | @@ -647,208 +647,101 @@ fn cmdTargets(zig_triple: [*:0]const u8) !void { |
| 647 | 647 | ); |
| 648 | 648 | } |
| 649 | 649 | |
| 650 | const Stage2CpuFeatures = struct { | |
| 651 | allocator: *mem.Allocator, | |
| 652 | cpu_features: Target.CpuFeatures, | |
| 653 | ||
| 654 | llvm_features_str: ?[*:0]const u8, | |
| 655 | ||
| 656 | builtin_str: [:0]const u8, | |
| 657 | cache_hash: [:0]const u8, | |
| 658 | ||
| 659 | const Self = @This(); | |
| 660 | ||
| 661 | fn createFromNative(allocator: *mem.Allocator) !*Self { | |
| 662 | const arch = Target.current.getArch(); | |
| 663 | const llvm = @import("llvm.zig"); | |
| 664 | const llvm_cpu_name = llvm.GetHostCPUName(); | |
| 665 | const llvm_cpu_features = llvm.GetNativeFeatures(); | |
| 666 | const cpu_features = try cpuFeaturesFromLLVM(arch, llvm_cpu_name, llvm_cpu_features); | |
| 667 | return createFromCpuFeatures(allocator, arch, cpu_features); | |
| 668 | } | |
| 669 | ||
| 670 | fn createFromCpuFeatures( | |
| 671 | allocator: *mem.Allocator, | |
| 672 | arch: Target.Arch, | |
| 673 | cpu_features: Target.CpuFeatures, | |
| 674 | ) !*Self { | |
| 675 | const self = try allocator.create(Self); | |
| 676 | errdefer allocator.destroy(self); | |
| 677 | ||
| 678 | const cache_hash = try std.fmt.allocPrint0(allocator, "{}\n{}", .{ | |
| 679 | cpu_features.cpu.name, | |
| 680 | cpu_features.features.asBytes(), | |
| 681 | }); | |
| 682 | errdefer allocator.free(cache_hash); | |
| 683 | ||
| 684 | const generic_arch_name = arch.genericName(); | |
| 685 | var builtin_str_buffer = try std.Buffer.allocPrint(allocator, | |
| 686 | \\CpuFeatures{{ | |
| 687 | \\ .cpu = &Target.{}.cpu.{}, | |
| 688 | \\ .features = Target.{}.featureSet(&[_]Target.{}.Feature{{ | |
| 689 | \\ | |
| 690 | , .{ | |
| 691 | generic_arch_name, | |
| 692 | cpu_features.cpu.name, | |
| 693 | generic_arch_name, | |
| 694 | generic_arch_name, | |
| 695 | }); | |
| 696 | defer builtin_str_buffer.deinit(); | |
| 697 | ||
| 698 | var llvm_features_buffer = try std.Buffer.initSize(allocator, 0); | |
| 699 | defer llvm_features_buffer.deinit(); | |
| 700 | ||
| 701 | for (arch.allFeaturesList()) |feature, index_usize| { | |
| 702 | const index = @intCast(Target.Cpu.Feature.Set.Index, index_usize); | |
| 703 | const is_enabled = cpu_features.features.isEnabled(index); | |
| 704 | ||
| 705 | if (feature.llvm_name) |llvm_name| { | |
| 706 | const plus_or_minus = "-+"[@boolToInt(is_enabled)]; | |
| 707 | try llvm_features_buffer.appendByte(plus_or_minus); | |
| 708 | try llvm_features_buffer.append(llvm_name); | |
| 709 | try llvm_features_buffer.append(","); | |
| 710 | } | |
| 711 | ||
| 712 | if (is_enabled) { | |
| 713 | // TODO some kind of "zig identifier escape" function rather than | |
| 714 | // unconditionally using @"" syntax | |
| 715 | try builtin_str_buffer.append(" .@\""); | |
| 716 | try builtin_str_buffer.append(feature.name); | |
| 717 | try builtin_str_buffer.append("\",\n"); | |
| 718 | } | |
| 719 | } | |
| 720 | ||
| 721 | try builtin_str_buffer.append( | |
| 722 | \\ }), | |
| 723 | \\}; | |
| 724 | \\ | |
| 725 | ); | |
| 726 | ||
| 727 | assert(mem.endsWith(u8, llvm_features_buffer.toSliceConst(), ",")); | |
| 728 | llvm_features_buffer.shrink(llvm_features_buffer.len() - 1); | |
| 729 | ||
| 730 | self.* = Self{ | |
| 731 | .allocator = allocator, | |
| 732 | .cpu_features = cpu_features, | |
| 733 | .llvm_features_str = llvm_features_buffer.toOwnedSlice().ptr, | |
| 734 | .builtin_str = builtin_str_buffer.toOwnedSlice(), | |
| 735 | .cache_hash = cache_hash, | |
| 736 | }; | |
| 737 | return self; | |
| 738 | } | |
| 739 | ||
| 740 | fn destroy(self: *Self) void { | |
| 741 | self.allocator.free(self.cache_hash); | |
| 742 | self.allocator.free(self.builtin_str); | |
| 743 | // TODO if (self.llvm_features_str) |llvm_features_str| self.allocator.free(llvm_features_str); | |
| 744 | self.allocator.destroy(self); | |
| 745 | } | |
| 746 | }; | |
| 747 | ||
| 748 | 650 | // ABI warning |
| 749 | export fn stage2_cpu_features_parse( | |
| 750 | result: **Stage2CpuFeatures, | |
| 651 | export fn stage2_target_parse( | |
| 652 | target: *Stage2Target, | |
| 751 | 653 | zig_triple: ?[*:0]const u8, |
| 752 | cpu_name: ?[*:0]const u8, | |
| 753 | cpu_features: ?[*:0]const u8, | |
| 654 | mcpu: ?[*:0]const u8, | |
| 754 | 655 | ) Error { |
| 755 | result.* = stage2ParseCpuFeatures(zig_triple, cpu_name, cpu_features) catch |err| switch (err) { | |
| 656 | stage2TargetParse(target, zig_triple, mcpu) catch |err| switch (err) { | |
| 756 | 657 | error.OutOfMemory => return .OutOfMemory, |
| 757 | 658 | error.UnknownArchitecture => return .UnknownArchitecture, |
| 758 | error.UnknownSubArchitecture => return .UnknownSubArchitecture, | |
| 759 | 659 | error.UnknownOperatingSystem => return .UnknownOperatingSystem, |
| 760 | 660 | error.UnknownApplicationBinaryInterface => return .UnknownApplicationBinaryInterface, |
| 761 | 661 | error.MissingOperatingSystem => return .MissingOperatingSystem, |
| 762 | 662 | error.MissingArchitecture => return .MissingArchitecture, |
| 763 | 663 | error.InvalidLlvmCpuFeaturesFormat => return .InvalidLlvmCpuFeaturesFormat, |
| 764 | error.InvalidCpuFeatures => return .InvalidCpuFeatures, | |
| 664 | error.UnknownCpu => return .UnknownCpu, | |
| 665 | error.UnexpectedExtraField => return .SemanticAnalyzeFail, | |
| 666 | error.UnknownCpuFeature => return .UnknownCpuFeature, | |
| 765 | 667 | }; |
| 766 | 668 | return .None; |
| 767 | 669 | } |
| 768 | 670 | |
| 769 | fn stage2ParseCpuFeatures( | |
| 671 | fn stage2TargetParse( | |
| 672 | stage1_target: *Stage2Target, | |
| 770 | 673 | zig_triple_oz: ?[*:0]const u8, |
| 771 | cpu_name_oz: ?[*:0]const u8, | |
| 772 | cpu_features_oz: ?[*:0]const u8, | |
| 773 | ) !*Stage2CpuFeatures { | |
| 774 | const zig_triple_z = zig_triple_oz orelse return Stage2CpuFeatures.createFromNative(std.heap.c_allocator); | |
| 775 | const target = try Target.parse(mem.toSliceConst(u8, zig_triple_z)); | |
| 776 | const arch = target.Cross.arch; | |
| 777 | ||
| 778 | const cpu = if (cpu_name_oz) |cpu_name_z| blk: { | |
| 779 | const cpu_name = mem.toSliceConst(u8, cpu_name_z); | |
| 780 | break :blk arch.parseCpu(cpu_name) catch |err| switch (err) { | |
| 781 | error.UnknownCpu => { | |
| 782 | std.debug.warn("Unknown CPU: '{}'\nAvailable CPUs for architecture '{}':\n", .{ | |
| 783 | cpu_name, | |
| 784 | @tagName(arch), | |
| 785 | }); | |
| 786 | for (arch.allCpus()) |cpu| { | |
| 787 | std.debug.warn(" {}\n", .{cpu.name}); | |
| 788 | } | |
| 789 | process.exit(1); | |
| 790 | }, | |
| 791 | else => |e| return e, | |
| 792 | }; | |
| 793 | } else target.Cross.cpu_features.cpu; | |
| 794 | ||
| 795 | var set = if (cpu_features_oz) |cpu_features_z| blk: { | |
| 796 | const cpu_features = mem.toSliceConst(u8, cpu_features_z); | |
| 797 | break :blk arch.parseCpuFeatureSet(cpu, cpu_features) catch |err| switch (err) { | |
| 798 | error.UnknownCpuFeature => { | |
| 799 | std.debug.warn( | |
| 800 | \\Unknown CPU features specified. | |
| 801 | \\Available CPU features for architecture '{}': | |
| 802 | \\ | |
| 803 | , .{@tagName(arch)}); | |
| 804 | for (arch.allFeaturesList()) |feature| { | |
| 805 | std.debug.warn(" {}\n", .{feature.name}); | |
| 806 | } | |
| 807 | process.exit(1); | |
| 808 | }, | |
| 809 | else => |e| return e, | |
| 810 | }; | |
| 811 | } else cpu.features; | |
| 674 | mcpu_oz: ?[*:0]const u8, | |
| 675 | ) !void { | |
| 676 | const target: Target = if (zig_triple_oz) |zig_triple_z| blk: { | |
| 677 | const zig_triple = mem.toSliceConst(u8, zig_triple_z); | |
| 678 | const mcpu = if (mcpu_oz) |mcpu_z| mem.toSliceConst(u8, mcpu_z) else null; | |
| 679 | break :blk try Target.parse(.{ .arch_os_abi = zig_triple, .cpu = mcpu }); | |
| 680 | } else Target.Native; | |
| 812 | 681 | |
| 813 | if (arch.subArchFeature()) |index| { | |
| 814 | set.addFeature(index); | |
| 815 | } | |
| 816 | set.populateDependencies(arch.allFeaturesList()); | |
| 682 | try stage1_target.fromTarget(target); | |
| 683 | } | |
| 817 | 684 | |
| 818 | return Stage2CpuFeatures.createFromCpuFeatures(std.heap.c_allocator, arch, .{ | |
| 819 | .cpu = cpu, | |
| 820 | .features = set, | |
| 685 | fn initStage1TargetCpuFeatures(stage1_target: *Stage2Target, cpu: Target.Cpu) !void { | |
| 686 | const allocator = std.heap.c_allocator; | |
| 687 | const cache_hash = try std.fmt.allocPrint0(allocator, "{}\n{}", .{ | |
| 688 | cpu.model.name, | |
| 689 | cpu.features.asBytes(), | |
| 821 | 690 | }); |
| 822 | } | |
| 691 | errdefer allocator.free(cache_hash); | |
| 692 | ||
| 693 | const generic_arch_name = cpu.arch.genericName(); | |
| 694 | var builtin_str_buffer = try std.Buffer.allocPrint(allocator, | |
| 695 | \\Cpu{{ | |
| 696 | \\ .arch = .{}, | |
| 697 | \\ .model = &Target.{}.cpu.{}, | |
| 698 | \\ .features = Target.{}.featureSet(&[_]Target.{}.Feature{{ | |
| 699 | \\ | |
| 700 | , .{ | |
| 701 | @tagName(cpu.arch), | |
| 702 | generic_arch_name, | |
| 703 | cpu.model.name, | |
| 704 | generic_arch_name, | |
| 705 | generic_arch_name, | |
| 706 | }); | |
| 707 | defer builtin_str_buffer.deinit(); | |
| 823 | 708 | |
| 824 | // ABI warning | |
| 825 | export fn stage2_cpu_features_get_cache_hash( | |
| 826 | cpu_features: *const Stage2CpuFeatures, | |
| 827 | ptr: *[*:0]const u8, | |
| 828 | len: *usize, | |
| 829 | ) void { | |
| 830 | ptr.* = cpu_features.cache_hash.ptr; | |
| 831 | len.* = cpu_features.cache_hash.len; | |
| 832 | } | |
| 709 | var llvm_features_buffer = try std.Buffer.initSize(allocator, 0); | |
| 710 | defer llvm_features_buffer.deinit(); | |
| 833 | 711 | |
| 834 | // ABI warning | |
| 835 | export fn stage2_cpu_features_get_builtin_str( | |
| 836 | cpu_features: *const Stage2CpuFeatures, | |
| 837 | ptr: *[*:0]const u8, | |
| 838 | len: *usize, | |
| 839 | ) void { | |
| 840 | ptr.* = cpu_features.builtin_str.ptr; | |
| 841 | len.* = cpu_features.builtin_str.len; | |
| 842 | } | |
| 712 | for (cpu.arch.allFeaturesList()) |feature, index_usize| { | |
| 713 | const index = @intCast(Target.Cpu.Feature.Set.Index, index_usize); | |
| 714 | const is_enabled = cpu.features.isEnabled(index); | |
| 843 | 715 | |
| 844 | // ABI warning | |
| 845 | export fn stage2_cpu_features_get_llvm_cpu(cpu_features: *const Stage2CpuFeatures) ?[*:0]const u8 { | |
| 846 | return if (cpu_features.cpu_features.cpu.llvm_name) |s| s.ptr else null; | |
| 847 | } | |
| 716 | if (feature.llvm_name) |llvm_name| { | |
| 717 | const plus_or_minus = "-+"[@boolToInt(is_enabled)]; | |
| 718 | try llvm_features_buffer.appendByte(plus_or_minus); | |
| 719 | try llvm_features_buffer.append(llvm_name); | |
| 720 | try llvm_features_buffer.append(","); | |
| 721 | } | |
| 848 | 722 | |
| 849 | // ABI warning | |
| 850 | export fn stage2_cpu_features_get_llvm_features(cpu_features: *const Stage2CpuFeatures) ?[*:0]const u8 { | |
| 851 | return cpu_features.llvm_features_str; | |
| 723 | if (is_enabled) { | |
| 724 | // TODO some kind of "zig identifier escape" function rather than | |
| 725 | // unconditionally using @"" syntax | |
| 726 | try builtin_str_buffer.append(" .@\""); | |
| 727 | try builtin_str_buffer.append(feature.name); | |
| 728 | try builtin_str_buffer.append("\",\n"); | |
| 729 | } | |
| 730 | } | |
| 731 | ||
| 732 | try builtin_str_buffer.append( | |
| 733 | \\ }), | |
| 734 | \\}; | |
| 735 | \\ | |
| 736 | ); | |
| 737 | ||
| 738 | assert(mem.endsWith(u8, llvm_features_buffer.toSliceConst(), ",")); | |
| 739 | llvm_features_buffer.shrink(llvm_features_buffer.len() - 1); | |
| 740 | ||
| 741 | stage1_target.llvm_cpu_name = if (cpu.model.llvm_name) |s| s.ptr else null; | |
| 742 | stage1_target.llvm_cpu_features = llvm_features_buffer.toOwnedSlice().ptr; | |
| 743 | stage1_target.builtin_str = builtin_str_buffer.toOwnedSlice().ptr; | |
| 744 | stage1_target.cache_hash = cache_hash.ptr; | |
| 852 | 745 | } |
| 853 | 746 | |
| 854 | 747 | // ABI warning |
| ... | ... | @@ -1017,12 +910,55 @@ export fn stage2_libc_render(stage1_libc: *Stage2LibCInstallation, output_file: |
| 1017 | 910 | const Stage2Target = extern struct { |
| 1018 | 911 | arch: c_int, |
| 1019 | 912 | sub_arch: c_int, |
| 913 | ||
| 1020 | 914 | vendor: c_int, |
| 1021 | os: c_int, | |
| 1022 | 915 | abi: c_int, |
| 1023 | glibc_version: ?*Stage2GLibCVersion, // null means default | |
| 1024 | cpu_features: *Stage2CpuFeatures, | |
| 916 | ||
| 917 | os: c_int, | |
| 1025 | 918 | is_native: bool, |
| 919 | ||
| 920 | glibc_version: ?*Stage2GLibCVersion, // null means default | |
| 921 | ||
| 922 | llvm_cpu_name: ?[*:0]const u8, | |
| 923 | llvm_cpu_features: ?[*:0]const u8, | |
| 924 | builtin_str: ?[*:0]const u8, | |
| 925 | cache_hash: ?[*:0]const u8, | |
| 926 | ||
| 927 | fn toTarget(in_target: Stage2Target) Target { | |
| 928 | if (in_target.is_native) return .Native; | |
| 929 | ||
| 930 | const in_arch = in_target.arch - 1; // skip over ZigLLVM_UnknownArch | |
| 931 | const in_sub_arch = in_target.sub_arch - 1; // skip over ZigLLVM_NoSubArch | |
| 932 | const in_os = in_target.os; | |
| 933 | const in_abi = in_target.abi - 1; // skip over ZigLLVM_UnknownEnvironment | |
| 934 | ||
| 935 | return .{ | |
| 936 | .Cross = .{ | |
| 937 | .cpu = Target.Cpu.baseline(enumInt(Target.Cpu.Arch, in_arch)), | |
| 938 | .os = enumInt(Target.Os, in_os), | |
| 939 | .abi = enumInt(Target.Abi, in_abi), | |
| 940 | }, | |
| 941 | }; | |
| 942 | } | |
| 943 | ||
| 944 | fn fromTarget(self: *Stage2Target, target: Target) !void { | |
| 945 | const cpu = switch (target) { | |
| 946 | .Native => blk: { | |
| 947 | // TODO self-host CPU model and feature detection instead of relying on LLVM | |
| 948 | const llvm = @import("llvm.zig"); | |
| 949 | const llvm_cpu_name = llvm.GetHostCPUName(); | |
| 950 | const llvm_cpu_features = llvm.GetNativeFeatures(); | |
| 951 | break :blk try detectNativeCpuWithLLVM(target.getArch(), llvm_cpu_name, llvm_cpu_features); | |
| 952 | }, | |
| 953 | .Cross => target.getCpu(), | |
| 954 | }; | |
| 955 | self.arch = @enumToInt(target.getArch()) + 1; // skip over ZigLLVM_UnknownArch | |
| 956 | self.sub_arch = 0; | |
| 957 | self.vendor = 0; | |
| 958 | self.os = @enumToInt(target.getOs()); | |
| 959 | self.abi = @enumToInt(target.getAbi()) + 1; // skip over ZigLLVM_UnknownEnvironment | |
| 960 | try initStage1TargetCpuFeatures(self, cpu); | |
| 961 | } | |
| 1026 | 962 | }; |
| 1027 | 963 | |
| 1028 | 964 | // ABI warning |
| ... | ... | @@ -1034,72 +970,7 @@ const Stage2GLibCVersion = extern struct { |
| 1034 | 970 | |
| 1035 | 971 | // ABI warning |
| 1036 | 972 | export fn stage2_detect_dynamic_linker(in_target: *const Stage2Target, out_ptr: *[*:0]u8, out_len: *usize) Error { |
| 1037 | const in_arch = in_target.arch - 1; // skip over ZigLLVM_UnknownArch | |
| 1038 | const in_sub_arch = in_target.sub_arch - 1; // skip over ZigLLVM_NoSubArch | |
| 1039 | const in_os = in_target.os; | |
| 1040 | const in_abi = in_target.abi - 1; // skip over ZigLLVM_UnknownEnvironment | |
| 1041 | const target: Target = if (in_target.is_native) .Native else .{ | |
| 1042 | .Cross = .{ | |
| 1043 | .arch = switch (enumInt(@TagType(Target.Arch), in_arch)) { | |
| 1044 | .arm => .{ .arm = enumInt(Target.Arch.Arm32, in_sub_arch) }, | |
| 1045 | .armeb => .{ .armeb = enumInt(Target.Arch.Arm32, in_sub_arch) }, | |
| 1046 | .thumb => .{ .thumb = enumInt(Target.Arch.Arm32, in_sub_arch) }, | |
| 1047 | .thumbeb => .{ .thumbeb = enumInt(Target.Arch.Arm32, in_sub_arch) }, | |
| 1048 | ||
| 1049 | .aarch64 => .{ .aarch64 = enumInt(Target.Arch.Arm64, in_sub_arch) }, | |
| 1050 | .aarch64_be => .{ .aarch64_be = enumInt(Target.Arch.Arm64, in_sub_arch) }, | |
| 1051 | .aarch64_32 => .{ .aarch64_32 = enumInt(Target.Arch.Arm64, in_sub_arch) }, | |
| 1052 | ||
| 1053 | .kalimba => .{ .kalimba = enumInt(Target.Arch.Kalimba, in_sub_arch) }, | |
| 1054 | ||
| 1055 | .arc => .arc, | |
| 1056 | .avr => .avr, | |
| 1057 | .bpfel => .bpfel, | |
| 1058 | .bpfeb => .bpfeb, | |
| 1059 | .hexagon => .hexagon, | |
| 1060 | .mips => .mips, | |
| 1061 | .mipsel => .mipsel, | |
| 1062 | .mips64 => .mips64, | |
| 1063 | .mips64el => .mips64el, | |
| 1064 | .msp430 => .msp430, | |
| 1065 | .powerpc => .powerpc, | |
| 1066 | .powerpc64 => .powerpc64, | |
| 1067 | .powerpc64le => .powerpc64le, | |
| 1068 | .r600 => .r600, | |
| 1069 | .amdgcn => .amdgcn, | |
| 1070 | .riscv32 => .riscv32, | |
| 1071 | .riscv64 => .riscv64, | |
| 1072 | .sparc => .sparc, | |
| 1073 | .sparcv9 => .sparcv9, | |
| 1074 | .sparcel => .sparcel, | |
| 1075 | .s390x => .s390x, | |
| 1076 | .tce => .tce, | |
| 1077 | .tcele => .tcele, | |
| 1078 | .i386 => .i386, | |
| 1079 | .x86_64 => .x86_64, | |
| 1080 | .xcore => .xcore, | |
| 1081 | .nvptx => .nvptx, | |
| 1082 | .nvptx64 => .nvptx64, | |
| 1083 | .le32 => .le32, | |
| 1084 | .le64 => .le64, | |
| 1085 | .amdil => .amdil, | |
| 1086 | .amdil64 => .amdil64, | |
| 1087 | .hsail => .hsail, | |
| 1088 | .hsail64 => .hsail64, | |
| 1089 | .spir => .spir, | |
| 1090 | .spir64 => .spir64, | |
| 1091 | .shave => .shave, | |
| 1092 | .lanai => .lanai, | |
| 1093 | .wasm32 => .wasm32, | |
| 1094 | .wasm64 => .wasm64, | |
| 1095 | .renderscript32 => .renderscript32, | |
| 1096 | .renderscript64 => .renderscript64, | |
| 1097 | }, | |
| 1098 | .os = enumInt(Target.Os, in_os), | |
| 1099 | .abi = enumInt(Target.Abi, in_abi), | |
| 1100 | .cpu_features = in_target.cpu_features.cpu_features, | |
| 1101 | }, | |
| 1102 | }; | |
| 973 | const target = in_target.toTarget(); | |
| 1103 | 974 | const result = @import("introspect.zig").detectDynamicLinker( |
| 1104 | 975 | std.heap.c_allocator, |
| 1105 | 976 | target, |
src/codegen.cpp+17-26| ... | ... | @@ -8624,14 +8624,11 @@ Buf *codegen_generate_builtin_source(CodeGen *g) { |
| 8624 | 8624 | buf_appendf(contents, "pub const arch = %s;\n", cur_arch); |
| 8625 | 8625 | buf_appendf(contents, "pub const abi = Abi.%s;\n", cur_abi); |
| 8626 | 8626 | { |
| 8627 | buf_append_str(contents, "pub const cpu_features: CpuFeatures = "); | |
| 8628 | if (g->zig_target->cpu_features != nullptr) { | |
| 8629 | const char *ptr; | |
| 8630 | size_t len; | |
| 8631 | stage2_cpu_features_get_builtin_str(g->zig_target->cpu_features, &ptr, &len); | |
| 8632 | buf_append_mem(contents, ptr, len); | |
| 8627 | buf_append_str(contents, "pub const cpu: Cpu = "); | |
| 8628 | if (g->zig_target->builtin_str != nullptr) { | |
| 8629 | buf_append_str(contents, g->zig_target->builtin_str); | |
| 8633 | 8630 | } else { |
| 8634 | buf_append_str(contents, "arch.getBaselineCpuFeatures();\n"); | |
| 8631 | buf_append_str(contents, "Target.Cpu.baseline(arch);\n"); | |
| 8635 | 8632 | } |
| 8636 | 8633 | } |
| 8637 | 8634 | if (g->libc_link_lib != nullptr && g->zig_target->glibc_version != nullptr) { |
| ... | ... | @@ -8734,11 +8731,8 @@ static Error define_builtin_compile_vars(CodeGen *g) { |
| 8734 | 8731 | cache_int(&cache_hash, g->zig_target->vendor); |
| 8735 | 8732 | cache_int(&cache_hash, g->zig_target->os); |
| 8736 | 8733 | cache_int(&cache_hash, g->zig_target->abi); |
| 8737 | if (g->zig_target->cpu_features != nullptr) { | |
| 8738 | const char *ptr; | |
| 8739 | size_t len; | |
| 8740 | stage2_cpu_features_get_cache_hash(g->zig_target->cpu_features, &ptr, &len); | |
| 8741 | cache_str(&cache_hash, ptr); | |
| 8734 | if (g->zig_target->cache_hash != nullptr) { | |
| 8735 | cache_str(&cache_hash, g->zig_target->cache_hash); | |
| 8742 | 8736 | } |
| 8743 | 8737 | if (g->zig_target->glibc_version != nullptr) { |
| 8744 | 8738 | cache_int(&cache_hash, g->zig_target->glibc_version->major); |
| ... | ... | @@ -8873,9 +8867,11 @@ static void init(CodeGen *g) { |
| 8873 | 8867 | } |
| 8874 | 8868 | |
| 8875 | 8869 | // Override CPU and features if defined by user. |
| 8876 | if (g->zig_target->cpu_features != nullptr) { | |
| 8877 | target_specific_cpu_args = stage2_cpu_features_get_llvm_cpu(g->zig_target->cpu_features); | |
| 8878 | target_specific_features = stage2_cpu_features_get_llvm_features(g->zig_target->cpu_features); | |
| 8870 | if (g->zig_target->llvm_cpu_name != nullptr) { | |
| 8871 | target_specific_cpu_args = g->zig_target->llvm_cpu_name; | |
| 8872 | } | |
| 8873 | if (g->zig_target->llvm_cpu_features != nullptr) { | |
| 8874 | target_specific_features = g->zig_target->llvm_cpu_features; | |
| 8879 | 8875 | } |
| 8880 | 8876 | if (g->verbose_llvm_cpu_features) { |
| 8881 | 8877 | fprintf(stderr, "name=%s triple=%s\n", buf_ptr(g->root_out_name), buf_ptr(&g->llvm_triple_str)); |
| ... | ... | @@ -9190,19 +9186,17 @@ void add_cc_args(CodeGen *g, ZigList<const char *> &args, const char *out_dep_pa |
| 9190 | 9186 | args.append("-target"); |
| 9191 | 9187 | args.append(buf_ptr(&g->llvm_triple_str)); |
| 9192 | 9188 | |
| 9193 | const char *llvm_cpu = stage2_cpu_features_get_llvm_cpu(g->zig_target->cpu_features); | |
| 9194 | if (llvm_cpu != nullptr) { | |
| 9189 | if (g->zig_target->llvm_cpu_name != nullptr) { | |
| 9195 | 9190 | args.append("-Xclang"); |
| 9196 | 9191 | args.append("-target-cpu"); |
| 9197 | 9192 | args.append("-Xclang"); |
| 9198 | args.append(llvm_cpu); | |
| 9193 | args.append(g->zig_target->llvm_cpu_name); | |
| 9199 | 9194 | } |
| 9200 | const char *llvm_target_features = stage2_cpu_features_get_llvm_features(g->zig_target->cpu_features); | |
| 9201 | if (llvm_target_features != nullptr) { | |
| 9195 | if (g->zig_target->llvm_cpu_features != nullptr) { | |
| 9202 | 9196 | args.append("-Xclang"); |
| 9203 | 9197 | args.append("-target-feature"); |
| 9204 | 9198 | args.append("-Xclang"); |
| 9205 | args.append(llvm_target_features); | |
| 9199 | args.append(g->zig_target->llvm_cpu_features); | |
| 9206 | 9200 | } |
| 9207 | 9201 | } |
| 9208 | 9202 | |
| ... | ... | @@ -10406,11 +10400,8 @@ static Error check_cache(CodeGen *g, Buf *manifest_dir, Buf *digest) { |
| 10406 | 10400 | cache_int(ch, g->zig_target->vendor); |
| 10407 | 10401 | cache_int(ch, g->zig_target->os); |
| 10408 | 10402 | cache_int(ch, g->zig_target->abi); |
| 10409 | if (g->zig_target->cpu_features != nullptr) { | |
| 10410 | const char *ptr; | |
| 10411 | size_t len; | |
| 10412 | stage2_cpu_features_get_cache_hash(g->zig_target->cpu_features, &ptr, &len); | |
| 10413 | cache_str(ch, ptr); | |
| 10403 | if (g->zig_target->cache_hash != nullptr) { | |
| 10404 | cache_str(ch, g->zig_target->cache_hash); | |
| 10414 | 10405 | } |
| 10415 | 10406 | if (g->zig_target->glibc_version != nullptr) { |
| 10416 | 10407 | cache_int(ch, g->zig_target->glibc_version->major); |
src/error.cpp-1| ... | ... | @@ -59,7 +59,6 @@ const char *err_str(Error err) { |
| 59 | 59 | case ErrorIsAsync: return "is async"; |
| 60 | 60 | case ErrorImportOutsidePkgPath: return "import of file outside package path"; |
| 61 | 61 | case ErrorUnknownCpu: return "unknown CPU"; |
| 62 | case ErrorUnknownSubArchitecture: return "unknown sub-architecture"; | |
| 63 | 62 | case ErrorUnknownCpuFeature: return "unknown CPU feature"; |
| 64 | 63 | case ErrorInvalidCpuFeatures: return "invalid CPU features"; |
| 65 | 64 | case ErrorInvalidLlvmCpuFeaturesFormat: return "invalid LLVM CPU features format"; |
src/main.cpp+39-47| ... | ... | @@ -106,8 +106,7 @@ static int print_full_usage(const char *arg0, FILE *file, int return_code) { |
| 106 | 106 | " --override-lib-dir [arg] override path to Zig lib directory\n" |
| 107 | 107 | " -ffunction-sections places each function in a separate section\n" |
| 108 | 108 | " -D[macro]=[value] define C [macro] to [value] (1 if [value] omitted)\n" |
| 109 | " -target-cpu [cpu] target one specific CPU by name\n" | |
| 110 | " -target-feature [features] specify the set of CPU features to target\n" | |
| 109 | " -mcpu [cpu] specify target CPU and feature set\n" | |
| 111 | 110 | " -code-model [default|tiny| set target code model\n" |
| 112 | 111 | " small|kernel|\n" |
| 113 | 112 | " medium|large]\n" |
| ... | ... | @@ -238,6 +237,14 @@ static int zig_error_no_build_file(void) { |
| 238 | 237 | return EXIT_FAILURE; |
| 239 | 238 | } |
| 240 | 239 | |
| 240 | static bool str_starts_with(const char *s1, const char *s2) { | |
| 241 | size_t s2_len = strlen(s2); | |
| 242 | if (strlen(s1) < s2_len) { | |
| 243 | return false; | |
| 244 | } | |
| 245 | return memcmp(s1, s2, s2_len) == 0; | |
| 246 | } | |
| 247 | ||
| 241 | 248 | extern "C" int ZigClang_main(int argc, char **argv); |
| 242 | 249 | |
| 243 | 250 | #ifdef ZIG_ENABLE_MEM_PROFILE |
| ... | ... | @@ -447,8 +454,7 @@ static int main0(int argc, char **argv) { |
| 447 | 454 | WantStackCheck want_stack_check = WantStackCheckAuto; |
| 448 | 455 | WantCSanitize want_sanitize_c = WantCSanitizeAuto; |
| 449 | 456 | bool function_sections = false; |
| 450 | const char *cpu = nullptr; | |
| 451 | const char *features = nullptr; | |
| 457 | const char *mcpu = nullptr; | |
| 452 | 458 | CodeModel code_model = CodeModelDefault; |
| 453 | 459 | |
| 454 | 460 | ZigList<const char *> llvm_argv = {0}; |
| ... | ... | @@ -716,6 +722,8 @@ static int main0(int argc, char **argv) { |
| 716 | 722 | emit_llvm_ir = true; |
| 717 | 723 | } else if (strcmp(arg, "-fno-emit-llvm-ir") == 0) { |
| 718 | 724 | emit_llvm_ir = false; |
| 725 | } else if (str_starts_with(arg, "-mcpu=")) { | |
| 726 | mcpu = arg + strlen("-mcpu="); | |
| 719 | 727 | } else if (i + 1 >= argc) { |
| 720 | 728 | fprintf(stderr, "Expected another argument after %s\n", arg); |
| 721 | 729 | return print_error_usage(arg0); |
| ... | ... | @@ -892,10 +900,8 @@ static int main0(int argc, char **argv) { |
| 892 | 900 | , argv[i]); |
| 893 | 901 | return EXIT_FAILURE; |
| 894 | 902 | } |
| 895 | } else if (strcmp(arg, "-target-cpu") == 0) { | |
| 896 | cpu = argv[i]; | |
| 897 | } else if (strcmp(arg, "-target-feature") == 0) { | |
| 898 | features = argv[i]; | |
| 903 | } else if (strcmp(arg, "-mcpu") == 0) { | |
| 904 | mcpu = argv[i]; | |
| 899 | 905 | } else { |
| 900 | 906 | fprintf(stderr, "Invalid argument: %s\n", arg); |
| 901 | 907 | return print_error_usage(arg0); |
| ... | ... | @@ -971,55 +977,41 @@ static int main0(int argc, char **argv) { |
| 971 | 977 | init_all_targets(); |
| 972 | 978 | |
| 973 | 979 | ZigTarget target; |
| 974 | if (target_string == nullptr) { | |
| 975 | get_native_target(&target); | |
| 976 | if (target_glibc != nullptr) { | |
| 977 | fprintf(stderr, "-target-glibc provided but no -target parameter\n"); | |
| 978 | return print_error_usage(arg0); | |
| 979 | } | |
| 980 | } else { | |
| 981 | if ((err = target_parse_triple(&target, target_string))) { | |
| 982 | if (err == ErrorUnknownArchitecture && target.arch != ZigLLVM_UnknownArch) { | |
| 983 | fprintf(stderr, "'%s' requires a sub-architecture. Try one of these:\n", | |
| 984 | target_arch_name(target.arch)); | |
| 985 | SubArchList sub_arch_list = target_subarch_list(target.arch); | |
| 986 | size_t subarch_count = target_subarch_count(sub_arch_list); | |
| 987 | for (size_t sub_i = 0; sub_i < subarch_count; sub_i += 1) { | |
| 988 | ZigLLVM_SubArchType sub = target_subarch_enum(sub_arch_list, sub_i); | |
| 989 | fprintf(stderr, " %s%s\n", target_arch_name(target.arch), target_subarch_name(sub)); | |
| 990 | } | |
| 991 | return print_error_usage(arg0); | |
| 992 | } else { | |
| 993 | fprintf(stderr, "invalid target: %s\n", err_str(err)); | |
| 994 | return print_error_usage(arg0); | |
| 980 | if ((err = target_parse_triple(&target, target_string, mcpu))) { | |
| 981 | if (err == ErrorUnknownArchitecture && target.arch != ZigLLVM_UnknownArch) { | |
| 982 | fprintf(stderr, "'%s' requires a sub-architecture. Try one of these:\n", | |
| 983 | target_arch_name(target.arch)); | |
| 984 | SubArchList sub_arch_list = target_subarch_list(target.arch); | |
| 985 | size_t subarch_count = target_subarch_count(sub_arch_list); | |
| 986 | for (size_t sub_i = 0; sub_i < subarch_count; sub_i += 1) { | |
| 987 | ZigLLVM_SubArchType sub = target_subarch_enum(sub_arch_list, sub_i); | |
| 988 | fprintf(stderr, " %s%s\n", target_arch_name(target.arch), target_subarch_name(sub)); | |
| 995 | 989 | } |
| 990 | return print_error_usage(arg0); | |
| 991 | } else { | |
| 992 | fprintf(stderr, "invalid target: %s\n", err_str(err)); | |
| 993 | return print_error_usage(arg0); | |
| 996 | 994 | } |
| 997 | if (target_is_glibc(&target)) { | |
| 998 | target.glibc_version = heap::c_allocator.create<ZigGLibCVersion>(); | |
| 995 | } | |
| 996 | if (target_is_glibc(&target)) { | |
| 997 | target.glibc_version = heap::c_allocator.create<ZigGLibCVersion>(); | |
| 999 | 998 | |
| 1000 | if (target_glibc != nullptr) { | |
| 1001 | if ((err = target_parse_glibc_version(target.glibc_version, target_glibc))) { | |
| 1002 | fprintf(stderr, "invalid glibc version '%s': %s\n", target_glibc, err_str(err)); | |
| 1003 | return print_error_usage(arg0); | |
| 1004 | } | |
| 1005 | } else { | |
| 1006 | target_init_default_glibc_version(&target); | |
| 999 | if (target_glibc != nullptr) { | |
| 1000 | if ((err = target_parse_glibc_version(target.glibc_version, target_glibc))) { | |
| 1001 | fprintf(stderr, "invalid glibc version '%s': %s\n", target_glibc, err_str(err)); | |
| 1002 | return print_error_usage(arg0); | |
| 1007 | 1003 | } |
| 1008 | } else if (target_glibc != nullptr) { | |
| 1009 | fprintf(stderr, "'%s' is not a glibc-compatible target", target_string); | |
| 1010 | return print_error_usage(arg0); | |
| 1004 | } else { | |
| 1005 | target_init_default_glibc_version(&target); | |
| 1011 | 1006 | } |
| 1007 | } else if (target_glibc != nullptr) { | |
| 1008 | fprintf(stderr, "'%s' is not a glibc-compatible target", target_string); | |
| 1009 | return print_error_usage(arg0); | |
| 1012 | 1010 | } |
| 1013 | 1011 | |
| 1014 | 1012 | Buf zig_triple_buf = BUF_INIT; |
| 1015 | 1013 | target_triple_zig(&zig_triple_buf, &target); |
| 1016 | 1014 | |
| 1017 | const char *stage2_triple_arg = target.is_native ? nullptr : buf_ptr(&zig_triple_buf); | |
| 1018 | if ((err = stage2_cpu_features_parse(&target.cpu_features, stage2_triple_arg, cpu, features))) { | |
| 1019 | fprintf(stderr, "unable to initialize CPU features: %s\n", err_str(err)); | |
| 1020 | return main_exit(root_progress_node, EXIT_FAILURE); | |
| 1021 | } | |
| 1022 | ||
| 1023 | 1015 | // If both output_dir and enable_cache are provided, and doing build-lib, we |
| 1024 | 1016 | // will just do a file copy at the end. This helps when bootstrapping zig from zig0 |
| 1025 | 1017 | // because we want to pass something like this: |
src/stage2.cpp+50-43| ... | ... | @@ -4,6 +4,7 @@ |
| 4 | 4 | #include "stage2.h" |
| 5 | 5 | #include "util.hpp" |
| 6 | 6 | #include "zig_llvm.h" |
| 7 | #include "target.hpp" | |
| 7 | 8 | #include <stdio.h> |
| 8 | 9 | #include <stdlib.h> |
| 9 | 10 | #include <string.h> |
| ... | ... | @@ -90,54 +91,60 @@ void stage2_progress_complete_one(Stage2ProgressNode *node) {} |
| 90 | 91 | void stage2_progress_disable_tty(Stage2Progress *progress) {} |
| 91 | 92 | void stage2_progress_update_node(Stage2ProgressNode *node, size_t completed_count, size_t estimated_total_items){} |
| 92 | 93 | |
| 93 | struct Stage2CpuFeatures { | |
| 94 | const char *llvm_cpu_name; | |
| 95 | const char *llvm_cpu_features; | |
| 96 | const char *builtin_str; | |
| 97 | const char *cache_hash; | |
| 98 | }; | |
| 94 | Error stage2_target_parse(struct ZigTarget *target, const char *zig_triple, const char *mcpu) { | |
| 95 | Error err; | |
| 99 | 96 | |
| 100 | Error stage2_cpu_features_parse(struct Stage2CpuFeatures **out, const char *zig_triple, | |
| 101 | const char *cpu_name, const char *cpu_features) | |
| 102 | { | |
| 103 | 97 | if (zig_triple == nullptr) { |
| 104 | Stage2CpuFeatures *result = heap::c_allocator.create<Stage2CpuFeatures>(); | |
| 105 | result->llvm_cpu_name = ZigLLVMGetHostCPUName(); | |
| 106 | result->llvm_cpu_features = ZigLLVMGetNativeFeatures(); | |
| 107 | result->builtin_str = "arch.getBaselineCpuFeatures();\n"; | |
| 108 | result->cache_hash = "native\n\n"; | |
| 109 | *out = result; | |
| 110 | return ErrorNone; | |
| 111 | } | |
| 112 | if (cpu_name == nullptr && cpu_features == nullptr) { | |
| 113 | Stage2CpuFeatures *result = heap::c_allocator.create<Stage2CpuFeatures>(); | |
| 114 | result->builtin_str = "arch.getBaselineCpuFeatures();\n"; | |
| 115 | result->cache_hash = "\n\n"; | |
| 116 | *out = result; | |
| 117 | return ErrorNone; | |
| 98 | get_native_target(target); | |
| 99 | ||
| 100 | target->llvm_cpu_name = ZigLLVMGetHostCPUName(); | |
| 101 | target->llvm_cpu_features = ZigLLVMGetNativeFeatures(); | |
| 102 | target->builtin_str = "Target.Cpu.baseline(arch);\n"; | |
| 103 | target->cache_hash = "native\n\n"; | |
| 104 | } else { | |
| 105 | // first initialize all to zero | |
| 106 | *target = {}; | |
| 107 | ||
| 108 | SplitIterator it = memSplit(str(zig_triple), str("-")); | |
| 109 | ||
| 110 | Optional<Slice<uint8_t>> opt_archsub = SplitIterator_next(&it); | |
| 111 | Optional<Slice<uint8_t>> opt_os = SplitIterator_next(&it); | |
| 112 | Optional<Slice<uint8_t>> opt_abi = SplitIterator_next(&it); | |
| 113 | ||
| 114 | if (!opt_archsub.is_some) | |
| 115 | return ErrorMissingArchitecture; | |
| 116 | ||
| 117 | if ((err = target_parse_archsub(&target->arch, &target->sub_arch, | |
| 118 | (char*)opt_archsub.value.ptr, opt_archsub.value.len))) | |
| 119 | { | |
| 120 | return err; | |
| 121 | } | |
| 122 | ||
| 123 | if (!opt_os.is_some) | |
| 124 | return ErrorMissingOperatingSystem; | |
| 125 | ||
| 126 | if ((err = target_parse_os(&target->os, (char*)opt_os.value.ptr, opt_os.value.len))) { | |
| 127 | return err; | |
| 128 | } | |
| 129 | ||
| 130 | if (opt_abi.is_some) { | |
| 131 | if ((err = target_parse_abi(&target->abi, (char*)opt_abi.value.ptr, opt_abi.value.len))) { | |
| 132 | return err; | |
| 133 | } | |
| 134 | } else { | |
| 135 | target->abi = target_default_abi(target->arch, target->os); | |
| 136 | } | |
| 137 | ||
| 138 | target->builtin_str = "Target.Cpu.baseline(arch);\n"; | |
| 139 | target->cache_hash = "\n\n"; | |
| 118 | 140 | } |
| 119 | 141 | |
| 120 | const char *msg = "stage0 called stage2_cpu_features_parse with non-null cpu name or features"; | |
| 121 | stage2_panic(msg, strlen(msg)); | |
| 122 | } | |
| 142 | if (mcpu != nullptr) { | |
| 143 | const char *msg = "stage0 can't handle CPU/features in the target"; | |
| 144 | stage2_panic(msg, strlen(msg)); | |
| 145 | } | |
| 123 | 146 | |
| 124 | void stage2_cpu_features_get_cache_hash(const Stage2CpuFeatures *cpu_features, | |
| 125 | const char **ptr, size_t *len) | |
| 126 | { | |
| 127 | *ptr = cpu_features->cache_hash; | |
| 128 | *len = strlen(cpu_features->cache_hash); | |
| 129 | } | |
| 130 | const char *stage2_cpu_features_get_llvm_cpu(const Stage2CpuFeatures *cpu_features) { | |
| 131 | return cpu_features->llvm_cpu_name; | |
| 132 | } | |
| 133 | const char *stage2_cpu_features_get_llvm_features(const Stage2CpuFeatures *cpu_features) { | |
| 134 | return cpu_features->llvm_cpu_features; | |
| 135 | } | |
| 136 | void stage2_cpu_features_get_builtin_str(const Stage2CpuFeatures *cpu_features, | |
| 137 | const char **ptr, size_t *len) | |
| 138 | { | |
| 139 | *ptr = cpu_features->builtin_str; | |
| 140 | *len = strlen(cpu_features->builtin_str); | |
| 147 | return ErrorNone; | |
| 141 | 148 | } |
| 142 | 149 | |
| 143 | 150 | int stage2_cmd_targets(const char *zig_triple) { |
src/stage2.h+14-25| ... | ... | @@ -81,7 +81,6 @@ enum Error { |
| 81 | 81 | ErrorIsAsync, |
| 82 | 82 | ErrorImportOutsidePkgPath, |
| 83 | 83 | ErrorUnknownCpu, |
| 84 | ErrorUnknownSubArchitecture, | |
| 85 | 84 | ErrorUnknownCpuFeature, |
| 86 | 85 | ErrorInvalidCpuFeatures, |
| 87 | 86 | ErrorInvalidLlvmCpuFeaturesFormat, |
| ... | ... | @@ -200,27 +199,6 @@ ZIG_EXTERN_C void stage2_progress_complete_one(Stage2ProgressNode *node); |
| 200 | 199 | ZIG_EXTERN_C void stage2_progress_update_node(Stage2ProgressNode *node, |
| 201 | 200 | size_t completed_count, size_t estimated_total_items); |
| 202 | 201 | |
| 203 | // ABI warning | |
| 204 | struct Stage2CpuFeatures; | |
| 205 | ||
| 206 | // ABI warning | |
| 207 | ZIG_EXTERN_C enum Error stage2_cpu_features_parse(struct Stage2CpuFeatures **result, | |
| 208 | const char *zig_triple, const char *cpu_name, const char *cpu_features); | |
| 209 | ||
| 210 | // ABI warning | |
| 211 | ZIG_EXTERN_C const char *stage2_cpu_features_get_llvm_cpu(const struct Stage2CpuFeatures *cpu_features); | |
| 212 | ||
| 213 | // ABI warning | |
| 214 | ZIG_EXTERN_C const char *stage2_cpu_features_get_llvm_features(const struct Stage2CpuFeatures *cpu_features); | |
| 215 | ||
| 216 | // ABI warning | |
| 217 | ZIG_EXTERN_C void stage2_cpu_features_get_builtin_str(const struct Stage2CpuFeatures *cpu_features, | |
| 218 | const char **ptr, size_t *len); | |
| 219 | ||
| 220 | // ABI warning | |
| 221 | ZIG_EXTERN_C void stage2_cpu_features_get_cache_hash(const struct Stage2CpuFeatures *cpu_features, | |
| 222 | const char **ptr, size_t *len); | |
| 223 | ||
| 224 | 202 | // ABI warning |
| 225 | 203 | ZIG_EXTERN_C int stage2_cmd_targets(const char *zig_triple); |
| 226 | 204 | |
| ... | ... | @@ -296,22 +274,33 @@ struct ZigGLibCVersion { |
| 296 | 274 | uint32_t patch; |
| 297 | 275 | }; |
| 298 | 276 | |
| 277 | struct Stage2TargetData; | |
| 278 | ||
| 299 | 279 | // ABI warning |
| 300 | 280 | struct ZigTarget { |
| 301 | 281 | enum ZigLLVM_ArchType arch; |
| 302 | 282 | enum ZigLLVM_SubArchType sub_arch; |
| 283 | ||
| 303 | 284 | enum ZigLLVM_VendorType vendor; |
| 304 | Os os; | |
| 305 | 285 | enum ZigLLVM_EnvironmentType abi; |
| 306 | struct ZigGLibCVersion *glibc_version; // null means default | |
| 307 | struct Stage2CpuFeatures *cpu_features; | |
| 286 | ||
| 287 | Os os; | |
| 308 | 288 | bool is_native; |
| 289 | ||
| 290 | struct ZigGLibCVersion *glibc_version; // null means default | |
| 291 | ||
| 292 | const char *llvm_cpu_name; | |
| 293 | const char *llvm_cpu_features; | |
| 294 | const char *builtin_str; | |
| 295 | const char *cache_hash; | |
| 309 | 296 | }; |
| 310 | 297 | |
| 311 | 298 | // ABI warning |
| 312 | 299 | ZIG_EXTERN_C enum Error stage2_detect_dynamic_linker(const struct ZigTarget *target, |
| 313 | 300 | char **out_ptr, size_t *out_len); |
| 314 | 301 | |
| 302 | // ABI warning | |
| 303 | ZIG_EXTERN_C enum Error stage2_target_parse(struct ZigTarget *target, const char *zig_triple, const char *mcpu); | |
| 315 | 304 | |
| 316 | 305 | |
| 317 | 306 | // ABI warning |
src/target.cpp+2-36| ... | ... | @@ -776,42 +776,8 @@ Error target_parse_abi(ZigLLVM_EnvironmentType *out_abi, const char *abi_ptr, si |
| 776 | 776 | return ErrorUnknownABI; |
| 777 | 777 | } |
| 778 | 778 | |
| 779 | Error target_parse_triple(ZigTarget *target, const char *triple) { | |
| 780 | Error err; | |
| 781 | ||
| 782 | // first initialize all to zero | |
| 783 | *target = {}; | |
| 784 | ||
| 785 | SplitIterator it = memSplit(str(triple), str("-")); | |
| 786 | ||
| 787 | Optional<Slice<uint8_t>> opt_archsub = SplitIterator_next(&it); | |
| 788 | Optional<Slice<uint8_t>> opt_os = SplitIterator_next(&it); | |
| 789 | Optional<Slice<uint8_t>> opt_abi = SplitIterator_next(&it); | |
| 790 | ||
| 791 | if (!opt_archsub.is_some) | |
| 792 | return ErrorMissingArchitecture; | |
| 793 | ||
| 794 | if ((err = target_parse_archsub(&target->arch, &target->sub_arch, | |
| 795 | (char*)opt_archsub.value.ptr, opt_archsub.value.len))) | |
| 796 | { | |
| 797 | return err; | |
| 798 | } | |
| 799 | ||
| 800 | if (!opt_os.is_some) | |
| 801 | return ErrorMissingOperatingSystem; | |
| 802 | ||
| 803 | if ((err = target_parse_os(&target->os, (char*)opt_os.value.ptr, opt_os.value.len))) { | |
| 804 | return err; | |
| 805 | } | |
| 806 | ||
| 807 | if (opt_abi.is_some) { | |
| 808 | if ((err = target_parse_abi(&target->abi, (char*)opt_abi.value.ptr, opt_abi.value.len))) { | |
| 809 | return err; | |
| 810 | } | |
| 811 | } else { | |
| 812 | target->abi = target_default_abi(target->arch, target->os); | |
| 813 | } | |
| 814 | return ErrorNone; | |
| 779 | Error target_parse_triple(ZigTarget *target, const char *triple, const char *mcpu) { | |
| 780 | return stage2_target_parse(target, triple, mcpu); | |
| 815 | 781 | } |
| 816 | 782 | |
| 817 | 783 | const char *target_arch_name(ZigLLVM_ArchType arch) { |
src/target.hpp+1-1| ... | ... | @@ -50,7 +50,7 @@ enum CIntType { |
| 50 | 50 | CIntTypeCount, |
| 51 | 51 | }; |
| 52 | 52 | |
| 53 | Error target_parse_triple(ZigTarget *target, const char *triple); | |
| 53 | Error target_parse_triple(ZigTarget *target, const char *triple, const char *mcpu); | |
| 54 | 54 | Error target_parse_archsub(ZigLLVM_ArchType *arch, ZigLLVM_SubArchType *sub, |
| 55 | 55 | const char *archsub_ptr, size_t archsub_len); |
| 56 | 56 | Error target_parse_os(Os *os, const char *os_ptr, size_t os_len); |
test/tests.zig+27-54| ... | ... | @@ -55,20 +55,18 @@ const test_targets = blk: { |
| 55 | 55 | TestTarget{ |
| 56 | 56 | .target = Target{ |
| 57 | 57 | .Cross = CrossTarget{ |
| 58 | .cpu = Target.Cpu.baseline(.x86_64), | |
| 58 | 59 | .os = .linux, |
| 59 | .arch = .x86_64, | |
| 60 | 60 | .abi = .none, |
| 61 | .cpu_features = Target.Arch.x86_64.getBaselineCpuFeatures(), | |
| 62 | 61 | }, |
| 63 | 62 | }, |
| 64 | 63 | }, |
| 65 | 64 | TestTarget{ |
| 66 | 65 | .target = Target{ |
| 67 | 66 | .Cross = CrossTarget{ |
| 67 | .cpu = Target.Cpu.baseline(.x86_64), | |
| 68 | 68 | .os = .linux, |
| 69 | .arch = .x86_64, | |
| 70 | 69 | .abi = .gnu, |
| 71 | .cpu_features = Target.Arch.x86_64.getBaselineCpuFeatures(), | |
| 72 | 70 | }, |
| 73 | 71 | }, |
| 74 | 72 | .link_libc = true, |
| ... | ... | @@ -76,9 +74,8 @@ const test_targets = blk: { |
| 76 | 74 | TestTarget{ |
| 77 | 75 | .target = Target{ |
| 78 | 76 | .Cross = CrossTarget{ |
| 77 | .cpu = Target.Cpu.baseline(.x86_64), | |
| 79 | 78 | .os = .linux, |
| 80 | .arch = .x86_64, | |
| 81 | .cpu_features = Target.Arch.x86_64.getBaselineCpuFeatures(), | |
| 82 | 79 | .abi = .musl, |
| 83 | 80 | }, |
| 84 | 81 | }, |
| ... | ... | @@ -88,9 +85,8 @@ const test_targets = blk: { |
| 88 | 85 | TestTarget{ |
| 89 | 86 | .target = Target{ |
| 90 | 87 | .Cross = CrossTarget{ |
| 88 | .cpu = Target.Cpu.baseline(.i386), | |
| 91 | 89 | .os = .linux, |
| 92 | .arch = .i386, | |
| 93 | .cpu_features = Target.Arch.i386.getBaselineCpuFeatures(), | |
| 94 | 90 | .abi = .none, |
| 95 | 91 | }, |
| 96 | 92 | }, |
| ... | ... | @@ -98,9 +94,8 @@ const test_targets = blk: { |
| 98 | 94 | TestTarget{ |
| 99 | 95 | .target = Target{ |
| 100 | 96 | .Cross = CrossTarget{ |
| 97 | .cpu = Target.Cpu.baseline(.i386), | |
| 101 | 98 | .os = .linux, |
| 102 | .arch = .i386, | |
| 103 | .cpu_features = Target.Arch.i386.getBaselineCpuFeatures(), | |
| 104 | 99 | .abi = .musl, |
| 105 | 100 | }, |
| 106 | 101 | }, |
| ... | ... | @@ -110,9 +105,8 @@ const test_targets = blk: { |
| 110 | 105 | TestTarget{ |
| 111 | 106 | .target = Target{ |
| 112 | 107 | .Cross = CrossTarget{ |
| 108 | .cpu = Target.Cpu.baseline(.aarch64), | |
| 113 | 109 | .os = .linux, |
| 114 | .arch = Target.Arch{ .aarch64 = .v8a }, | |
| 115 | .cpu_features = (Target.Arch{ .aarch64 = .v8a }).getBaselineCpuFeatures(), | |
| 116 | 110 | .abi = .none, |
| 117 | 111 | }, |
| 118 | 112 | }, |
| ... | ... | @@ -120,9 +114,8 @@ const test_targets = blk: { |
| 120 | 114 | TestTarget{ |
| 121 | 115 | .target = Target{ |
| 122 | 116 | .Cross = CrossTarget{ |
| 117 | .cpu = Target.Cpu.baseline(.aarch64), | |
| 123 | 118 | .os = .linux, |
| 124 | .arch = Target.Arch{ .aarch64 = .v8a }, | |
| 125 | .cpu_features = (Target.Arch{ .aarch64 = .v8a }).getBaselineCpuFeatures(), | |
| 126 | 119 | .abi = .musl, |
| 127 | 120 | }, |
| 128 | 121 | }, |
| ... | ... | @@ -131,9 +124,8 @@ const test_targets = blk: { |
| 131 | 124 | TestTarget{ |
| 132 | 125 | .target = Target{ |
| 133 | 126 | .Cross = CrossTarget{ |
| 127 | .cpu = Target.Cpu.baseline(.aarch64), | |
| 134 | 128 | .os = .linux, |
| 135 | .arch = Target.Arch{ .aarch64 = .v8a }, | |
| 136 | .cpu_features = (Target.Arch{ .aarch64 = .v8a }).getBaselineCpuFeatures(), | |
| 137 | 129 | .abi = .gnu, |
| 138 | 130 | }, |
| 139 | 131 | }, |
| ... | ... | @@ -141,45 +133,32 @@ const test_targets = blk: { |
| 141 | 133 | }, |
| 142 | 134 | |
| 143 | 135 | TestTarget{ |
| 144 | .target = Target{ | |
| 145 | .Cross = CrossTarget{ | |
| 146 | .os = .linux, | |
| 147 | .arch = Target.Arch{ .arm = .v8a }, | |
| 148 | .cpu_features = (Target.Arch{ .arm = .v8a }).getBaselineCpuFeatures(), | |
| 149 | .abi = .none, | |
| 150 | }, | |
| 151 | }, | |
| 136 | .target = Target.parse(.{ | |
| 137 | .arch_os_abi = "arm-linux-none", | |
| 138 | .cpu = "generic+v8a", | |
| 139 | }) catch unreachable, | |
| 152 | 140 | }, |
| 153 | 141 | TestTarget{ |
| 154 | .target = Target{ | |
| 155 | .Cross = CrossTarget{ | |
| 156 | .os = .linux, | |
| 157 | .arch = Target.Arch{ .arm = .v8a }, | |
| 158 | .cpu_features = (Target.Arch{ .arm = .v8a }).getBaselineCpuFeatures(), | |
| 159 | .abi = .musleabihf, | |
| 160 | }, | |
| 161 | }, | |
| 142 | .target = Target.parse(.{ | |
| 143 | .arch_os_abi = "arm-linux-musleabihf", | |
| 144 | .cpu = "generic+v8a", | |
| 145 | }) catch unreachable, | |
| 162 | 146 | .link_libc = true, |
| 163 | 147 | }, |
| 164 | 148 | // TODO https://github.com/ziglang/zig/issues/3287 |
| 165 | 149 | //TestTarget{ |
| 166 | // .target = Target{ | |
| 167 | // .Cross = CrossTarget{ | |
| 168 | // .os = .linux, | |
| 169 | // .arch = Target.Arch{ .arm = .v8a }, | |
| 170 | // .cpu_features = (Target.Arch{ .arm = .v8a }).getBaselineCpuFeatures(), | |
| 171 | // .abi = .gnueabihf, | |
| 172 | // }, | |
| 173 | // }, | |
| 150 | // .target = Target.parse(.{ | |
| 151 | // .arch_os_abi = "arm-linux-gnueabihf", | |
| 152 | // .cpu = "generic+v8a", | |
| 153 | // }) catch unreachable, | |
| 174 | 154 | // .link_libc = true, |
| 175 | 155 | //}, |
| 176 | 156 | |
| 177 | 157 | TestTarget{ |
| 178 | 158 | .target = Target{ |
| 179 | 159 | .Cross = CrossTarget{ |
| 160 | .cpu = Target.Cpu.baseline(.mipsel), | |
| 180 | 161 | .os = .linux, |
| 181 | .arch = .mipsel, | |
| 182 | .cpu_features = Target.Arch.mipsel.getBaselineCpuFeatures(), | |
| 183 | 162 | .abi = .none, |
| 184 | 163 | }, |
| 185 | 164 | }, |
| ... | ... | @@ -187,9 +166,8 @@ const test_targets = blk: { |
| 187 | 166 | TestTarget{ |
| 188 | 167 | .target = Target{ |
| 189 | 168 | .Cross = CrossTarget{ |
| 169 | .cpu = Target.Cpu.baseline(.mipsel), | |
| 190 | 170 | .os = .linux, |
| 191 | .arch = .mipsel, | |
| 192 | .cpu_features = Target.Arch.mipsel.getBaselineCpuFeatures(), | |
| 193 | 171 | .abi = .musl, |
| 194 | 172 | }, |
| 195 | 173 | }, |
| ... | ... | @@ -199,9 +177,8 @@ const test_targets = blk: { |
| 199 | 177 | TestTarget{ |
| 200 | 178 | .target = Target{ |
| 201 | 179 | .Cross = CrossTarget{ |
| 180 | .cpu = Target.Cpu.baseline(.x86_64), | |
| 202 | 181 | .os = .macosx, |
| 203 | .arch = .x86_64, | |
| 204 | .cpu_features = Target.Arch.x86_64.getBaselineCpuFeatures(), | |
| 205 | 182 | .abi = .gnu, |
| 206 | 183 | }, |
| 207 | 184 | }, |
| ... | ... | @@ -212,9 +189,8 @@ const test_targets = blk: { |
| 212 | 189 | TestTarget{ |
| 213 | 190 | .target = Target{ |
| 214 | 191 | .Cross = CrossTarget{ |
| 192 | .cpu = Target.Cpu.baseline(.i386), | |
| 215 | 193 | .os = .windows, |
| 216 | .arch = .i386, | |
| 217 | .cpu_features = Target.Arch.i386.getBaselineCpuFeatures(), | |
| 218 | 194 | .abi = .msvc, |
| 219 | 195 | }, |
| 220 | 196 | }, |
| ... | ... | @@ -223,9 +199,8 @@ const test_targets = blk: { |
| 223 | 199 | TestTarget{ |
| 224 | 200 | .target = Target{ |
| 225 | 201 | .Cross = CrossTarget{ |
| 202 | .cpu = Target.Cpu.baseline(.x86_64), | |
| 226 | 203 | .os = .windows, |
| 227 | .arch = .x86_64, | |
| 228 | .cpu_features = Target.Arch.x86_64.getBaselineCpuFeatures(), | |
| 229 | 204 | .abi = .msvc, |
| 230 | 205 | }, |
| 231 | 206 | }, |
| ... | ... | @@ -234,9 +209,8 @@ const test_targets = blk: { |
| 234 | 209 | TestTarget{ |
| 235 | 210 | .target = Target{ |
| 236 | 211 | .Cross = CrossTarget{ |
| 212 | .cpu = Target.Cpu.baseline(.i386), | |
| 237 | 213 | .os = .windows, |
| 238 | .arch = .i386, | |
| 239 | .cpu_features = Target.Arch.i386.getBaselineCpuFeatures(), | |
| 240 | 214 | .abi = .gnu, |
| 241 | 215 | }, |
| 242 | 216 | }, |
| ... | ... | @@ -246,9 +220,8 @@ const test_targets = blk: { |
| 246 | 220 | TestTarget{ |
| 247 | 221 | .target = Target{ |
| 248 | 222 | .Cross = CrossTarget{ |
| 223 | .cpu = Target.Cpu.baseline(.x86_64), | |
| 249 | 224 | .os = .windows, |
| 250 | .arch = .x86_64, | |
| 251 | .cpu_features = Target.Arch.x86_64.getBaselineCpuFeatures(), | |
| 252 | 225 | .abi = .gnu, |
| 253 | 226 | }, |
| 254 | 227 | }, |