From patchwork Thu Jul 3 18:00:45 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 1908 Received: (qmail 13915 invoked by alias); 3 Jul 2014 18:01:57 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 13062 invoked by uid 89); 3 Jul 2014 18:01:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL, BAYES_05, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-qa0-f43.google.com X-Received: by 10.224.26.18 with SMTP id b18mr10311980qac.20.1404410461057; Thu, 03 Jul 2014 11:01:01 -0700 (PDT) From: Richard Henderson To: libc-alpha@sourceware.org Subject: [COMMITTED 3/4] alpha: Implement math_opt_barrier and math_force_eval Date: Thu, 3 Jul 2014 11:00:45 -0700 Message-Id: <1404410446-30243-3-git-send-email-rth@twiddle.net> In-Reply-To: <1404410446-30243-1-git-send-email-rth@twiddle.net> References: <1404410446-30243-1-git-send-email-rth@twiddle.net> We need not force values to memory like i387. --- ChangeLog | 3 +++ sysdeps/alpha/fpu/math_private.h | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index 017003e..e84fbbf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2014-07-03 Richard Henderson + * sysdeps/alpha/fpu/math_private.h (math_opt_barrier): New. + (math_force_eval): New. + * sysdeps/alpha/fpu/s_lround.c: Add 0.5 with chopped rounding. * sysdeps/alpha/fpu/s_lroundf.c: Likewise. diff --git a/sysdeps/alpha/fpu/math_private.h b/sysdeps/alpha/fpu/math_private.h index 22ab3b9..9e06e25 100644 --- a/sysdeps/alpha/fpu/math_private.h +++ b/sysdeps/alpha/fpu/math_private.h @@ -13,6 +13,12 @@ # define __isnanf __isnanf #endif +/* Generic code forces values to memory; we don't need to do that. */ +#define math_opt_barrier(x) \ + ({ __typeof (x) __x = (x); __asm ("" : "+frm" (__x)); __x; }) +#define math_force_eval(x) \ + ({ __typeof (x) __x = (x); __asm __volatile__ ("" : : "frm" (__x)); }) + #include_next #ifdef __alpha_fix__