From 84f98e0a7425babdca988f277d9a51d1e373d192 Mon Sep 17 00:00:00 2001 From: Yolanda-Chen Date: Sun, 8 Dec 2024 07:24:47 +0800 Subject: [PATCH] v8,tools: expose experimental wasm revectorize feature MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/54896 Reviewed-By: Michaƫl Zasso Reviewed-By: James M Snell --- configure.py | 3 +++ tools/v8_gypfiles/features.gypi | 8 +++++++- tools/v8_gypfiles/v8.gyp | 10 ++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/configure.py b/configure.py index e2b12d8823bb64..c361676637c1cb 100755 --- a/configure.py +++ b/configure.py @@ -1685,6 +1685,9 @@ def configure_v8(o, configs): raise Exception( 'Only one of the --v8-enable-object-print or --v8-disable-object-print options ' 'can be specified at a time.') + if sys.platform != 'darwin': + if o['variables']['v8_enable_webassembly'] and o['variables']['target_arch'] == 'x64': + o['variables']['v8_enable_wasm_simd256_revec'] = 1 def configure_openssl(o): variables = o['variables'] diff --git a/tools/v8_gypfiles/features.gypi b/tools/v8_gypfiles/features.gypi index 18479d7d2abc44..7940234cd6789c 100644 --- a/tools/v8_gypfiles/features.gypi +++ b/tools/v8_gypfiles/features.gypi @@ -328,7 +328,10 @@ # Enable advanced BigInt algorithms, costing about 10-30 KiB binary size # depending on platform. - 'v8_advanced_bigint_algorithms%': 1 + 'v8_advanced_bigint_algorithms%': 1, + + # Enable 256-bit long vector re-vectorization pass in WASM compilation pipeline. + 'v8_enable_wasm_simd256_revec%' : 0 }, 'target_defaults': { @@ -541,6 +544,9 @@ ['v8_advanced_bigint_algorithms==1', { 'defines': ['V8_ADVANCED_BIGINT_ALGORITHMS',], }], + ['v8_enable_wasm_simd256_revec==1', { + 'defines': ['V8_ENABLE_WASM_SIMD256_REVEC',], + }], ], # conditions 'defines': [ 'V8_GYP_BUILD', diff --git a/tools/v8_gypfiles/v8.gyp b/tools/v8_gypfiles/v8.gyp index f344406a9414e9..9b5d8e2f648467 100644 --- a/tools/v8_gypfiles/v8.gyp +++ b/tools/v8_gypfiles/v8.gyp @@ -646,6 +646,11 @@ '