Add MSVC implementations for ULong__maxIndex and ULong__minIndex #8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Builds are currently broken for
pyvex
on MSVC due to a couple of issues. One is here in thevex
project (which I'll describe below) and one is in thepyvex
project, which I've submitted another PR for (see angr/pyvex#70).Currently,
vex
is using a couple ofgcc
builtin functions which, unsurprisngly, aren't present in the MSVC ecosystem. There are some very similar builtins in MSVC (_BitScanForward64
,_BitScanReverse64
) which would have done the job with some minor tweaks. However, those builtins are only present in the 64-bit compiler, which is problematic given that the default VS2015 developer prompt has the 32-bit version ofcl.exe
on its path.As such, I've come up with a 32-bit friendly solution by adding some implementations of the relevant algorithms from https://chessprogramming.wikispaces.com/BitScan. I haven't formally verified my implementation (and I lack the wizardry to fully understand the implementations I'm using), but from the limitied testing I've done, the results they're producing look sane (and identical to the output from the
gcc
functions).If you'd prefer an alternate strategy for resolving this though, let me know and I'll go back to the drawing board.