[Mesa-dev] [PATCH 2/2] i965: Optimize brw_inst_set_bits() and brw_compact_inst_set_bits().
Matt Turner
mattst88 at gmail.com
Tue Aug 11 13:29:47 PDT 2015
Cuts about 2k of .text.
text data bss dec hex filename
5017141 197160 27672 5241973 4ffc75 i965_dri.so before
5014981 197160 27672 5239813 4ff405 i965_dri.so after
---
src/mesa/drivers/dri/i965/brw_inst.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/brw_inst.h b/src/mesa/drivers/dri/i965/brw_inst.h
index 5feea38..8fa70a8 100644
--- a/src/mesa/drivers/dri/i965/brw_inst.h
+++ b/src/mesa/drivers/dri/i965/brw_inst.h
@@ -707,7 +707,7 @@ brw_inst_set_bits(brw_inst *inst, unsigned high, unsigned low, uint64_t value)
/* Make sure the supplied value actually fits in the given bitfield. */
assert((value & (mask >> low)) == value);
- inst->data[word] = (inst->data[word] & ~mask) | ((value << low) & mask);
+ inst->data[word] = (inst->data[word] & ~mask) | (value << low);
}
#undef BRW_IA16_ADDR_IMM
@@ -750,7 +750,7 @@ brw_compact_inst_set_bits(brw_compact_inst *inst, unsigned high, unsigned low,
/* Make sure the supplied value actually fits in the given bitfield. */
assert((value & (mask >> low)) == value);
- inst->data = (inst->data & ~mask) | ((value << low) & mask);
+ inst->data = (inst->data & ~mask) | (value << low);
}
#define F(name, high, low) \
--
2.4.6
More information about the mesa-dev
mailing list