diff options
author | Daniel Sanders <daniel_l_sanders@apple.com> | 2019-06-18 21:56:04 +0000 |
---|---|---|
committer | Daniel Sanders <daniel_l_sanders@apple.com> | 2019-06-18 21:56:04 +0000 |
commit | 9b2252123d1e79d2b3594097a9d9cc60072b83d9 (patch) | |
tree | 073ff36f6bf5da1d34f083bc560d9ef0311ab8a1 /llvm/lib/CodeGen/GlobalISel/Localizer.cpp | |
parent | 4f7f70e26245adffe87b18c4c95eb7899538c9d9 (diff) | |
download | bcm5719-llvm-9b2252123d1e79d2b3594097a9d9cc60072b83d9.tar.gz bcm5719-llvm-9b2252123d1e79d2b3594097a9d9cc60072b83d9.zip |
[tblgen][disasm] Allow multiple encodings to disassemble to the same instruction
Summary:
Add an AdditionalEncoding class which can be used to define additional encodings
for a given instruction. This causes the disassembler to add an additional
encoding to its matching tables that map to the specified instruction.
Usage:
def ADD1 : Instruction {
bits<8> Reg;
bits<32> Inst;
let Size = 4;
let Inst{0-7} = Reg;
let Inst{8-14} = 0;
let Inst{15} = 1; // Continuation bit
let Inst{16-31} = 0;
...
}
def : AdditionalEncoding<ADD1> {
bits<8> Reg;
bits<16> Inst; // You can also have bits<32> and it will still be a 16-bit encoding
let Size = 2;
let Inst{0-3} = 0;
let Inst{4-7} = Reg;
let Inst{8-15} = 0;
...
}
with those definitions, llvm-mc will successfully disassemble both of these:
0x01 0x00
0x10 0x80 0x00 0x00
to:
ADD1 r1
Depends on D52366
Reviewers: bogner, charukcs
Reviewed By: bogner
Subscribers: nlguillemot, nhaehnle, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D52369
llvm-svn: 363744
Diffstat (limited to 'llvm/lib/CodeGen/GlobalISel/Localizer.cpp')
0 files changed, 0 insertions, 0 deletions