Page 380 - ARM 64 Bit Assembly Language
P. 380
370 Chapter 10
10.7.6.2 Operations
Name Effect Description
vrecpe n ← # of elements Perform most of the Newton Raph-
for 0 ≤ i< n) do son reciprocal improvement step.
Vd[i]← 2 − Vn[i]× Vm[i]
end for
vrsqrte n ← # of elements Perform most of the Newton Raph-
for 0 ≤ i< n) do son reciprocal square root improve-
Vd[i]← ment step.
(3 − Vn[i]× Vm[i]) ÷ 2
end for
10.7.6.3 Examples
1 // Divide elements of v0 by elements of v1 and store in v3
2 // Doing a loop and testing for convergence would be slow,
3 // so we will just do two improvement steps and hope it is
4 // close enough.
5 frecpe v3.2d,v1.2d // Get initial reciprocal estimates
6 frecps v4.2d,v1.2d,v3.2d // Improve estimates
7 fmul v3.2d,v3.2d,v4.2d // Finish improvement step
8 frecps v4.2d,v1.2d,v3.2d // Improve estimates
9 fmul v3.2d,v3.2d,v4.2d // Finish improvement step
10 fmul v3.2d,v3.2d,v0.2d // Perform division
10.7.7 Multiply scalar by element
These instructions are used to multiply each element in a vector by a scalar:
fmul Vector by scalar floating point multiply,
fmla Vector by scalar floating point multiply accumulate,
fmls Vector by scalar floating point multiply subtract.
10.7.7.1 Syntax
fmul{x} Fd, Fn, Vm.Ts[x]
fmla Fd, Fn, Vm.Ts[x]
fmls Fd, Fn, Vm.Ts[x]
• Ts must be s or d.

