From: Uros Bizjak Date: Tue, 8 Dec 2015 08:53:42 +0000 (+0100) Subject: i386.c (ix86_emit_swsqrtsf): Cleanup infinity filterning code. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e8e1c90f3f856193a85622a0ee4c19b2b22c5a76;p=gcc.git i386.c (ix86_emit_swsqrtsf): Cleanup infinity filterning code. * config/i386/i386.c (ix86_emit_swsqrtsf): Cleanup infinity filterning code. From-SVN: r231397 --- 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 + + * config/i386/i386.c (ix86_emit_swsqrtsf): Cleanup + infinity filterning code. + 2015-12-08 Ilya Enkovich 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))); } }