1eae67f812
Originally subregs operated at the word level and subreg offsets were measured in words. The offset units were later changed from words to bytes (SUBREG_WORD became SUBREG_BYTE), but the fundamental assumption that subregs should operate at the word level remained. Whether (subreg:M1 (reg:M2 R2) N) is well-formed depended on the way that M1 and M2 partitioned into words and whether the subword part of N represented a lowpart. However, some questions depended instead on the macro REGMODE_NATURAL_SIZE, which was introduced as part of the patch that moved from SUBREG_WORD to SUBREG_BYTE. It is used to decide whether setting (subreg:M1 (reg:M2 R2) N) clobbers all of R2 or just part of it (df_read_modify_subreg). Using words doesn't really make sense for modern vector architectures. Vector registers are usually bigger than a word and: (a) setting the scalar lowpart of them usually clobbers the rest of the register (contrary to the subreg rules, where only the containing words should be clobbered). (b) high words of vector registers are often not independently addressable, even though that's what the subreg rules expect. This patch therefore uses REGMODE_NATURAL_SIZE instead of UNITS_PER_WORD to determine the size of the independently addressable blocks in an inner register. This is needed for SVE because the number of words in a vector mode isn't known at compile time, so isn't a sensible basis for calculating the number of registers. The only existing port to define REGMODE_NATURAL_SIZE is 64-bit SPARC, where FP registers are 32 bits. (This is the opposite of the use case for SVE, since the natural division is smaller than a word.) I compiled the testsuite before and after the patch for sparc64-linux-gnu and the only test whose assembly changed was g++.dg/debug/pr65678.C, where the order of two independent stores was reversed and where a different register was picked for one pseudo. The new code was otherwise equivalent to the old code. 2017-11-09 Richard Sandiford <richard.sandiford@linaro.org> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> gcc/ * doc/rtl.texi: Rewrite the subreg rules so that they partition the inner register into REGMODE_NATURAL_SIZE bytes rather than UNITS_PER_WORD bytes. * emit-rtl.c (validate_subreg): Divide subregs into blocks based on REGMODE_NATURAL_SIZE of the inner mode. (gen_lowpart_common): Split the SCALAR_FLOAT_MODE_P and !SCALAR_FLOAT_MODE_P cases. Use REGMODE_NATURAL_SIZE for the latter. * expmed.c (lowpart_bit_field_p): Divide the value up into chunks of REGMODE_NATURAL_SIZE rather than UNITS_PER_WORD. * expr.c (store_constructor): Use REGMODE_NATURAL_SIZE to test whether something is likely to occupy more than one register. Co-Authored-By: Alan Hayward <alan.hayward@arm.com> Co-Authored-By: David Sherwood <david.sherwood@arm.com> From-SVN: r254583 |
||
---|---|---|
config | ||
contrib | ||
fixincludes | ||
gcc | ||
gnattools | ||
gotools | ||
include | ||
INSTALL | ||
intl | ||
libada | ||
libatomic | ||
libbacktrace | ||
libcc1 | ||
libcilkrts | ||
libcpp | ||
libdecnumber | ||
libffi | ||
libgcc | ||
libgfortran | ||
libgo | ||
libgomp | ||
libhsail-rt | ||
libiberty | ||
libitm | ||
libmpx | ||
libobjc | ||
liboffloadmic | ||
libquadmath | ||
libsanitizer | ||
libssp | ||
libstdc++-v3 | ||
libvtv | ||
lto-plugin | ||
maintainer-scripts | ||
zlib | ||
.dir-locals.el | ||
.gitattributes | ||
.gitignore | ||
ABOUT-NLS | ||
ChangeLog | ||
ChangeLog.jit | ||
ChangeLog.tree-ssa | ||
compile | ||
config-ml.in | ||
config.guess | ||
config.rpath | ||
config.sub | ||
configure | ||
configure.ac | ||
COPYING | ||
COPYING3 | ||
COPYING3.LIB | ||
COPYING.LIB | ||
COPYING.RUNTIME | ||
depcomp | ||
install-sh | ||
libtool-ldflags | ||
libtool.m4 | ||
lt~obsolete.m4 | ||
ltgcc.m4 | ||
ltmain.sh | ||
ltoptions.m4 | ||
ltsugar.m4 | ||
ltversion.m4 | ||
MAINTAINERS | ||
Makefile.def | ||
Makefile.in | ||
Makefile.tpl | ||
missing | ||
mkdep | ||
mkinstalldirs | ||
move-if-change | ||
README | ||
symlink-tree | ||
ylwrap |
This directory contains the GNU Compiler Collection (GCC). The GNU Compiler Collection is free software. See the files whose names start with COPYING for copying permission. The manuals, and some of the runtime libraries, are under different terms; see the individual source files for details. The directory INSTALL contains copies of the installation information as HTML and plain text. The source of this information is gcc/doc/install.texi. The installation information includes details of what is included in the GCC sources and what files GCC installs. See the file gcc/doc/gcc.texi (together with other files that it includes) for usage and porting information. An online readable version of the manual is in the files gcc/doc/gcc.info*. See http://gcc.gnu.org/bugs/ for how to report bugs usefully. Copyright years on GCC source files may be listed using range notation, e.g., 1987-2012, indicating that every year in the range, inclusive, is a copyrightable year that could otherwise be listed individually.