#include "src/base/SkMSAN.h"
#include "src/core/SkMemset.h"
#include <cstddef>
#include <cstdint>
#if (defined(__x86_64__) || defined(_M_X64)) && !defined(SK_ENABLE_OPTIMIZE_SIZE)
static const char* note = …;
#if defined(_MSC_VER)
#include <intrin.h>
static inline void repsto(uint16_t* dst, uint16_t v, size_t n) {
sk_msan_mark_initialized(dst, dst + n, note);
__stosw(dst, v, n);
}
static inline void repsto(uint32_t* dst, uint32_t v, size_t n) {
sk_msan_mark_initialized(dst, dst + n, note);
static_assert(sizeof(uint32_t) == sizeof(unsigned long));
__stosd(reinterpret_cast<unsigned long*>(dst), v, n);
}
static inline void repsto(uint64_t* dst, uint64_t v, size_t n) {
sk_msan_mark_initialized(dst, dst + n, note);
__stosq(dst, v, n);
}
#else
static inline void repsto(uint16_t* dst, uint16_t v, size_t n) { … }
static inline void repsto(uint32_t* dst, uint32_t v, size_t n) { … }
static inline void repsto(uint64_t* dst, uint64_t v, size_t n) { … }
#endif
static void (*g_memset16_prev)(uint16_t*, uint16_t, int);
static void (*g_memset32_prev)(uint32_t*, uint32_t, int);
static void (*g_memset64_prev)(uint64_t*, uint64_t, int);
static void (*g_rect_memset16_prev)(uint16_t*, uint16_t, int, size_t, int);
static void (*g_rect_memset32_prev)(uint32_t*, uint32_t, int, size_t, int);
static void (*g_rect_memset64_prev)(uint64_t*, uint64_t, int, size_t, int);
static bool small(size_t bytes) { … }
namespace erms {
static inline void memset16(uint16_t* dst, uint16_t v, int n) { … }
static inline void memset32(uint32_t* dst, uint32_t v, int n) { … }
static inline void memset64(uint64_t* dst, uint64_t v, int n) { … }
static inline void rect_memset16(uint16_t* dst, uint16_t v, int n, size_t rowBytes, int height) { … }
static inline void rect_memset32(uint32_t* dst, uint32_t v, int n, size_t rowBytes, int height) { … }
static inline void rect_memset64(uint64_t* dst, uint64_t v, int n, size_t rowBytes, int height) { … }
}
#endif
namespace SkOpts {
void Init_Memset_erms() { … }
}