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>
5262 libm needs to be carefully unifdef'd
5268 libm doesn't need to hide symbols which are already local
Reviewed by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
Reviewed by: Gordon Ross <gwr@nexenta.com>
Approved by: Gordon Ross <gwr@nexenta.com>


  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   "nextafter.S"
  30 
  31 #include "libm.h"
  32 LIBM_ANSI_PRAGMA_WEAK(nextafter,function)
  33         .weak _nextafter
  34         .type _nextafter,#function
  35 _nextafter      = __nextafter
  36 #include "libm_synonyms.h"
  37 #include "libm_protos.h"
  38 
  39 #if defined(LIBM_BUILD) && !defined(ELFOBJ)
  40 #define mENTRY(x)       ENTRY(__libm/**/x)
  41 #define mNAME(x)        NAME(__libm/**/x)
  42 #else
  43 #define mENTRY(x)       ENTRY(x)
  44 #define mNAME(x)        NAME(x)
  45 #endif
  46 
  47         RO_DATA
  48         .align  8
  49 .Lconstant:
  50 two54   = 0x00
  51         .word   0x43500000,0x0          !  2**54
  52 twom54  = 0x08
  53         .word   0x3c900000,0x0          !  2**-54
  54 tiny    = 0x10
  55         .word   0x00100000,0x0          !  tiny
  56 
  57 ! variable using fp
  58 x       = -0x8
  59 y       = -0x10
  60 
  61         ENTRY(nextafter)
  62         save    %sp,-128,%sp
  63         PIC_SETUP(l7)
  64         std     %i0,[%fp+x]
  65         or      %g0,%i0,%o0             ! save original arguments
  66         or      %g0,%i1,%o1


  93         nop
  94 2:
  95         fbl     3f                      ! next_addulp
  96         nop
  97 1:                                      ! next_subulp
  98         subcc   %i1,1,%i1
  99         ba      4f                      ! next_final
 100         subx    %i0,0,%i0
 101 3:                                      ! next_addulp
 102         addcc   %i1,1,%i1
 103         addx    %i0,0,%i0
 104 4:                                      ! next_final
 105         sethi   %hi(0x7ff00000),%l3
 106         std     %i0,[%fp+x]
 107         andcc   %i0,%l3,%i2
 108         be,a    1f                      ! xflow
 109         ldd     [%l0+tiny],%f2
 110         cmp     %i2,%l3
 111         bne,a   9f                      ! next_return
 112         ldd     [%fp+x],%f0
 113         call    mNAME(_SVID_libm_err)   ! overflow
 114         or      %g0,46,%o4
 115         ba      9f
 116         nop
 117 1:                                      ! xflow
 118         fmuld   %f2,%f2,%f2
 119         ldd     [%fp+x],%f0
 120 9:                                      ! next_return
 121         ret
 122         restore
 123 
 124         SET_SIZE(nextafter)


  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   "nextafter.S"
  30 
  31 #include "libm.h"
  32 LIBM_ANSI_PRAGMA_WEAK(nextafter,function)
  33         .weak _nextafter
  34         .type _nextafter,#function
  35 _nextafter      = __nextafter

  36 #include "libm_protos.h"
  37 








  38         RO_DATA
  39         .align  8
  40 .Lconstant:
  41 two54   = 0x00
  42         .word   0x43500000,0x0          !  2**54
  43 twom54  = 0x08
  44         .word   0x3c900000,0x0          !  2**-54
  45 tiny    = 0x10
  46         .word   0x00100000,0x0          !  tiny
  47 
  48 ! variable using fp
  49 x       = -0x8
  50 y       = -0x10
  51 
  52         ENTRY(nextafter)
  53         save    %sp,-128,%sp
  54         PIC_SETUP(l7)
  55         std     %i0,[%fp+x]
  56         or      %g0,%i0,%o0             ! save original arguments
  57         or      %g0,%i1,%o1


  84         nop
  85 2:
  86         fbl     3f                      ! next_addulp
  87         nop
  88 1:                                      ! next_subulp
  89         subcc   %i1,1,%i1
  90         ba      4f                      ! next_final
  91         subx    %i0,0,%i0
  92 3:                                      ! next_addulp
  93         addcc   %i1,1,%i1
  94         addx    %i0,0,%i0
  95 4:                                      ! next_final
  96         sethi   %hi(0x7ff00000),%l3
  97         std     %i0,[%fp+x]
  98         andcc   %i0,%l3,%i2
  99         be,a    1f                      ! xflow
 100         ldd     [%l0+tiny],%f2
 101         cmp     %i2,%l3
 102         bne,a   9f                      ! next_return
 103         ldd     [%fp+x],%f0
 104         call    NAME(_SVID_libm_err)    ! overflow
 105         or      %g0,46,%o4
 106         ba      9f
 107         nop
 108 1:                                      ! xflow
 109         fmuld   %f2,%f2,%f2
 110         ldd     [%fp+x],%f0
 111 9:                                      ! next_return
 112         ret
 113         restore
 114 
 115         SET_SIZE(nextafter)