From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vk1-xa31.google.com (mail-vk1-xa31.google.com [IPv6:2607:f8b0:4864:20::a31]) by sourceware.org (Postfix) with ESMTPS id C29E33858414 for ; Fri, 25 Feb 2022 09:10:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C29E33858414 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=sifive.com Received: by mail-vk1-xa31.google.com with SMTP id l42so1228469vkd.7 for ; Fri, 25 Feb 2022 01:10:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=H4czkEiCpq8vifH/n8DiG+Ffvqmum1QgIwM5uFG4Ffs=; b=KwXz/BlcuRlpY5wXC/JkX4w7STUcxnM0iGOf2fuoCSM3i9xlH2CmPdcIS6ctd3D+bc osIk1B88fCY/r6NwCUbJvNXoWEzWLZVAPByW2hH5530ULEBs4HAV+oRYlHTBXLlsCNCE rJcTEWGZ6BSFEY8OcxF0+dWlyXjn6l7rIqyJDQap5A6/E5nLQz15ChDmjcopxmdtNODN Zw/VW+yD2API854IDwvnSvFg0RZoemPplllLMySCTHpm66TX8AxSrX9xxmk20X3wC0fr NSppFdgrFXLgeNWfXOCO4evwk8OC5+PNxxSluvB2gdSPL1l+QUW3jiRJKpWa/xjYJNid OgzQ== 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=H4czkEiCpq8vifH/n8DiG+Ffvqmum1QgIwM5uFG4Ffs=; b=O817BT4o3cdvm7i+Nl6cVKztJD94Zd704DdFW5cvU4FDsiFCMNyAEALWAm/PvvIJeD J8jlNXWE0IbqCuRfakkXOhPX/ouxwULPvmqzTJUc0W8NwG4DvQhdiy2VQd6CyFL/fIAH GL/rDwaDZOy4EduCbq97/HaY+OeK1jFLDdG0IACoXguv2V51cdIogWFv8GQfPKccvCtx XYTNm2VTAlMF7eypUngJWkhbxmTTP7I5AFRBYUkqveCcc2oeX5uhHX0/rQLlLaEoyza7 4BDufrRfO/rVHs6tr0GAnsAwLSJ1nV8Iog+JHaLX5d/7r6pXPqK/gSTLSGlL458mTckP j8ZQ== X-Gm-Message-State: AOAM533iqpKaTCagfTqwXfQjqMLrCIBcc9fqgNwIQ65NS025tmnYge/0 DXPc/XEFs/DQwaZe2hMb9+ZzZQ9XP4CCs8HGg3vrmM3xf1U= X-Google-Smtp-Source: ABdhPJxn8AqEcV2LUxZdtmJgOkNb59ARZODCr7SzqtM6WCRKGsH0cLqPnXhRb9ViLFyJuVB/o4hYZH5J/hfcSiYvYZU= X-Received: by 2002:a05:6122:169d:b0:321:602f:a70f with SMTP id 29-20020a056122169d00b00321602fa70fmr3092733vkl.3.1645780226346; Fri, 25 Feb 2022 01:10:26 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Nelson Chu Date: Fri, 25 Feb 2022 17:10:15 +0800 Message-ID: Subject: Re: [PATCH 1/3] RISC-V: Remove a loop in the ISA parser To: Tsukasa OI Cc: Binutils Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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, 25 Feb 2022 09:10:27 -0000 On Wed, Feb 23, 2022 at 9:48 AM Tsukasa OI via Binutils wrote: > > Since commit e601909a3287bf541c6a7d82214bb387d2c76d82 ("RISC-V: Support > to parse the multi-letter prefix in the architecture string.") changed > so that all prefixed extensions are parsed in single > riscv_parse_prefixed_ext call, a "while" loop on riscv_parse_subset > is no longer required. Make sense! LGTM, so committed. Thanks Nelson > bfd/ChangeLog: > > * elfxx-riscv.c (riscv_parse_subset): Remove unnecessary loop. > --- > bfd/elfxx-riscv.c | 11 ++++------- > 1 file changed, 4 insertions(+), 7 deletions(-) > > diff --git a/bfd/elfxx-riscv.c b/bfd/elfxx-riscv.c > index 27d06d2fa3d..329dcaed304 100644 > --- a/bfd/elfxx-riscv.c > +++ b/bfd/elfxx-riscv.c > @@ -2019,14 +2019,11 @@ riscv_parse_subset (riscv_parse_subset_t *rps, > if (p == NULL) > return false; > > - /* Parse the different classes of extensions in the specified order. */ > - while (*p != '\0') > - { > - p = riscv_parse_prefixed_ext (rps, arch, p); > + /* Parse prefixed extensions. */ > + p = riscv_parse_prefixed_ext (rps, arch, p); > > - if (p == NULL) > - return false; > - } > + if (p == NULL) > + return false; > > /* Finally add implicit extensions according to the current > extensions. */ > -- > 2.32.0 >