aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMITSUNARI Shigeo <herumi@nifty.com>2016-11-28 15:38:13 +0800
committerMITSUNARI Shigeo <herumi@nifty.com>2016-11-28 15:38:13 +0800
commitd9a1692528d63b5254b1315104ab8560439e0efc (patch)
tree3c516e245fd4b8dfa6b5e71e29f574165c4c3e1e /src
parent066fe4b95576b0f77f101a42c863e494666266f0 (diff)
downloadtangerine-mcl-d9a1692528d63b5254b1315104ab8560439e0efc.tar.gz
tangerine-mcl-d9a1692528d63b5254b1315104ab8560439e0efc.tar.zst
tangerine-mcl-d9a1692528d63b5254b1315104ab8560439e0efc.zip
disable llvm if gmp/gmp_mont
Diffstat (limited to 'src')
-rw-r--r--src/fp.cpp42
1 files changed, 23 insertions, 19 deletions
diff --git a/src/fp.cpp b/src/fp.cpp
index 8d758df..fc03aeb 100644
--- a/src/fp.cpp
+++ b/src/fp.cpp
@@ -207,7 +207,7 @@ void setOp2(Op& op)
}
template<size_t N>
-void setOp(Op& op)
+void setOp(Op& op, Mode mode)
{
// generic setup
op.fp_isZero = isZeroC<N>;
@@ -220,7 +220,11 @@ void setOp(Op& op)
}
setOp2<N, Gtag, true>(op);
#ifdef MCL_USE_LLVM
- setOp2<N, Ltag, (N * UnitBitSize <= 256)>(op);
+ if (mode != fp::FP_GMP && mode != fp::FP_GMP_MONT) {
+ setOp2<N, Ltag, (N * UnitBitSize <= 256)>(op);
+ }
+#else
+ (void)mode;
#endif
}
@@ -339,26 +343,26 @@ void Op::init(const std::string& mstr, size_t maxBitSize, Mode mode)
#endif
N = (bitSize + UnitBitSize - 1) / UnitBitSize;
switch (N) {
- case 1: setOp<1>(*this); break;
- case 2: setOp<2>(*this); break;
- case 3: setOp<3>(*this); break;
- case 4: setOp<4>(*this); break; // 256 if 64-bit
- case 5: setOp<5>(*this); break;
- case 6: setOp<6>(*this); break;
- case 7: setOp<7>(*this); break;
- case 8: setOp<8>(*this); break;
- case 9: setOp<9>(*this); break; // 576 if 64-bit
+ case 1: setOp<1>(*this, mode); break;
+ case 2: setOp<2>(*this, mode); break;
+ case 3: setOp<3>(*this, mode); break;
+ case 4: setOp<4>(*this, mode); break; // 256 if 64-bit
+ case 5: setOp<5>(*this, mode); break;
+ case 6: setOp<6>(*this, mode); break;
+ case 7: setOp<7>(*this, mode); break;
+ case 8: setOp<8>(*this, mode); break;
+ case 9: setOp<9>(*this, mode); break; // 576 if 64-bit
#if CYBOZU_OS_BIT == 32 || MCL_MAX_BIT_SIZE == 768
- case 10: setOp<10>(*this); break;
- case 11: setOp<11>(*this); break;
- case 12: setOp<12>(*this); break; // 768 if 64-bit
+ case 10: setOp<10>(*this, mode); break;
+ case 11: setOp<11>(*this, mode); break;
+ case 12: setOp<12>(*this, mode); break; // 768 if 64-bit
#endif
#if CYBOZU_OS_BIT == 32
- case 13: setOp<13>(*this); break;
- case 14: setOp<14>(*this); break;
- case 15: setOp<15>(*this); break;
- case 16: setOp<16>(*this); break;
- case 17: setOp<17>(*this); break; // 544 if 32-bit
+ case 13: setOp<13>(*this, mode); break;
+ case 14: setOp<14>(*this, mode); break;
+ case 15: setOp<15>(*this, mode); break;
+ case 16: setOp<16>(*this, mode); break;
+ case 17: setOp<17>(*this, mode); break; // 544 if 32-bit
#endif
default:
throw cybozu::Exception("Op::init:not:support") << N << mstr;