From patchwork Thu Oct 26 04:13:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 738316 Delivered-To: patch@linaro.org Received: by 2002:adf:f842:0:b0:32d:baff:b0ca with SMTP id d2csp618281wrq; Wed, 25 Oct 2023 21:16:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGA8miGMYjitR/dNY3Ons2+Fj1vuYXCKTiAzw0K5OESamVDDp0g8K41zO1TiRfVWzK9Mcn7 X-Received: by 2002:a05:622a:1492:b0:41e:3de2:c8ff with SMTP id t18-20020a05622a149200b0041e3de2c8ffmr1770695qtx.51.1698293759671; Wed, 25 Oct 2023 21:15:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698293759; cv=none; d=google.com; s=arc-20160816; b=lbxnWaZDGUYsb1qmxzmTFUfI29XgbxhGGLP4igVoDE8xlhHpcvAS8mvtjCHgTVuMZt 012lwHVWfii1oPGS7brgwALtiENuxQFZzaBpSOOT6/uLUBjEkdhdQWaae7lYHtultrpB z5beIvlJXfYbmSJ8wYvydsl5iLYPl3s999mNusshnI96mFT9DueDxsC1aBQTUioVVI3M 8LqJPTDXbO81a7wa/tlc+V3CMWNKnMWZlJen57lQdMYjToEPA9sUCfAyR/b6E3IG3acO a24ltwOjJCMSs7LkROZ/cCQuO2xAZEy1R7JkAH1ZcZIyhEPHPKi60uwt7KMi+SAkfWtI 315A== 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:message-id:date:subject:to:from:dkim-signature; bh=yWl3X9ckwF3yG0ZK9oFC4Uk2YcUEOZHmKJfJvllMuI0=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=FTgr9pqgFO5iwQxcyGgxjZIct75gJd1LZLm78RfhY+PkWJijSMpJa9WEAjuiWdCjAw kJaWsYowznwjYJG8QIcr9su0nH0y9qEgJ7dfu8V1qkapqblO+ywmoI3yvOLm383m9Cxs 7Dswb6vtcov4TSUb8TLsD9DmVap+jx2OGaujLAxB2Jf2EiQmYU7GBUaEGapePcPA2tfn 1wJJR5437vk/Znu2Ofbk2urd6eHj+eUDQXmu+hp+BFDVkeRoktKweT0pKoSwQx/f8jqg mWGs5iq/dVs6TErZ+Ai+49/dMLwS6JGnEZArZWpsZpuCH2hYRIpakb85aeFmVpMlbsCh Luwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RJYcnHHd; 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 d22-20020a05622a101600b0041816224c33si8807947qte.384.2023.10.25.21.15.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 25 Oct 2023 21:15:59 -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=RJYcnHHd; 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 1qvrl9-0002Wv-92; Thu, 26 Oct 2023 00:14:15 -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-0002VV-Aa for qemu-devel@nongnu.org; Thu, 26 Oct 2023 00:14:13 -0400 Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qvrl2-0000ip-B9 for qemu-devel@nongnu.org; Thu, 26 Oct 2023 00:14:13 -0400 Received: by mail-pg1-x52e.google.com with SMTP id 41be03b00d2f7-577e62e2adfso397868a12.2 for ; Wed, 25 Oct 2023 21:14:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698293645; x=1698898445; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=yWl3X9ckwF3yG0ZK9oFC4Uk2YcUEOZHmKJfJvllMuI0=; b=RJYcnHHd+fTVe1zCfNpW3l8lDNuUNsWQWMHf4rgjVc6M7YX0CR3sdERZpor+tdvOXT N0y8tQ5MGD/uwsjUKsbG+CMvQBI5p2hMYhid6lRw4PxOSzJP8ehhd5Z1cIi2FYQxPUHa yQbgoD16DKp4xhom7Bz7PIdrdfMuO57MYjzU8t7F16MBqLLFbg9ErTdH0JvfpNUFDIEX Gt2QNM39kpUGsGtdtdHfhrUI7lFwNt/o6FiHXGHbOBk/KVGfz5yuNxCdVpqG/jCw2RzQ WoyjUI9KHQSzRsAGqiOsQ/xPPPwcaDgsZj1cesoBcnnWkE/9N1tJsQrY/j/3PHn6JH0D To5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698293645; x=1698898445; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=yWl3X9ckwF3yG0ZK9oFC4Uk2YcUEOZHmKJfJvllMuI0=; b=MLPuucaf0JBt91LXgvzRjjhXAgZhkMZFnSKMWQqY2HpvrV2jJ4/d2KXGI8R5sYE97v pwL3DNWW38FyfQvsK0H2ieYHsQxfldyXhyZUeLuEmw+p6Kqegazhy1NVJfF8WNqJPTyO R3enSuc1rTlHcpwk1h7R0U4Q6ycIBloAbDukd+XZe8mwdTmHaY8+/ekg3XPFZX/ZO83p +/oRBvz+toc7weHMI2cFrLFrjimpaI980V0F0U9w8j1GztY5cSwdMnhluq06VvJrReuV XjP4mHj81FZCpLo22x9yL98o3CtDAINuQJY5ks1yfroNZVglYZEYx0aKE9R0O7Cmm4G1 1LpQ== X-Gm-Message-State: AOJu0YxHn4OQt0c6O1O+HYMN2mhY669bONctU1H7c2BKF6DxBcUxhG5N l2zoqG1vvd5ao60dh+9GpI7kkKYHO2U0hXqSl6E= X-Received: by 2002:a05:6a20:914a:b0:17e:2afd:4087 with SMTP id x10-20020a056a20914a00b0017e2afd4087mr7867299pzc.56.1698293645370; Wed, 25 Oct 2023 21:14:05 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id i12-20020a170902eb4c00b001b8b2b95068sm9953929pli.204.2023.10.25.21.14.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 21:14:04 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 0/6] tcg: Always implement neg and movcond Date: Wed, 25 Oct 2023 21:13:58 -0700 Message-Id: <20231026041404.1229328-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 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-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, T_SPF_TEMPERROR=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 Having opcodes always present means that we can remove some tests. NOT and MOVCOND were *almost* always present anyway. A close candidate is NOT. The hiccup is s390x: except for the most recent hardware revision, there is no single insn which can implement the operation. I experimented with replacements: i32: xilf r,-1 (6 bytes, requires R=X) lcr r,x; ahi r,-1 (6 bytes) i64: lcgr r,x; aghi r,-1 (8 bytes) But both don't compare well with the current lghi tmp,-1 (4 bytes, shared) xgrk r,x,tmp (4 bytes) With the constant -1 managed by register allocation, it gets loaded once and then reused between operations. An alternative might be to assume the presence of all opcodes during initial expansion and lower them later, after optimization. I'm close to doing just that for the more complex opcodes like deposit anyway, because the expansion is too complex for the optimizer to do anything sensible after constant propagation. r~ Richard Henderson (6): tcg/mips: Split out tcg_out_setcond_int tcg/mips: Always implement movcond tcg: Remove TCG_TARGET_HAS_movcond_{i32,i64} tcg/mips: Implement neg opcodes tcg/loongarch64: Implement neg opcodes tcg: Remove TCG_TARGET_HAS_neg_{i32,i64} include/tcg/tcg-op-common.h | 12 +- include/tcg/tcg-opc.h | 8 +- include/tcg/tcg.h | 2 - tcg/aarch64/tcg-target.h | 4 - tcg/arm/tcg-target.h | 2 - tcg/i386/tcg-target.h | 4 - tcg/loongarch64/tcg-target.h | 4 - tcg/mips/tcg-target.h | 4 - tcg/ppc/tcg-target.h | 4 - tcg/riscv/tcg-target.h | 4 - tcg/s390x/tcg-target.h | 4 - tcg/sparc64/tcg-target.h | 4 - tcg/tci/tcg-target.h | 4 - tcg/optimize.c | 15 +- tcg/tcg-op.c | 60 ++--- tcg/tcg.c | 12 +- tcg/tci.c | 2 - tcg/loongarch64/tcg-target.c.inc | 9 + tcg/mips/tcg-target.c.inc | 383 +++++++++++++------------------ 19 files changed, 192 insertions(+), 349 deletions(-)