Giter Club home page Giter Club logo

Comments (4)

danielschemmel avatar danielschemmel commented on July 24, 2024

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.

delcypher avatar delcypher commented on July 24, 2024

@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.

danielschemmel avatar danielschemmel commented on July 24, 2024

@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.

danielschemmel avatar danielschemmel commented on July 24, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.