<div dir="ltr">anyone know how to get the aarch64 fork pulled into the mainline speexdsp?<div>The code is provided in the bug report <a href="https://github.com/xiph/speexdsp/issues/7" target="_blank" style="font-size:12.8px">https://github.com/xiph/<wbr>speexdsp/issues/7</a></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 29, 2016 at 5:21 PM, Frank Barchard <span dir="ltr"><<a href="mailto:fbarchard@google.com" target="_blank">fbarchard@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I've filed a bug for aarch64<div><a href="https://github.com/xiph/speexdsp/issues/7" target="_blank">https://github.com/xiph/<wbr>speexdsp/issues/7</a><br></div><div><br></div><div>and provided the port in a fork with a pull request.  We need someone to review/merge in the pull request?</div><div><!--
-->It provides the source code, but my testing was under Android builds, so there would be some configure changes needed to build it stand alone.</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 19, 2016 at 4:32 PM, Frank Barchard <span dir="ltr"><<a href="mailto:fbarchard@google.com" target="_blank">fbarchard@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi I'm new to speex list but joined because I'm needing to port the Neon to ARM64.<div>On that function, saturate_32bit_to_16bit(), I noticed the ifdef's are wrong.</div><div>The first version is for normal arm 32 bit arm and should be used for arm32 and thumb2 but not thumb1.</div><div>The second version is 32 bit neon and should be #ifdef __ARM_NEON__</div><div>I've done a third version which<!--
--> is 64 bit neon.   I'm working off an android version which is rc2 so I'll need to integrate, but here it is:</div><div><br></div><div><div>#if defined(__aarch64__)</div><div>static inline int32_t saturate_32bit_to_16bit(int32_<wbr>t a) {</div><div><span class="m_1887038434184733674m_-3490218015663917727gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>int32_t ret;</div><div><span class="m_1887038434184733674m_-3490218015663917727gmail-Apple-tab-span" style="white-space:pre-wrap">   </span>asm volatile ("sqxtn h0, %s[a]\n"</div><div><span class="m_1887038434184733674m_-3490218015663917727gmail-Apple-tab-span" style="white-space:pre-wrap">            </span>      "sxtl  v0.4s, v0.4h\n"</div><div><span class="m_1887038434184733674m_-3490218015663917727gmail-Apple-tab-span" style="white-space:pre-wrap">             </span>      "fmov %w[ret], s0\n"</div><div><!--
--><span class="m_1887038434184733674m_-3490218015663917727gmail-Apple-tab-span" style="white-space:pre-wrap">             </span>      : [ret] "=&r" (ret)</div><div><span class="m_1887038434184733674m_-3490218015663917727gmail-Apple-tab-span" style="white-space:pre-wrap">             </span>      : [a] "w" (a)</div><div><span class="m_1887038434184733674m_-3490218015663917727gmail-Apple-tab-span" style="white-space:pre-wrap">               </span>      : "v0" );</div><div><span class="m_1887038434184733674m_-3490218015663917727gmail-Apple-tab-span" style="white-space:pre-wrap">   </span>return ret;</div><div>}</div><div>#elif defined(__ARM_NEON__)</div><div>static inline int32_t saturate_32bit_to_16bit(int32_<wbr>t a) {</div><div><span class="m_1887038434184733674m_-3490218015663917727gmail-Apple-tab-span" style="white-space:pre-wrap">      </span>int32_t ret;</div><div><!--
--><span class="m_1887038434184733674m_-3490218015663917727gmail-Apple-tab-span" style="white-space:pre-wrap">     </span>asm volatile ("vmov.s32 d24[0], %[a]\n"</div><div><span class="m_1887038434184733674m_-3490218015663917727gmail-Apple-tab-span" style="white-space:pre-wrap">              </span>      "vqmovn.s32 d24, q12\n"</div><div><span class="m_1887038434184733674m_-3490218015663917727gmail-Apple-tab-span" style="white-space:pre-wrap">             </span>      "vmov.s16 %[ret], d24[0]\n"</div><div><span class="m_1887038434184733674m_-3490218015663917727gmail-Apple-tab-span" style="white-space:pre-wrap">         </span>      : [ret] "=&r" (ret)</div><div><span class="m_1887038434184733674m_-3490218015663917727gmail-Apple-tab-span" style="white-space:pre-wrap">             </span>      : [a] "r" (a)</div><div><!--
--><span class="m_1887038434184733674m_-3490218015663917727gmail-Apple-tab-span" style="white-space:pre-wrap">             </span>      : "q12", "d24", "d25" );</div><div><span class="m_1887038434184733674m_-3490218015663917727gmail-Apple-tab-span" style="white-space:pre-wrap">        </span>return ret;</div><div>}</div><div>#else</div><div>static inline int32_t saturate_32bit_to_16bit(int32_<wbr>t a) {</div><div><span class="m_1887038434184733674m_-3490218015663917727gmail-Apple-tab-span" style="white-space:pre-wrap">    </span>return max(-32768, min(32767, a));</div><div>}</div><div>#endif</div></div><div><br></div><div>To test it I wrote a stand alone test and ran it via adb.</div><div>Anyone able to help with review/integration?</div><div>There are 4 functions in resample_neon.h thats just the first/easiest.</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><!--
--><div class="m_1887038434184733674h5">On Sat, Mar 28, 2015 at 11:28 AM, Evan JIANG <span dir="ltr"><<a href="mailto:firstfan@gmail.com" target="_blank">firstfan@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_1887038434184733674h5"><div dir="ltr"><div><div><div><div><div><div>Hi all,<br></div>    I build successfully with speex-1.2rc2. And with speexdsp 1.2rc3, I build with i386, X86_64, armv7 and armv7s all passed.<br></div>   But when I build for ARM64 (for iPhone 6), it failed with:<br>/Applications/Xcode.app/Conten<wbr>ts/Developer/usr/bin/make  all-recursive<br>Making all in libspeexdsp<br>  CC       preprocess.lo<br>  CC       jitter.lo<br>  CC       mdf.lo<br>  CC       fftwrap.lo<br>  CC       filterbank.lo<br>  CC       resample.lo<br>In file included <!--
-->from resample.c:104:<br>./resample_neon.h:134:12: error: unknown register name 'q0' in asm<br>         : "q0");<br>           ^<br>./resample_neon.h:195:13: error: invalid output constraint '+l' in asm<br>                    [len] "+l" (len), [remainder] "+l" (remainder)<br>                          ^<br>2 errors generated.<br>make[2]: *** [resample.lo] Error 1<br>make[1]: *** [all-recursive] Error 1<br>make: *** [all] Error 2<br><br><br></div>As I googled out, I found it's said:<br><br><pre>arm64 has a totally different instruction set.

See: <a href="http://people.linaro.org/%7Erikuvoipio/aarch64-talk/" rel="nofollow" target="_blank">http://people.linaro.org/~riku<wbr>voipio/aarch64-talk/</a>

The NEON assembly code needs a rewrite.</pre><br><br></div>But I'm not familiar with ASM code. Could anyone help to fix that?<br><br></div>Best regards,<br></div>Evan JIANG<br></div>
<br></div></div>______________________________<wbr>_________________<br>
Speex-dev mailing list<br>
<a href="mailto:Speex-dev@xiph.org" target="_blank">Speex-dev@xiph.org</a><br>
<a href="http://lists.xiph.org/mailman/listinfo/speex-dev" rel="noreferrer" target="_blank">http://lists.xiph.org/mailman/<wbr>listinfo/speex-dev</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>