From patchwork Mon Aug 24 11:13:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 509990 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 14BAB1401DE for ; Mon, 24 Aug 2015 21:14:12 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=wzyXITCb; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=kR76F7WwaxKfl3Ra Ai0JZnDJdv7+Q+KUCdX5k0YhnAWu/be9xoSd/VMzomNqnNnVWqobtAJNLuUjDcCJ YsfYG+dsU5/cUqCh6N23tpF6wxGJZEkZPKVUIoikRKwveqndk+xlPiBFWdl6URr7 vH99M/415atezp6clseKMWD3FTU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; s=default; bh=N0pCy0HfGvFvn44CGuo57r wM3gU=; b=wzyXITCbTIXq7D6hNYIgDcQQ6T9SF0celXkGZDtZH+WlZde4AjeiP2 iYgo2tCjaKOT9+vAOpGWWyenOapfDd4e2SeGZql34X6Nfk5DlZsIcx/YGY9M+PoC cEGjUs8unhFEEkBtGD6CDcNhRjT0Rcwr1RXqe8TdFf2C//eHo5nnI= Received: (qmail 34162 invoked by alias); 24 Aug 2015 11:14:04 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 34132 invoked by uid 89); 24 Aug 2015 11:14:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL, BAYES_00, SPF_PASS autolearn=ham version=3.3.2 X-HELO: eu-smtp-delivery-143.mimecast.com Received: from eu-smtp-delivery-143.mimecast.com (HELO eu-smtp-delivery-143.mimecast.com) (146.101.78.143) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 24 Aug 2015 11:14:02 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) by eu-smtp-1.mimecast.com with ESMTP id uk-mta-21-K01m8IX_SZalHZHkvZa2gg-1; Mon, 24 Aug 2015 12:13:57 +0100 Received: from localhost ([10.1.2.79]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 24 Aug 2015 12:13:57 +0100 From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@arm.com Subject: [committed] Use target-insns.def for movstr Date: Mon, 24 Aug 2015 12:13:57 +0100 Message-ID: <874mjp7xca.fsf@e105548-lin.cambridge.arm.com> User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 X-MC-Unique: K01m8IX_SZalHZHkvZa2gg-1 A simple conversion. Tested on x86_64-linux-gnu. Also tested by building one target per cpu directory and checking that there were no changes in the assembly output for gcc.dg, g++.dg and gcc.c-torture. Committed as preapproved. Thanks, Richard gcc/ * target-insns.def (movstr): New pattern. * builtins.c (HAVE_movstr, CODE_FOR_movstr): Delete. (expand_movstr): Use targetm rather than HAVE_movstr/ CODE_FOR_movstr. diff --git a/gcc/builtins.c b/gcc/builtins.c index bac28ef..d79372c 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -3434,11 +3434,6 @@ expand_builtin_mempcpy_args (tree dest, tree src, tree len, } } -#ifndef HAVE_movstr -# define HAVE_movstr 0 -# define CODE_FOR_movstr CODE_FOR_nothing -#endif - /* Expand into a movstr instruction, if one is available. Return NULL_RTX if we failed, the caller should emit a normal call, otherwise try to get the result in TARGET, if convenient. If ENDP is 0 return the @@ -3453,7 +3448,7 @@ expand_movstr (tree dest, tree src, rtx target, int endp) rtx dest_mem; rtx src_mem; - if (!HAVE_movstr) + if (!targetm.have_movstr ()) return NULL_RTX; dest_mem = get_memory_rtx (dest, NULL); @@ -3467,7 +3462,7 @@ expand_movstr (tree dest, tree src, rtx target, int endp) create_output_operand (&ops[0], endp ? target : NULL_RTX, Pmode); create_fixed_operand (&ops[1], dest_mem); create_fixed_operand (&ops[2], src_mem); - if (!maybe_expand_insn (CODE_FOR_movstr, 3, ops)) + if (!maybe_expand_insn (targetm.code_for_movstr, 3, ops)) return NULL_RTX; if (endp && target != const0_rtx) diff --git a/gcc/target-insns.def b/gcc/target-insns.def index e94b1de..00e0027 100644 --- a/gcc/target-insns.def +++ b/gcc/target-insns.def @@ -61,6 +61,7 @@ DEF_TARGET_INSN (load_multiple, (rtx x0, rtx x1, rtx x2)) DEF_TARGET_INSN (mem_signal_fence, (rtx x0)) DEF_TARGET_INSN (mem_thread_fence, (rtx x0)) DEF_TARGET_INSN (memory_barrier, (void)) +DEF_TARGET_INSN (movstr, (rtx x0, rtx x1, rtx x2)) DEF_TARGET_INSN (nonlocal_goto, (rtx x0, rtx x1, rtx x2, rtx x3)) DEF_TARGET_INSN (nonlocal_goto_receiver, (void)) DEF_TARGET_INSN (prefetch, (rtx x0, rtx x1, rtx x2))