This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] improve float to double on PPC a little
- From: David Edelsohn <dje at watson dot ibm dot com>
- To: Andrew Pinski <pinskia at physics dot uc dot edu>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sat, 29 May 2004 17:09:06 -0400
- Subject: Re: [PATCH] improve float to double on PPC a little
- References: <1BF86E78-B03A-11D8-8DD0-000393A6D2F2@physics.uc.edu>
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"