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

Side by Side Diff: third_party/WebKit/Source/wtf/CPU.h

Issue 1436153002: Apply clang-format with Chromium-style without column limit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2013 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2013 Apple Inc. All rights reserved.
3 * Copyright (C) 2007-2009 Torch Mobile, Inc. 3 * Copyright (C) 2007-2009 Torch Mobile, Inc.
4 * Copyright (C) 2010, 2011 Research In Motion Limited. All rights reserved. 4 * Copyright (C) 2010, 2011 Research In Motion Limited. All rights reserved.
5 * Copyright (C) 2013 Samsung Electronics. All rights reserved. 5 * Copyright (C) 2013 Samsung Electronics. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 14 matching lines...) Expand all
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */ 27 */
28 28
29 #ifndef WTF_CPU_h 29 #ifndef WTF_CPU_h
30 #define WTF_CPU_h 30 #define WTF_CPU_h
31 31
32 #include "wtf/Compiler.h" 32 #include "wtf/Compiler.h"
33 33
34 /* CPU() - the target CPU architecture */ 34 /* CPU() - the target CPU architecture */
35 #define CPU(WTF_FEATURE) (defined WTF_CPU_##WTF_FEATURE && WTF_CPU_##WTF_FEATUR E) 35 #define CPU(WTF_FEATURE) (defined WTF_CPU_##WTF_FEATURE && WTF_CPU_##WTF_FEATURE )
36 36
37 /* ==== CPU() - the target CPU architecture ==== */ 37 /* ==== CPU() - the target CPU architecture ==== */
38 38
39 /* This defines CPU(BIG_ENDIAN) or nothing, as appropriate. */ 39 /* This defines CPU(BIG_ENDIAN) or nothing, as appropriate. */
40 /* This defines CPU(32BIT) or CPU(64BIT), as appropriate. */ 40 /* This defines CPU(32BIT) or CPU(64BIT), as appropriate. */
41 41
42 /* CPU(X86) - i386 / x86 32-bit */ 42 /* CPU(X86) - i386 / x86 32-bit */
43 #if defined(__i386__) \ 43 #if defined(__i386__) || defined(i386) || defined(_M_IX86) || defined(_X86_) || defined(__THW_INTEL)
44 || defined(i386) \
45 || defined(_M_IX86) \
46 || defined(_X86_) \
47 || defined(__THW_INTEL)
48 #define WTF_CPU_X86 1 44 #define WTF_CPU_X86 1
49 #endif 45 #endif
50 46
51 /* CPU(X86_64) - AMD64 / Intel64 / x86_64 64-bit */ 47 /* CPU(X86_64) - AMD64 / Intel64 / x86_64 64-bit */
52 #if defined(__x86_64__) \ 48 #if defined(__x86_64__) || defined(_M_X64)
53 || defined(_M_X64)
54 #define WTF_CPU_X86_64 1 49 #define WTF_CPU_X86_64 1
55 #define WTF_CPU_64BIT 1 50 #define WTF_CPU_64BIT 1
56 #endif 51 #endif
57 52
58 /* CPU(ARM) - ARM, any version*/ 53 /* CPU(ARM) - ARM, any version*/
59 #define WTF_ARM_ARCH_AT_LEAST(N) (CPU(ARM) && defined(WTF_ARM_ARCH_VERSION) && W TF_ARM_ARCH_VERSION >= N) 54 #define WTF_ARM_ARCH_AT_LEAST(N) (CPU(ARM) && defined(WTF_ARM_ARCH_VERSION) && W TF_ARM_ARCH_VERSION >= N)
60 55
61 #if defined(arm) \ 56 #if defined(arm) || defined(__arm__) || defined(ARM) || defined(_ARM_)
62 || defined(__arm__) \
63 || defined(ARM) \
64 || defined(_ARM_)
65 #define WTF_CPU_ARM 1 57 #define WTF_CPU_ARM 1
66 58
67 #if defined(__ARMEB__) 59 #if defined(__ARMEB__)
68 #define WTF_CPU_BIG_ENDIAN 1 60 #define WTF_CPU_BIG_ENDIAN 1
69 61
70 #elif !defined(__ARM_EABI__) \ 62 #elif !defined(__ARM_EABI__) && !defined(__EABI__) && !defined(__VFP_FP__) && !d efined(_WIN32_WCE) && !defined(ANDROID)
71 && !defined(__EABI__) \
72 && !defined(__VFP_FP__) \
73 && !defined(_WIN32_WCE) \
74 && !defined(ANDROID)
75 #define WTF_CPU_MIDDLE_ENDIAN 1 63 #define WTF_CPU_MIDDLE_ENDIAN 1
76 64
77 #endif 65 #endif
78 66
79 /* Set WTF_ARM_ARCH_VERSION */ 67 /* Set WTF_ARM_ARCH_VERSION */
80 #if defined(__ARM_ARCH_4__) \ 68 #if defined(__ARM_ARCH_4__) || defined(__ARM_ARCH_4T__) || defined(__MARM_ARMV4_ _)
81 || defined(__ARM_ARCH_4T__) \
82 || defined(__MARM_ARMV4__)
83 #define WTF_ARM_ARCH_VERSION 4 69 #define WTF_ARM_ARCH_VERSION 4
84 70
85 #elif defined(__ARM_ARCH_5__) \ 71 #elif defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_5T__) || defined(__MARM_ARMV 5__)
86 || defined(__ARM_ARCH_5T__) \
87 || defined(__MARM_ARMV5__)
88 #define WTF_ARM_ARCH_VERSION 5 72 #define WTF_ARM_ARCH_VERSION 5
89 73
90 #elif defined(__ARM_ARCH_5E__) \ 74 #elif defined(__ARM_ARCH_5E__) || defined(__ARM_ARCH_5TE__) || defined(__ARM_ARC H_5TEJ__)
91 || defined(__ARM_ARCH_5TE__) \
92 || defined(__ARM_ARCH_5TEJ__)
93 #define WTF_ARM_ARCH_VERSION 5 75 #define WTF_ARM_ARCH_VERSION 5
94 76
95 #elif defined(__ARM_ARCH_6__) \ 77 #elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_ 6K__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) || defined(__ARM_ ARCH_6T2__) || defined(__ARMV6__)
96 || defined(__ARM_ARCH_6J__) \
97 || defined(__ARM_ARCH_6K__) \
98 || defined(__ARM_ARCH_6Z__) \
99 || defined(__ARM_ARCH_6ZK__) \
100 || defined(__ARM_ARCH_6T2__) \
101 || defined(__ARMV6__)
102 #define WTF_ARM_ARCH_VERSION 6 78 #define WTF_ARM_ARCH_VERSION 6
103 79
104 #elif defined(__ARM_ARCH_7A__) \ 80 #elif defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH _7S__)
105 || defined(__ARM_ARCH_7R__) \
106 || defined(__ARM_ARCH_7S__)
107 #define WTF_ARM_ARCH_VERSION 7 81 #define WTF_ARM_ARCH_VERSION 7
108 82
109 /* MSVC sets _M_ARM */ 83 /* MSVC sets _M_ARM */
110 #elif defined(_M_ARM) 84 #elif defined(_M_ARM)
111 #define WTF_ARM_ARCH_VERSION _M_ARM 85 #define WTF_ARM_ARCH_VERSION _M_ARM
112 #else 86 #else
113 #define WTF_ARM_ARCH_VERSION 0 87 #define WTF_ARM_ARCH_VERSION 0
114 88
115 #endif 89 #endif
116 90
117 /* Set WTF_THUMB_ARCH_VERSION */ 91 /* Set WTF_THUMB_ARCH_VERSION */
118 #if defined(__ARM_ARCH_4T__) 92 #if defined(__ARM_ARCH_4T__)
119 #define WTF_THUMB_ARCH_VERSION 1 93 #define WTF_THUMB_ARCH_VERSION 1
120 94
121 #elif defined(__ARM_ARCH_5T__) \ 95 #elif defined(__ARM_ARCH_5T__) || defined(__ARM_ARCH_5TE__) || defined(__ARM_ARC H_5TEJ__)
122 || defined(__ARM_ARCH_5TE__) \
123 || defined(__ARM_ARCH_5TEJ__)
124 #define WTF_THUMB_ARCH_VERSION 2 96 #define WTF_THUMB_ARCH_VERSION 2
125 97
126 #elif defined(__ARM_ARCH_6J__) \ 98 #elif defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH _6Z__) || defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_6M__)
127 || defined(__ARM_ARCH_6K__) \
128 || defined(__ARM_ARCH_6Z__) \
129 || defined(__ARM_ARCH_6ZK__) \
130 || defined(__ARM_ARCH_6M__)
131 #define WTF_THUMB_ARCH_VERSION 3 99 #define WTF_THUMB_ARCH_VERSION 3
132 100
133 #elif defined(__ARM_ARCH_6T2__) \ 101 #elif defined(__ARM_ARCH_6T2__) || defined(__ARM_ARCH_7__) || defined(__ARM_ARCH _7A__) || defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ ARCH_7S__)
134 || defined(__ARM_ARCH_7__) \
135 || defined(__ARM_ARCH_7A__) \
136 || defined(__ARM_ARCH_7M__) \
137 || defined(__ARM_ARCH_7R__) \
138 || defined(__ARM_ARCH_7S__)
139 #define WTF_THUMB_ARCH_VERSION 4 102 #define WTF_THUMB_ARCH_VERSION 4
140 103
141 #else 104 #else
142 #define WTF_THUMB_ARCH_VERSION 0 105 #define WTF_THUMB_ARCH_VERSION 0
143 #endif 106 #endif
144 107
145
146 /* CPU(ARM_THUMB2) - Thumb2 instruction set is available */ 108 /* CPU(ARM_THUMB2) - Thumb2 instruction set is available */
147 #if !defined(WTF_CPU_ARM_THUMB2) 109 #if !defined(WTF_CPU_ARM_THUMB2)
148 # if defined(thumb2) || defined(__thumb2__) \ 110 #if defined(thumb2) || defined(__thumb2__) || ((defined(__thumb) || defined(__th umb__)) && WTF_THUMB_ARCH_VERSION == 4)
149 || ((defined(__thumb) || defined(__thumb__)) && WTF_THUMB_ARCH_VERSION == 4) 111 #define WTF_CPU_ARM_THUMB2 1
150 # define WTF_CPU_ARM_THUMB2 1 112 #elif WTF_ARM_ARCH_AT_LEAST(4)
151 # elif WTF_ARM_ARCH_AT_LEAST(4) 113 #define WTF_CPU_ARM_THUMB2 0
152 # define WTF_CPU_ARM_THUMB2 0 114 #else
153 # else 115 #error "Unsupported ARM architecture"
154 # error "Unsupported ARM architecture" 116 #endif
155 # endif
156 #endif /* !defined(WTF_CPU_ARM_THUMB2) */ 117 #endif /* !defined(WTF_CPU_ARM_THUMB2) */
157 118
158 #if defined(__ARM_NEON__) && !defined(WTF_CPU_ARM_NEON) 119 #if defined(__ARM_NEON__) && !defined(WTF_CPU_ARM_NEON)
159 #define WTF_CPU_ARM_NEON 1 120 #define WTF_CPU_ARM_NEON 1
160 #endif 121 #endif
161 122
162 #if CPU(ARM_NEON) && (!COMPILER(GCC) || GCC_VERSION_AT_LEAST(4, 7, 0)) 123 #if CPU(ARM_NEON) && (!COMPILER(GCC) || GCC_VERSION_AT_LEAST(4, 7, 0))
163 // All NEON intrinsics usage can be disabled by this macro. 124 // All NEON intrinsics usage can be disabled by this macro.
164 #define HAVE_ARM_NEON_INTRINSICS 1 125 #define HAVE_ARM_NEON_INTRINSICS 1
165 #endif 126 #endif
(...skipping 13 matching lines...) Expand all
179 /* This defines CPU(64BIT). */ 140 /* This defines CPU(64BIT). */
180 #if defined(__mips__) && (_MIPS_SIM == _ABI64) 141 #if defined(__mips__) && (_MIPS_SIM == _ABI64)
181 #define WTF_CPU_64BIT 1 142 #define WTF_CPU_64BIT 1
182 #endif 143 #endif
183 144
184 #if !defined(WTF_CPU_64BIT) 145 #if !defined(WTF_CPU_64BIT)
185 #define WTF_CPU_32BIT 1 146 #define WTF_CPU_32BIT 1
186 #endif 147 #endif
187 148
188 #endif /* WTF_CPU_h */ 149 #endif /* WTF_CPU_h */
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/wtf/ByteSwap.h ('k') | third_party/WebKit/Source/wtf/CheckedArithmetic.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698