mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-23 16:19:52 +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:
@@ -63,6 +63,7 @@ namespace Intrinsic {
|
|||||||
|
|
||||||
// libm related functions.
|
// libm related functions.
|
||||||
isunordered, // Return true if either argument is a NaN
|
isunordered, // Return true if either argument is a NaN
|
||||||
|
sqrt,
|
||||||
|
|
||||||
// Input/Output intrinsics.
|
// Input/Output intrinsics.
|
||||||
readport,
|
readport,
|
||||||
|
|||||||
@@ -702,7 +702,7 @@ namespace {
|
|||||||
static const char *DoesntAccessMemoryTable[] = {
|
static const char *DoesntAccessMemoryTable[] = {
|
||||||
// LLVM intrinsics:
|
// LLVM intrinsics:
|
||||||
"llvm.frameaddress", "llvm.returnaddress", "llvm.readport",
|
"llvm.frameaddress", "llvm.returnaddress", "llvm.readport",
|
||||||
"llvm.isunordered",
|
"llvm.isunordered", "llvm.sqrt",
|
||||||
|
|
||||||
"abs", "labs", "llabs", "imaxabs", "fabs", "fabsf", "fabsl",
|
"abs", "labs", "llabs", "imaxabs", "fabs", "fabsf", "fabsl",
|
||||||
"trunc", "truncf", "truncl", "ldexp",
|
"trunc", "truncf", "truncl", "ldexp",
|
||||||
|
|||||||
@@ -245,6 +245,7 @@ unsigned Function::getIntrinsicID() const {
|
|||||||
if (getName() == "llvm.setjmp") return Intrinsic::setjmp;
|
if (getName() == "llvm.setjmp") return Intrinsic::setjmp;
|
||||||
if (getName() == "llvm.sigsetjmp") return Intrinsic::sigsetjmp;
|
if (getName() == "llvm.sigsetjmp") return Intrinsic::sigsetjmp;
|
||||||
if (getName() == "llvm.siglongjmp") return Intrinsic::siglongjmp;
|
if (getName() == "llvm.siglongjmp") return Intrinsic::siglongjmp;
|
||||||
|
if (getName() == "llvm.sqrt") return Intrinsic::sqrt;
|
||||||
break;
|
break;
|
||||||
case 'v':
|
case 'v':
|
||||||
if (getName() == "llvm.va_copy") return Intrinsic::vacopy;
|
if (getName() == "llvm.va_copy") return Intrinsic::vacopy;
|
||||||
|
|||||||
@@ -723,6 +723,16 @@ void Verifier::visitIntrinsicFunctionCall(Intrinsic::ID ID, CallInst &CI) {
|
|||||||
NumArgs = 2;
|
NumArgs = 2;
|
||||||
break;
|
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::setjmp: NumArgs = 1; break;
|
||||||
case Intrinsic::longjmp: NumArgs = 2; break;
|
case Intrinsic::longjmp: NumArgs = 2; break;
|
||||||
case Intrinsic::sigsetjmp: NumArgs = 2; break;
|
case Intrinsic::sigsetjmp: NumArgs = 2; break;
|
||||||
|
|||||||
Reference in New Issue
Block a user