From patchwork Mon May 14 22:27:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 135800 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp219548lji; Mon, 14 May 2018 15:57:35 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrt23xZRQyvAiS1G9AlGDdmU3+TqOkzuVeHmMOUc7XyhW0Pb97wtyH3em1KkTeVPoPmaOwD X-Received: by 2002:ac8:2653:: with SMTP id v19-v6mr10919726qtv.126.1526338654954; Mon, 14 May 2018 15:57:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526338654; cv=none; d=google.com; s=arc-20160816; b=SF1sFOFndN0P1BvObkfHLix/ozMKVjX7A47YGjmXgFqiugw5rg4XhZivrZvDoJ2IEE 23Fy+MYdNrpczc03rwx85G+r0DRAG9GFi0IN33plCpflER3aKKkJtH7WVArjwjxMq9ze D3vf35bj0yCgB1ThB1ajrUVOgpKs21xBwnFpPhim9yf5XuvtvdXcWochGttCQguXm+ih gUSCrSDOvi/0pmqMC9F9jMGIkPdvhq1r6LuAN/8UnwHIg6D0eDj/IEV4xIvW3Ec+Nnhk VBh+/goKC2sDsjkdflemIXchwV1foGUpWLK7QJWUx2F8kZLyGlUvsSXwxVXhkr0wjiCc Db2A== 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=YbsooNRD0HeVYowrjZbcyIiuM6dV6S8PgoUh0Ef+ks0=; b=Yza+LUpK2YQc4qFE3iYTwN2CuCBb3DqnbvHH198jtgi7Ehjk8wbLEdW9VOczRg2sMg 7qpWSyfN2O5FQKkgtSS1/AVrx4JehZB77H6Gf7V96GREILyFqqbhJWtdoQOLMucEjZuH 2Vr+0BJWrOwFPQTsgs8Cu0mAbMDdyN8rcNjrWradNvn6zNBJoJTTY3n+I0W+dIAuPP2U zbPX/OgjdCyd2/xUwXgbX6DDF/wr+THA8Z7shJ9ZMpIO2OGHNzb+wqmTs5pPMx24p5Sd HPV9Q368tlvv21UC5Wufio9cDj36LvJLoW5MwPUqp9rb/9y6KiSNCM7Qo3wXJ0R/uQDI jXww== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ARddt6LF; 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 l184-v6si3553893qkd.287.2018.05.14.15.57.34 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 14 May 2018 15:57:34 -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=ARddt6LF; 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]:51922 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fIMPO-0001z3-GF for patch@linaro.org; Mon, 14 May 2018 18:57:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55474) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fILwN-0004Hp-Kf for qemu-devel@nongnu.org; Mon, 14 May 2018 18:27:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fILwM-000068-AV for qemu-devel@nongnu.org; Mon, 14 May 2018 18:27:35 -0400 Received: from mail-pg0-x242.google.com ([2607:f8b0:400e:c05::242]:43200) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fILwM-00004x-1r for qemu-devel@nongnu.org; Mon, 14 May 2018 18:27:34 -0400 Received: by mail-pg0-x242.google.com with SMTP id p8-v6so2551999pgq.10 for ; Mon, 14 May 2018 15:27:33 -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=YbsooNRD0HeVYowrjZbcyIiuM6dV6S8PgoUh0Ef+ks0=; b=ARddt6LFzkGOZta1Ja2SfHg48aGbbGhywKNpYJC2LE71BuhRUCPfymSHv2atSpu0Ih HqzzotwVAT3P65U3iI2/9i7IdsFa7Qc1hdjPRH4NsB13tHvWJwoK0nu4dW+STAa5T7pT DiwOtLIL0Y4ss59h6YJORLgH165lmYU6bvj0g= 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=YbsooNRD0HeVYowrjZbcyIiuM6dV6S8PgoUh0Ef+ks0=; b=erzBGyLtQ1Qyy85VjKSdbIX+6+7vuAVQznq5DKikgd79IPSX0j8kVWCvjZ8xHj/Rbw ejA6fzm2r3lN0f2JxwjOzGNWwgKsNSw1PzRkKgtT7ml2VnpPavIhCUjavrh5u+tSDUdj c4D0BgWkhz5wbUo/bSP6kOo3XuO7Ip3PbDnserhn8kTcVsfNm+VqHXFL4bBese8LU+PK Pr2DJVBvyCc1URPFC3o5TqRxPEXdheWgzeLZvXLPwO1FI5bDyZoYMa4RmT3KG0cPIeqz gMqFAdsTtkjsa9W3uUQUcFam+PvG9kg5suT8FccWQBocUuMscrPjrS06ysCq1W8ehfGR S4GA== X-Gm-Message-State: ALKqPweGH3YNxzenEqfnWi0iWCg3fUFvHHtEAVnOeVZrk1QmQdUBZdt+ Mg86cGHypttXTbdlJMSGPAlgUdvJubo= X-Received: by 2002:a65:5308:: with SMTP id m8-v6mr8738281pgq.42.1526336852742; Mon, 14 May 2018 15:27:32 -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.31 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 14 May 2018 15:27:31 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 14 May 2018 15:27:12 -0700 Message-Id: <20180514222714.7982-12-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:c05::242 Subject: [Qemu-devel] [PULL 11/13] target/openrisc: Convert dec_compi 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 | 116 +++++++++++++++++------------------ target/openrisc/insns.decode | 12 ++++ 2 files changed, 70 insertions(+), 58 deletions(-) -- 2.17.0 diff --git a/target/openrisc/translate.c b/target/openrisc/translate.c index 8743b5e96e..c4256518cb 100644 --- a/target/openrisc/translate.c +++ b/target/openrisc/translate.c @@ -1117,70 +1117,74 @@ static bool trans_l_sfles(DisasContext *dc, arg_ab *a, TCGCond cond) return true; } -static void dec_compi(DisasContext *dc, uint32_t insn) +static bool trans_l_sfeqi(DisasContext *dc, arg_ai *a, TCGCond cond) { - uint32_t op0, ra; - int32_t I16; + LOG_DIS("l.sfeqi r%d, %d\n", a->a, a->i); + tcg_gen_setcondi_tl(TCG_COND_EQ, cpu_sr_f, cpu_R[a->a], a->i); + return true; +} - op0 = extract32(insn, 21, 5); - ra = extract32(insn, 16, 5); - I16 = sextract32(insn, 0, 16); +static bool trans_l_sfnei(DisasContext *dc, arg_ai *a, TCGCond cond) +{ + LOG_DIS("l.sfnei r%d, %d\n", a->a, a->i); + tcg_gen_setcondi_tl(TCG_COND_NE, cpu_sr_f, cpu_R[a->a], a->i); + return true; +} - switch (op0) { - case 0x0: /* l.sfeqi */ - LOG_DIS("l.sfeqi r%d, %d\n", ra, I16); - tcg_gen_setcondi_tl(TCG_COND_EQ, cpu_sr_f, cpu_R[ra], I16); - break; +static bool trans_l_sfgtui(DisasContext *dc, arg_ai *a, TCGCond cond) +{ + LOG_DIS("l.sfgtui r%d, %d\n", a->a, a->i); + tcg_gen_setcondi_tl(TCG_COND_GTU, cpu_sr_f, cpu_R[a->a], a->i); + return true; +} - case 0x1: /* l.sfnei */ - LOG_DIS("l.sfnei r%d, %d\n", ra, I16); - tcg_gen_setcondi_tl(TCG_COND_NE, cpu_sr_f, cpu_R[ra], I16); - break; +static bool trans_l_sfgeui(DisasContext *dc, arg_ai *a, TCGCond cond) +{ + LOG_DIS("l.sfgeui r%d, %d\n", a->a, a->i); + tcg_gen_setcondi_tl(TCG_COND_GEU, cpu_sr_f, cpu_R[a->a], a->i); + return true; +} - case 0x2: /* l.sfgtui */ - LOG_DIS("l.sfgtui r%d, %d\n", ra, I16); - tcg_gen_setcondi_tl(TCG_COND_GTU, cpu_sr_f, cpu_R[ra], I16); - break; +static bool trans_l_sfltui(DisasContext *dc, arg_ai *a, TCGCond cond) +{ + LOG_DIS("l.sfltui r%d, %d\n", a->a, a->i); + tcg_gen_setcondi_tl(TCG_COND_LTU, cpu_sr_f, cpu_R[a->a], a->i); + return true; +} - case 0x3: /* l.sfgeui */ - LOG_DIS("l.sfgeui r%d, %d\n", ra, I16); - tcg_gen_setcondi_tl(TCG_COND_GEU, cpu_sr_f, cpu_R[ra], I16); - break; +static bool trans_l_sfleui(DisasContext *dc, arg_ai *a, TCGCond cond) +{ + LOG_DIS("l.sfleui r%d, %d\n", a->a, a->i); + tcg_gen_setcondi_tl(TCG_COND_LEU, cpu_sr_f, cpu_R[a->a], a->i); + return true; +} - case 0x4: /* l.sfltui */ - LOG_DIS("l.sfltui r%d, %d\n", ra, I16); - tcg_gen_setcondi_tl(TCG_COND_LTU, cpu_sr_f, cpu_R[ra], I16); - break; +static bool trans_l_sfgtsi(DisasContext *dc, arg_ai *a, TCGCond cond) +{ + LOG_DIS("l.sfgtsi r%d, %d\n", a->a, a->i); + tcg_gen_setcondi_tl(TCG_COND_GT, cpu_sr_f, cpu_R[a->a], a->i); + return true; +} - case 0x5: /* l.sfleui */ - LOG_DIS("l.sfleui r%d, %d\n", ra, I16); - tcg_gen_setcondi_tl(TCG_COND_LEU, cpu_sr_f, cpu_R[ra], I16); - break; +static bool trans_l_sfgesi(DisasContext *dc, arg_ai *a, TCGCond cond) +{ + LOG_DIS("l.sfgesi r%d, %d\n", a->a, a->i); + tcg_gen_setcondi_tl(TCG_COND_GE, cpu_sr_f, cpu_R[a->a], a->i); + return true; +} - case 0xa: /* l.sfgtsi */ - LOG_DIS("l.sfgtsi r%d, %d\n", ra, I16); - tcg_gen_setcondi_tl(TCG_COND_GT, cpu_sr_f, cpu_R[ra], I16); - break; +static bool trans_l_sfltsi(DisasContext *dc, arg_ai *a, TCGCond cond) +{ + LOG_DIS("l.sfltsi r%d, %d\n", a->a, a->i); + tcg_gen_setcondi_tl(TCG_COND_LT, cpu_sr_f, cpu_R[a->a], a->i); + return true; +} - case 0xb: /* l.sfgesi */ - LOG_DIS("l.sfgesi r%d, %d\n", ra, I16); - tcg_gen_setcondi_tl(TCG_COND_GE, cpu_sr_f, cpu_R[ra], I16); - break; - - case 0xc: /* l.sfltsi */ - LOG_DIS("l.sfltsi r%d, %d\n", ra, I16); - tcg_gen_setcondi_tl(TCG_COND_LT, cpu_sr_f, cpu_R[ra], I16); - break; - - case 0xd: /* l.sflesi */ - LOG_DIS("l.sflesi r%d, %d\n", ra, I16); - tcg_gen_setcondi_tl(TCG_COND_LE, cpu_sr_f, cpu_R[ra], I16); - break; - - default: - gen_illegal_exception(dc); - break; - } +static bool trans_l_sflesi(DisasContext *dc, arg_ai *a, TCGCond cond) +{ + LOG_DIS("l.sflesi r%d, %d\n", a->a, a->i); + tcg_gen_setcondi_tl(TCG_COND_LE, cpu_sr_f, cpu_R[a->a], a->i); + return true; } static bool trans_l_sys(DisasContext *dc, arg_l_sys *a, uint32_t insn) @@ -1469,10 +1473,6 @@ static void disas_openrisc_insn(DisasContext *dc, OpenRISCCPU *cpu) op0 = extract32(insn, 26, 6); switch (op0) { - case 0x2f: - dec_compi(dc, insn); - break; - case 0x32: dec_float(dc, insn); break; diff --git a/target/openrisc/insns.decode b/target/openrisc/insns.decode index 29d28ff5be..4ec0e2de3a 100644 --- a/target/openrisc/insns.decode +++ b/target/openrisc/insns.decode @@ -21,6 +21,7 @@ &da d a &ab a b &dal d a l +&ai a i #### # System Instructions @@ -154,3 +155,14 @@ l_sfgts 111001 01010 a:5 b:5 ----------- l_sfges 111001 01011 a:5 b:5 ----------- l_sflts 111001 01100 a:5 b:5 ----------- l_sfles 111001 01101 a:5 b:5 ----------- + +l_sfeqi 101111 00000 a:5 i:s16 +l_sfnei 101111 00001 a:5 i:s16 +l_sfgtui 101111 00010 a:5 i:s16 +l_sfgeui 101111 00011 a:5 i:s16 +l_sfltui 101111 00100 a:5 i:s16 +l_sfleui 101111 00101 a:5 i:s16 +l_sfgtsi 101111 01010 a:5 i:s16 +l_sfgesi 101111 01011 a:5 i:s16 +l_sfltsi 101111 01100 a:5 i:s16 +l_sflesi 101111 01101 a:5 i:s16