Received: by 2002:a05:7412:3210:b0:e2:908c:2ebd with SMTP id eu16csp88145rdb; Thu, 31 Aug 2023 04:05:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGQ4ZDqjGfZIhbmHebUEVJwFpkuQuU83LbkiofIHBQ61b1jpY+IcrV4e5pCKYxpQxRQEI9L X-Received: by 2002:a17:902:e54e:b0:1c1:eb8b:799d with SMTP id n14-20020a170902e54e00b001c1eb8b799dmr3206821plf.21.1693479935026; Thu, 31 Aug 2023 04:05:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693479935; cv=none; d=google.com; s=arc-20160816; b=JuQK2oTQtwX3dpkE9IaJJXlBbX88BwCSNiUn5f2ZTuSJM7QDG4cR/M9tchZWEGBIVK c12NS3GgW1N6hrY0O7F8uIZKTdSv2MCO38kUeMpBcaaBTzec5300+2wkpOPwC0wV217N jvZRQhWX6wxVizNsWO0RdvpgJSIlQ/LbmWNRkjKvO74ahJLK1Fmu+QV9Wdo1hS3R/8/v 70P39ZWRxX33yWnVgjKN/wZGwNkgblxu+WTg2/GJM3A17tCiDv5LeWj6P0bxERACMf79 W7uvDxIrelK9UxVx8sIVWCpl4RlT7mxbm4RulM6qUf70vrKGHpsXrp8IcGEPGKHDh2Bw kKiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :mime-version:accept-language:in-reply-to:references:message-id:date :thread-index:thread-topic:subject:cc:to:from; bh=E/EswWIK7Z91L24vnCmvAi/+/5GnRs+oSZoKacBbzyI=; fh=/lmxWyYW+1HKAPvtN48ZxoUWgn7/naUIVhJa0tLEQsQ=; b=pkuS85vx+mu7eax/bMEQfejvbdzuc2q2M+8Esfr0JDemMsJY78oMkdwCsliVSKSiJt jCgLcx/AuqcfZvaHSGiYeNiRghZh8dWeuS8TjQWyA1hz6hog9soP1Z3CmZP2tIr7vLcL RZM79U2afKaOmO5v5ahfdhgY2CNwQ+BG7i1gGFNl4Sjrzt0rpNBcE6qC+gd7XehdJoe9 NbyWOVEtMcDJIlV0KZrXP8etYlW3o+rgYR3jt3rQSFH8aSjUdHiCNDKpqI6U7h5Thgkv mraQEZPTTFq/IYw4QeeNGL/qFZeur5FockxhXNHr4msmc6UaFminfcaLAQ/JN8qXtxu5 gzlg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 81-20020a630254000000b005646227c086si1087240pgc.376.2023.08.31.04.05.14; Thu, 31 Aug 2023 04:05:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234879AbjHaIne convert rfc822-to-8bit (ORCPT + 99 others); Thu, 31 Aug 2023 04:43:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234624AbjHaInd (ORCPT ); Thu, 31 Aug 2023 04:43:33 -0400 Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.86.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0EE70CF7 for ; Thu, 31 Aug 2023 01:43:28 -0700 (PDT) Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) by relay.mimecast.com with ESMTP with both STARTTLS and AUTH (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id uk-mta-311-LRFvNPzzO7iMs2R3ZDsrzw-1; Thu, 31 Aug 2023 09:37:14 +0100 X-MC-Unique: LRFvNPzzO7iMs2R3ZDsrzw-1 Received: from AcuMS.Aculab.com (10.202.163.6) by AcuMS.aculab.com (10.202.163.6) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Thu, 31 Aug 2023 09:37:12 +0100 Received: from AcuMS.Aculab.com ([::1]) by AcuMS.aculab.com ([::1]) with mapi id 15.00.1497.048; Thu, 31 Aug 2023 09:37:12 +0100 From: David Laight To: 'Zhangjin Wu' CC: "ammarfaizi2@gnuweeb.org" , "arnd@arndb.de" , "linux-kernel@vger.kernel.org" , "linux-kselftest@vger.kernel.org" , "tanyuan@tinylab.org" , "thomas@t-8ch.de" , "w@1wt.eu" Subject: RE: [RFC] tools/nolibc: replace duplicated -ENOSYS return with single -ENOSYS return Thread-Topic: [RFC] tools/nolibc: replace duplicated -ENOSYS return with single -ENOSYS return Thread-Index: AdnbXfVru8RTG9gTQ+SsAG5ax7hYowAeEOWAAANtgiA= Date: Thu, 31 Aug 2023 08:37:11 +0000 Message-ID: References: <2d52dbd55e6240d5a91ebdce67fe0b7b@AcuMS.aculab.com> <20230831074151.7900-1-falcon@tinylab.org> In-Reply-To: <20230831074151.7900-1-falcon@tinylab.org> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ... > We also need this style of checking for the delta logic in __atoi_add(). have > randomly tried different clang and gcc versions, seems all of them work > correctly, but the compiling speed is not that good if we want to support the > worst cases like "((0x900000 + 0x0f0000) + 5)", the shorter one > "((0x900000+0x0f0000)+5)" is used by ARM+OABI (not supported by nolibc > currently), therefore, we can strip some tailing branches but it is either not > that fast, of course, the other architectures/variants can use faster > __atoi_add() versions with less branches and without hex detection, comparison > and calculating. If there are only a few prefix offsets then the code can be optimised to explicitly detect them - rather than decoding arbitrary hex values. After all it only needs to decode the values that actually appear. The code also needs a compile-time assert that the result is constant (__buitin_constant_p() will do the check. But you can't use _Static_assert() to report the error because that requires an 'integer constant expression'. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)