1 //==- SystemZ.h - Top-Level Interface for SystemZ representation -*- C++ -*-==//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file contains the entry points for global functions defined in
11 // the LLVM SystemZ backend.
13 //===----------------------------------------------------------------------===//
18 #include "MCTargetDesc/SystemZMCTargetDesc.h"
19 #include "llvm/Support/CodeGen.h"
22 class SystemZTargetMachine;
26 // Condition-code mask values.
27 const unsigned CCMASK_0 = 1 << 3;
28 const unsigned CCMASK_1 = 1 << 2;
29 const unsigned CCMASK_2 = 1 << 1;
30 const unsigned CCMASK_3 = 1 << 0;
31 const unsigned CCMASK_ANY = CCMASK_0 | CCMASK_1 | CCMASK_2 | CCMASK_3;
33 // Condition-code mask assignments for floating-point comparisons.
34 const unsigned CCMASK_CMP_EQ = CCMASK_0;
35 const unsigned CCMASK_CMP_LT = CCMASK_1;
36 const unsigned CCMASK_CMP_GT = CCMASK_2;
37 const unsigned CCMASK_CMP_UO = CCMASK_3;
38 const unsigned CCMASK_CMP_NE = CCMASK_CMP_LT | CCMASK_CMP_GT;
39 const unsigned CCMASK_CMP_LE = CCMASK_CMP_EQ | CCMASK_CMP_LT;
40 const unsigned CCMASK_CMP_GE = CCMASK_CMP_EQ | CCMASK_CMP_GT;
41 const unsigned CCMASK_CMP_O = CCMASK_ANY ^ CCMASK_CMP_UO;
43 // Return true if Val fits an LLILL operand.
44 static inline bool isImmLL(uint64_t Val) {
45 return (Val & ~0x000000000000ffffULL) == 0;
48 // Return true if Val fits an LLILH operand.
49 static inline bool isImmLH(uint64_t Val) {
50 return (Val & ~0x00000000ffff0000ULL) == 0;
53 // Return true if Val fits an LLIHL operand.
54 static inline bool isImmHL(uint64_t Val) {
55 return (Val & ~0x00000ffff00000000ULL) == 0;
58 // Return true if Val fits an LLIHH operand.
59 static inline bool isImmHH(uint64_t Val) {
60 return (Val & ~0xffff000000000000ULL) == 0;
63 // Return true if Val fits an LLILF operand.
64 static inline bool isImmLF(uint64_t Val) {
65 return (Val & ~0x00000000ffffffffULL) == 0;
68 // Return true if Val fits an LLIHF operand.
69 static inline bool isImmHF(uint64_t Val) {
70 return (Val & ~0xffffffff00000000ULL) == 0;
74 FunctionPass *createSystemZISelDag(SystemZTargetMachine &TM,
75 CodeGenOpt::Level OptLevel);
76 FunctionPass *createSystemZLongBranchPass(SystemZTargetMachine &TM);
77 } // end namespace llvm;