~ubuntu-branches/ubuntu/trusty/eglibc/trusty

« back to all changes in this revision

Viewing changes to sysdeps/x86_64/fpu/e_powl.S

  • Committer: Package Import Robot
  • Author(s): Adam Conrad
  • Date: 2013-01-10 18:39:35 UTC
  • mfrom: (1.5.2) (4.4.24 experimental)
  • Revision ID: package-import@ubuntu.com-20130110183935-afsgfxkmg7wk5eaj
Tags: 2.17-0ubuntu1
* Merge with Debian, bringing in a new upstream and many small fixes:
  - patches/any/cvs-malloc-deadlock.diff: Dropped, merged upstream.
  - patches/ubuntu/lddebug-scopes.diff: Rebase for upstream changes.
  - patches/ubuntu/local-CVE-2012-3406.diff: Rebased against upstream.
  - patches/ubuntu/no-asm-mtune-i686.diff: Fixed in recent binutils.
* This upstream merge fixes a nasty hang in pulseaudio (LP: #1085342)
* Bump MIN_KERNEL_SUPPORTED to 2.6.32 on ARM, now that we no longer
  have to support shonky 2.6.31 kernels on imx51 babbage builders.
* Drop patches/ubuntu/local-disable-nscd-host-caching.diff, as these
  issues were apparently resolved upstream a while ago (LP: #613662)
* Fix the compiled-in bug URL to point to launchpad.net, not Debian.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
        .section .rodata.cst8,"aM",@progbits,8
24
24
 
25
25
        .p2align 3
26
 
        ASM_TYPE_DIRECTIVE(one,@object)
 
26
        .type one,@object
27
27
one:    .double 1.0
28
28
        ASM_SIZE_DIRECTIVE(one)
29
 
        ASM_TYPE_DIRECTIVE(limit,@object)
30
 
limit:  .double 0.29
31
 
        ASM_SIZE_DIRECTIVE(limit)
32
 
        ASM_TYPE_DIRECTIVE(p63,@object)
 
29
        .type p3,@object
 
30
p3:     .byte 0, 0, 0, 0, 0, 0, 0x20, 0x40
 
31
        ASM_SIZE_DIRECTIVE(p3)
 
32
        .type p63,@object
33
33
p63:    .byte 0, 0, 0, 0, 0, 0, 0xe0, 0x43
34
34
        ASM_SIZE_DIRECTIVE(p63)
35
 
        ASM_TYPE_DIRECTIVE(p64,@object)
 
35
        .type p64,@object
36
36
p64:    .byte 0, 0, 0, 0, 0, 0, 0xf0, 0x43
37
37
        ASM_SIZE_DIRECTIVE(p64)
38
 
        ASM_TYPE_DIRECTIVE(p78,@object)
 
38
        .type p78,@object
39
39
p78:    .byte 0, 0, 0, 0, 0, 0, 0xd0, 0x44
40
40
        ASM_SIZE_DIRECTIVE(p78)
 
41
        .type pm79,@object
 
42
pm79:   .byte 0, 0, 0, 0, 0, 0, 0, 0x3b
 
43
        ASM_SIZE_DIRECTIVE(pm79)
41
44
 
42
45
        .section .rodata.cst16,"aM",@progbits,16
43
46
 
44
47
        .p2align 3
45
 
        ASM_TYPE_DIRECTIVE(infinity,@object)
 
48
        .type infinity,@object
46
49
inf_zero:
47
50
infinity:
48
51
        .byte 0, 0, 0, 0, 0, 0, 0xf0, 0x7f
49
52
        ASM_SIZE_DIRECTIVE(infinity)
50
 
        ASM_TYPE_DIRECTIVE(zero,@object)
 
53
        .type zero,@object
51
54
zero:   .double 0.0
52
55
        ASM_SIZE_DIRECTIVE(zero)
53
 
        ASM_TYPE_DIRECTIVE(minf_mzero,@object)
 
56
        .type minf_mzero,@object
54
57
minf_mzero:
55
58
minfinity:
56
59
        .byte 0, 0, 0, 0, 0, 0, 0xf0, 0xff
110
113
        fistpll -8(%rsp)        // y : x
111
114
        fildll  -8(%rsp)        // int(y) : y : x
112
115
        fucomip %st(1),%st      // y : x
113
 
        jne     3f
114
 
 
115
 
        /* OK, we have an integer value for y.  */
 
116
        je      9f
 
117
 
 
118
        // If y has absolute value at most 0x1p-79, then any finite
 
119
        // nonzero x will result in 1.  Saturate y to those bounds to
 
120
        // avoid underflow in the calculation of y*log2(x).
 
121
        fldl    MO(pm79)        // 0x1p-79 : y : x
 
122
        fld     %st(1)          // y : 0x1p-79 : y : x
 
123
        fabs                    // |y| : 0x1p-79 : y : x
 
124
        fcomip  %st(1), %st     // 0x1p-79 : y : x
 
125
        fstp    %st(0)          // y : x
 
126
        jnc     3f
 
127
        fstp    %st(0)          // pop y
 
128
        fldl    MO(pm79)        // 0x1p-79 : x
 
129
        testb   $2, %dl
 
130
        jnz     3f              // y > 0
 
131
        fchs                    // -0x1p-79 : x
 
132
        jmp     3f
 
133
 
 
134
9:      /* OK, we have an integer value for y.  Unless very small
 
135
           (we use < 8), use the algorithm for real exponent to avoid
 
136
           accumulation of errors.  */
 
137
        fldl    MO(p3)          // 8 : y : x
 
138
        fld     %st(1)          // y : 8 : y : x
 
139
        fabs                    // |y| : 8 : y : x
 
140
        fcomip  %st(1), %st     // 8 : y : x
 
141
        fstp    %st(0)          // y : x
 
142
        jnc     2f
116
143
        mov     -8(%rsp),%eax
117
144
        mov     -4(%rsp),%edx
118
145
        orl     $0, %edx
148
175
        ret
149
176
 
150
177
        .align ALIGNARG(4)
151
 
2:      // y is a large integer (absolute value at least 1L<<63), but
 
178
2:      // y is a large integer (absolute value at least 8), but
152
179
        // may be odd unless at least 1L<<64.  So it may be necessary
153
180
        // to adjust the sign of a negative result afterwards.
154
181
        fxch                    // x : y
171
198
        fchs                    // -(1L<<78) : |x|
172
199
        .align ALIGNARG(4)
173
200
3:      /* y is a real number.  */
174
 
        fxch                    // x : y
175
 
        fldl    MO(one)         // 1.0 : x : y
176
 
        fldl    MO(limit)       // 0.29 : 1.0 : x : y
177
 
        fld     %st(2)          // x : 0.29 : 1.0 : x : y
178
 
        fsub    %st(2)          // x-1 : 0.29 : 1.0 : x : y
179
 
        fabs                    // |x-1| : 0.29 : 1.0 : x : y
180
 
        fucompp                 // 1.0 : x : y
181
 
        fnstsw
182
 
        fxch                    // x : 1.0 : y
183
 
        test    $0x4500,%eax
184
 
        jz      7f
185
 
        fsub    %st(1)          // x-1 : 1.0 : y
186
 
        fyl2xp1                 // log2(x) : y
187
 
        jmp     8f
188
 
 
189
 
7:      fyl2x                   // log2(x) : y
190
 
8:      fmul    %st(1)          // y*log2(x) : y
191
 
        fst     %st(1)          // y*log2(x) : y*log2(x)
192
 
        frndint                 // int(y*log2(x)) : y*log2(x)
193
 
        fsubr   %st, %st(1)     // int(y*log2(x)) : fract(y*log2(x))
194
 
        fxch                    // fract(y*log2(x)) : int(y*log2(x))
195
 
        f2xm1                   // 2^fract(y*log2(x))-1 : int(y*log2(x))
196
 
        faddl   MO(one)         // 2^fract(y*log2(x)) : int(y*log2(x))
197
 
        fscale                  // 2^fract(y*log2(x))*2^int(y*log2(x)) : int(y*log2(x))
198
 
        fstp    %st(1)          // 2^fract(y*log2(x))*2^int(y*log2(x))
 
201
        subq    $40, %rsp
 
202
        cfi_adjust_cfa_offset (40)
 
203
        fstpt   16(%rsp)        // x
 
204
        fstpt   (%rsp)          // <empty>
 
205
        mov     %edx, 32(%rsp)
 
206
        call    HIDDEN_JUMPTARGET (__powl_helper)       // <result>
 
207
        mov     32(%rsp), %edx
 
208
        addq    $40, %rsp
 
209
        cfi_adjust_cfa_offset (-40)
199
210
        testb   $2, %dh
200
211
        jz      292f
201
212
        // x is negative.  If y is an odd integer, negate the result.