diff options
author | Vadim Yanitskiy <axilirator@gmail.com> | 2017-05-20 01:46:51 +0300 |
---|---|---|
committer | Tom Tsou <tom@tsou.cc> | 2017-06-08 18:32:29 +0000 |
commit | 3bd763d2a10e19980505c90242a2eae9e2f6b4cb (patch) | |
tree | 7de8a172b393fc5af50259d6a0ae7664896339d6 /Transceiver52M | |
parent | ee5735768213f8724b978cd9180f088721e0cde0 (diff) |
ssedetect: call __builtin_cpu_supports() only if supported
Some compilers don't support the __builtin_cpu_supports built-in,
so let's make them able to compile the project anyway.
Change-Id: I0c90402d8e4c9f196c54b066ff30891c8de3ad2b
Diffstat (limited to 'Transceiver52M')
-rw-r--r-- | Transceiver52M/osmo-trx.cpp | 8 | ||||
-rw-r--r-- | Transceiver52M/x86/convert.c | 2 | ||||
-rw-r--r-- | Transceiver52M/x86/convolve.c | 2 |
3 files changed, 11 insertions, 1 deletions
diff --git a/Transceiver52M/osmo-trx.cpp b/Transceiver52M/osmo-trx.cpp index 1c0ceb1..31a99cf 100644 --- a/Transceiver52M/osmo-trx.cpp +++ b/Transceiver52M/osmo-trx.cpp @@ -397,18 +397,26 @@ int main(int argc, char *argv[]) #ifdef HAVE_SSE3 printf("Info: SSE3 support compiled in"); +#ifdef HAVE___BUILTIN_CPU_SUPPORTS if (__builtin_cpu_supports("sse3")) printf(" and supported by CPU\n"); else printf(", but not supported by CPU\n"); +#else + printf(", but runtime SIMD detection disabled\n"); +#endif #endif #ifdef HAVE_SSE4_1 printf("Info: SSE4.1 support compiled in"); +#ifdef HAVE___BUILTIN_CPU_SUPPORTS if (__builtin_cpu_supports("sse4.1")) printf(" and supported by CPU\n"); else printf(", but not supported by CPU\n"); +#else + printf(", but runtime SIMD detection disabled\n"); +#endif #endif convolve_init(); diff --git a/Transceiver52M/x86/convert.c b/Transceiver52M/x86/convert.c index db98050..07cdf59 100644 --- a/Transceiver52M/x86/convert.c +++ b/Transceiver52M/x86/convert.c @@ -46,6 +46,7 @@ void convert_init(void) c.convert_si16_ps_16n = base_convert_short_float; c.convert_si16_ps = base_convert_short_float; +#ifdef HAVE___BUILTIN_CPU_SUPPORTS #ifdef HAVE_SSE4_1 if (__builtin_cpu_supports("sse4.1")) { c.convert_si16_ps_16n = &_sse_convert_si16_ps_16n; @@ -60,6 +61,7 @@ void convert_init(void) c.convert_scale_ps_si16 = _sse_convert_scale_ps_si16; } #endif +#endif } void convert_float_short(short *out, const float *in, float scale, int len) diff --git a/Transceiver52M/x86/convolve.c b/Transceiver52M/x86/convolve.c index 35cba29..eb38f64 100644 --- a/Transceiver52M/x86/convolve.c +++ b/Transceiver52M/x86/convolve.c @@ -82,7 +82,7 @@ void convolve_init(void) c.conv_real4n = (void *)_base_convolve_real; c.conv_real = (void *)_base_convolve_real; -#ifdef HAVE_SSE3 +#if defined(HAVE_SSE3) && defined(HAVE___BUILTIN_CPU_SUPPORTS) if (__builtin_cpu_supports("sse3")) { c.conv_cmplx_4n = sse_conv_cmplx_4n; c.conv_cmplx_8n = sse_conv_cmplx_8n; |