aboutsummaryrefslogtreecommitdiff
path: root/lib/std/target/feature.zig
diff options
context:
space:
mode:
authorLayne Gustafson <lgustaf1@binghamton.edu>2019-12-20 19:27:13 -0500
committerAndrew Kelley <andrew@ziglang.org>2020-01-19 20:53:18 -0500
commitc131e50ea7ea0fb95d188c3d0f71ef77bcc96952 (patch)
treece612c95d691e986fb60599f0fb3f568546c3893 /lib/std/target/feature.zig
parent9d66bda26421c2b687afc26122736515c9cc35da (diff)
downloadzig-c131e50ea7ea0fb95d188c3d0f71ef77bcc96952.tar.gz
zig-c131e50ea7ea0fb95d188c3d0f71ef77bcc96952.zip
Switch CPU/features to simple format
Diffstat (limited to 'lib/std/target/feature.zig')
-rw-r--r--lib/std/target/feature.zig81
1 files changed, 0 insertions, 81 deletions
diff --git a/lib/std/target/feature.zig b/lib/std/target/feature.zig
deleted file mode 100644
index d5bf45cd0e..0000000000
--- a/lib/std/target/feature.zig
+++ /dev/null
@@ -1,81 +0,0 @@
-const builtin = @import("builtin");
-const std = @import("std");
-const Arch = std.Target.Arch;
-
-pub const AArch64Feature = @import("feature/AArch64Feature.zig").AArch64Feature;
-pub const AmdGpuFeature = @import("feature/AmdGpuFeature.zig").AmdGpuFeature;
-pub const ArmFeature = @import("feature/ArmFeature.zig").ArmFeature;
-pub const AvrFeature = @import("feature/AvrFeature.zig").AvrFeature;
-pub const BpfFeature = @import("feature/BpfFeature.zig").BpfFeature;
-pub const HexagonFeature = @import("feature/HexagonFeature.zig").HexagonFeature; pub const MipsFeature = @import("feature/MipsFeature.zig").MipsFeature;
-pub const Msp430Feature = @import("feature/Msp430Feature.zig").Msp430Feature;
-pub const NvptxFeature = @import("feature/NvptxFeature.zig").NvptxFeature;
-pub const PowerPcFeature = @import("feature/PowerPcFeature.zig").PowerPcFeature;
-pub const RiscVFeature = @import("feature/RiscVFeature.zig").RiscVFeature;
-pub const SparcFeature = @import("feature/SparcFeature.zig").SparcFeature;
-pub const SystemZFeature = @import("feature/SystemZFeature.zig").SystemZFeature;
-pub const WebAssemblyFeature = @import("feature/WebAssemblyFeature.zig").WebAssemblyFeature;
-pub const X86Feature = @import("feature/X86Feature.zig").X86Feature;
-
-pub const EmptyFeature = @import("feature/empty.zig").EmptyFeature;
-
-pub fn ArchFeature(comptime arch: @TagType(Arch)) type {
- return switch (arch) {
- .arm, .armeb, .thumb, .thumbeb => ArmFeature,
- .aarch64, .aarch64_be, .aarch64_32 => AArch64Feature,
- .avr => AvrFeature,
- .bpfel, .bpfeb => BpfFeature,
- .hexagon => HexagonFeature,
- .mips, .mipsel, .mips64, .mips64el => MipsFeature,
- .msp430 => Msp430Feature,
- .powerpc, .powerpc64, .powerpc64le => PowerPcFeature,
- .amdgcn => AmdGpuFeature,
- .riscv32, .riscv64 => RiscVFeature,
- .sparc, .sparcv9, .sparcel => SparcFeature,
- .s390x => SystemZFeature,
- .i386, .x86_64 => X86Feature,
- .nvptx, .nvptx64 => NvptxFeature,
- .wasm32, .wasm64 => WebAssemblyFeature,
-
- else => EmptyFeature,
- };
-}
-
-pub fn ArchFeatureInfo(comptime arch: @TagType(Arch)) type {
- return FeatureInfo(ArchFeature(arch));
-}
-
-pub fn FeatureInfo(comptime EnumType: type) type {
- return struct {
- value: EnumType,
- name: []const u8,
- description: []const u8,
- llvm_name: []const u8,
-
- subfeatures: []const EnumType,
-
- const Self = @This();
-
- pub fn create(value: EnumType, name: []const u8, description: []const u8, llvm_name: []const u8) Self {
- return Self {
- .value = value,
- .name = name,
- .description = description,
- .llvm_name = llvm_name,
-
- .subfeatures = &[_]EnumType{},
- };
- }
-
- pub fn createWithSubfeatures(value: EnumType, name: []const u8, description: []const u8, llvm_name: []const u8, subfeatures: []const EnumType) Self {
- return Self {
- .value = value,
- .name = name,
- .description = description,
- .llvm_name = llvm_name,
-
- .subfeatures = subfeatures,
- };
- }
- };
-}