Skip to content

Commit 18c3c46

Browse files
authored
[RISCV] Update Zfa extension version to 1.0 (#67964)
The Zfa specification was recently ratified <https://wiki.riscv.org/display/HOME/Recently+Ratified+Extensions>. This commit bumps the version to 1.0, but leaves it as an experimental extension (to be done in a follow-on patch), so reviews can focus on confirming there haven't been spec changes we have missed (which as noted below, is more difficult than usual). Because the development of the Zfa spec overlapped with the transition of riscv-isa-manual from LaTeX to AsciiDoc, it's more difficult than usual to confirm version changes. The linked PDF in RISCVUsage is for some reason a 404. Key commit histories to review are: * Changes to zfa.adoc on the main branch <https://github.com/riscv/riscv-isa-manual/commits/main/src/zfa.adoc> * Changes to zfa.tex on the now defunct latex branch <https://github.com/riscv/riscv-isa-manual/commits/latex/src/zfa.tex> From reviewing these, I believe there have been no changes to the spec since version 0.1/0.2 (sadly the AsciiDoc and LaTeX versions of the spec are inconsistent about version numbering).
1 parent 169c205 commit 18c3c46

File tree

9 files changed

+15
-15
lines changed

9 files changed

+15
-15
lines changed

clang/test/Driver/riscv-arch.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,9 +385,9 @@
385385
// RUN: not %clang --target=riscv32-unknown-elf -march=rv32izfa0p1 -menable-experimental-extensions -### %s \
386386
// RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=RV32-EXPERIMENTAL-BADVERS %s
387387
// RV32-EXPERIMENTAL-BADVERS: error: invalid arch name 'rv32izfa0p1'
388-
// RV32-EXPERIMENTAL-BADVERS: unsupported version number 0.1 for experimental extension 'zfa' (this compiler supports 0.2)
388+
// RV32-EXPERIMENTAL-BADVERS: unsupported version number 0.1 for experimental extension 'zfa' (this compiler supports 1.0)
389389

390-
// RUN: %clang --target=riscv32-unknown-elf -march=rv32izfa0p2 -menable-experimental-extensions -### %s \
390+
// RUN: %clang --target=riscv32-unknown-elf -march=rv32izfa1p0 -menable-experimental-extensions -### %s \
391391
// RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=RV32-EXPERIMENTAL-GOODVERS %s
392392
// RV32-EXPERIMENTAL-GOODVERS: "-target-feature" "+experimental-zfa"
393393

clang/test/Preprocessor/riscv-target-features.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,12 +1002,12 @@
10021002
// CHECK-ZACAS-EXT: __riscv_zacas 1000000{{$}}
10031003

10041004
// RUN: %clang --target=riscv32-unknown-linux-gnu -menable-experimental-extensions \
1005-
// RUN: -march=rv32izfa0p2 -x c -E -dM %s \
1005+
// RUN: -march=rv32izfa1p0 -x c -E -dM %s \
10061006
// RUN: -o - | FileCheck --check-prefix=CHECK-ZFA-EXT %s
10071007
// RUN: %clang --target=riscv64-unknown-linux-gnu -menable-experimental-extensions \
1008-
// RUN: -march=rv64izfa0p2 -x c -E -dM %s \
1008+
// RUN: -march=rv64izfa1p0 -x c -E -dM %s \
10091009
// RUN: -o - | FileCheck --check-prefix=CHECK-ZFA-EXT %s
1010-
// CHECK-ZFA-EXT: __riscv_zfa 2000{{$}}
1010+
// CHECK-ZFA-EXT: __riscv_zfa 1000000{{$}}
10111011

10121012
// RUN: %clang --target=riscv32 -menable-experimental-extensions \
10131013
// RUN: -march=rv32izfbfmin0p8 -x c -E -dM %s \

llvm/docs/RISCVUsage.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ The primary goal of experimental support is to assist in the process of ratifica
197197
LLVM implements the `1.0-rc1 draft specification <https://github.com/riscv/riscv-zacas/releases/tag/v1.0-rc1>`_.
198198

199199
``experimental-zfa``
200-
LLVM implements the `0.2 draft specification <https://github.com/riscv/riscv-isa-manual/releases/download/draft-20230131-c0b298a/zfa-20230414.pdf>`__.
200+
LLVM implements the `1.0 specification <https://github.com/riscv/riscv-isa-manual/releases/tag/riscv-isa-release-056b6ff-2023-10-02>`__.
201201

202202
``experimental-zfbfmin``, ``experimental-zvfbfmin``, ``experimental-zvfbfwma``
203203
LLVM implements assembler support for the `0.8.0 draft specification <https://github.com/riscv/riscv-bfloat16/releases/tag/20230629>`_.

llvm/docs/ReleaseNotes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ Changes to the PowerPC Backend
109109
Changes to the RISC-V Backend
110110
-----------------------------
111111

112+
* The Zfa extension version was upgraded to 1.0.
112113
* Zihintntl extension version was upgraded to 1.0 and is no longer experimental.
113114

114115
Changes to the WebAssembly Backend

llvm/lib/Support/RISCVISAInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ static const RISCVSupportedExtension SupportedExperimentalExtensions[] = {
166166

167167
{"zacas", RISCVExtensionVersion{1, 0}},
168168

169-
{"zfa", RISCVExtensionVersion{0, 2}},
169+
{"zfa", RISCVExtensionVersion{1, 0}},
170170
{"zfbfmin", RISCVExtensionVersion{0, 8}},
171171

172172
{"zicfilp", RISCVExtensionVersion{0, 2}},

llvm/lib/Target/RISCV/RISCVInstrInfoZfa.td

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@
77
//===----------------------------------------------------------------------===//
88
//
99
// This file describes the RISC-V instructions from the standard 'Zfa'
10-
// additional floating-point extension, version 0.1.
11-
// This version is still experimental as the 'Zfa' extension hasn't been
12-
// ratified yet.
10+
// additional floating-point extension, version 1.0.
11+
// This version is still experimental.
1312
//
1413
//===----------------------------------------------------------------------===//
1514

llvm/test/CodeGen/RISCV/attributes.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@
243243
; RV32ZIFENCEI: .attribute 5, "rv32i2p1_zifencei2p0"
244244
; RV32ZICNTR: .attribute 5, "rv32i2p1_zicntr2p0_zicsr2p0"
245245
; RV32ZIHPM: .attribute 5, "rv32i2p1_zicsr2p0_zihpm2p0"
246-
; RV32ZFA: .attribute 5, "rv32i2p1_f2p2_zicsr2p0_zfa0p2"
246+
; RV32ZFA: .attribute 5, "rv32i2p1_f2p2_zicsr2p0_zfa1p0"
247247
; RV32ZVBB: .attribute 5, "rv32i2p1_zicsr2p0_zvbb1p0_zve32x1p0_zvkb1p0_zvl32b1p0"
248248
; RV32ZVBC: .attribute 5, "rv32i2p1_zicsr2p0_zvbc1p0_zve32x1p0_zve64x1p0_zvl32b1p0_zvl64b1p0"
249249
; RV32ZVKB: .attribute 5, "rv32i2p1_zicsr2p0_zve32x1p0_zvkb1p0_zvl32b1p0"
@@ -332,7 +332,7 @@
332332
; RV64ZIFENCEI: .attribute 5, "rv64i2p1_zifencei2p0"
333333
; RV64ZICNTR: .attribute 5, "rv64i2p1_zicntr2p0_zicsr2p0"
334334
; RV64ZIHPM: .attribute 5, "rv64i2p1_zicsr2p0_zihpm2p0"
335-
; RV64ZFA: .attribute 5, "rv64i2p1_f2p2_zicsr2p0_zfa0p2"
335+
; RV64ZFA: .attribute 5, "rv64i2p1_f2p2_zicsr2p0_zfa1p0"
336336
; RV64ZVBB: .attribute 5, "rv64i2p1_zicsr2p0_zvbb1p0_zve32x1p0_zvkb1p0_zvl32b1p0"
337337
; RV64ZVBC: .attribute 5, "rv64i2p1_zicsr2p0_zvbc1p0_zve32x1p0_zve64x1p0_zvl32b1p0_zvl64b1p0"
338338
; RV64ZVKB: .attribute 5, "rv64i2p1_zicsr2p0_zve32x1p0_zvkb1p0_zvl32b1p0"

llvm/test/MC/RISCV/attribute-arch.s

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,8 @@
261261
.attribute arch, "rv32izifencei2p0"
262262
# CHECK: attribute 5, "rv32i2p1_zifencei2p0"
263263

264-
.attribute arch, "rv32izfa0p2"
265-
# CHECK: attribute 5, "rv32i2p1_f2p2_zicsr2p0_zfa0p2"
264+
.attribute arch, "rv32izfa1p0"
265+
# CHECK: attribute 5, "rv32i2p1_f2p2_zicsr2p0_zfa1p0"
266266

267267
.attribute arch, "rv32izicond1p0"
268268
# CHECK: attribute 5, "rv32i2p1_zicond1p0"

llvm/unittests/Support/RISCVISAInfoTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,7 @@ Experimental extensions
729729
zicfilp 0.2 This is a long dummy description
730730
zicond 1.0
731731
zacas 1.0
732-
zfa 0.2
732+
zfa 1.0
733733
zfbfmin 0.8
734734
ztso 0.1
735735
zvbb 1.0

0 commit comments

Comments
 (0)