2014-04-03 16:01:44 +00:00
|
|
|
; RUN: llc -mtriple=arm-eabi -mattr=+neon %s -o - | FileCheck %s
|
2009-06-22 23:27:02 +00:00
|
|
|
|
|
|
|
define <8 x i8> @v_movi8() nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: v_movi8:
|
2010-10-08 06:15:13 +00:00
|
|
|
;CHECK: vmov.i8 d{{.*}}, #0x8
|
2009-06-22 23:27:02 +00:00
|
|
|
ret <8 x i8> < i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8 >
|
|
|
|
}
|
|
|
|
|
|
|
|
define <4 x i16> @v_movi16a() nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: v_movi16a:
|
2010-10-08 06:15:13 +00:00
|
|
|
;CHECK: vmov.i16 d{{.*}}, #0x10
|
2009-06-22 23:27:02 +00:00
|
|
|
ret <4 x i16> < i16 16, i16 16, i16 16, i16 16 >
|
|
|
|
}
|
|
|
|
|
|
|
|
define <4 x i16> @v_movi16b() nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: v_movi16b:
|
2010-10-08 06:15:13 +00:00
|
|
|
;CHECK: vmov.i16 d{{.*}}, #0x1000
|
2009-06-22 23:27:02 +00:00
|
|
|
ret <4 x i16> < i16 4096, i16 4096, i16 4096, i16 4096 >
|
|
|
|
}
|
|
|
|
|
2010-07-14 06:31:50 +00:00
|
|
|
define <4 x i16> @v_mvni16a() nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: v_mvni16a:
|
2010-10-08 06:15:13 +00:00
|
|
|
;CHECK: vmvn.i16 d{{.*}}, #0x10
|
2010-07-14 06:31:50 +00:00
|
|
|
ret <4 x i16> < i16 65519, i16 65519, i16 65519, i16 65519 >
|
|
|
|
}
|
|
|
|
|
|
|
|
define <4 x i16> @v_mvni16b() nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: v_mvni16b:
|
2010-10-08 06:15:13 +00:00
|
|
|
;CHECK: vmvn.i16 d{{.*}}, #0x1000
|
2010-07-14 06:31:50 +00:00
|
|
|
ret <4 x i16> < i16 61439, i16 61439, i16 61439, i16 61439 >
|
|
|
|
}
|
|
|
|
|
2009-06-22 23:27:02 +00:00
|
|
|
define <2 x i32> @v_movi32a() nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: v_movi32a:
|
2010-10-08 06:15:13 +00:00
|
|
|
;CHECK: vmov.i32 d{{.*}}, #0x20
|
2009-06-22 23:27:02 +00:00
|
|
|
ret <2 x i32> < i32 32, i32 32 >
|
|
|
|
}
|
|
|
|
|
|
|
|
define <2 x i32> @v_movi32b() nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: v_movi32b:
|
2010-10-08 06:15:13 +00:00
|
|
|
;CHECK: vmov.i32 d{{.*}}, #0x2000
|
2009-06-22 23:27:02 +00:00
|
|
|
ret <2 x i32> < i32 8192, i32 8192 >
|
|
|
|
}
|
|
|
|
|
|
|
|
define <2 x i32> @v_movi32c() nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: v_movi32c:
|
2010-10-08 06:15:13 +00:00
|
|
|
;CHECK: vmov.i32 d{{.*}}, #0x200000
|
2009-06-22 23:27:02 +00:00
|
|
|
ret <2 x i32> < i32 2097152, i32 2097152 >
|
|
|
|
}
|
|
|
|
|
|
|
|
define <2 x i32> @v_movi32d() nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: v_movi32d:
|
2010-10-08 06:15:13 +00:00
|
|
|
;CHECK: vmov.i32 d{{.*}}, #0x20000000
|
2009-06-22 23:27:02 +00:00
|
|
|
ret <2 x i32> < i32 536870912, i32 536870912 >
|
|
|
|
}
|
|
|
|
|
|
|
|
define <2 x i32> @v_movi32e() nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: v_movi32e:
|
2011-11-07 21:00:59 +00:00
|
|
|
;CHECK: vmov.i32 d{{.*}}, #0x20ff
|
2009-06-22 23:27:02 +00:00
|
|
|
ret <2 x i32> < i32 8447, i32 8447 >
|
|
|
|
}
|
|
|
|
|
|
|
|
define <2 x i32> @v_movi32f() nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: v_movi32f:
|
2011-11-07 21:00:59 +00:00
|
|
|
;CHECK: vmov.i32 d{{.*}}, #0x20ffff
|
2009-06-22 23:27:02 +00:00
|
|
|
ret <2 x i32> < i32 2162687, i32 2162687 >
|
|
|
|
}
|
|
|
|
|
2010-07-14 06:31:50 +00:00
|
|
|
define <2 x i32> @v_mvni32a() nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: v_mvni32a:
|
2010-10-08 06:15:13 +00:00
|
|
|
;CHECK: vmvn.i32 d{{.*}}, #0x20
|
2010-07-14 06:31:50 +00:00
|
|
|
ret <2 x i32> < i32 4294967263, i32 4294967263 >
|
|
|
|
}
|
|
|
|
|
|
|
|
define <2 x i32> @v_mvni32b() nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: v_mvni32b:
|
2010-10-08 06:15:13 +00:00
|
|
|
;CHECK: vmvn.i32 d{{.*}}, #0x2000
|
2010-07-14 06:31:50 +00:00
|
|
|
ret <2 x i32> < i32 4294959103, i32 4294959103 >
|
|
|
|
}
|
|
|
|
|
|
|
|
define <2 x i32> @v_mvni32c() nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: v_mvni32c:
|
2010-10-08 06:15:13 +00:00
|
|
|
;CHECK: vmvn.i32 d{{.*}}, #0x200000
|
2010-07-14 06:31:50 +00:00
|
|
|
ret <2 x i32> < i32 4292870143, i32 4292870143 >
|
|
|
|
}
|
|
|
|
|
|
|
|
define <2 x i32> @v_mvni32d() nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: v_mvni32d:
|
2010-10-08 06:15:13 +00:00
|
|
|
;CHECK: vmvn.i32 d{{.*}}, #0x20000000
|
2010-07-14 06:31:50 +00:00
|
|
|
ret <2 x i32> < i32 3758096383, i32 3758096383 >
|
|
|
|
}
|
|
|
|
|
|
|
|
define <2 x i32> @v_mvni32e() nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: v_mvni32e:
|
2011-11-07 21:00:59 +00:00
|
|
|
;CHECK: vmvn.i32 d{{.*}}, #0x20ff
|
2010-07-14 06:31:50 +00:00
|
|
|
ret <2 x i32> < i32 4294958848, i32 4294958848 >
|
|
|
|
}
|
|
|
|
|
|
|
|
define <2 x i32> @v_mvni32f() nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: v_mvni32f:
|
2011-11-07 21:00:59 +00:00
|
|
|
;CHECK: vmvn.i32 d{{.*}}, #0x20ffff
|
2010-07-14 06:31:50 +00:00
|
|
|
ret <2 x i32> < i32 4292804608, i32 4292804608 >
|
|
|
|
}
|
|
|
|
|
2009-06-22 23:27:02 +00:00
|
|
|
define <1 x i64> @v_movi64() nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: v_movi64:
|
2011-11-07 21:00:59 +00:00
|
|
|
;CHECK: vmov.i64 d{{.*}}, #0xff0000ff0000ffff
|
2009-06-22 23:27:02 +00:00
|
|
|
ret <1 x i64> < i64 18374687574888349695 >
|
|
|
|
}
|
|
|
|
|
|
|
|
define <16 x i8> @v_movQi8() nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: v_movQi8:
|
2010-10-08 06:15:13 +00:00
|
|
|
;CHECK: vmov.i8 q{{.*}}, #0x8
|
2009-06-22 23:27:02 +00:00
|
|
|
ret <16 x i8> < i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8 >
|
|
|
|
}
|
|
|
|
|
|
|
|
define <8 x i16> @v_movQi16a() nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: v_movQi16a:
|
2010-10-08 06:15:13 +00:00
|
|
|
;CHECK: vmov.i16 q{{.*}}, #0x10
|
2009-06-22 23:27:02 +00:00
|
|
|
ret <8 x i16> < i16 16, i16 16, i16 16, i16 16, i16 16, i16 16, i16 16, i16 16 >
|
|
|
|
}
|
|
|
|
|
|
|
|
define <8 x i16> @v_movQi16b() nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: v_movQi16b:
|
2010-10-08 06:15:13 +00:00
|
|
|
;CHECK: vmov.i16 q{{.*}}, #0x1000
|
2009-06-22 23:27:02 +00:00
|
|
|
ret <8 x i16> < i16 4096, i16 4096, i16 4096, i16 4096, i16 4096, i16 4096, i16 4096, i16 4096 >
|
|
|
|
}
|
|
|
|
|
|
|
|
define <4 x i32> @v_movQi32a() nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: v_movQi32a:
|
2010-10-08 06:15:13 +00:00
|
|
|
;CHECK: vmov.i32 q{{.*}}, #0x20
|
2009-06-22 23:27:02 +00:00
|
|
|
ret <4 x i32> < i32 32, i32 32, i32 32, i32 32 >
|
|
|
|
}
|
|
|
|
|
|
|
|
define <4 x i32> @v_movQi32b() nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: v_movQi32b:
|
2010-10-08 06:15:13 +00:00
|
|
|
;CHECK: vmov.i32 q{{.*}}, #0x2000
|
2009-06-22 23:27:02 +00:00
|
|
|
ret <4 x i32> < i32 8192, i32 8192, i32 8192, i32 8192 >
|
|
|
|
}
|
|
|
|
|
|
|
|
define <4 x i32> @v_movQi32c() nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: v_movQi32c:
|
2010-10-08 06:15:13 +00:00
|
|
|
;CHECK: vmov.i32 q{{.*}}, #0x200000
|
2009-06-22 23:27:02 +00:00
|
|
|
ret <4 x i32> < i32 2097152, i32 2097152, i32 2097152, i32 2097152 >
|
|
|
|
}
|
|
|
|
|
|
|
|
define <4 x i32> @v_movQi32d() nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: v_movQi32d:
|
2010-10-08 06:15:13 +00:00
|
|
|
;CHECK: vmov.i32 q{{.*}}, #0x20000000
|
2009-06-22 23:27:02 +00:00
|
|
|
ret <4 x i32> < i32 536870912, i32 536870912, i32 536870912, i32 536870912 >
|
|
|
|
}
|
|
|
|
|
|
|
|
define <4 x i32> @v_movQi32e() nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: v_movQi32e:
|
2011-11-07 21:00:59 +00:00
|
|
|
;CHECK: vmov.i32 q{{.*}}, #0x20ff
|
2009-06-22 23:27:02 +00:00
|
|
|
ret <4 x i32> < i32 8447, i32 8447, i32 8447, i32 8447 >
|
|
|
|
}
|
|
|
|
|
|
|
|
define <4 x i32> @v_movQi32f() nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: v_movQi32f:
|
2011-11-07 21:00:59 +00:00
|
|
|
;CHECK: vmov.i32 q{{.*}}, #0x20ffff
|
2009-06-22 23:27:02 +00:00
|
|
|
ret <4 x i32> < i32 2162687, i32 2162687, i32 2162687, i32 2162687 >
|
|
|
|
}
|
|
|
|
|
|
|
|
define <2 x i64> @v_movQi64() nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: v_movQi64:
|
2011-11-07 21:00:59 +00:00
|
|
|
;CHECK: vmov.i64 q{{.*}}, #0xff0000ff0000ffff
|
2009-06-22 23:27:02 +00:00
|
|
|
ret <2 x i64> < i64 18374687574888349695, i64 18374687574888349695 >
|
|
|
|
}
|
2009-10-09 20:20:54 +00:00
|
|
|
|
2009-11-06 23:33:28 +00:00
|
|
|
; Check for correct assembler printing for immediate values.
|
|
|
|
%struct.int8x8_t = type { <8 x i8> }
|
2010-06-17 15:18:27 +00:00
|
|
|
define void @vdupn128(%struct.int8x8_t* noalias nocapture sret %agg.result) nounwind {
|
2009-11-06 23:33:28 +00:00
|
|
|
entry:
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: vdupn128:
|
2010-10-08 06:15:13 +00:00
|
|
|
;CHECK: vmov.i8 d{{.*}}, #0x80
|
[opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction
One of several parallel first steps to remove the target type of pointers,
replacing them with a single opaque pointer type.
This adds an explicit type parameter to the gep instruction so that when the
first parameter becomes an opaque pointer type, the type to gep through is
still available to the instructions.
* This doesn't modify gep operators, only instructions (operators will be
handled separately)
* Textual IR changes only. Bitcode (including upgrade) and changing the
in-memory representation will be in separate changes.
* geps of vectors are transformed as:
getelementptr <4 x float*> %x, ...
->getelementptr float, <4 x float*> %x, ...
Then, once the opaque pointer type is introduced, this will ultimately look
like:
getelementptr float, <4 x ptr> %x
with the unambiguous interpretation that it is a vector of pointers to float.
* address spaces remain on the pointer, not the type:
getelementptr float addrspace(1)* %x
->getelementptr float, float addrspace(1)* %x
Then, eventually:
getelementptr float, ptr addrspace(1) %x
Importantly, the massive amount of test case churn has been automated by
same crappy python code. I had to manually update a few test cases that
wouldn't fit the script's model (r228970,r229196,r229197,r229198). The
python script just massages stdin and writes the result to stdout, I
then wrapped that in a shell script to handle replacing files, then
using the usual find+xargs to migrate all the files.
update.py:
import fileinput
import sys
import re
ibrep = re.compile(r"(^.*?[^%\w]getelementptr inbounds )(((?:<\d* x )?)(.*?)(| addrspace\(\d\)) *\*(|>)(?:$| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$))")
normrep = re.compile( r"(^.*?[^%\w]getelementptr )(((?:<\d* x )?)(.*?)(| addrspace\(\d\)) *\*(|>)(?:$| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$))")
def conv(match, line):
if not match:
return line
line = match.groups()[0]
if len(match.groups()[5]) == 0:
line += match.groups()[2]
line += match.groups()[3]
line += ", "
line += match.groups()[1]
line += "\n"
return line
for line in sys.stdin:
if line.find("getelementptr ") == line.find("getelementptr inbounds"):
if line.find("getelementptr inbounds") != line.find("getelementptr inbounds ("):
line = conv(re.match(ibrep, line), line)
elif line.find("getelementptr ") != line.find("getelementptr ("):
line = conv(re.match(normrep, line), line)
sys.stdout.write(line)
apply.sh:
for name in "$@"
do
python3 `dirname "$0"`/update.py < "$name" > "$name.tmp" && mv "$name.tmp" "$name"
rm -f "$name.tmp"
done
The actual commands:
From llvm/src:
find test/ -name *.ll | xargs ./apply.sh
From llvm/src/tools/clang:
find test/ -name *.mm -o -name *.m -o -name *.cpp -o -name *.c | xargs -I '{}' ../../apply.sh "{}"
From llvm/src/tools/polly:
find test/ -name *.ll | xargs ./apply.sh
After that, check-all (with llvm, clang, clang-tools-extra, lld,
compiler-rt, and polly all checked out).
The extra 'rm' in the apply.sh script is due to a few files in clang's test
suite using interesting unicode stuff that my python script was throwing
exceptions on. None of those files needed to be migrated, so it seemed
sufficient to ignore those cases.
Reviewers: rafael, dexonsmith, grosser
Differential Revision: http://reviews.llvm.org/D7636
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230786 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-27 19:29:02 +00:00
|
|
|
%0 = getelementptr inbounds %struct.int8x8_t, %struct.int8x8_t* %agg.result, i32 0, i32 0 ; <<8 x i8>*> [#uses=1]
|
2009-11-06 23:33:28 +00:00
|
|
|
store <8 x i8> <i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128>, <8 x i8>* %0, align 8
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2010-06-17 15:18:27 +00:00
|
|
|
define void @vdupnneg75(%struct.int8x8_t* noalias nocapture sret %agg.result) nounwind {
|
2009-11-06 23:33:28 +00:00
|
|
|
entry:
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: vdupnneg75:
|
2011-11-07 21:00:59 +00:00
|
|
|
;CHECK: vmov.i8 d{{.*}}, #0xb5
|
[opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction
One of several parallel first steps to remove the target type of pointers,
replacing them with a single opaque pointer type.
This adds an explicit type parameter to the gep instruction so that when the
first parameter becomes an opaque pointer type, the type to gep through is
still available to the instructions.
* This doesn't modify gep operators, only instructions (operators will be
handled separately)
* Textual IR changes only. Bitcode (including upgrade) and changing the
in-memory representation will be in separate changes.
* geps of vectors are transformed as:
getelementptr <4 x float*> %x, ...
->getelementptr float, <4 x float*> %x, ...
Then, once the opaque pointer type is introduced, this will ultimately look
like:
getelementptr float, <4 x ptr> %x
with the unambiguous interpretation that it is a vector of pointers to float.
* address spaces remain on the pointer, not the type:
getelementptr float addrspace(1)* %x
->getelementptr float, float addrspace(1)* %x
Then, eventually:
getelementptr float, ptr addrspace(1) %x
Importantly, the massive amount of test case churn has been automated by
same crappy python code. I had to manually update a few test cases that
wouldn't fit the script's model (r228970,r229196,r229197,r229198). The
python script just massages stdin and writes the result to stdout, I
then wrapped that in a shell script to handle replacing files, then
using the usual find+xargs to migrate all the files.
update.py:
import fileinput
import sys
import re
ibrep = re.compile(r"(^.*?[^%\w]getelementptr inbounds )(((?:<\d* x )?)(.*?)(| addrspace\(\d\)) *\*(|>)(?:$| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$))")
normrep = re.compile( r"(^.*?[^%\w]getelementptr )(((?:<\d* x )?)(.*?)(| addrspace\(\d\)) *\*(|>)(?:$| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$))")
def conv(match, line):
if not match:
return line
line = match.groups()[0]
if len(match.groups()[5]) == 0:
line += match.groups()[2]
line += match.groups()[3]
line += ", "
line += match.groups()[1]
line += "\n"
return line
for line in sys.stdin:
if line.find("getelementptr ") == line.find("getelementptr inbounds"):
if line.find("getelementptr inbounds") != line.find("getelementptr inbounds ("):
line = conv(re.match(ibrep, line), line)
elif line.find("getelementptr ") != line.find("getelementptr ("):
line = conv(re.match(normrep, line), line)
sys.stdout.write(line)
apply.sh:
for name in "$@"
do
python3 `dirname "$0"`/update.py < "$name" > "$name.tmp" && mv "$name.tmp" "$name"
rm -f "$name.tmp"
done
The actual commands:
From llvm/src:
find test/ -name *.ll | xargs ./apply.sh
From llvm/src/tools/clang:
find test/ -name *.mm -o -name *.m -o -name *.cpp -o -name *.c | xargs -I '{}' ../../apply.sh "{}"
From llvm/src/tools/polly:
find test/ -name *.ll | xargs ./apply.sh
After that, check-all (with llvm, clang, clang-tools-extra, lld,
compiler-rt, and polly all checked out).
The extra 'rm' in the apply.sh script is due to a few files in clang's test
suite using interesting unicode stuff that my python script was throwing
exceptions on. None of those files needed to be migrated, so it seemed
sufficient to ignore those cases.
Reviewers: rafael, dexonsmith, grosser
Differential Revision: http://reviews.llvm.org/D7636
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230786 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-27 19:29:02 +00:00
|
|
|
%0 = getelementptr inbounds %struct.int8x8_t, %struct.int8x8_t* %agg.result, i32 0, i32 0 ; <<8 x i8>*> [#uses=1]
|
2009-11-06 23:33:28 +00:00
|
|
|
store <8 x i8> <i8 -75, i8 -75, i8 -75, i8 -75, i8 -75, i8 -75, i8 -75, i8 -75>, <8 x i8>* %0, align 8
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2009-10-09 20:20:54 +00:00
|
|
|
define <8 x i16> @vmovls8(<8 x i8>* %A) nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: vmovls8:
|
2009-10-09 20:20:54 +00:00
|
|
|
;CHECK: vmovl.s8
|
2015-02-27 21:17:42 +00:00
|
|
|
%tmp1 = load <8 x i8>, <8 x i8>* %A
|
2010-08-20 04:54:02 +00:00
|
|
|
%tmp2 = sext <8 x i8> %tmp1 to <8 x i16>
|
2009-10-09 20:20:54 +00:00
|
|
|
ret <8 x i16> %tmp2
|
|
|
|
}
|
|
|
|
|
|
|
|
define <4 x i32> @vmovls16(<4 x i16>* %A) nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: vmovls16:
|
2009-10-09 20:20:54 +00:00
|
|
|
;CHECK: vmovl.s16
|
2015-02-27 21:17:42 +00:00
|
|
|
%tmp1 = load <4 x i16>, <4 x i16>* %A
|
2010-08-20 04:54:02 +00:00
|
|
|
%tmp2 = sext <4 x i16> %tmp1 to <4 x i32>
|
2009-10-09 20:20:54 +00:00
|
|
|
ret <4 x i32> %tmp2
|
|
|
|
}
|
|
|
|
|
|
|
|
define <2 x i64> @vmovls32(<2 x i32>* %A) nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: vmovls32:
|
2009-10-09 20:20:54 +00:00
|
|
|
;CHECK: vmovl.s32
|
2015-02-27 21:17:42 +00:00
|
|
|
%tmp1 = load <2 x i32>, <2 x i32>* %A
|
2010-08-20 04:54:02 +00:00
|
|
|
%tmp2 = sext <2 x i32> %tmp1 to <2 x i64>
|
2009-10-09 20:20:54 +00:00
|
|
|
ret <2 x i64> %tmp2
|
|
|
|
}
|
|
|
|
|
|
|
|
define <8 x i16> @vmovlu8(<8 x i8>* %A) nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: vmovlu8:
|
2009-10-09 20:20:54 +00:00
|
|
|
;CHECK: vmovl.u8
|
2015-02-27 21:17:42 +00:00
|
|
|
%tmp1 = load <8 x i8>, <8 x i8>* %A
|
2010-08-20 04:54:02 +00:00
|
|
|
%tmp2 = zext <8 x i8> %tmp1 to <8 x i16>
|
2009-10-09 20:20:54 +00:00
|
|
|
ret <8 x i16> %tmp2
|
|
|
|
}
|
|
|
|
|
|
|
|
define <4 x i32> @vmovlu16(<4 x i16>* %A) nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: vmovlu16:
|
2009-10-09 20:20:54 +00:00
|
|
|
;CHECK: vmovl.u16
|
2015-02-27 21:17:42 +00:00
|
|
|
%tmp1 = load <4 x i16>, <4 x i16>* %A
|
2010-08-20 04:54:02 +00:00
|
|
|
%tmp2 = zext <4 x i16> %tmp1 to <4 x i32>
|
2009-10-09 20:20:54 +00:00
|
|
|
ret <4 x i32> %tmp2
|
|
|
|
}
|
|
|
|
|
|
|
|
define <2 x i64> @vmovlu32(<2 x i32>* %A) nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: vmovlu32:
|
2009-10-09 20:20:54 +00:00
|
|
|
;CHECK: vmovl.u32
|
2015-02-27 21:17:42 +00:00
|
|
|
%tmp1 = load <2 x i32>, <2 x i32>* %A
|
2010-08-20 04:54:02 +00:00
|
|
|
%tmp2 = zext <2 x i32> %tmp1 to <2 x i64>
|
2009-10-09 20:20:54 +00:00
|
|
|
ret <2 x i64> %tmp2
|
|
|
|
}
|
|
|
|
|
|
|
|
define <8 x i8> @vmovni16(<8 x i16>* %A) nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: vmovni16:
|
2009-10-09 20:20:54 +00:00
|
|
|
;CHECK: vmovn.i16
|
2015-02-27 21:17:42 +00:00
|
|
|
%tmp1 = load <8 x i16>, <8 x i16>* %A
|
2010-08-30 20:02:30 +00:00
|
|
|
%tmp2 = trunc <8 x i16> %tmp1 to <8 x i8>
|
2009-10-09 20:20:54 +00:00
|
|
|
ret <8 x i8> %tmp2
|
|
|
|
}
|
|
|
|
|
|
|
|
define <4 x i16> @vmovni32(<4 x i32>* %A) nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: vmovni32:
|
2009-10-09 20:20:54 +00:00
|
|
|
;CHECK: vmovn.i32
|
2015-02-27 21:17:42 +00:00
|
|
|
%tmp1 = load <4 x i32>, <4 x i32>* %A
|
2010-08-30 20:02:30 +00:00
|
|
|
%tmp2 = trunc <4 x i32> %tmp1 to <4 x i16>
|
2009-10-09 20:20:54 +00:00
|
|
|
ret <4 x i16> %tmp2
|
|
|
|
}
|
|
|
|
|
|
|
|
define <2 x i32> @vmovni64(<2 x i64>* %A) nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: vmovni64:
|
2009-10-09 20:20:54 +00:00
|
|
|
;CHECK: vmovn.i64
|
2015-02-27 21:17:42 +00:00
|
|
|
%tmp1 = load <2 x i64>, <2 x i64>* %A
|
2010-08-30 20:02:30 +00:00
|
|
|
%tmp2 = trunc <2 x i64> %tmp1 to <2 x i32>
|
2009-10-09 20:20:54 +00:00
|
|
|
ret <2 x i32> %tmp2
|
|
|
|
}
|
|
|
|
|
|
|
|
define <8 x i8> @vqmovns16(<8 x i16>* %A) nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: vqmovns16:
|
2009-10-09 20:20:54 +00:00
|
|
|
;CHECK: vqmovn.s16
|
2015-02-27 21:17:42 +00:00
|
|
|
%tmp1 = load <8 x i16>, <8 x i16>* %A
|
2009-10-09 20:20:54 +00:00
|
|
|
%tmp2 = call <8 x i8> @llvm.arm.neon.vqmovns.v8i8(<8 x i16> %tmp1)
|
|
|
|
ret <8 x i8> %tmp2
|
|
|
|
}
|
|
|
|
|
|
|
|
define <4 x i16> @vqmovns32(<4 x i32>* %A) nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: vqmovns32:
|
2009-10-09 20:20:54 +00:00
|
|
|
;CHECK: vqmovn.s32
|
2015-02-27 21:17:42 +00:00
|
|
|
%tmp1 = load <4 x i32>, <4 x i32>* %A
|
2009-10-09 20:20:54 +00:00
|
|
|
%tmp2 = call <4 x i16> @llvm.arm.neon.vqmovns.v4i16(<4 x i32> %tmp1)
|
|
|
|
ret <4 x i16> %tmp2
|
|
|
|
}
|
|
|
|
|
|
|
|
define <2 x i32> @vqmovns64(<2 x i64>* %A) nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: vqmovns64:
|
2009-10-09 20:20:54 +00:00
|
|
|
;CHECK: vqmovn.s64
|
2015-02-27 21:17:42 +00:00
|
|
|
%tmp1 = load <2 x i64>, <2 x i64>* %A
|
2009-10-09 20:20:54 +00:00
|
|
|
%tmp2 = call <2 x i32> @llvm.arm.neon.vqmovns.v2i32(<2 x i64> %tmp1)
|
|
|
|
ret <2 x i32> %tmp2
|
|
|
|
}
|
|
|
|
|
|
|
|
define <8 x i8> @vqmovnu16(<8 x i16>* %A) nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: vqmovnu16:
|
2009-10-09 20:20:54 +00:00
|
|
|
;CHECK: vqmovn.u16
|
2015-02-27 21:17:42 +00:00
|
|
|
%tmp1 = load <8 x i16>, <8 x i16>* %A
|
2009-10-09 20:20:54 +00:00
|
|
|
%tmp2 = call <8 x i8> @llvm.arm.neon.vqmovnu.v8i8(<8 x i16> %tmp1)
|
|
|
|
ret <8 x i8> %tmp2
|
|
|
|
}
|
|
|
|
|
|
|
|
define <4 x i16> @vqmovnu32(<4 x i32>* %A) nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: vqmovnu32:
|
2009-10-09 20:20:54 +00:00
|
|
|
;CHECK: vqmovn.u32
|
2015-02-27 21:17:42 +00:00
|
|
|
%tmp1 = load <4 x i32>, <4 x i32>* %A
|
2009-10-09 20:20:54 +00:00
|
|
|
%tmp2 = call <4 x i16> @llvm.arm.neon.vqmovnu.v4i16(<4 x i32> %tmp1)
|
|
|
|
ret <4 x i16> %tmp2
|
|
|
|
}
|
|
|
|
|
|
|
|
define <2 x i32> @vqmovnu64(<2 x i64>* %A) nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: vqmovnu64:
|
2009-10-09 20:20:54 +00:00
|
|
|
;CHECK: vqmovn.u64
|
2015-02-27 21:17:42 +00:00
|
|
|
%tmp1 = load <2 x i64>, <2 x i64>* %A
|
2009-10-09 20:20:54 +00:00
|
|
|
%tmp2 = call <2 x i32> @llvm.arm.neon.vqmovnu.v2i32(<2 x i64> %tmp1)
|
|
|
|
ret <2 x i32> %tmp2
|
|
|
|
}
|
|
|
|
|
|
|
|
define <8 x i8> @vqmovuns16(<8 x i16>* %A) nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: vqmovuns16:
|
2009-10-09 20:20:54 +00:00
|
|
|
;CHECK: vqmovun.s16
|
2015-02-27 21:17:42 +00:00
|
|
|
%tmp1 = load <8 x i16>, <8 x i16>* %A
|
2009-10-09 20:20:54 +00:00
|
|
|
%tmp2 = call <8 x i8> @llvm.arm.neon.vqmovnsu.v8i8(<8 x i16> %tmp1)
|
|
|
|
ret <8 x i8> %tmp2
|
|
|
|
}
|
|
|
|
|
|
|
|
define <4 x i16> @vqmovuns32(<4 x i32>* %A) nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: vqmovuns32:
|
2009-10-09 20:20:54 +00:00
|
|
|
;CHECK: vqmovun.s32
|
2015-02-27 21:17:42 +00:00
|
|
|
%tmp1 = load <4 x i32>, <4 x i32>* %A
|
2009-10-09 20:20:54 +00:00
|
|
|
%tmp2 = call <4 x i16> @llvm.arm.neon.vqmovnsu.v4i16(<4 x i32> %tmp1)
|
|
|
|
ret <4 x i16> %tmp2
|
|
|
|
}
|
|
|
|
|
|
|
|
define <2 x i32> @vqmovuns64(<2 x i64>* %A) nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: vqmovuns64:
|
2009-10-09 20:20:54 +00:00
|
|
|
;CHECK: vqmovun.s64
|
2015-02-27 21:17:42 +00:00
|
|
|
%tmp1 = load <2 x i64>, <2 x i64>* %A
|
2009-10-09 20:20:54 +00:00
|
|
|
%tmp2 = call <2 x i32> @llvm.arm.neon.vqmovnsu.v2i32(<2 x i64> %tmp1)
|
|
|
|
ret <2 x i32> %tmp2
|
|
|
|
}
|
|
|
|
|
|
|
|
declare <8 x i8> @llvm.arm.neon.vqmovns.v8i8(<8 x i16>) nounwind readnone
|
|
|
|
declare <4 x i16> @llvm.arm.neon.vqmovns.v4i16(<4 x i32>) nounwind readnone
|
|
|
|
declare <2 x i32> @llvm.arm.neon.vqmovns.v2i32(<2 x i64>) nounwind readnone
|
|
|
|
|
|
|
|
declare <8 x i8> @llvm.arm.neon.vqmovnu.v8i8(<8 x i16>) nounwind readnone
|
|
|
|
declare <4 x i16> @llvm.arm.neon.vqmovnu.v4i16(<4 x i32>) nounwind readnone
|
|
|
|
declare <2 x i32> @llvm.arm.neon.vqmovnu.v2i32(<2 x i64>) nounwind readnone
|
|
|
|
|
|
|
|
declare <8 x i8> @llvm.arm.neon.vqmovnsu.v8i8(<8 x i16>) nounwind readnone
|
|
|
|
declare <4 x i16> @llvm.arm.neon.vqmovnsu.v4i16(<4 x i32>) nounwind readnone
|
|
|
|
declare <2 x i32> @llvm.arm.neon.vqmovnsu.v2i32(<2 x i64>) nounwind readnone
|
2010-11-01 18:31:39 +00:00
|
|
|
|
|
|
|
; Truncating vector stores are not supported. The following should not crash.
|
|
|
|
; Radar 8598391.
|
|
|
|
define void @noTruncStore(<4 x i32>* %a, <4 x i16>* %b) nounwind {
|
|
|
|
;CHECK: vmovn
|
2015-02-27 21:17:42 +00:00
|
|
|
%tmp1 = load <4 x i32>, <4 x i32>* %a, align 16
|
2010-11-01 18:31:39 +00:00
|
|
|
%tmp2 = trunc <4 x i32> %tmp1 to <4 x i16>
|
|
|
|
store <4 x i16> %tmp2, <4 x i16>* %b, align 8
|
|
|
|
ret void
|
|
|
|
}
|
2011-11-15 02:12:34 +00:00
|
|
|
|
|
|
|
; Use vmov.f32 to materialize f32 immediate splats
|
|
|
|
; rdar://10437054
|
|
|
|
define void @v_mov_v2f32(<2 x float>* nocapture %p) nounwind {
|
|
|
|
entry:
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: v_mov_v2f32:
|
2011-11-15 02:12:34 +00:00
|
|
|
;CHECK: vmov.f32 d{{.*}}, #-1.600000e+01
|
|
|
|
store <2 x float> <float -1.600000e+01, float -1.600000e+01>, <2 x float>* %p, align 4
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @v_mov_v4f32(<4 x float>* nocapture %p) nounwind {
|
|
|
|
entry:
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: v_mov_v4f32:
|
2011-11-15 02:12:34 +00:00
|
|
|
;CHECK: vmov.f32 q{{.*}}, #3.100000e+01
|
|
|
|
store <4 x float> <float 3.100000e+01, float 3.100000e+01, float 3.100000e+01, float 3.100000e+01>, <4 x float>* %p, align 4
|
|
|
|
ret void
|
|
|
|
}
|
2011-12-09 23:54:42 +00:00
|
|
|
|
|
|
|
define void @v_mov_v4f32_undef(<4 x float> * nocapture %p) nounwind {
|
|
|
|
entry:
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: v_mov_v4f32_undef:
|
2011-12-09 23:54:42 +00:00
|
|
|
;CHECK: vmov.f32 q{{.*}}, #1.000000e+00
|
2015-02-27 21:17:42 +00:00
|
|
|
%a = load <4 x float> , <4 x float> *%p
|
2011-12-09 23:54:42 +00:00
|
|
|
%b = fadd <4 x float> %a, <float undef, float 1.0, float 1.0, float 1.0>
|
|
|
|
store <4 x float> %b, <4 x float> *%p
|
|
|
|
ret void
|
|
|
|
}
|
2012-01-20 20:59:56 +00:00
|
|
|
|
|
|
|
; Vector any_extends must be selected as either vmovl.u or vmovl.s.
|
|
|
|
; rdar://10723651
|
|
|
|
define void @any_extend(<4 x i1> %x, <4 x i32> %y) nounwind ssp {
|
|
|
|
entry:
|
2013-07-18 22:47:09 +00:00
|
|
|
;CHECK-LABEL: any_extend:
|
2012-01-20 20:59:56 +00:00
|
|
|
;CHECK: vmovl
|
|
|
|
%and.i186 = zext <4 x i1> %x to <4 x i32>
|
|
|
|
%add.i185 = sub <4 x i32> %and.i186, %y
|
|
|
|
%sub.i = sub <4 x i32> %add.i185, zeroinitializer
|
|
|
|
%add.i = add <4 x i32> %sub.i, zeroinitializer
|
|
|
|
%vmovn.i = trunc <4 x i32> %add.i to <4 x i16>
|
|
|
|
tail call void @llvm.arm.neon.vst1.v4i16(i8* undef, <4 x i16> %vmovn.i, i32 2)
|
|
|
|
unreachable
|
|
|
|
}
|
|
|
|
|
|
|
|
declare void @llvm.arm.neon.vst1.v4i16(i8*, <4 x i16>, i32) nounwind
|