From patchwork Fri Sep 28 00:01:57 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 187589 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 7BE792C00A2 for ; Fri, 28 Sep 2012 10:02:13 +1000 (EST) Received: from localhost ([::1]:35549 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1THO1z-000068-Lv for incoming@patchwork.ozlabs.org; Thu, 27 Sep 2012 20:02:11 -0400 Received: from eggs.gnu.org ([208.118.235.92]:55167) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1THO1r-0008UH-Kp for qemu-devel@nongnu.org; Thu, 27 Sep 2012 20:02:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1THO1q-0004oa-Cw for qemu-devel@nongnu.org; Thu, 27 Sep 2012 20:02:03 -0400 Received: from mail-pa0-f45.google.com ([209.85.220.45]:62232) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1THO1q-0004oW-6A for qemu-devel@nongnu.org; Thu, 27 Sep 2012 20:02:02 -0400 Received: by padfb10 with SMTP id fb10so1780546pad.4 for ; Thu, 27 Sep 2012 17:02:01 -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=U7/YSEU+z10urp/khU31ZjkLRgUm+uAJiURB9Tp82/E=; b=znuwRSvYRMd8NVdebicOuoHC8eFvU3Mx47rzdFUFc3OtGxVIGLchZXN9XoMg+T4zQa 0sZA5S2XgmkRoTk3G/gzYEMGBS3C2KrrQICsiHVhBY233bIDoEQIHNgsdqABsl7+ZTh3 nJICv2CfhHUORwl06LjT2cBEnuqV41aHQMFSwYqphzLL0oW7fF44WnGLmThHLhsbbrsz aearFESQoJpFKdnHPkVFCC2B1Wo4bsZwHyKaFPtqI/T71QsV6KkGEW2geMHp3OrHg/ya loNPCw+tLlpqOGq/RySYSsFvXWHtVMqxkwBfqIoTG6Psi3uq4iqrxE9cw13VxER3S5PC rJQA== Received: by 10.66.75.74 with SMTP id a10mr13310103paw.46.1348790521424; Thu, 27 Sep 2012 17:02:01 -0700 (PDT) Received: from anchor.twiddle.home.com ([173.160.232.49]) by mx.google.com with ESMTPS id pa6sm4570484pbc.71.2012.09.27.17.02.00 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 27 Sep 2012 17:02:00 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 27 Sep 2012 17:01:57 -0700 Message-Id: <1348790517-25650-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.220.45 Cc: Alexander Graf Subject: [Qemu-devel] [PATCH 069/147] target-s390: Convert CLM 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/insn-data.def | 4 ++++ target-s390x/translate.c | 32 +++++++++++++++++++------------- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/target-s390x/insn-data.def b/target-s390x/insn-data.def index 4714095..15ded97 100644 --- a/target-s390x/insn-data.def +++ b/target-s390x/insn-data.def @@ -136,6 +136,10 @@ C(0xc606, CLGHRL, RIL_b, GIE, r1_o, mri2_16u, 0, 0, 0, cmpu64) /* COMPARE LOGICAL LONG EXTENDED */ C(0xa900, CLCLE, RS_a, Z, 0, a2, 0, 0, clcle, 0) +/* COMPARE LOGICAL CHARACTERS UNDER MASK */ + C(0xbd00, CLM, RS_b, Z, r1_o, a2, 0, 0, clm, 0) + C(0xeb21, CLMY, RSY_b, LD, r1_o, a2, 0, 0, clm, 0) + C(0xeb20, CLMH, RSY_b, Z, r1_sr32, a2, 0, 0, clm, 0) /* COMPARE AND SWAP */ C(0xba00, CS, RS_a, Z, r1_o, a2, new, r1_32, cs, 0) diff --git a/target-s390x/translate.c b/target-s390x/translate.c index f7a4ad2..458cd08 100644 --- a/target-s390x/translate.c +++ b/target-s390x/translate.c @@ -1997,19 +1997,6 @@ static void disas_s390_insn(CPUS390XState *env, DisasContext *s) op = (insn >> 16) & 0xff; disas_b9(env, s, op, r1, r2); break; - case 0xbd: /* CLM R1,M3,D2(B2) [RS] */ - insn = ld_code4(env, s->pc); - decode_rs(s, insn, &r1, &r3, &b2, &d2); - tmp = get_address(s, 0, b2, d2); - tmp32_1 = load_reg32(r1); - tmp32_2 = tcg_const_i32(r3); - potential_page_fault(s); - gen_helper_clm(cc_op, cpu_env, tmp32_1, tmp32_2, tmp); - set_cc_static(s); - tcg_temp_free_i64(tmp); - tcg_temp_free_i32(tmp32_1); - tcg_temp_free_i32(tmp32_2); - break; case 0xbe: /* STCM R1,M3,D2(B2) [RS] */ insn = ld_code4(env, s->pc); decode_rs(s, insn, &r1, &r3, &b2, &d2); @@ -2628,6 +2615,19 @@ static ExitStatus op_clcle(DisasContext *s, DisasOps *o) return NO_EXIT; } +static ExitStatus op_clm(DisasContext *s, DisasOps *o) +{ + TCGv_i32 m3 = tcg_const_i32(get_field(s->fields, m3)); + TCGv_i32 t1 = tcg_temp_new_i32(); + tcg_gen_trunc_i64_i32(t1, o->in1); + potential_page_fault(s); + gen_helper_clm(cc_op, cpu_env, t1, m3, o->in2); + set_cc_static(s); + tcg_temp_free_i32(t1); + tcg_temp_free_i32(m3); + return NO_EXIT; +} + static ExitStatus op_cs(DisasContext *s, DisasOps *o) { int r3 = get_field(s->fields, r3); @@ -3712,6 +3712,12 @@ static void in1_r1_32u(DisasContext *s, DisasFields *f, DisasOps *o) tcg_gen_ext32u_i64(o->in1, regs[get_field(f, r1)]); } +static void in1_r1_sr32(DisasContext *s, DisasFields *f, DisasOps *o) +{ + o->in1 = tcg_temp_new_i64(); + tcg_gen_shri_i64(o->in1, regs[get_field(f, r1)], 32); +} + static void in1_r1p1(DisasContext *s, DisasFields *f, DisasOps *o) { /* ??? Specification exception: r1 must be even. */