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 

I'm not very happy with the do {} while() statement in C
Post new topic    TalkChess.com Forum Index -> Computer Chess Club: Programming and Technical Discussions Flat
View previous topic :: View next topic  
Author Message
Michael Sherwin



Joined: 26 May 2006
Posts: 2795
Location: OH, USA

PostPost subject: Re: I'm not very happy with the do {} while() statement in C    Posted: Fri Mar 09, 2018 7:43 pm Reply to topic Reply with quote

abulmo2 wrote:
Ras wrote:
Stockfish has much less assembly (and half of it is even wrong, IMO) than Crafty and still plays stronger.

What about asmfish ?
Doesn't it prove that assembly can provide faster engine than C++ ?


Speed was not Ras's mian focus. His focus was that assembly is not needed to create a really strong engine. The main reason that I would use 64 bit assembler over C right now is because my jump table style of chess programming lends itself to using a small subset of the assembly instructions. And that allows me to work faster due to my memory limitations.

Code:

iptmf    dd          0
            dd          wpm,wpm,wpm,wpm,wpm,wpm,wpm,wpm
            dd          wnm,wnm,wbm,wbm,wrm,wrm,wqm,wkm
            dd          wck,wcq,wmter
            dd          cbcam
            dd          0
            dd          bpm,bpm,bpm,bpm,bpm,bpm,bpm,bpm
            dd          bnm,bnm,bbm,bbm,brm,brm,bqm,bkm
            dd          bck,bcq,bmter
            dd          cwcam

iptcf      dd          0
            dd          wpc,wpc,wpc,wpc,wpc,wpc,wpc,wpc
            dd          wnc,wnc,wbc,wbc,wrc,wrc,wqc,wkc
            dd          wcter,wcter,wcter
            dd          cbcac
            dd          0
            dd          bpc,bpc,bpc,bpc,bpc,bpc,bpc,bpc
            dd          bnc,bnc,bbc,bbc,brc,brc,bqc,bkc
            dd          bcter,bcter,bcter
            dd          cwcac           

wqmf    dd          0
            dd          wqmnd,wqmnd,wqmnd,wqmnd,wqmnd,wqmnd,wqmnd,wqmnd
            dd          wqmnd,wqmnd,wqmnd,wqmnd,wqmnd,wqmnd,wqmnd,wqmnd
            dd          0,0,0
            dd          wqmrm
            dd          0
            dd          wqmrc,wqmrc,wqmrc,wqmrc,wqmrc,wqmrc,wqmrc,wqmrc
            dd          wqmrc,wqmrc,wqmrc,wqmrc,wqmrc,wqmrc,wqmrc,wmcbki
            dd          wnxtm
           
wqcf        dd          0
            dd          wqcnd,wqcnd,wqcnd,wqcnd,wqcnd,wqcnd,wqcnd,wqcnd
            dd          wqcnd,wqcnd,wqcnd,wqcnd,wqcnd,wqcnd,wqcnd,wqcnd
            dd          0,0,0
            dd          wqcns
            dd          0
            dd          wqcrc,wqcrc,wqcrc,wqcrc,wqcrc,wqcrc,wqcrc,wqcrc
            dd          wqcrc,wqcrc,wqcrc,wqcrc,wqcrc,wqcrc,wqcrc,wccbki
            dd          wnxtc

wmg:    push        ebp
            push        edi
            push        esi
            mov         ebp,[ply]
            mov         eax,[first+ebp*4]
            mov         [lis+ebp*4],eax
            mov         edi,[nxt]
            jmp         [ptmf+edi*4]

wnxtm: mov         edi,[nxt+edi*4]
            jmp         [ptmf+edi*4]
       
wqm:    mov         ecx,[ps+edi*4]
            mov         esi,[qol+ecx*4]
            movsx       ebx,[qns+esi+ecx]
            mov         edx,[brd+ebx*4]
            jmp         [wqmf+edx*4]
       
wqmrm: mov         [tree.fsq+eax*8],cl
            mov         [tree.tsq+eax*8],bl
            mov         [tree.typ+eax*8],QMOV
            inc         eax
            movsx       ebx,[qns+esi+ebx]
            mov         edx,[brd+ebx*4]
            jmp         [wqmf+edx*4]

wqmrc: mov         [tree.fsq+eax*8],cl
            mov         [tree.tsq+eax*8],dl
            mov         [tree.typ+eax*8],QCAP
            inc         eax
wqmnd: movsx       ebx,[qnd+esi+ebx]
            mov         edx,[brd+ebx*4]
            jmp         [wqmf+edx*4]



And it is incredibly fast!
_________________
Regards,
Mike
Back to top
View user's profile Send private message
Display posts from previous:   
Subject Author Date/Time
I'm not very happy with the do {} while() statement in C Michael Sherwin Sun Feb 18, 2018 8:06 am
      Re: I'm not very happy with the do {} while() statement in C Marco Belli Sun Feb 18, 2018 8:47 am
            Re: I'm not very happy with the do {} while() statement in C Michael Sherwin Sun Feb 18, 2018 9:03 am
      Re: I'm not very happy with the do {} while() statement in C Nguyen Pham Sun Feb 18, 2018 9:11 am
            Re: I'm not very happy with the do {} while() statement in C Michael Sherwin Sun Feb 18, 2018 9:21 am
                  Re: I'm not very happy with the do {} while() statement in C Nguyen Pham Sun Feb 18, 2018 9:42 am
                  Re: I'm not very happy with the do {} while() statement in C Ronald de Man Sun Feb 18, 2018 9:51 am
                        Re: I'm not very happy with the do {} while() statement in C Michael Sherwin Sun Feb 18, 2018 10:07 am
                              Re: I'm not very happy with the do {} while() statement in C Ronald de Man Sun Feb 18, 2018 10:21 am
                                    Re: I'm not very happy with the do {} while() statement in C Michael Sherwin Sun Feb 18, 2018 10:23 am
      Re: I'm not very happy with the do {} while() statement in C Rasmus Althoff Sun Feb 18, 2018 9:42 am
            Re: I'm not very happy with the do {} while() statement in C Michael Sherwin Sun Feb 18, 2018 10:05 am
                  Re: I'm not very happy with the do {} while() statement in C Rasmus Althoff Sun Feb 18, 2018 10:27 am
                        Re: I'm not very happy with the do {} while() statement in C Michael Sherwin Sun Feb 18, 2018 10:34 am
                              Re: I'm not very happy with the do {} while() statement in C Michael Sherwin Sun Feb 18, 2018 10:54 am
                                    Re: I'm not very happy with the do {} while() statement in C Rasmus Althoff Sun Feb 18, 2018 11:00 am
                                          Re: I'm not very happy with the do {} while() statement in C Michael Sherwin Sun Feb 18, 2018 11:09 am
                                          Re: I'm not very happy with the do {} while() statement in C Rasmus Althoff Sun Feb 18, 2018 11:20 am
                                                Re: I'm not very happy with the do {} while() statement in C Michael Sherwin Sun Feb 18, 2018 11:48 am
                                                      Re: I'm not very happy with the do {} while() statement in C Rasmus Althoff Sun Feb 18, 2018 12:40 pm
      Re: I'm not very happy with the do {} while() statement in C Michael Sherwin Sun Feb 18, 2018 1:56 pm
            Re: I'm not very happy with the do {} while() statement in C Ronald de Man Sun Feb 18, 2018 2:34 pm
            Re: I'm not very happy with the do {} while() statement in C Sven Schüle Tue Feb 20, 2018 12:23 am
                  Re: I'm not very happy with the do {} while() statement in C Michael Sherwin Tue Feb 20, 2018 2:25 am
                        Re: I'm not very happy with the do {} while() statement in C Michael Sherwin Tue Feb 20, 2018 5:39 am
                              Re: I'm not very happy with the do {} while() statement in C Sven Schüle Tue Feb 20, 2018 10:37 pm
                                    Re: I'm not very happy with the do {} while() statement in C Michael Sherwin Tue Feb 20, 2018 11:59 pm
                              Re: I'm not very happy with the do {} while() statement in C Fulvio Benini Wed Feb 21, 2018 10:08 am
                                    Re: I'm not very happy with the do {} while() statement in C Michael Sherwin Mon Mar 05, 2018 12:03 am
                                          Re: I'm not very happy with the do {} while() statement in C Álvaro Begué Mon Mar 05, 2018 1:03 am
                                                Re: I'm not very happy with the do {} while() statement in C Michael Sherwin Mon Mar 05, 2018 1:11 am
                                                      Re: I'm not very happy with the do {} while() statement in C Álvaro Begué Mon Mar 05, 2018 1:27 am
                                                            Re: I'm not very happy with the do {} while() statement in C Michael Sherwin Mon Mar 05, 2018 2:09 am
                                                                  Re: I'm not very happy with the do {} while() statement in C Lucas Braesch Wed Mar 07, 2018 4:06 am
                                                                        Re: I'm not very happy with the do {} while() statement in C Michael Sherwin Wed Mar 07, 2018 12:54 pm
                                                                              Re: I'm not very happy with the do {} while() statement in C Lucas Braesch Wed Mar 07, 2018 11:29 pm
                                                                              Re: I'm not very happy with the do {} while() statement in C Marco Costalba Fri Mar 09, 2018 8:40 am
                                                                                    Re: I'm not very happy with the do {} while() statement in C Michael Sherwin Fri Mar 09, 2018 3:35 pm
                                                                        Re: I'm not very happy with the do {} while() statement in C Alcides Schulz Wed Mar 07, 2018 11:32 pm
                                                                  Re: I'm not very happy with the do {} while() statement in C Ed Schroder Fri Mar 09, 2018 2:59 pm
                                                                        Re: I'm not very happy with the do {} while() statement in C Michael Sherwin Fri Mar 09, 2018 3:25 pm
                                                                        Re: I'm not very happy with the do {} while() statement in C Rasmus Althoff Fri Mar 09, 2018 3:47 pm
                                                                              Re: I'm not very happy with the do {} while() statement in C Richard Delorme Fri Mar 09, 2018 7:07 pm
                                                                                    Re: I'm not very happy with the do {} while() statement in C Michael Sherwin Fri Mar 09, 2018 7:43 pm
                                                                                          Re: I'm not very happy with the do {} while() statement in C Rasmus Althoff Fri Mar 09, 2018 8:11 pm
                                                                                          Re: I'm not very happy with the do {} while() statement in C Rasmus Althoff Sat Mar 10, 2018 9:58 am
                                                                                    Re: I'm not very happy with the do {} while() statement in C Rasmus Althoff Fri Mar 09, 2018 8:14 pm
                                                                        Re: I'm not very happy with the do {} while() statement in C Robert Hyatt Sat Mar 10, 2018 4:20 am
                                                                              Re: I'm not very happy with the do {} while() statement in C Martin Sedlak Sat Mar 10, 2018 9:21 am
                                                                                    Re: I'm not very happy with the do {} while() statement in C Martin Sedlak Sat Mar 10, 2018 9:29 am
                                                                                    Re: I'm not very happy with the do {} while() statement in C Robert Hyatt Sat Mar 10, 2018 6:08 pm
                                                                                          Re: I'm not very happy with the do {} while() statement in C Martin Sedlak Sat Mar 10, 2018 6:37 pm
                                                                                          Re: I'm not very happy with the do {} while() statement in C Robert Hyatt Sat Mar 10, 2018 10:13 pm
                                                                                          Re: I'm not very happy with the do {} while() statement in C Martin Sedlak Sat Mar 10, 2018 10:45 pm
                                                                                          Re: I'm not very happy with the do {} while() statement in C Robert Hyatt Wed Mar 14, 2018 2:06 am
                                                                                          Re: I'm not very happy with the do {} while() statement in C Rasmus Althoff Fri Mar 23, 2018 3:33 pm
                                                                                          Re: I'm not very happy with the do {} while() statement in C Martin Sedlak Fri Mar 23, 2018 7:19 pm
                                                                                          Re: I'm not very happy with the do {} while() statement in C Álvaro Begué Fri Mar 23, 2018 7:29 pm
                                                                                          Re: I'm not very happy with the do {} while() statement in C Ronald de Man Fri Mar 23, 2018 8:51 pm
                                                                                          Re: I'm not very happy with the do {} while() statement in C Ronald de Man Fri Mar 23, 2018 8:55 pm
                                                                                          Re: I'm not very happy with the do {} while() statement in C Álvaro Begué Sat Mar 24, 2018 12:00 am
                                                                                          Re: I'm not very happy with the do {} while() statement in C Robert Hyatt Fri Mar 23, 2018 4:17 am
                                                                                          Re: I'm not very happy with the do {} while() statement in C Martin Sedlak Fri Mar 23, 2018 7:33 pm
                                                                                          Re: I'm not very happy with the do {} while() statement in C Rasmus Althoff Sat Mar 10, 2018 7:16 pm
                                                                                          Re: I'm not very happy with the do {} while() statement in C Matthew Hull Sat Mar 10, 2018 9:17 pm
                                                                                          Re: I'm not very happy with the do {} while() statement in C Robert Hyatt Sat Mar 10, 2018 10:18 pm
                                                                                          Re: I'm not very happy with the do {} while() statement in C Rasmus Althoff Sat Mar 10, 2018 10:40 pm
                                                                                          Re: I'm not very happy with the do {} while() statement in C Rasmus Althoff Sat Mar 10, 2018 10:54 pm
                                                                                          Re: I'm not very happy with the do {} while() statement in C Matthew Hull Sun Mar 11, 2018 11:14 am
                                                                                          Re: I'm not very happy with the do {} while() statement in C Rasmus Althoff Sun Mar 11, 2018 1:51 pm
                                                                                          Re: I'm not very happy with the do {} while() statement in C Ronald de Man Sun Mar 11, 2018 12:32 pm
                                                                                          Re: I'm not very happy with the do {} while() statement in C Rasmus Althoff Sun Mar 11, 2018 1:42 pm
                                                                                          Re: I'm not very happy with the do {} while() statement in C Robert Hyatt Wed Mar 14, 2018 2:20 am
                                                                                          Re: I'm not very happy with the do {} while() statement in C laurie tunnicliffe Sun Mar 11, 2018 9:16 am
                                                                                          Re: I'm not very happy with the do {} while() statement in C Lucas Braesch Sun Mar 11, 2018 11:11 am
                                                                              Re: I'm not very happy with the do {} while() statement in C Ed Schroder Sat Mar 10, 2018 9:59 am
                                                            Re: I'm not very happy with the do {} while() statement in C P. Kumar Mon Mar 05, 2018 4:42 am
      Re: I'm not very happy with the do {} while() statement in C Martin Sedlak Sun Feb 18, 2018 5:39 pm
            Re: I'm not very happy with the do {} while() statement in C Michael Sherwin Sun Feb 18, 2018 5:59 pm
                  Re: I'm not very happy with the do {} while() statement in C Martin Sedlak Sun Feb 18, 2018 6:40 pm
                        Re: I'm not very happy with the do {} while() statement in C Michael Sherwin Sun Feb 18, 2018 7:16 pm
                        Re: I'm not very happy with the do {} while() statement in C Ronald de Man Sun Feb 18, 2018 8:39 pm
                              Re: I'm not very happy with the do {} while() statement in C Rasmus Althoff Sun Feb 18, 2018 10:06 pm
                                    Re: I'm not very happy with the do {} while() statement in C Martin Sedlak Sun Feb 18, 2018 10:32 pm
                                    Re: I'm not very happy with the do {} while() statement in C Ronald de Man Sun Feb 18, 2018 11:53 pm
                                          Re: I'm not very happy with the do {} while() statement in C Rasmus Althoff Mon Feb 19, 2018 5:58 pm
                        Re: I'm not very happy with the do {} while() statement in C Martin Sedlak Sun Feb 18, 2018 9:33 pm
                  Re: I'm not very happy with the do {} while() statement in C Rasmus Althoff Sun Feb 18, 2018 7:04 pm
                        Re: I'm not very happy with the do {} while() statement in C Ronald de Man Sun Feb 18, 2018 9:12 pm
                              Re: I'm not very happy with the do {} while() statement in C Rasmus Althoff Sun Feb 18, 2018 10:05 pm
                              Re: I'm not very happy with the do {} while() statement in C Robert Hyatt Tue Feb 20, 2018 5:22 am
                                    Re: I'm not very happy with the do {} while() statement in C Michael Sherwin Tue Feb 20, 2018 6:14 am
                                          Re: I'm not very happy with the do {} while() statement in C Michael Sherwin Tue Feb 20, 2018 6:33 am
                                                Re: I'm not very happy with the do {} while() statement in C Robert Hyatt Tue Feb 20, 2018 10:23 pm
                                                      Re: I'm not very happy with the do {} while() statement in C Michael Sherwin Tue Feb 20, 2018 11:52 pm
                                          Re: I'm not very happy with the do {} while() statement in C Álvaro Begué Tue Feb 20, 2018 11:45 pm
                                                Re: I'm not very happy with the do {} while() statement in C Michael Sherwin Wed Feb 21, 2018 12:15 am
                                                      Re: I'm not very happy with the do {} while() statement in C H.G.Muller Wed Feb 21, 2018 8:34 am
                                                            Re: I'm not very happy with the do {} while() statement in C Robert Hyatt Thu Feb 22, 2018 2:21 am
                                                                  Re: I'm not very happy with the do {} while() statement in C Ronald de Man Thu Feb 22, 2018 12:51 pm
                                                                        Re: I'm not very happy with the do {} while() statement in C Robert Hyatt Fri Feb 23, 2018 4:12 am
                                                                  Re: I'm not very happy with the do {} while() statement in C Rasmus Althoff Thu Feb 22, 2018 5:58 pm
                                                                        Re: I'm not very happy with the do {} while() statement in C Eugene Kotlov Thu Feb 22, 2018 6:16 pm
                                                            Re: I'm not very happy with the do {} while() statement in C Rasmus Althoff Thu Feb 22, 2018 5:54 pm
                                                                  Re: I'm not very happy with the do {} while() statement in C Robert Hyatt Fri Feb 23, 2018 4:22 am
                  Re: I'm not very happy with the do {} while() statement in C Lucas Braesch Mon Feb 19, 2018 11:45 am
                        Re: I'm not very happy with the do {} while() statement in C Michael Sherwin Mon Feb 19, 2018 2:13 pm
                  Re: I'm not very happy with the do {} while() statement in C Robert Hyatt Tue Feb 20, 2018 5:13 am
      Re: I'm not very happy with the do {} while() statement in C laurie tunnicliffe Mon Mar 05, 2018 12:22 am
            Re: I'm not very happy with the do {} while() statement in C Michael Sherwin Mon Mar 05, 2018 1:04 am
            Re: I'm not very happy with the do {} while() statement in C Álvaro Begué Mon Mar 05, 2018 1:06 am
            Re: I'm not very happy with the do {} while() statement in C Rasmus Althoff Wed Mar 07, 2018 4:58 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