mirror of
https://github.com/matrix-construct/construct
synced 2024-11-25 16:22:35 +01:00
ircd::info: Fix leaf for avx2/avx512f; additional tsc related.
This commit is contained in:
parent
d4b3a0db66
commit
ffecc8bd22
2 changed files with 20 additions and 7 deletions
|
@ -124,7 +124,7 @@ namespace ircd::info::hardware::x86
|
|||
extern const string_view vendor;
|
||||
extern const bool sse, sse2, sse3, ssse3, sse4a, sse4_1, sse4_2;
|
||||
extern const bool avx, avx2, avx512f;
|
||||
extern const bool tsc, tsc_constant;
|
||||
extern const bool tsc, tsc_constant, tsc_nonstop;
|
||||
}
|
||||
|
||||
namespace ircd::info::hardware::arm
|
||||
|
|
25
ircd/info.cc
25
ircd/info.cc
|
@ -175,7 +175,7 @@ ircd::info::dump_cpu_info_x86()
|
|||
const auto append{[&support]
|
||||
(const string_view &name, const bool &avail, const int &enable)
|
||||
{
|
||||
strlcat(support, fmt::bsprintf<64>
|
||||
strlcat(support, fmt::bsprintf<32>
|
||||
{
|
||||
" %s:%c%s",
|
||||
name,
|
||||
|
@ -193,7 +193,14 @@ ircd::info::dump_cpu_info_x86()
|
|||
append("avx", hardware::x86::avx, simd::support::avx);
|
||||
append("avx2", hardware::x86::avx2, simd::support::avx2);
|
||||
append("avx512f", hardware::x86::avx512f, simd::support::avx512f);
|
||||
append("constant_tsc", hardware::x86::tsc_constant, -1);
|
||||
|
||||
strlcat(support, fmt::bsprintf<32>
|
||||
{
|
||||
"%s%s%s",
|
||||
hardware::x86::tsc? " tsc": "",
|
||||
hardware::x86::tsc_constant? ":constant": "",
|
||||
hardware::x86::tsc_nonstop? ":nonstop": "",
|
||||
});
|
||||
|
||||
log::info
|
||||
{
|
||||
|
@ -415,25 +422,31 @@ ircd::info::hardware::x86::avx
|
|||
decltype(ircd::info::hardware::x86::avx2)
|
||||
ircd::info::hardware::x86::avx2
|
||||
{
|
||||
bool(features & (uint128_t(1) << (32 + 5)))
|
||||
bool(extended_features & (uint128_t(1) << (32 + 5)))
|
||||
};
|
||||
|
||||
decltype(ircd::info::hardware::x86::avx512f)
|
||||
ircd::info::hardware::x86::avx512f
|
||||
{
|
||||
bool(features & (uint128_t(1) << (32 + 16)))
|
||||
bool(extended_features & (uint128_t(1) << (32 + 16)))
|
||||
};
|
||||
|
||||
decltype(ircd::info::hardware::x86::tsc)
|
||||
ircd::info::hardware::x86::tsc
|
||||
{
|
||||
bool(features & (uint128_t(1) << 4))
|
||||
bool(features & (uint128_t(1) << (96 + 4)))
|
||||
};
|
||||
|
||||
decltype(ircd::info::hardware::x86::tsc_constant)
|
||||
ircd::info::hardware::x86::tsc_constant
|
||||
{
|
||||
bool(_apmi & (uint128_t(1) << (8)))
|
||||
bool(_apmi & (uint128_t(1) << (96 + 8)))
|
||||
};
|
||||
|
||||
decltype(ircd::info::hardware::x86::tsc_nonstop)
|
||||
ircd::info::hardware::x86::tsc_nonstop
|
||||
{
|
||||
bool(_apmi & (uint128_t(1) << (96 + 24)))
|
||||
};
|
||||
|
||||
#ifdef __x86_64__
|
||||
|
|
Loading…
Reference in a new issue