fix macos march flags

This commit is contained in:
Alexander Frick 2024-11-23 15:35:05 -06:00
parent e757c2322b
commit 75f1a93ece
4 changed files with 10 additions and 8 deletions

View file

@ -620,7 +620,7 @@ config("compiler") {
} }
} }
if (use_avx2 || use_avx512 || current_cpu == "arm64") { if (use_avx2 || use_avx512 || current_cpu == "arm64" || is_mac) {
if (is_win) { if (is_win) {
cflags += [ "/clang:-ffp-contract=fast" ] cflags += [ "/clang:-ffp-contract=fast" ]
} else { } else {
@ -2662,7 +2662,7 @@ if (is_win) {
common_optimize_on_cflags += [ "-mtune=cortex-a72", ] common_optimize_on_cflags += [ "-mtune=cortex-a72", ]
} }
if (is_mac) { if (is_mac) {
common_optimize_on_cflags += [ "-march=armv8.3-a+simd", ] common_optimize_on_cflags += [ "-march=armv8.3-a+simd+crypto", ]
} }
} }
@ -2723,7 +2723,7 @@ if (is_win) {
if (current_cpu == "arm64") { if (current_cpu == "arm64") {
common_optimize_on_ldflags += [ "-march=armv8-a+simd", ] common_optimize_on_ldflags += [ "-march=armv8-a+simd", ]
if (is_mac) { if (is_mac) {
common_optimize_on_ldflags += [ "-march=armv8.3-a+simd", ] common_optimize_on_ldflags += [ "-march=armv8.3-a+simd+crypto", ]
} }
} }

View file

@ -1,3 +1,5 @@
use_sse3 = false
# use_polly = true # use_polly = true
target_os = "mac" target_os = "mac"
target_cpu = "arm64" target_cpu = "arm64"

View file

@ -620,7 +620,7 @@ config("compiler") {
} }
} }
if (use_avx2 || use_avx512 || current_cpu == "arm64") { if (use_avx2 || use_avx512 || current_cpu == "arm64" || is_mac) {
if (is_win) { if (is_win) {
cflags += [ "/clang:-ffp-contract=fast" ] cflags += [ "/clang:-ffp-contract=fast" ]
} else { } else {
@ -2662,7 +2662,7 @@ if (is_win) {
common_optimize_on_cflags += [ "-mtune=cortex-a72", ] common_optimize_on_cflags += [ "-mtune=cortex-a72", ]
} }
if (is_mac) { if (is_mac) {
common_optimize_on_cflags += [ "-march=armv8.3-a+simd", ] common_optimize_on_cflags += [ "-march=armv8.3-a+simd+crypto", ]
} }
} }
@ -2723,7 +2723,7 @@ if (is_win) {
if (current_cpu == "arm64") { if (current_cpu == "arm64") {
common_optimize_on_ldflags += [ "-march=armv8-a+simd", ] common_optimize_on_ldflags += [ "-march=armv8-a+simd", ]
if (is_mac) { if (is_mac) {
common_optimize_on_ldflags += [ "-march=armv8.3-a+simd", ] common_optimize_on_ldflags += [ "-march=armv8.3-a+simd+crypto", ]
} }
} }

View file

@ -40,8 +40,8 @@ config("compiler") {
if (current_cpu == "arm64") { if (current_cpu == "arm64") {
# Alex313031 TODO: Possibly use -mcpu here? # Alex313031 TODO: Possibly use -mcpu here?
cflags += [ "-march=armv8.3-a+simd", "-mtune=apple-m1" ] cflags += [ "-march=armv8.3-a+simd+crypto", "-mtune=apple-m1" ]
ldflags += [ "-march=armv8.3-a+simd", "-mtune=apple-m1" ] ldflags += [ "-march=armv8.3-a+simd+crypto", "-mtune=apple-m1" ]
} }
if (current_cpu == "x64") { if (current_cpu == "x64") {