* fillchar fixed; it's used now

This commit is contained in:
florian 2005-01-05 15:21:14 +00:00
parent 86c111a794
commit 6333a6a6b3

View File

@ -62,68 +62,67 @@ end ['R0'];
{$define FPC_SYSTEM_HAS_SPTR} {$define FPC_SYSTEM_HAS_SPTR}
Function Sptr : pointer;assembler;{$ifdef SYSTEMINLINE}inline;{$endif} Function Sptr : pointer;assembler;{$ifdef SYSTEMINLINE}inline;{$endif}
asm asm
mov r0,sp mov r0,sp
end ['R0']; end ['R0'];
{
{$define FPC_SYSTEM_HAS_FILLCHAR} {$define FPC_SYSTEM_HAS_FILLCHAR}
Procedure FillChar(var x;count:longint;value:byte);assembler; Procedure FillChar(var x;count:longint;value:byte);assembler;nostackframe;
* void *memset (dstpp, c, len) */
asm asm
mov a4, a1 // less than 0?
cmp a2, $8 // at least 8 bytes to do? cmp r1,#0
blt .Fillchar2 movlt pc,lr
orr a3, a3, a3, lsl $8 mov r3,r0
orr a3, a3, a3, lsl $16 cmp r1,#8 // at least 8 bytes to do?
.Fillchar0: blt .LFillchar2
tst a4, $3 // aligned yet? orr r2,r2,r2,lsl #8
strneb a3, [a4], $1 orr r2,r2,r2,lsl #16
subne a2, a2, $1 .LFillchar0:
bne .Fillchar0 tst r3,#3 // aligned yet?
mov ip, a3 strneb r2,[r3],#1
.Fillchar1: subne r1,r1,#1
cmp a2, $8 // 8 bytes still to do? bne .LFillchar0
blt .Fillchar2 mov ip,r2
stmia a4!, {a3, ip} .LFillchar1:
sub a2, a2, $8 cmp r1,#8 // 8 bytes still to do?
cmp a2, $8 // 8 bytes still to do? blt .LFillchar2
blt .Fillchar2 stmia r3!,{r2,ip}
stmia a4!, {a3, ip} sub r1,r1,#8
sub a2, a2, $8 cmp r1,#8 // 8 bytes still to do?
cmp a2, $8 // 8 bytes still to do? blt .LFillchar2
blt .Fillchar2 stmia r3!,{r2,ip}
stmia a4!, {a3, ip} sub r1,r1,#8
sub a2, a2, $8 cmp r1,#8 // 8 bytes still to do?
cmp a2, $8 // 8 bytes still to do? blt .LFillchar2
stmgeia a4!, {a3, ip} stmia r3!,{r2,ip}
subge a2, a2, $8 sub r1,r1,#8
bge .Fillchar1 cmp r1,#8 // 8 bytes still to do?
.Fillchar2: stmgeia r3!,{r2,ip}
movs a2, a2 // anything left? subge r1,r1,#8
RETINSTR(moveq,pc,lr) // nope bge .LFillchar1
rsb a2, a2, $7 .LFillchar2:
add pc, pc, a2, lsl $2 movs r1,r1 // anything left?
mov r0, r0 moveq pc,lr
strb a3, [a4], $1 rsb r1,r1,#7
strb a3, [a4], $1 add pc,pc,r1,lsl #2
strb a3, [a4], $1 mov r0,r0
strb a3, [a4], $1 strb r2,[r3],#1
strb a3, [a4], $1 strb r2,[r3],#1
strb a3, [a4], $1 strb r2,[r3],#1
strb a3, [a4], $1 strb r2,[r3],#1
RETINSTR(mov,pc,lr) strb r2,[r3],#1
strb r2,[r3],#1
strb r2,[r3],#1
mov pc,lr
end; end;
}
{ {
$Log$ $Log$
Revision 1.8 2005-01-04 16:46:38 florian Revision 1.9 2005-01-05 15:21:14 florian
* fillchar fixed; it's used now
Revision 1.8 2005/01/04 16:46:38 florian
+ correct setting of FPU exception mask + correct setting of FPU exception mask
Revision 1.7 2004/03/23 21:03:10 florian Revision 1.7 2004/03/23 21:03:10 florian