Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: media/base/cpu_features_x86.cc

Issue 7891039: Resubmit - Rewrite color space conversions suite using YASM" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/base/cpu_features.h ('k') | media/base/simd/convert_rgb_to_yuv_x86.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Code in this file is taked from 5 // Code in this file is taked from
6 // third_party/skia/src/opts/opts_check_SSE2.cpp. 6 // third_party/skia/src/opts/opts_check_SSE2.cpp.
7 7
8 // Note that this file cannot be compiled with -msse2 in gcc. 8 // Note that this file cannot be compiled with -msse2 in gcc.
9 9
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 30 matching lines...) Expand all
41 // does not use ebx (or rbx) as a GOT register. 41 // does not use ebx (or rbx) as a GOT register.
42 asm volatile ( 42 asm volatile (
43 "cpuid \n\t" 43 "cpuid \n\t"
44 : "=a"(info[0]), "=r"(info[1]), "=c"(info[2]), "=d"(info[3]) 44 : "=a"(info[0]), "=r"(info[1]), "=c"(info[2]), "=d"(info[3])
45 : "a"(info_type) 45 : "a"(info_type)
46 ); 46 );
47 #endif 47 #endif
48 } 48 }
49 #endif 49 #endif
50 50
51 bool hasMMX() {
52 // TODO(hclam): Acutually checks it.
53 return true;
54 }
55
56 bool hasSSE() {
57 // TODO(hclam): Actually checks it.
58 return true;
59 }
60
51 bool hasSSE2() { 61 bool hasSSE2() {
52 #if defined(ARCH_CPU_X86_64) 62 #if defined(ARCH_CPU_X86_64)
53 /* All x86_64 machines have SSE2, so don't even bother checking. */ 63 /* All x86_64 machines have SSE2, so don't even bother checking. */
54 return true; 64 return true;
55 #else 65 #else
56 int cpu_info[4] = { 0 }; 66 int cpu_info[4] = { 0 };
57 getcpuid(1, cpu_info); 67 getcpuid(1, cpu_info);
58 return (cpu_info[3] & (1<<26)) != 0; 68 return (cpu_info[3] & (1<<26)) != 0;
59 #endif 69 #endif
60 } 70 }
61 71
62 bool hasSSSE3() { 72 bool hasSSSE3() {
63 int cpu_info[4] = { 0 }; 73 int cpu_info[4] = { 0 };
64 getcpuid(1, cpu_info); 74 getcpuid(1, cpu_info);
65 return (cpu_info[3] & 0x04000000) != 0 && (cpu_info[2] & 0x00000001) != 0 && 75 return (cpu_info[3] & 0x04000000) != 0 && (cpu_info[2] & 0x00000001) != 0 &&
66 (cpu_info[2] & 0x00000200) != 0; 76 (cpu_info[2] & 0x00000200) != 0;
67 } 77 }
68 78
69 } // namespace media 79 } // namespace media
OLDNEW
« no previous file with comments | « media/base/cpu_features.h ('k') | media/base/simd/convert_rgb_to_yuv_x86.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698