diff options
-rw-r--r-- | target-ppc/helper.h | 1 | ||||
-rw-r--r-- | target-ppc/op_helper.c | 11 | ||||
-rw-r--r-- | target-ppc/translate.c | 1 |
3 files changed, 13 insertions, 0 deletions
diff --git a/target-ppc/helper.h b/target-ppc/helper.h index 00a573c117..85cdd23c5c 100644 --- a/target-ppc/helper.h +++ b/target-ppc/helper.h @@ -245,6 +245,7 @@ DEF_HELPER_3(vsubfp, void, avr, avr, avr) DEF_HELPER_3(vmaxfp, void, avr, avr, avr) DEF_HELPER_3(vminfp, void, avr, avr, avr) DEF_HELPER_2(vrefp, void, avr, avr) +DEF_HELPER_2(vrsqrtefp, void, avr, avr) DEF_HELPER_4(vmaddfp, void, avr, avr, avr, avr) DEF_HELPER_4(vnmsubfp, void, avr, avr, avr, avr) DEF_HELPER_2(vlogefp, void, avr, avr) diff --git a/target-ppc/op_helper.c b/target-ppc/op_helper.c index 0e78e237ac..3afd217bc2 100644 --- a/target-ppc/op_helper.c +++ b/target-ppc/op_helper.c @@ -2707,6 +2707,17 @@ VROTATE(h, u16) VROTATE(w, u32) #undef VROTATE +void helper_vrsqrtefp (ppc_avr_t *r, ppc_avr_t *b) +{ + int i; + for (i = 0; i < ARRAY_SIZE(r->f); i++) { + HANDLE_NAN1(r->f[i], b->f[i]) { + float32 t = float32_sqrt(b->f[i], &env->vec_status); + r->f[i] = float32_div(float32_one, t, &env->vec_status); + } + } +} + void helper_vsel (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b, ppc_avr_t *c) { r->u64[0] = (a->u64[0] & ~c->u64[0]) | (b->u64[0] & c->u64[0]); diff --git a/target-ppc/translate.c b/target-ppc/translate.c index 46bd177d63..048bb54d21 100644 --- a/target-ppc/translate.c +++ b/target-ppc/translate.c @@ -6477,6 +6477,7 @@ GEN_VXFORM_NOA(vupklsh, 7, 11); GEN_VXFORM_NOA(vupkhpx, 7, 13); GEN_VXFORM_NOA(vupklpx, 7, 15); GEN_VXFORM_NOA(vrefp, 5, 4); +GEN_VXFORM_NOA(vrsqrtefp, 5, 5); GEN_VXFORM_NOA(vlogefp, 5, 7); GEN_VXFORM_NOA(vrfim, 5, 8); GEN_VXFORM_NOA(vrfin, 5, 9); |