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 / seed / kflow / sm80 / resadd.s2
| 1 | ; resadd.s2 -- Qwen3 decode residual add x[i] += a[i] (f32, 2048 values, one CTA of 256 threads, 8 per |
| 2 | ; thread) for sm_80, written by hand for asm2 with seed/sm80/sm80.tbl. Ported from CUDA++'s sm_121 RES ADD |
| 3 | ; (omega_blackwell_codegen_dec.h, RES words; the asm2 listing dec_k2_mo1_s256_m0.s2) with the dead loads |
| 4 | ; of w/nw/y/eps/scale dropped. Parameters keep CUDA++'s constant bank 0: x 0x380, a 0x388, w 0x390, |
| 5 | ; nw 0x398, y 0x3a0, eps 0x3a8, scale 0x3ac. ULDC is not needed: loads and stores use [R.64] with URZ. |
| 6 | ; Each ";=" line is the instruction text expected from nvdisasm -b SM80 for the next instruction |
| 7 | ; (kflow's intent check). Control words (c stall yield write-sb read-sb wait-mask reuse) are MODELED: |
| 8 | ; scoreboards 0/1 (LDC), 2 (S2R), 3 and 5 (loads, x then a), 4 (load address reads), 0 (store reads). |
| 9 | ; The first prediction of the memory texts said LDG.E.128/STG.E [R.64]; nvdisasm 13.0 prints order 7 as |
| 10 | ; .STRONG.GPU and the URZ address term, the same as NAK's vecadd. The intent lines were corrected to that. |
| 11 | ; Not run on any sm_80 GPU (NOT_RUN); the host emulator kemu is the only behaviour check. |
| 12 | ;= LDC.64 R2, c[0x0][0x380] |
| 13 | ldc.0 7 2 255 |
| 14 | cb.1 0x380 0 |
| 15 | ldc.2 5 0 |
| 16 | c 1 1 0 7 0 0 |
| 17 | ;= LDC.64 R4, c[0x0][0x388] |
| 18 | ldc.0 7 4 255 |
| 19 | cb.1 0x388 0 |
| 20 | ldc.2 5 0 |
| 21 | c 1 1 1 7 0 0 |
| 22 | ;= S2R R6, SR_TID.X |
| 23 | s2r.0 7 6 |
| 24 | z.1 |
| 25 | s2r.2 0x21 |
| 26 | c 1 1 2 7 0 0 |
| 27 | ;= MOV R7, 0x1 |
| 28 | mov.i.0 7 7 |
| 29 | n.1 1 |
| 30 | mov.2 15 |
| 31 | c 1 1 7 7 0 0 |
| 32 | ;= IMAD.SHL.U32 R8, R6, 0x20, RZ |
| 33 | imad.i.0 7 8 6 |
| 34 | n.1 32 |
| 35 | imad.2 255 0 |
| 36 | c 4 1 7 7 4 0 |
| 37 | ;= IMAD.WIDE.U32 R10, R8, 0x1, R2 |
| 38 | imadw.i.0 7 10 8 |
| 39 | n.1 1 |
| 40 | imad.2 2 0 |
| 41 | c 4 1 7 7 1 0 |
| 42 | ;= LDG.E.128.STRONG.GPU R12, [R10.64+URZ] |
| 43 | ldg.0 7 12 10 |
| 44 | ldg.1 63 0 |
| 45 | ldg.2 0 1 6 7 1 1 |
| 46 | c 1 1 3 4 0 0 |
| 47 | ;= LDG.E.128.STRONG.GPU R16, [R10.64+URZ+0x10] |
| 48 | ldg.0 7 16 10 |
| 49 | ldg.1 63 16 |
| 50 | ldg.2 0 1 6 7 1 1 |
| 51 | c 1 1 3 4 0 0 |
| 52 | ;= IMAD.WIDE.U32 R10, R8, 0x1, R4 |
| 53 | imadw.i.0 7 10 8 |
| 54 | n.1 1 |
| 55 | imad.2 4 0 |
| 56 | c 4 1 7 7 18 0 |
| 57 | ;= LDG.E.128.STRONG.GPU R20, [R10.64+URZ] |
| 58 | ldg.0 7 20 10 |
| 59 | ldg.1 63 0 |
| 60 | ldg.2 0 1 6 7 1 1 |
| 61 | c 1 1 5 7 0 0 |
| 62 | ;= LDG.E.128.STRONG.GPU R24, [R10.64+URZ+0x10] |
| 63 | ldg.0 7 24 10 |
| 64 | ldg.1 63 16 |
| 65 | ldg.2 0 1 6 7 1 1 |
| 66 | c 1 1 5 7 0 0 |
| 67 | ;= FADD R12, R12, R20 |
| 68 | fadd.0 7 12 12 |
| 69 | r.1 20 |
| 70 | fadd.2 0 0 0 |
| 71 | c 4 1 7 7 40 0 |
| 72 | ;= FADD R13, R13, R21 |
| 73 | fadd.0 7 13 13 |
| 74 | r.1 21 |
| 75 | fadd.2 0 0 0 |
| 76 | c 4 1 7 7 0 0 |
| 77 | ;= FADD R14, R14, R22 |
| 78 | fadd.0 7 14 14 |
| 79 | r.1 22 |
| 80 | fadd.2 0 0 0 |
| 81 | c 4 1 7 7 0 0 |
| 82 | ;= FADD R15, R15, R23 |
| 83 | fadd.0 7 15 15 |
| 84 | r.1 23 |
| 85 | fadd.2 0 0 0 |
| 86 | c 4 1 7 7 0 0 |
| 87 | ;= FADD R16, R16, R24 |
| 88 | fadd.0 7 16 16 |
| 89 | r.1 24 |
| 90 | fadd.2 0 0 0 |
| 91 | c 4 1 7 7 0 0 |
| 92 | ;= FADD R17, R17, R25 |
| 93 | fadd.0 7 17 17 |
| 94 | r.1 25 |
| 95 | fadd.2 0 0 0 |
| 96 | c 4 1 7 7 0 0 |
| 97 | ;= FADD R18, R18, R26 |
| 98 | fadd.0 7 18 18 |
| 99 | r.1 26 |
| 100 | fadd.2 0 0 0 |
| 101 | c 4 1 7 7 0 0 |
| 102 | ;= FADD R19, R19, R27 |
| 103 | fadd.0 7 19 19 |
| 104 | r.1 27 |
| 105 | fadd.2 0 0 0 |
| 106 | c 4 1 7 7 0 0 |
| 107 | ;= IMAD.WIDE.U32 R4, R8, 0x1, R2 |
| 108 | imadw.i.0 7 4 8 |
| 109 | n.1 1 |
| 110 | imad.2 2 0 |
| 111 | c 4 1 7 7 0 0 |
| 112 | ;= STG.E.STRONG.GPU [R4.64+URZ], R12 |
| 113 | stg.0 7 4 |
| 114 | stg.1 12 0 |
| 115 | stg.2 63 1 4 7 1 1 |
| 116 | c 2 1 7 0 0 0 |
| 117 | ;= IMAD.WIDE.U32 R4, R7, 0x4, R4 |
| 118 | imadw.i.0 7 4 7 |
| 119 | n.1 4 |
| 120 | imad.2 4 0 |
| 121 | c 4 1 7 7 1 0 |
| 122 | ;= STG.E.STRONG.GPU [R4.64+URZ], R13 |
| 123 | stg.0 7 4 |
| 124 | stg.1 13 0 |
| 125 | stg.2 63 1 4 7 1 1 |
| 126 | c 2 1 7 0 0 0 |
| 127 | ;= IMAD.WIDE.U32 R4, R7, 0x4, R4 |
| 128 | imadw.i.0 7 4 7 |
| 129 | n.1 4 |
| 130 | imad.2 4 0 |
| 131 | c 4 1 7 7 1 0 |
| 132 | ;= STG.E.STRONG.GPU [R4.64+URZ], R14 |
| 133 | stg.0 7 4 |
| 134 | stg.1 14 0 |
| 135 | stg.2 63 1 4 7 1 1 |
| 136 | c 2 1 7 0 0 0 |
| 137 | ;= IMAD.WIDE.U32 R4, R7, 0x4, R4 |
| 138 | imadw.i.0 7 4 7 |
| 139 | n.1 4 |
| 140 | imad.2 4 0 |
| 141 | c 4 1 7 7 1 0 |
| 142 | ;= STG.E.STRONG.GPU [R4.64+URZ], R15 |
| 143 | stg.0 7 4 |
| 144 | stg.1 15 0 |
| 145 | stg.2 63 1 4 7 1 1 |
| 146 | c 2 1 7 0 0 0 |
| 147 | ;= IMAD.WIDE.U32 R4, R7, 0x4, R4 |
| 148 | imadw.i.0 7 4 7 |
| 149 | n.1 4 |
| 150 | imad.2 4 0 |
| 151 | c 4 1 7 7 1 0 |
| 152 | ;= STG.E.STRONG.GPU [R4.64+URZ], R16 |
| 153 | stg.0 7 4 |
| 154 | stg.1 16 0 |
| 155 | stg.2 63 1 4 7 1 1 |
| 156 | c 2 1 7 0 0 0 |
| 157 | ;= IMAD.WIDE.U32 R4, R7, 0x4, R4 |
| 158 | imadw.i.0 7 4 7 |
| 159 | n.1 4 |
| 160 | imad.2 4 0 |
| 161 | c 4 1 7 7 1 0 |
| 162 | ;= STG.E.STRONG.GPU [R4.64+URZ], R17 |
| 163 | stg.0 7 4 |
| 164 | stg.1 17 0 |
| 165 | stg.2 63 1 4 7 1 1 |
| 166 | c 2 1 7 0 0 0 |
| 167 | ;= IMAD.WIDE.U32 R4, R7, 0x4, R4 |
| 168 | imadw.i.0 7 4 7 |
| 169 | n.1 4 |
| 170 | imad.2 4 0 |
| 171 | c 4 1 7 7 1 0 |
| 172 | ;= STG.E.STRONG.GPU [R4.64+URZ], R18 |
| 173 | stg.0 7 4 |
| 174 | stg.1 18 0 |
| 175 | stg.2 63 1 4 7 1 1 |
| 176 | c 2 1 7 0 0 0 |
| 177 | ;= IMAD.WIDE.U32 R4, R7, 0x4, R4 |
| 178 | imadw.i.0 7 4 7 |
| 179 | n.1 4 |
| 180 | imad.2 4 0 |
| 181 | c 4 1 7 7 1 0 |
| 182 | ;= STG.E.STRONG.GPU [R4.64+URZ], R19 |
| 183 | stg.0 7 4 |
| 184 | stg.1 19 0 |
| 185 | stg.2 63 1 4 7 1 1 |
| 186 | c 2 1 7 0 0 0 |
| 187 | ;= EXIT |
| 188 | exit.0 7 |
| 189 | z.1 |
| 190 | exit.2 |
| 191 | c 5 1 7 7 1 0 |
| 192 | ;= BRA 0x240 |
| 193 | bra.0 7 |
| 194 | bra.1 0x0fffffff |
| 195 | bra.2 -1 7 |
| 196 | c 0 0 7 7 0 0 |