Commit ebf209ba authored by Steinar Midtskogen's avatar Steinar Midtskogen Committed by Yaowu Xu
Browse files

Make generic SIMD code compile if no native support

Change-Id: I7f691a0ae27f06ef3d727764829a60a8ffc509eb
parent 86b19177
...@@ -376,4 +376,6 @@ DSP_SRCS-no += $(DSP_SRCS_REMOVE-yes) ...@@ -376,4 +376,6 @@ DSP_SRCS-no += $(DSP_SRCS_REMOVE-yes)
DSP_SRCS-yes += aom_dsp_rtcd.c DSP_SRCS-yes += aom_dsp_rtcd.c
DSP_SRCS-yes += aom_dsp_rtcd_defs.pl DSP_SRCS-yes += aom_dsp_rtcd_defs.pl
DSP_SRCS-yes += aom_simd.c
$(eval $(call rtcd_h_template,aom_dsp_rtcd,aom_dsp/aom_dsp_rtcd_defs.pl)) $(eval $(call rtcd_h_template,aom_dsp_rtcd,aom_dsp/aom_dsp_rtcd_defs.pl))
/*
* Copyright (c) 2016, Alliance for Open Media. All rights reserved
*
* This source code is subject to the terms of the BSD 2 Clause License and
* the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
* was not distributed with this source code in the LICENSE file, you can
* obtain it at www.aomedia.org/license/software. If the Alliance for Open
* Media Patent License 1.0 was not distributed with this source code in the
* PATENTS file, you can obtain it at www.aomedia.org/license/patent.
*/
// Set to 1 to add some sanity checks in the fallback C code
const int simd_check = 1;
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include "./v64_intrinsics_c.h" #include "./v64_intrinsics_c.h"
#include "./aom_config.h"
typedef union { typedef union {
uint8_t u8[16]; uint8_t u8[16];
...@@ -406,11 +407,13 @@ SIMD_INLINE c_v128 _c_v128_unzip_8(c_v128 a, c_v128 b, int mode) { ...@@ -406,11 +407,13 @@ SIMD_INLINE c_v128 _c_v128_unzip_8(c_v128 a, c_v128 b, int mode) {
} }
SIMD_INLINE c_v128 c_v128_unziplo_8(c_v128 a, c_v128 b) { SIMD_INLINE c_v128 c_v128_unziplo_8(c_v128 a, c_v128 b) {
return big_endian() ? _c_v128_unzip_8(a, b, 1) : _c_v128_unzip_8(a, b, 0); return CONFIG_BIG_ENDIAN ? _c_v128_unzip_8(a, b, 1)
: _c_v128_unzip_8(a, b, 0);
} }
SIMD_INLINE c_v128 c_v128_unziphi_8(c_v128 a, c_v128 b) { SIMD_INLINE c_v128 c_v128_unziphi_8(c_v128 a, c_v128 b) {
return big_endian() ? _c_v128_unzip_8(b, a, 0) : _c_v128_unzip_8(b, a, 1); return CONFIG_BIG_ENDIAN ? _c_v128_unzip_8(b, a, 0)
: _c_v128_unzip_8(b, a, 1);
} }
SIMD_INLINE c_v128 _c_v128_unzip_16(c_v128 a, c_v128 b, int mode) { SIMD_INLINE c_v128 _c_v128_unzip_16(c_v128 a, c_v128 b, int mode) {
...@@ -438,11 +441,13 @@ SIMD_INLINE c_v128 _c_v128_unzip_16(c_v128 a, c_v128 b, int mode) { ...@@ -438,11 +441,13 @@ SIMD_INLINE c_v128 _c_v128_unzip_16(c_v128 a, c_v128 b, int mode) {
} }
SIMD_INLINE c_v128 c_v128_unziplo_16(c_v128 a, c_v128 b) { SIMD_INLINE c_v128 c_v128_unziplo_16(c_v128 a, c_v128 b) {
return big_endian() ? _c_v128_unzip_16(a, b, 1) : _c_v128_unzip_16(a, b, 0); return CONFIG_BIG_ENDIAN ? _c_v128_unzip_16(a, b, 1)
: _c_v128_unzip_16(a, b, 0);
} }
SIMD_INLINE c_v128 c_v128_unziphi_16(c_v128 a, c_v128 b) { SIMD_INLINE c_v128 c_v128_unziphi_16(c_v128 a, c_v128 b) {
return big_endian() ? _c_v128_unzip_16(b, a, 0) : _c_v128_unzip_16(b, a, 1); return CONFIG_BIG_ENDIAN ? _c_v128_unzip_16(b, a, 0)
: _c_v128_unzip_16(b, a, 1);
} }
SIMD_INLINE c_v128 _c_v128_unzip_32(c_v128 a, c_v128 b, int mode) { SIMD_INLINE c_v128 _c_v128_unzip_32(c_v128 a, c_v128 b, int mode) {
...@@ -462,11 +467,13 @@ SIMD_INLINE c_v128 _c_v128_unzip_32(c_v128 a, c_v128 b, int mode) { ...@@ -462,11 +467,13 @@ SIMD_INLINE c_v128 _c_v128_unzip_32(c_v128 a, c_v128 b, int mode) {
} }
SIMD_INLINE c_v128 c_v128_unziplo_32(c_v128 a, c_v128 b) { SIMD_INLINE c_v128 c_v128_unziplo_32(c_v128 a, c_v128 b) {
return big_endian() ? _c_v128_unzip_32(a, b, 1) : _c_v128_unzip_32(a, b, 0); return CONFIG_BIG_ENDIAN ? _c_v128_unzip_32(a, b, 1)
: _c_v128_unzip_32(a, b, 0);
} }
SIMD_INLINE c_v128 c_v128_unziphi_32(c_v128 a, c_v128 b) { SIMD_INLINE c_v128 c_v128_unziphi_32(c_v128 a, c_v128 b) {
return big_endian() ? _c_v128_unzip_32(b, a, 0) : _c_v128_unzip_32(b, a, 1); return CONFIG_BIG_ENDIAN ? _c_v128_unzip_32(b, a, 0)
: _c_v128_unzip_32(b, a, 1);
} }
SIMD_INLINE c_v128 c_v128_unpack_u8_s16(c_v64 a) { SIMD_INLINE c_v128 c_v128_unpack_u8_s16(c_v64 a) {
...@@ -535,8 +542,8 @@ SIMD_INLINE c_v128 c_v128_shuffle_8(c_v128 a, c_v128 pattern) { ...@@ -535,8 +542,8 @@ SIMD_INLINE c_v128 c_v128_shuffle_8(c_v128 a, c_v128 pattern) {
c); c);
abort(); abort();
} }
t.u8[c] = t.u8[c] = a.u8[CONFIG_BIG_ENDIAN ? 15 - (pattern.u8[c] & 15)
a.u8[big_endian() ? 15 - (pattern.u8[c] & 15) : pattern.u8[c] & 15]; : pattern.u8[c] & 15];
} }
return t; return t;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment