diff options
author | Hyeongseok Oh <hseok82.oh@smasung.com> | 2016-08-19 11:06:52 +0900 |
---|---|---|
committer | Hyeongseok Oh <hseok82.oh@smasung.com> | 2016-08-19 11:06:52 +0900 |
commit | 39302ecfa7a32bb39d30e299a1863d0af59c31c5 (patch) | |
tree | 2166e27fa234c680a75fc6447567428ae7754300 /src/vm/jithelpers.cpp | |
parent | fdf58bc1b0e3906c5a3fba0017ea8f2f9887a892 (diff) | |
download | coreclr-39302ecfa7a32bb39d30e299a1863d0af59c31c5.tar.gz coreclr-39302ecfa7a32bb39d30e299a1863d0af59c31c5.tar.bz2 coreclr-39302ecfa7a32bb39d30e299a1863d0af59c31c5.zip |
fix for correct conversion from negative double to unsigned long in ARM (modify helper)
Diffstat (limited to 'src/vm/jithelpers.cpp')
-rw-r--r-- | src/vm/jithelpers.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/vm/jithelpers.cpp b/src/vm/jithelpers.cpp index 1f7c63035d..0f05342a63 100644 --- a/src/vm/jithelpers.cpp +++ b/src/vm/jithelpers.cpp @@ -588,17 +588,8 @@ 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 } @@ -623,7 +614,15 @@ HCIMPL1_V(UINT64, JIT_Dbl2ULng, double val) const double two63 = 2147483648.0 * 4294967296.0; UINT64 ret; if (val < two63) { +#ifdef _TARGET_XARCH_ ret = FastDbl2Lng(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. + ret = UINT64(val); +#endif } else { // subtract 0x8000000000000000, do the convert then add it back again |