mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-28 14:40:10 +01:00
i965/fs: Add a helper function for detecting math opcodes.
This commit is contained in:
parent
1991d92207
commit
382c2d99da
2 changed files with 13 additions and 8 deletions
|
|
@ -3138,14 +3138,7 @@ fs_visitor::compute_to_mrf()
|
|||
/* gen6 math instructions must have the destination be
|
||||
* GRF, so no compute-to-MRF for them.
|
||||
*/
|
||||
if (scan_inst->opcode == FS_OPCODE_RCP ||
|
||||
scan_inst->opcode == FS_OPCODE_RSQ ||
|
||||
scan_inst->opcode == FS_OPCODE_SQRT ||
|
||||
scan_inst->opcode == FS_OPCODE_EXP2 ||
|
||||
scan_inst->opcode == FS_OPCODE_LOG2 ||
|
||||
scan_inst->opcode == FS_OPCODE_SIN ||
|
||||
scan_inst->opcode == FS_OPCODE_COS ||
|
||||
scan_inst->opcode == FS_OPCODE_POW) {
|
||||
if (scan_inst->is_math()) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -313,6 +313,18 @@ public:
|
|||
opcode == FS_OPCODE_TXL);
|
||||
}
|
||||
|
||||
bool is_math()
|
||||
{
|
||||
return (opcode == FS_OPCODE_RCP ||
|
||||
opcode == FS_OPCODE_RSQ ||
|
||||
opcode == FS_OPCODE_SQRT ||
|
||||
opcode == FS_OPCODE_EXP2 ||
|
||||
opcode == FS_OPCODE_LOG2 ||
|
||||
opcode == FS_OPCODE_SIN ||
|
||||
opcode == FS_OPCODE_COS ||
|
||||
opcode == FS_OPCODE_POW);
|
||||
}
|
||||
|
||||
int opcode; /* BRW_OPCODE_* or FS_OPCODE_* */
|
||||
fs_reg dst;
|
||||
fs_reg src[3];
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue