cuda.ptx: rearrange maybe types so that tuple slots default to f properly, and adjust output of some insns
parent
8820f3bc26
commit
0f2f54a195
|
@ -5,8 +5,8 @@ FROM: roles => TUPLE: ;
|
||||||
IN: cuda.ptx
|
IN: cuda.ptx
|
||||||
|
|
||||||
UNION: dim integer sequence ;
|
UNION: dim integer sequence ;
|
||||||
UNION: ?integer integer POSTPONE: f ;
|
UNION: ?integer POSTPONE: f integer ;
|
||||||
UNION: ?string string POSTPONE: f ;
|
UNION: ?string POSTPONE: f string ;
|
||||||
|
|
||||||
VARIANT: ptx-type
|
VARIANT: ptx-type
|
||||||
.s8 .s16 .s32 .s64
|
.s8 .s16 .s32 .s64
|
||||||
|
@ -21,11 +21,11 @@ VARIANT: ptx-type
|
||||||
|
|
||||||
VARIANT: ptx-arch
|
VARIANT: ptx-arch
|
||||||
sm_10 sm_11 sm_12 sm_13 sm_20 ;
|
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
|
VARIANT: ptx-texmode
|
||||||
.texmode_unified .texmode_independent ;
|
.texmode_unified .texmode_independent ;
|
||||||
UNION: ?ptx-texmode ptx-texmode POSTPONE: f ;
|
UNION: ?ptx-texmode POSTPONE: f ptx-texmode ;
|
||||||
|
|
||||||
VARIANT: ptx-storage-space
|
VARIANT: ptx-storage-space
|
||||||
.reg
|
.reg
|
||||||
|
@ -36,7 +36,7 @@ VARIANT: ptx-storage-space
|
||||||
.param
|
.param
|
||||||
.shared
|
.shared
|
||||||
.tex ;
|
.tex ;
|
||||||
UNION: ?ptx-storage-space ptx-storage-space POSTPONE: f ;
|
UNION: ?ptx-storage-space POSTPONE: f ptx-storage-space ;
|
||||||
|
|
||||||
TUPLE: ptx-target
|
TUPLE: ptx-target
|
||||||
{ arch ?ptx-arch }
|
{ arch ?ptx-arch }
|
||||||
|
@ -66,7 +66,7 @@ TUPLE: ptx-variable
|
||||||
TUPLE: ptx-predicate
|
TUPLE: ptx-predicate
|
||||||
{ negated? boolean }
|
{ negated? boolean }
|
||||||
{ variable string } ;
|
{ variable string } ;
|
||||||
UNION: ?ptx-predicate ptx-predicate POSTPONE: f ;
|
UNION: ?ptx-predicate POSTPONE: f ptx-predicate ;
|
||||||
|
|
||||||
TUPLE: ptx-instruction
|
TUPLE: ptx-instruction
|
||||||
{ label ?string }
|
{ label ?string }
|
||||||
|
@ -102,12 +102,12 @@ VARIANT: ptx-float-rounding-mode
|
||||||
.rn .rz .rm .rp .approx .full ;
|
.rn .rz .rm .rp .approx .full ;
|
||||||
VARIANT: ptx-int-rounding-mode
|
VARIANT: ptx-int-rounding-mode
|
||||||
.rni .rzi .rmi .rpi ;
|
.rni .rzi .rmi .rpi ;
|
||||||
UNION: ?ptx-float-rounding-mode ptx-float-rounding-mode POSTPONE: f ;
|
UNION: ?ptx-float-rounding-mode POSTPONE: f ptx-float-rounding-mode ;
|
||||||
UNION: ?ptx-int-rounding-mode ptx-int-rounding-mode POSTPONE: f ;
|
UNION: ?ptx-int-rounding-mode POSTPONE: f ptx-int-rounding-mode ;
|
||||||
|
|
||||||
UNION: ptx-rounding-mode
|
UNION: ptx-rounding-mode
|
||||||
ptx-float-rounding-mode ptx-int-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
|
TUPLE: ptx-typed-instruction < ptx-instruction
|
||||||
{ type ptx-type }
|
{ type ptx-type }
|
||||||
|
@ -137,7 +137,7 @@ TUPLE: ptx-addsub-instruction < ptx-3op-instruction
|
||||||
|
|
||||||
VARIANT: ptx-mul-mode
|
VARIANT: ptx-mul-mode
|
||||||
.wide ;
|
.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
|
TUPLE: ptx-mul-instruction < ptx-3op-instruction
|
||||||
{ mode ?ptx-mul-mode } ;
|
{ mode ?ptx-mul-mode } ;
|
||||||
|
@ -148,7 +148,7 @@ TUPLE: ptx-mad-instruction < ptx-4op-instruction
|
||||||
|
|
||||||
VARIANT: ptx-prmt-mode
|
VARIANT: ptx-prmt-mode
|
||||||
.f4e .b4e .rc8 .ecl .ecr .rc16 ;
|
.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
|
ROLE: ptx-float-ftz
|
||||||
{ ftz? boolean } ;
|
{ ftz? boolean } ;
|
||||||
|
@ -169,6 +169,7 @@ VARIANT: ptx-cmp-op
|
||||||
VARIANT: ptx-op
|
VARIANT: ptx-op
|
||||||
.and .or .xor .cas .exch .add .inc .dec .min .max
|
.and .or .xor .cas .exch .add .inc .dec .min .max
|
||||||
.popc ;
|
.popc ;
|
||||||
|
UNION: ?ptx-op POSTPONE: f ptx-op ;
|
||||||
|
|
||||||
SINGLETONS: .lo .hi ;
|
SINGLETONS: .lo .hi ;
|
||||||
INSTANCE: .lo ptx-mul-mode
|
INSTANCE: .lo ptx-mul-mode
|
||||||
|
@ -178,14 +179,14 @@ INSTANCE: .hi ptx-cmp-op
|
||||||
|
|
||||||
TUPLE: ptx-set-instruction < ptx-3op-instruction
|
TUPLE: ptx-set-instruction < ptx-3op-instruction
|
||||||
{ cmp-op ptx-cmp-op }
|
{ cmp-op ptx-cmp-op }
|
||||||
{ bool-op ptx-op }
|
{ bool-op ?ptx-op }
|
||||||
{ c ?string }
|
{ c ?string }
|
||||||
{ ftz? boolean } ;
|
{ ftz? boolean } ;
|
||||||
|
|
||||||
VARIANT: ptx-cache-op
|
VARIANT: ptx-cache-op
|
||||||
.ca .cg .cs .lu .cv
|
.ca .cg .cs .lu .cv
|
||||||
.wb .wt ;
|
.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
|
TUPLE: ptx-ldst-instruction < ptx-2op-instruction
|
||||||
{ volatile? boolean }
|
{ volatile? boolean }
|
||||||
|
@ -434,7 +435,7 @@ M: ptx-instruction ptx-element-label
|
||||||
|
|
||||||
: write-insn ( insn name -- insn )
|
: write-insn ( insn name -- insn )
|
||||||
over predicate>>
|
over predicate>>
|
||||||
[ "@" write dup negated?>> [ "!" write ] when variable>> write ] when*
|
[ "@" write dup negated?>> [ "!" write ] when variable>> write " " write ] when*
|
||||||
write ;
|
write ;
|
||||||
|
|
||||||
: write-2op ( insn -- )
|
: write-2op ( insn -- )
|
||||||
|
@ -710,7 +711,11 @@ M: set (write-ptx-element)
|
||||||
M: setp (write-ptx-element)
|
M: setp (write-ptx-element)
|
||||||
"setp" write-insn
|
"setp" write-insn
|
||||||
dup write-set
|
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* ;
|
c>> [ ", " write write ] when* ;
|
||||||
M: shl (write-ptx-element)
|
M: shl (write-ptx-element)
|
||||||
"shl" write-insn
|
"shl" write-insn
|
||||||
|
|
Loading…
Reference in New Issue