summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-7.3/0044-libgcc-Add-knob-to-use-ldbl-128-on-ppc.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-7.3/0044-libgcc-Add-knob-to-use-ldbl-128-on-ppc.patch')
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.3/0044-libgcc-Add-knob-to-use-ldbl-128-on-ppc.patch513
1 files changed, 0 insertions, 513 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-7.3/0044-libgcc-Add-knob-to-use-ldbl-128-on-ppc.patch b/meta/recipes-devtools/gcc/gcc-7.3/0044-libgcc-Add-knob-to-use-ldbl-128-on-ppc.patch
deleted file mode 100644
index f4dd891717..0000000000
--- a/meta/recipes-devtools/gcc/gcc-7.3/0044-libgcc-Add-knob-to-use-ldbl-128-on-ppc.patch
+++ /dev/null
@@ -1,513 +0,0 @@
1From 847aec764540636ec654fd7a012e271afa8d4e0f Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 29 Apr 2016 20:03:28 +0000
4Subject: [PATCH 44/47] libgcc: Add knob to use ldbl-128 on ppc
5
6musl does not support ldbl 128 so we can not assume
7that linux as a whole supports ldbl-128 bits, instead
8act upon configure option passed to gcc and assume no
9on musl and yes otherwise if no option is passed since
10default behaviour is to assume ldbl128 it does not
11change the defaults
12
13Signed-off-by: Khem Raj <raj.khem@gmail.com>
14Upstream-Status: Pending
15---
16 libgcc/Makefile.in | 1 +
17 libgcc/config/rs6000/t-linux | 5 ++++-
18 libgcc/configure | 18 ++++++++++++++++++
19 libgcc/configure.ac | 12 ++++++++++++
20 4 files changed, 35 insertions(+), 1 deletion(-)
21 mode change 100644 => 100755 libgcc/configure
22
23diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in
24index a1a392de88d..2fe6889a342 100644
25--- a/libgcc/Makefile.in
26+++ b/libgcc/Makefile.in
27@@ -48,6 +48,7 @@ unwind_header = @unwind_header@
28 md_unwind_header = @md_unwind_header@
29 sfp_machine_header = @sfp_machine_header@
30 thread_header = @thread_header@
31+with_ldbl128 = @with_ldbl128@
32
33 host_noncanonical = @host_noncanonical@
34 real_host_noncanonical = @real_host_noncanonical@
35diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
36index 4f6d4c4a4d2..c50dd94a2da 100644
37--- a/libgcc/config/rs6000/t-linux
38+++ b/libgcc/config/rs6000/t-linux
39@@ -1,3 +1,9 @@
40 SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
41
42-HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
43+ifeq ($(with_ldbl128),yes)
44+HOST_LIBGCC2_CFLAGS += -mlong-double-128
45+else
46+# We do not want to build ibm-ldouble.c.
47+LIB2ADD := $(filter-out %ibm-ldouble.c, $(LIB2ADD))
48+endif
49+HOST_LIBGCC2_CFLAGS += -mno-minimal-toc
50diff --git a/libgcc/config/rs6000/fixtfdi.c b/libgcc/config/rs6000/fixtfdi.c
51new file mode 100644
52index 0000000..9b979d0
53--- /dev/null
54+++ b/libgcc/config/rs6000/fixtfdi.c
55@@ -0,0 +1,42 @@
56+/* Software floating-point emulation.
57+ Convert a to 64bit signed integer
58+ Copyright (C) 1997-2016 Free Software Foundation, Inc.
59+ This file is part of the GNU C Library.
60+ Contributed by Richard Henderson (rth@cygnus.com) and
61+ Jakub Jelinek (jj@ultra.linux.cz).
62+
63+ The GNU C Library is free software; you can redistribute it and/or
64+ modify it under the terms of the GNU Lesser General Public
65+ License as published by the Free Software Foundation; either
66+ version 2.1 of the License, or (at your option) any later version.
67+
68+ In addition to the permissions in the GNU Lesser General Public
69+ License, the Free Software Foundation gives you unlimited
70+ permission to link the compiled version of this file into
71+ combinations with other programs, and to distribute those
72+ combinations without any restriction coming from the use of this
73+ file. (The Lesser General Public License restrictions do apply in
74+ other respects; for example, they cover modification of the file,
75+ and distribution when not linked into a combine executable.)
76+
77+ The GNU C Library is distributed in the hope that it will be useful,
78+ but WITHOUT ANY WARRANTY; without even the implied warranty of
79+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
80+ Lesser General Public License for more details.
81+
82+ You should have received a copy of the GNU Lesser General Public
83+ License along with the GNU C Library; if not, see
84+ <http://www.gnu.org/licenses/>. */
85+
86+#ifdef _ARCH_PPC64
87+#include "soft-fp.h"
88+#include "quad-float128.h"
89+
90+DItype
91+__fixtfdi (TFtype a)
92+{
93+ if (a < 0)
94+ return - __fixunstfdi (-a);
95+ return __fixunstfdi (a);
96+}
97+#endif
98diff --git a/libgcc/config/rs6000/fixunstfdi.c b/libgcc/config/rs6000/fixunstfdi.c
99new file mode 100644
100index 0000000..65e9590
101--- /dev/null
102+++ b/libgcc/config/rs6000/fixunstfdi.c
103@@ -0,0 +1,58 @@
104+/* Software floating-point emulation.
105+ Convert a to 64bit unsigned integer
106+ Copyright (C) 1997-2016 Free Software Foundation, Inc.
107+ This file is part of the GNU C Library.
108+ Contributed by Richard Henderson (rth@cygnus.com) and
109+ Jakub Jelinek (jj@ultra.linux.cz).
110+
111+ The GNU C Library is free software; you can redistribute it and/or
112+ modify it under the terms of the GNU Lesser General Public
113+ License as published by the Free Software Foundation; either
114+ version 2.1 of the License, or (at your option) any later version.
115+
116+ In addition to the permissions in the GNU Lesser General Public
117+ License, the Free Software Foundation gives you unlimited
118+ permission to link the compiled version of this file into
119+ combinations with other programs, and to distribute those
120+ combinations without any restriction coming from the use of this
121+ file. (The Lesser General Public License restrictions do apply in
122+ other respects; for example, they cover modification of the file,
123+ and distribution when not linked into a combine executable.)
124+
125+ The GNU C Library is distributed in the hope that it will be useful,
126+ but WITHOUT ANY WARRANTY; without even the implied warranty of
127+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
128+ Lesser General Public License for more details.
129+
130+ You should have received a copy of the GNU Lesser General Public
131+ License along with the GNU C Library; if not, see
132+ <http://www.gnu.org/licenses/>. */
133+
134+#ifdef _ARCH_PPC64
135+#include "soft-fp.h"
136+#include "quad-float128.h"
137+
138+DItype
139+__fixunstfdi (TFtype a)
140+{
141+ if (a < 0)
142+ return 0;
143+
144+ /* Compute high word of result, as a flonum. */
145+ const TFtype b = (a / (((UDItype) 1) << (sizeof (SItype) * 8)));
146+ /* Convert that to fixed (but not to DItype!),
147+ and shift it into the high word. */
148+ UDItype v = (USItype) b;
149+ v <<= (sizeof (SItype) * 8);
150+ /* Remove high part from the TFtype, leaving the low part as flonum. */
151+ a -= (TFtype) v;
152+ /* Convert that to fixed (but not to DItype!) and add it in.
153+ Sometimes A comes out negative. This is significant, since
154+ A has more bits than a long int does. */
155+ if (a < 0)
156+ v -= (USItype) (-a);
157+ else
158+ v += (USItype) a;
159+ return v;
160+}
161+#endif
162diff --git a/libgcc/config/rs6000/floatditf.c b/libgcc/config/rs6000/floatditf.c
163new file mode 100644
164index 0000000..20ad4c6
165--- /dev/null
166+++ b/libgcc/config/rs6000/floatditf.c
167@@ -0,0 +1,47 @@
168+/* Software floating-point emulation.
169+ Convert a 64bit signed integer to IEEE quad
170+ Copyright (C) 1997-2016 Free Software Foundation, Inc.
171+ This file is part of the GNU C Library.
172+ Contributed by Richard Henderson (rth@cygnus.com) and
173+ Jakub Jelinek (jj@ultra.linux.cz).
174+
175+ The GNU C Library is free software; you can redistribute it and/or
176+ modify it under the terms of the GNU Lesser General Public
177+ License as published by the Free Software Foundation; either
178+ version 2.1 of the License, or (at your option) any later version.
179+
180+ In addition to the permissions in the GNU Lesser General Public
181+ License, the Free Software Foundation gives you unlimited
182+ permission to link the compiled version of this file into
183+ combinations with other programs, and to distribute those
184+ combinations without any restriction coming from the use of this
185+ file. (The Lesser General Public License restrictions do apply in
186+ other respects; for example, they cover modification of the file,
187+ and distribution when not linked into a combine executable.)
188+
189+ The GNU C Library is distributed in the hope that it will be useful,
190+ but WITHOUT ANY WARRANTY; without even the implied warranty of
191+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
192+ Lesser General Public License for more details.
193+
194+ You should have received a copy of the GNU Lesser General Public
195+ License along with the GNU C Library; if not, see
196+ <http://www.gnu.org/licenses/>. */
197+
198+#ifdef _ARCH_PPC64
199+#include "soft-fp.h"
200+#include "double.h"
201+#include "quad-float128.h"
202+
203+TFtype
204+__floatditf (DItype u)
205+{
206+ DFtype dh, dl;
207+
208+ dh = (SItype) (u >> (sizeof (SItype) * 8));
209+ dh *= 2.0 * (((UDItype) 1) << ((sizeof (SItype) * 8) - 1));
210+ dl = (USItype) (u & ((((UDItype) 1) << (sizeof (SItype) * 8)) - 1));
211+
212+ return (TFtype) dh + (TFtype) dl;
213+}
214+#endif
215diff --git a/libgcc/config/rs6000/floatunditf.c b/libgcc/config/rs6000/floatunditf.c
216new file mode 100644
217index 0000000..23dbde2
218--- /dev/null
219+++ b/libgcc/config/rs6000/floatunditf.c
220@@ -0,0 +1,47 @@
221+/* Software floating-point emulation.
222+ Convert a 64bit unsigned integer to IEEE quad
223+ Copyright (C) 1997-2016 Free Software Foundation, Inc.
224+ This file is part of the GNU C Library.
225+ Contributed by Richard Henderson (rth@cygnus.com) and
226+ Jakub Jelinek (jj@ultra.linux.cz).
227+
228+ The GNU C Library is free software; you can redistribute it and/or
229+ modify it under the terms of the GNU Lesser General Public
230+ License as published by the Free Software Foundation; either
231+ version 2.1 of the License, or (at your option) any later version.
232+
233+ In addition to the permissions in the GNU Lesser General Public
234+ License, the Free Software Foundation gives you unlimited
235+ permission to link the compiled version of this file into
236+ combinations with other programs, and to distribute those
237+ combinations without any restriction coming from the use of this
238+ file. (The Lesser General Public License restrictions do apply in
239+ other respects; for example, they cover modification of the file,
240+ and distribution when not linked into a combine executable.)
241+
242+ The GNU C Library is distributed in the hope that it will be useful,
243+ but WITHOUT ANY WARRANTY; without even the implied warranty of
244+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
245+ Lesser General Public License for more details.
246+
247+ You should have received a copy of the GNU Lesser General Public
248+ License along with the GNU C Library; if not, see
249+ <http://www.gnu.org/licenses/>. */
250+
251+#ifdef _ARCH_PPC64
252+#include "soft-fp.h"
253+#include "double.h"
254+#include "quad-float128.h"
255+
256+TFtype
257+__floatunditf (UDItype u)
258+{
259+ DFtype dh, dl;
260+
261+ dh = (USItype) (u >> (sizeof (SItype) * 8));
262+ dh *= 2.0 * (((UDItype) 1) << ((sizeof (SItype) * 8) - 1));
263+ dl = (USItype) (u & ((((UDItype) 1) << (sizeof (SItype) * 8)) - 1));
264+
265+ return (TFtype) dh + (TFtype) dl;
266+}
267+#endif
268diff --git a/libgcc/config/rs6000/ppc64-fp.c b/libgcc/config/rs6000/ppc64-fp.c
269index 5e1cbdd..70ad3c9 100644
270--- a/libgcc/config/rs6000/ppc64-fp.c
271+++ b/libgcc/config/rs6000/ppc64-fp.c
272@@ -25,33 +25,20 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
273 <http://www.gnu.org/licenses/>. */
274
275 #if defined(__powerpc64__) || defined (__64BIT__) || defined(__ppc64__)
276-#define TMODES
277 #include "fp-bit.h"
278
279-extern DItype __fixtfdi (TFtype);
280 extern DItype __fixdfdi (DFtype);
281 extern DItype __fixsfdi (SFtype);
282 extern USItype __fixunsdfsi (DFtype);
283 extern USItype __fixunssfsi (SFtype);
284-extern TFtype __floatditf (DItype);
285-extern TFtype __floatunditf (UDItype);
286 extern DFtype __floatdidf (DItype);
287 extern DFtype __floatundidf (UDItype);
288 extern SFtype __floatdisf (DItype);
289 extern SFtype __floatundisf (UDItype);
290-extern DItype __fixunstfdi (TFtype);
291
292 static DItype local_fixunssfdi (SFtype);
293 static DItype local_fixunsdfdi (DFtype);
294
295-DItype
296-__fixtfdi (TFtype a)
297-{
298- if (a < 0)
299- return - __fixunstfdi (-a);
300- return __fixunstfdi (a);
301-}
302-
303 DItype
304 __fixdfdi (DFtype a)
305 {
306@@ -86,30 +73,6 @@ __fixunssfsi (SFtype a)
307 return (SItype) a;
308 }
309
310-TFtype
311-__floatditf (DItype u)
312-{
313- DFtype dh, dl;
314-
315- dh = (SItype) (u >> (sizeof (SItype) * 8));
316- dh *= 2.0 * (((UDItype) 1) << ((sizeof (SItype) * 8) - 1));
317- dl = (USItype) (u & ((((UDItype) 1) << (sizeof (SItype) * 8)) - 1));
318-
319- return (TFtype) dh + (TFtype) dl;
320-}
321-
322-TFtype
323-__floatunditf (UDItype u)
324-{
325- DFtype dh, dl;
326-
327- dh = (USItype) (u >> (sizeof (SItype) * 8));
328- dh *= 2.0 * (((UDItype) 1) << ((sizeof (SItype) * 8) - 1));
329- dl = (USItype) (u & ((((UDItype) 1) << (sizeof (SItype) * 8)) - 1));
330-
331- return (TFtype) dh + (TFtype) dl;
332-}
333-
334 DFtype
335 __floatdidf (DItype u)
336 {
337@@ -183,30 +146,6 @@ __floatundisf (UDItype u)
338 return (SFtype) f;
339 }
340
341-DItype
342-__fixunstfdi (TFtype a)
343-{
344- if (a < 0)
345- return 0;
346-
347- /* Compute high word of result, as a flonum. */
348- const TFtype b = (a / (((UDItype) 1) << (sizeof (SItype) * 8)));
349- /* Convert that to fixed (but not to DItype!),
350- and shift it into the high word. */
351- UDItype v = (USItype) b;
352- v <<= (sizeof (SItype) * 8);
353- /* Remove high part from the TFtype, leaving the low part as flonum. */
354- a -= (TFtype) v;
355- /* Convert that to fixed (but not to DItype!) and add it in.
356- Sometimes A comes out negative. This is significant, since
357- A has more bits than a long int does. */
358- if (a < 0)
359- v -= (USItype) (-a);
360- else
361- v += (USItype) a;
362- return v;
363-}
364-
365 /* This version is needed to prevent recursion; fixunsdfdi in libgcc
366 calls fixdfdi, which in turn calls calls fixunsdfdi. */
367
368diff --git a/libgcc/config/rs6000/quad-float128.h b/libgcc/config/rs6000/quad-float128.h
369index 7d69c87..a0c2664 100644
370--- a/libgcc/config/rs6000/quad-float128.h
371+++ b/libgcc/config/rs6000/quad-float128.h
372@@ -99,6 +99,11 @@ extern TItype_ppc __fixkfti (TFtype);
373 extern UTItype_ppc __fixunskfti (TFtype);
374 extern TFtype __floattikf (TItype_ppc);
375 extern TFtype __floatuntikf (UTItype_ppc);
376+
377+extern DItype_ppc __fixtfdi (TFtype);
378+extern DItype_ppc __fixunstfdi (TFtype);
379+extern TFtype __floatditf (DItype_ppc);
380+extern TFtype __floatunditf (UDItype_ppc);
381 #endif
382
383 /* Functions using the ISA 3.0 hardware support. If the code is compiled with
384diff --git a/libgcc/config/rs6000/t-float128 b/libgcc/config/rs6000/t-float128
385index 2c52ca6..3a241aa 100644
386--- a/libgcc/config/rs6000/t-float128
387+++ b/libgcc/config/rs6000/t-float128
388@@ -24,6 +24,7 @@ fp128_softfp_obj = $(fp128_softfp_static_obj) $(fp128_softfp_shared_obj)
389
390 # New functions for software emulation
391 fp128_ppc_funcs = floattikf floatuntikf fixkfti fixunskfti \
392+ floatditf floatunditf fixtfdi fixunstfdi \
393 extendkftf2-sw trunctfkf2-sw \
394 sfp-exceptions _mulkc3 _divkc3
395
396@@ -58,7 +59,7 @@ fp128_includes = $(srcdir)/soft-fp/double.h \
397 $(srcdir)/soft-fp/soft-fp.h
398
399 # Build the emulator without ISA 3.0 hardware support.
400-FP128_CFLAGS_SW = -Wno-type-limits -mvsx -mfloat128 \
401+FP128_CFLAGS_SW = -Wno-type-limits -mvsx -mfloat128 -mfloat128-type \
402 -mno-float128-hardware \
403 -I$(srcdir)/soft-fp \
404 -I$(srcdir)/config/rs6000 \
405diff --git a/libgcc/config/rs6000/t-float128-hw b/libgcc/config/rs6000/t-float128-hw
406index 161062f..0476874 100644
407--- a/libgcc/config/rs6000/t-float128-hw
408+++ b/libgcc/config/rs6000/t-float128-hw
409@@ -21,7 +21,7 @@ fp128_ifunc_obj = $(fp128_ifunc_static_obj) $(fp128_ifunc_shared_obj)
410 fp128_sed_hw = -hw
411
412 # Build the hardware support functions with appropriate hardware support
413-FP128_CFLAGS_HW = -Wno-type-limits -mvsx -mfloat128 \
414+FP128_CFLAGS_HW = -Wno-type-limits -mvsx -mfloat128 -mfloat128-type \
415 -mpower8-vector -mpower9-vector \
416 -mfloat128-hardware \
417 -I$(srcdir)/soft-fp \
418diff --git a/libgcc/configure b/libgcc/configure
419old mode 100644
420new mode 100755
421index 45c459788c3..e2d19b144b8
422--- a/libgcc/configure
423+++ b/libgcc/configure
424@@ -618,6 +618,7 @@ build_vendor
425 build_cpu
426 build
427 with_aix_soname
428+with_ldbl128
429 enable_vtable_verify
430 enable_shared
431 libgcc_topdir
432@@ -667,6 +668,7 @@ with_cross_host
433 with_ld
434 enable_shared
435 enable_vtable_verify
436+with_long_double_128
437 with_aix_soname
438 enable_version_specific_runtime_libs
439 with_slibdir
440@@ -1324,6 +1326,7 @@ Optional Packages:
441 --with-target-subdir=SUBDIR Configuring in a subdirectory for target
442 --with-cross-host=HOST Configuring with a cross compiler
443 --with-ld arrange to use the specified ld (full pathname)
444+ --with-long-double-128 use 128-bit long double by default
445 --with-aix-soname=aix|svr4|both
446 shared library versioning (aka "SONAME") variant to
447 provide on AIX
448@@ -2208,6 +2211,21 @@ fi
449
450
451
452+# Check whether --with-long-double-128 was given.
453+if test "${with_long_double_128+set}" = set; then :
454+ withval=$with_long_double_128; with_ldbl128="$with_long_double_128"
455+else
456+ case "${host}" in
457+ power*-*-musl*)
458+ with_ldbl128="no";;
459+ *) with_ldbl128="yes";;
460+ esac
461+
462+fi
463+
464+
465+
466+
467 # Check whether --with-aix-soname was given.
468 if test "${with_aix_soname+set}" = set; then :
469 withval=$with_aix_soname; case "${host}:${enable_shared}" in
470@@ -4999,7 +4999,7 @@ case ${host} in
471 # for hardware support.
472 powerpc*-*-linux*)
473 saved_CFLAGS="$CFLAGS"
474- CFLAGS="$CFLAGS -mabi=altivec -mvsx -mfloat128"
475+ CFLAGS="$CFLAGS -mabi=altivec -mvsx -mfloat128 -mfloat128-type"
476 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PowerPC ISA 2.06 to build __float128 libraries" >&5
477 $as_echo_n "checking for PowerPC ISA 2.06 to build __float128 libraries... " >&6; }
478 if test "${libgcc_cv_powerpc_float128+set}" = set; then :
479diff --git a/libgcc/configure.ac b/libgcc/configure.ac
480index af151473709..dada52416da 100644
481--- a/libgcc/configure.ac
482+++ b/libgcc/configure.ac
483@@ -77,6 +77,18 @@ AC_ARG_ENABLE(vtable-verify,
484 [enable_vtable_verify=no])
485 AC_SUBST(enable_vtable_verify)
486
487+AC_ARG_WITH(long-double-128,
488+[AS_HELP_STRING([--with-long-double-128],
489+ [use 128-bit long double by default])],
490+ with_ldbl128="$with_long_double_128",
491+[case "${host}" in
492+ power*-*-musl*)
493+ with_ldbl128="no";;
494+ *) with_ldbl128="yes";;
495+ esac
496+])
497+AC_SUBST(with_ldbl128)
498+
499 AC_ARG_WITH(aix-soname,
500 [AS_HELP_STRING([--with-aix-soname=aix|svr4|both],
501 [shared library versioning (aka "SONAME") variant to provide on AIX])],
502@@ -394,7 +394,7 @@ case ${host} in
503 # for hardware support.
504 powerpc*-*-linux*)
505 saved_CFLAGS="$CFLAGS"
506- CFLAGS="$CFLAGS -mabi=altivec -mvsx -mfloat128"
507+ CFLAGS="$CFLAGS -mabi=altivec -mvsx -mfloat128 -mfloat128-type"
508 AC_CACHE_CHECK([for PowerPC ISA 2.06 to build __float128 libraries],
509 [libgcc_cv_powerpc_float128],
510 [AC_COMPILE_IFELSE(
511--
5122.12.2
513