From patchwork Fri May 11 04:23:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 135494 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp394058lji; Thu, 10 May 2018 21:29:25 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoZzOMTn64RAiO+1Je8gCFizp4rIih6zbm3q4k9ee1SnEVqYKgsO7qkZDbX6nvRfnKYZ+oi X-Received: by 2002:a0c:e78a:: with SMTP id x10-v6mr3786097qvn.13.1526012965816; Thu, 10 May 2018 21:29:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526012965; cv=none; d=google.com; s=arc-20160816; b=xvJ54Oimo8Re5N2WTMBWB1JjPcupBIlkr3YkqaXczwzLP6JPqcgbKrVlbPzCZeruBo XyvJ6pfX4208eGUhnk/z+WsOozzQ8MIKAoQbHV7FFZFojErFeUehAn+lN0g58ZCEhUNM utp/Glz2XGKt2MXhcK2om6E71nI4PCKBLKF2icOy82WqWnbXRVuPed50m/YGxz4jQDX3 TWdZXwueofTQpSOMXemo16J3H2hVsBDzRTye/QZ/atpjL71rbgdbjHJeM1+nAYlrbxjE f31dCw1mJVT4Oty8lDQ8vlDT/AqozTmWB3Ay7Ek58PeRYCYF6TOOlxIdXSRL/Vj5J/r9 Fk8g== 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=Z+5TIFy3I+D/WDAlD3QSum7pBMO7Xmvbj4B3x10drQ0=; b=ohFrCH19IA+6pCD3XU2Bppr0Jb7jgsQzVq8zhcfoZRUlu1WGE4Ux71MBO2c91NKj34 NgLVio3W0GApLeCQoLLwVLmx2OFeRYjvJIYawnA+oa44eMs/R9RbSzOoAkWFS5KmPgjH usD7SSs3lyGT7WY0AVYecAqTRw8yCTHNqei/vPvPju2QwaepooIA/wZ4siEoM9pOV12h 2Ls7oRGGVBUphc6wzTunaF4VxCVrz9PE+XLV80YSLEXgbwglWR4Atmrosz+Yb/nxR2ZY 3CArglaPRjYSPXktzL5f007k6pl+WBzsBzohcW00kqT4g+Xi4uOmKGzUVOp3jcfHVdUE gjww== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=c08dDJHW; 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 r41-v6si2381570qtc.165.2018.05.10.21.29.25 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 10 May 2018 21:29:25 -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=c08dDJHW; 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]:36698 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fGzgL-0007fV-4T for patch@linaro.org; Fri, 11 May 2018 00:29:25 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55642) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fGzam-0000dC-Dv for qemu-devel@nongnu.org; Fri, 11 May 2018 00:23:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fGzak-00087q-Ii for qemu-devel@nongnu.org; Fri, 11 May 2018 00:23:40 -0400 Received: from mail-pl0-x242.google.com ([2607:f8b0:400e:c01::242]:42026) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fGzak-00087g-DH for qemu-devel@nongnu.org; Fri, 11 May 2018 00:23:38 -0400 Received: by mail-pl0-x242.google.com with SMTP id u6-v6so2541660pls.9 for ; Thu, 10 May 2018 21:23:38 -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=Z+5TIFy3I+D/WDAlD3QSum7pBMO7Xmvbj4B3x10drQ0=; b=c08dDJHWFF4/EGEiuYX5DHhH9KND3DaG9RX0gjvA3d1bBKIrquhzrI1GJSNE2EWEJu 6Wk9ogGmppHSOGGEMrXDTDbSYi5U1sSCqWGT0Nf5gPwhN5F0GvEQcuFPxA1gMA/DU0ul RRBKSs6PRL/INmtw5iBfEOC0Jpc2NO1500skU= 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=Z+5TIFy3I+D/WDAlD3QSum7pBMO7Xmvbj4B3x10drQ0=; b=iFmzNEfgg2h/vbTtmOS2hJlbtEE0AKFHwHZcZps7g6X7cD+bxyXMDHS4qkE3SvtKj+ keICzyu3xVxvnD1ZtY8dolIZ5ktMcfoIC+yYj262rxsOCDUzBqzAugyuADa6Rcbx12x/ Pe0GSQvTShlX6I2E2riNARC0TXC5BG7bERDJAIIuN3bHscr1WdG1hntWhbCq3SzuYUMS OoDvt6DI+SjkSGKlfIu1TaQuHDfzAzsMzMmM9y8ANyU1Fqcp6ypTtCxgI6ugMQTcYKMP wgjefRU/IzwEJtY7UVoCII/9TjI+IhI5xrFWRgm+09nIcLA+jEMtXb4beb5GMFf8Od9O Jvkg== X-Gm-Message-State: ALKqPwcS7uUb/wqVQLFeNBFUa9c8jkt9PtlMcfKW1NFgg++QMvHYY5YU oB3PkV5qVBwuitYTfrT4EF0H0XK6MPY= X-Received: by 2002:a17:902:b582:: with SMTP id a2-v6mr3905649pls.371.1526012617125; Thu, 10 May 2018 21:23:37 -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.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 10 May 2018 21:23:35 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 10 May 2018 21:23:18 -0700 Message-Id: <20180511042324.5070-8-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 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 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