CACAO
Aarch64Instructions.hpp
Go to the documentation of this file.
1 /* src/vm/jit/compiler2/aarch64/Aarch64Instructions.hpp
2 
3  Copyright (C) 2013
4  CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
5 
6  This file is part of CACAO.
7 
8  This program is free software; you can redistribute it and/or
9  modify it under the terms of the GNU General Public License as
10  published by the Free Software Foundation; either version 2, or (at
11  your option) any later version.
12 
13  This program is distributed in the hope that it will be useful, but
14  WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with this program; if not, write to the Free Software
20  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21  02110-1301, USA.
22 
23 */
24 
25 #ifndef _JIT_COMPILER2_AARCH64_INSTRUCTIONS
26 #define _JIT_COMPILER2_AARCH64_INSTRUCTIONS
27 
32 #include "vm/jit/PatcherNew.hpp"
33 
34 namespace cacao {
35 namespace jit {
36 namespace compiler2 {
37 namespace aarch64 {
38 
39 const u1 kStackSlotSize = 8;
40 
41 // TODO: As soon as the wrappers are final, document them
42 
43 struct SrcOp {
45  explicit SrcOp(MachineOperand *op) : op(op) {}
46 };
47 
48 struct DstOp {
50  explicit DstOp(MachineOperand *op) : op(op) {}
51 };
52 
53 struct BaseOp {
55  explicit BaseOp(MachineOperand *op) : op(op) {}
56 };
57 
58 struct IdxOp {
60  explicit IdxOp(MachineOperand *op) : op(op) {}
61 };
62 
64  Immediate* imm = op->to_Immediate(); assert(imm);
65  return imm;
66 }
67 
69 public:
71  Type::TypeID type, std::size_t num_operands)
72  : MachineInstruction(name, result, num_operands),
73  result_type(type) {}
74 
77  return regFromType(reg->index, type);
78  }
79 
80  Reg reg_res() const {
81  return fromOp(result.op, result_type);
82  }
83 
84  Reg reg_op(std::size_t idx) const {
85  assert(idx < operands.size());
86  return fromOp(operands[idx].op, result_type);
87  }
88 
89  virtual void emit(CodeMemory* cm) const {
90  Emitter em;
91  emit(em);
92  em.emit(cm);
93  }
94 
95  virtual void emit(Emitter& em) const {}
96  Type::TypeID resultT() const { return result_type; }
97 
98 private:
100 
101  virtual Reg regFromType(u1 reg, Type::TypeID type) const {
102  switch (type) {
103  case Type::ByteTypeID:
104  case Type::CharTypeID:
105  case Type::ShortTypeID:
106  case Type::IntTypeID: return Reg::W(reg);
108  case Type::LongTypeID: return Reg::X(reg);
109  case Type::FloatTypeID: return Reg::S(reg);
110  case Type::DoubleTypeID: return Reg::D(reg);
111  default: break;
112  }
113  ABORT_MSG("aarch64: regFromOpSize unsupported op_size",
114  "Type: " << type);
115  return Reg::XZR; // make compiler happy
116  }
117 };
118 
119 
121 public:
122  MovImmInst(const DstOp &dst, const SrcOp &src, Type::TypeID type)
123  : AArch64Instruction("Aarch64MovImmInst", dst.op, type, 1) {
124  operands[0].op = src.op;
125  }
126 
127  virtual void emit(Emitter& em) const;
128 
129 private:
130  void emitIConst(Emitter& em) const;
131  void emitLConst(Emitter& em) const;
132 };
133 
134 
135 class MovInst : public AArch64Instruction {
136 public:
137  MovInst(const DstOp &dst, const SrcOp &src, Type::TypeID type)
138  : AArch64Instruction("Aarch64MovInst", dst.op, type, 1) {
139  operands[0].op = src.op;
140  }
141 
142  virtual bool is_move() const { return true; }
143  virtual void emit(Emitter& em) const;
144 };
145 
146 
148 public:
149  StoreInst(const SrcOp &src, const BaseOp &base, const IdxOp &offset,
150  Type::TypeID type)
151  : AArch64Instruction("Aarch64StoreInst", &NoOperand, type, 3) {
152  operands[0].op = src.op;
153  operands[1].op = base.op;
154  operands[2].op = offset.op;
155  }
156 
157  StoreInst(const SrcOp &src, const DstOp &dst, Type::TypeID type)
158  : AArch64Instruction("Aarch64StoreInst", dst.op, type, 1) {
159  operands[0].op = src.op;
160  }
161 
162  Reg reg_src() const {
163  return reg_op(0);
164  }
165 
166  Reg reg_base() const {
167  if (result.op->is_StackSlot()) {
168  return Reg::XFP;
169  } else if (result.op->is_ManagedStackSlot()) {
170  return Reg::XSP;
171  }
172 
173  MachineOperand *op = get(1).op;
174  if (op->is_Register()) {
175  return reg_op(1);
176  } else {
177  ABORT_MSG("MemoryInst::reg_base", op << " not supported");
178  }
179  assert(0);
180  }
181 
182  s4 offset() const {
183  if (result.op->is_StackSlot()) {
184  StackSlot* stackSlot = result.op->to_StackSlot();
185  return stackSlot->get_index() * kStackSlotSize;
186  } else if (result.op->is_ManagedStackSlot()) {
188  return stackSlot->get_index() * kStackSlotSize;
189  }
190 
191  MachineOperand *op = this->get(2).op;
192  if (op->is_Immediate()) {
194  return imm->get_Int();
195  } else {
196  ABORT_MSG("Memory::offset", op << " not supported");
197  }
198  assert(0);
199  }
200 
201  virtual bool is_move() const {
202  return operands[0].op->is_Register() &&
203  (result.op->is_StackSlot()
205  }
206 
207  virtual void emit(Emitter& em) const;
208 
209 private:
210  virtual Reg regFromType(u1 reg, Type::TypeID type) const {
211  switch (type) {
212  case Type::ByteTypeID: return Reg::B(reg);
213  case Type::ShortTypeID: return Reg::H(reg);
214  case Type::CharTypeID: return Reg::H(reg);
215  case Type::IntTypeID: return Reg::W(reg);
217  case Type::LongTypeID: return Reg::X(reg);
218  case Type::FloatTypeID: return Reg::S(reg);
219  case Type::DoubleTypeID: return Reg::D(reg);
220  default: break;
221  }
222  ABORT_MSG("aarch64: regFromOpSize unsupported type",
223  "Type: " << type);
224  return Reg::XZR; // make compiler happy
225  }
226 };
227 
228 
229 class LoadInst : public AArch64Instruction {
230 public:
231  LoadInst(const DstOp &dst, const BaseOp &base, const IdxOp &offset,
232  Type::TypeID type)
233  : AArch64Instruction("Aarch64LoadInst", dst.op, type, 2) {
234  operands[0].op = base.op;
235  operands[1].op = offset.op;
236  }
237 
238  LoadInst(const DstOp &dst, const SrcOp &src, Type::TypeID type)
239  : AArch64Instruction("Aarch64LoadInst", dst.op, type, 1) {
240  operands[0].op = src.op;
241  }
242 
243  Reg reg_base() const {
244  MachineOperand *op = get(0).op;
245  if (op->is_Register()) {
246  return reg_op(0);
247  } else if (op->is_StackSlot()) {
248  return Reg::XFP;
249  } else if (op->is_ManagedStackSlot()) {
250  return Reg::XSP;
251  } else {
252  ABORT_MSG("MemoryInst::reg_base", op << " not supported");
253  }
254  assert(0);
255  }
256 
257  s4 offset() const {
258  if (get(0).op->is_StackSlot()) {
259  StackSlot* stackSlot = get(0).op->to_StackSlot();
260  return stackSlot->get_index() * kStackSlotSize;
261  } else if (get(0).op->is_ManagedStackSlot()) {
262  ManagedStackSlot* stackSlot = get(0).op->to_ManagedStackSlot();
263  return stackSlot->get_index() * kStackSlotSize;
264  }
265 
266  MachineOperand *op = get(1).op;
267  if (op->is_Immediate()) {
269  return imm->get_Int();
270  } else {
271  ABORT_MSG("Memory::offset", op << " not supported");
272  }
273  assert(0);
274  }
275 
276  virtual bool is_move() const {
277  return result.op->is_Register() &&
278  (operands[0].op->is_StackSlot()
279  || operands[0].op->is_ManagedStackSlot());
280  }
281  virtual void emit(Emitter& em) const;
282 
283 private:
284  virtual Reg regFromType(u1 reg, Type::TypeID type) const {
285  switch (type) {
286  case Type::ByteTypeID: return Reg::B(reg);
287  case Type::ShortTypeID: return Reg::H(reg);
288  case Type::CharTypeID: return Reg::H(reg);
289  case Type::IntTypeID: return Reg::W(reg);
291  case Type::LongTypeID: return Reg::X(reg);
292  case Type::FloatTypeID: return Reg::S(reg);
293  case Type::DoubleTypeID: return Reg::D(reg);
294  default: break;
295  }
296  ABORT_MSG("aarch64: regFromOpSize unsupported type",
297  "Type: " << type);
298  return Reg::XZR; // make compiler happy
299  }
300 };
301 
302 
304 private:
305  DataSegment::IdxTy data_index;
306 public:
307  DsegAddrInst(const DstOp &dst, DataSegment::IdxTy &data_index,
308  Type::TypeID type)
309  : AArch64Instruction("Aarch64DsegAddrInst", dst.op, type, 0),
310  data_index(data_index) {}
311 
312  virtual void emit(CodeMemory* cm) const;
313  virtual void link(CodeFragment &CF) const;
314 };
315 
316 
317 class AddInst : public AArch64Instruction {
318 public:
319  AddInst(const DstOp &dst, const SrcOp &src1, const SrcOp &src2,
321  : AArch64Instruction("Aarch64AddInst", dst.op, type, 2),
322  shift(shift), amount(amount) {
323  operands[0].op = src1.op;
324  operands[1].op = src2.op;
325  }
326 
327  virtual void emit(Emitter& em) const;
328 
329 private:
332 };
333 
334 
335 class SubInst : public AArch64Instruction {
336 public:
337  SubInst(const DstOp &dst, const SrcOp &src1, const SrcOp &src2,
338  Type::TypeID type)
339  : AArch64Instruction("Aarch64SubInst", dst.op, type, 2) {
340  operands[0].op = src1.op;
341  operands[1].op = src2.op;
342  }
343 
344  virtual void emit(Emitter& em) const;
345 };
346 
347 
348 class MulInst : public AArch64Instruction {
349 public:
350  MulInst(const DstOp &dst, const SrcOp &src1, const SrcOp &src2,
351  Type::TypeID type)
352  : AArch64Instruction("Aarch64MulInst", dst.op, type, 2) {
353  operands[0].op = src1.op;
354  operands[1].op = src2.op;
355  }
356 
357  virtual void emit(Emitter& em) const;
358 };
359 
360 
362 public:
363  MulSubInst(const DstOp &dst, const SrcOp &src1, const SrcOp &src2,
364  const SrcOp &src3, Type::TypeID type)
365  : AArch64Instruction("Aarch64MulSubInst", dst.op, type, 3) {
366  operands[0].op = src1.op;
367  operands[1].op = src2.op;
368  operands[2].op = src3.op;
369  }
370 
371  virtual void emit(Emitter& em) const;
372 };
373 
374 
375 class DivInst : public AArch64Instruction {
376 public:
377  DivInst(const DstOp &dst, const SrcOp &src1, const SrcOp &src2,
378  Type::TypeID type)
379  : AArch64Instruction("Aarch64DivInst", dst.op, type, 2) {
380  operands[0].op = src1.op;
381  operands[1].op = src2.op;
382  }
383 
384  virtual void emit(Emitter& em) const;
385 };
386 
387 class NegInst : public AArch64Instruction {
388 public:
389  NegInst(const DstOp &dst, const SrcOp &src, Type::TypeID type)
390  : AArch64Instruction("Aarch64NegInst", dst.op, type, 1) {
391  operands[0].op = src.op;
392  }
393 
394  virtual void emit(Emitter& em) const;
395 };
396 
397 
398 class AndInst : public AArch64Instruction {
399 public:
400  AndInst(const DstOp &dst, const SrcOp &src1, const SrcOp &src2,
402  : AArch64Instruction("Aarch64AndInst", dst.op, type, 2),
403  shift(shift), amount(amount) {
404  operands[0].op = src1.op;
405  operands[1].op = src2.op;
406  }
407 
408  virtual void emit(Emitter& em) const;
409 
410 private:
413 };
414 
415 
416 class FCmpInst : public AArch64Instruction {
417 public:
418  FCmpInst(const SrcOp &src1, const SrcOp &src2, Type::TypeID type)
419  : AArch64Instruction("Aarch64FCmpInst", &NoOperand, type, 2) {
420  operands[0].op = src1.op;
421  operands[1].op = src2.op;
422  }
423 
424  virtual void emit(Emitter& em) const;
425 };
426 
427 
428 class FMovInst : public AArch64Instruction {
429 public:
430  FMovInst(const DstOp &dst, const SrcOp &src, Type::TypeID type)
431  : AArch64Instruction("Aarch64FMovInst", dst.op, type, 1) {
432  operands[0].op = src.op;
433  }
434 
435  virtual bool is_move() const { return true; }
436  virtual void emit(Emitter& em) const;
437 };
438 
439 
440 class FAddInst : public AArch64Instruction {
441 public:
442  FAddInst(const DstOp &dst, const SrcOp &src1, const SrcOp &src2,
443  Type::TypeID type)
444  : AArch64Instruction("Aarch64FAddInst", dst.op, type, 2) {
445  operands[0].op = src1.op;
446  operands[1].op = src2.op;
447  }
448 
449  virtual void emit(Emitter& em) const;
450 };
451 
452 
453 class FDivInst : public AArch64Instruction {
454 public:
455  FDivInst(const DstOp &dst, const SrcOp &src1, const SrcOp &src2,
456  Type::TypeID type)
457  : AArch64Instruction("Aarch64FDivInst", dst.op, type, 2) {
458  operands[0].op = src1.op;
459  operands[1].op = src2.op;
460  }
461 
462  virtual void emit(Emitter& em) const;
463 };
464 
465 
466 class FMulInst : public AArch64Instruction {
467 public:
468  FMulInst(const DstOp &dst, const SrcOp &src1, const SrcOp &src2,
469  Type::TypeID type)
470  : AArch64Instruction("Aarch64FMulInst", dst.op, type, 2) {
471  operands[0].op = src1.op;
472  operands[1].op = src2.op;
473  }
474 
475  virtual void emit(Emitter& em) const;
476 };
477 
478 
479 class FSubInst : public AArch64Instruction {
480 public:
481  FSubInst(const DstOp &dst, const SrcOp &src1, const SrcOp &src2,
482  Type::TypeID type)
483  : AArch64Instruction("Aarch64FSubInst", dst.op, type, 2) {
484  operands[0].op = src1.op;
485  operands[1].op = src2.op;
486  }
487 
488  virtual void emit(Emitter& em) const;
489 };
490 
491 
492 class FNegInst : public AArch64Instruction {
493 public:
494  FNegInst(const DstOp &dst, const SrcOp &src, Type::TypeID type)
495  : AArch64Instruction("Aarch64FNegInst", dst.op, type, 1) {
496  operands[0].op = src.op;
497  }
498 
499  virtual void emit(Emitter& em) const;
500 };
501 
502 
503 class JumpInst : public MachineJumpInst {
504 public:
506  successors.push_back(target);
507  }
508 
509  virtual bool is_jump() const { return true; }
511 
512  virtual void emit(CodeMemory* cm) const;
513  virtual void link(CodeFragment& cf) const;
514 };
515 
516 
517 class CmpInst : public AArch64Instruction {
518 public:
519  CmpInst(const SrcOp &src1, const SrcOp &src2, Type::TypeID type)
520  : AArch64Instruction("Aarch64CmpInst", &NoOperand, type, 2) {
521  operands[0].op = src1.op;
522  operands[1].op = src2.op;
523  }
524 
525  virtual void emit(Emitter& em) const;
526 };
527 
528 
529 class CSelInst : public AArch64Instruction {
530 private:
532 public:
533  CSelInst(const DstOp &dst, const SrcOp &src1, const SrcOp &src2,
535  : AArch64Instruction("Aarch64CSelInst", dst.op, type, 2),
536  cond(cond) {
537  operands[0].op = src1.op;
538  operands[1].op = src2.op;
539  }
540 
541  virtual void emit(Emitter& em) const;
542 };
543 
544 
546 public:
548  MachineBasicBlock* else_target)
549  : MachineInstruction("Aarch64CondJumpInst", &NoOperand, 0),
550  cond(cond), jump(else_target) {
551  successors.push_back(then_target);
552  successors.push_back(else_target);
553  }
554 
555  virtual bool is_jump() const { return true; }
558 
559  virtual void emit(CodeMemory* cm) const;
560  virtual void link(CodeFragment& cf) const;
561 
562 private:
564  mutable JumpInst jump;
565 };
566 
567 
569 private:
571 public:
573  : MachineInstruction("Aarch64EnterInst", &NoOperand, 0),
574  framesize(framesize) {}
575 
576  virtual void emit(CodeMemory* cm) const;
577 };
578 
579 
581 public:
583  : MachineInstruction("Aarch64LeaveInst", &NoOperand, 0) {}
584 
585  virtual void emit(CodeMemory* cm) const;
586 };
587 
588 
589 class RetInst : public MachineInstruction {
590 public:
591  RetInst() : MachineInstruction("Aarch64RetInst", &NoOperand, 0) {}
592  /**
593  * Non-void return. The source operand is only used to guide
594  * the register allocator. The user must ensure that the value
595  * really is in the correct register (e.g. by inserting a move)
596  */
597  RetInst(const SrcOp &src)
598  : MachineInstruction("Aarch64RetInst", &NoOperand, 1) {
599  operands[0].op = src.op;
600  }
601 
602  virtual bool is_end() const { return true; }
603  virtual void emit(CodeMemory* cm) const;
604 };
605 
606 
608 public:
609  IntToFpInst(const DstOp &dst, const SrcOp &src, Type::TypeID toType,
610  Type::TypeID fromType)
611  : AArch64Instruction("Aarch64IntToFpInst", dst.op, toType, 1),
612  from_type(fromType) {
613  operands[0].op = src.op;
614  }
615 
616  virtual void emit(Emitter& em) const;
617 
618 private:
620 
621  Reg reg_from() const {
622  return fromOp(operands[0].op, from_type);
623  }
624 };
625 
626 class FcvtInst : public AArch64Instruction {
627 public:
628  FcvtInst(const DstOp &dst, const SrcOp &src, Type::TypeID toType,
629  Type::TypeID fromType)
630  : AArch64Instruction("Aarch64FcvtInst", dst.op, toType, 1),
631  from_type(fromType) {
632  operands[0].op = src.op;
633  }
634 
635  virtual void emit(Emitter& em) const;
636 
637 private:
639 
640  Reg reg_from() const {
641  return fromOp(operands[0].op, from_type);
642  }
643 };
644 
646 public:
647  IntToLongInst(const DstOp &dst, const SrcOp &src)
648  : AArch64Instruction("Aarch64IntToLongInst", dst.op,
649  Type::IntTypeID, 1) {
650  operands[0].op = src.op;
651  }
652 
653  virtual void emit(Emitter& em) const;
654 };
655 
656 
658 public:
659  LongToIntInst(const DstOp &dst, const SrcOp &src)
660  : AArch64Instruction("Aarch64LongToIntInst", dst.op,
661  Type::IntTypeID, 1) {
662  operands[0].op = src.op;
663  }
664 
665  virtual void emit(Emitter& em) const;
666 };
667 
668 
670 public:
671  IntegerToByteInst(const DstOp &dst, const SrcOp &src, Type::TypeID type)
672  : AArch64Instruction("Aarch64IntToByteInst", dst.op, type, 1) {
673  operands[0].op = src.op;
674  }
675 
676  virtual void emit(Emitter& em) const;
677 };
678 
679 
681 public:
682  IntToCharInst(const DstOp &dst, const SrcOp &src)
683  : AArch64Instruction("Aarch64IntToCharInst", dst.op,
684  Type::IntTypeID, 1) {
685  operands[0].op = src.op;
686  }
687 
688  virtual void emit(Emitter& em) const;
689 };
690 
691 
693 public:
694  IntegerToShortInst(const DstOp &dst, const SrcOp &src, Type::TypeID type)
695  : AArch64Instruction("Aarch64IntToShortInst", dst.op, type, 1) {
696  operands[0].op = src.op;
697  }
698 
699  virtual void emit(Emitter& em) const;
700 };
701 
702 
704 private:
706 public:
708  : MachineInstruction("Aarch64PatchInst", &NoOperand, 0),
709  patcher(patcher) {}
710 
711  virtual void emit(CodeMemory* cm) const;
712  virtual void link(CodeFragment &cf) const;
713 };
714 
715 
716 class CallInst : public AArch64Instruction {
717 public:
718  CallInst(const SrcOp &src, const DstOp &dst, std::size_t argc)
719  : AArch64Instruction("Aarch64CallInst", dst.op, Type::LongTypeID,
720  1 + argc) {
721  operands[0].op = src.op;
722  }
723 
724  virtual void emit(Emitter& em) const;
725  virtual bool is_call() const { return true; }
726 };
727 
728 
729 class TrapInst : public AArch64Instruction {
730 private:
731  /// A trap number as defined in aarch64/md-trap.hpp
733 
734 public:
736  : AArch64Instruction("Aarch64TrapInst", &NoOperand,
737  Type::ReferenceTypeID, 1), trap(trap) {
738  operands[0].op = index.op;
739  }
740 
741  virtual bool is_end() const { return true; }
742  virtual void emit(Emitter& em) const;
743 };
744 
746 private:
747  /// A trap number as defined in aarch64/md-trap.hpp
750 public:
752  : AArch64Instruction("Aarch64CondTrapInst", &NoOperand,
753  Type::ReferenceTypeID, 1), trap(trap), cond(cond) {
754  operands[0].op = index.op;
755  }
756 
757  virtual bool is_end() const { return true; }
758  virtual void emit(Emitter& em) const;
759 };
760 
761 } // end namespace aarch64
762 } // end namespace compiler2
763 } // end namespace jit
764 } // end namespace cacao
765 
766 
767 #endif /* _JIT_COMPILER2_AARCH64_INSTRUCTIONS */
768 
769 
770 /*
771  * These are local overrides for various environment variables in Emacs.
772  * Please do not remove this and leave it at the end of the file, where
773  * Emacs will automagically detect them.
774  * ---------------------------------------------------------------------
775  * Local variables:
776  * mode: c++
777  * indent-tabs-mode: t
778  * c-basic-offset: 4
779  * tab-width: 4
780  * End:
781  * vim:noexpandtab:sw=4:ts=4:
782  */
virtual void emit(Emitter &em) const
std::size_t index
virtual void emit(Emitter &em) const
IntegerToShortInst(const DstOp &dst, const SrcOp &src, Type::TypeID type)
virtual void emit(CodeMemory *cm) const
emit machine code
AddInst(const DstOp &dst, const SrcOp &src1, const SrcOp &src2, Type::TypeID type, Shift::SHIFT shift=Shift::LSL, u1 amount=0)
virtual void emit(CodeMemory *cm) const
emit machine code
Reg fromOp(MachineOperand *op, Type::TypeID type) const
FMulInst(const DstOp &dst, const SrcOp &src1, const SrcOp &src2, Type::TypeID type)
virtual void emit(Emitter &em) const
virtual void emit(Emitter &em) const
virtual ManagedStackSlot * to_ManagedStackSlot()
virtual Reg regFromType(u1 reg, Type::TypeID type) const
virtual void link(CodeFragment &cf) const
link machine code
virtual void emit(CodeMemory *cm) const
emit machine code
virtual void emit(Emitter &em) const
MovInst(const DstOp &dst, const SrcOp &src, Type::TypeID type)
s4 trap
A trap number as defined in aarch64/md-trap.hpp.
u2 op
Definition: disass.cpp:129
A basic block of (scheduled) machine instructions.
virtual void emit(CodeMemory *cm) const
emit machine code
RetInst(const SrcOp &src)
Non-void return.
virtual Reg regFromType(u1 reg, Type::TypeID type) const
virtual void link(CodeFragment &cf) const
link machine code
uint8_t u1
Definition: types.hpp:40
virtual void emit(Emitter &em) const
IntegerToByteInst(const DstOp &dst, const SrcOp &src, Type::TypeID type)
virtual void link(CodeFragment &CF) const
link machine code
DsegAddrInst(const DstOp &dst, DataSegment::IdxTy &data_index, Type::TypeID type)
CondTrapInst(Cond::COND cond, s4 trap, const SrcOp &index)
virtual void emit(Emitter &em) const
JNIEnv jclass jobject const char * name
Definition: jvmti.h:312
MovImmInst(const DstOp &dst, const SrcOp &src, Type::TypeID type)
virtual void emit(Emitter &em) const
IntToCharInst(const DstOp &dst, const SrcOp &src)
MulSubInst(const DstOp &dst, const SrcOp &src1, const SrcOp &src2, const SrcOp &src3, Type::TypeID type)
StoreInst(const SrcOp &src, const BaseOp &base, const IdxOp &offset, Type::TypeID type)
virtual void emit(Emitter &em) const
FcvtInst(const DstOp &dst, const SrcOp &src, Type::TypeID toType, Type::TypeID fromType)
CmpInst(const SrcOp &src1, const SrcOp &src2, Type::TypeID type)
virtual Reg regFromType(u1 reg, Type::TypeID type) const
MachineBasicBlock * successor_front() const
virtual void emit(Emitter &em) const
Aarch64Register * cast_to< Aarch64Register >(MachineOperand *op)
IntToLongInst(const DstOp &dst, const SrcOp &src)
FCmpInst(const SrcOp &src1, const SrcOp &src2, Type::TypeID type)
virtual void emit(Emitter &em) const
virtual void emit(Emitter &em) const
AndInst(const DstOp &dst, const SrcOp &src1, const SrcOp &src2, Type::TypeID type, Shift::SHIFT shift=Shift::LSL, u1 amount=0)
AArch64Instruction(const char *name, MachineOperand *result, Type::TypeID type, std::size_t num_operands)
LoadInst(const DstOp &dst, const BaseOp &base, const IdxOp &offset, Type::TypeID type)
Immediate * cast_to< Immediate >(MachineOperand *op)
virtual void emit(Emitter &em) const
uint16_t u2
Definition: types.hpp:43
A &quot;virtual&quot; slot that will eventually be mapped to a machine-level slot.
virtual void emit(CodeMemory *cm) const
emit machine code
FSubInst(const DstOp &dst, const SrcOp &src1, const SrcOp &src2, Type::TypeID type)
virtual void emit(Emitter &em) const
FMovInst(const DstOp &dst, const SrcOp &src, Type::TypeID type)
FNegInst(const DstOp &dst, const SrcOp &src, Type::TypeID type)
int32_t s4
Definition: types.hpp:45
virtual void emit(Emitter &em) const
IntToFpInst(const DstOp &dst, const SrcOp &src, Type::TypeID toType, Type::TypeID fromType)
LoadInst(const DstOp &dst, const SrcOp &src, Type::TypeID type)
void set_target(MachineBasicBlock *target)
virtual void emit(Emitter &em) const
virtual void emit(CodeMemory *cm) const
emit machine code
virtual void link(CodeFragment &cf) const
link machine code
virtual void emit(Emitter &em) const
virtual void emit(CodeMemory *cm) const
emit machine code
virtual void emit(Emitter &em) const
Proxy to encode explicit and implicit successors.
CallInst(const SrcOp &src, const DstOp &dst, std::size_t argc)
virtual void emit(Emitter &em) const
FDivInst(const DstOp &dst, const SrcOp &src1, const SrcOp &src2, Type::TypeID type)
StoreInst(const SrcOp &src, const DstOp &dst, Type::TypeID type)
Operands that can be directly used by the machine (register, memory, stackslot)
s4 trap
A trap number as defined in aarch64/md-trap.hpp.
virtual void emit(Emitter &em) const
CSelInst(const DstOp &dst, const SrcOp &src1, const SrcOp &src2, Type::TypeID type, Cond::COND cond)
Segment reference.
Definition: Segment.hpp:44
DivInst(const DstOp &dst, const SrcOp &src1, const SrcOp &src2, Type::TypeID type)
MulInst(const DstOp &dst, const SrcOp &src1, const SrcOp &src2, Type::TypeID type)
BeginInst * target
virtual void emit(Emitter &em) const
virtual void emit(CodeMemory *cm) const
emit machine code
#define ABORT_MSG(EXPR_SHORT, EXPR_LONG)
Definition: logging.hpp:133
FAddInst(const DstOp &dst, const SrcOp &src1, const SrcOp &src2, Type::TypeID type)
NegInst(const DstOp &dst, const SrcOp &src, Type::TypeID type)
SubInst(const DstOp &dst, const SrcOp &src1, const SrcOp &src2, Type::TypeID type)
Patcher super class.
Definition: PatcherNew.hpp:49
CondJumpInst(Cond::COND cond, MachineBasicBlock *then_target, MachineBasicBlock *else_target)
LongToIntInst(const DstOp &dst, const SrcOp &src)