Skip to content

Commit

Permalink
[libc][NFC] Allow compilation of memcpy with -m32 (#93790)
Browse files Browse the repository at this point in the history
Needed to support i386 (#93709).
  • Loading branch information
gchatelet committed May 31, 2024
1 parent b1be480 commit 48ba7da
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions libc/src/string/memory_utils/op_x86.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#include "src/__support/macros/properties/architectures.h"

#if defined(LIBC_TARGET_ARCH_IS_X86_64)
#if defined(LIBC_TARGET_ARCH_IS_X86)

#include "src/__support/common.h"
#include "src/string/memory_utils/op_builtin.h"
Expand Down Expand Up @@ -316,6 +316,6 @@ LIBC_INLINE MemcmpReturnType cmp_neq<__m512i>(CPtr p1, CPtr p2, size_t offset) {

} // namespace LIBC_NAMESPACE::generic

#endif // LIBC_TARGET_ARCH_IS_X86_64
#endif // LIBC_TARGET_ARCH_IS_X86

#endif // LLVM_LIBC_SRC_STRING_MEMORY_UTILS_OP_X86_H
2 changes: 1 addition & 1 deletion libc/src/string/memory_utils/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ LIBC_INLINE MemcmpReturnType cmp_uint32_t(uint32_t a, uint32_t b) {
// otherwise. This implements the semantic of 'memcmp' when we know that 'a' and
// 'b' differ.
LIBC_INLINE MemcmpReturnType cmp_neq_uint64_t(uint64_t a, uint64_t b) {
#if defined(LIBC_TARGET_ARCH_IS_X86_64)
#if defined(LIBC_TARGET_ARCH_IS_X86)
// On x86, the best strategy would be to use 'INT32_MAX' and 'INT32_MIN' for
// positive and negative value respectively as they are one value apart:
// xor eax, eax <- free
Expand Down

0 comments on commit 48ba7da

Please sign in to comment.