Can you elaborate as to what the issue is? The dnz flag is set when we
want to make NaN -> Infinity. Do you have a concrete TGSI program that
triggers issues?
On Sat, Nov 24, 2018 at 6:04 PM Karol Herbst <[email protected]> wrote:
>
> fixes asserts with gallium nine
>
> Signed-off-by: Karol Herbst <[email protected]>
> ---
> src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
> b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
> index 04d26dcbf53..0a284572ede 100644
> --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
> +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
> @@ -557,6 +557,8 @@ ConstantFolding::expr(Instruction *i,
> case OP_MAD:
> case OP_FMA:
> case OP_MUL:
> + if (i->dnz && i->op != OP_MUL)
> + return;
> if (i->dnz && i->dType == TYPE_F32) {
> if (!isfinite(a->data.f32))
> a->data.f32 = 0.0f;
> @@ -1089,7 +1091,7 @@ ConstantFolding::opnd(Instruction *i, ImmediateValue
> &imm0, int s)
> i->src(0).mod = 0;
> i->setSrc(1, NULL);
> } else
> - if (!i->postFactor && (imm0.isInteger(2) || imm0.isInteger(-2))) {
> + if (!i->postFactor && !i->dnz && (imm0.isInteger(2) ||
> imm0.isInteger(-2))) {
> if (imm0.isNegative())
> i->src(t).mod = i->src(t).mod ^ Modifier(NV50_IR_MOD_NEG);
> i->op = OP_ADD;
> @@ -1120,7 +1122,7 @@ ConstantFolding::opnd(Instruction *i, ImmediateValue
> &imm0, int s)
> if (i->op != OP_CVT)
> i->src(0).mod = 0;
> } else
> - if (i->subOp != NV50_IR_SUBOP_MUL_HIGH &&
> + if (i->subOp != NV50_IR_SUBOP_MUL_HIGH && !i->dnz &&
> (imm0.isInteger(1) || imm0.isInteger(-1))) {
> if (imm0.isNegative())
> i->src(t).mod = i->src(t).mod ^ Modifier(NV50_IR_MOD_NEG);
> --
> 2.19.1
>
> _______________________________________________
> mesa-dev mailing list
> [email protected]
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
_______________________________________________
mesa-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-dev