From patchwork Wed May 6 18:29:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 186268 Delivered-To: patch@linaro.org Received: by 2002:a92:8d81:0:0:0:0:0 with SMTP id w1csp2408957ill; Wed, 6 May 2020 11:32:47 -0700 (PDT) X-Google-Smtp-Source: APiQypKvkEkomOhsfvKCxJEDf7xKrRHv4ChTBrLQr2DKQWUzi5MFsSC3e6+IGyVtV0fIOCn2u4/Z X-Received: by 2002:a05:620a:4f0:: with SMTP id b16mr10128044qkh.165.1588789967566; Wed, 06 May 2020 11:32:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588789967; cv=none; d=google.com; s=arc-20160816; b=JGqizijUFbVPCl6+shAZI7ztbZC+fDarkXn08V2c7IaZmtTUBMQFepSwFEBtH5UtAc a4If2RAokIr5kAEw/FvLwhfKlALMEhO9zfi+gkJAEpWUHjQY4wz4v0nCY62MWDK+TBwq J5TjVtPZltr33eKAKor4cJRSiq+H6poghoajxnqK/WLEaahGV24qUF6xHTdA5+dnJqAE Q5FELIsT2ew+Kb5wOZuIfRs+P57cBNa4pfEwoDuvAML/4UcTvqu5A6p/Bo7bZxnosFRQ q4W4tR2bevTR7B3umAWpkwHSU0QZwKAu0U5xkKUBR4b/iWGbbXEwnzSE7YZ11iz+Oyrs vOPA== 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=J8tKD8Dhorc/rZ7Pqa63r7FVSLYqB5ObHvXNIyPd1G0=; b=t5TU7l+6Z8/ZA4q9h1UHYnL16Vk14tbFJPl/l3+aJ2dbIU4L29v97PK7CX+5xTs0vi BnFzJGhos24yyYtNYfAVz6x3cnBrt3Ds3XTsIPqMf+6anvDYqqskgZ2a8GrbJ2e/fXgE 65q7ejyEuWfRlro/2+OWODOr/3/5c4w2iPRZCD0sZqdRmSCJtnM81shvf0e/D5f25U3n rJfXnsuKUaxqJrUlr7poKsTiegYcaPljH1zksfxvx9Swuvy7rG7gUN2mfCiq/WX5b7Lb qGYw6SCrEAiam9duwDxUvK6mLP0DZAuf4zF1Nndn0x537kePng81+31CbLtlrc/6tVHG WW1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Z224c+SG; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:470:142::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. [2001:470:142::17]) by mx.google.com with ESMTPS id n93si469470qtd.132.2020.05.06.11.32.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 06 May 2020 11:32:47 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:470:142::17 as permitted sender) client-ip=2001:470:142::17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Z224c+SG; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:470:142::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]:55960 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jWOqc-0007Mh-KP for patch@linaro.org; Wed, 06 May 2020 14:32:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60844) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jWOo6-0004NW-8P for qemu-devel@nongnu.org; Wed, 06 May 2020 14:30:10 -0400 Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]:43267) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jWOo5-0002sA-5J for qemu-devel@nongnu.org; Wed, 06 May 2020 14:30:09 -0400 Received: by mail-pg1-x52e.google.com with SMTP id l12so1165603pgr.10 for ; Wed, 06 May 2020 11:30:08 -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=J8tKD8Dhorc/rZ7Pqa63r7FVSLYqB5ObHvXNIyPd1G0=; b=Z224c+SGLRaP3J2LemA0zY6VD+nK3zFDJvhmhebbjwO+826eoG0S5tOoXGkggARf+8 Hybl9uCgJJY6kfpt8S6nFki4Z8EDIWd9xNHeJx9IdlYMiJmnGdw0IJkYPVH85VblTiRI OmRmxnrjbdB3glj6ZUxo6WxlgdDmNbdRPax0cEFwSKA3rqOFUilAflpdYGwbzw1iAM92 27mJf5W75Xt5OJt5iGqYB7RCGfkph4Xlu7ImVHP9Z22RkOFXndvWt+cqoCpDYUZ2KqRD +7uvxjrGn6++IF0h7kTkIIHz8pGA+jbi/967+JHJPSCZMwyWmeg16WDZl6QVtbCMGCog /yZw== 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=J8tKD8Dhorc/rZ7Pqa63r7FVSLYqB5ObHvXNIyPd1G0=; b=sAuNQhcIsXBMgiG02Z+ZypzYa7QXKRmOdSY14KnACvBHKhdq0n5HddKUDF3s+b/Dye 36cuBt96Wgu0A5j/hesPf0KdBFvEmlbjPXBy1+uxSeSCKHZWElw42rHqV67PwofqxNBU 2dxTvSPgwj2E2MGfHd2gOjj0qrs836fJXgrC76wCjcd/SGlkZlZ2eI1Cn2Rka4vz0aMz H4sQm4CddYf7I4OQr1309eOF+v5zLeGIAojIwYTO71auMMfmdnEEfAD/wyFHQ3k9hEaB 2vAsFj7ZgMCTu0GEgi4fjrJCLZpSxaW4jdaMAvnnxFba3jv873Z73Xc7CAAqBdxYfslv lssg== X-Gm-Message-State: AGi0PuYZdM9YrA85odXy1q6eIZ0/bemvWUSGaX4l/VRuO4N1V4gyLjpk Bm97FWb5GbqisP5L8TncqqSvLMyrS7g= X-Received: by 2002:aa7:8dd2:: with SMTP id j18mr9491524pfr.74.1588789807476; Wed, 06 May 2020 11:30:07 -0700 (PDT) Received: from localhost.localdomain (174-21-149-226.tukw.qwest.net. [174.21.149.226]) by smtp.gmail.com with ESMTPSA id w11sm2572589pfq.100.2020.05.06.11.30.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2020 11:30:06 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 03/10] target/ppc: Use tcg_gen_gvec_dup_imm Date: Wed, 6 May 2020 11:29:55 -0700 Message-Id: <20200506183002.3192-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200506183002.3192-1-richard.henderson@linaro.org> References: <20200506183002.3192-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52e; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52e.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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@linaro.org, David Gibson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We can now unify the implementation of the 3 VSPLTI instructions. Acked-by: David Gibson Signed-off-by: Richard Henderson --- target/ppc/translate/vmx-impl.inc.c | 32 ++++++++++++++++------------- target/ppc/translate/vsx-impl.inc.c | 2 +- 2 files changed, 19 insertions(+), 15 deletions(-) -- 2.20.1 diff --git a/target/ppc/translate/vmx-impl.inc.c b/target/ppc/translate/vmx-impl.inc.c index 81d5a7a341..403ed3a01c 100644 --- a/target/ppc/translate/vmx-impl.inc.c +++ b/target/ppc/translate/vmx-impl.inc.c @@ -1035,21 +1035,25 @@ GEN_VXRFORM_DUAL(vcmpbfp, PPC_ALTIVEC, PPC_NONE, \ GEN_VXRFORM_DUAL(vcmpgtfp, PPC_ALTIVEC, PPC_NONE, \ vcmpgtud, PPC_NONE, PPC2_ALTIVEC_207) -#define GEN_VXFORM_DUPI(name, tcg_op, opc2, opc3) \ -static void glue(gen_, name)(DisasContext *ctx) \ - { \ - int simm; \ - if (unlikely(!ctx->altivec_enabled)) { \ - gen_exception(ctx, POWERPC_EXCP_VPU); \ - return; \ - } \ - simm = SIMM5(ctx->opcode); \ - tcg_op(avr_full_offset(rD(ctx->opcode)), 16, 16, simm); \ +static void gen_vsplti(DisasContext *ctx, int vece) +{ + int simm; + + if (unlikely(!ctx->altivec_enabled)) { + gen_exception(ctx, POWERPC_EXCP_VPU); + return; } -GEN_VXFORM_DUPI(vspltisb, tcg_gen_gvec_dup8i, 6, 12); -GEN_VXFORM_DUPI(vspltish, tcg_gen_gvec_dup16i, 6, 13); -GEN_VXFORM_DUPI(vspltisw, tcg_gen_gvec_dup32i, 6, 14); + simm = SIMM5(ctx->opcode); + tcg_gen_gvec_dup_imm(vece, avr_full_offset(rD(ctx->opcode)), 16, 16, simm); +} + +#define GEN_VXFORM_VSPLTI(name, vece, opc2, opc3) \ +static void glue(gen_, name)(DisasContext *ctx) { gen_vsplti(ctx, vece); } + +GEN_VXFORM_VSPLTI(vspltisb, MO_8, 6, 12); +GEN_VXFORM_VSPLTI(vspltish, MO_16, 6, 13); +GEN_VXFORM_VSPLTI(vspltisw, MO_32, 6, 14); #define GEN_VXFORM_NOA(name, opc2, opc3) \ static void glue(gen_, name)(DisasContext *ctx) \ @@ -1559,7 +1563,7 @@ GEN_VXFORM_DUAL(vsldoi, PPC_ALTIVEC, PPC_NONE, #undef GEN_VXRFORM_DUAL #undef GEN_VXRFORM1 #undef GEN_VXRFORM -#undef GEN_VXFORM_DUPI +#undef GEN_VXFORM_VSPLTI #undef GEN_VXFORM_NOA #undef GEN_VXFORM_UIMM #undef GEN_VAFORM_PAIRED diff --git a/target/ppc/translate/vsx-impl.inc.c b/target/ppc/translate/vsx-impl.inc.c index 8287e272f5..b518de46db 100644 --- a/target/ppc/translate/vsx-impl.inc.c +++ b/target/ppc/translate/vsx-impl.inc.c @@ -1579,7 +1579,7 @@ static void gen_xxspltib(DisasContext *ctx) return; } } - tcg_gen_gvec_dup8i(vsr_full_offset(rt), 16, 16, uim8); + tcg_gen_gvec_dup_imm(MO_8, vsr_full_offset(rt), 16, 16, uim8); } static void gen_xxsldwi(DisasContext *ctx)