1 # Hitachi H8 testcase 'shll'
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 word_dest: .word 0xa5a5
20 long_dest: .long 0xa5a5a5a5
25 set_grs_a5a5 ; Fill all general regs with a fixed pattern
28 shll.b r0l ; shift left logical by one
31 test_carry_set ; H=0 N=0 Z=0 V=0 C=1
35 test_h_gr16 0xa54a r0 ; 1010 0101 -> 0100 1010
37 test_h_gr32 0xa5a5a54a er0
39 test_gr_a5a5 1 ; Make sure other general regs not disturbed
48 set_grs_a5a5 ; Fill all general regs with a fixed pattern
51 shll.b #2, r0l ; shift left logical by two
54 test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
59 test_h_gr16 0xa594 r0 ; 1010 0101 -> 1001 0100
61 test_h_gr32 0xa5a5a594 er0
63 test_gr_a5a5 1 ; Make sure other general regs not disturbed
73 set_grs_a5a5 ; Fill all general regs with a fixed pattern
76 shll.b #4, r0l ; shift left logical by four
79 test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
83 test_h_gr16 0xa550 r0 ; 1010 0101 -> 0101 0000
84 test_h_gr32 0xa5a5a550 er0
86 test_gr_a5a5 1 ; Make sure other general regs not disturbed
95 .if (sim_cpu) ; Not available in h8300 mode
97 set_grs_a5a5 ; Fill all general regs with a fixed pattern
100 shll.w r0 ; shift left logical by one
103 test_carry_set ; H=0 N=0 Z=0 V=0 C=1
107 test_h_gr16 0x4b4a r0 ; 1010 0101 1010 0101 -> 0100 1011 0100 1010
108 test_h_gr32 0xa5a54b4a er0
110 test_gr_a5a5 1 ; Make sure other general regs not disturbed
119 set_grs_a5a5 ; Fill all general regs with a fixed pattern
122 shll.w #2, r0 ; shift left logical by two
125 test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
129 test_h_gr16 0x9694 r0 ; 1010 0101 1010 0101 -> 1001 0110 1001 0100
130 test_h_gr32 0xa5a59694 er0
132 test_gr_a5a5 1 ; Make sure other general regs not disturbed
140 .if (sim_cpu == h8sx)
142 set_grs_a5a5 ; Fill all general regs with a fixed pattern
145 shll.w #4, r0 ; shift left logical by four
148 test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
152 test_h_gr16 0x5a50 r0 ; 1010 0101 1010 0101 -> 0101 1010 0101 0000
153 test_h_gr32 0xa5a55a50 er0
155 test_gr_a5a5 1 ; Make sure other general regs not disturbed
164 set_grs_a5a5 ; Fill all general regs with a fixed pattern
167 shll.w #8, r0 ; shift left logical by eight
170 test_carry_set ; H=0 N=1 Z=0 V=0 C=1
174 test_h_gr16 0xa500 r0 ; 1010 0101 1010 0101 -> 1010 0101 0000 0000
175 test_h_gr32 0xa5a5a500 er0
177 test_gr_a5a5 1 ; Make sure other general regs not disturbed
187 set_grs_a5a5 ; Fill all general regs with a fixed pattern
190 shll.l er0 ; shift left logical by one
193 test_carry_set ; H=0 N=0 Z=0 V=0 C=1
197 ; 1010 0101 1010 0101 1010 0101 1010 0101
198 ; -> 0100 1011 0100 1011 0100 1011 0100 1010
199 test_h_gr32 0x4b4b4b4a er0
201 test_gr_a5a5 1 ; Make sure other general regs not disturbed
210 set_grs_a5a5 ; Fill all general regs with a fixed pattern
213 shll.l #2, er0 ; shift left logical by two
216 test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
220 ; 1010 0101 1010 0101 1010 0101 1010 0101
221 ; -> 1001 0110 1001 0110 1001 0110 1001 0100
222 test_h_gr32 0x96969694 er0
224 test_gr_a5a5 1 ; Make sure other general regs not disturbed
232 .if (sim_cpu == h8sx)
234 set_grs_a5a5 ; Fill all general regs with a fixed pattern
237 shll.l #4, er0 ; shift left logical by four
240 test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
244 ; 1010 0101 1010 0101 1010 0101 1010 0101
245 ; -> 0101 1010 0101 1010 0101 1010 0101 0000
246 test_h_gr32 0x5a5a5a50 er0
248 test_gr_a5a5 1 ; Make sure other general regs not disturbed
257 set_grs_a5a5 ; Fill all general regs with a fixed pattern
260 shll.l #8, er0 ; shift left logical by eight
263 test_carry_set ; H=0 N=1 Z=0 V=0 C=1
267 test_h_gr16 0xa500 r0
268 ; 1010 0101 1010 0101 1010 0101 1010 0101
269 ; -> 1010 0101 1010 0101 1010 0101 0000 0000
270 test_h_gr32 0xa5a5a500 er0
272 test_gr_a5a5 1 ; Make sure other general regs not disturbed
281 set_grs_a5a5 ; Fill all general regs with a fixed pattern
284 shll.l #16, er0 ; shift left logical by sixteen
287 test_carry_set ; H=0 N=1 Z=0 V=0 C=1
291 ; 1010 0101 1010 0101 1010 0101 1010 0101
292 ;; -> 1010 0101 1010 0101 0000 0000 0000 0000
293 test_h_gr32 0xa5a50000 er0
295 test_gr_a5a5 1 ; Make sure other general regs not disturbed