From patchwork Tue Jan 9 17:19:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Law X-Patchwork-Id: 1884530 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=nE6tD4nG; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4T8d3d0tLGz1yPh for ; Wed, 10 Jan 2024 04:20:11 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0C0B438582BE for ; Tue, 9 Jan 2024 17:20:09 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-il1-x132.google.com (mail-il1-x132.google.com [IPv6:2607:f8b0:4864:20::132]) by sourceware.org (Postfix) with ESMTPS id 4DA7D38582BD for ; Tue, 9 Jan 2024 17:19:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4DA7D38582BD 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 4DA7D38582BD Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::132 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704820783; cv=none; b=vJqXslx277lheIVBa7BBga4Qus8lrHkNq4qZ3MLCLYyTULQEabx0VMT0ZjbBLDmkdful76x0xA2s8S+GoKId89b0o7AvGU+PsQMj4Ry4lSdV7JNUsmcgNz3uxHxlzpTHucBUlArVUnUDB67gzYgnmR3UpMXF0UXXeSmT6kcQkm4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704820783; c=relaxed/simple; bh=xbkfGRC3n9vidK7vu0gaeYa99WeN0/FYOX9M/nXjabo=; h=DKIM-Signature:Message-ID:Date:MIME-Version:From:Subject:To; b=ZXTiHRZn/PaVisXBRI4EfEbZN4j+Nl1EW56n8LFgiasMiitZLMeLUCvct9LOCMUIyh2RbSVw9EuaSGJhioZr6ucZCLoF5cydR/nPIcFa20OZhwoOgsQviB7hr7TDH6ZPWQrJf8k/XqUqtQlunCpG0Vs82A5nZ9R9PCbGDYlvalQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-il1-x132.google.com with SMTP id e9e14a558f8ab-3606f507efeso15567855ab.3 for ; Tue, 09 Jan 2024 09:19:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704820779; x=1705425579; darn=gcc.gnu.org; h=to:subject:from:content-language:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=TtNjiilcu0dF7T3jpx6vH4iRx5aclLo2EA51XtuH7cE=; b=nE6tD4nGucZ2klvaHEmyqZolVArEr7u79caHmFvENYZPepwqfHdTIHFPhdCZ5hQmEk MmchoHK+NfG0hab9Yl4b5SHWzqTeZUTtxA4C9OjxCaznk5dv5PU4XCxNNwC9m5zDJFID HVq6PGW4G2Hhg66CrtXic+BD72E+1H8u/HwbFrOo66MdDN7Jrn2JGrYlc6YPAt3So/Xm R5eTpW2XmLiotkaR5PeJ4xsCd4XjHyXmOcvIa4kAH+AHQkybK4X9iditFEcMMVen77iC 44rWRm5wV1XSas2ZQN0lRZx1ykrweSqoEhznx3VMkqxamIkkh54rw8Y20dmhP+yHBC+f xRrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704820779; x=1705425579; h=to:subject:from:content-language:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=TtNjiilcu0dF7T3jpx6vH4iRx5aclLo2EA51XtuH7cE=; b=SIwcEt97O9TrNRumcDXP8xMLlYcs1i1Te5ATVFv6sJV63fMqWJLo3fnmQ3sGow5WHX wZss74dGZmPZXh993ipYYiiblml+5BeYAICrXOKz/WGFS3So3QsE/aqCSeKqWfGVCi9b 3+69PTro++tbrCsY/LXJw3ObLrguLGPEbGdu0GCve7nabsWqKeGQAghBmSTOHG55LLHw OY10d6KXoW2vhHZaYXFz/Hc6hUOjsnngR7TIvZHm8NEAAGRk6dSdBxpGqyIjZurdevV6 M18XkO4nOv/DQV7dMVvMyagwIAh7gbMxjYR+kVTUI1XD7XEOUQRhDaxjhRQp6FZ9JTGA T8dQ== X-Gm-Message-State: AOJu0Yyf6ttri2xTHAli73YCNsZdICiVzmLLQ1iYxqyROL8pH/F4clUy wbZg1yOHDERmx2U953FxVxhK2AWongs= X-Google-Smtp-Source: AGHT+IGgzTDiOBy4vM7X1LEzSZm+qm2rGsZbFb2XukMEoAHxWDtfdmnJi4XrJ4EZvgcuHNZgGB0zRg== X-Received: by 2002:a05:6e02:1787:b0:360:7acd:5dd8 with SMTP id y7-20020a056e02178700b003607acd5dd8mr9495200ilu.33.1704820778909; Tue, 09 Jan 2024 09:19:38 -0800 (PST) Received: from [172.31.0.109] ([136.36.72.243]) by smtp.gmail.com with ESMTPSA id w2-20020a92d602000000b0035fea0268bcsm696767ilm.28.2024.01.09.09.19.37 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 09 Jan 2024 09:19:38 -0800 (PST) Message-ID: Date: Tue, 9 Jan 2024 10:19:37 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US From: Jeff Law Subject: [committed] Fix minor bug in epiphany port To: "gcc-patches@gcc.gnu.org" X-Spam-Status: No, score=-8.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org So I consider this port dead as it semi-randomly fails in reload due to unrelated changes earlier in the gimple and RTL pipelines. Regardless Richard S's late-combine work did show a very obvious error in the port that we should go ahead and fix as long as the port is in-tree. The epiphany add-with-immediate instruction allows an 11 bit signed immediate. That gives the instruction an immediate range of -1024..1023. The port actually allowed -8192..8191 due to the uber-weird constraint definition. I've simplified the constraint to match the hardware documentation I was able to find. That was enough to get the epiphany port to build libgcc/newlib with Richard S's late-combine work. The testsuite is so flakey on that port (due to the reload failures) that my tester doesn't run it. So no comparisons are available. Anyway, I've pushed this to the trunk. jeff commit 0beb20c01cf7120c724f9882be41a77e970fe63d Author: Jeff Law Date: Tue Jan 9 10:17:54 2024 -0700 [committed] Fix minor bug in epiphany port So I consider this port dead as it semi-randomly fails in reload due to unrelated changes earlier in the gimple and RTL pipelines. Regardless Richard S's late-combine work did show a very obvious error in the port that we should go ahead and fix as long as the port is in-tree. The epiphany add-with-immediate instruction allows an 11 bit signed immediate. That gives the instruction an immediate range of -1024..1023. The port actually allowed -8192..8191 due to the uber-weird constraint definition. I've simplified the constraint to match the hardware documentation I was able to find. That was enough to get the epiphany port to build libgcc/newlib with Richard S's late-combine work. The testsuite is so flakey on that port (due to the reload failures) that my tester doesn't run it. So no comparisons are available. gcc/ * config/epiphany/constraints.md (Car): Allow -1024..1023, no more, no less. diff --git a/gcc/config/epiphany/constraints.md b/gcc/config/epiphany/constraints.md index e4fda2d34a4..5dc960175f1 100644 --- a/gcc/config/epiphany/constraints.md +++ b/gcc/config/epiphany/constraints.md @@ -98,12 +98,12 @@ (define_constraint "Rgs" (match_test "REGNO (op) >= FIRST_PSEUDO_REGISTER || REGNO (op) <= 7"))) ;; Constant suitable for the addsi3_r pattern. +;; No idea why we previously used RTX_OK_FOR_OFFSET with SI, HI an QI +;; modes. The instruction in question accepts 11 bit signed constants. (define_constraint "Car" "addsi3_r constant." (and (match_code "const_int") - (ior (match_test "RTX_OK_FOR_OFFSET_P (SImode, op)") - (match_test "RTX_OK_FOR_OFFSET_P (HImode, op)") - (match_test "RTX_OK_FOR_OFFSET_P (QImode, op)")))) + (match_test "IN_RANGE (INTVAL (op), -1024, 1023)"))) ;; The return address if it can be replaced with GPR_LR. (define_constraint "Rra"