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

51 lines · 898 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2global QHOut uchar 8
3fn qh_word v ulong to void
4for j ulong 8
5put QHOut j uchar and shr v mul j 8 255
6end
7if ne write 1 QHOut 0 8 8
8trap 5
9end
10end
11fn main to int
12ins = new ulong 8192 0
13meta = new ulong 2048 0
14phys = new ulong 288 0
15st = new ulong 4 0
16rs = new ulong 4 0
17code = new uchar 16384 0
18if ne q38_bounds ins meta st 0
19ret 66
20end
21if ne bc_ircheck ins get st 0 meta 0
22ret 69
23end
24if ne bc_regalloc ins get st 0 meta phys rs 128 0
25ret 67
26end
27nbytes = bc_encode ins phys get st 0 1 code
28if eq nbytes 0
29ret 68
30end
31for k ulong 4
32qh_word get st k
33end
34qh_word get rs 1
35qh_word get rs 2
36for k ulong get st 1
37qh_word get meta k
38qh_word get phys k
39end
40for k ulong get st 2
41qh_word get meta add k 256
42qh_word get phys add k 256
43end
44for k ulong mul get st 0 8
45qh_word get ins k
46end
47if ne write 1 code 0 nbytes long nbytes
48ret 74
49end
50ret 0
51end