target-ppc: fix fsel instruction
authoraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>
Sun, 14 Dec 2008 11:12:10 +0000 (11:12 +0000)
committeraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>
Sun, 14 Dec 2008 11:12:10 +0000 (11:12 +0000)
Fix fsel instruction.  Eliminate unneeded temporaries while we're at it,
too.

Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6026 c046a42c-6fe2-441c-8c8c-71466251a162

target-ppc/op_helper.c

index a9b7f73bb035ed716bcb1e81b8ada48559ba0f08..cd88bb60756dc12ac5061555dd66437e9b3b455a 100644 (file)
@@ -1592,16 +1592,14 @@ uint64_t helper_frsqrte (uint64_t arg)
 /* fsel - fsel. */
 uint64_t helper_fsel (uint64_t arg1, uint64_t arg2, uint64_t arg3)
 {
-    CPU_DoubleU farg1, farg2, farg3;
+    CPU_DoubleU farg1;
 
     farg1.ll = arg1;
-    farg2.ll = arg2;
-    farg3.ll = arg3;
 
     if (!fpisneg(farg1.d) || iszero(farg1.d))
-        return farg2.ll;
+        return arg2;
     else
-        return farg2.ll;
+        return arg3;
 }
 
 uint32_t helper_fcmpu (uint64_t arg1, uint64_t arg2)