OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 # Do not use the targets in this file unless you need a certain libjpeg | 5 # Do not use the targets in this file unless you need a certain libjpeg |
6 # implementation. Use the meta target //third_party:jpeg instead. | 6 # implementation. Use the meta target //third_party:jpeg instead. |
7 | 7 |
8 if (current_cpu == "arm") { | 8 if (cpu_arch == "arm") { |
9 import("//build/config/arm.gni") | 9 import("//build/config/arm.gni") |
10 } | 10 } |
11 | 11 |
12 if (current_cpu == "x86" || current_cpu == "x64") { | 12 if (cpu_arch == "x86" || cpu_arch == "x64") { |
13 import("//third_party/yasm/yasm_assemble.gni") | 13 import("//third_party/yasm/yasm_assemble.gni") |
14 | 14 |
15 yasm_assemble("simd_asm") { | 15 yasm_assemble("simd_asm") { |
16 defines = [] | 16 defines = [] |
17 | 17 |
18 if (current_cpu == "x86") { | 18 if (cpu_arch == "x86") { |
19 sources = [ | 19 sources = [ |
20 "simd/jccolmmx.asm", | 20 "simd/jccolmmx.asm", |
21 "simd/jccolss2.asm", | 21 "simd/jccolss2.asm", |
22 "simd/jcgrammx.asm", | 22 "simd/jcgrammx.asm", |
23 "simd/jcgrass2.asm", | 23 "simd/jcgrass2.asm", |
24 "simd/jcqnt3dn.asm", | 24 "simd/jcqnt3dn.asm", |
25 "simd/jcqntmmx.asm", | 25 "simd/jcqntmmx.asm", |
26 "simd/jcqnts2f.asm", | 26 "simd/jcqnts2f.asm", |
27 "simd/jcqnts2i.asm", | 27 "simd/jcqnts2i.asm", |
28 "simd/jcqntsse.asm", | 28 "simd/jcqntsse.asm", |
(...skipping 16 matching lines...) Expand all Loading... |
45 "simd/jimmxint.asm", | 45 "simd/jimmxint.asm", |
46 "simd/jimmxred.asm", | 46 "simd/jimmxred.asm", |
47 "simd/jiss2flt.asm", | 47 "simd/jiss2flt.asm", |
48 "simd/jiss2fst.asm", | 48 "simd/jiss2fst.asm", |
49 "simd/jiss2int.asm", | 49 "simd/jiss2int.asm", |
50 "simd/jiss2red.asm", | 50 "simd/jiss2red.asm", |
51 "simd/jisseflt.asm", | 51 "simd/jisseflt.asm", |
52 "simd/jsimdcpu.asm", | 52 "simd/jsimdcpu.asm", |
53 ] | 53 ] |
54 defines += [ "__x86__" ] | 54 defines += [ "__x86__" ] |
55 } else if (current_cpu == "x64") { | 55 } else if (cpu_arch == "x64") { |
56 sources = [ | 56 sources = [ |
57 "simd/jccolss2-64.asm", | 57 "simd/jccolss2-64.asm", |
58 "simd/jcgrass2-64.asm", | 58 "simd/jcgrass2-64.asm", |
59 "simd/jcqnts2f-64.asm", | 59 "simd/jcqnts2f-64.asm", |
60 "simd/jcqnts2i-64.asm", | 60 "simd/jcqnts2i-64.asm", |
61 "simd/jcsamss2-64.asm", | 61 "simd/jcsamss2-64.asm", |
62 "simd/jdcolss2-64.asm", | 62 "simd/jdcolss2-64.asm", |
63 "simd/jdmerss2-64.asm", | 63 "simd/jdmerss2-64.asm", |
64 "simd/jdsamss2-64.asm", | 64 "simd/jdsamss2-64.asm", |
65 "simd/jfss2fst-64.asm", | 65 "simd/jfss2fst-64.asm", |
66 "simd/jfss2int-64.asm", | 66 "simd/jfss2int-64.asm", |
67 "simd/jfsseflt-64.asm", | 67 "simd/jfsseflt-64.asm", |
68 "simd/jiss2flt-64.asm", | 68 "simd/jiss2flt-64.asm", |
69 "simd/jiss2fst-64.asm", | 69 "simd/jiss2fst-64.asm", |
70 "simd/jiss2int-64.asm", | 70 "simd/jiss2int-64.asm", |
71 "simd/jiss2red-64.asm", | 71 "simd/jiss2red-64.asm", |
72 ] | 72 ] |
73 defines += [ "__x86_64__" ] | 73 defines += [ "__x86_64__" ] |
74 } | 74 } |
75 | 75 |
76 if (is_win) { | 76 if (is_win) { |
77 defines += [ "MSVC" ] | 77 defines += [ "MSVC" ] |
78 include_dirs = [ "win" ] | 78 include_dirs = [ "win" ] |
79 if (current_cpu == "x86") { | 79 if (cpu_arch == "x86") { |
80 defines += [ "WIN32" ] | 80 defines += [ "WIN32" ] |
81 } else { | 81 } else { |
82 defines += [ "WIN64" ] | 82 defines += [ "WIN64" ] |
83 } | 83 } |
84 } else if (is_mac) { | 84 } else if (is_mac) { |
85 defines += [ "MACHO" ] | 85 defines += [ "MACHO" ] |
86 include_dirs = [ "mac" ] | 86 include_dirs = [ "mac" ] |
87 } else if (is_linux || is_android) { | 87 } else if (is_linux || is_android) { |
88 defines += [ "ELF" ] | 88 defines += [ "ELF" ] |
89 include_dirs = [ "linux" ] | 89 include_dirs = [ "linux" ] |
90 } | 90 } |
91 } | 91 } |
92 } | 92 } |
93 | 93 |
94 source_set("simd") { | 94 source_set("simd") { |
95 if (current_cpu == "x86") { | 95 if (cpu_arch == "x86") { |
96 deps = [ | 96 deps = [ |
97 ":simd_asm", | 97 ":simd_asm", |
98 ] | 98 ] |
99 sources = [ | 99 sources = [ |
100 "simd/jsimd_i386.c", | 100 "simd/jsimd_i386.c", |
101 ] | 101 ] |
102 if (is_win) { | 102 if (is_win) { |
103 cflags = [ "/wd4245" ] | 103 cflags = [ "/wd4245" ] |
104 } | 104 } |
105 } else if (current_cpu == "x64") { | 105 } else if (cpu_arch == "x64") { |
106 deps = [ | 106 deps = [ |
107 ":simd_asm", | 107 ":simd_asm", |
108 ] | 108 ] |
109 sources = [ | 109 sources = [ |
110 "simd/jsimd_x86_64.c", | 110 "simd/jsimd_x86_64.c", |
111 ] | 111 ] |
112 } else if (current_cpu == "arm" && arm_version >= 7 && | 112 } else if (cpu_arch == "arm" && arm_version >= 7 && |
113 (arm_use_neon || arm_optionally_use_neon)) { | 113 (arm_use_neon || arm_optionally_use_neon)) { |
114 sources = [ | 114 sources = [ |
115 "simd/jsimd_arm.c", | 115 "simd/jsimd_arm.c", |
116 "simd/jsimd_arm_neon.S", | 116 "simd/jsimd_arm_neon.S", |
117 ] | 117 ] |
118 } else { | 118 } else { |
119 sources = [ | 119 sources = [ |
120 "jsimd_none.c", | 120 "jsimd_none.c", |
121 ] | 121 ] |
122 } | 122 } |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 if (is_msan || is_linux) { | 202 if (is_msan || is_linux) { |
203 sources += [ "jsimd_none.c" ] | 203 sources += [ "jsimd_none.c" ] |
204 } else { | 204 } else { |
205 deps = [ | 205 deps = [ |
206 ":simd", | 206 ":simd", |
207 ] | 207 ] |
208 } | 208 } |
209 | 209 |
210 # TODO(GYP): Compile the .asm files with YASM as GYP does. | 210 # TODO(GYP): Compile the .asm files with YASM as GYP does. |
211 } | 211 } |
OLD | NEW |