interplane.Get Omega
Read in your language

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

branch main Branches Tags History

omega-mv / seed / sm80 / vecadd.s2

89 lines · 2499 bytes Raw Blame History
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).
10ldc.0 7 1 255 ; LDC R1, c[0x0][0x37c]
11cb.1 0x37c 0
12ldc.2 4 0
13c 1 1 7 7 0 0
14s2r.0 7 9 ; S2R R9, SR_CTAID.X
15z.1
16s2r.2 0x25
17c 1 1 0 7 0 0
18uldc.0 7 4 ; ULDC UR4, c[0x0][0x360]
19cb.1 0x360 0
20uldc.2 4
21c 1 1 0 7 0 0
22s2r.0 7 0 ; S2R R0, SR_TID.X
23z.1
24s2r.2 0x21
25c 1 1 0 7 0 0
26uldc.0 7 5 ; ULDC UR5, c[0x0][0x398]
27cb.1 0x398 0
28uldc.2 4
29c 1 1 1 7 0 0
30imad.u.0 7 9 9 ; IMAD R9, R9, UR4, R0
31u.1 4
32imad.u.2 0 0
33c 5 0 7 7 1 0
34isetp.u.0 7 9 ; ISETP.GE.U32.AND P0, PT, R9, UR5, PT
35u.1 5
36isetp.u.2 7 0 0 0 6 0 7
37c 13 0 7 7 2 0
38exit.0 0 ; @P0 EXIT
39z.1
40exit.2
41c 5 1 7 7 0 0
42ldc.0 7 2 255 ; LDC.64 R2, c[0x0][0x380]
43cb.1 0x380 0
44ldc.2 5 0
45c 1 1 0 7 0 0
46ldc.0 7 4 255 ; LDC.64 R4, c[0x0][0x388]
47cb.1 0x388 0
48ldc.2 5 0
49c 8 1 2 7 0 0
50ldc.0 7 6 255 ; LDC.64 R6, c[0x0][0x390]
51cb.1 0x390 0
52ldc.2 5 0
53c 1 1 3 7 0 0
54imadw.i.0 7 2 9 ; IMAD.WIDE.U32 R2, R9, 0x4, R2
55n.1 4
56imad.2 2 0
57c 6 0 7 7 1 0
58ldg.0 7 2 2 ; LDG.E R2, [R2.64]
59ldg.1 63 0
60ldg.2 0 1 4 7 1 1
61c 1 1 4 7 0 0
62imadw.i.0 7 4 9 ; IMAD.WIDE.U32 R4, R9, 0x4, R4
63n.1 4
64imad.2 4 0
65c 6 0 7 7 4 0
66ldg.0 7 5 4 ; LDG.E R5, [R4.64]
67ldg.1 63 0
68ldg.2 0 1 4 7 1 1
69c 1 1 4 7 0 0
70imadw.i.0 7 6 9 ; IMAD.WIDE.U32 R6, R9, 0x4, R6
71n.1 4
72imad.2 6 0
73c 1 1 7 7 8 0
74iadd3.0 7 9 2 ; IADD3 R9, R2, R5, RZ
75r.1 5
76iadd3.2 255 7 7
77c 5 0 7 7 16 0
78stg.0 7 6 ; STG.E [R6.64], R9
79stg.1 9 0
80stg.2 63 1 4 7 1 1
81c 2 1 7 0 0 0
82exit.0 7 ; EXIT
83z.1
84exit.2
85c 5 1 7 7 1 0
86bra.0 7 ; BRA to itself: distance -1 instruction
87bra.1 0x0fffffff
88bra.2 -1 7
89c 0 0 7 7 0 0