Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. /*
  2.   Cephes Math Library Release 2.7:  May, 1998
  3.   Copyright 1984, 1987, 1988, 1992, 1998 by Stephen L. Moshier
  4.  
  5.   Extracted from floorl.387 for use in libmingwex.a by
  6.   Danny Smith <dannysmith@users.sourceforge.net>
  7.   2002-06-20
  8. */
  9.  
  10. /*
  11.  * frexpl(long double x, int* expnt) extracts the exponent from x.
  12.  * It returns an integer power of two to expnt and the significand
  13.  * between 0.5 and 1 to y.  Thus  x = y * 2**expn.
  14.  */
  15.         .align 2
  16. .globl _frexpl
  17. _frexpl:
  18.         pushl %ebp
  19.         movl %esp,%ebp
  20.         subl $24,%esp
  21.         pushl %esi
  22.         pushl %ebx
  23.         fldt 8(%ebp)
  24.         movl 20(%ebp),%ebx
  25.         fld %st(0)
  26.         fstpt -12(%ebp)
  27.         leal -4(%ebp),%ecx
  28.         movw -4(%ebp),%dx
  29.         andl $32767,%edx
  30.         jne L25
  31.         fldz
  32.         fucompp
  33.         fnstsw %ax
  34.         andb $68,%ah
  35.         xorb $64,%ah
  36.         jne L21
  37.         movl $0,(%ebx)
  38.         fldz
  39.         jmp L24
  40.         .align 2,0x90
  41.         .align 2,0x90
  42. L21:
  43.         fldt -12(%ebp)
  44.         fadd %st(0),%st
  45.         fstpt -12(%ebp)
  46.         decl %edx
  47.         movw (%ecx),%si
  48.         andl $32767,%esi
  49.         jne L22
  50.         cmpl $-66,%edx
  51.         jg L21
  52. L22:
  53.         addl %esi,%edx
  54.         jmp L19
  55.         .align 2,0x90
  56. L25:
  57.         fstp %st(0)
  58. L19:
  59.         addl $-16382,%edx
  60.         movl %edx,(%ebx)
  61.         movw (%ecx),%ax
  62.         andl $-32768,%eax
  63.         orl $16382,%eax
  64.         movw %ax,(%ecx)
  65.         fldt -12(%ebp)
  66. L24:
  67.         leal -32(%ebp),%esp
  68.         popl %ebx
  69.         popl %esi
  70.         leave
  71.         ret
  72.