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

wutdevoptab: check size of a read/write before checking the buffer alignment to reduce the read/write calls #273

Merged
merged 1 commit into from
Sep 20, 2022

Conversation

Maschell
Copy link
Contributor

@Maschell Maschell commented Sep 20, 2022

If the size is < 0x40 we need to use the aligned buffer anyway, so we check this first to avoid splitting the call up into multiple calls.

Example:
With the previous implementation writing 26 bytes from buffer 0x10000038, will result two write calls.
First call writes 8 bytes (buffer not aligned => MIN(size, 0x40 - ((uintptr_t) ptr & 0x3F)), the other one the remaining 18 bytes (buffer is now aligned, but size is now < 0x40).

With the new implementation the same operation (write 26 bytes from 0x10000038) would just result in one single 26 bytes (because size < 0x40 is checked first) call.

@fincs fincs merged commit ec4a7ea into devkitPro:master Sep 20, 2022
@Maschell Maschell deleted the read_write_optimisations branch October 6, 2022 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants