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 / qualification / om2 / candidates / s4 / mutants / part-order.to

70 lines · 1636 bytes Raw Blame History
1note arrpart mutant: `part A o k` keeps its operands and bounds checks, but evaluates k before o.
2note The source expressions are still parsed in their original order. partord emits branch trampolines
3note rather than moving instruction spans, so trap sites, deferred calls, inline fixups, global addresses
4note and diagnostic source records retain their original emitted positions without relocation changes.
5fn arrpart f ulong pi ulong md ulong to void
6p = add mul sub f 1 6 pi
7e = arrname
8i = sub e 1
9k = ulong get nm_kind i
10if ge k 6
11fail 7
12end
13if eq k 4
14fail 19
15end
16fz_arg e
17if eq get fn_pk p 3
18if eq md 57
19fail 20
20end
21if and ne k 1 ne k 3
22fail 20
23end
24else
25if eq md 58
26fail 7
27end
28end
29if ne ulong get nm_type i ulong get fn_pt p
30fail 7
31end
32if ne get fn_pl p 0
33fail 7
34end
35rn = alloc
36ro = partord rn
37d = partck i ro rn
38ux = add mul get depth 0 6 pi
39put ul_k ux 1
40put ul_v ux rn
41put rt 0 e
42put rk 0 5
43put rv 0 d
44end
45
46note partord: emitted layout is B length; offset; B checks; length; B offset; checks.
47note Reserve rn before lowering offset, so offset temporaries cannot overwrite it and offset calls save
48note and restore it through the existing register-save machinery. No new runtime stack convention is used.
49note Force the length result into rn before jumping back to offset; ro remains the offset result.
50fn partord rn ulong to ulong
51first = get oc 0
52emit 335544320
53head = get oc 0
54rdval 0 5 255 0
55if ne get rt 0 5
56fail 7
57end
58ro = matreg get rk 0 get rv 0 5
59done = get oc 0
60emit 335544320
61patch26 first get oc 0
62rdval 0 5 255 0
63if ne get rt 0 5
64fail 7
65end
66force get rk 0 get rv 0 5 rn
67back head
68patch26 done get oc 0
69ret ro
70end