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 FPU poerformance



my previous mail shoud have read:

>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

Should be:


Obviously this could be cleaned up to not:

   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

instead just execute:
	movel %d1,%sp-
	movel %d0,%sp-
	fmoved %sp@+,%fp0
	fsubd %fp0,%fp0

instead of pushing/popping data register pairs and popping/pushing fp
registers over-and-over....

Any ideas the best way 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]