Skip to content

Commit ac36c51

Browse files
committed
i965: Fix multiplication of immediates on Cherryview/Broxton.
Cherryview and Broxton don't support DW x DW multiplication. We have piles of code to handle this, but apparently weren't retyping in the immediate case. For example, tests/spec/arb_tessellation_shader/execution/dvec3-vs-tcs-tes makes the simulator angry about instructions such as: mul(8) r18<1>:D r10.0<8;8,1>:D 0x00000003:D Just retype to W or UW. It should be safe on all platforms. Cc: "12.0" <mesa-stable@lists.freedesktop.org> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95462 Reviewed-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
1 parent eb6764c commit ac36c51

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/mesa/drivers/dri/i965/brw_fs.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3551,7 +3551,10 @@ fs_visitor::lower_integer_multiplication()
35513551
ibld.MOV(imm, inst->src[1]);
35523552
ibld.MUL(inst->dst, imm, inst->src[0]);
35533553
} else {
3554-
ibld.MUL(inst->dst, inst->src[0], inst->src[1]);
3554+
const bool ud = (inst->src[1].type == BRW_REGISTER_TYPE_UD);
3555+
ibld.MUL(inst->dst, inst->src[0],
3556+
ud ? brw_imm_uw(inst->src[1].ud)
3557+
: brw_imm_w(inst->src[1].d));
35553558
}
35563559
} else {
35573560
/* Gen < 8 (and some Gen8+ low-power parts like Cherryview) cannot

0 commit comments

Comments
 (0)