forked from PimenovAlexander/corecvs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig-cpu-features.pri
More file actions
77 lines (73 loc) · 2.64 KB
/
config-cpu-features.pri
File metadata and controls
77 lines (73 loc) · 2.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#
# Autodetect CPU features block
#
set_cpu_sse4_features {
CONFIG -= with_native
CONFIG += with_sse with_sse2 with_sse3 with_sse4_1 with_sse4_2
!build_pass: message (The requested target platform to support all_sse*)
}
set_cpu_avx_features {
CONFIG -= with_native
CONFIG += with_sse with_sse2 with_sse3 with_sse4_1 with_sse4_2 with_avx
!build_pass: message (The requested target platform to support all_sse* +avx)
}
set_cpu_avx2_features {
CONFIG -= with_native
CONFIG += with_sse with_sse2 with_sse3 with_sse4_1 with_sse4_2 with_avx with_avx2 with_fma
!build_pass: message (The requested target platform to support all_sse* +avx +avx2 +fma)
}
CPU_FLAGS = ""
with_native {
!win32 {
CPU_FLAGS += $$system(cat /proc/cpuinfo | grep -m 1 "^flags")
} else {
CPU_FLAGS_PATH=$$shell_path($$PWD/tools/ckcpu/cpu_features.exe)
!exists("$$CPU_FLAGS_PATH") : CPU_FLAGS_PATH=$$shell_path($$PWD/src/open/tools/ckcpu/cpu_features.exe)
exists("$$CPU_FLAGS_PATH") {
CPU_FLAGS += $$system("$$CPU_FLAGS_PATH")
} else {
message (CPU_FLAGS_PATH=$$CPU_FLAGS_PATH not found!)
}
}
#message (Platform natively supports $$CPU_FLAGS)
}
contains(CPU_FLAGS, "sse") {
CONFIG += with_sse
!build_pass: contains(TARGET, core): message (Natively support SSE)
}
contains(CPU_FLAGS, "sse2") {
CONFIG += with_sse2
!build_pass: contains(TARGET, core): message (Natively support SSE2)
}
contains(CPU_FLAGS, "sse3") {
CONFIG += with_sse3
!build_pass: contains(TARGET, core): message (Natively support SSE3)
}
contains(CPU_FLAGS, "ssse3") {
CONFIG += with_sse3
!build_pass: contains(TARGET, core): message (Natively support SSSE3)
}
contains(CPU_FLAGS, "sse4.1") {
CONFIG += with_sse4_1
!build_pass: contains(TARGET, core): message (Natively support SSE4.1)
}
contains(CPU_FLAGS, "sse4.2") {
CONFIG += with_sse4_2
!build_pass: contains(TARGET, core): message (Natively support SSE4.2)
}
contains(CPU_FLAGS, "popcnt") {
!build_pass: contains(TARGET, core): message (Natively support POPCNT)
!contains(CONFIG, with_sse4_2): message (!!!!! FIXME !!!!!! Natively support POPCNT, but not SSE4.2 !!!!!!!!!!!!)
}
contains(CPU_FLAGS, "avx") {
CONFIG += with_avx
!build_pass: contains(TARGET, core): message (Natively support AVX)
}
contains(CPU_FLAGS, "avx2") {
CONFIG += with_avx2
!build_pass: contains(TARGET, core): message (Natively support AVX2)
}
contains(CPU_FLAGS, "fma") {
CONFIG += with_fma
!build_pass: contains(TARGET, core): message (Natively support FMA)
}