From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:56172) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QPgsm-0003ox-6Z for qemu-devel@nongnu.org; Thu, 26 May 2011 16:10:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QPgsl-0003hA-4l for qemu-devel@nongnu.org; Thu, 26 May 2011 16:10:12 -0400 Received: from mail-gy0-f173.google.com ([209.85.160.173]:38767) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QPgsl-0003h4-2F for qemu-devel@nongnu.org; Thu, 26 May 2011 16:10:11 -0400 Received: by gyg4 with SMTP id 4so544517gyg.4 for ; Thu, 26 May 2011 13:10:10 -0700 (PDT) Sender: Richard Henderson Message-ID: <4DDEB39F.80609@twiddle.net> Date: Thu, 26 May 2011 13:10:07 -0700 From: Richard Henderson MIME-Version: 1.0 References: <97bbf40c055a9949f5fbf185764792679fb8273a.1305889001.git.batuzovk@ispras.ru> <4DD6B4E9.3040501@twiddle.net> <4DDE5C28.4030507@twiddle.net> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 5/6] Do constant folding for shift operations. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: mj.mccormack@samsung.com, qemu-devel@nongnu.org, zhur@ispras.ru, Kirill Batuzov On 05/26/2011 12:14 PM, Blue Swirl wrote: > On Thu, May 26, 2011 at 4:56 PM, Richard Henderson wrote: >> On 05/26/2011 05:36 AM, Kirill Batuzov wrote: >>>> x = (int32_t)x >> (int32_t)y; >>>> >>> This expression has an implementation-defined behavior accroding to >>> C99 6.5.7 so we decided to emulate signed shifts by hand. >> >> Technically, yes. In practice, no. GCC, ICC, LLVM, MSVC all know >> what the user wants here and will implement it "properly". > > Can't this be probed by configure? Then a wrapper could be introduced > for signed shifts. I don't see the point. The C99 implementation defined escape hatch exists for weird cpus. Which we won't be supporting as a QEMU host. r~