|
@@ -1156,8 +1156,26 @@ unit cgcpu;
|
|
|
|
|
|
|
|
|
procedure tcgavr.g_flags2reg(list: TAsmList; size: TCgSize; const f: TResFlags; reg: TRegister);
|
|
|
+ var
|
|
|
+ l : TAsmLabel;
|
|
|
+ tmpflags : TResFlags;
|
|
|
begin
|
|
|
- { TODO : implement g_flags2reg }
|
|
|
+ current_asmdata.getjumplabel(l);
|
|
|
+ if flags_to_cond(f) then
|
|
|
+ begin
|
|
|
+ tmpflags:=f;
|
|
|
+ inverse_flags(tmpflags);
|
|
|
+ list.concat(taicpu.op_reg(A_CLR,reg));
|
|
|
+ a_jmp_flags(list,tmpflags,l);
|
|
|
+ list.concat(taicpu.op_const_reg(A_LDI,reg,1));
|
|
|
+ end
|
|
|
+ else
|
|
|
+ begin;
|
|
|
+ list.concat(taicpu.op_const_reg(A_LDI,reg,1));
|
|
|
+ a_jmp_flags(list,f,l);
|
|
|
+ list.concat(taicpu.op_reg(A_CLR,reg));
|
|
|
+ end;
|
|
|
+ cg.a_label(list,l);
|
|
|
end;
|
|
|
|
|
|
|