Arm neon
arm_neon
¶
ARM_NEON_INDEX_BY_NAME = {f'v{i}': i for i in range(0, 32)}
module-attribute
¶
UNALLOCATED_NEON = NEONRegisterType.unallocated()
module-attribute
¶
V0 = NEONRegisterType.from_name('v0')
module-attribute
¶
V1 = NEONRegisterType.from_name('v1')
module-attribute
¶
V2 = NEONRegisterType.from_name('v2')
module-attribute
¶
V3 = NEONRegisterType.from_name('v3')
module-attribute
¶
V4 = NEONRegisterType.from_name('v4')
module-attribute
¶
V5 = NEONRegisterType.from_name('v5')
module-attribute
¶
V6 = NEONRegisterType.from_name('v6')
module-attribute
¶
V7 = NEONRegisterType.from_name('v7')
module-attribute
¶
V8 = NEONRegisterType.from_name('v8')
module-attribute
¶
V9 = NEONRegisterType.from_name('v9')
module-attribute
¶
V10 = NEONRegisterType.from_name('v10')
module-attribute
¶
V11 = NEONRegisterType.from_name('v11')
module-attribute
¶
V12 = NEONRegisterType.from_name('v12')
module-attribute
¶
V13 = NEONRegisterType.from_name('v13')
module-attribute
¶
V14 = NEONRegisterType.from_name('v14')
module-attribute
¶
V15 = NEONRegisterType.from_name('v15')
module-attribute
¶
V16 = NEONRegisterType.from_name('v16')
module-attribute
¶
V17 = NEONRegisterType.from_name('v17')
module-attribute
¶
V18 = NEONRegisterType.from_name('v18')
module-attribute
¶
V19 = NEONRegisterType.from_name('v19')
module-attribute
¶
V20 = NEONRegisterType.from_name('v20')
module-attribute
¶
V21 = NEONRegisterType.from_name('v21')
module-attribute
¶
V22 = NEONRegisterType.from_name('v22')
module-attribute
¶
V23 = NEONRegisterType.from_name('v23')
module-attribute
¶
V24 = NEONRegisterType.from_name('v24')
module-attribute
¶
V25 = NEONRegisterType.from_name('v25')
module-attribute
¶
V26 = NEONRegisterType.from_name('v26')
module-attribute
¶
V27 = NEONRegisterType.from_name('v27')
module-attribute
¶
V28 = NEONRegisterType.from_name('v28')
module-attribute
¶
V29 = NEONRegisterType.from_name('v29')
module-attribute
¶
V30 = NEONRegisterType.from_name('v30')
module-attribute
¶
V31 = NEONRegisterType.from_name('v31')
module-attribute
¶
ARM_NEON = Dialect('arm_neon', [DSSFmlaVecScalarOp, DSSFMulOp, DSDupOp, DSVecMovOp, DVarSSt1Op, DVarSLd1Op, GetRegisterOp], [NeonArrangementAttr, NEONRegisterType])
module-attribute
¶
NEONRegisterType
dataclass
¶
Bases: ARMRegisterType
A 128-bit NEON ARM register type.
Source code in xdsl/dialects/arm_neon.py
NeonArrangement
¶
Bases: StrEnum
The arrangement specifier for NEON instructions determines element size and count. We assume full 128-bit registers. Possible arrangements: - D → 2 double-precision floats - S → 4 single-precision floats - H → 8 half-precision floats
Source code in xdsl/dialects/arm_neon.py
NeonArrangementAttr
dataclass
¶
Bases: EnumAttribute[NeonArrangement], SpacedOpaqueSyntaxAttribute
Attribute containing the arrangement specification.
Source code in xdsl/dialects/arm_neon.py
name = 'arm_neon.arrangement'
class-attribute
instance-attribute
¶
GetRegisterOp
¶
Bases: ARMAsmOperation
This instruction allows us to create an SSAValue for a given register name.
Source code in xdsl/dialects/arm_neon.py
DSSFMulOp
¶
Bases: ARMInstruction
Floating-point multiply. Different instruction types supported:
- Vector: multiplies corresponding floating-point values in the vectors in the two source NEON registers, and writes the result vector to the destination.
See external documentation.
- Mixed: (first source operand is a vector, second is a scalar. Destination is a vector)
This instruction multiplies each of the floating-point values in the first source
operand by the second source operand and writes the resulting values to the corresponding
lanes of the destination.
Encoding: FMUL
. , . , . .
See external documentation.
Source code in xdsl/dialects/arm_neon.py
name = 'arm_neon.dss.fmul'
class-attribute
instance-attribute
¶
d = result_def(NEONRegisterType)
class-attribute
instance-attribute
¶
s1 = operand_def(NEONRegisterType)
class-attribute
instance-attribute
¶
s2 = operand_def(NEONRegisterType)
class-attribute
instance-attribute
¶
scalar_idx = opt_prop_def(IntegerAttr[i8])
class-attribute
instance-attribute
¶
arrangement = prop_def(NeonArrangementAttr)
class-attribute
instance-attribute
¶
assembly_format = '$s1 `,` $s2 (`[` $scalar_idx^ `]`)? $arrangement attr-dict `:` functional-type(operands, $d)'
class-attribute
instance-attribute
¶
__init__(s1: Operation | SSAValue, s2: Operation | SSAValue, *, d: NEONRegisterType, scalar_idx: IntegerAttr | None, arrangement: NeonArrangement | NeonArrangementAttr, comment: str | StringAttr | None = None)
¶
Source code in xdsl/dialects/arm_neon.py
assembly_line_args()
¶
Source code in xdsl/dialects/arm_neon.py
DSSFmlaVecScalarOp
¶
Bases: ARMInstruction
Floating-point fused Multiply-Add to accumulator (mixed: first source operand is a vector, second is a scalar.
Destination is a vector)
This instruction multiplies the values in the first source operand by the second source operand,
adds the accumulated value from the destination operand, and writes the resulting values to the destination.
Encoding: FMLA
See external documentation.
Source code in xdsl/dialects/arm_neon.py
SAME_NEON_REGISTER_TYPE: ClassVar = VarConstraint('SAME_NEON_REGISTER_TYPE', base(NEONRegisterType))
class-attribute
instance-attribute
¶
name = 'arm_neon.dss.fmla'
class-attribute
instance-attribute
¶
res = result_def(SAME_NEON_REGISTER_TYPE)
class-attribute
instance-attribute
¶
d = operand_def(SAME_NEON_REGISTER_TYPE)
class-attribute
instance-attribute
¶
s1 = operand_def(NEONRegisterType)
class-attribute
instance-attribute
¶
s2 = operand_def(NEONRegisterType)
class-attribute
instance-attribute
¶
scalar_idx = prop_def(IntegerAttr[i8])
class-attribute
instance-attribute
¶
arrangement = prop_def(NeonArrangementAttr)
class-attribute
instance-attribute
¶
assembly_format = '$d `,` $s1 `,` $s2 `[` $scalar_idx `]` $arrangement attr-dict `:` `(` type($s1) `,` type($s2) `)` `->` type($res)'
class-attribute
instance-attribute
¶
__init__(d: Operation | SSAValue, s1: Operation | SSAValue, s2: Operation | SSAValue, *, res: NEONRegisterType, scalar_idx: IntegerAttr, arrangement: NeonArrangement | NeonArrangementAttr, comment: str | StringAttr | None = None)
¶
Source code in xdsl/dialects/arm_neon.py
assembly_instruction_name() -> str
¶
assembly_line_args()
¶
Source code in xdsl/dialects/arm_neon.py
DSDupOp
¶
Bases: ARMInstruction
Duplicate general-purpose register to vector.
Source code in xdsl/dialects/arm_neon.py
name = 'arm_neon.ds.dup'
class-attribute
instance-attribute
¶
s = operand_def(IntRegisterType)
class-attribute
instance-attribute
¶
d = result_def(NEONRegisterType)
class-attribute
instance-attribute
¶
arrangement = prop_def(NeonArrangementAttr)
class-attribute
instance-attribute
¶
assembly_format = '$s $arrangement attr-dict `:` type($s) `->` type($d)'
class-attribute
instance-attribute
¶
__init__(s: Operation | SSAValue, *, d: NEONRegisterType, arrangement: NeonArrangement | NeonArrangementAttr, comment: str | StringAttr | None = None)
¶
Source code in xdsl/dialects/arm_neon.py
DSVecMovOp
¶
Bases: ARMInstruction
Variant of MOV instruction which extracts a value from a specified lane in a NEON register into a general-purpose register. e.g. MOV X0, V3.S[1] Set X0 to the value of the second single word (bits 32-63) in V3. This instruction is an alias of UMOV.
Source code in xdsl/dialects/arm_neon.py
name = 'arm_neon.dsvec.mov'
class-attribute
instance-attribute
¶
s = operand_def(NEONRegisterType)
class-attribute
instance-attribute
¶
d = result_def(IntRegisterType)
class-attribute
instance-attribute
¶
scalar_idx = prop_def(IntegerAttr[i8])
class-attribute
instance-attribute
¶
arrangement = prop_def(NeonArrangementAttr)
class-attribute
instance-attribute
¶
assembly_format = '$s `[` $scalar_idx `]` $arrangement attr-dict `:` type($s) `->` type($d)'
class-attribute
instance-attribute
¶
__init__(s: Operation | SSAValue, *, d: IntRegisterType, arrangement: NeonArrangement | NeonArrangementAttr, scalar_idx: IntegerAttr, comment: str | StringAttr | None = None)
¶
Source code in xdsl/dialects/arm_neon.py
DVarSLd1Op
¶
Bases: ARMInstruction
Neon structure load instruction reads data from memory into 64-bit Neon registers. LD1 loads data from memory into up to four registers, with no interleaving.
Source code in xdsl/dialects/arm_neon.py
name = 'arm_neon.dvars.ld1'
class-attribute
instance-attribute
¶
s = operand_def(IntRegisterType)
class-attribute
instance-attribute
¶
dest_regs = var_result_def(NEONRegisterType)
class-attribute
instance-attribute
¶
arrangement = prop_def(NeonArrangementAttr)
class-attribute
instance-attribute
¶
assembly_format = ' ` ` `[` $s `]` $arrangement attr-dict `:` type($s) `->` `(` type($dest_regs) `)`'
class-attribute
instance-attribute
¶
__init__(s: Operation | SSAValue, result_types: Sequence[Attribute], *, arrangement: NeonArrangement | NeonArrangementAttr, comment: str | StringAttr | None = None)
¶
Source code in xdsl/dialects/arm_neon.py
verify_() -> None
¶
DVarSSt1Op
¶
Bases: ARMInstruction
Neon structure store instruction stores data from 64-bit Neon registers to memory. ST1 stores one to four registers of data to memory, with no interleaving.
Source code in xdsl/dialects/arm_neon.py
name = 'arm_neon.dvars.st1'
class-attribute
instance-attribute
¶
d = operand_def(IntRegisterType)
class-attribute
instance-attribute
¶
src_regs = var_operand_def(NEONRegisterType)
class-attribute
instance-attribute
¶
arrangement = prop_def(NeonArrangementAttr)
class-attribute
instance-attribute
¶
assembly_format = '$src_regs ` ` `[` $d `]` $arrangement attr-dict `:` `(` type($src_regs) `)` `->` type($d)'
class-attribute
instance-attribute
¶
__init__(d: IntRegisterType, src_regs: Sequence[SSAValue], *, arrangement: NeonArrangement | NeonArrangementAttr, comment: str | StringAttr | None = None)
¶
Source code in xdsl/dialects/arm_neon.py
verify_() -> None
¶
vector_with_arrangement(reg: NEONRegisterType | SSAValue, arrangement: NeonArrangementAttr, *, index: int | None = None) -> str
¶
Source code in xdsl/dialects/arm_neon.py
variadic_neon_reg_arg(regs: Sequence[SSAValue], arrangement: NeonArrangementAttr) -> str
¶
Returns the assembly string for a variadic NEON register argument with the given arrangement.