mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-05 16:26:14 +02:00
Replace DBRA instruction for Coldfire with a SUB/BRA combination in the for-loop-code-
generation and the assembly helpers in the RTL as DBRA is not supported by Coldfire. git-svn-id: trunk@22740 -
This commit is contained in:
parent
d5523e6af6
commit
43d8da7aa3
@ -1440,7 +1440,14 @@ unit cgcpu;
|
|||||||
a_label(list,hl);
|
a_label(list,hl);
|
||||||
list.concat(taicpu.op_ref_ref(A_MOVE,S_B,hp1,hp2));
|
list.concat(taicpu.op_ref_ref(A_MOVE,S_B,hp1,hp2));
|
||||||
a_label(list,hl2);
|
a_label(list,hl2);
|
||||||
list.concat(taicpu.op_reg_sym(A_DBRA,S_L,hregister,hl));
|
if current_settings.cputype=cpu_coldfire then
|
||||||
|
begin
|
||||||
|
{ Coldfire does not support DBRA }
|
||||||
|
list.concat(taicpu.op_const_reg(A_SUB,S_L,1,hregister));
|
||||||
|
list.concat(taicpu.op_sym(A_BMI,S_L,hl));
|
||||||
|
end
|
||||||
|
else
|
||||||
|
list.concat(taicpu.op_reg_sym(A_DBRA,S_L,hregister,hl));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ restore the registers that we have just used olny if they are used! }
|
{ restore the registers that we have just used olny if they are used! }
|
||||||
|
@ -95,7 +95,12 @@ procedure FillChar(var x;count:longint;value:byte); assembler;
|
|||||||
@LMEMSET4: { fast loop mode section 68010+ }
|
@LMEMSET4: { fast loop mode section 68010+ }
|
||||||
move.b d0,(a0)+
|
move.b d0,(a0)+
|
||||||
@LMEMSET3:
|
@LMEMSET3:
|
||||||
|
{$ifdef CPUCOLDFIRE}
|
||||||
|
sub.l #1,d1
|
||||||
|
bmi @LMEMSET4
|
||||||
|
{$else}
|
||||||
dbra d1,@LMEMSET4
|
dbra d1,@LMEMSET4
|
||||||
|
{$endif}
|
||||||
|
|
||||||
@LMEMSET5:
|
@LMEMSET5:
|
||||||
end ['d0','d1','a0'];
|
end ['d0','d1','a0'];
|
||||||
@ -137,7 +142,12 @@ asm
|
|||||||
@LMSTRCOPY56: { 68010 Fast loop mode }
|
@LMSTRCOPY56: { 68010 Fast loop mode }
|
||||||
move.b (a0)+,(a1)+
|
move.b (a0)+,(a1)+
|
||||||
@LMSTRCOPY55:
|
@LMSTRCOPY55:
|
||||||
|
{$ifdef CPUCOLDFIRE}
|
||||||
|
sub.l #1,d1
|
||||||
|
bmi @LMSTRCOPY56
|
||||||
|
{$else}
|
||||||
dbra d1,@LMSTRCOPY56
|
dbra d1,@LMSTRCOPY56
|
||||||
|
{$endif}
|
||||||
@Lend:
|
@Lend:
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -172,7 +182,12 @@ procedure strconcat(s1,s2 : pointer);[public,alias: 'STRCONCAT'];
|
|||||||
@Loop:
|
@Loop:
|
||||||
move.b (a1)+,(a0)+ { s1[i] := s2[i]; }
|
move.b (a1)+,(a0)+ { s1[i] := s2[i]; }
|
||||||
@ALoop:
|
@ALoop:
|
||||||
|
{$ifdef CPUCOLDFIRE}
|
||||||
|
sub.l #1,d6
|
||||||
|
bmi @Loop
|
||||||
|
{$else}
|
||||||
dbra d6,@Loop
|
dbra d6,@Loop
|
||||||
|
{$endif}
|
||||||
move.l s1,a0
|
move.l s1,a0
|
||||||
add.b d0,(a0) { change to new string length }
|
add.b d0,(a0) { change to new string length }
|
||||||
@Lend:
|
@Lend:
|
||||||
@ -270,12 +285,22 @@ begin
|
|||||||
@LMOVE01:
|
@LMOVE01:
|
||||||
move.b -(a0),-(a1) { (s < d) copy loop }
|
move.b -(a0),-(a1) { (s < d) copy loop }
|
||||||
@LMOVE02:
|
@LMOVE02:
|
||||||
|
{$ifdef CPUCOLDFIRE}
|
||||||
|
sub.l #1,d0
|
||||||
|
bmi @LMOVE01
|
||||||
|
{$else}
|
||||||
dbra d0,@LMOVE01
|
dbra d0,@LMOVE01
|
||||||
|
{$endif}
|
||||||
bra @LMOVE5
|
bra @LMOVE5
|
||||||
@LMOVE03:
|
@LMOVE03:
|
||||||
move.b (a0)+,(a1)+ { (s >= d) copy loop }
|
move.b (a0)+,(a1)+ { (s >= d) copy loop }
|
||||||
@LMOVE04:
|
@LMOVE04:
|
||||||
|
{$ifdef CPUCOLDFIRE}
|
||||||
|
sub.l #1,d0
|
||||||
|
bmi @LMOVE03
|
||||||
|
{$else}
|
||||||
dbra d0,@LMOVE03
|
dbra d0,@LMOVE03
|
||||||
|
{$endif}
|
||||||
{ end fast loop mode }
|
{ end fast loop mode }
|
||||||
@LMOVE5:
|
@LMOVE5:
|
||||||
end ['d0','a0','a1'];
|
end ['d0','a0','a1'];
|
||||||
|
Loading…
Reference in New Issue
Block a user