[Mesa-dev] Removing unused opcodes (TGSI, Mesa IR)

Jose Fonseca jfonseca at vmware.com
Thu Nov 13 12:19:22 PST 2014

I've eliminated our internal dependency on TGSI_OPCODE_CND (by replacing SUB+CMP).   So you can commit the change to remove it as far as I'm concerned.

I have mixed feelings about ARR, because the operation it does is essentially an "iround()", i.e., "(int)roundf()", and at least when targeting x86, we can generate better code with the combination.

That said neither D3D10,  GLSL, or OpenCL C code has built-ins for iround(), so to be of benefit we'd need to do pattern matching.  So I'm not sure if it's worth to keep this around just for that...


From: Jose Fonseca
Sent: 13 November 2014 13:06
To: Eric Anholt; mesa-dev at lists.freedesktop.org
Subject: RE: [Mesa-dev] Removing unused opcodes (TGSI, Mesa IR)

Thanks for doing this.  It's has been long overdue.

Unfortunately we are relying on TGSI_OPCODE_CND/TGSI_OPCODE_ARR internally.  I'm also interested in cutting down used opcodes, so I'll try to replace their usage with something else.  But until then please hold on to those two patches.

The rest looks good AFAICT.

Concerning subroutines, we rely on BGNSUB/ENDSUB/CAL extensively.  They are quite convenient when translating D3D 9/10 shaders, which also have them.  And if one day we need to support recursive subroutines (CUDA 4.0 appears to have them; not sure about OpenCL, but I suppose it's only a matter of time), then they'll be unavoidable, as in-lining subroutines won't work anymore.


From: mesa-dev <mesa-dev-bounces at lists.freedesktop.org> on behalf of Eric Anholt <eric at anholt.net>
Sent: 13 November 2014 01:18
To: mesa-dev at lists.freedesktop.org
Subject: [Mesa-dev] Removing unused opcodes (TGSI, Mesa IR)

This series removes a bunch of unused opcodes, mostly from TGSI.  It
doesn't go as far as we could possibly go -- while I welcome discussion
for future patch series deleting more, I hope that discussion doesn't
derail the review process for these changes.

I haven't messed with the subroutine stuff, since I don't know what people
are planning with that.  I also haven't messed with the pack/unpack
opcodes in TGSI, since they might be useful for some of the GLSL packing

Testing status: compile-tested ilo/r600/softpipe, touch-tested softpipe.

mesa-dev mailing list
mesa-dev at lists.freedesktop.org

More information about the mesa-dev mailing list