union CpuModel [src]
Fields
nativeAlways native
baselineAlways baseline
determined_by_arch_osIf CPU Architecture is native, then the CPU model will be native. Otherwise,
it will be baseline.
explicit: *const Target.Cpu.Model
Members
- eql (Function)
Source
pub const CpuModel = union(enum) {
/// Always native
native,
/// Always baseline
baseline,
/// If CPU Architecture is native, then the CPU model will be native. Otherwise,
/// it will be baseline.
determined_by_arch_os,
explicit: *const Target.Cpu.Model,
pub fn eql(a: CpuModel, b: CpuModel) bool {
const Tag = @typeInfo(CpuModel).@"union".tag_type.?;
const a_tag: Tag = a;
const b_tag: Tag = b;
if (a_tag != b_tag) return false;
return switch (a) {
.native, .baseline, .determined_by_arch_os => true,
.explicit => |a_model| a_model == b.explicit,
};
}
}