gcc/libgcc/config/i386
Jakub Jelinek 246127ab23 libgcc, i386: Add __fix{,uns}bfti and __float{,un}tibf [PR107703]
While DI <-> BF conversions can be handled (and are) through
DI <-> XF <-> BF and for narrower integral modes even sometimes
through DF or SF, because XFmode has 64-bit mantissa and so all
the DImode values are exactly representable in XFmode.
That is not the case for TImode, and while e.g. the HF -> TI
conversions are IMHO useless in libgcc, because HFmode has
-65504.0f16, 65504.0f16 range, all the integers will be already
representable in SImode (or even HImode for unsigned) and so
I think HF -> DI -> TI conversions are faster and valid,
BFmode has roughly the same range as SFmode and so we absolutely need
the TI -> BF conversions to avoid double rounding.

As for BF -> TI conversions, they can be either also implemented
in libgcc, or they can be implemented (as done in this commit)
as BF -> SF -> TI conversions with the same code generation used
elsewhere, just doing the 16-bit left shift of the bits - I think
we don't need to handle sNaNs during the BF -> SF part because
SF -> TI (which is already a libcall too) will handle that too.

The BF -> SF -> TI path avoids wasting
    32: 0000000000015e10   321 FUNC    GLOBAL DEFAULT   13 __fixbfti@@GCC_13.0.0
    89: 0000000000015f60   299 FUNC    GLOBAL DEFAULT   13 __fixunsbfti@@GCC_13.0.0

2023-03-10  Jakub Jelinek  <jakub@redhat.com>

	PR target/107703
	* optabs.cc (expand_fix): For conversions from BFmode to integral,
	use shifts to convert it to SFmode first and then convert SFmode
	to integral.

	* soft-fp/floattibf.c: New file.
	* soft-fp/floatuntibf.c: New file.
	* config/i386/libgcc-glibc.ver: Export __float{,un}tibf @ GCC_13.0.0.
	* config/i386/64/t-softfp (softfp_extras): Add floattibf and
	floatuntibf.
	(CFLAGS-floattibf.c, CFLAGS-floatunstibf.c): Add -msse2.
2023-03-10 20:39:54 +01:00
..
32 Update copyright years. 2023-01-16 11:52:17 +01:00
64 libgcc, i386: Add __fix{,uns}bfti and __float{,un}tibf [PR107703] 2023-03-10 20:39:54 +01:00
_divhc3.c Explicitly add -msse2 to compile HF related libgcc source file. 2021-09-06 15:13:14 +08:00
_mulhc3.c Explicitly add -msse2 to compile HF related libgcc source file. 2021-09-06 15:13:14 +08:00
avx_resms64.S
avx_resms64f.S
avx_resms64fx.S
avx_resms64x.S
avx_savms64.S
avx_savms64f.S
cpuinfo.c Update copyright years. 2023-01-16 11:52:17 +01:00
crtfastmath.c Update copyright years. 2023-01-16 11:52:17 +01:00
crti.S Update copyright years. 2023-01-16 11:52:17 +01:00
crtn.S Update copyright years. 2023-01-16 11:52:17 +01:00
crtprec.c Update copyright years. 2023-01-16 11:52:17 +01:00
cygming-crtbegin.c Update copyright years. 2023-01-16 11:52:17 +01:00
cygming-crtend.c Update copyright years. 2023-01-16 11:52:17 +01:00
cygwin.S Update copyright years. 2023-01-16 11:52:17 +01:00
darwin-lib.h Update copyright years. 2023-01-16 11:52:17 +01:00
dragonfly-unwind.h Update copyright years. 2023-01-16 11:52:17 +01:00
elf-lib.h Update copyright years. 2023-01-16 11:52:17 +01:00
enable-execute-stack-mingw32.c Update copyright years. 2023-01-16 11:52:17 +01:00
freebsd-unwind.h Update copyright years. 2023-01-16 11:52:17 +01:00
gnu-unwind.h Add support for x86_64-*-gnu-* targets to build x86_64 gnumach/hurd 2023-01-30 16:34:48 +01:00
gthr-mcf.h Update copyright years. 2023-01-16 11:52:17 +01:00
gthr-win32-cond.c Update copyright years. 2023-01-16 11:52:17 +01:00
gthr-win32-thread.c Update copyright years. 2023-01-16 11:52:17 +01:00
gthr-win32.c Update copyright years. 2023-01-16 11:52:17 +01:00
gthr-win32.h Update copyright years. 2023-01-16 11:52:17 +01:00
i386-asm.h Update copyright years. 2023-01-16 11:52:17 +01:00
libgcc-bsd.ver Update copyright years. 2023-01-16 11:52:17 +01:00
libgcc-cygming.ver Update copyright years. 2023-01-16 11:52:17 +01:00
libgcc-darwin.ver libgcc, X86, Darwin: Export cpu_model and indicator. 2021-09-28 20:02:48 +01:00
libgcc-glibc.ver libgcc, i386: Add __fix{,uns}bfti and __float{,un}tibf [PR107703] 2023-03-10 20:39:54 +01:00
libgcc-mingw.ver Update copyright years. 2023-01-16 11:52:17 +01:00
libgcc-sol2.ver Update copyright years. 2023-01-16 11:52:17 +01:00
linux-unwind.h Update copyright years. 2023-01-16 11:52:17 +01:00
morestack.S Update copyright years. 2023-01-16 11:52:17 +01:00
resms64.h Update copyright years. 2023-01-16 11:52:17 +01:00
resms64f.h Update copyright years. 2023-01-16 11:52:17 +01:00
resms64fx.h Update copyright years. 2023-01-16 11:52:17 +01:00
resms64x.h Update copyright years. 2023-01-16 11:52:17 +01:00
savms64.h Update copyright years. 2023-01-16 11:52:17 +01:00
savms64f.h Update copyright years. 2023-01-16 11:52:17 +01:00
sfp-exceptions.c Update copyright years. 2023-01-16 11:52:17 +01:00
sfp-machine.h middle-end, c++, i386, libgcc: std::bfloat16_t and __bf16 arithmetic support 2022-10-14 09:37:01 +02:00
shadow-stack-unwind.h Update copyright years. 2023-01-16 11:52:17 +01:00
sol2-c1.S Update copyright years. 2023-01-16 11:52:17 +01:00
sol2-unwind.h Update copyright years. 2023-01-16 11:52:17 +01:00
sse_resms64.S
sse_resms64f.S
sse_resms64fx.S
sse_resms64x.S
sse_savms64.S
sse_savms64f.S
t-chkstk
t-cpuinfo
t-cpuinfo-static
t-crtpc
t-crtstuff
t-cygming
t-cygwin
t-darwin libgcc, Darwin: Build a libgcc_s.1 for backwards compatibility. 2021-12-08 19:53:28 +00:00
t-dlldir
t-dlldir-x
t-dragonfly
t-dw2-eh
t-freebsd
t-gthr-win32 Reimplement GNU threads library on native Windows 2022-12-23 23:58:06 +00:00
t-linux
t-mingw-mcfgthread gcc: Add 'mcf' thread model support from mcfgthread 2022-10-19 13:52:37 +00:00
t-mingw-pthread
t-mingw32
t-msabi
t-nto
t-seh-eh
t-sjlj-eh
t-slibgcc-cygming gcc: Add 'mcf' thread model support from mcfgthread 2022-10-19 13:52:37 +00:00
t-slibgcc-mingw Reimplement GNU threads library on native Windows 2022-12-23 23:58:06 +00:00
t-softfp middle-end, c++, i386, libgcc: std::bfloat16_t and __bf16 arithmetic support 2022-10-14 09:37:01 +02:00
t-sol2
t-stack-i386
value-unwind.h Update copyright years. 2023-01-16 11:52:17 +01:00
w32-unwind.h Update copyright years. 2023-01-16 11:52:17 +01:00