aboutsummaryrefslogtreecommitdiff
path: root/core/time
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-04-25 20:22:26 +0100
committergingerBill <bill@gingerbill.org>2021-04-25 20:22:26 +0100
commit72aa0e6e3891c034863476751b2aefda781de5b2 (patch)
treefc49f4821dcb900a30d472803e5340587c1cd65a /core/time
parentcb2e6ea31db90ca80314e5ff8ce8f43371fade7c (diff)
Replace many `foreign` llvm calls with intrinsics
Diffstat (limited to 'core/time')
-rw-r--r--core/time/time.odin8
1 files changed, 3 insertions, 5 deletions
diff --git a/core/time/time.odin b/core/time/time.odin
index eb35ac0d9..00d7e529a 100644
--- a/core/time/time.odin
+++ b/core/time/time.odin
@@ -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());
}