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

[Q] Int, Double and Float comparisons? #17

Open
ocramz opened this issue Jan 12, 2019 · 5 comments
Open

[Q] Int, Double and Float comparisons? #17

ocramz opened this issue Jan 12, 2019 · 5 comments

Comments

@ocramz
Copy link

ocramz commented Jan 12, 2019

Are there comparison operations for integer and floating point types, or how could they be implemented? Thanks!

@newhoggy
Copy link
Member

These can be implemented 😁

@newhoggy
Copy link
Member

For Int, it's isomorphic to Word64 on ghc on x64, so unsafe casting between those types will get you the comparison for Int.

@newhoggy
Copy link
Member

newhoggy commented Jan 13, 2019

@ocramz
Copy link
Author

ocramz commented Jan 13, 2019

Thank you for the link! I don't know which bindings might be needed yet, but some people say leveraging this should give us faster sorting code thanvector-algorithms. I would like to know more about this, could you briefly explain how are new instructions added ?

@newhoggy
Copy link
Member

Unfortunately GHC doesn't support SIMD (yet).

There is ongoing work to improve SIMD support in GHC:

https://gist.github.com/Abhiroop/9a2600f24f8139b7fc0742a2b4585bb3

The work around (which is what this library does) is to write the relevant functions in C and then writing FFI wrappers to call the C functions.

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

No branches or pull requests

2 participants