diff options
Diffstat (limited to 'deps/v8/test/cctest/test-assembler-ia32.cc')
-rw-r--r-- | deps/v8/test/cctest/test-assembler-ia32.cc | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/deps/v8/test/cctest/test-assembler-ia32.cc b/deps/v8/test/cctest/test-assembler-ia32.cc index 3285be46cc..b95fe619d1 100644 --- a/deps/v8/test/cctest/test-assembler-ia32.cc +++ b/deps/v8/test/cctest/test-assembler-ia32.cc @@ -1550,6 +1550,35 @@ TEST(DeoptExitSizeIsFixed) { } } +TEST(CpuFeatures_ProbeImpl) { + // Support for a newer extension implies support for the older extensions. + CHECK_IMPLIES(CpuFeatures::IsSupported(FMA3), CpuFeatures::IsSupported(AVX)); + CHECK_IMPLIES(CpuFeatures::IsSupported(AVX2), CpuFeatures::IsSupported(AVX)); + CHECK_IMPLIES(CpuFeatures::IsSupported(AVX), + CpuFeatures::IsSupported(SSE4_2)); + CHECK_IMPLIES(CpuFeatures::IsSupported(SSE4_2), + CpuFeatures::IsSupported(SSE4_1)); + CHECK_IMPLIES(CpuFeatures::IsSupported(SSE4_1), + CpuFeatures::IsSupported(SSSE3)); + CHECK_IMPLIES(CpuFeatures::IsSupported(SSSE3), + CpuFeatures::IsSupported(SSE3)); + + // Check the reverse, if an older extension is not supported, a newer + // extension cannot be supported. + CHECK_IMPLIES(!CpuFeatures::IsSupported(SSE3), + !CpuFeatures::IsSupported(SSSE3)); + CHECK_IMPLIES(!CpuFeatures::IsSupported(SSSE3), + !CpuFeatures::IsSupported(SSE4_1)); + CHECK_IMPLIES(!CpuFeatures::IsSupported(SSE4_1), + !CpuFeatures::IsSupported(SSE4_2)); + CHECK_IMPLIES(!CpuFeatures::IsSupported(SSE4_2), + !CpuFeatures::IsSupported(AVX)); + CHECK_IMPLIES(!CpuFeatures::IsSupported(AVX), + !CpuFeatures::IsSupported(AVX2)); + CHECK_IMPLIES(!CpuFeatures::IsSupported(AVX), + !CpuFeatures::IsSupported(FMA3)); +} + #undef __ } // namespace internal |