From patchwork Tue Nov 7 02:48:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 741770 Delivered-To: patch@linaro.org Received: by 2002:adf:fd90:0:b0:32d:baff:b0ca with SMTP id d16csp1415948wrr; Mon, 6 Nov 2023 18:55:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IGzPmdiZ29SZqHfWA+nP2/IUVaQ4sQcr68kLp3IpJLYrhvHpkbYxgkfKf4Jq7SZpL2rABCa X-Received: by 2002:ad4:5ae5:0:b0:670:f530:47ee with SMTP id c5-20020ad45ae5000000b00670f53047eemr41774110qvh.34.1699325707156; Mon, 06 Nov 2023 18:55:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699325707; cv=none; d=google.com; s=arc-20160816; b=kzWab9kW7M6KZGNaxuHz6B2VhFq/CIhEQ5Vt2PyJzCMGKWcTkBSl7Zismq5UTofH52 R2vVWpvTU55buClW9gxGauiYUztXZJNwGSG+Vne7LjCh0KBQMiksnjUkyHVtanHyd8En YMpalTW7JFUpGJyhkpn3t9urpydswmynHjUp6Fg+dKR7OQrFnDRWYU1dpIXaDvGMX/0H WFYMD3vYxx6MhlpTO59r+qJKURRET+MT+MK0TGq524J8NTGQSOdDTL6ByvMyYfWrwBVe vljQqAsiyFbmPNxNt7jE6N5Od+cC/vVNRGHC3Rul71tYPhNiIwT2PK2P5u+vbAYvGARP aQag== 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=QmgLQHRjVVBRPaZdvh0i8/8wa1sGosyB6yu2fFTSqQc=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=Fk0t8/N/SSKKLHykA0H1warW3RKnUmt89JJSOTXI9tXQgPQEbPyVJTC1HM+bMUZ1vJ Ekz2D0JraE183m8baNGVWcI1dgq1Qpk4nsR3Uml3tU9HN/NuSmEIccyfjr75Ng4cPvUi EAGzwR/Hrdi7yIXSL6o5hlPrhBKCfQBF5/7/zyshY8BjrDpv4hQxSHTwulm9JDNL+hX9 n3MHY3z265E4imjEYoXrerD0Ewfa8083ukoCp7x0IMdZ3ExE4LJzxiVVYUKpn8nFX7Km dIEo80v3FvOl2tqeD7ndC1gljGfUn7mYshkFyEkJqdLrMzKJzPgeMYR5GrS2+Esu1KnU KOPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JhvcgDVX; 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 m4-20020ad44a04000000b0066d10e104cdsi6153892qvz.363.2023.11.06.18.55.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 Nov 2023 18:55:07 -0800 (PST) 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=JhvcgDVX; 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 1r0C9K-0008O1-I5; Mon, 06 Nov 2023 21:49:06 -0500 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 1r0C9I-0008Lh-RI for qemu-devel@nongnu.org; Mon, 06 Nov 2023 21:49:04 -0500 Received: from mail-vk1-xa2a.google.com ([2607:f8b0:4864:20::a2a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r0C9H-0005tT-7h for qemu-devel@nongnu.org; Mon, 06 Nov 2023 21:49:04 -0500 Received: by mail-vk1-xa2a.google.com with SMTP id 71dfb90a1353d-49e15724283so2006049e0c.1 for ; Mon, 06 Nov 2023 18:49:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699325342; x=1699930142; 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=QmgLQHRjVVBRPaZdvh0i8/8wa1sGosyB6yu2fFTSqQc=; b=JhvcgDVXldMNChA/jvrkCBd8HCjaVvrqwd8yectWOa+337m9Q/3hhu+lCHgHM2h4xq Ukhqf4R43knYgKGSpcv3DVZ8Dg9j6bwUZkrW3LNYJcmvcj7WIRPkEGikrCKWgMTEPQET gJfvjXldxw8bMSFJcnSsLMSZjfWTdu5wZRoVu0Z2CL1gOwqL8t6j+wG6hBEUq10Ols2X /b0YtfF16faClD2ixNrngURz1Wa6EGUciM2tlymNiLARF6+LYEoW0HvxsbvsQShQ0CqW vUs8hwmuKEOkpI4yMrHZD8k1EKtwkXUMDTzbq/R5mXa1sAiXbYEL8vcATlMSI+A9UPkD cFZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699325342; x=1699930142; 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=QmgLQHRjVVBRPaZdvh0i8/8wa1sGosyB6yu2fFTSqQc=; b=FUNhwi2dEG1q50gqpkcDhL5u1ND9fYrhaZRh4u9dPQ59PHxIpo3NUSJUhGRosyAXSt IKQ7/v6s63wwecH7MX4eeA8pr4TpdRZrSztzU8IItzWJX6NmaOZJIkagrvL9dv+imxy1 chmOdIb89PBDhBQUyV3TKHZvvUmErJCNWpnvwNWqkB+l7USiVi5K619028z7yaN40vkf Rr7o75qOP3xzPWgvFIDph5aBQLOQqVJZhpSE43ReWR3OQYqMPIP1FuxoeS+pJ3CDa01z 2WLNtIXpuqMTEKWVElXE5Hd3Lm8n6IeVdphy5ClTaIt5yOeCaQ7w3dJGcgRqnDMYKrgQ irPA== X-Gm-Message-State: AOJu0Yx/6HbGKMCU7ghiWFaxvolEHFJz1u5LpHEl2KKBoJb7CDSIgK0t +g5JRUoiHPJSWCtaWtxywZChCfFk4IvCeqHuWko= X-Received: by 2002:a1f:aa0a:0:b0:4ac:6a9f:2bb4 with SMTP id t10-20020a1faa0a000000b004ac6a9f2bb4mr2499959vke.15.1699325341973; Mon, 06 Nov 2023 18:49:01 -0800 (PST) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id fn11-20020a056a002fcb00b006bff7c36fb3sm6367478pfb.95.2023.11.06.18.49.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 18:49:01 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 23/35] tcg/mips: Implement neg opcodes Date: Mon, 6 Nov 2023 18:48:30 -0800 Message-Id: <20231107024842.7650-24-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231107024842.7650-1-richard.henderson@linaro.org> References: <20231107024842.7650-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::a2a; envelope-from=richard.henderson@linaro.org; helo=mail-vk1-xa2a.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 Signed-off-by: Richard Henderson Message-Id: <20231026041404.1229328-5-richard.henderson@linaro.org> --- tcg/mips/tcg-target.h | 4 ++-- tcg/mips/tcg-target.c.inc | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/tcg/mips/tcg-target.h b/tcg/mips/tcg-target.h index 5b3fdcc726..20c14224fb 100644 --- a/tcg/mips/tcg-target.h +++ b/tcg/mips/tcg-target.h @@ -184,12 +184,12 @@ extern bool use_mips32r2_instructions; #endif /* optional instructions automatically implemented */ -#define TCG_TARGET_HAS_neg_i32 0 /* sub rd, zero, rt */ +#define TCG_TARGET_HAS_neg_i32 1 #define TCG_TARGET_HAS_ext8u_i32 0 /* andi rt, rs, 0xff */ #define TCG_TARGET_HAS_ext16u_i32 0 /* andi rt, rs, 0xffff */ #if TCG_TARGET_REG_BITS == 64 -#define TCG_TARGET_HAS_neg_i64 0 /* sub rd, zero, rt */ +#define TCG_TARGET_HAS_neg_i64 1 #define TCG_TARGET_HAS_ext8u_i64 0 /* andi rt, rs, 0xff */ #define TCG_TARGET_HAS_ext16u_i64 0 /* andi rt, rs, 0xffff */ #endif diff --git a/tcg/mips/tcg-target.c.inc b/tcg/mips/tcg-target.c.inc index 82b078b9c5..8328dbdecc 100644 --- a/tcg/mips/tcg-target.c.inc +++ b/tcg/mips/tcg-target.c.inc @@ -1920,6 +1920,12 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, tcg_out_opc_reg(s, OPC_MFHI, a1, 0, 0); break; + case INDEX_op_neg_i32: + i1 = OPC_SUBU; + goto do_unary; + case INDEX_op_neg_i64: + i1 = OPC_DSUBU; + goto do_unary; case INDEX_op_not_i32: case INDEX_op_not_i64: i1 = OPC_NOR; @@ -2144,6 +2150,7 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) case INDEX_op_ld16u_i32: case INDEX_op_ld16s_i32: case INDEX_op_ld_i32: + case INDEX_op_neg_i32: case INDEX_op_not_i32: case INDEX_op_bswap16_i32: case INDEX_op_bswap32_i32: @@ -2157,6 +2164,7 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) case INDEX_op_ld32s_i64: case INDEX_op_ld32u_i64: case INDEX_op_ld_i64: + case INDEX_op_neg_i64: case INDEX_op_not_i64: case INDEX_op_bswap16_i64: case INDEX_op_bswap32_i64: