From patchwork Tue Jun 29 18:54:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 468372 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp5270636jao; Tue, 29 Jun 2021 12:59:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyeF5V8uW7xyMIwjR/OjJN1ln87hfhuRCPV5zVRXdl4B1TjPsUD12kCaWIsyYkc+I71m+4M X-Received: by 2002:a25:744c:: with SMTP id p73mr18757720ybc.201.1624996739915; Tue, 29 Jun 2021 12:58:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624996739; cv=none; d=google.com; s=arc-20160816; b=T+/E4gt2VxWXMNn3XSkgZEaeL4cK7/3t0cis5VjA2qplyz3l1mxXGCqWJw9uL+meIf Q6lvp3ME6Wd4wJws3YOkHFLxfBzvkYK7/AYzRj57wSWT2VW48ZbJzatYhb+ahXTuZOsG gnqs2D4RXbSAwzdnFUNHP0ROF1Ll6iXuuQMKVdPa+pzPubaaHv2mN8SzbUL1gBGeS17/ eXpk+jBF8erEjpvjUKhgZPrLa377SRhzWbf0HLIwC/3cipzZVE7lPEstz8NwTSIzy6dL cwB1REb7WceA/GI8IQwzO40TMTMGg9yBaXIzsvKMEVvi5VCrLWxWXymC+yZYn4BohULL nwbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=uxQeR//xqY+LsX6pm6SBoWME/fdGKFQJm9ucGcJi4j0=; b=RoAcm6QMjUnLxKLCxHUOlw9/9bH49m2l6GdYnDfjlW+LYP59AAzlh4xohseoNoXJT/ oGiW7oVlVvmMBZaGUekCatMQ+rL+YE2VGwBA8/pfK4DuwsarRfI0rwVMarBLA8nueA8l gZopgqICwbZFx7+qY1tk94tqC8H1kdTkYKj19RMAAT5oaRVhTH8W9OaXy8aP1uOsgDg5 nRG846jUhz4eon92lCpJ8lLvQ5Iw65ipGiSGe7nd4lBG77nasvQsYyuz859yPOmSXIO6 ZMZShAau+7cWJQFdn3/RGzquc8vHSzXWV+RselGyVDoTpodWw4ioINTTw53G8sFUzwjY Whsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GMTTfxkL; 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 d206si7867378ybh.409.2021.06.29.12.58.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 29 Jun 2021 12:58:59 -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=GMTTfxkL; 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]:57822 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lyJsp-0005bx-Ak for patch@linaro.org; Tue, 29 Jun 2021 15:58:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39876) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lyIwl-0004LE-UJ for qemu-devel@nongnu.org; Tue, 29 Jun 2021 14:59:00 -0400 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]:34363) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lyIwQ-000323-8G for qemu-devel@nongnu.org; Tue, 29 Jun 2021 14:58:59 -0400 Received: by mail-pf1-x42e.google.com with SMTP id i6so132539pfq.1 for ; Tue, 29 Jun 2021 11:58:37 -0700 (PDT) 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=uxQeR//xqY+LsX6pm6SBoWME/fdGKFQJm9ucGcJi4j0=; b=GMTTfxkLRL/Xcfw/UxsY5I7tjyyEb6w00T2iSBQHB61yBy5y3T42kOKVgDr0fm5MjA B/GNkCvbHTerURCAQYAHVGVjOdK9yTosEuUseocW9ERcISokittlOd2nXOIBQBtzErqE 6fOOd4/fOh8VrFe7SGgB0IYQoBZJr/cxvTTfjgkrUyCfOyMWzxoPEGxZMxGpXCg300PX CWGydEDKd7hW0or+8xNbaTF+0XH2RzCy/jp160BDs8lKRCdy3EJJbWZvpnOlyAx04OIy XAki4Se76AdCGNjpO5hy6Le6wovwbyHg9EhtiT8MVWD49PLpBRBdrWp3pBEW1brTzFlG RgyA== 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=uxQeR//xqY+LsX6pm6SBoWME/fdGKFQJm9ucGcJi4j0=; b=jw9RYdRgv68WqQnaldBGDjMchfwKg42zCLrLWNWUsdto7V99gdB9to3upDpwDP3THs ug0U+T8aHS2L7/1je45kKTd6/AdYAXlwrnzXUOsBggl3ZmbOk2+71xoKJU/54CiH9+Gn +DyuWHsmzJR9uJVeQyVodGRjGZ363i0CeiNHRCvFDAEq/oAUXvRJLL6QcnbFZTKScq3P ACuSXxF4dBMNS/AFnLBs01AV8MKUovczLAGu1hcotMm6t0SNTuynER8cD78HeHznZ9Ua yUEYVj+v4kSjzImKljZ99znDBzzhwEGLrKpNwSL4dczI/8d8AsljwbMYMTapHOGXYRz1 h2Sw== X-Gm-Message-State: AOAM53292bdoTho/WuFKqDU3MN8fIi9jIyNOhzdHDimdaE9xKkvlJ0Wq qMswZePvJjklfXvKtWf/P8Mx4loIcA8Rlw== X-Received: by 2002:a65:6441:: with SMTP id s1mr7155970pgv.214.1624993116416; Tue, 29 Jun 2021 11:58:36 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id 21sm18002849pfh.103.2021.06.29.11.58.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Jun 2021 11:58:36 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 58/63] target/i386: Improve bswap translation Date: Tue, 29 Jun 2021 11:54:50 -0700 Message-Id: <20210629185455.3131172-59-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210629185455.3131172-1-richard.henderson@linaro.org> References: <20210629185455.3131172-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42e; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42e.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 Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Use a break instead of an ifdefed else. There's no need to move the values through s->T0. Remove TCG_BSWAP_IZ and the preceding zero-extension. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/i386/tcg/translate.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) -- 2.25.1 diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index e8a9dcd21a..b21873ed23 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -7195,17 +7195,11 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) reg = (b & 7) | REX_B(s); #ifdef TARGET_X86_64 if (dflag == MO_64) { - gen_op_mov_v_reg(s, MO_64, s->T0, reg); - tcg_gen_bswap64_i64(s->T0, s->T0); - gen_op_mov_reg_v(s, MO_64, reg, s->T0); - } else -#endif - { - gen_op_mov_v_reg(s, MO_32, s->T0, reg); - tcg_gen_ext32u_tl(s->T0, s->T0); - tcg_gen_bswap32_tl(s->T0, s->T0, TCG_BSWAP_IZ | TCG_BSWAP_OZ); - gen_op_mov_reg_v(s, MO_32, reg, s->T0); + tcg_gen_bswap64_i64(cpu_regs[reg], cpu_regs[reg]); + break; } +#endif + tcg_gen_bswap32_tl(cpu_regs[reg], cpu_regs[reg], TCG_BSWAP_OZ); break; case 0xd6: /* salc */ if (CODE64(s))