[Mesa-dev] TGSI declarations missing type info

Keith Whitwell keithw at vmware.com
Mon Nov 14 01:44:49 PST 2011


On Mon, 2011-11-14 at 09:42 +0000, Keith Whitwell wrote:
> On Sun, 2011-11-13 at 14:43 -0600, Bryan Cain wrote:
> > On 11/13/2011 09:06 AM, Dave Airlie wrote:
> > > Hi guys,
> > >
> > > Just been looking at llvmpipe integer support and it seems like we
> > > lose some information about the type of data stored into temporaries,
> > >
> > > after st_glsl_to_cpp we no longer know what type the temporaries are,
> > > and llvm would really like to know and I can't see any reason that
> > > TGSI doesn't contain the info. Having untyped temp decls means we'd
> > > have to allocate some sort of "union" via aliases I guess in llvmpipe
> > > for all temps so we can store int/float in them.
> > >
> > > I've attached a run of glsl-vs-loop from llvmpipe with integer opcodes
> > > forced on. (llvmpipe-int-test branch of my repo).
> > >
> > > Dave.
> > 
> > If you do add types to TGSI registers, it's worth noting that the
> > internal IR used by glsl_to_tgsi (glsl_to_tgsi_instruction) already the
> > types of all src and dst registers, and it's only lost when converting
> > that to TGSI.  However, it was only intended to be good enough to
> > determine whether to emit an integer or float instruction, so there
> > might be some mistakes remaining somewhere that would need to be corrected.
> > 
> 
> I'd certainly support the idea of adding type information to TGSI.  It
> would mean that any SM4-to-TGSI translator would have to do type
> inference, but afaik SM4 is the only place where that would have to
> happen -- all other potential sources of TGSI either have type
> information (like IR as noted above), or are pretty much float-only
> (like SM3).  

Note I'm mainly posting this because I previously held the opposite view
fairly strongly & wanted to make sure that nobody feels they need to
keep on considering that...

Keith 



More information about the mesa-dev mailing list