This version is more composable and also simpler at the expense of being more explicit and more verbose. This patch is not meant to be submitted but gives an idea of the change. Codegen can be checked in https://godbolt.org/z/6z1dEoWbs by removing the "static inline" before individual functions. Unittests are coming. Suggested review order: - utils - op_base - op_builtin - op_generic - op_x86 / op_aarch64 - *_implementations.h Differential Revision: https://reviews.llvm.org/D135134
22 lines
740 B
C++
22 lines
740 B
C++
//===-- Implementation of memset ------------------------------------------===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "src/string/memset.h"
|
|
#include "src/__support/common.h"
|
|
#include "src/string/memory_utils/memset_implementations.h"
|
|
|
|
namespace __llvm_libc {
|
|
|
|
LLVM_LIBC_FUNCTION(void *, memset, (void *dst, int value, size_t count)) {
|
|
inline_memset(reinterpret_cast<char *>(dst), static_cast<uint8_t>(value),
|
|
count);
|
|
return dst;
|
|
}
|
|
|
|
} // namespace __llvm_libc
|