• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// RUN: llvm-tblgen %s | FileCheck %s
2// XFAIL: vg_leak
3
4class XD { bits<4> Prefix = 11; }
5// CHECK: Prefix = { 1, 1, 0, 0 };
6class XS { bits<4> Prefix = 12; }
7class VEX { bit hasVEX_4VPrefix = 1; }
8
9def xd : XD;
10
11class BaseI {
12  bits<4> Prefix = 0;
13  bit hasVEX_4VPrefix = 0;
14}
15
16class I<bits<4> op> : BaseI {
17  bits<4> opcode = op;
18  int val = !if(!eq(Prefix, xd.Prefix), 7, 21);
19  int check = !if(hasVEX_4VPrefix, 0, 10);
20}
21
22multiclass R {
23  def rr : I<4>;
24}
25
26multiclass M {
27  def rm : I<2>;
28}
29
30multiclass Y {
31  defm SS : R, M, XD;
32// CHECK: Prefix = { 1, 1, 0, 0 };
33// CHECK: Prefix = { 1, 1, 0, 0 };
34  defm SD : R, M, XS;
35}
36
37// CHECK: int check = 0;
38defm Instr : Y, VEX;
39
40
41// Anonymous defm.
42
43multiclass SomeAnonymous<int x> {
44  def rm;
45  def mr;
46}
47
48// These multiclasses shouldn't conflict.
49defm : SomeAnonymous<1>;
50defm : SomeAnonymous<2>;