* fixed remaining assembler errors

This commit is contained in:
florian 2002-08-18 22:11:10 +00:00
parent 08a92a26b4
commit b6f184646c
4 changed files with 61 additions and 49 deletions

View File

@ -90,8 +90,8 @@
1: (d: double);
end;
asm
fctiwz fr1,fr1
stfd fr1,temp
fctiwz f1,f1
stfd f1,temp
lwz r3,temp
lwz r4,4+temp
end ['R3','F1'];
@ -109,8 +109,8 @@
1: (d: double);
end;
asm
fctiw fr1,fr1
stfd fr1,temp
fctiw f1,f1
stfd f1,temp
lwz r3,temp
lwz r4,4+temp
end ['R3','F1'];
@ -221,22 +221,22 @@ var
1: (d: double);
end;
asm
lis r0,$4330
lis r0,0x4330
stw r0,temp
xoris r3,r3,$8000
xoris r3,r3,0x8000
stw r3,4+temp
lis r3,longint_to_real_helper@ha
lfd fr1,longint_to_real_helper@l(r3)
lfd fr0,temp
lfd f1,longint_to_real_helper@l(r3)
lfd f0,temp
stw r4,4+temp
fsub fr0,fr0,fr1
fsub f0,f0,f1
lis r4,cardinal_to_real_helper@ha
lfd fr1,cardinal_to_real_helper@l(r4)
lfd f1,cardinal_to_real_helper@l(r4)
lis r3,int_to_real_factor@ha
lfd fr3,temp
lfd fr2,int_to_real_factor@l(r3)
fsub fr3,fr3,fr1
fmadd fr1,fr0,fr2,fr3
lfd f3,temp
lfd f2,int_to_real_factor@l(r3)
fsub f3,f3,f1
fmadd f1,f0,f2,f3
end ['R0','R3','R4','F0','F1','F2','F3'];
@ -251,26 +251,29 @@ var
1: (d: double);
end;
asm
lis r0,$4330
lis r0,0x4330
stw r0,temp
stw r3,4+temp
lfd fr0,temp
lfd f0,temp
lis r3,cardinal_to_real_helper@ha
lfd fr1,cardinal_to_real_helper@l(r3)
lfd f1,cardinal_to_real_helper@l(r3)
stw r4,4+temp
fsub fr0,fr0,fr1
lfd fr3,temp
fsub f0,f0,f1
lfd f3,temp
lis r3,int_to_real_factor@ha
lfd fr2,int_to_real_factor@l(r3)
fsub fr3,fr3,fr1
fmadd fr1,fr0,fr2,fr3
lfd f2,int_to_real_factor@l(r3)
fsub f3,f3,f1
fmadd f1,f0,f2,f3
end ['R0','R3','F0','F1','F2','F3'];
{
$Log$
Revision 1.9 2002-08-18 21:37:48 florian
Revision 1.10 2002-08-18 22:11:10 florian
* fixed remaining assembler errors
Revision 1.9 2002/08/18 21:37:48 florian
* several errors in inline assembler fixed
Revision 1.8 2002/08/10 17:14:36 jonas

View File

@ -517,20 +517,20 @@ asm
{ use r0 instead of r3 for buf1 since r3 contains result }
cmplwi r5,0
mtctr r5
subi r0,r3,1
subi r11,r3,1
subi r4,r4,1
li r3,0
beq LCompByteDone
LCompByteLoop:
{ load next chars }
lbzu r9,1(r0)
lbzu r9,1(r11)
lbzu r10,1(r4)
{ calculate difference }
sub. r3,r9,r10
{ if chars not equal or at the end, we're ready }
bdnzt cr0*4+eq, LCompByteLoop
LCompByteDone:
end ['R0','R3','R4','R9','R10','CR0','CTR'];
end ['R0','R3','R4','R9','R10','R11','CR0','CTR'];
{$define FPC_SYSTEM_HAS_COMPAREWORD}
function CompareWord(var buf1,buf2;len:longint):longint; assembler;
@ -543,20 +543,20 @@ asm
{ use r0 instead of r3 for buf1 since r3 contains result }
cmplwi r5,0
mtctr r5
subi r0,r3,2
subi r11,r3,2
subi r4,r4,2
li r3,0
beq LCompWordDone
LCompWordLoop:
{ load next chars }
lhzu r9,2(r0)
lhzu r9,2(r11)
lhzu r10,2(r4)
{ calculate difference }
sub. r3,r9,r10
{ if chars not equal or at the end, we're ready }
bdnzt cr0*4+eq, LCompWordLoop
LCompWordDone:
end ['R0','R3','R4','R9','R10','CR0','CTR'];
end ['R0','R3','R4','R9','R10','R11','CR0','CTR'];
{$define FPC_SYSTEM_HAS_COMPAREDWORD}
@ -570,20 +570,20 @@ asm
{ use r0 instead of r3 for buf1 since r3 contains result }
cmplwi r5,0
mtctr r5
subi r0,r3,4
subi r11,r3,4
subi r4,r4,4
li r3,0
beq LCompDWordDone
LCompDWordLoop:
{ load next chars }
lwzu r9,4(r0)
lwzu r9,4(r11)
lwzu r10,4(r4)
{ calculate difference }
sub. r3,r9,r10
{ if chars not equal or at the end, we're ready }
bdnzt cr0*4+eq, LCompDWordLoop
LCompDWordDone:
end ['R0','R3','R4','R9','R10','CR0','CTR'];
end ['R0','R3','R4','R9','R10','R11','CR0','CTR'];
{$define FPC_SYSTEM_HAS_INDEXCHAR0}
function IndexChar0(var buf;len:longint;b:Char):longint; assembler;
@ -706,7 +706,7 @@ asm
{ put min(length(sstr),len) in r3 }
subc r0,r4,r10 { r0 := r3 - r10 }
subme r4,r4,r4 { if r3 >= r4 then r3' := 0 else r3' := -1 }
subfme r4,r4 { if r3 >= r4 then r3' := 0 else r3' := -1 }
and r4,r0,r4 { if r3 >= r4 then r3' := 0 else r3' := r3-r10 }
add r4,r4,r10 { if r3 >= r4 then r3' := r10 else r3' := r3 }
@ -734,7 +734,7 @@ asm
{ put min(length(sstr),len) in r3 }
subc r0,r3,r10 { r0 := r3 - r10 }
subme r3,r3,r3 { if r3 >= r4 then r3' := 0 else r3' := -1 }
subfme r3,r3 { if r3 >= r4 then r3' := 0 else r3' := -1 }
and r3,r0,r3 { if r3 >= r4 then r3' := 0 else r3' := r3-r10 }
add r3,r3,r10 { if r3 >= r4 then r3' := r10 else r3' := r3 }
@ -765,7 +765,7 @@ asm
{ calculate min(length(s1),255-length(result)) }
subfic r9,r9,255
subc r8,r9,r10 { r8 := r9 - r10 }
subme r9,r9,r9 { if r9 >= r10 then r9' := 0 else r9' := -1 }
subfme r9,r9 { if r9 >= r10 then r9' := 0 else r9' := -1 }
and r9,r8,r9 { if r9 >= r10 then r9' := 0 else r9' := r9-r8 }
add r9,r9,r10 { if r9 >= r10 then r9' := r10 else r9' := r9 }
@ -789,7 +789,7 @@ asm
{ save their difference for later and }
{ calculate min(length(sstr),length(dstr)) }
subc r0,r9,r10 { r0 := r9 - r10 }
subme r9,r9,r9 { if r9 >= r10 then r9' := 0 else r9' := -1 }
subfme r9,r9 { if r9 >= r10 then r9' := 0 else r9' := -1 }
and r9,r0,r9 { if r9 >= r10 then r9' := 0 else r9' := r9-r8 }
add r9,r9,r10 { if r9 >= r10 then r9' := r10 else r9' := r9 }
@ -897,7 +897,7 @@ end ['R3'];
{$define FPC_SYSTEM_HAS_SPTR}
Function Sptr : Longint;assembler;
asm
mr r3,sp
mr r3,r1
end ['R3'];
@ -950,7 +950,10 @@ end ['R3','R10'];
{
$Log$
Revision 1.13 2002-08-18 21:37:48 florian
Revision 1.14 2002-08-18 22:11:10 florian
* fixed remaining assembler errors
Revision 1.13 2002/08/18 21:37:48 florian
* several errors in inline assembler fixed
Revision 1.12 2002/08/10 17:14:36 jonas

View File

@ -91,7 +91,7 @@ Lset_set_byte_copy:
// r0 := (r5 rotl(32-3)) and (0x0fffffff8)
rlwinm r0,r5,31-3+1,3,31-2
// load dword in which the bit has to be set (and update r3 to this address)
lwzxu r4,r3,r0
lwzux r4,r3,r0
li r0,1
// generate bit which has to be inserted
// (can't use rlwimi, since that one only works for constants)
@ -126,7 +126,7 @@ Lset_unset_byte_copy:
// r0 := (r4 rotl(32-3)) and (0x0fffffff8)
rlwinm r0,r5,31-3+1,3,31-2
// load dword in which the bit has to be set (and update r3 to this address)
lwzxu r4,r3,r0
lwzux r4,r3,r0
li r0,1
// generate bit which has to be removed
rlwnm r5,r0,r5,0,31
@ -157,7 +157,7 @@ Lset_set_range_copy:
subi r3,r3,32
cmplw cr0,r5,r6
bg cr0,Lset_range_exit
bgt cr0,Lset_range_exit
rlwinm r4,r5,31-3+1,3,31-2 // divide by 8 to get starting and ending byte-
{ load the set the data cache }
dcbst r3,r4
@ -170,7 +170,7 @@ Lset_set_range_copy:
subfic r6,r6,31 // hi := 31 - (hi mod 32) = shift count for later
srw r10,r10,r4 // shift bitmask to clear bits below lo
// note: shift right = opposite little endian!!
lwzxu r5,r3,r4 // go to starting pos in set and load value
lwzux r5,r3,r4 // go to starting pos in set and load value
// (lo is not necessary anymore)
beq Lset_range_hi // if bit lo and hi in same longint, keep
// current mask and adjust for hi bit
@ -215,7 +215,7 @@ asm
li r0,1
// generate bit which has to be tested
rwlwnm r4,r0,r4,0,31
rlwnm r4,r0,r4,0,31
// test it
and. r3,r3,r4
end ['R0','R3','R4','CR0'];
@ -523,7 +523,10 @@ end;
{
$Log$
Revision 1.13 2002-08-18 21:37:48 florian
Revision 1.14 2002-08-18 22:11:10 florian
* fixed remaining assembler errors
Revision 1.13 2002/08/18 21:37:48 florian
* several errors in inline assembler fixed
Revision 1.12 2002/08/10 17:14:36 jonas

View File

@ -23,15 +23,15 @@ asm
{ maxlength }
li r10,255
mtctr r10
lwz r0,0(r3)
lwz r11,0(r3)
{ save address for at the end }
mr r3,r0
mr r3,r11
{ no "subi r0,r0,1" because the first byte = length byte }
subi r4,r4,1
LStrPasLoop:
lbzu r10,1(r4)
cmpli cr0,r10,0
stbu r10,1(r0)
stbu r10,1(r11)
bdnzf cr0*4+eq, LStrPasLoop
{ if we stopped because of a terminating #0, decrease the length by 1 }
@ -46,11 +46,14 @@ LStrPasLoop:
{ store length }
stb r10,0(r3)
end ['R0','R3','R4','R10','CR0','CTR'];
end ['R0','R3','R4','R10','R11','CR0','CTR'];
{
$Log$
Revision 1.4 2002-08-18 21:37:48 florian
Revision 1.5 2002-08-18 22:11:10 florian
* fixed remaining assembler errors
Revision 1.4 2002/08/18 21:37:48 florian
* several errors in inline assembler fixed
Revision 1.3 2002/08/10 17:14:36 jonas