search for: immediatevalue

Displaying 20 results from an estimated 54 matches for "immediatevalue".

2014 Jul 03
1
[PATCH v3 1/2] nv50/ir: Add support for the double Type to BuildUtil
...b/src/gallium/drivers/nouveau/codegen/nv50_ir_build_util.cpp index 6d9c830..44daece 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_build_util.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_build_util.cpp @@ -391,6 +391,17 @@ BuildUtil::mkImm(float f) return mkImm(u.u32); } +ImmediateValue * +BuildUtil::mkImm(double f) +{ + union { + double f64; + uint64_t u64; + } u; + u.f64 = f; + return mkImm(u.u64); +} + Value * BuildUtil::loadImm(Value *dst, float f) { @@ -398,6 +409,12 @@ BuildUtil::loadImm(Value *dst, float f) } Value * +BuildUtil::loadImm(Value *dst,...
2016 Oct 02
2
[PATCH] nv50/ir: Propagate third immediate src when folding OP_MAD
...n/nv50_ir_peephole.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp index 9875738..8bb5cf9 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp @@ -1008,13 +1008,22 @@ ConstantFolding::opnd(Instruction *i, ImmediateValue &imm0, int s) break; case OP_MAD: if (imm0.isInteger(0)) { + ImmediateValue imm1; i->setSrc(0, i->getSrc(2)); i->src(0).mod = i->src(2).mod; i->setSrc(1, NULL); i->setSrc(2, NULL); - i->op = i->src...
2015 Mar 25
0
[PATCH] nv50/ir: take postFactor into account when doing peephole optimizations
...->data.f64 * b->data.f64; break; case TYPE_S32: if (i->subOp == NV50_IR_SUBOP_MUL_HIGH) { @@ -579,6 +581,7 @@ ConstantFolding::expr(Instruction *i, i->src(0).mod = Modifier(0); i->src(1).mod = Modifier(0); + i->postFactor = 0; i->setSrc(0, new_ImmediateValue(i->bb->getProgram(), res.data.u32)); i->setSrc(1, NULL); @@ -682,7 +685,7 @@ ConstantFolding::tryCollapseChainedMULs(Instruction *mul2, Instruction *insn; Instruction *mul1 = NULL; // mul1 before mul2 int e = 0; - float f = imm2.reg.data.f32; + float f = imm2.reg.data.f...
2017 Apr 29
5
[PATCH v2] nv50/ir: optimize shl(a, 0) to a
...0_ir_peephole.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp index 015def0391..82da0d3e48 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp @@ -1284,6 +1284,13 @@ ConstantFolding::opnd(Instruction *i, ImmediateValue &imm0, int s) case OP_SHL: { + if (s == 1 && imm0.isInteger(0)) { + i->op = i->src(0).mod.getOp(); + if (i->op != OP_CVT) + i->src(0).mod = 0; + i->setSrc(1, NULL); + break; + } if (s != 1 || i->src(...
2017 Apr 29
3
[PATCH] nv50/ir: optimmize shl(a, 0) to a
...0_ir_peephole.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp index 015def0391..a2446e4df8 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp @@ -1284,6 +1284,11 @@ ConstantFolding::opnd(Instruction *i, ImmediateValue &imm0, int s) case OP_SHL: { + if (s == 1 && imm0.isInteger(0)) { + i->op = OP_MOV; + i->setSrc(1, NULL); + break; + } if (s != 1 || i->src(0).mod != Modifier(0)) break; // try to concatenate shifts -- 2.12.2
2016 Oct 02
2
[PATCH] nv50/ir: Propagate third immediate src when folding OP_MAD
.../drivers/nouveau/codegen/nv50_ir_peephole.cpp >> index 9875738..8bb5cf9 100644 >> --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp >> +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp >> @@ -1008,13 +1008,22 @@ ConstantFolding::opnd(Instruction *i, ImmediateValue &imm0, int s) >> break; >> case OP_MAD: >> if (imm0.isInteger(0)) { >> + ImmediateValue imm1; >> i->setSrc(0, i->getSrc(2)); >> i->src(0).mod = i->src(2).mod; >> i->setSrc(1, N...
2016 Sep 30
2
[PATCH v2] nv50/ir: constant fold OP_SPLIT
...egen/nv50_ir_peephole.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp index 9875738..d56b057 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp @@ -932,6 +932,22 @@ ConstantFolding::opnd(Instruction *i, ImmediateValue &imm0, int s) Instruction *newi = i; switch (i->op) { + case OP_SPLIT: { + uint8_t size = typeSizeof(i->dType); + DataType type = typeOfSize(size / 2, isFloatType(i->dType), + isSignedType(i->dType)); + if (likely(type != TY...
2015 Jan 11
2
[PATCH] nv50/ir: Handle OP_CVT when folding constant expressions
...e.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp > index 21d20ca..aaf0d0d 100644 > --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp > +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp > @@ -997,6 +997,79 @@ ConstantFolding::opnd(Instruction *i, ImmediateValue &imm0, int s) > i->op = OP_MOV; > break; > } > + case OP_CVT: { > + Storage res; > + bld.setPosition(i, true); /* make sure bld is init'ed */ > + switch(i->dType) { > + case TYPE_U16: > + switch (i->sType) {...
2015 May 09
5
[PATCH 1/4] nvc0/ir: avoid jumping to a sched instruction
Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu> --- Pretty sure there's nothing wrong with it, but it looks odd in the code. src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp | 2 ++ src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gm107.cpp | 7 +++++-- src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp | 2 ++ 3 files changed, 9 insertions(+), 2 deletions(-)
2016 Sep 27
2
[PATCH] nv50/ir: constant fold OP_SPLIT
...egen/nv50_ir_peephole.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp index 74a5a85..fdddd71 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp @@ -920,6 +920,29 @@ ConstantFolding::opnd(Instruction *i, ImmediateValue &imm0, int s) Instruction *newi = i; switch (i->op) { + case OP_SPLIT: { + uint16_t shift = 0; + DataType type = TYPE_NONE; + bld.setPosition(i, false); + if (i->sType == TYPE_U64 || i->sType == TYPE_S64) { + shift = 32; + type = (i->s...
2014 Jun 03
8
[PATCH v2 0/4] Constant folding of new Instructions
And another try for constant folding of Instructions for nvc0. Please Review this! Thanks, Tobias Klausmann Tobias Klausmann (4): nvc0/ir: clear subop when folding constant expressions nvc0/ir: Handle reverse subop for OP_EXTBF when folding constant expressions nvc0/ir: Handle OP_BFIND when folding constant expressions nvc0/ir: Handle OP_POPCNT when folding constant expressions
2016 Sep 30
2
[PATCH] nv50/ir: constant fold OP_SPLIT
...ium/drivers/nouveau/codegen/nv50_ir_peephole.cpp >> index 74a5a85..fdddd71 100644 >> --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp >> +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp >> @@ -920,6 +920,29 @@ ConstantFolding::opnd(Instruction *i, ImmediateValue &imm0, int s) >> Instruction *newi = i; >> >> switch (i->op) { >> + case OP_SPLIT: { >> + uint16_t shift = 0; >> + DataType type = TYPE_NONE; >> + bld.setPosition(i, false); >> + if (i->sType == TYPE_U64 || i-...
2015 May 09
2
[PATCH 3/4] nvc0/ir: optimize set & 1.0 to produce boolean-float sets
...e.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp > index 14446b6..d8af19a 100644 > --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp > +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp > @@ -973,6 +973,35 @@ ConstantFolding::opnd(Instruction *i, ImmediateValue &imm0, int s) > } > break; > > + case OP_AND: > + { > + CmpInstruction *cmp = i->getSrc(t)->getInsn()->asCmp(); > + if (!cmp || cmp->op == OP_SLCT) how about if (cmp == NULL || ...) and kill the same condition later? > +...
2014 May 18
1
[PATCH 1/2] nv50/ir: fix s32 x s32 -> high s32 multiply logic
Retrieving the high 32 bits of a signed multiply is rather annoying. It appears that the simplest way to do this is to compute the absolute value of the arguments, and perform a u32 x u32 -> u64 operation. If the arguments' signs differ, then negate the result. Since there is no u64 support in the cvt instruction, we have the perform the 2's complement negation "by hand".
2016 Oct 02
0
[PATCH] nv50/ir: Propagate third immediate src when folding OP_MAD
...pp b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp > index 9875738..8bb5cf9 100644 > --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp > +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp > @@ -1008,13 +1008,22 @@ ConstantFolding::opnd(Instruction *i, ImmediateValue &imm0, int s) > break; > case OP_MAD: > if (imm0.isInteger(0)) { > + ImmediateValue imm1; > i->setSrc(0, i->getSrc(2)); > i->src(0).mod = i->src(2).mod; > i->setSrc(1, NULL); > i->setSrc(...
2015 Jan 04
0
[PATCH] nv50/ir: fix texture offsets in release builds
...7612e 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nv50.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nv50.cpp @@ -772,7 +772,8 @@ NV50LoweringPreSSA::handleTEX(TexInstruction *i) if (i->tex.useOffsets) { for (int c = 0; c < 3; ++c) { ImmediateValue val; - assert(i->offset[0][c].getImmediate(val)); + if (!i->offset[0][c].getImmediate(val)) + assert(!"non-immediate offset"); i->tex.offset[c] = val.reg.data.u32; i->offset[0][c].set(NULL); } diff --git a/src/gallium/drive...
2015 Jan 11
2
[PATCH] nv50/ir: Handle OP_CVT when folding constant expressions
...eau/codegen/nv50_ir_peephole.cpp >>> index 21d20ca..aaf0d0d 100644 >>> --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp >>> +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp >>> @@ -997,6 +997,79 @@ ConstantFolding::opnd(Instruction *i, ImmediateValue >>> &imm0, int s) >>> i->op = OP_MOV; >>> break; >>> } >>> + case OP_CVT: { >>> + Storage res; >>> + bld.setPosition(i, true); /* make sure bld is init'ed */ >>> + switch(i->d...
2015 Jan 11
2
[PATCH v2] nv50/ir: Handle OP_CVT when folding constant expressions
...741c74f 100644 >>>>>> --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp >>>>>> +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp >>>>>> @@ -997,6 +997,87 @@ ConstantFolding::opnd(Instruction *i, >>>>>> ImmediateValue >>>>>> &imm0, int s) >>>>>> i->op = OP_MOV; >>>>>> break; >>>>>> } >>>>>> + case OP_CVT: { >>>>>> + Storage res; >>>>>> + bld.s...
2015 Jan 11
2
[PATCH v2] nv50/ir: Handle OP_CVT when folding constant expressions
..._ir_peephole.cpp >>>> index 9a0bb60..741c74f 100644 >>>> --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp >>>> +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp >>>> @@ -997,6 +997,87 @@ ConstantFolding::opnd(Instruction *i, ImmediateValue >>>> &imm0, int s) >>>> i->op = OP_MOV; >>>> break; >>>> } >>>> + case OP_CVT: { >>>> + Storage res; >>>> + bld.setPosition(i, true); /* make sure bld is init'ed */ &gt...
2015 Jan 11
2
[PATCH v2] nv50/ir: Handle OP_CVT when folding constant expressions
...ium/drivers/nouveau/codegen/nv50_ir_peephole.cpp >> index 9a0bb60..741c74f 100644 >> --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp >> +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp >> @@ -997,6 +997,87 @@ ConstantFolding::opnd(Instruction *i, ImmediateValue &imm0, int s) >> i->op = OP_MOV; >> break; >> } >> + case OP_CVT: { >> + Storage res; >> + bld.setPosition(i, true); /* make sure bld is init'ed */ >> + switch(i->dType) { >> + case TYPE_U16: &g...