[PATCH] D49274: [CUDA] Provide integer SIMD functions for CUDA-9.2

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 19 17:13:46 PDT 2018


tra marked 2 inline comments as done.
tra added a comment.

Ben, PTAL.



================
Comment at: clang/lib/Headers/__clang_cuda_device_functions.h:1080
+  unsigned int r;
+  asm("vabsdiff2.u32.u32.u32.sat %0,%1,%2,0;" : "=r"(r) : "r"(__a), "r"(__b));
+  return r;
----------------
bkramer wrote:
> Should this really saturate?
Hmm. My tests didn't catch this. I wonder if ptxas just ignores .sat here.
Yup. I've confirmed that the tests do run on this function and do trigger if I intentionally introduce an error.
In any case, I've removed the .sat as it should not be there.


================
Comment at: clang/lib/Headers/__clang_cuda_device_functions.h:1095
+  unsigned int r;
+  asm("vabsdiff2.s32.s32.s32.sat %0,%1,0,0;" : "=r"(r) : "r"(__a));
+  return r;
----------------
bkramer wrote:
> vabsdiff4?
Ah. I've missed __vabsssN in my tests. Fixed both the header and the tests.


https://reviews.llvm.org/D49274





More information about the cfe-commits mailing list