[Mesa-dev] [PATCH 10/12] R600/SI: cleanup literal handling

Tom Stellard tom at stellard.net
Wed Feb 13 08:21:40 PST 2013


On Wed, Feb 13, 2013 at 10:34:12AM +0100, Christian König wrote:
> Am 13.02.2013 01:39, schrieb Tom Stellard:
> > [SNIP]
> >
> > Way back when I first started working on the backend I was using
> > immediate operands in instructions defined to only uses registers, and
> > it worked most of the time, but I ran into a few cases where some of the
> > passes weren't able to handle it.  So, I'm actually kind of surprised that this
> > works, but it's a nice simplification in any case.
> 
> I stumbled over a couple of problems while coding it, but they were not 
> related to the fact that I tried to put immediate values into operands 
> that should only have registers. It was more that it surfaced a couple 
> of other problems, for example we shouldn't use f64 as supported type in 
> a RegisterClass and then forget to set a default class for f64 with 
> "addRegisterClass", that can lead to a whole bunch of problems, 
> including segfaults.
>

It's highly likely that when I implemented it in the past, it was
uncovering bugs rather than causing them.  It will still pretty unstable
at that point.

> Actually when you look into the MCOperandInfo class the only difference 
> between an immediate operand and an register operand is that registers 
> have a RegClass. Apart from that this information is only available at 
> pattern matching time, and there it doesn't seems to matter.
> 

The OpInfo information is stored in the MCInstrDesc object for each
instruction, so it can be accessed after pattern matching too, however
it looks like the only pass that does this is the MachineVerification
pass, so it looks like this won't be an issue.

-Tom


More information about the mesa-dev mailing list