From patchwork Fri Oct 21 07:30:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 617130 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp803760pvb; Fri, 21 Oct 2022 00:55:41 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6ZhYP/l4mU6rsXraD17y0irxextWB89A0ABbBMwtyxByg7imakAC6BurBhQe0lNnwq0SE4 X-Received: by 2002:a0c:8ccc:0:b0:4b2:382e:ddaa with SMTP id q12-20020a0c8ccc000000b004b2382eddaamr15126949qvb.33.1666338941574; Fri, 21 Oct 2022 00:55:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666338941; cv=none; d=google.com; s=arc-20160816; b=NzZoZsn6P/Hj9Lm9y7nODnoBmaXzzerJ6i1YWSWZN9c2TsJnFAb6BWKkuvE8inlK/n fvCgzuG+tXk4tlgV03aDNgXiOySXWEGswSUC+3imqSWZfsfynWxR8OQg4sTTzvJd02xT 08XGRHjHUuMhih8tuN1F9kP6x4y3JfbkXpFIPSl9eJ+LYTq5G5U6dVm6vQ8aAw2nFO49 lSeuGkWf2g8Y5XCQIuR8+j6lVGqfpWmAFC2+3sroTTs7AoceFU+LROF+Mao/UsstDu/p ZXS3cMdrv98vCK1tXly8/ZLr3JWZ4z8vSO2NfE6bpoKozIt6VA1kCMfPF3UhqYrzKO9Y cefg== 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=/rok+6KDRpXT7JmHw7TCPUnVpNhZz1E6dInc4GSpPSY=; b=TSAWlBGbJqQYyrZW+tkfUsc9QHVwm2041vclSnuxh8vygfcC0K8D0X1/v9o6WzV02e 467fWObZjJxPfqdOxR5RR6QsMCGUa99XFs++YYNWlwEOd+dx/5m1kTqniTvmzHSAuncW Q2KUT/vFAKzyvfoWCCN9l9LSUIXbduM4CedvUzzyqZPwvyhqlRgPggiyieOpDdVQntXD HlhExQDigOIeTFr6vcEDuWeEIFS0dX2uDxSCboVWTBsytWyyIFO024noUGnugo/L3SCQ jL9QWhcbPvHVb4V1NwppGK3SPeiwho15TVghcXJo1PbRcNqOFPFz7RaHr6ijiS+k6G3l DwHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EDpdwYnp; 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 125-20020a370483000000b006e0fc11eb6asi11110821qke.198.2022.10.21.00.55.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 21 Oct 2022 00:55:41 -0700 (PDT) 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=EDpdwYnp; 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=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1olmsW-00070N-VM for patch@linaro.org; Fri, 21 Oct 2022 03:55:41 -0400 Received: from [::1] (helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1olmVF-0004IJ-FX for patch@linaro.org; Fri, 21 Oct 2022 03:31:37 -0400 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 1olmUo-00045B-VC for qemu-devel@nongnu.org; Fri, 21 Oct 2022 03:31:12 -0400 Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1olmUa-0007vk-OD for qemu-devel@nongnu.org; Fri, 21 Oct 2022 03:31:07 -0400 Received: by mail-pg1-x52c.google.com with SMTP id 128so1851160pga.1 for ; Fri, 21 Oct 2022 00:30:56 -0700 (PDT) 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=/rok+6KDRpXT7JmHw7TCPUnVpNhZz1E6dInc4GSpPSY=; b=EDpdwYnp6tsVYoD7bsectTFQHrPgtYDPV1a13lT3U9U5r4OS7yl2t2Ro+9fbJs2gYG INHJMxdvsbcxZk49oIByKRyLjeOtsMWpn3qCnops2hxDD/mxpcAFIUGX+LqZA3R6dBYj s2zqpPS/qlxG+WVOcLMl0d7OIBnuL1G1TDovIG/JLcFeV8asu4+Lik+3jhlrTRLiqAmP NcaD16T/Xg//MEEdKBVIctsfFVna7YZbDdiQhwginM3b9ITdH3oH6XZeiRVF5wET15tK bsiPrla+Y/71cd3CnR3AV0Poy9nim7eWXhTKSS9QEJKlk2AfQpx4Q8ARlU+7HAmCglak X+NQ== 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=/rok+6KDRpXT7JmHw7TCPUnVpNhZz1E6dInc4GSpPSY=; b=633U1N3OpAcRFTanHCVUqmkDFOS2sWOta6Lk0VuLwP2VgBd6ZjfWrAmGdWZU/XREEV SUvZ5v8BO2cdRZDPQD5+VJukyJQez5tC/9wYudX+h46kpdPA+8h8zFLtEKzKlWs+G3ZV aQPMzypJqQ87T1GLOEgpGaq7sv/UJ0XL7Q6Ht1Xg3apdmi/A7ya5up+m1CHgusgwjyHb yrEM23EBvCdAdxT2wsVevDiNk2A3HEaEcvHhUFxLdVEtQ/wcpz/VaQlLK/llE8uH1jON aGkKoLr5ZPKTWDJ0NDD9Blnl5a36MWp2mG3+iIA84ei5nRDgYRMxBXAoBAmA38cVQ2Cl 7ZEg== X-Gm-Message-State: ACrzQf15DUe/y9W6NO7VrBoXBwbYoA6trIe7tA/LYL6qcuxVIfW3eUsT ibWF+g22bbonwdA2jhRxh/RXglKf9K6AUFzW X-Received: by 2002:aa7:8893:0:b0:563:89e0:2d43 with SMTP id z19-20020aa78893000000b0056389e02d43mr17385331pfe.25.1666337455287; Fri, 21 Oct 2022 00:30:55 -0700 (PDT) Received: from localhost.localdomain ([149.135.10.35]) by smtp.gmail.com with ESMTPSA id a9-20020a17090a6d8900b002008d0e5cb5sm1042721pjk.47.2022.10.21.00.30.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Oct 2022 00:30:54 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org Subject: [PATCH 4/9] target/s390x: Use Int128 for return from CKSM Date: Fri, 21 Oct 2022 17:30:01 +1000 Message-Id: <20221021073006.2398819-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221021073006.2398819-1-richard.henderson@linaro.org> References: <20221021073006.2398819-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52c; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52c.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" Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Acked-by: Ilya Leoshkevich --- target/s390x/helper.h | 2 +- target/s390x/tcg/mem_helper.c | 7 +++---- target/s390x/tcg/translate.c | 6 ++++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/target/s390x/helper.h b/target/s390x/helper.h index ba9ed11896..16045b6dbe 100644 --- a/target/s390x/helper.h +++ b/target/s390x/helper.h @@ -103,7 +103,7 @@ DEF_HELPER_4(tre, i64, 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) -DEF_HELPER_4(cksm, i64, env, i64, i64, i64) +DEF_HELPER_4(cksm, i128, env, i64, i64, i64) DEF_HELPER_FLAGS_5(calc_cc, TCG_CALL_NO_RWG_SE, i32, env, i32, i64, i64, i64) DEF_HELPER_FLAGS_2(sfpc, TCG_CALL_NO_WG, void, env, i64) DEF_HELPER_FLAGS_2(sfas, TCG_CALL_NO_WG, void, env, i64) diff --git a/target/s390x/tcg/mem_helper.c b/target/s390x/tcg/mem_helper.c index 5a299ca9a2..bb6714aee4 100644 --- a/target/s390x/tcg/mem_helper.c +++ b/target/s390x/tcg/mem_helper.c @@ -1350,8 +1350,8 @@ uint32_t HELPER(clclu)(CPUS390XState *env, uint32_t r1, uint64_t a2, } /* checksum */ -uint64_t HELPER(cksm)(CPUS390XState *env, uint64_t r1, - uint64_t src, uint64_t src_len) +Int128 HELPER(cksm)(CPUS390XState *env, uint64_t r1, + uint64_t src, uint64_t src_len) { uintptr_t ra = GETPC(); uint64_t max_len, len; @@ -1392,8 +1392,7 @@ uint64_t HELPER(cksm)(CPUS390XState *env, uint64_t r1, env->cc_op = (len == src_len ? 0 : 3); /* Return both cksm and processed length. */ - env->retxl = cksm; - return len; + return int128_make128(cksm, len); } void HELPER(pack)(CPUS390XState *env, uint32_t len, uint64_t dest, uint64_t src) diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index 63ce131cbf..224046551f 100644 --- a/target/s390x/tcg/translate.c +++ b/target/s390x/tcg/translate.c @@ -2041,11 +2041,13 @@ static DisasJumpType op_cxlgb(DisasContext *s, DisasOps *o) static DisasJumpType op_cksm(DisasContext *s, DisasOps *o) { int r2 = get_field(s, r2); + TCGv_i128 pair = tcg_temp_new_i128(); TCGv_i64 len = tcg_temp_new_i64(); - gen_helper_cksm(len, cpu_env, o->in1, o->in2, regs[r2 + 1]); + gen_helper_cksm(pair, cpu_env, o->in1, o->in2, regs[r2 + 1]); set_cc_static(s); - return_low128(o->out); + tcg_gen_extr_i128_i64(o->out, len, pair); + tcg_temp_free_i128(pair); tcg_gen_add_i64(regs[r2], regs[r2], len); tcg_gen_sub_i64(regs[r2 + 1], regs[r2 + 1], len);