From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16351 invoked by alias); 30 May 2012 23:11:23 -0000 Received: (qmail 16320 invoked by uid 22791); 30 May 2012 23:11:21 -0000 X-SWARE-Spam-Status: No, hits=-4.2 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,KHOP_RCVD_TRUST,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-pz0-f41.google.com (HELO mail-pz0-f41.google.com) (209.85.210.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 30 May 2012 23:11:08 +0000 Received: by dakp5 with SMTP id p5so444438dak.0 for ; Wed, 30 May 2012 16:11:08 -0700 (PDT) Received: by 10.68.227.67 with SMTP id ry3mr53214pbc.158.1338419468060; Wed, 30 May 2012 16:11:08 -0700 (PDT) Received: from anchor.twiddle.home ([173.160.232.49]) by mx.google.com with ESMTPS id mt9sm1968038pbb.14.2012.05.30.16.11.07 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 30 May 2012 16:11:07 -0700 (PDT) From: Richard Henderson To: libc-ports@sourceware.org Subject: [PATCH 1/4] alpha: Use dynamic rounding with sqrt insn Date: Wed, 30 May 2012 23:11:00 -0000 Message-Id: <1338419462-7572-1-git-send-email-rth@twiddle.net> X-IsSubscribed: yes Mailing-List: contact libc-ports-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: libc-ports-owner@sourceware.org X-SW-Source: 2012-05/txt/msg00199.txt.bz2 --- ChangeLog.alpha | 5 +++++ sysdeps/alpha/alphaev6/fpu/e_sqrt.S | 6 +++--- sysdeps/alpha/alphaev6/fpu/e_sqrtf.S | 6 +++--- sysdeps/alpha/fpu/math_private.h | 26 ++++++++++++++++++++++++++ 4 files changed, 37 insertions(+), 6 deletions(-) diff --git a/ChangeLog.alpha b/ChangeLog.alpha index f87c9d6..44ffdc7 100644 --- a/ChangeLog.alpha +++ b/ChangeLog.alpha @@ -1,5 +1,10 @@ 2012-05-30 Richard Henderson + * sysdeps/alpha/alphaev6/fpu/e_sqrt.S: Use dynamic rounding. + * sysdeps/alpha/alphaev6/fpu/e_sqrtf.S: Likewise. + * sysdeps/alpha/fpu/math_private.h (__ieee754_sqrt): New. + (__ieee754_sqrtf): New. + * sysdeps/unix/sysv/linux/alpha/nptl/pthread_once.c: Replace _internal alias by hidden_def. diff --git a/sysdeps/alpha/alphaev6/fpu/e_sqrt.S b/sysdeps/alpha/alphaev6/fpu/e_sqrt.S index eae1fb4..c4625d0 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 c8217e5..5681f3a 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 eb2177d..4f270f7 100644 --- a/sysdeps/alpha/fpu/math_private.h +++ b/sysdeps/alpha/fpu/math_private.h @@ -18,4 +18,30 @@ #include_next +#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 */ -- 1.7.7.6