Estimated hours taken: 0.2
compiler/rl_code.m:
compiler/bytecode_data.m:
Move code to convert a string to a list of bytes from
rl_code.m to be near similar code for ints and floats
in bytecode_data.m.
Remove some unnecessary module imports.
Estimated hours taken: 0.1
compiler/bytecode_data.m:
Fix a bug in my previous change - use `2 ** (Bits - 1)'
rather than `2 ** Bits' when computing the maximum
value a signed integer type can hold.
Estimated hours taken: 0.1
compiler/bytecode_data.m:
Fix a bug in checking whether a negative integer
fits in a certain number of bits. There isn't a
test case for this because the integer sizes less than
a word are only ever used for positive numbers.
Estimated hours taken: 2
Fix bugs in the Aditi bytecode output routines.
compiler/bytecode.m:
compiler/bytecode_data.m:
Move the data conversion predicates from bytecode.m to a new module
so they can be used by for output of Aditi-RL bytecode in the
compiler and in the RL bytecode assembler in the Aditi distribution.
Add new predicates to convert integers and floats to lists of
bytes rather than writing them out immediately.
compiler/rl_code.m:
Use the same data conversion predicates for Aditi-RL
bytecodes as for Mercury bytecodes.
This fixes a bug with the output of integers on 32 bit machines
(integers were being shifted by more than the width of the type,
the result of which is undefined) and endianness problems with
floating point numbers.