diff options
| author | Artem Belevich <tra@google.com> | 2020-01-22 15:12:49 -0800 |
|---|---|---|
| committer | Artem Belevich <tra@google.com> | 2020-01-24 15:07:22 -0800 |
| commit | 0df13627c6a4006de39e5f01d81a338793b0e82b (patch) | |
| tree | 612ac23b657ade737be8782acf984a92269735f8 | |
| parent | d11abddb32f6475441872ed19e0e3091d7d7f087 (diff) | |
| download | bcm5719-llvm-0df13627c6a4006de39e5f01d81a338793b0e82b.tar.gz bcm5719-llvm-0df13627c6a4006de39e5f01d81a338793b0e82b.zip | |
[CUDA] Fix order of memcpy arguments in __shfl_*(<64-bit type>).
Wrong argument order resulted in broken shfl ops for 64-bit types.
(cherry picked from commit cc14de88da27a8178976972bdc8211c31f7ca9ae)
| -rw-r--r-- | clang/lib/Headers/__clang_cuda_intrinsics.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Headers/__clang_cuda_intrinsics.h b/clang/lib/Headers/__clang_cuda_intrinsics.h index b67461a146f..c7bff6a9d8f 100644 --- a/clang/lib/Headers/__clang_cuda_intrinsics.h +++ b/clang/lib/Headers/__clang_cuda_intrinsics.h @@ -45,7 +45,7 @@ _Static_assert(sizeof(__val) == sizeof(__Bits)); \ _Static_assert(sizeof(__Bits) == 2 * sizeof(int)); \ __Bits __tmp; \ - memcpy(&__val, &__tmp, sizeof(__val)); \ + memcpy(&__tmp, &__val, sizeof(__val)); \ __tmp.__a = ::__FnName(__tmp.__a, __offset, __width); \ __tmp.__b = ::__FnName(__tmp.__b, __offset, __width); \ long long __ret; \ @@ -129,7 +129,7 @@ __MAKE_SHUFFLES(__shfl_xor, __nvvm_shfl_bfly_i32, __nvvm_shfl_bfly_f32, 0x1f, _Static_assert(sizeof(__val) == sizeof(__Bits)); \ _Static_assert(sizeof(__Bits) == 2 * sizeof(int)); \ __Bits __tmp; \ - memcpy(&__val, &__tmp, sizeof(__val)); \ + memcpy(&__tmp, &__val, sizeof(__val)); \ __tmp.__a = ::__FnName(__mask, __tmp.__a, __offset, __width); \ __tmp.__b = ::__FnName(__mask, __tmp.__b, __offset, __width); \ long long __ret; \ |

