LLVM  4.0.0
SystemZ.h
Go to the documentation of this file.
1 //==- SystemZ.h - Top-Level Interface for SystemZ representation -*- 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 // This file contains the entry points for global functions defined in
11 // the LLVM SystemZ backend.
12 //
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZ_H
16 #define LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZ_H
17 
19 #include "llvm/Support/CodeGen.h"
20 
21 namespace llvm {
22 class SystemZTargetMachine;
23 class FunctionPass;
24 
25 namespace SystemZ {
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;
32 
33 // Condition-code mask assignments for integer and floating-point
34 // comparisons.
35 const unsigned CCMASK_CMP_EQ = CCMASK_0;
36 const unsigned CCMASK_CMP_LT = CCMASK_1;
37 const unsigned CCMASK_CMP_GT = CCMASK_2;
41 
42 // Condition-code mask assignments for floating-point comparisons only.
43 const unsigned CCMASK_CMP_UO = CCMASK_3;
45 
46 // All condition-code values produced by comparisons.
47 const unsigned CCMASK_ICMP = CCMASK_0 | CCMASK_1 | CCMASK_2;
49 
50 // Condition-code mask assignments for CS.
51 const unsigned CCMASK_CS_EQ = CCMASK_0;
52 const unsigned CCMASK_CS_NE = CCMASK_1;
53 const unsigned CCMASK_CS = CCMASK_0 | CCMASK_1;
54 
55 // Condition-code mask assignments for a completed SRST loop.
56 const unsigned CCMASK_SRST_FOUND = CCMASK_1;
57 const unsigned CCMASK_SRST_NOTFOUND = CCMASK_2;
58 const unsigned CCMASK_SRST = CCMASK_1 | CCMASK_2;
59 
60 // Condition-code mask assignments for TEST UNDER MASK.
61 const unsigned CCMASK_TM_ALL_0 = CCMASK_0;
64 const unsigned CCMASK_TM_ALL_1 = CCMASK_3;
67 const unsigned CCMASK_TM_MSB_0 = CCMASK_0 | CCMASK_1;
68 const unsigned CCMASK_TM_MSB_1 = CCMASK_2 | CCMASK_3;
69 const unsigned CCMASK_TM = CCMASK_ANY;
70 
71 // Condition-code mask assignments for TRANSACTION_BEGIN.
76 const unsigned CCMASK_TBEGIN = CCMASK_ANY;
77 
78 // Condition-code mask assignments for TRANSACTION_END.
79 const unsigned CCMASK_TEND_TX = CCMASK_0;
80 const unsigned CCMASK_TEND_NOTX = CCMASK_2;
82 
83 // Condition-code mask assignments for vector comparisons (and similar
84 // operations).
85 const unsigned CCMASK_VCMP_ALL = CCMASK_0;
86 const unsigned CCMASK_VCMP_MIXED = CCMASK_1;
87 const unsigned CCMASK_VCMP_NONE = CCMASK_3;
88 const unsigned CCMASK_VCMP = CCMASK_0 | CCMASK_1 | CCMASK_3;
89 
90 // Condition-code mask assignments for Test Data Class.
91 const unsigned CCMASK_TDC_NOMATCH = CCMASK_0;
92 const unsigned CCMASK_TDC_MATCH = CCMASK_1;
94 
95 // The position of the low CC bit in an IPM result.
96 const unsigned IPM_CC = 28;
97 
98 // Mask assignments for PFD.
99 const unsigned PFD_READ = 1;
100 const unsigned PFD_WRITE = 2;
101 
102 // Mask assignments for TDC
103 const unsigned TDCMASK_ZERO_PLUS = 0x800;
104 const unsigned TDCMASK_ZERO_MINUS = 0x400;
105 const unsigned TDCMASK_NORMAL_PLUS = 0x200;
106 const unsigned TDCMASK_NORMAL_MINUS = 0x100;
107 const unsigned TDCMASK_SUBNORMAL_PLUS = 0x080;
108 const unsigned TDCMASK_SUBNORMAL_MINUS = 0x040;
109 const unsigned TDCMASK_INFINITY_PLUS = 0x020;
110 const unsigned TDCMASK_INFINITY_MINUS = 0x010;
111 const unsigned TDCMASK_QNAN_PLUS = 0x008;
112 const unsigned TDCMASK_QNAN_MINUS = 0x004;
113 const unsigned TDCMASK_SNAN_PLUS = 0x002;
114 const unsigned TDCMASK_SNAN_MINUS = 0x001;
115 
123 const unsigned TDCMASK_NAN = TDCMASK_QNAN_PLUS |
127 const unsigned TDCMASK_PLUS = TDCMASK_POSITIVE |
131 const unsigned TDCMASK_MINUS = TDCMASK_NEGATIVE |
136 
137 // Number of bits in a vector register.
138 const unsigned VectorBits = 128;
139 
140 // Number of bytes in a vector register (and consequently the number of
141 // bytes in a general permute vector).
142 const unsigned VectorBytes = VectorBits / 8;
143 
144 // Return true if Val fits an LLILL operand.
145 static inline bool isImmLL(uint64_t Val) {
146  return (Val & ~0x000000000000ffffULL) == 0;
147 }
148 
149 // Return true if Val fits an LLILH operand.
150 static inline bool isImmLH(uint64_t Val) {
151  return (Val & ~0x00000000ffff0000ULL) == 0;
152 }
153 
154 // Return true if Val fits an LLIHL operand.
155 static inline bool isImmHL(uint64_t Val) {
156  return (Val & ~0x00000ffff00000000ULL) == 0;
157 }
158 
159 // Return true if Val fits an LLIHH operand.
160 static inline bool isImmHH(uint64_t Val) {
161  return (Val & ~0xffff000000000000ULL) == 0;
162 }
163 
164 // Return true if Val fits an LLILF operand.
165 static inline bool isImmLF(uint64_t Val) {
166  return (Val & ~0x00000000ffffffffULL) == 0;
167 }
168 
169 // Return true if Val fits an LLIHF operand.
170 static inline bool isImmHF(uint64_t Val) {
171  return (Val & ~0xffffffff00000000ULL) == 0;
172 }
173 } // end namespace SystemZ
174 
175 FunctionPass *createSystemZISelDag(SystemZTargetMachine &TM,
176  CodeGenOpt::Level OptLevel);
177 FunctionPass *createSystemZElimComparePass(SystemZTargetMachine &TM);
178 FunctionPass *createSystemZExpandPseudoPass(SystemZTargetMachine &TM);
179 FunctionPass *createSystemZShortenInstPass(SystemZTargetMachine &TM);
180 FunctionPass *createSystemZLongBranchPass(SystemZTargetMachine &TM);
181 FunctionPass *createSystemZLDCleanupPass(SystemZTargetMachine &TM);
182 FunctionPass *createSystemZTDCPass();
183 } // end namespace llvm
184 
185 #endif
static bool isImmHF(uint64_t Val)
Definition: SystemZ.h:170
const unsigned TDCMASK_SNAN_PLUS
Definition: SystemZ.h:113
const unsigned CCMASK_CMP_GT
Definition: SystemZ.h:37
const unsigned CCMASK_TBEGIN_TRANSIENT
Definition: SystemZ.h:74
const unsigned CCMASK_SRST_NOTFOUND
Definition: SystemZ.h:57
const unsigned PFD_READ
Definition: SystemZ.h:99
const unsigned TDCMASK_ZERO
Definition: SystemZ.h:116
const unsigned CCMASK_FCMP
Definition: SystemZ.h:48
static bool isImmLF(uint64_t Val)
Definition: SystemZ.h:165
static bool isImmHH(uint64_t Val)
Definition: SystemZ.h:160
const unsigned TDCMASK_NEGATIVE
Definition: SystemZ.h:120
const unsigned CCMASK_CS_EQ
Definition: SystemZ.h:51
const unsigned TDCMASK_POSITIVE
Definition: SystemZ.h:117
const unsigned CCMASK_ICMP
Definition: SystemZ.h:47
const unsigned PFD_WRITE
Definition: SystemZ.h:100
FunctionPass * createSystemZTDCPass()
const unsigned CCMASK_TM_MSB_0
Definition: SystemZ.h:67
FunctionPass * createSystemZISelDag(SystemZTargetMachine &TM, CodeGenOpt::Level OptLevel)
const unsigned CCMASK_2
Definition: SystemZ.h:29
const unsigned CCMASK_TBEGIN
Definition: SystemZ.h:76
FunctionPass * createSystemZShortenInstPass(SystemZTargetMachine &TM)
const unsigned CCMASK_ANY
Definition: SystemZ.h:31
const unsigned VectorBits
Definition: SystemZ.h:138
const unsigned CCMASK_CS_NE
Definition: SystemZ.h:52
const unsigned CCMASK_TM_SOME_0
Definition: SystemZ.h:65
const unsigned CCMASK_CS
Definition: SystemZ.h:53
const unsigned TDCMASK_ZERO_MINUS
Definition: SystemZ.h:104
const unsigned CCMASK_TM_ALL_1
Definition: SystemZ.h:64
const unsigned CCMASK_TBEGIN_PERSISTENT
Definition: SystemZ.h:75
const unsigned CCMASK_VCMP_NONE
Definition: SystemZ.h:87
const unsigned CCMASK_TBEGIN_INDETERMINATE
Definition: SystemZ.h:73
const unsigned TDCMASK_NORMAL_PLUS
Definition: SystemZ.h:105
const unsigned CCMASK_VCMP
Definition: SystemZ.h:88
const unsigned CCMASK_TM
Definition: SystemZ.h:69
const unsigned CCMASK_CMP_LE
Definition: SystemZ.h:39
const unsigned TDCMASK_SNAN_MINUS
Definition: SystemZ.h:114
const unsigned TDCMASK_SUBNORMAL_MINUS
Definition: SystemZ.h:108
const unsigned CCMASK_TM_MSB_1
Definition: SystemZ.h:68
const unsigned CCMASK_CMP_LT
Definition: SystemZ.h:36
const unsigned CCMASK_3
Definition: SystemZ.h:30
const unsigned CCMASK_TDC
Definition: SystemZ.h:93
const unsigned TDCMASK_NAN
Definition: SystemZ.h:123
const unsigned TDCMASK_INFINITY_PLUS
Definition: SystemZ.h:109
static bool isImmLH(uint64_t Val)
Definition: SystemZ.h:150
const unsigned CCMASK_TM_MIXED_MSB_0
Definition: SystemZ.h:62
const unsigned CCMASK_SRST_FOUND
Definition: SystemZ.h:56
FunctionPass * createSystemZExpandPseudoPass(SystemZTargetMachine &TM)
const unsigned TDCMASK_ALL
Definition: SystemZ.h:135
const unsigned CCMASK_CMP_EQ
Definition: SystemZ.h:35
const unsigned CCMASK_TEND_NOTX
Definition: SystemZ.h:80
const unsigned CCMASK_CMP_O
Definition: SystemZ.h:44
const unsigned CCMASK_TDC_MATCH
Definition: SystemZ.h:92
const unsigned CCMASK_CMP_NE
Definition: SystemZ.h:38
FunctionPass * createSystemZLongBranchPass(SystemZTargetMachine &TM)
const unsigned CCMASK_TM_MIXED_MSB_1
Definition: SystemZ.h:63
const unsigned CCMASK_SRST
Definition: SystemZ.h:58
const unsigned CCMASK_1
Definition: SystemZ.h:28
const unsigned VectorBytes
Definition: SystemZ.h:142
const unsigned CCMASK_0
Definition: SystemZ.h:27
const unsigned CCMASK_CMP_GE
Definition: SystemZ.h:40
FunctionPass * createSystemZLDCleanupPass(SystemZTargetMachine &TM)
const unsigned TDCMASK_QNAN_PLUS
Definition: SystemZ.h:111
const unsigned CCMASK_TBEGIN_STARTED
Definition: SystemZ.h:72
FunctionPass * createSystemZElimComparePass(SystemZTargetMachine &TM)
const unsigned CCMASK_VCMP_ALL
Definition: SystemZ.h:85
const unsigned CCMASK_TEND_TX
Definition: SystemZ.h:79
const unsigned TDCMASK_ZERO_PLUS
Definition: SystemZ.h:103
const unsigned TDCMASK_INFINITY_MINUS
Definition: SystemZ.h:110
static bool isImmLL(uint64_t Val)
Definition: SystemZ.h:145
const unsigned TDCMASK_NORMAL_MINUS
Definition: SystemZ.h:106
const unsigned CCMASK_TDC_NOMATCH
Definition: SystemZ.h:91
const unsigned IPM_CC
Definition: SystemZ.h:96
const unsigned CCMASK_TM_ALL_0
Definition: SystemZ.h:61
const unsigned CCMASK_TEND
Definition: SystemZ.h:81
const unsigned TDCMASK_PLUS
Definition: SystemZ.h:127
const unsigned CCMASK_VCMP_MIXED
Definition: SystemZ.h:86
const unsigned TDCMASK_MINUS
Definition: SystemZ.h:131
const unsigned CCMASK_TM_SOME_1
Definition: SystemZ.h:66
const unsigned TDCMASK_QNAN_MINUS
Definition: SystemZ.h:112
const unsigned TDCMASK_SUBNORMAL_PLUS
Definition: SystemZ.h:107
const unsigned CCMASK_CMP_UO
Definition: SystemZ.h:43
static bool isImmHL(uint64_t Val)
Definition: SystemZ.h:155