[PATCH 1/5] R600: Expand vector sin and cos on r600.

Jan Vesely jan.vesely at rutgers.edu
Mon Apr 21 18:16:15 PDT 2014


On Mon, 2014-04-21 at 13:51 -0700, Tom Stellard wrote:
> On Sun, Apr 20, 2014 at 04:57:51PM -0400, Jan Vesely wrote:
> > Signed-off-by: Jan Vesely <jan.vesely at rutgers.edu>
> > ---
> >  lib/Target/R600/R600ISelLowering.cpp | 11 +++++++++++
> >  1 file changed, 11 insertions(+)
> > 
> > diff --git a/lib/Target/R600/R600ISelLowering.cpp b/lib/Target/R600/R600ISelLowering.cpp
> > index ecffee2..a6304d8 100644
> > --- a/lib/Target/R600/R600ISelLowering.cpp
> > +++ b/lib/Target/R600/R600ISelLowering.cpp
> > @@ -141,6 +141,17 @@ R600TargetLowering::R600TargetLowering(TargetMachine &TM) :
> >    setTargetDAGCombine(ISD::SELECT_CC);
> >    setTargetDAGCombine(ISD::INSERT_VECTOR_ELT);
> >  
> > +  static const MVT::SimpleValueType FloatTypes[] = {
> > +    MVT::v2f32, MVT::v4f32
> > +  };
> > +  const size_t NumFloatTypes = array_lengthof(FloatTypes);
> > +
> > +  for (unsigned int x = 0; x < NumFloatTypes; ++x) {
> > +    MVT::SimpleValueType VT = FloatTypes[x];
> > +    setOperationAction(ISD::FCOS, VT, Expand);
> > +    setOperationAction(ISD::FSIN, VT, Expand);
> > +  }
> > +
> 
> There actually aren't vector instructions for these on SI, so this
> should go in AMDGPUISelLowering.cpp.  It's confusing because the instructions
> V_SIN_F32 and V_COS_F32 are 'Vector Instructions', but in this case it means they
> execute on a vector of work items, and each work item provides scalar input.

So there's no way to make vector elements to work items, and execute
only one instruction? I should read the specs more carefully.

I've attached v2, simplified and squashed with tests(including SI).

regards,
Jan

> 
> -Tom
> 
> >    setOperationAction(ISD::GlobalAddress, MVT::i32, Custom);
> >  
> >    setBooleanContents(ZeroOrNegativeOneBooleanContent);
> > -- 
> > 1.9.0
> > 
> > _______________________________________________
> > llvm-commits mailing list
> > llvm-commits at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

-- 
Jan Vesely <jan.vesely at rutgers.edu>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-R600-Expand-vector-sin-and-cos.patch
Type: text/x-patch
Size: 5524 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140421/dfdab3d1/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140421/dfdab3d1/attachment.sig>


More information about the llvm-commits mailing list