Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlateralusX <lateralusx.github@gmail.com>2018-07-09 14:28:23 +0300
committerlateralusX <lateralusx.github@gmail.com>2018-07-09 14:52:28 +0300
commit8dd6baee6e7fb27f2b3736441da9c3d0e55f315a (patch)
treeefaa8cac689384fab4f8b9be4fb25e09b51dddf4 /msvc/scripts
parent467c8e4471dc5858e0e010cf1e5aa11f5e318b67 (diff)
Enable SIMD optimization on Windows x64.
When implementing Windows x64 valuetype ABI mono’s SIMD optimization didn’t handle the case when passed arguments uses ArgValuetypeAddrInIReg/ ArgValuetypeAddrOnStack so optimization was disabled on Windows x64. This commit fixes mono SIMD support for ABI’s passing value types using ArgValuetypeAddrInIReg/ArgValuetypeAddrOnStack on Windows x64. It does this as part of regular value type decomposition, including a pass decomposing SIMD intrinsic ending up as arguments of type OP_ARG into correct load/store of the value type reference before argument can be used by SIMD instructions. All JIT and full AOT regression tests pass with enabled SIMD optimization on Windows x64. Running this optimization on some vector intensive applications showed some great performance increase. Just running this on basic-simd.exe regression shows: Elapsed time: 0.040471 secs (no optimizations at all) Elapsed time: 0.015756 secs (only simd and intrins optimization) So in this small, isolated test, the optimization indicates a 2.5x performance increase.
Diffstat (limited to 'msvc/scripts')
-rw-r--r--msvc/scripts/tests/build-full-aot-regression-tests.bat21
-rw-r--r--msvc/scripts/tests/run-full-aot-regression-tests.bat21
-rw-r--r--msvc/scripts/tests/setup-env.bat7
3 files changed, 40 insertions, 9 deletions
diff --git a/msvc/scripts/tests/build-full-aot-regression-tests.bat b/msvc/scripts/tests/build-full-aot-regression-tests.bat
index 8a254081cab..2d61d5b44b3 100644
--- a/msvc/scripts/tests/build-full-aot-regression-tests.bat
+++ b/msvc/scripts/tests/build-full-aot-regression-tests.bat
@@ -35,6 +35,12 @@ SET MONO_TEST_PATH=%MONO_TEST_BUILD_DIR%
SET FULLAOT_DIR=%MONO_WINAOT_BUILD_DIR%
SET MONO_PATH=%FULLAOT_DIR%
+REM When building Full AOT using net_4x BCL Mono SIMD tests are available.
+SET MONO_ENABLE_SIMD_TESTS=0
+IF /i %MONO_BCL_PATH% == %MONO_WINAOT_BCL_PATH% (
+ SET MONO_ENABLE_SIMD_TESTS=1
+)
+
REM Debug output options.
REM SET MONO_LOG_LEVEL=debug
@@ -51,17 +57,22 @@ System.Numerics.dll ^
System.Numerics.Vectors.dll ^
System.Xml.dll ^
System.Security.dll ^
-Mono.Simd.dll ^
Mono.Security.dll ^
I18N.dll ^
I18N.West.dll ^
MemoryIntrinsics.dll
+IF %MONO_ENABLE_SIMD_TESTS% == 1 (
+ SET FULLAOT_BCL_LIBS=^
+ %FULLAOT_BCL_LIBS% ^
+ System.Configuration.dll ^
+ Mono.Simd.dll
+)
+
SET FULLAOT_TEST_LIBS=^
TestDriver.dll ^
generics-variant-types.dll
-REM basic-simd.exe not in full AOT profile on Windows.
SET FULLAOT_RUNTIME_TESTS=^
basic.exe ^
basic-float.exe ^
@@ -81,6 +92,12 @@ ratests.exe ^
unaligned.exe ^
builtin-types.exe
+IF %MONO_ENABLE_SIMD_TESTS% == 1 (
+ SET FULLAOT_RUNTIME_TESTS=^
+ %FULLAOT_RUNTIME_TESTS% ^
+ basic-simd.exe
+)
+
SET FULLAOT_LIBS=
mkdir %FULLAOT_DIR% >nul 2>&1
diff --git a/msvc/scripts/tests/run-full-aot-regression-tests.bat b/msvc/scripts/tests/run-full-aot-regression-tests.bat
index 2f85ada5b6c..19dd66f7546 100644
--- a/msvc/scripts/tests/run-full-aot-regression-tests.bat
+++ b/msvc/scripts/tests/run-full-aot-regression-tests.bat
@@ -18,11 +18,13 @@ IF NOT ERRORLEVEL == 0 (
SET FULLAOT_DIR=%MONO_WINAOT_BUILD_DIR%
SET MONO_PATH=%FULLAOT_DIR%
-SET RUN_TARGET=%1
-
-REM %FULLAOT_DIR%\basic-simd.exe not in full AOT profile on Windows.
+REM When building Full AOT using net_4x BCL Mono SIMD tests are available.
+SET MONO_ENABLE_SIMD_TESTS=0
+IF /i %MONO_BCL_PATH% == %MONO_WINAOT_BCL_PATH% (
+ SET MONO_ENABLE_SIMD_TESTS=1
+)
-IF /i "all" == "%RUN_TARGET%" (
+IF /i "all" == "%1" (
SET RUN_TARGET=%FULLAOT_DIR%\basic.exe ^
%FULLAOT_DIR%\basic-float.exe ^
%FULLAOT_DIR%\basic-long.exe ^
@@ -36,15 +38,24 @@ IF /i "all" == "%RUN_TARGET%" (
%FULLAOT_DIR%\generics.exe ^
%FULLAOT_DIR%\aot-tests.exe ^
%FULLAOT_DIR%\gshared.exe ^
+ %FULLAOT_DIR%\basic-vectors.exe ^
%FULLAOT_DIR%\ratests.exe ^
%FULLAOT_DIR%\unaligned.exe ^
%FULLAOT_DIR%\builtin-types.exe
) ELSE (
- IF NOT EXIST %RUN_TARGET% (
+ IF NOT EXIST %1 (
SET RUN_TARGET=%FULLAOT_DIR%\%1
)
)
+IF /i "all" == "%1" (
+ IF %MONO_ENABLE_SIMD_TESTS% == 1 (
+ SET RUN_TARGET=^
+ %RUN_TARGET% ^
+ %FULLAOT_DIR%\basic-simd.exe
+ )
+)
+
REM Debug output options.
REM SET MONO_LOG_LEVEL=debug
diff --git a/msvc/scripts/tests/setup-env.bat b/msvc/scripts/tests/setup-env.bat
index e8c45909689..4e6fded23c5 100644
--- a/msvc/scripts/tests/setup-env.bat
+++ b/msvc/scripts/tests/setup-env.bat
@@ -8,8 +8,10 @@ pushd %CURRENT_MONO_HOME%
SET CURRENT_MONO_HOME=%CD%
popd
-
+REM SET MONO_BUILD_CONFIG=Debug
SET MONO_BUILD_CONFIG=Release
+REM SET MONO_FULL_AOT_PROFILE=net_4_x
+SET MONO_FULL_AOT_PROFILE=winaot
SET MONO_CFG_DIR=%CURRENT_MONO_HOME%\runtime\etc
SET MONO_BCL_HOME=%CURRENT_MONO_HOME%\mcs\class\lib
@@ -21,7 +23,8 @@ SET MONO_DIST_DIR=%CURRENT_MONO_HOME%\msvc\dist
SET MONO_BCL_PATH=%MONO_BCL_HOME%\net_4_x
SET MONO_BCL_FACADE_PATH=%MONO_BCL_PATH%\Facades
-SET MONO_WINAOT_BCL_PATH=%MONO_BCL_HOME%\winaot
+
+SET MONO_WINAOT_BCL_PATH=%MONO_BCL_HOME%\%MONO_FULL_AOT_PROFILE%
SET MONO_WINAOT_BCL_FACADE_PATH=%MONO_WINAOT_BCL_PATH%\Facades
SET MONO_WINAOT_BUILD_DIR=%MONO_AOT_BUILD_DIR%\winaot