I own and run a NEC VectorEngine 10C which is a PCIe accelerator running a proprietary ISA which has many fun instructions among them is VRSQRT which computes an approximation of the inverse squareroot 1/sqrt(x) for 16384 bits of floating point numbers (could be 256 double or 512 single precision floats) at a time. The exact computation result is Implementation defined according to the specification.

For the 32 bit variant a dump of the entire instruction fits in RAM (<18 Gigabytes). The 64 bit variant obviously doesn't.

How can i get a computer program which emulates this implementation? Ideally i would like a computer to find this emulation for me. However an actionable description of a manual approach is also acceptable and should it be required I can give access to the hardware remotely.

1 Answer 1


My starting point here wouldn't be to look at generic emulation approaches as these themselves produce approximations to the function being emulated. (If an approximation is good enough then why not use the exact reciprocal square root result as an approximation to the approximate function ?)

Instead, here you know the instruction returns an approximation to a known mathematical calculation.

Approximate reciprocal square-root operation were developed some time ago. Initial versions were based on a 'magic' first step followed by 1 or more Newton-Raphson iterations.

Since them similar instructions have appeared in several hardware architecture. (Intel & AMD x86-64, ARM NEON etc.) The exact implementation of these is not generally documented, presumably because you seldom need to reproduce bit-accurate versions of approximate calculations. (The SX-Aurora document you linked to says that its implementation is system dependent. This, in theory, could mean that different versions or steppings of the same hardware could produce different results.

There is however at least one documented hardware implementation as Intel provided C reference implementations of the AVX-512 versions of their approximation instructions in 2015. These can be found here.

The first thing I'd try would be to implement a couple of the obvious or published implementations and see if they match the results you get from the hardware.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.