1 # Hitachi H8 testcase 'mov.l'
2 # mach(): h8300h h8300s h8sx
3 # as(h8300h): --defsym sim_cpu=1
4 # as(h8300s): --defsym sim_cpu=2
5 # as(h8sx): --defsym sim_cpu=3
6 # ld(h8300h): -m h8300helf
7 # ld(h8300s): -m h8300self
8 # ld(h8sx): -m h8300sxelf
10 .include "testutils.inc"
24 ;; Move long from immediate source
29 set_grs_a5a5 ; Fill all general regs with a fixed pattern
33 mov.l #0x3:3, er0 ; Immediate 3-bit operand
36 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
44 test_gr_a5a5 1 ; Make sure other general regs not disturbed
53 set_grs_a5a5 ; Fill all general regs with a fixed pattern
57 mov.l #0x1234, er0 ; Immediate 16-bit operand
61 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
67 test_h_gr32 0x1234 er0
69 test_gr_a5a5 1 ; Make sure other general regs not disturbed
79 set_grs_a5a5 ; Fill all general regs with a fixed pattern
83 mov.l #0x12345678, er0 ; Immediate 32-bit operand
87 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
93 test_h_gr32 0x12345678 er0
95 test_gr_a5a5 1 ; Make sure other general regs not disturbed
103 .if (sim_cpu == h8sx)
104 mov_l_imm8_to_indirect:
105 set_grs_a5a5 ; Fill all general regs with a fixed pattern
110 mov.l #0xa5:8, @er1 ; Register indirect operand
114 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
120 test_gr_a5a5 0 ; Make sure other general regs not disturbed
121 test_h_gr32 long_dst, er1
129 ;; Now check the result of the move to memory.
130 cmp.l #0xa5, @long_dst
134 mov.l #0, @long_dst ; zero it again for the next use.
136 mov_l_imm8_to_postinc: ; post-increment from imm8 to mem
137 set_grs_a5a5 ; Fill all general regs with a fixed pattern
140 ;; mov.l #xx:8, @erd+
142 mov.l #0xa5:8, @er1+ ; Imm8, register post-incr operands.
146 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
152 test_gr_a5a5 0 ; Make sure other general regs not disturbed
153 test_h_gr32 long_dst+4, er1
161 ;; Now check the result of the move to memory.
162 cmp.l #0xa5, @long_dst
166 mov.l #0, @long_dst ; zero it again for the next use.
168 mov_l_imm8_to_postdec: ; post-decrement from imm8 to mem
169 set_grs_a5a5 ; Fill all general regs with a fixed pattern
172 ;; mov.l #xx:8, @erd-
174 mov.l #0xa5:8, @er1- ; Imm8, register post-decr operands.
178 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
184 test_gr_a5a5 0 ; Make sure other general regs not disturbed
185 test_h_gr32 long_dst-4, er1
193 ;; Now check the result of the move to memory.
194 cmp.l #0xa5, @long_dst
198 mov.l #0, @long_dst ; zero it again for the next use.
200 mov_l_imm8_to_preinc: ; pre-increment from register to mem
201 set_grs_a5a5 ; Fill all general regs with a fixed pattern
204 ;; mov.l #xx:8, @+erd
205 mov.l #long_dst-4, er1
206 mov.l #0xa5:8, @+er1 ; Imm8, register pre-incr operands
210 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
216 test_gr_a5a5 0 ; Make sure other general regs not disturbed
217 test_h_gr32 long_dst, er1
225 ;; Now check the result of the move to memory.
226 cmp.l #0xa5, @long_dst
230 mov.l #0, @long_dst ; zero it again for the next use.
232 mov_l_imm8_to_predec: ; pre-decrement from register to mem
233 set_grs_a5a5 ; Fill all general regs with a fixed pattern
236 ;; mov.l #xx:8, @-erd
237 mov.l #long_dst+4, er1
238 mov.l #0xa5:8, @-er1 ; Imm8, register pre-decr operands
242 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
248 test_gr_a5a5 0 ; Make sure other general regs not disturbed
249 test_h_gr32 long_dst, er1
257 ;; Now check the result of the move to memory.
258 cmp.l #0xa5, @long_dst
262 mov.l #0, @long_dst ; zero it again for the next use.
265 set_grs_a5a5 ; Fill all general regs with a fixed pattern
268 ;; mov.l #xx:8, @(dd:2, erd)
269 mov.l #long_dst-12, er1
270 mov.l #0xa5:8, @(12:2, er1) ; Imm8, reg plus 2-bit disp. operand
274 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
280 test_gr_a5a5 0 ; Make sure other general regs not disturbed
281 test_h_gr32 long_dst-12, er1
289 ;; Now check the result of the move to memory.
290 cmp.l #0xa5, @long_dst
294 mov.l #0, @long_dst ; zero it again for the next use.
296 mov_l_imm8_to_disp16:
297 set_grs_a5a5 ; Fill all general regs with a fixed pattern
300 ;; mov.l #xx:8, @(dd:16, erd)
301 mov.l #long_dst-4, er1
302 mov.l #0xa5:8, @(4:16, er1) ; Register plus 16-bit disp. operand
307 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
313 test_gr_a5a5 0 ; Make sure other general regs not disturbed
314 test_h_gr32 long_dst-4, er1
322 ;; Now check the result of the move to memory.
323 cmp.l #0xa5, @long_dst
327 mov.l #0, @long_dst ; zero it again for the next use.
329 mov_l_imm8_to_disp32:
330 set_grs_a5a5 ; Fill all general regs with a fixed pattern
333 ;; mov.l #xx:8, @(dd:32, erd)
334 mov.l #long_dst-8, er1
335 mov.l #0xa5:8, @(8:32, er1) ; Register plus 32-bit disp. operand
340 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
346 test_gr_a5a5 0 ; Make sure other general regs not disturbed
347 test_h_gr32 long_dst-8, er1
355 ;; Now check the result of the move to memory.
356 cmp.l #0xa5, @long_dst
360 mov.l #0, @long_dst ; zero it again for the next use.
363 set_grs_a5a5 ; Fill all general regs with a fixed pattern
366 ;; mov.l #xx:8, @aa:16
367 mov.l #0xa5:8, @long_dst:16 ; 16-bit address-direct operand
372 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
378 test_gr_a5a5 0 ; Make sure _ALL_ general regs not disturbed
379 test_gr_a5a5 1 ; (first, because on h8/300 we must use one
380 test_gr_a5a5 2 ; to examine the destination memory).
387 ;; Now check the result of the move to memory.
388 cmp.l #0xa5, @long_dst
392 mov.l #0, @long_dst ; zero it again for the next use.
395 set_grs_a5a5 ; Fill all general regs with a fixed pattern
398 ;; mov.l #xx:8, @aa:32
399 mov.l #0xa5:8, @long_dst:32 ; 32-bit address-direct operand
404 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
410 test_gr_a5a5 0 ; Make sure _ALL_ general regs not disturbed
411 test_gr_a5a5 1 ; (first, because on h8/300 we must use one
412 test_gr_a5a5 2 ; to examine the destination memory).
419 ;; Now check the result of the move to memory.
420 cmp.l #0xa5, @long_dst
424 mov.l #0, @long_dst ; zero it again for the next use.
426 mov_l_imm16_to_indirect:
427 set_grs_a5a5 ; Fill all general regs with a fixed pattern
430 ;; mov.l #xx:16, @erd
432 mov.l #0xdead:16, @er1 ; Register indirect operand
437 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
443 test_gr_a5a5 0 ; Make sure other general regs not disturbed
444 test_h_gr32 long_dst, er1
452 ;; Now check the result of the move to memory.
453 cmp.l #0xdead, @long_dst
457 mov.l #0, @long_dst ; zero it again for the next use.
459 mov_l_imm16_to_postinc: ; post-increment from imm16 to mem
460 set_grs_a5a5 ; Fill all general regs with a fixed pattern
463 ;; mov.l #xx:16, @erd+
465 mov.l #0xdead:16, @er1+ ; Imm16, register post-incr operands.
470 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
476 test_gr_a5a5 0 ; Make sure other general regs not disturbed
477 test_h_gr32 long_dst+4, er1
485 ;; Now check the result of the move to memory.
486 cmp.l #0xdead, @long_dst
490 mov.l #0, @long_dst ; zero it again for the next use.
492 mov_l_imm16_to_postdec: ; post-decrement from imm16 to mem
493 set_grs_a5a5 ; Fill all general regs with a fixed pattern
496 ;; mov.l #xx:16, @erd-
498 mov.l #0xdead:16, @er1- ; Imm16, register post-decr operands.
503 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
509 test_gr_a5a5 0 ; Make sure other general regs not disturbed
510 test_h_gr32 long_dst-4, er1
518 ;; Now check the result of the move to memory.
519 cmp.l #0xdead, @long_dst
523 mov.l #0, @long_dst ; zero it again for the next use.
525 mov_l_imm16_to_preinc: ; pre-increment from register to mem
526 set_grs_a5a5 ; Fill all general regs with a fixed pattern
529 ;; mov.l #xx:16, @+erd
530 mov.l #long_dst-4, er1
531 mov.l #0xdead:16, @+er1 ; Imm16, register pre-incr operands
536 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
542 test_gr_a5a5 0 ; Make sure other general regs not disturbed
543 test_h_gr32 long_dst, er1
551 ;; Now check the result of the move to memory.
552 cmp.l #0xdead, @long_dst
556 mov.l #0, @long_dst ; zero it again for the next use.
558 mov_l_imm16_to_predec: ; pre-decrement from register to mem
559 set_grs_a5a5 ; Fill all general regs with a fixed pattern
562 ;; mov.l #xx:16, @-erd
563 mov.l #long_dst+4, er1
564 mov.l #0xdead:16, @-er1 ; Imm16, register pre-decr operands
569 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
575 test_gr_a5a5 0 ; Make sure other general regs not disturbed
576 test_h_gr32 long_dst, er1
584 ;; Now check the result of the move to memory.
585 cmp.l #0xdead, @long_dst
589 mov.l #0, @long_dst ; zero it again for the next use.
591 mov_l_imm16_to_disp2:
592 set_grs_a5a5 ; Fill all general regs with a fixed pattern
595 ;; mov.l #xx:16, @(dd:2, erd)
596 mov.l #long_dst-12, er1
597 mov.l #0xdead:16, @(12:2, er1) ; Imm16, reg plus 2-bit disp. operand
602 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
608 test_gr_a5a5 0 ; Make sure other general regs not disturbed
609 test_h_gr32 long_dst-12, er1
617 ;; Now check the result of the move to memory.
618 cmp.l #0xdead, @long_dst
622 mov.l #0, @long_dst ; zero it again for the next use.
624 mov_l_imm16_to_disp16:
625 set_grs_a5a5 ; Fill all general regs with a fixed pattern
628 ;; mov.l #xx:16, @(dd:16, erd)
629 mov.l #long_dst-4, er1
630 mov.l #0xdead:16, @(4:16, er1) ; Register plus 16-bit disp. operand
636 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
642 test_gr_a5a5 0 ; Make sure other general regs not disturbed
643 test_h_gr32 long_dst-4, er1
651 ;; Now check the result of the move to memory.
652 cmp.l #0xdead, @long_dst
656 mov.l #0, @long_dst ; zero it again for the next use.
658 mov_l_imm16_to_disp32:
659 set_grs_a5a5 ; Fill all general regs with a fixed pattern
662 ;; mov.l #xx:16, @(dd:32, erd)
663 mov.l #long_dst-8, er1
664 mov.l #0xdead:16, @(8:32, er1) ; Register plus 32-bit disp. operand
670 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
676 test_gr_a5a5 0 ; Make sure other general regs not disturbed
677 test_h_gr32 long_dst-8, er1
685 ;; Now check the result of the move to memory.
686 cmp.l #0xdead, @long_dst
690 mov.l #0, @long_dst ; zero it again for the next use.
692 mov_l_imm16_to_abs16:
693 set_grs_a5a5 ; Fill all general regs with a fixed pattern
696 ;; mov.l #xx:16, @aa:16
697 mov.l #0xdead:16, @long_dst:16 ; 16-bit address-direct operand
703 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
709 test_gr_a5a5 0 ; Make sure _ALL_ general regs not disturbed
710 test_gr_a5a5 1 ; (first, because on h8/300 we must use one
711 test_gr_a5a5 2 ; to examine the destination memory).
718 ;; Now check the result of the move to memory.
719 cmp.l #0xdead, @long_dst
723 mov.l #0, @long_dst ; zero it again for the next use.
725 mov_l_imm16_to_abs32:
726 set_grs_a5a5 ; Fill all general regs with a fixed pattern
729 ;; mov.l #xx:16, @aa:32
730 mov.l #0xdead:16, @long_dst:32 ; 32-bit address-direct operand
736 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
742 test_gr_a5a5 0 ; Make sure _ALL_ general regs not disturbed
743 test_gr_a5a5 1 ; (first, because on h8/300 we must use one
744 test_gr_a5a5 2 ; to examine the destination memory).
751 ;; Now check the result of the move to memory.
752 cmp.l #0xdead, @long_dst
756 mov.l #0, @long_dst ; zero it again for the next use.
758 mov_l_imm32_to_indirect:
759 set_grs_a5a5 ; Fill all general regs with a fixed pattern
762 ;; mov.l #xx:32, @erd
764 mov.l #0xcafedead:32, @er1 ; Register indirect operand
769 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
775 test_gr_a5a5 0 ; Make sure other general regs not disturbed
776 test_h_gr32 long_dst, er1
784 ;; Now check the result of the move to memory.
785 cmp.l #0xcafedead, @long_dst
789 mov.l #0, @long_dst ; zero it again for the next use.
791 mov_l_imm32_to_postinc: ; post-increment from imm32 to mem
792 set_grs_a5a5 ; Fill all general regs with a fixed pattern
795 ;; mov.l #xx:32, @erd+
797 mov.l #0xcafedead:32, @er1+ ; Imm32, register post-incr operands.
802 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
808 test_gr_a5a5 0 ; Make sure other general regs not disturbed
809 test_h_gr32 long_dst+4, er1
817 ;; Now check the result of the move to memory.
818 cmp.l #0xcafedead, @long_dst
822 mov.l #0, @long_dst ; zero it again for the next use.
824 mov_l_imm32_to_postdec: ; post-decrement from imm32 to mem
825 set_grs_a5a5 ; Fill all general regs with a fixed pattern
828 ;; mov.l #xx:32, @erd-
830 mov.l #0xcafedead:32, @er1- ; Imm32, register post-decr operands.
835 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
841 test_gr_a5a5 0 ; Make sure other general regs not disturbed
842 test_h_gr32 long_dst-4, er1
850 ;; Now check the result of the move to memory.
851 cmp.l #0xcafedead, @long_dst
855 mov.l #0, @long_dst ; zero it again for the next use.
857 mov_l_imm32_to_preinc: ; pre-increment from register to mem
858 set_grs_a5a5 ; Fill all general regs with a fixed pattern
861 ;; mov.l #xx:32, @+erd
862 mov.l #long_dst-4, er1
863 mov.l #0xcafedead:32, @+er1 ; Imm32, register pre-incr operands
868 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
874 test_gr_a5a5 0 ; Make sure other general regs not disturbed
875 test_h_gr32 long_dst, er1
883 ;; Now check the result of the move to memory.
884 cmp.l #0xcafedead, @long_dst
888 mov.l #0, @long_dst ; zero it again for the next use.
890 mov_l_imm32_to_predec: ; pre-decrement from register to mem
891 set_grs_a5a5 ; Fill all general regs with a fixed pattern
894 ;; mov.l #xx:32, @-erd
895 mov.l #long_dst+4, er1
896 mov.l #0xcafedead:32, @-er1 ; Imm32, register pre-decr operands
901 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
907 test_gr_a5a5 0 ; Make sure other general regs not disturbed
908 test_h_gr32 long_dst, er1
916 ;; Now check the result of the move to memory.
917 cmp.l #0xcafedead, @long_dst
921 mov.l #0, @long_dst ; zero it again for the next use.
923 mov_l_imm32_to_disp2:
924 set_grs_a5a5 ; Fill all general regs with a fixed pattern
927 ;; mov.l #xx:32, @(dd:2, erd)
928 mov.l #long_dst-12, er1
929 mov.l #0xcafedead:32, @(12:2, er1) ; Imm32, reg plus 2-bit disp. operand
934 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
940 test_gr_a5a5 0 ; Make sure other general regs not disturbed
941 test_h_gr32 long_dst-12, er1
949 ;; Now check the result of the move to memory.
950 cmp.l #0xcafedead, @long_dst
954 mov.l #0, @long_dst ; zero it again for the next use.
956 mov_l_imm32_to_disp16:
957 set_grs_a5a5 ; Fill all general regs with a fixed pattern
960 ;; mov.l #xx:32, @(dd:16, erd)
961 mov.l #long_dst-4, er1
962 mov.l #0xcafedead:32, @(4:16, er1) ; Register plus 16-bit disp. operand
968 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
974 test_gr_a5a5 0 ; Make sure other general regs not disturbed
975 test_h_gr32 long_dst-4, er1
983 ;; Now check the result of the move to memory.
984 cmp.l #0xcafedead, @long_dst
988 mov.l #0, @long_dst ; zero it again for the next use.
990 mov_l_imm32_to_disp32:
991 set_grs_a5a5 ; Fill all general regs with a fixed pattern
994 ;; mov.l #xx:32, @(dd:32, erd)
995 mov.l #long_dst-8, er1
996 mov.l #0xcafedead:32, @(8:32, er1) ; Register plus 32-bit disp. operand
1002 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
1008 test_gr_a5a5 0 ; Make sure other general regs not disturbed
1009 test_h_gr32 long_dst-8, er1
1017 ;; Now check the result of the move to memory.
1018 cmp.l #0xcafedead, @long_dst
1022 mov.l #0, @long_dst ; zero it again for the next use.
1024 mov_l_imm32_to_abs16:
1025 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1028 ;; mov.l #xx:32, @aa:16
1029 mov.l #0xcafedead:32, @long_dst:16 ; 16-bit address-direct operand
1031 ;;; .long 0xcafedead
1035 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
1041 test_gr_a5a5 0 ; Make sure _ALL_ general regs not disturbed
1042 test_gr_a5a5 1 ; (first, because on h8/300 we must use one
1043 test_gr_a5a5 2 ; to examine the destination memory).
1050 ;; Now check the result of the move to memory.
1051 cmp.l #0xcafedead, @long_dst
1055 mov.l #0, @long_dst ; zero it again for the next use.
1057 mov_l_imm32_to_abs32:
1058 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1061 ;; mov.l #xx:32, @aa:32
1062 mov.l #0xcafedead:32, @long_dst:32 ; 32-bit address-direct operand
1064 ;;; .long 0xcafedead
1068 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
1074 test_gr_a5a5 0 ; Make sure _ALL_ general regs not disturbed
1075 test_gr_a5a5 1 ; (first, because on h8/300 we must use one
1076 test_gr_a5a5 2 ; to examine the destination memory).
1083 ;; Now check the result of the move to memory.
1084 cmp.l #0xcafedead, @long_dst
1088 mov.l #0, @long_dst ; zero it again for the next use.
1093 ;; Move long from register source
1096 mov_l_reg32_to_reg32:
1097 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1101 mov.l #0x12345678, er1
1102 mov.l er1, er0 ; Register 32-bit operand
1105 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1110 test_h_gr32 0x12345678 er0
1111 test_h_gr32 0x12345678 er1 ; mov src unchanged
1113 test_gr_a5a5 2 ; Make sure other general regs not disturbed
1120 mov_l_reg32_to_indirect:
1121 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1125 mov.l #long_dst, er1
1126 mov.l er0, @er1 ; Register indirect operand
1130 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
1136 test_gr_a5a5 0 ; Make sure other general regs not disturbed
1137 test_h_gr32 long_dst, er1
1145 ;; Now check the result of the move to memory.
1147 mov.l @long_dst, er0
1153 mov.l er0, @long_dst ; zero it again for the next use.
1155 .if (sim_cpu == h8sx)
1156 mov_l_reg32_to_postinc: ; post-increment from register to mem
1157 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1161 mov.l #long_dst, er1
1162 mov.l er0, @er1+ ; Register post-incr operand
1166 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
1172 test_gr_a5a5 0 ; Make sure other general regs not disturbed
1173 test_h_gr32 long_dst+4, er1
1181 ;; Now check the result of the move to memory.
1182 cmp.l er2, @long_dst
1186 mov.l #0, @long_dst ; zero it again for the next use.
1188 mov_l_reg32_to_postdec: ; post-decrement from register to mem
1189 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1193 mov.l #long_dst, er1
1194 mov.l er0, @er1- ; Register post-decr operand
1198 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
1204 test_gr_a5a5 0 ; Make sure other general regs not disturbed
1205 test_h_gr32 long_dst-4, er1
1213 ;; Now check the result of the move to memory.
1214 cmp.l er2, @long_dst
1218 mov.l #0, @long_dst ; zero it again for the next use.
1220 mov_l_reg32_to_preinc: ; pre-increment from register to mem
1221 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1225 mov.l #long_dst-4, er1
1226 mov.l er0, @+er1 ; Register pre-incr operand
1230 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
1236 test_gr_a5a5 0 ; Make sure other general regs not disturbed
1237 test_h_gr32 long_dst, er1
1245 ;; Now check the result of the move to memory.
1246 cmp.l er2, @long_dst
1250 mov.l #0, @long_dst ; zero it again for the next use.
1253 mov_l_reg32_to_predec: ; pre-decrement from register to mem
1254 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1258 mov.l #long_dst+4, er1
1259 mov.l er0, @-er1 ; Register pre-decr operand
1263 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
1269 test_gr_a5a5 0 ; Make sure other general regs not disturbed
1270 test_h_gr32 long_dst, er1
1278 ;; Now check the result of the move to memory.
1280 mov.l @long_dst, er0
1286 mov.l er0, @long_dst ; zero it again for the next use.
1288 .if (sim_cpu == h8sx)
1289 mov_l_reg32_to_disp2:
1290 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1293 ;; mov.l ers, @(dd:2, erd)
1294 mov.l #long_dst-12, er1
1295 mov.l er0, @(12:2, er1) ; Register plus 2-bit disp. operand
1299 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
1305 test_gr_a5a5 0 ; Make sure other general regs not disturbed
1306 test_h_gr32 long_dst-12, er1
1314 ;; Now check the result of the move to memory.
1315 cmp.l er2, @long_dst
1319 mov.l #0, @long_dst ; zero it again for the next use.
1322 mov_l_reg32_to_disp16:
1323 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1326 ;; mov.l ers, @(dd:16, erd)
1327 mov.l #long_dst-4, er1
1328 mov.l er0, @(4:16, er1) ; Register plus 16-bit disp. operand
1333 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
1339 test_h_gr32 long_dst-4, er1
1340 test_gr_a5a5 0 ; Make sure other general regs not disturbed
1348 ;; Now check the result of the move to memory.
1350 mov.l @long_dst, er0
1356 mov.l er0, @long_dst ; zero it again for the next use.
1358 mov_l_reg32_to_disp32:
1359 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1362 ;; mov.l ers, @(dd:32, erd)
1363 mov.l #long_dst-8, er1
1364 mov.l er0, @(8:32, er1) ; Register plus 32-bit disp. operand
1369 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
1375 test_h_gr32 long_dst-8, er1
1376 test_gr_a5a5 0 ; Make sure other general regs not disturbed
1384 ;; Now check the result of the move to memory.
1386 mov.l @long_dst, er0
1392 mov.l er0, @long_dst ; zero it again for the next use.
1394 mov_l_reg32_to_abs16:
1395 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1398 ;; mov.l ers, @aa:16
1399 mov.l er0, @long_dst:16 ; 16-bit address-direct operand
1404 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
1410 test_gr_a5a5 0 ; Make sure _ALL_ general regs not disturbed
1411 test_gr_a5a5 1 ; (first, because on h8/300 we must use one
1412 test_gr_a5a5 2 ; to examine the destination memory).
1419 ;; Now check the result of the move to memory.
1421 mov.l @long_dst, er0
1427 mov.l er0, @long_dst ; zero it again for the next use.
1429 mov_l_reg32_to_abs32:
1430 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1433 ;; mov.l ers, @aa:32
1434 mov.l er0, @long_dst:32 ; 32-bit address-direct operand
1439 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
1445 test_gr_a5a5 0 ; Make sure _ALL_ general regs not disturbed
1446 test_gr_a5a5 1 ; (first, because on h8/300 we must use one
1447 test_gr_a5a5 2 ; to examine the destination memory).
1454 ;; Now check the result of the move to memory.
1456 mov.l @long_dst, er0
1462 mov.l er0, @long_dst ; zero it again for the next use.
1465 ;; Move long to register destination.
1468 mov_l_indirect_to_reg32:
1469 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1473 mov.l #long_src, er1
1474 mov.l @er1, er0 ; Register indirect operand
1478 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1484 test_h_gr32 0x77777777 er0
1486 test_h_gr32 long_src, er1
1487 test_gr_a5a5 2 ; Make sure other general regs not disturbed
1494 mov_l_postinc_to_reg32: ; post-increment from mem to register
1495 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1500 mov.l #long_src, er1
1501 mov.l @er1+, er0 ; Register post-incr operand
1505 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1511 test_h_gr32 0x77777777 er0
1513 test_h_gr32 long_src+4, er1
1514 test_gr_a5a5 2 ; Make sure other general regs not disturbed
1521 .if (sim_cpu == h8sx)
1522 mov_l_postdec_to_reg32: ; post-decrement from mem to register
1523 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1528 mov.l #long_src, er1
1529 mov.l @er1-, er0 ; Register post-decr operand
1533 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1539 test_h_gr32 0x77777777 er0
1541 test_h_gr32 long_src-4, er1
1542 test_gr_a5a5 2 ; Make sure other general regs not disturbed
1549 mov_l_preinc_to_reg32: ; pre-increment from mem to register
1550 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1555 mov.l #long_src-4, er1
1556 mov.l @+er1, er0 ; Register pre-incr operand
1560 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1566 test_h_gr32 0x77777777 er0
1568 test_h_gr32 long_src, er1
1569 test_gr_a5a5 2 ; Make sure other general regs not disturbed
1576 mov_l_predec_to_reg32: ; pre-decrement from mem to register
1577 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1582 mov.l #long_src+4, er1
1583 mov.l @-er1, er0 ; Register pre-decr operand
1587 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1593 test_h_gr32 0x77777777 er0
1595 test_h_gr32 long_src, er1
1596 test_gr_a5a5 2 ; Make sure other general regs not disturbed
1604 mov_l_disp2_to_reg32:
1605 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1608 ;; mov.l @(dd:2, ers), erd
1609 mov.l #long_src-4, er1
1610 mov.l @(4:2, er1), er0 ; Register plus 2-bit disp. operand
1614 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1620 test_h_gr32 0x77777777 er0 ; mov result: a5a5 | 7777
1622 test_h_gr32 long_src-4, er1
1623 test_gr_a5a5 2 ; Make sure other general regs not disturbed
1631 mov_l_disp16_to_reg32:
1632 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1635 ;; mov.l @(dd:16, ers), erd
1636 mov.l #long_src+0x1234, er1
1637 mov.l @(-0x1234:16, er1), er0 ; Register plus 16-bit disp. operand
1642 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1648 test_h_gr32 0x77777777 er0 ; mov result: a5a5 | 7777
1650 test_h_gr32 long_src+0x1234, er1
1651 test_gr_a5a5 2 ; Make sure other general regs not disturbed
1658 mov_l_disp32_to_reg32:
1659 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1662 ;; mov.l @(dd:32, ers), erd
1663 mov.l #long_src+65536, er1
1664 mov.l @(-65536:32, er1), er0 ; Register plus 32-bit disp. operand
1669 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1675 test_h_gr32 0x77777777 er0 ; mov result: a5a5 | 7777
1677 test_h_gr32 long_src+65536, er1
1678 test_gr_a5a5 2 ; Make sure other general regs not disturbed
1685 mov_l_abs16_to_reg32:
1686 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1689 ;; mov.l @aa:16, erd
1690 mov.l @long_src:16, er0 ; 16-bit address-direct operand
1695 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1701 test_h_gr32 0x77777777 er0
1703 test_gr_a5a5 1 ; Make sure other general regs not disturbed
1711 mov_l_abs32_to_reg32:
1712 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1715 ;; mov.l @aa:32, erd
1716 mov.l @long_src:32, er0 ; 32-bit address-direct operand
1721 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1727 test_h_gr32 0x77777777 er0
1729 test_gr_a5a5 1 ; Make sure other general regs not disturbed
1738 .if (sim_cpu == h8sx)
1741 ;; Move long from memory to memory
1744 mov_l_indirect_to_indirect: ; reg indirect, memory to memory
1745 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1750 mov.l #long_src, er1
1751 mov.l #long_dst, er0
1756 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1762 ;; Verify the affected registers.
1764 test_h_gr32 long_dst er0
1765 test_h_gr32 long_src er1
1766 test_gr_a5a5 2 ; Make sure other general regs not disturbed
1773 ;; Now check the result of the move to memory.
1774 cmp.l @long_src, @long_dst
1778 ;; Now clear the destination location, and verify that.
1780 cmp.l @long_src, @long_dst
1783 .Lnext56: ; OK, pass on.
1785 mov_l_postinc_to_postinc: ; reg post-increment, memory to memory
1786 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1789 ;; mov.l @ers+, @erd+
1791 mov.l #long_src, er1
1792 mov.l #long_dst, er0
1797 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1803 ;; Verify the affected registers.
1805 test_h_gr32 long_dst+4 er0
1806 test_h_gr32 long_src+4 er1
1807 test_gr_a5a5 2 ; Make sure other general regs not disturbed
1814 ;; Now check the result of the move to memory.
1815 cmp.l @long_src, @long_dst
1819 ;; Now clear the destination location, and verify that.
1821 cmp.l @long_src, @long_dst
1824 .Lnext66: ; OK, pass on.
1826 mov_l_postdec_to_postdec: ; reg post-decrement, memory to memory
1827 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1830 ;; mov.l @ers-, @erd-
1832 mov.l #long_src, er1
1833 mov.l #long_dst, er0
1838 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1844 ;; Verify the affected registers.
1846 test_h_gr32 long_dst-4 er0
1847 test_h_gr32 long_src-4 er1
1848 test_gr_a5a5 2 ; Make sure other general regs not disturbed
1855 ;; Now check the result of the move to memory.
1856 cmp.l @long_src, @long_dst
1860 ;; Now clear the destination location, and verify that.
1862 cmp.l @long_src, @long_dst
1865 .Lnext76: ; OK, pass on.
1867 mov_l_preinc_to_preinc: ; reg pre-increment, memory to memory
1868 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1871 ;; mov.l @+ers, @+erd
1873 mov.l #long_src-4, er1
1874 mov.l #long_dst-4, er0
1879 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1885 ;; Verify the affected registers.
1887 test_h_gr32 long_dst er0
1888 test_h_gr32 long_src er1
1889 test_gr_a5a5 2 ; Make sure other general regs not disturbed
1896 ;; Now check the result of the move to memory.
1897 cmp.l @long_src, @long_dst
1901 ;; Now clear the destination location, and verify that.
1903 cmp.l @long_src, @long_dst
1906 .Lnext86: ; OK, pass on.
1908 mov_l_predec_to_predec: ; reg pre-decrement, memory to memory
1909 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1912 ;; mov.l @-ers, @-erd
1914 mov.l #long_src+4, er1
1915 mov.l #long_dst+4, er0
1920 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1926 ;; Verify the affected registers.
1928 test_h_gr32 long_dst er0
1929 test_h_gr32 long_src er1
1930 test_gr_a5a5 2 ; Make sure other general regs not disturbed
1937 ;; Now check the result of the move to memory.
1938 cmp.l @long_src, @long_dst
1942 ;; Now clear the destination location, and verify that.
1944 cmp.l @long_src, @long_dst
1947 .Lnext96: ; OK, pass on.
1949 mov_l_disp2_to_disp2: ; reg 2-bit disp, memory to memory
1950 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1953 ;; mov.l @(dd:2, ers), @(dd:2, erd)
1955 mov.l #long_src-4, er1
1956 mov.l #long_dst-8, er0
1957 mov.l @(4:2, er1), @(8:2, er0)
1961 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1967 ;; Verify the affected registers.
1969 test_h_gr32 long_dst-8 er0
1970 test_h_gr32 long_src-4 er1
1971 test_gr_a5a5 2 ; Make sure other general regs not disturbed
1978 ;; Now check the result of the move to memory.
1979 cmp.l @long_src, @long_dst
1983 ;; Now clear the destination location, and verify that.
1985 cmp.l @long_src, @long_dst
1988 .Lnext106: ; OK, pass on.
1990 mov_l_disp16_to_disp16: ; reg 16-bit disp, memory to memory
1991 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1994 ;; mov.l @(dd:16, ers), @(dd:16, erd)
1996 mov.l #long_src-1, er1
1997 mov.l #long_dst-2, er0
1998 mov.l @(1:16, er1), @(2:16, er0)
2004 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
2010 ;; Verify the affected registers.
2012 test_h_gr32 long_dst-2 er0
2013 test_h_gr32 long_src-1 er1
2014 test_gr_a5a5 2 ; Make sure other general regs not disturbed
2021 ;; Now check the result of the move to memory.
2022 cmp.l @long_src, @long_dst
2026 ;; Now clear the destination location, and verify that.
2028 cmp.l @long_src, @long_dst
2031 .Lnext116: ; OK, pass on.
2033 mov_l_disp32_to_disp32: ; reg 32-bit disp, memory to memory
2034 set_grs_a5a5 ; Fill all general regs with a fixed pattern
2037 ;; mov.l @(dd:32, ers), @(dd:32, erd)
2039 mov.l #long_src-1, er1
2040 mov.l #long_dst-2, er0
2041 mov.l @(1:32, er1), @(2:32, er0)
2047 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
2053 ;; Verify the affected registers.
2055 test_h_gr32 long_dst-2 er0
2056 test_h_gr32 long_src-1 er1
2057 test_gr_a5a5 2 ; Make sure other general regs not disturbed
2064 ;; Now check the result of the move to memory.
2065 cmp.l @long_src, @long_dst
2069 ;; Now clear the destination location, and verify that.
2071 cmp.l @long_src, @long_dst
2074 .Lnext126: ; OK, pass on.
2076 mov_l_abs16_to_abs16: ; 16-bit absolute addr, memory to memory
2077 set_grs_a5a5 ; Fill all general regs with a fixed pattern
2080 ;; mov.l @aa:16, @aa:16
2082 mov.l @long_src:16, @long_dst:16
2088 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
2095 test_gr_a5a5 0 ; Make sure *NO* general registers are changed
2104 ;; Now check the result of the move to memory.
2105 cmp.l @long_src, @long_dst
2109 ;; Now clear the destination location, and verify that.
2111 cmp.l @long_src, @long_dst
2114 .Lnext136: ; OK, pass on.
2116 mov_l_abs32_to_abs32: ; 32-bit absolute addr, memory to memory
2117 set_grs_a5a5 ; Fill all general regs with a fixed pattern
2120 ;; mov.l @aa:32, @aa:32
2122 mov.l @long_src:32, @long_dst:32
2128 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
2134 test_gr_a5a5 0 ; Make sure *NO* general registers are changed
2143 ;; Now check the result of the move to memory.
2144 cmp.l @long_src, @long_dst
2148 ;; Now clear the destination location, and verify that.
2150 cmp.l @long_src, @long_dst
2153 .Lnext146: ; OK, pass on.