mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 21:27:34 +00: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
1 changed files with 5 additions and 0 deletions
|
@ -52,6 +52,11 @@ ALWAYS_INLINE static f32x4 clamp(f32x4 v, f32x4 min, f32x4 max)
|
||||||
return v < min ? min : (v > max ? max : v);
|
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)
|
ALWAYS_INLINE static f32x4 exp(f32x4 v)
|
||||||
{
|
{
|
||||||
// FIXME: This should be replaced with a vectorized algorithm instead of calling the scalar expf 4 times
|
// FIXME: This should be replaced with a vectorized algorithm instead of calling the scalar expf 4 times
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue