DataFormats
Math
interface
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(__CLING__) || defined(__MIC__) || defined(__NVCC__)) || (__BIGGEST_ALIGNMENT__ < 16)
5
#elif defined(__GNUC__) || defined(__clang__) || defined(__INTEL_COMPILER)
6
#if defined(__x86_64__) && defined(__SSE__)
7
#define USE_SSEVECT
8
#else
9
#define USE_EXTVECT
10
#endif
11
#endif
12
13
// to be moved elsewhere
14
namespace
mathSSE
{
15
//
16
template
<
typename
T>
17
inline
bool
samesign
(
T
rh,
T
lh
);
18
19
template
<>
20
inline
bool
__attribute__
((always_inline))
__attribute__
((pure))
samesign<int>
(
int
rh,
int
lh
) {
21
int
const
mask = 0x80000000;
22
return
((rh ^
lh
) & mask) == 0;
23
}
24
25
template
<>
26
inline
bool
__attribute__
((always_inline))
__attribute__
((pure))
samesign<long long>
(
long
long
rh,
long
long
lh
) {
27
long
long
const
mask = 0x8000000000000000
LL
;
28
return
((rh ^
lh
) & mask) == 0;
29
}
30
31
template
<>
32
inline
bool
__attribute__
((always_inline))
__attribute__
((pure)) samesign<float>(
float
rh,
float
lh
) {
33
union
{
34
int
i
;
35
float
f
;
36
}
a
,
b
;
37
a
.f = rh;
38
b
.f =
lh
;
39
return
samesign<int>
(
a
.i,
b
.i);
40
}
41
42
template
<>
43
inline
bool
__attribute__
((always_inline))
__attribute__
((pure)) samesign<double>(
double
rh,
double
lh
) {
44
union
{
45
long
long
i
;
46
double
f
;
47
}
a
,
b
;
48
a
.f = rh;
49
b
.f =
lh
;
50
return
samesign<long long>
(
a
.i,
b
.i);
51
}
52
}
// namespace mathSSE
53
54
#if defined(USE_EXTVECT)
55
#include "
DataFormats/Math/interface/ExtVec.h
"
56
#elif defined(USE_SSEVECT)
57
#include "
DataFormats/Math/interface/SSEVec.h
"
58
#include "
DataFormats/Math/interface/SSERot.h
"
59
#endif
60
61
#endif //
mps_fire.i
i
Definition:
mps_fire.py:428
SSEVec.h
mathSSE::lh
bool int lh
Definition:
SIMDVec.h:20
ExtVec.h
mathSSE::__attribute__
struct mathSSE::Rot3 __attribute__
b
double b
Definition:
hdecay.h:118
mathSSE::samesign< int >
return samesign< int >(a.i, b.i)
a
double a
Definition:
hdecay.h:119
mathSSE
Definition:
AVXVec.h:6
L1DTConfigBti_cff.LL
LL
Definition:
L1DTConfigBti_cff.py:25
mathSSE::samesign< long long >
return samesign< long long >(a.i, b.i)
mathSSE::samesign
bool samesign(T rh, T lh)
T
long double T
Definition:
Basic3DVectorLD.h:48
mathSSE::f
a f
Definition:
SIMDVec.h:37
SSERot.h
Generated for CMSSW Reference Manual by
1.8.16