[i386] : Fix gcc.target/i386/sse4_1-round-roundeven-2.c execution test failure

Message ID CAFULd4Y-_1zvRt7g9QvRAzaPO1KBuKQ7G=Dww93J0nkfar+yrw@mail.gmail.com
State New
Headers show
Series
  • [i386] : Fix gcc.target/i386/sse4_1-round-roundeven-2.c execution test failure
Related show

Commit Message

Uros Bizjak Aug. 26, 2019, 7:21 p.m.
We have to negate masking value to clear certain bits.

2019-08-26  UroŇ° Bizjak  <ubizjak@gmail.com>

    * config/i386/i386.c (emit_i387_cw_initialization)
    <case I387_CW_ROUNDEVEN>: Fix masking operand value.

Tested on x86_64-linux-gnu {,-m32} and committed to mainline SVN.

Uros.

Patch

Index: config/i386/i386.c
===================================================================
--- config/i386/i386.c	(revision 274930)
+++ config/i386/i386.c	(working copy)
@@ -13785,7 +13785,7 @@  emit_i387_cw_initialization (int mode)
     {
     case I387_CW_ROUNDEVEN:
       /* round to nearest */
-      emit_insn (gen_andhi3 (reg, reg, GEN_INT (0x0c00)));
+      emit_insn (gen_andhi3 (reg, reg, GEN_INT (~0x0c00)));
       slot = SLOT_CW_ROUNDEVEN;
       break;