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

Mark Wielaard <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #2 from Mark Wielaard <[email protected]> ---
(In reply to mcermak from comment #0)
> That said, since Valgrind's LZCNT could be advertised
> x86g_dirtyhelper_CPUID_sse0() technically (because BSR is so old), given that
> LZCNT was introduced in Haswell, a good place for it is
> x86g_dirtyhelper_CPUID_sse3().  Another option is to create a new
> dirtyhelper_CPUID function for it.  Tha attached patch uses the former
> approach.

I think another, different, approach is what amd64g_dirtyhelper_CPUID_avx2
does.
It takes arguments for whether or not the VEX_HWCAPS_AMD64 for F16C, RDRAND and
RDSEED are set.
I think that is more appropriate since whether or not we parse the LZCNT
instruction or not depends on whether  VEX_HWCAPS_X86_LZCNT is set.

This is slightly more work, you'll have to alter the args of the
unsafeIRDirty_0_N calling the helper and possibly only for the
x86g_dirtyhelper_CPUID_sse3 case. But the amd64g_dirtyhelper_CPUID_avx2 case in
VEX/priv/guest_amd64_toIR.c can be used as example how to do that.

(In reply to mcermak from comment #1)
> Created attachment 192680 [details]
> proposed patch
> [...]
> 
> LZCNT is not sowftare emulated instruction like e.g. POPCNT.
                           software

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

Reply via email to