From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49715) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPwXC-00080g-4k for qemu-devel@nongnu.org; Tue, 18 Mar 2014 12:06:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WPwX6-00047p-6J for qemu-devel@nongnu.org; Tue, 18 Mar 2014 12:06:34 -0400 Received: from mail-qa0-x22f.google.com ([2607:f8b0:400d:c00::22f]:46988) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPwX6-00047c-2l for qemu-devel@nongnu.org; Tue, 18 Mar 2014 12:06:28 -0400 Received: by mail-qa0-f47.google.com with SMTP id w5so7065852qac.20 for ; Tue, 18 Mar 2014 09:06:27 -0700 (PDT) Sender: Richard Henderson Message-ID: <53286F00.1000301@twiddle.net> Date: Tue, 18 Mar 2014 09:06:24 -0700 From: Richard Henderson MIME-Version: 1.0 References: <1395157702-23108-1-git-send-email-rth@twiddle.net> <1395157702-23108-3-git-send-email-rth@twiddle.net> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/3] tcg: Use "unspecified behaviour" for shifts List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: QEMU Developers On 03/18/2014 09:02 AM, Peter Maydell wrote: > On 18 March 2014 15:48, Richard Henderson wrote: >> Change the definition such that shifts are not allowed to crash >> for any input. >> >> Signed-off-by: Richard Henderson >> --- >> tcg/README | 18 +++++++++++++----- >> 1 file changed, 13 insertions(+), 5 deletions(-) >> >> diff --git a/tcg/README b/tcg/README >> index f178212..431cee7 100644 >> --- a/tcg/README >> +++ b/tcg/README >> @@ -36,6 +36,12 @@ or a memory location which is stored in a register outside QEMU TBs >> A TCG "basic block" corresponds to a list of instructions terminated >> by a branch instruction. >> >> +An operation with "undefined behavior" may result in a crash. >> + >> +An operation with "unspecified behaviour" shall not crash. However, > > no 'u' would be consistent with the US spelling elsewhere. Oops, by fingers have no consistency. > Incidentally, are deposit ops with bogus pos and len > undefined or unspecified behavior? (And is deposit of > 64 bits to bit 0 allowed?) Yes, deposit of 64 at 0 is allowed. Since deposit parameters are immediate constants instead of values in TCGv temporaries, we check them at opcode creation in tcg-op.h. Since we abort that's undefined, I guess. r~