From 4a5ec5a20911491971cdf38b4781eda8fa348570 Mon Sep 17 00:00:00 2001
From: hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Wed, 15 Mar 2000 12:34:40 +0000
Subject: [PATCH] 	* i386.md (movhi_1): Promote movw imm, reg to movl
 imm, reg and 	movw reg, reg to movzwl reg, reg on PARTIAL_REGISTER_STALL
 machines. 	* i386.c (pentiumpro_cost): Set mul cost to 4. 
 (x86_use_movx): Set for PPro.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@32560 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog           |  7 +++++++
 gcc/config/i386/i386.c  |  4 ++--
 gcc/config/i386/i386.md | 22 ++++++++++++++--------
 3 files changed, 23 insertions(+), 10 deletions(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 5e62675589f7..ca7070e609f2 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+Wed Mar 15 13:26:58 MET 2000  Jan Hubicka  <jh@suse.cz>
+
+	* i386.md (movhi_1): Promote movw imm, reg to movl imm, reg and
+	movw reg, reg to movzwl reg, reg on PARTIAL_REGISTER_STALL machines.
+	* i386.c (pentiumpro_cost): Set mul cost to 4.
+	(x86_use_movx): Set for PPro.
+
 Wed Mar 15 13:07:05 MET 2000  Jan Hubicka  <jh@suse.cz>
 
 	* i386.md (ix86_compute_frame_size): stack_alignment_needed is
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index e3038fd49618..c2eadf13bd22 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -124,7 +124,7 @@ struct processor_costs pentiumpro_cost = {
   1,					/* cost of a lea instruction */
   1,					/* variable shift costs */
   1,					/* constant shift costs */
-  1,					/* cost of starting a multiply */
+  4,					/* cost of starting a multiply */
   0,					/* cost of multiply per each bit set */
   17,					/* cost of a divide/mod */
   8,					/* "large" insn */
@@ -195,7 +195,7 @@ struct processor_costs *ix86_cost = &pentium_cost;
 const int x86_use_leave = m_386 | m_K6 | m_ATHLON;
 const int x86_push_memory = m_386 | m_K6 | m_ATHLON;
 const int x86_zero_extend_with_and = m_486 | m_PENT;
-const int x86_movx = m_ATHLON /* m_386 | m_PPRO | m_K6 */;
+const int x86_movx = m_ATHLON | m_PPRO /* m_386 | m_K6 */;
 const int x86_double_with_add = ~m_386;
 const int x86_use_bit_test = m_386;
 const int x86_unroll_strlen = m_486 | m_PENT | m_PPRO | m_ATHLON | m_K6;
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index be2b035b94de..925473952ac9 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -1379,8 +1379,8 @@
   [(set_attr "type" "pop")])
 
 (define_insn "*movhi_1"
-  [(set (match_operand:HI 0 "nonimmediate_operand" "=r,r,m")
-	(match_operand:HI 1 "general_operand" "rn,rm,rn"))]
+  [(set (match_operand:HI 0 "nonimmediate_operand" "=r,r,r,m")
+	(match_operand:HI 1 "general_operand" "r,rn,rm,rn"))]
   "GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM"
   "*
 {
@@ -1398,22 +1398,28 @@
     }
 }"
   [(set (attr "type")
-     (cond [(and (eq_attr "alternative" "0,1")
+     (cond [(and (eq_attr "alternative" "0")
+		 (eq (symbol_ref "TARGET_PARTIAL_REG_STALL")
+			(const_int 0)))
+	      (const_string "imov")
+	    (and (eq_attr "alternative" "1,2")
 		 (match_operand:HI 1 "aligned_operand" ""))
 	      (const_string "imov")
 	    (and (ne (symbol_ref "TARGET_MOVX")
 		     (const_int 0))
-		 (eq_attr "alternative" "1"))
+		 (eq_attr "alternative" "0,2"))
 	      (const_string "imovx")
 	   ]
 	   (const_string "imov")))
     (set (attr "length_prefix")
       (cond [(eq_attr "type" "imovx")
 	       (const_string "0")
-	     (and (eq_attr "alternative" "0,1")
-		  (and (match_operand:HI 1 "aligned_operand" "")
-		       (eq (symbol_ref "TARGET_PARTIAL_REG_STALL")
-			   (const_int 0))))
+	     (and (eq_attr "alternative" "1,2")
+		  (match_operand:HI 1 "aligned_operand" ""))
+	       (const_string "0")
+	     (and (eq_attr "alternative" "0")
+		  (eq (symbol_ref "TARGET_PARTIAL_REG_STALL")
+		      (const_int 0)))
 	       (const_string "0")
 	    ]
 	    (const_string "1")))
-- 
GitLab