Discussion:
[Speex-dev] Fwd: Cannot compile speexdsp 1.2rc3 on ARM64
Evan JIANG
2015-03-28 18:34:50 UTC
Permalink
Hi all,

(Sorry that may be duplicated that I was not a mail-list member before,
so last mail sent failed)

I build successfully with speex-1.2rc2. And with speexdsp 1.2rc3, I
build with i386, X86_64, armv7 and armv7s all passed.
But when I build for ARM64 (for iPhone 6), it failed with:
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-recursive
Making all in libspeexdsp
CC preprocess.lo
CC jitter.lo
CC mdf.lo
CC fftwrap.lo
CC filterbank.lo
CC resample.lo
In file included from resample.c:104:
./resample_neon.h:134:12: error: unknown register name 'q0' in asm
: "q0");
^
./resample_neon.h:195:13: error: invalid output constraint '+l' in asm
[len] "+l" (len), [remainder] "+l" (remainder)
^
2 errors generated.
make[2]: *** [resample.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2


As I googled out, I found it's said:

arm64 has a totally different instruction set.

See: http://people.linaro.org/~rikuvoipio/aarch64-talk/

The NEON assembly code needs a rewrite.



But I'm not familiar with ASM code. Could anyone help to fix that?

Best regards,
Evan JIANG
Tristan Matthews
2015-04-13 20:29:47 UTC
Permalink
Hi,
Post by Evan JIANG
Hi all,
(Sorry that may be duplicated that I was not a mail-list member before,
so last mail sent failed)
I build successfully with speex-1.2rc2. And with speexdsp 1.2rc3, I
build with i386, X86_64, armv7 and armv7s all passed.
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-recursive
Making all in libspeexdsp
CC preprocess.lo
CC jitter.lo
CC mdf.lo
CC fftwrap.lo
CC filterbank.lo
CC resample.lo
./resample_neon.h:134:12: error: unknown register name 'q0' in asm
: "q0");
^
./resample_neon.h:195:13: error: invalid output constraint '+l' in asm
[len] "+l" (len), [remainder] "+l" (remainder)
^
2 errors generated.
make[2]: *** [resample.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
arm64 has a totally different instruction set.
See: http://people.linaro.org/~rikuvoipio/aarch64-talk/
The NEON assembly code needs a rewrite.
But I'm not familiar with ASM code. Could anyone help to fix that?
For the time being, you can always disable NEON code on that platform with:
./configure --disable-neon
Evan JIANG
2015-04-14 02:32:44 UTC
Permalink
Hi Tristan,
Thank you for your reply. And "./configure --disable-neon" really works
for me.
Post by Tristan Matthews
Hi,
Post by Evan JIANG
Hi all,
(Sorry that may be duplicated that I was not a mail-list member
before, so last mail sent failed)
I build successfully with speex-1.2rc2. And with speexdsp 1.2rc3, I
build with i386, X86_64, armv7 and armv7s all passed.
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-recursive
Making all in libspeexdsp
CC preprocess.lo
CC jitter.lo
CC mdf.lo
CC fftwrap.lo
CC filterbank.lo
CC resample.lo
./resample_neon.h:134:12: error: unknown register name 'q0' in asm
: "q0");
^
./resample_neon.h:195:13: error: invalid output constraint '+l' in asm
[len] "+l" (len), [remainder] "+l" (remainder)
^
2 errors generated.
make[2]: *** [resample.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
arm64 has a totally different instruction set.
See: http://people.linaro.org/~rikuvoipio/aarch64-talk/
The NEON assembly code needs a rewrite.
But I'm not familiar with ASM code. Could anyone help to fix that?
./configure --disable-neon
Frank Barchard
2016-04-19 23:32:56 UTC
Permalink
Hi I'm new to speex list but joined because I'm needing to port the Neon to
ARM64.
On that function, saturate_32bit_to_16bit(), I noticed the ifdef's are
wrong.
The first version is for normal arm 32 bit arm and should be used for arm32
and thumb2 but not thumb1.
The second version is 32 bit neon and should be #ifdef __ARM_NEON__
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:

#if defined(__aarch64__)
static inline int32_t saturate_32bit_to_16bit(int32_t a) {
int32_t ret;
asm volatile ("sqxtn h0, %s[a]\n"
"sxtl v0.4s, v0.4h\n"
"fmov %w[ret], s0\n"
: [ret] "=&r" (ret)
: [a] "w" (a)
: "v0" );
return ret;
}
#elif defined(__ARM_NEON__)
static inline int32_t saturate_32bit_to_16bit(int32_t a) {
int32_t ret;
asm volatile ("vmov.s32 d24[0], %[a]\n"
"vqmovn.s32 d24, q12\n"
"vmov.s16 %[ret], d24[0]\n"
: [ret] "=&r" (ret)
: [a] "r" (a)
: "q12", "d24", "d25" );
return ret;
}
#else
static inline int32_t saturate_32bit_to_16bit(int32_t a) {
return max(-32768, min(32767, a));
}
#endif

To test it I wrote a stand alone test and ran it via adb.
Anyone able to help with review/integration?
There are 4 functions in resample_neon.h thats just the first/easiest.
Post by Evan JIANG
Hi all,
I build successfully with speex-1.2rc2. And with speexdsp 1.2rc3, I
build with i386, X86_64, armv7 and armv7s all passed.
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-recursive
Making all in libspeexdsp
CC preprocess.lo
CC jitter.lo
CC mdf.lo
CC fftwrap.lo
CC filterbank.lo
CC resample.lo
./resample_neon.h:134:12: error: unknown register name 'q0' in asm
: "q0");
^
./resample_neon.h:195:13: error: invalid output constraint '+l' in asm
[len] "+l" (len), [remainder] "+l" (remainder)
^
2 errors generated.
make[2]: *** [resample.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
arm64 has a totally different instruction set.
See: http://people.linaro.org/~rikuvoipio/aarch64-talk/
The NEON assembly code needs a rewrite.
But I'm not familiar with ASM code. Could anyone help to fix that?
Best regards,
Evan JIANG
_______________________________________________
Speex-dev mailing list
http://lists.xiph.org/mailman/listinfo/speex-dev
Frank Barchard
2016-07-30 00:21:24 UTC
Permalink
I've filed a bug for aarch64
https://github.com/xiph/speexdsp/issues/7

and provided the port in a fork with a pull request. We need someone to
review/merge in the pull request?
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.
Post by Frank Barchard
Hi I'm new to speex list but joined because I'm needing to port the Neon
to ARM64.
On that function, saturate_32bit_to_16bit(), I noticed the ifdef's are
wrong.
The first version is for normal arm 32 bit arm and should be used for
arm32 and thumb2 but not thumb1.
The second version is 32 bit neon and should be #ifdef __ARM_NEON__
I've done a third version which is 64 bit neon. I'm working off an
#if defined(__aarch64__)
static inline int32_t saturate_32bit_to_16bit(int32_t a) {
int32_t ret;
asm volatile ("sqxtn h0, %s[a]\n"
"sxtl v0.4s, v0.4h\n"
"fmov %w[ret], s0\n"
: [ret] "=&r" (ret)
: [a] "w" (a)
: "v0" );
return ret;
}
#elif defined(__ARM_NEON__)
static inline int32_t saturate_32bit_to_16bit(int32_t a) {
int32_t ret;
asm volatile ("vmov.s32 d24[0], %[a]\n"
"vqmovn.s32 d24, q12\n"
"vmov.s16 %[ret], d24[0]\n"
: [ret] "=&r" (ret)
: [a] "r" (a)
: "q12", "d24", "d25" );
return ret;
}
#else
static inline int32_t saturate_32bit_to_16bit(int32_t a) {
return max(-32768, min(32767, a));
}
#endif
To test it I wrote a stand alone test and ran it via adb.
Anyone able to help with review/integration?
There are 4 functions in resample_neon.h thats just the first/easiest.
Post by Evan JIANG
Hi all,
I build successfully with speex-1.2rc2. And with speexdsp 1.2rc3, I
build with i386, X86_64, armv7 and armv7s all passed.
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-recursive
Making all in libspeexdsp
CC preprocess.lo
CC jitter.lo
CC mdf.lo
CC fftwrap.lo
CC filterbank.lo
CC resample.lo
./resample_neon.h:134:12: error: unknown register name 'q0' in asm
: "q0");
^
./resample_neon.h:195:13: error: invalid output constraint '+l' in asm
[len] "+l" (len), [remainder] "+l" (remainder)
^
2 errors generated.
make[2]: *** [resample.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
arm64 has a totally different instruction set.
See: http://people.linaro.org/~rikuvoipio/aarch64-talk/
The NEON assembly code needs a rewrite.
But I'm not familiar with ASM code. Could anyone help to fix that?
Best regards,
Evan JIANG
_______________________________________________
Speex-dev mailing list
http://lists.xiph.org/mailman/listinfo/speex-dev
Frank Barchard
2016-08-09 00:29:52 UTC
Permalink
anyone know how to get the aarch64 fork pulled into the mainline speexdsp?
The code is provided in the bug report https://github.com/xiph/
speexdsp/issues/7
Post by Frank Barchard
I've filed a bug for aarch64
https://github.com/xiph/speexdsp/issues/7
and provided the port in a fork with a pull request. We need someone to
review/merge in the pull request?
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.
Post by Frank Barchard
Hi I'm new to speex list but joined because I'm needing to port the Neon
to ARM64.
On that function, saturate_32bit_to_16bit(), I noticed the ifdef's are
wrong.
The first version is for normal arm 32 bit arm and should be used for
arm32 and thumb2 but not thumb1.
The second version is 32 bit neon and should be #ifdef __ARM_NEON__
I've done a third version which is 64 bit neon. I'm working off an
#if defined(__aarch64__)
static inline int32_t saturate_32bit_to_16bit(int32_t a) {
int32_t ret;
asm volatile ("sqxtn h0, %s[a]\n"
"sxtl v0.4s, v0.4h\n"
"fmov %w[ret], s0\n"
: [ret] "=&r" (ret)
: [a] "w" (a)
: "v0" );
return ret;
}
#elif defined(__ARM_NEON__)
static inline int32_t saturate_32bit_to_16bit(int32_t a) {
int32_t ret;
asm volatile ("vmov.s32 d24[0], %[a]\n"
"vqmovn.s32 d24, q12\n"
"vmov.s16 %[ret], d24[0]\n"
: [ret] "=&r" (ret)
: [a] "r" (a)
: "q12", "d24", "d25" );
return ret;
}
#else
static inline int32_t saturate_32bit_to_16bit(int32_t a) {
return max(-32768, min(32767, a));
}
#endif
To test it I wrote a stand alone test and ran it via adb.
Anyone able to help with review/integration?
There are 4 functions in resample_neon.h thats just the first/easiest.
Post by Evan JIANG
Hi all,
I build successfully with speex-1.2rc2. And with speexdsp 1.2rc3, I
build with i386, X86_64, armv7 and armv7s all passed.
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-recursive
Making all in libspeexdsp
CC preprocess.lo
CC jitter.lo
CC mdf.lo
CC fftwrap.lo
CC filterbank.lo
CC resample.lo
./resample_neon.h:134:12: error: unknown register name 'q0' in asm
: "q0");
^
./resample_neon.h:195:13: error: invalid output constraint '+l' in asm
[len] "+l" (len), [remainder] "+l" (remainder)
^
2 errors generated.
make[2]: *** [resample.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
arm64 has a totally different instruction set.
See: http://people.linaro.org/~rikuvoipio/aarch64-talk/
The NEON assembly code needs a rewrite.
But I'm not familiar with ASM code. Could anyone help to fix that?
Best regards,
Evan JIANG
_______________________________________________
Speex-dev mailing list
http://lists.xiph.org/mailman/listinfo/speex-dev
Tristan Matthews
2016-08-09 01:28:37 UTC
Permalink
Hi Frank,
Post by Frank Barchard
anyone know how to get the aarch64 fork pulled into the mainline speexdsp?
The code is provided in the bug report
https://github.com/xiph/speexdsp/issues/7
Thanks for the patch, I will have a look and get back to you.

Best,
Tristan
Post by Frank Barchard
Post by Frank Barchard
I've filed a bug for aarch64
https://github.com/xiph/speexdsp/issues/7
and provided the port in a fork with a pull request. We need someone to
review/merge in the pull request?
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.
Post by Frank Barchard
Hi I'm new to speex list but joined because I'm needing to port the Neon
to ARM64.
On that function, saturate_32bit_to_16bit(), I noticed the ifdef's are
wrong.
The first version is for normal arm 32 bit arm and should be used for
arm32 and thumb2 but not thumb1.
The second version is 32 bit neon and should be #ifdef __ARM_NEON__
I've done a third version which is 64 bit neon. I'm working off an
#if defined(__aarch64__)
static inline int32_t saturate_32bit_to_16bit(int32_t a) {
int32_t ret;
asm volatile ("sqxtn h0, %s[a]\n"
"sxtl v0.4s, v0.4h\n"
"fmov %w[ret], s0\n"
: [ret] "=&r" (ret)
: [a] "w" (a)
: "v0" );
return ret;
}
#elif defined(__ARM_NEON__)
static inline int32_t saturate_32bit_to_16bit(int32_t a) {
int32_t ret;
asm volatile ("vmov.s32 d24[0], %[a]\n"
"vqmovn.s32 d24, q12\n"
"vmov.s16 %[ret], d24[0]\n"
: [ret] "=&r" (ret)
: [a] "r" (a)
: "q12", "d24", "d25" );
return ret;
}
#else
static inline int32_t saturate_32bit_to_16bit(int32_t a) {
return max(-32768, min(32767, a));
}
#endif
To test it I wrote a stand alone test and ran it via adb.
Anyone able to help with review/integration?
There are 4 functions in resample_neon.h thats just the first/easiest.
Post by Evan JIANG
Hi all,
I build successfully with speex-1.2rc2. And with speexdsp 1.2rc3, I
build with i386, X86_64, armv7 and armv7s all passed.
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-recursive
Making all in libspeexdsp
CC preprocess.lo
CC jitter.lo
CC mdf.lo
CC fftwrap.lo
CC filterbank.lo
CC resample.lo
./resample_neon.h:134:12: error: unknown register name 'q0' in asm
: "q0");
^
./resample_neon.h:195:13: error: invalid output constraint '+l' in asm
[len] "+l" (len), [remainder] "+l" (remainder)
^
2 errors generated.
make[2]: *** [resample.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
arm64 has a totally different instruction set.
See: http://people.linaro.org/~rikuvoipio/aarch64-talk/
The NEON assembly code needs a rewrite.
But I'm not familiar with ASM code. Could anyone help to fix that?
Best regards,
Evan JIANG
_______________________________________________
Speex-dev mailing list
http://lists.xiph.org/mailman/listinfo/speex-dev
_______________________________________________
Speex-dev mailing list
http://lists.xiph.org/mailman/listinfo/speex-dev
Loading...