Source/Packages

Accelerator.SM86.Instruction

packages/hardware/architectures/nvidia-sm86/src/Accelerator/SM86/Instruction.alpha

698 lines435 declarations35.0 KiBSHA-256 fa563d2c80c7

Complete file · line 602

Instruction.alpha

Definition view
1module Accelerator.SM86.Instruction
2
3import Accelerator.SM86.Control
4import Accelerator.SM86.Immediate
5import Accelerator.SM86.NumericSemantics
6import Accelerator.SM86.Types
7
8family SM86SpecialRegister : Type 0
9-- SASS SR_CTAID.X: the cooperative thread array (block) index on x.
10constructor SM86CooperativeThreadArrayIdX
11-- SASS SR_CTAID.Y: the cooperative thread array (block) index on y.
12constructor SM86CooperativeThreadArrayIdY
13-- SASS SR_CTAID.Z: the cooperative thread array (block) index on z.
14constructor SM86CooperativeThreadArrayIdZ
15-- SASS SR_TID.X: the thread index on x within its cooperative thread array.
16constructor SM86ThreadIdX
17-- SASS SR_CLOCKLO: the low word of the SM's cycle counter.
18constructor SM86ClockLow
19-- SASS SR_GLOBALTIMERLO: the low word of the device's global timer, in
20-- nanoseconds -- the clock the semaphore releases stamp.
21constructor SM86GlobalTimerLow
22-- SASS SR_GLOBALTIMERHI: its high word.
23constructor SM86GlobalTimerHigh
24
25end-family
26
27family SM86InstructionGuard : Type 0
28-- no guard: the instruction always executes.
29constructor SM86InstructionAlways
30-- SASS @P: the instruction executes only in threads where the predicate is true.
31constructor SM86InstructionWhen
32field unrestricted sm86InstructionGuardPredicate : SM86Predicate
33-- SASS @!P: the instruction executes only in threads where the predicate is false.
34constructor SM86InstructionWhenNot
35field unrestricted sm86InstructionGuardNotPredicate : SM86Predicate
36
37end-family
38
39family SM86ShuffleMode : Type 0
40-- SASS SHFL.IDX: read the lane named by the lane operand.
41constructor SM86ShuffleIndex
42-- SASS SHFL.UP: read the lane that is lane places below this one.
43constructor SM86ShuffleUp
44-- SASS SHFL.DOWN: read the lane that is lane places above this one.
45constructor SM86ShuffleDown
46-- SASS SHFL.BFLY: read the lane whose index is this lane's index xor the lane operand.
47constructor SM86ShuffleButterfly
48
49end-family
50
51family SM86HalfSelector : Type 0
52-- the low binary16 half (H0) of a 32-bit register.
53constructor SM86LowHalf
54-- the high binary16 half (H1) of a 32-bit register.
55constructor SM86HighHalf
56
57end-family
58
59-- the 16-bit floating-point format a program's halves are in: binary16
60-- (5 exponent bits, 10 fraction bits) or bfloat16 (8 and 7: binary32's
61-- range).  Accelerator.SM86.HalfFormat moves a program between them.
62family SM86HalfFormat : Type 0
63constructor SM86Binary16
64constructor SM86BFloat16
65
66end-family
67
68family SM86SharedMatrixCount : Type 0
69-- SASS LDSM.x1: one 8x8 matrix.
70constructor SM86SharedMatrix1
71-- SASS LDSM.x2: two 8x8 matrices.
72constructor SM86SharedMatrix2
73-- SASS LDSM.x4: four 8x8 matrices.
74constructor SM86SharedMatrix4
75
76end-family
77
78family SM86SharedMatrixTranspose : Type 0
79-- SASS LDSM (no .T): rows as stored.
80constructor SM86SharedMatrixNotTransposed
81-- SASS LDSM.T: each matrix transposed while loading.
82constructor SM86SharedMatrixTransposed
83
84end-family
85
86-- an 8-bit floating-point format (sm_89 and later): E4M3 (4 exponent bits,
87-- 3 mantissa bits, largest finite 448) or E5M2 (5 and 2, 57344)
88family SM86Float8Format : Type 0
89constructor SM86Float8E4M3
90constructor SM86Float8E5M2
91
92end-family
93
94-- SM86FloatArithmetic's operation: FADD, FMUL or FFMA
95family SM86FloatOperation : Type 0
96constructor SM86FloatOperationAdd
97constructor SM86FloatOperationMultiply
98constructor SM86FloatOperationFusedMultiplyAdd
99
100end-family
101
102-- a binary32 rounding direction: to nearest even (RN), toward minus
103-- infinity (RM), toward plus infinity (RP), toward zero (RZ)
104family SM86Rounding : Type 0
105constructor SM86RoundNearestEven
106constructor SM86RoundDown
107constructor SM86RoundUp
108constructor SM86RoundTowardZero
109
110end-family
111
112-- SM86FloatArithmetic's modifiers, each flag 0 or 1: the rounding, .FTZ
113-- (subnormal sources and result flushed to zero, sign kept), .SAT (the
114-- result clamped to [0, 1], NaN to 0), a source negated (-R) or made
115-- absolute (|R|: FADD only).  The negation of the left and right sources
116-- negates FMUL's and FFMA's product.
117family SM86FloatModifiers : Type 0
118constructor SM86FloatModifiersValue
119field unrestricted sm86FloatModifiersRounding : SM86Rounding
120field unrestricted sm86FloatModifiersFlushToZero : Nat
121field unrestricted sm86FloatModifiersSaturate : Nat
122field unrestricted sm86FloatModifiersNegateLeft : Nat
123field unrestricted sm86FloatModifiersAbsoluteLeft : Nat
124field unrestricted sm86FloatModifiersNegateRight : Nat
125field unrestricted sm86FloatModifiersAbsoluteRight : Nat
126field unrestricted sm86FloatModifiersNegateAddend : Nat
127
128end-family
129
130-- ---- system forms (AlphaOS PRD §7, §9) ----
131-- The forms a GPU-resident operating system needs and ordinary kernels did
132-- not: atomics, fences, strong (coherent) accesses, sleeping, register
133-- compares and selects, indirect control transfer, warp votes.  Their
134-- encodings are the words ptxas 12.9 writes for sm_86
135-- (experiments/sm86-opcodes/sources/ptxas-oracle.tsv, checked by
136-- Proof.SM86SystemEncoding) with field positions from Mesa NAK
137-- (sm70_encode.rs @ ad23c0ca).  They sit behind one body constructor,
138-- SM86System, so a program transformation that does not care about them
139-- passes them through in one branch.
140-- the scope an atomic, a fence or a strong access orders at
141family SM86MemoryScope : Type 0
142constructor SM86ScopeBlock
143constructor SM86ScopeDevice
144constructor SM86ScopeSystem
145
146end-family
147
148family SM86AtomicOperation : Type 0
149constructor SM86AtomicAdd
150constructor SM86AtomicMinimum
151constructor SM86AtomicMaximum
152constructor SM86AtomicIncrement
153constructor SM86AtomicDecrement
154constructor SM86AtomicAnd
155constructor SM86AtomicOr
156constructor SM86AtomicXor
157constructor SM86AtomicExchange
158
159end-family
160
161-- MEMBAR.SC (sequentially consistent: fence.sc) or MEMBAR.ALL (fence.acq_rel)
162family SM86FenceMode : Type 0
163constructor SM86FenceSequential
164constructor SM86FenceAcquireRelease
165
166end-family
167
168family SM86IntegerComparison : Type 0
169constructor SM86CompareLess
170constructor SM86CompareEqual
171constructor SM86CompareLessOrEqual
172constructor SM86CompareGreater
173constructor SM86CompareNotEqual
174constructor SM86CompareGreaterOrEqual
175
176end-family
177
178family SM86IntegerSignedness : Type 0
179constructor SM86Unsigned
180constructor SM86Signed
181
182end-family
183
184family SM86PredicateSense : Type 0
185constructor SM86PredicateAsIs
186constructor SM86PredicateInverted
187
188end-family
189
190family SM86SystemOperation : Type 0
191-- ATOMG.E.<op>.STRONG.<scope> PT, Rd, [Ra.64 + offset], Rb: the 32-bit word
192-- at the address combined with Rb, atomically; Rd receives the old word.
193constructor SM86AtomicGlobal
194field unrestricted sm86AtomicOperation : SM86AtomicOperation
195field unrestricted sm86AtomicScope : SM86MemoryScope
196field unrestricted sm86AtomicDestination : SM86Register
197field unrestricted sm86AtomicAddress : SM86Register
198field unrestricted sm86AtomicValue : SM86Register
199field unrestricted sm86AtomicOffset : SM86Unsigned32
200-- ATOMG.E.CAS.STRONG.<scope> PT, Rd, [Ra.64 + offset], Rcompare, Rvalue: the
201-- word becomes Rvalue when it equals Rcompare; Rd receives the old word.
202constructor SM86AtomicCompareSwapGlobal
203field unrestricted sm86CompareSwapScope : SM86MemoryScope
204field unrestricted sm86CompareSwapDestination : SM86Register
205field unrestricted sm86CompareSwapAddress : SM86Register
206field unrestricted sm86CompareSwapCompare : SM86Register
207field unrestricted sm86CompareSwapValue : SM86Register
208field unrestricted sm86CompareSwapOffset : SM86Unsigned32
209-- RED.E.<op>.STRONG.<scope> [Ra.64 + offset], Rb: the same without the old
210-- word (no exchange: RED has no EXCH)
211constructor SM86ReduceGlobal
212field unrestricted sm86ReduceOperation : SM86AtomicOperation
213field unrestricted sm86ReduceScope : SM86MemoryScope
214field unrestricted sm86ReduceAddress : SM86Register
215field unrestricted sm86ReduceValue : SM86Register
216field unrestricted sm86ReduceOffset : SM86Unsigned32
217-- MEMBAR.<mode>.<scope>: this thread's earlier accesses ordered before its later ones
218constructor SM86MemoryBarrier
219field unrestricted sm86MemoryBarrierScope : SM86MemoryScope
220field unrestricted sm86MemoryBarrierMode : SM86FenceMode
221-- ERRBAR: wait until outstanding memory errors are reported
222constructor SM86ErrorBarrier
223-- CCTL.IVALL: every line of this SM's L1 data cache invalidated (what ptxas
224-- emits after the fence of an acquire)
225constructor SM86InvalidateDataCache
226-- LDG.E.STRONG.<scope> Rd, [Ra.64 + offset]: a coherent 32-bit load
227constructor SM86LoadGlobalStrong
228field unrestricted sm86LoadStrongScope : SM86MemoryScope
229field unrestricted sm86LoadStrongDestination : SM86Register
230field unrestricted sm86LoadStrongAddress : SM86Register
231field unrestricted sm86LoadStrongOffset : SM86Unsigned32
232-- STG.E.STRONG.<scope> [Ra.64 + offset], Rb: a coherent 32-bit store
233constructor SM86StoreGlobalStrong
234field unrestricted sm86StoreStrongScope : SM86MemoryScope
235field unrestricted sm86StoreStrongAddress : SM86Register
236field unrestricted sm86StoreStrongValue : SM86Register
237field unrestricted sm86StoreStrongOffset : SM86Unsigned32
238-- NANOSLEEP immediate: suspend the warp about that many nanoseconds
239constructor SM86Sleep
240field unrestricted sm86SleepNanoseconds : SM86Unsigned32
241-- ISETP.<comparison>.<U32|S32>.AND Pd, PT, Ra, Rb, PT
242constructor SM86CompareRegisters
243field unrestricted sm86CompareComparison : SM86IntegerComparison
244field unrestricted sm86CompareSignedness : SM86IntegerSignedness
245field unrestricted sm86CompareDestination : SM86Predicate
246field unrestricted sm86CompareLeft : SM86Register
247field unrestricted sm86CompareRight : SM86Register
248-- SEL Rd, Rt, Rf, P: Rt where the predicate (as sensed) holds, else Rf
249constructor SM86SelectRegisters
250field unrestricted sm86SelectDestination : SM86Register
251field unrestricted sm86SelectWhenTrue : SM86Register
252field unrestricted sm86SelectWhenFalse : SM86Register
253field unrestricted sm86SelectPredicate : SM86Predicate
254field unrestricted sm86SelectSense : SM86PredicateSense
255-- IMNMX.<U32|S32> Rd, Ra, Rb: the integer minimum or maximum
256constructor SM86IntegerMinimumOrMaximum
257field unrestricted sm86IntegerExtremumMode : SM86FloatExtremum
258field unrestricted sm86IntegerExtremumSignedness : SM86IntegerSignedness
259field unrestricted sm86IntegerExtremumDestination : SM86Register
260field unrestricted sm86IntegerExtremumLeft : SM86Register
261field unrestricted sm86IntegerExtremumRight : SM86Register
262-- IMAD.MOV.U32 Rd, RZ, RZ, Rs: a register copy on the fixed-latency pipe
263constructor SM86MoveRegister
264field unrestricted sm86MoveDestination : SM86Register
265field unrestricted sm86MoveSource : SM86Register
266-- IMAD.U32 Rd, Ra, Rb, Rc: the low 32 bits of Ra x Rb + Rc
267constructor SM86IntegerMultiplyAddRegister
268field unrestricted sm86MultiplyAddDestination : SM86Register
269field unrestricted sm86MultiplyAddLeft : SM86Register
270field unrestricted sm86MultiplyAddRight : SM86Register
271field unrestricted sm86MultiplyAddAddend : SM86Register
272-- S2R Rd, SR_<code>: any special register by its code (lane id 0x00,
273-- TID.X 0x21, CTAID.X 0x25, virtual SM id 0x43, ...)
274constructor SM86ReadSystemRegister
275field unrestricted sm86ReadSystemDestination : SM86Register
276field unrestricted sm86ReadSystemCode : Byte
277-- BRX Ra, offset: continue at the next instruction's address + Ra:Ra+1 +
278-- offset.  The register is a PAIR, a 64-bit displacement (ptxas loads the
279-- pair before every BRX, CALL.REL and RET.REL it writes: "MOV R10, ..;
280-- MOV R11, 0x0; RET.REL.NODEC R10"); ptxas sets offset to minus the next
281-- instruction's position, so the pair is a target relative to the start.
282constructor SM86BranchIndirect
283field unrestricted sm86BranchIndirectRegister : SM86Register
284field unrestricted sm86BranchIndirectOffset : SM86Unsigned32
285-- CALL.REL.NOINC Ra, offset: the same transfer through the pair, as a call
286-- (no call stack; the caller leaves its return target in registers by
287-- convention)
288constructor SM86CallIndirect
289field unrestricted sm86CallIndirectRegister : SM86Register
290field unrestricted sm86CallIndirectOffset : SM86Unsigned32
291-- RET.REL.NODEC Ra, offset: the same transfer, as a return
292constructor SM86ReturnIndirect
293field unrestricted sm86ReturnIndirectRegister : SM86Register
294field unrestricted sm86ReturnIndirectOffset : SM86Unsigned32
295-- POPC Rd, Rs: the number of set bits
296constructor SM86PopulationCount
297field unrestricted sm86PopulationDestination : SM86Register
298field unrestricted sm86PopulationSource : SM86Register
299-- VOTE.ANY Rd, PT, P: the warp's ballot of the predicate (as sensed) in Rd
300constructor SM86VoteBallot
301field unrestricted sm86BallotDestination : SM86Register
302field unrestricted sm86BallotPredicate : SM86Predicate
303field unrestricted sm86BallotSense : SM86PredicateSense
304-- BAR.ARV barrier, threads: arrive at a named barrier without waiting
305constructor SM86BarrierArrive
306field unrestricted sm86BarrierArriveBarrier : Byte
307field unrestricted sm86BarrierArriveThreads : Nat
308-- BSSY Bb, target: convergence barrier b (0 .. 15) takes the lanes that
309-- execute it, the reconvergence point `displacement` bytes past the next
310-- instruction (its BSYNC).  Independent thread scheduling never merges
311-- lanes that went different ways on its own; a BSYNC on the barrier does.
312constructor SM86ConvergenceStart
313field unrestricted sm86ConvergenceStartBarrier : Byte
314field unrestricted sm86ConvergenceStartDisplacement : SM86Unsigned32
315-- BSYNC Bb: wait until every lane barrier b took (and has not exited) is
316-- here; they leave together, one group
317constructor SM86ConvergenceWait
318field unrestricted sm86ConvergenceWaitBarrier : Byte
319-- MOV Rd, to - from: the byte distance from one label to another
320-- (Accelerator.SM86.Assembly's SM86AsmLabelOffset, the offset an indirect
321-- transfer adds to its base).  Its word is MOV immediate's; the two labels'
322-- displacements from the next instruction (bytes, two's complement) are
323-- kept apart so a lowering that moves instructions (Accelerator.SM121.
324-- Lowering) can measure the distance again where it placed them.
325constructor SM86LabelDistance
326field unrestricted sm86LabelDistanceDestination : SM86Register
327field unrestricted sm86LabelDistanceFrom : SM86Unsigned32
328field unrestricted sm86LabelDistanceTo : SM86Unsigned32
329
330end-family
331
332family SM86InstructionBody : Type 0
333-- SASS MOV (constant bank): destination = c[bank][offset], a 32-bit word from a constant bank.
334constructor SM86MoveConstant
335field unrestricted sm86MoveConstantDestination : SM86Register
336field unrestricted sm86MoveConstantBank : Byte
337field unrestricted sm86MoveConstantOffset : SM86Unsigned32
338field unrestricted sm86MoveConstantControl : SM86Control
339-- SASS S2R: destination = a special register (thread or cooperative-thread-array index).
340constructor SM86SpecialToRegister
341field unrestricted sm86SpecialDestination : SM86Register
342field unrestricted sm86SpecialSource : SM86SpecialRegister
343field unrestricted sm86SpecialControl : SM86Control
344-- SASS MOV (immediate): destination = a 32-bit immediate.
345constructor SM86MoveImmediate
346field unrestricted sm86MoveImmediateDestination : SM86Register
347field unrestricted sm86MoveImmediateValue : SM86Unsigned32
348field unrestricted sm86MoveImmediateControl : SM86Control
349-- SASS IMAD (constant bank): destination = left * c[bank][offset] + addend, 32-bit integer.
350constructor SM86IntegerMultiplyAddConstant
351field unrestricted sm86IMADConstantDestination : SM86Register
352field unrestricted sm86IMADConstantLeft : SM86Register
353field unrestricted sm86IMADConstantBank : Byte
354field unrestricted sm86IMADConstantOffset : SM86Unsigned32
355field unrestricted sm86IMADConstantAddend : SM86Register
356field unrestricted sm86IMADConstantControl : SM86Control
357-- SASS IMAD (immediate): destination = left * immediate + addend, 32-bit integer.
358constructor SM86IntegerMultiplyAddImmediate
359field unrestricted sm86IMADImmediateDestination : SM86Register
360field unrestricted sm86IMADImmediateLeft : SM86Register
361field unrestricted sm86IMADImmediateValue : SM86Unsigned32
362field unrestricted sm86IMADImmediateAddend : SM86Register
363field unrestricted sm86IMADImmediateControl : SM86Control
364-- SASS IMAD.WIDE.U32: destination pair = left * right + c[bank][offset], a 64-bit product plus a 64-bit constant.
365constructor SM86IntegerMultiplyAddWideConstant
366field unrestricted sm86IMADWideDestination : SM86Register
367field unrestricted sm86IMADWideLeft : SM86Register
368field unrestricted sm86IMADWideRight : SM86Register
369field unrestricted sm86IMADWideBank : Byte
370field unrestricted sm86IMADWideOffset : SM86Unsigned32
371field unrestricted sm86IMADWideControl : SM86Control
372-- SASS IADD3 (immediate): destination = left + immediate, the three-input adder with one input zero.
373constructor SM86IntegerAddThreeImmediate
374field unrestricted sm86IADD3ImmediateDestination : SM86Register
375field unrestricted sm86IADD3ImmediateLeft : SM86Register
376field unrestricted sm86IADD3ImmediateValue : SM86Unsigned32
377field unrestricted sm86IADD3ImmediateControl : SM86Control
378-- SASS IADD3 (register): destination = left + right, the three-input adder with one input zero.
379constructor SM86IntegerAddThreeRegister
380field unrestricted sm86IADD3RegisterDestination : SM86Register
381field unrestricted sm86IADD3RegisterLeft : SM86Register
382field unrestricted sm86IADD3RegisterRight : SM86Register
383field unrestricted sm86IADD3RegisterControl : SM86Control
384-- SASS SHF.R.U32.HI: destination = source logically shifted right by an immediate amount.
385constructor SM86ShiftRightImmediate
386field unrestricted sm86ShiftRightDestination : SM86Register
387field unrestricted sm86ShiftRightSource : SM86Register
388field unrestricted sm86ShiftRightAmount : Byte
389field unrestricted sm86ShiftRightControl : SM86Control
390-- SASS LOP3.LUT: destination = truthTable(left, right, zero), any bitwise function of the inputs given as an 8-bit lookup table.
391constructor SM86LogicThreeInputTruthTable
392field unrestricted sm86Logic3Destination : SM86Register
393field unrestricted sm86Logic3Left : SM86Register
394field unrestricted sm86Logic3Right : SM86Register
395field unrestricted sm86Logic3TruthTable : Byte
396field unrestricted sm86Logic3Control : SM86Control
397-- SASS I2FP.F32.S32: destination = the signed 32-bit integer source converted to binary32.
398constructor SM86IntegerToFloat
399field unrestricted sm86IntegerToFloatDestination : SM86Register
400field unrestricted sm86IntegerToFloatSource : SM86Register
401field unrestricted sm86IntegerToFloatControl : SM86Control
402-- SASS FADD: destination = left + right, binary32, round to nearest even.
403constructor SM86FloatAdd
404field unrestricted sm86FloatAddDestination : SM86Register
405field unrestricted sm86FloatAddLeft : SM86Register
406field unrestricted sm86FloatAddRight : SM86Register
407field unrestricted sm86FloatAddControl : SM86Control
408-- SASS FMUL: destination = left * right, binary32, round to nearest even.
409constructor SM86FloatMultiply
410field unrestricted sm86FloatMultiplyDestination : SM86Register
411field unrestricted sm86FloatMultiplyLeft : SM86Register
412field unrestricted sm86FloatMultiplyRight : SM86Register
413field unrestricted sm86FloatMultiplyControl : SM86Control
414-- Binary64 arithmetic has paired operands and separate rounding at every
415-- instruction. It is variable-latency: callers must retire both destination
416-- words and protect both words of every source with scoreboard dependencies.
417constructor SM86Float64Binary
418field unrestricted sm86Float64Operation : SM86Float64Operation
419field unrestricted sm86Float64Destination : SM86RegisterPair
420field unrestricted sm86Float64Left : SM86RegisterPair
421field unrestricted sm86Float64Right : SM86RegisterPair
422field unrestricted sm86Float64Control : SM86Control
423-- F2F with nearest-even rounding and subnormals preserved. Its pair shape,
424-- late sources and late result are explicit; conversion never implies FTZ.
425constructor SM86FloatConvert
426field unrestricted sm86FloatConvertOperation : SM86FloatConversion
427field unrestricted sm86FloatConvertControl : SM86Control
428-- SASS FFMA: destination = left * right + addend, binary32 with a single rounding.
429constructor SM86FloatFusedMultiplyAdd
430field unrestricted sm86FloatFMADestination : SM86Register
431field unrestricted sm86FloatFMALeft : SM86Register
432field unrestricted sm86FloatFMARight : SM86Register
433field unrestricted sm86FloatFMAAddend : SM86Register
434field unrestricted sm86FloatFMAControl : SM86Control
435-- SASS MUFU: destination = an approximate transcendental of the source (cosine, sine, exp2, log2, reciprocal, reciprocal square root, square root, tanh) from the multi-function unit.
436constructor SM86MultiFunctionUnitApproximation
437field unrestricted sm86MultiFunctionDestination : SM86Register
438field unrestricted sm86MultiFunctionSource : SM86Register
439field unrestricted sm86MultiFunctionOperation : SM86MultiFunction
440field unrestricted sm86MultiFunctionControl : SM86Control
441-- SASS FMNMX: destination = the minimum or the maximum of left and right, binary32.
442constructor SM86FloatMinimumOrMaximum
443field unrestricted sm86FloatExtremumDestination : SM86Register
444field unrestricted sm86FloatExtremumLeft : SM86Register
445field unrestricted sm86FloatExtremumRight : SM86Register
446field unrestricted sm86FloatExtremumMode : SM86FloatExtremum
447field unrestricted sm86FloatExtremumControl : SM86Control
448-- SASS FADD (negated source, zero addend): destination = -source, binary32.
449constructor SM86FloatNegate
450field unrestricted sm86FloatNegateDestination : SM86Register
451field unrestricted sm86FloatNegateSource : SM86Register
452field unrestricted sm86FloatNegateControl : SM86Control
453-- SASS F2FP.PACK_AB: destination = two binary32 sources converted and packed into one register of two binary16 halves.
454constructor SM86FloatPairToPackedHalfPair
455field unrestricted sm86Float32PairToHalf2Destination : SM86Register
456field unrestricted sm86Float32PairToHalf2SourceHigh : SM86Register
457field unrestricted sm86Float32PairToHalf2SourceLow : SM86Register
458field unrestricted sm86Float32PairToHalf2Control : SM86Control
459-- SASS F2FP.BF16.PACK_AB: destination = two binary32 sources rounded to bfloat16 (to nearest, ties to even) and packed into one register.
460constructor SM86FloatPairToPackedBFloat16Pair
461field unrestricted sm86Float32PairToBFloat16PairDestination : SM86Register
462field unrestricted sm86Float32PairToBFloat16PairSourceHigh : SM86Register
463field unrestricted sm86Float32PairToBFloat16PairSourceLow : SM86Register
464field unrestricted sm86Float32PairToBFloat16PairControl : SM86Control
465-- SASS HADD2.F32: destination = the selected binary16 half of the source widened to binary32.
466-- SASS F2FP.SATFINITE.{E4M3,E5M2}.F32.PACK_AB_MERGE_C (sm_89 and later):
467-- destination = the half of `merge` that `mergeHalf` selects in bits
468-- 16..31, the high source rounded to the 8-bit format in bits 8..15 and
469-- the low source in bits 0..7 (each to nearest, ties to even, saturating to
470-- the format's largest finite magnitude; a NaN stays NaN).
471constructor SM86FloatPairToPackedFloat8Pair
472field unrestricted sm86Float32PairToFloat8Destination : SM86Register
473field unrestricted sm86Float32PairToFloat8SourceHigh : SM86Register
474field unrestricted sm86Float32PairToFloat8SourceLow : SM86Register
475field unrestricted sm86Float32PairToFloat8Merge : SM86Register
476field unrestricted sm86Float32PairToFloat8MergeHalf : SM86HalfSelector
477field unrestricted sm86Float32PairToFloat8Format : SM86Float8Format
478field unrestricted sm86Float32PairToFloat8Control : SM86Control
479-- SASS FADD / FMUL / FFMA with their modifiers (SM86FloatModifiers): the
480-- words of ptxas 12.9 for sm_90a (Proof.FloatArithmeticContract), libdevice's
481-- forms -- __nv_expf's FFMA.FTZ.RM, __nv_tanhf's FFMA.FTZ, FADD.FTZ.SAT.
482-- destination = left + right, left * right, or left * right + addend (the
483-- addend unread unless FFMA), binary32 with one rounding.
484constructor SM86FloatArithmetic
485field unrestricted sm86FloatArithmeticOperation : SM86FloatOperation
486field unrestricted sm86FloatArithmeticDestination : SM86Register
487field unrestricted sm86FloatArithmeticLeft : SM86Register
488field unrestricted sm86FloatArithmeticRight : SM86Register
489field unrestricted sm86FloatArithmeticAddend : SM86Register
490field unrestricted sm86FloatArithmeticModifiers : SM86FloatModifiers
491field unrestricted sm86FloatArithmeticControl : SM86Control
492constructor SM86HalfToFloat
493field unrestricted sm86HalfToFloatDestination : SM86Register
494field unrestricted sm86HalfToFloatSource : SM86Register
495field unrestricted sm86HalfToFloatSelector : SM86HalfSelector
496field unrestricted sm86HalfToFloatControl : SM86Control
497-- SASS PRMT Rd, Ra, 0x1044 (H0) or 0x3244 (H1), RZ: destination = the selected bfloat16 half of the source widened to binary32 (its bits moved to the high half, the low half zero: exact).
498constructor SM86BFloat16ToFloat
499field unrestricted sm86BFloat16ToFloatDestination : SM86Register
500field unrestricted sm86BFloat16ToFloatSource : SM86Register
501field unrestricted sm86BFloat16ToFloatSelector : SM86HalfSelector
502field unrestricted sm86BFloat16ToFloatControl : SM86Control
503-- SASS HMMA.16816.F32: destination = fragmentA (16x16, binary16) * fragmentB (16x8, binary16) + accumulator (16x8, binary32) on the tensor cores, one warp-wide 16x8x16 tile.
504constructor SM86TensorCoreHalfMatrixMultiplyAccumulate16x8x16Float32
505field unrestricted sm86TensorCoreMatrixMultiplyAccumulateDestination : SM86Register
506field unrestricted sm86TensorCoreMatrixMultiplyAccumulateFragmentA : SM86Register
507field unrestricted sm86TensorCoreMatrixMultiplyAccumulateFragmentB : SM86Register
508field unrestricted sm86TensorCoreMatrixMultiplyAccumulateAccumulator : SM86Register
509field unrestricted sm86TensorCoreMatrixMultiplyAccumulateControl : SM86Control
510-- SASS HMMA.16816.F32.BF16: the same tile product with bfloat16 fragments.
511constructor SM86TensorCoreBFloat16MatrixMultiplyAccumulate16x8x16Float32
512field unrestricted sm86TensorCoreBFloat16Destination : SM86Register
513field unrestricted sm86TensorCoreBFloat16FragmentA : SM86Register
514field unrestricted sm86TensorCoreBFloat16FragmentB : SM86Register
515field unrestricted sm86TensorCoreBFloat16Accumulator : SM86Register
516field unrestricted sm86TensorCoreBFloat16Control : SM86Control
517-- SASS HMMA.16816.F16: the binary16 tile product with a binary16 accumulator
518-- and destination (a register pair each, not a quad).  GeForce Ampere is
519-- documented at twice the binary32-accumulate rate for it; the accumulator's
520-- rounding inside the tensor core is not modelled (the machine models fault).
521-- Encoding: ptxas 11.8's for sm_86 (experiments/sm86-opcodes, probe
522-- gpt2_alphaos_products).
523constructor SM86TensorCoreHalfMatrixMultiplyAccumulate16x8x16Half
524field unrestricted sm86TensorCoreHalfAccumulateDestination : SM86Register
525field unrestricted sm86TensorCoreHalfAccumulateFragmentA : SM86Register
526field unrestricted sm86TensorCoreHalfAccumulateFragmentB : SM86Register
527field unrestricted sm86TensorCoreHalfAccumulateAccumulator : SM86Register
528field unrestricted sm86TensorCoreHalfAccumulateControl : SM86Control
529-- SASS IMMA.16832.S8.S8: a 16 x 32 signed 8-bit fragment times a 32 x 8 one
530-- plus a 16 x 8 binary32-wide signed integer accumulator (quads, as
531-- HMMA.16816.F32's).  Not modelled.  Encoding: ptxas 11.8's for sm_86.
532constructor SM86TensorCoreInteger8MatrixMultiplyAccumulate16x8x32Integer32
533field unrestricted sm86TensorCoreInteger8Destination : SM86Register
534field unrestricted sm86TensorCoreInteger8FragmentA : SM86Register
535field unrestricted sm86TensorCoreInteger8FragmentB : SM86Register
536field unrestricted sm86TensorCoreInteger8Accumulator : SM86Register
537field unrestricted sm86TensorCoreInteger8Control : SM86Control
538-- SASS LDG.E: destination = the 32-bit word at address + offset in global memory.
539constructor SM86LoadGlobal
540field unrestricted sm86LoadGlobalDestination : SM86Register
541field unrestricted sm86LoadGlobalAddress : SM86Register
542field unrestricted sm86LoadGlobalOffset : SM86Unsigned32
543field unrestricted sm86LoadGlobalControl : SM86Control
544-- SASS LDG.E.128: destination quad = the 128 bits at address + offset in global memory.
545constructor SM86LoadGlobalWide
546field unrestricted sm86LoadGlobalWideDestination : SM86Register
547field unrestricted sm86LoadGlobalWideAddress : SM86Register
548field unrestricted sm86LoadGlobalWideOffset : SM86Unsigned32
549field unrestricted sm86LoadGlobalWideControl : SM86Control
550-- SASS SHFL: destination = the source register of another lane of the warp, selected by index, up, down or butterfly mode.
551constructor SM86WarpShuffle
552field unrestricted sm86ShuffleDestination : SM86Register
553field unrestricted sm86ShuffleSource : SM86Register
554field unrestricted sm86ShuffleLane : Byte
555field unrestricted sm86ShuffleSegment : SM86Unsigned32
556field unrestricted sm86ShuffleMode : SM86ShuffleMode
557field unrestricted sm86ShuffleControl : SM86Control
558-- SASS LDS: destination = the 32-bit word at 4 address + offset in shared memory
559-- (encoded LDS [Ra.X4 + offset]: the register is a WORD index, the offset
560-- bytes -- nvdisasm prints the .X4; a byte address in the register reads 4x
561-- too far, as the Hopper attention key pass did, 2026-10-18).
562constructor SM86LoadShared
563field unrestricted sm86LoadSharedDestination : SM86Register
564field unrestricted sm86LoadSharedAddress : SM86Register
565field unrestricted sm86LoadSharedOffset : SM86Unsigned32
566field unrestricted sm86LoadSharedControl : SM86Control
567-- SASS LDSM: destination = one, two or four 8x8 binary16 matrices loaded from shared memory into tensor-core fragment layout, optionally transposed.
568constructor SM86LoadSharedMatrix
569field unrestricted sm86LoadSharedMatrixDestination : SM86Register
570field unrestricted sm86LoadSharedMatrixAddress : SM86Register
571field unrestricted sm86LoadSharedMatrixOffset : SM86Unsigned32
572field unrestricted sm86LoadSharedMatrixCount : SM86SharedMatrixCount
573field unrestricted sm86LoadSharedMatrixTranspose : SM86SharedMatrixTranspose
574field unrestricted sm86LoadSharedMatrixControl : SM86Control
575-- SASS STS: the 32-bit value stored at 4 address + offset in shared memory
576-- (STS [Ra.X4 + offset]: the register a word index, the offset bytes).
577constructor SM86StoreShared
578field unrestricted sm86StoreSharedAddress : SM86Register
579field unrestricted sm86StoreSharedValue : SM86Register
580field unrestricted sm86StoreSharedOffset : SM86Unsigned32
581field unrestricted sm86StoreSharedControl : SM86Control
582-- SASS LDGSTS.E.BYPASS.128 (cp.async.cg, 16 bytes): the 128 bits at global
583-- source + sourceOffset (a register pair; the offset a signed 12-bit
584-- immediate) copied to shared memory at address + offset, asynchronously:
585-- the copy joins the thread's open group (SM86CommitAsyncGroup closes it),
586-- and nothing may read those shared bytes until SM86WaitAsyncGroups has
587-- retired the group (and, for other threads, a BAR.SYNC after).  Its
588-- registers are read after issue: a read barrier guards them.
589constructor SM86LoadGlobalToShared
590field unrestricted sm86LoadGlobalToSharedAddress : SM86Register
591field unrestricted sm86LoadGlobalToSharedOffset : SM86Unsigned32
592field unrestricted sm86LoadGlobalToSharedSource : SM86Register
593field unrestricted sm86LoadGlobalToSharedSourceOffset : SM86Unsigned32
594field unrestricted sm86LoadGlobalToSharedControl : SM86Control
595-- SASS LDGDEPBAR (cp.async.commit_group): the thread's open group of
596-- asynchronous copies closed; the groups in flight count on scoreboard SB0,
597-- which the control's write barrier names.
598constructor SM86CommitAsyncGroup
599field unrestricted sm86CommitAsyncGroupControl : SM86Control
600-- SASS DEPBAR.LE SB0, count (cp.async.wait_group count): wait until at
601-- most `count` (0..63) groups of asynchronous copies are in flight.
602constructor SM86WaitAsyncGroups
603field unrestricted sm86WaitAsyncGroupsCount : Byte
604field unrestricted sm86WaitAsyncGroupsControl : SM86Control
605-- SASS BAR.SYNC: every thread of the cooperative thread array waits until all have arrived.
606constructor SM86BarrierSynchronize
607field unrestricted sm86BarrierSynchronizeControl : SM86Control
608-- SASS BAR.SYNC b, n: the first `threads` threads to arrive at named barrier
609-- `barrier` (0..15) wait until that many have (a multiple of the warp
610-- size, at most 1024; the others of the CTA run on). Warps that synchronise
611-- among themselves this way leave the CTA's other warps free -- a warp
612-- streaming independent work beside them (Realization.Nvidia.SM86's side
613-- warps).
614constructor SM86BarrierSynchronizeCount
615field unrestricted sm86BarrierSynchronizeCountBarrier : Byte
616field unrestricted sm86BarrierSynchronizeCountThreads : Nat
617field unrestricted sm86BarrierSynchronizeCountControl : SM86Control
618-- SASS STG.E: the 32-bit value stored at address + offset in global memory.
619constructor SM86StoreGlobal
620field unrestricted sm86StoreGlobalAddress : SM86Register
621field unrestricted sm86StoreGlobalValue : SM86Register
622field unrestricted sm86StoreGlobalOffset : SM86Unsigned32
623field unrestricted sm86StoreGlobalControl : SM86Control
624-- SASS STG.E.128: the 128-bit value quad stored at address + offset in global memory.
625constructor SM86StoreGlobalWide
626field unrestricted sm86StoreGlobalWideAddress : SM86Register
627field unrestricted sm86StoreGlobalWideValue : SM86Register
628field unrestricted sm86StoreGlobalWideOffset : SM86Unsigned32
629field unrestricted sm86StoreGlobalWideControl : SM86Control
630-- SASS STG.E.64: the 64-bit value pair stored at address + offset in global memory.
631constructor SM86StoreGlobal64
632field unrestricted sm86StoreGlobal64Address : SM86Register
633field unrestricted sm86StoreGlobal64Value : SM86Register
634field unrestricted sm86StoreGlobal64Offset : SM86Unsigned32
635field unrestricted sm86StoreGlobal64Control : SM86Control
636-- SASS RED.E.ADD.F32: the binary32 value atomically added to the word at address + offset in global memory, no result returned.
637constructor SM86ReduceGlobalAddFloat32
638field unrestricted sm86ReduceGlobalAddress : SM86Register
639field unrestricted sm86ReduceGlobalValue : SM86Register
640field unrestricted sm86ReduceGlobalOffset : SM86Unsigned32
641field unrestricted sm86ReduceGlobalControl : SM86Control
642-- SASS ISETP.GT (immediate): destination predicate = source > immediate, compared as
643-- unsigned 32-bit words in this encoding: the RTX 3070 has 0x80000000 > 0
644-- (Checked.IntegerCompareProbe, Proof.CheckedIntegerCompareSilicon).
645constructor SM86PredicateGreaterThanImmediate
646field unrestricted sm86PredicateGreaterDestination : SM86Predicate
647field unrestricted sm86PredicateGreaterSource : SM86Register
648field unrestricted sm86PredicateGreaterImmediate : SM86Unsigned32
649field unrestricted sm86PredicateGreaterControl : SM86Control
650-- SASS BRA: continue at the instruction offset bytes away, relative to the next instruction.
651constructor SM86Branch
652field unrestricted sm86BranchOffset : SM86Unsigned32
653field unrestricted sm86BranchDescriptor : SM86Unsigned32
654field unrestricted sm86BranchControl : SM86Control
655-- SASS EXIT: this thread finishes the program.
656constructor SM86Exit
657field unrestricted sm86ExitControl : SM86Control
658-- One of the system forms above, with its control word.
659constructor SM86System
660field unrestricted sm86SystemOperation : SM86SystemOperation
661field unrestricted sm86SystemControl : SM86Control
662
663end-family
664
665family SM86Instruction : Type 0
666constructor SM86InstructionValue
667field unrestricted sm86InstructionGuard : SM86InstructionGuard
668field unrestricted sm86InstructionBody : SM86InstructionBody
669
670end-family
671
672family SM86Program : Type 0
673constructor SM86ProgramEnd
674constructor SM86ProgramNext
675field unrestricted sm86ProgramHead : SM86Instruction
676recursive unrestricted sm86ProgramTail
677
678end-family
679
680def sm86Instruction =
681  (lambda unrestricted body : SM86InstructionBody .
682    constructor SM86Instruction SM86InstructionValue SM86InstructionAlways body)
683
684def sm86PredicatedInstruction =
685  (lambda unrestricted predicate : SM86Predicate . unrestricted body : SM86InstructionBody .
686    constructor
687      SM86Instruction
688      SM86InstructionValue
689      (constructor SM86InstructionGuard SM86InstructionWhen predicate)
690      body)
691
692def sm86NegatedPredicatedInstruction =
693  (lambda unrestricted predicate : SM86Predicate . unrestricted body : SM86InstructionBody .
694    constructor
695      SM86Instruction
696      SM86InstructionValue
697      (constructor SM86InstructionGuard SM86InstructionWhenNot predicate)
698      body)

The compiler supplied declaration spans and resolved links from this source snapshot. This page does not assert that this file belongs to a checked closure.