mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-02 10:01:48 -07:00
Replace many foreign llvm calls with intrinsics
This commit is contained in:
+3
-5
@@ -1,5 +1,7 @@
|
||||
package time
|
||||
|
||||
import "intrinsics"
|
||||
|
||||
Duration :: distinct i64;
|
||||
|
||||
Nanosecond :: Duration(1);
|
||||
@@ -137,11 +139,7 @@ clock :: proc(t: Time) -> (hour, min, sec: int) {
|
||||
|
||||
|
||||
read_cycle_counter :: proc() -> u64 {
|
||||
foreign _ {
|
||||
@(link_name="llvm.readcyclecounter")
|
||||
llvm_readcyclecounter :: proc "none" () -> u64 ---
|
||||
}
|
||||
return llvm_readcyclecounter();
|
||||
return u64(intrinsics.read_cycle_counter());
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user