New user self-registration is disabled due to spam. Please email eigen-core-team @ if you need an account.
Before reporting a bug, please make sure that your Eigen version is up-to-date!
Bug 976 - Code duplication in Core/arch/*/MathFunctions.h
Summary: Code duplication in Core/arch/*/MathFunctions.h
Alias: None
Product: Eigen
Classification: Unclassified
Component: Core - vectorization (show other bugs)
Version: 3.3 (current stable)
Hardware: All All
: Normal Internal Design
Assignee: Nobody
Depends on: 692
  Show dependency treegraph
Reported: 2015-03-03 18:16 UTC by Christoph Hertzberg
Modified: 2015-03-03 18:16 UTC (History)
4 users (show)


Description Christoph Hertzberg 2015-03-03 18:16:34 UTC
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.

Note You need to log in before you can comment on or make changes to this bug.