[PATCH 3/5] R600: Move R600 scalar operations initialization to R600ISelLowering.cpp

Tom Stellard tom at stellard.net
Mon Apr 21 13:53:33 PDT 2014


On Sun, Apr 20, 2014 at 04:57:53PM -0400, Jan Vesely wrote:
> All these operations have vector instruction on SI+.
> 

Same comment as patch 1.

-Tom

> Signed-off-by: Jan Vesely <jan.vesely at rutgers.edu>
> ---
>  lib/Target/R600/AMDGPUISelLowering.cpp | 21 ++-------------------
>  lib/Target/R600/R600ISelLowering.cpp   | 10 ++++++++++
>  2 files changed, 12 insertions(+), 19 deletions(-)
> 
> diff --git a/lib/Target/R600/AMDGPUISelLowering.cpp b/lib/Target/R600/AMDGPUISelLowering.cpp
> index 18f10d4..386f854 100644
> --- a/lib/Target/R600/AMDGPUISelLowering.cpp
> +++ b/lib/Target/R600/AMDGPUISelLowering.cpp
> @@ -195,25 +195,8 @@ AMDGPUTargetLowering::AMDGPUTargetLowering(TargetMachine &TM) :
>      setOperationAction(ISD::XOR,  VT, Expand);
>    }
>  
> -  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::FABS, VT, Expand);
> -    setOperationAction(ISD::FADD, VT, Expand);
> -    setOperationAction(ISD::FDIV, VT, Expand);
> -    setOperationAction(ISD::FPOW, VT, Expand);
> -    setOperationAction(ISD::FFLOOR, VT, Expand);
> -    setOperationAction(ISD::FTRUNC, VT, Expand);
> -    setOperationAction(ISD::FMUL, VT, Expand);
> -    setOperationAction(ISD::FRINT, VT, Expand);
> -    setOperationAction(ISD::FSQRT, VT, Expand);
> -    setOperationAction(ISD::FSUB, VT, Expand);
> -    setOperationAction(ISD::SELECT, VT, Expand);
> -  }
> +  setOperationAction(ISD::SELECT, MVT::v2f32, Expand);
> +  setOperationAction(ISD::SELECT, MVT::v4f32, Expand);
>  
>    setTargetDAGCombine(ISD::MUL);
>  }
> diff --git a/lib/Target/R600/R600ISelLowering.cpp b/lib/Target/R600/R600ISelLowering.cpp
> index 80e2782..5157d3a 100644
> --- a/lib/Target/R600/R600ISelLowering.cpp
> +++ b/lib/Target/R600/R600ISelLowering.cpp
> @@ -146,6 +146,16 @@ R600TargetLowering::R600TargetLowering(TargetMachine &TM) :
>  
>    for (unsigned int x = 0; x < NumFloatTypes; ++x) {
>      MVT::SimpleValueType VT = FloatTypes[x];
> +    setOperationAction(ISD::FABS, VT, Expand);
> +    setOperationAction(ISD::FADD, VT, Expand);
> +    setOperationAction(ISD::FDIV, VT, Expand);
> +    setOperationAction(ISD::FPOW, VT, Expand);
> +    setOperationAction(ISD::FFLOOR, VT, Expand);
> +    setOperationAction(ISD::FTRUNC, VT, Expand);
> +    setOperationAction(ISD::FMUL, VT, Expand);
> +    setOperationAction(ISD::FRINT, VT, Expand);
> +    setOperationAction(ISD::FSQRT, VT, Expand);
> +    setOperationAction(ISD::FSUB, VT, Expand);
>      setOperationAction(ISD::FCOS, VT, Expand);
>      setOperationAction(ISD::FSIN, VT, Expand);
>    }
> -- 
> 1.9.0
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits



More information about the llvm-commits mailing list