Skip to content

Conversation

@tkann-galois
Copy link
Collaborator

Fixes #696

The previous usage of constFp in Copilot-Bluespec did not correctly translate special double-width floating point values. This PR implements a fix and a proof-of-concept example.
The example does not compile before the fix but does compile after the patch, giving the expected bit-representations of the floating point values.

Interestingly this issue was not caught before during testing because the test suite uses a different method for deriving the Bluespec versions of floating point values that was not used in the public-facing reification. For that reason I provide the example directory that demonstrates the error (because a test would not work).

…special floating point values in a suite that does not compile before the fix for 696
…nstFp to preserve special Double values

Const fp previously only checked if a number was negative or not but failed to create valid bluespec values on special Doubles (inf, -inf, sNaN, qNaN, -0.0).
This was previously not captured in tests since the testing aparatus has a special-Double-friendly way of making bluespec values for testing.
This fix can be seen in the now-compiling version of examples/special_doubles
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

copilot-bluespec: Special floating-point values are translated to syntactically invalid Bluespec code

1 participant