= IDISA Vertical Operations =
The tables below list the various IDISA vertical 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, or
signed or unsigned saturation. When the results depend on the
interpration t(x) refers to the truncation of a field to the N least
significant bits of x, ss(x) refers to conversion by signed
saturation and us(x) refers to conversion by unsigned saturation.
== IDISA Binary Operations ==
These operations generally have the form `r = simd::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 || r,,i,, = a,,i,, + b,,i,, ||
|| `sub` || subtraction || r,,i,, = a,,i,, - b,,i,, ||
|| `mul` || multiplication || r,,i,, = a,,i,, * b,,i,, ||
|| `eq` || equality || r,,i,, = if a,,i,, = b,,i,, then -1 else 0 ||
|| `gt` || greater than || r,,i,, = if s(a,,i,,) > s(b,,i,,) then -1 else 0 ||
|| `ugt` || unsigned greater than || r,,i,, = if u(a,,i,,) > u(b,,i,,) then -1 else 0 ||
|| `lt` || less than || r,,i,, = if s(a,,i,,) < s(b,,i,,) then -1 else 0 ||
|| `ult` || unsigned less than || r,,i,, = if u(a,,i,,) < u(b,,i,,) then -1 else 0 ||
|| `max` || maximum value || r,,i,, = if s(a,,i,,) > s(b,,i,,) then a,,i,, else b,,i,, ||
|| `umax` || unsigned maximum value || r,,i,, = if u(a,,i,,) > u(b,,i,,) then a,,i,, else b,,i,, ||
|| `min` || minimum value || r,,i,, = if s(a,,i,,) < s(b,,i,,) then a,,i,, else b,,i,, ||
|| `umin` || unsigned minimum value || r,,i,, = if u(a,,i,,) < u(b,,i,,) then a,,i,, else b,,i,, ||
|| `sll` || shift left logical || r,,i,, = a,,i,, << b,,i,, ||
|| `srl` || shift right logical || r,,i,, = u(a,,i,,) >> b,,i,, ||
|| `sra` || shift right arithmetic || r,,i,, = s(a,,i,,) >> b,,i,, ||
== IDISA Unary Operations ==
These operations generally have the form `r = simd::op(a)` for each
operation `op`, where `a` is an operand vector of N bit fields and `r` is
the corresponding result vector.
Some of these operations involve operations on the high half of each
field h(a,,i,,) and the the low half of each field l(a,,i,,), where
- h(a,,i,,) = a,,i,, >> N/2
- l(a,,i,,) = a,,i,, & (1 << N/2 - 1)
|| `abs` || absolute value || r,,i,, = if s(a,,i,,) < 0 then -a,,i,, else a,,i,, ||
|| `neg` || negate || r,,i,, = -s(a,,i,,) ||
|| `add_hl` || add halves || r,,i,, = h(a,,i,,) + l(a,,i,,)
|| `xor_hl` || bitwise xor halves || r,,i,, = h(a,,i,,) xor l(a,,i,,)
|| `slli` || shift left logical immediate|| r,,i,, = a,,i,, << k ||
|| `srli` || shift right logical immediate|| r,,i,, = u(a,,i,,) >> k ||
|| `srai` || shift right arithmetic immediate|| r,,i,, = s(a,,i,,) >> k ||
|| `popcount` || population count || r,,i,, = number of 1 bits in u(a,,i,,) ||
|| `ctz` || count trailing zeroes || r,,i,, = the number of consecutive 0 bits in a,,i,, counting from the right ||
== IDISA Ternary Operation ==
This operation has the form `r = simd::op(a, b, c)` for each
operation `op`, where `a`, `b`, and `c` are operand vectors of N bit fields and `r` is
the corresponding result vector.
|| `if` || if sign bit || r,,i,, = if s(a,,i,,) < 0 then b,,i,, else c,,i,, ||