This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] improve float to double on PPC a little


Andrew,

	The following patch uses the same trick that Richard Sandiford
uses to remove unnecessary sign extensions in the Mips port.  I am worried
that matching constraints with different modes is unsafe unless the
instruction actually is removed.

	How does the appended patch work on your tests.  The patch is
preliminary.  I am not sure if it is better to retain the case that
explicitly copies to a different FPR or let reload generate that.

David

Index: rs6000.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.md,v
retrieving revision 1.305
diff -c -p -u -r1.305 rs6000.md
--- rs6000.md	18 May 2004 05:35:30 -0000	1.305
+++ rs6000.md	29 May 2004 21:01:23 -0000
@@ -4372,17 +4467,19 @@
 ;; this case, we just lose precision that we would have otherwise gotten but
 ;; is not guaranteed.  Perhaps this should be tightened up at some point.
 
-(define_insn "extendsfdf2"
-  [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
-	(float_extend:DF (match_operand:SF 1 "gpc_reg_operand" "f")))]
+(define_insn_and_split "extendsfdf2"
+  [(set (match_operand:DF 0 "gpc_reg_operand" "=f,?f")
+	(float_extend:DF (match_operand:SF 1 "gpc_reg_operand" "0,f")))]
   "TARGET_HARD_FLOAT && TARGET_FPRS"
-  "*
+  "@
+   #
+   fmr %0,%1"
+  "&& reload_completed && REGNO (operands[0]) == REGNO (operands[1])"
+  [(const_int 0)]
 {
-  if (REGNO (operands[0]) == REGNO (operands[1]))
-    return \"\";
-  else
-    return \"fmr %0,%1\";
-}"
+  emit_note (NOTE_INSN_DELETED);
+  DONE;
+}
   [(set_attr "type" "fp")])
 
 (define_insn "truncdfsf2"


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]