i965: two-argument instructions can only use 32-bit immediates
authorIago Toral Quiroga <itoral@igalia.com>
Thu, 7 Jan 2016 13:11:28 +0000 (14:11 +0100)
committerSamuel Iglesias Gonsálvez <siglesias@igalia.com>
Tue, 10 May 2016 09:25:04 +0000 (11:25 +0200)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
src/mesa/drivers/dri/i965/brw_eu_emit.c

index 434be830f9a9b29e323eec552122cd019a1373d3..1a2ed3fb08500948dd2a5c0573ac3f5630acce29 100644 (file)
@@ -501,6 +501,8 @@ brw_set_src1(struct brw_codegen *p, brw_inst *inst, struct brw_reg reg)
    assert(brw_inst_src0_reg_file(devinfo, inst) != BRW_IMMEDIATE_VALUE);
 
    if (reg.file == BRW_IMMEDIATE_VALUE) {
+      /* two-argument instructions can only use 32-bit immediates */
+      assert(type_sz(reg.type) < 8);
       brw_inst_set_imm_ud(devinfo, inst, reg.ud);
    } else {
       /* This is a hardware restriction, which may or may not be lifted