-
Notifications
You must be signed in to change notification settings - Fork 0
Description
I just synced wav with the recent changes in LLVM (from emscripten tot), and noticed several issues.
These issues are clearly in LLVM, but I don't want to bombard them with lots of issues they are already aware of. @tlively, do you want me to file these in LLVM's bug tracker?
- Missing
__builtin_wasm_abs_i64x2 - Missing 64-bit shl and shr (there are no intrinsics, but shifting the vectors doesn't output the right instruction)
- any_true should be element-type agnostic
- Missing 64-bit all_true
- Pointers parameters to __builtin_wasm_load{32,64}_zero should be const, otherwise you may end up with an annoying
-Wcast-qualdiagnostic.
Some issues which may be in LLVM or WABT:
- wasm2wat says that code generated by
__builtin_wasm_popcnt_i8x16usesi16x8.extadd_pairwise_i8x16_s. wasm-dis saysi8x16.popcnt. Reported as [SIMD] wasm2wat outputs incorrect instruction for i8x16.popcount WebAssembly/wabt#1653 - For 64-bit comparisons (using i64x2.eq for example), wasm2wat says
cmpeq.wasm:000007a: error: type mismatch in function, expected [] but got [v128] - Both wasm2wat and wasm-dis have problems with __bulitin_wasm_load8_lane (I don't think I tried other load*_lane functions):
- wasm2wat:
[parse exception: surprising value (at 0:4)] - wasm-dis:
load_lane.wasm:0000076: error: alignment (0) must be a power of 2
- wasm2wat:
I'm guessing the first two are WABT issues, the third one feels like LLVM.
I also have a lot places where I have to use the built-in functions because portable (within clang) versions don't generate the right instructions. I've kept the code around for now because I think they'll be helpful for improving the WASM codegen, but they're not really bugs so much as missing features. There are quite a few of these, just search for WAV_BUILTIN_MISSING_OPT in the current version of the header. If you want, I can go through and file a bunch of bugs similar to 49655 ("Masks on SIMD shift values should be elided")?