URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libffi/] [src/] [frv/] [eabi.S] - Rev 791
Go to most recent revision | Compare with Previous | Blame | View Log
/* -----------------------------------------------------------------------eabi.S - Copyright (c) 2004 Anthony GreenFR-V Assembly glue.Permission is hereby granted, free of charge, to any person obtaininga copy of this software and associated documentation files (the``Software''), to deal in the Software without restriction, includingwithout limitation the rights to use, copy, modify, merge, publish,distribute, sublicense, and/or sell copies of the Software, and topermit persons to whom the Software is furnished to do so, subject tothe following conditions:The above copyright notice and this permission notice shall be includedin all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESSOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OFMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OROTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OROTHER DEALINGS IN THE SOFTWARE.----------------------------------------------------------------------- */#define LIBFFI_ASM#include <fficonfig.h>#include <ffi.h>.globl ffi_prep_args_EABI.text.p2align 4.globl ffi_call_EABI.type ffi_call_EABI, @function# gr8 : ffi_prep_args# gr9 : &ecif# gr10: cif->bytes# gr11: fig->flags# gr12: ecif.rvalue# gr13: fnffi_call_EABI:addi sp, #-80, spsti fp, @(sp, #24)addi sp, #24, fpmovsg lr, gr5/* Make room for the new arguments. *//* subi sp, fp, gr10 *//* Store return address and incoming args on stack. */sti gr5, @(fp, #8)sti gr8, @(fp, #-4)sti gr9, @(fp, #-8)sti gr10, @(fp, #-12)sti gr11, @(fp, #-16)sti gr12, @(fp, #-20)sti gr13, @(fp, #-24)sub sp, gr10, sp/* Call ffi_prep_args. */ldi @(fp, #-4), gr4addi sp, #0, gr8ldi @(fp, #-8), gr9#ifdef __FRV_FDPIC__ldd @(gr4, gr0), gr14calll @(gr14, gr0)#elsecalll @(gr4, gr0)#endif/* ffi_prep_args returns the new stack pointer. */mov gr8, gr4ldi @(sp, #0), gr8ldi @(sp, #4), gr9ldi @(sp, #8), gr10ldi @(sp, #12), gr11ldi @(sp, #16), gr12ldi @(sp, #20), gr13/* Always copy the return value pointer into the hiddenparameter register. This is only strictly necessarywhen we're returning an aggregate type, but it doesn'thurt to do this all the time, and it saves a branch. */ldi @(fp, #-20), gr3/* Use the ffi_prep_args return value for the new sp. */mov gr4, sp/* Call the target function. */ldi @(fp, -24), gr4#ifdef __FRV_FDPIC__ldd @(gr4, gr0), gr14calll @(gr14, gr0)#elsecalll @(gr4, gr0)#endif/* Store the result. */ldi @(fp, #-16), gr10 /* fig->flags */ldi @(fp, #-20), gr4 /* ecif.rvalue *//* Is the return value stored in two registers? */cmpi gr10, #8, icc0bne icc0, 0, .L2/* Yes, save them. */sti gr8, @(gr4, #0)sti gr9, @(gr4, #4)bra .L3.L2:/* Is the return value a structure? */cmpi gr10, #-1, icc0beq icc0, 0, .L3/* No, save a 4 byte return value. */sti gr8, @(gr4, #0).L3:/* Restore the stack, and return. */ldi @(fp, 8), gr5ld @(fp, gr0), fpaddi sp,#80,spjmpl @(gr5,gr0).size ffi_call_EABI, .-ffi_call_EABI
Go to most recent revision | Compare with Previous | Blame | View Log
