diff mbox series

[RFC,v4,16/75] target/i386: disable AVX/AVX2 cpuid bitchecks

Message ID 20190821172951.15333-17-jan.bobek@gmail.com (mailing list archive)
State New, archived
Headers show
Series rewrite MMX/SSE*/AVX/AVX2 vector instruction translation | expand

Commit Message

Jan Bobek Aug. 21, 2019, 5:28 p.m. UTC
Ignore the AVX/AVX2 cpuid bits when checking for availability of the
relevant instructions. This is clearly incorrect, but it preserves the
old behavior, which is useful during development.

Note: This changeset is intended for development only and shall not be
included in the final patch series.

Signed-off-by: Jan Bobek <jan.bobek@gmail.com>
---
 target/i386/translate.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/target/i386/translate.c b/target/i386/translate.c
index 3e54443d99..e7c2ad41bf 100644
--- a/target/i386/translate.c
+++ b/target/i386/translate.c
@@ -4564,15 +4564,15 @@  static bool check_cpuid(CPUX86State *env, DisasContext *s, CheckCpuidFeat feat)
     case CHECK_CPUID_PCLMULQDQ:
         return s->cpuid_ext_features & CPUID_EXT_PCLMULQDQ;
     case CHECK_CPUID_AVX:
-        return s->cpuid_ext_features & CPUID_EXT_AVX;
+        return true /* s->cpuid_ext_features & CPUID_EXT_AVX */;
     case CHECK_CPUID_AES_AVX:
-        return (s->cpuid_ext_features & CPUID_EXT_AES)
-            && (s->cpuid_ext_features & CPUID_EXT_AVX);
+        return s->cpuid_ext_features & CPUID_EXT_AES
+            /* && (s->cpuid_ext_features & CPUID_EXT_AVX) */;
     case CHECK_CPUID_PCLMULQDQ_AVX:
-        return (s->cpuid_ext_features & CPUID_EXT_PCLMULQDQ)
-            && (s->cpuid_ext_features & CPUID_EXT_AVX);
+        return s->cpuid_ext_features & CPUID_EXT_PCLMULQDQ
+            /* && (s->cpuid_ext_features & CPUID_EXT_AVX) */;
     case CHECK_CPUID_AVX2:
-        return s->cpuid_7_0_ebx_features & CPUID_7_0_EBX_AVX2;
+        return true /* s->cpuid_7_0_ebx_features & CPUID_7_0_EBX_AVX2 */;
     default:
         g_assert_not_reached();
     }