From patchwork Wed Feb 17 23:39:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 383941 Delivered-To: patch@linaro.org Received: by 2002:a02:c80e:0:0:0:0:0 with SMTP id p14csp3221983jao; Wed, 17 Feb 2021 15:49:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJxGVrBwP6cvsn1y42xUeVaBilVI8Puar0Dj1sQ9cx1oM8MOy15zYm/rOPKcuEsDxO9eyCpD X-Received: by 2002:a5b:30c:: with SMTP id j12mr2642141ybp.360.1613605797781; Wed, 17 Feb 2021 15:49:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613605797; cv=none; d=google.com; s=arc-20160816; b=O8NXx+bJqvEEl4XmuChv+i0L+D4sgmbxQAGxG9ySEiS89vHcZB3JqbMOa7OjInALF/ LSPOznfHaAEv5udwTh0xTwzO45OG+doRbX56DyjmZbvIFBjVphIOMW3GZrayQ6/lTeEZ Cs8sHVcoEB3V5rf+eQQ+KIhMG7Rm62RB7UdMcpQ56cUYfW81/qk7xNn7k1yDU9tbEQoC 18blK3ntcEH6z4C+tXfPyBh/ppEYHA551x2LIRs4zXsF2da+v8OHe99KW9Ip3d7p7Mfe x/kxf+5qFgXqM/iEy34I3XmU3X+6m85ngvOVCTjumBm9ryqEdxUpGvNquZ7wT81nEwg+ j/Wg== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=+Ct613QdC6dlEWBE/nYo3PltwiwMWPpntLMKNmtZ7L0=; b=vJ/mBVvsIL804TGItBC+MqB6/j9IjfsFPywchcq8MVMeNr5NgYI5ktooUyMCNbgQH6 gq9SK6ETGQ9oC1tWkugdKrySFU+fMZSnIAgtGj9S0onKOQ/E06/97gYgvUWocsj6ntau v+Kx2tPAaiF0nPt6UBSpeGC2Y5Q6qkRU6IFeuBOqL3e99z8cXXFzOk8hl6dQOgt2obeD zK+AAoBVtR1DFSVrJ51GsCNCbB4HphWDz993ZWKcwTNHyDct3vrtuwXGZ+DS4BgTsn4H Y1il6Qx3W0BD5pus0fWBucc3YvrdcPqtsyQnkdMrWs/CAGZwhkHffj6HZegXx2oPXC0L XD/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="I/cqg8Rj"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id o135si3221860ybg.469.2021.02.17.15.49.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Feb 2021 15:49:57 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="I/cqg8Rj"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:58950 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lCWZx-0001Xc-5S for patch@linaro.org; Wed, 17 Feb 2021 18:49:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50658) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lCWRD-0008Kq-HZ for qemu-devel@nongnu.org; Wed, 17 Feb 2021 18:40:55 -0500 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]:53425) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lCWRA-0004dd-T1 for qemu-devel@nongnu.org; Wed, 17 Feb 2021 18:40:55 -0500 Received: by mail-pj1-x102a.google.com with SMTP id c19so240503pjq.3 for ; Wed, 17 Feb 2021 15:40:52 -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 :mime-version:content-transfer-encoding; bh=+Ct613QdC6dlEWBE/nYo3PltwiwMWPpntLMKNmtZ7L0=; b=I/cqg8RjinVjqos4iKyz2HBGWbSW1e7hWaq+Tt3vI2f4ch6l04uHgSF0W3c9GBUBCy CQIiNwPvxHHZZDdKcPWYASM89B3sTEfZxJLrTMwGsliq9MHKatDvc55Xm+IMY0XZ9O6c m1HlTUszkxrOF0dREQ28Q/pjCBQqZbqFDml2A1KEnXLHu8DVj2+xesJwKQn58EyIaKlo tkYcNwze7iSxt73o9y1/o0WQ9WRIOy1G03N4kdWsoarN9Dtb5P1bTPS9wSwuLOomqtYK w+lbCcpGk9dAnFRTf0AlBKHNFwsOhzDJDOHbOPPe4259lsnIzK0cebZaDRHr2QGl+Be3 6kCw== 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:mime-version:content-transfer-encoding; bh=+Ct613QdC6dlEWBE/nYo3PltwiwMWPpntLMKNmtZ7L0=; b=czCdYMA6ysTgdbjV9ipwdnKWPkBhb7xVM3DWr22l06oZKkwMSikCvGjlQjT2Iw6O02 z/b5s+guaZwLg1YswL3p+teQWiz70qwCHI3sBaUAzD+An6s2R9rCY0wCshrOb8tRpeQk 9ciIzwYKoPXnkrIWvdUG+qWvsvLoIz6f9i7wLz/yAo6lElPkJBnxtXxgXtfnN8VZ1r5U upIaXiD/wz9tgoG3YlQUCftYPSKOCov/HcXzMA/P38GwAQgylepAFzxxTaAcT4mGdaUP g2IJm3RukunZuiqES3gh/yHnF9ZspvM0Vo9tmlPTM78E3evOXrHiNLxwHushK05pIkcP Qf9w== X-Gm-Message-State: AOAM530wUH5tRVcfODnVHm3gEgbFOIbUPgBm9vhhCK51Nuwni2Vs6fzL M1cEef0luqI61Dt2OKl5xjsxXEcZheBn6g== X-Received: by 2002:a17:902:8201:b029:e3:95d2:eb0a with SMTP id x1-20020a1709028201b02900e395d2eb0amr1575092pln.43.1613605251352; Wed, 17 Feb 2021 15:40:51 -0800 (PST) Received: from localhost.localdomain (047-051-160-125.biz.spectrum.com. [47.51.160.125]) by smtp.gmail.com with ESMTPSA id c21sm3950355pgh.0.2021.02.17.15.40.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Feb 2021 15:40:50 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 11/35] Hexagon (target/hexagon) instruction and packet types Date: Wed, 17 Feb 2021 15:39:59 -0800 Message-Id: <20210217234023.1742406-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210217234023.1742406-1-richard.henderson@linaro.org> References: <20210217234023.1742406-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102a; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, Taylor Simpson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Taylor Simpson The insn_t and packet_t are the interface between instruction decoding and TCG code generation Signed-off-by: Taylor Simpson Reviewed-by: Richard Henderson Message-Id: <1612763186-18161-11-git-send-email-tsimpson@quicinc.com> Signed-off-by: Richard Henderson --- target/hexagon/insn.h | 74 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 target/hexagon/insn.h -- 2.25.1 diff --git a/target/hexagon/insn.h b/target/hexagon/insn.h new file mode 100644 index 0000000000..5756a1d0ca --- /dev/null +++ b/target/hexagon/insn.h @@ -0,0 +1,74 @@ +/* + * Copyright(c) 2019-2021 Qualcomm Innovation Center, Inc. All Rights Reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ + +#ifndef HEXAGON_INSN_H +#define HEXAGON_INSN_H + +#include "cpu.h" + +#define INSTRUCTIONS_MAX 7 /* 2 pairs + loopend */ +#define REG_OPERANDS_MAX 5 +#define IMMEDS_MAX 2 + +struct Instruction; +struct Packet; +struct DisasContext; + +typedef void (*SemanticInsn)(CPUHexagonState *env, + struct DisasContext *ctx, + struct Instruction *insn, + struct Packet *pkt); + +struct Instruction { + SemanticInsn generate; /* pointer to genptr routine */ + uint8_t regno[REG_OPERANDS_MAX]; /* reg operands including predicates */ + uint16_t opcode; + + uint32_t iclass:6; + uint32_t slot:3; + uint32_t part1:1; /* + * cmp-jumps are split into two insns. + * set for the compare and clear for the jump + */ + uint32_t extension_valid:1; /* Has a constant extender attached */ + uint32_t which_extended:1; /* If has an extender, which immediate */ + uint32_t is_endloop:1; /* This is an end of loop */ + uint32_t new_value_producer_slot:4; + int32_t immed[IMMEDS_MAX]; /* immediate field */ +}; + +typedef struct Instruction Insn; + +struct Packet { + uint16_t num_insns; + uint16_t encod_pkt_size_in_bytes; + + /* Pre-decodes about COF */ + uint32_t pkt_has_cof:1; /* Has any change-of-flow */ + uint32_t pkt_has_endloop:1; + + uint32_t pkt_has_dczeroa:1; + + uint32_t pkt_has_store_s0:1; + uint32_t pkt_has_store_s1:1; + + Insn insn[INSTRUCTIONS_MAX]; +}; + +typedef struct Packet Packet; + +#endif