From patchwork Fri Dec 2 06:51:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 630235 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp741432pvb; Thu, 1 Dec 2022 22:54:10 -0800 (PST) X-Google-Smtp-Source: AA0mqf5lH412L4vnfd0kWTo0CpsVJE0OehVIEirfWmrTFMXsUXO6VCuq6RBpXiZ1zEsWnSY7nFGI X-Received: by 2002:a05:620a:164a:b0:6f9:5ebe:2bba with SMTP id c10-20020a05620a164a00b006f95ebe2bbamr47035141qko.426.1669964050769; Thu, 01 Dec 2022 22:54:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669964050; cv=none; d=google.com; s=arc-20160816; b=mDLkTJkXl7AOBfx1MhOGGu2br+wRy6kznn7GLlbgbUvIIUEB8xPFuFtNXLFkMnQO1o vX2YSJXP0FomOZ8dWPSx9EzlEHCux+ycQereh2OJVOyyOTx9FmbuiuQYZUvnb1HWCASO OYnvMusBJWJBss1fgm3d7u8dlMhd6dHVd+Cey5xRInbiqYVxeiU1ZngZlJbVjWQgQBGK laWPxR7ct1V/9xE7zp04PnW0evW5hdB7INNSAtrgiDPeBA+e0IYJGNVGjb24G0nxogu7 FlsFjwUxFheCt/BhR0jIvBNy0TUvC0iXw4erxRFmA2CyOKiOa9prj8Nk4Ydh7oYLI5z+ VFIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=Izp6/1cScQHTbPzRYt8a/mj2s7C9kjdu18CHy562wow=; b=gCED1jPmdKUhDMZde1DcExZMusyHK2pkjU9GHqbXbf9GZyn/0gRP4ohsosC+JAE2WG xWptcYadOZKz0lkjjtwN82MMRqdjq3cd/5SpA8g99yPEpQ9CHTTKnEvNmj0J90Q+DuBX aAdDj3mgUB5MexIU4mq8OnQ11+KzHz9Psc1V9vT5nSsAti+9aN2Aj63IOawHzANNvdpY yVPLn9+dudWS/qVlsyX3QsrBCDJpcdBHuLINnDvQzcuD8h1q1NoPL4Q9C9XTpmzZPC6z r6+M8UjY+3ng+xQkTKo/sofNEelBoJn33qu6a1/UDqHRLudKCzwduaLR0iCdfIoi9Vth ddCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="O67t/Mt2"; 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 do52-20020a05620a2b3400b006fc9e8c6f87si3285068qkb.705.2022.12.01.22.54.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 01 Dec 2022 22:54:10 -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="O67t/Mt2"; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p0zuB-0007b5-Ow; Fri, 02 Dec 2022 01:52:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p0zu7-0007Zn-4K for qemu-devel@nongnu.org; Fri, 02 Dec 2022 01:52:14 -0500 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p0zu4-0003fs-Sz for qemu-devel@nongnu.org; Fri, 02 Dec 2022 01:52:10 -0500 Received: by mail-pl1-x633.google.com with SMTP id w23so3806296ply.12 for ; Thu, 01 Dec 2022 22:52:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Izp6/1cScQHTbPzRYt8a/mj2s7C9kjdu18CHy562wow=; b=O67t/Mt2axi4lKLDUPRAnAKsFNnqtbhiFlxYofuZf377WoXMZW0JzAm2fqkiC/lTQR 6y5lYYTCg6tcKmNBbe/u7sWOSNBIrVDTtbXEvyOIcc8W22SZzHJ+U9mvTRhzCX5aZcOk JnX2M9Upx1mEQ2gUbuzHEF9P9D+FW9S2/X5+kE0zPfylGD3/cR/7HX+XSNw26m0DfwIX CPrL5n7s2ppbpn2q/+rXqQJxff4FcMAZhS0a559dRpZ4D2d6+qwAk2sH3yZUY2TkGKR9 FnH3UMtNclu0zBGCplZ8yJ9u67m6Chi6HOEJURek5FnEy51R8HAhdmlCR+TYeRz2wCVH BckA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Izp6/1cScQHTbPzRYt8a/mj2s7C9kjdu18CHy562wow=; b=3Wthfhp0KsOvUKl4ChgDUbOWlZhQCBBnExuYocUSJceyD3jTge/EjiUzNOhR9Y1Pww wVlPf6VHdWc1fUpMi8zltHoIrI3chxCQFXkUDHfn3bkZtCJjHt4Zv00Ukbsz0+3UujiW VH3E4W/aJFp3NQmvJRNH1yF1ffHcE0i+9Y4sB0O3kjlorZp7HZCcQIVjkNS9aJ/5VaV0 AyflTR84jMtTCaHckfPtjTZjezhJ+/2np0K+fw03dURo3VIBhVmu7ueJ25fDSFXVUEyA GVo5JXuLbNk1Pv4Svfc1nLn2MHcdFhMPz9trlXIfMWmkn6UiN557mGpt9mY7YedEYzPY mmVg== X-Gm-Message-State: ANoB5plBlSIzptJnov5+G2+4dDRRokv/2YC9bhiW481pNrfIGMhhTAUC xeiKD7+Gw7l16Hlxo9bzK564Mj8MKN2bU5+N X-Received: by 2002:a17:902:8217:b0:186:a5a7:cc3d with SMTP id x23-20020a170902821700b00186a5a7cc3dmr50363486pln.42.1669963926519; Thu, 01 Dec 2022 22:52:06 -0800 (PST) Received: from stoup.. ([2602:47:d48a:1201:e3cc:2e37:17d4:f1d5]) by smtp.gmail.com with ESMTPSA id q61-20020a17090a17c300b00218d894fac3sm6056649pja.3.2022.12.01.22.52.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Dec 2022 22:52:06 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: thuth@redhat.com, iii@linux.ibm.com Subject: [PATCH v3 05/13] tcg/s390x: Distinguish RIE formats Date: Thu, 1 Dec 2022 22:51:52 -0800 Message-Id: <20221202065200.224537-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221202065200.224537-1-richard.henderson@linaro.org> References: <20221202065200.224537-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::633; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x633.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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org There are multiple variations, with different fields. Signed-off-by: Richard Henderson Reviewed-by: Ilya Leoshkevich --- tcg/s390x/tcg-target.c.inc | 47 +++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/tcg/s390x/tcg-target.c.inc b/tcg/s390x/tcg-target.c.inc index a489b3359e..d02b433271 100644 --- a/tcg/s390x/tcg-target.c.inc +++ b/tcg/s390x/tcg-target.c.inc @@ -133,16 +133,19 @@ typedef enum S390Opcode { RI_OILL = 0xa50b, RI_TMLL = 0xa701, - RIE_CGIJ = 0xec7c, - RIE_CGRJ = 0xec64, - RIE_CIJ = 0xec7e, - RIE_CLGRJ = 0xec65, - RIE_CLIJ = 0xec7f, - RIE_CLGIJ = 0xec7d, - RIE_CLRJ = 0xec77, - RIE_CRJ = 0xec76, - RIE_LOCGHI = 0xec46, - RIE_RISBG = 0xec55, + RIEb_CGRJ = 0xec64, + RIEb_CLGRJ = 0xec65, + RIEb_CLRJ = 0xec77, + RIEb_CRJ = 0xec76, + + RIEc_CGIJ = 0xec7c, + RIEc_CIJ = 0xec7e, + RIEc_CLGIJ = 0xec7d, + RIEc_CLIJ = 0xec7f, + + RIEf_RISBG = 0xec55, + + RIEg_LOCGHI = 0xec46, RRE_AGR = 0xb908, RRE_ALGR = 0xb90a, @@ -561,7 +564,7 @@ static void tcg_out_insn_RI(TCGContext *s, S390Opcode op, TCGReg r1, int i2) tcg_out32(s, (op << 16) | (r1 << 20) | (i2 & 0xffff)); } -static void tcg_out_insn_RIE(TCGContext *s, S390Opcode op, TCGReg r1, +static void tcg_out_insn_RIEg(TCGContext *s, S390Opcode op, TCGReg r1, int i2, int m3) { tcg_out16(s, (op & 0xff00) | (r1 << 4) | m3); @@ -1008,9 +1011,9 @@ static inline void tcg_out_risbg(TCGContext *s, TCGReg dest, TCGReg src, int msb, int lsb, int ofs, int z) { /* Format RIE-f */ - tcg_out16(s, (RIE_RISBG & 0xff00) | (dest << 4) | src); + tcg_out16(s, (RIEf_RISBG & 0xff00) | (dest << 4) | src); tcg_out16(s, (msb << 8) | (z << 7) | lsb); - tcg_out16(s, (ofs << 8) | (RIE_RISBG & 0xff)); + tcg_out16(s, (ofs << 8) | (RIEf_RISBG & 0xff)); } static void tgen_ext8s(TCGContext *s, TCGType type, TCGReg dest, TCGReg src) @@ -1350,7 +1353,7 @@ static void tgen_setcond(TCGContext *s, TCGType type, TCGCond cond, /* Emit: d = 0, d = (cc ? 1 : d). */ cc = tgen_cmp(s, type, cond, c1, c2, c2const, false); tcg_out_movi(s, TCG_TYPE_I64, dest, 0); - tcg_out_insn(s, RIE, LOCGHI, dest, 1, cc); + tcg_out_insn(s, RIEg, LOCGHI, dest, 1, cc); return; } @@ -1443,7 +1446,7 @@ static void tgen_movcond(TCGContext *s, TCGType type, TCGCond c, TCGReg dest, if (HAVE_FACILITY(LOAD_ON_COND)) { cc = tgen_cmp(s, type, c, c1, c2, c2const, false); if (v3const) { - tcg_out_insn(s, RIE, LOCGHI, dest, v3, cc); + tcg_out_insn(s, RIEg, LOCGHI, dest, v3, cc); } else { tcg_out_insn(s, RRFc, LOCGR, dest, v3, cc); } @@ -1530,6 +1533,7 @@ static void tgen_compare_branch(TCGContext *s, S390Opcode opc, int cc, TCGReg r1, TCGReg r2, TCGLabel *l) { tcg_out_reloc(s, s->code_ptr + 1, R_390_PC16DBL, l, 2); + /* Format RIE-b */ tcg_out16(s, (opc & 0xff00) | (r1 << 4) | r2); tcg_out16(s, 0); tcg_out16(s, cc << 12 | (opc & 0xff)); @@ -1539,6 +1543,7 @@ static void tgen_compare_imm_branch(TCGContext *s, S390Opcode opc, int cc, TCGReg r1, int i2, TCGLabel *l) { tcg_out_reloc(s, s->code_ptr + 1, R_390_PC16DBL, l, 2); + /* Format RIE-c */ tcg_out16(s, (opc & 0xff00) | (r1 << 4) | cc); tcg_out16(s, 0); tcg_out16(s, (i2 << 8) | (opc & 0xff)); @@ -1558,8 +1563,8 @@ static void tgen_brcond(TCGContext *s, TCGType type, TCGCond c, if (!c2const) { opc = (type == TCG_TYPE_I32 - ? (is_unsigned ? RIE_CLRJ : RIE_CRJ) - : (is_unsigned ? RIE_CLGRJ : RIE_CGRJ)); + ? (is_unsigned ? RIEb_CLRJ : RIEb_CRJ) + : (is_unsigned ? RIEb_CLGRJ : RIEb_CGRJ)); tgen_compare_branch(s, opc, cc, r1, c2, l); return; } @@ -1570,18 +1575,18 @@ static void tgen_brcond(TCGContext *s, TCGType type, TCGCond c, larger comparison range afforded by COMPARE IMMEDIATE. */ if (type == TCG_TYPE_I32) { if (is_unsigned) { - opc = RIE_CLIJ; + opc = RIEc_CLIJ; in_range = (uint32_t)c2 == (uint8_t)c2; } else { - opc = RIE_CIJ; + opc = RIEc_CIJ; in_range = (int32_t)c2 == (int8_t)c2; } } else { if (is_unsigned) { - opc = RIE_CLGIJ; + opc = RIEc_CLGIJ; in_range = (uint64_t)c2 == (uint8_t)c2; } else { - opc = RIE_CGIJ; + opc = RIEc_CGIJ; in_range = (int64_t)c2 == (int8_t)c2; } }