Bug 460616 - disInstr(arm64): unhandled instruction 0x4E819402 (dotprod/ASIMDDP)
Summary: disInstr(arm64): unhandled instruction 0x4E819402 (dotprod/ASIMDDP)
Status: RESOLVED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: memcheck (show other bugs)
Version: 3.20 GIT
Platform: RedHat Enterprise Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
: 484742 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-10-17 18:26 UTC by edeturk32
Modified: 2024-04-01 18:22 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
archive containing sdot.c and valgrind output (1.31 KB, application/x-compressed)
2022-10-17 18:26 UTC, edeturk32
Details
Patch to add FEAT_DotProd support (12.83 KB, text/plain)
2023-07-27 15:25 UTC, William Ashley
Details
Patch to add FEAT_DotProd support (13.51 KB, text/plain)
2023-08-01 20:24 UTC, William Ashley
Details

Note You need to log in before you can comment on or make changes to this bug.
Description edeturk32 2022-10-17 18:26:38 UTC
Created attachment 152956 [details]
archive containing sdot.c and valgrind output

The instruction is Arm64 SIMD sdot (vector):
https://developer.arm.com/documentation/100069/0609/A64-SIMD-Vector-Instructions/SDOT--vector-

Decoding specification can be found in the Arm Architecture Reference manual:
https://developer.arm.com/documentation/ddi0487/latest

I'm using a machine that supports this instruction. The process does not receive a SIGILL when I run the program without valgrind

STEPS TO REPRODUCE
1. Compile the attached source file with "gcc -march='armv8.2-a+dotprod' -o sdot -c sdot.c" with gcc 9
2. Run "valgrind --tool=memcheck sdot"
3. Disassemble at the unhandled instruction address, e.g. "objdump --disassemble --start-address 0x4006ac --stop-address 0x4006b0 sdot"

Thanks for your help!
Comment 1 William Ashley 2023-07-27 15:25:28 UTC
Created attachment 160568 [details]
Patch to add FEAT_DotProd support

I have implemented support for the dot product instructions (more specifically those under the FEAT_DotProd feature). The attached patch file applies cleanly to 'master' as of this writing. I haven't yet figured out the 'correct' process for submitting changes to the valgrind project.
Comment 2 William Ashley 2023-07-31 14:50:30 UTC
On Friday I submitted the change to the valgrind-developers mailing list, https://sourceforge.net/p/valgrind/mailman/valgrind-developers/thread/ED40273D-295D-445C-8D97-9FC48F535932@amazon.com/
Comment 3 William Ashley 2023-08-01 20:24:34 UTC
Created attachment 160669 [details]
Patch to add FEAT_DotProd support
Comment 4 Mark Wielaard 2023-11-09 23:09:42 UTC
Found a cfarm machine that supports ASIMDDP.
Comment 5 Mark Wielaard 2023-11-10 16:57:04 UTC
This was a really good patch. Thanks.
Only added a NEWS entry, then pushed as:

commit f42b9a434e12bc14ec821183a69b86e91da0577c
Author: William Ashley <wash@amazon.com>
Date:   Fri Nov 10 17:51:12 2023 +0100

    Bug 460616 - Add support for aarch64 dotprod instructions
    
    This change adds support for the FEAT_DotProd instructions
    SDOT <Vd>.<Ta>, <Vn>.<Tb>, <Vm>.4B[<index>]
    SDOT <Vd>.<Ta>, <Vn>.<Tb>, <Vm>.<Tb>
    UDOT <Vd>.<Ta>, <Vn>.<Tb>, <Vm>.4B[<index>]
    UDOT <Vd>.<Ta>, <Vn>.<Tb>, <Vm>.<Tb>
Comment 6 William Ashley 2023-11-10 17:11:45 UTC
Thanks Mark!
Comment 7 Paul Floyd 2024-04-01 18:22:21 UTC
*** Bug 484742 has been marked as a duplicate of this bug. ***