5#ifndef V8_COMMON_SIMD128_H_
6#define V8_COMMON_SIMD128_H_
15#define FOREACH_SIMD_TYPE(V) \
16 V(double, float64x2, f64x2, 2) \
17 V(float, float32x4, f32x4, 4) \
18 V(int64_t, int64x2, i64x2, 2) \
19 V(int32_t, int32x4, i32x4, 4) \
20 V(int16_t, int16x8, i16x8, 8) \
21 V(int8_t, int8x16, i8x16, 16)
23#define DEFINE_SIMD_TYPE(cType, sType, name, kSize) \
28#undef DEFINE_SIMD_TYPE
34#define DEFINE_SIMD_TYPE_SPECIFIC_METHODS(cType, sType, name, size) \
35 explicit Simd128(sType val) { \
36 base::WriteUnalignedValue<sType>(reinterpret_cast<Address>(val_), val); \
38 sType to_##name() const { \
39 return base::ReadUnalignedValue<sType>(reinterpret_cast<Address>(val_)); \
42#undef DEFINE_SIMD_TYPE_SPECIFIC_METHODS
45 memcpy(
static_cast<void*
>(val_),
reinterpret_cast<void*
>(bytes),
50 return memcmp(val_, other.val_,
sizeof val_) == 0;
53 const uint8_t*
bytes() {
return val_; }
59 uint8_t val_[16] = {0};
62#define DECLARE_CAST(cType, sType, name, size) \
64 inline sType Simd128::to() const { \
#define DECLARE_CAST(CamelName)
bool operator==(const Simd128 &other) const noexcept
constexpr int kSimd128Size
#define FOREACH_SIMD_TYPE(V)
#define DEFINE_SIMD_TYPE_SPECIFIC_METHODS(cType, sType, name, size)
#define DEFINE_SIMD_TYPE(cType, sType, name, kSize)