From 5c8617dce6534f9438d4a7d110b277b2fddf19c5 Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Wed, 28 Dec 2016 16:16:26 +0100 Subject: re PR target/78904 (zero-extracts are not effective) PR target/78904 * config/i386/constraints.md (Bn): New special memory constraint. * config/i386/predicates.md (norex_memory_operand): New predicate. * config/i386/i386.md (*extzvqi_mem_rex64): New insn pattern and corresponding peephole2 pattern. testsuite/ChangeLog: PR target/78904 * gcc.target/i386/pr78904-4.c: New test. * gcc.target/i386/pr78904-5.c: Ditto. From-SVN: r243955 --- gcc/config/i386/i386.md | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'gcc/config/i386/i386.md') diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 13769f987ff..cf9dc03ba8b 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -2835,9 +2835,20 @@ [(set_attr "type" "imovx") (set_attr "mode" "SI")]) +(define_insn "*extzvqi_mem_rex64" + [(set (match_operand:QI 0 "norex_memory_operand" "=Bn") + (subreg:QI + (zero_extract:SI (match_operand 1 "ext_register_operand" "Q") + (const_int 8) + (const_int 8)) 0))] + "TARGET_64BIT && reload_completed" + "mov{b}\t{%h1, %0|%0, %h1}" + [(set_attr "type" "imov") + (set_attr "mode" "QI")]) + (define_insn "*extzvqi" [(set (match_operand:QI 0 "nonimmediate_operand" "=QBc,?R,m") - (subreg:QI + (subreg:QI (zero_extract:SI (match_operand 1 "ext_register_operand" "Q,Q,Q") (const_int 8) (const_int 8)) 0))] @@ -2863,6 +2874,21 @@ (const_string "SI") (const_string "QI")))]) +(define_peephole2 + [(set (match_operand:QI 0 "register_operand") + (subreg:QI + (zero_extract:SI (match_operand 1 "ext_register_operand") + (const_int 8) + (const_int 8)) 0)) + (set (match_operand:QI 2 "norex_memory_operand") (match_dup 0))] + "TARGET_64BIT + && peep2_reg_dead_p (2, operands[0])" + [(set (match_dup 2) + (subreg:QI + (zero_extract:SI (match_dup 1) + (const_int 8) + (const_int 8)) 0))]) + (define_expand "insv" [(set (zero_extract:SWI248 (match_operand:SWI248 0 "register_operand") (match_operand:SI 1 "const_int_operand") -- cgit v1.2.1