fcvtms
Floating-Point Convert to Signed Integer (Minus Infinity)
FCVTMS <Wd|Xd>, <Hn|Sn|Dn>
Converts float to signed integer, rounding towards minus infinity (Floor).
Details
Converts a scalar floating-point value to a signed integer, rounding towards negative infinity (floor). Sets condition flags based on the integer result. Raises Invalid Operation exception on overflow or invalid input. AArch64-only instruction.
Pseudocode Operation
operand ← Vn
intval ← Floor(operand)
if intval > MaxInt(destination_width) or intval < MinInt(destination_width) then
GenerateException(InvalidOperation)
else
Rd ← SignExtend(intval)
UpdateFlags(intval)
end
Example
FCVTMS Wd, Dn
Encoding
Binary Layout
0
0
0
11110
00
1
10
000
000000
Rn
Rd
Operands
-
Rd
Int Dest -
Vn
Float Src
Reference (Arm A64 ISA)
Instruction Forms
| Encoding | Instruction | ISA | Bit pattern | ||
|---|---|---|---|---|---|
| 0x5E79B800 | FCVTMS <Hd>, <Hn> | A64 | 01 | 0 | 11110 | 0 | 1111001101 | 1 | 10 | Rn | Rd | ||
| 0x5E21B800 | FCVTMS <V><d>, <V><n> | A64 | 01 | 0 | 11110 | 0 | sz | 100001101 | 1 | 10 | Rn | Rd | ||
| 0x0E79B800 | FCVTMS <Vd>.<T>, <Vn>.<T> | A64 | 0 | Q | 0 | 01110 | 0 | 1111001101 | 1 | 10 | Rn | Rd | ||
| 0x0E21B800 | FCVTMS <Vd>.<T>, <Vn>.<T> | A64 | 0 | Q | 0 | 01110 | 0 | sz | 100001101 | 1 | 10 | Rn | Rd | ||
| 0x1EF00000 | FCVTMS <Wd>, <Hn> | A64 | 0 | 0 | 0 | 11110 | 11 | 1 | 10 | 000 | 000000 | Rn | Rd | ||
| 0x9EF00000 | FCVTMS <Xd>, <Hn> | A64 | 1 | 0 | 0 | 11110 | 11 | 1 | 10 | 000 | 000000 | Rn | Rd | ||
| 0x1E300000 | FCVTMS <Wd>, <Sn> | A64 | 0 | 0 | 0 | 11110 | 00 | 1 | 10 | 000 | 000000 | Rn | Rd | ||
| 0x9E300000 | FCVTMS <Xd>, <Sn> | A64 | 1 | 0 | 0 | 11110 | 00 | 1 | 10 | 000 | 000000 | Rn | Rd | ||
| 0x1E700000 | FCVTMS <Wd>, <Dn> | A64 | 0 | 0 | 0 | 11110 | 01 | 1 | 10 | 000 | 000000 | Rn | Rd | ||
| 0x9E700000 | FCVTMS <Xd>, <Dn> | A64 | 1 | 0 | 0 | 11110 | 01 | 1 | 10 | 000 | 000000 | Rn | Rd |
Description
Floating-point Convert to Signed integer, rounding toward Minus infinity (scalar). This instruction converts the floating-point value in the SIMD&FP source register to a 32-bit or 64-bit signed integer using the Round towards Minus Infinity rounding mode, and writes the result to the general-purpose destination register.
A floating-point exception can be generated by this instruction. Depending on the settings in FPCR, the exception results in either a flag being set in FPSR, or a synchronous exception being generated. For more information, see Floating-point exception traps.
Depending on the settings in the CPACR_EL1, CPTR_EL2, and CPTR_EL3 registers, and the current Security state and Exception level, an attempt to execute the instruction might be trapped.
Operation
CheckFPEnabled64(); bits(decode_fltsize) fltval; bits(intsize) intval; fltval = V[n, decode_fltsize]; intval = FPToFixed(fltval, 0, FALSE, FPCR, rounding, intsize); X[d, intsize] = intval;