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 / components / compose.om
| 1 | note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 2 | note cfg16:family1direct/2rowpipe/3staged,K,LB,rows-or-MT,warps,component,mutant0,reserved0. |
| 3 | note Native component concatenation shares one instruction array and one allocation namespace. |
| 4 | note No component performs physical allocation. One effect stream covers all boundaries. |
| 5 | note out8:count,peakGPR,peakUGPR,shared,virtualGPR,virtualUGPR,reserved0,reserved0. |
| 6 | fn bc_compose cfg view ulong 16 ins edit ulong 8192 m edit ulong 2048 phys edit ulong 288 out edit ulong 8 to uint |
| 7 | spec = new ulong 16 0 |
| 8 | small = new ulong 8 0 |
| 9 | st = new ulong 4 0 |
| 10 | rs = new ulong 4 0 |
| 11 | for k ulong 8 |
| 12 | put out k 0 |
| 13 | end |
| 14 | for k ulong 10 |
| 15 | if ne get cfg add k 6 0 |
| 16 | ret 1 |
| 17 | end |
| 18 | end |
| 19 | family = get cfg 0 |
| 20 | if or lt family 1 gt family 3 |
| 21 | ret 1 |
| 22 | end |
| 23 | for k ulong 5 |
| 24 | put spec k get cfg add k 1 |
| 25 | put small k get cfg add k 1 |
| 26 | end |
| 27 | rc = uint 1 |
| 28 | if eq family 1 |
| 29 | rc = bc_project small ins m st |
| 30 | end |
| 31 | if eq family 2 |
| 32 | if ne get cfg 5 0 |
| 33 | ret 1 |
| 34 | end |
| 35 | rc = bc_rowpipe small ins m st |
| 36 | end |
| 37 | if eq family 3 |
| 38 | rc = bc_staged spec ins m st |
| 39 | end |
| 40 | if ne rc 0 |
| 41 | ret rc |
| 42 | end |
| 43 | rc = bc_ircheck ins get st 0 m |
| 44 | if ne rc 0 |
| 45 | ret add rc 8 |
| 46 | end |
| 47 | rc = bc_regalloc ins get st 0 m phys rs 128 |
| 48 | if ne rc 0 |
| 49 | ret add rc 16 |
| 50 | end |
| 51 | put out 0 get st 0 |
| 52 | put out 1 get rs 1 |
| 53 | put out 2 get rs 2 |
| 54 | put out 3 get st 3 |
| 55 | put out 4 get st 1 |
| 56 | put out 5 get st 2 |
| 57 | ret 0 |
| 58 | end |