Print this page
5261 libm should stop using synonyms.h
5298 fabs is 0-sized, confuses dis(1) and others
Reviewed by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
Approved by: Gordon Ross <gwr@nexenta.com>


  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
  23  */
  24 /*
  25  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
  26  * Use is subject to license terms.
  27  */
  28 
  29         .file "expm1.s"
  30 
  31 #include "libm.h"
  32 LIBM_ANSI_PRAGMA_WEAK(expm1,function)
  33 #include "libm_synonyms.h"
  34 
  35         .data
  36         .align  4
  37 .mhundred:      .float  -100.0
  38 
  39         ENTRY(expm1)
  40         movl    8(%esp),%ecx            / ecx <-- hi_32(x)
  41         andl    $0x7fffffff,%ecx        / ecx <-- hi_32(|x|)
  42         cmpl    $0x3fe62e42,%ecx        / Is |x| < ln(2)?
  43         jb      .shortcut               / If so, take a shortcut.
  44         je      .check_tail             / |x| may be only slightly < ln(2)
  45         cmpl    $0x7ff00000,%ecx        / hi_32(|x|) >= hi_32(INF)?
  46         jae     .not_finite             / if so, x is not finite
  47 .finite_non_special:                    / Here, ln(2) < |x| < INF
  48         fldl    4(%esp)                 / push x
  49 
  50         subl    $8,%esp                 / save RP and set round-to-64-bits
  51         fstcw   (%esp)
  52         movw    (%esp),%ax
  53         movw    %ax,4(%esp)




  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
  23  */
  24 /*
  25  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
  26  * Use is subject to license terms.
  27  */
  28 
  29         .file "expm1.s"
  30 
  31 #include "libm.h"
  32 LIBM_ANSI_PRAGMA_WEAK(expm1,function)

  33 
  34         .data
  35         .align  4
  36 .mhundred:      .float  -100.0
  37 
  38         ENTRY(expm1)
  39         movl    8(%esp),%ecx            / ecx <-- hi_32(x)
  40         andl    $0x7fffffff,%ecx        / ecx <-- hi_32(|x|)
  41         cmpl    $0x3fe62e42,%ecx        / Is |x| < ln(2)?
  42         jb      .shortcut               / If so, take a shortcut.
  43         je      .check_tail             / |x| may be only slightly < ln(2)
  44         cmpl    $0x7ff00000,%ecx        / hi_32(|x|) >= hi_32(INF)?
  45         jae     .not_finite             / if so, x is not finite
  46 .finite_non_special:                    / Here, ln(2) < |x| < INF
  47         fldl    4(%esp)                 / push x
  48 
  49         subl    $8,%esp                 / save RP and set round-to-64-bits
  50         fstcw   (%esp)
  51         movw    (%esp),%ax
  52         movw    %ax,4(%esp)