diff mbox series

[2/3,x86] implement TARGET_MODE_CAN_TRANSFER_BITS

Message ID 20240729121622.5BEE63858283@sourceware.org
State New
Headers show
Series [1/3] Add TARGET_MODE_CAN_TRANSFER_BITS | expand

Commit Message

Richard Biener July 29, 2024, 12:14 p.m. UTC
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 mbox series

Patch

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)
 {