summaryrefslogtreecommitdiffstats
path: root/src/intel/compiler/brw_eu_emit.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2017-10-17 11:57:48 -0700
committerJason Ekstrand <[email protected]>2017-11-07 10:37:52 -0800
commite3bcc8613311dede33612b185b7e6e374c09570c (patch)
tree5b23450358e79638ca3389e572d5ec89281c3e3d /src/intel/compiler/brw_eu_emit.c
parent1b8ef49f48ae3634e4903422a9d9c11864c03cb1 (diff)
intel/compiler: Add some restrictions to MOV_INDIRECT and BROADCAST
These restrictions effectively already existed due to the way we use indirect sources but weren't being directly enforced. Reviewed-by: Iago Toral Quiroga <[email protected]>
Diffstat (limited to 'src/intel/compiler/brw_eu_emit.c')
-rw-r--r--src/intel/compiler/brw_eu_emit.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/intel/compiler/brw_eu_emit.c b/src/intel/compiler/brw_eu_emit.c
index 4f0be550983..e10b1432b5e 100644
--- a/src/intel/compiler/brw_eu_emit.c
+++ b/src/intel/compiler/brw_eu_emit.c
@@ -3373,6 +3373,8 @@ brw_broadcast(struct brw_codegen *p,
assert(src.file == BRW_GENERAL_REGISTER_FILE &&
src.address_mode == BRW_ADDRESS_DIRECT);
+ assert(!src.abs && !src.negate);
+ assert(src.type == dst.type);
if ((src.vstride == 0 && (src.hstride == 0 || !align1)) ||
idx.file == BRW_IMMEDIATE_VALUE) {
@@ -3385,6 +3387,20 @@ brw_broadcast(struct brw_codegen *p,
(align1 ? stride(suboffset(src, i), 0, 1, 0) :
stride(suboffset(src, 4 * i), 0, 4, 1)));
} else {
+ /* From the Haswell PRM section "Register Region Restrictions":
+ *
+ * "The lower bits of the AddressImmediate must not overflow to
+ * change the register address. The lower 5 bits of Address
+ * Immediate when added to lower 5 bits of address register gives
+ * the sub-register offset. The upper bits of Address Immediate
+ * when added to upper bits of address register gives the register
+ * address. Any overflow from sub-register offset is dropped."
+ *
+ * Fortunately, for broadcast, we never have a sub-register offset so
+ * this isn't an issue.
+ */
+ assert(src.subnr == 0);
+
if (align1) {
const struct brw_reg addr =
retype(brw_address_reg(0), BRW_REGISTER_TYPE_UD);