From patchwork Tue May 9 18:07:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 9718799 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 4869560364 for ; Tue, 9 May 2017 18:10:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3F1A428415 for ; Tue, 9 May 2017 18:10:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3321828435; Tue, 9 May 2017 18:10:56 +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 8AB6828415 for ; Tue, 9 May 2017 18:10:55 +0000 (UTC) Received: from localhost ([::1]:38768 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d89b4-0003hO-NA for patchwork-qemu-devel@patchwork.kernel.org; Tue, 09 May 2017 14:10:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53924) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d89Xj-00017J-Hh for qemu-devel@nongnu.org; Tue, 09 May 2017 14:07:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d89Xi-0002nh-Do for qemu-devel@nongnu.org; Tue, 09 May 2017 14:07:27 -0400 Received: from mail-qk0-x229.google.com ([2607:f8b0:400d:c09::229]:33743) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d89Xi-0002mk-AK for qemu-devel@nongnu.org; Tue, 09 May 2017 14:07:26 -0400 Received: by mail-qk0-x229.google.com with SMTP id y201so8248647qka.0 for ; Tue, 09 May 2017 11:07:26 -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=aTkoRJifqfE+BmekeLe1hGpPsAC+St5Tr4vgFhwHdqY=; b=gMNbHJ5Y+/CEv0WupI4RoklcHaSlwa4Idm2cJHl+kxyY3E5XtTrQ55hc1hAOS0KWgY nRcBKupSRW1RnV9MNQnGnIH3b2pF0Wk27/Wk6O+9tARznn3Ll9InA6WQRMb8nDUvXHMj eCie+pzjl0ve0aYTU0JX7HKPRFnlMOalDZyXUTTXbNBlFho8wGB3u1q2DSh25ZY1azbp pyS7UaKjZfYSvzNqro7WFFwFQk6PZT9VD0dl25bDV0XWHVcO03/jz+V/HtP4DRJIa8hN 0gh7QoyYOZ8cLqvXP3gLb6TSIw1vumMaZy8AYbt1+MhRNPBxxm1fIGQi79DKtf4W4FPC vaEA== 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=aTkoRJifqfE+BmekeLe1hGpPsAC+St5Tr4vgFhwHdqY=; b=ScxIpn1QRM323NKIviuetdJdrQwR1Tp2SrSHZEeLGExm2Sgo4dGNIlkmb4kbh1R06d nlMcsGdZUwJp6usNrpdKOZkblOxngwM0j3xBlXclvgZEKVpls4ODjV7hSEVLAqTsOdYB YihA/2XvqLeIFEETWIMZZVT7fdIqPhu/099q4L+k0tZjuWydS0MyH2QC0NXC0DqPCf2T FLPd22cUnU7CgoVEbCotPv+6+kON1N9uLvvTGisbswVhWcSXVzsyzfFWJivf5Sx8/hpC C+vcz9hS268SSoQhJAJpsCUHOBsqyl4RX+KbMnBf1yRGcSncw9h5/M7ReWNqk0/28KQB t8NQ== X-Gm-Message-State: AODbwcC2NMXGj2PwvvpBGfAp8c2FKM4JSelyASw5Djf1z644x78OaVbj JxCi8Lx0wO7HTJJ7cIE= X-Received: by 10.55.97.76 with SMTP id v73mr1425681qkb.241.1494353245531; Tue, 09 May 2017 11:07:25 -0700 (PDT) Received: from bigtime.twiddle.net.com ([2602:47:d954:1500:5e51:4fff:fe40:9c64]) by smtp.gmail.com with ESMTPSA id w12sm213102qtc.20.2017.05.09.11.07.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 May 2017 11:07:24 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 9 May 2017 11:07:13 -0700 Message-Id: <20170509180715.22910-5-rth@twiddle.net> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170509180715.22910-1-rth@twiddle.net> References: <20170509180715.22910-1-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::229 Subject: [Qemu-devel] [PATCH v3 4/6] target/s390x: Implement LOAD PAIR DISJOINT 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: Eric Bischoff Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Eric Bischoff Reviewed-by: Aurelien Jarno Signed-off-by: Eric Bischoff Message-Id: <20170228120134.7921-1-ebischoff@suse.com> [rth: Combine the two via insn->data; free the address temps.] Signed-off-by: Richard Henderson --- target/s390x/insn-data.def | 4 +++- target/s390x/translate.c | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/target/s390x/insn-data.def b/target/s390x/insn-data.def index 43c5707..0909060 100644 --- a/target/s390x/insn-data.def +++ b/target/s390x/insn-data.def @@ -504,7 +504,9 @@ C(0xb9e2, LOCGR, RRF_c, LOC, r1, r2, r1, 0, loc, 0) C(0xebf2, LOC, RSY_b, LOC, r1, m2_32u, new, r1_32, loc, 0) C(0xebe2, LOCG, RSY_b, LOC, r1, m2_64, r1, 0, loc, 0) -/* LOAD PAIR DISJOINT TODO */ +/* LOAD PAIR DISJOINT */ + D(0xc804, LPD, SSF, ILA, 0, 0, new_P, r3_P32, lpd, 0, MO_TEUL) + D(0xc805, LPDG, SSF, ILA, 0, 0, new_P, r3_P64, lpd, 0, MO_TEQ) /* LOAD POSITIVE */ C(0x1000, LPR, RR_a, Z, 0, r2_32s, new, r1_32, abs, abs32) C(0xb900, LPGR, RRE, Z, 0, r2, r1, 0, abs, abs64) diff --git a/target/s390x/translate.c b/target/s390x/translate.c index 2b66a4e..8de0177 100644 --- a/target/s390x/translate.c +++ b/target/s390x/translate.c @@ -2559,6 +2559,7 @@ static ExitStatus op_lctlg(DisasContext *s, DisasOps *o) tcg_temp_free_i32(r3); return NO_EXIT; } + static ExitStatus op_lra(DisasContext *s, DisasOps *o) { check_privileged(s); @@ -2759,6 +2760,31 @@ static ExitStatus op_lm64(DisasContext *s, DisasOps *o) return NO_EXIT; } +static ExitStatus op_lpd(DisasContext *s, DisasOps *o) +{ + TCGv_i64 a1, a2; + TCGMemOp mop = s->insn->data; + + /* In a parallel context, stop the world and single step. */ + if (parallel_cpus) { + potential_page_fault(s); + gen_helper_exit_atomic(cpu_env); + return EXIT_NORETURN; + } + + /* In a serial context, perform the two loads ... */ + a1 = get_address(s, 0, get_field(s->fields, b1), get_field(s->fields, d1)); + a2 = get_address(s, 0, get_field(s->fields, b2), get_field(s->fields, d2)); + tcg_gen_qemu_ld_i64(o->out, a1, get_mem_index(s), mop | MO_ALIGN); + tcg_gen_qemu_ld_i64(o->out2, a2, get_mem_index(s), mop | MO_ALIGN); + tcg_temp_free_i64(a1); + tcg_temp_free_i64(a2); + + /* ... and indicate that we performed them while interlocked. */ + gen_op_movi_cc(s, 0); + return NO_EXIT; +} + #ifndef CONFIG_USER_ONLY static ExitStatus op_lura(DisasContext *s, DisasOps *o) { @@ -4430,6 +4456,22 @@ static void wout_r1_D32(DisasContext *s, DisasFields *f, DisasOps *o) } #define SPEC_wout_r1_D32 SPEC_r1_even +static void wout_r3_P32(DisasContext *s, DisasFields *f, DisasOps *o) +{ + int r3 = get_field(f, r3); + store_reg32_i64(r3, o->out); + store_reg32_i64(r3 + 1, o->out2); +} +#define SPEC_wout_r3_P32 SPEC_r3_even + +static void wout_r3_P64(DisasContext *s, DisasFields *f, DisasOps *o) +{ + int r3 = get_field(f, r3); + store_reg(r3, o->out); + store_reg(r3 + 1, o->out2); +} +#define SPEC_wout_r3_P64 SPEC_r3_even + static void wout_e1(DisasContext *s, DisasFields *f, DisasOps *o) { store_freg32_i64(get_field(f, r1), o->out);