[Mesa-stable] [Mesa-dev] [PATCH] nvc0/ir: fix emission of IMAD with NEG modifiers

Ilia Mirkin imirkin at alum.mit.edu
Wed Oct 26 21:12:22 UTC 2016


Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>

On Wed, Oct 26, 2016 at 5:10 PM, Samuel Pitoiset
<samuel.pitoiset at gmail.com> wrote:
> The emitter tried to emit sub instead of subr when src0 has
> actually a NEG modifier.
>
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
> Cc: "11.0 12.0 13.0" <mesa-stable at lists.freedesktop.org>
> ---
>  src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp | 2 +-
>  src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp  | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp
> index ff8d777..123ec5c 100644
> --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp
> +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp
> @@ -726,7 +726,7 @@ void
>  CodeEmitterGK110::emitIMAD(const Instruction *i)
>  {
>     uint8_t addOp =
> -      (i->src(2).mod.neg() << 1) | (i->src(0).mod.neg() ^ i->src(1).mod.neg());
> +      i->src(2).mod.neg() | ((i->src(0).mod.neg() ^ i->src(1).mod.neg()) << 1);
>
>     emitForm_21(i, 0x100, 0xa00);
>
> diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp
> index e8ee5f7..ef06939 100644
> --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp
> +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp
> @@ -736,7 +736,7 @@ void
>  CodeEmitterNVC0::emitIMAD(const Instruction *i)
>  {
>     uint8_t addOp =
> -      (i->src(2).mod.neg() << 1) | (i->src(0).mod.neg() ^ i->src(1).mod.neg());
> +      i->src(2).mod.neg() | ((i->src(0).mod.neg() ^ i->src(1).mod.neg()) << 1);
>
>     assert(i->encSize == 8);
>     emitForm_A(i, HEX64(20000000, 00000003));
> --
> 2.10.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-stable mailing list