[llvm-commits] [llvm-gcc-4.2] r56473 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
Duncan Sands
baldrick at free.fr
Tue Sep 23 00:55:32 PDT 2008
Hi Evan,
> - return Builder.CreateBinOp((Instruction::BinaryOps)Opc, LHS, RHS);
> + // If it's And, Or, or Xor, may sure the oeprands are casted to the right
may sure -> make sure
oeprands -> operands
casted -> cast
> + if (Ty == Type::FloatTy)
> + Ty = Type::Int32Ty;
> + else if (Ty == Type::DoubleTy)
> + Ty = Type::Int64Ty;
How about IntegerType::get(Ty->getPrimitiveSizeInBits())
instead of these? This also works with 128 bit floating
point, and 80 bit once legalize types is on :)
> + if (EltTy == Type::FloatTy)
> + Ty = VectorType::get(Type::Int32Ty, NumElements);
> + else if (EltTy == Type::DoubleTy)
> + Ty = VectorType::get(Type::Int64Ty, NumElements);
> + else
> + abort();
Likewise.
Ciao,
Duncan.
More information about the llvm-commits
mailing list