CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SIMDVec.h
Go to the documentation of this file.
1 #ifndef DataFormat_Math_SIMDVec_H
2 #define DataFormat_Math_SIMDVec_H
3 
4 #if ( defined(IN_DICTBUILD) || defined(__REFLEX__) || defined(__CINT__) ) || (__BIGGEST_ALIGNMENT__<16)
5 #elif (defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ > 7)) || defined(__clang__)
6 #define USE_EXTVECT
7 #elif (defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ > 4))
8 #define USE_SSEVECT
9 #endif
10 
11 
12 // to be moved elsewhere
13 namespace mathSSE {
14  //
15  template<typename T> inline bool samesign(T rh, T lh);
16 
17  template<>
18  inline bool
19  __attribute__((always_inline)) __attribute__ ((pure)) samesign<int>(int rh, int lh) {
20  int const mask= 0x80000000;
21  return ((rh^lh)&mask) == 0;
22  }
23 
24  template<>
25  inline bool
26  __attribute__((always_inline)) __attribute__ ((pure)) samesign<long long>(long long rh, long long lh) {
27  long long const mask= 0x8000000000000000LL;
28  return ((rh^lh)&mask) == 0;
29  }
30 
31  template<>
32  inline bool
33  __attribute__((always_inline)) __attribute__ ((pure)) samesign<float>(float rh, float lh) {
34  union { int i; float f; } a, b;
35  a.f=rh; b.f=lh;
36  return samesign<int>(a.i,b.i);
37  }
38 
39  template<>
40  inline bool
41  __attribute__((always_inline)) __attribute__ ((pure)) samesign<double>(double rh, double lh) {
42  union { long long i; double f; } a, b;
43  a.f=rh; b.f=lh;
44  return samesign<long long>(a.i,b.i);
45  }
46 }
47 
48 
49 
50 #if defined(USE_EXTVECT)
52 #elif defined(USE_SSEVECT)
55 #endif
56 
57 #endif //
int i
Definition: DBlmapReader.cc:9
bool int lh
Definition: SIMDVec.h:19
struct mathSSE::Rot3 __attribute__
return samesign< long long >(a.i, b.i)
return samesign< int >(a.i, b.i)
double b
Definition: hdecay.h:120
a f
Definition: SIMDVec.h:35
bool samesign(T rh, T lh)
double a
Definition: hdecay.h:121
long double T