From 7c428b871db0a21e79ba420ac7e35854a7db9c6a Mon Sep 17 00:00:00 2001 From: lloyd Date: Wed, 25 Aug 2010 17:56:44 +0000 Subject: Rename mp_amd64_msvc to mp_msvc64 since it supports both AMD64 and IA-64 (and, hypothetically, any other 64 bit CPU Visual C++ might target in the future). --- src/math/bigint/info.txt | 2 +- src/math/bigint/mp_amd64_msvc/info.txt | 17 ---------- src/math/bigint/mp_amd64_msvc/mp_asm.h | 61 ---------------------------------- src/math/bigint/mp_msvc64/info.txt | 17 ++++++++++ src/math/bigint/mp_msvc64/mp_asm.h | 61 ++++++++++++++++++++++++++++++++++ 5 files changed, 79 insertions(+), 79 deletions(-) delete mode 100644 src/math/bigint/mp_amd64_msvc/info.txt delete mode 100644 src/math/bigint/mp_amd64_msvc/mp_asm.h create mode 100644 src/math/bigint/mp_msvc64/info.txt create mode 100644 src/math/bigint/mp_msvc64/mp_asm.h (limited to 'src/math') diff --git a/src/math/bigint/info.txt b/src/math/bigint/info.txt index 0511c2d8d..7892a6edf 100644 --- a/src/math/bigint/info.txt +++ b/src/math/bigint/info.txt @@ -30,7 +30,7 @@ mp_shift.cpp alloc hex -mp_amd64|mp_amd64_msvc|mp_asm64|mp_ia32|mp_ia32_msvc|mp_generic +mp_amd64|mp_msvc64|mp_asm64|mp_ia32|mp_ia32_msvc|mp_generic monty_generic mulop_generic rng diff --git a/src/math/bigint/mp_amd64_msvc/info.txt b/src/math/bigint/mp_amd64_msvc/info.txt deleted file mode 100644 index 56ae05927..000000000 --- a/src/math/bigint/mp_amd64_msvc/info.txt +++ /dev/null @@ -1,17 +0,0 @@ -load_on dep - -mp_bits 64 - - -mp_asm.h -mp_generic:mp_asmi.h - - - -amd64 -ia64 - - - -msvc - diff --git a/src/math/bigint/mp_amd64_msvc/mp_asm.h b/src/math/bigint/mp_amd64_msvc/mp_asm.h deleted file mode 100644 index 3acbe11bb..000000000 --- a/src/math/bigint/mp_amd64_msvc/mp_asm.h +++ /dev/null @@ -1,61 +0,0 @@ -/* -* Multiply-Add for 64-bit MSVC -* (C) 2010 Jack Lloyd -* -* Distributed under the terms of the Botan license -*/ - -#ifndef BOTAN_MP_ASM_H__ -#define BOTAN_MP_ASM_H__ - -#include -#include - -#if (BOTAN_MP_WORD_BITS != 64) - #error The mp_amd64_msvc module requires that BOTAN_MP_WORD_BITS == 64 -#endif - -#pragma intrinsic(_umul128) - -namespace Botan { - -extern "C" { - -/* -* Word Multiply -*/ -inline word word_madd2(word a, word b, word* c) - { - word hi, lo; - lo = _umul128(a, b, &hi); - - lo += *c; - hi += (lo < *c); // carry? - - *c = hi; - return lo; - } - -/* -* Word Multiply/Add -*/ -inline word word_madd3(word a, word b, word c, word* d) - { - word hi, lo; - lo = _umul128(a, b, &hi); - - lo += c; - hi += (lo < c); // carry? - - lo += *d; - hi += (lo < *d); // carry? - - *d = hi; - return lo; - } - -} - -} - -#endif diff --git a/src/math/bigint/mp_msvc64/info.txt b/src/math/bigint/mp_msvc64/info.txt new file mode 100644 index 000000000..56ae05927 --- /dev/null +++ b/src/math/bigint/mp_msvc64/info.txt @@ -0,0 +1,17 @@ +load_on dep + +mp_bits 64 + + +mp_asm.h +mp_generic:mp_asmi.h + + + +amd64 +ia64 + + + +msvc + diff --git a/src/math/bigint/mp_msvc64/mp_asm.h b/src/math/bigint/mp_msvc64/mp_asm.h new file mode 100644 index 000000000..8e4535c35 --- /dev/null +++ b/src/math/bigint/mp_msvc64/mp_asm.h @@ -0,0 +1,61 @@ +/* +* Multiply-Add for 64-bit MSVC +* (C) 2010 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ + +#ifndef BOTAN_MP_ASM_H__ +#define BOTAN_MP_ASM_H__ + +#include +#include + +#if (BOTAN_MP_WORD_BITS != 64) + #error The mp_msvc64 module requires that BOTAN_MP_WORD_BITS == 64 +#endif + +#pragma intrinsic(_umul128) + +namespace Botan { + +extern "C" { + +/* +* Word Multiply +*/ +inline word word_madd2(word a, word b, word* c) + { + word hi, lo; + lo = _umul128(a, b, &hi); + + lo += *c; + hi += (lo < *c); // carry? + + *c = hi; + return lo; + } + +/* +* Word Multiply/Add +*/ +inline word word_madd3(word a, word b, word c, word* d) + { + word hi, lo; + lo = _umul128(a, b, &hi); + + lo += c; + hi += (lo < c); // carry? + + lo += *d; + hi += (lo < *d); // carry? + + *d = hi; + return lo; + } + +} + +} + +#endif -- cgit v1.2.3