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:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user