blob: 85d218a3d2d630248bfc4ddc9ad67af5fdb10a57 [file] [log] [blame]
James Zern9dab3ce2012-12-20 14:46:55 -08001/*
Yaowu Xu9c01aa12016-09-01 14:32:49 -07002 * Copyright (c) 2016, Alliance for Open Media. All rights reserved
James Zern9dab3ce2012-12-20 14:46:55 -08003 *
Yaowu Xu9c01aa12016-09-01 14:32:49 -07004 * 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 Zern9dab3ce2012-12-20 14:46:55 -080010 */
11
James Zerne1cbb132018-08-22 14:10:36 -070012#ifndef AOM_AOM_PORTS_EMMINTRIN_COMPAT_H_
13#define AOM_AOM_PORTS_EMMINTRIN_COMPAT_H_
James Zern9dab3ce2012-12-20 14:46:55 -080014
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-format05ce8502016-08-10 18:23:43 -070019extern __inline __m128
20 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
21 _mm_castpd_ps(__m128d __A) {
22 return (__m128)__A;
James Zern9dab3ce2012-12-20 14:46:55 -080023}
24
clang-format05ce8502016-08-10 18:23:43 -070025extern __inline __m128i
26 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
27 _mm_castpd_si128(__m128d __A) {
28 return (__m128i)__A;
James Zern9dab3ce2012-12-20 14:46:55 -080029}
30
clang-format05ce8502016-08-10 18:23:43 -070031extern __inline __m128d
32 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
33 _mm_castps_pd(__m128 __A) {
34 return (__m128d)__A;
James Zern9dab3ce2012-12-20 14:46:55 -080035}
36
clang-format05ce8502016-08-10 18:23:43 -070037extern __inline __m128i
38 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
39 _mm_castps_si128(__m128 __A) {
40 return (__m128i)__A;
James Zern9dab3ce2012-12-20 14:46:55 -080041}
42
clang-format05ce8502016-08-10 18:23:43 -070043extern __inline __m128
44 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
45 _mm_castsi128_ps(__m128i __A) {
46 return (__m128)__A;
James Zern9dab3ce2012-12-20 14:46:55 -080047}
48
clang-format05ce8502016-08-10 18:23:43 -070049extern __inline __m128d
50 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
51 _mm_castsi128_pd(__m128i __A) {
52 return (__m128d)__A;
James Zern9dab3ce2012-12-20 14:46:55 -080053}
54#endif
55
James Zerne1cbb132018-08-22 14:10:36 -070056#endif // AOM_AOM_PORTS_EMMINTRIN_COMPAT_H_