Skip to content

Conversation

@WalterKruger
Copy link
Contributor

Added 64-bit fastdiv & mod support for MSVC via multi-word arithmetic and VS specific intrinsics. I needed to add additional functions for that. This produces very similar asm output to GCC/Clang's __uint128_t.

I also had to slightly modify the tests to make it compatible with MSVC:

  • Removed #ifndef _MSC_VER directives
  • __uint128_t => auto
  • Literals -2147483648 & -0x80000000 => INT32_MIN (to prevent overflow)
  • Added VS compatible doNotOptimizeAway

MSVC_PassedTest

Added 64-bit fastdiv & mod support for MSVC via multi-word arithmetic and VS specific intrinsics. This produces almost identical asm output to GCC/Clang's __uint128_t.

I also had to slightly modify the tests to make it compatible for MSVC:
- Removed `#ifndef _MSC_VER` directives
- `__uint128_t` => `auto`
- Literals `-2147483648` & `-0x80000000` => `INT32_MIN` (to prevent overflow)
- Added VS compatible `doNotOptimizeAway`
There was a bunch of superfluous indentation in the multi-word arithmetic functions.
@lemire
Copy link
Owner

lemire commented Nov 15, 2024

Merging.

@lemire lemire merged commit 5589d93 into lemire:master Nov 15, 2024
3 checks passed
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

Successfully merging this pull request may close these issues.

2 participants