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 / sm80 / vecadd.s2
| 1 | ; vecadd.s2 -- c[i] = a[i] + b[i] for sm_80, written by hand for asm2 with seed/sm80/sm80.tbl. |
| 2 | ; The same kernel and schedule as seed/sm121/vecadd.s2 (chip-run on the GB10), moved to sm_80 forms: |
| 3 | ; ULDC replaces LDCU (no 64-bit uniform descriptor load), and global loads/stores take [R.64] with URZ, |
| 4 | ; so the first load no longer waits on the descriptor's scoreboard. Two control words are NAK's |
| 5 | ; (calc_instr_deps with SM80Latency, `nakref sched 80`) because NAK's are stricter there: STG holds its |
| 6 | ; registers on read scoreboard 0 with stall 2, and the last EXIT waits on it. Every other stall is at |
| 7 | ; least NAK's. Constant bank 0 keeps CUDA++'s layout: |
| 8 | ; 0x37c stack, 0x360 block size, 0x380/0x388/0x390 a/b/c, 0x398 n. Each instruction is four lines. |
| 9 | ; Control line: c stall yield write-sb read-sb wait-mask reuse. Not run on any sm_80 GPU (NOT_RUN). |
| 10 | ldc.0 7 1 255 ; LDC R1, c[0x0][0x37c] |
| 11 | cb.1 0x37c 0 |
| 12 | ldc.2 4 0 |
| 13 | c 1 1 7 7 0 0 |
| 14 | s2r.0 7 9 ; S2R R9, SR_CTAID.X |
| 15 | z.1 |
| 16 | s2r.2 0x25 |
| 17 | c 1 1 0 7 0 0 |
| 18 | uldc.0 7 4 ; ULDC UR4, c[0x0][0x360] |
| 19 | cb.1 0x360 0 |
| 20 | uldc.2 4 |
| 21 | c 1 1 0 7 0 0 |
| 22 | s2r.0 7 0 ; S2R R0, SR_TID.X |
| 23 | z.1 |
| 24 | s2r.2 0x21 |
| 25 | c 1 1 0 7 0 0 |
| 26 | uldc.0 7 5 ; ULDC UR5, c[0x0][0x398] |
| 27 | cb.1 0x398 0 |
| 28 | uldc.2 4 |
| 29 | c 1 1 1 7 0 0 |
| 30 | imad.u.0 7 9 9 ; IMAD R9, R9, UR4, R0 |
| 31 | u.1 4 |
| 32 | imad.u.2 0 0 |
| 33 | c 5 0 7 7 1 0 |
| 34 | isetp.u.0 7 9 ; ISETP.GE.U32.AND P0, PT, R9, UR5, PT |
| 35 | u.1 5 |
| 36 | isetp.u.2 7 0 0 0 6 0 7 |
| 37 | c 13 0 7 7 2 0 |
| 38 | exit.0 0 ; @P0 EXIT |
| 39 | z.1 |
| 40 | exit.2 |
| 41 | c 5 1 7 7 0 0 |
| 42 | ldc.0 7 2 255 ; LDC.64 R2, c[0x0][0x380] |
| 43 | cb.1 0x380 0 |
| 44 | ldc.2 5 0 |
| 45 | c 1 1 0 7 0 0 |
| 46 | ldc.0 7 4 255 ; LDC.64 R4, c[0x0][0x388] |
| 47 | cb.1 0x388 0 |
| 48 | ldc.2 5 0 |
| 49 | c 8 1 2 7 0 0 |
| 50 | ldc.0 7 6 255 ; LDC.64 R6, c[0x0][0x390] |
| 51 | cb.1 0x390 0 |
| 52 | ldc.2 5 0 |
| 53 | c 1 1 3 7 0 0 |
| 54 | imadw.i.0 7 2 9 ; IMAD.WIDE.U32 R2, R9, 0x4, R2 |
| 55 | n.1 4 |
| 56 | imad.2 2 0 |
| 57 | c 6 0 7 7 1 0 |
| 58 | ldg.0 7 2 2 ; LDG.E R2, [R2.64] |
| 59 | ldg.1 63 0 |
| 60 | ldg.2 0 1 4 7 1 1 |
| 61 | c 1 1 4 7 0 0 |
| 62 | imadw.i.0 7 4 9 ; IMAD.WIDE.U32 R4, R9, 0x4, R4 |
| 63 | n.1 4 |
| 64 | imad.2 4 0 |
| 65 | c 6 0 7 7 4 0 |
| 66 | ldg.0 7 5 4 ; LDG.E R5, [R4.64] |
| 67 | ldg.1 63 0 |
| 68 | ldg.2 0 1 4 7 1 1 |
| 69 | c 1 1 4 7 0 0 |
| 70 | imadw.i.0 7 6 9 ; IMAD.WIDE.U32 R6, R9, 0x4, R6 |
| 71 | n.1 4 |
| 72 | imad.2 6 0 |
| 73 | c 1 1 7 7 8 0 |
| 74 | iadd3.0 7 9 2 ; IADD3 R9, R2, R5, RZ |
| 75 | r.1 5 |
| 76 | iadd3.2 255 7 7 |
| 77 | c 5 0 7 7 16 0 |
| 78 | stg.0 7 6 ; STG.E [R6.64], R9 |
| 79 | stg.1 9 0 |
| 80 | stg.2 63 1 4 7 1 1 |
| 81 | c 2 1 7 0 0 0 |
| 82 | exit.0 7 ; EXIT |
| 83 | z.1 |
| 84 | exit.2 |
| 85 | c 5 1 7 7 1 0 |
| 86 | bra.0 7 ; BRA to itself: distance -1 instruction |
| 87 | bra.1 0x0fffffff |
| 88 | bra.2 -1 7 |
| 89 | c 0 0 7 7 0 0 |