Find a file
Ilya Leoshkevich e627cda568 IBM Z: Store long doubles in vector registers when possible
On z14+, there are instructions for working with 128-bit floats (long
doubles) in vector registers.  It's beneficial to use them instead of
instructions that operate on floating point register pairs, because it
allows to store 4 times more data in registers at a time, relieving
register pressure.  The raw performance of the new instructions is
almost the same as that of the new ones.

Implement by storing TFmode values in vector registers on z14+.  Since
not all operations are available with the new instructions, keep the
old ones available using the new FPRX2 mode, and convert between it and
TFmode when necessary (this is called "forwarder" expanders below).
Change the existing TFmode expanders to call either new- or old-style
ones depending on whether we are on z14+ or older machines
("dispatcher" expanders).

gcc/ChangeLog:

2020-11-03  Ilya Leoshkevich  <iii@linux.ibm.com>

	* config/s390/s390-modes.def (FPRX2): New mode.
	* config/s390/s390-protos.h (s390_fma_allowed_p): New function.
	* config/s390/s390.c (s390_fma_allowed_p): Likewise.
	(s390_build_signbit_mask): Support 128-bit masks.
	(print_operand): Support printing the second word of a TFmode
	operand as vector register.
	(constant_modes): Add FPRX2mode.
	(s390_class_max_nregs): Return 1 for TFmode on z14+.
	(s390_is_fpr128): New function.
	(s390_is_vr128): Likewise.
	(s390_can_change_mode_class): Use s390_is_fpr128 and
	s390_is_vr128 in order to determine whether mode refers to a FPR
	pair or to a VR.
	(s390_emit_compare): Force TFmode operands into registers on
	z14+.
	* config/s390/s390.h (HAVE_TF): New macro.
	(EXPAND_MOVTF): New macro.
	(EXPAND_TF): Likewise.
	* config/s390/s390.md (PFPO_OP_TYPE_FPRX2): PFPO_OP_TYPE_TF
	alias.
	(ALL): Add FPRX2.
	(FP_ALL): Add FPRX2 for z14+, restrict TFmode to z13-.
	(FP): Likewise.
	(FP_ANYTF): New mode iterator.
	(BFP): Add FPRX2 for z14+, restrict TFmode to z13-.
	(TD_TF): Likewise.
	(xde): Add FPRX2.
	(nBFP): Likewise.
	(nDFP): Likewise.
	(DSF): Likewise.
	(DFDI): Likewise.
	(SFSI): Likewise.
	(DF): Likewise.
	(SF): Likewise.
	(fT0): Likewise.
	(bt): Likewise.
	(_d): Likewise.
	(HALF_TMODE): Likewise.
	(tf_fpr): New mode_attr.
	(type): New mode_attr.
	(*cmp<mode>_ccz_0): Use type instead of mode with fsimp.
	(*cmp<mode>_ccs_0_fastmath): Likewise.
	(*cmptf_ccs): New pattern for wfcxb.
	(*cmptf_ccsfps): New pattern for wfkxb.
	(mov<mode>): Rename to mov<mode><tf_fpr>.
	(signbit<mode>2): Rename to signbit<mode>2<tf_fpr>.
	(isinf<mode>2): Renamed to isinf<mode>2<tf_fpr>.
	(*TDC_insn_<mode>): Use type instead of mode with fsimp.
	(fixuns_trunc<FP:mode><GPR:mode>2): Rename to
	fixuns_trunc<FP:mode><GPR:mode>2<FP:tf_fpr>.
	(fix_trunctf<mode>2): Rename to fix_trunctf<mode>2_fpr.
	(floatdi<mode>2): Rename to floatdi<mode>2<tf_fpr>, use type
	instead of mode with itof.
	(floatsi<mode>2): Rename to floatsi<mode>2<tf_fpr>, use type
	instead of mode with itof.
	(*floatuns<GPR:mode><FP:mode>2): Use type instead of mode for
	itof.
	(floatuns<GPR:mode><FP:mode>2): Rename to
	floatuns<GPR:mode><FP:mode>2<tf_fpr>.
	(trunctf<mode>2): Rename to trunctf<mode>2_fpr, use type instead
	of mode with fsimp.
	(extend<DSF:mode><BFP:mode>2): Rename to
	extend<DSF:mode><BFP:mode>2<BFP:tf_fpr>.
	(<FPINT:fpint_name><BFP:mode>2): Rename to
	<FPINT:fpint_name><BFP:mode>2<BFP:tf_fpr>, use type instead of
	mode with fsimp.
	(rint<BFP:mode>2): Rename to rint<BFP:mode>2<BFP:tf_fpr>, use
	type instead of mode with fsimp.
	(<FPINT:fpint_name><DFP:mode>2): Use type instead of mode for
	fsimp.
	(rint<DFP:mode>2): Likewise.
	(trunc<BFP:mode><DFP_ALL:mode>2): Rename to
	trunc<BFP:mode><DFP_ALL:mode>2<BFP:tf_fpr>.
	(trunc<DFP_ALL:mode><BFP:mode>2): Rename to
	trunc<DFP_ALL:mode><BFP:mode>2<BFP:tf_fpr>.
	(extend<BFP:mode><DFP_ALL:mode>2): Rename to
	extend<BFP:mode><DFP_ALL:mode>2<BFP:tf_fpr>.
	(extend<DFP_ALL:mode><BFP:mode>2): Rename to
	extend<DFP_ALL:mode><BFP:mode>2<BFP:tf_fpr>.
	(add<mode>3): Rename to add<mode>3<tf_fpr>, use type instead of
	mode with fsimp.
	(*add<mode>3_cc): Use type instead of mode with fsimp.
	(*add<mode>3_cconly): Likewise.
	(sub<mode>3): Rename to sub<mode>3<tf_fpr>, use type instead of
	mode with fsimp.
	(*sub<mode>3_cc): Use type instead of mode with fsimp.
	(*sub<mode>3_cconly): Likewise.
	(mul<mode>3): Rename to mul<mode>3<tf_fpr>, use type instead of
	mode with fsimp.
	(fma<mode>4): Restrict using s390_fma_allowed_p.
	(fms<mode>4): Restrict using s390_fma_allowed_p.
	(div<mode>3): Rename to div<mode>3<tf_fpr>, use type instead of
	mode with fdiv.
	(neg<mode>2): Rename to neg<mode>2<tf_fpr>.
	(*neg<mode>2_cc): Use type instead of mode with fsimp.
	(*neg<mode>2_cconly): Likewise.
	(*neg<mode>2_nocc): Likewise.
	(*neg<mode>2): Likeiwse.
	(abs<mode>2): Rename to abs<mode>2<tf_fpr>, use type instead of
	mode with fdiv.
	(*abs<mode>2_cc): Use type instead of mode with fsimp.
	(*abs<mode>2_cconly): Likewise.
	(*abs<mode>2_nocc): Likewise.
	(*abs<mode>2): Likewise.
	(*negabs<mode>2_cc): Likewise.
	(*negabs<mode>2_cconly): Likewise.
	(*negabs<mode>2_nocc): Likewise.
	(*negabs<mode>2): Likewise.
	(sqrt<mode>2): Rename to sqrt<mode>2<tf_fpr>, use type instead
	of mode with fsqrt.
	(cbranch<mode>4): Use FP_ANYTF instead of FP.
	(copysign<mode>3): Rename to copysign<mode>3<tf_fpr>, use type
	instead of mode with fsimp.
	* config/s390/s390.opt (flag_vx_long_double_fma): New
	undocumented option.
	* config/s390/vector.md (V_HW): Add TF for z14+.
	(V_HW2): Likewise.
	(VFT): Likewise.
	(VF_HW): Likewise.
	(V_128): Likewise.
	(tf_vr): New mode_attr.
	(tointvec): Add TF.
	(mov<mode>): Rename to mov<mode><tf_vr>.
	(movetf): New dispatcher.
	(*vec_tf_to_v1tf): Rename to *vec_tf_to_v1tf_fpr, restrict to
	z13-.
	(*vec_tf_to_v1tf_vr): New pattern for z14+.
	(*fprx2_to_tf): Likewise.
	(*mov_tf_to_fprx2_0): Likewise.
	(*mov_tf_to_fprx2_1): Likewise.
	(add<mode>3): Rename to add<mode>3<tf_vr>.
	(addtf3): New dispatcher.
	(sub<mode>3): Rename to sub<mode>3<tf_vr>.
	(subtf3): New dispatcher.
	(mul<mode>3): Rename to mul<mode>3<tf_vr>.
	(multf3): New dispatcher.
	(div<mode>3): Rename to div<mode>3<tf_vr>.
	(divtf3): New dispatcher.
	(sqrt<mode>2): Rename to sqrt<mode>2<tf_vr>.
	(sqrttf2): New dispatcher.
	(fma<mode>4): Restrict using s390_fma_allowed_p.
	(fms<mode>4): Likewise.
	(neg_fma<mode>4): Likewise.
	(neg_fms<mode>4): Likewise.
	(neg<mode>2): Rename to neg<mode>2<tf_vr>.
	(negtf2): New dispatcher.
	(abs<mode>2): Rename to abs<mode>2<tf_vr>.
	(abstf2): New dispatcher.
	(float<mode>tf2_vr): New forwarder.
	(float<mode>tf2): New dispatcher.
	(floatuns<mode>tf2_vr): New forwarder.
	(floatuns<mode>tf2): New dispatcher.
	(fix_trunctf<mode>2_vr): New forwarder.
	(fix_trunctf<mode>2): New dispatcher.
	(fixuns_trunctf<mode>2_vr): New forwarder.
	(fixuns_trunctf<mode>2): New dispatcher.
	(<FPINT:fpint_name><VF_HW:mode>2<VF_HW:tf_vr>): New pattern.
	(<FPINT:fpint_name>tf2): New forwarder.
	(rint<mode>2<tf_vr>): New pattern.
	(rinttf2): New forwarder.
	(*trunctfdf2_vr): New pattern.
	(trunctfdf2_vr): New forwarder.
	(trunctfdf2): New dispatcher.
	(trunctfsf2_vr): New forwarder.
	(trunctfsf2): New dispatcher.
	(extenddftf2_vr): New pattern.
	(extenddftf2): New dispatcher.
	(extendsftf2_vr): New forwarder.
	(extendsftf2): New dispatcher.
	(signbittf2_vr): New forwarder.
	(signbittf2): New dispatchers.
	(isinftf2_vr): New forwarder.
	(isinftf2): New dispatcher.
	* config/s390/vx-builtins.md (*vftci<mode>_cconly): Use VF_HW
	instead of VECF_HW, add missing constraint, add vw support.
	(vftci<mode>_intcconly): Use VF_HW instead of VECF_HW.
	(*vftci<mode>): Rename to vftci<mode>, use VF_HW instead of
	VECF_HW, and vw support.
	(vftci<mode>_intcc): Use VF_HW instead of VECF_HW.
2020-11-10 12:13:37 +01:00
config Fixup config/ChangeLog. 2020-09-10 10:17:51 +02:00
contrib Daily bump. 2020-11-08 00:16:31 +00:00
fixincludes Daily bump. 2020-10-04 00:16:21 +00:00
gcc IBM Z: Store long doubles in vector registers when possible 2020-11-10 12:13:37 +01:00
gnattools
gotools Daily bump. 2020-10-30 00:16:29 +00:00
include Daily bump. 2020-09-25 00:16:27 +00:00
INSTALL
intl intl: Unbreak intl build with bison 3 when no regeneration is needed [PR92008] 2020-04-16 11:55:00 +02:00
libada Add `--with-toolexeclibdir=' configuration option 2020-01-24 11:24:25 +00:00
libatomic Daily bump. 2020-10-12 00:16:25 +00:00
libbacktrace Daily bump. 2020-10-21 00:16:36 +00:00
libcc1 Daily bump. 2020-11-07 00:16:39 +00:00
libcpp Daily bump. 2020-11-08 00:16:31 +00:00
libdecnumber Daily bump. 2020-07-31 00:16:26 +00:00
libffi Daily bump. 2020-09-25 00:16:27 +00:00
libgcc Daily bump. 2020-11-04 00:16:41 +00:00
libgfortran Daily bump. 2020-11-02 20:53:00 +00:00
libgo libgo: handle linking to NetBSD's versioned symbols 2020-10-28 18:20:50 -07:00
libgomp Daily bump. 2020-11-06 00:16:34 +00:00
libhsail-rt Add `--with-toolexeclibdir=' configuration option 2020-01-24 11:24:25 +00:00
libiberty Daily bump. 2020-11-10 00:16:24 +00:00
libitm Daily bump. 2020-10-02 00:16:27 +00:00
libobjc Daily bump. 2020-10-12 00:16:25 +00:00
liboffloadmic Add missing ChangeLog entries. 2020-05-05 16:10:13 +02:00
libphobos Daily bump. 2020-10-28 00:16:38 +00:00
libquadmath Daily bump. 2020-05-30 00:16:27 +00:00
libsanitizer ASAN: Support detect_invalid_pointer_pairs=1 with detect_stack_use_after_return=1 2020-10-21 09:27:08 +02:00
libssp Daily bump. 2020-05-30 00:16:27 +00:00
libstdc++-v3 Daily bump. 2020-11-10 00:16:24 +00:00
libvtv Daily bump. 2020-05-30 00:16:27 +00:00
lto-plugin Daily bump. 2020-09-11 00:16:28 +00:00
maintainer-scripts Daily bump. 2020-05-30 00:16:27 +00:00
zlib Daily bump. 2020-05-30 00:16:27 +00:00
.dir-locals.el
.gitattributes Add *.md diff=md. 2020-01-15 14:29:53 +01:00
.gitignore Add .clang-tidy to git ignored. 2020-06-12 16:03:02 +02:00
ABOUT-NLS
ar-lib
ChangeLog Daily bump. 2020-11-10 00:16:24 +00:00
ChangeLog.jit
ChangeLog.tree-ssa
compile
config-ml.in config-ml.in: Suppress output from multi-do recipes 2020-11-09 14:28:37 +00:00
config.guess
config.rpath
config.sub
configure configure: Fix in-tree building of GMP on BSD [PR97302] 2020-10-06 11:49:34 +02:00
configure.ac configure: Fix in-tree building of GMP on BSD [PR97302] 2020-10-06 11:49:34 +02:00
COPYING
COPYING.LIB
COPYING.RUNTIME
COPYING3
COPYING3.LIB
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 Do not use HAVE_DOS_BASED_FILE_SYSTEM for Cygwin. 2020-04-17 09:22:51 +02:00
ltoptions.m4
ltsugar.m4
ltversion.m4
lt~obsolete.m4
MAINTAINERS MAINTAINERS: Add myself for write after approval 2020-11-09 16:03:16 -05:00
Makefile.def Merge top-level configury changes from gdb 2020-04-09 06:52:55 -06:00
Makefile.in Merge top-level configury changes from gdb 2020-04-09 06:52:55 -06:00
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.