diff options
author | Jonathan Lennox <jonathan@vidyo.com> | 2016-07-08 18:30:19 -0400 |
---|---|---|
committer | Timothy B. Terriberry <tterribe@xiph.org> | 2016-07-08 16:45:44 -0700 |
commit | 1a94b2b8797a3c289ac23bd42cda9a37b73ca112 (patch) | |
tree | 15bd887dcf356275624d650403c429dd7882556d /celt | |
parent | 37cce2800bd79dd6b2ef7b44f71e2c9b714dc4d1 (diff) | |
download | libopus-1a94b2b8797a3c289ac23bd42cda9a37b73ca112.tar.gz |
Fix RTCD on ARM with Neon Intrinsics but not ASM.
Notably, ARM floating-point build.
This maintains the invariant that we don't use later instruction
sets if the OS claims an earlier one is not available.
However, it does not update configure to ensure that there is
build support for all earlier instruction sets if NEON build
support is enabled (though I am not aware of a build toolchain
where this is actually a problem).
Signed-off-by: Timothy B. Terriberry <tterribe@xiph.org>
Diffstat (limited to 'celt')
-rw-r--r-- | celt/arm/armcpu.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/celt/arm/armcpu.c b/celt/arm/armcpu.c index 09fbc418..694a63b7 100644 --- a/celt/arm/armcpu.c +++ b/celt/arm/armcpu.c @@ -56,7 +56,8 @@ static OPUS_INLINE opus_uint32 opus_cpu_capabilities(void){ /* MSVC has no OPUS_INLINE __asm support for ARM, but it does let you __emit * instructions via their assembled hex code. * All of these instructions should be essentially nops. */ -# if defined(OPUS_ARM_MAY_HAVE_EDSP) +# if defined(OPUS_ARM_MAY_HAVE_EDSP) || defined(OPUS_ARM_MAY_HAVE_MEDIA) \ + || defined(OPUS_ARM_MAY_HAVE_NEON) || defined(OPUS_ARM_MAY_HAVE_NEON_INTR) __try{ /*PLD [r13]*/ __emit(0xF5DDF000); @@ -65,7 +66,8 @@ static OPUS_INLINE opus_uint32 opus_cpu_capabilities(void){ __except(GetExceptionCode()==EXCEPTION_ILLEGAL_INSTRUCTION){ /*Ignore exception.*/ } -# if defined(OPUS_ARM_MAY_HAVE_MEDIA) +# if defined(OPUS_ARM_MAY_HAVE_MEDIA) \ + || defined(OPUS_ARM_MAY_HAVE_NEON) || defined(OPUS_ARM_MAY_HAVE_NEON_INTR) __try{ /*SHADD8 r3,r3,r3*/ __emit(0xE6333F93); @@ -108,16 +110,15 @@ opus_uint32 opus_cpu_capabilities(void) while(fgets(buf, 512, cpuinfo) != NULL) { -# if defined(OPUS_ARM_MAY_HAVE_EDSP) || defined(OPUS_ARM_MAY_HAVE_NEON) || defined(OPUS_ARM_MAY_HAVE_NEON_INTR) +# if defined(OPUS_ARM_MAY_HAVE_EDSP) || defined(OPUS_ARM_MAY_HAVE_MEDIA) \ + || defined(OPUS_ARM_MAY_HAVE_NEON) || defined(OPUS_ARM_MAY_HAVE_NEON_INTR) /* Search for edsp and neon flag */ if(memcmp(buf, "Features", 8) == 0) { char *p; -# if defined(OPUS_ARM_MAY_HAVE_EDSP) p = strstr(buf, " edsp"); if(p != NULL && (p[5] == ' ' || p[5] == '\n')) flags |= OPUS_CPU_ARM_EDSP_FLAG; -# endif # if defined(OPUS_ARM_MAY_HAVE_NEON) || defined(OPUS_ARM_MAY_HAVE_NEON_INTR) p = strstr(buf, " neon"); @@ -127,7 +128,8 @@ opus_uint32 opus_cpu_capabilities(void) } # endif -# if defined(OPUS_ARM_MAY_HAVE_MEDIA) +# if defined(OPUS_ARM_MAY_HAVE_MEDIA) \ + || defined(OPUS_ARM_MAY_HAVE_NEON) || defined(OPUS_ARM_MAY_HAVE_NEON_INTR) /* Search for media capabilities (>= ARMv6) */ if(memcmp(buf, "CPU architecture:", 17) == 0) { |