summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanaka@mips.com>2011-11-07 18:57:41 +0000
committerAkira Hatanaka <ahatanaka@mips.com>2011-11-07 18:57:41 +0000
commitd5c1329078793f0e33759845c9327897540dfae6 (patch)
tree081d04087bd7847cf7536160fd51eff26c028db9 /llvm/lib/Target
parent80357c6227da0da3b9adfafb9a9ba2328abf8703 (diff)
downloadbcm5719-llvm-d5c1329078793f0e33759845c9327897540dfae6.tar.gz
bcm5719-llvm-d5c1329078793f0e33759845c9327897540dfae6.zip
Add 64-bit to 32-bit trunc pattern.
llvm-svn: 143988
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/Mips/Mips64InstrInfo.td5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Target/Mips/Mips64InstrInfo.td b/llvm/lib/Target/Mips/Mips64InstrInfo.td
index 05470d5a4d4..3708c4a3627 100644
--- a/llvm/lib/Target/Mips/Mips64InstrInfo.td
+++ b/llvm/lib/Target/Mips/Mips64InstrInfo.td
@@ -172,3 +172,8 @@ defm : SetlePats<CPU64Regs, SLT64, SLTu64>;
defm : SetgtPats<CPU64Regs, SLT64, SLTu64>;
defm : SetgePats<CPU64Regs, SLT64, SLTu64>;
defm : SetgeImmPats<CPU64Regs, SLTi64, SLTiu64>;
+
+// truncate
+def : Pat<(i32 (trunc CPU64Regs:$src)),
+ (SLL (EXTRACT_SUBREG CPU64Regs:$src, sub_32), 0)>, Requires<[IsN64]>;
+
OpenPOWER on IntegriCloud