Basis-Universal-Transcoders
Basis-Universal-Transcoders copied to clipboard
[proposal] Refactor bitreverse routines
Replace it to builtin intrinsics after landing https://github.com/AssemblyScript/assemblyscript/pull/1474
Couple thoughts after looking into the proposal.
- Using those intrinsics here would require careful
-- memoryBasehandling to preventREV_LUTfrom overwriting used memory. Moreover, some future standard library update may potentially break these assumptions. - In general, we'd prefer to avoid non-trivial external functions that may make porting this project to other languages or platforms more complicated. This particular change looks straightforward enough, though.
__heap_base already depend on optimization level, also, not only memory.data write to data section, it also happening for constant strings and other things. So it required changes in any way. Probably you don't affect to any issue due to your starting offset much bigger than 1024, but may happening in future.
Another option you could just leave everithing "as is" and don't use newly builtin bitrev intrinsic. This issue is just one more suggestion
Using __heap_base seems fine. I somehow missed it in the docs.