3 ms·
Neon is SIMD so I would presume these instructions let you vectorize those calculations and do them in parallel on a lot of data more efficiently than if you br
by nanidin 3y ago
Neon is SIMD so I would presume these instructions let you vectorize those calculations and do them in parallel on a lot of data more efficiently than if you broke it down into simpler operations and did them one by one.
- voidbert 3y agoYes, but the part that got me was the halving of the result followed by the clamping. SIMD generally makes sense, but for something like this to exist usually there's something very specific (like a certain video codec, for example) that greatly benefits from such a complex instruction.
- creato 3y agoIt's probably not about avoiding extra instructions/performance, but making the range of the result more useful and avoiding overflow. Or in other words, the entire instruction may be useless if you don't do these things.
- epcoa 3y agoThe halving and clamping is nothing particularly remarkable in the context of usefully using fixed point numbers (scaled integers) to avoid overflow. Reciprocal square root itself is a fundamental operation for DSP algorithms and of course computer graphics. This is a fairly generic instruction really, though FRSQRTE likely gets more real world use.
- ekelsen 3y agoThe halving could come from an intended use in a Newton Raphson iteration of a square root refinement. See for example https://math.mit.edu/~stevenj/18.335/newton-sqrt.pdf https://math.mit.edu/~stevenj/18.335/newton-sqrt.pdf The initial guess is the approximate square root, but it needs to be halved as part of the calculation.