From patchwork Fri Oct 21 07:30:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 617162 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp842240pvb; Fri, 21 Oct 2022 02:21:15 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5Jjunmh6Omvy6nzsGL0aT4zfNtRPm2ZIu+78kPRUZZprsvzwKZSxQPEYLokVZrd+f0o71e X-Received: by 2002:a0c:e087:0:b0:4b8:ff9:f760 with SMTP id l7-20020a0ce087000000b004b80ff9f760mr7073676qvk.52.1666344074921; Fri, 21 Oct 2022 02:21:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666344074; cv=none; d=google.com; s=arc-20160816; b=Ac4e9hOyMCNQGRcjIs1093VcsIrMCiTnaUiqDZ/mHl2IY+EtEKbJR25fqkT9XD7hrU yRdgWf3U4prC3/2USZhNjKfKF3ZNn1o7FVe8PsF8uYz0YD9uqG/T5VnDqT025NSPF9H+ G3oazBMnOBVLFmODMtbezYBTR/1TE+VE3F53qFX/6b42JObPXV9gdQBsbWmKPerZQ5JT nsw8Kiriqty6D33YZCzchswUjyBmp6NWos5R8RinETfZcXNPGMS4ZZjxkyQaP2zAX77e aQEOpxo+WDskD6/2dM4EFNNKNGNDL2wWyT+64Hz8wTnki2umMvKxx+80hPaEd/zP0FGe Du3w== 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=hLRrIVuBZjjDNeiWycMrRFTB0ofq8rCekDwEI69XsFA=; b=WejTNwBwT40GLVFpMFIeqi1mr2iZiUYU5k5dkJqt2UFWTCngLWdWIk6XpsI4jqRIKV XyxHzs4xQ3Oq4RC08y7AT/In2FKd9m0k1RtZG+DHB6pJhK0W+2TW483Z/YbTccj/vTMb YFQJnPJt/NxNnTf6eWLXEW+op0ccPbfm4oGeRpDIn9Kfbcanwm4DmJCMFo27TO7zwoEk TBaYeYJb+kS7yo9S0NBrVjyWw0hbBXxLpYMXD2urAHi/NfLj+P/xjLUAdjVl1dZG3MMk SA6Xsn8p9YKKzq0yeVMb5dGy9/wRKNyC1ridCvgUg4tFnlSuOMCGRKC91FPeC3aw384n HlOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jpxqPx4Z; 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 js4-20020a0562142aa400b004b1a94e3a30si11998007qvb.244.2022.10.21.02.21.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 21 Oct 2022 02:21:14 -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=jpxqPx4Z; 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 1oloDK-0002eA-Du for patch@linaro.org; Fri, 21 Oct 2022 05:21:14 -0400 Received: from [::1] (helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1olmVL-0004XH-3n for patch@linaro.org; Fri, 21 Oct 2022 03:31:43 -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 1olmUq-00045h-LG for qemu-devel@nongnu.org; Fri, 21 Oct 2022 03:31:16 -0400 Received: from mail-pg1-x52b.google.com ([2607:f8b0:4864:20::52b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1olmUX-0007vO-P6 for qemu-devel@nongnu.org; Fri, 21 Oct 2022 03:31:12 -0400 Received: by mail-pg1-x52b.google.com with SMTP id u71so1849657pgd.2 for ; Fri, 21 Oct 2022 00:30:53 -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=hLRrIVuBZjjDNeiWycMrRFTB0ofq8rCekDwEI69XsFA=; b=jpxqPx4ZVIuC6IeJK1iNJYFDG5qoKnS1SEmgc/2uxhx0iNlz2AvIFEA7FaFQs/Ewk9 2Z33XVw/S8OU64JID6R7BmQVv8CiLeBfL2gYfECpJr07dadgSJD4WVDUkomVeLl8MZVE NTNC7BrmJT9OhmGdtZNAscy1zK2f6hSzpLHwKcd9tl1vfRjmMPpsbMXfOdkoXwPKjWt/ 58mYwJUASr3osXByPGvDqlEZsGdXb9O+MsoW4+XR7TqEQUocewelc4RC6EeEUUm3eYEk 69bUZ31tyZw4DqYg+R5wlu1Xsi5r7uT5cQBPae68Qu17GV/0ZmDeyZFaucOKk9XCFgnD lfTQ== 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=hLRrIVuBZjjDNeiWycMrRFTB0ofq8rCekDwEI69XsFA=; b=n+kJUKPSifcZ3qMNO53ppVHDqQW5SWImz4UPenPRCpDDya02EIeS2eq2yve0F5A0E3 e6AZ0DZENb9Ga9VZUPAvgvlu1/zFYMIy3ADVkRhHmfBzeL7IqlmehGqnJigkP/2IbOOO WKGooPQple/5+XxqkbiU1Yc28Wu4FkcbkK8HnPPYJ1AWQBQ13U6t71aoQrYGcJTBne4f gkOURpAY6M7csoAmvLBPc2zp+tG2ubeUn2v598tFMYpMvUkq5aW1HDs/LdyTe0kvKsE8 1hjADfoEpsrOZfsxLb9VbLezVak/gaFdjR1JkxeWyXK+8Ol5Tef2qeqHhlsUAy31VOpK MUaw== X-Gm-Message-State: ACrzQf1g4OcBIg+hozehj4p7xIxgK0seoE+mzhVQ3oLHA8EhhKCWERm4 YX5oHK4Zpev3H6OnuYhXI6ZRv4nLprU//FyY X-Received: by 2002:a62:1a97:0:b0:562:5587:12d6 with SMTP id a145-20020a621a97000000b00562558712d6mr17707676pfa.37.1666337452404; Fri, 21 Oct 2022 00:30:52 -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.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Oct 2022 00:30:51 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org Subject: [PATCH 3/9] target/s390x: Use Int128 for return from CLST Date: Fri, 21 Oct 2022 17:30:00 +1000 Message-Id: <20221021073006.2398819-4-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::52b; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52b.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=unavailable 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 Signed-off-by: Ilya Leoshkevich --- 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 29986557ed..ba9ed11896 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 3758b9e688..5a299ca9a2 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 a3f5a55891..63ce131cbf 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; }