Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1673)

Unified Diff: crypto/p224.cc

Issue 814273004: Disable auto-vectorization of P224 ReduceLarge() under GCC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Only use pragms if GNU-C and not Clang... Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crypto/p224.cc
diff --git a/crypto/p224.cc b/crypto/p224.cc
index 5f76fbc259be1f3477c91a03fdcf6514eae53959..74ad7e00c4719dedaffec747361e8d69c1f80882 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)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698