Commit Graph

4 Commits

Author SHA1 Message Date
Zoltan Somogyi
4c528d429d Add <<u and >>u to library/{int,uint}*.m ...
... along with their unchecked equivalents. These differ from <<, >> and
their unchecked equivalents in that they take the shift amount as a uint,
instead of an int.

library/int.m:
library/int16.m:
library/int32.m:
library/int64.m:
library/int8.m:
library/uint.m:
library/uint16.m:
library/uint32.m:
library/uint64.m:
library/uint8.m:
    As above. The unchecked versions have only declarations, since
    these operations have been recognized as builtins for a while now.

NEWS:
    Document the new operations, and the recent change to recognize
    <<u and >>u as single tokens, and fix a typo in a recent addition.

configure.ac:
    Require the compiler to be sufficiently recent to be able to parse
    <<u and >>u as operators.

compiler/options.m:
    Provide a way for a later change to configure.ac to detect the presence
    of this change.

tests/hard_coded/bitwise_int.exp:
tests/hard_coded/bitwise_int.exp2:
tests/hard_coded/bitwise_int.m:
tests/hard_coded/bitwise_int16.exp:
tests/hard_coded/bitwise_int16.m:
tests/hard_coded/bitwise_int32.exp:
tests/hard_coded/bitwise_int32.m:
tests/hard_coded/bitwise_int64.exp:
tests/hard_coded/bitwise_int64.m:
tests/hard_coded/bitwise_int8.exp:
tests/hard_coded/bitwise_int8.m:
tests/hard_coded/bitwise_uint.exp:
tests/hard_coded/bitwise_uint.exp2:
tests/hard_coded/bitwise_uint.m:
tests/hard_coded/bitwise_uint16.exp:
tests/hard_coded/bitwise_uint16.m:
tests/hard_coded/bitwise_uint32.exp:
tests/hard_coded/bitwise_uint32.m:
tests/hard_coded/bitwise_uint64.exp:
tests/hard_coded/bitwise_uint64.m:
tests/hard_coded/bitwise_uint8.exp:
tests/hard_coded/bitwise_uint8.m:
    Check that <<u and >>u compute the same results as << and >> respectively.
2022-12-07 23:12:33 +11:00
Zoltan Somogyi
3c3c072a33 Make bitwise op tests' .exp files more readable.
tests/hard_coded/bitwise_int.m:
tests/hard_coded/bitwise_int16.m:
tests/hard_coded/bitwise_int32.m:
tests/hard_coded/bitwise_int64.m:
tests/hard_coded/bitwise_int8.m:
tests/hard_coded/bitwise_uint.m:
tests/hard_coded/bitwise_uint16.m:
tests/hard_coded/bitwise_uint32.m:
tests/hard_coded/bitwise_uint64.m:
tests/hard_coded/bitwise_uint8.m:
    Most of the expected output files of these test cases were
    easily readable already, but there were some exceptions caused
    by unnecessary differences between their source codes.

    The main problem was with bitwise_uint.m (uint_bitwise.m until recently),
    whose .exp file contained very long lines of the form A op B = C
    where A, B and C could each be 64 bits (and chars) long. Fix this
    by adopting the format used by the other modules:

        A op
        B =
        C

    The other problem was that in some test cases, the indentation had
    an off-by-one bug. They generated output such as

        \ aaaa =
         bbbb

    instead of the much-easier-to-visually-check

        \ aaaa =
          bbbb

    A third, much less important change is the deletion of unnecessary
    blank lines.

tests/hard_coded/bitwise_int.exp:
tests/hard_coded/bitwise_int16.exp:
tests/hard_coded/bitwise_int32.exp:
tests/hard_coded/bitwise_int64.exp:
tests/hard_coded/bitwise_int8.exp:
tests/hard_coded/bitwise_uint.exp:
tests/hard_coded/bitwise_uint16.exp:
tests/hard_coded/bitwise_uint32.exp:
tests/hard_coded/bitwise_uint64.exp:
tests/hard_coded/bitwise_uint8.exp:
    Conform to the changes in codes of the tests.
2022-12-05 21:25:07 +11:00
Peter Wang
ecdf8ae7dd Fix typos in test cases.
tests/hard_coded/bit_twiddle_int16.exp:
tests/hard_coded/bit_twiddle_int16.m:
tests/hard_coded/bitwise_int32.exp:
tests/hard_coded/bitwise_int32.m:
    Fix typos in test cases and update expected outputs.
2018-10-29 10:20:48 +11:00
Julien Fischer
5d3633f0ca Add tests of bitwise operations for fixed sized integers.
tests/hard_coded/Mmakefile:
tests/hard_coded/bitwise*.{m,exp}:
     As above.
2017-08-27 02:05:29 +10:00