Author: greatlrd
Date: Tue Aug 29 23:14:18 2006
New Revision: 23790
URL: http://svn.reactos.org/svn/reactos?rev=23790&view=rev
Log:
found more inline asm.
1. move all inline asm to folder i386
2. to do : seh.s should be rewrites to intel syntax
3. to do : almost all c files in folders i386 need be convert to true asm instead using inline asm
4. add dection for x86 arch in rbuild for each found I have done
Added:
trunk/reactos/lib/crt/except/i386/
trunk/reactos/lib/crt/except/i386/seh.s
- copied unchanged from r23781, trunk/reactos/lib/crt/except/seh.s
trunk/reactos/lib/crt/except/i386/unwind.c
- copied unchanged from r23788, trunk/reactos/lib/crt/except/unwind.c
trunk/reactos/lib/crt/float/i386/
trunk/reactos/lib/crt/float/i386/clearfp.c
- copied unchanged from r23781, trunk/reactos/lib/crt/float/clearfp.c
trunk/reactos/lib/crt/float/i386/cntrlfp.c
- copied unchanged from r23781, trunk/reactos/lib/crt/float/cntrlfp.c
trunk/reactos/lib/crt/float/i386/logb.c
- copied unchanged from r23781, trunk/reactos/lib/crt/float/logb.c
trunk/reactos/lib/crt/float/i386/statfp.c
- copied unchanged from r23781, trunk/reactos/lib/crt/float/statfp.c
trunk/reactos/lib/crt/math/i386/atan2.c
- copied unchanged from r23784, trunk/reactos/lib/crt/math/atan2.c
trunk/reactos/lib/crt/math/i386/exp.c
- copied unchanged from r23784, trunk/reactos/lib/crt/math/exp.c
trunk/reactos/lib/crt/math/i386/fmod.c
- copied unchanged from r23784, trunk/reactos/lib/crt/math/fmod.c
trunk/reactos/lib/crt/math/i386/ldexp.c
- copied unchanged from r23784, trunk/reactos/lib/crt/math/ldexp.c
Removed:
trunk/reactos/lib/crt/except/seh.s
trunk/reactos/lib/crt/except/unwind.c
trunk/reactos/lib/crt/float/clearfp.c
trunk/reactos/lib/crt/float/cntrlfp.c
trunk/reactos/lib/crt/float/logb.c
trunk/reactos/lib/crt/float/statfp.c
trunk/reactos/lib/crt/math/atan2.c
trunk/reactos/lib/crt/math/exp.c
trunk/reactos/lib/crt/math/fmod.c
trunk/reactos/lib/crt/math/ldexp.c
Modified:
trunk/reactos/lib/crt/crt.rbuild
Modified: trunk/reactos/lib/crt/crt.rbuild
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/crt/crt.rbuild?rev=237…
==============================================================================
--- trunk/reactos/lib/crt/crt.rbuild (original)
+++ trunk/reactos/lib/crt/crt.rbuild Tue Aug 29 23:14:18 2006
@@ -41,23 +41,32 @@
<file>abnorter.c</file>
<file>exhand2.c</file>
<file>matherr.c</file>
- <file>seh.s</file>
- <file>unwind.c</file>
+ <if property="ARCH" value="i386">
+ <directory name="i386">
+ <file>seh.s</file>
+ <file>unwind.c</file>
+ </directory>
+ </if>
<file>xcptfil.c</file>
</directory>
<directory name="float">
- <file>chgsign.c</file>
- <file>clearfp.c</file>
- <file>cntrlfp.c</file>
+ <file>chgsign.c</file>
<file>copysign.c</file>
<file>fpclass.c</file>
<file>fpecode.c</file>
<file>fpreset.c</file>
<file>isnan.c</file>
- <file>logb.c</file>
<file>nafter.c</file>
<file>scalb.c</file>
- <file>statfp.c</file>
+
+ <if property="ARCH" value="i386">
+ <directory name="i386">
+ <file>clearfp.c</file>
+ <file>cntrlfp.c</file>
+ <file>logb.c</file>
+ <file>statfp.c</file>
+ </directory>
+ </if>
</directory>
<directory name="io">
<file>access.c</file>
@@ -121,13 +130,12 @@
<file>tanh.c</file>
<file>pow_asm.c</file>
- <if property="ARCH" value="i386">
- <file>atan2.c</file>
- <file>exp.c</file>
- <file>fmod.c</file>
- <file>ldexp.c</file>
-
+ <if property="ARCH" value="i386">
<directory name="i386">
+ <file>atan2.c</file>
+ <file>exp.c</file>
+ <file>fmod.c</file>
+ <file>ldexp.c</file>
<file>atan_asm.s</file>
<file>pow_asm.s</file>
<file>log10_asm.s</file>
Removed: trunk/reactos/lib/crt/except/seh.s
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/crt/except/seh.s?rev=2…
==============================================================================
--- trunk/reactos/lib/crt/except/seh.s (original)
+++ trunk/reactos/lib/crt/except/seh.s (removed)
@@ -1,380 +1,0 @@
-/* $Id$
- *
- * COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS MSVCRT Runtime Library
- * PURPOSE: Runtime library exception support for IA-32
- * FILE: lib/msvcrt/except/seh.s
- * PROGRAMER: Casper S. Hornstrup (chorns(a)users.sourceforge.net)
- * NOTES: This file is shared with ntoskrnl/rtl/i386/seh.s.
- * Please keep them in sync.
- */
-
-#define ExceptionContinueExecution 0
-#define ExceptionContinueSearch 1
-#define ExceptionNestedException 2
-#define ExceptionCollidedUnwind 3
-
-#define EXCEPTION_NONCONTINUABLE 0x01
-#define EXCEPTION_UNWINDING 0x02
-#define EXCEPTION_EXIT_UNWIND 0x04
-#define EXCEPTION_STACK_INVALID 0x08
-#define EXCEPTION_NESTED_CALL 0x10
-#define EXCEPTION_TARGET_UNWIND 0x20
-#define EXCEPTION_COLLIDED_UNWIND 0x40
-
-#define EXCEPTION_UNWIND_MODE \
-( EXCEPTION_UNWINDING \
- | EXCEPTION_EXIT_UNWIND \
- | EXCEPTION_TARGET_UNWIND \
- | EXCEPTION_COLLIDED_UNWIND)
-
-#define EREC_CODE 0x00
-#define EREC_FLAGS 0x04
-#define EREC_RECORD 0x08
-#define EREC_ADDRESS 0x0C
-#define EREC_NUMPARAMS 0x10
-#define EREC_INFO 0x14
-
-#define TRYLEVEL_NONE -1
-#define TRYLEVEL_INVALID -2
-
-#define ER_STANDARDESP -0x08
-#define ER_EPOINTERS -0x04
-#define ER_PREVFRAME 0x00
-#define ER_HANDLER 0x04
-#define ER_SCOPETABLE 0x08
-#define ER_TRYLEVEL 0x0C
-#define ER_EBP 0x10
-
-#define ST_TRYLEVEL 0x00
-#define ST_FILTER 0x04
-#define ST_HANDLER 0x08
-
-#define CONTEXT_EDI 0x9C
-#define CONTEXT_EBX 0xA4
-#define CONTEXT_EIP 0xB8
-
-.globl __local_unwind2
-.globl __except_handler3
-.globl __EH_prolog
-
-// EAX = value to print
-_do_debug:
- pushal
- pushl %eax
- call _MsvcrtDebug@4
- popal
- ret
-
-#define LU2_TRYLEVEL 0x08
-#define LU2_REGFRAME 0x04
-
-//
-// void
-// _local_unwind2(PEXCEPTION_REGISTRATION RegistrationFrame,
-// LONG TryLevel)
-//
-// Parameters:
-// [EDX+08h] - PEXCEPTION_REGISTRATION RegistrationFrame
-// [EDX+04h] - LONG TryLevel
-// Registers:
-// EBP - EBP of call frame we are unwinding
-// Returns:
-// Nothing
-// Notes:
-// Run all termination handlers for a call frame from the current
-// try-level up to (but not including) the given stop try-level.
-__local_unwind2:
- // Setup our call frame so we can access parameters using EDX
- //pushl %ebp
- movl %esp, %edx
-
- // FIXME: Setup an EXCEPTION_REGISTRATION entry to protect the
- // unwinding in case something goes wrong
-
-.lu2_next_scope:
-
- // Keep a pointer to the exception registration in EBX
- movl LU2_REGFRAME(%edx), %ebx
-
- // If we have reached the end of the chain or we're asked to stop here
- // by the caller then exit
- test %ebx, %ebx
- je .lu2_done
-
- movl ER_TRYLEVEL(%ebx), %eax
- cmpl $-1, %eax
- je .lu2_done
-
- cmpl LU2_TRYLEVEL(%edx), %eax
- je .lu2_done
-
- // Keep a pointer to the scopetable in ESI
- movl ER_SCOPETABLE(%ebx), %esi
-
- // Compute the offset of the entry in the scopetable that describes
- // the scope that is to be unwound. Put the offset in EDI.
- movl ST_TRYLEVEL(%esi), %edi
- lea (%edi, %edi, 2), %edi
- shll $2, %edi
- addl %esi, %edi
-
- // If this is not a termination handler then skip it
- cmpl $0, ST_FILTER(%edi)
- jne .lu2_next_scope
-
- // Save the previous try-level in the exception registration structure
- movl ST_TRYLEVEL(%edi), %eax
- movl %eax, ER_TRYLEVEL(%ebx)
-
- // Fetch the address of the termination handler
- movl ST_HANDLER(%edi), %eax
-
- // Termination handlers may trash all registers so save the
- // important ones and then call the handler
- pushl %edx
- call *%eax
-
- // Get our base pointer back
- popl %edx
-
- jmp .lu2_next_scope
-
-.lu2_done:
-
- // FIXME: Tear down the EXCEPTION_REGISTRATION entry setup to protect
- // the unwinding
-
- //movl %esi, %esp
- //popl %ebp
- ret
-
-#define EH3_DISPCONTEXT 0x14
-#define EH3_CONTEXT 0x10
-#define EH3_REGFRAME 0x0C
-#define EH3_ERECORD 0x08
-
-// Parameters:
-// [ESP+14h] - PVOID DispatcherContext
-// [ESP+10h] - PCONTEXT Context
-// [ESP+0Ch] - PEXCEPTION_REGISTRATION RegistrationFrame
-// [ESP+08h] - PEXCEPTION_RECORD ExceptionRecord
-// Registers:
-// Unknown
-// Returns:
-// EXCEPTION_DISPOSITION - How this handler handled the exception
-// Notes:
-// Try to find an exception handler that will handle the exception.
-// Traverse the entries in the scopetable that is associated with the
-// exception registration passed as a parameter to this function.
-// If an exception handler that will handle the exception is found, it
-// is called and this function never returns
-__except_handler3:
- // Setup our call frame so we can access parameters using EBP
- pushl %ebp // Standard ESP in frame (considered part of EXCEPTION_REGISTRATION)
- movl %esp, %ebp
-
- // Don't trust the direction flag to be cleared
- cld
-
- // Either we're called to handle an exception or we're called to unwind
- movl EH3_ERECORD(%ebp), %eax
- testl $EXCEPTION_UNWIND_MODE, EREC_FLAGS(%eax)
- jnz .eh3_unwind
-
- // Keep a pointer to the exception registration in EBX
- movl EH3_REGFRAME(%ebp), %ebx
-
- // Build an EXCEPTION_POINTERS structure on the stack and store it's
- // address in the EXCEPTION_REGISTRATION structure
- movl EH3_CONTEXT(%esp), %eax
- pushl %ebx // Registration frame
- pushl %eax // Context
- movl %esp, ER_EPOINTERS(%ebx) // Pointer to EXCEPTION_REGISTRATION on the stack
-
- // Keep current try-level in EDI
- movl ER_TRYLEVEL(%ebx), %edi
-
- // Keep a pointer to the scopetable in ESI
- movl ER_SCOPETABLE(%ebx), %esi
-
-.eh3_next_scope:
-
- // If we have reached the end of the chain then exit
- cmpl $-1, %edi
- je .eh3_search
-
- // Compute the offset of the entry in the scopetable and store
- // the absolute address in EAX
- lea (%edi, %edi, 2), %eax
- shll $2, %eax
- addl %esi, %eax
-
- // Fetch the address of the filter routine
- movl ST_FILTER(%eax), %eax
-
- // If this is a termination handler then skip it
- cmpl $0, %eax
- je .eh3_continue
-
- // Filter routines may trash all registers so save the important
- // ones before restoring the call frame ebp and calling the handler
- pushl %ebp
- pushl %edi // Stop try-level
- lea ER_EBP(%ebx), %ebp
- call *%eax
- popl %edi // Stop try-level
- popl %ebp
-
- // Reload EBX with registration frame address
- movl EH3_REGFRAME(%ebp), %ebx
-
- // Be more flexible here by checking if the return value is less than
- // zero, equal to zero, or larger than zero instead of the defined
- // values:
- // -1 (EXCEPTION_CONTINUE_EXECUTION)
- // 0 (EXCEPTION_CONTINUE_SEARCH)
- // +1 (EXCEPTION_EXECUTE_HANDLER)
- orl %eax, %eax
- jz .eh3_continue
- js .eh3_dismiss
-
- // Filter returned: EXCEPTION_EXECUTE_HANDLER
-
- // Ask the OS to perform global unwinding.
- pushl %edi // Save stop try-level
- pushl %ebx // Save registration frame address
- pushl %ebx // Registration frame address
- call __global_unwind2
- popl %eax // Remove parameter to __global_unwind2
- popl %ebx // Restore registration frame address
- popl %edi // Restore stop try-level
-
- // Change the context structure so _except_finish is called in the
- // correct context since we return ExceptionContinueExecution.
- movl EH3_CONTEXT(%ebp), %eax
-
- movl %edi, CONTEXT_EDI(%eax) // Stop try-level
- movl %ebx, CONTEXT_EBX(%eax) // Registration frame address
- movl $_except_finish, CONTEXT_EIP(%eax)
-
- movl $ExceptionContinueExecution, %eax
- jmp .eh3_return
-
- // Filter returned: EXCEPTION_CONTINUE_SEARCH
-.eh3_continue:
-
- // Reload ESI because the filter routine may have trashed it
- movl ER_SCOPETABLE(%ebx), %esi
-
- // Go one try-level closer to the top
- lea (%edi, %edi, 2), %edi
- shll $2, %edi
- addl %esi, %edi
- movl ST_TRYLEVEL(%edi), %edi
-
- jmp .eh3_next_scope
-
- // Filter returned: EXCEPTION_CONTINUE_EXECUTION
- // Continue execution like nothing happened
-.eh3_dismiss:
- movl $ExceptionContinueExecution, %eax
- jmp .eh3_return
-
- // Tell the OS to search for another handler that will handle the exception
-.eh3_search:
-
- movl $ExceptionContinueSearch, %eax
- jmp .eh3_return
-
- // Perform local unwinding
-.eh3_unwind:
-
- testl $EXCEPTION_TARGET_UNWIND, EREC_FLAGS(%eax)
- jnz .eh3_return
-
- // Save some important registers
- pushl %ebp
-
- lea ER_EBP(%ebx), %ebp
- pushl $-1
- pushl %ebx
- call __local_unwind2
- addl $8, %esp
-
- // Restore some important registers
- popl %ebp
-
- movl $ExceptionContinueSearch, %eax
-
- // Get me out of here
-.eh3_return:
-
- movl %ebp, %esp
- popl %ebp
- ret
-
-// Parameters:
-// None
-// Registers:
-// EBX - Pointer to exception registration structure
-// EDI - Stop try-level
-// Returns:
-// -
-// Notes:
-// -
-_except_finish:
-
- // Setup EBP for the exception handler. By doing this the exception
- // handler can access local variables as normal
- lea ER_EBP(%ebx), %ebp
-
- // Save some important registers
- pushl %ebp
- pushl %ebx
- pushl %edi
-
- // Stop try-level
- pushl %edi
-
- // Pointer to exception registration structure
- pushl %ebx
- call __local_unwind2
- addl $8, %esp
-
- // Restore some important registers
- popl %edi
- popl %ebx
- popl %ebp
-
- // Keep a pointer to the scopetable in ESI
- movl ER_SCOPETABLE(%ebx), %esi
-
- // Compute the offset of the entry in the scopetable and store
- // the absolute address in EDI
- lea (%edi, %edi, 2), %edi
- shll $2, %edi
- addl %esi, %edi
-
- // Set the current try-level to the previous try-level and call
- // the exception handler
- movl ST_TRYLEVEL(%edi), %eax
- movl %eax, ER_TRYLEVEL(%ebx)
- movl ST_HANDLER(%edi), %eax
-
- call *%eax
-
- // We should never get here
- ret
-
-// Copied from Wine.
-__EH_prolog:
- pushl $-1
- pushl %eax
- pushl %fs:0
- movl %esp, %fs:0
- movl 12(%esp), %eax
- movl %ebp, 12(%esp)
- leal 12(%esp), %ebp
- pushl %eax
- ret
Removed: trunk/reactos/lib/crt/except/unwind.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/crt/except/unwind.c?re…
==============================================================================
--- trunk/reactos/lib/crt/except/unwind.c (original)
+++ trunk/reactos/lib/crt/except/unwind.c (removed)
@@ -1,72 +1,0 @@
-#define WIN32_NO_STATUS
-#include <precomp.h>
-#include <windows.h>
-#define NTOS_MODE_USER
-#include <ndk/umtypes.h>
-#include <ndk/extypes.h>
-#include <ndk/rtlfuncs.h>
-
-/*
- * @implemented
- */
-void __cdecl
-_global_unwind2(PEXCEPTION_REGISTRATION_RECORD RegistrationFrame)
-{
-#ifdef __GNUC__
- RtlUnwind(RegistrationFrame, &&__ret_label, NULL, 0);
-__ret_label:
- // return is important
- return;
-#else
-#endif
-}
-
-
-/* VC++ extensions to Win32 SEH */
-typedef struct _SCOPETABLE
-{
- int previousTryLevel;
- int (*lpfnFilter)(PEXCEPTION_POINTERS);
- int (*lpfnHandler)(void);
-} SCOPETABLE, *PSCOPETABLE;
-
-typedef struct _MSVCRT_EXCEPTION_FRAME
-{
- PEXCEPTION_REGISTRATION_RECORD *prev;
- void (*handler)(PEXCEPTION_RECORD, PEXCEPTION_REGISTRATION_RECORD,
- PCONTEXT, PEXCEPTION_RECORD);
- PSCOPETABLE scopetable;
- int trylevel;
- int _ebp;
- PEXCEPTION_POINTERS xpointers;
-} MSVCRT_EXCEPTION_FRAME;
-
-
-typedef struct __JUMP_BUFFER
-{
- unsigned long Ebp;
- unsigned long Ebx;
- unsigned long Edi;
- unsigned long Esi;
- unsigned long Esp;
- unsigned long Eip;
- unsigned long Registration;
- unsigned long TryLevel;
- /* Start of new struct members */
- unsigned long Cookie;
- unsigned long UnwindFunc;
- unsigned long UnwindData[6];
-} _JUMP_BUFFER;
-
-void
-_local_unwind2(MSVCRT_EXCEPTION_FRAME *RegistrationFrame,
- LONG TryLevel);
-
-/*
- * @implemented
-*/
-
-void __stdcall _seh_longjmp_unwind(_JUMP_BUFFER *jmp)
-{
- _local_unwind2((MSVCRT_EXCEPTION_FRAME*) jmp->Registration, jmp->TryLevel);
-}
Removed: trunk/reactos/lib/crt/float/clearfp.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/crt/float/clearfp.c?re…
==============================================================================
--- trunk/reactos/lib/crt/float/clearfp.c (original)
+++ trunk/reactos/lib/crt/float/clearfp.c (removed)
@@ -1,29 +1,0 @@
-/*
- * COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS system libraries
- * FILE: lib/crt/??????
- * PURPOSE: Unknown
- * PROGRAMER: Unknown
- * UPDATE HISTORY:
- * 25/11/05: Added license header
- */
-
-#include <precomp.h>
-
-unsigned int _statusfp( void );
-
-/*
- * @implemented
- */
-unsigned int _clearfp (void)
-{
- unsigned short __res = _statusfp();
-#ifdef __GNUC__
-__asm__ __volatile__ (
- "fclex \n\t"
- );
-#else
-#endif /*__GNUC__*/
- return __res;
-}
-
Removed: trunk/reactos/lib/crt/float/cntrlfp.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/crt/float/cntrlfp.c?re…
==============================================================================
--- trunk/reactos/lib/crt/float/cntrlfp.c (original)
+++ trunk/reactos/lib/crt/float/cntrlfp.c (removed)
@@ -1,174 +1,0 @@
-/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
-
-#include <precomp.h>
-
-#define X87_CW_IM (1<<0) /* Invalid operation mask */
-#define X87_CW_DM (1<<1) /* Denormal operand mask */
-#define X87_CW_ZM (1<<2) /* Zero divide mask */
-#define X87_CW_OM (1<<3) /* Overflow mask */
-#define X87_CW_UM (1<<4) /* Underflow mask */
-#define X87_CW_PM (1<<5) /* Precision mask */
-
-#define X87_CW_PC_MASK (3<<8) /* precision control mask */
-#define X87_CW_PC24 (0<<8) /* 24 bit precision */
-#define X87_CW_PC53 (2<<8) /* 53 bit precision */
-#define X87_CW_PC64 (3<<8) /* 64 bit precision */
-
-#define X87_CW_RC_MASK (3<<10) /* rounding control mask */
-#define X87_CW_RC_NEAREST (0<<10) /* round to nearest */
-#define X87_CW_RC_DOWN (1<<10) /* round down */
-#define X87_CW_RC_UP (2<<10) /* round up */
-#define X87_CW_RC_ZERO (3<<10) /* round toward zero (chop) */
-
-#define X87_CW_IC (1<<12) /* infinity control flag */
-
-/*
- * @implemented
- */
-unsigned int _controlfp(unsigned int unNew, unsigned int unMask)
-{
- return _control87(unNew,unMask);
-}
-
-/*
- * @implemented
- */
-unsigned int _control87(unsigned int unNew, unsigned int unMask)
-{
- unsigned int FpuCw;
- unsigned int DummyCw = 0;
-
- /* get the controlword */
- asm volatile("fstcw %0\n\t" : "=m"(FpuCw));
- FpuCw &= 0x0000ffff;
-
- /* translate it into _control87 format */
- if (FpuCw & X87_CW_IM)
- DummyCw |= _EM_INVALID;
- if (FpuCw & X87_CW_DM)
- DummyCw |= _EM_DENORMAL;
- if (FpuCw & X87_CW_ZM)
- DummyCw |= _EM_ZERODIVIDE;
- if (FpuCw & X87_CW_OM)
- DummyCw |= _EM_OVERFLOW;
- if (FpuCw & X87_CW_UM)
- DummyCw |= _EM_UNDERFLOW;
- if (FpuCw & X87_CW_PM)
- DummyCw |= _EM_INEXACT;
-
- switch (FpuCw & X87_CW_PC_MASK)
- {
- case X87_CW_PC24:
- DummyCw |= _PC_24;
- break;
- case X87_CW_PC53:
- DummyCw |= _PC_53;
- break;
- case X87_CW_PC64:
- DummyCw |= _PC_64;
- break;
- }
-
- switch (FpuCw & X87_CW_RC_MASK)
- {
- case X87_CW_RC_NEAREST:
- DummyCw |= _RC_NEAR;
- break;
- case X87_CW_RC_DOWN:
- DummyCw |= _RC_DOWN;
- break;
- case X87_CW_RC_UP:
- DummyCw |= _RC_UP;
- break;
- case X87_CW_RC_ZERO:
- DummyCw |= _RC_CHOP;
- break;
- }
-
- /* unset (un)masked bits */
- DummyCw &= ~unMask;
- unNew &= unMask;
-
- /* set new bits */
- DummyCw |= unNew;
-
- /* translate back into x87 format
- * FIXME: translate infinity control!
- */
- FpuCw = 0;
- if (DummyCw & _EM_INVALID)
- FpuCw |= X87_CW_IM;
- if (DummyCw & _EM_DENORMAL)
- FpuCw |= X87_CW_DM;
- if (DummyCw & _EM_ZERODIVIDE)
- FpuCw |= X87_CW_ZM;
- if (DummyCw & _EM_OVERFLOW)
- FpuCw |= X87_CW_OM;
- if (DummyCw & _EM_UNDERFLOW)
- FpuCw |= X87_CW_UM;
- if (DummyCw & _EM_INEXACT)
- FpuCw |= X87_CW_PM;
-
- switch (DummyCw & _MCW_PC)
- {
- case _PC_24:
- FpuCw |= X87_CW_PC24;
- break;
- case _PC_53:
- FpuCw |= X87_CW_PC53;
- break;
- case _PC_64:
- default:
- FpuCw |= X87_CW_PC64;
- break;
- }
-
- switch (DummyCw & _MCW_RC)
- {
- case _RC_NEAR:
- FpuCw |= X87_CW_RC_NEAREST;
- break;
- case _RC_DOWN:
- FpuCw |= X87_CW_RC_DOWN;
- break;
- case _RC_UP:
- FpuCw |= X87_CW_RC_UP;
- break;
- case _RC_CHOP:
- FpuCw |= X87_CW_RC_ZERO;
- break;
- }
-
- /* set controlword */
- asm volatile("fldcw %0" : : "m"(FpuCw));
-
- return DummyCw;
-
-#if 0 /* The follwing is the original code, broken I think! -blight */
-register unsigned int __res;
-#ifdef __GNUC__
-__asm__ __volatile__ (
- "pushl %%eax \n\t" /* make room on stack */
- "fstcw (%%esp) \n\t"
- "fwait \n\t"
- "popl %%eax \n\t"
- "andl $0xffff, %%eax \n\t" /* OK; we have the old value ready */
-
- "movl %1, %%ecx \n\t"
- "notl %%ecx \n\t"
- "andl %%eax, %%ecx \n\t" /* the bits we want to keep */
-
- "movl %2, %%edx \n\t"
- "andl %1, %%edx \n\t" /* the bits we want to change */
-
- "orl %%ecx, %%edx\n\t" /* the new value */
- "pushl %%edx \n\t"
- "fldcw (%%esp) \n\t"
- "popl %%edx \n\t"
-
- :"=a" (__res):"r" (unNew),"r" (unMask): "dx", "cx");
-#else
-#endif /*__GNUC__*/
- return __res;
-#endif
-}
Removed: trunk/reactos/lib/crt/float/logb.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/crt/float/logb.c?rev=2…
==============================================================================
--- trunk/reactos/lib/crt/float/logb.c (original)
+++ trunk/reactos/lib/crt/float/logb.c (removed)
@@ -1,34 +1,0 @@
-/* Math functions for i387.
- Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by John C. Bowman <bowman(a)ipp-garching.mpg.de>, 1995.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include <precomp.h>
-
-double _logb (double __x)
-{
- register double __val;
-#ifdef __GNUC__
- register double __junk;
- __asm __volatile__
- ("fxtract\n\t"
- : "=t" (__junk), "=u" (__val) : "0" (__x));
-#else
-#endif /*__GNUC__*/
- return __val;
-}
Removed: trunk/reactos/lib/crt/float/statfp.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/crt/float/statfp.c?rev…
==============================================================================
--- trunk/reactos/lib/crt/float/statfp.c (original)
+++ trunk/reactos/lib/crt/float/statfp.c (removed)
@@ -1,29 +1,0 @@
-/*
- * COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS system libraries
- * FILE: lib/crt/??????
- * PURPOSE: Unknown
- * PROGRAMER: Unknown
- * UPDATE HISTORY:
- * 25/11/05: Added license header
- */
-
-#include <precomp.h>
-
-/*
- * @implemented
- */
-unsigned int _statusfp (void)
-{
-
-register unsigned short __res;
-#ifdef __GNUC__
-__asm__ __volatile__ (
- "fstsw %0 \n\t"
-// "movzwl %ax, %eax"
- :"=a" (__res)
- );
-#else
-#endif /*__GNUC__*/
- return __res;
-}
Removed: trunk/reactos/lib/crt/math/atan2.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/crt/math/atan2.c?rev=2…
==============================================================================
--- trunk/reactos/lib/crt/math/atan2.c (original)
+++ trunk/reactos/lib/crt/math/atan2.c (removed)
@@ -1,21 +1,0 @@
-
-#include <math.h>
-
-double atan2 (double __y, double __x);
-
-/*
- * @implemented
- */
-double atan2 (double __y, double __x)
-{
- register double __val;
-#ifdef __GNUC__
- __asm __volatile__
- ("fpatan\n\t"
- "fld %%st(0)"
- : "=t" (__val) : "0" (__x), "u" (__y));
-#else
- __val = linkme_atan2(__x, __y);
-#endif /*__GNUC__*/
- return __val;
-}
Removed: trunk/reactos/lib/crt/math/exp.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/crt/math/exp.c?rev=237…
==============================================================================
--- trunk/reactos/lib/crt/math/exp.c (original)
+++ trunk/reactos/lib/crt/math/exp.c (removed)
@@ -1,47 +1,0 @@
-/* Math functions for i387.
- Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by John C. Bowman <bowman(a)ipp-garching.mpg.de>, 1995.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include <math.h>
-
-double exp (double __x);
-
-double exp (double __x)
-{
-#ifdef __GNUC__
- register double __value, __exponent;
- __asm __volatile__
- ("fldl2e # e^x = 2^(x * log2(e))\n\t"
- "fmul %%st(1) # x * log2(e)\n\t"
- "fst %%st(1)\n\t"
- "frndint # int(x * log2(e))\n\t"
- "fxch\n\t"
- "fsub %%st(1) # fract(x * log2(e))\n\t"
- "f2xm1 # 2^(fract(x * log2(e))) - 1\n\t"
- : "=t" (__value), "=u" (__exponent) : "0" (__x));
- __value += 1.0;
- __asm __volatile__
- ("fscale"
- : "=t" (__value) : "0" (__value), "u" (__exponent));
-
- return __value;
-#else
- return linkme_exp(__x);
-#endif /*__GNUC__*/
-}
Removed: trunk/reactos/lib/crt/math/fmod.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/crt/math/fmod.c?rev=23…
==============================================================================
--- trunk/reactos/lib/crt/math/fmod.c (original)
+++ trunk/reactos/lib/crt/math/fmod.c (removed)
@@ -1,39 +1,0 @@
-/* Math functions for i387.
- Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by John C. Bowman <bowman(a)ipp-garching.mpg.de>, 1995.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include <math.h>
-
-double fmod (double __x, double __y);
-
-double fmod (double __x, double __y)
-{
- register double __val;
-#ifdef __GNUC__
- __asm __volatile__
- ("1: fprem\n\t"
- "fstsw %%ax\n\t"
- "sahf\n\t"
- "jp 1b"
- : "=t" (__val) : "0" (__x), "u" (__y) : "ax", "cc");
-#else
- __val = linkme_fmod(__x, __y);
-#endif /*__GNUC__*/
- return __val;
-}
Removed: trunk/reactos/lib/crt/math/ldexp.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/crt/math/ldexp.c?rev=2…
==============================================================================
--- trunk/reactos/lib/crt/math/ldexp.c (original)
+++ trunk/reactos/lib/crt/math/ldexp.c (removed)
@@ -1,36 +1,0 @@
-/* Math functions for i387.
- Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by John C. Bowman <bowman(a)ipp-garching.mpg.de>, 1995.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include <math.h>
-
-double ldexp (double __x, int __y);
-
-double ldexp (double __x, int __y)
-{
- register double __val;
-#ifdef __GNUC__
- __asm __volatile__
- ("fscale"
- : "=t" (__val) : "0" (__x), "u" ((double) __y));
-#else
- __val = linkme_ldexp(__x, __y);
-#endif /*__GNUC__*/
- return __val;
-}
Author: greatlrd
Date: Tue Aug 29 21:51:13 2006
New Revision: 23784
URL: http://svn.reactos.org/svn/reactos?rev=23784&view=rev
Log:
1. Rewote atan.c to pure asm
2. Rewote log10 to pure asm
3. Delete unuse c/asm files like ceil, cos, fabs, flor, sin, sqrt, and tan
4. Switch to rtl asm version of pow
5. Follow need be convert to asm atan2, exp, fmod, ldexp
6. Follow need c version atan2, exp, fmod, ldexp, atan, log10, pow
7. Add i386 arch dections in rbuild for asm/inline asm so we using only i386 asm on x86 cpu
Added:
trunk/reactos/lib/crt/math/i386/atan_asm.s
trunk/reactos/lib/crt/math/i386/log10_asm.s
trunk/reactos/lib/crt/math/pow_asm.c
Removed:
trunk/reactos/lib/crt/math/atan.c
trunk/reactos/lib/crt/math/ceil.c
trunk/reactos/lib/crt/math/cos.c
trunk/reactos/lib/crt/math/fabs.c
trunk/reactos/lib/crt/math/floor.c
trunk/reactos/lib/crt/math/i386/ceil_asm.s
trunk/reactos/lib/crt/math/i386/cos_asm.s
trunk/reactos/lib/crt/math/i386/fabs_asm.s
trunk/reactos/lib/crt/math/i386/floor_asm.s
trunk/reactos/lib/crt/math/i386/sin_asm.s
trunk/reactos/lib/crt/math/i386/sqrt_asm.s
trunk/reactos/lib/crt/math/i386/tan_asm.s
trunk/reactos/lib/crt/math/log.c
trunk/reactos/lib/crt/math/log10.c
trunk/reactos/lib/crt/math/math.c
trunk/reactos/lib/crt/math/pow.c
trunk/reactos/lib/crt/math/sin.c
trunk/reactos/lib/crt/math/sqrt.c
trunk/reactos/lib/crt/math/tan.c
Modified:
trunk/reactos/lib/crt/crt.rbuild
Modified: trunk/reactos/lib/crt/crt.rbuild
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/crt/crt.rbuild?rev=237…
==============================================================================
--- trunk/reactos/lib/crt/crt.rbuild (original)
+++ trunk/reactos/lib/crt/crt.rbuild Tue Aug 29 21:51:13 2006
@@ -105,27 +105,38 @@
<directory name="math">
<file>acos.c</file>
<file>adjust.c</file>
- <file>asin.c</file>
- <file>atan2.c</file>
+ <file>asin.c</file>
<file>cabs.c</file>
- <file>cosh.c</file>
- <file>exp.c</file>
- <file>fmod.c</file>
+ <file>cosh.c</file>
<file>frexp.c</file>
<file>huge_val.c</file>
<file>hypot.c</file>
<file>j0_y0.c</file>
<file>j1_y1.c</file>
- <file>jn_yn.c</file>
- <file>ldexp.c</file>
- <file>log10.c</file>
+ <file>jn_yn.c</file>
<file>modf.c</file>
<file>s_modf.c</file>
- <file>pow.c</file>
<file>sinh.c</file>
<file>stubs.c</file>
<file>tanh.c</file>
- </directory>
+ <file>pow_asm.c</file>
+
+ <if property="ARCH" value="i386">
+ <file>atan2.c</file>
+ <file>exp.c</file>
+ <file>fmod.c</file>
+ <file>ldexp.c</file>
+
+ <directory name="i386">
+ <file>atan_asm.s</file>
+ <file>pow_asm.s</file>
+ <file>log10_asm.s</file>
+ </directory>
+ </if>
+ <ifnot property="ARCH" value="i386">
+ </ifnot>
+ </directory>
+
<directory name="mbstring">
<file>hanzen.c</file>
<file>ischira.c</file>
Removed: trunk/reactos/lib/crt/math/atan.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/crt/math/atan.c?rev=23…
==============================================================================
--- trunk/reactos/lib/crt/math/atan.c (original)
+++ trunk/reactos/lib/crt/math/atan.c (removed)
@@ -1,37 +1,0 @@
-/* Math functions for i387.
- Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by John C. Bowman <bowman(a)ipp-garching.mpg.de>, 1995.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include <math.h>
-
-double atan (double __x);
-
-double atan (double __x)
-{
- register double __value;
-#ifdef __GNUC__
- __asm __volatile__
- ("fld1\n\t"
- "fpatan"
- : "=t" (__value) : "0" (__x));
-#else
- __value = linkme_atan(__x);
-#endif /*__GNUC__*/
- return __value;
-}
Removed: trunk/reactos/lib/crt/math/ceil.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/crt/math/ceil.c?rev=23…
==============================================================================
--- trunk/reactos/lib/crt/math/ceil.c (original)
+++ trunk/reactos/lib/crt/math/ceil.c (removed)
@@ -1,21 +1,0 @@
-#include <math.h>
-
-/*
- * @implemented
- */
-double ceil (double __x)
-{
- register double __value;
-#ifdef __GNUC__
- __volatile unsigned short int __cw, __cwtmp;
-
- __asm __volatile ("fnstcw %0" : "=m" (__cw));
- __cwtmp = (__cw & 0xf3ff) | 0x0800; /* rounding up */
- __asm __volatile ("fldcw %0" : : "m" (__cwtmp));
- __asm __volatile ("frndint" : "=t" (__value) : "0" (__x));
- __asm __volatile ("fldcw %0" : : "m" (__cw));
-#else
- __value = linkme_ceil(__x);
-#endif /*__GNUC__*/
- return __value;
-}
Removed: trunk/reactos/lib/crt/math/cos.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/crt/math/cos.c?rev=237…
==============================================================================
--- trunk/reactos/lib/crt/math/cos.c (original)
+++ trunk/reactos/lib/crt/math/cos.c (removed)
@@ -1,19 +1,0 @@
-#include <math.h>
-
-double cos (double __x);
-
-/*
- * @implemented
- */
-double cos (double __x)
-{
- register double __value;
-#ifdef __GNUC__
- __asm __volatile__
- ("fcos"
- : "=t" (__value): "0" (__x));
-#else
- __value = linkme_cos(__x);
-#endif /*__GNUC__*/
- return __value;
-}
Removed: trunk/reactos/lib/crt/math/fabs.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/crt/math/fabs.c?rev=23…
==============================================================================
--- trunk/reactos/lib/crt/math/fabs.c (original)
+++ trunk/reactos/lib/crt/math/fabs.c (removed)
@@ -1,36 +1,0 @@
-/* Math functions for i387.
- Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by John C. Bowman <bowman(a)ipp-garching.mpg.de>, 1995.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include <math.h>
-
-double fabs (double __x);
-
-double fabs (double __x)
-{
- register double __value;
-#ifdef __GNUC__
- __asm __volatile__
- ("fabs"
- : "=t" (__value) : "0" (__x));
-#else
- __value = linkme_fabs(__x);
-#endif /*__GNUC__*/
- return __value;
-}
Removed: trunk/reactos/lib/crt/math/floor.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/crt/math/floor.c?rev=2…
==============================================================================
--- trunk/reactos/lib/crt/math/floor.c (original)
+++ trunk/reactos/lib/crt/math/floor.c (removed)
@@ -1,40 +1,0 @@
-/* Math functions for i387.
- Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by John C. Bowman <bowman(a)ipp-garching.mpg.de>, 1995.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include <math.h>
-
-double floor (double __x);
-
-double floor (double __x)
-{
- register double __value;
-#ifdef __GNUC__
- __volatile unsigned short int __cw, __cwtmp;
-
- __asm __volatile ("fnstcw %0" : "=m" (__cw));
- __cwtmp = (__cw & 0xf3ff) | 0x0400; /* rounding down */
- __asm __volatile ("fldcw %0" : : "m" (__cwtmp));
- __asm __volatile ("frndint" : "=t" (__value) : "0" (__x));
- __asm __volatile ("fldcw %0" : : "m" (__cw));
-#else
- __value = linkme_floor(__x);
-#endif /*__GNUC__*/
- return __value;
-}
Added: trunk/reactos/lib/crt/math/i386/atan_asm.s
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/crt/math/i386/atan_asm…
==============================================================================
--- trunk/reactos/lib/crt/math/i386/atan_asm.s (added)
+++ trunk/reactos/lib/crt/math/i386/atan_asm.s Tue Aug 29 21:51:13 2006
@@ -1,0 +1,22 @@
+/*
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS kernel
+ * PURPOSE:
+ * FILE:
+ * PROGRAMER: Magnus Olsen (magnus(a)greatlord.com)
+ *
+ */
+
+.globl _atan
+
+.intel_syntax noprefix
+
+/* FUNCTIONS ***************************************************************/
+
+_atan:
+ push ebp
+ mov ebp,esp
+ fld qword ptr [ebp+8]
+ fpatan
+ pop ebp
+ ret
Removed: trunk/reactos/lib/crt/math/i386/ceil_asm.s
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/crt/math/i386/ceil_asm…
==============================================================================
--- trunk/reactos/lib/crt/math/i386/ceil_asm.s (original)
+++ trunk/reactos/lib/crt/math/i386/ceil_asm.s (removed)
@@ -1,58 +1,0 @@
-/*
- * COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS kernel
- * PURPOSE: Run-Time Library
- * FILE: lib/rtl/i386/ceil.S
- * PROGRAMER: Alex Ionescu (alex(a)relsoft.net)
- * Eric Kohl (ekohl(a)rz-online.de)
- *
- * Copyright (C) 2002 Michael Ringgaard.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the project nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
-
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES// LOSS OF USE, DATA, OR PROFITS// OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-.globl _ceil
-
-.intel_syntax noprefix
-
-/* FUNCTIONS ***************************************************************/
-
-_ceil:
- push ebp
- mov ebp,esp
- sub esp,4 // Allocate temporary space
- fld qword ptr [ebp+8] // Load real from stack
- fstcw [ebp-2] // Save control word
- fclex // Clear exceptions
- mov word ptr [ebp-4],0xb63 // Rounding control word
- fldcw [ebp-4] // Set new rounding control
- frndint // Round to integer
- fclex // Clear exceptions
- fldcw [ebp-2] // Restore control word
- mov esp,ebp // Deallocate temporary space
- pop ebp
- ret
Removed: trunk/reactos/lib/crt/math/i386/cos_asm.s
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/crt/math/i386/cos_asm.…
==============================================================================
--- trunk/reactos/lib/crt/math/i386/cos_asm.s (original)
+++ trunk/reactos/lib/crt/math/i386/cos_asm.s (removed)
@@ -1,50 +1,0 @@
-/*
- * COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS kernel
- * PURPOSE: Run-Time Library
- * FILE: lib/rtl/i386/cos.S
- * PROGRAMER: Alex Ionescu (alex(a)relsoft.net)
- * Eric Kohl (ekohl(a)rz-online.de)
- *
- * Copyright (C) 2002 Michael Ringgaard.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the project nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
-
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES// LOSS OF USE, DATA, OR PROFITS// OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-.globl _cos
-
-.intel_syntax noprefix
-
-/* FUNCTIONS ***************************************************************/
-
-_cos:
- push ebp
- mov ebp,esp // Point to the stack frame
- fld qword ptr [ebp+8] // Load real from stack
- fcos // Take the cosine
- pop ebp
- ret
Removed: trunk/reactos/lib/crt/math/i386/fabs_asm.s
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/crt/math/i386/fabs_asm…
==============================================================================
--- trunk/reactos/lib/crt/math/i386/fabs_asm.s (original)
+++ trunk/reactos/lib/crt/math/i386/fabs_asm.s (removed)
@@ -1,50 +1,0 @@
-/*
- * COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS kernel
- * PURPOSE: Run-Time Library
- * FILE: lib/rtl/i386/fabs.S
- * PROGRAMER: Alex Ionescu (alex(a)relsoft.net)
- * Eric Kohl (ekohl(a)rz-online.de)
- *
- * Copyright (C) 2002 Michael Ringgaard.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the project nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
-
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES// LOSS OF USE, DATA, OR PROFITS// OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-.globl _fabs
-
-.intel_syntax noprefix
-
-/* FUNCTIONS ***************************************************************/
-
-_fabs:
- push ebp
- mov ebp,esp
- fld qword ptr [ebp+8] // Load real from stack
- fabs // Take the absolute value
- pop ebp
- ret
Removed: trunk/reactos/lib/crt/math/i386/floor_asm.s
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/crt/math/i386/floor_as…
==============================================================================
--- trunk/reactos/lib/crt/math/i386/floor_asm.s (original)
+++ trunk/reactos/lib/crt/math/i386/floor_asm.s (removed)
@@ -1,58 +1,0 @@
-/*
- * COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS kernel
- * PURPOSE: Run-Time Library
- * FILE: lib/rtl/i386/floor.S
- * PROGRAMER: Alex Ionescu (alex(a)relsoft.net)
- * Eric Kohl (ekohl(a)rz-online.de)
- *
- * Copyright (C) 2002 Michael Ringgaard.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the project nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
-
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES// LOSS OF USE, DATA, OR PROFITS// OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-.globl _floor
-
-.intel_syntax noprefix
-
-/* FUNCTIONS ***************************************************************/
-
-_floor:
- push ebp
- mov ebp,esp
- sub esp,4 // Allocate temporary space
- fld qword ptr [ebp+8] // Load real from stack
- fstcw [ebp-2] // Save control word
- fclex // Clear exceptions
- mov word ptr [ebp-4],0x763 // Rounding control word
- fldcw [ebp-4] // Set new rounding control
- frndint // Round to integer
- fclex // Clear exceptions
- fldcw [ebp-2] // Restore control word
- mov esp,ebp
- pop ebp
- ret
Added: trunk/reactos/lib/crt/math/i386/log10_asm.s
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/crt/math/i386/log10_as…
==============================================================================
--- trunk/reactos/lib/crt/math/i386/log10_asm.s (added)
+++ trunk/reactos/lib/crt/math/i386/log10_asm.s Tue Aug 29 21:51:13 2006
@@ -1,0 +1,25 @@
+
+ /*
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS kernel
+ * PURPOSE:
+ * FILE:
+ * PROGRAMER: Magnus Olsen (magnus(a)greatlord.com)
+ *
+ */
+
+.globl _log10
+
+.intel_syntax noprefix
+
+/* FUNCTIONS ***************************************************************/
+
+_log10:
+ push ebp
+ mov ebp,esp
+ fld qword ptr [ebp+8]
+ fldlg2
+ fyl2x
+ pop ebp
+ ret
+
Removed: trunk/reactos/lib/crt/math/i386/sin_asm.s
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/crt/math/i386/sin_asm.…
==============================================================================
--- trunk/reactos/lib/crt/math/i386/sin_asm.s (original)
+++ trunk/reactos/lib/crt/math/i386/sin_asm.s (removed)
@@ -1,50 +1,0 @@
-/*
- * COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS kernel
- * PURPOSE: Run-Time Library
- * FILE: lib/rtl/i386/sin.S
- * PROGRAMER: Alex Ionescu (alex(a)relsoft.net)
- * Eric Kohl (ekohl(a)rz-online.de)
- *
- * Copyright (C) 2002 Michael Ringgaard.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the project nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
-
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES// LOSS OF USE, DATA, OR PROFITS// OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-.globl _sin
-
-.intel_syntax noprefix
-
-/* FUNCTIONS ***************************************************************/
-
-_sin:
- push ebp // Save register bp
- mov ebp,esp // Point to the stack frame
- fld qword ptr [ebp+8] // Load real from stack
- fsin // Take the sine
- pop ebp // Restore register bp
- ret
Removed: trunk/reactos/lib/crt/math/i386/sqrt_asm.s
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/crt/math/i386/sqrt_asm…
==============================================================================
--- trunk/reactos/lib/crt/math/i386/sqrt_asm.s (original)
+++ trunk/reactos/lib/crt/math/i386/sqrt_asm.s (removed)
@@ -1,50 +1,0 @@
-/*
- * COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS kernel
- * PURPOSE: Run-Time Library
- * FILE: lib/rtl/i386/sqrt.S
- * PROGRAMER: Alex Ionescu (alex(a)relsoft.net)
- * Eric Kohl (ekohl(a)rz-online.de)
- *
- * Copyright (C) 2002 Michael Ringgaard.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the project nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
-
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES// LOSS OF USE, DATA, OR PROFITS// OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-.globl _sqrt
-
-.intel_syntax noprefix
-
-/* FUNCTIONS ***************************************************************/
-
-_sqrt:
- push ebp
- mov ebp,esp
- fld qword ptr [ebp+8] // Load real from stack
- fsqrt // Take the square root
- pop ebp
- ret
Removed: trunk/reactos/lib/crt/math/i386/tan_asm.s
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/crt/math/i386/tan_asm.…
==============================================================================
--- trunk/reactos/lib/crt/math/i386/tan_asm.s (original)
+++ trunk/reactos/lib/crt/math/i386/tan_asm.s (removed)
@@ -1,53 +1,0 @@
-/*
- * COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS kernel
- * PURPOSE: Run-Time Library
- * FILE: lib/rtl/i386/tan.S
- * PROGRAMER: Alex Ionescu (alex(a)relsoft.net)
- * Eric Kohl (ekohl(a)rz-online.de)
- *
- * Copyright (C) 2002 Michael Ringgaard.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the project nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
-
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES// LOSS OF USE, DATA, OR PROFITS// OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-.globl _tan
-
-.intel_syntax noprefix
-
-/* FUNCTIONS ***************************************************************/
-
-_tan:
- push ebp
- mov ebp,esp
- sub esp,4 // Allocate temporary space
- fld qword ptr [ebp+8] // Load real from stack
- fptan // Take the tangent
- fstp dword ptr [ebp-4] // Throw away the constant 1
- mov esp,ebp // Deallocate temporary space
- pop ebp
- ret
Removed: trunk/reactos/lib/crt/math/log.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/crt/math/log.c?rev=237…
==============================================================================
--- trunk/reactos/lib/crt/math/log.c (original)
+++ trunk/reactos/lib/crt/math/log.c (removed)
@@ -1,38 +1,0 @@
-/* Math functions for i387.
- Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by John C. Bowman <bowman(a)ipp-garching.mpg.de>, 1995.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include <math.h>
-
-double log (double __x);
-
-double log (double __x)
-{
- register double __value;
-#ifdef __GNUC__
- __asm __volatile__
- ("fldln2\n\t"
- "fxch\n\t"
- "fyl2x"
- : "=t" (__value) : "0" (__x));
-#else
- __value = linkme_log(__x);
-#endif /*__GNUC__*/
- return __value;
-}
Removed: trunk/reactos/lib/crt/math/log10.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/crt/math/log10.c?rev=2…
==============================================================================
--- trunk/reactos/lib/crt/math/log10.c (original)
+++ trunk/reactos/lib/crt/math/log10.c (removed)
@@ -1,38 +1,0 @@
-/* Math functions for i387.
- Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by John C. Bowman <bowman(a)ipp-garching.mpg.de>, 1995.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include <math.h>
-
-double log10 (double __x);
-
-double log10 (double __x)
-{
- register double __val;
-#ifdef __GNUC__
- __asm __volatile__
- ("fldlg2\n\t"
- "fxch\n\t"
- "fyl2x"
- : "=t" (__val) : "0" (__x));
-#else
- __val = linkme_log10(__x);
-#endif /*__GNUC__*/
- return __val;
-}
Removed: trunk/reactos/lib/crt/math/math.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/crt/math/math.c?rev=23…
==============================================================================
--- trunk/reactos/lib/crt/math/math.c (original)
+++ trunk/reactos/lib/crt/math/math.c (removed)
@@ -1,120 +1,0 @@
-#include <math.h>
-
-#pragma function(fmod,sqrt)
-#pragma function(log,log10,pow,exp)
-#pragma function(tan,atan,atan2,tanh)
-#pragma function(cos,acos,cosh)
-#pragma function(sin,asin,sinh)
-
-
-double linkme_ceil(double __x)
-{
- return ceil(__x);
-}
-
-double linkme_fabs(double __x)
-{
- return fabs(__x);
-}
-
-double linkme_floor(double __x)
-{
- return floor(__x);
-}
-
-double linkme_ldexp(double __x, int __y)
-{
- return ldexp(__x, __y);
-}
-
-double linkme_log2(double __x)
-{
- //return log2(__x);
- return 0;
-}
-
-double linkme_fmod(double __x, double __y)
-{
- return fmod(__x, __y);
-}
-
-double linkme_sqrt(double __x)
-{
- return sqrt(__x);
-}
-
-double linkme_log(double __x)
-{
- return log(__x);
-}
-
-double linkme_log10(double __x)
-{
- return log10(__x);
-}
-
-double linkme_pow(double __x, double __y)
-{
- return pow(__x, __y);
-}
-
-double linkme_exp(double __x)
-{
- return exp(__x);
-}
-
-double linkme_tan(double __x)
-{
- return tan(__x);
-}
-
-double linkme_atan(double __x)
-{
- return atan(__x);
-}
-
-double linkme_atan2(double __x, double __y)
-{
- return atan2(__x, __y);
-}
-
-double linkme_tanh(double __x)
-{
- return tanh(__x);
-}
-
-double linkme_cos(double __x)
-{
- return cos(__x);
-}
-
-double linkme_acos(double __x)
-{
- return acos(__x);
-}
-
-double linkme_cosh(double __x)
-{
- return cosh(__x);
-}
-
-double linkme_sin(double __x)
-{
- return sin(__x);
-}
-
-double linkme_asin(double __x)
-{
- return asin(__x);
-}
-
-double linkme_sinh(double __x)
-{
- return sinh(__x);
-}
-/*
-linkme_log2
-linkme_floor
-_linkme_ldexp
-_linkme_pow
- */
Removed: trunk/reactos/lib/crt/math/pow.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/crt/math/pow.c?rev=237…
==============================================================================
--- trunk/reactos/lib/crt/math/pow.c (original)
+++ trunk/reactos/lib/crt/math/pow.c (removed)
@@ -1,97 +1,0 @@
-/* Math functions for i387.
- Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by John C. Bowman <bowman(a)ipp-garching.mpg.de>, 1995.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include <math.h>
-
-double pow (double __x, double __y);
-
-double __log2 (double __x);
-
-double __log2 (double __x)
-{
- register double __val;
-#ifdef __GNUC__
- __asm __volatile__
- ("fld1\n\t"
- "fxch\n\t"
- "fyl2x"
- : "=t" (__val) : "0" (__x));
-#else
- //__value = linkme_log2(__x);
- __val = 0;
-#endif /*__GNUC__*/
- return __val;
-}
-
-/*
- * @implemented
- */
-double pow (double __x, double __y)
-{
- register double __val;
-#ifdef __GNUC__
- register double __exponent;
- long __p = (long) __y;
-
- if (__x == 0.0 && __y > 0.0)
- return 0.0;
- if (__y == (double) __p)
- {
- double __r = 1.0;
- if (__p == 0)
- return 1.0;
- if (__p < 0)
- {
- __p = -__p;
- __x = 1.0 / __x;
- }
- while (1)
- {
- if (__p & 1)
- __r *= __x;
- __p >>= 1;
- if (__p == 0)
- return __r;
- __x *= __x;
- }
- /* NOTREACHED */
- }
- __asm __volatile__
- ("fmul %%st(1) # y * log2(x)\n\t"
- "fst %%st(1)\n\t"
- "frndint # int(y * log2(x))\n\t"
- "fxch\n\t"
- "fsub %%st(1) # fract(y * log2(x))\n\t"
- "f2xm1 # 2^(fract(y * log2(x))) - 1\n\t"
- : "=t" (__val), "=u" (__exponent) : "0" (__log2 (__x)), "1" (__y));
- __val += 1.0;
- __asm __volatile__
- ("fscale"
- : "=t" (__val) : "0" (__val), "u" (__exponent));
-#else
- __val = linkme_pow(__x, __y);
-#endif /*__GNUC__*/
- return __val;
-}
-
-long double powl (long double __x,long double __y)
-{
- return pow(__x,__y/2)*pow(__x,__y/2);
-}
Added: trunk/reactos/lib/crt/math/pow_asm.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/crt/math/pow_asm.c?rev…
==============================================================================
--- trunk/reactos/lib/crt/math/pow_asm.c (added)
+++ trunk/reactos/lib/crt/math/pow_asm.c Tue Aug 29 21:51:13 2006
@@ -1,0 +1,30 @@
+/* Math functions for i387.
+ Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by John C. Bowman <bowman(a)ipp-garching.mpg.de>, 1995.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include <math.h>
+
+/*
+ * @implemented
+ */
+
+long double powl (long double __x,long double __y)
+{
+ return pow(__x,__y/2)*pow(__x,__y/2);
+}
Removed: trunk/reactos/lib/crt/math/sin.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/crt/math/sin.c?rev=237…
==============================================================================
--- trunk/reactos/lib/crt/math/sin.c (original)
+++ trunk/reactos/lib/crt/math/sin.c (removed)
@@ -1,36 +1,0 @@
-/* Math functions for i387.
- Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by John C. Bowman <bowman(a)ipp-garching.mpg.de>, 1995.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include <math.h>
-
-double sin (double __x);
-
-double sin (double __x)
-{
- register double __value;
-#ifdef __GNUC__
- __asm __volatile__
- ("fsin"
- : "=t" (__value) : "0" (__x));
-#else
- __value = linkme_sin(__x);
-#endif /*__GNUC__*/
- return __value;
-}
Removed: trunk/reactos/lib/crt/math/sqrt.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/crt/math/sqrt.c?rev=23…
==============================================================================
--- trunk/reactos/lib/crt/math/sqrt.c (original)
+++ trunk/reactos/lib/crt/math/sqrt.c (removed)
@@ -1,35 +1,0 @@
-/* Math functions for i387.
- Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by John C. Bowman <bowman(a)ipp-garching.mpg.de>, 1995.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-#include <math.h>
-
-double sqrt (double __x);
-
-double sqrt (double __x)
-{
- register double __value;
-#ifdef __GNUC__
- __asm __volatile__
- ("fsqrt"
- : "=t" (__value) : "0" (__x));
-#else
- __value = linkme_sqrt(__x);
-#endif /*__GNUC__*/
- return __value;
-}
Removed: trunk/reactos/lib/crt/math/tan.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/crt/math/tan.c?rev=237…
==============================================================================
--- trunk/reactos/lib/crt/math/tan.c (original)
+++ trunk/reactos/lib/crt/math/tan.c (removed)
@@ -1,37 +1,0 @@
-/* Math functions for i387.
- Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by John C. Bowman <bowman(a)ipp-garching.mpg.de>, 1995.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include <math.h>
-
-double tan (double __x);
-
-double tan (double __x)
-{
- register double __value;
-#ifdef __GNUC__
- register double __value2 __attribute__ ((unused));
- __asm __volatile__
- ("fptan"
- : "=t" (__value2), "=u" (__value) : "0" (__x));
-#else
- __value = linkme_tan(__x);
-#endif /*__GNUC__*/
- return __value;
-}
Author: weiden
Date: Tue Aug 29 21:41:34 2006
New Revision: 23783
URL: http://svn.reactos.org/svn/reactos?rev=23783&view=rev
Log:
Create a branch for Pablo Borobia's clipboard implementation
Added:
branches/clipboard/
- copied from r23782, trunk/reactos/