epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 1 | { |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 2 | 'targets': [ |
| 3 | # Due to an unfortunate intersection of lameness between gcc and gyp, |
| 4 | # we have to build the *_SSE2.cpp files in a separate target. The |
| 5 | # gcc lameness is that, in order to compile SSE2 intrinsics code, it |
| 6 | # must be passed the -msse2 flag. However, with this flag, it may |
| 7 | # emit SSE2 instructions even for scalar code, such as the CPUID |
| 8 | # test used to test for the presence of SSE2. So that, and all other |
| 9 | # code must be compiled *without* -msse2. The gyp lameness is that it |
| 10 | # does not allow file-specific CFLAGS, so we must create this extra |
| 11 | # target for those files to be compiled with -msse2. |
| 12 | # |
| 13 | # This is actually only a problem on 32-bit Linux (all Intel Macs have |
| 14 | # SSE2, Linux x86_64 has SSE2 by definition, and MSC will happily emit |
| 15 | # SSE2 from instrinsics, while generating plain ol' 386 for everything |
| 16 | # else). However, to keep the .gyp file simple and avoid platform-specific |
| 17 | # build breakage, we do this on all platforms. |
| 18 | |
| 19 | # For about the same reason, we need to compile the ARM opts files |
| 20 | # separately as well. |
| 21 | { |
| 22 | 'target_name': 'opts', |
borenet@google.com | efb1d77 | 2012-10-10 19:45:51 +0000 | [diff] [blame] | 23 | 'product_name': 'skia_opts', |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 24 | 'type': 'static_library', |
borenet@google.com | efb1d77 | 2012-10-10 19:45:51 +0000 | [diff] [blame] | 25 | 'standalone_static_library': 1, |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 26 | 'include_dirs': [ |
| 27 | '../include/config', |
| 28 | '../include/core', |
| 29 | '../src/core', |
djsollen@google.com | a44e6c6 | 2012-01-09 14:38:25 +0000 | [diff] [blame] | 30 | '../src/opts', |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 31 | ], |
| 32 | 'conditions': [ |
caryclark@google.com | 867cbd8 | 2012-09-20 15:45:41 +0000 | [diff] [blame] | 33 | [ 'skia_arch_type == "x86" and skia_os != "ios"', { |
tomhudson@google.com | 95ad155 | 2012-02-14 18:28:54 +0000 | [diff] [blame] | 34 | 'conditions': [ |
borenet@google.com | 7158e6a | 2012-11-01 17:43:44 +0000 | [diff] [blame] | 35 | [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris", "nacl"]', { |
tomhudson@google.com | 95ad155 | 2012-02-14 18:28:54 +0000 | [diff] [blame] | 36 | 'cflags': [ |
| 37 | '-msse2', |
| 38 | ], |
| 39 | }], |
| 40 | ], |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 41 | 'sources': [ |
djsollen@google.com | a44e6c6 | 2012-01-09 14:38:25 +0000 | [diff] [blame] | 42 | '../src/opts/opts_check_SSE2.cpp', |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 43 | '../src/opts/SkBitmapProcState_opts_SSE2.cpp', |
| 44 | '../src/opts/SkBlitRow_opts_SSE2.cpp', |
tomhudson@google.com | 8dd90a9 | 2012-03-19 13:49:50 +0000 | [diff] [blame] | 45 | '../src/opts/SkBlitRect_opts_SSE2.cpp', |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 46 | '../src/opts/SkUtils_opts_SSE2.cpp', |
| 47 | ], |
tomhudson@google.com | 95ad155 | 2012-02-14 18:28:54 +0000 | [diff] [blame] | 48 | 'dependencies': [ |
| 49 | 'opts_ssse3', |
| 50 | ], |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 51 | }], |
djsollen@google.com | e341cb3 | 2012-06-28 16:08:05 +0000 | [diff] [blame] | 52 | [ 'skia_arch_type == "arm" and armv7 == 1', { |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 53 | # The assembly uses the frame pointer register (r7 in Thumb/r11 in |
| 54 | # ARM), the compiler doesn't like that. |
| 55 | 'cflags!': [ |
| 56 | '-fno-omit-frame-pointer', |
djsollen@google.com | 5afbbc4 | 2012-11-29 15:09:58 +0000 | [diff] [blame] | 57 | '-mapcs-frame', |
| 58 | '-mapcs', |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 59 | ], |
| 60 | 'cflags': [ |
| 61 | '-fomit-frame-pointer', |
djsollen@google.com | 5afbbc4 | 2012-11-29 15:09:58 +0000 | [diff] [blame] | 62 | '-mno-apcs-frame', |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 63 | ], |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 64 | 'variables': { |
| 65 | 'arm_neon_optional%': '<(arm_neon_optional>', |
| 66 | }, |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 67 | 'sources': [ |
djsollen@google.com | a44e6c6 | 2012-01-09 14:38:25 +0000 | [diff] [blame] | 68 | '../src/opts/opts_check_arm.cpp', |
| 69 | '../src/opts/memset.arm.S', |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 70 | '../src/opts/SkBitmapProcState_opts_arm.cpp', |
| 71 | '../src/opts/SkBlitRow_opts_arm.cpp', |
digit@google.com | a8dd1ce | 2012-08-08 22:06:29 +0000 | [diff] [blame] | 72 | '../src/opts/SkBlitRow_opts_arm.h', |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 73 | ], |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 74 | 'conditions': [ |
| 75 | [ 'arm_neon == 1 or arm_neon_optional == 1', { |
| 76 | 'dependencies': [ |
| 77 | 'opts_neon', |
| 78 | ] |
caryclark@google.com | 867cbd8 | 2012-09-20 15:45:41 +0000 | [diff] [blame] | 79 | }], |
| 80 | [ 'skia_os == "ios"', { |
| 81 | 'sources!': [ |
caryclark@google.com | 594dd3c | 2012-09-24 19:33:57 +0000 | [diff] [blame] | 82 | # these fail to compile under xcode for ios |
caryclark@google.com | 867cbd8 | 2012-09-20 15:45:41 +0000 | [diff] [blame] | 83 | '../src/opts/memset.arm.S', |
caryclark@google.com | 594dd3c | 2012-09-24 19:33:57 +0000 | [diff] [blame] | 84 | '../src/opts/SkBitmapProcState_opts_arm.cpp', |
| 85 | '../src/opts/SkBlitRow_opts_arm.cpp', |
caryclark@google.com | 867cbd8 | 2012-09-20 15:45:41 +0000 | [diff] [blame] | 86 | ], |
| 87 | }], |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 88 | ], |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 89 | }], |
caryclark@google.com | 594dd3c | 2012-09-24 19:33:57 +0000 | [diff] [blame] | 90 | [ '(skia_arch_type == "arm" and armv7 == 0) or (skia_os == "ios")', { |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 91 | 'sources': [ |
| 92 | '../src/opts/SkBitmapProcState_opts_none.cpp', |
| 93 | '../src/opts/SkBlitRow_opts_none.cpp', |
| 94 | '../src/opts/SkUtils_opts_none.cpp', |
| 95 | ], |
| 96 | }], |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 97 | ], |
| 98 | }, |
tomhudson@google.com | 95ad155 | 2012-02-14 18:28:54 +0000 | [diff] [blame] | 99 | # For the same lame reasons as what is done for skia_opts, we have to |
| 100 | # create another target specifically for SSSE3 code as we would not want |
| 101 | # to compile the SSE2 code with -mssse3 which would potentially allow |
| 102 | # gcc to generate SSSE3 code. |
| 103 | { |
| 104 | 'target_name': 'opts_ssse3', |
borenet@google.com | efb1d77 | 2012-10-10 19:45:51 +0000 | [diff] [blame] | 105 | 'product_name': 'skia_opts_ssse3', |
tomhudson@google.com | 95ad155 | 2012-02-14 18:28:54 +0000 | [diff] [blame] | 106 | 'type': 'static_library', |
borenet@google.com | efb1d77 | 2012-10-10 19:45:51 +0000 | [diff] [blame] | 107 | 'standalone_static_library': 1, |
tomhudson@google.com | 95ad155 | 2012-02-14 18:28:54 +0000 | [diff] [blame] | 108 | 'include_dirs': [ |
| 109 | '../include/config', |
| 110 | '../include/core', |
| 111 | '../src/core', |
| 112 | ], |
| 113 | 'conditions': [ |
borenet@google.com | 7158e6a | 2012-11-01 17:43:44 +0000 | [diff] [blame] | 114 | [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris", "nacl"]', { |
tomhudson@google.com | 95ad155 | 2012-02-14 18:28:54 +0000 | [diff] [blame] | 115 | 'cflags': [ |
| 116 | '-mssse3', |
| 117 | ], |
| 118 | }], |
epoger@google.com | 2109923 | 2012-02-14 19:49:19 +0000 | [diff] [blame] | 119 | # TODO(epoger): the following will enable SSSE3 on Macs, but it will |
| 120 | # break once we set OTHER_CFLAGS anywhere else (the first setting will |
| 121 | # be replaced, not added to) |
| 122 | [ 'skia_os in ["mac"]', { |
| 123 | 'xcode_settings': { |
| 124 | 'OTHER_CFLAGS': ['-mssse3',], |
| 125 | }, |
| 126 | }], |
djsollen@google.com | e341cb3 | 2012-06-28 16:08:05 +0000 | [diff] [blame] | 127 | [ 'skia_arch_type == "x86"', { |
tomhudson@google.com | 95ad155 | 2012-02-14 18:28:54 +0000 | [diff] [blame] | 128 | 'sources': [ |
| 129 | '../src/opts/SkBitmapProcState_opts_SSSE3.cpp', |
| 130 | ], |
| 131 | }], |
| 132 | ], |
| 133 | }, |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 134 | # NEON code must be compiled with -mfpu=neon which also affects scalar |
| 135 | # code. To support dynamic NEON code paths, we need to build all |
| 136 | # NEON-specific sources in a separate static library. The situation |
| 137 | # is very similar to the SSSE3 one. |
| 138 | { |
| 139 | 'target_name': 'opts_neon', |
borenet@google.com | efb1d77 | 2012-10-10 19:45:51 +0000 | [diff] [blame] | 140 | 'product_name': 'skia_opts_neon', |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 141 | 'type': 'static_library', |
borenet@google.com | efb1d77 | 2012-10-10 19:45:51 +0000 | [diff] [blame] | 142 | 'standalone_static_library': 1, |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 143 | 'include_dirs': [ |
| 144 | '../include/config', |
| 145 | '../include/core', |
| 146 | '../src/core', |
digit@google.com | fce02ac | 2012-08-01 14:25:07 +0000 | [diff] [blame] | 147 | '../src/opts', |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 148 | ], |
| 149 | 'cflags!': [ |
| 150 | '-fno-omit-frame-pointer', |
| 151 | '-mfpu=vfp', # remove them all, just in case. |
| 152 | '-mfpu=vfpv3', |
| 153 | '-mfpu=vfpv3-d16', |
| 154 | ], |
| 155 | 'cflags': [ |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 156 | '-mfpu=neon', |
digit@google.com | fce02ac | 2012-08-01 14:25:07 +0000 | [diff] [blame] | 157 | '-fomit-frame-pointer', |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 158 | ], |
| 159 | 'sources': [ |
| 160 | '../src/opts/memset16_neon.S', |
| 161 | '../src/opts/memset32_neon.S', |
digit@google.com | 3ada0ef | 2012-08-13 14:06:34 +0000 | [diff] [blame] | 162 | '../src/opts/SkBitmapProcState_arm_neon.cpp', |
digit@google.com | fce02ac | 2012-08-01 14:25:07 +0000 | [diff] [blame] | 163 | '../src/opts/SkBitmapProcState_matrixProcs_neon.cpp', |
| 164 | '../src/opts/SkBitmapProcState_matrix_clamp_neon.h', |
| 165 | '../src/opts/SkBitmapProcState_matrix_repeat_neon.h', |
digit@google.com | a8dd1ce | 2012-08-08 22:06:29 +0000 | [diff] [blame] | 166 | '../src/opts/SkBlitRow_opts_arm_neon.cpp', |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 167 | ], |
| 168 | }, |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 169 | ], |
| 170 | } |
| 171 | |
| 172 | # Local Variables: |
| 173 | # tab-width:2 |
| 174 | # indent-tabs-mode:nil |
| 175 | # End: |
| 176 | # vim: set expandtab tabstop=2 shiftwidth=2: |