Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix signum translation. Refs #14. #17

Merged
merged 3 commits into from
Jul 11, 2024
Merged

Conversation

RyanGlScott
Copy link
Collaborator

@RyanGlScott RyanGlScott commented Jul 11, 2024

This ensures that the translation of Copilot signum expressions results in Bluespec code that is semantically equivalent. In particular, it ensures that signum e behaves correctly when e is zero, negative zero, or NaN (if e is a floating-point type).

The new translation is heavily inspired by the existing approach in copilot-c99: https://github.com/Copilot-Language/copilot/blob/6034e6d4d95464397ba81e346f40f71213c0ffbd/copilot-c99/src/Copilot/Compile/C99/Expr.hs#L233-L272

Fixes #14.

RyanGlScott and others added 3 commits July 11, 2024 08:33
This ensures that the translation of Copilot `signum` expressions results in
Bluespec code that is semantically equivalent. In particular, it ensures that
`signum e` behaves correctly when `e` is zero, negative zero, or `NaN` (if `e`
is a floating-point type).

The new translation is heavily inspired by the existing approach in
`copilot-c99`:
https://github.com/Copilot-Language/copilot/blob/6034e6d4d95464397ba81e346f40f71213c0ffbd/copilot-c99/src/Copilot/Compile/C99/Expr.hs#L233-L272
@RyanGlScott RyanGlScott merged commit 761b4fb into master Jul 11, 2024
3 checks passed
@RyanGlScott RyanGlScott deleted the T14-fix-signum-translation branch July 11, 2024 12:50
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.

Incorrect signum translation
1 participant