7353d3630b4d76c59b82e4f477ef384c2d790d4b
[oota-llvm.git] / test / TableGen / DefmInsideMultiClass.td
1 // RUN: llvm-tblgen %s | FileCheck %s
2
3 // CHECK: ADDPSrr
4 // CHECK-NOT: ADDPSrr
5
6 class Instruction<bits<4> opc, string Name> {
7   bits<4> opcode = opc;
8   string name = Name;
9 }
10
11 multiclass basic_r<bits<4> opc> {
12   def rr : Instruction<opc, "rr">;
13   def rm : Instruction<opc, "rm">;
14 }
15
16 multiclass basic_s<bits<4> opc> {
17   defm SS : basic_r<opc>;
18   defm SD : basic_r<opc>;
19 }
20
21 multiclass basic_p<bits<4> opc> {
22   defm PS : basic_r<opc>;
23   defm PD : basic_r<opc>;
24 }
25
26 defm ADD : basic_s<0xf>, basic_p<0xf>;
27 defm SUB : basic_s<0xe>, basic_p<0xe>;