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', |
| 23 | 'type': 'static_library', |
| 24 | 'include_dirs': [ |
| 25 | '../include/config', |
| 26 | '../include/core', |
| 27 | '../src/core', |
djsollen@google.com | a44e6c6 | 2012-01-09 14:38:25 +0000 | [diff] [blame] | 28 | '../src/opts', |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 29 | ], |
| 30 | 'conditions': [ |
djsollen@google.com | e341cb3 | 2012-06-28 16:08:05 +0000 | [diff] [blame] | 31 | [ 'skia_arch_type == "x86"', { |
tomhudson@google.com | 95ad155 | 2012-02-14 18:28:54 +0000 | [diff] [blame] | 32 | 'conditions': [ |
| 33 | [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris"]', { |
| 34 | 'cflags': [ |
| 35 | '-msse2', |
| 36 | ], |
| 37 | }], |
| 38 | ], |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 39 | 'sources': [ |
djsollen@google.com | a44e6c6 | 2012-01-09 14:38:25 +0000 | [diff] [blame] | 40 | '../src/opts/opts_check_SSE2.cpp', |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 41 | '../src/opts/SkBitmapProcState_opts_SSE2.cpp', |
| 42 | '../src/opts/SkBlitRow_opts_SSE2.cpp', |
tomhudson@google.com | 8dd90a9 | 2012-03-19 13:49:50 +0000 | [diff] [blame] | 43 | '../src/opts/SkBlitRect_opts_SSE2.cpp', |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 44 | '../src/opts/SkUtils_opts_SSE2.cpp', |
| 45 | ], |
tomhudson@google.com | 95ad155 | 2012-02-14 18:28:54 +0000 | [diff] [blame] | 46 | 'dependencies': [ |
| 47 | 'opts_ssse3', |
| 48 | ], |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 49 | }], |
djsollen@google.com | e341cb3 | 2012-06-28 16:08:05 +0000 | [diff] [blame] | 50 | [ 'skia_arch_type == "arm" and armv7 == 1', { |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 51 | # The assembly uses the frame pointer register (r7 in Thumb/r11 in |
| 52 | # ARM), the compiler doesn't like that. |
| 53 | 'cflags!': [ |
| 54 | '-fno-omit-frame-pointer', |
| 55 | ], |
| 56 | 'cflags': [ |
| 57 | '-fomit-frame-pointer', |
| 58 | ], |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 59 | 'variables': { |
| 60 | 'arm_neon_optional%': '<(arm_neon_optional>', |
| 61 | }, |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 62 | 'sources': [ |
djsollen@google.com | a44e6c6 | 2012-01-09 14:38:25 +0000 | [diff] [blame] | 63 | '../src/opts/opts_check_arm.cpp', |
| 64 | '../src/opts/memset.arm.S', |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 65 | '../src/opts/SkBitmapProcState_opts_arm.cpp', |
| 66 | '../src/opts/SkBlitRow_opts_arm.cpp', |
digit@google.com | a8dd1ce | 2012-08-08 22:06:29 +0000 | [diff] [blame^] | 67 | '../src/opts/SkBlitRow_opts_arm.h', |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 68 | ], |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 69 | 'conditions': [ |
| 70 | [ 'arm_neon == 1 or arm_neon_optional == 1', { |
| 71 | 'dependencies': [ |
| 72 | 'opts_neon', |
| 73 | ] |
| 74 | }] |
| 75 | ], |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 76 | }], |
djsollen@google.com | e341cb3 | 2012-06-28 16:08:05 +0000 | [diff] [blame] | 77 | [ 'skia_arch_type == "arm" and armv7 != 1', { |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 78 | 'sources': [ |
| 79 | '../src/opts/SkBitmapProcState_opts_none.cpp', |
| 80 | '../src/opts/SkBlitRow_opts_none.cpp', |
| 81 | '../src/opts/SkUtils_opts_none.cpp', |
| 82 | ], |
| 83 | }], |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 84 | ], |
| 85 | }, |
tomhudson@google.com | 95ad155 | 2012-02-14 18:28:54 +0000 | [diff] [blame] | 86 | # For the same lame reasons as what is done for skia_opts, we have to |
| 87 | # create another target specifically for SSSE3 code as we would not want |
| 88 | # to compile the SSE2 code with -mssse3 which would potentially allow |
| 89 | # gcc to generate SSSE3 code. |
| 90 | { |
| 91 | 'target_name': 'opts_ssse3', |
| 92 | 'type': 'static_library', |
| 93 | 'include_dirs': [ |
| 94 | '../include/config', |
| 95 | '../include/core', |
| 96 | '../src/core', |
| 97 | ], |
| 98 | 'conditions': [ |
epoger@google.com | 2109923 | 2012-02-14 19:49:19 +0000 | [diff] [blame] | 99 | [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris"]', { |
tomhudson@google.com | 95ad155 | 2012-02-14 18:28:54 +0000 | [diff] [blame] | 100 | 'cflags': [ |
| 101 | '-mssse3', |
| 102 | ], |
| 103 | }], |
epoger@google.com | 2109923 | 2012-02-14 19:49:19 +0000 | [diff] [blame] | 104 | # TODO(epoger): the following will enable SSSE3 on Macs, but it will |
| 105 | # break once we set OTHER_CFLAGS anywhere else (the first setting will |
| 106 | # be replaced, not added to) |
| 107 | [ 'skia_os in ["mac"]', { |
| 108 | 'xcode_settings': { |
| 109 | 'OTHER_CFLAGS': ['-mssse3',], |
| 110 | }, |
| 111 | }], |
djsollen@google.com | e341cb3 | 2012-06-28 16:08:05 +0000 | [diff] [blame] | 112 | [ 'skia_arch_type == "x86"', { |
tomhudson@google.com | 95ad155 | 2012-02-14 18:28:54 +0000 | [diff] [blame] | 113 | 'sources': [ |
| 114 | '../src/opts/SkBitmapProcState_opts_SSSE3.cpp', |
| 115 | ], |
| 116 | }], |
| 117 | ], |
| 118 | }, |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 119 | # NEON code must be compiled with -mfpu=neon which also affects scalar |
| 120 | # code. To support dynamic NEON code paths, we need to build all |
| 121 | # NEON-specific sources in a separate static library. The situation |
| 122 | # is very similar to the SSSE3 one. |
| 123 | { |
| 124 | 'target_name': 'opts_neon', |
| 125 | 'type': 'static_library', |
| 126 | 'include_dirs': [ |
| 127 | '../include/config', |
| 128 | '../include/core', |
| 129 | '../src/core', |
digit@google.com | fce02ac | 2012-08-01 14:25:07 +0000 | [diff] [blame] | 130 | '../src/opts', |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 131 | ], |
| 132 | 'cflags!': [ |
| 133 | '-fno-omit-frame-pointer', |
| 134 | '-mfpu=vfp', # remove them all, just in case. |
| 135 | '-mfpu=vfpv3', |
| 136 | '-mfpu=vfpv3-d16', |
| 137 | ], |
| 138 | 'cflags': [ |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 139 | '-mfpu=neon', |
digit@google.com | fce02ac | 2012-08-01 14:25:07 +0000 | [diff] [blame] | 140 | '-fomit-frame-pointer', |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 141 | ], |
| 142 | 'sources': [ |
| 143 | '../src/opts/memset16_neon.S', |
| 144 | '../src/opts/memset32_neon.S', |
digit@google.com | a8dd1ce | 2012-08-08 22:06:29 +0000 | [diff] [blame^] | 145 | '../src/opts/SkBitmapProcState_arm_neon.cpp', |
digit@google.com | fce02ac | 2012-08-01 14:25:07 +0000 | [diff] [blame] | 146 | '../src/opts/SkBitmapProcState_matrixProcs_neon.cpp', |
| 147 | '../src/opts/SkBitmapProcState_matrix_clamp_neon.h', |
| 148 | '../src/opts/SkBitmapProcState_matrix_repeat_neon.h', |
digit@google.com | a8dd1ce | 2012-08-08 22:06:29 +0000 | [diff] [blame^] | 149 | '../src/opts/SkBlitRow_opts_arm_neon.cpp', |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 150 | ], |
| 151 | }, |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 152 | ], |
| 153 | } |
| 154 | |
| 155 | # Local Variables: |
| 156 | # tab-width:2 |
| 157 | # indent-tabs-mode:nil |
| 158 | # End: |
| 159 | # vim: set expandtab tabstop=2 shiftwidth=2: |