-
Notifications
You must be signed in to change notification settings - Fork 11.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RISCV] Decode vtype with reserved fields to raw immediate
This patch fixes a crash when doing "llvm-objdump -D --mattr=+experimental-v" against an object file which happens to keep a word that can be decoded to VSETVLI & VSETIVLI with reserved vlmul[2:0]=4. All vtype values with reserved fields (vlmul[2:0]=4, vsew[2:0]=0b1xx, non-zero bits 8/9/10) are printed to raw immediate. Reviewed By: jhenderson, jrtc27, craig.topper Differential Revision: https://reviews.llvm.org/D114581
- Loading branch information
Showing
2 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# RUN: llvm-mc -filetype=obj -triple=riscv32 %s \ | ||
# RUN: | llvm-objdump -d --mattr=+experimental-v - | FileCheck %s | ||
# RUN: llvm-mc -filetype=obj -triple=riscv64 %s \ | ||
# RUN: | llvm-objdump -d --mattr=+experimental-v - | FileCheck %s | ||
|
||
# CHECK: vsetvli a1, a0, e64, m1, tu, mu | ||
.word 0x018575d7 | ||
|
||
# CHECK: vsetvli a1, a0, 28 | ||
.word 0x01c575d7 | ||
|
||
# CHECK: vsetvli a1, a0, 36 | ||
.word 0x024575d7 | ||
|
||
# CHECK: vsetvli a1, a0, 41 | ||
.word 0x029575d7 | ||
|
||
# CHECK: vsetvli a1, a0, 272 | ||
.word 0x110575d7 | ||
|
||
# CHECK: vsetvli a1, a0, e64, mf8, tu, mu | ||
.word 0x01d575d7 | ||
|
||
# CHECK: vsetivli a1, 16, e8, m4, tu, mu | ||
.word 0xc02875d7 | ||
|
||
# CHECK: vsetivli a1, 16, 12 | ||
.word 0xc0c875d7 | ||
|
||
# CHECK: vsetivli a1, 16, 20 | ||
.word 0xc14875d7 | ||
|
||
# CHECK: vsetivli a1, 16, 56 | ||
.word 0xc38875d7 | ||
|
||
# CHECK: vsetivli a1, 16, 259 | ||
.word 0xd03875d7 | ||
|
||
# CHECK: vsetivli a1, 16, e8, mf4, tu, mu | ||
.word 0xc06875d7 |