[PATCH] D28216: AVX-512: Truncate with unsigned saturation.

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 10 05:31:26 PST 2017


RKSimon added a comment.

In https://reviews.llvm.org/D28216#641199, @delena wrote:

> 2. I promised to Simon to cover non-avx512 cases with VPACKUS. Now it is in. Additional tests are in avx-trunc.ll.


Thank you!



================
Comment at: ../lib/Target/X86/X86ISelLowering.cpp:31130
+  //Saturation with truncation. We truncate from InVT to VT.
+  assert(In.getValueType().getScalarSizeInBits() > VT.getScalarSizeInBits() &&
+    "Unexpected types for truncate operation");
----------------
In.getScalarValueSizeInBits()


================
Comment at: ../lib/Target/X86/X86ISelLowering.cpp:31144
+  // the element size of the destination type.
+  return (C == ((uint64_t)1 << VT.getScalarSizeInBits()) - 1) ?
+    SrcVal : SDValue();
----------------
Can you use APIntOps::isMask here?
```
APIntOps::isMask(VT.getScalarSizeInBits(), C)
```


Repository:
  rL LLVM

https://reviews.llvm.org/D28216





More information about the llvm-commits mailing list