James Zern | 9dab3ce | 2012-12-20 14:46:55 -0800 | [diff] [blame] | 1 | /* |
Yaowu Xu | 9c01aa1 | 2016-09-01 14:32:49 -0700 | [diff] [blame] | 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved |
James Zern | 9dab3ce | 2012-12-20 14:46:55 -0800 | [diff] [blame] | 3 | * |
Yaowu Xu | 9c01aa1 | 2016-09-01 14:32:49 -0700 | [diff] [blame] | 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. |
James Zern | 9dab3ce | 2012-12-20 14:46:55 -0800 | [diff] [blame] | 10 | */ |
| 11 | |
James Zern | e1cbb13 | 2018-08-22 14:10:36 -0700 | [diff] [blame] | 12 | #ifndef AOM_AOM_PORTS_EMMINTRIN_COMPAT_H_ |
| 13 | #define AOM_AOM_PORTS_EMMINTRIN_COMPAT_H_ |
James Zern | 9dab3ce | 2012-12-20 14:46:55 -0800 | [diff] [blame] | 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. */ |
clang-format | 05ce850 | 2016-08-10 18:23:43 -0700 | [diff] [blame] | 19 | extern __inline __m128 |
| 20 | __attribute__((__gnu_inline__, __always_inline__, __artificial__)) |
| 21 | _mm_castpd_ps(__m128d __A) { |
| 22 | return (__m128)__A; |
James Zern | 9dab3ce | 2012-12-20 14:46:55 -0800 | [diff] [blame] | 23 | } |
| 24 | |
clang-format | 05ce850 | 2016-08-10 18:23:43 -0700 | [diff] [blame] | 25 | extern __inline __m128i |
| 26 | __attribute__((__gnu_inline__, __always_inline__, __artificial__)) |
| 27 | _mm_castpd_si128(__m128d __A) { |
| 28 | return (__m128i)__A; |
James Zern | 9dab3ce | 2012-12-20 14:46:55 -0800 | [diff] [blame] | 29 | } |
| 30 | |
clang-format | 05ce850 | 2016-08-10 18:23:43 -0700 | [diff] [blame] | 31 | extern __inline __m128d |
| 32 | __attribute__((__gnu_inline__, __always_inline__, __artificial__)) |
| 33 | _mm_castps_pd(__m128 __A) { |
| 34 | return (__m128d)__A; |
James Zern | 9dab3ce | 2012-12-20 14:46:55 -0800 | [diff] [blame] | 35 | } |
| 36 | |
clang-format | 05ce850 | 2016-08-10 18:23:43 -0700 | [diff] [blame] | 37 | extern __inline __m128i |
| 38 | __attribute__((__gnu_inline__, __always_inline__, __artificial__)) |
| 39 | _mm_castps_si128(__m128 __A) { |
| 40 | return (__m128i)__A; |
James Zern | 9dab3ce | 2012-12-20 14:46:55 -0800 | [diff] [blame] | 41 | } |
| 42 | |
clang-format | 05ce850 | 2016-08-10 18:23:43 -0700 | [diff] [blame] | 43 | extern __inline __m128 |
| 44 | __attribute__((__gnu_inline__, __always_inline__, __artificial__)) |
| 45 | _mm_castsi128_ps(__m128i __A) { |
| 46 | return (__m128)__A; |
James Zern | 9dab3ce | 2012-12-20 14:46:55 -0800 | [diff] [blame] | 47 | } |
| 48 | |
clang-format | 05ce850 | 2016-08-10 18:23:43 -0700 | [diff] [blame] | 49 | extern __inline __m128d |
| 50 | __attribute__((__gnu_inline__, __always_inline__, __artificial__)) |
| 51 | _mm_castsi128_pd(__m128i __A) { |
| 52 | return (__m128d)__A; |
James Zern | 9dab3ce | 2012-12-20 14:46:55 -0800 | [diff] [blame] | 53 | } |
| 54 | #endif |
| 55 | |
James Zern | e1cbb13 | 2018-08-22 14:10:36 -0700 | [diff] [blame] | 56 | #endif // AOM_AOM_PORTS_EMMINTRIN_COMPAT_H_ |