+ assembler coded move for arm

git-svn-id: trunk@6412 -
This commit is contained in:
florian 2007-02-11 11:04:55 +00:00
parent 8e4ca28a9e
commit 57415a73a7

View File

@ -133,21 +133,20 @@ asm
end; end;
(*
{$define FPC_SYSTEM_HAS_MOVE} {$define FPC_SYSTEM_HAS_MOVE}
procedure Move(const source;var dest;count:longint);[public, alias: 'FPC_MOVE'];assembler;nostackframe; procedure Move(const source;var dest;count:longint);[public, alias: 'FPC_MOVE'];assembler;nostackframe;
asm asm
// count <=0 ? // count <=0 ?
cmp r2,#0 cmp r2,#0
movle pc,lr movle pc,lr
// overlap? // overlap?
cmp r2,r1 cmp r1,r0
bls .Lnoverlap bls .Lnooverlap
add r3,r0,r2 add r3,r0,r2
cmp r3,r2 cmp r3,r1
bls .Lnooverlap bls .Lnooverlap
// overlap, copy backward // overlap, copy backward
.Loverlapped .Loverlapped:
subs r2,r2,#1 subs r2,r2,#1
ldrb r3,[r0,r2] ldrb r3,[r0,r2]
strb r3,[r1,r2] strb r3,[r1,r2]
@ -155,16 +154,17 @@ asm
mov pc,lr mov pc,lr
.Lnooverlap: .Lnooverlap:
// less then 16 bytes to copy? // less then 16 bytes to copy?
cmp r2,#16 cmp r2,#8
// yes, the forget about the whole optimizations // yes, the forget about the whole optimizations
// and do a bytewise copy // and do a bytewise copy
blt .Lbyteloop blt .Lbyteloop
// both uneven aligned? // both aligned?
eor r3,r0,r1 orr r3,r0,r1
tst r3,#1 tst r3,#3
bne .Ldifferentaligned bne .Lbyteloop
(*
// yes, then align // yes, then align
// alignment to 4 byte boundries is enough // alignment to 4 byte boundries is enough
ldrb ip,[r0],#1 ldrb ip,[r0],#1
@ -181,21 +181,23 @@ asm
orrs r3,r0,r1 orrs r3,r0,r1
tst r3,#7 tst r3,#7
bne .Ldwordloop bne .Ldwordloop
.Lqwordloop: *)
sub r2,r2,#8 .Ldwordloop:
ldmia r0!,{r3,ip} sub r2,r2,#4
stmia r1!,{r3,ip} ldr r3,[r0],#4
cmp r2,#4
str r3,[r1],#4
bcs .Ldwordloop
cmp r2,#0
moveq pc,lr
.Lbyteloop: .Lbyteloop:
subs r2,r2,#1
ldrb r3,[r0],#1 ldrb r3,[r0],#1
strb r3,[r1],#1 strb r3,[r1],#1
subs r2,r2,#1
bne .Lbyteloop bne .Lbyteloop
mov pc,lr mov pc,lr
end; end;
*)
var var
fpc_system_lock: longint; export name 'fpc_system_lock'; fpc_system_lock: longint; export name 'fpc_system_lock';