mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
18 lines
588 B
Zig
18 lines
588 B
Zig
const std = @import("std");
|
|
const builtin = @import("builtin");
|
|
const arch = builtin.cpu.arch;
|
|
const function_prefix = @import("assembly_util.zig").function_prefix;
|
|
|
|
// I couldn't manage to define this in a PIE friendly way with inline assembly.
|
|
// Instead, I am defining it as global assembly functions.
|
|
comptime {
|
|
switch (arch) {
|
|
.x86_64 => {
|
|
asm (std.fmt.comptimePrint(@embedFile("cpuid.S"), .{ .function_prefix = function_prefix }));
|
|
},
|
|
else => unreachable,
|
|
}
|
|
}
|
|
|
|
pub extern fn supports_avx2() bool;
|
|
pub extern fn supports_prefetchw() bool;
|