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 / amd / tests / amd-exec / trans-probe.om

58 lines · 787 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note Test-only 8-byte (opcode, input bits) to 4-byte result; short record exits 74.
3global tb uchar 8
4fn tbword p ulong to ulong
5v = ulong 0
6for i ulong 4
7v = or v shl ulong get tb add p i mul i 8
8end
9ret v
10end
11fn main to int
12while true bound 999999
13n = ulong 0
14while lt n 8 bound 999999
15r = read 0 tb n sub 8 n
16if lt r 0
17ret 74
18end
19if eq r 0
20if eq n 0
21ret 0
22end
23ret 74
24end
25n = add n ulong r
26end
27op = tbword 0
28v = tbword 4
29if eq op 32
30v = fpexp v
31else
32if eq op 33
33v = fplog v
34else
35if eq op 34
36v = fprcp v
37else
38if ne op 36
39ret 66
40end
41v = fprsq v
42end
43end
44end
45for i ulong 4
46put tb i uchar and shr v mul i 8 255
47end
48n = 0
49while lt n 4 bound 999999
50r = write 1 tb n sub 4 n
51if le r 0
52ret 74
53end
54n = add n ulong r
55end
56end
57ret 0
58end