mirror of
https://github.com/odin-lang/Odin.git
synced 2025-12-30 01:44:36 +00:00
Add rdtsc.odin
This commit is contained in:
19
core/simd/x86/rdtsc.odin
Normal file
19
core/simd/x86/rdtsc.odin
Normal file
@@ -0,0 +1,19 @@
|
||||
//+build i386, amd64
|
||||
package simd_x86
|
||||
|
||||
_rdtsc :: #force_inline proc "c" () -> u64 {
|
||||
return rdtsc()
|
||||
}
|
||||
|
||||
__rdtscp :: #force_inline proc "c" (aux: ^u32) -> u64 {
|
||||
return rdtscp(aux)
|
||||
}
|
||||
|
||||
@(default_calling_convention="c")
|
||||
@(private)
|
||||
foreign _ {
|
||||
@(link_name="llvm.x86.rdtsc")
|
||||
rdtsc :: proc() -> u64 ---
|
||||
@(link_name="llvm.x86.rdtscp")
|
||||
rdtscp :: proc(aux: rawptr) -> u64 ---
|
||||
}
|
||||
Reference in New Issue
Block a user