We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 5443 - [PATCH] Implement SDL_MostSignificantBitIndex32 with MSVC intrinsics
Summary: [PATCH] Implement SDL_MostSignificantBitIndex32 with MSVC intrinsics
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: *don't know* (show other bugs)
Version: HG 2.0
Hardware: All Windows 10
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-03 20:06 UTC by Cameron Gutman
Modified: 2021-01-03 21:57 UTC (History)
0 users

See Also:


Attachments
Patch (770 bytes, patch)
2021-01-03 20:06 UTC, Cameron Gutman
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Cameron Gutman 2021-01-03 20:06:37 UTC
Created attachment 4636 [details]
Patch

MSVC provides a _BitScanReverse() intrinsic that we can use to implement SDL_MostSignificantBitIndex32().
Comment 1 Sam Lantinga 2021-01-03 21:57:31 UTC
Patch added, thanks!
https://hg.libsdl.org/SDL/rev/2dd9827ac682