From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com [68.232.137.180]) by sourceware.org (Postfix) with ESMTPS id 0143D3948822 for ; Fri, 6 May 2022 15:23:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0143D3948822 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="5.91,203,1647331200"; d="scan'208";a="75238868" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa3.mentor.iphmx.com with ESMTP; 06 May 2022 07:23:42 -0800 IronPort-SDR: 4zd8WL7n8MnFdqIzK8Lo0tj1ZnwwJzZgEqE3CKKBzc6Byf/enuPhYmtvbigqhOArSZqSdkljeO z31YQ6Cp87doI/1+MPz8gR249y5Tp6+azrSXlr4YoQ19MnAMxUbYrC6EOWsXx4Dihy3DW5iRgP 5Y71txk/imPk1XZg7swDCVsAZCzP1gcEeB9wwrwI+2ZA2itQA7kcHVlXxXavAU2T81mRKcRGcJ xdJ29T7hbxstxbt1O8+AIs84Vwl+K48oFact7e+6yqXylA6pTgyQJoK0lshNBWTBUFiUVs9unj quY= Date: Fri, 6 May 2022 15:23:36 +0000 From: Joseph Myers X-X-Sender: jsm28@digraph.polyomino.org.uk To: Jakub Jelinek CC: Matthias Gehre , "gcc@gcc.gnu.org" Subject: =?ISO-8859-15?Q?Re=3A_=5BRFC=5D_Adding_division=2Fmodulo_on_arb?= =?ISO-8859-15?Q?itrary_precision=A0integers=A0to=A0libgcc?= In-Reply-To: Message-ID: References: User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: SVR-IES-MBX-07.mgc.mentorg.com (139.181.222.7) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-3113.5 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2022 15:23:46 -0000 On Fri, 6 May 2022, Jakub Jelinek via Gcc wrote: > And I really don't like the N + 1 stuff you're proposing, at least for > _BigInts that would be represented as an array of those word etc. elements > from least to most significant (or vice versa? That really needs to be > specified too), if they are same precision having to copy one of them just > to get the extra scratch is bad. Note that the proposed x86_64 ABI for _BitInt (branch usr/hjl/bitint) says that padding bits are unspecified. That means that when the width isn't a multiple of the word size, either you need to copy to zero-extend / sign-extend (in the general case where a variable of _BitInt type is read from memory / function argument / ..., so the code doing arithmetic on it doesn't have any further information about the values of those bits that it might have if it had computed the value itself), even in the absence of needing to allocate extra memory or allowing the libgcc function to write to those arrays, or you need to pass in a width in bits (rather than a number of words) to the libgcc function so that it can tell which bits are padding. -- Joseph S. Myers joseph@codesourcery.com