interplane.Get Omega
Read in your language

CUDApp

CUDA++: AIEN’s GPU machine-code toolchain, runtime and driver client for NVIDIA GPUs without the CUDA toolkit. Hardware coverage and driver replacement limits are explicit.

Brought by drakestapleton

branch main Branches Tags History

CUDApp / om / codegen / cg_reconv.om

86 lines · 1398 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note Source-derived ordered steps from omega_bw_reconv.h. C owns structs and dereferences.
3note Failed joins retain the already-decremented depth and any already-patched immediate.
4fn rc_g w view ulong 8 i ulong to long
5u = get w i
6v = long u
7if ge u 2147483648
8v = sub v 4294967296
9end
10ret v
11end
12fn rc_u v long to ulong
13if lt v 0
14ret ulong add v 4294967296
15end
16ret ulong v
17end
18fn cg_reconv act ulong w edit ulong 8 to long
19if eq act 0
20if lt rc_g w 0 16
21ret rc_g w 0
22end
23ret -1
24end
25if eq act 1
26if or ge rc_g w 0 16 lt rc_g w 3 0
27ret -1
28end
29d = rc_g w 0
30put w 0 rc_u add d 1
31put w 2 rc_u add rc_g w 2 1
32if gt rc_g w 0 rc_g w 1
33put w 1 get w 0
34end
35ret d
36end
37if eq act 2
38if or le rc_g w 0 0 lt rc_g w 1 0
39ret -1
40end
41ret sub rc_g w 0 1
42end
43if eq act 3
44if ge rc_g w 0 8
45ret -1
46end
47n = rc_g w 0
48put w 0 rc_u add n 1
49ret n
50end
51if eq act 4
52if or le rc_g w 0 0 eq rc_g w 3 0
53ret -1
54end
55if lt rc_g w 1 0
56ret -1
57end
58if ge ulong rc_g w 1 get w 2
59ret -1
60end
61put w 0 rc_u sub rc_g w 0 1
62ret rc_g w 0
63end
64if eq act 5
65if or lt rc_g w 0 0 ge rc_g w 0 rc_g w 1
66ret -1
67end
68if or ne rc_g w 2 54 ne rc_g w 3 55
69ret -1
70end
71if or ne rc_g w 4 rc_g w 6 ne rc_g w 5 rc_g w 6
72ret -1
73end
74ret sub add rc_g w 1 1 rc_g w 0
75end
76if eq act 6
77if or le rc_g w 0 rc_g w 1 ge rc_g w 0 rc_g w 2
78ret -1
79end
80if ne rc_g w 3 46
81ret -1
82end
83ret sub rc_g w 2 rc_g w 0
84end
85ret -1
86end