diff --git a/llvm/lib/Target/ARC/ARCInstrInfo.td b/llvm/lib/Target/ARC/ARCInstrInfo.td --- a/llvm/lib/Target/ARC/ARCInstrInfo.td +++ b/llvm/lib/Target/ARC/ARCInstrInfo.td @@ -224,6 +224,8 @@ multiclass ArcUnaryGEN4Inst mincode, string opasm> : ArcUnaryInst<0b00100, mincode, opasm>; +multiclass ArcUnaryEXT5Inst mincode, string opasm> : + ArcUnaryInst<0b00101, mincode, opasm>; // Pattern generation for different instruction variants. multiclass MultiPat; defm SEXH : ArcUnaryGEN4Inst<0b000110, "sexh">; +// Extension unary instruction definitions. +defm FLS : ArcUnaryEXT5Inst<0b010011, "fls">; + // General Unary Instruction fragments. def : Pat<(sext_inreg i32:$a, i8), (SEXB_rr i32:$a)>; def : Pat<(sext_inreg i32:$a, i16), (SEXH_rr i32:$a)>; diff --git a/llvm/test/MC/Disassembler/ARC/misc.txt b/llvm/test/MC/Disassembler/ARC/misc.txt --- a/llvm/test/MC/Disassembler/ARC/misc.txt +++ b/llvm/test/MC/Disassembler/ARC/misc.txt @@ -54,3 +54,9 @@ # CHECK: seteq %fp, %fp, -1 0xb8 0x23 0xff 0x3f + +# CHECK: fls %r0, %r0 +0x2f 0x28 0x13 0x00 + +# CHECK: fls.f %r0, %r0 +0x2f 0x28 0x13 0x80