Skip to content
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

Replace inline assembly with function prototypes in sanity check #2101

Open
tobiasdiez opened this issue Oct 27, 2024 · 2 comments
Open

Replace inline assembly with function prototypes in sanity check #2101

tobiasdiez opened this issue Oct 27, 2024 · 2 comments

Comments

@tobiasdiez
Copy link
Contributor

I get the following error:

C:\Users\Tobia\.conda\envs\sage-dev\Library\include\flint\fmpz_mpoly.h(1244): error C2664: '__int64 _mul128(__int64,__int64,__int64 *)': cannot convert argument 3 from 'mp_limb_t *' to '__int64 *'
C:\Users\Tobia\.conda\envs\sage-dev\Library\include\flint\fmpz_mpoly.h(1244): note: Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or parenthesized function-style cast
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include\intrin.h(941): note: see declaration of '_mul128'
C:\Users\Tobia\.conda\envs\sage-dev\Library\include\flint\fmpz_mpoly.h(1244): note: while trying to match the argument list '(mp_limb_signed_t, mp_limb_signed_t, mp_limb_t *)'
C:\Users\Tobia\.conda\envs\sage-dev\Library\include\flint\fmpz_mpoly.h(1245): warning C4146: unary minus operator applied to unsigned type, result still unsigned
C:\Users\Tobia\.conda\envs\sage-dev\Library\include\flint\fmpz_mpoly.h(1253): error C2664: '__int64 _mul128(__int64,__int64,__int64 *)': cannot convert argument 3 from 'mp_limb_t *' to '__int64 *'
C:\Users\Tobia\.conda\envs\sage-dev\Library\include\flint\fmpz_mpoly.h(1253): note: Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or parenthesized function-style cast
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include\intrin.h(941): note: see declaration of '_mul128'
C:\Users\Tobia\.conda\envs\sage-dev\Library\include\flint\fmpz_mpoly.h(1253): note: while trying to match the argument list '(mp_limb_signed_t, mp_limb_signed_t, mp_limb_t *)'
C:\Users\Tobia\.conda\envs\sage-dev\Library\include\flint\fmpz_mpoly.h(1254): warning C4146: unary minus operator applied to unsigned type, result still unsigned
C:\Users\Tobia\.conda\envs\sage-dev\Library\include\flint\calcium.h(155): warning C4146: unary minus operator applied to unsigned type, result still unsigned
C:\Users\Tobia\.conda\envs\sage-dev\Library\include\flint\mpoly.h(33): warning C4244: 'initializing': conversion from 'double' to 'mp_limb_signed_t', possible loss of data
C:\Users\Tobia\.conda\envs\sage-dev\Library\include\flint\mpoly.h(974): warning C4146: unary minus operator applied to unsigned type, result still unsigned
C:/Users/Tobia/.conda/envs/sage-dev/Library/include\flint/long_extras.h(37): error C2664: '__int64 _mul128(__int64,__int64,__int64 *)': cannot convert argument 3 from 'mp_limb_t *' to '__int64 *'
C:/Users/Tobia/.conda/envs/sage-dev/Library/include\flint/long_extras.h(37): note: Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or parenthesized function-style cast
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include\intrin.h(941): note: see declaration of '_mul128'
C:/Users/Tobia/.conda/envs/sage-dev/Library/include\flint/long_extras.h(37): note: while trying to match the argument list '(mp_limb_signed_t, mp_limb_signed_t, mp_limb_t *)'
C:/Users/Tobia/.conda/envs/sage-dev/Library/include\flint/long_extras.h(39): warning C4146: unary minus operator applied to unsigned type, result still unsigned
C:/Users/Tobia/.conda/envs/sage-dev/Library/include\flint/long_extras.h(54): error C2664: '__int64 _mul128(__int64,__int64,__int64 *)': cannot convert argument 3 from 'mp_limb_t *' to '__int64 *'
C:/Users/Tobia/.conda/envs/sage-dev/Library/include\flint/long_extras.h(54): note: Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or parenthesized function-style cast
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include\intrin.h(941): note: see declaration of '_mul128'
C:/Users/Tobia/.conda/envs/sage-dev/Library/include\flint/long_extras.h(54): note: while trying to match the argument list '(mp_limb_signed_t, mp_limb_signed_t, mp_limb_t *)'
C:/Users/Tobia/.conda/envs/sage-dev/Library/include\flint/long_extras.h(55): error C2664: '__int64 _mul128(__int64,__int64,__int64 *)': cannot convert argument 3 from 'mp_limb_t *' to '__int64 *'
C:/Users/Tobia/.conda/envs/sage-dev/Library/include\flint/long_extras.h(55): note: Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or parenthesized function-style cast
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include\intrin.h(941): note: see declaration of '_mul128'

with __MACHINEX64(__int64 _mul128(__int64 _Multiplier, __int64 _Multiplicand, __int64 * _HighProduct)) being the definition in MSVC.

@albinahlback
Copy link
Collaborator

Those errors can safely be ignored, but they should be fixed. We should sanity check without the use of assembly to make compiler recognize these warnings.

@albinahlback albinahlback changed the title _mul128 incompatibility with MSVC 20 Replace inline assembly with function prototypes in sanity check Oct 27, 2024
@albinahlback
Copy link
Collaborator

Perhaps not. Perhaps one should simply try casting instead. I'll investigate this in a week or two.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants