From patchwork Fri Nov 11 08:08:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 623718 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp632921pvb; Fri, 11 Nov 2022 00:25:59 -0800 (PST) X-Google-Smtp-Source: AA0mqf6C49hrde1QpCBzxMCyKO/9ZDGznd+8X8WUBB++qWFjsIpSyGOUx/XSXIPDdXM9wJ6gMWAY X-Received: by 2002:a37:95c2:0:b0:6fa:2aec:52b0 with SMTP id x185-20020a3795c2000000b006fa2aec52b0mr224400qkd.740.1668155159773; Fri, 11 Nov 2022 00:25:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668155159; cv=none; d=google.com; s=arc-20160816; b=a4sYY8s9SSNLRcsSArQLEf2dsvH/Fyu86S1N7xljIpPCf5CVV6uH2S1lhpNtLkHHWH HdcO6oiL97gfkXn+o36EMRXd7qYO7WqP3ggmwuSmJ4dYwap3z46RYiHTDDinwuRdGWbU yxYTCFVu+4r+4F302HqbrMzdvXDL8N4BMFjbFg423VFx3k871Fgh0OSQv/8kBGQ80Bgk 3a/xLUwf67I69jzfS0Qeyed+elM8H+1W9kHvIk7esw1igmhtAj/C0cuQobls5hlmUlsx WcC0XcBHF3CuHDpnDMS+wnEdXn/NVPsyERjrxY4Ciw3+qk6c0mC+/pboaDnEC0jNwizb cdfA== 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=cMsVXU84GstEE4BTAJC95Fa0iNsUBEyjtGyoPyOs7n8=; b=HbZIPyD0cE4kHwTY+QKBNyE64KcPGBRJ676I8N9oF7BNBsWDIdiyMG3u0CSaIjMoyQ ptxTgMpyaEuQ//+2W/8IK6uaXM1gIltEPSckTBog95klOCyO32HpP5CQtXNS9cGIVYm5 HCHadjNJbb7rFrOszidARfroIFrqO9k0PZvVRHYeZfrexr5j9sOKiglvw6/estNKr3VB TRFJvWzYls1pCgl5FbQ7TFhDzBJwFCePdi/zSo9wcQIvaOQ2lPcNyy/PqQk3pZ9krGWF a3zCQ5TesIdh+zUlQQEyQ2YftIMSuD3F31V6hFHc5ilwHfjWOIq/0w0ULbhbp01tuHD/ kukg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wGJLPFvl; 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 bi30-20020a05620a319e00b006eed0fc6627si756421qkb.296.2022.11.11.00.25.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 11 Nov 2022 00:25:59 -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=wGJLPFvl; 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 1otP6P-0001Jd-Q7; Fri, 11 Nov 2022 03:09:29 -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 1otP5j-00015f-F2 for qemu-devel@nongnu.org; Fri, 11 Nov 2022 03:08:49 -0500 Received: from mail-pj1-x102d.google.com ([2607:f8b0:4864:20::102d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1otP5h-0002Fk-JG for qemu-devel@nongnu.org; Fri, 11 Nov 2022 03:08:47 -0500 Received: by mail-pj1-x102d.google.com with SMTP id m14-20020a17090a3f8e00b00212dab39bcdso7166990pjc.0 for ; Fri, 11 Nov 2022 00:08:45 -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=cMsVXU84GstEE4BTAJC95Fa0iNsUBEyjtGyoPyOs7n8=; b=wGJLPFvl+ubbBNVuhrp1Tr1cPxaO/M3NNbmeAGdS1WHBhypr3Hw0gAfJ7y/BvVHj/A VkrYUgCrCgkkymHSJBXb2tCQa83WjRKYPjn7ZBWEpMIkSmco1hTZNCaexnObsjQw4my5 IVt8CVU3NWYN7fKWAP1pz3Qgf534FbQwsUmo3ejJufyMzh/7sslzPmCJFuI8HWoLssKC XGYcyY1Ks6FSNzJvVL4KONXuhar8D08QvVkqqXZjW5Z76eFOX8lxghse8DD+hdZeRsOF w9a8ewCnL2kvaqYAgKvhnCTIHzkO2rRYLxBInHh05WeMkLgzVyqbZXLkyxcOYc497+0+ R+9Q== 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=cMsVXU84GstEE4BTAJC95Fa0iNsUBEyjtGyoPyOs7n8=; b=7S4uTZAVRvwapWiDGwUqAh/ZlkDC4KlJKUcDctT9k1+0EMOUNazBVVrIMgFQ6KFEK8 NMq1LHod+Utss1cCEVak7F0X/Qu/PH6HQgGG4A/lCJITSuNTYCELeBSWIPoja0+9lfhl 2kTeL2/ObfZneRF3cLnE6Crzymz4mPh/LxiFICfkbpmL+yQZ7T+ITGq8sIj69+xiVCxE QoyKhEILSUdHojZa9rkAZpNFUehbFGWP/VQPux9N1A5aYx+MwzJi3oHeZhjUQKSPcgNk //9I5dn/8DmXWrTGpkMp86EgQbefBjTamMuntGTJt0ZuhLZgaNgUecPVffi/Gfbcd9Mc VDKg== X-Gm-Message-State: ANoB5pn/ns04Eg3NzKqc5urZIDLKQ0oaQoCgqnE5RYVIKvJJoaSF58G3 /fpof7iVUSkR42t7P8KwX+3yxh1ZJ4P/SBkr X-Received: by 2002:a17:90a:1b83:b0:200:6637:a9e3 with SMTP id w3-20020a17090a1b8300b002006637a9e3mr678508pjc.176.1668154124274; Fri, 11 Nov 2022 00:08:44 -0800 (PST) Received: from stoup.lan (2001-44b8-2176-c800-0aef-59aa-1faf-7e61.static.ipv6.internode.on.net. [2001:44b8:2176:c800:aef:59aa:1faf:7e61]) by smtp.gmail.com with ESMTPSA id j4-20020a170902c3c400b00186a2dd3ffdsm1046341plj.15.2022.11.11.00.08.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Nov 2022 00:08:43 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: iii@linux.ibm.com, david@redhat.com, =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PATCH for-8.0 v2 06/13] target/s390x: Use Int128 for return from CLST Date: Fri, 11 Nov 2022 18:08:13 +1000 Message-Id: <20221111080820.2132412-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221111080820.2132412-1-richard.henderson@linaro.org> References: <20221111080820.2132412-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102d; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102d.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 Reviewed-by: Philippe Mathieu-Daudé Acked-by: Ilya Leoshkevich Signed-off-by: Richard Henderson --- target/s390x/helper.h | 2 +- target/s390x/tcg/mem_helper.c | 11 ++++------- target/s390x/tcg/translate.c | 8 ++++++-- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/target/s390x/helper.h b/target/s390x/helper.h index 29986557ed..ba9ed11896 100644 --- a/target/s390x/helper.h +++ b/target/s390x/helper.h @@ -16,7 +16,7 @@ DEF_HELPER_FLAGS_3(divs64, TCG_CALL_NO_WG, i128, env, s64, s64) DEF_HELPER_FLAGS_4(divu64, TCG_CALL_NO_WG, i128, env, i64, i64, i64) DEF_HELPER_3(srst, void, env, i32, i32) DEF_HELPER_3(srstu, void, env, i32, i32) -DEF_HELPER_4(clst, i64, env, i64, i64, i64) +DEF_HELPER_4(clst, i128, env, i64, i64, i64) DEF_HELPER_FLAGS_4(mvn, TCG_CALL_NO_WG, void, env, i32, i64, i64) DEF_HELPER_FLAGS_4(mvo, TCG_CALL_NO_WG, void, env, i32, i64, i64) DEF_HELPER_FLAGS_4(mvpg, TCG_CALL_NO_WG, i32, env, i64, i32, i32) diff --git a/target/s390x/tcg/mem_helper.c b/target/s390x/tcg/mem_helper.c index 3758b9e688..5a299ca9a2 100644 --- a/target/s390x/tcg/mem_helper.c +++ b/target/s390x/tcg/mem_helper.c @@ -886,7 +886,7 @@ void HELPER(srstu)(CPUS390XState *env, uint32_t r1, uint32_t r2) } /* unsigned string compare (c is string terminator) */ -uint64_t HELPER(clst)(CPUS390XState *env, uint64_t c, uint64_t s1, uint64_t s2) +Int128 HELPER(clst)(CPUS390XState *env, uint64_t c, uint64_t s1, uint64_t s2) { uintptr_t ra = GETPC(); uint32_t len; @@ -904,23 +904,20 @@ uint64_t HELPER(clst)(CPUS390XState *env, uint64_t c, uint64_t s1, uint64_t s2) if (v1 == c) { /* Equal. CC=0, and don't advance the registers. */ env->cc_op = 0; - env->retxl = s2; - return s1; + return int128_make128(s2, s1); } } else { /* Unequal. CC={1,2}, and advance the registers. Note that the terminator need not be zero, but the string that contains the terminator is by definition "low". */ env->cc_op = (v1 == c ? 1 : v2 == c ? 2 : v1 < v2 ? 1 : 2); - env->retxl = s2 + len; - return s1 + len; + return int128_make128(s2 + len, s1 + len); } } /* CPU-determined bytes equal; advance the registers. */ env->cc_op = 3; - env->retxl = s2 + len; - return s1 + len; + return int128_make128(s2 + len, s1 + len); } /* move page */ diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index 36613bb20b..3708faec0e 100644 --- a/target/s390x/tcg/translate.c +++ b/target/s390x/tcg/translate.c @@ -2164,9 +2164,13 @@ static DisasJumpType op_clm(DisasContext *s, DisasOps *o) static DisasJumpType op_clst(DisasContext *s, DisasOps *o) { - gen_helper_clst(o->in1, cpu_env, regs[0], o->in1, o->in2); + TCGv_i128 pair = tcg_temp_new_i128(); + + gen_helper_clst(pair, cpu_env, regs[0], o->in1, o->in2); + tcg_gen_extr_i128_i64(o->in2, o->in1, pair); + tcg_temp_free_i128(pair); + set_cc_static(s); - return_low128(o->in2); return DISAS_NEXT; }