summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/ARM/neon_vshl_minint.ll
diff options
context:
space:
mode:
authorLuke Cheeseman <luke.cheeseman@arm.com>2015-07-24 09:31:48 +0000
committerLuke Cheeseman <luke.cheeseman@arm.com>2015-07-24 09:31:48 +0000
commitb5c627aba864517300df961027dbc85a9d3c142e (patch)
tree2fec3b37dc4fac3eb32a63331a08a06a890ba8e2 /llvm/test/CodeGen/ARM/neon_vshl_minint.ll
parent5aa27e1acca98e3f8f1cf2da47dc4b05297786c5 (diff)
downloadbcm5719-llvm-b5c627aba864517300df961027dbc85a9d3c142e.tar.gz
bcm5719-llvm-b5c627aba864517300df961027dbc85a9d3c142e.zip
When lowering vector shifts a check is performed to see if the value to shift by
is an immediate, in this check the value is negated and stored in and int64_t. The value can be -2^63 yet the result cannot be stored in an int64_t and this gives some undefined behaviour causing failures. The negation is only necessary when the values is within a certain range and so it should not need to negate -2^63, this patch introduces this and also a regression test. Differential Revision: http://reviews.llvm.org/D11408 llvm-svn: 243100
Diffstat (limited to 'llvm/test/CodeGen/ARM/neon_vshl_minint.ll')
-rw-r--r--llvm/test/CodeGen/ARM/neon_vshl_minint.ll13
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/ARM/neon_vshl_minint.ll b/llvm/test/CodeGen/ARM/neon_vshl_minint.ll
new file mode 100644
index 00000000000..769eff845fd
--- /dev/null
+++ b/llvm/test/CodeGen/ARM/neon_vshl_minint.ll
@@ -0,0 +1,13 @@
+; RUN: llc < %s -mtriple=arm-none-eabi -mcpu=cortex-a8 2>&1 | FileCheck %s
+; RUN: llc < %s -mtriple=thumb-none-eabi -mcpu=cortex-a8 2>&1 | FileCheck %s
+
+define <1 x i64> @vshl_minint() #0 {
+ entry:
+ ; CHECK-LABEL: vshl_minint
+ ; CHECK: vldr
+ ; CHECK: vshl.u64
+ %vshl.i = tail call <1 x i64> @llvm.arm.neon.vshiftu.v1i64(<1 x i64> undef, <1 x i64> <i64 -9223372036854775808>)
+ ret <1 x i64> %vshl.i
+}
+
+declare <1 x i64> @llvm.arm.neon.vshiftu.v1i64(<1 x i64>, <1 x i64>)
OpenPOWER on IntegriCloud