Add support for Alpha intrinsics, contributed by Rahul Joshi

llvm-svn: 7373
This commit is contained in:
Chris Lattner 2003-07-28 21:20:57 +00:00
parent 8c48a098a5
commit 60104f00c7
2 changed files with 12 additions and 0 deletions

View File

@ -164,6 +164,12 @@ unsigned Function::getIntrinsicID() const {
return 0; // All intrinsics start with 'llvm.'
switch (getName()[5]) {
case 'a':
if (getName() == "llvm.alpha.ctlz") return LLVMIntrinsic::alpha_ctlz;
if (getName() == "llvm.alpha.cttz") return LLVMIntrinsic::alpha_cttz;
if (getName() == "llvm.alpha.ctpop") return LLVMIntrinsic::alpha_ctpop;
if (getName() == "llvm.alpha.umulh") return LLVMIntrinsic::alpha_umulh;
break;
case 'l':
if (getName() == "llvm.longjmp") return LLVMIntrinsic::longjmp;
break;

View File

@ -521,6 +521,12 @@ void Verifier::visitIntrinsicFunctionCall(LLVMIntrinsic::ID ID, CallInst &CI) {
case LLVMIntrinsic::va_copy: NumArgs = 2; break;
case LLVMIntrinsic::setjmp: NumArgs = 1; break;
case LLVMIntrinsic::longjmp: NumArgs = 2; break;
case LLVMIntrinsic::alpha_ctlz: NumArgs = 1; break;
case LLVMIntrinsic::alpha_cttz: NumArgs = 1; break;
case LLVMIntrinsic::alpha_ctpop: NumArgs = 1; break;
case LLVMIntrinsic::alpha_umulh: NumArgs = 2; break;
case LLVMIntrinsic::not_intrinsic:
assert(0 && "Invalid intrinsic!"); NumArgs = 0; break;
}