Commit 5a37a60c by Uros Bizjak Committed by Uros Bizjak

i386.c (ix86_builtin_reciprocal): Remove check for TARGET_RECIP.

        * config/i386/i386.c (ix86_builtin_reciprocal): Remove check
        for TARGET_RECIP.
        (ix86_emit_swsqrtsf): Do not filter out infinity for rsqrt expansion.

From-SVN: r131342
parent a6514ef2
2008-01-05 Uros Bizjak <ubizjak@gmail.com>
* config/i386/i386.c (ix86_builtin_reciprocal): Remove check
for TARGET_RECIP.
(ix86_emit_swsqrtsf): Do not filter out infinity for rsqrt expansion.
2008-01-05 Richard Sandiford <rsandifo@nildram.co.uk> 2008-01-05 Richard Sandiford <rsandifo@nildram.co.uk>
* c-omp.c (check_omp_for_incr_expr): Handle CONVERT_EXPR. * c-omp.c (check_omp_for_incr_expr): Handle CONVERT_EXPR.
...@@ -21466,7 +21466,7 @@ static tree ...@@ -21466,7 +21466,7 @@ static tree
ix86_builtin_reciprocal (unsigned int fn, bool md_fn, ix86_builtin_reciprocal (unsigned int fn, bool md_fn,
bool sqrt ATTRIBUTE_UNUSED) bool sqrt ATTRIBUTE_UNUSED)
{ {
if (! (TARGET_SSE_MATH && TARGET_RECIP && !optimize_size if (! (TARGET_SSE_MATH && !optimize_size
&& flag_finite_math_only && !flag_trapping_math && flag_finite_math_only && !flag_trapping_math
&& flag_unsafe_math_optimizations)) && flag_unsafe_math_optimizations))
return NULL_TREE; return NULL_TREE;
...@@ -24239,16 +24239,18 @@ void ix86_emit_swsqrtsf (rtx res, rtx a, enum machine_mode mode, ...@@ -24239,16 +24239,18 @@ void ix86_emit_swsqrtsf (rtx res, rtx a, enum machine_mode mode,
1.0 / sqrt(a) = 0.5 * rsqrtss(a) * (3.0 - a * rsqrtss(a) * rsqrtss(a)) */ 1.0 / sqrt(a) = 0.5 * rsqrtss(a) * (3.0 - a * rsqrtss(a) * rsqrtss(a)) */
/* Compare a to zero. */ /* Compare a to zero. */
emit_insn (gen_rtx_SET (VOIDmode, mask, if (!recip)
gen_rtx_NE (mode, zero, a))); emit_insn (gen_rtx_SET (VOIDmode, mask,
gen_rtx_NE (mode, zero, a)));
/* x0 = 1./sqrt(a) estimate */ /* x0 = 1./sqrt(a) estimate */
emit_insn (gen_rtx_SET (VOIDmode, x0, emit_insn (gen_rtx_SET (VOIDmode, x0,
gen_rtx_UNSPEC (mode, gen_rtvec (1, a), gen_rtx_UNSPEC (mode, gen_rtvec (1, a),
UNSPEC_RSQRT))); UNSPEC_RSQRT)));
/* Filter out infinity. */ /* Filter out infinity. */
emit_insn (gen_rtx_SET (VOIDmode, x0, if (!recip)
gen_rtx_AND (mode, x0, mask))); emit_insn (gen_rtx_SET (VOIDmode, x0,
gen_rtx_AND (mode, x0, mask)));
/* e0 = x0 * a */ /* e0 = x0 * a */
emit_insn (gen_rtx_SET (VOIDmode, e0, emit_insn (gen_rtx_SET (VOIDmode, e0,
gen_rtx_MULT (mode, x0, a))); gen_rtx_MULT (mode, x0, a)));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment