From patchwork Mon Nov 12 00:04:48 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleg Endo X-Patchwork-Id: 198311 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]) by ozlabs.org (Postfix) with SMTP id 615AC2C0086 for ; Mon, 12 Nov 2012 11:05:06 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1353283508; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Message-ID:Subject:From:To:Date:Content-Type:Mime-Version: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=cxCsQhBUHIrf/cp7ilTS w8yQ6Qw=; b=ZWBjUSHqZiRaSPMPowzpHNcb+qzn+sfofU1IAtNHQLoV4MbdiZJ+ 3gudrwiDanIJ1ZE/rjzHBgq25mL0JEs9X+O4xvohySEDU2Fru7WQMS6YNfSCDOu/ Hg0QDxkQ/iH7WgdRlNixcki+cOaAIXoeVmDMdkTq6fx82ORbVSCkyoc= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Message-ID:Subject:From:To:Date:Content-Type:Mime-Version:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=ScMY57LtFdrbds/G1xG2akUHarvnHNb0twm1hq6bjWrRw7DoXdTUSrp0xLx5+i u38k5/RQ7jRSQhfm1zpYCtPRjB1g1ZiKgeg5uVBP63GOhUL13YcZhvmeN2NE5TEm BPduY2IFoZyVB02Tnnv60r6B1bGidXt5XprBYjdT8E7AU=; Received: (qmail 23305 invoked by alias); 12 Nov 2012 00:05:03 -0000 Received: (qmail 23292 invoked by uid 22791); 12 Nov 2012 00:05:03 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_HOSTKARMA_NO, RP_MATCHES_RCVD, UNPARSEABLE_RELAY X-Spam-Check-By: sourceware.org Received: from mailout05.t-online.de (HELO mailout05.t-online.de) (194.25.134.82) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 12 Nov 2012 00:04:57 +0000 Received: from fwd18.aul.t-online.de (fwd18.aul.t-online.de ) by mailout05.t-online.de with smtp id 1TXhWJ-00007A-43; Mon, 12 Nov 2012 01:04:55 +0100 Received: from [192.168.0.100] (rxObKgZFrhhdlOR1Q27RKZzlpIXbub14aa92DdjfqLua2FFZjDdSYE7kvQ-Xo7jZH6@[87.157.50.171]) by fwd18.t-online.de with esmtp id 1TXhWH-04eBFo0; Mon, 12 Nov 2012 01:04:53 +0100 Message-ID: <1352678688.8110.336.camel@yam-132-YW-E178-FTW> Subject: [SH, committed] Fix sh4a-fprun test case From: Oleg Endo To: gcc-patches Date: Mon, 12 Nov 2012 01:04:48 +0100 Mime-Version: 1.0 X-IsSubscribed: yes 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 Hello, The sh4a-fprun.c test case was bogus. It did not really use the fsca instruction to do any calculations, because the things it tests could be evaluated at compile time and folded away. The test case was supposed to be failing since rev 188149, as I introduced a bug in the commit for PR 53512. I got the sincos standard name pattern wrong -- the sin and cos outputs are swapped. The attached patch fixes the test case by using noinline wrappers around sinf and cosf. Committed as obvious as rev 193419. The other fixes for the docs and the sincos pattern in sh.md will follow. Cheers, Oleg testsuite/ChangeLog: * gcc.target/sh/sh4a-fprun.c: Add test_sinf and test_cosf noinline wrappers around sinf and cosf. Index: gcc/testsuite/gcc.target/sh/sh4a-fprun.c =================================================================== --- gcc/testsuite/gcc.target/sh/sh4a-fprun.c (revision 193405) +++ gcc/testsuite/gcc.target/sh/sh4a-fprun.c (working copy) @@ -11,25 +11,43 @@ float dg2rad_f; double dg2rad_d; -void check_f (float res, float expected) { +float __attribute__ ((noinline)) +test_sinf (float x) +{ + return sinf (x); +} + +float __attribute ((noinline)) +test_cosf (float x) +{ + return cosf (x); +} + +void +check_f (float res, float expected) +{ if (res >= expected - 0.001f && res <= expected + 0.001f) return; abort (); } -void check_d (double res, double expected) { +void +check_d (double res, double expected) +{ if (res >= expected - 0.001 && res <= expected + 0.001) return; abort (); } -int main() { +int +main() +{ check_f (sqrtf(sqrt_arg), sqrt_res); dg2rad_f = dg2rad_d = atan(1) / 45; - check_f (sinf(90*dg2rad_f), 1); - check_f (cosf(90*dg2rad_f), 0); + check_f (test_sinf(90*dg2rad_f), 1); + check_f (test_cosf(90*dg2rad_f), 0); check_d (sin(-90*dg2rad_d), -1); check_d (cos(180*dg2rad_d), -1); check_d (sin(-45*dg2rad_d) * cosf(135*dg2rad_f), 0.5);