From patchwork Mon May 14 22:27:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 135797 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp217108lji; Mon, 14 May 2018 15:53:57 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpb4ZSgtMpSC0+4om6xsBUyF+LGuUZ0ng9L4N4KYcLX/o8UaXaP29eSFGIESuljhlu3Z2H/ X-Received: by 2002:a0c:b59b:: with SMTP id g27-v6mr10841496qve.126.1526338437821; Mon, 14 May 2018 15:53:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526338437; cv=none; d=google.com; s=arc-20160816; b=FAfRLmFRE3XwsXVIwF48aM/57nPmdat/kusGVlchF6IWeM2eDFdsvDJNsZRlKsCnrr PerFtoy0KGgES6owdLB/OOyOz11IxrtKtwVcX4Eqet/a9GYg7xyllklZBBVv2ybIADxa I464XyA8czOy7XSxUiEbViPiTTGfCEuN1GCAk643gvsicxgK8k94J25C2o2cUXxoa0cK me2pOVeBRGj5lF6Gls8cMJ54eJfXQtzKl7xV1AQkVNFghB8FtVLCs8mGRi/fvJayuTqI JDNtKRPimxC1CEy7zXkJtbxG/7mhrV4+T5ILPJsVTea5BW1B6sK67QAK64jwxCDGTy9B ycTQ== 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=5IvOHkMmZovRqvgS1ERm+08uE8JgwzdCeJrMoKwphlQ=; b=H+RWF/sW4cS56v2l2mcrw79d49rL/a7hM9zFtBJSzULs9eEuaiQKUF0VFp2dLravH6 bt/TBzZo4Hh36u8dJ2NLZbrDeQ0eyWE6IO6CJXS0FFfbNON/v+UmrpTR4dVyoVnBLWt5 DDEmvQj4Nl3cIMEYp2xrDgruNGEO4YSRRVeP7T3eU3iJF07igIIYIdreThJeTb6OPgGb ueC94Dwkte0Tgf0vYVW+ZnHlmpAXRXgnYe8liTHCf0mF1MFsvvoIZFp/dE8JSWdBGg5p LIrSxDnTmZ9zoA0df9zASX64g8b2YLZZjZctJPXiVYFlBAwJLKG2QqS/tnjUYAdRQ8Il 34UA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=B5D8cZZ0; 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 r62-v6si3431726qkc.72.2018.05.14.15.53.57 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 14 May 2018 15:53:57 -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=B5D8cZZ0; 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]:51789 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fIMLt-0008Pg-9m for patch@linaro.org; Mon, 14 May 2018 18:53:57 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55402) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fILwH-0004BF-RE for qemu-devel@nongnu.org; Mon, 14 May 2018 18:27:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fILwG-0008Pc-M3 for qemu-devel@nongnu.org; Mon, 14 May 2018 18:27:29 -0400 Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]:37482) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fILwG-0008OW-Gy for qemu-devel@nongnu.org; Mon, 14 May 2018 18:27:28 -0400 Received: by mail-pf0-x244.google.com with SMTP id e9-v6so6683427pfi.4 for ; 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=5IvOHkMmZovRqvgS1ERm+08uE8JgwzdCeJrMoKwphlQ=; b=B5D8cZZ0vZV8EAG9gNSEKM43pxRN9Jc0sVCHu1YYwJgnM3aMgcMOf9iosv6QJIVo60 41XrvMGuJOMxmnMWolKu0cZGhORMuZQ/ho8NctqA1dHhIuSB8lSBQ80/KohygFfwH58B nNM8t6jcH3j9R6qtatGOQUkAQk/xoEhir2SPs= 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=5IvOHkMmZovRqvgS1ERm+08uE8JgwzdCeJrMoKwphlQ=; b=M276RBMYJFNhfv+WxfQpU+pe4finB5c5FFcYIXIub5V8W22tA9U3GC/Wa27msZHsM2 m4BrKvY4H5fbGqDvdGMZZV4/gH+hDXYnv5bqiP2PCyMo+5A4Hq1v/RvqvF/GOOuVFTDX HJHJFbF2hO11jP12AZGa3eQ9HiqmFgeOQ73MmYpIlDypBKnQ6dFy0x7b0QkLwP/pt7Fv NFNkTIkNoeLjy4ib1EnULzNGWdAGhBSUJax6D/NhmVN/Gg6n9FRy8pjNp8Viwh1ZZ4tN WnDybCEMV3EaKJyEJs897a3aM5MZfDgRMOpQcXUg4AvZAKL3ACr5RkS7YffmBL6+22Xz a+eQ== X-Gm-Message-State: ALKqPwctOJ09UQYRWIjXVDAT0iWHO/4UHtCbDy/wV6sC/tqKjDuKX+SJ kN99OEOCjUOZyAaiYZIShH434t+gAdY= X-Received: by 2002:a63:b306:: with SMTP id i6-v6mr9814360pgf.434.1526336847271; Mon, 14 May 2018 15:27:27 -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.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 14 May 2018 15:27:26 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 14 May 2018 15:27:08 -0700 Message-Id: <20180514222714.7982-8-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::244 Subject: [Qemu-devel] [PULL 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: 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 | 55 +++++++++++++++--------------------- target/openrisc/insns.decode | 5 ++++ 2 files changed, 27 insertions(+), 33 deletions(-) -- 2.17.0 diff --git a/target/openrisc/translate.c b/target/openrisc/translate.c index 755f43535e..48e26c4349 100644 --- a/target/openrisc/translate.c +++ b/target/openrisc/translate.c @@ -970,39 +970,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) @@ -1505,10 +1498,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