From eb8768f8c2f4b7efe9c7f9b1c14175ec0d873a28 Mon Sep 17 00:00:00 2001 From: MITSUNARI Shigeo Date: Mon, 31 Oct 2016 13:51:16 +0900 Subject: [PATCH] specialization of template for llvm --- src/fp_llvm.hpp | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 src/fp_llvm.hpp diff --git a/src/fp_llvm.hpp b/src/fp_llvm.hpp new file mode 100644 index 0000000..cc28753 --- /dev/null +++ b/src/fp_llvm.hpp @@ -0,0 +1,41 @@ +#pragma once + +namespace mcl { namespace fp { + +#define MCL_DEF_LLVM_FUNC(n) \ +template<>const u3u AddPre::f = &mcl_fp_addPre ## n ## L; \ +template<>const u3u SubPre::f = &mcl_fp_subPre ## n ## L; \ +template<>const void3u MulPreCore::f = &mcl_fpDbl_mulPre ## n ## L; \ +template<>const void2u SqrPre::f = &mcl_fpDbl_sqrPre ## n ## L; \ +template<>const void2uI MulUnitPre::f = &mcl_fp_mulUnitPre ## n ## L; \ +template<>const void4u Add::f = &mcl_fp_add ## n ## L; \ +template<>const void4u Sub::f = &mcl_fp_sub ## n ## L; \ +template<>const void4u Mont::f = &mcl_fp_mont ## n ## L; \ +template<>const void3u MontRed::f = &mcl_fp_montRed ## n ## L; \ +template<>const void4u DblAdd::f = &mcl_fpDbl_add ## n ## L; \ +template<>const void4u DblSub::f = &mcl_fpDbl_sub ## n ## L; \ + +MCL_DEF_LLVM_FUNC(1) +MCL_DEF_LLVM_FUNC(2) +MCL_DEF_LLVM_FUNC(3) +MCL_DEF_LLVM_FUNC(4) +MCL_DEF_LLVM_FUNC(5) +MCL_DEF_LLVM_FUNC(6) +MCL_DEF_LLVM_FUNC(7) +MCL_DEF_LLVM_FUNC(8) +MCL_DEF_LLVM_FUNC(9) +#if CYBOZU_OS_BIT == 32 || MCL_MAX_BIT_SIZE == 768 +MCL_DEF_LLVM_FUNC(10) +MCL_DEF_LLVM_FUNC(11) +MCL_DEF_LLVM_FUNC(12) +#endif +#if CYBOZU_OS_BIT == 32 +MCL_DEF_LLVM_FUNC(13) +MCL_DEF_LLVM_FUNC(14) +MCL_DEF_LLVM_FUNC(15) +MCL_DEF_LLVM_FUNC(16) +MCL_DEF_LLVM_FUNC(17) +#endif + +} } // mcl::fp +