1 /* src/vm/jit/powerpc/emit.c - PowerPC code emitter functions
3 Copyright (C) 1996-2005, 2006 R. Grafl, A. Krall, C. Kruegel,
4 C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
5 E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
6 J. Wenninger, Institut f. Computersprachen - TU Wien
8 This file is part of CACAO.
10 This program is free software; you can redistribute it and/or
11 modify it under the terms of the GNU General Public License as
12 published by the Free Software Foundation; either version 2, or (at
13 your option) any later version.
15 This program is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
25 Contact: cacao@cacaojvm.org
27 Authors: Christian Thalinger
31 $Id: emitfuncs.c 4398 2006-01-31 23:43:08Z twisti $
44 #include "vm/jit/powerpc/codegen.h"
46 #include "vm/builtin.h"
47 #include "vm/jit/asmpart.h"
48 #include "vm/jit/dseg.h"
49 #include "vm/jit/emit.h"
50 #include "vm/jit/jit.h"
51 #include "vm/jit/replace.h"
54 /* emit_load *******************************************************************
56 Emits a possible load of an operand.
58 *******************************************************************************/
60 s4 emit_load(jitdata *jd, instruction *iptr, stackptr src, s4 tempreg)
66 /* get required compiler data */
70 if (src->flags & INMEMORY) {
73 disp = src->regoff * 4;
75 if (IS_FLT_DBL_TYPE(src->type)) {
76 if (IS_2_WORD_TYPE(src->type))
77 M_DLD(tempreg, REG_SP, disp);
79 M_FLD(tempreg, REG_SP, disp);
82 if (IS_2_WORD_TYPE(src->type))
83 M_LLD(tempreg, REG_SP, disp);
85 M_ILD(tempreg, REG_SP, disp);
97 /* emit_load_low ***************************************************************
99 Emits a possible load of the low 32-bits of an operand.
101 *******************************************************************************/
103 s4 emit_load_low(jitdata *jd, instruction *iptr, stackptr src, s4 tempreg)
109 assert(src->type == TYPE_LNG);
111 /* get required compiler data */
115 if (src->flags & INMEMORY) {
118 disp = src->regoff * 4;
120 M_ILD(tempreg, REG_SP, disp + 4);
125 reg = GET_LOW_REG(src->regoff);
131 /* emit_load_high **************************************************************
133 Emits a possible load of the high 32-bits of an operand.
135 *******************************************************************************/
137 s4 emit_load_high(jitdata *jd, instruction *iptr, stackptr src, s4 tempreg)
143 assert(src->type == TYPE_LNG);
145 /* get required compiler data */
149 if (src->flags & INMEMORY) {
152 disp = src->regoff * 4;
154 M_ILD(tempreg, REG_SP, disp);
159 reg = GET_HIGH_REG(src->regoff);
165 /* emit_load_s1 ****************************************************************
167 Emits a possible load of the first source operand.
169 *******************************************************************************/
171 s4 emit_load_s1(jitdata *jd, instruction *iptr, s4 tempreg)
178 reg = emit_load(jd, iptr, src, tempreg);
184 /* emit_load_s2 ****************************************************************
186 Emits a possible load of the second source operand.
188 *******************************************************************************/
190 s4 emit_load_s2(jitdata *jd, instruction *iptr, s4 tempreg)
195 src = iptr->sx.s23.s2.var;
197 reg = emit_load(jd, iptr, src, tempreg);
203 /* emit_load_s3 ****************************************************************
205 Emits a possible load of the third source operand.
207 *******************************************************************************/
209 s4 emit_load_s3(jitdata *jd, instruction *iptr, s4 tempreg)
214 src = iptr->sx.s23.s3.var;
216 reg = emit_load(jd, iptr, src, tempreg);
222 /* emit_load_s1_low ************************************************************
224 Emits a possible load of the low 32-bits of the first long source
227 *******************************************************************************/
229 s4 emit_load_s1_low(jitdata *jd, instruction *iptr, s4 tempreg)
236 reg = emit_load_low(jd, iptr, src, tempreg);
242 /* emit_load_s2_low ************************************************************
244 Emits a possible load of the low 32-bits of the second long source
247 *******************************************************************************/
249 s4 emit_load_s2_low(jitdata *jd, instruction *iptr, s4 tempreg)
254 src = iptr->sx.s23.s2.var;
256 reg = emit_load_low(jd, iptr, src, tempreg);
262 /* emit_load_s3_low ************************************************************
264 Emits a possible load of the low 32-bits of the third long source
267 *******************************************************************************/
269 s4 emit_load_s3_low(jitdata *jd, instruction *iptr, s4 tempreg)
274 src = iptr->sx.s23.s3.var;
276 reg = emit_load_low(jd, iptr, src, tempreg);
282 /* emit_load_s1_high ***********************************************************
284 Emits a possible load of the high 32-bits of the first long source
287 *******************************************************************************/
289 s4 emit_load_s1_high(jitdata *jd, instruction *iptr, s4 tempreg)
296 reg = emit_load_high(jd, iptr, src, tempreg);
302 /* emit_load_s2_high ***********************************************************
304 Emits a possible load of the high 32-bits of the second long source
307 *******************************************************************************/
309 s4 emit_load_s2_high(jitdata *jd, instruction *iptr, s4 tempreg)
314 src = iptr->sx.s23.s2.var;
316 reg = emit_load_high(jd, iptr, src, tempreg);
322 /* emit_load_s3_high ***********************************************************
324 Emits a possible load of the high 32-bits of the third long source
327 *******************************************************************************/
329 s4 emit_load_s3_high(jitdata *jd, instruction *iptr, s4 tempreg)
334 src = iptr->sx.s23.s3.var;
336 reg = emit_load_high(jd, iptr, src, tempreg);
342 /* emit_store ******************************************************************
346 *******************************************************************************/
348 void emit_store(jitdata *jd, instruction *iptr, stackptr dst, s4 d)
352 /* get required compiler data */
356 if (dst->flags & INMEMORY) {
359 if (IS_FLT_DBL_TYPE(dst->type)) {
360 if (IS_2_WORD_TYPE(dst->type))
361 M_DST(d, REG_SP, dst->regoff * 4);
363 M_FST(d, REG_SP, dst->regoff * 4);
366 if (IS_2_WORD_TYPE(dst->type))
367 M_LST(d, REG_SP, dst->regoff * 4);
369 M_IST(d, REG_SP, dst->regoff * 4);
375 /* emit_store_dst **************************************************************
377 This function generates the code to store the result of an
378 operation back into a spilled pseudo-variable. If the
379 pseudo-variable has not been spilled in the first place, this
380 function will generate nothing.
382 *******************************************************************************/
384 void emit_store_dst(jitdata *jd, instruction *iptr, s4 d)
386 emit_store(jd, iptr, iptr->dst.var, d);
390 /* emit_copy *******************************************************************
392 Generates a register/memory to register/memory copy.
394 *******************************************************************************/
396 void emit_copy(jitdata *jd, instruction *iptr, stackptr src, stackptr dst)
402 /* get required compiler data */
407 if ((src->regoff != dst->regoff) ||
408 ((src->flags ^ dst->flags) & INMEMORY)) {
410 /* If one of the variables resides in memory, we can eliminate
411 the register move from/to the temporary register with the
412 order of getting the destination register and the load. */
414 if (IS_INMEMORY(src->flags)) {
415 if (IS_LNG_TYPE(src->type))
416 d = codegen_reg_of_var(rd, iptr->opc, dst, REG_ITMP12_PACKED);
418 d = codegen_reg_of_var(rd, iptr->opc, dst, REG_IFTMP);
420 s1 = emit_load(jd, iptr, src, d);
423 if (IS_LNG_TYPE(src->type))
424 s1 = emit_load(jd, iptr, src, REG_ITMP12_PACKED);
426 s1 = emit_load(jd, iptr, src, REG_IFTMP);
428 d = codegen_reg_of_var(rd, iptr->opc, dst, s1);
432 if (IS_FLT_DBL_TYPE(src->type))
435 if (IS_2_WORD_TYPE(src->type)) {
436 M_MOV(GET_LOW_REG(s1), GET_LOW_REG(d));
437 M_MOV(GET_HIGH_REG(s1), GET_HIGH_REG(d));
444 emit_store(jd, iptr, dst, d);
449 /* emit_iconst *****************************************************************
453 *******************************************************************************/
455 void emit_iconst(codegendata *cd, s4 d, s4 value)
459 if ((value >= -32768) && (value <= 32767))
460 M_LDA_INTERN(d, REG_ZERO, value);
462 disp = dseg_add_s4(cd, value);
463 M_ILD(d, REG_PV, disp);
468 /* emit_exception_stubs ********************************************************
470 Generates the code for the exception stubs.
472 *******************************************************************************/
474 void emit_exception_stubs(jitdata *jd)
482 /* get required compiler data */
487 /* generate exception stubs */
491 for (eref = cd->exceptionrefs; eref != NULL; eref = eref->next) {
492 gen_resolvebranch(cd->mcodebase + eref->branchpos,
493 eref->branchpos, cd->mcodeptr - cd->mcodebase);
497 /* Move the value register to a temporary register, if
498 there is the need for it. */
501 M_MOV(eref->reg, REG_ITMP1);
503 /* calcuate exception address */
505 M_LDA(REG_ITMP2_XPC, REG_PV, eref->branchpos - 4);
507 /* move function to call into REG_ITMP3 */
509 disp = dseg_add_functionptr(cd, eref->function);
510 M_ALD(REG_ITMP3, REG_PV, disp);
512 if (targetdisp == 0) {
513 targetdisp = ((u4 *) cd->mcodeptr) - ((u4 *) cd->mcodebase);
515 if (jd->isleafmethod) {
517 M_AST(REG_ZERO, REG_SP, cd->stackframesize * 4 + LA_LR_OFFSET);
520 M_MOV(REG_PV, rd->argintregs[0]);
521 M_MOV(REG_SP, rd->argintregs[1]);
523 if (jd->isleafmethod)
524 M_MOV(REG_ZERO, rd->argintregs[2]);
526 M_ALD(rd->argintregs[2],
527 REG_SP, cd->stackframesize * 4 + LA_LR_OFFSET);
529 M_MOV(REG_ITMP2_XPC, rd->argintregs[3]);
530 M_MOV(REG_ITMP1, rd->argintregs[4]);
532 M_STWU(REG_SP, REG_SP, -(LA_SIZE + 6 * 4));
533 M_AST(REG_ITMP2_XPC, REG_SP, LA_SIZE + 5 * 4);
537 M_MOV(REG_RESULT, REG_ITMP1_XPTR);
539 M_ALD(REG_ITMP2_XPC, REG_SP, LA_SIZE + 5 * 4);
540 M_IADD_IMM(REG_SP, LA_SIZE + 6 * 4, REG_SP);
542 if (jd->isleafmethod) {
543 /* XXX FIXME: REG_ZERO can cause problems here! */
544 assert(cd->stackframesize * 4 <= 32767);
546 M_ALD(REG_ZERO, REG_SP, cd->stackframesize * 4 + LA_LR_OFFSET);
550 disp = dseg_add_functionptr(cd, asm_handle_exception);
551 M_ALD(REG_ITMP3, REG_PV, disp);
556 disp = (((u4 *) cd->mcodebase) + targetdisp) -
557 (((u4 *) cd->mcodeptr) + 1);
564 /* emit_patcher_stubs **********************************************************
566 Generates the code for the patcher stubs.
568 *******************************************************************************/
570 void emit_patcher_stubs(jitdata *jd)
580 /* get required compiler data */
584 /* generate code patching stub call code */
588 for (pref = cd->patchrefs; pref != NULL; pref = pref->next) {
589 /* check code segment size */
593 /* Get machine code which is patched back in later. The
594 call is 1 instruction word long. */
596 tmpmcodeptr = (u1 *) (cd->mcodebase + pref->branchpos);
598 mcode = *((u4 *) tmpmcodeptr);
600 /* Patch in the call to call the following code (done at
603 savedmcodeptr = cd->mcodeptr; /* save current mcodeptr */
604 cd->mcodeptr = tmpmcodeptr; /* set mcodeptr to patch position */
606 disp = ((u4 *) savedmcodeptr) - (((u4 *) tmpmcodeptr) + 1);
609 cd->mcodeptr = savedmcodeptr; /* restore the current mcodeptr */
611 /* create stack frame - keep stack 16-byte aligned */
613 M_AADD_IMM(REG_SP, -8 * 4, REG_SP);
615 /* calculate return address and move it onto the stack */
617 M_LDA(REG_ITMP3, REG_PV, pref->branchpos);
618 M_AST_INTERN(REG_ITMP3, REG_SP, 5 * 4);
620 /* move pointer to java_objectheader onto stack */
622 #if defined(ENABLE_THREADS)
623 /* order reversed because of data segment layout */
625 (void) dseg_add_unique_address(cd, NULL); /* flcword */
626 (void) dseg_add_unique_address(cd, lock_get_initial_lock_word());
627 disp = dseg_add_unique_address(cd, NULL); /* vftbl */
629 M_LDA(REG_ITMP3, REG_PV, disp);
630 M_AST_INTERN(REG_ITMP3, REG_SP, 4 * 4);
635 /* move machine code onto stack */
637 disp = dseg_add_s4(cd, mcode);
638 M_ILD(REG_ITMP3, REG_PV, disp);
639 M_IST_INTERN(REG_ITMP3, REG_SP, 3 * 4);
641 /* move class/method/field reference onto stack */
643 disp = dseg_add_address(cd, pref->ref);
644 M_ALD(REG_ITMP3, REG_PV, disp);
645 M_AST_INTERN(REG_ITMP3, REG_SP, 2 * 4);
647 /* move data segment displacement onto stack */
649 disp = dseg_add_s4(cd, pref->disp);
650 M_ILD(REG_ITMP3, REG_PV, disp);
651 M_IST_INTERN(REG_ITMP3, REG_SP, 1 * 4);
653 /* move patcher function pointer onto stack */
655 disp = dseg_add_functionptr(cd, pref->patcher);
656 M_ALD(REG_ITMP3, REG_PV, disp);
657 M_AST_INTERN(REG_ITMP3, REG_SP, 0 * 4);
659 if (targetdisp == 0) {
660 targetdisp = ((u4 *) cd->mcodeptr) - ((u4 *) cd->mcodebase);
662 disp = dseg_add_functionptr(cd, asm_patcher_wrapper);
663 M_ALD(REG_ITMP3, REG_PV, disp);
668 disp = (((u4 *) cd->mcodebase) + targetdisp) -
669 (((u4 *) cd->mcodeptr) + 1);
676 /* emit_replacement_stubs ******************************************************
678 Generates the code for the replacement stubs.
680 *******************************************************************************/
682 void emit_replacement_stubs(jitdata *jd)
691 /* get required compiler data */
696 rplp = code->rplpoints;
698 for (i = 0; i < code->rplpointcount; ++i, ++rplp) {
699 /* check code segment size */
703 /* note start of stub code */
705 rplp->outcode = (u1 *) (cd->mcodeptr - cd->mcodebase);
707 /* make machine code for patching */
709 savedmcodeptr = cd->mcodeptr;
710 cd->mcodeptr = (u1 *) &(rplp->mcode) + 1; /* big-endian */
712 disp = (ptrint) ((s4 *) rplp->outcode - (s4 *) rplp->pc) - 1;
715 cd->mcodeptr = savedmcodeptr;
717 /* create stack frame - keep 16-byte aligned */
719 M_AADD_IMM(REG_SP, -4 * 4, REG_SP);
721 /* push address of `rplpoint` struct */
723 disp = dseg_add_address(cd, rplp);
724 M_ALD(REG_ITMP3, REG_PV, disp);
725 M_AST_INTERN(REG_ITMP3, REG_SP, 0 * 4);
727 /* jump to replacement function */
729 disp = dseg_add_functionptr(cd, asm_replacement_out);
730 M_ALD(REG_ITMP3, REG_PV, disp);
737 /* emit_verbosecall_enter ******************************************************
739 Generates the code for the call trace.
741 *******************************************************************************/
743 void emit_verbosecall_enter(jitdata *jd)
753 /* get required compiler data */
761 /* Build up Stackframe for builtin_trace_args call (a multiple of 16) */
763 /* LA + TRACE_ARGS_NUM u8 args + methodinfo + LR */
764 /* LA_SIZE(=6*4) + 8*8 + 4 + 4 + 0(Padding) */
765 /* 6 * 4 + 8 * 8 + 2 * 4 = 12 * 8 = 6 * 16 */
767 /* LA + (TRACE_ARGS_NUM - INT_ARG_CNT/2) u8 args + methodinfo */
768 /* + INT_ARG_CNT * 4 ( save integer registers) + LR + 8 + 8 (Padding) */
769 /* LA_SIZE(=2*4) + 4 * 8 + 4 + 8 * 4 + 4 + 8 */
770 /* 2 * 4 + 4 * 8 + 10 * 4 + 1 * 8 + 8= 12 * 8 = 6 * 16 */
772 /* in nativestubs no Place to save the LR (Link Register) would be needed */
773 /* but since the stack frame has to be aligned the 4 Bytes would have to */
774 /* be padded again */
776 #if defined(__DARWIN__)
777 stack_size = LA_SIZE + (TRACE_ARGS_NUM + 1) * 8;
782 /* mark trace code */
787 M_AST(REG_ZERO, REG_SP, LA_LR_OFFSET);
788 M_STWU(REG_SP, REG_SP, -stack_size);
790 M_CLR(REG_ITMP1); /* clear help register */
792 /* save up to TRACE_ARGS_NUM arguments into the reserved stack space */
793 #if defined(__DARWIN__)
794 /* Copy Params starting from first to Stack */
795 /* since TRACE_ARGS == INT_ARG_CNT all used integer argument regs */
799 /* Copy Params starting from fifth to Stack (INT_ARG_CNT/2) are in */
800 /* integer argument regs */
801 /* all integer argument registers have to be saved */
802 for (p = 0; p < 8; p++) {
803 d = rd->argintregs[p];
804 /* save integer argument registers */
805 M_IST(d, REG_SP, LA_SIZE + 4 * 8 + 4 + p * 4);
810 for (; p < md->paramcount && p < TRACE_ARGS_NUM; p++, stack_off += 8) {
811 t = md->paramtypes[p].type;
812 if (IS_INT_LNG_TYPE(t)) {
813 if (!md->params[p].inmemory) { /* Param in Arg Reg */
814 if (IS_2_WORD_TYPE(t)) {
815 M_IST(rd->argintregs[GET_HIGH_REG(md->params[p].regoff)]
816 , REG_SP, stack_off);
817 M_IST(rd->argintregs[GET_LOW_REG(md->params[p].regoff)]
818 , REG_SP, stack_off + 4);
820 M_IST(REG_ITMP1, REG_SP, stack_off);
821 M_IST(rd->argintregs[md->params[p].regoff]
822 , REG_SP, stack_off + 4);
824 } else { /* Param on Stack */
825 s1 = (md->params[p].regoff + cd->stackframesize) * 4
827 if (IS_2_WORD_TYPE(t)) {
828 M_ILD(REG_ITMP2, REG_SP, s1);
829 M_IST(REG_ITMP2, REG_SP, stack_off);
830 M_ILD(REG_ITMP2, REG_SP, s1 + 4);
831 M_IST(REG_ITMP2, REG_SP, stack_off + 4);
833 M_IST(REG_ITMP1, REG_SP, stack_off);
834 M_ILD(REG_ITMP2, REG_SP, s1);
835 M_IST(REG_ITMP2, REG_SP, stack_off + 4);
838 } else { /* IS_FLT_DBL_TYPE(t) */
839 if (!md->params[p].inmemory) { /* in Arg Reg */
840 s1 = rd->argfltregs[md->params[p].regoff];
841 if (!IS_2_WORD_TYPE(t)) {
842 M_IST(REG_ITMP1, REG_SP, stack_off);
843 M_FST(s1, REG_SP, stack_off + 4);
845 M_DST(s1, REG_SP, stack_off);
847 } else { /* on Stack */
848 /* this should not happen */
853 /* load first 4 (==INT_ARG_CNT/2) arguments into integer registers */
854 #if defined(__DARWIN__)
855 for (p = 0; p < 8; p++) {
856 d = rd->argintregs[p];
857 M_ILD(d, REG_SP, LA_SIZE + p * 4);
861 /* Set integer and float argument registers vor trace_args call */
862 /* offset to saved integer argument registers */
863 stack_off = LA_SIZE + 4 * 8 + 4;
864 for (p = 0; (p < 4) && (p < md->paramcount); p++) {
865 t = md->paramtypes[p].type;
866 if (IS_INT_LNG_TYPE(t)) {
867 /* "stretch" int types */
868 if (!IS_2_WORD_TYPE(t)) {
869 M_CLR(rd->argintregs[2 * p]);
870 M_ILD(rd->argintregs[2 * p + 1], REG_SP,stack_off);
873 M_ILD(rd->argintregs[2 * p + 1], REG_SP,stack_off + 4);
874 M_ILD(rd->argintregs[2 * p], REG_SP,stack_off);
877 } else { /* Float/Dbl */
878 if (!md->params[p].inmemory) { /* Param in Arg Reg */
879 /* use reserved Place on Stack (sp + 5 * 16) to copy */
880 /* float/double arg reg to int reg */
881 s1 = rd->argfltregs[md->params[p].regoff];
882 if (!IS_2_WORD_TYPE(t)) {
883 M_FST(s1, REG_SP, 5 * 16);
884 M_ILD(rd->argintregs[2 * p + 1], REG_SP, 5 * 16);
885 M_CLR(rd->argintregs[2 * p]);
887 M_DST(s1, REG_SP, 5 * 16);
888 M_ILD(rd->argintregs[2 * p + 1], REG_SP, 5 * 16 + 4);
889 M_ILD(rd->argintregs[2 * p], REG_SP, 5 * 16);
896 /* put methodinfo pointer on Stackframe */
897 p = dseg_add_address(cd, m);
898 M_ALD(REG_ITMP1, REG_PV, p);
899 #if defined(__DARWIN__)
900 M_AST(REG_ITMP1, REG_SP, LA_SIZE + TRACE_ARGS_NUM * 8);
902 M_AST(REG_ITMP1, REG_SP, LA_SIZE + 4 * 8);
904 p = dseg_add_functionptr(cd, builtin_trace_args);
905 M_ALD(REG_ITMP2, REG_PV, p);
909 #if defined(__DARWIN__)
910 /* restore integer argument registers from the reserved stack space */
913 for (p = 0; p < md->paramcount && p < TRACE_ARGS_NUM;
914 p++, stack_off += 8) {
915 t = md->paramtypes[p].type;
917 if (IS_INT_LNG_TYPE(t)) {
918 if (!md->params[p].inmemory) {
919 if (IS_2_WORD_TYPE(t)) {
920 M_ILD(rd->argintregs[GET_HIGH_REG(md->params[p].regoff)]
921 , REG_SP, stack_off);
922 M_ILD(rd->argintregs[GET_LOW_REG(md->params[p].regoff)]
923 , REG_SP, stack_off + 4);
925 M_ILD(rd->argintregs[md->params[p].regoff]
926 , REG_SP, stack_off + 4);
933 for (p = 0; p < 8; p++) {
934 d = rd->argintregs[p];
935 /* save integer argument registers */
936 M_ILD(d, REG_SP, LA_SIZE + 4 * 8 + 4 + p * 4);
940 M_ALD(REG_ZERO, REG_SP, stack_size + LA_LR_OFFSET);
942 M_LDA(REG_SP, REG_SP, stack_size);
944 /* mark trace code */
950 /* emit_verbosecall_exit *******************************************************
952 Generates the code for the call trace.
954 *******************************************************************************/
956 void emit_verbosecall_exit(jitdata *jd)
964 /* get required compiler data */
972 /* mark trace code */
977 M_AST(REG_ZERO, REG_SP, LA_LR_OFFSET);
978 M_STWU(REG_SP, REG_SP, -(LA_SIZE + (1 + 2 + 2 + 1 + 4) * 4));
980 /* save return registers */
982 M_LST(REG_RESULT_PACKED, REG_SP, LA_SIZE + (1 + 2 + 2 + 1 + 0) * 4);
983 M_DST(REG_FRESULT, REG_SP, LA_SIZE + (1 + 2 + 2 + 1 + 2) * 4);
985 /* keep this order */
986 switch (md->returntype.type) {
989 #if defined(__DARWIN__)
990 M_MOV(REG_RESULT, rd->argintregs[2]);
991 M_CLR(rd->argintregs[1]);
993 M_MOV(REG_RESULT, rd->argintregs[3]);
994 M_CLR(rd->argintregs[2]);
999 #if defined(__DARWIN__)
1000 M_MOV(REG_RESULT2, rd->argintregs[2]);
1001 M_MOV(REG_RESULT, rd->argintregs[1]);
1003 M_MOV(REG_RESULT2, rd->argintregs[3]);
1004 M_MOV(REG_RESULT, rd->argintregs[2]);
1009 M_FLTMOVE(REG_FRESULT, rd->argfltregs[0]);
1010 M_FLTMOVE(REG_FRESULT, rd->argfltregs[1]);
1012 disp = dseg_add_address(cd, m);
1013 M_ALD(rd->argintregs[0], REG_PV, disp);
1015 disp = dseg_add_functionptr(cd, builtin_displaymethodstop);
1016 M_ALD(REG_ITMP2, REG_PV, disp);
1020 /* restore return registers */
1022 M_LLD(REG_RESULT_PACKED, REG_SP, LA_SIZE + (1 + 2 + 2 + 1 + 0) * 4);
1023 M_DLD(REG_FRESULT, REG_SP, LA_SIZE + (1 + 2 + 2 + 1 + 2) * 4);
1025 M_ALD(REG_ZERO, REG_SP, LA_SIZE + (1 + 2 + 2 + 1 + 4) * 4 + LA_LR_OFFSET);
1027 M_LDA(REG_SP, REG_SP, LA_SIZE + (1 + 2 + 2 + 1 + 4) * 4);
1029 /* mark trace code */
1036 * These are local overrides for various environment variables in Emacs.
1037 * Please do not remove this and leave it at the end of the file, where
1038 * Emacs will automagically detect them.
1039 * ---------------------------------------------------------------------
1042 * indent-tabs-mode: t
1046 * vim:noexpandtab:sw=4:ts=4: