code wiki / _hdl_build / nx_self_measure_cost.nx
nx_self_measure_cost.nx
buildroot/runtime/_hdl_build/nx_self_measure_cost.nx
about
nx_self_measure_cost.nx -- BUILD OUR OWN cost data, on whatever chip the seed
lands on. uops.info only characterizes Intel; this measures THIS silicon directly
with rdtsc/rdcycle -- so a sovereign RV64 core, an ARM garden sensor, or a
throttled/damaged unit each get a REAL profile uops.info never had. The node
times dependent op-chains (latency) and normalizes to add. This is the seed
growing to meet its hardware's measured reality (Cardinal: optimize to THIS chip).
dependencies 1 imports · 1 importers
imports: nx_syscalls.nx
imported by: nx_cost_federation_test.nx
structs
| none |
consts
| 9 | const SM_MAGIC_3750763034362895579: i64 = 3750763034362895579 |
| 10 | const SM_MAGIC_1099511628211: i64 = 1099511628211 |
| 12 | const SM_ITERS: i64 = 2000000 |
functions
| 16 | func sm_add() -> i64 { let t0: i64 = __rdtsc(); var a: i64 = 7; var i: i64 = 0; while i < SM_ITERS { a = a + i; i = i + 1 } let t1: i64 = __rdtsc(); if a == 0 - 1 { sys_write(1, "" as *u8, 0) } return t1 - t0 } |
| 17 | func sm_mul() -> i64 { let t0: i64 = __rdtsc(); var a: i64 = 7; var i: i64 = 0; while i < SM_ITERS { a = a * 3; a = a | 1; i = i + 1 } let t1: i64 = __rdtsc(); if a == 0 - 1 { sys_write(1, "" as *u8, 0) } return t1 - t0 } |
| 18 | func sm_shl() -> i64 { let t0: i64 = __rdtsc(); var a: i64 = 7; var i: i64 = 0; while i < SM_ITERS { a = a << 1; a = a | 1; i = i + 1 } let t1: i64 = __rdtsc(); if a == 0 - 1 { sys_write(1, "" as *u8, 0) } return t1 - t0 } |
| 22 | func sm_profile(out: *i64) -> i64 |
| 40 | func sm_sane(p: *i64) -> i64 called by 1: cf_contribute |
| 48 | func sm_hash(p: *i64, n: i64) -> i64 called by 1: cf_contribute |