Go to file
Richard Sandiford 482b2b43e5 Add a compatible_vector_types_p target hook
One problem with adding an N-bit vector extension to an existing
architecture is to decide how N-bit vectors should be passed to
functions and returned from functions.  Allowing all N-bit vector
types to be passed in registers breaks backwards compatibility,
since N-bit vectors could be used (and emulated) before the vector
extension was added.  But always passing N-bit vectors on the
stack would be inefficient for things like vector libm functions.

For SVE we took the compromise position of predefining new SVE vector
types that are distinct from all existing vector types, including
GNU-style vectors.  The new types are passed and returned in an
efficient way while existing vector types are passed and returned
in the traditional way.  In the right circumstances, the two types
are inter-convertible.

The SVE types are created using:

      vectype = build_distinct_type_copy (vectype);
      SET_TYPE_STRUCTURAL_EQUALITY (vectype);
      TYPE_ARTIFICIAL (vectype) = 1;

The C frontend maintains this distinction, using VIEW_CONVERT_EXPR
to convert from one type to the other.  However, the distinction can
be lost during gimple, which treats two vector types with the same
mode, number of elements, and element type as equivalent.  And for
most targets that's the right thing to do.

This patch therefore adds a hook that lets the target choose
whether such vector types are indeed equivalent.

Note that the new tests fail for -mabi=ilp32 in the same way as other
ACLE-based tests.  I'm still planning to fix that as a follow-on.

2020-01-09  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	* target.def (compatible_vector_types_p): New target hook.
	* hooks.h (hook_bool_const_tree_const_tree_true): Declare.
	* hooks.c (hook_bool_const_tree_const_tree_true): New function.
	* doc/tm.texi.in (TARGET_COMPATIBLE_VECTOR_TYPES_P): New hook.
	* doc/tm.texi: Regenerate.
	* gimple-expr.c: Include target.h.
	(useless_type_conversion_p): Use targetm.compatible_vector_types_p.
	* config/aarch64/aarch64.c (aarch64_compatible_vector_types_p): New
	function.
	(TARGET_COMPATIBLE_VECTOR_TYPES_P): Define.
	* config/aarch64/aarch64-sve-builtins.cc (gimple_folder::convert_pred):
	Use the original predicate if it already has a suitable type.

gcc/testsuite/
	* gcc.target/aarch64/sve/pcs/gnu_vectors_1.c: New test.
	* gcc.target/aarch64/sve/pcs/gnu_vectors_2.c: Likewise.

From-SVN: r280047
2020-01-09 15:08:26 +00:00
INSTALL
config [ARM/FDPIC v6 02/24] [ARM] FDPIC: Handle arm*-*-uclinuxfdpiceabi in configure scripts 2019-09-10 09:37:00 +02:00
contrib update-copyright.py: Add Mentor Graphics Corporation and Yoshinori Sato as external authors. 2020-01-01 12:26:53 +01:00
fixincludes re PR libgomp/93066 (libgomp/target.c:525:46: error: expected expression before ')' token) 2019-12-30 20:33:17 +00:00
gcc Add a compatible_vector_types_p target hook 2020-01-09 15:08:26 +00:00
gnattools PR81878: fix --disable-bootstrap --enable-languages=ada 2018-11-20 00:07:47 +00:00
gotools libgo: update to Go 1.13beta1 release 2019-09-06 18:12:46 +00:00
include Update copyright years. 2020-01-01 12:51:42 +01:00
intl iconv.m4 (AM_ICONV_LINK): Don't overwrite CPPFLAGS. 2018-11-07 15:41:21 -07:00
libada Update copyright years. 2020-01-01 12:51:42 +01:00
libatomic Update copyright years. 2020-01-01 12:51:42 +01:00
libbacktrace Update copyright years. 2020-01-01 12:51:42 +01:00
libcc1 init.c (build_new): Add location_t parameter and use it throughout. 2020-01-07 17:58:18 +00:00
libcpp Update copyright years. 2020-01-01 12:51:42 +01:00
libdecnumber Update copyright years. 2020-01-01 12:51:42 +01:00
libffi Regenerate `configure' scripts for `uclinuxfdpiceabi' libtool.m4 update 2019-09-27 21:24:42 +00:00
libgcc Implement 64-bit double functions. 2020-01-08 09:31:07 +00:00
libgfortran PR 90374 d0.d, e0.d, es0.d, en0.d, g0.d and ew.d edit descriptors. 2020-01-02 00:57:31 +00:00
libgo compiler, runtime: stop using __go_runtime_error 2020-01-07 23:13:24 +00:00
libgomp libgomp.texi: Fix typos, use https (actual change) 2020-01-08 16:00:39 +01:00
libhsail-rt Update copyright years. 2020-01-01 12:51:42 +01:00
libiberty Update copyright years. 2020-01-01 12:51:42 +01:00
libitm Update copyright years. 2020-01-01 12:51:42 +01:00
libobjc Fix windows libobjc build (PR libobjc/93099) 2020-01-01 14:16:35 -08:00
liboffloadmic Add OpenACC 2.6 `acc_get_property' support 2019-12-22 19:54:09 +00:00
libphobos Update copyright years. 2020-01-01 12:51:42 +01:00
libquadmath Update copyright years. 2020-01-01 12:51:42 +01:00
libsanitizer re PR sanitizer/92154 (new glibc breaks arm bootstrap due to libsanitizer) 2019-11-26 10:08:31 +01:00
libssp Update copyright years. 2020-01-01 12:51:42 +01:00
libstdc++-v3 libstdc++: Define memory resource key functions non-inline (PR93208) 2020-01-09 13:18:20 +00:00
libvtv Update copyright years. 2020-01-01 12:51:42 +01:00
lto-plugin Update copyright years. 2020-01-01 12:51:42 +01:00
maintainer-scripts Switch gcc ftp URL's to https 2019-11-20 22:24:48 +02:00
zlib Regenerate `configure' scripts for `uclinuxfdpiceabi' libtool.m4 update 2019-09-27 21:24:42 +00:00
.dir-locals.el
.gitattributes * .gitattributes: Also check ChangeLog whitespace. 2019-10-21 23:12:04 -04:00
.gitignore Add .clangd and compile_commands.json to .gitignore. 2019-08-28 19:33:28 +00:00
ABOUT-NLS
COPYING
COPYING.LIB
COPYING.RUNTIME
COPYING3
COPYING3.LIB
ChangeLog Add myself to MAINTAINERS 2020-01-02 16:09:57 +00:00
ChangeLog.jit
ChangeLog.tree-ssa
MAINTAINERS Add myself to MAINTAINERS 2020-01-02 16:09:57 +00:00
Makefile.def Sync top-level change from gdb 2019-06-15 21:32:03 +00:00
Makefile.in Makefile.tpl (HOST_EXPORTS): Add CXX_FOR_BUILD. 2019-08-23 15:37:22 -06:00
Makefile.tpl Makefile.tpl (HOST_EXPORTS): Add CXX_FOR_BUILD. 2019-08-23 15:37:22 -06:00
README
ar-lib Update GCC to autoconf 2.69, automake 1.15.1 (PR bootstrap/82856). 2018-10-31 17:03:16 +00:00
compile
config-ml.in MSP430: Add -fno-exceptions multilib 2019-12-11 19:19:50 +00:00
config.guess Update config.sub and config.guess. 2019-09-09 11:14:32 +02:00
config.rpath
config.sub Update config.sub and config.guess. 2019-09-09 11:14:32 +02:00
configure configure.ac: Factor out common cases for compare_exclusions. 2019-12-11 20:59:35 +00:00
configure.ac configure.ac: Factor out common cases for compare_exclusions. 2019-12-11 20:59:35 +00:00
depcomp
install-sh
libtool-ldflags
libtool.m4 [ARM/FDPIC v6 02/24] [ARM] FDPIC: Handle arm*-*-uclinuxfdpiceabi in configure scripts 2019-09-10 09:37:00 +02:00
ltgcc.m4
ltmain.sh libtool.m4: Sort output of 'find' to enable deterministic builds. 2018-07-05 13:13:45 -06:00
ltoptions.m4
ltsugar.m4
ltversion.m4
lt~obsolete.m4
missing
mkdep
mkinstalldirs
move-if-change Update move-if-change from gnulib 2014-11-16 16:12:44 +00:00
multilib.am Update GCC to autoconf 2.69, automake 1.15.1 (PR bootstrap/82856). 2018-10-31 17:03:16 +00:00
symlink-tree
test-driver Update GCC to autoconf 2.69, automake 1.15.1 (PR bootstrap/82856). 2018-10-31 17:03:16 +00:00
ylwrap

README

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.