From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 5LdDMfC8QWJZFQAAWB0awg (envelope-from ) for ; Mon, 28 Mar 2022 09:49:36 -0400 Received: by simark.ca (Postfix, from userid 112) id B75B91EFB9; Mon, 28 Mar 2022 09:49:36 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RDNS_DYNAMIC autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id F18A91ED17 for ; Mon, 28 Mar 2022 09:49:35 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 557C43888C77 for ; Mon, 28 Mar 2022 13:49:35 +0000 (GMT) Received: from arjuna.pair.com (arjuna.pair.com [209.68.5.131]) by sourceware.org (Postfix) with ESMTPS id 076C23857811; Mon, 28 Mar 2022 13:38:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 076C23857811 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=bitrange.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=bitrange.com Received: by arjuna.pair.com (Postfix, from userid 3006) id AAD018A658; Mon, 28 Mar 2022 09:38:42 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by arjuna.pair.com (Postfix) with ESMTP id AA1178A655; Mon, 28 Mar 2022 09:38:42 -0400 (EDT) Date: Mon, 28 Mar 2022 09:38:42 -0400 (EDT) From: Hans-Peter Nilsson X-X-Sender: hp@arjuna.pair.com To: Jeff Law Subject: Re: Fix for MUL instruction on the v850 In-Reply-To: <3524b3c5-354f-b1cb-b9f4-ea815fa5774a@gmail.com> Message-ID: References: <3524b3c5-354f-b1cb-b9f4-ea815fa5774a@gmail.com> User-Agent: Alpine 2.20.16 (BSF 172 2016-09-29) MIME-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY=------------t1yOcqtvLyu0vSok8DZzyxoX Content-ID: X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: binutils@sourceware.org, gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --------------t1yOcqtvLyu0vSok8DZzyxoX Content-Type: text/plain; CHARSET=US-ASCII; FORMAT=flowed Content-ID: (Wrong list; I CC:ed the right one.) On Sat, 26 Mar 2022, Jeff Law via Binutils wrote: > The v850 gcc testsuite started failing test vrp13 about a week ago. This was > ultimately tracked down on a bug in the simulator's handling of the MUL > instruction (a change in the compiler resulted in the test no longer > compile-time optimized away). > > MUL on the v850 is a 32x32->64 multiply with the hi/low parts of the result > going into distinct registers.? ?? mul r1, r2, r3 is r1xr2 -> (r3, r2) where > r2 holds the low 32 bits of the result and r3 holds the high 32 bits of the > result. > > We had inputs of 2, -10 and produced an output of 20.? Opps ;-) > > The v850 is a 32bit processor using 2s complement.? So to check if a value is > negative we merely need to check if bit 0x80000000 is on. Anything else is > just introducing dependencies on the host system's types, argument promotions, > etc, which is precisely what happened in this case. > > No new testcase for the simulator.? Not only does vrp13 test this, but about > 1800 other tests which have flipped from failing to passing in the GCC > testsuite...? So I can say it's being tested and if it were to regress again, > we'd catch it. > > OK for the trunk? > > Thanks, > Jeff OK if you mention the gcc test-suite in the commit message or a comment, but please (re)consider adding a self-contained (i.e. just binutils+sim) test-case. Suggested inspiration: "git grep sim" in the CRIS sim test-suite, though without a "dump register" framework macro you need to compare with expected results instead of matching output. brgds, H-P --------------t1yOcqtvLyu0vSok8DZzyxoX Content-Type: text/plain; CHARSET=UTF-8; NAME=0001-v850.patch Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: ATTACHMENT; FILENAME=0001-v850.patch CSogc2ltL3Y4NTAvc2ltb3BzLmMgKE11bHRpcGx5NjQpOiBQcm9wZXJseSB0ZXN0IGlmIHdl IG5lZWQgdG8gbmVnYXRlCgllaXRoZXIgb2YgdGhlIG9wZXJhbmQuCgpkaWZmIC0tZ2l0IGEv c2ltL3Y4NTAvc2ltb3BzLmMgYi9zaW0vdjg1MC9zaW1vcHMuYwppbmRleCA4ZmFjOGJkOTg5 MS4uOTQzOTllMmFkNGYgMTAwNjQ0Ci0tLSBhL3NpbS92ODUwL3NpbW9wcy5jCisrKyBiL3Np bS92ODUwL3NpbW9wcy5jCkBAIC0zMzksMTAgKzMzOSwxMCBAQCBNdWx0aXBseTY0IChpbnQg c2lnbiwgdW5zaWduZWQgbG9uZyBvcDApCiAJICAKICAgICAgIHNpZ24gPSAob3AwIF4gb3Ax KSAmIDB4ODAwMDAwMDA7CiAJICAKLSAgICAgIGlmICgoKHNpZ25lZCBsb25nKSBvcDApIDwg MCkKKyAgICAgIGlmIChvcDAgJiAweDgwMDAwMDAwKQogCW9wMCA9IC0gb3AwOwogCSAgCi0g ICAgICBpZiAoKChzaWduZWQgbG9uZykgb3AxKSA8IDApCisgICAgICBpZiAob3AxICYgMHg4 MDAwMDAwMCkKIAlvcDEgPSAtIG9wMTsKICAgICB9CiAgICAgICAK --------------t1yOcqtvLyu0vSok8DZzyxoX--