CACAO
emit-common.cpp
Go to the documentation of this file.
1 /* src/vm/jit/emit-common.cpp - common code emitter functions
2 
3  Copyright (C) 2006-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 #include "vm/jit/emit-common.hpp"
26 #include "config.h"
27 #include <algorithm>
28 #include <cassert> // for assert
29 #include <stdint.h> // for int32_t, uint32_t
30 #include <list> // for _List_iterator, etc
31 #include "arch.hpp"
32 #include "codegen.hpp"
33 #include "codegen-common.hpp" // for codegendata, etc
34 #include "toolbox/list.hpp" // for DumpList, LockedList, List
35 #include "vm/jit/code.hpp" // for codeinfo
36 #include "vm/jit/ir/instruction.hpp" // for instruction, etc
37 #include "vm/jit/jit.hpp" // for basicblock, jitdata
38 #include "vm/jit/patcher-common.hpp" // for patchref_t
39 #include "vm/options.hpp"
40 #include "vm/statistics.hpp"
41 #include "vm/types.hpp" // for s4, u1, u4
42 
43 struct varinfo;
44 
45 STAT_REGISTER_VAR(int,count_branches_resolved,0,"resolved branches","resolved branches")
46 
47 STAT_REGISTER_VAR_EXTERN(int,count_mov_reg_reg,0,"count_mov_reg_reg","Moves reg -> reg")
48 STAT_REGISTER_VAR_EXTERN(int,count_mov_mem_reg,0,"count_mov_mem_reg","Moves mem -> reg")
49 STAT_REGISTER_VAR_EXTERN(int,count_mov_reg_mem,0,"count_mov_reg_mem","Moves reg -> mem")
50 //STAT_REGISTER_VAR_EXTERN(int,count_mov_mem_mem,0,"count_mov_mem_mem","Moves mem -> mem")
51 
52 STAT_REGISTER_SUM_GROUP(emit_branch_stat,"emit branch","Number of branch_emit (total)")
53 STAT_REGISTER_GROUP_VAR(int,count_emit_branch_8bit,0,"emit branch 8bit","Number of branch_emit ( 8bit offset)",emit_branch_stat)
54 STAT_REGISTER_GROUP_VAR(int,count_emit_branch_16bit,0,"emit branch 16bit","Number of branch_emit (16bit offset)",emit_branch_stat)
55 STAT_REGISTER_GROUP_VAR(int,count_emit_branch_32bit,0,"emit branch 32bit","Number of branch_emit (32bit offset)",emit_branch_stat)
56 STAT_REGISTER_GROUP_VAR(int,count_emit_branch_64bit,0,"emit branch 64bit","Number of branch_emit (64bit offset)",emit_branch_stat)
57 /* emit_load_s1 ****************************************************************
58 
59  Emits a possible load of the first source operand.
60 
61 *******************************************************************************/
62 
63 s4 emit_load_s1(jitdata *jd, instruction *iptr, s4 tempreg)
64 {
65  varinfo *src;
66  s4 reg;
67 
68  src = VAROP(iptr->s1);
69 
70  reg = emit_load(jd, iptr, src, tempreg);
71 
72  return reg;
73 }
74 
75 
76 /* emit_load_s2 ****************************************************************
77 
78  Emits a possible load of the second source operand.
79 
80 *******************************************************************************/
81 
82 s4 emit_load_s2(jitdata *jd, instruction *iptr, s4 tempreg)
83 {
84  varinfo *src;
85  s4 reg;
86 
87  src = VAROP(iptr->sx.s23.s2);
88 
89  reg = emit_load(jd, iptr, src, tempreg);
90 
91  return reg;
92 }
93 
94 
95 /* emit_load_s3 ****************************************************************
96 
97  Emits a possible load of the third source operand.
98 
99 *******************************************************************************/
100 
101 s4 emit_load_s3(jitdata *jd, instruction *iptr, s4 tempreg)
102 {
103  varinfo *src;
104  s4 reg;
105 
106  src = VAROP(iptr->sx.s23.s3);
107 
108  reg = emit_load(jd, iptr, src, tempreg);
109 
110  return reg;
111 }
112 
113 
114 /* emit_load_s1_low ************************************************************
115 
116  Emits a possible load of the low 32-bits of the first long source
117  operand.
118 
119 *******************************************************************************/
120 
121 #if SIZEOF_VOID_P == 4
122 s4 emit_load_s1_low(jitdata *jd, instruction *iptr, s4 tempreg)
123 {
124  varinfo *src;
125  s4 reg;
126 
127  src = VAROP(iptr->s1);
128 
129  reg = emit_load_low(jd, iptr, src, tempreg);
130 
131  return reg;
132 }
133 #endif
134 
135 
136 /* emit_load_s2_low ************************************************************
137 
138  Emits a possible load of the low 32-bits of the second long source
139  operand.
140 
141 *******************************************************************************/
142 
143 #if SIZEOF_VOID_P == 4
144 s4 emit_load_s2_low(jitdata *jd, instruction *iptr, s4 tempreg)
145 {
146  varinfo *src;
147  s4 reg;
148 
149  src = VAROP(iptr->sx.s23.s2);
150 
151  reg = emit_load_low(jd, iptr, src, tempreg);
152 
153  return reg;
154 }
155 #endif
156 
157 
158 /* emit_load_s3_low ************************************************************
159 
160  Emits a possible load of the low 32-bits of the third long source
161  operand.
162 
163 *******************************************************************************/
164 
165 #if SIZEOF_VOID_P == 4
166 s4 emit_load_s3_low(jitdata *jd, instruction *iptr, s4 tempreg)
167 {
168  varinfo *src;
169  s4 reg;
170 
171  src = VAROP(iptr->sx.s23.s3);
172 
173  reg = emit_load_low(jd, iptr, src, tempreg);
174 
175  return reg;
176 }
177 #endif
178 
179 
180 /* emit_load_s1_high ***********************************************************
181 
182  Emits a possible load of the high 32-bits of the first long source
183  operand.
184 
185 *******************************************************************************/
186 
187 #if SIZEOF_VOID_P == 4
188 s4 emit_load_s1_high(jitdata *jd, instruction *iptr, s4 tempreg)
189 {
190  varinfo *src;
191  s4 reg;
192 
193  src = VAROP(iptr->s1);
194 
195  reg = emit_load_high(jd, iptr, src, tempreg);
196 
197  return reg;
198 }
199 #endif
200 
201 
202 /* emit_load_s2_high ***********************************************************
203 
204  Emits a possible load of the high 32-bits of the second long source
205  operand.
206 
207 *******************************************************************************/
208 
209 #if SIZEOF_VOID_P == 4
210 s4 emit_load_s2_high(jitdata *jd, instruction *iptr, s4 tempreg)
211 {
212  varinfo *src;
213  s4 reg;
214 
215  src = VAROP(iptr->sx.s23.s2);
216 
217  reg = emit_load_high(jd, iptr, src, tempreg);
218 
219  return reg;
220 }
221 #endif
222 
223 
224 /* emit_load_s3_high ***********************************************************
225 
226  Emits a possible load of the high 32-bits of the third long source
227  operand.
228 
229 *******************************************************************************/
230 
231 #if SIZEOF_VOID_P == 4
232 s4 emit_load_s3_high(jitdata *jd, instruction *iptr, s4 tempreg)
233 {
234  varinfo *src;
235  s4 reg;
236 
237  src = VAROP(iptr->sx.s23.s3);
238 
239  reg = emit_load_high(jd, iptr, src, tempreg);
240 
241  return reg;
242 }
243 #endif
244 
245 
246 /* emit_store_dst **************************************************************
247 
248  This function generates the code to store the result of an
249  operation back into a spilled pseudo-variable. If the
250  pseudo-variable has not been spilled in the first place, this
251  function will generate nothing.
252 
253 *******************************************************************************/
254 
256 {
257  emit_store(jd, iptr, VAROP(iptr->dst), d);
258 }
259 
260 
261 /* emit_patcher_traps **********************************************************
262 
263  Generates the code for the patcher traps.
264 
265 *******************************************************************************/
266 
268 {
269  codeinfo* code = jd->code;
270 
271  // Generate patcher traps code.
272  for (PatcherListTy::iterator i = code->patchers->begin(),
273  e = code->patchers->end(); i != e; ++i) {
274  PatcherPtrTy& pr = *i;
275  pr->emit();
276  }
277 }
278 
279 
280 /* emit_bccz *******************************************************************
281 
282  Emit conditional and unconditional branch instructions on integer
283  regiseters.
284 
285 *******************************************************************************/
286 
287 void emit_bccz(codegendata *cd, basicblock *target, s4 condition, s4 reg, u4 options)
288 {
289  s4 branchmpc;
290  s4 disp;
291 
292  /* Target basic block already has an PC, so we can generate the
293  branch immediately. */
294 
295  if ((target->mpc >= 0)) {
296  STATISTICS(count_branches_resolved++);
297 
298  /* calculate the mpc of the branch instruction */
299 
300  branchmpc = cd->mcodeptr - cd->mcodebase;
301  disp = target->mpc - branchmpc;
302 
303 #if defined(ENABLE_STATISTICS)
304  if ((int8_t)disp == disp) count_emit_branch_8bit++;
305  else if ((int16_t)disp == disp) count_emit_branch_16bit++;
306  else if ((int32_t)disp == disp) count_emit_branch_32bit++;
307 # if SIZEOF_VOID_P == 8
308  else if ((int64_t)disp == disp) count_emit_branch_64bit++;
309 # endif
310 #endif
311 
312  emit_branch(cd, disp, condition, reg, options);
313  }
314  else {
315  /* current mcodeptr is the correct position,
316  afterwards emit the NOPs */
317 
318  codegen_add_branch_ref(cd, target, condition, reg, options);
319 
320  /* generate NOPs as placeholder for branch code */
321 
322  BRANCH_NOPS;
323  }
324 }
325 
326 
327 /* emit_bcc ********************************************************************
328 
329  Emit conditional and unconditional branch instructions on condition
330  codes.
331 
332 *******************************************************************************/
333 
334 void emit_bcc(codegendata *cd, basicblock *target, s4 condition, u4 options)
335 {
336  emit_bccz(cd, target, condition, -1, options);
337 }
338 
339 
340 /* emit_br *********************************************************************
341 
342  Wrapper for unconditional branches.
343 
344 *******************************************************************************/
345 
347 {
349 }
350 
351 
352 /* emit_bxxz *******************************************************************
353 
354  Wrappers for branches on one integer register.
355 
356 *******************************************************************************/
357 
358 #if SUPPORT_BRANCH_CONDITIONAL_ONE_INTEGER_REGISTER
359 
360 void emit_beqz(codegendata *cd, basicblock *target, s4 reg)
361 {
362  emit_bccz(cd, target, BRANCH_EQ, reg, BRANCH_OPT_NONE);
363 }
364 
365 void emit_bnez(codegendata *cd, basicblock *target, s4 reg)
366 {
367  emit_bccz(cd, target, BRANCH_NE, reg, BRANCH_OPT_NONE);
368 }
369 
370 void emit_bltz(codegendata *cd, basicblock *target, s4 reg)
371 {
372  emit_bccz(cd, target, BRANCH_LT, reg, BRANCH_OPT_NONE);
373 }
374 
375 void emit_bgez(codegendata *cd, basicblock *target, s4 reg)
376 {
377  emit_bccz(cd, target, BRANCH_GE, reg, BRANCH_OPT_NONE);
378 }
379 
380 void emit_bgtz(codegendata *cd, basicblock *target, s4 reg)
381 {
382  emit_bccz(cd, target, BRANCH_GT, reg, BRANCH_OPT_NONE);
383 }
384 
385 void emit_blez(codegendata *cd, basicblock *target, s4 reg)
386 {
387  emit_bccz(cd, target, BRANCH_LE, reg, BRANCH_OPT_NONE);
388 }
389 
390 #endif /* SUPPORT_BRANCH_CONDITIONAL_ONE_INTEGER_REGISTER */
391 
392 
393 /* emit_bxx ********************************************************************
394 
395  Wrappers for branches on two integer registers.
396 
397  We use PACK_REGS here, so we don't have to change the branchref
398  data structure and the emit_bccz function.
399 
400 *******************************************************************************/
401 
402 #if SUPPORT_BRANCH_CONDITIONAL_TWO_INTEGER_REGISTERS
403 
404 void emit_beq(codegendata *cd, basicblock *target, s4 s1, s4 s2)
405 {
406  emit_bccz(cd, target, BRANCH_EQ, PACK_REGS(s1, s2), BRANCH_OPT_NONE);
407 }
408 
409 void emit_bne(codegendata *cd, basicblock *target, s4 s1, s4 s2)
410 {
411  emit_bccz(cd, target, BRANCH_NE, PACK_REGS(s1, s2), BRANCH_OPT_NONE);
412 }
413 
414 #endif /* SUPPORT_BRANCH_CONDITIONAL_TWO_INTEGER_REGISTERS */
415 
416 
417 /* emit_bxx ********************************************************************
418 
419  Wrappers for branches on condition codes.
420 
421 *******************************************************************************/
422 
423 #if SUPPORT_BRANCH_CONDITIONAL_CONDITION_REGISTER
424 
425 void emit_beq(codegendata *cd, basicblock *target)
426 {
427  emit_bcc(cd, target, BRANCH_EQ, BRANCH_OPT_NONE);
428 }
429 
430 void emit_bne(codegendata *cd, basicblock *target)
431 {
432  emit_bcc(cd, target, BRANCH_NE, BRANCH_OPT_NONE);
433 }
434 
435 void emit_blt(codegendata *cd, basicblock *target)
436 {
437  emit_bcc(cd, target, BRANCH_LT, BRANCH_OPT_NONE);
438 }
439 
440 void emit_bge(codegendata *cd, basicblock *target)
441 {
442  emit_bcc(cd, target, BRANCH_GE, BRANCH_OPT_NONE);
443 }
444 
445 void emit_bgt(codegendata *cd, basicblock *target)
446 {
447  emit_bcc(cd, target, BRANCH_GT, BRANCH_OPT_NONE);
448 }
449 
450 void emit_ble(codegendata *cd, basicblock *target)
451 {
452  emit_bcc(cd, target, BRANCH_LE, BRANCH_OPT_NONE);
453 }
454 
455 #if SUPPORT_BRANCH_CONDITIONAL_UNSIGNED_CONDITIONS
456 void emit_bult(codegendata *cd, basicblock *target)
457 {
458  emit_bcc(cd, target, BRANCH_ULT, BRANCH_OPT_NONE);
459 }
460 
461 void emit_bule(codegendata *cd, basicblock *target)
462 {
463  emit_bcc(cd, target, BRANCH_ULE, BRANCH_OPT_NONE);
464 }
465 
466 void emit_buge(codegendata *cd, basicblock *target)
467 {
468  emit_bcc(cd, target, BRANCH_UGE, BRANCH_OPT_NONE);
469 }
470 
471 void emit_bugt(codegendata *cd, basicblock *target)
472 {
473  emit_bcc(cd, target, BRANCH_UGT, BRANCH_OPT_NONE);
474 }
475 #endif
476 
477 #if defined(__POWERPC__) || defined(__POWERPC64__)
478 void emit_bnan(codegendata *cd, basicblock *target)
479 {
480  emit_bcc(cd, target, BRANCH_NAN, BRANCH_OPT_NONE);
481 }
482 #endif
483 
484 #endif /* SUPPORT_BRANCH_CONDITIONAL_CONDITION_REGISTER */
485 
486 
487 /* emit_label_bccz *************************************************************
488 
489  Emit a branch to a label. Possibly emit the branch, if it is a
490  backward branch.
491 
492 *******************************************************************************/
493 
494 void emit_label_bccz(codegendata *cd, s4 label, s4 condition, s4 reg, u4 options)
495 {
496  // Search if the label is already in the list.
498  for (it = cd->brancheslabel->begin(); it != cd->brancheslabel->end(); it++) {
499  branch_label_ref_t* br = *it;
500 
501  /* is this entry the correct label? */
502 
503  if (br->label == label)
504  break;
505  }
506 
507  if (it == cd->brancheslabel->end()) {
508  /* current mcodeptr is the correct position,
509  afterwards emit the NOPs */
510 
511  codegen_branch_label_add(cd, label, condition, reg, options);
512 
513  /* generate NOPs as placeholder for branch code */
514 
515  BRANCH_NOPS;
516  return;
517  }
518 
519  // Branch reference was found.
520  branch_label_ref_t* br = *it;
521 
522  /* calculate the mpc of the branch instruction */
523 
524  int32_t mpc = cd->mcodeptr - cd->mcodebase;
525  int32_t disp = br->mpc - mpc;
526 
527 #if defined(ENABLE_STATISTICS)
528  if ((int8_t)disp == disp) count_emit_branch_8bit++;
529  else if ((int16_t)disp == disp) count_emit_branch_16bit++;
530  else if ((int32_t)disp == disp) count_emit_branch_32bit++;
531 # if SIZEOF_VOID_P == 8
532  else if ((int64_t)disp == disp) count_emit_branch_64bit++;
533 # endif
534 #endif
535 
536  emit_branch(cd, disp, condition, reg, options);
537 
538  // Now remove the branch reference.
539  cd->brancheslabel->remove(br);
540 }
541 
542 
543 /* emit_label ******************************************************************
544 
545  Emit a label for a branch. Possibly emit the branch, if it is a
546  forward branch.
547 
548 *******************************************************************************/
549 
550 void emit_label(codegendata *cd, s4 label)
551 {
552  u1* mcodeptr;
553 
554  // Search if the label is already in the list.
556  for (it = cd->brancheslabel->begin(); it != cd->brancheslabel->end(); it++) {
557  branch_label_ref_t* br = *it;
558 
559  /* is this entry the correct label? */
560 
561  if (br->label == label)
562  break;
563  }
564 
565  if (it == cd->brancheslabel->end()) {
566  /* No branch reference found, add the label to the list (use
567  invalid values for condition and register). */
568 
569  codegen_branch_label_add(cd, label, -1, -1, BRANCH_OPT_NONE );
570  return;
571  }
572 
573  // Branch reference was found.
574  branch_label_ref_t* br = *it;
575 
576  // Calculate the mpc of the branch instruction.
577  int32_t mpc = cd->mcodeptr - cd->mcodebase;
578  int32_t disp = mpc - br->mpc;
579 
580  /* temporary set the mcodeptr */
581 
582  mcodeptr = cd->mcodeptr;
583  cd->mcodeptr = cd->mcodebase + br->mpc;
584 
585 #if defined(ENABLE_STATISTICS)
586  if ((int8_t)disp == disp) count_emit_branch_8bit++;
587  else if ((int16_t)disp == disp) count_emit_branch_16bit++;
588  else if ((int32_t)disp == disp) count_emit_branch_32bit++;
589 # if SIZEOF_VOID_P == 8
590  else if ((int64_t)disp == disp) count_emit_branch_64bit++;
591 # endif
592 #endif
593 
594  emit_branch(cd, disp, br->condition, br->reg, br->options);
595 
596  /* restore mcodeptr */
597 
598  cd->mcodeptr = mcodeptr;
599 
600  // Now remove the branch reference.
601  cd->brancheslabel->remove(br);
602 }
603 
604 
605 /* emit_label_bcc **************************************************************
606 
607  Emit conditional and unconditional label-branch instructions on
608  condition codes.
609 
610 *******************************************************************************/
611 
612 void emit_label_bcc(codegendata *cd, s4 label, s4 condition, u4 options)
613 {
614  emit_label_bccz(cd, label, condition, -1, options);
615 }
616 
617 
618 /* emit_label_br ***************************************************************
619 
620  Wrapper for unconditional label-branches.
621 
622 *******************************************************************************/
623 
624 void emit_label_br(codegendata *cd, s4 label)
625 {
627 }
628 
629 
630 /* emit_label_bxxz *************************************************************
631 
632  Wrappers for label-branches on one integer register.
633 
634 *******************************************************************************/
635 
636 #if SUPPORT_BRANCH_CONDITIONAL_ONE_INTEGER_REGISTER
637 
638 void emit_label_beqz(codegendata* cd, int label, int reg)
639 {
640  emit_label_bccz(cd, label, BRANCH_EQ, reg, BRANCH_OPT_NONE);
641 }
642 
643 void emit_label_bnez(codegendata* cd, int label, int reg)
644 {
645  emit_label_bccz(cd, label, BRANCH_NE, reg, BRANCH_OPT_NONE);
646 }
647 
648 void emit_label_bltz(codegendata* cd, int label, int reg)
649 {
650  emit_label_bccz(cd, label, BRANCH_LT, reg, BRANCH_OPT_NONE);
651 }
652 
653 void emit_label_bgtz(codegendata* cd, int label, int reg)
654 {
655  emit_label_bccz(cd, label, BRANCH_GT, reg, BRANCH_OPT_NONE);
656 }
657 
658 #endif /* SUPPORT_BRANCH_CONDITIONAL_ONE_INTEGER_REGISTER */
659 
660 
661 /* emit_label_bxx **************************************************************
662 
663  Wrappers for label-branches on two integer registers.
664 
665  We use PACK_REGS here, so we don't have to change the branchref
666  data structure and the emit_bccz function.
667 
668 *******************************************************************************/
669 
670 #if SUPPORT_BRANCH_CONDITIONAL_TWO_INTEGER_REGISTERS
671 
672 void emit_label_beq(codegendata* cd, int label, int s1, int s2)
673 {
674  emit_label_bccz(cd, label, BRANCH_EQ, PACK_REGS(s1, s2), BRANCH_OPT_NONE);
675 }
676 
677 void emit_label_bne(codegendata* cd, int label, int s1, int s2)
678 {
679  emit_label_bccz(cd, label, BRANCH_NE, PACK_REGS(s1, s2), BRANCH_OPT_NONE);
680 }
681 
682 #endif /* SUPPORT_BRANCH_CONDITIONAL_TWO_INTEGER_REGISTERS */
683 
684 
685 /* emit_label_bxx **************************************************************
686 
687  Wrappers for label-branches on condition codes.
688 
689 *******************************************************************************/
690 
691 #if SUPPORT_BRANCH_CONDITIONAL_CONDITION_REGISTER
692 
693 void emit_label_beq(codegendata *cd, s4 label)
694 {
696 }
697 
698 void emit_label_bne(codegendata *cd, s4 label)
699 {
701 }
702 
703 void emit_label_blt(codegendata *cd, s4 label)
704 {
706 }
707 
708 void emit_label_bge(codegendata *cd, s4 label)
709 {
711 }
712 
713 void emit_label_bgt(codegendata *cd, s4 label)
714 {
716 }
717 
718 void emit_label_ble(codegendata *cd, s4 label)
719 {
721 }
722 
723 #endif /* SUPPORT_BRANCH_CONDITIONAL_CONDITION_REGISTER */
724 
725 
726 /*
727  * These are local overrides for various environment variables in Emacs.
728  * Please do not remove this and leave it at the end of the file, where
729  * Emacs will automagically detect them.
730  * ---------------------------------------------------------------------
731  * Local variables:
732  * mode: c++
733  * indent-tabs-mode: t
734  * c-basic-offset: 4
735  * tab-width: 4
736  * End:
737  * vim:noexpandtab:sw=4:ts=4:
738  */
s4 emit_load_s3(jitdata *jd, instruction *iptr, s4 tempreg)
s4 emit_load_s1(jitdata *jd, instruction *iptr, s4 tempreg)
Definition: emit-common.cpp:63
#define STATISTICS(x)
Wrapper for statistics only code.
Definition: statistics.hpp:975
#define BRANCH_OPT_NONE
Definition: jit.hpp:126
#define BRANCH_LE
#define BRANCH_NE
#define BRANCH_GT
#define BRANCH_EQ
codeinfo * code
Definition: jit.hpp:128
void emit_bcc(codegendata *cd, basicblock *target, s4 condition, u4 options)
#define BRANCH_UNCONDITIONAL
s4 mpc
Definition: jit.hpp:345
#define BRANCH_NOPS
Definition: codegen.hpp:60
void emit_label_bcc(codegendata *cd, s4 label, s4 condition, u4 options)
uint8_t u1
Definition: types.hpp:40
Definition: reg.hpp:43
void emit_patcher_traps(jitdata *jd)
s4 emit_load_high(jitdata *jd, instruction *iptr, varinfo *src, s4 tempreg)
Definition: emit.cpp:174
dst_operand_t dst
void emit_label_br(codegendata *cd, s4 label)
This file contains the statistics framework.
s4 emit_load_s2(jitdata *jd, instruction *iptr, s4 tempreg)
Definition: emit-common.cpp:82
#define STAT_REGISTER_GROUP_VAR(type, var, init, name, description, group)
Register an statistics variable and add it to a group.
Definition: statistics.hpp:967
#define BRANCH_GE
#define STAT_REGISTER_SUM_GROUP(var, name, description)
Register a statistics summary group.
Definition: statistics.hpp:972
#define BRANCH_UGE
MIIterator i
s4 emit_load(jitdata *jd, instruction *iptr, varinfo *src, s4 tempreg)
Definition: emit.cpp:66
#define BRANCH_UGT
int32_t s4
Definition: types.hpp:45
void emit_store(jitdata *jd, instruction *iptr, varinfo *dst, s4 d)
Definition: emit.cpp:113
DumpList< branch_label_ref_t * > * brancheslabel
cacao::shared_ptr< cacao::Patcher > PatcherPtrTy
Definition: code.hpp:60
void codegen_branch_label_add(codegendata *cd, s4 label, s4 condition, s4 reg, u4 options)
union instruction::@12 sx
#define BRANCH_NAN
#define PACK_REGS(low, high)
MIIterator e
void emit_store_dst(jitdata *jd, instruction *iptr, s4 d)
s1_operand_t s1
uint32_t u4
Definition: types.hpp:46
#define BRANCH_LT
#define VAROP(v)
Definition: jit.hpp:251
void emit_label_bccz(codegendata *cd, s4 label, s4 condition, s4 reg, u4 options)
PatcherListTy * patchers
Definition: code.hpp:98
s4 emit_load_low(jitdata *jd, instruction *iptr, varinfo *src, s4 tempreg)
Definition: emit.cpp:136
void codegen_add_branch_ref(codegendata *cd, basicblock *target, s4 condition, s4 reg, u4 options)
void emit_branch(codegendata *cd, s4 disp, s4 condition, s4 reg, u4 opt)
Definition: emit.cpp:263
int8_t s1
Definition: types.hpp:39
int16_t s2
Definition: types.hpp:42
List implementation with dump memory.
Definition: list.hpp:80
struct instruction::@12::@13 s23
#define BRANCH_ULE
#define BRANCH_ULT
BeginInst * target
void emit_label(codegendata *cd, s4 label)
void emit_bccz(codegendata *cd, basicblock *target, s4 condition, s4 reg, u4 options)
#define STAT_REGISTER_VAR_EXTERN(type, var, init, name, description)
Register an external statistics variable.
Definition: statistics.hpp:964
#define STAT_REGISTER_VAR(type, var, init, name, description)
Register an external statistics variable.
Definition: statistics.hpp:966
void emit_br(codegendata *cd, basicblock *target)
double d
Definition: reg.hpp:51