1 # Hitachi H8 testcase 'bra'
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"
18 disp16: .long tgt_reg16
19 disp32: .long tgt_reg32
25 set_grs_a5a5 ; Fill all general regs with a fixed pattern
28 ;; bra dd:8 ; 8-bit displacement
30 ;;; .word 0x40xx ; where "xx" is tgt_8 - '.'.
35 test_gr_a5a5 0 ; Make sure other general regs not disturbed
44 .if (sim_cpu) ; not available in h8/300 mode
46 set_grs_a5a5 ; Fill all general regs with a fixed pattern
49 ;; bra dd:16 ; 16-bit displacement
50 bra tgt_24:16 ; NOTE: hard-coded to avoid relaxing.
57 test_gr_a5a5 0 ; Make sure other general regs not disturbed
69 set_grs_a5a5 ; Fill all general regs with a fixed pattern
72 ;; bra rn.b ; 8-bit register indirect
81 test_gr_a5a5 0 ; Make sure other general regs not disturbed
86 ;;; test_h_gr32 tgt_reg8 er5
91 set_grs_a5a5 ; Fill all general regs with a fixed pattern
94 ;; bra rn.w ; 16-bit register indirect
103 test_gr_a5a5 0 ; Make sure other general regs not disturbed
108 ;;; test_h_gr32 tgt_reg16 er5
113 set_grs_a5a5 ; Fill all general regs with a fixed pattern
116 ;; bra ern ; 32-bit register indirect
117 sub.l #src32, @disp32
125 test_gr_a5a5 0 ; Make sure other general regs not disturbed
139 ;; The following instruction is in the delay slot, and should execute.
141 ;; After this, the next instructions should not execute.
146 cmp.b #0, @dslot ; Should be non-zero if delay slot executed.
151 test_gr_a5a5 0 ; Make sure all general regs not disturbed