pmul

Vector Polynomial Multiply

PMUL <Vd>.<T>, <Vn>.<T>, <Vm>.<T>

Performs polynomial multiplication over {0,1}.

Details

Performs polynomial multiplication over GF(2^m) on corresponding 8-bit elements of Vn and Vm, storing results in Vd. Each element is treated as a polynomial with coefficients in {0,1}, and multiplication is performed modulo an irreducible polynomial. The Q bit determines operation width (64-bit for Q=0, 128-bit for Q=1). No condition flags are affected. AArch64 NEON extension.

Pseudocode Operation

for i = 0 to (128 >> (if Q then 0 else 1)) - 1 step 8:
  Vd[i +: 8] ← PolynomialMultiply(Vn[i +: 8], Vm[i +: 8]);

Example

PMUL v0.4s.T, v1.4s.T, v2.4s.T

Encoding

Binary Layout
0
Q
1
01110
size
1
Rm
10011
1
Rn
Rd
 
Format SIMD Three Register
Opcode 0x2E209C00
Extension NEON (SIMD)

Operands

  • Vd
    Destination SIMD/FP vector register
  • Vn
    First source SIMD/FP vector register
  • Vm
    Second source SIMD/FP vector register

Reference (Arm A64 ISA)

Instruction Forms

Encoding Instruction ISA Bit pattern
0x2E209C00 PMUL <Vd>.<T>, <Vn>.<T>, <Vm>.<T> A64 0 | Q | 1 | 01110 | size | 1 | Rm | 10011 | 1 | Rn | Rd
0x04206400 PMUL <Zd>.B, <Zn>.B, <Zm>.B A64 00000100 | 0 | 0 | 1 | Zm | 0110 | 0 | 1 | Zn | Zd

Description

Polynomial Multiply. This instruction multiplies corresponding elements in the vectors of the two source SIMD&FP registers, places the results in a vector, and writes the vector to the destination SIMD&FP register. For information about multiplying polynomials see Polynomial arithmetic over {0, 1}. Depending on the settings in the CPACR_EL1, CPTR_EL2, and CPTR_EL3 registers, and the current Security state and Exception level, an attempt to execute the instruction might be trapped.

Operation

CheckFPAdvSIMDEnabled64();
bits(datasize) operand1 = V[n, datasize];
bits(datasize) operand2 = V[m, datasize];
bits(datasize) result;
bits(esize) element1;
bits(esize) element2;
bits(esize) product;

for e = 0 to elements-1
    element1 = Elem[operand1, e, esize];
    element2 = Elem[operand2, e, esize];
    if poly then
        product = PolynomialMult(element1, element2)<esize-1:0>;
    else
        product = (UInt(element1)*UInt(element2))<esize-1:0>;
    Elem[result, e, esize] = product;

V[d, datasize] = result;