Page 353 - ARM 64 Bit Assembly Language
P. 353

Advanced SIMD instructions 343

                     There are also functions to perform integer or fixed-point to floating-point conversions, and
                     convert between IEEE single and double precision.




                     10.4.1 Convert between integer or fixed point and floating point

                     These instructions can be used to perform data conversion between floating point and fixed
                     point (or integer) on each element in a vector:

                     fcvt       Vector convert floating point to integer or fixed point, and
                     cvtf       Vector convert integer or fixed point to floating point.

                     The elements in the result vector must be the same size as the elements in the source vector.
                     An out of range integer or fixed-point result will be saturated to the destination size.

                     Fixed point (or integer) arithmetic operations are up to twice as fast as floating point opera-
                     tions. In some cases it is much more efficient to make this conversion, perform the calcula-
                     tions, then convert the results back to floating point.



                     10.4.1.1 Syntax

                          fcvt<x>(s|u)      Vd.T, Vn.T
                          fcvtz(s|u)        Vd.T, Vn.T, #<fbits>
                          (s|u)cvtf         Vd.T, Vn.T{, #<fbits>}



                     •   <x> is a single character which specifies the rounding mode:
                         N:  round to nearest with ties to even,
                         A:  round to nearest with ties away from zero,
                         P:  round towards +∞,
                         M:  round towards −∞,or
                         Z:  round towards zero.
                     •   T may be either 2s, 4s,or 2d.
                     •   <type> must be either s32 or u32.
                     •   <fbits> specifies the number of fraction bits for a fixed point number, and must be be-
                         tween 1 and the number of bits specified by T. If it is omitted, then it is assumed to be
                         zero.
   348   349   350   351   352   353   354   355   356   357   358