summaryrefslogtreecommitdiff
path: root/win32/build
diff options
context:
space:
mode:
Diffstat (limited to 'win32/build')
-rw-r--r--win32/build/config.w3211
-rw-r--r--win32/build/confutils.js14
2 files changed, 17 insertions, 8 deletions
diff --git a/win32/build/config.w32 b/win32/build/config.w32
index 7697838bb1..8eccd14d27 100644
--- a/win32/build/config.w32
+++ b/win32/build/config.w32
@@ -325,7 +325,7 @@ if (CLANG_TOOLSET) {
}
}
-ARG_WITH("codegen-arch", "Architecture for code generation: ia32, sse, sse2, avx, avx2", "no");
+ARG_WITH("codegen-arch", "Architecture for code generation: ia32. Use --enable-native-intrinsics to enable SIMD optimizations.", "no");
toolset_setup_codegen_arch();
ARG_WITH("all-shared", "Force all the non obligatory extensions to be shared", "no");
@@ -343,9 +343,10 @@ ARG_WITH("test-ini-ext-exclude", "Comma separated list of shared extensions to \
be excluded from the test.ini", "no");
ARG_ENABLE("native-intrinsics", "Comma separated list of intrinsic optimizations to enable. \
- Available optimization names are sse, sse2, sse4.1, sse4.2. SSE and SSE2 are enabled \
- by default. The best optimization specified will automatically enable all the older \
- optimizations. Note, that the produced binary might not work properly, if the \
- optimizations are not available on the target processor.", "no");
+ Available optimization names are sse, sse2, sse3, ssse3, sse4.1, sse4.2, avx, avx2. \
+ SSE and SSE2 are enabled by default. The best optimization specified will \
+ automatically enable all the older optimizations. Note, that the produced binary \
+ might not work properly, if the optimizations are not available on the target \
+ processor.", "no");
toolset_setup_intrinsic_cflags();
diff --git a/win32/build/confutils.js b/win32/build/confutils.js
index 41d1541bd9..2115078bea 100644
--- a/win32/build/confutils.js
+++ b/win32/build/confutils.js
@@ -3122,16 +3122,20 @@ function toolset_setup_arch()
function toolset_setup_codegen_arch()
{
- if("no" == PHP_CODEGEN_ARCH) {
+ if("no" == PHP_CODEGEN_ARCH || "yes" == PHP_CODEGEN_ARCH) {
return;
}
if (VS_TOOLSET) {
var arc = PHP_CODEGEN_ARCH.toUpperCase();
- if ("AVX2" == arc || "AVX" == arc || "SSE2" == arc || "SSE" == arc || "IA32" == arc) {
- ADD_FLAG("CFLAGS", "/arch:" + arc);
+ if ("IA32" != arc) {
+ ERROR("Only IA32 arch is supported by --with-codegen-arch, got '" + arc + "'");
+ } else if (X64) {
+ ERROR("IA32 arch is only supported with 32-bit build");
}
+ ADD_FLAG("CFLAGS", "/arch:" + arc);
+ PHP_NATIVE_INTRINSICS = "disabled";
}
}
@@ -3236,6 +3240,10 @@ function toolset_setup_intrinsic_cflags()
var scale = new Array("sse", "sse2", "sse3", "ssse3", "sse4.1", "sse4.2", "avx", "avx2");
if (VS_TOOLSET) {
+ if ("disabled" == PHP_NATIVE_INTRINSICS) {
+ ERROR("Can't enable intrinsics, --with-codegen-arch passed with an incompatible option. ")
+ }
+
if ("no" == PHP_NATIVE_INTRINSICS || "yes" == PHP_NATIVE_INTRINSICS) {
PHP_NATIVE_INTRINSICS = default_enabled;
}