subs.s 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. # Hitachi H8 testcase 'subs'
  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. # Instructions tested:
  12. # subs #1, erd ; 1 b 0 0erd
  13. # subs #2, erd ; 1 b 8 0erd
  14. # subs #4, erd ; 1 b 9 0erd
  15. #
  16. start
  17. .if (sim_cpu) ; 32 bit only
  18. subs_1:
  19. set_grs_a5a5
  20. set_ccr_zero
  21. subs #1, er0
  22. test_cc_clear ; subs should not affect any condition codes
  23. test_h_gr32 0xa5a5a5a4 er0 ; result of subs #1
  24. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  25. test_gr_a5a5 2
  26. test_gr_a5a5 3
  27. test_gr_a5a5 4
  28. test_gr_a5a5 5
  29. test_gr_a5a5 6
  30. test_gr_a5a5 7
  31. subs_2:
  32. set_grs_a5a5
  33. set_ccr_zero
  34. subs #2, er0
  35. test_cc_clear ; subs should not affect any condition codes
  36. test_h_gr32 0xa5a5a5a3 er0 ; result of subs #2
  37. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  38. test_gr_a5a5 2
  39. test_gr_a5a5 3
  40. test_gr_a5a5 4
  41. test_gr_a5a5 5
  42. test_gr_a5a5 6
  43. test_gr_a5a5 7
  44. subs_4:
  45. set_grs_a5a5
  46. set_ccr_zero
  47. subs #4, er0
  48. test_cc_clear ; subs should not affect any condition codes
  49. test_h_gr32 0xa5a5a5a1 er0 ; result of subs #4
  50. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  51. test_gr_a5a5 2
  52. test_gr_a5a5 3
  53. test_gr_a5a5 4
  54. test_gr_a5a5 5
  55. test_gr_a5a5 6
  56. test_gr_a5a5 7
  57. pass
  58. .endif
  59. exit 0