From patchwork Wed Aug 20 09:20:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Lawrence X-Patchwork-Id: 381592 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 2A39E140082 for ; Wed, 20 Aug 2014 19:21:07 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; q= dns; s=default; b=drIu0PjTPVyZ6cHqqfwqa7X81v9jWoubTeLt7ial/aJ9Be N4+A3Z1fequ+D2UX4OITWMYr/SCj2yeuyfdHiSBr0gyzEDZVV0PXzipN2ulylVTz P6ink8mzhrg/FmBHp3AQosHrbokr4pmM//WHTxdQEgGwbt3KctTneBDYXR6bs= 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 :message-id:date:from:mime-version:to:subject:content-type; s= default; bh=C+hWgiwDqYbQQhgxNbxG5s90j+E=; b=u6FMRCKxxpinxqjTPNhS 6oF/JnM1pEMLcZpEWElBA/WFv2QQAec61y5fKtLVlgaPN/ZAjoXJqBfCfFWdnV/X R3yG5S2zHfrnEnfzqC0n8tcoLwiiZHvtN37yJ2Zbo9Cn2P38mCAwQyrJnbQ1PMpA UjEMdx8URTQ2xcGMSGmHwzA= Received: (qmail 8238 invoked by alias); 20 Aug 2014 09:20:43 -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 8223 invoked by uid 89); 20 Aug 2014 09:20:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=3.1 required=5.0 tests=AWL, BAYES_00, RAR_ATTACHED, SPF_PASS autolearn=no version=3.3.2 X-HELO: service87.mimecast.com Received: from service87.mimecast.com (HELO service87.mimecast.com) (91.220.42.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 20 Aug 2014 09:20:42 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Wed, 20 Aug 2014 10:20:39 +0100 Received: from [10.1.209.51] ([10.1.255.212]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 20 Aug 2014 10:20:39 +0100 Message-ID: <53F46866.1020604@arm.com> Date: Wed, 20 Aug 2014 10:20:38 +0100 From: Alan Lawrence User-Agent: Thunderbird 2.0.0.24 (X11/20101213) MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" Subject: [PATCH][AArch64] Remove varargs from aarch64_simd_expand_args X-MC-Unique: 114082010203906701 X-IsSubscribed: yes This patch just replaces the varargs with a builtin_simd_arg*. The use of varargs seems to make stepping into, and breakpointing, aarch64_simd_expand_args difficult, and this adds typesafety and (I argue!) reduces complexity. Tested check-gcc on aarch64-none-elf. gcc/ChangeLog: * config/aarch64/aarch64-builtins.c (aarch64_simd_expand_args): Replace varargs with pointer parameter. (aarch64_simd_expand_builtin): pass pointer into previous. diff --git a/gcc/config/aarch64/aarch64-builtins.c b/gcc/config/aarch64/aarch64-builtins.c index fee17ecf637436c8704f565be2eb9ef23891209a..1af17900785685e4e005710d3bb1743d88a11c16 100644 --- a/gcc/config/aarch64/aarch64-builtins.c +++ b/gcc/config/aarch64/aarch64-builtins.c @@ -904,9 +904,8 @@ typedef enum static rtx aarch64_simd_expand_args (rtx target, int icode, int have_retval, - tree exp, ...) + tree exp, builtin_simd_arg *args) { - va_list ap; rtx pat; tree arg[SIMD_MAX_BUILTIN_ARGS]; rtx op[SIMD_MAX_BUILTIN_ARGS]; @@ -920,11 +919,9 @@ aarch64_simd_expand_args (rtx target, int icode, int have_retval, || !(*insn_data[icode].operand[0].predicate) (target, tmode))) target = gen_reg_rtx (tmode); - va_start (ap, exp); - for (;;) { - builtin_simd_arg thisarg = (builtin_simd_arg) va_arg (ap, int); + builtin_simd_arg thisarg = args[argc]; if (thisarg == SIMD_ARG_STOP) break; @@ -960,8 +957,6 @@ aarch64_simd_expand_args (rtx target, int icode, int have_retval, } } - va_end (ap); - if (have_retval) switch (argc) { @@ -1075,12 +1070,7 @@ aarch64_simd_expand_builtin (int fcode, tree exp, rtx target) /* The interface to aarch64_simd_expand_args expects a 0 if the function is void, and a 1 if it is not. */ return aarch64_simd_expand_args - (target, icode, !is_void, exp, - args[1], - args[2], - args[3], - args[4], - SIMD_ARG_STOP); + (target, icode, !is_void, exp, &args[1]); } rtx