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')
|
||||
|
||||
class ShlOp(BinOp):
|
||||
scratch_need = 3
|
||||
scratch_need = 2
|
||||
def synth(self, scratches):
|
||||
sc0, sc1, sc2 = scratches
|
||||
return [f'or {sc0}, {self.right}, {self.right}',
|
||||
sc0, sc1 = scratches
|
||||
return [f'set {sc1}, 1',
|
||||
f'or {self.dest}, {self.left}, {self.left}',
|
||||
f'set {sc1}, 1',
|
||||
f'set {sc2}, 0',
|
||||
f'cmp {sc0}, {sc2}',
|
||||
f'sub {sc0}, {self.right}, {sc1}',
|
||||
f'beq [pc, 6]',
|
||||
f'add {self.dest}, {self.dest}, {self.dest}',
|
||||
f'sub {sc0}, {sc0}, {sc1}',
|
||||
|
Loading…
Reference in New Issue
Block a user