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 / q38-head / bounds.om

91 lines · 2098 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note Experimental bound generator. Input contract is documented in README.
3note Reuses checked opcodes and allocator; no handwritten machine encodings.
4fn qh_math ins edit ulong 8192 s edit ulong 64 to void
5note r10 score r11 coefficient r4 norm; r12 radius r13 abs score r14 constants.
6bc_node s 32 12 11 4 BCNONE
7bc_emit ins s 0
8bc_inst ins s 2 14 BCNONE 1065353224
9bc_node s 32 12 12 14 BCNONE
10bc_emit ins s 0
11bc_mask ins s 13 10 0 2147483647
12bc_inst ins s 2 14 BCNONE 897581056
13put s 9 0
14bc_ffma ins s 12 13 14 12
15bc_inst ins s 2 14 BCNONE 226492416
16bc_node s 30 12 12 14 BCNONE
17bc_emit ins s 0
18bc_node s 31 15 10 12 BCNONE
19bc_emit ins s 0
20bc_node s 30 16 10 12 BCNONE
21bc_emit ins s 0
22end
23fn qh_load ins edit ulong 8192 s edit ulong 64 to void
24bc_node s 7 0 BCNONE BCNONE BCNONE
25put s 22 856
26put s 23 1
27bc_emit ins s 4
28for k ulong 6
29op = ulong 5
30offset = add ulong 896 mul k 8
31if ge k 4
32op = 4
33offset = add ulong 928 mul sub k 4 4
34end
35bc_node s op k BCNONE BCNONE BCNONE
36put s 22 offset
37bc_emit ins s 2
38end
39bc_node s 3 6 BCNONE BCNONE BCNONE
40put s 22 33
41bc_emit ins s 2
42bc_node s 3 7 BCNONE BCNONE BCNONE
43put s 22 37
44bc_emit ins s 2
45bc_imm ins s 8 7 6 256
46bc_pred ins s 8 5
47put s 10 bc_branch ins s add get s 0 1 true
48for k ulong 2
49bc_wide ins s 9 8 k 4
50put s 8 0
51bc_mem ins s 11 add ulong 10 k 9 2
52end
53end
54fn qh_store ins edit ulong 8192 s edit ulong 64 to void
55for k ulong 2
56bc_wide ins s 9 8 add ulong 2 k 4
57bc_node s 12 BCNONE 9 add ulong 15 k BCNONE
58put s 21 0
59bc_emit ins s 5
60end
61bc_patch ins get s 10 get s 0
62bc_node s 45 BCNONE BCNONE BCNONE BCNONE
63bc_emit ins s 7
64at = bc_branch ins s get s 0 false
65bc_tail ins at
66end
67fn q38_bounds ins edit ulong 8192 m edit ulong 2048 st edit ulong 4 to uint
68s = new ulong 64 0
69for k ulong 8192
70put ins k 0
71end
72for k ulong 2048
73put m k 0
74end
75uv = bc_vreg s m 2 true
76for k ulong 17
77width = ulong 1
78if or lt k 4 eq k 9
79width = 2
80end
81v = bc_vreg s m width false
82end
83qh_load ins s
84qh_math ins s
85qh_store ins s
86put st 0 get s 0
87put st 1 get s 4
88put st 2 get s 5
89put st 3 0
90ret uint get s 3
91end