intel/vec4: Don't optimize multiply by 1.0 away

The SPIR-V compiler's implementation of tanh generates a multiply by 1.0
to flush denorms to zero.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20232>
This commit is contained in:
Väinö Mäkelä
2022-12-08 17:52:04 +02:00
committed by Marge Bot
parent dcad4a2cd1
commit 56667002fd

View File

@@ -668,6 +668,12 @@ vec4_visitor::opt_algebraic()
break;
case BRW_OPCODE_MUL:
if (inst->src[1].file != IMM)
continue;
if (brw_reg_type_is_floating_point(inst->src[1].type))
break;
if (inst->src[1].is_zero()) {
inst->opcode = BRW_OPCODE_MOV;
switch (inst->src[0].type) {