RE: [Committed] RISC-V: Add basic Zaamo and Zalrsc support

2024-06-12 Thread Li, Pan2
Do we need to upgrade the binutils of the riscv-gnu-toolchain repo? Or we may 
have unknown prefixed ISA extension `zaamo' when building.

Pan


-Original Message-
From: Patrick O'Neill  
Sent: Wednesday, June 12, 2024 1:08 AM
To: Jeff Law ; gcc-patches@gcc.gnu.org
Cc: kito.ch...@gmail.com; e...@rivosinc.com; pal...@dabbelt.com; 
gnu-toolch...@rivosinc.com; and...@rivosinc.com
Subject: [Committed] RISC-V: Add basic Zaamo and Zalrsc support


On 6/10/24 21:33, Jeff Law wrote:
>
>
> On 6/10/24 3:46 PM, Patrick O'Neill wrote:
>> The A extension has been split into two parts: Zaamo and Zalrsc.
>> This patch adds basic support by making the A extension imply Zaamo and
>> Zalrsc.
>>
>> Zaamo/Zalrsc spec: https://github.com/riscv/riscv-zaamo-zalrsc/tags
>> Ratification: https://jira.riscv.org/browse/RVS-1995
>>
>> v2:
>> Rebased and updated some testcases that rely on the ISA string.
>>
>> v3:
>> Regex-ify temp registers in added testcases.
>> Remove unintentional whitespace changes.
>> Add riscv_{a|ztso|zaamo|zalrsc} docs to sourcebuild.texi (and move 
>> core-v bi
>> extension doc into appropriate section).
>>
>> Edwin Lu (1):
>>    RISC-V: Add basic Zaamo and Zalrsc support
>>
>> Patrick O'Neill (2):
>>    RISC-V: Add Zalrsc and Zaamo testsuite support
>>    RISC-V: Add Zalrsc amo-op patterns
>>
>>   gcc/common/config/riscv/riscv-common.cc   |  11 +-
>>   gcc/config/riscv/arch-canonicalize    |   1 +
>>   gcc/config/riscv/riscv.opt    |   6 +-
>>   gcc/config/riscv/sync.md  | 152 +++---
>>   gcc/doc/sourcebuild.texi  |  16 +-
>>   .../riscv/amo-table-a-6-amo-add-1.c   |   2 +-
>>   .../riscv/amo-table-a-6-amo-add-2.c   |   2 +-
>>   .../riscv/amo-table-a-6-amo-add-3.c   |   2 +-
>>   .../riscv/amo-table-a-6-amo-add-4.c   |   2 +-
>>   .../riscv/amo-table-a-6-amo-add-5.c   |   2 +-
>>   .../riscv/amo-table-a-6-compare-exchange-1.c  |   2 +-
>>   .../riscv/amo-table-a-6-compare-exchange-2.c  |   2 +-
>>   .../riscv/amo-table-a-6-compare-exchange-3.c  |   2 +-
>>   .../riscv/amo-table-a-6-compare-exchange-4.c  |   2 +-
>>   .../riscv/amo-table-a-6-compare-exchange-5.c  |   2 +-
>>   .../riscv/amo-table-a-6-compare-exchange-6.c  |   2 +-
>>   .../riscv/amo-table-a-6-compare-exchange-7.c  |   2 +-
>>   .../riscv/amo-table-a-6-subword-amo-add-1.c   |   2 +-
>>   .../riscv/amo-table-a-6-subword-amo-add-2.c   |   2 +-
>>   .../riscv/amo-table-a-6-subword-amo-add-3.c   |   2 +-
>>   .../riscv/amo-table-a-6-subword-amo-add-4.c   |   2 +-
>>   .../riscv/amo-table-a-6-subword-amo-add-5.c   |   2 +-
>>   .../riscv/amo-table-ztso-amo-add-1.c  |   2 +-
>>   .../riscv/amo-table-ztso-amo-add-2.c  |   2 +-
>>   .../riscv/amo-table-ztso-amo-add-3.c  |   2 +-
>>   .../riscv/amo-table-ztso-amo-add-4.c  |   2 +-
>>   .../riscv/amo-table-ztso-amo-add-5.c  |   2 +-
>>   .../riscv/amo-table-ztso-compare-exchange-1.c |   2 +-
>>   .../riscv/amo-table-ztso-compare-exchange-2.c |   2 +-
>>   .../riscv/amo-table-ztso-compare-exchange-3.c |   2 +-
>>   .../riscv/amo-table-ztso-compare-exchange-4.c |   2 +-
>>   .../riscv/amo-table-ztso-compare-exchange-5.c |   2 +-
>>   .../riscv/amo-table-ztso-compare-exchange-6.c |   2 +-
>>   .../riscv/amo-table-ztso-compare-exchange-7.c |   2 +-
>>   .../riscv/amo-table-ztso-subword-amo-add-1.c  |   2 +-
>>   .../riscv/amo-table-ztso-subword-amo-add-2.c  |   2 +-
>>   .../riscv/amo-table-ztso-subword-amo-add-3.c  |   2 +-
>>   .../riscv/amo-table-ztso-subword-amo-add-4.c  |   2 +-
>>   .../riscv/amo-table-ztso-subword-amo-add-5.c  |   2 +-
>>   .../riscv/amo-zaamo-preferred-over-zalrsc.c   |  17 ++
>>   .../gcc.target/riscv/amo-zalrsc-amo-add-1.c   |  19 +++
>>   .../gcc.target/riscv/amo-zalrsc-amo-add-2.c   |  19 +++
>>   .../gcc.target/riscv/amo-zalrsc-amo-add-3.c   |  19 +++
>>   .../gcc.target/riscv/amo-zalrsc-amo-add-4.c   |  19 +++
>>   .../gcc.target/riscv/amo-zalrsc-amo-add-5.c   |  19 +++
>>   gcc/testsuite/gcc.target/riscv/attribute-15.c |   2 +-
>>   gcc/testsuite/gcc.target/riscv/attribute-16.c |   2 +-
>>   gcc/testsuite/gcc.target/riscv/attribute-17.c |   2 +-
>>   gcc/testsuite/gcc.target/riscv/attribute-18.c |   2 +-
>>   gcc/testsuite/gcc.target/riscv/pr110696.c |   2 +-
>>   .../gcc.target/riscv/rvv/base/pr114352-1.c    |   4 +-
>>   .../gcc.target/riscv/rvv/base/pr114352-3.c    |   8 +-
>>   gcc/testsuite/lib/target-supports.exp |  48 +-
>>   53 files changed, 366 insertions(+), 70 deletions(-)
>>   create mode 100644 
>> gcc/testsuite/gcc.target/riscv/amo-zaamo-preferred-over-zalrsc.c
>>   create mode 100644 
>> gcc/testsuite/gcc.target/riscv/amo-zalrsc-amo-add-1.c
>>   create mode 100644 
>> gcc/testsuite/gcc.target/riscv/amo-zalrsc-amo-add-2.c
>>   create mode 100644 
>> gcc/testsuite/gcc.target/riscv/amo-zalrsc-amo-add-3.c
>>   create mode 100644 
>> gcc/testsuite/gcc.target/riscv/amo-zalrsc-amo-add

Re: [Committed] RISC-V: Add basic Zaamo and Zalrsc support

2024-06-12 Thread Andreas Schwab
On Jun 12 2024, Li, Pan2 wrote:

> Do we need to upgrade the binutils of the riscv-gnu-toolchain repo? Or we may 
> have unknown prefixed ISA extension `zaamo' when building.

There needs to be a configure check if binutils can grok the extension.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Re: [Committed] RISC-V: Add basic Zaamo and Zalrsc support

2024-06-12 Thread Patrick O'Neill



On 6/12/24 04:21, Andreas Schwab wrote:

On Jun 12 2024, Li, Pan2 wrote:


Do we need to upgrade the binutils of the riscv-gnu-toolchain repo? Or we may 
have unknown prefixed ISA extension `zaamo' when building.

There needs to be a configure check if binutils can grok the extension.


Ack. I'll make a patch for that.

In the meantime bumping binutils to tip-of-tree will resolve the build 
issue.


Patrick



Re: [Committed] RISC-V: Add basic Zaamo and Zalrsc support

2024-06-12 Thread Palmer Dabbelt

On Wed, 12 Jun 2024 10:09:06 PDT (-0700), Patrick O'Neill wrote:


On 6/12/24 04:21, Andreas Schwab wrote:

On Jun 12 2024, Li, Pan2 wrote:


Do we need to upgrade the binutils of the riscv-gnu-toolchain repo? Or we may 
have unknown prefixed ISA extension `zaamo' when building.

There needs to be a configure check if binutils can grok the extension.


Ack. I'll make a patch for that.


Thanks.  That's how we usually handle this stuff, it keeps the world 
building.




In the meantime bumping binutils to tip-of-tree will resolve the build
issue.

Patrick