]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[x86] implement TARGET_MODE_CAN_TRANSFER_BITS
authorRichard Biener <rguenther@suse.de>
Mon, 29 Jul 2024 11:10:18 +0000 (13:10 +0200)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 1 Aug 2024 10:27:47 +0000 (12:27 +0200)
The following implements the hook, excluding x87 modes for scalar
and complex float modes.

* config/i386/i386.cc (TARGET_MODE_CAN_TRANSFER_BITS): Define.
(ix86_mode_can_transfer_bits): New function.

gcc/config/i386/i386.cc

index 77c441893b40a213eeb7b860edc0c4b9fac32888..8f289b5bc22852b162bd68a54c51052a747f70e4 100644 (file)
@@ -26105,6 +26105,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
@@ -26951,6 +26970,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)
 {