OPCODE_RECIP

This commit is contained in:
Dr. Chat
2016-06-26 13:03:42 -05:00
parent 212cd6ee3d
commit f2ad6b8cb8
9 changed files with 68 additions and 3 deletions

View File

@@ -629,6 +629,25 @@ void Value::RSqrt() {
}
}
void Value::Recip() {
switch (type) {
case FLOAT32_TYPE:
constant.f32 = 1.0f / constant.f32;
break;
case FLOAT64_TYPE:
constant.f64 = 1.0f / constant.f64;
break;
case VEC128_TYPE:
for (int i = 0; i < 4; i++) {
constant.v128.f32[i] = 1.0f / constant.v128.f32[i];
}
break;
default:
assert_unhandled_case(type);
break;
}
}
void Value::And(Value* other) {
assert_true(type == other->type);
switch (type) {