summaryrefslogtreecommitdiff
path: root/sys/arch/amd64/include
diff options
context:
space:
mode:
authorChristian Weisgerber <naddy@cvs.openbsd.org>2024-05-07 14:26:49 +0000
committerChristian Weisgerber <naddy@cvs.openbsd.org>2024-05-07 14:26:49 +0000
commita5b7b6ef4f9a056a0edc918f792bb1decb601592 (patch)
tree7e62d7cf2849865491a35656a2ef0b9af541f3a0 /sys/arch/amd64/include
parent749f1ec339c6cb683670d6a8ac6ff7582c939110 (diff)
drop the MD byte-swap micro-optimizations on clang architectures
The compiler already translates the generic code into arithmetic byte-swap instructions or byte-swapping memory load and store instructions if available on an architecture. ok deraadt@ guenther@
Diffstat (limited to 'sys/arch/amd64/include')
-rw-r--r--sys/arch/amd64/include/endian.h30
1 files changed, 1 insertions, 29 deletions
diff --git a/sys/arch/amd64/include/endian.h b/sys/arch/amd64/include/endian.h
index 3b077cd9295..3a2b46d2c51 100644
--- a/sys/arch/amd64/include/endian.h
+++ b/sys/arch/amd64/include/endian.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: endian.h,v 1.7 2018/10/02 21:30:44 naddy Exp $ */
+/* $OpenBSD: endian.h,v 1.8 2024/05/07 14:26:48 naddy Exp $ */
/*-
* Copyright (c) 1997 Niklas Hallqvist. All rights reserved.
@@ -27,34 +27,6 @@
#ifndef _MACHINE_ENDIAN_H_
#define _MACHINE_ENDIAN_H_
-#ifndef __FROM_SYS__ENDIAN
-#include <sys/_types.h>
-#endif
-
-static __inline __uint16_t
-__swap16md(__uint16_t _x)
-{
- __asm ("rorw $8, %w0" : "+r" (_x));
- return (_x);
-}
-
-static __inline __uint32_t
-__swap32md(__uint32_t _x)
-{
- __asm ("bswap %0" : "+r" (_x));
- return (_x);
-}
-
-static __inline __uint64_t
-__swap64md(__uint64_t _x)
-{
- __asm ("bswapq %0" : "+r" (_x));
- return (_x);
-}
-
-/* Tell sys/endian.h we have MD variants of the swap macros. */
-#define __HAVE_MD_SWAP
-
#define _BYTE_ORDER _LITTLE_ENDIAN
#ifndef __FROM_SYS__ENDIAN