[PATCH] [1/2] Adding a feature flag for TBM instruction set

Anton Korobeynikov anton at korobeynikov.info
Tue Sep 17 11:29:35 PDT 2013


Please submit both flag / feature set and the actual user of this flag.

On Tue, Sep 17, 2013 at 10:25 PM, Yunzhong Gao
<Yunzhong_Gao at playstation.sony.com> wrote:
> ygao added you to the CC list for the revision "[1/2] Adding a feature flag for TBM instruction set".
>
> Hi,
> This patch adds a feature flag to the llvm backend for x86 TBM instruction set (to be added later). Could someone take a look whether this is good to go in?
> Many thanks,
> - Gao.
>
> http://llvm-reviews.chandlerc.com/D1692
>
> Files:
>   lib/Target/X86/X86Subtarget.h
>   lib/Target/X86/X86Subtarget.cpp
>   lib/Target/X86/X86.td
>
> Index: lib/Target/X86/X86Subtarget.h
> ===================================================================
> --- lib/Target/X86/X86Subtarget.h
> +++ lib/Target/X86/X86Subtarget.h
> @@ -97,6 +97,9 @@
>    /// HasXOP - Target has XOP instructions
>    bool HasXOP;
>
> +  /// HasTBM - Target has TBM instructions.
> +  bool HasTBM;
> +
>    /// HasMOVBE - True if the processor has the MOVBE instruction.
>    bool HasMOVBE;
>
> @@ -271,6 +274,7 @@
>    // FIXME: Favor FMA when both are enabled. Is this the right thing to do?
>    bool hasFMA4() const { return HasFMA4 && !HasFMA; }
>    bool hasXOP() const { return HasXOP; }
> +  bool hasTBM() const { return HasTBM; }
>    bool hasMOVBE() const { return HasMOVBE; }
>    bool hasRDRAND() const { return HasRDRAND; }
>    bool hasF16C() const { return HasF16C; }
> Index: lib/Target/X86/X86Subtarget.cpp
> ===================================================================
> --- lib/Target/X86/X86Subtarget.cpp
> +++ lib/Target/X86/X86Subtarget.cpp
> @@ -376,6 +376,10 @@
>          ToggleFeature(X86::FeatureCDI);
>        }
>      }
> +    if (IsAMD && ((ECX >> 21) & 0x1)) {
> +      HasTBM = true;
> +      ToggleFeature(X86::FeatureTBM);
> +    }
>    }
>  }
>
> @@ -484,6 +488,7 @@
>    HasFMA = false;
>    HasFMA4 = false;
>    HasXOP = false;
> +  HasTBM = false;
>    HasMOVBE = false;
>    HasRDRAND = false;
>    HasF16C = false;
> Index: lib/Target/X86/X86.td
> ===================================================================
> --- lib/Target/X86/X86.td
> +++ lib/Target/X86/X86.td
> @@ -117,6 +117,8 @@
>  def FeatureAES     : SubtargetFeature<"aes", "HasAES", "true",
>                                        "Enable AES instructions",
>                                        [FeatureSSE2]>;
> +def FeatureTBM     : SubtargetFeature<"tbm", "HasTBM", "true",
> +                                      "Enable TBM instructions">;
>  def FeatureMOVBE   : SubtargetFeature<"movbe", "HasMOVBE", "true",
>                                        "Support MOVBE instruction">;
>  def FeatureRDRAND  : SubtargetFeature<"rdrnd", "HasRDRAND", "true",
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>



-- 
With best regards, Anton Korobeynikov
Faculty of Mathematics and Mechanics, Saint Petersburg State University



More information about the llvm-commits mailing list