From patchwork Mon Jan 30 21:48:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 648620 Delivered-To: patch@linaro.org Received: by 2002:a17:522:d8c:b0:4be:c3dc:14d8 with SMTP id d12csp1395472pva; Mon, 30 Jan 2023 13:51:41 -0800 (PST) X-Google-Smtp-Source: AMrXdXsHhZJKzw23950P2KTJHnBPn1cm1SmwCkY1D3sgJjl1pbroW+1Ao4eGEJtx9H+AhOeLdkFp X-Received: by 2002:a05:622a:4306:b0:3b3:7d5:a752 with SMTP id el6-20020a05622a430600b003b307d5a752mr56929016qtb.50.1675115501563; Mon, 30 Jan 2023 13:51:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675115501; cv=none; d=google.com; s=arc-20160816; b=BTXhF4grNq5e4m+MLiNX0mhVJIQ7KIjuwKCq0J/EXsRtwKa9hmf0XDaArM2EUds8iZ AKR+h+TUvq4+pwocWMi4rGZN7AGPKxEGOosQDIlVWp8XYY1oXLZit9oRjSc7fdiyy8JJ 4hhoklEdotjitIQFqwHHwDilrGVMrpGssHbpNF3qcYHppFUn6kk7wK397mW8Ylxvl8+f myu3CXlC1AUJzo3qGwvEZDqaql1lKyukFBWLb8O0EuemgraIM2ETInKF+LgfI1A9VHk+ w/WuVtNPy2crgKRgxpGLKe6vpK64GaTtdTvb+H7XtB+FduKQE0C+zLDx2wCJM1YFBdLR QjCQ== 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=uiGt9TI+QiouYZnDbq8g9cmuMEXgKdorGkFATMJwRVNNS/laxiogUYqplzCX1bZTD/ +8ot5DZ0H9QehJ7PYJytwwhnjfzMCRwttfoOvsFtT/C4CRhSd3XDokwUJz7kA/NPJw/7 ynV5OqGwciCDgbx9cL5b7Kqw0VmV4hySfoV8AGPxG4DO60xZDwZaVhAndOHrL6fpKe0f mzJEeT/CA7whG8DvCwS7eRQtsEVby/Xy0OOGeJ5Md8Qt734CYvA3a79VpHVQjfgiGXSh Zo0IT+nnT9NWBp9S6FWZhamBF+/L+nc01IKagyyH5SuFSZWovrin6oI0heJLfGGOkbGv UUUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="ERG/wqTg"; 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 fd10-20020a05622a4d0a00b003b6459a7bdasi603058qtb.683.2023.01.30.13.51.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Jan 2023 13:51:41 -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="ERG/wqTg"; 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 1pMc1z-0002YY-HP; Mon, 30 Jan 2023 16:49:39 -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 1pMc1w-0002IJ-CI for qemu-devel@nongnu.org; Mon, 30 Jan 2023 16:49:36 -0500 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pMc1r-0005hv-VX for qemu-devel@nongnu.org; Mon, 30 Jan 2023 16:49:33 -0500 Received: by mail-pj1-x1030.google.com with SMTP id mi9so3238512pjb.4 for ; Mon, 30 Jan 2023 13:49:31 -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=ERG/wqTgHoY4vulC6M5Z02/0wALStWhXI+axhaxRYxHZKyav5gt5lc3Wii4Ah1ZWVB T01G4Z7cKaLw+rHTT4EKotsoC3uNf4I6ipb/LBYWzKgC/2M8VH7uS3SQDKzcd4ajvh/l +d+0pYYUWhXH0RtrnFchnQD9yS/IS5auIosDqyesy0PdMdNYcrHTKsnSIUPUb3UixYa6 0ftrKYd0UG0Cd2oF4BSYDN24AgyLKlbXm2kwmypV9BC6NlGrz27kNl1IeuCCgeY9/+un 3cG0q7PlbXu7MgBau8E5ENTvonlroHiS5ZaxcKVoOAM/KUyJ9KxIy9TQJksAyyQh7CvM Xipw== 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=xMYlCvx6Ze5I73dNAYk2lgR7/Us4V/3pNdzg3qBy4ZVWnd3o2gbgo0iGhHvNyrPnIH vzytxVsiCrIsyobvEvDEvO2FkJYuePogeJZzKi7pTLWsW2kDWj8uNOL420I0prx21jhl Q6MWDzugAUd6JZhquSt5/jh/4VHMMmKkk3UTQNz3VaSBKr5Hnx5t4JlsxJEAaEDs1h+3 6cIiz5VoCcjqx2BX1fmHBKSCFkv5bUoFotGJ2XuawaocbBuDrgpFbVh/GDfx5W+DAp2z O9FSKcMLBc6wk6uiw9boyns+OGDwU3FQk3rEgrHyBzua6gFEjZHyrpR/Tlcr1vijOnPQ TQOQ== X-Gm-Message-State: AO0yUKW+4WYQzoPvSGmxUeENTVfxC9x84Nyy4GRh4rWVOky3uwiszqJ5 xT8zV325OiQG6HygpYwW+yZl0vR/GdN/8AgK X-Received: by 2002:a17:90b:4d83:b0:22c:6de5:60d3 with SMTP id oj3-20020a17090b4d8300b0022c6de560d3mr10320244pjb.4.1675115370528; Mon, 30 Jan 2023 13:49:30 -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 t4-20020a17090ad14400b00219220edf0dsm7451215pjw.48.2023.01.30.13.49.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Jan 2023 13:49:30 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: alex.bennee@linaro.org, philmd@linaro.org, Ilya Leoshkevich Subject: [PATCH v6 26/36] target/s390x: Use Int128 for return from CLST Date: Mon, 30 Jan 2023 11:48:34 -1000 Message-Id: <20230130214844.1158612-27-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230130214844.1158612-1-richard.henderson@linaro.org> References: <20230130214844.1158612-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1030; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1030.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; }