diff options
Diffstat (limited to 'lib/Expr/Expr.cpp')
-rw-r--r-- | lib/Expr/Expr.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/Expr/Expr.cpp b/lib/Expr/Expr.cpp index 386d29de..703c689f 100644 --- a/lib/Expr/Expr.cpp +++ b/lib/Expr/Expr.cpp @@ -274,6 +274,7 @@ void Expr::printWidth(std::ostream &os, Width width) { case Expr::Int16: os << "Expr::Int16"; break; case Expr::Int32: os << "Expr::Int32"; break; case Expr::Int64: os << "Expr::Int64"; break; + case Expr::Fl80: os << "Expr::Fl80"; break; default: os << "<invalid type: " << (unsigned) width << ">"; } } @@ -305,7 +306,11 @@ ref<Expr> ConstantExpr::fromMemory(void *address, Width width) { case Expr::Int16: return ConstantExpr::create(*((uint16_t*) address), width); case Expr::Int32: return ConstantExpr::create(*((uint32_t*) address), width); case Expr::Int64: return ConstantExpr::create(*((uint64_t*) address), width); - // FIXME: Should support long double, at least. + // FIXME: what about machines without x87 support? + case Expr::Fl80: + return ConstantExpr::alloc(llvm::APInt(width, + (width+llvm::integerPartWidth-1)/llvm::integerPartWidth, + (const uint64_t*)address)); } } @@ -317,7 +322,10 @@ void ConstantExpr::toMemory(void *address) { case Expr::Int16: *((uint16_t*) address) = getZExtValue(16); break; case Expr::Int32: *((uint32_t*) address) = getZExtValue(32); break; case Expr::Int64: *((uint64_t*) address) = getZExtValue(64); break; - // FIXME: Should support long double, at least. + // FIXME: what about machines without x87 support? + case Expr::Fl80: + *((long double*) address) = *(long double*) value.getRawData(); + break; } } |