MSA 011110 |
110011100 |
df |
ws |
wd |
2RF 011110 |
6 |
9 |
1 |
5 |
5 |
6 |
FTINT_S.df |
Vector Floating-Point Convert to Signed Integer | |
FTINT_S.W wd,ws |
MSA |
Vector Floating-Point Convert to Signed Integer |
FTINT_S.D wd,ws |
MSA |
Vector Floating-Point Convert to Signed Integer |
Vector Floating-Point Convert to Signed Integer
Vector floating-point convert to signed integer.
wd[i] = to_int_s(ws[i])
The floating-point elements in ws are rounded and converted to signed 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 signed integer value. The default result for negative numeric operands outside the range is the smallest signed integer value.
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.
Data-dependent exceptions are possible.
FTINT_S.W for i in 0 .. WRLEN/32-1 f = ToIntSignedFP(WR[ws]32i+31..32i, 32) WR[wd]32i+31..32i = f endfor FTINT_S.D for i in 0 .. WRLEN/64-1 f = ToIntSignedFP(WR[ws]64i+63..64i, 64) WR[wd]64i+63..64i = f endfor function ToIntSignedFP(tt, n) /* Implementation defined floating-point rounding and signed integer conversion. */ endfunction ToIntSignedFP
Reserved Instruction Exception, MSA Disabled Exception, MSA Floating Point Exception.