From nobody Tue Feb 10 06:59:01 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.50 as permitted sender) client-ip=209.85.221.50; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f50.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.50 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1633283899; cv=none; d=zohomail.com; s=zohoarc; b=gLfG0QBB+o6Xkq8qOF/q9fY7VIRoG2aVPJZUR3hf+FOCR6cYSJfL33gxn0aK2zxYM2CKp8BF8016U6QTIvNklgFutyzfYj/aVT/CU6xDs/p9Ys7ksjP8Rk72HdiOaR9ihF1XdE/yv/6v6KAtprotL2rzxBv5t5dC3GaNVzTww0Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633283899; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=6XihHO8hR/2w0fkY9TAy59BcD7FH2rXSgl3e1w0F2cc=; b=mlrvvjMuJW4yFTU/zHyqovFOHGJsWU+FDe1nKfT7LiF1EeCx5Nn3i6hGL9cnTnm7TPyxITELmaim09S5PpL1ntSBUsoIiJk8VxDIYO2q9r6y8/lK8/YULLah0PK6sqME8buERMxSZ+Ng7ETWVIrLNNTzepV3zdH+dC1+JyEIPz8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.50 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) by mx.zohomail.com with SMTPS id 1633283899550755.3245950877147; Sun, 3 Oct 2021 10:58:19 -0700 (PDT) Received: by mail-wr1-f50.google.com with SMTP id m22so20680098wrb.0 for ; Sun, 03 Oct 2021 10:58:18 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id d16sm13728474wmb.2.2021.10.03.10.58.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Oct 2021 10:58:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6XihHO8hR/2w0fkY9TAy59BcD7FH2rXSgl3e1w0F2cc=; b=pPcfGcI0CMfJK4Nio3gEDH/ajJlkGFl1mKbZRf58tfPzWJZUOvxThTfu8AMnVdUXx+ y9f7yLyVxx9R8Dtb42wk6DE7LVN668hzA4dOoYy4ych+fC8JVgKUvwdouos13maCUeG3 y4jC2/yoyy49API3+DP/J/ryvilLiTWpRW0kqi5S3zOkCmY3iz6IJaPVXcerADBrsDhu S+Fn89pBoqZJ/ezH8yCnE3Or5gVcbNi4cCc2FRkMQZ0PbbaMYHp+XjzXMsGnrrp8sV0d /wPFJzk5PUWCprice0b3Cy8SU8dcZDUs6wPzcSxJTH6Giufpd5NgQaVOFgsnmT7+h58s k2zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=6XihHO8hR/2w0fkY9TAy59BcD7FH2rXSgl3e1w0F2cc=; b=7LsPg+uGHZBgddBXMTszbet//MNk5u0+nIDvDdlJiQSm8+Gn9nkb+hyz0oaQOnSoGB N+j/rOH1M3H0Z9xLLJBXaJJdXeHd9O3FAiz8kc1YjZwKbCnok1d1nSAk4GnGRzjKA40y oOMIqIX1coYxuMCGTNbIfIoJ/W7FTohvYrjk84oZmcqb8jP2Fgsjf3yQ22UtEw4+39gJ YoPOxUPw3fP1yxlSjJh43vyFDkGw2iLRCTwGTcRNj5M9lFsD6oOUYO0GUMTDfBYs/fK0 NKI6GCLFaEz2d321LlO6xtOR0Xp2yFj1qU4y1grMcTjPZvm7xItX3Stc4fuO4ZKaqDGy DMlA== X-Gm-Message-State: AOAM530DnO7NbG6YWwB4tpdxZ6bUZkubHqZAjyVLP4aygAMETdvCe2xv iM0RU3vQ8lNKcZPv5vfEnAs= X-Google-Smtp-Source: ABdhPJzgeuLoh7FsFtCvwTOsYvs5kfncYBjNQWhfTmPdGHzhXyviQFsXClgDCyALV4XepZm1Jbm8Mg== X-Received: by 2002:adf:a505:: with SMTP id i5mr8134053wrb.38.1633283897737; Sun, 03 Oct 2021 10:58:17 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , Jiaxun Yang , Richard Henderson , Aleksandar Rikalo Subject: [PATCH 7/8] target/mips: Use tcg_constant_i32() in gen_msa_i5() Date: Sun, 3 Oct 2021 19:57:42 +0200 Message-Id: <20211003175743.3738710-8-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211003175743.3738710-1-f4bug@amsat.org> References: <20211003175743.3738710-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1633283899806100001 Avoid using a TCG temporary by moving Data Format to the constant pool. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- target/mips/tcg/msa_translate.c | 40 ++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/target/mips/tcg/msa_translate.c b/target/mips/tcg/msa_translat= e.c index 3ef912da6b8..3ede2f643c0 100644 --- a/target/mips/tcg/msa_translate.c +++ b/target/mips/tcg/msa_translate.c @@ -473,14 +473,32 @@ static void gen_msa_i8(DisasContext *ctx) static void gen_msa_i5(DisasContext *ctx) { #define MASK_MSA_I5(op) (MASK_MSA_MINOR(op) | (op & (0x7 << 23))) - int8_t s5 =3D (int8_t) sextract32(ctx->opcode, 16, 5); - uint8_t u5 =3D extract32(ctx->opcode, 16, 5); - TCGv_i32 tdf =3D tcg_const_i32(extract32(ctx->opcode, 21, 2)); TCGv_i32 twd =3D tcg_const_i32(extract32(ctx->opcode, 11, 5)); TCGv_i32 tws =3D tcg_const_i32(extract32(ctx->opcode, 6, 5)); - TCGv_i32 timm =3D tcg_temp_new_i32(); - tcg_gen_movi_i32(timm, u5); + TCGv_i32 timm; + + switch (MASK_MSA_I5(ctx->opcode)) { + case OPC_ADDVI_df: + case OPC_MAXI_U_df: + case OPC_MINI_U_df: + case OPC_CLTI_U_df: + case OPC_CLEI_U_df: + timm =3D tcg_constant_i32(extract32(ctx->opcode, 16, 5)); + break; + case OPC_MAXI_S_df: + case OPC_MINI_S_df: + case OPC_CEQI_df: + case OPC_CLTI_S_df: + case OPC_CLEI_S_df: + timm =3D tcg_constant_i32(sextract32(ctx->opcode, 16, 5)); + break; + case OPC_LDI_df: + timm =3D tcg_constant_i32(sextract32(ctx->opcode, 11, 10)); + break; + default: + break; + } =20 switch (MASK_MSA_I5(ctx->opcode)) { case OPC_ADDVI_df: @@ -490,43 +508,34 @@ static void gen_msa_i5(DisasContext *ctx) gen_helper_msa_subvi_df(cpu_env, tdf, twd, tws, timm); break; case OPC_MAXI_S_df: - tcg_gen_movi_i32(timm, s5); gen_helper_msa_maxi_s_df(cpu_env, tdf, twd, tws, timm); break; case OPC_MAXI_U_df: gen_helper_msa_maxi_u_df(cpu_env, tdf, twd, tws, timm); break; case OPC_MINI_S_df: - tcg_gen_movi_i32(timm, s5); gen_helper_msa_mini_s_df(cpu_env, tdf, twd, tws, timm); break; case OPC_MINI_U_df: gen_helper_msa_mini_u_df(cpu_env, tdf, twd, tws, timm); break; case OPC_CEQI_df: - tcg_gen_movi_i32(timm, s5); gen_helper_msa_ceqi_df(cpu_env, tdf, twd, tws, timm); break; case OPC_CLTI_S_df: - tcg_gen_movi_i32(timm, s5); gen_helper_msa_clti_s_df(cpu_env, tdf, twd, tws, timm); break; case OPC_CLTI_U_df: gen_helper_msa_clti_u_df(cpu_env, tdf, twd, tws, timm); break; case OPC_CLEI_S_df: - tcg_gen_movi_i32(timm, s5); gen_helper_msa_clei_s_df(cpu_env, tdf, twd, tws, timm); break; case OPC_CLEI_U_df: gen_helper_msa_clei_u_df(cpu_env, tdf, twd, tws, timm); break; case OPC_LDI_df: - { - int32_t s10 =3D sextract32(ctx->opcode, 11, 10); - tcg_gen_movi_i32(timm, s10); - gen_helper_msa_ldi_df(cpu_env, tdf, twd, timm); - } + gen_helper_msa_ldi_df(cpu_env, tdf, twd, timm); break; default: MIPS_INVAL("MSA instruction"); @@ -537,7 +546,6 @@ static void gen_msa_i5(DisasContext *ctx) tcg_temp_free_i32(tdf); tcg_temp_free_i32(twd); tcg_temp_free_i32(tws); - tcg_temp_free_i32(timm); } =20 static void gen_msa_bit(DisasContext *ctx) --=20 2.31.1