search for: mkimm

Displaying 20 results from an estimated 45 matches for "mkimm".

2014 Jul 03
1
[PATCH v3 1/2] nv50/ir: Add support for the double Type to BuildUtil
...drivers/nouveau/codegen/nv50_ir_build_util.cpp 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,...
2017 Dec 20
2
[PATCH] gm107/ir: use lane 0 for manual textureGrad handling
.... + static const uint8_t qOps[2] = + { QUADOP(MOV2, ADD, MOV2, ADD), QUADOP(MOV2, MOV2, ADD, ADD) }; Value *def[4][4]; - Value *crd[3]; + Value *crd[3], *arr, *shadow; Value *tmp; Instruction *tex, *add; - Value *zero = bld.loadImm(bld.getSSA(), 0); + Value *quad = bld.mkImm(SHFL_BOUND_QUAD); int l, c; const int dim = i->tex.target.getDim() + i->tex.target.isCube(); const int array = i->tex.target.isArray(); @@ -115,35 +112,40 @@ GM107LoweringPass::handleManualTXD(TexInstruction *i) for (c = 0; c < dim; ++c) crd[c] = bld.getScratch(...
2015 Jan 09
3
[RESEND/PATCH] nv50/ir: Handle OP_CVT when folding constant expressions
...es.data.u16 = util_iround(CLAMP(imm0.reg.data.f64, 0, + UINT16_MAX)); + else + res.data.u16 = util_iround(imm0.reg.data.f64); + break; + default: + return; + } + i->setSrc(0, bld.mkImm(res.data.u16)); + break; + case TYPE_U32: + switch (i->sType) { + case TYPE_F32: + if (i->saturate) + res.data.u32 = util_iround(CLAMP(imm0.reg.data.f32, 0, + UINT32_MAX)); + else +...
2015 Jan 10
2
[PATCH v2] nv50/ir: Handle OP_CVT when folding constant expressions
...es.data.u16 = util_iround(CLAMP(imm0.reg.data.f32, 0, + UINT16_MAX)); + else + res.data.u16 = util_iround(imm0.reg.data.f32); + break; + default: + return; + } + i->setSrc(0, bld.mkImm(res.data.u16)); + break; + case TYPE_U32: + switch (i->sType) { + case TYPE_F32: + if (i->saturate) + res.data.u32 = util_iround(CLAMP(imm0.reg.data.f32, 0, + UINT32_MAX)); + else +...
2017 Dec 20
0
[PATCH] gm107/ir: use lane 0 for manual textureGrad handling
...; + { QUADOP(MOV2, ADD, MOV2, ADD), QUADOP(MOV2, MOV2, ADD, ADD) }; > Value *def[4][4]; > - Value *crd[3]; > + Value *crd[3], *arr, *shadow; > Value *tmp; > Instruction *tex, *add; > - Value *zero = bld.loadImm(bld.getSSA(), 0); > + Value *quad = bld.mkImm(SHFL_BOUND_QUAD); > int l, c; > const int dim = i->tex.target.getDim() + i->tex.target.isCube(); > const int array = i->tex.target.isArray(); > @@ -115,35 +112,40 @@ GM107LoweringPass::handleManualTXD(TexInstruction *i) > > for (c = 0; c < dim; ++c) &gt...
2014 Jul 05
1
[PATCH v4] nv50/ir: Handle OP_CVT when folding constant expressions
...u16 = (conv < 0) ? 0 : CLAMP((uint32_t)conv, 0, + UINT16_MAX); + } + else res.data.u16 = util_iround(imm0.reg.data.f64); + break; + default: + return; + } + i->setSrc(0, bld.mkImm(res.data.u16)); + break; + case TYPE_U32: + switch (i->sType) { + case TYPE_F32: + if (i->saturate) { + int32_t conv = util_iround(imm0.reg.data.f32); + res.data.u32 = (conv < 0) ? 0 : CLAMP((uint32_t)conv, 0, +...
2016 Sep 27
2
[PATCH] nv50/ir: constant fold OP_SPLIT
...type = (i->sType == TYPE_U32) ? TYPE_U16 : TYPE_S16; + } + if (i->sType == TYPE_U16 || i->sType == TYPE_S16) { + shift = 8; + type = (i->sType == TYPE_U16) ? TYPE_U8 : TYPE_S8; + } + if (type != TYPE_NONE) { + bld.mkMov(i->getDef(0), bld.mkImm(imm0.reg.data.u64 >> shift), type); + bld.mkMov(i->getDef(1), bld.mkImm(imm0.reg.data.u64), type); + delete_Instruction(prog, i); + } + } + break; case OP_MUL: if (i->dType == TYPE_F32) tryCollapseChainedMULs(i, s, imm0); -- 2.10.0
2015 Jan 05
0
[PATCH] nv50/ir: change the way float face is returned
...b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nv50.cpp @@ -1094,8 +1094,9 @@ NV50LoweringPreSSA::handleRDSV(Instruction *i) case SV_FACE: bld.mkInterp(NV50_IR_INTERP_FLAT, def, addr, NULL); if (i->dType == TYPE_F32) { - bld.mkOp2(OP_AND, TYPE_U32, def, def, bld.mkImm(0x80000000)); - bld.mkOp2(OP_XOR, TYPE_U32, def, def, bld.mkImm(0xbf800000)); + bld.mkOp2(OP_OR, TYPE_U32, def, def, bld.mkImm(0x00000001)); + bld.mkOp1(OP_NEG, TYPE_S32, def, def); + bld.mkCvt(OP_CVT, TYPE_F32, def, TYPE_S32, def); } break; case SV...
2014 Jul 03
0
[PATCH] nv50/ir: Handle OP_CVT when folding constant expressions
...e) { + case TYPE_U16: + switch (i->sType) { + case TYPE_F32: res.data.u16 = util_iround(imm0.reg.data.f32); break; + case TYPE_F64: res.data.u16 = util_iround(imm0.reg.data.f64); break; + default: + return; + } + i->setSrc(0, bld.mkImm(res.data.u16)); + break; + case TYPE_U32: + switch (i->sType) { + case TYPE_F32: res.data.u32 = util_iround(imm0.reg.data.f32); break; + case TYPE_F64: res.data.u32 = util_iround(imm0.reg.data.f64); break; + default: + return; + } +...
2016 Sep 30
2
[PATCH] nv50/ir: constant fold OP_SPLIT
...pe == TYPE_U16 || i->sType == TYPE_S16) { >> + shift = 8; >> + type = (i->sType == TYPE_U16) ? TYPE_U8 : TYPE_S8; >> + } > shift = typeSizeOf(i->dType); > >> + if (type != TYPE_NONE) { >> + bld.mkMov(i->getDef(0), bld.mkImm(imm0.reg.data.u64 >> shift), type); >> + bld.mkMov(i->getDef(1), bld.mkImm(imm0.reg.data.u64), type); > u64 val = ...u64; > for (d = 0; i->defExists(d); ++d) { > bld.mkMov(i->getDef(d), bld.mkImm(val & ((1 << shift) - 1)); > val >>= shi...
2015 Jan 11
0
[PATCH] nv50/ir: Handle OP_CVT when folding constant expressions
...res.data.u16 = util_iround(CLAMP(imm0.reg.data.f32, 0, + UINT16_MAX)); + else + res.data.u16 = util_iround(imm0.reg.data.f32); + break; + default: + return; + } + i->setSrc(0, bld.mkImm(res.data.u16)); + break; + case TYPE_U32: + assert(!i->saturate); + switch (i->sType) { + case TYPE_F32: + res.data.u32 = util_iround(imm0.reg.data.f32); + break; + default: + return; + } + i->set...
2014 Jul 06
0
[PATCH v5] nv50/ir: Handle OP_CVT when folding constant expressions
...es.data.u16 = util_iround(CLAMP(imm0.reg.data.f64, 0, + UINT16_MAX)); + else + res.data.u16 = util_iround(imm0.reg.data.f64); + break; + default: + return; + } + i->setSrc(0, bld.mkImm(res.data.u16)); + break; + case TYPE_U32: + switch (i->sType) { + case TYPE_F32: + if (i->saturate) + res.data.u32 = util_iround(CLAMP(imm0.reg.data.f32, 0, + UINT32_MAX)); + else +...
2015 Jan 11
0
[PATCH v2] nv50/ir: Handle OP_CVT when folding constant expressions
...the destination... whether it saturates or not. I don't hugely care though. > + else > + res.data.u16 = util_iround(imm0.reg.data.f32); > + break; > + default: > + return; > + } > + i->setSrc(0, bld.mkImm(res.data.u16)); > + break; > + case TYPE_U32: > + switch (i->sType) { > + case TYPE_F32: > + if (i->saturate) > + res.data.u32 = util_iround(CLAMP(imm0.reg.data.f32, 0, > +...
2015 Jan 10
0
[RESEND/PATCH] nv50/ir: Handle OP_CVT when folding constant expressions
....data.f64, 0, > + UINT16_MAX)); > + else > + res.data.u16 = util_iround(imm0.reg.data.f64); > + break; > + default: > + return; > + } > + i->setSrc(0, bld.mkImm(res.data.u16)); > + break; > + case TYPE_U32: > + switch (i->sType) { > + case TYPE_F32: > + if (i->saturate) > + res.data.u32 = util_iround(CLAMP(imm0.reg.data.f32, 0, > +...
2014 Sep 26
0
[PATCH] gm107/ir: take relative pfetch offset into account
...ing_gm107.cpp index 113f372..64989ac 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_gm107.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_gm107.cpp @@ -159,7 +159,10 @@ GM107LoweringPass::handlePFETCH(Instruction *i) bld.mkOp2(OP_SHR , TYPE_U32, tmp1, tmp0, bld.mkImm(16)); bld.mkOp2(OP_AND , TYPE_U32, tmp0, tmp0, bld.mkImm(0xff)); bld.mkOp2(OP_AND , TYPE_U32, tmp1, tmp1, bld.mkImm(0xff)); - bld.mkOp1(OP_MOV , TYPE_U32, tmp2, bld.mkImm(i->getSrc(0)->reg.data.u32)); + if (i->getSrc(1)) + bld.mkOp2(OP_ADD , TYPE_U32, tmp2, i->getSrc(0)...
2015 Jan 11
2
[PATCH v2] nv50/ir: Handle OP_CVT when folding constant expressions
On 11.01.2015 20:57, Ilia Mirkin wrote: > On Sun, Jan 11, 2015 at 2:56 PM, Tobias Klausmann > <tobias.johannes.klausmann at mni.thm.de> wrote: >> >> On 11.01.2015 20:19, Ilia Mirkin wrote: >>> On Sun, Jan 11, 2015 at 12:27 PM, Tobias Klausmann >>> <tobias.johannes.klausmann at mni.thm.de> wrote: >>>> >>>> On 11.01.2015 01:58,
2019 Oct 14
1
[PATCH] gm107/ir: fix loading z offset for layered 3d image bindings
...int32_t off, bool bindless { uint32_t base = slot * NVC0_SU_INFO__STRIDE; + // We don't upload surface info for bindless for GM107+ + assert(!bindless || targ->getChipset() < NVISA_GM107_CHIPSET); + if (ptr) { ptr = bld.mkOp2v(OP_ADD, TYPE_U32, bld.getSSA(), ptr, bld.mkImm(slot)); if (bindless) @@ -2204,7 +2207,7 @@ getDestType(const ImgType type) { } void -NVC0LoweringPass::convertSurfaceFormat(TexInstruction *su) +NVC0LoweringPass::convertSurfaceFormat(TexInstruction *su, Instruction **loaded) { const TexInstruction::ImgFormatDesc *format = su->t...
2014 Aug 08
2
[PATCH 1/3] nvc0/ir: add base tex offset for fermi indirect tex case
...Value *tscRel = i->getIndirectS(); - if (ticRel) + if (ticRel) { i->setSrc(i->tex.rIndirectSrc, NULL); - if (tscRel) + if (i->tex.r) + ticRel = bld.mkOp2v(OP_ADD, TYPE_U32, bld.getScratch(), + ticRel, bld.mkImm(i->tex.r)); + } + if (tscRel) { i->setSrc(i->tex.sIndirectSrc, NULL); + if (i->tex.s) + tscRel = bld.mkOp2v(OP_ADD, TYPE_U32, bld.getScratch(), + tscRel, bld.mkImm(i->tex.s)); + } Value *arrayIndex =...
2016 Sep 28
0
[PATCH] nv50/ir: constant fold OP_SPLIT
...} > + if (i->sType == TYPE_U16 || i->sType == TYPE_S16) { > + shift = 8; > + type = (i->sType == TYPE_U16) ? TYPE_U8 : TYPE_S8; > + } shift = typeSizeOf(i->dType); > + if (type != TYPE_NONE) { > + bld.mkMov(i->getDef(0), bld.mkImm(imm0.reg.data.u64 >> shift), type); > + bld.mkMov(i->getDef(1), bld.mkImm(imm0.reg.data.u64), type); u64 val = ...u64; for (d = 0; i->defExists(d); ++d) { bld.mkMov(i->getDef(d), bld.mkImm(val & ((1 << shift) - 1)); val >>= shift; } I think this will...
2016 Sep 30
0
[PATCH] nv50/ir: constant fold OP_SPLIT
..._S16) { >>> + shift = 8; >>> + type = (i->sType == TYPE_U16) ? TYPE_U8 : TYPE_S8; >>> + } >> >> shift = typeSizeOf(i->dType); >> >>> + if (type != TYPE_NONE) { >>> + bld.mkMov(i->getDef(0), bld.mkImm(imm0.reg.data.u64 >> shift), >>> type); >>> + bld.mkMov(i->getDef(1), bld.mkImm(imm0.reg.data.u64), type); >> >> u64 val = ...u64; >> for (d = 0; i->defExists(d); ++d) { >> bld.mkMov(i->getDef(d), bld.mkImm(val & ((1 << s...