summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorUlrich Weigand <ulrich.weigand@de.ibm.com>2016-06-09 15:19:16 +0000
committerUlrich Weigand <ulrich.weigand@de.ibm.com>2016-06-09 15:19:16 +0000
commit79564611d9f982935952d3b62ef5918122fa5919 (patch)
treec8b75b762e2ef64436929959440a409c88d410bd /llvm/test
parentdb0168d1d669e0a21f889a67a86e883ec60fd701 (diff)
downloadbcm5719-llvm-79564611d9f982935952d3b62ef5918122fa5919.tar.gz
bcm5719-llvm-79564611d9f982935952d3b62ef5918122fa5919.zip
[SystemZ] Enable long displacement constraints for inline ASM operands
This enables use of the 'S' constraint for inline ASM operands on SystemZ, which allows for a memory reference with a signed 20-bit immediate displacement. This patch includes corresponding documentation and test case updates. I've changed the 'T' constraint to match the new behavior for 'S', as 'T' also uses a long displacement (though index constraints are still not implemented). I also changed 'm' to match the behavior for 'S' as this will allow for a wider range of displacements for 'm', though correct me if that's not the right decision. Author: colpell Differential Revision: http://reviews.llvm.org/D21097 llvm-svn: 272266
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/CodeGen/SystemZ/asm-03.ll40
-rw-r--r--llvm/test/CodeGen/SystemZ/asm-04.ll2
-rw-r--r--llvm/test/CodeGen/SystemZ/asm-05.ll2
3 files changed, 39 insertions, 5 deletions
diff --git a/llvm/test/CodeGen/SystemZ/asm-03.ll b/llvm/test/CodeGen/SystemZ/asm-03.ll
index 2e60ad61ef4..d4fd564ce19 100644
--- a/llvm/test/CodeGen/SystemZ/asm-03.ll
+++ b/llvm/test/CodeGen/SystemZ/asm-03.ll
@@ -3,14 +3,48 @@
;
; RUN: llc < %s -mtriple=s390x-linux-gnu -no-integrated-as | FileCheck %s
+; Check the lowest range.
define void @f1(i64 %base) {
; CHECK-LABEL: f1:
+; CHECK: blah -524288(%r2)
+; CHECK: br %r14
+ %add = add i64 %base, -524288
+ %addr = inttoptr i64 %add to i64 *
+ call void asm "blah $0", "=*S" (i64 *%addr)
+ ret void
+}
+
+; Check the next lowest byte.
+define void @f2(i64 %base) {
+; CHECK-LABEL: f2:
+; CHECK: agfi %r2, -524289
; CHECK: blah 0(%r2)
; CHECK: br %r14
- %addr = inttoptr i64 %base to i64 *
+ %add = add i64 %base, -524289
+ %addr = inttoptr i64 %add to i64 *
call void asm "blah $0", "=*S" (i64 *%addr)
ret void
}
-; FIXME: at the moment the precise constraint is not passed down to
-; target code, so we must conservatively treat "S" as "Q".
+; Check the highest range.
+define void @f3(i64 %base) {
+; CHECK-LABEL: f3:
+; CHECK: blah 524287(%r2)
+; CHECK: br %r14
+ %add = add i64 %base, 524287
+ %addr = inttoptr i64 %add to i64 *
+ call void asm "blah $0", "=*S" (i64 *%addr)
+ ret void
+}
+
+; Check the next highest byte.
+define void @f4(i64 %base) {
+; CHECK-LABEL: f4:
+; CHECK: agfi %r2, 524288
+; CHECK: blah 0(%r2)
+; CHECK: br %r14
+ %add = add i64 %base, 524288
+ %addr = inttoptr i64 %add to i64 *
+ call void asm "blah $0", "=*S" (i64 *%addr)
+ ret void
+}
diff --git a/llvm/test/CodeGen/SystemZ/asm-04.ll b/llvm/test/CodeGen/SystemZ/asm-04.ll
index b212253dbd9..a41a0a630d9 100644
--- a/llvm/test/CodeGen/SystemZ/asm-04.ll
+++ b/llvm/test/CodeGen/SystemZ/asm-04.ll
@@ -13,4 +13,4 @@ define void @f1(i64 %base) {
}
; FIXME: at the moment the precise constraint is not passed down to
-; target code, so we must conservatively treat "T" as "Q".
+; target code, so we must conservatively treat "T" as "S".
diff --git a/llvm/test/CodeGen/SystemZ/asm-05.ll b/llvm/test/CodeGen/SystemZ/asm-05.ll
index db99b10853e..780b61ac3a3 100644
--- a/llvm/test/CodeGen/SystemZ/asm-05.ll
+++ b/llvm/test/CodeGen/SystemZ/asm-05.ll
@@ -12,4 +12,4 @@ define void @f1(i64 %base) {
}
; FIXME: at the moment the precise constraint is not passed down to
-; target code, so we must conservatively treat "m" as "Q".
+; target code, so we must conservatively treat "m" as "S".
OpenPOWER on IntegriCloud