From patchwork Wed Jun 19 20:59:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 805649 Delivered-To: patch@linaro.org Received: by 2002:a5d:508d:0:b0:362:4979:7f74 with SMTP id a13csp15280wrt; Wed, 19 Jun 2024 14:04:55 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWkT1jxe7Dkm+WyObimH8VTPUVtpiTmQOxsO3jneqRFEWq6qGautT8yE/SjTgtvCcQxJMji+06PQJxT6VndcoFH X-Google-Smtp-Source: AGHT+IEeUgS7w6yMGJR6Xpoj3grr5LeRkQdGMne73oF+MwTlpvBwwno8HiNfQK/gDf5ikiDjdn/w X-Received: by 2002:a05:6870:d209:b0:250:58b8:bbe2 with SMTP id 586e51a60fabf-25c948eaea8mr4002098fac.4.1718831095513; Wed, 19 Jun 2024 14:04:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718831095; cv=none; d=google.com; s=arc-20160816; b=hnH3Yjfyg0NSGz3CEtrB1eSnZTuA/VON3RiSFlea6uqCg2pdEmodOC6bH8atcMP6xw tIy7/s0QONbhpYTCii0M3slHOszB0Tz+US++YB7Xj3gKw7ee2zQ7beV9/DgEX0pKMSg9 Nicw8tmkQDGvd/eT8N+8yFLYDdJaWHtXx02n9zZXViUnQT2b0KyQvmmKMZtMykz69eN0 vuxS8vAWGyhCUVMYqcYyeIl7YNOJT650ZcdRqmQ1KAENYgABB8HeZ/pxycpJm2e9AbgA riCEVov4sfWzfG6q9/dzc4Eok0UP9FliBYO5OTPfgKGAEFDCM4LHz43M3q7M/mU8vir1 4xgw== 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=1R6PniPLNMWr5brkBomFlTCMhKgUFohFxAyFLb2Rr/U=; fh=WHbKwsB9jlgssve14/eRnAYNW4p1c+a/TobPlehjgd8=; b=qQ2LymIYaJ3GS4i+GrEOxI+uU7uBqzVcOo59G76+Xu1y+UQGtrVpWJck3w7dqthtcZ aziaUOc3Fj1kmkc9zMJt7YJzf4wglb0pp9ESsPCisAkZX5Hiov6SOFIv4lt846bYLi4P px60DvQX8UDIugySUVE7bV3WXfRegzjHnaUVnMPC6PT2DNvsN9kwepQ9tKWCvSV275Dn p4VqcInGoqfCsfcTyKPXJbQsAgzeyVePxRm1Drp4FHQEDFIHq7M5i5UbxQhTNvYr2CuD STfgqSv6ey5zgwrv3XE5oOo3qMUgyyCkp6HBup9RYit2wkhFyvPscrTe5Hy1aJqq51am sX3w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DwsPC9pH; 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 d75a77b69052e-441f2fed203si167659981cf.609.2024.06.19.14.04.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 19 Jun 2024 14:04:55 -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=DwsPC9pH; 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 1sK2Pc-0002F9-3C; Wed, 19 Jun 2024 17:00:12 -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 1sK2PT-0002C8-Pm for qemu-devel@nongnu.org; Wed, 19 Jun 2024 17:00:05 -0400 Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sK2PQ-0000KD-U4 for qemu-devel@nongnu.org; Wed, 19 Jun 2024 17:00:02 -0400 Received: by mail-pg1-x532.google.com with SMTP id 41be03b00d2f7-6e4dbca52f0so177480a12.0 for ; Wed, 19 Jun 2024 14:00:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718830799; x=1719435599; 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=1R6PniPLNMWr5brkBomFlTCMhKgUFohFxAyFLb2Rr/U=; b=DwsPC9pHX3XZFzx0xbIkplf+dwcEYudnU/nKLbORf1k7v4aFI8XqLvp7WqGDtTOcJC KXXQlPv3C9WSUdgsLxsxa2DSl6tajdOZ+ECdk7sZGqC1xFR0+5igBrwRk0h031dlvK/2 xDoaBkgN4qVh32SHCBjJ2f0d00i8PuBkEEDffCYTbwwKatuC+0TKnE5eDVJowqzj3INq +lb24o+hppp3tqCOSGx/hy3KZtltuibGSQ/5kvnx3uYlnYeX1UsRc2pats50MaBe70xu LZ6r1on4WbF5uEkxwEag7+pUNTS1GrQWzFu5yoGpUXNq9YLRh7Dj/zbtESl96dIEgYhg XTTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718830799; x=1719435599; 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=1R6PniPLNMWr5brkBomFlTCMhKgUFohFxAyFLb2Rr/U=; b=XgI21Eb2T5ghtw9QIYi6361oC0fsxTa41bCOGdX9DNi2zAVFy34PunmZPq96VM7yva OocIIjua2Ey9HL6wgEVu2kYPRLRadW0zJJj0KIQb2xpRRmxhylSAPXtk0O40z8wEmGG8 SleOxB/5vCZnGTPiJAIrRJF6XTg+2GmvHnG1+btRFofw9sLsUITH7CRLkDJpX9uEo2IE VgHR8NrURkaRq/S8oRlS0NXfwRvvkMrw6KgFuAsPDotmReEXYWNsezV6vyuJoRX1DFZ+ sqsBRO6b0Ctar7Yna8b5UoNTFeWRip2ETQi7IvL2awhFztsVSfzcUGFtlE3Kk6kkkrZU uv2w== X-Gm-Message-State: AOJu0YwbkKDmk4vLcAQ9A455MaHkr2A2XdIBgnKA6RP8vf7GCAtuhEhP Mj4uwZrSWnUFwzPuNSaVH2KIBuKAmPSNjHQcqAu7pERryFo3cD/gb85YQrfQRnAXDjIOSM3KIVi O X-Received: by 2002:a17:902:f68f:b0:1f6:673c:ff2f with SMTP id d9443c01a7336-1f9aa472200mr39234485ad.68.1718830799082; Wed, 19 Jun 2024 13:59:59 -0700 (PDT) Received: from stoup.. ([71.212.132.216]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f98f8f8c42sm39183765ad.162.2024.06.19.13.59.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jun 2024 13:59:58 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Song Gao , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 06/24] tcg/loongarch64: Simplify tcg_out_dup_vec Date: Wed, 19 Jun 2024 13:59:34 -0700 Message-Id: <20240619205952.235946-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240619205952.235946-1-richard.henderson@linaro.org> References: <20240619205952.235946-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::532; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x532.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, T_SCC_BODY_TEXT_LINE=-0.01 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 Reviewed-by: Song Gao Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/loongarch64/tcg-target.c.inc | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc index 980ea10211..b1d652355d 100644 --- a/tcg/loongarch64/tcg-target.c.inc +++ b/tcg/loongarch64/tcg-target.c.inc @@ -1674,22 +1674,12 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, static bool tcg_out_dup_vec(TCGContext *s, TCGType type, unsigned vece, TCGReg rd, TCGReg rs) { - switch (vece) { - case MO_8: - tcg_out_opc_vreplgr2vr_b(s, rd, rs); - break; - case MO_16: - tcg_out_opc_vreplgr2vr_h(s, rd, rs); - break; - case MO_32: - tcg_out_opc_vreplgr2vr_w(s, rd, rs); - break; - case MO_64: - tcg_out_opc_vreplgr2vr_d(s, rd, rs); - break; - default: - g_assert_not_reached(); - } + static const LoongArchInsn repl_insn[4] = { + OPC_VREPLGR2VR_B, OPC_VREPLGR2VR_H, OPC_VREPLGR2VR_W, OPC_VREPLGR2VR_D + }; + + tcg_debug_assert(vece <= MO_64); + tcg_out32(s, encode_vdj_insn(repl_insn[vece], rd, rs)); return true; }