Fixing sqrt/rsqrt mixup.

Queue the 'how did this ever work?!'
This commit is contained in:
Ben Vanik 2015-11-30 17:22:08 -08:00
parent cd50aac6d2
commit 82fe65475e
1 changed files with 4 additions and 4 deletions

View File

@ -464,10 +464,10 @@ void Value::Abs() {
void Value::Sqrt() {
switch (type) {
case FLOAT32_TYPE:
constant.f32 = 1.0f / std::sqrt(constant.f32);
constant.f32 = std::sqrt(constant.f32);
break;
case FLOAT64_TYPE:
constant.f64 = 1.0 / std::sqrt(constant.f64);
constant.f64 = std::sqrt(constant.f64);
break;
default:
assert_unhandled_case(type);
@ -478,10 +478,10 @@ void Value::Sqrt() {
void Value::RSqrt() {
switch (type) {
case FLOAT32_TYPE:
constant.f32 = std::sqrt(constant.f32);
constant.f32 = 1.0f / std::sqrt(constant.f32);
break;
case FLOAT64_TYPE:
constant.f64 = std::sqrt(constant.f64);
constant.f64 = 1.0f / std::sqrt(constant.f64);
break;
default:
assert_unhandled_case(type);