Warning: This file is not a C or C++ file. It does not have highlighting.

1//===-- Memset 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-exception
6//
7//===----------------------------------------------------------------------===//
8#ifndef LIBC_SRC_STRING_MEMORY_UTILS_RISCV_INLINE_MEMSET_H
9#define LIBC_SRC_STRING_MEMORY_UTILS_RISCV_INLINE_MEMSET_H
10
11#include "src/__support/macros/attributes.h" // LIBC_INLINE
12#include "src/__support/macros/config.h" // LIBC_NAMESPACE_DECL
13#include "src/__support/macros/properties/architectures.h" // LIBC_TARGET_ARCH_IS_RISCV64
14#include "src/string/memory_utils/generic/aligned_access.h"
15#include "src/string/memory_utils/utils.h" // Ptr, CPtr
16
17#include <stddef.h> // size_t
18
19namespace LIBC_NAMESPACE_DECL {
20
21LIBC_INLINE static void inline_memset_riscv(Ptr dst, uint8_t value,
22 size_t count) {
23#if defined(LIBC_TARGET_ARCH_IS_RISCV64)
24 return inline_memset_aligned_access_64bit(dst, value, count);
25#elif defined(LIBC_TARGET_ARCH_IS_RISCV32)
26 return inline_memset_aligned_access_32bit(dst, value, count);
27#else
28#error "Unimplemented"
29#endif
30}
31
32} // namespace LIBC_NAMESPACE_DECL
33
34#endif // LIBC_SRC_STRING_MEMORY_UTILS_RISCV_INLINE_MEMSET_H
35

Warning: This file is not a C or C++ file. It does not have highlighting.

source code of libc/src/string/memory_utils/riscv/inline_memset.h