From patchwork Sun Jul 20 10:25:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 371882 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 4B5D1140116 for ; Sun, 20 Jul 2014 20:26:17 +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:cc:subject:content-type; q=dns; s=default; b=BEatQN4Q4Jw1mampa2jDwrXCHtr0VglKkMbRT5cT/OA qBjKDCNd54JtLQqOXd7+lgnidFegoaYnRpqXkxxxaIJbAzqpSHCPf7xvVNQcCx1p csu2XCuGd6MkFScOavMP3vYRjyYByDTkqj1xrOoZJolRik2FSa7lxzzpnhn3OLJM = 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:cc:subject:content-type; s=default; bh=RuMF9mhT3pUYIFz0BNDOskcmTNo=; b=NXAhyNphllRjJbB70 /T/sCvQiesQETYAfL5b/9AyCZRoBBUFLnmq6M8hq2T8zq/TZ0JYCsW1EF7Q5ohza YqPeWwhOQ1VIHr0SvtIftlpj/vb8Gin+zujLE/WvDuVJAEBQLOI7D0jPwi+E0FuI Sl+G/CSGvOabEC+zLqFZF2lMzA= Received: (qmail 1785 invoked by alias); 20 Jul 2014 10:26:09 -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 1631 invoked by uid 89); 20 Jul 2014 10:26:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 20 Jul 2014 10:26:02 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1X8oJZ-0005Yx-NP from Tom_deVries@mentor.com ; Sun, 20 Jul 2014 03:25:57 -0700 Received: from SVR-IES-FEM-01.mgc.mentorg.com ([137.202.0.104]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Sun, 20 Jul 2014 03:25:57 -0700 Received: from [127.0.0.1] (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.2.247.3; Sun, 20 Jul 2014 11:25:55 +0100 Message-ID: <53CB9931.6030800@mentor.com> Date: Sun, 20 Jul 2014 12:25:53 +0200 From: Tom de Vries User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Uros Bizjak CC: GCC Patches Subject: [PATCH, i386, PR61827] Fix fuse-caller-save-xmm.c test-case Uros, this patch fixes the problems in test-case gcc.target/i386/fuse-caller-save-xmm.c reported in PR 61827. I've removed the checks for cfi_def_cfa_offset, which were not robust enough for the different configurations. Furthermore, I've: - added checks for all insns that handle the xmm registers, to make sure we're actually using the xmm1 register. - fixed the scan-assembler-not lines to allow both %esp and %rsp. - removed main, which was really only intended for the fuse-caller-save-xmm-run.c test-case. Tested with -m32 and -m64. OK for trunk? Thanks, - Tom 2014-07-20 Tom de Vries PR target/61827 * gcc.target/i386/fuse-caller-save-xmm.c: Add checks for insns with xmm registers. Remove cfi_def_cfa_offset checks. Generalize checks containing %rsp. (main): Remove. diff --git a/gcc/testsuite/gcc.target/i386/fuse-caller-save-xmm.c b/gcc/testsuite/gcc.target/i386/fuse-caller-save-xmm.c index ff21f0c..3754b01 100644 --- a/gcc/testsuite/gcc.target/i386/fuse-caller-save-xmm.c +++ b/gcc/testsuite/gcc.target/i386/fuse-caller-save-xmm.c @@ -15,23 +15,12 @@ foo (v2df y) return y + bar (y); } -int -main (void) -{ - int success; - union { - v2df v; - double d[2]; - } u; - - u.v = foo ((v2df){ 5.0, 5.0}); - success = (u.d[0] == 13.0 - && u.d[1] == 13.0); - - return !success; -} +/* Check presence of all insns on xmm registers. These checks are expected to + pass with both -fuse-caller-save and -fno-use-caller-save. */ +/* { dg-final { scan-assembler-times "addpd\t\\.LC0.*, %xmm0" 1 } } */ +/* { dg-final { scan-assembler-times "addpd\t%xmm1, %xmm0" 1 } } */ +/* { dg-final { scan-assembler-times "movapd\t%xmm0, %xmm1" 1 } } */ -/* { dg-final { scan-assembler-not "movaps\t%xmm1, \\(%rsp\\)" } } */ -/* { dg-final { scan-assembler-not "movapd\t\\(%rsp\\), %xmm1" } } */ -/* { dg-final { scan-assembler-times ".cfi_def_cfa_offset 16" 1 } } */ -/* { dg-final { scan-assembler-times ".cfi_def_cfa_offset 32" 1 } } */ +/* Check absence of save/restore of xmm1 register. */ +/* { dg-final { scan-assembler-not "movaps\t%xmm1, \\(%.sp\\)" } } */ +/* { dg-final { scan-assembler-not "movapd\t\\(%.sp\\), %xmm1" } } */