summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2009-08-05 16:50:53 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2009-08-05 16:50:53 +0000
commitbe47ccffef343bd08dd373340842e402863b46fd (patch)
treeb06afa67d6bb068d127faa0c145efe4cb42c12cd
parent477fd55c9ac7c0cb02b0d0e502f7fa0367b735f4 (diff)
downloadbcm5719-llvm-be47ccffef343bd08dd373340842e402863b46fd.tar.gz
bcm5719-llvm-be47ccffef343bd08dd373340842e402863b46fd.zip
Convert bswap test to filecheck, add more test entries & convert stuff to filecheck
llvm-svn: 78212
-rw-r--r--llvm/lib/Target/SystemZ/SystemZInstrInfo.td2
-rw-r--r--llvm/test/CodeGen/SystemZ/11-BSwap.ll37
2 files changed, 32 insertions, 7 deletions
diff --git a/llvm/lib/Target/SystemZ/SystemZInstrInfo.td b/llvm/lib/Target/SystemZ/SystemZInstrInfo.td
index 58ea46c6551..810d027398c 100644
--- a/llvm/lib/Target/SystemZ/SystemZInstrInfo.td
+++ b/llvm/lib/Target/SystemZ/SystemZInstrInfo.td
@@ -510,7 +510,7 @@ def BSWAP64rm : RXYI<0x0FE3, (outs GR64:$dst), (ins rriaddr:$src),
// [(truncstorei16 (bswap GR32:$src), rriaddr:$dst)]>;
def BSWAP32mr : RXYI<0xE33E, (outs), (ins rriaddr:$dst, GR32:$src),
"strv\t{$src, $dst}",
- [(truncstorei32 (bswap GR32:$src), rriaddr:$dst)]>;
+ [(store (bswap GR32:$src), rriaddr:$dst)]>;
def BSWAP64mr : RXYI<0xE32F, (outs), (ins rriaddr:$dst, GR64:$src),
"strvg\t{$src, $dst}",
[(store (bswap GR64:$src), rriaddr:$dst)]>;
diff --git a/llvm/test/CodeGen/SystemZ/11-BSwap.ll b/llvm/test/CodeGen/SystemZ/11-BSwap.ll
index a3e1cd0c9e9..8480311de0b 100644
--- a/llvm/test/CodeGen/SystemZ/11-BSwap.ll
+++ b/llvm/test/CodeGen/SystemZ/11-BSwap.ll
@@ -1,9 +1,4 @@
-; XFAIL: *
-; RUN: llvm-as < %s | llc | grep lrvr | count 2
-; RUN: llvm-as < %s | llc | grep lrvgr | count 1
-; RUN: llvm-as < %s | llc | grep lrvh | count 1
-; RUN: llvm-as < %s | llc | grep {lrv.%} | count 1
-; RUN: llvm-as < %s | llc | grep {lrvg.%} | count 1
+; RUN: llvm-as < %s | llc | FileCheck %s
target datalayout = "E-p:64:64:64-i8:8:16-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f128:128:128-a0:16:16"
@@ -16,11 +11,15 @@ define i16 @foo(i16 zeroext %a) zeroext {
}
define i32 @foo2(i32 zeroext %a) zeroext {
+; CHECK: foo2:
+; CHECK: lrvr %r1, %r2
%res = tail call i32 @llvm.bswap.i32(i32 %a)
ret i32 %res
}
define i64 @foo3(i64 %a) zeroext {
+; CHECK: foo3:
+; CHECK: lrvgr %r2, %r2
%res = tail call i64 @llvm.bswap.i64(i64 %a)
ret i64 %res
}
@@ -32,17 +31,43 @@ define i16 @foo4(i16* %b) zeroext {
}
define i32 @foo5(i32* %b) zeroext {
+; CHECK: foo5:
+; CHECK: lrv %r1, 0(%r2)
%a = load i32* %b
%res = tail call i32 @llvm.bswap.i32(i32 %a)
ret i32 %res
}
define i64 @foo6(i64* %b) {
+; CHECK: foo6:
+; CHECK: lrvg %r2, 0(%r2)
%a = load i64* %b
%res = tail call i64 @llvm.bswap.i64(i64 %a)
ret i64 %res
}
+define void @foo7(i16 %a, i16* %b) {
+ %res = tail call i16 @llvm.bswap.i16(i16 %a)
+ store i16 %res, i16* %b
+ ret void
+}
+
+define void @foo8(i32 %a, i32* %b) {
+; CHECK: foo8:
+; CHECK: strv %r2, 0(%r3)
+ %res = tail call i32 @llvm.bswap.i32(i32 %a)
+ store i32 %res, i32* %b
+ ret void
+}
+
+define void @foo9(i64 %a, i64* %b) {
+; CHECK: foo9:
+; CHECK: strvg %r2, 0(%r3)
+ %res = tail call i64 @llvm.bswap.i64(i64 %a)
+ store i64 %res, i64* %b
+ ret void
+}
+
declare i16 @llvm.bswap.i16(i16) nounwind readnone
declare i32 @llvm.bswap.i32(i32) nounwind readnone
declare i64 @llvm.bswap.i64(i64) nounwind readnone
OpenPOWER on IntegriCloud