cosl.asm revision a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fc
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync; $Id$
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync;; @file
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync; innotek Portable Runtime - No-CRT cosl - AMD64 & X86.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync;
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync;
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync; Copyright (C) 2006-2007 innotek GmbH
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync;
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync; This file is part of VirtualBox Open Source Edition (OSE), as
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync; available from http://www.virtualbox.org. This file is free software;
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync; you can redistribute it and/or modify it under the terms of the GNU
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync; General Public License (GPL) as published by the Free Software
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync; Foundation, in version 2 as it comes in the "COPYING" file of the
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync;
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync; The contents of this file may alternatively be used under the terms
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync; of the Common Development and Distribution License Version 1.0
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync; (CDDL) only, as it comes in the "COPYING.CDDL" file of the
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync; VirtualBox OSE distribution, in which case the provisions of the
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync; CDDL are applicable instead of those of the GPL.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync;
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync; You may elect to license modified versions of this file under the
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync; terms and conditions of either the GPL or the CDDL or both.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync;
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync%include "iprt/asmdefs.mac"
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncBEGINCODE
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync%ifdef RT_ARCH_AMD64
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync %define _SP rsp
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync %define _BP rbp
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync %define _S 8
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync%else
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync %define _SP esp
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync %define _BP ebp
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync %define _S 4
%endif
;;
; compute the cosine of ldr, measured in radians.
; @returns st(0)
; @param lrd [rbp + _S*2]
BEGINPROC RT_NOCRT(cosl)
push _BP
mov _BP, _SP
sub _SP, 10h
fld tword [_BP + _S*2]
fcos
fnstsw ax
test ah, 4
jz .done
fldpi
fadd st0, st0
fxch st1
.again:
fprem1
fnstsw ax
test ah, 4
jnz .again
fstp st0
fcos
.done:
leave
ret
ENDPROC RT_NOCRT(cosl)