diff --git a/src/xenia/cpu/frontend/ppc_emit_fpu.cc b/src/xenia/cpu/frontend/ppc_emit_fpu.cc index bc72c0a13..25176858f 100644 --- a/src/xenia/cpu/frontend/ppc_emit_fpu.cc +++ b/src/xenia/cpu/frontend/ppc_emit_fpu.cc @@ -114,8 +114,18 @@ XEEMITTER(fmulsx, 0xEC000032, A)(PPCHIRBuilder& f, InstrData& i) { } XEEMITTER(fresx, 0xEC000030, A)(PPCHIRBuilder& f, InstrData& i) { - XEINSTRNOTIMPLEMENTED(); - return 1; + // frD <- 1.0 / (frB) + Value* v = f.Convert( + f.Div(f.LoadConstant(1.0f), f.Convert(f.LoadFPR(i.A.FRB), FLOAT32_TYPE)), + FLOAT64_TYPE); + f.StoreFPR(i.A.FRT, v); + // f.UpdateFPRF(v); + if (i.A.Rc) { + // e.update_cr_with_cond(1, v); + XEINSTRNOTIMPLEMENTED(); + return 1; + } + return 0; } XEEMITTER(frsqrtex, 0xFC000034, A)(PPCHIRBuilder& f, InstrData& i) { diff --git a/src/xenia/cpu/hir/value.cc b/src/xenia/cpu/hir/value.cc index 719967e20..ee3fceced 100644 --- a/src/xenia/cpu/hir/value.cc +++ b/src/xenia/cpu/hir/value.cc @@ -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;