mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-06-30 02:05:18 +08:00
test/packetmath: Silence alignment warnings
This commit is contained in:
parent
c79b6ffe1f
commit
743c925286
@ -39,9 +39,12 @@ bits(const T& x) {
|
|||||||
// The following implement bitwise operations on floating point types
|
// The following implement bitwise operations on floating point types
|
||||||
template<typename T,typename Bits,typename Func>
|
template<typename T,typename Bits,typename Func>
|
||||||
T apply_bit_op(Bits a, Bits b, Func f) {
|
T apply_bit_op(Bits a, Bits b, Func f) {
|
||||||
Array<unsigned char,sizeof(T),1> res;
|
Array<unsigned char,sizeof(T),1> data;
|
||||||
for(Index i=0; i<res.size();++i) res[i] = f(a[i],b[i]);
|
T res;
|
||||||
return *reinterpret_cast<T*>(&res);
|
for(Index i = 0; i < data.size(); ++i)
|
||||||
|
data[i] = f(a[i], b[i]);
|
||||||
|
std::memcpy(&res, &data, sizeof(T));
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define EIGEN_TEST_MAKE_BITWISE2(OP,FUNC,T) \
|
#define EIGEN_TEST_MAKE_BITWISE2(OP,FUNC,T) \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user