Skip to content

Encode floating point operations as uninterpreted functions#1095

Open
can-leh-emmtrix wants to merge 7 commits into
AliveToolkit:masterfrom
emmtrix:uf-float-2
Open

Encode floating point operations as uninterpreted functions#1095
can-leh-emmtrix wants to merge 7 commits into
AliveToolkit:masterfrom
emmtrix:uf-float-2

Conversation

@can-leh-emmtrix
Copy link
Copy Markdown
Contributor

@can-leh-emmtrix can-leh-emmtrix commented Oct 9, 2024

Approach based on modifying expr.cpp. Please let me know what you think.

Previous PR: #1057

@nunoplopes
Copy link
Copy Markdown
Member

(not forgotten, but review delayed for a few weeks, sorry. PLDI deadline approaching)

Comment thread ir/state.cpp
Comment on lines +260 to +261
if (get_uf_float())
doesApproximation("uf-float");
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I am not sure what the best way to handle doesApproximation is with this approach. One option would be to call it in fm_poison in instr.cpp, however we don't have direct access to the UFs anymore. From what I can tell from the source code, the second argument to doesApproximation needs to be the APP node of the UF. However we do not have access to that anymore at this point. It may be possible to obtain the UFs by traversing the AST though. Another option might be to register a callback function with expr.h which is called for each created UF.

@can-leh-emmtrix
Copy link
Copy Markdown
Contributor Author

Thanks for letting me know and no worries about the delay.

@tnuha
Copy link
Copy Markdown
Contributor

tnuha commented Apr 23, 2026

@can-leh-emmtrix I have a local branch that catches these changes up to 28bb8c6, but wanted to run it by you before I push anything to your branch in case you have other work on your end that hasn't been broadcast yet.

Certainly #1095 (comment) still hasn't been resolved, but these changes overall seem pretty reasonable to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants