aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/SystemZ/SystemZOperators.td
diff options
context:
space:
mode:
authorRichard Sandiford <rsandifo@linux.vnet.ibm.com>2013-08-19 12:48:54 +0000
committerRichard Sandiford <rsandifo@linux.vnet.ibm.com>2013-08-19 12:48:54 +0000
commitb0d40a22e5aa1a51913fa161c2ce5513d7bd9293 (patch)
tree52334bd3daccd16d29c2a27180d1a2e986ec640e /lib/Target/SystemZ/SystemZOperators.td
parent80f54784da0bd42fb79176bbf447a31d69287fe3 (diff)
downloadexternal_llvm-b0d40a22e5aa1a51913fa161c2ce5513d7bd9293.zip
external_llvm-b0d40a22e5aa1a51913fa161c2ce5513d7bd9293.tar.gz
external_llvm-b0d40a22e5aa1a51913fa161c2ce5513d7bd9293.tar.bz2
[SystemZ] Add integer absolute (load positive)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188670 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/SystemZ/SystemZOperators.td')
-rw-r--r--lib/Target/SystemZ/SystemZOperators.td8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Target/SystemZ/SystemZOperators.td b/lib/Target/SystemZ/SystemZOperators.td
index 8d6c619..59e1ffc 100644
--- a/lib/Target/SystemZ/SystemZOperators.td
+++ b/lib/Target/SystemZ/SystemZOperators.td
@@ -240,6 +240,14 @@ def or_as_revinserti8 : PatFrag<(ops node:$src1, node:$src2),
APInt::getLowBitsSet(BitWidth, 8));
}]>;
+// Integer absolute, matching the canonical form generated by DAGCombiner.
+def z_iabs32 : PatFrag<(ops node:$src),
+ (xor (add node:$src, (sra node:$src, (i32 31))),
+ (sra node:$src, (i32 31)))>;
+def z_iabs64 : PatFrag<(ops node:$src),
+ (xor (add node:$src, (sra node:$src, (i32 63))),
+ (sra node:$src, (i32 63)))>;
+
// Fused multiply-add and multiply-subtract, but with the order of the
// operands matching SystemZ's MA and MS instructions.
def z_fma : PatFrag<(ops node:$src1, node:$src2, node:$src3),