mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-13 12:59:15 +02:00
+ support testing for individual bits from the x86 flags register in i386's
TCpuAsmOptimizer.RegReadByInstruction() git-svn-id: trunk@35956 -
This commit is contained in:
parent
c8487c4150
commit
618b6292ee
@ -233,12 +233,34 @@ unit aoptcpu;
|
|||||||
exit
|
exit
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
if ([Ch_RCarryFlag,Ch_RParityFlag,Ch_RAuxiliaryFlag,Ch_RZeroFlag,Ch_RSignFlag,Ch_ROverflowFlag,
|
if SuperRegistersEqual(reg,NR_DEFAULTFLAGS) then
|
||||||
Ch_RWCarryFlag,Ch_RWParityFlag,Ch_RWAuxiliaryFlag,Ch_RWZeroFlag,Ch_RWSignFlag,Ch_RWOverflowFlag,
|
|
||||||
Ch_RFlags,Ch_RWFlags,Ch_RFLAGScc]*Ch<>[]) and (reg=NR_DEFAULTFLAGS) then
|
|
||||||
begin
|
begin
|
||||||
RegReadByInstruction := true;
|
case getsubreg(reg) of
|
||||||
exit
|
R_SUBW,R_SUBD,R_SUBQ:
|
||||||
|
RegReadByInstruction :=
|
||||||
|
[Ch_RCarryFlag,Ch_RParityFlag,Ch_RAuxiliaryFlag,Ch_RZeroFlag,Ch_RSignFlag,Ch_ROverflowFlag,
|
||||||
|
Ch_RWCarryFlag,Ch_RWParityFlag,Ch_RWAuxiliaryFlag,Ch_RWZeroFlag,Ch_RWSignFlag,Ch_RWOverflowFlag,
|
||||||
|
Ch_RDirFlag,Ch_RFlags,Ch_RWFlags,Ch_RFLAGScc]*Ch<>[];
|
||||||
|
R_SUBFLAGCARRY:
|
||||||
|
RegReadByInstruction:=[Ch_RCarryFlag,Ch_RWCarryFlag,Ch_RFlags,Ch_RWFlags,Ch_RFLAGScc]*Ch<>[];
|
||||||
|
R_SUBFLAGPARITY:
|
||||||
|
RegReadByInstruction:=[Ch_RParityFlag,Ch_RWParityFlag,Ch_RFlags,Ch_RWFlags,Ch_RFLAGScc]*Ch<>[];
|
||||||
|
R_SUBFLAGAUXILIARY:
|
||||||
|
RegReadByInstruction:=[Ch_RAuxiliaryFlag,Ch_RWAuxiliaryFlag,Ch_RFlags,Ch_RWFlags,Ch_RFLAGScc]*Ch<>[];
|
||||||
|
R_SUBFLAGZERO:
|
||||||
|
RegReadByInstruction:=[Ch_RZeroFlag,Ch_RWZeroFlag,Ch_RFlags,Ch_RWFlags,Ch_RFLAGScc]*Ch<>[];
|
||||||
|
R_SUBFLAGSIGN:
|
||||||
|
RegReadByInstruction:=[Ch_RSignFlag,Ch_RWSignFlag,Ch_RFlags,Ch_RWFlags,Ch_RFLAGScc]*Ch<>[];
|
||||||
|
R_SUBFLAGOVERFLOW:
|
||||||
|
RegReadByInstruction:=[Ch_ROverflowFlag,Ch_RWOverflowFlag,Ch_RFlags,Ch_RWFlags,Ch_RFLAGScc]*Ch<>[];
|
||||||
|
R_SUBFLAGINTERRUPT:
|
||||||
|
RegReadByInstruction:=[Ch_RFlags,Ch_RWFlags]*Ch<>[];
|
||||||
|
R_SUBFLAGDIRECTION:
|
||||||
|
RegReadByInstruction:=[Ch_RDirFlag,Ch_RFlags,Ch_RWFlags]*Ch<>[];
|
||||||
|
else
|
||||||
|
internalerror(2017042601);
|
||||||
|
end;
|
||||||
|
exit;
|
||||||
end;
|
end;
|
||||||
if (Ch_NoReadIfEqualRegs in Ch) and (p.ops=2) and
|
if (Ch_NoReadIfEqualRegs in Ch) and (p.ops=2) and
|
||||||
(p.oper[0]^.typ=top_reg) and (p.oper[1]^.typ=top_reg) and
|
(p.oper[0]^.typ=top_reg) and (p.oper[1]^.typ=top_reg) and
|
||||||
|
Loading…
Reference in New Issue
Block a user