i386.c (ix86_expand_builtin): Generate reg for readflags built-in when optimizing.
authorKirill Yukhin <kirill.yukhin@intel.com>
Thu, 5 Dec 2013 12:20:19 +0000 (12:20 +0000)
committerKirill Yukhin <kyukhin@gcc.gnu.org>
Thu, 5 Dec 2013 12:20:19 +0000 (12:20 +0000)
        * config/i386/i386.c (ix86_expand_builtin): Generate
        reg for readflags built-in when optimizing.
        * config/i386/i386.md (*pushfl<mode>): Rename to ...
        (pushfl<mode>2): This. Fix iterator.
        (*popfl<mode>): Rename to ...
        (*popfl<mode>1): This. Fix iterator.

From-SVN: r205707

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

index 6440950..7488e92 100644 (file)
@@ -1,6 +1,15 @@
 2013-12-05  Kirill Yukhin  <kirill.yukhin@intel.com>
 
-        * config/i386/i386.c(IX86_BUILTIN_READ_FLAGS): New.
+       * config/i386/i386.c (ix86_expand_builtin): Generate
+       reg for readflags built-in when optimizing.
+       * config/i386/i386.md (*pushfl<mode>): Rename to ...
+       (pushfl<mode>2): This. Fix iterator.
+       (*popfl<mode>): Rename to ...
+       (*popfl<mode>1): This. Fix iterator.
+
+2013-12-05  Kirill Yukhin  <kirill.yukhin@intel.com>
+
+        * config/i386/i386.c (IX86_BUILTIN_READ_FLAGS): New.
        (IX86_BUILTIN_WRITE_FLAGS): Ditto.
        (ix86_init_mmx_sse_builtins): Define
        __builtin_ia32_writeeflags_u32, __builtin_ia32_writeeflags_u64,
index 848b850..0f6612d 100644 (file)
@@ -33457,8 +33457,9 @@ addcarryx:
     case IX86_BUILTIN_READ_FLAGS:
       emit_insn (gen_push (gen_rtx_REG (word_mode, FLAGS_REG)));
 
-      if (target == NULL_RTX
-         || !register_operand (target, word_mode)
+      if (optimize
+         || target == NULL_RTX
+         || !nonimmediate_operand (target, word_mode)
          || GET_MODE (target) != word_mode)
        target = gen_reg_rtx (word_mode);
 
index 7075332..7138868 100644 (file)
   [(set_attr "type" "pop")
    (set_attr "mode" "<MODE>")])
 
-(define_insn "*pushfl<mode>"
-  [(set (match_operand:DWIH 0 "push_operand" "=<")
-       (match_operand:DWIH 1 "flags_reg_operand"))]
+(define_insn "*pushfl<mode>2"
+  [(set (match_operand:W 0 "push_operand" "=<")
+       (match_operand:W 1 "flags_reg_operand"))]
   ""
   "pushf{<imodesuffix>}"
   [(set_attr "type" "push")
    (set_attr "mode" "<MODE>")])
 
-(define_insn "*popfl<mode>"
-  [(set (match_operand:DWIH 0 "flags_reg_operand")
-       (match_operand:DWIH 1 "pop_operand" ">"))]
+(define_insn "*popfl<mode>1"
+  [(set (match_operand:W 0 "flags_reg_operand")
+       (match_operand:W 1 "pop_operand" ">"))]
   ""
   "popf{<imodesuffix>}"
   [(set_attr "type" "pop")