summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2015-08-10 16:57:58 -0700
committerMatt Turner <mattst88@gmail.com>2015-08-11 15:13:10 -0700
commit9fa70fef22bd458fbeb95a3b0ebb5f7919cba7f0 (patch)
tree9a688d9b96aa5b654dac8139450192b5332b8578
parent1e53df70642a970fa1bdf5e6b7d64f2c0a4699c7 (diff)
i965: Optimize brw_inst_bits() and brw_compact_inst_bits().
Cuts about 1k of .text. text data bss dec hex filename 5018165 197160 27672 5242997 500075 i965_dri.so before 5017141 197160 27672 5241973 4ffc75 i965_dri.so after Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
-rw-r--r--src/mesa/drivers/dri/i965/brw_inst.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_inst.h b/src/mesa/drivers/dri/i965/brw_inst.h
index 7a8c210118..51082dc77a 100644
--- a/src/mesa/drivers/dri/i965/brw_inst.h
+++ b/src/mesa/drivers/dri/i965/brw_inst.h
@@ -683,9 +683,9 @@ brw_inst_bits(const brw_inst *inst, unsigned high, unsigned low)
high %= 64;
low %= 64;
- const uint64_t mask = (((1ull << (high - low + 1)) - 1) << low);
+ const uint64_t mask = (1ull << (high - low + 1)) - 1;
- return (inst->data[word] & mask) >> low;
+ return (inst->data[word] >> low) & mask;
}
/**
@@ -731,9 +731,9 @@ typedef struct {
static inline unsigned
brw_compact_inst_bits(brw_compact_inst *inst, unsigned high, unsigned low)
{
- const uint64_t mask = (((1ull << (high - low + 1)) - 1) << low);
+ const uint64_t mask = (1ull << (high - low + 1)) - 1;
- return (inst->data & mask) >> low;
+ return (inst->data >> low) & mask;
}
/**