[llvm-commits] [llvm-gcc-4.2] r57227 - in /llvm-gcc-4.2/trunk/gcc: config.gcc config/alpha/alpha.h config/alpha/llvm-alpha.cpp

Chris Lattner clattner at apple.com
Mon Oct 6 21:05:37 PDT 2008


On Oct 6, 2008, at 7:11 PM, Andrew Lenharth wrote:

> Author: alenhar2
> Date: Mon Oct  6 21:11:11 2008
> New Revision: 57227
>
> URL: http://llvm.org/viewvc/llvm-project?rev=57227&view=rev
> Log:
> Get alpha closer to building libgcc2

Ok

+bool TreeToLLVM::TargetIntrinsicLower(tree exp,
> +                                      unsigned FnCode,
> +                                      const MemRef *DestLoc,
> +                                      Value *&Result,
> +                                      const Type *ResultType,
> +                                      std::vector<Value*> &Ops) {

If you make an llvm intrinsic that maps 1-1 with a GCC builtin, you  
generally don't have to do lowering like this.

This would be a great place to lower it to llvm ir though :)

-Chris

>
> +  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");
> +    return true;
> +  }
> +  default: break;
> +  }
> +
> +  return false;
> +}
> +
> +/* LLVM LOCAL end (ENTIRE FILE!)  */
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list