aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2019-05-10 09:22:31 +0200
committerMartin Liska <marxin@gcc.gnu.org>2019-05-10 07:22:31 +0000
commitecd71fee44843437af58e18eb2698c302088cace (patch)
tree0a06db8bc9afc4b9a837f5e1855b52204dfebfb7 /gcc
parent26f36b50ead92836710b0ae799abaf4f000a6f88 (diff)
downloadgcc-ecd71fee44843437af58e18eb2698c302088cace.zip
gcc-ecd71fee44843437af58e18eb2698c302088cace.tar.gz
gcc-ecd71fee44843437af58e18eb2698c302088cace.tar.bz2
Reapply r269790 which was missed during rebase.
2019-05-10 Martin Liska <mliska@suse.cz> * config/i386/i386-expand.c (ix86_expand_floorceildf_32): Reapply changes from r269790. From-SVN: r271054
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/i386/i386-expand.c17
2 files changed, 14 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3c2c13d..5e30430 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
2019-05-10 Martin Liska <mliska@suse.cz>
+ * config/i386/i386-expand.c (ix86_expand_floorceildf_32):
+ Reapply changes from r269790.
+
+2019-05-10 Martin Liska <mliska@suse.cz>
+
PR middle-end/90340
* doc/invoke.texi: New params.
* params.def (PARAM_JUMP_TABLE_MAX_GROWTH_RATIO_FOR_SIZE): New.
diff --git a/gcc/config/i386/i386-expand.c b/gcc/config/i386/i386-expand.c
index b7ce5d0..a55d492 100644
--- a/gcc/config/i386/i386-expand.c
+++ b/gcc/config/i386/i386-expand.c
@@ -15533,8 +15533,10 @@ ix86_expand_floorceildf_32 (rtx operand0, rtx operand1, bool do_floor)
x2 -= 1;
Compensate. Ceil:
if (x2 < x)
- x2 -= -1;
- return x2;
+ x2 += 1;
+ if (HONOR_SIGNED_ZEROS (mode))
+ x2 = copysign (x2, x);
+ return x2;
*/
machine_mode mode = GET_MODE (operand0);
rtx xa, TWO52, tmp, one, res, mask;
@@ -15560,17 +15562,16 @@ ix86_expand_floorceildf_32 (rtx operand0, rtx operand1, bool do_floor)
/* xa = copysign (xa, operand1) */
ix86_sse_copysign_to_positive (xa, xa, res, mask);
- /* generate 1.0 or -1.0 */
- one = force_reg (mode,
- const_double_from_real_value (do_floor
- ? dconst1 : dconstm1, mode));
+ /* generate 1.0 */
+ one = force_reg (mode, const_double_from_real_value (dconst1, mode));
/* Compensate: xa = xa - (xa > operand1 ? 1 : 0) */
tmp = ix86_expand_sse_compare_mask (UNGT, xa, res, !do_floor);
emit_insn (gen_rtx_SET (tmp, gen_rtx_AND (mode, one, tmp)));
- /* We always need to subtract here to preserve signed zero. */
- tmp = expand_simple_binop (mode, MINUS,
+ tmp = expand_simple_binop (mode, do_floor ? MINUS : PLUS,
xa, tmp, NULL_RTX, 0, OPTAB_DIRECT);
+ if (!do_floor && HONOR_SIGNED_ZEROS (mode))
+ ix86_sse_copysign_to_positive (tmp, tmp, res, mask);
emit_move_insn (res, tmp);
emit_label (label);