Files
mercury/tests/hard_coded/rotate_uint64.exp
Julien Fischer 451bb5a181 Add bitwise rotations for uint64s.
library/uint64.m:
    As above.

tests/hard_coded/Mmakefile:
tests/hard_coded/rotate_uint64.{m,exp}:
    Add a test for the new operations.
2021-03-28 20:01:08 +11:00

89 lines
8.2 KiB
Plaintext

*** Test 'rotate_left' ***
rotate_left(0000000000000000000000000000000000000000000000000000000000000001, 0) = 0000000000000000000000000000000000000000000000000000000000000001
unchecked_rotate_left(0000000000000000000000000000000000000000000000000000000000000001, 0) = 0000000000000000000000000000000000000000000000000000000000000001
rotate_left(0000000000000000000000000000000000000000000000000000000000000001, 1) = 0000000000000000000000000000000000000000000000000000000000000010
unchecked_rotate_left(0000000000000000000000000000000000000000000000000000000000000001, 1) = 0000000000000000000000000000000000000000000000000000000000000010
rotate_left(0000000000000000000000000000000000000000000000000000000000000001, 2) = 0000000000000000000000000000000000000000000000000000000000000100
unchecked_rotate_left(0000000000000000000000000000000000000000000000000000000000000001, 2) = 0000000000000000000000000000000000000000000000000000000000000100
rotate_left(0000000000000000000000000000000000000000000000000000000000000001, 63) = 1000000000000000000000000000000000000000000000000000000000000000
unchecked_rotate_left(0000000000000000000000000000000000000000000000000000000000000001, 63) = 1000000000000000000000000000000000000000000000000000000000000000
rotate_left(0000000000000000000000000000000000000000000000000000000000000001, 64) = <<exception>>
unchecked_rotate_left(0000000000000000000000000000000000000000000000000000000000000001, 64) = 0000000000000000000000000000000000000000000000000000000000000001
rotate_left(0000000000000000000000000000000000000000000000000000000000000001, 127) = <<exception>>
unchecked_rotate_left(0000000000000000000000000000000000000000000000000000000000000001, 127) = 1000000000000000000000000000000000000000000000000000000000000000
rotate_left(0000000000000000000000000000000000000000000000000000000000000001, 128) = <<exception>>
unchecked_rotate_left(0000000000000000000000000000000000000000000000000000000000000001, 128) = 0000000000000000000000000000000000000000000000000000000000000001
rotate_left(0000000000000000000000000000000000000000000000000000000011111111, 0) = 0000000000000000000000000000000000000000000000000000000011111111
unchecked_rotate_left(0000000000000000000000000000000000000000000000000000000011111111, 0) = 0000000000000000000000000000000000000000000000000000000011111111
rotate_left(0000000000000000000000000000000000000000000000000000000011111111, 1) = 0000000000000000000000000000000000000000000000000000000111111110
unchecked_rotate_left(0000000000000000000000000000000000000000000000000000000011111111, 1) = 0000000000000000000000000000000000000000000000000000000111111110
rotate_left(0000000000000000000000000000000000000000000000000000000011111111, 2) = 0000000000000000000000000000000000000000000000000000001111111100
unchecked_rotate_left(0000000000000000000000000000000000000000000000000000000011111111, 2) = 0000000000000000000000000000000000000000000000000000001111111100
rotate_left(0000000000000000000000000000000000000000000000000000000011111111, 63) = 1000000000000000000000000000000000000000000000000000000001111111
unchecked_rotate_left(0000000000000000000000000000000000000000000000000000000011111111, 63) = 1000000000000000000000000000000000000000000000000000000001111111
rotate_left(0000000000000000000000000000000000000000000000000000000011111111, 64) = <<exception>>
unchecked_rotate_left(0000000000000000000000000000000000000000000000000000000011111111, 64) = 0000000000000000000000000000000000000000000000000000000011111111
rotate_left(0000000000000000000000000000000000000000000000000000000011111111, 127) = <<exception>>
unchecked_rotate_left(0000000000000000000000000000000000000000000000000000000011111111, 127) = 1000000000000000000000000000000000000000000000000000000001111111
rotate_left(0000000000000000000000000000000000000000000000000000000011111111, 128) = <<exception>>
unchecked_rotate_left(0000000000000000000000000000000000000000000000000000000011111111, 128) = 0000000000000000000000000000000000000000000000000000000011111111
*** Test 'rotate_right' ***
rotate_right(0000000000000000000000000000000000000000000000000000000000000001, 0) = 0000000000000000000000000000000000000000000000000000000000000001
unchecked_rotate_right(0000000000000000000000000000000000000000000000000000000000000001, 0) = 0000000000000000000000000000000000000000000000000000000000000001
rotate_right(0000000000000000000000000000000000000000000000000000000000000001, 1) = 1000000000000000000000000000000000000000000000000000000000000000
unchecked_rotate_right(0000000000000000000000000000000000000000000000000000000000000001, 1) = 1000000000000000000000000000000000000000000000000000000000000000
rotate_right(0000000000000000000000000000000000000000000000000000000000000001, 2) = 0100000000000000000000000000000000000000000000000000000000000000
unchecked_rotate_right(0000000000000000000000000000000000000000000000000000000000000001, 2) = 0100000000000000000000000000000000000000000000000000000000000000
rotate_right(0000000000000000000000000000000000000000000000000000000000000001, 63) = 0000000000000000000000000000000000000000000000000000000000000010
unchecked_rotate_right(0000000000000000000000000000000000000000000000000000000000000001, 63) = 0000000000000000000000000000000000000000000000000000000000000010
rotate_right(0000000000000000000000000000000000000000000000000000000000000001, 64) = <<exception>>
unchecked_rotate_right(0000000000000000000000000000000000000000000000000000000000000001, 64) = 0000000000000000000000000000000000000000000000000000000000000001
rotate_right(0000000000000000000000000000000000000000000000000000000000000001, 127) = <<exception>>
unchecked_rotate_right(0000000000000000000000000000000000000000000000000000000000000001, 127) = 0000000000000000000000000000000000000000000000000000000000000010
rotate_right(0000000000000000000000000000000000000000000000000000000000000001, 128) = <<exception>>
unchecked_rotate_right(0000000000000000000000000000000000000000000000000000000000000001, 128) = 0000000000000000000000000000000000000000000000000000000000000001
rotate_right(0000000000000000000000000000000000000000000000000000000011111111, 0) = 0000000000000000000000000000000000000000000000000000000011111111
unchecked_rotate_right(0000000000000000000000000000000000000000000000000000000011111111, 0) = 0000000000000000000000000000000000000000000000000000000011111111
rotate_right(0000000000000000000000000000000000000000000000000000000011111111, 1) = 1000000000000000000000000000000000000000000000000000000001111111
unchecked_rotate_right(0000000000000000000000000000000000000000000000000000000011111111, 1) = 1000000000000000000000000000000000000000000000000000000001111111
rotate_right(0000000000000000000000000000000000000000000000000000000011111111, 2) = 1100000000000000000000000000000000000000000000000000000000111111
unchecked_rotate_right(0000000000000000000000000000000000000000000000000000000011111111, 2) = 1100000000000000000000000000000000000000000000000000000000111111
rotate_right(0000000000000000000000000000000000000000000000000000000011111111, 63) = 0000000000000000000000000000000000000000000000000000000111111110
unchecked_rotate_right(0000000000000000000000000000000000000000000000000000000011111111, 63) = 0000000000000000000000000000000000000000000000000000000111111110
rotate_right(0000000000000000000000000000000000000000000000000000000011111111, 64) = <<exception>>
unchecked_rotate_right(0000000000000000000000000000000000000000000000000000000011111111, 64) = 0000000000000000000000000000000000000000000000000000000011111111
rotate_right(0000000000000000000000000000000000000000000000000000000011111111, 127) = <<exception>>
unchecked_rotate_right(0000000000000000000000000000000000000000000000000000000011111111, 127) = 0000000000000000000000000000000000000000000000000000000111111110
rotate_right(0000000000000000000000000000000000000000000000000000000011111111, 128) = <<exception>>
unchecked_rotate_right(0000000000000000000000000000000000000000000000000000000011111111, 128) = 0000000000000000000000000000000000000000000000000000000011111111