qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: qemu-devel qemu-devel <qemu-devel@nongnu.org>
Cc: Blue Swirl <blauwirbel@gmail.com>,
	"qemu-ppc@nongnu.org List" <qemu-ppc@nongnu.org>,
	Aurelien Jarno <aurelien@aurel32.net>
Subject: [Qemu-devel] [PATCH 06/34] target-ppc: simplify NaN propagation for vector functions
Date: Thu,  4 Oct 2012 15:56:28 +0200	[thread overview]
Message-ID: <1349359016-13107-7-git-send-email-agraf@suse.de> (raw)
In-Reply-To: <1349359016-13107-1-git-send-email-agraf@suse.de>

From: Aurelien Jarno <aurelien@aurel32.net>

Commit e024e881bb1a8b5085026589360d26ed97acdd64 provided a pickNaN()
function for PowerPC, implementing the correct NaN propagation rules.
Therefore there is no need to test the operands manually, we can rely
on the softfloat code to do that.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Alexander Graf <agraf@suse.de>
---
 target-ppc/int_helper.c |   26 +++++++-------------------
 1 files changed, 7 insertions(+), 19 deletions(-)

diff --git a/target-ppc/int_helper.c b/target-ppc/int_helper.c
index f638b2a..5b2a3c8 100644
--- a/target-ppc/int_helper.c
+++ b/target-ppc/int_helper.c
@@ -409,9 +409,7 @@ VARITH(uwm, u32)
         int i;                                                          \
                                                                         \
         for (i = 0; i < ARRAY_SIZE(r->f); i++) {                        \
-            HANDLE_NAN2(r->f[i], a->f[i], b->f[i]) {                    \
-                r->f[i] = func(a->f[i], b->f[i], &env->vec_status);     \
-            }                                                           \
+            r->f[i] = func(a->f[i], b->f[i], &env->vec_status);         \
         }                                                               \
     }
 VARITHFP(addfp, float32_add)
@@ -1039,9 +1037,7 @@ void helper_vrefp(CPUPPCState *env, 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]) {
-            r->f[i] = float32_div(float32_one, b->f[i], &env->vec_status);
-        }
+        r->f[i] = float32_div(float32_one, b->f[i], &env->vec_status);
     }
 }
 
@@ -1054,9 +1050,7 @@ void helper_vrefp(CPUPPCState *env, ppc_avr_t *r, ppc_avr_t *b)
                                                                 \
         set_float_rounding_mode(rounding, &s);                  \
         for (i = 0; i < ARRAY_SIZE(r->f); i++) {                \
-            HANDLE_NAN1(r->f[i], b->f[i]) {                     \
-                r->f[i] = float32_round_to_int (b->f[i], &s);   \
-            }                                                   \
+            r->f[i] = float32_round_to_int (b->f[i], &s);       \
         }                                                       \
     }
 VRFI(n, float_round_nearest_even)
@@ -1089,11 +1083,9 @@ void helper_vrsqrtefp(CPUPPCState *env, 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);
+        float32 t = float32_sqrt(b->f[i], &env->vec_status);
 
-            r->f[i] = float32_div(float32_one, t, &env->vec_status);
-        }
+        r->f[i] = float32_div(float32_one, t, &env->vec_status);
     }
 }
 
@@ -1109,9 +1101,7 @@ void helper_vexptefp(CPUPPCState *env, 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]) {
-            r->f[i] = float32_exp2(b->f[i], &env->vec_status);
-        }
+        r->f[i] = float32_exp2(b->f[i], &env->vec_status);
     }
 }
 
@@ -1120,9 +1110,7 @@ void helper_vlogefp(CPUPPCState *env, 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]) {
-            r->f[i] = float32_log2(b->f[i], &env->vec_status);
-        }
+        r->f[i] = float32_log2(b->f[i], &env->vec_status);
     }
 }
 
-- 
1.6.0.2

  parent reply	other threads:[~2012-10-04 13:57 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-04 13:56 [Qemu-devel] [PULL 00/34] ppc patch queue 2012-10-04 Alexander Graf
2012-10-04 13:56 ` [Qemu-devel] [PATCH 01/34] MAINTAINERS: Document sPAPR (pSeries) machine Alexander Graf
2012-10-04 13:56 ` [Qemu-devel] [PATCH 02/34] MAINTAINERS: Document e500 machines and devices Alexander Graf
2012-10-04 13:56 ` [Qemu-devel] [PATCH 03/34] MAINTAINERS: Downgrade ppc405 to Odd Fixes Alexander Graf
2012-10-04 13:56 ` [Qemu-devel] [PATCH 04/34] MAINTAINERS: Document Bamboo machine and ppc4xx devices Alexander Graf
2012-10-04 13:56 ` [Qemu-devel] [PATCH 05/34] MAINTAINERS: Document virtex_ml507 machine Alexander Graf
2012-10-04 13:56 ` Alexander Graf [this message]
2012-10-04 13:56 ` [Qemu-devel] [PATCH 07/34] target-ppc: use the softfloat min/max functions Alexander Graf
2012-10-04 13:56 ` [Qemu-devel] [PATCH 08/34] target-ppc: use the softfloat float32_muladd function Alexander Graf
2012-10-04 13:56 ` [Qemu-devel] [PATCH 09/34] target-ppc: get rid of the HANDLE_NAN{1, 2, 3} macros Alexander Graf
2012-10-04 13:56 ` [Qemu-devel] [PATCH 10/34] ppc: Make kvm_arch_put_registers() put *all* the registers Alexander Graf
2012-10-04 13:56 ` [Qemu-devel] [PATCH 11/34] pseries: Fix and cleanup CPU initialization and reset Alexander Graf
2012-10-04 13:56 ` [Qemu-devel] [PATCH 12/34] pseries: Use new method to correct reset sequence Alexander Graf
2012-10-04 13:56 ` [Qemu-devel] [PATCH 13/34] pseries: Add support for new KVM hash table control call Alexander Graf
2012-10-04 13:56 ` [Qemu-devel] [PATCH 14/34] pseries: Clear TCE and signal state when resetting PAPR VIO devices Alexander Graf
2012-10-04 13:56 ` [Qemu-devel] [PATCH 15/34] pseries: Reset emulated PCI TCE tables on system reset Alexander Graf
2012-10-04 13:56 ` [Qemu-devel] [PATCH 16/34] pseries: Fix XICS reset Alexander Graf
2012-10-04 13:56 ` [Qemu-devel] [PATCH 17/34] pseries: Small cleanup to H_CEDE implementation Alexander Graf
2012-10-04 13:56 ` [Qemu-devel] [PATCH 18/34] pseries: Remove C bitfields from xics code Alexander Graf
2012-10-04 13:56 ` [Qemu-devel] [PATCH 19/34] pseries: Remove XICS irq type enum type Alexander Graf
2012-10-04 13:56 ` [Qemu-devel] [PATCH 20/34] pseries: Remove never used flags field from spapr vio devices Alexander Graf
2012-10-04 13:56 ` [Qemu-devel] [PATCH 21/34] pseries: Rework implementation of TCE bypass Alexander Graf
2012-10-04 13:56 ` [Qemu-devel] [PATCH 22/34] pseries: Fix semantics of RTAS int-on, int-off and set-xive functions Alexander Graf
2012-10-04 13:56 ` [Qemu-devel] [PATCH 23/34] target-ppc: KVM: Fix some kernel version edge cases for kvmppc_reset_htab() Alexander Graf
2012-10-04 13:56 ` [Qemu-devel] [PATCH 24/34] ppc405_uc: Fix buffer overflow Alexander Graf
2012-10-04 13:56 ` [Qemu-devel] [PATCH 25/34] pseries: Remove unnecessary locking from PAPR hash table hcalls Alexander Graf
2012-10-04 13:56 ` [Qemu-devel] [PATCH 26/34] pseries: Set hash table size based on RAM size Alexander Graf
2012-10-04 13:56 ` [Qemu-devel] [PATCH 27/34] target-ppc: Remove unused power_mode field from cpu state Alexander Graf
2012-10-04 13:56 ` [Qemu-devel] [PATCH 28/34] target-ppc: Extend FPU state for newer POWER CPUs Alexander Graf
2012-10-04 13:56 ` [Qemu-devel] [PATCH 29/34] fdt: move dumpdtb interpretation code to device_tree.c Alexander Graf
2012-10-04 13:56 ` [Qemu-devel] [PATCH 30/34] device tree: simplify dumpdtb code Alexander Graf
2012-10-04 13:56 ` [Qemu-devel] [PATCH 31/34] PPC: e500: increase DTC_LOAD_PAD Alexander Graf
2012-10-04 13:56 ` [Qemu-devel] [PATCH 32/34] PPC: e500: calculate initrd_base like dt_base Alexander Graf
2012-10-04 13:56 ` [Qemu-devel] [PATCH 33/34] pseries: Don't test for MSR_PR for hypercalls under KVM Alexander Graf
2012-10-04 13:56 ` [Qemu-devel] [PATCH 34/34] ppc/pseries: Reset VPA registration on CPU reset Alexander Graf
2012-10-06 18:35 ` [Qemu-devel] [PULL 00/34] ppc patch queue 2012-10-04 Aurelien Jarno

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1349359016-13107-7-git-send-email-agraf@suse.de \
    --to=agraf@suse.de \
    --cc=aurelien@aurel32.net \
    --cc=blauwirbel@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).