llvm / llvm/circt

Support of IEEE single and double precision floating point operations

Open
#2,667 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
2.2k
Forks
524
Avg merge
3d 2h
Merged PRs (30d)
46

Description

Hello everyone,

I just want to confirm the status of supporting IEEE single and double precision floating point operations in CIRCT and if it is on the roadmap.

I was playing around with the handshake integration test and changed the data type to f64 (see attached) and I am getting the following errors:

matmul_std_lin_float.mlir:3:17: error: unsupported data type ''f64''
    %c123_f64 = arith.constant 123.0 : f64
                ^
matmul_std_lin_float.mlir:3:17: error: unsupported data type ''f64''
    %c123_f64 = arith.constant 123.0 : f64
                ^
matmul_std_lin_float.mlir:3:17: error: only memrefs of signless ints are supported
    %c123_f64 = arith.constant 123.0 : f64
                ^
matmul_std_lin_float.mlir:3:17: note: see current operation: %2:4 = "handshake.memory"(%164, %163, %456, %455, %470) {id = 2 : i32, ldCount = 1 : i32, lsq = false, memRefType = memref<64xf64>, stCount = 2 : i32} : (f64, index, f64, index, index) -> (f64, none, none, none)
matmul_std_lin_float.mlir:3:17: error: unsupported operation type
    %c123_f64 = arith.constant 123.0 : f64
                ^
matmul_std_lin_float.mlir:3:17: note: see current operation: %2:4 = "handshake.memory"(%164, %163, %456, %455, %470) {id = 2 : i32, ldCount = 1 : i32, lsq = false, memRefType = memref<64xf64>, stCount = 2 : i32} : (f64, index, f64, index, index) -> (f64, none, none, none)
matmul_std_lin_float.mlir:2:3: error: failed to legalize operation 'handshake.func' that was explicitly marked illegal
  func @top() -> f64 {
  ^
matmul_std_lin_float.mlir:2:3: note: see current operation: "handshake.func"() ({
^bb0(%arg0: none):
}) {argNames = ["inCtrl"], resNames = ["out0", "outCtrl"], sym_name = "top", type = (none) -> (f64, none)} : () -> ()
matmul_std_lin_float.mlir:2:3: error: 'handshake.func' op error during conversion
  func @top() -> f64 {
  ^
matmul_std_lin_float.mlir:2:3: note: see current operation: "handshake.func"() ({
^bb0(%arg0: none):
}) {argNames = ["inCtrl"], resNames = ["out0", "outCtrl"], sym_name = "top", type = (none) -> (f64, none)} : () -> ()

Of course I could just have a syntax error or not be using the arith.constant operator correctly so any feedback would be greatly appreciated.

Best regards,
Juan

matmul_std_lin_float.txt

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the handshake integration test and the attached matmul_std_lin_float.mlir input, then trace the reported f64 failures through handshake legalization. Review the current handling of arith.constant, floating-point values, and handshake.memory; done means the issue’s IEEE single- and double-precision example is accepted without the reported unsupported-type and legalization errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.