Skip to content

Commit

Permalink
python format
Browse files Browse the repository at this point in the history
Signed-off-by: Nathan Gauër <[email protected]>
  • Loading branch information
Keenuts committed Aug 22, 2024
1 parent 6c93b7e commit 11af4e2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion llvm/utils/spirv-sim/instructions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from typing import Optional


# Base class for an instruction. To implement a basic instruction that doesn't
# impact the control-flow, create a new class inheriting from this.
class Instruction:
Expand Down Expand Up @@ -256,14 +257,16 @@ def _impl(self, module, lane):
output.append(lane.get_register(op))
lane.set_register(self._result, output)


class OpCompositeExtract(Instruction):
def _impl(self, module, lane):
value = lane.get_register(self._operands[1])
output = value
for op in self._operands[2:]:
output = output[int(op)]
output = output[int(op)]
lane.set_register(self._result, output)


class OpStore(Instruction):
def _impl(self, module, lane):
lane.set_register(self._operands[0], lane.get_register(self._operands[1]))
Expand Down

0 comments on commit 11af4e2

Please sign in to comment.