summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorflorian <florian@3ad0048d-3df7-0310-abae-a5850022a9f2>2013-09-05 21:40:30 +0000
committerflorian <florian@3ad0048d-3df7-0310-abae-a5850022a9f2>2013-09-05 21:40:30 +0000
commit014f401f990b24f46108df8107cbb8595900e3cb (patch)
treeea6a2544247176993dbebcdcdf7ec2c09578990c
parenta6ab481b83b0d990862409ad5c5a122a6d45277c (diff)
downloadfpc-014f401f990b24f46108df8107cbb8595900e3cb.tar.gz
* fix tthumbcgarm.g_flags2reg, mov reg,#imm for thumb updates the flags
git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@25426 3ad0048d-3df7-0310-abae-a5850022a9f2
-rw-r--r--compiler/arm/cgcpu.pas13
1 files changed, 8 insertions, 5 deletions
diff --git a/compiler/arm/cgcpu.pas b/compiler/arm/cgcpu.pas
index c08492988d..0bba156f4e 100644
--- a/compiler/arm/cgcpu.pas
+++ b/compiler/arm/cgcpu.pas
@@ -4123,17 +4123,20 @@ unit cgcpu;
procedure tthumbcgarm.g_flags2reg(list: TAsmList; size: TCgSize; const f: TResFlags; reg: TRegister);
var
- l : tasmlabel;
+ l1,l2 : tasmlabel;
ai : taicpu;
begin
- current_asmdata.getjumplabel(l);
- list.concat(taicpu.op_reg_const(A_MOV,reg,1));
- ai:=setcondition(taicpu.op_sym(A_B,l),flags_to_cond(f));
+ current_asmdata.getjumplabel(l1);
+ current_asmdata.getjumplabel(l2);
+ ai:=setcondition(taicpu.op_sym(A_B,l1),flags_to_cond(f));
ai.is_jmp:=true;
list.concat(ai);
list.concat(taicpu.op_reg_const(A_MOV,reg,0));
+ list.concat(taicpu.op_sym(A_B,l2));
+ cg.a_label(list,l1);
+ list.concat(taicpu.op_reg_const(A_MOV,reg,1));
a_reg_dealloc(list,NR_DEFAULTFLAGS);
- cg.a_label(list,l);
+ cg.a_label(list,l2);
end;