~mingw-w64/mingw-w64/experimental

« back to all changes in this revision

Viewing changes to ros-privexp/mingw-w64-crt/math/frexpl.S

  • Committer: NightStrike
  • Date: 2010-08-11 22:20:57 UTC
  • Revision ID: svn-v4:4407c894-4637-0410-b4f5-ada5f102cad1:experimental:3266
Branch for adding option for supporting ros

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
 * This file has no copyright assigned and is placed in the Public Domain.
 
3
 * This file is part of the w64 mingw-runtime package.
 
4
 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
 
5
 */
 
6
#include <_mingw_mac.h>
 
7
 
 
8
/*
 
9
 * frexpl(long double x, int* expnt) extracts the exponent from x.
 
10
 * It returns an integer power of two to expnt and the significand
 
11
 * between 0.5 and 1 to y.  Thus  x = y * 2**expn.
 
12
 */ 
 
13
#ifdef _WIN64
 
14
        .align 8
 
15
#else
 
16
        .align 2
 
17
#endif
 
18
.globl __MINGW_USYMBOL(frexpl)
 
19
__MINGW_USYMBOL(frexpl):
 
20
#ifdef _WIN64
 
21
        pushq %rbp
 
22
        movq %rsp,%rbp
 
23
        subq $48,%rsp
 
24
        pushq %rsi
 
25
        fldt (%rdx)
 
26
        movq %rcx,%r9
 
27
        fld %st(0)
 
28
        fstpt -12(%rbp)
 
29
        leaq -4(%rbp),%rcx
 
30
        movw -4(%rbp),%dx
 
31
        andl $32767,%edx
 
32
        jne L25
 
33
        fldz
 
34
        fucompp
 
35
        fnstsw %ax
 
36
        andb $68,%ah
 
37
        xorb $64,%ah
 
38
        jne L21
 
39
        movl $0,(%r8)
 
40
        fldz
 
41
        jmp L24
 
42
        .align 4,0x90
 
43
        .align 4,0x90
 
44
L21:
 
45
        fldt -12(%rbp)
 
46
        fadd %st(0),%st
 
47
        fstpt -12(%rbp)
 
48
        decl %edx
 
49
        movw (%rcx),%si
 
50
        andl $32767,%esi
 
51
        jne L22
 
52
        cmpl $-66,%edx
 
53
        jg L21
 
54
L22:
 
55
        add %esi,%edx
 
56
        jmp L19
 
57
        .align 2,0x90
 
58
L25:
 
59
        fstp %st(0)
 
60
L19:
 
61
        addl $-16382,%edx
 
62
        movl %edx,(%r8)
 
63
        movw (%rcx),%ax
 
64
        andl $-32768,%eax
 
65
        orl $16382,%eax
 
66
        movw %ax,(%rcx)
 
67
        fldt -12(%rbp)
 
68
L24:
 
69
        popq %rsi
 
70
        movq    %r9,%rax
 
71
        movq    $0,8(%r9)
 
72
        fstpt   (%r9)
 
73
        leave
 
74
        ret
 
75
#else
 
76
        pushl %ebp
 
77
        movl %esp,%ebp
 
78
        subl $24,%esp
 
79
        pushl %esi
 
80
        pushl %ebx
 
81
        fldt 8(%ebp)
 
82
        movl 20(%ebp),%ebx
 
83
        fld %st(0)
 
84
        fstpt -12(%ebp)
 
85
        leal -4(%ebp),%ecx
 
86
        movw -4(%ebp),%dx
 
87
        andl $32767,%edx
 
88
        jne L25
 
89
        fldz
 
90
        fucompp
 
91
        fnstsw %ax
 
92
        andb $68,%ah
 
93
        xorb $64,%ah
 
94
        jne L21
 
95
        movl $0,(%ebx)
 
96
        fldz
 
97
        jmp L24
 
98
        .align 2,0x90
 
99
        .align 2,0x90
 
100
L21:
 
101
        fldt -12(%ebp)
 
102
        fadd %st(0),%st
 
103
        fstpt -12(%ebp)
 
104
        decl %edx
 
105
        movw (%ecx),%si
 
106
        andl $32767,%esi
 
107
        jne L22
 
108
        cmpl $-66,%edx
 
109
        jg L21
 
110
L22:
 
111
        addl %esi,%edx
 
112
        jmp L19
 
113
        .align 2,0x90
 
114
L25:
 
115
        fstp %st(0)
 
116
L19:
 
117
        addl $-16382,%edx
 
118
        movl %edx,(%ebx)
 
119
        movw (%ecx),%ax
 
120
        andl $-32768,%eax
 
121
        orl $16382,%eax
 
122
        movw %ax,(%ecx)
 
123
        fldt -12(%ebp)
 
124
L24:
 
125
        leal -32(%ebp),%esp
 
126
        popl %ebx
 
127
        popl %esi
 
128
        leave
 
129
        ret
 
130
#endif