From patchwork Sat Nov 21 14:03:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Sidwell X-Patchwork-Id: 547162 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 A8E2C140157 for ; Sun, 22 Nov 2015 01:03:31 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=Ase3bu6l; 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:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=WLJw8YvPCPuffJMgwedqjDAnnTD1XZnG8ZQ2z4yxOc/RACKOOn IiJsXW62nXslNA+Xt6sDyi4zpI47CLh9IBdEwnV+l59HiIQGdOMiG3JQzemIXfxs XloJy6qpNGWO9Wv2evfgYgUKR6q5geIGv7G0aQi78K5JIBxyIG0Hz9V5Y= 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:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=ZXEIR5EpXV3clzx9tbBHn4VWCZA=; b=Ase3bu6lh3cqa0jhvnJ5 KzPPSaAqYlA2sm4zqONuMALiCOuRkrMdW26aaQLzRyTq8cualQastmz9Y5cYGu9V Par/ezP8hkv8AymxdwCgDBOTiwcmFyYJ5McLe4uVOhd98Mj8vuZFNHv8Jm7z9mE3 fDYUY0vMrmCkWRwxqxw2h4k= Received: (qmail 6317 invoked by alias); 21 Nov 2015 14:03:24 -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 6305 invoked by uid 89); 21 Nov 2015 14:03:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-vk0-f54.google.com Received: from mail-vk0-f54.google.com (HELO mail-vk0-f54.google.com) (209.85.213.54) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Sat, 21 Nov 2015 14:03:23 +0000 Received: by vkfr145 with SMTP id r145so13963062vkf.0 for ; Sat, 21 Nov 2015 06:03:21 -0800 (PST) X-Received: by 10.31.167.20 with SMTP id q20mr6028293vke.79.1448114601061; Sat, 21 Nov 2015 06:03:21 -0800 (PST) Received: from ?IPv6:2601:181:c000:c497:a2a8:cdff:fe3e:b48? ([2601:181:c000:c497:a2a8:cdff:fe3e:b48]) by smtp.googlemail.com with ESMTPSA id g68sm3486650vki.22.2015.11.21.06.03.20 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 21 Nov 2015 06:03:20 -0800 (PST) To: GCC Patches From: Nathan Sidwell Subject: [ptx] fix CLZ Message-ID: <565079A8.8090201@acm.org> Date: Sat, 21 Nov 2015 09:03:20 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 This patch fixes CLZ. It always returns SImode, we should look at the input operand to determine the type. Fixes cc.c-torture/execute/builtin-bitops-1.c committed. nathan 2015-11-21 Nathan Sidwell * config/nvptx/nvptx.md (clz2): Use operand 1 for type. Index: config/nvptx/nvptx.md =================================================================== --- config/nvptx/nvptx.md (revision 230704) +++ config/nvptx/nvptx.md (working copy) @@ -731,7 +731,7 @@ [(set (match_operand:SI 0 "nvptx_register_operand" "=R") (clz:SI (match_operand:SDIM 1 "nvptx_register_operand" "R")))] "" - "%.\\tclz.b%T0\\t%0, %1;") + "%.\\tclz.b%T1\\t%0, %1;") (define_expand "ctz2" [(set (match_operand:SI 0 "nvptx_register_operand" "")