libosmscout 1.1.1
Loading...
Searching...
No Matches
SSEMathPublic.h
Go to the documentation of this file.
1#ifndef OSMSCOUT_SYSTEM_SSEMATH_PUBLIC_H
2#define OSMSCOUT_SYSTEM_SSEMATH_PUBLIC_H
3
4/*
5 This source is part of the libosmscout library
6 Copyright (C) 2009 Tim Teulings
7
8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Lesser General Public
10 License as published by the Free Software Foundation; either
11 version 2.1 of the License, or (at your option) any later version.
12
13 This library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
17
18 You should have received a copy of the GNU Lesser General Public
19 License along with this library; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21*/
22
23#include <osmscout/lib/CoreFeatures.h>
24
25#if defined(OSMSCOUT_HAVE_SSE2)
26
27//include sse and sse2 headers
28#include <xmmintrin.h>
29#include <emmintrin.h>
30
31//create alignment types
32#ifdef _MSC_VER /* visual c++ */
33# define ALIGN16_BEG __declspec(align(16))
34# define ALIGN16_END
35#else /* gcc or icc */
36# define ALIGN16_BEG
37# define ALIGN16_END __attribute__((aligned(16)))
38#endif
39
40#else
42#endif
43
44namespace osmscout {
45
46#if defined(OSMSCOUT_HAVE_SSE2)
47 #define sincos sin_cos_pd
48
49 /* __m128 is ugly to write */
50 typedef __m128d v2df; // vector of 2 double (sse2)
51 typedef __m128i v2di; // vector of 2 int (sse2)
52#else
53 inline void sincos(double x, double& resSin, double& resCos)
54 {
55 resSin = sin(x);
56 resCos = cos(x);
57 }
58#endif
59}
60
61#endif
Definition Area.h:39
void sincos(double x, double &resSin, double &resCos)
Definition SSEMathPublic.h:53