* [PATCH 2/3] [x86] implement TARGET_MODE_CAN_TRANSFER_BITS
@ 2024-07-29 12:14 Richard Biener
0 siblings, 0 replies; 4+ messages in thread
From: Richard Biener @ 2024-07-29 12:14 UTC (permalink / raw)
To: gcc-patches; +Cc: Jan Hubicka, ubizjak
The following implements the hook, excluding x87 modes.
* i386.cc (TARGET_MODE_CAN_TRANSFER_BITS): Define.
(ix86_mode_can_transfer_bits): New function.
---
gcc/config/i386/i386.cc | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/gcc/config/i386/i386.cc b/gcc/config/i386/i386.cc
index 12d15feb5e9..584417992a0 100644
--- a/gcc/config/i386/i386.cc
+++ b/gcc/config/i386/i386.cc
@@ -26113,6 +26113,14 @@ ix86_have_ccmp ()
return (bool) TARGET_APX_CCMP;
}
+/* Implement TARGET_MODE_CAN_TRANSFER_BITS. */
+static bool
+ix86_mode_can_transfer_bits (machine_mode mode)
+{
+ return (!SCALAR_FLOAT_MODE_P (mode)
+ || (TARGET_SSE_MATH && !TARGET_MIX_SSE_I387 && mode != XFmode));
+}
+
/* Target-specific selftests. */
#if CHECKING_P
@@ -26959,6 +26967,9 @@ ix86_libgcc_floating_mode_supported_p
#undef TARGET_HAVE_CCMP
#define TARGET_HAVE_CCMP ix86_have_ccmp
+#undef TARGET_MODE_CAN_TRANSFER_BITS
+#define TARGET_MODE_CAN_TRANSFER_BITS ix86_mode_can_transfer_bits
+
static bool
ix86_libc_has_fast_function (int fcode ATTRIBUTE_UNUSED)
{
--
2.35.3
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2/3] [x86] implement TARGET_MODE_CAN_TRANSFER_BITS
[not found] <66aa3eb6.050a0220.28fa5.bb8cSMTPIN_ADDED_MISSING@mx.google.com>
@ 2024-07-31 15:50 ` Uros Bizjak
0 siblings, 0 replies; 4+ messages in thread
From: Uros Bizjak @ 2024-07-31 15:50 UTC (permalink / raw)
To: Richard Biener; +Cc: gcc-patches
On Wed, Jul 31, 2024 at 3:40 PM Richard Biener <rguenther@suse.de> wrote:
>
> The following implements the hook, excluding x87 modes for scalar
> and complex float modes.
>
> Bootstrapped and tested on x86_64-unknown-linux-gnu.
>
> OK this way?
>
> Thanks,
> Richard.
>
> * i386.cc (TARGET_MODE_CAN_TRANSFER_BITS): Define.
> (ix86_mode_can_transfer_bits): New function.
OK.
Thanks for your efforts and your patience to resolve this issue!
Uros.
> ---
> gcc/config/i386/i386.cc | 22 ++++++++++++++++++++++
> 1 file changed, 22 insertions(+)
>
> diff --git a/gcc/config/i386/i386.cc b/gcc/config/i386/i386.cc
> index 12d15feb5e9..9869c44ee15 100644
> --- a/gcc/config/i386/i386.cc
> +++ b/gcc/config/i386/i386.cc
> @@ -26113,6 +26113,25 @@ ix86_have_ccmp ()
> return (bool) TARGET_APX_CCMP;
> }
>
> +/* Implement TARGET_MODE_CAN_TRANSFER_BITS. */
> +static bool
> +ix86_mode_can_transfer_bits (machine_mode mode)
> +{
> + if (GET_MODE_CLASS (mode) == MODE_FLOAT
> + || GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT)
> + switch (GET_MODE_INNER (mode))
> + {
> + case SFmode:
> + case DFmode:
> + /* These suffer from normalization upon load when not using SSE. */
> + return !(ix86_fpmath & FPMATH_387);
> + default:
> + return true;
> + }
> +
> + return true;
> +}
> +
> /* Target-specific selftests. */
>
> #if CHECKING_P
> @@ -26959,6 +26978,9 @@ ix86_libgcc_floating_mode_supported_p
> #undef TARGET_HAVE_CCMP
> #define TARGET_HAVE_CCMP ix86_have_ccmp
>
> +#undef TARGET_MODE_CAN_TRANSFER_BITS
> +#define TARGET_MODE_CAN_TRANSFER_BITS ix86_mode_can_transfer_bits
> +
> static bool
> ix86_libc_has_fast_function (int fcode ATTRIBUTE_UNUSED)
> {
> --
> 2.43.0
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 2/3] [x86] implement TARGET_MODE_CAN_TRANSFER_BITS
@ 2024-07-31 13:40 Richard Biener
0 siblings, 0 replies; 4+ messages in thread
From: Richard Biener @ 2024-07-31 13:40 UTC (permalink / raw)
To: gcc-patches; +Cc: ubizjak
The following implements the hook, excluding x87 modes for scalar
and complex float modes.
Bootstrapped and tested on x86_64-unknown-linux-gnu.
OK this way?
Thanks,
Richard.
* i386.cc (TARGET_MODE_CAN_TRANSFER_BITS): Define.
(ix86_mode_can_transfer_bits): New function.
---
gcc/config/i386/i386.cc | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/gcc/config/i386/i386.cc b/gcc/config/i386/i386.cc
index 12d15feb5e9..9869c44ee15 100644
--- a/gcc/config/i386/i386.cc
+++ b/gcc/config/i386/i386.cc
@@ -26113,6 +26113,25 @@ ix86_have_ccmp ()
return (bool) TARGET_APX_CCMP;
}
+/* Implement TARGET_MODE_CAN_TRANSFER_BITS. */
+static bool
+ix86_mode_can_transfer_bits (machine_mode mode)
+{
+ if (GET_MODE_CLASS (mode) == MODE_FLOAT
+ || GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT)
+ switch (GET_MODE_INNER (mode))
+ {
+ case SFmode:
+ case DFmode:
+ /* These suffer from normalization upon load when not using SSE. */
+ return !(ix86_fpmath & FPMATH_387);
+ default:
+ return true;
+ }
+
+ return true;
+}
+
/* Target-specific selftests. */
#if CHECKING_P
@@ -26959,6 +26978,9 @@ ix86_libgcc_floating_mode_supported_p
#undef TARGET_HAVE_CCMP
#define TARGET_HAVE_CCMP ix86_have_ccmp
+#undef TARGET_MODE_CAN_TRANSFER_BITS
+#define TARGET_MODE_CAN_TRANSFER_BITS ix86_mode_can_transfer_bits
+
static bool
ix86_libc_has_fast_function (int fcode ATTRIBUTE_UNUSED)
{
--
2.43.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2/3] [x86] implement TARGET_MODE_CAN_TRANSFER_BITS
@ 2024-07-29 13:00 Richard Biener
0 siblings, 0 replies; 4+ messages in thread
From: Richard Biener @ 2024-07-29 13:00 UTC (permalink / raw)
To: gcc-patches; +Cc: Jan Hubicka, ubizjak
On Mon, 29 Jul 2024, Richard Biener wrote:
> The following implements the hook, excluding x87 modes.
Jakub correctly pointed out complex modes, so I've adjusted the hook to
the following which might be easier to parse (and handles decimal
FP modes as returning true). Re-testing in progress.
/* Implement TARGET_MODE_CAN_TRANSFER_BITS. */
static bool
ix86_mode_can_transfer_bits (machine_mode mode)
{
if (GET_MODE_CLASS (mode) == MODE_FLOAT
|| GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT)
switch (GET_MODE_INNER (mode))
{
case SFmode:
case DFmode:
return TARGET_SSE_MATH && !TARGET_MIX_SSE_I387;
default:
return false;
}
return true;
}
> * i386.cc (TARGET_MODE_CAN_TRANSFER_BITS): Define.
> (ix86_mode_can_transfer_bits): New function.
> ---
> gcc/config/i386/i386.cc | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/gcc/config/i386/i386.cc b/gcc/config/i386/i386.cc
> index 12d15feb5e9..584417992a0 100644
> --- a/gcc/config/i386/i386.cc
> +++ b/gcc/config/i386/i386.cc
> @@ -26113,6 +26113,14 @@ ix86_have_ccmp ()
> return (bool) TARGET_APX_CCMP;
> }
>
> +/* Implement TARGET_MODE_CAN_TRANSFER_BITS. */
> +static bool
> +ix86_mode_can_transfer_bits (machine_mode mode)
> +{
> + return (!SCALAR_FLOAT_MODE_P (mode)
> + || (TARGET_SSE_MATH && !TARGET_MIX_SSE_I387 && mode != XFmode));
> +}
> +
> /* Target-specific selftests. */
>
> #if CHECKING_P
> @@ -26959,6 +26967,9 @@ ix86_libgcc_floating_mode_supported_p
> #undef TARGET_HAVE_CCMP
> #define TARGET_HAVE_CCMP ix86_have_ccmp
>
> +#undef TARGET_MODE_CAN_TRANSFER_BITS
> +#define TARGET_MODE_CAN_TRANSFER_BITS ix86_mode_can_transfer_bits
> +
> static bool
> ix86_libc_has_fast_function (int fcode ATTRIBUTE_UNUSED)
> {
>
--
Richard Biener <rguenther@suse.de>
SUSE Software Solutions Germany GmbH,
Frankenstrasse 146, 90461 Nuernberg, Germany;
GF: Ivo Totev, Andrew McDonald, Werner Knoblich; (HRB 36809, AG Nuernberg)
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-07-31 15:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-29 12:14 [PATCH 2/3] [x86] implement TARGET_MODE_CAN_TRANSFER_BITS Richard Biener
2024-07-29 13:00 Richard Biener
2024-07-31 13:40 Richard Biener
[not found] <66aa3eb6.050a0220.28fa5.bb8cSMTPIN_ADDED_MISSING@mx.google.com>
2024-07-31 15:50 ` Uros Bizjak
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).