Skip to content
Closed
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion ir/type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "ir/state.h"
#include "smt/solver.h"
#include "util/compiler.h"
#include "util/config.h"
#include <array>
#include <cassert>
#include <numeric>
Expand Down Expand Up @@ -450,7 +451,7 @@ expr FloatType::fromFloat(State &s, const expr &fp, const Type &from_type0,
expr isnan = fp.isNaN();
expr val = fp.float2BV();

if (isnan.isFalse())
if (config::use_exact_fp || isnan.isFalse())
return val;

unsigned fraction_bits = fractionBits();
Expand Down
1 change: 1 addition & 0 deletions util/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ bool skip_smt = false;
string smt_benchmark_dir;
bool disable_poison_input = false;
bool disable_undef_input = false;
bool use_exact_fp = false;
bool tgt_is_asm = false;
bool fail_if_src_is_ub = false;
bool disallow_ub_exploitation = false;
Expand Down
2 changes: 2 additions & 0 deletions util/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ extern bool disable_poison_input;

extern bool disable_undef_input;

extern bool use_exact_fp;

extern bool tgt_is_asm;

extern bool fail_if_src_is_ub;
Expand Down
Loading