From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id qKtRKPZ1S2KdWAAAWB0awg (envelope-from ) for ; Mon, 04 Apr 2022 18:49:26 -0400 Received: by simark.ca (Postfix, from userid 112) id A35F41F344; Mon, 4 Apr 2022 18:49:26 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED 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 28A2F1ED17 for ; Mon, 4 Apr 2022 18:49:26 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 98BBB3858418 for ; Mon, 4 Apr 2022 22:49:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 98BBB3858418 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1649112565; bh=is82+S/kVWxqW2xkW2xj/6R5kteH/mB0IyivQfz/NmM=; h=Date:Subject:References:To:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=xuPPwX8uVtLbtGAA5+uXrj/OSVSOSOFYAIRaKsVp18nV/tq02+/dugIpHMAQ31uJe Ctp6xVg/MVdSQ7MD9uc89OOhCDfPSL/MaEOE3vJwphMe2wGb4kjFGnTGbzCpeVgZce +sZ+Gnki4boixT5NKeSArG7iajN+MUKdHbUWVD+U= Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by sourceware.org (Postfix) with ESMTPS id 2F27B385842E for ; Mon, 4 Apr 2022 22:49:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2F27B385842E Received: by mail-pl1-x62b.google.com with SMTP id f10so9352127plr.6 for ; Mon, 04 Apr 2022 15:49:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:references:to:from:in-reply-to; bh=7kLI6t+BXsjdIHaiuDDKgE/JwSm71GGTT95Tdtby3gk=; b=D1IHNxLM1WeORl9RCBlyeLyrTnT5AewgXePkKDjNaLF8NSvLLJxiTLqUPP1X4qwsjj 1sXSnwnEhzZI7GErZHFm9rHvR8ozqnBPMKMJs1PaaEFqEMGTa/Vw+AbDM17wnqByhhAJ yPr7iaoG5nXXTgatjjGSTDCM3ZdT2xpis8Zoim2iCLaz0d8edO1F/rkAXWSnxL4v/5pG l0ycsFArcTkCS2+hA3KtXGNfd6U2moAr/yn62nh3NBiPcckXFwxLlq9UmXmFmeY/Y1lD 3xuLgjF/ejGykpZ77rFwosBwyRaDxfE8z8hz6mun9PvyxKQcZkjY/8IgqugCcc1FweAB 3XIQ== X-Gm-Message-State: AOAM530zgluevuPeFVN0XPTETGWiNJwMlpCcn7l0+8BF4CwMhO8C4Uh9 UTsFQdPm7XO3favT8SpUqkTGv/LMfvnzVw== X-Google-Smtp-Source: ABdhPJwl5cqXhj/kGmRgNTpk9MCgznW9WDJ0Fv8ILKLdwF3Ejj/1l2nz7YyobraCfCg9vc5i89lgmw== X-Received: by 2002:a17:90b:4ac9:b0:1c9:a345:6b9a with SMTP id mh9-20020a17090b4ac900b001c9a3456b9amr630782pjb.118.1649112541948; Mon, 04 Apr 2022 15:49:01 -0700 (PDT) Received: from [172.31.0.204] (c-73-63-24-84.hsd1.ut.comcast.net. [73.63.24.84]) by smtp.gmail.com with ESMTPSA id u9-20020a056a00158900b004faad3ae570sm13780673pfk.189.2022.04.04.15.49.01 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 04 Apr 2022 15:49:01 -0700 (PDT) Content-Type: multipart/mixed; boundary="------------CSXQjoiAloLyJR5KzTRgCMGW" Message-ID: Date: Mon, 4 Apr 2022 16:49:00 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Fwd: Fix for v850e divq instruction Content-Language: en-US References: <4eaa501f-9b0a-20dc-6972-0ca0686d2a75@gmail.com> To: gdb-patches@sourceware.org In-Reply-To: <4eaa501f-9b0a-20dc-6972-0ca0686d2a75@gmail.com> X-Forwarded-Message-Id: <4eaa501f-9b0a-20dc-6972-0ca0686d2a75@gmail.com> X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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: , From: Jeff Law via Gdb-patches Reply-To: Jeff Law Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" This is a multi-part message in MIME format. --------------CSXQjoiAloLyJR5KzTRgCMGW Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Similarly, this should have gone to the gdb list. -------- Forwarded Message -------- Subject: Fix for v850e divq instruction Date: Sun, 3 Apr 2022 10:25:16 -0600 From: Jeff Law To: binutils@sourceware.org This is the last of the correctness fixes I've been carrying around for the v850. Like the other recent fixes, this is another case where we haven't been as careful as we should WRT host vs target types.   For the divq instruction both operands are 32 bit types.  Yet in the simulator code we convert them from unsigned int to signed long by assignment.  So 0xfffffffb (aka -5) turns into 4294967291 and naturally that changes the result of our division. The fix is simple, insert a cast to int32_t to force interpretation as a signed value. Testcase for the simulator is included.  It has a trivial dependency on the bins patch. OK for the trunk? JEff --------------CSXQjoiAloLyJR5KzTRgCMGW Content-Type: text/plain; charset=UTF-8; name="P" Content-Disposition: attachment; filename="P" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL3NpbS90ZXN0c3VpdGUvdjg1MC9kaXZxLmNncyBiL3NpbS90ZXN0c3Vp dGUvdjg1MC9kaXZxLmNncwpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwMDAw MC4uODQ2MWY4NmY3YTAKLS0tIC9kZXYvbnVsbAorKysgYi9zaW0vdGVzdHN1aXRlL3Y4NTAv ZGl2cS5jZ3MKQEAgLTAsMCArMSwxMSBAQAorIyB2ODUwIGJpbnMKKyMgbWFjaDogdjg1MGUz djUKKyMgYXM6IC1tdjg1MGUzdjUKKworCS5pbmNsdWRlICJ0ZXN0dXRpbHMuaW5jIgorCXNl dGkJMHhmZmZmZmZmYiByMTEKKwlzZXRpCTB4MzIgcjEwCisJZGl2cQlyMTEsIHIxMCwgcjEx CisJcmVnCXIxMCwgMHhmZmZmZmZmNgorCXJlZwlyMTEsIDB4MAorCXBhc3MKZGlmZiAtLWdp dCBhL3NpbS92ODUwL3NpbW9wcy5jIGIvc2ltL3Y4NTAvc2ltb3BzLmMKaW5kZXggZDI2NDA1 NzdmYzguLmY5MGEwZjc1NzNjIDEwMDY0NAotLS0gYS9zaW0vdjg1MC9zaW1vcHMuYworKysg Yi9zaW0vdjg1MC9zaW1vcHMuYwpAQCAtMzEzNSw4ICszMTM1LDggQEAgdjg1MF9kaXYgKFNJ TV9ERVNDIHNkLCB1bnNpZ25lZCBpbnQgb3AwLCB1bnNpZ25lZCBpbnQgb3AxLCB1bnNpZ25l ZCBpbnQgKm9wMnAsIHUKICAgYmZkX2Jvb2xlYW4gICAgIG92ZXJmbG93ID0gRkFMU0U7CiAg IAogICAvKiBDb21wdXRlIHRoZSByZXN1bHQuICAqLwotICBkaXZpZGVfYnkgICA9IG9wMDsK LSAgZGl2aWRlX3RoaXMgPSBvcDE7CisgIGRpdmlkZV9ieSAgID0gKGludDMyX3Qpb3AwOwor ICBkaXZpZGVfdGhpcyA9IChpbnQzMl90KW9wMTsKIAogICBpZiAoZGl2aWRlX2J5ID09IDAg fHwgKGRpdmlkZV9ieSA9PSAtMSAmJiBkaXZpZGVfdGhpcyA9PSAoMSA8PCAzMSkpKQogICAg IHsKCg== --------------CSXQjoiAloLyJR5KzTRgCMGW--