luau/Common/include/Luau
Micah 011c1afbde
Implement bit32.byteswap (#1075)
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 <arseny.kapoulkine@gmail.com>
2023-10-23 08:00:48 -07:00
..
Bytecode.h Implement bit32.byteswap (#1075) 2023-10-23 08:00:48 -07:00
BytecodeUtils.h Sync to upstream/release/591 (#1012) 2023-08-18 11:15:41 -07:00
Common.h Sync to upstream/release/560 (#810) 2023-01-20 12:27:03 -08:00
DenseHash.h Sync to upstream/release/592 (#1018) 2023-08-25 10:23:55 -07:00
ExperimentalFlags.h Sync to upstream/release/595 (#1044) 2023-09-15 10:26:59 -07:00