1 # Hitachi H8 testcase 'exts.w, extu.w'
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
11 .include "testutils.inc"
29 ;; Test ccr H=0 N=0 Z=0 V=0 C=0
32 test_h_gr32 0xa5a50001 er0 ; result of sign extend
33 test_gr_a5a5 1 ; Make sure other general regs not disturbed
48 ;; Test ccr H=0 N=1 Z=0 V=0 C=0
54 test_h_gr32 0xa5a5ffff er0 ; result of sign extend
55 test_gr_a5a5 1 ; Make sure other general regs not disturbed
70 ;; Test ccr H=0 N=0 Z=0 V=0 C=0
73 test_h_gr32 0xa5a500ff er0 ; result of zero extend
74 test_gr_a5a5 1 ; Make sure other general regs not disturbed
90 ;; Test ccr H=0 N=0 Z=0 V=0 C=0
93 test_h_gr32 pos er1 ; er1 still contains target address
94 test_gr_a5a5 0 ; Make sure other general regs not disturbed
105 mov.w #0xff01, @pos ; Restore initial value
114 ;; Test ccr H=0 N=1 Z=0 V=0 C=0
120 test_h_gr32 neg er1 ; er1 still contains target address
121 test_gr_a5a5 0 ; Make sure other general regs not disturbed
132 ;; Note: leave the value as 0xff80, so that extu has work to do.
141 ;; Test ccr H=0 N=0 Z=0 V=0 C=0
144 test_h_gr32 neg er1 ; er1 still contains target address
145 test_gr_a5a5 0 ; Make sure other general regs not disturbed
156 ;; Note: leave the value as 0x0080, like it started out.
165 ;; Test ccr H=0 N=0 Z=0 V=0 C=0
168 test_h_gr32 pos+2 er1 ; er1 still contains target address plus 2
169 test_gr_a5a5 0 ; Make sure other general regs not disturbed
180 mov.w #0xff01, @pos ; Restore initial value
189 ;; Test ccr H=0 N=1 Z=0 V=0 C=0
195 test_h_gr32 neg+2 er1 ; er1 still contains target address
196 test_gr_a5a5 0 ; Make sure other general regs not disturbed
207 ;; Note: leave the value as 0xff80, so that extu has work to do.
216 ;; Test ccr H=0 N=0 Z=0 V=0 C=0
219 test_h_gr32 neg+2 er1 ; er1 still contains target address
220 test_gr_a5a5 0 ; Make sure other general regs not disturbed
231 ;; Note: leave the value as 0x0080, like it started out.
240 ;; Test ccr H=0 N=0 Z=0 V=0 C=0
243 test_h_gr32 pos-2 er1 ; er1 still contains target address plus 2
244 test_gr_a5a5 0 ; Make sure other general regs not disturbed
255 mov.w #0xff01, @pos ; Restore initial value
264 ;; Test ccr H=0 N=1 Z=0 V=0 C=0
270 test_h_gr32 neg-2 er1 ; er1 still contains target address
271 test_gr_a5a5 0 ; Make sure other general regs not disturbed
282 ;; Note: leave the value as 0xff80, so that extu has work to do.
291 ;; Test ccr H=0 N=0 Z=0 V=0 C=0
294 test_h_gr32 neg-2 er1 ; er1 still contains target address
295 test_gr_a5a5 0 ; Make sure other general regs not disturbed
306 ;; Note: leave the value as 0x0080, like it started out.
315 ;; Test ccr H=0 N=0 Z=0 V=0 C=0
318 test_h_gr32 pos er1 ; er1 still contains target address plus 2
319 test_gr_a5a5 0 ; Make sure other general regs not disturbed
330 mov.w #0xff01, @pos ; Restore initial value
339 ;; Test ccr H=0 N=1 Z=0 V=0 C=0
345 test_h_gr32 neg er1 ; er1 still contains target address
346 test_gr_a5a5 0 ; Make sure other general regs not disturbed
357 ;; Note: leave the value as 0xff80, so that extu has work to do.
366 ;; Test ccr H=0 N=0 Z=0 V=0 C=0
369 test_h_gr32 neg er1 ; er1 still contains target address
370 test_gr_a5a5 0 ; Make sure other general regs not disturbed
381 ;; Note: leave the value as 0x0080, like it started out.
390 ;; Test ccr H=0 N=0 Z=0 V=0 C=0
393 test_h_gr32 pos er1 ; er1 still contains target address plus 2
394 test_gr_a5a5 0 ; Make sure other general regs not disturbed
405 mov.w #0xff01, @pos ; Restore initial value
414 ;; Test ccr H=0 N=1 Z=0 V=0 C=0
420 test_h_gr32 neg er1 ; er1 still contains target address
421 test_gr_a5a5 0 ; Make sure other general regs not disturbed
432 ;; Note: leave the value as 0xff80, so that extu has work to do.
441 ;; Test ccr H=0 N=0 Z=0 V=0 C=0
444 test_h_gr32 neg er1 ; er1 still contains target address
445 test_gr_a5a5 0 ; Make sure other general regs not disturbed
456 ;; Note: leave the value as 0x0080, like it started out.
461 ;; extu.w @(dd:2, ern)
465 ;; Test ccr H=0 N=0 Z=0 V=0 C=0
468 test_h_gr32 neg-1 er1 ; er1 still contains target address
469 test_gr_a5a5 0 ; Make sure other general regs not disturbed
480 ;; Note: leave the value as 0x0080, like it started out.
485 ;; extu.w @(dd:16, ern)
489 ;; Test ccr H=0 N=0 Z=0 V=0 C=0
492 test_h_gr32 neg-44 er1 ; er1 still contains target address
493 test_gr_a5a5 0 ; Make sure other general regs not disturbed
504 ;; Note: leave the value as 0x0080, like it started out.
509 ;; extu.w @(dd:32, ern)
511 extu.w @(-444:32, er1)
513 ;; Test ccr H=0 N=0 Z=0 V=0 C=0
516 test_h_gr32 neg+444 er1 ; er1 still contains target address
517 test_gr_a5a5 0 ; Make sure other general regs not disturbed
528 ;; Note: leave the value as 0x0080, like it started out.
536 ;; Test ccr H=0 N=0 Z=0 V=0 C=0
539 test_gr_a5a5 0 ; Make sure other general regs not disturbed
551 ;; Note: leave the value as 0x0080, like it started out.
559 ;; Test ccr H=0 N=0 Z=0 V=0 C=0
562 test_gr_a5a5 0 ; Make sure other general regs not disturbed
574 ;; Note: leave the value as 0x0080, like it started out.