summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2018-12-10 11:42:44 -0800
committerMatt Turner <mattst88@gmail.com>2019-01-08 22:12:37 -0800
commite2fccb632ce64443e1da8af17ef60d245a1aeb48 (patch)
tree3f6a91e63240a0395dcbcbd4292e11985f9e45da
parent24abb19fc70504970c661e8e90808e6550358052 (diff)
intel/compiler: Avoid false positive assertions
A follow on patch will move the 'nr' field to the union containing the immediate field, so prepare by checking that we're only testing these assertions if the .file is correct. The assertions with != ARF were kind of silly to begin with because the <128 check is specifically only for things in the GRF. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
-rw-r--r--src/intel/compiler/brw_eu_emit.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/intel/compiler/brw_eu_emit.c b/src/intel/compiler/brw_eu_emit.c
index 483037345e9..96b3cbc1e94 100644
--- a/src/intel/compiler/brw_eu_emit.c
+++ b/src/intel/compiler/brw_eu_emit.c
@@ -91,7 +91,7 @@ brw_set_dest(struct brw_codegen *p, brw_inst *inst, struct brw_reg dest)
if (dest.file == BRW_MESSAGE_REGISTER_FILE)
assert((dest.nr & ~BRW_MRF_COMPR4) < BRW_MAX_MRF(devinfo->gen));
- else if (dest.file != BRW_ARCHITECTURE_REGISTER_FILE)
+ else if (dest.file == BRW_GENERAL_REGISTER_FILE)
assert(dest.nr < 128);
gen7_convert_mrf_to_grf(p, &dest);
@@ -170,7 +170,7 @@ brw_set_src0(struct brw_codegen *p, brw_inst *inst, struct brw_reg reg)
if (reg.file == BRW_MESSAGE_REGISTER_FILE)
assert((reg.nr & ~BRW_MRF_COMPR4) < BRW_MAX_MRF(devinfo->gen));
- else if (reg.file != BRW_ARCHITECTURE_REGISTER_FILE)
+ else if (reg.file == BRW_GENERAL_REGISTER_FILE)
assert(reg.nr < 128);
gen7_convert_mrf_to_grf(p, &reg);
@@ -275,7 +275,7 @@ brw_set_src1(struct brw_codegen *p, brw_inst *inst, struct brw_reg reg)
{
const struct gen_device_info *devinfo = p->devinfo;
- if (reg.file != BRW_ARCHITECTURE_REGISTER_FILE)
+ if (reg.file == BRW_GENERAL_REGISTER_FILE)
assert(reg.nr < 128);
/* From the IVB PRM Vol. 4, Pt. 3, Section 3.3.3.5:
@@ -654,9 +654,9 @@ brw_alu3(struct brw_codegen *p, unsigned opcode, struct brw_reg dest,
gen7_convert_mrf_to_grf(p, &dest);
assert(dest.nr < 128);
- assert(src0.nr < 128);
- assert(src1.nr < 128);
- assert(src2.nr < 128);
+ assert(src0.file != BRW_IMMEDIATE_VALUE || src0.nr < 128);
+ assert(src1.file != BRW_IMMEDIATE_VALUE || src1.nr < 128);
+ assert(src2.file != BRW_IMMEDIATE_VALUE || src2.nr < 128);
assert(dest.address_mode == BRW_ADDRESS_DIRECT);
assert(src0.address_mode == BRW_ADDRESS_DIRECT);
assert(src1.address_mode == BRW_ADDRESS_DIRECT);