mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-11 20:26:00 +02:00
m68k: always check the V flag after MUL/DIV overflows, because MUL/DIV never sets the C flag. note that this fix is full 68k only. on CF, MUL doesn't set any of V or C flags
git-svn-id: trunk@36496 -
This commit is contained in:
parent
d2f769c93e
commit
e0cbd48785
@ -1804,7 +1804,15 @@ unit cgcpu;
|
||||
pasbool8,pasbool16,pasbool32,pasbool64]))) then
|
||||
cond:=C_VC
|
||||
else
|
||||
cond:=C_CC;
|
||||
begin
|
||||
{ MUL/DIV always sets the overflow flag, and never the carry flag }
|
||||
{ Note/Fixme: This still doesn't cover the ColdFire, where none of these opcodes
|
||||
set either the overflow or the carry flag. So CF must be handled in other ways. }
|
||||
if taicpu(list.last).opcode in [A_MULU,A_MULS,A_DIVS,A_DIVU,A_DIVUL,A_DIVSL] then
|
||||
cond:=C_VC
|
||||
else
|
||||
cond:=C_CC;
|
||||
end;
|
||||
ai:=Taicpu.Op_Sym(A_Bxx,S_NO,hl);
|
||||
ai.SetCondition(cond);
|
||||
ai.is_jmp:=true;
|
||||
|
Loading…
Reference in New Issue
Block a user