Home | History | Annotate | Line # | Download | only in h8300
      1  1.1  christos # Hitachi H8 testcase 'rotl'
      2  1.1  christos # mach(): h8300s h8sx
      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 	.data
     16  1.1  christos byte_dest:	.byte	0xa5
     17  1.1  christos 	.align 2
     18  1.1  christos word_dest:	.word	0xa5a5
     19  1.1  christos 	.align 4
     20  1.1  christos long_dest:	.long	0xa5a5a5a5
     21  1.1  christos 
     22  1.1  christos 	.text
     23  1.1  christos 
     24  1.1  christos rotl_b_reg8_1:
     25  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
     26  1.1  christos 	set_ccr_zero
     27  1.1  christos 
     28  1.1  christos 	rotl.b	r0l		; shift left arithmetic by one
     29  1.1  christos 
     30  1.1  christos 	test_carry_set		; H=0 N=0 Z=0 V=0 C=1
     31  1.1  christos 	test_zero_clear
     32  1.1  christos 	test_ovf_clear
     33  1.1  christos 	test_neg_clear
     34  1.1  christos 	test_h_gr16 0xa54b r0	; 1010 0101 -> 0100 1011
     35  1.1  christos .if (sim_cpu)
     36  1.1  christos 	test_h_gr32 0xa5a5a54b er0
     37  1.1  christos .endif
     38  1.1  christos 	test_gr_a5a5 1		; Make sure other general regs not disturbed
     39  1.1  christos 	test_gr_a5a5 2
     40  1.1  christos 	test_gr_a5a5 3
     41  1.1  christos 	test_gr_a5a5 4
     42  1.1  christos 	test_gr_a5a5 5
     43  1.1  christos 	test_gr_a5a5 6
     44  1.1  christos 	test_gr_a5a5 7
     45  1.1  christos 
     46  1.1  christos .if (sim_cpu == h8sx)
     47  1.1  christos rotl_b_ind_1:
     48  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
     49  1.1  christos 	set_ccr_zero
     50  1.1  christos 
     51  1.1  christos 	mov	#byte_dest, er0
     52  1.1  christos 	rotl.b	@er0	; shift right arithmetic by one, indirect
     53  1.1  christos 
     54  1.1  christos 	test_carry_set		; H=0 N=0 Z=0 V=0 C=1
     55  1.1  christos 	test_zero_clear
     56  1.1  christos 	test_ovf_clear
     57  1.1  christos 	test_neg_clear
     58  1.1  christos 
     59  1.1  christos 	test_h_gr32  byte_dest er0
     60  1.1  christos 	test_gr_a5a5 1		; Make sure other general regs not disturbed
     61  1.1  christos 	test_gr_a5a5 2
     62  1.1  christos 	test_gr_a5a5 3
     63  1.1  christos 	test_gr_a5a5 4
     64  1.1  christos 	test_gr_a5a5 5
     65  1.1  christos 	test_gr_a5a5 6
     66  1.1  christos 	test_gr_a5a5 7
     67  1.1  christos 	; 1010 0101 -> 0100 1011
     68  1.1  christos 	cmp.b	#0x4b, @byte_dest
     69  1.1  christos 	beq	.Lbind1
     70  1.1  christos 	fail
     71  1.1  christos .Lbind1:
     72  1.1  christos 	mov.b	#0xa5, @byte_dest
     73  1.1  christos 
     74  1.1  christos rotl_b_indexb16_1:
     75  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
     76  1.1  christos 	set_ccr_zero
     77  1.1  christos 
     78  1.1  christos 	mov.b	#5, r0l
     79  1.1  christos 	rotl.b	@(byte_dest-5:16, r0.b)	; indexed byte/byte
     80  1.1  christos 
     81  1.1  christos 	test_carry_set		; H=0 N=0 Z=0 V=0 C=1
     82  1.1  christos 	test_zero_clear
     83  1.1  christos 	test_ovf_clear
     84  1.1  christos 	test_neg_clear
     85  1.1  christos 
     86  1.1  christos 	test_h_gr32  0xa5a5a505 er0
     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 	; 1010 0101 -> 0100 1011
     95  1.1  christos 	cmp.b	#0x4b, @byte_dest
     96  1.1  christos 	beq	.Lbindexb161
     97  1.1  christos 	fail
     98  1.1  christos .Lbindexb161:
     99  1.1  christos 	mov.b	#0xa5, @byte_dest
    100  1.1  christos 
    101  1.1  christos rotl_b_indexw16_1:
    102  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    103  1.1  christos 	set_ccr_zero
    104  1.1  christos 
    105  1.1  christos 	mov.w	#256, r0
    106  1.1  christos 	rotl.b	@(byte_dest-256:16, r0.w)	; indexed byte/word
    107  1.1  christos 
    108  1.1  christos 	test_carry_set		; H=0 N=0 Z=0 V=0 C=1
    109  1.1  christos 	test_zero_clear
    110  1.1  christos 	test_ovf_clear
    111  1.1  christos 	test_neg_clear
    112  1.1  christos 
    113  1.1  christos 	test_h_gr32  0xa5a50100 er0
    114  1.1  christos 	test_gr_a5a5 1		; Make sure other general regs not disturbed
    115  1.1  christos 	test_gr_a5a5 2
    116  1.1  christos 	test_gr_a5a5 3
    117  1.1  christos 	test_gr_a5a5 4
    118  1.1  christos 	test_gr_a5a5 5
    119  1.1  christos 	test_gr_a5a5 6
    120  1.1  christos 	test_gr_a5a5 7
    121  1.1  christos 	; 1010 0101 -> 0100 1011
    122  1.1  christos 	cmp.b	#0x4b, @byte_dest
    123  1.1  christos 	beq	.Lbindexw161
    124  1.1  christos 	fail
    125  1.1  christos .Lbindexw161:
    126  1.1  christos 	mov.b	#0xa5, @byte_dest
    127  1.1  christos 
    128  1.1  christos rotl_b_indexl16_1:
    129  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    130  1.1  christos 	set_ccr_zero
    131  1.1  christos 
    132  1.1  christos 	mov.l	#0xffffffff, er0
    133  1.1  christos 	rotl.b	@(byte_dest+1:16, er0.l)	; indexed byte/long
    134  1.1  christos 
    135  1.1  christos 	test_carry_set		; H=0 N=0 Z=0 V=0 C=1
    136  1.1  christos 	test_zero_clear
    137  1.1  christos 	test_ovf_clear
    138  1.1  christos 	test_neg_clear
    139  1.1  christos 
    140  1.1  christos 	test_h_gr32  0xffffffff er0
    141  1.1  christos 	test_gr_a5a5 1		; Make sure other general regs not disturbed
    142  1.1  christos 	test_gr_a5a5 2
    143  1.1  christos 	test_gr_a5a5 3
    144  1.1  christos 	test_gr_a5a5 4
    145  1.1  christos 	test_gr_a5a5 5
    146  1.1  christos 	test_gr_a5a5 6
    147  1.1  christos 	test_gr_a5a5 7
    148  1.1  christos 	; 1010 0101 -> 0100 1011
    149  1.1  christos 	cmp.b	#0x4b, @byte_dest
    150  1.1  christos 	beq	.Lbindexl161
    151  1.1  christos 	fail
    152  1.1  christos .Lbindexl161:
    153  1.1  christos 	mov.b	#0xa5, @byte_dest
    154  1.1  christos 
    155  1.1  christos rotl_b_indexb32_1:
    156  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    157  1.1  christos 	set_ccr_zero
    158  1.1  christos 
    159  1.1  christos 	mov.b	#5, r1l
    160  1.1  christos 	rotl.b	@(byte_dest-5:32, r1.b)	; indexed byte/byte
    161  1.1  christos 
    162  1.1  christos 	test_carry_set		; H=0 N=0 Z=0 V=0 C=1
    163  1.1  christos 	test_zero_clear
    164  1.1  christos 	test_ovf_clear
    165  1.1  christos 	test_neg_clear
    166  1.1  christos 
    167  1.1  christos 	test_h_gr32  0xa5a5a505 er1
    168  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
    169  1.1  christos 	test_gr_a5a5 2
    170  1.1  christos 	test_gr_a5a5 3
    171  1.1  christos 	test_gr_a5a5 4
    172  1.1  christos 	test_gr_a5a5 5
    173  1.1  christos 	test_gr_a5a5 6
    174  1.1  christos 	test_gr_a5a5 7
    175  1.1  christos 	; 1010 0101 -> 0100 1011
    176  1.1  christos 	cmp.b	#0x4b, @byte_dest
    177  1.1  christos 	beq	.Lbindexb321
    178  1.1  christos 	fail
    179  1.1  christos .Lbindexb321:
    180  1.1  christos 	mov.b	#0xa5, @byte_dest
    181  1.1  christos 
    182  1.1  christos rotl_b_indexw32_1:
    183  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    184  1.1  christos 	set_ccr_zero
    185  1.1  christos 
    186  1.1  christos 	mov.w	#256, r1
    187  1.1  christos 	rotl.b	@(byte_dest-256:32, r1.w)	; indexed byte/word
    188  1.1  christos 
    189  1.1  christos 	test_carry_set		; H=0 N=0 Z=0 V=0 C=1
    190  1.1  christos 	test_zero_clear
    191  1.1  christos 	test_ovf_clear
    192  1.1  christos 	test_neg_clear
    193  1.1  christos 
    194  1.1  christos 	test_h_gr32  0xa5a50100 er1
    195  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
    196  1.1  christos 	test_gr_a5a5 2
    197  1.1  christos 	test_gr_a5a5 3
    198  1.1  christos 	test_gr_a5a5 4
    199  1.1  christos 	test_gr_a5a5 5
    200  1.1  christos 	test_gr_a5a5 6
    201  1.1  christos 	test_gr_a5a5 7
    202  1.1  christos 	; 1010 0101 -> 0100 1011
    203  1.1  christos 	cmp.b	#0x4b, @byte_dest
    204  1.1  christos 	beq	.Lbindexw321
    205  1.1  christos 	fail
    206  1.1  christos .Lbindexw321:
    207  1.1  christos 	mov.b	#0xa5, @byte_dest
    208  1.1  christos 
    209  1.1  christos rotl_b_indexl32_1:
    210  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    211  1.1  christos 	set_ccr_zero
    212  1.1  christos 
    213  1.1  christos 	mov.l	#0xffffffff, er1
    214  1.1  christos 	rotl.b	@(byte_dest+1:32, er1.l)	; indexed byte/long
    215  1.1  christos 
    216  1.1  christos 	test_carry_set		; H=0 N=0 Z=0 V=0 C=1
    217  1.1  christos 	test_zero_clear
    218  1.1  christos 	test_ovf_clear
    219  1.1  christos 	test_neg_clear
    220  1.1  christos 
    221  1.1  christos 	test_h_gr32  0xffffffff er1
    222  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
    223  1.1  christos 	test_gr_a5a5 2
    224  1.1  christos 	test_gr_a5a5 3
    225  1.1  christos 	test_gr_a5a5 4
    226  1.1  christos 	test_gr_a5a5 5
    227  1.1  christos 	test_gr_a5a5 6
    228  1.1  christos 	test_gr_a5a5 7
    229  1.1  christos 	; 1010 0101 -> 0100 1011
    230  1.1  christos 	cmp.b	#0x4b, @byte_dest
    231  1.1  christos 	beq	.Lbindexl321
    232  1.1  christos 	fail
    233  1.1  christos .Lbindexl321:
    234  1.1  christos 	mov.b	#0xa5, @byte_dest
    235  1.1  christos 
    236  1.1  christos .endif
    237  1.1  christos 
    238  1.1  christos rotl_b_reg8_2:
    239  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    240  1.1  christos 	set_ccr_zero
    241  1.1  christos 
    242  1.1  christos 	rotl.b	#2, r0l		; shift left arithmetic by two
    243  1.1  christos 
    244  1.1  christos 	test_carry_clear	; H=0 N=1 Z=0 V=0 C=0
    245  1.1  christos 	test_zero_clear
    246  1.1  christos 	test_ovf_clear
    247  1.1  christos 	test_neg_set
    248  1.1  christos 
    249  1.1  christos 	test_h_gr16 0xa596 r0	; 1010 0101 -> 1001 0110
    250  1.1  christos .if (sim_cpu)
    251  1.1  christos 	test_h_gr32 0xa5a5a596 er0
    252  1.1  christos .endif
    253  1.1  christos 	test_gr_a5a5 1		; Make sure other general regs not disturbed
    254  1.1  christos 	test_gr_a5a5 2
    255  1.1  christos 	test_gr_a5a5 3
    256  1.1  christos 	test_gr_a5a5 4
    257  1.1  christos 	test_gr_a5a5 5
    258  1.1  christos 	test_gr_a5a5 6
    259  1.1  christos 	test_gr_a5a5 7
    260  1.1  christos 
    261  1.1  christos .if (sim_cpu == h8sx)
    262  1.1  christos rotl_b_ind_2:
    263  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    264  1.1  christos 	set_ccr_zero
    265  1.1  christos 
    266  1.1  christos 	mov	#byte_dest, er0
    267  1.1  christos 	rotl.b	#2, @er0	; shift right arithmetic by one, indirect
    268  1.1  christos 
    269  1.1  christos 	test_carry_clear	; H=0 N=1 Z=0 C=0
    270  1.1  christos 	test_zero_clear
    271  1.1  christos 	test_ovf_clear
    272  1.1  christos 	test_neg_set
    273  1.1  christos 
    274  1.1  christos 	test_h_gr32  byte_dest er0
    275  1.1  christos 	test_gr_a5a5 1		; Make sure other general regs not disturbed
    276  1.1  christos 	test_gr_a5a5 2
    277  1.1  christos 	test_gr_a5a5 3
    278  1.1  christos 	test_gr_a5a5 4
    279  1.1  christos 	test_gr_a5a5 5
    280  1.1  christos 	test_gr_a5a5 6
    281  1.1  christos 	test_gr_a5a5 7
    282  1.1  christos 	; 1010 0101 -> 1001 0110
    283  1.1  christos 	cmp.b	#0x96, @byte_dest
    284  1.1  christos 	beq	.Lbind2
    285  1.1  christos 	fail
    286  1.1  christos .Lbind2:
    287  1.1  christos 	mov.b	#0xa5, @byte_dest
    288  1.1  christos 
    289  1.1  christos rotl_b_indexb16_2:
    290  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    291  1.1  christos 	set_ccr_zero
    292  1.1  christos 
    293  1.1  christos 	mov.b	#5, r0l
    294  1.1  christos 	rotl.b	#2, @(byte_dest-5:16, r0.b)	; indexed byte/byte
    295  1.1  christos 
    296  1.1  christos 	test_carry_clear	; H=0 N=1 Z=0 C=0
    297  1.1  christos 	test_zero_clear
    298  1.1  christos 	test_ovf_clear
    299  1.1  christos 	test_neg_set
    300  1.1  christos 
    301  1.1  christos 	test_h_gr32  0xa5a5a505 er0
    302  1.1  christos 	test_gr_a5a5 1		; Make sure other general regs not disturbed
    303  1.1  christos 	test_gr_a5a5 2
    304  1.1  christos 	test_gr_a5a5 3
    305  1.1  christos 	test_gr_a5a5 4
    306  1.1  christos 	test_gr_a5a5 5
    307  1.1  christos 	test_gr_a5a5 6
    308  1.1  christos 	test_gr_a5a5 7
    309  1.1  christos 	; 1010 0101 -> 1001 0110
    310  1.1  christos 	cmp.b	#0x96, @byte_dest
    311  1.1  christos 	beq	.Lbindexb162
    312  1.1  christos 	fail
    313  1.1  christos .Lbindexb162:
    314  1.1  christos 	mov.b	#0xa5, @byte_dest
    315  1.1  christos 
    316  1.1  christos rotl_b_indexw16_2:
    317  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    318  1.1  christos 	set_ccr_zero
    319  1.1  christos 
    320  1.1  christos 	mov.w	#256, r0
    321  1.1  christos 	rotl.b	#2, @(byte_dest-256:16, r0.w)	; indexed byte/word
    322  1.1  christos 
    323  1.1  christos 	test_carry_clear	; H=0 N=1 Z=0 C=0
    324  1.1  christos 	test_zero_clear
    325  1.1  christos 	test_ovf_clear
    326  1.1  christos 	test_neg_set
    327  1.1  christos 
    328  1.1  christos 	test_h_gr32  0xa5a50100 er0
    329  1.1  christos 	test_gr_a5a5 1		; Make sure other general regs not disturbed
    330  1.1  christos 	test_gr_a5a5 2
    331  1.1  christos 	test_gr_a5a5 3
    332  1.1  christos 	test_gr_a5a5 4
    333  1.1  christos 	test_gr_a5a5 5
    334  1.1  christos 	test_gr_a5a5 6
    335  1.1  christos 	test_gr_a5a5 7
    336  1.1  christos 	; 1010 0101 -> 1001 0110
    337  1.1  christos 	cmp.b	#0x96, @byte_dest
    338  1.1  christos 	beq	.Lbindexw162
    339  1.1  christos 	fail
    340  1.1  christos .Lbindexw162:
    341  1.1  christos 	mov.b	#0xa5, @byte_dest
    342  1.1  christos 
    343  1.1  christos rotl_b_indexl16_2:
    344  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    345  1.1  christos 	set_ccr_zero
    346  1.1  christos 
    347  1.1  christos 	mov.l	#0xffffffff, er0
    348  1.1  christos 	rotl.b	#2, @(byte_dest+1:16, er0.l)	; indexed byte/long
    349  1.1  christos 
    350  1.1  christos 	test_carry_clear	; H=0 N=1 Z=0 C=0
    351  1.1  christos 	test_zero_clear
    352  1.1  christos 	test_ovf_clear
    353  1.1  christos 	test_neg_set
    354  1.1  christos 
    355  1.1  christos 	test_h_gr32  0xffffffff er0
    356  1.1  christos 	test_gr_a5a5 1		; Make sure other general regs not disturbed
    357  1.1  christos 	test_gr_a5a5 2
    358  1.1  christos 	test_gr_a5a5 3
    359  1.1  christos 	test_gr_a5a5 4
    360  1.1  christos 	test_gr_a5a5 5
    361  1.1  christos 	test_gr_a5a5 6
    362  1.1  christos 	test_gr_a5a5 7
    363  1.1  christos 	; 1010 0101 -> 1001 0110
    364  1.1  christos 	cmp.b	#0x96, @byte_dest
    365  1.1  christos 	beq	.Lbindexl162
    366  1.1  christos 	fail
    367  1.1  christos .Lbindexl162:
    368  1.1  christos 	mov.b	#0xa5, @byte_dest
    369  1.1  christos 
    370  1.1  christos rotl_b_indexb32_2:
    371  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    372  1.1  christos 	set_ccr_zero
    373  1.1  christos 
    374  1.1  christos 	mov.b	#5, r1l
    375  1.1  christos 	rotl.b	#2, @(byte_dest-5:32, r1.b)	; indexed byte/byte
    376  1.1  christos 
    377  1.1  christos 	test_carry_clear	; H=0 N=1 Z=0 C=0
    378  1.1  christos 	test_zero_clear
    379  1.1  christos 	test_ovf_clear
    380  1.1  christos 	test_neg_set
    381  1.1  christos 
    382  1.1  christos 	test_h_gr32  0xa5a5a505 er1
    383  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
    384  1.1  christos 	test_gr_a5a5 2
    385  1.1  christos 	test_gr_a5a5 3
    386  1.1  christos 	test_gr_a5a5 4
    387  1.1  christos 	test_gr_a5a5 5
    388  1.1  christos 	test_gr_a5a5 6
    389  1.1  christos 	test_gr_a5a5 7
    390  1.1  christos 	; 1010 0101 -> 1001 0110
    391  1.1  christos 	cmp.b	#0x96, @byte_dest
    392  1.1  christos 	beq	.Lbindexb322
    393  1.1  christos 	fail
    394  1.1  christos .Lbindexb322:
    395  1.1  christos 	mov.b	#0xa5, @byte_dest
    396  1.1  christos 
    397  1.1  christos rotl_b_indexw32_2:
    398  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    399  1.1  christos 	set_ccr_zero
    400  1.1  christos 
    401  1.1  christos 	mov.w	#256, r1
    402  1.1  christos 	rotl.b	#2, @(byte_dest-256:32, r1.w)	; indexed byte/word
    403  1.1  christos 
    404  1.1  christos 	test_carry_clear	; H=0 N=1 Z=0 C=0
    405  1.1  christos 	test_zero_clear
    406  1.1  christos 	test_ovf_clear
    407  1.1  christos 	test_neg_set
    408  1.1  christos 
    409  1.1  christos 	test_h_gr32  0xa5a50100 er1
    410  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
    411  1.1  christos 	test_gr_a5a5 2
    412  1.1  christos 	test_gr_a5a5 3
    413  1.1  christos 	test_gr_a5a5 4
    414  1.1  christos 	test_gr_a5a5 5
    415  1.1  christos 	test_gr_a5a5 6
    416  1.1  christos 	test_gr_a5a5 7
    417  1.1  christos 	; 1010 0101 -> 1001 0110
    418  1.1  christos 	cmp.b	#0x96, @byte_dest
    419  1.1  christos 	beq	.Lbindexw322
    420  1.1  christos 	fail
    421  1.1  christos .Lbindexw322:
    422  1.1  christos 	mov.b	#0xa5, @byte_dest
    423  1.1  christos 
    424  1.1  christos rotl_b_indexl32_2:
    425  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    426  1.1  christos 	set_ccr_zero
    427  1.1  christos 
    428  1.1  christos 	mov.l	#0xffffffff, er1
    429  1.1  christos 	rotl.b	#2, @(byte_dest+1:32, er1.l)	; indexed byte/long
    430  1.1  christos 
    431  1.1  christos 	test_carry_clear	; H=0 N=1 Z=0 C=0
    432  1.1  christos 	test_zero_clear
    433  1.1  christos 	test_ovf_clear
    434  1.1  christos 	test_neg_set
    435  1.1  christos 
    436  1.1  christos 	test_h_gr32  0xffffffff er1
    437  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
    438  1.1  christos 	test_gr_a5a5 2
    439  1.1  christos 	test_gr_a5a5 3
    440  1.1  christos 	test_gr_a5a5 4
    441  1.1  christos 	test_gr_a5a5 5
    442  1.1  christos 	test_gr_a5a5 6
    443  1.1  christos 	test_gr_a5a5 7
    444  1.1  christos 	; 1010 0101 -> 1001 0110
    445  1.1  christos 	cmp.b	#0x96, @byte_dest
    446  1.1  christos 	beq	.Lbindexl322
    447  1.1  christos 	fail
    448  1.1  christos .Lbindexl322:
    449  1.1  christos 	mov.b	#0xa5, @byte_dest
    450  1.1  christos 
    451  1.1  christos .endif
    452  1.1  christos 
    453  1.1  christos .if (sim_cpu)			; Not available in h8300 mode
    454  1.1  christos rotl_w_reg16_1:
    455  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    456  1.1  christos 	set_ccr_zero
    457  1.1  christos 
    458  1.1  christos 	rotl.w	r0		; shift left arithmetic by one
    459  1.1  christos 
    460  1.1  christos 	test_carry_set		; H=0 N=0 Z=0 V=0 C=1
    461  1.1  christos 	test_zero_clear
    462  1.1  christos 	test_ovf_clear
    463  1.1  christos 	test_neg_clear
    464  1.1  christos 	test_h_gr16 0x4b4b r0	; 1010 0101 1010 0101 -> 0100 1011 0100 1011
    465  1.1  christos 	test_h_gr32 0xa5a54b4b er0
    466  1.1  christos 
    467  1.1  christos 	test_gr_a5a5 1		; Make sure other general regs not disturbed
    468  1.1  christos 	test_gr_a5a5 2
    469  1.1  christos 	test_gr_a5a5 3
    470  1.1  christos 	test_gr_a5a5 4
    471  1.1  christos 	test_gr_a5a5 5
    472  1.1  christos 	test_gr_a5a5 6
    473  1.1  christos 	test_gr_a5a5 7
    474  1.1  christos 
    475  1.1  christos .if (sim_cpu == h8sx)
    476  1.1  christos rotl_w_indexb16_1:
    477  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    478  1.1  christos 	set_ccr_zero
    479  1.1  christos 
    480  1.1  christos 	mov.b	#5, r0l
    481  1.1  christos 	rotl.w	@(word_dest-10:16, r0.b)	; indexed word/byte
    482  1.1  christos 
    483  1.1  christos 	test_carry_set		; H=0 N=0 Z=0 V=0 C=1
    484  1.1  christos 	test_zero_clear
    485  1.1  christos 	test_ovf_clear
    486  1.1  christos 	test_neg_clear
    487  1.1  christos 
    488  1.1  christos 	test_h_gr32  0xa5a5a505 er0
    489  1.1  christos 	test_gr_a5a5 1		; Make sure other general regs not disturbed
    490  1.1  christos 	test_gr_a5a5 2
    491  1.1  christos 	test_gr_a5a5 3
    492  1.1  christos 	test_gr_a5a5 4
    493  1.1  christos 	test_gr_a5a5 5
    494  1.1  christos 	test_gr_a5a5 6
    495  1.1  christos 	test_gr_a5a5 7
    496  1.1  christos 	; 1010 0101 1010 0101 -> 0100 1011 0100 1011
    497  1.1  christos 	cmp.w	#0x4b4b, @word_dest
    498  1.1  christos 	beq	.Lwindexb161
    499  1.1  christos 	fail
    500  1.1  christos .Lwindexb161:
    501  1.1  christos 	mov.w	#0xa5a5, @word_dest
    502  1.1  christos 
    503  1.1  christos rotl_w_indexw16_1:
    504  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    505  1.1  christos 	set_ccr_zero
    506  1.1  christos 
    507  1.1  christos 	mov.w	#256, r0
    508  1.1  christos 	rotl.w	@(word_dest-512:16, r0.w)	; indexed word/word
    509  1.1  christos 
    510  1.1  christos 	test_carry_set		; H=0 N=0 Z=0 V=0 C=1
    511  1.1  christos 	test_zero_clear
    512  1.1  christos 	test_ovf_clear
    513  1.1  christos 	test_neg_clear
    514  1.1  christos 
    515  1.1  christos 	test_h_gr32  0xa5a50100 er0
    516  1.1  christos 	test_gr_a5a5 1		; Make sure other general regs not disturbed
    517  1.1  christos 	test_gr_a5a5 2
    518  1.1  christos 	test_gr_a5a5 3
    519  1.1  christos 	test_gr_a5a5 4
    520  1.1  christos 	test_gr_a5a5 5
    521  1.1  christos 	test_gr_a5a5 6
    522  1.1  christos 	test_gr_a5a5 7
    523  1.1  christos 	; 1010 0101 1010 0101 -> 0100 1011 0100 1011
    524  1.1  christos 	cmp.w	#0x4b4b, @word_dest
    525  1.1  christos 	beq	.Lwindexw161
    526  1.1  christos 	fail
    527  1.1  christos .Lwindexw161:
    528  1.1  christos 	mov.w	#0xa5a5, @word_dest
    529  1.1  christos 
    530  1.1  christos rotl_w_indexl16_1:
    531  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    532  1.1  christos 	set_ccr_zero
    533  1.1  christos 
    534  1.1  christos 	mov.l	#0xffffffff, er0
    535  1.1  christos 	rotl.w	@(word_dest+2:16, er0.l)	; indexed word/long
    536  1.1  christos 
    537  1.1  christos 	test_carry_set		; H=0 N=0 Z=0 V=0 C=1
    538  1.1  christos 	test_zero_clear
    539  1.1  christos 	test_ovf_clear
    540  1.1  christos 	test_neg_clear
    541  1.1  christos 
    542  1.1  christos 	test_h_gr32  0xffffffff er0
    543  1.1  christos 	test_gr_a5a5 1		; Make sure other general regs not disturbed
    544  1.1  christos 	test_gr_a5a5 2
    545  1.1  christos 	test_gr_a5a5 3
    546  1.1  christos 	test_gr_a5a5 4
    547  1.1  christos 	test_gr_a5a5 5
    548  1.1  christos 	test_gr_a5a5 6
    549  1.1  christos 	test_gr_a5a5 7
    550  1.1  christos 	; 1010 0101 1010 0101 -> 0100 1011 0100 1011
    551  1.1  christos 	cmp.w	#0x4b4b, @word_dest
    552  1.1  christos 	beq	.Lwindexl161
    553  1.1  christos 	fail
    554  1.1  christos .Lwindexl161:
    555  1.1  christos 	mov.w	#0xa5a5, @word_dest
    556  1.1  christos 
    557  1.1  christos rotl_w_indexb32_1:
    558  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    559  1.1  christos 	set_ccr_zero
    560  1.1  christos 
    561  1.1  christos 	mov.b	#5, r1l
    562  1.1  christos 	rotl.w	@(word_dest-10:32, r1.b)	; indexed word/byte
    563  1.1  christos 
    564  1.1  christos 	test_carry_set		; H=0 N=0 Z=0 V=0 C=1
    565  1.1  christos 	test_zero_clear
    566  1.1  christos 	test_ovf_clear
    567  1.1  christos 	test_neg_clear
    568  1.1  christos 
    569  1.1  christos 	test_h_gr32  0xa5a5a505 er1
    570  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
    571  1.1  christos 	test_gr_a5a5 2
    572  1.1  christos 	test_gr_a5a5 3
    573  1.1  christos 	test_gr_a5a5 4
    574  1.1  christos 	test_gr_a5a5 5
    575  1.1  christos 	test_gr_a5a5 6
    576  1.1  christos 	test_gr_a5a5 7
    577  1.1  christos 	; 1010 0101 1010 0101 -> 0100 1011 0100 1011
    578  1.1  christos 	cmp.w	#0x4b4b, @word_dest
    579  1.1  christos 	beq	.Lwindexb321
    580  1.1  christos 	fail
    581  1.1  christos .Lwindexb321:
    582  1.1  christos 	mov.w	#0xa5a5, @word_dest
    583  1.1  christos 
    584  1.1  christos rotl_w_indexw32_1:
    585  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    586  1.1  christos 	set_ccr_zero
    587  1.1  christos 
    588  1.1  christos 	mov.w	#256, r1
    589  1.1  christos 	rotl.w	@(word_dest-512:32, r1.w)	; indexed word/byte
    590  1.1  christos 
    591  1.1  christos 	test_carry_set		; H=0 N=0 Z=0 V=0 C=1
    592  1.1  christos 	test_zero_clear
    593  1.1  christos 	test_ovf_clear
    594  1.1  christos 	test_neg_clear
    595  1.1  christos 
    596  1.1  christos 	test_h_gr32  0xa5a50100 er1
    597  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
    598  1.1  christos 	test_gr_a5a5 2
    599  1.1  christos 	test_gr_a5a5 3
    600  1.1  christos 	test_gr_a5a5 4
    601  1.1  christos 	test_gr_a5a5 5
    602  1.1  christos 	test_gr_a5a5 6
    603  1.1  christos 	test_gr_a5a5 7
    604  1.1  christos 	; 1010 0101 1010 0101 -> 0100 1011 0100 1011
    605  1.1  christos 	cmp.w	#0x4b4b, @word_dest
    606  1.1  christos 	beq	.Lwindexw321
    607  1.1  christos 	fail
    608  1.1  christos .Lwindexw321:
    609  1.1  christos 	mov.w	#0xa5a5, @word_dest
    610  1.1  christos 
    611  1.1  christos rotl_w_indexl32_1:
    612  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    613  1.1  christos 	set_ccr_zero
    614  1.1  christos 
    615  1.1  christos 	mov.l	#0xffffffff, er1
    616  1.1  christos 	rotl.w	@(word_dest+2:32, er1.l)	; indexed word/byte
    617  1.1  christos 
    618  1.1  christos 	test_carry_set		; H=0 N=0 Z=0 V=0 C=1
    619  1.1  christos 	test_zero_clear
    620  1.1  christos 	test_ovf_clear
    621  1.1  christos 	test_neg_clear
    622  1.1  christos 
    623  1.1  christos 	test_h_gr32  0xffffffff er1
    624  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
    625  1.1  christos 	test_gr_a5a5 2
    626  1.1  christos 	test_gr_a5a5 3
    627  1.1  christos 	test_gr_a5a5 4
    628  1.1  christos 	test_gr_a5a5 5
    629  1.1  christos 	test_gr_a5a5 6
    630  1.1  christos 	test_gr_a5a5 7
    631  1.1  christos 	; 1010 0101 1010 0101 -> 0100 1011 0100 1011
    632  1.1  christos 	cmp.w	#0x4b4b, @word_dest
    633  1.1  christos 	beq	.Lwindexl321
    634  1.1  christos 	fail
    635  1.1  christos .Lwindexl321:
    636  1.1  christos 	mov.w	#0xa5a5, @word_dest
    637  1.1  christos .endif
    638  1.1  christos 
    639  1.1  christos rotl_w_reg16_2:
    640  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    641  1.1  christos 	set_ccr_zero
    642  1.1  christos 
    643  1.1  christos 	rotl.w	#2, r0		; shift left arithmetic by two
    644  1.1  christos 
    645  1.1  christos 	test_carry_clear	; H=0 N=1 Z=0 V=0 C=0
    646  1.1  christos 	test_zero_clear
    647  1.1  christos 	test_ovf_clear
    648  1.1  christos 	test_neg_set
    649  1.1  christos 	test_h_gr16 0x9696 r0	; 1010 0101 1010 0101 -> 1001 0110 1001 0110
    650  1.1  christos 	test_h_gr32 0xa5a59696 er0
    651  1.1  christos 
    652  1.1  christos 	test_gr_a5a5 1		; Make sure other general regs not disturbed
    653  1.1  christos 	test_gr_a5a5 2
    654  1.1  christos 	test_gr_a5a5 3
    655  1.1  christos 	test_gr_a5a5 4
    656  1.1  christos 	test_gr_a5a5 5
    657  1.1  christos 	test_gr_a5a5 6
    658  1.1  christos 	test_gr_a5a5 7
    659  1.1  christos 
    660  1.1  christos .if (sim_cpu == h8sx)
    661  1.1  christos rotl_w_indexb16_2:
    662  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    663  1.1  christos 	set_ccr_zero
    664  1.1  christos 
    665  1.1  christos 	mov.b	#5, r0l
    666  1.1  christos 	rotl.w	#2, @(word_dest-10:16, r0.b)	; indexed word/byte
    667  1.1  christos 
    668  1.1  christos 	test_carry_clear		; H=0 N=1 Z=0 V=0 C=0
    669  1.1  christos 	test_zero_clear
    670  1.1  christos 	test_ovf_clear
    671  1.1  christos 	test_neg_set
    672  1.1  christos 
    673  1.1  christos 	test_h_gr32  0xa5a5a505 er0
    674  1.1  christos 	test_gr_a5a5 1		; Make sure other general regs not disturbed
    675  1.1  christos 	test_gr_a5a5 2
    676  1.1  christos 	test_gr_a5a5 3
    677  1.1  christos 	test_gr_a5a5 4
    678  1.1  christos 	test_gr_a5a5 5
    679  1.1  christos 	test_gr_a5a5 6
    680  1.1  christos 	test_gr_a5a5 7
    681  1.1  christos 	; 1010 0101 1010 0101 -> 1001 0110 1001 0110
    682  1.1  christos 	cmp.w	#0x9696, @word_dest
    683  1.1  christos 	beq	.Lwindexb162
    684  1.1  christos 	fail
    685  1.1  christos .Lwindexb162:
    686  1.1  christos 	mov.w	#0xa5a5, @word_dest
    687  1.1  christos 
    688  1.1  christos rotl_w_indexw16_2:
    689  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    690  1.1  christos 	set_ccr_zero
    691  1.1  christos 
    692  1.1  christos 	mov.w	#256, r0
    693  1.1  christos 	rotl.w	#2, @(word_dest-512:16, r0.w)	; indexed word/word
    694  1.1  christos 
    695  1.1  christos 	test_carry_clear		; H=0 N=1 Z=0 V=0 C=0
    696  1.1  christos 	test_zero_clear
    697  1.1  christos 	test_ovf_clear
    698  1.1  christos 	test_neg_set
    699  1.1  christos 
    700  1.1  christos 	test_h_gr32  0xa5a50100 er0
    701  1.1  christos 	test_gr_a5a5 1		; Make sure other general regs not disturbed
    702  1.1  christos 	test_gr_a5a5 2
    703  1.1  christos 	test_gr_a5a5 3
    704  1.1  christos 	test_gr_a5a5 4
    705  1.1  christos 	test_gr_a5a5 5
    706  1.1  christos 	test_gr_a5a5 6
    707  1.1  christos 	test_gr_a5a5 7
    708  1.1  christos 	; 1010 0101 1010 0101 -> 1001 0110 1001 0110
    709  1.1  christos 	cmp.w	#0x9696, @word_dest
    710  1.1  christos 	beq	.Lwindexw162
    711  1.1  christos 	fail
    712  1.1  christos .Lwindexw162:
    713  1.1  christos 	mov.w	#0xa5a5, @word_dest
    714  1.1  christos 
    715  1.1  christos rotl_w_indexl16_2:
    716  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    717  1.1  christos 	set_ccr_zero
    718  1.1  christos 
    719  1.1  christos 	mov.l	#0xffffffff, er0
    720  1.1  christos 	rotl.w	#2, @(word_dest+2:16, er0.l)	; indexed word/long
    721  1.1  christos 
    722  1.1  christos 	test_carry_clear		; H=0 N=1 Z=0 V=0 C=0
    723  1.1  christos 	test_zero_clear
    724  1.1  christos 	test_ovf_clear
    725  1.1  christos 	test_neg_set
    726  1.1  christos 
    727  1.1  christos 	test_h_gr32  0xffffffff er0
    728  1.1  christos 	test_gr_a5a5 1		; Make sure other general regs not disturbed
    729  1.1  christos 	test_gr_a5a5 2
    730  1.1  christos 	test_gr_a5a5 3
    731  1.1  christos 	test_gr_a5a5 4
    732  1.1  christos 	test_gr_a5a5 5
    733  1.1  christos 	test_gr_a5a5 6
    734  1.1  christos 	test_gr_a5a5 7
    735  1.1  christos 	; 1010 0101 1010 0101 -> 1001 0110 1001 0110
    736  1.1  christos 	cmp.w	#0x9696, @word_dest
    737  1.1  christos 	beq	.Lwindexl162
    738  1.1  christos 	fail
    739  1.1  christos .Lwindexl162:
    740  1.1  christos 	mov.w	#0xa5a5, @word_dest
    741  1.1  christos 
    742  1.1  christos rotl_w_indexb32_2:
    743  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    744  1.1  christos 	set_ccr_zero
    745  1.1  christos 
    746  1.1  christos 	mov.b	#5, r1l
    747  1.1  christos 	rotl.w	#2, @(word_dest-10:32, r1.b)	; indexed word/byte
    748  1.1  christos 
    749  1.1  christos 	test_carry_clear		; H=0 N=1 Z=0 V=0 C=0
    750  1.1  christos 	test_zero_clear
    751  1.1  christos 	test_ovf_clear
    752  1.1  christos 	test_neg_set
    753  1.1  christos 
    754  1.1  christos 	test_h_gr32  0xa5a5a505 er1
    755  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
    756  1.1  christos 	test_gr_a5a5 2
    757  1.1  christos 	test_gr_a5a5 3
    758  1.1  christos 	test_gr_a5a5 4
    759  1.1  christos 	test_gr_a5a5 5
    760  1.1  christos 	test_gr_a5a5 6
    761  1.1  christos 	test_gr_a5a5 7
    762  1.1  christos 	; 1010 0101 1010 0101 -> 1001 0110 1001 0110
    763  1.1  christos 	cmp.w	#0x9696, @word_dest
    764  1.1  christos 	beq	.Lwindexb322
    765  1.1  christos 	fail
    766  1.1  christos .Lwindexb322:
    767  1.1  christos 	mov.w	#0xa5a5, @word_dest
    768  1.1  christos 
    769  1.1  christos rotl_w_indexw32_2:
    770  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    771  1.1  christos 	set_ccr_zero
    772  1.1  christos 
    773  1.1  christos 	mov.w	#256, r1
    774  1.1  christos 	rotl.w	#2, @(word_dest-512:32, r1.w)	; indexed word/byte
    775  1.1  christos 
    776  1.1  christos 	test_carry_clear		; H=0 N=1 Z=0 V=0 C=0
    777  1.1  christos 	test_zero_clear
    778  1.1  christos 	test_ovf_clear
    779  1.1  christos 	test_neg_set
    780  1.1  christos 
    781  1.1  christos 	test_h_gr32  0xa5a50100 er1
    782  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
    783  1.1  christos 	test_gr_a5a5 2
    784  1.1  christos 	test_gr_a5a5 3
    785  1.1  christos 	test_gr_a5a5 4
    786  1.1  christos 	test_gr_a5a5 5
    787  1.1  christos 	test_gr_a5a5 6
    788  1.1  christos 	test_gr_a5a5 7
    789  1.1  christos 	; 1010 0101 1010 0101 -> 1001 0110 1001 0110
    790  1.1  christos 	cmp.w	#0x9696, @word_dest
    791  1.1  christos 	beq	.Lwindexw322
    792  1.1  christos 	fail
    793  1.1  christos .Lwindexw322:
    794  1.1  christos 	mov.w	#0xa5a5, @word_dest
    795  1.1  christos 
    796  1.1  christos rotl_w_indexl32_2:
    797  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    798  1.1  christos 	set_ccr_zero
    799  1.1  christos 
    800  1.1  christos 	mov.l	#0xffffffff, er1
    801  1.1  christos 	rotl.w	#2, @(word_dest+2:32, er1.l)	; indexed word/byte
    802  1.1  christos 
    803  1.1  christos 	test_carry_clear		; H=0 N=1 Z=0 V=0 C=0
    804  1.1  christos 	test_zero_clear
    805  1.1  christos 	test_ovf_clear
    806  1.1  christos 	test_neg_set
    807  1.1  christos 
    808  1.1  christos 	test_h_gr32  0xffffffff er1
    809  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
    810  1.1  christos 	test_gr_a5a5 2
    811  1.1  christos 	test_gr_a5a5 3
    812  1.1  christos 	test_gr_a5a5 4
    813  1.1  christos 	test_gr_a5a5 5
    814  1.1  christos 	test_gr_a5a5 6
    815  1.1  christos 	test_gr_a5a5 7
    816  1.1  christos 	; 1010 0101 1010 0101 -> 1001 0110 1001 0110
    817  1.1  christos 	cmp.w	#0x9696, @word_dest
    818  1.1  christos 	beq	.Lwindexl322
    819  1.1  christos 	fail
    820  1.1  christos .Lwindexl322:
    821  1.1  christos 	mov.w	#0xa5a5, @word_dest
    822  1.1  christos .endif
    823  1.1  christos 
    824  1.1  christos rotl_l_reg32_1:
    825  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    826  1.1  christos 	set_ccr_zero
    827  1.1  christos 
    828  1.1  christos 	rotl.l	er0		; shift left arithmetic by one
    829  1.1  christos 
    830  1.1  christos 	test_carry_set		; H=0 N=0 Z=0 V=0 C=1
    831  1.1  christos 	test_zero_clear
    832  1.1  christos 	test_ovf_clear
    833  1.1  christos 	test_neg_clear
    834  1.1  christos 	; 1010 0101 1010 0101 1010 0101 1010 0101
    835  1.1  christos 	; -> 0100 1011 0100 1011 0100 1011 0100 1011
    836  1.1  christos 	test_h_gr32 0x4b4b4b4b er0
    837  1.1  christos 
    838  1.1  christos 	test_gr_a5a5 1		; Make sure other general regs not disturbed
    839  1.1  christos 	test_gr_a5a5 2
    840  1.1  christos 	test_gr_a5a5 3
    841  1.1  christos 	test_gr_a5a5 4
    842  1.1  christos 	test_gr_a5a5 5
    843  1.1  christos 	test_gr_a5a5 6
    844  1.1  christos 	test_gr_a5a5 7
    845  1.1  christos 
    846  1.1  christos .if (sim_cpu == h8sx)
    847  1.1  christos rotl_l_indexb16_1:
    848  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    849  1.1  christos 	set_ccr_zero
    850  1.1  christos 
    851  1.1  christos 	mov.b	#5, r0l
    852  1.1  christos 	rotl.l	@(long_dest-20:16, er0.b)	; indexed long/byte
    853  1.1  christos 
    854  1.1  christos 	test_carry_set		; H=0 N=0 Z=0 V=0 C=1
    855  1.1  christos 	test_zero_clear
    856  1.1  christos 	test_ovf_clear
    857  1.1  christos 	test_neg_clear
    858  1.1  christos 
    859  1.1  christos 	test_h_gr32  0xa5a5a505 er0
    860  1.1  christos 	test_gr_a5a5 1		; Make sure other general regs not disturbed
    861  1.1  christos 	test_gr_a5a5 2
    862  1.1  christos 	test_gr_a5a5 3
    863  1.1  christos 	test_gr_a5a5 4
    864  1.1  christos 	test_gr_a5a5 5
    865  1.1  christos 	test_gr_a5a5 6
    866  1.1  christos 	test_gr_a5a5 7
    867  1.1  christos 	; 1010 0101 1010 0101 1010 0101 1010 0101
    868  1.1  christos 	; -> 0100 1011 0100 1011 0100 1011 0100 1011
    869  1.1  christos 	cmp.l	#0x4b4b4b4b, @long_dest
    870  1.1  christos 	beq	.Llindexb161
    871  1.1  christos 	fail
    872  1.1  christos .Llindexb161:
    873  1.1  christos 	mov.l	#0xa5a5a5a5, @long_dest
    874  1.1  christos 
    875  1.1  christos rotl_l_indexw16_1:
    876  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    877  1.1  christos 	set_ccr_zero
    878  1.1  christos 
    879  1.1  christos 	mov.w	#256, r0
    880  1.1  christos 	rotl.l	@(long_dest-1024:16, er0.w)	; indexed long/word
    881  1.1  christos 
    882  1.1  christos 	test_carry_set		; H=0 N=0 Z=0 V=0 C=1
    883  1.1  christos 	test_zero_clear
    884  1.1  christos 	test_ovf_clear
    885  1.1  christos 	test_neg_clear
    886  1.1  christos 
    887  1.1  christos 	test_h_gr32  0xa5a50100 er0
    888  1.1  christos 	test_gr_a5a5 1		; Make sure other general regs not disturbed
    889  1.1  christos 	test_gr_a5a5 2
    890  1.1  christos 	test_gr_a5a5 3
    891  1.1  christos 	test_gr_a5a5 4
    892  1.1  christos 	test_gr_a5a5 5
    893  1.1  christos 	test_gr_a5a5 6
    894  1.1  christos 	test_gr_a5a5 7
    895  1.1  christos 	; 1010 0101 1010 0101 1010 0101 1010 0101
    896  1.1  christos 	; -> 0100 1011 0100 1011 0100 1011 0100 1011
    897  1.1  christos 	cmp.l	#0x4b4b4b4b, @long_dest
    898  1.1  christos 	beq	.Llindexw161
    899  1.1  christos 	fail
    900  1.1  christos .Llindexw161:
    901  1.1  christos 	mov.l	#0xa5a5a5a5, @long_dest
    902  1.1  christos 
    903  1.1  christos rotl_l_indexl16_1:
    904  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    905  1.1  christos 	set_ccr_zero
    906  1.1  christos 
    907  1.1  christos 	mov.l	#0xffffffff, er0
    908  1.1  christos 	rotl.l	@(long_dest+4:16, er0.l)	; indexed long/long
    909  1.1  christos 
    910  1.1  christos 	test_carry_set		; H=0 N=0 Z=0 V=0 C=1
    911  1.1  christos 	test_zero_clear
    912  1.1  christos 	test_ovf_clear
    913  1.1  christos 	test_neg_clear
    914  1.1  christos 
    915  1.1  christos 	test_h_gr32  0xffffffff er0
    916  1.1  christos 	test_gr_a5a5 1		; Make sure other general regs not disturbed
    917  1.1  christos 	test_gr_a5a5 2
    918  1.1  christos 	test_gr_a5a5 3
    919  1.1  christos 	test_gr_a5a5 4
    920  1.1  christos 	test_gr_a5a5 5
    921  1.1  christos 	test_gr_a5a5 6
    922  1.1  christos 	test_gr_a5a5 7
    923  1.1  christos 	; 1010 0101 1010 0101 1010 0101 1010 0101
    924  1.1  christos 	; -> 0100 1011 0100 1011 0100 1011 0100 1011
    925  1.1  christos 	cmp.l	#0x4b4b4b4b, @long_dest
    926  1.1  christos 	beq	.Llindexl161
    927  1.1  christos 	fail
    928  1.1  christos .Llindexl161:
    929  1.1  christos 	mov.l	#0xa5a5a5a5, @long_dest
    930  1.1  christos 
    931  1.1  christos rotl_l_indexb32_1:
    932  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    933  1.1  christos 	set_ccr_zero
    934  1.1  christos 
    935  1.1  christos 	mov.b	#5, r1l
    936  1.1  christos 	rotl.l	@(long_dest-20:32, er1.b)	; indexed long/byte
    937  1.1  christos 
    938  1.1  christos 	test_carry_set		; H=0 N=0 Z=0 V=0 C=1
    939  1.1  christos 	test_zero_clear
    940  1.1  christos 	test_ovf_clear
    941  1.1  christos 	test_neg_clear
    942  1.1  christos 
    943  1.1  christos 	test_h_gr32  0xa5a5a505 er1
    944  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
    945  1.1  christos 	test_gr_a5a5 2
    946  1.1  christos 	test_gr_a5a5 3
    947  1.1  christos 	test_gr_a5a5 4
    948  1.1  christos 	test_gr_a5a5 5
    949  1.1  christos 	test_gr_a5a5 6
    950  1.1  christos 	test_gr_a5a5 7
    951  1.1  christos 	; 1010 0101 1010 0101 1010 0101 1010 0101
    952  1.1  christos 	; -> 0100 1011 0100 1011 0100 1011 0100 1011
    953  1.1  christos 	cmp.l	#0x4b4b4b4b, @long_dest
    954  1.1  christos 	beq	.Llindexb321
    955  1.1  christos 	fail
    956  1.1  christos .Llindexb321:
    957  1.1  christos 	mov.l	#0xa5a5a5a5, @long_dest
    958  1.1  christos 
    959  1.1  christos rotl_l_indexw32_1:
    960  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    961  1.1  christos 	set_ccr_zero
    962  1.1  christos 
    963  1.1  christos 	mov.w	#256, r1
    964  1.1  christos 	rotl.l	@(long_dest-1024:32, er1.w)	; indexed long/byte
    965  1.1  christos 
    966  1.1  christos 	test_carry_set		; H=0 N=0 Z=0 V=0 C=1
    967  1.1  christos 	test_zero_clear
    968  1.1  christos 	test_ovf_clear
    969  1.1  christos 	test_neg_clear
    970  1.1  christos 
    971  1.1  christos 	test_h_gr32  0xa5a50100 er1
    972  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
    973  1.1  christos 	test_gr_a5a5 2
    974  1.1  christos 	test_gr_a5a5 3
    975  1.1  christos 	test_gr_a5a5 4
    976  1.1  christos 	test_gr_a5a5 5
    977  1.1  christos 	test_gr_a5a5 6
    978  1.1  christos 	test_gr_a5a5 7
    979  1.1  christos 	; 1010 0101 1010 0101 1010 0101 1010 0101
    980  1.1  christos 	; -> 0100 1011 0100 1011 0100 1011 0100 1011
    981  1.1  christos 	cmp.l	#0x4b4b4b4b, @long_dest
    982  1.1  christos 	beq	.Llindexw321
    983  1.1  christos 	fail
    984  1.1  christos .Llindexw321:
    985  1.1  christos 	mov.l	#0xa5a5a5a5, @long_dest
    986  1.1  christos 
    987  1.1  christos rotl_l_indexl32_1:
    988  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    989  1.1  christos 	set_ccr_zero
    990  1.1  christos 
    991  1.1  christos 	mov.l	#0xffffffff, er1
    992  1.1  christos 	rotl.l	@(long_dest+4:32, er1.l)	; indexed long/byte
    993  1.1  christos 
    994  1.1  christos 	test_carry_set		; H=0 N=0 Z=0 V=0 C=1
    995  1.1  christos 	test_zero_clear
    996  1.1  christos 	test_ovf_clear
    997  1.1  christos 	test_neg_clear
    998  1.1  christos 
    999  1.1  christos 	test_h_gr32  0xffffffff er1
   1000  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
   1001  1.1  christos 	test_gr_a5a5 2
   1002  1.1  christos 	test_gr_a5a5 3
   1003  1.1  christos 	test_gr_a5a5 4
   1004  1.1  christos 	test_gr_a5a5 5
   1005  1.1  christos 	test_gr_a5a5 6
   1006  1.1  christos 	test_gr_a5a5 7
   1007  1.1  christos 	; 1010 0101 1010 0101 1010 0101 1010 0101
   1008  1.1  christos 	; -> 0100 1011 0100 1011 0100 1011 0100 1011
   1009  1.1  christos 	cmp.l	#0x4b4b4b4b, @long_dest
   1010  1.1  christos 	beq	.Llindexl321
   1011  1.1  christos 	fail
   1012  1.1  christos .Llindexl321:
   1013  1.1  christos 	mov.l	#0xa5a5a5a5, @long_dest
   1014  1.1  christos .endif
   1015  1.1  christos 
   1016  1.1  christos rotl_l_reg32_2:
   1017  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
   1018  1.1  christos 	set_ccr_zero
   1019  1.1  christos 
   1020  1.1  christos 	rotl.l	#2, er0		; shift left arithmetic by two
   1021  1.1  christos 
   1022  1.1  christos 	test_carry_clear	; H=0 N=1 Z=0 V=0 C=0
   1023  1.1  christos 	test_zero_clear
   1024  1.1  christos 	test_ovf_clear
   1025  1.1  christos 	test_neg_set
   1026  1.1  christos 	; 1010 0101 1010 0101 1010 0101 1010 0101
   1027  1.1  christos 	; -> 1001 0110 1001 0110 1001 0110 1001 0110
   1028  1.1  christos 	test_h_gr32 0x96969696 er0
   1029  1.1  christos 
   1030  1.1  christos 	test_gr_a5a5 1		; Make sure other general regs not disturbed
   1031  1.1  christos 	test_gr_a5a5 2
   1032  1.1  christos 	test_gr_a5a5 3
   1033  1.1  christos 	test_gr_a5a5 4
   1034  1.1  christos 	test_gr_a5a5 5
   1035  1.1  christos 	test_gr_a5a5 6
   1036  1.1  christos 	test_gr_a5a5 7
   1037  1.1  christos 
   1038  1.1  christos .if (sim_cpu == h8sx)
   1039  1.1  christos rotl_l_indexb16_2:
   1040  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
   1041  1.1  christos 	set_ccr_zero
   1042  1.1  christos 
   1043  1.1  christos 	mov.b	#5, r0l
   1044  1.1  christos 	rotl.l	#2, @(long_dest-20:16, er0.b)	; indexed long/byte
   1045  1.1  christos 
   1046  1.1  christos 	test_carry_clear		; H=0 N=1 Z=0 V=0 C=0
   1047  1.1  christos 	test_zero_clear
   1048  1.1  christos 	test_ovf_clear
   1049  1.1  christos 	test_neg_set
   1050  1.1  christos 
   1051  1.1  christos 	test_h_gr32  0xa5a5a505 er0
   1052  1.1  christos 	test_gr_a5a5 1		; Make sure other general regs not disturbed
   1053  1.1  christos 	test_gr_a5a5 2
   1054  1.1  christos 	test_gr_a5a5 3
   1055  1.1  christos 	test_gr_a5a5 4
   1056  1.1  christos 	test_gr_a5a5 5
   1057  1.1  christos 	test_gr_a5a5 6
   1058  1.1  christos 	test_gr_a5a5 7
   1059  1.1  christos 	; 1010 0101 1010 0101 1010 0101 1010 0101
   1060  1.1  christos 	; -> 1001 0110 1001 0110 1001 0110 1001 0110
   1061  1.1  christos 	cmp.l	#0x96969696, @long_dest
   1062  1.1  christos 	beq	.Llindexb162
   1063  1.1  christos 	fail
   1064  1.1  christos .Llindexb162:
   1065  1.1  christos 	mov.l	#0xa5a5a5a5, @long_dest
   1066  1.1  christos 
   1067  1.1  christos rotl_l_indexw16_2:
   1068  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
   1069  1.1  christos 	set_ccr_zero
   1070  1.1  christos 
   1071  1.1  christos 	mov.w	#256, r0
   1072  1.1  christos 	rotl.l	#2, @(long_dest-1024:16, er0.w)	; indexed long/word
   1073  1.1  christos 
   1074  1.1  christos 	test_carry_clear		; H=0 N=1 Z=0 V=0 C=0
   1075  1.1  christos 	test_zero_clear
   1076  1.1  christos 	test_ovf_clear
   1077  1.1  christos 	test_neg_set
   1078  1.1  christos 
   1079  1.1  christos 	test_h_gr32  0xa5a50100 er0
   1080  1.1  christos 	test_gr_a5a5 1		; Make sure other general regs not disturbed
   1081  1.1  christos 	test_gr_a5a5 2
   1082  1.1  christos 	test_gr_a5a5 3
   1083  1.1  christos 	test_gr_a5a5 4
   1084  1.1  christos 	test_gr_a5a5 5
   1085  1.1  christos 	test_gr_a5a5 6
   1086  1.1  christos 	test_gr_a5a5 7
   1087  1.1  christos 	; 1010 0101 1010 0101 1010 0101 1010 0101
   1088  1.1  christos 	; -> 1001 0110 1001 0110 1001 0110 1001 0110
   1089  1.1  christos 	cmp.l	#0x96969696, @long_dest
   1090  1.1  christos 	beq	.Llindexw162
   1091  1.1  christos 	fail
   1092  1.1  christos .Llindexw162:
   1093  1.1  christos 	mov.l	#0xa5a5a5a5, @long_dest
   1094  1.1  christos 
   1095  1.1  christos rotl_l_indexl16_2:
   1096  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
   1097  1.1  christos 	set_ccr_zero
   1098  1.1  christos 
   1099  1.1  christos 	mov.l	#0xffffffff, er0
   1100  1.1  christos 	rotl.l	#2, @(long_dest+4:16, er0.l)	; indexed long/long
   1101  1.1  christos 
   1102  1.1  christos 	test_carry_clear		; H=0 N=1 Z=0 V=0 C=0
   1103  1.1  christos 	test_zero_clear
   1104  1.1  christos 	test_ovf_clear
   1105  1.1  christos 	test_neg_set
   1106  1.1  christos 
   1107  1.1  christos 	test_h_gr32  0xffffffff er0
   1108  1.1  christos 	test_gr_a5a5 1		; Make sure other general regs not disturbed
   1109  1.1  christos 	test_gr_a5a5 2
   1110  1.1  christos 	test_gr_a5a5 3
   1111  1.1  christos 	test_gr_a5a5 4
   1112  1.1  christos 	test_gr_a5a5 5
   1113  1.1  christos 	test_gr_a5a5 6
   1114  1.1  christos 	test_gr_a5a5 7
   1115  1.1  christos 	; 1010 0101 1010 0101 1010 0101 1010 0101
   1116  1.1  christos 	; -> 1001 0110 1001 0110 1001 0110 1001 0110
   1117  1.1  christos 	cmp.l	#0x96969696, @long_dest
   1118  1.1  christos 	beq	.Llindexl162
   1119  1.1  christos 	fail
   1120  1.1  christos .Llindexl162:
   1121  1.1  christos 	mov.l	#0xa5a5a5a5, @long_dest
   1122  1.1  christos 
   1123  1.1  christos rotl_l_indexb32_2:
   1124  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
   1125  1.1  christos 	set_ccr_zero
   1126  1.1  christos 
   1127  1.1  christos 	mov.b	#5, r1l
   1128  1.1  christos 	rotl.l	#2, @(long_dest-20:32, er1.b)	; indexed long/byte
   1129  1.1  christos 
   1130  1.1  christos 	test_carry_clear		; H=0 N=1 Z=0 V=0 C=0
   1131  1.1  christos 	test_zero_clear
   1132  1.1  christos 	test_ovf_clear
   1133  1.1  christos 	test_neg_set
   1134  1.1  christos 
   1135  1.1  christos 	test_h_gr32  0xa5a5a505 er1
   1136  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
   1137  1.1  christos 	test_gr_a5a5 2
   1138  1.1  christos 	test_gr_a5a5 3
   1139  1.1  christos 	test_gr_a5a5 4
   1140  1.1  christos 	test_gr_a5a5 5
   1141  1.1  christos 	test_gr_a5a5 6
   1142  1.1  christos 	test_gr_a5a5 7
   1143  1.1  christos 	; 1010 0101 1010 0101 1010 0101 1010 0101
   1144  1.1  christos 	; -> 1001 0110 1001 0110 1001 0110 1001 0110
   1145  1.1  christos 	cmp.l	#0x96969696, @long_dest
   1146  1.1  christos 	beq	.Llindexb322
   1147  1.1  christos 	fail
   1148  1.1  christos .Llindexb322:
   1149  1.1  christos 	mov.l	#0xa5a5a5a5, @long_dest
   1150  1.1  christos 
   1151  1.1  christos rotl_l_indexw32_2:
   1152  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
   1153  1.1  christos 	set_ccr_zero
   1154  1.1  christos 
   1155  1.1  christos 	mov.w	#256, r1
   1156  1.1  christos 	rotl.l	#2, @(long_dest-1024:32, er1.w)	; indexed long/byte
   1157  1.1  christos 
   1158  1.1  christos 	test_carry_clear		; H=0 N=1 Z=0 V=0 C=0
   1159  1.1  christos 	test_zero_clear
   1160  1.1  christos 	test_ovf_clear
   1161  1.1  christos 	test_neg_set
   1162  1.1  christos 
   1163  1.1  christos 	test_h_gr32  0xa5a50100 er1
   1164  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
   1165  1.1  christos 	test_gr_a5a5 2
   1166  1.1  christos 	test_gr_a5a5 3
   1167  1.1  christos 	test_gr_a5a5 4
   1168  1.1  christos 	test_gr_a5a5 5
   1169  1.1  christos 	test_gr_a5a5 6
   1170  1.1  christos 	test_gr_a5a5 7
   1171  1.1  christos 	; 1010 0101 1010 0101 1010 0101 1010 0101
   1172  1.1  christos 	; -> 1001 0110 1001 0110 1001 0110 1001 0110
   1173  1.1  christos 	cmp.l	#0x96969696, @long_dest
   1174  1.1  christos 	beq	.Llindexw322
   1175  1.1  christos 	fail
   1176  1.1  christos .Llindexw322:
   1177  1.1  christos 	mov.l	#0xa5a5a5a5, @long_dest
   1178  1.1  christos 
   1179  1.1  christos rotl_l_indexl32_2:
   1180  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
   1181  1.1  christos 	set_ccr_zero
   1182  1.1  christos 
   1183  1.1  christos 	mov.l	#0xffffffff, er1
   1184  1.1  christos 	rotl.l	#2, @(long_dest+4:32, er1.l)	; indexed long/byte
   1185  1.1  christos 
   1186  1.1  christos 	test_carry_clear		; H=0 N=1 Z=0 V=0 C=0
   1187  1.1  christos 	test_zero_clear
   1188  1.1  christos 	test_ovf_clear
   1189  1.1  christos 	test_neg_set
   1190  1.1  christos 
   1191  1.1  christos 	test_h_gr32  0xffffffff er1
   1192  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
   1193  1.1  christos 	test_gr_a5a5 2
   1194  1.1  christos 	test_gr_a5a5 3
   1195  1.1  christos 	test_gr_a5a5 4
   1196  1.1  christos 	test_gr_a5a5 5
   1197  1.1  christos 	test_gr_a5a5 6
   1198  1.1  christos 	test_gr_a5a5 7
   1199  1.1  christos 	; 1010 0101 1010 0101 1010 0101 1010 0101
   1200  1.1  christos 	; -> 1001 0110 1001 0110 1001 0110 1001 0110
   1201  1.1  christos 	cmp.l	#0x96969696, @long_dest
   1202  1.1  christos 	beq	.Llindexl322
   1203  1.1  christos 	fail
   1204  1.1  christos .Llindexl322:
   1205  1.1  christos 	mov.l	#0xa5a5a5a5, @long_dest
   1206  1.1  christos .endif
   1207  1.1  christos .endif
   1208  1.1  christos 
   1209  1.1  christos 	pass
   1210  1.1  christos 
   1211  1.1  christos 	exit 0
   1212  1.1  christos 
   1213