blob: 18f923d5174a93e348b4dbfb27b1b02b9b9d314d [file] [log] [blame]
Ben Murdoch097c5b22016-05-18 11:27:45 +01001# Copyright 2014 The Chromium Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5# These are primarily relevant in current_cpu == "arm" contexts, where
6# ARM code is being compiled. But they can also be relevant in the
7# host toolchain context when target_cpu == "arm", where a host-side
8# build tool being built will change its behavior depending on the
9# details of the target configuration.
10if (target_cpu == "arm" || current_cpu == "arm") {
11 declare_args() {
12 # Version of the ARM processor when compiling on ARM. Ignored on non-ARM
13 # platforms.
14 arm_version = 7
15
16 # The ARM floating point mode. This is either the string "hard", "soft", or
17 # "softfp". An empty string means to use the default one for the
18 # arm_version.
19 arm_float_abi = ""
20
21 # The ARM variant-specific tuning mode. This will be a string like "armv6"
22 # or "cortex-a15". An empty string means to use the default for the
23 # arm_version.
24 arm_tune = ""
25
26 # Whether to use the neon FPU instruction set or not.
27 arm_use_neon = true
28
29 # Whether to enable optional NEON code paths.
30 arm_optionally_use_neon = false
31
32 # Thumb is a reduced instruction set available on some ARM processors that
33 # has increased code density.
34 arm_use_thumb = true
35 }
36
37 assert(arm_float_abi == "" || arm_float_abi == "hard" ||
38 arm_float_abi == "soft" || arm_float_abi == "softfp")
39
40 if (arm_version == 6) {
41 arm_arch = "armv6"
42 if (arm_tune != "") {
43 arm_tune = ""
44 }
45 if (arm_float_abi == "") {
46 arm_float_abi = "softfp"
47 }
48 arm_fpu = "vfp"
49 arm_use_thumb = false
50 } else if (arm_version == 7) {
51 arm_arch = "armv7-a"
52 if (arm_tune == "") {
53 arm_tune = "generic-armv7-a"
54 }
55
56 if (arm_float_abi == "") {
57 if (current_os == "android" || target_os == "android") {
58 arm_float_abi = "softfp"
59 } else {
60 arm_float_abi = "hard"
61 }
62 }
63
64 if (arm_use_neon) {
65 arm_fpu = "neon"
66 } else {
67 arm_fpu = "vfpv3-d16"
68 }
69 } else if (arm_version == 8) {
70 arm_arch = "armv8-a"
71 if (arm_tune == "") {
72 arm_tune = "generic-armv8-a"
73 }
74
75 if (arm_float_abi == "") {
76 if (current_os == "android" || target_os == "android") {
77 arm_float_abi = "softfp"
78 } else {
79 arm_float_abi = "hard"
80 }
81 }
82
83 if (arm_use_neon) {
84 arm_fpu = "neon"
85 } else {
86 arm_fpu = "vfpv3-d16"
87 }
88 }
89} else if (current_cpu == "arm64" || target_cpu == "arm64") {
90 # arm64 supports only "hard".
91 arm_float_abi = "hard"
92 arm_use_neon = true
93 arm_fpu = "cortex-a57+simd+crypto+fp+crc"
94}