From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9607 invoked by alias); 20 Nov 2012 07:46:38 -0000 Received: (qmail 7812 invoked by uid 48); 20 Nov 2012 07:46:16 -0000 From: "cosmos at claycon dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/55393] gcc/g++ multiplies two unsigned integers using the IMULQ instruction Date: Tue, 20 Nov 2012 07:46:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cosmos at claycon dot org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-11/txt/msg01882.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55393 --- Comment #2 from Clay Harris 2012-11-20 07:46:15 UTC --- I shouldn't write bug reports when I've been awake for 24 hours. The bit 63 reference was for one more 9 in num, which got missed with a cut & paste error. In any case, the IMUL instruction is doing what its supposed to for the C code (and executes faster than MUL). The handling of the sign bit would be wrong, except that we're throwing away the upper half of the product, where the discrepancy would occur. It would be very convenient for overflow testing to have the upper half (or at least the Carry flag), but alas gcc doesn't seem to have a way to do that since long long int stopped being 128 bits in 64bit mode. Please close this bug as INVALID.