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

[SCFToCalyx] buildLibraryOp cast floating point to integer types #7977

Merged
merged 3 commits into from
Dec 13, 2024

Conversation

jiahanxie353
Copy link
Contributor

In buildLibraryOp, we cast floating point types to integer types with the same width, as discussed here: #7762

The testing case is just the result of running the -arith-expand pass on the following input:

module {
  func.func @main(%b: f64, %c: f64) -> f64 {
    %a = arith.maximumf %b, %c : f64
    return %a : f64
  }
}

Copy link
Member

@cgyurgyik cgyurgyik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some small nits :)

lib/Conversion/SCFToCalyx/SCFToCalyx.cpp Outdated Show resolved Hide resolved
lib/Conversion/SCFToCalyx/SCFToCalyx.cpp Outdated Show resolved Hide resolved
lib/Conversion/SCFToCalyx/SCFToCalyx.cpp Outdated Show resolved Hide resolved
…ype; enable build return arguments with signed integer type by making convIndexType to a more generic normalize type function
@jiahanxie353
Copy link
Contributor Author

Thanks @cgyurgyik !

Made some changes based on your feedback; also changed convIndex to a more generic function by utilizing the toBitVector function.

Copy link
Member

@cgyurgyik cgyurgyik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks!

include/circt/Dialect/Calyx/CalyxLoweringUtils.h Outdated Show resolved Hide resolved
Co-authored-by: Chris Gyurgyik <[email protected]>
@jiahanxie353 jiahanxie353 merged commit 5ef9ea9 into llvm:main Dec 13, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Calyx The Calyx dialect
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants