diff options
author | Richard Henderson <rth@twiddle.net> | 2012-05-30 15:49:01 -0700 |
---|---|---|
committer | Richard Henderson <rth@twiddle.net> | 2012-05-30 16:05:42 -0700 |
commit | 268f6dda11e8afc861cbd964b2f209eb0ff816a3 (patch) | |
tree | 1a6ec53580f096a1dd79848360f558524592e33c /sysdeps | |
parent | 6863adc8f9d57fc8fe690edc3f535a6804556481 (diff) | |
download | glibc-268f6dda11e8afc861cbd964b2f209eb0ff816a3.tar.gz glibc-268f6dda11e8afc861cbd964b2f209eb0ff816a3.tar.xz glibc-268f6dda11e8afc861cbd964b2f209eb0ff816a3.zip |
alpha: Use dynamic rounding with sqrt insn
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/alpha/alphaev6/fpu/e_sqrt.S | 6 | ||||
-rw-r--r-- | sysdeps/alpha/alphaev6/fpu/e_sqrtf.S | 6 | ||||
-rw-r--r-- | sysdeps/alpha/fpu/math_private.h | 26 |
3 files changed, 32 insertions, 6 deletions
diff --git a/sysdeps/alpha/alphaev6/fpu/e_sqrt.S b/sysdeps/alpha/alphaev6/fpu/e_sqrt.S index eae1fb4e4c..c4625d0eca 100644 --- a/sysdeps/alpha/alphaev6/fpu/e_sqrt.S +++ b/sysdeps/alpha/alphaev6/fpu/e_sqrt.S @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 Free Software Foundation, Inc. +/* Copyright (C) 2000-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -33,9 +33,9 @@ ENTRY(__ieee754_sqrt) .align 4 #ifdef _IEEE_FP_INEXACT - sqrtt/sui $f16, $f0 + sqrtt/suid $f16, $f0 #else - sqrtt/su $f16, $f0 + sqrtt/sud $f16, $f0 #endif ret nop diff --git a/sysdeps/alpha/alphaev6/fpu/e_sqrtf.S b/sysdeps/alpha/alphaev6/fpu/e_sqrtf.S index c8217e5454..5681f3a947 100644 --- a/sysdeps/alpha/alphaev6/fpu/e_sqrtf.S +++ b/sysdeps/alpha/alphaev6/fpu/e_sqrtf.S @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 Free Software Foundation, Inc. +/* Copyright (C) 2000-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -33,9 +33,9 @@ ENTRY(__ieee754_sqrtf) .align 4 #ifdef _IEEE_FP_INEXACT - sqrts/sui $f16, $f0 + sqrts/suid $f16, $f0 #else - sqrts/su $f16, $f0 + sqrts/sud $f16, $f0 #endif ret nop diff --git a/sysdeps/alpha/fpu/math_private.h b/sysdeps/alpha/fpu/math_private.h index eb2177d78d..4f270f7a3f 100644 --- a/sysdeps/alpha/fpu/math_private.h +++ b/sysdeps/alpha/fpu/math_private.h @@ -18,4 +18,30 @@ #include_next <math_private.h> +#ifdef __alpha_fix__ +extern __always_inline double +__ieee754_sqrt (double d) +{ + double ret; +# ifdef _IEEE_FP_INEXACT + asm ("sqrtt/suid %1,%0" : "=f"(ret) : "f"(d)); +# else + asm ("sqrtt/sud %1,%0" : "=f"(ret) : "f"(d)); +# endif + return ret; +} + +extern __always_inline float +__ieee754_sqrtf (float d) +{ + float ret; +# ifdef _IEEE_FP_INEXACT + asm ("sqrts/suid %1,%0" : "=f"(ret) : "f"(d)); +# else + asm ("sqrts/sud %1,%0" : "=f"(ret) : "f"(d)); +# endif + return ret; +} +#endif /* FIX */ + #endif /* ALPHA_MATH_PRIVATE_H */ |