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_pfhost_mc.om

100 lines · 2147 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note Combine config cf[0..7]: h,top-k,unused,mutant,nquads,used.
3fn ph_mc_meta cf view ulong 64 meta edit ulong 512 to void
4nv = add add 9 mul 2 get cf 4 mul 2 get cf 1
5put meta 1 nv
6put meta 2 1
7put meta 320 2
8for v ulong nv
9sz = ulong 1
10if lt v 4
11sz = ulong 2
12end
13if ge v 8
14sz = ulong 4
15if ge v add 9 mul 2 get cf 4
16if eq rem sub v add 9 mul 2 get cf 4 2 1
17sz = ulong 2
18end
19end
20end
21put meta add 64 v sz
22end
23end
24fn ph_mc_head ins edit ulong 8192 st edit ulong 16 cf view ulong 64 to void
25ph_imm ins st 7 0 856 4
26ph_imm ins st 5 0 896 2
27ph_imm ins st 5 1 904 2
28ph_imm ins st 5 2 912 2
29ph_imm ins st 5 3 920 2
30ph_imm ins st 3 4 33 2
31ph_imm ins st 3 5 37 2
32ph_wide ins st 1 5 mul get cf 1 4 1
33ph_wide ins st 2 5 mul get cf 1 4 2
34for q ulong get cf 4
35kind = ulong 3
36if eq q 0
37kind = ulong 2
38end
39ph_load ins st add 9 mul 2 q 1 mul 16 q kind
40end
41for q ulong get cf 4
42ph_load ins st add 10 mul 2 q 2 mul 16 q 3
43end
44end
45fn ph_mc_loads ins edit ulong 8192 st edit ulong 16 cf view ulong 64 to void
46for s ulong get cf 1
47ph_base st 8 6 add 9 mul 2 div s 4 PHNONE
48put st 12 4
49put st 14 div get cf 0 4
50put st 15 shl rem s 4 24
51ph_emit ins st 0
52pa = add add 10 mul 2 get cf 4 mul 2 s
53ph_wide ins st pa 6 16 0
54end
55for s ulong get cf 1
56v = add add 9 mul 2 get cf 4 mul 2 s
57kind = ulong 3
58if eq s 0
59kind = ulong 2
60end
61ph_load ins st v add v 1 0 kind
62end
63for q ulong 4
64ph_base st 1 8 PHNONE PHNONE
65put st 15 shl q 16
66ph_emit ins st 0
67end
68end
69fn ph_mc_math ins edit ulong 8192 st edit ulong 16 cf edit ulong 64 to void
70for s ulong get cf 5
71v = add 9 mul 2 get cf 4
72v = add v mul 2 s
73for q ulong 4
74put cf 8 8
75put cf 9 q
76put cf 10 7
77put cf 11 add 10 mul 2 div s 4
78put cf 12 v
79put cf 13 rem s 4
80put cf 14 q
81ph_muladd ins st cf
82end
83end
84end
85fn ph_mc_body ins edit ulong 8192 st edit ulong 16 cf edit ulong 64 meta edit ulong 512 to void
86ph_mc_head ins st cf
87ph_mc_loads ins st cf
88ph_mc_math ins st cf
89ph_imad ins st 6 5 div get cf 0 4 4
90ph_wide ins st 3 6 16 3
91for q ulong 4
92ph_base st 12 PHNONE 3 8
93put st 15 shl q 32
94put st 14 mul 4 q
95put st 13 0
96ph_emit ins st 5
97end
98ph_tail ins st
99put meta 0 get st 0
100end