Fix shl
This commit is contained in:
parent
f3928f52a4
commit
abfd8d3647
10
tools/cc.py
10
tools/cc.py
@ -339,14 +339,12 @@ orOp = make_cpu_bin_op('or')
|
|||||||
XorOp = make_cpu_bin_op('xor')
|
XorOp = make_cpu_bin_op('xor')
|
||||||
|
|
||||||
class ShlOp(BinOp):
|
class ShlOp(BinOp):
|
||||||
scratch_need = 3
|
scratch_need = 2
|
||||||
def synth(self, scratches):
|
def synth(self, scratches):
|
||||||
sc0, sc1, sc2 = scratches
|
sc0, sc1 = scratches
|
||||||
return [f'or {sc0}, {self.right}, {self.right}',
|
return [f'set {sc1}, 1',
|
||||||
f'or {self.dest}, {self.left}, {self.left}',
|
f'or {self.dest}, {self.left}, {self.left}',
|
||||||
f'set {sc1}, 1',
|
f'sub {sc0}, {self.right}, {sc1}',
|
||||||
f'set {sc2}, 0',
|
|
||||||
f'cmp {sc0}, {sc2}',
|
|
||||||
f'beq [pc, 6]',
|
f'beq [pc, 6]',
|
||||||
f'add {self.dest}, {self.dest}, {self.dest}',
|
f'add {self.dest}, {self.dest}, {self.dest}',
|
||||||
f'sub {sc0}, {sc0}, {sc1}',
|
f'sub {sc0}, {sc0}, {sc1}',
|
||||||
|
Loading…
Reference in New Issue
Block a user