From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 56209 invoked by alias); 20 Apr 2016 22:10:34 -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 55896 invoked by uid 89); 20 Apr 2016 22:10:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=tuned, fool X-HELO: zimbra.cs.ucla.edu Subject: Re: question regarding div / std::div implementation To: Daniel Gutson References: <5717DF65.5060606@linaro.org> <5717E68D.2020905@linaro.org> <5717EB44.5020508@linaro.org> <5717F6BD.90705@cs.ucla.edu> Cc: Adhemerval Zanella , GNU C Library From: Paul Eggert Message-ID: <5717FE54.3070003@cs.ucla.edu> Date: Wed, 20 Apr 2016 22:10:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2016-04/txt/msg00518.txt.bz2 On 04/20/2016 02:55 PM, Daniel Gutson wrote: > That fools the compiler. Yes, bizarre C code can fool the compiler. I was talking about realistic code, not contrived examples. glibc itself uses % and / in places where div/ldiv/lldiv might plausibly be used internally, and this is portable and maintainable and efficient and there is no real reason to change this, even if div/ldiv/lldiv were tuned. Similarly for other C applications.