Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic implementation of BoardMoveExecutor #9

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

budgetdevv
Copy link

Basic implementation of an "array" ( We use native memory ) of function pointers, pointing to generic instantiations!

All 64 moves get their own specialized method body, with irrelevant code eliminated

Method selection code looks something like...

L00000:  mov rax, 0x2a362746c50
L00010:  mov rax, [rax+rdx*8]
L00014:  jmp rax
Optimization Tier - OptimizedTier1
Code Size - 17

private static readonly delegate*<ref BitBoardMap, void>* FPs;

[ModuleInitializer]
internal static void RunCctor()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to do this. It's already done by Util.cs.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't tell me you're pre-running all cctors...

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am. See:

public static void RunStaticConstructor()

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does that even work? The ModuleInitializer attribute seems to be missing. Either way, RIP startup perf

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it works? — Not 100% sure, but running it seems to be fine.

The start-up performance isn't actually hurt that much.

@TheBlackPlague
Copy link
Owner

Merged it with the latest changes to begin testing ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants