mirror of
https://github.com/dschmenk/PLASMA.git
synced 2025-04-18 16:37:23 +00:00
Add optimization for multiply by 3
This commit is contained in:
parent
e1f0cf9164
commit
5883fc8fae
Binary file not shown.
@ -1469,6 +1469,11 @@ int crunch_seq(t_opseq **seq, int pass)
|
||||
op->code = DUP_CODE;
|
||||
opnext->code = BINARY_CODE(ADD_TOKEN);
|
||||
}
|
||||
else if (op->val == 3)
|
||||
{
|
||||
op->code = DUP_CODE;
|
||||
opnext->code = BINARY_CODE(INDEXW_CODE);
|
||||
}
|
||||
else
|
||||
{
|
||||
//
|
||||
|
@ -278,6 +278,10 @@ def crunch_seq(seq, pass)
|
||||
op->opcode = DUP_CODE
|
||||
op->opgroup = STACK_GROUP
|
||||
nextop->opcode = ADD_CODE
|
||||
elsif op=>opval == 3
|
||||
op->opcode = DUP_CODE
|
||||
op->opgroup = STACK_GROUP
|
||||
nextop->opcode = INDEXW_CODE
|
||||
else
|
||||
for shiftcnt = 2 to 15
|
||||
if op=>opval == 1 << shiftcnt
|
||||
|
Loading…
x
Reference in New Issue
Block a user