From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by sourceware.org (Postfix) with ESMTPS id ECE4738582A1 for ; Fri, 29 Jul 2022 22:14:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org ECE4738582A1 Received: by mail-pj1-x1034.google.com with SMTP id 15-20020a17090a098f00b001f305b453feso9634570pjo.1 for ; Fri, 29 Jul 2022 15:14:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=IcqtHaHL2N7aF/2W7Mu6FLs/9UycvOKxJKedOgkF4ik=; b=3+3URL3qM4nTFiBnUOSKtz9gG00tf+EvfZphbj8NFAIwGIPk1XG36UWvLTOyfc+A9e O80dQzMOVDBcXQyw+n6pnHhuVLeH6pJPor9RA2ondg0dDTXIwGJPLzfFYS0c2DWcvpw+ dHytNgrVuTbHnsdvSLc1B0H5aqgN3q14cEw3kSMdX6vtjgQ8GLPXj2jYnyR/fsbIMOWb 4XpMzmx67GNFT1HiDqPsIVyFqPgQNZRWvACY7QnYqtUM6PDuv3bC87pErSyTf+ITEsFU xZBtC06yJ6XNoO4I1Qp7HFPeI0tQjm/wvBqvSVbUgMj5sKYPepyHNTuTFNIarxC3KQd6 1UAQ== X-Gm-Message-State: ACgBeo2L8zAg+SF5kuMgprl7dw3sLvAcaCFi7bXQ65wO7DKPVWghfJR7 4rTqSQ1707/LwsK+V8hfeqgb+9METYJG2fsRhV8= X-Google-Smtp-Source: AA6agR4h5ZFatOCSDcyd47XIUltpnO+he9jbBbU0a3JF1VP6Hg/htfT9UnAE5yHpDeUJaVX9lLL5HvjyFyrPSo+RDzQ= X-Received: by 2002:a17:902:a502:b0:151:8289:b19 with SMTP id s2-20020a170902a50200b0015182890b19mr5848899plq.149.1659132876890; Fri, 29 Jul 2022 15:14:36 -0700 (PDT) MIME-Version: 1.0 References: <20220625175259.3171982-1-och95@yandex.ru> <87a68r8x9l.fsf@igel.home> In-Reply-To: <87a68r8x9l.fsf@igel.home> From: Cary Coutant Date: Fri, 29 Jul 2022 15:14:25 -0700 Message-ID: Subject: Re: [PATCH] gold/aarch64: Fix adrp distance check To: Andreas Schwab Cc: Cary Coutant via Binutils , Vladislav Khmelevsky Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jul 2022 22:14:39 -0000 > > The cast is unnecessary here for assignment to an int64_t. Once the > > result is in a signed int, I don't think you need to go to all that > > extra trouble to shift it. > > Note that right shifting a negative value is fully defined only in C++20 > and later. Yes, you're right, thanks. I was tempted to say that every compiler we care about does that as an arithmetic shift, but of course that's careless. Then I saw that the arm-gcc compiler translates that ?: idiom into a single "asr" instruction. Kinda suggests we should have an ASR macro somewhere common. Still, the static cast is unnecessary, and I see no need to introduce the temporary "offset" instead of "adrp_imm". -cary