From patchwork Fri Sep 28 00:46:35 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 187634 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 3A8122C00B8 for ; Fri, 28 Sep 2012 10:46:49 +1000 (EST) Received: from localhost ([::1]:48686 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1THOj9-0007iE-EJ for incoming@patchwork.ozlabs.org; Thu, 27 Sep 2012 20:46:47 -0400 Received: from eggs.gnu.org ([208.118.235.92]:41203) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1THOj2-0007i9-R1 for qemu-devel@nongnu.org; Thu, 27 Sep 2012 20:46:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1THOj1-00034T-EF for qemu-devel@nongnu.org; Thu, 27 Sep 2012 20:46:40 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:33147) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1THOj1-00034P-8F for qemu-devel@nongnu.org; Thu, 27 Sep 2012 20:46:39 -0400 Received: by pbbrp2 with SMTP id rp2so4373807pbb.4 for ; Thu, 27 Sep 2012 17:46:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=ZIQuQ4CG9y9BJcBbJ6/fSAtHCUNn2qN00Q/bDynCEa4=; b=pmaFRWV+4/VcrGlTkUJMz+ARbbBk4zy4jgNg3eUrdR3iMSJV5vRPua6x1ZXgspZE4d AUjfKMAY/FwEX2PzJpC/UKnRYsb00/OIZ6vqL0iLNtWfywkpFcYBoQxn6f+NC2mKmZWt oZpbB8cbLcyL2lAFr4iQZFrif1ZBgMk+intylJBG6G6X+fp4gIzf6X1WQAnlXJmpyUIe oybMeLMh2katySP2xvK9blJiF/oID6v29nu9xSqJThqaqbwL2ERDcXoJZbYQhaqZrR0e au2uftcQHMWBm9oXqS+00MePJd45CRapXIADLYAkc6M9d0RIsiWDtdlTwIPeoh2rsNB/ qM2w== Received: by 10.68.212.71 with SMTP id ni7mr15835050pbc.81.1348793198526; Thu, 27 Sep 2012 17:46:38 -0700 (PDT) Received: from anchor.twiddle.home.com ([173.160.232.49]) by mx.google.com with ESMTPS id te6sm4636514pbc.29.2012.09.27.17.46.37 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 27 Sep 2012 17:46:37 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 27 Sep 2012 17:46:35 -0700 Message-Id: <1348793195-27487-1-git-send-email-rth@twiddle.net> X-Mailer: git-send-email 1.7.11.4 In-Reply-To: <1348785610-23418-1-git-send-email-rth@twiddle.net> References: <1348785610-23418-1-git-send-email-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.160.45 Cc: Alexander Graf Subject: [Qemu-devel] [PATCH 111/147] target-s390: Convert STCKE X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Richard Henderson --- target-s390x/helper.h | 1 - target-s390x/insn-data.def | 2 ++ target-s390x/misc_helper.c | 14 -------------- target-s390x/translate.c | 31 ++++++++++++++++++++++--------- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/target-s390x/helper.h b/target-s390x/helper.h index 84a46f5..4ba81af 100644 --- a/target-s390x/helper.h +++ b/target-s390x/helper.h @@ -87,7 +87,6 @@ DEF_HELPER_4(diag, i64, env, i32, i64, i64) DEF_HELPER_3(load_psw, void, env, i64, i64) DEF_HELPER_FLAGS_2(spx, TCG_CALL_CONST, void, env, i64) DEF_HELPER_FLAGS_1(stck, TCG_CALL_CONST | TCG_CALL_PURE, i64, env) -DEF_HELPER_2(stcke, i32, env, i64) DEF_HELPER_FLAGS_2(sckc, TCG_CALL_CONST, void, env, i64) DEF_HELPER_FLAGS_1(stckc, TCG_CALL_CONST, i64, env) DEF_HELPER_FLAGS_2(spt, TCG_CALL_CONST, void, env, i64) diff --git a/target-s390x/insn-data.def b/target-s390x/insn-data.def index 12468a3..75729fe 100644 --- a/target-s390x/insn-data.def +++ b/target-s390x/insn-data.def @@ -663,6 +663,8 @@ /* STORE CLOCK */ C(0xb205, STCK, S, Z, la2, 0, new, m1_64, stck, 0) C(0xb27c, STCKF, S, Z, la2, 0, new, m1_64, stck, 0) +/* STORE CLOCK EXTENDED */ + C(0xb278, STCKE, S, Z, 0, a2, 0, 0, stcke, 0) /* STORE CLOCK COMPARATOR */ C(0xb207, STCKC, S, Z, la2, 0, new, m1_64, stckc, 0) /* STORE CONTROL */ diff --git a/target-s390x/misc_helper.c b/target-s390x/misc_helper.c index 925dc0a..cf4ae62 100644 --- a/target-s390x/misc_helper.c +++ b/target-s390x/misc_helper.c @@ -204,20 +204,6 @@ uint64_t HELPER(stck)(CPUS390XState *env) return clock_value(env); } -/* Store Clock Extended */ -uint32_t HELPER(stcke)(CPUS390XState *env, uint64_t a1) -{ - cpu_stb_data(env, a1, 0); - /* basically the same value as stck */ - cpu_stq_data(env, a1 + 1, clock_value(env) | env->cpu_num); - /* more fine grained than stck */ - cpu_stq_data(env, a1 + 9, 0); - /* XXX programmable fields */ - cpu_stw_data(env, a1 + 17, 0); - - return 0; -} - /* Set Clock Comparator */ void HELPER(sckc)(CPUS390XState *env, uint64_t time) { diff --git a/target-s390x/translate.c b/target-s390x/translate.c index 585e739..9b664aa 100644 --- a/target-s390x/translate.c +++ b/target-s390x/translate.c @@ -1033,15 +1033,6 @@ static void disas_b2(CPUS390XState *env, DisasContext *s, int op, LOG_DISAS("disas_b2: op 0x%x r1 %d r2 %d\n", op, r1, r2); switch (op) { - case 0x78: /* STCKE D2(B2) [S] */ - /* Store Clock Extended */ - decode_rs(s, insn, &r1, &r3, &b2, &d2); - tmp = get_address(s, 0, b2, d2); - potential_page_fault(s); - gen_helper_stcke(cc_op, cpu_env, tmp); - set_cc_static(s); - tcg_temp_free_i64(tmp); - break; case 0x79: /* SACF D2(B2) [S] */ /* Set Address Space Control Fast */ check_privileged(s); @@ -2828,6 +2819,28 @@ static ExitStatus op_stck(DisasContext *s, DisasOps *o) return NO_EXIT; } +static ExitStatus op_stcke(DisasContext *s, DisasOps *o) +{ + TCGv_i64 c1 = tcg_temp_new_i64(); + TCGv_i64 c2 = tcg_temp_new_i64(); + gen_helper_stck(c1, cpu_env); + /* Shift the 64-bit value into its place as a zero-extended + 104-bit value. Note that "bit positions 64-103 are always + non-zero so that they compare differently to STCK"; we set + the least significant bit to 1. */ + tcg_gen_shli_i64(c2, c1, 56); + tcg_gen_shri_i64(c1, c1, 8); + tcg_gen_ori_i64(c2, c2, 0x10000); + tcg_gen_qemu_st64(c1, o->in2, get_mem_index(s)); + tcg_gen_addi_i64(o->in2, o->in2, 8); + tcg_gen_qemu_st64(c2, o->in2, get_mem_index(s)); + tcg_temp_free_i64(c1); + tcg_temp_free_i64(c2); + /* ??? We don't implement clock states. */ + gen_op_movi_cc(s, 0); + return NO_EXIT; +} + static ExitStatus op_sckc(DisasContext *s, DisasOps *o) { check_privileged(s);