mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 13:36:13 +03:00
AK: Add clamp(f32x4, float, float)
We are allowed to directly compare `f32x4` with a `float`, so make use of it.
This commit is contained in:
parent
7906ada015
commit
2c381ea45c
Notes:
sideshowbarker
2024-07-17 11:06:20 +09:00
Author: https://github.com/gmta Commit: https://github.com/SerenityOS/serenity/commit/2c381ea45c Pull-request: https://github.com/SerenityOS/serenity/pull/13970 Reviewed-by: https://github.com/alimpfard Reviewed-by: https://github.com/linusg Reviewed-by: https://github.com/sunverwerth ✅
@ -52,6 +52,11 @@ ALWAYS_INLINE static f32x4 clamp(f32x4 v, f32x4 min, f32x4 max)
|
||||
return v < min ? min : (v > max ? max : v);
|
||||
}
|
||||
|
||||
ALWAYS_INLINE static f32x4 clamp(f32x4 v, float min, float max)
|
||||
{
|
||||
return v < min ? min : (v > max ? max : v);
|
||||
}
|
||||
|
||||
ALWAYS_INLINE static f32x4 exp(f32x4 v)
|
||||
{
|
||||
// FIXME: This should be replaced with a vectorized algorithm instead of calling the scalar expf 4 times
|
||||
|
Loading…
Reference in New Issue
Block a user