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

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

Issue 1611343002: wtf reformat test Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pydent Created 4 years, 11 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
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) \
36 (defined WTF_CPU_##WTF_FEATURE && WTF_CPU_##WTF_FEATURE)
36 37
37 /* ==== CPU() - the target CPU architecture ==== */ 38 /* ==== CPU() - the target CPU architecture ==== */
38 39
39 /* This defines CPU(BIG_ENDIAN) or nothing, as appropriate. */ 40 /* This defines CPU(BIG_ENDIAN) or nothing, as appropriate. */
40 /* This defines CPU(32BIT) or CPU(64BIT), as appropriate. */ 41 /* This defines CPU(32BIT) or CPU(64BIT), as appropriate. */
41 42
42 /* CPU(X86) - i386 / x86 32-bit */ 43 /* CPU(X86) - i386 / x86 32-bit */
43 #if defined(__i386__) \ 44 #if defined(__i386__) || defined(i386) || defined(_M_IX86) || \
44 || defined(i386) \ 45 defined(_X86_) || defined(__THW_INTEL)
45 || defined(_M_IX86) \
46 || defined(_X86_) \
47 || defined(__THW_INTEL)
48 #define WTF_CPU_X86 1 46 #define WTF_CPU_X86 1
49 #endif 47 #endif
50 48
51 /* CPU(X86_64) - AMD64 / Intel64 / x86_64 64-bit */ 49 /* CPU(X86_64) - AMD64 / Intel64 / x86_64 64-bit */
52 #if defined(__x86_64__) \ 50 #if defined(__x86_64__) || defined(_M_X64)
53 || defined(_M_X64)
54 #define WTF_CPU_X86_64 1 51 #define WTF_CPU_X86_64 1
55 #define WTF_CPU_64BIT 1 52 #define WTF_CPU_64BIT 1
56 #endif 53 #endif
57 54
58 /* CPU(ARM) - ARM, any version*/ 55 /* 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) 56 #define WTF_ARM_ARCH_AT_LEAST(N) \
57 (CPU(ARM) && defined(WTF_ARM_ARCH_VERSION) && WTF_ARM_ARCH_VERSION >= N)
60 58
61 #if defined(arm) \ 59 #if defined(arm) || defined(__arm__) || defined(ARM) || defined(_ARM_)
62 || defined(__arm__) \
63 || defined(ARM) \
64 || defined(_ARM_)
65 #define WTF_CPU_ARM 1 60 #define WTF_CPU_ARM 1
66 61
67 #if defined(__ARMEB__) 62 #if defined(__ARMEB__)
68 #define WTF_CPU_BIG_ENDIAN 1 63 #define WTF_CPU_BIG_ENDIAN 1
69 64
70 #elif !defined(__ARM_EABI__) \ 65 #elif !defined(__ARM_EABI__) && !defined(__EABI__) && !defined(__VFP_FP__) && \
71 && !defined(__EABI__) \ 66 !defined(_WIN32_WCE) && !defined(ANDROID)
72 && !defined(__VFP_FP__) \
73 && !defined(_WIN32_WCE) \
74 && !defined(ANDROID)
75 #define WTF_CPU_MIDDLE_ENDIAN 1 67 #define WTF_CPU_MIDDLE_ENDIAN 1
76 68
77 #endif 69 #endif
78 70
79 /* Set WTF_ARM_ARCH_VERSION */ 71 /* Set WTF_ARM_ARCH_VERSION */
80 #if defined(__ARM_ARCH_4__) \ 72 #if defined(__ARM_ARCH_4__) || defined(__ARM_ARCH_4T__) || \
81 || defined(__ARM_ARCH_4T__) \ 73 defined(__MARM_ARMV4__)
82 || defined(__MARM_ARMV4__)
83 #define WTF_ARM_ARCH_VERSION 4 74 #define WTF_ARM_ARCH_VERSION 4
84 75
85 #elif defined(__ARM_ARCH_5__) \ 76 #elif defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_5T__) || \
86 || defined(__ARM_ARCH_5T__) \ 77 defined(__MARM_ARMV5__)
87 || defined(__MARM_ARMV5__)
88 #define WTF_ARM_ARCH_VERSION 5 78 #define WTF_ARM_ARCH_VERSION 5
89 79
90 #elif defined(__ARM_ARCH_5E__) \ 80 #elif defined(__ARM_ARCH_5E__) || defined(__ARM_ARCH_5TE__) || \
91 || defined(__ARM_ARCH_5TE__) \ 81 defined(__ARM_ARCH_5TEJ__)
92 || defined(__ARM_ARCH_5TEJ__)
93 #define WTF_ARM_ARCH_VERSION 5 82 #define WTF_ARM_ARCH_VERSION 5
94 83
95 #elif defined(__ARM_ARCH_6__) \ 84 #elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || \
96 || defined(__ARM_ARCH_6J__) \ 85 defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) || \
97 || defined(__ARM_ARCH_6K__) \ 86 defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_6T2__) || \
98 || defined(__ARM_ARCH_6Z__) \ 87 defined(__ARMV6__)
99 || defined(__ARM_ARCH_6ZK__) \
100 || defined(__ARM_ARCH_6T2__) \
101 || defined(__ARMV6__)
102 #define WTF_ARM_ARCH_VERSION 6 88 #define WTF_ARM_ARCH_VERSION 6
103 89
104 #elif defined(__ARM_ARCH_7A__) \ 90 #elif defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7R__) || \
105 || defined(__ARM_ARCH_7R__) \ 91 defined(__ARM_ARCH_7S__)
106 || defined(__ARM_ARCH_7S__)
107 #define WTF_ARM_ARCH_VERSION 7 92 #define WTF_ARM_ARCH_VERSION 7
108 93
109 /* MSVC sets _M_ARM */ 94 /* MSVC sets _M_ARM */
110 #elif defined(_M_ARM) 95 #elif defined(_M_ARM)
111 #define WTF_ARM_ARCH_VERSION _M_ARM 96 #define WTF_ARM_ARCH_VERSION _M_ARM
112 #else 97 #else
113 #define WTF_ARM_ARCH_VERSION 0 98 #define WTF_ARM_ARCH_VERSION 0
114 99
115 #endif 100 #endif
116 101
117 /* Set WTF_THUMB_ARCH_VERSION */ 102 /* Set WTF_THUMB_ARCH_VERSION */
118 #if defined(__ARM_ARCH_4T__) 103 #if defined(__ARM_ARCH_4T__)
119 #define WTF_THUMB_ARCH_VERSION 1 104 #define WTF_THUMB_ARCH_VERSION 1
120 105
121 #elif defined(__ARM_ARCH_5T__) \ 106 #elif defined(__ARM_ARCH_5T__) || defined(__ARM_ARCH_5TE__) || \
122 || defined(__ARM_ARCH_5TE__) \ 107 defined(__ARM_ARCH_5TEJ__)
123 || defined(__ARM_ARCH_5TEJ__)
124 #define WTF_THUMB_ARCH_VERSION 2 108 #define WTF_THUMB_ARCH_VERSION 2
125 109
126 #elif defined(__ARM_ARCH_6J__) \ 110 #elif defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || \
127 || defined(__ARM_ARCH_6K__) \ 111 defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) || \
128 || defined(__ARM_ARCH_6Z__) \ 112 defined(__ARM_ARCH_6M__)
129 || defined(__ARM_ARCH_6ZK__) \
130 || defined(__ARM_ARCH_6M__)
131 #define WTF_THUMB_ARCH_VERSION 3 113 #define WTF_THUMB_ARCH_VERSION 3
132 114
133 #elif defined(__ARM_ARCH_6T2__) \ 115 #elif defined(__ARM_ARCH_6T2__) || defined(__ARM_ARCH_7__) || \
134 || defined(__ARM_ARCH_7__) \ 116 defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7M__) || \
135 || defined(__ARM_ARCH_7A__) \ 117 defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7S__)
136 || defined(__ARM_ARCH_7M__) \
137 || defined(__ARM_ARCH_7R__) \
138 || defined(__ARM_ARCH_7S__)
139 #define WTF_THUMB_ARCH_VERSION 4 118 #define WTF_THUMB_ARCH_VERSION 4
140 119
141 #else 120 #else
142 #define WTF_THUMB_ARCH_VERSION 0 121 #define WTF_THUMB_ARCH_VERSION 0
143 #endif 122 #endif
144 123
145
146 /* CPU(ARM_THUMB2) - Thumb2 instruction set is available */ 124 /* CPU(ARM_THUMB2) - Thumb2 instruction set is available */
147 #if !defined(WTF_CPU_ARM_THUMB2) 125 #if !defined(WTF_CPU_ARM_THUMB2)
148 # if defined(thumb2) || defined(__thumb2__) \ 126 #if defined(thumb2) || defined(__thumb2__) || \
149 || ((defined(__thumb) || defined(__thumb__)) && WTF_THUMB_ARCH_VERSION == 4) 127 ((defined(__thumb) || defined(__thumb__)) && WTF_THUMB_ARCH_VERSION == 4)
150 # define WTF_CPU_ARM_THUMB2 1 128 #define WTF_CPU_ARM_THUMB2 1
151 # elif WTF_ARM_ARCH_AT_LEAST(4) 129 #elif WTF_ARM_ARCH_AT_LEAST(4)
152 # define WTF_CPU_ARM_THUMB2 0 130 #define WTF_CPU_ARM_THUMB2 0
153 # else 131 #else
154 # error "Unsupported ARM architecture" 132 #error "Unsupported ARM architecture"
155 # endif 133 #endif
156 #endif /* !defined(WTF_CPU_ARM_THUMB2) */ 134 #endif /* !defined(WTF_CPU_ARM_THUMB2) */
157 135
158 #if defined(__ARM_NEON__) && !defined(WTF_CPU_ARM_NEON) 136 #if defined(__ARM_NEON__) && !defined(WTF_CPU_ARM_NEON)
159 #define WTF_CPU_ARM_NEON 1 137 #define WTF_CPU_ARM_NEON 1
160 #endif 138 #endif
161 139
162 #if CPU(ARM_NEON) && (!COMPILER(GCC) || GCC_VERSION_AT_LEAST(4, 7, 0)) 140 #if CPU(ARM_NEON) && (!COMPILER(GCC) || GCC_VERSION_AT_LEAST(4, 7, 0))
163 // All NEON intrinsics usage can be disabled by this macro. 141 // All NEON intrinsics usage can be disabled by this macro.
164 #define HAVE_ARM_NEON_INTRINSICS 1 142 #define HAVE_ARM_NEON_INTRINSICS 1
165 #endif 143 #endif
(...skipping 16 matching lines...) Expand all
182 #define WTF_CPU_64BIT 1 160 #define WTF_CPU_64BIT 1
183 #elif defined(__mips__) 161 #elif defined(__mips__)
184 #define WTF_CPU_MIPS 1 162 #define WTF_CPU_MIPS 1
185 #endif 163 #endif
186 164
187 #if !defined(WTF_CPU_64BIT) 165 #if !defined(WTF_CPU_64BIT)
188 #define WTF_CPU_32BIT 1 166 #define WTF_CPU_32BIT 1
189 #endif 167 #endif
190 168
191 #endif /* WTF_CPU_h */ 169 #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