[Mesa-dev] [PATCH 12/12] R600/SI: Add pattern to simplify i64 loading

Tom Stellard tom at stellard.net
Wed Feb 13 08:36:02 PST 2013


On Wed, Feb 13, 2013 at 11:24:24AM -0500, Tom Stellard wrote:
> On Tue, Feb 12, 2013 at 06:13:24PM +0100, Christian König wrote:
> > From: Christian König <christian.koenig at amd.com>
> > 
> > Signed-off-by: Christian König <christian.koenig at amd.com>
> > ---
> >  lib/Target/R600/SIInstrInfo.td    |    4 ++++
> >  lib/Target/R600/SIInstructions.td |    5 +++++
> >  2 files changed, 9 insertions(+)
> > 
> > diff --git a/lib/Target/R600/SIInstrInfo.td b/lib/Target/R600/SIInstrInfo.td
> > index efc6015..8c4e5af 100644
> > --- a/lib/Target/R600/SIInstrInfo.td
> > +++ b/lib/Target/R600/SIInstrInfo.td
> > @@ -40,6 +40,10 @@ def IMM12bit : ImmLeaf <
> >    [{return isUInt<12>(Imm);}]
> >  >;
> >  
> > +class InlineImm <ValueType vt> : ImmLeaf <vt, [{
> > +  return -16 <= Imm && Imm <= 64;
> > +}]>;
> > +
> 
> I don't understand what this is checking for:
> 
> -16 <= Imm && Imm <= 64
> 
> Can you explain this?
>

Michel just explained this to me, -16 to 64 is the range of inline
constants.

-Tom

> >  class InstSI <dag outs, dag ins, string asm, list<dag> pattern> :
> >      AMDGPUInst<outs, ins, asm, pattern> {
> >  
> > diff --git a/lib/Target/R600/SIInstructions.td b/lib/Target/R600/SIInstructions.td
> > index f7d5cbf..19ea414 100644
> > --- a/lib/Target/R600/SIInstructions.td
> > +++ b/lib/Target/R600/SIInstructions.td
> > @@ -1290,6 +1290,11 @@ def : Pat <
> >    (S_MOV_B32 fpimm:$imm)
> >  >;
> >  
> > +def : Pat <
> > +  (i64 InlineImm<i64>:$imm),
> > +  (S_MOV_B64 InlineImm<i64>:$imm)
> > +>;
> > +
> >  // i64 immediates aren't supported in hardware, split it into two 32bit values
> >  def : Pat <
> >    (i64 imm:$imm),
> > -- 
> > 1.7.9.5
> > 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list