Commit d69bfcf7 authored by Clemens Backes's avatar Clemens Backes Committed by Commit Bot

[wasm] Fix MSVC compile error

MSVC wants the static cast, even if the constant fits in the narrower
type anyway.

R=ahaas@chromium.org

Change-Id: I40043c02db1524ac591f6dcea14333695a53d028
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1924356Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65482}
parent 4bae0d6a
...@@ -108,8 +108,10 @@ class LoadType { ...@@ -108,8 +108,10 @@ class LoadType {
const LoadTypeValue val_; const LoadTypeValue val_;
static constexpr uint8_t kLoadSizeLog2[] = { static constexpr uint8_t kLoadSizeLog2[] = {
// MSVC wants a static_cast here.
#define LOAD_SIZE(_, __, memtype) \ #define LOAD_SIZE(_, __, memtype) \
ElementSizeLog2Of(MachineType::memtype().representation()), static_cast<uint8_t>( \
ElementSizeLog2Of(MachineType::memtype().representation())),
FOREACH_LOAD_TYPE(LOAD_SIZE) FOREACH_LOAD_TYPE(LOAD_SIZE)
#undef LOAD_SIZE #undef LOAD_SIZE
}; };
...@@ -176,8 +178,9 @@ class StoreType { ...@@ -176,8 +178,9 @@ class StoreType {
const StoreTypeValue val_; const StoreTypeValue val_;
static constexpr uint8_t kStoreSizeLog2[] = { static constexpr uint8_t kStoreSizeLog2[] = {
// MSVC wants a static_cast here.
#define STORE_SIZE(_, __, memrep) \ #define STORE_SIZE(_, __, memrep) \
ElementSizeLog2Of(MachineRepresentation::k##memrep), static_cast<uint8_t>(ElementSizeLog2Of(MachineRepresentation::k##memrep)),
FOREACH_STORE_TYPE(STORE_SIZE) FOREACH_STORE_TYPE(STORE_SIZE)
#undef STORE_SIZE #undef STORE_SIZE
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment