Page 378 - ARM 64 Bit Assembly Language
P. 378

368 Chapter 10

                  10.7.5 Estimate reciprocals

                  In general, multiplication is faster than division. In many cases of vector arithmetic, it is faster
                  to calculate reciprocals and use multiplication. These instructions perform the initial estimates
                  of the reciprocal values:

                  recpe     Reciprocal Estimate, and
                  rsqrte    Reciprocal Square Root Estimate.

                  These work on floating point and unsigned fixed point vectors. The estimates from this
                  instruction are accurate to within about eight bits. If higher accuracy is desired, then the
                  Newton-Raphson method can be used to improve the initial estimates. For more information,
                  see the Reciprocal Step instructions on page 369.

                  10.7.5.1 Syntax

                       u<op>    Vd.Ta, Vn.Ta
                       f<op>    Vd.Tb, Vn.Tb


                  •  <op> is either recpe or rsqrte.
                  •  Ta must be 2s or 4s.
                  •  Tb must be 2s, 4s,or 2d.

                  10.7.5.2 Operations

                   Name            Effect                           Description
                   (u|f)recpe      n ← # of elements                Find an approximate reciprocal of
                                   for 0 ≤ i< n) do                 each element in a vector.
                                     Vd[i]←≈ (1 ÷ Vm[i])
                                   end for
                   (u|f)rsqrte     n ← # of elements                Find an approximate reciprocal
                                   for 0 ≤ i< n) do                 square root of each element in a
                                                   √
                                     Vd[i]←≈ (1 ÷    Vm[i])         vector.
                                   end for

                  10.7.5.3 Examples


                1     urecpe  v1.4s,v6.4s  // Get initial reciprocal estimates
                2     frecpe  v4.2d,v5.2d  // Get initial reciprocal estimates
   373   374   375   376   377   378   379   380   381   382   383