From patchwork Sat Nov 3 09:50:02 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 196814 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 492B92C00D7 for ; Sat, 3 Nov 2012 20:50:10 +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=1352541011; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:From:To:Mail-Followup-To:Subject:Date:Message-ID: User-Agent:MIME-Version:Content-Type:Mailing-List:Precedence: List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=tanrOdQa6JWdlC0EySXcoA2jMmY=; b=AV12EDghnMuNBm0 d0xs8rtXYhRMHV6svlY16y9XCwGuzFE+bKU2497NqsfQkB9NIhjRzNo/SIKE9Mpb dRvO9ldxn8edwnCJPyOYOEWksnWth5S26cB3z/Fyj7C1Vryhn06AShjL7QNiynE/ dWKRzbNPuvs+4bBI153bJCHBlfyM= 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:Received:From:To:Mail-Followup-To:Subject:Date:Message-ID:User-Agent:MIME-Version:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=SGqW9recadogtFClM9lgWBwJdmq3LS9v+Bsvfhe8ukDB8iPEC9vmNUpt6JAAp2 p5b9VfyE6D4fR5lz3tk47Wu4Da2ZXxrAPp3TCxRcGtmbtVIBbO3VoGcI3dMirUgY XlAyUTGkrq/6w7LDQDe9Yuh83omd63EEd76HkQYfmL0rg=; Received: (qmail 25118 invoked by alias); 3 Nov 2012 09:50:06 -0000 Received: (qmail 25109 invoked by uid 22791); 3 Nov 2012 09:50:05 -0000 X-SWARE-Spam-Status: No, hits=-3.6 required=5.0 tests=AWL, BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, KHOP_RCVD_TRUST, KHOP_SPAMHAUS_DROP, NML_ADSP_CUSTOM_MED, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-wg0-f51.google.com (HELO mail-wg0-f51.google.com) (74.125.82.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 03 Nov 2012 09:50:00 +0000 Received: by mail-wg0-f51.google.com with SMTP id ed3so2243050wgb.8 for ; Sat, 03 Nov 2012 02:49:59 -0700 (PDT) Received: by 10.180.101.165 with SMTP id fh5mr5870607wib.7.1351936199463; Sat, 03 Nov 2012 02:49:59 -0700 (PDT) Received: from localhost ([2.26.192.222]) by mx.google.com with ESMTPS id en20sm1981008wid.4.2012.11.03.02.49.57 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 03 Nov 2012 02:49:58 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, rdsandiford@googlemail.com Subject: [MIPS, committed] Tweak octeon-exts-7.c test Date: Sat, 03 Nov 2012 09:50:02 +0000 Message-ID: <87objff22d.fsf@talisman.home> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 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 Adam added octeon-exts-7.c in: http://gcc.gnu.org/ml/gcc-patches/2009-07/msg00406.html to test that a sign_extract, truncate, sign_extend sequence got folded into a single sign_extract on targets where truncation is a sign-extension operation. The patches that I'm about to post defeat the test on EABI64 targets (for which the structure is passed by reference) because they allow the load and extraction to be done in 32 bits rather than 64. I only noticed because little-endian targets would then use SRA rather than EXTS to get the bitfield. I've applied the patch below to force a 64-bit operation to be used. I checked the dumps to make sure that we still had the sign_extract, truncate, sign_extend sequence before combine and that combine managed to fold it. Tested on mipsisa64-elf. Richard gcc/testsuite/ * gcc.target/mips/octeon-exts-7.c (bar): Make sure the extraction of b requires a 64-bit operation followed by a truncation. Index: gcc/testsuite/gcc.target/mips/octeon-exts-7.c =================================================================== --- gcc/testsuite/gcc.target/mips/octeon-exts-7.c 2012-08-27 17:31:22.000000000 +0100 +++ gcc/testsuite/gcc.target/mips/octeon-exts-7.c 2012-11-03 09:11:01.535370627 +0000 @@ -8,7 +8,8 @@ struct bar { long long a:18; - long long b:14; + long long b:24; + long long c:22; }; NOMIPS16 int