wiki:IDISA_Horizontal

Version 2 (modified by cameron, 8 years ago) (diff)

--

IDISA Horizontal Operations

The tables below list the various IDISA horizontal operations on vectors of N-bit fields, together with their description and semantic specification.

In general, operand fields may be interpreted as either signed or unsigned N-bit integers, depending on the operation. When the results depend on this interpretation, the notation s(a) refers to the interpretation of field a as a signed integer (2's complement interpretation), while the notation u(a) refers to the interpretation as an unsigned integer (natural binary interpretation).

In general, result fields are converted to N-bits by truncation.

IDISA Binary Operations

These operations generally have the form r = hsimd<N>::op(a, b) for each operation op, where a and b are operand vectors of N bit fields and r is the corresponding result vector.

add addition ri = c2i + c2i+1
min minimum value ri = if s(c2i) < s(c2i+1) then c2i else c2i+1
packl pack low ri = c2i+1
packh pack high ri = c2i
packus pack with signed saturation ri = ss(c2i+1)
packss pack with unsigned saturation ri = us(c2i+1)

In these definitions, fields are numbered left-to-right in so-called *big-endian* style. Implementations using little-endian processors generally reverse the arguments c2i and c2i+1.