mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
SIMDRegister abs operation implemented
This commit is contained in:
parent
56302416df
commit
c3a8ea1ab6
2 changed files with 48 additions and 1 deletions
|
|
@ -328,6 +328,13 @@ struct SIMDRegister
|
|||
/** Returns a scalar which is the sum of all elements of the receiver. */
|
||||
inline ElementType sum() const noexcept { return CmplxOps::sum (value); }
|
||||
|
||||
//==============================================================================
|
||||
/** Returns the absolute value of each element. */
|
||||
static inline SIMDRegister JUCE_VECTOR_CALLTYPE abs (SIMDRegister a) noexcept
|
||||
{
|
||||
return a - (a * (expand (ElementType (2)) & lessThan (a, expand (ElementType (0)))));
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
/** Checks if the given pointer is suffeciently aligned for using SIMD operations. */
|
||||
static inline bool isSIMDAligned (const ElementType* ptr) noexcept
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue