Skip to content

Commit

Permalink
Feature clean up
Browse files Browse the repository at this point in the history
* Deprecated features
* Comments
* Update dependency and processor feature set
  • Loading branch information
yuyichao committed Jul 6, 2020
1 parent 8f6fe5d commit 9f83eaf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
9 changes: 4 additions & 5 deletions src/features_x86.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@ JL_FEATURE_DEF(bmi, 32 * 2 + 3, 0)
// JL_FEATURE_DEF(hle, 32 * 2 + 4, 0) // Not used and gone in LLVM 5.0
JL_FEATURE_DEF(avx2, 32 * 2 + 5, 0)
JL_FEATURE_DEF(bmi2, 32 * 2 + 8, 0)
// JL_FEATURE_DEF(invpcid, 32 * 2 + 10, 0) // Not used and gone in LLVM 5.0
// JL_FEATURE_DEF(invpcid, 32 * 2 + 10, 0) // Priviledged instruction
JL_FEATURE_DEF(rtm, 32 * 2 + 11, 0)
JL_FEATURE_DEF(mpx, 32 * 2 + 14, 0)
// Disable avx512 pre-5.0 since it can't handle address space
// JL_FEATURE_DEF(mpx, 32 * 2 + 14, 0) // Deprecated in LLVM 10.0
JL_FEATURE_DEF(avx512f, 32 * 2 + 16, 0)
JL_FEATURE_DEF(avx512dq, 32 * 2 + 17, 0)
JL_FEATURE_DEF(rdseed, 32 * 2 + 18, 0)
Expand All @@ -60,8 +59,8 @@ JL_FEATURE_DEF(pku, 32 * 3 + 4, 0) // ospke
JL_FEATURE_DEF(avx512vpopcntdq, 32 * 3 + 14, 0)

// EAX=7,ECX=0: EDX
// JL_FEATURE_DEF(avx512_4vnniw, 32 * 4 + 2, ?????)
// JL_FEATURE_DEF(avx512_4fmaps, 32 * 4 + 3, ?????)
// JL_FEATURE_DEF(avx5124vnniw, 32 * 4 + 2, ?????)
// JL_FEATURE_DEF(avx5124fmaps, 32 * 4 + 3, ?????)

// EAX=0x80000001: ECX
// ignore sahf on 32bit x86 since it is required
Expand Down
11 changes: 7 additions & 4 deletions src/processor_x86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,10 @@ static constexpr FeatureDep deps[] = {
{sse4a, sse3},
{xop, fma4},
{fma4, avx},
{fma4, sse4a}
{fma4, sse4a},
{xsaveopt, xsave},
{xsavec, xsave},
{xsaves, xsave},
};

// We require cx16 on 64bit by default. This can be overwritten with `-cx16`
Expand All @@ -152,7 +155,7 @@ constexpr auto generic = get_feature_masks(cx16);
constexpr auto bonnell = get_feature_masks(sse3, ssse3, cx16, movbe, sahf);
constexpr auto silvermont = bonnell | get_feature_masks(sse41, sse42, popcnt,
pclmul, aes, prfchw);
constexpr auto goldmont = silvermont | get_feature_masks(mpx, sha, rdrnd, rdseed, xsave,
constexpr auto goldmont = silvermont | get_feature_masks(sha, rdrnd, rdseed, xsave,
xsaveopt, xsavec, xsaves, clflushopt);
constexpr auto yonah = get_feature_masks(sse3);
constexpr auto prescott = yonah;
Expand All @@ -165,7 +168,7 @@ constexpr auto sandybridge = westmere | get_feature_masks(avx, xsave, xsaveopt);
constexpr auto ivybridge = sandybridge | get_feature_masks(rdrnd, f16c, fsgsbase);
constexpr auto haswell = ivybridge | get_feature_masks(avx2, bmi, bmi2, fma, lzcnt, movbe);
constexpr auto broadwell = haswell | get_feature_masks(adx, rdseed, prfchw);
constexpr auto skylake = broadwell | get_feature_masks(mpx, rtm, xsavec, xsaves,
constexpr auto skylake = broadwell | get_feature_masks(rtm, xsavec, xsaves,
clflushopt); // ignore sgx; hle
constexpr auto knl = broadwell | get_feature_masks(avx512f, avx512er, avx512cd, avx512pf,
prefetchwt1);
Expand All @@ -184,7 +187,7 @@ constexpr auto bdver1 = amdfam10 | get_feature_masks(xop, fma4, avx, ssse3, sse4
prfchw, pclmul, xsave, lwp);
constexpr auto bdver2 = bdver1 | get_feature_masks(f16c, bmi, tbm, fma);
constexpr auto bdver3 = bdver2 | get_feature_masks(xsaveopt, fsgsbase);
constexpr auto bdver4 = bdver3 | get_feature_masks(avx2, bmi2, mwaitx);
constexpr auto bdver4 = bdver3 | get_feature_masks(avx2, bmi2, mwaitx, movbe, rdrnd);

constexpr auto znver1 = haswell | get_feature_masks(adx, clflushopt, clzero, mwaitx, prfchw,
rdseed, sha, sse4a, xsavec, xsaves);
Expand Down

0 comments on commit 9f83eaf

Please sign in to comment.