OSDN Git Service

ac/nir: fix lsb emission
authorConnor Abbott <cwabbott0@gmail.com>
Tue, 1 Aug 2017 01:28:45 +0000 (18:28 -0700)
committerAndres Gomez <agomez@igalia.com>
Sat, 19 Aug 2017 10:46:04 +0000 (13:46 +0300)
commit7056362f8dfe2629c901de0b35315aa3aee0aec0
tree0e76fed532d6d250307cca6ad9fd8751a4c64a6a
parent2766ed0d45b2c3397de5cbdfa9cf7e03a0fdfb5d
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>
(cherry picked from commit 6d731c5651ea98551e0bf0c1a8896d5ea63558d5)
[Andres Gomez: nir_to_llvm_context not yet converted into ac_llvm_context]
Signed-off-by: Andres Gomez <agomez@igalia.com>
Conflicts:
src/amd/common/ac_nir_to_llvm.c
src/amd/common/ac_nir_to_llvm.c