Skip to content

Commit 2f4b607

Browse files
committed
rewrite raoint multi class
1 parent a978e80 commit 2f4b607

File tree

1 file changed

+15
-19
lines changed

1 file changed

+15
-19
lines changed

llvm/lib/Target/X86/X86InstrRAOINT.td

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,30 +25,26 @@ def X86rao_xor : SDNode<"X86ISD::AXOR", SDTRAOBinaryArith,
2525
def X86rao_and : SDNode<"X86ISD::AAND", SDTRAOBinaryArith,
2626
[SDNPHasChain, SDNPMayStore, SDNPMemOperand]>;
2727

28-
multiclass RAOINT_BASE<string m, string suffix = ""> {
29-
let Predicates = [HasRAOINT] in
30-
def 32mr#suffix : I<0xfc, MRMDestMem, (outs), (ins i32mem:$src1, GR32:$src2),
31-
!strconcat("a", m, "{l}\t", binop_args),
32-
[(!cast<SDNode>("X86rao_" # m) addr:$src1, GR32:$src2)]>,
33-
NoCD8, Sched<[WriteALURMW]>;
28+
multiclass RaoInt<string m, string suffix = ""> {
29+
let SchedRW = [WriteALURMW, ReadDefault, ReadDefault, ReadDefault, ReadDefault, ReadDefault] in {
30+
def 32mr#suffix : BinOpMR<0xfc, "a"#m, binop_args, Xi32, (outs),
31+
[(!cast<SDNode>("X86rao_" # m) addr:$src1, GR32:$src2)]>;
3432

35-
let Predicates = [HasRAOINT, In64BitMode] in
36-
def 64mr#suffix : I<0xfc, MRMDestMem, (outs), (ins i64mem:$src1, GR64:$src2),
37-
!strconcat("a", m, "{q}\t", binop_args),
38-
[(!cast<SDNode>("X86rao_" # m) addr:$src1, GR64:$src2)]>,
39-
NoCD8, Sched<[WriteALURMW]>, REX_W;
33+
def 64mr#suffix : BinOpMR<0xfc, "a"#m, binop_args, Xi64, (outs),
34+
[(!cast<SDNode>("X86rao_" # m) addr:$src1, GR64:$src2)]>, REX_W;
35+
}
4036
}
4137

4238
let Predicates = [HasRAOINT, NoEGPR] in {
43-
defm AADD : RAOINT_BASE<"add">, T8;
44-
defm AAND : RAOINT_BASE<"and">, T8, PD;
45-
defm AOR : RAOINT_BASE<"or" >, T8, XD;
46-
defm AXOR : RAOINT_BASE<"xor">, T8, XS;
39+
defm AADD : RaoInt<"add">, T8;
40+
defm AAND : RaoInt<"and">, T8, PD;
41+
defm AOR : RaoInt<"or" >, T8, XD;
42+
defm AXOR : RaoInt<"xor">, T8, XS;
4743
}
4844

4945
let Predicates = [HasRAOINT, HasEGPR, In64BitMode] in {
50-
defm AADD : RAOINT_BASE<"add", "_EVEX">, EVEX, T_MAP4;
51-
defm AAND : RAOINT_BASE<"and", "_EVEX">, EVEX, T_MAP4, PD;
52-
defm AOR : RAOINT_BASE<"or", "_EVEX">, EVEX, T_MAP4, XD;
53-
defm AXOR : RAOINT_BASE<"xor", "_EVEX">, EVEX, T_MAP4, XS;
46+
defm AADD : RaoInt<"add", "_EVEX">, EVEX, T_MAP4;
47+
defm AAND : RaoInt<"and", "_EVEX">, EVEX, T_MAP4, PD;
48+
defm AOR : RaoInt<"or", "_EVEX">, EVEX, T_MAP4, XD;
49+
defm AXOR : RaoInt<"xor", "_EVEX">, EVEX, T_MAP4, XS;
5450
}

0 commit comments

Comments
 (0)