From patchwork Tue Sep 6 10:17:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 603032 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:4388:0:0:0:0 with SMTP id w8csp4457015mae; Tue, 6 Sep 2022 04:59:18 -0700 (PDT) X-Google-Smtp-Source: AA6agR6b3gH8ZyKsQ4lDc33QPV12wTmz3hXv4YtJrR8jXDueLBLCyfpz4PggYxy6HrCtDR4hzUJs X-Received: by 2002:a05:620a:4310:b0:6ac:f9df:178d with SMTP id u16-20020a05620a431000b006acf9df178dmr35834344qko.773.1662465558202; Tue, 06 Sep 2022 04:59:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662465558; cv=none; d=google.com; s=arc-20160816; b=nD8DkbhPRB6JJd0Ht9zksDbTdwgRX6LqEFyegM7MHe5q8EUlhv1pcfaNsnnfDvLD2L wfO6DWTtSadYF2JAs6LRUSRugTHZsArr8UF2O2c+x7IlgIo1jKqYb3xEI9zIdR9RI9qP 9bhysedmUBGfXVguX+Jq93a/wHskWEvJja1TeP6vhwJe4yHKgRuAGJZ2MBg8Y1Vq2kTs F2ZCFPNtdc+P64DjE3/32g8+0qvKvPXgFXq/A+Om5PmdTmug7hfUoDAbcJEshSDtT7Zh 2Nmhz0WwnWXprDwMvSKZ2hq65NQuEFm2g5I2XTF9fiopYaMgkxtZzyqijuxnxn1cFroO NUmg== 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=rPJg4mEU9SLLKDl0FCUQ1+PhBCFKs+m7Onca/fb/wNE=; b=d3bacF63VZyvMv1Up7KBg+nl6qWrQFA9og0jHD4H7/q/JXYK3qXpfgF6NU/5MtcxUh c41yEjL3lrHbiSCcnQrVaIaW6MfJ50DBPpaTf04cxQfk97rrRWECZ9tjwHL/qQENnhcb 82UxD/vr2Yc+JizVrT7gjPTniIzLnmoN+WBip6XN8rLFpSGKiQ64GybjjJS/0jGNWBHD 0GVwNx7eGmxLH6L1IU1VQTfRQVFgoRXObUZj40nrb6Cg1Z1m68buhQX2PW86MRV4+VzM 6IEr8J0xVDlqQCrx1SY5YIE4R2UZyA6xcoR8xE99eEA6oqCD9+YwLRBjAPl3aa6I+dg9 mumw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ob3ZBunb; 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 p5-20020ac87405000000b0031eef0c1cccsi6150301qtq.104.2022.09.06.04.59.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 06 Sep 2022 04:59:18 -0700 (PDT) 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=Ob3ZBunb; 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]:46720 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oVXEb-00056W-Ji for patch@linaro.org; Tue, 06 Sep 2022 07:59:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46496) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oVVet-0003Sv-L2 for qemu-devel@nongnu.org; Tue, 06 Sep 2022 06:18:19 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]:38857) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oVVeq-0005Hx-CH for qemu-devel@nongnu.org; Tue, 06 Sep 2022 06:18:19 -0400 Received: by mail-wm1-x333.google.com with SMTP id n23-20020a7bc5d7000000b003a62f19b453so9280238wmk.3 for ; Tue, 06 Sep 2022 03:18:13 -0700 (PDT) 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; bh=rPJg4mEU9SLLKDl0FCUQ1+PhBCFKs+m7Onca/fb/wNE=; b=Ob3ZBunbKHXjHsyfzCCalhQG6t4U83x21ElzV4v+i2/l+X20+ji9wxAoj3+sIXvQuL JbSzz66XiGd19cnUGQqEYCiPYo1VFRqj7q8MUfT/NXyrAvLu7euJgWrQoLoQ26UXtPgR QVminGr8vPqHRQGPGX4hvHnRB3KhZJyAZzSXBVmhUvsjT0VmkTvgB7ebDoRVjz2hGRmk BRC+Kp98VLD1rX7EsLakYOuSexf9WYbfEpddi/xdUlOb099zJSr6P9VVB718yda5QZ1x gTaDkyM/iZwwJoFDRqQITXozL427+fosjI30zvuAkalyVjpYDBmGQ//H0dHaySgvLJMB msIw== 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; bh=rPJg4mEU9SLLKDl0FCUQ1+PhBCFKs+m7Onca/fb/wNE=; b=aB9f30IWI4OwilqKWHjAhajyd+unhl9FttyXGHVGgxmy2ZsVexUGfs5aj8KfEHfGXf pnuRXcDGuSM6UtmYntAhcZu4w+iXRiqL1w9XHnxkTJAgWOxoagDi8HoLm/7IDqg6UpAO 0Pl5Fs9gN7zgjy69zrmSL7j3FSh5jNfD15ZCw2Aq+11NBeVmbGOPZonvMaJHLxF0G1of 3U0pqtB/OJBS3k4Hyz3o1FHcny5O/GMKMw79n5bwxkTnqZ4/0XwAdMG4C+rC60N665vU FHY1vx43WdMBInuxqdKeEkKQ2MFNEtuS12qU38Q9ATBm7R2RpAu3Ed7QxwNvW2a9RXb2 QcLQ== X-Gm-Message-State: ACgBeo1LkeACUU2QmSjdO8lOpOembkiuX6j72m7S+ehlpmPbROwfyEkM 6RzvaLHEpTB6se8Bd1whEqaSJOV4RRc7NiTk X-Received: by 2002:a05:600c:4e52:b0:3a6:d89:4d1b with SMTP id e18-20020a05600c4e5200b003a60d894d1bmr13621981wmq.150.1662459492221; Tue, 06 Sep 2022 03:18:12 -0700 (PDT) Received: from localhost.localdomain ([2a02:8084:a5c0:5a80:ba98:3a71:8524:e0b1]) by smtp.gmail.com with ESMTPSA id y16-20020a05600c365000b003a62bc1735asm14094361wmq.9.2022.09.06.03.18.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Sep 2022 03:18:11 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org Subject: [PATCH v1 22/26] target/s390x: Pass original r2 register to BCR Date: Tue, 6 Sep 2022 11:17:43 +0100 Message-Id: <20220906101747.344559-23-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220906101747.344559-1-richard.henderson@linaro.org> References: <20220906101747.344559-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=richard.henderson@linaro.org; helo=mail-wm1-x333.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, T_SCC_BODY_TEXT_LINE=-0.01 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" We do not modify any general-purpose registers in BCR, which means that we may be able to avoid saving the value across a branch. Signed-off-by: Richard Henderson --- target/s390x/tcg/translate.c | 10 ++++++++++ target/s390x/tcg/insn-data.def | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index e6c7c2a6ae..b27e34f712 100644 --- a/target/s390x/tcg/translate.c +++ b/target/s390x/tcg/translate.c @@ -5704,6 +5704,16 @@ static void in2_r2_nz(DisasContext *s, DisasOps *o) } #define SPEC_in2_r2_nz 0 +static void in2_r2_o_nz(DisasContext *s, DisasOps *o) +{ + int r2 = get_field(s, r2); + if (r2 != 0) { + o->in2 = regs[r2]; + o->g_in2 = true; + } +} +#define SPEC_in2_r2_o_nz 0 + static void in2_r2_8s(DisasContext *s, DisasOps *o) { o->in2 = tcg_temp_new_i64(); diff --git a/target/s390x/tcg/insn-data.def b/target/s390x/tcg/insn-data.def index 6d2cfe5fa2..682d1d292d 100644 --- a/target/s390x/tcg/insn-data.def +++ b/target/s390x/tcg/insn-data.def @@ -121,7 +121,7 @@ /* BRANCH INDIRECT ON CONDITION */ C(0xe347, BIC, RXY_b, MIE2,0, m2_64w, 0, 0, bc, 0) /* BRANCH ON CONDITION */ - C(0x0700, BCR, RR_b, Z, 0, r2_nz, 0, 0, bc, 0) + C(0x0700, BCR, RR_b, Z, 0, r2_o_nz, 0, 0, bc, 0) C(0x4700, BC, RX_b, Z, 0, a2, 0, 0, bc, 0) /* BRANCH RELATIVE ON CONDITION */ C(0xa704, BRC, RI_c, Z, 0, 0, 0, 0, bc, 0)