From patchwork Thu Aug 31 03:07:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 718947 Delivered-To: patch@linaro.org Received: by 2002:adf:e5c2:0:b0:31d:da82:a3b4 with SMTP id a2csp244377wrn; Wed, 30 Aug 2023 20:08:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHlRVKP0bY9hV+7NNoGbEFqTfpT1WO0UJ1A8GRS6g+1hQaCLHurrekdOV2A8DHLN5peTTHd X-Received: by 2002:a05:6214:5087:b0:64f:60c3:39ff with SMTP id kk7-20020a056214508700b0064f60c339ffmr1731019qvb.41.1693451281819; Wed, 30 Aug 2023 20:08:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693451281; cv=none; d=google.com; s=arc-20160816; b=LnqFkvL23QeOIvuwhC9MciJqDMxdqMTxruYhjbSjzfsN5Gz17vZbpc8pIWNXzj5Eq6 kIXkZ+YYO8XB+Pw9FeVrC/TLwegwuK9mYKzngHphj5aHZzoSmpkN73IFolnvto0eDVxq S8ZsPyOVNoBlSBvRE5X9++w2T7lf3KbWkYkuONn5pUdnmU/2A29GfMH7oSvDg8rdOor/ Q2HB7in5cyK7DViwOXe2EFZot7V1zc3bN4iTBtoL6S3NKAeiXyGyuUkD8KUISKTq91xf efr1ITnot3TVMHOXPXbJCnb5glFLfsNXy3ve79qZtzDLrPOpj7hq3UxVfm/383i2fNYF jnug== 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:to:from :dkim-signature; bh=JsBwcmai69DwtSy3p5qDNG9Z2ep35wWirnfrfJquRn4=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=hpSwVU4vWHhIjqrdPLeCK9zjMOo1D8LNMxGaYBu2MatoOLtaOSBoEQ3n2Gyhv6b/nr VYmrr2pdhUXM+VHgU45Eg+bRI7n3OCGUOPxHg8fQVx1oGzesc4/4PXtw50dni2EZVVFo 2kXeS3xRJVh1LN3QshIe15VKAm49kYU91Oz/SPemd+lT4GiPY94uVviiHwdLbpQmZxgW bRkNLY47l7JFYrhbY8R71dN5pnVT1GLIu4UU7+ir0CBglaBRQx2P3WcTURxZ205x9FZI +Br1xIWIigR0W667wdavni4ffdbDXfgdEkraggrYdL/GKSf1cmd3ONnlhKs6RHbfOOhU M6/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UmFgATo9; 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 i15-20020a0cf48f000000b0064c92f86b0bsi297913qvm.508.2023.08.30.20.08.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 30 Aug 2023 20:08:01 -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=UmFgATo9; 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 1qbY1k-0003YF-4R; Wed, 30 Aug 2023 23:07:24 -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 1qbY1i-0003Xu-AW for qemu-devel@nongnu.org; Wed, 30 Aug 2023 23:07:22 -0400 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qbY1f-00012r-Vq for qemu-devel@nongnu.org; Wed, 30 Aug 2023 23:07:22 -0400 Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-1c0c6d4d650so2666905ad.0 for ; Wed, 30 Aug 2023 20:07:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693451238; x=1694056038; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=JsBwcmai69DwtSy3p5qDNG9Z2ep35wWirnfrfJquRn4=; b=UmFgATo9WF9k871l77mqIW2ZZbBSWt9tfCqrfDwlw/pygMYYqp8KKotscM1PyxwoqU CF2Q2tW7d4V9HrIMqBehkwIlQG94vOHQyHGkH+co1AlwP6GQyq55tWH5qrjqlHBqMh8F GbuggpoLLh7I2lgQFEk3bjRhJLgARIvcvf2cUGw1aVLa5A2ddwk8hbKzWMN9pOt0lKVU 8+5DmQj4Zws0U80j50i3hNswfXhkhSmNeXp6jUL4sCYBcxQYRg8v/gJpeZvzOUteo1AE LUZ1RCikqisNdbB4hwCVBvBADXIrZAJTCGdmx7ypx1WRYlsZ67P1zzZsyh+UkM7UuqCJ 4iKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693451238; x=1694056038; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JsBwcmai69DwtSy3p5qDNG9Z2ep35wWirnfrfJquRn4=; b=gRleVMO6XVpJR6eKIqM8vnrCqpNHerrvKDUuRE9NB/WDb8hIeFbiHCXwAweEHXDlJs cJglueMvqnOBeZY/1X2rO9gkIblPY+B56wbWncTIlHUdeBi636/61MU0LlqTBhnw5I1H VTs5wYmbBeS/v10MXyJ1ag7Jw3ktv81z73rqz+qNlTGynKFW3z4f0iT3l2eojkK9qPyg aaBpSAk6xI2tXn+WKqdJ2NXH7kwlFGNP5Zby2H7KdtaI2GO5SHrTcEUTpcnQuRgzWgG/ EvZ5G2jjEN5PKlaS1F7nXV388LUWeIXw+2arVR2Qi/PXVoMfhar8H1xFi0UDQlMddkQ4 fV6g== X-Gm-Message-State: AOJu0YwwCS0CvrtN2CEhZQG8tPqXGA0fU8egwmcM9fpwcz/E0e8tfliI UTkhl9safEC84vD/X3EzH4oihNBMSn/cCNZ4sE4= X-Received: by 2002:a17:902:cec5:b0:1c0:ec66:f2b2 with SMTP id d5-20020a170902cec500b001c0ec66f2b2mr4708049plg.27.1693451238518; Wed, 30 Aug 2023 20:07:18 -0700 (PDT) Received: from stoup.. ([71.212.131.115]) by smtp.gmail.com with ESMTPSA id ju19-20020a170903429300b001b8c689060dsm228847plb.28.2023.08.30.20.07.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Aug 2023 20:07:18 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 2/2] target/i386: Use i128 for 128 and 256-bit loads and stores Date: Wed, 30 Aug 2023 20:07:14 -0700 Message-Id: <20230831030714.1194595-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230831030714.1194595-1-richard.henderson@linaro.org> References: <20230831030714.1194595-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::634; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x634.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.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 --- target/i386/tcg/translate.c | 61 ++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 34 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 90c7b32f36..bbcb81e908 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -2919,58 +2919,51 @@ static inline void gen_stq_env_A0(DisasContext *s, int offset) static inline void gen_ldo_env_A0(DisasContext *s, int offset, bool align) { int mem_index = s->mem_index; - tcg_gen_qemu_ld_i64(s->tmp1_i64, s->A0, mem_index, - MO_LEUQ | (align ? MO_ALIGN_16 : 0)); - tcg_gen_st_i64(s->tmp1_i64, cpu_env, offset + offsetof(XMMReg, XMM_Q(0))); - tcg_gen_addi_tl(s->tmp0, s->A0, 8); - tcg_gen_qemu_ld_i64(s->tmp1_i64, s->tmp0, mem_index, MO_LEUQ); - tcg_gen_st_i64(s->tmp1_i64, cpu_env, offset + offsetof(XMMReg, XMM_Q(1))); + TCGv_i128 t = tcg_temp_new_i128(); + + tcg_gen_qemu_ld_i128(t, s->A0, mem_index, + MO_128 | MO_LE | (align ? MO_ALIGN_16 : 0)); + tcg_gen_st_i128(t, cpu_env, offset); } static inline void gen_sto_env_A0(DisasContext *s, int offset, bool align) { int mem_index = s->mem_index; - tcg_gen_ld_i64(s->tmp1_i64, cpu_env, offset + offsetof(XMMReg, XMM_Q(0))); - tcg_gen_qemu_st_i64(s->tmp1_i64, s->A0, mem_index, - MO_LEUQ | (align ? MO_ALIGN_16 : 0)); - tcg_gen_addi_tl(s->tmp0, s->A0, 8); - tcg_gen_ld_i64(s->tmp1_i64, cpu_env, offset + offsetof(XMMReg, XMM_Q(1))); - tcg_gen_qemu_st_i64(s->tmp1_i64, s->tmp0, mem_index, MO_LEUQ); + TCGv_i128 t = tcg_temp_new_i128(); + + tcg_gen_ld_i128(t, cpu_env, offset); + tcg_gen_qemu_st_i128(t, s->A0, mem_index, + MO_128 | MO_LE | (align ? MO_ALIGN_16 : 0)); } static void gen_ldy_env_A0(DisasContext *s, int offset, bool align) { int mem_index = s->mem_index; - tcg_gen_qemu_ld_i64(s->tmp1_i64, s->A0, mem_index, - MO_LEUQ | (align ? MO_ALIGN_32 : 0)); - tcg_gen_st_i64(s->tmp1_i64, cpu_env, offset + offsetof(YMMReg, YMM_Q(0))); - tcg_gen_addi_tl(s->tmp0, s->A0, 8); - tcg_gen_qemu_ld_i64(s->tmp1_i64, s->tmp0, mem_index, MO_LEUQ); - tcg_gen_st_i64(s->tmp1_i64, cpu_env, offset + offsetof(YMMReg, YMM_Q(1))); + TCGv_i128 t0 = tcg_temp_new_i128(); + TCGv_i128 t1 = tcg_temp_new_i128(); + tcg_gen_qemu_ld_i128(t0, s->A0, mem_index, + MO_128 | MO_LE | (align ? MO_ALIGN_32 : 0)); tcg_gen_addi_tl(s->tmp0, s->A0, 16); - tcg_gen_qemu_ld_i64(s->tmp1_i64, s->tmp0, mem_index, MO_LEUQ); - tcg_gen_st_i64(s->tmp1_i64, cpu_env, offset + offsetof(YMMReg, YMM_Q(2))); - tcg_gen_addi_tl(s->tmp0, s->A0, 24); - tcg_gen_qemu_ld_i64(s->tmp1_i64, s->tmp0, mem_index, MO_LEUQ); - tcg_gen_st_i64(s->tmp1_i64, cpu_env, offset + offsetof(YMMReg, YMM_Q(3))); + tcg_gen_qemu_ld_i128(t1, s->tmp0, mem_index, + MO_128 | MO_LE | (align ? MO_ALIGN_16 : 0)); + + tcg_gen_st_i128(t0, cpu_env, offset + offsetof(YMMReg, YMM_X(0))); + tcg_gen_st_i128(t1, cpu_env, offset + offsetof(YMMReg, YMM_X(1))); } static void gen_sty_env_A0(DisasContext *s, int offset, bool align) { int mem_index = s->mem_index; - tcg_gen_ld_i64(s->tmp1_i64, cpu_env, offset + offsetof(YMMReg, YMM_Q(0))); - tcg_gen_qemu_st_i64(s->tmp1_i64, s->A0, mem_index, - MO_LEUQ | (align ? MO_ALIGN_32 : 0)); - tcg_gen_addi_tl(s->tmp0, s->A0, 8); - tcg_gen_ld_i64(s->tmp1_i64, cpu_env, offset + offsetof(YMMReg, YMM_Q(1))); - tcg_gen_qemu_st_i64(s->tmp1_i64, s->tmp0, mem_index, MO_LEUQ); + TCGv_i128 t = tcg_temp_new_i128(); + + tcg_gen_ld_i128(t, cpu_env, offset + offsetof(YMMReg, YMM_X(0))); + tcg_gen_qemu_st_i128(t, s->A0, mem_index, + MO_128 | MO_LE | (align ? MO_ALIGN_32 : 0)); tcg_gen_addi_tl(s->tmp0, s->A0, 16); - tcg_gen_ld_i64(s->tmp1_i64, cpu_env, offset + offsetof(YMMReg, YMM_Q(2))); - tcg_gen_qemu_st_i64(s->tmp1_i64, s->tmp0, mem_index, MO_LEUQ); - tcg_gen_addi_tl(s->tmp0, s->A0, 24); - tcg_gen_ld_i64(s->tmp1_i64, cpu_env, offset + offsetof(YMMReg, YMM_Q(3))); - tcg_gen_qemu_st_i64(s->tmp1_i64, s->tmp0, mem_index, MO_LEUQ); + tcg_gen_ld_i128(t, cpu_env, offset + offsetof(YMMReg, YMM_X(1))); + tcg_gen_qemu_st_i128(t, s->tmp0, mem_index, + MO_128 | MO_LE | (align ? MO_ALIGN_16 : 0)); } #include "decode-new.h"