test_nand_1:
  #_ REGISTER_IN r4 0xFFFFFFFFFFFFFFFF
  #_ REGISTER_IN r5 0xFFFFFFFFFFFFFFFF
  nand r3, r4, r5
  blr
  #_ REGISTER_OUT r3 0x0000000000000000
  #_ REGISTER_OUT r4 0xFFFFFFFFFFFFFFFF
  #_ REGISTER_OUT r5 0xFFFFFFFFFFFFFFFF

test_nand_1_constant:
  li r4, -1
  li r5, -1
  nand r3, r4, r5
  blr
  #_ REGISTER_OUT r3 0x0000000000000000
  #_ REGISTER_OUT r4 0xFFFFFFFFFFFFFFFF
  #_ REGISTER_OUT r5 0xFFFFFFFFFFFFFFFF

test_nand_2:
  #_ REGISTER_IN r4 0xFFFFFFFFFFFFFFFE
  #_ REGISTER_IN r5 0x7FFFFFFFFFFFFFFF
  nand r3, r4, r5
  blr
  #_ REGISTER_OUT r3 0x8000000000000001
  #_ REGISTER_OUT r4 0xFFFFFFFFFFFFFFFE
  #_ REGISTER_OUT r5 0x7FFFFFFFFFFFFFFF

test_nand_2_constant:
  li r4, -1
  srdi r4, r4, 1
  sldi r4, r4, 1
  li r5, -1
  srdi r5, r5, 1
  nand r3, r4, r5
  blr
  #_ REGISTER_OUT r3 0x8000000000000001
  #_ REGISTER_OUT r4 0xFFFFFFFFFFFFFFFE
  #_ REGISTER_OUT r5 0x7FFFFFFFFFFFFFFF

test_nand_3:
  #_ REGISTER_IN r4 0x0000000000000000
  #_ REGISTER_IN r5 0xFFFFFFFFFFFFFFFF
  nand r3, r4, r5
  blr
  #_ REGISTER_OUT r3 0xFFFFFFFFFFFFFFFF
  #_ REGISTER_OUT r4 0x0000000000000000
  #_ REGISTER_OUT r5 0xFFFFFFFFFFFFFFFF

test_nand_3_constant:
  li r4, 0
  li r5, -1
  nand r3, r4, r5
  blr
  #_ REGISTER_OUT r3 0xFFFFFFFFFFFFFFFF
  #_ REGISTER_OUT r4 0x0000000000000000
  #_ REGISTER_OUT r5 0xFFFFFFFFFFFFFFFF

test_nand_4:
  #_ REGISTER_IN r4 0xFFFFFFFF00000000
  #_ REGISTER_IN r5 0x00000000FFFFFFFF
  nand r3, r4, r5
  blr
  #_ REGISTER_OUT r3 0xFFFFFFFFFFFFFFFF
  #_ REGISTER_OUT r4 0xFFFFFFFF00000000
  #_ REGISTER_OUT r5 0x00000000FFFFFFFF

test_nand_4_constant:
  li r4, -1
  clrldi r4, r4, 32
  sldi r4, r4, 32
  li r5, -1
  clrldi r5, r5, 32
  nand r3, r4, r5
  blr
  #_ REGISTER_OUT r3 0xFFFFFFFFFFFFFFFF
  #_ REGISTER_OUT r4 0xFFFFFFFF00000000
  #_ REGISTER_OUT r5 0x00000000FFFFFFFF

test_nand_5:
  #_ REGISTER_IN r4 0xF0F0F0F0F0F0F0F0
  #_ REGISTER_IN r5 0xF0F0F0F0F0F0F0F0
  nand r3, r4, r5
  blr
  #_ REGISTER_OUT r3 0x0F0F0F0F0F0F0F0F
  #_ REGISTER_OUT r4 0xF0F0F0F0F0F0F0F0
  #_ REGISTER_OUT r5 0xF0F0F0F0F0F0F0F0

test_nand_5_constant:
  lis r4, 0xF0F0
  ori r4, r4, 0xF0F0
  sldi r4, r4, 32
  oris r4, r4, 0xF0F0
  ori r4, r4, 0xF0F0
  mr r5, r4
  nand r3, r4, r5
  blr
  #_ REGISTER_OUT r3 0x0F0F0F0F0F0F0F0F
  #_ REGISTER_OUT r4 0xF0F0F0F0F0F0F0F0
  #_ REGISTER_OUT r5 0xF0F0F0F0F0F0F0F0
