Skip to content

Commit ca554ad

Browse files
egouriou-rivosasb
authored andcommitted
[RISCV] NFC tweaks in extension descriptions, sorting
NFC changes in RISCISAInfo and RISCFeatures, and matching updates to the MC tests. - Drop the '.' in the parentheses section of the Zvk extension descriptions. This is supported by <https://www.masterclass.com/articles/period-inside-or-outside-parentheses#>, - Remove an extraneous space in the description of Zvt, - Reorder the ImpliedExts.* constant literals in RISCISAInfo.cpp, as suggested in <https://reviews.llvm.org/D148483>. Differential Revision: https://reviews.llvm.org/D148857
1 parent 1c3653d commit ca554ad

File tree

6 files changed

+44
-44
lines changed

6 files changed

+44
-44
lines changed

llvm/lib/Support/RISCVISAInfo.cpp

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -913,35 +913,28 @@ Error RISCVISAInfo::checkDependency() {
913913
return Error::success();
914914
}
915915

916-
static const char *ImpliedExtsF[] = {"zicsr"};
917916
static const char *ImpliedExtsD[] = {"f"};
917+
static const char *ImpliedExtsF[] = {"zicsr"};
918918
static const char *ImpliedExtsV[] = {"zvl128b", "zve64d", "f", "d"};
919-
static const char *ImpliedExtsZfhmin[] = {"f"};
919+
static const char *ImpliedExtsXTHeadVdot[] = {"v"};
920+
static const char *ImpliedExtsXsfvcp[] = {"zve32x"};
921+
static const char *ImpliedExtsZcb[] = {"zca"};
922+
static const char *ImpliedExtsZdinx[] = {"zfinx"};
923+
static const char *ImpliedExtsZfa[] = {"f"};
920924
static const char *ImpliedExtsZfh[] = {"f"};
925+
static const char *ImpliedExtsZfhmin[] = {"f"};
921926
static const char *ImpliedExtsZfinx[] = {"zicsr"};
922-
static const char *ImpliedExtsZdinx[] = {"zfinx"};
923-
static const char *ImpliedExtsZhinxmin[] = {"zfinx"};
924927
static const char *ImpliedExtsZhinx[] = {"zfinx"};
925-
static const char *ImpliedExtsZve64d[] = {"zve64f"};
926-
static const char *ImpliedExtsZve64f[] = {"zve64x", "zve32f"};
927-
static const char *ImpliedExtsZve64x[] = {"zve32x", "zvl64b"};
928-
static const char *ImpliedExtsZve32f[] = {"zve32x"};
929-
static const char *ImpliedExtsZve32x[] = {"zvl32b", "zicsr"};
930-
static const char *ImpliedExtsZvl65536b[] = {"zvl32768b"};
931-
static const char *ImpliedExtsZvl32768b[] = {"zvl16384b"};
932-
static const char *ImpliedExtsZvl16384b[] = {"zvl8192b"};
933-
static const char *ImpliedExtsZvl8192b[] = {"zvl4096b"};
934-
static const char *ImpliedExtsZvl4096b[] = {"zvl2048b"};
935-
static const char *ImpliedExtsZvl2048b[] = {"zvl1024b"};
936-
static const char *ImpliedExtsZvl1024b[] = {"zvl512b"};
937-
static const char *ImpliedExtsZvl512b[] = {"zvl256b"};
938-
static const char *ImpliedExtsZvl256b[] = {"zvl128b"};
939-
static const char *ImpliedExtsZvl128b[] = {"zvl64b"};
940-
static const char *ImpliedExtsZvl64b[] = {"zvl32b"};
928+
static const char *ImpliedExtsZhinxmin[] = {"zfinx"};
941929
static const char *ImpliedExtsZk[] = {"zkn", "zkt", "zkr"};
942930
static const char *ImpliedExtsZkn[] = {"zbkb", "zbkc", "zbkx",
943931
"zkne", "zknd", "zknh"};
944932
static const char *ImpliedExtsZks[] = {"zbkb", "zbkc", "zbkx", "zksed", "zksh"};
933+
static const char *ImpliedExtsZve32f[] = {"zve32x"};
934+
static const char *ImpliedExtsZve32x[] = {"zvl32b", "zicsr"};
935+
static const char *ImpliedExtsZve64d[] = {"zve64f"};
936+
static const char *ImpliedExtsZve64f[] = {"zve64x", "zve32f"};
937+
static const char *ImpliedExtsZve64x[] = {"zve32x", "zvl64b"};
945938
static const char *ImpliedExtsZvfh[] = {"zve32f"};
946939
static const char *ImpliedExtsZvkn[] = {"zvbb", "zvbc", "zvkned", "zvknhb",
947940
"zvkt"};
@@ -950,10 +943,17 @@ static const char *ImpliedExtsZvknhb[] = {"zvknha"};
950943
static const char *ImpliedExtsZvks[] = {"zvbb", "zvbc", "zvksed", "zvksh",
951944
"zvkt"};
952945
static const char *ImpliedExtsZvksg[] = {"zvks", "zvkg"};
953-
static const char *ImpliedExtsXsfvcp[] = {"zve32x"};
954-
static const char *ImpliedExtsXTHeadVdot[] = {"v"};
955-
static const char *ImpliedExtsZcb[] = {"zca"};
956-
static const char *ImpliedExtsZfa[] = {"f"};
946+
static const char *ImpliedExtsZvl1024b[] = {"zvl512b"};
947+
static const char *ImpliedExtsZvl128b[] = {"zvl64b"};
948+
static const char *ImpliedExtsZvl16384b[] = {"zvl8192b"};
949+
static const char *ImpliedExtsZvl2048b[] = {"zvl1024b"};
950+
static const char *ImpliedExtsZvl256b[] = {"zvl128b"};
951+
static const char *ImpliedExtsZvl32768b[] = {"zvl16384b"};
952+
static const char *ImpliedExtsZvl4096b[] = {"zvl2048b"};
953+
static const char *ImpliedExtsZvl512b[] = {"zvl256b"};
954+
static const char *ImpliedExtsZvl64b[] = {"zvl32b"};
955+
static const char *ImpliedExtsZvl65536b[] = {"zvl32768b"};
956+
static const char *ImpliedExtsZvl8192b[] = {"zvl4096b"};
957957

958958
struct ImpliedExtsEntry {
959959
StringLiteral Name;

llvm/lib/Target/RISCV/RISCVFeatures.td

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -497,10 +497,10 @@ def HasStdExtZvbc : Predicate<"Subtarget->hasStdExtZvbc()">,
497497

498498
def FeatureStdExtZvkg
499499
: SubtargetFeature<"experimental-zvkg", "HasStdExtZvkg", "true",
500-
"'Zvkg' (Vector GCM instructions for Cryptography.)">;
500+
"'Zvkg' (Vector GCM instructions for Cryptography)">;
501501
def HasStdExtZvkg : Predicate<"Subtarget->hasStdExtZvkg()">,
502502
AssemblerPredicate<(all_of FeatureStdExtZvkg),
503-
"'Zvkg' (Vector GCM instructions for Cryptography.)">;
503+
"'Zvkg' (Vector GCM instructions for Cryptography)">;
504504

505505
def FeatureStdExtZvkn
506506
: SubtargetFeature<"experimental-zvkn", "HasStdExtZvkn", "true",
@@ -521,15 +521,15 @@ def FeatureStdExtZvkng
521521

522522
def FeatureStdExtZvknha
523523
: SubtargetFeature<"experimental-zvknha", "HasStdExtZvknha", "true",
524-
"'Zvknha' (Vector SHA-2. (SHA-256 only))">;
524+
"'Zvknha' (Vector SHA-2 (SHA-256 only))">;
525525

526526
def FeatureStdExtZvknhb
527527
: SubtargetFeature<"experimental-zvknhb", "HasStdExtZvknhb", "true",
528-
"'Zvknhb' (Vector SHA-2. (SHA-256 and SHA-512))",
528+
"'Zvknhb' (Vector SHA-2 (SHA-256 and SHA-512))",
529529
[FeatureStdExtZvknha]>;
530530
def HasStdExtZvknha : Predicate<"Subtarget->hasStdExtZvknha()">,
531531
AssemblerPredicate<(all_of FeatureStdExtZvknha),
532-
"'Zvknha' (Vector SHA-2. (SHA-256 only))">;
532+
"'Zvknha' (Vector SHA-2 (SHA-256 only))">;
533533

534534
def FeatureStdExtZvks
535535
: SubtargetFeature<"experimental-zvks", "HasStdExtZvks", "true",
@@ -538,10 +538,10 @@ def FeatureStdExtZvks
538538

539539
def FeatureStdExtZvksed
540540
: SubtargetFeature<"experimental-zvksed", "HasStdExtZvksed", "true",
541-
"'Zvksed' (SM4 Block Cipher Instructions.)">;
541+
"'Zvksed' (SM4 Block Cipher Instructions)">;
542542
def HasStdExtZvksed : Predicate<"Subtarget->hasStdExtZvksed()">,
543543
AssemblerPredicate<(all_of FeatureStdExtZvksed),
544-
"'Zvksed' (SM4 Block Cipher Instructions.)">;
544+
"'Zvksed' (SM4 Block Cipher Instructions)">;
545545

546546
def FeatureStdExtZvksg
547547
: SubtargetFeature<"experimental-zvksg", "HasStdExtZvksg", "true",
@@ -550,14 +550,14 @@ def FeatureStdExtZvksg
550550

551551
def FeatureStdExtZvksh
552552
: SubtargetFeature<"experimental-zvksh", "HasStdExtZvksh", "true",
553-
"'Zvksh' (SM3 Hash Function Instructions.)">;
553+
"'Zvksh' (SM3 Hash Function Instructions)">;
554554
def HasStdExtZvksh : Predicate<"Subtarget->hasStdExtZvksh()">,
555555
AssemblerPredicate<(all_of FeatureStdExtZvksh),
556-
"'Zvksh' (SM3 Hash Function Instructions.)">;
556+
"'Zvksh' (SM3 Hash Function Instructions)">;
557557

558558
def FeatureStdExtZvkt
559559
: SubtargetFeature<"experimental-zvkt", "HasStdExtZvkt", "true",
560-
"'Zvkt' (Vector Data-Independent Execution Latency )">;
560+
"'Zvkt' (Vector Data-Independent Execution Latency)">;
561561

562562
def FeatureStdExtZicond
563563
: SubtargetFeature<"experimental-zicond", "HasStdExtZicond", "true",

llvm/test/MC/RISCV/rvv/zvkg.s

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
vghsh.vv v10, v9, v8
1212
# CHECK-INST: vghsh.vv v10, v9, v8
1313
# CHECK-ENCODING: [0x77,0x25,0x94,0xb2]
14-
# CHECK-ERROR: instruction requires the following: 'Zvkg' (Vector GCM instructions for Cryptography.){{$}}
14+
# CHECK-ERROR: instruction requires the following: 'Zvkg' (Vector GCM instructions for Cryptography){{$}}
1515
# CHECK-UNKNOWN: 77 25 94 b2 <unknown>
1616

1717
vgmul.vv v10, v9
1818
# CHECK-INST: vgmul.vv v10, v9
1919
# CHECK-ENCODING: [0x77,0xa5,0x98,0xa2]
20-
# CHECK-ERROR: instruction requires the following: 'Zvkg' (Vector GCM instructions for Cryptography.){{$}}
20+
# CHECK-ERROR: instruction requires the following: 'Zvkg' (Vector GCM instructions for Cryptography){{$}}
2121
# CHECK-UNKNOWN: 77 a5 98 a2 <unknown>

llvm/test/MC/RISCV/rvv/zvknh.s

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@ vsha2ms.vv v10, v9, v8
1919
# CHECK-INST: vsha2ms.vv v10, v9, v8
2020
# CHECK-ENCODING: [0x77,0x25,0x94,0xb6]
2121
# CHECK-UNKNOWN: 77 25 94 b6 <unknown>
22-
# CHECK-ERROR: instruction requires the following: 'Zvknha' (Vector SHA-2. (SHA-256 only)){{$}}
22+
# CHECK-ERROR: instruction requires the following: 'Zvknha' (Vector SHA-2 (SHA-256 only)){{$}}
2323

2424
vsha2ch.vv v10, v9, v8
2525
# CHECK-INST: vsha2ch.vv v10, v9, v8
2626
# CHECK-ENCODING: [0x77,0x25,0x94,0xba]
2727
# CHECK-UNKNOWN: 77 25 94 ba <unknown>
28-
# CHECK-ERROR: instruction requires the following: 'Zvknha' (Vector SHA-2. (SHA-256 only)){{$}}
28+
# CHECK-ERROR: instruction requires the following: 'Zvknha' (Vector SHA-2 (SHA-256 only)){{$}}
2929

3030
vsha2cl.vv v10, v9, v8
3131
# CHECK-INST: vsha2cl.vv v10, v9, v8
3232
# CHECK-ENCODING: [0x77,0x25,0x94,0xbe]
3333
# CHECK-UNKNOWN: 77 25 94 be <unknown>
34-
# CHECK-ERROR: instruction requires the following: 'Zvknha' (Vector SHA-2. (SHA-256 only)){{$}}
34+
# CHECK-ERROR: instruction requires the following: 'Zvknha' (Vector SHA-2 (SHA-256 only)){{$}}

llvm/test/MC/RISCV/rvv/zvksed.s

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@
1111
vsm4k.vi v10, v9, 7
1212
# CHECK-INST: vsm4k.vi v10, v9, 7
1313
# CHECK-ENCODING: [0x77,0xa5,0x93,0x86]
14-
# CHECK-ERROR: instruction requires the following: 'Zvksed' (SM4 Block Cipher Instructions.){{$}}
14+
# CHECK-ERROR: instruction requires the following: 'Zvksed' (SM4 Block Cipher Instructions){{$}}
1515
# CHECK-UNKNOWN: 77 a5 93 86 <unknown>
1616

1717
vsm4r.vv v10, v9
1818
# CHECK-INST: vsm4r.vv v10, v9
1919
# CHECK-ENCODING: [0x77,0x25,0x98,0xa2]
20-
# CHECK-ERROR: instruction requires the following: 'Zvksed' (SM4 Block Cipher Instructions.){{$}}
20+
# CHECK-ERROR: instruction requires the following: 'Zvksed' (SM4 Block Cipher Instructions){{$}}
2121
# CHECK-UNKNOWN: 77 25 98 a2 <unknown>
2222

2323
vsm4r.vs v10, v9
2424
# CHECK-INST: vsm4r.vs v10, v9
2525
# CHECK-ENCODING: [0x77,0x25,0x98,0xa6]
26-
# CHECK-ERROR: instruction requires the following: 'Zvksed' (SM4 Block Cipher Instructions.){{$}}
26+
# CHECK-ERROR: instruction requires the following: 'Zvksed' (SM4 Block Cipher Instructions){{$}}
2727
# CHECK-UNKNOWN: 77 25 98 a6 <unknown>

llvm/test/MC/RISCV/rvv/zvksh.s

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
vsm3c.vi v10, v9, 7
1212
# CHECK-INST: vsm3c.vi v10, v9, 7
1313
# CHECK-ENCODING: [0x77,0xa5,0x93,0xae]
14-
# CHECK-ERROR: instruction requires the following: 'Zvksh' (SM3 Hash Function Instructions.){{$}}
14+
# CHECK-ERROR: instruction requires the following: 'Zvksh' (SM3 Hash Function Instructions){{$}}
1515
# CHECK-UNKNOWN: 77 a5 93 ae <unknown>
1616

1717
vsm3me.vv v10, v9, v8
1818
# CHECK-INST: vsm3me.vv v10, v9, v8
1919
# CHECK-ENCODING: [0x77,0x25,0x94,0x82]
20-
# CHECK-ERROR: instruction requires the following: 'Zvksh' (SM3 Hash Function Instructions.){{$}}
20+
# CHECK-ERROR: instruction requires the following: 'Zvksh' (SM3 Hash Function Instructions){{$}}
2121
# CHECK-UNKNOWN: 77 25 94 82 <unknown>

0 commit comments

Comments
 (0)