https://bugs.kde.org/show_bug.cgi?id=521413

--- Comment #10 from Martin Cermak <[email protected]> ---
Created attachment 195534
  --> https://bugs.kde.org/attachment.cgi?id=195534&action=edit
WIP patch

(In reply to Mark Wielaard from comment #8)
> (In reply to mcermak from comment #7)
> > Created attachment 194647 [details]
> > proposed patch
> 
> - .gitignore new test, ack.
> - NEWS add bug, ack.
> - guest_x86_defs.h define x86g_dirtyhelper_PCMPxSTRx, ack.
> - VEX/priv/guest_x86_toIR.c. Add OFFB_XMM8. dis_PCMPxSTRx32
>   adapted from amd dis_PCMPxSTRx, takes isAvx but that is never used.

Commit 5c4989a3ed13f59 (branch users/mcermak/try-bug521413-pcmpxstrx)

>   could be dropped to simplify code. Comment still calls the pseudo-register
>   XMM16 in one place, but should be XMM8 for x86.

Commit 5c4989a3ed13f59 (branch users/mcermak/try-bug521413-pcmpxstrx)

> The special case for
>   dis_PCMPISTRI_3A is commented out and not implemented. I am not sure
>   I am following that case in the amd64 code either. Could you explain?

Explained in previous comment I believe.  Trying to address that...

I'm working with attached WIP patch.  It is a straightforward analogy of
the amd64 dis_PCMPISTRI_3A(). But it is missing implementation of
Iop_GetMSBs8x16 in host_x86_isel.c and I'm not there yet:

$ ./vg-in-place --partial-loads-ok=yes --track-origins=yes   ./test
==1740084== Memcheck, a memory error detector
==1740084== Copyright (C) 2002-2026, and GNU GPL'd, by Julian Seward et al.
==1740084== Using Valgrind-3.28.0.GIT and LibVEX; rerun with -h for copyright
info
==1740084== Command: ./test
==1740084== 
GetMSBs8x16(CmpNEZ8x16(t95))
vex: the `impossible' happened:
   iselIntExpr_R: cannot reduce tree
vex storage: T total 110594064 bytes allocated
vex storage: P total 448 bytes allocated

valgrind: the 'impossible' happened:
   LibVEX called failure_exit().

[ ... stuff deleted ... ]

>   The rest of the function looks correct. As does the actual instruction
>   detection.
> - VEX/pub/libvex_guest_x86.h. ack. Extend state with fake XMM8 reg.
> - VEX/priv/guest_x86_helpers.c. zmask_from_V128 and zmask_from_V128_wide
>   might be put in a shared header (as static inline), but that is not really
> necessary.
>   x86g_dirtyhelper_PCMPxSTRx comment says "fake XMM16 register" but that
> should
>   be "fake XMM8 register". 

Commit 5c4989a3ed13f59 (branch users/mcermak/try-bug521413-pcmpxstrx)

>  Code looks correct, it uses compute_PCMPxSTRx and
>   compute_PCMPxSTRx_wide which are already shared in guest_generic_x87.
> - none/tests/x86/Makefile.am, ack. Add new testcase. 
> - none/tests/x86/pcmpxstrx32.vgtest, prereq should test against x86-sse42
>   not amd64-sse42 to work on "pure" x86 32bit systems. Also it might be build
>   on systems where configure detects it cannot 
>   So prereq should be test -e  pcmpxstrx32 &&
> ../../../tests/x86_amd64_features x86-sse42
> - none/tests/x86/pcmpxstrx32.stdout.exp, ack, regenerates from native OK.
> - none/tests/x86/pcmpxstrx32.c looks like the correct adaption of
>   none/tests/amd64/pcmpxstrx64.c (offsets and regnames changed). OK.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to