aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2019-11-19 10:31:59 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2019-11-19 10:31:59 +0100
commit63b887119024128efaeb122193c935397c2572e9 (patch)
treee81c2ec143652cdfe8583b8a1b11117e6fdd01b4 /gcc/config
parentbeeac4c2716e5873648c67f71ba810cc02f7f8a8 (diff)
downloadgcc-63b887119024128efaeb122193c935397c2572e9.zip
gcc-63b887119024128efaeb122193c935397c2572e9.tar.gz
gcc-63b887119024128efaeb122193c935397c2572e9.tar.bz2
re PR target/92549 (Use x86 xchg instruction more)
PR target/92549 * config/i386/i386.md (peephole2 for *swap<mode>): New peephole2. * gcc.target/i386/pr92549.c: New test. From-SVN: r278439
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/i386/i386.md11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index fb2235a..7ff5872 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -2787,6 +2787,17 @@
(set_attr "amdfam10_decode" "double")
(set_attr "bdver1_decode" "double")])
+(define_peephole2
+ [(set (match_operand:SWI 0 "register_operand")
+ (match_operand:SWI 1 "register_operand"))
+ (set (match_dup 1)
+ (match_operand:SWI 2 "register_operand"))
+ (set (match_dup 2) (match_dup 0))]
+ "peep2_reg_dead_p (3, operands[0])
+ && optimize_insn_for_size_p ()"
+ [(parallel [(set (match_dup 1) (match_dup 2))
+ (set (match_dup 2) (match_dup 1))])])
+
(define_expand "movstrict<mode>"
[(set (strict_low_part (match_operand:SWI12 0 "register_operand"))
(match_operand:SWI12 1 "general_operand"))]