Encoding:

MSA

011110

110011101

df

ws

wd

2RF

011110

6

9

1

5

5

6

Format:

FTINT_U.df 

Vector Floating-Point Round and Convert to Unsigned Integer

FTINT_U.W wd,ws

MSA

Vector Floating-Point Round and Convert to Unsigned Integer

FTINT_U.D wd,ws

MSA

Vector Floating-Point Round and Convert to Unsigned Integer

Purpose:

Vector Floating-Point Round and Convert to Unsigned Integer

Vector floating-point round and convert to unsigned integer.

Description:

wd[i] = to_int_u(ws[i])

The floating-point elements in ws are rounded and converted to unsigned integer values based on the rounding mode bits RM in MSA Control and Status Register MSACSR. The result is written to vector wd.

The floating-point to integer conversion operation is exact as defined by the IEEE Standard for Floating-Point Arithmetic 754TM-2008, i.e. the Inexact exception is signaled if the result does not have the same numerical value as the input operand. In this case, the default result is the rounded result.

NaN values and numeric operands converting to an integer outside the range of the destination format signal the

Invalid Operation exception. For positive numeric operands outside the range, the default result is the largest unsigned integer value. The default result for negative numeric operands is zero. The default result for NaN operands is zero.

The operands are values in floating_point data format df. The results are values in integer data format df.

Restrictions:

Data-dependent exceptions are possible.

Operation:

FTINT_U.W
   for i in 0 .. WRLEN/32-1
      f = ToIntUnsignedFP(WR[ws]32i+31..32i, 32)
      WR[wd]32i+31..32i = f
   endfor
FTINT_U.D
   for i in 0 .. WRLEN/64-1
      f = ToIntUnsignedFP(WR[ws]64i+63..64i, 64)
      WR[wd]64i+63..64i = f
   endfor
function ToIntUnsignedFP(tt, n)
   /* Implementation defined floating-point rounding and unsigned
         integer conversion. */
endfunction ToIntUnsignedFP

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception, MSA Floating Point Exception.