-
Notifications
You must be signed in to change notification settings - Fork 393
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I've decided to take a stab at implementing `bit32.byteswap` from the [recently merged RFC](https://github.com/Roblox/luau/blob/master/rfcs/function-bit32-byteswap.md). I asked on Discord for some guidance, but for the sake of posterity: this is my first time doing this and I am likely to have made some mistakes. The biggest gaps in this implementation are the lack of tests and the lack of native codegen support. I'd appreciate help with those since I'm not sure what's relevant for me to touch for tests, and I'm told that relevant assembler instructions don't exist publicly yet. Intuition tells me that Luau-side tests would go into `tests/conformance/bitwise.luau` but this is not well documented and I'm not sure how I'm meant to test built-in implementations. The current implementation compiles down to `bswap` and `rev` on x86 and ARM respectively when optimized. --------- Co-authored-by: Arseny Kapoulkine <[email protected]>
- Loading branch information
Showing
8 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters