diff options
-rw-r--r-- | gcc/ChangeLog | 11 | ||||
-rw-r--r-- | gcc/config/i386/i386.c | 5 | ||||
-rw-r--r-- | gcc/config/i386/i386.md | 12 |
3 files changed, 19 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6440950f470..7488e925ad5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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, diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 848b8508652..0f6612dabf8 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -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); diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 70753324661..713886885d0 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -1722,17 +1722,17 @@ [(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") |