aco: Fix an MSVC warning
authorBoris Brezillon <boris.brezillon@collabora.com>
Tue, 22 Mar 2022 11:05:03 +0000 (12:05 +0100)
committerMarge Bot <emma+marge@anholt.net>
Thu, 24 Mar 2022 09:11:13 +0000 (09:11 +0000)
'warning C4804: '<<': unsafe use of type 'bool' in operation'

Fixes: 9934c8676132 ("aco: use v_fma_mix to combine mul/add/fma input conversions")
Acked-by: Daniel Stone <daniels@collabora.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15518>

src/amd/compiler/aco_optimizer.cpp

index 933ce83..8b6f978 100644 (file)
@@ -3487,7 +3487,7 @@ to_mad_mix(opt_ctx& ctx, aco_ptr<Instruction>& instr)
    aco_ptr<VOP3P_instruction> vop3p{
       create_instruction<VOP3P_instruction>(aco_opcode::v_fma_mix_f32, Format::VOP3P, 3, 1)};
 
-   vop3p->opsel_lo = instr->isVOP3() ? (instr->vop3().opsel & 0x7) << is_add : 0x0;
+   vop3p->opsel_lo = instr->isVOP3() ? ((instr->vop3().opsel & 0x7) << (is_add ? 1 : 0)) : 0x0;
    vop3p->opsel_hi = 0x0;
    for (unsigned i = 0; i < instr->operands.size(); i++) {
       vop3p->operands[is_add + i] = instr->operands[i];