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 / gpu / nvidia / om / codegen / qm_host.om

45 lines · 918 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note op 0 mark predicate; 1 little-endian read; >=2 packed selftest counts plus 2.
3note a,b,c,d,e are insn op, immediate, word0, word1, word2 for verification.
4fn qm_host op ulong a ulong b ulong c ulong d ulong e ulong to ulong
5if eq op 0
6if and eq a 16 eq b 1362114610
7ret 1
8end
9ret 0
10end
11if eq op 1
12ret or or a shl b 8 or shl c 16 shl d 24
13end
14if eq a 37
15if ne and c 65535 29246
16ret 18446744073709551615
17end
18if ne and d 4294967040 0
19ret 18446744073709551615
20end
21if ne e 75526399
22ret 18446744073709551615
23end
24ret add op 65536
25end
26if ne a 16
27ret op
28end
29if eq b 1362114610
30if ne and c 65535 29306
31ret 18446744073709551615
32end
33if ne and d 4294967040 0
34ret 18446744073709551615
35end
36if ne and e 4294967040 11264
37ret 18446744073709551615
38end
39ret add op 1
40end
41if or ne and c 65535 29244 ne and e 4294967040 268288
42ret 18446744073709551615
43end
44ret add op 256
45end