From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oa1-x29.google.com (mail-oa1-x29.google.com [IPv6:2001:4860:4864:20::29]) by sourceware.org (Postfix) with ESMTPS id 1BA5C3858C60 for ; Tue, 31 Jan 2023 03:38:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1BA5C3858C60 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rivosinc.com Received: by mail-oa1-x29.google.com with SMTP id 586e51a60fabf-163bd802238so5677229fac.1 for ; Mon, 30 Jan 2023 19:38:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20210112.gappssmtp.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=00KkYW9Vv3A7vsdpowLBNtlpsoLlCMiAJUDo+jKwWS8=; b=pRtcSviXPbtnho6ucZ148gtONC716AAnepYdima/ZDP6BZ9jopaCGNeBUN+4IoeUnF 2QGgQ5oIrsu4r03041Cde5X7GxPim5m7Q5n/3yz2q4pV6i1pv+j5ZXOuFxiFrZQdLpti JIVnLevnFp+ekWLsauBAl0Rlih61MRAyt2UlqFBBWwzpUoUk3So4QnQOg9uuX47eSFZx Lvc6bF65EeHfM9vdWfXPieyz2NLZJ7Kg/r6WQj219nVcHN+zoOoESfeX9MZ0TH6BtgbJ w/SRp/62xghD2lLKOU1IneOTYDkFMqvr9JFxhCRITdNiuNEfN+a9AVrzE+NjXAs0JmQv mmrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=00KkYW9Vv3A7vsdpowLBNtlpsoLlCMiAJUDo+jKwWS8=; b=pO2fj6h8jQ1ex1PhE7JMhot4KMn50nl7LpCCt4CEvjbIF+aLeSks7Ad526sv1O+ibv Tc6IlmOsFr1UiWT4LAKX4mriA0LtmIXORVPCnwPL/VDn8rFAKGdeRNH7DGOcKPjkGuKZ wPSZ8/A85o9ToxMczJFryjDnjLGPuIuxqpt9uCUcbzGiQgiYmRoQ6UbITj8PCbE60b80 k2pOZ94E1RpUDCekGGCAcXEiVk+fe8Ey3VnCNm3Lovhw+lJQzSZ+SMvACLbUPqwH6t5v JeFJiVrnsgdcwOzzS5oI3tYD+1QIDeaX0VLXIh8f3l+ZJFgXzk52rS3+wj2jfsloPyjq 4hGg== X-Gm-Message-State: AO0yUKVN28ZgvS5RLBKbrElG8BFtjrbs5dGnLrONH+qHBdVc23cpYSxQ fEwLXdKltcEke2/q3yF4D7crQBlp40v6SlUVeMGkr7x08XCwyOBX X-Google-Smtp-Source: AK7set+UocLUZ6VKiOMdYiDZycyOse6TMeSx6sJCInJbeul3q/vVmhbXDcrA9/HytjYSvzSB7UqkwtlczIusJlZ2UVY= X-Received: by 2002:a05:6870:d79c:b0:163:4ba0:fc7c with SMTP id bd28-20020a056870d79c00b001634ba0fc7cmr2022950oab.244.1675136284371; Mon, 30 Jan 2023 19:38:04 -0800 (PST) MIME-Version: 1.0 References: <20230130210642.7579-1-palmer@rivosinc.com> In-Reply-To: <20230130210642.7579-1-palmer@rivosinc.com> From: Nelson Chu Date: Tue, 31 Jan 2023 11:37:53 +0800 Message-ID: Subject: Re: [PATCH 1/2] gas: RISC-V: Add a test for near->far branch conversion To: Palmer Dabbelt Cc: binutils@sourceware.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,GIT_PATCH_0,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 List-Id: I always thought the test cases were already there, because the assembler branch relaxation (or branch conversion, whatever called) has been supported since the very beginning of the risc-v porting. Anyway, both of the gas and ld test cases for this are what we need, so thanks for adding them :) Nelson On Tue, Jan 31, 2023 at 5:07 AM Palmer Dabbelt wrote: > > This works in GAS and has for a very long time, but I couldn't find a > test case for it. It doesn't appear to be documented anywhere, but GCC > depends on it and I'd bet a bunch of handwritten assembly does too so > it's probably too late to drop. > --- > gas/testsuite/gas/riscv/far-branch.d | 13 +++++++++++++ > gas/testsuite/gas/riscv/far-branch.s | 6 ++++++ > 2 files changed, 19 insertions(+) > create mode 100644 gas/testsuite/gas/riscv/far-branch.d > create mode 100644 gas/testsuite/gas/riscv/far-branch.s > > diff --git a/gas/testsuite/gas/riscv/far-branch.d b/gas/testsuite/gas/riscv/far-branch.d > new file mode 100644 > index 00000000000..e781e3eadb5 > --- /dev/null > +++ b/gas/testsuite/gas/riscv/far-branch.d > @@ -0,0 +1,13 @@ > +#as: -march=rv32i > +#objdump: -d > + > +.*:[ ]+file format .* > + > + > +Disassembly of section .text: > + > +0+000 : > +[^:]+:[ ]+00b51063[ ]+bne[ ]+a0,a1,0 > +#... > +[^:]+:[ ]+00b50463[ ]+beq[ ]+a0,a1,.* > +[^:]+:[ ]+ff9fe06f[ ]+j[ ]+0 > diff --git a/gas/testsuite/gas/riscv/far-branch.s b/gas/testsuite/gas/riscv/far-branch.s > new file mode 100644 > index 00000000000..2b369ffb538 > --- /dev/null > +++ b/gas/testsuite/gas/riscv/far-branch.s > @@ -0,0 +1,6 @@ > +target: > + bne a0, a1, target > +.rep 1024 > + nop > +.endr > + bne a0, a1, target > -- > 2.39.0 >