| 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". | 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. | 18 # An empty string means to use the default for the arm_version. |
| 19 arm_arch = "" | 19 arm_arch = "" |
| 20 | 20 |
| 21 # The ARM floating point hardware. This will be a string like "neon" or |
| 22 # "vfpv3". An empty string means to use the default for the arm_version. |
| 23 arm_fpu = "" |
| 24 |
| 21 # The ARM floating point mode. This is either the string "hard", "soft", or | 25 # The ARM floating point mode. This is either the string "hard", "soft", or |
| 22 # "softfp". An empty string means to use the default one for the | 26 # "softfp". An empty string means to use the default one for the |
| 23 # arm_version. | 27 # arm_version. |
| 24 arm_float_abi = "" | 28 arm_float_abi = "" |
| 25 | 29 |
| 26 # The ARM variant-specific tuning mode. This will be a string like "armv6" | 30 # The ARM variant-specific tuning mode. This will be a string like "armv6" |
| 27 # or "cortex-a15". An empty string means to use the default for the | 31 # or "cortex-a15". An empty string means to use the default for the |
| 28 # arm_version. | 32 # arm_version. |
| 29 arm_tune = "" | 33 arm_tune = "" |
| 30 | 34 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 54 if (arm_version == 6) { | 58 if (arm_version == 6) { |
| 55 if (arm_arch == "") { | 59 if (arm_arch == "") { |
| 56 arm_arch = "armv6" | 60 arm_arch = "armv6" |
| 57 } | 61 } |
| 58 if (arm_tune != "") { | 62 if (arm_tune != "") { |
| 59 arm_tune = "" | 63 arm_tune = "" |
| 60 } | 64 } |
| 61 if (arm_float_abi == "") { | 65 if (arm_float_abi == "") { |
| 62 arm_float_abi = "softfp" | 66 arm_float_abi = "softfp" |
| 63 } | 67 } |
| 64 arm_fpu = "vfp" | 68 if (arm_fpu == "") { |
| 69 arm_fpu = "vfp" |
| 70 } |
| 65 arm_use_thumb = false | 71 arm_use_thumb = false |
| 66 } else if (arm_version == 7) { | 72 } else if (arm_version == 7) { |
| 67 if (arm_arch == "") { | 73 if (arm_arch == "") { |
| 68 arm_arch = "armv7-a" | 74 arm_arch = "armv7-a" |
| 69 } | 75 } |
| 70 if (arm_tune == "") { | 76 if (arm_tune == "") { |
| 71 arm_tune = "generic-armv7-a" | 77 arm_tune = "generic-armv7-a" |
| 72 } | 78 } |
| 73 | 79 |
| 74 if (arm_float_abi == "") { | 80 if (arm_float_abi == "") { |
| 75 if (current_os == "android" || target_os == "android") { | 81 if (current_os == "android" || target_os == "android") { |
| 76 arm_float_abi = "softfp" | 82 arm_float_abi = "softfp" |
| 77 } else if (current_os == "linux" && target_cpu != v8_target_cpu) { | 83 } else if (current_os == "linux" && target_cpu != v8_target_cpu) { |
| 78 # Default to the same as Android for V8 simulator builds. | 84 # Default to the same as Android for V8 simulator builds. |
| 79 arm_float_abi = "softfp" | 85 arm_float_abi = "softfp" |
| 80 } else { | 86 } else { |
| 81 arm_float_abi = "hard" | 87 arm_float_abi = "hard" |
| 82 } | 88 } |
| 83 } | 89 } |
| 84 | 90 |
| 85 if (arm_use_neon) { | 91 if (arm_fpu == "") { |
| 86 arm_fpu = "neon" | 92 if (arm_use_neon) { |
| 87 } else { | 93 arm_fpu = "neon" |
| 88 arm_fpu = "vfpv3-d16" | 94 } else { |
| 95 arm_fpu = "vfpv3-d16" |
| 96 } |
| 89 } | 97 } |
| 90 } else if (arm_version == 8) { | 98 } else if (arm_version == 8) { |
| 91 if (arm_arch == "") { | 99 if (arm_arch == "") { |
| 92 arm_arch = "armv8-a" | 100 arm_arch = "armv8-a" |
| 93 } | 101 } |
| 94 if (arm_tune == "") { | 102 if (arm_tune == "") { |
| 95 arm_tune = "generic-armv8-a" | 103 arm_tune = "generic-armv8-a" |
| 96 } | 104 } |
| 97 | 105 |
| 98 if (arm_float_abi == "") { | 106 if (arm_float_abi == "") { |
| 99 if (current_os == "android" || target_os == "android") { | 107 if (current_os == "android" || target_os == "android") { |
| 100 arm_float_abi = "softfp" | 108 arm_float_abi = "softfp" |
| 101 } else { | 109 } else { |
| 102 arm_float_abi = "hard" | 110 arm_float_abi = "hard" |
| 103 } | 111 } |
| 104 } | 112 } |
| 105 | 113 |
| 106 if (arm_use_neon) { | 114 if (arm_fpu == "") { |
| 107 arm_fpu = "neon" | 115 if (arm_use_neon) { |
| 108 } else { | 116 arm_fpu = "neon" |
| 109 arm_fpu = "vfpv3-d16" | 117 } else { |
| 118 arm_fpu = "vfpv3-d16" |
| 119 } |
| 110 } | 120 } |
| 111 } | 121 } |
| 112 } else if (current_cpu == "arm64" || v8_current_cpu == "arm64") { | 122 } else if (current_cpu == "arm64" || v8_current_cpu == "arm64") { |
| 113 # arm64 supports only "hard". | 123 # arm64 supports only "hard". |
| 114 arm_float_abi = "hard" | 124 arm_float_abi = "hard" |
| 115 arm_use_neon = true | 125 arm_use_neon = true |
| 116 } | 126 } |
| OLD | NEW |