mirror of
https://chromium.googlesource.com/libyuv/libyuv
synced 2025-12-06 16:56:55 +08:00
avx10_2 detect
Run with sde only -dmr reports AVX10.2
emr:Has AVX10_2 0x0
adl:Has AVX10_2 0x0
icx:Has AVX10_2 0x0
snb:Has AVX10_2 0x0
tnt:Has AVX10_2 0x0
icl:Has AVX10_2 0x0
slm:Has AVX10_2 0x0
dmr:Has AVX10_2 0x2000000
cwf:Has AVX10_2 0x0
mrm:Has AVX10_2 0x0
skx:Has AVX10_2 0x0
wsm:Has AVX10_2 0x0
gnr:Has AVX10_2 0x0
gnr256:Has AVX10_2 0x0
bdw:Has AVX10_2 0x0
cpx:Has AVX10_2 0x0
rpl:Has AVX10_2 0x0
snr:Has AVX10_2 0x0
ptl:Has AVX10_2 0x0
slt:Has AVX10_2 0x0
ivb:Has AVX10_2 0x0
spr:Has AVX10_2 0x0
tgl:Has AVX10_2 0x0
arl:Has AVX10_2 0x0
srf:Has AVX10_2 0x0
nhm:Has AVX10_2 0x0
skl:Has AVX10_2 0x0
mtl:Has AVX10_2 0x0
pnr:Has AVX10_2 0x0
glp:Has AVX10_2 0x0
lnl:Has AVX10_2 0x0
cnl:Has AVX10_2 0x0
hsw:Has AVX10_2 0x0
clx:Has AVX10_2 0x0
glm:Has AVX10_2 0x0
sde -dmr -- libyuv_test --gunit_filter=*Cpu*
[ RUN ] LibYUVBaseTest.TestCpuId
Cpu Vendor: GenuineIntel 0x756e6547 0x49656e69 0x6c65746e
Cpu Family 6 (0x6), Model 214 (0xd6)
[ OK ] LibYUVBaseTest.TestCpuId (34 ms)
[ RUN ] LibYUVBaseTest.TestCpuHas
Kernel Version 6.10
Has X86 0x8
Has SSE2 0x100
Has SSSE3 0x200
Has SSE4.1 0x400
Has SSE4.2 0x800
Has AVX 0x1000
Has AVX2 0x2000
Has ERMS 0x4000
Has FSMR 0x8000
Has FMA3 0x10000
Has F16C 0x20000
Has AVX512BW 0x40000
Has AVX512VL 0x80000
Has AVX512VNNI 0x100000
Has AVX512VBMI 0x200000
Has AVX512VBMI2 0x400000
Has AVX512VBITALG 0x800000
Has AVX10 0x1000000
Has AVX10_2 0x2000000
HAS AVXVNNI 0x4000000
Has AVXVNNIINT8 0x8000000
Has AMXINT8 0x10000000
[ OK ] LibYUVBaseTest.TestCpuHas (10 ms)
This is how oneDNN does avx10 version:
e15d2c220f/src/cpu/x64/xbyak/xbyak_util.h (L698-L701)
Bug: b/350318244
Change-Id: I6f78402fecc38a92019d137b3439d7bce950510c
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/6172267
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
Reviewed-by: richard winterton <rrwinterton@gmail.com>
This commit is contained in:
parent
10592b60c0
commit
ef52c1658a
@ -29,6 +29,7 @@ By default the cpu is detected and the most advanced form of SIMD is used. But
|
||||
LIBYUV_DISABLE_AVX512VBMI2
|
||||
LIBYUV_DISABLE_AVX512VBITALG
|
||||
LIBYUV_DISABLE_AVX10
|
||||
LIBYUV_DISABLE_AVX10_2
|
||||
LIBYUV_DISABLE_AVXVNNI
|
||||
LIBYUV_DISABLE_AVXVNNIINT8
|
||||
LIBYUV_DISABLE_AMXINT8
|
||||
|
||||
@ -54,9 +54,10 @@ static const int kCpuHasAVX512VBMI = 0x200000;
|
||||
static const int kCpuHasAVX512VBMI2 = 0x400000;
|
||||
static const int kCpuHasAVX512VBITALG = 0x800000;
|
||||
static const int kCpuHasAVX10 = 0x1000000;
|
||||
static const int kCpuHasAVXVNNI = 0x2000000;
|
||||
static const int kCpuHasAVXVNNIINT8 = 0x4000000;
|
||||
static const int kCpuHasAMXINT8 = 0x8000000;
|
||||
static const int kCpuHasAVX10_2 = 0x2000000;
|
||||
static const int kCpuHasAVXVNNI = 0x4000000;
|
||||
static const int kCpuHasAVXVNNIINT8 = 0x8000000;
|
||||
static const int kCpuHasAMXINT8 = 0x10000000;
|
||||
|
||||
// These flags are only valid on MIPS processors.
|
||||
static const int kCpuHasMIPS = 0x10;
|
||||
|
||||
@ -409,6 +409,7 @@ static SAFEBUFFERS int GetCpuFlags(void) {
|
||||
int cpu_info1[4] = {0, 0, 0, 0};
|
||||
int cpu_info7[4] = {0, 0, 0, 0};
|
||||
int cpu_einfo7[4] = {0, 0, 0, 0};
|
||||
int cpu_info24[4] = {0, 0, 0, 0};
|
||||
int cpu_amdinfo21[4] = {0, 0, 0, 0};
|
||||
CpuId(0, 0, cpu_info0);
|
||||
CpuId(1, 0, cpu_info1);
|
||||
@ -417,6 +418,9 @@ static SAFEBUFFERS int GetCpuFlags(void) {
|
||||
CpuId(7, 1, cpu_einfo7);
|
||||
CpuId(0x80000021, 0, cpu_amdinfo21);
|
||||
}
|
||||
if (cpu_info0[0] >= 0x24) {
|
||||
CpuId(0x24, 0, cpu_info24);
|
||||
}
|
||||
cpu_info = kCpuHasX86 | ((cpu_info1[3] & 0x04000000) ? kCpuHasSSE2 : 0) |
|
||||
((cpu_info1[2] & 0x00000200) ? kCpuHasSSSE3 : 0) |
|
||||
((cpu_info1[2] & 0x00080000) ? kCpuHasSSE41 : 0) |
|
||||
@ -445,6 +449,9 @@ static SAFEBUFFERS int GetCpuFlags(void) {
|
||||
((cpu_info7[2] & 0x00001000) ? kCpuHasAVX512VBITALG : 0) |
|
||||
((cpu_einfo7[3] & 0x00080000) ? kCpuHasAVX10 : 0) |
|
||||
((cpu_info7[3] & 0x02000000) ? kCpuHasAMXINT8 : 0);
|
||||
if (cpu_info0[0] >= 0x24 && (cpu_einfo7[3] & 0x00080000)) {
|
||||
cpu_info |= ((cpu_info24[1] & 0xFF) >= 2) ? kCpuHasAVX10_2: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -190,6 +190,7 @@ TEST_F(LibYUVBaseTest, TestCpuHas) {
|
||||
int has_avx512vbmi2 = TestCpuFlag(kCpuHasAVX512VBMI2);
|
||||
int has_avx512vbitalg = TestCpuFlag(kCpuHasAVX512VBITALG);
|
||||
int has_avx10 = TestCpuFlag(kCpuHasAVX10);
|
||||
int has_avx10_2 = TestCpuFlag(kCpuHasAVX10_2);
|
||||
int has_avxvnni = TestCpuFlag(kCpuHasAVXVNNI);
|
||||
int has_avxvnniint8 = TestCpuFlag(kCpuHasAVXVNNIINT8);
|
||||
int has_amxint8 = TestCpuFlag(kCpuHasAMXINT8);
|
||||
@ -211,6 +212,7 @@ TEST_F(LibYUVBaseTest, TestCpuHas) {
|
||||
printf("Has AVX512VBMI2 0x%x\n", has_avx512vbmi2);
|
||||
printf("Has AVX512VBITALG 0x%x\n", has_avx512vbitalg);
|
||||
printf("Has AVX10 0x%x\n", has_avx10);
|
||||
printf("Has AVX10_2 0x%x\n", has_avx10_2);
|
||||
printf("HAS AVXVNNI 0x%x\n", has_avxvnni);
|
||||
printf("Has AVXVNNIINT8 0x%x\n", has_avxvnniint8);
|
||||
printf("Has AMXINT8 0x%x\n", has_amxint8);
|
||||
|
||||
@ -164,6 +164,9 @@ static int TestCpuEnv(int cpu_info) {
|
||||
if (TestEnv("LIBYUV_DISABLE_AVX10")) {
|
||||
cpu_info &= ~libyuv::kCpuHasAVX10;
|
||||
}
|
||||
if (TestEnv("LIBYUV_DISABLE_AVX10_2")) {
|
||||
cpu_info &= ~libyuv::kCpuHasAVX10_2;
|
||||
}
|
||||
if (TestEnv("LIBYUV_DISABLE_AVXVNNI")) {
|
||||
cpu_info &= ~libyuv::kCpuHasAVXVNNI;
|
||||
}
|
||||
|
||||
@ -181,6 +181,7 @@ int main(int argc, const char* argv[]) {
|
||||
int has_avx512vbmi2 = TestCpuFlag(kCpuHasAVX512VBMI2);
|
||||
int has_avx512vbitalg = TestCpuFlag(kCpuHasAVX512VBITALG);
|
||||
int has_avx10 = TestCpuFlag(kCpuHasAVX10);
|
||||
int has_avx10_2 = TestCpuFlag(kCpuHasAVX10_2);
|
||||
int has_avxvnni = TestCpuFlag(kCpuHasAVXVNNI);
|
||||
int has_avxvnniint8 = TestCpuFlag(kCpuHasAVXVNNIINT8);
|
||||
int has_amxint8 = TestCpuFlag(kCpuHasAMXINT8);
|
||||
@ -202,6 +203,7 @@ int main(int argc, const char* argv[]) {
|
||||
printf("Has AVX512VBMI2 0x%x\n", has_avx512vbmi2);
|
||||
printf("Has AVX512VBITALG 0x%x\n", has_avx512vbitalg);
|
||||
printf("Has AVX10 0x%x\n", has_avx10);
|
||||
printf("Has AVX10_2 0x%x\n", has_avx10_2);
|
||||
printf("HAS AVXVNNI 0x%x\n", has_avxvnni);
|
||||
printf("Has AVXVNNIINT8 0x%x\n", has_avxvnniint8);
|
||||
printf("Has AMXINT8 0x%x\n", has_amxint8);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user