From patchwork Thu Oct 9 07:05:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Collison X-Patchwork-Id: 38494 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 557F82032C for ; Thu, 9 Oct 2014 07:06:00 +0000 (UTC) Received: by mail-wi0-f197.google.com with SMTP id n3sf468065wiv.4 for ; Thu, 09 Oct 2014 00:05:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:mailing-list:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:sender :delivered-to:message-id:date:from:user-agent:mime-version:to :subject:x-original-sender:x-original-authentication-results :content-type; bh=Dxos1Pk1OtnTD/7jJFL+Aws1RquYp0PlYZQvbJVeHcM=; b=Mhao5fWKIKrV2T/YUppmzLiIIR06/mniUCPI4PRE0Luzy5O9qKlkz1qT80a00tMMy+ vShGxPEifuKWACBrVNyPnQ+KkMRGsEumnYkpfxSEiQQ6rbk2EjTyUNqVDq+RmaqXNpoJ sBGej2zfIZPh/KYYzXMfVP4meUJVmc7sPPVMEYPOveMIMR2pRhFm7dFpUWtoKWQRsDji g1YLShNH3u+nDz4eiPRXxukBd36dsBOlJlNFWN/QKMkI+RBKtKZ85WDmbevBqadZPnUw prDgu6Gene8l1KFa6GPe9vOH2ONEgCmINPxqfx4Q8SlqZK9GmoSwN1ZE2iin3L50+ZJF 2Z9w== X-Gm-Message-State: ALoCoQmEAr6Q4bJzA+o6VazFP1i4w3E4qHorOv8m70zWGMgO1lUDCeS0s0tu85O3DrYJLUpEgEpj X-Received: by 10.112.60.225 with SMTP id k1mr2293583lbr.0.1412838359082; Thu, 09 Oct 2014 00:05:59 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.6.5 with SMTP id w5ls139660law.71.gmail; Thu, 09 Oct 2014 00:05:58 -0700 (PDT) X-Received: by 10.152.19.195 with SMTP id h3mr16469355lae.71.1412838358609; Thu, 09 Oct 2014 00:05:58 -0700 (PDT) Received: from mail-la0-x234.google.com (mail-la0-x234.google.com [2a00:1450:4010:c03::234]) by mx.google.com with ESMTPS id f4si3054302lag.46.2014.10.09.00.05.58 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 09 Oct 2014 00:05:58 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::234 as permitted sender) client-ip=2a00:1450:4010:c03::234; Received: by mail-la0-f52.google.com with SMTP id hz20so555840lab.25 for ; Thu, 09 Oct 2014 00:05:58 -0700 (PDT) X-Received: by 10.152.28.167 with SMTP id c7mr16228540lah.27.1412838358469; Thu, 09 Oct 2014 00:05:58 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.84.229 with SMTP id c5csp192747lbz; Thu, 9 Oct 2014 00:05:57 -0700 (PDT) X-Received: by 10.60.67.42 with SMTP id k10mr19468877oet.60.1412838356402; Thu, 09 Oct 2014 00:05:56 -0700 (PDT) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id y10si1741929obs.12.2014.10.09.00.05.55 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Oct 2014 00:05:56 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-379956-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 19140 invoked by alias); 9 Oct 2014 07:05:43 -0000 Mailing-List: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org Precedence: list 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 19129 invoked by uid 89); 9 Oct 2014 07:05:42 -0000 X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-oi0-f49.google.com Received: from mail-oi0-f49.google.com (HELO mail-oi0-f49.google.com) (209.85.218.49) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 09 Oct 2014 07:05:41 +0000 Received: by mail-oi0-f49.google.com with SMTP id a3so1402561oib.22 for ; Thu, 09 Oct 2014 00:05:39 -0700 (PDT) X-Received: by 10.60.125.135 with SMTP id mq7mr19656400oeb.11.1412838339056; Thu, 09 Oct 2014 00:05:39 -0700 (PDT) Received: from [192.168.2.118] (ip70-176-172-237.ph.ph.cox.net. [70.176.172.237]) by mx.google.com with ESMTPSA id f8sm2590989oev.4.2014.10.09.00.05.37 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Oct 2014 00:05:37 -0700 (PDT) Message-ID: <543633BD.9030004@linaro.org> Date: Thu, 09 Oct 2014 00:05:33 -0700 From: Michael Collison User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: gcc-patches@gcc.gnu.org Subject: [ARM] Fix CLZ_DEFINED_VALUE_AT_ZERO for vector modes X-Original-Sender: michael.collison@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::234 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=pass header.i=@gcc.gnu.org X-Google-Group-Id: 836684582541 The CLZ_DEFINED_VALUE_AT_ZERO macro is harded to return 32. For the vector intrinsic vclz this is incorrect and should return the value eight. The CTZ_DEFINED_VALUE_AT_ZERO has the same issue. Tested on arm-linux-gnueabihf, arm-linux-gnueabi. 2014-10-08 Michael Collison * config/arm/arm.h (CLZ_DEFINED_VALUE_AT_ZERO) : Update to support vector modes (CTZ_DEFINED_VALUE_AT_ZERO): Ditto --- ../../../../linaro-gcc4_9_git/gcc/config/arm/arm.h 2014-10-08 13:49:01.109819957 -0700 +++ arm.h 2014-10-08 13:56:19.509841175 -0700 @@ -2138,8 +2138,10 @@ extern int making_const_table; : reverse_condition (code)) /* The arm5 clz instruction returns 32. */ -#define CLZ_DEFINED_VALUE_AT_ZERO(MODE, VALUE) ((VALUE) = 32, 1) -#define CTZ_DEFINED_VALUE_AT_ZERO(MODE, VALUE) ((VALUE) = 32, 1) +#define CLZ_DEFINED_VALUE_AT_ZERO(MODE, VALUE) \ + ((VALUE) = GET_MODE_UNIT_BITSIZE (MODE)) +#define CTZ_DEFINED_VALUE_AT_ZERO(MODE, VALUE) \ + ((VALUE) = GET_MODE_UNIT_BITSIZE (MODE)) #define CC_STATUS_INIT \ do { cfun->machine->thumb1_cc_insn = NULL_RTX; } while (0)