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 / fma-probe.om

41 lines · 666 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note Test-only streaming interface: 12-byte little-endian (a,b,c) -> 4-byte result.
3global fb uchar 12
4fn fbword p ulong to ulong
5v = ulong 0
6for i ulong 4
7v = or v shl ulong get fb add p i mul i 8
8end
9ret v
10end
11fn main to int
12while true bound 999999
13n = ulong 0
14while lt n 12 bound 999999
15r = read 0 fb n sub 12 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
27v = fpfma fbword 0 fbword 4 fbword 8
28for i ulong 4
29put fb i uchar and shr v mul i 8 255
30end
31n = 0
32while lt n 4 bound 999999
33r = write 1 fb n sub 4 n
34if le r 0
35ret 74
36end
37n = add n ulong r
38end
39end
40ret 0
41end