blob: 26e80c5e236e84c83aa744b4451e46bacda09de0 [file]
!sum
- go: Add
commutative: true
extension: "AVX.*"
documentation: !string |-
// NAME adds corresponding elements of two vectors.
- go: AddSaturated
commutative: true
extension: "AVX.*"
documentation: !string |-
// NAME adds corresponding elements of two vectors with saturation.
- go: Sub
commutative: false
extension: "AVX.*"
documentation: !string |-
// NAME subtracts corresponding elements of two vectors.
- go: SubSaturated
commutative: false
extension: "AVX.*"
documentation: !string |-
// NAME subtracts corresponding elements of two vectors with saturation.
- go: AddPairs
commutative: false
extension: "AVX.*"
documentation: !string |-
// NAME horizontally adds adjacent pairs of elements.
// For x = [x0, x1, x2, x3, ...] and y = [y0, y1, y2, y3, ...], the result is [y0+y1, y2+y3, ..., x0+x1, x2+x3, ...].
- go: SubPairs
commutative: false
extension: "AVX.*"
documentation: !string |-
// NAME horizontally subtracts adjacent pairs of elements.
// For x = [x0, x1, x2, x3, ...] and y = [y0, y1, y2, y3, ...], the result is [y0-y1, y2-y3, ..., x0-x1, x2-x3, ...].
- go: AddPairsSaturated
commutative: false
extension: "AVX.*"
documentation: !string |-
// NAME horizontally adds adjacent pairs of elements with saturation.
// For x = [x0, x1, x2, x3, ...] and y = [y0, y1, y2, y3, ...], the result is [y0+y1, y2+y3, ..., x0+x1, x2+x3, ...].
- go: SubPairsSaturated
commutative: false
extension: "AVX.*"
documentation: !string |-
// NAME horizontally subtracts adjacent pairs of elements with saturation.
// For x = [x0, x1, x2, x3, ...] and y = [y0, y1, y2, y3, ...], the result is [y0-y1, y2-y3, ..., x0-x1, x2-x3, ...].
- go: And
commutative: true
extension: "AVX.*"
documentation: !string |-
// NAME performs a bitwise AND operation between two vectors.
- go: Or
commutative: true
extension: "AVX.*"
documentation: !string |-
// NAME performs a bitwise OR operation between two vectors.
- go: AndNot
commutative: false
extension: "AVX.*"
documentation: !string |-
// NAME performs a bitwise x &^ y.
- go: Xor
commutative: true
extension: "AVX.*"
documentation: !string |-
// NAME performs a bitwise XOR operation between two vectors.
# We also have PTEST and VPTERNLOG, those should be hidden from the users
# and only appear in rewrite rules.
# const imm predicate(holds for both float and int|uint):
# 0: Equal
# 1: Less
# 2: LessEqual
# 4: NotEqual
# 5: GreaterEqual
# 6: Greater
- go: Equal
constImm: 0
commutative: true
extension: "AVX.*"
documentation: !string |-
// NAME compares for equality.
- go: Less
constImm: 1
commutative: false
extension: "AVX.*"
documentation: !string |-
// NAME compares for less than.
- go: LessEqual
constImm: 2
commutative: false
extension: "AVX.*"
documentation: !string |-
// NAME compares for less than or equal.
- go: IsNan # For float only.
constImm: 3
commutative: true
extension: "AVX.*"
documentation: !string |-
// NAME checks if elements are NaN. Use as x.IsNan(x).
- go: NotEqual
constImm: 4
commutative: true
extension: "AVX.*"
documentation: !string |-
// NAME compares for inequality.
- go: GreaterEqual
constImm: 13
commutative: false
extension: "AVX.*"
documentation: !string |-
// NAME compares for greater than or equal.
- go: Greater
constImm: 14
commutative: false
extension: "AVX.*"
documentation: !string |-
// NAME compares for greater than.
- go: ConvertToInt32
commutative: false
extension: "AVX.*"
documentation: !string |-
// ConvertToInt32 converts element values to int32.
- go: ConvertToUint32
commutative: false
extension: "AVX.*"
documentation: !string |-
// ConvertToUint32Masked converts element values to uint32.
- go: Div
commutative: false
extension: "AVX.*"
documentation: !string |-
// NAME divides elements of two vectors.
- go: Sqrt
commutative: false
extension: "AVX.*"
documentation: !string |-
// NAME computes the square root of each element.
- go: ApproximateReciprocal
commutative: false
extension: "AVX.*"
documentation: !string |-
// NAME computes an approximate reciprocal of each element.
- go: ApproximateReciprocalOfSqrt
commutative: false
extension: "AVX.*"
documentation: !string |-
// NAME computes an approximate reciprocal of the square root of each element.
- go: Scale
commutative: false
extension: "AVX.*"
documentation: !string |-
// NAME multiplies elements by a power of 2.
- go: Round
commutative: false
extension: "AVX.*"
constImm: 0
documentation: !string |-
// NAME rounds elements to the nearest integer.
- go: RoundScaled
commutative: false
extension: "AVX.*"
constImm: 0
documentation: !string |-
// NAME rounds elements with specified precision.
- go: RoundScaledResidue
commutative: false
extension: "AVX.*"
constImm: 0
documentation: !string |-
// NAME computes the difference after rounding with specified precision.
- go: Floor
commutative: false
extension: "AVX.*"
constImm: 1
documentation: !string |-
// NAME rounds elements down to the nearest integer.
- go: FloorScaled
commutative: false
extension: "AVX.*"
constImm: 1
documentation: !string |-
// NAME rounds elements down with specified precision.
- go: FloorScaledResidue
commutative: false
extension: "AVX.*"
constImm: 1
documentation: !string |-
// NAME computes the difference after flooring with specified precision.
- go: Ceil
commutative: false
extension: "AVX.*"
constImm: 2
documentation: !string |-
// NAME rounds elements up to the nearest integer.
- go: CeilScaled
commutative: false
extension: "AVX.*"
constImm: 2
documentation: !string |-
// NAME rounds elements up with specified precision.
- go: CeilScaledResidue
commutative: false
extension: "AVX.*"
constImm: 2
documentation: !string |-
// NAME computes the difference after ceiling with specified precision.
- go: Trunc
commutative: false
extension: "AVX.*"
constImm: 3
documentation: !string |-
// NAME truncates elements towards zero.
- go: TruncScaled
commutative: false
extension: "AVX.*"
constImm: 3
documentation: !string |-
// NAME truncates elements with specified precision.
- go: TruncScaledResidue
commutative: false
extension: "AVX.*"
constImm: 3
documentation: !string |-
// NAME computes the difference after truncating with specified precision.
- go: AddSub
commutative: false
extension: "AVX.*"
documentation: !string |-
// NAME subtracts even elements and adds odd elements of two vectors.
- go: GaloisFieldAffineTransform
commutative: false
extension: "AVX.*"
documentation: !string |-
// NAME computes an affine transformation in GF(2^8):
// x is a vector of 8-bit vectors, with each adjacent 8 as a group; y is a vector of 8x8 1-bit matrixes;
// b is an 8-bit vector. The affine transformation is y * x + b, with each element of y
// corresponding to a group of 8 elements in x.
- go: GaloisFieldAffineTransformInverse
commutative: false
extension: "AVX.*"
documentation: !string |-
// NAME computes an affine transformation in GF(2^8),
// with x inverted with respect to reduction polynomial x^8 + x^4 + x^3 + x + 1:
// x is a vector of 8-bit vectors, with each adjacent 8 as a group; y is a vector of 8x8 1-bit matrixes;
// b is an 8-bit vector. The affine transformation is y * x + b, with each element of y
// corresponding to a group of 8 elements in x.
- go: GaloisFieldMul
commutative: false
extension: "AVX.*"
documentation: !string |-
// NAME computes element-wise GF(2^8) multiplication with
// reduction polynomial x^8 + x^4 + x^3 + x + 1.
- go: Average
commutative: true
extension: "AVX.*" # VPAVGB/W are available across various AVX versions
documentation: !string |-
// NAME computes the rounded average of corresponding elements.
- go: Absolute
commutative: false
# Unary operation, not commutative
extension: "AVX.*" # VPABSB/W/D are AVX, VPABSQ is AVX512
documentation: !string |-
// NAME computes the absolute value of each element.
- go: Sign
# Applies sign of second operand to first: sign(val, sign_src)
commutative: false
extension: "AVX.*"
documentation: !string |-
// NAME returns the product of the first operand with -1, 0, or 1,
// whichever constant is nearest to the value of the second operand.
# Sign does not have masked version
- go: PopCount
commutative: false
extension: "AVX512.*"
documentation: !string |-
// NAME counts the number of set bits in each element.
- go: PairDotProd
commutative: false
extension: "AVX.*"
documentation: !string |-
// NAME multiplies the elements and add the pairs together,
// yielding a vector of half as many elements with twice the input element size.
# TODO: maybe simplify this name within the receiver-type + method-naming scheme we use.
- go: SaturatedUnsignedSignedPairDotProd
commutative: false
extension: "AVX.*"
documentation: !string |-
// NAME multiplies the elements and add the pairs together with saturation,
// yielding a vector of half as many elements with twice the input element size.
# QuadDotProd, i.e. VPDPBUSD(S) are operations with src/dst on the same register, we are not supporting this as of now.
- go: DotProdBroadcast
commutative: true
extension: "AVX.*"
documentation: !string |-
// NAME multiplies all elements and broadcasts the sum.
- go: UnsignedSignedQuadDotProdAccumulate
commutative: false
extension: "AVX.*"
documentation: !string |-
// NAME performs dot products on groups of 4 elements of x and y and then adds z.
- go: SaturatedUnsignedSignedQuadDotProdAccumulate
commutative: false
extension: "AVX.*"
documentation: !string |-
// NAME multiplies performs dot products on groups of 4 elements of x and y and then adds z.
- go: AddDotProd
commutative: false
extension: "AVX.*"
documentation: !string |-
// NAME performs dot products on pairs of elements of y and z and then adds x.
- go: SaturatedAddDotProd
commutative: false
extension: "AVX.*"
documentation: !string |-
// NAME performs dot products on pairs of elements of y and z and then adds x.
- go: FusedMultiplyAdd
commutative: false
extension: "AVX.*"
documentation: !string |-
// NAME performs (x * y) + z.
- go: FusedMultiplyAddSub
commutative: false
extension: "AVX.*"
documentation: !string |-
// NAME performs (x * y) - z for odd-indexed elements, and (x * y) + z for even-indexed elements.
- go: FusedMultiplySubAdd
commutative: false
extension: "AVX.*"
documentation: !string |-
// NAME performs (x * y) + z for odd-indexed elements, and (x * y) - z for even-indexed elements.
- go: Max
commutative: true
extension: "AVX.*"
documentation: !string |-
// NAME computes the maximum of corresponding elements.
- go: Min
commutative: true
extension: "AVX.*"
documentation: !string |-
// NAME computes the minimum of corresponding elements.
- go: SetElem
commutative: false
extension: "AVX.*"
documentation: !string |-
// NAME sets a single constant-indexed element's value.
- go: GetElem
commutative: false
extension: "AVX.*"
documentation: !string |-
// NAME retrieves a single constant-indexed element's value.
- go: Set128
commutative: false
extension: "AVX.*"
documentation: !string |-
// NAME combines a 128-bit vector with a 256-bit vector, where the constant operand specifies whether the low (0) or high (1) half is receives the smaller vector.
- go: Get128
commutative: false
extension: "AVX.*"
documentation: !string |-
// NAME retrieves the upper (1) or lower (0) half of a 256-bit vector, depending on the constant operand.
- go: Permute
commutative: false
extension: "AVX.*"
documentation: !string |-
// NAME performs a full permutation of vector x using indices:
// result := {x[indices[0]], x[indices[1]], ..., x[indices[n]]}
// Only the needed bits to represent x's index are used in indices' elements.
- go: Permute2 # Permute2 is only available on or after AVX512
commutative: false
extension: "AVX.*"
documentation: !string |-
// NAME performs a full permutation of vector x, y using indices:
// result := {xy[indices[0]], xy[indices[1]], ..., xy[indices[n]]}
// where xy is x appending y.
// Only the needed bits to represent xy's index are used in indices' elements.
- go: Compress
commutative: false
extension: "AVX.*"
documentation: !string |-
// NAME performs a compression on vector x using mask by
// selecting elements as indicated by mask, and pack them to lower indexed elements.
- go: blend
commutative: false
extension: "AVX.*"
documentation: !string |-
// NAME blends two vectors based on mask values, choosing either
// the first or the second based on whether the third is false or true
- go: Mul
commutative: true
extension: "AVX.*"
documentation: !string |-
// NAME multiplies corresponding elements of two vectors.
- go: MulEvenWiden
commutative: true
extension: "AVX.*"
documentation: !string |-
// NAME multiplies even-indexed elements, widening the result.
// Result[i] = v1.Even[i] * v2.Even[i].
- go: MulHigh
commutative: true
extension: "AVX.*"
documentation: !string |-
// NAME multiplies elements and stores the high part of the result.
- go: ShiftAllLeft
nameAndSizeCheck: true
specialLower: sftimm
commutative: false
extension: "AVX.*"
documentation: !string |-
// NAME shifts each element to the left by the specified number of bits. Emptied lower bits are zeroed.
- go: ShiftAllRight
signed: false
nameAndSizeCheck: true
specialLower: sftimm
commutative: false
extension: "AVX.*"
documentation: !string |-
// NAME shifts each element to the right by the specified number of bits. Emptied upper bits are zeroed.
- go: ShiftAllRight
signed: true
specialLower: sftimm
nameAndSizeCheck: true
commutative: false
extension: "AVX.*"
documentation: !string |-
// NAME shifts each element to the right by the specified number of bits. Emptied upper bits are filled with the sign bit.
- go: shiftAllLeftConst # no APIs, only ssa ops.
noTypes: "true"
noGenericOps: "true"
SSAVariant: "const" # to avoid its name colliding with reg version of this instruction, amend this to its ssa op name.
nameAndSizeCheck: true
commutative: false
extension: "AVX.*"
- go: shiftAllRightConst # no APIs, only ssa ops.
noTypes: "true"
noGenericOps: "true"
SSAVariant: "const"
signed: false
nameAndSizeCheck: true
commutative: false
extension: "AVX.*"
- go: shiftAllRightConst # no APIs, only ssa ops.
noTypes: "true"
noGenericOps: "true"
SSAVariant: "const"
signed: true
nameAndSizeCheck: true
commutative: false
extension: "AVX.*"
- go: ShiftLeft
nameAndSizeCheck: true
commutative: false
extension: "AVX.*"
documentation: !string |-
// NAME shifts each element in x to the left by the number of bits specified in y's corresponding elements. Emptied lower bits are zeroed.
- go: ShiftRight
signed: false
nameAndSizeCheck: true
commutative: false
extension: "AVX.*"
documentation: !string |-
// NAME shifts each element in x to the right by the number of bits specified in y's corresponding elements. Emptied upper bits are zeroed.
- go: ShiftRight
signed: true
nameAndSizeCheck: true
commutative: false
extension: "AVX.*"
documentation: !string |-
// NAME shifts each element in x to the right by the number of bits specified in y's corresponding elements. Emptied upper bits are filled with the sign bit.
- go: RotateAllLeft
nameAndSizeCheck: true
commutative: false
extension: "AVX.*"
documentation: !string |-
// NAME rotates each element to the left by the number of bits specified by the immediate.
- go: RotateLeft
nameAndSizeCheck: true
commutative: false
extension: "AVX.*"
documentation: !string |-
// NAME rotates each element in x to the left by the number of bits specified by y's corresponding elements.
- go: RotateAllRight
nameAndSizeCheck: true
commutative: false
extension: "AVX.*"
documentation: !string |-
// NAME rotates each element to the right by the number of bits specified by the immediate.
- go: RotateRight
nameAndSizeCheck: true
commutative: false
extension: "AVX.*"
documentation: !string |-
// NAME rotates each element in x to the right by the number of bits specified by y's corresponding elements.
- go: ShiftAllLeftConcat
nameAndSizeCheck: true
commutative: false
extension: "AVX.*"
documentation: !string |-
// NAME shifts each element of x to the left by the number of bits specified by the
// immediate(only the lower 5 bits are used), and then copies the upper bits of y to the emptied lower bits of the shifted x.
- go: ShiftAllRightConcat
nameAndSizeCheck: true
commutative: false
extension: "AVX.*"
documentation: !string |-
// NAME shifts each element of x to the right by the number of bits specified by the
// immediate(only the lower 5 bits are used), and then copies the lower bits of y to the emptied upper bits of the shifted x.
- go: ShiftLeftConcat
nameAndSizeCheck: true
commutative: false
extension: "AVX.*"
documentation: !string |-
// NAME shifts each element of x to the left by the number of bits specified by the
// corresponding elements in y(only the lower 5 bits are used), and then copies the upper bits of z to the emptied lower bits of the shifted x.
- go: ShiftRightConcat
nameAndSizeCheck: true
commutative: false
extension: "AVX.*"
documentation: !string |-
// NAME shifts each element of x to the right by the number of bits specified by the
// corresponding elements in y(only the lower 5 bits are used), and then copies the lower bits of z to the emptied upper bits of the shifted x.