1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 12:12:47 +01:00

Add support for assembly printing fp constants

llvm-svn: 191
This commit is contained in:
Chris Lattner 2001-07-15 00:18:39 +00:00
parent 964af23ab4
commit 444b28658f
2 changed files with 5 additions and 4 deletions

View File

@ -296,8 +296,7 @@ string ConstPoolUInt::getStrValue() const {
} }
string ConstPoolFP::getStrValue() const { string ConstPoolFP::getStrValue() const {
assert(0 && "FP Constants Not implemented yet!!!!!!!!!!!"); return ftostr(Val);
return "% FP Constants NI!" /* + dtostr(Val)*/;
} }
string ConstPoolType::getStrValue() const { string ConstPoolType::getStrValue() const {
@ -429,8 +428,8 @@ bool ConstPoolFP::isValueValidForType(const Type *Ty, double Val) {
return false; // These can't be represented as floating point! return false; // These can't be represented as floating point!
// TODO: Figure out how to test if a double can be cast to a float! // TODO: Figure out how to test if a double can be cast to a float!
/*
case Type::FloatTyID: case Type::FloatTyID:
/*
return (Val <= UINT8_MAX); return (Val <= UINT8_MAX);
*/ */
case Type::DoubleTyID: case Type::DoubleTyID:

View File

@ -86,7 +86,9 @@ StoreInst::StoreInst(Value *Val, Value *Ptr, const vector<ConstPoolVal*> &Idx,
GetElementPtrInst::GetElementPtrInst(Value *Ptr, GetElementPtrInst::GetElementPtrInst(Value *Ptr,
const vector<ConstPoolVal*> &Idx, const vector<ConstPoolVal*> &Idx,
const string &Name = "") const string &Name = "")
: MemAccessInst(PointerType::getPointerType(getIndexedType(Ptr->getType(), Idx, true)), GetElementPtr, Name) { : MemAccessInst(PointerType::getPointerType(getIndexedType(Ptr->getType(),
Idx, true)),
GetElementPtr, Name) {
assert(getIndexedType(Ptr->getType(), Idx, true) && "gep operands invalid!"); assert(getIndexedType(Ptr->getType(), Idx, true) && "gep operands invalid!");
Operands.reserve(1+Idx.size()); Operands.reserve(1+Idx.size());
Operands.push_back(Use(Ptr, this)); Operands.push_back(Use(Ptr, this));