Hard ware long dooble operations are slower.

M.V.S. Phani Narasimham phanimvs@wipinfo.soft.net
Thu Dec 30 02:14:00 GMT 1999


hi,
Why quad floatine point instructions of sparcv9 are very slower,
compared to the instructions which make call to the library and
perform the operations.
The following c code takes more time when compiled with cc1 of gcc
with option -mhard-quad-float than when compiled with sun cc.

-----------------------------------------------------------
c code:-
     1  main(){
     2  long double a=2e0;
     3  int i;
     4  for(i=0;i<10000000;i++)
     5          a=a+2;
     6  printf("%Lfg\n",a);
     7  }

The c code generates an faddq instruction.
----------------------------------------------------------------------

Time taken details:-

real    4m36.96s
user    0m23.33s
sys     1m8.59s

-------------------------------------------------------------------

If Sun cc is used it makes a call to the library (_Qp_add_)
and the details of the time are.

real    0m14.77s
user    0m5.01s
sys     0m0.01s

------------------------------------------------------------------

I could not see any trap handler that get's invoked when the hard quad
instructions are generated. Is it that they are implimented in the system
software or firmware. If so why is it slow.

phani.
-----------------------------------------------------------------------
 M.V.S. Phani Narasimham	  
 Global R & D Solutions	    	 
 1 st Block,7 th main road,No:8
 Kormangla
 BANGLORE-36 , India
 Ph- 5530053 ext.1053           
 E-MAIL- phani.sesha@wipro.com
 www.wipro.com
 The World's First SEI CMM LEVEL 5 Software Services Company
-----------------------------------------------------------------------




More information about the Gcc-help mailing list