[PATCH] D158329: [X86] Support arch=x86-64{,-v2,-v3,-v4} for target_clones attribute

Phoebe Wang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Aug 19 02:49:06 PDT 2023


pengfei added inline comments.


================
Comment at: clang/lib/CodeGen/CGBuiltin.cpp:13272
+  uint64_t Mask = llvm::X86::getCpuSupportsMask(FeatureStrs);
+  uint32_t FeaturesMask[4] = {uint32_t(Mask), uint32_t(Mask >> 32), 0, 0};
+  return EmitX86CpuSupports(FeaturesMask);
----------------
Use `Lo_32(Mask)`, `Hi_32(Mask)`?


================
Comment at: clang/lib/CodeGen/CGBuiltin.cpp:13318-13320
+    Value *Idxs[] = {Builder.getInt32(0), Builder.getInt32(i - 1)};
+    Value *Features = Builder.CreateAlignedLoad(
+        Int32Ty, Builder.CreateGEP(ATy, CpuFeatures2, Idxs),
----------------
Do we have problem when linking with old version of libgcc?


================
Comment at: compiler-rt/lib/builtins/cpu_model.c:808
+  if (HasExtLeaf1) {
+    if (ECX & 1)
+      setFeature(FEATURE_LAHF_LM);
----------------
Can we reuse bit defination in cpuid.h, e.g., `if (ECX & bit_LAHF_LM)`? The same below.


================
Comment at: compiler-rt/lib/builtins/cpu_model.c:808
+  if (HasExtLeaf1) {
+    if (ECX & 1)
+      setFeature(FEATURE_LAHF_LM);
----------------
pengfei wrote:
> Can we reuse bit defination in cpuid.h, e.g., `if (ECX & bit_LAHF_LM)`? The same below.
Can we reuse bit defination in cpuid.h, e.g., `if (ECX & bit_LAHF_LM)`? The same below.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D158329/new/

https://reviews.llvm.org/D158329



More information about the cfe-commits mailing list