tiny.simd.detectSpin
Defined in thread.spin.
Source
Source: lib/simd/src/thread/spin.zig:168
zig
pub fn detectSpin(disabled: u8) SpinType { if (comptime isX86()) { const leaf0 = cpuid(0, 0); if (comptime haveMonitorX()) { if (enabled(disabled, .monitor_x) and isAmd(leaf0)) { const extended = cpuid(0x8000_0000, 0); if (extended.eax >= 0x8000_0001) { const features = cpuid(0x8000_0001, 0); if (features.ecx & (@as(u32, 1) << 29) != 0) { return .monitor_x; } } } } if (comptime haveUMonitor()) { if (enabled(disabled, .u_monitor) and leaf0.eax >= 7) { const features = cpuid(7, 0); if (features.ecx & (@as(u32, 1) << 5) != 0) { return .u_monitor; } } } } return .pause;}Source: lib/simd/src/root.zig:125
zig
pub const detectSpin = thread.detectSpin;Also reachable as
Audit
| Definitions | 1 |
|---|---|
| Public names | 3 |
| Members | 0 |
| Version | 26.7.0 |
| Revision | daab053ee433 |