minix/lib/libm/arch/i387/abi.h
Ben Gras 2fe8fb192f Full switch to clang/ELF. Drop ack. Simplify.
There is important information about booting non-ack images in
docs/UPDATING. ack/aout-format images can't be built any more, and
booting clang/ELF-format ones is a little different. Updating to the
new boot monitor is recommended.

Changes in this commit:

	. drop boot monitor -> allowing dropping ack support
	. facility to copy ELF boot files to /boot so that old boot monitor
	  can still boot fairly easily, see UPDATING
	. no more ack-format libraries -> single-case libraries
	. some cleanup of OBJECT_FMT, COMPILER_TYPE, etc cases
	. drop several ack toolchain commands, but not all support
	  commands (e.g. aal is gone but acksize is not yet).
	. a few libc files moved to netbsd libc dir
	. new /bin/date as minix date used code in libc/
	. test compile fix
	. harmonize includes
	. /usr/lib is no longer special: without ack, /usr/lib plays no
	  kind of special bootstrapping role any more and bootstrapping
	  is done exclusively through packages, so releases depend even
	  less on the state of the machine making them now.
	. rename nbsd_lib* to lib*
	. reduce mtree
2012-02-14 14:52:02 +01:00

77 lines
1.7 KiB
C

/* $NetBSD: abi.h,v 1.5 2008/06/23 10:24:13 drochner Exp $ */
/*
* Written by Frank van der Linden (fvdl@wasabisystems.com)
*/
/*
* The x86-64 ABI specifies that float, double and long double
* arguments are passed in SSE2 (xmm) registers. Unfortunately,
* there is no way to push those on to the FP stack, which is
* where the fancier instructions get their arguments from.
*
* Define some prologues and epilogues to store and retrieve
* xmm regs to local variables.
*/
#ifdef __x86_64__
#define ARG_DOUBLE_ONE -8(%rsp)
#define ARG_DOUBLE_ONE_LSW -8(%rsp)
#define ARG_DOUBLE_ONE_MSW -4(%rsp)
#define ARG_DOUBLE_TWO -16(%rsp)
#define ARG_FLOAT_ONE -4(%rsp)
#define ARG_FLOAT_TWO -8(%rsp)
#define XMM_ONE_ARG_DOUBLE_PROLOGUE \
movsd %xmm0, ARG_DOUBLE_ONE
#define XMM_TWO_ARG_DOUBLE_PROLOGUE \
movsd %xmm0, ARG_DOUBLE_ONE ; \
movsd %xmm1, ARG_DOUBLE_TWO
#define XMM_ONE_ARG_FLOAT_PROLOGUE \
movss %xmm0, ARG_FLOAT_ONE
#define XMM_TWO_ARG_FLOAT_PROLOGUE \
movss %xmm0, ARG_FLOAT_ONE ; \
movss %xmm1, ARG_FLOAT_TWO
#define XMM_DOUBLE_EPILOGUE \
fstpl ARG_DOUBLE_ONE ; \
movsd ARG_DOUBLE_ONE, %xmm0
#define XMM_FLOAT_EPILOGUE \
fstps ARG_FLOAT_ONE ; \
movss ARG_FLOAT_ONE, %xmm0
#define FLDL_VAR(x) fldl x(%rip)
#else
#define ARG_DOUBLE_ONE 4(%esp)
#define ARG_DOUBLE_ONE_LSW 4(%esp)
#define ARG_DOUBLE_ONE_MSW 8(%esp)
#define ARG_DOUBLE_TWO 12(%esp)
#define ARG_FLOAT_ONE 4(%esp)
#define ARG_FLOAT_TWO 8(%esp)
#define XMM_ONE_ARG_DOUBLE_PROLOGUE
#define XMM_TWO_ARG_DOUBLE_PROLOGUE
#define XMM_ONE_ARG_FLOAT_PROLOGUE
#define XMM_TWO_ARG_FLOAT_PROLOGUE
#define XMM_DOUBLE_EPILOGUE
#define XMM_FLOAT_EPILOGUE
#ifdef PIC
#define FLDL_VAR(x) \
PIC_PROLOGUE ; \
fldl PIC_GOTOFF(x) ; \
PIC_EPILOGUE
#else
#define FLDL_VAR(x) \
fldl x
#endif
#endif