https://bugs.kde.org/show_bug.cgi?id=521027
Bug ID: 521027
Summary: Advertise the LZCNT instruction conditionally
Classification: Developer tools
Product: valgrind
Version First 3.27 GIT
Reported In:
Platform: Other
OS: Linux
Status: REPORTED
Severity: normal
Priority: NOR
Component: vex
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
Per Bug 520753, the LZCNT instruction is advertised to x86 guests only if the
host CPU supports it. For the amd64 though, the instruction is advertised
unconditionally to all the avx2 guests:
---------------------------------------- 8<
---------------------------------------------
$ cat VEX/priv/guest_amd64_helpers.c | grep -A1 -e 'dirtyhelper_CPUID' -e
'0x80000001'
void amd64g_dirtyhelper_CPUID_baseline ( VexGuestAMD64State* st )
{
--
case 0x80000001:
/* Don't claim to support 3dnow or 3dnowext. 0xe1d3fbff is
--
void amd64g_dirtyhelper_CPUID_sse3_and_cx16 ( VexGuestAMD64State* st )
{
--
case 0x80000001:
SET_ABCD(0x00000000, 0x00000000, 0x00000001, 0x20100800);
--
void amd64g_dirtyhelper_CPUID_sse42_and_cx16 ( VexGuestAMD64State* st )
{
--
case 0x80000001:
SET_ABCD(0x00000000, 0x00000000, 0x00000001, 0x28100800);
--
void amd64g_dirtyhelper_CPUID_avx_and_cx16 ( VexGuestAMD64State* st,
ULong hasF16C, ULong hasRDRAND,
--
case 0x80000001:
SET_ABCD(0x00000000, 0x00000000, 0x00000001, 0x28100800);
--
void amd64g_dirtyhelper_CPUID_avx2 ( VexGuestAMD64State* st,
ULong hasF16C, ULong hasRDRAND,
--
case 0x80000001:
SET_ABCD(0x00000000, 0x00000000, 0x00000021, 0x2c100800);
$
---------------------------------------- 8<
---------------------------------------------
The very last line shows how LZCNT is advertised via ECX (0x00000021). Make it
conditional, similarly to the x86 case (Bug 520753).
--
You are receiving this mail because:
You are watching all bug changes.