diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2019-08-26 09:20:17 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-08-26 09:20:17 -0400 |
| commit | 04465b2b1ac4130b8306ada86584d46ffd2e2a3e (patch) | |
| tree | 8441dac71fcc66fcfc7aae73dd8cc294a9e1fc3c | |
| parent | 06a0e3980fd04fa265bd20eb11f2abc18bd6a215 (diff) | |
Hotfix/cpu asdouble (#1032)
* Fix asdouble in C++ prelude.
* Fix small typo
| -rw-r--r-- | prelude/slang-cpp-scalar-intrinsics.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/prelude/slang-cpp-scalar-intrinsics.h b/prelude/slang-cpp-scalar-intrinsics.h index 40d137395..8809d9575 100644 --- a/prelude/slang-cpp-scalar-intrinsics.h +++ b/prelude/slang-cpp-scalar-intrinsics.h @@ -133,7 +133,7 @@ SLANG_FORCE_INLINE uint32_t I32_asuint(int32_t x) { return uint32_t(x); } SLANG_FORCE_INLINE double I32_asdouble(int32_t low, int32_t hi ) { Union64 u; - u.i = (int64_t(hi) << 32) | low; + u.u = (uint64_t(hi) << 32) | uint32_t(low); return u.d; } @@ -166,7 +166,7 @@ SLANG_FORCE_INLINE void F64_asuint(double d, uint32_t& low, uint32_t& hi) hi = uint32_t(u.u >> 32); } -SLANG_FORCE_INLINE void F64_asint(double d, int32_t& low, uint32_t& hi) +SLANG_FORCE_INLINE void F64_asint(double d, int32_t& low, int32_t& hi) { Union64 u; u.d = d; |
