i386.c (emit_i387_cw_initialization): Fix masking operand value.
authorUros Bizjak <uros@gcc.gnu.org>
Mon, 26 Aug 2019 19:18:30 +0000 (21:18 +0200)
committerUros Bizjak <uros@gcc.gnu.org>
Mon, 26 Aug 2019 19:18:30 +0000 (21:18 +0200)
* config/i386/i386.c (emit_i387_cw_initialization)
<case I387_CW_ROUNDEVEN>: Fix masking operand value.

From-SVN: r274934

gcc/ChangeLog
gcc/config/i386/i386.c

index 852382efcb52d5efcba8bc996dedd9cd9da64756..377275745f5b4d9706346df84bc2235ed7ca7cbf 100644 (file)
@@ -1,4 +1,9 @@
-2019-08-23  Martin Sebor  <msebor@redhat.com>
+2019-08-26  Uroš Bizjak  <ubizjak@gmail.com>
+
+       * config/i386/i386.c (emit_i387_cw_initialization)
+       <case I387_CW_ROUNDEVEN>: Fix masking operand value.
+
+2019-08-26  Martin Sebor  <msebor@redhat.com>
 
        PR c++/83431
        * gimple-ssa-sprintf.c (pass_data_sprintf_length): Remove object.
index c712c03dbe2705603273ca7ee40dd540fba1c276..f3b3a9a326fdb1c35155586c9f0e8d64e77a09b9 100644 (file)
@@ -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;