dsh-remote 0.8.47 → 0.8.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/client.js +89 -16
- package/lib/ignore.js +46 -0
- package/lib/index.js +68 -23
- package/lib/remote-shell-child.cjs +305 -0
- package/lib/remote-shell.js +518 -0
- package/lib/search.js +8 -3
- package/package.json +1 -1
- package/node_modules/buildcheck/.eslintrc.js +0 -5
- package/node_modules/buildcheck/.github/workflows/ci.yml +0 -88
- package/node_modules/buildcheck/.github/workflows/lint.yml +0 -27
- package/node_modules/buildcheck/.npmignore +0 -3
- package/node_modules/buildcheck/LICENSE +0 -19
- package/node_modules/buildcheck/README.md +0 -106
- package/node_modules/buildcheck/deps/Find-VisualStudio.cs +0 -250
- package/node_modules/buildcheck/lib/findvs.js +0 -361
- package/node_modules/buildcheck/lib/index.js +0 -738
- package/node_modules/buildcheck/package.json +0 -36
- package/node_modules/buildcheck/test/test.js +0 -8
- package/node_modules/cpu-features/.eslintrc.js +0 -5
- package/node_modules/cpu-features/.github/workflows/ci.yml +0 -74
- package/node_modules/cpu-features/.github/workflows/lint.yml +0 -27
- package/node_modules/cpu-features/LICENSE +0 -19
- package/node_modules/cpu-features/README.md +0 -59
- package/node_modules/cpu-features/binding.gyp +0 -16
- package/node_modules/cpu-features/buildcheck.js +0 -32
- package/node_modules/cpu-features/deps/cpu_features/.clang-format +0 -4
- package/node_modules/cpu-features/deps/cpu_features/.dockerignore +0 -31
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/Dockerfile +0 -5
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/aarch64_linux_cmake.yml +0 -30
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/amd64_freebsd_cmake.yml +0 -22
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/amd64_linux_bazel.yml +0 -26
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/amd64_linux_cmake.yml +0 -31
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/amd64_macos_cmake.yml +0 -43
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/amd64_windows_cmake.yml +0 -25
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/arm_linux_cmake.yml +0 -31
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/clang_format.yml +0 -24
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/mips_linux_cmake.yml +0 -30
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/power_linux_cmake.yml +0 -29
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/riscv_linux_cmake.yml +0 -28
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/s390x_linux_cmake.yml +0 -27
- package/node_modules/cpu-features/deps/cpu_features/.grenrc.yml +0 -21
- package/node_modules/cpu-features/deps/cpu_features/BUILD.bazel +0 -329
- package/node_modules/cpu-features/deps/cpu_features/CMakeLists.txt +0 -261
- package/node_modules/cpu-features/deps/cpu_features/CONTRIBUTING.md +0 -23
- package/node_modules/cpu-features/deps/cpu_features/LICENSE +0 -230
- package/node_modules/cpu-features/deps/cpu_features/README.md +0 -272
- package/node_modules/cpu-features/deps/cpu_features/WORKSPACE +0 -19
- package/node_modules/cpu-features/deps/cpu_features/bazel/ci/README.md +0 -5
- package/node_modules/cpu-features/deps/cpu_features/bazel/platforms.bzl +0 -11
- package/node_modules/cpu-features/deps/cpu_features/cmake/CpuFeaturesConfig.cmake.in +0 -3
- package/node_modules/cpu-features/deps/cpu_features/cmake/CpuFeaturesNdkCompatConfig.cmake.in +0 -3
- package/node_modules/cpu-features/deps/cpu_features/cmake/README.md +0 -30
- package/node_modules/cpu-features/deps/cpu_features/cmake/ci/Makefile +0 -252
- package/node_modules/cpu-features/deps/cpu_features/cmake/ci/README.md +0 -40
- package/node_modules/cpu-features/deps/cpu_features/cmake/ci/doc/docker.dot +0 -64
- package/node_modules/cpu-features/deps/cpu_features/cmake/ci/doc/docker.svg +0 -312
- package/node_modules/cpu-features/deps/cpu_features/cmake/ci/doc/generate_image.sh +0 -7
- package/node_modules/cpu-features/deps/cpu_features/cmake/ci/docker/amd64/Dockerfile +0 -48
- package/node_modules/cpu-features/deps/cpu_features/cmake/ci/docker/toolchain/Dockerfile +0 -34
- package/node_modules/cpu-features/deps/cpu_features/cmake/ci/sample/CMakeLists.txt +0 -22
- package/node_modules/cpu-features/deps/cpu_features/cmake/ci/sample/main.cpp +0 -11
- package/node_modules/cpu-features/deps/cpu_features/cmake/ci/vagrant/freebsd/Vagrantfile +0 -107
- package/node_modules/cpu-features/deps/cpu_features/cmake/googletest.CMakeLists.txt.in +0 -15
- package/node_modules/cpu-features/deps/cpu_features/cpu_features.gyp +0 -105
- package/node_modules/cpu-features/deps/cpu_features/include/cpu_features_cache_info.h +0 -54
- package/node_modules/cpu-features/deps/cpu_features/include/cpu_features_macros.h +0 -384
- package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_aarch64.h +0 -259
- package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_arm.h +0 -121
- package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_mips.h +0 -74
- package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_ppc.h +0 -149
- package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_riscv.h +0 -72
- package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_s390x.h +0 -108
- package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_x86.h +0 -288
- package/node_modules/cpu-features/deps/cpu_features/include/internal/bit_utils.h +0 -40
- package/node_modules/cpu-features/deps/cpu_features/include/internal/cpuid_x86.h +0 -37
- package/node_modules/cpu-features/deps/cpu_features/include/internal/filesystem.h +0 -39
- package/node_modules/cpu-features/deps/cpu_features/include/internal/hwcaps.h +0 -240
- package/node_modules/cpu-features/deps/cpu_features/include/internal/stack_line_reader.h +0 -49
- package/node_modules/cpu-features/deps/cpu_features/include/internal/string_view.h +0 -110
- package/node_modules/cpu-features/deps/cpu_features/include/internal/windows_utils.h +0 -70
- package/node_modules/cpu-features/deps/cpu_features/ndk_compat/CMakeLists.txt +0 -60
- package/node_modules/cpu-features/deps/cpu_features/ndk_compat/README.md +0 -4
- package/node_modules/cpu-features/deps/cpu_features/ndk_compat/cpu-features.c +0 -205
- package/node_modules/cpu-features/deps/cpu_features/ndk_compat/cpu-features.h +0 -320
- package/node_modules/cpu-features/deps/cpu_features/ndk_compat/ndk-compat-test.c +0 -12
- package/node_modules/cpu-features/deps/cpu_features/patches/0001-Add-Apple-Silicon-Support.patch +0 -456
- package/node_modules/cpu-features/deps/cpu_features/scripts/generate_badges.d +0 -165
- package/node_modules/cpu-features/deps/cpu_features/scripts/make_release.sh +0 -75
- package/node_modules/cpu-features/deps/cpu_features/scripts/run_integration.sh +0 -490
- package/node_modules/cpu-features/deps/cpu_features/scripts/test_integration.sh +0 -79
- package/node_modules/cpu-features/deps/cpu_features/src/copy.inl +0 -19
- package/node_modules/cpu-features/deps/cpu_features/src/define_introspection.inl +0 -86
- package/node_modules/cpu-features/deps/cpu_features/src/define_introspection_and_hwcaps.inl +0 -26
- package/node_modules/cpu-features/deps/cpu_features/src/equals.inl +0 -22
- package/node_modules/cpu-features/deps/cpu_features/src/filesystem.c +0 -62
- package/node_modules/cpu-features/deps/cpu_features/src/hwcaps.c +0 -169
- package/node_modules/cpu-features/deps/cpu_features/src/impl_aarch64__base_implementation.inl +0 -88
- package/node_modules/cpu-features/deps/cpu_features/src/impl_aarch64_linux_or_android.c +0 -79
- package/node_modules/cpu-features/deps/cpu_features/src/impl_aarch64_macos_or_iphone.c +0 -82
- package/node_modules/cpu-features/deps/cpu_features/src/impl_aarch64_windows.c +0 -138
- package/node_modules/cpu-features/deps/cpu_features/src/impl_arm_linux_or_android.c +0 -212
- package/node_modules/cpu-features/deps/cpu_features/src/impl_mips_linux_or_android.c +0 -93
- package/node_modules/cpu-features/deps/cpu_features/src/impl_ppc_linux.c +0 -163
- package/node_modules/cpu-features/deps/cpu_features/src/impl_riscv_linux.c +0 -111
- package/node_modules/cpu-features/deps/cpu_features/src/impl_s390x_linux.c +0 -120
- package/node_modules/cpu-features/deps/cpu_features/src/impl_x86__base_implementation.inl +0 -2055
- package/node_modules/cpu-features/deps/cpu_features/src/impl_x86_freebsd.c +0 -68
- package/node_modules/cpu-features/deps/cpu_features/src/impl_x86_linux_or_android.c +0 -58
- package/node_modules/cpu-features/deps/cpu_features/src/impl_x86_macos.c +0 -57
- package/node_modules/cpu-features/deps/cpu_features/src/impl_x86_windows.c +0 -58
- package/node_modules/cpu-features/deps/cpu_features/src/stack_line_reader.c +0 -132
- package/node_modules/cpu-features/deps/cpu_features/src/string_view.c +0 -192
- package/node_modules/cpu-features/deps/cpu_features/src/utils/list_cpu_features.c +0 -461
- package/node_modules/cpu-features/deps/cpu_features/test/CMakeLists.txt +0 -114
- package/node_modules/cpu-features/deps/cpu_features/test/bit_utils_test.cc +0 -53
- package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_aarch64_test.cc +0 -396
- package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_arm_test.cc +0 -384
- package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_mips_test.cc +0 -176
- package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_ppc_test.cc +0 -131
- package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_riscv_test.cc +0 -180
- package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_s390x_test.cc +0 -82
- package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_x86_test.cc +0 -1729
- package/node_modules/cpu-features/deps/cpu_features/test/filesystem_for_testing.cc +0 -103
- package/node_modules/cpu-features/deps/cpu_features/test/filesystem_for_testing.h +0 -61
- package/node_modules/cpu-features/deps/cpu_features/test/hwcaps_for_testing.cc +0 -52
- package/node_modules/cpu-features/deps/cpu_features/test/hwcaps_for_testing.h +0 -31
- package/node_modules/cpu-features/deps/cpu_features/test/stack_line_reader_test.cc +0 -132
- package/node_modules/cpu-features/deps/cpu_features/test/string_view_test.cc +0 -202
- package/node_modules/cpu-features/lib/index.js +0 -5
- package/node_modules/cpu-features/package.json +0 -40
- package/node_modules/cpu-features/src/binding.cc +0 -151
- package/node_modules/cpu-features/test/test.js +0 -12
|
@@ -1,396 +0,0 @@
|
|
|
1
|
-
// Copyright 2017 Google LLC
|
|
2
|
-
//
|
|
3
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
// you may not use this file except in compliance with the License.
|
|
5
|
-
// You may obtain a copy of the License at
|
|
6
|
-
//
|
|
7
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
//
|
|
9
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
// See the License for the specific language governing permissions and
|
|
13
|
-
// limitations under the License.
|
|
14
|
-
|
|
15
|
-
#include "cpuinfo_aarch64.h"
|
|
16
|
-
|
|
17
|
-
#include <set>
|
|
18
|
-
|
|
19
|
-
#include "filesystem_for_testing.h"
|
|
20
|
-
#include "gtest/gtest.h"
|
|
21
|
-
#include "hwcaps_for_testing.h"
|
|
22
|
-
#if defined(CPU_FEATURES_OS_WINDOWS)
|
|
23
|
-
#include "internal/windows_utils.h"
|
|
24
|
-
#endif // CPU_FEATURES_OS_WINDOWS
|
|
25
|
-
|
|
26
|
-
namespace cpu_features {
|
|
27
|
-
class FakeCpuAarch64 {
|
|
28
|
-
public:
|
|
29
|
-
#if defined(CPU_FEATURES_OS_WINDOWS)
|
|
30
|
-
bool GetWindowsIsProcessorFeaturePresent(DWORD dwProcessorFeature) {
|
|
31
|
-
return windows_isprocessorfeaturepresent_.count(dwProcessorFeature);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
void SetWindowsIsProcessorFeaturePresent(DWORD dwProcessorFeature) {
|
|
35
|
-
windows_isprocessorfeaturepresent_.insert(dwProcessorFeature);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
WORD GetWindowsNativeSystemInfoProcessorRevision() const {
|
|
39
|
-
return processor_revision_;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
void SetWindowsNativeSystemInfoProcessorRevision(WORD wProcessorRevision) {
|
|
43
|
-
processor_revision_ = wProcessorRevision;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
private:
|
|
47
|
-
std::set<DWORD> windows_isprocessorfeaturepresent_;
|
|
48
|
-
WORD processor_revision_{};
|
|
49
|
-
#endif // CPU_FEATURES_OS_WINDOWS
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
static FakeCpuAarch64* g_fake_cpu_instance = nullptr;
|
|
53
|
-
|
|
54
|
-
static FakeCpuAarch64& cpu() {
|
|
55
|
-
assert(g_fake_cpu_instance != nullptr);
|
|
56
|
-
return *g_fake_cpu_instance;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
#if defined(CPU_FEATURES_OS_WINDOWS)
|
|
60
|
-
extern "C" bool GetWindowsIsProcessorFeaturePresent(DWORD dwProcessorFeature) {
|
|
61
|
-
return cpu().GetWindowsIsProcessorFeaturePresent(dwProcessorFeature);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
extern "C" WORD GetWindowsNativeSystemInfoProcessorRevision() {
|
|
65
|
-
return cpu().GetWindowsNativeSystemInfoProcessorRevision();
|
|
66
|
-
}
|
|
67
|
-
#endif // CPU_FEATURES_OS_WINDOWS
|
|
68
|
-
|
|
69
|
-
namespace {
|
|
70
|
-
|
|
71
|
-
class CpuidAarch64Test : public ::testing::Test {
|
|
72
|
-
protected:
|
|
73
|
-
void SetUp() override {
|
|
74
|
-
assert(g_fake_cpu_instance == nullptr);
|
|
75
|
-
g_fake_cpu_instance = new FakeCpuAarch64();
|
|
76
|
-
}
|
|
77
|
-
void TearDown() override {
|
|
78
|
-
delete g_fake_cpu_instance;
|
|
79
|
-
g_fake_cpu_instance = nullptr;
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
TEST(CpuinfoAarch64Test, Aarch64FeaturesEnum) {
|
|
84
|
-
const char* last_name = GetAarch64FeaturesEnumName(AARCH64_LAST_);
|
|
85
|
-
EXPECT_STREQ(last_name, "unknown_feature");
|
|
86
|
-
for (int i = static_cast<int>(AARCH64_FP);
|
|
87
|
-
i != static_cast<int>(AARCH64_LAST_); ++i) {
|
|
88
|
-
const auto feature = static_cast<Aarch64FeaturesEnum>(i);
|
|
89
|
-
const char* name = GetAarch64FeaturesEnumName(feature);
|
|
90
|
-
ASSERT_FALSE(name == nullptr);
|
|
91
|
-
EXPECT_STRNE(name, "");
|
|
92
|
-
EXPECT_STRNE(name, last_name);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
#if defined(CPU_FEATURES_OS_LINUX)
|
|
97
|
-
void DisableHardwareCapabilities() { SetHardwareCapabilities(0, 0); }
|
|
98
|
-
|
|
99
|
-
#if defined(CPU_FEATURES_OS_MACOS)
|
|
100
|
-
|
|
101
|
-
class FakeCpu {
|
|
102
|
-
public:
|
|
103
|
-
bool GetDarwinSysCtlByName(std::string name) const {
|
|
104
|
-
return darwin_sysctlbyname_.count(name);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
int GetDarwinSysCtlByNameValue(std::string name) const {
|
|
108
|
-
std::map<std::string, int>::const_iterator iter = darwin_sysctlbynamevalue_.find(name);
|
|
109
|
-
if (iter != std::end(darwin_sysctlbynamevalue_)) {
|
|
110
|
-
return iter->second;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
return 0;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
void SetDarwinSysCtlByName(std::string name) {
|
|
117
|
-
darwin_sysctlbyname_.insert(name);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
void SetDarwinSysCtlByNameValue(std::string name, int value) {
|
|
121
|
-
darwin_sysctlbynamevalue_[name] = value;
|
|
122
|
-
}
|
|
123
|
-
private:
|
|
124
|
-
std::set<std::string> darwin_sysctlbyname_;
|
|
125
|
-
std::map<std::string, int> darwin_sysctlbynamevalue_;
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
static FakeCpu* g_fake_cpu_instance = nullptr;
|
|
129
|
-
|
|
130
|
-
static FakeCpu& cpu() {
|
|
131
|
-
assert(g_fake_cpu_instance != nullptr);
|
|
132
|
-
return *g_fake_cpu_instance;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
extern "C" bool GetDarwinSysCtlByName(const char* name) {
|
|
136
|
-
return cpu().GetDarwinSysCtlByName(name);
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
extern "C" int GetDarwinSysCtlByNameValue(const char *name) {
|
|
140
|
-
return cpu().GetDarwinSysCtlByNameValue(name);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
class CpuinfoAarch64Test : public ::testing::Test {
|
|
144
|
-
protected:
|
|
145
|
-
void SetUp() override {
|
|
146
|
-
assert(g_fake_cpu_instance == nullptr);
|
|
147
|
-
g_fake_cpu_instance = new FakeCpu();
|
|
148
|
-
}
|
|
149
|
-
void TearDown() override {
|
|
150
|
-
delete g_fake_cpu_instance;
|
|
151
|
-
g_fake_cpu_instance = nullptr;
|
|
152
|
-
}
|
|
153
|
-
};
|
|
154
|
-
|
|
155
|
-
TEST_F(CpuinfoAarch64Test, FromDarwinSysctlFromName) {
|
|
156
|
-
cpu().SetDarwinSysCtlByName("hw.optional.floatingpoint");
|
|
157
|
-
cpu().SetDarwinSysCtlByName("hw.optional.neon");
|
|
158
|
-
cpu().SetDarwinSysCtlByName("hw.optional.neon_hpfp");
|
|
159
|
-
cpu().SetDarwinSysCtlByName("hw.optional.neon_fp16");
|
|
160
|
-
cpu().SetDarwinSysCtlByName("hw.optional.armv8_1_atomics");
|
|
161
|
-
cpu().SetDarwinSysCtlByName("hw.optional.armv8_crc32");
|
|
162
|
-
cpu().SetDarwinSysCtlByName("hw.optional.armv8_2_fhm");
|
|
163
|
-
cpu().SetDarwinSysCtlByName("hw.optional.armv8_2_sha512");
|
|
164
|
-
cpu().SetDarwinSysCtlByName("hw.optional.armv8_2_sha3");
|
|
165
|
-
cpu().SetDarwinSysCtlByName("hw.optional.amx_version");
|
|
166
|
-
cpu().SetDarwinSysCtlByName("hw.optional.ucnormal_mem");
|
|
167
|
-
cpu().SetDarwinSysCtlByName("hw.optional.arm64");
|
|
168
|
-
|
|
169
|
-
cpu().SetDarwinSysCtlByNameValue("hw.cputype", 16777228);
|
|
170
|
-
cpu().SetDarwinSysCtlByNameValue("hw.cpusubtype", 2);
|
|
171
|
-
cpu().SetDarwinSysCtlByNameValue("hw.cpu64bit", 1);
|
|
172
|
-
cpu().SetDarwinSysCtlByNameValue("hw.cpufamily", 458787763);
|
|
173
|
-
cpu().SetDarwinSysCtlByNameValue("hw.cpusubfamily", 2);
|
|
174
|
-
|
|
175
|
-
const auto info = GetAarch64Info();
|
|
176
|
-
|
|
177
|
-
EXPECT_EQ(info.implementer, 0x100000C);
|
|
178
|
-
EXPECT_EQ(info.variant, 2);
|
|
179
|
-
EXPECT_EQ(info.part, 0x1B588BB3);
|
|
180
|
-
EXPECT_EQ(info.revision, 2);
|
|
181
|
-
|
|
182
|
-
EXPECT_TRUE(info.features.fp);
|
|
183
|
-
EXPECT_FALSE(info.features.asimd);
|
|
184
|
-
EXPECT_FALSE(info.features.evtstrm);
|
|
185
|
-
EXPECT_FALSE(info.features.aes);
|
|
186
|
-
EXPECT_FALSE(info.features.pmull);
|
|
187
|
-
EXPECT_FALSE(info.features.sha1);
|
|
188
|
-
EXPECT_FALSE(info.features.sha2);
|
|
189
|
-
EXPECT_TRUE(info.features.crc32);
|
|
190
|
-
EXPECT_TRUE(info.features.atomics);
|
|
191
|
-
EXPECT_TRUE(info.features.fphp);
|
|
192
|
-
EXPECT_FALSE(info.features.asimdhp);
|
|
193
|
-
EXPECT_FALSE(info.features.cpuid);
|
|
194
|
-
EXPECT_FALSE(info.features.asimdrdm);
|
|
195
|
-
EXPECT_FALSE(info.features.jscvt);
|
|
196
|
-
EXPECT_FALSE(info.features.fcma);
|
|
197
|
-
EXPECT_FALSE(info.features.lrcpc);
|
|
198
|
-
EXPECT_FALSE(info.features.dcpop);
|
|
199
|
-
EXPECT_TRUE(info.features.sha3);
|
|
200
|
-
EXPECT_FALSE(info.features.sm3);
|
|
201
|
-
EXPECT_FALSE(info.features.sm4);
|
|
202
|
-
EXPECT_FALSE(info.features.asimddp);
|
|
203
|
-
EXPECT_TRUE(info.features.sha512);
|
|
204
|
-
EXPECT_FALSE(info.features.sve);
|
|
205
|
-
EXPECT_TRUE(info.features.asimdfhm);
|
|
206
|
-
EXPECT_FALSE(info.features.dit);
|
|
207
|
-
EXPECT_FALSE(info.features.uscat);
|
|
208
|
-
EXPECT_FALSE(info.features.ilrcpc);
|
|
209
|
-
EXPECT_FALSE(info.features.flagm);
|
|
210
|
-
EXPECT_FALSE(info.features.ssbs);
|
|
211
|
-
EXPECT_FALSE(info.features.sb);
|
|
212
|
-
EXPECT_FALSE(info.features.paca);
|
|
213
|
-
EXPECT_FALSE(info.features.pacg);
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
#else
|
|
217
|
-
|
|
218
|
-
TEST(CpuinfoAarch64Test, FromHardwareCap) {
|
|
219
|
-
ResetHwcaps();
|
|
220
|
-
SetHardwareCapabilities(AARCH64_HWCAP_FP | AARCH64_HWCAP_AES, 0);
|
|
221
|
-
GetEmptyFilesystem(); // disabling /proc/cpuinfo
|
|
222
|
-
const auto info = GetAarch64Info();
|
|
223
|
-
EXPECT_TRUE(info.features.fp);
|
|
224
|
-
EXPECT_FALSE(info.features.asimd);
|
|
225
|
-
EXPECT_FALSE(info.features.evtstrm);
|
|
226
|
-
EXPECT_TRUE(info.features.aes);
|
|
227
|
-
EXPECT_FALSE(info.features.pmull);
|
|
228
|
-
EXPECT_FALSE(info.features.sha1);
|
|
229
|
-
EXPECT_FALSE(info.features.sha2);
|
|
230
|
-
EXPECT_FALSE(info.features.crc32);
|
|
231
|
-
EXPECT_FALSE(info.features.atomics);
|
|
232
|
-
EXPECT_FALSE(info.features.fphp);
|
|
233
|
-
EXPECT_FALSE(info.features.asimdhp);
|
|
234
|
-
EXPECT_FALSE(info.features.cpuid);
|
|
235
|
-
EXPECT_FALSE(info.features.asimdrdm);
|
|
236
|
-
EXPECT_FALSE(info.features.jscvt);
|
|
237
|
-
EXPECT_FALSE(info.features.fcma);
|
|
238
|
-
EXPECT_FALSE(info.features.lrcpc);
|
|
239
|
-
EXPECT_FALSE(info.features.dcpop);
|
|
240
|
-
EXPECT_FALSE(info.features.sha3);
|
|
241
|
-
EXPECT_FALSE(info.features.sm3);
|
|
242
|
-
EXPECT_FALSE(info.features.sm4);
|
|
243
|
-
EXPECT_FALSE(info.features.asimddp);
|
|
244
|
-
EXPECT_FALSE(info.features.sha512);
|
|
245
|
-
EXPECT_FALSE(info.features.sve);
|
|
246
|
-
EXPECT_FALSE(info.features.asimdfhm);
|
|
247
|
-
EXPECT_FALSE(info.features.dit);
|
|
248
|
-
EXPECT_FALSE(info.features.uscat);
|
|
249
|
-
EXPECT_FALSE(info.features.ilrcpc);
|
|
250
|
-
EXPECT_FALSE(info.features.flagm);
|
|
251
|
-
EXPECT_FALSE(info.features.ssbs);
|
|
252
|
-
EXPECT_FALSE(info.features.sb);
|
|
253
|
-
EXPECT_FALSE(info.features.paca);
|
|
254
|
-
EXPECT_FALSE(info.features.pacg);
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
TEST(CpuinfoAarch64Test, FromHardwareCap2) {
|
|
258
|
-
ResetHwcaps();
|
|
259
|
-
SetHardwareCapabilities(AARCH64_HWCAP_FP,
|
|
260
|
-
AARCH64_HWCAP2_SVE2 | AARCH64_HWCAP2_BTI);
|
|
261
|
-
GetEmptyFilesystem(); // disabling /proc/cpuinfo
|
|
262
|
-
const auto info = GetAarch64Info();
|
|
263
|
-
EXPECT_TRUE(info.features.fp);
|
|
264
|
-
|
|
265
|
-
EXPECT_TRUE(info.features.sve2);
|
|
266
|
-
EXPECT_TRUE(info.features.bti);
|
|
267
|
-
|
|
268
|
-
EXPECT_FALSE(info.features.dcpodp);
|
|
269
|
-
EXPECT_FALSE(info.features.sveaes);
|
|
270
|
-
EXPECT_FALSE(info.features.svepmull);
|
|
271
|
-
EXPECT_FALSE(info.features.svebitperm);
|
|
272
|
-
EXPECT_FALSE(info.features.svesha3);
|
|
273
|
-
EXPECT_FALSE(info.features.svesm4);
|
|
274
|
-
EXPECT_FALSE(info.features.flagm2);
|
|
275
|
-
EXPECT_FALSE(info.features.frint);
|
|
276
|
-
EXPECT_FALSE(info.features.svei8mm);
|
|
277
|
-
EXPECT_FALSE(info.features.svef32mm);
|
|
278
|
-
EXPECT_FALSE(info.features.svef64mm);
|
|
279
|
-
EXPECT_FALSE(info.features.svebf16);
|
|
280
|
-
EXPECT_FALSE(info.features.i8mm);
|
|
281
|
-
EXPECT_FALSE(info.features.bf16);
|
|
282
|
-
EXPECT_FALSE(info.features.dgh);
|
|
283
|
-
EXPECT_FALSE(info.features.rng);
|
|
284
|
-
}
|
|
285
|
-
#endif // CPU_FEATURES_OS_MACOS
|
|
286
|
-
|
|
287
|
-
TEST(CpuinfoAarch64Test, ARMCortexA53) {
|
|
288
|
-
ResetHwcaps();
|
|
289
|
-
auto& fs = GetEmptyFilesystem();
|
|
290
|
-
fs.CreateFile("/proc/cpuinfo",
|
|
291
|
-
R"(Processor : AArch64 Processor rev 3 (aarch64)
|
|
292
|
-
processor : 0
|
|
293
|
-
processor : 1
|
|
294
|
-
processor : 2
|
|
295
|
-
processor : 3
|
|
296
|
-
processor : 4
|
|
297
|
-
processor : 5
|
|
298
|
-
processor : 6
|
|
299
|
-
processor : 7
|
|
300
|
-
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32
|
|
301
|
-
CPU implementer : 0x41
|
|
302
|
-
CPU architecture: AArch64
|
|
303
|
-
CPU variant : 0x0
|
|
304
|
-
CPU part : 0xd03
|
|
305
|
-
CPU revision : 3)");
|
|
306
|
-
const auto info = GetAarch64Info();
|
|
307
|
-
EXPECT_EQ(info.implementer, 0x41);
|
|
308
|
-
EXPECT_EQ(info.variant, 0x0);
|
|
309
|
-
EXPECT_EQ(info.part, 0xd03);
|
|
310
|
-
EXPECT_EQ(info.revision, 3);
|
|
311
|
-
|
|
312
|
-
EXPECT_TRUE(info.features.fp);
|
|
313
|
-
EXPECT_TRUE(info.features.asimd);
|
|
314
|
-
EXPECT_TRUE(info.features.evtstrm);
|
|
315
|
-
EXPECT_TRUE(info.features.aes);
|
|
316
|
-
EXPECT_TRUE(info.features.pmull);
|
|
317
|
-
EXPECT_TRUE(info.features.sha1);
|
|
318
|
-
EXPECT_TRUE(info.features.sha2);
|
|
319
|
-
EXPECT_TRUE(info.features.crc32);
|
|
320
|
-
|
|
321
|
-
EXPECT_FALSE(info.features.atomics);
|
|
322
|
-
EXPECT_FALSE(info.features.fphp);
|
|
323
|
-
EXPECT_FALSE(info.features.asimdhp);
|
|
324
|
-
EXPECT_FALSE(info.features.cpuid);
|
|
325
|
-
EXPECT_FALSE(info.features.asimdrdm);
|
|
326
|
-
EXPECT_FALSE(info.features.jscvt);
|
|
327
|
-
EXPECT_FALSE(info.features.fcma);
|
|
328
|
-
EXPECT_FALSE(info.features.lrcpc);
|
|
329
|
-
EXPECT_FALSE(info.features.dcpop);
|
|
330
|
-
EXPECT_FALSE(info.features.sha3);
|
|
331
|
-
EXPECT_FALSE(info.features.sm3);
|
|
332
|
-
EXPECT_FALSE(info.features.sm4);
|
|
333
|
-
EXPECT_FALSE(info.features.asimddp);
|
|
334
|
-
EXPECT_FALSE(info.features.sha512);
|
|
335
|
-
EXPECT_FALSE(info.features.sve);
|
|
336
|
-
EXPECT_FALSE(info.features.asimdfhm);
|
|
337
|
-
EXPECT_FALSE(info.features.dit);
|
|
338
|
-
EXPECT_FALSE(info.features.uscat);
|
|
339
|
-
EXPECT_FALSE(info.features.ilrcpc);
|
|
340
|
-
EXPECT_FALSE(info.features.flagm);
|
|
341
|
-
EXPECT_FALSE(info.features.ssbs);
|
|
342
|
-
EXPECT_FALSE(info.features.sb);
|
|
343
|
-
EXPECT_FALSE(info.features.paca);
|
|
344
|
-
EXPECT_FALSE(info.features.pacg);
|
|
345
|
-
EXPECT_FALSE(info.features.dcpodp);
|
|
346
|
-
EXPECT_FALSE(info.features.sve2);
|
|
347
|
-
EXPECT_FALSE(info.features.sveaes);
|
|
348
|
-
EXPECT_FALSE(info.features.svepmull);
|
|
349
|
-
EXPECT_FALSE(info.features.svebitperm);
|
|
350
|
-
EXPECT_FALSE(info.features.svesha3);
|
|
351
|
-
EXPECT_FALSE(info.features.svesm4);
|
|
352
|
-
EXPECT_FALSE(info.features.flagm2);
|
|
353
|
-
EXPECT_FALSE(info.features.frint);
|
|
354
|
-
EXPECT_FALSE(info.features.svei8mm);
|
|
355
|
-
EXPECT_FALSE(info.features.svef32mm);
|
|
356
|
-
EXPECT_FALSE(info.features.svef64mm);
|
|
357
|
-
EXPECT_FALSE(info.features.svebf16);
|
|
358
|
-
EXPECT_FALSE(info.features.i8mm);
|
|
359
|
-
EXPECT_FALSE(info.features.bf16);
|
|
360
|
-
EXPECT_FALSE(info.features.dgh);
|
|
361
|
-
EXPECT_FALSE(info.features.rng);
|
|
362
|
-
EXPECT_FALSE(info.features.bti);
|
|
363
|
-
EXPECT_FALSE(info.features.mte);
|
|
364
|
-
EXPECT_FALSE(info.features.ecv);
|
|
365
|
-
EXPECT_FALSE(info.features.afp);
|
|
366
|
-
EXPECT_FALSE(info.features.rpres);
|
|
367
|
-
}
|
|
368
|
-
#endif // CPU_FEATURES_OS_LINUX
|
|
369
|
-
|
|
370
|
-
#if defined(CPU_FEATURES_OS_WINDOWS)
|
|
371
|
-
TEST_F(CpuidAarch64Test, WINDOWS_AARCH64_RPI4) {
|
|
372
|
-
cpu().SetWindowsNativeSystemInfoProcessorRevision(0x03);
|
|
373
|
-
cpu().SetWindowsIsProcessorFeaturePresent(PF_ARM_VFP_32_REGISTERS_AVAILABLE);
|
|
374
|
-
cpu().SetWindowsIsProcessorFeaturePresent(PF_ARM_NEON_INSTRUCTIONS_AVAILABLE);
|
|
375
|
-
cpu().SetWindowsIsProcessorFeaturePresent(
|
|
376
|
-
PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE);
|
|
377
|
-
|
|
378
|
-
const auto info = GetAarch64Info();
|
|
379
|
-
|
|
380
|
-
EXPECT_EQ(info.revision, 0x03);
|
|
381
|
-
EXPECT_TRUE(info.features.fp);
|
|
382
|
-
EXPECT_TRUE(info.features.asimd);
|
|
383
|
-
EXPECT_TRUE(info.features.crc32);
|
|
384
|
-
EXPECT_FALSE(info.features.aes);
|
|
385
|
-
EXPECT_FALSE(info.features.sha1);
|
|
386
|
-
EXPECT_FALSE(info.features.sha2);
|
|
387
|
-
EXPECT_FALSE(info.features.pmull);
|
|
388
|
-
EXPECT_FALSE(info.features.atomics);
|
|
389
|
-
EXPECT_FALSE(info.features.asimddp);
|
|
390
|
-
EXPECT_FALSE(info.features.jscvt);
|
|
391
|
-
EXPECT_FALSE(info.features.lrcpc);
|
|
392
|
-
}
|
|
393
|
-
#endif // CPU_FEATURES_OS_WINDOWS
|
|
394
|
-
|
|
395
|
-
} // namespace
|
|
396
|
-
} // namespace cpu_features
|