From patchwork Fri Nov 6 06:46:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Collison X-Patchwork-Id: 56095 Delivered-To: patch@linaro.org Received: by 10.112.61.134 with SMTP id p6csp830082lbr; Thu, 5 Nov 2015 22:46:34 -0800 (PST) X-Received: by 10.68.87.161 with SMTP id az1mr15306294pbb.57.1446792394164; Thu, 05 Nov 2015 22:46:34 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id xg5si15616932pab.13.2015.11.05.22.46.33 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Nov 2015 22:46:34 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-412839-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; spf=pass (google.com: domain of gcc-patches-return-412839-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-412839-patch=linaro.org@gcc.gnu.org; dkim=pass header.i=@gcc.gnu.org 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=RUdQ87eV91zNSO1MghKhdfBnK23uqGp3+GqNOiyqDmyAT3 QAH2DeNUvU2W2uzT7qZvOkrsAQGUQD38KeYg4HewGHWMP8V1FZR5d0aoSmj/qCqP VCUspk0Qo4VJoOSLsLNvihO8hekxUPoOrgraBSJ6ujanrjP72PxkPAp0QRKs0= 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/TRIJUu99whVL7MiNG0mOtU6pA=; b=BmYPUiE1HJPPM6d5bzRh pgSWSvRlZgV4qFK4DJgyg7f2l3wfuEOT1d1u4f3Jyq6cPdKwRi9lZkICCmexZk+Y Hj1LJuft48vJB1QNOCvR9f/E++7jYPUwbYySq7xnIBaIF0zkGWAB4HgmOMF/nASB TdKeK8HvpW9lfPhFMaow0kA= Received: (qmail 88946 invoked by alias); 6 Nov 2015 06:46:22 -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 88930 invoked by uid 89); 6 Nov 2015 06:46:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pa0-f43.google.com Received: from mail-pa0-f43.google.com (HELO mail-pa0-f43.google.com) (209.85.220.43) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 06 Nov 2015 06:46:20 +0000 Received: by padhx2 with SMTP id hx2so105054301pad.1 for ; Thu, 05 Nov 2015 22:46:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:organization:user-agent :mime-version:to:subject:content-type; bh=0f0zVPQ4KPOFkvB1UUc+zhlmU60cs7b9a8uQsPgvUKQ=; b=PDMrVI8KE9IQ4ZLnemzfhIhIs/azBv8enBFn2MBZjC3ZcXoYDj4lESBX3esDp+02QY 0mF6qy1HzJe6ccf+2UrIWQZkQBrnK98wiUBYeOQMG5rHbJrBfU/Hd9lKU2lYCV3dTHCt OIKF6dl9RB7Onjio+PJ6dVWYMjzklgVIKBw+yfg3t7aTK2S0nMkIi7O6Y0U5wvz98lBi E3XDzeQ9mPBP2eUJlrcEAVOE2aEbIsL6vYWCDrJiBPeqWpzrKJ42EIyVcDSTsqPjDMf8 ePC32jOOl11qPkpj/zvW951cxK9IWzI9XgKPyeLv7l5u1SWclDV8IZIRtUS0JtB9NcjT oRng== X-Gm-Message-State: ALoCoQnwGWM6+xd5Yjs1ruY2JNvTJo+vOiogh8Ss8uexOOubnA4ywMYAQVNq208gOV366n8eHNMV X-Received: by 10.67.4.38 with SMTP id cb6mr15184836pad.34.1446792378663; Thu, 05 Nov 2015 22:46:18 -0800 (PST) Received: from [192.168.1.14] (ip70-176-202-128.ph.ph.cox.net. [70.176.202.128]) by smtp.googlemail.com with ESMTPSA id yq2sm11705386pbb.39.2015.11.05.22.46.17 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 05 Nov 2015 22:46:18 -0800 (PST) Message-ID: <563C4CB3.9050703@linaro.org> Date: Thu, 05 Nov 2015 23:46:11 -0700 From: Michael Collison User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: GCC Patches , Ramana Radhakrishnan Subject: [ARM][PATCH, PR 68223] arm_[su]min_cmp pattern fails The patterns arm_smin_cmp and arm_umin_cmp patterns fail if operand 0 and operand 2 are equal and both are less than operand 1. The solution is to remove the two patterns. 2015-11-06 Michael Collison PR target/68223 * gcc/config/arm/arm.md (*arm_smin_cmp): Remove pattern. (*arm_umin_cmp): Likewise. * gcc.target/arm/mincmp.c: Remove testcase. -- Michael Collison Linaro Toolchain Working Group michael.collison@linaro.org diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md index 02e147e..6ba1ec3 100644 --- a/gcc/config/arm/arm.md +++ b/gcc/config/arm/arm.md @@ -3455,44 +3455,6 @@ (set_attr "type" "multiple,multiple")] ) -;; t = (s/u)min (x, y) -;; cc = cmp (t, z) -;; is the same as -;; cmp x, z -;; cmpge(u) y, z - -(define_insn_and_split "*arm_smin_cmp" - [(set (reg:CC CC_REGNUM) - (compare:CC - (smin:SI (match_operand:SI 0 "s_register_operand" "r") - (match_operand:SI 1 "s_register_operand" "r")) - (match_operand:SI 2 "s_register_operand" "r")))] - "TARGET_32BIT" - "#" - "&& reload_completed" - [(set (reg:CC CC_REGNUM) - (compare:CC (match_dup 0) (match_dup 2))) - (cond_exec (ge:CC (reg:CC CC_REGNUM) (const_int 0)) - (set (reg:CC CC_REGNUM) - (compare:CC (match_dup 1) (match_dup 2))))] -) - -(define_insn_and_split "*arm_umin_cmp" - [(set (reg:CC CC_REGNUM) - (compare:CC - (umin:SI (match_operand:SI 0 "s_register_operand" "r") - (match_operand:SI 1 "s_register_operand" "r")) - (match_operand:SI 2 "s_register_operand" "r")))] - "TARGET_32BIT" - "#" - "&& reload_completed" - [(set (reg:CC CC_REGNUM) - (compare:CC (match_dup 0) (match_dup 2))) - (cond_exec (geu:CC (reg:CC CC_REGNUM) (const_int 0)) - (set (reg:CC CC_REGNUM) - (compare:CC (match_dup 1) (match_dup 2))))] -) - (define_expand "umaxsi3" [(parallel [ (set (match_operand:SI 0 "s_register_operand" "") diff --git a/gcc/testsuite/gcc.target/arm/mincmp.c b/gcc/testsuite/gcc.target/arm/mincmp.c deleted file mode 100644 index ade3bd9..0000000 --- a/gcc/testsuite/gcc.target/arm/mincmp.c +++ /dev/null @@ -1,20 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-O2" } */ -/* { dg-require-effective-target arm32 } */ - -#define min(x, y) ((x) <= (y)) ? (x) : (y) - -unsigned int -foo (unsigned int i, unsigned int x, unsigned int y) -{ - return i < (min (x, y)); -} - -int -bar (int i, int x, int y) -{ - return i < (min (x, y)); -} - -/* { dg-final { scan-assembler "cmpcs" } } */ -/* { dg-final { scan-assembler "cmpge" } } */ -- 1.9.1