[llvm-commits] CVS: llvm/tools/llvm-upgrade/UpgradeParser.y
Reid Spencer
reid at x10sys.com
Sun Jan 7 00:07:26 PST 2007
Changes in directory llvm/tools/llvm-upgrade:
UpgradeParser.y updated: 1.35 -> 1.36
---
Log message:
Upgrade the llvm.isunordered intrinsics to "fcmp uno" instruction.
---
Diffs of the changes: (+24 -14)
UpgradeParser.y | 38 ++++++++++++++++++++++++--------------
1 files changed, 24 insertions(+), 14 deletions(-)
Index: llvm/tools/llvm-upgrade/UpgradeParser.y
diff -u llvm/tools/llvm-upgrade/UpgradeParser.y:1.35 llvm/tools/llvm-upgrade/UpgradeParser.y:1.36
--- llvm/tools/llvm-upgrade/UpgradeParser.y:1.35 Sat Jan 6 00:03:09 2007
+++ llvm/tools/llvm-upgrade/UpgradeParser.y Sun Jan 7 02:07:10 2007
@@ -1872,21 +1872,31 @@
delete $2.val;
}
| OptTailCall OptCallingConv TypesV ValueRef '(' ValueRefListE ')' {
- if (!$2->empty())
- *$1 += " " + *$2;
- if (!$1->empty())
- *$1 += " ";
- *$1 += $3->getNewTy() + " " + *$4.val + "(";
- for (unsigned i = 0; i < $6->size(); ++i) {
- ValueInfo& VI = (*$6)[i];
- *$1 += *VI.val;
- if (i+1 < $6->size())
- *$1 += ", ";
- VI.destroy();
+ // map llvm.isunordered to "fcmp uno"
+ if (*$4.val == "%llvm.isunordered.f32" ||
+ *$4.val == "%llvm.isunordered.f64") {
+ $$.val = new std::string( "fcmp uno " + *(*$6)[0].val + ", ");
+ size_t pos = (*$6)[1].val->find(' ');
+ assert(pos != std::string::npos && "no space?");
+ *$$.val += (*$6)[1].val->substr(pos+1);
+ $$.type = TypeInfo::get("bool", BoolTy);
+ } else {
+ if (!$2->empty())
+ *$1 += " " + *$2;
+ if (!$1->empty())
+ *$1 += " ";
+ *$1 += $3->getNewTy() + " " + *$4.val + "(";
+ for (unsigned i = 0; i < $6->size(); ++i) {
+ ValueInfo& VI = (*$6)[i];
+ *$1 += *VI.val;
+ if (i+1 < $6->size())
+ *$1 += ", ";
+ VI.destroy();
+ }
+ *$1 += ")";
+ $$.val = $1;
+ $$.type = getFunctionReturnType($3);
}
- *$1 += ")";
- $$.val = $1;
- $$.type = getFunctionReturnType($3);
delete $2; $4.destroy(); delete $6;
}
| MemoryInst ;
More information about the llvm-commits
mailing list