[Mesa-dev] [PATCH] nvir/nvc0: fix CVT lowering for dType == sType
Ilia Mirkin
imirkin at alum.mit.edu
Tue Dec 5 14:34:42 UTC 2017
An in any case, CVT with stype == dtype is illegal - whatever
generates that should be fixed.
On Tue, Dec 5, 2017 at 9:23 AM, Karol Herbst <kherbst at redhat.com> wrote:
> uhh, seems like this code isn't in master yet, so ignore this please.
>
> On Tue, Dec 5, 2017 at 3:17 PM, Karol Herbst <kherbst at redhat.com> wrote:
>> The lowering code can't really handle that situation well and we just get away
>> with converting it to OP_MOV in this case.
>>
>> Signed-off-by: Karol Herbst <kherbst at redhat.com>
>> ---
>> src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp | 5 +++++
>> 1 file changed, 5 insertions(+)
>>
>> diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp
>> index b0834a8035..da2f979e66 100644
>> --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp
>> +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp
>> @@ -2808,6 +2808,11 @@ NVC0LoweringPass::handleCVT(Instruction *i)
>> if (isFloatType(i->dType) || isFloatType(i->sType))
>> return true;
>>
>> + if (i->dType == i->sType) {
>> + i->op = OP_MOV;
>> + return true;
>> + }
>> +
>> if (i->saturate && (typeSizeof(i->sType) > typeSizeof(i->dType))) {
>> if (isSignedIntType(i->sType) && !isSignedIntType(i->dType)) {
>> // Signed to unsigned: only need to clamp to 0
>> --
>> 2.14.3
>>
> _______________________________________________
> 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