diff options
author | wez <wez@chromium.org> | 2014-12-19 20:29:35 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-12-20 04:30:14 +0000 |
commit | af9ea6f018c635e4cfadebdc7b6a0715d44441aa (patch) | |
tree | 32a6e8485116101e60fb3e533ba62cede141fa19 /crypto/p224.cc | |
parent | 2f006578f7aa0b16287a09d8de10df76c24e7245 (diff) | |
download | chromium_src-af9ea6f018c635e4cfadebdc7b6a0715d44441aa.zip chromium_src-af9ea6f018c635e4cfadebdc7b6a0715d44441aa.tar.gz chromium_src-af9ea6f018c635e4cfadebdc7b6a0715d44441aa.tar.bz2 |
Disable auto-vectorization of P224 ReduceLarge() under GCC.
Something about automatic tree vectorization breaks ReduceLarge(), so
disable the optimization for this function until we determine the real
fix.
BUG=439566
Review URL: https://codereview.chromium.org/814273004
Cr-Commit-Position: refs/heads/master@{#309335}
Diffstat (limited to 'crypto/p224.cc')
-rw-r--r-- | crypto/p224.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/crypto/p224.cc b/crypto/p224.cc index 5f76fbc..74ad7e0 100644 --- a/crypto/p224.cc +++ b/crypto/p224.cc @@ -123,6 +123,15 @@ typedef uint64 LargeFieldElement[15]; // ReduceLarge converts a LargeFieldElement to a FieldElement. // // in[i] < 2**62 + +// GCC 4.9 incorrectly vectorizes the first coefficient elimination loop, so +// disable that optimization via pragma. Don't use the pragma under Clang, since +// clang doesn't understand it. +// TODO(wez): Remove this when crbug.com/439566 is fixed. +#if defined(__GNUC__) && !defined(__clang__) +#pragma GCC optimize("no-tree-vectorize") +#endif + void ReduceLarge(FieldElement* out, LargeFieldElement* inptr) { LargeFieldElement& in(*inptr); @@ -164,6 +173,11 @@ void ReduceLarge(FieldElement* out, LargeFieldElement* inptr) { // out[5..7] < 2**28 } +// TODO(wez): Remove this when crbug.com/439566 is fixed. +#if defined(__GNUC__) && !defined(__clang__) +#pragma GCC optimize("tree-vectorize") +#endif + // Mul computes *out = a*b // // a[i] < 2**29, b[i] < 2**30 (or vice versa) |