desmume icon indicating copy to clipboard operation
desmume copied to clipboard

Update wifi.cpp - added faster reflect functions

Open gnudles opened this issue 9 months ago • 3 comments

I know this is so insignificant because it only hapens on initialization. But maybe future implementation might require it. Feel free to reject it.

gnudles avatar Apr 01 '25 18:04 gnudles

Your replacement functions, reflect8() and reflect32() rearrange the bits on a per-nibble basis, but the original reflect() function rearranges the bits on a per-bit basis. Therefore, these are NOT equivalent functions at all. Nice try trying to optimize, but we've gotta reject this PR because your new functions cannot replace the old function. Optimization is hard.

rogerman avatar Apr 01 '25 20:04 rogerman

Okay, might of analyzed this PR too quickly -- the functions actually are equivalent. My bad.

Still, at the end of the day, we're just filling a LUT of 256 32-bit values only once at initialization, so this isn't even a performance issue. Meh. Because the functions are, in fact, equivalent, I'll reopen this PR if anyone actually cares.

rogerman avatar Apr 01 '25 20:04 rogerman

Yes I know this is not significant at all. I just thought, maybe one day, someone would need to use it in a different place in the code, so he better have a faster implementation...

gnudles avatar Apr 02 '25 07:04 gnudles