From bc7b94961a542b854b649e34c76150cdd8ba608c Mon Sep 17 00:00:00 2001 From: Marco Castelluccio Date: Tue, 1 Oct 2019 00:57:38 +0000 Subject: [PATCH] servo: Merge #10916 - Use NEON build flag on ARM and AArch64 (from mmatyas:useneon); r=aneeshusa The NEON flag is already used when building for Android, this patch enables it on other ARM devices too. Note that this patch just adds the build flag to the compilation, for actually enabling the SIMD code in Servo, we'll also need #10900 (but it's not a dependency). Source-Repo: https://github.com/servo/servo Source-Revision: a233d1e39b9549f7b24937ca4de9de0719bb890c UltraBlame original commit: ed43c96e2aa45b5353169af6812740e8609c83ab --- servo/python/servo/build_commands.py | 124 ++++++++++++++++----------- servo/python/servo/command_base.py | 60 +++++++------ 2 files changed, 102 insertions(+), 82 deletions(-) diff --git a/servo/python/servo/build_commands.py b/servo/python/servo/build_commands.py index 294dc0db7d567..3fc48352a693e 100644 --- a/servo/python/servo/build_commands.py +++ b/servo/python/servo/build_commands.py @@ -1308,28 +1308,38 @@ 1 ) -targets -= -[ -] - if -release +target +and +android : -opts -+ -= -[ +print +( " +Please +specify +either - - -release +target +or +- +- +android +. " -] +) + +sys +. +exit +( +1 +) if -target +release : opts @@ -1339,17 +1349,9 @@ " - - -target +release " -target ] - -targets -. -append -( -target -) if jobs @@ -1387,15 +1389,8 @@ android : -opts -+ -= -[ -" -- -- target -" += self . config @@ -1409,28 +1404,30 @@ target " ] -] + +if +target +: -targets -. -append -( +opts ++ += +[ " -arm - -linux - -androideabi +target " -) +target +] self . ensure_bootstrapped ( -targets +target = -targets +target ) if @@ -1518,19 +1515,42 @@ ( ) -if -android -: - # Ensure Rust uses hard floats +and +SIMD on -Android +ARM +devices + +if +target +: +if +target +. +startswith +( +' +arm +' +) +or +target +. +startswith +( +' +aarch64 +' +) +: + env [ ' @@ -1559,6 +1579,10 @@ + neon " + +if +android +: # Build @@ -2643,9 +2667,8 @@ ) : -targets +target = -[ " arm - @@ -2653,15 +2676,14 @@ - androideabi " -] self . ensure_bootstrapped ( -targets +target = -targets +target ) opts diff --git a/servo/python/servo/command_base.py b/servo/python/servo/command_base.py index 82eec974e2a39..2b684d0616d10 100644 --- a/servo/python/servo/command_base.py +++ b/servo/python/servo/command_base.py @@ -4377,10 +4377,9 @@ ensure_bootstrapped ( self -targets +target = -[ -] +None ) : @@ -4461,43 +4460,39 @@ " ) -target_paths +target_exists += +True + +if +target +is +not +None +: + +target_path = -[ path . join ( base_target_path -t +target ) -for -t -in -targets -] - -all_targets_exist + +target_exists = -all -( -[ path . exists ( -p -) -for -p -in -target_paths -] +target_path ) if -( not +( self . config @@ -4513,14 +4508,11 @@ rust ' ] -and - +or ( -not rustc_binary_exists -or -not -all_targets_exist +and +target_exists ) ) : @@ -4557,7 +4549,13 @@ context target = -targets +filter +( +None +[ +target +] +) ) cargo_path