Index: src/opts/opts_check_x86.cpp |
diff --git a/src/opts/opts_check_x86.cpp b/src/opts/opts_check_x86.cpp |
index 6af47729cd06a59bd973c0e8621c7dcddc5d6268..b94969890d1f540e982d696452fc772286d3c84f 100644 |
--- a/src/opts/opts_check_x86.cpp |
+++ b/src/opts/opts_check_x86.cpp |
@@ -12,6 +12,7 @@ |
#include "SkBlitRect_opts_SSE2.h" |
#include "SkBlitRow.h" |
#include "SkBlitRow_opts_SSE2.h" |
+#include "SkBlitRow_opts_SSE4.h" |
#include "SkBlurImage_opts_SSE2.h" |
#include "SkMorphology_opts.h" |
#include "SkMorphology_opts_SSE2.h" |
@@ -82,6 +83,8 @@ static int get_SIMD_level() { |
getcpuid(1, cpu_info); |
if ((cpu_info[2] & (1<<20)) != 0) { |
return SK_CPU_SSE_LEVEL_SSE42; |
+ } else if ((cpu_info[2] & (1<<19)) != 0) { |
+ return SK_CPU_SSE_LEVEL_SSE41; |
} else if ((cpu_info[2] & (1<<9)) != 0) { |
return SK_CPU_SSE_LEVEL_SSSE3; |
} else if ((cpu_info[3] & (1<<26)) != 0) { |
@@ -206,16 +209,30 @@ SkBlitRow::Proc SkBlitRow::PlatformProcs565(unsigned flags) { |
} |
} |
-static SkBlitRow::Proc32 platform_32_procs[] = { |
+static SkBlitRow::Proc32 platform_32_procs_SSE2[] = { |
NULL, // S32_Opaque, |
S32_Blend_BlitRow32_SSE2, // S32_Blend, |
S32A_Opaque_BlitRow32_SSE2, // S32A_Opaque |
S32A_Blend_BlitRow32_SSE2, // S32A_Blend, |
}; |
+#if defined(SK_ATT_ASM_SUPPORTED) |
+static SkBlitRow::Proc32 platform_32_procs_SSE4[] = { |
+ NULL, // S32_Opaque, |
+ S32_Blend_BlitRow32_SSE2, // S32_Blend, |
+ S32A_Opaque_BlitRow32_SSE4_asm, // S32A_Opaque |
+ S32A_Blend_BlitRow32_SSE2, // S32A_Blend, |
+}; |
+#endif |
+ |
SkBlitRow::Proc32 SkBlitRow::PlatformProcs32(unsigned flags) { |
+#if defined(SK_ATT_ASM_SUPPORTED) |
+ if (supports_simd(SK_CPU_SSE_LEVEL_SSE41)) { |
+ return platform_32_procs_SSE4[flags]; |
+ } else |
+#endif |
if (supports_simd(SK_CPU_SSE_LEVEL_SSE2)) { |
- return platform_32_procs[flags]; |
+ return platform_32_procs_SSE2[flags]; |
} else { |
return NULL; |
} |