From patchwork Wed Jun 7 00:30:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 9770365 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id F1CFD60353 for ; Wed, 7 Jun 2017 00:53:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D3F122841C for ; Wed, 7 Jun 2017 00:53:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C8E4A28520; Wed, 7 Jun 2017 00:53:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6A2102841C for ; Wed, 7 Jun 2017 00:53:30 +0000 (UTC) Received: from localhost ([::1]:40645 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dIPE1-0004zA-ED for patchwork-qemu-devel@patchwork.kernel.org; Tue, 06 Jun 2017 20:53:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33922) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dIOtL-0002ot-SH for qemu-devel@nongnu.org; Tue, 06 Jun 2017 20:32:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dIOtK-00023Q-Vt for qemu-devel@nongnu.org; Tue, 06 Jun 2017 20:32:07 -0400 Received: from mail-qt0-x241.google.com ([2607:f8b0:400d:c0d::241]:36010) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dIOtK-00023L-Ry for qemu-devel@nongnu.org; Tue, 06 Jun 2017 20:32:06 -0400 Received: by mail-qt0-x241.google.com with SMTP id s33so19304364qtg.3 for ; Tue, 06 Jun 2017 17:32:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=YQBW8ieQfu+dv4kgXRs3Mg/Ye2gyrG9MFH6XDvTycAI=; b=LTVKkXNrJvErWFp6AZ5Li/Y3RsxkO12ecYB4rlKfjPCCtBMV2EO0kynsk6h3v3i8rp o7cOm7bOt/LQ3ezH12dihGFxcP0Gvk77mF88SytJYu6+Jzd5cQsJmqOGDj681gNoxrU4 QYisJSxiNA9UnReazFejAcrLM2D0hkoYJ4E9huIr6+2+qbuL7Db66TXG+r0cCnMYWTPu NrHh/0h2cD0m0RoZt5diGvzLfbFWxvM+tfTqLjHsreFSY9Kkd77UlGtE3lxGcLx3NF79 K6ML5DRx9u/yQBBxNGhcnlQU6A2ZXpiMwBU4hL3/3QtNyytvPacRhhEfC+xvSLpYAYb6 C0oQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=YQBW8ieQfu+dv4kgXRs3Mg/Ye2gyrG9MFH6XDvTycAI=; b=P0kMkV/TeeDem+OeYhUMUbqAxcvN8Jihq0a2eo09ziWNuJHlmLx5iIx0l1dr9yGkoJ pqq3SXSmq9b237zbN5u6CaXJrjiys+hLnb9pgFLHjC126GmvPVkw1CsEJGW0qbAjlUBl agAMTHJCUJtDG1ZuPqfp8AQrw2yPvxrDB9UIC4xI32jFBySHK5uYaZ5MEK1FZphrVEvJ QTaWoI4UPS1WXwlTQR3k3HfQ2yhFrZQCPyy6jCmgXdGVPu1JunGYmiKS3O3gNNo51+O8 iRiAdqz7hUjvEoOIvYqvjvz3c3XPuUGLsZkcg10CkIyQbCjAabi81f8SJ40BjdCdicKc 4zMA== X-Gm-Message-State: AODbwcAqy/PyaqJ4zDq4KqK0vAEzDH2pNRhIchSARIYaliC1R1/7tzzk RHDSRPJj/WEMy/coNZo= X-Received: by 10.237.61.39 with SMTP id g36mr33555928qtf.60.1496795526184; Tue, 06 Jun 2017 17:32:06 -0700 (PDT) Received: from bigtime.twiddle.net.com (71-217-91-69.tukw.qwest.net. [71.217.91.69]) by smtp.gmail.com with ESMTPSA id m47sm29286qtc.36.2017.06.06.17.32.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Jun 2017 17:32:05 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 6 Jun 2017 17:30:41 -0700 Message-Id: <20170607003119.14778-33-rth@twiddle.net> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170607003119.14778-1-rth@twiddle.net> References: <20170607003119.14778-1-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::241 Subject: [Qemu-devel] [PULL v2 32/70] target/s390x: Fix EXECUTE with R1==0 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, aurelien@aurel32.net Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP The PoO specifies that when R1==0, no ORing into the insn loaded from storage takes place. Load a zero for this case. Reviewed-by: Aurelien Jarno Signed-off-by: Richard Henderson --- target/s390x/insn-data.def | 4 ++-- target/s390x/translate.c | 14 +++++++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/target/s390x/insn-data.def b/target/s390x/insn-data.def index cac0f51..3c3541c 100644 --- a/target/s390x/insn-data.def +++ b/target/s390x/insn-data.def @@ -327,9 +327,9 @@ C(0xeb57, XIY, SIY, LD, m1_8u, i2_8u, new, m1_8, xor, nz64) /* EXECUTE */ - C(0x4400, EX, RX_a, Z, r1_o, a2, 0, 0, ex, 0) + C(0x4400, EX, RX_a, Z, 0, a2, 0, 0, ex, 0) /* EXECUTE RELATIVE LONG */ - C(0xc600, EXRL, RIL_b, EE, r1_o, ri2, 0, 0, ex, 0) + C(0xc600, EXRL, RIL_b, EE, 0, ri2, 0, 0, ex, 0) /* EXTRACT ACCESS */ C(0xb24f, EAR, RRE, Z, 0, 0, new, r1_32, ear, 0) diff --git a/target/s390x/translate.c b/target/s390x/translate.c index c1162a1..78c14ef 100644 --- a/target/s390x/translate.c +++ b/target/s390x/translate.c @@ -2164,15 +2164,27 @@ static ExitStatus op_ex(DisasContext *s, DisasOps *o) MVC inside of memcpy, which needs a helper call anyway. So perhaps this doesn't bear thinking about any further. */ + int r1 = get_field(s->fields, r1); TCGv_i32 ilen; + TCGv_i64 v1; update_psw_addr(s); gen_op_calc_cc(s); + if (r1 == 0) { + v1 = tcg_const_i64(0); + } else { + v1 = regs[r1]; + } + ilen = tcg_const_i32(s->next_pc - s->pc); - gen_helper_ex(cpu_env, ilen, o->in1, o->in2); + gen_helper_ex(cpu_env, ilen, v1, o->in2); tcg_temp_free_i32(ilen); + if (r1 == 0) { + tcg_temp_free_i64(v1); + } + return NO_EXIT; }