From adf22b3f5a9b826192c4582c897e9b8c8b4ff37a Mon Sep 17 00:00:00 2001 From: Andreas Krebbel Date: Tue, 1 Mar 2016 09:22:20 +0000 Subject: [PATCH] S/390: Get rid of Y constraint in left and logical right shift patterns. With this patch the substitution patterns added earlier are used for the logical right shift and all the left shift patterns. 2016-03-01 Andreas Krebbel * config/s390/s390.md ("3"): Change predicate of op2 to nonmemory_operand. ("*di3_31", "*di3_31_and"): Merge into single pattern definition ... ("*di3_31"): New pattern. ("*3", "*3_and"): Merge into single pattern definition ... ("*3"): New pattern. * config/s390/subst.md: Add ashift and lshiftrt to SUBST iterator. From-SVN: r233844 --- gcc/ChangeLog | 13 ++++++++++ gcc/config/s390/s390.md | 55 ++++++++++++---------------------------- gcc/config/s390/subst.md | 2 +- 3 files changed, 30 insertions(+), 40 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 416eed73b88..aa829f0eb2f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,16 @@ +2016-03-01 Andreas Krebbel + + * config/s390/s390.md ("3"): Change predicate of + op2 to nonmemory_operand. + ("*di3_31", "*di3_31_and"): + Merge into single pattern definition ... + ("*di3_31"): New pattern. + ("*3", "*3_and"): Merge into single + pattern definition ... + ("*3"): New pattern. + * config/s390/subst.md: Add ashift and lshiftrt to SUBST + iterator. + 2016-03-01 Andreas Krebbel * config/s390/predicates.md (const_int_6bitset_operand): New diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md index b7c037a5229..771d1e91c22 100644 --- a/gcc/config/s390/s390.md +++ b/gcc/config/s390/s390.md @@ -8408,60 +8408,37 @@ (define_expand "3" [(set (match_operand:DSI 0 "register_operand" "") (SHIFT:DSI (match_operand:DSI 1 "register_operand" "") - (match_operand:SI 2 "shift_count_or_setmem_operand" "")))] + (match_operand:SI 2 "nonmemory_operand" "")))] "" "") +; ESA 64 bit register pair shift with reg or imm shift count ; sldl, srdl -(define_insn "*di3_31" - [(set (match_operand:DI 0 "register_operand" "=d") - (SHIFT:DI (match_operand:DI 1 "register_operand" "0") - (match_operand:SI 2 "shift_count_or_setmem_operand" "Y")))] +(define_insn "*di3_31" + [(set (match_operand:DI 0 "register_operand" "=d") + (SHIFT:DI (match_operand:DI 1 "register_operand" "0") + (match_operand:SI 2 "nonmemory_operand" "an")))] "!TARGET_ZARCH" - "sdl\t%0,%Y2" + "sdl\t%0," [(set_attr "op_type" "RS") (set_attr "atype" "reg") (set_attr "z196prop" "z196_cracked")]) -; sll, srl, sllg, srlg, sllk, srlk -(define_insn "*3" - [(set (match_operand:GPR 0 "register_operand" "=d,d") - (SHIFT:GPR (match_operand:GPR 1 "register_operand" ",d") - (match_operand:SI 2 "shift_count_or_setmem_operand" "Y,Y")))] - "" - "@ - sl\t%0,<1>%Y2 - sl\t%0,%1,%Y2" - [(set_attr "op_type" "RS,RSY") - (set_attr "atype" "reg,reg") - (set_attr "cpu_facility" "*,z196") - (set_attr "z10prop" "z10_super_E1,*")]) - -; sldl, srdl -(define_insn "*di3_31_and" - [(set (match_operand:DI 0 "register_operand" "=d") - (SHIFT:DI (match_operand:DI 1 "register_operand" "0") - (and:SI (match_operand:SI 2 "shift_count_or_setmem_operand" "Y") - (match_operand:SI 3 "const_int_operand" "n"))))] - "!TARGET_ZARCH && (INTVAL (operands[3]) & 63) == 63" - "sdl\t%0,%Y2" - [(set_attr "op_type" "RS") - (set_attr "atype" "reg")]) +; 64 bit register shift with reg or imm shift count ; sll, srl, sllg, srlg, sllk, srlk -(define_insn "*3_and" - [(set (match_operand:GPR 0 "register_operand" "=d,d") - (SHIFT:GPR (match_operand:GPR 1 "register_operand" ",d") - (and:SI (match_operand:SI 2 "shift_count_or_setmem_operand" "Y,Y") - (match_operand:SI 3 "const_int_operand" "n,n"))))] - "(INTVAL (operands[3]) & 63) == 63" +(define_insn "*3" + [(set (match_operand:GPR 0 "register_operand" "=d, d") + (SHIFT:GPR (match_operand:GPR 1 "register_operand" ", d") + (match_operand:SI 2 "nonmemory_operand" "an,an")))] + "" "@ - sl\t%0,<1>%Y2 - sl\t%0,%1,%Y2" + sl\t%0,<1> + sl\t%0,%1," [(set_attr "op_type" "RS,RSY") (set_attr "atype" "reg,reg") (set_attr "cpu_facility" "*,z196") - (set_attr "z10prop" "z10_super_E1,*")]) + (set_attr "z10prop" "z10_super_E1,*")]) ; ; ashr(di|si)3 instruction pattern(s). diff --git a/gcc/config/s390/subst.md b/gcc/config/s390/subst.md index c3761a972a2..907676af396 100644 --- a/gcc/config/s390/subst.md +++ b/gcc/config/s390/subst.md @@ -19,7 +19,7 @@ ;; along with GCC; see the file COPYING3. If not see ;; . -(define_code_iterator SUBST [rotate]) +(define_code_iterator SUBST [rotate ashift lshiftrt]) ; This expands an register/immediate operand to a register+immediate ; operand to draw advantage of the address style operand format -- 2.30.2