Unsigned integer constants
I encountered an issue where:
- 32-bit ABC code is interpreted on a 64-bit platform (e.g. compile with 32-bit Clean, run in WebAssembly)
- The code uses negative integer constants with unsigned semantics (e.g.
When generating 64-bit bytecode this value is sign-extended, since there is no way to tell that this value should be
0x0000000080000000 on 64-bit platforms.
The issue could be solved by computing the values at runtime (clean-and-itasks/clean-platform!386 (merged)) using only positive values. Performance-wise this is not ideal.
Would it be very difficult to add syntax for unsigned integer constants, e.g.
0ux80000000 (neither of these is fully backwards compatible) all the way down to the ABC level so that the bytecode generator knows how the value should be extended? Or do you see another way to solve this without losing performance?