Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support lifting x87 80-bit float constants #393

Merged
merged 2 commits into from
Sep 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions lib/Lifters/ValueLifter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,13 @@ ValueLifterImpl::Lift(llvm::ArrayRef<uint8_t> data, llvm::Type *type,
return llvm::ConstantFP::get(type, val.bitsToDouble());
}

case llvm::Type::X86_FP80TyID: {
const auto size = static_cast<uint64_t>(dl.getTypeStoreSize(type));
auto val = ConsumeBytesAsInt(data, size);
const llvm::APFloat float_val(llvm::APFloat::x87DoubleExtended(), val);
return llvm::ConstantFP::get(type, float_val);
}

default:
LOG(FATAL) << "Cannot initialize constant of unhandled LLVM type "
<< remill::LLVMThingToString(type) << " at " << std::hex
Expand Down
Loading