e8b02b1d24ba00dfa3ee9ed73dcb4a20c78b7c4a
[oota-llvm.git] / lib / Target / AMDGPU / AMDGPUUtil.h
1 //===-- AMDGPUUtil.h - AMDGPU Utility function declarations -----*- C++ -*-===//
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 // Declarations for utility functions common to all hw codegen targets.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef AMDGPU_UTIL_H
15 #define AMDGPU_UTIL_H
16
17 namespace llvm {
18
19 class MachineFunction;
20 class MachineRegisterInfo;
21 class TargetInstrInfo;
22
23 namespace AMDGPU {
24
25 bool isPlaceHolderOpcode(unsigned opcode);
26
27 bool isTransOp(unsigned opcode);
28 bool isTexOp(unsigned opcode);
29 bool isReductionOp(unsigned opcode);
30 bool isCubeOp(unsigned opcode);
31 bool isFCOp(unsigned opcode);
32
33 // XXX: Move these to AMDGPUInstrInfo.h
34 #define MO_FLAG_CLAMP (1 << 0)
35 #define MO_FLAG_NEG   (1 << 1)
36 #define MO_FLAG_ABS   (1 << 2)
37 #define MO_FLAG_MASK  (1 << 3)
38
39 void utilAddLiveIn(MachineFunction * MF, MachineRegisterInfo & MRI,
40     const TargetInstrInfo * TII, unsigned physReg, unsigned virtReg);
41
42 } // End namespace AMDGPU
43
44 } // End namespace llvm
45
46 #endif // AMDGPU_UTIL_H