summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMichael Liao <michael.liao@intel.com>2013-10-15 17:51:02 +0000
committerMichael Liao <michael.liao@intel.com>2013-10-15 17:51:02 +0000
commitdc8c044a9a3e00cab52ca204717de7aee9dab1be (patch)
tree89ad409fb774f860488c22c9bf0af76e96f9d7ad /test
parentd45b3c4653dc4b18074b04662b6d0009880214e3 (diff)
downloadllvm-dc8c044a9a3e00cab52ca204717de7aee9dab1be.tar.gz
llvm-dc8c044a9a3e00cab52ca204717de7aee9dab1be.tar.bz2
llvm-dc8c044a9a3e00cab52ca204717de7aee9dab1be.tar.xz
Fix PR16807
- Lower signed division by constant powers-of-2 to target-independent DAG operators instead of target-dependent ones to support them better on targets where vector types are legal but shift operators on that types are illegal. E.g., on AVX, PSRAW is only available on <8 x i16> though <16 x i16> is a legal type. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192721 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/X86/pr16807.ll18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/CodeGen/X86/pr16807.ll b/test/CodeGen/X86/pr16807.ll
new file mode 100644
index 0000000000..6d55d99a6a
--- /dev/null
+++ b/test/CodeGen/X86/pr16807.ll
@@ -0,0 +1,18 @@
+; RUN: llc < %s -mtriple=x86_64-linux-gnu -mcpu=core-avx-i | FileCheck %s
+
+define <16 x i16> @f_fu(<16 x i16> %bf) {
+allocas:
+ %avg.i.i = sdiv <16 x i16> %bf, <i16 4, i16 4, i16 4, i16 4, i16 4, i16 4, i16 4, i16 4, i16 4, i16 4, i16 4, i16 4, i16 4, i16 4, i16 4, i16 4>
+ ret <16 x i16> %avg.i.i
+}
+
+; CHECK: f_fu
+; CHECK: psraw
+; CHECK: psrlw
+; CHECK: paddw
+; CHECK: psraw
+; CHECK: psraw
+; CHECK: psrlw
+; CHECK: paddw
+; CHECK: psraw
+; CHECK: ret