assemblyscript icon indicating copy to clipboard operation
assemblyscript copied to clipboard

Move bswap to builtins. Remove bswap16

Open MaxGraey opened this issue 1 year ago • 1 comments

  • Remove bswap from polyfills.ts and expose it as compiler's builtin.
  • Remove bswap16. We didn't use it and I can't imagine where it would be needed. So removing it and don't mark this PR as breaking changed due to its mostly internal change.
  • Add Type#toUnsigned helper which try to force type to unsigned. Useful for sign agnostic operations, especially generic types, due to reduce polymorphic noise.
  • Remove polyfills.ts and according tests. Move bswap tests to tests/builtins
  • [x] I've read the contributing guidelines
  • [x] I've added my name and email to the NOTICE file

MaxGraey avatar Aug 07 '22 18:08 MaxGraey

It might even be worth transferring this to builtins.ts and generating it immediately to binaryen IR.

MaxGraey avatar Aug 08 '22 05:08 MaxGraey