Skip to content

Commit 4c14e4c

Browse files
committed
Removed AVX2 and AVX512 usage for Windows, as Windows ARM64 under Parallels lacks AVX2 support and AVX512 is limited to certain processors, aligning with Delphi users' need for maximum backward compatibility.
1 parent 11d3f02 commit 4c14e4c

File tree

2 files changed

+20
-18
lines changed

2 files changed

+20
-18
lines changed

BUILD.gn

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ opts("hsw") {
172172
sources = skia_opts.hsw_sources
173173
if (is_win && !is_mingw) {
174174
cflags = [ "/arch:AVX2" ]
175-
} else {
175+
} else if (!is_win || !is_sk4d_build) {
176176
cflags = [ "-march=haswell" ]
177177
}
178178
}
@@ -182,7 +182,7 @@ opts("skx") {
182182
sources = skia_opts.skx_sources
183183
if (is_win && !is_mingw) {
184184
cflags = [ "/arch:AVX512" ]
185-
} else {
185+
} else if (!is_win || !is_sk4d_build) {
186186
cflags = [ "-march=skylake-avx512" ]
187187
}
188188
}

modules/skcms/BUILD.gn

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ template("arch") {
3131
}
3232

3333
arch("skcms_TransformHsw") {
34-
enabled = current_cpu == "x64" && target_os != "android"
34+
enabled = current_cpu == "x64" && target_os != "android" && (!is_win || !is_sk4d_build)
3535
sources = skcms_TransformHsw
3636
if (is_win && !is_mingw) {
3737
if (is_clang) {
@@ -43,7 +43,7 @@ arch("skcms_TransformHsw") {
4343
} else {
4444
cflags = [ "/arch:AVX2" ]
4545
}
46-
} else {
46+
} else if (!is_win || !is_sk4d_build) {
4747
cflags = [
4848
"-mavx2",
4949
"-mf16c",
@@ -53,20 +53,22 @@ arch("skcms_TransformHsw") {
5353
}
5454

5555
arch("skcms_TransformSkx") {
56-
enabled = current_cpu == "x64" && target_os != "android"
56+
enabled = current_cpu == "x64" && target_os != "android" && (!is_win || !is_sk4d_build)
5757
sources = skcms_TransformSkx
58-
if (is_win && !is_mingw) {
59-
if (is_clang) {
60-
cflags = [
61-
"/clang:-mavx512f",
62-
"/clang:-mavx512dq",
63-
"/clang:-mavx512cd",
64-
"/clang:-mavx512bw",
65-
"/clang:-mavx512vl",
66-
"/clang:-ffp-contract=off",
67-
]
68-
} else {
69-
cflags = [ "/arch:AVX512" ]
58+
if (is_win) {
59+
if (!is_mingw) {
60+
if (is_clang) {
61+
cflags = [
62+
"/clang:-mavx512f",
63+
"/clang:-mavx512dq",
64+
"/clang:-mavx512cd",
65+
"/clang:-mavx512bw",
66+
"/clang:-mavx512vl",
67+
"/clang:-ffp-contract=off",
68+
]
69+
} else {
70+
cflags = [ "/arch:AVX512" ]
71+
}
7072
}
7173
} else {
7274
cflags = [
@@ -87,7 +89,7 @@ static_library("skcms") {
8789
} else if (is_clang) {
8890
cflags_c += [ "-std=c11" ]
8991
}
90-
if (target_cpu != "x64" || target_os == "android") {
92+
if (target_cpu != "x64" || target_os == "android" || (is_win && is_sk4d_build)) {
9193
defines = [
9294
"SKCMS_DISABLE_HSW",
9395
"SKCMS_DISABLE_SKX",

0 commit comments

Comments
 (0)