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