Skip to content

Commit 9460f8a

Browse files
markschimmelmemfrob
authored andcommitted
[ARC] Add norm/normh instructions with disassembly tests
Add disassembler support for the NORM and NORMH instructions. These instructions only exist when the ARC processor is configured with the "norm" extension. fferential Revision: https://reviews.llvm.org/D107118
1 parent 0571e77 commit 9460f8a

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

llvm/lib/Target/ARC/ARCInstrInfo.td

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ def SDT_ARCCallSeqStart : SDCallSeqStart<[ SDTCisVT<0, i32>,
4545
def SDT_ARCCallSeqEnd : SDCallSeqEnd<[ SDTCisVT<0, i32>,
4646
SDTCisVT<1, i32> ]>;
4747

48-
4948
// Global Address.
5049
def ARCGAWrapper : SDNode<"ARCISD::GAWRAPPER", SDT_ARCmov, []>;
5150

@@ -79,6 +78,12 @@ def callseq_start : SDNode<"ISD::CALLSEQ_START", SDT_ARCCallSeqStart,
7978
def callseq_end : SDNode<"ISD::CALLSEQ_END", SDT_ARCCallSeqEnd,
8079
[SDNPHasChain, SDNPOptInGlue, SDNPOutGlue]>;
8180

81+
//===----------------------------------------------------------------------===//
82+
// Instruction predicates
83+
//===----------------------------------------------------------------------===//
84+
85+
def HasNorm : Predicate<"Subtarget->hasNorm()">;
86+
8287
//===----------------------------------------------------------------------===//
8388
// Instruction Pattern Stuff
8489
//===----------------------------------------------------------------------===//
@@ -303,6 +308,11 @@ defm SEXH : ArcUnaryGEN4Inst<0b000110, "sexh">;
303308
// Extension unary instruction definitions.
304309
defm FLS : ArcUnaryEXT5Inst<0b010011, "fls">;
305310

311+
let Predicates=[HasNorm] in {
312+
defm NORM : ArcUnaryEXT5Inst<0b000001,"norm">;
313+
defm NORMH : ArcUnaryEXT5Inst<0b001000,"normh">;
314+
}
315+
306316
// General Unary Instruction fragments.
307317
def : Pat<(sext_inreg i32:$a, i8), (SEXB_rr i32:$a)>;
308318
def : Pat<(sext_inreg i32:$a, i16), (SEXH_rr i32:$a)>;

llvm/test/MC/Disassembler/ARC/misc.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,3 +129,9 @@
129129

130130
# CHECK: fls.f %r0, %r0
131131
0x2f 0x28 0x13 0x80
132+
133+
# CHECK: norm %r22, %blink
134+
0x2f 0x2e 0xc1 0x27
135+
136+
# CHECK: normh %r7, %r18
137+
0x2f 0x2f 0x88 0x04

0 commit comments

Comments
 (0)