qemu/tests/tcg/lm32/test_mul.S
<<
>>
Prefs
   1.include "macros.inc"
   2
   3start
   4
   5test_name MUL_1
   6mvi r1, 0
   7mvi r2, 0
   8mul r3, r1, r2
   9check_r3 0
  10
  11test_name MUL_2
  12mvi r1, 1
  13mvi r2, 0
  14mul r3, r1, r2
  15check_r3 0
  16
  17test_name MUL_3
  18mvi r1, 0
  19mvi r2, 1
  20mul r3, r1, r2
  21check_r3 0
  22
  23test_name MUL_4
  24mvi r1, 1
  25mvi r2, 1
  26mul r3, r1, r2
  27check_r3 1
  28
  29test_name MUL_5
  30mvi r1, 2
  31mvi r2, -1
  32mul r3, r1, r2
  33check_r3 -2
  34
  35test_name MUL_6
  36mvi r1, -2
  37mvi r2, -1
  38mul r3, r1, r2
  39check_r3 2
  40
  41test_name MUL_7
  42mvi r1, 0x1234
  43mvi r2, 0x789
  44mul r3, r1, r2
  45check_r3 0x8929d4
  46
  47test_name MUL_8
  48mvi r3, 4
  49mul r3, r3, r3
  50check_r3 16
  51
  52test_name MUL_9
  53mvi r2, 2
  54mvi r3, 4
  55mul r3, r3, r2
  56check_r3 8
  57
  58test_name MUL_10
  59load r1 0x12345678
  60load r2 0x7bcdef12
  61mul r3, r1, r2
  62check_r3 0xa801c70
  63
  64test_name MUL_11
  65load r1 0x12345678
  66load r2 0xabcdef12
  67mul r3, r1, r2
  68check_r3 0x8a801c70
  69
  70end
  71