mirror of
https://github.com/cc65/cc65.git
synced 2025-04-04 21:33:30 +00:00
Replaced direct CEF_NUMARG flag checks on code entries with CE_HasNumArg().
This commit is contained in:
parent
c45a6b3685
commit
28c7aa2bc8
@ -176,14 +176,14 @@ static int IsImmCmp16 (CodeEntry** L)
|
||||
{
|
||||
return (L[0]->OPC == OP65_CPX &&
|
||||
L[0]->AM == AM65_IMM &&
|
||||
(L[0]->Flags & CEF_NUMARG) != 0 &&
|
||||
CE_HasNumArg (L[0]) &&
|
||||
!CE_HasLabel (L[0]) &&
|
||||
(L[1]->OPC == OP65_JNE || L[1]->OPC == OP65_BNE) &&
|
||||
L[1]->JumpTo != 0 &&
|
||||
!CE_HasLabel (L[1]) &&
|
||||
L[2]->OPC == OP65_CMP &&
|
||||
L[2]->AM == AM65_IMM &&
|
||||
(L[2]->Flags & CEF_NUMARG) != 0 &&
|
||||
CE_HasNumArg (L[2]) &&
|
||||
(L[3]->Info & OF_CBRA) != 0 &&
|
||||
L[3]->JumpTo != 0 &&
|
||||
(L[1]->JumpTo->Owner == L[3] || L[1]->JumpTo == L[3]->JumpTo));
|
||||
|
@ -68,15 +68,15 @@ unsigned OptBNegA1 (CodeSeg* S)
|
||||
CodeEntry* E = CS_GetEntry (S, I);
|
||||
|
||||
/* Check for a ldx */
|
||||
if (E->OPC == OP65_LDX &&
|
||||
E->AM == AM65_IMM &&
|
||||
(E->Flags & CEF_NUMARG) != 0 &&
|
||||
E->Num == 0 &&
|
||||
CS_GetEntries (S, L, I+1, 2) &&
|
||||
L[0]->OPC == OP65_LDA &&
|
||||
(L[0]->Use & REG_X) == 0 &&
|
||||
!CE_HasLabel (L[0]) &&
|
||||
CE_IsCallTo (L[1], "bnega") &&
|
||||
if (E->OPC == OP65_LDX &&
|
||||
E->AM == AM65_IMM &&
|
||||
CE_HasNumArg (E) &&
|
||||
E->Num == 0 &&
|
||||
CS_GetEntries (S, L, I+1, 2) &&
|
||||
L[0]->OPC == OP65_LDA &&
|
||||
(L[0]->Use & REG_X) == 0 &&
|
||||
!CE_HasLabel (L[0]) &&
|
||||
CE_IsCallTo (L[1], "bnega") &&
|
||||
!CE_HasLabel (L[1])) {
|
||||
|
||||
/* Remove the ldx instruction */
|
||||
|
Loading…
x
Reference in New Issue
Block a user