From patchwork Tue Oct 9 18:41:05 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleg Endo X-Patchwork-Id: 190405 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 4232A2C00BA for ; Wed, 10 Oct 2012 05:41:37 +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=1350412897; 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=Wj5hJ854NNvCNyMwtz8o TABaVkI=; b=sBeKWamQWvS4lROA/o0e1wMjXQHl44t+BXmZTKhPEHVeeJPPZpHQ dUN77k18sE2gjl+CcgbJM06iypDs1ub1mw0wpnqV/teZSB1v4IddzVNZw32jvUgs Aj+bAy9n0pFt5CEmFnnoHlG1z1fkmCrX6ZMfOAtZustbvZ+tVtPRrNk= 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=Diktafrf2Suog0BjyNuH3/YHsn3nsFPMWSgMmmjIZmjONZalLkrYLAdEt77JyN SFtQY6rVMKK9E8YN6jdlpPohlrk17FD5478B1lDM1i7ixSP3/OUaF38EGSGC6/hC vUGLWNUaXf3MdEf3OYTyXde1xhq55g2IM9tTtxOLwR7ac=; Received: (qmail 9722 invoked by alias); 9 Oct 2012 18:41:24 -0000 Received: (qmail 9708 invoked by uid 22791); 9 Oct 2012 18:41:23 -0000 X-SWARE-Spam-Status: No, hits=-4.0 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_HOSTKARMA_NO, RCVD_IN_HOSTKARMA_YE, RP_MATCHES_RCVD, TW_VU, UNPARSEABLE_RELAY X-Spam-Check-By: sourceware.org Received: from mailout06.t-online.de (HELO mailout06.t-online.de) (194.25.134.19) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 09 Oct 2012 18:41:19 +0000 Received: from fwd57.aul.t-online.de (fwd57.aul.t-online.de ) by mailout06.t-online.de with smtp id 1TLek1-0005GY-Bd; Tue, 09 Oct 2012 20:41:17 +0200 Received: from [192.168.0.100] (SmlH1MZFrhOKa4krlrioD1bndvSGRtfj5NyOU-v1D-xQaS5BufpsQPUQfRUuHTgQ2I@[93.218.185.64]) by fwd57.t-online.de with esmtp id 1TLejs-1ZBxku0; Tue, 9 Oct 2012 20:41:08 +0200 Message-ID: <1349808065.21984.74.camel@yam-132-YW-E178-FTW> Subject: [SH] PR 52480 - fix movua.l for big endian From: Oleg Endo To: gcc-patches Date: Tue, 09 Oct 2012 20:41:05 +0200 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, This is the same patch I posted in the PR. It seems to fix the issue. Tested on rev 192200 with make -k check RUNTESTFLAGS="--target_board=sh-sim \{-m2/-ml,-m2/-mb,-m2a/-mb,-m4/-ml,-m4/-mb,-m4a/-ml,-m4a/-mb}" and no new failures. OK? Cheers, Oleg gcc/ChangeLog: PR target/52480 * config/sh/sh.md (extv, extzv): Check that operands[3] is zero, regardless of the endianness. testsuite/ChangeLog: PR target/52480 * gcc.target/sh/sh4a-bitmovua.c: Compact skip-if list. Add runtime tests. Index: gcc/testsuite/gcc.target/sh/sh4a-bitmovua.c =================================================================== --- gcc/testsuite/gcc.target/sh/sh4a-bitmovua.c (revision 192200) +++ gcc/testsuite/gcc.target/sh/sh4a-bitmovua.c (working copy) @@ -1,7 +1,7 @@ /* Verify that we generate movua to load unaligned 32-bit values on SH4A. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "*" } { "-m4a" "-m4a-single" "-m4a-single-only" "-m4a-nofpu" } } */ +/* { dg-do run { target "sh*-*-*" } } */ +/* { dg-options "-O1 -save-temps -fno-inline" } */ +/* { dg-skip-if "" { "sh*-*-*" } { "*" } { "-m4a*" } } */ /* { dg-final { scan-assembler-times "movua.l" 6 } } */ /* Aligned. */ @@ -64,4 +64,28 @@ return y4.d; } +#include +int +main (void) +{ + x1.d = 0x12345678; + assert (f1 () == 0x12345678); + + x2.d = 0x12345678; + assert (f2 () == 0x12345678); + + x3.d = 0x12345678; + assert (f3 () == 0x12345678); + + y_1.d = 0x12345678; + assert (g1 () == 0x12345678); + + y2.d = 0x12345678; + assert (g2 () == 0x12345678); + + y3.d = 0x12345678; + assert (g3 () == 0x12345678); + + return 0; +} Index: gcc/config/sh/sh.md =================================================================== --- gcc/config/sh/sh.md (revision 192200) +++ gcc/config/sh/sh.md (working copy) @@ -12706,7 +12706,7 @@ } if (TARGET_SH4A_ARCH && INTVAL (operands[2]) == 32 - && INTVAL (operands[3]) == -24 * (BITS_BIG_ENDIAN != BYTES_BIG_ENDIAN) + && INTVAL (operands[3]) == 0 && MEM_P (operands[1]) && MEM_ALIGN (operands[1]) < 32) { rtx src = adjust_address (operands[1], BLKmode, 0); @@ -12738,7 +12738,7 @@ } if (TARGET_SH4A_ARCH && INTVAL (operands[2]) == 32 - && INTVAL (operands[3]) == -24 * (BITS_BIG_ENDIAN != BYTES_BIG_ENDIAN) + && INTVAL (operands[3]) == 0 && MEM_P (operands[1]) && MEM_ALIGN (operands[1]) < 32) { rtx src = adjust_address (operands[1], BLKmode, 0);