Skip to content

Commit 112c8a2

Browse files
committed
feat: add support for branch hints in build configuration and documentation
1 parent 3fcc8c1 commit 112c8a2

3 files changed

Lines changed: 16 additions & 1 deletion

File tree

build-scripts/config_common.cmake

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -774,6 +774,11 @@ endif ()
774774
if (WAMR_BUILD_LIME1 EQUAL 1)
775775
message (" Lime1 enabled")
776776
endif ()
777+
if (WAMR_BUILD_BRANCH_HINTS EQUAL 1)
778+
message (" Branch hints enabled")
779+
add_definitions(-DWASM_ENABLE_BRANCH_HINTS=1)
780+
endif ()
781+
777782
########################################
778783
# Show Phase4 Wasm proposals status.
779784
########################################
@@ -786,8 +791,8 @@ message (
786791
" \"Non-trapping float-to-int Conversions\"\n"
787792
" \"Sign-extension Operators\"\n"
788793
" \"WebAssembly C and C++ API\"\n"
789-
" \"Branch Hinting\"\n"
790794
" Configurable. 0 is OFF. 1 is ON:\n"
795+
" \"Branch Hinting\" via WAMR_BUILD_BRANCH_HINTS: ${WAMR_BUILD_BRANCH_HINTS}\n"
791796
" \"Bulk Memory Operation\" via WAMR_BUILD_BULK_MEMORY: ${WAMR_BUILD_BULK_MEMORY}\n"
792797
" \"Bulk-memory-opt\" via WAMR_BUILD_BULK_MEMORY_OPT: ${WAMR_BUILD_BULK_MEMORY_OPT}\n"
793798
" \"Call-indirect-overlong\" via WAMR_BUILD_CALL_INDIRECT_OVERLONG: ${WAMR_BUILD_CALL_INDIRECT_OVERLONG}\n"

doc/build_wamr.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,15 @@ SIMDE (SIMD Everywhere) implements SIMD operations in fast interpreter mode.
611611
> [!WARNING]
612612
> This is only supported in classic interpreter mode.
613613
614+
## **Branch hints**
615+
616+
- **WAMR_BUILD_BRANCH_HINTS**=1/0, default to disable if not set
617+
618+
> [!NOTE]
619+
> Enabling this feature allows the runtime to utilize branch hints for better performance during aot/jit execution.
620+
621+
## **Combination of configurations:**
622+
614623
### **Invoke general FFI**
615624
616625
- **WAMR_BUILD_INVOKE_NATIVE_GENERAL**=1/0, default to off.

doc/tiered_support.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ This tier indicates experimental features with foundational support levels. Thes
164164
| RT-Thread Compatibility | WAMR_BUILD_PLATFORM=rt-thread | Portability |
165165
| VxWorks Compatibility | WAMR_BUILD_PLATFORM=vxworks | Portability |
166166
| Windows Compatibility | WAMR_BUILD_PLATFORM=windows | Portability |
167+
| Branch Hints | [WAMR_BUILD_BRANCH_HINTS](./build_wamr.md#branch-hints-feature) | Wasm Proposal |
167168
| Legacy Exception Handling | [WAMR_BUILD_EXCE_HANDLING](./build_wamr.md#exception-handling) | Wasm Proposal |
168169
| Multi-memory | [WAMR_BUILD_MULTI_MEMORY](./build_wamr.md#multi-memory) | Wasm Proposal |
169170
| Fast JIT | [WAMR_BUILD_FAST_JIT](./build_wamr.md#configure-fast-jit) | Running mode |

0 commit comments

Comments
 (0)