1 /* src/vm/jit/mips/emit.c - MIPS code emitter functions
3 Copyright (C) 1996-2005, 2006, 2007 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 $Id: emit.c 4398 2006-01-31 23:43:08Z twisti $
36 #include "vm/jit/mips/codegen.h"
37 #include "vm/jit/mips/md-abi.h"
39 #include "mm/memory.h"
41 #if defined(ENABLE_THREADS)
42 # include "threads/native/lock.h"
45 #include "vm/builtin.h"
46 #include "vm/exceptions.h"
47 #include "vm/stringlocal.h" /* XXX for gen_resolvebranch */
49 #include "vm/jit/abi-asm.h"
50 #include "vm/jit/asmpart.h"
51 #include "vm/jit/dseg.h"
52 #include "vm/jit/emit-common.h"
53 #include "vm/jit/jit.h"
54 #include "vm/jit/replace.h"
56 #include "vmcore/options.h"
59 /* emit_load *******************************************************************
61 Emits a possible load of an operand.
63 *******************************************************************************/
65 s4 emit_load(jitdata *jd, instruction *iptr, varinfo *src, s4 tempreg)
71 /* get required compiler data */
75 if (src->flags & INMEMORY) {
78 disp = src->vv.regoff * 8;
81 #if SIZEOF_VOID_P == 8
85 M_LLD(tempreg, REG_SP, disp);
90 M_ILD(tempreg, REG_SP, disp);
93 M_LLD(tempreg, REG_SP, disp);
97 M_FLD(tempreg, REG_SP, disp);
100 M_DLD(tempreg, REG_SP, disp);
103 vm_abort("emit_load: unknown type %d", src->type);
109 reg = src->vv.regoff;
115 /* emit_load_low ***************************************************************
117 Emits a possible load of the low 32-bits of an operand.
119 *******************************************************************************/
121 #if SIZEOF_VOID_P == 4
122 s4 emit_load_low(jitdata *jd, instruction *iptr, varinfo *src, s4 tempreg)
128 assert(src->type == TYPE_LNG);
130 /* get required compiler data */
134 if (src->flags & INMEMORY) {
137 disp = src->vv.regoff * 8;
139 #if WORDS_BIGENDIAN == 1
140 M_ILD(tempreg, REG_SP, disp + 4);
142 M_ILD(tempreg, REG_SP, disp);
148 reg = GET_LOW_REG(src->vv.regoff);
152 #endif /* SIZEOF_VOID_P == 4 */
155 /* emit_load_high **************************************************************
157 Emits a possible load of the high 32-bits of an operand.
159 *******************************************************************************/
161 #if SIZEOF_VOID_P == 4
162 s4 emit_load_high(jitdata *jd, instruction *iptr, varinfo *src, s4 tempreg)
168 assert(src->type == TYPE_LNG);
170 /* get required compiler data */
174 if (src->flags & INMEMORY) {
177 disp = src->vv.regoff * 8;
179 #if WORDS_BIGENDIAN == 1
180 M_ILD(tempreg, REG_SP, disp);
182 M_ILD(tempreg, REG_SP, disp + 4);
188 reg = GET_HIGH_REG(src->vv.regoff);
192 #endif /* SIZEOF_VOID_P == 4 */
195 /* emit_store ******************************************************************
197 Emits a possible store to variable.
199 *******************************************************************************/
201 void emit_store(jitdata *jd, instruction *iptr, varinfo *dst, s4 d)
206 /* get required compiler data */
210 if (dst->flags & INMEMORY) {
213 disp = dst->vv.regoff * 8;
216 #if SIZEOF_VOID_P == 8
220 M_LST(d, REG_SP, disp);
225 M_IST(d, REG_SP, disp);
228 M_LST(d, REG_SP, disp);
232 M_FST(d, REG_SP, disp);
235 M_DST(d, REG_SP, disp);
238 vm_abort("emit_store: unknown type %d", dst->type);
244 /* emit_copy *******************************************************************
246 Generates a register/memory to register/memory copy.
248 *******************************************************************************/
250 void emit_copy(jitdata *jd, instruction *iptr, varinfo *src, varinfo *dst)
255 /* get required compiler data */
259 if ((src->vv.regoff != dst->vv.regoff) ||
260 ((src->flags ^ dst->flags) & INMEMORY)) {
261 /* If one of the variables resides in memory, we can eliminate
262 the register move from/to the temporary register with the
263 order of getting the destination register and the load. */
265 if (IS_INMEMORY(src->flags)) {
266 #if SIZEOF_VOID_P == 4
267 if (IS_2_WORD_TYPE(src->type))
268 d = codegen_reg_of_var(iptr->opc, dst, REG_ITMP12_PACKED);
271 d = codegen_reg_of_var(iptr->opc, dst, REG_IFTMP);
272 s1 = emit_load(jd, iptr, src, d);
275 s1 = emit_load(jd, iptr, src, REG_IFTMP);
276 #if SIZEOF_VOID_P == 4
277 if (IS_2_WORD_TYPE(src->type))
278 d = codegen_reg_of_var(iptr->opc, dst, REG_ITMP12_PACKED);
281 d = codegen_reg_of_var(iptr->opc, dst, s1);
286 #if SIZEOF_VOID_P == 8
308 vm_abort("emit_copy: unknown type %d", dst->type);
312 emit_store(jd, iptr, dst, d);
317 /* emit_iconst *****************************************************************
321 *******************************************************************************/
323 void emit_iconst(codegendata *cd, s4 d, s4 value)
327 if ((value >= -32768) && (value <= 32767))
328 M_IADD_IMM(REG_ZERO, value, d);
329 else if ((value >= 0) && (value <= 0xffff))
330 M_OR_IMM(REG_ZERO, value, d);
332 disp = dseg_add_s4(cd, value);
333 M_ILD(d, REG_PV, disp);
338 /* emit_lconst *****************************************************************
342 *******************************************************************************/
344 void emit_lconst(codegendata *cd, s4 d, s8 value)
348 #if SIZEOF_VOID_P == 8
349 if ((value >= -32768) && (value <= 32767))
350 M_LADD_IMM(REG_ZERO, value, d);
351 else if ((value >= 0) && (value <= 0xffff))
352 M_OR_IMM(REG_ZERO, value, d);
354 disp = dseg_add_s8(cd, value);
355 M_LLD(d, REG_PV, disp);
358 disp = dseg_add_s8(cd, value);
359 M_LLD(d, REG_PV, disp);
364 /* emit_branch *****************************************************************
366 Emits the code for conditional and unconditional branchs.
368 NOTE: The reg argument may contain two packed registers.
370 *******************************************************************************/
372 void emit_branch(codegendata *cd, s4 disp, s4 condition, s4 reg, u4 opt)
377 /* calculate the different displacements */
379 checkdisp = (disp - 4);
380 branchdisp = (disp - 4) >> 2;
382 /* check which branch to generate */
384 if (condition == BRANCH_UNCONDITIONAL) {
385 /* check displacement for overflow */
387 if ((checkdisp < (s4) 0xffff8000) || (checkdisp > (s4) 0x00007fff)) {
388 /* if the long-branches flag isn't set yet, do it */
390 if (!CODEGENDATA_HAS_FLAG_LONGBRANCHES(cd)) {
391 cd->flags |= (CODEGENDATA_FLAG_ERROR |
392 CODEGENDATA_FLAG_LONGBRANCHES);
395 vm_abort("emit_branch: emit unconditional long-branch code");
403 /* and displacement for overflow */
405 if ((checkdisp < (s4) 0xffff8000) || (checkdisp > (s4) 0x00007fff)) {
406 /* if the long-branches flag isn't set yet, do it */
408 if (!CODEGENDATA_HAS_FLAG_LONGBRANCHES(cd)) {
409 cd->flags |= (CODEGENDATA_FLAG_ERROR |
410 CODEGENDATA_FLAG_LONGBRANCHES);
415 M_BNE(GET_HIGH_REG(reg), GET_LOW_REG(reg), 5);
418 M_BEQ(GET_HIGH_REG(reg), GET_LOW_REG(reg), 5);
433 vm_abort("emit_branch: unknown condition %d", condition);
436 /* The actual branch code which is over-jumped (NOTE: we
437 don't use a branch delay slot here). */
439 M_LUI(REG_ITMP3, branchdisp >> 16);
440 M_OR_IMM(REG_ITMP3, branchdisp, REG_ITMP3);
441 M_AADD(REG_PV, REG_ITMP3, REG_ITMP3);
449 M_BEQ(GET_HIGH_REG(reg), GET_LOW_REG(reg), branchdisp);
452 M_BNE(GET_HIGH_REG(reg), GET_LOW_REG(reg), branchdisp);
455 M_BLTZ(reg, branchdisp);
458 M_BGEZ(reg, branchdisp);
461 M_BGTZ(reg, branchdisp);
464 M_BLEZ(reg, branchdisp);
467 vm_abort("emit_branch: unknown condition %d", condition);
477 /* emit_arithmetic_check *******************************************************
479 Emit an ArithmeticException check.
481 *******************************************************************************/
483 void emit_arithmetic_check(codegendata *cd, instruction *iptr, s4 reg)
485 if (INSTRUCTION_MUST_CHECK(iptr)) {
488 M_ALD_INTERN(REG_ZERO, REG_ZERO, EXCEPTION_HARDWARE_ARITHMETIC);
493 /* emit_arrayindexoutofbounds_check ********************************************
495 Emit an ArrayIndexOutOfBoundsException check.
497 *******************************************************************************/
499 void emit_arrayindexoutofbounds_check(codegendata *cd, instruction *iptr, s4 s1, s4 s2)
501 if (INSTRUCTION_MUST_CHECK(iptr)) {
502 M_ILD_INTERN(REG_ITMP3, s1, OFFSET(java_arrayheader, size));
503 M_CMPULT(s2, REG_ITMP3, REG_ITMP3);
504 M_BNEZ(REG_ITMP3, 2);
506 M_ALD_INTERN(s2, REG_ZERO, EXCEPTION_HARDWARE_ARRAYINDEXOUTOFBOUNDS);
511 /* emit_classcast_check ********************************************************
513 Emit a ClassCastException check.
515 *******************************************************************************/
517 void emit_classcast_check(codegendata *cd, instruction *iptr, s4 condition, s4 reg, s4 s1)
519 if (INSTRUCTION_MUST_CHECK(iptr)) {
534 vm_abort("emit_classcast_check: unknown condition %d", condition);
538 M_ALD_INTERN(s1, REG_ZERO, EXCEPTION_HARDWARE_CLASSCAST);
543 /* emit_nullpointer_check ******************************************************
545 Emit a NullPointerException check.
547 *******************************************************************************/
549 void emit_nullpointer_check(codegendata *cd, instruction *iptr, s4 reg)
551 if (INSTRUCTION_MUST_CHECK(iptr)) {
554 M_ALD_INTERN(REG_ZERO, REG_ZERO, EXCEPTION_HARDWARE_NULLPOINTER);
559 /* emit_exception_check ********************************************************
561 Emit an Exception check.
563 *******************************************************************************/
565 void emit_exception_check(codegendata *cd, instruction *iptr)
567 if (INSTRUCTION_MUST_CHECK(iptr)) {
568 M_BNEZ(REG_RESULT, 2);
570 M_ALD_INTERN(REG_RESULT, REG_ZERO, EXCEPTION_HARDWARE_EXCEPTION);
575 /* emit_patcher_stubs **********************************************************
577 Generates the code for the patcher stubs.
579 *******************************************************************************/
581 void emit_patcher_stubs(jitdata *jd)
591 /* get required compiler data */
595 /* generate code patching stub call code */
599 /* for (pr = list_first_unsynced(cd->patchrefs); pr != NULL; */
600 /* pr = list_next_unsynced(cd->patchrefs, pr)) { */
601 for (pr = cd->patchrefs; pr != NULL; pr = pr->next) {
602 /* check code segment size */
606 /* Get machine code which is patched back in later. The
607 call is 2 instruction words long. */
609 tmpmcodeptr = (u1 *) (cd->mcodebase + pr->branchpos);
611 /* We use 2 loads here as an unaligned 8-byte read on 64-bit
612 MIPS causes a SIGSEGV and using the same code for both
613 architectures is much better. */
615 mcode[0] = ((u4 *) tmpmcodeptr)[0];
616 mcode[1] = ((u4 *) tmpmcodeptr)[1];
618 mcode[2] = ((u4 *) tmpmcodeptr)[2];
619 mcode[3] = ((u4 *) tmpmcodeptr)[3];
620 mcode[4] = ((u4 *) tmpmcodeptr)[4];
622 /* Patch in the call to call the following code (done at
625 savedmcodeptr = cd->mcodeptr; /* save current mcodeptr */
626 cd->mcodeptr = tmpmcodeptr; /* set mcodeptr to patch position */
628 disp = ((u4 *) savedmcodeptr) - (((u4 *) tmpmcodeptr) + 1);
630 /* if ((disp < (s4) 0xffff8000) || (disp > (s4) 0x00007fff)) { */
631 /* Recalculate the displacement to be relative to PV. */
633 disp = savedmcodeptr - cd->mcodebase;
635 M_LUI(REG_ITMP3, disp >> 16);
636 M_OR_IMM(REG_ITMP3, disp, REG_ITMP3);
637 M_AADD(REG_PV, REG_ITMP3, REG_ITMP3);
649 cd->mcodeptr = savedmcodeptr; /* restore the current mcodeptr */
651 /* create stack frame */
653 M_ASUB_IMM(REG_SP, 8 * 8, REG_SP);
655 /* calculate return address and move it onto the stack */
657 M_LDA(REG_ITMP3, REG_PV, pr->branchpos);
658 M_AST(REG_ITMP3, REG_SP, 7 * 8);
660 /* move pointer to java_objectheader onto stack */
662 #if defined(ENABLE_THREADS)
663 /* create a virtual java_objectheader */
665 (void) dseg_add_unique_address(cd, NULL); /* flcword */
666 (void) dseg_add_unique_address(cd, lock_get_initial_lock_word());
667 disp = dseg_add_unique_address(cd, NULL); /* vftbl */
669 M_LDA(REG_ITMP3, REG_PV, disp);
670 M_AST(REG_ITMP3, REG_SP, 6 * 8);
675 /* move machine code onto stack */
677 disp = dseg_add_s4(cd, mcode[0]);
678 M_ILD(REG_ITMP3, REG_PV, disp);
679 M_IST(REG_ITMP3, REG_SP, 3 * 8 + 0);
681 disp = dseg_add_s4(cd, mcode[1]);
682 M_ILD(REG_ITMP3, REG_PV, disp);
683 M_IST(REG_ITMP3, REG_SP, 3 * 8 + 4);
685 disp = dseg_add_s4(cd, mcode[2]);
686 M_ILD(REG_ITMP3, REG_PV, disp);
687 M_IST(REG_ITMP3, REG_SP, 4 * 8 + 0);
689 disp = dseg_add_s4(cd, mcode[3]);
690 M_ILD(REG_ITMP3, REG_PV, disp);
691 M_IST(REG_ITMP3, REG_SP, 4 * 8 + 4);
693 disp = dseg_add_s4(cd, mcode[4]);
694 M_ILD(REG_ITMP3, REG_PV, disp);
695 M_IST(REG_ITMP3, REG_SP, 5 * 8 + 0);
697 /* move class/method/field reference onto stack */
699 disp = dseg_add_address(cd, pr->ref);
700 M_ALD(REG_ITMP3, REG_PV, disp);
701 M_AST(REG_ITMP3, REG_SP, 2 * 8);
703 /* move data segment displacement onto stack */
705 disp = dseg_add_s4(cd, pr->disp);
706 M_ILD(REG_ITMP3, REG_PV, disp);
707 M_IST(REG_ITMP3, REG_SP, 1 * 8);
709 /* move patcher function pointer onto stack */
711 disp = dseg_add_functionptr(cd, pr->patcher);
712 M_ALD(REG_ITMP3, REG_PV, disp);
713 M_AST(REG_ITMP3, REG_SP, 0 * 8);
715 if (targetdisp == 0) {
716 targetdisp = ((u4 *) cd->mcodeptr) - ((u4 *) cd->mcodebase);
718 disp = dseg_add_functionptr(cd, asm_patcher_wrapper);
719 M_ALD(REG_ITMP3, REG_PV, disp);
724 disp = (((u4 *) cd->mcodebase) + targetdisp) -
725 (((u4 *) cd->mcodeptr) + 1);
734 /* emit_replacement_stubs ******************************************************
736 Generates the code for the replacement stubs.
738 *******************************************************************************/
740 #if defined(ENABLE_REPLACEMENT)
741 void emit_replacement_stubs(jitdata *jd)
752 /* get required compiler data */
757 rplp = code->rplpoints;
759 /* store beginning of replacement stubs */
761 code->replacementstubs = (u1*) (cd->mcodeptr - cd->mcodebase);
763 for (i = 0; i < code->rplpointcount; ++i, ++rplp) {
764 /* do not generate stubs for non-trappable points */
766 if (rplp->flags & RPLPOINT_FLAG_NOTRAP)
769 /* check code segment size */
774 savedmcodeptr = cd->mcodeptr;
777 /* create stack frame - 16-byte aligned */
779 M_ASUB_IMM(REG_SP, 2 * 8, REG_SP);
781 /* push address of `rplpoint` struct */
783 disp = dseg_add_address(cd, rplp);
784 M_ALD(REG_ITMP3, REG_PV, disp);
785 M_AST(REG_ITMP3, REG_SP, 0 * 8);
787 /* jump to replacement function */
789 disp = dseg_add_functionptr(cd, asm_replacement_out);
790 M_ALD(REG_ITMP3, REG_PV, disp);
792 M_NOP; /* delay slot */
794 assert((cd->mcodeptr - savedmcodeptr) == 4*REPLACEMENT_STUB_SIZE);
797 #endif /* defined(ENABLE_REPLACEMENT) */
800 /* emit_verbosecall_enter ******************************************************
802 Generates the code for the call trace.
804 *******************************************************************************/
807 void emit_verbosecall_enter(jitdata *jd)
816 /* get required compiler data */
824 /* mark trace code */
828 M_LDA(REG_SP, REG_SP, -(PA_SIZE + (2 + ARG_CNT + TMP_CNT) * 8));
829 M_AST(REG_RA, REG_SP, PA_SIZE + 1 * 8);
831 /* save argument registers (we store the registers as address
832 types, so it's correct for MIPS32 too) */
834 for (i = 0; i < INT_ARG_CNT; i++)
835 M_AST(rd->argintregs[i], REG_SP, PA_SIZE + (2 + i) * 8);
837 for (i = 0; i < FLT_ARG_CNT; i++)
838 M_DST(rd->argfltregs[i], REG_SP, PA_SIZE + (2 + INT_ARG_CNT + i) * 8);
840 /* save temporary registers for leaf methods */
842 if (jd->isleafmethod) {
843 for (i = 0; i < INT_TMP_CNT; i++)
844 M_AST(rd->tmpintregs[i], REG_SP, PA_SIZE + (2 + ARG_CNT + i) * 8);
846 for (i = 0; i < FLT_TMP_CNT; i++)
847 M_DST(rd->tmpfltregs[i], REG_SP, PA_SIZE + (2 + ARG_CNT + INT_TMP_CNT + i) * 8);
850 /* Load float arguments into integer registers. MIPS32 has less
851 float argument registers than integer ones, we need to check
854 for (i = 0; i < md->paramcount && i < INT_ARG_CNT && i < FLT_ARG_CNT; i++) {
855 t = md->paramtypes[i].type;
857 if (IS_FLT_DBL_TYPE(t)) {
858 if (IS_2_WORD_TYPE(t)) {
859 M_DST(rd->argfltregs[i], REG_SP, 0 * 8);
860 M_LLD(rd->argintregs[i], REG_SP, 0 * 8);
863 M_FST(rd->argfltregs[i], REG_SP, 0 * 8);
864 M_ILD(rd->argintregs[i], REG_SP, 0 * 8);
869 #if SIZEOF_VOID_P == 4
870 for (i = 0, j = 0; i < md->paramcount && i < TRACE_ARGS_NUM; i++) {
871 t = md->paramtypes[i].type;
873 if (IS_INT_LNG_TYPE(t)) {
874 if (IS_2_WORD_TYPE(t)) {
875 M_ILD(rd->argintregs[j], REG_SP, PA_SIZE + (2 + i) * 8);
876 M_ILD(rd->argintregs[j + 1], REG_SP, PA_SIZE + (2 + i) * 8 + 4);
879 # if WORDS_BIGENDIAN == 1
880 M_MOV(REG_ZERO, rd->argintregs[j]);
881 M_ILD(rd->argintregs[j + 1], REG_SP, PA_SIZE + (2 + i) * 8);
883 M_ILD(rd->argintregs[j], REG_SP, PA_SIZE + (2 + i) * 8);
884 M_MOV(REG_ZERO, rd->argintregs[j + 1]);
892 disp = dseg_add_address(cd, m);
893 M_ALD(REG_ITMP1, REG_PV, disp);
894 M_AST(REG_ITMP1, REG_SP, PA_SIZE + 0 * 8);
895 disp = dseg_add_functionptr(cd, builtin_verbosecall_enter);
896 M_ALD(REG_ITMP3, REG_PV, disp);
897 M_JSR(REG_RA, REG_ITMP3);
900 /* restore argument registers */
902 for (i = 0; i < INT_ARG_CNT; i++)
903 M_ALD(rd->argintregs[i], REG_SP, PA_SIZE + (2 + i) * 8);
905 for (i = 0; i < FLT_ARG_CNT; i++)
906 M_DLD(rd->argfltregs[i], REG_SP, PA_SIZE + (2 + INT_ARG_CNT + i) * 8);
908 /* restore temporary registers for leaf methods */
910 if (jd->isleafmethod) {
911 for (i = 0; i < INT_TMP_CNT; i++)
912 M_ALD(rd->tmpintregs[i], REG_SP, PA_SIZE + (2 + ARG_CNT + i) * 8);
914 for (i = 0; i < FLT_TMP_CNT; i++)
915 M_DLD(rd->tmpfltregs[i], REG_SP, PA_SIZE + (2 + ARG_CNT + INT_TMP_CNT + i) * 8);
918 M_ALD(REG_RA, REG_SP, PA_SIZE + 1 * 8);
919 M_LDA(REG_SP, REG_SP, PA_SIZE + (2 + ARG_CNT + TMP_CNT) * 8);
921 /* mark trace code */
925 #endif /* !defined(NDEBUG) */
928 /* emit_verbosecall_exit *******************************************************
930 Generates the code for the call trace.
932 void builtin_verbosecall_exit(s8 l, double d, float f, methodinfo *m);
934 *******************************************************************************/
937 void emit_verbosecall_exit(jitdata *jd)
945 /* get required compiler data */
953 /* mark trace code */
957 #if SIZEOF_VOID_P == 8
958 M_ASUB_IMM(REG_SP, 4 * 8, REG_SP); /* keep stack 16-byte aligned */
959 M_AST(REG_RA, REG_SP, 0 * 8);
961 M_LST(REG_RESULT, REG_SP, 1 * 8);
962 M_DST(REG_FRESULT, REG_SP, 2 * 8);
964 M_MOV(REG_RESULT, REG_A0);
965 M_DMOV(REG_FRESULT, REG_FA1);
966 M_FMOV(REG_FRESULT, REG_FA2);
968 disp = dseg_add_address(cd, m);
969 M_ALD(REG_A4, REG_PV, disp);
971 M_ASUB_IMM(REG_SP, (8*4 + 4 * 8), REG_SP);
972 M_AST(REG_RA, REG_SP, 8*4 + 0 * 8);
974 M_LST(REG_RESULT_PACKED, REG_SP, 8*4 + 1 * 8);
975 M_DST(REG_FRESULT, REG_SP, 8*4 + 2 * 8);
977 switch (md->returntype.type) {
979 M_LNGMOVE(REG_RESULT_PACKED, REG_A0_A1_PACKED);
983 # if WORDS_BIGENDIAN == 1
984 M_MOV(REG_ZERO, REG_A0);
985 M_MOV(REG_RESULT, REG_A1);
987 M_MOV(REG_RESULT, REG_A0);
988 M_MOV(REG_ZERO, REG_A1);
992 M_LLD(REG_A2_A3_PACKED, REG_SP, 8*4 + 2 * 8);
993 M_FST(REG_FRESULT, REG_SP, 4*4 + 0 * 4);
995 disp = dseg_add_address(cd, m);
996 M_ALD(REG_ITMP1, REG_PV, disp);
997 M_AST(REG_ITMP1, REG_SP, 4*4 + 1 * 4);
1000 disp = dseg_add_functionptr(cd, builtin_verbosecall_exit);
1001 M_ALD(REG_ITMP3, REG_PV, disp);
1002 M_JSR(REG_RA, REG_ITMP3);
1005 #if SIZEOF_VOID_P == 8
1006 M_DLD(REG_FRESULT, REG_SP, 2 * 8);
1007 M_LLD(REG_RESULT, REG_SP, 1 * 8);
1009 M_ALD(REG_RA, REG_SP, 0 * 8);
1010 M_AADD_IMM(REG_SP, 4 * 8, REG_SP);
1012 M_DLD(REG_FRESULT, REG_SP, 8*4 + 2 * 8);
1013 M_LLD(REG_RESULT_PACKED, REG_SP, 8*4 + 1 * 8);
1015 M_ALD(REG_RA, REG_SP, 8*4 + 0 * 8);
1016 M_AADD_IMM(REG_SP, 8*4 + 4 * 8, REG_SP);
1019 /* mark trace code */
1023 #endif /* !defined(NDEBUG) */
1027 * These are local overrides for various environment variables in Emacs.
1028 * Please do not remove this and leave it at the end of the file, where
1029 * Emacs will automagically detect them.
1030 * ---------------------------------------------------------------------
1033 * indent-tabs-mode: t
1037 * vim:noexpandtab:sw=4:ts=4: