From patchwork Fri Dec 9 02:05:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 632207 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp588820pvb; Thu, 8 Dec 2022 18:07:12 -0800 (PST) X-Google-Smtp-Source: AA0mqf7GqumGMOJBKHDxufcrR7LWBP9zy7tZxQK6oChWBAiJypt3sp3FiJnnPG1UA7ie+5fy9yNu X-Received: by 2002:ac8:490d:0:b0:3a7:e6df:36c2 with SMTP id e13-20020ac8490d000000b003a7e6df36c2mr4382950qtq.56.1670551632205; Thu, 08 Dec 2022 18:07:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670551632; cv=none; d=google.com; s=arc-20160816; b=rd8LjkS3iOJacx+VcqaCKZ+qIZxMi7p5HnH+IZZvj6c9QsbChf1552eeM8zomitiDf n4Dt1mKpz57t4UHVMNf/ruTUU+DUvVffAYQcWReEJIr+yXuRHei4De3Ag2ig4cewHi9/ HbRlZ4rXlM7z132r59XUdWqlMAxEpk4GlTw+f9B5bmIUgx0pJtp5LJFzVMmafpHqSDOC 3VFICm5dcyWCsmoTgDoY3u9Xp/wo8lHWr/FFxdkTS7nZukdNa4X4EyKa8z5lP8zfLC94 DrcgGWdDQ69Z5eycpIBQUBD5T5xEoiztBj0JVMB0L+mTeeMW5Pm11HkIT0k2NrzEbAbG CgUw== 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=/xRarcor/wbrlmQ6/1SUQDwNV/2PA1HoUGLA4N0wOFk=; b=ixF4NdmyyiNUh4GxeB1hWkqRMfAkVyy5JepHNLfkOzcA4gZpnx5Jq3yWxSPIMio3Rq COOGYC588JMUOHcsG59NrLE3oOMfscx//0AGyu9qaekAL3QS4EnN+YCQbeQ7cnXH55Vc pG7SZViyDOQYNj+7Rcr1wn0W7/koixm3Qwg4bR8C97i5byVNbHzLuJmLU1HrOV5qIYT+ oAs8jGFIbiLVLva/2+EPNSG7RA5AjW1UnTQhCXddWMpLcN8lT55BzgBgvD85o0/61Hbw O/HezlFT4Crc1IMMXcANw5Wx77FNnf7ArzfwfKqgTTw17N7Usu3fXIm/CkmSSjjluwmE UKDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lxkyvnio; 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 x5-20020ac85385000000b003a58b44591csi28882qtp.132.2022.12.08.18.07.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 Dec 2022 18:07:12 -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=lxkyvnio; 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 1p3Sm8-00064M-Ue; Thu, 08 Dec 2022 21:06:09 -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 1p3Sm2-00062S-8a for qemu-devel@nongnu.org; Thu, 08 Dec 2022 21:06:05 -0500 Received: from mail-oi1-x22e.google.com ([2607:f8b0:4864:20::22e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p3Slz-0001yz-Iv for qemu-devel@nongnu.org; Thu, 08 Dec 2022 21:06:01 -0500 Received: by mail-oi1-x22e.google.com with SMTP id v70so3277544oie.3 for ; Thu, 08 Dec 2022 18:05:59 -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=/xRarcor/wbrlmQ6/1SUQDwNV/2PA1HoUGLA4N0wOFk=; b=lxkyvnioQU5/iwuqGHWagUJT9vWBv/eDRUHk4ZU7ycDBbaldSTWSkGOCwyc6aNCOMo x4+PfnljtkElewLgp+b8TfSIg5QECIt5VG2XGUH4WqUGbfSH83X/NOW6/MADgdV0P846 WnKfNReNPlGpquncdlMnjn15TZyWpmnNZ5yuMP+RFBO97gSwV9v+wUHY8cyc5KfNusjE sb67f4fFPcF2MKAFW0zKd5gCq2GJoMy8CmxgORNxf6uXPtw6b4D6aGQls0c0EdHrJeBF DUt8jH9QbBfiAlwdOiDcCdPVHvwztlEI80ZKHfWElWsk+NO8KIHd1NDjhjJg9AgMTmH3 J5Ig== 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=/xRarcor/wbrlmQ6/1SUQDwNV/2PA1HoUGLA4N0wOFk=; b=hZxTLpBnMD2unSmGB4d8rWovzuoxCHEpN5QmRqOK2VfCyit0CT/e2oi1aMwIaAvl4m 3GQzMraf85VL9i7RvUJclK9/Zqh4tAZjURMEnK0cmYMbtfxQvYGXpXmcZ6DRq4lZvoe4 lDuRwloSum6EiuTe57Ck9sANwGnSd6hNH7V78/svUZSRCBDWITlMqGjGGY5Du0pliMaq /+vD4KDf0x+oI5QQhMvL34PFBMlRex3UCKCOU+fLNO9oLUGyFsafuRw8jEaQ32Hv6+pf UBXBT7q/e88zXVoZGS+TYB56sBsFhhP5o33UXTglbz7DqsU5do+g++Yj1ybzT+peS5iA gQyQ== X-Gm-Message-State: ANoB5pm7eZRfZIa8NWUffWSH5pIVU13sEClscdvy/EELfNzGJroJheve kfCPdG3dfEduaOk2n7BoQ5bOPj65SnEYGnZqmTI= X-Received: by 2002:a05:6808:1b1e:b0:35e:4589:19cf with SMTP id bx30-20020a0568081b1e00b0035e458919cfmr2114298oib.42.1670551558369; Thu, 08 Dec 2022 18:05:58 -0800 (PST) Received: from stoup.. ([2806:102e:18:2efc:d298:de6f:2ed:87a4]) by smtp.gmail.com with ESMTPSA id s14-20020a05683004ce00b0066f7e1188f0sm53531otd.68.2022.12.08.18.05.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Dec 2022 18:05:57 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: thuth@redhat.com, iii@linux.ibm.com Subject: [PATCH v4 22/27] tcg/s390x: Support SELGR instruction in movcond Date: Thu, 8 Dec 2022 20:05:25 -0600 Message-Id: <20221209020530.396391-23-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221209020530.396391-1-richard.henderson@linaro.org> References: <20221209020530.396391-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::22e; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x22e.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 The new select instruction provides two separate register inputs, whereas the old load-on-condition instruction overlaps one of the register inputs with the destination. Reviewed-by: Ilya Leoshkevich Signed-off-by: Richard Henderson --- tcg/s390x/tcg-target.c.inc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tcg/s390x/tcg-target.c.inc b/tcg/s390x/tcg-target.c.inc index 30c12052f0..ab1fb45cc2 100644 --- a/tcg/s390x/tcg-target.c.inc +++ b/tcg/s390x/tcg-target.c.inc @@ -202,6 +202,8 @@ typedef enum S390Opcode { RRFa_XRK = 0xb9f7, RRFa_XGRK = 0xb9e7, + RRFam_SELGR = 0xb9e3, + RRFc_LOCR = 0xb9f2, RRFc_LOCGR = 0xb9e2, @@ -626,12 +628,20 @@ static void tcg_out_insn_RRE(TCGContext *s, S390Opcode op, tcg_out32(s, (op << 16) | (r1 << 4) | r2); } +/* RRF-a without the m4 field */ static void tcg_out_insn_RRFa(TCGContext *s, S390Opcode op, TCGReg r1, TCGReg r2, TCGReg r3) { tcg_out32(s, (op << 16) | (r3 << 12) | (r1 << 4) | r2); } +/* RRF-a with the m4 field */ +static void tcg_out_insn_RRFam(TCGContext *s, S390Opcode op, + TCGReg r1, TCGReg r2, TCGReg r3, int m4) +{ + tcg_out32(s, (op << 16) | (r3 << 12) | (m4 << 8) | (r1 << 4) | r2); +} + static void tcg_out_insn_RRFc(TCGContext *s, S390Opcode op, TCGReg r1, TCGReg r2, int m3) { @@ -1376,6 +1386,11 @@ static void tgen_movcond_int(TCGContext *s, TCGType type, TCGReg dest, src = v4; } } else { + if (HAVE_FACILITY(MISC_INSN_EXT3)) { + /* Emit: dest = cc ? v3 : v4. */ + tcg_out_insn(s, RRFam, SELGR, dest, v3, v4, cc); + return; + } if (dest == v4) { src = v3; } else {