Skip to content

Commit

Permalink
[ARM] Add MVE vector instructions that take a scalar input.
Browse files Browse the repository at this point in the history
This adds the `MVE_qDest_rSrc` superclass and all its instances, plus
a few other instructions that also take a scalar input register or two.

I've also belatedly added custom diagnostic messages to the operand
classes for odd- and even-numbered GPRs, which required matching
changes in two of the existing MVE assembly test files.

Reviewers: dmgreen, samparker, SjoerdMeijer, t.p.northover

Subscribers: javed.absar, kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D62678

llvm-svn: 364040
  • Loading branch information
statham-arm committed Jun 21, 2019
1 parent 26cc5bc commit bafb105
Show file tree
Hide file tree
Showing 10 changed files with 1,580 additions and 9 deletions.
14 changes: 14 additions & 0 deletions llvm/lib/Target/ARM/ARMInstrInfo.td
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,20 @@ def rot_imm : Operand<i32>, PatLeaf<(i32 imm), [{
let ParserMatchClass = RotImmAsmOperand;
}

// Power-of-two operand for MVE VIDUP and friends, which encode
// {1,2,4,8} as its log to base 2, i.e. as {0,1,2,3} respectively
def MVE_VIDUP_imm_asmoperand : AsmOperandClass {
let Name = "VIDUP_imm";
let PredicateMethod = "isPowerTwoInRange<1,8>";
let RenderMethod = "addPowerTwoOperands";
let DiagnosticString = "vector increment immediate must be 1, 2, 4 or 8";
}
def MVE_VIDUP_imm : Operand<i32> {
let EncoderMethod = "getPowerTwoOpValue";
let DecoderMethod = "DecodePowerTwoOperand<0,3>";
let ParserMatchClass = MVE_VIDUP_imm_asmoperand;
}

// Vector indexing
class MVEVectorIndexOperand<int NumLanes> : AsmOperandClass {
let Name = "MVEVectorIndex"#NumLanes;
Expand Down
Loading

0 comments on commit bafb105

Please sign in to comment.