From: Uros Bizjak Date: Sun, 27 Sep 2015 18:02:36 +0000 (+0200) Subject: predicates.md (register_sse4nonimm_operand): New predicate. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=846e2ad83cfab0a6b06ee4b23e053f3d73cc83d3;p=gcc.git predicates.md (register_sse4nonimm_operand): New predicate. * config/i386/predicates.md (register_sse4nonimm_operand): New predicate. * config/i386/sse.md (PEXTR_MODE12): New mode iterator. (*vec_extract): Use PEXTR_MODE12 instead of VI12_128 mode. Use register_sse4nonimm_operand as operand 0 predicate. (*vec_extractv8hi_sse2): Remove insn pattern. (*vec_extract_zext): Merge insn pattern from *vec_extractv8hi_zext and *vec_extractv16qi_zext patterns. From-SVN: r228178 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9734b08547e..5c956045c86 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +2015-09-27 Uros Bizjak + + * config/i386/predicates.md (register_sse4nonimm_operand): New + predicate. + * config/i386/sse.md (PEXTR_MODE12): New mode iterator. + (*vec_extract): Use PEXTR_MODE12 instead of VI12_128 mode. + Use register_sse4nonimm_operand as operand 0 predicate. + (*vec_extractv8hi_sse2): Remove insn pattern. + (*vec_extract_zext): Merge insn pattern from + *vec_extractv8hi_zext and *vec_extractv16qi_zext patterns. + 2015-09-27 Oleg Endo Kaz Kojima diff --git a/gcc/config/i386/predicates.md b/gcc/config/i386/predicates.md index bc76a5b7cee..042b9494a2b 100644 --- a/gcc/config/i386/predicates.md +++ b/gcc/config/i386/predicates.md @@ -127,6 +127,12 @@ (match_operand 0 "nonimmediate_operand") (match_operand 0 "register_operand"))) +;; Match register operands, include memory operand for TARGET_SSE4_1. +(define_predicate "register_sse4nonimm_operand" + (if_then_else (match_test "TARGET_SSE4_1") + (match_operand 0 "nonimmediate_operand") + (match_operand 0 "register_operand"))) + ;; Return true if VALUE is symbol reference (define_predicate "symbol_operand" (match_code "symbol_ref")) diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md index 0a57db001c8..4eefb4529b8 100644 --- a/gcc/config/i386/sse.md +++ b/gcc/config/i386/sse.md @@ -12864,23 +12864,21 @@ (set_attr "prefix" "maybe_vex,maybe_vex,orig,orig,vex") (set_attr "mode" "TI,TI,V4SF,SF,SF")]) +;; QI and HI modes handled by pextr patterns. +(define_mode_iterator PEXTR_MODE12 + [(V16QI "TARGET_SSE4_1") V8HI]) + (define_insn "*vec_extract" - [(set (match_operand: 0 "nonimmediate_operand" "=r,m") + [(set (match_operand: 0 "register_sse4nonimm_operand" "=r,m") (vec_select: - (match_operand:VI12_128 1 "register_operand" "x,x") + (match_operand:PEXTR_MODE12 1 "register_operand" "x,x") (parallel [(match_operand:SI 2 "const_0_to__operand")])))] - "TARGET_SSE4_1" - "@ - %vpextr\t{%2, %1, %k0|%k0, %1, %2} - %vpextr\t{%2, %1, %0|%0, %1, %2}" - [(set_attr "type" "sselog1") - (set (attr "prefix_data16") - (if_then_else - (and (eq_attr "alternative" "0") - (eq (const_string "mode") (const_string "V8HImode"))) - (const_string "1") - (const_string "*"))) + "TARGET_SSE2" + "%vpextr\t{%2, %1, %k0|%k0, %1, %2}" + [(set_attr "isa" "*,sse4") + (set_attr "type" "sselog1") + (set_attr "prefix_data16" "1") (set (attr "prefix_extra") (if_then_else (and (eq_attr "alternative" "0") @@ -12891,45 +12889,23 @@ (set_attr "prefix" "maybe_vex") (set_attr "mode" "TI")]) -(define_insn "*vec_extractv8hi_sse2" - [(set (match_operand:HI 0 "register_operand" "=r") - (vec_select:HI - (match_operand:V8HI 1 "register_operand" "x") - (parallel - [(match_operand:SI 2 "const_0_to_7_operand")])))] - "TARGET_SSE2 && !TARGET_SSE4_1" - "pextrw\t{%2, %1, %k0|%k0, %1, %2}" - [(set_attr "type" "sselog1") - (set_attr "prefix_data16" "1") - (set_attr "length_immediate" "1") - (set_attr "mode" "TI")]) - -(define_insn "*vec_extractv16qi_zext" - [(set (match_operand:SWI48 0 "register_operand" "=r") - (zero_extend:SWI48 - (vec_select:QI - (match_operand:V16QI 1 "register_operand" "x") - (parallel - [(match_operand:SI 2 "const_0_to_15_operand")]))))] - "TARGET_SSE4_1" - "%vpextrb\t{%2, %1, %k0|%k0, %1, %2}" - [(set_attr "type" "sselog1") - (set_attr "prefix_extra" "1") - (set_attr "length_immediate" "1") - (set_attr "prefix" "maybe_vex") - (set_attr "mode" "TI")]) - -(define_insn "*vec_extractv8hi_zext" +(define_insn "*vec_extract_zext" [(set (match_operand:SWI48 0 "register_operand" "=r") (zero_extend:SWI48 - (vec_select:HI - (match_operand:V8HI 1 "register_operand" "x") + (vec_select: + (match_operand:PEXTR_MODE12 1 "register_operand" "x") (parallel - [(match_operand:SI 2 "const_0_to_7_operand")]))))] + [(match_operand:SI 2 + "const_0_to__operand")]))))] "TARGET_SSE2" - "%vpextrw\t{%2, %1, %k0|%k0, %1, %2}" + "%vpextr\t{%2, %1, %k0|%k0, %1, %2}" [(set_attr "type" "sselog1") (set_attr "prefix_data16" "1") + (set (attr "prefix_extra") + (if_then_else + (eq (const_string "mode") (const_string "V8HImode")) + (const_string "*") + (const_string "1"))) (set_attr "length_immediate" "1") (set_attr "prefix" "maybe_vex") (set_attr "mode" "TI")]) @@ -18347,8 +18323,7 @@ 3 "register_operand") (match_operand:SI 5 "const1248_operand ")])) (mem:BLK (scratch)) - (match_operand: - 4 "register_operand")] + (match_operand: 4 "register_operand")] UNSPEC_GATHER)) (clobber (match_scratch:VEC_GATHER_MODE 6))])] "TARGET_AVX2"