From patchwork Sat Sep 16 03:29:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 723558 Delivered-To: patch@linaro.org Received: by 2002:adf:f0d1:0:b0:31d:da82:a3b4 with SMTP id x17csp709448wro; Fri, 15 Sep 2023 20:35:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFW9Xxc76sZIdHYMWOZVFvyyOXT7qCwtsRZjYNcSy5hL05IQU0iW4F+yn+86+C70V9JOpds X-Received: by 2002:ac8:5ac3:0:b0:410:8ac5:3084 with SMTP id d3-20020ac85ac3000000b004108ac53084mr4760409qtd.7.1694835319003; Fri, 15 Sep 2023 20:35:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694835318; cv=none; d=google.com; s=arc-20160816; b=Zs+qwdGN2krQ4dqXvO39jiFtSdN9LAnKoAv+nTzS2YeQSbVc2xjGiiYUxd65uI3iT1 rPcJX2S8JEPBKUCPUQizYtnKiIYOniLbeI4opfc7hblXVBbsWlTLf1/LRQRkdX3MQ3fD vuJt2vPjBr0RY6j0MljKn9ieQTBw+dZN14Tb0fGE5MI/wasp79sYqf1gBy2wQw9IrWMa JuhjkyH22gIxBlWdqOQq9OVu7EDTOpZAZxlUsBvjfNfRE81gmAVOZlHuLmGCU7k/EFQ9 XgCbGO7Tuf5Eu23CPf/Rs7D7S3pKek1fcTNMJTxaQ+0Lwh1kTXqa5O2soxa7gS1sP9TZ ZiOw== 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=gfBRrxx77NvM2gONPN+r7Oxv4+eOWyWr5yF2/BMEzhk=; fh=XdZcuDF0lIDVBff2CYkB4/gQzRNs362lYRoE1KF8IAU=; b=Sb5skNXpVVsVV+4GPhP/BQMxWZFZ1rqNVmsUudoJbZPrILdVK+0EUPEq202SyxtQVX JgVXLLphdID/1sMY8xsQEXdEkVYSixoF4R+yxQF5sQj3J80UYz9Y/v/c5TjiU15RisdM 49i1u41Di6Tzh5fnQjbsTaeTCioCCG8xUoOr0plLsrB4YYkY4UQnpiO9H9oZwbKjGXw0 0AFKHUWtfMUFbkxA2l10IjKxi12b8EBDxvPVnIsuP4Fgp5Ifp4eKcRttsflmSaF3AINk 56rw4bLnEDoeWHvo8Ppbcc5csgFTcolWy2aoHLwrtfMERicwPtCdYk2rUNlKs0SzNWnm xjgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xBXtvXlW; 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 h13-20020ac85e0d000000b00403e963cbdcsi3258558qtx.169.2023.09.15.20.35.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Sep 2023 20:35:18 -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=xBXtvXlW; 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 1qhM0r-0005xS-Tw; Fri, 15 Sep 2023 23:30:29 -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 1qhM0p-0005wT-Ru for qemu-devel@nongnu.org; Fri, 15 Sep 2023 23:30:27 -0400 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qhM0o-00080v-5b for qemu-devel@nongnu.org; Fri, 15 Sep 2023 23:30:27 -0400 Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-68cbbff84f6so2777426b3a.1 for ; Fri, 15 Sep 2023 20:30:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1694835025; x=1695439825; 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=gfBRrxx77NvM2gONPN+r7Oxv4+eOWyWr5yF2/BMEzhk=; b=xBXtvXlWFdKnj++OWDhF3a9txGNLDNRWohlnhABUPN/jxIrA6ypGx011qwQ4uPEPds EWKWcDMbj0BXDFhtAlX8aK4CVmYbK/dwAnhj4N4ZzqffcTh371LebTMu+pje0D5u9PaD u0g/UCE3FKISgQMGAzOUNTIACZv4fMCYrtTNTZQ3JNJG4w38VdvqSocRLg35VVSpxiIV NrIiYRVPBj218XhgKIhOTRMsCluceBGN/tqlrAqYjGTqRhXvjw7X34rUyjGsJQYqOeFf +WoRWMdBhtJVAoxrmZR+8Dbn/LeTjzRqkzIJdXkEsAhc+NL8X2HYZShDWE2Z6R0mI6UL gBWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694835025; x=1695439825; 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=gfBRrxx77NvM2gONPN+r7Oxv4+eOWyWr5yF2/BMEzhk=; b=gIv4o/tXenhIIRVpKgWdQvYrmg+TN2aSeutYX1p/KLIaf2VeyPxerBoFYWEwpUIxGm 2ivLPxxvprJIQOBLDx9jN2VfF7PWwL/unuiEi64TgJamFB01QgFbw4FzCmlcry2sCESK r12CTX9xAs0BqQuD08Y2j+LrzEaS+f8S1jJsqz02PSLyx01fHChlZThKOOxnLLZKvXvq 2EAD6RjSEN72oR6/nR2cBudYpQ4mOdRd0qhb0SJswl1dTJE3cr+AgL9YtT+h86JTFqEQ WcU8Nw35AN0ZSbCh4Gy9TkDdudrIlEHZUxkI5UZf57XgVh8LUjuyu20mhwCnc7Obv2jd euNQ== X-Gm-Message-State: AOJu0Yxg3LeB3o+g6MEPzjh0VoSYZYBbxeFcfk89DhqZ0t+IHzo3wCUi ANoy5UTqbXPRXBvWLaqDJ71Y/3YDDtFFH/bbIts= X-Received: by 2002:a05:6a21:3299:b0:159:c07d:66f0 with SMTP id yt25-20020a056a21329900b00159c07d66f0mr4447856pzb.6.1694835024734; Fri, 15 Sep 2023 20:30:24 -0700 (PDT) Received: from stoup.. ([71.212.131.115]) by smtp.gmail.com with ESMTPSA id j26-20020aa783da000000b00687a4b70d1esm3577320pfn.218.2023.09.15.20.30.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 20:30:24 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Jiajie Chen Subject: [PULL 12/39] tcg/loongarch64: Lower neg_vec to vneg Date: Fri, 15 Sep 2023 20:29:44 -0700 Message-Id: <20230916033011.479144-13-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230916033011.479144-1-richard.henderson@linaro.org> References: <20230916033011.479144-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::433; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x433.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 From: Jiajie Chen Signed-off-by: Jiajie Chen Reviewed-by: Richard Henderson Message-Id: <20230908022302.180442-8-c@jia.je> Signed-off-by: Richard Henderson --- tcg/loongarch64/tcg-target.h | 2 +- tcg/loongarch64/tcg-target.c.inc | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/tcg/loongarch64/tcg-target.h b/tcg/loongarch64/tcg-target.h index f9c5cb12ca..64c72d0857 100644 --- a/tcg/loongarch64/tcg-target.h +++ b/tcg/loongarch64/tcg-target.h @@ -178,7 +178,7 @@ extern bool use_lsx_instructions; #define TCG_TARGET_HAS_v256 0 #define TCG_TARGET_HAS_not_vec 1 -#define TCG_TARGET_HAS_neg_vec 0 +#define TCG_TARGET_HAS_neg_vec 1 #define TCG_TARGET_HAS_abs_vec 0 #define TCG_TARGET_HAS_andc_vec 1 #define TCG_TARGET_HAS_orc_vec 1 diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc index d569e443dd..b36b706e39 100644 --- a/tcg/loongarch64/tcg-target.c.inc +++ b/tcg/loongarch64/tcg-target.c.inc @@ -1695,6 +1695,9 @@ static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc, [TCG_COND_LTU] = {OPC_VSLTI_BU, OPC_VSLTI_HU, OPC_VSLTI_WU, OPC_VSLTI_DU}, }; LoongArchInsn insn; + static const LoongArchInsn neg_vec_insn[4] = { + OPC_VNEG_B, OPC_VNEG_H, OPC_VNEG_W, OPC_VNEG_D + }; a0 = args[0]; a1 = args[1]; @@ -1793,6 +1796,9 @@ static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc, case INDEX_op_sub_vec: tcg_out_addsub_vec(s, vece, a0, a1, a2, const_args[2], false); break; + case INDEX_op_neg_vec: + tcg_out32(s, encode_vdvj_insn(neg_vec_insn[vece], a0, a1)); + break; case INDEX_op_dupm_vec: tcg_out_dupm_vec(s, type, vece, a0, a1, a2); break; @@ -1818,6 +1824,7 @@ int tcg_can_emit_vec_op(TCGOpcode opc, TCGType type, unsigned vece) case INDEX_op_xor_vec: case INDEX_op_nor_vec: case INDEX_op_not_vec: + case INDEX_op_neg_vec: return 1; default: return 0; @@ -1995,6 +2002,7 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) return C_O1_I2(w, w, w); case INDEX_op_not_vec: + case INDEX_op_neg_vec: return C_O1_I1(w, w); default: