[PATCH 1/1] R600: Add fma and ldexp asic specific feature macros

Tom Stellard tom at stellard.net
Mon May 4 12:26:09 PDT 2015


On Mon, May 04, 2015 at 01:51:55PM -0400, Jan Vesely wrote:
> Signed-off-by: Jan Vesely <jan.vesely at rutgers.edu>
> ---
> 
> I don't have a preference for macro names, I just wanted to avoid CL spec names.
> 

LGTM.

> jan
> 
> PS: do we want these (this one and r236325) in 3.6?

Doing this would be useful if we can guarantee that libclc ToT will always be
compatible with llvm 3.6, and I don't think we have this guarantee.

-Tom
> 
>  lib/Basic/Targets.cpp | 18 +++++++++++++++++-
>  1 file changed, 17 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp
> index d253f7e..6d94623 100644
> --- a/lib/Basic/Targets.cpp
> +++ b/lib/Basic/Targets.cpp
> @@ -1695,7 +1695,9 @@ class R600TargetInfo : public TargetInfo {
>      GK_SEA_ISLANDS
>    } GPU;
>  
> -  bool hasFP64;
> +  bool hasFP64:1;
> +  bool hasFMAF:1;
> +  bool hasLDEXPF:1;
>  
>  public:
>    R600TargetInfo(const llvm::Triple &Triple)
> @@ -1705,10 +1707,14 @@ public:
>        DescriptionString = DescriptionStringSI;
>        GPU = GK_SOUTHERN_ISLANDS;
>        hasFP64 = true;
> +      hasFMAF = true;
> +      hasLDEXPF = true;
>      } else {
>        DescriptionString = DescriptionStringR600;
>        GPU = GK_R600;
>        hasFP64 = false;
> +      hasFMAF = false;
> +      hasLDEXPF = false;
>      }
>      AddrSpaceMap = &R600AddrSpaceMap;
>      UseAddrSpaceMapMangling = true;
> @@ -1755,6 +1761,10 @@ public:
>    void getTargetDefines(const LangOptions &Opts,
>                          MacroBuilder &Builder) const override {
>      Builder.defineMacro("__R600__");
> +    if (hasFMAF)
> +      Builder.defineMacro("__HAS_FMAF__");
> +    if (hasLDEXPF)
> +      Builder.defineMacro("__HAS_LDEXPF__");
>      if (hasFP64 && Opts.OpenCL) {
>        Builder.defineMacro("cl_khr_fp64");
>      }
> @@ -1816,6 +1826,8 @@ public:
>      case GK_NORTHERN_ISLANDS:
>        DescriptionString = DescriptionStringR600;
>        hasFP64 = false;
> +      hasFMAF = false;
> +      hasLDEXPF = false;
>        break;
>      case GK_R600_DOUBLE_OPS:
>      case GK_R700_DOUBLE_OPS:
> @@ -1823,11 +1835,15 @@ public:
>      case GK_CAYMAN:
>        DescriptionString = DescriptionStringR600DoubleOps;
>        hasFP64 = true;
> +      hasFMAF = true;
> +      hasLDEXPF = false;
>        break;
>      case GK_SOUTHERN_ISLANDS:
>      case GK_SEA_ISLANDS:
>        DescriptionString = DescriptionStringSI;
>        hasFP64 = true;
> +      hasFMAF = true;
> +      hasLDEXPF = true;
>        break;
>      }
>  
> -- 
> 2.1.0
> 
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits



More information about the cfe-commits mailing list