Upgrade the llvm.isunordered intrinsics to "fcmp uno" instruction.

llvm-svn: 32986
This commit is contained in:
Reid Spencer 2007-01-07 08:07:10 +00:00
parent d97f1936bb
commit 2af5100b53
1 changed files with 24 additions and 14 deletions

View File

@ -1872,6 +1872,15 @@ InstVal : ArithmeticOps Types ValueRef ',' ValueRef {
delete $2.val;
}
| OptTailCall OptCallingConv TypesV ValueRef '(' ValueRefListE ')' {
// 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())
@ -1887,6 +1896,7 @@ InstVal : ArithmeticOps Types ValueRef ',' ValueRef {
*$1 += ")";
$$.val = $1;
$$.type = getFunctionReturnType($3);
}
delete $2; $4.destroy(); delete $6;
}
| MemoryInst ;