blob: cfa756df2067279b600ffa46d7fffc5d320e5fcd [file] [log] [blame]
Bill Wendlingb4be7f62013-08-22 20:46:05 +00001// RUN: llvm-tblgen %s | FileCheck %s
2
3// CHECK: bit IsDouble = 1;
4// CHECK: bit IsDouble = 1;
5// CHECK: bit IsDouble = 1;
6// CHECK-NOT: bit IsDouble = 1;
Bruno Cardoso Lopesee65db32010-06-10 02:42:59 +00007
8class Instruction<bits<4> opc, string Name> {
9 bits<4> opcode = opc;
10 string name = Name;
11 bit IsDouble = 0;
12}
13
14multiclass basic_r<bits<4> opc> {
15 let name = "newname" in {
16 def rr : Instruction<opc, "rr">;
17 def rm : Instruction<opc, "rm">;
18 }
19
20 let name = "othername" in
21 def rx : Instruction<opc, "rx">;
22}
23
24multiclass basic_ss<bits<4> opc> {
25 let IsDouble = 0 in
26 defm SS : basic_r<opc>;
27
28 let IsDouble = 1 in
29 defm SD : basic_r<opc>;
30}
31
32defm ADD : basic_ss<0xf>;
33