ChessUSA.com TalkChess.com
Hosted by Your Move Chess & Games
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

SSE4 instructions
Post new topic    TalkChess.com Forum Index -> Computer Chess Club: Programming and Technical Discussions Flat
View previous topic :: View next topic  
Author Message
Vincent Diepeveen



Joined: 09 Mar 2006
Posts: 1738
Location: The Netherlands

PostPost subject: Re: SSE4 instructions    Posted: Thu May 24, 2012 12:35 pm Reply to topic Reply with quote

mar wrote:
Engin wrote:

MY_INLINE int my_pop_cnt64 (const uint64_t a)
{
if(a) return (count_word[0xffff & a] +
count_word[0xffff & (a >> 16)] +
count_word[0xffff & (a >> 32)] +
count_word[0xffff & (a >> 48)] ) ;

return (0);
}


Hi Engin,

yes i also use a LUT in cheng. Also 64K table, 4 lookups.


You also do the useless 'if( a )' clause in front of it?
Without it it's 2 cycles provided your results are in L1d, otherwise you have to get it out of L2 or L3 which is slow.

Quote:

Doing 8 256-byte lookups proved slower, and any other fancy formulas proved much slower (note i only tested in 32-bit mode).

it's 4 cycles yet lots of problems for L1d to keep up with the result,
also i see the above code uses a '+' (PLUS). You can also use | (OR) of course, which is faster on paper, except L1d problems again.

Quote:

I'm not sure but i believe only SSE4 popcnt was faster.


Of course it is faster if other instructions already are in SIMD. The SSE4 can do 2 at a time which always is faster. AVX can do 4 at a time which is even faster.

So if you write simple test, usually compiler will fool everyone there.

Quote:

However even with popcnt the speedup was really negligible so i never enabled it and i believe it's useless. At my level (~2500 elo engine +- rating list elo normalization offset) certainly.
One more binary for how much? 1, 2, 5 or 10 elo at best perhaps? Not worth it IMO unless want to make some nerds happy Wink


No elo at all of course, except if you mess up.
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Display posts from previous:   
Subject Author Date/Time
SSE4 instructions Maurizio Maglio Mon May 21, 2012 8:48 pm
      Re: SSE4 instructions Adam Hair Mon May 21, 2012 10:47 pm
            Re: SSE4 instructions Maurizio Maglio Tue May 22, 2012 7:47 am
      Re: SSE4 instructions Joona Kiiski Tue May 22, 2012 1:55 pm
            Re: SSE4 instructions Engin Üstün Tue May 22, 2012 8:11 pm
                  Re: SSE4 instructions Maurizio Maglio Tue May 22, 2012 8:41 pm
                  Re: SSE4 instructions Robert Hyatt Wed May 23, 2012 3:39 pm
      Re: SSE4 instructions Engin Üstün Tue May 22, 2012 7:31 pm
            Re: SSE4 instructions Engin Üstün Tue May 22, 2012 7:34 pm
                  Re: SSE4 instructions Ricardo Barreira Wed May 23, 2012 7:40 am
                        Re: SSE4 instructions Robert Hyatt Wed May 23, 2012 3:37 pm
                              Re: SSE4 instructions Richard Vida Wed May 23, 2012 5:28 pm
                                    Re: SSE4 instructions Robert Hyatt Wed May 23, 2012 5:47 pm
                                          Re: SSE4 instructions Ricardo Barreira Sat May 26, 2012 3:14 pm
                                    Re: SSE4 instructions Engin Üstün Wed May 23, 2012 10:02 pm
                                          Re: SSE4 instructions Vincent Diepeveen Thu May 24, 2012 12:02 am
                                                Re: SSE4 instructions Engin Üstün Thu May 24, 2012 3:54 pm
                                                      Re: SSE4 instructions Engin Üstün Thu May 24, 2012 4:07 pm
                                          Re: SSE4 instructions Lucas Braesch Thu May 24, 2012 11:03 am
                                          Re: SSE4 instructions Martin Sedlak Thu May 24, 2012 11:47 am
                                                Re: SSE4 instructions Vincent Diepeveen Thu May 24, 2012 12:35 pm
                                                      Re: SSE4 instructions Martin Sedlak Thu May 24, 2012 12:46 pm
                                                      Re: SSE4 instructions Engin Üstün Thu May 24, 2012 4:24 pm
                                    Re: SSE4 instructions Engin Üstün Thu May 24, 2012 4:41 pm
                        Re: SSE4 instructions Engin Üstün Wed May 23, 2012 4:35 pm
                              Re: SSE4 instructions Robert Hyatt Wed May 23, 2012 5:48 pm
                                    Re: SSE4 instructions Engin Üstün Wed May 23, 2012 10:28 pm
                                          Re: SSE4 instructions Robert Hyatt Thu May 24, 2012 3:41 pm
                                                Re: SSE4 instructions Engin Üstün Thu May 24, 2012 4:31 pm
                        Re: SSE4 instructions Engin Üstün Thu May 24, 2012 4:35 pm
      Re: SSE4 instructions Don Dailey Thu May 24, 2012 9:09 pm
            Re: SSE4 instructions Richard Vida Thu May 24, 2012 9:21 pm
                  Re: SSE4 instructions Vincent Diepeveen Fri May 25, 2012 12:19 am
                  Re: SSE4 instructions Engin Üstün Fri May 25, 2012 10:44 pm
Post new topic    TalkChess.com Forum Index -> Computer Chess Club: Programming and Technical Discussions

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Powered by phpBB © 2001, 2005 phpBB Group
Enhanced with Moby Threads