From patchwork Thu May 1 15:17:52 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Ellcey X-Patchwork-Id: 775 Return-Path: X-Original-To: siddhesh@wilcox.dreamhost.com Delivered-To: siddhesh@wilcox.dreamhost.com Received: from homiemail-mx21.g.dreamhost.com (peon2454.g.dreamhost.com [208.113.200.127]) by wilcox.dreamhost.com (Postfix) with ESMTP id B935A360075 for ; Thu, 1 May 2014 08:18:03 -0700 (PDT) Received: by homiemail-mx21.g.dreamhost.com (Postfix, from userid 14314964) id 64C1613DD393; Thu, 1 May 2014 08:18:03 -0700 (PDT) X-Original-To: gdb@patchwork.siddhesh.in Delivered-To: x14314964@homiemail-mx21.g.dreamhost.com Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by homiemail-mx21.g.dreamhost.com (Postfix) with ESMTPS id 3383813D9D9B for ; Thu, 1 May 2014 08:18:03 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:date:to:cc:subject:mime-version :content-type:content-transfer-encoding:message-id; q=dns; s= default; b=tZpP35q4g0+P8c37sx2b/aHvC9AUyY7Fd4OgOdRQZQVJfP1CDQHS3 pV+J1EnpooPETGWGQ0FTuXr6ntT1io9oAjhZe2MvP/O2QmbLtA9YdDmFi8xq4WEK gJtczhOxMTdjBFMpT/U1VSJtlJ0Dsg8TfBjKzFtJERjIZkoVWXgjwE= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:date:to:cc:subject:mime-version :content-type:content-transfer-encoding:message-id; s=default; bh=7uIxmrI7DWn00ghsAmZIqffhetU=; b=h8JvJ9WV33zXMl7kOb+K+yelxt0B nDzrQ6aebHSz2DxeB59PHYpMOGxcZKnH5C2uJAiIv2yfsJbq/aYDu5NxaMztlVqT vG7bo0f1ZzPWXzjx+LI6BdZUK/ir790T5KPIRIul6dFaziEGNqS+8dmcu765Hqr6 //J48KVLBgfD8os= Received: (qmail 14615 invoked by alias); 1 May 2014 15:18:01 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 14599 invoked by uid 89); 1 May 2014 15:18:00 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mailapp01.imgtec.com Received: from mailapp01.imgtec.com (HELO mailapp01.imgtec.com) (195.89.28.114) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 01 May 2014 15:17:58 +0000 Received: from KLMAIL01.kl.imgtec.org (unknown [192.168.5.35]) by Websense Email Security Gateway with ESMTPS id 27A5F37BBBE99; Thu, 1 May 2014 16:17:52 +0100 (IST) Received: from BAMAIL02.ba.imgtec.org (192.168.66.28) by KLMAIL01.kl.imgtec.org (192.168.5.35) with Microsoft SMTP Server (TLS) id 14.3.181.6; Thu, 1 May 2014 16:17:55 +0100 Received: from ubuntu-sellcey.mips.com (192.168.65.53) by bamail02.ba.imgtec.org (192.168.66.28) with Microsoft SMTP Server id 14.3.174.1; Thu, 1 May 2014 08:17:52 -0700 Received: by ubuntu-sellcey.mips.com (sSMTP sendmail emulation); Thu, 01 May 2014 08:17:52 -0700 From: "Steve Ellcey " Date: Thu, 1 May 2014 08:17:52 -0700 To: , CC: , Subject: [Patch] Update include/longlong.h to match GCC User-Agent: Heirloom mailx 12.5 6/20/10 MIME-Version: 1.0 Message-ID: X-DH-Original-To: gdb@patchwork.siddhesh.in I would like to update include/longlong.h to pick up the latest changes from GCC and keep this file in sync. I think changes to keep files in sync are considered pre-approved so if I don't hear any objections I will go ahead. The changes in GCC that are not yet in the binutils tree are: 2014-05-01 Steve Ellcey * include/longlong.h: Use 'defined()' to check __mips16. 2014-04-30 Richard Sandiford * longlong.h (__i386__): Remove W_TYPE_SIZE==64 handling. 2014-04-22 Yufeng Zhang * longlong.h: Merge from glibc. Steve Ellcey sellcey@mips.com 2014-05-01 Steve Ellcey * include/longlong.h: Import latest version from GCC tree. diff --git a/include/longlong.h b/include/longlong.h index 5f00e54..31f88cb 100644 --- a/include/longlong.h +++ b/include/longlong.h @@ -1,5 +1,5 @@ /* longlong.h -- definitions for mixed size 32/64 bit arithmetic. - Copyright (C) 1991-2013 Free Software Foundation, Inc. + Copyright (C) 1991-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -122,6 +122,22 @@ extern const UQItype __clz_tab[256] attribute_hidden; #define __AND_CLOBBER_CC , "cc" #endif /* __GNUC__ < 2 */ +#if defined (__aarch64__) + +#if W_TYPE_SIZE == 32 +#define count_leading_zeros(COUNT, X) ((COUNT) = __builtin_clz (X)) +#define count_trailing_zeros(COUNT, X) ((COUNT) = __builtin_ctz (X)) +#define COUNT_LEADING_ZEROS_0 32 +#endif /* W_TYPE_SIZE == 32 */ + +#if W_TYPE_SIZE == 64 +#define count_leading_zeros(COUNT, X) ((COUNT) = __builtin_clzll (X)) +#define count_trailing_zeros(COUNT, X) ((COUNT) = __builtin_ctzll (X)) +#define COUNT_LEADING_ZEROS_0 64 +#endif /* W_TYPE_SIZE == 64 */ + +#endif /* __aarch64__ */ + #if defined (__alpha) && W_TYPE_SIZE == 64 #define umul_ppmm(ph, pl, m0, m1) \ do { \ @@ -467,7 +483,7 @@ extern UDItype __umulsidi3 (USItype, USItype); #define UDIV_TIME 40 #endif /* 80x86 */ -#if (defined (__x86_64__) || defined (__i386__)) && W_TYPE_SIZE == 64 +#if defined (__x86_64__) && W_TYPE_SIZE == 64 #define add_ssaaaa(sh, sl, ah, al, bh, bl) \ __asm__ ("add{q} {%5,%1|%1,%5}\n\tadc{q} {%3,%0|%0,%3}" \ : "=r" ((UDItype) (sh)), \ @@ -832,7 +848,7 @@ extern UDItype __umulsidi3 (USItype, USItype); #define UMUL_TIME 10 #define UDIV_TIME 100 -#if (__mips == 32 || __mips == 64) && ! __mips16 +#if (__mips == 32 || __mips == 64) && ! defined (__mips16) #define count_leading_zeros(COUNT,X) ((COUNT) = __builtin_clz (X)) #define COUNT_LEADING_ZEROS_0 32 #endif