From patchwork Thu Jan 26 04:38:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 647060 Delivered-To: patch@linaro.org Received: by 2002:a17:522:b9de:b0:4b9:b062:db3b with SMTP id fj30csp58748pvb; Wed, 25 Jan 2023 20:42:26 -0800 (PST) X-Google-Smtp-Source: AK7set9C7x8+oj3sSLJ9BN0f6phyqOTWPIzW0eSvzOsgClBt3uvKQbosfhymx5uc2eMS+WOEYHQq X-Received: by 2002:a05:622a:250:b0:3b6:302d:714 with SMTP id c16-20020a05622a025000b003b6302d0714mr2235361qtx.4.1674708146366; Wed, 25 Jan 2023 20:42:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674708146; cv=none; d=google.com; s=arc-20160816; b=EsaIA0eQX1Fwe7OCGvBeBpyM5brNdCC2FBpYfKCsP/68o32VFrIj27DjFmKu448roh IyacDvBv8KLOiQPbwo3FVCE+icg8clc+Pf/Iahzj4//s+xwkcJWaS1bloKec+WV1Z4Do RYiZyVquqy7C3QW6tLqiD2Uu9LeSR6GpDlE8Rkn7qK5cRmb16DTkOj0fLTJoaoWx1pTX sJQByulXy/0pJIHwWgMafiyFq20QDLC4hbkJaz1j+oSJRBPPKV9O5Vfk4Z71+Zgv+Dqr rCMhWtplGp4/QQ9iZOcExLhkZ4SapqeaiDlZbx7vvVO5bFWXIrepygU271FZu93PXsc7 aWhA== 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=U/HSkpGEvHbItuZnMKBTZy7j63PzLUxQ950pxrJaTtQ=; b=KRhLJivDDq5HY1fU3vT9NIo+DgmOwUSFBAR67RYk6eAAGEcv8Xlhkarzo7CBviKyoG wHRgT5BHTT/N7mS81bErUopXCxEAMw0QQk4Pz9KiW5GtEQ25Ozs/VoGt1d3/WYmfpMdK BjgkYKp2maajiSu2UtO6zoK4OAyfRv11jy8cYE3JscjbkxjSJMwyKKiUIZQe1uqKZgR1 GMm7lmX3IJWD2O+zNMoKh774Bsh+Fk1dF+Ogk+eV4MsSbIb3a8tKvGxiZhsw6r0qT2dS n+c1Hi/1fiZJgPKKq7TA+8t2jrTItkfvCFfPpZEUYW5RcBBSL7oZkBJ0pweWQ6hg6ZbV ZKtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QaXqTAS9; 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 d199-20020ae9efd0000000b00706b3f21ad1si376379qkg.63.2023.01.25.20.42.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 25 Jan 2023 20:42:26 -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=QaXqTAS9; 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 1pKu2o-0000OC-Sr; Wed, 25 Jan 2023 23:39:26 -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 1pKu2f-0000JI-KV for qemu-devel@nongnu.org; Wed, 25 Jan 2023 23:39:17 -0500 Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pKu2e-0004Vr-0y for qemu-devel@nongnu.org; Wed, 25 Jan 2023 23:39:17 -0500 Received: by mail-pj1-x1035.google.com with SMTP id t12-20020a17090aae0c00b00229f4cff534so5122838pjq.1 for ; Wed, 25 Jan 2023 20:39:12 -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=U/HSkpGEvHbItuZnMKBTZy7j63PzLUxQ950pxrJaTtQ=; b=QaXqTAS9o+fR4MFnTRYPGLWs6wwx//ORSp1kVRon47YsKge7WS25ejmvTnf1pVC8p4 85r7/O3Gq5/fcXuyafP70/TXbn1upjrz9mTu0HLe73V2HC2b1eA1PGlwyhIzoAF7hLEW 4/3C2JpOdjqIQbzLvblaPMIqhzp8Fu5ubieM9/XvKR8beXnqcdh/XY7EN1jNDHk+H3b1 arm9P3m3jud7otDUpbur1aDH/kNAfyiyp6E8P99uIYo951UChxC+KhiAiz8KXa9Gdg2G +w6751/uin+njkF4c/sCIiENqM0bsygcqQGEpaXWOSPWi6RAb7UHW2rCLuEHV+MN0Rv6 2jgA== 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=U/HSkpGEvHbItuZnMKBTZy7j63PzLUxQ950pxrJaTtQ=; b=ghAH5MK6zXbwuyHR6eixlXdf9gysJP6FTVHItwq4zWcbKlMtr92m4E/FMdEZBQcpfD UB0C9Z7/zwmmeXdMcYYHmzGlRGmpJeWfi3r2ryFSk1wi7xg+poPAzy/nPqCeER/PDZiH 7iDTdFRUeKelSR31hTJs7j/95ZSMwYPAn9ao/J5Ryz4BDOQdJ5wn3ETWTu/j3zitfeQT mW3MAv/gmtM0e4yNNyUmk3qPrHdGKGmhnFIEpGeWUDY5oe34RAV/4h3IOfKVXbOv/ibk VqlotEwW71/HzwZVciStoXofdg2BZjjSLfT74ZAlCM4a1kumVFKKx6xWpPsmVmj0oQWC 1+dw== X-Gm-Message-State: AO0yUKU490o5rv0orRoMB8PbQRBkwuP4VU6KNfgsZnzzESsIZxySEqkO z7HS6zbvEK4d+2VSwxe81gc8P1QAC4a4PT+y8rQ= X-Received: by 2002:a17:90b:4a8a:b0:225:f47d:b49f with SMTP id lp10-20020a17090b4a8a00b00225f47db49fmr725583pjb.39.1674707951836; Wed, 25 Jan 2023 20:39:11 -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.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Jan 2023 20:39:11 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: alex.bennee@linaro.org, Ilya Leoshkevich , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v5 28/36] target/s390x: Use Int128 for return from TRE Date: Wed, 25 Jan 2023 18:38:16 -1000 Message-Id: <20230126043824.54819-29-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::1035; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1035.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 Acked-by: Ilya Leoshkevich Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/s390x/helper.h | 2 +- target/s390x/tcg/mem_helper.c | 7 +++---- target/s390x/tcg/translate.c | 7 +++++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/target/s390x/helper.h b/target/s390x/helper.h index 03b29efa3e..b4170a4256 100644 --- a/target/s390x/helper.h +++ b/target/s390x/helper.h @@ -99,7 +99,7 @@ DEF_HELPER_FLAGS_4(unpka, TCG_CALL_NO_WG, i32, env, i64, i32, i64) DEF_HELPER_FLAGS_4(unpku, TCG_CALL_NO_WG, i32, env, i64, i32, i64) DEF_HELPER_FLAGS_3(tp, TCG_CALL_NO_WG, i32, env, i64, i32) DEF_HELPER_FLAGS_4(tr, TCG_CALL_NO_WG, void, env, i32, i64, i64) -DEF_HELPER_4(tre, i64, env, i64, i64, i64) +DEF_HELPER_4(tre, i128, env, i64, i64, i64) DEF_HELPER_4(trt, i32, env, i32, i64, i64) DEF_HELPER_4(trtr, i32, env, i32, i64, i64) DEF_HELPER_5(trXX, i32, env, i32, i32, i32, i32) diff --git a/target/s390x/tcg/mem_helper.c b/target/s390x/tcg/mem_helper.c index b0b403e23a..49969abda7 100644 --- a/target/s390x/tcg/mem_helper.c +++ b/target/s390x/tcg/mem_helper.c @@ -1632,8 +1632,8 @@ void HELPER(tr)(CPUS390XState *env, uint32_t len, uint64_t array, do_helper_tr(env, len, array, trans, GETPC()); } -uint64_t HELPER(tre)(CPUS390XState *env, uint64_t array, - uint64_t len, uint64_t trans) +Int128 HELPER(tre)(CPUS390XState *env, uint64_t array, + uint64_t len, uint64_t trans) { uintptr_t ra = GETPC(); uint8_t end = env->regs[0] & 0xff; @@ -1668,8 +1668,7 @@ uint64_t HELPER(tre)(CPUS390XState *env, uint64_t array, } env->cc_op = cc; - env->retxl = len - i; - return array + i; + return int128_make128(len - i, array + i); } static inline uint32_t do_helper_trt(CPUS390XState *env, int len, diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index 1a7aa9e4ae..f3e4b70ed9 100644 --- a/target/s390x/tcg/translate.c +++ b/target/s390x/tcg/translate.c @@ -4905,8 +4905,11 @@ static DisasJumpType op_tr(DisasContext *s, DisasOps *o) static DisasJumpType op_tre(DisasContext *s, DisasOps *o) { - gen_helper_tre(o->out, cpu_env, o->out, o->out2, o->in2); - return_low128(o->out2); + TCGv_i128 pair = tcg_temp_new_i128(); + + gen_helper_tre(pair, cpu_env, o->out, o->out2, o->in2); + tcg_gen_extr_i128_i64(o->out2, o->out, pair); + tcg_temp_free_i128(pair); set_cc_static(s); return DISAS_NEXT; }