]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - contrib/llvm/lib/Target/R600/AMDGPUInstrInfo.td
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / contrib / llvm / lib / Target / R600 / AMDGPUInstrInfo.td
1 //===-- AMDGPUInstrInfo.td - AMDGPU DAG nodes --------------*- 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 contains DAG node defintions for the AMDGPU target.
11 //
12 //===----------------------------------------------------------------------===//
13
14 //===----------------------------------------------------------------------===//
15 // AMDGPU DAG Profiles
16 //===----------------------------------------------------------------------===//
17
18 def AMDGPUDTIntTernaryOp : SDTypeProfile<1, 3, [
19   SDTCisSameAs<0, 1>, SDTCisSameAs<0, 2>, SDTCisInt<0>, SDTCisInt<3>
20 ]>;
21
22 //===----------------------------------------------------------------------===//
23 // AMDGPU DAG Nodes
24 //
25
26 // out = ((a << 32) | b) >> c)
27 //
28 // Can be used to optimize rtol:
29 // rotl(a, b) = bitalign(a, a, 32 - b)
30 def AMDGPUbitalign : SDNode<"AMDGPUISD::BITALIGN", AMDGPUDTIntTernaryOp>;
31
32 // This argument to this node is a dword address.
33 def AMDGPUdwordaddr : SDNode<"AMDGPUISD::DWORDADDR", SDTIntUnaryOp>;
34
35 // out = a - floor(a)
36 def AMDGPUfract : SDNode<"AMDGPUISD::FRACT", SDTFPUnaryOp>;
37
38 // out = max(a, b) a and b are floats
39 def AMDGPUfmax : SDNode<"AMDGPUISD::FMAX", SDTFPBinOp,
40   [SDNPCommutative, SDNPAssociative]
41 >;
42
43 // out = max(a, b) a and b are signed ints
44 def AMDGPUsmax : SDNode<"AMDGPUISD::SMAX", SDTIntBinOp,
45   [SDNPCommutative, SDNPAssociative]
46 >;
47
48 // out = max(a, b) a and b are unsigned ints
49 def AMDGPUumax : SDNode<"AMDGPUISD::UMAX", SDTIntBinOp,
50   [SDNPCommutative, SDNPAssociative]
51 >;
52
53 // out = min(a, b) a and b are floats
54 def AMDGPUfmin : SDNode<"AMDGPUISD::FMIN", SDTFPBinOp,
55   [SDNPCommutative, SDNPAssociative]
56 >;
57
58 // out = min(a, b) a snd b are signed ints
59 def AMDGPUsmin : SDNode<"AMDGPUISD::SMIN", SDTIntBinOp,
60   [SDNPCommutative, SDNPAssociative]
61 >;
62
63 // out = min(a, b) a and b are unsigned ints
64 def AMDGPUumin : SDNode<"AMDGPUISD::UMIN", SDTIntBinOp,
65   [SDNPCommutative, SDNPAssociative]
66 >;
67
68 // urecip - This operation is a helper for integer division, it returns the
69 // result of 1 / a as a fractional unsigned integer.
70 // out = (2^32 / a) + e
71 // e is rounding error
72 def AMDGPUurecip : SDNode<"AMDGPUISD::URECIP", SDTIntUnaryOp>;
73
74 def fpow : SDNode<"ISD::FPOW", SDTFPBinOp>;
75
76 def AMDGPUregister_load : SDNode<"AMDGPUISD::REGISTER_LOAD",
77                           SDTypeProfile<1, 2, [SDTCisPtrTy<1>, SDTCisInt<2>]>,
78                           [SDNPHasChain, SDNPMayLoad]>;
79
80 def AMDGPUregister_store : SDNode<"AMDGPUISD::REGISTER_STORE",
81                            SDTypeProfile<0, 3, [SDTCisPtrTy<1>, SDTCisInt<2>]>,
82                            [SDNPHasChain, SDNPMayStore]>;