From 7e84969f965149ef44f38c3243f0bc2725a37c6d Mon Sep 17 00:00:00 2001 From: jaishank Date: Tue, 25 Jun 2019 14:55:52 +0530 Subject: [PATCH] Disabled avx avx2 avx512 compiler flags by default. Library components can enable the flags based on performance impact Test: run-test gtest Change-Id: I41c4464cffd2b0e830d4ab1c5a25b378e2a25129 Signed-off-by: jaishank --- cc/config/x86_64_device.go | 12 +++++++++--- cc/config/x86_device.go | 11 +++++++++-- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/cc/config/x86_64_device.go b/cc/config/x86_64_device.go index 0f0420f76..d9c96df93 100644 --- a/cc/config/x86_64_device.go +++ b/cc/config/x86_64_device.go @@ -67,10 +67,16 @@ var ( "sse4": []string{"-msse4"}, "sse4_1": []string{"-msse4.1"}, "sse4_2": []string{"-msse4.2"}, + + // Not all cases there is performance gain by enabling -mavx -mavx2 + // flags so these flags are not enabled by default. + // if there is performance gain in individual library components, + // the compiler flags can be set in corresponding bp files. + // "avx": []string{"-mavx"}, + // "avx2": []string{"-mavx2"}, + // "avx512": []string{"-mavx512"} + "popcnt": []string{"-mpopcnt"}, - "avx": []string{"-mavx"}, - "avx2": []string{"-mavx2"}, - "avx512": []string{"-mavx512"}, "aes_ni": []string{"-maes"}, } ) diff --git a/cc/config/x86_device.go b/cc/config/x86_device.go index 500014e9f..65047588b 100644 --- a/cc/config/x86_device.go +++ b/cc/config/x86_device.go @@ -86,8 +86,15 @@ var ( "sse4": []string{"-msse4"}, "sse4_1": []string{"-msse4.1"}, "sse4_2": []string{"-msse4.2"}, - "avx": []string{"-mavx"}, - "avx2": []string{"-mavx2"}, + + // Not all cases there is performance gain by enabling -mavx -mavx2 + // flags so these flags are not enabled by default. + // if there is performance gain in individual library components, + // the compiler flags can be set in corresponding bp files. + // "avx": []string{"-mavx"}, + // "avx2": []string{"-mavx2"}, + // "avx512": []string{"-mavx512"} + "aes_ni": []string{"-maes"}, } )