diff options
author | Jack Lloyd <[email protected]> | 2016-10-14 12:03:22 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2016-10-14 12:03:22 -0400 |
commit | 8b3bda479efecef760f052cc055d3d6d98bf0637 (patch) | |
tree | 77cd13fe2e62085c2f04bf437c1e845a20bf6a01 /configure.py | |
parent | 60fc0ebf44e746b17d46a9d53054064808476495 (diff) |
Add ISA annotations to functions using SIMD, AES, etc
Also emit `#pragma GCC target` in the ISA specific amalgamation files.
This allows compiling without any special compiler flags, at least
with GCC 6.2 and Clang 3.8. The ISA annotations are ignored in MSVC,
which just emits whatever instruction the intrinsic requires.
Diffstat (limited to 'configure.py')
-rwxr-xr-x | configure.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/configure.py b/configure.py index 037d47d54..d23716256 100755 --- a/configure.py +++ b/configure.py @@ -1783,6 +1783,16 @@ def generate_amalgamation(build_config, options): if tgt not in botan_amalg_files: botan_amalg_files[tgt] = open_amalg_file(tgt) + + if tgt != '': + for isa in mod.need_isa: + if isa == 'aesni': + isa = "aes,ssse3,pclmul" + elif isa == 'rdrand': + isa = 'rdrnd' + + botan_amalg_files[tgt].write('#if defined(__GNUG__)\n#pragma GCC target ("%s")\n#endif\n' % (isa)) + if tgt not in headers_written: headers_written[tgt] = headers_written_in_h_files.copy() |