Skip to contentSkip to conversation

target-ppc: fix fsel instruction

PATCH Applied Nathan Froyd 2 participants 2 messages Dec 14, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target-ppc: fix fsel instruction

Fix fsel instruction. Eliminate unneeded temporaries while we're at it, too.

---
 target-ppc/op_helper.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)
target-ppc/op_helper.c +3 -5
index a9b7f73..92c6269 100644
@@ -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)
Signature · 1 line
1.6.0.5
#1 lore raw
Quoted 4 lines · Nathan Froyd

Fix fsel instruction. Eliminate unneeded temporaries while we're at it, too.

Thanks, applied.

Quoted 34 lines
---
 target-ppc/op_helper.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)
target-ppc/op_helper.c +3 -5
index a9b7f73..92c6269 100644
@@ -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)
Signature · 1 line
1.6.0.5
Signature · 4 lines
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   [email protected]         | [email protected]
   `-    people.debian.org/~aurel32 | www.aurel32.net