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 import("//build/config/v8_target_cpu.gni") | 5 import("//build/config/v8_target_cpu.gni") |
6 | 6 |
7 # These are primarily relevant in current_cpu == "arm" contexts, where | 7 # These are primarily relevant in current_cpu == "arm" contexts, where |
8 # ARM code is being compiled. But they can also be relevant in the | 8 # ARM code is being compiled. But they can also be relevant in the |
9 # other contexts when the code will change its behavior based on the | 9 # other contexts when the code will change its behavior based on the |
10 # cpu it wants to generate code for. | 10 # cpu it wants to generate code for. |
11 if (current_cpu == "arm" || v8_current_cpu == "arm") { | 11 if (current_cpu == "arm" || v8_current_cpu == "arm") { |
12 declare_args() { | 12 declare_args() { |
13 # Version of the ARM processor when compiling on ARM. Ignored on non-ARM | 13 # Version of the ARM processor when compiling on ARM. Ignored on non-ARM |
14 # platforms. | 14 # platforms. |
15 arm_version = 7 | 15 arm_version = 7 |
16 | 16 |
| 17 # The ARM architecture. This will be a string like "armv6" or "armv7-a". |
| 18 # An empty string means to use the default for the arm_version. |
| 19 arm_arch = "" |
| 20 |
17 # The ARM floating point mode. This is either the string "hard", "soft", or | 21 # The ARM floating point mode. This is either the string "hard", "soft", or |
18 # "softfp". An empty string means to use the default one for the | 22 # "softfp". An empty string means to use the default one for the |
19 # arm_version. | 23 # arm_version. |
20 arm_float_abi = "" | 24 arm_float_abi = "" |
21 | 25 |
22 # The ARM variant-specific tuning mode. This will be a string like "armv6" | 26 # The ARM variant-specific tuning mode. This will be a string like "armv6" |
23 # or "cortex-a15". An empty string means to use the default for the | 27 # or "cortex-a15". An empty string means to use the default for the |
24 # arm_version. | 28 # arm_version. |
25 arm_tune = "" | 29 arm_tune = "" |
26 | 30 |
(...skipping 14 matching lines...) Expand all Loading... |
41 if (arm_use_neon == "") { | 45 if (arm_use_neon == "") { |
42 if (current_os == "linux" && target_cpu != v8_target_cpu) { | 46 if (current_os == "linux" && target_cpu != v8_target_cpu) { |
43 # Don't use neon on V8 simulator builds as a default. | 47 # Don't use neon on V8 simulator builds as a default. |
44 arm_use_neon = false | 48 arm_use_neon = false |
45 } else { | 49 } else { |
46 arm_use_neon = true | 50 arm_use_neon = true |
47 } | 51 } |
48 } | 52 } |
49 | 53 |
50 if (arm_version == 6) { | 54 if (arm_version == 6) { |
51 arm_arch = "armv6" | 55 if (arm_arch == "") { |
| 56 arm_arch = "armv6" |
| 57 } |
52 if (arm_tune != "") { | 58 if (arm_tune != "") { |
53 arm_tune = "" | 59 arm_tune = "" |
54 } | 60 } |
55 if (arm_float_abi == "") { | 61 if (arm_float_abi == "") { |
56 arm_float_abi = "softfp" | 62 arm_float_abi = "softfp" |
57 } | 63 } |
58 arm_fpu = "vfp" | 64 arm_fpu = "vfp" |
59 arm_use_thumb = false | 65 arm_use_thumb = false |
60 } else if (arm_version == 7) { | 66 } else if (arm_version == 7) { |
61 arm_arch = "armv7-a" | 67 if (arm_arch == "") { |
| 68 arm_arch = "armv7-a" |
| 69 } |
62 if (arm_tune == "") { | 70 if (arm_tune == "") { |
63 arm_tune = "generic-armv7-a" | 71 arm_tune = "generic-armv7-a" |
64 } | 72 } |
65 | 73 |
66 if (arm_float_abi == "") { | 74 if (arm_float_abi == "") { |
67 if (current_os == "android" || target_os == "android") { | 75 if (current_os == "android" || target_os == "android") { |
68 arm_float_abi = "softfp" | 76 arm_float_abi = "softfp" |
69 } else if (current_os == "linux" && target_cpu != v8_target_cpu) { | 77 } else if (current_os == "linux" && target_cpu != v8_target_cpu) { |
70 # Default to the same as Android for V8 simulator builds. | 78 # Default to the same as Android for V8 simulator builds. |
71 arm_float_abi = "softfp" | 79 arm_float_abi = "softfp" |
72 } else { | 80 } else { |
73 arm_float_abi = "hard" | 81 arm_float_abi = "hard" |
74 } | 82 } |
75 } | 83 } |
76 | 84 |
77 if (arm_use_neon) { | 85 if (arm_use_neon) { |
78 arm_fpu = "neon" | 86 arm_fpu = "neon" |
79 } else { | 87 } else { |
80 arm_fpu = "vfpv3-d16" | 88 arm_fpu = "vfpv3-d16" |
81 } | 89 } |
82 } else if (arm_version == 8) { | 90 } else if (arm_version == 8) { |
83 arm_arch = "armv8-a" | 91 if (arm_arch == "") { |
| 92 arm_arch = "armv8-a" |
| 93 } |
84 if (arm_tune == "") { | 94 if (arm_tune == "") { |
85 arm_tune = "generic-armv8-a" | 95 arm_tune = "generic-armv8-a" |
86 } | 96 } |
87 | 97 |
88 if (arm_float_abi == "") { | 98 if (arm_float_abi == "") { |
89 if (current_os == "android" || target_os == "android") { | 99 if (current_os == "android" || target_os == "android") { |
90 arm_float_abi = "softfp" | 100 arm_float_abi = "softfp" |
91 } else { | 101 } else { |
92 arm_float_abi = "hard" | 102 arm_float_abi = "hard" |
93 } | 103 } |
94 } | 104 } |
95 | 105 |
96 if (arm_use_neon) { | 106 if (arm_use_neon) { |
97 arm_fpu = "neon" | 107 arm_fpu = "neon" |
98 } else { | 108 } else { |
99 arm_fpu = "vfpv3-d16" | 109 arm_fpu = "vfpv3-d16" |
100 } | 110 } |
101 } | 111 } |
102 } else if (current_cpu == "arm64" || v8_current_cpu == "arm64") { | 112 } else if (current_cpu == "arm64" || v8_current_cpu == "arm64") { |
103 # arm64 supports only "hard". | 113 # arm64 supports only "hard". |
104 arm_float_abi = "hard" | 114 arm_float_abi = "hard" |
105 arm_use_neon = true | 115 arm_use_neon = true |
106 } | 116 } |
OLD | NEW |