1 # Hitachi H8 testcase 'mov.w'
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"
26 ;; Move word from immediate source
31 set_grs_a5a5 ; Fill all general regs with a fixed pattern
35 mov.w #0x3:3, r0 ; Immediate 3-bit operand
38 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
44 test_h_gr32 0xa5a50003 er0
46 test_gr_a5a5 1 ; Make sure other general regs not disturbed
56 set_grs_a5a5 ; Fill all general regs with a fixed pattern
60 mov.w #0x1234, r0 ; Immediate 16-bit operand
64 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
70 test_h_gr32 0xa5a51234 er0
72 test_gr_a5a5 1 ; Make sure other general regs not disturbed
82 set_grs_a5a5 ; Fill all general regs with a fixed pattern
85 ;; mov.w #xx:4, @aa:16
86 mov.w #0xf:4, @word_dst:16 ; 4-bit imm to 16-bit address-direct
90 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
96 test_gr_a5a5 0 ; Make sure _ALL_ general regs not disturbed
97 test_gr_a5a5 1 ; (first, because on h8/300 we must use one
98 test_gr_a5a5 2 ; to examine the destination memory).
105 ;; Now check the result of the move to memory.
106 cmp.w #0xf, @word_dst
110 mov.w #0, @word_dst ; zero it again for the next use.
113 set_grs_a5a5 ; Fill all general regs with a fixed pattern
116 ;; mov.w #xx:4, @aa:32
117 mov.w #0xf:4, @word_dst:32 ; 4-bit imm to 32-bit address-direct
121 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
127 test_gr_a5a5 0 ; Make sure _ALL_ general regs not disturbed
128 test_gr_a5a5 1 ; (first, because on h8/300 we must use one
129 test_gr_a5a5 2 ; to examine the destination memory).
136 ;; Now check the result of the move to memory.
137 cmp.w #0xf, @word_dst
141 mov.w #0, @word_dst ; zero it again for the next use.
143 mov_w_imm8_to_indirect:
144 set_grs_a5a5 ; Fill all general regs with a fixed pattern
149 mov.w #0xa5:8, @er1 ; Register indirect operand
153 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
159 test_gr_a5a5 0 ; Make sure other general regs not disturbed
160 test_h_gr32 word_dst, er1
168 ;; Now check the result of the move to memory.
169 cmp.w #0xa5, @word_dst
173 mov.w #0, @word_dst ; zero it again for the next use.
175 mov_w_imm8_to_postinc: ; post-increment from imm8 to mem
176 set_grs_a5a5 ; Fill all general regs with a fixed pattern
179 ;; mov.w #xx:8, @erd+
181 mov.w #0xa5:8, @er1+ ; Imm8, register post-incr operands.
185 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
191 test_gr_a5a5 0 ; Make sure other general regs not disturbed
192 test_h_gr32 word_dst+2, er1
200 ;; Now check the result of the move to memory.
201 cmp.w #0xa5, @word_dst
205 mov.w #0, @word_dst ; zero it again for the next use.
207 mov_w_imm8_to_postdec: ; post-decrement from imm8 to mem
208 set_grs_a5a5 ; Fill all general regs with a fixed pattern
211 ;; mov.w #xx:8, @erd-
213 mov.w #0xa5:8, @er1- ; Imm8, register post-decr operands.
217 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
223 test_gr_a5a5 0 ; Make sure other general regs not disturbed
224 test_h_gr32 word_dst-2, er1
232 ;; Now check the result of the move to memory.
233 cmp.w #0xa5, @word_dst
237 mov.w #0, @word_dst ; zero it again for the next use.
239 mov_w_imm8_to_preinc: ; pre-increment from register to mem
240 set_grs_a5a5 ; Fill all general regs with a fixed pattern
243 ;; mov.w #xx:8, @+erd
244 mov.l #word_dst-2, er1
245 mov.w #0xa5:8, @+er1 ; Imm8, register pre-incr operands
249 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
255 test_gr_a5a5 0 ; Make sure other general regs not disturbed
256 test_h_gr32 word_dst, er1
264 ;; Now check the result of the move to memory.
265 cmp.w #0xa5, @word_dst
269 mov.w #0, @word_dst ; zero it again for the next use.
271 mov_w_imm8_to_predec: ; pre-decrement from register to mem
272 set_grs_a5a5 ; Fill all general regs with a fixed pattern
275 ;; mov.w #xx:8, @-erd
276 mov.l #word_dst+2, er1
277 mov.w #0xa5:8, @-er1 ; Imm8, register pre-decr operands
281 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
287 test_gr_a5a5 0 ; Make sure other general regs not disturbed
288 test_h_gr32 word_dst, er1
296 ;; Now check the result of the move to memory.
297 cmp.w #0xa5, @word_dst
301 mov.w #0, @word_dst ; zero it again for the next use.
304 set_grs_a5a5 ; Fill all general regs with a fixed pattern
307 ;; mov.w #xx:8, @(dd:2, erd)
308 mov.l #word_dst-6, er1
309 mov.w #0xa5:8, @(6:2, er1) ; Imm8, reg plus 2-bit disp. operand
313 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
319 test_gr_a5a5 0 ; Make sure other general regs not disturbed
320 test_h_gr32 word_dst-6, er1
328 ;; Now check the result of the move to memory.
329 cmp.w #0xa5, @word_dst
333 mov.w #0, @word_dst ; zero it again for the next use.
335 mov_w_imm8_to_disp16:
336 set_grs_a5a5 ; Fill all general regs with a fixed pattern
339 ;; mov.w #xx:8, @(dd:16, erd)
340 mov.l #word_dst-4, er1
341 mov.w #0xa5:8, @(4:16, er1) ; Register plus 16-bit disp. operand
346 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
352 test_gr_a5a5 0 ; Make sure other general regs not disturbed
353 test_h_gr32 word_dst-4, er1
361 ;; Now check the result of the move to memory.
362 cmp.w #0xa5, @word_dst
366 mov.w #0, @word_dst ; zero it again for the next use.
368 mov_w_imm8_to_disp32:
369 set_grs_a5a5 ; Fill all general regs with a fixed pattern
372 ;; mov.w #xx:8, @(dd:32, erd)
373 mov.l #word_dst-8, er1
374 mov.w #0xa5:8, @(8:32, er1) ; Register plus 32-bit disp. operand
379 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
385 test_gr_a5a5 0 ; Make sure other general regs not disturbed
386 test_h_gr32 word_dst-8, er1
394 ;; Now check the result of the move to memory.
395 cmp.w #0xa5, @word_dst
399 mov.w #0, @word_dst ; zero it again for the next use.
402 set_grs_a5a5 ; Fill all general regs with a fixed pattern
405 ;; mov.w #xx:8, @aa:16
406 mov.w #0xa5:8, @word_dst:16 ; 16-bit address-direct operand
411 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
417 test_gr_a5a5 0 ; Make sure _ALL_ general regs not disturbed
418 test_gr_a5a5 1 ; (first, because on h8/300 we must use one
419 test_gr_a5a5 2 ; to examine the destination memory).
426 ;; Now check the result of the move to memory.
427 cmp.w #0xa5, @word_dst
431 mov.w #0, @word_dst ; zero it again for the next use.
434 set_grs_a5a5 ; Fill all general regs with a fixed pattern
437 ;; mov.w #xx:8, @aa:32
438 mov.w #0xa5:8, @word_dst:32 ; 32-bit address-direct operand
443 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
449 test_gr_a5a5 0 ; Make sure _ALL_ general regs not disturbed
450 test_gr_a5a5 1 ; (first, because on h8/300 we must use one
451 test_gr_a5a5 2 ; to examine the destination memory).
458 ;; Now check the result of the move to memory.
459 cmp.w #0xa5, @word_dst
463 mov.w #0, @word_dst ; zero it again for the next use.
465 mov_w_imm16_to_indirect:
466 set_grs_a5a5 ; Fill all general regs with a fixed pattern
469 ;; mov.w #xx:16, @erd
471 mov.w #0xdead:16, @er1 ; Register indirect operand
476 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
482 test_gr_a5a5 0 ; Make sure other general regs not disturbed
483 test_h_gr32 word_dst, er1
491 ;; Now check the result of the move to memory.
492 cmp.w #0xdead, @word_dst
496 mov.w #0, @word_dst ; zero it again for the next use.
498 mov_w_imm16_to_postinc: ; post-increment from imm16 to mem
499 set_grs_a5a5 ; Fill all general regs with a fixed pattern
502 ;; mov.w #xx:16, @erd+
504 mov.w #0xdead:16, @er1+ ; Imm16, register post-incr operands.
509 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
515 test_gr_a5a5 0 ; Make sure other general regs not disturbed
516 test_h_gr32 word_dst+2, er1
524 ;; Now check the result of the move to memory.
525 cmp.w #0xdead, @word_dst
529 mov.w #0, @word_dst ; zero it again for the next use.
531 mov_w_imm16_to_postdec: ; post-decrement from imm16 to mem
532 set_grs_a5a5 ; Fill all general regs with a fixed pattern
535 ;; mov.w #xx:16, @erd-
537 mov.w #0xdead:16, @er1- ; Imm16, register post-decr operands.
542 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
548 test_gr_a5a5 0 ; Make sure other general regs not disturbed
549 test_h_gr32 word_dst-2, er1
557 ;; Now check the result of the move to memory.
558 cmp.w #0xdead, @word_dst
562 mov.w #0, @word_dst ; zero it again for the next use.
564 mov_w_imm16_to_preinc: ; pre-increment from register to mem
565 set_grs_a5a5 ; Fill all general regs with a fixed pattern
568 ;; mov.w #xx:16, @+erd
569 mov.l #word_dst-2, er1
570 mov.w #0xdead:16, @+er1 ; Imm16, register pre-incr operands
575 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
581 test_gr_a5a5 0 ; Make sure other general regs not disturbed
582 test_h_gr32 word_dst, er1
590 ;; Now check the result of the move to memory.
591 cmp.w #0xdead, @word_dst
595 mov.w #0, @word_dst ; zero it again for the next use.
597 mov_w_imm16_to_predec: ; pre-decrement from register to mem
598 set_grs_a5a5 ; Fill all general regs with a fixed pattern
601 ;; mov.w #xx:16, @-erd
602 mov.l #word_dst+2, er1
603 mov.w #0xdead:16, @-er1 ; Imm16, register pre-decr operands
608 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
614 test_gr_a5a5 0 ; Make sure other general regs not disturbed
615 test_h_gr32 word_dst, er1
623 ;; Now check the result of the move to memory.
624 cmp.w #0xdead, @word_dst
628 mov.w #0, @word_dst ; zero it again for the next use.
630 mov_w_imm16_to_disp2:
631 set_grs_a5a5 ; Fill all general regs with a fixed pattern
634 ;; mov.w #xx:16, @(dd:2, erd)
635 mov.l #word_dst-6, er1
636 mov.w #0xdead:16, @(6:2, er1) ; Imm16, reg plus 2-bit disp. operand
641 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
647 test_gr_a5a5 0 ; Make sure other general regs not disturbed
648 test_h_gr32 word_dst-6, er1
656 ;; Now check the result of the move to memory.
657 cmp.w #0xdead, @word_dst
661 mov.w #0, @word_dst ; zero it again for the next use.
663 mov_w_imm16_to_disp16:
664 set_grs_a5a5 ; Fill all general regs with a fixed pattern
667 ;; mov.w #xx:16, @(dd:16, erd)
668 mov.l #word_dst-4, er1
669 mov.w #0xdead:16, @(4:16, er1) ; Register plus 16-bit disp. operand
675 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
681 test_gr_a5a5 0 ; Make sure other general regs not disturbed
682 test_h_gr32 word_dst-4, er1
690 ;; Now check the result of the move to memory.
691 cmp.w #0xdead, @word_dst
695 mov.w #0, @word_dst ; zero it again for the next use.
697 mov_w_imm16_to_disp32:
698 set_grs_a5a5 ; Fill all general regs with a fixed pattern
701 ;; mov.w #xx:16, @(dd:32, erd)
702 mov.l #word_dst-8, er1
703 mov.w #0xdead:16, @(8:32, er1) ; Register plus 32-bit disp. operand
709 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
715 test_gr_a5a5 0 ; Make sure other general regs not disturbed
716 test_h_gr32 word_dst-8, er1
724 ;; Now check the result of the move to memory.
725 cmp.w #0xdead, @word_dst
729 mov.w #0, @word_dst ; zero it again for the next use.
731 mov_w_imm16_to_abs16:
732 set_grs_a5a5 ; Fill all general regs with a fixed pattern
735 ;; mov.w #xx:16, @aa:16
736 mov.w #0xdead:16, @word_dst:16 ; 16-bit address-direct operand
742 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
748 test_gr_a5a5 0 ; Make sure _ALL_ general regs not disturbed
749 test_gr_a5a5 1 ; (first, because on h8/300 we must use one
750 test_gr_a5a5 2 ; to examine the destination memory).
757 ;; Now check the result of the move to memory.
758 cmp.w #0xdead, @word_dst
762 mov.w #0, @word_dst ; zero it again for the next use.
764 mov_w_imm16_to_abs32:
765 set_grs_a5a5 ; Fill all general regs with a fixed pattern
768 ;; mov.w #xx:16, @aa:32
769 mov.w #0xdead:16, @word_dst:32 ; 32-bit address-direct operand
775 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
781 test_gr_a5a5 0 ; Make sure _ALL_ general regs not disturbed
782 test_gr_a5a5 1 ; (first, because on h8/300 we must use one
783 test_gr_a5a5 2 ; to examine the destination memory).
790 ;; Now check the result of the move to memory.
791 cmp.w #0xdead, @word_dst
795 mov.w #0, @word_dst ; zero it again for the next use.
799 ;; Move word from register source
802 mov_w_reg16_to_reg16:
803 set_grs_a5a5 ; Fill all general regs with a fixed pattern
808 mov.w r1, r0 ; Register 16-bit operand
811 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
816 test_h_gr16 0x1234 r0
817 test_h_gr16 0x1234 r1 ; mov src unchanged
819 test_h_gr32 0xa5a51234 er0
820 test_h_gr32 0xa5a51234 er1 ; mov src unchanged
822 test_gr_a5a5 2 ; Make sure other general regs not disturbed
830 mov_w_reg16_to_indirect:
831 set_grs_a5a5 ; Fill all general regs with a fixed pattern
836 mov.w r0, @er1 ; Register indirect operand
839 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
845 test_gr_a5a5 0 ; Make sure other general regs not disturbed
846 test_h_gr32 word_dst, er1
854 ;; Now check the result of the move to memory.
862 mov.w r0, @word_dst ; zero it again for the next use.
864 .if (sim_cpu == h8sx)
865 mov_w_reg16_to_postinc: ; post-increment from register to mem
866 set_grs_a5a5 ; Fill all general regs with a fixed pattern
871 mov.w r0, @er1+ ; Register post-incr operand
875 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
881 test_gr_a5a5 0 ; Make sure other general regs not disturbed
882 test_h_gr32 word_dst+2, er1
890 ;; Now check the result of the move to memory.
895 ;; special case same register
905 mov.w #0, @word_dst ; zero it again for the next use.
907 mov_w_reg16_to_postdec: ; post-decrement from register to mem
908 set_grs_a5a5 ; Fill all general regs with a fixed pattern
913 mov.w r0, @er1- ; Register post-decr operand
917 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
923 test_gr_a5a5 0 ; Make sure other general regs not disturbed
924 test_h_gr32 word_dst-2, er1
932 ;; Now check the result of the move to memory.
937 ;; special case same register
947 mov.w #0, @word_dst ; zero it again for the next use.
949 mov_w_reg16_to_preinc: ; pre-increment from register to mem
950 set_grs_a5a5 ; Fill all general regs with a fixed pattern
954 mov.l #word_dst-2, er1
955 mov.w r0, @+er1 ; Register pre-incr operand
959 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
965 test_gr_a5a5 0 ; Make sure other general regs not disturbed
966 test_h_gr32 word_dst, er1
974 ;; Now check the result of the move to memory.
979 ;; special case same register
980 mov.l #word_dst-2, er0
989 mov.w #0, @word_dst ; zero it again for the next use.
992 mov_w_reg16_to_predec: ; pre-decrement from register to mem
993 set_grs_a5a5 ; Fill all general regs with a fixed pattern
997 mov.l #word_dst+2, er1
998 mov.w r0, @-er1 ; Register pre-decr operand
1001 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
1007 test_gr_a5a5 0 ; Make sure other general regs not disturbed
1008 test_h_gr32 word_dst, er1
1016 ;; Now check the result of the move to memory.
1023 ;; Special case in same register
1024 ;; CCR confirmation omitted
1025 mov.l #word_dst+2, er1
1035 mov.w r0, @word_dst ; zero it again for the next use.
1037 .if (sim_cpu == h8sx)
1038 mov_w_reg16_to_disp2:
1039 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1042 ;; mov.w ers, @(dd:2, erd)
1043 mov.l #word_dst-6, er1
1044 mov.w r0, @(6:2, er1) ; Register plus 2-bit disp. operand
1048 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
1054 test_gr_a5a5 0 ; Make sure other general regs not disturbed
1055 test_h_gr32 word_dst-6, er1
1063 ;; Now check the result of the move to memory.
1068 mov.w #0, @word_dst ; zero it again for the next use.
1071 mov_w_reg16_to_disp16:
1072 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1075 ;; mov.w ers, @(dd:16, erd)
1076 mov.l #word_dst-4, er1
1077 mov.w r0, @(4:16, er1) ; Register plus 16-bit disp. operand
1081 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
1087 test_h_gr32 word_dst-4, er1
1088 test_gr_a5a5 0 ; Make sure other general regs not disturbed
1096 ;; Now check the result of the move to memory.
1104 mov.w r0, @word_dst ; zero it again for the next use.
1106 mov_w_reg16_to_disp32:
1107 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1110 ;; mov.w ers, @(dd:32, erd)
1111 mov.l #word_dst-8, er1
1112 mov.w r0, @(8:32, er1) ; Register plus 32-bit disp. operand
1117 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
1123 test_h_gr32 word_dst-8, er1
1124 test_gr_a5a5 0 ; Make sure other general regs not disturbed
1132 ;; Now check the result of the move to memory.
1140 mov.w r0, @word_dst ; zero it again for the next use.
1142 mov_w_reg16_to_abs16:
1143 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1146 ;; mov.w ers, @aa:16
1147 mov.w r0, @word_dst:16 ; 16-bit address-direct operand
1151 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
1157 test_gr_a5a5 0 ; Make sure _ALL_ general regs not disturbed
1158 test_gr_a5a5 1 ; (first, because on h8/300 we must use one
1159 test_gr_a5a5 2 ; to examine the destination memory).
1166 ;; Now check the result of the move to memory.
1174 mov.w r0, @word_dst ; zero it again for the next use.
1176 mov_w_reg16_to_abs32:
1177 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1180 ;; mov.w ers, @aa:32
1181 mov.w r0, @word_dst:32 ; 32-bit address-direct operand
1185 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
1191 test_gr_a5a5 0 ; Make sure _ALL_ general regs not disturbed
1192 test_gr_a5a5 1 ; (first, because on h8/300 we must use one
1193 test_gr_a5a5 2 ; to examine the destination memory).
1200 ;; Now check the result of the move to memory.
1208 mov.w r0, @word_dst ; zero it again for the next use.
1211 ;; Move word to register destination.
1214 mov_w_indirect_to_reg16:
1215 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1219 mov.l #word_src, er1
1220 mov.w @er1, r0 ; Register indirect operand
1223 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1229 test_h_gr32 0xa5a57777 er0
1231 test_h_gr32 word_src, er1
1232 test_gr_a5a5 2 ; Make sure other general regs not disturbed
1239 mov_w_postinc_to_reg16: ; post-increment from mem to register
1240 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1245 mov.l #word_src, er1
1246 mov.w @er1+, r0 ; Register post-incr operand
1249 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1255 test_h_gr32 0xa5a57777 er0
1257 test_h_gr32 word_src+2, er1
1258 test_gr_a5a5 2 ; Make sure other general regs not disturbed
1265 .if (sim_cpu == h8sx)
1266 mov_w_postdec_to_reg16: ; post-decrement from mem to register
1267 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1272 mov.l #word_src, er1
1273 mov.w @er1-, r0 ; Register post-decr operand
1277 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1283 test_h_gr32 0xa5a57777 er0
1285 test_h_gr32 word_src-2, er1
1286 test_gr_a5a5 2 ; Make sure other general regs not disturbed
1293 mov_w_preinc_to_reg16: ; pre-increment from mem to register
1294 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1299 mov.l #word_src-2, er1
1300 mov.w @+er1, r0 ; Register pre-incr operand
1304 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1310 test_h_gr32 0xa5a57777 er0
1312 test_h_gr32 word_src, er1
1313 test_gr_a5a5 2 ; Make sure other general regs not disturbed
1320 mov_w_predec_to_reg16: ; pre-decrement from mem to register
1321 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1326 mov.l #word_src+2, er1
1327 mov.w @-er1, r0 ; Register pre-decr operand
1331 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1337 test_h_gr32 0xa5a57777 er0
1339 test_h_gr32 word_src, er1
1340 test_gr_a5a5 2 ; Make sure other general regs not disturbed
1348 mov_w_disp2_to_reg16:
1349 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1352 ;; mov.w @(dd:2, ers), rd
1353 mov.l #word_src-2, er1
1354 mov.w @(2:2, er1), r0 ; Register plus 2-bit disp. operand
1358 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1364 test_h_gr32 0xa5a57777 er0 ; mov result: a5a5 | 7777
1366 test_h_gr32 word_src-2, er1
1367 test_gr_a5a5 2 ; Make sure other general regs not disturbed
1375 mov_w_disp16_to_reg16:
1376 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1379 ;; mov.w @(dd:16, ers), rd
1380 mov.l #word_src+0x1234, er1
1381 mov.w @(-0x1234:16, er1), r0 ; Register plus 16-bit disp. operand
1385 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1391 test_h_gr32 0xa5a57777 er0 ; mov result: a5a5 | 7777
1393 test_h_gr32 word_src+0x1234, er1
1394 test_gr_a5a5 2 ; Make sure other general regs not disturbed
1401 mov_w_disp32_to_reg16:
1402 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1405 ;; mov.w @(dd:32, ers), rd
1406 mov.l #word_src+65536, er1
1407 mov.w @(-65536:32, er1), r0 ; Register plus 32-bit disp. operand
1412 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1418 test_h_gr32 0xa5a57777 er0 ; mov result: a5a5 | 7777
1420 test_h_gr32 word_src+65536, er1
1421 test_gr_a5a5 2 ; Make sure other general regs not disturbed
1428 mov_w_abs16_to_reg16:
1429 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1433 mov.w @word_src:16, r0 ; 16-bit address-direct operand
1437 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1443 test_h_gr32 0xa5a57777 er0
1445 test_gr_a5a5 1 ; Make sure other general regs not disturbed
1453 mov_w_abs32_to_reg16:
1454 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1458 mov.w @word_src:32, r0 ; 32-bit address-direct operand
1462 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1468 test_h_gr32 0xa5a57777 er0
1470 test_gr_a5a5 1 ; Make sure other general regs not disturbed
1478 .if (sim_cpu == h8sx)
1481 ;; Move word from memory to memory
1484 mov_w_indirect_to_indirect: ; reg indirect, memory to memory
1485 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1490 mov.l #word_src, er1
1491 mov.l #word_dst, er0
1496 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1502 ;; Verify the affected registers.
1504 test_h_gr32 word_dst er0
1505 test_h_gr32 word_src er1
1506 test_gr_a5a5 2 ; Make sure other general regs not disturbed
1513 ;; Now check the result of the move to memory.
1514 cmp.w @word_src, @word_dst
1518 ;; Now clear the destination location, and verify that.
1520 cmp.w @word_src, @word_dst
1523 .Lnext57: ; OK, pass on.
1525 mov_w_postinc_to_postinc: ; reg post-increment, memory to memory
1526 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1529 ;; mov.w @ers+, @erd+
1531 mov.l #word_src, er1
1532 mov.l #word_dst, er0
1537 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1543 ;; Verify the affected registers.
1545 test_h_gr32 word_dst+2 er0
1546 test_h_gr32 word_src+2 er1
1547 test_gr_a5a5 2 ; Make sure other general regs not disturbed
1554 ;; Now check the result of the move to memory.
1555 cmp.w @word_src, @word_dst
1559 ;; Now clear the destination location, and verify that.
1561 cmp.w @word_src, @word_dst
1564 .Lnext66: ; OK, pass on.
1565 ;; special case same register
1566 mov.l #word_src, er0
1567 mov.w @er0+, @er0+ ; copying word_src to word_dst
1568 test_h_gr32 word_src+4 er0
1569 cmp.w @word_src, @word_dst
1573 ;; Now clear the destination location, and verify that.
1575 cmp.b @word_src, @word_dst
1580 mov_w_postdec_to_postdec: ; reg post-decrement, memory to memory
1581 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1584 ;; mov.w @ers-, @erd-
1586 mov.l #word_src, er1
1587 mov.l #word_dst, er0
1592 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1598 ;; Verify the affected registers.
1600 test_h_gr32 word_dst-2 er0
1601 test_h_gr32 word_src-2 er1
1602 test_gr_a5a5 2 ; Make sure other general regs not disturbed
1609 ;; Now check the result of the move to memory.
1610 cmp.w @word_src, @word_dst
1614 ;; Now clear the destination location, and verify that.
1616 cmp.w @word_src, @word_dst
1619 .Lnext76: ; OK, pass on.
1620 ;; special case same register
1621 mov.l #word_src, er0
1622 mov.w @er0-, @er0- ; copying word_src to word_dst_dec
1623 test_h_gr32 word_src-4 er0
1624 cmp.w @word_src, @word_dst_dec
1628 ;; Now clear the destination location, and verify that.
1629 mov.w #0, @word_dst_dec
1630 cmp.w @word_src, @word_dst_dec
1635 mov_w_preinc_to_preinc: ; reg pre-increment, memory to memory
1636 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1639 ;; mov.w @+ers, @+erd
1641 mov.l #word_src-2, er1
1642 mov.l #word_dst-2, er0
1647 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1653 ;; Verify the affected registers.
1655 test_h_gr32 word_dst er0
1656 test_h_gr32 word_src er1
1657 test_gr_a5a5 2 ; Make sure other general regs not disturbed
1664 ;; Now check the result of the move to memory.
1665 cmp.w @word_src, @word_dst
1669 ;; Now clear the destination location, and verify that.
1671 cmp.w @word_src, @word_dst
1674 .Lnext86: ; OK, pass on.
1675 ;; special case same register
1676 mov.l #word_src-2, er0
1677 mov.w @+er0, @+er0 ; copying word_src to word_dst
1678 test_h_gr32 word_src+2 er0
1679 cmp.w @word_src, @word_dst
1683 ;; Now clear the destination location, and verify that.
1685 cmp.w @word_src, @word_dst
1690 mov_w_predec_to_predec: ; reg pre-decrement, memory to memory
1691 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1694 ;; mov.w @-ers, @-erd
1696 mov.l #word_src+2, er1
1697 mov.l #word_dst+2, er0
1702 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1708 ;; Verify the affected registers.
1710 test_h_gr32 word_dst er0
1711 test_h_gr32 word_src er1
1712 test_gr_a5a5 2 ; Make sure other general regs not disturbed
1719 ;; Now check the result of the move to memory.
1720 cmp.w @word_src, @word_dst
1724 ;; Now clear the destination location, and verify that.
1726 cmp.w @word_src, @word_dst
1729 .Lnext96: ; OK, pass on.
1730 ;; special case same register
1731 mov.l #word_src+2, er0
1732 mov.w @-er0, @-er0 ; copying word_src to word_dst_dec
1733 test_h_gr32 word_src-2 er0
1734 cmp.w @word_src, @word_dst_dec
1738 ;; Now clear the destination location, and verify that.
1739 mov.w #0, @word_dst_dec
1740 cmp.w @word_src, @word_dst_dec
1745 mov_w_disp2_to_disp2: ; reg 2-bit disp, memory to memory
1746 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1749 ;; mov.w @(dd:2, ers), @(dd:2, erd)
1751 mov.l #word_src-2, er1
1752 mov.l #word_dst-4, er0
1753 mov.w @(2:2, er1), @(4:2, er0)
1757 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1763 ;; Verify the affected registers.
1765 test_h_gr32 word_dst-4 er0
1766 test_h_gr32 word_src-2 er1
1767 test_gr_a5a5 2 ; Make sure other general regs not disturbed
1774 ;; Now check the result of the move to memory.
1775 cmp.w @word_src, @word_dst
1779 ;; Now clear the destination location, and verify that.
1781 cmp.w @word_src, @word_dst
1784 .Lnext106: ; OK, pass on.
1786 mov_w_disp16_to_disp16: ; reg 16-bit disp, memory to memory
1787 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1790 ;; mov.w @(dd:16, ers), @(dd:16, erd)
1792 mov.l #word_src-1, er1
1793 mov.l #word_dst-2, er0
1794 mov.w @(1:16, er1), @(2:16, er0)
1800 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1806 ;; Verify the affected registers.
1808 test_h_gr32 word_dst-2 er0
1809 test_h_gr32 word_src-1 er1
1810 test_gr_a5a5 2 ; Make sure other general regs not disturbed
1817 ;; Now check the result of the move to memory.
1818 cmp.w @word_src, @word_dst
1822 ;; Now clear the destination location, and verify that.
1824 cmp.w @word_src, @word_dst
1827 .Lnext116: ; OK, pass on.
1829 mov_w_disp32_to_disp32: ; reg 32-bit disp, memory to memory
1830 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1833 ;; mov.w @(dd:32, ers), @(dd:32, erd)
1835 mov.l #word_src-1, er1
1836 mov.l #word_dst-2, er0
1837 mov.w @(1:32, er1), @(2:32, er0)
1843 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1849 ;; Verify the affected registers.
1851 test_h_gr32 word_dst-2 er0
1852 test_h_gr32 word_src-1 er1
1853 test_gr_a5a5 2 ; Make sure other general regs not disturbed
1860 ;; Now check the result of the move to memory.
1861 cmp.w @word_src, @word_dst
1865 ;; Now clear the destination location, and verify that.
1867 cmp.w @word_src, @word_dst
1870 .Lnext126: ; OK, pass on.
1872 mov_w_abs16_to_abs16: ; 16-bit absolute addr, memory to memory
1873 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1876 ;; mov.w @aa:16, @aa:16
1878 mov.w @word_src:16, @word_dst:16
1884 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1891 test_gr_a5a5 0 ; Make sure *NO* general registers are changed
1900 ;; Now check the result of the move to memory.
1901 cmp.w @word_src, @word_dst
1905 ;; Now clear the destination location, and verify that.
1907 cmp.w @word_src, @word_dst
1910 .Lnext136: ; OK, pass on.
1912 mov_w_abs32_to_abs32: ; 32-bit absolute addr, memory to memory
1913 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1916 ;; mov.w @aa:32, @aa:32
1918 mov.w @word_src:32, @word_dst:32
1924 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1930 test_gr_a5a5 0 ; Make sure *NO* general registers are changed
1939 ;; Now check the result of the move to memory.
1940 cmp.w @word_src, @word_dst
1944 ;; Now clear the destination location, and verify that.
1946 cmp.w @word_src, @word_dst
1949 .Lnext146: ; OK, pass on.