From patchwork Fri May 11 04:23:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 135496 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp394345lji; Thu, 10 May 2018 21:29:52 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq1JY/IWTqMcIUVi0WSuxQSBLB19CB9AM5WRBTjeBiWneQWSnC9FWLSNCFdPfhMxLaozKQb X-Received: by 2002:ac8:859:: with SMTP id x25-v6mr4159299qth.48.1526012992197; Thu, 10 May 2018 21:29:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526012992; cv=none; d=google.com; s=arc-20160816; b=YPOCj1HcAaFT85Sw1Skf+aecZXrYJ4WmChNoQVA/Eg2T/6sq1Z0Aqok5pfN9LCgNsC lDycp1RidEqMbAKUJaXD2YPg8fu4Fw6vn2s11b7XkQzaONv4DaGuzJaIYdp77r7+35FA ZtbKJtWqEqC9erEPmX+UsIRkstI7Rjsa9Yn5WAH5TLdNShK0jDaIF4M6b4+fyuLKG7aa rOCnwJfaX6mvKkqVjygMQ5yZRl6ecyCs4O6kP1v6oYDzohb2cJV0Q2wxJReAVRVZyaew uUWkmZHl/u96c2Q0870GeBXhCH3mwY0kdATlOkgHdRRaWuSjolIn92210rWFEKqeydza dNEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=1lY73R3Cbw8tBI+8Ovo7cwbtTAlyxzG/opbV7x2Z9IQ=; b=WLjOjayQinb855hOyk91uY7eazTsHFvEzPfqWE4HcLjR4rH5qqD3L6qgVITsmHkeyH y6hMgATMag61rUMo3HtJS3IfAgm+8RoCi+GlBk3Ofztb2liXI0zcJ0JoMeZm0wadoMOs N3LEQY1nD5Cq9R4VIxZPuu7C1r2E8LmkjnuA3+pBFUTIwJ/tdrfahhq6Bou3C01Z9MPL fV1gybl1RGBwZoyV5FhBQiUs0iutIVsa1jFIseucEbQQragMG2dCTEN/xGWzC4VExW6f DPJ37SruW1rinPoreh/nrJID0tBYOq66WpP7+nirMMEIwAeLd4jnPzV32X5e6bC0SFlx z16A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=DNuT+Sg8; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id t192-v6si2129420qke.194.2018.05.10.21.29.52 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 10 May 2018 21:29:52 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=DNuT+Sg8; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:36700 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fGzgl-0007uR-Kv for patch@linaro.org; Fri, 11 May 2018 00:29:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55669) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fGzao-0000f8-6z for qemu-devel@nongnu.org; Fri, 11 May 2018 00:23:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fGzan-00088o-CA for qemu-devel@nongnu.org; Fri, 11 May 2018 00:23:42 -0400 Received: from mail-pl0-x242.google.com ([2607:f8b0:400e:c01::242]:39792) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fGzan-00088U-7k for qemu-devel@nongnu.org; Fri, 11 May 2018 00:23:41 -0400 Received: by mail-pl0-x242.google.com with SMTP id c19-v6so2547390pls.6 for ; Thu, 10 May 2018 21:23:41 -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=1lY73R3Cbw8tBI+8Ovo7cwbtTAlyxzG/opbV7x2Z9IQ=; b=DNuT+Sg8e08A0mMTr7sAoDW4XbazuzLsnGpZonTAV7LdzrK/6YbrcP4ZeUaqkhxTNd FDerul/vt8oEb/O/B35iLs2F1FnKMqqxLLRx+IYIqecpa3kqCEZHcyqM5+9NEpTGDAgZ /GJRJzIGnK84uTKKRlyOXiygmwNXK2nUc/TKg= 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=1lY73R3Cbw8tBI+8Ovo7cwbtTAlyxzG/opbV7x2Z9IQ=; b=DppqnXsiuTiO2M5Jh8Am6dXNKSzXjIPqh7eOMUBX7gVIICyqaERNqS0kGXcIzerYkl iIjoVbBNx8+932C0XoAT6S0HyBI+505U0hy77yrShBeGzJpazC3eTGQq6vrnx//I1yFT mvPzbYKwojqkT+EbyM3vUL3WfnMkIVpznCJBhZTYbhtzWw/aILJn6zPd2wax9nnGVcL2 W/09ABWqmTxT3cXSobApSRrBY7VFRj/wMDlKiA3x5vEZ05JlBlHiJpFekc9GmO5IjZh/ 3Bl0KhQv4G+7SoP9VQq9We3n4MoJKnP8qgw+f9qq6ufLn7/k19HhRpFWmoIDx/wxKi68 ljMA== X-Gm-Message-State: ALKqPwfP8NjZ2YHHv7D2ipWaDVqkUJ29nTOUnI0X7iBQskCoPfMj2zkS Eg7hJVmUTEWfiLxYKIF6RWC5J9ywkMo= X-Received: by 2002:a17:902:4081:: with SMTP id c1-v6mr41963pld.60.1526012619987; Thu, 10 May 2018 21:23:39 -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 r76-v6sm4509462pfl.1.2018.05.10.21.23.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 10 May 2018 21:23:39 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 10 May 2018 21:23:20 -0700 Message-Id: <20180511042324.5070-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180511042324.5070-1-richard.henderson@linaro.org> References: <20180511042324.5070-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:c01::242 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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(-) -- 2.17.0 diff --git a/target/openrisc/translate.c b/target/openrisc/translate.c index f2f9a0c0d2..548e0230b3 100644 --- a/target/openrisc/translate.c +++ b/target/openrisc/translate.c @@ -1031,32 +1031,21 @@ static bool trans_l_rori(DisasContext *dc, arg_dal *a, uint32_t insn) return true; } -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 = extract32(insn, 16, 1); - rd = extract32(insn, 21, 5); - K16 = 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; +} - 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; } static void dec_comp(DisasContext *dc, uint32_t insn) @@ -1481,10 +1470,6 @@ static void disas_openrisc_insn(DisasContext *dc, OpenRISCCPU *cpu) op0 = 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=%mtspr_k l_maci 010011 ----- a:5 i:s16 +l_movhi 000110 d:5 ----0 k:16 +l_macrc 000110 d:5 ----1 00000000 00000000 + #### # Arithmetic Instructions ####