Skip to content

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

@TheBlackPlague TheBlackPlague Jun 30, 2022

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.

2 participants