@@ -102,79 +102,99 @@ class ModulePass;
102102 // PPC Specific MachineOperand flags.
103103 MO_NO_FLAG,
104104
105+ // / On PPC, the 12 bits are not enough for all target operand flags.
106+ // / Treat all PPC target flags as direct flags. To define new flag that is
107+ // / combination of other flags, add new enum entry instead of combining
108+ // / existing flags. See example MO_GOT_TPREL_PCREL_FLAG.
109+
105110 // / On a symbol operand "FOO", this indicates that the reference is actually
106111 // / to "FOO@plt". This is used for calls and jumps to external functions
107112 // / and for PIC calls on 32-bit ELF systems.
108- MO_PLT = 1 ,
113+ MO_PLT,
109114
110115 // / MO_PIC_FLAG - If this bit is set, the symbol reference is relative to
111116 // / the function's picbase, e.g. lo16(symbol-picbase).
112- MO_PIC_FLAG = 2 ,
117+ MO_PIC_FLAG,
113118
114119 // / MO_PCREL_FLAG - If this bit is set, the symbol reference is relative to
115120 // / the current instruction address(pc), e.g., var@pcrel. Fixup is VK_PCREL.
116- MO_PCREL_FLAG = 4 ,
121+ MO_PCREL_FLAG,
117122
118123 // / MO_GOT_FLAG - If this bit is set the symbol reference is to be computed
119124 // / via the GOT. For example when combined with the MO_PCREL_FLAG it should
120125 // / produce the relocation @got@pcrel. Fixup is VK_PPC_GOT_PCREL.
121- MO_GOT_FLAG = 8 ,
126+ MO_GOT_FLAG,
122127
123- // MO_PCREL_OPT_FLAG - If this bit is set the operand is part of a
124- // PC Relative linker optimization.
125- MO_PCREL_OPT_FLAG = 16 ,
128+ // / MO_PCREL_OPT_FLAG - If this bit is set the operand is part of a
129+ // / PC Relative linker optimization.
130+ MO_PCREL_OPT_FLAG,
126131
127132 // / MO_TLSGD_FLAG - If this bit is set the symbol reference is relative to
128133 // / TLS General Dynamic model for Linux and the variable offset of TLS
129134 // / General Dynamic model for AIX.
130- MO_TLSGD_FLAG = 32 ,
135+ MO_TLSGD_FLAG,
131136
132137 // / MO_TPREL_FLAG - If this bit is set, the symbol reference is relative to
133138 // / the thread pointer and the symbol can be used for the TLS Initial Exec
134139 // / and Local Exec models.
135- MO_TPREL_FLAG = 64 ,
140+ MO_TPREL_FLAG,
136141
137142 // / MO_TLSLD_FLAG - If this bit is set the symbol reference is relative to
138143 // / TLS Local Dynamic model.
139- MO_TLSLD_FLAG = 128 ,
144+ MO_TLSLD_FLAG,
140145
141146 // / MO_TLSGDM_FLAG - If this bit is set the symbol reference is relative
142147 // / to the region handle of TLS General Dynamic model for AIX.
143- MO_TLSGDM_FLAG = 256 ,
148+ MO_TLSGDM_FLAG,
144149
145150 // / MO_GOT_TLSGD_PCREL_FLAG - A combintaion of flags, if these bits are set
146151 // / they should produce the relocation @got@tlsgd@pcrel.
147152 // / Fix up is VK_PPC_GOT_TLSGD_PCREL
148- MO_GOT_TLSGD_PCREL_FLAG = MO_PCREL_FLAG | MO_GOT_FLAG | MO_TLSGD_FLAG,
153+ // / MO_GOT_TLSGD_PCREL_FLAG = MO_PCREL_FLAG | MO_GOT_FLAG | MO_TLSGD_FLAG,
154+ MO_GOT_TLSGD_PCREL_FLAG,
149155
150156 // / MO_GOT_TLSLD_PCREL_FLAG - A combintaion of flags, if these bits are set
151157 // / they should produce the relocation @got@tlsld@pcrel.
152158 // / Fix up is VK_PPC_GOT_TLSLD_PCREL
153- MO_GOT_TLSLD_PCREL_FLAG = MO_PCREL_FLAG | MO_GOT_FLAG | MO_TLSLD_FLAG,
159+ // / MO_GOT_TLSLD_PCREL_FLAG = MO_PCREL_FLAG | MO_GOT_FLAG | MO_TLSLD_FLAG,
160+ MO_GOT_TLSLD_PCREL_FLAG,
154161
155162 // / MO_GOT_TPREL_PCREL_FLAG - A combintaion of flags, if these bits are set
156163 // / they should produce the relocation @got@tprel@pcrel.
157164 // / Fix up is VK_PPC_GOT_TPREL_PCREL
158- MO_GOT_TPREL_PCREL_FLAG = MO_GOT_FLAG | MO_TPREL_FLAG | MO_PCREL_FLAG,
159-
160- // / The next are not flags but distinct values.
161- MO_ACCESS_MASK = 0xf00 ,
165+ // / MO_GOT_TPREL_PCREL_FLAG = MO_GOT_FLAG | MO_TPREL_FLAG | MO_PCREL_FLAG,
166+ MO_GOT_TPREL_PCREL_FLAG,
162167
163168 // / MO_LO, MO_HA - lo16(symbol) and ha16(symbol)
164- MO_LO = 1 << 8 ,
165- MO_HA = 2 << 8 ,
169+ MO_LO,
170+ MO_HA,
166171
167- MO_TPREL_LO = 4 << 8 ,
168- MO_TPREL_HA = 3 << 8 ,
172+ MO_TPREL_LO,
173+ MO_TPREL_HA,
169174
170175 // / These values identify relocations on immediates folded
171176 // / into memory operations.
172- MO_DTPREL_LO = 5 << 8 ,
173- MO_TLSLD_LO = 6 << 8 ,
174- MO_TOC_LO = 7 << 8 ,
177+ MO_DTPREL_LO,
178+ MO_TLSLD_LO,
179+ MO_TOC_LO,
180+
181+ // / Symbol for VK_PPC_TLS fixup attached to an ADD instruction
182+ MO_TLS,
183+
184+ // / MO_PIC_HA_FLAG = MO_PIC_FLAG | MO_HA
185+ MO_PIC_HA_FLAG,
186+
187+ // / MO_PIC_LO_FLAG = MO_PIC_FLAG | MO_LO
188+ MO_PIC_LO_FLAG,
189+
190+ // / MO_TPREL_PCREL_FLAG = MO_PCREL_FLAG | MO_TPREL_FLAG
191+ MO_TPREL_PCREL_FLAG,
192+
193+ // / MO_TPREL_PCREL_FLAG = MO_PCREL_FLAG | MO_TLS
194+ MO_TLS_PCREL_FLAG,
175195
176- // Symbol for VK_PPC_TLS fixup attached to an ADD instruction
177- MO_TLS = 8 << 8
196+ // / MO_GOT_PCREL_FLAG = MO_PCREL_FLAG | MO_GOT_FLAG
197+ MO_GOT_PCREL_FLAG,
178198 };
179199 } // end namespace PPCII
180200
0 commit comments