Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
|
robertphillips
2013/07/12 14:01:40
2013?
djsollen
2013/07/12 14:43:27
Done.
| |
| 2 # Use of this source code is governed by a BSD-style license that can be | |
| 3 # found in the LICENSE file. | |
| 4 | |
| 5 { | |
|
robertphillips
2013/07/12 14:01:40
# This file manages the platform-specific optimiza
djsollen
2013/07/12 14:43:27
Done.
| |
| 6 'targets': [ | |
| 7 # Due to an unfortunate intersection of lameness between gcc and gyp, | |
| 8 # we have to build the *_SSE2.cpp files in a separate target. The | |
| 9 # gcc lameness is that, in order to compile SSE2 intrinsics code, it | |
| 10 # must be passed the -msse2 flag. However, with this flag, it may | |
| 11 # emit SSE2 instructions even for scalar code, such as the CPUID | |
| 12 # test used to test for the presence of SSE2. So that, and all other | |
| 13 # code must be compiled *without* -msse2. The gyp lameness is that it | |
| 14 # does not allow file-specific CFLAGS, so we must create this extra | |
| 15 # target for those files to be compiled with -msse2. | |
| 16 # | |
| 17 # This is actually only a problem on 32-bit Linux (all Intel Macs have | |
| 18 # SSE2, Linux x86_64 has SSE2 by definition, and MSC will happily emit | |
| 19 # SSE2 from instrinsics, which generating plain ol' 386 for everything | |
| 20 # else). However, to keep the .gyp file simple and avoid platform-specific | |
| 21 # build breakage, we do this on all platforms. | |
| 22 | |
| 23 # For about the same reason, we need to compile the ARM opts files | |
| 24 # separately as well. | |
| 25 { | |
| 26 'target_name': 'skia_opts', | |
| 27 'type': 'static_library', | |
| 28 'include_dirs': [ | |
| 29 'config', | |
| 30 '../third_party/skia/include/config', | |
| 31 '../third_party/skia/include/core', | |
| 32 '../third_party/skia/src/core', | |
| 33 '../third_party/skia/src/opts', | |
| 34 ], | |
| 35 'conditions': [ | |
| 36 [ 'os_posix == 1 and OS != "mac" and OS != "android" and \ | |
| 37 target_arch != "arm" and target_arch != "mipsel"', { | |
| 38 'cflags': [ | |
| 39 '-msse2', | |
| 40 ], | |
| 41 }], | |
| 42 [ 'target_arch != "arm" and target_arch != "mipsel"', { | |
| 43 'sources': [ | |
| 44 '../third_party/skia/src/opts/SkBitmapProcState_opts_SSE2.cpp', | |
| 45 '../third_party/skia/src/opts/SkBlitRect_opts_SSE2.cpp', | |
| 46 '../third_party/skia/src/opts/SkBlitRow_opts_SSE2.cpp', | |
| 47 '../third_party/skia/src/opts/SkUtils_opts_SSE2.cpp', | |
| 48 '../third_party/skia/src/opts/SkBitmapFilter_opts_SSE2.cpp', | |
| 49 ], | |
| 50 'conditions': [ | |
| 51 # x86 Android doesn't support SSSE3 instructions. | |
| 52 [ 'OS != "android"', { | |
| 53 'dependencies': [ | |
| 54 'skia_opts_ssse3', | |
| 55 ], | |
| 56 }], | |
| 57 ], | |
| 58 }], | |
| 59 [ 'target_arch == "arm"', { | |
| 60 'conditions': [ | |
| 61 [ 'arm_version >= 7 and arm_neon == 1', { | |
| 62 'defines': [ | |
| 63 '__ARM_HAVE_NEON', | |
| 64 ], | |
| 65 }], | |
| 66 [ 'arm_version >= 7 and arm_neon_optional == 1', { | |
| 67 'defines': [ | |
| 68 '__ARM_HAVE_OPTIONAL_NEON_SUPPORT', | |
| 69 ], | |
| 70 }], | |
| 71 [ 'arm_version >= 7 and (arm_neon == 1 or arm_neon_optional == 1)', { | |
| 72 'cflags': [ | |
| 73 # The neon assembly contains conditional instructions which | |
| 74 # aren't enclosed in an IT block. The assembler complains | |
| 75 # without this option. | |
| 76 # See #86592. | |
| 77 '-Wa,-mimplicit-it=always', | |
| 78 ], | |
| 79 'dependencies': [ | |
| 80 'skia_opts_neon', | |
| 81 ] | |
| 82 }], | |
| 83 ], | |
| 84 # The assembly uses the frame pointer register (r7 in Thumb/r11 in | |
| 85 # ARM), the compiler doesn't like that. Explicitly remove the | |
| 86 # -fno-omit-frame-pointer flag for Android, as that gets added to all | |
| 87 # targets via common.gypi. | |
| 88 'cflags!': [ | |
| 89 '-fno-omit-frame-pointer', | |
| 90 '-marm', | |
| 91 '-mapcs-frame', | |
| 92 ], | |
| 93 'cflags': [ | |
| 94 '-fomit-frame-pointer', | |
| 95 ], | |
| 96 'sources': [ | |
| 97 '../third_party/skia/src/opts/SkBitmapProcState_opts_arm.cpp', | |
| 98 ], | |
| 99 }], | |
| 100 [ 'target_arch == "arm" and (arm_version < 7 or (arm_neon == 0 and arm_n eon_optional == 1))', { | |
| 101 'sources': [ | |
| 102 '../third_party/skia/src/opts/memset.arm.S', | |
| 103 ], | |
| 104 }], | |
| 105 [ 'target_arch == "arm" and arm_version < 6', { | |
| 106 'sources': [ | |
| 107 '../third_party/skia/src/opts/SkBlitRow_opts_none.cpp', | |
| 108 '../third_party/skia/src/opts/SkUtils_opts_none.cpp', | |
| 109 ], | |
| 110 }], | |
| 111 [ 'target_arch == "arm" and arm_version >= 6', { | |
| 112 'sources': [ | |
| 113 '../third_party/skia/src/opts/SkBlitRow_opts_arm.cpp', | |
| 114 '../third_party/skia/src/opts/SkBlitRow_opts_arm.h', | |
| 115 '../third_party/skia/src/opts/opts_check_arm.cpp', | |
| 116 ], | |
| 117 }], | |
| 118 [ 'target_arch == "mipsel"',{ | |
| 119 'cflags': [ | |
| 120 '-fomit-frame-pointer', | |
| 121 ], | |
| 122 'sources': [ | |
| 123 '../third_party/skia/src/opts/SkBitmapProcState_opts_none.cpp', | |
| 124 '../third_party/skia/src/opts/SkBlitRow_opts_none.cpp', | |
| 125 '../third_party/skia/src/opts/SkUtils_opts_none.cpp', | |
| 126 ], | |
| 127 }], | |
| 128 ], | |
| 129 }, | |
| 130 # For the same lame reasons as what is done for skia_opts, we have to | |
| 131 # create another target specifically for SSSE3 code as we would not want | |
| 132 # to compile the SSE2 code with -mssse3 which would potentially allow | |
| 133 # gcc to generate SSSE3 code. | |
| 134 { | |
| 135 'target_name': 'skia_opts_ssse3', | |
| 136 'type': 'static_library', | |
| 137 'include_dirs': [ | |
| 138 '..', | |
| 139 'config', | |
| 140 '../third_party/skia/include/config', | |
| 141 '../third_party/skia/include/core', | |
| 142 '../third_party/skia/src/core', | |
| 143 ], | |
| 144 'conditions': [ | |
| 145 [ 'OS in ["linux", "freebsd", "openbsd", "solaris"]', { | |
| 146 'cflags': [ | |
| 147 '-mssse3', | |
| 148 ], | |
| 149 }], | |
| 150 [ 'OS == "mac"', { | |
| 151 'xcode_settings': { | |
| 152 'GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONS': 'YES', | |
| 153 }, | |
| 154 }], | |
| 155 [ 'OS == "win"', { | |
| 156 'include_dirs': [ | |
| 157 'config/win', | |
| 158 ], | |
| 159 'direct_dependent_settings': { | |
| 160 'include_dirs': [ | |
| 161 'config/win', | |
| 162 ], | |
| 163 }, | |
| 164 }], | |
| 165 [ 'target_arch != "arm" and target_arch != "mipsel"', { | |
| 166 'sources': [ | |
| 167 '../third_party/skia/src/opts/SkBitmapProcState_opts_SSSE3.cpp', | |
| 168 ], | |
| 169 }], | |
| 170 ], | |
| 171 }, | |
| 172 { | |
| 173 'target_name': 'skia_opts_none', | |
| 174 'type': 'static_library', | |
| 175 'include_dirs': [ | |
| 176 '..', | |
| 177 'config', | |
| 178 '../third_party/skia/include/config', | |
| 179 '../third_party/skia/include/core', | |
| 180 '../third_party/skia/src/core', | |
| 181 ], | |
| 182 'sources': [ | |
| 183 '../third_party/skia/src/opts/SkBitmapProcState_opts_none.cpp', | |
| 184 '../third_party/skia/src/opts/SkBlitRow_opts_none.cpp', | |
| 185 '../third_party/skia/src/opts/SkUtils_opts_none.cpp', | |
| 186 ], | |
| 187 }, | |
| 188 ], | |
| 189 'conditions': [ | |
| 190 # NEON code must be compiled with -mfpu=neon which also affects scalar | |
| 191 # code. To support dynamic NEON code paths, we need to build all | |
| 192 # NEON-specific sources in a separate static library. The situation | |
| 193 # is very similar to the SSSE3 one. | |
| 194 ['target_arch == "arm" and (arm_neon == 1 or arm_neon_optional == 1)', { | |
| 195 'targets': [ | |
| 196 { | |
| 197 'target_name': 'skia_opts_neon', | |
| 198 'type': 'static_library', | |
| 199 'include_dirs': [ | |
| 200 '..', | |
| 201 'config', | |
| 202 '../third_party/skia/include/core', | |
| 203 '../third_party/skia/src/core', | |
| 204 '../third_party/skia/src/opts', | |
| 205 ], | |
| 206 'cflags!': [ | |
| 207 '-fno-omit-frame-pointer', | |
| 208 '-mfpu=vfp', # remove them all, just in case. | |
| 209 '-mfpu=vfpv3', | |
| 210 '-mfpu=vfpv3-d16', | |
| 211 ], | |
| 212 'cflags': [ | |
| 213 '-mfpu=neon', | |
| 214 '-fomit-frame-pointer', | |
| 215 ], | |
| 216 'ldflags': [ | |
| 217 '-march=armv7-a', | |
| 218 '-Wl,--fix-cortex-a8', | |
| 219 ], | |
| 220 'sources': [ | |
| 221 '../third_party/skia/src/opts/memset16_neon.S', | |
| 222 '../third_party/skia/src/opts/memset32_neon.S', | |
| 223 '../third_party/skia/src/opts/SkBitmapProcState_arm_neon.cpp', | |
| 224 '../third_party/skia/src/opts/SkBitmapProcState_matrixProcs_neon.cpp ', | |
| 225 '../third_party/skia/src/opts/SkBitmapProcState_matrix_clamp_neon.h' , | |
| 226 '../third_party/skia/src/opts/SkBitmapProcState_matrix_repeat_neon.h ', | |
| 227 '../third_party/skia/src/opts/SkBlitRow_opts_arm_neon.cpp', | |
| 228 ], | |
| 229 'conditions': [ | |
| 230 ['arm_neon == 1', { | |
| 231 'defines': [ | |
| 232 '__ARM_HAVE_NEON', | |
| 233 ], | |
| 234 }], | |
| 235 ['arm_neon_optional == 1', { | |
| 236 'defines': [ | |
| 237 '__ARM_HAVE_OPTIONAL_NEON_SUPPORT', | |
| 238 ], | |
| 239 }], | |
| 240 ], | |
| 241 }, | |
| 242 ], | |
| 243 }], | |
| 244 ], | |
| 245 } | |
| OLD | NEW |