IN: cuda.ptx
UNION: dim integer sequence ;
-UNION: ?integer integer POSTPONE: f ;
-UNION: ?string string POSTPONE: f ;
+UNION: ?integer POSTPONE: f integer ;
+UNION: ?string POSTPONE: f string ;
VARIANT: ptx-type
.s8 .s16 .s32 .s64
VARIANT: ptx-arch
sm_10 sm_11 sm_12 sm_13 sm_20 ;
-UNION: ?ptx-arch ptx-arch POSTPONE: f ;
+UNION: ?ptx-arch POSTPONE: f ptx-arch ;
VARIANT: ptx-texmode
.texmode_unified .texmode_independent ;
-UNION: ?ptx-texmode ptx-texmode POSTPONE: f ;
+UNION: ?ptx-texmode POSTPONE: f ptx-texmode ;
VARIANT: ptx-storage-space
.reg
.param
.shared
.tex ;
-UNION: ?ptx-storage-space ptx-storage-space POSTPONE: f ;
+UNION: ?ptx-storage-space POSTPONE: f ptx-storage-space ;
TUPLE: ptx-target
{ arch ?ptx-arch }
TUPLE: ptx-predicate
{ negated? boolean }
{ variable string } ;
-UNION: ?ptx-predicate ptx-predicate POSTPONE: f ;
+UNION: ?ptx-predicate POSTPONE: f ptx-predicate ;
TUPLE: ptx-instruction
{ label ?string }
.rn .rz .rm .rp .approx .full ;
VARIANT: ptx-int-rounding-mode
.rni .rzi .rmi .rpi ;
-UNION: ?ptx-float-rounding-mode ptx-float-rounding-mode POSTPONE: f ;
-UNION: ?ptx-int-rounding-mode ptx-int-rounding-mode POSTPONE: f ;
+UNION: ?ptx-float-rounding-mode POSTPONE: f ptx-float-rounding-mode ;
+UNION: ?ptx-int-rounding-mode POSTPONE: f ptx-int-rounding-mode ;
UNION: ptx-rounding-mode
ptx-float-rounding-mode ptx-int-rounding-mode ;
-UNION: ?ptx-rounding-mode ptx-rounding-mode POSTPONE: f ;
+UNION: ?ptx-rounding-mode POSTPONE: f ptx-rounding-mode ;
TUPLE: ptx-typed-instruction < ptx-instruction
{ type ptx-type }
VARIANT: ptx-mul-mode
.wide ;
-UNION: ?ptx-mul-mode ptx-mul-mode POSTPONE: f ;
+UNION: ?ptx-mul-mode POSTPONE: f ptx-mul-mode ;
TUPLE: ptx-mul-instruction < ptx-3op-instruction
{ mode ?ptx-mul-mode } ;
VARIANT: ptx-prmt-mode
.f4e .b4e .rc8 .ecl .ecr .rc16 ;
-UNION: ?ptx-prmt-mode ptx-prmt-mode POSTPONE: f ;
+UNION: ?ptx-prmt-mode POSTPONE: f ptx-prmt-mode ;
ROLE: ptx-float-ftz
{ ftz? boolean } ;
VARIANT: ptx-op
.and .or .xor .cas .exch .add .inc .dec .min .max
.popc ;
+UNION: ?ptx-op POSTPONE: f ptx-op ;
SINGLETONS: .lo .hi ;
INSTANCE: .lo ptx-mul-mode
TUPLE: ptx-set-instruction < ptx-3op-instruction
{ cmp-op ptx-cmp-op }
- { bool-op ptx-op }
+ { bool-op ?ptx-op }
{ c ?string }
{ ftz? boolean } ;
VARIANT: ptx-cache-op
.ca .cg .cs .lu .cv
.wb .wt ;
-UNION: ?ptx-cache-op ptx-cache-op POSTPONE: f ;
+UNION: ?ptx-cache-op POSTPONE: f ptx-cache-op ;
TUPLE: ptx-ldst-instruction < ptx-2op-instruction
{ volatile? boolean }
: write-insn ( insn name -- insn )
over predicate>>
- [ "@" write dup negated?>> [ "!" write ] when variable>> write ] when*
+ [ "@" write dup negated?>> [ "!" write ] when variable>> write " " write ] when*
write ;
: write-2op ( insn -- )
M: setp (write-ptx-element)
"setp" write-insn
dup write-set
- dup write-3op
+ dup type>> (write-ptx-element) " " write
+ dup dest>> write
+ dup |dest>> [ "|" write write ] when* ", " write
+ dup a>> write ", " write
+ dup b>> write
c>> [ ", " write write ] when* ;
M: shl (write-ptx-element)
"shl" write-insn