diff options
author | lloyd <[email protected]> | 2008-10-11 16:44:02 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2008-10-11 16:44:02 +0000 |
commit | 0f078fbf51f70c59b8e3197ef2828e46cd0f10c0 (patch) | |
tree | 7266d2d1552fb1589cdad726ec6160234c7062a0 /src/math | |
parent | a91b6a50bac23a4c21b128c678af9941496e78ca (diff) |
Add a version for x86-64 in mp_asm64, though it is disabled by default
because the dependency handling/module picker gets confused otherwise.
This allows building a mostly C++ version with 64-bit words with only a
very small amount of inline asm (which is good for debugging the asm).
Diffstat (limited to 'src/math')
-rw-r--r-- | src/math/bigint/mp_asm64/info.txt | 1 | ||||
-rw-r--r-- | src/math/bigint/mp_asm64/mp_asm.h | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/math/bigint/mp_asm64/info.txt b/src/math/bigint/mp_asm64/info.txt index 85a4391b9..5c112c490 100644 --- a/src/math/bigint/mp_asm64/info.txt +++ b/src/math/bigint/mp_asm64/info.txt @@ -10,6 +10,7 @@ mp_generic:mp_asmi.h </add> <arch> +#amd64 alpha ia64 mips64 diff --git a/src/math/bigint/mp_asm64/mp_asm.h b/src/math/bigint/mp_asm64/mp_asm.h index e455b3616..f751a50f8 100644 --- a/src/math/bigint/mp_asm64/mp_asm.h +++ b/src/math/bigint/mp_asm64/mp_asm.h @@ -21,6 +21,13 @@ namespace Botan { z1 = a * b; \ } while(0); +#elif defined(BOTAN_TARGET_ARCH_IS_AMD64) + +#define BOTAN_WORD_MUL(a,b,z1,z0) do { \ + asm("mulq %3" : "=d" (z0), "=a" (z1) : \ + "a" (a), "rm" (b) : "cc"); \ +} while(0); + #elif defined(BOTAN_TARGET_ARCH_IS_IA64) #define BOTAN_WORD_MUL(a,b,z1,z0) do { \ |