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

Feature idea/request: clamp and signum #131

Open
torokati44 opened this issue Apr 9, 2023 · 2 comments
Open

Feature idea/request: clamp and signum #131

torokati44 opened this issue Apr 9, 2023 · 2 comments

Comments

@torokati44
Copy link
Contributor

torokati44 commented Apr 9, 2023

They came up in an algorithm I'm considering for SIMDification (ruffle-rs/h263-rs#49), and perhaps they would came in handy for others as well - they are in f32 at least, after all...
I have zero clue though, whether there are intrinsics for these in any platforms... (At least clamp can be done with min and max of course. EDIT: Come to think of it, signum is also just (x > 0) - (x < 0).)

@Lokathor
Copy link
Owner

Lokathor commented Apr 10, 2023

These should be pretty easy to add! I'd be happy to merge a PR if you did one.

As you say, they don't need to be specific intrinsics (though that would help), just making them from smaller parts that already exist should work.

@torokati44
Copy link
Contributor Author

Unfortunately I don't think I have the capacity for a proper PR about this, sorry. :/
I'll leave the issue open in case someone picks it up later.

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