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
omega-mv / gpu / amd / tests / amd-exec / fma-probe.om
| 1 | note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 2 | note Test-only streaming interface: 12-byte little-endian (a,b,c) -> 4-byte result. |
| 3 | global fb uchar 12 |
| 4 | fn fbword p ulong to ulong |
| 5 | v = ulong 0 |
| 6 | for i ulong 4 |
| 7 | v = or v shl ulong get fb add p i mul i 8 |
| 8 | end |
| 9 | ret v |
| 10 | end |
| 11 | fn main to int |
| 12 | while true bound 999999 |
| 13 | n = ulong 0 |
| 14 | while lt n 12 bound 999999 |
| 15 | r = read 0 fb n sub 12 n |
| 16 | if lt r 0 |
| 17 | ret 74 |
| 18 | end |
| 19 | if eq r 0 |
| 20 | if eq n 0 |
| 21 | ret 0 |
| 22 | end |
| 23 | ret 74 |
| 24 | end |
| 25 | n = add n ulong r |
| 26 | end |
| 27 | v = fpfma fbword 0 fbword 4 fbword 8 |
| 28 | for i ulong 4 |
| 29 | put fb i uchar and shr v mul i 8 255 |
| 30 | end |
| 31 | n = 0 |
| 32 | while lt n 4 bound 999999 |
| 33 | r = write 1 fb n sub 4 n |
| 34 | if le r 0 |
| 35 | ret 74 |
| 36 | end |
| 37 | n = add n ulong r |
| 38 | end |
| 39 | end |
| 40 | ret 0 |
| 41 | end |