]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/lib/Target/X86/X86InstrMPX.td
MFV r339792:
[FreeBSD/FreeBSD.git] / contrib / llvm / lib / Target / X86 / X86InstrMPX.td
1 //===-- X86InstrMPX.td - MPX Instruction Set ---------*- tablegen -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file describes the X86 MPX instruction set, defining the
11 // instructions, and properties of the instructions which are needed for code
12 // generation, machine code emission, and analysis.
13 //
14 //===----------------------------------------------------------------------===//
15
16 // FIXME: Investigate a better scheduler itinerary once MPX is used inside LLVM.
17 let SchedRW = [WriteSystem] in {
18
19 multiclass mpx_bound_make<bits<8> opc, string OpcodeStr> {
20 let mayLoad = 1 in {
21   def 32rm: I<opc, MRMSrcMem, (outs BNDR:$dst), (ins i32mem:$src),
22               OpcodeStr#"\t{$src, $dst|$dst, $src}", [], IIC_MPX>,
23               Requires<[HasMPX, Not64BitMode]>;
24   def 64rm: RI<opc, MRMSrcMem, (outs BNDR:$dst), (ins i64mem:$src),
25               OpcodeStr#"\t{$src, $dst|$dst, $src}", [], IIC_MPX>,
26               Requires<[HasMPX, In64BitMode]>;
27 }
28 }
29
30 defm BNDMK : mpx_bound_make<0x1B, "bndmk">, XS;
31
32 multiclass mpx_bound_check<bits<8> opc, string OpcodeStr> {
33 let mayLoad = 1 in {
34   def 32rm: I<opc, MRMSrcMem, (outs), (ins  BNDR:$src1, i32mem:$src2),
35               OpcodeStr#"\t{$src2, $src1|$src1, $src2}", [], IIC_MPX>,
36               Requires<[HasMPX, Not64BitMode]>;
37   def 64rm: RI<opc, MRMSrcMem, (outs), (ins  BNDR:$src1, i64mem:$src2),
38               OpcodeStr#"\t{$src2, $src1|$src1, $src2}", [], IIC_MPX>,
39               Requires<[HasMPX, In64BitMode]>;
40 }
41   def 32rr: I<opc, MRMSrcReg, (outs), (ins  BNDR:$src1, GR32:$src2),
42               OpcodeStr#"\t{$src2, $src1|$src1, $src2}", [], IIC_MPX>,
43               Requires<[HasMPX, Not64BitMode]>;
44   def 64rr: RI<opc, MRMSrcReg, (outs), (ins  BNDR:$src1, GR64:$src2),
45               OpcodeStr#"\t{$src2, $src1|$src1, $src2}", [], IIC_MPX>,
46               Requires<[HasMPX, In64BitMode]>;
47 }
48 defm BNDCL : mpx_bound_check<0x1A, "bndcl">, XS;
49 defm BNDCU : mpx_bound_check<0x1A, "bndcu">, XD;
50 defm BNDCN : mpx_bound_check<0x1B, "bndcn">, XD;
51
52 def BNDMOVRMrr   : I<0x1A, MRMSrcReg, (outs BNDR:$dst), (ins BNDR:$src),
53                     "bndmov\t{$src, $dst|$dst, $src}", [], IIC_MPX>, PD,
54                     Requires<[HasMPX]>;
55 let mayLoad = 1 in {
56 def BNDMOVRM32rm : I<0x1A, MRMSrcMem, (outs BNDR:$dst), (ins i64mem:$src),
57                     "bndmov\t{$src, $dst|$dst, $src}", [], IIC_MPX>, PD,
58                     Requires<[HasMPX, Not64BitMode]>;
59 def BNDMOVRM64rm : RI<0x1A, MRMSrcMem, (outs BNDR:$dst), (ins i128mem:$src),
60                     "bndmov\t{$src, $dst|$dst, $src}", [], IIC_MPX>, PD,
61                     Requires<[HasMPX, In64BitMode]>;
62 }
63 def BNDMOVMRrr   : I<0x1B, MRMDestReg, (outs BNDR:$dst), (ins BNDR:$src),
64                     "bndmov\t{$src, $dst|$dst, $src}", [], IIC_MPX>, PD,
65                     Requires<[HasMPX]>;
66 let mayStore = 1 in {
67 def BNDMOVMR32mr : I<0x1B, MRMDestMem, (outs), (ins i64mem:$dst, BNDR:$src),
68                     "bndmov\t{$src, $dst|$dst, $src}", [], IIC_MPX>, PD,
69                     Requires<[HasMPX, Not64BitMode]>;
70 def BNDMOVMR64mr : RI<0x1B, MRMDestMem, (outs), (ins i128mem:$dst, BNDR:$src),
71                     "bndmov\t{$src, $dst|$dst, $src}", [], IIC_MPX>, PD,
72                     Requires<[HasMPX, In64BitMode]>;
73
74 def BNDSTXmr:      I<0x1B, MRMDestMem, (outs), (ins i64mem:$dst, BNDR:$src),
75                     "bndstx\t{$src, $dst|$dst, $src}", [], IIC_MPX>, PS,
76                     Requires<[HasMPX]>;
77 }
78 let mayLoad = 1 in
79 def BNDLDXrm:      I<0x1A, MRMSrcMem, (outs BNDR:$dst), (ins anymem:$src),
80                     "bndldx\t{$src, $dst|$dst, $src}", [], IIC_MPX>, PS,
81                     Requires<[HasMPX]>;
82 } // SchedRW