summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>2015-12-08 08:53:42 +0000
committeruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>2015-12-08 08:53:42 +0000
commit93bb3cf80c2b8302a5d8a4563d6be8846965f971 (patch)
treee5433d8fadd0b2ad5665638b3f55f821c1997396
parente300de9f917e8ddabc37db3cf6cba283dbdf0aa2 (diff)
downloadgcc-93bb3cf80c2b8302a5d8a4563d6be8846965f971.tar.gz
* config/i386/i386.c (ix86_emit_swsqrtsf): Cleanup
infinity filterning code. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231397 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/i386/i386.c13
2 files changed, 9 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 918cd12fba4..8e9d0167b34 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2015-12-08 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386.c (ix86_emit_swsqrtsf): Cleanup
+ infinity filterning code.
+
2015-12-08 Ilya Enkovich <enkovich.gnu@gmail.com>
PR tree-optimization/68766
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 1e6969f483e..e423b3c1897 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -47827,8 +47827,7 @@ void ix86_emit_swdivsf (rtx res, rtx a, rtx b, machine_mode mode)
/* Output code to perform a Newton-Rhapson approximation of a
single precision floating point [reciprocal] square root. */
-void ix86_emit_swsqrtsf (rtx res, rtx a, machine_mode mode,
- bool recip)
+void ix86_emit_swsqrtsf (rtx res, rtx a, machine_mode mode, bool recip)
{
rtx x0, e0, e1, e2, e3, mthree, mhalf;
REAL_VALUE_TYPE r;
@@ -47868,12 +47867,8 @@ void ix86_emit_swsqrtsf (rtx res, rtx a, machine_mode mode,
/* If (a == 0.0) Filter out infinity to prevent NaN for sqrt(0.0). */
if (!recip)
{
- rtx zero, mask;
-
- zero = gen_reg_rtx (mode);
- mask = gen_reg_rtx (mode);
-
- zero = force_reg (mode, CONST0_RTX(mode));
+ rtx zero = force_reg (mode, CONST0_RTX(mode));
+ rtx mask;
/* Handle masked compare. */
if (VECTOR_MODE_P (mode) && GET_MODE_SIZE (mode) == 64)
@@ -47885,8 +47880,8 @@ void ix86_emit_swsqrtsf (rtx res, rtx a, machine_mode mode,
}
else
{
+ mask = gen_reg_rtx (mode);
emit_insn (gen_rtx_SET (mask, gen_rtx_NE (mode, zero, a)));
-
emit_insn (gen_rtx_SET (x0, gen_rtx_AND (mode, x0, mask)));
}
}