]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
tests/x86_amd_features.c: followup to 4810c14b5d
authorFlorian Krohm <flo2030@eich-krohm.de>
Thu, 24 Jul 2025 09:43:04 +0000 (09:43 +0000)
committerFlorian Krohm <flo2030@eich-krohm.de>
Thu, 24 Jul 2025 09:43:04 +0000 (09:43 +0000)
Do not rely on hardware identifying itself in a particular way.
Enable lzcnt for non-AMD hardware.

tests/x86_amd64_features.c

index 5a95e06df31a7cdc7a7d13016c76e6fbea9763d2..955cca13b07f5a6ee732fe69dc4cd7c9a9099120 100644 (file)
@@ -102,7 +102,6 @@ static Bool go(char* cpu)
    } else if ( strcmp( cpu, "x86-lzcnt" ) == 0 ) {
      level = 0x80000001;
      cmask = 1 << 5;
-     require_amd = True;
 #if defined(VGA_amd64)
    } else if ( strcmp( cpu, "amd64-sse3" ) == 0 ) {
      level = 1;
@@ -119,7 +118,6 @@ static Bool go(char* cpu)
    } else if ( strcmp( cpu, "amd64-lzcnt" ) == 0 ) {
      level = 0x80000001;
      cmask = 1 << 5;
-     require_amd = True;
    } else if ( strcmp( cpu, "amd64-sse42" ) == 0 ) {
      level = 1;
      cmask = 1 << 20;
@@ -148,8 +146,7 @@ static Bool go(char* cpu)
    assert( !(cmask != 0 && dmask != 0 && bmask != 0) );
    assert( !(cmask == 0 && dmask == 0 && bmask == 0) );
 
-   if (require_amd && !vendorStringEquals("AuthenticAMD") &&
-       !vendorStringEquals("GenuineIntel"))
+   if (require_amd && !vendorStringEquals("AuthenticAMD"))
       return FEATURE_NOT_PRESENT;
       // regardless of what that feature actually is