aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/SystemZ
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2009-07-16 14:34:52 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2009-07-16 14:34:52 +0000
commit6ff3f2c7106046ffa4479983899e1e0060be19be (patch)
treed45fe774d5cbf1b050df823ed82944d515332cb6 /lib/Target/SystemZ
parent21ddf779bfceb2ba98f976bcd36fbf017ed54c52 (diff)
downloadexternal_llvm-6ff3f2c7106046ffa4479983899e1e0060be19be.zip
external_llvm-6ff3f2c7106046ffa4479983899e1e0060be19be.tar.gz
external_llvm-6ff3f2c7106046ffa4479983899e1e0060be19be.tar.bz2
Add bswap patterns
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76061 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/SystemZ')
-rw-r--r--lib/Target/SystemZ/SystemZInstrInfo.td18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/Target/SystemZ/SystemZInstrInfo.td b/lib/Target/SystemZ/SystemZInstrInfo.td
index c124af6..30204fa 100644
--- a/lib/Target/SystemZ/SystemZInstrInfo.td
+++ b/lib/Target/SystemZ/SystemZInstrInfo.td
@@ -432,6 +432,24 @@ def MOV128r0_even : Pseudo<(outs GR128:$dst), (ins GR128:$src),
[]>;
}
+// Byte swaps
+def BSWAP32rr : Pseudo<(outs GR32:$dst), (ins GR32:$src),
+ "lrvr\t{$dst, $src}",
+ [(set GR32:$dst, (bswap GR32:$src))]>;
+def BSWAP64rr : Pseudo<(outs GR64:$dst), (ins GR64:$src),
+ "lrvgr\t{$dst, $src}",
+ [(set GR64:$dst, (bswap GR64:$src))]>;
+
+def BSWAP16rm : Pseudo<(outs GR32:$dst), (ins rriaddr:$src),
+ "lrvh\t{$dst, $src}",
+ [(set GR32:$dst, (bswap (extloadi32i16 rriaddr:$src)))]>;
+def BSWAP32rm : Pseudo<(outs GR32:$dst), (ins rriaddr:$src),
+ "lrv\t{$dst, $src}",
+ [(set GR32:$dst, (bswap (load rriaddr:$src)))]>;
+def BSWAP64rm : Pseudo<(outs GR64:$dst), (ins rriaddr:$src),
+ "lrvg\t{$dst, $src}",
+ [(set GR64:$dst, (bswap (load rriaddr:$src)))]>;
+
//===----------------------------------------------------------------------===//
// Arithmetic Instructions