summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2018-11-16 13:03:31 -0600
committerJason Ekstrand <[email protected]>2019-01-29 18:43:55 +0000
commitd96969120de1a9cee04a889831347154f54e0c4b (patch)
tree18e3788121fd5ab81b6ba6f57a8b9ecfc8b8283b /src
parente46fb33143c20132e8a56e20a6ea4c768886bc79 (diff)
intel/inst: Fix the ia16_addr_imm helpers
These have clearly never seen any use.... On gen8, the bottom 4 bits are missing so we need to shift them off before we call set_bits and shift again when we get the bits. Found by inspection. Reviewed-by: Iago Toral Quiroga <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/intel/compiler/brw_inst.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/intel/compiler/brw_inst.h b/src/intel/compiler/brw_inst.h
index 753f09e70cf..f60325c1a6b 100644
--- a/src/intel/compiler/brw_inst.h
+++ b/src/intel/compiler/brw_inst.h
@@ -933,10 +933,11 @@ brw_inst_set_##reg##_ia16_addr_imm(const struct gen_device_info *devinfo, \
{ \
assert((value & ~0x3ff) == 0); \
if (devinfo->gen >= 8) { \
- brw_inst_set_bits(inst, g8_high, g8_low, value & 0x1ff); \
- brw_inst_set_bits(inst, g8_nine, g8_nine, value >> 9); \
+ assert(GET_BITS(value, 3, 0) == 0); \
+ brw_inst_set_bits(inst, g8_high, g8_low, GET_BITS(value, 8, 4)); \
+ brw_inst_set_bits(inst, g8_nine, g8_nine, GET_BITS(value, 9, 9)); \
} else { \
- brw_inst_set_bits(inst, g4_high, g4_low, value >> 9); \
+ brw_inst_set_bits(inst, g4_high, g4_low, value); \
} \
} \
static inline unsigned \
@@ -944,7 +945,7 @@ brw_inst_##reg##_ia16_addr_imm(const struct gen_device_info *devinfo, \
const brw_inst *inst) \
{ \
if (devinfo->gen >= 8) { \
- return brw_inst_bits(inst, g8_high, g8_low) | \
+ return (brw_inst_bits(inst, g8_high, g8_low) << 4) | \
(brw_inst_bits(inst, g8_nine, g8_nine) << 9); \
} else { \
return brw_inst_bits(inst, g4_high, g4_low); \