calyxir/calyx

Floating-point constants

Opened this issue · 3 comments

@jiahanxie353 has proposed adding floating-point constants to the CIRCT frontend in llvm/circt#7086. I think this is particularly interesting because we'd have to figure out how to represent these constants in Calyx. Verilog itself (AFAIK) does not support IEEE-754 constants and so we'd have to generate the right bit-patterns.

One possible approach is adding this capability to calyx-frontend but the IR only ever sees bit-patterns for the numbers. In this case from_ast becomes responsible for transforming a floating-point constant string into the correct bit-pattern.

These two commits:

Thanks @jiahanxie353! Can you open a PR for these two commits so we can start the review?

Sure, just created it!