xxxLD
xxxLD

Reputation: 21

what's the difference between the vrnd32x and vrndx?

Both the vrnd32x and vrndx are the Arm A64 neon intrinsics,see as the https://developer.arm.com/architectures/instruction-sets/intrinsics/vrnd32z_f32, it explains vrnd32x round to 32bit Integral using current rounding mode.What means 32bit integer here? It mostly has the same result as the vrndx. By the way,the current rounding mode is defined by what,and which way can change the rounding mode?

Upvotes: 0

Views: 29

Answers (1)

solidpixel
solidpixel

Reputation: 12229

vrdnx rounds according to the rounding mode. vrndz always rounds towards zero.

The "32-bit integral" limit means that the max value is limited to the max range of an integer (+- ~2.147e9) vs the max range of a float which is (+- ~3.403e38).

In C/C++ you can set the rounding mode using fesetround() from fenv.h.

Upvotes: 1

Related Questions