Fix experimental_simd CanvasKit build.

Although it appeared that the experimental_simd CanvasKit build was
working, the build was not producing actual wasm SIMD operations. This
CL fixes that issue by changing the build arguments.

This issue also fixes an incorrect type issue with the SkVx wasm SIMD
implementation.

Bug: skia:10453
Change-Id: If26f84b09e4d84df36be589245878c821972dffc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302669
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
This commit is contained in:
Elliot Evans 2020-07-15 10:58:33 -06:00
parent 3de2a56407
commit 72b8aea019
2 changed files with 15 additions and 14 deletions

View File

@ -671,11 +671,11 @@ static inline Vec<N,uint8_t> approx_scale(const Vec<N,uint8_t>& x, const Vec<N,u
));
}
static inline Vec<4,int32_t> any(const Vec<4,int32_t>& x) {
return to_vec<4,int32_t>(wasm_i32x4_any_true(to_vext(x)));
static inline bool any(const Vec<4,int32_t>& x) {
return wasm_i32x4_any_true(to_vext(x));
}
static inline Vec<4,int32_t> all(const Vec<4,int32_t>& x) {
return to_vec<4,int32_t>(wasm_i32x4_all_true(to_vext(x)));
static inline bool all(const Vec<4,int32_t>& x) {
return wasm_i32x4_all_true(to_vext(x));
}
static inline Vec<4,int32_t> min(const Vec<4,int32_t>& x, const Vec<4,int32_t>& y) {
return to_vec<4,int32_t>(wasm_i32x4_min(to_vext(x), to_vext(y)));
@ -687,11 +687,11 @@ static inline Vec<N,uint8_t> approx_scale(const Vec<N,uint8_t>& x, const Vec<N,u
return to_vec<4,int32_t>(wasm_i32x4_abs(to_vext(x)));
}
static inline Vec<4,uint32_t> any(const Vec<4,uint32_t>& x) {
return to_vec<4,uint32_t>(wasm_i32x4_any_true(to_vext(x)));
static inline bool any(const Vec<4,uint32_t>& x) {
return wasm_i32x4_any_true(to_vext(x));
}
static inline Vec<4,uint32_t> all(const Vec<4,uint32_t>& x) {
return to_vec<4,uint32_t>(wasm_i32x4_all_true(to_vext(x)));
static inline bool all(const Vec<4,uint32_t>& x) {
return wasm_i32x4_all_true(to_vext(x));
}
static inline Vec<4,uint32_t> min(const Vec<4,uint32_t>& x,
const Vec<4,uint32_t>& y) {

View File

@ -47,16 +47,17 @@ elif [[ $@ == *profiling* ]]; then
echo "Building a build for profiling"
RELEASE_CONF+=" --profiling-funcs --closure 0"
BUILD_DIR=${BUILD_DIR:="out/canvaskit_wasm_profile"}
elif [[ $@ == *simd* ]]; then
echo "Building a Debug build with SIMD operations"
EXTRA_CFLAGS="\"-DSK_DEBUG\""
RELEASE_CONF="-O0 -msimd128 --js-opts 0 -s DEMANGLE_SUPPORT=1 -s ASSERTIONS=1 -s GL_ASSERTIONS=1 -g4 \
--source-map-base /node_modules/canvaskit/bin/ -DSK_DEBUG --pre-js $BASE_DIR/debug.js"
BUILD_DIR=${BUILD_DIR:="out/canvaskit_wasm_experimental_simd"}
else
BUILD_DIR=${BUILD_DIR:="out/canvaskit_wasm"}
fi
if [[ $@ == *simd* ]]; then
echo "Building with SIMD operations"
RELEASE_CONF+=" -msimd128"
EXTRA_CFLAGS+=" \"-msimd128\""
BUILD_DIR=${BUILD_DIR:="out/canvaskit_wasm_experimental_simd"}
fi
mkdir -p $BUILD_DIR
# sometimes the .a files keep old symbols around - cleaning them out makes sure
# we get a fresh build.