[Mesa-dev] [PATCH] nvc0/lowering: Handle conversions to U64/S64 manually

Ilia Mirkin imirkin at alum.mit.edu
Sat Mar 19 22:41:31 UTC 2016


On Sat, Mar 19, 2016 at 6:36 PM, Pierre Moreau <pierre.morrow at free.fr> wrote:
> On 06:26 PM - Mar 19 2016, Ilia Mirkin wrote:
>> On Sat, Mar 19, 2016 at 6:26 PM, Pierre Moreau <pierre.morrow at free.fr> wrote:
>> > However, you could have some `long bar; char foo = convert_char_sat(bar);` in
>> > the OpenCL kernel.
>>
>> Sure, but the SPIR-V -> nv50/ir converter could be smarter about when
>> it generates the converts, no?
>
> It should be possible, but then I'm unsure what ends up in the SPIR-V ->
> nv50/ir converter and what ends up in the nv50/ir backend. Should I also do
> constant folding in the converter? I was assuming the backend would take care
> of the optimisations, removing useless converts, but maybe my assumptions were
> wrong and I have to take care of more things than just translating from SPIR-V
> to nv50/ir?

Well, the nv50 ir is not a well-specified IR. So it's kind of up to us
what to do. However if the hw hates converts with src/dst types like
that, I'm perfectly happy to decree that such converts shall never
make it into the IR. That said, if you feel strongly about it, we can
leave it as a fix-up pass. What about nv50, need the same logic there
too right?

  -ilia


More information about the mesa-dev mailing list