Search found 1881 matches

by mar
Sun Apr 21, 2019 11:48 am
Forum: Computer Chess Club: General Topics
Topic: Contrived position for perft
Replies: 13
Views: 302

Re: Contrived position for perft

Does it cover all the possibilities? Has someone done a better one already? Any suggested changes? r3k2r/1bp2pP1/5n2/1P1Q4/1pPq4/5N2/1B1P2p1/R3K2R b KQkq c3 0 1 Thanks I don't remeber one position to test all cases, not sure if it's possible; if so then it would be really nice if you don't have to ...
by mar
Sat Apr 20, 2019 11:49 am
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: No standard specification for Perft
Replies: 22
Views: 414

Re: No standard specification for Perft

in my regular search I never promote to bishop because that is clearly a waste of time. Is this really worth it? I always consider all legal moves in search and never even considered doing anything like that. Besides there are other ways to avoid wasting time on bishop underpromotions rather than c...
by mar
Thu Apr 18, 2019 8:24 am
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: My newest almost bb move generator is wonderful
Replies: 16
Views: 878

Re: My newest almost bb move generator is wonderful

And the bsf and bsr instructions are clock tick inefficient. Does this still hold on modern CPUs? Anyway, since you're hunting for cycles, one more low hanging fruit for you: mark default case in your switches unreachable to eliminate bounds check, turning the switch into plain jump table, making y...
by mar
Tue Apr 16, 2019 9:57 am
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Google's bfloat for neural networks
Replies: 2
Views: 315

Re: Google's bfloat for neural networks

I misread as "Google's bloat...", thought that Google open sourced yet another masterpiece :D So this bfloat16 is basically float where you throw away 16 bits worth of mantissa. Packing/unpacking from 32-bit float should be trivial, so probably clever, but hey only 7 bits of mantissa, is it really e...
by mar
Fri Mar 29, 2019 1:19 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Some x64 assembler for the curious
Replies: 21
Views: 1767

Re: Some x64 assembler for the curious

And a good compiler will translate a (considerable) switch-case in a jump table anyway. True, but you still need the switch inside the loop. Also, the compiler typically generates code to verify that the expression you switch on is in a valid range. You can still hint the compiler that default is u...
by mar
Sat Mar 23, 2019 12:39 am
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Some x64 assembler for the curious
Replies: 21
Views: 1767

Re: Some x64 assembler for the curious

Yes, first n args are passed in registers, but I like having twice the number of registers more. I haven't done any serious assembly in years though (except for a stub that passes control to generated machine code for my scripting language) It's worth noting that addresses use 64-bit registers by de...
by mar
Mon Mar 18, 2019 11:57 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Need MSVC with assembler file help
Replies: 24
Views: 976

Re: Need MSVC with assembler file help

Partial success. New sample code. #pragma pack (push, 1) typedef struct { int sqr; int typ; // the type of piece, WP ... BK int clr; int prv; // the previous on board piece int nxt; // the next on board piece int val; // the value of the piece } ps; // piece-structure typedef struct { int castle; i...
by mar
Sat Mar 16, 2019 9:01 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Need MSVC with assembler file help
Replies: 24
Views: 976

Re: Need MSVC with assembler file help

This is actually the structure in my real code. typedef struct { int sqr; // the square the piece is on int typ; // the type of piece, WP ... BK int clr; // the side int prv; // the previous on board piece int nxt; // the next on board piece int val; // the value of the piece } ps; // piece-structu...
by mar
Sat Mar 16, 2019 7:42 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Need MSVC with assembler file help
Replies: 24
Views: 976

Re: Need MSVC with assembler file help

Double.c typedef struct { int prv; int nxt; } piece_s; typedef struct { int board[64]; piece_s piece[40]; } thread_s; Looking at this, I think you're missing an important piece of information, namely how to map to board index. You could either embed it into piece_s or use another array, say int boa...
by mar
Sat Mar 16, 2019 7:22 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Need MSVC with assembler file help
Replies: 24
Views: 976

Re: Need MSVC with assembler file help

Linked.asm .386 .model flat .data .code public c MoveGen MoveGen: push ebp mov ebp, esp mov ebx, [ebp+8] ; code to traverse t->piece[].nxt mov esp, ebp pop ebp ret end Let's try: ebx = thread_s * lea esi,[ebx + 4*64 + 4] // esi = &thread->piece[0].nxt // edx = current index xor edx, edx // you may ...