From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7123 invoked by alias); 26 Apr 2004 10:33:33 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 7106 invoked from network); 26 Apr 2004 10:33:28 -0000 Received: from unknown (HELO mtagate2.de.ibm.com) (195.212.29.151) by sources.redhat.com with SMTP; 26 Apr 2004 10:33:28 -0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate2.de.ibm.com (8.12.10/8.12.10) with ESMTP id i3QAUVVi076086; Mon, 26 Apr 2004 10:30:49 GMT Received: from d12ml102.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i3QAUI4I030952; Mon, 26 Apr 2004 12:30:19 +0200 In-Reply-To: <200404221428.i3MES0q32605@linsvr1.uk.superh.com> To: Joern Rennecke Cc: gcc@gcc.gnu.org, joern.rennecke@superh.com (Joern Rennecke), Leehod Baruch (Leehod Baruch) MIME-Version: 1.0 Subject: Re: Exploiting dual mode operation Message-ID: From: Mircea Namolaru Date: Mon, 26 Apr 2004 16:41:00 -0000 Content-Type: text/plain; charset="US-ASCII" X-SW-Source: 2004-04/txt/msg01204.txt.bz2 Hello, 1. Trying to solve the sign extension removal problem using the live highpart information has some limitations. For instance in the following case (which appears during computation of array addresses): i = sign extension i1; .... index = 64-bit shift of i // the target and the source are 64 bits In some architectures we may get the same result without using an explicit sign extension. As we understand it, your algorithm will found that the highpart of "i" is live and the sign extension will not be discarded. Another example is: int i, s; for (i = 0; i < N; i++) { s1 = s + i; s = sign extend s1; } return s; The sign extension is required for the return only, so the sign extension can be removed from the loop and placed before the return. The highpart of "s" is live, but this information alone will not help to improve the code. 2. To exploit the dual mode operation, for instructions that uses the result of explicit sign extensions we need to found if it is possible to get the same result via an instruction that doesn't require explicit sign extensions. Basically we need to found if: s1 = sign extend s t1 = sign extend t result = inst s1, t1 can be replaced by an instruction inst1: result = inst1 s, t. But this seems similar with what combine does, so the information from the description file should suffice. 3. One possible way for implementation is to use reaching definitions to propagate the sign extensions forward right before the uses. This will create opportunities for combine and gcse to do the rest of the work afterward. Another possible way is to extend gcse (but there are some issues that we still need to clarify). Maybe there is a way to use your code (or part of it) ? Mircea and Leehod