[Mesa-dev] [PATCH v2] nvc0/ir: fix up an assertion in emitUADD()

Ilia Mirkin imirkin at alum.mit.edu
Sat Jul 23 22:40:20 UTC 2016


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

On Sat, Jul 23, 2016 at 6:39 PM, Samuel Pitoiset
<samuel.pitoiset at gmail.com> wrote:
> It's illegal to have neg modifiers on both sources for OP_ADD,
> and it's illegal to have OP_SUB with just src0 neg.
>
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
> ---
>  src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
>
> 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 1c3e519..8c9b867 100644
> --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp
> +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp
> @@ -698,16 +698,15 @@ CodeEmitterNVC0::emitUADD(const Instruction *i)
>     uint32_t addOp = 0;
>
>     assert(!i->src(0).mod.abs() && !i->src(1).mod.abs());
> -   assert(!i->src(0).mod.neg() || !i->src(1).mod.neg());
>
>     if (i->src(0).mod.neg())
>        addOp |= 0x200;
>     if (i->src(1).mod.neg())
>        addOp |= 0x100;
> -   if (i->op == OP_SUB) {
> +   if (i->op == OP_SUB)
>        addOp ^= 0x100;
> -      assert(addOp != 0x300); // would be add-plus-one
> -   }
> +
> +   assert(addOp != 0x300); // would be add-plus-one
>
>     if (i->encSize == 8) {
>        if (isLIMM(i->src(1), TYPE_U32)) {
> --
> 2.9.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list