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 / omc / tests / a64-decode-cases.om

117 lines · 1686 bytes Raw Blame History
1om2
2note Deterministic parity input for seed/check/a64check.om and the retained C reference.
3note 65536 xorshift words plus every one-bit flip of every decoder pattern, then 4096 low-register
4note and immediate variations per pattern. Constants are the C reference's pattern words, not a new ISA.
5text hx "0123456789abcdef"
6global outb uchar 65536
7global outn ulong 1
8fn flush to void
9p = ulong 0
10while lt p get outn 0 bound 65536
11r = write 1 outb p sub get outn 0 p
12if le r 0
13exit 2
14end
15p = add p ulong r
16end
17put outn 0 0
18end
19fn emit w uint to void
20if gt get outn 0 65527
21flush
22end
23p = get outn 0
24for j ulong 8
25v = and shr ulong w sub 28 mul j 4 15
26put outb add p j get hx v
27end
28put outb add p 8 10
29put outn 0 add p 9
30end
31fn pattern i ulong to uint
32if eq i 0
33ret 0xd65f03c0
34end
35if eq i 1
36ret 0x14000000
37end
38if eq i 2
39ret 0x54000000
40end
41if eq i 3
42ret 0x34000000
43end
44if eq i 4
45ret 0x35000000
46end
47if eq i 5
48ret 0x52800000
49end
50if eq i 6
51ret 0x1b007c00
52end
53if eq i 7
54ret 0x0a000000
55end
56if eq i 8
57ret 0x2a000000
58end
59if eq i 9
60ret 0x4a000000
61end
62if eq i 10
63ret 0x0b000000
64end
65if eq i 11
66ret 0x4b000000
67end
68if eq i 12
69ret 0x72800000
70end
71if eq i 13
72ret 0x10000000
73end
74if eq i 14
75ret 0xb9400000
76end
77if eq i 15
78ret 0xb9000000
79end
80if eq i 16
81ret 0xb8400400
82end
83if eq i 17
84ret 0xb8000400
85end
86if eq i 18
87ret 0x39400000
88end
89if eq i 19
90ret 0x39000000
91end
92if eq i 20
93ret 0x71000000
94end
95ret 0x6b000000
96end
97fn main to int
98x = uint 1077
99for i ulong 65536
100x = xor x shl x 13
101x = xor x shr x 17
102x = xor x shl x 5
103emit x
104end
105for i ulong 22
106b = pattern i
107for j uint 32
108emit xor b shl uint 1 j
109end
110for k uint 4096
111emit or b or shl and k 31 16 and k 1023
112emit or or b 0x80000000 shl k 5
113end
114end
115flush
116ret 0
117end