#include <cmath>
#include <functional>
#include <limits>
#include "src/base/bits.h"
#include "src/base/overflowing-math.h"
#include "src/base/template-utils.h"
#include "src/base/utils/random-number-generator.h"
#include "src/objects/objects-inl.h"
#include "src/objects/tagged.h"
#include "test/cctest/cctest.h"
#include "test/cctest/compiler/codegen-tester.h"
#include "test/common/value-helper.h"
namespace v8 {
namespace internal {
namespace compiler {
enum TestAlignment { … };
#if V8_TARGET_LITTLE_ENDIAN
#define LSB …
#elif V8_TARGET_BIG_ENDIAN
#define LSB …
#else
#error "Unknown Architecture"
#endif
#define A_BILLION …
#define A_GIG …
namespace {
uint8_t* ComputeOffset(void* real_address, int32_t offset) { … }
void RunLoadInt32(const TestAlignment t) { … }
void RunLoadInt32Offset(TestAlignment t) { … }
void RunLoadStoreFloat32Offset(TestAlignment t) { … }
void RunLoadStoreFloat64Offset(TestAlignment t) { … }
}
TEST(RunLoadInt32) { … }
TEST(RunUnalignedLoadInt32) { … }
TEST(RunLoadInt32Offset) { … }
TEST(RunUnalignedLoadInt32Offset) { … }
TEST(RunLoadStoreFloat32Offset) { … }
TEST(RunUnalignedLoadStoreFloat32Offset) { … }
TEST(RunLoadStoreFloat64Offset) { … }
TEST(RunUnalignedLoadStoreFloat64Offset) { … }
namespace {
template <typename CType>
void CheckEq(CType in_value, CType out_value) { … }
#ifdef V8_COMPRESS_POINTERS
template <>
void CheckEq<Tagged<Object>>(Tagged<Object> in_value,
Tagged<Object> out_value) { … }
template <>
void CheckEq<Tagged<HeapObject>>(Tagged<HeapObject> in_value,
Tagged<HeapObject> out_value) { … }
template <>
void CheckEq<Tagged<Smi>>(Tagged<Smi> in_value, Tagged<Smi> out_value) { … }
#endif
template <typename CType>
void InitBuffer(CType* buffer, size_t length, MachineType type) { … }
template <typename CType>
void RunLoadImmIndex(MachineType type, TestAlignment t) { … }
template <typename CType>
void RunLoadStore(MachineType type, TestAlignment t) { … }
template <typename CType>
void RunUnalignedLoadStoreUnalignedAccess(MachineType type) { … }
}
TEST(RunLoadImmIndex) { … }
TEST(RunUnalignedLoadImmIndex) { … }
TEST(RunLoadStore) { … }
TEST(RunUnalignedLoadStore) { … }
TEST(RunUnalignedLoadStoreUnalignedAccess) { … }
namespace {
void RunLoadStoreSignExtend32(TestAlignment t) { … }
void RunLoadStoreZeroExtend32(TestAlignment t) { … }
}
TEST(RunLoadStoreSignExtend32) { … }
TEST(RunUnalignedLoadStoreSignExtend32) { … }
TEST(RunLoadStoreZeroExtend32) { … }
TEST(RunUnalignedLoadStoreZeroExtend32) { … }
#if V8_TARGET_ARCH_64_BIT
namespace {
void RunLoadStoreSignExtend64(TestAlignment t) { … }
void RunLoadStoreZeroExtend64(TestAlignment t) { … }
}
TEST(RunLoadStoreSignExtend64) { … }
TEST(RunUnalignedLoadStoreSignExtend64) { … }
TEST(RunLoadStoreZeroExtend64) { … }
TEST(RunUnalignedLoadStoreZeroExtend64) { … }
#endif
namespace {
template <typename IntType>
void LoadStoreTruncation(MachineType kRepresentation, TestAlignment t) { … }
}
TEST(RunLoadStoreTruncation) { … }
TEST(RunUnalignedLoadStoreTruncation) { … }
#undef LSB
#undef A_BILLION
#undef A_GIG
}
}
}