blob: 554dd2350b3df4bd14edaf3d86d4fdc71973cb54 [file] [log] [blame]
Dave Allison65fcc2c2014-04-28 13:45:27 -07001/*
2 * Copyright (C) 2014 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef ART_COMPILER_UTILS_ARM_ASSEMBLER_ARM32_H_
18#define ART_COMPILER_UTILS_ARM_ASSEMBLER_ARM32_H_
19
20#include <vector>
21
22#include "base/logging.h"
23#include "constants_arm.h"
24#include "utils/arm/managed_register_arm.h"
25#include "utils/arm/assembler_arm.h"
26#include "offsets.h"
Dave Allison65fcc2c2014-04-28 13:45:27 -070027
28namespace art {
29namespace arm {
30
31class Arm32Assembler FINAL : public ArmAssembler {
32 public:
Vladimir Marko93205e32016-04-13 11:59:46 +010033 explicit Arm32Assembler(ArenaAllocator* arena) : ArmAssembler(arena) {}
Dave Allison65fcc2c2014-04-28 13:45:27 -070034 virtual ~Arm32Assembler() {}
35
36 bool IsThumb() const OVERRIDE {
37 return false;
38 }
39
40 // Data-processing instructions.
Vladimir Marko73cf0fb2015-07-30 15:07:22 +010041 virtual void and_(Register rd, Register rn, const ShifterOperand& so,
42 Condition cond = AL, SetCc set_cc = kCcDontCare) OVERRIDE;
Dave Allison65fcc2c2014-04-28 13:45:27 -070043
Vladimir Marko73cf0fb2015-07-30 15:07:22 +010044 virtual void eor(Register rd, Register rn, const ShifterOperand& so,
45 Condition cond = AL, SetCc set_cc = kCcDontCare) OVERRIDE;
Dave Allison65fcc2c2014-04-28 13:45:27 -070046
Vladimir Marko73cf0fb2015-07-30 15:07:22 +010047 virtual void sub(Register rd, Register rn, const ShifterOperand& so,
48 Condition cond = AL, SetCc set_cc = kCcDontCare) OVERRIDE;
Dave Allison65fcc2c2014-04-28 13:45:27 -070049
Vladimir Marko73cf0fb2015-07-30 15:07:22 +010050 virtual void rsb(Register rd, Register rn, const ShifterOperand& so,
51 Condition cond = AL, SetCc set_cc = kCcDontCare) OVERRIDE;
Dave Allison65fcc2c2014-04-28 13:45:27 -070052
Vladimir Marko73cf0fb2015-07-30 15:07:22 +010053 virtual void add(Register rd, Register rn, const ShifterOperand& so,
54 Condition cond = AL, SetCc set_cc = kCcDontCare) OVERRIDE;
Dave Allison65fcc2c2014-04-28 13:45:27 -070055
Vladimir Marko73cf0fb2015-07-30 15:07:22 +010056 virtual void adc(Register rd, Register rn, const ShifterOperand& so,
57 Condition cond = AL, SetCc set_cc = kCcDontCare) OVERRIDE;
Dave Allison65fcc2c2014-04-28 13:45:27 -070058
Vladimir Marko73cf0fb2015-07-30 15:07:22 +010059 virtual void sbc(Register rd, Register rn, const ShifterOperand& so,
60 Condition cond = AL, SetCc set_cc = kCcDontCare) OVERRIDE;
Dave Allison65fcc2c2014-04-28 13:45:27 -070061
Vladimir Marko73cf0fb2015-07-30 15:07:22 +010062 virtual void rsc(Register rd, Register rn, const ShifterOperand& so,
63 Condition cond = AL, SetCc set_cc = kCcDontCare) OVERRIDE;
Dave Allison65fcc2c2014-04-28 13:45:27 -070064
65 void tst(Register rn, const ShifterOperand& so, Condition cond = AL) OVERRIDE;
66
67 void teq(Register rn, const ShifterOperand& so, Condition cond = AL) OVERRIDE;
68
69 void cmp(Register rn, const ShifterOperand& so, Condition cond = AL) OVERRIDE;
70
71 void cmn(Register rn, const ShifterOperand& so, Condition cond = AL) OVERRIDE;
72
Vladimir Marko73cf0fb2015-07-30 15:07:22 +010073 virtual void orr(Register rd, Register rn, const ShifterOperand& so,
74 Condition cond = AL, SetCc set_cc = kCcDontCare) OVERRIDE;
Dave Allison65fcc2c2014-04-28 13:45:27 -070075
Vladimir Markod2b4ca22015-09-14 15:13:26 +010076 virtual void orn(Register rd, Register rn, const ShifterOperand& so,
77 Condition cond = AL, SetCc set_cc = kCcDontCare) OVERRIDE;
78
Vladimir Marko73cf0fb2015-07-30 15:07:22 +010079 virtual void mov(Register rd, const ShifterOperand& so,
80 Condition cond = AL, SetCc set_cc = kCcDontCare) OVERRIDE;
Dave Allison65fcc2c2014-04-28 13:45:27 -070081
Vladimir Marko73cf0fb2015-07-30 15:07:22 +010082 virtual void bic(Register rd, Register rn, const ShifterOperand& so,
83 Condition cond = AL, SetCc set_cc = kCcDontCare) OVERRIDE;
Dave Allison65fcc2c2014-04-28 13:45:27 -070084
Vladimir Marko73cf0fb2015-07-30 15:07:22 +010085 virtual void mvn(Register rd, const ShifterOperand& so,
86 Condition cond = AL, SetCc set_cc = kCcDontCare) OVERRIDE;
Dave Allison65fcc2c2014-04-28 13:45:27 -070087
88 // Miscellaneous data-processing instructions.
89 void clz(Register rd, Register rm, Condition cond = AL) OVERRIDE;
90 void movw(Register rd, uint16_t imm16, Condition cond = AL) OVERRIDE;
91 void movt(Register rd, uint16_t imm16, Condition cond = AL) OVERRIDE;
Scott Wakeling9ee23f42015-07-23 10:44:35 +010092 void rbit(Register rd, Register rm, Condition cond = AL) OVERRIDE;
Artem Serovc257da72016-02-02 13:49:43 +000093 void rev(Register rd, Register rm, Condition cond = AL) OVERRIDE;
94 void rev16(Register rd, Register rm, Condition cond = AL) OVERRIDE;
95 void revsh(Register rd, Register rm, Condition cond = AL) OVERRIDE;
Dave Allison65fcc2c2014-04-28 13:45:27 -070096
97 // Multiply instructions.
98 void mul(Register rd, Register rn, Register rm, Condition cond = AL) OVERRIDE;
99 void mla(Register rd, Register rn, Register rm, Register ra,
100 Condition cond = AL) OVERRIDE;
101 void mls(Register rd, Register rn, Register rm, Register ra,
102 Condition cond = AL) OVERRIDE;
Zheng Xuc6667102015-05-15 16:08:45 +0800103 void smull(Register rd_lo, Register rd_hi, Register rn, Register rm,
104 Condition cond = AL) OVERRIDE;
Dave Allison65fcc2c2014-04-28 13:45:27 -0700105 void umull(Register rd_lo, Register rd_hi, Register rn, Register rm,
106 Condition cond = AL) OVERRIDE;
107
108 void sdiv(Register rd, Register rn, Register rm, Condition cond = AL) OVERRIDE;
109 void udiv(Register rd, Register rn, Register rm, Condition cond = AL) OVERRIDE;
110
Roland Levillain981e4542014-11-14 11:47:14 +0000111 // Bit field extract instructions.
Roland Levillain51d3fc42014-11-13 14:11:42 +0000112 void sbfx(Register rd, Register rn, uint32_t lsb, uint32_t width, Condition cond = AL) OVERRIDE;
Roland Levillain981e4542014-11-14 11:47:14 +0000113 void ubfx(Register rd, Register rn, uint32_t lsb, uint32_t width, Condition cond = AL) OVERRIDE;
Roland Levillain51d3fc42014-11-13 14:11:42 +0000114
Dave Allison65fcc2c2014-04-28 13:45:27 -0700115 // Load/store instructions.
116 void ldr(Register rd, const Address& ad, Condition cond = AL) OVERRIDE;
117 void str(Register rd, const Address& ad, Condition cond = AL) OVERRIDE;
118
119 void ldrb(Register rd, const Address& ad, Condition cond = AL) OVERRIDE;
120 void strb(Register rd, const Address& ad, Condition cond = AL) OVERRIDE;
121
122 void ldrh(Register rd, const Address& ad, Condition cond = AL) OVERRIDE;
123 void strh(Register rd, const Address& ad, Condition cond = AL) OVERRIDE;
124
125 void ldrsb(Register rd, const Address& ad, Condition cond = AL) OVERRIDE;
126 void ldrsh(Register rd, const Address& ad, Condition cond = AL) OVERRIDE;
127
128 void ldrd(Register rd, const Address& ad, Condition cond = AL) OVERRIDE;
129 void strd(Register rd, const Address& ad, Condition cond = AL) OVERRIDE;
130
131 void ldm(BlockAddressMode am, Register base,
132 RegList regs, Condition cond = AL) OVERRIDE;
133 void stm(BlockAddressMode am, Register base,
134 RegList regs, Condition cond = AL) OVERRIDE;
135
136 void ldrex(Register rd, Register rn, Condition cond = AL) OVERRIDE;
137 void strex(Register rd, Register rt, Register rn, Condition cond = AL) OVERRIDE;
Calin Juravle52c48962014-12-16 17:02:57 +0000138 void ldrexd(Register rt, Register rt2, Register rn, Condition cond = AL) OVERRIDE;
139 void strexd(Register rd, Register rt, Register rt2, Register rn, Condition cond = AL) OVERRIDE;
Dave Allison65fcc2c2014-04-28 13:45:27 -0700140
141 // Miscellaneous instructions.
142 void clrex(Condition cond = AL) OVERRIDE;
143 void nop(Condition cond = AL) OVERRIDE;
144
145 // Note that gdb sets breakpoints using the undefined instruction 0xe7f001f0.
146 void bkpt(uint16_t imm16) OVERRIDE;
147 void svc(uint32_t imm24) OVERRIDE;
148
149 void cbz(Register rn, Label* target) OVERRIDE;
150 void cbnz(Register rn, Label* target) OVERRIDE;
151
152 // Floating point instructions (VFPv3-D16 and VFPv3-D32 profiles).
153 void vmovsr(SRegister sn, Register rt, Condition cond = AL) OVERRIDE;
154 void vmovrs(Register rt, SRegister sn, Condition cond = AL) OVERRIDE;
155 void vmovsrr(SRegister sm, Register rt, Register rt2, Condition cond = AL) OVERRIDE;
156 void vmovrrs(Register rt, Register rt2, SRegister sm, Condition cond = AL) OVERRIDE;
157 void vmovdrr(DRegister dm, Register rt, Register rt2, Condition cond = AL) OVERRIDE;
158 void vmovrrd(Register rt, Register rt2, DRegister dm, Condition cond = AL) OVERRIDE;
159 void vmovs(SRegister sd, SRegister sm, Condition cond = AL) OVERRIDE;
160 void vmovd(DRegister dd, DRegister dm, Condition cond = AL) OVERRIDE;
161
162 // Returns false if the immediate cannot be encoded.
163 bool vmovs(SRegister sd, float s_imm, Condition cond = AL) OVERRIDE;
164 bool vmovd(DRegister dd, double d_imm, Condition cond = AL) OVERRIDE;
165
166 void vldrs(SRegister sd, const Address& ad, Condition cond = AL) OVERRIDE;
167 void vstrs(SRegister sd, const Address& ad, Condition cond = AL) OVERRIDE;
168 void vldrd(DRegister dd, const Address& ad, Condition cond = AL) OVERRIDE;
169 void vstrd(DRegister dd, const Address& ad, Condition cond = AL) OVERRIDE;
170
171 void vadds(SRegister sd, SRegister sn, SRegister sm, Condition cond = AL) OVERRIDE;
172 void vaddd(DRegister dd, DRegister dn, DRegister dm, Condition cond = AL) OVERRIDE;
173 void vsubs(SRegister sd, SRegister sn, SRegister sm, Condition cond = AL) OVERRIDE;
174 void vsubd(DRegister dd, DRegister dn, DRegister dm, Condition cond = AL) OVERRIDE;
175 void vmuls(SRegister sd, SRegister sn, SRegister sm, Condition cond = AL) OVERRIDE;
176 void vmuld(DRegister dd, DRegister dn, DRegister dm, Condition cond = AL) OVERRIDE;
177 void vmlas(SRegister sd, SRegister sn, SRegister sm, Condition cond = AL) OVERRIDE;
178 void vmlad(DRegister dd, DRegister dn, DRegister dm, Condition cond = AL) OVERRIDE;
179 void vmlss(SRegister sd, SRegister sn, SRegister sm, Condition cond = AL) OVERRIDE;
180 void vmlsd(DRegister dd, DRegister dn, DRegister dm, Condition cond = AL) OVERRIDE;
181 void vdivs(SRegister sd, SRegister sn, SRegister sm, Condition cond = AL) OVERRIDE;
182 void vdivd(DRegister dd, DRegister dn, DRegister dm, Condition cond = AL) OVERRIDE;
183
184 void vabss(SRegister sd, SRegister sm, Condition cond = AL) OVERRIDE;
185 void vabsd(DRegister dd, DRegister dm, Condition cond = AL) OVERRIDE;
186 void vnegs(SRegister sd, SRegister sm, Condition cond = AL) OVERRIDE;
187 void vnegd(DRegister dd, DRegister dm, Condition cond = AL) OVERRIDE;
188 void vsqrts(SRegister sd, SRegister sm, Condition cond = AL) OVERRIDE;
189 void vsqrtd(DRegister dd, DRegister dm, Condition cond = AL) OVERRIDE;
190
191 void vcvtsd(SRegister sd, DRegister dm, Condition cond = AL) OVERRIDE;
192 void vcvtds(DRegister dd, SRegister sm, Condition cond = AL) OVERRIDE;
193 void vcvtis(SRegister sd, SRegister sm, Condition cond = AL) OVERRIDE;
194 void vcvtid(SRegister sd, DRegister dm, Condition cond = AL) OVERRIDE;
195 void vcvtsi(SRegister sd, SRegister sm, Condition cond = AL) OVERRIDE;
196 void vcvtdi(DRegister dd, SRegister sm, Condition cond = AL) OVERRIDE;
197 void vcvtus(SRegister sd, SRegister sm, Condition cond = AL) OVERRIDE;
198 void vcvtud(SRegister sd, DRegister dm, Condition cond = AL) OVERRIDE;
199 void vcvtsu(SRegister sd, SRegister sm, Condition cond = AL) OVERRIDE;
200 void vcvtdu(DRegister dd, SRegister sm, Condition cond = AL) OVERRIDE;
201
202 void vcmps(SRegister sd, SRegister sm, Condition cond = AL) OVERRIDE;
203 void vcmpd(DRegister dd, DRegister dm, Condition cond = AL) OVERRIDE;
204 void vcmpsz(SRegister sd, Condition cond = AL) OVERRIDE;
205 void vcmpdz(DRegister dd, Condition cond = AL) OVERRIDE;
206 void vmstat(Condition cond = AL) OVERRIDE; // VMRS APSR_nzcv, FPSCR
207
xueliang.zhonge652c122016-06-13 14:42:27 +0100208 void vcntd(DRegister dd, DRegister dm) OVERRIDE;
209 void vpaddld(DRegister dd, DRegister dm, int32_t size, bool is_unsigned) OVERRIDE;
210
Dave Allison65fcc2c2014-04-28 13:45:27 -0700211 void vpushs(SRegister reg, int nregs, Condition cond = AL) OVERRIDE;
212 void vpushd(DRegister reg, int nregs, Condition cond = AL) OVERRIDE;
213 void vpops(SRegister reg, int nregs, Condition cond = AL) OVERRIDE;
214 void vpopd(DRegister reg, int nregs, Condition cond = AL) OVERRIDE;
215
216 // Branch instructions.
Nicolas Geoffrayd56376c2015-05-21 12:32:34 +0000217 void b(Label* label, Condition cond = AL) OVERRIDE;
218 void bl(Label* label, Condition cond = AL) OVERRIDE;
Dave Allison65fcc2c2014-04-28 13:45:27 -0700219 void blx(Register rm, Condition cond = AL) OVERRIDE;
220 void bx(Register rm, Condition cond = AL) OVERRIDE;
Vladimir Marko73cf0fb2015-07-30 15:07:22 +0100221 virtual void Lsl(Register rd, Register rm, uint32_t shift_imm,
222 Condition cond = AL, SetCc set_cc = kCcDontCare) OVERRIDE;
223 virtual void Lsr(Register rd, Register rm, uint32_t shift_imm,
224 Condition cond = AL, SetCc set_cc = kCcDontCare) OVERRIDE;
225 virtual void Asr(Register rd, Register rm, uint32_t shift_imm,
226 Condition cond = AL, SetCc set_cc = kCcDontCare) OVERRIDE;
227 virtual void Ror(Register rd, Register rm, uint32_t shift_imm,
228 Condition cond = AL, SetCc set_cc = kCcDontCare) OVERRIDE;
229 virtual void Rrx(Register rd, Register rm,
230 Condition cond = AL, SetCc set_cc = kCcDontCare) OVERRIDE;
Dave Allison45fdb932014-06-25 12:37:10 -0700231
Vladimir Marko73cf0fb2015-07-30 15:07:22 +0100232 virtual void Lsl(Register rd, Register rm, Register rn,
233 Condition cond = AL, SetCc set_cc = kCcDontCare) OVERRIDE;
234 virtual void Lsr(Register rd, Register rm, Register rn,
235 Condition cond = AL, SetCc set_cc = kCcDontCare) OVERRIDE;
236 virtual void Asr(Register rd, Register rm, Register rn,
237 Condition cond = AL, SetCc set_cc = kCcDontCare) OVERRIDE;
238 virtual void Ror(Register rd, Register rm, Register rn,
239 Condition cond = AL, SetCc set_cc = kCcDontCare) OVERRIDE;
Dave Allison65fcc2c2014-04-28 13:45:27 -0700240
241 void Push(Register rd, Condition cond = AL) OVERRIDE;
242 void Pop(Register rd, Condition cond = AL) OVERRIDE;
243
244 void PushList(RegList regs, Condition cond = AL) OVERRIDE;
245 void PopList(RegList regs, Condition cond = AL) OVERRIDE;
246
247 void Mov(Register rd, Register rm, Condition cond = AL) OVERRIDE;
248
249 void CompareAndBranchIfZero(Register r, Label* label) OVERRIDE;
250 void CompareAndBranchIfNonZero(Register r, Label* label) OVERRIDE;
251
Nicolas Geoffray19a19cf2014-10-22 16:07:05 +0100252 // Memory barriers.
253 void dmb(DmbOptions flavor) OVERRIDE;
Dave Allison65fcc2c2014-04-28 13:45:27 -0700254
Vladimir Markocf93a5c2015-06-16 11:33:24 +0000255 // Get the final position of a label after local fixup based on the old position
256 // recorded before FinalizeCode().
257 uint32_t GetAdjustedPosition(uint32_t old_position) OVERRIDE;
258
259 Literal* NewLiteral(size_t size, const uint8_t* data) OVERRIDE;
260 void LoadLiteral(Register rt, Literal* literal) OVERRIDE;
261 void LoadLiteral(Register rt, Register rt2, Literal* literal) OVERRIDE;
262 void LoadLiteral(SRegister sd, Literal* literal) OVERRIDE;
263 void LoadLiteral(DRegister dd, Literal* literal) OVERRIDE;
264
Dave Allison65fcc2c2014-04-28 13:45:27 -0700265 // Add signed constant value to rd. May clobber IP.
Dave Allison65fcc2c2014-04-28 13:45:27 -0700266 void AddConstant(Register rd, Register rn, int32_t value,
Vladimir Marko449b1092015-09-08 12:16:45 +0100267 Condition cond = AL, SetCc set_cc = kCcDontCare) OVERRIDE;
Dave Allison65fcc2c2014-04-28 13:45:27 -0700268
Andreas Gampe7cffc3b2015-10-19 21:31:53 -0700269 void CmpConstant(Register rn, int32_t value, Condition cond = AL) OVERRIDE;
270
Dave Allison65fcc2c2014-04-28 13:45:27 -0700271 // Load and Store. May clobber IP.
272 void LoadImmediate(Register rd, int32_t value, Condition cond = AL) OVERRIDE;
Vladimir Markoebdbf4b2016-07-07 15:37:02 +0100273 void LoadDImmediate(DRegister dd, double value, Condition cond = AL) OVERRIDE;
Dave Allison65fcc2c2014-04-28 13:45:27 -0700274 void MarkExceptionHandler(Label* label) OVERRIDE;
275 void LoadFromOffset(LoadOperandType type,
276 Register reg,
277 Register base,
278 int32_t offset,
279 Condition cond = AL) OVERRIDE;
280 void StoreToOffset(StoreOperandType type,
281 Register reg,
282 Register base,
283 int32_t offset,
284 Condition cond = AL) OVERRIDE;
285 void LoadSFromOffset(SRegister reg,
286 Register base,
287 int32_t offset,
288 Condition cond = AL) OVERRIDE;
289 void StoreSToOffset(SRegister reg,
290 Register base,
291 int32_t offset,
292 Condition cond = AL) OVERRIDE;
293 void LoadDFromOffset(DRegister reg,
294 Register base,
295 int32_t offset,
296 Condition cond = AL) OVERRIDE;
297 void StoreDToOffset(DRegister reg,
298 Register base,
299 int32_t offset,
300 Condition cond = AL) OVERRIDE;
301
Nicolas Geoffray3bcc8ea2014-11-28 15:00:02 +0000302 bool ShifterOperandCanHold(Register rd,
303 Register rn,
304 Opcode opcode,
305 uint32_t immediate,
Vladimir Markof5c09c32015-12-17 12:08:08 +0000306 SetCc set_cc,
Nicolas Geoffray3bcc8ea2014-11-28 15:00:02 +0000307 ShifterOperand* shifter_op) OVERRIDE;
Vladimir Markof5c09c32015-12-17 12:08:08 +0000308 using ArmAssembler::ShifterOperandCanHold; // Don't hide the non-virtual override.
Nicolas Geoffray3bcc8ea2014-11-28 15:00:02 +0000309
Nicolas Geoffray5bd05a52015-10-13 09:48:30 +0100310 bool ShifterOperandCanAlwaysHold(uint32_t immediate) OVERRIDE;
Dave Allison65fcc2c2014-04-28 13:45:27 -0700311
Ian Rogers13735952014-10-08 12:43:28 -0700312 static bool IsInstructionForExceptionHandling(uintptr_t pc);
Dave Allison65fcc2c2014-04-28 13:45:27 -0700313
314 // Emit data (e.g. encoded instruction or immediate) to the
315 // instruction stream.
316 void Emit(int32_t value);
317 void Bind(Label* label) OVERRIDE;
318
319 void MemoryBarrier(ManagedRegister scratch) OVERRIDE;
320
Andreas Gampe7cffc3b2015-10-19 21:31:53 -0700321 JumpTable* CreateJumpTable(std::vector<Label*>&& labels, Register base_reg) OVERRIDE;
322 void EmitJumpTableDispatch(JumpTable* jump_table, Register displacement_reg) OVERRIDE;
323
324 void FinalizeCode() OVERRIDE;
325
Dave Allison65fcc2c2014-04-28 13:45:27 -0700326 private:
327 void EmitType01(Condition cond,
328 int type,
329 Opcode opcode,
Vladimir Marko73cf0fb2015-07-30 15:07:22 +0100330 SetCc set_cc,
Dave Allison65fcc2c2014-04-28 13:45:27 -0700331 Register rn,
332 Register rd,
333 const ShifterOperand& so);
334
335 void EmitType5(Condition cond, int offset, bool link);
336
337 void EmitMemOp(Condition cond,
338 bool load,
339 bool byte,
340 Register rd,
341 const Address& ad);
342
343 void EmitMemOpAddressMode3(Condition cond,
344 int32_t mode,
345 Register rd,
346 const Address& ad);
347
348 void EmitMultiMemOp(Condition cond,
349 BlockAddressMode am,
350 bool load,
351 Register base,
352 RegList regs);
353
354 void EmitShiftImmediate(Condition cond,
355 Shift opcode,
356 Register rd,
357 Register rm,
358 const ShifterOperand& so);
359
360 void EmitShiftRegister(Condition cond,
361 Shift opcode,
362 Register rd,
363 Register rm,
364 const ShifterOperand& so);
365
366 void EmitMulOp(Condition cond,
367 int32_t opcode,
368 Register rd,
369 Register rn,
370 Register rm,
371 Register rs);
372
373 void EmitVFPsss(Condition cond,
374 int32_t opcode,
375 SRegister sd,
376 SRegister sn,
377 SRegister sm);
378
379 void EmitVFPddd(Condition cond,
380 int32_t opcode,
381 DRegister dd,
382 DRegister dn,
383 DRegister dm);
384
385 void EmitVFPsd(Condition cond,
386 int32_t opcode,
387 SRegister sd,
388 DRegister dm);
389
390 void EmitVFPds(Condition cond,
391 int32_t opcode,
392 DRegister dd,
393 SRegister sm);
394
395 void EmitVPushPop(uint32_t reg, int nregs, bool push, bool dbl, Condition cond);
396
Artem Serovc257da72016-02-02 13:49:43 +0000397 void EmitMiscellaneous(Condition cond, uint8_t op1, uint8_t op2,
398 uint32_t a_part, uint32_t rest);
399 void EmitReverseBytes(Register rd, Register rm, Condition cond,
400 uint8_t op1, uint8_t op2);
401
Dave Allison65fcc2c2014-04-28 13:45:27 -0700402 void EmitBranch(Condition cond, Label* label, bool link);
403 static int32_t EncodeBranchOffset(int offset, int32_t inst);
404 static int DecodeBranchOffset(int32_t inst);
Nicolas Geoffray3bcc8ea2014-11-28 15:00:02 +0000405 bool ShifterOperandCanHoldArm32(uint32_t immediate, ShifterOperand* shifter_op);
Dave Allison65fcc2c2014-04-28 13:45:27 -0700406};
407
408} // namespace arm
409} // namespace art
410
411#endif // ART_COMPILER_UTILS_ARM_ASSEMBLER_ARM32_H_