ac/nir: fix lsb emission
authorConnor Abbott <cwabbott0@gmail.com>
Tue, 1 Aug 2017 01:28:45 +0000 (18:28 -0700)
committerConnor Abbott <cwabbott0@gmail.com>
Tue, 1 Aug 2017 19:20:49 +0000 (12:20 -0700)
commit6d731c5651ea98551e0bf0c1a8896d5ea63558d5
treebeefc6739cba9b3fc3526ded00b042a4cb743dd4
parentde914615753678c5514733a37ac7d0360a43e525
ac/nir: fix lsb emission

This makes it match radeonsi. The LLVM backend itself will emit the
correct instruction, but LLVM might do incorrect optimizations since it
thinks the output is undefined when the input is 0, even though it's not
supposed to be. We really need a new intrinsic, or for the backend to
become smarter and recognize this pattern.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Bas Nieuwenhuizen <basni@google.com>
src/amd/common/ac_nir_to_llvm.c