On 03/10/2026 14:45, Ishan K wrote:
Hi,
This patch recognizes
acc + (long long) a[0] * b[0]
+ (long long) a[1] * b[1]
where a and b each contain two signed 16 bit values. GCC currently computes the two products separately. This patch lets GCC use one SMLALD instruction to perform both products and add them to acc in a single instruction.
The attached patch includes the implementation, regression tests,
ChangeLog entries and testing results.
I do not have GCC write access.
Thanks,
Ishan Kumthekar
Hi Ishan,
Thanks for sending the patch. I had a look at it, but I don't think
this is the right way to set about tackling this issue. Peephole2
patterns are notoriously flaky in when they get applied and the idiom
here is really a generic sdot_prod operation that should be matched and
applied by the mid-end, probably during auto-vectorization.
I had a quick look at the mid-end code, but I can't quickly see why it
is not detecting this case, though that in itself would not be enough to
make the Arm backend expand this.
I've created https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127909 to
track this issue.
R.