mirror of
https://github.com/dschmenk/PLASMA.git
synced 2024-10-18 22:24:28 +00:00
BREQ/BRNE optimizations
This commit is contained in:
parent
3d84a2192c
commit
5fc2807ace
@ -453,6 +453,38 @@ def crunch_seq(seq, pass)
|
|||||||
break
|
break
|
||||||
wend
|
wend
|
||||||
break // LOGIC_NOT_CODE
|
break // LOGIC_NOT_CODE
|
||||||
|
is EQ_CODE
|
||||||
|
when nextop->opcode
|
||||||
|
is BRFALSE_CODE
|
||||||
|
op->opcode = BRNE_CODE
|
||||||
|
op->opgroup = RELATIVE_GROUP
|
||||||
|
op=>optag = nextop=>optag
|
||||||
|
freeops = 1
|
||||||
|
break
|
||||||
|
is BRTRUE_CODE
|
||||||
|
op->opcode = BREQ_CODE
|
||||||
|
op->opgroup = RELATIVE_GROUP
|
||||||
|
op=>optag = nextop=>optag
|
||||||
|
freeops = 1
|
||||||
|
break
|
||||||
|
wend
|
||||||
|
break // EQ_CODE
|
||||||
|
is NE_CODE
|
||||||
|
when nextop->opcode
|
||||||
|
is BRFALSE_CODE
|
||||||
|
op->opcode = BREQ_CODE
|
||||||
|
op->opgroup = RELATIVE_GROUP
|
||||||
|
op=>optag = nextop=>optag
|
||||||
|
freeops = 1
|
||||||
|
break
|
||||||
|
is BRTRUE_CODE
|
||||||
|
op->opcode = BRNE_CODE
|
||||||
|
op->opgroup = RELATIVE_GROUP
|
||||||
|
op=>optag = nextop=>optag
|
||||||
|
freeops = 1
|
||||||
|
break
|
||||||
|
wend
|
||||||
|
break // NE_CODE
|
||||||
is SLB_CODE
|
is SLB_CODE
|
||||||
if nextop->opcode == LLB_CODE and op=>opoffset == nextop=>opoffset
|
if nextop->opcode == LLB_CODE and op=>opoffset == nextop=>opoffset
|
||||||
op->opcode = DLB_CODE
|
op->opcode = DLB_CODE
|
||||||
|
@ -82,6 +82,8 @@ const IDXAW_CODE = $BE
|
|||||||
// Relative address code group
|
// Relative address code group
|
||||||
//
|
//
|
||||||
const RELATIVE_GROUP = $05
|
const RELATIVE_GROUP = $05
|
||||||
|
const BREQ_CODE = $22
|
||||||
|
const BRNE_CODE = $24
|
||||||
const BRFALSE_CODE = $4C
|
const BRFALSE_CODE = $4C
|
||||||
const BRTRUE_CODE = $4E
|
const BRTRUE_CODE = $4E
|
||||||
const BRNCH_CODE = $50
|
const BRNCH_CODE = $50
|
||||||
|
Loading…
Reference in New Issue
Block a user