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