2014-04-04 00:01:44 +08:00
|
|
|
; RUN: llc -mtriple=arm -mattr=+neon %s -o - | FileCheck %s
|
2009-09-02 02:51:56 +08:00
|
|
|
|
2010-11-04 00:24:53 +08:00
|
|
|
define void @vst1lanei8(i8* %A, <8 x i8>* %B) nounwind {
|
2013-07-14 14:24:09 +08:00
|
|
|
;CHECK-LABEL: vst1lanei8:
|
2010-11-04 00:24:53 +08:00
|
|
|
;Check the (default) alignment.
|
2013-10-12 02:09:19 +08:00
|
|
|
;CHECK: vst1.8 {d16[3]}, [r0]
|
2015-02-28 05:17:42 +08:00
|
|
|
%tmp1 = load <8 x i8>, <8 x i8>* %B
|
2010-11-04 00:24:53 +08:00
|
|
|
%tmp2 = extractelement <8 x i8> %tmp1, i32 3
|
|
|
|
store i8 %tmp2, i8* %A, align 8
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2011-02-25 14:42:42 +08:00
|
|
|
;Check for a post-increment updating store.
|
|
|
|
define void @vst1lanei8_update(i8** %ptr, <8 x i8>* %B) nounwind {
|
2013-07-14 14:24:09 +08:00
|
|
|
;CHECK-LABEL: vst1lanei8_update:
|
2013-10-12 02:09:19 +08:00
|
|
|
;CHECK: vst1.8 {d16[3]}, [{{r[0-9]}}]!
|
2015-02-28 05:17:42 +08:00
|
|
|
%A = load i8*, i8** %ptr
|
|
|
|
%tmp1 = load <8 x i8>, <8 x i8>* %B
|
2011-02-25 14:42:42 +08:00
|
|
|
%tmp2 = extractelement <8 x i8> %tmp1, i32 3
|
|
|
|
store i8 %tmp2, i8* %A, align 8
|
[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
llvm-svn: 230786
2015-02-28 03:29:02 +08:00
|
|
|
%tmp3 = getelementptr i8, i8* %A, i32 1
|
2011-02-25 14:42:42 +08:00
|
|
|
store i8* %tmp3, i8** %ptr
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2010-11-04 00:24:53 +08:00
|
|
|
define void @vst1lanei16(i16* %A, <4 x i16>* %B) nounwind {
|
2013-07-14 14:24:09 +08:00
|
|
|
;CHECK-LABEL: vst1lanei16:
|
2010-11-04 00:24:53 +08:00
|
|
|
;Check the alignment value. Max for this instruction is 16 bits:
|
2013-10-12 02:09:19 +08:00
|
|
|
;CHECK: vst1.16 {d16[2]}, [r0:16]
|
2015-02-28 05:17:42 +08:00
|
|
|
%tmp1 = load <4 x i16>, <4 x i16>* %B
|
2010-11-04 00:24:53 +08:00
|
|
|
%tmp2 = extractelement <4 x i16> %tmp1, i32 2
|
|
|
|
store i16 %tmp2, i16* %A, align 8
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @vst1lanei32(i32* %A, <2 x i32>* %B) nounwind {
|
2013-07-14 14:24:09 +08:00
|
|
|
;CHECK-LABEL: vst1lanei32:
|
2010-11-04 00:24:53 +08:00
|
|
|
;Check the alignment value. Max for this instruction is 32 bits:
|
2013-10-12 02:09:19 +08:00
|
|
|
;CHECK: vst1.32 {d16[1]}, [r0:32]
|
2015-02-28 05:17:42 +08:00
|
|
|
%tmp1 = load <2 x i32>, <2 x i32>* %B
|
2010-11-04 00:24:53 +08:00
|
|
|
%tmp2 = extractelement <2 x i32> %tmp1, i32 1
|
|
|
|
store i32 %tmp2, i32* %A, align 8
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2010-12-11 06:13:32 +08:00
|
|
|
define void @vst1lanef(float* %A, <2 x float>* %B) nounwind {
|
2013-07-14 14:24:09 +08:00
|
|
|
;CHECK-LABEL: vst1lanef:
|
2013-10-12 02:09:19 +08:00
|
|
|
;CHECK: vst1.32 {d16[1]}, [r0:32]
|
2015-02-28 05:17:42 +08:00
|
|
|
%tmp1 = load <2 x float>, <2 x float>* %B
|
2010-12-11 06:13:32 +08:00
|
|
|
%tmp2 = extractelement <2 x float> %tmp1, i32 1
|
|
|
|
store float %tmp2, float* %A
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2010-11-04 00:24:53 +08:00
|
|
|
define void @vst1laneQi8(i8* %A, <16 x i8>* %B) nounwind {
|
2013-07-14 14:24:09 +08:00
|
|
|
;CHECK-LABEL: vst1laneQi8:
|
2011-05-11 22:40:50 +08:00
|
|
|
; // Can use scalar load. No need to use vectors.
|
2013-10-12 02:09:19 +08:00
|
|
|
; // CHE-CK: vst1.8 {d17[1]}, [r0]
|
2015-02-28 05:17:42 +08:00
|
|
|
%tmp1 = load <16 x i8>, <16 x i8>* %B
|
2010-11-04 00:24:53 +08:00
|
|
|
%tmp2 = extractelement <16 x i8> %tmp1, i32 9
|
|
|
|
store i8 %tmp2, i8* %A, align 8
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @vst1laneQi16(i16* %A, <8 x i16>* %B) nounwind {
|
2013-07-14 14:24:09 +08:00
|
|
|
;CHECK-LABEL: vst1laneQi16:
|
2013-10-12 02:09:19 +08:00
|
|
|
;CHECK: vst1.16 {d17[1]}, [r0:16]
|
2015-02-28 05:17:42 +08:00
|
|
|
%tmp1 = load <8 x i16>, <8 x i16>* %B
|
2010-11-04 00:24:53 +08:00
|
|
|
%tmp2 = extractelement <8 x i16> %tmp1, i32 5
|
|
|
|
store i16 %tmp2, i16* %A, align 8
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @vst1laneQi32(i32* %A, <4 x i32>* %B) nounwind {
|
2013-07-14 14:24:09 +08:00
|
|
|
;CHECK-LABEL: vst1laneQi32:
|
2011-05-11 22:40:50 +08:00
|
|
|
; // Can use scalar load. No need to use vectors.
|
2013-10-12 02:09:19 +08:00
|
|
|
; // CHE-CK: vst1.32 {d17[1]}, [r0:32]
|
2015-02-28 05:17:42 +08:00
|
|
|
%tmp1 = load <4 x i32>, <4 x i32>* %B
|
2010-11-04 00:24:53 +08:00
|
|
|
%tmp2 = extractelement <4 x i32> %tmp1, i32 3
|
|
|
|
store i32 %tmp2, i32* %A, align 8
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2011-02-25 14:42:42 +08:00
|
|
|
;Check for a post-increment updating store.
|
|
|
|
define void @vst1laneQi32_update(i32** %ptr, <4 x i32>* %B) nounwind {
|
2013-07-14 14:24:09 +08:00
|
|
|
;CHECK-LABEL: vst1laneQi32_update:
|
2011-05-11 22:40:50 +08:00
|
|
|
; // Can use scalar load. No need to use vectors.
|
2013-10-12 02:09:19 +08:00
|
|
|
; // CHE-CK: vst1.32 {d17[1]}, [r1:32]!
|
2015-02-28 05:17:42 +08:00
|
|
|
%A = load i32*, i32** %ptr
|
|
|
|
%tmp1 = load <4 x i32>, <4 x i32>* %B
|
2011-02-25 14:42:42 +08:00
|
|
|
%tmp2 = extractelement <4 x i32> %tmp1, i32 3
|
|
|
|
store i32 %tmp2, i32* %A, align 8
|
[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
llvm-svn: 230786
2015-02-28 03:29:02 +08:00
|
|
|
%tmp3 = getelementptr i32, i32* %A, i32 1
|
2011-02-25 14:42:42 +08:00
|
|
|
store i32* %tmp3, i32** %ptr
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2010-12-11 06:13:32 +08:00
|
|
|
define void @vst1laneQf(float* %A, <4 x float>* %B) nounwind {
|
2013-07-14 14:24:09 +08:00
|
|
|
;CHECK-LABEL: vst1laneQf:
|
2011-05-11 22:40:50 +08:00
|
|
|
; // Can use scalar load. No need to use vectors.
|
2013-10-12 02:09:19 +08:00
|
|
|
; // CHE-CK: vst1.32 {d17[1]}, [r0]
|
2015-02-28 05:17:42 +08:00
|
|
|
%tmp1 = load <4 x float>, <4 x float>* %B
|
2010-12-11 06:13:32 +08:00
|
|
|
%tmp2 = extractelement <4 x float> %tmp1, i32 3
|
|
|
|
store float %tmp2, float* %A
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2009-09-02 02:51:56 +08:00
|
|
|
define void @vst2lanei8(i8* %A, <8 x i8>* %B) nounwind {
|
2013-07-14 14:24:09 +08:00
|
|
|
;CHECK-LABEL: vst2lanei8:
|
2010-10-19 08:16:32 +08:00
|
|
|
;Check the alignment value. Max for this instruction is 16 bits:
|
2013-02-22 18:01:33 +08:00
|
|
|
;CHECK: vst2.8 {d16[1], d17[1]}, [r0:16]
|
2015-02-28 05:17:42 +08:00
|
|
|
%tmp1 = load <8 x i8>, <8 x i8>* %B
|
2015-09-30 18:56:37 +08:00
|
|
|
call void @llvm.arm.neon.vst2lane.p0i8.v8i8(i8* %A, <8 x i8> %tmp1, <8 x i8> %tmp1, i32 1, i32 4)
|
2009-09-02 02:51:56 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @vst2lanei16(i16* %A, <4 x i16>* %B) nounwind {
|
2013-07-14 14:24:09 +08:00
|
|
|
;CHECK-LABEL: vst2lanei16:
|
2010-10-19 08:16:32 +08:00
|
|
|
;Check the alignment value. Max for this instruction is 32 bits:
|
2013-02-22 18:01:33 +08:00
|
|
|
;CHECK: vst2.16 {d16[1], d17[1]}, [r0:32]
|
2010-04-20 08:17:16 +08:00
|
|
|
%tmp0 = bitcast i16* %A to i8*
|
2015-02-28 05:17:42 +08:00
|
|
|
%tmp1 = load <4 x i16>, <4 x i16>* %B
|
2015-09-30 18:56:37 +08:00
|
|
|
call void @llvm.arm.neon.vst2lane.p0i8.v4i16(i8* %tmp0, <4 x i16> %tmp1, <4 x i16> %tmp1, i32 1, i32 8)
|
2009-09-02 02:51:56 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2011-02-08 01:43:21 +08:00
|
|
|
;Check for a post-increment updating store with register increment.
|
|
|
|
define void @vst2lanei16_update(i16** %ptr, <4 x i16>* %B, i32 %inc) nounwind {
|
2013-07-14 14:24:09 +08:00
|
|
|
;CHECK-LABEL: vst2lanei16_update:
|
2013-10-12 02:09:19 +08:00
|
|
|
;CHECK: vst2.16 {d16[1], d17[1]}, [r1], r2
|
2015-02-28 05:17:42 +08:00
|
|
|
%A = load i16*, i16** %ptr
|
2011-02-08 01:43:21 +08:00
|
|
|
%tmp0 = bitcast i16* %A to i8*
|
2015-02-28 05:17:42 +08:00
|
|
|
%tmp1 = load <4 x i16>, <4 x i16>* %B
|
2015-09-30 18:56:37 +08:00
|
|
|
call void @llvm.arm.neon.vst2lane.p0i8.v4i16(i8* %tmp0, <4 x i16> %tmp1, <4 x i16> %tmp1, i32 1, i32 2)
|
[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
llvm-svn: 230786
2015-02-28 03:29:02 +08:00
|
|
|
%tmp2 = getelementptr i16, i16* %A, i32 %inc
|
2011-02-08 01:43:21 +08:00
|
|
|
store i16* %tmp2, i16** %ptr
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2009-09-02 02:51:56 +08:00
|
|
|
define void @vst2lanei32(i32* %A, <2 x i32>* %B) nounwind {
|
2013-07-14 14:24:09 +08:00
|
|
|
;CHECK-LABEL: vst2lanei32:
|
2009-09-02 02:51:56 +08:00
|
|
|
;CHECK: vst2.32
|
2010-04-20 08:17:16 +08:00
|
|
|
%tmp0 = bitcast i32* %A to i8*
|
2015-02-28 05:17:42 +08:00
|
|
|
%tmp1 = load <2 x i32>, <2 x i32>* %B
|
2015-09-30 18:56:37 +08:00
|
|
|
call void @llvm.arm.neon.vst2lane.p0i8.v2i32(i8* %tmp0, <2 x i32> %tmp1, <2 x i32> %tmp1, i32 1, i32 1)
|
2009-09-02 02:51:56 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @vst2lanef(float* %A, <2 x float>* %B) nounwind {
|
2013-07-14 14:24:09 +08:00
|
|
|
;CHECK-LABEL: vst2lanef:
|
2009-09-02 02:51:56 +08:00
|
|
|
;CHECK: vst2.32
|
2010-04-20 08:17:16 +08:00
|
|
|
%tmp0 = bitcast float* %A to i8*
|
2015-02-28 05:17:42 +08:00
|
|
|
%tmp1 = load <2 x float>, <2 x float>* %B
|
2015-09-30 18:56:37 +08:00
|
|
|
call void @llvm.arm.neon.vst2lane.p0i8.v2f32(i8* %tmp0, <2 x float> %tmp1, <2 x float> %tmp1, i32 1, i32 1)
|
2009-09-02 02:51:56 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2009-10-09 07:38:24 +08:00
|
|
|
define void @vst2laneQi16(i16* %A, <8 x i16>* %B) nounwind {
|
2013-07-14 14:24:09 +08:00
|
|
|
;CHECK-LABEL: vst2laneQi16:
|
2010-10-19 08:16:32 +08:00
|
|
|
;Check the (default) alignment.
|
|
|
|
;CHECK: vst2.16 {d17[1], d19[1]}, [r0]
|
2010-04-20 08:17:16 +08:00
|
|
|
%tmp0 = bitcast i16* %A to i8*
|
2015-02-28 05:17:42 +08:00
|
|
|
%tmp1 = load <8 x i16>, <8 x i16>* %B
|
2015-09-30 18:56:37 +08:00
|
|
|
call void @llvm.arm.neon.vst2lane.p0i8.v8i16(i8* %tmp0, <8 x i16> %tmp1, <8 x i16> %tmp1, i32 5, i32 1)
|
2009-10-09 07:38:24 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @vst2laneQi32(i32* %A, <4 x i32>* %B) nounwind {
|
2013-07-14 14:24:09 +08:00
|
|
|
;CHECK-LABEL: vst2laneQi32:
|
2010-10-19 08:16:32 +08:00
|
|
|
;Check the alignment value. Max for this instruction is 64 bits:
|
2013-02-22 18:01:33 +08:00
|
|
|
;CHECK: vst2.32 {d17[0], d19[0]}, [r0:64]
|
2010-04-20 08:17:16 +08:00
|
|
|
%tmp0 = bitcast i32* %A to i8*
|
2015-02-28 05:17:42 +08:00
|
|
|
%tmp1 = load <4 x i32>, <4 x i32>* %B
|
2015-09-30 18:56:37 +08:00
|
|
|
call void @llvm.arm.neon.vst2lane.p0i8.v4i32(i8* %tmp0, <4 x i32> %tmp1, <4 x i32> %tmp1, i32 2, i32 16)
|
2009-10-09 07:38:24 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @vst2laneQf(float* %A, <4 x float>* %B) nounwind {
|
2013-07-14 14:24:09 +08:00
|
|
|
;CHECK-LABEL: vst2laneQf:
|
2009-10-09 07:38:24 +08:00
|
|
|
;CHECK: vst2.32
|
2010-04-20 08:17:16 +08:00
|
|
|
%tmp0 = bitcast float* %A to i8*
|
2015-02-28 05:17:42 +08:00
|
|
|
%tmp1 = load <4 x float>, <4 x float>* %B
|
2015-09-30 18:56:37 +08:00
|
|
|
call void @llvm.arm.neon.vst2lane.p0i8.v4f32(i8* %tmp0, <4 x float> %tmp1, <4 x float> %tmp1, i32 3, i32 1)
|
2009-10-09 07:38:24 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2015-09-30 18:56:37 +08:00
|
|
|
declare void @llvm.arm.neon.vst2lane.p0i8.v8i8(i8*, <8 x i8>, <8 x i8>, i32, i32) nounwind
|
|
|
|
declare void @llvm.arm.neon.vst2lane.p0i8.v4i16(i8*, <4 x i16>, <4 x i16>, i32, i32) nounwind
|
|
|
|
declare void @llvm.arm.neon.vst2lane.p0i8.v2i32(i8*, <2 x i32>, <2 x i32>, i32, i32) nounwind
|
|
|
|
declare void @llvm.arm.neon.vst2lane.p0i8.v2f32(i8*, <2 x float>, <2 x float>, i32, i32) nounwind
|
2009-09-02 02:51:56 +08:00
|
|
|
|
2015-09-30 18:56:37 +08:00
|
|
|
declare void @llvm.arm.neon.vst2lane.p0i8.v8i16(i8*, <8 x i16>, <8 x i16>, i32, i32) nounwind
|
|
|
|
declare void @llvm.arm.neon.vst2lane.p0i8.v4i32(i8*, <4 x i32>, <4 x i32>, i32, i32) nounwind
|
|
|
|
declare void @llvm.arm.neon.vst2lane.p0i8.v4f32(i8*, <4 x float>, <4 x float>, i32, i32) nounwind
|
2009-10-09 07:38:24 +08:00
|
|
|
|
2009-09-02 02:51:56 +08:00
|
|
|
define void @vst3lanei8(i8* %A, <8 x i8>* %B) nounwind {
|
2013-07-14 14:24:09 +08:00
|
|
|
;CHECK-LABEL: vst3lanei8:
|
2009-09-02 02:51:56 +08:00
|
|
|
;CHECK: vst3.8
|
2015-02-28 05:17:42 +08:00
|
|
|
%tmp1 = load <8 x i8>, <8 x i8>* %B
|
2015-09-30 18:56:37 +08:00
|
|
|
call void @llvm.arm.neon.vst3lane.p0i8.v8i8(i8* %A, <8 x i8> %tmp1, <8 x i8> %tmp1, <8 x i8> %tmp1, i32 1, i32 1)
|
2009-09-02 02:51:56 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @vst3lanei16(i16* %A, <4 x i16>* %B) nounwind {
|
2013-07-14 14:24:09 +08:00
|
|
|
;CHECK-LABEL: vst3lanei16:
|
2010-10-19 08:16:32 +08:00
|
|
|
;Check the (default) alignment value. VST3 does not support alignment.
|
|
|
|
;CHECK: vst3.16 {d16[1], d17[1], d18[1]}, [r0]
|
2010-04-20 08:17:16 +08:00
|
|
|
%tmp0 = bitcast i16* %A to i8*
|
2015-02-28 05:17:42 +08:00
|
|
|
%tmp1 = load <4 x i16>, <4 x i16>* %B
|
2015-09-30 18:56:37 +08:00
|
|
|
call void @llvm.arm.neon.vst3lane.p0i8.v4i16(i8* %tmp0, <4 x i16> %tmp1, <4 x i16> %tmp1, <4 x i16> %tmp1, i32 1, i32 8)
|
2009-09-02 02:51:56 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @vst3lanei32(i32* %A, <2 x i32>* %B) nounwind {
|
2013-07-14 14:24:09 +08:00
|
|
|
;CHECK-LABEL: vst3lanei32:
|
2009-09-02 02:51:56 +08:00
|
|
|
;CHECK: vst3.32
|
2010-04-20 08:17:16 +08:00
|
|
|
%tmp0 = bitcast i32* %A to i8*
|
2015-02-28 05:17:42 +08:00
|
|
|
%tmp1 = load <2 x i32>, <2 x i32>* %B
|
2015-09-30 18:56:37 +08:00
|
|
|
call void @llvm.arm.neon.vst3lane.p0i8.v2i32(i8* %tmp0, <2 x i32> %tmp1, <2 x i32> %tmp1, <2 x i32> %tmp1, i32 1, i32 1)
|
2009-09-02 02:51:56 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @vst3lanef(float* %A, <2 x float>* %B) nounwind {
|
2013-07-14 14:24:09 +08:00
|
|
|
;CHECK-LABEL: vst3lanef:
|
2009-09-02 02:51:56 +08:00
|
|
|
;CHECK: vst3.32
|
2010-04-20 08:17:16 +08:00
|
|
|
%tmp0 = bitcast float* %A to i8*
|
2015-02-28 05:17:42 +08:00
|
|
|
%tmp1 = load <2 x float>, <2 x float>* %B
|
2015-09-30 18:56:37 +08:00
|
|
|
call void @llvm.arm.neon.vst3lane.p0i8.v2f32(i8* %tmp0, <2 x float> %tmp1, <2 x float> %tmp1, <2 x float> %tmp1, i32 1, i32 1)
|
2009-09-02 02:51:56 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2009-10-09 07:51:31 +08:00
|
|
|
define void @vst3laneQi16(i16* %A, <8 x i16>* %B) nounwind {
|
2013-07-14 14:24:09 +08:00
|
|
|
;CHECK-LABEL: vst3laneQi16:
|
2010-10-19 08:16:32 +08:00
|
|
|
;Check the (default) alignment value. VST3 does not support alignment.
|
|
|
|
;CHECK: vst3.16 {d17[2], d19[2], d21[2]}, [r0]
|
2010-04-20 08:17:16 +08:00
|
|
|
%tmp0 = bitcast i16* %A to i8*
|
2015-02-28 05:17:42 +08:00
|
|
|
%tmp1 = load <8 x i16>, <8 x i16>* %B
|
2015-09-30 18:56:37 +08:00
|
|
|
call void @llvm.arm.neon.vst3lane.p0i8.v8i16(i8* %tmp0, <8 x i16> %tmp1, <8 x i16> %tmp1, <8 x i16> %tmp1, i32 6, i32 8)
|
2009-10-09 07:51:31 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @vst3laneQi32(i32* %A, <4 x i32>* %B) nounwind {
|
2013-07-14 14:24:09 +08:00
|
|
|
;CHECK-LABEL: vst3laneQi32:
|
2009-10-09 07:51:31 +08:00
|
|
|
;CHECK: vst3.32
|
2010-04-20 08:17:16 +08:00
|
|
|
%tmp0 = bitcast i32* %A to i8*
|
2015-02-28 05:17:42 +08:00
|
|
|
%tmp1 = load <4 x i32>, <4 x i32>* %B
|
2015-09-30 18:56:37 +08:00
|
|
|
call void @llvm.arm.neon.vst3lane.p0i8.v4i32(i8* %tmp0, <4 x i32> %tmp1, <4 x i32> %tmp1, <4 x i32> %tmp1, i32 0, i32 1)
|
2009-10-09 07:51:31 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2011-02-08 01:43:21 +08:00
|
|
|
;Check for a post-increment updating store.
|
|
|
|
define void @vst3laneQi32_update(i32** %ptr, <4 x i32>* %B) nounwind {
|
2013-07-14 14:24:09 +08:00
|
|
|
;CHECK-LABEL: vst3laneQi32_update:
|
2013-10-12 02:09:19 +08:00
|
|
|
;CHECK: vst3.32 {d16[0], d18[0], d20[0]}, [r1]!
|
2015-02-28 05:17:42 +08:00
|
|
|
%A = load i32*, i32** %ptr
|
2011-02-08 01:43:21 +08:00
|
|
|
%tmp0 = bitcast i32* %A to i8*
|
2015-02-28 05:17:42 +08:00
|
|
|
%tmp1 = load <4 x i32>, <4 x i32>* %B
|
2015-09-30 18:56:37 +08:00
|
|
|
call void @llvm.arm.neon.vst3lane.p0i8.v4i32(i8* %tmp0, <4 x i32> %tmp1, <4 x i32> %tmp1, <4 x i32> %tmp1, i32 0, i32 1)
|
[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
llvm-svn: 230786
2015-02-28 03:29:02 +08:00
|
|
|
%tmp2 = getelementptr i32, i32* %A, i32 3
|
2011-02-08 01:43:21 +08:00
|
|
|
store i32* %tmp2, i32** %ptr
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2009-10-09 07:51:31 +08:00
|
|
|
define void @vst3laneQf(float* %A, <4 x float>* %B) nounwind {
|
2013-07-14 14:24:09 +08:00
|
|
|
;CHECK-LABEL: vst3laneQf:
|
2009-10-09 07:51:31 +08:00
|
|
|
;CHECK: vst3.32
|
2010-04-20 08:17:16 +08:00
|
|
|
%tmp0 = bitcast float* %A to i8*
|
2015-02-28 05:17:42 +08:00
|
|
|
%tmp1 = load <4 x float>, <4 x float>* %B
|
2015-09-30 18:56:37 +08:00
|
|
|
call void @llvm.arm.neon.vst3lane.p0i8.v4f32(i8* %tmp0, <4 x float> %tmp1, <4 x float> %tmp1, <4 x float> %tmp1, i32 1, i32 1)
|
2009-10-09 07:51:31 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2015-09-30 18:56:37 +08:00
|
|
|
declare void @llvm.arm.neon.vst3lane.p0i8.v8i8(i8*, <8 x i8>, <8 x i8>, <8 x i8>, i32, i32) nounwind
|
|
|
|
declare void @llvm.arm.neon.vst3lane.p0i8.v4i16(i8*, <4 x i16>, <4 x i16>, <4 x i16>, i32, i32) nounwind
|
|
|
|
declare void @llvm.arm.neon.vst3lane.p0i8.v2i32(i8*, <2 x i32>, <2 x i32>, <2 x i32>, i32, i32) nounwind
|
|
|
|
declare void @llvm.arm.neon.vst3lane.p0i8.v2f32(i8*, <2 x float>, <2 x float>, <2 x float>, i32, i32) nounwind
|
2009-09-02 02:51:56 +08:00
|
|
|
|
2015-09-30 18:56:37 +08:00
|
|
|
declare void @llvm.arm.neon.vst3lane.p0i8.v8i16(i8*, <8 x i16>, <8 x i16>, <8 x i16>, i32, i32) nounwind
|
|
|
|
declare void @llvm.arm.neon.vst3lane.p0i8.v4i32(i8*, <4 x i32>, <4 x i32>, <4 x i32>, i32, i32) nounwind
|
|
|
|
declare void @llvm.arm.neon.vst3lane.p0i8.v4f32(i8*, <4 x float>, <4 x float>, <4 x float>, i32, i32) nounwind
|
2009-10-09 07:51:31 +08:00
|
|
|
|
2009-09-02 02:51:56 +08:00
|
|
|
|
|
|
|
define void @vst4lanei8(i8* %A, <8 x i8>* %B) nounwind {
|
2013-07-14 14:24:09 +08:00
|
|
|
;CHECK-LABEL: vst4lanei8:
|
2010-10-19 08:16:32 +08:00
|
|
|
;Check the alignment value. Max for this instruction is 32 bits:
|
2013-02-22 18:01:33 +08:00
|
|
|
;CHECK: vst4.8 {d16[1], d17[1], d18[1], d19[1]}, [r0:32]
|
2015-02-28 05:17:42 +08:00
|
|
|
%tmp1 = load <8 x i8>, <8 x i8>* %B
|
2015-09-30 18:56:37 +08:00
|
|
|
call void @llvm.arm.neon.vst4lane.p0i8.v8i8(i8* %A, <8 x i8> %tmp1, <8 x i8> %tmp1, <8 x i8> %tmp1, <8 x i8> %tmp1, i32 1, i32 8)
|
2009-09-02 02:51:56 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2011-02-08 01:43:21 +08:00
|
|
|
;Check for a post-increment updating store.
|
|
|
|
define void @vst4lanei8_update(i8** %ptr, <8 x i8>* %B) nounwind {
|
2013-07-14 14:24:09 +08:00
|
|
|
;CHECK-LABEL: vst4lanei8_update:
|
2013-10-12 02:09:19 +08:00
|
|
|
;CHECK: vst4.8 {d16[1], d17[1], d18[1], d19[1]}, [r1:32]!
|
2015-02-28 05:17:42 +08:00
|
|
|
%A = load i8*, i8** %ptr
|
|
|
|
%tmp1 = load <8 x i8>, <8 x i8>* %B
|
2015-09-30 18:56:37 +08:00
|
|
|
call void @llvm.arm.neon.vst4lane.p0i8.v8i8(i8* %A, <8 x i8> %tmp1, <8 x i8> %tmp1, <8 x i8> %tmp1, <8 x i8> %tmp1, i32 1, i32 8)
|
[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
llvm-svn: 230786
2015-02-28 03:29:02 +08:00
|
|
|
%tmp2 = getelementptr i8, i8* %A, i32 4
|
2011-02-08 01:43:21 +08:00
|
|
|
store i8* %tmp2, i8** %ptr
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2009-09-02 02:51:56 +08:00
|
|
|
define void @vst4lanei16(i16* %A, <4 x i16>* %B) nounwind {
|
2013-07-14 14:24:09 +08:00
|
|
|
;CHECK-LABEL: vst4lanei16:
|
2009-09-02 02:51:56 +08:00
|
|
|
;CHECK: vst4.16
|
2010-04-20 08:17:16 +08:00
|
|
|
%tmp0 = bitcast i16* %A to i8*
|
2015-02-28 05:17:42 +08:00
|
|
|
%tmp1 = load <4 x i16>, <4 x i16>* %B
|
2015-09-30 18:56:37 +08:00
|
|
|
call void @llvm.arm.neon.vst4lane.p0i8.v4i16(i8* %tmp0, <4 x i16> %tmp1, <4 x i16> %tmp1, <4 x i16> %tmp1, <4 x i16> %tmp1, i32 1, i32 1)
|
2009-09-02 02:51:56 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @vst4lanei32(i32* %A, <2 x i32>* %B) nounwind {
|
2013-07-14 14:24:09 +08:00
|
|
|
;CHECK-LABEL: vst4lanei32:
|
2010-10-19 08:16:32 +08:00
|
|
|
;Check the alignment value. Max for this instruction is 128 bits:
|
2013-02-22 18:01:33 +08:00
|
|
|
;CHECK: vst4.32 {d16[1], d17[1], d18[1], d19[1]}, [r0:128]
|
2010-04-20 08:17:16 +08:00
|
|
|
%tmp0 = bitcast i32* %A to i8*
|
2015-02-28 05:17:42 +08:00
|
|
|
%tmp1 = load <2 x i32>, <2 x i32>* %B
|
2015-09-30 18:56:37 +08:00
|
|
|
call void @llvm.arm.neon.vst4lane.p0i8.v2i32(i8* %tmp0, <2 x i32> %tmp1, <2 x i32> %tmp1, <2 x i32> %tmp1, <2 x i32> %tmp1, i32 1, i32 16)
|
2009-09-02 02:51:56 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @vst4lanef(float* %A, <2 x float>* %B) nounwind {
|
2013-07-14 14:24:09 +08:00
|
|
|
;CHECK-LABEL: vst4lanef:
|
2009-09-02 02:51:56 +08:00
|
|
|
;CHECK: vst4.32
|
2010-04-20 08:17:16 +08:00
|
|
|
%tmp0 = bitcast float* %A to i8*
|
2015-02-28 05:17:42 +08:00
|
|
|
%tmp1 = load <2 x float>, <2 x float>* %B
|
2015-09-30 18:56:37 +08:00
|
|
|
call void @llvm.arm.neon.vst4lane.p0i8.v2f32(i8* %tmp0, <2 x float> %tmp1, <2 x float> %tmp1, <2 x float> %tmp1, <2 x float> %tmp1, i32 1, i32 1)
|
2009-09-02 02:51:56 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2009-10-09 08:01:36 +08:00
|
|
|
define void @vst4laneQi16(i16* %A, <8 x i16>* %B) nounwind {
|
2013-07-14 14:24:09 +08:00
|
|
|
;CHECK-LABEL: vst4laneQi16:
|
2010-10-19 08:16:32 +08:00
|
|
|
;Check the alignment value. Max for this instruction is 64 bits:
|
2013-02-22 18:01:33 +08:00
|
|
|
;CHECK: vst4.16 {d17[3], d19[3], d21[3], d23[3]}, [r0:64]
|
2010-04-20 08:17:16 +08:00
|
|
|
%tmp0 = bitcast i16* %A to i8*
|
2015-02-28 05:17:42 +08:00
|
|
|
%tmp1 = load <8 x i16>, <8 x i16>* %B
|
2015-09-30 18:56:37 +08:00
|
|
|
call void @llvm.arm.neon.vst4lane.p0i8.v8i16(i8* %tmp0, <8 x i16> %tmp1, <8 x i16> %tmp1, <8 x i16> %tmp1, <8 x i16> %tmp1, i32 7, i32 16)
|
2009-10-09 08:01:36 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @vst4laneQi32(i32* %A, <4 x i32>* %B) nounwind {
|
2013-07-14 14:24:09 +08:00
|
|
|
;CHECK-LABEL: vst4laneQi32:
|
2010-10-19 08:16:32 +08:00
|
|
|
;Check the (default) alignment.
|
|
|
|
;CHECK: vst4.32 {d17[0], d19[0], d21[0], d23[0]}, [r0]
|
2010-04-20 08:17:16 +08:00
|
|
|
%tmp0 = bitcast i32* %A to i8*
|
2015-02-28 05:17:42 +08:00
|
|
|
%tmp1 = load <4 x i32>, <4 x i32>* %B
|
2015-09-30 18:56:37 +08:00
|
|
|
call void @llvm.arm.neon.vst4lane.p0i8.v4i32(i8* %tmp0, <4 x i32> %tmp1, <4 x i32> %tmp1, <4 x i32> %tmp1, <4 x i32> %tmp1, i32 2, i32 1)
|
2009-10-09 08:01:36 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @vst4laneQf(float* %A, <4 x float>* %B) nounwind {
|
2013-07-14 14:24:09 +08:00
|
|
|
;CHECK-LABEL: vst4laneQf:
|
2009-10-09 08:01:36 +08:00
|
|
|
;CHECK: vst4.32
|
2010-04-20 08:17:16 +08:00
|
|
|
%tmp0 = bitcast float* %A to i8*
|
2015-02-28 05:17:42 +08:00
|
|
|
%tmp1 = load <4 x float>, <4 x float>* %B
|
2015-09-30 18:56:37 +08:00
|
|
|
call void @llvm.arm.neon.vst4lane.p0i8.v4f32(i8* %tmp0, <4 x float> %tmp1, <4 x float> %tmp1, <4 x float> %tmp1, <4 x float> %tmp1, i32 1, i32 1)
|
2009-10-09 08:01:36 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2011-10-25 07:08:52 +08:00
|
|
|
; Make sure this doesn't crash; PR10258
|
|
|
|
define <8 x i16> @variable_insertelement(<8 x i16> %a, i16 %b, i32 %c) nounwind readnone {
|
2013-07-14 14:24:09 +08:00
|
|
|
;CHECK-LABEL: variable_insertelement:
|
2011-10-25 07:08:52 +08:00
|
|
|
%r = insertelement <8 x i16> %a, i16 %b, i32 %c
|
|
|
|
ret <8 x i16> %r
|
|
|
|
}
|
|
|
|
|
2015-09-30 18:56:37 +08:00
|
|
|
declare void @llvm.arm.neon.vst4lane.p0i8.v8i8(i8*, <8 x i8>, <8 x i8>, <8 x i8>, <8 x i8>, i32, i32) nounwind
|
|
|
|
declare void @llvm.arm.neon.vst4lane.p0i8.v4i16(i8*, <4 x i16>, <4 x i16>, <4 x i16>, <4 x i16>, i32, i32) nounwind
|
|
|
|
declare void @llvm.arm.neon.vst4lane.p0i8.v2i32(i8*, <2 x i32>, <2 x i32>, <2 x i32>, <2 x i32>, i32, i32) nounwind
|
|
|
|
declare void @llvm.arm.neon.vst4lane.p0i8.v2f32(i8*, <2 x float>, <2 x float>, <2 x float>, <2 x float>, i32, i32) nounwind
|
2009-10-09 08:01:36 +08:00
|
|
|
|
2015-09-30 18:56:37 +08:00
|
|
|
declare void @llvm.arm.neon.vst4lane.p0i8.v8i16(i8*, <8 x i16>, <8 x i16>, <8 x i16>, <8 x i16>, i32, i32) nounwind
|
|
|
|
declare void @llvm.arm.neon.vst4lane.p0i8.v4i32(i8*, <4 x i32>, <4 x i32>, <4 x i32>, <4 x i32>, i32, i32) nounwind
|
|
|
|
declare void @llvm.arm.neon.vst4lane.p0i8.v4f32(i8*, <4 x float>, <4 x float>, <4 x float>, <4 x float>, i32, i32) nounwind
|