From patchwork Mon Feb 22 17:04:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans-Peter Nilsson X-Patchwork-Id: 1443201 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=wFiIIJZr; dkim-atps=neutral Received: from sourceware.org (unknown [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DkpSH66c4z9sCD for ; Tue, 23 Feb 2021 04:04:15 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DDC0F384241A; Mon, 22 Feb 2021 17:04:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DDC0F384241A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1614013453; bh=NLQGcbhzJk+7mfzYOjiYFrbJGkTRp+C/MPylwk8SVxY=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=wFiIIJZrKgULo+H4SMYVDkFCUpTVVWSzor9LmtkAVUPyuxp2cepeiM61BSvHW/46y 18j1kTzp7P0Vl6n1fqAVH0LxgnpXmiCtM6PcKJEzcW5M8U3ujqHT8+drzndXgMdlTM Z35C4Q/WkqxDZku9YpJGOvkMwK+ITSwu5si2jph8= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp1.axis.com (smtp1.axis.com [195.60.68.17]) by sourceware.org (Postfix) with ESMTPS id 0AC8A385801D for ; Mon, 22 Feb 2021 17:04:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 0AC8A385801D To: Subject: cris: testsuite/gcc.target/cris/biap-mul.c: New test. MIME-Version: 1.0 Message-ID: <20210222170409.C3E41203BE@pchp3.se.axis.com> Date: Mon, 22 Feb 2021 18:04:09 +0100 X-Spam-Status: No, score=-11.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Hans-Peter Nilsson via Gcc-patches From: Hans-Peter Nilsson Reply-To: Hans-Peter Nilsson Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Needed coverage for that *addi_mul pattern. Committed. gcc/testsuite: * gcc.target/cris/biap-mul.c: New test. --- gcc/testsuite/gcc.target/cris/biap-mul.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 gcc/testsuite/gcc.target/cris/biap-mul.c diff --git a/gcc/testsuite/gcc.target/cris/biap-mul.c b/gcc/testsuite/gcc.target/cris/biap-mul.c new file mode 100644 index 000000000000..e0054632b239 --- /dev/null +++ b/gcc/testsuite/gcc.target/cris/biap-mul.c @@ -0,0 +1,15 @@ +/* Make sure ADDI is used for trivial multiplications too. */ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ +/* { dg-final { scan-assembler-times "\taddi" 2 } } */ +/* { dg-final { scan-assembler-not "\tlsl|\tmul|\tmove|\tadd\[^i\]" } } */ + +int xyzzy (int r10) +{ + return r10 * 5; +} + +int plugh (int r10) +{ + return r10 * 3; +}