interplane.Get Omega
Read in your language

CUDApp

CUDA++: AIEN’s GPU machine-code toolchain, runtime and driver client for NVIDIA GPUs without the CUDA toolkit. Hardware coverage and driver replacement limits are explicit.

Brought by drakestapleton

branch main Branches Tags History

CUDApp / om / disasm / sm121_dis.om

1376 lines · 25888 bytes Raw Blame History
1note sm121_dis.om: Omega's own sm_121 (GB10) disassembler, row C6 of docs/OMEGA.md (CUDA++ C6, DRA-475).
2note It turns one 128-bit instruction word into the text nvdisasm 13.0.85 prints for it. It replaces the decoder
3note of src/omega_sm121_disasm.c, which stays compiled only behind CUDAPP_MIGRATION_PENDING_C_DISASM (and the
4note DIFF build) as the differential oracle. nvdisasm is an offline oracle only (tools/sm121dis/check.sh).
5note
6note Layout of a word (lo = bits 0..63, hi = bits 64..127): opcode bits 0..11; guard predicate bits 12..14 with
7note its negation at 15 (7 and no negation = no guard); registers at 16, 24, 32 and hi 0; modifiers in hi 8..40;
8note control from hi 41 on (stall, barriers, yield, reuse), which is not part of the text.
9note
10note A row is one instruction form: its fixed bits (lov, hiv) and a format, the exact C format string packed
11note eight ASCII bytes per ulong, little-endian. Each %x code names the bits it reads (fn fld). Every other
12note bit of lo and of hi 0..40 (outside the guard) must equal the row's fixed value, or the row does not match.
13note Rows are tried in the C table's order; only the rows of the word's opcode are built (fn rows), which is
14note the same order restricted to the rows that can match. The row table (fns rowsa, rowsb, rowsc) was
15note generated by Wolfram from the C ROWS table (evidence/C6-DISASM-OM/wolfram-rows.txt).
16note The rows of the #280 integration (ATOMG.E.MIN.64 and the conversions and binary64 forms of BlackwellIR ops
17note 64..79) were added on 2026-11-10; their constants are Wolfram's (evidence/INTEG-280-20261110/wolfram-rows.txt).
18note A word that matches no form prints ?? 0x<hi><lo> (16 hex digits each) and is reported, never guessed.
19note The C file's float immediate form (%f) is used by no row; here %f refuses (overflow flag) instead.
20note
21note Call: sm121_dis lo hi pc out. pc is the byte address of the word. out receives the text, no trailing
22note semicolon. Result: bits 0..15 the text length, bit 16 set when no form matched, bit 17 set when the word
23note is an EXIT (opcode 0x94d, any guard), bit 18 set when the text did not fit 255 bytes.
24note State s: 0 lo, 1 hi, 2 pc, 3 write position, 4 refused (overflow or an unknown code), 5 a field value the
25note oracle names but this decoder does not (the word is then reported as ??).
26
27const HIM ulong 2199023255551
28const P31 ulong 2147483648
29const P55 ulong 36028797018963968
30const SX56 ulong 18374686479671623680
31const SX32 ulong 18446744069414584320
32
33note bits at .. at+n-1 of v (n below 64)
34fn bits v ulong at ulong n ulong to ulong
35ret and shr v at sub shl ulong 1 n 1
36end
37
38note append one byte; past 255 bytes mark the text refused
39fn pc1 o edit uchar 256 s edit ulong 8 c ulong to void
40a = get s 3
41if lt a 255
42put o a uchar c
43put s 3 add a 1
44else
45put s 4 1
46end
47end
48
49note append up to eight bytes packed little-endian in v, stopping at the first zero byte
50fn lit o edit uchar 256 s edit ulong 8 v ulong to void
51x = v
52for k ulong 8
53if eq x 0
54break
55end
56pc1 o s and x 255
57x = shr x 8
58end
59end
60
61note unsigned decimal
62fn dec o edit uchar 256 s edit ulong 8 v ulong to void
63d = new ulong 20 0
64x = v
65n = ulong 0
66for k ulong 20
67put d n rem x 10
68n = add n 1
69x = div x 10
70if eq x 0
71break
72end
73end
74for k ulong 20
75if eq n 0
76break
77end
78n = sub n 1
79pc1 o s add 48 get d n
80end
81end
82
83fn hexd d ulong to ulong
84if lt d 10
85ret add d 48
86end
87ret add d 87
88end
89
90note lowercase hex without leading zeros, no prefix
91fn hexn o edit uchar 256 s edit ulong 8 v ulong to void
92n = ulong 1
93for k ulong 15
94if eq shr v mul n 4 0
95break
96end
97n = add n 1
98end
99for k ulong 16
100if eq n 0
101break
102end
103n = sub n 1
104pc1 o s hexd and shr v mul n 4 15
105end
106end
107
108note 0x and lowercase hex (printf 0x%x)
109fn hexu o edit uchar 256 s edit ulong 8 v ulong to void
110lit o s 30768
111hexn o s v
112end
113
114note exactly 16 hex digits (printf %016llx)
115fn hex16 o edit uchar 256 s edit ulong 8 v ulong to void
116n = ulong 16
117for k ulong 16
118n = sub n 1
119pc1 o s hexd and shr v mul n 4 15
120end
121end
122
123note v read as an n-bit two's complement number: -0x... or 0x...
124fn hexs o edit uchar 256 s edit ulong 8 v ulong n ulong to void
125if ge v shl ulong 1 sub n 1
126pc1 o s 45
127hexu o s sub shl ulong 1 n v
128ret
129end
130hexu o s v
131end
132
133note a predicate: ! when negated, PT for 7, else P and the number
134fn prd o edit uchar 256 s edit ulong 8 p ulong ng ulong to void
135if ne ng 0
136pc1 o s 33
137end
138if eq p 7
139lit o s 21584
140ret
141end
142pc1 o s 80
143dec o s p
144end
145
146note a register with prefix pf (R or UR): Z for 255, else the number
147fn reg o edit uchar 256 s edit ulong 8 pf ulong v ulong to void
148lit o s pf
149if eq v 255
150pc1 o s 90
151ret
152end
153dec o s v
154end
155
156note the special registers nvdisasm 13.0.85 prints by name (107 of 256, an S2R sweep; Wolfram bitmap): one the
157note table above does not name is reported (s 5 set, the word prints ??), never printed as SR and its number
158fn srnamed v ulong to bool
159w = ulong 0
160q = div v 64
161if eq q 0
162w = 9223363172042244111
163end
164if eq q 1
165w = 18446744069418713119
166end
167if eq q 2
168w = 61247
169end
170if eq q 3
171w = 9223372036854775808
172end
173ret ne and shr w rem v 64 1 0
174end
175
176note special register names nvdisasm prints, else SR and the number
177fn srn o edit uchar 256 s edit ulong 8 v ulong to void
178if eq v 33
179lit o s 6354091206005183059
180ret
181end
182if eq v 34
183lit o s 6426148800043110995
184ret
185end
186if eq v 35
187lit o s 6498206394081038931
188ret
189end
190if eq v 37
191lit o s 4920535898042356307
192lit o s 22574
193ret
194end
195if eq v 38
196lit o s 4920535898042356307
197lit o s 22830
198ret
199end
200if eq v 39
201lit o s 4920535898042356307
202lit o s 23086
203ret
204end
205if eq v 0
206lit o s 5279712180522930771
207lit o s 68
208ret
209end
210if eq v 80
211lit o s 5423265565250638419
212lit o s 20300
213ret
214end
215if eq v 81
216lit o s 5423265565250638419
217lit o s 18760
218ret
219end
220note the device-side trace emitter's timer pair, SR_GLOBALTIMERLO and SR_GLOBALTIMERHI
221if eq v 82
222lit o s 4702408149961757267
223lit o s 5714032484829189196
224ret
225end
226if eq v 83
227lit o s 4702408149961757267
228lit o s 5280561020694778956
229ret
230end
231if srnamed v
232put s 5 1
233ret
234end
235lit o s 21075
236dec o s v
237end
238
239note float compare names 0..15: F LT EQ LE GT NE GE NUM NAN LTU EQU LEU GTU NEU GEU T
240fn fcmp v ulong to ulong
241if eq v 0
242ret 70
243end
244if eq v 1
245ret 21580
246end
247if eq v 2
248ret 20805
249end
250if eq v 3
251ret 17740
252end
253if eq v 4
254ret 21575
255end
256if eq v 5
257ret 17742
258end
259if eq v 6
260ret 17735
261end
262if eq v 7
263ret 5068110
264end
265if eq v 8
266ret 5128526
267end
268if eq v 9
269ret 5592140
270end
271if eq v 10
272ret 5591365
273end
274if eq v 11
275ret 5588300
276end
277if eq v 12
278ret 5592135
279end
280if eq v 13
281ret 5588302
282end
283if eq v 14
284ret 5588295
285end
286ret 84
287end
288
289note integer compare names 0..7: F LT EQ LE GT NE GE T (the float names, T for 7)
290fn icmp v ulong to ulong
291if eq v 7
292ret 84
293end
294ret fcmp v
295end
296
297note memory access sizes 0..7: .U8 .S8 .U16 .S16 (none) .64 .128 .U.128
298fn msz v ulong to ulong
299if eq v 0
300ret 3691822
301end
302if eq v 1
303ret 3691310
304end
305if eq v 2
306ret 909202734
307end
308if eq v 3
309ret 909202222
310end
311if eq v 4
312ret 0
313end
314if eq v 5
315ret 3421742
316end
317if eq v 6
318ret 942813486
319end
320ret 61788224640302
321end
322
323fn pk h ulong at ulong n ulong to ulong
324ret add add mul h 65536 mul at 256 n
325end
326
327note operand code c: hi word flag, first bit and width packed by pk; 0 for a code without a field
328fn fld c ulong to ulong
329note d a b c (R registers) and D A B C (uniform registers)
330if or eq c 100 eq c 68
331ret pk 0 16 8
332end
333if or eq c 97 eq c 65
334ret pk 0 24 8
335end
336if or eq c 98 eq c 66
337ret pk 0 32 8
338end
339if or eq c 99 eq c 67
340ret pk 1 0 8
341end
342note i s f j Y: a 32-bit immediate (unsigned, signed, float, ISETP signed, BSSY distance)
343if or or eq c 105 eq c 115 eq c 102
344ret pk 0 32 32
345end
346if or eq c 106 eq c 89
347ret pk 0 32 32
348end
349note K c[bank][offset] offset 38..53 bank 54..58; U the uniform load, offset 37..53
350if eq c 75
351ret pk 0 38 21
352end
353if eq c 85
354ret pk 0 37 22
355end
356note o signed 24-bit address offset; y convergence barrier
357if eq c 111
358ret pk 0 40 24
359end
360if eq c 121
361ret pk 0 16 4
362end
363note P Q R predicates, R with its negation at hi 26
364if eq c 80
365ret pk 1 17 3
366end
367if eq c 81
368ret pk 1 20 3
369end
370if eq c 82
371ret pk 1 23 4
372end
373note l LOP3 table and S special register at hi 8; h m SHFL lane distance and clamp
374if or eq c 108 eq c 83
375ret pk 1 8 8
376end
377if eq c 104
378ret pk 0 53 5
379end
380if eq c 109
381ret pk 0 40 13
382end
383note G g integer and float compare; Z ISETP signed flag; z memory size; N M IADD3 negations
384if eq c 71
385ret pk 1 12 3
386end
387if eq c 103
388ret pk 1 12 4
389end
390if eq c 90
391ret pk 1 9 1
392end
393if eq c 122
394ret pk 1 9 3
395end
396if eq c 78
397ret pk 1 8 1
398end
399if eq c 77
400ret pk 0 63 1
401end
402ret 0
403end
404
405note the bits field f reads, in lo (h 0) or hi (h 1)
406fn fmsk f ulong h ulong to ulong
407if eq f 0
408ret 0
409end
410if ne shr f 16 h
411ret 0
412end
413ret shl sub shl ulong 1 and f 255 1 and shr f 8 255
414end
415
416note the BRA distance: 4-byte units, low 8 bits at 16..23, the rest at 34..63 and hi 0..17
417fn tmsk h ulong to ulong
418if eq h 0
419ret or shl ulong 255 16 shl sub shl ulong 1 30 1 34
420end
421ret sub shl ulong 1 18 1
422end
423
424note the value field f reads from the word in s
425fn fval s view ulong 8 f ulong to ulong
426v = get s 0
427if ne shr f 16 0
428v = get s 1
429end
430ret bits v and shr f 8 255 and f 255
431end
432
433note byte i of row r's format
434fn fb t view ulong 80 r ulong i ulong to ulong
435w = get t add add mul r 10 2 div i 8
436ret and shr w mul rem i 8 8 255
437end
438
439note the bits row r's format reads, in lo (h 0) or hi (h 1)
440fn rmask t view ulong 80 r ulong h ulong to ulong
441m = ulong 0
442i = ulong 0
443for k ulong 64
444if ge i 63
445break
446end
447c = fb t r i
448if eq c 0
449break
450end
451if eq c 37
452i = add i 1
453d = fb t r i
454if eq d 84
455m = or m tmsk h
456else
457m = or m fmsk fld d h
458end
459end
460i = add i 1
461end
462ret m
463end
464
465note row r matches when every bit outside its fields and the guard equals the row's
466fn hit t view ulong 80 r ulong lb ulong hb ulong to bool
467b = mul r 10
468lm = not or rmask t r 0 61440
469hm = and HIM not rmask t r 1
470if ne and lb lm and get t b lm
471ret false
472end
473ret eq and hb hm and get t add b 1 hm
474end
475
476note print the signed 56-bit BRA target and the BSSY target as unsigned byte addresses
477fn btgt s view ulong 8 to ulong
478lo = get s 0
479u = or or bits lo 16 8 shl bits lo 34 30 8 shl bits get s 1 0 18 38
480if ge u P55
481u = or u SX56
482end
483ret add add get s 2 16 mul u 4
484end
485
486fn ytgt s view ulong 8 to ulong
487v = bits get s 0 32 32
488if ge v P31
489v = or v SX32
490end
491ret add add get s 2 16 v
492end
493
494note one operand
495fn opd o edit uchar 256 s edit ulong 8 c ulong to void
496v = fval s fld c
497if or or or eq c 100 eq c 97 eq c 98 eq c 99
498reg o s 82 v
499ret
500end
501if or or or eq c 68 eq c 65 eq c 66 eq c 67
502reg o s 21077 v
503ret
504end
505if or or or eq c 105 eq c 108 eq c 104 eq c 109
506hexu o s v
507ret
508end
509if or eq c 115 eq c 106
510hexs o s v 32
511ret
512end
513if eq c 75
514lit o s 2016435043
515hexn o s bits get s 0 54 5
516lit o s 2016435037
517hexn o s bits get s 0 38 16
518pc1 o s 93
519ret
520end
521if eq c 85
522lit o s 2016435043
523hexn o s bits get s 0 54 5
524lit o s 2016435037
525hexn o s bits get s 0 37 17
526pc1 o s 93
527ret
528end
529if eq c 111
530if ne v 0
531pc1 o s 43
532hexs o s v 24
533end
534ret
535end
536if eq c 89
537hexu o s ytgt s
538ret
539end
540if eq c 121
541pc1 o s 66
542dec o s v
543ret
544end
545if or eq c 80 eq c 81
546prd o s v 0
547ret
548end
549if eq c 82
550prd o s and v 7 and shr v 3 1
551ret
552end
553if eq c 83
554srn o s v
555ret
556end
557if eq c 71
558lit o s icmp v
559ret
560end
561if eq c 103
562lit o s fcmp v
563ret
564end
565if eq c 90
566if eq v 0
567lit o s 842224942
568end
569ret
570end
571if eq c 122
572lit o s msz v
573ret
574end
575if or eq c 78 eq c 77
576if ne v 0
577pc1 o s 45
578end
579ret
580end
581if eq c 84
582hexu o s btgt s
583ret
584end
585put s 4 1
586end
587
588note write row r's text
589fn rend o edit uchar 256 s edit ulong 8 t view ulong 80 r ulong to void
590i = ulong 0
591for k ulong 64
592if ge i 64
593break
594end
595c = fb t r i
596if eq c 0
597break
598end
599if eq c 37
600i = add i 1
601if ge i 64
602put s 4 1
603ret
604end
605opd o s fb t r i
606else
607pc1 o s c
608end
609i = add i 1
610end
611end
612
613note IMAD with an immediate: nvdisasm names the special cases. CUDA 13.0 -b SM121 on 2^1..2^31 with Rc = RZ
614note (2026-10-27): plain IMAD for 2^16 and 2^31, .SHL for every other power.
615fn imadn imm ulong c ulong to ulong
616if eq imm 0
617ret 1
618end
619if eq imm 1
620if eq c 255
621ret 1
622end
623ret 2
624end
625if ne c 255
626ret 0
627end
628if ne and imm sub imm 1 0
629ret 0
630end
631n = ulong 0
632x = imm
633for k ulong 32
634if ne and x 1 0
635break
636end
637x = shr x 1
638n = add n 1
639end
640if or eq n 16 eq n 31
641ret 0
642end
643ret 3
644end
645
646fn imadi o edit uchar 256 s edit ulong 8 lb ulong hb ulong to bool
647if ne and lb 4095 2084
648ret false
649end
650if ne and hb not ulong 255 126747136
651ret false
652end
653imm = bits lb 32 32
654c = and hb 255
655k = imadn imm c
656if eq k 0
657lit o s 1145130313
658end
659if eq k 1
660lit o s 6219274471530909001
661end
662if eq k 2
663lit o s 4918292731127745865
664lit o s 68
665end
666if eq k 3
667lit o s 5496734803384421705
668end
669pc1 o s 32
670reg o s 82 bits lb 16 8
671lit o s 8236
672reg o s 82 bits lb 24 8
673lit o s 8236
674hexs o s imm 32
675lit o s 8236
676reg o s 82 c
677ret true
678end
679
680fn rowsa op ulong t edit ulong 80 to ulong
681if eq op 2050
682note MOV %d, %i
683put t 0 30722
684put t 1 3840
685put t 2 2318338018808057677
686put t 3 26917
687ret 1
688end
689if eq op 514
690note MOV %d, %b
691put t 0 4278219266
692put t 1 3840
693put t 2 2318338018808057677
694put t 3 25125
695note MOV %d, %b
696put t 10 29186
697put t 11 3840
698put t 12 2318338018808057677
699put t 13 25125
700ret 2
701end
702if eq op 2329
703note S2R %d, %S
704put t 0 31001
705put t 2 2318338018807788115
706put t 3 21285
707ret 1
708end
709if eq op 2946
710note LDC %d, %K
711put t 0 4278221698
712put t 1 2048
713put t 2 2318338018806809676
714put t 3 19237
715note LDC.64 %d, %K
716put t 10 4278221698
717put t 11 2560
718put t 12 2675195585967113292
719put t 13 322745412708
720ret 2
721end
722if eq op 1964
723note LDCU %D, %U
724put t 0 4278220716
725put t 1 134219776
726put t 2 3189715256884806732
727put t 3 5580064
728note LDCU.64 %D, %U
729put t 10 4278220716
730put t 11 134220288
731put t 12 2320539280629515340
732put t 13 93617941922853
733ret 2
734end
735if eq op 548
736note IMAD %d, %a, %b, %c
737put t 0 29220
738put t 1 126747136
739put t 2 3198722455854206281
740put t 3 3198159505500218656
741put t 4 6497568
742ret 1
743end
744if eq op 3108
745note IMAD %d, %a, %B, %c
746put t 0 31780
747put t 1 260964864
748put t 2 3198722455854206281
749put t 3 3189152306245477664
750put t 4 6497568
751ret 1
752end
753if eq op 2085
754note IMAD.WIDE.U32 %d, %a, %s, %c
755put t 0 30757
756put t 1 126746624
757put t 2 4920559924104219977
758put t 3 7216209377912761925
759put t 4 8297073263480479788
760put t 5 1663377452
761ret 1
762end
763if eq op 551
764note IMAD.HI.U32 %d, %a, %b, %c
765put t 0 29223
766put t 1 126746624
767put t 2 3335276362595388745
768put t 3 2318338018805691221
769put t 4 2318335819782054181
770put t 5 25381
771ret 1
772end
773if eq op 528
774note IADD3 %d, PT, PT, %N%a, %M%b, %c
775put t 0 29200
776put t 1 134209536
777put t 2 7216209382491832649
778put t 3 6075391272087986220
779put t 4 2318334721041702956
780put t 5 7144151758890421541
781ret 1
782end
783if eq op 2064
784note IADD3 %d, PT, PT, %N%a, %s, %c
785put t 0 30736
786put t 1 134209536
787put t 2 7216209382491832649
788put t 3 6075391272087986220
789put t 4 2318334721041702956
790put t 5 109011104723749
791ret 1
792end
793if eq op 530
794note LOP3.LUT %d, %a, %b, %c, %l, %R
795put t 0 29202
796put t 1 917504
797put t 2 6076847033519460172
798put t 3 3197878030523704608
799put t 4 3198440980476994848
800put t 5 23121768204739872
801ret 1
802end
803if eq op 2066
804note LOP3.LUT %d, %a, %i, %c, %l, %R
805put t 0 30738
806put t 1 917504
807put t 2 6076847033519460172
808put t 3 3197878030523704608
809put t 4 3198440980477453600
810put t 5 23121768204739872
811ret 1
812end
813if eq op 2073
814note SHF.R.U32.HI %d, %a, %i, %c
815put t 0 30745
816put t 1 71168
817put t 2 3698913599453284435
818put t 3 3198722455938543154
819put t 4 3200129830337193248
820put t 5 6497568
821note SHF.L.U32 %d, %a, %i, %c
822put t 10 30745
823put t 11 1536
824put t 12 3698913573683480659
825put t 13 7000036570848108594
826put t 14 7144151759007850540
827ret 2
828end
829if eq op 537
830note SHF.R.U32.HI %d, %a, %b, %c
831put t 0 29209
832put t 1 71168
833put t 2 3698913599453284435
834put t 3 3198722455938543154
835put t 4 3198159505500218656
836put t 5 6497568
837note SHF.L.U32 %d, %a, %b, %c
838put t 10 29209
839put t 11 1536
840put t 12 3698913573683480659
841put t 13 7000036570848108594
842put t 14 7144151758890410028
843ret 2
844end
845ret 0
846end
847
848fn rowsb op ulong t edit ulong 80 to ulong
849if eq op 524
850note ISETP.%G%Z.AND %P, %Q, %a, %b, %R
851put t 0 29196
852put t 1 112
853put t 2 5126554673377268553
854put t 3 2675213281549769253
855put t 4 2675186905684913232
856put t 5 2675186978699357281
857put t 6 82
858ret 1
859end
860if eq op 2060
861note ISETP.%G%Z.AND %P, %Q, %a, %j, %R
862put t 0 30732
863put t 1 112
864put t 2 5126554673377268553
865put t 3 2675213281549769253
866put t 4 2675186905684913232
867put t 5 2675187013059095649
868put t 6 82
869ret 1
870end
871if eq op 3084
872note ISETP.%G%Z.AND %P, %Q, %a, %B, %R
873put t 0 31756
874put t 1 134217840
875put t 2 5126554673377268553
876put t 3 2675213281549769253
877put t 4 2675186905684913232
878put t 5 2675186841260403809
879put t 6 82
880ret 1
881end
882if eq op 519
883note SEL %d, %a, %b, %R
884put t 0 29191
885put t 2 2318338018807399763
886put t 3 2318335819782054181
887put t 4 21029
888ret 1
889end
890if eq op 2055
891note SEL %d, %a, %i, %R
892put t 0 30727
893put t 2 2318338018807399763
894put t 3 2318343516363448613
895put t 4 21029
896ret 1
897end
898if eq op 545
899note FADD %d, %a, %b
900put t 0 29217
901put t 2 3198722455854399814
902put t 3 27625367831389472
903note FADD %d, %a, -%b
904put t 10 9223372036854805025
905put t 12 3198722455854399814
906put t 13 7072108406061999392
907ret 2
908end
909if eq op 544
910note FMUL %d, %a, %b
911put t 0 29216
912put t 1 4194304
913put t 2 3198722455989734726
914put t 3 27625367831389472
915ret 1
916end
917if eq op 547
918note FFMA %d, %a, %b, %c
919put t 0 29219
920put t 2 3198722455804659270
921put t 3 3198159505500218656
922put t 4 6497568
923ret 1
924end
925if eq op 521
926note FMNMX %d, %a, %b, %R
927put t 0 29193
928put t 2 7216209541557275974
929put t 3 7072094164835704876
930put t 4 1378164780
931ret 1
932end
933if eq op 523
934note FSETP.%g.AND %P, %Q, %a, %b, %R
935put t 0 29195
936put t 2 7432397682590962502
937put t 3 3193092956320842030
938put t 4 3197878030522459424
939put t 5 23121768204084512
940ret 1
941end
942if eq op 581
943note I2FP.F32.U32 %d, %b
944put t 0 29253
945put t 1 2101248
946put t 2 3617312090437857865
947put t 3 3198722455551300910
948put t 4 6432032
949note I2FP.F32.S32 %d, %b
950put t 10 29253
951put t 11 2102272
952put t 12 3617312090437857865
953put t 13 3198722455551300398
954put t 14 6432032
955ret 2
956end
957if eq op 773
958note F2I.U32.TRUNC.NTZ %d, %b
959put t 0 29445
960put t 1 2158592
961put t 2 3328779515522003526
962put t 3 6074843813981278804
963put t 4 7072094164886036570
964ret 1
965end
966if eq op 574
967note F2FP.SATFINITE.E4M3.F32.PACK_AB_MERGE_C %d, %a, %b, %c
968put t 0 29246
969put t 1 75526144
970put t 2 6071225231052517958
971put t 3 4984998065855154502
972put t 4 3328779451096059188
973put t 5 6864120659606454608
974put t 6 2324806583807264077
975put t 7 2318334720270427173
976put t 8 109011104719397
977note F2FP.BF16.F32.PACK_AB %d, %a, %b
978put t 10 29246
979put t 11 4351
980put t 12 3550598122910921286
981put t 13 4706312403745648182
982put t 14 7216209446867782467
983put t 15 7072094164835704876
984ret 2
985end
986if eq op 572
987note HMMA.16816.F32.BF16 %d, %a, %b, %c
988put t 0 29244
989put t 1 268288
990put t 2 4050478989600181576
991put t 3 4768804251234088497
992put t 4 2318338018805952838
993put t 5 2318335819782054181
994put t 6 25381
995note HMMA.16816.F32 %d, %a, %b, %c
996put t 10 29244
997put t 11 6144
998put t 12 4050478989600181576
999put t 13 2675193374460229169
1000put t 14 2675186974404389988
1001put t 15 425824627810
1002ret 2
1003end
1004if eq op 634
1005note QMMA.16832.F32.E4M3.E4M3 %d, %a, %b, %c
1006put t 0 29306
1007put t 1 11264
1008put t 2 4050478989600181585
1009put t 3 4984977033347871283
1010put t 4 3696668340873547060
1011put t 5 3197878030523704608
1012put t 6 27906842808165664
1013ret 1
1014end
1015ret 0
1016end
1017
1018fn rowsc op ulong t edit ulong 80 to ulong
1019if eq op 776
1020note MUFU.EX2 %d, %b
1021put t 0 29448
1022put t 1 2048
1023put t 2 3627725565148419405
1024put t 3 27625367831586080
1025note MUFU.RCP %d, %b
1026put t 10 29448
1027put t 11 4096
1028put t 12 5783556705426494797
1029put t 13 27625367831586080
1030note MUFU.RSQ %d, %b
1031put t 20 29448
1032put t 21 5120
1033put t 22 5860117899091793229
1034put t 23 27625367831586080
1035note MUFU.LG2 %d, %b
1036put t 30 29448
1037put t 31 3072
1038put t 32 3622948187125732685
1039put t 33 27625367831586080
1040note MUFU.RCP64H %d, %b
1041put t 40 29448
1042put t 41 6144
1043put t 42 5783556705426494797
1044put t 43 2318338018807133238
1045put t 44 25125
1046note MUFU.RSQ64H %d, %b
1047put t 50 29448
1048put t 51 7168
1049put t 52 5860117899091793229
1050put t 53 2318338018807133238
1051put t 54 25125
1052ret 6
1053end
1054if eq op 2433
1055note LDG.E%z %d, desc[%B][%a.64%o]
1056put t 0 31105
1057put t 1 203297024
1058put t 2 2340223935431787596
1059put t 3 7166182912787506213
1060put t 4 3341993472822486363
1061put t 5 401296667702
1062note LDG.E.STRONG.SYS %d, desc[%B][%a.64%o]
1063put t 10 31105
1064put t 11 203380992
1065put t 12 6076251196916974668
1066put t 13 6005923036305182546
1067put t 14 8315162376355980576
1068put t 15 7000101651917134691
1069put t 16 102731946931758
1070note LDG.E.MMIO.GPU %d, desc[%B][%a.64%o]
1071put t 20 31105
1072put t 21 203364608
1073put t 22 5570159188791215180
1074put t 23 2675231981938036553
1075put t 24 6585233959454518372
1076put t 25 3904164740051321381
1077put t 26 1567565108
1078ret 3
1079end
1080if eq op 2438
1081note STG.E%z desc[%C][%a.64%o], %b
1082put t 0 31110
1083put t 1 202379520
1084put t 2 2340223935431791699
1085put t 3 6720256143407670628
1086put t 4 8008864919659291995
1087put t 5 421529660509
1088note STG.E.STRONG.SYS desc[%C][%a.64%o], %b
1089put t 10 31110
1090put t 11 202463488
1091put t 12 6076251196916978771
1092put t 13 6005923036305182546
1093put t 14 4838373857375380512
1094put t 15 2680827251018521437
1095put t 16 107911593090415
1096ret 2
1097end
1098if eq op 2472
1099note ATOMG.E.ADD.STRONG.SYS PT, %d, desc[%C][%a.64], %b
1100put t 0 9223372036854806952
1101put t 1 136270080
1102put t 2 3334121982912320577
1103put t 3 5715723593321825345
1104put t 4 5773706365401712462
1105put t 5 7214815411678751828
1106put t 6 6583492058011628389
1107put t 7 2318330387017654565
1108put t 8 25125
1109note ATOMG.E.MIN.64.STRONG.SYS PT, %d, desc[%C][%a.64], %b
1110put t 10 9223372036854806952
1111put t 11 144659712
1112put t 12 3334121982912320577
1113put t 13 5993785561386469709
1114put t 14 6436539176233947732
1115put t 15 7216209352696275027
1116put t 16 2691854549557452844
1117put t 17 3762245533488078147
1118put t 18 421529660509
1119note ATOMG.E.EXCH.STRONG.SYS PT, %d, desc[%C][%a.64], %b
1120put t 20 9223372036854806952
1121put t 21 203378944
1122put t 22 3334121982912320577
1123put t 23 5932458067399759941
1124put t 24 2329303646074261071
1125put t 25 2318338018805306448
1126put t 26 6720256143407670628
1127put t 27 3196768717813917019
1128put t 28 6432032
1129ret 3
1130end
1131if eq op 2436
1132note LDS %d, [%a+%B]
1133put t 0 31108
1134put t 1 134219776
1135put t 2 2318338018807858252
1136put t 3 26249900243101019
1137note LDS%z %d, [%a%o]
1138put t 10 31108
1139put t 12 7216209686915400780
1140put t 13 6732641067110965292
1141ret 2
1142end
1143if eq op 2440
1144note STS [%a+%C], %b
1145put t 0 31112
1146put t 1 134219776
1147put t 2 3125820689686418515
1148put t 3 27625367831135013
1149ret 1
1150end
1151if eq op 2450
1152note MEMBAR.ALL.SYS
1153put t 0 31122
1154put t 1 45056
1155put t 2 4696781901632718157
1156put t 3 91643112737868
1157ret 1
1158end
1159if eq op 3977
1160note SHFL.DOWN PT, %d, %a, %h, %m
1161put t 0 576460752303456137
1162put t 1 917504
1163put t 2 6291322170098731091
1164put t 3 7216209352696275022
1165put t 4 7504439729063272492
1166put t 5 1831149612
1167note SHFL.BFLY PT, %d, %a, %h, %m
1168put t 10 864691128455167881
1169put t 11 917504
1170put t 12 5496153161867872339
1171put t 13 7216209352696275033
1172put t 14 7504439729063272492
1173put t 15 1831149612
1174ret 2
1175end
1176if eq op 2328
1177note NOP
1178put t 0 31000
1179put t 2 5263182
1180ret 1
1181end
1182if eq op 2381
1183note EXIT
1184put t 0 31053
1185put t 1 58720256
1186put t 2 1414092869
1187ret 1
1188end
1189if eq op 2375
1190note BRA %T
1191put t 0 31047
1192put t 1 58720256
1193put t 2 92518431674946
1194ret 1
1195end
1196if eq op 2373
1197note BSSY.RECONVERGENT %y, %Y
1198put t 0 31045
1199put t 1 58720768
1200put t 2 4847370932954813250
1201put t 3 5639992527027588687
1202put t 4 6423575818897006676
1203ret 1
1204end
1205if eq op 2369
1206note BSYNC.RECONVERGENT %y
1207put t 0 31041
1208put t 1 58720768
1209put t 2 4995105803319464770
1210put t 3 4992049169717677891
1211put t 4 520313918542
1212ret 1
1213end
1214if eq op 2845
1215note BAR.SYNC.DEFER_BLOCKING 0x0
1216put t 0 31517
1217put t 1 65536
1218put t 2 4849912062518903106
1219put t 3 4782631786775921710
1220put t 4 2325913809262432076
1221put t 5 3176496
1222ret 1
1223end
1224note The #280 integration's conversions and binary64 forms (BlackwellIR ops 65..79): only the exact forms its
1225note encoder writes, checked with nvdisasm 13.0.85 -b SM121 on 2026-11-10 (om/disasm/opmove_test.om).
1226if eq op 560
1227note HADD2.F32 %d, -RZ, %b.H0_H0
1228put t 0 2305843013491913264
1229put t 1 16640
1230put t 2 3694691337732637000
1231put t 3 5921424460092874802
1232put t 4 3479081711208246362
1233put t 5 3164255
1234ret 1
1235end
1236if eq op 772
1237note F2F.F16.F32 %d, %b
1238put t 0 29444
1239put t 1 2099200
1240put t 2 3329903151980884550
1241put t 3 2318338018805691206
1242put t 4 25125
1243ret 1
1244end
1245if eq op 553
1246note DADD %d, %a, %c
1247put t 0 29225
1248put t 1 0
1249put t 2 3198722455854399812
1250put t 3 27906842808100128
1251ret 1
1252end
1253if eq op 552
1254note DMUL %d, %a, %b
1255put t 0 29224
1256put t 1 0
1257put t 2 3198722455989734724
1258put t 3 27625367831389472
1259ret 1
1260end
1261if eq op 555
1262note DFMA %d, %a, %b, %c
1263put t 0 29227
1264put t 1 0
1265put t 2 3198722455804659268
1266put t 3 3198159505500218656
1267put t 4 6497568
1268ret 1
1269end
1270if eq op 554
1271note DSETP.%g.AND %P, %Q, %a, %b, %R
1272put t 0 29226
1273put t 1 0
1274put t 2 7432397682590962500
1275put t 3 3193092956320842030
1276put t 4 3197878030522459424
1277put t 5 23121768204084512
1278ret 1
1279end
1280if eq op 784
1281note F2F.F64.F32 %d, %b
1282put t 0 29456
1283put t 1 2103296
1284put t 2 3329345699585602118
1285put t 3 2318338018805691206
1286put t 4 25125
1287note F2F.F32.F64 %d, %b
1288put t 10 29456
1289put t 11 3149824
1290put t 12 3328779451097297478
1291put t 13 2318338018805823046
1292put t 14 25125
1293ret 2
1294end
1295if eq op 786
1296note I2F.F64 %d, %b
1297put t 0 29458
1298put t 1 2104320
1299put t 2 2320539383054611017
1300put t 3 107911593092133
1301note I2F.F64.U32 %d, %b
1302put t 10 29458
1303put t 11 2103296
1304put t 12 3329345699585602121
1305put t 13 2318338018805691221
1306put t 14 25125
1307ret 2
1308end
1309if eq op 785
1310note F2I.F64.TRUNC %d, %b
1311put t 0 29457
1312put t 1 3199232
1313put t 2 3329345699585798726
1314put t 3 7216209451380200020
1315put t 4 1646600236
1316ret 1
1317end
1318ret 0
1319end
1320
1321
1322note the rows of opcode op, in the C table's order, written to t (stride 10); their count
1323fn rows op ulong t edit ulong 80 to ulong
1324n = rowsa op t
1325if ne n 0
1326ret n
1327end
1328n = rowsb op t
1329if ne n 0
1330ret n
1331end
1332ret rowsc op t
1333end
1334
1335fn fin s view ulong 8 x ulong to ulong
1336ret or or get s 3 x mul get s 4 262144
1337end
1338
1339fn sm121_dis lo ulong hi ulong pc ulong o edit uchar 256 to ulong
1340s = new ulong 8 0
1341t = new ulong 80 0
1342put s 0 lo
1343put s 1 hi
1344put s 2 pc
1345g = bits lo 12 3
1346gn = bits lo 15 1
1347if or ne g 7 ne gn 0
1348pc1 o s 64
1349prd o s g gn
1350pc1 o s 32
1351end
1352lb = and lo not ulong 61440
1353hb = and hi HIM
1354x = ulong 0
1355if eq and lo 4095 2381
1356x = 131072
1357end
1358if imadi o s lb hb
1359ret fin s x
1360end
1361n = rows and lb 4095 t
1362for r ulong n
1363if hit t r lb hb
1364rend o s t r
1365if eq get s 5 0
1366ret fin s x
1367end
1368break
1369end
1370end
1371put s 3 0
1372lit o s 516203495231
1373hex16 o s hi
1374hex16 o s lo
1375ret fin s or x 65536
1376end