Commit Graph

2 Commits

Author SHA1 Message Date
Julien Fischer
ca7ae00c36 More library predicates for 64-bit integers.
library/io.m:
     Add predicates for writing 64-bit integers to binary streams.

library/int64.m:
     Add reverse_bytes/1.

library/uint64.m:
     Add reverse_bytes/1 and cast_from_int64/1.

runtime/mercury_int.h:
     Add MR_uint64_reverse_bytes.

tests/hard_coded/write_binary_multibyte_int.{m,exp}:
     Extend this test to cover 64-bit integers.
2018-02-08 08:51:39 -05:00
Julien Fischer
db05403325 Writing 16- and 32-bit integers to binary file streams.
Add predicates for writing 16- and 32-bit integers to binary file streams in
native, little and big endian byte order to the standard library.

library/io.m:
    Add the new predicates.

library/uint16.m:
library/uint32.m:
    Add a functions for casting from the signed to unsigned versions
    of these types.

runtime/mercury_int.h:
    New header intended to hold things related to the implementation
    of the integer types in C grades.  Currently it contains the
    macros defining the byte reverse operations for 16- and 32-bit
    types.   (It will eventually contain macros for (un)boxing 64-bit
    integer types on 32-bit platforms as well.)

runtime/mercury_imp.h:
runtime/Mmakefile:
     Add the new header.

tests/hard_coded/Mmakefile:
tests/write_binary_multibyte_int.{m,exp}:
     Add a test for the new predicates.
2017-09-25 06:50:42 -04:00