From patchwork Fri Nov 11 08:08:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 623712 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp631053pvb; Fri, 11 Nov 2022 00:20:59 -0800 (PST) X-Google-Smtp-Source: AA0mqf5pKrv9QfzzqhtPWXV/afR5JLfycdByG/fexngtD/g0QEmPtMTYbj7vn89qpYgPt5iw8U2Z X-Received: by 2002:ac8:518d:0:b0:3a5:1dde:dcee with SMTP id c13-20020ac8518d000000b003a51ddedceemr377188qtn.639.1668154859501; Fri, 11 Nov 2022 00:20:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668154859; cv=none; d=google.com; s=arc-20160816; b=XBIGkqL14pht1rWa0HUa9t/rPiyg8YiPJ02kJhmGouF0cCTsHF1o7xByPwfcY2hBIf fwR4t5VPQUjumtRpMO3TH9/c5z/xCWI0KynrN6xg0s3TIN/HRmaW4YjR1oNQTFUjUd91 5tuNXwxzdb1Sr6HRHYQSGebJXuib5SIilwdJZ8YZeqWuoy4+OVkRtTbd5NBm3xDtSoS6 W0cCwPSoURAYmCs74c3BS1QTJDpRA2oEspreopzJyPvi2YARAVF8QaOQWavTaoqiljrN gXbkb43yxwxPF8nAdOY3VRDl0jpxHLQpPmgf+Li/tRi9a1YPVtwl3lWc1dXeIIsO1FgL ASng== 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=1D0Cnl/RU9i2YfiOcMFXKWOM1DM6G1t5gEDWgJX7LZc=; b=qQCvF1TXeqJI/k9VfS7x9J2Px7Ka0C6wBf/OxRYXeInA1DNGudjqXggt2vmY+bHbg1 VO68b0QBYKojjVF5FQS5BtGC4Tc5HmTcbmIU9rLL9Vw3bYU17dry6T8aj494FJ/TNhsf 9updV0IyxOP1qSW5atPer8fEn/9gCNlMrAiFtKJhLs6ADpA5+WU2RqpvwORwo9QIeSzv jwZk5MuiId8mMpfohispgpoQxcaKi+MFbc5jIoI7vX5Wl4C41igs5KvtJmUfamtmRw6f kXrnybu6v1aTB/Zox1fjHUGPdWEPjeuVXh9amLAZ1rWwuLTD7qD6PTcBJ28KyVbDY5Nj cvtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=smpvuRgM; 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 c7-20020ac85a87000000b0039cc8561f1csi752768qtc.716.2022.11.11.00.20.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 11 Nov 2022 00:20:59 -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=smpvuRgM; 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 1otP6X-0001Sz-OP; Fri, 11 Nov 2022 03:09:37 -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 1otP5n-0001AG-FN for qemu-devel@nongnu.org; Fri, 11 Nov 2022 03:08:52 -0500 Received: from mail-pj1-x102d.google.com ([2607:f8b0:4864:20::102d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1otP5k-0002Fy-HR for qemu-devel@nongnu.org; Fri, 11 Nov 2022 03:08:49 -0500 Received: by mail-pj1-x102d.google.com with SMTP id u8-20020a17090a5e4800b002106dcdd4a0so7146668pji.1 for ; Fri, 11 Nov 2022 00:08:48 -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=1D0Cnl/RU9i2YfiOcMFXKWOM1DM6G1t5gEDWgJX7LZc=; b=smpvuRgMHa6U/h3s7Cv5SXiB/+tLCqu+8t/c7fi3xE0f1EdZ5jaFwl7TSJMB1u8DIc AmAS+7leS0aoUQVaWp0plbXJOVfA+Vr3HEUMVjjTpM6XOin/TsIaJ7j0TY/FpnlcFL3G OcA6dFo2UzjQa3HdrmZLGFXNAH0w1G7YQM/s+ifbxJXF7LjnL9pQIne+S2oNjX6+4gy3 qBBwqS8ehLO/tP31UCoBgQJ4uvDyDxhVgukpQFGkWPLoJrDuHLwJir2iD4mUDcEIo7k0 nz4Xei90Lm1rHNQpb9Q8XrltK7rw9h8JwL3EaK9WiS4Jhiq5OYdIABUCsUHhbO96Mx4V /KjA== 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=1D0Cnl/RU9i2YfiOcMFXKWOM1DM6G1t5gEDWgJX7LZc=; b=O68gIPt0/u6rQ5ACVxFq8X4aCzDZL/DMGmWHE1/5lojuiFyYgXu9MGw05NnIQ/Tngf 9N23/J3CcSCm//wWvAgVBaRFPOfAkJPMFNoBlMs3WpGofry6bn5Cl7swJt57Jllt2gZy m2F2fOPFEddw1+FENUs9RVL8aPPJzgAGVdEN0JWHI11pBQ+mvFEoWbZWnEcMZm2LBsZ7 Lcwq709xnWv8Okb5DJRFxOzthUhnwsFYtS3THQh4vNCZWiYpajMU+pn25eazkh/5exVm 3eQt1/NEaGhC3Im1DbtTaK9t8jP4R6iyL+iNPSlm3i4j33Mosq5OCvDDWWh+zMcRUYRv Z/Dw== X-Gm-Message-State: ANoB5pl5T5VXdjV0SlLUaAAN2TKMD/FXNR52O1X4tqlB/vhrSZtgcf2P LnR+B/MexWli469GKeYpH2wqbCQgIVhYLxMK X-Received: by 2002:a17:90a:fa11:b0:212:6a0b:7d55 with SMTP id cm17-20020a17090afa1100b002126a0b7d55mr770734pjb.16.1668154127075; Fri, 11 Nov 2022 00:08:47 -0800 (PST) Received: from stoup.lan (2001-44b8-2176-c800-0aef-59aa-1faf-7e61.static.ipv6.internode.on.net. [2001:44b8:2176:c800:aef:59aa:1faf:7e61]) by smtp.gmail.com with ESMTPSA id j4-20020a170902c3c400b00186a2dd3ffdsm1046341plj.15.2022.11.11.00.08.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Nov 2022 00:08:46 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: iii@linux.ibm.com, david@redhat.com, =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PATCH for-8.0 v2 07/13] target/s390x: Use Int128 for return from CKSM Date: Fri, 11 Nov 2022 18:08:14 +1000 Message-Id: <20221111080820.2132412-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221111080820.2132412-1-richard.henderson@linaro.org> References: <20221111080820.2132412-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102d; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102d.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 | 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 3708faec0e..112ec35160 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);