Instruction execution in graphics processor shader programs
AssigneeArm Limited
InventorPeter William Harris
Life of this patent
Estimating the term…
Abstract
When executing a shader program to perform graphics shading operations in a graphics processor, the graphics processor determines for instructions to be executed for the shader program, whether to replace the instructions with alternative instructions, based on the nature of the instructions and the values of input operands to be processed by the instructions, and either retains an instruction or replaces the instruction with an alternative instruction, accordingly.
Claims24
A method of operating a graphics processor that executes a graphics processing pipeline which includes a programmable shading stage that executes compiled graphics shader programs to perform graphics shading operations, wherein the compiled graphics shader programs are graphics shader programs which have been compiled by a compiler, the method comprising:
- the graphics processor, when executing a compiled shader program to perform graphics shading operations:
- for an instruction to be executed for the compiled shader program:
- determining, based on the nature of the instruction and the value of an input operand to be processed by the instruction, whether to replace the instruction with an alternative instruction, wherein the determining based on the value of an input operand to be processed by the instruction comprises either determining whether the input operand has a data value of 0 or determining whether the input operand has a data value of 1;
- and
- based on the determination, either:
- retaining the instruction and continuing execution of the compiled shader program with the retained instruction;
- or
- replacing the instruction with an alternative instruction and continuing execution of the compiled shader program with the alternative instruction in place of the instruction.
A graphics processor that executes a graphics processing pipeline which includes a programmable shading stage that executes compiled graphics shader programs to perform graphics shading operations, wherein the compiled graphics shader programs are graphics shader programs which have been compiled by a compiler the graphics processor comprising:
- programmable processing circuitry operable to execute compiled graphics shader programs to perform graphics shading operations;
- and further comprising:
- instruction replacement circuitry operable to, when the programmable processing circuitry is executing a compiled shader program to perform graphics shading operations:
- for an instruction to be executed for the shader program:
- determine, based on the nature of the instruction and the value of an input operand to be processed by the instruction, whether to replace the instruction with an alternative instruction, wherein the determining based on the value of an input operand to be processed by the instruction comprises either determining whether the input operand has a data value of 0 or determining whether the input operand has a data value of 1;
- and
- based on the determination, either:
- retain the instruction in the compiled shader program and cause the programmable processing circuitry to continue execution of the compiled shader program with the retained instruction;
- or
- replace the instruction with an alternative instruction in the compiled shader program and cause the programmable processing circuitry to continue execution of the compiled shader program with the alternative instruction in place of the instruction.
A non-transitory computer readable storage medium storing computer software code which when executing on a processor performs a method of operating a graphics processor that executes a graphics processing pipeline which includes a programmable shading stage that executes compiled graphics shader programs to perform graphics shading operations, wherein the compiled graphics shader programs are graphics shader programs which have been compiled by a compiler, the method comprising:
- the graphics processor, when executing a compiled shader program to perform graphics shading operations:
- for an instruction to be executed for the compiled shader program:
- determining, based on the nature of the instruction and the value of an input operand to be processed by the instruction, whether to replace the instruction with an alternative instruction, wherein the determining based on the value of an input operand to be processed by the instruction comprises either determining whether the input operand has a data value of 0 or determining whether the input operand has a data value of 1;
- and
- based on the determination, either:
- retaining the instruction and continuing execution of the compiled shader program with the retained instruction;
- or
- replacing the instruction with an alternative instruction and continuing execution of the compiled shader program with the alternative instruction in place of the instruction.
Dependencies are inferred from the claim text.