From b22c7f325d56917e9a423b758126f84f1991d7fa Mon Sep 17 00:00:00 2001 From: Alexander Frick Date: Thu, 18 Jan 2024 19:25:07 -0600 Subject: [PATCH] use RobRich999 SIMD opts --- other/AVX2/build/config/compiler/BUILD.gn | 6 ++++++ other/AVX2/build/config/win/BUILD.gn | 11 ++++++++++- src/build/config/compiler/BUILD.gn | 12 +++++++++++- src/build/config/win/BUILD.gn | 11 +++++++++++ 4 files changed, 38 insertions(+), 2 deletions(-) diff --git a/other/AVX2/build/config/compiler/BUILD.gn b/other/AVX2/build/config/compiler/BUILD.gn index d9e943bd..d4780ffe 100644 --- a/other/AVX2/build/config/compiler/BUILD.gn +++ b/other/AVX2/build/config/compiler/BUILD.gn @@ -2286,6 +2286,12 @@ if (is_win) { "-mllvm", "-enable-dfa-jump-thread", "/O2", "/clang:-O3", + "/clang:-msse3", + "/clang:-mssse3", + "/clang:-msse4", + "/clang:-msse4.1", + "/clang:-msse4.2", + "/clang:-mavx", "/clang:-mavx2", "/clang:-maes", "/clang:-mpclmul", diff --git a/other/AVX2/build/config/win/BUILD.gn b/other/AVX2/build/config/win/BUILD.gn index 75016d0c..3fe94ce6 100644 --- a/other/AVX2/build/config/win/BUILD.gn +++ b/other/AVX2/build/config/win/BUILD.gn @@ -129,17 +129,26 @@ config("compiler") { # "/fp:fast", enables FMA. if (current_cpu == "x86" || current_cpu == "x64") { cflags += [ + "-msse3", + "-mssse3", + "-msse4", + "-msse4.1", + "-msse4.2", "-mavx", "-mavx2", "-maes", "-mpclmul", "/clang:-O3", + "/clang:-msse3", + "/clang:-mssse3", + "/clang:-msse4", + "/clang:-msse4.1", + "/clang:-msse4.2", "/clang:-mavx", "/clang:-mavx2", "/clang:-maes", "/clang:-mpclmul", "-Xclang", "-O3", - "/clang:-march=haswell", "/clang:-ffp-contract=fast", "/arch:AVX2", "-Wno-unused-command-line-argument", diff --git a/src/build/config/compiler/BUILD.gn b/src/build/config/compiler/BUILD.gn index 3622726f..311bb684 100644 --- a/src/build/config/compiler/BUILD.gn +++ b/src/build/config/compiler/BUILD.gn @@ -1141,11 +1141,16 @@ config("compiler_cpu_abi") { cflags += [ "-m64", "-O3", + "-msse3", + "-mssse3", + "-msse4", + "-msse4.1", + "-msse4.2", "-mavx", "-maes", "-mpclmul", ] - ldflags += [ "-m64", "-Wl,-O3", "-mavx", "-maes", "-mpclmul", "-Wl,-mllvm,-import-instr-limit=30", "-Wl,-mllvm,-import-hot-multiplier=15", "-Wl,-mllvm,-import-cold-multiplier=2", ] + ldflags += [ "-m64", "-Wl,-O3", "-msse3", "-mssse3", "-msse4", "-msse4.1", "-msse4.2", "-mavx", "-maes", "-mpclmul", "-Wl,-mllvm,-import-instr-limit=30", "-Wl,-mllvm,-import-hot-multiplier=15", "-Wl,-mllvm,-import-cold-multiplier=2", ] } else if (current_cpu == "x86") { cflags += [ "-m32" ] ldflags += [ "-m32", "-Wl,-O3", "-msse3", ] @@ -2286,6 +2291,11 @@ if (is_win) { "-mllvm", "-enable-dfa-jump-thread", "/O2", "/clang:-O3", + "/clang:-msse3", + "/clang:-mssse3", + "/clang:-msse4", + "/clang:-msse4.1", + "/clang:-msse4.2", "/clang:-mavx", "/clang:-maes", "/clang:-mpclmul", diff --git a/src/build/config/win/BUILD.gn b/src/build/config/win/BUILD.gn index 59840fa8..9bbfeb8d 100644 --- a/src/build/config/win/BUILD.gn +++ b/src/build/config/win/BUILD.gn @@ -129,10 +129,20 @@ config("compiler") { # "/fp:fast", enables FMA. if (current_cpu == "x86" || current_cpu == "x64") { cflags += [ + "-msse3", + "-mssse3", + "-msse4", + "-msse4.1", + "-msse4.2", "-mavx", "-maes", "-mpclmul", "/clang:-O3", + "/clang:-msse3", + "/clang:-mssse3", + "/clang:-msse4", + "/clang:-msse4.1", + "/clang:-msse4.2", "/clang:-mavx", "/clang:-maes", "/clang:-mpclmul", @@ -206,6 +216,7 @@ config("compiler") { "/INCREMENTAL:NO", "/FIXED:NO", "/OPT:lldlto=3", + "-mllvm:-march=sandybridge", ] if (use_lld) {