subl.s 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. # Hitachi H8 testcase 'sub.l'
  2. # mach(): h8300h h8300s h8sx
  3. # as(h8300): --defsym sim_cpu=0
  4. # as(h8300h): --defsym sim_cpu=1
  5. # as(h8300s): --defsym sim_cpu=2
  6. # as(h8sx): --defsym sim_cpu=3
  7. # ld(h8300h): -m h8300helf
  8. # ld(h8300s): -m h8300self
  9. # ld(h8sx): -m h8300sxelf
  10. .include "testutils.inc"
  11. start
  12. .if (sim_cpu == h8sx) ;
  13. sub_l_imm3: ; 3-bit immediate mode only for h8sx
  14. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  15. ;; fixme set ccr
  16. ;; sub.l #xx:3,eRd ; Immediate 3-bit operand
  17. sub.l #7:3, er0
  18. ;; fixme test ccr ; H=0 N=1 Z=0 V=0 C=0
  19. test_h_gr32 0xa5a5a59e er0 ; sub result: a5a5 - 7
  20. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  21. test_gr_a5a5 2
  22. test_gr_a5a5 3
  23. test_gr_a5a5 4
  24. test_gr_a5a5 5
  25. test_gr_a5a5 6
  26. test_gr_a5a5 7
  27. sub_l_imm16: ; sub immediate 16-bit value
  28. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  29. ;; fixme set ccr
  30. ;; sub.l #xx:16,eRd ; Immediate 16-bit operand
  31. sub.l #0x1111:16, er0
  32. ;; fixme test ccr ; H=0 N=1 Z=0 V=0 C=0
  33. test_h_gr16 0x9494 r0 ; sub result: a5a5 - 1111
  34. test_h_gr32 0xa5a59494 er0 ; sub result: a5a5 - 1111
  35. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  36. test_gr_a5a5 2
  37. test_gr_a5a5 3
  38. test_gr_a5a5 4
  39. test_gr_a5a5 5
  40. test_gr_a5a5 6
  41. test_gr_a5a5 7
  42. .endif
  43. sub_l_imm32:
  44. ;; sub.l immediate not available in h8300 mode.
  45. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  46. ;; fixme set ccr
  47. ;; sub.l #xx:32,Rd
  48. sub.l #0x11111111, er0 ; Immediate 32-bit operand
  49. ;; fixme test ccr ; H=0 N=1 Z=0 V=0 C=0
  50. test_h_gr32 0x94949494 er0 ; sub result: a5a5a5a5 - 11111111
  51. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  52. test_gr_a5a5 2
  53. test_gr_a5a5 3
  54. test_gr_a5a5 4
  55. test_gr_a5a5 5
  56. test_gr_a5a5 6
  57. test_gr_a5a5 7
  58. sub.l.reg:
  59. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  60. ;; fixme set ccr
  61. ;; add.l Rs,Rd
  62. mov.l #0x11111111, er1
  63. sub.l er1, er0 ; Register operand
  64. ;; fixme test ccr ; H=0 N=1 Z=0 V=0 C=0
  65. test_h_gr32 0x94949494 er0 ; sub result: a5a5a5a5 - 11111111
  66. test_h_gr32 0x11111111 er1
  67. test_gr_a5a5 2 ; Make sure other general regs not disturbed
  68. test_gr_a5a5 3
  69. test_gr_a5a5 4
  70. test_gr_a5a5 5
  71. test_gr_a5a5 6
  72. test_gr_a5a5 7
  73. pass
  74. exit 0