diff options
author | Hyeongseok Oh <hseok82.oh@smasung.com> | 2016-08-16 19:22:06 +0900 |
---|---|---|
committer | Hyeongseok Oh <hseok82.oh@smasung.com> | 2016-08-16 19:22:06 +0900 |
commit | fdf58bc1b0e3906c5a3fba0017ea8f2f9887a892 (patch) | |
tree | 04897dadb1121bd0c452fc2fc0be55af8caf3a2a /src/vm/jithelpers.cpp | |
parent | deb00ad58acf627763b6c0a7833fa789e3bb1cd0 (diff) | |
download | coreclr-fdf58bc1b0e3906c5a3fba0017ea8f2f9887a892.tar.gz coreclr-fdf58bc1b0e3906c5a3fba0017ea8f2f9887a892.tar.bz2 coreclr-fdf58bc1b0e3906c5a3fba0017ea8f2f9887a892.zip |
fix for correct conversion from negative double to unsigned long in ARM
Diffstat (limited to 'src/vm/jithelpers.cpp')
-rw-r--r-- | src/vm/jithelpers.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/vm/jithelpers.cpp b/src/vm/jithelpers.cpp index 1626810758..1f7c63035d 100644 --- a/src/vm/jithelpers.cpp +++ b/src/vm/jithelpers.cpp @@ -588,8 +588,17 @@ FORCEINLINE INT64 FastDbl2Lng(double val) FCALL_CONTRACT; return HCCALL1_V(JIT_Dbl2Lng, val); #else +// In x86/x64, conversion result of negative double to unsigned integer is +// bit-equivalent unsigned value. +// But other architecture's compiler convert negative doubles to zero when +// the target is unsigned. +#ifdef _TARGET_XARCH_ FCALL_CONTRACT; return((__int64) val); +#else + FCALL_CONTRACT; + return((unsigned __int64) val); +#endif #endif } |