[Mesa-dev] [PATCH 2/2] gk110/ir: add emission for (a OP b) OP c
Samuel Pitoiset
samuel.pitoiset at gmail.com
Tue Apr 26 17:25:09 UTC 2016
On 04/26/2016 07:19 PM, Ilia Mirkin wrote:
> Presumably this should also be CC'd to stable? I don't know when we'd
> emit something like that, but presumably it can happen.
Well, it's only used by the lowering pass for surfaces, so I'm not sure
if it's really required to backport it because surfaces were not really
supported before. But I'll send this patch to stable as well.
>
> Does the GM107 emitter handle this case?
I didn't check yet.
>
> In any case, this series is
>
> Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>
Thanks!
>
> On Tue, Apr 26, 2016 at 1:11 PM, Samuel Pitoiset
> <samuel.pitoiset at gmail.com> wrote:
>> This is pretty similar to NVC0 except that offsets have changed.
>>
>> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
>> ---
>> .../drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp | 26 ++++++++++++++++++++++
>> 1 file changed, 26 insertions(+)
>>
>> diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp
>> index 9027803..98e5a95 100644
>> --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp
>> +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp
>> @@ -784,6 +784,32 @@ CodeEmitterGK110::emitNOT(const Instruction *i)
>> void
>> CodeEmitterGK110::emitLogicOp(const Instruction *i, uint8_t subOp)
>> {
>> + if (i->def(0).getFile() == FILE_PREDICATE) {
>> + code[0] = 0x00000002 | (subOp << 27);
>> + code[1] = 0x84800000;
>> +
>> + emitPredicate(i);
>> +
>> + defId(i->def(0), 5);
>> + srcId(i->src(0), 14);
>> + if (i->src(0).mod == Modifier(NV50_IR_MOD_NOT)) code[0] |= 1 << 17;
>> + srcId(i->src(1), 32);
>> + if (i->src(1).mod == Modifier(NV50_IR_MOD_NOT)) code[1] |= 1 << 3;
>> +
>> + if (i->defExists(1)) {
>> + defId(i->def(1), 2);
>> + } else {
>> + code[0] |= 7 << 2;
>> + }
>> + // (a OP b) OP c
>> + if (i->predSrc != 2 && i->srcExists(2)) {
>> + code[1] |= subOp << 16;
>> + srcId(i->src(2), 42);
>> + if (i->src(2).mod == Modifier(NV50_IR_MOD_NOT)) code[1] |= 1 << 13;
>> + } else {
>> + code[1] |= 7 << 10;
>> + }
>> + } else
>> if (isLIMM(i->src(1), TYPE_S32)) {
>> emitForm_L(i, 0x200, 0, i->src(1).mod);
>> code[1] |= subOp << 24;
>> --
>> 2.8.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