Message ID | 20181225205529.10874-13-richard.henderson@linaro.org |
---|---|
State | Accepted |
Commit | 27fd64144bebc34a815fd8a69af790b080e80c61 |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp5212051ljp; Tue, 25 Dec 2018 13:02:36 -0800 (PST) X-Google-Smtp-Source: ALg8bN5Is5unZ/39KfFCvQkS0LzR1pDas4aX5OecRMQaEqaX9u9EMjxAxnRf4m/58TBSgcktl80i X-Received: by 2002:a0c:afd1:: with SMTP id t17mr16427729qvc.93.1545771756287; Tue, 25 Dec 2018 13:02:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545771756; cv=none; d=google.com; s=arc-20160816; b=WQdMKNqiObibK7z+cE1+gf070pyXycXObT600oalbOj3qmbWUSJ+qPeRmPGGpL31ew YYMdmmTM26rf6Dv1wV/jQLLMSxk3k2aU1FSYniQArXLu/TVfvS151tzvQ+ONm7aUSyAE nZ/q6FJUqS/IJK9NccsZY0D4TpKI3ahANgchc2S+rqdQ0WLh9xYEIyMbRHeYBQA9LhP1 d7gDeF1Wtm6mfjT8qT7eU6Uaj5wBAMgdxIOMjX6jOUAWaDJL09rT0j2LHjJ9Oi9kZ4VP b1u7qS28EOzZKApjEhVh3gVCcta673kJrq7LrbOE4eLp8DjGlEP9MC4AAA/A+cMrtYI8 XnMQ== 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; bh=nEHLvkQL2voFvXtpuzfSUHHAe4REKcd/a+fnRRehKaY=; b=UOBdHT6ZeOlTJEAzWf/h7MvHGfZkidFXYknNqJ/L3/3AXto73sLSmSJMf/gLWedXNS sAcIMHuPHOZN/I4glmW1A4qWIOzBXkW5iI/otng5sjMB7zt2eHaAT53zpqgR5c81AZeX UdDKRVwZn/STSQ98BtuLoRRGh53rNlN5oODuZNcbBmeB2BnD9S4x7pE+MMd2cIj92PDp vbfO5JLFyw0EjalU87qv/ZnqZZbf6oUKvUgtC7PUBkn0yFerFvGPdwIZQ/FWWahT79vC mSgeKicxhOPmTStKb5gGjyepkCGWehxUtJbL0EjMLKoH+zwKKn+tJ2Q+8t6qRqp0hHAG 9Bcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=W3fT+P2t; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 208.118.235.17 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: <qemu-devel-bounces+patch=linaro.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org. [208.118.235.17]) by mx.google.com with ESMTPS id m70si203315qkl.245.2018.12.25.13.02.36 for <patch@linaro.org> (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 25 Dec 2018 13:02:36 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=W3fT+P2t; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 208.118.235.17 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 ([127.0.0.1]:43064 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <qemu-devel-bounces+patch=linaro.org@nongnu.org>) id 1gbtqV-0002hW-LH for patch@linaro.org; Tue, 25 Dec 2018 16:02:35 -0500 Received: from eggs.gnu.org ([208.118.235.92]:49892) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <richard.henderson@linaro.org>) id 1gbtlL-00053N-Q3 for qemu-devel@nongnu.org; Tue, 25 Dec 2018 15:57:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <richard.henderson@linaro.org>) id 1gbtlI-0007iJ-Jj for qemu-devel@nongnu.org; Tue, 25 Dec 2018 15:57:15 -0500 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]:35860) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from <richard.henderson@linaro.org>) id 1gbtlI-0007hT-DK for qemu-devel@nongnu.org; Tue, 25 Dec 2018 15:57:12 -0500 Received: by mail-pf1-x42f.google.com with SMTP id b85so7082652pfc.3 for <qemu-devel@nongnu.org>; Tue, 25 Dec 2018 12:57:12 -0800 (PST) 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=nEHLvkQL2voFvXtpuzfSUHHAe4REKcd/a+fnRRehKaY=; b=W3fT+P2tDqkYvPCH29jLMoqilj42Ub2qleoj+jii+Rgmcee0s3MHsqYJZaQHJRACPF ArPVkV1qypZ31u7fFRVhRTeenaS87GOWtUsG3LDgNhLc5cRVDDT5uhGoNbmN0loIoRCF 7lhB4TDeFPw7uUp9HJ8QSzIaPAfFa7QOJS+ek= 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=nEHLvkQL2voFvXtpuzfSUHHAe4REKcd/a+fnRRehKaY=; b=NRWpZJJRlTWxzBqQpl7mVZoe3Q+gUvmjlLOKPPAEQdJqD8Sz/9KoFzdSMU1vNOosvx Sm6srZetDTZDUewcOLtVCg3RAt+JVM+pADumNltczwdG6aA2Romh5DsORntrye5ST9yG sfcCvrW7ZBlviLAdUIyjRfBa6twa9Jg4BrIAwR9ma5IPkxmqzJKxthPmGbRs2whhr5XN GVoH3cbriohx+ZD8+ORRzd2SL2P06COm90W+ZjTSM5gDl5Nce3eL7K3m7mU+0+01ciTo /0G/FazMIDoDW+dGigfO2bvj7wu3vdWYvAYhQcDT0Nm+WFLrm335Ybr4tRbg4yK5GRzR d4vw== X-Gm-Message-State: AJcUukdhVwBktWG4dnftzo8kERgW2LawqAxykWOXFwjrAjmCyNWtQaP3 g/QmuvLQCuU5S755o6Ls0xCyloNPHIs= X-Received: by 2002:a63:104d:: with SMTP id 13mr16698860pgq.303.1545771431117; Tue, 25 Dec 2018 12:57:11 -0800 (PST) Received: from cloudburst.home (c211-28-135-144.sunsh3.vic.optusnet.com.au. [211.28.135.144]) by smtp.gmail.com with ESMTPSA id t21sm48501628pgg.24.2018.12.25.12.57.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 25 Dec 2018 12:57:10 -0800 (PST) From: Richard Henderson <richard.henderson@linaro.org> To: qemu-devel@nongnu.org Date: Wed, 26 Dec 2018 07:54:59 +1100 Message-Id: <20181225205529.10874-13-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181225205529.10874-1-richard.henderson@linaro.org> References: <20181225205529.10874-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::42f Subject: [Qemu-devel] [PULL 12/42] tcg/riscv: Add the extract instructions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <http://lists.nongnu.org/archive/html/qemu-devel/> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: peter.maydell@linaro.org, Michael Clark <mjc@sifive.com>, Alistair Francis <alistair.francis@wdc.com> Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+patch=linaro.org@nongnu.org> |
Series |
tcg queued patches
|
expand
|
diff --git a/tcg/riscv/tcg-target.inc.c b/tcg/riscv/tcg-target.inc.c index 01b4443d6d..48399480b2 100644 --- a/tcg/riscv/tcg-target.inc.c +++ b/tcg/riscv/tcg-target.inc.c @@ -596,3 +596,37 @@ static void tcg_out_movi(TCGContext *s, TCGType type, TCGReg rd, tcg_out_opc_upper(s, OPC_AUIPC, rd, 0); tcg_out_opc_imm(s, OPC_LD, rd, rd, 0); } + +static void tcg_out_ext8u(TCGContext *s, TCGReg ret, TCGReg arg) +{ + tcg_out_opc_imm(s, OPC_ANDI, ret, arg, 0xff); +} + +static void tcg_out_ext16u(TCGContext *s, TCGReg ret, TCGReg arg) +{ + tcg_out_opc_imm(s, OPC_SLLIW, ret, arg, 16); + tcg_out_opc_imm(s, OPC_SRLIW, ret, ret, 16); +} + +static void tcg_out_ext32u(TCGContext *s, TCGReg ret, TCGReg arg) +{ + tcg_out_opc_imm(s, OPC_SLLI, ret, arg, 32); + tcg_out_opc_imm(s, OPC_SRLI, ret, ret, 32); +} + +static void tcg_out_ext8s(TCGContext *s, TCGReg ret, TCGReg arg) +{ + tcg_out_opc_imm(s, OPC_SLLIW, ret, arg, 24); + tcg_out_opc_imm(s, OPC_SRAIW, ret, ret, 24); +} + +static void tcg_out_ext16s(TCGContext *s, TCGReg ret, TCGReg arg) +{ + tcg_out_opc_imm(s, OPC_SLLIW, ret, arg, 16); + tcg_out_opc_imm(s, OPC_SRAIW, ret, ret, 16); +} + +static void tcg_out_ext32s(TCGContext *s, TCGReg ret, TCGReg arg) +{ + tcg_out_opc_imm(s, OPC_ADDIW, ret, arg, 0); +}