Home » Developing U++ » U++ Developers corner » SSE2(/AVX) and alignment issues
Re: SSE2(/AVX) and alignment issues [message #30968 is a reply to message #30962] |
Sun, 30 January 2011 16:52 |
|
Looking in boost code:
class X{
public:
explicit X(int n): n_(n){
}
void * operator new(std::size_t){
return std::allocator<X>().allocate(1, static_cast<X*>(0));
}
void operator delete(void * p){
std::allocator<X>().deallocate(static_cast<X*>(p), 1);
}
private:
X(X const &);
X & operator=(X const &);
int n_;
};
or
class Y{
public:
explicit Y(int n): n_(n){
}
void * operator new(std::size_t n){
return boost::detail::quick_allocator<Y>::alloc(n);
}
void operator delete(void * p, std::size_t n){
boost::detail::quick_allocator<Y>::dealloc(p, n);
}
private:
Y(Y const &);
Y & operator=(Y const &);
int n_;
};
where something in the memory alocator we can get alignmet of type by:
for Codegear: alignof(T)
for GCC: __alignof__(T)
for MSC: __alignof(T)
according by IBM link and boost source code.
According by boost source code in file intrinsics.hpp MSC __alignof(T) fails when used with /Zp property. We need to be care of.
In this case we can easily use sse2/3/4/...:
Is possible to implement a tool that can be integrated in the "operator new" of the classes with sse2/3/4 types properties?
Sorry, if it is a stupid question. I have not experience with sse, but i'me very interested to speed up the program by using sse/2/3/4.
|
|
|
|
|
SSE2(/AVX) and alignment issues
By: mirek on Fri, 28 January 2011 10:55
|
|
|
Re: SSE2(/AVX) and alignment issues
By: tojocky on Fri, 28 January 2011 13:48
|
|
|
Re: SSE2(/AVX) and alignment issues
|
|
|
Re: SSE2(/AVX) and alignment issues
By: Didier on Fri, 28 January 2011 18:43
|
|
|
Re: SSE2(/AVX) and alignment issues
By: mirek on Sat, 29 January 2011 00:05
|
|
|
Re: SSE2(/AVX) and alignment issues
By: mirek on Fri, 28 January 2011 23:59
|
|
|
Re: SSE2(/AVX) and alignment issues
By: Novo on Fri, 28 January 2011 21:53
|
|
|
Re: SSE2(/AVX) and alignment issues
By: mirek on Sat, 29 January 2011 00:03
|
|
|
Re: SSE2(/AVX) and alignment issues
By: Novo on Sat, 29 January 2011 02:07
|
|
|
Re: SSE2(/AVX) and alignment issues
By: tojocky on Sat, 29 January 2011 09:23
|
|
|
Re: SSE2(/AVX) and alignment issues
By: mirek on Sat, 29 January 2011 20:29
|
|
|
Re: SSE2(/AVX) and alignment issues
By: tojocky on Sun, 30 January 2011 11:34
|
|
|
Re: SSE2(/AVX) and alignment issues
By: mirek on Sun, 30 January 2011 11:51
|
|
|
Re: SSE2(/AVX) and alignment issues
By: tojocky on Sun, 30 January 2011 16:52
|
|
|
Re: SSE2(/AVX) and alignment issues
By: mirek on Sun, 30 January 2011 18:24
|
|
|
Re: SSE2(/AVX) and alignment issues
By: Novo on Sun, 30 January 2011 19:35
|
|
|
Re: SSE2(/AVX) and alignment issues
By: mirek on Sun, 30 January 2011 20:08
|
|
|
Re: SSE2(/AVX) and alignment issues
By: Novo on Sun, 30 January 2011 20:50
|
|
|
Re: SSE2(/AVX) and alignment issues
|
|
|
Re: SSE2(/AVX) and alignment issues
By: tojocky on Sun, 30 January 2011 22:03
|
Goto Forum:
Current Time: Thu Jun 13 05:59:43 CEST 2024
Total time taken to generate the page: 0.01745 seconds
|