From patchwork Fri May 4 05:40:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 134931 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp423910lji; Thu, 3 May 2018 22:44:02 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpsDPM6vsinD3ysEIqKefsjNE9OmKEx9pUOpJ81d4mqqb92MShi720D0fdhXBFc1Nk+hvux X-Received: by 2002:a0c:8a85:: with SMTP id 5-v6mr16870949qvv.208.1525412642294; Thu, 03 May 2018 22:44:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525412642; cv=none; d=google.com; s=arc-20160816; b=0gWZyvaXKKqoDI65VL2lLvuhTdUT00rrB86S4SNDqYTlE/ir2fTVycdAR8RsgjipW+ LAaKlpyk0nmLzPmePM1KghkbRJKveX32/gCNaDHkXKDPYVFbIRClWC4Juqu+3qR+t3LJ kWgYKmJR64ALF0V77kC5Ye88lOnPEIDUF8XnnRo2/AyJowON2JAcxf0cnwVXjLG/nvWP ew5pnX4KyeYMc7sxkEDYe6fgcU4Oa6kG1SnfozY4Oulv9haMIWhTOwDxBj9/LC7IrWE5 0zcubJLmHR/hOIa/YKRtzeBmaistZ2pbUG2+kvjikm7WSySsGRjQwNFuTlXkPFFGYdYX bF9A== 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=XRogM6VrBr6vZbFtZIpzqbkrMGDk1OCH6oJJvTnUa1M=; b=QhGYVcNJ3S+VB/3AZrnIabTIGgdA7dJzgpKNxN7Otp5b7Tvzm82XSHeepQyge9ybpz hH4L0UVvsipJ4zt5z1uGrAXKdQY/ItCECFr7zGxS7gjdCBXwQ8fGTpkGt4vm1HiHZDl4 wTQKGRWhz/+GT/QHrh5TxbpAUFYSYn5rHqvEwp6zY9qlcMDfjqf+WdWly+nxv2JXHjvU E9o+OmRH54qX7/HUPOsvqu/gzK6+JQrC7WAcFB5cJeZEDk1I6am6QwvMRgvTZl6vFST5 AOoixyLAgjMLqyWt07J3qSth2DMczjczdJ/gLpAVYQ/VLKXQO2AZ84tIcbRbBiVDnsK+ m/4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=BIPrB6WV; 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 n14-v6si2556786qvi.151.2018.05.03.22.44.02 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 03 May 2018 22:44:02 -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=BIPrB6WV; 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]:60557 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fETVh-0002O9-O9 for patch@linaro.org; Fri, 04 May 2018 01:44:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38401) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fETSY-0008Vn-Jd for qemu-devel@nongnu.org; Fri, 04 May 2018 01:40:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fETSV-0004nw-HJ for qemu-devel@nongnu.org; Fri, 04 May 2018 01:40:46 -0400 Received: from mail-pg0-x241.google.com ([2607:f8b0:400e:c05::241]:39186) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fETSV-0004nI-Cd for qemu-devel@nongnu.org; Fri, 04 May 2018 01:40:43 -0400 Received: by mail-pg0-x241.google.com with SMTP id e1-v6so3378237pga.6 for ; Thu, 03 May 2018 22:40:43 -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=XRogM6VrBr6vZbFtZIpzqbkrMGDk1OCH6oJJvTnUa1M=; b=BIPrB6WVUJaGjsVwVglNIF0DzHjMo77YTHO03YP3ax/edbSlJqUsSVc34Hw18SLXnK NMh+0wp7bMFYkVDmzEQInZmJ2yg3EiE6ZpM438i9W2MNGggzQYnwB/ChNYl4RHTBnq/j UuRPOQoB2oBpWPacMp4yOv2VCeIDgtO12fQC0= 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=XRogM6VrBr6vZbFtZIpzqbkrMGDk1OCH6oJJvTnUa1M=; b=I9+WBIZIQc8h5AZhxjppbXANohkvTJBEqbuCwyKVM9GNp9OUNjGcuTj8VU3BDuO0ax G1uTzvbJnrCfyaUG4yZCptA783rBP6VUPVaZUnEh2qqGzQ5fvodp7pkL/d/16P5BPcml CvjTrqzKE7OTeeelS4eIF49dXbdrS0ok/4kWsRZTsCLdN1+pPnExC3A1LV+tEMmXbJZZ Hl8iBRaqXqVS7KARob60ZdYzj16cEnqUnXRGOgGhQz8QfKxJtXutgTlRuSQfcWgMGWJ4 MWeslrQGuCA0tXkwcTFcTMLrVE93DgNIpkw6eAGOz9+rWjWClHHmiB+GUldt3fdg7qzy DIiA== X-Gm-Message-State: ALQs6tBTlSRicaniua86VZM7oY4YJXfezfRRSBpY4hioNIiox3KMk+HV 5OGxkM+J2qliW5CFwb7WMMWK5oerEhc= X-Received: by 2002:a17:902:bb84:: with SMTP id m4-v6mr26380286pls.339.1525412442060; Thu, 03 May 2018 22:40:42 -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 t23-v6sm26550809pgu.41.2018.05.03.22.40.40 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 May 2018 22:40:41 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 3 May 2018 22:40:24 -0700 Message-Id: <20180504054030.24527-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180504054030.24527-1-richard.henderson@linaro.org> References: <20180504054030.24527-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:c05::241 Subject: [Qemu-devel] [PATCH 07/13] target/openrisc: Convert dec_mac 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: Stafford Horne Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- target/openrisc/translate.c | 55 ++++++++++++++++++-------------------------- target/openrisc/insns.decode | 5 ++++ 2 files changed, 27 insertions(+), 33 deletions(-) -- 2.14.3 Acked-by: Stafford Horne diff --git a/target/openrisc/translate.c b/target/openrisc/translate.c index 90520b0805..8ca01e1a33 100644 --- a/target/openrisc/translate.c +++ b/target/openrisc/translate.c @@ -971,39 +971,32 @@ static bool trans_l_mtspr(DisasContext *dc, arg_l_mtspr *a, uint32_t insn) return true; } -static void dec_mac(DisasContext *dc, uint32_t insn) +static bool trans_l_mac(DisasContext *dc, arg_ab *a, uint32_t insn) { - uint32_t op0; - uint32_t ra, rb; - op0 = extract32(insn, 0, 4); - ra = extract32(insn, 16, 5); - rb = extract32(insn, 11, 5); + LOG_DIS("l.mac r%d, r%d\n", a->a, a->b); + gen_mac(dc, cpu_R[a->a], cpu_R[a->b]); + return true; +} - switch (op0) { - case 0x0001: /* l.mac */ - LOG_DIS("l.mac r%d, r%d\n", ra, rb); - gen_mac(dc, cpu_R[ra], cpu_R[rb]); - break; +static bool trans_l_msb(DisasContext *dc, arg_ab *a, uint32_t insn) +{ + LOG_DIS("l.msb r%d, r%d\n", a->a, a->b); + gen_msb(dc, cpu_R[a->a], cpu_R[a->b]); + return true; +} - case 0x0002: /* l.msb */ - LOG_DIS("l.msb r%d, r%d\n", ra, rb); - gen_msb(dc, cpu_R[ra], cpu_R[rb]); - break; +static bool trans_l_macu(DisasContext *dc, arg_ab *a, uint32_t insn) +{ + LOG_DIS("l.mac r%d, r%d\n", a->a, a->b); + gen_macu(dc, cpu_R[a->a], cpu_R[a->b]); + return true; +} - case 0x0003: /* l.macu */ - LOG_DIS("l.macu r%d, r%d\n", ra, rb); - gen_macu(dc, cpu_R[ra], cpu_R[rb]); - break; - - case 0x0004: /* l.msbu */ - LOG_DIS("l.msbu r%d, r%d\n", ra, rb); - gen_msbu(dc, cpu_R[ra], cpu_R[rb]); - break; - - default: - gen_illegal_exception(dc); - break; - } +static bool trans_l_msbu(DisasContext *dc, arg_ab *a, uint32_t insn) +{ + LOG_DIS("l.msb r%d, r%d\n", a->a, a->b); + gen_msbu(dc, cpu_R[a->a], cpu_R[a->b]); + return true; } static void dec_logic(DisasContext *dc, uint32_t insn) @@ -1506,10 +1499,6 @@ static void disas_openrisc_insn(DisasContext *dc, OpenRISCCPU *cpu) dec_compi(dc, insn); break; - case 0x31: - dec_mac(dc, insn); - break; - case 0x32: dec_float(dc, insn); break; diff --git a/target/openrisc/insns.decode b/target/openrisc/insns.decode index 20f035f488..7240c6fb77 100644 --- a/target/openrisc/insns.decode +++ b/target/openrisc/insns.decode @@ -125,3 +125,8 @@ l_divu 111000 d:5 a:5 b:5 - 11 ---- 1010 l_muld 111000 ----- a:5 b:5 - 11 ---- 0111 l_muldu 111000 ----- a:5 b:5 - 11 ---- 1100 + +l_mac 110001 ----- a:5 b:5 ------- 0001 +l_macu 110001 ----- a:5 b:5 ------- 0011 +l_msb 110001 ----- a:5 b:5 ------- 0010 +l_msbu 110001 ----- a:5 b:5 ------- 0100