diff --git a/llvm/utils/spirv-sim/instructions.py b/llvm/utils/spirv-sim/instructions.py index 5ae0f826648ee4e..c1e3d1e1ef7ab07 100644 --- a/llvm/utils/spirv-sim/instructions.py +++ b/llvm/utils/spirv-sim/instructions.py @@ -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: @@ -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]))