Commit 70927ba
committed
patches: 0024 MSVC __builtin_expect no-op shim (fixes upstream PR CI)
Upstream PR bytecodealliance/wasm-micro-runtime#4949
failed every `build_iwasm` matrix entry on Windows MSVC with
`LNK2019: unresolved external symbol __builtin_expect referenced
in function wasm_interp_call_func_bytecode`. The cold-path hints
we added in patch 0011 use the GCC/Clang `__builtin_expect`
intrinsic; MSVC has no equivalent.
Drop-in no-op shim gated on `!defined(__GNUC__) && !defined(__clang__)`.
The hints are branch-predictor optimization, not correctness, so
dropping them on MSVC is fine. Same change is on the upstream PR
branch as commit `0411662d` (separate fixup commit; lands in the
PR sequence right after patch 0011's equivalent).
Stack-position rationale: patch 0024 (after linmem 0023) inserts
9 lines near the top of `wasm_interp_fast.c` between the SIMDe
include guards and `typedef int32 CellType_I32`. Putting it last
in the apply-stack avoids shifting line-number anchors for any
of the earlier patches.1 parent c59f4e2 commit 70927ba
1 file changed
Lines changed: 38 additions & 0 deletions
Lines changed: 38 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
0 commit comments