dbry / WavPack

WavPack encode/decode library, command-line programs, and several plugins
BSD 3-Clause "New" or "Revised" License
371 stars 67 forks source link

enable clz and ctz optimizations for watcom builds. #141

Closed sezero closed 2 years ago

sezero commented 2 years ago

Uses bsr and bsf inline asm in watcom aux pragma syntax.

Question: these optimizations are not enabled in MSVC 32 bit builds: is there a reason?

dbry commented 2 years ago

Uses bsr and bsf inline asm in watcom aux pragma syntax.

Question: these optimizations are not enabled in MSVC 32 bit builds: is there a reason?

I believe that every time I've tested it, the optimized version is slower. Haven't done that in some time though, and maybe not since I switched to MSVC 2019.

sezero commented 2 years ago

I believe that every time I've tested it, the optimized version is slower.

Huh.. I see.

sezero commented 2 years ago

I believe that every time I've tested it, the optimized version is slower.

Huh.. I see.

Interesting though, mingw and unix builds have them enabled by default provided that the builtins are available. Only MSVC x86 builds are the outliers.

Anyways, will this patch go into the upcoming release or you intend to delay it for later?

dbry commented 2 years ago

I believe that every time I've tested it, the optimized version is slower.

Huh.. I see.

Interesting though, mingw and unix builds have them enabled by default provided that the builtins are available. Only MSVC x86 builds are the outliers.

Yes, that sounds familiar. Only MSVC was slower using the builtins. But I may test again now that I'm using a newer VS and am on a newer CPU. Of course, I could test on a wide range of CPUs, but the difference was not very big in any case.

Anyways, will this patch go into the upcoming release or you intend to delay it for later?

I'll pull it in right now.