mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
Add llvm.sqrt intrinsic, patch contributed by Morten Ofstad
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21627 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9f56b1feeb
commit
eed37bad01
@ -63,6 +63,7 @@ namespace Intrinsic {
|
||||
|
||||
// libm related functions.
|
||||
isunordered, // Return true if either argument is a NaN
|
||||
sqrt,
|
||||
|
||||
// Input/Output intrinsics.
|
||||
readport,
|
||||
|
@ -702,7 +702,7 @@ namespace {
|
||||
static const char *DoesntAccessMemoryTable[] = {
|
||||
// LLVM intrinsics:
|
||||
"llvm.frameaddress", "llvm.returnaddress", "llvm.readport",
|
||||
"llvm.isunordered",
|
||||
"llvm.isunordered", "llvm.sqrt",
|
||||
|
||||
"abs", "labs", "llabs", "imaxabs", "fabs", "fabsf", "fabsl",
|
||||
"trunc", "truncf", "truncl", "ldexp",
|
||||
|
@ -245,6 +245,7 @@ unsigned Function::getIntrinsicID() const {
|
||||
if (getName() == "llvm.setjmp") return Intrinsic::setjmp;
|
||||
if (getName() == "llvm.sigsetjmp") return Intrinsic::sigsetjmp;
|
||||
if (getName() == "llvm.siglongjmp") return Intrinsic::siglongjmp;
|
||||
if (getName() == "llvm.sqrt") return Intrinsic::sqrt;
|
||||
break;
|
||||
case 'v':
|
||||
if (getName() == "llvm.va_copy") return Intrinsic::vacopy;
|
||||
|
@ -723,6 +723,16 @@ void Verifier::visitIntrinsicFunctionCall(Intrinsic::ID ID, CallInst &CI) {
|
||||
NumArgs = 2;
|
||||
break;
|
||||
|
||||
case Intrinsic::sqrt:
|
||||
Assert1(FT->getNumParams() == 1,
|
||||
"Illegal # arguments for intrinsic function!", IF);
|
||||
Assert1(FT->getParamType(0)->isFloatingPoint(),
|
||||
"Argument is not a floating point type!", IF);
|
||||
Assert1(FT->getReturnType() == FT->getParamType(0),
|
||||
"Return type is not the same as argument type!", IF);
|
||||
NumArgs = 1;
|
||||
break;
|
||||
|
||||
case Intrinsic::setjmp: NumArgs = 1; break;
|
||||
case Intrinsic::longjmp: NumArgs = 2; break;
|
||||
case Intrinsic::sigsetjmp: NumArgs = 2; break;
|
||||
|
Loading…
Reference in New Issue
Block a user