From nobody Thu Oct 30 15:31:11 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1526337249102277.036412861544; Mon, 14 May 2018 15:34:09 -0700 (PDT) Received: from localhost ([::1]:50368 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fIM2i-00017w-Aw for importer@patchew.org; Mon, 14 May 2018 18:34:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55439) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fILwJ-0004DU-VP for qemu-devel@nongnu.org; Mon, 14 May 2018 18:27:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fILwJ-0008TF-4G for qemu-devel@nongnu.org; Mon, 14 May 2018 18:27:31 -0400 Received: from mail-pf0-x243.google.com ([2607:f8b0:400e:c00::243]:43870) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fILwI-0008SU-VM for qemu-devel@nongnu.org; Mon, 14 May 2018 18:27:31 -0400 Received: by mail-pf0-x243.google.com with SMTP id j20-v6so6673433pff.10 for ; Mon, 14 May 2018 15:27:30 -0700 (PDT) Received: from cloudburst.twiddle.net (97-113-2-170.tukw.qwest.net. [97.113.2.170]) by smtp.gmail.com with ESMTPSA id g13-v6sm19517976pfm.67.2018.05.14.15.27.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 14 May 2018 15:27:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=wov3UDEUIab80KZLsx5qFyv4cBmccw1Qn22N0bcTDV0=; b=McjJdr106vBpy2bi+W3/c+7FuRnl/398Cqjht0NlRazG7t6O3KUwAUZAaQr/8QOvG0 CcWvHO6aBsYRQ3eB5cItQhV26U6dtTmwonyR9WakJESswpwLuneay/18JbsMuAbIiu8d a1PiycBRQEhz+95JSopWbvzsxeK7VDKzqQnxo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=wov3UDEUIab80KZLsx5qFyv4cBmccw1Qn22N0bcTDV0=; b=bJffDDGnHq39IQ1lvcTo2SOSveZ88QYc/WX3R2AvWIuthHkhtGINkYHd69QPAAow3F eQDwRq2wAwJNaXEVXuqW2f8mmuU5MSj5pwqfhsHL+Ew6RSff7L5T33xGQu/uCTu9nR+h pM88uvyuoiB49JvS1o8AwIoeB9/R0pt8B+SeuyXZgjNhude5U6FuPBAeSivOOBOG8ugh 8B6ySf6wXwFuDZaBGiTBIhfIxlTp0AIrVYl1781PjlqL1PRVlzJrfyC5xrQYvmvzIWmV gWS8AF2rn5yBFWhZC2ibdWLjXDJ5Zz7jHmVKLmJy5U1ma9KwmbCS6yEP16jgIa/2AfIQ 4TFg== X-Gm-Message-State: ALKqPweB5FsB+9qeRaO0n72dmaoOCLSuBTumIB7c0vKOv11qRjkdPyDs NhL5wpTSJZ4G1xwH6PtfrmPSu1vwG6A= X-Google-Smtp-Source: AB8JxZrl30Xwbj+UdGWzT0UVcYBv2L0QRO1gx37t6bM7HQOtZYhVkklTb4D3a/RBkdz8cr2fhrLoXg== X-Received: by 2002:a63:7a44:: with SMTP id j4-v6mr9902036pgn.172.1526336849728; Mon, 14 May 2018 15:27:29 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 14 May 2018 15:27:10 -0700 Message-Id: <20180514222714.7982-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180514222714.7982-1-richard.henderson@linaro.org> References: <20180514222714.7982-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::243 Subject: [Qemu-devel] [PULL 09/13] target/openrisc: Convert dec_M 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, Stafford Horne Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Acked-by: Stafford Horne Signed-off-by: Richard Henderson --- target/openrisc/translate.c | 41 ++++++++++++------------------------ target/openrisc/insns.decode | 3 +++ 2 files changed, 16 insertions(+), 28 deletions(-) diff --git a/target/openrisc/translate.c b/target/openrisc/translate.c index b5ff7577bd..bdd4626c02 100644 --- a/target/openrisc/translate.c +++ b/target/openrisc/translate.c @@ -1030,32 +1030,21 @@ static bool trans_l_rori(DisasContext *dc, arg_dal = *a, uint32_t insn) return true; } =20 -static void dec_M(DisasContext *dc, uint32_t insn) +static bool trans_l_movhi(DisasContext *dc, arg_l_movhi *a, uint32_t insn) { - uint32_t op0; - uint32_t rd; - uint32_t K16; - op0 =3D extract32(insn, 16, 1); - rd =3D extract32(insn, 21, 5); - K16 =3D extract32(insn, 0, 16); + LOG_DIS("l.movhi r%d, %d\n", a->d, a->k); + check_r0_write(a->d); + tcg_gen_movi_tl(cpu_R[a->d], a->k << 16); + return true; +} =20 - check_r0_write(rd); - switch (op0) { - case 0x0: /* l.movhi */ - LOG_DIS("l.movhi r%d, %d\n", rd, K16); - tcg_gen_movi_tl(cpu_R[rd], (K16 << 16)); - break; - - case 0x1: /* l.macrc */ - LOG_DIS("l.macrc r%d\n", rd); - tcg_gen_trunc_i64_tl(cpu_R[rd], cpu_mac); - tcg_gen_movi_i64(cpu_mac, 0); - break; - - default: - gen_illegal_exception(dc); - break; - } +static bool trans_l_macrc(DisasContext *dc, arg_l_macrc *a, uint32_t insn) +{ + LOG_DIS("l.macrc r%d\n", a->d); + check_r0_write(a->d); + tcg_gen_trunc_i64_tl(cpu_R[a->d], cpu_mac); + tcg_gen_movi_i64(cpu_mac, 0); + return true; } =20 static void dec_comp(DisasContext *dc, uint32_t insn) @@ -1480,10 +1469,6 @@ static void disas_openrisc_insn(DisasContext *dc, Op= enRISCCPU *cpu) =20 op0 =3D extract32(insn, 26, 6); switch (op0) { - case 0x06: - dec_M(dc, insn); - break; - case 0x2f: dec_compi(dc, insn); break; diff --git a/target/openrisc/insns.decode b/target/openrisc/insns.decode index fb8ba5812a..84f71c13b3 100644 --- a/target/openrisc/insns.decode +++ b/target/openrisc/insns.decode @@ -95,6 +95,9 @@ l_mtspr 110000 ..... a:5 b:5 ........... k= =3D%mtspr_k =20 l_maci 010011 ----- a:5 i:s16 =20 +l_movhi 000110 d:5 ----0 k:16 +l_macrc 000110 d:5 ----1 00000000 00000000 + #### # Arithmetic Instructions #### --=20 2.17.0