From: <daw...@us...> - 2014-05-13 23:02:38
|
Revision: 6634 http://sourceforge.net/p/mingw-w64/code/6634 Author: dawncrow Date: 2014-05-13 23:02:30 +0000 (Tue, 13 May 2014) Log Message: ----------- math: Add ARM implementation for nearbyint, nearbyintf and nearbyintl Modified Paths: -------------- trunk/mingw-w64-crt/math/nearbyint.S trunk/mingw-w64-crt/math/nearbyintf.S trunk/mingw-w64-crt/math/nearbyintl.S Modified: trunk/mingw-w64-crt/math/nearbyint.S =================================================================== --- trunk/mingw-w64-crt/math/nearbyint.S 2014-05-13 23:01:34 UTC (rev 6633) +++ trunk/mingw-w64-crt/math/nearbyint.S 2014-05-13 23:02:30 UTC (rev 6634) @@ -12,10 +12,10 @@ #else .align 4 #endif -.globl __MINGW_USYMBOL(nearbyint) + .globl __MINGW_USYMBOL(nearbyint) .def __MINGW_USYMBOL(nearbyint); .scl 2; .type 32; .endef __MINGW_USYMBOL(nearbyint): -#ifdef _WIN64 +#if defined(_AMD64_) || defined(__x86_64__) movsd %xmm0,-16(%rsp) fldl -16(%rsp) pushq %rax @@ -33,7 +33,11 @@ fstpl -16(%rsp) movsd -16(%rsp),%xmm0 ret -#else +#elif defined(_ARM_) || defined(__arm__) + vcvtr.s32.f64 s0, d0 + vcvt.f64.s32 d0, s0 + bx lr +#elif defined(_X86_) || defined(__i386__) fldl 4(%esp) pushl %eax pushl %ecx Modified: trunk/mingw-w64-crt/math/nearbyintf.S =================================================================== --- trunk/mingw-w64-crt/math/nearbyintf.S 2014-05-13 23:01:34 UTC (rev 6633) +++ trunk/mingw-w64-crt/math/nearbyintf.S 2014-05-13 23:02:30 UTC (rev 6634) @@ -12,10 +12,10 @@ #else .align 4 #endif -.globl __MINGW_USYMBOL(nearbyintf) + .globl __MINGW_USYMBOL(nearbyintf) .def __MINGW_USYMBOL(nearbyintf); .scl 2; .type 32; .endef __MINGW_USYMBOL(nearbyintf): -#ifdef _WIN64 +#if defined(_AMD64_) || defined(__x86_64__) movss %xmm0,-12(%rsp) flds -12(%rsp) pushq %rax @@ -33,7 +33,11 @@ fstps -12(%rsp) movss -12(%rsp),%xmm0 ret -#else +#elif defined(_ARM_) || defined(__arm__) + vcvt.s32.f32 s0, s0 + vcvt.f32.s32 s0, s0 + bx lr +#elif defined(_X86_) || defined(__i386__) flds 4(%esp) pushl %eax pushl %ecx Modified: trunk/mingw-w64-crt/math/nearbyintl.S =================================================================== --- trunk/mingw-w64-crt/math/nearbyintl.S 2014-05-13 23:01:34 UTC (rev 6633) +++ trunk/mingw-w64-crt/math/nearbyintl.S 2014-05-13 23:02:30 UTC (rev 6634) @@ -12,10 +12,10 @@ #else .align 4 #endif -.globl __MINGW_USYMBOL(nearbyintl) + .globl __MINGW_USYMBOL(nearbyintl) .def __MINGW_USYMBOL(nearbyintl); .scl 2; .type 32; .endef __MINGW_USYMBOL(nearbyintl): -#ifdef _WIN64 +#if defined(_AMD64_) || defined(__x86_64__) fldt (%rdx) movq %rcx,%r8 pushq %rax @@ -34,7 +34,11 @@ movq $0,8(%r8) fstpt (%r8) ret -#else +#elif defined(_ARM_) || defined(__arm__) + vcvtr.s32.f64 s0, d0 + vcvt.f64.s32 d0, s0 + bx lr +#elif defined(_X86_) || defined(__i386__) fldt 4(%esp) pushl %eax pushl %ecx This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |