From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25161 invoked by alias); 25 Jun 2013 15:30:45 -0000 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 Received: (qmail 25139 invoked by uid 89); 25 Jun 2013 15:30:44 -0000 X-Spam-SWARE-Status: No, score=-3.5 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,SPF_PASS autolearn=ham version=3.3.1 X-Spam-User: qpsmtpd, 2 recipients Received: from mail-qc0-f175.google.com (HELO mail-qc0-f175.google.com) (209.85.216.175) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 25 Jun 2013 15:30:44 +0000 Received: by mail-qc0-f175.google.com with SMTP id k14so7355580qcv.34 for ; Tue, 25 Jun 2013 08:30:42 -0700 (PDT) X-Received: by 10.49.12.11 with SMTP id u11mr33669578qeb.21.1372174242253; Tue, 25 Jun 2013 08:30:42 -0700 (PDT) Received: from anchor.twiddle.net (50-194-63-110-static.hfc.comcastbusiness.net. [50.194.63.110]) by mx.google.com with ESMTPSA id s9sm19783138qeo.3.2013.06.25.08.30.39 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 25 Jun 2013 08:30:41 -0700 (PDT) Message-ID: <51C9B79D.8070303@twiddle.net> Date: Tue, 25 Jun 2013 15:30:00 -0000 From: Richard Henderson User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130514 Thunderbird/17.0.6 MIME-Version: 1.0 To: "Joseph S. Myers" CC: libc-alpha@sourceware.org, libc-ports@sourceware.org, Marcus Shawcroft , Richard Henderson , David Holsgrove , Chris Metcalf , "David S. Miller" Subject: Re: Implement fma in soft-fp References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2013-06/txt/msg00051.txt.bz2 On 06/22/2013 10:17 AM, Joseph S. Myers wrote: > * Using this code on an architecture that detects tininess after > rounding may require soft-fp support for after-rounding tininess > detection to be added to avoid failures of fma tests for that > particular case. (In particular, this is relevant for alpha. It's > not currently relevant for MIPS because of the general lack of > exceptions support in the cases where this code gets used.) I'll give this a bit o testing for alpha and see what happens. > -#define _FP_MUL_MEAT_1_hard(wfracbits, R, X, Y) \ > +#define _FP_MUL_MEAT_DW_1_hard(wfracbits, R, X, Y) \ > do { \ > - _FP_W_TYPE _xh, _xl, _yh, _yl, _z_f0, _z_f1, _a_f0, _a_f1; \ > + _FP_W_TYPE _xh, _xl, _yh, _yl; \ > + _FP_FRAC_DECL_2(_a); \ > \ > /* split the words in half */ \ > _xh = X##_f >> (_FP_W_TYPE_SIZE/2); \ > @@ -172,17 +184,23 @@ do { \ > _yl = Y##_f & (((_FP_W_TYPE)1 << (_FP_W_TYPE_SIZE/2)) - 1); \ > \ > /* multiply the pieces */ \ > - _z_f0 = _xl * _yl; \ > + R##f0 = _xl * _yl; \ > _a_f0 = _xh * _yl; \ > _a_f1 = _xl * _yh; \ > - _z_f1 = _xh * _yh; \ > + R##f1 = _xh * _yh; \ Missing _ before f[01] there. I've been wondering from time to time about replacing all of this macro nonsense with c++. Overloaded functions in some cases, templates in others. It might eliminate silly typos like this. And be easier to debug. I believe that all of this code pre-dates the SRA pass by a large margin, so it's possible the compiler could do the same good structure splitting job that we did here by hand. Of course, that would require glibc to build parts with the c++ compiler, so that may be a non-starter... r~