From nobody Wed Dec 17 05:38:24 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1612565991; cv=none; d=zohomail.com; s=zohoarc; b=eNGDX6FQgNzsjR3wKUyBAvSA+DhXF0kZGSQJlPIiPy0pNYJPW4vjIMvzWOSHits0jLaqSaHuVoR2wdiOPujdpgFnPPqppJ625h29OKMip7GYGltaPr2ItVhg0woeu44qGp04lFKzA0Zajn/sm+Xy5cYGb18jnXZnCoFRCNSzOAk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612565991; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=5/ZgyQAuQvE4YcOG34t++03WUxcDnhNMW/sElkvFii8=; b=RLvs66tW+Pgn9TcIGThHAnvK1mje6mMuhVoCdVphGmp6KB2vroJPS+3XnCrDJFlrRGUMoUkYQNIhKs5Zv79bRioF/RhMcNhCIRf+930Jx3thc5+/avA9GbjyAHt9t4NN6i+EjycNqtHFThOKQ0aaKuiyUduAljqQaaYlFvrw4sA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1612565991888776.1990521582904; Fri, 5 Feb 2021 14:59:51 -0800 (PST) Received: from localhost ([::1]:48470 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8A4s-00059k-Qo for importer@patchew.org; Fri, 05 Feb 2021 17:59:50 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:58952) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8A28-0001CS-Bp for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:57:00 -0500 Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]:34043) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8A26-00039E-QJ for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:57:00 -0500 Received: by mail-pg1-x532.google.com with SMTP id o7so5596249pgl.1 for ; Fri, 05 Feb 2021 14:56:58 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id c23sm12155149pgc.72.2021.02.05.14.56.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 14:56:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5/ZgyQAuQvE4YcOG34t++03WUxcDnhNMW/sElkvFii8=; b=Sm2DRgcaealHOz6DVWja2oTH7ZYjsKCP9FKO/tiksAfYErg9t6Mp43YGDVYEEi5lYE spmLKi8Y6MOxzKH57JRnw2EeEt7czJGgb0705w+HGLadSUhJo654pSU5M4n3Hc2CEVyW gq9T6YtQ3lEps9GtREfxNIsP3BVhBeMLpP1LIUO3OjFpOlU1tS3lib19ZAFjwLDKwasv bYeQqG3yDfDrZjvoLmQltPN+1IMuRBVamT7Fht2g5xaUIZpkies8PmXfFWl/B54yZaBG J7v94qywKLlaBDcIoiaiq7WRZ4We/nlkC8Mmp0L46xLnnjhNoKGOOZwh47zU6xX0mcEd iRnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5/ZgyQAuQvE4YcOG34t++03WUxcDnhNMW/sElkvFii8=; b=P/fl7LiDLSqxDm2qHmE6Yyj4lG53oK+Wxw4r1ciAf3vGTnIRPScu9AB4y01HiXRteI g++ZvoPAutYRxJgpVPOeGIaV2A4Bf9wP+ucNa7oj74e3RODWW42gUSipNlypSbNHmZBV IQrqNHOHMLvC/3BH0GsS7/KCvWkjM0qVULWRuO9VyxpK6neV5NGRITx6YI1UgefqyAn+ GS84Z5C3a5ssQffneM38gAKL68rxefIiwmDgVkjKrQmrPNxrtoEfYpPgXRCVgkUJbuB3 Px8eh6MX4F37FlNEpEzMzjerLOnddjbV3IpUY0gjSQhXdzpWB/MlMOfNVGvIKGQGauTM YHJA== X-Gm-Message-State: AOAM530rvz0OqXz+YZmxqTVUl9M73hnzzZyCjMlK51ldYSJfu3IIhPQP 7tpKYTzPOaDmtM1JI21DjBQRWoGJEtR+5Juf X-Google-Smtp-Source: ABdhPJyOs5BxPpbK8QhT0kj4SDDR5+3mgVIqBSov6UC205J1M6j9gd7PwN4rB1XBMEPUKGxUdi/rAg== X-Received: by 2002:a63:2306:: with SMTP id j6mr6591705pgj.187.1612565816421; Fri, 05 Feb 2021 14:56:56 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 01/46] tcg/s390: Fix compare instruction from extended-immediate facility Date: Fri, 5 Feb 2021 12:56:05 -1000 Message-Id: <20210205225650.1330794-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210205225650.1330794-1-richard.henderson@linaro.org> References: <20210205225650.1330794-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::532; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x532.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, David Hildenbrand , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Richard W . M . Jones" , Miroslav Rezanina Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Philippe Mathieu-Daud=C3=A9 The code is currently comparing c2 to the type promotion of uint32_t and int32_t. That is, the conversion rules are as: (common_type) c2 =3D=3D (common_type) (uint32_t) (is_unsigned ? (uint32_t)c2 : (uint32_t)(int32_t)c2) In the signed case we lose the desired sign extensions because of the argument promotion rules of the ternary operator. Solve the problem by doing the round-trip parsing through the intermediate type and back to the desired common type (all at one expression). Fixes: a534bb15f30 ("tcg/s390: Use constant pool for cmpi") Tested-by: Richard W.M. Jones Reviewed-by: David Hildenbrand Reported-by: Miroslav Rezanina Reported-by: Richard W.M. Jones Suggested-by: David Hildenbrand Suggested-by: Eric Blake Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20210204182902.1742826-1-f4bug@amsat.org> Signed-off-by: Richard Henderson --- tcg/s390/tcg-target.c.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcg/s390/tcg-target.c.inc b/tcg/s390/tcg-target.c.inc index b67470137c..695d7ee652 100644 --- a/tcg/s390/tcg-target.c.inc +++ b/tcg/s390/tcg-target.c.inc @@ -1067,7 +1067,7 @@ static int tgen_cmp(TCGContext *s, TCGType type, TCGC= ond c, TCGReg r1, op =3D (is_unsigned ? RIL_CLFI : RIL_CFI); tcg_out_insn_RIL(s, op, r1, c2); goto exit; - } else if (c2 =3D=3D (is_unsigned ? (uint32_t)c2 : (int32_t)c2= )) { + } else if (c2 =3D=3D (is_unsigned ? (TCGArg)(uint32_t)c2 : (TC= GArg)(int32_t)c2)) { op =3D (is_unsigned ? RIL_CLGFI : RIL_CGFI); tcg_out_insn_RIL(s, op, r1, c2); goto exit; --=20 2.25.1