Skip to content

Turn float comparisons into primitive operations (PR#9945) #148

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

Merged
merged 2 commits into from
Aug 10, 2021

Conversation

gretay-js
Copy link
Contributor

@gretay-js gretay-js changed the title port PR9945 Turn float comparisons into primitive operations (PR#9945) Aug 6, 2021
to transfer the argument to the fixed register. *)
let treg = Reg.create Float in
let _,is_swapped = float_cond_and_need_swap cond in
(if is_swapped then [| arg.(0); treg |] else [| treg; arg.(1) |])
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@smuenzel why do you swap the arguments here and then again in emit.mlp?

Copy link
Contributor

Choose a reason for hiding this comment

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

In selection, I'm not swapping the arguments, but i need to pick the correct argument position for the temporary, because cmpsd clobbers one of the inputs, and swapping affects which one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd rather just have an extra fixed register to clobber here for now and optimize the extra move separately, because there are a couple of other operations that have the same problem. It's not great that we are "lying to the compiler" about what the result registers are, but the change is correct as far as I can tell.

@gretay-js gretay-js merged commit 02f37d3 into ocaml-flambda:main Aug 10, 2021
mshinwell pushed a commit that referenced this pull request Aug 12, 2021
* add float comparison (ocaml#9945)

* Fix build after rebase

Co-authored-by: Stefan Muenzel <source@s.muenzel.net>
ccasin added a commit that referenced this pull request Mar 24, 2023
ea89813 Merge pull request #154 from ocaml-flambda/merge-flambda-backend
23cf5a5 Merge flambda-backend changes
b3af0c4 Unboxed types version 3 tests (#82)
1282d16 Functions with no clauses aren't local-returning (#149)
15d38c0 `make install` puts ocamlc at workspace root (#152)
b4928ee Remove -absname to improve build errors (#151)
f5b5e49 Remove `type_unpacks` (#150)
50d54db Remove arity-interrupting elaboration of module patterns (#146)
4382869 Remove the need to manually update the `tools/debug_printers` file (#148)
06a1d91 Add `promote-failed` targets to the Makefiles (#144)
d04eb58 Cleanup of comprehensions and immutable arrays (#127)
a45df79 Add a Module_strengthening extension (#142)
163c4b9 Add support for extensions in module types (#141)
74aa974 Some small patch-ups around matching on extensions (#140)
07127fe Remove raw_body from modular extensions setup (#137)
3f9bd64 Don't copy when resolving aliases in try_modtypes (#143)
aba6294 Immediacy rework (#122)
cf4eeef Add no-stack-allocation variant of some tests that print lambda (#133)
8f22438 Fully switch over Jane Street Merlin support to `.local-*` (#136)
5482a8d Remove `Lev_module_definition` from lambda (#135)
261e016 Change modular extensions to produce `AST_desc` types (#132)
0760c82 Disable module patterns in comprehensions (#131)
6acac80 Add Ctype global state debug printers (#130)
bc32037 Enable support for Jane Street's internal Merlin configuration (#64)
d1a8d03 Split out `Clflags.Extension` into a new file, `Language_extension` (#125)
435de6d Fix bootstrap and add legacy CI (#126)
7e5a626 Improve the API of language extensions to better support upstream compatibility (and also tooling) (#13)
c4e17b0 Replace var with local for faster mode checking (#53)
6d477d8 Merge pull request #124 from riaqn/merge-backend
d737533 minor fixes after merge
f1710d6 Merge flambda-backend changes
cc18534 Just run make boostrap (#123)

git-subtree-dir: ocaml
git-subtree-split: ea89813
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.

2 participants