Bug 514596

Summary: Add SSE4.1 BLENDPD instruction for x86 32 bit
Product: [Developer tools] valgrind Reporter: Alexandra Hajkova <ahajkova>
Component: generalAssignee: Alexandra Hajkova <ahajkova>
Status: ASSIGNED ---    
Severity: normal CC: mark
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: patch
patch
patch

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