From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 43752 invoked by alias); 5 Sep 2016 15:24:49 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 42711 invoked by uid 89); 5 Sep 2016 15:24:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS,URIBL_RED autolearn=ham version=3.3.2 spammy=awareness X-HELO: relay1.mentorg.com Date: Mon, 05 Sep 2016 15:24:00 -0000 From: Joseph Myers To: Yury Norov CC: , Subject: Re: [06/12] Add femode_t functions: ia64 In-Reply-To: <20160903142550.GA29995@yury-N73SV> Message-ID: References: <20160903142550.GA29995@yury-N73SV> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-SW-Source: 2016-09/txt/msg00069.txt.bz2 On Sat, 3 Sep 2016, Yury Norov wrote: > > +#define FPSR_STATUS 0x1f80UL > > +#define FPSR_STATUS_ALL ((FPSR_STATUS << 6) | (FPSR_STATUS << 19) \ > > + | (FPSR_STATUS << 32) | (FPSR_STATUS << 45)) > > + > > Hi Josepf, > > Is it possible to #define offsets to avoid magic numbers, or drop the > link to specification? I think defining extra macros (which would be used only once each) for the offsets of the four status/control fields would make the code less readable, not more, in this case (like the recent rejected Linux kernel patches to use symbolic names for file access modes). It's clear to readers of the code what those offsets are meant to be (I think it's reasonable to expect readers of ia64 floating-point code to have a general awareness of the four status/control fields, with instructions being able to choose which one is applied to that instruction), and anyone checking the precise values of offsets and bit-masks has to refer to architecture manuals, with or without macros involved. -- Joseph S. Myers joseph@codesourcery.com