aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/ia64/fpu/s_nearbyint.S
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/ia64/fpu/s_nearbyint.S')
-rw-r--r--sysdeps/ia64/fpu/s_nearbyint.S46
1 files changed, 18 insertions, 28 deletions
diff --git a/sysdeps/ia64/fpu/s_nearbyint.S b/sysdeps/ia64/fpu/s_nearbyint.S
index 6ee01ea..cba74e6 100644
--- a/sysdeps/ia64/fpu/s_nearbyint.S
+++ b/sysdeps/ia64/fpu/s_nearbyint.S
@@ -1,11 +1,10 @@
.file "nearbyint.s"
-// Copyright (C) 2000, 2001, Intel Corporation
+
+// Copyright (c) 2000 - 2003, Intel Corporation
// All rights reserved.
-//
-// Contributed 10/19/2000 by John Harrison, Cristina Iordache, Ted Kubaska,
-// Bob Norin, Tom Rowan, Shane Story, and Ping Tak Peter Tang of the
-// Computational Software Lab, Intel Corporation.
+//
+// Contributed 2000 by the Intel Numerics Group, Intel Corporation
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
@@ -21,7 +20,7 @@
// * The name of Intel Corporation may not be used to endorse or promote
// products derived from this software without specific prior written
// permission.
-//
+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -36,20 +35,19 @@
//
// Intel Corporation is the author of this code, and requests that all
// problem reports or change requests be submitted to it directly at
-// http://developer.intel.com/opensource.
+// http://www.intel.com/software/products/opensource/libraries/num.htm.
//
// History
//==============================================================
-// 10/19/2000: Created
-// 2/08/01 Corrected behavior for all rounding modes.
+// 10/19/00 Created
+// 02/08/01 Corrected behavior for all rounding modes.
+// 05/20/02 Cleaned up namespace and sf0 syntax
+// 02/10/03 Reordered header: .section, .global, .proc, .align
//==============================================================
//
// API
//==============================================================
// double nearbyint(double x)
-
-#include "libm_support.h"
-
//
// general registers used:
//
@@ -110,15 +108,8 @@ NEARBYINT_INT_f8 = f11
// 1 1 1 0 0 1 11 0xe7
-.align 32
-.global nearbyint#
-
.section .text
-.proc nearbyint#
-.align 32
-
-
-nearbyint:
+GLOBAL_LIBM_ENTRY(nearbyint)
{ .mfi
mov nearbyint_GR_fpsr = ar40 // Read the fpsr--need to check rc.s0
@@ -141,7 +132,7 @@ nearbyint:
{ .mfb
nop.m 999
-(p6) fnorm.d f8 = f8
+(p6) fnorm.d.s0 f8 = f8
(p6) br.ret.spnt b0 // Exit if x nan, inf, zero
;;
}
@@ -177,11 +168,11 @@ nearbyint:
// Check to see if s0 rounding mode is round to nearest. If not then set s2
// rounding mode to that of s0 and repeat conversions.
-L(NEARBYINT_COMMON):
+NEARBYINT_COMMON:
{ .mfb
cmp.ne p11,p0 = nearbyint_GR_rcs0, r0
(p6) fclass.m.unc p9,p10 = NEARBYINT_FLOAT_INT_f8, 0x07 // Test for result=0
-(p11) br.cond.spnt L(NEARBYINT_NOT_ROUND_NEAREST) // Branch if not round to nearest
+(p11) br.cond.spnt NEARBYINT_NOT_ROUND_NEAREST // Branch if not round to nearest
;;
}
@@ -200,13 +191,13 @@ L(NEARBYINT_COMMON):
}
{ .mfb
nop.m 999
-(p10) fnorm.d f8 = NEARBYINT_FLOAT_INT_f8
+(p10) fnorm.d.s0 f8 = NEARBYINT_FLOAT_INT_f8
br.ret.sptk b0
;;
}
-L(NEARBYINT_NOT_ROUND_NEAREST):
+NEARBYINT_NOT_ROUND_NEAREST:
// Set rounding mode of s2 to that of s0
{ .mfi
mov nearbyint_GR_rcs0 = r0 // Clear so we don't come back here
@@ -225,10 +216,9 @@ L(NEARBYINT_NOT_ROUND_NEAREST):
{ .mfb
nop.m 999
fcvt.xf NEARBYINT_FLOAT_INT_f8 = NEARBYINT_INT_f8
- br.cond.sptk L(NEARBYINT_COMMON)
+ br.cond.sptk NEARBYINT_COMMON
;;
}
-.endp nearbyint
-ASM_SIZE_DIRECTIVE(nearbyint)
+GLOBAL_LIBM_END(nearbyint)