From f9f09d784f283542f8edd1a57ab225d21a3d0fec Mon Sep 17 00:00:00 2001 From: Yolanda Chen Date: Thu, 12 Sep 2024 12:01:43 +0800 Subject: [PATCH 1/2] v8,tools: expose experimental wasm revectorize feature --- configure.py | 2 ++ tools/v8_gypfiles/features.gypi | 8 +++++++- tools/v8_gypfiles/v8.gyp | 10 ++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/configure.py b/configure.py index a4e210261e2e76..e00fe33cfb3b70 100755 --- a/configure.py +++ b/configure.py @@ -1675,6 +1675,8 @@ 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 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 226a3f6df54d07..7df3f3945827af 100644 --- a/tools/v8_gypfiles/v8.gyp +++ b/tools/v8_gypfiles/v8.gyp @@ -646,6 +646,11 @@ ' Date: Wed, 6 Nov 2024 20:01:53 +0800 Subject: [PATCH 2/2] Disable revec on mac --- configure.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/configure.py b/configure.py index e00fe33cfb3b70..1934100594d1f3 100755 --- a/configure.py +++ b/configure.py @@ -1675,8 +1675,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 o['variables']['v8_enable_webassembly'] and o['variables']['target_arch'] == 'x64': - o['variables']['v8_enable_wasm_simd256_revec'] = 1 + 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']