2 Copyright © 1995-2012, The AROS Development Team. All rights reserved.
5 Desc: 68060 optimized CopyMem/Quick by Matt Hey.
14 /**********************************
16 * CopyMem( source, dest, size )
19 * source & dest = any aligned
27 subq.l #4,%d0 // size is 4 less than actual!
28 bls.b smallcopy // if size<=4 bytes
30 lsr.l #1,%d1 //btst #0,%d1
31 bcc.b daligned2 //beq.b daligned2
35 daligned2: // dest should be WORD aligned now
36 lsr.l #1,%d1 //btst #1,%d1
37 bcc.b daligned4 //beq.b daligned4
40 bcs.b last2 // if size<0
41 daligned4: // dest should be LONG aligned now
42 cmp.l #2048-4,%d0 // min size for move16, less than 252 is dangerous!
47 bhi.b move4loop // if size>0
62 lsr.l #1,%d0 //btst #0,%d0
63 bcs.b move1 //bne.b move1
68 lsr.l #3,%d1 // destination aligned by 8 if bit3/bit#2=0
69 bcc.b disal8 // if bit3/bit#2=0
71 addq.l #1,%d1 // addq.l #4,%d1
74 lsr.l #1,%d1 // destination aligned by 16 if bit4/bit#3=0
75 bcc.b disal16 // if bit4/bit#3=0
82 bne.b move4loop // if source not aligned by 16
85 cmp.l #$01000000,%a1 // destination must be in 24 bit space
88 cmp.l #$01000000,%a0 // source must be in 24 bit space
94 sub.l %d1,%d0 // size is now 128 less than actual
95 addq.l #4,%d1 // %d1=128=bytes to move per loop
105 sub.l %d1,%d0 // %d0=%d0-128
106 bcc.b move16loop // if %d0>=0
108 add.l %d1,%d0 // %d0=%d0+124, size is actual-4
109 bcs.b move4loop // if %d0>=0
120 /***********************************
122 * CopyMemQuick( source, dest, size )
125 * source & dest = long word aligned
126 * size = in bytes (divisable by 4)
130 .globl copymemquick_060
131 .globl copymemquicke_060
133 subq.l #4,%d0 // size is 4.b less than actual
134 bls.b ism4or0 // if %d0<=0
136 cmp.l #2048-4,%d0 // min size for move16, less than 252 is dangerous!
141 subq.l #8,%d0 // 8 less bytes to MOVE
142 bhi.b m4loop // if %d0>0
155 bhi.b lastloop // if %d0>0
160 lsr.l #3,%d1 // destination aligned by 8 if bit3/bit#2=0
161 bcc.b destisal8 // if bit3/bit#2=0
163 addq.l #1,%d1 //addq.l #4,%d1
166 lsr.l #1,%d1 // destination aligned by 16 if bit4/bit#3=0
167 bcc.b destisal16 // if bit4/bit#3=0
174 bne.b m4loop // if source not aligned by 16
177 cmp.l #$01000000,%a1 // destination must be in 24 bit space
180 cmp.l #$01000000,%a0 // source must be in 24 bit space
186 sub.l %d1,%d0 // size is now 128 less than actual
187 addq.l #4,%d1 // %d1=128=bytes to move per loop
197 sub.l %d1,%d0 // %d0=%d0-128
198 bcc.b mov16loop // if %d0>=0
199 add.l %d1,%d0 // %d0=%d0+128, back to positive