From patchwork Thu Jan 26 04:38:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 647068 Delivered-To: patch@linaro.org Received: by 2002:a17:522:b9de:b0:4b9:b062:db3b with SMTP id fj30csp58945pvb; Wed, 25 Jan 2023 20:43:18 -0800 (PST) X-Google-Smtp-Source: AMrXdXt+rCw2U5arfntT5D8JWIoT5E9H5thj2p1NQ+eWwSBhrEMAEOwQd8OnD8bc2EJXbLYkHxES X-Received: by 2002:a0c:eac1:0:b0:535:664b:772b with SMTP id y1-20020a0ceac1000000b00535664b772bmr33648107qvp.6.1674708198275; Wed, 25 Jan 2023 20:43:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674708198; cv=none; d=google.com; s=arc-20160816; b=MYhxTi/+wgl9Vt5IKFAbKTMrzhg2cdFrZgTaain0o5zSfbM8dphWqK37Cl9dESi1E7 /2PVNF8cuvz+1ehf9ecPHQ+uVWYn8oiT1VajJRowqdQlmD6KLdpliW7RgkC3Zuy4EuAN x65e2qWoWpmwEGvVHo3F4hsih9BBuWVxTq1beCvcVDEgTtNIe3b/GCa8eqaY3e4l8Fcj WbggIQdTD+jijDpcQvxBprNVpMMMEYZOWlcqUDImyLr6XWm4H7MQ1Bsxlv8knjHohj88 enG2mMHyK8jUBAWLHoAWVyzBvegwG3EZbn/CHUq1+OotPpmGC1GQaWGJ1AwejhGU2Y17 VGWw== 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=SzDpq4p4TZ0OiGc3bd/AjIVDg1qF6XupmGP3awuLITw=; b=ZiSJmT0viqRNjONZg8i/JHVhh6hXKADpUXT+GeTlsX5PaOSPwhkCyc61giIqVHy0rw PrTXnyYCGfEIanaZsQlWQun+o1Nsd5p6do9Ep93D7WHMwQZett2+sz+ZPsXZ1sqRRl5C Ad4LhWLibqmYI/dtALl49S1HoZ5jCeytuETYvoXpwJLogwQIltqX/DSbwEMAWTGoDmNj kUJ5K2jzq4vdupgOR+pKo1X9sQJT736MRTXkjYYLVuFfGx0VQz2N8W7nyqmLtURqAuIL jTufp4sEq9ekonrwwYonnufp9EBHLZZmGEwT06BsTZToTR0nrsx2lNThUOTcM+33oyG6 IBPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Y7Wca7xK; 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 p81-20020a374254000000b00704cf5d76f7si273696qka.511.2023.01.25.20.43.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 25 Jan 2023 20:43:18 -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=Y7Wca7xK; 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 1pKu2q-0000Sx-3S; Wed, 25 Jan 2023 23:39:28 -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 1pKu2Z-0000I3-Qu for qemu-devel@nongnu.org; Wed, 25 Jan 2023 23:39:15 -0500 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pKu2X-0004Qk-JS for qemu-devel@nongnu.org; Wed, 25 Jan 2023 23:39:11 -0500 Received: by mail-pj1-x102b.google.com with SMTP id v6-20020a17090ad58600b00229eec90a7fso5407949pju.0 for ; Wed, 25 Jan 2023 20:39:09 -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=SzDpq4p4TZ0OiGc3bd/AjIVDg1qF6XupmGP3awuLITw=; b=Y7Wca7xKXiCBCfqrKRyO4QrNg3zHaZBZWe/URAHNrBci9cF8b3eMhQ1vfMTVQlz6uN 577KYUjoFX8bZ/BZ7/x9xUamWouyEoQEBz7yLlnqPJZ3Agwxd7sgZpoCg8uRJh1Uyacp tUukI0ZiIXrBue9Gpz9Pti1+4003uZeV7Qo9YAEbp7b6FXj/TiU49/BW0BgkmMfQGCVK EIJ55CwdYJPcEowJSA7kmoAJg5k3XUoGMKmd+FyqiPBUOKPwDuPol4RZOeH4VgNnKJcr VSE5fsqSqINPjOJoJFzSfHiOu10HBa5xCkQxlh8/o8rt4nGitFoffzYVkQf5yhpwUSp4 mDDg== 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=SzDpq4p4TZ0OiGc3bd/AjIVDg1qF6XupmGP3awuLITw=; b=6+6cgwNJkCGwhDl3460Ry/2nrnwF5QiRqwq9Lx5wZw0+BOKK1YVzjV+WgumZ/QMl4S c7bsuLhF58NSrkxW9IK8yx+6jefDsvWTkRS0LVcyvCVV7FcbZZAEb4bOQeFtzIGaaPdA pwEfMyDoUyz+qBF002kUBKl9z3x5hZXMunS6vrX1bAl7tZKmTQWBweQj5PsbZ/w3D6Wm nHB44aNCwEDopWZwWlYbliviZc5xW7pwu+q4MSJNXl/baWq46skS6OlYQfgR3xw7FArv wwmljIeI9kvXwGTBJLuZpKhcvRvFs+T2U4K4t6Ep2yXuFe/5YLmoS9k1Ltg2CbFNMfOu +/TQ== X-Gm-Message-State: AO0yUKUCliwUXrA4UzU1sj2BYbnR9ZGqn8BOj/u5CyxYZh8A8PX74Yg2 SvZXitMQRM5ImAZMIdxQtn5JQNwSkeM5A0G9vJw= X-Received: by 2002:a17:90b:3891:b0:22b:ecec:aba6 with SMTP id mu17-20020a17090b389100b0022bececaba6mr8859159pjb.26.1674707948598; Wed, 25 Jan 2023 20:39:08 -0800 (PST) Received: from stoup.. (rrcs-173-197-98-118.west.biz.rr.com. [173.197.98.118]) by smtp.gmail.com with ESMTPSA id s62-20020a17090a69c400b00228e56d375asm233376pjj.33.2023.01.25.20.39.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Jan 2023 20:39:08 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: alex.bennee@linaro.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Ilya Leoshkevich Subject: [PATCH v5 26/36] target/s390x: Use Int128 for return from CLST Date: Wed, 25 Jan 2023 18:38:14 -1000 Message-Id: <20230126043824.54819-27-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230126043824.54819-1-richard.henderson@linaro.org> References: <20230126043824.54819-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102b; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102b.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 593f3c8bee..25c2dd0b3c 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 cb82cd1c1d..9be42851d8 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 6953b81de7..8397fe2bd8 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; }