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).
This ensures that the translation of Copilot
signum
expressions results in Bluespec code that is semantically equivalent. In particular, it ensures thatsignum e
behaves correctly whene
is zero, negative zero, orNaN
(ife
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-L272Fixes #14.