cvs commit: src/lib/msun/src e_rem_pio2.c

Bruce Evans bde at FreeBSD.org
Fri Feb 22 17:26:24 UTC 2008


bde         2008-02-22 17:26:24 UTC

  FreeBSD src repository

  Modified files:
    lib/msun/src         e_rem_pio2.c 
  Log:
  Remove the "quick check no cancellation" optimization for
  9pi/2 < |x| < 32pi/2 since it is only a small or negative optimation
  and it gets in the way of further optimizations.  It did one more
  branch to avoid some integer operations and to use a different
  dependency on previous results.  The branches are fairly predictable
  so they are usually not a problem, so whether this is a good
  optimization depends mainly on the timing for the previous results,
  which is very machine-dependent.  On amd64 (A64), this "optimization"
  is a pessimization of about 1 cycle or 1%; on ia64, it is an
  optimization of about 2 cycles or 1%; on i386 (A64), it is an
  optimization of about 5 cycles or 4%; on i386 (Celeron P2) it is an
  optimization of about 4 cycles or 3% for cos but a pessimization of
  about 5 cycles for sin and 1 cycle for tan.  I think the new i386
  (A64) slowness is due to an pipeline stall due to an avoidable
  load-store mismatch (so the old timing was better), and the i386
  (Celeron) variance is due to its branch predictor not being too good.
  
  Revision  Changes    Path
  1.13      +1 -12     src/lib/msun/src/e_rem_pio2.c


More information about the cvs-all mailing list