Bug 514596 - Add SSE4.1 BLENDPD instruction for x86 32 bit
Summary: Add SSE4.1 BLENDPD instruction for x86 32 bit
Status: ASSIGNED
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Alexandra Hajkova
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-01-14 14:51 UTC by Alexandra Hajkova
Modified: 2026-01-21 16:56 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
patch (19.23 KB, patch)
2026-01-14 14:53 UTC, Alexandra Hajkova
Details
patch (19.57 KB, patch)
2026-01-14 18:48 UTC, Alexandra Hajkova
Details
patch (22.22 KB, patch)
2026-01-21 16:56 UTC, Alexandra Hajkova
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandra Hajkova 2026-01-14 14:51:02 UTC
Add SSE4.1 BLENDPD instruction for x86 32 bit
Comment 1 Alexandra Hajkova 2026-01-14 14:53:35 UTC
Created attachment 188520 [details]
patch

Support blendpd (Blend Packed Double Precision Floating-Point
Values (XMM)) instruction in guest_x86_toIR.c. To be able to
use amd64 math_BLENDPD_128 function for x86 implementation, add
a new VEX/priv/guest_generic_sse.h header and move math_BLENDPD_128
there.

Add test function to sse4-common.h and update none/tests/x86/sse4-x86.c
to test the instruction.
Comment 2 Alexandra Hajkova 2026-01-14 18:48:11 UTC
Created attachment 188530 [details]
patch
Comment 3 Mark Wielaard 2026-01-16 12:34:50 UTC
I see you added priv/guest_generic_sse.h to Makefile.vex.am, good (although odd indentation).
It is missing a NEWS (bug) entry. 
Why are the guest_generic_sse.h includes in the middle of the files?
Can they be moved up to where we include other generic headers like guest_generic_x87.h?
Comment 4 Mark Wielaard 2026-01-16 12:44:52 UTC
(In reply to Mark Wielaard from comment #3)
> Why are the guest_generic_sse.h includes in the middle of the files?
> Can they be moved up to where we include other generic headers like
> guest_generic_x87.h?

OK, I see because you need newTemp, assign, mkV128, binop, unop, mkexpr, etc.
hmmm, maybe it isn't worth it to create a guest_generic_x87.h then, just keep the
math_BLENDPD_128 in guest_amd64_toIR.c and repeat it in guest_x86_toIR.c?

I don't really mind it being included at that odd place in the middle if you think
it will help reduce redundancy in the future for other shared sse shared functions.
But in that case please do document it clearly to list all requirements before it
can be included.
Comment 5 Alexandra Hajkova 2026-01-21 16:56:57 UTC
Created attachment 188756 [details]
patch