This is the mail archive of the gcc@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: inefficient float performance



I'm still trying to modify tgcc-3.0.4 to support ColdFire v4e which
includes a v4e, and the code that get generated out of newlib looks
pretty bad, expecially for the transcendental functions, namely _kernel_cos().
A dump looks like:

    /* cos(Inf or NaN) is NaN */
	else if (ix>=0x7ff00000) return x-x;
   314e2:	0c82 7fef ffff 	cmpil #2146435071,%d2
   314e8:	6f28           	bles 31512 <cos+0x66>
   314ea:	2f01           	movel %d1,%sp@-
   314ec:	2f00           	movel %d0,%sp@-
   314ee:	f21f 5480      	fmoved %sp@+,%fp1
   314f2:	2f01           	movel %d1,%sp@-
   314f4:	2f00           	movel %d0,%sp@-
   314f6:	f21f 5400      	fmoved %sp@+,%fp0
   314fa:	f200 00a8      	fsubd %fp0,%fp1
   314fe:	f227 7480      	fmoved %fp1,%sp@-
   31502:	201f           	movel %sp@+,%d0
   31504:	221f           	movel %sp@+,%d1
   31506:	2f01           	movel %d1,%sp@-
   31508:	2f00           	movel %d0,%sp@-
   3150a:	f21f 5400      	fmoved %sp@+,%fp0
   3150e:	6000 0090      	braw 315a0 <cos+0xf4>

Obviously this could be cleaned up to not:

   314fe:	f227 7480      	fmoved %fp1,%sp@-
   31502:	201f           	movel %sp@+,%d0
   31504:	221f           	movel %sp@+,%d1
   31506:	2f01           	movel %d1,%sp@-
   31508:	2f00           	movel %d0,%sp@-
   3150a:	f21f 5400      	fmoved %sp@+,%fp0

instead just execute:
	fmoved %fp1,%fp0

but I've already got:

(define_insn "movdf_v4e"
  [(set (match_operand:DF 0 "nonimmediate_operand" "=f,<Q>U,r,f,r")
	(match_operand:DF 1 "general_operand" "f<Q>U,f,f,r,r"))]
  "TARGET_CFV4E"
  "*
{
  ...
}")

which allows f/f movement.  Any ideas how to fix this?

-- 
Peter Barada                                   Peter.Barada@motorola.com
Wizard                                         781-852-2768 (direct)
WaveMark Solutions(wholly owned by Motorola)   781-270-0193 (fax)


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