^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /* $Id: memmove.S,v 1.2 2001/07/27 11:51:09 gniibe Exp $
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * "memmove" implementation of SuperH
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) * Copyright (C) 1999 Niibe Yutaka
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) * void *memmove(void *dst, const void *src, size_t n);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) * The memory areas may overlap.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #include <linux/linkage.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) ENTRY(memmove)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) ! if dest > src, call memcpy (it copies in decreasing order)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) cmp/hi r5,r4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) bf 1f
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) mov.l 2f,r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) jmp @r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) nop
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) .balign 4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) 2: .long memcpy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) 1:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) sub r5,r4 ! From here, r4 has the distance to r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) tst r6,r6
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) bt/s 9f ! if n=0, do nothing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) mov r5,r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) add r6,r5
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) mov #12,r1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) cmp/gt r6,r1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) bt/s 8f ! if it's too small, copy a byte at once
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) add #-1,r4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) add #1,r4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) ! [ ... ] DST [ ... ] SRC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) ! [ ... ] [ ... ]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) ! : :
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) ! r0+r4--> [ ... ] r0 --> [ ... ]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) ! : :
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) ! [ ... ] [ ... ]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) ! r5 -->
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) mov r4,r1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) mov #3,r2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) and r2,r1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) shll2 r1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) mov r0,r3 ! Save the value on R0 to R3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) mova jmptable,r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) add r1,r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) mov.l @r0,r1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) jmp @r1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) mov r3,r0 ! and back to R0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) .balign 4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) jmptable:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) .long case0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) .long case1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) .long case2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) .long case3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) ! copy a byte at once
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) 8: mov.b @r0+,r1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) cmp/hs r5,r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) bf/s 8b ! while (r0<r5)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) mov.b r1,@(r0,r4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) add #1,r4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) 9:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) add r4,r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) rts
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) sub r6,r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) case_none:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) bra 8b
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) add #-1,r4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) case0:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) ! GHIJ KLMN OPQR --> GHIJ KLMN OPQR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) ! First, align to long word boundary
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) mov r0,r3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) and r2,r3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) tst r3,r3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) bt/s 2f
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) add #-1,r4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) mov #4,r2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) sub r3,r2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) 1: dt r2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) mov.b @r0+,r1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) bf/s 1b
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) mov.b r1,@(r0,r4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) 2: ! Second, copy a long word at once
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) add #-3,r4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) add #-3,r5
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) 3: mov.l @r0+,r1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) cmp/hs r5,r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) bf/s 3b
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) mov.l r1,@(r0,r4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) add #3,r5
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) ! Third, copy a byte at once, if necessary
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) cmp/eq r5,r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) bt/s 9b
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) add #4,r4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) bra 8b
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) add #-1,r4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) case3:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) ! GHIJ KLMN OPQR --> ...G HIJK LMNO PQR.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) ! First, align to long word boundary
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) mov r0,r3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) and r2,r3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) tst r3,r3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) bt/s 2f
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) add #-1,r4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) mov #4,r2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) sub r3,r2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 1: dt r2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) mov.b @r0+,r1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) bf/s 1b
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) mov.b r1,@(r0,r4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 2: ! Second, read a long word and write a long word at once
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) add #-2,r4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) mov.l @(r0,r4),r1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) add #-7,r5
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) add #-4,r4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) #ifdef __LITTLE_ENDIAN__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) shll8 r1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 3: mov r1,r3 ! JIHG
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) shlr8 r3 ! xJIH
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) mov.l @r0+,r1 ! NMLK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) mov r1,r2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) shll16 r2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) shll8 r2 ! Kxxx
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) or r2,r3 ! KJIH
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) cmp/hs r5,r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) bf/s 3b
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) mov.l r3,@(r0,r4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) shlr8 r1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 3: mov r1,r3 ! GHIJ
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) shll8 r3 ! HIJx
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) mov.l @r0+,r1 ! KLMN
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) mov r1,r2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) shlr16 r2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) shlr8 r2 ! xxxK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) or r2,r3 ! HIJK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) cmp/hs r5,r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) bf/s 3b
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) mov.l r3,@(r0,r4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) add #7,r5
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) ! Third, copy a byte at once, if necessary
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) cmp/eq r5,r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) bt/s 9b
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) add #7,r4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) add #-3,r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) bra 8b
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) add #-1,r4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) case2:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) ! GHIJ KLMN OPQR --> ..GH IJKL MNOP QR..
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) ! First, align to word boundary
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) tst #1,r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) bt/s 2f
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) add #-1,r4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) mov.b @r0+,r1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) mov.b r1,@(r0,r4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 2: ! Second, read a word and write a word at once
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) add #-1,r4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) add #-1,r5
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 3: mov.w @r0+,r1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) cmp/hs r5,r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) bf/s 3b
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) mov.w r1,@(r0,r4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) add #1,r5
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) ! Third, copy a byte at once, if necessary
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) cmp/eq r5,r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) bt/s 9b
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) add #2,r4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) mov.b @r0,r1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) mov.b r1,@(r0,r4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) bra 9b
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) add #1,r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) case1:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) ! GHIJ KLMN OPQR --> .GHI JKLM NOPQ R...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) ! First, align to long word boundary
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) mov r0,r3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) and r2,r3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) tst r3,r3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) bt/s 2f
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) add #-1,r4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) mov #4,r2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) sub r3,r2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 1: dt r2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) mov.b @r0+,r1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) bf/s 1b
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) mov.b r1,@(r0,r4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 2: ! Second, read a long word and write a long word at once
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) mov.l @(r0,r4),r1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) add #-7,r5
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) add #-4,r4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) #ifdef __LITTLE_ENDIAN__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) shll16 r1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) shll8 r1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) 3: mov r1,r3 ! JIHG
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) shlr16 r3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) shlr8 r3 ! xxxJ
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) mov.l @r0+,r1 ! NMLK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) mov r1,r2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) shll8 r2 ! MLKx
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) or r2,r3 ! MLKJ
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) cmp/hs r5,r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) bf/s 3b
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) mov.l r3,@(r0,r4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) shlr16 r1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) shlr8 r1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) 3: mov r1,r3 ! GHIJ
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) shll16 r3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) shll8 r3 ! Jxxx
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) mov.l @r0+,r1 ! KLMN
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) mov r1,r2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) shlr8 r2 ! xKLM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) or r2,r3 ! JKLM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) cmp/hs r5,r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) bf/s 3b ! while(r0<r5)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) mov.l r3,@(r0,r4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) add #7,r5
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) ! Third, copy a byte at once, if necessary
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) cmp/eq r5,r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) bt/s 9b
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) add #5,r4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) add #-3,r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) bra 8b
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) add #-1,r4