From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28366 invoked by alias); 19 May 2014 09:30:46 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 28351 invoked by uid 89); 19 May 2014 09:30:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: service87.mimecast.com Received: from service87.mimecast.com (HELO service87.mimecast.com) (91.220.42.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 19 May 2014 09:30:44 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Mon, 19 May 2014 10:30:41 +0100 Received: from SHAWIN202 ([10.1.255.212]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 19 May 2014 10:30:47 +0100 From: "Thomas Preud'homme" To: "GCC Patches" References: <006f01cf6b71$1cf10df0$56d329d0$@arm.com> <000001cf70ee$9aa2ed90$cfe8c8b0$@arm.com> In-Reply-To: Subject: RE: [PATCH] Fix PR54733 Optimize endian independent load/store Date: Mon, 19 May 2014 09:30:00 -0000 Message-ID: <000101cf7345$05da1630$118e4290$@arm.com> MIME-Version: 1.0 X-MC-Unique: 114051910304109401 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2014-05/txt/msg01459.txt.bz2 > From: Richard Biener [mailto:richard.guenther@gmail.com] >=20 > Oh, and what happens for >=20 > unsigned foo (unsigned char *x) > { > return x[0] << 24 | x[2] << 8 | x[3]; > } >=20 > ? We could do an unsigned int load from x and zero byte 3 > with an AND. Enhancement for a followup, similar to also > considering vector types for the load (also I'm not sure > that uint64_type_node always has non-BLKmode for all > targets). I implemented this but it makes the statistics more difficult to read and thus the test more difficult to write. Indeed, when doing a full bswap many of the intermediate computations are partial bswap. I can get on with it by using a different string to notify of partial bswap than full bswap and test the partial bswap feature in a separate file to not get noise from the full bswap. However I still don't like the idea of notifying for partial bswap in statements that will eventually be eliminated as dead statements. Besides, this occur because some recursion is made for each statement even if they were already examined which is not very nice in itself. The solution I see is to keep a map of visited statements but I don't know if that's fine in this case. After all, it's not strictly necessary as the pass would work without this. It would just serve to avoid redundant computation and confusion statistics. Best regards, Thomas