summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/SystemZ/SystemZPatterns.td
diff options
context:
space:
mode:
authorRichard Sandiford <rsandifo@linux.vnet.ibm.com>2013-12-06 09:59:12 +0000
committerRichard Sandiford <rsandifo@linux.vnet.ibm.com>2013-12-06 09:59:12 +0000
commit198ddf83c1b64b95321ea8b2f764aace81d6963d (patch)
tree0cb4ce5955d09d84bc81c23e81802c9055e1d276 /llvm/lib/Target/SystemZ/SystemZPatterns.td
parent7b4118a0fcf1c99fb352cef9c297f97af7a35757 (diff)
downloadbcm5719-llvm-198ddf83c1b64b95321ea8b2f764aace81d6963d.tar.gz
bcm5719-llvm-198ddf83c1b64b95321ea8b2f764aace81d6963d.zip
[SystemZ] Use LOAD AND TEST for comparisons with -0
...since it os equivalent to comparison with +0. llvm-svn: 196580
Diffstat (limited to 'llvm/lib/Target/SystemZ/SystemZPatterns.td')
-rw-r--r--llvm/lib/Target/SystemZ/SystemZPatterns.td7
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/Target/SystemZ/SystemZPatterns.td b/llvm/lib/Target/SystemZ/SystemZPatterns.td
index 7706351e54b..c0f94ecbe2c 100644
--- a/llvm/lib/Target/SystemZ/SystemZPatterns.td
+++ b/llvm/lib/Target/SystemZ/SystemZPatterns.td
@@ -148,5 +148,8 @@ multiclass BlockLoadStore<SDPatternOperator load, ValueType vt,
// Record that INSN is a LOAD AND TEST that can be used to compare
// registers in CLS against zero. The instruction has separate R1 and R2
// operands, but they must be the same when the instruction is used like this.
-class CompareZeroFP<Instruction insn, RegisterOperand cls>
- : Pat<(z_fcmp cls:$reg, (fpimm0)), (insn cls:$reg, cls:$reg)>;
+multiclass CompareZeroFP<Instruction insn, RegisterOperand cls> {
+ def : Pat<(z_fcmp cls:$reg, (fpimm0)), (insn cls:$reg, cls:$reg)>;
+ // The sign of the zero makes no difference.
+ def : Pat<(z_fcmp cls:$reg, (fpimmneg0)), (insn cls:$reg, cls:$reg)>;
+}
OpenPOWER on IntegriCloud