From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32957) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPvnQ-0000sC-B4 for qemu-devel@nongnu.org; Tue, 18 Mar 2014 11:19:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WPvnH-0003Eh-OY for qemu-devel@nongnu.org; Tue, 18 Mar 2014 11:19:16 -0400 Received: from mail-qc0-x232.google.com ([2607:f8b0:400d:c01::232]:38477) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPvnH-0003Ec-Kf for qemu-devel@nongnu.org; Tue, 18 Mar 2014 11:19:07 -0400 Received: by mail-qc0-f178.google.com with SMTP id i8so8056919qcq.9 for ; Tue, 18 Mar 2014 08:19:07 -0700 (PDT) Sender: Richard Henderson Message-ID: <532863E7.8060606@twiddle.net> Date: Tue, 18 Mar 2014 08:19:03 -0700 From: Richard Henderson MIME-Version: 1.0 References: <5328564A.8060409@twiddle.net> <53285A90.6040300@twiddle.net> <53285E88.3060407@twiddle.net> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] target-i386: guest variable shift by 0 provokes shift by -1 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: QEMU Developers On 03/18/2014 08:01 AM, Peter Maydell wrote: > Unless all our host architectures have undefined-result > behaviour for variable shifts by out of range values > then we can't make the TCG op semantics do that. > (They probably can; the only counterexample I know > of is the 8086, where the variable-shift cycle count > was proportional to the value of the shift, so feeding > it -1 would effectively cause it to hang.) ARM is our only host architecture that does not mask the input to the width of the operand. That one, of course, masks with 255 and produces zero for shifts larger than the width of the operand. There are several host architectures for which we do not have backends that e.g. always mask with 63, even for the 32-bit shifts. r~