code wiki / _hdl_build / nx_gen_machine.nx
nx_gen_machine.nx
buildroot/runtime/_hdl_build/nx_gen_machine.nx
about
AUTHORED BY nx_machine_gen from a DATA spec (op-fragments + examples) -- a machine the team authored from DATA, not hand-written. license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_itoa_lib.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 4 | const EVO_MAGIC_2862933555777941757: i64 = 2862933555777941757 |
| 5 | const EVO_MAGIC_3037000493: i64 = 3037000493 |
| 6 | const EVO_MAGIC_2000000: i64 = 2000000 |
| 7 | const EVO_MAGIC_1000000: i64 = 1000000 |
| 8 | const EVO_MAGIC_2654435761: i64 = 2654435761 |
| 9 | const EVO_MAGIC_12345: i64 = 12345 |
| 10 | const EVO_MAGIC_1000000000: i64 = 1000000000 |
| 11 | const GLEN: i64 = 4 |
| 12 | const EVO_P: i64 = 256 |
| 13 | const EVO_G: i64 = 2000 |
| 14 | const EVO_T: i64 = 5 |
| 15 | const NTRAIN: i64 = 6 |
| 16 | const NHELD: i64 = 4 |
functions
| 17 | func gm_rand(s: *i64) -> i64 { s[0] = s[0] * EVO_MAGIC_2862933555777941757 + EVO_MAGIC_3037000493; return (s[0] >> 17) & 0x3fffffff } |
| 18 | func gm_abs(x: i64) -> i64 { if x < 0 { return 0 - x } return x } called by 1: gm_fit |
| 19 | func gm_xa(i: i64) -> i64 |
| 32 | func gm_xb(i: i64) -> i64 |
| 45 | func gm_xy(i: i64) -> i64 |
| 58 | func gm_eval(pop: *i64, base: i64, a: i64, b: i64) -> i64 |
| 73 | func gm_fit(pop: *i64, base: i64) -> i64 |
| 85 | func gm_tourney(fit: *i64, state: *i64) -> i64 |
| 92 | func gm_p(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 97 | func gm_pn(v: i64) -> i64 { nxi_out(v); return 0 } |
| 98 | func main() -> i64 |