From: <daw...@us...> - 2014-05-13 23:00:42
|
Revision: 6632 http://sourceforge.net/p/mingw-w64/code/6632 Author: dawncrow Date: 2014-05-13 23:00:36 +0000 (Tue, 13 May 2014) Log Message: ----------- math: Add ARM implementation for ceil, ceilf and ceill Modified Paths: -------------- trunk/mingw-w64-crt/math/ceil.S trunk/mingw-w64-crt/math/ceilf.S trunk/mingw-w64-crt/math/ceill.S Modified: trunk/mingw-w64-crt/math/ceil.S =================================================================== --- trunk/mingw-w64-crt/math/ceil.S 2014-05-13 22:59:57 UTC (rev 6631) +++ trunk/mingw-w64-crt/math/ceil.S 2014-05-13 23:00:36 UTC (rev 6632) @@ -8,14 +8,14 @@ .file "ceil.S" .text .align 4 -.globl __MINGW_USYMBOL(ceil) + .globl __MINGW_USYMBOL(ceil) .def __MINGW_USYMBOL(ceil); .scl 2; .type 32; .endef #ifdef _WIN64 .seh_proc __MINGW_USYMBOL(ceil) #endif __MINGW_USYMBOL(ceil): -#ifdef _WIN64 +#if defined(_AMD64_) || defined(__x86_64__) .seh_endprologue movd %xmm0, %rax movq %rax, %rcx @@ -91,7 +91,16 @@ .zero: .long 0 .long 0 -#else +#elif defined(_ARM_) || defined(__arm__) + vmrs r1, fpscr + bic r0, r1, #0x00c00000 + orr r0, r0, #0x00400000 /* Round towards Plus Infinity */ + vmsr fpscr, r0 + vcvtr.s32.f64 s0, d0 + vcvt.f64.s32 d0, s0 + vmsr fpscr, r1 + bx lr +#elif defined(_X86_) || defined(__i386__) fldl 4(%esp) subl $8,%esp Modified: trunk/mingw-w64-crt/math/ceilf.S =================================================================== --- trunk/mingw-w64-crt/math/ceilf.S 2014-05-13 22:59:57 UTC (rev 6631) +++ trunk/mingw-w64-crt/math/ceilf.S 2014-05-13 23:00:36 UTC (rev 6632) @@ -8,14 +8,14 @@ .file "ceilf.S" .text .align 4 -.globl __MINGW_USYMBOL(ceilf) + .globl __MINGW_USYMBOL(ceilf) .def __MINGW_USYMBOL(ceilf); .scl 2; .type 32; .endef #ifdef _WIN64 .seh_proc __MINGW_USYMBOL(ceilf) #endif __MINGW_USYMBOL(ceilf): -#ifdef _WIN64 +#if defined(_AMD64_) || defined(__x86_64__) subq $24, %rsp .seh_stackalloc 24 .seh_endprologue @@ -87,7 +87,16 @@ .align 4 .zeroval: .long 0 -#else +#elif defined(_ARM_) || defined(__arm__) + vmrs r1, fpscr + bic r0, r1, #0x00c00000 + orr r0, r0, #0x00400000 /* Round towards Plus Infinity */ + vmsr fpscr, r0 + vcvt.s32.f32 s0, s0 + vcvt.f32.s32 s0, s0 + vmsr fpscr, r1 + bx lr +#elif defined(_X86_) || defined(__i386__) flds 4(%esp) subl $8,%esp Modified: trunk/mingw-w64-crt/math/ceill.S =================================================================== --- trunk/mingw-w64-crt/math/ceill.S 2014-05-13 22:59:57 UTC (rev 6631) +++ trunk/mingw-w64-crt/math/ceill.S 2014-05-13 23:00:36 UTC (rev 6632) @@ -12,10 +12,10 @@ #else .align 4 #endif -.globl __MINGW_USYMBOL(ceill) + .globl __MINGW_USYMBOL(ceill) .def __MINGW_USYMBOL(ceill); .scl 2; .type 32; .endef __MINGW_USYMBOL(ceill): -#ifdef _WIN64 +#if defined(_AMD64_) || defined(__x86_64__) fldt (%rdx) subq $24,%rsp @@ -39,7 +39,16 @@ movq $0,8(%rcx) fstpt (%rcx) ret -#else +#elif defined(_ARM_) || defined(__arm__) + vmrs r1, fpscr + bic r0, r1, #0x00c00000 + orr r0, r0, #0x00400000 /* Round towards Plus Infinity */ + vmsr fpscr, r0 + vcvtr.s32.f64 s0, d0 + vcvt.f64.s32 d0, s0 + vmsr fpscr, r1 + bx lr +#elif defined(_X86_) || defined(__i386__) fldt 4(%esp) subl $8,%esp fstcw 4(%esp) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |