From: Julien Olivain via buildroot <buildroot@buildroot.org>
To: Michele Comignano <mcdev@playlinux.net>
Cc: Bernd Kuhls <bernd@kuhls.net>, buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH] package/opus: don't use vcvtaq_s32_f32 on 32 bit ARM
Date: Mon, 15 Jun 2026 19:47:05 +0200 [thread overview]
Message-ID: <f177ac01cfd1e52af17e06a2a44950df@free.fr> (raw)
In-Reply-To: <2c8f5ad9-1917-450c-a899-3bcdc130453b@app.fastmail.com>
Hi Michele,
On 15/06/2026 11:38, Michele Comignano wrote:
> Just noticed that I linked the wrong rust arm intrinsics docs.
> The right link is
> https://doc.rust-lang.org/core/arch/aarch64/fn.vcvtaq_s32_f32.html
> which matches gcc observations (arm 64 only).
> As for clang, the example code used another intrinsics, here is one
> using exactly vcvtaq_s32_f32 https://godbolt.org/z/31f1xnjvz, which
> also works.
>
> Kind regards,
> Michele
>
> Il Lun, 15 Giu 2026, alle ore 11:23, Michele Comignano ha scritto:
>
>> Thanks for all the hints! I tried going a bit deeper.
>>
>> Looking at GCC arm_neon.h
>>
> (https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/config/arm/arm_neon.h;h=6785dd2578a8ee0fd28b04d30934b764ea5fff3e;hb=HEAD),
>> vcvtaq_s32_f32 is not present, though the arm instrinsics search
>> suggests it is supported for the reference arch combo
>>
> https://developer.arm.com/architectures/instruction-sets/intrinsics/#f:@navigationhierarchiessimdisa=[Neon]&f:@navigationhierarchiesarchitectures=[A32]&q=vcvtaq_s32_f32
>> [1].
>>
>> In a way, the ifdef from opus seems to match arm documentation,
>> though GCC is not making it available.
>>
>> According to
>> https://gcc.gnu.org/pipermail/gcc-patches/2016-January/439845.html
>> the intrinsics vcvtaq_s32_f32 was added in circa 2016 to arm_neon.h,
>> yet reported as missing in circa 2020
>> https://gcc.gnu.org/pipermail/gcc-bugs/2020-May/703594.html.
>> The latter led to the creation of a GCC issue at
>> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95399 which still sits
>> new.
>>
>> Interesting enough, rust (I wanted to check some other compiler)
>> seems to match arm docs, though arm instrisics are deemed as
>> experimental
>> https://doc.rust-lang.org/core/arch/arm/fn.vcvtq_s32_f32.html.
>> Clang as well seems to support vcvtaq_s32_f32
>> https://godbolt.org/z/xsMfSz (link taken from from gcc bug at
>> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95399).
>>
>> So the problem seems to be GCC only.
>>
>> After all the research, the problem arguably sits in either upstream
>> gcc or opus, but as a matter of fact opus package build through
>> buildroot is currently broken on 32 bit arm neon.
>>
>> Do you think my proposed patch could apply as a buildroot-only quick
>> fix?
From Arm documentation, Armv8-A Aarch32 does support vcvtaq_s32_f32.
Gcc apparently does not support it in 32-bit, but clang does.
Since it seems it is just the gcc support which is missing, maybe
your patch could changed for upstream as:
/*
* 32bit Arm gcc does not support vcvtaq_s32_f32()
* See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71233
*/
#if defined(__aarch64__) || (defined(__ARM_ARCH) && (__ARM_ARCH >= 8) &&
defined(__clang__))
...
It does not really change anything in Buildroot, since there is
only Gcc. But for opus upstream, it will still allow other users
to keep using this on Armv8-A Aarch32.
Also, we try to avoid carrying Buildroot-specific package patches,
so it's better the fix is accepted upstream (your initial proposal,
or a revised one).
>> Best regards,
>> Michele
>>
>> Il Dom, 14 Giu 2026, alle ore 18:58, Julien Olivain via buildroot ha
>> scritto:
>>
>>> Hi Peter, All,
>>>
>>> On 14/06/2026 12:11, Peter Korsgaard wrote:
>>>>>>>>> "Michele" == Michele Comignano <mcdev@playlinux.net>
>>> writes:
>>>>
>>>>> From: Comick <mcdev@playlinux.net>
>>>>> Upstream issues is waiting for feedback.
>>>>
>>>>> See here for details:
>>>>> https://gitlab.xiph.org/xiph/opus/-/work_items/2397
>>>>
>>>>
>>>> Hmm, indeed - There is no vcvtaq_s32_f32 intrinsic in
>>>> gcc/config/arm/arm_neon.h but there is in
>>> gcc/config/aarch64/arm_neon.h
>>>> but I do not understand the finer details - Julien?
>>>
>>> Armv8-A Aarch32 is in fact a superset of Armv7-A. This is why
>>> there
>>> is few 32bit Armv8-A instructions which are not available in
>>> original
>>> Armv7-A.
>>>
>>> See the column "Supported architectures" in the following table:
>>>
>>
> https://arm-software.github.io/acle/neon_intrinsics/advsimd.html#conversions
>>>
>>> vcvtaq_s32_f32 is maked "A32/A64", whereas, for example
>>> vcvt_s32_f32 is marked "v7/A32/A64".
>>>
>>> There is also a search engine for intrinsics available at:
>>>
>> https://developer.arm.com/architectures/instruction-sets/intrinsics/
>>>
>>>>> Signed-off-by: Michele Comignano <mcdev@playlinux.net>
>>>>> ---
>>>>> ...use-vcvtaq_s32_f32-on-32-bit-systems.patch | 26
>>>> +++++++++++++++++++
>>>>> 1 file changed, 26 insertions(+)
>>>>> create mode 100644
>>>>
>>>
>>
> package/opus/0001-celt-arm-don-t-use-vcvtaq_s32_f32-on-32-bit-systems.patch
>>>>
>>>>> diff --git
>>>>
>>>
>>
> a/package/opus/0001-celt-arm-don-t-use-vcvtaq_s32_f32-on-32-bit-systems.patch
>>>
>>>>
>>>
>>
> b/package/opus/0001-celt-arm-don-t-use-vcvtaq_s32_f32-on-32-bit-systems.patch
>>>>> new file mode 100644
>>>>> index 0000000000..ddd572921f
>>>>> --- /dev/null
>>>>> +++
>>>>
>>>
>>
> b/package/opus/0001-celt-arm-don-t-use-vcvtaq_s32_f32-on-32-bit-systems.patch
>>>>> @@ -0,0 +1,26 @@
>>>>> +From 321532001d59367466a6a4a60f5c6f0fe5fa2176 Mon Sep 17
>>> 00:00:00
>>>> 2001
>>>>> +From: Comick <mcdev@playlinux.net>
>>>>> +Date: Sat, 13 Jun 2026 21:48:00 +0200
>>>>> +Subject: [PATCH] celt/arm don't use vcvtaq_s32_f32 on 32 bit
>>>
>>>> systems
>>>>> +Upstream: N/A
>>> https://gitlab.xiph.org/xiph/opus/-/work_items/2397
>>>>> +
>>>>> +---
>>>>> + celt/arm/mathops_arm.h | 2 +-
>>>>> + 1 file changed, 1 insertion(+), 1 deletion(-)
>>>>> +
>>>>> +diff --git a/celt/arm/mathops_arm.h b/celt/arm/mathops_arm.h
>>>>> +index b1f9169..c612dae 100644
>>>>> +--- a/celt/arm/mathops_arm.h
>>>>> ++++ b/celt/arm/mathops_arm.h
>>>>> +@@ -37,7 +37,7 @@
>>>>> +
>>>>> + static inline int32x4_t vroundf(float32x4_t x)
>>>>> + {
>>>>> +-# if defined(__aarch64__) || (defined(__ARM_ARCH) &&
>>> __ARM_ARCH
>>>>> = 8)
>>>>> ++# if defined(__aarch64__)
>>>>> + return vcvtaq_s32_f32(x);
>>>>> + # else
>>>>> + uint32x4_t sign = vandq_u32(vreinterpretq_u32_f32(x),
>>>> vdupq_n_u32(0x80000000));
>>>>> +--
>>>>> +2.54.0
>>>>> +
>>>>> --
>>>>
>>>>> 2.54.0
>>>>
>>>>> _______________________________________________
>>>>> buildroot mailing list
>>>>> buildroot@buildroot.org
>>>>> https://lists.buildroot.org/mailman/listinfo/buildroot
>>>>
>>>>
>>>> --
>>>> Bye, Peter Korsgaard
>>>
>>> Best regards,
>>>
>>> Julien.
>>> _______________________________________________
>>> buildroot mailing list
>>> buildroot@buildroot.org
>>> https://lists.buildroot.org/mailman/listinfo/buildroot
>>
>> _______________________________________________
>> buildroot mailing list
>> buildroot@buildroot.org
>> https://lists.buildroot.org/mailman/listinfo/buildroot
>
>
>
> Links:
> ------
> [1]
> https://developer.arm.com/architectures/instruction-sets/intrinsics/#f:@navigationhierarchiessimdisa=[Neon]&f:@navigationhierarchiesarchitectures=[A32]&q=vcvtaq_s32_f32
Best regards,
Julien.
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
prev parent reply other threads:[~2026-06-15 17:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-13 21:55 [Buildroot] [PATCH] package/opus: don't use vcvtaq_s32_f32 on 32 bit ARM Michele Comignano
2026-06-14 10:11 ` Peter Korsgaard
2026-06-14 16:58 ` Julien Olivain via buildroot
2026-06-15 9:23 ` Michele Comignano
2026-06-15 9:38 ` Michele Comignano
2026-06-15 17:47 ` Julien Olivain via buildroot [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f177ac01cfd1e52af17e06a2a44950df@free.fr \
--to=buildroot@buildroot.org \
--cc=bernd@kuhls.net \
--cc=ju.o@free.fr \
--cc=mcdev@playlinux.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox