forked from llvm-mirror/llvm
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ARM] Support inline assembler constraints for MVE.
"To" selects an odd-numbered GPR, and "Te" an even one. There are some 8.1-M instructions that have one too few bits in their register fields and require registers of particular parity, without necessarily using a consecutive even/odd pair. Also, the constraint letter "t" should select an MVE q-register, when MVE is present. This didn't need any source changes, but some extra tests have been added. Reviewers: dmgreen, samparker, SjoerdMeijer Subscribers: javed.absar, eraman, kristof.beyls, hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D60709 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364331 91177308-0d34-0410-b5e6-96231b3b80d8
- Loading branch information
1 parent
87cdc00
commit 6b3b0e0
Showing
5 changed files
with
110 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
; RUN: not llc -mtriple=armv8.1-m-eabi -mattr=+mve %s -o /dev/null 2>&1 | FileCheck %s | ||
|
||
; CHECK: inline assembly requires more registers than available | ||
define arm_aapcs_vfpcc <4 x i32> @t-constraint-i32-vectors-too-few-regs(<4 x i32> %a, <4 x i32> %b) { | ||
entry: | ||
%0 = tail call { <4 x i32>, <4 x i32>, <4 x i32>, <4 x i32>, <4 x i32>, | ||
<4 x i32>, <4 x i32>, <4 x i32>, <4 x i32>, <4 x i32> } | ||
asm "", | ||
"=t,=t,=t,=t,=t,=t,=t,=t,=t,=t,t,t"(<4 x i32> %a, <4 x i32> %b) | ||
%asmresult = extractvalue { <4 x i32>, <4 x i32>, <4 x i32>, <4 x i32>, | ||
<4 x i32>, <4 x i32>, <4 x i32>, <4 x i32>, | ||
<4 x i32>, <4 x i32> } %0, 0 | ||
ret <4 x i32> %asmresult | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
; RUN: llc -mtriple=armv8.1-m-eabi -mattr=+mve %s -o - | FileCheck %s | ||
|
||
define i32 @test1(i32 %tmp54) { | ||
%tmp56 = tail call i32 asm "uxtb16 $0,$1", "=r,r"( i32 %tmp54 ) | ||
ret i32 %tmp56 | ||
} | ||
|
||
define void @test2() { | ||
tail call void asm sideeffect "/* number: ${0:c} */", "i"( i32 1 ) | ||
ret void | ||
} | ||
|
||
define arm_aapcs_vfpcc <4 x i32> @mve-t-constraint-128bit(<4 x i32>, <4 x i32>) { | ||
; CHECK-LABEL: mve-t-constraint-128bit | ||
; CHECK: vadd.i32 q{{[0-7]}}, q{{[0-7]}}, q{{[0-7]}} | ||
%ret = tail call <4 x i32> | ||
asm "vadd.i32 $0, $1, $2", "=t,t,t" | ||
(<4 x i32> %0, <4 x i32> %1) | ||
ret <4 x i32> %ret | ||
} | ||
|
||
define i32 @even-GPR-constraint() { | ||
entry: | ||
; CHECK-LABEL: even-GPR-constraint | ||
; CHECK: add [[REG:r1*[0, 2, 4, 6, 8]]], [[REG]], #1 | ||
; CHECK: add [[REG:r1*[0, 2, 4, 6, 8]]], [[REG]], #2 | ||
; CHECK: add [[REG:r1*[0, 2, 4, 6, 8]]], [[REG]], #3 | ||
; CHECK: add [[REG:r1*[0, 2, 4, 6, 8]]], [[REG]], #4 | ||
%0 = tail call { i32, i32, i32, i32 } | ||
asm "add $0, #1\0Aadd $1, #2\0Aadd $2, #3\0Aadd $3, #4\0A", "=^Te,=^Te,=^Te,=^Te,0,1,2,3" | ||
(i32 0, i32 0, i32 0, i32 0) | ||
%asmresult = extractvalue { i32, i32, i32, i32 } %0, 0 | ||
ret i32 %asmresult | ||
} | ||
|
||
define i32 @odd-GPR-constraint() { | ||
entry: | ||
; CHECK-LABEL: odd-GPR-constraint | ||
; CHECK: add [[REG:r1*[1, 3, 5, 7, 9]]], [[REG]], #1 | ||
; CHECK: add [[REG:r1*[1, 3, 5, 7, 9]]], [[REG]], #2 | ||
; CHECK: add [[REG:r1*[1, 3, 5, 7, 9]]], [[REG]], #3 | ||
; CHECK: add [[REG:r1*[1, 3, 5, 7, 9]]], [[REG]], #4 | ||
%0 = tail call { i32, i32, i32, i32 } | ||
asm "add $0, #1\0Aadd $1, #2\0Aadd $2, #3\0Aadd $3, #4\0A", "=^To,=^To,=^To,=^To,0,1,2,3" | ||
(i32 0, i32 0, i32 0, i32 0) | ||
%asmresult = extractvalue { i32, i32, i32, i32 } %0, 0 | ||
ret i32 %asmresult | ||
} |