diff options
author | Uros Bizjak <uros@gcc.gnu.org> | 2016-06-07 00:35:18 +0200 |
---|---|---|
committer | Uros Bizjak <uros@gcc.gnu.org> | 2016-06-07 00:35:18 +0200 |
commit | c7ca8ef875201d4eaa685edbb31fc97eaaa903d8 (patch) | |
tree | 9f439388509de6078944a34a327284a7a0125c55 /gcc/config/i386/i386.md | |
parent | 1f40cff37998535a8f6f3eb6989327d8be3c8efb (diff) | |
download | gcc-c7ca8ef875201d4eaa685edbb31fc97eaaa903d8.tar.gz |
i386.h (enum ix86_enitity): Add X86_DIRFLAG.
* config/i386/i386.h (enum ix86_enitity): Add X86_DIRFLAG.
(enum x86_dirflag_state): New enum.
(NUM_MODES_FOR_MODE_SWITCHING): Add X86_DIRFLAG_ANY.
(machine_function): Remove needs_cld.
(ix86_current_function_needs_cld): Remove.
* config/i386/i386.c (ix86_set_func_type): Set
ix86_optimize_mode_switching[X86_DIRFLAG] to 1.
(ix86_expand_prologue): Do not emit CLD here.
(ix86_dirflag_mode_needed): New function.
(ix86_dirflag_mode_entry): Ditto.
(ix86_mode_needed): Handle X86_DIRFLAG entity.
(ix86_mode_after): Ditto.
(ix86_mode_entry): Ditto.
(ix86_mode_exit): Ditto.
(ix86_emit_mode_set): Ditto.
* config/i386/i386.md (strmov_singleop): Set
ix86_optimize_mode_switching[X86_DIRFLAG] to 1 for TARGET_CLD.
Do not set ix86_current_function_needs_cld.
(rep_mov): Ditto.
(strset_singleop): Ditto.
(rep_stos): Ditto.
(cmpstrnqi_nz_1): Ditto.
(cmpstrnqi_1): Ditto.
(strlenqi_1): Ditto.
From-SVN: r237156
Diffstat (limited to 'gcc/config/i386/i386.md')
-rw-r--r-- | gcc/config/i386/i386.md | 35 |
1 files changed, 28 insertions, 7 deletions
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index a32c4e204ce..416cdcd9129 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -16350,7 +16350,10 @@ (set (match_operand 2 "register_operand") (match_operand 5))])] "" - "ix86_current_function_needs_cld = 1;") +{ + if (TARGET_CLD) + ix86_optimize_mode_switching[X86_DIRFLAG] = 1; +}) (define_insn "*strmovdi_rex_1" [(set (mem:DI (match_operand:P 2 "register_operand" "0")) @@ -16432,7 +16435,10 @@ (match_operand 3 "memory_operand")) (use (match_dup 4))])] "" - "ix86_current_function_needs_cld = 1;") +{ + if (TARGET_CLD) + ix86_optimize_mode_switching[X86_DIRFLAG] = 1; +}) (define_insn "*rep_movdi_rex64" [(set (match_operand:P 2 "register_operand" "=c") (const_int 0)) @@ -16555,7 +16561,10 @@ (match_operand 3)) (unspec [(const_int 0)] UNSPEC_STOS)])] "" - "ix86_current_function_needs_cld = 1;") +{ + if (TARGET_CLD) + ix86_optimize_mode_switching[X86_DIRFLAG] = 1; +}) (define_insn "*strsetdi_rex_1" [(set (mem:DI (match_operand:P 1 "register_operand" "0")) @@ -16627,7 +16636,10 @@ (use (match_operand 3 "register_operand")) (use (match_dup 1))])] "" - "ix86_current_function_needs_cld = 1;") +{ + if (TARGET_CLD) + ix86_optimize_mode_switching[X86_DIRFLAG] = 1; +}) (define_insn "*rep_stosdi_rex64" [(set (match_operand:P 1 "register_operand" "=c") (const_int 0)) @@ -16786,7 +16798,10 @@ (clobber (match_operand 1 "register_operand")) (clobber (match_dup 2))])] "" - "ix86_current_function_needs_cld = 1;") +{ + if (TARGET_CLD) + ix86_optimize_mode_switching[X86_DIRFLAG] = 1; +}) (define_insn "*cmpstrnqi_nz_1" [(set (reg:CC FLAGS_REG) @@ -16824,7 +16839,10 @@ (clobber (match_operand 1 "register_operand")) (clobber (match_dup 2))])] "" - "ix86_current_function_needs_cld = 1;") +{ + if (TARGET_CLD) + ix86_optimize_mode_switching[X86_DIRFLAG] = 1; +}) (define_insn "*cmpstrnqi_1" [(set (reg:CC FLAGS_REG) @@ -16870,7 +16888,10 @@ (clobber (match_operand 1 "register_operand")) (clobber (reg:CC FLAGS_REG))])] "" - "ix86_current_function_needs_cld = 1;") +{ + if (TARGET_CLD) + ix86_optimize_mode_switching[X86_DIRFLAG] = 1; +}) (define_insn "*strlenqi_1" [(set (match_operand:P 0 "register_operand" "=&c") |