From patchwork Sun Jan 8 02:37:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 640341 Delivered-To: patch@linaro.org Received: by 2002:a17:522:f3c4:b0:4b4:3859:abed with SMTP id in4csp1517203pvb; Sat, 7 Jan 2023 18:39:24 -0800 (PST) X-Google-Smtp-Source: AMrXdXvbImj+w5MuN0pdnBU+Kt4WTxWW1+BFd/MdM0tEgluZNJAdNux1l03OBcOuRF8ODpKnLdMQ X-Received: by 2002:ac8:43d8:0:b0:3a9:82a1:fb02 with SMTP id w24-20020ac843d8000000b003a982a1fb02mr76551659qtn.16.1673145564041; Sat, 07 Jan 2023 18:39:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673145564; cv=none; d=google.com; s=arc-20160816; b=ZbZ6WbWKcdGIxfvSNY5NdpM18zTyGahNpD98t7CIOgMNc0prny0MHmoWwwcRO4A8pw CfdVvlFefAtKPFsGeo2UMz67F/jJjKf1jL/M2xKarlYSUabZ9YoUVLq5gmmSASJm2fgy wmXt7Mu8wOmGSJTbVzZ+iIflFTjqfjynOUJnebGyQvfsVSVWyqek8SGgoJdWyCMFaHNF hu40tY0F+PmTHCOL9TX4rlLkHES4HZM277uwIlUryCMhbfKlnAHAVlE67E6mRoTZDmN8 Q57BHFe6r2MPVlurlHV5owzyZTwKylptof6oyEENmf5EnK91Zv0W1Khv49nSm0JAIKoQ 8J6Q== 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=O66NKO3iwTaPP9ThYWVwYPOLI4R1DXoUAU3K4OwGZv586grAN7DslMcMqKTXbPYpa/ MH6ZOYRW1PkN3cd2G+wT8PZV+CVbFNWNfy5xf8g2b+XGDal4RP8jC29lOFy8qYQdqLqJ IU40PN53PX5oSJnQGRkZDkx83XjNWBEil7Ju7kZ6fOvw5oQcAEl82Hpt0JJpdObHQMNx T6zQBjxnmEK/pOPGqUgVahhkMwjQ0eAKJA6XE0+dklVYQl0DaVRLB/xuqZYumTG44lAZ wDPoYhPkoGd9EiibnIzbCumaV60MUQ96wf5ztpCL07P0dd8WWgAM7clZTc1wYh5HjkZ2 bUwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XOErZP0u; 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 bt9-20020ac86909000000b003accbc4facbsi157724qtb.98.2023.01.07.18.39.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 07 Jan 2023 18:39:24 -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=XOErZP0u; 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 1pELaA-00063j-I4; Sat, 07 Jan 2023 21:38:46 -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 1pELa6-0005qY-Up for qemu-devel@nongnu.org; Sat, 07 Jan 2023 21:38:42 -0500 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pELZH-0004YR-F9 for qemu-devel@nongnu.org; Sat, 07 Jan 2023 21:38:41 -0500 Received: by mail-pj1-x1029.google.com with SMTP id b9-20020a17090a7ac900b00226ef160dcaso4079944pjl.2 for ; Sat, 07 Jan 2023 18:37:49 -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=XOErZP0uyB76ZPYUCJeaFgU8ddkWddUTq1jXF4aC6Xsq3md/pb6qGu7cpMgfM3O/Bt BnrMpJ3nQ4JbWfIunKtiQ21Agi5reiprnWmOQ6uIVtmn7ZXVKLf9YRvRbqRUWwhnjXWn 63GtHhGcZb1EsASn+IXYkj7OLAHjbgnMRmQl5C0uv4v75tWWcgd++qNm4vT+eBiBZaJl 1C9tyaRk/i4/sr+T0dVjjlSAkogLJe8nGlKbuviO//QGxqv6K3u/SzmlM3v/0Dpw9mdN 4iYXtMSLDKAcZyxSbvC4lCoXgg/lPuUdQcbHPjnfdHz8MRVXEobCQglYW9V9h1Spp7DL z6gw== 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=Us40JGYrx2z1vf2IYCfO0R/Z2eFJhJzsKdzW2ZCgylEled+y4uHs2165dhWO71rJgg 2odYUsqYhoFqhTrnEpc2cNnKhTmQy5yLmyUiwymx/iw5erXVfLV314nzWGJno5yVm5oy I1153HVPll9GJIkkvWvoA7VdWEB3Ke/5Zx5paFGXqkz/7A8/steWUMkezhyP1eOJ83Ff ejXM/WssVywHC5v5aRkGNVj6uroYG9wJbU2905kDtLv6OszjJqOJtYT/3yQmN+4wdaoT wV81NkihJ/ygEagQVkKHNBtuudGX4V8bV929fWEkvi9JAwV/jG+glbgExbxkGMROg+pf MenQ== X-Gm-Message-State: AFqh2krfux+A+2ORCUKhsjHjBCmZ6edgphY9RZsBz5G+5M3t7UO1kq9/ +YguXPOMWkon4cVZvpLzbJ5vzpztu+6DtuWa X-Received: by 2002:a05:6a20:a584:b0:ad:a5fd:b664 with SMTP id bc4-20020a056a20a58400b000ada5fdb664mr68552759pzb.37.1673145469580; Sat, 07 Jan 2023 18:37:49 -0800 (PST) Received: from stoup.. ([2602:47:d48c:8101:8a2d:2011:f402:6f82]) by smtp.gmail.com with ESMTPSA id o17-20020a170902d4d100b00189d4c666c8sm3394775plg.153.2023.01.07.18.37.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Jan 2023 18:37:49 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, qemu-riscv@nongnu.org, pbonzini@redhat.com, eduardo@habkost.net, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Ilya Leoshkevich Subject: [PATCH v4 26/36] target/s390x: Use Int128 for return from CLST Date: Sat, 7 Jan 2023 18:37:09 -0800 Message-Id: <20230108023719.2466341-27-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230108023719.2466341-1-richard.henderson@linaro.org> References: <20230108023719.2466341-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1029; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1029.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; }