diff options
Diffstat (limited to 'gcc/config/i386/i386-expand.c')
-rw-r--r-- | gcc/config/i386/i386-expand.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/gcc/config/i386/i386-expand.c b/gcc/config/i386/i386-expand.c index 5fe38052056..5c48cded954 100644 --- a/gcc/config/i386/i386-expand.c +++ b/gcc/config/i386/i386-expand.c @@ -16310,7 +16310,7 @@ ix86_expand_rint (rtx operand0, rtx operand1) return copysign (xa, operand1); */ machine_mode mode = GET_MODE (operand0); - rtx res, xa, TWO52, two52, mask; + rtx res, xa, TWO52, mask; rtx_code_label *label; res = gen_reg_rtx (mode); @@ -16323,16 +16323,18 @@ ix86_expand_rint (rtx operand0, rtx operand1) TWO52 = ix86_gen_TWO52 (mode); label = ix86_expand_sse_compare_and_jump (UNLE, TWO52, xa, false); - two52 = TWO52; if (flag_rounding_math) { - two52 = gen_reg_rtx (mode); - ix86_sse_copysign_to_positive (two52, TWO52, res, mask); + ix86_sse_copysign_to_positive (TWO52, TWO52, res, mask); xa = res; } - xa = expand_simple_binop (mode, PLUS, xa, two52, NULL_RTX, 0, OPTAB_DIRECT); - xa = expand_simple_binop (mode, MINUS, xa, two52, xa, 0, OPTAB_DIRECT); + xa = expand_simple_binop (mode, PLUS, xa, TWO52, NULL_RTX, 0, OPTAB_DIRECT); + xa = expand_simple_binop (mode, MINUS, xa, TWO52, xa, 0, OPTAB_DIRECT); + + /* Remove the sign with FE_DOWNWARD, where x - x = -0.0. */ + if (HONOR_SIGNED_ZEROS (mode) && flag_rounding_math) + xa = ix86_expand_sse_fabs (xa, NULL); ix86_sse_copysign_to_positive (res, xa, res, mask); @@ -16577,7 +16579,7 @@ ix86_expand_truncdf_32 (rtx operand0, rtx operand1) tmp = expand_simple_binop (mode, MINUS, xa2, tmp, NULL_RTX, 0, OPTAB_DIRECT); /* Remove the sign with FE_DOWNWARD, where x - x = -0.0. */ - if (flag_rounding_math) + if (HONOR_SIGNED_ZEROS (mode) && flag_rounding_math) tmp = ix86_expand_sse_fabs (tmp, NULL); /* res = copysign (xa2, operand1) */ |