fresx and some vec128 constant prop.

This commit is contained in:
Ben Vanik
2015-03-25 19:16:30 -07:00
parent 55ef84bf21
commit 6bf84d832f
2 changed files with 22 additions and 2 deletions

View File

@@ -357,6 +357,11 @@ void Value::Neg() {
case FLOAT64_TYPE:
constant.f64 = -constant.f64;
break;
case VEC128_TYPE:
for (int i = 0; i < 4; ++i) {
constant.v128.f32[i] = -constant.v128.f32[i];
}
break;
default:
assert_unhandled_case(type);
break;
@@ -383,6 +388,11 @@ void Value::Abs() {
case FLOAT64_TYPE:
constant.f64 = abs(constant.f64);
break;
case VEC128_TYPE:
for (int i = 0; i < 4; ++i) {
constant.v128.f32[i] = std::fabsf(constant.v128.f32[i]);
}
break;
default:
assert_unhandled_case(type);
break;