From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-il1-x12e.google.com (mail-il1-x12e.google.com [IPv6:2607:f8b0:4864:20::12e]) by sourceware.org (Postfix) with ESMTPS id 997433858C5F for ; Tue, 19 Dec 2023 05:09:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 997433858C5F Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 997433858C5F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::12e ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702962566; cv=none; b=tc5mNsgSXWnc+xVKHu2r7OR9t27hXX8qOSnK4Om4VOAvE1CrbRx21FtYiMqI9C3FxzaWd6fjjw6tkHTQvhaIvdk++mwyWA5s73ziLfhffQpa4ZSIHrmRarw2LmQhUnNZVdZInE37ggyJejmxdNWVtpzJiCyGHOQquxmJerN8zhY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702962566; c=relaxed/simple; bh=dz8zNB5zOuX2CoDsxlxUy7P/L9CvCML9eyLZ18Rbk4E=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=sONDUp4KgAULUalqDU3TZep4np2H7HKGpoPjQkaPAAxjNBJTOVZVW661tzrqk+5Uvqc1QyBe8OkLwH1w/d+nfnya8Ad3D4xxH+7J2cuUSt7IGarC83h6OOjUjnNbU7zzt6FuBjgW0tgQzHtDCYCfCtAOIeRiTTnhJyzqY/Uc8sQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-il1-x12e.google.com with SMTP id e9e14a558f8ab-35fbdcec131so2248595ab.0 for ; Mon, 18 Dec 2023 21:09:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702962563; x=1703567363; darn=sourceware.org; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=e0Xh5hLIzqhiAKNMkX3c3cVGmJwwzo6enrBGz3pavns=; b=OZ4wz64M3RtrOeKsDGgaTLFpZ5lhwAMvdMKYNmCTsqsG4+pLcwpoGMQFqf3lI42YQH ywzFnnnoOiehPw12OsyY6V/gXAlGzrpZiKSTi4L+a7dacO5nadaJPJ9RwaamrACoob/t VA8kYqS88474S+7qkL6q16ZVmrTh5NBv+Rs4f9iaUyW5hS3apdLOSBq7067C2vo02WTE VHCxjxfLVJU86fo0YvdJcEPj+OYazf3TddkKkUCTZ5n8s5oOPel/AZp625QsZM4MbSAx t+pm3fHURSwWzjoFsDww8dozFEs0XDr3ROTu06u2VRrXB6qUj+ygbiza09378QuYMtty pcyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702962563; x=1703567363; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=e0Xh5hLIzqhiAKNMkX3c3cVGmJwwzo6enrBGz3pavns=; b=kcc5zAq/aUGuNYXIa5Z1jg8ct82ouXe0LtsjJUxXph7muWuIDVgr9r1rH5wjI0lUWY SL9fKi87m9DY+kCehFtiUkfkOGChjCN0JCzX/polZ56aQZjD9wJ5DzJHYv8yaWmBT4dm JLYQDp7LSsTcxKJShHyF+/j2SIxjyP6yzisxTtFY1ujdgHEs/Vmg8RbSUOFwjUEEABYP SRdgMYzYKtubPLiU3B+HD2jsG/aaj+HQIrCRLN++azXEKF4BnyXi1lr7x/ydZOZuVitG RBNkH7PK/i+ktC0+tWR0MCg6HHrX/mkVzxgyrj2a9dfX0fYr7jGRrmE/ovntz8nYfLfB rfHA== X-Gm-Message-State: AOJu0YxQZqoVtrvQ5p5WfM+7A8AxD4aEaC8YvQgxYo73Q3qMlOZDxmCs dLnv+8umetDrANBUwAfBRRB94kfrzqs= X-Google-Smtp-Source: AGHT+IE4ls8IbZwCWEAqC5vJRRmL7vHrub9IcAmTcPStDKmQkJC9AjPeBYQU1xdjz5qLaWmv222a7g== X-Received: by 2002:a05:6e02:1ba7:b0:35f:741a:7900 with SMTP id n7-20020a056e021ba700b0035f741a7900mr12543997ili.15.1702962563510; Mon, 18 Dec 2023 21:09:23 -0800 (PST) Received: from [172.31.0.109] ([136.36.72.243]) by smtp.gmail.com with ESMTPSA id bt5-20020a056e02248500b0035b186a19f7sm7397566ilb.23.2023.12.18.21.09.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 Dec 2023 21:09:23 -0800 (PST) Message-ID: Date: Mon, 18 Dec 2023 22:09:21 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Fwd: Yet another fix for mcore-sim Content-Language: en-US To: Andrew Burgess , apinski--- via Gdb-patches References: <6de3406e-b76a-4599-b946-10e431a2dd75@gmail.com> <87plz34qnv.fsf@redhat.com> From: Jeff Law In-Reply-To: <87plz34qnv.fsf@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 12/18/23 05:54, Andrew Burgess wrote: > Jeff Law writes: > >> Someday I'll type "sourceware.org" correctly on a consistent basis. >> >> >> >> -------- Forwarded Message -------- >> Subject: Yet another fix for mcore-sim >> Date: Sat, 16 Dec 2023 21:52:12 -0700 >> From: Jeff Law >> To: gdb-patches@sourcware.org >> >> >> This came up testing the CRC optimization work from Mariam@RAU. >> Basically to optimize some CRC loops into table lookups or carryless >> multiplies, we may need to do a bit reflection, which on the mcore >> processor is done using a rotate instruction. >> >> Unfortunately the simulator implementation of rotates has the exact same >> problem as we saw with right shifts. The input value may have been sign >> extended from 32 to 64 bits. When we rotate the extended value, we get >> those sign extension bits and thus the wrong result. >> >> The fix is the same. Rather than using a "long", use a uint32_t for the >> type of the temporary. This fixes a handful of tests in the GCC testsuite: >> >>> mcore-sim: gcc.c-torture/execute/20100805-1.c -O0 execution test >>> mcore-sim: gcc.c-torture/execute/20100805-1.c -O1 execution test >>> mcore-sim: gcc.c-torture/execute/20100805-1.c -O2 execution test >>> mcore-sim: gcc.c-torture/execute/20100805-1.c -O2 -flto -fno-use-linker-plugin -flto-partition=none execution test >>> mcore-sim: gcc.c-torture/execute/20100805-1.c -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects execution test >>> mcore-sim: gcc.c-torture/execute/20100805-1.c -O3 -g execution test >>> mcore-sim: gcc.c-torture/execute/20100805-1.c -Os execution test >>> mcore-sim: gcc.c-torture/execute/20180112-1.c -O0 execution test >>> mcore-sim: gcc.c-torture/execute/20180112-1.c -O1 execution test >>> mcore-sim: gcc.c-torture/execute/20180112-1.c -O2 execution test >>> mcore-sim: gcc.c-torture/execute/20180112-1.c -O2 -flto -fno-use-linker-plugin -flto-partition=none execution test >>> mcore-sim: gcc.c-torture/execute/20180112-1.c -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects execution test >>> mcore-sim: gcc.c-torture/execute/20180112-1.c -O3 -g execution test >>> mcore-sim: gcc.c-torture/execute/20180112-1.c -Os execution test >>> mcore-sim: gcc.dg/20050922-1.c execution test >>> mcore-sim: gcc.dg/crc-25.c execution test >>> mcore-sim: gcc.dg/crc-26.c execution test >>> mcore-sim: gcc.dg/crc-8.c execution test >>> mcore-sim: gcc.dg/pr57233.c execution test >> >> >> The crc-* tests are Mariam's CRC optimizer tests. The rest are >> regression tests already in the GCC testsuite. >> >> OK for the trunk? > > It would be nice if there were some tests added to the simulator tree. > Could you create one similar to sim/testsuite/mcore/lsr.s maybe? > > (Pre-)Approved with a test: Test added. Fix and test pushed to the trunk. Thanks, jeff ps. Hadn't realized you'd moved to Red Hat. Looks like we missed each other by about ~6 months.