From patchwork Thu Oct 19 18:29:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 735594 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1667155wro; Thu, 19 Oct 2023 11:31:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHRv+s83v/Ue4QPJY91YWgdFTjDInCtwZud3bcS9OaSQuLCpuCEluOnyhhFdMN4NMthl6GE X-Received: by 2002:a5d:4b05:0:b0:32d:8855:138d with SMTP id v5-20020a5d4b05000000b0032d8855138dmr2508459wrq.66.1697740285963; Thu, 19 Oct 2023 11:31:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697740285; cv=none; d=google.com; s=arc-20160816; b=JbWG0GNv48ihqQzyy8gJ/6ms47VnS397vnMmIkFYnt2FlYceKW6mKDGmYyvxwxjK4x awe8eCjI4a/yfEmgQB/Lhfzn7Dn4vxT0RN6oy/Tly2E3OfaO0eHKezM9aArC2g4hGtmr 0jey/lYFMQvKRMeWQ9vZ2BPzwaQRZ6ruXKOyzPJIGoP2H1kYMlfvPgWFNiTDxG2rKf4y W2QB/b7Wix2QJ04AEYCYXLgQ0rYD/5wasp4xSIrwsd2nq1lLxZH+ud1QUhUhzPfXXz78 o8/I2eyFs8AM/oMMyqJOe7p9oMLVOOJv3x8yJNjlqsuBmBN7F0BNgRN+chllahNdPZ9O bwcQ== 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=/9nFH074W8LbHLqCjcMRWprK189i8aGWQz4eNu3oG1o=; fh=rp4SvMZyvufgLOIbJsYRQQ45Pxd1jVTSEU6q8ruBOWo=; b=vFxoogoOs+N27dXC5uPCLEQ3K9VltaB6hZFuge+0J/Bm8DmPJYy+3PFSLvvZfxIzYy D1jHjkjLfNkgI/Z8SehNgMAZ/IqW6Nbp5rKTYQmTE24g1nk6fuJjD7VugDhET5oVpXej RQpr2LdWF6lUY3E490JzZCIRyUTuAvazPXk3yKcCZOsxZG7qGN+FwOEYDdtm7tS0pLbK 0JVGf5oWgNN88HSvva0OAGW+EHf0vd9AiIAvhp0cY084pHAeFaK19ec6SYBrak9UDMOB EBKvonQbV14laAHqIMcNnNwF1EFz/fDWEJmsyf1M0RgqLChdqe8lS+Ig+9BLlmzhuj9C SOQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zh0kQBnk; 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 f13-20020adfe90d000000b0032da83b58efsi3005208wrm.272.2023.10.19.11.31.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Oct 2023 11:31:25 -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=zh0kQBnk; 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 1qtXmE-0001gI-9g; Thu, 19 Oct 2023 14:29:46 -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 1qtXm2-0001CF-Lz for qemu-devel@nongnu.org; Thu, 19 Oct 2023 14:29:34 -0400 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtXm0-000702-Ky for qemu-devel@nongnu.org; Thu, 19 Oct 2023 14:29:34 -0400 Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-6bd73395bceso43195b3a.0 for ; Thu, 19 Oct 2023 11:29:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697740171; x=1698344971; darn=nongnu.org; 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=/9nFH074W8LbHLqCjcMRWprK189i8aGWQz4eNu3oG1o=; b=zh0kQBnkOyd5FEa6nqlPKJapwabOdbaN7nICILgOu35v+V0ZQk+R5zYI1i6T7tJYKO PJvzWxNKoKhZlA2DHugI3fbfppOEt+vgEFyDgqhAB1n3LnqQNfccSmXSl1j/hzEzclb2 OzehKDxLroEhFLfUsvj8JsnobGbIQdjXQxJYlxldDd7QfrxS45Q+02RKwm65JzteAaaj Xtogt7YiUE1cegFR846WpSS0cKr91iz7omLESsbAEd5KpGx5M1PUw+2DL1LipFEfQ4TB L0RZxCF9JWhQemtfoyE5fUvh0fRhHdvff5qYQEPVLPsvWkU0oaQ6jyDikrI245cnT1uA WljQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697740171; x=1698344971; 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=/9nFH074W8LbHLqCjcMRWprK189i8aGWQz4eNu3oG1o=; b=rKSqwmCM8NdfE2onWkkbRCensXepn8POspXG1plqtCoNZh/9k0aBDAS07wN/7SjvR1 bMMc/jGk96rSGl5qoMHy1euxwjhwqJ9wAEJyYdsXqkQi8APXdH1qw+L8Re+IcrLrxCOf sfPfG5L6MWoVxRiPrfljJ471PkRJ+E53brOdc0glPU5WHn/PCgmG2JLP8ebAWbA06DH8 8KykXZdE1p+OzUth6Klmr2t9yjOfkMlbCD6HCzYjyW8vKdHpN/pXUXJWrNAzyrQyeFV4 vSdFcloj8PFM/8ucHuTYZm/fhE9iLSaAEb7SqfwLszSRPboiMe3ybtik4WLFMrLMO19s 31WQ== X-Gm-Message-State: AOJu0YxJ6FWDv45A2HJ9jtPzMpTmSN886RA4RzOsRVJCkqOZS1+jGnrG qdR/UPwmCnQv+IQ4uhKSBmQQdTU8L6YuIgy3VKM= X-Received: by 2002:a05:6a20:3951:b0:15d:8366:65be with SMTP id r17-20020a056a20395100b0015d836665bemr4069051pzg.9.1697740170928; Thu, 19 Oct 2023 11:29:30 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id e1-20020a630f01000000b005b856fab5e9sm72216pgl.18.2023.10.19.11.29.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 11:29:30 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, qemu-arm@nongnu.org, laurent@vivier.eu, ysato@users.sourceforge.jp, kbastian@mail.uni-paderborn.de, jcmvbkbc@gmail.com Subject: [PATCH 3/7] target/i386: Use tcg_gen_ext_tl Date: Thu, 19 Oct 2023 11:29:17 -0700 Message-Id: <20231019182921.1772928-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231019182921.1772928-1-richard.henderson@linaro.org> References: <20231019182921.1772928-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42a; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42a.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-bounces+patch=linaro.org@nongnu.org Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 0c81e066de..d420ed8f0a 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -701,33 +701,11 @@ static inline void gen_op_movl_T0_Dshift(DisasContext *s, MemOp ot) static TCGv gen_ext_tl(TCGv dst, TCGv src, MemOp size, bool sign) { - switch (size) { - case MO_8: - if (sign) { - tcg_gen_ext8s_tl(dst, src); - } else { - tcg_gen_ext8u_tl(dst, src); - } - return dst; - case MO_16: - if (sign) { - tcg_gen_ext16s_tl(dst, src); - } else { - tcg_gen_ext16u_tl(dst, src); - } - return dst; -#ifdef TARGET_X86_64 - case MO_32: - if (sign) { - tcg_gen_ext32s_tl(dst, src); - } else { - tcg_gen_ext32u_tl(dst, src); - } - return dst; -#endif - default: + if (memop_size(size) == TARGET_LONG_BITS) { return src; } + tcg_gen_ext_tl(dst, src, size | (sign ? MO_SIGN : 0)); + return dst; } static void gen_extu(MemOp ot, TCGv reg)