From e0feeec03956ac7bf2733f3e9b394b006043f318 Mon Sep 17 00:00:00 2001 From: "vitalyr@chromium.org" Date: Tue, 28 Sep 2010 14:56:36 +0000 Subject: [PATCH] Mark ptest instruction as requiring SSE4.1. I also added a flag like the ones we have for other SSE versions. Review URL: http://codereview.chromium.org/3505003 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5548 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/flag-definitions.h | 2 ++ src/ia32/assembler-ia32.cc | 2 +- src/ia32/assembler-ia32.h | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/flag-definitions.h b/src/flag-definitions.h index 263a2a40d7..b075087870 100644 --- a/src/flag-definitions.h +++ b/src/flag-definitions.h @@ -108,6 +108,8 @@ DEFINE_bool(enable_sse2, true, "enable use of SSE2 instructions if available") DEFINE_bool(enable_sse3, true, "enable use of SSE3 instructions if available") +DEFINE_bool(enable_sse4_1, true, + "enable use of SSE4.1 instructions if available") DEFINE_bool(enable_cmov, true, "enable use of CMOV instruction if available") DEFINE_bool(enable_rdtsc, true, diff --git a/src/ia32/assembler-ia32.cc b/src/ia32/assembler-ia32.cc index e2f45470d7..e201179cd4 100644 --- a/src/ia32/assembler-ia32.cc +++ b/src/ia32/assembler-ia32.cc @@ -2414,7 +2414,7 @@ void Assembler::pxor(XMMRegister dst, XMMRegister src) { void Assembler::ptest(XMMRegister dst, XMMRegister src) { - ASSERT(CpuFeatures::IsEnabled(SSE2)); + ASSERT(CpuFeatures::IsEnabled(SSE4_1)); EnsureSpace ensure_space(this); last_pc_ = pc_; EMIT(0x66); diff --git a/src/ia32/assembler-ia32.h b/src/ia32/assembler-ia32.h index 1dab0a608c..d8051c8719 100644 --- a/src/ia32/assembler-ia32.h +++ b/src/ia32/assembler-ia32.h @@ -376,6 +376,7 @@ class CpuFeatures : public AllStatic { static bool IsSupported(CpuFeature f) { if (f == SSE2 && !FLAG_enable_sse2) return false; if (f == SSE3 && !FLAG_enable_sse3) return false; + if (f == SSE4_1 && !FLAG_enable_sse4_1) return false; if (f == CMOV && !FLAG_enable_cmov) return false; if (f == RDTSC && !FLAG_enable_rdtsc) return false; return (supported_ & (static_cast(1) << f)) != 0;