diff options
author | James Greenhalgh <james.greenhalgh@arm.com> | 2016-09-09 09:40:22 +0000 |
---|---|---|
committer | James Greenhalgh <jgreenhalgh@gcc.gnu.org> | 2016-09-09 09:40:22 +0000 |
commit | 0abcd6cc738c5afd131c232ddb6809e6ff8e8def (patch) | |
tree | fa60721ba37968ad4ebd70293c6f08a547f86ddf /libgcc/libgcc2.c | |
parent | f67a81a5e266a110963062cf3d76c98d8bcb0974 (diff) | |
download | gcc-0abcd6cc738c5afd131c232ddb6809e6ff8e8def.zip gcc-0abcd6cc738c5afd131c232ddb6809e6ff8e8def.tar.gz gcc-0abcd6cc738c5afd131c232ddb6809e6ff8e8def.tar.bz2 |
[Patch libgcc] Enable HCmode multiply and divide (mulhc3/divhc3)
This patch arranges for half-precision complex multiply and divide
routines to be built if __LIBGCC_HAS_HF_MODE__. This will be true
if the target supports the _Float16 type.
libgcc/
PR target/63250
* Makefile.in (lib2funcs): Build _mulhc3 and _divhc3.
* libgcc2.h (LIBGCC_HAS_HF_MODE): Conditionally define.
(HFtype): Likewise.
(HCtype): Likewise.
(__divhc3): Likewise.
(__mulhc3): Likewise.
* libgcc2.c: Support _mulhc3 and _divhc3.
From-SVN: r240043
Diffstat (limited to 'libgcc/libgcc2.c')
-rw-r--r-- | libgcc/libgcc2.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/libgcc/libgcc2.c b/libgcc/libgcc2.c index 4f0e199..9fb150b 100644 --- a/libgcc/libgcc2.c +++ b/libgcc/libgcc2.c @@ -1852,7 +1852,8 @@ NAME (TYPE x, int m) #endif -#if ((defined(L_mulsc3) || defined(L_divsc3)) && LIBGCC2_HAS_SF_MODE) \ +#if((defined(L_mulhc3) || defined(L_divhc3)) && LIBGCC2_HAS_HF_MODE) \ + || ((defined(L_mulsc3) || defined(L_divsc3)) && LIBGCC2_HAS_SF_MODE) \ || ((defined(L_muldc3) || defined(L_divdc3)) && LIBGCC2_HAS_DF_MODE) \ || ((defined(L_mulxc3) || defined(L_divxc3)) && LIBGCC2_HAS_XF_MODE) \ || ((defined(L_multc3) || defined(L_divtc3)) && LIBGCC2_HAS_TF_MODE) @@ -1861,7 +1862,13 @@ NAME (TYPE x, int m) #undef double #undef long -#if defined(L_mulsc3) || defined(L_divsc3) +#if defined(L_mulhc3) || defined(L_divhc3) +# define MTYPE HFtype +# define CTYPE HCtype +# define MODE hc +# define CEXT __LIBGCC_HF_FUNC_EXT__ +# define NOTRUNC (!__LIBGCC_HF_EXCESS_PRECISION__) +#elif defined(L_mulsc3) || defined(L_divsc3) # define MTYPE SFtype # define CTYPE SCtype # define MODE sc @@ -1922,7 +1929,7 @@ extern void *compile_type_assert[sizeof(INFINITY) == sizeof(MTYPE) ? 1 : -1]; # define TRUNC(x) __asm__ ("" : "=m"(x) : "m"(x)) #endif -#if defined(L_mulsc3) || defined(L_muldc3) \ +#if defined(L_mulhc3) || defined(L_mulsc3) || defined(L_muldc3) \ || defined(L_mulxc3) || defined(L_multc3) CTYPE @@ -1992,7 +1999,7 @@ CONCAT3(__mul,MODE,3) (MTYPE a, MTYPE b, MTYPE c, MTYPE d) } #endif /* complex multiply */ -#if defined(L_divsc3) || defined(L_divdc3) \ +#if defined(L_divhc3) || defined(L_divsc3) || defined(L_divdc3) \ || defined(L_divxc3) || defined(L_divtc3) CTYPE |