public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/meissner/heads/work093)] Make _round_to_odd functions overloaded.
@ 2022-06-30 15:21 Michael Meissner
0 siblings, 0 replies; only message in thread
From: Michael Meissner @ 2022-06-30 15:21 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:6f3e5235300c42dbf27ded35c078f57f33715290
commit 6f3e5235300c42dbf27ded35c078f57f33715290
Author: Michael Meissner <meissner@linux.ibm.com>
Date: Thu Jun 30 11:20:55 2022 -0400
Make _round_to_odd functions overloaded.
2022-06-30 Michael Meissner <meissner@linux.ibm.com>
gcc/
* config/rs6000/rs6000-builtin.cc (rs6000_expand_builtin): Remove
converting KFmode round to odd built-in functions to TFmode round
to odd built-in functions when long double is IEEE 128-bit.
* config/rs6000/rs6000-builtins.def
(__builtin_addf128_round_to_odd_kf): Rename KFmode round to odd
built-in functions with a KF suffix to allow overloading.
(__builtin_divf128_round_to_odd_kf): Likewise.
(__builtin_fmaf128_round_to_odd_kf): Likewise.
(__builtin_mulf128_round_to_odd_kf): Likewise.
(__builtin_sqrtf128_round_to_odd_kf): Likewise.
(__builtin_subf128_round_to_odd_kf): Likewise.
(__builtin_truncf128_round_to_odd_kf): Likewise.
(__builtin_addf128_round_to_odd_tf): Add TFmode round to odd
built-in functions.
(__builtin_fmaf128_round_to_odd_tf): Likewise.
(__builtin_mulf128_round_to_odd_tf): Likewise.
(__builtin_sqrtf128_round_to_odd_tf): Likewise.
(__builtin_subf128_round_to_odd_tf): Likewise.
(__builtin_truncf128_round_to_odd_tf): Likewise.
* config/rs6000/rs6000-overload.def
(__builtin_addf128_round_to_odd): Make round to odd built-in
functions overloaded.
(__builtin_divf128_round_to_odd): Likewise.
(__builtin_fmaf128_round_to_odd): Likewise.
(__builtin_mulf128_round_to_odd): Likewise.
(__builtin_sqrtf128_round_to_odd): Likewise.
(__builtin_subf128_round_to_odd): Likewise.
(__builtin_truncf128_round_to_odd): Likewise.
Diff:
---
gcc/config/rs6000/rs6000-builtin.cc | 21 -------------
gcc/config/rs6000/rs6000-builtins.def | 58 ++++++++++++++++++++++++++---------
gcc/config/rs6000/rs6000-overload.def | 44 ++++++++++++++++++++++++++
3 files changed, 87 insertions(+), 36 deletions(-)
diff --git a/gcc/config/rs6000/rs6000-builtin.cc b/gcc/config/rs6000/rs6000-builtin.cc
index aac123fbf9e..2e346d24db6 100644
--- a/gcc/config/rs6000/rs6000-builtin.cc
+++ b/gcc/config/rs6000/rs6000-builtin.cc
@@ -3318,27 +3318,6 @@ rs6000_expand_builtin (tree exp, rtx target, rtx /* subtarget */,
if (FLOAT128_IEEE_P (TFmode))
switch (icode)
{
- case CODE_FOR_sqrtkf2_odd:
- icode = CODE_FOR_sqrttf2_odd;
- break;
- case CODE_FOR_trunckfdf2_odd:
- icode = CODE_FOR_trunctfdf2_odd;
- break;
- case CODE_FOR_addkf3_odd:
- icode = CODE_FOR_addtf3_odd;
- break;
- case CODE_FOR_subkf3_odd:
- icode = CODE_FOR_subtf3_odd;
- break;
- case CODE_FOR_mulkf3_odd:
- icode = CODE_FOR_multf3_odd;
- break;
- case CODE_FOR_divkf3_odd:
- icode = CODE_FOR_divtf3_odd;
- break;
- case CODE_FOR_fmakf4_odd:
- icode = CODE_FOR_fmatf4_odd;
- break;
case CODE_FOR_xsxexpqp_kf:
icode = CODE_FOR_xsxexpqp_tf;
break;
diff --git a/gcc/config/rs6000/rs6000-builtins.def b/gcc/config/rs6000/rs6000-builtins.def
index defd7e25ffe..d72ff8cb7fe 100644
--- a/gcc/config/rs6000/rs6000-builtins.def
+++ b/gcc/config/rs6000/rs6000-builtins.def
@@ -2867,18 +2867,18 @@
; Builtins requiring hardware support for IEEE-128 floating-point.
[ieee128-hw]
- fpmath _Float128 __builtin_addf128_round_to_odd (_Float128, _Float128);
- ADDF128_ODD addkf3_odd {}
+ fpmath _Float128 __builtin_addf128_round_to_odd_kf (_Float128, _Float128);
+ ADDF128_ODD_KF addkf3_odd {}
- fpmath _Float128 __builtin_divf128_round_to_odd (_Float128, _Float128);
- DIVF128_ODD divkf3_odd {}
+ fpmath _Float128 __builtin_divf128_round_to_odd_kf (_Float128, _Float128);
+ DIVF128_ODD_KF divkf3_odd {}
- fpmath _Float128 __builtin_fmaf128_round_to_odd (_Float128, _Float128, \
- _Float128);
- FMAF128_ODD fmakf4_odd {}
+ fpmath _Float128 __builtin_fmaf128_round_to_odd_kf (_Float128, _Float128, \
+ _Float128);
+ FMAF128_ODD_KF fmakf4_odd {}
- fpmath _Float128 __builtin_mulf128_round_to_odd (_Float128, _Float128);
- MULF128_ODD mulkf3_odd {}
+ fpmath _Float128 __builtin_mulf128_round_to_odd_kf (_Float128, _Float128);
+ MULF128_ODD_KF mulkf3_odd {}
const signed int __builtin_vsx_scalar_cmp_exp_qp_eq (_Float128, _Float128);
VSCEQPEQ xscmpexpqp_eq_kf {}
@@ -2893,14 +2893,14 @@
__builtin_vsx_scalar_cmp_exp_qp_unordered (_Float128, _Float128);
VSCEQPUO xscmpexpqp_unordered_kf {}
- fpmath _Float128 __builtin_sqrtf128_round_to_odd (_Float128);
- SQRTF128_ODD sqrtkf2_odd {}
+ fpmath _Float128 __builtin_sqrtf128_round_to_odd_kf (_Float128);
+ SQRTF128_ODD_KF sqrtkf2_odd {}
- fpmath _Float128 __builtin_subf128_round_to_odd (_Float128, _Float128);
- SUBF128_ODD subkf3_odd {}
+ fpmath _Float128 __builtin_subf128_round_to_odd_kf (_Float128, _Float128);
+ SUBF128_ODD_KF subkf3_odd {}
- fpmath double __builtin_truncf128_round_to_odd (_Float128);
- TRUNCF128_ODD trunckfdf2_odd {}
+ fpmath double __builtin_truncf128_round_to_odd_kf (_Float128);
+ TRUNCF128_ODD_KF trunckfdf2_odd {}
const signed long long __builtin_vsx_scalar_extract_expq (_Float128);
VSEEQP xsxexpqp_kf {}
@@ -2924,6 +2924,34 @@
VSTDCNQP xststdcnegqp_kf {}
+; Builtins requiring hardware support for IEEE-128 floating-point. Long double
+; must use the IEEE 128-bit encoding.
+[ieee128-hw-ld]
+ fpmath long double __builtin_addf128_round_to_odd_tf (long double, long double);
+ ADDF128_ODD_TF addtf3_odd {ieeeld}
+
+ fpmath long double __builtin_divf128_round_to_odd_tf (long double,long double);
+ DIVF128_ODD_TF divtf3_odd {ieeeld}
+
+ fpmath long double __builtin_fmaf128_round_to_odd_tf (long double, \
+ long double, \
+ long double);
+ FMAF128_ODD_TF fmatf4_odd {ieeeld}
+
+ fpmath long double __builtin_mulf128_round_to_odd_tf (long double, \
+ long double);
+ MULF128_ODD_TF multf3_odd {ieeeld}
+
+ fpmath long double __builtin_sqrtf128_round_to_odd_tf (long double);
+ SQRTF128_ODD_TF sqrttf2_odd {ieeeld}
+
+ fpmath long double __builtin_subf128_round_to_odd_tf (long double, \
+ long double);
+ SUBF128_ODD_TF subtf3_odd {ieeeld}
+
+ fpmath double __builtin_truncf128_round_to_odd_tf (long double);
+ TRUNCF128_ODD_TF trunctfdf2_odd {ieeeld}
+
; Decimal floating-point builtins.
[dfp]
diff --git a/gcc/config/rs6000/rs6000-overload.def b/gcc/config/rs6000/rs6000-overload.def
index 44e2945aaa0..f406a16a882 100644
--- a/gcc/config/rs6000/rs6000-overload.def
+++ b/gcc/config/rs6000/rs6000-overload.def
@@ -6175,3 +6175,47 @@
VUPKLSW VUPKLSW_DEPR1
vbll __builtin_vec_vupklsw (vbi);
VUPKLSW VUPKLSW_DEPR2
+
+[ADDF128_ODD, SKIP, __builtin_addf128_round_to_odd]
+ long double __builtin_addf128_round_to_odd (long double, long double);
+ ADDF128_ODD_TF
+ _Float128 __builtin_addf128_round_to_odd (_Float128, _Float128);
+ ADDF128_ODD_KF
+
+[DIVF128_ODD, SKIP, __builtin_divf128_round_to_odd]
+ long double __builtin_divf128_round_to_odd (long double, long double);
+ DIVF128_ODD_TF
+ _Float128 __builtin_divf128_round_to_odd (_Float128, _Float128);
+ DIVF128_ODD_KF
+
+[FMAF128_ODD, SKIP, __builtin_fmaf128_round_to_odd]
+ long double __builtin_fmaf128_round_to_odd (long double, long double, \
+ long double);
+ FMAF128_ODD_TF
+ _Float128 __builtin_fmaf128_round_to_odd (_Float128, _Float128, \
+ _Float128);
+ FMAF128_ODD_KF
+
+[MULF128_ODD, SKIP, __builtin_mulf128_round_to_odd]
+ long double __builtin_mulf128_round_to_odd (long double, long double);
+ MULF128_ODD_TF
+ _Float128 __builtin_mulf128_round_to_odd (_Float128, _Float128);
+ MULF128_ODD_KF
+
+[SQRTF128_ODD, SKIP, __builtin_sqrtf128_round_to_odd]
+ long double __builtin_sqrtf128_round_to_odd (long double);
+ SQRTF128_ODD_TF
+ _Float128 __builtin_sqrtf128_round_to_odd (_Float128);
+ SQRTF128_ODD_KF
+
+[SUBF128_ODD, SKIP, __builtin_subf128_round_to_odd]
+ long double __builtin_subf128_round_to_odd (long double, long double);
+ SUBF128_ODD_TF
+ _Float128 __builtin_subf128_round_to_odd (_Float128, _Float128);
+ SUBF128_ODD_KF
+
+[TRUNCF128_ODD, SKIP, __builtin_truncf128_round_to_odd]
+ long double __builtin_truncf128_round_to_odd (long double);
+ TRUNCF128_ODD_TF
+ _Float128 __builtin_truncf128_round_to_odd (_Float128);
+ TRUNCF128_ODD_KF
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-06-30 15:21 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-30 15:21 [gcc(refs/users/meissner/heads/work093)] Make _round_to_odd functions overloaded Michael Meissner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).