On S/390 we have address style shift counts. So it is possible to have a reg + const_int shift count. To address this it appeared to be convenient to really handle this as address operand. For that reason the "Y" constraint used for shift counts is an extra memory constraint. Unfortunately a shift count is not necessarily Pmode. So even when compiling for 64 bit we had to allow SImode addresses for Y. Since all extra memory constraints go through s390_decompose_address we had to unconditionally enable SImode addresses everywhere:
https://gcc.gnu.org/ml/gcc-patches/2006-03/msg01495.html Unfortunately this seems to cause some trouble in situations not entirely clear to me yet: https://gcc.gnu.org/ml/gcc/2015-05/msg00305.html This patchset fixes this by getting rid of SImode - "Y" combinations in our machine description. To prevent us from losing performance in situations where an reg + const_int can really be used as shift count we have to make it explicit in the RTL patterns. This unfortunately requires us to duplicate a lot of patterns. To compensate for that I'm using the define_subst mechanism to keep the overhead limited. In fact the patchset reduces the number of lines in the md files. I've tested the whole patchset with various CPU levels on s390 and s390x. No regressions. Patch 1 is the only common code change which fixes a problem with the renumbering of operands when performing substitutions. While I only need a formal approval for patch 1 comments regarding the other patches are welcome as well. Ok to apply? Bye, -Andreas- Andreas Krebbel (9): gensupport: Fix define_subst operand renumbering. S/390: Add disabled insn attribute S/390: Get rid of Y constraint in rotate patterns. S/390: Get rid of Y constraint in left and logical right shift patterns. S/390: Get rid of Y constraint in arithmetic right shift patterns. S/390: Get rid of Y constraint in tabort. S/390: Get rid of Y constraint in vector.md. S/390: Use define_subst for the setmem patterns. S/390: Disallow SImode in s390_decompose_address gcc/config/s390/predicates.md | 31 +++ gcc/config/s390/s390.c | 8 +- gcc/config/s390/s390.md | 581 +++++++++++++++--------------------------- gcc/config/s390/subst.md | 180 +++++++++++++ gcc/config/s390/vector.md | 138 +++++----- gcc/gensupport.c | 41 +-- 6 files changed, 520 insertions(+), 459 deletions(-) create mode 100644 gcc/config/s390/subst.md -- 1.9.1