diff options
| author | mayeut <mayeut@users.noreply.github.com> | 2015-07-27 20:12:48 +0200 |
|---|---|---|
| committer | mayeut <mayeut@users.noreply.github.com> | 2015-07-27 20:12:48 +0200 |
| commit | b0035538af1209abbe405bf2ab45921169620513 (patch) | |
| tree | ee4e366ca30cc4fa36a8758fc25c880447bb3ffc /src/lib/openjp2/opj_includes.h | |
| parent | 45ccf501f04b062287fd416b35451ce5ed55cb93 (diff) | |
Use __emul under msvc x86 for fast 64 = 32 * 32
Update uclouvain/openjpeg#220
Diffstat (limited to 'src/lib/openjp2/opj_includes.h')
| -rw-r--r-- | src/lib/openjp2/opj_includes.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/openjp2/opj_includes.h b/src/lib/openjp2/opj_includes.h index bd9ae09a..22b2f62a 100644 --- a/src/lib/openjp2/opj_includes.h +++ b/src/lib/openjp2/opj_includes.h @@ -162,12 +162,16 @@ static INLINE long opj_lrintf(float f) { } #endif - - #if defined(_MSC_VER) && (_MSC_VER < 1400) #define vsnprintf _vsnprintf #endif +/* MSVC x86 is really bad at doing int64 = int32 * int32 on its own. Use intrinsic. */ +#if defined(_MSC_VER) && (_MSC_VER >= 1400) && !defined(__INTEL_COMPILER) && defined(_M_IX86)
+# include <intrin.h>
+# pragma intrinsic(__emul)
+#endif + #include "opj_inttypes.h" #include "opj_clock.h" #include "opj_malloc.h" |
