Skip to content

Commit 1799bba

Browse files
authored
[Platforms] Use -mpcu instead of -mtune for ARM architectures (#238)
1 parent 46e7609 commit 1799bba

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/Platforms.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,9 @@ const ARCHITECTURE_FLAGS = Dict(
110110
),
111111
"armv7l" => OrderedDict(
112112
# Base armv7l architecture, with the most basic of FPU's
113-
"armv7l" => ["-march=armv7-a", "-mtune=generic-armv7-a", "-mfpu=vfpv3", "-mfloat-abi=hard"],
113+
"armv7l" => ["-mcpu=generic-armv7-a", "-mfpu=vfpv3", "-mfloat-abi=hard"],
114114
# armv7l plus NEON and vfpv4, (Raspberry Pi 2B+, RK3328, most boards Elliot has access to)
115-
"neonvfpv4" => ["-march=armv7-a", "-mtune=cortex-a53", "-mfpu=neon-vfpv4", "-mfloat-abi=hard"],
115+
"neonvfpv4" => ["-mcpu=cortex-a53", "-mfpu=neon-vfpv4", "-mfloat-abi=hard"],
116116
),
117117
"aarch64" => OrderedDict(
118118
# For GCC, see: <https://gcc.gnu.org/onlinedocs/gcc/AArch64-Options.html>. For
@@ -121,10 +121,10 @@ const ARCHITECTURE_FLAGS = Dict(
121121
# and
122122
# <https://github.com/llvm/llvm-project/blob/85e9b2687a13d1908aa86d1b89c5ce398a06cd39/llvm/lib/Target/AArch64/AArch64.td>.
123123
# Run `clang --print-supported-cpus` for the list of values of `-mtune`.
124-
"armv8_0" => ["-march=armv8-a", "-mtune=cortex-a57"],
125-
"armv8_1" => ["-march=armv8.1-a", "-mtune=thunderx2t99"],
126-
"armv8_2_crypto" => ["-march=armv8.2-a+aes+sha2", "-mtune=cortex-a76"],
127-
"a64fx" => ["-march=armv8.2-a+aes+sha2+fp16+sve", "-mtune=a64fx"],
124+
"armv8_0" => ["-march=armv8-a", "-mcpu=cortex-a57"],
125+
"armv8_1" => ["-march=armv8.1-a", "-mcpu=thunderx2t99"],
126+
"armv8_2_crypto" => ["-march=armv8.2-a+aes+sha2", "-mcpu=cortex-a76"],
127+
"a64fx" => ["-mcpu=a64fx"],
128128
),
129129
"powerpc64le" => OrderedDict(
130130
"power8" => ["-mcpu=power8", "-mtune=power8"],
@@ -136,7 +136,7 @@ const ARCHITECTURE_FLAGS = Dict(
136136
),
137137
"gcc" => Dict(
138138
"aarch64" => OrderedDict(
139-
"apple_m1" => ["-march=armv8.5-a+aes+sha2+sha3+fp16fml+fp16+rcpc+dotprod", "-mtune=cortex-a76"],
139+
"apple_m1" => ["-march=armv8.5-a+aes+sha2+sha3+fp16fml+fp16+rcpc+dotprod", "-mcpu=cortex-a76"],
140140
),
141141
),
142142
"clang" => Dict(

test/platforms.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ using BinaryBuilderBase: get_march_flags, get_all_arch_names, get_all_march_name
9595
@test get_march_flags("x86_64", "avx", "gcc") == ["-march=sandybridge", "-mtune=sandybridge"]
9696

9797
# Test one that is different between gcc and clang
98-
@test get_march_flags("aarch64", "apple_m1", "gcc") == ["-march=armv8.5-a+aes+sha2+sha3+fp16fml+fp16+rcpc+dotprod", "-mtune=cortex-a76"]
98+
@test get_march_flags("aarch64", "apple_m1", "gcc") == ["-march=armv8.5-a+aes+sha2+sha3+fp16fml+fp16+rcpc+dotprod", "-mcpu=cortex-a76"]
9999
@test get_march_flags("aarch64", "apple_m1", "clang") == ["-mcpu=apple-m1"]
100100

101101
for compiler in ("gcc", "clang")

0 commit comments

Comments
 (0)