memmove, // Copy potentially overlapping memory blocks
memset, // Fill memory with a byte value
- // Standard libm functions.
+ // libm related functions.
+ isnan, // Return true if fp argument is a NAN.
// Input/Output intrinsics.
readport,
readio,
writeio,
- // Support for unordered compare intrinsic
- isunordered,
-
//===------------------------------------------------------------------===//
// This section defines intrinsic functions used to represent Alpha
// instructions.
(*(CI->op_begin()+1))->getType(), MemsetFCache);
break;
}
- case Intrinsic::isunordered: {
- static Function *IsunorderedFCache = 0;
- ReplaceCallWith("isunordered", CI, CI->op_begin()+1, CI->op_end(),
- (*(CI->op_begin()+1))->getType(), IsunorderedFCache);
+ case Intrinsic::isnan: {
+ // FIXME: This should force the argument to be a double. There may be
+ // multiple isnans for different FP arguments.
+ static Function *isnanFCache = 0;
+ ReplaceCallWith("isnan", CI, CI->op_begin()+1, CI->op_end(),
+ (*(CI->op_begin()+1))->getType(), isnanFCache);
break;
}
}
if (getName() == "llvm.gcroot") return Intrinsic::gcroot;
break;
case 'i':
- if (getName() == "llvm.isunordered") return Intrinsic::isunordered;
+ if (getName() == "llvm.isnan") return Intrinsic::isnan;
break;
case 'l':
if (getName() == "llvm.longjmp") return Intrinsic::longjmp;
(*(CI->op_begin()+1))->getType(), MemsetFCache);
break;
}
- case Intrinsic::isunordered: {
- static Function *IsunorderedFCache = 0;
- ReplaceCallWith("isunordered", CI, CI->op_begin()+1, CI->op_end(),
- (*(CI->op_begin()+1))->getType(), IsunorderedFCache);
+ case Intrinsic::isnan: {
+ // FIXME: This should force the argument to be a double. There may be
+ // multiple isnans for different FP arguments.
+ static Function *isnanFCache = 0;
+ ReplaceCallWith("isnan", CI, CI->op_begin()+1, CI->op_end(),
+ (*(CI->op_begin()+1))->getType(), isnanFCache);
break;
}
}
break;
}
- case Intrinsic::isunordered: NumArgs = 2; break;
+ case Intrinsic::isnan:
+ Assert1(FT->getNumParams() == 1 && FT->getParamType(0)->isFloatingPoint(),
+ "Illegal prototype for llvm.isnan", IF);
+ Assert1(FT->getReturnType() == Type::BoolTy,
+ "Illegal prototype for llvm.isnan", IF);
+ NumArgs = 1;
+ break;
case Intrinsic::setjmp: NumArgs = 1; break;
case Intrinsic::longjmp: NumArgs = 2; break;