adds.s 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. # Hitachi H8 testcase 'adds'
  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. # adds #1, erd ; 0 b 0 xerd
  13. # adds #2, erd ; 0 b 8 xerd
  14. # adds #4, erd ; 0 b 9 xerd
  15. #
  16. start
  17. .if (sim_cpu) ; 32 bit only
  18. adds_1:
  19. set_grs_a5a5
  20. set_ccr_zero
  21. adds #1, er0
  22. test_cc_clear ; adds should not affect any condition codes
  23. test_h_gr32 0xa5a5a5a6 er0 ; result of adds #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. adds_2:
  32. set_grs_a5a5
  33. set_ccr_zero
  34. adds #2, er0
  35. test_cc_clear ; adds should not affect any condition codes
  36. test_h_gr32 0xa5a5a5a7 er0 ; result of adds #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. adds_4:
  45. set_grs_a5a5
  46. set_ccr_zero
  47. adds #4, er0
  48. test_cc_clear ; adds should not affect any condition codes
  49. test_h_gr32 0xa5a5a5a9 er0 ; result of adds #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