| author | |
| committer | |
| log | 2b23f98d2c31ef1a8cbe67e8f37e3b2aa2387ed3 |
| tree | 6e601e7167c3fed6e0ac9776b26c223bfd2f3f38 |
| parent | 181b25ce4fcebc32f6fdc7498148c0f5e131dda9 |
| signature |
3 files changed, 181 insertions(+), 1 deletions(-)
lib/std/Target.zig+3-1| ... | @@ -700,7 +700,7 @@ pub const Os = struct { | ... | @@ -700,7 +700,7 @@ pub const Os = struct { |
| 700 | }; | 700 | }; |
| 701 | 701 | ||
| 702 | pub const aarch64 = @import("Target/aarch64.zig"); | 702 | pub const aarch64 = @import("Target/aarch64.zig"); |
| 703 | pub const alpha = @import("Target/generic.zig"); | 703 | pub const alpha = @import("Target/alpha.zig"); |
| 704 | pub const amdgcn = @import("Target/amdgcn.zig"); | 704 | pub const amdgcn = @import("Target/amdgcn.zig"); |
| 705 | pub const arc = @import("Target/arc.zig"); | 705 | pub const arc = @import("Target/arc.zig"); |
| 706 | pub const arm = @import("Target/arm.zig"); | 706 | pub const arm = @import("Target/arm.zig"); |
| ... | @@ -1944,6 +1944,7 @@ pub const Cpu = struct { | ... | @@ -1944,6 +1944,7 @@ pub const Cpu = struct { |
| 1944 | /// Clang compatibility is important, consider using `baseline` instead. | 1944 | /// Clang compatibility is important, consider using `baseline` instead. |
| 1945 | pub fn generic(arch: Arch) *const Model { | 1945 | pub fn generic(arch: Arch) *const Model { |
| 1946 | return switch (arch) { | 1946 | return switch (arch) { |
| 1947 | .alpha => &alpha.cpu.ev4, | ||
| 1947 | .amdgcn => &amdgcn.cpu.gfx600, | 1948 | .amdgcn => &amdgcn.cpu.gfx600, |
| 1948 | .avr => &avr.cpu.avr1, | 1949 | .avr => &avr.cpu.avr1, |
| 1949 | .kvx => &kvx.cpu.coolidge_v1, | 1950 | .kvx => &kvx.cpu.coolidge_v1, |
| ... | @@ -1976,6 +1977,7 @@ pub const Cpu = struct { | ... | @@ -1976,6 +1977,7 @@ pub const Cpu = struct { |
| 1976 | /// `Os.Tag.freestanding`. | 1977 | /// `Os.Tag.freestanding`. |
| 1977 | pub fn baseline(arch: Arch, os: Os) *const Model { | 1978 | pub fn baseline(arch: Arch, os: Os) *const Model { |
| 1978 | return switch (arch) { | 1979 | return switch (arch) { |
| 1980 | .alpha => &alpha.cpu.ev6, | ||
| 1979 | .amdgcn => &amdgcn.cpu.gfx906, | 1981 | .amdgcn => &amdgcn.cpu.gfx906, |
| 1980 | .arm => switch (os.tag) { | 1982 | .arm => switch (os.tag) { |
| 1981 | .@"3ds" => &arm.cpu.mpcore, | 1983 | .@"3ds" => &arm.cpu.mpcore, |
lib/std/Target/alpha.zig created+101| ... | @@ -0,0 +1,101 @@ | ||
| 1 | //! This file is auto-generated by tools/update_cpu_features.zig. | ||
| 2 | |||
| 3 | const std = @import("../std.zig"); | ||
| 4 | const CpuFeature = std.Target.Cpu.Feature; | ||
| 5 | const CpuModel = std.Target.Cpu.Model; | ||
| 6 | |||
| 7 | pub const Feature = enum { | ||
| 8 | bwx, | ||
| 9 | cix, | ||
| 10 | fix, | ||
| 11 | max, | ||
| 12 | }; | ||
| 13 | |||
| 14 | pub const featureSet = CpuFeature.FeatureSetFns(Feature).featureSet; | ||
| 15 | pub const featureSetHas = CpuFeature.FeatureSetFns(Feature).featureSetHas; | ||
| 16 | pub const featureSetHasAny = CpuFeature.FeatureSetFns(Feature).featureSetHasAny; | ||
| 17 | pub const featureSetHasAll = CpuFeature.FeatureSetFns(Feature).featureSetHasAll; | ||
| 18 | |||
| 19 | pub const all_features = blk: { | ||
| 20 | const len = @typeInfo(Feature).@"enum".fields.len; | ||
| 21 | std.debug.assert(len <= CpuFeature.Set.needed_bit_count); | ||
| 22 | var result: [len]CpuFeature = undefined; | ||
| 23 | result[@intFromEnum(Feature.bwx)] = .{ | ||
| 24 | .llvm_name = null, | ||
| 25 | .description = "Enable byte/word extensions", | ||
| 26 | .dependencies = featureSet(&[_]Feature{}), | ||
| 27 | }; | ||
| 28 | result[@intFromEnum(Feature.cix)] = .{ | ||
| 29 | .llvm_name = null, | ||
| 30 | .description = "Enable counting extensions", | ||
| 31 | .dependencies = featureSet(&[_]Feature{}), | ||
| 32 | }; | ||
| 33 | result[@intFromEnum(Feature.fix)] = .{ | ||
| 34 | .llvm_name = null, | ||
| 35 | .description = "Enable floating point move and square root extensions", | ||
| 36 | .dependencies = featureSet(&[_]Feature{}), | ||
| 37 | }; | ||
| 38 | result[@intFromEnum(Feature.max)] = .{ | ||
| 39 | .llvm_name = null, | ||
| 40 | .description = "Enable motion video extensions", | ||
| 41 | .dependencies = featureSet(&[_]Feature{}), | ||
| 42 | }; | ||
| 43 | const ti = @typeInfo(Feature); | ||
| 44 | for (&result, 0..) |*elem, i| { | ||
| 45 | elem.index = i; | ||
| 46 | elem.name = ti.@"enum".fields[i].name; | ||
| 47 | } | ||
| 48 | break :blk result; | ||
| 49 | }; | ||
| 50 | |||
| 51 | pub const cpu = struct { | ||
| 52 | pub const ev4: CpuModel = .{ | ||
| 53 | .name = "ev4", | ||
| 54 | .llvm_name = null, | ||
| 55 | .features = featureSet(&[_]Feature{}), | ||
| 56 | }; | ||
| 57 | pub const ev45: CpuModel = .{ | ||
| 58 | .name = "ev45", | ||
| 59 | .llvm_name = null, | ||
| 60 | .features = featureSet(&[_]Feature{}), | ||
| 61 | }; | ||
| 62 | pub const ev5: CpuModel = .{ | ||
| 63 | .name = "ev5", | ||
| 64 | .llvm_name = null, | ||
| 65 | .features = featureSet(&[_]Feature{}), | ||
| 66 | }; | ||
| 67 | pub const ev56: CpuModel = .{ | ||
| 68 | .name = "ev56", | ||
| 69 | .llvm_name = null, | ||
| 70 | .features = featureSet(&[_]Feature{ | ||
| 71 | .bwx, | ||
| 72 | }), | ||
| 73 | }; | ||
| 74 | pub const ev6: CpuModel = .{ | ||
| 75 | .name = "ev6", | ||
| 76 | .llvm_name = null, | ||
| 77 | .features = featureSet(&[_]Feature{ | ||
| 78 | .bwx, | ||
| 79 | .fix, | ||
| 80 | .max, | ||
| 81 | }), | ||
| 82 | }; | ||
| 83 | pub const ev67: CpuModel = .{ | ||
| 84 | .name = "ev67", | ||
| 85 | .llvm_name = null, | ||
| 86 | .features = featureSet(&[_]Feature{ | ||
| 87 | .bwx, | ||
| 88 | .cix, | ||
| 89 | .fix, | ||
| 90 | .max, | ||
| 91 | }), | ||
| 92 | }; | ||
| 93 | pub const pca56: CpuModel = .{ | ||
| 94 | .name = "pca56", | ||
| 95 | .llvm_name = null, | ||
| 96 | .features = featureSet(&[_]Feature{ | ||
| 97 | .bwx, | ||
| 98 | .max, | ||
| 99 | }), | ||
| 100 | }; | ||
| 101 | }; | ||
tools/update_cpu_features.zig+77| ... | @@ -393,6 +393,83 @@ const targets = [_]ArchTarget{ | ... | @@ -393,6 +393,83 @@ const targets = [_]ArchTarget{ |
| 393 | "apple-latest", | 393 | "apple-latest", |
| 394 | }, | 394 | }, |
| 395 | }, | 395 | }, |
| 396 | .{ | ||
| 397 | .zig_name = "alpha", | ||
| 398 | .llvm = null, | ||
| 399 | .extra_features = &.{ | ||
| 400 | .{ | ||
| 401 | .zig_name = "bwx", | ||
| 402 | .desc = "Enable byte/word extensions", | ||
| 403 | .deps = &.{}, | ||
| 404 | }, | ||
| 405 | .{ | ||
| 406 | .zig_name = "cix", | ||
| 407 | .desc = "Enable counting extensions", | ||
| 408 | .deps = &.{}, | ||
| 409 | }, | ||
| 410 | .{ | ||
| 411 | .zig_name = "fix", | ||
| 412 | .desc = "Enable floating point move and square root extensions", | ||
| 413 | .deps = &.{}, | ||
| 414 | }, | ||
| 415 | .{ | ||
| 416 | .zig_name = "max", | ||
| 417 | .desc = "Enable motion video extensions", | ||
| 418 | .deps = &.{}, | ||
| 419 | }, | ||
| 420 | }, | ||
| 421 | .extra_cpus = &.{ | ||
| 422 | .{ | ||
| 423 | .llvm_name = null, | ||
| 424 | .zig_name = "ev4", | ||
| 425 | .features = &.{}, | ||
| 426 | }, | ||
| 427 | .{ | ||
| 428 | .llvm_name = null, | ||
| 429 | .zig_name = "ev45", | ||
| 430 | .features = &.{}, | ||
| 431 | }, | ||
| 432 | .{ | ||
| 433 | .llvm_name = null, | ||
| 434 | .zig_name = "ev5", | ||
| 435 | .features = &.{}, | ||
| 436 | }, | ||
| 437 | .{ | ||
| 438 | .llvm_name = null, | ||
| 439 | .zig_name = "ev56", | ||
| 440 | .features = &.{ | ||
| 441 | "bwx", | ||
| 442 | }, | ||
| 443 | }, | ||
| 444 | .{ | ||
| 445 | .llvm_name = null, | ||
| 446 | .zig_name = "pca56", | ||
| 447 | .features = &.{ | ||
| 448 | "bwx", | ||
| 449 | "max", | ||
| 450 | }, | ||
| 451 | }, | ||
| 452 | .{ | ||
| 453 | .llvm_name = null, | ||
| 454 | .zig_name = "ev6", | ||
| 455 | .features = &.{ | ||
| 456 | "bwx", | ||
| 457 | "fix", | ||
| 458 | "max", | ||
| 459 | }, | ||
| 460 | }, | ||
| 461 | .{ | ||
| 462 | .llvm_name = null, | ||
| 463 | .zig_name = "ev67", | ||
| 464 | .features = &.{ | ||
| 465 | "bwx", | ||
| 466 | "cix", | ||
| 467 | "fix", | ||
| 468 | "max", | ||
| 469 | }, | ||
| 470 | }, | ||
| 471 | }, | ||
| 472 | }, | ||
| 396 | .{ | 473 | .{ |
| 397 | .zig_name = "amdgcn", | 474 | .zig_name = "amdgcn", |
| 398 | .llvm = .{ | 475 | .llvm = .{ |