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

Unified Diff: third_party/boringssl/update_gypi_and_asm.py

Issue 385983006: net: pickup "586" asm files for x86. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: .. Created 6 years, 5 months 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 | « third_party/boringssl/mac-x86/crypto/sha/sha512-586.S ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/boringssl/update_gypi_and_asm.py
diff --git a/third_party/boringssl/update_gypi_and_asm.py b/third_party/boringssl/update_gypi_and_asm.py
index e7755e435783028a0a3656b2d6bc3e0d30c17dab..8e61591f0f9623da351453352ea2fce4889e6fa9 100644
--- a/third_party/boringssl/update_gypi_and_asm.py
+++ b/third_party/boringssl/update_gypi_and_asm.py
@@ -132,6 +132,20 @@ def PerlAsm(output_filename, input_filename, perlasm_style, extra_args):
out_file.write(output)
+def ArchForAsmFilename(filename):
+ """Returns the architecture that a given asm file should be compiled for
+ based on substrings in the filename."""
+
+ if 'x86_64' in filename or 'avx2' in filename:
+ return 'x86_64'
+ elif ('x86' in filename and 'x86_64' not in filename) or '586' in filename:
+ return 'x86'
+ elif 'arm' in filename:
+ return 'arm'
+ else:
+ raise ValueError('Unknown arch for asm filename: ' + filename)
+
+
def WriteAsmFiles(perlasms):
"""Generates asm files from perlasm directives for each supported OS x
platform combination."""
@@ -150,15 +164,7 @@ def WriteAsmFiles(perlasms):
output = os.path.join(outDir, output[4:])
output = output.replace('${ASM_EXT}', asm_ext)
- found = False
- if arch == 'x86_64' and ('x86_64' in filename or 'avx2' in filename):
- found = True
- elif arch == 'x86' and 'x86' in filename and 'x86_64' not in filename:
- found = True
- elif arch == 'arm' and 'arm' in filename:
- found = True
-
- if found:
+ if arch == ArchForAsmFilename(filename):
PerlAsm(output, perlasm['input'], perlasm_style, perlasm['extra_args'])
asmfiles.setdefault(key, []).append(output)
« no previous file with comments | « third_party/boringssl/mac-x86/crypto/sha/sha512-586.S ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698