mirror of
https://github.com/ziglang/zig.git
synced 2025-12-24 23:23:07 +00:00
29 lines
777 B
Zig
29 lines
777 B
Zig
const feature = @import("std").target.feature;
|
|
const CpuInfo = @import("std").target.cpu.CpuInfo;
|
|
|
|
pub const WebAssemblyCpu = enum {
|
|
BleedingEdge,
|
|
Generic,
|
|
Mvp,
|
|
|
|
pub fn getInfo(self: @This()) CpuInfo {
|
|
return cpu_infos[@enumToInt(self)];
|
|
}
|
|
|
|
pub const FeatureType = feature.WebAssemblyFeature;
|
|
|
|
const cpu_infos = [@memberCount(@This())]CpuInfo(@This()) {
|
|
CpuInfo(@This()).create(.BleedingEdge, "bleeding-edge", &[_]FeatureType {
|
|
.Atomics,
|
|
.MutableGlobals,
|
|
.NontrappingFptoint,
|
|
.Simd128,
|
|
.SignExt,
|
|
},
|
|
CpuInfo(@This()).create(.Generic, "generic", &[_]FeatureType {
|
|
},
|
|
CpuInfo(@This()).create(.Mvp, "mvp", &[_]FeatureType {
|
|
},
|
|
};
|
|
};
|