aboutsummaryrefslogtreecommitdiff
path: root/libgcc
diff options
context:
space:
mode:
Diffstat (limited to 'libgcc')
-rw-r--r--libgcc/ChangeLog110
-rw-r--r--libgcc/config.host7
-rw-r--r--libgcc/config/aarch64/libgcc-softfp.ver6
-rw-r--r--libgcc/config/avr/libf7/ChangeLog15
-rw-r--r--libgcc/config/avr/libf7/f7-renames.h1
-rw-r--r--libgcc/config/avr/libf7/f7-wraps.h14
-rwxr-xr-xlibgcc/config/avr/libf7/f7renames.sh12
-rw-r--r--libgcc/config/avr/libf7/libf7-common.mk6
-rw-r--r--libgcc/config/avr/libf7/libf7.c19
-rw-r--r--libgcc/config/avr/libf7/libf7.h1
-rw-r--r--libgcc/config/gthr-vxworks-thread.c1
-rw-r--r--libgcc/config/i386/libgcc-darwin.ver6
-rw-r--r--libgcc/config/i386/libgcc-glibc.ver6
-rw-r--r--libgcc/config/i386/libgcc-sol2.ver6
-rw-r--r--libgcc/config/libbid/ChangeLog6
-rwxr-xr-x[-rw-r--r--]libgcc/config/libbid/bid128_string.c121
-rw-r--r--libgcc/config/mingw/t-mingw-mcfgthread (renamed from libgcc/config/i386/t-mingw-mcfgthread)0
-rw-r--r--libgcc/config/sh/lib1funcs.S3
-rw-r--r--libgcc/config/t-softfp2
-rw-r--r--libgcc/libgcc-std.ver.in6
-rw-r--r--libgcc/libgcc2.c10
-rw-r--r--libgcc/soft-fp/bitint.h16
-rw-r--r--libgcc/soft-fp/bitintpow10.c340
-rw-r--r--libgcc/soft-fp/fixddbitint.c33
-rw-r--r--libgcc/soft-fp/fixddti.c6
-rw-r--r--libgcc/soft-fp/fixsdbitint.c27
-rw-r--r--libgcc/soft-fp/fixsdti.c4
-rw-r--r--libgcc/soft-fp/fixtdbitint.c54
-rw-r--r--libgcc/soft-fp/fixtdti.c6
-rw-r--r--libgcc/soft-fp/fixunsddti.c6
-rw-r--r--libgcc/soft-fp/fixunssdti.c6
-rw-r--r--libgcc/soft-fp/fixunstdti.c6
-rw-r--r--libgcc/soft-fp/floatbitintdd.c45
-rw-r--r--libgcc/soft-fp/floatbitintsd.c39
-rw-r--r--libgcc/soft-fp/floatbitinttd.c68
-rw-r--r--libgcc/soft-fp/floattidd.c6
-rw-r--r--libgcc/soft-fp/floattisd.c6
-rw-r--r--libgcc/soft-fp/floattitd.c6
-rw-r--r--libgcc/soft-fp/floatuntidd.c6
-rw-r--r--libgcc/soft-fp/floatuntisd.c6
-rw-r--r--libgcc/soft-fp/floatuntitd.c6
41 files changed, 936 insertions, 114 deletions
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog
index dc90779..7e907b6 100644
--- a/libgcc/ChangeLog
+++ b/libgcc/ChangeLog
@@ -1,3 +1,113 @@
+2025-05-27 Jakub Jelinek <jakub@redhat.com>
+
+ * config/t-softfp (softfp_bid_list): Don't guard with
+ $(enable_decimal_float) == bid.
+ * soft-fp/bitint.h (__bid_pow10bitint): For
+ !defined(ENABLE_DECIMAL_BID_FORMAT) redefine to __dpd_pow10bitint.
+ (__dpd_d2bbitint, __dpd_b2dbitint): Declare.
+ * soft-fp/bitintpow10.c (__dpd_d2bbitint, __dpd_b2dbitint): New
+ variables.
+ * soft-fp/fixsdbitint.c (__bid_fixsdbitint): For
+ !defined(ENABLE_DECIMAL_BID_FORMAT) redefine to __dpd_fixsdbitint.
+ Add DPD support. Fix big-endian support.
+ * soft-fp/fixddbitint.c (__bid_fixddbitint): For
+ !defined(ENABLE_DECIMAL_BID_FORMAT) redefine to __dpd_fixddbitint.
+ Add DPD support. Fix big-endian support.
+ * soft-fp/fixtdbitint.c (__bid_fixtdbitint): For
+ !defined(ENABLE_DECIMAL_BID_FORMAT) redefine to __dpd_fixtdbitint.
+ Add DPD support. Fix big-endian support.
+ * soft-fp/fixsdti.c (__bid_fixsdbitint): For
+ !defined(ENABLE_DECIMAL_BID_FORMAT) redefine to __dpd_fixsdbitint.
+ (__bid_fixsdti): For !defined(ENABLE_DECIMAL_BID_FORMAT) redefine to
+ __dpd_fixsdti.
+ * soft-fp/fixddti.c (__bid_fixddbitint): For
+ !defined(ENABLE_DECIMAL_BID_FORMAT) redefine to __dpd_fixddbitint.
+ (__bid_fixddti): For !defined(ENABLE_DECIMAL_BID_FORMAT) redefine to
+ __dpd_fixddti.
+ * soft-fp/fixtdti.c (__bid_fixtdbitint): For
+ !defined(ENABLE_DECIMAL_BID_FORMAT) redefine to __dpd_fixtdbitint.
+ (__bid_fixtdti): For !defined(ENABLE_DECIMAL_BID_FORMAT) redefine to
+ __dpd_fixtdti.
+ * soft-fp/fixunssdti.c (__bid_fixsdbitint): For
+ !defined(ENABLE_DECIMAL_BID_FORMAT) redefine to __dpd_fixsdbitint.
+ (__bid_fixunssdti): For !defined(ENABLE_DECIMAL_BID_FORMAT) redefine
+ to __dpd_fixunssdti.
+ * soft-fp/fixunsddti.c (__bid_fixddbitint): For
+ !defined(ENABLE_DECIMAL_BID_FORMAT) redefine to __dpd_fixddbitint.
+ (__bid_fixunsddti): For !defined(ENABLE_DECIMAL_BID_FORMAT) redefine
+ to __dpd_fixunsddti.
+ * soft-fp/fixunstdti.c (__bid_fixtdbitint): For
+ !defined(ENABLE_DECIMAL_BID_FORMAT) redefine to __dpd_fixtdbitint.
+ (__bid_fixunstdti): For !defined(ENABLE_DECIMAL_BID_FORMAT) redefine
+ to __dpd_fixunstdti.
+ * soft-fp/floatbitintsd.c (__bid_floatbitintsd): For
+ !defined(ENABLE_DECIMAL_BID_FORMAT) redefine to __dpd_floatbitintsd.
+ Add DPD support. Avoid calling __builtin_clzll with 0 argument. Fix
+ big-endian support.
+ * soft-fp/floatbitintdd.c (__bid_floatbitintdd): For
+ !defined(ENABLE_DECIMAL_BID_FORMAT) redefine to __dpd_floatbitintdd.
+ Add DPD support. Avoid calling __builtin_clzll with 0 argument. Fix
+ big-endian support.
+ * soft-fp/floatbitinttd.c (__bid_floatbitinttd): For
+ !defined(ENABLE_DECIMAL_BID_FORMAT) redefine to __dpd_floatbitinttd.
+ Add DPD support. Avoid calling __builtin_clzll with 0 argument. Fix
+ big-endian support.
+ * soft-fp/floattisd.c (__bid_floatbitintsd): For
+ !defined(ENABLE_DECIMAL_BID_FORMAT) redefine to __dpd_floatbitintsd.
+ (__bid_floattisd): For !defined(ENABLE_DECIMAL_BID_FORMAT) redefine to
+ __dpd_floattisd.
+ * soft-fp/floattidd.c (__bid_floatbitintdd): For
+ !defined(ENABLE_DECIMAL_BID_FORMAT) redefine to __dpd_floatbitintdd.
+ (__bid_floattidd): For !defined(ENABLE_DECIMAL_BID_FORMAT) redefine to
+ __dpd_floattidd.
+ * soft-fp/floattitd.c (__bid_floatbitinttd): For
+ !defined(ENABLE_DECIMAL_BID_FORMAT) redefine to __dpd_floatbitinttd.
+ (__bid_floattitd): For !defined(ENABLE_DECIMAL_BID_FORMAT) redefine to
+ __dpd_floattitd.
+ * soft-fp/floatuntisd.c (__bid_floatbitintsd): For
+ !defined(ENABLE_DECIMAL_BID_FORMAT) redefine to __dpd_floatbitintsd.
+ (__bid_floatuntisd): For !defined(ENABLE_DECIMAL_BID_FORMAT) redefine
+ to __dpd_floatuntisd.
+ * soft-fp/floatuntidd.c (__bid_floatbitintdd): For
+ !defined(ENABLE_DECIMAL_BID_FORMAT) redefine to __dpd_floatbitintdd.
+ (__bid_floatuntidd): For !defined(ENABLE_DECIMAL_BID_FORMAT) redefine
+ to __dpd_floatuntidd.
+ * soft-fp/floatuntitd.c (__bid_floatbitinttd): For
+ !defined(ENABLE_DECIMAL_BID_FORMAT) redefine to __dpd_floatbitinttd.
+ (__bid_floatuntitd): For !defined(ENABLE_DECIMAL_BID_FORMAT) redefine
+ to __dpd_floatuntitd.
+
+2025-05-25 LIU Hao <lh_mouse@126.com>
+
+ * config.host: Enable mcf thread model for aarch64-*-mingw*.
+ * config/i386/t-mingw-mcfgthread: Move to...
+ * config/mingw/t-mingw-mcfgthread: ...here.
+
+2025-05-21 Alexandre Oliva <oliva@adacore.com>
+
+ * config/gthr-vxworks-thread.c: Include string.h for memset.
+
+2025-05-20 Jakub Jelinek <jakub@redhat.com>
+
+ * libgcc-std.ver.in (GCC_14.0.0): Remove bitint related exports
+ from here.
+ * config/i386/libgcc-glibc.ver (GCC_14.0.0): Add them here.
+ * config/i386/libgcc-darwin.ver (GCC_14.0.0): Likewise.
+ * config/i386/libgcc-sol2.ver (GCC_14.0.0): Likewise.
+ * config/aarch64/libgcc-softfp.ver (GCC_14.0.0): Likewise.
+
+2025-05-20 Jakub Jelinek <jakub@redhat.com>
+
+ * libgcc2.c (bitint_reduce_prec): For big endian
+ __LIBGCC_BITINT_ORDER__ use ++*p and --*p instead of
+ ++p and --p.
+ * soft-fp/bitint.h (bitint_reduce_prec): Likewise.
+
+2025-05-17 Oleg Endo <olegendo@gcc.gnu.org>
+
+ * config/sh/lib1funcs.S (ashiftrt_r4_32): Increase alignment.
+ (movemem): Force alignment of the mova intruction.
+
2025-04-25 Thomas Schwinge <tschwinge@baylibre.com>
PR target/119853
diff --git a/libgcc/config.host b/libgcc/config.host
index 6a88ee5..d36f0e3 100644
--- a/libgcc/config.host
+++ b/libgcc/config.host
@@ -472,6 +472,9 @@ aarch64-*-mingw*)
posix)
tmake_thr_file="mingw/t-mingw-pthread"
;;
+ mcf)
+ tmake_thr_file="mingw/t-mingw-mcfgthread"
+ ;;
esac
tmake_file="${tmake_file} ${cpu_type}/t-no-eh ${tmake_thr_file}"
tmake_file="${tmake_file} t-dfprules"
@@ -904,7 +907,7 @@ i[34567]86-*-mingw*)
tmake_thr_file="mingw/t-mingw-pthread"
;;
mcf)
- tmake_thr_file="i386/t-mingw-mcfgthread"
+ tmake_thr_file="mingw/t-mingw-mcfgthread"
;;
esac
# This has to match the logic for DWARF2_UNWIND_INFO in gcc/config/i386/cygming.h
@@ -931,7 +934,7 @@ x86_64-*-mingw*)
tmake_thr_file="mingw/t-mingw-pthread"
;;
mcf)
- tmake_thr_file="i386/t-mingw-mcfgthread"
+ tmake_thr_file="mingw/t-mingw-mcfgthread"
;;
esac
# This has to match the logic for DWARF2_UNWIND_INFO in gcc/config/i386/cygming.h
diff --git a/libgcc/config/aarch64/libgcc-softfp.ver b/libgcc/config/aarch64/libgcc-softfp.ver
index c24466c..3b392c9 100644
--- a/libgcc/config/aarch64/libgcc-softfp.ver
+++ b/libgcc/config/aarch64/libgcc-softfp.ver
@@ -42,8 +42,14 @@ GCC_13.0.0 {
%inherit GCC_14.0.0 GCC_13.0.0
GCC_14.0.0 {
+ __mulbitint3
+ __divmodbitint4
+ __fixsfbitint
+ __fixdfbitint
__fixtfbitint
__floatbitintbf
__floatbitinthf
+ __floatbitintsf
+ __floatbitintdf
__floatbitinttf
}
diff --git a/libgcc/config/avr/libf7/ChangeLog b/libgcc/config/avr/libf7/ChangeLog
index 1b8a29a..b19b5b4 100644
--- a/libgcc/config/avr/libf7/ChangeLog
+++ b/libgcc/config/avr/libf7/ChangeLog
@@ -1,3 +1,18 @@
+2025-05-27 Georg-Johann Lay <avr@gjlay.de>
+
+ PR target/120442
+ * libf7-common.mk (LIBF_C_PARTS, m_ddd): Add fdim.
+ * libf7.h (f7_fdim): New proto.
+ * libf7.c (f7_fdim): New function.
+ * f7renames.sh (f7_fdim): Add rename.
+ * f7-wraps.h: Rebuild
+ * f7-renames.h: Rebuild
+
+2025-05-27 Georg-Johann Lay <avr@gjlay.de>
+
+ PR target/120441
+ * libf7.c (f7_exp): Limit aa->expo to 10 (not to 9).
+
2025-03-22 Georg-Johann Lay <avr@gjlay.de>
* t-libf7 (libgcc-objects): Only add objects when building
diff --git a/libgcc/config/avr/libf7/f7-renames.h b/libgcc/config/avr/libf7/f7-renames.h
index bbe571a..bce2dd3 100644
--- a/libgcc/config/avr/libf7/f7-renames.h
+++ b/libgcc/config/avr/libf7/f7-renames.h
@@ -97,6 +97,7 @@
#define f7_acos __f7_acos
#define f7_atan __f7_atan
#define f7_atan2 __f7_atan2
+#define f7_fdim __f7_fdim
#define f7_mul_noround __f7_mul_noround
#define f7_sqrt16_round __f7_sqrt16_round
#define f7_sqrt16_floor __f7_sqrt16_floor
diff --git a/libgcc/config/avr/libf7/f7-wraps.h b/libgcc/config/avr/libf7/f7-wraps.h
index a455b7d..409492e 100644
--- a/libgcc/config/avr/libf7/f7-wraps.h
+++ b/libgcc/config/avr/libf7/f7-wraps.h
@@ -239,7 +239,7 @@ _ENDF __extendsfdf2
;; Functions that usually live in libm: Depending on [long] double layout,
;; define <name> and <name>l as weak alias(es) of __<name> for <name> in:
-;; pow fmin fmax fmod hypot atan2
+;; pow fmin fmax fmod hypot atan2 fdim
;; double __pow (double, double)
#ifdef F7MOD_D_pow_
@@ -313,6 +313,18 @@ _DEFUN __atan2
_ENDF __atan2
#endif /* F7MOD_D_atan2_ */
+;; double __fdim (double, double)
+#ifdef F7MOD_D_fdim_
+_DEFUN __fdim
+ DALIAS fdim
+ LALIAS fdiml
+ .global F7_NAME(fdim)
+ ldi ZH, hi8(gs(F7_NAME(fdim)))
+ ldi ZL, lo8(gs(F7_NAME(fdim)))
+ F7jmp call_ddd
+_ENDF __fdim
+#endif /* F7MOD_D_fdim_ */
+
;; Functions that usually live in libm: Depending on [long] double layout,
;; define <name> and <name>l as weak alias(es) of __<name> for <name> in:
;; ldexp frexp
diff --git a/libgcc/config/avr/libf7/f7renames.sh b/libgcc/config/avr/libf7/f7renames.sh
index 7ef251e..4ced423 100755
--- a/libgcc/config/avr/libf7/f7renames.sh
+++ b/libgcc/config/avr/libf7/f7renames.sh
@@ -35,9 +35,9 @@ EOF
c)
if [ x${PRE} != xf7_ ]; then
- echo " "
+ echo ""
echo "/* Renames for libf7.c, libf7.h. */"
- echo " "
+ echo ""
for x in $*; do
echo "#define f7_$x ${PRE}$x"
done
@@ -46,9 +46,9 @@ EOF
cst)
if [ x${PRE} != xf7_ ]; then
- echo " "
+ echo ""
echo "/* Renames for libf7.c, libf7.h. */"
- echo " "
+ echo ""
for x in $*; do
echo "#define f7_const_${x} ${PRE}const_${x}"
echo "#define f7_const_${x}_P ${PRE}const_${x}_P"
@@ -58,9 +58,9 @@ EOF
asm)
if [ x${PRE} != xf7_ ]; then
- echo " "
+ echo ""
echo "/* Renames for libf7-asm.sx, f7-wraps.h. */"
- echo " "
+ echo ""
for x in $*; do
echo "#define f7_${x}_asm ${PRE}${x}_asm"
done
diff --git a/libgcc/config/avr/libf7/libf7-common.mk b/libgcc/config/avr/libf7/libf7-common.mk
index 5d41107..644be2c 100644
--- a/libgcc/config/avr/libf7/libf7-common.mk
+++ b/libgcc/config/avr/libf7/libf7-common.mk
@@ -8,7 +8,7 @@ F7_C_PARTS += set_float get_float get_double set_double set_pdouble
F7_C_PARTS += fabs neg fmin fmax minmax truncx trunc floor ceil round lround
F7_C_PARTS += horner logx log log10 log2 exp pow10 pow powi
F7_C_PARTS += sin cos tan cotan sincos sinh cosh tanh sinhcosh
-F7_C_PARTS += asinacos asin acos atan atan2
+F7_C_PARTS += asinacos asin acos atan atan2 fdim
F7_C_PARTS += abscmp_msb_ge cmp cmp_abs cmp_unordered
F7_C_PARTS += const_1 const_1_2 const_1_3
@@ -34,7 +34,7 @@ g_xdd_cmp += le lt ge gt ne eq unord
g_dx += floatunsidf floatsidf extendsfdf2
g_xd += fixdfsi fixdfdi fixunsdfdi fixunsdfsi truncdfsf2
-m_ddd += pow fmin fmax fmod hypot atan2
+m_ddd += pow fmin fmax fmod hypot atan2 fdim
m_ddx += ldexp frexp
m_dd += sqrt cbrt exp exp10 pow10 log log10 log2 sin cos tan cotan asin acos atan
m_dd += ceil floor trunc round sinh cosh tanh
@@ -59,7 +59,7 @@ F7F += lrint ldexp frexp exp logx log log10 log2
F7F += minmax fmax fmin floor ceil round lround trunc truncx
F7F += horner pow10 exp10 pow powi
F7F += sin cos tan cotan sincos sinh cosh tanh sinhcosh
-F7F += asinacos asin acos atan atan2
+F7F += asinacos asin acos atan atan2 fdim
F7F += mul_noround sqrt16_round sqrt16_floor
F7F += clr_mant_lsbs abscmp_msb_ge lshrdi3 ashldi3
F7F += assert
diff --git a/libgcc/config/avr/libf7/libf7.c b/libgcc/config/avr/libf7/libf7.c
index a64554c..78c218a 100644
--- a/libgcc/config/avr/libf7/libf7.c
+++ b/libgcc/config/avr/libf7/libf7.c
@@ -928,6 +928,21 @@ void f7_sub (f7_t *cc, const f7_t *aa, const f7_t *bb)
#endif // F7MOD_sub_
+#ifdef F7MOD_fdim_
+F7_WEAK
+void f7_fdim (f7_t *cc, const f7_t *aa, const f7_t *bb)
+{
+ int8_t cmp = f7_cmp_unordered (aa, bb, true /*with_sign*/);
+ if (cmp == INT8_MIN)
+ return f7_set_nan (cc);
+ if (cmp < 0)
+ return f7_clr (cc);
+
+ f7_sub (cc, aa, bb);
+}
+#endif // F7MOD_fdim_
+
+
#ifdef F7MOD_addsub_
static void return_with_sign (f7_t *cc, const f7_t *aa, int8_t c_sign)
{
@@ -1649,10 +1664,10 @@ void f7_exp (f7_t *cc, const f7_t *aa)
return f7_set_nan (cc);
/* The maximal exponent of 2 for a double is 1023, hence we may limit
- to |A| < 1023 * ln2 ~ 709. We limit to 1024 ~ 1.99 * 2^9 */
+ to |A| < 1023 * ln2 ~ 709. We limit to 1024 = 2^10 */
if (f7_class_inf (a_class)
- || (f7_class_nonzero (a_class) && aa->expo >= 9))
+ || (f7_class_nonzero (a_class) && aa->expo >= 10))
{
if (f7_class_sign (a_class))
return f7_clr (cc);
diff --git a/libgcc/config/avr/libf7/libf7.h b/libgcc/config/avr/libf7/libf7.h
index 8aa91c7..786e141 100644
--- a/libgcc/config/avr/libf7/libf7.h
+++ b/libgcc/config/avr/libf7/libf7.h
@@ -612,6 +612,7 @@ extern void f7_cos (f7_t*, const f7_t*);
extern void f7_tan (f7_t*, const f7_t*);
extern void f7_atan (f7_t*, const f7_t*);
extern void f7_atan2 (f7_t*, const f7_t*, const f7_t*);
+extern void f7_fdim (f7_t*, const f7_t*, const f7_t*);
extern void f7_asin (f7_t*, const f7_t*);
extern void f7_acos (f7_t*, const f7_t*);
extern void f7_tanh (f7_t*, const f7_t*);
diff --git a/libgcc/config/gthr-vxworks-thread.c b/libgcc/config/gthr-vxworks-thread.c
index 17c60fa..31f291a 100644
--- a/libgcc/config/gthr-vxworks-thread.c
+++ b/libgcc/config/gthr-vxworks-thread.c
@@ -33,6 +33,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include <taskLib.h>
#include <stdlib.h>
+#include <string.h>
#define __TIMESPEC_TO_NSEC(timespec) \
((long long)timespec.tv_sec * 1000000000 + (long long)timespec.tv_nsec)
diff --git a/libgcc/config/i386/libgcc-darwin.ver b/libgcc/config/i386/libgcc-darwin.ver
index 06560d6..fd609ea 100644
--- a/libgcc/config/i386/libgcc-darwin.ver
+++ b/libgcc/config/i386/libgcc-darwin.ver
@@ -37,10 +37,16 @@ GCC_14.0.0 {
__truncxfbf2
__trunchfbf2
# Added to GCC_14.0.0 in i386/libgcc-glibc.ver.
+ __mulbitint3
+ __divmodbitint4
+ __fixsfbitint
+ __fixdfbitint
__fixxfbitint
__fixtfbitint
__floatbitintbf
__floatbitinthf
+ __floatbitintsf
+ __floatbitintdf
__floatbitintxf
__floatbitinttf
}
diff --git a/libgcc/config/i386/libgcc-glibc.ver b/libgcc/config/i386/libgcc-glibc.ver
index e71cc22..9e47b9a 100644
--- a/libgcc/config/i386/libgcc-glibc.ver
+++ b/libgcc/config/i386/libgcc-glibc.ver
@@ -229,10 +229,16 @@ GCC_13.0.0 {
%inherit GCC_14.0.0 GCC_13.0.0
GCC_14.0.0 {
+ __mulbitint3
+ __divmodbitint4
+ __fixsfbitint
+ __fixdfbitint
__fixxfbitint
__fixtfbitint
__floatbitintbf
__floatbitinthf
+ __floatbitintsf
+ __floatbitintdf
__floatbitintxf
__floatbitinttf
}
diff --git a/libgcc/config/i386/libgcc-sol2.ver b/libgcc/config/i386/libgcc-sol2.ver
index d2d6265..538bb69 100644
--- a/libgcc/config/i386/libgcc-sol2.ver
+++ b/libgcc/config/i386/libgcc-sol2.ver
@@ -144,10 +144,16 @@ GCC_14.0.0 {
__truncxfbf2
__trunchfbf2
# Added to GCC_14.0.0 in i386/libgcc-glibc.ver.
+ __mulbitint3
+ __divmodbitint4
+ __fixsfbitint
+ __fixdfbitint
__fixxfbitint
__fixtfbitint
__floatbitintbf
__floatbitinthf
+ __floatbitintsf
+ __floatbitintdf
__floatbitintxf
__floatbitinttf
}
diff --git a/libgcc/config/libbid/ChangeLog b/libgcc/config/libbid/ChangeLog
index dbdeb4e..9bc4518 100644
--- a/libgcc/config/libbid/ChangeLog
+++ b/libgcc/config/libbid/ChangeLog
@@ -1,3 +1,9 @@
+2025-05-15 liuhongt <hongtao.liu@intel.com>
+
+ * bid128_string.c (MIN_DIGITS): New macro.
+ (bid128_from_string): Bug fix. Conversion from very long input
+ string to decimal.
+
2024-11-14 Christophe Lyon <christophe.lyon@linaro.org>
PR libgcc/117537
diff --git a/libgcc/config/libbid/bid128_string.c b/libgcc/config/libbid/bid128_string.c
index fce036a..49ad179 100644..100755
--- a/libgcc/config/libbid/bid128_string.c
+++ b/libgcc/config/libbid/bid128_string.c
@@ -31,6 +31,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "bid128_2_str.h"
#include "bid128_2_str_macros.h"
+#define MIN_DIGITS(a,b) ((a) < (b) ? (a) : (b))
+
extern int bid128_coeff_2_string (UINT64 X_hi, UINT64 X_lo,
char *char_ptr);
@@ -283,6 +285,7 @@ bid128_from_string (char *ps _RND_MODE_PARAM _EXC_FLAGS_PARAM
int ndigits_before, ndigits_after, ndigits_total, dec_expon, sgn_exp,
i, d2, rdx_pt_enc;
char c, buffer[MAX_STRING_DIGITS_128];
+ int min_digits, sticky_bit=0;
int save_rnd_mode;
int save_fpsf;
@@ -443,8 +446,10 @@ bid128_from_string (char *ps _RND_MODE_PARAM _EXC_FLAGS_PARAM
if (!rdx_pt_enc) {
// investigate string (before radix point)
while ((unsigned) (c - '0') <= 9
- && ndigits_before < MAX_STRING_DIGITS_128) {
- buffer[ndigits_before] = c;
+ /*&& ndigits_before < MAX_STRING_DIGITS_128*/) {
+ if(ndigits_before < MAX_FORMAT_DIGITS_128) buffer[ndigits_before] = c;
+ else if(ndigits_before < MAX_STRING_DIGITS_128) { buffer[ndigits_before] = c; }
+ else if(c>'0') { sticky_bit = 1; }
ps++;
c = *ps;
ndigits_before++;
@@ -457,8 +462,10 @@ bid128_from_string (char *ps _RND_MODE_PARAM _EXC_FLAGS_PARAM
// investigate string (after radix point)
while ((unsigned) (c - '0') <= 9
- && ndigits_total < MAX_STRING_DIGITS_128) {
- buffer[ndigits_total] = c;
+ /*&& ndigits_total < MAX_STRING_DIGITS_128*/) {
+ if(ndigits_total < MAX_FORMAT_DIGITS_128) buffer[ndigits_total] = c;
+ else if(ndigits_total < MAX_STRING_DIGITS_128) { buffer[ndigits_total] = c; }
+ else if(c>'0') { sticky_bit = 1; }
ps++;
c = *ps;
ndigits_total++;
@@ -474,8 +481,10 @@ bid128_from_string (char *ps _RND_MODE_PARAM _EXC_FLAGS_PARAM
ndigits_total = 0;
// investigate string (after radix point)
while ((unsigned) (c - '0') <= 9
- && ndigits_total < MAX_STRING_DIGITS_128) {
- buffer[ndigits_total] = c;
+ /*&& ndigits_total < MAX_STRING_DIGITS_128*/) {
+ if(ndigits_total < MAX_FORMAT_DIGITS_128) buffer[ndigits_total] = c;
+ else if(ndigits_total < MAX_STRING_DIGITS_128) { buffer[ndigits_total] = c; }
+ else if(c>'0') { sticky_bit = 1; }
ps++;
c = *ps;
ndigits_total++;
@@ -594,57 +603,63 @@ bid128_from_string (char *ps _RND_MODE_PARAM _EXC_FLAGS_PARAM
coeff_l2 = coeff_low + coeff_low;
coeff_low = (coeff_l2 << 2) + coeff_l2 + buffer[i] - '0';
}
- switch(rnd_mode) {
- case ROUNDING_TO_NEAREST:
- carry = ((unsigned) ('4' - buffer[i])) >> 31;
- if ((buffer[i] == '5' && !(coeff_low & 1)) || dec_expon < 0) {
- if (dec_expon >= 0) {
- carry = 0;
- i++;
- }
- for (; i < ndigits_total; i++) {
- if (buffer[i] > '0') {
- carry = 1;
- break;
- }
+ switch(rnd_mode) {
+ case ROUNDING_TO_NEAREST:
+ carry = ((unsigned) ('4' - buffer[i])) >> 31;
+ if ((buffer[i] == '5' && !(coeff_low & 1) && !sticky_bit) || dec_expon < 0) {
+ if (dec_expon >= 0) {
+ carry = 0;
+ i++;
+ }
+ min_digits = MIN_DIGITS(ndigits_total, MAX_STRING_DIGITS_128);
+ for (carry=sticky_bit; (!carry) && (i < min_digits); i++) {
+ if (buffer[i] > '0') {
+ carry = 1;
+ break;
+ }
+ }
}
- }
- break;
-
- case ROUNDING_DOWN:
- if(sign_x)
- for (; i < ndigits_total; i++) {
- if (buffer[i] > '0') {
- carry = 1;
- break;
- }
+ break;
+
+ case ROUNDING_DOWN:
+ if(sign_x) {
+ min_digits = MIN_DIGITS(ndigits_total, MAX_STRING_DIGITS_128);
+ for (carry=sticky_bit; (!carry) && (i < min_digits); i++) {
+ if (buffer[i] > '0') {
+ carry = 1;
+ break;
+ }
+ }
}
- break;
- case ROUNDING_UP:
- if(!sign_x)
- for (; i < ndigits_total; i++) {
- if (buffer[i] > '0') {
- carry = 1;
- break;
- }
+ break;
+ case ROUNDING_UP:
+ if(!sign_x) {
+ min_digits = MIN_DIGITS(ndigits_total, MAX_STRING_DIGITS_128);
+ for (carry=sticky_bit; (!carry) && (i < min_digits); i++) {
+ if (buffer[i] > '0') {
+ carry = 1;
+ break;
+ }
+ }
}
- break;
- case ROUNDING_TO_ZERO:
- carry=0;
- break;
- case ROUNDING_TIES_AWAY:
- carry = ((unsigned) ('4' - buffer[i])) >> 31;
- if (dec_expon < 0) {
- for (; i < ndigits_total; i++) {
- if (buffer[i] > '0') {
- carry = 1;
- break;
- }
+ break;
+ case ROUNDING_TO_ZERO:
+ carry=0;
+ break;
+ case ROUNDING_TIES_AWAY:
+ carry = ((unsigned) ('4' - buffer[i])) >> 31;
+ if (dec_expon < 0) {
+ min_digits = MIN_DIGITS(ndigits_total, MAX_STRING_DIGITS_128);
+ for (carry=sticky_bit; (!carry) && (i < min_digits); i++) {
+ if (buffer[i] > '0') {
+ carry = 1;
+ break;
+ }
+ }
}
- }
- break;
-
- default: break; // default added to avoid compiler warning
+ break;
+
+ default: break; // default added to avoid compiler warning
}
// now form the coefficient as coeff_high*10^17+coeff_low+carry
scale_high = 100000000000000000ull;
diff --git a/libgcc/config/i386/t-mingw-mcfgthread b/libgcc/config/mingw/t-mingw-mcfgthread
index c5b817f..c5b817f 100644
--- a/libgcc/config/i386/t-mingw-mcfgthread
+++ b/libgcc/config/mingw/t-mingw-mcfgthread
diff --git a/libgcc/config/sh/lib1funcs.S b/libgcc/config/sh/lib1funcs.S
index eda4806..11acfd5 100644
--- a/libgcc/config/sh/lib1funcs.S
+++ b/libgcc/config/sh/lib1funcs.S
@@ -115,7 +115,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
HIDDEN_FUNC(GLOBAL(ashiftrt_r4_31))
HIDDEN_FUNC(GLOBAL(ashiftrt_r4_32))
- .align 1
+ .align 4
GLOBAL(ashiftrt_r4_32):
GLOBAL(ashiftrt_r4_31):
rotcl r4
@@ -764,6 +764,7 @@ LOCAL(movmem_loop): /* Reached with rts */
bt GLOBAL(movmemSI52)
! done all the large groups, do the remainder
! jump to movmem+
+ .balign 4
mova GLOBAL(movmemSI4)+4,r0
add r6,r0
jmp @r0
diff --git a/libgcc/config/t-softfp b/libgcc/config/t-softfp
index 94297ad..b352dfa 100644
--- a/libgcc/config/t-softfp
+++ b/libgcc/config/t-softfp
@@ -67,13 +67,11 @@ softfp_floatint_funcs = fix$(m)$(i) fixuns$(m)$(i) \
softfp_floatbitint_funcs = fix$(m)bitint floatbitint$(m)
softfp_bid_list :=
ifeq ($(decimal_float),yes)
-ifeq ($(enable_decimal_float),bid)
softfp_bid_list += bitintpow10 \
$(foreach m,sd dd td,fix$(m)bitint floatbitint$(m) \
fix$(m)ti fixuns$(m)ti \
floatti$(m) floatunti$(m))
endif
-endif
softfp_func_list := \
$(foreach m,$(softfp_float_modes), \
diff --git a/libgcc/libgcc-std.ver.in b/libgcc/libgcc-std.ver.in
index 1e372d7..3b3b5e6 100644
--- a/libgcc/libgcc-std.ver.in
+++ b/libgcc/libgcc-std.ver.in
@@ -1947,12 +1947,6 @@ GCC_7.0.0 {
%inherit GCC_14.0.0 GCC_7.0.0
GCC_14.0.0 {
- __PFX__mulbitint3
- __PFX__divmodbitint4
- __PFX__fixsfbitint
- __PFX__fixdfbitint
- __PFX__floatbitintsf
- __PFX__floatbitintdf
__PFX__hardcfr_check
__PFX__strub_enter
__PFX__strub_update
diff --git a/libgcc/libgcc2.c b/libgcc/libgcc2.c
index 92cb79d..faefff3 100644
--- a/libgcc/libgcc2.c
+++ b/libgcc/libgcc2.c
@@ -1333,7 +1333,7 @@ bitint_reduce_prec (const UBILtype **p, SItype prec)
if (prec >= -1)
return -2;
#if __LIBGCC_BITINT_ORDER__ == __ORDER_BIG_ENDIAN__
- ++p;
+ ++*p;
#else
--i;
#endif
@@ -1347,7 +1347,7 @@ bitint_reduce_prec (const UBILtype **p, SItype prec)
if (prec >= -1)
return -2;
#if __LIBGCC_BITINT_ORDER__ == __ORDER_BIG_ENDIAN__
- ++p;
+ ++*p;
#else
--i;
#endif
@@ -1358,7 +1358,7 @@ bitint_reduce_prec (const UBILtype **p, SItype prec)
if ((Wtype) mslimb >= 0)
{
#if __LIBGCC_BITINT_ORDER__ == __ORDER_BIG_ENDIAN__
- --p;
+ --*p;
#endif
return prec - 1;
}
@@ -1387,7 +1387,7 @@ bitint_reduce_prec (const UBILtype **p, SItype prec)
if (prec == 0)
return 1;
#if __LIBGCC_BITINT_ORDER__ == __ORDER_BIG_ENDIAN__
- ++p;
+ ++*p;
#else
--i;
#endif
@@ -1400,7 +1400,7 @@ bitint_reduce_prec (const UBILtype **p, SItype prec)
if (prec == 0)
return 1;
#if __LIBGCC_BITINT_ORDER__ == __ORDER_BIG_ENDIAN__
- ++p;
+ ++*p;
#else
--i;
#endif
diff --git a/libgcc/soft-fp/bitint.h b/libgcc/soft-fp/bitint.h
index 07a7bcb..457fc8f 100644
--- a/libgcc/soft-fp/bitint.h
+++ b/libgcc/soft-fp/bitint.h
@@ -1,7 +1,7 @@
/* Software floating-point emulation.
Definitions for _BitInt implementation details.
- Copyright (C) 2023 Free Software Foundation, Inc.
+ Copyright (C) 2023-2025 Free Software Foundation, Inc.
This file is part of GCC.
@@ -76,7 +76,7 @@ bitint_reduce_prec (const UBILtype **p, SItype prec)
if (prec >= -1)
return -2;
#if __LIBGCC_BITINT_ORDER__ == __ORDER_BIG_ENDIAN__
- ++p;
+ ++*p;
#else
--i;
#endif
@@ -90,7 +90,7 @@ bitint_reduce_prec (const UBILtype **p, SItype prec)
if (prec >= -1)
return -2;
#if __LIBGCC_BITINT_ORDER__ == __ORDER_BIG_ENDIAN__
- ++p;
+ ++*p;
#else
--i;
#endif
@@ -101,7 +101,7 @@ bitint_reduce_prec (const UBILtype **p, SItype prec)
if ((BILtype) mslimb >= 0)
{
#if __LIBGCC_BITINT_ORDER__ == __ORDER_BIG_ENDIAN__
- --p;
+ --*p;
#endif
return prec - 1;
}
@@ -130,7 +130,7 @@ bitint_reduce_prec (const UBILtype **p, SItype prec)
if (prec == 0)
return 1;
#if __LIBGCC_BITINT_ORDER__ == __ORDER_BIG_ENDIAN__
- ++p;
+ ++*p;
#else
--i;
#endif
@@ -143,7 +143,7 @@ bitint_reduce_prec (const UBILtype **p, SItype prec)
if (prec == 0)
return 1;
#if __LIBGCC_BITINT_ORDER__ == __ORDER_BIG_ENDIAN__
- ++p;
+ ++*p;
#else
--i;
#endif
@@ -352,6 +352,10 @@ extern void __divmodbitint4 (UBILtype *, SItype, UBILtype *, SItype,
const UBILtype *, SItype,
const UBILtype *, SItype);
+#ifndef ENABLE_DECIMAL_BID_FORMAT
+#define __bid_pow10bitint __dpd_pow10bitint
+extern const unsigned short __dpd_d2bbitint[1024], __dpd_b2dbitint[1000];
+#endif
extern USItype __bid_pow10bitint (UBILtype *, SItype, USItype);
#endif /* __BITINT_MAXWIDTH__ */
diff --git a/libgcc/soft-fp/bitintpow10.c b/libgcc/soft-fp/bitintpow10.c
index 06a470f0..15b288c 100644
--- a/libgcc/soft-fp/bitintpow10.c
+++ b/libgcc/soft-fp/bitintpow10.c
@@ -1,7 +1,7 @@
/* Software floating-point emulation.
Compute powers of 10 into _BitInt.
- Copyright (C) 2023 Free Software Foundation, Inc.
+ Copyright (C) 2023-2025 Free Software Foundation, Inc.
This file is part of GCC.
@@ -130,3 +130,341 @@ __bid_pow10bitint (UBILtype *r, SItype rprec, USItype n)
}
}
#endif
+
+#ifndef ENABLE_DECIMAL_BID_FORMAT
+/* DPD encoded 10-bit number to decimal table. */
+const unsigned short __dpd_d2bbitint[1024] = {
+ 0, 1, 2, 3, 4, 5, 6, 7,
+ 8, 9, 80, 81, 800, 801, 880, 881,
+ 10, 11, 12, 13, 14, 15, 16, 17,
+ 18, 19, 90, 91, 810, 811, 890, 891,
+ 20, 21, 22, 23, 24, 25, 26, 27,
+ 28, 29, 82, 83, 820, 821, 808, 809,
+ 30, 31, 32, 33, 34, 35, 36, 37,
+ 38, 39, 92, 93, 830, 831, 818, 819,
+ 40, 41, 42, 43, 44, 45, 46, 47,
+ 48, 49, 84, 85, 840, 841, 88, 89,
+ 50, 51, 52, 53, 54, 55, 56, 57,
+ 58, 59, 94, 95, 850, 851, 98, 99,
+ 60, 61, 62, 63, 64, 65, 66, 67,
+ 68, 69, 86, 87, 860, 861, 888, 889,
+ 70, 71, 72, 73, 74, 75, 76, 77,
+ 78, 79, 96, 97, 870, 871, 898, 899,
+ 100, 101, 102, 103, 104, 105, 106, 107,
+ 108, 109, 180, 181, 900, 901, 980, 981,
+ 110, 111, 112, 113, 114, 115, 116, 117,
+ 118, 119, 190, 191, 910, 911, 990, 991,
+ 120, 121, 122, 123, 124, 125, 126, 127,
+ 128, 129, 182, 183, 920, 921, 908, 909,
+ 130, 131, 132, 133, 134, 135, 136, 137,
+ 138, 139, 192, 193, 930, 931, 918, 919,
+ 140, 141, 142, 143, 144, 145, 146, 147,
+ 148, 149, 184, 185, 940, 941, 188, 189,
+ 150, 151, 152, 153, 154, 155, 156, 157,
+ 158, 159, 194, 195, 950, 951, 198, 199,
+ 160, 161, 162, 163, 164, 165, 166, 167,
+ 168, 169, 186, 187, 960, 961, 988, 989,
+ 170, 171, 172, 173, 174, 175, 176, 177,
+ 178, 179, 196, 197, 970, 971, 998, 999,
+ 200, 201, 202, 203, 204, 205, 206, 207,
+ 208, 209, 280, 281, 802, 803, 882, 883,
+ 210, 211, 212, 213, 214, 215, 216, 217,
+ 218, 219, 290, 291, 812, 813, 892, 893,
+ 220, 221, 222, 223, 224, 225, 226, 227,
+ 228, 229, 282, 283, 822, 823, 828, 829,
+ 230, 231, 232, 233, 234, 235, 236, 237,
+ 238, 239, 292, 293, 832, 833, 838, 839,
+ 240, 241, 242, 243, 244, 245, 246, 247,
+ 248, 249, 284, 285, 842, 843, 288, 289,
+ 250, 251, 252, 253, 254, 255, 256, 257,
+ 258, 259, 294, 295, 852, 853, 298, 299,
+ 260, 261, 262, 263, 264, 265, 266, 267,
+ 268, 269, 286, 287, 862, 863, 888, 889,
+ 270, 271, 272, 273, 274, 275, 276, 277,
+ 278, 279, 296, 297, 872, 873, 898, 899,
+ 300, 301, 302, 303, 304, 305, 306, 307,
+ 308, 309, 380, 381, 902, 903, 982, 983,
+ 310, 311, 312, 313, 314, 315, 316, 317,
+ 318, 319, 390, 391, 912, 913, 992, 993,
+ 320, 321, 322, 323, 324, 325, 326, 327,
+ 328, 329, 382, 383, 922, 923, 928, 929,
+ 330, 331, 332, 333, 334, 335, 336, 337,
+ 338, 339, 392, 393, 932, 933, 938, 939,
+ 340, 341, 342, 343, 344, 345, 346, 347,
+ 348, 349, 384, 385, 942, 943, 388, 389,
+ 350, 351, 352, 353, 354, 355, 356, 357,
+ 358, 359, 394, 395, 952, 953, 398, 399,
+ 360, 361, 362, 363, 364, 365, 366, 367,
+ 368, 369, 386, 387, 962, 963, 988, 989,
+ 370, 371, 372, 373, 374, 375, 376, 377,
+ 378, 379, 396, 397, 972, 973, 998, 999,
+ 400, 401, 402, 403, 404, 405, 406, 407,
+ 408, 409, 480, 481, 804, 805, 884, 885,
+ 410, 411, 412, 413, 414, 415, 416, 417,
+ 418, 419, 490, 491, 814, 815, 894, 895,
+ 420, 421, 422, 423, 424, 425, 426, 427,
+ 428, 429, 482, 483, 824, 825, 848, 849,
+ 430, 431, 432, 433, 434, 435, 436, 437,
+ 438, 439, 492, 493, 834, 835, 858, 859,
+ 440, 441, 442, 443, 444, 445, 446, 447,
+ 448, 449, 484, 485, 844, 845, 488, 489,
+ 450, 451, 452, 453, 454, 455, 456, 457,
+ 458, 459, 494, 495, 854, 855, 498, 499,
+ 460, 461, 462, 463, 464, 465, 466, 467,
+ 468, 469, 486, 487, 864, 865, 888, 889,
+ 470, 471, 472, 473, 474, 475, 476, 477,
+ 478, 479, 496, 497, 874, 875, 898, 899,
+ 500, 501, 502, 503, 504, 505, 506, 507,
+ 508, 509, 580, 581, 904, 905, 984, 985,
+ 510, 511, 512, 513, 514, 515, 516, 517,
+ 518, 519, 590, 591, 914, 915, 994, 995,
+ 520, 521, 522, 523, 524, 525, 526, 527,
+ 528, 529, 582, 583, 924, 925, 948, 949,
+ 530, 531, 532, 533, 534, 535, 536, 537,
+ 538, 539, 592, 593, 934, 935, 958, 959,
+ 540, 541, 542, 543, 544, 545, 546, 547,
+ 548, 549, 584, 585, 944, 945, 588, 589,
+ 550, 551, 552, 553, 554, 555, 556, 557,
+ 558, 559, 594, 595, 954, 955, 598, 599,
+ 560, 561, 562, 563, 564, 565, 566, 567,
+ 568, 569, 586, 587, 964, 965, 988, 989,
+ 570, 571, 572, 573, 574, 575, 576, 577,
+ 578, 579, 596, 597, 974, 975, 998, 999,
+ 600, 601, 602, 603, 604, 605, 606, 607,
+ 608, 609, 680, 681, 806, 807, 886, 887,
+ 610, 611, 612, 613, 614, 615, 616, 617,
+ 618, 619, 690, 691, 816, 817, 896, 897,
+ 620, 621, 622, 623, 624, 625, 626, 627,
+ 628, 629, 682, 683, 826, 827, 868, 869,
+ 630, 631, 632, 633, 634, 635, 636, 637,
+ 638, 639, 692, 693, 836, 837, 878, 879,
+ 640, 641, 642, 643, 644, 645, 646, 647,
+ 648, 649, 684, 685, 846, 847, 688, 689,
+ 650, 651, 652, 653, 654, 655, 656, 657,
+ 658, 659, 694, 695, 856, 857, 698, 699,
+ 660, 661, 662, 663, 664, 665, 666, 667,
+ 668, 669, 686, 687, 866, 867, 888, 889,
+ 670, 671, 672, 673, 674, 675, 676, 677,
+ 678, 679, 696, 697, 876, 877, 898, 899,
+ 700, 701, 702, 703, 704, 705, 706, 707,
+ 708, 709, 780, 781, 906, 907, 986, 987,
+ 710, 711, 712, 713, 714, 715, 716, 717,
+ 718, 719, 790, 791, 916, 917, 996, 997,
+ 720, 721, 722, 723, 724, 725, 726, 727,
+ 728, 729, 782, 783, 926, 927, 968, 969,
+ 730, 731, 732, 733, 734, 735, 736, 737,
+ 738, 739, 792, 793, 936, 937, 978, 979,
+ 740, 741, 742, 743, 744, 745, 746, 747,
+ 748, 749, 784, 785, 946, 947, 788, 789,
+ 750, 751, 752, 753, 754, 755, 756, 757,
+ 758, 759, 794, 795, 956, 957, 798, 799,
+ 760, 761, 762, 763, 764, 765, 766, 767,
+ 768, 769, 786, 787, 966, 967, 988, 989,
+ 770, 771, 772, 773, 774, 775, 776, 777,
+ 778, 779, 796, 797, 976, 977, 998, 999
+};
+
+/* Decimal to DPD encoded 10-bit number table. */
+const unsigned short __dpd_b2dbitint[1000] = {
+ 0x000, 0x001, 0x002, 0x003, 0x004,
+ 0x005, 0x006, 0x007, 0x008, 0x009,
+ 0x010, 0x011, 0x012, 0x013, 0x014,
+ 0x015, 0x016, 0x017, 0x018, 0x019,
+ 0x020, 0x021, 0x022, 0x023, 0x024,
+ 0x025, 0x026, 0x027, 0x028, 0x029,
+ 0x030, 0x031, 0x032, 0x033, 0x034,
+ 0x035, 0x036, 0x037, 0x038, 0x039,
+ 0x040, 0x041, 0x042, 0x043, 0x044,
+ 0x045, 0x046, 0x047, 0x048, 0x049,
+ 0x050, 0x051, 0x052, 0x053, 0x054,
+ 0x055, 0x056, 0x057, 0x058, 0x059,
+ 0x060, 0x061, 0x062, 0x063, 0x064,
+ 0x065, 0x066, 0x067, 0x068, 0x069,
+ 0x070, 0x071, 0x072, 0x073, 0x074,
+ 0x075, 0x076, 0x077, 0x078, 0x079,
+ 0x00a, 0x00b, 0x02a, 0x02b, 0x04a,
+ 0x04b, 0x06a, 0x06b, 0x04e, 0x04f,
+ 0x01a, 0x01b, 0x03a, 0x03b, 0x05a,
+ 0x05b, 0x07a, 0x07b, 0x05e, 0x05f,
+ 0x080, 0x081, 0x082, 0x083, 0x084,
+ 0x085, 0x086, 0x087, 0x088, 0x089,
+ 0x090, 0x091, 0x092, 0x093, 0x094,
+ 0x095, 0x096, 0x097, 0x098, 0x099,
+ 0x0a0, 0x0a1, 0x0a2, 0x0a3, 0x0a4,
+ 0x0a5, 0x0a6, 0x0a7, 0x0a8, 0x0a9,
+ 0x0b0, 0x0b1, 0x0b2, 0x0b3, 0x0b4,
+ 0x0b5, 0x0b6, 0x0b7, 0x0b8, 0x0b9,
+ 0x0c0, 0x0c1, 0x0c2, 0x0c3, 0x0c4,
+ 0x0c5, 0x0c6, 0x0c7, 0x0c8, 0x0c9,
+ 0x0d0, 0x0d1, 0x0d2, 0x0d3, 0x0d4,
+ 0x0d5, 0x0d6, 0x0d7, 0x0d8, 0x0d9,
+ 0x0e0, 0x0e1, 0x0e2, 0x0e3, 0x0e4,
+ 0x0e5, 0x0e6, 0x0e7, 0x0e8, 0x0e9,
+ 0x0f0, 0x0f1, 0x0f2, 0x0f3, 0x0f4,
+ 0x0f5, 0x0f6, 0x0f7, 0x0f8, 0x0f9,
+ 0x08a, 0x08b, 0x0aa, 0x0ab, 0x0ca,
+ 0x0cb, 0x0ea, 0x0eb, 0x0ce, 0x0cf,
+ 0x09a, 0x09b, 0x0ba, 0x0bb, 0x0da,
+ 0x0db, 0x0fa, 0x0fb, 0x0de, 0x0df,
+ 0x100, 0x101, 0x102, 0x103, 0x104,
+ 0x105, 0x106, 0x107, 0x108, 0x109,
+ 0x110, 0x111, 0x112, 0x113, 0x114,
+ 0x115, 0x116, 0x117, 0x118, 0x119,
+ 0x120, 0x121, 0x122, 0x123, 0x124,
+ 0x125, 0x126, 0x127, 0x128, 0x129,
+ 0x130, 0x131, 0x132, 0x133, 0x134,
+ 0x135, 0x136, 0x137, 0x138, 0x139,
+ 0x140, 0x141, 0x142, 0x143, 0x144,
+ 0x145, 0x146, 0x147, 0x148, 0x149,
+ 0x150, 0x151, 0x152, 0x153, 0x154,
+ 0x155, 0x156, 0x157, 0x158, 0x159,
+ 0x160, 0x161, 0x162, 0x163, 0x164,
+ 0x165, 0x166, 0x167, 0x168, 0x169,
+ 0x170, 0x171, 0x172, 0x173, 0x174,
+ 0x175, 0x176, 0x177, 0x178, 0x179,
+ 0x10a, 0x10b, 0x12a, 0x12b, 0x14a,
+ 0x14b, 0x16a, 0x16b, 0x14e, 0x14f,
+ 0x11a, 0x11b, 0x13a, 0x13b, 0x15a,
+ 0x15b, 0x17a, 0x17b, 0x15e, 0x15f,
+ 0x180, 0x181, 0x182, 0x183, 0x184,
+ 0x185, 0x186, 0x187, 0x188, 0x189,
+ 0x190, 0x191, 0x192, 0x193, 0x194,
+ 0x195, 0x196, 0x197, 0x198, 0x199,
+ 0x1a0, 0x1a1, 0x1a2, 0x1a3, 0x1a4,
+ 0x1a5, 0x1a6, 0x1a7, 0x1a8, 0x1a9,
+ 0x1b0, 0x1b1, 0x1b2, 0x1b3, 0x1b4,
+ 0x1b5, 0x1b6, 0x1b7, 0x1b8, 0x1b9,
+ 0x1c0, 0x1c1, 0x1c2, 0x1c3, 0x1c4,
+ 0x1c5, 0x1c6, 0x1c7, 0x1c8, 0x1c9,
+ 0x1d0, 0x1d1, 0x1d2, 0x1d3, 0x1d4,
+ 0x1d5, 0x1d6, 0x1d7, 0x1d8, 0x1d9,
+ 0x1e0, 0x1e1, 0x1e2, 0x1e3, 0x1e4,
+ 0x1e5, 0x1e6, 0x1e7, 0x1e8, 0x1e9,
+ 0x1f0, 0x1f1, 0x1f2, 0x1f3, 0x1f4,
+ 0x1f5, 0x1f6, 0x1f7, 0x1f8, 0x1f9,
+ 0x18a, 0x18b, 0x1aa, 0x1ab, 0x1ca,
+ 0x1cb, 0x1ea, 0x1eb, 0x1ce, 0x1cf,
+ 0x19a, 0x19b, 0x1ba, 0x1bb, 0x1da,
+ 0x1db, 0x1fa, 0x1fb, 0x1de, 0x1df,
+ 0x200, 0x201, 0x202, 0x203, 0x204,
+ 0x205, 0x206, 0x207, 0x208, 0x209,
+ 0x210, 0x211, 0x212, 0x213, 0x214,
+ 0x215, 0x216, 0x217, 0x218, 0x219,
+ 0x220, 0x221, 0x222, 0x223, 0x224,
+ 0x225, 0x226, 0x227, 0x228, 0x229,
+ 0x230, 0x231, 0x232, 0x233, 0x234,
+ 0x235, 0x236, 0x237, 0x238, 0x239,
+ 0x240, 0x241, 0x242, 0x243, 0x244,
+ 0x245, 0x246, 0x247, 0x248, 0x249,
+ 0x250, 0x251, 0x252, 0x253, 0x254,
+ 0x255, 0x256, 0x257, 0x258, 0x259,
+ 0x260, 0x261, 0x262, 0x263, 0x264,
+ 0x265, 0x266, 0x267, 0x268, 0x269,
+ 0x270, 0x271, 0x272, 0x273, 0x274,
+ 0x275, 0x276, 0x277, 0x278, 0x279,
+ 0x20a, 0x20b, 0x22a, 0x22b, 0x24a,
+ 0x24b, 0x26a, 0x26b, 0x24e, 0x24f,
+ 0x21a, 0x21b, 0x23a, 0x23b, 0x25a,
+ 0x25b, 0x27a, 0x27b, 0x25e, 0x25f,
+ 0x280, 0x281, 0x282, 0x283, 0x284,
+ 0x285, 0x286, 0x287, 0x288, 0x289,
+ 0x290, 0x291, 0x292, 0x293, 0x294,
+ 0x295, 0x296, 0x297, 0x298, 0x299,
+ 0x2a0, 0x2a1, 0x2a2, 0x2a3, 0x2a4,
+ 0x2a5, 0x2a6, 0x2a7, 0x2a8, 0x2a9,
+ 0x2b0, 0x2b1, 0x2b2, 0x2b3, 0x2b4,
+ 0x2b5, 0x2b6, 0x2b7, 0x2b8, 0x2b9,
+ 0x2c0, 0x2c1, 0x2c2, 0x2c3, 0x2c4,
+ 0x2c5, 0x2c6, 0x2c7, 0x2c8, 0x2c9,
+ 0x2d0, 0x2d1, 0x2d2, 0x2d3, 0x2d4,
+ 0x2d5, 0x2d6, 0x2d7, 0x2d8, 0x2d9,
+ 0x2e0, 0x2e1, 0x2e2, 0x2e3, 0x2e4,
+ 0x2e5, 0x2e6, 0x2e7, 0x2e8, 0x2e9,
+ 0x2f0, 0x2f1, 0x2f2, 0x2f3, 0x2f4,
+ 0x2f5, 0x2f6, 0x2f7, 0x2f8, 0x2f9,
+ 0x28a, 0x28b, 0x2aa, 0x2ab, 0x2ca,
+ 0x2cb, 0x2ea, 0x2eb, 0x2ce, 0x2cf,
+ 0x29a, 0x29b, 0x2ba, 0x2bb, 0x2da,
+ 0x2db, 0x2fa, 0x2fb, 0x2de, 0x2df,
+ 0x300, 0x301, 0x302, 0x303, 0x304,
+ 0x305, 0x306, 0x307, 0x308, 0x309,
+ 0x310, 0x311, 0x312, 0x313, 0x314,
+ 0x315, 0x316, 0x317, 0x318, 0x319,
+ 0x320, 0x321, 0x322, 0x323, 0x324,
+ 0x325, 0x326, 0x327, 0x328, 0x329,
+ 0x330, 0x331, 0x332, 0x333, 0x334,
+ 0x335, 0x336, 0x337, 0x338, 0x339,
+ 0x340, 0x341, 0x342, 0x343, 0x344,
+ 0x345, 0x346, 0x347, 0x348, 0x349,
+ 0x350, 0x351, 0x352, 0x353, 0x354,
+ 0x355, 0x356, 0x357, 0x358, 0x359,
+ 0x360, 0x361, 0x362, 0x363, 0x364,
+ 0x365, 0x366, 0x367, 0x368, 0x369,
+ 0x370, 0x371, 0x372, 0x373, 0x374,
+ 0x375, 0x376, 0x377, 0x378, 0x379,
+ 0x30a, 0x30b, 0x32a, 0x32b, 0x34a,
+ 0x34b, 0x36a, 0x36b, 0x34e, 0x34f,
+ 0x31a, 0x31b, 0x33a, 0x33b, 0x35a,
+ 0x35b, 0x37a, 0x37b, 0x35e, 0x35f,
+ 0x380, 0x381, 0x382, 0x383, 0x384,
+ 0x385, 0x386, 0x387, 0x388, 0x389,
+ 0x390, 0x391, 0x392, 0x393, 0x394,
+ 0x395, 0x396, 0x397, 0x398, 0x399,
+ 0x3a0, 0x3a1, 0x3a2, 0x3a3, 0x3a4,
+ 0x3a5, 0x3a6, 0x3a7, 0x3a8, 0x3a9,
+ 0x3b0, 0x3b1, 0x3b2, 0x3b3, 0x3b4,
+ 0x3b5, 0x3b6, 0x3b7, 0x3b8, 0x3b9,
+ 0x3c0, 0x3c1, 0x3c2, 0x3c3, 0x3c4,
+ 0x3c5, 0x3c6, 0x3c7, 0x3c8, 0x3c9,
+ 0x3d0, 0x3d1, 0x3d2, 0x3d3, 0x3d4,
+ 0x3d5, 0x3d6, 0x3d7, 0x3d8, 0x3d9,
+ 0x3e0, 0x3e1, 0x3e2, 0x3e3, 0x3e4,
+ 0x3e5, 0x3e6, 0x3e7, 0x3e8, 0x3e9,
+ 0x3f0, 0x3f1, 0x3f2, 0x3f3, 0x3f4,
+ 0x3f5, 0x3f6, 0x3f7, 0x3f8, 0x3f9,
+ 0x38a, 0x38b, 0x3aa, 0x3ab, 0x3ca,
+ 0x3cb, 0x3ea, 0x3eb, 0x3ce, 0x3cf,
+ 0x39a, 0x39b, 0x3ba, 0x3bb, 0x3da,
+ 0x3db, 0x3fa, 0x3fb, 0x3de, 0x3df,
+ 0x00c, 0x00d, 0x10c, 0x10d, 0x20c,
+ 0x20d, 0x30c, 0x30d, 0x02e, 0x02f,
+ 0x01c, 0x01d, 0x11c, 0x11d, 0x21c,
+ 0x21d, 0x31c, 0x31d, 0x03e, 0x03f,
+ 0x02c, 0x02d, 0x12c, 0x12d, 0x22c,
+ 0x22d, 0x32c, 0x32d, 0x12e, 0x12f,
+ 0x03c, 0x03d, 0x13c, 0x13d, 0x23c,
+ 0x23d, 0x33c, 0x33d, 0x13e, 0x13f,
+ 0x04c, 0x04d, 0x14c, 0x14d, 0x24c,
+ 0x24d, 0x34c, 0x34d, 0x22e, 0x22f,
+ 0x05c, 0x05d, 0x15c, 0x15d, 0x25c,
+ 0x25d, 0x35c, 0x35d, 0x23e, 0x23f,
+ 0x06c, 0x06d, 0x16c, 0x16d, 0x26c,
+ 0x26d, 0x36c, 0x36d, 0x32e, 0x32f,
+ 0x07c, 0x07d, 0x17c, 0x17d, 0x27c,
+ 0x27d, 0x37c, 0x37d, 0x33e, 0x33f,
+ 0x00e, 0x00f, 0x10e, 0x10f, 0x20e,
+ 0x20f, 0x30e, 0x30f, 0x06e, 0x06f,
+ 0x01e, 0x01f, 0x11e, 0x11f, 0x21e,
+ 0x21f, 0x31e, 0x31f, 0x07e, 0x07f,
+ 0x08c, 0x08d, 0x18c, 0x18d, 0x28c,
+ 0x28d, 0x38c, 0x38d, 0x0ae, 0x0af,
+ 0x09c, 0x09d, 0x19c, 0x19d, 0x29c,
+ 0x29d, 0x39c, 0x39d, 0x0be, 0x0bf,
+ 0x0ac, 0x0ad, 0x1ac, 0x1ad, 0x2ac,
+ 0x2ad, 0x3ac, 0x3ad, 0x1ae, 0x1af,
+ 0x0bc, 0x0bd, 0x1bc, 0x1bd, 0x2bc,
+ 0x2bd, 0x3bc, 0x3bd, 0x1be, 0x1bf,
+ 0x0cc, 0x0cd, 0x1cc, 0x1cd, 0x2cc,
+ 0x2cd, 0x3cc, 0x3cd, 0x2ae, 0x2af,
+ 0x0dc, 0x0dd, 0x1dc, 0x1dd, 0x2dc,
+ 0x2dd, 0x3dc, 0x3dd, 0x2be, 0x2bf,
+ 0x0ec, 0x0ed, 0x1ec, 0x1ed, 0x2ec,
+ 0x2ed, 0x3ec, 0x3ed, 0x3ae, 0x3af,
+ 0x0fc, 0x0fd, 0x1fc, 0x1fd, 0x2fc,
+ 0x2fd, 0x3fc, 0x3fd, 0x3be, 0x3bf,
+ 0x08e, 0x08f, 0x18e, 0x18f, 0x28e,
+ 0x28f, 0x38e, 0x38f, 0x0ee, 0x0ef,
+ 0x09e, 0x09f, 0x19e, 0x19f, 0x29e,
+ 0x29f, 0x39e, 0x39f, 0x0fe, 0x0ff
+};
+#endif
diff --git a/libgcc/soft-fp/fixddbitint.c b/libgcc/soft-fp/fixddbitint.c
index 7b0162e..067a9a6 100644
--- a/libgcc/soft-fp/fixddbitint.c
+++ b/libgcc/soft-fp/fixddbitint.c
@@ -1,7 +1,7 @@
/* Software floating-point emulation.
Convert _Decimal64 to signed or unsigned _BitInt.
- Copyright (C) 2023 Free Software Foundation, Inc.
+ Copyright (C) 2023-2025 Free Software Foundation, Inc.
This file is part of GCC.
@@ -28,6 +28,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "bitint.h"
#ifdef __BITINT_MAXWIDTH__
+#ifndef ENABLE_DECIMAL_BID_FORMAT
+#define __bid_fixddbitint __dpd_fixddbitint
+#endif
extern void __bid_fixddbitint (UBILtype *, SItype, _Decimal64);
void
@@ -48,6 +51,7 @@ __bid_fixddbitint (UBILtype *r, SItype rprec, _Decimal64 a)
u.d = a;
t = u.u >> 51;
sgn = (DItype) u.u < 0;
+#ifdef ENABLE_DECIMAL_BID_FORMAT
if ((t & (3 << 10)) != (3 << 10))
{
mantissa = u.u & ((((UDItype) 1) << 53) - 1);
@@ -61,6 +65,31 @@ __bid_fixddbitint (UBILtype *r, SItype rprec, _Decimal64 a)
if (mantissa > (UDItype) 9999999999999999)
mantissa = 0;
}
+#else
+ if ((t & (15 << 8)) != (15 << 8))
+ {
+ exponent = (u.u >> 50) & 255;
+ if ((t & (3 << 10)) != (3 << 10))
+ {
+ mantissa = ((t >> 7) & 7) * 1000;
+ exponent += (t >> 2) & (3 << 8);
+ }
+ else
+ {
+ mantissa = ((t >> 7) & 1) ? 9000 : 8000;
+ exponent += t & (3 << 8);
+ }
+ mantissa += __dpd_d2bbitint[(u.u >> 40) & 1023];
+ mantissa *= 1000;
+ mantissa += __dpd_d2bbitint[(u.u >> 30) & 1023];
+ mantissa *= 1000;
+ mantissa += __dpd_d2bbitint[(u.u >> 20) & 1023];
+ mantissa *= 1000;
+ mantissa += __dpd_d2bbitint[(u.u >> 10) & 1023];
+ mantissa *= 1000;
+ mantissa += __dpd_d2bbitint[u.u & 1023];
+ }
+#endif
else
{
FP_SET_EXCEPTION (FP_EX_INVALID
@@ -162,7 +191,7 @@ __bid_fixddbitint (UBILtype *r, SItype rprec, _Decimal64 a)
if (res_limbs + low_zeros > rn && resv[BITINT_END (0, res_limbs - 1)])
goto ovf_ex;
if ((arprec % BIL_TYPE_SIZE) != 0
- && (resv[BITINT_END (rn - res_limbs, rn - 1) - low_zeros]
+ && (resv[BITINT_END (res_limbs + low_zeros - rn, rn - 1 - low_zeros)]
& ((UBILtype) -1 << (arprec % BIL_TYPE_SIZE))) != 0)
goto ovf_ex;
min_limbs = rn - low_zeros;
diff --git a/libgcc/soft-fp/fixddti.c b/libgcc/soft-fp/fixddti.c
index c27ae8b..c7b4ad7 100644
--- a/libgcc/soft-fp/fixddti.c
+++ b/libgcc/soft-fp/fixddti.c
@@ -1,7 +1,7 @@
/* Software floating-point emulation.
Convert _Decimal64 to 128bit signed integer.
- Copyright (C) 2023 Free Software Foundation, Inc.
+ Copyright (C) 2023-2025 Free Software Foundation, Inc.
This file is part of GCC.
@@ -28,6 +28,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "bitint.h"
#if defined(__BITINT_MAXWIDTH__) && defined(__SIZEOF_INT128__)
+#ifndef ENABLE_DECIMAL_BID_FORMAT
+#define __bid_fixddbitint __dpd_fixddbitint
+#define __bid_fixddti __dpd_fixddti
+#endif
extern void __bid_fixddbitint (UBILtype *, SItype, _Decimal64);
extern TItype __bid_fixddti (_Decimal64);
diff --git a/libgcc/soft-fp/fixsdbitint.c b/libgcc/soft-fp/fixsdbitint.c
index 2ba550f..fc117d9 100644
--- a/libgcc/soft-fp/fixsdbitint.c
+++ b/libgcc/soft-fp/fixsdbitint.c
@@ -1,7 +1,7 @@
/* Software floating-point emulation.
Convert _Decimal32 to signed or unsigned _BitInt.
- Copyright (C) 2023 Free Software Foundation, Inc.
+ Copyright (C) 2023-2025 Free Software Foundation, Inc.
This file is part of GCC.
@@ -28,6 +28,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "bitint.h"
#ifdef __BITINT_MAXWIDTH__
+#ifndef ENABLE_DECIMAL_BID_FORMAT
+#define __bid_fixsdbitint __dpd_fixsdbitint
+#endif
extern void __bid_fixsdbitint (UBILtype *, SItype, _Decimal32);
void
@@ -48,6 +51,7 @@ __bid_fixsdbitint (UBILtype *r, SItype rprec, _Decimal32 a)
u.d = a;
t = u.u >> 21;
sgn = (SItype) u.u < 0;
+#ifdef ENABLE_DECIMAL_BID_FORMAT
if ((t & (3 << 8)) != (3 << 8))
{
mantissa = u.u & ((((USItype) 1) << 23) - 1);
@@ -61,6 +65,25 @@ __bid_fixsdbitint (UBILtype *r, SItype rprec, _Decimal32 a)
if (mantissa > (USItype) 9999999)
mantissa = 0;
}
+#else
+ if ((t & (15 << 6)) != (15 << 6))
+ {
+ exponent = (u.u >> 20) & 63;
+ if ((t & (3 << 8)) != (3 << 8))
+ {
+ mantissa = ((t >> 5) & 7) * 1000;
+ exponent += (t >> 2) & (3 << 6);
+ }
+ else
+ {
+ mantissa = ((t >> 5) & 1) ? 9000 : 8000;
+ exponent += t & (3 << 6);
+ }
+ mantissa += __dpd_d2bbitint[(u.u >> 10) & 1023];
+ mantissa *= 1000;
+ mantissa += __dpd_d2bbitint[u.u & 1023];
+ }
+#endif
else
{
FP_SET_EXCEPTION (FP_EX_INVALID
@@ -153,7 +176,7 @@ __bid_fixsdbitint (UBILtype *r, SItype rprec, _Decimal32 a)
if (res_limbs + low_zeros > rn && resv[BITINT_END (0, res_limbs - 1)])
goto ovf_ex;
if ((arprec % BIL_TYPE_SIZE) != 0
- && (resv[BITINT_END (rn - res_limbs, rn - 1) - low_zeros]
+ && (resv[BITINT_END (res_limbs + low_zeros - rn, rn - 1 - low_zeros)]
& ((UBILtype) -1 << (arprec % BIL_TYPE_SIZE))) != 0)
goto ovf_ex;
min_limbs = rn - low_zeros;
diff --git a/libgcc/soft-fp/fixsdti.c b/libgcc/soft-fp/fixsdti.c
index 8477ace..9a53508 100644
--- a/libgcc/soft-fp/fixsdti.c
+++ b/libgcc/soft-fp/fixsdti.c
@@ -28,6 +28,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "bitint.h"
#if defined(__BITINT_MAXWIDTH__) && defined(__SIZEOF_INT128__)
+#ifndef ENABLE_DECIMAL_BID_FORMAT
+#define __bid_fixsdbitint __dpd_fixsdbitint
+#define __bid_fixsdti __dpd_fixsdti
+#endif
extern void __bid_fixsdbitint (UBILtype *, SItype, _Decimal32);
extern TItype __bid_fixsdti (_Decimal32);
diff --git a/libgcc/soft-fp/fixtdbitint.c b/libgcc/soft-fp/fixtdbitint.c
index 66aca1c..a16aaab 100644
--- a/libgcc/soft-fp/fixtdbitint.c
+++ b/libgcc/soft-fp/fixtdbitint.c
@@ -1,7 +1,7 @@
/* Software floating-point emulation.
Convert _Decimal128 to signed or unsigned _BitInt.
- Copyright (C) 2023 Free Software Foundation, Inc.
+ Copyright (C) 2023-2025 Free Software Foundation, Inc.
This file is part of GCC.
@@ -28,6 +28,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "bitint.h"
#ifdef __BITINT_MAXWIDTH__
+#ifndef ENABLE_DECIMAL_BID_FORMAT
+#define __bid_fixtdbitint __dpd_fixtdbitint
+#endif
extern void __bid_fixtdbitint (UBILtype *, SItype, _Decimal128);
void
@@ -50,6 +53,7 @@ __bid_fixtdbitint (UBILtype *r, SItype rprec, _Decimal128 a)
mantissalo = u.u[__FLOAT_WORD_ORDER__ == __ORDER_BIG_ENDIAN__];
t = mantissahi >> 47;
sgn = (DItype) mantissahi < 0;
+#ifdef ENABLE_DECIMAL_BID_FORMAT
if ((t & (3 << 14)) != (3 << 14))
{
mantissahi &= ((((UDItype) 1) << 49) - 1);
@@ -68,6 +72,52 @@ __bid_fixtdbitint (UBILtype *r, SItype rprec, _Decimal128 a)
mantissalo = 0;
exponent = t & 0x3fff;
}
+#else
+ if ((t & (15 << 12)) != (15 << 12))
+ {
+ exponent = (mantissahi >> 46) & 4095;
+ if ((t & (3 << 14)) != (3 << 14))
+ {
+ exponent += (t >> 2) & (3 << 12);
+ t = ((t >> 11) & 7) * 1000;
+ }
+ else
+ {
+ exponent += t & (3 << 12);
+ t = ((t >> 11) & 1) ? 9000 : 8000;
+ }
+ t += __dpd_d2bbitint[(mantissahi >> (100 - 64)) & 1023];
+ t *= 1000;
+ t += __dpd_d2bbitint[(mantissahi >> (90 - 64)) & 1023];
+ t *= 1000;
+ t += __dpd_d2bbitint[(mantissahi >> (80 - 64)) & 1023];
+ t *= 1000;
+ t += __dpd_d2bbitint[(mantissahi >> (70 - 64)) & 1023];
+ t *= 1000;
+ t += __dpd_d2bbitint[((mantissahi & 63) << 4)
+ + ((mantissalo >> 60) & 15)];
+ t *= 1000;
+ t += __dpd_d2bbitint[mantissalo >> 50 & 1023];
+#ifdef __SIZEOF_INT128__
+ unsigned __int128 m = t;
+#else
+ unsigned _BitInt(128) m = t;
+#endif
+ m *= 1000000000000000ULL;
+ t = __dpd_d2bbitint[(mantissalo >> 40) & 1023];
+ t *= 1000;
+ t += __dpd_d2bbitint[(mantissalo >> 30) & 1023];
+ t *= 1000;
+ t += __dpd_d2bbitint[(mantissalo >> 20) & 1023];
+ t *= 1000;
+ t += __dpd_d2bbitint[(mantissalo >> 10) & 1023];
+ t *= 1000;
+ t += __dpd_d2bbitint[mantissalo & 1023];
+ m += t;
+ mantissahi = m >> 64;
+ mantissalo = m;
+ }
+#endif
else
{
FP_SET_EXCEPTION (FP_EX_INVALID
@@ -199,7 +249,7 @@ __bid_fixtdbitint (UBILtype *r, SItype rprec, _Decimal128 a)
if (res_limbs + low_zeros > rn && resv[BITINT_END (0, res_limbs - 1)])
goto ovf_ex;
if ((arprec % BIL_TYPE_SIZE) != 0
- && (resv[BITINT_END (rn - res_limbs, rn - 1) - low_zeros]
+ && (resv[BITINT_END (res_limbs + low_zeros - rn, rn - 1 - low_zeros)]
& ((UBILtype) -1 << (arprec % BIL_TYPE_SIZE))) != 0)
goto ovf_ex;
min_limbs = rn - low_zeros;
diff --git a/libgcc/soft-fp/fixtdti.c b/libgcc/soft-fp/fixtdti.c
index 9ac1333..ee26f26 100644
--- a/libgcc/soft-fp/fixtdti.c
+++ b/libgcc/soft-fp/fixtdti.c
@@ -1,7 +1,7 @@
/* Software floating-point emulation.
Convert _Decimal128 to 128bit signed integer.
- Copyright (C) 2023 Free Software Foundation, Inc.
+ Copyright (C) 2023-2025 Free Software Foundation, Inc.
This file is part of GCC.
@@ -28,6 +28,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "bitint.h"
#if defined(__BITINT_MAXWIDTH__) && defined(__SIZEOF_INT128__)
+#ifndef ENABLE_DECIMAL_BID_FORMAT
+#define __bid_fixtdbitint __dpd_fixtdbitint
+#define __bid_fixtdti __dpd_fixtdti
+#endif
extern void __bid_fixtdbitint (UBILtype *, SItype, _Decimal128);
extern TItype __bid_fixtdti (_Decimal128);
diff --git a/libgcc/soft-fp/fixunsddti.c b/libgcc/soft-fp/fixunsddti.c
index 7551e00..b7a4a80 100644
--- a/libgcc/soft-fp/fixunsddti.c
+++ b/libgcc/soft-fp/fixunsddti.c
@@ -1,7 +1,7 @@
/* Software floating-point emulation.
Convert _Decimal64 to 128bit unsigned integer.
- Copyright (C) 2023 Free Software Foundation, Inc.
+ Copyright (C) 2023-2025 Free Software Foundation, Inc.
This file is part of GCC.
@@ -28,6 +28,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "bitint.h"
#if defined(__BITINT_MAXWIDTH__) && defined(__SIZEOF_INT128__)
+#ifndef ENABLE_DECIMAL_BID_FORMAT
+#define __bid_fixddbitint __dpd_fixddbitint
+#define __bid_fixunsddti __dpd_fixunsddti
+#endif
extern void __bid_fixddbitint (UBILtype *, SItype, _Decimal64);
extern UTItype __bid_fixunsddti (_Decimal64);
diff --git a/libgcc/soft-fp/fixunssdti.c b/libgcc/soft-fp/fixunssdti.c
index 8d71b2c..3425c29 100644
--- a/libgcc/soft-fp/fixunssdti.c
+++ b/libgcc/soft-fp/fixunssdti.c
@@ -1,7 +1,7 @@
/* Software floating-point emulation.
Convert _Decimal32 to 128bit unsigned integer.
- Copyright (C) 2023 Free Software Foundation, Inc.
+ Copyright (C) 2023-2025 Free Software Foundation, Inc.
This file is part of GCC.
@@ -28,6 +28,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "bitint.h"
#if defined(__BITINT_MAXWIDTH__) && defined(__SIZEOF_INT128__)
+#ifndef ENABLE_DECIMAL_BID_FORMAT
+#define __bid_fixsdbitint __dpd_fixsdbitint
+#define __bid_fixunssdti __dpd_fixunssdti
+#endif
extern void __bid_fixsdbitint (UBILtype *, SItype, _Decimal32);
extern UTItype __bid_fixunssdti (_Decimal32);
diff --git a/libgcc/soft-fp/fixunstdti.c b/libgcc/soft-fp/fixunstdti.c
index 41ae974..d63ec2b 100644
--- a/libgcc/soft-fp/fixunstdti.c
+++ b/libgcc/soft-fp/fixunstdti.c
@@ -1,7 +1,7 @@
/* Software floating-point emulation.
Convert _Decimal128 to 128bit unsigned integer.
- Copyright (C) 2023 Free Software Foundation, Inc.
+ Copyright (C) 2023-2025 Free Software Foundation, Inc.
This file is part of GCC.
@@ -28,6 +28,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "bitint.h"
#if defined(__BITINT_MAXWIDTH__) && defined(__SIZEOF_INT128__)
+#ifndef ENABLE_DECIMAL_BID_FORMAT
+#define __bid_fixtdbitint __dpd_fixtdbitint
+#define __bid_fixunstdti __dpd_fixunstdti
+#endif
extern void __bid_fixtdbitint (UBILtype *, SItype, _Decimal128);
extern UTItype __bid_fixunstdti (_Decimal128);
diff --git a/libgcc/soft-fp/floatbitintdd.c b/libgcc/soft-fp/floatbitintdd.c
index 4565572..0547bb5 100644
--- a/libgcc/soft-fp/floatbitintdd.c
+++ b/libgcc/soft-fp/floatbitintdd.c
@@ -1,7 +1,7 @@
/* Software floating-point emulation.
Convert a _BitInt to _Decimal64.
- Copyright (C) 2023 Free Software Foundation, Inc.
+ Copyright (C) 2023-2025 Free Software Foundation, Inc.
This file is part of GCC.
@@ -28,6 +28,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "bitint.h"
#ifdef __BITINT_MAXWIDTH__
+#ifndef ENABLE_DECIMAL_BID_FORMAT
+#define __bid_floatbitintdd __dpd_floatbitintdd
+#endif
extern _Decimal64 __bid_floatbitintdd (const UBILtype *, SItype);
_Decimal64
@@ -51,7 +54,11 @@ __bid_floatbitintdd (const UBILtype *i, SItype iprec)
}
if (iprec < 0)
{
- SItype n = sizeof (0ULL) * __CHAR_BIT__ + 1 - __builtin_clzll (~msb);
+ SItype n;
+ if (msb == ~(UBILtype) 0)
+ n = 1;
+ else
+ n = sizeof (0ULL) * __CHAR_BIT__ + 1 - __builtin_clzll (~msb);
aiprec = (in - 1) * BIL_TYPE_SIZE + n;
}
else if (msb == 0)
@@ -118,7 +125,8 @@ __bid_floatbitintdd (const UBILtype *i, SItype iprec)
}
else
{
- __builtin_memcpy (buf + BITINT_END (q_limbs - in + 1, 0), i,
+ __builtin_memcpy (buf + BITINT_END (q_limbs - in + 1, 0),
+ i + BITINT_END (1, 0),
(in - 1) * sizeof (UBILtype));
buf[BITINT_END (q_limbs - in, in - 1)] = msb;
if (iprec < 0)
@@ -239,6 +247,7 @@ __bid_floatbitintdd (const UBILtype *i, SItype iprec)
}
exponent += 398;
+#ifdef ENABLE_DECIMAL_BID_FORMAT
if (mantissa >= (UDItype) 0x20000000000000)
u.u = (((((iprec < 0) << 2) | (UDItype) 3) << 61)
| (((UDItype) exponent) << 51)
@@ -247,10 +256,40 @@ __bid_floatbitintdd (const UBILtype *i, SItype iprec)
u.u = ((((UDItype) (iprec < 0)) << 63)
| (((UDItype) exponent) << 53)
| mantissa);
+#else
+ u.u = mantissa;
+ mantissa = __dpd_b2dbitint[u.u % 1000];
+ u.u /= 1000;
+ mantissa |= ((UDItype) __dpd_b2dbitint[u.u % 1000]) << 10;
+ u.u /= 1000;
+ mantissa |= ((UDItype) __dpd_b2dbitint[u.u % 1000]) << 20;
+ u.u /= 1000;
+ mantissa |= ((UDItype) __dpd_b2dbitint[u.u % 1000]) << 30;
+ u.u /= 1000;
+ mantissa |= ((UDItype) __dpd_b2dbitint[u.u % 1000]) << 40;
+ u.u /= 1000;
+ if (u.u >= 8)
+ u.u = (((((iprec < 0) << 2) | (UDItype) 3) << 61)
+ | (((UDItype) exponent & (3 << 8)) << 51)
+ | ((u.u & 1) << 58)
+ | (((UDItype) exponent & 255) << 50)
+ | mantissa);
+ else
+ u.u = ((((UDItype) (iprec < 0)) << 63)
+ | (((UDItype) exponent & (3 << 8)) << 53)
+ | (u.u << 58)
+ | (((UDItype) exponent & 255) << 50)
+ | mantissa);
+#endif
if (inexact)
{
ui.u = ((((UDItype) (iprec < 0)) << 63)
+#ifdef ENABLE_DECIMAL_BID_FORMAT
| (((UDItype) (exponent - 1)) << 53)
+#else
+ | (((UDItype) (exponent - 1) & (3 << 8)) << 53)
+ | (((UDItype) (exponent - 1) & 255) << 50)
+#endif
| (inexact + 3));
__asm ("" : "+g" (u.d));
__asm ("" : "+g" (ui.d));
diff --git a/libgcc/soft-fp/floatbitintsd.c b/libgcc/soft-fp/floatbitintsd.c
index 4901aa8..915f46c 100644
--- a/libgcc/soft-fp/floatbitintsd.c
+++ b/libgcc/soft-fp/floatbitintsd.c
@@ -1,7 +1,7 @@
/* Software floating-point emulation.
Convert a _BitInt to _Decimal32.
- Copyright (C) 2023 Free Software Foundation, Inc.
+ Copyright (C) 2023-2025 Free Software Foundation, Inc.
This file is part of GCC.
@@ -28,6 +28,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "bitint.h"
#ifdef __BITINT_MAXWIDTH__
+#ifndef ENABLE_DECIMAL_BID_FORMAT
+#define __bid_floatbitintsd __dpd_floatbitintsd
+#endif
extern _Decimal32 __bid_floatbitintsd (const UBILtype *, SItype);
_Decimal32
@@ -51,7 +54,11 @@ __bid_floatbitintsd (const UBILtype *i, SItype iprec)
}
if (iprec < 0)
{
- SItype n = sizeof (0ULL) * __CHAR_BIT__ + 1 - __builtin_clzll (~msb);
+ SItype n;
+ if (msb == ~(UBILtype) 0)
+ n = 1;
+ else
+ n = sizeof (0ULL) * __CHAR_BIT__ + 1 - __builtin_clzll (~msb);
aiprec = (in - 1) * BIL_TYPE_SIZE + n;
}
else if (msb == 0)
@@ -117,7 +124,8 @@ __bid_floatbitintsd (const UBILtype *i, SItype iprec)
}
else
{
- __builtin_memcpy (buf + BITINT_END (q_limbs - in + 1, 0), i,
+ __builtin_memcpy (buf + BITINT_END (q_limbs - in + 1, 0),
+ i + BITINT_END (1, 0),
(in - 1) * sizeof (UBILtype));
buf[BITINT_END (q_limbs - in, in - 1)] = msb;
if (iprec < 0)
@@ -210,6 +218,7 @@ __bid_floatbitintsd (const UBILtype *i, SItype iprec)
}
exponent += 101;
+#ifdef ENABLE_DECIMAL_BID_FORMAT
if (mantissa >= (USItype) 0x800000)
u.u = (((((iprec < 0) << 2) | (USItype) 3) << 29)
| (((USItype) exponent) << 21)
@@ -218,10 +227,34 @@ __bid_floatbitintsd (const UBILtype *i, SItype iprec)
u.u = ((((USItype) (iprec < 0)) << 31)
| (((USItype) exponent) << 23)
| mantissa);
+#else
+ u.u = mantissa;
+ mantissa = __dpd_b2dbitint[u.u % 1000];
+ u.u /= 1000;
+ mantissa |= ((USItype) __dpd_b2dbitint[u.u % 1000]) << 10;
+ u.u /= 1000;
+ if (u.u >= 8)
+ u.u = (((((iprec < 0) << 2) | (USItype) 3) << 29)
+ | (((USItype) exponent & (3 << 6)) << 21)
+ | ((u.u & 1) << 26)
+ | (((USItype) exponent & 63) << 20)
+ | mantissa);
+ else
+ u.u = ((((USItype) (iprec < 0)) << 31)
+ | (((USItype) exponent & (3 << 6)) << 23)
+ | (u.u << 26)
+ | (((USItype) exponent & 63) << 20)
+ | mantissa);
+#endif
if (inexact)
{
ui.u = ((((USItype) (iprec < 0)) << 31)
+#ifdef ENABLE_DECIMAL_BID_FORMAT
| (((USItype) (exponent - 1)) << 23)
+#else
+ | (((USItype) (exponent - 1) & (3 << 6)) << 23)
+ | (((USItype) (exponent - 1) & 63) << 20)
+#endif
| (inexact + 3));
__asm ("" : "+g" (u.d));
__asm ("" : "+g" (ui.d));
diff --git a/libgcc/soft-fp/floatbitinttd.c b/libgcc/soft-fp/floatbitinttd.c
index 5fff339..50b9e77 100644
--- a/libgcc/soft-fp/floatbitinttd.c
+++ b/libgcc/soft-fp/floatbitinttd.c
@@ -1,7 +1,7 @@
/* Software floating-point emulation.
Convert a _BitInt to _Decimal128.
- Copyright (C) 2023 Free Software Foundation, Inc.
+ Copyright (C) 2023-2025 Free Software Foundation, Inc.
This file is part of GCC.
@@ -28,6 +28,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "bitint.h"
#ifdef __BITINT_MAXWIDTH__
+#ifndef ENABLE_DECIMAL_BID_FORMAT
+#define __bid_floatbitinttd __dpd_floatbitinttd
+#endif
extern _Decimal128 __bid_floatbitinttd (const UBILtype *, SItype);
_Decimal128
@@ -51,7 +54,11 @@ __bid_floatbitinttd (const UBILtype *i, SItype iprec)
}
if (iprec < 0)
{
- SItype n = sizeof (0ULL) * __CHAR_BIT__ + 1 - __builtin_clzll (~msb);
+ SItype n;
+ if (msb == ~(UBILtype) 0)
+ n = 1;
+ else
+ n = sizeof (0ULL) * __CHAR_BIT__ + 1 - __builtin_clzll (~msb);
aiprec = (in - 1) * BIL_TYPE_SIZE + n;
}
else if (msb == 0)
@@ -117,7 +124,8 @@ __bid_floatbitinttd (const UBILtype *i, SItype iprec)
}
else
{
- __builtin_memcpy (buf + BITINT_END (q_limbs - in + 1, 0), i,
+ __builtin_memcpy (buf + BITINT_END (q_limbs - in + 1, 0),
+ i + BITINT_END (1, 0),
(in - 1) * sizeof (UBILtype));
buf[BITINT_END (q_limbs - in, in - 1)] = msb;
if (iprec < 0)
@@ -253,15 +261,69 @@ __bid_floatbitinttd (const UBILtype *i, SItype iprec)
}
exponent += 6176;
+#ifdef ENABLE_DECIMAL_BID_FORMAT
u.u[__FLOAT_WORD_ORDER__ != __ORDER_BIG_ENDIAN__]
= ((((UDItype) (iprec < 0)) << 63)
| (((UDItype) exponent) << 49)
| mantissahi);
+#else
+#ifdef __SIZEOF_INT128__
+ unsigned __int128 m = mantissahi;
+#else
+ unsigned _BitInt(128) m = mantissahi;
+#endif
+ m = (m << 64) | mantissalo;
+ u.u[0] = m / 1000000000000000ULL;
+ u.u[1] = m % 1000000000000000ULL;
+ mantissalo = __dpd_b2dbitint[u.u[1] % 1000];
+ u.u[1] /= 1000;
+ mantissalo |= ((UDItype) __dpd_b2dbitint[u.u[1] % 1000]) << 10;
+ u.u[1] /= 1000;
+ mantissalo |= ((UDItype) __dpd_b2dbitint[u.u[1] % 1000]) << 20;
+ u.u[1] /= 1000;
+ mantissalo |= ((UDItype) __dpd_b2dbitint[u.u[1] % 1000]) << 30;
+ u.u[1] /= 1000;
+ mantissalo |= ((UDItype) __dpd_b2dbitint[u.u[1] % 1000]) << 40;
+ mantissalo |= ((UDItype) __dpd_b2dbitint[u.u[0] % 1000]) << 50;
+ u.u[0] /= 1000;
+ mantissahi = __dpd_b2dbitint[u.u[0] % 1000];
+ u.u[0] /= 1000;
+ mantissalo |= mantissahi << 60;
+ mantissahi >>= 4;
+ mantissahi |= ((UDItype) __dpd_b2dbitint[u.u[0] % 1000]) << 6;
+ u.u[0] /= 1000;
+ mantissahi |= ((UDItype) __dpd_b2dbitint[u.u[0] % 1000]) << 16;
+ u.u[0] /= 1000;
+ mantissahi |= ((UDItype) __dpd_b2dbitint[u.u[0] % 1000]) << 26;
+ u.u[0] /= 1000;
+ mantissahi |= ((UDItype) __dpd_b2dbitint[u.u[0] % 1000]) << 36;
+ u.u[0] /= 1000;
+ if (u.u[0] >= 8)
+ u.u[__FLOAT_WORD_ORDER__ != __ORDER_BIG_ENDIAN__]
+ = (((((iprec < 0) << 2) | (UDItype) 3) << 61)
+ | (((UDItype) exponent & (3 << 12)) << 47)
+ | ((u.u[0] & 1) << 58)
+ | (((UDItype) exponent & 4095) << 46)
+ | mantissahi);
+ else
+ u.u[__FLOAT_WORD_ORDER__ != __ORDER_BIG_ENDIAN__]
+ = ((((UDItype) (iprec < 0)) << 63)
+ | (((UDItype) exponent & (3 << 12)) << 49)
+ | (u.u[0] << 58)
+ | (((UDItype) exponent & 4095) << 46)
+ | mantissahi);
+#endif
u.u[__FLOAT_WORD_ORDER__ == __ORDER_BIG_ENDIAN__] = mantissalo;
if (inexact)
{
ui.u[__FLOAT_WORD_ORDER__ != __ORDER_BIG_ENDIAN__]
+#ifdef ENABLE_DECIMAL_BID_FORMAT
= (((UDItype) (iprec < 0)) << 63) | (((UDItype) exponent - 1) << 49);
+#else
+ = ((((UDItype) (iprec < 0)) << 63)
+ | ((((UDItype) exponent - 1) & (3 << 12)) << 49)
+ | ((((UDItype) exponent - 1) & 4095) << 46));
+#endif
ui.u[__FLOAT_WORD_ORDER__ == __ORDER_BIG_ENDIAN__] = inexact + 3;
__asm ("" : "+g" (u.d));
__asm ("" : "+g" (ui.d));
diff --git a/libgcc/soft-fp/floattidd.c b/libgcc/soft-fp/floattidd.c
index 31ad9d0..c4e569d 100644
--- a/libgcc/soft-fp/floattidd.c
+++ b/libgcc/soft-fp/floattidd.c
@@ -1,7 +1,7 @@
/* Software floating-point emulation.
Convert a 128bit signed integer to _Decimal64.
- Copyright (C) 2023 Free Software Foundation, Inc.
+ Copyright (C) 2023-2025 Free Software Foundation, Inc.
This file is part of GCC.
@@ -28,6 +28,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "bitint.h"
#if defined(__BITINT_MAXWIDTH__) && defined(__SIZEOF_INT128__)
+#ifndef ENABLE_DECIMAL_BID_FORMAT
+#define __bid_floatbitintdd __dpd_floatbitintdd
+#define __bid_floattidd __dpd_floattidd
+#endif
extern _Decimal64 __bid_floatbitintdd (const UBILtype *, SItype);
extern _Decimal64 __bid_floattidd (TItype);
diff --git a/libgcc/soft-fp/floattisd.c b/libgcc/soft-fp/floattisd.c
index 37a24a3..641c32a 100644
--- a/libgcc/soft-fp/floattisd.c
+++ b/libgcc/soft-fp/floattisd.c
@@ -1,7 +1,7 @@
/* Software floating-point emulation.
Convert a 128bit signed integer to _Decimal32.
- Copyright (C) 2023 Free Software Foundation, Inc.
+ Copyright (C) 2023-2025 Free Software Foundation, Inc.
This file is part of GCC.
@@ -28,6 +28,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "bitint.h"
#if defined(__BITINT_MAXWIDTH__) && defined(__SIZEOF_INT128__)
+#ifndef ENABLE_DECIMAL_BID_FORMAT
+#define __bid_floatbitintsd __dpd_floatbitintsd
+#define __bid_floattisd __dpd_floattisd
+#endif
extern _Decimal32 __bid_floatbitintsd (const UBILtype *, SItype);
extern _Decimal32 __bid_floattisd (TItype);
diff --git a/libgcc/soft-fp/floattitd.c b/libgcc/soft-fp/floattitd.c
index edc0b37..9d10ed7 100644
--- a/libgcc/soft-fp/floattitd.c
+++ b/libgcc/soft-fp/floattitd.c
@@ -1,7 +1,7 @@
/* Software floating-point emulation.
Convert a 128bit signed integer to _Decimal128.
- Copyright (C) 2023 Free Software Foundation, Inc.
+ Copyright (C) 2023-2025 Free Software Foundation, Inc.
This file is part of GCC.
@@ -28,6 +28,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "bitint.h"
#if defined(__BITINT_MAXWIDTH__) && defined(__SIZEOF_INT128__)
+#ifndef ENABLE_DECIMAL_BID_FORMAT
+#define __bid_floatbitinttd __dpd_floatbitinttd
+#define __bid_floattitd __dpd_floattitd
+#endif
extern _Decimal128 __bid_floatbitinttd (const UBILtype *, SItype);
extern _Decimal128 __bid_floattitd (TItype);
diff --git a/libgcc/soft-fp/floatuntidd.c b/libgcc/soft-fp/floatuntidd.c
index ea4108f..f977400 100644
--- a/libgcc/soft-fp/floatuntidd.c
+++ b/libgcc/soft-fp/floatuntidd.c
@@ -1,7 +1,7 @@
/* Software floating-point emulation.
Convert a 128bit unsigned integer to _Decimal64.
- Copyright (C) 2023 Free Software Foundation, Inc.
+ Copyright (C) 2023-2025 Free Software Foundation, Inc.
This file is part of GCC.
@@ -28,6 +28,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "bitint.h"
#if defined(__BITINT_MAXWIDTH__) && defined(__SIZEOF_INT128__)
+#ifndef ENABLE_DECIMAL_BID_FORMAT
+#define __bid_floatbitintdd __dpd_floatbitintdd
+#define __bid_floatunstidd __dpd_floatunstidd
+#endif
extern _Decimal64 __bid_floatbitintdd (const UBILtype *, SItype);
extern _Decimal64 __bid_floatunstidd (UTItype);
diff --git a/libgcc/soft-fp/floatuntisd.c b/libgcc/soft-fp/floatuntisd.c
index d907353e..cc00d83 100644
--- a/libgcc/soft-fp/floatuntisd.c
+++ b/libgcc/soft-fp/floatuntisd.c
@@ -1,7 +1,7 @@
/* Software floating-point emulation.
Convert a 128bit unsigned integer to _Decimal32.
- Copyright (C) 2023 Free Software Foundation, Inc.
+ Copyright (C) 2023-2025 Free Software Foundation, Inc.
This file is part of GCC.
@@ -28,6 +28,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "bitint.h"
#if defined(__BITINT_MAXWIDTH__) && defined(__SIZEOF_INT128__)
+#ifndef ENABLE_DECIMAL_BID_FORMAT
+#define __bid_floatbitintsd __dpd_floatbitintsd
+#define __bid_floatunstisd __dpd_floatunstisd
+#endif
extern _Decimal32 __bid_floatbitintsd (const UBILtype *, SItype);
extern _Decimal32 __bid_floatunstisd (UTItype);
diff --git a/libgcc/soft-fp/floatuntitd.c b/libgcc/soft-fp/floatuntitd.c
index 5731f2a..551166e 100644
--- a/libgcc/soft-fp/floatuntitd.c
+++ b/libgcc/soft-fp/floatuntitd.c
@@ -1,7 +1,7 @@
/* Software floating-point emulation.
Convert a 128bit unsigned integer to _Decimal128.
- Copyright (C) 2023 Free Software Foundation, Inc.
+ Copyright (C) 2023-2025 Free Software Foundation, Inc.
This file is part of GCC.
@@ -28,6 +28,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "bitint.h"
#if defined(__BITINT_MAXWIDTH__) && defined(__SIZEOF_INT128__)
+#ifndef ENABLE_DECIMAL_BID_FORMAT
+#define __bid_floatbitinttd __dpd_floatbitinttd
+#define __bid_floatunstitd __dpd_floatunstitd
+#endif
extern _Decimal128 __bid_floatbitinttd (const UBILtype *, SItype);
extern _Decimal128 __bid_floatunstitd (UTItype);