diff options
author | Ilia Mirkin <[email protected]> | 2015-12-01 20:35:19 -0500 |
---|---|---|
committer | Ilia Mirkin <[email protected]> | 2015-12-02 18:51:15 -0500 |
commit | ff61ac48387d3f42ede50a572c11f404f4cd3abb (patch) | |
tree | eaf52ba8091929c835cbb3230289d117bf406348 /src/gallium/drivers/nouveau | |
parent | 52a800a687ee68483fe7cd83b137630b74e2127b (diff) |
nvc0/ir: fold postfactor into immediate
SM20-SM50 can't emit a post-factor in the presence of a long immediate.
Make sure to fold it in.
Signed-off-by: Ilia Mirkin <[email protected]>
Cc: "11.0 11.1" <[email protected]>
Diffstat (limited to 'src/gallium/drivers/nouveau')
-rw-r--r-- | src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp index 0f1dcf0dacd..9c42e4a7e01 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp @@ -858,6 +858,12 @@ ConstantFolding::opnd(Instruction *i, ImmediateValue &imm0, int s) i->src(0).mod = i->src(t).mod; i->setSrc(1, new_ImmediateValue(prog, imm0.reg.data.u32)); i->src(1).mod = 0; + } else + if (i->postFactor && i->sType == TYPE_F32) { + /* Can't emit a postfactor with an immediate, have to fold it in */ + i->setSrc(s, new_ImmediateValue( + prog, imm0.reg.data.f32 * exp2f(i->postFactor))); + i->postFactor = 0; } break; case OP_MAD: |