Skip to content

Commit de8f906

Browse files
authored
[RISCV] Simplify assembler error information for RVV instructions (#72469)
Since vector embedded extensions have dependence, we don't have to show several extensions in the error messages.
1 parent bffa8e1 commit de8f906

34 files changed

+1143
-1143
lines changed

llvm/lib/Target/RISCV/RISCVFeatures.td

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -444,8 +444,8 @@ def FeatureStdExtV
444444
def HasVInstructions : Predicate<"Subtarget->hasVInstructions()">,
445445
AssemblerPredicate<
446446
(any_of FeatureStdExtZve32x),
447-
"'V' (Vector Extension for Application Processors), 'Zve32x' or "
448-
"'Zve64x' (Vector Extensions for Embedded Processors)">;
447+
"'V' (Vector Extension for Application Processors), 'Zve32x' "
448+
"(Vector Extensions for Embedded Processors)">;
449449
def HasVInstructionsI64 : Predicate<"Subtarget->hasVInstructionsI64()">,
450450
AssemblerPredicate<
451451
(any_of FeatureStdExtZve64x),
@@ -454,8 +454,8 @@ def HasVInstructionsI64 : Predicate<"Subtarget->hasVInstructionsI64()">,
454454
def HasVInstructionsAnyF : Predicate<"Subtarget->hasVInstructionsAnyF()">,
455455
AssemblerPredicate<
456456
(any_of FeatureStdExtZve32f),
457-
"'V' (Vector Extension for Application Processors), 'Zve32f', "
458-
"'Zve64f' or 'Zve64d' (Vector Extensions for Embedded Processors)">;
457+
"'V' (Vector Extension for Application Processors), 'Zve32f' "
458+
"(Vector Extensions for Embedded Processors)">;
459459

460460
def HasVInstructionsF64 : Predicate<"Subtarget->hasVInstructionsF64()">;
461461

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

Lines changed: 59 additions & 59 deletions
Large diffs are not rendered by default.

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,35 +11,35 @@
1111
vand.vv v8, v4, v20, v0.t
1212
# CHECK-INST: vand.vv v8, v4, v20, v0.t
1313
# CHECK-ENCODING: [0x57,0x04,0x4a,0x24]
14-
# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' or 'Zve64x' (Vector Extensions for Embedded Processors){{$}}
14+
# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
1515
# CHECK-UNKNOWN: 57 04 4a 24 <unknown>
1616

1717
vand.vv v8, v4, v20
1818
# CHECK-INST: vand.vv v8, v4, v20
1919
# CHECK-ENCODING: [0x57,0x04,0x4a,0x26]
20-
# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' or 'Zve64x' (Vector Extensions for Embedded Processors){{$}}
20+
# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
2121
# CHECK-UNKNOWN: 57 04 4a 26 <unknown>
2222

2323
vand.vx v8, v4, a0, v0.t
2424
# CHECK-INST: vand.vx v8, v4, a0, v0.t
2525
# CHECK-ENCODING: [0x57,0x44,0x45,0x24]
26-
# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' or 'Zve64x' (Vector Extensions for Embedded Processors){{$}}
26+
# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
2727
# CHECK-UNKNOWN: 57 44 45 24 <unknown>
2828

2929
vand.vx v8, v4, a0
3030
# CHECK-INST: vand.vx v8, v4, a0
3131
# CHECK-ENCODING: [0x57,0x44,0x45,0x26]
32-
# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' or 'Zve64x' (Vector Extensions for Embedded Processors){{$}}
32+
# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
3333
# CHECK-UNKNOWN: 57 44 45 26 <unknown>
3434

3535
vand.vi v8, v4, 15, v0.t
3636
# CHECK-INST: vand.vi v8, v4, 15, v0.t
3737
# CHECK-ENCODING: [0x57,0xb4,0x47,0x24]
38-
# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' or 'Zve64x' (Vector Extensions for Embedded Processors){{$}}
38+
# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
3939
# CHECK-UNKNOWN: 57 b4 47 24 <unknown>
4040

4141
vand.vi v8, v4, 15
4242
# CHECK-INST: vand.vi v8, v4, 15
4343
# CHECK-ENCODING: [0x57,0xb4,0x47,0x26]
44-
# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' or 'Zve64x' (Vector Extensions for Embedded Processors){{$}}
44+
# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
4545
# CHECK-UNKNOWN: 57 b4 47 26 <unknown>

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,71 +11,71 @@
1111
vnclipu.wv v8, v4, v20, v0.t
1212
# CHECK-INST: vnclipu.wv v8, v4, v20, v0.t
1313
# CHECK-ENCODING: [0x57,0x04,0x4a,0xb8]
14-
# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' or 'Zve64x' (Vector Extensions for Embedded Processors){{$}}
14+
# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
1515
# CHECK-UNKNOWN: 57 04 4a b8 <unknown>
1616

1717
vnclipu.wv v8, v4, v20
1818
# CHECK-INST: vnclipu.wv v8, v4, v20
1919
# CHECK-ENCODING: [0x57,0x04,0x4a,0xba]
20-
# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' or 'Zve64x' (Vector Extensions for Embedded Processors){{$}}
20+
# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
2121
# CHECK-UNKNOWN: 57 04 4a ba <unknown>
2222

2323
vnclipu.wx v8, v4, a0, v0.t
2424
# CHECK-INST: vnclipu.wx v8, v4, a0, v0.t
2525
# CHECK-ENCODING: [0x57,0x44,0x45,0xb8]
26-
# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' or 'Zve64x' (Vector Extensions for Embedded Processors){{$}}
26+
# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
2727
# CHECK-UNKNOWN: 57 44 45 b8 <unknown>
2828

2929
vnclipu.wx v8, v4, a0
3030
# CHECK-INST: vnclipu.wx v8, v4, a0
3131
# CHECK-ENCODING: [0x57,0x44,0x45,0xba]
32-
# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' or 'Zve64x' (Vector Extensions for Embedded Processors){{$}}
32+
# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
3333
# CHECK-UNKNOWN: 57 44 45 ba <unknown>
3434

3535
vnclipu.wi v8, v4, 31, v0.t
3636
# CHECK-INST: vnclipu.wi v8, v4, 31, v0.t
3737
# CHECK-ENCODING: [0x57,0xb4,0x4f,0xb8]
38-
# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' or 'Zve64x' (Vector Extensions for Embedded Processors){{$}}
38+
# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
3939
# CHECK-UNKNOWN: 57 b4 4f b8 <unknown>
4040

4141
vnclipu.wi v8, v4, 31
4242
# CHECK-INST: vnclipu.wi v8, v4, 31
4343
# CHECK-ENCODING: [0x57,0xb4,0x4f,0xba]
44-
# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' or 'Zve64x' (Vector Extensions for Embedded Processors){{$}}
44+
# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
4545
# CHECK-UNKNOWN: 57 b4 4f ba <unknown>
4646

4747
vnclip.wv v8, v4, v20, v0.t
4848
# CHECK-INST: vnclip.wv v8, v4, v20, v0.t
4949
# CHECK-ENCODING: [0x57,0x04,0x4a,0xbc]
50-
# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' or 'Zve64x' (Vector Extensions for Embedded Processors){{$}}
50+
# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
5151
# CHECK-UNKNOWN: 57 04 4a bc <unknown>
5252

5353
vnclip.wv v8, v4, v20
5454
# CHECK-INST: vnclip.wv v8, v4, v20
5555
# CHECK-ENCODING: [0x57,0x04,0x4a,0xbe]
56-
# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' or 'Zve64x' (Vector Extensions for Embedded Processors){{$}}
56+
# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
5757
# CHECK-UNKNOWN: 57 04 4a be <unknown>
5858

5959
vnclip.wx v8, v4, a0, v0.t
6060
# CHECK-INST: vnclip.wx v8, v4, a0, v0.t
6161
# CHECK-ENCODING: [0x57,0x44,0x45,0xbc]
62-
# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' or 'Zve64x' (Vector Extensions for Embedded Processors){{$}}
62+
# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
6363
# CHECK-UNKNOWN: 57 44 45 bc <unknown>
6464

6565
vnclip.wx v8, v4, a0
6666
# CHECK-INST: vnclip.wx v8, v4, a0
6767
# CHECK-ENCODING: [0x57,0x44,0x45,0xbe]
68-
# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' or 'Zve64x' (Vector Extensions for Embedded Processors){{$}}
68+
# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
6969
# CHECK-UNKNOWN: 57 44 45 be <unknown>
7070

7171
vnclip.wi v8, v4, 31, v0.t
7272
# CHECK-INST: vnclip.wi v8, v4, 31, v0.t
7373
# CHECK-ENCODING: [0x57,0xb4,0x4f,0xbc]
74-
# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' or 'Zve64x' (Vector Extensions for Embedded Processors){{$}}
74+
# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
7575
# CHECK-UNKNOWN: 57 b4 4f bc <unknown>
7676

7777
vnclip.wi v8, v4, 31
7878
# CHECK-INST: vnclip.wi v8, v4, 31
7979
# CHECK-ENCODING: [0x57,0xb4,0x4f,0xbe]
80-
# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' or 'Zve64x' (Vector Extensions for Embedded Processors){{$}}
80+
# CHECK-ERROR: instruction requires the following: 'V' (Vector Extension for Application Processors), 'Zve32x' (Vector Extensions for Embedded Processors){{$}}
8181
# CHECK-UNKNOWN: 57 b4 4f be <unknown>

0 commit comments

Comments
 (0)