[PATCH] D138807: [RISCV] Support vector crypto extension ISA string and assembly

Eric Gouriou via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 28 12:25:26 PST 2022


ego added a comment.

See my comment below where I can trigger an MC-layer assertion when using "vaeskf1 v0, ...".



================
Comment at: llvm/test/MC/RISCV/rvv/rv64zvkns.s:1-9
+# RUN: llvm-mc -triple=riscv64 -show-encoding --mattr=+zve32x --mattr=+experimental-zvkns %s \
+# RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
+# RUN: not llvm-mc -triple=riscv64 -show-encoding %s 2>&1 \
+# RUN:        | FileCheck %s --check-prefix=CHECK-ERROR
+# RUN: llvm-mc -triple=riscv64 -filetype=obj --mattr=+zve32x --mattr=+experimental-zvkns %s \
+# RUN:        | llvm-objdump -d --mattr=+zve32x --mattr=+experimental-zvkns  - \
+# RUN:        | FileCheck %s --check-prefix=CHECK-INST
----------------
See Kito's comment. For most of those tests, and to avoid duplicating the logic between RV32 and RV64 files, we could drop the "rv64" prefix, cut/paste the RUN section to duplicate it and replace "riscv64" with "riscv32" in one of the copies.


================
Comment at: llvm/test/MC/RISCV/rvv/rv64zvkns.s:59
+
+vaeskf1.vi v10, v9, 1
+# CHECK-INST: vaeskf1.vi v10, v9, 1
----------------
If I replaces "v10" with "v0", the test fails with an assertion failure. My own patch uses a slightly different class hierarchy but hits the same assertion.


```
FAIL: LLVM :: MC/RISCV/rvv/rv64zvkns.s (3 of 8)
******************** TEST 'LLVM :: MC/RISCV/rvv/rv64zvkns.s' FAILED ********************
Script:
--
: 'RUN: at line 1';   /Users/ego/root-dirs/scratch/projects/llvm-project/build/bin/llvm-mc -triple=riscv64 -show-encoding --mattr=+zve32x --mattr=+experimental-zvkns /Users/ego/root-dirs/scratch/projects/llvm-project/llvm/test/MC/RISCV/rvv/rv64zvkns.s         | /Users/ego/root-dirs/scratch/projects/llvm-project/build/bin/FileCheck /Users/ego/root-dirs/scratch/projects/llvm-project/llvm/test/MC/RISCV/rvv/rv64zvkns.s --check-prefixes=CHECK-ENCODING,CHECK-INST
: 'RUN: at line 3';   not /Users/ego/root-dirs/scratch/projects/llvm-project/build/bin/llvm-mc -triple=riscv64 -show-encoding /Users/ego/root-dirs/scratch/projects/llvm-project/llvm/test/MC/RISCV/rvv/rv64zvkns.s 2>&1         | /Users/ego/root-dirs/scratch/projects/llvm-project/build/bin/FileCheck /Users/ego/root-dirs/scratch/projects/llvm-project/llvm/test/MC/RISCV/rvv/rv64zvkns.s --check-prefix=CHECK-ERROR
: 'RUN: at line 5';   /Users/ego/root-dirs/scratch/projects/llvm-project/build/bin/llvm-mc -triple=riscv64 -filetype=obj --mattr=+zve32x --mattr=+experimental-zvkns /Users/ego/root-dirs/scratch/projects/llvm-project/llvm/test/MC/RISCV/rvv/rv64zvkns.s         | /Users/ego/root-dirs/scratch/projects/llvm-project/build/bin/llvm-objdump -d --mattr=+zve32x --mattr=+experimental-zvkns  -         | /Users/ego/root-dirs/scratch/projects/llvm-project/build/bin/FileCheck /Users/ego/root-dirs/scratch/projects/llvm-project/llvm/test/MC/RISCV/rvv/rv64zvkns.s --check-prefix=CHECK-INST
: 'RUN: at line 8';   /Users/ego/root-dirs/scratch/projects/llvm-project/build/bin/llvm-mc -triple=riscv64 -filetype=obj --mattr=+zve32x --mattr=+experimental-zvkns /Users/ego/root-dirs/scratch/projects/llvm-project/llvm/test/MC/RISCV/rvv/rv64zvkns.s         | /Users/ego/root-dirs/scratch/projects/llvm-project/build/bin/llvm-objdump -d - | /Users/ego/root-dirs/scratch/projects/llvm-project/build/bin/FileCheck /Users/ego/root-dirs/scratch/projects/llvm-project/llvm/test/MC/RISCV/rvv/rv64zvkns.s --check-prefix=CHECK-UNKNOWN
--
Exit Code: 2

Command Output (stderr):
--
Assertion failed: (isReg() && "This is not a register operand!"), function getReg, file MCInst.h, line 70.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.	Program arguments: /Users/ego/root-dirs/scratch/projects/llvm-project/build/bin/llvm-mc -triple=riscv64 -show-encoding --mattr=+zve32x --mattr=+experimental-zvkns /Users/ego/root-dirs/scratch/projects/llvm-project/llvm/test/MC/RISCV/rvv/rv64zvkns.s
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  libLLVMSupport.dylib        0x00000001023015e8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
1  libLLVMSupport.dylib        0x0000000102300840 llvm::sys::RunSignalHandlers() + 112
2  libLLVMSupport.dylib        0x0000000102301c28 SignalHandler(int) + 304
3  libsystem_platform.dylib    0x00000001914f82a4 _sigtramp + 56
4  libsystem_pthread.dylib     0x00000001914c9cec pthread_kill + 288
5  libsystem_c.dylib           0x00000001914032c8 abort + 180
6  libsystem_c.dylib           0x0000000191402620 err + 0
7  libLLVMRISCVAsmParser.dylib 0x0000000100666208 (anonymous namespace)::RISCVAsmParser::MatchAndEmitInstruction(llvm::SMLoc, unsigned int&, llvm::SmallVectorImpl<std::__1::unique_ptr<llvm::MCParsedAsmOperand, std::__1::default_delete<llvm::MCParsedAsmOperand>>>&, llvm::MCStreamer&, unsigned long long&, bool) (.cold.42) + 0
8  libLLVMRISCVAsmParser.dylib 0x0000000100655084 (anonymous namespace)::RISCVAsmParser::MatchAndEmitInstruction(llvm::SMLoc, unsigned int&, llvm::SmallVectorImpl<std::__1::unique_ptr<llvm::MCParsedAsmOperand, std::__1::default_delete<llvm::MCParsedAsmOperand>>>&, llvm::MCStreamer&, unsigned long long&, bool) + 7268
9  libLLVMMCParser.dylib       0x0000000100c36c08 (anonymous namespace)::AsmParser::parseAndMatchAndEmitTargetInstruction((anonymous namespace)::ParseStatementInfo&, llvm::StringRef, llvm::AsmToken, llvm::SMLoc) + 1356
10 libLLVMMCParser.dylib       0x0000000100c2d1d0 (anonymous namespace)::AsmParser::parseStatement((anonymous namespace)::ParseStatementInfo&, llvm::MCAsmParserSemaCallback*) + 3492
11 libLLVMMCParser.dylib       0x0000000100c27884 (anonymous namespace)::AsmParser::Run(bool, bool) + 500
12 llvm-mc                     0x000000010051ffc8 main + 6608
13 dyld                        0x000000019119fe50 start + 2544
FileCheck error: '<stdin>' is empty.
FileCheck command line:  /Users/ego/root-dirs/scratch/projects/llvm-project/build/bin/FileCheck /Users/ego/root-dirs/scratch/projects/llvm-project/llvm/test/MC/RISCV/rvv/rv64zvkns.s --check-prefixes=CHECK-ENCODING,CHECK-INST

--

```


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138807/new/

https://reviews.llvm.org/D138807



More information about the cfe-commits mailing list