From patchwork Thu Oct 19 18:29:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 735597 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1667763wro; Thu, 19 Oct 2023 11:33:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGw/J3JSV2nm+M1us3StRteiKL3uwH4CvRgkwwdVjgYoTNX95hgNvmNUTaLhI3Snj09cvFT X-Received: by 2002:adf:ec0f:0:b0:32d:ae31:4595 with SMTP id x15-20020adfec0f000000b0032dae314595mr2170571wrn.65.1697740380116; Thu, 19 Oct 2023 11:33:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697740380; cv=none; d=google.com; s=arc-20160816; b=AH3bdRM5Q+quePE5zt8J/PKHUcI5zU67v/+ZVEXIL//MgxKPjHwdn7qjXVxOP+hbB4 Sn30z9UI3Jvk525GIWP2Ag78O5z7/urjJ2XilzcSg5/TwUWxjxa7zmgOTmA2P56ljy5q QG7sjoXo5PZzCm5I36YE2OjD93Vl+EiDcWFvwifj8QwOHMv5v6slo0H+edmOZnE3UQHc y8FF0JQdWX5cQSKmNuf+jONOfhclOwVbjOZMoDJvzqfZ8j6ib78tL/7gxgZaVFhjq5U5 Zx1L+46f9SL3SC+6ToLmK7SBOrnnitD8Vs7vt1t04rQwAmJTmAl1A75LcdGSL9q8eLnQ 93Hw== 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=tq79fEqaZfxncWlnhMXIKSET4c6RLRriTWIQt92yq8w=; fh=rp4SvMZyvufgLOIbJsYRQQ45Pxd1jVTSEU6q8ruBOWo=; b=s6AOIAPU5fci+W4LveTKSuSXnuw15ZArWwTRPw4nl82a1DCEbR2ewPpbJMa8KOpHbd vDYUil8Vv1ielaJArseeqiuzDP/4F0nPya6CMYNTswrWsZYJnNpGsEJi7+XfLmBZ74hs fmZiQXqml8m8OHrqzLJuDz4tyY+ZwD40RXM6z9njfU7CCJ2PZgDm4Gq+EPcepq6aQCSL vdZ64RLYCmZi5aSivJxRiT5nO/HAXSuFGKmiRNv2xMzvN/nMeR3R2N1K0MC3x2+FeHgX qSl0B8m5EeQOwHPZ0akhREU6XzveebMY/aHQtXNMaV9wfMQ+mwt5yIKXdE07n9DZ3hkD qUZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JtyS7KTy; 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 b18-20020a5d6352000000b0032db012cdf0si2979745wrw.621.2023.10.19.11.33.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Oct 2023 11:33:00 -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=JtyS7KTy; 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 1qtXmG-0001wS-9D; Thu, 19 Oct 2023 14:29:48 -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 1qtXm3-0001EZ-O5 for qemu-devel@nongnu.org; Thu, 19 Oct 2023 14:29:36 -0400 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtXm2-00070J-0F for qemu-devel@nongnu.org; Thu, 19 Oct 2023 14:29:35 -0400 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-692c02adeefso27526b3a.3 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=1697740172; x=1698344972; 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=tq79fEqaZfxncWlnhMXIKSET4c6RLRriTWIQt92yq8w=; b=JtyS7KTy1ie5zGUkNihJrRy7pnfBos5uFWe9HAFkObkiPzUNGw2gC+m0x5Ppq5vBwC Xj86FldBqC9pt5ExlfNZ7BRTLTBir+vVOSbmvu+bj4NT8L1x09YFikRVMTVBrrq1VKVY TOVkhWzy92betSs4FTo+VEatGar7TIG+zzkWmErR2tPAlQ8GCCL69tjH86cy0F8sHOHF DChlTAO/HJdQWEYgsbP/q0LxaBOkiqO7Ja9bVvaxoidThHYjEPrdaNjXyBfiHJwRpxAh d3QFHKtJ8TvvUv/Xw+NeSM66U2aFHXfypGc5zZ8aqPJT7KSmJ4Wha0LolEU5ti6eMiSx yntA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697740172; x=1698344972; 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=tq79fEqaZfxncWlnhMXIKSET4c6RLRriTWIQt92yq8w=; b=vyN4amfz2khQh+YX6P6fDI5HFCPr62j+3RjtYydUxoVMycpLLXOVGMa5dUIJrLfG4w +F2vZ4xrVxZzFvFSYY22mEattWDzrv6oT2VNwCBAbJc6DSeg+m7IeAJgRw0sTJCmUL0m KZtWf8nrRvZiS8Fh0U2Rt7HkFVy5nCS7EOvk8L2VjS9ZqtI8hXehS4fW1GGNaMBDad66 LY29Vs2ttfbr7vjj/xtuz7gde5fTS73wU8xS7v799awlEPGyiR1xucKkzi8SMeoC2eG9 SChJbKcZV+YIeKDLqoodxvAEmdmVxQ9xVL04isTMvxmcBoMNRDK8kN4TrciHdHta1UZU TLGw== X-Gm-Message-State: AOJu0Ywg+OOXTyaSYbx9CC79QyMGnI5PyhJJgJQutfaeXIIl+k8sV1q5 0k409o5N+zJ/dF4jD39+VBzFCjHz4X7zypXDTlQ= X-Received: by 2002:a05:6a00:b91:b0:6be:2e07:5c5c with SMTP id g17-20020a056a000b9100b006be2e075c5cmr3153002pfj.20.1697740171802; Thu, 19 Oct 2023 11:29:31 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id e1-20020a630f01000000b005b856fab5e9sm72216pgl.18.2023.10.19.11.29.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 11:29:31 -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 4/7] target/m68k: Use tcg_gen_ext_i32 Date: Thu, 19 Oct 2023 11:29:18 -0700 Message-Id: <20231019182921.1772928-5-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::42d; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42d.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 We still need to check OS_{BYTE,WORD,LONG}, because m68k includes floating point in OS_*. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/m68k/translate.c | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/target/m68k/translate.c b/target/m68k/translate.c index 4d0110de95..4a0b0b2703 100644 --- a/target/m68k/translate.c +++ b/target/m68k/translate.c @@ -520,21 +520,9 @@ static inline void gen_ext(TCGv res, TCGv val, int opsize, int sign) { switch (opsize) { case OS_BYTE: - if (sign) { - tcg_gen_ext8s_i32(res, val); - } else { - tcg_gen_ext8u_i32(res, val); - } - break; case OS_WORD: - if (sign) { - tcg_gen_ext16s_i32(res, val); - } else { - tcg_gen_ext16u_i32(res, val); - } - break; case OS_LONG: - tcg_gen_mov_i32(res, val); + tcg_gen_ext_i32(res, val, opsize | (sign ? MO_SIGN : 0)); break; default: g_assert_not_reached(); @@ -1072,15 +1060,10 @@ static int gen_ea_mode_fp(CPUM68KState *env, DisasContext *s, int mode, tmp = tcg_temp_new(); switch (opsize) { case OS_BYTE: - tcg_gen_ext8s_i32(tmp, reg); - gen_helper_exts32(tcg_env, fp, tmp); - break; case OS_WORD: - tcg_gen_ext16s_i32(tmp, reg); - gen_helper_exts32(tcg_env, fp, tmp); - break; case OS_LONG: - gen_helper_exts32(tcg_env, fp, reg); + tcg_gen_ext_i32(tmp, reg, opsize | MO_SIGN); + gen_helper_exts32(tcg_env, fp, tmp); break; case OS_SINGLE: gen_helper_extf32(tcg_env, fp, reg);