<div dir="ltr">Yeah, I'm not particularly interested in supporting older devices; I just wanted to ensure all the optimized NEON routines were used. I missed the PRESUME_NEON macro when real-time cpu detection is disabled (celt/arm/pitch_arm.h) in the fixed point section:<div><br></div><div><div># if !defined(OPUS_HAVE_RTCD)</div><div># define OVERRIDE_PITCH_XCORR (1)</div><div># define celt_pitch_xcorr(_x, _y, xcorr, len, max_pitch, arch) \</div><div> ((void)(arch),PRESUME_NEON(celt_pitch_xcorr)(_x, _y, xcorr, len, max_pitch))</div><div># endif</div></div><div><br></div><div>It looks like in both the fixed point and floating point case on iOS with real-time cpu detection disabled celt_pitch_xcorr_float_neon will be used, so there's probably no reason for this patch.</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 8, 2015 at 12:48 PM, Martin Storsjö <span dir="ltr"><<a href="mailto:martin@martin.st" target="_blank">martin@martin.st</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Thu, 8 Jan 2015, Jonathan Lennox wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Every armv7 (and armv8) iOS device has supported Neon, and Xcode support for<br>
armv6 was dropped with Xcode 4.5.<br>
<br>
Even if you’re compiling with an old Xcode version to support really old iOS<br>
devices, Apple’s armv6/armv7 selection was a compile-time switch (supported<br>
using fat binaries). I think the arch can be detected based on on<br>
preprocessor defines, though I can’t find the specific settings offhand.<br>
</blockquote>
<br></span>
You can use e.g. the define __ARM_NEON__ - it is defined in apple toolchains when targeting both armv7 and arm64. Likewise, when the compiler is building code for armv7 it will use neon instructions in normal C codepaths as well (if it finds it useful).<br>
<br>
So the only even theoretical use for runtime detection on iOS would be trying to include NEON instruction codepaths in armv6 slices, but there's little reason for that, and you can't probably even submit such binaries to appstore any longer even if you'd have an old xcode version around.<br>
<br>
Thus, I wholeheartedly agree that there is no point in runtime detection for this on iOS - checking the __ARM_NEON__ define at compile time is enough.<span class="HOEnZb"><font color="#888888"><br>
<br>
// Martin</font></span></blockquote></div><br></div>