-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Microsoft Visual C++ (latest version) #44
Comments
Hi Keith / @bitlush , Thank you for your interest in the project! I've never tried compiling with MS's Visual Studio, nor do I have windows/Visual Studio... Would you be interested in contributing, e.g., by sending a pull request?
explicit operator auto() const { return data; } I am not sure if I actually use that somewhere. explicit operator big_int<sizeof...(Modulus), T>() const { return data; }
constexpr auto ext_gcd(std::integer_sequence<T, A...>,
std::integer_sequence<T, B...>) must have been caused by the |
I'll fork and create a pull request as I've managed to get the bits I've tried compiling. I've also had to sprinkle a few static_casts around the code to remove compiler warnings. I also use Clang and AppleClang as well so I can easily do a regression on those. Great work by the way, this is a wonderful library. |
Great! I'd be very interested to see where exactly those static_casts are needed. BTW The old multiplication code (circumventing __uint128_t ) can be found commit: fba16e2 |
@niekbouman, OK thanks for the heads up. It'll be a day or two before I can check my changes through as the tests are problematic under MSVC.
After some more thought, I think the simplest approach is to provide a custom implementation of 128 integers for non-supporting platforms so that enough of I haven't spent enough time understanding the compiler warnings to have a strong view on the cleanest way to avoid them. |
With respect to 128-bit arithmetic, the following seems to be useful, i.e., an 128-bit multiply intrinsic for MS Visual C++: However, double-word (128bit) addition is also needed, because of line 53 in the TT t = static_cast<TT>(u[i]) * static_cast<TT>(v[j]) + w[i + j] + k; what is used here, is that if you multiply two unsigned operands A and B that can maximally be 2^{64}-1, then there is room left for adding two extra unsigned operands C and D to the result, where C and D can also maximally be 2^{64}-1. |
Hi Keith @bitlush , Any luck so far getting the code to run on MSVC? best, |
A couple of problems when compiling in MSVC (latest version)
Compiler errors:
Severity Code Description Project File Line Suppression State
Error C3177 you cannot have a conversion function to a type that contains 'auto' ctbignum\field.hpp 29
Severity Code Description Project File Line Suppression State
Error C3547 template parameter 'Is' cannot be used because it follows a template parameter pack and cannot be deduced from the function parameters of 'cbn::ext_gcd' dsapp ctbignum\gcd.hpp 69
Incompatible features
#define CBN_ALWAYS_INLINE [[gnu::always_inline]] in config.hpp
template <> struct dbl_bitlen<uint64_t> { using type = __uint128_t; };
template <> struct dbl_bitlen { using type = __uint128_t; };
in type_traits.hpp
The text was updated successfully, but these errors were encountered: