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

--- Comment #7 from Mark Wielaard <[email protected]> ---
(In reply to Martin Cermak from comment #6)
> Created attachment 196253 [details]
> proposed patch
> 
> This patch does test fine locally for me.  Please, review.

Looks good with two nitpicks:

+extern void  x86g_dirtyhelper_CPUID_sse42 ( VexGuestX86State*, UInt );

+void x86g_dirtyhelper_CPUID_sse42 ( VexGuestX86State* st,
+                                    UInt hasLZCNT )

The UInt (hasLZCNT) isn't needed or used.

And the code just below seems to also not expect or add that extra arg:

         if (fAddr == &x86g_dirtyhelper_CPUID_sse3) {
            Bool hasLZCNT = (archinfo->hwcaps & VEX_HWCAPS_X86_LZCNT) != 0;
            args = mkIRExprVec_2(IRExpr_GSPTR(),
                                 mkIRExpr_HWord(hasLZCNT ? 1 : 0));
         } else {
            args = mkIRExprVec_1(IRExpr_GSPTR());
         }
[...]
@@ -990,7 +994,17 @@ Bool VG_(machine_get_hwcaps)( void )
      va = VexArchX86;
      vai.endness = VexEndnessLE;

-     if (have_sse3 && have_sse2 && have_sse1 && have_mmxext) {
+     if (have_sse41 && have_sse42 && have_lzcnt && have_popcnt) {

I think technically this should be:

   if (have_sse41 && have_sse42 && have_lzcnt && have_popcnt
       && have_sse3 && have_sse2 && have_sse1 && have_mmxext) {

Although it is highly unlikely (impossible?) to not have sse1/2/3/mmx
while having sse42. But it follows the logic of the rest of the code.

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

Reply via email to