| 1 |
/* |
| 2 |
* This file is a part of Luminance HDR package |
| 3 |
* ---------------------------------------------------------------------- |
| 4 |
* Copyright (C) 2011 Davide Anastasia |
| 5 |
* |
| 6 |
* This program is free software; you can redistribute it and/or modify |
| 7 |
* it under the terms of the GNU General Public License as published by |
| 8 |
* the Free Software Foundation; either version 2 of the License, or |
| 9 |
* (at your option) any later version. |
| 10 |
* |
| 11 |
* This program is distributed in the hope that it will be useful, |
| 12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 |
* GNU General Public License for more details. |
| 15 |
* |
| 16 |
* You should have received a copy of the GNU General Public License |
| 17 |
* along with this program; if not, write to the Free Software |
| 18 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 19 |
* ---------------------------------------------------------------------- |
| 20 |
*/ |
| 21 |
|
| 22 |
//! @brief SSE for high performance vector operations |
| 23 |
//! @author Davide Anastasia, <[email protected]> |
| 24 |
|
| 25 |
#ifndef PFS_UTILS_SSE_H |
| 26 |
#define PFS_UTILS_SSE_H |
| 27 |
|
| 28 |
namespace pfs { |
| 29 |
namespace utils { |
| 30 |
|
| 31 |
#ifdef __SSE__ |
| 32 |
|
| 33 |
//#if __ppc__ || __ppc7400__ || __ppc64__ || __ppc970__ |
| 34 |
//#include <ppc_intrinsics.h> |
| 35 |
#if __i386__ || __x86_64__ |
| 36 |
// #define LUMINANCE_USE_SSE |
| 37 |
#include <mm_malloc.h> |
| 38 |
#include <xmmintrin.h> |
| 39 |
//#include <pmmintrin.h> |
| 40 |
//#include <tmmintrin.h> |
| 41 |
|
| 42 |
#else |
| 43 |
#error unsupported architecture |
| 44 |
#endif |
| 45 |
|
| 46 |
#endif // __SSE__ |
| 47 |
|
| 48 |
#ifdef LUMINANCE_USE_SSE |
| 49 |
typedef __v4sf v4sf; |
| 50 |
v4sf _mm_log2_ps(v4sf); |
| 51 |
v4sf _mm_exp2_ps(v4sf); |
| 52 |
v4sf _mm_pow_ps(v4sf, v4sf); |
| 53 |
#endif |
| 54 |
|
| 55 |
} // utils |
| 56 |
} // pfs |
| 57 |
|
| 58 |
#endif // PFS_UTILS_SSE_H |