SME has various instructions that require aligned register tuples. However, the associated tuple modes are already widely used and do not need to be aligned in other contexts. It therefore isn't appropriate to force alignment in TARGET_HARD_REGNO_MODE_OK.
There are also strided loads and stores that require: - (regno & 0x8) == 0 for 2-register tuples - (regno & 0xc) == 0 for 4-register tuples Although the requirements for strided loads and stores could be enforced by C++ conditions on the insn, it's convenient to handle them in the same way as alignment. This series of patches therefore adds a way for register constraints to specify which start registers are valid and which aren't. Most of the details are in the covering note to the first patch. This is clearly changing a performance-sensitive part of the compiler. I've tried to ensure that the overhead is only small for targets that use the new feature. Almost all of the new code gets optimised away on targets that don't use the feature. Richard Sandiford (5): Add register filter operand to define_register_constraint recog: Handle register filters lra: Handle register filters ira: Handle register filters Add an aligned_register_operand predicate gcc/common.md | 28 ++++++++ gcc/doc/md.texi | 41 +++++++++++- gcc/doc/tm.texi | 3 +- gcc/doc/tm.texi.in | 3 +- gcc/genconfig.cc | 2 + gcc/genpreds.cc | 146 ++++++++++++++++++++++++++++++++++++++++- gcc/gensupport.cc | 48 +++++++++++++- gcc/gensupport.h | 3 + gcc/ira-build.cc | 8 +++ gcc/ira-color.cc | 10 +++ gcc/ira-int.h | 14 ++++ gcc/ira-lives.cc | 61 +++++++++++++++++ gcc/lra-constraints.cc | 13 +++- gcc/recog.cc | 14 +++- gcc/recog.h | 24 ++++++- gcc/reginfo.cc | 5 ++ gcc/rtl.def | 6 +- gcc/target-globals.cc | 6 +- gcc/target-globals.h | 3 + 19 files changed, 421 insertions(+), 17 deletions(-) -- 2.25.1