Encoding:

P32A

001000

rt

rs

0000000

100

111

111

6

5

5

7

3

3

3

Format:

ABSQ_S.QB rt, rs

DSP-R2

Find Absolute Value of Four Fractional Byte Values

Purpose:

Find Absolute Value of Four Fractional Byte Values

Find the absolute value of four fractional byte vector elements with saturation.

Description:

rt = sat8(abs(rs31..24)) || sat8(abs(rs23..16)) || sat8(abs(rs15..8)) || 
sat8(abs(rs7..0))

For each value in the four Q7 fractional byte elements in register rs, the absolute value is found and written to the corresponding byte in register rt. If either input value is the minimum Q7 value (-1.0 in decimal, 0x80 in hexadecimal), the corresponding result is saturated to 0x7F.s

This instruction sets bit 20 in ouflag field of the DSPControl register if any input value was saturated.

Restrictions:

No data-dependent exceptions are possible.

The operands must be a value in the specified format. If they are not, the results are UNPREDICTABLE and the values of the operand vectors become UNPREDICTABLE.

Operation:

ValidateAccessToDSP2Resources()
tempD7..0 = abs8( GPR[rs]31..24 )
tempC7..0 = abs8( GPR[rs]23..16 )
tempB7..0 = abs8( GPR[rs]15..8 )
tempA7..0 = abs8( GPR[rs]7..0 )
GPR[rt]31..0 = tempD7..0 || tempC7..0 || tempB7..0 || tempA7..0
function abs8( a7..0 )
   if ( a7..0 = 0x80 ) then
      DSPControlouflag:20 = 1
      temp7..0 = 0x7F
   else
      if ( a7 = 1 ) then
          temp7..0 = -a7..0
      else
         temp7..0 = a7..0
      endif
   endif
   return temp7..0 
endfunction abs8

Exceptions:

Reserved Instruction, DSP Disabled