From nobody Wed Nov 27 16:45:18 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1698293712; cv=none; d=zohomail.com; s=zohoarc; b=myBJiBrLnErntUuuwVjyX/l4o6t5mee00xXFqtFx5kMWwKN4WIm4lUu0CW2ETufIs63OBvAkEZzIptaxuDk2qRXqBnTbUMXqDiOymdh++9uBTJB8WkpJBoP6dSqR9G2LsW33XuWcZE71ya+yOr6b3MmusAIfNLxcRIZOg+RV0So= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698293712; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=lPY9mxzDBbOf1owj0FOY1MUzjClJ3s1wsYFvJx2toV4=; b=FDsi8kHgzEoc6l24Jn/3vasO8nenUcoGzxMrFvpwdOYzHGy0GdHWIhn85nsoTWl6IjTYY9vVy1km6MbKTkTtNI7SA3mXOndmPv5YaEUR2/H86G4An/M8+Swu1aJlpugg30+hQgXALyEco9relpYLvkUgnj6p0yv/4s5l1Bult+E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1698293711915350.3198015488307; Wed, 25 Oct 2023 21:15:11 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qvrlB-0002XI-BI; Thu, 26 Oct 2023 00:14:17 -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 1qvrl7-0002VW-BW for qemu-devel@nongnu.org; Thu, 26 Oct 2023 00:14:13 -0400 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qvrl5-0000jK-3M for qemu-devel@nongnu.org; Thu, 26 Oct 2023 00:14:13 -0400 Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-1c5cd27b1acso3602135ad.2 for ; Wed, 25 Oct 2023 21:14:10 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id i12-20020a170902eb4c00b001b8b2b95068sm9953929pli.204.2023.10.25.21.14.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 21:14:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698293648; x=1698898448; 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=lPY9mxzDBbOf1owj0FOY1MUzjClJ3s1wsYFvJx2toV4=; b=SKkv3jNEnzmbGHw48dQoUIRneJTwcrut1YGwQpz6az5vbuLLYPEgEO2HGhScAZSXU7 bwVlf/dzW7OwuWJAE0Ylrf6cvf887oQBMULo820B3En945VvrSLxtl4DZ1qKnswZxki1 pSt6XDjgqVzbwoz2bTJpXSqBpShUoq1w8znSJLAqiaNhYdy9nC6V9Yj6DiD0UVPOEdJO DebZyXBh+wFvod4eGqfaMfYfzfUEo7jHn6CO+6FU+BcgEmXjB+jl6pMJc/E+QFORn66k Rf/WP8oiox1XeNO1wDPlzjbw/2clKpAeXgNN3d7VUiTyop0t1nZZi2y7u5S//oH7gyuI jpfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698293648; x=1698898448; 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=lPY9mxzDBbOf1owj0FOY1MUzjClJ3s1wsYFvJx2toV4=; b=VQJ1dKwP/JObWAvuPCJoZDsgxeJ+uCJE/yCx6Xb2AIfi+70HZviYTifyURjb1ffeQx BbwxMlZT+h2vsv3+gqVIFJGpmXtjxUWK0tTjatFrhMUQj5XkV3zceSiaEsVEBqppcyTV wHaEEaI+MR8cwipWz0oPMnbFnpIi+9av0ofQz+8tyeDqSlsWpvn0sNB9ozq9mDjfRaW2 YV/FTib0IvcB/6ASodAtNartSjiFrgCKZnr9iIAgH0xLUKAJvGQSDJZSIDJvngrj9LpD pBfLM9U6iaR+ysoU24WgmkuK3ZlaIdJaLuCz8/FqHaXNB77u8Oow/BGfa8SUwPh66I7S pf8A== X-Gm-Message-State: AOJu0YwbfdklVsnWi8USNn3JKSbIMLurHAo3ci3rzpVKhxIgn2lXrykl 6E6KZx++C4UoMjB0S7ScXNsHCAEXjxSQpSvCRvk= X-Google-Smtp-Source: AGHT+IFkaI6LUNRwyFKX9xzw6jO1vE22RxU4GVfFBe7jyHbWcGPWac+SVbNw4i4wd+zhuHFHS2q/ag== X-Received: by 2002:a17:902:f686:b0:1c7:5f03:8562 with SMTP id l6-20020a170902f68600b001c75f038562mr19992779plg.30.1698293648581; Wed, 25 Oct 2023 21:14:08 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 4/6] tcg/mips: Implement neg opcodes Date: Wed, 25 Oct 2023 21:14:02 -0700 Message-Id: <20231026041404.1229328-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231026041404.1229328-1-richard.henderson@linaro.org> References: <20231026041404.1229328-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::634; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x634.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1698293712353100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson --- 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 =20 /* 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 */ =20 #if TCG_TARGET_REG_BITS =3D=3D 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 f9b790ed8a..c38f5c9450 100644 --- a/tcg/mips/tcg-target.c.inc +++ b/tcg/mips/tcg-target.c.inc @@ -1935,6 +1935,12 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, tcg_out_opc_reg(s, OPC_MFHI, a1, 0, 0); break; =20 + case INDEX_op_neg_i32: + i1 =3D OPC_SUBU; + goto do_unary; + case INDEX_op_neg_i64: + i1 =3D OPC_DSUBU; + goto do_unary; case INDEX_op_not_i32: case INDEX_op_not_i64: i1 =3D OPC_NOR; @@ -2159,6 +2165,7 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpc= ode 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: @@ -2172,6 +2179,7 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpc= ode 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: --=20 2.34.1