Commit e00dc7c6 authored by catchyrime's avatar catchyrime
Browse files

Add Seek

parents
Pipeline #121 canceled with stages
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
"""
THIS FILE IS AUTO GENERATED.
ANY MODIFICATION WILL BE LOST AFTER REGENERATION.
"""
# flake8: noqa
# noinspection PyUnresolvedReferences
from typing import Optional, Hashable, Dict, Set
# noinspection PyUnresolvedReferences
from .autogen_validate_operands import *
# noinspection PyUnresolvedReferences
from .autogen_validate_modifiers import *
# noinspection PyUnresolvedReferences
from ...basic.instr import InstrCall, MemToken, SrcLoc
# noinspection DuplicatedCode,PyDictCreation
def v_pk_add_f16(vdst, src0, src1, /, op_sel=None, op_sel_hi=None, neg_lo=None, neg_hi=None, clamp=None, comment: str = None, srcloc: Optional[SrcLoc] = None):
"""
Instruction: v_pk_add_f16
Operands:
dst: vdst/*synid-gfx9-vdst*/
src0: src0/*synid-gfx9-src-8*/
src1: src1/*synid-gfx9-src-1*/
Modifiers:
op_sel/*synid-op-sel*/
op_sel_hi/*synid-op-sel-hi*/
neg_lo/*synid-neg-lo*/
neg_hi/*synid-neg-hi*/
clamp/*synid-clamp*/
"""
# Prepare for a new instruction call
operands = {'vdst': vdst, 'src0': src0, 'src1': src1}
modifiers = {'op_sel': op_sel, 'op_sel_hi': op_sel_hi, 'neg_lo': neg_lo, 'neg_hi': neg_hi, 'clamp': clamp}
# Operands validation
validate_operand_synid_gfx9_vdst('vop3p', 'v_pk_add_f16', operands, modifiers, 'vdst', vdst)
validate_operand_synid_gfx9_src_8('vop3p', 'v_pk_add_f16', operands, modifiers, 'src0', src0)
validate_operand_synid_gfx9_src_1('vop3p', 'v_pk_add_f16', operands, modifiers, 'src1', src1)
# Modifiers validation
validate_modifier_synid_op_sel('vop3p', 'v_pk_add_f16', operands, modifiers, 'op_sel', op_sel)
validate_modifier_synid_op_sel_hi('vop3p', 'v_pk_add_f16', operands, modifiers, 'op_sel_hi', op_sel_hi)
validate_modifier_synid_neg_lo('vop3p', 'v_pk_add_f16', operands, modifiers, 'neg_lo', neg_lo)
validate_modifier_synid_neg_hi('vop3p', 'v_pk_add_f16', operands, modifiers, 'neg_hi', neg_hi)
validate_modifier_synid_clamp('vop3p', 'v_pk_add_f16', operands, modifiers, 'clamp', clamp)
# Generate the source location
if srcloc is None:
srcloc = SrcLoc.get_caller_srcloc()
# Generate memory token
mem_token = None # this instruction does not access memory
# Generate the instruction call
call = InstrCall('vop3p', 'v_pk_add_f16', operands, modifiers, mem_token, comment, srcloc)
# Do we use/hold/define any Gpr
call.add_gpr_uses(exec, src0, src1)
call.add_gpr_defs(vdst)
# Add instruction call to current block
call.add_to_current_block()
# noinspection DuplicatedCode,PyDictCreation
def v_pk_add_i16(vdst, src0, src1, /, op_sel=None, op_sel_hi=None, clamp=None, comment: str = None, srcloc: Optional[SrcLoc] = None):
"""
Instruction: v_pk_add_i16
Operands:
dst: vdst/*synid-gfx9-vdst*/
src0: src0/*synid-gfx9-src-10*/
src1: src1/*synid-gfx9-src-4*/
Modifiers:
op_sel/*synid-op-sel*/
op_sel_hi/*synid-op-sel-hi*/
clamp/*synid-clamp*/
"""
# Prepare for a new instruction call
operands = {'vdst': vdst, 'src0': src0, 'src1': src1}
modifiers = {'op_sel': op_sel, 'op_sel_hi': op_sel_hi, 'clamp': clamp}
# Operands validation
validate_operand_synid_gfx9_vdst('vop3p', 'v_pk_add_i16', operands, modifiers, 'vdst', vdst)
validate_operand_synid_gfx9_src_10('vop3p', 'v_pk_add_i16', operands, modifiers, 'src0', src0)
validate_operand_synid_gfx9_src_4('vop3p', 'v_pk_add_i16', operands, modifiers, 'src1', src1)
# Modifiers validation
validate_modifier_synid_op_sel('vop3p', 'v_pk_add_i16', operands, modifiers, 'op_sel', op_sel)
validate_modifier_synid_op_sel_hi('vop3p', 'v_pk_add_i16', operands, modifiers, 'op_sel_hi', op_sel_hi)
validate_modifier_synid_clamp('vop3p', 'v_pk_add_i16', operands, modifiers, 'clamp', clamp)
# Generate the source location
if srcloc is None:
srcloc = SrcLoc.get_caller_srcloc()
# Generate memory token
mem_token = None # this instruction does not access memory
# Generate the instruction call
call = InstrCall('vop3p', 'v_pk_add_i16', operands, modifiers, mem_token, comment, srcloc)
# Do we use/hold/define any Gpr
call.add_gpr_uses(exec, src0, src1)
call.add_gpr_defs(vdst)
# Add instruction call to current block
call.add_to_current_block()
# noinspection DuplicatedCode,PyDictCreation
def v_pk_add_u16(vdst, src0, src1, /, op_sel=None, op_sel_hi=None, clamp=None, comment: str = None, srcloc: Optional[SrcLoc] = None):
"""
Instruction: v_pk_add_u16
Operands:
dst: vdst/*synid-gfx9-vdst*/
src0: src0/*synid-gfx9-src-10*/
src1: src1/*synid-gfx9-src-4*/
Modifiers:
op_sel/*synid-op-sel*/
op_sel_hi/*synid-op-sel-hi*/
clamp/*synid-clamp*/
"""
# Prepare for a new instruction call
operands = {'vdst': vdst, 'src0': src0, 'src1': src1}
modifiers = {'op_sel': op_sel, 'op_sel_hi': op_sel_hi, 'clamp': clamp}
# Operands validation
validate_operand_synid_gfx9_vdst('vop3p', 'v_pk_add_u16', operands, modifiers, 'vdst', vdst)
validate_operand_synid_gfx9_src_10('vop3p', 'v_pk_add_u16', operands, modifiers, 'src0', src0)
validate_operand_synid_gfx9_src_4('vop3p', 'v_pk_add_u16', operands, modifiers, 'src1', src1)
# Modifiers validation
validate_modifier_synid_op_sel('vop3p', 'v_pk_add_u16', operands, modifiers, 'op_sel', op_sel)
validate_modifier_synid_op_sel_hi('vop3p', 'v_pk_add_u16', operands, modifiers, 'op_sel_hi', op_sel_hi)
validate_modifier_synid_clamp('vop3p', 'v_pk_add_u16', operands, modifiers, 'clamp', clamp)
# Generate the source location
if srcloc is None:
srcloc = SrcLoc.get_caller_srcloc()
# Generate memory token
mem_token = None # this instruction does not access memory
# Generate the instruction call
call = InstrCall('vop3p', 'v_pk_add_u16', operands, modifiers, mem_token, comment, srcloc)
# Do we use/hold/define any Gpr
call.add_gpr_uses(exec, src0, src1)
call.add_gpr_defs(vdst)
# Add instruction call to current block
call.add_to_current_block()
# noinspection DuplicatedCode,PyDictCreation
def v_pk_ashrrev_i16(vdst, src0, src1, /, op_sel=None, op_sel_hi=None, comment: str = None, srcloc: Optional[SrcLoc] = None):
"""
Instruction: v_pk_ashrrev_i16
Operands:
dst: vdst/*synid-gfx9-vdst*/
src0: src0/*synid-gfx9-src-4*/:u16x2/*synid-gfx9-type-deviation*/
src1: src1/*synid-gfx9-src-4*/
Modifiers:
op_sel/*synid-op-sel*/
op_sel_hi/*synid-op-sel-hi*/
"""
# Prepare for a new instruction call
operands = {'vdst': vdst, 'src0': src0, 'src1': src1}
modifiers = {'op_sel': op_sel, 'op_sel_hi': op_sel_hi}
# Operands validation
validate_operand_synid_gfx9_vdst('vop3p', 'v_pk_ashrrev_i16', operands, modifiers, 'vdst', vdst)
validate_operand_synid_gfx9_src_4('vop3p', 'v_pk_ashrrev_i16', operands, modifiers, 'src0', src0)
validate_operand_synid_gfx9_src_4('vop3p', 'v_pk_ashrrev_i16', operands, modifiers, 'src1', src1)
# Modifiers validation
validate_modifier_synid_op_sel('vop3p', 'v_pk_ashrrev_i16', operands, modifiers, 'op_sel', op_sel)
validate_modifier_synid_op_sel_hi('vop3p', 'v_pk_ashrrev_i16', operands, modifiers, 'op_sel_hi', op_sel_hi)
# Generate the source location
if srcloc is None:
srcloc = SrcLoc.get_caller_srcloc()
# Generate memory token
mem_token = None # this instruction does not access memory
# Generate the instruction call
call = InstrCall('vop3p', 'v_pk_ashrrev_i16', operands, modifiers, mem_token, comment, srcloc)
# Do we use/hold/define any Gpr
call.add_gpr_uses(exec, src0, src1)
call.add_gpr_defs(vdst)
# Add instruction call to current block
call.add_to_current_block()
# noinspection DuplicatedCode,PyDictCreation
def v_pk_fma_f16(vdst, src0, src1, src2, /, op_sel=None, op_sel_hi=None, neg_lo=None, neg_hi=None, clamp=None, comment: str = None, srcloc: Optional[SrcLoc] = None):
"""
Instruction: v_pk_fma_f16
Operands:
dst: vdst/*synid-gfx9-vdst*/
src0: src0/*synid-gfx9-src-8*/
src1: src1/*synid-gfx9-src-1*/
src2: src2/*synid-gfx9-src-1*/
Modifiers:
op_sel/*synid-op-sel*/
op_sel_hi/*synid-op-sel-hi*/
neg_lo/*synid-neg-lo*/
neg_hi/*synid-neg-hi*/
clamp/*synid-clamp*/
"""
# Prepare for a new instruction call
operands = {'vdst': vdst, 'src0': src0, 'src1': src1, 'src2': src2}
modifiers = {'op_sel': op_sel, 'op_sel_hi': op_sel_hi, 'neg_lo': neg_lo, 'neg_hi': neg_hi, 'clamp': clamp}
# Operands validation
validate_operand_synid_gfx9_vdst('vop3p', 'v_pk_fma_f16', operands, modifiers, 'vdst', vdst)
validate_operand_synid_gfx9_src_8('vop3p', 'v_pk_fma_f16', operands, modifiers, 'src0', src0)
validate_operand_synid_gfx9_src_1('vop3p', 'v_pk_fma_f16', operands, modifiers, 'src1', src1)
validate_operand_synid_gfx9_src_1('vop3p', 'v_pk_fma_f16', operands, modifiers, 'src2', src2)
# Modifiers validation
validate_modifier_synid_op_sel('vop3p', 'v_pk_fma_f16', operands, modifiers, 'op_sel', op_sel)
validate_modifier_synid_op_sel_hi('vop3p', 'v_pk_fma_f16', operands, modifiers, 'op_sel_hi', op_sel_hi)
validate_modifier_synid_neg_lo('vop3p', 'v_pk_fma_f16', operands, modifiers, 'neg_lo', neg_lo)
validate_modifier_synid_neg_hi('vop3p', 'v_pk_fma_f16', operands, modifiers, 'neg_hi', neg_hi)
validate_modifier_synid_clamp('vop3p', 'v_pk_fma_f16', operands, modifiers, 'clamp', clamp)
# Generate the source location
if srcloc is None:
srcloc = SrcLoc.get_caller_srcloc()
# Generate memory token
mem_token = None # this instruction does not access memory
# Generate the instruction call
call = InstrCall('vop3p', 'v_pk_fma_f16', operands, modifiers, mem_token, comment, srcloc)
# Do we use/hold/define any Gpr
call.add_gpr_uses(exec, src0, src1, src2)
call.add_gpr_defs(vdst)
# Add instruction call to current block
call.add_to_current_block()
# noinspection DuplicatedCode,PyDictCreation
def v_pk_lshlrev_b16(vdst, src0, src1, /, op_sel=None, op_sel_hi=None, comment: str = None, srcloc: Optional[SrcLoc] = None):
"""
Instruction: v_pk_lshlrev_b16
Operands:
dst: vdst/*synid-gfx9-vdst*/
src0: src0/*synid-gfx9-src-4*/:u16x2/*synid-gfx9-type-deviation*/
src1: src1/*synid-gfx9-src-4*/
Modifiers:
op_sel/*synid-op-sel*/
op_sel_hi/*synid-op-sel-hi*/
"""
# Prepare for a new instruction call
operands = {'vdst': vdst, 'src0': src0, 'src1': src1}
modifiers = {'op_sel': op_sel, 'op_sel_hi': op_sel_hi}
# Operands validation
validate_operand_synid_gfx9_vdst('vop3p', 'v_pk_lshlrev_b16', operands, modifiers, 'vdst', vdst)
validate_operand_synid_gfx9_src_4('vop3p', 'v_pk_lshlrev_b16', operands, modifiers, 'src0', src0)
validate_operand_synid_gfx9_src_4('vop3p', 'v_pk_lshlrev_b16', operands, modifiers, 'src1', src1)
# Modifiers validation
validate_modifier_synid_op_sel('vop3p', 'v_pk_lshlrev_b16', operands, modifiers, 'op_sel', op_sel)
validate_modifier_synid_op_sel_hi('vop3p', 'v_pk_lshlrev_b16', operands, modifiers, 'op_sel_hi', op_sel_hi)
# Generate the source location
if srcloc is None:
srcloc = SrcLoc.get_caller_srcloc()
# Generate memory token
mem_token = None # this instruction does not access memory
# Generate the instruction call
call = InstrCall('vop3p', 'v_pk_lshlrev_b16', operands, modifiers, mem_token, comment, srcloc)
# Do we use/hold/define any Gpr
call.add_gpr_uses(exec, src0, src1)
call.add_gpr_defs(vdst)
# Add instruction call to current block
call.add_to_current_block()
# noinspection DuplicatedCode,PyDictCreation
def v_pk_lshrrev_b16(vdst, src0, src1, /, op_sel=None, op_sel_hi=None, comment: str = None, srcloc: Optional[SrcLoc] = None):
"""
Instruction: v_pk_lshrrev_b16
Operands:
dst: vdst/*synid-gfx9-vdst*/
src0: src0/*synid-gfx9-src-4*/:u16x2/*synid-gfx9-type-deviation*/
src1: src1/*synid-gfx9-src-4*/
Modifiers:
op_sel/*synid-op-sel*/
op_sel_hi/*synid-op-sel-hi*/
"""
# Prepare for a new instruction call
operands = {'vdst': vdst, 'src0': src0, 'src1': src1}
modifiers = {'op_sel': op_sel, 'op_sel_hi': op_sel_hi}
# Operands validation
validate_operand_synid_gfx9_vdst('vop3p', 'v_pk_lshrrev_b16', operands, modifiers, 'vdst', vdst)
validate_operand_synid_gfx9_src_4('vop3p', 'v_pk_lshrrev_b16', operands, modifiers, 'src0', src0)
validate_operand_synid_gfx9_src_4('vop3p', 'v_pk_lshrrev_b16', operands, modifiers, 'src1', src1)
# Modifiers validation
validate_modifier_synid_op_sel('vop3p', 'v_pk_lshrrev_b16', operands, modifiers, 'op_sel', op_sel)
validate_modifier_synid_op_sel_hi('vop3p', 'v_pk_lshrrev_b16', operands, modifiers, 'op_sel_hi', op_sel_hi)
# Generate the source location
if srcloc is None:
srcloc = SrcLoc.get_caller_srcloc()
# Generate memory token
mem_token = None # this instruction does not access memory
# Generate the instruction call
call = InstrCall('vop3p', 'v_pk_lshrrev_b16', operands, modifiers, mem_token, comment, srcloc)
# Do we use/hold/define any Gpr
call.add_gpr_uses(exec, src0, src1)
call.add_gpr_defs(vdst)
# Add instruction call to current block
call.add_to_current_block()
# noinspection DuplicatedCode,PyDictCreation
def v_pk_mad_i16(vdst, src0, src1, src2, /, op_sel=None, op_sel_hi=None, clamp=None, comment: str = None, srcloc: Optional[SrcLoc] = None):
"""
Instruction: v_pk_mad_i16
Operands:
dst: vdst/*synid-gfx9-vdst*/
src0: src0/*synid-gfx9-src-10*/
src1: src1/*synid-gfx9-src-4*/
src2: src2/*synid-gfx9-src-4*/
Modifiers:
op_sel/*synid-op-sel*/
op_sel_hi/*synid-op-sel-hi*/
clamp/*synid-clamp*/
"""
# Prepare for a new instruction call
operands = {'vdst': vdst, 'src0': src0, 'src1': src1, 'src2': src2}
modifiers = {'op_sel': op_sel, 'op_sel_hi': op_sel_hi, 'clamp': clamp}
# Operands validation
validate_operand_synid_gfx9_vdst('vop3p', 'v_pk_mad_i16', operands, modifiers, 'vdst', vdst)
validate_operand_synid_gfx9_src_10('vop3p', 'v_pk_mad_i16', operands, modifiers, 'src0', src0)
validate_operand_synid_gfx9_src_4('vop3p', 'v_pk_mad_i16', operands, modifiers, 'src1', src1)
validate_operand_synid_gfx9_src_4('vop3p', 'v_pk_mad_i16', operands, modifiers, 'src2', src2)
# Modifiers validation
validate_modifier_synid_op_sel('vop3p', 'v_pk_mad_i16', operands, modifiers, 'op_sel', op_sel)
validate_modifier_synid_op_sel_hi('vop3p', 'v_pk_mad_i16', operands, modifiers, 'op_sel_hi', op_sel_hi)
validate_modifier_synid_clamp('vop3p', 'v_pk_mad_i16', operands, modifiers, 'clamp', clamp)
# Generate the source location
if srcloc is None:
srcloc = SrcLoc.get_caller_srcloc()
# Generate memory token
mem_token = None # this instruction does not access memory
# Generate the instruction call
call = InstrCall('vop3p', 'v_pk_mad_i16', operands, modifiers, mem_token, comment, srcloc)
# Do we use/hold/define any Gpr
call.add_gpr_uses(exec, src0, src1, src2)
call.add_gpr_defs(vdst)
# Add instruction call to current block
call.add_to_current_block()
# noinspection DuplicatedCode,PyDictCreation
def v_pk_mad_u16(vdst, src0, src1, src2, /, op_sel=None, op_sel_hi=None, clamp=None, comment: str = None, srcloc: Optional[SrcLoc] = None):
"""
Instruction: v_pk_mad_u16
Operands:
dst: vdst/*synid-gfx9-vdst*/
src0: src0/*synid-gfx9-src-10*/
src1: src1/*synid-gfx9-src-4*/
src2: src2/*synid-gfx9-src-4*/
Modifiers:
op_sel/*synid-op-sel*/
op_sel_hi/*synid-op-sel-hi*/
clamp/*synid-clamp*/
"""
# Prepare for a new instruction call
operands = {'vdst': vdst, 'src0': src0, 'src1': src1, 'src2': src2}
modifiers = {'op_sel': op_sel, 'op_sel_hi': op_sel_hi, 'clamp': clamp}
# Operands validation
validate_operand_synid_gfx9_vdst('vop3p', 'v_pk_mad_u16', operands, modifiers, 'vdst', vdst)
validate_operand_synid_gfx9_src_10('vop3p', 'v_pk_mad_u16', operands, modifiers, 'src0', src0)
validate_operand_synid_gfx9_src_4('vop3p', 'v_pk_mad_u16', operands, modifiers, 'src1', src1)
validate_operand_synid_gfx9_src_4('vop3p', 'v_pk_mad_u16', operands, modifiers, 'src2', src2)
# Modifiers validation
validate_modifier_synid_op_sel('vop3p', 'v_pk_mad_u16', operands, modifiers, 'op_sel', op_sel)
validate_modifier_synid_op_sel_hi('vop3p', 'v_pk_mad_u16', operands, modifiers, 'op_sel_hi', op_sel_hi)
validate_modifier_synid_clamp('vop3p', 'v_pk_mad_u16', operands, modifiers, 'clamp', clamp)
# Generate the source location
if srcloc is None:
srcloc = SrcLoc.get_caller_srcloc()
# Generate memory token
mem_token = None # this instruction does not access memory
# Generate the instruction call
call = InstrCall('vop3p', 'v_pk_mad_u16', operands, modifiers, mem_token, comment, srcloc)
# Do we use/hold/define any Gpr
call.add_gpr_uses(exec, src0, src1, src2)
call.add_gpr_defs(vdst)
# Add instruction call to current block
call.add_to_current_block()
# noinspection DuplicatedCode,PyDictCreation
def v_pk_max_f16(vdst, src0, src1, /, op_sel=None, op_sel_hi=None, neg_lo=None, neg_hi=None, clamp=None, comment: str = None, srcloc: Optional[SrcLoc] = None):
"""
Instruction: v_pk_max_f16
Operands:
dst: vdst/*synid-gfx9-vdst*/
src0: src0/*synid-gfx9-src-8*/
src1: src1/*synid-gfx9-src-1*/
Modifiers:
op_sel/*synid-op-sel*/
op_sel_hi/*synid-op-sel-hi*/
neg_lo/*synid-neg-lo*/
neg_hi/*synid-neg-hi*/
clamp/*synid-clamp*/
"""
# Prepare for a new instruction call
operands = {'vdst': vdst, 'src0': src0, 'src1': src1}
modifiers = {'op_sel': op_sel, 'op_sel_hi': op_sel_hi, 'neg_lo': neg_lo, 'neg_hi': neg_hi, 'clamp': clamp}
# Operands validation
validate_operand_synid_gfx9_vdst('vop3p', 'v_pk_max_f16', operands, modifiers, 'vdst', vdst)
validate_operand_synid_gfx9_src_8('vop3p', 'v_pk_max_f16', operands, modifiers, 'src0', src0)
validate_operand_synid_gfx9_src_1('vop3p', 'v_pk_max_f16', operands, modifiers, 'src1', src1)
# Modifiers validation
validate_modifier_synid_op_sel('vop3p', 'v_pk_max_f16', operands, modifiers, 'op_sel', op_sel)
validate_modifier_synid_op_sel_hi('vop3p', 'v_pk_max_f16', operands, modifiers, 'op_sel_hi', op_sel_hi)
validate_modifier_synid_neg_lo('vop3p', 'v_pk_max_f16', operands, modifiers, 'neg_lo', neg_lo)
validate_modifier_synid_neg_hi('vop3p', 'v_pk_max_f16', operands, modifiers, 'neg_hi', neg_hi)
validate_modifier_synid_clamp('vop3p', 'v_pk_max_f16', operands, modifiers, 'clamp', clamp)
# Generate the source location
if srcloc is None:
srcloc = SrcLoc.get_caller_srcloc()
# Generate memory token
mem_token = None # this instruction does not access memory
# Generate the instruction call
call = InstrCall('vop3p', 'v_pk_max_f16', operands, modifiers, mem_token, comment, srcloc)
# Do we use/hold/define any Gpr
call.add_gpr_uses(exec, src0, src1)
call.add_gpr_defs(vdst)
# Add instruction call to current block
call.add_to_current_block()
# noinspection DuplicatedCode,PyDictCreation
def v_pk_max_i16(vdst, src0, src1, /, op_sel=None, op_sel_hi=None, comment: str = None, srcloc: Optional[SrcLoc] = None):
"""
Instruction: v_pk_max_i16
Operands:
dst: vdst/*synid-gfx9-vdst*/
src0: src0/*synid-gfx9-src-10*/
src1: src1/*synid-gfx9-src-4*/
Modifiers:
op_sel/*synid-op-sel*/
op_sel_hi/*synid-op-sel-hi*/
"""
# Prepare for a new instruction call
operands = {'vdst': vdst, 'src0': src0, 'src1': src1}
modifiers = {'op_sel': op_sel, 'op_sel_hi': op_sel_hi}
# Operands validation
validate_operand_synid_gfx9_vdst('vop3p', 'v_pk_max_i16', operands, modifiers, 'vdst', vdst)
validate_operand_synid_gfx9_src_10('vop3p', 'v_pk_max_i16', operands, modifiers, 'src0', src0)
validate_operand_synid_gfx9_src_4('vop3p', 'v_pk_max_i16', operands, modifiers, 'src1', src1)
# Modifiers validation
validate_modifier_synid_op_sel('vop3p', 'v_pk_max_i16', operands, modifiers, 'op_sel', op_sel)
validate_modifier_synid_op_sel_hi('vop3p', 'v_pk_max_i16', operands, modifiers, 'op_sel_hi', op_sel_hi)
# Generate the source location
if srcloc is None:
srcloc = SrcLoc.get_caller_srcloc()
# Generate memory token
mem_token = None # this instruction does not access memory
# Generate the instruction call
call = InstrCall('vop3p', 'v_pk_max_i16', operands, modifiers, mem_token, comment, srcloc)
# Do we use/hold/define any Gpr
call.add_gpr_uses(exec, src0, src1)
call.add_gpr_defs(vdst)
# Add instruction call to current block
call.add_to_current_block()
# noinspection DuplicatedCode,PyDictCreation
def v_pk_max_u16(vdst, src0, src1, /, op_sel=None, op_sel_hi=None, comment: str = None, srcloc: Optional[SrcLoc] = None):
"""
Instruction: v_pk_max_u16
Operands:
dst: vdst/*synid-gfx9-vdst*/
src0: src0/*synid-gfx9-src-10*/
src1: src1/*synid-gfx9-src-4*/
Modifiers:
op_sel/*synid-op-sel*/
op_sel_hi/*synid-op-sel-hi*/
"""
# Prepare for a new instruction call
operands = {'vdst': vdst, 'src0': src0, 'src1': src1}
modifiers = {'op_sel': op_sel, 'op_sel_hi': op_sel_hi}
# Operands validation
validate_operand_synid_gfx9_vdst('vop3p', 'v_pk_max_u16', operands, modifiers, 'vdst', vdst)
validate_operand_synid_gfx9_src_10('vop3p', 'v_pk_max_u16', operands, modifiers, 'src0', src0)
validate_operand_synid_gfx9_src_4('vop3p', 'v_pk_max_u16', operands, modifiers, 'src1', src1)
# Modifiers validation
validate_modifier_synid_op_sel('vop3p', 'v_pk_max_u16', operands, modifiers, 'op_sel', op_sel)
validate_modifier_synid_op_sel_hi('vop3p', 'v_pk_max_u16', operands, modifiers, 'op_sel_hi', op_sel_hi)
# Generate the source location
if srcloc is None:
srcloc = SrcLoc.get_caller_srcloc()
# Generate memory token
mem_token = None # this instruction does not access memory
# Generate the instruction call
call = InstrCall('vop3p', 'v_pk_max_u16', operands, modifiers, mem_token, comment, srcloc)
# Do we use/hold/define any Gpr
call.add_gpr_uses(exec, src0, src1)
call.add_gpr_defs(vdst)
# Add instruction call to current block
call.add_to_current_block()
# noinspection DuplicatedCode,PyDictCreation
def v_pk_min_f16(vdst, src0, src1, /, op_sel=None, op_sel_hi=None, neg_lo=None, neg_hi=None, clamp=None, comment: str = None, srcloc: Optional[SrcLoc] = None):
"""
Instruction: v_pk_min_f16
Operands:
dst: vdst/*synid-gfx9-vdst*/
src0: src0/*synid-gfx9-src-8*/
src1: src1/*synid-gfx9-src-1*/
Modifiers:
op_sel/*synid-op-sel*/
op_sel_hi/*synid-op-sel-hi*/
neg_lo/*synid-neg-lo*/
neg_hi/*synid-neg-hi*/
clamp/*synid-clamp*/
"""
# Prepare for a new instruction call
operands = {'vdst': vdst, 'src0': src0, 'src1': src1}
modifiers = {'op_sel': op_sel, 'op_sel_hi': op_sel_hi, 'neg_lo': neg_lo, 'neg_hi': neg_hi, 'clamp': clamp}
# Operands validation
validate_operand_synid_gfx9_vdst('vop3p', 'v_pk_min_f16', operands, modifiers, 'vdst', vdst)
validate_operand_synid_gfx9_src_8('vop3p', 'v_pk_min_f16', operands, modifiers, 'src0', src0)
validate_operand_synid_gfx9_src_1('vop3p', 'v_pk_min_f16', operands, modifiers, 'src1', src1)
# Modifiers validation
validate_modifier_synid_op_sel('vop3p', 'v_pk_min_f16', operands, modifiers, 'op_sel', op_sel)
validate_modifier_synid_op_sel_hi('vop3p', 'v_pk_min_f16', operands, modifiers, 'op_sel_hi', op_sel_hi)
validate_modifier_synid_neg_lo('vop3p', 'v_pk_min_f16', operands, modifiers, 'neg_lo', neg_lo)
validate_modifier_synid_neg_hi('vop3p', 'v_pk_min_f16', operands, modifiers, 'neg_hi', neg_hi)
validate_modifier_synid_clamp('vop3p', 'v_pk_min_f16', operands, modifiers, 'clamp', clamp)
# Generate the source location
if srcloc is None:
srcloc = SrcLoc.get_caller_srcloc()
# Generate memory token
mem_token = None # this instruction does not access memory
# Generate the instruction call
call = InstrCall('vop3p', 'v_pk_min_f16', operands, modifiers, mem_token, comment, srcloc)
# Do we use/hold/define any Gpr
call.add_gpr_uses(exec, src0, src1)
call.add_gpr_defs(vdst)
# Add instruction call to current block
call.add_to_current_block()
# noinspection DuplicatedCode,PyDictCreation
def v_pk_min_i16(vdst, src0, src1, /, op_sel=None, op_sel_hi=None, comment: str = None, srcloc: Optional[SrcLoc] = None):
"""
Instruction: v_pk_min_i16
Operands:
dst: vdst/*synid-gfx9-vdst*/
src0: src0/*synid-gfx9-src-10*/
src1: src1/*synid-gfx9-src-4*/
Modifiers:
op_sel/*synid-op-sel*/
op_sel_hi/*synid-op-sel-hi*/
"""
# Prepare for a new instruction call
operands = {'vdst': vdst, 'src0': src0, 'src1': src1}
modifiers = {'op_sel': op_sel, 'op_sel_hi': op_sel_hi}
# Operands validation
validate_operand_synid_gfx9_vdst('vop3p', 'v_pk_min_i16', operands, modifiers, 'vdst', vdst)
validate_operand_synid_gfx9_src_10('vop3p', 'v_pk_min_i16', operands, modifiers, 'src0', src0)
validate_operand_synid_gfx9_src_4('vop3p', 'v_pk_min_i16', operands, modifiers, 'src1', src1)
# Modifiers validation
validate_modifier_synid_op_sel('vop3p', 'v_pk_min_i16', operands, modifiers, 'op_sel', op_sel)
validate_modifier_synid_op_sel_hi('vop3p', 'v_pk_min_i16', operands, modifiers, 'op_sel_hi', op_sel_hi)
# Generate the source location
if srcloc is None:
srcloc = SrcLoc.get_caller_srcloc()
# Generate memory token
mem_token = None # this instruction does not access memory
# Generate the instruction call
call = InstrCall('vop3p', 'v_pk_min_i16', operands, modifiers, mem_token, comment, srcloc)
# Do we use/hold/define any Gpr
call.add_gpr_uses(exec, src0, src1)
call.add_gpr_defs(vdst)
# Add instruction call to current block
call.add_to_current_block()
# noinspection DuplicatedCode,PyDictCreation
def v_pk_min_u16(vdst, src0, src1, /, op_sel=None, op_sel_hi=None, comment: str = None, srcloc: Optional[SrcLoc] = None):
"""
Instruction: v_pk_min_u16
Operands:
dst: vdst/*synid-gfx9-vdst*/
src0: src0/*synid-gfx9-src-10*/
src1: src1/*synid-gfx9-src-4*/
Modifiers:
op_sel/*synid-op-sel*/
op_sel_hi/*synid-op-sel-hi*/
"""
# Prepare for a new instruction call
operands = {'vdst': vdst, 'src0': src0, 'src1': src1}
modifiers = {'op_sel': op_sel, 'op_sel_hi': op_sel_hi}
# Operands validation
validate_operand_synid_gfx9_vdst('vop3p', 'v_pk_min_u16', operands, modifiers, 'vdst', vdst)
validate_operand_synid_gfx9_src_10('vop3p', 'v_pk_min_u16', operands, modifiers, 'src0', src0)
validate_operand_synid_gfx9_src_4('vop3p', 'v_pk_min_u16', operands, modifiers, 'src1', src1)
# Modifiers validation
validate_modifier_synid_op_sel('vop3p', 'v_pk_min_u16', operands, modifiers, 'op_sel', op_sel)
validate_modifier_synid_op_sel_hi('vop3p', 'v_pk_min_u16', operands, modifiers, 'op_sel_hi', op_sel_hi)
# Generate the source location
if srcloc is None:
srcloc = SrcLoc.get_caller_srcloc()
# Generate memory token
mem_token = None # this instruction does not access memory
# Generate the instruction call
call = InstrCall('vop3p', 'v_pk_min_u16', operands, modifiers, mem_token, comment, srcloc)
# Do we use/hold/define any Gpr
call.add_gpr_uses(exec, src0, src1)
call.add_gpr_defs(vdst)
# Add instruction call to current block
call.add_to_current_block()
# noinspection DuplicatedCode,PyDictCreation
def v_pk_mul_f16(vdst, src0, src1, /, op_sel=None, op_sel_hi=None, neg_lo=None, neg_hi=None, clamp=None, comment: str = None, srcloc: Optional[SrcLoc] = None):
"""
Instruction: v_pk_mul_f16
Operands:
dst: vdst/*synid-gfx9-vdst*/
src0: src0/*synid-gfx9-src-8*/
src1: src1/*synid-gfx9-src-1*/
Modifiers:
op_sel/*synid-op-sel*/
op_sel_hi/*synid-op-sel-hi*/
neg_lo/*synid-neg-lo*/
neg_hi/*synid-neg-hi*/
clamp/*synid-clamp*/
"""
# Prepare for a new instruction call
operands = {'vdst': vdst, 'src0': src0, 'src1': src1}
modifiers = {'op_sel': op_sel, 'op_sel_hi': op_sel_hi, 'neg_lo': neg_lo, 'neg_hi': neg_hi, 'clamp': clamp}
# Operands validation
validate_operand_synid_gfx9_vdst('vop3p', 'v_pk_mul_f16', operands, modifiers, 'vdst', vdst)
validate_operand_synid_gfx9_src_8('vop3p', 'v_pk_mul_f16', operands, modifiers, 'src0', src0)
validate_operand_synid_gfx9_src_1('vop3p', 'v_pk_mul_f16', operands, modifiers, 'src1', src1)
# Modifiers validation
validate_modifier_synid_op_sel('vop3p', 'v_pk_mul_f16', operands, modifiers, 'op_sel', op_sel)
validate_modifier_synid_op_sel_hi('vop3p', 'v_pk_mul_f16', operands, modifiers, 'op_sel_hi', op_sel_hi)
validate_modifier_synid_neg_lo('vop3p', 'v_pk_mul_f16', operands, modifiers, 'neg_lo', neg_lo)
validate_modifier_synid_neg_hi('vop3p', 'v_pk_mul_f16', operands, modifiers, 'neg_hi', neg_hi)
validate_modifier_synid_clamp('vop3p', 'v_pk_mul_f16', operands, modifiers, 'clamp', clamp)
# Generate the source location
if srcloc is None:
srcloc = SrcLoc.get_caller_srcloc()
# Generate memory token
mem_token = None # this instruction does not access memory
# Generate the instruction call
call = InstrCall('vop3p', 'v_pk_mul_f16', operands, modifiers, mem_token, comment, srcloc)
# Do we use/hold/define any Gpr
call.add_gpr_uses(exec, src0, src1)
call.add_gpr_defs(vdst)
# Add instruction call to current block
call.add_to_current_block()
# noinspection DuplicatedCode,PyDictCreation
def v_pk_mul_lo_u16(vdst, src0, src1, /, op_sel=None, op_sel_hi=None, comment: str = None, srcloc: Optional[SrcLoc] = None):
"""
Instruction: v_pk_mul_lo_u16
Operands:
dst: vdst/*synid-gfx9-vdst*/
src0: src0/*synid-gfx9-src-10*/
src1: src1/*synid-gfx9-src-4*/
Modifiers:
op_sel/*synid-op-sel*/
op_sel_hi/*synid-op-sel-hi*/
"""
# Prepare for a new instruction call
operands = {'vdst': vdst, 'src0': src0, 'src1': src1}
modifiers = {'op_sel': op_sel, 'op_sel_hi': op_sel_hi}
# Operands validation
validate_operand_synid_gfx9_vdst('vop3p', 'v_pk_mul_lo_u16', operands, modifiers, 'vdst', vdst)
validate_operand_synid_gfx9_src_10('vop3p', 'v_pk_mul_lo_u16', operands, modifiers, 'src0', src0)
validate_operand_synid_gfx9_src_4('vop3p', 'v_pk_mul_lo_u16', operands, modifiers, 'src1', src1)
# Modifiers validation
validate_modifier_synid_op_sel('vop3p', 'v_pk_mul_lo_u16', operands, modifiers, 'op_sel', op_sel)
validate_modifier_synid_op_sel_hi('vop3p', 'v_pk_mul_lo_u16', operands, modifiers, 'op_sel_hi', op_sel_hi)
# Generate the source location
if srcloc is None:
srcloc = SrcLoc.get_caller_srcloc()
# Generate memory token
mem_token = None # this instruction does not access memory
# Generate the instruction call
call = InstrCall('vop3p', 'v_pk_mul_lo_u16', operands, modifiers, mem_token, comment, srcloc)
# Do we use/hold/define any Gpr
call.add_gpr_uses(exec, src0, src1)
call.add_gpr_defs(vdst)
# Add instruction call to current block
call.add_to_current_block()
# noinspection DuplicatedCode,PyDictCreation
def v_pk_sub_i16(vdst, src0, src1, /, op_sel=None, op_sel_hi=None, clamp=None, comment: str = None, srcloc: Optional[SrcLoc] = None):
"""
Instruction: v_pk_sub_i16
Operands:
dst: vdst/*synid-gfx9-vdst*/
src0: src0/*synid-gfx9-src-10*/
src1: src1/*synid-gfx9-src-4*/
Modifiers:
op_sel/*synid-op-sel*/
op_sel_hi/*synid-op-sel-hi*/
clamp/*synid-clamp*/
"""
# Prepare for a new instruction call
operands = {'vdst': vdst, 'src0': src0, 'src1': src1}
modifiers = {'op_sel': op_sel, 'op_sel_hi': op_sel_hi, 'clamp': clamp}
# Operands validation
validate_operand_synid_gfx9_vdst('vop3p', 'v_pk_sub_i16', operands, modifiers, 'vdst', vdst)
validate_operand_synid_gfx9_src_10('vop3p', 'v_pk_sub_i16', operands, modifiers, 'src0', src0)
validate_operand_synid_gfx9_src_4('vop3p', 'v_pk_sub_i16', operands, modifiers, 'src1', src1)
# Modifiers validation
validate_modifier_synid_op_sel('vop3p', 'v_pk_sub_i16', operands, modifiers, 'op_sel', op_sel)
validate_modifier_synid_op_sel_hi('vop3p', 'v_pk_sub_i16', operands, modifiers, 'op_sel_hi', op_sel_hi)
validate_modifier_synid_clamp('vop3p', 'v_pk_sub_i16', operands, modifiers, 'clamp', clamp)
# Generate the source location
if srcloc is None:
srcloc = SrcLoc.get_caller_srcloc()
# Generate memory token
mem_token = None # this instruction does not access memory
# Generate the instruction call
call = InstrCall('vop3p', 'v_pk_sub_i16', operands, modifiers, mem_token, comment, srcloc)
# Do we use/hold/define any Gpr
call.add_gpr_uses(exec, src0, src1)
call.add_gpr_defs(vdst)
# Add instruction call to current block
call.add_to_current_block()
# noinspection DuplicatedCode,PyDictCreation
def v_pk_sub_u16(vdst, src0, src1, /, op_sel=None, op_sel_hi=None, clamp=None, comment: str = None, srcloc: Optional[SrcLoc] = None):
"""
Instruction: v_pk_sub_u16
Operands:
dst: vdst/*synid-gfx9-vdst*/
src0: src0/*synid-gfx9-src-10*/
src1: src1/*synid-gfx9-src-4*/
Modifiers:
op_sel/*synid-op-sel*/
op_sel_hi/*synid-op-sel-hi*/
clamp/*synid-clamp*/
"""
# Prepare for a new instruction call
operands = {'vdst': vdst, 'src0': src0, 'src1': src1}
modifiers = {'op_sel': op_sel, 'op_sel_hi': op_sel_hi, 'clamp': clamp}
# Operands validation
validate_operand_synid_gfx9_vdst('vop3p', 'v_pk_sub_u16', operands, modifiers, 'vdst', vdst)
validate_operand_synid_gfx9_src_10('vop3p', 'v_pk_sub_u16', operands, modifiers, 'src0', src0)
validate_operand_synid_gfx9_src_4('vop3p', 'v_pk_sub_u16', operands, modifiers, 'src1', src1)
# Modifiers validation
validate_modifier_synid_op_sel('vop3p', 'v_pk_sub_u16', operands, modifiers, 'op_sel', op_sel)
validate_modifier_synid_op_sel_hi('vop3p', 'v_pk_sub_u16', operands, modifiers, 'op_sel_hi', op_sel_hi)
validate_modifier_synid_clamp('vop3p', 'v_pk_sub_u16', operands, modifiers, 'clamp', clamp)
# Generate the source location
if srcloc is None:
srcloc = SrcLoc.get_caller_srcloc()
# Generate memory token
mem_token = None # this instruction does not access memory
# Generate the instruction call
call = InstrCall('vop3p', 'v_pk_sub_u16', operands, modifiers, mem_token, comment, srcloc)
# Do we use/hold/define any Gpr
call.add_gpr_uses(exec, src0, src1)
call.add_gpr_defs(vdst)
# Add instruction call to current block
call.add_to_current_block()
# noinspection DuplicatedCode,PyDictCreation
def v_dot2_f32_f16(vdst, src0, src1, src2, /, neg_lo=None, neg_hi=None, clamp=None, comment: str = None, srcloc: Optional[SrcLoc] = None):
"""
Instruction: v_dot2_f32_f16
Operands:
dst: vdst/*synid-gfx906-vdst*/
src0: src0/*synid-gfx906-src-2*/:f16x2/*synid-gfx906-type-deviation*/
src1: src1/*synid-gfx906-src-1*/:f16x2/*synid-gfx906-type-deviation*/
src2: src2/*synid-gfx906-src-1*/:f32/*synid-gfx906-type-deviation*/
Modifiers:
neg_lo/*synid-neg-lo*/
neg_hi/*synid-neg-hi*/
clamp/*synid-clamp*/
"""
# Prepare for a new instruction call
operands = {'vdst': vdst, 'src0': src0, 'src1': src1, 'src2': src2}
modifiers = {'neg_lo': neg_lo, 'neg_hi': neg_hi, 'clamp': clamp}
# Operands validation
validate_operand_synid_gfx906_vdst('vop3p', 'v_dot2_f32_f16', operands, modifiers, 'vdst', vdst)
validate_operand_synid_gfx906_src_2('vop3p', 'v_dot2_f32_f16', operands, modifiers, 'src0', src0)
validate_operand_synid_gfx906_src_1('vop3p', 'v_dot2_f32_f16', operands, modifiers, 'src1', src1)
validate_operand_synid_gfx906_src_1('vop3p', 'v_dot2_f32_f16', operands, modifiers, 'src2', src2)
# Modifiers validation
validate_modifier_synid_neg_lo('vop3p', 'v_dot2_f32_f16', operands, modifiers, 'neg_lo', neg_lo)
validate_modifier_synid_neg_hi('vop3p', 'v_dot2_f32_f16', operands, modifiers, 'neg_hi', neg_hi)
validate_modifier_synid_clamp('vop3p', 'v_dot2_f32_f16', operands, modifiers, 'clamp', clamp)
# Generate the source location
if srcloc is None:
srcloc = SrcLoc.get_caller_srcloc()
# Generate memory token
mem_token = None # this instruction does not access memory
# Generate the instruction call
call = InstrCall('vop3p', 'v_dot2_f32_f16', operands, modifiers, mem_token, comment, srcloc)
# Do we use/hold/define any Gpr
call.add_gpr_uses(exec, src0, src1, src2)
call.add_gpr_defs(vdst)
# Add instruction call to current block
call.add_to_current_block()
# noinspection DuplicatedCode,PyDictCreation
def v_dot2_i32_i16(vdst, src0, src1, src2, /, clamp=None, comment: str = None, srcloc: Optional[SrcLoc] = None):
"""
Instruction: v_dot2_i32_i16
Operands:
dst: vdst/*synid-gfx906-vdst*/
src0: src0/*synid-gfx906-src-3*/:i16x2/*synid-gfx906-type-deviation*/
src1: src1/*synid-gfx906-src-4*/:i16x2/*synid-gfx906-type-deviation*/
src2: src2/*synid-gfx906-src-1*/:i32/*synid-gfx906-type-deviation*/
Modifiers:
clamp/*synid-clamp*/
"""
# Prepare for a new instruction call
operands = {'vdst': vdst, 'src0': src0, 'src1': src1, 'src2': src2}
modifiers = {'clamp': clamp}
# Operands validation
validate_operand_synid_gfx906_vdst('vop3p', 'v_dot2_i32_i16', operands, modifiers, 'vdst', vdst)
validate_operand_synid_gfx906_src_3('vop3p', 'v_dot2_i32_i16', operands, modifiers, 'src0', src0)
validate_operand_synid_gfx906_src_4('vop3p', 'v_dot2_i32_i16', operands, modifiers, 'src1', src1)
validate_operand_synid_gfx906_src_1('vop3p', 'v_dot2_i32_i16', operands, modifiers, 'src2', src2)
# Modifiers validation
validate_modifier_synid_clamp('vop3p', 'v_dot2_i32_i16', operands, modifiers, 'clamp', clamp)
# Generate the source location
if srcloc is None:
srcloc = SrcLoc.get_caller_srcloc()
# Generate memory token
mem_token = None # this instruction does not access memory
# Generate the instruction call
call = InstrCall('vop3p', 'v_dot2_i32_i16', operands, modifiers, mem_token, comment, srcloc)
# Do we use/hold/define any Gpr
call.add_gpr_uses(exec, src0, src1, src2)
call.add_gpr_defs(vdst)
# Add instruction call to current block
call.add_to_current_block()
# noinspection DuplicatedCode,PyDictCreation
def v_dot2_u32_u16(vdst, src0, src1, src2, /, clamp=None, comment: str = None, srcloc: Optional[SrcLoc] = None):
"""
Instruction: v_dot2_u32_u16
Operands:
dst: vdst/*synid-gfx906-vdst*/
src0: src0/*synid-gfx906-src-3*/:u16x2/*synid-gfx906-type-deviation*/
src1: src1/*synid-gfx906-src-4*/:u16x2/*synid-gfx906-type-deviation*/
src2: src2/*synid-gfx906-src-1*/:u32/*synid-gfx906-type-deviation*/
Modifiers:
clamp/*synid-clamp*/
"""
# Prepare for a new instruction call
operands = {'vdst': vdst, 'src0': src0, 'src1': src1, 'src2': src2}
modifiers = {'clamp': clamp}
# Operands validation
validate_operand_synid_gfx906_vdst('vop3p', 'v_dot2_u32_u16', operands, modifiers, 'vdst', vdst)
validate_operand_synid_gfx906_src_3('vop3p', 'v_dot2_u32_u16', operands, modifiers, 'src0', src0)
validate_operand_synid_gfx906_src_4('vop3p', 'v_dot2_u32_u16', operands, modifiers, 'src1', src1)
validate_operand_synid_gfx906_src_1('vop3p', 'v_dot2_u32_u16', operands, modifiers, 'src2', src2)
# Modifiers validation
validate_modifier_synid_clamp('vop3p', 'v_dot2_u32_u16', operands, modifiers, 'clamp', clamp)
# Generate the source location
if srcloc is None:
srcloc = SrcLoc.get_caller_srcloc()
# Generate memory token
mem_token = None # this instruction does not access memory
# Generate the instruction call
call = InstrCall('vop3p', 'v_dot2_u32_u16', operands, modifiers, mem_token, comment, srcloc)
# Do we use/hold/define any Gpr
call.add_gpr_uses(exec, src0, src1, src2)
call.add_gpr_defs(vdst)
# Add instruction call to current block
call.add_to_current_block()
# noinspection DuplicatedCode,PyDictCreation
def v_dot4_i32_i8(vdst, src0, src1, src2, /, clamp=None, comment: str = None, srcloc: Optional[SrcLoc] = None):
"""
Instruction: v_dot4_i32_i8
Operands:
dst: vdst/*synid-gfx906-vdst*/
src0: src0/*synid-gfx906-src-2*/:i8x4/*synid-gfx906-type-deviation*/
src1: src1/*synid-gfx906-src-1*/:i8x4/*synid-gfx906-type-deviation*/
src2: src2/*synid-gfx906-src-1*/:i32/*synid-gfx906-type-deviation*/
Modifiers:
clamp/*synid-clamp*/
"""
# Prepare for a new instruction call
operands = {'vdst': vdst, 'src0': src0, 'src1': src1, 'src2': src2}
modifiers = {'clamp': clamp}
# Operands validation
validate_operand_synid_gfx906_vdst('vop3p', 'v_dot4_i32_i8', operands, modifiers, 'vdst', vdst)
validate_operand_synid_gfx906_src_2('vop3p', 'v_dot4_i32_i8', operands, modifiers, 'src0', src0)
validate_operand_synid_gfx906_src_1('vop3p', 'v_dot4_i32_i8', operands, modifiers, 'src1', src1)
validate_operand_synid_gfx906_src_1('vop3p', 'v_dot4_i32_i8', operands, modifiers, 'src2', src2)
# Modifiers validation
validate_modifier_synid_clamp('vop3p', 'v_dot4_i32_i8', operands, modifiers, 'clamp', clamp)
# Generate the source location
if srcloc is None:
srcloc = SrcLoc.get_caller_srcloc()
# Generate memory token
mem_token = None # this instruction does not access memory
# Generate the instruction call
call = InstrCall('vop3p', 'v_dot4_i32_i8', operands, modifiers, mem_token, comment, srcloc)
# Do we use/hold/define any Gpr
call.add_gpr_uses(exec, src0, src1, src2)
call.add_gpr_defs(vdst)
# Add instruction call to current block
call.add_to_current_block()
# noinspection DuplicatedCode,PyDictCreation
def v_dot4_u32_u8(vdst, src0, src1, src2, /, clamp=None, comment: str = None, srcloc: Optional[SrcLoc] = None):
"""
Instruction: v_dot4_u32_u8
Operands:
dst: vdst/*synid-gfx906-vdst*/
src0: src0/*synid-gfx906-src-2*/:u8x4/*synid-gfx906-type-deviation*/
src1: src1/*synid-gfx906-src-1*/:u8x4/*synid-gfx906-type-deviation*/
src2: src2/*synid-gfx906-src-1*/:u32/*synid-gfx906-type-deviation*/
Modifiers:
clamp/*synid-clamp*/
"""
# Prepare for a new instruction call
operands = {'vdst': vdst, 'src0': src0, 'src1': src1, 'src2': src2}
modifiers = {'clamp': clamp}
# Operands validation
validate_operand_synid_gfx906_vdst('vop3p', 'v_dot4_u32_u8', operands, modifiers, 'vdst', vdst)
validate_operand_synid_gfx906_src_2('vop3p', 'v_dot4_u32_u8', operands, modifiers, 'src0', src0)
validate_operand_synid_gfx906_src_1('vop3p', 'v_dot4_u32_u8', operands, modifiers, 'src1', src1)
validate_operand_synid_gfx906_src_1('vop3p', 'v_dot4_u32_u8', operands, modifiers, 'src2', src2)
# Modifiers validation
validate_modifier_synid_clamp('vop3p', 'v_dot4_u32_u8', operands, modifiers, 'clamp', clamp)
# Generate the source location
if srcloc is None:
srcloc = SrcLoc.get_caller_srcloc()
# Generate memory token
mem_token = None # this instruction does not access memory
# Generate the instruction call
call = InstrCall('vop3p', 'v_dot4_u32_u8', operands, modifiers, mem_token, comment, srcloc)
# Do we use/hold/define any Gpr
call.add_gpr_uses(exec, src0, src1, src2)
call.add_gpr_defs(vdst)
# Add instruction call to current block
call.add_to_current_block()
# noinspection DuplicatedCode,PyDictCreation
def v_dot8_i32_i4(vdst, src0, src1, src2, /, clamp=None, comment: str = None, srcloc: Optional[SrcLoc] = None):
"""
Instruction: v_dot8_i32_i4
Operands:
dst: vdst/*synid-gfx906-vdst*/
src0: src0/*synid-gfx906-src-2*/:i4x8/*synid-gfx906-type-deviation*/
src1: src1/*synid-gfx906-src-1*/:i4x8/*synid-gfx906-type-deviation*/
src2: src2/*synid-gfx906-src-1*/:i32/*synid-gfx906-type-deviation*/
Modifiers:
clamp/*synid-clamp*/
"""
# Prepare for a new instruction call
operands = {'vdst': vdst, 'src0': src0, 'src1': src1, 'src2': src2}
modifiers = {'clamp': clamp}
# Operands validation
validate_operand_synid_gfx906_vdst('vop3p', 'v_dot8_i32_i4', operands, modifiers, 'vdst', vdst)
validate_operand_synid_gfx906_src_2('vop3p', 'v_dot8_i32_i4', operands, modifiers, 'src0', src0)
validate_operand_synid_gfx906_src_1('vop3p', 'v_dot8_i32_i4', operands, modifiers, 'src1', src1)
validate_operand_synid_gfx906_src_1('vop3p', 'v_dot8_i32_i4', operands, modifiers, 'src2', src2)
# Modifiers validation
validate_modifier_synid_clamp('vop3p', 'v_dot8_i32_i4', operands, modifiers, 'clamp', clamp)
# Generate the source location
if srcloc is None:
srcloc = SrcLoc.get_caller_srcloc()
# Generate memory token
mem_token = None # this instruction does not access memory
# Generate the instruction call
call = InstrCall('vop3p', 'v_dot8_i32_i4', operands, modifiers, mem_token, comment, srcloc)
# Do we use/hold/define any Gpr
call.add_gpr_uses(exec, src0, src1, src2)
call.add_gpr_defs(vdst)
# Add instruction call to current block
call.add_to_current_block()
# noinspection DuplicatedCode,PyDictCreation
def v_dot8_u32_u4(vdst, src0, src1, src2, /, clamp=None, comment: str = None, srcloc: Optional[SrcLoc] = None):
"""
Instruction: v_dot8_u32_u4
Operands:
dst: vdst/*synid-gfx906-vdst*/
src0: src0/*synid-gfx906-src-2*/:u4x8/*synid-gfx906-type-deviation*/
src1: src1/*synid-gfx906-src-1*/:u4x8/*synid-gfx906-type-deviation*/
src2: src2/*synid-gfx906-src-1*/:u32/*synid-gfx906-type-deviation*/
Modifiers:
clamp/*synid-clamp*/
"""
# Prepare for a new instruction call
operands = {'vdst': vdst, 'src0': src0, 'src1': src1, 'src2': src2}
modifiers = {'clamp': clamp}
# Operands validation
validate_operand_synid_gfx906_vdst('vop3p', 'v_dot8_u32_u4', operands, modifiers, 'vdst', vdst)
validate_operand_synid_gfx906_src_2('vop3p', 'v_dot8_u32_u4', operands, modifiers, 'src0', src0)
validate_operand_synid_gfx906_src_1('vop3p', 'v_dot8_u32_u4', operands, modifiers, 'src1', src1)
validate_operand_synid_gfx906_src_1('vop3p', 'v_dot8_u32_u4', operands, modifiers, 'src2', src2)
# Modifiers validation
validate_modifier_synid_clamp('vop3p', 'v_dot8_u32_u4', operands, modifiers, 'clamp', clamp)
# Generate the source location
if srcloc is None:
srcloc = SrcLoc.get_caller_srcloc()
# Generate memory token
mem_token = None # this instruction does not access memory
# Generate the instruction call
call = InstrCall('vop3p', 'v_dot8_u32_u4', operands, modifiers, mem_token, comment, srcloc)
# Do we use/hold/define any Gpr
call.add_gpr_uses(exec, src0, src1, src2)
call.add_gpr_defs(vdst)
# Add instruction call to current block
call.add_to_current_block()
# noinspection DuplicatedCode,PyDictCreation
def v_fma_mix_f32(vdst, src0, src1, src2, /, m_op_sel=None, m_op_sel_hi=None, clamp=None, comment: str = None, srcloc: Optional[SrcLoc] = None):
"""
Instruction: v_fma_mix_f32
Operands:
dst: vdst/*synid-gfx906-vdst*/
src0: src0/*synid-gfx906-src-2*/:m/*synid-gfx906-m*/:fx/*synid-gfx906-fx-operand*/
src1: src1/*synid-gfx906-src-1*/:m/*synid-gfx906-m*/:fx/*synid-gfx906-fx-operand*/
src2: src2/*synid-gfx906-src-1*/:m/*synid-gfx906-m*/:fx/*synid-gfx906-fx-operand*/
Modifiers:
m_op_sel/*synid-mad-mix-op-sel*/
m_op_sel_hi/*synid-mad-mix-op-sel-hi*/
clamp/*synid-clamp*/
"""
# Prepare for a new instruction call
operands = {'vdst': vdst, 'src0': src0, 'src1': src1, 'src2': src2}
modifiers = {'m_op_sel': m_op_sel, 'm_op_sel_hi': m_op_sel_hi, 'clamp': clamp}
# Operands validation
validate_operand_synid_gfx906_vdst('vop3p', 'v_fma_mix_f32', operands, modifiers, 'vdst', vdst)
validate_operand_synid_gfx906_src_2('vop3p', 'v_fma_mix_f32', operands, modifiers, 'src0', src0, allow_sext=True)
validate_operand_synid_gfx906_src_1('vop3p', 'v_fma_mix_f32', operands, modifiers, 'src1', src1, allow_sext=True)
validate_operand_synid_gfx906_src_1('vop3p', 'v_fma_mix_f32', operands, modifiers, 'src2', src2, allow_sext=True)
# Modifiers validation
validate_modifier_synid_mad_mix_op_sel('vop3p', 'v_fma_mix_f32', operands, modifiers, 'm_op_sel', m_op_sel)
validate_modifier_synid_mad_mix_op_sel_hi('vop3p', 'v_fma_mix_f32', operands, modifiers, 'm_op_sel_hi', m_op_sel_hi)
validate_modifier_synid_clamp('vop3p', 'v_fma_mix_f32', operands, modifiers, 'clamp', clamp)
# Generate the source location
if srcloc is None:
srcloc = SrcLoc.get_caller_srcloc()
# Generate memory token
mem_token = None # this instruction does not access memory
# Generate the instruction call
call = InstrCall('vop3p', 'v_fma_mix_f32', operands, modifiers, mem_token, comment, srcloc)
# Do we use/hold/define any Gpr
call.add_gpr_uses(exec, src0, src1, src2)
call.add_gpr_defs(vdst)
# Add instruction call to current block
call.add_to_current_block()
# noinspection DuplicatedCode,PyDictCreation
def v_fma_mixhi_f16(vdst, src0, src1, src2, /, m_op_sel=None, m_op_sel_hi=None, clamp=None, comment: str = None, srcloc: Optional[SrcLoc] = None):
"""
Instruction: v_fma_mixhi_f16
Operands:
dst: vdst/*synid-gfx906-vdst*/
src0: src0/*synid-gfx906-src-2*/:m/*synid-gfx906-m*/:fx/*synid-gfx906-fx-operand*/
src1: src1/*synid-gfx906-src-1*/:m/*synid-gfx906-m*/:fx/*synid-gfx906-fx-operand*/
src2: src2/*synid-gfx906-src-1*/:m/*synid-gfx906-m*/:fx/*synid-gfx906-fx-operand*/
Modifiers:
m_op_sel/*synid-mad-mix-op-sel*/
m_op_sel_hi/*synid-mad-mix-op-sel-hi*/
clamp/*synid-clamp*/
"""
# Prepare for a new instruction call
operands = {'vdst': vdst, 'src0': src0, 'src1': src1, 'src2': src2}
modifiers = {'m_op_sel': m_op_sel, 'm_op_sel_hi': m_op_sel_hi, 'clamp': clamp}
# Operands validation
validate_operand_synid_gfx906_vdst('vop3p', 'v_fma_mixhi_f16', operands, modifiers, 'vdst', vdst)
validate_operand_synid_gfx906_src_2('vop3p', 'v_fma_mixhi_f16', operands, modifiers, 'src0', src0, allow_sext=True)
validate_operand_synid_gfx906_src_1('vop3p', 'v_fma_mixhi_f16', operands, modifiers, 'src1', src1, allow_sext=True)
validate_operand_synid_gfx906_src_1('vop3p', 'v_fma_mixhi_f16', operands, modifiers, 'src2', src2, allow_sext=True)
# Modifiers validation
validate_modifier_synid_mad_mix_op_sel('vop3p', 'v_fma_mixhi_f16', operands, modifiers, 'm_op_sel', m_op_sel)
validate_modifier_synid_mad_mix_op_sel_hi('vop3p', 'v_fma_mixhi_f16', operands, modifiers, 'm_op_sel_hi', m_op_sel_hi)
validate_modifier_synid_clamp('vop3p', 'v_fma_mixhi_f16', operands, modifiers, 'clamp', clamp)
# Generate the source location
if srcloc is None:
srcloc = SrcLoc.get_caller_srcloc()
# Generate memory token
mem_token = None # this instruction does not access memory
# Generate the instruction call
call = InstrCall('vop3p', 'v_fma_mixhi_f16', operands, modifiers, mem_token, comment, srcloc)
# Do we use/hold/define any Gpr
call.add_gpr_uses(exec, src0, src1, src2)
call.add_gpr_defs(vdst)
# Add instruction call to current block
call.add_to_current_block()
# noinspection DuplicatedCode,PyDictCreation
def v_fma_mixlo_f16(vdst, src0, src1, src2, /, m_op_sel=None, m_op_sel_hi=None, clamp=None, comment: str = None, srcloc: Optional[SrcLoc] = None):
"""
Instruction: v_fma_mixlo_f16
Operands:
dst: vdst/*synid-gfx906-vdst*/
src0: src0/*synid-gfx906-src-2*/:m/*synid-gfx906-m*/:fx/*synid-gfx906-fx-operand*/
src1: src1/*synid-gfx906-src-1*/:m/*synid-gfx906-m*/:fx/*synid-gfx906-fx-operand*/
src2: src2/*synid-gfx906-src-1*/:m/*synid-gfx906-m*/:fx/*synid-gfx906-fx-operand*/
Modifiers:
m_op_sel/*synid-mad-mix-op-sel*/
m_op_sel_hi/*synid-mad-mix-op-sel-hi*/
clamp/*synid-clamp*/
"""
# Prepare for a new instruction call
operands = {'vdst': vdst, 'src0': src0, 'src1': src1, 'src2': src2}
modifiers = {'m_op_sel': m_op_sel, 'm_op_sel_hi': m_op_sel_hi, 'clamp': clamp}
# Operands validation
validate_operand_synid_gfx906_vdst('vop3p', 'v_fma_mixlo_f16', operands, modifiers, 'vdst', vdst)
validate_operand_synid_gfx906_src_2('vop3p', 'v_fma_mixlo_f16', operands, modifiers, 'src0', src0, allow_sext=True)
validate_operand_synid_gfx906_src_1('vop3p', 'v_fma_mixlo_f16', operands, modifiers, 'src1', src1, allow_sext=True)
validate_operand_synid_gfx906_src_1('vop3p', 'v_fma_mixlo_f16', operands, modifiers, 'src2', src2, allow_sext=True)
# Modifiers validation
validate_modifier_synid_mad_mix_op_sel('vop3p', 'v_fma_mixlo_f16', operands, modifiers, 'm_op_sel', m_op_sel)
validate_modifier_synid_mad_mix_op_sel_hi('vop3p', 'v_fma_mixlo_f16', operands, modifiers, 'm_op_sel_hi', m_op_sel_hi)
validate_modifier_synid_clamp('vop3p', 'v_fma_mixlo_f16', operands, modifiers, 'clamp', clamp)
# Generate the source location
if srcloc is None:
srcloc = SrcLoc.get_caller_srcloc()
# Generate memory token
mem_token = None # this instruction does not access memory
# Generate the instruction call
call = InstrCall('vop3p', 'v_fma_mixlo_f16', operands, modifiers, mem_token, comment, srcloc)
# Do we use/hold/define any Gpr
call.add_gpr_uses(exec, src0, src1, src2)
call.add_gpr_defs(vdst)
# Add instruction call to current block
call.add_to_current_block()
This source diff could not be displayed because it is too large. You can view the blob instead.
"""
THIS FILE IS AUTO GENERATED.
ANY MODIFICATION WILL BE LOST AFTER REGENERATION.
"""
# flake8: noqa
# noinspection PyUnresolvedReferences
from ...basic.exception import check, SeekTODOException
# noinspection DuplicatedCode,PyUnusedLocal
def validate_modifier_synid_ds_offset16(category, instr_name, operands, modifiers, modifier_text, modifier_value):
"""
#### offset¶
Specifies a 16-bit offset, in bytes. The default value is 0.
Used with DS instructions that expect a single address.
Syntax | Description
> --- |---
> offset:{0..0xFFFF} | Specifies an unsigned 16-bit offset as a positive integer number or an absolute expression.
Examples:
offset:65535
offset:0xffff
offset:-x-y
"""
if modifier_value is None:
return
check(isinstance(modifier_value, int), modifier_value)
check(0 <= modifier_value <= 65535, modifier_value)
# noinspection DuplicatedCode,PyUnusedLocal
def validate_modifier_synid_gds(category, instr_name, operands, modifiers, modifier_text, modifier_value):
"""
#### gds¶
Specifies whether to use GDS or LDS memory (LDS is the default).
Syntax | Description
> --- |---
> gds | Use GDS memory.
"""
if modifier_value is not None:
check(modifier_value in {True, False}, modifier_value)
# noinspection DuplicatedCode,PyUnusedLocal
def validate_modifier_synid_ds_offset80(category, instr_name, operands, modifiers, modifier_text, modifier_value):
"""
#### offset0¶
Specifies first 8-bit offset, in bytes. The default value is 0.
Used with DS instructions that expect two addresses.
Syntax | Description
> --- |---
> offset0:{0..0xFF} | Specifies an unsigned 8-bit offset as a positive integer number or an absolute expression.
Examples:
offset0:0xff
offset0:2-x
offset0:-x-y
"""
if modifier_value is None:
return
check(isinstance(modifier_value, int), modifier_value)
check(0 <= modifier_value <= 255, modifier_value)
# noinspection DuplicatedCode,PyUnusedLocal
def validate_modifier_synid_ds_offset81(category, instr_name, operands, modifiers, modifier_text, modifier_value):
"""
#### offset1¶
Specifies second 8-bit offset, in bytes. The default value is 0.
Used with DS instructions that expect two addresses.
Syntax | Description
> --- |---
> offset1:{0..0xFF} | Specifies an unsigned 8-bit offset as a positive integer number or an absolute expression.
Examples:
offset1:0xff
offset1:2-x
offset1:-x-y
"""
if modifier_value is None:
return
check(isinstance(modifier_value, int), modifier_value)
check(0 <= modifier_value <= 255, modifier_value)
# noinspection DuplicatedCode,PyUnusedLocal
def validate_modifier_synid_sw_offset16(category, instr_name, operands, modifiers, modifier_text, modifier_value):
"""
#### swizzle pattern¶
This is a special modifier which may be used with ds_swizzle_b32 instruction only. It specifies a swizzle pattern in numeric or symbolic form. The default value is 0.
See AMD documentation for more information.
Syntax | Description
> --- |---
> offset:{0..0xFFFF} | Specifies a 16-bit swizzle pattern.
> offset:swizzle(QUAD_PERM,{0..3},{0..3},{0..3},{0..3}) |
>
> Specifies a quad permute mode pattern
>
> Each number is a lane id.
>
> offset:swizzle(BITMASK_PERM, “<mask>”) |
>
> Specifies a bitmask permute mode pattern.
>
> The pattern converts a 5-bit lane id to another lane id with which the lane interacts.
>
> mask is a 5 character sequence which specifies how to transform the bits of the lane id.
>
> The following characters are allowed:
>
> * “0” - set bit to 0.
> * “1” - set bit to 1.
> * “p” - preserve bit.
> * “i” - inverse bit.
>
> offset:swizzle(BROADCAST,{2..32},{0..N}) |
>
> Specifies a broadcast mode.
>
> Broadcasts the value of any particular lane to all lanes in its group.
>
> The first numeric parameter is a group size and must be equal to 2, 4, 8, 16 or 32.
>
> The second numeric parameter is an index of the lane being broadcasted.
>
> The index must not exceed group size.
>
> offset:swizzle(SWAP,{1..16}) |
>
> Specifies a swap mode.
>
> Swaps the neighboring groups of 1, 2, 4, 8 or 16 lanes.
>
> offset:swizzle(REVERSE,{2..32}) |
>
> Specifies a reverse mode.
>
> Reverses the lanes for groups of 2, 4, 8, 16 or 32 lanes.
>
Note: numeric values may be specified as either integer numbers or absolute expressions.
Examples:
offset:255
offset:0xffff
offset:swizzle(QUAD_PERM, 0, 1, 2, 3)
offset:swizzle(BITMASK_PERM, "01pi0")
offset:swizzle(BROADCAST, 2, 0)
offset:swizzle(SWAP, 8)
offset:swizzle(REVERSE, 30 + 2)
"""
raise SeekTODOException()
# noinspection DuplicatedCode,PyUnusedLocal
def validate_modifier_synid_done(category, instr_name, operands, modifiers, modifier_text, modifier_value):
"""
#### done¶
Specifies if this is the last export from the shader to the target. By default, exp instruction does not finish an export sequence.
Syntax | Description
> --- |---
> done | Indicates the last export operation.
"""
if modifier_value is not None:
check(modifier_value in {True, False}, modifier_value)
# noinspection DuplicatedCode,PyUnusedLocal
def validate_modifier_synid_compr(category, instr_name, operands, modifiers, modifier_text, modifier_value):
"""
#### compr¶
Indicates if the data are compressed (data are not compressed by default).
Syntax | Description
> --- |---
> compr | Data are compressed.
"""
if modifier_value is not None:
check(modifier_value in {True, False}, modifier_value)
# noinspection DuplicatedCode,PyUnusedLocal
def validate_modifier_synid_vm(category, instr_name, operands, modifiers, modifier_text, modifier_value):
"""
#### vm¶
Specifies valid mask flag state (off by default).
Syntax | Description
> --- |---
> vm | Set valid mask flag.
"""
if modifier_value is not None:
check(modifier_value in {True, False}, modifier_value)
# noinspection DuplicatedCode,PyUnusedLocal
def validate_modifier_synid_flat_offset12(category, instr_name, operands, modifiers, modifier_text, modifier_value):
"""
#### offset12¶
Specifies an immediate unsigned 12-bit offset, in bytes. The default value is 0.
Cannot be used with global/scratch opcodes. GFX9 only.
Syntax | Description
> --- |---
> offset:{0..4095} | Specifies a 12-bit unsigned offset as a positive integer number or an absolute expression.
Examples:
offset:4095
offset:x-0xff
"""
if modifier_value is None:
return
check(isinstance(modifier_value, int), modifier_value)
check(0 <= modifier_value <= 4095, modifier_value)
# noinspection DuplicatedCode,PyUnusedLocal
def validate_modifier_synid_glc(category, instr_name, operands, modifiers, modifier_text, modifier_value):
"""
#### glc¶
This modifier has different meaning for loads, stores, and atomic operations. The default value is off (0).
See AMD documentation for details.
Syntax | Description
> --- |---
> glc | Set glc bit to 1.
"""
if modifier_value is not None:
check(modifier_value in {True, False}, modifier_value)
# noinspection DuplicatedCode,PyUnusedLocal
def validate_modifier_synid_slc(category, instr_name, operands, modifiers, modifier_text, modifier_value):
"""
#### slc¶
Specifies cache policy. The default value is off (0).
See AMD documentation for details.
Syntax | Description
> --- |---
> slc | Set slc bit to 1.
"""
if modifier_value is not None:
check(modifier_value in {True, False}, modifier_value)
# noinspection DuplicatedCode,PyUnusedLocal
def validate_modifier_synid_flat_offset13s(category, instr_name, operands, modifiers, modifier_text, modifier_value):
"""
#### offset13s¶
Specifies an immediate signed 13-bit offset, in bytes. The default value is 0.
Can be used with global/scratch opcodes only. GFX9 only.
Syntax | Description
> --- |---
> offset:{-4096..4095} | Specifies a 13-bit signed offset as an integer number or an absolute expression.
Examples:
offset:-4000
offset:0x10
offset:-x
"""
if modifier_value is None:
return
check(isinstance(modifier_value, int), modifier_value)
check(-4096 <= modifier_value <= 4095, modifier_value)
# noinspection DuplicatedCode,PyUnusedLocal
def validate_modifier_synid_dmask(category, instr_name, operands, modifiers, modifier_text, modifier_value):
"""
#### dmask¶
Specifies which channels (image components) are used by the operation. By default, no channels are used.
Syntax | Description
> --- |---
> dmask:{0..15} |
>
> Specifies image channels as a positive integer number or an absolute expression.
>
> Each bit corresponds to one of 4 image components (RGBA).
>
> If the specified bit value is 0, the component is not used, value 1 means that the component is used.
>
This modifier has some limitations depending on instruction kind:
Instruction Kind | Valid dmask Values
> --- |---
> 32-bit atomic cmpswap | 0x3
> 32-bit atomic instructions except for cmpswap | 0x1
> 64-bit atomic cmpswap | 0xF
> 64-bit atomic instructions except for cmpswap | 0x3
> gather4 | 0x1, 0x2, 0x4, 0x8
> Other instructions | any value
Examples:
dmask:0xf
dmask:0b1111
dmask:x|y|z
"""
if modifier_value is None:
return
check(isinstance(modifier_value, int), modifier_value)
check(0 <= modifier_value <= 15, modifier_value)
# noinspection DuplicatedCode,PyUnusedLocal
def validate_modifier_synid_unorm(category, instr_name, operands, modifiers, modifier_text, modifier_value):
"""
#### unorm¶
Specifies whether the address is normalized or not (the address is normalized by default).
Syntax | Description
> --- |---
> unorm | Force the address to be unnormalized.
"""
if modifier_value is not None:
check(modifier_value in {True, False}, modifier_value)
# noinspection DuplicatedCode,PyUnusedLocal
def validate_modifier_synid_a16(category, instr_name, operands, modifiers, modifier_text, modifier_value):
"""
#### a16¶
Specifies size of image address components: 16 or 32 bits (32 bits by default). GFX9 and GFX10 only.
Syntax | Description
> --- |---
> a16 | Enables 16-bits image address components.
"""
if modifier_value is not None:
check(modifier_value in {True, False}, modifier_value)
# noinspection DuplicatedCode,PyUnusedLocal
def validate_modifier_synid_lwe(category, instr_name, operands, modifiers, modifier_text, modifier_value):
"""
#### lwe¶
Specifies LOD warning status (LOD warning is disabled by default).
Syntax | Description
> --- |---
> lwe | Enables LOD warning.
"""
if modifier_value is not None:
check(modifier_value in {True, False}, modifier_value)
# noinspection DuplicatedCode,PyUnusedLocal
def validate_modifier_synid_da(category, instr_name, operands, modifiers, modifier_text, modifier_value):
"""
#### da¶
Specifies if an array index must be sent to TA. By default, array index is not sent.
Syntax | Description
> --- |---
> da | Send an array-index to TA.
"""
if modifier_value is not None:
check(modifier_value in {True, False}, modifier_value)
# noinspection DuplicatedCode,PyUnusedLocal
def validate_modifier_synid_d16(category, instr_name, operands, modifiers, modifier_text, modifier_value):
"""
#### d16¶
Specifies data size: 16 or 32 bits (32 bits by default). Not supported by GFX7.
Syntax | Description
> --- |---
> d16 |
>
> Enables 16-bits data mode.
>
> On loads, convert data in memory to 16-bit format before storing it in VGPRs.
>
> For stores, convert 16-bit data in VGPRs to 32 bits before going to memory.
>
> Note that GFX8.0 does not support data packing. Each 16-bit data element occupies 1 VGPR.
>
> GFX8.1, GFX9 and GFX10 support data packing. Each pair of 16-bit data elements occupies 1 VGPR.
>
"""
if modifier_value is not None:
check(modifier_value in {True, False}, modifier_value)
# noinspection DuplicatedCode,PyUnusedLocal
def validate_modifier_synid_tfe(category, instr_name, operands, modifiers, modifier_text, modifier_value):
"""
#### tfe¶
Controls access to partially resident textures. The default value is off (0).
See AMD documentation for details.
Syntax | Description
> --- |---
> tfe | Set tfe bit to 1.
"""
if modifier_value is not None:
check(modifier_value in {True, False}, modifier_value)
# noinspection DuplicatedCode,PyUnusedLocal
def validate_modifier_synid_fmt(category, instr_name, operands, modifiers, modifier_text, modifier_value):
"""
#### fmt¶
Specifies data and numeric formats used by the operation. The default numeric format is BUF_NUM_FORMAT_UNORM. The default data format is BUF_DATA_FORMAT_8.
Syntax | Description
> --- |---
> format:{0..127} | Use format specified as either an integer number or an absolute expression.
> format:[<data format>] | Use the specified data format and default numeric format.
> format:[<numeric format>] | Use the specified numeric format and default data format.
> format:[<data format>, <numeric format>] | Use the specified data and numeric formats.
> format:[<numeric format>, <data format>] | Use the specified data and numeric formats.
Supported data formats are defined in the following table:
Syntax | Note
> --- |---
> BUF_DATA_FORMAT_INVALID |
> BUF_DATA_FORMAT_8 | Default value.
> BUF_DATA_FORMAT_16 |
> BUF_DATA_FORMAT_8_8 |
> BUF_DATA_FORMAT_32 |
> BUF_DATA_FORMAT_16_16 |
> BUF_DATA_FORMAT_10_11_11 |
> BUF_DATA_FORMAT_11_11_10 |
> BUF_DATA_FORMAT_10_10_10_2 |
> BUF_DATA_FORMAT_2_10_10_10 |
> BUF_DATA_FORMAT_8_8_8_8 |
> BUF_DATA_FORMAT_32_32 |
> BUF_DATA_FORMAT_16_16_16_16 |
> BUF_DATA_FORMAT_32_32_32 |
> BUF_DATA_FORMAT_32_32_32_32 |
> BUF_DATA_FORMAT_RESERVED_15 |
Supported numeric formats are defined below:
Syntax | Note
> --- |---
> BUF_NUM_FORMAT_UNORM | Default value.
> BUF_NUM_FORMAT_SNORM |
> BUF_NUM_FORMAT_USCALED |
> BUF_NUM_FORMAT_SSCALED |
> BUF_NUM_FORMAT_UINT |
> BUF_NUM_FORMAT_SINT |
> BUF_NUM_FORMAT_SNORM_OGL | GFX7 only.
> BUF_NUM_FORMAT_RESERVED_6 | GFX8 and GFX9 only.
> BUF_NUM_FORMAT_FLOAT |
Examples:
format:0
format:127
format:[BUF_DATA_FORMAT_16]
format:[BUF_DATA_FORMAT_16,BUF_NUM_FORMAT_SSCALED]
format:[BUF_NUM_FORMAT_FLOAT]
"""
raise SeekTODOException()
# noinspection DuplicatedCode,PyUnusedLocal
def validate_modifier_synid_idxen(category, instr_name, operands, modifiers, modifier_text, modifier_value):
"""
#### idxen¶
Specifies whether address components include an index. By default, no components are used.
Can be used together with offen.
Cannot be used with addr64.
Syntax | Description
> --- |---
> idxen | Address components include an index.
"""
if modifier_value is not None:
check(modifier_value in {True, False}, modifier_value)
# noinspection DuplicatedCode,PyUnusedLocal
def validate_modifier_synid_offen(category, instr_name, operands, modifiers, modifier_text, modifier_value):
"""
#### offen¶
Specifies whether address components include an offset. By default, no components are used.
Can be used together with idxen.
Cannot be used with addr64.
Syntax | Description
> --- |---
> offen | Address components include an offset.
"""
if modifier_value is not None:
check(modifier_value in {True, False}, modifier_value)
# noinspection DuplicatedCode,PyUnusedLocal
def validate_modifier_synid_buf_offset12(category, instr_name, operands, modifiers, modifier_text, modifier_value):
"""
#### offset12¶
Specifies an immediate unsigned 12-bit offset, in bytes. The default value is 0.
Syntax | Description
> --- |---
> offset:{0..0xFFF} | Specifies a 12-bit unsigned offset as a positive integer number or an absolute expression.
Examples:
offset:x+y
offset:0x10
"""
if modifier_value is None:
return
check(isinstance(modifier_value, int), modifier_value)
check(0 <= modifier_value <= 4095, modifier_value)
# noinspection DuplicatedCode,PyUnusedLocal
def validate_modifier_synid_lds(category, instr_name, operands, modifiers, modifier_text, modifier_value):
"""
#### lds¶
Specifies where to store the result: VGPRs or LDS (VGPRs by default).
Syntax | Description
> --- |---
> lds | Store result in LDS.
"""
if modifier_value is not None:
check(modifier_value in {True, False}, modifier_value)
# noinspection DuplicatedCode,PyUnusedLocal
def validate_modifier_synid_dpp_ctrl(category, instr_name, operands, modifiers, modifier_text, modifier_value):
"""
#### dpp_ctrl¶
Specifies how data are shared between threads. This is a mandatory modifier. There is no default value.
GFX8 and GFX9 only. Use dpp16_ctrl for GFX10.
Note: the lanes of a wavefront are organized in four rows and four banks.
Syntax | Description
> --- |---
> quad_perm:[{0..3},{0..3},{0..3},{0..3}] | Full permute of 4 threads.
> row_mirror | Mirror threads within row.
> row_half_mirror | Mirror threads within 1/2 row (8 threads).
> row_bcast:15 | Broadcast 15th thread of each row to next row.
> row_bcast:31 | Broadcast thread 31 to rows 2 and 3.
> wave_shl:1 | Wavefront left shift by 1 thread.
> wave_rol:1 | Wavefront left rotate by 1 thread.
> wave_shr:1 | Wavefront right shift by 1 thread.
> wave_ror:1 | Wavefront right rotate by 1 thread.
> row_shl:{1..15} | Row shift left by 1-15 threads.
> row_shr:{1..15} | Row shift right by 1-15 threads.
> row_ror:{1..15} | Row rotate right by 1-15 threads.
Note: numeric values may be specified as either integer numbers or absolute expressions.
Examples:
quad_perm:[0, 1, 2, 3]
row_shl:3
"""
check(modifier_value is not None, modifier_value)
check(modifier_value in {'quad_perm:[0,0,0,0]', 'quad_perm:[0,0,0,1]', 'quad_perm:[0,0,0,2]', 'quad_perm:[0,0,0,3]', 'quad_perm:[0,0,1,0]', 'quad_perm:[0,0,1,1]', 'quad_perm:[0,0,1,2]', 'quad_perm:[0,0,1,3]', 'quad_perm:[0,0,2,0]', 'quad_perm:[0,0,2,1]', 'quad_perm:[0,0,2,2]', 'quad_perm:[0,0,2,3]', 'quad_perm:[0,0,3,0]', 'quad_perm:[0,0,3,1]', 'quad_perm:[0,0,3,2]', 'quad_perm:[0,0,3,3]', 'quad_perm:[0,1,0,0]', 'quad_perm:[0,1,0,1]', 'quad_perm:[0,1,0,2]', 'quad_perm:[0,1,0,3]', 'quad_perm:[0,1,1,0]', 'quad_perm:[0,1,1,1]', 'quad_perm:[0,1,1,2]', 'quad_perm:[0,1,1,3]', 'quad_perm:[0,1,2,0]', 'quad_perm:[0,1,2,1]', 'quad_perm:[0,1,2,2]', 'quad_perm:[0,1,2,3]', 'quad_perm:[0,1,3,0]', 'quad_perm:[0,1,3,1]', 'quad_perm:[0,1,3,2]', 'quad_perm:[0,1,3,3]', 'quad_perm:[0,2,0,0]', 'quad_perm:[0,2,0,1]', 'quad_perm:[0,2,0,2]', 'quad_perm:[0,2,0,3]', 'quad_perm:[0,2,1,0]', 'quad_perm:[0,2,1,1]', 'quad_perm:[0,2,1,2]', 'quad_perm:[0,2,1,3]', 'quad_perm:[0,2,2,0]', 'quad_perm:[0,2,2,1]', 'quad_perm:[0,2,2,2]', 'quad_perm:[0,2,2,3]', 'quad_perm:[0,2,3,0]', 'quad_perm:[0,2,3,1]', 'quad_perm:[0,2,3,2]', 'quad_perm:[0,2,3,3]', 'quad_perm:[0,3,0,0]', 'quad_perm:[0,3,0,1]', 'quad_perm:[0,3,0,2]', 'quad_perm:[0,3,0,3]', 'quad_perm:[0,3,1,0]', 'quad_perm:[0,3,1,1]', 'quad_perm:[0,3,1,2]', 'quad_perm:[0,3,1,3]', 'quad_perm:[0,3,2,0]', 'quad_perm:[0,3,2,1]', 'quad_perm:[0,3,2,2]', 'quad_perm:[0,3,2,3]', 'quad_perm:[0,3,3,0]', 'quad_perm:[0,3,3,1]', 'quad_perm:[0,3,3,2]', 'quad_perm:[0,3,3,3]', 'quad_perm:[1,0,0,0]', 'quad_perm:[1,0,0,1]', 'quad_perm:[1,0,0,2]', 'quad_perm:[1,0,0,3]', 'quad_perm:[1,0,1,0]', 'quad_perm:[1,0,1,1]', 'quad_perm:[1,0,1,2]', 'quad_perm:[1,0,1,3]', 'quad_perm:[1,0,2,0]', 'quad_perm:[1,0,2,1]', 'quad_perm:[1,0,2,2]', 'quad_perm:[1,0,2,3]', 'quad_perm:[1,0,3,0]', 'quad_perm:[1,0,3,1]', 'quad_perm:[1,0,3,2]', 'quad_perm:[1,0,3,3]', 'quad_perm:[1,1,0,0]', 'quad_perm:[1,1,0,1]', 'quad_perm:[1,1,0,2]', 'quad_perm:[1,1,0,3]', 'quad_perm:[1,1,1,0]', 'quad_perm:[1,1,1,1]', 'quad_perm:[1,1,1,2]', 'quad_perm:[1,1,1,3]', 'quad_perm:[1,1,2,0]', 'quad_perm:[1,1,2,1]', 'quad_perm:[1,1,2,2]', 'quad_perm:[1,1,2,3]', 'quad_perm:[1,1,3,0]', 'quad_perm:[1,1,3,1]', 'quad_perm:[1,1,3,2]', 'quad_perm:[1,1,3,3]', 'quad_perm:[1,2,0,0]', 'quad_perm:[1,2,0,1]', 'quad_perm:[1,2,0,2]', 'quad_perm:[1,2,0,3]', 'quad_perm:[1,2,1,0]', 'quad_perm:[1,2,1,1]', 'quad_perm:[1,2,1,2]', 'quad_perm:[1,2,1,3]', 'quad_perm:[1,2,2,0]', 'quad_perm:[1,2,2,1]', 'quad_perm:[1,2,2,2]', 'quad_perm:[1,2,2,3]', 'quad_perm:[1,2,3,0]', 'quad_perm:[1,2,3,1]', 'quad_perm:[1,2,3,2]', 'quad_perm:[1,2,3,3]', 'quad_perm:[1,3,0,0]', 'quad_perm:[1,3,0,1]', 'quad_perm:[1,3,0,2]', 'quad_perm:[1,3,0,3]', 'quad_perm:[1,3,1,0]', 'quad_perm:[1,3,1,1]', 'quad_perm:[1,3,1,2]', 'quad_perm:[1,3,1,3]', 'quad_perm:[1,3,2,0]', 'quad_perm:[1,3,2,1]', 'quad_perm:[1,3,2,2]', 'quad_perm:[1,3,2,3]', 'quad_perm:[1,3,3,0]', 'quad_perm:[1,3,3,1]', 'quad_perm:[1,3,3,2]', 'quad_perm:[1,3,3,3]', 'quad_perm:[2,0,0,0]', 'quad_perm:[2,0,0,1]', 'quad_perm:[2,0,0,2]', 'quad_perm:[2,0,0,3]', 'quad_perm:[2,0,1,0]', 'quad_perm:[2,0,1,1]', 'quad_perm:[2,0,1,2]', 'quad_perm:[2,0,1,3]', 'quad_perm:[2,0,2,0]', 'quad_perm:[2,0,2,1]', 'quad_perm:[2,0,2,2]', 'quad_perm:[2,0,2,3]', 'quad_perm:[2,0,3,0]', 'quad_perm:[2,0,3,1]', 'quad_perm:[2,0,3,2]', 'quad_perm:[2,0,3,3]', 'quad_perm:[2,1,0,0]', 'quad_perm:[2,1,0,1]', 'quad_perm:[2,1,0,2]', 'quad_perm:[2,1,0,3]', 'quad_perm:[2,1,1,0]', 'quad_perm:[2,1,1,1]', 'quad_perm:[2,1,1,2]', 'quad_perm:[2,1,1,3]', 'quad_perm:[2,1,2,0]', 'quad_perm:[2,1,2,1]', 'quad_perm:[2,1,2,2]', 'quad_perm:[2,1,2,3]', 'quad_perm:[2,1,3,0]', 'quad_perm:[2,1,3,1]', 'quad_perm:[2,1,3,2]', 'quad_perm:[2,1,3,3]', 'quad_perm:[2,2,0,0]', 'quad_perm:[2,2,0,1]', 'quad_perm:[2,2,0,2]', 'quad_perm:[2,2,0,3]', 'quad_perm:[2,2,1,0]', 'quad_perm:[2,2,1,1]', 'quad_perm:[2,2,1,2]', 'quad_perm:[2,2,1,3]', 'quad_perm:[2,2,2,0]', 'quad_perm:[2,2,2,1]', 'quad_perm:[2,2,2,2]', 'quad_perm:[2,2,2,3]', 'quad_perm:[2,2,3,0]', 'quad_perm:[2,2,3,1]', 'quad_perm:[2,2,3,2]', 'quad_perm:[2,2,3,3]', 'quad_perm:[2,3,0,0]', 'quad_perm:[2,3,0,1]', 'quad_perm:[2,3,0,2]', 'quad_perm:[2,3,0,3]', 'quad_perm:[2,3,1,0]', 'quad_perm:[2,3,1,1]', 'quad_perm:[2,3,1,2]', 'quad_perm:[2,3,1,3]', 'quad_perm:[2,3,2,0]', 'quad_perm:[2,3,2,1]', 'quad_perm:[2,3,2,2]', 'quad_perm:[2,3,2,3]', 'quad_perm:[2,3,3,0]', 'quad_perm:[2,3,3,1]', 'quad_perm:[2,3,3,2]', 'quad_perm:[2,3,3,3]', 'quad_perm:[3,0,0,0]', 'quad_perm:[3,0,0,1]', 'quad_perm:[3,0,0,2]', 'quad_perm:[3,0,0,3]', 'quad_perm:[3,0,1,0]', 'quad_perm:[3,0,1,1]', 'quad_perm:[3,0,1,2]', 'quad_perm:[3,0,1,3]', 'quad_perm:[3,0,2,0]', 'quad_perm:[3,0,2,1]', 'quad_perm:[3,0,2,2]', 'quad_perm:[3,0,2,3]', 'quad_perm:[3,0,3,0]', 'quad_perm:[3,0,3,1]', 'quad_perm:[3,0,3,2]', 'quad_perm:[3,0,3,3]', 'quad_perm:[3,1,0,0]', 'quad_perm:[3,1,0,1]', 'quad_perm:[3,1,0,2]', 'quad_perm:[3,1,0,3]', 'quad_perm:[3,1,1,0]', 'quad_perm:[3,1,1,1]', 'quad_perm:[3,1,1,2]', 'quad_perm:[3,1,1,3]', 'quad_perm:[3,1,2,0]', 'quad_perm:[3,1,2,1]', 'quad_perm:[3,1,2,2]', 'quad_perm:[3,1,2,3]', 'quad_perm:[3,1,3,0]', 'quad_perm:[3,1,3,1]', 'quad_perm:[3,1,3,2]', 'quad_perm:[3,1,3,3]', 'quad_perm:[3,2,0,0]', 'quad_perm:[3,2,0,1]', 'quad_perm:[3,2,0,2]', 'quad_perm:[3,2,0,3]', 'quad_perm:[3,2,1,0]', 'quad_perm:[3,2,1,1]', 'quad_perm:[3,2,1,2]', 'quad_perm:[3,2,1,3]', 'quad_perm:[3,2,2,0]', 'quad_perm:[3,2,2,1]', 'quad_perm:[3,2,2,2]', 'quad_perm:[3,2,2,3]', 'quad_perm:[3,2,3,0]', 'quad_perm:[3,2,3,1]', 'quad_perm:[3,2,3,2]', 'quad_perm:[3,2,3,3]', 'quad_perm:[3,3,0,0]', 'quad_perm:[3,3,0,1]', 'quad_perm:[3,3,0,2]', 'quad_perm:[3,3,0,3]', 'quad_perm:[3,3,1,0]', 'quad_perm:[3,3,1,1]', 'quad_perm:[3,3,1,2]', 'quad_perm:[3,3,1,3]', 'quad_perm:[3,3,2,0]', 'quad_perm:[3,3,2,1]', 'quad_perm:[3,3,2,2]', 'quad_perm:[3,3,2,3]', 'quad_perm:[3,3,3,0]', 'quad_perm:[3,3,3,1]', 'quad_perm:[3,3,3,2]', 'quad_perm:[3,3,3,3]', 'row_mirror', 'row_half_mirror', 'row_bcast:15', 'row_bcast:31', 'wave_shl:1', 'wave_rol:1', 'wave_shr:1', 'wave_ror:1', 'row_shl:1', 'row_shr:1', 'row_ror:1', 'row_shl:2', 'row_shr:2', 'row_ror:2', 'row_shl:3', 'row_shr:3', 'row_ror:3', 'row_shl:4', 'row_shr:4', 'row_ror:4', 'row_shl:5', 'row_shr:5', 'row_ror:5', 'row_shl:6', 'row_shr:6', 'row_ror:6', 'row_shl:7', 'row_shr:7', 'row_ror:7', 'row_shl:8', 'row_shr:8', 'row_ror:8', 'row_shl:9', 'row_shr:9', 'row_ror:9', 'row_shl:10', 'row_shr:10', 'row_ror:10', 'row_shl:11', 'row_shr:11', 'row_ror:11', 'row_shl:12', 'row_shr:12', 'row_ror:12', 'row_shl:13', 'row_shr:13', 'row_ror:13', 'row_shl:14', 'row_shr:14', 'row_ror:14', 'row_shl:15', 'row_shr:15', 'row_ror:15'}, modifier_value)
# noinspection DuplicatedCode,PyUnusedLocal
def validate_modifier_synid_row_mask(category, instr_name, operands, modifiers, modifier_text, modifier_value):
"""
#### row_mask¶
Controls which rows are enabled for data sharing. By default, all rows are enabled.
Note: the lanes of a wavefront are organized in four rows and four banks. (There are only two rows in wave32 mode.)
Syntax | Description
> --- |---
> row_mask:{0..15} |
>
> Specifies a row mask as a positive integer number or an absolute expression.
>
> Each of 4 bits in the mask controls one row (0 - disabled, 1 - enabled).
>
> In wave32 mode the values should be limited to 0..7.
>
Examples:
row_mask:0xf
row_mask:0b1010
row_mask:x|y
"""
if modifier_value is None:
return
check(isinstance(modifier_value, int), modifier_value)
check(0 <= modifier_value <= 15, modifier_value)
# noinspection DuplicatedCode,PyUnusedLocal
def validate_modifier_synid_bank_mask(category, instr_name, operands, modifiers, modifier_text, modifier_value):
"""
#### bank_mask¶
Controls which banks are enabled for data sharing. By default, all banks are enabled.
Note: the lanes of a wavefront are organized in four rows and four banks. (There are only two rows in wave32 mode.)
Syntax | Description
> --- |---
> bank_mask:{0..15} |
>
> Specifies a bank mask as a positive integer number or an absolute expression.
>
> Each of 4 bits in the mask controls one bank (0 - disabled, 1 - enabled).
>
Examples:
bank_mask:0x3
bank_mask:0b0011
bank_mask:x&y
"""
if modifier_value is None:
return
check(isinstance(modifier_value, int), modifier_value)
check(0 <= modifier_value <= 15, modifier_value)
# noinspection DuplicatedCode,PyUnusedLocal
def validate_modifier_synid_bound_ctrl(category, instr_name, operands, modifiers, modifier_text, modifier_value):
"""
#### bound_ctrl¶
Controls data sharing when accessing an invalid lane. By default, data sharing with invalid lanes is disabled.
Syntax | Description
> --- |---
> bound_ctrl:1 |
>
> Enables data sharing with invalid lanes.
>
> Accessing data from an invalid lane will return zero.
>
"""
if modifier_value is not None:
check(modifier_value in {True, False}, modifier_value)
# noinspection DuplicatedCode,PyUnusedLocal
def validate_modifier_synid_dst_sel(category, instr_name, operands, modifiers, modifier_text, modifier_value):
"""
#### dst_sel¶
Selects which bits in the destination are affected. By default, all bits are affected.
Syntax | Description
> --- |---
> dst_sel:DWORD | Use bits 31:0.
> dst_sel:BYTE_0 | Use bits 7:0.
> dst_sel:BYTE_1 | Use bits 15:8.
> dst_sel:BYTE_2 | Use bits 23:16.
> dst_sel:BYTE_3 | Use bits 31:24.
> dst_sel:WORD_0 | Use bits 15:0.
> dst_sel:WORD_1 | Use bits 31:16.
"""
if modifier_value is None:
return
check(modifier_value in {'DWORD', 'BYTE_0', 'BYTE_1', 'BYTE_2', 'BYTE_3', 'WORD_0', 'WORD_1'}, modifier_value)
# noinspection DuplicatedCode,PyUnusedLocal
def validate_modifier_synid_dst_unused(category, instr_name, operands, modifiers, modifier_text, modifier_value):
"""
#### dst_unused¶
Controls what to do with the bits in the destination which are not selected by dst_sel. By default, unused bits are preserved.
Syntax | Description
> --- |---
> dst_unused:UNUSED_PAD | Pad with zeros.
> dst_unused:UNUSED_SEXT | Sign-extend upper bits, zero lower bits.
> dst_unused:UNUSED_PRESERVE | Preserve bits.
"""
if modifier_value is None:
return
check(modifier_value in {'UNUSED_PAD', 'UNUSED_SEXT', 'UNUSED_PRESERVE'}, modifier_value)
# noinspection DuplicatedCode,PyUnusedLocal
def validate_modifier_synid_src0_sel(category, instr_name, operands, modifiers, modifier_text, modifier_value):
"""
#### src0_sel¶
Controls which bits in the src0 are used. By default, all bits are used.
Syntax | Description
> --- |---
> src0_sel:DWORD | Use bits 31:0.
> src0_sel:BYTE_0 | Use bits 7:0.
> src0_sel:BYTE_1 | Use bits 15:8.
> src0_sel:BYTE_2 | Use bits 23:16.
> src0_sel:BYTE_3 | Use bits 31:24.
> src0_sel:WORD_0 | Use bits 15:0.
> src0_sel:WORD_1 | Use bits 31:16.
"""
if modifier_value is None:
return
check(modifier_value in {'DWORD', 'BYTE_0', 'BYTE_1', 'BYTE_2', 'BYTE_3', 'WORD_0', 'WORD_1'}, modifier_value)
# noinspection DuplicatedCode,PyUnusedLocal
def validate_modifier_synid_clamp(category, instr_name, operands, modifiers, modifier_text, modifier_value):
"""
#### clamp¶
Clamp meaning depends on instruction.
For v_cmp instructions, clamp modifier indicates that the compare signals if a floating point exception occurs. By default, signaling is disabled. Not supported by GFX7.
For integer operations, clamp modifier indicates that the result must be clamped to the largest and smallest representable value. By default, there is no clamping. Integer clamping is not supported by GFX7.
For floating point operations, clamp modifier indicates that the result must be clamped to the range [0.0, 1.0]. By default, there is no clamping.
Note: clamp modifier is applied after output modifiers (if any).
Syntax | Description
> --- |---
> clamp | Enables clamping (or signaling).
"""
if modifier_value is not None:
check(modifier_value in {True, False}, modifier_value)
# noinspection DuplicatedCode,PyUnusedLocal
def validate_modifier_synid_omod(category, instr_name, operands, modifiers, modifier_text, modifier_value):
"""
#### omod¶
Specifies if an output modifier must be applied to the result. By default, no output modifiers are applied.
Note: output modifiers are applied before clamping (if any).
Output modifiers are valid for f32 and f64 floating point results only. They must not be used with f16.
Note: v_cvt_f16_f32 is an exception. This instruction produces f16 result but accepts output modifiers.
Syntax | Description
> --- |---
> mul:2 | Multiply the result by 2.
> mul:4 | Multiply the result by 4.
> div:2 | Multiply the result by 0.5.
Note: numeric values may be specified as either integer numbers or absolute expressions.
Examples:
mul:2
mul:x // x must be equal to 2 or 4
"""
if modifier_value is None:
return
check(modifier_value in {'mul:2', 'mul:4', 'div:2'}, modifier_value)
# noinspection DuplicatedCode,PyUnusedLocal
def validate_modifier_synid_src1_sel(category, instr_name, operands, modifiers, modifier_text, modifier_value):
"""
#### src1_sel¶
Controls which bits in the src1 are used. By default, all bits are used.
Syntax | Description
> --- |---
> src1_sel:DWORD | Use bits 31:0.
> src1_sel:BYTE_0 | Use bits 7:0.
> src1_sel:BYTE_1 | Use bits 15:8.
> src1_sel:BYTE_2 | Use bits 23:16.
> src1_sel:BYTE_3 | Use bits 31:24.
> src1_sel:WORD_0 | Use bits 15:0.
> src1_sel:WORD_1 | Use bits 31:16.
"""
if modifier_value is None:
return
check(modifier_value in {'DWORD', 'BYTE_0', 'BYTE_1', 'BYTE_2', 'BYTE_3', 'WORD_0', 'WORD_1'}, modifier_value)
# noinspection DuplicatedCode,PyUnusedLocal
def validate_modifier_synid_vop3_op_sel(category, instr_name, operands, modifiers, modifier_text, modifier_value):
"""
#### op_sel¶
Selects the low [15:0] or high [31:16] operand bits for source and destination operands. By default, low bits are used for all operands.
The number of values specified with the op_sel modifier must match the number of instruction operands (both source and destination). First value controls src0, second value controls src1 and so on, except that the last value controls destination. The value 0 selects the low bits, while 1 selects the high bits.
Note: op_sel modifier affects 16-bit operands only. For 32-bit operands the value specified by op_sel must be 0.
GFX9 and GFX10 only.
Syntax | Description
> --- |---
> op_sel:[{0..1},{0..1}] | Select operand bits for instructions with 1 source operand.
> op_sel:[{0..1},{0..1},{0..1}] | Select operand bits for instructions with 2 source operands.
> op_sel:[{0..1},{0..1},{0..1},{0..1}] | Select operand bits for instructions with 3 source operands.
Note: numeric values may be specified as either integer numbers or absolute expressions.
Examples:
op_sel:[0,0]
op_sel:[0,1]
"""
if modifier_value is not None:
num_src_and_dst_operands = len(operands) # counting `vdst`
check(isinstance(modifier_value, list), modifier_value)
check(len(modifier_value) == num_src_and_dst_operands, modifier_value)
for x in modifier_value:
check(x in {0, 1}, modifier_value)
# noinspection DuplicatedCode,PyUnusedLocal
def validate_modifier_synid_high(category, instr_name, operands, modifiers, modifier_text, modifier_value):
"""
#### high¶
Specifies which half of the LDS word to use. Low half of LDS word is used by default. GFX9 and GFX10 only.
Syntax | Description
> --- |---
> high | Use high half of LDS word.
"""
if modifier_value is not None:
check(modifier_value in {True, False}, modifier_value)
# noinspection DuplicatedCode,PyUnusedLocal
def validate_modifier_synid_op_sel(category, instr_name, operands, modifiers, modifier_text, modifier_value):
"""
#### op_sel¶
Selects the low [15:0] or high [31:16] operand bits as input to the operation which results in the lower-half of the destination. By default, low bits are used for all operands.
The number of values specified by the op_sel modifier must match the number of source operands. First value controls src0, second value controls src1 and so on.
The value 0 selects the low bits, while 1 selects the high bits.
Syntax | Description
> --- |---
> op_sel:[{0..1}] | Select operand bits for instructions with 1 source operand.
> op_sel:[{0..1},{0..1}] | Select operand bits for instructions with 2 source operands.
> op_sel:[{0..1},{0..1},{0..1}] | Select operand bits for instructions with 3 source operands.
Note: numeric values may be specified as either integer numbers or absolute expressions.
Examples:
op_sel:[0,0]
op_sel:[0,1,0]
"""
if modifier_value is not None:
num_src_operands = len(operands) - 1 # not counting `vdst`
check(isinstance(modifier_value, list), modifier_value)
check(len(modifier_value) == num_src_operands, modifier_value)
for x in modifier_value:
check(x in {0, 1}, modifier_value)
# noinspection DuplicatedCode,PyUnusedLocal
def validate_modifier_synid_op_sel_hi(category, instr_name, operands, modifiers, modifier_text, modifier_value):
"""
#### op_sel_hi¶
Selects the low [15:0] or high [31:16] operand bits as input to the operation which results in the upper-half of the destination. By default, high bits are used for all operands.
The number of values specified by the op_sel_hi modifier must match the number of source operands. First value controls src0, second value controls src1 and so on.
The value 0 selects the low bits, while 1 selects the high bits.
Syntax | Description
> --- |---
> op_sel_hi:[{0..1}] | Select operand bits for instructions with 1 source operand.
> op_sel_hi:[{0..1},{0..1}] | Select operand bits for instructions with 2 source operands.
> op_sel_hi:[{0..1},{0..1},{0..1}] | Select operand bits for instructions with 3 source operands.
Note: numeric values may be specified as either integer numbers or absolute expressions.
Examples:
op_sel_hi:[0,0]
op_sel_hi:[0,0,1]
"""
if modifier_value is not None:
num_src_operands = len(operands) - 1 # not counting `vdst`
check(isinstance(modifier_value, list), modifier_value)
check(len(modifier_value) == num_src_operands, modifier_value)
for x in modifier_value:
check(x in {0, 1}, modifier_value)
# noinspection DuplicatedCode,PyUnusedLocal
def validate_modifier_synid_neg_lo(category, instr_name, operands, modifiers, modifier_text, modifier_value):
"""
#### neg_lo¶
Specifies whether to change sign of operand values selected by op_sel. These values are then used as input to the operation which results in the upper-half of the destination.
The number of values specified by this modifier must match the number of source operands. First value controls src0, second value controls src1 and so on.
The value 0 indicates that the corresponding operand value is used unmodified, the value 1 indicates that negative value of the operand must be used.
By default, operand values are used unmodified.
This modifier is valid for floating point operands only.
Syntax | Description
> --- |---
> neg_lo:[{0..1}] | Select affected operands for instructions with 1 source operand.
> neg_lo:[{0..1},{0..1}] | Select affected operands for instructions with 2 source operands.
> neg_lo:[{0..1},{0..1},{0..1}] | Select affected operands for instructions with 3 source operands.
Note: numeric values may be specified as either integer numbers or absolute expressions.
Examples:
neg_lo:[0]
neg_lo:[0,1]
"""
if modifier_value is not None:
num_src_operands = len(operands) - 1 # not counting `vdst`
check(isinstance(modifier_value, list), modifier_value)
check(len(modifier_value) == num_src_operands, modifier_value)
for x in modifier_value:
check(x in {0, 1}, modifier_value)
# noinspection DuplicatedCode,PyUnusedLocal
def validate_modifier_synid_neg_hi(category, instr_name, operands, modifiers, modifier_text, modifier_value):
"""
#### neg_hi¶
Specifies whether to change sign of operand values selected by op_sel_hi. These values are then used as input to the operation which results in the upper-half of the destination.
The number of values specified by this modifier must match the number of source operands. First value controls src0, second value controls src1 and so on.
The value 0 indicates that the corresponding operand value is used unmodified, the value 1 indicates that negative value of the operand must be used.
By default, operand values are used unmodified.
This modifier is valid for floating point operands only.
Syntax | Description
> --- |---
> neg_hi:[{0..1}] | Select affected operands for instructions with 1 source operand.
> neg_hi:[{0..1},{0..1}] | Select affected operands for instructions with 2 source operands.
> neg_hi:[{0..1},{0..1},{0..1}] | Select affected operands for instructions with 3 source operands.
Note: numeric values may be specified as either integer numbers or absolute expressions.
Examples:
neg_hi:[1,0]
neg_hi:[0,1,1]
"""
if modifier_value is not None:
num_src_operands = len(operands) - 1 # not counting `vdst`
check(isinstance(modifier_value, list), modifier_value)
check(len(modifier_value) == num_src_operands, modifier_value)
for x in modifier_value:
check(x in {0, 1}, modifier_value)
# noinspection DuplicatedCode,PyUnusedLocal
def validate_modifier_synid_mad_mix_op_sel(category, instr_name, operands, modifiers, modifier_text, modifier_value):
"""
#### m_op_sel¶
This operand has meaning only for 16-bit source operands as indicated by m_op_sel_hi. It specifies to select either the low [15:0] or high [31:16] operand bits as input to the operation.
The number of values specified by the op_sel modifier must match the number of source operands. First value controls src0, second value controls src1 and so on.
The value 0 indicates the low bits, the value 1 indicates the high 16 bits.
By default, low bits are used for all operands.
Syntax | Description
> --- |---
> op_sel:[{0..1},{0..1},{0..1}] | Select location of each 16-bit source operand.
Note: numeric values may be specified as either integer numbers or absolute expressions.
Examples:
op_sel:[0,1]
"""
if modifier_value is not None:
num_src_operands = len(operands) - 1 # not counting `vdst`
check(isinstance(modifier_value, list), modifier_value)
check(len(modifier_value) == num_src_operands, modifier_value)
for x in modifier_value:
check(x in {0, 1}, modifier_value)
# noinspection DuplicatedCode,PyUnusedLocal
def validate_modifier_synid_mad_mix_op_sel_hi(category, instr_name, operands, modifiers, modifier_text, modifier_value):
"""
#### m_op_sel_hi¶
Selects the size of source operands: either 32 bits or 16 bits. By default, 32 bits are used for all source operands.
The number of values specified by the op_sel_hi modifier must match the number of source operands. First value controls src0, second value controls src1 and so on.
The value 0 indicates 32 bits, the value 1 indicates 16 bits.
The location of 16 bits in the operand may be specified by m_op_sel.
Syntax | Description
> --- |---
> op_sel_hi:[{0..1},{0..1},{0..1}] | Select size of each source operand.
Note: numeric values may be specified as either integer numbers or absolute expressions.
Examples:
op_sel_hi:[1,1,1]
"""
if modifier_value is not None:
num_src_operands = len(operands) - 1 # not counting `vdst`
check(isinstance(modifier_value, list), modifier_value)
check(len(modifier_value) == num_src_operands, modifier_value)
for x in modifier_value:
check(x in {0, 1}, modifier_value)
"""
THIS FILE IS AUTO GENERATED.
ANY MODIFICATION WILL BE LOST AFTER REGENERATION.
"""
# flake8: noqa
# noinspection PyUnresolvedReferences
from typing import List
# noinspection PyUnresolvedReferences
from ...basic.exception import check, SeekTODOException
# noinspection PyUnresolvedReferences
from ...basic.register import *
# noinspection PyUnresolvedReferences
from ...basic.instr import Block, Waitcnt
def __check_alignment(operand_value: Gpr, operand_size: int):
if operand_value.rtype.is_special():
pass
elif operand_value.rtype.is_vgpr():
check(operand_value.align.is_aligned(1), operand_value)
elif operand_value.rtype.is_sgpr():
alignment = 1
if operand_size == 2:
alignment = 2
assert operand_size != 3
if operand_size >= 4:
alignment = 4
check(operand_value.align.is_aligned(alignment), operand_value)
else:
assert operand_value.rtype.is_agpr()
raise SeekTODOException("AGpr")
def __check_size(operand_value: Gpr, operand_size: int, /, allow_off: bool):
# If this operand is allowed to be `off`, and it's indeed `off`, don't check operand_size
if allow_off and operand_value.base_gpr is off:
return
if operand_size == 0:
raise SeekException(f"Expects `off` here, but got {operand_value}")
if operand_value.base_gpr in {scc, vccz, execz}:
# These Gprs are 1-bit, they will be extended to desired size
pass
else:
check(operand_value.count == operand_size,
f'Expects {operand_size} Gprs here, but got {operand_value}')
def __check_abs_neg_sext(operand_value: Gpr, allow_abs: bool, allow_neg: bool, allow_sext: bool):
if not allow_abs:
check(not operand_value.is_abs, f"abs() is not allowed here, but got {operand_value}")
if not allow_neg:
check(not operand_value.is_neg, f"neg() is not allowed here, but got {operand_value}")
if not allow_sext:
check(not operand_value.is_sext, f"sext() is not allowed here, but got {operand_value}")
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_vaddr(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# vaddr¶
An offset from the start of GDS/LDS memory.
Size: 1 dword.
Operands: v
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 1
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_vgpr(): return # v
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_vdata(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# vdata¶
Instruction input.
Size: 1 dword.
Operands: v
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 1
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_vgpr(): return # v
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_vdst(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# vdst¶
Instruction output.
Size: 1 dword.
Operands: v
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 1
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_vgpr(): return # v
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_vdst_1(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# vdst¶
Instruction output.
Size: 2 dwords.
Operands: v
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 2
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_vgpr(): return # v
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_vdata_1(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# vdata¶
Instruction input.
Size: 2 dwords.
Operands: v
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 2
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_vgpr(): return # v
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_vdata0(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# vdata0¶
Instruction input.
Size: 1 dword.
Operands: v
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 1
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_vgpr(): return # v
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_vdata1(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# vdata1¶
Instruction input.
Size: 1 dword.
Operands: v
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 1
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_vgpr(): return # v
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_vdata0_1(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# vdata0¶
Instruction input.
Size: 2 dwords.
Operands: v
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 2
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_vgpr(): return # v
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_vdata1_1(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# vdata1¶
Instruction input.
Size: 2 dwords.
Operands: v
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 2
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_vgpr(): return # v
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_vdst_2(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# vdst¶
Instruction output.
Size: 4 dwords.
Operands: v
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 4
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_vgpr(): return # v
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_vdst_3(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# vdst¶
Instruction output.
Size: 3 dwords.
Operands: v
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 3
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_vgpr(): return # v
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_vdata_2(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# vdata¶
Instruction input.
Size: 4 dwords.
Operands: v
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 4
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_vgpr(): return # v
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_vdata_3(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# vdata¶
Instruction input.
Size: 3 dwords.
Operands: v
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 3
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_vgpr(): return # v
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_tgt(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# tgt¶
An export target:
Syntax | Description
> --- |---
> pos{0..3} | Copy vertex position 0..3.
> param{0..31} | Copy vertex parameter 0..31.
> mrt{0..7} | Copy pixel color to the MRTs 0..7.
> mrtz | Copy pixel depth (Z) data.
> null | Copy nothing.
"""
raise SeekTODOException()
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_vsrc(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# vsrc¶
Data to copy to export buffers. This is an optional operand. Must be specified as off if not used.
compr modifier indicates use of compressed (16-bit) data. This limits number of source operands from 4 to 2:
* src0 and src1 must specify the first register (or off).
* src2 and src3 must specify the second register (or off).
An example:
exp mrtz v3, v3, off, off compr
Size: 1 dword.
Operands: v, off
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 1
__check_size(operand_value, operand_size, allow_off=True)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_vgpr(): return # v
if isinstance(operand_value, Gpr) and operand_value.base_gpr is off: return # off
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_vdst_4(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# vdst¶
Data returned by a 32-bit atomic flat instruction.
This is an optional operand. It must be used if and only if glc is specified.
Size: 1 dword.
Operands: v
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 1
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_vgpr(): return # v
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_vaddr_1(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# vaddr¶
A 64-bit flat address.
Size: 2 dwords.
Operands: v
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 2
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_vgpr(): return # v
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_vdst_5(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# vdst¶
Data returned by a 64-bit atomic flat instruction.
This is an optional operand. It must be used if and only if glc is specified.
Size: 2 dwords.
Operands: v
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 2
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_vgpr(): return # v
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_vaddr_2(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# vaddr¶
A 64-bit flat global address or a 32-bit offset depending on addressing mode:
* Address = vaddr + offset13s. vaddr is a 64-bit address. This mode is indicated by saddr set to off.
* Address = saddr + vaddr + offset13s. vaddr is a 32-bit offset. This mode is used when saddr is not off.
Size: 1 or 2 dwords.
Operands: v
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = None
if operands['saddr'] == off:
operand_size = 2
if operands['saddr'] != off:
operand_size = 1
assert operand_size is not None
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_vgpr(): return # v
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_saddr(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# saddr¶
An optional 64-bit flat global address. Must be specified as off if not used.
See vaddr for description of available addressing modes.
Size: 2 dwords.
Operands: s, flat_scratch, xnack_mask, vcc, ttmp, off
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 2
__check_size(operand_value, operand_size, allow_off=True)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_sgpr(): return # s
if isinstance(operand_value, Gpr) and operand_value.base_gpr is flat_scratch: return # flat_scratch
if isinstance(operand_value, Gpr) and operand_value.base_gpr is xnack_mask: return # xnack_mask
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vcc: return # vcc
if isinstance(operand_value, Gpr) and operand_value.base_gpr is off: return # off
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_vaddr_3(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# vaddr¶
An optional 32-bit flat scratch offset. Must be specified as off if not used.
Either this operand or saddr must be set to off.
Size: 1 dword.
Operands: v, off
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 1
__check_size(operand_value, operand_size, allow_off=True)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_vgpr(): return # v
if isinstance(operand_value, Gpr) and operand_value.base_gpr is off: return # off
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_saddr_1(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# saddr¶
An optional 32-bit flat scratch offset. Must be specified as off if not used.
Either this operand or vaddr must be set to off.
Size: 1 dword.
Operands: s, flat_scratch, xnack_mask, vcc, ttmp, off
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 1
__check_size(operand_value, operand_size, allow_off=True)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_sgpr(): return # s
if isinstance(operand_value, Gpr) and operand_value.base_gpr is flat_scratch: return # flat_scratch
if isinstance(operand_value, Gpr) and operand_value.base_gpr is xnack_mask: return # xnack_mask
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vcc: return # vcc
if isinstance(operand_value, Gpr) and operand_value.base_gpr is off: return # off
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_vdata_4(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# vdata¶
Input data for an atomic instruction.
Optionally may serve as an output data:
* If glc is specified, gets the memory value before the operation.
Size: depends on dmask and tfe:
* dmask may specify 1 data element for 32-bit-per-pixel surfaces or 2 data elements for 64-bit-per-pixel surfaces. Each data element occupies 1 dword.
* tfe adds 1 dword if specified.
Note: the surface data format is indicated in the image resource constant but not in the instruction.
Operands: v
"""
raise NotImplementedError('Unsupported for now')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_vaddr_4(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# vaddr¶
Image address which includes from one to four dimensional coordinates and other data used to locate a position in the image.
Size: 1, 2, 3, 4, 8 or 16 dwords. Actual size depends on opcode, specific image being handled and a16.
> Note 1. Image format and dimensions are encoded in the image resource constant but not in the instruction.
>
> Note 2. Actually image address size may vary from 1 to 13 dwords, but assembler currently supports a limited range of register sequences.
Operands: v
"""
raise NotImplementedError('Unsupported for now')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_srsrc(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# srsrc¶
Image resource constant which defines the location of the image buffer in memory, its dimensions, tiling, and data format.
Size: 8 dwords.
Operands: s, ttmp
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 8
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_sgpr(): return # s
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_vdata_5(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# vdata¶
Input data for an atomic instruction.
Optionally may serve as an output data:
* If glc is specified, gets the memory value before the operation.
Size: depends on dmask and tfe:
* dmask may specify 2 data elements for 32-bit-per-pixel surfaces or 4 data elements for 64-bit-per-pixel surfaces. Each data element occupies 1 dword.
* tfe adds 1 dword if specified.
Note: the surface data format is indicated in the image resource constant but not in the instruction.
Operands: v
"""
raise NotImplementedError('Unsupported for now')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_vdst_6(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# vdst¶
Image data to load by an image_gather4 instruction.
Size: 4 data elements by default. Each data element occupies either 32 bits or 16 bits depending on d16.
d16 and tfe affect operand size as follows:
* d16 specifies that data elements in registers are packed; each value occupies 16 bits.
* tfe adds one dword if specified.
Operands: v
"""
raise NotImplementedError('Unsupported for now')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_ssamp(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# ssamp¶
Sampler constant used to specify filtering options applied to the image data after it is read.
Size: 4 dwords.
Operands: s, ttmp
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 4
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_sgpr(): return # s
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_vdst_7(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# vdst¶
Image data to load by an image instruction.
Size: depends on dmask and tfe:
* dmask may specify from 1 to 4 data elements. Each data element occupies 1 dword.
* tfe adds 1 dword if specified.
Operands: v
"""
raise NotImplementedError('Unsupported for now')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_vdst_8(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# vdst¶
Image data to load by an image instruction.
Size: depends on dmask, tfe and d16:
* dmask may specify from 1 to 4 data elements. Each data element occupies either 32 bits or 16 bits depending on d16.
* d16 specifies that data elements in registers are packed; each value occupies 16 bits.
* tfe adds 1 dword if specified.
Operands: v
"""
raise NotImplementedError('Unsupported for now')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_vdata_6(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# vdata¶
Image data to store by an image_store instruction.
Size: depends on dmask and d16:
* dmask may specify from 1 to 4 data elements. Each data element occupies either 32 bits or 16 bits depending on d16.
* d16 specifies that data in registers are packed; each value occupies 16 bits.
Operands: v
"""
raise NotImplementedError('Unsupported for now')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_vdata_7(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# vdata¶
Image data to store by an image_store instruction.
Size: depends on dmask which may specify from 1 to 4 data elements. Each data element occupies 1 dword.
Operands: v
"""
raise NotImplementedError('Unsupported for now')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_vdst_9(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# vdst¶
Instruction output: data read from a memory buffer.
Size: 1 dword by default. tfe adds 1 dword if specified.
Operands: v
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = None
if not modifiers['tfe']:
operand_size = 1
if modifiers['tfe']:
operand_size = 2
assert operand_size is not None
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_vgpr(): return # v
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_vaddr_5(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# vaddr¶
This is an optional operand which may specify offset and/or index.
Size: 0, 1 or 2 dwords. Size is controlled by modifiers offen and idxen:
* If only idxen is specified, this operand supplies an index. Size is 1 dword.
* If only offen is specified, this operand supplies an offset. Size is 1 dword.
* If both modifiers are specified, index is in the first register and offset is in the second. Size is 2 dwords.
* If none of these modifiers are specified, this operand must be set to off.
Operands: v, off
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = None
if modifiers['idxen'] and modifiers['offen']:
operand_size = 2
if modifiers['idxen'] and not modifiers['offen']:
operand_size = 1
if not modifiers['idxen'] and modifiers['offen']:
operand_size = 1
if not modifiers['idxen'] and not modifiers['offen']:
operand_size = 0
assert operand_size is not None
__check_size(operand_value, operand_size, allow_off=True)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_vgpr(): return # v
if isinstance(operand_value, Gpr) and operand_value.base_gpr is off: return # off
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_srsrc_1(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# srsrc¶
Buffer resource constant which defines the address and characteristics of the buffer in memory.
Size: 4 dwords.
Operands: s, ttmp
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 4
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_sgpr(): return # s
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_soffset(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# soffset¶
An unsigned byte offset.
Size: 1 dword.
Operands: s, flat_scratch, xnack_mask, vcc, ttmp, m0, exec, vccz, execz, scc, constant
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 1
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_sgpr(): return # s
if isinstance(operand_value, Gpr) and operand_value.base_gpr is flat_scratch: return # flat_scratch
if isinstance(operand_value, Gpr) and operand_value.base_gpr is xnack_mask: return # xnack_mask
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vcc: return # vcc
if isinstance(operand_value, Gpr) and operand_value.base_gpr is m0: return # m0
if isinstance(operand_value, Gpr) and operand_value.base_gpr is exec: return # exec
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vccz: return # vccz
if isinstance(operand_value, Gpr) and operand_value.base_gpr is execz: return # execz
if isinstance(operand_value, Gpr) and operand_value.base_gpr is scc: return # scc
if isinstance(operand_value, int) and (-16 <= operand_value <= 64): return # constant
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_vdst_10(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# vdst¶
Instruction output: data read from a memory buffer.
Size: 2 dwords by default. tfe adds 1 dword if specified.
Operands: v
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = None
if not modifiers['tfe']:
operand_size = 2
if modifiers['tfe']:
operand_size = 3
assert operand_size is not None
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_vgpr(): return # v
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_vdst_11(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# vdst¶
Instruction output: data read from a memory buffer.
Size: 3 dwords by default. tfe adds 1 dword if specified.
Operands: v
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = None
if not modifiers['tfe']:
operand_size = 3
if modifiers['tfe']:
operand_size = 4
assert operand_size is not None
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_vgpr(): return # v
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_vdst_12(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# vdst¶
Instruction output: data read from a memory buffer.
Size: 4 dwords by default. tfe adds 1 dword if specified.
Operands: v
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = None
if not modifiers['tfe']:
operand_size = 4
if modifiers['tfe']:
operand_size = 5
assert operand_size is not None
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_vgpr(): return # v
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_vdata_8(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# vdata¶
Input data for an atomic instruction.
Optionally may serve as an output data:
* If glc is specified, gets the memory value before the operation.
Size: 1 dword by default. tfe adds 1 dword if specified.
Operands: v
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = None
if not modifiers['tfe']:
operand_size = 1
if modifiers['tfe']:
operand_size = 2
assert operand_size is not None
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_vgpr(): return # v
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_vdata_9(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# vdata¶
Input data for an atomic instruction.
Optionally may serve as an output data:
* If glc is specified, gets the memory value before the operation.
Size: 2 dwords by default. tfe adds 1 dword if specified.
Operands: v
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = None
if not modifiers['tfe']:
operand_size = 2
if modifiers['tfe']:
operand_size = 3
assert operand_size is not None
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_vgpr(): return # v
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_vdata_10(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# vdata¶
Input data for an atomic instruction.
Optionally may serve as an output data:
* If glc is specified, gets the memory value before the operation.
Size: 4 dwords by default. tfe adds 1 dword if specified.
Operands: v
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = None
if not modifiers['tfe']:
operand_size = 4
if modifiers['tfe']:
operand_size = 5
assert operand_size is not None
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_vgpr(): return # v
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_vdst_13(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# vdst¶
Instruction output: data read from a memory buffer.
If lds is specified, this operand is ignored by H/W and data are stored directly into LDS.
Size: 1 dword by default. tfe adds 1 dword if specified.
> Note that tfe and lds cannot be used together.
Operands: v
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = None
if not modifiers['tfe']:
operand_size = 1
if modifiers['tfe']:
operand_size = 2
assert operand_size is not None
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_vgpr(): return # v
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_probe(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# probe¶
A bit mask which indicates request permissions.
This operand must be specified as an integer_number or an absolute_expression. The value is truncated to 7 bits, but only 3 low bits are significant.
Bit Number | Description
> --- |---
> 0 | Request read permission.
> 1 | Request write permission.
> 2 | Request execute permission.
"""
raise SeekTODOException()
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_sbase(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# sbase¶
A 64-bit base address for scalar memory operations.
Size: 2 dwords.
Operands: s, flat_scratch, xnack_mask, vcc, ttmp
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 2
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_sgpr(): return # s
if isinstance(operand_value, Gpr) and operand_value.base_gpr is flat_scratch: return # flat_scratch
if isinstance(operand_value, Gpr) and operand_value.base_gpr is xnack_mask: return # xnack_mask
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vcc: return # vcc
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_soffset_1(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# soffset¶
An offset added to the base address to get memory address.
* If offset is specified as a register, it supplies an unsigned byte offset.
* If offset is specified as a 21-bit immediate, it supplies a signed byte offset.
Size: 1 dword.
Operands: s, flat_scratch, xnack_mask, vcc, ttmp, m0, simm21
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 1
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_sgpr(): return # s
if isinstance(operand_value, Gpr) and operand_value.base_gpr is flat_scratch: return # flat_scratch
if isinstance(operand_value, Gpr) and operand_value.base_gpr is xnack_mask: return # xnack_mask
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vcc: return # vcc
if isinstance(operand_value, Gpr) and operand_value.base_gpr is m0: return # m0
if isinstance(operand_value, int) and (-0x100000 <= operand_value < 0x100000): return # simm21
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_sbase_1(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# sbase¶
A 128-bit buffer resource constant for scalar memory operations which provides a base address, a size and a stride.
Size: 4 dwords.
Operands: s, ttmp
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 4
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_sgpr(): return # s
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_soffset_2(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# soffset¶
An unsigned 20-bit offset added to the base address to get memory address.
Size: 1 dword.
Operands: s, flat_scratch, xnack_mask, vcc, ttmp, m0, uimm20
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 1
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_sgpr(): return # s
if isinstance(operand_value, Gpr) and operand_value.base_gpr is flat_scratch: return # flat_scratch
if isinstance(operand_value, Gpr) and operand_value.base_gpr is xnack_mask: return # xnack_mask
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vcc: return # vcc
if isinstance(operand_value, Gpr) and operand_value.base_gpr is m0: return # m0
if isinstance(operand_value, int) and (0 <= operand_value < 0x100000): return # uimm20
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_sdata(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# sdata¶
Input data for an atomic instruction.
Optionally may serve as an output data:
* If glc is specified, gets the memory value before the operation.
Size: 1 dword.
Operands: s, flat_scratch, xnack_mask, vcc, ttmp
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 1
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_sgpr(): return # s
if isinstance(operand_value, Gpr) and operand_value.base_gpr is flat_scratch: return # flat_scratch
if isinstance(operand_value, Gpr) and operand_value.base_gpr is xnack_mask: return # xnack_mask
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vcc: return # vcc
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_sdata_1(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# sdata¶
Input data for an atomic instruction.
Optionally may serve as an output data:
* If glc is specified, gets the memory value before the operation.
Size: 2 dwords.
Operands: s, flat_scratch, xnack_mask, vcc, ttmp
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 2
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_sgpr(): return # s
if isinstance(operand_value, Gpr) and operand_value.base_gpr is flat_scratch: return # flat_scratch
if isinstance(operand_value, Gpr) and operand_value.base_gpr is xnack_mask: return # xnack_mask
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vcc: return # vcc
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_sdata_2(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# sdata¶
Input data for an atomic instruction.
Optionally may serve as an output data:
* If glc is specified, gets the memory value before the operation.
Size: 4 dwords.
Operands: s, ttmp
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 4
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_sgpr(): return # s
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_sdst(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# sdst¶
Instruction output.
Size: 1 dword.
Operands: s, flat_scratch, xnack_mask, vcc, ttmp
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 1
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_sgpr(): return # s
if isinstance(operand_value, Gpr) and operand_value.base_gpr is flat_scratch: return # flat_scratch
if isinstance(operand_value, Gpr) and operand_value.base_gpr is xnack_mask: return # xnack_mask
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vcc: return # vcc
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_sdst_1(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# sdst¶
Instruction output.
Size: 16 dwords.
Operands: s, ttmp
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 16
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_sgpr(): return # s
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_sdst_2(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# sdst¶
Instruction output.
Size: 2 dwords.
Operands: s, flat_scratch, xnack_mask, vcc, ttmp
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 2
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_sgpr(): return # s
if isinstance(operand_value, Gpr) and operand_value.base_gpr is flat_scratch: return # flat_scratch
if isinstance(operand_value, Gpr) and operand_value.base_gpr is xnack_mask: return # xnack_mask
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vcc: return # vcc
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_sdst_3(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# sdst¶
Instruction output.
Size: 4 dwords.
Operands: s, ttmp
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 4
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_sgpr(): return # s
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_sdst_4(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# sdst¶
Instruction output.
Size: 8 dwords.
Operands: s, ttmp
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 8
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_sgpr(): return # s
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_sdata_3(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# sdata¶
Instruction input.
Size: 1 dword.
Operands: s, flat_scratch, xnack_mask, vcc, ttmp
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 1
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_sgpr(): return # s
if isinstance(operand_value, Gpr) and operand_value.base_gpr is flat_scratch: return # flat_scratch
if isinstance(operand_value, Gpr) and operand_value.base_gpr is xnack_mask: return # xnack_mask
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vcc: return # vcc
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_sdata_4(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# sdata¶
Instruction input.
Size: 2 dwords.
Operands: s, flat_scratch, xnack_mask, vcc, ttmp
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 2
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_sgpr(): return # s
if isinstance(operand_value, Gpr) and operand_value.base_gpr is flat_scratch: return # flat_scratch
if isinstance(operand_value, Gpr) and operand_value.base_gpr is xnack_mask: return # xnack_mask
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vcc: return # vcc
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_sdata_5(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# sdata¶
Instruction input.
Size: 4 dwords.
Operands: s, ttmp
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 4
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_sgpr(): return # s
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_sbase_2(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# sbase¶
This operand is ignored by H/W and flat_scratch is supplied instead.
Size: 2 dwords.
Operands: s, flat_scratch, xnack_mask, vcc, ttmp
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 2
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_sgpr(): return # s
if isinstance(operand_value, Gpr) and operand_value.base_gpr is flat_scratch: return # flat_scratch
if isinstance(operand_value, Gpr) and operand_value.base_gpr is xnack_mask: return # xnack_mask
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vcc: return # vcc
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_sdst_5(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# sdst¶
Instruction output.
Size: 1 dword.
Operands: s, flat_scratch, xnack_mask, vcc, ttmp, m0, exec
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 1
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_sgpr(): return # s
if isinstance(operand_value, Gpr) and operand_value.base_gpr is flat_scratch: return # flat_scratch
if isinstance(operand_value, Gpr) and operand_value.base_gpr is xnack_mask: return # xnack_mask
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vcc: return # vcc
if isinstance(operand_value, Gpr) and operand_value.base_gpr is m0: return # m0
if isinstance(operand_value, Gpr) and operand_value.base_gpr is exec: return # exec
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_ssrc(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# ssrc¶
Instruction input.
Size: 1 dword.
Operands: s, flat_scratch, xnack_mask, vcc, ttmp, m0, exec, vccz, execz, scc, constant, literal
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 1
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_sgpr(): return # s
if isinstance(operand_value, Gpr) and operand_value.base_gpr is flat_scratch: return # flat_scratch
if isinstance(operand_value, Gpr) and operand_value.base_gpr is xnack_mask: return # xnack_mask
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vcc: return # vcc
if isinstance(operand_value, Gpr) and operand_value.base_gpr is m0: return # m0
if isinstance(operand_value, Gpr) and operand_value.base_gpr is exec: return # exec
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vccz: return # vccz
if isinstance(operand_value, Gpr) and operand_value.base_gpr is execz: return # execz
if isinstance(operand_value, Gpr) and operand_value.base_gpr is scc: return # scc
if isinstance(operand_value, int) and (-16 <= operand_value <= 64): return # constant
if isinstance(operand_value, int) and (-0x80000000 <= operand_value < 0xffffffff+1): return # literal
if isinstance(operand_value, float): return # literal
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_ssrc_1(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# ssrc¶
Instruction input.
Size: 2 dwords.
Operands: s, flat_scratch, xnack_mask, vcc, ttmp, exec, vccz, execz, scc, constant, literal
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 2
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_sgpr(): return # s
if isinstance(operand_value, Gpr) and operand_value.base_gpr is flat_scratch: return # flat_scratch
if isinstance(operand_value, Gpr) and operand_value.base_gpr is xnack_mask: return # xnack_mask
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vcc: return # vcc
if isinstance(operand_value, Gpr) and operand_value.base_gpr is exec: return # exec
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vccz: return # vccz
if isinstance(operand_value, Gpr) and operand_value.base_gpr is execz: return # execz
if isinstance(operand_value, Gpr) and operand_value.base_gpr is scc: return # scc
if isinstance(operand_value, int) and (-16 <= operand_value <= 64): return # constant
if isinstance(operand_value, int) and (-0x80000000 <= operand_value < 0xffffffff+1): return # literal
if isinstance(operand_value, float): return # literal
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_sdst_6(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# sdst¶
Instruction output.
Size: 2 dwords.
Operands: s, flat_scratch, xnack_mask, vcc, ttmp, exec
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 2
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_sgpr(): return # s
if isinstance(operand_value, Gpr) and operand_value.base_gpr is flat_scratch: return # flat_scratch
if isinstance(operand_value, Gpr) and operand_value.base_gpr is xnack_mask: return # xnack_mask
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vcc: return # vcc
if isinstance(operand_value, Gpr) and operand_value.base_gpr is exec: return # exec
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_ssrc_2(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# ssrc¶
Instruction input.
Size: 1 dword.
Operands: s, flat_scratch, xnack_mask, vcc, ttmp
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 1
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_sgpr(): return # s
if isinstance(operand_value, Gpr) and operand_value.base_gpr is flat_scratch: return # flat_scratch
if isinstance(operand_value, Gpr) and operand_value.base_gpr is xnack_mask: return # xnack_mask
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vcc: return # vcc
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_ssrc_3(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# ssrc¶
Instruction input.
Size: 2 dwords.
Operands: s, flat_scratch, xnack_mask, vcc, ttmp
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 2
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_sgpr(): return # s
if isinstance(operand_value, Gpr) and operand_value.base_gpr is flat_scratch: return # flat_scratch
if isinstance(operand_value, Gpr) and operand_value.base_gpr is xnack_mask: return # xnack_mask
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vcc: return # vcc
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_ssrc_4(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# ssrc¶
Instruction input.
Size: 2 dwords.
Operands: s, flat_scratch, xnack_mask, vcc, ttmp, exec, vccz, execz, scc, constant
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 2
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_sgpr(): return # s
if isinstance(operand_value, Gpr) and operand_value.base_gpr is flat_scratch: return # flat_scratch
if isinstance(operand_value, Gpr) and operand_value.base_gpr is xnack_mask: return # xnack_mask
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vcc: return # vcc
if isinstance(operand_value, Gpr) and operand_value.base_gpr is exec: return # exec
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vccz: return # vccz
if isinstance(operand_value, Gpr) and operand_value.base_gpr is execz: return # execz
if isinstance(operand_value, Gpr) and operand_value.base_gpr is scc: return # scc
if isinstance(operand_value, int) and (-16 <= operand_value <= 64): return # constant
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_imask(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# imask¶
This operand is a mask which controls indexing mode for operands of subsequent instructions. Bits 0, 1 and 2 control indexing of src0, src1 and src2, while bit 3 controls indexing of dst. Value 1 enables indexing and value 0 disables it.
Bit | Meaning
> --- |---
> 0 | Enables or disables src0 indexing.
> 1 | Enables or disables src1 indexing.
> 2 | Enables or disables src2 indexing.
> 3 | Enables or disables dst indexing.
This operand may be specified as one of the following:
* An integer_number or an absolute_expression. The value must be in the range 0..15.
* A gpr_idx value described below.
Gpr_idx Value Syntax | Description
> --- |---
> gpr_idx(<operands>) |
>
> Enable indexing for specified operands and disable it for the rest. Operands is a comma-separated list of values which may include:
>
> * “SRC0” - enable src0 indexing.
> * “SRC1” - enable src1 indexing.
> * “SRC2” - enable src2 indexing.
> * “DST” - enable dst indexing.
>
> Each of these values may be specified only once.
>
> Operands list may be empty; this syntax disables indexing for all operands.
>
Examples:
s_set_gpr_idx_mode 0
s_set_gpr_idx_mode gpr_idx() // the same as above
s_set_gpr_idx_mode 15
s_set_gpr_idx_mode gpr_idx(DST,SRC0,SRC1,SRC2) // the same as above
s_set_gpr_idx_mode gpr_idx(SRC0,SRC1,SRC2,DST) // the same as above
s_set_gpr_idx_mode gpr_idx(DST,SRC1)
"""
raise SeekTODOException()
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_imm16(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# imm16¶
An integer_number or an absolute_expression. The value must be in the range -32768..65535.
"""
check(isinstance(operand_value, int), operand_value)
check(-32768 <= operand_value <= 65535, operand_value)
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_label(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# label¶
A branch target which is a 16-bit signed integer treated as a PC-relative dword offset.
This operand may be specified as one of the following:
* An integer_number or an absolute_expression. The value must be in the range -32768..65535.
* A symbol (for example, a label) representing a relocatable address in the same compilation unit where it is referred from. The value is handled as a 16-bit PC-relative dword offset to be resolved by a linker.
Examples:
offset = 30
label_1:
label_2 = . + 4
s_branch 32
s_branch offset + 2
s_branch label_1
s_branch label_2
s_branch label_3
s_branch label_4
label_3 = label_2 + 4
label_4:
"""
if isinstance(operand_value, str):
check(operand_value)
return
check(isinstance(operand_value, Block), operand_value)
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_ssrc_5(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# ssrc¶
Instruction input.
Size: 2 dwords.
Operands: s, flat_scratch, xnack_mask, vcc, ttmp, exec
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 2
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_sgpr(): return # s
if isinstance(operand_value, Gpr) and operand_value.base_gpr is flat_scratch: return # flat_scratch
if isinstance(operand_value, Gpr) and operand_value.base_gpr is xnack_mask: return # xnack_mask
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vcc: return # vcc
if isinstance(operand_value, Gpr) and operand_value.base_gpr is exec: return # exec
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_ssrc_6(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# ssrc¶
Instruction input.
Size: 1 dword.
Operands: s, flat_scratch, xnack_mask, vcc, ttmp, m0, exec
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 1
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_sgpr(): return # s
if isinstance(operand_value, Gpr) and operand_value.base_gpr is flat_scratch: return # flat_scratch
if isinstance(operand_value, Gpr) and operand_value.base_gpr is xnack_mask: return # xnack_mask
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vcc: return # vcc
if isinstance(operand_value, Gpr) and operand_value.base_gpr is m0: return # m0
if isinstance(operand_value, Gpr) and operand_value.base_gpr is exec: return # exec
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_imm16_1(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# imm16¶
An integer_number or an absolute_expression. The value must be in the range 0..65535.
"""
check(isinstance(operand_value, int), operand_value)
check(0 <= operand_value <= 65535, operand_value)
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_hwreg(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# hwreg¶
Bits of a hardware register being accessed.
The bits of this operand have the following meaning:
Bits | Description | Value Range
> --- |--- |---
> 5:0 | Register id. | 0..63
> 10:6 | First bit offset. | 0..31
> 15:11 | Size in bits. | 1..32
This operand may be specified as one of the following:
* An integer_number or an absolute_expression. The value must be in the range 0..0xFFFF.
* An hwreg value described below.
Hwreg Value Syntax | Description
> --- |---
> hwreg({0..63}) | All bits of a register indicated by its id.
> hwreg(<name>) | All bits of a register indicated by its name.
> hwreg({0..63}, {0..31}, {1..32}) | Register bits indicated by register id, first bit offset and size.
> hwreg(<name>, {0..31}, {1..32}) | Register bits indicated by register name, first bit offset and size.
Numeric values may be specified as positive integer numbers or absolute expressions.
Defined register names include:
Name | Description
> --- |---
> HW_REG_MODE | Shader writeable mode bits.
> HW_REG_STATUS | Shader read-only status.
> HW_REG_TRAPSTS | Trap status.
> HW_REG_HW_ID | Id of wave, simd, compute unit, etc.
> HW_REG_GPR_ALLOC | Per-wave SGPR and VGPR allocation.
> HW_REG_LDS_ALLOC | Per-wave LDS allocation.
> HW_REG_IB_STS | Counters of outstanding instructions.
> HW_REG_SH_MEM_BASES | Memory aperture.
Examples:
reg = 1
offset = 2
size = 4
hwreg_enc = reg | (offset << 6) | ((size - 1) << 11)
s_getreg_b32 s2, 0x1881
s_getreg_b32 s2, hwreg_enc // the same as above
s_getreg_b32 s2, hwreg(1, 2, 4) // the same as above
s_getreg_b32 s2, hwreg(reg, offset, size) // the same as above
s_getreg_b32 s2, hwreg(15)
s_getreg_b32 s2, hwreg(51, 1, 31)
s_getreg_b32 s2, hwreg(HW_REG_LDS_ALLOC, 0, 1)
"""
raise SeekTODOException()
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_simm32(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# simm32¶
An integer_number or an absolute_expression. The value is truncated to 32 bits.
"""
check(isinstance(operand_value, int), operand_value)
check(-2147483648 <= operand_value <= 4294967295, operand_value)
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_imm16_2(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# imm16¶
A 16-bit integer_number or an absolute_expression. The value must be in the range -32768..65535.
"""
check(isinstance(operand_value, int), operand_value)
check(-32768 <= operand_value <= 65535, operand_value)
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_msg(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# msg¶
A 16-bit message code. The bits of this operand have the following meaning:
Bits | Description | Value Range
> --- |--- |---
> 3:0 | Message type. | 0..15
> 6:4 | Optional operation. | 0..7
> 7:7 | Unused. | -
> 9:8 | Optional stream. | 0..3
> 15:10 | Unused. | -
This operand may be specified as one of the following:
* An integer_number or an absolute_expression. The value must be in the range 0..0xFFFF.
* A sendmsg value described below.
Sendmsg Value Syntax | Description
> --- |---
> sendmsg(<type>) | A message identified by its type.
> sendmsg(<type>,<op>) | A message identified by its type and operation.
> sendmsg(<type>,<op>,<stream>) | A message identified by its type and operation with a stream id.
Type may be specified using message name or message id.
Op may be specified using operation name or operation id.
Stream id is an integer in the range 0..3.
Numeric values may be specified as positive integer numbers or absolute expressions.
Each message type supports specific operations:
Message name | Message Id | Supported Operations | Operation Id | Stream Id
> --- |--- |--- |--- |---
> MSG_INTERRUPT | 1 | - | - | -
> MSG_GS | 2 | GS_OP_CUT | 1 | Optional
> | | GS_OP_EMIT | 2 | Optional
> | | GS_OP_EMIT_CUT | 3 | Optional
> MSG_GS_DONE | 3 | GS_OP_NOP | 0 | -
> | | GS_OP_CUT | 1 | Optional
> | | GS_OP_EMIT | 2 | Optional
> | | GS_OP_EMIT_CUT | 3 | Optional
> MSG_SAVEWAVE | 4 | - | - | -
> MSG_STALL_WAVE_GEN | 5 | - | - | -
> MSG_HALT_WAVES | 6 | - | - | -
> MSG_ORDERED_PS_DONE | 7 | - | - | -
> MSG_EARLY_PRIM_DEALLOC | 8 | - | - | -
> MSG_GS_ALLOC_REQ | 9 | - | - | -
> MSG_GET_DOORBELL | 10 | - | - | -
> MSG_SYSMSG | 15 | SYSMSG_OP_ECC_ERR_INTERRUPT | 1 | -
> | | SYSMSG_OP_REG_RD | 2 | -
> | | SYSMSG_OP_HOST_TRAP_ACK | 3 | -
> | | SYSMSG_OP_TTRACE_PC | 4 | -
Sendmsg arguments are validated depending on how type value is specified:
* If message type is specified by name, arguments values must satisfy limitations detailed in the table above.
* If message type is specified as a number, each argument must not exceed corresponding value range (see the first table).
Examples:
// numeric message code
msg = 0x10
s_sendmsg 0x12
s_sendmsg msg + 2
// sendmsg with strict arguments validation
s_sendmsg sendmsg(MSG_INTERRUPT)
s_sendmsg sendmsg(MSG_GS, GS_OP_EMIT)
s_sendmsg sendmsg(MSG_GS, 2)
s_sendmsg sendmsg(MSG_GS_DONE, GS_OP_EMIT_CUT, 1)
s_sendmsg sendmsg(MSG_SYSMSG, SYSMSG_OP_TTRACE_PC)
s_sendmsg sendmsg(MSG_GET_DOORBELL)
// sendmsg with validation of value range only
msg = 2
op = 3
stream = 1
s_sendmsg sendmsg(msg, op, stream)
s_sendmsg sendmsg(2, GS_OP_CUT)
"""
raise SeekTODOException()
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_waitcnt(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# waitcnt¶
Counts of outstanding instructions to wait for.
The bits of this operand have the following meaning:
High Bits | Low Bits | Description | Value Range
> --- |--- |--- |---
> 15:14 | 3:0 | VM_CNT: vector memory operations count. | 0..63
> - | 6:4 | EXP_CNT: export count. | 0..7
> - | 11:8 | LGKM_CNT: LDS, GDS, Constant and Message count. | 0..15
This operand may be specified as one of the following:
* An integer_number or an absolute_expression. The value must be in the range 0..0xFFFF.
* A combination of vmcnt, expcnt, lgkmcnt and other values described below.
Syntax | Description
> --- |---
> vmcnt(<N>) | A VM_CNT value. N must not exceed the largest VM_CNT value.
> expcnt(<N>) | An EXP_CNT value. N must not exceed the largest EXP_CNT value.
> lgkmcnt(<N>) | An LGKM_CNT value. N must not exceed the largest LGKM_CNT value.
> vmcnt_sat(<N>) | A VM_CNT value computed as min(N, the largest VM_CNT value).
> expcnt_sat(<N>) | An EXP_CNT value computed as min(N, the largest EXP_CNT value).
> lgkmcnt_sat(<N>) | An LGKM_CNT value computed as min(N, the largest LGKM_CNT value).
These values may be specified in any order. Spaces, ampersands and commas may be used as optional separators.
N is either an integer number or an absolute expression.
Examples:
vm_cnt = 1
exp_cnt = 2
lgkm_cnt = 3
cnt = vm_cnt | (exp_cnt << 4) | (lgkm_cnt << 8)
s_waitcnt cnt
s_waitcnt 1 | (2 << 4) | (3 << 8) // the same as above
s_waitcnt vmcnt(1) expcnt(2) lgkmcnt(3) // the same as above
s_waitcnt vmcnt(vm_cnt) expcnt(exp_cnt) lgkmcnt(lgkm_cnt) // the same as above
s_waitcnt vmcnt(1)
s_waitcnt expcnt(2) lgkmcnt(3)
s_waitcnt vmcnt(1), expcnt(2), lgkmcnt(3)
s_waitcnt vmcnt(1) & lgkmcnt_sat(100) & expcnt(2)
"""
if isinstance(operand_value, int):
check(0 <= operand_value <= 65535, operand_value) # totally 16 bits
return
check(isinstance(operand_value, Waitcnt), operand_value)
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_param(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# param¶
Interpolation parameter to read:
Syntax | Description
> --- |---
> p0 | Parameter P0.
> p10 | Parameter P10.
> p20 | Parameter P20.
"""
raise SeekTODOException()
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_attr(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# attr¶
Interpolation attribute and channel:
Syntax | Description
> --- |---
> attr{0..32}.x | Attribute 0..32 with x channel.
> attr{0..32}.y | Attribute 0..32 with y channel.
> attr{0..32}.z | Attribute 0..32 with z channel.
> attr{0..32}.w | Attribute 0..32 with w channel.
Examples:
v_interp_p1_f32 v1, v0, attr0.x
v_interp_p1_f32 v1, v0, attr32.w
"""
raise SeekTODOException()
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_vsrc_1(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# vsrc¶
Instruction input.
Size: 1 dword.
Operands: v
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 1
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_vgpr(): return # v
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_src(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# src¶
Instruction input.
Size: 1 dword.
Operands: v, s, flat_scratch, xnack_mask, vcc, ttmp, m0, exec, vccz, execz, scc, lds_direct, constant, literal
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 1
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_vgpr(): return # v
if isinstance(operand_value, Gpr) and operand_value.rtype.is_sgpr(): return # s
if isinstance(operand_value, Gpr) and operand_value.base_gpr is flat_scratch: return # flat_scratch
if isinstance(operand_value, Gpr) and operand_value.base_gpr is xnack_mask: return # xnack_mask
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vcc: return # vcc
if isinstance(operand_value, Gpr) and operand_value.base_gpr is m0: return # m0
if isinstance(operand_value, Gpr) and operand_value.base_gpr is exec: return # exec
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vccz: return # vccz
if isinstance(operand_value, Gpr) and operand_value.base_gpr is execz: return # execz
if isinstance(operand_value, Gpr) and operand_value.base_gpr is scc: return # scc
if isinstance(operand_value, Gpr) and operand_value.base_gpr is lds_direct: return # lds_direct
if isinstance(operand_value, int) and (-16 <= operand_value <= 64): return # constant
if isinstance(operand_value, int) and (-0x80000000 <= operand_value < 0xffffffff+1): return # literal
if isinstance(operand_value, float): return # literal
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_src_1(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# src¶
Instruction input.
Size: 1 dword.
Operands: v, s, flat_scratch, xnack_mask, vcc, ttmp, m0, exec, vccz, execz, scc, constant
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 1
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_vgpr(): return # v
if isinstance(operand_value, Gpr) and operand_value.rtype.is_sgpr(): return # s
if isinstance(operand_value, Gpr) and operand_value.base_gpr is flat_scratch: return # flat_scratch
if isinstance(operand_value, Gpr) and operand_value.base_gpr is xnack_mask: return # xnack_mask
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vcc: return # vcc
if isinstance(operand_value, Gpr) and operand_value.base_gpr is m0: return # m0
if isinstance(operand_value, Gpr) and operand_value.base_gpr is exec: return # exec
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vccz: return # vccz
if isinstance(operand_value, Gpr) and operand_value.base_gpr is execz: return # execz
if isinstance(operand_value, Gpr) and operand_value.base_gpr is scc: return # scc
if isinstance(operand_value, int) and (-16 <= operand_value <= 64): return # constant
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_src_2(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# src¶
Instruction input.
Size: 2 dwords.
Operands: v, s, flat_scratch, xnack_mask, vcc, ttmp, exec, vccz, execz, scc, constant, literal
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 2
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_vgpr(): return # v
if isinstance(operand_value, Gpr) and operand_value.rtype.is_sgpr(): return # s
if isinstance(operand_value, Gpr) and operand_value.base_gpr is flat_scratch: return # flat_scratch
if isinstance(operand_value, Gpr) and operand_value.base_gpr is xnack_mask: return # xnack_mask
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vcc: return # vcc
if isinstance(operand_value, Gpr) and operand_value.base_gpr is exec: return # exec
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vccz: return # vccz
if isinstance(operand_value, Gpr) and operand_value.base_gpr is execz: return # execz
if isinstance(operand_value, Gpr) and operand_value.base_gpr is scc: return # scc
if isinstance(operand_value, int) and (-16 <= operand_value <= 64): return # constant
if isinstance(operand_value, int) and (-0x80000000 <= operand_value < 0xffffffff+1): return # literal
if isinstance(operand_value, float): return # literal
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_src_3(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# src¶
Instruction input.
Size: 1 dword.
Operands: v, s, flat_scratch, xnack_mask, vcc, ttmp, m0, exec, vccz, execz, scc, lds_direct, iconst, ival, literal
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 1
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_vgpr(): return # v
if isinstance(operand_value, Gpr) and operand_value.rtype.is_sgpr(): return # s
if isinstance(operand_value, Gpr) and operand_value.base_gpr is flat_scratch: return # flat_scratch
if isinstance(operand_value, Gpr) and operand_value.base_gpr is xnack_mask: return # xnack_mask
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vcc: return # vcc
if isinstance(operand_value, Gpr) and operand_value.base_gpr is m0: return # m0
if isinstance(operand_value, Gpr) and operand_value.base_gpr is exec: return # exec
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vccz: return # vccz
if isinstance(operand_value, Gpr) and operand_value.base_gpr is execz: return # execz
if isinstance(operand_value, Gpr) and operand_value.base_gpr is scc: return # scc
if isinstance(operand_value, Gpr) and operand_value.base_gpr is lds_direct: return # lds_direct
if isinstance(operand_value, int) and (-16 <= operand_value <= 64): return # iconst
if isinstance(operand_value, str) and operand_value in ('shared_base', 'shared_limit', 'private_base', 'private_limit', 'pops_exiting_wave_id'): return # ival
if isinstance(operand_value, int) and (-0x80000000 <= operand_value < 0xffffffff+1): return # literal
if isinstance(operand_value, float): return # literal
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_src_4(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# src¶
Instruction input.
Size: 1 dword.
Operands: v, s, flat_scratch, xnack_mask, vcc, ttmp, m0, exec, vccz, execz, scc, iconst, ival
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 1
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_vgpr(): return # v
if isinstance(operand_value, Gpr) and operand_value.rtype.is_sgpr(): return # s
if isinstance(operand_value, Gpr) and operand_value.base_gpr is flat_scratch: return # flat_scratch
if isinstance(operand_value, Gpr) and operand_value.base_gpr is xnack_mask: return # xnack_mask
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vcc: return # vcc
if isinstance(operand_value, Gpr) and operand_value.base_gpr is m0: return # m0
if isinstance(operand_value, Gpr) and operand_value.base_gpr is exec: return # exec
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vccz: return # vccz
if isinstance(operand_value, Gpr) and operand_value.base_gpr is execz: return # execz
if isinstance(operand_value, Gpr) and operand_value.base_gpr is scc: return # scc
if isinstance(operand_value, int) and (-16 <= operand_value <= 64): return # iconst
if isinstance(operand_value, str) and operand_value in ('shared_base', 'shared_limit', 'private_base', 'private_limit', 'pops_exiting_wave_id'): return # ival
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_sdst_7(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# sdst¶
Instruction output.
Size: 1 dword.
Operands: s, flat_scratch, xnack_mask, ttmp
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 1
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_sgpr(): return # s
if isinstance(operand_value, Gpr) and operand_value.base_gpr is flat_scratch: return # flat_scratch
if isinstance(operand_value, Gpr) and operand_value.base_gpr is xnack_mask: return # xnack_mask
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_src_5(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# src¶
Instruction input.
Size: 1 dword.
Operands: v, lds_direct
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 1
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_vgpr(): return # v
if isinstance(operand_value, Gpr) and operand_value.base_gpr is lds_direct: return # lds_direct
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_vcc(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# vcc¶
Vector condition code.
Size: 2 dwords.
Operands: vcc
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 2
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vcc: return # vcc
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_src_6(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# src¶
Instruction input.
Size: 1 dword.
Operands: v, s, flat_scratch, xnack_mask, vcc, ttmp, m0, exec, vccz, execz, scc, iconst, ival, literal
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 1
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_vgpr(): return # v
if isinstance(operand_value, Gpr) and operand_value.rtype.is_sgpr(): return # s
if isinstance(operand_value, Gpr) and operand_value.base_gpr is flat_scratch: return # flat_scratch
if isinstance(operand_value, Gpr) and operand_value.base_gpr is xnack_mask: return # xnack_mask
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vcc: return # vcc
if isinstance(operand_value, Gpr) and operand_value.base_gpr is m0: return # m0
if isinstance(operand_value, Gpr) and operand_value.base_gpr is exec: return # exec
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vccz: return # vccz
if isinstance(operand_value, Gpr) and operand_value.base_gpr is execz: return # execz
if isinstance(operand_value, Gpr) and operand_value.base_gpr is scc: return # scc
if isinstance(operand_value, int) and (-16 <= operand_value <= 64): return # iconst
if isinstance(operand_value, str) and operand_value in ('shared_base', 'shared_limit', 'private_base', 'private_limit', 'pops_exiting_wave_id'): return # ival
if isinstance(operand_value, int) and (-0x80000000 <= operand_value < 0xffffffff+1): return # literal
if isinstance(operand_value, float): return # literal
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_src_7(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# src¶
Instruction input.
Size: 1 dword.
Operands: v, s, flat_scratch, xnack_mask, vcc, ttmp, m0, exec, vccz, execz, scc, constant, literal
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 1
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_vgpr(): return # v
if isinstance(operand_value, Gpr) and operand_value.rtype.is_sgpr(): return # s
if isinstance(operand_value, Gpr) and operand_value.base_gpr is flat_scratch: return # flat_scratch
if isinstance(operand_value, Gpr) and operand_value.base_gpr is xnack_mask: return # xnack_mask
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vcc: return # vcc
if isinstance(operand_value, Gpr) and operand_value.base_gpr is m0: return # m0
if isinstance(operand_value, Gpr) and operand_value.base_gpr is exec: return # exec
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vccz: return # vccz
if isinstance(operand_value, Gpr) and operand_value.base_gpr is execz: return # execz
if isinstance(operand_value, Gpr) and operand_value.base_gpr is scc: return # scc
if isinstance(operand_value, int) and (-16 <= operand_value <= 64): return # constant
if isinstance(operand_value, int) and (-0x80000000 <= operand_value < 0xffffffff+1): return # literal
if isinstance(operand_value, float): return # literal
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_src_8(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# src¶
Instruction input.
Size: 1 dword.
Operands: v, s, flat_scratch, xnack_mask, vcc, ttmp, m0, exec, vccz, execz, scc, lds_direct, constant
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 1
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_vgpr(): return # v
if isinstance(operand_value, Gpr) and operand_value.rtype.is_sgpr(): return # s
if isinstance(operand_value, Gpr) and operand_value.base_gpr is flat_scratch: return # flat_scratch
if isinstance(operand_value, Gpr) and operand_value.base_gpr is xnack_mask: return # xnack_mask
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vcc: return # vcc
if isinstance(operand_value, Gpr) and operand_value.base_gpr is m0: return # m0
if isinstance(operand_value, Gpr) and operand_value.base_gpr is exec: return # exec
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vccz: return # vccz
if isinstance(operand_value, Gpr) and operand_value.base_gpr is execz: return # execz
if isinstance(operand_value, Gpr) and operand_value.base_gpr is scc: return # scc
if isinstance(operand_value, Gpr) and operand_value.base_gpr is lds_direct: return # lds_direct
if isinstance(operand_value, int) and (-16 <= operand_value <= 64): return # constant
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_simm32_1(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# simm32¶
A floating-point_number, an integer_number, or an absolute_expression. The value is converted to f16 as described here.
"""
check(isinstance(operand_value, int) or isinstance(operand_value, float), operand_value)
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_simm32_2(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# simm32¶
A floating-point_number, an integer_number, or an absolute_expression. The value is converted to f32 as described here.
"""
check(isinstance(operand_value, int) or isinstance(operand_value, float), operand_value)
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_src_9(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# src¶
Instruction input.
Size: 2 dwords.
Operands: v, s, flat_scratch, xnack_mask, vcc, ttmp, exec, vccz, execz, scc, constant
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 2
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_vgpr(): return # v
if isinstance(operand_value, Gpr) and operand_value.rtype.is_sgpr(): return # s
if isinstance(operand_value, Gpr) and operand_value.base_gpr is flat_scratch: return # flat_scratch
if isinstance(operand_value, Gpr) and operand_value.base_gpr is xnack_mask: return # xnack_mask
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vcc: return # vcc
if isinstance(operand_value, Gpr) and operand_value.base_gpr is exec: return # exec
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vccz: return # vccz
if isinstance(operand_value, Gpr) and operand_value.base_gpr is execz: return # execz
if isinstance(operand_value, Gpr) and operand_value.base_gpr is scc: return # scc
if isinstance(operand_value, int) and (-16 <= operand_value <= 64): return # constant
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_src_10(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# src¶
Instruction input.
Size: 1 dword.
Operands: v, s, flat_scratch, xnack_mask, vcc, ttmp, m0, exec, vccz, execz, scc, lds_direct, iconst, ival
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 1
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_vgpr(): return # v
if isinstance(operand_value, Gpr) and operand_value.rtype.is_sgpr(): return # s
if isinstance(operand_value, Gpr) and operand_value.base_gpr is flat_scratch: return # flat_scratch
if isinstance(operand_value, Gpr) and operand_value.base_gpr is xnack_mask: return # xnack_mask
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vcc: return # vcc
if isinstance(operand_value, Gpr) and operand_value.base_gpr is m0: return # m0
if isinstance(operand_value, Gpr) and operand_value.base_gpr is exec: return # exec
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vccz: return # vccz
if isinstance(operand_value, Gpr) and operand_value.base_gpr is execz: return # execz
if isinstance(operand_value, Gpr) and operand_value.base_gpr is scc: return # scc
if isinstance(operand_value, Gpr) and operand_value.base_gpr is lds_direct: return # lds_direct
if isinstance(operand_value, int) and (-16 <= operand_value <= 64): return # iconst
if isinstance(operand_value, str) and operand_value in ('shared_base', 'shared_limit', 'private_base', 'private_limit', 'pops_exiting_wave_id'): return # ival
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_vsrc_2(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# vsrc¶
Instruction input.
Size: 4 dwords.
Operands: v
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 4
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_vgpr(): return # v
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_ssrc_7(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# ssrc¶
Instruction input.
Size: 1 dword.
Operands: s, flat_scratch, xnack_mask, vcc, ttmp, m0, iconst
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 1
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_sgpr(): return # s
if isinstance(operand_value, Gpr) and operand_value.base_gpr is flat_scratch: return # flat_scratch
if isinstance(operand_value, Gpr) and operand_value.base_gpr is xnack_mask: return # xnack_mask
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vcc: return # vcc
if isinstance(operand_value, Gpr) and operand_value.base_gpr is m0: return # m0
if isinstance(operand_value, int) and (-16 <= operand_value <= 64): return # iconst
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_ssrc_8(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# ssrc¶
Instruction input.
Size: 1 dword.
Operands: s, flat_scratch, xnack_mask, vcc, ttmp, m0, exec, vccz, execz, scc, constant
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 1
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_sgpr(): return # s
if isinstance(operand_value, Gpr) and operand_value.base_gpr is flat_scratch: return # flat_scratch
if isinstance(operand_value, Gpr) and operand_value.base_gpr is xnack_mask: return # xnack_mask
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vcc: return # vcc
if isinstance(operand_value, Gpr) and operand_value.base_gpr is m0: return # m0
if isinstance(operand_value, Gpr) and operand_value.base_gpr is exec: return # exec
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vccz: return # vccz
if isinstance(operand_value, Gpr) and operand_value.base_gpr is execz: return # execz
if isinstance(operand_value, Gpr) and operand_value.base_gpr is scc: return # scc
if isinstance(operand_value, int) and (-16 <= operand_value <= 64): return # constant
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx9_vsrc_3(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# vsrc¶
Instruction input.
Size: 2 dwords.
Operands: v
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 2
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_vgpr(): return # v
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx906_vdst(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# vdst¶
Instruction output.
Size: 1 dword.
Operands: v
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 1
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_vgpr(): return # v
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx906_src(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# src¶
Instruction input.
Size: 1 dword.
Operands: v, s, flat_scratch, xnack_mask, vcc, ttmp, m0, exec, vccz, execz, scc, lds_direct, constant, literal
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 1
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_vgpr(): return # v
if isinstance(operand_value, Gpr) and operand_value.rtype.is_sgpr(): return # s
if isinstance(operand_value, Gpr) and operand_value.base_gpr is flat_scratch: return # flat_scratch
if isinstance(operand_value, Gpr) and operand_value.base_gpr is xnack_mask: return # xnack_mask
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vcc: return # vcc
if isinstance(operand_value, Gpr) and operand_value.base_gpr is m0: return # m0
if isinstance(operand_value, Gpr) and operand_value.base_gpr is exec: return # exec
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vccz: return # vccz
if isinstance(operand_value, Gpr) and operand_value.base_gpr is execz: return # execz
if isinstance(operand_value, Gpr) and operand_value.base_gpr is scc: return # scc
if isinstance(operand_value, Gpr) and operand_value.base_gpr is lds_direct: return # lds_direct
if isinstance(operand_value, int) and (-16 <= operand_value <= 64): return # constant
if isinstance(operand_value, int) and (-0x80000000 <= operand_value < 0xffffffff+1): return # literal
if isinstance(operand_value, float): return # literal
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx906_vsrc(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# vsrc¶
Instruction input.
Size: 1 dword.
Operands: v
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 1
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_vgpr(): return # v
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx906_src_1(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# src¶
Instruction input.
Size: 1 dword.
Operands: v, s, flat_scratch, xnack_mask, vcc, ttmp, m0, exec, vccz, execz, scc, constant
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 1
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_vgpr(): return # v
if isinstance(operand_value, Gpr) and operand_value.rtype.is_sgpr(): return # s
if isinstance(operand_value, Gpr) and operand_value.base_gpr is flat_scratch: return # flat_scratch
if isinstance(operand_value, Gpr) and operand_value.base_gpr is xnack_mask: return # xnack_mask
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vcc: return # vcc
if isinstance(operand_value, Gpr) and operand_value.base_gpr is m0: return # m0
if isinstance(operand_value, Gpr) and operand_value.base_gpr is exec: return # exec
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vccz: return # vccz
if isinstance(operand_value, Gpr) and operand_value.base_gpr is execz: return # execz
if isinstance(operand_value, Gpr) and operand_value.base_gpr is scc: return # scc
if isinstance(operand_value, int) and (-16 <= operand_value <= 64): return # constant
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx906_src_2(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# src¶
Instruction input.
Size: 1 dword.
Operands: v, s, flat_scratch, xnack_mask, vcc, ttmp, m0, exec, vccz, execz, scc, lds_direct, constant
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 1
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_vgpr(): return # v
if isinstance(operand_value, Gpr) and operand_value.rtype.is_sgpr(): return # s
if isinstance(operand_value, Gpr) and operand_value.base_gpr is flat_scratch: return # flat_scratch
if isinstance(operand_value, Gpr) and operand_value.base_gpr is xnack_mask: return # xnack_mask
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vcc: return # vcc
if isinstance(operand_value, Gpr) and operand_value.base_gpr is m0: return # m0
if isinstance(operand_value, Gpr) and operand_value.base_gpr is exec: return # exec
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vccz: return # vccz
if isinstance(operand_value, Gpr) and operand_value.base_gpr is execz: return # execz
if isinstance(operand_value, Gpr) and operand_value.base_gpr is scc: return # scc
if isinstance(operand_value, Gpr) and operand_value.base_gpr is lds_direct: return # lds_direct
if isinstance(operand_value, int) and (-16 <= operand_value <= 64): return # constant
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx906_src_3(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# src¶
Instruction input.
Size: 1 dword.
Operands: v, s, flat_scratch, xnack_mask, vcc, ttmp, m0, exec, vccz, execz, scc, lds_direct, iconst, ival
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 1
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_vgpr(): return # v
if isinstance(operand_value, Gpr) and operand_value.rtype.is_sgpr(): return # s
if isinstance(operand_value, Gpr) and operand_value.base_gpr is flat_scratch: return # flat_scratch
if isinstance(operand_value, Gpr) and operand_value.base_gpr is xnack_mask: return # xnack_mask
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vcc: return # vcc
if isinstance(operand_value, Gpr) and operand_value.base_gpr is m0: return # m0
if isinstance(operand_value, Gpr) and operand_value.base_gpr is exec: return # exec
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vccz: return # vccz
if isinstance(operand_value, Gpr) and operand_value.base_gpr is execz: return # execz
if isinstance(operand_value, Gpr) and operand_value.base_gpr is scc: return # scc
if isinstance(operand_value, Gpr) and operand_value.base_gpr is lds_direct: return # lds_direct
if isinstance(operand_value, int) and (-16 <= operand_value <= 64): return # iconst
if isinstance(operand_value, str) and operand_value in ('shared_base', 'shared_limit', 'private_base', 'private_limit', 'pops_exiting_wave_id'): return # ival
raise SeekException(f'Invalid operand: {operand_value}')
# noinspection DuplicatedCode,PyUnusedLocal
def validate_operand_synid_gfx906_src_4(category, instr_name, operands, modifiers, operand_text, operand_value, /, allow_abs: bool = False, allow_neg: bool = False, allow_sext: bool = False):
"""
# src¶
Instruction input.
Size: 1 dword.
Operands: v, s, flat_scratch, xnack_mask, vcc, ttmp, m0, exec, vccz, execz, scc, iconst, ival
"""
if isinstance(operand_value, Gpr):
# Check operand size
operand_size = 1
__check_size(operand_value, operand_size, allow_off=False)
# Check operand alignment
__check_alignment(operand_value, operand_size)
# Check operand abs(), neg(), sext()
__check_abs_neg_sext(operand_value, allow_abs, allow_neg, allow_sext)
# Check operands Gpr rtype
if isinstance(operand_value, Gpr) and operand_value.rtype.is_vgpr(): return # v
if isinstance(operand_value, Gpr) and operand_value.rtype.is_sgpr(): return # s
if isinstance(operand_value, Gpr) and operand_value.base_gpr is flat_scratch: return # flat_scratch
if isinstance(operand_value, Gpr) and operand_value.base_gpr is xnack_mask: return # xnack_mask
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vcc: return # vcc
if isinstance(operand_value, Gpr) and operand_value.base_gpr is m0: return # m0
if isinstance(operand_value, Gpr) and operand_value.base_gpr is exec: return # exec
if isinstance(operand_value, Gpr) and operand_value.base_gpr is vccz: return # vccz
if isinstance(operand_value, Gpr) and operand_value.base_gpr is execz: return # execz
if isinstance(operand_value, Gpr) and operand_value.base_gpr is scc: return # scc
if isinstance(operand_value, int) and (-16 <= operand_value <= 64): return # iconst
if isinstance(operand_value, str) and operand_value in ('shared_base', 'shared_limit', 'private_base', 'private_limit', 'pops_exiting_wave_id'): return # ival
raise SeekException(f'Invalid operand: {operand_value}')
from seek import * # noqa: F403 ('from seek import *' used; unable to detect undefined names)
import unittest
class TestGpr(unittest.TestCase):
def _assert_gpr_not_view(self, gpr, rtype, name, count, align, repr_s):
self.assertFalse(gpr.is_view)
self.assertEqual(gpr.rtype, rtype)
self.assertEqual(gpr.name, name)
self.assertEqual(gpr.count, count)
self.assertEqual(gpr.align, align)
self.assertIs(gpr.base_gpr, gpr)
self.assertEqual(gpr.base_offset, 0)
self.assertEqual(repr(gpr), repr_s)
def _assert_gpr_is_view(self, gpr, rtype, name, count, align, base_gpr, base_offset, repr_s):
self.assertTrue(gpr.is_view)
self.assertEqual(gpr.rtype, rtype)
self.assertEqual(gpr.name, name)
self.assertEqual(gpr.count, count)
self.assertEqual(gpr.align, align)
self.assertIs(gpr.base_gpr, base_gpr)
self.assertEqual(gpr.base_offset, base_offset)
self.assertEqual(repr(gpr), repr_s)
def test_subscription_and_alias(self):
v_value = new(name="value", rtype=GprType.V, count=4, align=4)
self._assert_gpr_not_view(v_value, rtype=GprType.V, name="value", count=4, align=Align(4,0),
repr_s="VGpr4('value', align=4)")
v_value23 = v_value[2:3]
self._assert_gpr_is_view(v_value23, rtype=GprType.V, name="value[2:3]",
count=2, align=Align(4,2), base_gpr=v_value, base_offset=2,
repr_s="VGpr2('@value[2:3]', align=(4,2))")
self._assert_gpr_is_view(v_value23[0], rtype=GprType.V, name="value[2:3][0]",
count=1, align=Align(4,2), base_gpr=v_value, base_offset=2,
repr_s="VGpr1('@value[2:3][0]', ref=VGpr4('value', align=4)[2])")
self._assert_gpr_is_view(v_value23[0:0], rtype=GprType.V, name="value[2:3][0:0]",
count=1, align=Align(4,2), base_gpr=v_value, base_offset=2,
repr_s="VGpr1('@value[2:3][0:0]', ref=VGpr4('value', align=4)[2])")
self._assert_gpr_is_view(v_value23[0:1][1][0], rtype=GprType.V, name="value[2:3][0:1][1][0]",
count=1, align=Align(4,3), base_gpr=v_value, base_offset=3,
repr_s="VGpr1('@value[2:3][0:1][1][0]', ref=VGpr4('value', align=4)[3])")
v_aliased = v_value23[0:1].alias('aliased')
self._assert_gpr_is_view(v_aliased, rtype=GprType.V, name="aliased",
count=2, align=Align(4,2), base_gpr=v_value, base_offset=2,
repr_s="VGpr2('@aliased', ref=VGpr4('value', align=4)[2:3])")
self._assert_gpr_is_view(v_aliased[1], rtype=GprType.V, name="aliased[1]",
count=1, align=Align(4,3), base_gpr=v_value, base_offset=3,
repr_s="VGpr1('@aliased[1]', ref=VGpr4('value', align=4)[3])")
v_inferred = v_value[1:2][1].alias() # aliased name is inferred from assignment target 'v_inferred'
self._assert_gpr_is_view(v_inferred, rtype=GprType.V, name="inferred",
count=1, align=Align(4,2), base_gpr=v_value, base_offset=2,
repr_s="VGpr1('@inferred', ref=VGpr4('value', align=4)[2])")
def test_new_register(self):
v_data = new()
self._assert_gpr_not_view(v_data, rtype=GprType.V, name="data",
count=1, align=Align(1,0), repr_s="VGpr1('data')")
s_data2 = new(count=2)
self._assert_gpr_not_view(s_data2, rtype=GprType.S, name="data2",
count=2, align=Align(1,0), repr_s="SGpr2('data2')")
s_list = new[3](count=2)
for i in range(0, 3):
self._assert_gpr_not_view(s_list[i], rtype=GprType.S, name=f"list_{i}",
count=2, align=Align(1,0), repr_s=f"SGpr2('list_{i}')")
v_matrix = new[3,4]() # default count is 1
for i in range(0, 3):
for j in range(0, 4):
self._assert_gpr_not_view(v_matrix[i,j], rtype=GprType.V, name=f"matrix_{i}_{j}",
count=1, align=Align(1,0), repr_s=f"VGpr1('matrix_{i}_{j}')")
v_tensor = new[3,4,5]() # default count is 1
for i in range(0, 3):
for j in range(0, 4):
for k in range(0, 5):
self._assert_gpr_not_view(v_tensor[i,j,k], rtype=GprType.V, name=f"tensor_{i}_{j}_{k}",
count=1, align=Align(1,0), repr_s=f"VGpr1('tensor_{i}_{j}_{k}')")
# noinspection PyStatementEffect
def test_invalid_subscription(self):
v_data = new()
# Should not throw
v_data[0]
v_data[0][0]
v_data[0:0][0]
# Should throw
self.assertRaises(SeekException, lambda: v_data[1])
self.assertRaises(SeekException, lambda: v_data[1:1])
self.assertRaises(SeekException, lambda: v_data[0:1])
self.assertRaises(SeekException, lambda: v_data[-1])
self.assertRaises(SeekException, lambda: v_data[-1:0])
v_data2 = new(count=2)
# Should not throw
v_data2[0]
v_data2[1]
v_data2[0:1]
v_data2[1:1]
v_data2[0:1][1]
# Should throw
self.assertRaises(SeekException, lambda: v_data2[2])
self.assertRaises(SeekException, lambda: v_data2[1:2])
self.assertRaises(SeekException, lambda: v_data2[0:2])
self.assertRaises(SeekException, lambda: v_data2[-1])
self.assertRaises(SeekException, lambda: v_data2[-1:0])
self.assertRaises(SeekException, lambda: v_data2[0:1][2])
# noinspection PyStatementEffect
def test_neg_abs_sext(self):
v_value = new(count=2)
# Should not throw
-v_value
abs(v_value)
-abs(v_value[0])
sext(v_value[1])
# Should throw
self.assertRaises(SeekException, lambda: abs(-v_value))
self.assertRaises(SeekException, lambda: abs(abs(v_value)))
self.assertRaises(SeekException, lambda: -(-v_value))
self.assertRaises(SeekException, lambda: sext(-v_value))
self.assertRaises(SeekException, lambda: sext(abs(v_value)))
self.assertRaises(SeekException, lambda: abs(sext(v_value)))
self.assertRaises(SeekException, lambda: sext(sext(v_value)))
self.assertRaises(SeekException, lambda: -(sext(v_value)))
# repr
self.assertEqual(repr(-v_value), "-VGpr2('@value')")
self.assertEqual(repr(abs(v_value)), "|VGpr2|('@value')")
self.assertEqual(repr(-abs(v_value)), "-|VGpr2|('@value')")
self.assertEqual(repr(sext(v_value)), "VGpr2.sext('@value')")
self.assertEqual(repr(-v_value[1]), "-VGpr1('@value[1]')")
self.assertEqual(repr(abs(v_value[1]).alias('xxx')), "|VGpr1|('@xxx', ref=VGpr2('value')[1])")
self.assertEqual(repr(-abs(v_value[0])), "-|VGpr1|('@value[0]')")
self.assertEqual(repr(sext(v_value[1:1][0])), "VGpr1.sext('@value[1:1][0]', ref=VGpr2('value')[1])")
def test_compare(self):
self.assertTrue(vcc[0] == vcc_lo)
self.assertTrue(vcc[1] == vcc_hi)
self.assertTrue({vcc[1], vcc_lo, vcc[0:1]} == {vcc, vcc[0], vcc_hi}) # Gpr is hashable
self.assertTrue(vcc[0] == -vcc[0]) # neg() is not considered in compare
self.assertTrue(vcc_lo == abs(vcc[0])) # abs() is not considered in compare
self.assertTrue(vcc[0] == -abs(vcc_lo)) # neg(), abs() are not considered in compare
self.assertTrue(vcc[0] == sext(vcc_lo)) # sext() is not considered in compare
# Gprs are ordered
v_r1 = new()
s_r2 = new()
self.assertTrue(v_r1 != s_r2)
self.assertFalse(v_r1 == s_r2)
self.assertTrue(v_r1 < s_r2)
self.assertTrue(v_r1 <= s_r2)
# Compare with None
objNone = None
# noinspection DuplicatedCode
self.assertTrue(threadIdx.x != objNone)
self.assertFalse(threadIdx.x == objNone)
self.assertRaises(TypeError, lambda: threadIdx.x < objNone)
self.assertRaises(TypeError, lambda: threadIdx.x <= objNone)
self.assertRaises(TypeError, lambda: threadIdx.x > objNone)
self.assertRaises(TypeError, lambda: threadIdx.x >= objNone)
# Compare with types other than Gpr
objInt = 42
# noinspection DuplicatedCode
self.assertTrue(threadIdx.x != objInt)
self.assertFalse(threadIdx.x == objInt)
self.assertRaises(TypeError, lambda: threadIdx.x < objInt)
self.assertRaises(TypeError, lambda: threadIdx.x <= objInt)
self.assertRaises(TypeError, lambda: threadIdx.x > objInt)
self.assertRaises(TypeError, lambda: threadIdx.x >= objInt)
class TestGprSet(unittest.TestCase):
def test_is_superset(self):
v_data = new(count=4)
s_data = new(count=4, align=2)
gprset = GprSet(v_data[0], vcc_hi, threadIdx.x, vcc, s_data[2:3], execz, exec, v_data[3], xnack_mask_lo)
gprset._sanity_check()
self.assertTrue(gprset.is_superset(vcc_lo))
self.assertTrue(gprset.is_superset(vcc_hi))
self.assertTrue(gprset.is_superset(vcc))
self.assertTrue(gprset.is_superset(xnack_mask_lo))
self.assertTrue(gprset.is_superset(s_data[2]))
self.assertTrue(gprset.is_superset(s_data[3]))
self.assertTrue(gprset.is_superset(s_data[2:3]))
self.assertFalse(gprset.is_superset(s_data))
self.assertFalse(gprset.is_superset(v_data))
self.assertFalse(gprset.is_superset(v_data[2:3]))
self.assertFalse(gprset.is_superset(xnack_mask_hi))
self.assertFalse(gprset.is_superset(xnack_mask))
def test_is_intersected(self):
v_data = new(count=4)
s_data = new(count=4, align=2)
gprset = GprSet(v_data[0], vcc_hi, threadIdx.x, vcc, s_data[2:3], execz, exec, v_data[3], xnack_mask_lo)
gprset._sanity_check()
self.assertTrue(gprset.is_intersected(vcc_lo))
self.assertTrue(gprset.is_intersected(vcc_hi))
self.assertTrue(gprset.is_intersected(vcc))
self.assertTrue(gprset.is_intersected(exec_hi))
self.assertTrue(gprset.is_intersected(xnack_mask))
self.assertTrue(gprset.is_intersected(s_data[2]))
self.assertTrue(gprset.is_intersected(s_data[3]))
self.assertTrue(gprset.is_intersected(s_data))
self.assertTrue(gprset.is_intersected(v_data[0]))
self.assertTrue(gprset.is_intersected(v_data))
self.assertFalse(gprset.is_intersected(threadIdx.y))
self.assertFalse(gprset.is_intersected(blockIdx.z))
self.assertFalse(gprset.is_intersected(vccz))
self.assertFalse(gprset.is_intersected(lds_direct))
def test_set_operation(self):
v_data = new(count=4)
s_data = new(count=4, align=2)
gprset = GprSet(v_data[0], vcc_hi, threadIdx.x, vcc, s_data[2:3], execz, exec, v_data[3])
gprset._sanity_check()
self.assertListEqual(gprset.base_gprs, [vcc, exec, execz, threadIdx.x, v_data, s_data])
self.assertListEqual(gprset.expanded_gprs,
[vcc_lo, vcc_hi, exec_lo, exec_hi, execz, threadIdx.x,
v_data[0], v_data[3], s_data[2], s_data[3]])
self.assertTrue(gprset)
tmp = gprset.union(v_data, s_kernarg)
tmp._sanity_check()
self.assertListEqual(tmp.base_gprs, [vcc, exec, execz, s_kernarg, threadIdx.x, v_data, s_data])
self.assertListEqual(tmp.expanded_gprs,
[vcc_lo, vcc_hi, exec_lo, exec_hi, execz, s_kernarg[0], s_kernarg[1], threadIdx.x,
v_data[0], v_data[1], v_data[2], v_data[3], s_data[2], s_data[3]])
tmp = gprset.difference(exec_hi, s_data[1:2], exec_lo, vcc_hi, blockIdx.x)
tmp._sanity_check()
self.assertListEqual(tmp.base_gprs, [vcc, execz, threadIdx.x, v_data, s_data])
self.assertListEqual(tmp.expanded_gprs,
[vcc_lo, execz, threadIdx.x, v_data[0], v_data[3], s_data[3]])
tmp = gprset.intersect(GprSet(exec_hi, s_data[1:2], exec_lo, vcc_hi, blockIdx.x))
tmp._sanity_check()
self.assertListEqual(tmp.base_gprs, [vcc, exec, s_data])
self.assertListEqual(tmp.expanded_gprs,
[vcc_hi, exec_lo, exec_hi, s_data[2]])
if __name__ == '__main__':
unittest.main()
import unittest
from typing import Any
from seek.basic.exception import SeekException
from seek.basic.utility import get_caller_assignments
class TestUtility(unittest.TestCase):
def test_get_caller_assignments(self):
x1 = get_caller_assignments(stack=0)
self.assertEqual(x1, "x1")
x2, = get_caller_assignments(stack=0)
self.assertEqual(x2, "x2") # `x2` is not a list any more
x3, x4 = get_caller_assignments(stack=0)
self.assertTupleEqual((x3, x4), ("x3", "x4"))
x5, (x6, [x7, (x8, x9), _]) = get_caller_assignments(stack=0)
self.assertTupleEqual((x5, x6, x7, x8, x9, _), ("x5", "x6", "x7", "x8", "x9", "_"))
x10: Any = get_caller_assignments(stack=0)
self.assertEqual(x10, "x10")
# This is not an assignment and should return None
self.assertIsNone(get_caller_assignments(stack=0))
# The stack is invalid, so it should raise SeekException
# Note that we didn't actually parse the source code here (as the stack depth is invalid),
# so multi-line source code is OK
self.assertRaisesRegex(SeekException,
r"Can't get frame at stack depth 1000000 from bottom",
lambda: get_caller_assignments(stack=1000000))
if __name__ == "__main__":
unittest.main()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment