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 / nvidia / checks / arest-victim.om
| 1 | note SPDX-License-Identifier: Apache-2.0 |
| 2 | note gpu/nvidia/checks/arest-victim.om: arvictim (gpu/nvidia/om/apirest/victim.om); Q is its 8 q words and 17 records of 8 bytes as in arest-cache.om; q after the call is output 64 on. Composed before arest.om. |
| 3 | text t_name "AREST-VICTIM" |
| 4 | text t_au "victim" |
| 5 | note the 17 records from word s of q, 8 bytes each, little-endian |
| 6 | fn arrec q view ulong 64 s ulong x edit uchar 136 to void |
| 7 | for i ulong 17 |
| 8 | w = get q add s i |
| 9 | c = mul i 8 |
| 10 | for b ulong 8 |
| 11 | put x add c b uchar and shr w mul b 8 255 |
| 12 | end |
| 13 | end |
| 14 | end |
| 15 | fn arop q view ulong 64 nq ulong ny ulong o edit ulong 128 to ulong |
| 16 | if or ne nq 25 ne ny 0 |
| 17 | ckbad |
| 18 | end |
| 19 | a = new ulong 8 0 |
| 20 | for i ulong 8 |
| 21 | put a i get q i |
| 22 | end |
| 23 | x = new uchar 136 0 |
| 24 | arrec q 8 x |
| 25 | r = arvictim a x |
| 26 | for i ulong 8 |
| 27 | put o add 64 i get a i |
| 28 | end |
| 29 | ret r |
| 30 | end |