Skip to content

Commit 48ba7da

Browse files
authored
[libc][NFC] Allow compilation of memcpy with -m32 (#93790)
Needed to support i386 (#93709).
1 parent b1be480 commit 48ba7da

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

libc/src/string/memory_utils/op_x86.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

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

17-
#if defined(LIBC_TARGET_ARCH_IS_X86_64)
17+
#if defined(LIBC_TARGET_ARCH_IS_X86)
1818

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

317317
} // namespace LIBC_NAMESPACE::generic
318318

319-
#endif // LIBC_TARGET_ARCH_IS_X86_64
319+
#endif // LIBC_TARGET_ARCH_IS_X86
320320

321321
#endif // LLVM_LIBC_SRC_STRING_MEMORY_UTILS_OP_X86_H

libc/src/string/memory_utils/utils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ LIBC_INLINE MemcmpReturnType cmp_uint32_t(uint32_t a, uint32_t b) {
170170
// otherwise. This implements the semantic of 'memcmp' when we know that 'a' and
171171
// 'b' differ.
172172
LIBC_INLINE MemcmpReturnType cmp_neq_uint64_t(uint64_t a, uint64_t b) {
173-
#if defined(LIBC_TARGET_ARCH_IS_X86_64)
173+
#if defined(LIBC_TARGET_ARCH_IS_X86)
174174
// On x86, the best strategy would be to use 'INT32_MAX' and 'INT32_MIN' for
175175
// positive and negative value respectively as they are one value apart:
176176
// xor eax, eax <- free

0 commit comments

Comments
 (0)