Files
mercury/tests/hard_coded/bitwise_int8.exp
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

1381 lines
12 KiB
Plaintext

*** Test unary operation '\' ***
\ 10000000 =
01111111
\ 00000000 =
11111111
\ 00000001 =
11111110
\ 00000010 =
11111101
\ 00001000 =
11110111
\ 00001010 =
11110101
\ 00010000 =
11101111
\ 01111111 =
10000000
*** Test binary operation '/\' ***
10000000 /\
10000000 =
10000000
10000000 /\
00000000 =
00000000
10000000 /\
00000001 =
00000000
10000000 /\
00000010 =
00000000
10000000 /\
00001000 =
00000000
10000000 /\
00001010 =
00000000
10000000 /\
00010000 =
00000000
10000000 /\
01111111 =
00000000
00000000 /\
10000000 =
00000000
00000000 /\
00000000 =
00000000
00000000 /\
00000001 =
00000000
00000000 /\
00000010 =
00000000
00000000 /\
00001000 =
00000000
00000000 /\
00001010 =
00000000
00000000 /\
00010000 =
00000000
00000000 /\
01111111 =
00000000
00000001 /\
10000000 =
00000000
00000001 /\
00000000 =
00000000
00000001 /\
00000001 =
00000001
00000001 /\
00000010 =
00000000
00000001 /\
00001000 =
00000000
00000001 /\
00001010 =
00000000
00000001 /\
00010000 =
00000000
00000001 /\
01111111 =
00000001
00000010 /\
10000000 =
00000000
00000010 /\
00000000 =
00000000
00000010 /\
00000001 =
00000000
00000010 /\
00000010 =
00000010
00000010 /\
00001000 =
00000000
00000010 /\
00001010 =
00000010
00000010 /\
00010000 =
00000000
00000010 /\
01111111 =
00000010
00001000 /\
10000000 =
00000000
00001000 /\
00000000 =
00000000
00001000 /\
00000001 =
00000000
00001000 /\
00000010 =
00000000
00001000 /\
00001000 =
00001000
00001000 /\
00001010 =
00001000
00001000 /\
00010000 =
00000000
00001000 /\
01111111 =
00001000
00001010 /\
10000000 =
00000000
00001010 /\
00000000 =
00000000
00001010 /\
00000001 =
00000000
00001010 /\
00000010 =
00000010
00001010 /\
00001000 =
00001000
00001010 /\
00001010 =
00001010
00001010 /\
00010000 =
00000000
00001010 /\
01111111 =
00001010
00010000 /\
10000000 =
00000000
00010000 /\
00000000 =
00000000
00010000 /\
00000001 =
00000000
00010000 /\
00000010 =
00000000
00010000 /\
00001000 =
00000000
00010000 /\
00001010 =
00000000
00010000 /\
00010000 =
00010000
00010000 /\
01111111 =
00010000
01111111 /\
10000000 =
00000000
01111111 /\
00000000 =
00000000
01111111 /\
00000001 =
00000001
01111111 /\
00000010 =
00000010
01111111 /\
00001000 =
00001000
01111111 /\
00001010 =
00001010
01111111 /\
00010000 =
00010000
01111111 /\
01111111 =
01111111
*** Test binary operation '\/' ***
10000000 \/
10000000 =
10000000
10000000 \/
00000000 =
10000000
10000000 \/
00000001 =
10000001
10000000 \/
00000010 =
10000010
10000000 \/
00001000 =
10001000
10000000 \/
00001010 =
10001010
10000000 \/
00010000 =
10010000
10000000 \/
01111111 =
11111111
00000000 \/
10000000 =
10000000
00000000 \/
00000000 =
00000000
00000000 \/
00000001 =
00000001
00000000 \/
00000010 =
00000010
00000000 \/
00001000 =
00001000
00000000 \/
00001010 =
00001010
00000000 \/
00010000 =
00010000
00000000 \/
01111111 =
01111111
00000001 \/
10000000 =
10000001
00000001 \/
00000000 =
00000001
00000001 \/
00000001 =
00000001
00000001 \/
00000010 =
00000011
00000001 \/
00001000 =
00001001
00000001 \/
00001010 =
00001011
00000001 \/
00010000 =
00010001
00000001 \/
01111111 =
01111111
00000010 \/
10000000 =
10000010
00000010 \/
00000000 =
00000010
00000010 \/
00000001 =
00000011
00000010 \/
00000010 =
00000010
00000010 \/
00001000 =
00001010
00000010 \/
00001010 =
00001010
00000010 \/
00010000 =
00010010
00000010 \/
01111111 =
01111111
00001000 \/
10000000 =
10001000
00001000 \/
00000000 =
00001000
00001000 \/
00000001 =
00001001
00001000 \/
00000010 =
00001010
00001000 \/
00001000 =
00001000
00001000 \/
00001010 =
00001010
00001000 \/
00010000 =
00011000
00001000 \/
01111111 =
01111111
00001010 \/
10000000 =
10001010
00001010 \/
00000000 =
00001010
00001010 \/
00000001 =
00001011
00001010 \/
00000010 =
00001010
00001010 \/
00001000 =
00001010
00001010 \/
00001010 =
00001010
00001010 \/
00010000 =
00011010
00001010 \/
01111111 =
01111111
00010000 \/
10000000 =
10010000
00010000 \/
00000000 =
00010000
00010000 \/
00000001 =
00010001
00010000 \/
00000010 =
00010010
00010000 \/
00001000 =
00011000
00010000 \/
00001010 =
00011010
00010000 \/
00010000 =
00010000
00010000 \/
01111111 =
01111111
01111111 \/
10000000 =
11111111
01111111 \/
00000000 =
01111111
01111111 \/
00000001 =
01111111
01111111 \/
00000010 =
01111111
01111111 \/
00001000 =
01111111
01111111 \/
00001010 =
01111111
01111111 \/
00010000 =
01111111
01111111 \/
01111111 =
01111111
*** Test binary operation 'xor' ***
10000000 xor
10000000 =
00000000
10000000 xor
00000000 =
10000000
10000000 xor
00000001 =
10000001
10000000 xor
00000010 =
10000010
10000000 xor
00001000 =
10001000
10000000 xor
00001010 =
10001010
10000000 xor
00010000 =
10010000
10000000 xor
01111111 =
11111111
00000000 xor
10000000 =
10000000
00000000 xor
00000000 =
00000000
00000000 xor
00000001 =
00000001
00000000 xor
00000010 =
00000010
00000000 xor
00001000 =
00001000
00000000 xor
00001010 =
00001010
00000000 xor
00010000 =
00010000
00000000 xor
01111111 =
01111111
00000001 xor
10000000 =
10000001
00000001 xor
00000000 =
00000001
00000001 xor
00000001 =
00000000
00000001 xor
00000010 =
00000011
00000001 xor
00001000 =
00001001
00000001 xor
00001010 =
00001011
00000001 xor
00010000 =
00010001
00000001 xor
01111111 =
01111110
00000010 xor
10000000 =
10000010
00000010 xor
00000000 =
00000010
00000010 xor
00000001 =
00000011
00000010 xor
00000010 =
00000000
00000010 xor
00001000 =
00001010
00000010 xor
00001010 =
00001000
00000010 xor
00010000 =
00010010
00000010 xor
01111111 =
01111101
00001000 xor
10000000 =
10001000
00001000 xor
00000000 =
00001000
00001000 xor
00000001 =
00001001
00001000 xor
00000010 =
00001010
00001000 xor
00001000 =
00000000
00001000 xor
00001010 =
00000010
00001000 xor
00010000 =
00011000
00001000 xor
01111111 =
01110111
00001010 xor
10000000 =
10001010
00001010 xor
00000000 =
00001010
00001010 xor
00000001 =
00001011
00001010 xor
00000010 =
00001000
00001010 xor
00001000 =
00000010
00001010 xor
00001010 =
00000000
00001010 xor
00010000 =
00011010
00001010 xor
01111111 =
01110101
00010000 xor
10000000 =
10010000
00010000 xor
00000000 =
00010000
00010000 xor
00000001 =
00010001
00010000 xor
00000010 =
00010010
00010000 xor
00001000 =
00011000
00010000 xor
00001010 =
00011010
00010000 xor
00010000 =
00000000
00010000 xor
01111111 =
01101111
01111111 xor
10000000 =
11111111
01111111 xor
00000000 =
01111111
01111111 xor
00000001 =
01111110
01111111 xor
00000010 =
01111101
01111111 xor
00001000 =
01110111
01111111 xor
00001010 =
01110101
01111111 xor
00010000 =
01101111
01111111 xor
01111111 =
00000000
*** Test shift operations '>>' and '>>u' ***
10000000 >> -1 =
<<exception>>
10000000 >> 0 =
10000000
10000000 >> 1 =
11000000
10000000 >> 2 =
11100000
10000000 >> 3 =
11110000
10000000 >> 4 =
11111000
10000000 >> 5 =
11111100
10000000 >> 6 =
11111110
10000000 >> 7 =
11111111
10000000 >> 8 =
<<exception>>
10000000 >> 16 =
<<exception>>
10000000 >> 17 =
<<exception>>
00000000 >> -1 =
<<exception>>
00000000 >> 0 =
00000000
00000000 >> 1 =
00000000
00000000 >> 2 =
00000000
00000000 >> 3 =
00000000
00000000 >> 4 =
00000000
00000000 >> 5 =
00000000
00000000 >> 6 =
00000000
00000000 >> 7 =
00000000
00000000 >> 8 =
<<exception>>
00000000 >> 16 =
<<exception>>
00000000 >> 17 =
<<exception>>
00000001 >> -1 =
<<exception>>
00000001 >> 0 =
00000001
00000001 >> 1 =
00000000
00000001 >> 2 =
00000000
00000001 >> 3 =
00000000
00000001 >> 4 =
00000000
00000001 >> 5 =
00000000
00000001 >> 6 =
00000000
00000001 >> 7 =
00000000
00000001 >> 8 =
<<exception>>
00000001 >> 16 =
<<exception>>
00000001 >> 17 =
<<exception>>
00000010 >> -1 =
<<exception>>
00000010 >> 0 =
00000010
00000010 >> 1 =
00000001
00000010 >> 2 =
00000000
00000010 >> 3 =
00000000
00000010 >> 4 =
00000000
00000010 >> 5 =
00000000
00000010 >> 6 =
00000000
00000010 >> 7 =
00000000
00000010 >> 8 =
<<exception>>
00000010 >> 16 =
<<exception>>
00000010 >> 17 =
<<exception>>
00001000 >> -1 =
<<exception>>
00001000 >> 0 =
00001000
00001000 >> 1 =
00000100
00001000 >> 2 =
00000010
00001000 >> 3 =
00000001
00001000 >> 4 =
00000000
00001000 >> 5 =
00000000
00001000 >> 6 =
00000000
00001000 >> 7 =
00000000
00001000 >> 8 =
<<exception>>
00001000 >> 16 =
<<exception>>
00001000 >> 17 =
<<exception>>
00001010 >> -1 =
<<exception>>
00001010 >> 0 =
00001010
00001010 >> 1 =
00000101
00001010 >> 2 =
00000010
00001010 >> 3 =
00000001
00001010 >> 4 =
00000000
00001010 >> 5 =
00000000
00001010 >> 6 =
00000000
00001010 >> 7 =
00000000
00001010 >> 8 =
<<exception>>
00001010 >> 16 =
<<exception>>
00001010 >> 17 =
<<exception>>
00010000 >> -1 =
<<exception>>
00010000 >> 0 =
00010000
00010000 >> 1 =
00001000
00010000 >> 2 =
00000100
00010000 >> 3 =
00000010
00010000 >> 4 =
00000001
00010000 >> 5 =
00000000
00010000 >> 6 =
00000000
00010000 >> 7 =
00000000
00010000 >> 8 =
<<exception>>
00010000 >> 16 =
<<exception>>
00010000 >> 17 =
<<exception>>
01111111 >> -1 =
<<exception>>
01111111 >> 0 =
01111111
01111111 >> 1 =
00111111
01111111 >> 2 =
00011111
01111111 >> 3 =
00001111
01111111 >> 4 =
00000111
01111111 >> 5 =
00000011
01111111 >> 6 =
00000001
01111111 >> 7 =
00000000
01111111 >> 8 =
<<exception>>
01111111 >> 16 =
<<exception>>
01111111 >> 17 =
<<exception>>
*** Test shift operations '<<' and '<<u' ***
10000000 << -1 =
<<exception>>
10000000 << 0 =
10000000
10000000 << 1 =
00000000
10000000 << 2 =
00000000
10000000 << 3 =
00000000
10000000 << 4 =
00000000
10000000 << 5 =
00000000
10000000 << 6 =
00000000
10000000 << 7 =
00000000
10000000 << 8 =
<<exception>>
10000000 << 16 =
<<exception>>
10000000 << 17 =
<<exception>>
00000000 << -1 =
<<exception>>
00000000 << 0 =
00000000
00000000 << 1 =
00000000
00000000 << 2 =
00000000
00000000 << 3 =
00000000
00000000 << 4 =
00000000
00000000 << 5 =
00000000
00000000 << 6 =
00000000
00000000 << 7 =
00000000
00000000 << 8 =
<<exception>>
00000000 << 16 =
<<exception>>
00000000 << 17 =
<<exception>>
00000001 << -1 =
<<exception>>
00000001 << 0 =
00000001
00000001 << 1 =
00000010
00000001 << 2 =
00000100
00000001 << 3 =
00001000
00000001 << 4 =
00010000
00000001 << 5 =
00100000
00000001 << 6 =
01000000
00000001 << 7 =
10000000
00000001 << 8 =
<<exception>>
00000001 << 16 =
<<exception>>
00000001 << 17 =
<<exception>>
00000010 << -1 =
<<exception>>
00000010 << 0 =
00000010
00000010 << 1 =
00000100
00000010 << 2 =
00001000
00000010 << 3 =
00010000
00000010 << 4 =
00100000
00000010 << 5 =
01000000
00000010 << 6 =
10000000
00000010 << 7 =
00000000
00000010 << 8 =
<<exception>>
00000010 << 16 =
<<exception>>
00000010 << 17 =
<<exception>>
00001000 << -1 =
<<exception>>
00001000 << 0 =
00001000
00001000 << 1 =
00010000
00001000 << 2 =
00100000
00001000 << 3 =
01000000
00001000 << 4 =
10000000
00001000 << 5 =
00000000
00001000 << 6 =
00000000
00001000 << 7 =
00000000
00001000 << 8 =
<<exception>>
00001000 << 16 =
<<exception>>
00001000 << 17 =
<<exception>>
00001010 << -1 =
<<exception>>
00001010 << 0 =
00001010
00001010 << 1 =
00010100
00001010 << 2 =
00101000
00001010 << 3 =
01010000
00001010 << 4 =
10100000
00001010 << 5 =
01000000
00001010 << 6 =
10000000
00001010 << 7 =
00000000
00001010 << 8 =
<<exception>>
00001010 << 16 =
<<exception>>
00001010 << 17 =
<<exception>>
00010000 << -1 =
<<exception>>
00010000 << 0 =
00010000
00010000 << 1 =
00100000
00010000 << 2 =
01000000
00010000 << 3 =
10000000
00010000 << 4 =
00000000
00010000 << 5 =
00000000
00010000 << 6 =
00000000
00010000 << 7 =
00000000
00010000 << 8 =
<<exception>>
00010000 << 16 =
<<exception>>
00010000 << 17 =
<<exception>>
01111111 << -1 =
<<exception>>
01111111 << 0 =
01111111
01111111 << 1 =
11111110
01111111 << 2 =
11111100
01111111 << 3 =
11111000
01111111 << 4 =
11110000
01111111 << 5 =
11100000
01111111 << 6 =
11000000
01111111 << 7 =
10000000
01111111 << 8 =
<<exception>>
01111111 << 16 =
<<exception>>
01111111 << 17 =
<<exception>>