Code duplication in Core/arch/*/MathFunctions.h
@chhtz
Submitted by Christoph HertzbergAssigned to Nobody
Link to original bugzilla bug (#976)
Version: 3.3 (current stable)
Description
There is a lot of code duplication in the vectorized MathFunctions.
Partially, functions are identical except for different variable types and method names, partially functions have slight differences.
Partially, some functions are implemented for some platforms but not for others (AltiVec has no MathFunctions at all).
This is also the case for the unsupported MoreVectorization module (only one function and only for SSE at the moment).
With meta-packets all implementations can be joined into a single generic implementation, which increases maintainability a lot and avoids having to fix possible issues for multiple platforms.
Important for this is that all low-level function calls are replaces by the corresponding p* functions from arch//PacketMath.h
We probably need to introduce further p functions for that which can be optimized for different architectures.
If this works, we probably don't even need the {HasSin, HasCos, HasLog, ...}-flags in packet_traits anymore.