From patchwork Wed May 15 04:53:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Law X-Patchwork-Id: 1935263 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=ventanamicro.com header.i=@ventanamicro.com header.a=rsa-sha256 header.s=google header.b=h9/nMYRU; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; 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 [IPv6:2620:52:3:1:0:246e:9693:128c]) (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 4VfLVC5y4Nz1ydW for ; Wed, 15 May 2024 14:54:09 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 28C84384AB54 for ; Wed, 15 May 2024 04:54:08 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by sourceware.org (Postfix) with ESMTPS id D1A053858D35 for ; Wed, 15 May 2024 04:53:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D1A053858D35 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=ventanamicro.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D1A053858D35 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::632 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715748827; cv=none; b=VGrgRg8rgJFcbowZpQdYmJ4UZKokdoJjZX5LL5COt8jOSVKk3wtgUWl/kJUNdAvBZfVLddcwf9u5gjYkhR5/oK0hO4NKRxXQ4lCbc4/8JSkud0jC6Ye35z1A8PamnK8/yE6ZyC7SSu8j9GM6d2Pk9L6Z2PKBD0RDw6wmBJYT1M0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715748827; c=relaxed/simple; bh=l0lSg1ZB1pEEwHTpIYoXJr+Q+1Nm2wgUr3yVzWgjhDY=; h=DKIM-Signature:Message-ID:Date:MIME-Version:From:To:Subject; b=mxMxMnc2NMDzJsgaSATjjIhyUUXGw99si35P/Vnb2FPpSNcg/UarbFx6FzejJ7nN9FkDlekPKiZqwNDmZi+OTVOVj63cawASSXashfAh6fhDn2cllieu/XYmPmZECju+mznAAhUfNqwDH0DCYLKBjXATcBN9g+yYt94FuYkv8Bg= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1ee0132a6f3so48914355ad.0 for ; Tue, 14 May 2024 21:53:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1715748824; x=1716353624; darn=gcc.gnu.org; h=subject:to:from:content-language:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=gJ6TyPq4RjoBtU1h+0nV6oNGNQYQpHn2aInv0Uxl7lU=; b=h9/nMYRU5OLgIfQsTD9DLKvUsjxiW+9Ltg7Obip2hXn5CoMLB/UTfLvCsyx3dlHYnq hGPy/SpZsOsp52iwD0E6WTJLttv3bCvBuvlZJKQoB4fIkqDL0K7ZwGEHg0SBZYWf7BJX GWccv3siajaxjrr9hg2ea9+VPFE6Fcr8F3K7c0W41r4TKrSaqpIkIXnQWlSI4ruXe2dX jD4k1jsaKsUmte5Nu3QW0G2vKBjobrTR+t+EqBCK84R+mYW8cRFHHaQNJXBvIEPGCMux 0fIWYv7E1jvz5gjZwt3AA1v0zWUpoz3Px3j8GbwnquIoOooWyqrWvKorG1t3t2OLbujn wxLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715748824; x=1716353624; h=subject:to:from:content-language:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=gJ6TyPq4RjoBtU1h+0nV6oNGNQYQpHn2aInv0Uxl7lU=; b=U6li5sictaXVwjC/xOgiP7vDBrLzgFS26ahFuyP/tNez+I6nwu516VB0AYWO4D57AW vPPu3bvwxkMw/4DjAP4FamTM4MWR60cFly9OeXjV4tmFYySMb2cgcw1oxYp3ulbrUkaW +1RDaPJmm27cS/9DoYooylLCMKHIxkl+CSlEdtsd2fHExhZm53T/bELj83HDA97RpnLb VaUgjuaaRqqJ7vFQ/doSF/KzDdtf/Hahr6ZsK1Lnk6KmSdhYbO331yGiQag4RnzZ/Y4y PpeVcMbPGY6S1orZT28lkJBT0+XYtx0b7F41X8bQk6wf07F4e+5JsXsyxOm/QXFl8uD1 Dmrg== X-Gm-Message-State: AOJu0Yw+qsD+f/TCbiI6187+hHpQB1JCnF0Vx6tuCUZVTaxY6UQQH5uF FgWDIiDwWfMC34eg1TbFAXjKED5dogpy7tYPOMbWJjj/rYOm06U85KAsskRkYS7Yrnav8B6z7Da / X-Google-Smtp-Source: AGHT+IFNHQB/c7Ht/JZI9A8dpDx9bwWcimpCvOG0tOwMDr4A+nEXbT8318A4aclMDBftnre4o4If8A== X-Received: by 2002:a17:903:2444:b0:1e4:55d8:dfae with SMTP id d9443c01a7336-1ef43c0cec0mr178381705ad.4.1715748817825; Tue, 14 May 2024 21:53:37 -0700 (PDT) Received: from [172.31.0.109] ([136.36.72.243]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1ef0c25698csm110335795ad.305.2024.05.14.21.53.36 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 14 May 2024 21:53:37 -0700 (PDT) Message-ID: <6b1c612a-e412-4b2e-acc9-16cf5a1480ac@ventanamicro.com> Date: Tue, 14 May 2024 22:53:36 -0600 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta Content-Language: en-US From: Jeff Law To: "gcc-patches@gcc.gnu.org" Subject: [committed] Fix rv32 issues with recent zicboz work X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, LIKELY_SPAM_BODY, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP 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 I should have double-checked the CI system before pushing Christoph's patches for memset-zero. While I thought I'd checked CI state, I must have been looking at the wrong patch from Christoph. Anyway, this fixes the rv32 ICEs and disables one of the tests for rv32. The test would need a revamp for rv32 as the expected output is all rv64 code using "sd" instructions. I'm just not vested deeply enough into rv32 to adjust the test to work in that environment though it should be fairly trivial to copy the test and provide new expected output if someone cares enough. Verified this fixes the rv32 failures in my tester: > New tests that FAIL (6 tests): > > unix/-march=rv32gcv: gcc: gcc.target/riscv/cmo-zicboz-zic64-1.c -O1 (internal compiler error: in extract_insn, at recog.cc:2812) > unix/-march=rv32gcv: gcc: gcc.target/riscv/cmo-zicboz-zic64-1.c -O1 (test for excess errors) > unix/-march=rv32gcv: gcc: gcc.target/riscv/cmo-zicboz-zic64-1.c -O2 (internal compiler error: in extract_insn, at recog.cc:2812) > unix/-march=rv32gcv: gcc: gcc.target/riscv/cmo-zicboz-zic64-1.c -O2 (test for excess errors) > unix/-march=rv32gcv: gcc: gcc.target/riscv/cmo-zicboz-zic64-1.c -O3 -g (internal compiler error: in extract_insn, at recog.cc:2812) > unix/-march=rv32gcv: gcc: gcc.target/riscv/cmo-zicboz-zic64-1.c -O3 -g (test for excess errors) And after the ICE is fixed, these are eliminated by only running the test for rv64: > New tests that FAIL (3 tests): > > unix/-march=rv32gcv: gcc: gcc.target/riscv/cmo-zicboz-zic64-1.c -O1 check-function-bodies clear_buf_123 > unix/-march=rv32gcv: gcc: gcc.target/riscv/cmo-zicboz-zic64-1.c -O2 check-function-bodies clear_buf_123 > unix/-march=rv32gcv: gcc: gcc.target/riscv/cmo-zicboz-zic64-1.c -O3 -g check-function-bodies clear_buf_123 Pushed to the trunk. Jeff commit e410ad74e5e4589aeb666aa298b2f933e7b5d9e7 Author: Jeff Law Date: Tue May 14 22:50:15 2024 -0600 [committed] Fix rv32 issues with recent zicboz work I should have double-checked the CI system before pushing Christoph's patches for memset-zero. While I thought I'd checked CI state, I must have been looking at the wrong patch from Christoph. Anyway, this fixes the rv32 ICEs and disables one of the tests for rv32. The test would need a revamp for rv32 as the expected output is all rv64 code using "sd" instructions. I'm just not vested deeply enough into rv32 to adjust the test to work in that environment though it should be fairly trivial to copy the test and provide new expected output if someone cares enough. Verified this fixes the rv32 failures in my tester: > New tests that FAIL (6 tests): > > unix/-march=rv32gcv: gcc: gcc.target/riscv/cmo-zicboz-zic64-1.c -O1 (internal compiler error: in extract_insn, at recog.cc:2812) > unix/-march=rv32gcv: gcc: gcc.target/riscv/cmo-zicboz-zic64-1.c -O1 (test for excess errors) > unix/-march=rv32gcv: gcc: gcc.target/riscv/cmo-zicboz-zic64-1.c -O2 (internal compiler error: in extract_insn, at recog.cc:2812) > unix/-march=rv32gcv: gcc: gcc.target/riscv/cmo-zicboz-zic64-1.c -O2 (test for excess errors) > unix/-march=rv32gcv: gcc: gcc.target/riscv/cmo-zicboz-zic64-1.c -O3 -g (internal compiler error: in extract_insn, at recog.cc:2812) > unix/-march=rv32gcv: gcc: gcc.target/riscv/cmo-zicboz-zic64-1.c -O3 -g (test for excess errors) And after the ICE is fixed, these are eliminated by only running the test for rv64: > New tests that FAIL (3 tests): > > unix/-march=rv32gcv: gcc: gcc.target/riscv/cmo-zicboz-zic64-1.c -O1 check-function-bodies clear_buf_123 > unix/-march=rv32gcv: gcc: gcc.target/riscv/cmo-zicboz-zic64-1.c -O2 check-function-bodies clear_buf_123 > unix/-march=rv32gcv: gcc: gcc.target/riscv/cmo-zicboz-zic64-1.c -O3 -g check-function-bodies clear_buf_123 gcc/ * config/riscv/riscv-string.cc (riscv_expand_block_clear_zicboz_zic64b): Handle rv32 correctly. gcc/testsuite * gcc.target/riscv/cmo-zicboz-zic64-1.c: Don't run on rv32. diff --git a/gcc/config/riscv/riscv-string.cc b/gcc/config/riscv/riscv-string.cc index 87f5fdee3c1..b515f44d17a 100644 --- a/gcc/config/riscv/riscv-string.cc +++ b/gcc/config/riscv/riscv-string.cc @@ -827,7 +827,10 @@ riscv_expand_block_clear_zicboz_zic64b (rtx dest, rtx length) { rtx mem = adjust_address (dest, BLKmode, offset); rtx addr = force_reg (Pmode, XEXP (mem, 0)); - emit_insn (gen_riscv_zero_di (addr)); + if (TARGET_64BIT) + emit_insn (gen_riscv_zero_di (addr)); + else + emit_insn (gen_riscv_zero_si (addr)); offset += cbo_bytes; } diff --git a/gcc/testsuite/gcc.target/riscv/cmo-zicboz-zic64-1.c b/gcc/testsuite/gcc.target/riscv/cmo-zicboz-zic64-1.c index c2d79eb7ae6..6d4535287d0 100644 --- a/gcc/testsuite/gcc.target/riscv/cmo-zicboz-zic64-1.c +++ b/gcc/testsuite/gcc.target/riscv/cmo-zicboz-zic64-1.c @@ -1,6 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-march=rv64gc_zic64b_zicboz" { target { rv64 } } } */ -/* { dg-options "-march=rv32gc_zic64b_zicboz" { target { rv32 } } } */ +/* { dg-options "-march=rv64gc_zic64b_zicboz -mabi=lp64d" } */ /* { dg-skip-if "" { *-*-* } {"-O0" "-Os" "-Og" "-Oz" "-flto" } } */ /* { dg-final { check-function-bodies "**" "" } } */ /* { dg-allow-blank-lines-in-output 1 } */