Comments (4)
Compilers may not optimize this scenario, as the result of f == f
is not known at compile time (passing a pointer to the object that f
refers to to an unknown function -- klee_make_symbolic
-- changes the status of that value from "undefined" to "unknown", as the definition of klee_make_symbolic
cannot be known to the compiler).
The case you are referring to, explicitly allows the compiler to ignore floating point rules to generate faster code. Allowing the compiler to make invalid assumptions, has the obvious drawback, that the compiler may generate invalid assumptions ;)
from fp-benchmarks-aachen.
@danielschemmel Sure what you mention above is all true but why not just use isnan()
? It's a lot clearer and would do the right thing even if -ffast-math
is being used.
from fp-benchmarks-aachen.
@delcypher There are a few reasons against using isnan
:
isnan
is guaranteed to be a macro, one legal implementation of which is self comparison- its implementation may actually be problematic for
klee_assume
- We want to discourage simply recognizing the usage of a function, and instead promote relying on floating point semantics (in our tools at least)
I am aware that this is not a problem for either uclibc nor glibc, which use basically the same implementation that uses a type generic macro falling down to a builtin, and your argument for clarity does have its own merit. Personally, however I prefer a solution that is known to be correct w.r.t. any valid C compiler and library.
from fp-benchmarks-aachen.
Having discussed this in the conference call, our decision was to assume -ffast-math
is disabled and floating point behavior is correct.
from fp-benchmarks-aachen.
Related Issues (9)
- gmp_klee_inv_arg.x86_64 crashes KLEE by calling `raise()` HOT 1
- The specification for `real/sorting_doubles` is incorrect. HOT 4
- Mistakes in `aachen/syn/sqr/spec.yml` HOT 4
- Ninja & GMP HOT 2
- `ld-unnormal_default.x86_64` is mis-compiled by Clang when optimizations are enabled HOT 1
- `ld-unnormal` requires more investigation HOT 4
- syn/atof_default.x86_64 is incorrect despite the spec saying it should be correct HOT 2
- sqr_ family of benchmarks incorrect HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fp-benchmarks-aachen.