diff options
Diffstat (limited to 'sysdeps/ia64/fpu/s_nearbyintf.S')
-rw-r--r-- | sysdeps/ia64/fpu/s_nearbyintf.S | 46 |
1 files changed, 28 insertions, 18 deletions
diff --git a/sysdeps/ia64/fpu/s_nearbyintf.S b/sysdeps/ia64/fpu/s_nearbyintf.S index 6471232513..7050ddc52c 100644 --- a/sysdeps/ia64/fpu/s_nearbyintf.S +++ b/sysdeps/ia64/fpu/s_nearbyintf.S @@ -1,10 +1,11 @@ .file "nearbyintf.s" - -// Copyright (c) 2000 - 2003, Intel Corporation +// Copyright (C) 2000, 2001, Intel Corporation // All rights reserved. -// -// Contributed 2000 by the Intel Numerics Group, Intel Corporation +// +// 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. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -20,7 +21,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 @@ -35,19 +36,20 @@ // // Intel Corporation is the author of this code, and requests that all // problem reports or change requests be submitted to it directly at -// http://www.intel.com/software/products/opensource/libraries/num.htm. +// http://developer.intel.com/opensource. // // History //============================================================== -// 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 +// 10/19/2000: Created +// 2/08/01 Corrected behavior for all rounding modes. //============================================================== // // API //============================================================== // float nearbyintf(float x) + +#include "libm_support.h" + // // general registers used: // @@ -108,8 +110,15 @@ NEARBYINT_INT_f8 = f11 // 1 1 1 0 0 1 11 0xe7 +.align 32 +.global nearbyintf# + .section .text -GLOBAL_LIBM_ENTRY(nearbyintf) +.proc nearbyintf# +.align 32 + + +nearbyintf: { .mfi mov nearbyint_GR_fpsr = ar40 // Read the fpsr--need to check rc.s0 @@ -132,7 +141,7 @@ GLOBAL_LIBM_ENTRY(nearbyintf) { .mfb nop.m 999 -(p6) fnorm.s.s0 f8 = f8 +(p6) fnorm.s f8 = f8 (p6) br.ret.spnt b0 // Exit if x nan, inf, zero ;; } @@ -168,11 +177,11 @@ GLOBAL_LIBM_ENTRY(nearbyintf) // 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. -NEARBYINT_COMMON: +L(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 NEARBYINT_NOT_ROUND_NEAREST // Branch if not round to nearest +(p11) br.cond.spnt L(NEARBYINT_NOT_ROUND_NEAREST) // Branch if not round to nearest ;; } @@ -191,13 +200,13 @@ NEARBYINT_COMMON: } { .mfb nop.m 999 -(p10) fnorm.s.s0 f8 = NEARBYINT_FLOAT_INT_f8 +(p10) fnorm.s f8 = NEARBYINT_FLOAT_INT_f8 br.ret.sptk b0 ;; } -NEARBYINT_NOT_ROUND_NEAREST: +L(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 @@ -216,9 +225,10 @@ NEARBYINT_NOT_ROUND_NEAREST: { .mfb nop.m 999 fcvt.xf NEARBYINT_FLOAT_INT_f8 = NEARBYINT_INT_f8 - br.cond.sptk NEARBYINT_COMMON + br.cond.sptk L(NEARBYINT_COMMON) ;; } -GLOBAL_LIBM_END(nearbyintf) +.endp nearbyintf +ASM_SIZE_DIRECTIVE(nearbyintf) |