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: Optimization comparison: 3.3, 3.4, mainline, tree-ssa


Hello

On Monday 19 April 2004 08:27, Uros Bizjak wrote:
> BTW: I would really appreciate some help with -rint(), lrint() and
> llrint() builtins

Sure you kow the trick. I gain about 30% of performance in Glucas, (a 
Lucas-Lehmer test for Mersenne Prime numbers), when using the round constant 
trick basically,

#define RINT(x) (((x) + A) - A)

where A = 3 * 2^62 (for x87) and (3 * 2^51) for 8 bytes IEEE doubles. This is 
better to me than 

#define RINT(x) ({ double __arg ;\
   __asm__ volatile ("frndint \n" : "=t" (__arg) : "0" (x));\
   __arg;})

Any chance to use the trick in gcc?

Guillermo

-- 
Guillermo Ballester Valor
gbv@oxixares.com
Ogijares, Granada  SPAIN
Linux user #117181. See http://counter.li.org/
Public GPG KEY http://www.oxixares.com/~gbv/pubgpg.html

 


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