From b87cfcfbe3f534de2736136b6f36d87b77f0b002 Mon Sep 17 00:00:00 2001
From: Richard Henderson <rth@redhat.com>
Date: Fri, 2 Jan 2004 16:40:31 -0800
Subject: [PATCH] i386.md (fp constant pool splitter): Reorg suppression for
 sse and 387; add suppression for mmx.

        * config/i386/i386.md (fp constant pool splitter): Reorg suppression
        for sse and 387; add suppression for mmx.

From-SVN: r75349
---
 gcc/ChangeLog           |  5 +++++
 gcc/config/i386/i386.md | 38 +++++++++++++++++++++++++-------------
 2 files changed, 30 insertions(+), 13 deletions(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 96b16ce85e74..41db1bedac3d 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2004-01-02  Richard Henderson  <rth@redhat.com>
+
+	* config/i386/i386.md (fp constant pool splitter): Reorg suppression
+	for sse and 387; add suppression for mmx.
+
 2004-01-02  Andrew Pinski  <pinskia@physics.uc.edu>
 
 	* loop.c (loop_optimize): Free all loops_info's mems.
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index a004c321b407..75fd86a40d43 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -1,6 +1,6 @@
 ;; GCC machine description for IA-32 and x86-64.
 ;; Copyright (C) 1988, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-;; 2001, 2002, 2003
+;; 2001, 2002, 2003, 2004
 ;; Free Software Foundation, Inc.
 ;; Mostly by William Schelter.
 ;; x86_64 support added by Jan Hubicka
@@ -2880,18 +2880,30 @@
    && (GET_MODE (operands[0]) == XFmode
        || GET_MODE (operands[0]) == SFmode || GET_MODE (operands[0]) == DFmode)
    && GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF
-   && CONSTANT_POOL_ADDRESS_P (XEXP (operands[1], 0))
-   && (!(SSE_REG_P (operands[0]) || 
-	 (GET_CODE (operands[0]) == SUBREG
-	  && SSE_REG_P (SUBREG_REG (operands[0]))))
-       || standard_sse_constant_p (get_pool_constant (XEXP (operands[1], 0))))
-   && (!(FP_REG_P (operands[0]) || 
-	 (GET_CODE (operands[0]) == SUBREG
-	  && FP_REG_P (SUBREG_REG (operands[0]))))
-       || standard_80387_constant_p (get_pool_constant (XEXP (operands[1], 0))))"
-  [(set (match_dup 0)
-	(match_dup 1))]
-  "operands[1] = get_pool_constant (XEXP (operands[1], 0));")
+   && CONSTANT_POOL_ADDRESS_P (XEXP (operands[1], 0))"
+  [(set (match_dup 0) (match_dup 1))]
+{
+  rtx c = get_pool_constant (XEXP (operands[1], 0));
+  rtx r = operands[0];
+
+  if (GET_CODE (r) == SUBREG)
+    r = SUBREG_REG (r);
+
+  if (SSE_REG_P (r))
+    {
+      if (!standard_sse_constant_p (c))
+	FAIL;
+    }
+  else if (FP_REG_P (r))
+    {
+      if (!standard_80387_constant_p (c))
+	FAIL;
+    }
+  else if (MMX_REG_P (r))
+    FAIL;
+
+  operands[1] = c;
+})
 
 (define_insn "swapxf"
   [(set (match_operand:XF 0 "register_operand" "+f")
-- 
GitLab