Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Implementation of the abs() function [o.t.]

Author: Gerd Isenberg

Date: 03:09:20 07/07/03

Go up one level in this thread


On July 05, 2003 at 20:32:05, Dieter Buerssner wrote:

>Should be 80000000h
>
>I get a very strange table, when I let MSVC inline - omid is *much* faster than
>nothing! And this reproducable. And totally unexplainable by looking at the
>generated assembly. Very strange.
>
>MSVC, Russel's code, -Ox2 -Ob2 -G6 -Gr -GF
>
>       nothing 3951541892 13.309
>         abs() 1713113360 14.400
>  simple_abs() 1713113360 17.936
>    omid_abs() 1713113360 7.932   !!! Yes, reprocucable
>     sbb_abs() 1713113360 17.144
>     cdq_abs() 1713113360 17.555
>    fish_abs() 1713113360 20.900
>     sar_abs() 1713113360 16.464
>   cmovl_abs() 1713113360 17.365
>   cmovs_abs() 1713113360 17.345
>

i tried Russells test on P4 2.4GHz:
MSVC, corrected Russel's code, inlined
Speep optimization,
/GX /O2 /Oy-

       nothing 3951541892 13.671
         abs() 1713113360 13.438!
    omid_abs() 1713113360 14.641
     sbb_abs() 1713113360 16.640
     cdq_abs() 1713113360 17.954
     sar_abs() 1713113360 18.781
   cmovl_abs() 1713113360 19.282
   cmovs_abs() 1713113360 19.140
  simple_abs() 1713113360 19.781
    fish_abs() 1713113360 22.515

custom optimization:
/G6 /Gr /ML /W3 /Ox /Ot /Oa /Ow /Og /Ob2

       nothing 3951541892 13.390
         abs() 1713113360 13.141!
    omid_abs() 1713113360 13.672
   cmovs_abs() 1713113360 16.781
   cmovl_abs() 1713113360 16.782
     sbb_abs() 1713113360 17.969
     cdq_abs() 1713113360 17.625
     sar_abs() 1713113360 16.984
  simple_abs() 1713113360 19.562
    fish_abs() 1713113360 21.750

Gerd



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.