]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Followup to r1562: fixes for ppc64
authorJulian Seward <jseward@acm.org>
Fri, 3 Feb 2006 19:12:17 +0000 (19:12 +0000)
committerJulian Seward <jseward@acm.org>
Fri, 3 Feb 2006 19:12:17 +0000 (19:12 +0000)
git-svn-id: svn://svn.valgrind.org/vex/trunk@1563

VEX/priv/host-ppc/isel.c

index 0477d4aaffdaa5c257a088392a3a204f463c5065..e07e11a55305e5a00608ed8ac60326ef969872b4 100644 (file)
@@ -136,13 +136,6 @@ static IRExpr* unop ( IROp op, IRExpr* a )
    return IRExpr_Unop(op, a);
 }
 
-#if 0
-static IRExpr* binop ( IROp op, IRExpr* a1, IRExpr* a2 )
-{
-   return IRExpr_Binop(op, a1, a2);
-}
-#endif
-
 static IRExpr* mkU32 ( UInt i )
 {
    return IRExpr_Const(IRConst_U32(i));
@@ -2912,6 +2905,21 @@ static HReg iselDblExpr_wrk ( ISelEnv* env, IRExpr* e )
       }
    }
 
+   if (e->tag == Iex_Binop) {
+      PPCFpOp fpop = Pfp_INVALID;
+      switch (e->Iex.Binop.op) {
+         case Iop_SqrtF64: fpop = Pfp_SQRT; break;
+         default: break;
+      }
+      if (fpop != Pfp_INVALID) {
+         HReg fr_dst = newVRegF(env);
+         HReg fr_src = iselDblExpr(env, e->Iex.Binop.arg2);
+         set_FPU_rounding_mode( env, e->Iex.Binop.arg1 );
+         addInstr(env, PPCInstr_FpUnary(fpop, fr_dst, fr_src));
+         return fr_dst;
+      }
+   }
+
    if (e->tag == Iex_Binop) {
 
       if (e->Iex.Binop.op == Iop_RoundF64toF32) {
@@ -2981,7 +2989,6 @@ static HReg iselDblExpr_wrk ( ISelEnv* env, IRExpr* e )
       switch (e->Iex.Unop.op) {
          case Iop_NegF64:     fpop = Pfp_NEG; break;
          case Iop_AbsF64:     fpop = Pfp_ABS; break;
-         case Iop_SqrtF64:    fpop = Pfp_SQRT; break;
          case Iop_Est5FRSqrt: fpop = Pfp_RSQRTE; break;
          default: break;
       }