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 / om / core / graph.om
| 1 | note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 2 | note Copyright 2026 Drake Stapleton |
| 3 | fn gnew b edit uchar 6648836 p ulong kind ulong to void |
| 4 | for i ulong 25972 |
| 5 | put b add p i uchar 0 |
| 6 | end |
| 7 | p = add p 36 |
| 8 | for i ulong 4 |
| 9 | put b add p i uchar and shr kind mul i 8 255 |
| 10 | end |
| 11 | end |
| 12 | fn gmatch b view uchar 6648836 id view uchar 32 p ulong to bool |
| 13 | if eq get b add p 32 uchar 0 |
| 14 | ret false |
| 15 | end |
| 16 | for i ulong 32 |
| 17 | if ne get b add p i get id i |
| 18 | ret false |
| 19 | end |
| 20 | end |
| 21 | ret true |
| 22 | end |
| 23 | fn omgraph b edit uchar 6648836 id view uchar 32 kind ulong mode ulong to ulong |
| 24 | n = or ulong get b 0 shl ulong get b 1 8 |
| 25 | if eq mode 0 |
| 26 | if ge n 256 |
| 27 | ret 256 |
| 28 | end |
| 29 | p = add 4 mul n 25972 |
| 30 | gnew b p kind |
| 31 | put b 0 uchar and add n 1 255 |
| 32 | put b 1 uchar shr add n 1 8 |
| 33 | ret n |
| 34 | end |
| 35 | for j ulong n |
| 36 | p = add 4 mul j 25972 |
| 37 | if gmatch b id p |
| 38 | ret j |
| 39 | end |
| 40 | end |
| 41 | ret 256 |
| 42 | end |