Module: Mesa
Branch: main
Commit: de039537da891f56d5fadd0f1e18039cd5b8340b
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=de039537da891f56d5fadd0f1e18039cd5b8340b

Author: Boris Brezillon <[email protected]>
Date:   Tue Mar 22 12:05:03 2022 +0100

aco: Fix an MSVC warning

'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 <[email protected]>
Acked-by: Erik Faye-Lund <[email protected]>
Acked-by: Jason Ekstrand <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15518>

---

 src/amd/compiler/aco_optimizer.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/amd/compiler/aco_optimizer.cpp 
b/src/amd/compiler/aco_optimizer.cpp
index 933ce834628..8b6f9786869 100644
--- a/src/amd/compiler/aco_optimizer.cpp
+++ b/src/amd/compiler/aco_optimizer.cpp
@@ -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];

Reply via email to