Home | History | Annotate | Line # | Download | only in h8300
      1  1.1  christos # Hitachi H8 testcase 'inc, inc.w, inc.l'
      2  1.1  christos # mach(): all
      3  1.1  christos # as(h8300):	--defsym sim_cpu=0
      4  1.1  christos # as(h8300h):	--defsym sim_cpu=1
      5  1.1  christos # as(h8300s):	--defsym sim_cpu=2
      6  1.1  christos # as(h8sx):	--defsym sim_cpu=3
      7  1.1  christos # ld(h8300h):	-m h8300helf
      8  1.1  christos # ld(h8300s):	-m h8300self
      9  1.1  christos # ld(h8sx):	-m h8300sxelf
     10  1.1  christos 
     11  1.1  christos 	.include "testutils.inc"
     12  1.1  christos 
     13  1.1  christos 	start
     14  1.1  christos 
     15  1.1  christos inc_b:
     16  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
     17  1.1  christos 	;;  fixme set ccr
     18  1.1  christos 
     19  1.1  christos 	;;  inc.b Rd
     20  1.1  christos 	inc.b	r0h		; Increment 8-bit reg by one
     21  1.1  christos 
     22  1.1  christos 	;; fixme test ccr	; H=0 N=1 Z=0 V=0 C=0
     23  1.1  christos 	test_h_gr16 0xa6a5 r0	; inc result: a6|a5
     24  1.1  christos .if (sim_cpu)			; non-zero means h8300h, s, or sx
     25  1.1  christos 	test_h_gr32 0xa5a5a6a5 er0	; inc result: a5|a5|a6|a5
     26  1.1  christos .endif
     27  1.1  christos 	test_gr_a5a5 1		; Make sure other general regs not disturbed
     28  1.1  christos 	test_gr_a5a5 2
     29  1.1  christos 	test_gr_a5a5 3
     30  1.1  christos 	test_gr_a5a5 4
     31  1.1  christos 	test_gr_a5a5 5
     32  1.1  christos 	test_gr_a5a5 6
     33  1.1  christos 	test_gr_a5a5 7
     34  1.1  christos 
     35  1.1  christos .if (sim_cpu)			; non-zero means h8300h, s, or sx
     36  1.1  christos inc_w_1:
     37  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
     38  1.1  christos 	;;  fixme set ccr
     39  1.1  christos 
     40  1.1  christos 	;;  inc.w #1, Rd
     41  1.1  christos 	inc.w	#1, r0		; Increment 16-bit reg by one
     42  1.1  christos 
     43  1.1  christos 	;; fixme test ccr	; H=0 N=1 Z=0 V=0 C=0
     44  1.1  christos 	test_h_gr16 0xa5a6 r0	; inc result: a5|a6
     45  1.1  christos 
     46  1.1  christos 	test_h_gr32 0xa5a5a5a6 er0	; inc result:	a5|a5|a5|a6
     47  1.1  christos 
     48  1.1  christos 	test_gr_a5a5 1		; Make sure other general regs not disturbed
     49  1.1  christos 	test_gr_a5a5 2
     50  1.1  christos 	test_gr_a5a5 3
     51  1.1  christos 	test_gr_a5a5 4
     52  1.1  christos 	test_gr_a5a5 5
     53  1.1  christos 	test_gr_a5a5 6
     54  1.1  christos 	test_gr_a5a5 7
     55  1.1  christos 
     56  1.1  christos inc_w_2:
     57  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
     58  1.1  christos 	;;  fixme set ccr
     59  1.1  christos 
     60  1.1  christos 	;;  inc.w #2, Rd
     61  1.1  christos 	inc.w	#2, r0		; Increment 16-bit reg by two
     62  1.1  christos 
     63  1.1  christos 	;; fixme test ccr	; H=0 N=1 Z=0 V=0 C=0
     64  1.1  christos 	test_h_gr16 0xa5a7 r0	; inc result: a5|a7
     65  1.1  christos 
     66  1.1  christos 	test_h_gr32 0xa5a5a5a7 er0	; inc result:	a5|a5|a5|a7
     67  1.1  christos 
     68  1.1  christos 	test_gr_a5a5 1		; Make sure other general regs not disturbed
     69  1.1  christos 	test_gr_a5a5 2
     70  1.1  christos 	test_gr_a5a5 3
     71  1.1  christos 	test_gr_a5a5 4
     72  1.1  christos 	test_gr_a5a5 5
     73  1.1  christos 	test_gr_a5a5 6
     74  1.1  christos 	test_gr_a5a5 7
     75  1.1  christos 
     76  1.1  christos inc_l_1:
     77  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
     78  1.1  christos 	;;  fixme set ccr
     79  1.1  christos 
     80  1.1  christos 	;;  inc.l #1, eRd
     81  1.1  christos 	inc.l	#1, er0		; Increment 32-bit reg by one
     82  1.1  christos 
     83  1.1  christos 	;; fixme test ccr	; H=0 N=1 Z=0 V=0 C=0
     84  1.1  christos 
     85  1.1  christos 	test_h_gr32 0xa5a5a5a6 er0	; inc result:	a5|a5|a5|a6
     86  1.1  christos 
     87  1.1  christos 	test_gr_a5a5 1		; Make sure other general regs not disturbed
     88  1.1  christos 	test_gr_a5a5 2
     89  1.1  christos 	test_gr_a5a5 3
     90  1.1  christos 	test_gr_a5a5 4
     91  1.1  christos 	test_gr_a5a5 5
     92  1.1  christos 	test_gr_a5a5 6
     93  1.1  christos 	test_gr_a5a5 7
     94  1.1  christos 
     95  1.1  christos inc_l_2:
     96  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
     97  1.1  christos 	;;  fixme set ccr
     98  1.1  christos 
     99  1.1  christos 	;;  inc.l #2, eRd
    100  1.1  christos 	inc.l	#2, er0		; Increment 32-bit reg by two
    101  1.1  christos 
    102  1.1  christos 	;; fixme test ccr	; H=0 N=1 Z=0 V=0 C=0
    103  1.1  christos 
    104  1.1  christos 	test_h_gr32 0xa5a5a5a7 er0	; inc result:	a5|a5|a5|a7
    105  1.1  christos 
    106  1.1  christos 	test_gr_a5a5 1		; Make sure other general regs not disturbed
    107  1.1  christos 	test_gr_a5a5 2
    108  1.1  christos 	test_gr_a5a5 3
    109  1.1  christos 	test_gr_a5a5 4
    110  1.1  christos 	test_gr_a5a5 5
    111  1.1  christos 	test_gr_a5a5 6
    112  1.1  christos 	test_gr_a5a5 7
    113  1.1  christos .endif
    114  1.1  christos 
    115  1.1  christos 	pass
    116  1.1  christos 
    117  1.1  christos 	exit 0
    118