From patchwork Fri May 4 05:40:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 134937 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp429307lji; Thu, 3 May 2018 22:51:05 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpczSUrz7ooZO7LHbM4hVDytyb0hyw/NPR9y9Gycrgs5D8ja90ljV8z/PGnedq5tBduBjE6 X-Received: by 10.55.185.135 with SMTP id j129mr15694944qkf.25.1525413065489; Thu, 03 May 2018 22:51:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525413065; cv=none; d=google.com; s=arc-20160816; b=xhyrVM2A8Ijxqw8OuWmuznXHmd6/jNmSM3k1lkKfbnYATFc/q9SiyATBuEcBGYer6r 66Yss5rZ+kNPIJI3qMC69+DFfO74Q8BL0IDXXBXMqLBG5Kc65OogHieJIsk6Pn3QuI5T 6Op2WAF2gsf9NFZPE3/u2Q3q25710hjXH9QZJjNid6Jve/DlT1q3k/E7g8cDNbzBxLuH 6f/yM+dx7RPdrNqnxM60oL4Q/S6Ckn382XCQbbSDrUEXg85/rnWcOB8QpoWQvA1N+JNC tVHcH6KgGW4eb2onlpMiJZFfbObEPFvfCA2tSHOViRdxAHsiwGs1FaT9dPbAG3wrqRN4 ISCg== 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=FD7rWvsMQXq5LO9kdwmVjGKfPRcat9Tdv5zhQKCQ+O4=; b=jfOjBUo+2WR1N1468koIbo+MTyDTuXY70mqqwrTJLwy14F7GXhXUr/BmT+Wudhx9FA XWI9M4gKIhWOSB7j5hLozR54naeTvry90cAYgBdD8xrIiGu2mu3CLTnfFpg0lgDFfpL7 J1m33MCNvdddhKQWz+UBGao+b5njBNSlpz/xuH9AExRuR8sRN+8DXhJyZ9l8kZthOH+t KU2axKIlvoLtmVCW04IyhnN5FwqZI91BQahC9KJP2jRbUlKUfF864qph2fd28cPMBLIX KVT15a6sv473joLMGIr8e/XTMMcn2cT2GbnV+T/3OX//an1ObUcOJ1tXppwIg0X4u7Qo uUjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=OrlV7op9; 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 c40-v6si14709443qte.106.2018.05.03.22.51.05 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 03 May 2018 22:51:05 -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=OrlV7op9; 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]:60590 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fETcW-0007mA-Ud for patch@linaro.org; Fri, 04 May 2018 01:51:04 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38405) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fETSY-0008Vr-N3 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 1fETSX-0004qB-UK for qemu-devel@nongnu.org; Fri, 04 May 2018 01:40:46 -0400 Received: from mail-pg0-x243.google.com ([2607:f8b0:400e:c05::243]:36244) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fETSX-0004pi-ON for qemu-devel@nongnu.org; Fri, 04 May 2018 01:40:45 -0400 Received: by mail-pg0-x243.google.com with SMTP id z129-v6so10551202pgz.3 for ; Thu, 03 May 2018 22:40:45 -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=FD7rWvsMQXq5LO9kdwmVjGKfPRcat9Tdv5zhQKCQ+O4=; b=OrlV7op91eq3gKX89fdnPUj5iikrU6oOB3kidkYdB7Om/IYd+NtP8mMuD0/NxNgj8r dFPXyP7PCM1dakLdemg0M+Se2VP7O7FsxNkdRGibbmHxI0Q8ORzhydaeg1fAya43uXTp r31UM4RRKsvPKknkEiXTh8GZTzX71MwS99mWA= 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=FD7rWvsMQXq5LO9kdwmVjGKfPRcat9Tdv5zhQKCQ+O4=; b=cFkwUCMAMIFff/dIVgnOJZ/Fz8xKXEN99kc4UGF0z+s6+toQiewBYZ131GRTluRSU6 unWF6P+s7tYts/vLL/GX4tfGarYTQjrBLZzDvzn0i4dD1IKyB8LtmtqJm2EYlZ3mTBHW dC1sVVOFJx2GCazQWHJwApds0QO6aQ76wGzVq5J1JMz2HutOuUoLx/EH1V6XlOzAX1NM VGyBMs2tVSK09GkmvIbclhSBG0tmVHcMJ2rbxw17DiwKlbdkurYzyvCT6VvNDp1mNTqM hP1wgssonSrkq/yphml4WECfi+rMTLZWhgulBO3ZlB85RJ1DiLtgxKpsrtH+dEyGsJvK 4vpA== X-Gm-Message-State: ALQs6tAO5rIlIwKOakJpnnM4J3BOal0Qi7/dwzP2I3hlE5c9BW80cE6n J8b41renB01Ajilku70qLLkD0YCfEOY= X-Received: by 2002:a63:2a89:: with SMTP id q131-v6mr21162382pgq.379.1525412444514; Thu, 03 May 2018 22:40:44 -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.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 May 2018 22:40:43 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 3 May 2018 22:40:26 -0700 Message-Id: <20180504054030.24527-10-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::243 Subject: [Qemu-devel] [PATCH 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: Stafford Horne Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- target/openrisc/translate.c | 41 +++++++++++++---------------------------- target/openrisc/insns.decode | 3 +++ 2 files changed, 16 insertions(+), 28 deletions(-) -- 2.14.3 Acked-by: Stafford Horne 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 ####