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.h"
50 #include "vm/jit/abi-asm.h"
51 #include "vm/jit/asmpart.h"
52 #include "vm/jit/dseg.h"
53 #include "vm/jit/emit-common.h"
54 #include "vm/jit/jit.h"
55 #include "vm/jit/replace.h"
57 #include "vmcore/options.h"
60 /* emit_load *******************************************************************
62 Emits a possible load of an operand.
64 *******************************************************************************/
66 s4 emit_load(jitdata *jd, instruction *iptr, varinfo *src, s4 tempreg)
72 /* get required compiler data */
76 if (src->flags & INMEMORY) {
79 disp = src->vv.regoff * 8;
82 #if SIZEOF_VOID_P == 8
86 M_LLD(tempreg, REG_SP, disp);
91 M_ILD(tempreg, REG_SP, disp);
94 M_LLD(tempreg, REG_SP, disp);
98 M_FLD(tempreg, REG_SP, disp);
101 M_DLD(tempreg, REG_SP, disp);
104 vm_abort("emit_load: unknown type %d", src->type);
110 reg = src->vv.regoff;
116 /* emit_load_low ***************************************************************
118 Emits a possible load of the low 32-bits of an operand.
120 *******************************************************************************/
122 #if SIZEOF_VOID_P == 4
123 s4 emit_load_low(jitdata *jd, instruction *iptr, varinfo *src, s4 tempreg)
129 assert(src->type == TYPE_LNG);
131 /* get required compiler data */
135 if (src->flags & INMEMORY) {
138 disp = src->vv.regoff * 8;
140 #if WORDS_BIGENDIAN == 1
141 M_ILD(tempreg, REG_SP, disp + 4);
143 M_ILD(tempreg, REG_SP, disp);
149 reg = GET_LOW_REG(src->vv.regoff);
153 #endif /* SIZEOF_VOID_P == 4 */
156 /* emit_load_high **************************************************************
158 Emits a possible load of the high 32-bits of an operand.
160 *******************************************************************************/
162 #if SIZEOF_VOID_P == 4
163 s4 emit_load_high(jitdata *jd, instruction *iptr, varinfo *src, s4 tempreg)
169 assert(src->type == TYPE_LNG);
171 /* get required compiler data */
175 if (src->flags & INMEMORY) {
178 disp = src->vv.regoff * 8;
180 #if WORDS_BIGENDIAN == 1
181 M_ILD(tempreg, REG_SP, disp);
183 M_ILD(tempreg, REG_SP, disp + 4);
189 reg = GET_HIGH_REG(src->vv.regoff);
193 #endif /* SIZEOF_VOID_P == 4 */
196 /* emit_store ******************************************************************
198 Emits a possible store to variable.
200 *******************************************************************************/
202 void emit_store(jitdata *jd, instruction *iptr, varinfo *dst, s4 d)
207 /* get required compiler data */
211 if (dst->flags & INMEMORY) {
214 disp = dst->vv.regoff * 8;
217 #if SIZEOF_VOID_P == 8
221 M_LST(d, REG_SP, disp);
226 M_IST(d, REG_SP, disp);
229 M_LST(d, REG_SP, disp);
233 M_FST(d, REG_SP, disp);
236 M_DST(d, REG_SP, disp);
239 vm_abort("emit_store: unknown type %d", dst->type);
245 /* emit_copy *******************************************************************
247 Generates a register/memory to register/memory copy.
249 *******************************************************************************/
251 void emit_copy(jitdata *jd, instruction *iptr, varinfo *src, varinfo *dst)
256 /* get required compiler data */
260 if ((src->vv.regoff != dst->vv.regoff) ||
261 ((src->flags ^ dst->flags) & INMEMORY)) {
262 /* If one of the variables resides in memory, we can eliminate
263 the register move from/to the temporary register with the
264 order of getting the destination register and the load. */
266 if (IS_INMEMORY(src->flags)) {
267 #if SIZEOF_VOID_P == 4
268 if (IS_2_WORD_TYPE(src->type))
269 d = codegen_reg_of_var(iptr->opc, dst, REG_ITMP12_PACKED);
272 d = codegen_reg_of_var(iptr->opc, dst, REG_IFTMP);
273 s1 = emit_load(jd, iptr, src, d);
276 s1 = emit_load(jd, iptr, src, REG_IFTMP);
277 #if SIZEOF_VOID_P == 4
278 if (IS_2_WORD_TYPE(src->type))
279 d = codegen_reg_of_var(iptr->opc, dst, REG_ITMP12_PACKED);
282 d = codegen_reg_of_var(iptr->opc, dst, s1);
287 #if SIZEOF_VOID_P == 8
309 vm_abort("emit_copy: unknown type %d", dst->type);
313 emit_store(jd, iptr, dst, d);
318 /* emit_iconst *****************************************************************
322 *******************************************************************************/
324 void emit_iconst(codegendata *cd, s4 d, s4 value)
328 if ((value >= -32768) && (value <= 32767))
329 M_IADD_IMM(REG_ZERO, value, d);
330 else if ((value >= 0) && (value <= 0xffff))
331 M_OR_IMM(REG_ZERO, value, d);
333 disp = dseg_add_s4(cd, value);
334 M_ILD(d, REG_PV, disp);
339 /* emit_lconst *****************************************************************
343 *******************************************************************************/
345 void emit_lconst(codegendata *cd, s4 d, s8 value)
349 #if SIZEOF_VOID_P == 8
350 if ((value >= -32768) && (value <= 32767))
351 M_LADD_IMM(REG_ZERO, value, d);
352 else if ((value >= 0) && (value <= 0xffff))
353 M_OR_IMM(REG_ZERO, value, d);
355 disp = dseg_add_s8(cd, value);
356 M_LLD(d, REG_PV, disp);
359 disp = dseg_add_s8(cd, value);
360 M_LLD(d, REG_PV, disp);
365 /* emit_branch *****************************************************************
367 Emits the code for conditional and unconditional branchs.
369 NOTE: The reg argument may contain two packed registers.
371 *******************************************************************************/
373 void emit_branch(codegendata *cd, s4 disp, s4 condition, s4 reg, u4 opt)
378 /* calculate the different displacements */
380 checkdisp = (disp - 4);
381 branchdisp = (disp - 4) >> 2;
383 /* check which branch to generate */
385 if (condition == BRANCH_UNCONDITIONAL) {
386 /* check displacement for overflow */
388 if ((checkdisp < (s4) 0xffff8000) || (checkdisp > (s4) 0x00007fff)) {
389 /* if the long-branches flag isn't set yet, do it */
391 if (!CODEGENDATA_HAS_FLAG_LONGBRANCHES(cd)) {
392 cd->flags |= (CODEGENDATA_FLAG_ERROR |
393 CODEGENDATA_FLAG_LONGBRANCHES);
396 vm_abort("emit_branch: emit unconditional long-branch code");
404 /* and displacement for overflow */
406 if ((checkdisp < (s4) 0xffff8000) || (checkdisp > (s4) 0x00007fff)) {
407 /* if the long-branches flag isn't set yet, do it */
409 if (!CODEGENDATA_HAS_FLAG_LONGBRANCHES(cd)) {
410 cd->flags |= (CODEGENDATA_FLAG_ERROR |
411 CODEGENDATA_FLAG_LONGBRANCHES);
416 M_BNE(GET_HIGH_REG(reg), GET_LOW_REG(reg), 5);
419 M_BEQ(GET_HIGH_REG(reg), GET_LOW_REG(reg), 5);
434 vm_abort("emit_branch: unknown condition %d", condition);
437 /* The actual branch code which is over-jumped (NOTE: we
438 don't use a branch delay slot here). */
440 M_LUI(REG_ITMP3, branchdisp >> 16);
441 M_OR_IMM(REG_ITMP3, branchdisp, REG_ITMP3);
442 M_AADD(REG_PV, REG_ITMP3, REG_ITMP3);
450 M_BEQ(GET_HIGH_REG(reg), GET_LOW_REG(reg), branchdisp);
453 M_BNE(GET_HIGH_REG(reg), GET_LOW_REG(reg), branchdisp);
456 M_BLTZ(reg, branchdisp);
459 M_BGEZ(reg, branchdisp);
462 M_BGTZ(reg, branchdisp);
465 M_BLEZ(reg, branchdisp);
468 vm_abort("emit_branch: unknown condition %d", condition);
478 /* emit_arithmetic_check *******************************************************
480 Emit an ArithmeticException check.
482 *******************************************************************************/
484 void emit_arithmetic_check(codegendata *cd, instruction *iptr, s4 reg)
486 if (INSTRUCTION_MUST_CHECK(iptr)) {
489 M_ALD_INTERN(REG_ZERO, REG_ZERO, EXCEPTION_HARDWARE_ARITHMETIC);
494 /* emit_arrayindexoutofbounds_check ********************************************
496 Emit an ArrayIndexOutOfBoundsException check.
498 *******************************************************************************/
500 void emit_arrayindexoutofbounds_check(codegendata *cd, instruction *iptr, s4 s1, s4 s2)
502 if (INSTRUCTION_MUST_CHECK(iptr)) {
503 M_ILD_INTERN(REG_ITMP3, s1, OFFSET(java_arrayheader, size));
504 M_CMPULT(s2, REG_ITMP3, REG_ITMP3);
505 M_BNEZ(REG_ITMP3, 2);
507 M_ALD_INTERN(s2, REG_ZERO, EXCEPTION_HARDWARE_ARRAYINDEXOUTOFBOUNDS);
512 /* emit_classcast_check ********************************************************
514 Emit a ClassCastException check.
516 *******************************************************************************/
518 void emit_classcast_check(codegendata *cd, instruction *iptr, s4 condition, s4 reg, s4 s1)
520 if (INSTRUCTION_MUST_CHECK(iptr)) {
535 vm_abort("emit_classcast_check: unknown condition %d", condition);
539 M_ALD_INTERN(s1, REG_ZERO, EXCEPTION_HARDWARE_CLASSCAST);
544 /* emit_nullpointer_check ******************************************************
546 Emit a NullPointerException check.
548 *******************************************************************************/
550 void emit_nullpointer_check(codegendata *cd, instruction *iptr, s4 reg)
552 if (INSTRUCTION_MUST_CHECK(iptr)) {
555 M_ALD_INTERN(REG_ZERO, REG_ZERO, EXCEPTION_HARDWARE_NULLPOINTER);
560 /* emit_exception_check ********************************************************
562 Emit an Exception check.
564 *******************************************************************************/
566 void emit_exception_check(codegendata *cd, instruction *iptr)
568 if (INSTRUCTION_MUST_CHECK(iptr)) {
569 M_BNEZ(REG_RESULT, 2);
571 M_ALD_INTERN(REG_RESULT, REG_ZERO, EXCEPTION_HARDWARE_EXCEPTION);
576 /* emit_patcher_stubs **********************************************************
578 Generates the code for the patcher stubs.
580 *******************************************************************************/
582 void emit_patcher_stubs(jitdata *jd)
592 /* get required compiler data */
596 /* generate code patching stub call code */
600 /* for (pr = list_first_unsynced(cd->patchrefs); pr != NULL; */
601 /* pr = list_next_unsynced(cd->patchrefs, pr)) { */
602 for (pr = cd->patchrefs; pr != NULL; pr = pr->next) {
603 /* check code segment size */
607 /* Get machine code which is patched back in later. The
608 call is 2 instruction words long. */
610 tmpmcodeptr = (u1 *) (cd->mcodebase + pr->branchpos);
612 /* We use 2 loads here as an unaligned 8-byte read on 64-bit
613 MIPS causes a SIGSEGV and using the same code for both
614 architectures is much better. */
616 mcode[0] = ((u4 *) tmpmcodeptr)[0];
617 mcode[1] = ((u4 *) tmpmcodeptr)[1];
619 mcode[2] = ((u4 *) tmpmcodeptr)[2];
620 mcode[3] = ((u4 *) tmpmcodeptr)[3];
621 mcode[4] = ((u4 *) tmpmcodeptr)[4];
623 /* Patch in the call to call the following code (done at
626 savedmcodeptr = cd->mcodeptr; /* save current mcodeptr */
627 cd->mcodeptr = tmpmcodeptr; /* set mcodeptr to patch position */
629 disp = ((u4 *) savedmcodeptr) - (((u4 *) tmpmcodeptr) + 1);
631 /* if ((disp < (s4) 0xffff8000) || (disp > (s4) 0x00007fff)) { */
632 /* Recalculate the displacement to be relative to PV. */
634 disp = savedmcodeptr - cd->mcodebase;
636 M_LUI(REG_ITMP3, disp >> 16);
637 M_OR_IMM(REG_ITMP3, disp, REG_ITMP3);
638 M_AADD(REG_PV, REG_ITMP3, REG_ITMP3);
650 cd->mcodeptr = savedmcodeptr; /* restore the current mcodeptr */
652 /* create stack frame */
654 M_ASUB_IMM(REG_SP, 8 * 8, REG_SP);
656 /* calculate return address and move it onto the stack */
658 M_LDA(REG_ITMP3, REG_PV, pr->branchpos);
659 M_AST(REG_ITMP3, REG_SP, 7 * 8);
661 /* move pointer to java_objectheader onto stack */
663 #if defined(ENABLE_THREADS)
664 /* create a virtual java_objectheader */
666 (void) dseg_add_unique_address(cd, NULL); /* flcword */
667 (void) dseg_add_unique_address(cd, lock_get_initial_lock_word());
668 disp = dseg_add_unique_address(cd, NULL); /* vftbl */
670 M_LDA(REG_ITMP3, REG_PV, disp);
671 M_AST(REG_ITMP3, REG_SP, 6 * 8);
676 /* move machine code onto stack */
678 disp = dseg_add_s4(cd, mcode[0]);
679 M_ILD(REG_ITMP3, REG_PV, disp);
680 M_IST(REG_ITMP3, REG_SP, 3 * 8 + 0);
682 disp = dseg_add_s4(cd, mcode[1]);
683 M_ILD(REG_ITMP3, REG_PV, disp);
684 M_IST(REG_ITMP3, REG_SP, 3 * 8 + 4);
686 disp = dseg_add_s4(cd, mcode[2]);
687 M_ILD(REG_ITMP3, REG_PV, disp);
688 M_IST(REG_ITMP3, REG_SP, 4 * 8 + 0);
690 disp = dseg_add_s4(cd, mcode[3]);
691 M_ILD(REG_ITMP3, REG_PV, disp);
692 M_IST(REG_ITMP3, REG_SP, 4 * 8 + 4);
694 disp = dseg_add_s4(cd, mcode[4]);
695 M_ILD(REG_ITMP3, REG_PV, disp);
696 M_IST(REG_ITMP3, REG_SP, 5 * 8 + 0);
698 /* move class/method/field reference onto stack */
700 disp = dseg_add_address(cd, pr->ref);
701 M_ALD(REG_ITMP3, REG_PV, disp);
702 M_AST(REG_ITMP3, REG_SP, 2 * 8);
704 /* move data segment displacement onto stack */
706 disp = dseg_add_s4(cd, pr->disp);
707 M_ILD(REG_ITMP3, REG_PV, disp);
708 M_IST(REG_ITMP3, REG_SP, 1 * 8);
710 /* move patcher function pointer onto stack */
712 disp = dseg_add_functionptr(cd, pr->patcher);
713 M_ALD(REG_ITMP3, REG_PV, disp);
714 M_AST(REG_ITMP3, REG_SP, 0 * 8);
716 if (targetdisp == 0) {
717 targetdisp = ((u4 *) cd->mcodeptr) - ((u4 *) cd->mcodebase);
719 disp = dseg_add_functionptr(cd, asm_patcher_wrapper);
720 M_ALD(REG_ITMP3, REG_PV, disp);
725 disp = (((u4 *) cd->mcodebase) + targetdisp) -
726 (((u4 *) cd->mcodeptr) + 1);
735 /* emit_replacement_stubs ******************************************************
737 Generates the code for the replacement stubs.
739 *******************************************************************************/
741 #if defined(ENABLE_REPLACEMENT)
742 void emit_replacement_stubs(jitdata *jd)
753 /* get required compiler data */
758 rplp = code->rplpoints;
760 /* store beginning of replacement stubs */
762 code->replacementstubs = (u1*) (cd->mcodeptr - cd->mcodebase);
764 for (i = 0; i < code->rplpointcount; ++i, ++rplp) {
765 /* do not generate stubs for non-trappable points */
767 if (rplp->flags & RPLPOINT_FLAG_NOTRAP)
770 /* check code segment size */
775 savedmcodeptr = cd->mcodeptr;
778 /* create stack frame - 16-byte aligned */
780 M_ASUB_IMM(REG_SP, 2 * 8, REG_SP);
782 /* push address of `rplpoint` struct */
784 disp = dseg_add_address(cd, rplp);
785 M_ALD(REG_ITMP3, REG_PV, disp);
786 M_AST(REG_ITMP3, REG_SP, 0 * 8);
788 /* jump to replacement function */
790 disp = dseg_add_functionptr(cd, asm_replacement_out);
791 M_ALD(REG_ITMP3, REG_PV, disp);
793 M_NOP; /* delay slot */
795 assert((cd->mcodeptr - savedmcodeptr) == 4*REPLACEMENT_STUB_SIZE);
798 #endif /* defined(ENABLE_REPLACEMENT) */
801 /* emit_verbosecall_enter ******************************************************
803 Generates the code for the call trace.
805 *******************************************************************************/
808 void emit_verbosecall_enter(jitdata *jd)
817 /* get required compiler data */
825 /* mark trace code */
829 M_LDA(REG_SP, REG_SP, -(PA_SIZE + (2 + ARG_CNT + TMP_CNT) * 8));
830 M_AST(REG_RA, REG_SP, PA_SIZE + 1 * 8);
832 /* save argument registers (we store the registers as address
833 types, so it's correct for MIPS32 too) */
835 for (i = 0; i < INT_ARG_CNT; i++)
836 M_AST(abi_registers_integer_argument[i], REG_SP, PA_SIZE + (2 + i) * 8);
838 for (i = 0; i < FLT_ARG_CNT; i++)
839 M_DST(abi_registers_float_argument[i], REG_SP, PA_SIZE + (2 + INT_ARG_CNT + i) * 8);
841 /* save temporary registers for leaf methods */
843 if (jd->isleafmethod) {
844 for (i = 0; i < INT_TMP_CNT; i++)
845 M_AST(rd->tmpintregs[i], REG_SP, PA_SIZE + (2 + ARG_CNT + i) * 8);
847 for (i = 0; i < FLT_TMP_CNT; i++)
848 M_DST(rd->tmpfltregs[i], REG_SP, PA_SIZE + (2 + ARG_CNT + INT_TMP_CNT + i) * 8);
851 /* Load float arguments into integer registers. MIPS32 has less
852 float argument registers than integer ones, we need to check
855 for (i = 0; i < md->paramcount && i < INT_ARG_CNT && i < FLT_ARG_CNT; i++) {
856 t = md->paramtypes[i].type;
858 if (IS_FLT_DBL_TYPE(t)) {
859 if (IS_2_WORD_TYPE(t)) {
860 M_DST(abi_registers_float_argument[i], REG_SP, 0 * 8);
861 M_LLD(abi_registers_integer_argument[i], REG_SP, 0 * 8);
864 M_FST(abi_registers_float_argument[i], REG_SP, 0 * 8);
865 M_ILD(abi_registers_integer_argument[i], REG_SP, 0 * 8);
870 #if SIZEOF_VOID_P == 4
871 for (i = 0, j = 0; i < md->paramcount && i < TRACE_ARGS_NUM; i++) {
872 t = md->paramtypes[i].type;
874 if (IS_INT_LNG_TYPE(t)) {
875 if (IS_2_WORD_TYPE(t)) {
876 M_ILD(abi_registers_integer_argument[j], REG_SP, PA_SIZE + (2 + i) * 8);
877 M_ILD(abi_registers_integer_argument[j + 1], REG_SP, PA_SIZE + (2 + i) * 8 + 4);
880 # if WORDS_BIGENDIAN == 1
881 M_MOV(REG_ZERO, abi_registers_integer_argument[j]);
882 M_ILD(abi_registers_integer_argument[j + 1], REG_SP, PA_SIZE + (2 + i) * 8);
884 M_ILD(abi_registers_integer_argument[j], REG_SP, PA_SIZE + (2 + i) * 8);
885 M_MOV(REG_ZERO, abi_registers_integer_argument[j + 1]);
893 disp = dseg_add_address(cd, m);
894 M_ALD(REG_ITMP1, REG_PV, disp);
895 M_AST(REG_ITMP1, REG_SP, PA_SIZE + 0 * 8);
896 disp = dseg_add_functionptr(cd, builtin_verbosecall_enter);
897 M_ALD(REG_ITMP3, REG_PV, disp);
898 M_JSR(REG_RA, REG_ITMP3);
901 /* restore argument registers */
903 for (i = 0; i < INT_ARG_CNT; i++)
904 M_ALD(abi_registers_integer_argument[i], REG_SP, PA_SIZE + (2 + i) * 8);
906 for (i = 0; i < FLT_ARG_CNT; i++)
907 M_DLD(abi_registers_float_argument[i], REG_SP, PA_SIZE + (2 + INT_ARG_CNT + i) * 8);
909 /* restore temporary registers for leaf methods */
911 if (jd->isleafmethod) {
912 for (i = 0; i < INT_TMP_CNT; i++)
913 M_ALD(rd->tmpintregs[i], REG_SP, PA_SIZE + (2 + ARG_CNT + i) * 8);
915 for (i = 0; i < FLT_TMP_CNT; i++)
916 M_DLD(rd->tmpfltregs[i], REG_SP, PA_SIZE + (2 + ARG_CNT + INT_TMP_CNT + i) * 8);
919 M_ALD(REG_RA, REG_SP, PA_SIZE + 1 * 8);
920 M_LDA(REG_SP, REG_SP, PA_SIZE + (2 + ARG_CNT + TMP_CNT) * 8);
922 /* mark trace code */
926 #endif /* !defined(NDEBUG) */
929 /* emit_verbosecall_exit *******************************************************
931 Generates the code for the call trace.
933 void builtin_verbosecall_exit(s8 l, double d, float f, methodinfo *m);
935 *******************************************************************************/
938 void emit_verbosecall_exit(jitdata *jd)
946 /* get required compiler data */
954 /* mark trace code */
958 #if SIZEOF_VOID_P == 8
959 M_ASUB_IMM(REG_SP, 4 * 8, REG_SP); /* keep stack 16-byte aligned */
960 M_AST(REG_RA, REG_SP, 0 * 8);
962 M_LST(REG_RESULT, REG_SP, 1 * 8);
963 M_DST(REG_FRESULT, REG_SP, 2 * 8);
965 M_MOV(REG_RESULT, REG_A0);
966 M_DMOV(REG_FRESULT, REG_FA1);
967 M_FMOV(REG_FRESULT, REG_FA2);
969 disp = dseg_add_address(cd, m);
970 M_ALD(REG_A4, REG_PV, disp);
972 M_ASUB_IMM(REG_SP, (8*4 + 4 * 8), REG_SP);
973 M_AST(REG_RA, REG_SP, 8*4 + 0 * 8);
975 M_LST(REG_RESULT_PACKED, REG_SP, 8*4 + 1 * 8);
976 M_DST(REG_FRESULT, REG_SP, 8*4 + 2 * 8);
978 switch (md->returntype.type) {
980 M_LNGMOVE(REG_RESULT_PACKED, REG_A0_A1_PACKED);
984 # if WORDS_BIGENDIAN == 1
985 M_MOV(REG_ZERO, REG_A0);
986 M_MOV(REG_RESULT, REG_A1);
988 M_MOV(REG_RESULT, REG_A0);
989 M_MOV(REG_ZERO, REG_A1);
993 M_LLD(REG_A2_A3_PACKED, REG_SP, 8*4 + 2 * 8);
994 M_FST(REG_FRESULT, REG_SP, 4*4 + 0 * 4);
996 disp = dseg_add_address(cd, m);
997 M_ALD(REG_ITMP1, REG_PV, disp);
998 M_AST(REG_ITMP1, REG_SP, 4*4 + 1 * 4);
1001 disp = dseg_add_functionptr(cd, builtin_verbosecall_exit);
1002 M_ALD(REG_ITMP3, REG_PV, disp);
1003 M_JSR(REG_RA, REG_ITMP3);
1006 #if SIZEOF_VOID_P == 8
1007 M_DLD(REG_FRESULT, REG_SP, 2 * 8);
1008 M_LLD(REG_RESULT, REG_SP, 1 * 8);
1010 M_ALD(REG_RA, REG_SP, 0 * 8);
1011 M_AADD_IMM(REG_SP, 4 * 8, REG_SP);
1013 M_DLD(REG_FRESULT, REG_SP, 8*4 + 2 * 8);
1014 M_LLD(REG_RESULT_PACKED, REG_SP, 8*4 + 1 * 8);
1016 M_ALD(REG_RA, REG_SP, 8*4 + 0 * 8);
1017 M_AADD_IMM(REG_SP, 8*4 + 4 * 8, REG_SP);
1020 /* mark trace code */
1024 #endif /* !defined(NDEBUG) */
1028 * These are local overrides for various environment variables in Emacs.
1029 * Please do not remove this and leave it at the end of the file, where
1030 * Emacs will automagically detect them.
1031 * ---------------------------------------------------------------------
1034 * indent-tabs-mode: t
1038 * vim:noexpandtab:sw=4:ts=4: