summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/VE/VEInstrFormats.td
blob: a8d3e786ba8913a47362447f1dd9681f3962912d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
//===-- VEInstrFormats.td - VE Instruction Formats ---------*- tablegen -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

class InstVE<dag outs, dag ins, string asmstr, list<dag> pattern>
   : Instruction {
  field bits<64> Inst;

  let Namespace = "VE";
  let Size = 8;

  bits<8> op;
  let Inst{0-7} = op;

  dag OutOperandList = outs;
  dag InOperandList = ins;
  let AsmString   = asmstr;
  let Pattern = pattern;

  let DecoderNamespace = "VE";
  field bits<64> SoftFail = 0;
}

class RM<bits<8>opVal, dag outs, dag ins, string asmstr, list<dag> pattern=[]>
   : InstVE<outs, ins, asmstr, pattern> {
  bits<1>  cx = 0;
  bits<7>  sx;
  bits<1>  cy = 0;
  bits<7>  sy;
  bits<1>  cz = 0;
  bits<7>  sz;
  bits<32> imm32 = 0;
  let op = opVal;
  let Inst{15} = cx;
  let Inst{14-8} = sx;
  let Inst{23} = cy;
  let Inst{22-16} = sy;
  let Inst{31} = cz;
  let Inst{30-24} = sz;
  let Inst{63-32}  = imm32;
}

class RR<bits<8>opVal, dag outs, dag ins, string asmstr>
   : RM<opVal, outs, ins, asmstr> {
  bits<1> cw = 0;
  bits<1> cw2 = 0;
  bits<4> cfw = 0;
  let imm32{0-23} = 0;
  let imm32{24} = cw;
  let imm32{25} = cw2;
  let imm32{26-27} = 0;
  let imm32{28-31} = cfw;
}

class CF<bits<8>opVal, dag outs, dag ins, string asmstr, list<dag> pattern=[]>
   : RM<opVal, outs, ins, asmstr, pattern> {
  bits<1>  cx2;
  bits<2>  bpf;
  bits<4>  cf;
  let cx = 0;
  let sx{6} = cx2;
  let sx{5-4} = bpf;
  let sx{3-0} = cf;
}

// Pseudo instructions.
class Pseudo<dag outs, dag ins, string asmstr, list<dag> pattern=[]>
   : InstVE<outs, ins, asmstr, pattern> {
  let isCodeGenOnly = 1;
  let isPseudo = 1;
}
OpenPOWER on IntegriCloud