brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · e907ae4 Raw
35 lines · c
1//===-- Memcpy implementation for riscv -------------------------*- C++ -*-===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8#ifndef LIBC_SRC_STRING_MEMORY_UTILS_RISCV_INLINE_MEMCPY_H9#define LIBC_SRC_STRING_MEMORY_UTILS_RISCV_INLINE_MEMCPY_H10 11#include "src/__support/macros/attributes.h"               // LIBC_INLINE12#include "src/__support/macros/config.h" // LIBC_NAMESPACE_DECL13#include "src/__support/macros/properties/architectures.h" // LIBC_TARGET_ARCH_IS_RISCV6414#include "src/string/memory_utils/generic/aligned_access.h"15#include "src/string/memory_utils/utils.h" // Ptr, CPtr16 17#include <stddef.h> // size_t18 19namespace LIBC_NAMESPACE_DECL {20 21[[maybe_unused]] LIBC_INLINE void22inline_memcpy_riscv(Ptr __restrict dst, CPtr __restrict src, size_t count) {23#if defined(LIBC_TARGET_ARCH_IS_RISCV64)24  return inline_memcpy_aligned_access_64bit(dst, src, count);25#elif defined(LIBC_TARGET_ARCH_IS_RISCV32)26  return inline_memcpy_aligned_access_32bit(dst, src, count);27#else28#error "Unimplemented"29#endif30}31 32} // namespace LIBC_NAMESPACE_DECL33 34#endif // LIBC_SRC_STRING_MEMORY_UTILS_RISCV_INLINE_MEMCPY_H35