42 #ifdef OGDF_FME_KERNEL_USE_SSE
59 inline ComplexDouble(
float x,
float y) {
reg = _mm_cvtps_pd(_mm_setr_ps((x), (y), 0, 0)); }
81 __m128d b_t = _mm_shuffle_pd(other.
reg, other.
reg, _MM_SHUFFLE2(0, 1));
83 __m128d left = _mm_mul_pd(
reg, other.
reg);
85 __m128d right = _mm_mul_pd(
reg, b_t);
87 left = _mm_mul_pd(left, _mm_setr_pd(1.0, -1.0));
95 __m128d conj_reg = _mm_mul_pd(other.
reg, _mm_setr_pd(1.0, -1.0));
97 __m128d b_t = _mm_shuffle_pd(conj_reg, conj_reg, _MM_SHUFFLE2(0, 1));
99 __m128d left = _mm_mul_pd(
reg, conj_reg);
101 __m128d right = _mm_mul_pd(
reg, b_t);
103 left = _mm_mul_pd(left, _mm_setr_pd(1.0, -1.0));
105 __m128d product = _mm_hadd_pd(left, right);
108 __m128d ell = _mm_mul_pd(conj_reg, conj_reg);
110 ell = _mm_hadd_pd(ell, ell);
125 return ComplexDouble(_mm_mul_pd(
reg, _mm_setr_pd((
double)scalar, (
double)scalar)));
134 __m128d b_t = _mm_shuffle_pd(other.
reg, other.
reg, _MM_SHUFFLE2(0, 1));
136 __m128d left = _mm_mul_pd(
reg, other.
reg);
138 __m128d right = _mm_mul_pd(
reg, b_t);
140 left = _mm_mul_pd(left, _mm_setr_pd(1.0, -1.0));
142 reg = _mm_hadd_pd(left, right);
147 reg = _mm_mul_pd(
reg, _mm_setr_pd(scalar, scalar));
153 __m128d conj_reg = _mm_mul_pd(other.
reg, _mm_setr_pd(1.0, -1.0));
155 __m128d b_t = _mm_shuffle_pd(conj_reg, conj_reg, _MM_SHUFFLE2(0, 1));
157 __m128d left = _mm_mul_pd(
reg, conj_reg);
159 __m128d right = _mm_mul_pd(
reg, b_t);
161 left = _mm_mul_pd(left, _mm_setr_pd(1.0, -1.0));
163 __m128d product = _mm_hadd_pd(left, right);
165 __m128d ell = _mm_mul_pd(conj_reg, conj_reg);
167 ell = _mm_hadd_pd(ell, ell);
169 reg = _mm_div_pd(product, ell);
176 inline double length()
const {
179 __m128d
r = _mm_mul_pd(
reg,
reg);
180 r = _mm_hadd_pd(
r, _mm_setzero_pd());
181 r = _mm_sqrt_sd(
r,
r);
182 _mm_store_sd(&res,
r);
198 inline void operator=(
double* ptr) {
reg = _mm_load_pd(ptr); }
205 inline void load(
const double* ptr) {
reg = _mm_load_pd(ptr); }
211 inline void store(
double* ptr)
const { _mm_store_pd(ptr,
reg); }
267 return (*
this) * other.
conj() / (other.
reg[0] * other.
reg[0] + other.
reg[1] * other.
reg[1]);
350 inline void load(
const double* ptr) {
362 inline void store(
double* ptr)
const {