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: RFA: -mfpmath=sse -fpic vs double constants


(this is Linux, the same happens on Darwin).
This is not really a good idea, as movsd of a double-precision 1.0 is faster.

I wonder whether fixing compress_float_constant is better.

Like this; untested, but pretty obvious. Ok for mainline?


Paolo
2005-07-08  Paolo Bonzini  <bonzini@gnu.org>

	* expr.c (emit_move_insn): Don't use compress_float_constant
	unless optimize_size.

Index: expr.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/expr.c,v
retrieving revision 1.802
diff -p -u -u -r1.802 expr.c
--- expr.c	7 Jul 2005 10:21:05 -0000	1.802
+++ expr.c	8 Jul 2005 15:51:09 -0000
@@ -3143,7 +3143,7 @@ emit_move_insn (rtx x, rtx y)
 
   if (CONSTANT_P (y))
     {
-      if (optimize
+      if (optimize_size
 	  && SCALAR_FLOAT_MODE_P (GET_MODE (x))
 	  && (last_insn = compress_float_constant (x, y)))
 	return last_insn;

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