1 # Hitachi H8 testcase 'bset', 'bclr'
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
11 .include "testutils.inc"
13 # Instructions tested:
15 # bset xx:3, rd8 ; 7 0 ?xxx rd8
16 # bclr xx:3, rd8 ; 7 2 ?xxx rd8
17 # bset xx:3, @erd ; 7 d 0rd ???? 7 0 ?xxx ????
18 # bclr xx:3, @erd ; 7 d 0rd ???? 7 2 ?xxx ????
19 # bset xx:3, @abs16 ; 6 a 1 1??? aa:16 7 0 ?xxx ????
20 # bclr xx:3, @abs16 ; 6 a 1 1??? aa:16 7 2 ?xxx ????
21 # bset reg8, rd8 ; 6 0 rs8 rd8
22 # bclr reg8, rd8 ; 6 2 rs8 rd8
23 # bset reg8, @erd ; 7 d 0rd ???? 6 0 rs8 ????
24 # bclr reg8, @erd ; 7 d 0rd ???? 6 2 rs8 ????
25 # bset reg8, @abs32 ; 6 a 3 1??? aa:32 6 0 rs8 ????
26 # bclr reg8, @abs32 ; 6 a 3 1??? aa:32 6 2 rs8 ????
39 set_grs_a5a5 ; Fill all general regs with a fixed pattern
83 .if (sim_cpu == h8300)
84 test_h_gr16 0xa5ff, r1
86 test_h_gr32 0xa5a5a5ff er1
130 test_gr_a5a5 0 ; Make sure other general regs not disturbed
131 .if (sim_cpu == h8300)
132 test_h_gr16 0xa500 r1
134 test_h_gr32 0xa5a5a500 er1
145 set_grs_a5a5 ; Fill all general regs with a fixed pattern
197 .if (sim_cpu == h8300)
198 test_h_gr16 0xa5ff r2
200 test_h_gr32 0xa5a5a5ff er2
252 test_gr_a5a5 0 ; Make sure other general regs not disturbed
253 .if (sim_cpu == h8300)
254 test_h_gr16 byte_dst r1
255 test_h_gr16 0xa500 r2
257 test_h_gr32 byte_dst er1
258 test_h_gr32 0xa5a5a500 er2
267 set_grs_a5a5 ; Fill all general regs with a fixed pattern
271 bset #0, @byte_dst:16
277 bset #1, @byte_dst:16
283 bset #2, @byte_dst:16
289 bset #3, @byte_dst:16
295 bset #4, @byte_dst:16
301 bset #5, @byte_dst:16
307 bset #6, @byte_dst:16
313 bset #7, @byte_dst:16
318 .if (sim_cpu == h8300)
319 test_h_gr16 0xa5ff r2
321 test_h_gr32 0xa5a5a5ff er2
326 bclr #7, @byte_dst:16
332 bclr #6, @byte_dst:16
338 bclr #5, @byte_dst:16
344 bclr #4, @byte_dst:16
350 bclr #3, @byte_dst:16
356 bclr #2, @byte_dst:16
362 bclr #1, @byte_dst:16
368 bclr #0, @byte_dst:16
373 test_gr_a5a5 0 ; Make sure other general regs not disturbed
375 .if (sim_cpu == h8300)
376 test_h_gr16 0xa500 r2
378 test_h_gr32 0xa5a5a500 er2
388 set_grs_a5a5 ; Fill all general regs with a fixed pattern
440 .if (sim_cpu == h8300)
441 test_h_gr16 0x07ff, r1
443 test_h_gr32 0xa5a507ff er1
495 test_gr_a5a5 0 ; Make sure other general regs not disturbed
496 .if (sim_cpu == h8300)
497 test_h_gr16 0x0000 r1
499 test_h_gr32 0xa5a50000 er1
510 set_grs_a5a5 ; Fill all general regs with a fixed pattern
570 .if (sim_cpu == h8300)
571 test_h_gr16 0x07ff r2
573 test_h_gr32 0xa5a507ff er2
633 test_gr_a5a5 0 ; Make sure other general regs not disturbed
634 .if (sim_cpu == h8300)
635 test_h_gr16 byte_dst r1
636 test_h_gr16 0x0000 r2
638 test_h_gr32 byte_dst er1
639 test_h_gr32 0xa5a50000 er2
648 set_grs_a5a5 ; Fill all general regs with a fixed pattern
653 bset r2h, @byte_dst:32
660 bset r2h, @byte_dst:32
667 bset r2h, @byte_dst:32
674 bset r2h, @byte_dst:32
681 bset r2h, @byte_dst:32
688 bset r2h, @byte_dst:32
695 bset r2h, @byte_dst:32
702 bset r2h, @byte_dst:32
707 .if (sim_cpu == h8300)
708 test_h_gr16 0x07ff r2
710 test_h_gr32 0xa5a507ff er2
716 bclr r2h, @byte_dst:32
723 bclr r2h, @byte_dst:32
730 bclr r2h, @byte_dst:32
737 bclr r2h, @byte_dst:32
744 bclr r2h, @byte_dst:32
751 bclr r2h, @byte_dst:32
758 bclr r2h, @byte_dst:32
765 bclr r2h, @byte_dst:32
770 test_gr_a5a5 0 ; Make sure other general regs not disturbed
772 .if (sim_cpu == h8300)
773 test_h_gr16 0x0000 r2
775 test_h_gr32 0xa5a50000 er2
784 .if (sim_cpu == h8sx)
786 set_grs_a5a5 ; Fill all general regs with a fixed pattern
791 bset/eq #0, @byte_dst:16 ; Zero is clear, should have no effect.
797 orc #4, ccr ; Set zero flag
798 bset/eq #0, @byte_dst:16 ; Zero is set: operation should succeed.
811 bclr/eq #0, @byte_dst:32 ; Zero is clear, should have no effect.
817 orc #4, ccr ; Set zero flag
818 bclr/eq #0, @byte_dst:32 ; Zero is set: operation should succeed.
826 test_gr_a5a5 0 ; Make sure other general regs not disturbed
827 .if (sim_cpu == h8300)
828 test_h_gr16 0xa500 r1
830 test_h_gr32 0xa5a5a500 er1