1 /* 2 * Copyright (c) 2016, Alliance for Open Media. All rights reserved. 3 * 4 * This source code is subject to the terms of the BSD 2 Clause License and 5 * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 * was not distributed with this source code in the LICENSE file, you can 7 * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 * Media Patent License 1.0 was not distributed with this source code in the 9 * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 */ 11 12 #ifndef AOM_AOM_PORTS_EMMINTRIN_COMPAT_H_ 13 #define AOM_AOM_PORTS_EMMINTRIN_COMPAT_H_ 14 15 #if defined(__GNUC__) && __GNUC__ < 4 16 /* From emmintrin.h (gcc 4.5.3) */ 17 /* Casts between various SP, DP, INT vector types. Note that these do no 18 conversion of values, they just change the type. */ 19 extern __inline __m128 20 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_castpd_ps(__m128d __A)21 _mm_castpd_ps(__m128d __A) { 22 return (__m128)__A; 23 } 24 25 extern __inline __m128i 26 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_castpd_si128(__m128d __A)27 _mm_castpd_si128(__m128d __A) { 28 return (__m128i)__A; 29 } 30 31 extern __inline __m128d 32 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_castps_pd(__m128 __A)33 _mm_castps_pd(__m128 __A) { 34 return (__m128d)__A; 35 } 36 37 extern __inline __m128i 38 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_castps_si128(__m128 __A)39 _mm_castps_si128(__m128 __A) { 40 return (__m128i)__A; 41 } 42 43 extern __inline __m128 44 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_castsi128_ps(__m128i __A)45 _mm_castsi128_ps(__m128i __A) { 46 return (__m128)__A; 47 } 48 49 extern __inline __m128d 50 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_castsi128_pd(__m128i __A)51 _mm_castsi128_pd(__m128i __A) { 52 return (__m128d)__A; 53 } 54 #endif 55 56 #endif // AOM_AOM_PORTS_EMMINTRIN_COMPAT_H_ 57