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 2006 Sun Microsystems, Inc.  All rights reserved.
  26  * Use is subject to license terms.
  27  */
  28 
  29         .file   "round.s"
  30 
  31 #include "libm.h"
  32 LIBM_ANSI_PRAGMA_WEAK(round,function)
  33 #include "libm_synonyms.h"
  34 #undef fabs
  35 
  36         .section .rodata
  37         .align  4
  38 .Lhalf: .float  0.5
  39 
  40         ENTRY(round)
  41         movl    %esp,%ecx
  42         subl    $8,%esp
  43         fstcw   -8(%ecx)
  44         fldl    4(%ecx)
  45         movw    -8(%ecx),%dx
  46         andw    $0xf3ff,%dx
  47         movw    %dx,-4(%ecx)
  48         fldcw   -4(%ecx)                / set RD = to_nearest
  49         fld     %st(0)
  50         frndint                         / [x],x
  51         fstcw   -4(%ecx)
  52         movw    -4(%ecx),%dx
  53         andw    $0xf3ff,%dx
  54         movw    -8(%ecx),%ax




  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 2006 Sun Microsystems, Inc.  All rights reserved.
  26  * Use is subject to license terms.
  27  */
  28 
  29         .file   "round.s"
  30 
  31 #include "libm.h"
  32 LIBM_ANSI_PRAGMA_WEAK(round,function)


  33 
  34         .section .rodata
  35         .align  4
  36 .Lhalf: .float  0.5
  37 
  38         ENTRY(round)
  39         movl    %esp,%ecx
  40         subl    $8,%esp
  41         fstcw   -8(%ecx)
  42         fldl    4(%ecx)
  43         movw    -8(%ecx),%dx
  44         andw    $0xf3ff,%dx
  45         movw    %dx,-4(%ecx)
  46         fldcw   -4(%ecx)                / set RD = to_nearest
  47         fld     %st(0)
  48         frndint                         / [x],x
  49         fstcw   -4(%ecx)
  50         movw    -4(%ecx),%dx
  51         andw    $0xf3ff,%dx
  52         movw    -8(%ecx),%ax