Proposal: add hooks for floating point comparisons #3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Verificarlo is preparing to move fully towards the interflop interface (verificarlo/verificarlo#93).
In this context we would like to instrument floating point comparisons (fcmp).
This is a proposal to add two hooks to
interflop.h
with the following conventions,The enumeration
FCMP_PREDICATE
contains the 16 floating point operators supported by LLVM. We think it is better to have only two hooks predicated with the enum, instead of 32 individual hooks (16 for float and 16 for double).Since we are mainly using the LLVM frontend, this is very practical for us. But we are flexible if another representation is more general or practical.
In this PR, I have only modified
interflop.h
to start the discussion. If this proposal is accepted, we should update the existing backends and the C++ interface before merging.