qemu/tests/tcg/lm32/test_lh.S
<<
>>
Prefs
   1.include "macros.inc"
   2
   3start
   4
   5test_name LH_1
   6load r1 data
   7lh r3, (r1+0)
   8check_r3 0x7e7f
   9
  10test_name LH_2
  11load r1 data
  12lh r3, (r1+2)
  13check_r3 0x7071
  14
  15test_name LH_3
  16load r1 data
  17lh r3, (r1+-2)
  18check_r3 0x7c7d
  19
  20test_name LH_4
  21load r1 data_msb
  22lh r3, (r1+0)
  23check_r3 0xfffffeff
  24
  25test_name LH_5
  26load r1 data_msb
  27lh r3, (r1+2)
  28check_r3 0xfffff0f1
  29
  30test_name LH_6
  31load r1 data_msb
  32lh r3, (r1+-2)
  33check_r3 0xfffffcfd
  34
  35test_name LH_7
  36load r3 data
  37lh r3, (r3+0)
  38check_r3 0x7e7f
  39
  40end
  41
  42.data
  43        .align 4
  44        .byte 0x7a, 0x7b, 0x7c, 0x7d
  45data:
  46        .byte 0x7e, 0x7f, 0x70, 0x71
  47        .byte 0xfa, 0xfb, 0xfc, 0xfd
  48data_msb:
  49        .byte 0xfe, 0xff, 0xf0, 0xf1
  50