From patchwork Tue May 21 17:36:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vineet Gupta X-Patchwork-Id: 1937499 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=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=W6qVJxKL; 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 4VkM7J4z57z20PS for ; Wed, 22 May 2024 03:36:44 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EB8EA3849AC1 for ; Tue, 21 May 2024 17:36:42 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by sourceware.org (Postfix) with ESMTPS id B5A7B3858C66 for ; Tue, 21 May 2024 17:36:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B5A7B3858C66 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rivosinc.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B5A7B3858C66 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::102e ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716312983; cv=none; b=jLs25SWmvkTEDHCLlpLqSrNiQAXyWv00Na1J7eABPeWPDUVDi97Bfn4WRTQWmG/dF2zg0JeImBMkA4ZfXobd5lbxhHphdpJODVYeY/HNcabT/vCAPCQCAqEeJ9baGFimNoKkEdSbe5Nw8cayki32ZZfCi2K0UPEEoJwYuyesZgY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716312983; c=relaxed/simple; bh=NhL1EvLrwvxQaGT31xGx623w3kAoNhOpK+Jw9wzIL54=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=DsIErKEXqdBjpxvGugZzJMDuE3bnXLUc43d+wg+NmivOUSdnZRS+rhlPDkKbKReqzAcrzqRPF6EgyTOXas1H5QncIlNjNJ1h+JeXumYsh00GtpXthSPN7CWtpS4+0Vz+NSKvEhgKX+5/aIdMmXvvMLhGS9Zjlk3Rb2iSEYcJdJw= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pj1-x102e.google.com with SMTP id 98e67ed59e1d1-2bd9256ffdfso49390a91.1 for ; Tue, 21 May 2024 10:36:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1716312979; x=1716917779; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=UirLzWLFhOf/eWPqoJ8GXvoXwYasKLaB96a6J0BYjn8=; b=W6qVJxKLeH/yWcrOxLNaN3uuht8vxlNkUoTd+T6bLk1TohCQYmQT3d7F/jyG2BN97v G1go07mjljvWYq+To6iqwjp57H/WrgJEN/Bbkh160mCHbU6DLnmrVxt2gEMKf7toVwPs BKc9wH7bQh81xPy/si4xqH9KP1j2CWQH/OkrxVGy5lokF5KoBcQte/cTs4llDNfD5ls7 knE0zclr2qsuDdDqDQMPLG6g1x3vjDBxSf3MvSy0Q8psnhCNM7g12J9cnjFOGqr2Ktd1 AN9vZXi2U6N5puyieliK9vksn4HpeizrZ+cJIMwyOU/uMCnvuRu2GvUkkRdbn23rFl6z g5zA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716312979; x=1716917779; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=UirLzWLFhOf/eWPqoJ8GXvoXwYasKLaB96a6J0BYjn8=; b=Slt69ORGCxHJFkaE1IbwFkiViUu8TO24ztNTVlMERwLQPcVx7cMu/uu5RW5Qla/9T3 kpS+hLG20q6RkUfZd9+9TwG238srExkgIY2NYcPuLfilPNjmvmUb+HBrSDHYfkiXJr58 OckhvLdo3reu4dd2lid8Y8dsBdRQxBtNsSEavc5+OZ3LEuc9oA6rZrdpI+8tC9q4ToIQ sgQb4SLTwohah+4Ltq9SdhDNSQIDntB4fRDSI7M9yKrHW+1AswuwtJWWQPyMcFusmwku HwCgs+i8mOXCmmC/C0ez/n+k41wOhu2SGy0NfJw6g9VeyiFabVgUp745ShNZDQFEnMZc xgEg== X-Gm-Message-State: AOJu0YzNXrdd0vkMvLUD0EQ8lb2/t+Y8iRMCdSl5vEHQ6mlAzyawa/S7 phC3bYUmW4YtEVP4rzp1GoC2sJHpnO5iJtGVMAZi8s+S7V+VcrpB2VPffCOv/lTAx2tfAp7CLiW FYJI= X-Google-Smtp-Source: AGHT+IG2xyZj/IYTaoLxGpRJVMkJHgIGBMrj2+S8s8looaviUNpPfttPll9YPghC/T9+sUk/MlpHGw== X-Received: by 2002:a17:90b:230c:b0:2b5:9534:56d6 with SMTP id 98e67ed59e1d1-2bd6047a8e7mr11851921a91.24.1716312979132; Tue, 21 May 2024 10:36:19 -0700 (PDT) Received: from vineet-framework.hq.rivosinc.com ([50.145.13.30]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-6f4d2a6646bsm21644037b3a.15.2024.05.21.10.36.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 10:36:18 -0700 (PDT) From: Vineet Gupta To: gcc-patches@gcc.gnu.org Cc: Vineet Gupta , Edwin Lu Subject: [COMMITTED] RISC-V: avoid LUI based const mat in prologue/epilogue expansion [PR/105733] Date: Tue, 21 May 2024 10:36:15 -0700 Message-Id: <20240521173615.132106-1-vineetg@rivosinc.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-9.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, KAM_ASCII_DIVIDERS, 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 If the constant used for stack offset can be expressed as sum of two S12 values, the constant need not be materialized (in a reg) and instead the two S12 bits can be added to instructions involved with frame pointer. This avoids burning a register and more importantly can often get down to be 2 insn vs. 3. The prev patches to generally avoid LUI based const materialization didn't fix this PR and need this directed fix in funcion prologue/epilogue expansion. This fix doesn't move the neddle for SPEC, at all, but it is still a win considering gcc generates one insn fewer than llvm for the test ;-) gcc-13.1 release | gcc 230823 | | | g6619b3d4c15c | This patch | clang/llvm --------------------------------------------------------------------------------- li t0,-4096 | li t0,-4096 | addi sp,sp,-2048 | addi sp,sp,-2048 addi t0,t0,2016 | addi t0,t0,2032 | add sp,sp,-16 | addi sp,sp,-32 li a4,4096 | add sp,sp,t0 | add a5,sp,a0 | add a1,sp,16 add sp,sp,t0 | addi a5,sp,-2032 | sb zero,0(a5) | add a0,a0,a1 li a5,-4096 | add a0,a5,a0 | addi sp,sp,2032 | sb zero,0(a0) addi a4,a4,-2032 | li t0, 4096 | addi sp,sp,32 | addi sp,sp,2032 add a4,a4,a5 | sb zero,2032(a0) | ret | addi sp,sp,48 addi a5,sp,16 | addi t0,t0,-2032 | | ret add a5,a4,a5 | add sp,sp,t0 | add a0,a5,a0 | ret | li t0,4096 | sd a5,8(sp) | sb zero,2032(a0)| addi t0,t0,-2016 | add sp,sp,t0 | ret | gcc/ChangeLog: PR target/105733 * config/riscv/riscv.h: New macros for with aligned offsets. * config/riscv/riscv.cc (riscv_split_sum_of_two_s12): New function to split a sum of two s12 values into constituents. (riscv_expand_prologue): Handle offset being sum of two S12. (riscv_expand_epilogue): Ditto. * config/riscv/riscv-protos.h (riscv_split_sum_of_two_s12): New. gcc/testsuite/ChangeLog: * gcc.target/riscv/pr105733.c: New Test. * gcc.target/riscv/rvv/autovec/vls/spill-1.c: Adjust to not expect LUI 4096. * gcc.target/riscv/rvv/autovec/vls/spill-2.c: Ditto. * gcc.target/riscv/rvv/autovec/vls/spill-3.c: Ditto. * gcc.target/riscv/rvv/autovec/vls/spill-4.c: Ditto. * gcc.target/riscv/rvv/autovec/vls/spill-5.c: Ditto. * gcc.target/riscv/rvv/autovec/vls/spill-6.c: Ditto. * gcc.target/riscv/rvv/autovec/vls/spill-7.c: Ditto. Tested-by: Edwin Lu # pre-commit-CI #1568 Signed-off-by: Vineet Gupta --- gcc/config/riscv/riscv-protos.h | 2 + gcc/config/riscv/riscv.cc | 54 +++++++++++++++++-- gcc/config/riscv/riscv.h | 7 +++ gcc/testsuite/gcc.target/riscv/pr105733.c | 15 ++++++ .../riscv/rvv/autovec/vls/spill-1.c | 4 +- .../riscv/rvv/autovec/vls/spill-2.c | 4 +- .../riscv/rvv/autovec/vls/spill-3.c | 4 +- .../riscv/rvv/autovec/vls/spill-4.c | 4 +- .../riscv/rvv/autovec/vls/spill-5.c | 4 +- .../riscv/rvv/autovec/vls/spill-6.c | 4 +- .../riscv/rvv/autovec/vls/spill-7.c | 4 +- 11 files changed, 89 insertions(+), 17 deletions(-) create mode 100644 gcc/testsuite/gcc.target/riscv/pr105733.c diff --git a/gcc/config/riscv/riscv-protos.h b/gcc/config/riscv/riscv-protos.h index c64aae18deb9..0704968561bb 100644 --- a/gcc/config/riscv/riscv-protos.h +++ b/gcc/config/riscv/riscv-protos.h @@ -167,6 +167,8 @@ extern void riscv_subword_address (rtx, rtx *, rtx *, rtx *, rtx *); extern void riscv_lshift_subword (machine_mode, rtx, rtx, rtx *); extern enum memmodel riscv_union_memmodels (enum memmodel, enum memmodel); extern bool riscv_reg_frame_related (rtx); +extern void riscv_split_sum_of_two_s12 (HOST_WIDE_INT, HOST_WIDE_INT *, + HOST_WIDE_INT *); /* Routines implemented in riscv-c.cc. */ void riscv_cpu_cpp_builtins (cpp_reader *); diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc index d0c22058b8c3..2ecbcf1d0af8 100644 --- a/gcc/config/riscv/riscv.cc +++ b/gcc/config/riscv/riscv.cc @@ -4075,6 +4075,32 @@ riscv_split_doubleword_move (rtx dest, rtx src) riscv_emit_move (riscv_subword (dest, true), riscv_subword (src, true)); } } + +/* Constant VAL is known to be sum of two S12 constants. Break it into + comprising BASE and OFF. + Numerically S12 is -2048 to 2047, however it uses the more conservative + range -2048 to 2032 as offsets pertain to stack related registers. */ + +void +riscv_split_sum_of_two_s12 (HOST_WIDE_INT val, HOST_WIDE_INT *base, + HOST_WIDE_INT *off) +{ + if (SUM_OF_TWO_S12_N (val)) + { + *base = -2048; + *off = val - (-2048); + } + else if (SUM_OF_TWO_S12_P_ALGN (val)) + { + *base = 2032; + *off = val - 2032; + } + else + { + gcc_unreachable (); + } +} + /* Return the appropriate instructions to move SRC into DEST. Assume that SRC is operand 1 and DEST is operand 0. */ @@ -7864,6 +7890,17 @@ riscv_expand_prologue (void) GEN_INT (-constant_frame)); RTX_FRAME_RELATED_P (emit_insn (insn)) = 1; } + else if (SUM_OF_TWO_S12_ALGN (-constant_frame)) + { + HOST_WIDE_INT one, two; + riscv_split_sum_of_two_s12 (-constant_frame, &one, &two); + insn = gen_add3_insn (stack_pointer_rtx, stack_pointer_rtx, + GEN_INT (one)); + RTX_FRAME_RELATED_P (emit_insn (insn)) = 1; + insn = gen_add3_insn (stack_pointer_rtx, stack_pointer_rtx, + GEN_INT (two)); + RTX_FRAME_RELATED_P (emit_insn (insn)) = 1; + } else { riscv_emit_move (RISCV_PROLOGUE_TEMP (Pmode), GEN_INT (-constant_frame)); @@ -8160,10 +8197,21 @@ riscv_expand_epilogue (int style) /* Get an rtx for STEP1 that we can add to BASE. Skip if adjust equal to zero. */ - if (step1.to_constant () != 0) + HOST_WIDE_INT step1_value = step1.to_constant (); + if (step1_value != 0) { - rtx adjust = GEN_INT (step1.to_constant ()); - if (!SMALL_OPERAND (step1.to_constant ())) + rtx adjust = GEN_INT (step1_value); + if (SUM_OF_TWO_S12_ALGN (step1_value)) + { + HOST_WIDE_INT one, two; + riscv_split_sum_of_two_s12 (step1_value, &one, &two); + insn = emit_insn (gen_add3_insn (stack_pointer_rtx, + stack_pointer_rtx, + GEN_INT (one))); + RTX_FRAME_RELATED_P (insn) = 1; + adjust = GEN_INT (two); + } + else if (!SMALL_OPERAND (step1_value)) { riscv_emit_move (RISCV_PROLOGUE_TEMP (Pmode), adjust); adjust = RISCV_PROLOGUE_TEMP (Pmode); diff --git a/gcc/config/riscv/riscv.h b/gcc/config/riscv/riscv.h index 0d27c0d378df..d6b14c4d6205 100644 --- a/gcc/config/riscv/riscv.h +++ b/gcc/config/riscv/riscv.h @@ -641,6 +641,13 @@ enum reg_class #define SUM_OF_TWO_S12(VALUE) \ (SUM_OF_TWO_S12_N (VALUE) || SUM_OF_TWO_S12_P (VALUE)) +/* Variant with first value 8 byte aligned if involving stack regs. */ +#define SUM_OF_TWO_S12_P_ALGN(VALUE) \ + (((VALUE) >= (2032 + 1)) && ((VALUE) <= (2032 * 2))) + +#define SUM_OF_TWO_S12_ALGN(VALUE) \ + (SUM_OF_TWO_S12_N (VALUE) || SUM_OF_TWO_S12_P_ALGN (VALUE)) + /* If this is a single bit mask, then we can load it with bseti. Special handling of SImode 0x80000000 on RV64 is done in riscv_build_integer_1. */ #define SINGLE_BIT_MASK_OPERAND(VALUE) \ diff --git a/gcc/testsuite/gcc.target/riscv/pr105733.c b/gcc/testsuite/gcc.target/riscv/pr105733.c new file mode 100644 index 000000000000..6156c36dc7ef --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/pr105733.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-options { -march=rv64gcv -mabi=lp64d } } */ +/* { dg-skip-if "" { *-*-* } { "-O0" "-Og" "-Os" "-Oz" } } */ + +#define BUF_SIZE 2064 + +void +foo(unsigned long i) +{ + volatile char buf[BUF_SIZE]; + + buf[i] = 0; +} + +/* { dg-final { scan-assembler-not {li\t[a-x0-9]+,4096} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vls/spill-1.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vls/spill-1.c index b64c73f34f13..6afcf1db593b 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vls/spill-1.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vls/spill-1.c @@ -129,5 +129,5 @@ spill_12 (int8_t *in, int8_t *out) /* { dg-final { scan-assembler-times {addi\tsp,sp,-256} 1 } } */ /* { dg-final { scan-assembler-times {addi\tsp,sp,-512} 1 } } */ /* { dg-final { scan-assembler-times {addi\tsp,sp,-1024} 1 } } */ -/* { dg-final { scan-assembler-times {addi\tsp,sp,-2048} 1 } } */ -/* { dg-final { scan-assembler-times {li\t[a-x0-9]+,-4096\s+add\tsp,sp,[a-x0-9]+} 1 } } */ +/* { dg-final { scan-assembler-times {addi\tsp,sp,-2048} 3 } } */ +/* { dg-final { scan-assembler-times {addi\tsp,sp,2032} 1 } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vls/spill-2.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vls/spill-2.c index 8fcdca705384..544e8628a27b 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vls/spill-2.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vls/spill-2.c @@ -120,5 +120,5 @@ spill_11 (int16_t *in, int16_t *out) /* { dg-final { scan-assembler-times {addi\tsp,sp,-256} 1 } } */ /* { dg-final { scan-assembler-times {addi\tsp,sp,-512} 1 } } */ /* { dg-final { scan-assembler-times {addi\tsp,sp,-1024} 1 } } */ -/* { dg-final { scan-assembler-times {addi\tsp,sp,-2048} 1 } } */ -/* { dg-final { scan-assembler-times {li\t[a-x0-9]+,-4096\s+add\tsp,sp,[a-x0-9]+} 1 } } */ +/* { dg-final { scan-assembler-times {addi\tsp,sp,-2048} 3 } } */ +/* { dg-final { scan-assembler-times {addi\tsp,sp,2032} 1 } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vls/spill-3.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vls/spill-3.c index ca296ce02d66..4bfeb07e9aca 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vls/spill-3.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vls/spill-3.c @@ -111,5 +111,5 @@ spill_10 (int32_t *in, int32_t *out) /* { dg-final { scan-assembler-times {addi\tsp,sp,-256} 1 } } */ /* { dg-final { scan-assembler-times {addi\tsp,sp,-512} 1 } } */ /* { dg-final { scan-assembler-times {addi\tsp,sp,-1024} 1 } } */ -/* { dg-final { scan-assembler-times {addi\tsp,sp,-2048} 1 } } */ -/* { dg-final { scan-assembler-times {li\t[a-x0-9]+,-4096\s+add\tsp,sp,[a-x0-9]+} 1 } } */ +/* { dg-final { scan-assembler-times {addi\tsp,sp,-2048} 3 } } */ +/* { dg-final { scan-assembler-times {addi\tsp,sp,2032} 1 } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vls/spill-4.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vls/spill-4.c index ef61d9a2c0c3..1faf31ffd8e0 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vls/spill-4.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vls/spill-4.c @@ -102,5 +102,5 @@ spill_9 (int64_t *in, int64_t *out) /* { dg-final { scan-assembler-times {addi\tsp,sp,-256} 1 } } */ /* { dg-final { scan-assembler-times {addi\tsp,sp,-512} 1 } } */ /* { dg-final { scan-assembler-times {addi\tsp,sp,-1024} 1 } } */ -/* { dg-final { scan-assembler-times {addi\tsp,sp,-2048} 1 } } */ -/* { dg-final { scan-assembler-times {li\t[a-x0-9]+,-4096\s+add\tsp,sp,[a-x0-9]+} 1 } } */ +/* { dg-final { scan-assembler-times {addi\tsp,sp,-2048} 3 } } */ +/* { dg-final { scan-assembler-times {addi\tsp,sp,2032} 1 } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vls/spill-5.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vls/spill-5.c index 150135a91103..0c8dccc518e3 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vls/spill-5.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vls/spill-5.c @@ -120,5 +120,5 @@ spill_11 (_Float16 *in, _Float16 *out) /* { dg-final { scan-assembler-times {addi\tsp,sp,-256} 1 } } */ /* { dg-final { scan-assembler-times {addi\tsp,sp,-512} 1 } } */ /* { dg-final { scan-assembler-times {addi\tsp,sp,-1024} 1 } } */ -/* { dg-final { scan-assembler-times {addi\tsp,sp,-2048} 1 } } */ -/* { dg-final { scan-assembler-times {li\t[a-x0-9]+,-4096\s+add\tsp,sp,[a-x0-9]+} 1 } } */ +/* { dg-final { scan-assembler-times {addi\tsp,sp,-2048} 3 } } */ +/* { dg-final { scan-assembler-times {addi\tsp,sp,2032} 1 } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vls/spill-6.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vls/spill-6.c index c5d2d0194348..8bf53b84d1cd 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vls/spill-6.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vls/spill-6.c @@ -111,5 +111,5 @@ spill_10 (float *in, float *out) /* { dg-final { scan-assembler-times {addi\tsp,sp,-256} 1 } } */ /* { dg-final { scan-assembler-times {addi\tsp,sp,-512} 1 } } */ /* { dg-final { scan-assembler-times {addi\tsp,sp,-1024} 1 } } */ -/* { dg-final { scan-assembler-times {addi\tsp,sp,-2048} 1 } } */ -/* { dg-final { scan-assembler-times {li\t[a-x0-9]+,-4096\s+add\tsp,sp,[a-x0-9]+} 1 } } */ +/* { dg-final { scan-assembler-times {addi\tsp,sp,-2048} 3 } } */ +/* { dg-final { scan-assembler-times {addi\tsp,sp,2032} 1 } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vls/spill-7.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vls/spill-7.c index 70ca683908db..e3980a295406 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vls/spill-7.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vls/spill-7.c @@ -102,5 +102,5 @@ spill_9 (int64_t *in, int64_t *out) /* { dg-final { scan-assembler-times {addi\tsp,sp,-256} 1 } } */ /* { dg-final { scan-assembler-times {addi\tsp,sp,-512} 1 } } */ /* { dg-final { scan-assembler-times {addi\tsp,sp,-1024} 1 } } */ -/* { dg-final { scan-assembler-times {addi\tsp,sp,-2048} 1 } } */ -/* { dg-final { scan-assembler-times {li\t[a-x0-9]+,-4096\s+add\tsp,sp,[a-x0-9]+} 1 } } */ +/* { dg-final { scan-assembler-times {addi\tsp,sp,-2048} 3 } } */ +/* { dg-final { scan-assembler-times {addi\tsp,sp,2032} 1 } } */