From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6792 invoked by alias); 21 Apr 2012 04:45:51 -0000 Received: (qmail 6778 invoked by uid 22791); 21 Apr 2012 04:45:49 -0000 X-SWARE-Spam-Status: No, hits=-5.2 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp.gentoo.org (HELO smtp.gentoo.org) (140.211.166.183) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 21 Apr 2012 04:45:06 +0000 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 8CC301B40EB for ; Sat, 21 Apr 2012 04:34:48 +0000 (UTC) From: Mike Frysinger To: libc-ports@sourceware.org Subject: [PATCH 18/21] ia64: splitting of 16bit funcs out of byteswap.h and into byteswap-16.h Date: Sat, 21 Apr 2012 04:45:00 -0000 Message-Id: <1334982948-12167-15-git-send-email-vapier@gentoo.org> In-Reply-To: <1334982948-12167-1-git-send-email-vapier@gentoo.org> References: <1334982921-12113-1-git-send-email-vapier@gentoo.org> <1334982948-12167-1-git-send-email-vapier@gentoo.org> X-IsSubscribed: yes Mailing-List: contact libc-ports-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: libc-ports-owner@sourceware.org X-SW-Source: 2012-04/txt/msg00113.txt.bz2 The main tree split the 16bit byteswap funcs out into a dedicated header. Do the same for ia64. Signed-off-by: Mike Frysinger 2012-04-17 Mike Frysinger * sysdeps/ia64/bits/byteswap.h (__bswap_16): Removed. Include to get __bswap_16. * sysdeps/ia64/bits/byteswap-16.h: New file. --- sysdeps/ia64/bits/byteswap-16.h | 42 +++++++++++++++++++++++++++++++++++++++ sysdeps/ia64/bits/byteswap.h | 26 ++--------------------- 2 files changed, 45 insertions(+), 23 deletions(-) create mode 100644 sysdeps/ia64/bits/byteswap-16.h diff --git a/sysdeps/ia64/bits/byteswap-16.h b/sysdeps/ia64/bits/byteswap-16.h new file mode 100644 index 0000000..0a85909 --- /dev/null +++ b/sysdeps/ia64/bits/byteswap-16.h @@ -0,0 +1,42 @@ +/* Macros to swap the order of bytes in 16-bit integer values. + Copyright (C) 1997-2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _BITS_BYTESWAP_H +# error "Never use directly; include instead." +#endif + +#if defined __GNUC__ && __GNUC__ >= 2 +# define __bswap_16(x) \ + (__extension__ \ + ({ register unsigned short int __v, __x = (x); \ + if (__builtin_constant_p (x)) \ + __v = __bswap_constant_16 (__x); \ + else \ + __asm__ __volatile__ ("shl %0 = %1, 48 ;;" \ + "mux1 %0 = %0, @rev ;;" \ + : "=r" (__v) \ + : "r" ((unsigned short int) (__x))); \ + __v; })) +#else +/* This is better than nothing. */ +static __inline unsigned short int +__bswap_16 (unsigned short int __bsx) +{ + return __bswap_constant_16 (__bsx); +} +#endif diff --git a/sysdeps/ia64/bits/byteswap.h b/sysdeps/ia64/bits/byteswap.h index db7824a..6861248 100644 --- a/sysdeps/ia64/bits/byteswap.h +++ b/sysdeps/ia64/bits/byteswap.h @@ -1,6 +1,5 @@ /* Macros to swap the order of bytes in integer values. - Copyright (C) 1997,1998,2000,2002,2003,2008,2011 - Free Software Foundation, Inc. + Copyright (C) 1997-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -28,27 +27,8 @@ #define __bswap_constant_16(x) \ ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8)) -#if defined __GNUC__ && __GNUC__ >= 2 -# define __bswap_16(x) \ - (__extension__ \ - ({ register unsigned short int __v, __x = (x); \ - if (__builtin_constant_p (x)) \ - __v = __bswap_constant_16 (__x); \ - else \ - __asm__ __volatile__ ("shl %0 = %1, 48 ;;" \ - "mux1 %0 = %0, @rev ;;" \ - : "=r" (__v) \ - : "r" ((unsigned short int) (__x))); \ - __v; })) -#else -/* This is better than nothing. */ -static __inline unsigned short int -__bswap_16 (unsigned short int __bsx) -{ - return __bswap_constant_16 (__bsx); -} -#endif - +/* Get __bswap_16. */ +#include /* Swap bytes in 32 bit value. */ #define __bswap_constant_32(x) \ -- 1.7.8.5