Implemented SIMD rsqrt.

This commit is contained in:
Branimir Karadžić
2018-01-29 20:35:51 -08:00
parent 672a39f4f4
commit c1f8036b70
3 changed files with 53 additions and 18 deletions

View File

@@ -70,6 +70,12 @@ TEST_CASE("libm", "")
REQUIRE(bx::equal(bx::exp(xx), ::expf(xx), 0.00001f) );
}
for (float xx = 0.0f; xx < 100.0f; xx += 0.1f)
{
bx::writePrintf(writer, "rsqrt(%f) == %f (expected: %f)\n", xx, bx::rsqrt(xx), 1.0f/::sqrtf(xx) );
REQUIRE(bx::equal(bx::rsqrt(xx), 1.0f/::sqrtf(xx), 0.00001f) );
}
for (float xx = 0.0f; xx < 100.0f; xx += 0.1f)
{
bx::writePrintf(writer, "sqrt(%f) == %f (expected: %f)\n", xx, bx::sqrt(xx), ::sqrtf(xx) );