interplane.Get Omega
Read in your language

omega-mv

Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.

Brought by drakestapleton

branch main Branches Tags History

omega-mv / seed / ng / front / runs / leafcall-s.om

36 lines · 938 bytes Raw Blame History
1note leafcall-s: kernels/leafcall.om with 3000000 calls (was 30000000), for ngrun in gate-front-ir.
2note leafcall: a two-parameter leaf function called from a loop that keeps values
3note live across the call; s = 1 + sum mix(i, 2654435761), t = xor of every running s. Prints s then t.
4note OMC-EFF-2: main writes the nanoseconds between its two monons readings (the computation, without
5note start-up and output) as one decimal line on stderr; stdout is unchanged.
6global out uchar 32
7fn putnum fd int v ulong to void
8put out 31 10
9p = ulong 31
10x = v
11while gt x 9
12p = sub p 1
13put out p uchar add rem x 10 48
14x = div x 10
15end
16p = sub p 1
17put out p uchar add x 48
18w = write fd out p sub 32 p
19end
20fn mix x ulong k ulong to ulong
21ret xor mul x k shr x 5
22end
23fn main to int
24t0 = monons
25s = ulong 1
26t = ulong 0
27for i ulong 3000000
28s = add s mix i 2654435761
29t = xor t s
30end
31t1 = monons
32putnum 2 ulong sub t1 t0
33putnum 1 s
34putnum 1 t
35ret 0
36end