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 / bench / hand / sort-L.spec

38 lines · 1737 bytes Raw Blame History
1@ng a64-enc
2; sort ngL: the same rewrite as isort-L.spec on sort's isort (omc 0x400128..0x4001cc; the array
3; `a edit ulong 40000` arrives in x0): 40000 and 1000000 hoisted into x7, x9, rotation, the eager and
4; lowered to branches; bounds checks (trap 3, 0x4001dc) and the while bound counter x5 (trap 4, 0x4001e4) kept.
5; @old 0x400128 0xd2800001 0xd2938802 0xeb02003f 0x540004c2 0xd2938803 0xeb03003f 0x540004e2 0xf8617802 0xaa0103e3 0xd2800024 0xd2800005 0xf100007f 0x9a9f97e6 0x8a060088 0xb40002a8 0xd2884809 0xf2a001e9 0xeb0900bf 0x540003a2 0x910004a5 0xd1000468 0xd2938809 0xeb09011f 0x540002c2 0xf8687806 0xeb0200df 0x540000e9 0xd2938808 0xeb08007f 0x54000202 0xf8237806 0xd1000463 0x14000002 0xd2800004 0x17ffffe9 0xd2938805 0xeb05007f 0x54000102 0xf8237802 0x91000421 0x17ffffd9 0xd65f03c0
6; @at 0x400128
7movzx 1 0 0 | mov x1, #0x0
8movzx 7 0x9c40 0 | mov x7, #0x9c40
9movzx 9 0x4240 0 | mov x9, #0x4240
10movkx 9 0xf 1 | movk x9, #0xf, lsl #16
11subsx 31 1 7 | cmp x1, x7
12bcond 2 40 | b.cs @+160
13ldrxr 2 0 1 1 | ldr x2, [x0, x1, lsl #3]
14addxi 3 1 0 0 | add x3, x1, #0x0
15movzx 5 0 0 | mov x5, #0x0
16cbzx 3 15 | cbz x3, @+60
17subsx 31 5 9 | cmp x5, x9
18bcond 2 36 | b.cs @+144
19addxi 5 5 1 0 | add x5, x5, #0x1
20subxi 8 3 1 0 | sub x8, x3, #0x1
21subsx 31 8 7 | cmp x8, x7
22bcond 2 30 | b.cs @+120
23ldrxr 6 0 8 1 | ldr x6, [x0, x8, lsl #3]
24subsx 31 6 2 | cmp x6, x2
25bcond 9 6 | b.ls @+24
26subsx 31 3 7 | cmp x3, x7
27bcond 2 25 | b.cs @+100
28strxr 6 0 3 1 | str x6, [x0, x3, lsl #3]
29addxi 3 8 0 0 | add x3, x8, #0x0
30cbnzx 3 -13 | cbnz x3, @-52
31subsx 31 3 7 | cmp x3, x7
32bcond 2 20 | b.cs @+80
33strxr 2 0 3 1 | str x2, [x0, x3, lsl #3]
34addxi 1 1 1 0 | add x1, x1, #0x1
35subsx 31 1 7 | cmp x1, x7
36bcond 3 -25 | b.cc @-100
37ret 30 | ret
38; @nop 0x4001d0