Skip to contentSkip to conversation

x86emul/test: drop Xeon Phi S/G prefetch special case

PATCH In review Jan Beulich 3 participants 5 messages Oct 16, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86emul/test: drop Xeon Phi S/G prefetch special case

Another leftover from the dropping of Xeon Phi support.

---
Note: I'm deliberately not switching to use of the conditional operator, as the form as is resulting now is what we'll want for APX (which is where I noticed this small piece of dead logic).

tools/tests/x86_emulator/evex-disp8.c +1 -3
@@ -911,10 +911,8 @@ static void test_one(const struct test *
     n = test->scale == SC_vl ? vsz : esz;
     if ( !sg )
         n += vsz;
-    else if ( !strstr(test->mnemonic, "pf") )
-        n += esz;
     else
-        ++n;
+        n += esz;
 
     for ( ; i < n; ++i )
          if ( accessed[i] != (sg ? (vsz / esz) >> (test->opc & 1 & !evex.w)
#2 lore raw
In reply to Jan Beulich
Quoted 11 lines · Jan Beulich

Another leftover from the dropping of Xeon Phi support.

---
Note: I'm deliberately not switching to use of the conditional operator, as the form as is resulting now is what we'll want for APX (which is where I noticed this small piece of dead logic).

tools/tests/x86_emulator/evex-disp8.c static void test_one(const struct test * · line 915

Quoted 8 lines
tools/tests/x86_emulator/evex-disp8.c +1 -3
@@ -911,10 +911,8 @@ static void test_one(const struct test *
     n = test->scale == SC_vl ? vsz : esz;
     if ( !sg )
         n += vsz;
-    else if ( !strstr(test->mnemonic, "pf") )
-        n += esz;
     else
-        ++n;
+        n += esz;

Just making sure. This is leftover from 85191cf32180("x86: drop Xeon Phi support"), right? Dead code after the removal of the avx512pf group.

If so, that sounds good. But (not having looking at the general logic), how come we go from ++n to "n += esz". It's all quite cryptic.

tools/tests/x86_emulator/evex-disp8.c static void test_one(const struct test * · line 918

Quoted 3 lines
tools/tests/x86_emulator/evex-disp8.c +0 -0
     for ( ; i < n; ++i )
          if ( accessed[i] != (sg ? (vsz / esz) >> (test->opc & 1 & !evex.w)

Cheers,
Alejandro

#3 lore raw
Quoted 15 lines · Alejandro Vallejo

tools/tests/x86_emulator/evex-disp8.c static void test_one(const struct test * · line 915

Quoted 11 lines · Jan Beulich
tools/tests/x86_emulator/evex-disp8.c +1 -3
@@ -911,10 +911,8 @@ static void test_one(const struct test *
     n = test->scale == SC_vl ? vsz : esz;
     if ( !sg )
         n += vsz;
-    else if ( !strstr(test->mnemonic, "pf") )
-        n += esz;
     else
-        ++n;
+        n += esz;

Just making sure. This is leftover from 85191cf32180("x86: drop Xeon Phi support"), right? Dead code after the removal of the avx512pf group.

Yes.

Quoted 2 lines

If so, that sounds good. But (not having looking at the general logic), how come we go from ++n to "n += esz". It's all quite cryptic.

It's the (prior) if() portion we're keeping, and the "else" we're dropping. The if() checks for _no_ "pf" in the mnemonic. "Going from ++n to n+= esz" is merely an effect of how the change is being expressed as diff.

Jan

#4 lore raw
Quoted 19 lines · Jan Beulich
Quoted 15 lines · Alejandro Vallejo

tools/tests/x86_emulator/evex-disp8.c static void test_one(const struct test * · line 915

Quoted 11 lines · Jan Beulich
tools/tests/x86_emulator/evex-disp8.c +1 -3
@@ -911,10 +911,8 @@ static void test_one(const struct test *
     n = test->scale == SC_vl ? vsz : esz;
     if ( !sg )
         n += vsz;
-    else if ( !strstr(test->mnemonic, "pf") )
-        n += esz;
     else
-        ++n;
+        n += esz;

Just making sure. This is leftover from 85191cf32180("x86: drop Xeon Phi support"), right? Dead code after the removal of the avx512pf group.

Yes.

Quoted 8 lines
Quoted 2 lines

If so, that sounds good. But (not having looking at the general logic), how come we go from ++n to "n += esz". It's all quite cryptic.

It's the (prior) if() portion we're keeping, and the "else" we're dropping. The if() checks for _no_ "pf" in the mnemonic. "Going from ++n to n+= esz" is merely an effect of how the change is being expressed as diff.

Jan

Bah, misremembered strstr() being used like strcmp() on match, but of course that makes no sense with the substring being returned. Thanks for spelling it out :)

Cheers,
Alejandro