[llvm-commits] [llvm-gcc-4.2] r57244 - /llvm-gcc-4.2/trunk/gcc/config/alpha/llvm-alpha.cpp
Andrew Lenharth
alenhar2 at cs.uiuc.edu
Tue Oct 7 07:41:04 PDT 2008
Author: alenhar2
Date: Tue Oct 7 09:41:03 2008
New Revision: 57244
URL: http://llvm.org/viewvc/llvm-project?rev=57244&view=rev
Log:
expand to llmv IR
Modified:
llvm-gcc-4.2/trunk/gcc/config/alpha/llvm-alpha.cpp
Modified: llvm-gcc-4.2/trunk/gcc/config/alpha/llvm-alpha.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/alpha/llvm-alpha.cpp?rev=57244&r1=57243&r2=57244&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/alpha/llvm-alpha.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/config/alpha/llvm-alpha.cpp Tue Oct 7 09:41:03 2008
@@ -103,13 +103,13 @@
std::vector<Value*> &Ops) {
switch (FnCode) {
case ALPHA_BUILTIN_UMULH: {
- Function *f =
- Intrinsic::getDeclaration(TheModule, Intrinsic::alpha_umulh);
Value *Arg0 = Ops[0];
Value *Arg1 = Ops[1];
- Value *CallOps[2] = { Arg0, Arg1};
- Result = Builder.CreateCall(f, CallOps, CallOps+2, "tmp");
- Result = Builder.CreateBitCast(Result, ResultType, "tmp");
+ Arg0 = Builder.CreateZExt(Arg0, IntegerType::get(128));
+ Arg1 = Builder.CreateZExt(Arg1, IntegerType::get(128));
+ Result = Builder.CreateMul(Arg0, Arg1);
+ Result = Builder.CreateLShr(Result, ConstantInt::get(Type::Int64Ty, 64));
+ Result = Builder.CreateTrunc(Result, Type::Int64Ty);
return true;
}
default: break;
More information about the llvm-commits
mailing list