Go to file
Jakub Jelinek 4adfcea0a1 middle-end: Prefer no RMW in __builtin_clear_padding implementation where possible
Currently the __builtin_clear_padding expansion code emits no code for
full words that don't have any padding bits, and most of the time if
the only padding bytes are from the start of the word it attempts to merge
them with previous padding store (via {}) or if the only padding bytes are
from the end of the word, it attempts to merge it with following padding
bytes.  For everything else it was using a RMW, except when it found
an aligned char/short/int covering all the padding bytes and all those
padding bytes were all ones in that store.

The following patch changes it, such that we only use RMW if the padding has
any bytes which have some padding and some non-padding bits (i.e. bitfields
are involved), often it is the same amount of instructions in the end and
avoids being thread-unsafe unless necessary (and avoids having to wait for
the reads to make it into the CPU).  So, if there are no bitfields,
the function will just store some zero bytes, shorts, ints, long longs etc.
where needed.

2020-11-24  Jakub Jelinek  <jakub@redhat.com>

	* gimple-fold.c (clear_padding_flush): If a word contains only 0
	or 0xff bytes of padding other than all set, all clear, all set
	followed by all clear or all clear followed by all set, don't emit
	a RMW operation on the whole word or parts of it, but instead
	clear the individual bytes of padding.  For paddings of one byte
	size, don't use char[1] and {}, but instead just char and 0.
2020-11-24 10:44:32 +01:00
config
contrib Daily bump. 2020-11-17 00:16:27 +00:00
fixincludes Daily bump. 2020-11-19 00:16:30 +00:00
gcc middle-end: Prefer no RMW in __builtin_clear_padding implementation where possible 2020-11-24 10:44:32 +01:00
gnattools
gotools
include
INSTALL
intl
libada
libatomic
libbacktrace
libcc1 Daily bump. 2020-11-12 00:16:39 +00:00
libcpp Daily bump. 2020-11-20 00:16:40 +00:00
libdecnumber
libffi
libgcc Daily bump. 2020-11-21 00:16:29 +00:00
libgfortran Daily bump. 2020-11-22 00:16:24 +00:00
libgo log/syslog: correct asm name for C function 2020-11-23 08:14:20 -08:00
libgomp [testsuite] Avoid Tcl 8.5-specific behavior 2020-11-24 10:29:35 +01:00
libhsail-rt
libiberty Daily bump. 2020-11-14 00:16:38 +00:00
libitm
libobjc
liboffloadmic
libphobos Daily bump. 2020-11-19 00:16:30 +00:00
libquadmath
libsanitizer Daily bump. 2020-11-22 00:16:24 +00:00
libssp
libstdc++-v3 Daily bump. 2020-11-24 00:16:44 +00:00
libvtv
lto-plugin
maintainer-scripts
zlib
.dir-locals.el
.gitattributes
.gitignore Add .cache to git ignore. 2020-11-16 12:52:43 +01:00
ABOUT-NLS
ar-lib
ChangeLog Daily bump. 2020-11-24 00:16:44 +00:00
ChangeLog.jit
ChangeLog.tree-ssa
compile
config-ml.in
config.guess config.sub, config.guess : Import upstream 2020-11-07. 2020-11-23 19:30:01 +00:00
config.rpath
config.sub config.sub, config.guess : Import upstream 2020-11-07. 2020-11-23 19:30:01 +00:00
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 MAINTAINERS: add myself for write after approval 2020-11-13 11:01:12 +08:00
Makefile.def
Makefile.in
Makefile.tpl
missing
mkdep
mkinstalldirs
move-if-change
multilib.am
README
symlink-tree
test-driver
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.