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 / cg_replay.om

64 lines · 1170 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note Replay wire admission. maxop is the final opcode of the pinned public enum; no new IR op is introduced.
3fn validreg v ulong lim ulong to bool
4ret or eq v 18446744073709551615 lt v lim
5end
6fn cg_replay ins view ulong 8192 meta view ulong 512 maxop ulong to ulong
7n = get meta 0
8if or eq n 0 gt n 1024
9ret 4
10end
11if or gt get meta 1 256 gt get meta 2 32
12ret 4
13end
14if gt get meta 5 24
15ret 4
16end
17lim = get meta 6
18if and ne lim 0 or le lim 128 gt lim 246
19ret 4
20end
21if gt get meta 7 1
22ret 9
23end
24if and eq get meta 7 1 gt get meta 1 160
25ret 10
26end
27for v ulong get meta 1
28k = get meta add 64 v
29if and ne k 1 and ne k 2 ne k 4
30ret 4
31end
32end
33for u ulong get meta 2
34k = get meta add 320 u
35if and ne k 1 ne k 2
36ret 4
37end
38end
39for i ulong n
40b = mul i 8
41if gt get ins b maxop
42ret 4
43end
44for off ulong 4
45f = add off 1
46if not validreg get ins add b f 256
47ret 4
48end
49end
50if not validreg get ins add b 5 32
51ret 4
52end
53end
54note Closures must occur in emitter order, as the C replay dispatch consumes them.
55last = ulong 0
56for l ulong get meta 5
57e = get meta add 17 mul l 2
58if or ge e n lt e last
59ret 4
60end
61last = e
62end
63ret 0
64end