[PATCH] D20897: [AVX512/AVX][Intrinsics] Fix Variable Bit Shift Right Arithmetic intrinsic lowering.

Igor Breger via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 2 00:38:00 PDT 2016


igorb created this revision.
igorb added reviewers: delena, AsafBadouh.
igorb added a subscriber: llvm-commits.
igorb set the repository for this revision to rL LLVM.

[AVX512/AVX][Intrinsics] Fix Variable Bit Shift Right Arithmetic intrinsic lowering.
Intel SRA intrinsic behavior are different from LLVM ashr instruction.
LLVM ashr instruction : If op2 is (statically or dynamically) equal to or larger than the number of bits in op1, the result is undefined.
Intel SRA: If the unsigned integer value specified in the respective data element of the second source operand is greater than 15 (for words), 31 (for doublewords), or 63 (for a quadword), then the destination data element are filled with the corresponding sign bit of the source element.

Perform constant folding before SRA creation to match intrinsic behavior.

Repository:
  rL LLVM

http://reviews.llvm.org/D20897

Files:
  lib/Target/X86/X86ISelLowering.cpp
  lib/Target/X86/X86IntrinsicsInfo.h
  test/CodeGen/X86/avx2-intrinsics-x86.ll
  test/CodeGen/X86/avx512bw-intrinsics.ll
  test/CodeGen/X86/avx512vl-intrinsics.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D20897.59341.patch
Type: text/x-patch
Size: 12402 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160602/58b9301e/attachment.bin>


More information about the llvm-commits mailing list