From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:46469) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QV645-000234-RM for qemu-devel@nongnu.org; Fri, 10 Jun 2011 14:04:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QV644-0002EX-Io for qemu-devel@nongnu.org; Fri, 10 Jun 2011 14:04:13 -0400 Received: from mail-gx0-f173.google.com ([209.85.161.173]:60199) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QV644-0002ER-Az for qemu-devel@nongnu.org; Fri, 10 Jun 2011 14:04:12 -0400 Received: by gxk26 with SMTP id 26so2496440gxk.4 for ; Fri, 10 Jun 2011 11:04:11 -0700 (PDT) Sender: Richard Henderson Message-ID: <4DF25C98.2050800@twiddle.net> Date: Fri, 10 Jun 2011 11:04:08 -0700 From: Richard Henderson MIME-Version: 1.0 References: <1307616344-27161-1-git-send-email-batuzovk@ispras.ru> <1307616344-27161-7-git-send-email-batuzovk@ispras.ru> In-Reply-To: <1307616344-27161-7-git-send-email-batuzovk@ispras.ru> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 6/6] Do constant folding for unary operations. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kirill Batuzov Cc: qemu-devel@nongnu.org, zhur@ispras.ru On 06/09/2011 03:45 AM, Kirill Batuzov wrote: > + case INDEX_op_ext8s_i32: > + return (int32_t)(int8_t)x; > + > + case INDEX_op_ext16s_i32: > + return (int32_t)(int16_t)x; No need to cast back to a 32-bit type. They'll be extended properly for the return type which is TCGArg. And if you drop these intermediate casts, you can merge the 32 and 64-bit copies. r~