MSA 011110 |
110010001 |
df |
ws |
wd |
2RF 011110 |
6 |
9 |
1 |
5 |
5 |
6 |
FTRUNC_S.df |
Vector Floating-Point Truncate and Convert to Signed Integer | |
FTRUNC_S.W wd,ws |
MSA |
Vector Floating-Point Truncate and Convert to Signed Integer |
FTRUNC_S.D wd,ws |
MSA |
Vector Floating-Point Truncate and Convert to Signed Integer |
Vector Floating-Point Truncate and Convert to Signed Integer
Vector floating-point truncate and convert to signed integer.
wd[i] = truncate_to_int_s(ws[i])
The floating-point elements in ws are truncated, i.e. rounded toward zero, to signed integer values. The rounding mode bits RM in MSA Control and Status Register MSACSR are not used. 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.
FTRUNC_S.W for i in 0 .. WRLEN/32-1 f = TruncToIntSignedFP(WR[ws]32i+31..32i, 32) WR[wd]32i+31..32i = f endfor FTRUNC_S.D for i in 0 .. WRLEN/64-1 f = TruncToIntSignedFP(WR[ws]64i+63..64i, 64) WR[wd]64i+63..64i = f endfor function TruncToIntSignedFP(tt, n) /* Implementation defined floating-point truncation and signed integer conversion. */ endfunction TruncToIntSignedFP
Reserved Instruction Exception, MSA Disabled Exception, MSA Floating Point Exception.