diff options
author | Kenneth Graunke <[email protected]> | 2012-11-17 15:10:53 -0800 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2012-11-30 13:15:39 -0800 |
commit | 8d0bb74a11f1905e32f6db23fbf8bb29ff8fa367 (patch) | |
tree | 8d4bc5ca7bfec4d7c4b1a71c0b7d2bbaa3863e88 /src/egl | |
parent | 4cedb65a43ae81c7ac71e631c854b7404dd2b61b (diff) |
i965/fs: Add fs_reg::is_zero() and is_one(); use for opt_algebraic().
These helper macros save you from writing nasty expressions like:
if ((inst->src[1].type == BRW_REGISTER_TYPE_F &&
inst->src[1].imm.f == 1.0) ||
((inst->src[1].type == BRW_REGISTER_TYPE_D ||
inst->src[1].type == BRW_REGISTER_TYPE_UD) &&
inst->src[1].imm.u == 1)) {
Instead, you simply get to write inst->src[1].is_one(). Simple.
Also, this makes the FS backend match the VS backend (which has these).
This patch also converts opt_algebraic to use the new helper functions.
As a consequence, it will now also optimize integer-typed expressions.
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/egl')
0 files changed, 0 insertions, 0 deletions