From patchwork Fri Jan 17 18:23:49 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858212 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp841887wrb; Fri, 17 Jan 2025 10:26:12 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUqmsCK23Y64HHO+ouRjFXE4hU9bqD/gOl2qYPiHre3rzSN8a0VMktfZeCrFNON8iohLej9CA==@linaro.org X-Google-Smtp-Source: AGHT+IErjxFrQj8eSqS/cvHGYrbrgRWCogTR7OJih2A5NIDEgCtYZZST+vXIYPjNECz0UPlnN5E6 X-Received: by 2002:a05:6214:19cd:b0:6d8:8d87:e5b4 with SMTP id 6a1803df08f44-6e1b2186a4emr79827146d6.19.1737138372596; Fri, 17 Jan 2025 10:26:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138372; cv=none; d=google.com; s=arc-20240605; b=X3Ha8KqAuo4Qhb7/8Ga8xbjzXSbQLZz5vGGFZyiEn8idXU+LDA6DQBgfigQXRAKMF1 X0YPkFhZAf9rMfCNebdsGuv+n7mhmkq/bFuIX67JNFKSBoQQPjtaEaJGryU14lCSb8GA HrkWi2lQSldSbkYUHv+RaWI76e2IbS3C3hHZe+g7HkIG684ojayG71e18q3uW+r3OSN3 W07FfRWqSPPrXs6prCQgC9HgbuYAEIWhqs0G1MhmivLd+YyioIE6NQc/zrDDMccAHXLm hxt5oT0ocLrc/zVuqSuX5KlCtzcdIg9Otz21kvN8j78z4QSjt5VkoiipXB/pfK96rVlN kqyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=6S52snYHijLwx57nwxGZtQUutA8vgOZxNo/jj2SLduk=; fh=j7Cmyqi3/gQ6PVbMIYTABTAC5JDdWyCAx0HC845o5JA=; b=DU2yGtv8+gGxaXSIiTLwoJVH9cHiNhtWJ+LrpLWb60xyXhp1IuTK+RCNWaAxQ0qUDd od1f/lmrSnsBnG7tqLCbYHpEA+mnNolOueCn3EjbUkxAUOMGR1qcfnLRtIl+mUQi0Cex KMZ9RToEiZoz5qK72p580X76qpHIoxCaQpIrVOMIbOcQqGcLfJtS4V0M+aKZ+W0cOoIj QtMC+TzDYNmyNKljpo6Dy74WTmVn4RUFXcdoh9GWna32wIEmvNruaBSoiQz1bzJESGie MMUiEDRbtMtft8wOoD0toXK2KZil7drosJiAWXe0LgpVh5FgUCffHboFRaJX3hDkH4Mk +PHw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JJjjqY+M; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6e1afcd98f5si29158676d6.262.2025.01.17.10.26.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:26:12 -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=JJjjqY+M; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr1j-0003t8-Pc; Fri, 17 Jan 2025 13:25:03 -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 1tYr1i-0003sa-5O for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:02 -0500 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr1g-0007dY-5r for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:01 -0500 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-2161eb95317so48430405ad.1 for ; Fri, 17 Jan 2025 10:24:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138299; x=1737743099; 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=6S52snYHijLwx57nwxGZtQUutA8vgOZxNo/jj2SLduk=; b=JJjjqY+MPhFDd0ocvNOvVyYp64cF/iS4vR2oYDEdz3jhHu+qWoaol9lFlr/VhvcJfq 76wlunQckAZ6byPPFig5vG105iZhWhIuK2LNe2miCSCyPVsahGkMwHyshy2/D9Jf/RLC p04V5cyycNIl3Qv/HFMgqoLWhjWzlGSxARwVrrURQ8kiQFFhbEIMlf4wFxA30CoAo1w2 s00CqprwFgLPeXC97bcYmUsYsyaBzc+v/F7k0VmOLSLW4AUIXgeZ2Liccbx9IE+4iHj2 kp/1lRnTBgdQ0YUJZg66EOmYKuxEEQ5WIWSnkz27MDNv51y+2bJcjx0/nhNcRQs1OvIe WuKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138299; x=1737743099; 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=6S52snYHijLwx57nwxGZtQUutA8vgOZxNo/jj2SLduk=; b=F83UDtnigYYBxvj71PKjHirJiyZ2ztTicwnPkC6ip5k9022kmU7rD/64fMbJ8fpNQf 8juMFb+4j0/1r8HrDJiLsmXjJcZNtVauW5WDrG3DgNVAR+ORAFcAbYXtpz5+U7Bmzfxs twPbLd1oopn6XdDtXT2MefVP5hwl25Q0E2p+80xjJE/57BbmQ5a6WMb7oqNbq8MrQm20 IejlxV4fGTygUn5MtJYJWDweHaRw/EWNGg6eEl8FShFQQhBfPJPzCxlPthnHLBhQgaVe BWAdoZaTtATLfe7OL8s05qHA0PTSHJYlHYg2d/4sLLqQGW2HVVWZhGVVRYhPbjk3lPu/ 3o+g== X-Gm-Message-State: AOJu0YwGFb21PAO8lyrs2klyGCIMK6CK0b5729U1brwqhfqeOlx1LnYP T171YlIb82jRqbB3z5BU5pb81b+eF9ZwX5jpQ6aEQJz0CeJjAfROsv00xy/7UVlVgqXd9NxRFJg W X-Gm-Gg: ASbGncsYAhizzxZrXSlmP2VG4WyHdadtToomnqIIVw7pWkRkC/Uv7Ca9WJdBYN+Ylmc QsXXTC8ApfC5lo7dTlAJrJuAbrQ3PO8NUjvvRLZx9y2hAKLLOnQgCiS9Ltx6oDgwYxI5URMcqbm tKe4IL9zOOK5EXtlVWIUa8v6kEq+rg1+AS+yrYQAcmZfg8c0q3KgA9ebVG3R+fIW1QO13tg9nXt GREnJCJUTLMqcV+oycnpq+zINyno66wCX4K/BQSoAX5o8nu7YLQcIzSKJMZn//guQZPrGUpJS1K 8OSGWHYXxUxEtMs= X-Received: by 2002:a17:902:c951:b0:216:5268:9aab with SMTP id d9443c01a7336-21c355e832amr44404635ad.46.1737138298775; Fri, 17 Jan 2025 10:24:58 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21c2d3acccesm18879005ad.123.2025.01.17.10.24.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:24:58 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: LIU Zhiwei Subject: [PULL 01/68] disas/riscv: Guard dec->cfg dereference for host disassemble Date: Fri, 17 Jan 2025 10:23:49 -0800 Message-ID: <20250117182456.2077110-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x632.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: LIU Zhiwei For riscv host, it will set dec->cfg to zero. Thus we shuld guard the dec->cfg deference for riscv host disassemble. And in general, we should only use dec->cfg for target in three cases: 1) For not incompatible encodings, such as zcmp/zcmt/zfinx. 2) For maybe-ops encodings, they are better to be disassembled to the "real" extensions, such as zicfiss. The guard of dec->zimop and dec->zcmop is for comment and avoid check for every extension that encoded in maybe-ops area. 3) For custom encodings, we have to use dec->cfg to disassemble custom encodings using the same encoding area. Signed-off-by: LIU Zhiwei Suggested-by: Richard Henderson Signed-off-by: Richard Henderson Message-ID: <20241206032411.52528-1-zhiwei_liu@linux.alibaba.com> --- disas/riscv.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/disas/riscv.c b/disas/riscv.c index 9c1e332dde..4075ed6bfe 100644 --- a/disas/riscv.c +++ b/disas/riscv.c @@ -2611,7 +2611,7 @@ static void decode_inst_opcode(rv_decode *dec, rv_isa isa) break; case 2: op = rv_op_c_li; break; case 3: - if (dec->cfg->ext_zcmop) { + if (dec->cfg && dec->cfg->ext_zcmop) { if ((((inst >> 2) & 0b111111) == 0b100000) && (((inst >> 11) & 0b11) == 0b0)) { unsigned int cmop_code = 0; @@ -2712,7 +2712,7 @@ static void decode_inst_opcode(rv_decode *dec, rv_isa isa) op = rv_op_c_sqsp; } else { op = rv_op_c_fsdsp; - if (dec->cfg->ext_zcmp && ((inst >> 12) & 0b01)) { + if (dec->cfg && dec->cfg->ext_zcmp && ((inst >> 12) & 0b01)) { switch ((inst >> 8) & 0b01111) { case 8: if (((inst >> 4) & 0b01111) >= 4) { @@ -2738,7 +2738,7 @@ static void decode_inst_opcode(rv_decode *dec, rv_isa isa) } else { switch ((inst >> 10) & 0b011) { case 0: - if (!dec->cfg->ext_zcmt) { + if (dec->cfg && !dec->cfg->ext_zcmt) { break; } if (((inst >> 2) & 0xFF) >= 32) { @@ -2748,7 +2748,7 @@ static void decode_inst_opcode(rv_decode *dec, rv_isa isa) } break; case 3: - if (!dec->cfg->ext_zcmp) { + if (dec->cfg && !dec->cfg->ext_zcmp) { break; } switch ((inst >> 5) & 0b011) { @@ -2956,7 +2956,7 @@ static void decode_inst_opcode(rv_decode *dec, rv_isa isa) break; case 5: op = rv_op_auipc; - if (dec->cfg->ext_zicfilp && + if (dec->cfg && dec->cfg->ext_zicfilp && (((inst >> 7) & 0b11111) == 0b00000)) { op = rv_op_lpad; } @@ -4058,7 +4058,7 @@ static void decode_inst_opcode(rv_decode *dec, rv_isa isa) case 2: op = rv_op_csrrs; break; case 3: op = rv_op_csrrc; break; case 4: - if (dec->cfg->ext_zimop) { + if (dec->cfg && dec->cfg->ext_zimop) { int imm_mop5, imm_mop3, reg_num; if ((extract32(inst, 22, 10) & 0b1011001111) == 0b1000000111) { @@ -5112,28 +5112,28 @@ static GString *format_inst(size_t tab, rv_decode *dec) g_string_append(buf, rv_ireg_name_sym[dec->rs2]); break; case '3': - if (dec->cfg->ext_zfinx) { + if (dec->cfg && dec->cfg->ext_zfinx) { g_string_append(buf, rv_ireg_name_sym[dec->rd]); } else { g_string_append(buf, rv_freg_name_sym[dec->rd]); } break; case '4': - if (dec->cfg->ext_zfinx) { + if (dec->cfg && dec->cfg->ext_zfinx) { g_string_append(buf, rv_ireg_name_sym[dec->rs1]); } else { g_string_append(buf, rv_freg_name_sym[dec->rs1]); } break; case '5': - if (dec->cfg->ext_zfinx) { + if (dec->cfg && dec->cfg->ext_zfinx) { g_string_append(buf, rv_ireg_name_sym[dec->rs2]); } else { g_string_append(buf, rv_freg_name_sym[dec->rs2]); } break; case '6': - if (dec->cfg->ext_zfinx) { + if (dec->cfg && dec->cfg->ext_zfinx) { g_string_append(buf, rv_ireg_name_sym[dec->rs3]); } else { g_string_append(buf, rv_freg_name_sym[dec->rs3]); @@ -5439,7 +5439,8 @@ static GString *disasm_inst(rv_isa isa, uint64_t pc, rv_inst inst, const rv_opcode_data *opcode_data = decoders[i].opcode_data; void (*decode_func)(rv_decode *, rv_isa) = decoders[i].decode_func; - if (guard_func(cfg)) { + /* always_true_p don't dereference cfg */ + if (((i == 0) || cfg) && guard_func(cfg)) { dec.opcode_data = opcode_data; decode_func(&dec, isa); if (dec.op != rv_op_illegal) From patchwork Fri Jan 17 18:23:50 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858269 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp845268wrb; Fri, 17 Jan 2025 10:33:56 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUTPTrQ8tpFlwPsHwO+C0ZE0z8YusZbInyDxGL7EG9AwspDjs7J5piEl205mrDQTD9AW/6/Pw==@linaro.org X-Google-Smtp-Source: AGHT+IFgBeUSNZ71uIX2+mKUCondVM3aj47Ub2Bud/vnoOAKbDgc9NoYyaLH/F9dE8fllNEx80uI X-Received: by 2002:a05:6214:762:b0:6d1:7433:3670 with SMTP id 6a1803df08f44-6e1b216921bmr59028676d6.4.1737138836185; Fri, 17 Jan 2025 10:33:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138836; cv=none; d=google.com; s=arc-20240605; b=Hkwnbp/krbr3AUUCCleqoElY9T+yXLvln598Bn3v7DqKik4ivukEdPpe4qOLJWvOjQ YLM2lI2Q0qQhZUN8iI4dStaFB83AiJbeUBAlNn+TrP1EL6YpZt9w+lYDbq6ggF70vinl 2X9IbQapZyqC5yVQgKo+B/AU3drPMoULMji1vN1nZEk4c89PKFvKXKIwMAckeGBud40O KuJbRdNWG+yuNunZbpO6hr4fjIu9rRTXTN3vVGuAPt9TTWFypjGUtQGmPpHyDgVVBeYp mIM/e1DuMbZvzzICvdR178FcqyceRpOf/tzlCFA9EP+a8JOwkwx8spDLoRsLaJAnTB8B iITw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=3GPj/dHv/OtqEUrzEcxJI0azKZQpu1Wxa2/jDsuCpfY=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=OQuCMz+tcVeHj6GWeT7pFcoS1J1WIRycCXPTMUvotgIa1PDmhKre6ybBSSZOiFlCD5 EJ8V65M0IUlz1i9b3dWiKcG7EVz8iAJ0s8onjjfL7ZHChfZE7y1orTrxo2ZllrXf/7Ob RzoX5FinAARMLfG9skTjLyVzxE9tSkzeEH3ImrybTv3gZ1TWfdkCxzAc2MR+mjBAZm/t dHashlKJGA9Foxc49x6mxevsV19uc/lVNQvTnIhiIkS+iiy0C3m/ylvGBD0C56dM08Cm PtMfMwMuo1Mda0/8TFjNB2dJ+Zncy+9dIcrvV2mECpR69kKGTXBDmwtkqKz/RVqAiEcs uk+g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oWabex41; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46e10453519si33353091cf.452.2025.01.17.10.33.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:33:56 -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=oWabex41; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr1n-0003ty-AW; Fri, 17 Jan 2025 13:25:07 -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 1tYr1k-0003tE-Up for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:04 -0500 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 1tYr1i-0007dg-9K for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:04 -0500 Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-21644aca3a0so58940615ad.3 for ; Fri, 17 Jan 2025 10:25:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138300; x=1737743100; 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=3GPj/dHv/OtqEUrzEcxJI0azKZQpu1Wxa2/jDsuCpfY=; b=oWabex41/VOF8Du7aS8F5zWsbjiirmJqos6u6nIp5XcHrQ9Ce7/Ii1ijiOY/nO4HBZ xEJ6V7Jm1rWYE/1hOOiEKnD3BwB7OCjBgUx3wAIS7UPoykK+FM2374Tb2fhbC5oUsmSn HoFM9B688fv6bT9nfv0epBGfHS5cM12fzdh1oUcftF+BXIZOQRFd8miJSP5K0pgH3jZ/ pzbXrP22bO03PzX1a3XtgnwReJ1EbMItEVfeFBXaLG8QNtcdzWrPy9IRTHD51IbRk85r UwYK62zryYkBpdPursR+NDSmKle6NqzYklrlAD1KwxU2hIxUmpIN5rwfLqikq1BhKbie 9Q1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138300; x=1737743100; 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=3GPj/dHv/OtqEUrzEcxJI0azKZQpu1Wxa2/jDsuCpfY=; b=TB2Uh9VOUwLRwoVQcxtGq7pkgZsEyAx/y668D5uVGJUIh7gGCFiUacKLft/2GMeEOH kYHl37zZDrzhbR6pXLr8vd9zmgdYH7w+g4UJXCI4b4A27RyK+hkKpM2YZLZ0zxrGkvbo u+54YNx04W1Nt5+em5+1vdG8+1XvpDIWfj+qtIno5zvbZzyRZTltTja8pvunXqqtoVlq HEh8vRny7QdsmMBEU7tkAL0142OTHKhIHJpt6qy4J109IRY68TtiLX+UrHVr+mwuPd+c 7ifkzwygJ4tAIiJxeGOaattsISpNw4/trvPp+d5JYkPxSpUZZpTEsw+7I3HDbaDGKcwi D5ZA== X-Gm-Message-State: AOJu0YzDJq4hpk51nl8QBUkBw0WVZaR7/2Wftl4MJwut9XDnRY2nwI5N lnlPn26Eg9wDLqFjzdurHzLXfK8c8xVZXic9sNknWQiv3Tku8o4QYaxZdwUABhxLu+otz9JseLN S X-Gm-Gg: ASbGncvFVy1InpcCpl+l6+zqh4PijMM/YJqAlyYQa9W6HcekXzAUlZW1RynTCm4ZMGQ OV3BZatPb1DFbZ0SckzYuf1jbozjnopaY80zQbCOlJLRr+R0Hc+PX0n+YI86xi+Ul2mardAfPPt Bqjg2b5DmzjBPqvYfcRZKetG3X5yC+mRY6OmStpYLlkAOmo4jiSjccw4PmzPQWQqIklPnnX+oaN Kh69/lAq4FAoDqch2EddO5MOLklaFdmd3XqXPNyLD0g2bvgCctz/KpsIvKNNfFEYeLUxwIlMjtJ KWkBST6QSDfUpUw= X-Received: by 2002:a17:902:e802:b0:212:615f:c1 with SMTP id d9443c01a7336-21c3540a0admr66480735ad.14.1737138299662; Fri, 17 Jan 2025 10:24:59 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21c2d3acccesm18879005ad.123.2025.01.17.10.24.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:24:59 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 02/68] tcg: Move call abi parameters from tcg-target.h to tcg-target.c.inc Date: Fri, 17 Jan 2025 10:23:50 -0800 Message-ID: <20250117182456.2077110-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org These defines are not required outside of tcg/tcg.c, which includes tcg-target.c.inc before use. Reduces the exported symbol set of tcg-target.h. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/aarch64/tcg-target.h | 13 ------------- tcg/arm/tcg-target.h | 8 -------- tcg/i386/tcg-target.h | 20 -------------------- tcg/loongarch64/tcg-target.h | 9 --------- tcg/mips/tcg-target.h | 14 -------------- tcg/riscv/tcg-target.h | 9 --------- tcg/s390x/tcg-target.h | 8 -------- tcg/sparc64/tcg-target.h | 11 ----------- tcg/tci/tcg-target.h | 14 -------------- tcg/aarch64/tcg-target.c.inc | 13 +++++++++++++ tcg/arm/tcg-target.c.inc | 8 ++++++++ tcg/i386/tcg-target.c.inc | 20 ++++++++++++++++++++ tcg/loongarch64/tcg-target.c.inc | 9 +++++++++ tcg/mips/tcg-target.c.inc | 14 ++++++++++++++ tcg/riscv/tcg-target.c.inc | 9 +++++++++ tcg/s390x/tcg-target.c.inc | 8 ++++++++ tcg/sparc64/tcg-target.c.inc | 10 ++++++++++ tcg/tci/tcg-target.c.inc | 14 ++++++++++++++ 18 files changed, 105 insertions(+), 106 deletions(-) diff --git a/tcg/aarch64/tcg-target.h b/tcg/aarch64/tcg-target.h index 8bd9e6a5eb..cb24c0d276 100644 --- a/tcg/aarch64/tcg-target.h +++ b/tcg/aarch64/tcg-target.h @@ -49,19 +49,6 @@ typedef enum { #define TCG_TARGET_NB_REGS 64 -/* used for function call generation */ -#define TCG_REG_CALL_STACK TCG_REG_SP -#define TCG_TARGET_STACK_ALIGN 16 -#define TCG_TARGET_CALL_STACK_OFFSET 0 -#define TCG_TARGET_CALL_ARG_I32 TCG_CALL_ARG_NORMAL -#define TCG_TARGET_CALL_ARG_I64 TCG_CALL_ARG_NORMAL -#ifdef CONFIG_DARWIN -# define TCG_TARGET_CALL_ARG_I128 TCG_CALL_ARG_NORMAL -#else -# define TCG_TARGET_CALL_ARG_I128 TCG_CALL_ARG_EVEN -#endif -#define TCG_TARGET_CALL_RET_I128 TCG_CALL_RET_NORMAL - #define have_lse (cpuinfo & CPUINFO_LSE) #define have_lse2 (cpuinfo & CPUINFO_LSE2) diff --git a/tcg/arm/tcg-target.h b/tcg/arm/tcg-target.h index fb7261499b..8abf15aef4 100644 --- a/tcg/arm/tcg-target.h +++ b/tcg/arm/tcg-target.h @@ -85,14 +85,6 @@ extern bool use_idiv_instructions; extern bool use_neon_instructions; #endif -/* used for function call generation */ -#define TCG_TARGET_STACK_ALIGN 8 -#define TCG_TARGET_CALL_STACK_OFFSET 0 -#define TCG_TARGET_CALL_ARG_I32 TCG_CALL_ARG_NORMAL -#define TCG_TARGET_CALL_ARG_I64 TCG_CALL_ARG_EVEN -#define TCG_TARGET_CALL_ARG_I128 TCG_CALL_ARG_EVEN -#define TCG_TARGET_CALL_RET_I128 TCG_CALL_RET_BY_REF - /* optional instructions */ #define TCG_TARGET_HAS_ext8s_i32 1 #define TCG_TARGET_HAS_ext16s_i32 1 diff --git a/tcg/i386/tcg-target.h b/tcg/i386/tcg-target.h index c68ac023d8..c81d509f1c 100644 --- a/tcg/i386/tcg-target.h +++ b/tcg/i386/tcg-target.h @@ -90,26 +90,6 @@ typedef enum { TCG_REG_CALL_STACK = TCG_REG_ESP } TCGReg; -/* used for function call generation */ -#define TCG_TARGET_STACK_ALIGN 16 -#if defined(_WIN64) -#define TCG_TARGET_CALL_STACK_OFFSET 32 -#else -#define TCG_TARGET_CALL_STACK_OFFSET 0 -#endif -#define TCG_TARGET_CALL_ARG_I32 TCG_CALL_ARG_NORMAL -#define TCG_TARGET_CALL_ARG_I64 TCG_CALL_ARG_NORMAL -#if defined(_WIN64) -# define TCG_TARGET_CALL_ARG_I128 TCG_CALL_ARG_BY_REF -# define TCG_TARGET_CALL_RET_I128 TCG_CALL_RET_BY_VEC -#elif TCG_TARGET_REG_BITS == 64 -# define TCG_TARGET_CALL_ARG_I128 TCG_CALL_ARG_NORMAL -# define TCG_TARGET_CALL_RET_I128 TCG_CALL_RET_NORMAL -#else -# define TCG_TARGET_CALL_ARG_I128 TCG_CALL_ARG_NORMAL -# define TCG_TARGET_CALL_RET_I128 TCG_CALL_RET_BY_REF -#endif - #define have_bmi1 (cpuinfo & CPUINFO_BMI1) #define have_popcnt (cpuinfo & CPUINFO_POPCNT) #define have_avx1 (cpuinfo & CPUINFO_AVX1) diff --git a/tcg/loongarch64/tcg-target.h b/tcg/loongarch64/tcg-target.h index 58bd7d258e..7811530c8a 100644 --- a/tcg/loongarch64/tcg-target.h +++ b/tcg/loongarch64/tcg-target.h @@ -87,15 +87,6 @@ typedef enum { TCG_VEC_TMP0 = TCG_REG_V23, } TCGReg; -/* used for function call generation */ -#define TCG_REG_CALL_STACK TCG_REG_SP -#define TCG_TARGET_STACK_ALIGN 16 -#define TCG_TARGET_CALL_STACK_OFFSET 0 -#define TCG_TARGET_CALL_ARG_I32 TCG_CALL_ARG_NORMAL -#define TCG_TARGET_CALL_ARG_I64 TCG_CALL_ARG_NORMAL -#define TCG_TARGET_CALL_ARG_I128 TCG_CALL_ARG_NORMAL -#define TCG_TARGET_CALL_RET_I128 TCG_CALL_RET_NORMAL - /* optional instructions */ #define TCG_TARGET_HAS_negsetcond_i32 0 #define TCG_TARGET_HAS_div_i32 1 diff --git a/tcg/mips/tcg-target.h b/tcg/mips/tcg-target.h index a996aa171d..d9b9f6a965 100644 --- a/tcg/mips/tcg-target.h +++ b/tcg/mips/tcg-target.h @@ -70,20 +70,6 @@ typedef enum { TCG_AREG0 = TCG_REG_S8, } TCGReg; -/* used for function call generation */ -#define TCG_TARGET_STACK_ALIGN 16 -#if _MIPS_SIM == _ABIO32 -# define TCG_TARGET_CALL_STACK_OFFSET 16 -# define TCG_TARGET_CALL_ARG_I64 TCG_CALL_ARG_EVEN -# define TCG_TARGET_CALL_RET_I128 TCG_CALL_RET_BY_REF -#else -# define TCG_TARGET_CALL_STACK_OFFSET 0 -# define TCG_TARGET_CALL_ARG_I64 TCG_CALL_ARG_NORMAL -# define TCG_TARGET_CALL_RET_I128 TCG_CALL_RET_NORMAL -#endif -#define TCG_TARGET_CALL_ARG_I32 TCG_CALL_ARG_NORMAL -#define TCG_TARGET_CALL_ARG_I128 TCG_CALL_ARG_EVEN - /* MOVN/MOVZ instructions detection */ #if (defined(__mips_isa_rev) && (__mips_isa_rev >= 1)) || \ defined(_MIPS_ARCH_LOONGSON2E) || defined(_MIPS_ARCH_LOONGSON2F) || \ diff --git a/tcg/riscv/tcg-target.h b/tcg/riscv/tcg-target.h index 334c37cbe6..d23306738a 100644 --- a/tcg/riscv/tcg-target.h +++ b/tcg/riscv/tcg-target.h @@ -59,15 +59,6 @@ typedef enum { TCG_REG_TMP2 = TCG_REG_T4, } TCGReg; -/* used for function call generation */ -#define TCG_REG_CALL_STACK TCG_REG_SP -#define TCG_TARGET_STACK_ALIGN 16 -#define TCG_TARGET_CALL_STACK_OFFSET 0 -#define TCG_TARGET_CALL_ARG_I32 TCG_CALL_ARG_NORMAL -#define TCG_TARGET_CALL_ARG_I64 TCG_CALL_ARG_NORMAL -#define TCG_TARGET_CALL_ARG_I128 TCG_CALL_ARG_NORMAL -#define TCG_TARGET_CALL_RET_I128 TCG_CALL_RET_NORMAL - /* optional instructions */ #define TCG_TARGET_HAS_negsetcond_i32 1 #define TCG_TARGET_HAS_div_i32 1 diff --git a/tcg/s390x/tcg-target.h b/tcg/s390x/tcg-target.h index 86aeca166f..7e0bf687b9 100644 --- a/tcg/s390x/tcg-target.h +++ b/tcg/s390x/tcg-target.h @@ -165,14 +165,6 @@ extern uint64_t s390_facilities[3]; #define TCG_TARGET_HAS_cmpsel_vec 1 #define TCG_TARGET_HAS_tst_vec 0 -/* used for function call generation */ -#define TCG_TARGET_STACK_ALIGN 8 -#define TCG_TARGET_CALL_STACK_OFFSET 160 -#define TCG_TARGET_CALL_ARG_I32 TCG_CALL_ARG_EXTEND -#define TCG_TARGET_CALL_ARG_I64 TCG_CALL_ARG_NORMAL -#define TCG_TARGET_CALL_ARG_I128 TCG_CALL_ARG_BY_REF -#define TCG_TARGET_CALL_RET_I128 TCG_CALL_RET_BY_REF - #define TCG_TARGET_DEFAULT_MO (TCG_MO_ALL & ~TCG_MO_ST_LD) #define TCG_TARGET_NEED_LDST_LABELS #define TCG_TARGET_NEED_POOL_LABELS diff --git a/tcg/sparc64/tcg-target.h b/tcg/sparc64/tcg-target.h index a18906a14e..0705308951 100644 --- a/tcg/sparc64/tcg-target.h +++ b/tcg/sparc64/tcg-target.h @@ -64,17 +64,6 @@ typedef enum { TCG_REG_I7, } TCGReg; -/* used for function call generation */ -#define TCG_REG_CALL_STACK TCG_REG_O6 - -#define TCG_TARGET_STACK_BIAS 2047 -#define TCG_TARGET_STACK_ALIGN 16 -#define TCG_TARGET_CALL_STACK_OFFSET (128 + 6*8 + TCG_TARGET_STACK_BIAS) -#define TCG_TARGET_CALL_ARG_I32 TCG_CALL_ARG_EXTEND -#define TCG_TARGET_CALL_ARG_I64 TCG_CALL_ARG_NORMAL -#define TCG_TARGET_CALL_ARG_I128 TCG_CALL_ARG_NORMAL -#define TCG_TARGET_CALL_RET_I128 TCG_CALL_RET_NORMAL - #if defined(__VIS__) && __VIS__ >= 0x300 #define use_vis3_instructions 1 #else diff --git a/tcg/tci/tcg-target.h b/tcg/tci/tcg-target.h index a076f401d2..d7650343a3 100644 --- a/tcg/tci/tcg-target.h +++ b/tcg/tci/tcg-target.h @@ -146,20 +146,6 @@ typedef enum { TCG_REG_CALL_STACK = TCG_REG_R15, } TCGReg; -/* Used for function call generation. */ -#define TCG_TARGET_CALL_STACK_OFFSET 0 -#define TCG_TARGET_STACK_ALIGN 8 -#if TCG_TARGET_REG_BITS == 32 -# define TCG_TARGET_CALL_ARG_I32 TCG_CALL_ARG_EVEN -# define TCG_TARGET_CALL_ARG_I64 TCG_CALL_ARG_EVEN -# define TCG_TARGET_CALL_ARG_I128 TCG_CALL_ARG_EVEN -#else -# define TCG_TARGET_CALL_ARG_I32 TCG_CALL_ARG_NORMAL -# define TCG_TARGET_CALL_ARG_I64 TCG_CALL_ARG_NORMAL -# define TCG_TARGET_CALL_ARG_I128 TCG_CALL_ARG_NORMAL -#endif -#define TCG_TARGET_CALL_RET_I128 TCG_CALL_RET_NORMAL - #define HAVE_TCG_QEMU_TB_EXEC #define TCG_TARGET_NEED_POOL_LABELS diff --git a/tcg/aarch64/tcg-target.c.inc b/tcg/aarch64/tcg-target.c.inc index ffa8a3e519..0b018d3247 100644 --- a/tcg/aarch64/tcg-target.c.inc +++ b/tcg/aarch64/tcg-target.c.inc @@ -14,6 +14,19 @@ #include "../tcg-pool.c.inc" #include "qemu/bitops.h" +/* Used for function call generation. */ +#define TCG_REG_CALL_STACK TCG_REG_SP +#define TCG_TARGET_STACK_ALIGN 16 +#define TCG_TARGET_CALL_STACK_OFFSET 0 +#define TCG_TARGET_CALL_ARG_I32 TCG_CALL_ARG_NORMAL +#define TCG_TARGET_CALL_ARG_I64 TCG_CALL_ARG_NORMAL +#ifdef CONFIG_DARWIN +# define TCG_TARGET_CALL_ARG_I128 TCG_CALL_ARG_NORMAL +#else +# define TCG_TARGET_CALL_ARG_I128 TCG_CALL_ARG_EVEN +#endif +#define TCG_TARGET_CALL_RET_I128 TCG_CALL_RET_NORMAL + /* We're going to re-use TCGType in setting of the SF bit, which controls the size of the operation performed. If we know the values match, it makes things much cleaner. */ diff --git a/tcg/arm/tcg-target.c.inc b/tcg/arm/tcg-target.c.inc index 56072d89a2..f0674f23a5 100644 --- a/tcg/arm/tcg-target.c.inc +++ b/tcg/arm/tcg-target.c.inc @@ -35,6 +35,14 @@ bool use_idiv_instructions; bool use_neon_instructions; #endif +/* Used for function call generation. */ +#define TCG_TARGET_STACK_ALIGN 8 +#define TCG_TARGET_CALL_STACK_OFFSET 0 +#define TCG_TARGET_CALL_ARG_I32 TCG_CALL_ARG_NORMAL +#define TCG_TARGET_CALL_ARG_I64 TCG_CALL_ARG_EVEN +#define TCG_TARGET_CALL_ARG_I128 TCG_CALL_ARG_EVEN +#define TCG_TARGET_CALL_RET_I128 TCG_CALL_RET_BY_REF + #ifdef CONFIG_DEBUG_TCG static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = { "%r0", "%r1", "%r2", "%r3", "%r4", "%r5", "%r6", "%r7", diff --git a/tcg/i386/tcg-target.c.inc b/tcg/i386/tcg-target.c.inc index 1bf50f1f62..aaf6107284 100644 --- a/tcg/i386/tcg-target.c.inc +++ b/tcg/i386/tcg-target.c.inc @@ -25,6 +25,26 @@ #include "../tcg-ldst.c.inc" #include "../tcg-pool.c.inc" +/* Used for function call generation. */ +#define TCG_TARGET_STACK_ALIGN 16 +#if defined(_WIN64) +#define TCG_TARGET_CALL_STACK_OFFSET 32 +#else +#define TCG_TARGET_CALL_STACK_OFFSET 0 +#endif +#define TCG_TARGET_CALL_ARG_I32 TCG_CALL_ARG_NORMAL +#define TCG_TARGET_CALL_ARG_I64 TCG_CALL_ARG_NORMAL +#if defined(_WIN64) +# define TCG_TARGET_CALL_ARG_I128 TCG_CALL_ARG_BY_REF +# define TCG_TARGET_CALL_RET_I128 TCG_CALL_RET_BY_VEC +#elif TCG_TARGET_REG_BITS == 64 +# define TCG_TARGET_CALL_ARG_I128 TCG_CALL_ARG_NORMAL +# define TCG_TARGET_CALL_RET_I128 TCG_CALL_RET_NORMAL +#else +# define TCG_TARGET_CALL_ARG_I128 TCG_CALL_ARG_NORMAL +# define TCG_TARGET_CALL_RET_I128 TCG_CALL_RET_BY_REF +#endif + #ifdef CONFIG_DEBUG_TCG static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = { #if TCG_TARGET_REG_BITS == 64 diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc index 973601aec3..8ae561bfc0 100644 --- a/tcg/loongarch64/tcg-target.c.inc +++ b/tcg/loongarch64/tcg-target.c.inc @@ -32,6 +32,15 @@ #include "../tcg-ldst.c.inc" #include +/* used for function call generation */ +#define TCG_REG_CALL_STACK TCG_REG_SP +#define TCG_TARGET_STACK_ALIGN 16 +#define TCG_TARGET_CALL_STACK_OFFSET 0 +#define TCG_TARGET_CALL_ARG_I32 TCG_CALL_ARG_NORMAL +#define TCG_TARGET_CALL_ARG_I64 TCG_CALL_ARG_NORMAL +#define TCG_TARGET_CALL_ARG_I128 TCG_CALL_ARG_NORMAL +#define TCG_TARGET_CALL_RET_I128 TCG_CALL_RET_NORMAL + #ifdef CONFIG_DEBUG_TCG static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = { "zero", diff --git a/tcg/mips/tcg-target.c.inc b/tcg/mips/tcg-target.c.inc index 3b5b5c6d5b..ed41cd7f1b 100644 --- a/tcg/mips/tcg-target.c.inc +++ b/tcg/mips/tcg-target.c.inc @@ -27,6 +27,20 @@ #include "../tcg-ldst.c.inc" #include "../tcg-pool.c.inc" +/* used for function call generation */ +#define TCG_TARGET_STACK_ALIGN 16 +#if _MIPS_SIM == _ABIO32 +# define TCG_TARGET_CALL_STACK_OFFSET 16 +# define TCG_TARGET_CALL_ARG_I64 TCG_CALL_ARG_EVEN +# define TCG_TARGET_CALL_RET_I128 TCG_CALL_RET_BY_REF +#else +# define TCG_TARGET_CALL_STACK_OFFSET 0 +# define TCG_TARGET_CALL_ARG_I64 TCG_CALL_ARG_NORMAL +# define TCG_TARGET_CALL_RET_I128 TCG_CALL_RET_NORMAL +#endif +#define TCG_TARGET_CALL_ARG_I32 TCG_CALL_ARG_NORMAL +#define TCG_TARGET_CALL_ARG_I128 TCG_CALL_ARG_EVEN + #if TCG_TARGET_REG_BITS == 32 # define LO_OFF (HOST_BIG_ENDIAN * 4) # define HI_OFF (4 - LO_OFF) diff --git a/tcg/riscv/tcg-target.c.inc b/tcg/riscv/tcg-target.c.inc index 96f9a7e348..34402fee2a 100644 --- a/tcg/riscv/tcg-target.c.inc +++ b/tcg/riscv/tcg-target.c.inc @@ -30,6 +30,15 @@ #include "../tcg-ldst.c.inc" #include "../tcg-pool.c.inc" +/* Used for function call generation. */ +#define TCG_REG_CALL_STACK TCG_REG_SP +#define TCG_TARGET_STACK_ALIGN 16 +#define TCG_TARGET_CALL_STACK_OFFSET 0 +#define TCG_TARGET_CALL_ARG_I32 TCG_CALL_ARG_NORMAL +#define TCG_TARGET_CALL_ARG_I64 TCG_CALL_ARG_NORMAL +#define TCG_TARGET_CALL_ARG_I128 TCG_CALL_ARG_NORMAL +#define TCG_TARGET_CALL_RET_I128 TCG_CALL_RET_NORMAL + #ifdef CONFIG_DEBUG_TCG static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = { "zero", "ra", "sp", "gp", "tp", "t0", "t1", "t2", diff --git a/tcg/s390x/tcg-target.c.inc b/tcg/s390x/tcg-target.c.inc index 27bccc14e5..b1188525b2 100644 --- a/tcg/s390x/tcg-target.c.inc +++ b/tcg/s390x/tcg-target.c.inc @@ -28,6 +28,14 @@ #include "../tcg-pool.c.inc" #include "elf.h" +/* Used for function call generation. */ +#define TCG_TARGET_STACK_ALIGN 8 +#define TCG_TARGET_CALL_STACK_OFFSET 160 +#define TCG_TARGET_CALL_ARG_I32 TCG_CALL_ARG_EXTEND +#define TCG_TARGET_CALL_ARG_I64 TCG_CALL_ARG_NORMAL +#define TCG_TARGET_CALL_ARG_I128 TCG_CALL_ARG_BY_REF +#define TCG_TARGET_CALL_RET_I128 TCG_CALL_RET_BY_REF + #define TCG_CT_CONST_S16 (1 << 8) #define TCG_CT_CONST_S32 (1 << 9) #define TCG_CT_CONST_U32 (1 << 10) diff --git a/tcg/sparc64/tcg-target.c.inc b/tcg/sparc64/tcg-target.c.inc index 32f9ec24b5..c9d105c35a 100644 --- a/tcg/sparc64/tcg-target.c.inc +++ b/tcg/sparc64/tcg-target.c.inc @@ -30,6 +30,16 @@ #include "../tcg-ldst.c.inc" #include "../tcg-pool.c.inc" +/* Used for function call generation. */ +#define TCG_REG_CALL_STACK TCG_REG_O6 +#define TCG_TARGET_STACK_BIAS 2047 +#define TCG_TARGET_STACK_ALIGN 16 +#define TCG_TARGET_CALL_STACK_OFFSET (128 + 6 * 8 + TCG_TARGET_STACK_BIAS) +#define TCG_TARGET_CALL_ARG_I32 TCG_CALL_ARG_EXTEND +#define TCG_TARGET_CALL_ARG_I64 TCG_CALL_ARG_NORMAL +#define TCG_TARGET_CALL_ARG_I128 TCG_CALL_ARG_NORMAL +#define TCG_TARGET_CALL_RET_I128 TCG_CALL_RET_NORMAL + #ifdef CONFIG_DEBUG_TCG static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = { "%g0", diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index c740864b96..e6c97e8153 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -24,6 +24,20 @@ #include "../tcg-pool.c.inc" +/* Used for function call generation. */ +#define TCG_TARGET_CALL_STACK_OFFSET 0 +#define TCG_TARGET_STACK_ALIGN 8 +#if TCG_TARGET_REG_BITS == 32 +# define TCG_TARGET_CALL_ARG_I32 TCG_CALL_ARG_EVEN +# define TCG_TARGET_CALL_ARG_I64 TCG_CALL_ARG_EVEN +# define TCG_TARGET_CALL_ARG_I128 TCG_CALL_ARG_EVEN +#else +# define TCG_TARGET_CALL_ARG_I32 TCG_CALL_ARG_NORMAL +# define TCG_TARGET_CALL_ARG_I64 TCG_CALL_ARG_NORMAL +# define TCG_TARGET_CALL_ARG_I128 TCG_CALL_ARG_NORMAL +#endif +#define TCG_TARGET_CALL_RET_I128 TCG_CALL_RET_NORMAL + static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) { switch (op) { From patchwork Fri Jan 17 18:23:51 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858252 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp844559wrb; Fri, 17 Jan 2025 10:32:16 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXV8fIsUJe7Zci0LDNVlDLlVfv7mWZn9+3Ph6y90Yhli/KboyBYMHLbqqbQo2/Kopke2fBXQQ==@linaro.org X-Google-Smtp-Source: AGHT+IE2ZWVuB/koUoxnSQTlY3umRxWQaoeRU0sxvvk3Y1ptMiiRdciLUhb/MBRNOBlK3GiZ11qW X-Received: by 2002:a05:622a:1495:b0:46c:7141:9087 with SMTP id d75a77b69052e-46e12a1fbd0mr58460961cf.1.1737138736423; Fri, 17 Jan 2025 10:32:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138736; cv=none; d=google.com; s=arc-20240605; b=XhQpAWT/OX51JzifSu/jJv6Wy5TcKtkQK6hR3dsFQ5T6JuKtC7eLX66Vvbe6hNTKyL wt/FMslhQfbaO5IEZnUIMAuFGfdxkjlvKkpfAbDSUzFfWaJj/v2dy5M5vBV/X3havKNR exD9tzYTmGEiwo47gOjY/lywr7Vtt6FTLEVEGyXyZ3lwKLwlVaSAOA87F/MB0gY5nD0p 6cLeVSSFpwgWrgRX1EJB50YU3ZWE6A8Vxz62hxZu+yam1Y10F6pW7O9GCuLYS1D97WB+ 2txIvkBsFtpodOiy6zVJ6KozygiUvnAjWkgHz6WB7GnbN2vWoM+emEex3oHbJ6nUks2E hlcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=1NVJG2bsQGfiTlauYkPfoYl9GjxI4oxR+grahJAAroQ=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=jP33xFUtePCvdjmUdqzBpUlD6t1U23KRQfCeVVa6Q4LPu95fuY5R/5jXNYLOenXasA r2mlpHAp7fMjxwEynkqA7cbfX6rlr8yozrpLjaJZ4CosUSSKafu83wTRz2/WL6/wqtO0 Cfy7GsZMK+eYwi5whjJGXO+0XBm6HO30f/bdRlYlmxO9ttfldKxc7kWWZFev5loA6X1G 9vcbf38ts8LQ7eqJ8lQOFzUUE23LZ6mV2ttpX8vZOZKkGA+VRz/QikFv9a15d213M1MM F6ooqz+m3aSRy0ecGPKXxtxtoI2PyjoP8E7SaUvmrcu+A/NIUoJfckuObJVy4qeYUstg c4Ug==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VtRDn1H8; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id ada2fe7eead31-4b68a2f9a74si1159206137.256.2025.01.17.10.32.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:32:16 -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=VtRDn1H8; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr1n-0003tz-AC; Fri, 17 Jan 2025 13:25:07 -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 1tYr1l-0003tT-MQ for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:05 -0500 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr1i-0007dj-CH for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:05 -0500 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-21649a7bcdcso45791925ad.1 for ; Fri, 17 Jan 2025 10:25:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138300; x=1737743100; 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=1NVJG2bsQGfiTlauYkPfoYl9GjxI4oxR+grahJAAroQ=; b=VtRDn1H83P8PP0huwIgUNqtZs32sOhBjXpt5ZuP0VemT2MS1Z5SsNHbur6d4OxdyKO +qTFnoikSBVsNRvNG2J9mbtVN/KJAggz+6JSAlefpTWVRPZIrlOnM0w4EsYCpW6Ni3Pn CNstNGK9YZ/uqLI4uGN0aLL6rE4Dh0XVPk+uL7oP0qCc2IbPkw/RaTdZA6wNDc0iYLmt nptr6Ky/9l3uC+KuMIgNJhsvgNFhpgVwo2C9dE44jruXJkFD4BPz4AYB4R6tdQnJqwH/ diFvycbrecuq5riOtOQHiHCmlTRCsKUyYqXgBqRSZzmzD/R8xM5o4nauOkFyX8aYtk9o cOVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138300; x=1737743100; 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=1NVJG2bsQGfiTlauYkPfoYl9GjxI4oxR+grahJAAroQ=; b=eZKlO82B7ECUdlBJQP6DAsv4p19J1FM/YWWXdSzGnus1RgrnyFoVI4kljN+wg1bbTo mMbr/Po/HZQ0uFJiYKGRAeVe9w0C6ADcrow4Wy7Nh6NiyLtnV3HtFnlEljIOLzhOhy+E +CdGRpNCiXcQ6vZF/i4Wi87fcfCbN9MYIrVbxUKozsqXtqEBcOIsbDmU4awtHL8HXYFy L2StLD1RrZOuRU4f6D69fke89LhaKySi30s4Z05zyo4If/wMxfyCAD1ra2MhOhQRrX/D Y2fbohrXxitVqDxOKqOnbJI0mqKHsXDdX+ca++EhjWSepn7Q8lbLd0zSJIQVwIbm4vgC rlpg== X-Gm-Message-State: AOJu0YwMPNJFLYOPbZpaF4xAQwuMi63xBWA1GlMIqYMpbQ26KPUD/8r7 /R/T3DeVZNPX/WQQlZNlmBq0nI1lKmDOOvzah2m4VPhFfMppzA9pU7iKNhaboDMs46FYMr+GSzW S X-Gm-Gg: ASbGncuHzs8mLouvhYOyW5zPmndAI9yV+63NyX4xf55A4qTh/BeTQdsOeVNtQFVnJ7d 5BZtL4104+qyWErTrWxRypNNHij0RQoVLS26agC7lt98kTLZtEUsjBYRXzwNkXB0F4oW01B6/od OIC6kqD+jHhywuQJnT6A3tcrrRjZOykPuKcov418q9vsKzIqoaOPH06RKaByuSAsMhQ/plApniZ ybskgKJ8PvVJ1n8HPEBrLfpaEbYti4KcIQsiNlD6010I2QLpc7RL8Y0Drvvl0Ay2Qh9v9L2kxYT TAUFxmkKa6+Nelg= X-Received: by 2002:a17:902:e751:b0:215:9d29:9724 with SMTP id d9443c01a7336-21c355c6146mr58886345ad.38.1737138300428; Fri, 17 Jan 2025 10:25:00 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21c2d3acccesm18879005ad.123.2025.01.17.10.24.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:25:00 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 03/68] tcg: Replace TCGOP_VECL with TCGOP_TYPE Date: Fri, 17 Jan 2025 10:23:51 -0800 Message-ID: <20250117182456.2077110-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62d; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62d.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 In the replacement, drop the TCGType - TCG_TYPE_V64 adjustment, except for the call to tcg_out_vec_op. Pass type to tcg_gen_op[1-6], so that all integer opcodes gain the type. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/tcg/tcg.h | 2 +- tcg/tcg-internal.h | 13 ++--- tcg/optimize.c | 10 +--- tcg/tcg-op-ldst.c | 26 ++++++---- tcg/tcg-op-vec.c | 8 +-- tcg/tcg-op.c | 113 +++++++++++++++++++++++------------------ tcg/tcg.c | 11 ++-- docs/devel/tcg-ops.rst | 15 +++--- 8 files changed, 105 insertions(+), 93 deletions(-) diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h index a77ed12b9d..fe053296ac 100644 --- a/include/tcg/tcg.h +++ b/include/tcg/tcg.h @@ -439,7 +439,7 @@ struct TCGOp { #define TCGOP_CALLI(X) (X)->param1 #define TCGOP_CALLO(X) (X)->param2 -#define TCGOP_VECL(X) (X)->param1 +#define TCGOP_TYPE(X) (X)->param1 #define TCGOP_VECE(X) (X)->param2 /* Make sure operands fit in the bitfields above. */ diff --git a/tcg/tcg-internal.h b/tcg/tcg-internal.h index 8099248076..072b36d85c 100644 --- a/tcg/tcg-internal.h +++ b/tcg/tcg-internal.h @@ -92,12 +92,13 @@ TCGTemp *tcg_temp_new_internal(TCGType type, TCGTempKind kind); */ TCGTemp *tcg_constant_internal(TCGType type, int64_t val); -TCGOp *tcg_gen_op1(TCGOpcode, TCGArg); -TCGOp *tcg_gen_op2(TCGOpcode, TCGArg, TCGArg); -TCGOp *tcg_gen_op3(TCGOpcode, TCGArg, TCGArg, TCGArg); -TCGOp *tcg_gen_op4(TCGOpcode, TCGArg, TCGArg, TCGArg, TCGArg); -TCGOp *tcg_gen_op5(TCGOpcode, TCGArg, TCGArg, TCGArg, TCGArg, TCGArg); -TCGOp *tcg_gen_op6(TCGOpcode, TCGArg, TCGArg, TCGArg, TCGArg, TCGArg, TCGArg); +TCGOp *tcg_gen_op1(TCGOpcode, TCGType, TCGArg); +TCGOp *tcg_gen_op2(TCGOpcode, TCGType, TCGArg, TCGArg); +TCGOp *tcg_gen_op3(TCGOpcode, TCGType, TCGArg, TCGArg, TCGArg); +TCGOp *tcg_gen_op4(TCGOpcode, TCGType, TCGArg, TCGArg, TCGArg, TCGArg); +TCGOp *tcg_gen_op5(TCGOpcode, TCGType, TCGArg, TCGArg, TCGArg, TCGArg, TCGArg); +TCGOp *tcg_gen_op6(TCGOpcode, TCGType, TCGArg, TCGArg, + TCGArg, TCGArg, TCGArg, TCGArg); void vec_gen_2(TCGOpcode, TCGType, unsigned, TCGArg, TCGArg); void vec_gen_3(TCGOpcode, TCGType, unsigned, TCGArg, TCGArg, TCGArg); diff --git a/tcg/optimize.c b/tcg/optimize.c index c23f0d1392..6823569ee2 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -370,7 +370,7 @@ static bool tcg_opt_gen_mov(OptContext *ctx, TCGOp *op, TCGArg dst, TCGArg src) case TCG_TYPE_V64: case TCG_TYPE_V128: case TCG_TYPE_V256: - /* TCGOP_VECL and TCGOP_VECE remain unchanged. */ + /* TCGOP_TYPE and TCGOP_VECE remain unchanged. */ new_op = INDEX_op_mov_vec; break; default: @@ -2866,13 +2866,7 @@ void tcg_optimize(TCGContext *s) copy_propagate(&ctx, op, def->nb_oargs, def->nb_iargs); /* Pre-compute the type of the operation. */ - if (def->flags & TCG_OPF_VECTOR) { - ctx.type = TCG_TYPE_V64 + TCGOP_VECL(op); - } else if (def->flags & TCG_OPF_64BIT) { - ctx.type = TCG_TYPE_I64; - } else { - ctx.type = TCG_TYPE_I32; - } + ctx.type = TCGOP_TYPE(op); /* * Process each opcode. diff --git a/tcg/tcg-op-ldst.c b/tcg/tcg-op-ldst.c index a318011229..0d8fe3b4f5 100644 --- a/tcg/tcg-op-ldst.c +++ b/tcg/tcg-op-ldst.c @@ -87,14 +87,15 @@ static MemOp tcg_canonicalize_memop(MemOp op, bool is64, bool st) return op; } -static void gen_ldst(TCGOpcode opc, TCGTemp *vl, TCGTemp *vh, +static void gen_ldst(TCGOpcode opc, TCGType type, TCGTemp *vl, TCGTemp *vh, TCGTemp *addr, MemOpIdx oi) { if (TCG_TARGET_REG_BITS == 64 || tcg_ctx->addr_type == TCG_TYPE_I32) { if (vh) { - tcg_gen_op4(opc, temp_arg(vl), temp_arg(vh), temp_arg(addr), oi); + tcg_gen_op4(opc, type, temp_arg(vl), temp_arg(vh), + temp_arg(addr), oi); } else { - tcg_gen_op3(opc, temp_arg(vl), temp_arg(addr), oi); + tcg_gen_op3(opc, type, temp_arg(vl), temp_arg(addr), oi); } } else { /* See TCGV_LOW/HIGH. */ @@ -102,10 +103,11 @@ static void gen_ldst(TCGOpcode opc, TCGTemp *vl, TCGTemp *vh, TCGTemp *ah = addr + !HOST_BIG_ENDIAN; if (vh) { - tcg_gen_op5(opc, temp_arg(vl), temp_arg(vh), + tcg_gen_op5(opc, type, temp_arg(vl), temp_arg(vh), temp_arg(al), temp_arg(ah), oi); } else { - tcg_gen_op4(opc, temp_arg(vl), temp_arg(al), temp_arg(ah), oi); + tcg_gen_op4(opc, type, temp_arg(vl), + temp_arg(al), temp_arg(ah), oi); } } } @@ -115,9 +117,9 @@ static void gen_ldst_i64(TCGOpcode opc, TCGv_i64 v, TCGTemp *addr, MemOpIdx oi) if (TCG_TARGET_REG_BITS == 32) { TCGTemp *vl = tcgv_i32_temp(TCGV_LOW(v)); TCGTemp *vh = tcgv_i32_temp(TCGV_HIGH(v)); - gen_ldst(opc, vl, vh, addr, oi); + gen_ldst(opc, TCG_TYPE_I64, vl, vh, addr, oi); } else { - gen_ldst(opc, tcgv_i64_temp(v), NULL, addr, oi); + gen_ldst(opc, TCG_TYPE_I64, tcgv_i64_temp(v), NULL, addr, oi); } } @@ -250,7 +252,7 @@ static void tcg_gen_qemu_ld_i32_int(TCGv_i32 val, TCGTemp *addr, } else { opc = INDEX_op_qemu_ld_a64_i32; } - gen_ldst(opc, tcgv_i32_temp(val), NULL, addr, oi); + gen_ldst(opc, TCG_TYPE_I32, tcgv_i32_temp(val), NULL, addr, oi); plugin_gen_mem_callbacks_i32(val, copy_addr, addr, orig_oi, QEMU_PLUGIN_MEM_R); @@ -319,7 +321,7 @@ static void tcg_gen_qemu_st_i32_int(TCGv_i32 val, TCGTemp *addr, opc = INDEX_op_qemu_st_a64_i32; } } - gen_ldst(opc, tcgv_i32_temp(val), NULL, addr, oi); + gen_ldst(opc, TCG_TYPE_I32, tcgv_i32_temp(val), NULL, addr, oi); plugin_gen_mem_callbacks_i32(val, NULL, addr, orig_oi, QEMU_PLUGIN_MEM_W); if (swap) { @@ -590,7 +592,8 @@ static void tcg_gen_qemu_ld_i128_int(TCGv_i128 val, TCGTemp *addr, } else { opc = INDEX_op_qemu_ld_a64_i128; } - gen_ldst(opc, tcgv_i64_temp(lo), tcgv_i64_temp(hi), addr, oi); + gen_ldst(opc, TCG_TYPE_I128, tcgv_i64_temp(lo), + tcgv_i64_temp(hi), addr, oi); if (need_bswap) { tcg_gen_bswap64_i64(lo, lo); @@ -710,7 +713,8 @@ static void tcg_gen_qemu_st_i128_int(TCGv_i128 val, TCGTemp *addr, } else { opc = INDEX_op_qemu_st_a64_i128; } - gen_ldst(opc, tcgv_i64_temp(lo), tcgv_i64_temp(hi), addr, oi); + gen_ldst(opc, TCG_TYPE_I128, tcgv_i64_temp(lo), + tcgv_i64_temp(hi), addr, oi); if (need_bswap) { tcg_temp_free_i64(lo); diff --git a/tcg/tcg-op-vec.c b/tcg/tcg-op-vec.c index d4bb4aee74..364cd089df 100644 --- a/tcg/tcg-op-vec.c +++ b/tcg/tcg-op-vec.c @@ -143,7 +143,7 @@ bool tcg_can_emit_vecop_list(const TCGOpcode *list, void vec_gen_2(TCGOpcode opc, TCGType type, unsigned vece, TCGArg r, TCGArg a) { TCGOp *op = tcg_emit_op(opc, 2); - TCGOP_VECL(op) = type - TCG_TYPE_V64; + TCGOP_TYPE(op) = type; TCGOP_VECE(op) = vece; op->args[0] = r; op->args[1] = a; @@ -153,7 +153,7 @@ void vec_gen_3(TCGOpcode opc, TCGType type, unsigned vece, TCGArg r, TCGArg a, TCGArg b) { TCGOp *op = tcg_emit_op(opc, 3); - TCGOP_VECL(op) = type - TCG_TYPE_V64; + TCGOP_TYPE(op) = type; TCGOP_VECE(op) = vece; op->args[0] = r; op->args[1] = a; @@ -164,7 +164,7 @@ void vec_gen_4(TCGOpcode opc, TCGType type, unsigned vece, TCGArg r, TCGArg a, TCGArg b, TCGArg c) { TCGOp *op = tcg_emit_op(opc, 4); - TCGOP_VECL(op) = type - TCG_TYPE_V64; + TCGOP_TYPE(op) = type; TCGOP_VECE(op) = vece; op->args[0] = r; op->args[1] = a; @@ -176,7 +176,7 @@ void vec_gen_6(TCGOpcode opc, TCGType type, unsigned vece, TCGArg r, TCGArg a, TCGArg b, TCGArg c, TCGArg d, TCGArg e) { TCGOp *op = tcg_emit_op(opc, 6); - TCGOP_VECL(op) = type - TCG_TYPE_V64; + TCGOP_TYPE(op) = type; TCGOP_VECE(op) = vece; op->args[0] = r; op->args[1] = a; diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c index 4a7e705367..872fb22ef8 100644 --- a/tcg/tcg-op.c +++ b/tcg/tcg-op.c @@ -37,34 +37,39 @@ */ #define NI __attribute__((noinline)) -TCGOp * NI tcg_gen_op1(TCGOpcode opc, TCGArg a1) +TCGOp * NI tcg_gen_op1(TCGOpcode opc, TCGType type, TCGArg a1) { TCGOp *op = tcg_emit_op(opc, 1); + TCGOP_TYPE(op) = type; op->args[0] = a1; return op; } -TCGOp * NI tcg_gen_op2(TCGOpcode opc, TCGArg a1, TCGArg a2) +TCGOp * NI tcg_gen_op2(TCGOpcode opc, TCGType type, TCGArg a1, TCGArg a2) { TCGOp *op = tcg_emit_op(opc, 2); + TCGOP_TYPE(op) = type; op->args[0] = a1; op->args[1] = a2; return op; } -TCGOp * NI tcg_gen_op3(TCGOpcode opc, TCGArg a1, TCGArg a2, TCGArg a3) +TCGOp * NI tcg_gen_op3(TCGOpcode opc, TCGType type, TCGArg a1, + TCGArg a2, TCGArg a3) { TCGOp *op = tcg_emit_op(opc, 3); + TCGOP_TYPE(op) = type; op->args[0] = a1; op->args[1] = a2; op->args[2] = a3; return op; } -TCGOp * NI tcg_gen_op4(TCGOpcode opc, TCGArg a1, TCGArg a2, +TCGOp * NI tcg_gen_op4(TCGOpcode opc, TCGType type, TCGArg a1, TCGArg a2, TCGArg a3, TCGArg a4) { TCGOp *op = tcg_emit_op(opc, 4); + TCGOP_TYPE(op) = type; op->args[0] = a1; op->args[1] = a2; op->args[2] = a3; @@ -72,10 +77,11 @@ TCGOp * NI tcg_gen_op4(TCGOpcode opc, TCGArg a1, TCGArg a2, return op; } -TCGOp * NI tcg_gen_op5(TCGOpcode opc, TCGArg a1, TCGArg a2, +TCGOp * NI tcg_gen_op5(TCGOpcode opc, TCGType type, TCGArg a1, TCGArg a2, TCGArg a3, TCGArg a4, TCGArg a5) { TCGOp *op = tcg_emit_op(opc, 5); + TCGOP_TYPE(op) = type; op->args[0] = a1; op->args[1] = a2; op->args[2] = a3; @@ -84,10 +90,11 @@ TCGOp * NI tcg_gen_op5(TCGOpcode opc, TCGArg a1, TCGArg a2, return op; } -TCGOp * NI tcg_gen_op6(TCGOpcode opc, TCGArg a1, TCGArg a2, TCGArg a3, - TCGArg a4, TCGArg a5, TCGArg a6) +TCGOp * NI tcg_gen_op6(TCGOpcode opc, TCGType type, TCGArg a1, TCGArg a2, + TCGArg a3, TCGArg a4, TCGArg a5, TCGArg a6) { TCGOp *op = tcg_emit_op(opc, 6); + TCGOP_TYPE(op) = type; op->args[0] = a1; op->args[1] = a2; op->args[2] = a3; @@ -107,132 +114,138 @@ TCGOp * NI tcg_gen_op6(TCGOpcode opc, TCGArg a1, TCGArg a2, TCGArg a3, # define DNI #endif -static void DNI tcg_gen_op1_i32(TCGOpcode opc, TCGv_i32 a1) +static void DNI tcg_gen_op1_i32(TCGOpcode opc, TCGType type, TCGv_i32 a1) { - tcg_gen_op1(opc, tcgv_i32_arg(a1)); + tcg_gen_op1(opc, type, tcgv_i32_arg(a1)); } -static void DNI tcg_gen_op1_i64(TCGOpcode opc, TCGv_i64 a1) +static void DNI tcg_gen_op1_i64(TCGOpcode opc, TCGType type, TCGv_i64 a1) { - tcg_gen_op1(opc, tcgv_i64_arg(a1)); + tcg_gen_op1(opc, type, tcgv_i64_arg(a1)); } -static TCGOp * DNI tcg_gen_op1i(TCGOpcode opc, TCGArg a1) +static TCGOp * DNI tcg_gen_op1i(TCGOpcode opc, TCGType type, TCGArg a1) { - return tcg_gen_op1(opc, a1); + return tcg_gen_op1(opc, type, a1); } static void DNI tcg_gen_op2_i32(TCGOpcode opc, TCGv_i32 a1, TCGv_i32 a2) { - tcg_gen_op2(opc, tcgv_i32_arg(a1), tcgv_i32_arg(a2)); + tcg_gen_op2(opc, TCG_TYPE_I32, tcgv_i32_arg(a1), tcgv_i32_arg(a2)); } static void DNI tcg_gen_op2_i64(TCGOpcode opc, TCGv_i64 a1, TCGv_i64 a2) { - tcg_gen_op2(opc, tcgv_i64_arg(a1), tcgv_i64_arg(a2)); + tcg_gen_op2(opc, TCG_TYPE_I64, tcgv_i64_arg(a1), tcgv_i64_arg(a2)); } static void DNI tcg_gen_op3_i32(TCGOpcode opc, TCGv_i32 a1, TCGv_i32 a2, TCGv_i32 a3) { - tcg_gen_op3(opc, tcgv_i32_arg(a1), tcgv_i32_arg(a2), tcgv_i32_arg(a3)); + tcg_gen_op3(opc, TCG_TYPE_I32, tcgv_i32_arg(a1), + tcgv_i32_arg(a2), tcgv_i32_arg(a3)); } static void DNI tcg_gen_op3_i64(TCGOpcode opc, TCGv_i64 a1, TCGv_i64 a2, TCGv_i64 a3) { - tcg_gen_op3(opc, tcgv_i64_arg(a1), tcgv_i64_arg(a2), tcgv_i64_arg(a3)); + tcg_gen_op3(opc, TCG_TYPE_I64, tcgv_i64_arg(a1), + tcgv_i64_arg(a2), tcgv_i64_arg(a3)); } static void DNI tcg_gen_op3i_i32(TCGOpcode opc, TCGv_i32 a1, TCGv_i32 a2, TCGArg a3) { - tcg_gen_op3(opc, tcgv_i32_arg(a1), tcgv_i32_arg(a2), a3); + tcg_gen_op3(opc, TCG_TYPE_I32, tcgv_i32_arg(a1), tcgv_i32_arg(a2), a3); } static void DNI tcg_gen_op3i_i64(TCGOpcode opc, TCGv_i64 a1, TCGv_i64 a2, TCGArg a3) { - tcg_gen_op3(opc, tcgv_i64_arg(a1), tcgv_i64_arg(a2), a3); + tcg_gen_op3(opc, TCG_TYPE_I64, tcgv_i64_arg(a1), tcgv_i64_arg(a2), a3); } static void DNI tcg_gen_ldst_op_i32(TCGOpcode opc, TCGv_i32 val, TCGv_ptr base, TCGArg offset) { - tcg_gen_op3(opc, tcgv_i32_arg(val), tcgv_ptr_arg(base), offset); + tcg_gen_op3(opc, TCG_TYPE_I32, tcgv_i32_arg(val), + tcgv_ptr_arg(base), offset); } static void DNI tcg_gen_ldst_op_i64(TCGOpcode opc, TCGv_i64 val, TCGv_ptr base, TCGArg offset) { - tcg_gen_op3(opc, tcgv_i64_arg(val), tcgv_ptr_arg(base), offset); + tcg_gen_op3(opc, TCG_TYPE_I64, tcgv_i64_arg(val), + tcgv_ptr_arg(base), offset); } static void DNI tcg_gen_op4_i32(TCGOpcode opc, TCGv_i32 a1, TCGv_i32 a2, TCGv_i32 a3, TCGv_i32 a4) { - tcg_gen_op4(opc, tcgv_i32_arg(a1), tcgv_i32_arg(a2), + tcg_gen_op4(opc, TCG_TYPE_I32, tcgv_i32_arg(a1), tcgv_i32_arg(a2), tcgv_i32_arg(a3), tcgv_i32_arg(a4)); } static void DNI tcg_gen_op4_i64(TCGOpcode opc, TCGv_i64 a1, TCGv_i64 a2, TCGv_i64 a3, TCGv_i64 a4) { - tcg_gen_op4(opc, tcgv_i64_arg(a1), tcgv_i64_arg(a2), + tcg_gen_op4(opc, TCG_TYPE_I64, tcgv_i64_arg(a1), tcgv_i64_arg(a2), tcgv_i64_arg(a3), tcgv_i64_arg(a4)); } static void DNI tcg_gen_op4i_i32(TCGOpcode opc, TCGv_i32 a1, TCGv_i32 a2, TCGv_i32 a3, TCGArg a4) { - tcg_gen_op4(opc, tcgv_i32_arg(a1), tcgv_i32_arg(a2), + tcg_gen_op4(opc, TCG_TYPE_I32, tcgv_i32_arg(a1), tcgv_i32_arg(a2), tcgv_i32_arg(a3), a4); } static void DNI tcg_gen_op4i_i64(TCGOpcode opc, TCGv_i64 a1, TCGv_i64 a2, TCGv_i64 a3, TCGArg a4) { - tcg_gen_op4(opc, tcgv_i64_arg(a1), tcgv_i64_arg(a2), + tcg_gen_op4(opc, TCG_TYPE_I64, tcgv_i64_arg(a1), tcgv_i64_arg(a2), tcgv_i64_arg(a3), a4); } static TCGOp * DNI tcg_gen_op4ii_i32(TCGOpcode opc, TCGv_i32 a1, TCGv_i32 a2, TCGArg a3, TCGArg a4) { - return tcg_gen_op4(opc, tcgv_i32_arg(a1), tcgv_i32_arg(a2), a3, a4); + return tcg_gen_op4(opc, TCG_TYPE_I32, + tcgv_i32_arg(a1), tcgv_i32_arg(a2), a3, a4); } static TCGOp * DNI tcg_gen_op4ii_i64(TCGOpcode opc, TCGv_i64 a1, TCGv_i64 a2, TCGArg a3, TCGArg a4) { - return tcg_gen_op4(opc, tcgv_i64_arg(a1), tcgv_i64_arg(a2), a3, a4); + return tcg_gen_op4(opc, TCG_TYPE_I64, + tcgv_i64_arg(a1), tcgv_i64_arg(a2), a3, a4); } static void DNI tcg_gen_op5_i32(TCGOpcode opc, TCGv_i32 a1, TCGv_i32 a2, TCGv_i32 a3, TCGv_i32 a4, TCGv_i32 a5) { - tcg_gen_op5(opc, tcgv_i32_arg(a1), tcgv_i32_arg(a2), + tcg_gen_op5(opc, TCG_TYPE_I32, tcgv_i32_arg(a1), tcgv_i32_arg(a2), tcgv_i32_arg(a3), tcgv_i32_arg(a4), tcgv_i32_arg(a5)); } static void DNI tcg_gen_op5_i64(TCGOpcode opc, TCGv_i64 a1, TCGv_i64 a2, TCGv_i64 a3, TCGv_i64 a4, TCGv_i64 a5) { - tcg_gen_op5(opc, tcgv_i64_arg(a1), tcgv_i64_arg(a2), + tcg_gen_op5(opc, TCG_TYPE_I64, tcgv_i64_arg(a1), tcgv_i64_arg(a2), tcgv_i64_arg(a3), tcgv_i64_arg(a4), tcgv_i64_arg(a5)); } static void DNI tcg_gen_op5ii_i32(TCGOpcode opc, TCGv_i32 a1, TCGv_i32 a2, TCGv_i32 a3, TCGArg a4, TCGArg a5) { - tcg_gen_op5(opc, tcgv_i32_arg(a1), tcgv_i32_arg(a2), + tcg_gen_op5(opc, TCG_TYPE_I32, tcgv_i32_arg(a1), tcgv_i32_arg(a2), tcgv_i32_arg(a3), a4, a5); } static void DNI tcg_gen_op5ii_i64(TCGOpcode opc, TCGv_i64 a1, TCGv_i64 a2, TCGv_i64 a3, TCGArg a4, TCGArg a5) { - tcg_gen_op5(opc, tcgv_i64_arg(a1), tcgv_i64_arg(a2), + tcg_gen_op5(opc, TCG_TYPE_I64, tcgv_i64_arg(a1), tcgv_i64_arg(a2), tcgv_i64_arg(a3), a4, a5); } @@ -240,7 +253,7 @@ static void DNI tcg_gen_op6_i32(TCGOpcode opc, TCGv_i32 a1, TCGv_i32 a2, TCGv_i32 a3, TCGv_i32 a4, TCGv_i32 a5, TCGv_i32 a6) { - tcg_gen_op6(opc, tcgv_i32_arg(a1), tcgv_i32_arg(a2), + tcg_gen_op6(opc, TCG_TYPE_I32, tcgv_i32_arg(a1), tcgv_i32_arg(a2), tcgv_i32_arg(a3), tcgv_i32_arg(a4), tcgv_i32_arg(a5), tcgv_i32_arg(a6)); } @@ -249,7 +262,7 @@ static void DNI tcg_gen_op6_i64(TCGOpcode opc, TCGv_i64 a1, TCGv_i64 a2, TCGv_i64 a3, TCGv_i64 a4, TCGv_i64 a5, TCGv_i64 a6) { - tcg_gen_op6(opc, tcgv_i64_arg(a1), tcgv_i64_arg(a2), + tcg_gen_op6(opc, TCG_TYPE_I64, tcgv_i64_arg(a1), tcgv_i64_arg(a2), tcgv_i64_arg(a3), tcgv_i64_arg(a4), tcgv_i64_arg(a5), tcgv_i64_arg(a6)); } @@ -258,7 +271,7 @@ static void DNI tcg_gen_op6i_i32(TCGOpcode opc, TCGv_i32 a1, TCGv_i32 a2, TCGv_i32 a3, TCGv_i32 a4, TCGv_i32 a5, TCGArg a6) { - tcg_gen_op6(opc, tcgv_i32_arg(a1), tcgv_i32_arg(a2), + tcg_gen_op6(opc, TCG_TYPE_I32, tcgv_i32_arg(a1), tcgv_i32_arg(a2), tcgv_i32_arg(a3), tcgv_i32_arg(a4), tcgv_i32_arg(a5), a6); } @@ -266,7 +279,7 @@ static void DNI tcg_gen_op6i_i64(TCGOpcode opc, TCGv_i64 a1, TCGv_i64 a2, TCGv_i64 a3, TCGv_i64 a4, TCGv_i64 a5, TCGArg a6) { - tcg_gen_op6(opc, tcgv_i64_arg(a1), tcgv_i64_arg(a2), + tcg_gen_op6(opc, TCG_TYPE_I64, tcgv_i64_arg(a1), tcgv_i64_arg(a2), tcgv_i64_arg(a3), tcgv_i64_arg(a4), tcgv_i64_arg(a5), a6); } @@ -274,7 +287,7 @@ static TCGOp * DNI tcg_gen_op6ii_i32(TCGOpcode opc, TCGv_i32 a1, TCGv_i32 a2, TCGv_i32 a3, TCGv_i32 a4, TCGArg a5, TCGArg a6) { - return tcg_gen_op6(opc, tcgv_i32_arg(a1), tcgv_i32_arg(a2), + return tcg_gen_op6(opc, TCG_TYPE_I32, tcgv_i32_arg(a1), tcgv_i32_arg(a2), tcgv_i32_arg(a3), tcgv_i32_arg(a4), a5, a6); } @@ -283,7 +296,7 @@ static TCGOp * DNI tcg_gen_op6ii_i32(TCGOpcode opc, TCGv_i32 a1, TCGv_i32 a2, void gen_set_label(TCGLabel *l) { l->present = 1; - tcg_gen_op1(INDEX_op_set_label, label_arg(l)); + tcg_gen_op1(INDEX_op_set_label, 0, label_arg(l)); } static void add_as_label_use(TCGLabel *l, TCGOp *op) @@ -296,7 +309,7 @@ static void add_as_label_use(TCGLabel *l, TCGOp *op) void tcg_gen_br(TCGLabel *l) { - add_as_label_use(l, tcg_gen_op1(INDEX_op_br, label_arg(l))); + add_as_label_use(l, tcg_gen_op1(INDEX_op_br, 0, label_arg(l))); } void tcg_gen_mb(TCGBar mb_type) @@ -314,25 +327,25 @@ void tcg_gen_mb(TCGBar mb_type) #endif if (parallel) { - tcg_gen_op1(INDEX_op_mb, mb_type); + tcg_gen_op1(INDEX_op_mb, 0, mb_type); } } void tcg_gen_plugin_cb(unsigned from) { - tcg_gen_op1(INDEX_op_plugin_cb, from); + tcg_gen_op1(INDEX_op_plugin_cb, 0, from); } void tcg_gen_plugin_mem_cb(TCGv_i64 addr, unsigned meminfo) { - tcg_gen_op2(INDEX_op_plugin_mem_cb, tcgv_i64_arg(addr), meminfo); + tcg_gen_op2(INDEX_op_plugin_mem_cb, 0, tcgv_i64_arg(addr), meminfo); } /* 32 bit ops */ void tcg_gen_discard_i32(TCGv_i32 arg) { - tcg_gen_op1_i32(INDEX_op_discard, arg); + tcg_gen_op1_i32(INDEX_op_discard, TCG_TYPE_I32, arg); } void tcg_gen_mov_i32(TCGv_i32 ret, TCGv_i32 arg) @@ -1467,7 +1480,7 @@ void tcg_gen_st_i32(TCGv_i32 arg1, TCGv_ptr arg2, tcg_target_long offset) void tcg_gen_discard_i64(TCGv_i64 arg) { if (TCG_TARGET_REG_BITS == 64) { - tcg_gen_op1_i64(INDEX_op_discard, arg); + tcg_gen_op1_i64(INDEX_op_discard, TCG_TYPE_I64, arg); } else { tcg_gen_discard_i32(TCGV_LOW(arg)); tcg_gen_discard_i32(TCGV_HIGH(arg)); @@ -3156,7 +3169,7 @@ void tcg_gen_extrl_i64_i32(TCGv_i32 ret, TCGv_i64 arg) if (TCG_TARGET_REG_BITS == 32) { tcg_gen_mov_i32(ret, TCGV_LOW(arg)); } else if (TCG_TARGET_HAS_extr_i64_i32) { - tcg_gen_op2(INDEX_op_extrl_i64_i32, + tcg_gen_op2(INDEX_op_extrl_i64_i32, TCG_TYPE_I32, tcgv_i32_arg(ret), tcgv_i64_arg(arg)); } else { tcg_gen_mov_i32(ret, (TCGv_i32)arg); @@ -3168,7 +3181,7 @@ void tcg_gen_extrh_i64_i32(TCGv_i32 ret, TCGv_i64 arg) if (TCG_TARGET_REG_BITS == 32) { tcg_gen_mov_i32(ret, TCGV_HIGH(arg)); } else if (TCG_TARGET_HAS_extr_i64_i32) { - tcg_gen_op2(INDEX_op_extrh_i64_i32, + tcg_gen_op2(INDEX_op_extrh_i64_i32, TCG_TYPE_I32, tcgv_i32_arg(ret), tcgv_i64_arg(arg)); } else { TCGv_i64 t = tcg_temp_ebb_new_i64(); @@ -3184,7 +3197,7 @@ void tcg_gen_extu_i32_i64(TCGv_i64 ret, TCGv_i32 arg) tcg_gen_mov_i32(TCGV_LOW(ret), arg); tcg_gen_movi_i32(TCGV_HIGH(ret), 0); } else { - tcg_gen_op2(INDEX_op_extu_i32_i64, + tcg_gen_op2(INDEX_op_extu_i32_i64, TCG_TYPE_I64, tcgv_i64_arg(ret), tcgv_i32_arg(arg)); } } @@ -3195,7 +3208,7 @@ void tcg_gen_ext_i32_i64(TCGv_i64 ret, TCGv_i32 arg) tcg_gen_mov_i32(TCGV_LOW(ret), arg); tcg_gen_sari_i32(TCGV_HIGH(ret), TCGV_LOW(ret), 31); } else { - tcg_gen_op2(INDEX_op_ext_i32_i64, + tcg_gen_op2(INDEX_op_ext_i32_i64, TCG_TYPE_I64, tcgv_i64_arg(ret), tcgv_i32_arg(arg)); } } @@ -3320,7 +3333,7 @@ void tcg_gen_exit_tb(const TranslationBlock *tb, unsigned idx) tcg_debug_assert(idx == TB_EXIT_REQUESTED); } - tcg_gen_op1i(INDEX_op_exit_tb, val); + tcg_gen_op1i(INDEX_op_exit_tb, 0, val); } void tcg_gen_goto_tb(unsigned idx) @@ -3335,7 +3348,7 @@ void tcg_gen_goto_tb(unsigned idx) tcg_ctx->goto_tb_issue_mask |= 1 << idx; #endif plugin_gen_disable_mem_helpers(); - tcg_gen_op1i(INDEX_op_goto_tb, idx); + tcg_gen_op1i(INDEX_op_goto_tb, 0, idx); } void tcg_gen_lookup_and_goto_ptr(void) @@ -3350,6 +3363,6 @@ void tcg_gen_lookup_and_goto_ptr(void) plugin_gen_disable_mem_helpers(); ptr = tcg_temp_ebb_new_ptr(); gen_helper_lookup_tb_ptr(ptr, tcg_env); - tcg_gen_op1i(INDEX_op_goto_ptr, tcgv_ptr_arg(ptr)); + tcg_gen_op1i(INDEX_op_goto_ptr, TCG_TYPE_PTR, tcgv_ptr_arg(ptr)); tcg_temp_free_ptr(ptr); } diff --git a/tcg/tcg.c b/tcg/tcg.c index 4578b185be..6838ecdefc 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -2616,7 +2616,8 @@ void tcg_dump_ops(TCGContext *s, FILE *f, bool have_prefs) nb_cargs = def->nb_cargs; if (def->flags & TCG_OPF_VECTOR) { - col += ne_fprintf(f, "v%d,e%d,", 64 << TCGOP_VECL(op), + col += ne_fprintf(f, "v%d,e%d,", + 8 * tcg_type_size(TCGOP_TYPE(op)), 8 << TCGOP_VECE(op)); } @@ -4709,7 +4710,7 @@ static void tcg_reg_alloc_dup(TCGContext *s, const TCGOp *op) itype = its->type; vece = TCGOP_VECE(op); - vtype = TCGOP_VECL(op) + TCG_TYPE_V64; + vtype = TCGOP_TYPE(op); if (its->val_type == TEMP_VAL_CONST) { /* Propagate constant via movi -> dupi. */ @@ -5176,8 +5177,8 @@ static void tcg_reg_alloc_op(TCGContext *s, const TCGOp *op) break; default: if (def->flags & TCG_OPF_VECTOR) { - tcg_out_vec_op(s, op->opc, TCGOP_VECL(op), TCGOP_VECE(op), - new_args, const_args); + tcg_out_vec_op(s, op->opc, TCGOP_TYPE(op) - TCG_TYPE_V64, + TCGOP_VECE(op), new_args, const_args); } else { tcg_out_op(s, op->opc, new_args, const_args); } @@ -5203,7 +5204,7 @@ static bool tcg_reg_alloc_dup2(TCGContext *s, const TCGOp *op) { const TCGLifeData arg_life = op->life; TCGTemp *ots, *itsl, *itsh; - TCGType vtype = TCGOP_VECL(op) + TCG_TYPE_V64; + TCGType vtype = TCGOP_TYPE(op); /* This opcode is only valid for 32-bit hosts, for 64-bit elements. */ tcg_debug_assert(TCG_TARGET_REG_BITS == 32); diff --git a/docs/devel/tcg-ops.rst b/docs/devel/tcg-ops.rst index d46b625e0e..6608a29376 100644 --- a/docs/devel/tcg-ops.rst +++ b/docs/devel/tcg-ops.rst @@ -712,10 +712,9 @@ QEMU specific operations Host vector operations ---------------------- -All of the vector ops have two parameters, ``TCGOP_VECL`` & ``TCGOP_VECE``. -The former specifies the length of the vector in log2 64-bit units; the -latter specifies the length of the element (if applicable) in log2 8-bit units. -E.g. VECL = 1 -> 64 << 1 -> v128, and VECE = 2 -> 1 << 2 -> i32. +All of the vector ops have two parameters, ``TCGOP_TYPE`` & ``TCGOP_VECE``. +The former specifies the length of the vector as a TCGType; the latter +specifies the length of the element (if applicable) in log2 8-bit units. .. list-table:: @@ -729,7 +728,7 @@ E.g. VECL = 1 -> 64 << 1 -> v128, and VECE = 2 -> 1 << 2 -> i32. * - dup_vec *v0*, *r1* - - | Duplicate the low N bits of *r1* into VECL/VECE copies across *v0*. + - | Duplicate the low N bits of *r1* into TYPE/VECE copies across *v0*. * - dupi_vec *v0*, *c* @@ -738,7 +737,7 @@ E.g. VECL = 1 -> 64 << 1 -> v128, and VECE = 2 -> 1 << 2 -> i32. * - dup2_vec *v0*, *r1*, *r2* - - | Duplicate *r2*:*r1* into VECL/64 copies across *v0*. This opcode is + - | Duplicate *r2*:*r1* into TYPE/64 copies across *v0*. This opcode is only present for 32-bit hosts. * - add_vec *v0*, *v1*, *v2* @@ -810,7 +809,7 @@ E.g. VECL = 1 -> 64 << 1 -> v128, and VECE = 2 -> 1 << 2 -> i32. .. code-block:: c - for (i = 0; i < VECL/VECE; ++i) { + for (i = 0; i < TYPE/VECE; ++i) { v0[i] = v1[i] << s2; } @@ -832,7 +831,7 @@ E.g. VECL = 1 -> 64 << 1 -> v128, and VECE = 2 -> 1 << 2 -> i32. .. code-block:: c - for (i = 0; i < VECL/VECE; ++i) { + for (i = 0; i < TYPE/VECE; ++i) { v0[i] = v1[i] << v2[i]; } From patchwork Fri Jan 17 18:23:52 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858215 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp842105wrb; Fri, 17 Jan 2025 10:26:40 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWt3qWg+U+jMx1DHvwxEkZiGXtTiD4BwME4B2y1MAAyjwZx94jaGQTpfbGS0Kj36QwGYXqUqg==@linaro.org X-Google-Smtp-Source: AGHT+IFLoIisEVZ3CLfjWpk1Xr7F1LTT/Yvgbs+sfyy87uVBBiL8HRGX1zqqqHpfjrWd84VZ3myi X-Received: by 2002:a05:620a:4886:b0:7b6:deaa:3191 with SMTP id af79cd13be357-7be63276b53mr604120485a.55.1737138400173; Fri, 17 Jan 2025 10:26:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138400; cv=none; d=google.com; s=arc-20240605; b=YX/YRAtA5fq0wmXKN6QZf+G24VQ5DVvsLgt79a9MKQhZ0Xw30qyMYv2zpJaLCHLdwe akxl8ZaFVAq96IPWSE/dA9ztl1jOhkJEaM5+kpeyZKfeGwtIgce/NL2dqoOtmmA25aHx KSPmvvHVLmHTmbqc83lzOMwLpzBH11kA6MwSc42W7uuUOcBhSTl4Ytv2etSedtrdxdR8 7RaYCLTLxNKwRPsjA9zfSoYzIhGsGe6FvM+tLMbJ6qDygjvBmQfOchhps9wqRRntzEtP jtjkBhZ67lS3N4U2ORuNLk7gif5mLoyxiEMSTWuvqmyLVnihM+D+YjvAwe4zZcPNe//0 +m+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=dxnsbTwT3uqKOnkSfZkbXFJ/XlGe3xqFKdhh2O6cYGc=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=h7bex16fdUqPgT62zVhvMy9ltSLdP5D42eD521kU7WFNkDclzxQdOHDm+IeG/disaV UvgV9k4vDNufZmgFOefYcB1/FfzY+Zt6rrFj1W6z0RijRZ0tXvueY/DqZIS0Jm+EjDwN 0TZlnVqOg3wjAoMaK4EPoVM99GU7wM+ZeemJsY63KdspJ8ldg6ilrUEeNBNnNpS9VbMn VUgFykCO+FLjGXPCFQUjhRRnWAI46bVTpGwSpYflhDmFp1XS2oQXD6yEdaZRIMp/E94F YXd063XT1xq/tbjkZP+t1RTK/3/gbig27dpo2zthiVdbUq0OX/brn+8jFK1egzUQymF6 baAA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Lf+0lnSa; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=fail header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6e1afcfdb91si29827726d6.377.2025.01.17.10.26.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:26:40 -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=fail header.i=@linaro.org header.s=google header.b=Lf+0lnSa; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=fail header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr1p-0003um-7P; Fri, 17 Jan 2025 13:25:09 -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 1tYr1m-0003td-DE for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:06 -0500 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr1i-0007dq-JB for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:06 -0500 Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-2156e078563so33559485ad.2 for ; Fri, 17 Jan 2025 10:25:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138301; x=1737743101; 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=dxnsbTwT3uqKOnkSfZkbXFJ/XlGe3xqFKdhh2O6cYGc=; b=Lf+0lnSaUqQOCgiEeKOu7olNiyl+vZjcbgAO7odHy74+LKtdbIcWdmrHzdSFRBJdf2 lozg+peV5eL1VokKbwPwszmTCLbbBQuw3tPA/v8VaSEld1f51dWlZjScdOKiFy3/g9r4 qUcNzwbVyzX+s2lNIaPFUmzoI+R2iZG/F44yLohnP1SqKFKnGTQy/VALo2SaXloSI05V vB0OzzwXfAQkSVDT0yFsCYotuKHEssn1U/XVKwhoSJQL7BhYgn/UuH2owEDMF0J06Z1U oGIA4W92PDZjUseXd7SCQC/3DLhSGuu2EHIxh18CZ4Qt47tx1+7KWLB0/oCtn990UAM+ gpOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138301; x=1737743101; 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=dxnsbTwT3uqKOnkSfZkbXFJ/XlGe3xqFKdhh2O6cYGc=; b=iwDePuZaL/hFF3epP785ezpniaGldYA9BpiDIXSbBMDui6X0+DG+QsE5fkdfhSx8fr 4g5vG8Pq0qwhG3QuUZOoWBN+S31LRBYgbMnoZJaUyWHNJDtiYxS9QYbcSVvJAEmn2l7X tnPZ/rlEdVd+PXIOaCuivSqmnHXwU157tEQVgjloMKkMVH+vqGqg1mfc9bsUNqp+lFeP ciTExctiSUpAGMQ1wAeetlJba0eGeirHYuICgDIiPEhikAFeugmP/3SrGjDaT13UIqa5 2E+32Rq+ImlLjL3RHO9GQBuMfzv5/ejocotdHN/XGKGBbROf3FUR35ghXe2g440WUZFy qaQw== X-Gm-Message-State: AOJu0Yyb8Dd3DJ2JwDMMfmRCatwut9z4ip+Lk9BN00naUfn4i4PV9lGt mfBuPHeabk1CQTZY3BV5HUBQDd0APuHQV2BQ4khBHWpe7RCF/FmhRmlN4sym6DOYMwW425eCY22 O X-Gm-Gg: ASbGncv8mqDjq/A2oXsmMoAyFMnvcOonpL/gJOxKfpCmYP4/3aAFH47fBWCcwPe0FTa FeBBafklZwZGd+NusSi7gnJWpvqJXOlwOmknsECzeuWcPv/yRWrXtYoFnTYm1lMwP+Szt+ZNEqW M28T1EZSdSKSizVfaJw0QvB0BaYK5YPCLnqjO0i+5RuzaYNBzHCxi9ij/3xuJGZ0X7dV2Q81tK5 TWbcLe7ri2AeVczpnVTBEVi3Foge1ydN90ogggaJBvgqc09p7lY2GFqjw5AzN+yziSHUFIF4cHm OKj6txokDaxR6Qk= X-Received: by 2002:a17:902:f645:b0:215:9379:4650 with SMTP id d9443c01a7336-21c355ce65amr57547915ad.42.1737138301159; Fri, 17 Jan 2025 10:25:01 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21c2d3acccesm18879005ad.123.2025.01.17.10.25.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:25:00 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 04/68] tcg: Move tcg_op_insert_{after, before} decls to tcg-internal.h Date: Fri, 17 Jan 2025 10:23:52 -0800 Message-ID: <20250117182456.2077110-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62f; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62f.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 These are not particularly useful outside of optimization passes. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/tcg/tcg.h | 4 ---- tcg/tcg-internal.h | 5 +++++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h index fe053296ac..5d96cdfc30 100644 --- a/include/tcg/tcg.h +++ b/include/tcg/tcg.h @@ -854,10 +854,6 @@ void tcg_gen_call7(void *func, TCGHelperInfo *, TCGTemp *ret, TCGOp *tcg_emit_op(TCGOpcode opc, unsigned nargs); void tcg_op_remove(TCGContext *s, TCGOp *op); -TCGOp *tcg_op_insert_before(TCGContext *s, TCGOp *op, - TCGOpcode opc, unsigned nargs); -TCGOp *tcg_op_insert_after(TCGContext *s, TCGOp *op, - TCGOpcode opc, unsigned nargs); /** * tcg_remove_ops_after: diff --git a/tcg/tcg-internal.h b/tcg/tcg-internal.h index 072b36d85c..a648ee7a0e 100644 --- a/tcg/tcg-internal.h +++ b/tcg/tcg-internal.h @@ -106,4 +106,9 @@ void vec_gen_4(TCGOpcode, TCGType, unsigned, TCGArg, TCGArg, TCGArg, TCGArg); void vec_gen_6(TCGOpcode opc, TCGType type, unsigned vece, TCGArg r, TCGArg a, TCGArg b, TCGArg c, TCGArg d, TCGArg e); +TCGOp *tcg_op_insert_before(TCGContext *s, TCGOp *op, + TCGOpcode opc, unsigned nargs); +TCGOp *tcg_op_insert_after(TCGContext *s, TCGOp *op, + TCGOpcode opc, unsigned nargs); + #endif /* TCG_INTERNAL_H */ From patchwork Fri Jan 17 18:23:53 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858220 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp842209wrb; Fri, 17 Jan 2025 10:26:52 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCV/6ix8L1plBZQFLmkg0TqXXWlbJ2xWXwsXqWo6fIZUYI7VxxGEg5TGtVJPdpBnzt6imp/NoA==@linaro.org X-Google-Smtp-Source: AGHT+IEmfjCsayQUwFiESja3a4MbtqUKVXyxtC/mStkffHXyxY+czvPxE1zybSJvztI7qAwjdzuV X-Received: by 2002:a05:6214:2584:b0:6cb:ee08:c1e8 with SMTP id 6a1803df08f44-6e1b21b7b81mr79393596d6.23.1737138412417; Fri, 17 Jan 2025 10:26:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138412; cv=none; d=google.com; s=arc-20240605; b=bk5o8uMkUWkmkVRvYBLlN+dbiHOA7el2+DutEbPYezT8Pxd7pZAtTxSbfp/mPeKHlK KLUPTxncm655rRqt5rzrr36PfPBadO1mQ3N/bzzgnpZKAKSdsimnaIjcNNWaaEPMp4zb 78VPq9omPsI1Q2RYKHjG9tcjxfrz/JtH9KlW0o1gIU/kjJQqphMrCtLmR8aeKdZ5XA8a +VnLkFUwSFYbhhPnpazXL5wXOM/wxnBQAKG0pMJF2p+lf+X1sh53P8iUMpQ1RWpanndS zDp80qBaLZCg6KPPdNJLlYDAAEX/tCdLN8Lq9SfU/e2lCVDjqM0ggBGNIWNsYOdIk6Ke eDfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=8kbD2fy0ZsrIZjczUigAT7kEYROqKzeHL89DQQ9XFYc=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=IJ9Od3RmnAp3lBLHxZuvYVxHUzls1sV0ldjaKYuaJtE9FFW75B/CfX0qxADHqtYO6Q gEoNJ7/k2m7mDLqBnBINIgBR66W6HGFUSuEvWrfHD9RNe28uxPKm53m6L6NZE7P2RRpX CiKKW5FKn/oOQ6ymO/Il4AhAeQHqEqOxiBfQnZXVRFLtg8xq9mdm+/g2zRQJJPykaHbJ ySS/9GinrvFRHnZoeRnlLa48eXJ1AbirE3tTbX6smbE/PFiIApt5t5MBNLV6guFtsfhn qutP9Pf5CyAWjISnPNO+ZIB0iOzrrIhf7sVdHAvG9Cc8BC4OQGDZafPVNqg+M1npFfkz PFeQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dbNfKwoG; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6e1afd16fbfsi34343506d6.435.2025.01.17.10.26.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:26:52 -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=dbNfKwoG; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr1p-0003ua-0w; Fri, 17 Jan 2025 13:25:09 -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 1tYr1m-0003te-E1 for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:06 -0500 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr1j-0007eF-Fr for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:06 -0500 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-21654fdd5daso44787895ad.1 for ; Fri, 17 Jan 2025 10:25:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138302; x=1737743102; 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=8kbD2fy0ZsrIZjczUigAT7kEYROqKzeHL89DQQ9XFYc=; b=dbNfKwoGYzFcogVw2pMjmyooeUt/e4yYa49cqxxrIfFSJHrl5DGubbJsg7mdfiJz5A HiDqxtptNKDe4YsVxgh8buYwAo79YUU0IoH2UAC4HShUJfEnCF1AF7XC5dkHVb7qbOPN P38bGK9klwiMbxPbk8SQ1GjQGT4GsCkXf2PdkTxZcpc+dscB0isLOByBOn9uTPHuKiA1 4wqTa3W2ZpzPHiJlNn4k0kEiM6UxFgU+bwXcQm+D6VvZ+cfq6SDmCjTE3CmSoXEZrliV JXzilStwzvpcEd/Z6wyCvZZ1q6l22xeKhGuS331t/MOWB1XSRMdJ+0Qifezc4quKUyMZ 9n3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138302; x=1737743102; 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=8kbD2fy0ZsrIZjczUigAT7kEYROqKzeHL89DQQ9XFYc=; b=XYMR9oDyFF9VGwkchbCmSb2TA8Dtf/E+W3Og18EeRt//+NT/JYUYHn3NtcX+i9yGgl n/OEexfSJjcJLJvXFFKfZaazeu517I/r96pNHn8D1SrahMllJvaPybYuguXVlXRWrX9U Uvg1rw5hSNBx7TzBR+rvYFJNJD88mzlB1J/gREh5Oum6+wH+P/n+mafXxVeK68ykYnRQ 5CLP1oEhWv6Aqm6cnupXlJJ02JqUTCBv5uUEhXmmWkoL63ASKYvGReTMG+obaJiaYzHU WopJwxNUBKLq6TK2cwL48HiYDP5P8/hee/Homc87pBC19yYrFaEagEeHotyFMI5fAigN L54Q== X-Gm-Message-State: AOJu0Yz/I+4gjP6FqgIxdY5HRg4mPbZ+D8vedBMe//lMHf3+NCRWn489 7wEna0iw0f1ujtAdvdZ1XwU5qvw+wPeVfE0nO5xpOdb34aq9Q8WkH0HyJJjyOxH9x+f53M2stHI a X-Gm-Gg: ASbGncsk1jR0PtENyOfFYShHPP/PyqWPR/jfyf2aLheIZQmjjnD8pVHV8lDlyTS1+78 sYCetlxtfTwNnm9rWOpk1N5pGTlR+/UeARU8wLsrICcEgtaYtqj8q0VyGo3xx9CMyDffaz2WB9C SvRXsLUjp4IlxI3BZor15dVolGTaSWdmm63efXMj5vNWSXdVJcbzshKttO6fZoaSVNbOxuJnuIT 77ub2X+6isbUgZijWYR0ewqXYxhD9PUcLQbHTBXB7otNAWzcrCLRqsAioqd0N6D6vvwOzHRVjCa gHZGb4W9m+/1bx0= X-Received: by 2002:a17:903:41c4:b0:215:b75f:a1cb with SMTP id d9443c01a7336-21c352c7d9cmr51724725ad.9.1737138301798; Fri, 17 Jan 2025 10:25:01 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21c2d3acccesm18879005ad.123.2025.01.17.10.25.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:25:01 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 05/68] tcg: Copy TCGOP_TYPE in tcg_op_insert_{after,before} Date: Fri, 17 Jan 2025 10:23:53 -0800 Message-ID: <20250117182456.2077110-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62b.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 Simplify use within the optimizers by defaulting the new opcode to the same type as the old opcode. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/tcg.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tcg/tcg.c b/tcg/tcg.c index 6838ecdefc..f2bbff8079 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -3249,6 +3249,8 @@ TCGOp *tcg_op_insert_before(TCGContext *s, TCGOp *old_op, TCGOpcode opc, unsigned nargs) { TCGOp *new_op = tcg_op_alloc(opc, nargs); + + TCGOP_TYPE(new_op) = TCGOP_TYPE(old_op); QTAILQ_INSERT_BEFORE(old_op, new_op, link); return new_op; } @@ -3257,6 +3259,8 @@ TCGOp *tcg_op_insert_after(TCGContext *s, TCGOp *old_op, TCGOpcode opc, unsigned nargs) { TCGOp *new_op = tcg_op_alloc(opc, nargs); + + TCGOP_TYPE(new_op) = TCGOP_TYPE(old_op); QTAILQ_INSERT_AFTER(&s->ops, old_op, new_op, link); return new_op; } From patchwork Fri Jan 17 18:23:54 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858233 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp843290wrb; Fri, 17 Jan 2025 10:29:46 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXYhk7LRtEMVWQjg2hrxjfvrEDMrCZcuIJ2cQ9Z/Zr735LBtGdh9p4kTe/Wtex1VytJ0LN6Iw==@linaro.org X-Google-Smtp-Source: AGHT+IEjcHoyojA46A2DoYuP7sxJU8ykx/XJQhSONggJZDl8yAej22Pg0WJK6Qj9e6Gp8KD1K7Nq X-Received: by 2002:a05:6214:230d:b0:6dd:d3b:de38 with SMTP id 6a1803df08f44-6e1b217a923mr69409166d6.16.1737138586030; Fri, 17 Jan 2025 10:29:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138586; cv=none; d=google.com; s=arc-20240605; b=I3Ouroerj0eADGpK1m3/Q3EusvAKsS0IcThzXpzX3AB2szc5QAwzb6GX6DnEpckBOX wVO3ie3KZsNuUaztxZK5PA2Fh0mTKw/gjtW43Rvfs9//kUHMJ17s9JghsHBQKtpZAW4w FRT3XD1oG5fZFRucNUJmOT3An7yQBFvN2jm7L7nQQZWFFgdyk1mEyaUwEyvmonlIDVf3 SIenlqIidhWkupnYXgr94xWFN3EcfuNwzrdteZIirLFfgCW76RN7+gGJKVjM0U0UWDGp /bs0ox8NsLfZmDVHMe/Db8knfAkUkmrbYnX/rkfyl7iGUDDOfJqcqR3dniPKy/iZobWr K6ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=5tL6sktYYC9Rw5x1UyaJLj4KaE42qpOUtqK87mSas4w=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=h08YY/FpGYev1h4ZVVyefTO5P06lG17NYv/HFS7dLdI2m8Y4KbDCEMAV3DI8+Lv4l9 ODXYyJk9JCXA6+Upcb8W2UtNnC9rcFdcLV2INB+1MY+npsDjfjsRojQzgPV0u/cFQ89y OHzZNQqkWz5c3916gfEankJ++WC2zHNstanONxPPquFuNhyMyQsLHDm4W1YpycYjLGKI WCYZtayT/UQfRMUKaB7lOR1Tc8yjP+lJY67AftXGfprnxs06MItFFHnBHP4SL132Jx/W uvoHsr8T/I5rgSR96udK5HFh3XB/rXJVrYDpi+45ZpvREFPfT46k3var2rjVJqPQ9Qi5 FLQA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="ZAayI/ZY"; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6e1afd1dcb2si30041786d6.467.2025.01.17.10.29.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:29:46 -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="ZAayI/ZY"; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr1s-0003xO-6Z; Fri, 17 Jan 2025 13:25:12 -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 1tYr1m-0003tt-LX for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:06 -0500 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr1k-0007eQ-TZ for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:06 -0500 Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-2165cb60719so46216135ad.0 for ; Fri, 17 Jan 2025 10:25:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138302; x=1737743102; 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=5tL6sktYYC9Rw5x1UyaJLj4KaE42qpOUtqK87mSas4w=; b=ZAayI/ZY81Xkz2HS9XNY7OVV4LbY2RmXCget2imidI2TFP2xDyxcKE0Kmb3cOthU+K iWF84cH25qag94kRO6A+BurJdMAkBvv6Lcf9ifzpaWYT53nP12cSq3ypM0MOweOp+0HK LdGSg1b24LMZzLNnpVRhiV0Mf4iSAKBJ2QbkwTkjVJdeCB3dI9BB02zBNEkuHySd5R/z vxq52I1CtWlaOzkdCQdVzydHZBUxFXH9zm+N/aNbNsJ0yFJcHENnHZ5wVLOdv6fyCv5j FKEcNEd5wM6IvaVJg+93jTM+X6YLFQ2wSBzbCqb0NdHEf4JYA+u6VudbhhUmXZ5uxYJv A0MA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138302; x=1737743102; 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=5tL6sktYYC9Rw5x1UyaJLj4KaE42qpOUtqK87mSas4w=; b=DbWJmB9M2zySHIkJj8CZW6jUOS1l3aPzr4kNkpkkPzenOQgffBJY17TFxwe9c4F/ik xk5XjoGa4rlUHtkQu1kOhK8hsnEXPtnVvjBI6uZrhNOSF8NCvNoUICq1DErN6+ZWyXtv HROi+1mL3k8mgkeT/RKa6SgOnUTu8gAEgtzfcHujHHTKCrvUYLngm40JLFQm7sMZqWlh ++9NwsL/D1/uSklVVEM1x/aIlw8TPFb4B1i++mfV93V3sae0GbQp9Gr/nN5hz+yw2vvP 4UAMzD3So2h8sUhFNl57qRlAfWvZnZyiGKIzXUzLdAxM80vh9EvC7C93T9LhPHKJorV1 03Kw== X-Gm-Message-State: AOJu0YxwGUyylyScYpJJO9QvJ/CP3C8A6S0bBYz5nzEtM7sQsDF5kIeW NTgbLbiS8M1EoSd/phSXWNeQWulRzSg2MFLA9oyxp7a2BCy4g8YS4kJ3mQT9UVnhedvnhFCUYwE J X-Gm-Gg: ASbGncs86IgYQw6Bj2zLWd45vZLMGfo4ArPvd68ohrV5I0cvoPai9f++Pjhs2e2mXFR bm7/G2nflNpVOGLAXj7/5389DDemPBzOSJ3riYNwfbE1d/v1OxyhZfSZELGNfiII14yrxZ7u4KK h0fWuBhBP5SqEV6jVlexz5yNo8MMZbZ1fcf36wUzD2cINajRB10hV3SMMj0bShpg34gXchZTgQk 608aJ0kGS31lWEwCt//G4LltBAW7p8SjpjVwSwnKI2fE2Q7GrcHUW9A02v0SXPoggm1PuYf/o2F 7JW80NXpK8sl20o= X-Received: by 2002:a17:902:e80a:b0:216:6769:9ed7 with SMTP id d9443c01a7336-21c355c7dc2mr59064705ad.40.1737138302408; Fri, 17 Jan 2025 10:25:02 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21c2d3acccesm18879005ad.123.2025.01.17.10.25.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:25:02 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 06/68] tcg: Add TCGOP_FLAGS Date: Fri, 17 Jan 2025 10:23:54 -0800 Message-ID: <20250117182456.2077110-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62a; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62a.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 To be used by some integer operations instead of, or in addition to, a trailing constant argument. Signed-off-by: Richard Henderson --- include/tcg/tcg.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h index 5d96cdfc30..238c55c9ac 100644 --- a/include/tcg/tcg.h +++ b/include/tcg/tcg.h @@ -440,6 +440,7 @@ struct TCGOp { #define TCGOP_CALLO(X) (X)->param2 #define TCGOP_TYPE(X) (X)->param1 +#define TCGOP_FLAGS(X) (X)->param2 #define TCGOP_VECE(X) (X)->param2 /* Make sure operands fit in the bitfields above. */ From patchwork Fri Jan 17 18:23:55 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858228 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp843037wrb; Fri, 17 Jan 2025 10:29:07 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVYUNm4duRAOvwGO0VTwHN3IaJsMmero2/h7KGHFeiiWa/3k6UV/0yXBowYOImklacMoGPm+w==@linaro.org X-Google-Smtp-Source: AGHT+IGwW8mnmljtSJsC60x0bgj4gGD9eb1U8N2vJc9blNf6gecpnfhRQKctOPo/c74uGMZRb6NN X-Received: by 2002:a05:620a:c4c:b0:7a8:554:c368 with SMTP id af79cd13be357-7be523b9226mr1861053685a.6.1737138546950; Fri, 17 Jan 2025 10:29:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138546; cv=none; d=google.com; s=arc-20240605; b=aQ3dDrEWQdqSmbjYoA8x1LRR0wSw7XuwFf9PV5hA/4SduZ4gVEmGF5rZHtiGbKXmXu J20f7qV1cm2LZnmMEoOUmZY3IMWiePwSr4sevwuBtlbm1GJ1/og2n61mgqd187PiSRIH 6QoNUsU1zgx/YzGXymLBLrB6aOld/a4d6BRW/H3MH5IMtA1qlMmryj7qFhvFt8bblYu+ whOjOzWoUkbVe7MRAjhPK66fd+nxpBiIdDi7HE2pM1NwO1A3dYjVkNq+Wzlq9jgZSEzj FG5j5GWOJa1l52GCLqBFO/uxLXWsbM8+5Swsm2CiH0BFnPSpMVJwni0M8DIP+9dAiG1y nEKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=SkmlLK7Fahw0RO7FW2rGNPWMoqBNxNRmAvk5ugcs8i8=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=CpGASYji1Xs3SmRe2d2oAHb+CW/f1MFR/vCJw08vOahVRVNb0e0MOpcBq9fPfY1tXd T1bh4VWdKTVi2UBDhUkJoV/YiRI6WWCs5G0DeEqW9egjrPJtlOUeDRxk7l8yQQj29Iwm CRXCf3O0+CImP0iZdjlB4XkW5KujaGo5X31cE0VFUXre/RRrCDZHM3zlBTr7uk/wpI+F gm11OoqwvXQvnTB+vVzou7Dkg0VwoohutONG04u6x7RFW5otCxsiQOaSewBTuCERHMXS WVXt6xotNc86QIp1j+D0p7XyZtMili8nB8T2KdDj5aCoBRFeoUUmql/ESTzGG9s48lOv HZEw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RsXteXrI; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7be61477e41si322331385a.181.2025.01.17.10.29.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:29:06 -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=RsXteXrI; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr1y-00044n-5r; Fri, 17 Jan 2025 13:25:18 -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 1tYr1r-0003vx-HI for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:11 -0500 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr1l-0007pP-HO for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:11 -0500 Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-216395e151bso35159595ad.0 for ; Fri, 17 Jan 2025 10:25:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138303; x=1737743103; 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=SkmlLK7Fahw0RO7FW2rGNPWMoqBNxNRmAvk5ugcs8i8=; b=RsXteXrIN5foSrSQoYrkp0ZKchJUJigaNGRlbdktxTc9J9syTNnlD45M6UlW90xo7f j320VbjVj53jNR1NROyRH0T9PIFWrA7oxRNRHShl9PJ7F717PCzsVM843o31p8QXxgrm GqhmFAgL7aZHYpRoFly5iGaE/Q2GgM9ruLoBIMEn1pXL/JwAswhmxK0b3N4DOdY0mIUh 46UGLmHPi9+Oqk+KW9UUzvSJs9qr4i03POExvdSW0AcEksK5poeGHPGYJRfKbbTBFQX2 4OSna5LqNPN1874j32j2jJ92ebt+5AIDSxd36Qnenqsjdc5PzB6PYjpcTbAr/e1jhE34 jvxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138303; x=1737743103; 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=SkmlLK7Fahw0RO7FW2rGNPWMoqBNxNRmAvk5ugcs8i8=; b=FQ4Da39R6o5tS1FkyZLpB2PXaP5yjXVPWEzBHeV7KwILs9Xp3ac9e/+Zo5UXdTWjji shrqsdBdu4NThQ1/f8GGxlWqSb+0vTTc+GmycnNAxY2wFMr9pFCkWKYWWvL3O/H/BxZK diqxN79pBh1pmFu7i8fs6Mp+b6/ZL/nnF0t2/hBMDwG58bEztn/1aRue6AimWrDY+Dru /18PPWOqOkvn0K+jQ6FrboSXCFdzOU8qiUVH3WL7gIRauKpkn9GsJZnMB/T80Qyvzmw/ hHT43bTHTvCXxiVAfeC5CQizMSNYngXlrgFUFwOrTkHqS+WNQnhHaHTMEFO1ZF8R2rw8 Jeog== X-Gm-Message-State: AOJu0YwoZwgCCMANH9v9kaoOLn0XkYl4blfqnbiLGZSZ5Jzk/iMV+BQb MFUUBotnDT/3mIUvCPNCQQTdIAa3oh1u3bwXcT7S4JbCjamt72EazUOdrJrzuYwSILSG1b5s7UG K X-Gm-Gg: ASbGncuPL3nEd/ATK8+O0pxpjZraBdT8OLcT1ZoMyraOStBUfrXdQsjLkUzK5JnXnAx 5AYhrgl90tlLFWwKPbp7sxFN12T3vbq1T+Z7PG66JLWJAJy6GroHa9xdz/rIl4rmR1/WJpZUAcU 1Rqb9r7UdM0gFIsDtTqqpCJCXjuNXIOaUOAz6b9KeHe81VttCxXgW9f9l5i8JE5GAU7f+PwBUHO ux9GPoLhtsqfbC4L7/5bhEfrg5uUpMoSprDogvR88sy5U8It1gubeUeKu0WrQrKywDOL7XOWqPM FEldeEnN+2VdFYw= X-Received: by 2002:a17:903:2352:b0:215:58be:334e with SMTP id d9443c01a7336-21c35c9af72mr53230595ad.10.1737138303011; Fri, 17 Jan 2025 10:25:03 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21c2d3acccesm18879005ad.123.2025.01.17.10.25.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:25:02 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 07/68] tcg: Add type and flags arguments to tcg_op_supported Date: Fri, 17 Jan 2025 10:23:55 -0800 Message-ID: <20250117182456.2077110-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62f; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62f.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 Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/tcg/tcg.h | 7 ++++++- tcg/tcg.c | 11 +++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h index 238c55c9ac..ac0a080b15 100644 --- a/include/tcg/tcg.h +++ b/include/tcg/tcg.h @@ -834,7 +834,12 @@ typedef struct TCGTargetOpDef { const char *args_ct_str[TCG_MAX_OP_ARGS]; } TCGTargetOpDef; -bool tcg_op_supported(TCGOpcode op); +/* + * tcg_op_supported: + * Query if @op, for @type and @flags, is supported by the host + * on which we are currently executing. + */ +bool tcg_op_supported(TCGOpcode op, TCGType type, unsigned flags); void tcg_gen_call0(void *func, TCGHelperInfo *, TCGTemp *ret); void tcg_gen_call1(void *func, TCGHelperInfo *, TCGTemp *ret, TCGTemp *); diff --git a/tcg/tcg.c b/tcg/tcg.c index f2bbff8079..43293ca255 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -1931,9 +1931,11 @@ TCGTemp *tcgv_i32_temp(TCGv_i32 v) } #endif /* CONFIG_DEBUG_TCG */ -/* Return true if OP may appear in the opcode stream. - Test the runtime variable that controls each opcode. */ -bool tcg_op_supported(TCGOpcode op) +/* + * Return true if OP may appear in the opcode stream with TYPE. + * Test the runtime variable that controls each opcode. + */ +bool tcg_op_supported(TCGOpcode op, TCGType type, unsigned flags) { const bool have_vec = TCG_TARGET_HAS_v64 | TCG_TARGET_HAS_v128 | TCG_TARGET_HAS_v256; @@ -6243,7 +6245,8 @@ int tcg_gen_code(TCGContext *s, TranslationBlock *tb, uint64_t pc_start) /* fall through */ default: /* Sanity check that we've not introduced any unhandled opcodes. */ - tcg_debug_assert(tcg_op_supported(opc)); + tcg_debug_assert(tcg_op_supported(opc, TCGOP_TYPE(op), + TCGOP_FLAGS(op))); /* Note: in order to speed up the code, it would be much faster to have specialized register allocator functions for some common argument patterns */ From patchwork Fri Jan 17 18:23:56 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858219 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp842180wrb; Fri, 17 Jan 2025 10:26:48 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWLqU6nbaOT9R1Imb5/xbxtMsty5JNsUG3tK0PklevDApB/SnMj6+Sd9KLseMQ1smm7NPeURg==@linaro.org X-Google-Smtp-Source: AGHT+IEe2WyOmELkodziAJmFUGGHpAKZ9DcrfTt7ki1GskgZSJxWIvZLqV44rHJyoh+dDWdO+Tjf X-Received: by 2002:a05:6214:224e:b0:6e1:5076:c400 with SMTP id 6a1803df08f44-6e1b21e52edmr55268876d6.39.1737138408567; Fri, 17 Jan 2025 10:26:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138408; cv=none; d=google.com; s=arc-20240605; b=ZihAWBcBcHKlwqGfcT8jExf8oi9wTsjc2HKcjQnSOQmwpQn3NjeERknU0qne/ojtNr hV/AXWb7axZSixXQ+qrrvlQCe9TCiHKf3MGSWyrrQadHC8Ro148NKgifmyBvO7yX5GSD 4IIewBlOh/cts1jmIfC+BhN4HETIskuvIoN664n2pRv0Ktssu9pew3VFGO0euTGR0bSV tOCrCvVlV47VI9DgI53JNwz1jYCNEsx86zCA56F28zXycEzt6GHN8VSBqbjSKYaMDrqd /DoDKvHiafTAWXFgogGXQqHpzJHEZKFCuTsDFPW6jqWpDMQ+3WY+gVOcZXKOJ0fcqvic RNxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=sKZ4GjtoygI38RsFhp13dWyLZZ39a3F3n4T5V19Yyos=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=KMRUuhozcb4Yy8WbMJ5mDwi+iTbZT4K7VK37eXeaoec6rKmdYI4ldFxSQ74dYPNLMR sfMwdeUSMRBabgBK28gcAgrvhPag1USIUR5Tci0Ro3SrUtNoVNETD/hxkZuXQluTr+lz 5ZdjeBmTHIrSnP6HZQsIxtPmEoHXZ2jGoZKw7kyq/0cXXYodu0d0e/Tfzf1lENi1dCBC EMWvGC+3PYcHJTDX+ame1Hf8DvkjeFov3IDZy+PXg/OVeTda38EAlRn/H7APoIWMKZAQ je5Hju6g0OXrDkRZQ75906W1A3QzWyfKMg4owNzmRYtRA5OXNKcxmlpCi+Qrp2DfAtFg UUeA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mFBE0gwY; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46e1048b2b3si30581011cf.523.2025.01.17.10.26.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:26:48 -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=mFBE0gwY; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr1p-0003v5-VM; Fri, 17 Jan 2025 13:25:09 -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 1tYr1n-0003u9-5n for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:07 -0500 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr1l-0007pK-1j for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:06 -0500 Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-21675fd60feso55032975ad.2 for ; Fri, 17 Jan 2025 10:25:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138303; x=1737743103; 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=sKZ4GjtoygI38RsFhp13dWyLZZ39a3F3n4T5V19Yyos=; b=mFBE0gwYJ1gOrMfy+bt5OkhXgHST7Ou9OHgFTWIhCVNivUIohCyCA4iaDIAevOiRci qEA7q9kwmnVJsM0di5eYdoDJj5i8ty760FpJAWkBiuu4o1xz0QasJc6q3o/CPwXxL07K 34yrBeIp8CsZhbTnN1I4kll+QEDibmSIX0RXRZDuFy0wuoXa6fEAI7W0xsZRxsOj6XfS wuYnhkpWc+Im4i5lVKegrEXOYslKB52qckVZtbUf5Z8+0QrOXBKk/H6Wa8Hh90ZCCtoY ostXcw8gH7ZZdI2iNvtydU7d1SsXWnlwKc9ouiJU6OCbpRSp6U40jlD1Fh3q9eW5Acny XATQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138303; x=1737743103; 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=sKZ4GjtoygI38RsFhp13dWyLZZ39a3F3n4T5V19Yyos=; b=ftp9nHBVKuHPGRG1miwC503j5wnIbDIVXsKcO7SwTdVKQHyi7wrON9iORR+zBfKEYj cc2T+HQl7hdSAzsT2pqB1oW83HwoFM2K2RlwXVruruhRl6QispccBEmHFxlzWrbXtc7a Y6RZQfd3Ux633qvCrfa1hPOd7Tg0NGVlxw+MFWr4Ren0Q6d/n1mWkJpAg0BCFhAR7N/N zhoxqXYjZQb6S3BszZPMoDzAwf8U/xAXeaBHtT32Zst6//cO4N/6bF0EkcARu2Dzo5fk S7C17Zmk8AGisED8YwOikOLAU1o5odcsgFVhaNk/J8kSu9hzmMggwRDtpvdGalKqA66N CFfQ== X-Gm-Message-State: AOJu0YxuBClhdmDshU07VR4NkwtxY2uRWZuU20PuHMweT72aPgj+Tl+B 4TkX+8vUP8kgZEVC+RaoqoGeZu0wlyECgp536MLICwNV56idDPLBCYIFoblnuT+l/MpAvf4TbWl a X-Gm-Gg: ASbGncvHWcMkOCojD8e97NR+DaDqBbcHqF/gZTaSggQIyHD2dfYV9rSUDjBVaBMFjYd ZufeQ4HSm83sUappac7EtyYYwAW9GNKt5YOAyaNhVCVWBZcTJnBLfpoIcFCVvBJ+g7tYEDIPMKy /MuywBkW3gqa2ZSORwjwS3btt3kG6M+KqRD0gqI1ZVWY3YxQJpnITUefDZRRFkVkZHfLC3ypXFS E+VpjMKGi9HjwoBJhLYZ/zZh8Nk6iIlG7IL2+Ht87NLGhAAy8nJRcaYfUB/hdZFlIA5IRhUTg+H e6jkIHR8B4t3A/Q= X-Received: by 2002:a17:903:2306:b0:216:4676:dfaf with SMTP id d9443c01a7336-21c355eeb01mr50560705ad.34.1737138303633; Fri, 17 Jan 2025 10:25:03 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21c2d3acccesm18879005ad.123.2025.01.17.10.25.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:25:03 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 08/68] target/arm: Do not test TCG_TARGET_HAS_bitsel_vec Date: Fri, 17 Jan 2025 10:23:56 -0800 Message-ID: <20250117182456.2077110-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62c; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62c.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 Rely on tcg-op-vec.c to expand the opcode if missing. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/arm/tcg/translate-sve.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/target/arm/tcg/translate-sve.c b/target/arm/tcg/translate-sve.c index 49d32fabc9..732453db6f 100644 --- a/target/arm/tcg/translate-sve.c +++ b/target/arm/tcg/translate-sve.c @@ -596,14 +596,8 @@ static void gen_bsl1n_i64(TCGv_i64 d, TCGv_i64 n, TCGv_i64 m, TCGv_i64 k) static void gen_bsl1n_vec(unsigned vece, TCGv_vec d, TCGv_vec n, TCGv_vec m, TCGv_vec k) { - if (TCG_TARGET_HAS_bitsel_vec) { - tcg_gen_not_vec(vece, n, n); - tcg_gen_bitsel_vec(vece, d, k, n, m); - } else { - tcg_gen_andc_vec(vece, n, k, n); - tcg_gen_andc_vec(vece, m, m, k); - tcg_gen_or_vec(vece, d, n, m); - } + tcg_gen_not_vec(vece, n, n); + tcg_gen_bitsel_vec(vece, d, k, n, m); } static void gen_bsl1n(unsigned vece, uint32_t d, uint32_t n, uint32_t m, @@ -640,14 +634,8 @@ static void gen_bsl2n_i64(TCGv_i64 d, TCGv_i64 n, TCGv_i64 m, TCGv_i64 k) static void gen_bsl2n_vec(unsigned vece, TCGv_vec d, TCGv_vec n, TCGv_vec m, TCGv_vec k) { - if (TCG_TARGET_HAS_bitsel_vec) { - tcg_gen_not_vec(vece, m, m); - tcg_gen_bitsel_vec(vece, d, k, n, m); - } else { - tcg_gen_and_vec(vece, n, n, k); - tcg_gen_or_vec(vece, m, m, k); - tcg_gen_orc_vec(vece, d, n, m); - } + tcg_gen_not_vec(vece, m, m); + tcg_gen_bitsel_vec(vece, d, k, n, m); } static void gen_bsl2n(unsigned vece, uint32_t d, uint32_t n, uint32_t m, From patchwork Fri Jan 17 18:23:57 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858236 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp843377wrb; Fri, 17 Jan 2025 10:29:56 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCX0vE37D90kySYOLMTI/mVEJLLVL5+/oYN9QR64vps74YF1I+NvsDghI7enx3ApbmLj1a7p8A==@linaro.org X-Google-Smtp-Source: AGHT+IGD43G4k/SaORGMmBW10ltVavV2rZHEBiyGy5xQnE/lhRom5+QushljVulShL1BkPMx2oH8 X-Received: by 2002:a05:622a:2c5:b0:467:5d0b:c744 with SMTP id d75a77b69052e-46e12b213abmr52706751cf.16.1737138596733; Fri, 17 Jan 2025 10:29:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138596; cv=none; d=google.com; s=arc-20240605; b=iUgz3KkbQYz1Rz6gchojLhXBDvxTtErsmDMTC2yWESMzmDXgtiqhZkgM2B1X/JUp20 qoi9LUjpz490OQQk0ZqH9GXXJCpwNIugPkh2A5joBsZjhH99R6ihq75848nPx1QcWzmW io4mxVyJYumF1UkySrOvvkWDu/wkZxj+WoUiwUvQNOhNEPgEKXI+FNx97RkKwp6OrMcE 2DfBZD7YbdXlMKjp8D+1kmEZrdDyW2R3/R89ZDjoq9eyxtTacR0qPQcwk8xB71YbsfIw UU3Ybaz8q1QG+sC52+uSJhBm8/jiYB1ZAykkjEPDYZv3XsoYoRqhv3tdF1bwawrxUR/s i7Jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=QXZzdIlxIFjTwtimzoQBa4lLqmXgKR1E12aAeDzxQGs=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=AYcRzceEWsurT340o2kS0qc5d12FRSu9MUj8ld/vAw72QoTc1DUfqTHF1THM0j4zw8 uKJiCxERqsap0tpIeZ9FJgZPU/3TJJxfUmNADr/GzihAPEniLR7f62+/EiiBob8tFPep gJuXEQVWoedqBw/MyJrorL9FGVRNEeGAyXUPSzhULViuM9+bXVZxwOUtL86fq3sIGS9F QYTBMmxnM6I3HGbQ8h7p1BV6ceaFcZUtaet+d1XcJnEKP2pLcBdnl4DwM+yvu95QeRRB uSJGjair/CWf2bnFmgi3yodrXzHIvhN6XPS05ktQZf/qiNHSn0ez02W668NPt2hxS5nL VdOQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Z5Z5kAuN; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46e102f29d2si30517721cf.122.2025.01.17.10.29.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:29:56 -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=Z5Z5kAuN; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr1t-0003zC-3P; Fri, 17 Jan 2025 13:25:13 -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 1tYr1n-0003uY-Vn for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:08 -0500 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr1l-0007pZ-Kw for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:07 -0500 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-21619108a6bso44007515ad.3 for ; Fri, 17 Jan 2025 10:25:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138304; x=1737743104; 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=QXZzdIlxIFjTwtimzoQBa4lLqmXgKR1E12aAeDzxQGs=; b=Z5Z5kAuNs8LEl69EUfBidcP2BsNkEYePd2rJARQTLrg55Ot4JkD4G9ZdFOjT+YFQCb BZqOR38JmwK0IAfQcGOi7RUYGzOwEIWTM0eWtKNS9rNX2YxBXdpoWU7b4XA4nqaUkHhV LL8HWAk5CHjQF+PYJ73dKABS+1N6XGH0IGlUcYUNkgw8jErfy6fxR4cUrdEJTN4INefn DpZZOyuA/g/ARCF/LaY0GIorauQt2xN9eDF8jUtmR7Pt3bxkjrHmMox55y13zjqcKQPN pMqvNQ40czHe8heXJ8cxt61Ju0B0V+FpGiJepjwrVXgwGIQ3r/PgahDAg5Sf+3wtc3rW qGCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138304; x=1737743104; 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=QXZzdIlxIFjTwtimzoQBa4lLqmXgKR1E12aAeDzxQGs=; b=hvTstBsJtA5sV7A4pENfBrzrSmRaf5btexZAd7Y7cBoSGbDCAFWxh9i5Bd7ebpn5NR 4ixg7FuKx3JlC5PT8yBt9tRv7IIN+7POijUlkPu3b7VuHQ5dRgK+s1huiAOlKDxqFGtv N1w4WKgtHMuC/CRi1ONhZLzFHcR02xr9K6y8NqZEi035X1h9EANYVt1GqaDZRgeOhzG4 oKwwG91VC8qtuhcvEHMQXKtRlCcg3d5omkR+OcknqteU+2Jykl6COeYK/sOWo+Mz9vj0 Dp8v+gEX/2iGjE4glb9rlL+wxV9byc/wGZ3RdWPQ8VH55pSjMGIBZgT3NxwXnhXLK2FL MWRQ== X-Gm-Message-State: AOJu0Ywh13/qfz7SJkr6F+gLVk7VDvswuK3Mh66fhT3HwP/AKOebJP68 qhCTGY1NuzQi6eT2VeCfo4uyRoMAmNeRUZIdUwjFmnLPgGlXZC931L3EW7KFzqmVzYdYnVy72Og r X-Gm-Gg: ASbGncuu9xLOpgjJ4iz7F9EzBA6I8hjfZf094GjnGJ7TOem8qI0zMaU80BRi5LumQiF /KPzye7XZiPgdaEZDL2qACydPqfC98JEL6XJqEGTs9pLeNiAyBhWtbropzRFL8h5H/qx2feedjD oWEmwUiNbxPbCmVpT0JPYKg4659P6XC1TNnxoADdVTjABg+jgSccQSgfnATKwHYXkfZGPyalhnw dKyZ88I2DOVraXJb/Z00GQ8+49bTxiuQ7O8dGiggqWDCI2m3V4b+009jbelRkj7opZDKDb/7E2Z PNFCd02DYLrW+bM= X-Received: by 2002:a17:902:f688:b0:215:aee1:7e3e with SMTP id d9443c01a7336-21c352d664fmr49588305ad.5.1737138304206; Fri, 17 Jan 2025 10:25:04 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21c2d3acccesm18879005ad.123.2025.01.17.10.25.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:25:03 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 09/68] target/arm: Use tcg_op_supported Date: Fri, 17 Jan 2025 10:23:57 -0800 Message-ID: <20250117182456.2077110-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x632.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 Do not reference TCG_TARGET_HAS_* directly. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/arm/tcg/translate-a64.c | 10 ++++++---- target/arm/tcg/translate-sve.c | 2 +- target/arm/tcg/translate.c | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 7c65fc3a3b..bd814849c1 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -8219,6 +8219,7 @@ static bool trans_CCMP(DisasContext *s, arg_CCMP *a) TCGv_i64 tcg_rn, tcg_y; DisasCompare c; unsigned nzcv; + bool has_andc; /* Set T0 = !COND. */ arm_test_cc(&c, a->cond); @@ -8249,17 +8250,18 @@ static bool trans_CCMP(DisasContext *s, arg_CCMP *a) tcg_gen_subi_i32(tcg_t2, tcg_t0, 1); nzcv = a->nzcv; + has_andc = tcg_op_supported(INDEX_op_andc_i32, TCG_TYPE_I32, 0); if (nzcv & 8) { /* N */ tcg_gen_or_i32(cpu_NF, cpu_NF, tcg_t1); } else { - if (TCG_TARGET_HAS_andc_i32) { + if (has_andc) { tcg_gen_andc_i32(cpu_NF, cpu_NF, tcg_t1); } else { tcg_gen_and_i32(cpu_NF, cpu_NF, tcg_t2); } } if (nzcv & 4) { /* Z */ - if (TCG_TARGET_HAS_andc_i32) { + if (has_andc) { tcg_gen_andc_i32(cpu_ZF, cpu_ZF, tcg_t1); } else { tcg_gen_and_i32(cpu_ZF, cpu_ZF, tcg_t2); @@ -8270,7 +8272,7 @@ static bool trans_CCMP(DisasContext *s, arg_CCMP *a) if (nzcv & 2) { /* C */ tcg_gen_or_i32(cpu_CF, cpu_CF, tcg_t0); } else { - if (TCG_TARGET_HAS_andc_i32) { + if (has_andc) { tcg_gen_andc_i32(cpu_CF, cpu_CF, tcg_t1); } else { tcg_gen_and_i32(cpu_CF, cpu_CF, tcg_t2); @@ -8279,7 +8281,7 @@ static bool trans_CCMP(DisasContext *s, arg_CCMP *a) if (nzcv & 1) { /* V */ tcg_gen_or_i32(cpu_VF, cpu_VF, tcg_t1); } else { - if (TCG_TARGET_HAS_andc_i32) { + if (has_andc) { tcg_gen_andc_i32(cpu_VF, cpu_VF, tcg_t1); } else { tcg_gen_and_i32(cpu_VF, cpu_VF, tcg_t2); diff --git a/target/arm/tcg/translate-sve.c b/target/arm/tcg/translate-sve.c index 732453db6f..e303196592 100644 --- a/target/arm/tcg/translate-sve.c +++ b/target/arm/tcg/translate-sve.c @@ -622,7 +622,7 @@ static void gen_bsl2n_i64(TCGv_i64 d, TCGv_i64 n, TCGv_i64 m, TCGv_i64 k) * = | ~(m | k) */ tcg_gen_and_i64(n, n, k); - if (TCG_TARGET_HAS_orc_i64) { + if (tcg_op_supported(INDEX_op_orc_i64, TCG_TYPE_I64, 0)) { tcg_gen_or_i64(m, m, k); tcg_gen_orc_i64(d, n, m); } else { diff --git a/target/arm/tcg/translate.c b/target/arm/tcg/translate.c index c16b59ab88..68ac393415 100644 --- a/target/arm/tcg/translate.c +++ b/target/arm/tcg/translate.c @@ -493,7 +493,7 @@ static void gen_add_CC(TCGv_i32 dest, TCGv_i32 t0, TCGv_i32 t1) static void gen_adc_CC(TCGv_i32 dest, TCGv_i32 t0, TCGv_i32 t1) { TCGv_i32 tmp = tcg_temp_new_i32(); - if (TCG_TARGET_HAS_add2_i32) { + if (tcg_op_supported(INDEX_op_add2_i32, TCG_TYPE_I32, 0)) { tcg_gen_movi_i32(tmp, 0); tcg_gen_add2_i32(cpu_NF, cpu_CF, t0, tmp, cpu_CF, tmp); tcg_gen_add2_i32(cpu_NF, cpu_CF, cpu_NF, cpu_CF, t1, tmp); From patchwork Fri Jan 17 18:23:58 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858235 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp843380wrb; Fri, 17 Jan 2025 10:29:57 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXzMme282ZvMTCzTjE7vsQhK3LLxQZ6fwgg6GpMDKApzPxXNQV43iYcow+KiMMeoXlxYdpX1A==@linaro.org X-Google-Smtp-Source: AGHT+IEY6x6Y1QWxnYUKvLfyzpOS6Ig1r31JswfWp2eIOblIWhax5MoeitYhIxzyr91C6hU6KjE4 X-Received: by 2002:a05:620a:2a0c:b0:7b1:48ff:6b62 with SMTP id af79cd13be357-7be6321be3bmr569126385a.16.1737138596887; Fri, 17 Jan 2025 10:29:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138596; cv=none; d=google.com; s=arc-20240605; b=MSDG0eMJ1st72naEhEYKIzzbNFLZPMrHPdOnviDd14+WRocVD3mB4RczBmcVhuwXlg d1HecE4+7s/YorzXaiDpRLbKIbBUwQ+tbfZeQrnmE+4y9xDoe/KkGPK6m18FNQkldAaU 1eWPLt7/54oxgqOMn23ygi15JUDus8UyGoXMwZ1HRXv0zdY9yjJ44Px25SmRQajo/YkV 6iduEqK8IwS6+UUUGxoIhioS16cOqHv8e9qDKXRNASVhhpajbdiwQOnKJ6z6/+wAKWeP c+T7Lph198CnQ7nchldq7ThiSssOBbU9Qf+xQX3fxzcbbP7FzihDoArSk0om9kVQ5VCX L6SA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=8DcTEozh86Xrwd11aGFdHOjTtoqytx9vFk9B8/PjCx4=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=CGoJgb59SQBM4zl1ijqED0gmt3CBZk14V8ZbHzJwgqarOKPNKHlcA/qfEieKqz0D31 3EpZcyVp3cnAE1FB48jtrBzmtbON36tCgK8LjeKa85JtWuqjxM3hEkKgkFqr1UihH5Az KZ5IK2m/3eozzJLuiuRTrDAKhX4YAUSaSLJU8BLTBcYiko5jJg4+ZzgIDv7Wep/3Y7kw Yz+ANqN6hF2rw9Hs4iBUj7FaI60GxTjO5wtiCRYbPp398wAZbl2iyV/CLzftlvsY1OrE TLIT6VbTFXVj0ILnF0x/T+AEZCfKtTztA2i9ZNfN2Z+9ZpZGg6MhrpDQwAbmhARm3Na/ TY7Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uds1S6Z3; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7be614bedbdsi320887285a.253.2025.01.17.10.29.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:29:56 -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=uds1S6Z3; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr1t-0003z7-2w; Fri, 17 Jan 2025 13:25:13 -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 1tYr1o-0003uj-T3 for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:08 -0500 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr1m-0007pr-CX for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:08 -0500 Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-2164b662090so47456075ad.1 for ; Fri, 17 Jan 2025 10:25:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138305; x=1737743105; 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=8DcTEozh86Xrwd11aGFdHOjTtoqytx9vFk9B8/PjCx4=; b=uds1S6Z3GxU0a78eUecYP0zVfgSLhfPuHJRCQUDcqT8sn0q9IS0TcQnh/vfPcd5Pti 9SzHyKPjzkHPP/ApZJ8Kyd8m4x5WQGY8QOg1PoUqGC6f7UuqzTQAh77jImnc17XMTo7e 2Il+7qU8YNQb9PUq4H9hJuVo8c/paB4FL1+oR7FH/iMSNIaQ2we/bZbUk3kXyQntSh48 8b21Hz6FVsbg4xUKU8ujE20LlaS8OAOBsuIqGow8tlqoyfd6SSc1LxQfQsPe/lh7hMKc ia4Oe35G9TlmTwLr9rEtfYlKYx1JyNwJZ+JI9PIw2LBRM/HCkTPg6zJeHaSHpB/3tsvr VoPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138305; x=1737743105; 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=8DcTEozh86Xrwd11aGFdHOjTtoqytx9vFk9B8/PjCx4=; b=wsuq4NiHYiL6ugZP1941QsJYbXOjXg2SoE2HfFxEaHvqqcL2rt0pAjMZ0XAGW9K/9Y sO4cf6J+kXtzShp5YCMUVntAIBx/aTORTRjYPPsQt2j6lqDvjbTi8zLd5rBTT1WdtqMY pcfu96ZxrzxoJ8j8bTkQTKrkHXMXlQQcYxx2+WTUliGN4uGxxXdBxylXixnfvCvoC1bX JBEqfWD1+ZhFO5bPt7cdukpsTdkAyQry2xfG8GeHYxuy19JKq1DmXlELovK9j38z2N06 2VpaRsRJv+vl4O8G66ATxKIqwe350G8ksMZ1l3wtzPFUovaM44op/ZDY2y1HWcAXNcop WdYA== X-Gm-Message-State: AOJu0YyTZgn0aK8AiNEis3eRJ63+u+cc3VUxhMuBc3pOl5Da0XTOMid7 ZOX3+jrnUAXUICbBeEWPOLzZ1Dlq5sbmY9sq2abW4GHuGJQ07/nKRepZEza/lpWOpsgdSoONlFo S X-Gm-Gg: ASbGncuqIDNrcZfL3PVKcTlil1JomVzN7FaFDDm6nZXpNYExAoxy9757xz62OrpBamk ZkjmSaBHrmYRXc3AvsE+cjYPB0z4fSNcZkRgjbBXhAM8Vg2B8nOHwIZBm6RhBRrwG8KnQhzpFwx 2turaoCX8XC3Q8FFlkG2pLLTsA3pfIyiPDZNDyL0B3BWgvSOaHgzEN9F24/RmSl9NZ1cQCytusY ASC66SFrd4VcwSipsKuAtigdenb11JpJXug9bDECvvPk+xRHVcSQ0sVWfjS0eA5OmP4ADgQUtOZ jXxT+7SIJoV0WqA= X-Received: by 2002:a17:902:e74c:b0:216:31aa:12eb with SMTP id d9443c01a7336-21c355932e4mr58775965ad.31.1737138304938; Fri, 17 Jan 2025 10:25:04 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21c2d3acccesm18879005ad.123.2025.01.17.10.25.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:25:04 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 10/68] target/tricore: Use tcg_op_supported Date: Fri, 17 Jan 2025 10:23:58 -0800 Message-ID: <20250117182456.2077110-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::629; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x629.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 Do not reference TCG_TARGET_HAS_* directly. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/tricore/translate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/tricore/translate.c b/target/tricore/translate.c index 0ef3743f3e..6819b77668 100644 --- a/target/tricore/translate.c +++ b/target/tricore/translate.c @@ -3980,7 +3980,7 @@ static void decode_bit_andacc(DisasContext *ctx) pos1, pos2, &tcg_gen_andc_tl, &tcg_gen_and_tl); break; case OPC2_32_BIT_AND_NOR_T: - if (TCG_TARGET_HAS_andc_i32) { + if (tcg_op_supported(INDEX_op_andc_i32, TCG_TYPE_I32, 0)) { gen_bit_2op(cpu_gpr_d[r3], cpu_gpr_d[r1], cpu_gpr_d[r2], pos1, pos2, &tcg_gen_or_tl, &tcg_gen_andc_tl); } else { @@ -4113,7 +4113,7 @@ static void decode_bit_orand(DisasContext *ctx) pos1, pos2, &tcg_gen_andc_tl, &tcg_gen_or_tl); break; case OPC2_32_BIT_OR_NOR_T: - if (TCG_TARGET_HAS_orc_i32) { + if (tcg_op_supported(INDEX_op_orc_i32, TCG_TYPE_I32, 0)) { gen_bit_2op(cpu_gpr_d[r3], cpu_gpr_d[r1], cpu_gpr_d[r2], pos1, pos2, &tcg_gen_or_tl, &tcg_gen_orc_tl); } else { From patchwork Fri Jan 17 18:23:59 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858210 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp841788wrb; Fri, 17 Jan 2025 10:25:57 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVFWD3EbtRrVfQrGiepu5uMUIiioob1FGYE0lbuy06dUlWt6z+HR9Z7cbn9rgOP7oT9OABAuA==@linaro.org X-Google-Smtp-Source: AGHT+IHucQCGacmFh0avmDEdPgWPmVi2qZMWrM2EHQWY5iG+cxfXtSu+Al/A8P9IPVBcOQTtxSIB X-Received: by 2002:a05:6214:5b8a:b0:6d4:c6d:17fe with SMTP id 6a1803df08f44-6e1b21bd627mr68855206d6.25.1737138357192; Fri, 17 Jan 2025 10:25:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138357; cv=none; d=google.com; s=arc-20240605; b=UvsUF7LYD10pIssS9iDMqh0EeI8InfrNVK3XBWWDtTi8st5WlOqvPeknTL428t/eTj MLPfa8gDUE0e2fA0FDlCH8/XtyhuXxmcqVAjMhbobFM48OTX/fq+3OASHgFhP+9AraqX vLug+rija9ed9Vku638WZmOKyLdnpOO82Td3RNIwFOnVTXrlvhPUbVNorJ9U2GwNNl/M B2XYnxLDLrFdJjHKJeEQvfsOAx2oGG4I6NMlJ0yPQ2xOU6dwtJcN87QiRP1Gh8AFSl9w k3YzF7pi4m+I1hAaBk/Kw3MZCguLhQiT2s6cOMok866dUpl0YvGLY03KHHtVbRw5iyqf mm0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=S0der1AXY8+NAd6sj2IOYm3ClOdoj63Ilu/FNwjNpMg=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=SHccFH99dCmWt4mzT33nkErE3Ng3/pRzJaq0ls5m1+vnioiWFbUsAfp7gn9RHbCRkM 9Y41+qFYdDsBxctzRKPfftkVKAOlrtODunpeTYfG7+P8Q7Rh9/kgLmWxi1BaLDYaXDRa FV3r1EMrirSCmtCJUpCHCVw/ORJ1cJp7ycL27KxTrpkO8ZL19ivJcoGJS+zU1YLlnLcz ynsxhpk18DiOw361QaJp7HfMuEKp8I8wSL8ivRZ3MqliBACYKO+TWGGHIE0dRmRU9Bmr ky0EIOHvnubWTtnyVQoJ37MhozJW+OwSi8oK96K5GY4E6cqGslkiSZsWKPr8Ql5QaBOu Obdw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FeA4ZQVX; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6e1afd142f6si29483736d6.454.2025.01.17.10.25.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:25:57 -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=FeA4ZQVX; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr1z-00045t-8q; Fri, 17 Jan 2025 13:25:19 -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 1tYr1t-0003zj-Kk for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:13 -0500 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr1m-0007q2-Tv for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:13 -0500 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-2161eb95317so48432145ad.1 for ; Fri, 17 Jan 2025 10:25:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138305; x=1737743105; 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=S0der1AXY8+NAd6sj2IOYm3ClOdoj63Ilu/FNwjNpMg=; b=FeA4ZQVXZkshDpMPF3xyaZ2T62DgP4/ZoXJapUubd/vh9uFyMvuCzePmgmUxp3nb2A UoENTtogLC8IAhZrDyvbRQ4bca24e2wjwnjIJoj5lS0zct108oPa8UjxuB1YvkbO1ond hiky3DqkNn5DV1iMhntPVkkpCanmODAyFUuuZWVeksBIHoFOJQuTq4SATae+dYUUGlo7 ZfKvfUyuWwgh0HNI+ljf1qmYVZvoFFCT8TNffDeiYKiV0ETAVuohzXrc6TNHXUFzMebs g2sztMDrZyX3axW9KzxDZlEPHZgS1+tdyD15OINyYmsmVEDPaW0S74+F6y5Xfi1jrIH0 nv2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138305; x=1737743105; 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=S0der1AXY8+NAd6sj2IOYm3ClOdoj63Ilu/FNwjNpMg=; b=EbnfACmZlDxY7YdxU27x4aQ2OmQj4E6ZUvcLIzrS/em1djHVJiHblrGiZiCQhz2y9R utyxMKBdclskQWLDRZNqAKa6CHAQg821JNTnVjM48IMNW5tavE2EjC2VEUne3VMP3r+6 hKBD88KCTW4OG7pL8dhUmLPUc5F5P7s6bmyQ1/r/fQUYFkSgfm0A8O76QIE46SWapuV6 e9eiTOzfnGhlNnZCrNFEA5PwevmOPndNmxNTLlH+ICcH/KZQufo93QvfCQPkgrGH73rz FmmVdWmDmP/WxubSOlNSfckIMiGi1pWzzWpyjO2MlkOl8b0oGt84JzdQMjg4E4XaOQhm +ivg== X-Gm-Message-State: AOJu0YxOIXtR5MVAUjMYSttTSSODMdS1DrLX7vr9u0OujIAtbA/gzLuf Et31hvIi/apcF8IJ2gL1PRVu7WCiBHTNBGtroC67rALy6DRjhKhUh0m0HwXb7zGYYz7dy1DcX83 T X-Gm-Gg: ASbGncurqjvBn85j6hLUcEDhqSvV7FZ2/7jFPbw+aG4iNd8qcGIZt+ZactNg68oRE00 cVPh2ZprecIYzVJL2QU9wLNrA4+wOLqE9L0x9ewAEitFfj1F+8134IDs4Hw3eW3z06e0r0/9CNz pfP6XUSxZ8WBQLSAwZlDV41mR/n0RjlZVMPXw2SAW7+f7iKy/P23IwVw28n2AmSwLmKdzNb7Bw6 MU5kh71x2ENreHtXKX8S7QwfyJr8XPm1B0E1c1b0/RpxHDzv+ihPCHOn3XF07EfST0vSwMe60Kj 1TK5LGYUYvsf864= X-Received: by 2002:a17:902:c94d:b0:216:55a1:369 with SMTP id d9443c01a7336-21c3540179amr58148805ad.18.1737138305473; Fri, 17 Jan 2025 10:25:05 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21c2d3acccesm18879005ad.123.2025.01.17.10.25.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:25:05 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 11/68] tcg: Add tcg_op_deposit_valid Date: Fri, 17 Jan 2025 10:23:59 -0800 Message-ID: <20250117182456.2077110-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62d; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62d.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 Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/tcg/tcg.h | 6 ++++++ tcg/tcg.c | 21 +++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h index ac0a080b15..63f7eb3adf 100644 --- a/include/tcg/tcg.h +++ b/include/tcg/tcg.h @@ -840,6 +840,12 @@ typedef struct TCGTargetOpDef { * on which we are currently executing. */ bool tcg_op_supported(TCGOpcode op, TCGType type, unsigned flags); +/* + * tcg_op_deposit_valid: + * Query if a deposit into (ofs, len) is supported for @type by + * the host on which we are currently executing. + */ +bool tcg_op_deposit_valid(TCGType type, unsigned ofs, unsigned len); void tcg_gen_call0(void *func, TCGHelperInfo *, TCGTemp *ret); void tcg_gen_call1(void *func, TCGHelperInfo *, TCGTemp *ret, TCGTemp *); diff --git a/tcg/tcg.c b/tcg/tcg.c index 43293ca255..6b318873ca 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -2238,6 +2238,27 @@ bool tcg_op_supported(TCGOpcode op, TCGType type, unsigned flags) } } +bool tcg_op_deposit_valid(TCGType type, unsigned ofs, unsigned len) +{ + tcg_debug_assert(len > 0); + switch (type) { + case TCG_TYPE_I32: + tcg_debug_assert(ofs < 32); + tcg_debug_assert(len <= 32); + tcg_debug_assert(ofs + len <= 32); + return TCG_TARGET_HAS_deposit_i32 && + TCG_TARGET_deposit_i32_valid(ofs, len); + case TCG_TYPE_I64: + tcg_debug_assert(ofs < 64); + tcg_debug_assert(len <= 64); + tcg_debug_assert(ofs + len <= 64); + return TCG_TARGET_HAS_deposit_i64 && + TCG_TARGET_deposit_i64_valid(ofs, len); + default: + g_assert_not_reached(); + } +} + static TCGOp *tcg_op_alloc(TCGOpcode opc, unsigned nargs); static void tcg_gen_callN(void *func, TCGHelperInfo *info, From patchwork Fri Jan 17 18:24:00 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858273 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp845429wrb; Fri, 17 Jan 2025 10:34:18 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXAUY5XunUi8aIcxO/EcMEVqfqLsilz61lImMxYiA/8qnU+BtE/VHut735EaGF8euhrtHEK4Q==@linaro.org X-Google-Smtp-Source: AGHT+IEo4Uv/AF5tCYKTnMmNTXf2oZgp5/VjcSbkuzBpJ95WABcor2DGKc1aaJsv0954IiwIc5xs X-Received: by 2002:a05:622a:19a3:b0:467:63a5:fb9c with SMTP id d75a77b69052e-46e12b96aa4mr54331771cf.44.1737138857759; Fri, 17 Jan 2025 10:34:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138857; cv=none; d=google.com; s=arc-20240605; b=Hf9Nfw9Sc+a/rTh6+d5fWmdGzi9MnifqbCVQqXSeFexed4Z21nWl9f3J8LdxIpEcBl XhzoypsnUuaxJp0Ug2+jjOIBSY7PsRcIMLaWaFXfMGw8gXAIPfXr17bnr/YQAleWoaxn l4Pgu6lCk2FeFUumQwaBRFvsFpSJN9PKk46rVZ6bwDAoRQ+f/ejbIgRL29y9tGcoKIJK vGv2DkRkAwoCs7xsPZPXP1X/YhwNzA7yI2mLcu9ex2WcKCes7jIKweDtLnRVchMV1mKI jMr0z5ipSEfJvIaf70d5Dh/CKlBFQvmP3L/YLMgwHOEfSV2Mbm7Ul8rhopeKu314UWL1 La9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=qnf+fSHWEdd4ca8fA4cnMkUUnEWFBlmFUk49aGQ3+K8=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=MPaxTw3qXiQZiWbYGsWTlWAlQy2Y+2Yje+qMWdtZVNtYVBS2UQ8HK7XJmKjHXGKuMc A5MgnuwoOWUV94ad5FcnYMtiXkCAfjzYzuaOrvZUblCXe6Aq0khfwXz3UUyX/PCcPcHz 8m3mxVr69NOc3BMhJUEQFxp646I9HBKuVy+z61YE2FwAt3z157j6MFPvlq88s2f++Xu8 0DzkYB7t6SjJnMgM186mBoUpc0EImh8wpO9ehs4T3pUZQ7g7m1XWFo4GdZWZ6D3coBit r1iWS97bcgPh1lBG7xPLYqYy6AQp0P3pKEFwCqyTJpeWVrgaO5mVUFMtA+ORqWOQz5VN fUTw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IpmKkgKL; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46e104b4dd9si33812021cf.597.2025.01.17.10.34.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:34:17 -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=IpmKkgKL; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr1v-00040f-87; Fri, 17 Jan 2025 13:25:15 -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 1tYr1r-0003vn-24 for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:11 -0500 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr1o-0007qR-LF for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:10 -0500 Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-2166f1e589cso61668765ad.3 for ; Fri, 17 Jan 2025 10:25:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138306; x=1737743106; 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=qnf+fSHWEdd4ca8fA4cnMkUUnEWFBlmFUk49aGQ3+K8=; b=IpmKkgKLR2vFAsKu/K6k/E2dhPhCNpeCYl7wbpdiMyAbAxCxkDlkjH1BAoETWYngol MF/PUBovCubPiF4vn+wKauGH3qNtzI3M6TBUrVxCZGLYLzNk4qUwB4GWtd7IPPvVMLyK 703s88SZlr2I2jeaofhCRHdOniwMRpCC0IRgfIg49C3EQxRo5Zl7GJBa+WLs/EQ0KVZX aIfTwnWOh+PyrON6X1b9ZUQe0SuzaEszPmHW/3b6FnJfww8ip6dK5ZDPmHB7UGAFKIrs PdpBh+1Vqdlcqfjuj/+olEUIJhhpynsshLCgImd32ptzY1ECDElciXh07SmyHId1VPyW 48dQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138306; x=1737743106; 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=qnf+fSHWEdd4ca8fA4cnMkUUnEWFBlmFUk49aGQ3+K8=; b=m6omyI0eTh92vT5bvW51xM2n4r5TzEerxTeSQWRTpOXSyWr5EYmrp69Yc+nT2jlfPg rhyCfF24WWDkKw//VMhs95dAZhYMgDL1xRicFFKOCOq4O5Rd9i4Nnd8PkCv5POKYqfmZ x/BYatmsPOxKxJlWDd8w/PX3k7kvScm3B+3pxYcutSjjMj/pKV1Mqkt8mM4szcXzn/3+ e2y+X4vRYumcoHCLb397SftqW+fQyn2lDe5qBgJJDJa6IbWW6VdT57K5MDLXtaRTrTHO z14GaKcXsnuYRw8w08cdsmii4qhQIPLTzyol8YpPAOsh9pZhR7j29HJkqdvxkehDXRYe xxGQ== X-Gm-Message-State: AOJu0Yxa6EsPh9swiUzc58If3A580+jIWpa8m18/6OCwZO/DFqnkJKcO jRQipGKOb1TFTQqHSghzaIm9Wm64URlaUKyVCRWPADXFuctVKyAImFITEBDhpbQsx+UZUtOHa2G R X-Gm-Gg: ASbGncvpdurIkI+blGWqe3ukQ19EP8DuammPCOhlc7gadIu/9J6M1f9FTQPqpqrKyv9 C09nf2Ef8PKBFIWSCr8AVawSsdE3fr5ZcGK5gWYEMRRktWqPYqX3790VeIA4gyyBPL1yqR5Gq2m 4uWFKRx1eeF9C3jL6cKFBcAzD6tTmHNF9iFd+UMsN/SDdfl4IyqVUi+2dQ9gRdAlTvCbfI1r6Cg OQsQbcKzHE3L6XhzPz8sudqJ4tzLZm5+0gy5hCzyeyMPQv1Gq225RPdPtc2gK2jjZXlZ/XCprWu wQrNMxBXugT4LeU= X-Received: by 2002:a17:902:e546:b0:216:281f:820d with SMTP id d9443c01a7336-21c3553b6famr64540975ad.11.1737138306206; Fri, 17 Jan 2025 10:25:06 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21c2d3acccesm18879005ad.123.2025.01.17.10.25.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:25:05 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 12/68] target/i386: Remove TCG_TARGET_extract_tl_valid Date: Fri, 17 Jan 2025 10:24:00 -0800 Message-ID: <20250117182456.2077110-13-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::633; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x633.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 This macro is unused. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/i386/tcg/emit.c.inc | 2 -- 1 file changed, 2 deletions(-) diff --git a/target/i386/tcg/emit.c.inc b/target/i386/tcg/emit.c.inc index 785ff63f2a..ab416627b7 100644 --- a/target/i386/tcg/emit.c.inc +++ b/target/i386/tcg/emit.c.inc @@ -26,11 +26,9 @@ #ifdef TARGET_X86_64 #define TCG_TARGET_HAS_extract2_tl TCG_TARGET_HAS_extract2_i64 #define TCG_TARGET_deposit_tl_valid TCG_TARGET_deposit_i64_valid -#define TCG_TARGET_extract_tl_valid TCG_TARGET_extract_i64_valid #else #define TCG_TARGET_HAS_extract2_tl TCG_TARGET_HAS_extract2_i32 #define TCG_TARGET_deposit_tl_valid TCG_TARGET_deposit_i32_valid -#define TCG_TARGET_extract_tl_valid TCG_TARGET_extract_i32_valid #endif #define MMX_OFFSET(reg) \ From patchwork Fri Jan 17 18:24:01 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858231 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp843239wrb; Fri, 17 Jan 2025 10:29:41 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXf8HBPdZxwwLaMf8oykIddRFASs8Trn+MzChGMSmPNczDtdbJdX5cjmvndrwrQ0vxpOOc2Yw==@linaro.org X-Google-Smtp-Source: AGHT+IER/dQtFsgEV/pcgLwl2vrf80jeqQe7AtJe6dxofZn1m7HdEM3WiDXaJMIjGOaNSGisK2yE X-Received: by 2002:a05:6214:3bc7:b0:6d8:fa8a:af7e with SMTP id 6a1803df08f44-6e1b2173943mr53136166d6.12.1737138581059; Fri, 17 Jan 2025 10:29:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138581; cv=none; d=google.com; s=arc-20240605; b=OnXm0I4PSQyW4c9DfDLRrj3peo/giAYj+hhNHi0DW7fvzePTkq2CCeoIbPngpLjp1l uTGSaNJSQoF3QSmCygYsLZYRe9NQEdSkIuygnSpbDlsDvy19imv37WGspeX8KqBNBerg D+Sc/wu0s9draU/Q9U4tANZ9m8ONkjGXmIpyrESbtMs1aOoTyhgo8X1tO4m4QmsOulwU 2GWxsmBGQBOgU4CZ8517ozCFS8vPbz9fCvR3Oa0+LtjQAIsKt6JFgkP7YhXVpB3GDuni oeBmZzUrwCYuORle0AsJVDaILDqPXdm5hNgPt8orY/H5e65u+RG8xcP1fm+Hhcvt9FwM Rs2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=Va9p08X93j/jzeWcLncWLYR0nY5/Q2/Ig5KLzRua/5s=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=K9haOEyy1rrttcjG+bBwSqt+Gaj4EvnVK3jzb4hcIeMEJ2985cCFxRnKHgswDtoV6Q +Uk7P0aK2Wt/8l0q8DxV1W2RV7nHCE0PRAHaDXD4fBvJA1erm9KNSp41F9o3XM7+ce2a BaTlcx9DDF8uHqWcRnBXTbhJdT9WeHPrvTXwKhwmHgBfgn/Vv+zzq0Sa8ezD2sFss3jk Q+lHo8ASOuJyCqJyBQ3p+HUjLALtBHLzkCIdVzerCpY5sEKipM1Opx5e/rUAdLC8zwlz NtQcKZuOfI+8e4lwiKzYFzUIgnLp+SjaB01tOUUpXiCNS9KmnILV7SdRP78XP3ychFYD HM7Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IVc8dmjS; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6e1afc1b4a2si31423986d6.166.2025.01.17.10.29.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:29:41 -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=IVc8dmjS; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr1w-00041V-33; Fri, 17 Jan 2025 13:25:16 -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 1tYr1r-0003vr-6o for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:11 -0500 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr1p-0007qp-Fd for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:10 -0500 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-216281bc30fso57582635ad.0 for ; Fri, 17 Jan 2025 10:25:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138308; x=1737743108; 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=Va9p08X93j/jzeWcLncWLYR0nY5/Q2/Ig5KLzRua/5s=; b=IVc8dmjSDb3up//lOkzIi16taE4VCM7a4USzE4oRdyrBCL3xFBySh8QZMAq0jeE58P 7/Tc3c7lSNp2GSTuZ/zIV3oW0zQcAs35gp3M6TLy5x7DHLycG/FUTQ5Ap97XtJCgakEq 3LsP0fnxEUj0X8sFiI1PJ6g5mGt94WnghLjuHH9dZ8bvxMzEX4l/lZU23FrqN7N6Z8Us gqwRSvDHL/vy1A0cMvSE9xznr+4PghId6N3Ud4VtAmXqzU2TX7FZSlRnPePs+kW7p9kY Mstw0bUFSAs/riGLUwhGo7WE4dmccxMgUJn0UZ+jOnLts6WcHsFc963vPyo0to0mWevk TsUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138308; x=1737743108; 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=Va9p08X93j/jzeWcLncWLYR0nY5/Q2/Ig5KLzRua/5s=; b=GZKumb8L6b1eW3rDTZWF/IYI5cAEgx/08wlil0YHRr14adVgZqbgpCN8sPU0E04OKY EldVRCcldddOHT0Rtrm8TwGN+Z6tzHJNh8X2pBElesEuIklXR8C5Kiz3aA2ZiL9I+Qep 1YwCMJbKn10lA2v1QMgzMpoyqa0ngYYWVFqeFC+CR4QVgCUN5tzq8QIu1pCmxyveuU3w WQBIid8/JKOgghBG/FCyGmbY4xVb1QCo3XmubGJVjBWK0hzk1fXcTu70J7bPZylnmA7c paaZwGaRzjlh6o5UhtL99IpbaeKf86+xRZBtlvqmEkblhHNsl5z9HkmEcAKFxoJfUOCd +9/A== X-Gm-Message-State: AOJu0YysiyLIjPrxcFdzKAYxH/qVPQaYQEj5on7r0fOschoSYmHj8s+N UUHHmqhlEDZQIwSzav0q+Ym50vGjPeVa2kHFcpULmJ2RT2zoculJ4/GGA9+P5cKX0jRzHOKAi0M K X-Gm-Gg: ASbGncvUGeJN8Ov7cnph0OkA6s6WfkkJuW42HNwKRewhjYQfXEr6j4qsjbpFG3vU4J8 qthaRR1qA+sIDmzjPOb2PSAcjDc3atcBUovH+h0ZqujtcM82WMnJhCqwo9x343NZqd4hkyfVnUQ kxgEdHHJIhyJ65DS78Z9A2iACzE+wKhJiVFlr2Ep90bcC8lAKQdtbakNrBtoIC19gV+FXF7GD6S TEoJqrjJSKDe6ywcq+6eNw1ciQoOF1mZB9CH/GBVV3G5C9UlWzMNohoBe1MdElMP/k2T17ZUtnI JFWVN++qFCQLzVE= X-Received: by 2002:a17:902:d492:b0:216:1543:195e with SMTP id d9443c01a7336-21c3553b227mr58921525ad.5.1737138306908; Fri, 17 Jan 2025 10:25:06 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21c2d3acccesm18879005ad.123.2025.01.17.10.25.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:25:06 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 13/68] target/i386: Use tcg_op_deposit_valid Date: Fri, 17 Jan 2025 10:24:01 -0800 Message-ID: <20250117182456.2077110-14-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::635; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x635.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 Avoid direct usage of TCG_TARGET_deposit_*_valid. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/i386/tcg/emit.c.inc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/target/i386/tcg/emit.c.inc b/target/i386/tcg/emit.c.inc index ab416627b7..a2b940a5c3 100644 --- a/target/i386/tcg/emit.c.inc +++ b/target/i386/tcg/emit.c.inc @@ -25,10 +25,8 @@ */ #ifdef TARGET_X86_64 #define TCG_TARGET_HAS_extract2_tl TCG_TARGET_HAS_extract2_i64 -#define TCG_TARGET_deposit_tl_valid TCG_TARGET_deposit_i64_valid #else #define TCG_TARGET_HAS_extract2_tl TCG_TARGET_HAS_extract2_i32 -#define TCG_TARGET_deposit_tl_valid TCG_TARGET_deposit_i32_valid #endif #define MMX_OFFSET(reg) \ @@ -3449,7 +3447,7 @@ static void gen_RCL(DisasContext *s, X86DecodedInsn *decode) } /* Compute high part, including incoming carry. */ - if (!have_1bit_cin || TCG_TARGET_deposit_tl_valid(1, TARGET_LONG_BITS - 1)) { + if (!have_1bit_cin || tcg_op_deposit_valid(TCG_TYPE_TL, 1, TARGET_LONG_BITS - 1)) { /* high = (T0 << 1) | cin */ TCGv cin = have_1bit_cin ? decode->cc_dst : decode->cc_src; tcg_gen_deposit_tl(high, cin, s->T0, 1, TARGET_LONG_BITS - 1); @@ -3501,7 +3499,7 @@ static void gen_RCR(DisasContext *s, X86DecodedInsn *decode) } /* Save incoming carry into high, it will be shifted later. */ - if (!have_1bit_cin || TCG_TARGET_deposit_tl_valid(1, TARGET_LONG_BITS - 1)) { + if (!have_1bit_cin || tcg_op_deposit_valid(TCG_TYPE_TL, 1, TARGET_LONG_BITS - 1)) { TCGv cin = have_1bit_cin ? decode->cc_dst : decode->cc_src; tcg_gen_deposit_tl(high, cin, s->T0, 1, TARGET_LONG_BITS - 1); } else { From patchwork Fri Jan 17 18:24:02 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858241 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp843531wrb; Fri, 17 Jan 2025 10:30:14 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWQzMFxDrbMqkSRVFf7vjrcW7F739Pc+xzWxoiRWhhEGhJ/srhO+HfCbvnXSdl2NgPdwrC5Ug==@linaro.org X-Google-Smtp-Source: AGHT+IEPLmQUy5Xfw06NWCKkmH5ndnxKcp+Hf4Bt6j79BsWSnccIHidcIGqn0DWgcXNrcfgDl8Nx X-Received: by 2002:a05:6214:230b:b0:6d8:88fc:c0fb with SMTP id 6a1803df08f44-6e1b220e469mr67757536d6.35.1737138614027; Fri, 17 Jan 2025 10:30:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138614; cv=none; d=google.com; s=arc-20240605; b=FzQ9tniUOa4Yx+peMbfipbviscq18/M/gPS8rPLhM5oz9vyIsNcClpA22JSTy8FZq1 PPIt7QjcE1OXcn7LfA7k1EkLKMRVFxx9tc+HRP+nN3r0g0XDqBQ4jN1URycFXE+njQfh 4vcB+dX0zDnKbvyKGapx1pYFBTy5XbwaoH1xL1ILGMRCNILgRk5xMovGpimvqS78XN4z SrOSi3lH9HJk4VF4hSiXrAzDbhNXz6tEI9Zh8U92y1xoEV6MHZSg9broaRbrd2yymrmX /Nc00WDoMZz83RwZoBibRCEqevWwQk4mcpK1Kq1shTFoNB8FSKUXjVCH2b8FD4C+I1KG RuLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=QHTGG97acyPD34Tp+rqh/MGzijUGRlOPz3TDCzFvbmE=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=U4+4/F5IWWKR5nEzvhJ9yA7f3JNieIyFn1p6axIMwWFzEJzm5i+yOL2/XQlIgE/EWX q/uhu5MdnFq/0PXgEw7tORaPmOKn1SfHG8yfWbA9/jA+u+m0Zxs7SRRAZMCRbHJMgMd7 83E0Bx7bjkOAiJn9F09B5cOKIgFOrRvnsK5X5MdjfFlhMlqzrbWjL7jLhGjOpF/LE4/D 9s+a+4KEkdm2TQOeiuX3+IjX8k7grByOnBoKr0SBtuaBZFwqVVmR/dJ6ywJRQW5KAOvF SfGWzIFwvUElYcvkpD67ORsrqMOS5PlTJK3osLZs1ZqM4/dJ5wqwE00r+cura0wEDa9a LnLQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wvDgaX1C; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6e1afc186aasi33516996d6.105.2025.01.17.10.30.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:30:14 -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=wvDgaX1C; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr1t-0003zK-6U; Fri, 17 Jan 2025 13:25:13 -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 1tYr1r-0003wr-SG for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:11 -0500 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr1p-0007qm-Sy for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:11 -0500 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-21654fdd5daso44789195ad.1 for ; Fri, 17 Jan 2025 10:25:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138307; x=1737743107; 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=QHTGG97acyPD34Tp+rqh/MGzijUGRlOPz3TDCzFvbmE=; b=wvDgaX1CZMgqETr9C8DS0SFJaEHe1T0EuKoYjBQ00VXt50/0TttO3veqRA8Xr6xcfA SlBzReCiJ/6EkIOo0MuN5k0RBvz0KDAAPyvXQiRxP7aIA2YLf03huxEYejxzsRlpIHi7 I1dWEQCsddLODszYqrxrJRjE/CH0pXEmpu2+PDTcjkm9ANKWb3/ziR7/R8HxVsDsCM+W 2pKRZIccdv4y0b8bd//VaPh/GaE1JppCvVsRDIQ2uw7SXim7usIzRT+LUoHycSLz3S/z wefFfoGvF8jjaoWZJrRdSATxAWUrUh0V/adRr7lClXiutZ6sP9iggR+7Yqs1ebV6cq1/ EJ8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138307; x=1737743107; 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=QHTGG97acyPD34Tp+rqh/MGzijUGRlOPz3TDCzFvbmE=; b=cpiBWcDOFXHjMqLIBFCA0v/RJU5yeOximVsQr2GdXHx1BDfdMl6pM1dgayfW5TJBp3 duXR412Dy+AW+RH8LEN9UlJ4WZBnWTnu/1C3wE7M8xWZfHd8Q8Z8EborzcwxnM6n2PG7 fQ4K3sgILPzHKv56S6jJwrR/lKFQj/zzNXhs5mP06mgHr50pObnpsLjgSwazrdtz0bWa ZfyJ9GuQp/VeE+mpiQtKIIgZVC4emVsi1iitv5VwBvIP2ZFYzXOyZvUwFZZt3DXI1/KU cynVo3J+2cqGLzkwc5nkWXpd0KkYsXZDvdx6hXRc/yWxngg1aiVt40MY+OECbNnTllE2 GtBQ== X-Gm-Message-State: AOJu0YyaYVdWPOahXAPwSwSKFIP3x3klMD+9xXhO02r3PbBDaXRRcp0K o0hwejSfiMuItH/vMh44p9bL02epUXN9FDypmBZv54Por5LWjwKQJn4eaot0fn/pLTxZAa6QfBK e X-Gm-Gg: ASbGncsEcdwwzMbIJZsRWs7ab1uG+JshekY0jNM+RCYbD/sIuIbG7OHqTBTNj988H87 rF8nd7hgMM/taYday1YiT9ALURez3r9YXeFkY7e/ZP+RdX7EIToNIgF5Zduyb+1I4W1FwGC7AOk ECr0bgdUrm34OAGxs2qTdYEtnqV+fjsiGWgWGA05s9BZ7iyd7HfUitPN73cRCJ4dI1TA8+ryEsA L53mk7Ar+R7isQ7lxZxeZDaTcOv7sgae6uz7GlYclAGQ8u5CkVnIGhT3lgijG6K+XxFjwkBJ9Oz cIcfdHou4gsBtyY= X-Received: by 2002:a17:902:db10:b0:215:a2e2:53fe with SMTP id d9443c01a7336-21c355c7a3dmr58479905ad.40.1737138307566; Fri, 17 Jan 2025 10:25:07 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21c2d3acccesm18879005ad.123.2025.01.17.10.25.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:25:07 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 14/68] target/i386: Use tcg_op_supported Date: Fri, 17 Jan 2025 10:24:02 -0800 Message-ID: <20250117182456.2077110-15-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x632.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 Do not reference TCG_TARGET_HAS_* directly. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/i386/tcg/emit.c.inc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/target/i386/tcg/emit.c.inc b/target/i386/tcg/emit.c.inc index a2b940a5c3..f305640182 100644 --- a/target/i386/tcg/emit.c.inc +++ b/target/i386/tcg/emit.c.inc @@ -24,9 +24,9 @@ * The exact opcode to check depends on 32- vs. 64-bit. */ #ifdef TARGET_X86_64 -#define TCG_TARGET_HAS_extract2_tl TCG_TARGET_HAS_extract2_i64 +#define INDEX_op_extract2_tl INDEX_op_extract2_i64 #else -#define TCG_TARGET_HAS_extract2_tl TCG_TARGET_HAS_extract2_i32 +#define INDEX_op_extract2_tl INDEX_op_extract2_i32 #endif #define MMX_OFFSET(reg) \ @@ -2993,7 +2993,7 @@ static void gen_PMOVMSKB(DisasContext *s, X86DecodedInsn *decode) tcg_gen_ld8u_tl(s->T0, tcg_env, offsetof(CPUX86State, xmm_t0.ZMM_B(vec_len - 1))); while (vec_len > 8) { vec_len -= 8; - if (TCG_TARGET_HAS_extract2_tl) { + if (tcg_op_supported(INDEX_op_extract2_tl, TCG_TYPE_TL, 0)) { /* * Load the next byte of the result into the high byte of T. * TCG does a similar expansion of deposit to shl+extract2; by From patchwork Fri Jan 17 18:24:03 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858222 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp842279wrb; Fri, 17 Jan 2025 10:27:04 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXNDqQZr6uUR+ygScKaO3HAqqspCvPf2peQdnBkKxIVRPBMRltH7vgxVjOtlmqFeEitm9Zmow==@linaro.org X-Google-Smtp-Source: AGHT+IGDVDISgzx/8zNcI5xGTxYQFOd+m1rrxVS3umW/WGktyhqpSDj4Y+6OW4zosHFYKU7C5b9v X-Received: by 2002:a05:620a:4495:b0:7b6:f0e0:3f79 with SMTP id af79cd13be357-7be6325e075mr556478185a.57.1737138424516; Fri, 17 Jan 2025 10:27:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138424; cv=none; d=google.com; s=arc-20240605; b=hkooM8T5VPKLT26Ddd44J1A/wi3/OPSmI1obJ14YVjBJDS4lSSLWk5/8C8CNXc6xHW Oqjl9AMId/8re74x0Mj5KxWPNsK2ThWI6WHZNh39Mualtj8aNVucU/pnMgAaLPuhtTRE 742K8hJJ6dM0Mw2D7TBpcAxEohbbhoMt5tBgP+qcA0FAel/8viYkCdyuNOwTfIXaHaMo qdTQx5Z22oG2Bx2d69wvBtEHOM45CghMm7CNJDg+Wy8+FdIZJSFETI+wkbv//YVonS+3 vMqadoS7G1vcIFue/aMIdcVuwJftBKQt4WG5JtlGwjrIQR8AUaTZ1cpBncH50ih1sDEX oSiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=CV6eLf1yEvuuQ4en61eccBx6EvsMZyK2wexJv0TpIX8=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=RrRl1T0io/mI977cqw9DFUZ4Q1AQ9wlZXPf9ujVODuFJNqNhjb/IOTxs0J2PkmIpSl 13/cJX30KYw0YbXT+O/fqMIgv3+LqVexjRDKMj3/aTh/2U/Xo4hBeEgzU6ro9RkzMXYU 3Ekp6aka6V+tKH457bMkxvb0oC1UaFzh+b3dWgLpuX+IRWe4SutXl470vQeYaf/Omou1 RYFNWDYm0oAkVz/+Lr9O6fvhKOVcT5Z0DkC3axRLeIvtgvI4ZA0LUA282WAFvkkpueRa OlFQsEFSnIuKKZ9CMlRueiv7yvEZK6OQqBTMA9onYM3z+wy1TEL9UOAaU+6fu+EaBm2C g2JQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Q/Wq4Qs6"; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7be614e0be3si318889085a.509.2025.01.17.10.27.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:27:04 -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="Q/Wq4Qs6"; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr1w-00041S-1A; Fri, 17 Jan 2025 13:25:16 -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 1tYr1u-00040P-3w for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:14 -0500 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr1q-0007r2-PP for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:13 -0500 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-216426b0865so44699405ad.0 for ; Fri, 17 Jan 2025 10:25:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138308; x=1737743108; 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=CV6eLf1yEvuuQ4en61eccBx6EvsMZyK2wexJv0TpIX8=; b=Q/Wq4Qs6ytPbnROl5jjipji/+kTCdI/nPu9oEt/SOuwT0kFk8faCizD+LcEA4a4v+U an+Je9Nto8gNWMRUJ5A/rYQbK31GUR7XU1k2jN4WAzRokqoIP/GMdrc+kwVFcbwevwxL nriIjnJnjqkr7+o0qubSRROgi2EfsX1ugW05yBFb2bPL7k1rbRdvxf590quPEqeZc0kA YoOL0M069yxeqQ/yzDszuVyN9v39Xl1YcZRxHqAv23BszE2KqzbUnBAxPHXNeNuYSX5N /KMQoxaeExfD2UfjdwTRAJQ0CS7egNGgCi4uTYe5ZqElL3DmlH+WoHUirxEd/0sBJeHO klJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138308; x=1737743108; 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=CV6eLf1yEvuuQ4en61eccBx6EvsMZyK2wexJv0TpIX8=; b=Ptb7tY010kUUtj/Ey5VCKkRsNHDYxJ8EhnnbGOFpM8XFr3ib7UtpaOsmi0uCxxSvNt qX+bOAnCQMh7My02ZO/nXrhpRMuuqLZUmPbs1tU+bTeI+M3XNTErbr++PUirb3YnO/jj a52yF1NfDAGBdnlkRpEefYikzbiYSmdk/8Py4TGKWcMnV/+vC1kOBbEw3XRV63a4Czcq R6OePOS7gmDgV5hYaUCMBaMr6uT2sXuKH+fGdsxkc8dwvfMslzT7H+MwO0ILg4z+XmZX /ykHtaeymzfX5byDiGPbdiIzCO7/khLg1vLrHDAzzNtqmMwGvwd3oeLkjB/O0izMVICm PnHA== X-Gm-Message-State: AOJu0YwSqqTgXkJHpwjsW0Z0JTUP0B21uzsdbp55gZpSZcmW8dCSOiMn GDtgOyYPVgbMTprRAChTCImSfEIhawBt88s0pyscxDpXPbHrgzosbW7WI5Fqf0kZqLAvSui18HC 5 X-Gm-Gg: ASbGncumbvoTsIbEsL3bbvaQGgT2dYm72mO2Wc915VQhQvKLlT3ffUrH1era2H3ygBe 5P67hgnIBpg/wx6Gj6RndW/hDVZ0Uh2+p71w1va67XYhNE0kzZx8VT7OCoGWdxdiZRfp1aQm+DF NcNmnLN8ZMM06mO1bklrnWFzBPrVqEvG4AU34+7wJVSdYX2rxWF+MuemJ9EXQaaDoCqS3pSr2z9 ZptqBbpbdU5VvqH/pWj0eWuFuS/lB6d01Yj4fXbIgaSDdu6N9mECRBQN5zmaFFTZqK24qnu4Ziu 6CezQJLaIyyDx6E= X-Received: by 2002:a17:902:d4c2:b0:216:7cbf:951f with SMTP id d9443c01a7336-21c3540c3c2mr53723165ad.21.1737138308276; Fri, 17 Jan 2025 10:25:08 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21c2d3acccesm18879005ad.123.2025.01.17.10.25.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:25:07 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 15/68] tcg: Remove TCG_TARGET_NEED_LDST_LABELS and TCG_TARGET_NEED_POOL_LABELS Date: Fri, 17 Jan 2025 10:24:03 -0800 Message-ID: <20250117182456.2077110-16-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62b.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 Make these features unconditional, as they're used by most tcg backends anyway. Merge tcg-ldst.c.inc and tcg-pool.c.inc into tcg.c and mark some of the functions unused, so that when the features are not used we won't get Werrors. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/tcg/tcg.h | 4 - tcg/aarch64/tcg-target.h | 2 - tcg/arm/tcg-target.h | 2 - tcg/i386/tcg-target.h | 2 - tcg/loongarch64/tcg-target.h | 2 - tcg/mips/tcg-target.h | 2 - tcg/ppc/tcg-target.h | 2 - tcg/riscv/tcg-target.h | 3 - tcg/s390x/tcg-target.h | 2 - tcg/sparc64/tcg-target.h | 2 - tcg/tcg.c | 211 +++++++++++++++++++++++++++++-- tcg/aarch64/tcg-target.c.inc | 2 - tcg/arm/tcg-target.c.inc | 2 - tcg/i386/tcg-target.c.inc | 3 - tcg/loongarch64/tcg-target.c.inc | 9 +- tcg/mips/tcg-target.c.inc | 3 - tcg/ppc/tcg-target.c.inc | 2 - tcg/riscv/tcg-target.c.inc | 3 - tcg/s390x/tcg-target.c.inc | 2 - tcg/sparc64/tcg-target.c.inc | 3 - tcg/tcg-ldst.c.inc | 65 ---------- tcg/tcg-pool.c.inc | 162 ------------------------ tcg/tci/tcg-target.c.inc | 12 +- 23 files changed, 216 insertions(+), 286 deletions(-) delete mode 100644 tcg/tcg-ldst.c.inc delete mode 100644 tcg/tcg-pool.c.inc diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h index 63f7eb3adf..2671321cb5 100644 --- a/include/tcg/tcg.h +++ b/include/tcg/tcg.h @@ -498,12 +498,8 @@ struct TCGContext { CPUState *cpu; /* *_trans */ /* These structures are private to tcg-target.c.inc. */ -#ifdef TCG_TARGET_NEED_LDST_LABELS QSIMPLEQ_HEAD(, TCGLabelQemuLdst) ldst_labels; -#endif -#ifdef TCG_TARGET_NEED_POOL_LABELS struct TCGLabelPoolData *pool_labels; -#endif TCGLabel *exitreq_label; diff --git a/tcg/aarch64/tcg-target.h b/tcg/aarch64/tcg-target.h index cb24c0d276..d8ca52d32d 100644 --- a/tcg/aarch64/tcg-target.h +++ b/tcg/aarch64/tcg-target.h @@ -157,7 +157,5 @@ typedef enum { #define TCG_TARGET_HAS_tst_vec 1 #define TCG_TARGET_DEFAULT_MO (0) -#define TCG_TARGET_NEED_LDST_LABELS -#define TCG_TARGET_NEED_POOL_LABELS #endif /* AARCH64_TCG_TARGET_H */ diff --git a/tcg/arm/tcg-target.h b/tcg/arm/tcg-target.h index 8abf15aef4..7f6e24f861 100644 --- a/tcg/arm/tcg-target.h +++ b/tcg/arm/tcg-target.h @@ -145,7 +145,5 @@ extern bool use_neon_instructions; #define TCG_TARGET_HAS_tst_vec 1 #define TCG_TARGET_DEFAULT_MO (0) -#define TCG_TARGET_NEED_LDST_LABELS -#define TCG_TARGET_NEED_POOL_LABELS #endif diff --git a/tcg/i386/tcg-target.h b/tcg/i386/tcg-target.h index c81d509f1c..9961d8e757 100644 --- a/tcg/i386/tcg-target.h +++ b/tcg/i386/tcg-target.h @@ -227,7 +227,5 @@ typedef enum { #include "tcg/tcg-mo.h" #define TCG_TARGET_DEFAULT_MO (TCG_MO_ALL & ~TCG_MO_ST_LD) -#define TCG_TARGET_NEED_LDST_LABELS -#define TCG_TARGET_NEED_POOL_LABELS #endif diff --git a/tcg/loongarch64/tcg-target.h b/tcg/loongarch64/tcg-target.h index 7811530c8a..3bc9aafaf2 100644 --- a/tcg/loongarch64/tcg-target.h +++ b/tcg/loongarch64/tcg-target.h @@ -189,6 +189,4 @@ typedef enum { #define TCG_TARGET_DEFAULT_MO (0) -#define TCG_TARGET_NEED_LDST_LABELS - #endif /* LOONGARCH_TCG_TARGET_H */ diff --git a/tcg/mips/tcg-target.h b/tcg/mips/tcg-target.h index d9b9f6a965..db60eb7c1b 100644 --- a/tcg/mips/tcg-target.h +++ b/tcg/mips/tcg-target.h @@ -183,7 +183,5 @@ extern bool use_mips32r2_instructions; #define TCG_TARGET_HAS_tst 0 #define TCG_TARGET_DEFAULT_MO 0 -#define TCG_TARGET_NEED_LDST_LABELS -#define TCG_TARGET_NEED_POOL_LABELS #endif diff --git a/tcg/ppc/tcg-target.h b/tcg/ppc/tcg-target.h index 0b2171d38c..8291e0127d 100644 --- a/tcg/ppc/tcg-target.h +++ b/tcg/ppc/tcg-target.h @@ -176,7 +176,5 @@ typedef enum { #define TCG_TARGET_HAS_tst_vec 0 #define TCG_TARGET_DEFAULT_MO (0) -#define TCG_TARGET_NEED_LDST_LABELS -#define TCG_TARGET_NEED_POOL_LABELS #endif diff --git a/tcg/riscv/tcg-target.h b/tcg/riscv/tcg-target.h index d23306738a..bfaa99ccdd 100644 --- a/tcg/riscv/tcg-target.h +++ b/tcg/riscv/tcg-target.h @@ -161,7 +161,4 @@ typedef enum { #define TCG_TARGET_DEFAULT_MO (0) -#define TCG_TARGET_NEED_LDST_LABELS -#define TCG_TARGET_NEED_POOL_LABELS - #endif diff --git a/tcg/s390x/tcg-target.h b/tcg/s390x/tcg-target.h index 7e0bf687b9..223d3f6ca1 100644 --- a/tcg/s390x/tcg-target.h +++ b/tcg/s390x/tcg-target.h @@ -166,7 +166,5 @@ extern uint64_t s390_facilities[3]; #define TCG_TARGET_HAS_tst_vec 0 #define TCG_TARGET_DEFAULT_MO (TCG_MO_ALL & ~TCG_MO_ST_LD) -#define TCG_TARGET_NEED_LDST_LABELS -#define TCG_TARGET_NEED_POOL_LABELS #endif diff --git a/tcg/sparc64/tcg-target.h b/tcg/sparc64/tcg-target.h index 0705308951..b560d43ed5 100644 --- a/tcg/sparc64/tcg-target.h +++ b/tcg/sparc64/tcg-target.h @@ -143,7 +143,5 @@ extern bool use_vis3_instructions; #define TCG_AREG0 TCG_REG_I0 #define TCG_TARGET_DEFAULT_MO (0) -#define TCG_TARGET_NEED_LDST_LABELS -#define TCG_TARGET_NEED_POOL_LABELS #endif diff --git a/tcg/tcg.c b/tcg/tcg.c index 6b318873ca..7f5d014973 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -66,6 +66,11 @@ static void tcg_target_init(TCGContext *s); static void tcg_target_qemu_prologue(TCGContext *s); static bool patch_reloc(tcg_insn_unit *code_ptr, int type, intptr_t value, intptr_t addend); +static void tcg_out_nop_fill(tcg_insn_unit *p, int count); + +typedef struct TCGLabelQemuLdst TCGLabelQemuLdst; +static bool tcg_out_qemu_ld_slow_path(TCGContext *s, TCGLabelQemuLdst *l); +static bool tcg_out_qemu_st_slow_path(TCGContext *s, TCGLabelQemuLdst *l); /* The CIE and FDE header definitions will be common to all hosts. */ typedef struct { @@ -90,7 +95,7 @@ typedef struct QEMU_PACKED { DebugFrameFDEHeader fde; } DebugFrameHeader; -typedef struct TCGLabelQemuLdst { +struct TCGLabelQemuLdst { bool is_ld; /* qemu_ld: true, qemu_st: false */ MemOpIdx oi; TCGType type; /* result type of a load */ @@ -101,7 +106,7 @@ typedef struct TCGLabelQemuLdst { const tcg_insn_unit *raddr; /* addr of the next IR of qemu_ld/st IR */ tcg_insn_unit *label_ptr[2]; /* label pointers to be updated */ QSIMPLEQ_ENTRY(TCGLabelQemuLdst) next; -} TCGLabelQemuLdst; +}; static void tcg_register_jit_int(const void *buf, size_t size, const void *debug_frame, @@ -175,9 +180,6 @@ static void tcg_out_call(TCGContext *s, const tcg_insn_unit *target, static TCGReg tcg_target_call_oarg_reg(TCGCallReturnKind kind, int slot); static bool tcg_target_const_match(int64_t val, int ct, TCGType type, TCGCond cond, int vece); -#ifdef TCG_TARGET_NEED_LDST_LABELS -static int tcg_out_ldst_finalize(TCGContext *s); -#endif #ifndef CONFIG_USER_ONLY #define guest_base ({ qemu_build_not_reached(); (uintptr_t)0; }) @@ -634,6 +636,197 @@ static void tcg_out_movext3(TCGContext *s, const TCGMovExtend *i1, } } +/* + * Allocate a new TCGLabelQemuLdst entry. + */ + +__attribute__((unused)) +static TCGLabelQemuLdst *new_ldst_label(TCGContext *s) +{ + TCGLabelQemuLdst *l = tcg_malloc(sizeof(*l)); + + memset(l, 0, sizeof(*l)); + QSIMPLEQ_INSERT_TAIL(&s->ldst_labels, l, next); + + return l; +} + +/* + * Allocate new constant pool entries. + */ + +typedef struct TCGLabelPoolData { + struct TCGLabelPoolData *next; + tcg_insn_unit *label; + intptr_t addend; + int rtype; + unsigned nlong; + tcg_target_ulong data[]; +} TCGLabelPoolData; + +static TCGLabelPoolData *new_pool_alloc(TCGContext *s, int nlong, int rtype, + tcg_insn_unit *label, intptr_t addend) +{ + TCGLabelPoolData *n = tcg_malloc(sizeof(TCGLabelPoolData) + + sizeof(tcg_target_ulong) * nlong); + + n->label = label; + n->addend = addend; + n->rtype = rtype; + n->nlong = nlong; + return n; +} + +static void new_pool_insert(TCGContext *s, TCGLabelPoolData *n) +{ + TCGLabelPoolData *i, **pp; + int nlong = n->nlong; + + /* Insertion sort on the pool. */ + for (pp = &s->pool_labels; (i = *pp) != NULL; pp = &i->next) { + if (nlong > i->nlong) { + break; + } + if (nlong < i->nlong) { + continue; + } + if (memcmp(n->data, i->data, sizeof(tcg_target_ulong) * nlong) >= 0) { + break; + } + } + n->next = *pp; + *pp = n; +} + +/* The "usual" for generic integer code. */ +__attribute__((unused)) +static void new_pool_label(TCGContext *s, tcg_target_ulong d, int rtype, + tcg_insn_unit *label, intptr_t addend) +{ + TCGLabelPoolData *n = new_pool_alloc(s, 1, rtype, label, addend); + n->data[0] = d; + new_pool_insert(s, n); +} + +/* For v64 or v128, depending on the host. */ +__attribute__((unused)) +static void new_pool_l2(TCGContext *s, int rtype, tcg_insn_unit *label, + intptr_t addend, tcg_target_ulong d0, + tcg_target_ulong d1) +{ + TCGLabelPoolData *n = new_pool_alloc(s, 2, rtype, label, addend); + n->data[0] = d0; + n->data[1] = d1; + new_pool_insert(s, n); +} + +/* For v128 or v256, depending on the host. */ +__attribute__((unused)) +static void new_pool_l4(TCGContext *s, int rtype, tcg_insn_unit *label, + intptr_t addend, tcg_target_ulong d0, + tcg_target_ulong d1, tcg_target_ulong d2, + tcg_target_ulong d3) +{ + TCGLabelPoolData *n = new_pool_alloc(s, 4, rtype, label, addend); + n->data[0] = d0; + n->data[1] = d1; + n->data[2] = d2; + n->data[3] = d3; + new_pool_insert(s, n); +} + +/* For v256, for 32-bit host. */ +__attribute__((unused)) +static void new_pool_l8(TCGContext *s, int rtype, tcg_insn_unit *label, + intptr_t addend, tcg_target_ulong d0, + tcg_target_ulong d1, tcg_target_ulong d2, + tcg_target_ulong d3, tcg_target_ulong d4, + tcg_target_ulong d5, tcg_target_ulong d6, + tcg_target_ulong d7) +{ + TCGLabelPoolData *n = new_pool_alloc(s, 8, rtype, label, addend); + n->data[0] = d0; + n->data[1] = d1; + n->data[2] = d2; + n->data[3] = d3; + n->data[4] = d4; + n->data[5] = d5; + n->data[6] = d6; + n->data[7] = d7; + new_pool_insert(s, n); +} + +/* + * Generate TB finalization at the end of block + */ + +static int tcg_out_ldst_finalize(TCGContext *s) +{ + TCGLabelQemuLdst *lb; + + /* qemu_ld/st slow paths */ + QSIMPLEQ_FOREACH(lb, &s->ldst_labels, next) { + if (lb->is_ld + ? !tcg_out_qemu_ld_slow_path(s, lb) + : !tcg_out_qemu_st_slow_path(s, lb)) { + return -2; + } + + /* + * Test for (pending) buffer overflow. The assumption is that any + * one operation beginning below the high water mark cannot overrun + * the buffer completely. Thus we can test for overflow after + * generating code without having to check during generation. + */ + if (unlikely((void *)s->code_ptr > s->code_gen_highwater)) { + return -1; + } + } + return 0; +} + +static int tcg_out_pool_finalize(TCGContext *s) +{ + TCGLabelPoolData *p = s->pool_labels; + TCGLabelPoolData *l = NULL; + void *a; + + if (p == NULL) { + return 0; + } + + /* + * ??? Round up to qemu_icache_linesize, but then do not round + * again when allocating the next TranslationBlock structure. + */ + a = (void *)ROUND_UP((uintptr_t)s->code_ptr, + sizeof(tcg_target_ulong) * p->nlong); + tcg_out_nop_fill(s->code_ptr, (tcg_insn_unit *)a - s->code_ptr); + s->data_gen_ptr = a; + + for (; p != NULL; p = p->next) { + size_t size = sizeof(tcg_target_ulong) * p->nlong; + uintptr_t value; + + if (!l || l->nlong != p->nlong || memcmp(l->data, p->data, size)) { + if (unlikely(a > s->code_gen_highwater)) { + return -1; + } + memcpy(a, p->data, size); + a += size; + l = p; + } + + value = (uintptr_t)tcg_splitwx_to_rx(a) - size; + if (!patch_reloc(p->label, p->rtype, value, p->addend)) { + return -2; + } + } + + s->code_ptr = a; + return 0; +} + #define C_PFX1(P, A) P##A #define C_PFX2(P, A, B) P##A##_##B #define C_PFX3(P, A, B, C) P##A##_##B##_##C @@ -6204,12 +6397,8 @@ int tcg_gen_code(TCGContext *s, TranslationBlock *tb, uint64_t pc_start) s->code_ptr = s->code_buf; s->data_gen_ptr = NULL; -#ifdef TCG_TARGET_NEED_LDST_LABELS QSIMPLEQ_INIT(&s->ldst_labels); -#endif -#ifdef TCG_TARGET_NEED_POOL_LABELS s->pool_labels = NULL; -#endif start_words = s->insn_start_words; s->gen_insn_data = @@ -6290,18 +6479,14 @@ int tcg_gen_code(TCGContext *s, TranslationBlock *tb, uint64_t pc_start) s->gen_insn_end_off[num_insns] = tcg_current_code_size(s); /* Generate TB finalization at the end of block */ -#ifdef TCG_TARGET_NEED_LDST_LABELS i = tcg_out_ldst_finalize(s); if (i < 0) { return i; } -#endif -#ifdef TCG_TARGET_NEED_POOL_LABELS i = tcg_out_pool_finalize(s); if (i < 0) { return i; } -#endif if (!tcg_resolve_relocs(s)) { return -2; } diff --git a/tcg/aarch64/tcg-target.c.inc b/tcg/aarch64/tcg-target.c.inc index 0b018d3247..d77d305f30 100644 --- a/tcg/aarch64/tcg-target.c.inc +++ b/tcg/aarch64/tcg-target.c.inc @@ -10,8 +10,6 @@ * See the COPYING file in the top-level directory for details. */ -#include "../tcg-ldst.c.inc" -#include "../tcg-pool.c.inc" #include "qemu/bitops.h" /* Used for function call generation. */ diff --git a/tcg/arm/tcg-target.c.inc b/tcg/arm/tcg-target.c.inc index f0674f23a5..90ac80077f 100644 --- a/tcg/arm/tcg-target.c.inc +++ b/tcg/arm/tcg-target.c.inc @@ -23,8 +23,6 @@ */ #include "elf.h" -#include "../tcg-ldst.c.inc" -#include "../tcg-pool.c.inc" int arm_arch = __ARM_ARCH; diff --git a/tcg/i386/tcg-target.c.inc b/tcg/i386/tcg-target.c.inc index aaf6107284..167228a781 100644 --- a/tcg/i386/tcg-target.c.inc +++ b/tcg/i386/tcg-target.c.inc @@ -22,9 +22,6 @@ * THE SOFTWARE. */ -#include "../tcg-ldst.c.inc" -#include "../tcg-pool.c.inc" - /* Used for function call generation. */ #define TCG_TARGET_STACK_ALIGN 16 #if defined(_WIN64) diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc index 8ae561bfc0..a273e7fce5 100644 --- a/tcg/loongarch64/tcg-target.c.inc +++ b/tcg/loongarch64/tcg-target.c.inc @@ -29,7 +29,6 @@ * THE SOFTWARE. */ -#include "../tcg-ldst.c.inc" #include /* used for function call generation */ @@ -2465,6 +2464,14 @@ static void tcg_out_tb_start(TCGContext *s) /* nothing to do */ } +static void tcg_out_nop_fill(tcg_insn_unit *p, int count) +{ + for (int i = 0; i < count; ++i) { + /* Canonical nop is andi r0,r0,0 */ + p[i] = OPC_ANDI; + } +} + static void tcg_target_init(TCGContext *s) { unsigned long hwcap = qemu_getauxval(AT_HWCAP); diff --git a/tcg/mips/tcg-target.c.inc b/tcg/mips/tcg-target.c.inc index ed41cd7f1b..8857398893 100644 --- a/tcg/mips/tcg-target.c.inc +++ b/tcg/mips/tcg-target.c.inc @@ -24,9 +24,6 @@ * THE SOFTWARE. */ -#include "../tcg-ldst.c.inc" -#include "../tcg-pool.c.inc" - /* used for function call generation */ #define TCG_TARGET_STACK_ALIGN 16 #if _MIPS_SIM == _ABIO32 diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc index 9a11c26fd3..94997b126f 100644 --- a/tcg/ppc/tcg-target.c.inc +++ b/tcg/ppc/tcg-target.c.inc @@ -23,8 +23,6 @@ */ #include "elf.h" -#include "../tcg-pool.c.inc" -#include "../tcg-ldst.c.inc" /* * Standardize on the _CALL_FOO symbols used by GCC: diff --git a/tcg/riscv/tcg-target.c.inc b/tcg/riscv/tcg-target.c.inc index 34402fee2a..7d1bba100a 100644 --- a/tcg/riscv/tcg-target.c.inc +++ b/tcg/riscv/tcg-target.c.inc @@ -27,9 +27,6 @@ * THE SOFTWARE. */ -#include "../tcg-ldst.c.inc" -#include "../tcg-pool.c.inc" - /* Used for function call generation. */ #define TCG_REG_CALL_STACK TCG_REG_SP #define TCG_TARGET_STACK_ALIGN 16 diff --git a/tcg/s390x/tcg-target.c.inc b/tcg/s390x/tcg-target.c.inc index b1188525b2..fdf57c0b07 100644 --- a/tcg/s390x/tcg-target.c.inc +++ b/tcg/s390x/tcg-target.c.inc @@ -24,8 +24,6 @@ * THE SOFTWARE. */ -#include "../tcg-ldst.c.inc" -#include "../tcg-pool.c.inc" #include "elf.h" /* Used for function call generation. */ diff --git a/tcg/sparc64/tcg-target.c.inc b/tcg/sparc64/tcg-target.c.inc index c9d105c35a..fe3e727399 100644 --- a/tcg/sparc64/tcg-target.c.inc +++ b/tcg/sparc64/tcg-target.c.inc @@ -27,9 +27,6 @@ #error "unsupported code generation mode" #endif -#include "../tcg-ldst.c.inc" -#include "../tcg-pool.c.inc" - /* Used for function call generation. */ #define TCG_REG_CALL_STACK TCG_REG_O6 #define TCG_TARGET_STACK_BIAS 2047 diff --git a/tcg/tcg-ldst.c.inc b/tcg/tcg-ldst.c.inc deleted file mode 100644 index ffada04af0..0000000000 --- a/tcg/tcg-ldst.c.inc +++ /dev/null @@ -1,65 +0,0 @@ -/* - * TCG Backend Data: load-store optimization only. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -/* - * Generate TB finalization at the end of block - */ - -static bool tcg_out_qemu_ld_slow_path(TCGContext *s, TCGLabelQemuLdst *l); -static bool tcg_out_qemu_st_slow_path(TCGContext *s, TCGLabelQemuLdst *l); - -static int tcg_out_ldst_finalize(TCGContext *s) -{ - TCGLabelQemuLdst *lb; - - /* qemu_ld/st slow paths */ - QSIMPLEQ_FOREACH(lb, &s->ldst_labels, next) { - if (lb->is_ld - ? !tcg_out_qemu_ld_slow_path(s, lb) - : !tcg_out_qemu_st_slow_path(s, lb)) { - return -2; - } - - /* Test for (pending) buffer overflow. The assumption is that any - one operation beginning below the high water mark cannot overrun - the buffer completely. Thus we can test for overflow after - generating code without having to check during generation. */ - if (unlikely((void *)s->code_ptr > s->code_gen_highwater)) { - return -1; - } - } - return 0; -} - -/* - * Allocate a new TCGLabelQemuLdst entry. - */ - -static inline TCGLabelQemuLdst *new_ldst_label(TCGContext *s) -{ - TCGLabelQemuLdst *l = tcg_malloc(sizeof(*l)); - - memset(l, 0, sizeof(*l)); - QSIMPLEQ_INSERT_TAIL(&s->ldst_labels, l, next); - - return l; -} diff --git a/tcg/tcg-pool.c.inc b/tcg/tcg-pool.c.inc deleted file mode 100644 index 90c2e63b7f..0000000000 --- a/tcg/tcg-pool.c.inc +++ /dev/null @@ -1,162 +0,0 @@ -/* - * TCG Backend Data: constant pool. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -typedef struct TCGLabelPoolData { - struct TCGLabelPoolData *next; - tcg_insn_unit *label; - intptr_t addend; - int rtype; - unsigned nlong; - tcg_target_ulong data[]; -} TCGLabelPoolData; - - -static TCGLabelPoolData *new_pool_alloc(TCGContext *s, int nlong, int rtype, - tcg_insn_unit *label, intptr_t addend) -{ - TCGLabelPoolData *n = tcg_malloc(sizeof(TCGLabelPoolData) - + sizeof(tcg_target_ulong) * nlong); - - n->label = label; - n->addend = addend; - n->rtype = rtype; - n->nlong = nlong; - return n; -} - -static void new_pool_insert(TCGContext *s, TCGLabelPoolData *n) -{ - TCGLabelPoolData *i, **pp; - int nlong = n->nlong; - - /* Insertion sort on the pool. */ - for (pp = &s->pool_labels; (i = *pp) != NULL; pp = &i->next) { - if (nlong > i->nlong) { - break; - } - if (nlong < i->nlong) { - continue; - } - if (memcmp(n->data, i->data, sizeof(tcg_target_ulong) * nlong) >= 0) { - break; - } - } - n->next = *pp; - *pp = n; -} - -/* The "usual" for generic integer code. */ -static inline void new_pool_label(TCGContext *s, tcg_target_ulong d, int rtype, - tcg_insn_unit *label, intptr_t addend) -{ - TCGLabelPoolData *n = new_pool_alloc(s, 1, rtype, label, addend); - n->data[0] = d; - new_pool_insert(s, n); -} - -/* For v64 or v128, depending on the host. */ -static inline void new_pool_l2(TCGContext *s, int rtype, tcg_insn_unit *label, - intptr_t addend, tcg_target_ulong d0, - tcg_target_ulong d1) -{ - TCGLabelPoolData *n = new_pool_alloc(s, 2, rtype, label, addend); - n->data[0] = d0; - n->data[1] = d1; - new_pool_insert(s, n); -} - -/* For v128 or v256, depending on the host. */ -static inline void new_pool_l4(TCGContext *s, int rtype, tcg_insn_unit *label, - intptr_t addend, tcg_target_ulong d0, - tcg_target_ulong d1, tcg_target_ulong d2, - tcg_target_ulong d3) -{ - TCGLabelPoolData *n = new_pool_alloc(s, 4, rtype, label, addend); - n->data[0] = d0; - n->data[1] = d1; - n->data[2] = d2; - n->data[3] = d3; - new_pool_insert(s, n); -} - -/* For v256, for 32-bit host. */ -static inline void new_pool_l8(TCGContext *s, int rtype, tcg_insn_unit *label, - intptr_t addend, tcg_target_ulong d0, - tcg_target_ulong d1, tcg_target_ulong d2, - tcg_target_ulong d3, tcg_target_ulong d4, - tcg_target_ulong d5, tcg_target_ulong d6, - tcg_target_ulong d7) -{ - TCGLabelPoolData *n = new_pool_alloc(s, 8, rtype, label, addend); - n->data[0] = d0; - n->data[1] = d1; - n->data[2] = d2; - n->data[3] = d3; - n->data[4] = d4; - n->data[5] = d5; - n->data[6] = d6; - n->data[7] = d7; - new_pool_insert(s, n); -} - -/* To be provided by cpu/tcg-target.c.inc. */ -static void tcg_out_nop_fill(tcg_insn_unit *p, int count); - -static int tcg_out_pool_finalize(TCGContext *s) -{ - TCGLabelPoolData *p = s->pool_labels; - TCGLabelPoolData *l = NULL; - void *a; - - if (p == NULL) { - return 0; - } - - /* ??? Round up to qemu_icache_linesize, but then do not round - again when allocating the next TranslationBlock structure. */ - a = (void *)ROUND_UP((uintptr_t)s->code_ptr, - sizeof(tcg_target_ulong) * p->nlong); - tcg_out_nop_fill(s->code_ptr, (tcg_insn_unit *)a - s->code_ptr); - s->data_gen_ptr = a; - - for (; p != NULL; p = p->next) { - size_t size = sizeof(tcg_target_ulong) * p->nlong; - uintptr_t value; - - if (!l || l->nlong != p->nlong || memcmp(l->data, p->data, size)) { - if (unlikely(a > s->code_gen_highwater)) { - return -1; - } - memcpy(a, p->data, size); - a += size; - l = p; - } - - value = (uintptr_t)tcg_splitwx_to_rx(a) - size; - if (!patch_reloc(p->label, p->rtype, value, p->addend)) { - return -2; - } - } - - s->code_ptr = a; - return 0; -} diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index e6c97e8153..5f88ca0537 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -22,8 +22,6 @@ * THE SOFTWARE. */ -#include "../tcg-pool.c.inc" - /* Used for function call generation. */ #define TCG_TARGET_CALL_STACK_OFFSET 0 #define TCG_TARGET_STACK_ALIGN 8 @@ -979,3 +977,13 @@ bool tcg_target_has_memory_bswap(MemOp memop) { return true; } + +static bool tcg_out_qemu_ld_slow_path(TCGContext *s, TCGLabelQemuLdst *l) +{ + g_assert_not_reached(); +} + +static bool tcg_out_qemu_st_slow_path(TCGContext *s, TCGLabelQemuLdst *l) +{ + g_assert_not_reached(); +} From patchwork Fri Jan 17 18:24:04 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858260 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp845037wrb; Fri, 17 Jan 2025 10:33:20 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUGpmhgbLkgsU3pgFnPQkJLkBpZ5N20JTufxpXA+m+AujPtsKjoO0RRPMROlGT9+rIM4AQzBQ==@linaro.org X-Google-Smtp-Source: AGHT+IFbqdyA4sNbmPPq7q/GB/O7xZPQ+xpqUj+NsRD9wtNIrxG2kLS70avH8BXcxeshzn3tpdkL X-Received: by 2002:a05:6102:290d:b0:4b2:cc92:169d with SMTP id ada2fe7eead31-4b690b71af5mr3525977137.4.1737138800038; Fri, 17 Jan 2025 10:33:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138800; cv=none; d=google.com; s=arc-20240605; b=WwcQIOuWEf8UB2cjgtoxN9mc/EyAhWlF8kUrc2j5Bd7k7CKDzXII2dm4O5ONBEE7Ez BXB11nlzl231xA5lgyVArrRrpxesd4WwQhl6bawWdBEu+5cEteOGEAMTT4rXiB1OcUW/ l1iqaw1D2D1dg522N4K6y7yxBzA67MNGv/pWPfNs/nfa26tDHTvcgFQTwpJkuE0oha0u jxMbs7e2dGkWWLUStssm/ZvxnTi8j18AjN+lXqXxLktFwKwuopzSuxqMYNcFzn7cdPxc plt7ylR23JpsmV9/o7tuzN0YWdiAiLPrk1gwsxPW4yda3yc/6hBCKLiZiQujBHlWN8eQ hVXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=wWOubo1yw/jMK9n7npaDQ/kdBR0LHc4+hHuxEbmZxkw=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=T9StjlXIKHW/GQCrg9Uo/53xLaCq4iNwhvegarm8FBrZGNFmTeeXlg35Jo6XfBzv22 MWNRnDcOXJJeqBpgh3hJXYiUCfHMvGmUmOEka03tLPW3tLruG6ICa8LjohUpLbzB95QJ 88ILQAftIIgr60y/44kmBQxs9GVeXsV5xC5Vnw60IXx/ipJ8zI5bnl9aqARDjEyCcNnK oKuhu6yZYSNzPxacP6/S0qGu9i/cUcWn7bC9sr+IHo1bdjOsZHs8Xh45nN4TSlu2F/D0 IHnd8i8wR1dTa+lsUicgDWTTMoEocNQqXWq5RnL+rJWOlbAyu9xamu7d9dcjc2HKxOcJ Z3cg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ocAFvnUl; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id ada2fe7eead31-4b68a2fa089si1377661137.302.2025.01.17.10.33.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:33:20 -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=ocAFvnUl; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr1v-00040e-8t; Fri, 17 Jan 2025 13:25:15 -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 1tYr1s-0003yQ-NE for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:12 -0500 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr1q-0007r9-PR for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:12 -0500 Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-21669fd5c7cso45849125ad.3 for ; Fri, 17 Jan 2025 10:25:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138309; x=1737743109; 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=wWOubo1yw/jMK9n7npaDQ/kdBR0LHc4+hHuxEbmZxkw=; b=ocAFvnUlPu/0w5IUFBYl7jRv8B88wNs+ry6v1cxdDxAujF+qFMUBrI+tPCnxUVAVKd j6aKtfSp7ao4BnU2vuLyBxoyyzhTXGndWUKR6VxQvr77z232JRjGeBnLRaroENIOWGHw W33VoJc+tJp1PcjEfnUADlNDnFcp/jpIwhVDRXfvJDpdwur/VENy8aSfWzBfHXRj9Oyt zMBvPVZEMl+sVJgFnJOu12oe02s0eC+t1yFYckwX9mmeKoTkWY45Ud/OrBrkUuep7ZV1 4/zYKUKS0sNb2KlFyDGUw2DkHOVlHvebw1OGjmBLCyrfZrelv89aZvfI0cLmvjF0qCQk EK2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138309; x=1737743109; 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=wWOubo1yw/jMK9n7npaDQ/kdBR0LHc4+hHuxEbmZxkw=; b=GBzOqzCnJwO+NPYUN2e6d/VYJHCqOwB6sQecyfdr/ajlSnEJJQCCoVFlfQukTsMLjE LMMNRNDKp6mjTSWVGFFy2HDmsrq4vELNHBhZZWObV4f0F5MUPljviLvsQlL/DE5VsHT+ PjyGfwziG2DE60uDfAMYcEdg0aT/0Utc2W78m48aflfVWUOcCNoiYdV1gUAhpmbJNiTp T2drecy//MA+ivgCtTreI6Zn+3tmma1VcpfDRIKE238sCw+p8GkSy2kp3HLL1JVs9RMg +trbKmO5JRf4Ur9iTCco1HbAD2oFqSAgRjQYmnobyHSxJcdmM07Dgp8yozDQ5qAmDmsC Rnnw== X-Gm-Message-State: AOJu0Yx4LJaEJepPq7SYWg+XRHnoYmDVkfC/TYtcXrTuNOTGFSyCJ9rN Xbc0OO20Zrr+JMIhrMFiDJe4aIsK3GfSGunz2yuGsKxHxjE8OnUH0KhNPhItj/sZjRJ6DbXXY5w C X-Gm-Gg: ASbGncuXiwP9ehC12uN29pupSwVEXbCD92oq3cXxJYkDL6XHjR+Yl2pFZJtRLpNsros 0L20ZW1adrNUzicV5tYss+jGzY0xve4+JWBOtkT+P1CZ3RyU62W60RWewb1BAsLBZUe05Coezmr P7B0OnYVoYGkow0weIzll3CKv3jJ/EVV31ItH+3dOYJsM14yxa0AF6cbpOTX4gfd8nXzk/3VC13 vldhuM5cefxxRq7hLXxXb0LNCZO9zVatwdScP8JQpbXgYzI5QYh0XTPy6K3GxHI0PCEcQ8V2UH4 G8UO65tB83foQYA= X-Received: by 2002:a17:902:d4c8:b0:216:725c:a11a with SMTP id d9443c01a7336-21c352c8145mr62648135ad.10.1737138308995; Fri, 17 Jan 2025 10:25:08 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21c2d3acccesm18879005ad.123.2025.01.17.10.25.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:25:08 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 16/68] tcg: Rename tcg-target.opc.h to tcg-target-opc.h.inc Date: Fri, 17 Jan 2025 10:24:04 -0800 Message-ID: <20250117182456.2077110-17-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62a; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62a.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 In addition, add empty files for mips, sparc64 and tci. Make the include unconditional within tcg-opc.h. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/tcg/tcg-opc.h | 4 +--- tcg/aarch64/{tcg-target.opc.h => tcg-target-opc.h.inc} | 0 tcg/arm/{tcg-target.opc.h => tcg-target-opc.h.inc} | 0 tcg/i386/{tcg-target.opc.h => tcg-target-opc.h.inc} | 0 tcg/loongarch64/{tcg-target.opc.h => tcg-target-opc.h.inc} | 0 tcg/mips/tcg-target-opc.h.inc | 1 + tcg/ppc/{tcg-target.opc.h => tcg-target-opc.h.inc} | 0 tcg/riscv/{tcg-target.opc.h => tcg-target-opc.h.inc} | 0 tcg/s390x/{tcg-target.opc.h => tcg-target-opc.h.inc} | 0 tcg/sparc64/tcg-target-opc.h.inc | 1 + tcg/tci/tcg-target-opc.h.inc | 1 + 11 files changed, 4 insertions(+), 3 deletions(-) rename tcg/aarch64/{tcg-target.opc.h => tcg-target-opc.h.inc} (100%) rename tcg/arm/{tcg-target.opc.h => tcg-target-opc.h.inc} (100%) rename tcg/i386/{tcg-target.opc.h => tcg-target-opc.h.inc} (100%) rename tcg/loongarch64/{tcg-target.opc.h => tcg-target-opc.h.inc} (100%) create mode 100644 tcg/mips/tcg-target-opc.h.inc rename tcg/ppc/{tcg-target.opc.h => tcg-target-opc.h.inc} (100%) rename tcg/riscv/{tcg-target.opc.h => tcg-target-opc.h.inc} (100%) rename tcg/s390x/{tcg-target.opc.h => tcg-target-opc.h.inc} (100%) create mode 100644 tcg/sparc64/tcg-target-opc.h.inc create mode 100644 tcg/tci/tcg-target-opc.h.inc diff --git a/include/tcg/tcg-opc.h b/include/tcg/tcg-opc.h index 546eb49c11..93622f3f6b 100644 --- a/include/tcg/tcg-opc.h +++ b/include/tcg/tcg-opc.h @@ -301,9 +301,7 @@ DEF(cmpsel_vec, 1, 4, 1, IMPLVEC | IMPL(TCG_TARGET_HAS_cmpsel_vec)) DEF(last_generic, 0, 0, 0, TCG_OPF_NOT_PRESENT) -#if TCG_TARGET_MAYBE_vec -#include "tcg-target.opc.h" -#endif +#include "tcg-target-opc.h.inc" #ifdef TCG_TARGET_INTERPRETER /* These opcodes are only for use between the tci generator and interpreter. */ diff --git a/tcg/aarch64/tcg-target.opc.h b/tcg/aarch64/tcg-target-opc.h.inc similarity index 100% rename from tcg/aarch64/tcg-target.opc.h rename to tcg/aarch64/tcg-target-opc.h.inc diff --git a/tcg/arm/tcg-target.opc.h b/tcg/arm/tcg-target-opc.h.inc similarity index 100% rename from tcg/arm/tcg-target.opc.h rename to tcg/arm/tcg-target-opc.h.inc diff --git a/tcg/i386/tcg-target.opc.h b/tcg/i386/tcg-target-opc.h.inc similarity index 100% rename from tcg/i386/tcg-target.opc.h rename to tcg/i386/tcg-target-opc.h.inc diff --git a/tcg/loongarch64/tcg-target.opc.h b/tcg/loongarch64/tcg-target-opc.h.inc similarity index 100% rename from tcg/loongarch64/tcg-target.opc.h rename to tcg/loongarch64/tcg-target-opc.h.inc diff --git a/tcg/mips/tcg-target-opc.h.inc b/tcg/mips/tcg-target-opc.h.inc new file mode 100644 index 0000000000..84e777bfe5 --- /dev/null +++ b/tcg/mips/tcg-target-opc.h.inc @@ -0,0 +1 @@ +/* No target specific opcodes. */ diff --git a/tcg/ppc/tcg-target.opc.h b/tcg/ppc/tcg-target-opc.h.inc similarity index 100% rename from tcg/ppc/tcg-target.opc.h rename to tcg/ppc/tcg-target-opc.h.inc diff --git a/tcg/riscv/tcg-target.opc.h b/tcg/riscv/tcg-target-opc.h.inc similarity index 100% rename from tcg/riscv/tcg-target.opc.h rename to tcg/riscv/tcg-target-opc.h.inc diff --git a/tcg/s390x/tcg-target.opc.h b/tcg/s390x/tcg-target-opc.h.inc similarity index 100% rename from tcg/s390x/tcg-target.opc.h rename to tcg/s390x/tcg-target-opc.h.inc diff --git a/tcg/sparc64/tcg-target-opc.h.inc b/tcg/sparc64/tcg-target-opc.h.inc new file mode 100644 index 0000000000..84e777bfe5 --- /dev/null +++ b/tcg/sparc64/tcg-target-opc.h.inc @@ -0,0 +1 @@ +/* No target specific opcodes. */ diff --git a/tcg/tci/tcg-target-opc.h.inc b/tcg/tci/tcg-target-opc.h.inc new file mode 100644 index 0000000000..84e777bfe5 --- /dev/null +++ b/tcg/tci/tcg-target-opc.h.inc @@ -0,0 +1 @@ +/* No target specific opcodes. */ From patchwork Fri Jan 17 18:24:05 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858225 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp842996wrb; Fri, 17 Jan 2025 10:29:00 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWLxQo2qlNNz493OPbZMpa7ogtP8faN+q2WNB7DX7iDwCSNNAmzHuXXfRc2L8Vh5lhKpni2yg==@linaro.org X-Google-Smtp-Source: AGHT+IGNx+iD5Ubg9Qo3mMo1nAt7aA12CceGlNr5DVDxmz817mqZMbsUENaupaVHfFKicp6aoUiK X-Received: by 2002:ac8:58c6:0:b0:467:61c1:df3e with SMTP id d75a77b69052e-46e12ab658emr49128981cf.30.1737138540323; Fri, 17 Jan 2025 10:29:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138540; cv=none; d=google.com; s=arc-20240605; b=UncQLdiH0ui2Sdw8Ju5kBJ6QDiqwdYNayvXNuNt3EsLS1vXuFPgApJz8ROZD+1Bf0/ JBmWLj6ssivYWEtOj57XPFOuwzcjBmMrts5wiAo9l+J+P761niKFrCN7dEvXknJvkAzp Zs/0xGWdbxHdcZTz+VyAqIRrpRtq+wUjt5ptEj1nz5Lr8G7HRmsFAsBun7IJirmfdDdK tAbkcxjdswqFP3+4UGvooem3Flo+kj3kFu5Om+zSPESzUli0c8pNEGtXQF3tHTeIlKwg pzgXfzjH/6doVc9LXBu3mPaW0zehOSBWf32oopM2+ANn0e0Fr41RdrgxLB5ebnJnXPmC 6vHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=pQva3q+MWFJ9pcoUzbmbXwAhlkVRuQCmcAHZ1Ju2AJA=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=KyZYUpNv8ad0Dlxx1727JifGYCXAYV1gZxrbnsEMKzNt7e1TVCKK8Z8NW1y+NdH6tN O6E+e76KBkWJM7S8uvcK/XdpE2+WCAPSTD7o8Mp7Yx1rkTld1P9s3z7cdnyRRnPbjDrU Y0WqeEQhB9gUqzKo/4H4DGuwLHl4+AL91blKaxdM5oWV4bymKqSIefv/Ko6cJ5HbJH5t AB05kClXhij0Z5WTaGnQtOoX00dncvJgt2SH/isWfY1m0YbExFI3ErTC9AhxWpKnTd+M W/kPI0o7sc1WOFR3FrH3QZiE9229KiPDLY+sIQTng7jpuDQRrH315/pKoiSH6ol/d7AU OdYg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VKajTxHq; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46e1048f6c9si28708671cf.578.2025.01.17.10.29.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:29:00 -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=VKajTxHq; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr1w-000431-Qb; Fri, 17 Jan 2025 13:25:16 -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 1tYr1v-00040g-3E for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:15 -0500 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 1tYr1r-0007rH-AM for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:13 -0500 Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-21636268e43so58625235ad.2 for ; Fri, 17 Jan 2025 10:25:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138310; x=1737743110; 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=pQva3q+MWFJ9pcoUzbmbXwAhlkVRuQCmcAHZ1Ju2AJA=; b=VKajTxHq+V/nOaQCoqV5AoNRcDdpTdAeCpKyLtsWHHuPERMRpRsDslhqr3YCjE9w++ 2LUJC5rTc0Q0TpnwZqKkhjIRlC1gX/XIjGz0boMUcnAyCJlYH4L20gGJwmlPA+44bkhP oZ3WVPaqJ9826PdC4b7+S/9mZMzxUTNjqZ6NAXwQYxARIS7lpJmeGE02ptsjkLydBkRn /RSbUPrL7QcouuG0f63qps/0qgxZG26qqTi4rppaCNfa5uAlviWjLTnaDCM/NHyIe/1A UWx+MOJDfOLutSOjy9adJTe+Kg/6OK1d/tjgs2JLZZF+LjrMtmXF9L6MHdRxJ9X0/EPN v8tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138310; x=1737743110; 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=pQva3q+MWFJ9pcoUzbmbXwAhlkVRuQCmcAHZ1Ju2AJA=; b=OrcktC06wjKJgVAF+uZf3UhlyAZwZ/cxn0Th+3JGxpu5ARw0mc/zBI/8PoEGlQwndH v6iNZ+ElWT8OAa7Yw8798Ye8THImud1+5gnR5H/aw3vywmSHHKOCKTl64lP1ibwwdCXN zR1hK5yQadDtOLa4ST/kpY/df/pjVAJdIlvxpXG6vyBI14LjnMiyVvLY7li43Y45yJf7 s2P/J91DLRuxad6sW3wc698Hfnrv3u+oaDuREFfkB+P8tbLU1GREAaVrAkG5Z2L2Fp5s Vjf5f7SaLmHh8WSQW2Q70HJzi6qx2AphQfUO5fCxk0+efR4/JJz0Ygnc9W5YPMpatQ+0 zWZQ== X-Gm-Message-State: AOJu0Yy1+Mx6t1rQ7/t7fG4IIuDi7bu6Owbo16EsomDpkSn5clC327By 7kjz+PWd7Dfyezg7RYmYxz8bN0zdxTZAeof1jKQ1Q+ZCwJ3pb0K8F1dRgDZtD7UdGxneu9t9HiJ y X-Gm-Gg: ASbGncuF3zeh0XTRDgEj4GFSSaZSY37yjvVbn9d4rr2dFTJH9fFeHd3r5vrH95KijKV 7p46Z6xwxpL5sxa4IF+HJqIsxe+wn9Tw4Hq9pWjisa9MH/voMopYEyqeNhdwAf1RWyDH7dtZoRz jc6gahAGEs/xbC+Ds++bpb9DIpswoxts7a3CODM56htyC2UT8sSNrSoOiGCH9Ak1WcDQbJ5hZvd eR9ZqoSk80lC/pe40Hln4kPjPzc2Bz44UbLYmoeW6ApeTWfPNU9wV+h9AyaxOdSVsIFWm6Nh2P3 E1yBxx9wiJUHQHY= X-Received: by 2002:a17:902:f7ce:b0:215:773a:c168 with SMTP id d9443c01a7336-21c352de425mr55852865ad.1.1737138309885; Fri, 17 Jan 2025 10:25:09 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21c2d3acccesm18879005ad.123.2025.01.17.10.25.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:25:09 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 17/68] tcg/tci: Move TCI specific opcodes to tcg-target-opc.h.inc Date: Fri, 17 Jan 2025 10:24:05 -0800 Message-ID: <20250117182456.2077110-18-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Now that tcg-target-opc.h.inc is unconditional, we can move these out of the generic header. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/tcg/tcg-opc.h | 6 ------ tcg/tci/tcg-target-opc.h.inc | 5 ++++- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/include/tcg/tcg-opc.h b/include/tcg/tcg-opc.h index 93622f3f6b..14aff6e7f9 100644 --- a/include/tcg/tcg-opc.h +++ b/include/tcg/tcg-opc.h @@ -303,12 +303,6 @@ DEF(last_generic, 0, 0, 0, TCG_OPF_NOT_PRESENT) #include "tcg-target-opc.h.inc" -#ifdef TCG_TARGET_INTERPRETER -/* These opcodes are only for use between the tci generator and interpreter. */ -DEF(tci_movi, 1, 0, 1, TCG_OPF_NOT_PRESENT) -DEF(tci_movl, 1, 0, 1, TCG_OPF_NOT_PRESENT) -#endif - #undef DATA64_ARGS #undef IMPL #undef IMPL64 diff --git a/tcg/tci/tcg-target-opc.h.inc b/tcg/tci/tcg-target-opc.h.inc index 84e777bfe5..ecc8c4e55e 100644 --- a/tcg/tci/tcg-target-opc.h.inc +++ b/tcg/tci/tcg-target-opc.h.inc @@ -1 +1,4 @@ -/* No target specific opcodes. */ +/* SPDX-License-Identifier: MIT */ +/* These opcodes for use between the tci generator and interpreter. */ +DEF(tci_movi, 1, 0, 1, TCG_OPF_NOT_PRESENT) +DEF(tci_movl, 1, 0, 1, TCG_OPF_NOT_PRESENT) From patchwork Fri Jan 17 18:24:06 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858224 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp842997wrb; Fri, 17 Jan 2025 10:29:00 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUw9XMQcJQ+z4nfcqVBgyy5QMdhlzLzwfS/v09c8Ebr0vRImn3z3JmxC+xxVGXz5frmS4XDeQ==@linaro.org X-Google-Smtp-Source: AGHT+IG19CiYSTQv08Ze2+8jEUrlQQ4GYNshrYmdlYHr4AFSzV3Ul/N+9OGcF7EhhU9BHvH7TEuQ X-Received: by 2002:a05:620a:1b9a:b0:7b6:e20d:2b4f with SMTP id af79cd13be357-7be63287efamr649133185a.49.1737138540257; Fri, 17 Jan 2025 10:29:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138540; cv=none; d=google.com; s=arc-20240605; b=ZNRk6tqBOCxyQG6BlzjOuCSLYSmvJXJQtW9FsFkRHsEuaWFhkLbzQhVt7vkRdqNOyE 5ngNkcr3sJa/Rk4wedqmc5iP3KseCnU09Al/TqM+oJBqox0jWjreEuzSTxNFzB43VHSy sqY2UKEpxgTFMa+ZDxxoHBtImXCZuh0rBSgWRFOFIpUbfCYnyvySVpCH50V68n1/it/H pqFVNmlIB+DogFzBIXH7ewgFtEWt/tmEeJ/B7ddCOvO9vJhVELqjk7lOLL+uFMG2U8bp C7ztAIZVBbJzHyIFqzduMBv8/4fa19yRqyXEs11bcM07UWLQ4/A1qbqS8cSLHT+1hgsD BbNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=odcV7Gvy5Hf81zTlTs/tKp0bKYUPWk8WsxFIWicd3Ik=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=k6BjiQY7N/8THDn8LiV3PU/U3jW4NyEE+1GMttDvUXnL+kfZtylnnp/+r4BBil1HlW GQtx6PGq5UCK52WBjhj1E5ZNVjFvAeb1s+SwKKmHv2FZXo8moYXImgVHaw2WPAnFFg5H 9HJzfqb/ARq6QZYnj83X/WscqXKvIw/YVf+SZ+6v3eETFSIEs1CZT09R2do80pckJ3yX QTRpLdwhqpyh+0fAJNaPzf5W1ewvbdz1Uk2KEeJffam6DBI7xIuBlxlFRFigfxDOeNs2 Fm4cXRqqJQRv+slOwxRNms0lLRUMN1tEF6w/jeUlAdhcMXIhzoYGdcoS9ZQrcr3hjShT Yo5Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="P9PQNNq/"; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7be6146cfe9si327885885a.46.2025.01.17.10.29.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:29:00 -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="P9PQNNq/"; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr1y-00044c-1o; Fri, 17 Jan 2025 13:25:18 -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 1tYr1v-000418-C3 for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:15 -0500 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr1t-0007rq-MO for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:15 -0500 Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-21bc1512a63so49513685ad.1 for ; Fri, 17 Jan 2025 10:25:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138311; x=1737743111; 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=odcV7Gvy5Hf81zTlTs/tKp0bKYUPWk8WsxFIWicd3Ik=; b=P9PQNNq/7zecUpSDw7BAS4XFwvsmguoLZBmCim0vhaF4UHvmeCIW6LqGZQq/Jpf6YI dkIaOJ+V4R9nlRQCDd4UogWwwBe9SPF29lj2P7m/9DFdSRs1vQ8U6tIekv76/Vtb/qAx 5JIPHHqnkEyxhHmD1xPknzL4PTH5SLYnZPTb0ktnnO3Z4GHILj5D4z8Zjrayrr9R/d81 WxoyuUsd3voks8cglcohfdngs92k/ePoMWoceQvurkJI95NzHFFnghwtWaco0Ui3XOi6 x6nTVw6gw+kvodzrs8JhqMIAVbzfCETGLSvjQu073Zvgr4BsTChHDg8MpKc8DaYc+bzW UtLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138311; x=1737743111; 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=odcV7Gvy5Hf81zTlTs/tKp0bKYUPWk8WsxFIWicd3Ik=; b=isFeOV3qGViXO/eN8fHTbQwHhRLcyokcPlUzYvWLUEp1yIYY/QNUwOTXv18FsiZYp5 Ny+w7zvBRrvkoVHXF+VCA77d/lFL1WpVcIrBU0LAQAsgulxK0sXHNTIFj+44zB4AJGMg Ci7orVh22pPpmxH3XTeYcvKdxQ0gim35/pzg5JNpxgdtcZ3a41NPsYAc4SzUlDHwJ5rG haJmkTCFpb8iZYXQHp0+gz3l2ARAqwr5w6oNgo6MI/onlG+AT/JGFoFaaRKACdWxXgC9 mWFOE6Efcyn1ju4R4e6XHueXn5cd0ib28tzzPaPZnBeZUIn35eQb3V/xbb/61f2l4I+1 tDeA== X-Gm-Message-State: AOJu0YzK4LG8v7gPintP2Jn9PbmoETNdQ/uDIBs8HvzkrLJIVUKV1pfj AFyL9REjXXv9eC3Vv18+vtkRNfbGVEHTM3lqcF1A2Ki7VN3vZbTbse14xjmGQMoq0TLB6kA1+Ck c X-Gm-Gg: ASbGncsQ2ZCHnzVIx5YHbvE4lAwDHXOckjQT1k7LsM6Zr06WWw3qc7RG4UhubkSjHCy GFFHXQ7SVvJMwQm3YofH9RfRj5NX2pyG6hRVsl3vwyPsJLzwjz3iL9QkClBpU3K3DYKOkA7Yh2a EcziOA7V0+KyP3QLeFcIPJKfdKffzA4YLszVh51QhdqPb/N7P3ovcCadFVd7l8trvIHlUVhbH/B 5ZlJuPbxj/eaLHI8raqoPWMc/VM5Cv7KSZSaja7QmOdh7NgJvh4z8PPqm6szQMywJhXPn5DNLuY vhb8netVsdbXYD0= X-Received: by 2002:a17:902:da8b:b0:215:9642:4d7a with SMTP id d9443c01a7336-21c34cc9574mr49719305ad.0.1737138310714; Fri, 17 Jan 2025 10:25:10 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21c2d3acccesm18879005ad.123.2025.01.17.10.25.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:25:10 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 18/68] tcg: Move fallback tcg_can_emit_vec_op out of line Date: Fri, 17 Jan 2025 10:24:06 -0800 Message-ID: <20250117182456.2077110-19-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62f; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62f.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 Don't reference TCG_TARGET_MAYBE_vec in a public header. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/tcg/tcg.h | 7 ------- tcg/tcg.c | 4 ++++ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h index 2671321cb5..fc379bb122 100644 --- a/include/tcg/tcg.h +++ b/include/tcg/tcg.h @@ -1020,17 +1020,10 @@ extern tcg_prologue_fn *tcg_qemu_tb_exec; void tcg_register_jit(const void *buf, size_t buf_size); -#if TCG_TARGET_MAYBE_vec /* Return zero if the tuple (opc, type, vece) is unsupportable; return > 0 if it is directly supportable; return < 0 if we must call tcg_expand_vec_op. */ int tcg_can_emit_vec_op(TCGOpcode, TCGType, unsigned); -#else -static inline int tcg_can_emit_vec_op(TCGOpcode o, TCGType t, unsigned ve) -{ - return 0; -} -#endif /* Expand the tuple (opc, type, vece) on the given arguments. */ void tcg_expand_vec_op(TCGOpcode, TCGType, unsigned, TCGArg, ...); diff --git a/tcg/tcg.c b/tcg/tcg.c index 7f5d014973..505e43c128 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -170,6 +170,10 @@ static inline void tcg_out_vec_op(TCGContext *s, TCGOpcode opc, { g_assert_not_reached(); } +int tcg_can_emit_vec_op(TCGOpcode o, TCGType t, unsigned ve) +{ + return 0; +} #endif static void tcg_out_st(TCGContext *s, TCGType type, TCGReg arg, TCGReg arg1, intptr_t arg2); From patchwork Fri Jan 17 18:24:07 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858249 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp844322wrb; Fri, 17 Jan 2025 10:31:44 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWZtWGWdKQHgi2Ef42XT+aIGbO6cxAXbGdysAF8HMF+p24aH9hKy3Z0pl3EtJg61LDrXPvUBw==@linaro.org X-Google-Smtp-Source: AGHT+IG2li0YijmkzsjEXNQa43C/F7cV0xAlMcKpa4eFWGpKXxureNv0pDyNy3fR9VxRImPWZO7R X-Received: by 2002:a05:6214:3006:b0:6d8:68a1:b7aa with SMTP id 6a1803df08f44-6e1b222f202mr68407786d6.28.1737138703964; Fri, 17 Jan 2025 10:31:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138703; cv=none; d=google.com; s=arc-20240605; b=ChMONZuKng+NAa/ra6yXbiVNc2Ic65S5y2418Wv5GGp6Y8+UclMIDHnaKdVVhBstDb RRuXJ77jeAExMKH1rH5JlkvhtQSN5slbeMyaPcKdlAA1k6lCJrPCX1XcEUmhmG6i5hQ5 DVe9WBOU6pN/24uwqeAj/GXLSx0Zv/Mtxxaqdf9sCyKUEhWVTcy6G0CnqhLg3ngyg53y /THT3lVYhTQBaX0d0aKbjRVDpYfM9cChpWMzpFkJZxyvYzHCugQgTe1zOO0aUxh1J+RP l/i2upCN/PKRXtLjtjr29xXc6sSPmCCoeSBV4YtdY/v+KIEq/G+8C9kqaTukILZP3W+5 qozw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=xG1IahTqt4vurDh2g5rpdRAk5d613TDMqAZ7ZMXQJB8=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=M8m7kcR8INJ6bN/Lr7RogyeFIrE+II1m9RsUo/2lzZgh8RSGN6YdWae9sl1hOKYsK/ Ty5bFeF79Q5UgZQg8B5Wx5dUG4F9U9bgtt9sGRbI5C4FE4QZtDzr/40xqsv1h7pccoDT kpuDkeClqs4AwV+bDf+F8Rv0gIv5dl0o3ZBMiW+v1/Fc/Jqc3pRVGMPGU//hC010LK3h fe6MY8gKK7B6iN+FfJ+ifzjixcV0J4wOZO3gRwZLmqV6yTP0IkddMqDyrTvw1ui8HES1 s3WqjYhzno8qsjQHUT1ks1nnqabglw7TbcefBZt3wG+U78j3FL0EHTuI2fJDSIKdTGpa uyiw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BdCweNfn; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6e1afcda1a7si34838196d6.236.2025.01.17.10.31.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:31:43 -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=BdCweNfn; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr23-00048H-BS; Fri, 17 Jan 2025 13:25:23 -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 1tYr1x-00044H-LC for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:17 -0500 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr1t-0007rk-Ma for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:17 -0500 Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-2156e078563so33561555ad.2 for ; Fri, 17 Jan 2025 10:25:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138311; x=1737743111; 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=xG1IahTqt4vurDh2g5rpdRAk5d613TDMqAZ7ZMXQJB8=; b=BdCweNfnqSytFpu7NSiOvoWGkc65KP4fzI+vSIwUYe3TPxo6UmxjL0yKmD4v5YzxwI RzNb92PrIv8pHAT0hX8fC69KFNGKu1gw+7S8H6u9tTscQlJ6CNTugJFH7V2mWeLFlVuL avQn+UucC5gXhKAAOD+r5lVhYwUbvPoXrgeM6Od0GMyoiaFhtPAuvlG8xSQRxvEzVHag 9enZ1cnFSlfzfMmZ0d6x1yAcp5+f7Dh0Raffvx+9/5fONOMIV4hi8yBh9X885Y/JdZIq hgpyWMoE3ijmnCm32bIk6FbMlBfmi8fZqkMzuHsqf8PO/jNARwt+sAjXKYc8hAoR4Hmy N3Tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138311; x=1737743111; 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=xG1IahTqt4vurDh2g5rpdRAk5d613TDMqAZ7ZMXQJB8=; b=TlFXuj1kWeD3wREPh03EIVBGXswwqFSYDB3a3KPjHDYZd/+S3/T6PXHY7xA8aefbeN eby7Rywtq1mXqFehRPDnpf0lYHoXiQ1MrH8ApYI2hB172IiAdJBj9CVkYE+fypYLmpBe ELzpFcWcyvjYfCZMP34Py33kHBamaJJjXs0bj8syWgpIBVch/5cPaXA15COam5sl1nd8 P1Tm1LyYSzeywYIS9fPWbGwTfbBcMpSBfL7PnCXUW7ensqCt4qrIyapCjUZaWaHyMPNJ iA8XrjivmMfLNgWLwhD+TT1j3eLKtdOOm4NJ78FNbH0hPsiIgDVSMYGsgmoJRt37v/7x jmmw== X-Gm-Message-State: AOJu0YyKFO/lfSZYdLMc7v+4k39Wa0KJ8MnP9Z3a5QGRGrNoQmLycO9b YgtSqDpRtse8V4C/90TT1anUTmrPcKbrGoSgg2lTe9u6PKQDVjFVDm0nLHHCKFGKqOgEP04llVV I X-Gm-Gg: ASbGncuRGRqnmeLOgIUsJa9hhLKTP41vMPIXJ1yak/tOLi5AO9XvIjLWkDt1GW0MTSK T0MVFw79fazRSCr0eG4fBHDIIjm0Nuf17FDdEtjoXnH8tsvNlTJHoVhVD6sYk6m8JjeOeNrSMH0 2dBbWs9L8a3Hs8YfUSdu23ffmamrAGj6sLIiiZJMfE6B1uhqR2iSUm9Ip2Y3wXYNXA7UzqFkcl/ cwDfK6d1C0L7YaYV1YhHF7HSkPMSH6sP1qnD+f4UIWNWs/L8LZMhtneH8nb/w4E2X79YJm46iRc j7V9t+srwwFuzSI= X-Received: by 2002:a17:903:32c1:b0:216:59ed:1ab0 with SMTP id d9443c01a7336-21c3555847amr44373925ad.27.1737138311393; Fri, 17 Jan 2025 10:25:11 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21c2d3acccesm18879005ad.123.2025.01.17.10.25.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:25:10 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 19/68] tcg/ppc: Remove TCGPowerISA enum Date: Fri, 17 Jan 2025 10:24:07 -0800 Message-ID: <20250117182456.2077110-20-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::629; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x629.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.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, TVD_SUBJ_WIPE_DEBT=1.004 autolearn=no 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 Left-over from commit 623d7e3551a ("util: Add cpuinfo-ppc.c"). Signed-off-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20250108215156.8731-2-philmd@linaro.org> --- tcg/ppc/tcg-target.h | 8 -------- 1 file changed, 8 deletions(-) diff --git a/tcg/ppc/tcg-target.h b/tcg/ppc/tcg-target.h index 8291e0127d..4fa4a30de4 100644 --- a/tcg/ppc/tcg-target.h +++ b/tcg/ppc/tcg-target.h @@ -55,14 +55,6 @@ typedef enum { TCG_AREG0 = TCG_REG_R27 } TCGReg; -typedef enum { - tcg_isa_base, - tcg_isa_2_06, - tcg_isa_2_07, - tcg_isa_3_00, - tcg_isa_3_10, -} TCGPowerISA; - #define have_isa_2_06 (cpuinfo & CPUINFO_V2_06) #define have_isa_2_07 (cpuinfo & CPUINFO_V2_07) #define have_isa_3_00 (cpuinfo & CPUINFO_V3_0) From patchwork Fri Jan 17 18:24:08 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858221 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp842208wrb; Fri, 17 Jan 2025 10:26:52 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXIyVUuUbtYaCYIeuSQaFuAPV5oH+k9NRxFOS7XmQKyQSyX4Gt2/q55X4jU8bXcJR7ITfKCjA==@linaro.org X-Google-Smtp-Source: AGHT+IGzrZVhoTox/0uD4qYoMWnjgz33ZQT9tlL3BuIHMiv0LMeihUzphgAMFFXZuspatKG5qSko X-Received: by 2002:ad4:4eab:0:b0:6d8:99cf:d2eb with SMTP id 6a1803df08f44-6e1b216cbbamr64372826d6.21.1737138412301; Fri, 17 Jan 2025 10:26:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138412; cv=none; d=google.com; s=arc-20240605; b=BseNQfdDIiKRe7FONmjUu9c2BvjXJ4Z3avessDLznYV2fq9MHDid2sbsTA9rPr8wxb Mo6O8cDfdlUA++3Zh9QRp7qKgow6URo5/RRC11iUoZ2NMUT9DWrxhVo8agjJLtOHlwkA XGIRHud8jPAbY7HBmn6IRkIK8xpL5+iSr155TINq12Unc+yh7xR2KS43WhT06rf/ChjV 1QfmF3V7sIpWfz+tGhal3sUiBN1BRxCh3nldgnXBXX1gA1kqQb4EorhvKX2FAmBNMgC9 0RZoVROUvr+XOdil9YMz5KVkyAik7BkimMkJF3xfg/o//02y43sOxHFlvo7e/DLAVb4l Vc2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=BlY2d71bd16ZCSa+8arDxoe0WW5txCeM4kb+98ivaDc=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=Azqld0h419RgXOo0Qo1UzU0f+LgTYfy03Jh4Ze3hVLXgNbbL6DobbMXDdDUk64OJov Pnp6agAMxPQmWB4h59yN6v/3IKVk0Qn5kNWE3roJgOOXQpcCyGJmisLBr7pwFJe9kGhu v+oMSyqrm6sf2hrToSvzJn9AdnevEUdiGKEXuvh+Rxu9W5XoC/d1g3TxH/0a6jwsK5eR 64P0KJYFaRtdLhe9rOPoZfbtix0caGzcg33bi7XACWThHyShSImHsM4Fd6mlN69goT4c kyAw//Ua+HTWC5Dp0rcggwWXPGB8JLQjGfTHR39pjWigr2jOxglyqizlGvrjF4DO4QXE X7dQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=H2YbNLSr; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6e1afd23b80si33780666d6.501.2025.01.17.10.26.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:26:52 -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=H2YbNLSr; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr1z-00046W-VM; Fri, 17 Jan 2025 13:25:19 -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 1tYr1v-00041P-UT for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:15 -0500 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr1t-0007ry-MT for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:15 -0500 Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-21675fd60feso55035485ad.2 for ; Fri, 17 Jan 2025 10:25:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138312; x=1737743112; 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=BlY2d71bd16ZCSa+8arDxoe0WW5txCeM4kb+98ivaDc=; b=H2YbNLSr2T6mJA2R1ccZOfZBreeUSWwaUcMHGAyU30PnH/aEWKt2leMRDgQ7Ay5DGo LO1DlN+dphDH+jSJVF0UtYbPIGavU95JCx+gi2CkLVyfcM+GwcQgdMlKSKTOMihikw6m LNZrCRv7kQRqtw1J/0LLeGkHmi+NWhXAqU9PDHe+daydktvFqH0gNNLaljG37Hyxvhbz GPxifLK0G4h28ojoM7WfyB3eKDlGWod6fs5qp5nLXfIR7HZC9ycBmEWDck3sBfHMXrnD Kw3y+P5nCB5IMouf83+G52GhvmqZITr4sJqzm+hbjLriqilwFAXR+x6dLQaIgj197RzV qDZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138312; x=1737743112; 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=BlY2d71bd16ZCSa+8arDxoe0WW5txCeM4kb+98ivaDc=; b=iqrNCQmKSpgC4ElIfOKGsHy5r8+8m557PVuJWRDJWOarc3U/57EcowNuSpSp1yr1mf KQtOU5A2Bwsy+fRe25hxL1utQqkLBRQVcjl4NFH9X2AZiNUm8OKkF2k4dt2FwZQGgLdd 4SaaqhZPbVKpffSJ3gTmqO6MJvClpsjdMHj8LNrpoFtn+sgez44oUoepl1Kj3G8v5TFk jExOD67fu3j0oscx2/DjoO3dEqrolplCyfX4GY4+vQTAdO1aUaIta8qUVlot/X7bowRV qGyfymSvGmNZQLNfnGSLylUBwPa00HV9X3qjPIvkp5WZD9YlN7Z9GDpdd90+zkPWnaP+ b9kQ== X-Gm-Message-State: AOJu0YyzXDYenH84jiYsmcVVdlLKCsQNhLfoRKTwbNow/X+40QWuU/Qy +nkcKdIqVu0yHISI7MPpBnvA6LVhtdm789mFaFqYrisgBy3iGFawGurF6ZYnC3ai+2aFd6oTZDM y X-Gm-Gg: ASbGncusMp5d3gykL+7qw2NvdNNfDeaL2AuUh2lr+Dx2cW/P8bGqrku/jgDbLEe57k6 zuBsKlhvuRgdJYj46gxOTEs3+4K+32AYCPHNtqomLrr5FQiOFnMVMntK5OrCBF7vdqJVhG3LhV+ UKVRrqIr5z+mFtFKcwVxhaauT0DJE57byvIi5WtTkuXFo+DBzT4yZY1FcavOdMSQw2hn3E0J17O JQgswijnIg2ckS8aATyOtXjPKwaxKq1SbZ2kJ5r6/BpASwXHH9OolMjXAdWVrbdInZDm3Kuemhx tLHWYS4o4pmo5zA= X-Received: by 2002:a17:903:2284:b0:216:48f4:4f3d with SMTP id d9443c01a7336-21c3550e86cmr45603415ad.13.1737138312133; Fri, 17 Jan 2025 10:25:12 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21c2d3acccesm18879005ad.123.2025.01.17.10.25.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:25:11 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 20/68] tcg: Extract default TCG_TARGET_HAS_foo definitions to 'tcg-has.h' Date: Fri, 17 Jan 2025 10:24:08 -0800 Message-ID: <20250117182456.2077110-21-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62e; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62e.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 Signed-off-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20250108215156.8731-3-philmd@linaro.org> --- include/tcg/tcg.h | 105 +----------------------------------------- tcg/tcg-has.h | 115 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 116 insertions(+), 104 deletions(-) create mode 100644 tcg/tcg-has.h diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h index fc379bb122..4352ec012f 100644 --- a/include/tcg/tcg.h +++ b/include/tcg/tcg.h @@ -64,110 +64,7 @@ typedef uint64_t TCGRegSet; #error unsupported #endif -#if TCG_TARGET_REG_BITS == 32 -/* Turn some undef macros into false macros. */ -#define TCG_TARGET_HAS_extr_i64_i32 0 -#define TCG_TARGET_HAS_div_i64 0 -#define TCG_TARGET_HAS_rem_i64 0 -#define TCG_TARGET_HAS_div2_i64 0 -#define TCG_TARGET_HAS_rot_i64 0 -#define TCG_TARGET_HAS_ext8s_i64 0 -#define TCG_TARGET_HAS_ext16s_i64 0 -#define TCG_TARGET_HAS_ext32s_i64 0 -#define TCG_TARGET_HAS_ext8u_i64 0 -#define TCG_TARGET_HAS_ext16u_i64 0 -#define TCG_TARGET_HAS_ext32u_i64 0 -#define TCG_TARGET_HAS_bswap16_i64 0 -#define TCG_TARGET_HAS_bswap32_i64 0 -#define TCG_TARGET_HAS_bswap64_i64 0 -#define TCG_TARGET_HAS_not_i64 0 -#define TCG_TARGET_HAS_andc_i64 0 -#define TCG_TARGET_HAS_orc_i64 0 -#define TCG_TARGET_HAS_eqv_i64 0 -#define TCG_TARGET_HAS_nand_i64 0 -#define TCG_TARGET_HAS_nor_i64 0 -#define TCG_TARGET_HAS_clz_i64 0 -#define TCG_TARGET_HAS_ctz_i64 0 -#define TCG_TARGET_HAS_ctpop_i64 0 -#define TCG_TARGET_HAS_deposit_i64 0 -#define TCG_TARGET_HAS_extract_i64 0 -#define TCG_TARGET_HAS_sextract_i64 0 -#define TCG_TARGET_HAS_extract2_i64 0 -#define TCG_TARGET_HAS_negsetcond_i64 0 -#define TCG_TARGET_HAS_add2_i64 0 -#define TCG_TARGET_HAS_sub2_i64 0 -#define TCG_TARGET_HAS_mulu2_i64 0 -#define TCG_TARGET_HAS_muls2_i64 0 -#define TCG_TARGET_HAS_muluh_i64 0 -#define TCG_TARGET_HAS_mulsh_i64 0 -/* Turn some undef macros into true macros. */ -#define TCG_TARGET_HAS_add2_i32 1 -#define TCG_TARGET_HAS_sub2_i32 1 -#endif - -#ifndef TCG_TARGET_deposit_i32_valid -#define TCG_TARGET_deposit_i32_valid(ofs, len) 1 -#endif -#ifndef TCG_TARGET_deposit_i64_valid -#define TCG_TARGET_deposit_i64_valid(ofs, len) 1 -#endif -#ifndef TCG_TARGET_extract_i32_valid -#define TCG_TARGET_extract_i32_valid(ofs, len) 1 -#endif -#ifndef TCG_TARGET_extract_i64_valid -#define TCG_TARGET_extract_i64_valid(ofs, len) 1 -#endif - -/* Only one of DIV or DIV2 should be defined. */ -#if defined(TCG_TARGET_HAS_div_i32) -#define TCG_TARGET_HAS_div2_i32 0 -#elif defined(TCG_TARGET_HAS_div2_i32) -#define TCG_TARGET_HAS_div_i32 0 -#define TCG_TARGET_HAS_rem_i32 0 -#endif -#if defined(TCG_TARGET_HAS_div_i64) -#define TCG_TARGET_HAS_div2_i64 0 -#elif defined(TCG_TARGET_HAS_div2_i64) -#define TCG_TARGET_HAS_div_i64 0 -#define TCG_TARGET_HAS_rem_i64 0 -#endif - -#if !defined(TCG_TARGET_HAS_v64) \ - && !defined(TCG_TARGET_HAS_v128) \ - && !defined(TCG_TARGET_HAS_v256) -#define TCG_TARGET_MAYBE_vec 0 -#define TCG_TARGET_HAS_abs_vec 0 -#define TCG_TARGET_HAS_neg_vec 0 -#define TCG_TARGET_HAS_not_vec 0 -#define TCG_TARGET_HAS_andc_vec 0 -#define TCG_TARGET_HAS_orc_vec 0 -#define TCG_TARGET_HAS_nand_vec 0 -#define TCG_TARGET_HAS_nor_vec 0 -#define TCG_TARGET_HAS_eqv_vec 0 -#define TCG_TARGET_HAS_roti_vec 0 -#define TCG_TARGET_HAS_rots_vec 0 -#define TCG_TARGET_HAS_rotv_vec 0 -#define TCG_TARGET_HAS_shi_vec 0 -#define TCG_TARGET_HAS_shs_vec 0 -#define TCG_TARGET_HAS_shv_vec 0 -#define TCG_TARGET_HAS_mul_vec 0 -#define TCG_TARGET_HAS_sat_vec 0 -#define TCG_TARGET_HAS_minmax_vec 0 -#define TCG_TARGET_HAS_bitsel_vec 0 -#define TCG_TARGET_HAS_cmpsel_vec 0 -#define TCG_TARGET_HAS_tst_vec 0 -#else -#define TCG_TARGET_MAYBE_vec 1 -#endif -#ifndef TCG_TARGET_HAS_v64 -#define TCG_TARGET_HAS_v64 0 -#endif -#ifndef TCG_TARGET_HAS_v128 -#define TCG_TARGET_HAS_v128 0 -#endif -#ifndef TCG_TARGET_HAS_v256 -#define TCG_TARGET_HAS_v256 0 -#endif +#include "tcg/tcg-has.h" typedef enum TCGOpcode { #define DEF(name, oargs, iargs, cargs, flags) INDEX_op_ ## name, diff --git a/tcg/tcg-has.h b/tcg/tcg-has.h new file mode 100644 index 0000000000..c09ce13389 --- /dev/null +++ b/tcg/tcg-has.h @@ -0,0 +1,115 @@ +/* SPDX-License-Identifier: MIT */ +/* + * Define target-specific opcode support + * Copyright (c) 2024 Linaro, Ltd. + */ + +#ifndef TCG_HAS_H +#define TCG_HAS_H + +#if TCG_TARGET_REG_BITS == 32 +/* Turn some undef macros into false macros. */ +#define TCG_TARGET_HAS_extr_i64_i32 0 +#define TCG_TARGET_HAS_div_i64 0 +#define TCG_TARGET_HAS_rem_i64 0 +#define TCG_TARGET_HAS_div2_i64 0 +#define TCG_TARGET_HAS_rot_i64 0 +#define TCG_TARGET_HAS_ext8s_i64 0 +#define TCG_TARGET_HAS_ext16s_i64 0 +#define TCG_TARGET_HAS_ext32s_i64 0 +#define TCG_TARGET_HAS_ext8u_i64 0 +#define TCG_TARGET_HAS_ext16u_i64 0 +#define TCG_TARGET_HAS_ext32u_i64 0 +#define TCG_TARGET_HAS_bswap16_i64 0 +#define TCG_TARGET_HAS_bswap32_i64 0 +#define TCG_TARGET_HAS_bswap64_i64 0 +#define TCG_TARGET_HAS_not_i64 0 +#define TCG_TARGET_HAS_andc_i64 0 +#define TCG_TARGET_HAS_orc_i64 0 +#define TCG_TARGET_HAS_eqv_i64 0 +#define TCG_TARGET_HAS_nand_i64 0 +#define TCG_TARGET_HAS_nor_i64 0 +#define TCG_TARGET_HAS_clz_i64 0 +#define TCG_TARGET_HAS_ctz_i64 0 +#define TCG_TARGET_HAS_ctpop_i64 0 +#define TCG_TARGET_HAS_deposit_i64 0 +#define TCG_TARGET_HAS_extract_i64 0 +#define TCG_TARGET_HAS_sextract_i64 0 +#define TCG_TARGET_HAS_extract2_i64 0 +#define TCG_TARGET_HAS_negsetcond_i64 0 +#define TCG_TARGET_HAS_add2_i64 0 +#define TCG_TARGET_HAS_sub2_i64 0 +#define TCG_TARGET_HAS_mulu2_i64 0 +#define TCG_TARGET_HAS_muls2_i64 0 +#define TCG_TARGET_HAS_muluh_i64 0 +#define TCG_TARGET_HAS_mulsh_i64 0 +/* Turn some undef macros into true macros. */ +#define TCG_TARGET_HAS_add2_i32 1 +#define TCG_TARGET_HAS_sub2_i32 1 +#endif + +#ifndef TCG_TARGET_deposit_i32_valid +#define TCG_TARGET_deposit_i32_valid(ofs, len) 1 +#endif +#ifndef TCG_TARGET_deposit_i64_valid +#define TCG_TARGET_deposit_i64_valid(ofs, len) 1 +#endif +#ifndef TCG_TARGET_extract_i32_valid +#define TCG_TARGET_extract_i32_valid(ofs, len) 1 +#endif +#ifndef TCG_TARGET_extract_i64_valid +#define TCG_TARGET_extract_i64_valid(ofs, len) 1 +#endif + +/* Only one of DIV or DIV2 should be defined. */ +#if defined(TCG_TARGET_HAS_div_i32) +#define TCG_TARGET_HAS_div2_i32 0 +#elif defined(TCG_TARGET_HAS_div2_i32) +#define TCG_TARGET_HAS_div_i32 0 +#define TCG_TARGET_HAS_rem_i32 0 +#endif +#if defined(TCG_TARGET_HAS_div_i64) +#define TCG_TARGET_HAS_div2_i64 0 +#elif defined(TCG_TARGET_HAS_div2_i64) +#define TCG_TARGET_HAS_div_i64 0 +#define TCG_TARGET_HAS_rem_i64 0 +#endif + +#if !defined(TCG_TARGET_HAS_v64) \ + && !defined(TCG_TARGET_HAS_v128) \ + && !defined(TCG_TARGET_HAS_v256) +#define TCG_TARGET_MAYBE_vec 0 +#define TCG_TARGET_HAS_abs_vec 0 +#define TCG_TARGET_HAS_neg_vec 0 +#define TCG_TARGET_HAS_not_vec 0 +#define TCG_TARGET_HAS_andc_vec 0 +#define TCG_TARGET_HAS_orc_vec 0 +#define TCG_TARGET_HAS_nand_vec 0 +#define TCG_TARGET_HAS_nor_vec 0 +#define TCG_TARGET_HAS_eqv_vec 0 +#define TCG_TARGET_HAS_roti_vec 0 +#define TCG_TARGET_HAS_rots_vec 0 +#define TCG_TARGET_HAS_rotv_vec 0 +#define TCG_TARGET_HAS_shi_vec 0 +#define TCG_TARGET_HAS_shs_vec 0 +#define TCG_TARGET_HAS_shv_vec 0 +#define TCG_TARGET_HAS_mul_vec 0 +#define TCG_TARGET_HAS_sat_vec 0 +#define TCG_TARGET_HAS_minmax_vec 0 +#define TCG_TARGET_HAS_bitsel_vec 0 +#define TCG_TARGET_HAS_cmpsel_vec 0 +#define TCG_TARGET_HAS_tst_vec 0 +#else +#define TCG_TARGET_MAYBE_vec 1 +#endif +#ifndef TCG_TARGET_HAS_v64 +#define TCG_TARGET_HAS_v64 0 +#endif +#ifndef TCG_TARGET_HAS_v128 +#define TCG_TARGET_HAS_v128 0 +#endif +#ifndef TCG_TARGET_HAS_v256 +#define TCG_TARGET_HAS_v256 0 +#endif + +#endif From patchwork Fri Jan 17 18:24:09 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858216 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp842111wrb; Fri, 17 Jan 2025 10:26:41 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWCz8xXxbjBvbmYGl6rQXMTrTRix+5mWkoQcIo2kmyVAEijcoKUNpWi6QWeHjy3UKGv8Lmc4Q==@linaro.org X-Google-Smtp-Source: AGHT+IE/IvXyYzKEjpkNoJNNUrFfw6BfzWeEs6AAd4aBJqvBamtRDVjS23My/6CgVT6KpbFCjbjZ X-Received: by 2002:a05:6214:486:b0:6d8:95c9:af2b with SMTP id 6a1803df08f44-6e1b224ca45mr67866396d6.35.1737138401525; Fri, 17 Jan 2025 10:26:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138401; cv=none; d=google.com; s=arc-20240605; b=HJzWU0ibphqolYHfEykg3qEb30xgxoNzgO+DNQ7WTwAm6drI+VnOjIvd5Kz5K4dAHq 3oWxNrLDt7RY80xK/EOOZJVQhuB0lV3hpbqLl4cPjbVlwE2RWDsAoj+TqMrYmKXYa8dd Xmo2dIfOK/JVza3tpYNzDJKxUJKzrzxTm3/1BiJAHk5r09dBeV8+FNreF6LXx0KU+yfh Oa6XOIMbq7h5ShfKxReSVu5UeGRHuO0P0jPC/7mUKgJXVW5huuRD/4Cet1drqyNyj7gz Nml48WnFuftq0A1GK62ZLtOtbZ+U/Ehxim1Xek6bZrXH5sapJ01AOimw93NP1hE+jaQE +8cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=ejNe7dujNWlrHZx528aik9wp8F8L+b+G3lLjN4kTkqw=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=cXUp4so7tuZ8tNQy32cG/89V3RwFX3nHmsMdjDqPlLPAsozSlRHfqVqjzOQSybOCne BlwYjdi8lblFro1T6Hw5wU7dfBpM4feAKPhJIDCmTUo9pi029usYgWpuXYqdBlxljrNI s5EFJrKSGtMtqWO5aQ2Io7UlC5TRUtU7hT9ZY4TDew3vlPD/5S9nLohCBhvgqKYSrqvU I6YHKRZdKOt7O42xRyxPVPISd4hf2x6voqsaRNNdlMMDd/k4V5wSoG+QHZ8KzhX5LyeM n2c+B1qeBYs0Izm2O4epizSmhwqf+FP5DpS+1yxQX9iknp8/33ZK4nTn0Z8udJgs4ijC YMDA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vfRaqrpP; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6e1afcf3589si31519966d6.326.2025.01.17.10.26.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:26:41 -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=vfRaqrpP; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr20-00046Z-1V; Fri, 17 Jan 2025 13:25:20 -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 1tYr1x-00043f-6S for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:17 -0500 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr1u-0007sF-Mx for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:16 -0500 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-2164b1f05caso48360205ad.3 for ; Fri, 17 Jan 2025 10:25:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138313; x=1737743113; 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=ejNe7dujNWlrHZx528aik9wp8F8L+b+G3lLjN4kTkqw=; b=vfRaqrpPLJAzhT5RAuuU0S+28U5/2WJYiD5+wwSW+FDg7sgAzR8YNBmTst2UEG/nnE WJf8N11cx+CSe8NXO0keyzXZmJWATDzE0g7HyCSyzCzIBPYs/KNJKt4fQfnKkVge21iK qpTe7Q3YKp6HhiNGVcpffU1URK5Y0mNFhapwVAtW2sibQV1YubrTe60kyJyL1TcBjCbd qAtXEJAMMhcjJQaGqXK3DG/CdNpIklXglF8kgYlj6I8ML12ohgR5n2Lt8rGn3PswK91I vPkHGPlklK7t+ybrUXOhf4m24Biwu2YwlGB2OoIgWsoQy6IYyJ4WpqQ+Mn7fY99AjOPl gtYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138313; x=1737743113; 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=ejNe7dujNWlrHZx528aik9wp8F8L+b+G3lLjN4kTkqw=; b=jz7izruc72wgc64O6aBMNl/d47vyP2Hmcmz0Ll/16QVW65yQY/3WIFUjOPo+SvmBzq U5Bq+VnZNiirZ9zgpPu7Pvb0z8KoxWde3bMu8ciyzn0JOK5FUF5+6NkNihNvLoEZHYjA Tf9edaGEo0vEy8dI61IjUCwIJuWRvoumzCJSrwlOuwBVJ8usWyMVJlFcS8SLL+GSCKgL 6Z2hhRgE1OEYTNSm2BInbI2VVvW0os57FfSo9ICuKbtOz3FZo3w53IMcq6XXRPiSXzs0 jb+qH+5IAlMD+qq2lU/ZqVX5WuwMD870dYpfGh4CP+XsIf8qyQ5AkkFnEHS/suXCv0Pn uy1A== X-Gm-Message-State: AOJu0Yx0yMPz6lkzjv9e0F53dKgNoerzQNPTkRfIohsvgAKMyMYEFVtN f08FkHB4Ej8/R4NTYuSPvTMxzJCaZ0HrUot6rV5m1Wkx81rFgE6xpsdgOAZaedFUNECekCbAoA3 c X-Gm-Gg: ASbGncsE/fx5uMk204TFByXJSlRvUNyTguMVJeMQ+BI/g9r/TF+l8VeRvgD7k7YdHL4 9Kw0Co9HNUsmHg3hkCNFJR/RXaOcqygrAi1EEn0RCq1BIG/m+NrQWn/yri13Ob6mD+Ev8bHOZUG bB0n0b+ibyWCTLnHGycFwIQ+JSVdgb43VdR99dbffE5nOKXLUMdjoRdNaDNPhXlz8Do36+PLCza jjpzls3Mr/aQEX/2i06YvqKTYWoRRIQsYxSVlp2EE0YkDSQ3tJ1n3+e5K/oaQ1s6N5tLwDT/7b5 kONn/EYlwEcy0Mg= X-Received: by 2002:a17:903:2342:b0:216:725c:a137 with SMTP id d9443c01a7336-21c3556b038mr53972085ad.28.1737138313139; Fri, 17 Jan 2025 10:25:13 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21c2d3acccesm18879005ad.123.2025.01.17.10.25.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:25:12 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 21/68] tcg/aarch64: Extract TCG_TARGET_HAS_foo defs to 'tcg-target-has.h' Date: Fri, 17 Jan 2025 10:24:09 -0800 Message-ID: <20250117182456.2077110-22-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x632.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 Signed-off-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20250108215156.8731-4-philmd@linaro.org> --- tcg/aarch64/tcg-target-has.h | 119 +++++++++++++++++++++++++++++++++++ tcg/aarch64/tcg-target.h | 109 +------------------------------- 2 files changed, 120 insertions(+), 108 deletions(-) create mode 100644 tcg/aarch64/tcg-target-has.h diff --git a/tcg/aarch64/tcg-target-has.h b/tcg/aarch64/tcg-target-has.h new file mode 100644 index 0000000000..0e79e01266 --- /dev/null +++ b/tcg/aarch64/tcg-target-has.h @@ -0,0 +1,119 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * Define target-specific opcode support + * Copyright (c) 2013 Huawei Technologies Duesseldorf GmbH + */ + +#ifndef TCG_TARGET_HAS_H +#define TCG_TARGET_HAS_H + +#include "host/cpuinfo.h" + +#define have_lse (cpuinfo & CPUINFO_LSE) +#define have_lse2 (cpuinfo & CPUINFO_LSE2) + +/* optional instructions */ +#define TCG_TARGET_HAS_div_i32 1 +#define TCG_TARGET_HAS_rem_i32 1 +#define TCG_TARGET_HAS_ext8s_i32 1 +#define TCG_TARGET_HAS_ext16s_i32 1 +#define TCG_TARGET_HAS_ext8u_i32 1 +#define TCG_TARGET_HAS_ext16u_i32 1 +#define TCG_TARGET_HAS_bswap16_i32 1 +#define TCG_TARGET_HAS_bswap32_i32 1 +#define TCG_TARGET_HAS_not_i32 1 +#define TCG_TARGET_HAS_rot_i32 1 +#define TCG_TARGET_HAS_andc_i32 1 +#define TCG_TARGET_HAS_orc_i32 1 +#define TCG_TARGET_HAS_eqv_i32 1 +#define TCG_TARGET_HAS_nand_i32 0 +#define TCG_TARGET_HAS_nor_i32 0 +#define TCG_TARGET_HAS_clz_i32 1 +#define TCG_TARGET_HAS_ctz_i32 1 +#define TCG_TARGET_HAS_ctpop_i32 0 +#define TCG_TARGET_HAS_deposit_i32 1 +#define TCG_TARGET_HAS_extract_i32 1 +#define TCG_TARGET_HAS_sextract_i32 1 +#define TCG_TARGET_HAS_extract2_i32 1 +#define TCG_TARGET_HAS_negsetcond_i32 1 +#define TCG_TARGET_HAS_add2_i32 1 +#define TCG_TARGET_HAS_sub2_i32 1 +#define TCG_TARGET_HAS_mulu2_i32 0 +#define TCG_TARGET_HAS_muls2_i32 0 +#define TCG_TARGET_HAS_muluh_i32 0 +#define TCG_TARGET_HAS_mulsh_i32 0 +#define TCG_TARGET_HAS_extr_i64_i32 0 +#define TCG_TARGET_HAS_qemu_st8_i32 0 + +#define TCG_TARGET_HAS_div_i64 1 +#define TCG_TARGET_HAS_rem_i64 1 +#define TCG_TARGET_HAS_ext8s_i64 1 +#define TCG_TARGET_HAS_ext16s_i64 1 +#define TCG_TARGET_HAS_ext32s_i64 1 +#define TCG_TARGET_HAS_ext8u_i64 1 +#define TCG_TARGET_HAS_ext16u_i64 1 +#define TCG_TARGET_HAS_ext32u_i64 1 +#define TCG_TARGET_HAS_bswap16_i64 1 +#define TCG_TARGET_HAS_bswap32_i64 1 +#define TCG_TARGET_HAS_bswap64_i64 1 +#define TCG_TARGET_HAS_not_i64 1 +#define TCG_TARGET_HAS_rot_i64 1 +#define TCG_TARGET_HAS_andc_i64 1 +#define TCG_TARGET_HAS_orc_i64 1 +#define TCG_TARGET_HAS_eqv_i64 1 +#define TCG_TARGET_HAS_nand_i64 0 +#define TCG_TARGET_HAS_nor_i64 0 +#define TCG_TARGET_HAS_clz_i64 1 +#define TCG_TARGET_HAS_ctz_i64 1 +#define TCG_TARGET_HAS_ctpop_i64 0 +#define TCG_TARGET_HAS_deposit_i64 1 +#define TCG_TARGET_HAS_extract_i64 1 +#define TCG_TARGET_HAS_sextract_i64 1 +#define TCG_TARGET_HAS_extract2_i64 1 +#define TCG_TARGET_HAS_negsetcond_i64 1 +#define TCG_TARGET_HAS_add2_i64 1 +#define TCG_TARGET_HAS_sub2_i64 1 +#define TCG_TARGET_HAS_mulu2_i64 0 +#define TCG_TARGET_HAS_muls2_i64 0 +#define TCG_TARGET_HAS_muluh_i64 1 +#define TCG_TARGET_HAS_mulsh_i64 1 + +/* + * Without FEAT_LSE2, we must use LDXP+STXP to implement atomic 128-bit load, + * which requires writable pages. We must defer to the helper for user-only, + * but in system mode all ram is writable for the host. + */ +#ifdef CONFIG_USER_ONLY +#define TCG_TARGET_HAS_qemu_ldst_i128 have_lse2 +#else +#define TCG_TARGET_HAS_qemu_ldst_i128 1 +#endif + +#define TCG_TARGET_HAS_tst 1 + +#define TCG_TARGET_HAS_v64 1 +#define TCG_TARGET_HAS_v128 1 +#define TCG_TARGET_HAS_v256 0 + +#define TCG_TARGET_HAS_andc_vec 1 +#define TCG_TARGET_HAS_orc_vec 1 +#define TCG_TARGET_HAS_nand_vec 0 +#define TCG_TARGET_HAS_nor_vec 0 +#define TCG_TARGET_HAS_eqv_vec 0 +#define TCG_TARGET_HAS_not_vec 1 +#define TCG_TARGET_HAS_neg_vec 1 +#define TCG_TARGET_HAS_abs_vec 1 +#define TCG_TARGET_HAS_roti_vec 0 +#define TCG_TARGET_HAS_rots_vec 0 +#define TCG_TARGET_HAS_rotv_vec 0 +#define TCG_TARGET_HAS_shi_vec 1 +#define TCG_TARGET_HAS_shs_vec 0 +#define TCG_TARGET_HAS_shv_vec 1 +#define TCG_TARGET_HAS_mul_vec 1 +#define TCG_TARGET_HAS_sat_vec 1 +#define TCG_TARGET_HAS_minmax_vec 1 +#define TCG_TARGET_HAS_bitsel_vec 1 +#define TCG_TARGET_HAS_cmpsel_vec 0 +#define TCG_TARGET_HAS_tst_vec 1 + +#endif diff --git a/tcg/aarch64/tcg-target.h b/tcg/aarch64/tcg-target.h index d8ca52d32d..9a682e51a4 100644 --- a/tcg/aarch64/tcg-target.h +++ b/tcg/aarch64/tcg-target.h @@ -13,8 +13,6 @@ #ifndef AARCH64_TCG_TARGET_H #define AARCH64_TCG_TARGET_H -#include "host/cpuinfo.h" - #define TCG_TARGET_INSN_UNIT_SIZE 4 #define MAX_CODE_GEN_BUFFER_SIZE ((size_t)-1) @@ -49,112 +47,7 @@ typedef enum { #define TCG_TARGET_NB_REGS 64 -#define have_lse (cpuinfo & CPUINFO_LSE) -#define have_lse2 (cpuinfo & CPUINFO_LSE2) - -/* optional instructions */ -#define TCG_TARGET_HAS_div_i32 1 -#define TCG_TARGET_HAS_rem_i32 1 -#define TCG_TARGET_HAS_ext8s_i32 1 -#define TCG_TARGET_HAS_ext16s_i32 1 -#define TCG_TARGET_HAS_ext8u_i32 1 -#define TCG_TARGET_HAS_ext16u_i32 1 -#define TCG_TARGET_HAS_bswap16_i32 1 -#define TCG_TARGET_HAS_bswap32_i32 1 -#define TCG_TARGET_HAS_not_i32 1 -#define TCG_TARGET_HAS_rot_i32 1 -#define TCG_TARGET_HAS_andc_i32 1 -#define TCG_TARGET_HAS_orc_i32 1 -#define TCG_TARGET_HAS_eqv_i32 1 -#define TCG_TARGET_HAS_nand_i32 0 -#define TCG_TARGET_HAS_nor_i32 0 -#define TCG_TARGET_HAS_clz_i32 1 -#define TCG_TARGET_HAS_ctz_i32 1 -#define TCG_TARGET_HAS_ctpop_i32 0 -#define TCG_TARGET_HAS_deposit_i32 1 -#define TCG_TARGET_HAS_extract_i32 1 -#define TCG_TARGET_HAS_sextract_i32 1 -#define TCG_TARGET_HAS_extract2_i32 1 -#define TCG_TARGET_HAS_negsetcond_i32 1 -#define TCG_TARGET_HAS_add2_i32 1 -#define TCG_TARGET_HAS_sub2_i32 1 -#define TCG_TARGET_HAS_mulu2_i32 0 -#define TCG_TARGET_HAS_muls2_i32 0 -#define TCG_TARGET_HAS_muluh_i32 0 -#define TCG_TARGET_HAS_mulsh_i32 0 -#define TCG_TARGET_HAS_extr_i64_i32 0 -#define TCG_TARGET_HAS_qemu_st8_i32 0 - -#define TCG_TARGET_HAS_div_i64 1 -#define TCG_TARGET_HAS_rem_i64 1 -#define TCG_TARGET_HAS_ext8s_i64 1 -#define TCG_TARGET_HAS_ext16s_i64 1 -#define TCG_TARGET_HAS_ext32s_i64 1 -#define TCG_TARGET_HAS_ext8u_i64 1 -#define TCG_TARGET_HAS_ext16u_i64 1 -#define TCG_TARGET_HAS_ext32u_i64 1 -#define TCG_TARGET_HAS_bswap16_i64 1 -#define TCG_TARGET_HAS_bswap32_i64 1 -#define TCG_TARGET_HAS_bswap64_i64 1 -#define TCG_TARGET_HAS_not_i64 1 -#define TCG_TARGET_HAS_rot_i64 1 -#define TCG_TARGET_HAS_andc_i64 1 -#define TCG_TARGET_HAS_orc_i64 1 -#define TCG_TARGET_HAS_eqv_i64 1 -#define TCG_TARGET_HAS_nand_i64 0 -#define TCG_TARGET_HAS_nor_i64 0 -#define TCG_TARGET_HAS_clz_i64 1 -#define TCG_TARGET_HAS_ctz_i64 1 -#define TCG_TARGET_HAS_ctpop_i64 0 -#define TCG_TARGET_HAS_deposit_i64 1 -#define TCG_TARGET_HAS_extract_i64 1 -#define TCG_TARGET_HAS_sextract_i64 1 -#define TCG_TARGET_HAS_extract2_i64 1 -#define TCG_TARGET_HAS_negsetcond_i64 1 -#define TCG_TARGET_HAS_add2_i64 1 -#define TCG_TARGET_HAS_sub2_i64 1 -#define TCG_TARGET_HAS_mulu2_i64 0 -#define TCG_TARGET_HAS_muls2_i64 0 -#define TCG_TARGET_HAS_muluh_i64 1 -#define TCG_TARGET_HAS_mulsh_i64 1 - -/* - * Without FEAT_LSE2, we must use LDXP+STXP to implement atomic 128-bit load, - * which requires writable pages. We must defer to the helper for user-only, - * but in system mode all ram is writable for the host. - */ -#ifdef CONFIG_USER_ONLY -#define TCG_TARGET_HAS_qemu_ldst_i128 have_lse2 -#else -#define TCG_TARGET_HAS_qemu_ldst_i128 1 -#endif - -#define TCG_TARGET_HAS_tst 1 - -#define TCG_TARGET_HAS_v64 1 -#define TCG_TARGET_HAS_v128 1 -#define TCG_TARGET_HAS_v256 0 - -#define TCG_TARGET_HAS_andc_vec 1 -#define TCG_TARGET_HAS_orc_vec 1 -#define TCG_TARGET_HAS_nand_vec 0 -#define TCG_TARGET_HAS_nor_vec 0 -#define TCG_TARGET_HAS_eqv_vec 0 -#define TCG_TARGET_HAS_not_vec 1 -#define TCG_TARGET_HAS_neg_vec 1 -#define TCG_TARGET_HAS_abs_vec 1 -#define TCG_TARGET_HAS_roti_vec 0 -#define TCG_TARGET_HAS_rots_vec 0 -#define TCG_TARGET_HAS_rotv_vec 0 -#define TCG_TARGET_HAS_shi_vec 1 -#define TCG_TARGET_HAS_shs_vec 0 -#define TCG_TARGET_HAS_shv_vec 1 -#define TCG_TARGET_HAS_mul_vec 1 -#define TCG_TARGET_HAS_sat_vec 1 -#define TCG_TARGET_HAS_minmax_vec 1 -#define TCG_TARGET_HAS_bitsel_vec 1 -#define TCG_TARGET_HAS_cmpsel_vec 0 -#define TCG_TARGET_HAS_tst_vec 1 +#include "tcg-target-has.h" #define TCG_TARGET_DEFAULT_MO (0) From patchwork Fri Jan 17 18:24:10 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858242 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp843974wrb; Fri, 17 Jan 2025 10:31:04 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVskh0E/2PCzwixAGsoH+D8jdLKoK88TO27J1tavEmIwFQewmjGM+bJVvytWAVtYbyap1f0kw==@linaro.org X-Google-Smtp-Source: AGHT+IGo5jEEqfUlzmPdreNf8omKs1myTMuZ3ZSNU20JY3P6NL8k056aDwDxTFAEEw86TB0UoV+7 X-Received: by 2002:a05:6102:a53:b0:4b2:5c4b:55e7 with SMTP id ada2fe7eead31-4b690cde3a2mr3589380137.25.1737138664154; Fri, 17 Jan 2025 10:31:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138664; cv=none; d=google.com; s=arc-20240605; b=VxJ7K5//E3HAEOOR9UKCZAe+LUlV507BDpQliBvUro4XCoffy/D6DSqO68DkNbA3VB RCYnrNSwU6kszFK8Ne0CwgxDN28VkYd37Fmbj+++VaPmdbw3LZBqgrNsAOOfidabgMx6 mVOGiF1empcVG40/y6ScKJh5YMd5I5vMTmRn5MrFbmRjzCUmz4Ij/xSw1uVDvqMyThYH bKK1lYNSdQhvBin/tm3KI8/mO0C+E4lqKzmXykuBlCDOgxLup9Pm2EDk1FliKNxJh7pT TOsJNNnOPIHWp7BXecK59wDs7nEMXXKS/ZyCEbPufamN8NTHoMtuqeQVyGMiRotq6QwN rLlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=rOSic346AHlhuVEPNh01g7q+WJfoUtr9PY21Tvlp0tM=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=aY327GYgo8fWHvn02CbWqtYd0pMnY92284JuLdVFM2h6C8EIo/ZdFssa+dCHwdaAUK ICiL5fWfRrMPkPgrRaVLGueJNOXdv+BnKNzrmmSqJCfj/jCZSnZYwtOGDNcIbQKR5zSf /XeUknIuQYVMWzZ8oqz0YHYovWsMZ39dr8e6kfSLcqwrX06LO2w4tI9qX4+2JhjX/ukA YZKA5UsBKNYteCtFN9/HkHkfn699MVxKLisWVMHp/p5WaLNs6w2kCHOHGyCDD2Bbl4OO YNIHCKM7Nstln0SuqBJLfY0hdFopyvge7rKYnz2V2Wf86jFaUq8myn/gF5DorGn4pui4 vitw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eyvTq1UH; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id ada2fe7eead31-4b68a2fa037si1486654137.221.2025.01.17.10.31.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:31:04 -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=eyvTq1UH; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr21-00047b-Cq; Fri, 17 Jan 2025 13:25:21 -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 1tYr1x-000448-HS for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:17 -0500 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr1v-0007sT-K2 for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:17 -0500 Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-2166022c5caso43157515ad.2 for ; Fri, 17 Jan 2025 10:25:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138314; x=1737743114; 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=rOSic346AHlhuVEPNh01g7q+WJfoUtr9PY21Tvlp0tM=; b=eyvTq1UH4FerUJqZjeTbukml+wY2jmRmlH+8YHL96a3HpNCBe5tk0jAfuqBbstHMcS 9sT2E4XP1H6UOIHsUm08zw2tI7AkIYoBdZAC6kz9SmW+76teuiaUnZSPyX+54sH4iTbW 0FQQTwgT26Jxr5/g3RMDAnncDSvOOB+XROZEdh6doLWPRnaEfzKPW2ZUzrYuJqDBmP42 HOOInkbVqooM5rpguLU/nYCZ4/nJEwogpeBBXW1rFcwxK0Ai3vNGazXi5Dnyp+m23EiE GwE/UW7XyvoOJoM/m3wE/vREla31ffrbd/1xUIt5MqpEd3W08G8uKbO+xA/Mwe5qRDde WAFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138314; x=1737743114; 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=rOSic346AHlhuVEPNh01g7q+WJfoUtr9PY21Tvlp0tM=; b=MtX2hZIwCU56/QB97WSZm4twJiypov3DSYqEfp9Nm4/lCAs7gEFojhVRpv72MqOJD6 AJNG/zIqJAgq7PMS62RagQvykFhWgYbU3XPbe7fI3NiAtLr2Y4eNe9UoACTtUpVLyoLi Ub7faRdEKdEylYBSUaHLzz2aF2TkkzFBymcsFaxtE5Pd0X6RCpGYnItjuabrEOK/ilqM 2Ynje8EOH2eiJ6F7A/z0qBwIF5+tnp0NGkSjyKHGhCttBczR+lkIKYqTMgFW1i0hNMOA YzBDjvIejQ3tLjePD/G/C+bz5ID3bd5qnsQefAzLE0bFeBNEGjoY3KF4vkEt7zEpAew9 AFzA== X-Gm-Message-State: AOJu0YyxlGpFpVQ4cfoFqR8MD33nCcX5Sjel0ojjBBSWcr6TSUZkUl3N CzlCPfBvXDGDCBRRgiye5rvxg68n9D3vyk7yXK6VyQQfyabTYR4YEo7nq6bFZ3sTp2+hfjP21IB r X-Gm-Gg: ASbGnctEM4q2xSxDQs6lL7zPzuUCOgY7X3CkZYEXi6I4TyNtileTiGqq+FhsMB7/PAj bkSa1+CeKg3hIhlHaRucPpQK2MJdjhbfluCL/bJ82LcbhV4ei+aR5mtnG0xU2IxxeGvPuw5Zvqh ixSrAOWv0813PKO2Of516KNcBusxbgpqcDAO8tSOkEZUor3bXdOrTTkPeUIcoBhlbY3Idp5WX5+ wnRpG+4sC4cMJR645rmCt+fs5UJYkGq/TXjS3fzDaNFVVUYPuG55t4ktLnQJA1nPp3u/N/y4oye LsxoJ7a6e8tRzLU= X-Received: by 2002:a17:902:f105:b0:216:7c33:8994 with SMTP id d9443c01a7336-21c3561fef9mr40007565ad.53.1737138314049; Fri, 17 Jan 2025 10:25:14 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21c2d3acccesm18879005ad.123.2025.01.17.10.25.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:25:13 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 22/68] tcg/arm: Extract TCG_TARGET_HAS_foo defs to 'tcg-target-has.h' Date: Fri, 17 Jan 2025 10:24:10 -0800 Message-ID: <20250117182456.2077110-23-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::629; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x629.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 Signed-off-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20250108215156.8731-5-philmd@linaro.org> --- tcg/arm/tcg-target-has.h | 85 ++++++++++++++++++++++++++++++++++++++++ tcg/arm/tcg-target.h | 74 +--------------------------------- 2 files changed, 86 insertions(+), 73 deletions(-) create mode 100644 tcg/arm/tcg-target-has.h diff --git a/tcg/arm/tcg-target-has.h b/tcg/arm/tcg-target-has.h new file mode 100644 index 0000000000..316185500d --- /dev/null +++ b/tcg/arm/tcg-target-has.h @@ -0,0 +1,85 @@ +/* SPDX-License-Identifier: MIT */ +/* + * Define target-specific opcode support + * Copyright (c) 2008 Fabrice Bellard + * Copyright (c) 2008 Andrzej Zaborowski + */ + +#ifndef TCG_TARGET_HAS_H +#define TCG_TARGET_HAS_H + +extern int arm_arch; + +#define use_armv7_instructions (__ARM_ARCH >= 7 || arm_arch >= 7) + +#ifdef __ARM_ARCH_EXT_IDIV__ +#define use_idiv_instructions 1 +#else +extern bool use_idiv_instructions; +#endif +#ifdef __ARM_NEON__ +#define use_neon_instructions 1 +#else +extern bool use_neon_instructions; +#endif + +/* optional instructions */ +#define TCG_TARGET_HAS_ext8s_i32 1 +#define TCG_TARGET_HAS_ext16s_i32 1 +#define TCG_TARGET_HAS_ext8u_i32 0 /* and r0, r1, #0xff */ +#define TCG_TARGET_HAS_ext16u_i32 1 +#define TCG_TARGET_HAS_bswap16_i32 1 +#define TCG_TARGET_HAS_bswap32_i32 1 +#define TCG_TARGET_HAS_not_i32 1 +#define TCG_TARGET_HAS_rot_i32 1 +#define TCG_TARGET_HAS_andc_i32 1 +#define TCG_TARGET_HAS_orc_i32 0 +#define TCG_TARGET_HAS_eqv_i32 0 +#define TCG_TARGET_HAS_nand_i32 0 +#define TCG_TARGET_HAS_nor_i32 0 +#define TCG_TARGET_HAS_clz_i32 1 +#define TCG_TARGET_HAS_ctz_i32 use_armv7_instructions +#define TCG_TARGET_HAS_ctpop_i32 0 +#define TCG_TARGET_HAS_deposit_i32 use_armv7_instructions +#define TCG_TARGET_HAS_extract_i32 use_armv7_instructions +#define TCG_TARGET_HAS_sextract_i32 use_armv7_instructions +#define TCG_TARGET_HAS_extract2_i32 1 +#define TCG_TARGET_HAS_negsetcond_i32 1 +#define TCG_TARGET_HAS_mulu2_i32 1 +#define TCG_TARGET_HAS_muls2_i32 1 +#define TCG_TARGET_HAS_muluh_i32 0 +#define TCG_TARGET_HAS_mulsh_i32 0 +#define TCG_TARGET_HAS_div_i32 use_idiv_instructions +#define TCG_TARGET_HAS_rem_i32 0 +#define TCG_TARGET_HAS_qemu_st8_i32 0 + +#define TCG_TARGET_HAS_qemu_ldst_i128 0 + +#define TCG_TARGET_HAS_tst 1 + +#define TCG_TARGET_HAS_v64 use_neon_instructions +#define TCG_TARGET_HAS_v128 use_neon_instructions +#define TCG_TARGET_HAS_v256 0 + +#define TCG_TARGET_HAS_andc_vec 1 +#define TCG_TARGET_HAS_orc_vec 1 +#define TCG_TARGET_HAS_nand_vec 0 +#define TCG_TARGET_HAS_nor_vec 0 +#define TCG_TARGET_HAS_eqv_vec 0 +#define TCG_TARGET_HAS_not_vec 1 +#define TCG_TARGET_HAS_neg_vec 1 +#define TCG_TARGET_HAS_abs_vec 1 +#define TCG_TARGET_HAS_roti_vec 0 +#define TCG_TARGET_HAS_rots_vec 0 +#define TCG_TARGET_HAS_rotv_vec 0 +#define TCG_TARGET_HAS_shi_vec 1 +#define TCG_TARGET_HAS_shs_vec 0 +#define TCG_TARGET_HAS_shv_vec 0 +#define TCG_TARGET_HAS_mul_vec 1 +#define TCG_TARGET_HAS_sat_vec 1 +#define TCG_TARGET_HAS_minmax_vec 1 +#define TCG_TARGET_HAS_bitsel_vec 1 +#define TCG_TARGET_HAS_cmpsel_vec 0 +#define TCG_TARGET_HAS_tst_vec 1 + +#endif diff --git a/tcg/arm/tcg-target.h b/tcg/arm/tcg-target.h index 7f6e24f861..e114f7ddf4 100644 --- a/tcg/arm/tcg-target.h +++ b/tcg/arm/tcg-target.h @@ -26,10 +26,6 @@ #ifndef ARM_TCG_TARGET_H #define ARM_TCG_TARGET_H -extern int arm_arch; - -#define use_armv7_instructions (__ARM_ARCH >= 7 || arm_arch >= 7) - #define TCG_TARGET_INSN_UNIT_SIZE 4 #define MAX_CODE_GEN_BUFFER_SIZE UINT32_MAX @@ -74,75 +70,7 @@ typedef enum { #define TCG_TARGET_NB_REGS 32 -#ifdef __ARM_ARCH_EXT_IDIV__ -#define use_idiv_instructions 1 -#else -extern bool use_idiv_instructions; -#endif -#ifdef __ARM_NEON__ -#define use_neon_instructions 1 -#else -extern bool use_neon_instructions; -#endif - -/* optional instructions */ -#define TCG_TARGET_HAS_ext8s_i32 1 -#define TCG_TARGET_HAS_ext16s_i32 1 -#define TCG_TARGET_HAS_ext8u_i32 0 /* and r0, r1, #0xff */ -#define TCG_TARGET_HAS_ext16u_i32 1 -#define TCG_TARGET_HAS_bswap16_i32 1 -#define TCG_TARGET_HAS_bswap32_i32 1 -#define TCG_TARGET_HAS_not_i32 1 -#define TCG_TARGET_HAS_rot_i32 1 -#define TCG_TARGET_HAS_andc_i32 1 -#define TCG_TARGET_HAS_orc_i32 0 -#define TCG_TARGET_HAS_eqv_i32 0 -#define TCG_TARGET_HAS_nand_i32 0 -#define TCG_TARGET_HAS_nor_i32 0 -#define TCG_TARGET_HAS_clz_i32 1 -#define TCG_TARGET_HAS_ctz_i32 use_armv7_instructions -#define TCG_TARGET_HAS_ctpop_i32 0 -#define TCG_TARGET_HAS_deposit_i32 use_armv7_instructions -#define TCG_TARGET_HAS_extract_i32 use_armv7_instructions -#define TCG_TARGET_HAS_sextract_i32 use_armv7_instructions -#define TCG_TARGET_HAS_extract2_i32 1 -#define TCG_TARGET_HAS_negsetcond_i32 1 -#define TCG_TARGET_HAS_mulu2_i32 1 -#define TCG_TARGET_HAS_muls2_i32 1 -#define TCG_TARGET_HAS_muluh_i32 0 -#define TCG_TARGET_HAS_mulsh_i32 0 -#define TCG_TARGET_HAS_div_i32 use_idiv_instructions -#define TCG_TARGET_HAS_rem_i32 0 -#define TCG_TARGET_HAS_qemu_st8_i32 0 - -#define TCG_TARGET_HAS_qemu_ldst_i128 0 - -#define TCG_TARGET_HAS_tst 1 - -#define TCG_TARGET_HAS_v64 use_neon_instructions -#define TCG_TARGET_HAS_v128 use_neon_instructions -#define TCG_TARGET_HAS_v256 0 - -#define TCG_TARGET_HAS_andc_vec 1 -#define TCG_TARGET_HAS_orc_vec 1 -#define TCG_TARGET_HAS_nand_vec 0 -#define TCG_TARGET_HAS_nor_vec 0 -#define TCG_TARGET_HAS_eqv_vec 0 -#define TCG_TARGET_HAS_not_vec 1 -#define TCG_TARGET_HAS_neg_vec 1 -#define TCG_TARGET_HAS_abs_vec 1 -#define TCG_TARGET_HAS_roti_vec 0 -#define TCG_TARGET_HAS_rots_vec 0 -#define TCG_TARGET_HAS_rotv_vec 0 -#define TCG_TARGET_HAS_shi_vec 1 -#define TCG_TARGET_HAS_shs_vec 0 -#define TCG_TARGET_HAS_shv_vec 0 -#define TCG_TARGET_HAS_mul_vec 1 -#define TCG_TARGET_HAS_sat_vec 1 -#define TCG_TARGET_HAS_minmax_vec 1 -#define TCG_TARGET_HAS_bitsel_vec 1 -#define TCG_TARGET_HAS_cmpsel_vec 0 -#define TCG_TARGET_HAS_tst_vec 1 +#include "tcg-target-has.h" #define TCG_TARGET_DEFAULT_MO (0) From patchwork Fri Jan 17 18:24:11 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858258 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp844930wrb; Fri, 17 Jan 2025 10:33:09 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVLgiZg9UVftLNB9HKTEM594/veXak2crwPRy1zJR9UMjW3vvvpxtui6DirqkhhhipdppJtGg==@linaro.org X-Google-Smtp-Source: AGHT+IG6adLJzORT9DAHaGKtfwdt/zgiKjn7vnLohcbZEQrz7Mcxl6TcaT4coIR9vYSbyrlx9c8I X-Received: by 2002:ad4:5f09:0:b0:6d8:81cd:a0ce with SMTP id 6a1803df08f44-6e1b224c15amr64833146d6.43.1737138788900; Fri, 17 Jan 2025 10:33:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138788; cv=none; d=google.com; s=arc-20240605; b=CxECCDAkjkv3EAaxSY5v2q77OzHGZ/D8GLA7p6MKwoZX3Ci/I/EvBMkuLvs0MODaIa xZd42i7rQhUEzQWM4ZAFWSK9YPbUQu7rVGGrA/EO+oC6O56V8jgGgcXyDqCaPrl3Q83H 03BC4MWvoKwBXznZfPJq5TTmkOLN0DztM8YSKJzZX2XpDGwMqbkY4JcD9TLsqyfEFKXs uxP8uMwAGNNU+6ZziVk8Ci+h5bk2MqCBrqdYibiBn5tIcD93WYeiQfvtZSBDGHOT4wg7 zsHpAi0qVukN0+FfJ+aErcmCOMtKdRH40Vt2/9I4qbT/YK8RB3zhdZliqTakNhjuYCm1 SXMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=lE0h923NoKk15/QsPZdut8ARp6zLfAFkgoa9rjgCwZY=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=hN+NuX+MBi2j24XjfXzcdkv726aOI87zfX0Es2+y71aXNxbiYMNzR9hzEFBY9gGp2E WT4e6lPYgFTkd1OD3XFBBbsT7e9e4+JkPjcE3FKubMUDYxU8J/88EURRhc6XEVW2fi81 1f4Zto3pvSdR3BfPQlhYoVe2ZxGCTqe2Lmd7lnr92yODxStM8BQZ0fh7JFWkKFe3cEkt KczVrMBBKlUJ1Deam/RFTbqoVofrkd+MiRdY6vk5A8O6R8lVVMRhbkCeEXQvHCW3dYdY HfDHFTDcN2ZS6OYuSYGwjBmTA1c6UMnAg1VUx9RjKO3/GIQ+G878iGKFG8bTU7qiBegS 2vpA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oOj4Xhmk; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6e1afcf80b1si29713126d6.338.2025.01.17.10.33.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:33:08 -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=oOj4Xhmk; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr24-00048b-5w; Fri, 17 Jan 2025 13:25:24 -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 1tYr1y-000454-GZ for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:18 -0500 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr1w-0007sg-7L for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:18 -0500 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-21c2f1b610dso32616045ad.0 for ; Fri, 17 Jan 2025 10:25:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138315; x=1737743115; 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=lE0h923NoKk15/QsPZdut8ARp6zLfAFkgoa9rjgCwZY=; b=oOj4XhmkNBG0Fra/WOqarJYl8o4BIdaStaa8dMwSL1Uw6qpTwuE7Ni97vCwOU9vNya wMIUi6CyAemSvpp8EThc3h5WoGNC2MgbCaCs26YWZBsoV41FGCMtZ2xNRTQ10qP1CRYh BLgLMXMH/7us6Sg03aW/odTrOWLXzm8EpaLutfXBHkpnUA61WD64+OkSSVg00HluX/h6 NqK4F2nFt9wi2RV2qQny4vCshpqeh/AVUlQYNZtJjXNWH4htLbiut4RWxps+R0S8RvgQ NqkuvN6XkwasqgjYjk3DZRNV/D/GbfmDRALGJTvXCTHgeUxdFfVw4hMd2nHIay0ECSMN 2O3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138315; x=1737743115; 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=lE0h923NoKk15/QsPZdut8ARp6zLfAFkgoa9rjgCwZY=; b=bipZRKGG7m9CSbJzBk+suIsv/3PmpSGA54OKUDgZbzKv419x9p0o7FUClE5B+Evaws xeZ2m7HB1cOmj9RsRn+NWnobeijcDyZPVAatcdCZ70ho5csmUSf4hZQT+GWjIq2zGEhN gbpM8hm6DKWHaMWJUF5UzpDXA5DMqMr3FS+Xbd+V7trgos0hJTBRIrnhRsXFZqZMMdFd 3zSCcGC7kIyex5AdrDbIGG6HcWgo+QHm0gpe2zKzsUhvJUNIYynGdPcvMtgCzkkU/Vy6 DWra5GKZyn/nk6CRsjtIvp9/yQfoqN+5Wv5K9XjJsJplV3LC1jh+q2gSr8AMAgyB9tr+ TZZw== X-Gm-Message-State: AOJu0YyznSyrfquY5gjran3oiPIXqBnP26c5dYigrkSKnIXXyuuDa+0i 3fgF59OJAaBGHTIVqDuzEWjXLBTdNCAsZBnHF44nokDqc/MQxMRPrSi3uDkdNwYy/PI64371G31 A X-Gm-Gg: ASbGncvvJjaRphvBuThpqOiRP/2Sluhj77iZFN4fpvCUDl1tx3WNlZtG6IkUR6qRPTQ gX3hduRURzspqHK12+en3DtOotzRzV87d0tIviKfUVAgTIoLutno5BCSnA5QFzEeYfjRrnVOMBy v3FHPKzOwrvOH4sgCsguGkDYsVtgacSD62hUpwotB/43n9bcG1VgRe6YLVWZmkxFJE8f6QGw/5t hwVRNPfTHEGJWlRIzqyxhosST3SJDOtsZXEnU3hoNX8IWcCPHXzcQKB7/Ih0FHSEzNtuI1OF6/G QNJvToU0DVihcDw= X-Received: by 2002:a17:902:e810:b0:215:a412:4f12 with SMTP id d9443c01a7336-21c355bfa7cmr53360625ad.33.1737138314806; Fri, 17 Jan 2025 10:25:14 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21c2d3acccesm18879005ad.123.2025.01.17.10.25.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:25:14 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 23/68] tcg/i386: Extract TCG_TARGET_HAS_foo defs to 'tcg-target-has.h' Date: Fri, 17 Jan 2025 10:24:11 -0800 Message-ID: <20250117182456.2077110-24-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62b.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 Signed-off-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20250108215156.8731-6-philmd@linaro.org> --- tcg/i386/tcg-target-has.h | 139 ++++++++++++++++++++++++++++++++++++++ tcg/i386/tcg-target.h | 129 +---------------------------------- 2 files changed, 140 insertions(+), 128 deletions(-) create mode 100644 tcg/i386/tcg-target-has.h diff --git a/tcg/i386/tcg-target-has.h b/tcg/i386/tcg-target-has.h new file mode 100644 index 0000000000..3ea2eab807 --- /dev/null +++ b/tcg/i386/tcg-target-has.h @@ -0,0 +1,139 @@ +/* SPDX-License-Identifier: MIT */ +/* + * Define target-specific opcode support + * Copyright (c) 2008 Fabrice Bellard + */ + +#ifndef TCG_TARGET_HAS_H +#define TCG_TARGET_HAS_H + +#include "host/cpuinfo.h" + +#define have_bmi1 (cpuinfo & CPUINFO_BMI1) +#define have_popcnt (cpuinfo & CPUINFO_POPCNT) +#define have_avx1 (cpuinfo & CPUINFO_AVX1) +#define have_avx2 (cpuinfo & CPUINFO_AVX2) +#define have_movbe (cpuinfo & CPUINFO_MOVBE) + +/* + * There are interesting instructions in AVX512, so long as we have AVX512VL, + * which indicates support for EVEX on sizes smaller than 512 bits. + */ +#define have_avx512vl ((cpuinfo & CPUINFO_AVX512VL) && \ + (cpuinfo & CPUINFO_AVX512F)) +#define have_avx512bw ((cpuinfo & CPUINFO_AVX512BW) && have_avx512vl) +#define have_avx512dq ((cpuinfo & CPUINFO_AVX512DQ) && have_avx512vl) +#define have_avx512vbmi2 ((cpuinfo & CPUINFO_AVX512VBMI2) && have_avx512vl) + +/* optional instructions */ +#define TCG_TARGET_HAS_div2_i32 1 +#define TCG_TARGET_HAS_rot_i32 1 +#define TCG_TARGET_HAS_ext8s_i32 1 +#define TCG_TARGET_HAS_ext16s_i32 1 +#define TCG_TARGET_HAS_ext8u_i32 1 +#define TCG_TARGET_HAS_ext16u_i32 1 +#define TCG_TARGET_HAS_bswap16_i32 1 +#define TCG_TARGET_HAS_bswap32_i32 1 +#define TCG_TARGET_HAS_not_i32 1 +#define TCG_TARGET_HAS_andc_i32 have_bmi1 +#define TCG_TARGET_HAS_orc_i32 0 +#define TCG_TARGET_HAS_eqv_i32 0 +#define TCG_TARGET_HAS_nand_i32 0 +#define TCG_TARGET_HAS_nor_i32 0 +#define TCG_TARGET_HAS_clz_i32 1 +#define TCG_TARGET_HAS_ctz_i32 1 +#define TCG_TARGET_HAS_ctpop_i32 have_popcnt +#define TCG_TARGET_HAS_deposit_i32 1 +#define TCG_TARGET_HAS_extract_i32 1 +#define TCG_TARGET_HAS_sextract_i32 1 +#define TCG_TARGET_HAS_extract2_i32 1 +#define TCG_TARGET_HAS_negsetcond_i32 1 +#define TCG_TARGET_HAS_add2_i32 1 +#define TCG_TARGET_HAS_sub2_i32 1 +#define TCG_TARGET_HAS_mulu2_i32 1 +#define TCG_TARGET_HAS_muls2_i32 1 +#define TCG_TARGET_HAS_muluh_i32 0 +#define TCG_TARGET_HAS_mulsh_i32 0 + +#if TCG_TARGET_REG_BITS == 64 +/* Keep 32-bit values zero-extended in a register. */ +#define TCG_TARGET_HAS_extr_i64_i32 1 +#define TCG_TARGET_HAS_div2_i64 1 +#define TCG_TARGET_HAS_rot_i64 1 +#define TCG_TARGET_HAS_ext8s_i64 1 +#define TCG_TARGET_HAS_ext16s_i64 1 +#define TCG_TARGET_HAS_ext32s_i64 1 +#define TCG_TARGET_HAS_ext8u_i64 1 +#define TCG_TARGET_HAS_ext16u_i64 1 +#define TCG_TARGET_HAS_ext32u_i64 1 +#define TCG_TARGET_HAS_bswap16_i64 1 +#define TCG_TARGET_HAS_bswap32_i64 1 +#define TCG_TARGET_HAS_bswap64_i64 1 +#define TCG_TARGET_HAS_not_i64 1 +#define TCG_TARGET_HAS_andc_i64 have_bmi1 +#define TCG_TARGET_HAS_orc_i64 0 +#define TCG_TARGET_HAS_eqv_i64 0 +#define TCG_TARGET_HAS_nand_i64 0 +#define TCG_TARGET_HAS_nor_i64 0 +#define TCG_TARGET_HAS_clz_i64 1 +#define TCG_TARGET_HAS_ctz_i64 1 +#define TCG_TARGET_HAS_ctpop_i64 have_popcnt +#define TCG_TARGET_HAS_deposit_i64 1 +#define TCG_TARGET_HAS_extract_i64 1 +#define TCG_TARGET_HAS_sextract_i64 0 +#define TCG_TARGET_HAS_extract2_i64 1 +#define TCG_TARGET_HAS_negsetcond_i64 1 +#define TCG_TARGET_HAS_add2_i64 1 +#define TCG_TARGET_HAS_sub2_i64 1 +#define TCG_TARGET_HAS_mulu2_i64 1 +#define TCG_TARGET_HAS_muls2_i64 1 +#define TCG_TARGET_HAS_muluh_i64 0 +#define TCG_TARGET_HAS_mulsh_i64 0 +#define TCG_TARGET_HAS_qemu_st8_i32 0 +#else +#define TCG_TARGET_HAS_qemu_st8_i32 1 +#endif + +#define TCG_TARGET_HAS_qemu_ldst_i128 \ + (TCG_TARGET_REG_BITS == 64 && (cpuinfo & CPUINFO_ATOMIC_VMOVDQA)) + +#define TCG_TARGET_HAS_tst 1 + +/* We do not support older SSE systems, only beginning with AVX1. */ +#define TCG_TARGET_HAS_v64 have_avx1 +#define TCG_TARGET_HAS_v128 have_avx1 +#define TCG_TARGET_HAS_v256 have_avx2 + +#define TCG_TARGET_HAS_andc_vec 1 +#define TCG_TARGET_HAS_orc_vec have_avx512vl +#define TCG_TARGET_HAS_nand_vec have_avx512vl +#define TCG_TARGET_HAS_nor_vec have_avx512vl +#define TCG_TARGET_HAS_eqv_vec have_avx512vl +#define TCG_TARGET_HAS_not_vec have_avx512vl +#define TCG_TARGET_HAS_neg_vec 0 +#define TCG_TARGET_HAS_abs_vec 1 +#define TCG_TARGET_HAS_roti_vec have_avx512vl +#define TCG_TARGET_HAS_rots_vec 0 +#define TCG_TARGET_HAS_rotv_vec have_avx512vl +#define TCG_TARGET_HAS_shi_vec 1 +#define TCG_TARGET_HAS_shs_vec 1 +#define TCG_TARGET_HAS_shv_vec have_avx2 +#define TCG_TARGET_HAS_mul_vec 1 +#define TCG_TARGET_HAS_sat_vec 1 +#define TCG_TARGET_HAS_minmax_vec 1 +#define TCG_TARGET_HAS_bitsel_vec have_avx512vl +#define TCG_TARGET_HAS_cmpsel_vec 1 +#define TCG_TARGET_HAS_tst_vec have_avx512bw + +#define TCG_TARGET_deposit_i32_valid(ofs, len) \ + (((ofs) == 0 && ((len) == 8 || (len) == 16)) || \ + (TCG_TARGET_REG_BITS == 32 && (ofs) == 8 && (len) == 8)) +#define TCG_TARGET_deposit_i64_valid TCG_TARGET_deposit_i32_valid + +/* Check for the possibility of high-byte extraction and, for 64-bit, + zero-extending 32-bit right-shift. */ +#define TCG_TARGET_extract_i32_valid(ofs, len) ((ofs) == 8 && (len) == 8) +#define TCG_TARGET_extract_i64_valid(ofs, len) \ + (((ofs) == 8 && (len) == 8) || ((ofs) + (len)) == 32) + +#endif diff --git a/tcg/i386/tcg-target.h b/tcg/i386/tcg-target.h index 9961d8e757..a1dfdeb28d 100644 --- a/tcg/i386/tcg-target.h +++ b/tcg/i386/tcg-target.h @@ -25,8 +25,6 @@ #ifndef I386_TCG_TARGET_H #define I386_TCG_TARGET_H -#include "host/cpuinfo.h" - #define TCG_TARGET_INSN_UNIT_SIZE 1 #ifdef __x86_64__ @@ -90,132 +88,7 @@ typedef enum { TCG_REG_CALL_STACK = TCG_REG_ESP } TCGReg; -#define have_bmi1 (cpuinfo & CPUINFO_BMI1) -#define have_popcnt (cpuinfo & CPUINFO_POPCNT) -#define have_avx1 (cpuinfo & CPUINFO_AVX1) -#define have_avx2 (cpuinfo & CPUINFO_AVX2) -#define have_movbe (cpuinfo & CPUINFO_MOVBE) - -/* - * There are interesting instructions in AVX512, so long as we have AVX512VL, - * which indicates support for EVEX on sizes smaller than 512 bits. - */ -#define have_avx512vl ((cpuinfo & CPUINFO_AVX512VL) && \ - (cpuinfo & CPUINFO_AVX512F)) -#define have_avx512bw ((cpuinfo & CPUINFO_AVX512BW) && have_avx512vl) -#define have_avx512dq ((cpuinfo & CPUINFO_AVX512DQ) && have_avx512vl) -#define have_avx512vbmi2 ((cpuinfo & CPUINFO_AVX512VBMI2) && have_avx512vl) - -/* optional instructions */ -#define TCG_TARGET_HAS_div2_i32 1 -#define TCG_TARGET_HAS_rot_i32 1 -#define TCG_TARGET_HAS_ext8s_i32 1 -#define TCG_TARGET_HAS_ext16s_i32 1 -#define TCG_TARGET_HAS_ext8u_i32 1 -#define TCG_TARGET_HAS_ext16u_i32 1 -#define TCG_TARGET_HAS_bswap16_i32 1 -#define TCG_TARGET_HAS_bswap32_i32 1 -#define TCG_TARGET_HAS_not_i32 1 -#define TCG_TARGET_HAS_andc_i32 have_bmi1 -#define TCG_TARGET_HAS_orc_i32 0 -#define TCG_TARGET_HAS_eqv_i32 0 -#define TCG_TARGET_HAS_nand_i32 0 -#define TCG_TARGET_HAS_nor_i32 0 -#define TCG_TARGET_HAS_clz_i32 1 -#define TCG_TARGET_HAS_ctz_i32 1 -#define TCG_TARGET_HAS_ctpop_i32 have_popcnt -#define TCG_TARGET_HAS_deposit_i32 1 -#define TCG_TARGET_HAS_extract_i32 1 -#define TCG_TARGET_HAS_sextract_i32 1 -#define TCG_TARGET_HAS_extract2_i32 1 -#define TCG_TARGET_HAS_negsetcond_i32 1 -#define TCG_TARGET_HAS_add2_i32 1 -#define TCG_TARGET_HAS_sub2_i32 1 -#define TCG_TARGET_HAS_mulu2_i32 1 -#define TCG_TARGET_HAS_muls2_i32 1 -#define TCG_TARGET_HAS_muluh_i32 0 -#define TCG_TARGET_HAS_mulsh_i32 0 - -#if TCG_TARGET_REG_BITS == 64 -/* Keep 32-bit values zero-extended in a register. */ -#define TCG_TARGET_HAS_extr_i64_i32 1 -#define TCG_TARGET_HAS_div2_i64 1 -#define TCG_TARGET_HAS_rot_i64 1 -#define TCG_TARGET_HAS_ext8s_i64 1 -#define TCG_TARGET_HAS_ext16s_i64 1 -#define TCG_TARGET_HAS_ext32s_i64 1 -#define TCG_TARGET_HAS_ext8u_i64 1 -#define TCG_TARGET_HAS_ext16u_i64 1 -#define TCG_TARGET_HAS_ext32u_i64 1 -#define TCG_TARGET_HAS_bswap16_i64 1 -#define TCG_TARGET_HAS_bswap32_i64 1 -#define TCG_TARGET_HAS_bswap64_i64 1 -#define TCG_TARGET_HAS_not_i64 1 -#define TCG_TARGET_HAS_andc_i64 have_bmi1 -#define TCG_TARGET_HAS_orc_i64 0 -#define TCG_TARGET_HAS_eqv_i64 0 -#define TCG_TARGET_HAS_nand_i64 0 -#define TCG_TARGET_HAS_nor_i64 0 -#define TCG_TARGET_HAS_clz_i64 1 -#define TCG_TARGET_HAS_ctz_i64 1 -#define TCG_TARGET_HAS_ctpop_i64 have_popcnt -#define TCG_TARGET_HAS_deposit_i64 1 -#define TCG_TARGET_HAS_extract_i64 1 -#define TCG_TARGET_HAS_sextract_i64 0 -#define TCG_TARGET_HAS_extract2_i64 1 -#define TCG_TARGET_HAS_negsetcond_i64 1 -#define TCG_TARGET_HAS_add2_i64 1 -#define TCG_TARGET_HAS_sub2_i64 1 -#define TCG_TARGET_HAS_mulu2_i64 1 -#define TCG_TARGET_HAS_muls2_i64 1 -#define TCG_TARGET_HAS_muluh_i64 0 -#define TCG_TARGET_HAS_mulsh_i64 0 -#define TCG_TARGET_HAS_qemu_st8_i32 0 -#else -#define TCG_TARGET_HAS_qemu_st8_i32 1 -#endif - -#define TCG_TARGET_HAS_qemu_ldst_i128 \ - (TCG_TARGET_REG_BITS == 64 && (cpuinfo & CPUINFO_ATOMIC_VMOVDQA)) - -#define TCG_TARGET_HAS_tst 1 - -/* We do not support older SSE systems, only beginning with AVX1. */ -#define TCG_TARGET_HAS_v64 have_avx1 -#define TCG_TARGET_HAS_v128 have_avx1 -#define TCG_TARGET_HAS_v256 have_avx2 - -#define TCG_TARGET_HAS_andc_vec 1 -#define TCG_TARGET_HAS_orc_vec have_avx512vl -#define TCG_TARGET_HAS_nand_vec have_avx512vl -#define TCG_TARGET_HAS_nor_vec have_avx512vl -#define TCG_TARGET_HAS_eqv_vec have_avx512vl -#define TCG_TARGET_HAS_not_vec have_avx512vl -#define TCG_TARGET_HAS_neg_vec 0 -#define TCG_TARGET_HAS_abs_vec 1 -#define TCG_TARGET_HAS_roti_vec have_avx512vl -#define TCG_TARGET_HAS_rots_vec 0 -#define TCG_TARGET_HAS_rotv_vec have_avx512vl -#define TCG_TARGET_HAS_shi_vec 1 -#define TCG_TARGET_HAS_shs_vec 1 -#define TCG_TARGET_HAS_shv_vec have_avx2 -#define TCG_TARGET_HAS_mul_vec 1 -#define TCG_TARGET_HAS_sat_vec 1 -#define TCG_TARGET_HAS_minmax_vec 1 -#define TCG_TARGET_HAS_bitsel_vec have_avx512vl -#define TCG_TARGET_HAS_cmpsel_vec 1 -#define TCG_TARGET_HAS_tst_vec have_avx512bw - -#define TCG_TARGET_deposit_i32_valid(ofs, len) \ - (((ofs) == 0 && ((len) == 8 || (len) == 16)) || \ - (TCG_TARGET_REG_BITS == 32 && (ofs) == 8 && (len) == 8)) -#define TCG_TARGET_deposit_i64_valid TCG_TARGET_deposit_i32_valid - -/* Check for the possibility of high-byte extraction and, for 64-bit, - zero-extending 32-bit right-shift. */ -#define TCG_TARGET_extract_i32_valid(ofs, len) ((ofs) == 8 && (len) == 8) -#define TCG_TARGET_extract_i64_valid(ofs, len) \ - (((ofs) == 8 && (len) == 8) || ((ofs) + (len)) == 32) +#include "tcg-target-has.h" /* This defines the natural memory order supported by this * architecture before guarantees made by various barrier From patchwork Fri Jan 17 18:24:12 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858276 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp845742wrb; Fri, 17 Jan 2025 10:35:05 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXTWvZynOk6wnbXizK3cuo3bESrLX98Ji88Iq1YhbyzWtBXjxYClGqy4ykl5WUeybKAekzAIg==@linaro.org X-Google-Smtp-Source: AGHT+IE1yuEnbv2qK569/W278yYChlrRuPsm6XKCuWVWt0+x0fimCYZ/hHORAee0baEZFTq1TaC3 X-Received: by 2002:a05:6102:dcd:b0:4b6:20a5:8a11 with SMTP id ada2fe7eead31-4b690b5ece7mr3639691137.1.1737138905340; Fri, 17 Jan 2025 10:35:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138905; cv=none; d=google.com; s=arc-20240605; b=R5I4BsOWAZTTpjf6s6qnFegg1JfxXQJ4j8XJTo24v0B1iOrxIPqh1216VEkbaBk5Rf /yLyhEYkCQ//zh1+LOqs/zFwEU4PAQPNbEZ6NDIYzbw/WURIwztBZwJcuv6vdctqmNLB q1I6aVlt9BBZ1HlHXb6hx3MHmjvGsaQYMhklwf32vWcy8ulutDzJvGoG5/37AyeYJUxQ K4+gNUBcutfKNcU5Vy8M7n52AiCWSi2i2cgq3mYd4XrNSuhH3wlc9qPNQc8H813uFUg4 iaUXi6tOoLVgY9WyRDkzSN5lAt5OOusnQk1Y1yBjL30C0+qZTprgsEE9xC7U7zxWt2b8 6BmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=vOhLWXTIX7hwmqo2FLkpHqbxphxrnRJHI7dqF5jxuZ4=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=HQh9nPw4koENFo0JZ3ECZfd+F8FnmqyOvIgJs2pyKJoc/VHm3FsF0jzG23WhSMYOaP nqm77/i+J1MwRY7QhA0uc4lUrjJkVqAAX0uwavVFFFd6xxZOotHcjqE6LA3cZJ115lQg pphrn5LRLOZyt32Hnp2HjuWowJd3RE3VOIz8N0dmJmqDYvUN30ZTexIyWb8WBKAILs7q GHUmvmRb5OO7Q3JDA0R8s9xZvSEw3lGhkhdPpYAj8uGTooNv/GtzRbjykTskPS4tC817 50LLhKMd+NE4GA9QCg+79/u0P0NhcyRYNdfh3JqcC1WchkCD8jP3RhBg4b2c3B34tBqT 3d6Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nZ5hib0z; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id ada2fe7eead31-4b68a32063bsi1436809137.364.2025.01.17.10.35.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:35:05 -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=nZ5hib0z; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr24-00048r-Gm; Fri, 17 Jan 2025 13:25:24 -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 1tYr1z-00045v-Bm for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:19 -0500 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr1x-0007sq-8d for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:19 -0500 Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-21c2f1b610dso32616215ad.0 for ; Fri, 17 Jan 2025 10:25:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138316; x=1737743116; 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=vOhLWXTIX7hwmqo2FLkpHqbxphxrnRJHI7dqF5jxuZ4=; b=nZ5hib0zraZBf5LxWCYVxu974JGnlXizWoKf/LYR0o0mB9qsZvYZp8GOWDtIoX997v 02a5qr6SmI/rAxjlxV4JOpq/2M1aj+P+vXhs4bdRe/XIlFdReKHwLoyZkdW/5WiiT3Cb ASKgtu7wxMiN0/wzpNknRX3xn+APpBvnhZr4R5gmbrgWzq9o/8HHENqu1TJD/Eg03Q9X WC6oLqPgCb9vIUYmeJPWg2RrKTxnjy1/fbpUj33uIzbb7weDewsCHmbuPg0///TUIhTy 1tZR/r540bYKojXZLQfjjMv29bQOarBkcdAxD4KN/hxf92+RslPnPON2fGPU3j6ih9qA wCWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138316; x=1737743116; 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=vOhLWXTIX7hwmqo2FLkpHqbxphxrnRJHI7dqF5jxuZ4=; b=vGB+OLPn9cUErczJ543QE7TvI97QqquCxstX1UEjuatfpXMPn5YKCPEqPrsgNCMgaA tH1btq8Pz0/dmJiJm8CXBcD+0Aev2z9WyK1Sw8r386lFsbfnnQLcOpxdPW1vsCtyu1gW nMtuR/4VBQAIEMfZA3hwVBhf9JQxO77ovtYeJkqVHy9Kl1EXMETEXfIeoZTldAJ5CrPz SobvRX78d5Z2Z4mbltuwrGvMh/brP7BFIji/N2G3hdz7evN7ZVglc+1vqoQw4Y8tg/WA ZxfuBJzuDKMP8BOflhyLlomv9CKWpk1Pu7Y4rKuPI5yfJDW2LUc11WOoaI7qYoE5pVqn x+Cw== X-Gm-Message-State: AOJu0YwGUAbKw/jfW/86Mrb2HApSxTuE343QHpJYFsnoVd7czdlWbQwR pNYJQXRWbIW5VokAimj5DfpWvMBg2MW7Hg1GF6fP4JJl/nziV2egujPbcIOihCt7hJqaPfUW542 R X-Gm-Gg: ASbGncufEUz/tfG4KxOFb5Gc2tKuyYyFU/rmL0z19aVXTcyNwiTbBUWGXikO9iH3Sna 22EK5MGqDeScgkWGI3cR9xW8fljyZLnYCZyslH1FogfbNFr83cSdXI7G4SiR9OjhokbuG+sEILm dklQ4RlD+nl7cXiTK8uoGrspI4EkcC9sDac2z7xq50vV074zWvZEak10FdBG+fFLmmzzgnq9BL4 vkXRO1z6iQD+zUOrGwlOa4/ULqNgWUEe70msnKme3uKjdO3ywKto8yrKw5jsqAb3FTw+Oze55fM 4lMAX/3lbdZ8Boo= X-Received: by 2002:a17:902:d58e:b0:215:a57e:88e7 with SMTP id d9443c01a7336-21c352de0damr52789315ad.3.1737138315723; Fri, 17 Jan 2025 10:25:15 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21c2d3acccesm18879005ad.123.2025.01.17.10.25.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:25:15 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 24/68] tcg/loongarch64: Extract TCG_TARGET_HAS_foo defs to 'tcg-target-has.h' Date: Fri, 17 Jan 2025 10:24:12 -0800 Message-ID: <20250117182456.2077110-25-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::630; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x630.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 Signed-off-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20250108215156.8731-7-philmd@linaro.org> --- tcg/loongarch64/tcg-target-has.h | 113 +++++++++++++++++++++++++++++++ tcg/loongarch64/tcg-target.h | 102 +--------------------------- 2 files changed, 114 insertions(+), 101 deletions(-) create mode 100644 tcg/loongarch64/tcg-target-has.h diff --git a/tcg/loongarch64/tcg-target-has.h b/tcg/loongarch64/tcg-target-has.h new file mode 100644 index 0000000000..e4333c36c6 --- /dev/null +++ b/tcg/loongarch64/tcg-target-has.h @@ -0,0 +1,113 @@ +/* SPDX-License-Identifier: MIT */ +/* + * Define target-specific opcode support + * Copyright (c) 2021 WANG Xuerui + */ + +#ifndef TCG_TARGET_HAS_H +#define TCG_TARGET_HAS_H + +#include "host/cpuinfo.h" + +/* optional instructions */ +#define TCG_TARGET_HAS_negsetcond_i32 0 +#define TCG_TARGET_HAS_div_i32 1 +#define TCG_TARGET_HAS_rem_i32 1 +#define TCG_TARGET_HAS_div2_i32 0 +#define TCG_TARGET_HAS_rot_i32 1 +#define TCG_TARGET_HAS_deposit_i32 1 +#define TCG_TARGET_HAS_extract_i32 1 +#define TCG_TARGET_HAS_sextract_i32 0 +#define TCG_TARGET_HAS_extract2_i32 0 +#define TCG_TARGET_HAS_add2_i32 0 +#define TCG_TARGET_HAS_sub2_i32 0 +#define TCG_TARGET_HAS_mulu2_i32 0 +#define TCG_TARGET_HAS_muls2_i32 0 +#define TCG_TARGET_HAS_muluh_i32 1 +#define TCG_TARGET_HAS_mulsh_i32 1 +#define TCG_TARGET_HAS_ext8s_i32 1 +#define TCG_TARGET_HAS_ext16s_i32 1 +#define TCG_TARGET_HAS_ext8u_i32 1 +#define TCG_TARGET_HAS_ext16u_i32 1 +#define TCG_TARGET_HAS_bswap16_i32 1 +#define TCG_TARGET_HAS_bswap32_i32 1 +#define TCG_TARGET_HAS_not_i32 1 +#define TCG_TARGET_HAS_andc_i32 1 +#define TCG_TARGET_HAS_orc_i32 1 +#define TCG_TARGET_HAS_eqv_i32 0 +#define TCG_TARGET_HAS_nand_i32 0 +#define TCG_TARGET_HAS_nor_i32 1 +#define TCG_TARGET_HAS_clz_i32 1 +#define TCG_TARGET_HAS_ctz_i32 1 +#define TCG_TARGET_HAS_ctpop_i32 0 +#define TCG_TARGET_HAS_brcond2 0 +#define TCG_TARGET_HAS_setcond2 0 +#define TCG_TARGET_HAS_qemu_st8_i32 0 + +/* 64-bit operations */ +#define TCG_TARGET_HAS_negsetcond_i64 0 +#define TCG_TARGET_HAS_div_i64 1 +#define TCG_TARGET_HAS_rem_i64 1 +#define TCG_TARGET_HAS_div2_i64 0 +#define TCG_TARGET_HAS_rot_i64 1 +#define TCG_TARGET_HAS_deposit_i64 1 +#define TCG_TARGET_HAS_extract_i64 1 +#define TCG_TARGET_HAS_sextract_i64 0 +#define TCG_TARGET_HAS_extract2_i64 0 +#define TCG_TARGET_HAS_extr_i64_i32 1 +#define TCG_TARGET_HAS_ext8s_i64 1 +#define TCG_TARGET_HAS_ext16s_i64 1 +#define TCG_TARGET_HAS_ext32s_i64 1 +#define TCG_TARGET_HAS_ext8u_i64 1 +#define TCG_TARGET_HAS_ext16u_i64 1 +#define TCG_TARGET_HAS_ext32u_i64 1 +#define TCG_TARGET_HAS_bswap16_i64 1 +#define TCG_TARGET_HAS_bswap32_i64 1 +#define TCG_TARGET_HAS_bswap64_i64 1 +#define TCG_TARGET_HAS_not_i64 1 +#define TCG_TARGET_HAS_andc_i64 1 +#define TCG_TARGET_HAS_orc_i64 1 +#define TCG_TARGET_HAS_eqv_i64 0 +#define TCG_TARGET_HAS_nand_i64 0 +#define TCG_TARGET_HAS_nor_i64 1 +#define TCG_TARGET_HAS_clz_i64 1 +#define TCG_TARGET_HAS_ctz_i64 1 +#define TCG_TARGET_HAS_ctpop_i64 0 +#define TCG_TARGET_HAS_add2_i64 0 +#define TCG_TARGET_HAS_sub2_i64 0 +#define TCG_TARGET_HAS_mulu2_i64 0 +#define TCG_TARGET_HAS_muls2_i64 0 +#define TCG_TARGET_HAS_muluh_i64 1 +#define TCG_TARGET_HAS_mulsh_i64 1 + +#define TCG_TARGET_HAS_qemu_ldst_i128 (cpuinfo & CPUINFO_LSX) + +#define TCG_TARGET_HAS_tst 0 + +#define TCG_TARGET_HAS_v64 (cpuinfo & CPUINFO_LSX) +#define TCG_TARGET_HAS_v128 (cpuinfo & CPUINFO_LSX) +#define TCG_TARGET_HAS_v256 (cpuinfo & CPUINFO_LASX) + +#define TCG_TARGET_HAS_not_vec 1 +#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 +#define TCG_TARGET_HAS_nand_vec 0 +#define TCG_TARGET_HAS_nor_vec 1 +#define TCG_TARGET_HAS_eqv_vec 0 +#define TCG_TARGET_HAS_mul_vec 1 +#define TCG_TARGET_HAS_shi_vec 1 +#define TCG_TARGET_HAS_shs_vec 0 +#define TCG_TARGET_HAS_shv_vec 1 +#define TCG_TARGET_HAS_roti_vec 1 +#define TCG_TARGET_HAS_rots_vec 0 +#define TCG_TARGET_HAS_rotv_vec 1 +#define TCG_TARGET_HAS_sat_vec 1 +#define TCG_TARGET_HAS_minmax_vec 1 +#define TCG_TARGET_HAS_bitsel_vec 1 +#define TCG_TARGET_HAS_cmpsel_vec 0 +#define TCG_TARGET_HAS_tst_vec 0 + + +#endif diff --git a/tcg/loongarch64/tcg-target.h b/tcg/loongarch64/tcg-target.h index 3bc9aafaf2..a3a6130720 100644 --- a/tcg/loongarch64/tcg-target.h +++ b/tcg/loongarch64/tcg-target.h @@ -29,8 +29,6 @@ #ifndef LOONGARCH_TCG_TARGET_H #define LOONGARCH_TCG_TARGET_H -#include "host/cpuinfo.h" - #define TCG_TARGET_INSN_UNIT_SIZE 4 #define TCG_TARGET_NB_REGS 64 @@ -87,105 +85,7 @@ typedef enum { TCG_VEC_TMP0 = TCG_REG_V23, } TCGReg; -/* optional instructions */ -#define TCG_TARGET_HAS_negsetcond_i32 0 -#define TCG_TARGET_HAS_div_i32 1 -#define TCG_TARGET_HAS_rem_i32 1 -#define TCG_TARGET_HAS_div2_i32 0 -#define TCG_TARGET_HAS_rot_i32 1 -#define TCG_TARGET_HAS_deposit_i32 1 -#define TCG_TARGET_HAS_extract_i32 1 -#define TCG_TARGET_HAS_sextract_i32 0 -#define TCG_TARGET_HAS_extract2_i32 0 -#define TCG_TARGET_HAS_add2_i32 0 -#define TCG_TARGET_HAS_sub2_i32 0 -#define TCG_TARGET_HAS_mulu2_i32 0 -#define TCG_TARGET_HAS_muls2_i32 0 -#define TCG_TARGET_HAS_muluh_i32 1 -#define TCG_TARGET_HAS_mulsh_i32 1 -#define TCG_TARGET_HAS_ext8s_i32 1 -#define TCG_TARGET_HAS_ext16s_i32 1 -#define TCG_TARGET_HAS_ext8u_i32 1 -#define TCG_TARGET_HAS_ext16u_i32 1 -#define TCG_TARGET_HAS_bswap16_i32 1 -#define TCG_TARGET_HAS_bswap32_i32 1 -#define TCG_TARGET_HAS_not_i32 1 -#define TCG_TARGET_HAS_andc_i32 1 -#define TCG_TARGET_HAS_orc_i32 1 -#define TCG_TARGET_HAS_eqv_i32 0 -#define TCG_TARGET_HAS_nand_i32 0 -#define TCG_TARGET_HAS_nor_i32 1 -#define TCG_TARGET_HAS_clz_i32 1 -#define TCG_TARGET_HAS_ctz_i32 1 -#define TCG_TARGET_HAS_ctpop_i32 0 -#define TCG_TARGET_HAS_brcond2 0 -#define TCG_TARGET_HAS_setcond2 0 -#define TCG_TARGET_HAS_qemu_st8_i32 0 - -/* 64-bit operations */ -#define TCG_TARGET_HAS_negsetcond_i64 0 -#define TCG_TARGET_HAS_div_i64 1 -#define TCG_TARGET_HAS_rem_i64 1 -#define TCG_TARGET_HAS_div2_i64 0 -#define TCG_TARGET_HAS_rot_i64 1 -#define TCG_TARGET_HAS_deposit_i64 1 -#define TCG_TARGET_HAS_extract_i64 1 -#define TCG_TARGET_HAS_sextract_i64 0 -#define TCG_TARGET_HAS_extract2_i64 0 -#define TCG_TARGET_HAS_extr_i64_i32 1 -#define TCG_TARGET_HAS_ext8s_i64 1 -#define TCG_TARGET_HAS_ext16s_i64 1 -#define TCG_TARGET_HAS_ext32s_i64 1 -#define TCG_TARGET_HAS_ext8u_i64 1 -#define TCG_TARGET_HAS_ext16u_i64 1 -#define TCG_TARGET_HAS_ext32u_i64 1 -#define TCG_TARGET_HAS_bswap16_i64 1 -#define TCG_TARGET_HAS_bswap32_i64 1 -#define TCG_TARGET_HAS_bswap64_i64 1 -#define TCG_TARGET_HAS_not_i64 1 -#define TCG_TARGET_HAS_andc_i64 1 -#define TCG_TARGET_HAS_orc_i64 1 -#define TCG_TARGET_HAS_eqv_i64 0 -#define TCG_TARGET_HAS_nand_i64 0 -#define TCG_TARGET_HAS_nor_i64 1 -#define TCG_TARGET_HAS_clz_i64 1 -#define TCG_TARGET_HAS_ctz_i64 1 -#define TCG_TARGET_HAS_ctpop_i64 0 -#define TCG_TARGET_HAS_add2_i64 0 -#define TCG_TARGET_HAS_sub2_i64 0 -#define TCG_TARGET_HAS_mulu2_i64 0 -#define TCG_TARGET_HAS_muls2_i64 0 -#define TCG_TARGET_HAS_muluh_i64 1 -#define TCG_TARGET_HAS_mulsh_i64 1 - -#define TCG_TARGET_HAS_qemu_ldst_i128 (cpuinfo & CPUINFO_LSX) - -#define TCG_TARGET_HAS_tst 0 - -#define TCG_TARGET_HAS_v64 (cpuinfo & CPUINFO_LSX) -#define TCG_TARGET_HAS_v128 (cpuinfo & CPUINFO_LSX) -#define TCG_TARGET_HAS_v256 (cpuinfo & CPUINFO_LASX) - -#define TCG_TARGET_HAS_not_vec 1 -#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 -#define TCG_TARGET_HAS_nand_vec 0 -#define TCG_TARGET_HAS_nor_vec 1 -#define TCG_TARGET_HAS_eqv_vec 0 -#define TCG_TARGET_HAS_mul_vec 1 -#define TCG_TARGET_HAS_shi_vec 1 -#define TCG_TARGET_HAS_shs_vec 0 -#define TCG_TARGET_HAS_shv_vec 1 -#define TCG_TARGET_HAS_roti_vec 1 -#define TCG_TARGET_HAS_rots_vec 0 -#define TCG_TARGET_HAS_rotv_vec 1 -#define TCG_TARGET_HAS_sat_vec 1 -#define TCG_TARGET_HAS_minmax_vec 1 -#define TCG_TARGET_HAS_bitsel_vec 1 -#define TCG_TARGET_HAS_cmpsel_vec 0 -#define TCG_TARGET_HAS_tst_vec 0 +#include "tcg-target-has.h" #define TCG_TARGET_DEFAULT_MO (0) From patchwork Fri Jan 17 18:24:13 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858267 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp845263wrb; Fri, 17 Jan 2025 10:33:54 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXMOtR97oa+kmt2lNvcWGCwS8x0zW+4xyn6G7hJHb9ACWaRXuGLbdt7IzAroE4UwKGrgMniIg==@linaro.org X-Google-Smtp-Source: AGHT+IGNVPT4hwuyO1lr8Ql2fFUU7M5iFhIOJDkUf8LQP5VLQAScPTRpXB1UmqRi53KYKnaAmO5d X-Received: by 2002:a05:6102:6c7:b0:4b6:8e5d:4bfd with SMTP id ada2fe7eead31-4b690cc968emr3834550137.22.1737138834727; Fri, 17 Jan 2025 10:33:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138834; cv=none; d=google.com; s=arc-20240605; b=WVGMHv38+yR2AR1ePQ/7NVHu5DKnR2HHvHyA4rM97bO2PUsfZ1qTKtVFKqWmiGpCvc nqyKo4NdNuDaFNPY9FUqSZ5kDSqat7r8Hm3HUbRjDv1waYrZ6LCEWxnPS8+To114qXYJ RRZ6yy8Ik6f3CFSoVXaKmmyYpM5ea6DIzW34zUBF9PLkgsyeqOV4DOAwzLQB9E9JHBJa 7OJf3Qdbw7QOfhKm0zZ5JodeS7ojEqNmbV4GpIqe4ZEjf/BYFl6aLXzPUeQgeMEB4K4V 1DbIe6tQEsdGMzoJFdcPxZus5zOZHUEks6KaJvp34WKWt4E4Ctcz0/XO+dsGPWiE2MIE AGFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=9tRgoyvnnwIMvgwZ53Tf5jvPHSFGXWCXDFVkQ4d9r+w=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=lbwiAPvDBpQ4wS8muRfN9i92zJRLRBkr+1sOE+qloqoK3cjF8SEDSpL7+EzPGRg6k1 XAS3fgIaRZs5BLCkvPJavUBAE3rjdA1JxLO9JusOktkSNpnLA9mgSu9qZBhBngunaCH3 3SIueR+lxrEvY3tQJ3A5CYt2ppLM/OnHtzMw/9ZTZw03JujmV1y3ZCA0bG6NGQBC1YhI kaZ25LAwFfKENaoYqaIXjkm4lSjv08DPq+JFZR3jp8K6+/ZyU+PaSXoQwu61hhlje/B3 pbifyFDJLoLXFs6cvFSMAl2finVmRIes6sjGiEgHh1uK+HTVyLnU31vZma+1vSvy/LBo gNmA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WDvwlQJe; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id a1e0cc1a2514c-8642cd0f0aesi1113445241.187.2025.01.17.10.33.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:33:54 -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=WDvwlQJe; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr24-00048c-5r; Fri, 17 Jan 2025 13:25:24 -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 1tYr21-000478-1M for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:21 -0500 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr1y-0007sz-R0 for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:20 -0500 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-2166f1e589cso61672665ad.3 for ; Fri, 17 Jan 2025 10:25:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138316; x=1737743116; 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=9tRgoyvnnwIMvgwZ53Tf5jvPHSFGXWCXDFVkQ4d9r+w=; b=WDvwlQJe3Tn6yN3hghlp5jT/srHetJIsr/pcmD0rMEEwNpbYoAuxqpUUmMvv1nzY8H 8Y6hp7XY+vXqNd5M+y5uyNHYVfioSgsLm00Wj1Kiq4zsmNar3N7LzHh/HfxHjjCpoaWZ R4vZlgSkkNCJ5D8YVtHy4U/G9OZhPsDs43gWo63Ur8X1MrZt6elsSI+Tk+9O/u0B5uRQ d2wjGOlT5mimzvI7tvNJOFsL0dkDNmut4JBIiBueKch42V4qKo34sm2XiyrMwbUjfvD0 4BVeRK5ZJaOlpVyoFmYW3fVik49s1hS5xJ6JHXxhwbvGxuqTVbMdhdLt2XUzqgh+PQZf 0LfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138316; x=1737743116; 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=9tRgoyvnnwIMvgwZ53Tf5jvPHSFGXWCXDFVkQ4d9r+w=; b=PAn11VdvqLcworKZVQTkfJYi7vCjX2h08Nf6uqFyllRqF4Mfy+JAS2T2GripShtbD6 STP4G6Xzm3XedFCHpF7I5yNuXxmpVhS3AUDA5uedChwLqW7RUHoRaE70+fwdVGMeqsdI v0yWCvGbliwpy/+6v+rH7UPTu/27GH2KZYXzKl9ZgQAv3Hq9o4sU3SCB5Tx3OVIaDGhO P55OiOpzY9U4pQv0glnHw9gYRMq1HryIKHDvbVrn357LDgtY3HSgHbZwXYlQCvd1jLct T4ItDgqexNEH0PLHRKsURldBY0BxMCx52LVvBoyFwQbtIV57wRtvQ2xaLPWjX2rp7Iqc cP+w== X-Gm-Message-State: AOJu0YyQIkUv4xMivS0L9jdoFRNAK/5j9kIfEuIhVTn4csJhRaEBg3aR NImdFvN5/WIqEgBc49b5sfYbtPDXcJI0rCqhgv5bixW8J64DnJi+/p8IRdb6iD2sFwK8sFymDtG V X-Gm-Gg: ASbGncsemHE043PSeyM+2apoGlbEfDlJGYYL6A8Fx1wF2NbLwbT/i0+FZ4UazDmL5XA 6GVDMmKgcgduEEo+jLyV7+mQV8OqCQ1ER1EmbpEiU2C5fZZPG62VbOEmYSCjY03xpH6Lqyu4BEu guJnWsIaWOJ/qMdY910Lt1VBH4o3l6bF0E5OKJN0EI6t1T3P0rqxNLDDdB4/yy+h/DZMxGMGRxA blW4viiCYk0vrJddmSRD1So0BDyxtmRuRDHZpuGTmZCkKZ+iF1PSdVm/smvfT+NmvtZ/I+ri3ZA Gnnyljc1/7zVOMs= X-Received: by 2002:a17:902:e948:b0:215:6f9b:e447 with SMTP id d9443c01a7336-21c35621db7mr49816845ad.30.1737138316396; Fri, 17 Jan 2025 10:25:16 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21c2d3acccesm18879005ad.123.2025.01.17.10.25.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:25:16 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 25/68] tcg/mips: Extract TCG_TARGET_HAS_foo defs to 'tcg-target-has.h' Date: Fri, 17 Jan 2025 10:24:13 -0800 Message-ID: <20250117182456.2077110-26-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62d; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62d.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 Signed-off-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20250108215156.8731-8-philmd@linaro.org> --- tcg/mips/tcg-target-has.h | 122 ++++++++++++++++++++++++++++++++++++++ tcg/mips/tcg-target.h | 112 +--------------------------------- 2 files changed, 123 insertions(+), 111 deletions(-) create mode 100644 tcg/mips/tcg-target-has.h diff --git a/tcg/mips/tcg-target-has.h b/tcg/mips/tcg-target-has.h new file mode 100644 index 0000000000..5dbc63cef6 --- /dev/null +++ b/tcg/mips/tcg-target-has.h @@ -0,0 +1,122 @@ +/* SPDX-License-Identifier: MIT */ +/* + * Define target-specific opcode support + * Copyright (c) 2008-2009 Arnaud Patard + * Copyright (c) 2009 Aurelien Jarno + */ + +#ifndef TCG_TARGET_HAS_H +#define TCG_TARGET_HAS_H + +/* MOVN/MOVZ instructions detection */ +#if (defined(__mips_isa_rev) && (__mips_isa_rev >= 1)) || \ + defined(_MIPS_ARCH_LOONGSON2E) || defined(_MIPS_ARCH_LOONGSON2F) || \ + defined(_MIPS_ARCH_MIPS4) +#define use_movnz_instructions 1 +#else +extern bool use_movnz_instructions; +#endif + +/* MIPS32 instruction set detection */ +#if defined(__mips_isa_rev) && (__mips_isa_rev >= 1) +#define use_mips32_instructions 1 +#else +extern bool use_mips32_instructions; +#endif + +/* MIPS32R2 instruction set detection */ +#if defined(__mips_isa_rev) && (__mips_isa_rev >= 2) +#define use_mips32r2_instructions 1 +#else +extern bool use_mips32r2_instructions; +#endif + +/* MIPS32R6 instruction set detection */ +#if defined(__mips_isa_rev) && (__mips_isa_rev >= 6) +#define use_mips32r6_instructions 1 +#else +#define use_mips32r6_instructions 0 +#endif + +/* optional instructions */ +#define TCG_TARGET_HAS_div_i32 1 +#define TCG_TARGET_HAS_rem_i32 1 +#define TCG_TARGET_HAS_not_i32 1 +#define TCG_TARGET_HAS_nor_i32 1 +#define TCG_TARGET_HAS_andc_i32 0 +#define TCG_TARGET_HAS_orc_i32 0 +#define TCG_TARGET_HAS_eqv_i32 0 +#define TCG_TARGET_HAS_nand_i32 0 +#define TCG_TARGET_HAS_mulu2_i32 (!use_mips32r6_instructions) +#define TCG_TARGET_HAS_muls2_i32 (!use_mips32r6_instructions) +#define TCG_TARGET_HAS_muluh_i32 1 +#define TCG_TARGET_HAS_mulsh_i32 1 +#define TCG_TARGET_HAS_bswap32_i32 1 +#define TCG_TARGET_HAS_negsetcond_i32 0 + +#if TCG_TARGET_REG_BITS == 64 +#define TCG_TARGET_HAS_add2_i32 0 +#define TCG_TARGET_HAS_sub2_i32 0 +#define TCG_TARGET_HAS_extr_i64_i32 1 +#define TCG_TARGET_HAS_div_i64 1 +#define TCG_TARGET_HAS_rem_i64 1 +#define TCG_TARGET_HAS_not_i64 1 +#define TCG_TARGET_HAS_nor_i64 1 +#define TCG_TARGET_HAS_andc_i64 0 +#define TCG_TARGET_HAS_orc_i64 0 +#define TCG_TARGET_HAS_eqv_i64 0 +#define TCG_TARGET_HAS_nand_i64 0 +#define TCG_TARGET_HAS_add2_i64 0 +#define TCG_TARGET_HAS_sub2_i64 0 +#define TCG_TARGET_HAS_mulu2_i64 (!use_mips32r6_instructions) +#define TCG_TARGET_HAS_muls2_i64 (!use_mips32r6_instructions) +#define TCG_TARGET_HAS_muluh_i64 1 +#define TCG_TARGET_HAS_mulsh_i64 1 +#define TCG_TARGET_HAS_ext32s_i64 1 +#define TCG_TARGET_HAS_ext32u_i64 1 +#define TCG_TARGET_HAS_negsetcond_i64 0 +#endif + +/* optional instructions detected at runtime */ +#define TCG_TARGET_HAS_bswap16_i32 use_mips32r2_instructions +#define TCG_TARGET_HAS_deposit_i32 use_mips32r2_instructions +#define TCG_TARGET_HAS_extract_i32 use_mips32r2_instructions +#define TCG_TARGET_HAS_sextract_i32 0 +#define TCG_TARGET_HAS_extract2_i32 0 +#define TCG_TARGET_HAS_ext8s_i32 use_mips32r2_instructions +#define TCG_TARGET_HAS_ext16s_i32 use_mips32r2_instructions +#define TCG_TARGET_HAS_rot_i32 use_mips32r2_instructions +#define TCG_TARGET_HAS_clz_i32 use_mips32r2_instructions +#define TCG_TARGET_HAS_ctz_i32 0 +#define TCG_TARGET_HAS_ctpop_i32 0 +#define TCG_TARGET_HAS_qemu_st8_i32 0 + +#if TCG_TARGET_REG_BITS == 64 +#define TCG_TARGET_HAS_bswap16_i64 use_mips32r2_instructions +#define TCG_TARGET_HAS_bswap32_i64 use_mips32r2_instructions +#define TCG_TARGET_HAS_bswap64_i64 use_mips32r2_instructions +#define TCG_TARGET_HAS_deposit_i64 use_mips32r2_instructions +#define TCG_TARGET_HAS_extract_i64 use_mips32r2_instructions +#define TCG_TARGET_HAS_sextract_i64 0 +#define TCG_TARGET_HAS_extract2_i64 0 +#define TCG_TARGET_HAS_ext8s_i64 use_mips32r2_instructions +#define TCG_TARGET_HAS_ext16s_i64 use_mips32r2_instructions +#define TCG_TARGET_HAS_rot_i64 use_mips32r2_instructions +#define TCG_TARGET_HAS_clz_i64 use_mips32r2_instructions +#define TCG_TARGET_HAS_ctz_i64 0 +#define TCG_TARGET_HAS_ctpop_i64 0 +#endif + +/* optional instructions automatically implemented */ +#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_ext8u_i64 0 /* andi rt, rs, 0xff */ +#define TCG_TARGET_HAS_ext16u_i64 0 /* andi rt, rs, 0xffff */ +#endif + +#define TCG_TARGET_HAS_qemu_ldst_i128 0 +#define TCG_TARGET_HAS_tst 0 + +#endif diff --git a/tcg/mips/tcg-target.h b/tcg/mips/tcg-target.h index db60eb7c1b..a34765b389 100644 --- a/tcg/mips/tcg-target.h +++ b/tcg/mips/tcg-target.h @@ -70,117 +70,7 @@ typedef enum { TCG_AREG0 = TCG_REG_S8, } TCGReg; -/* MOVN/MOVZ instructions detection */ -#if (defined(__mips_isa_rev) && (__mips_isa_rev >= 1)) || \ - defined(_MIPS_ARCH_LOONGSON2E) || defined(_MIPS_ARCH_LOONGSON2F) || \ - defined(_MIPS_ARCH_MIPS4) -#define use_movnz_instructions 1 -#else -extern bool use_movnz_instructions; -#endif - -/* MIPS32 instruction set detection */ -#if defined(__mips_isa_rev) && (__mips_isa_rev >= 1) -#define use_mips32_instructions 1 -#else -extern bool use_mips32_instructions; -#endif - -/* MIPS32R2 instruction set detection */ -#if defined(__mips_isa_rev) && (__mips_isa_rev >= 2) -#define use_mips32r2_instructions 1 -#else -extern bool use_mips32r2_instructions; -#endif - -/* MIPS32R6 instruction set detection */ -#if defined(__mips_isa_rev) && (__mips_isa_rev >= 6) -#define use_mips32r6_instructions 1 -#else -#define use_mips32r6_instructions 0 -#endif - -/* optional instructions */ -#define TCG_TARGET_HAS_div_i32 1 -#define TCG_TARGET_HAS_rem_i32 1 -#define TCG_TARGET_HAS_not_i32 1 -#define TCG_TARGET_HAS_nor_i32 1 -#define TCG_TARGET_HAS_andc_i32 0 -#define TCG_TARGET_HAS_orc_i32 0 -#define TCG_TARGET_HAS_eqv_i32 0 -#define TCG_TARGET_HAS_nand_i32 0 -#define TCG_TARGET_HAS_mulu2_i32 (!use_mips32r6_instructions) -#define TCG_TARGET_HAS_muls2_i32 (!use_mips32r6_instructions) -#define TCG_TARGET_HAS_muluh_i32 1 -#define TCG_TARGET_HAS_mulsh_i32 1 -#define TCG_TARGET_HAS_bswap32_i32 1 -#define TCG_TARGET_HAS_negsetcond_i32 0 - -#if TCG_TARGET_REG_BITS == 64 -#define TCG_TARGET_HAS_add2_i32 0 -#define TCG_TARGET_HAS_sub2_i32 0 -#define TCG_TARGET_HAS_extr_i64_i32 1 -#define TCG_TARGET_HAS_div_i64 1 -#define TCG_TARGET_HAS_rem_i64 1 -#define TCG_TARGET_HAS_not_i64 1 -#define TCG_TARGET_HAS_nor_i64 1 -#define TCG_TARGET_HAS_andc_i64 0 -#define TCG_TARGET_HAS_orc_i64 0 -#define TCG_TARGET_HAS_eqv_i64 0 -#define TCG_TARGET_HAS_nand_i64 0 -#define TCG_TARGET_HAS_add2_i64 0 -#define TCG_TARGET_HAS_sub2_i64 0 -#define TCG_TARGET_HAS_mulu2_i64 (!use_mips32r6_instructions) -#define TCG_TARGET_HAS_muls2_i64 (!use_mips32r6_instructions) -#define TCG_TARGET_HAS_muluh_i64 1 -#define TCG_TARGET_HAS_mulsh_i64 1 -#define TCG_TARGET_HAS_ext32s_i64 1 -#define TCG_TARGET_HAS_ext32u_i64 1 -#define TCG_TARGET_HAS_negsetcond_i64 0 -#endif - -/* optional instructions detected at runtime */ -#define TCG_TARGET_HAS_bswap16_i32 use_mips32r2_instructions -#define TCG_TARGET_HAS_deposit_i32 use_mips32r2_instructions -#define TCG_TARGET_HAS_extract_i32 use_mips32r2_instructions -#define TCG_TARGET_HAS_sextract_i32 0 -#define TCG_TARGET_HAS_extract2_i32 0 -#define TCG_TARGET_HAS_ext8s_i32 use_mips32r2_instructions -#define TCG_TARGET_HAS_ext16s_i32 use_mips32r2_instructions -#define TCG_TARGET_HAS_rot_i32 use_mips32r2_instructions -#define TCG_TARGET_HAS_clz_i32 use_mips32r2_instructions -#define TCG_TARGET_HAS_ctz_i32 0 -#define TCG_TARGET_HAS_ctpop_i32 0 -#define TCG_TARGET_HAS_qemu_st8_i32 0 - -#if TCG_TARGET_REG_BITS == 64 -#define TCG_TARGET_HAS_bswap16_i64 use_mips32r2_instructions -#define TCG_TARGET_HAS_bswap32_i64 use_mips32r2_instructions -#define TCG_TARGET_HAS_bswap64_i64 use_mips32r2_instructions -#define TCG_TARGET_HAS_deposit_i64 use_mips32r2_instructions -#define TCG_TARGET_HAS_extract_i64 use_mips32r2_instructions -#define TCG_TARGET_HAS_sextract_i64 0 -#define TCG_TARGET_HAS_extract2_i64 0 -#define TCG_TARGET_HAS_ext8s_i64 use_mips32r2_instructions -#define TCG_TARGET_HAS_ext16s_i64 use_mips32r2_instructions -#define TCG_TARGET_HAS_rot_i64 use_mips32r2_instructions -#define TCG_TARGET_HAS_clz_i64 use_mips32r2_instructions -#define TCG_TARGET_HAS_ctz_i64 0 -#define TCG_TARGET_HAS_ctpop_i64 0 -#endif - -/* optional instructions automatically implemented */ -#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_ext8u_i64 0 /* andi rt, rs, 0xff */ -#define TCG_TARGET_HAS_ext16u_i64 0 /* andi rt, rs, 0xffff */ -#endif - -#define TCG_TARGET_HAS_qemu_ldst_i128 0 - -#define TCG_TARGET_HAS_tst 0 +#include "tcg-target-has.h" #define TCG_TARGET_DEFAULT_MO 0 From patchwork Fri Jan 17 18:24:14 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858211 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp841791wrb; Fri, 17 Jan 2025 10:25:57 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWsLLoYdPecA7LGYMCe6MJduodlqvXVxJ1uXW+5olH2YXc9VKSh+ClpHx29sEGxU3NkUpmiTA==@linaro.org X-Google-Smtp-Source: AGHT+IGEuI0yI7dnZn1Rk5urMnOAx9Xi3LIL++fTTdlyoVwyhRZ3AGG6g5eadousjVMrbViaoxbX X-Received: by 2002:ac8:7fd6:0:b0:467:451b:eba3 with SMTP id d75a77b69052e-46e12a0d91dmr49737181cf.8.1737138357317; Fri, 17 Jan 2025 10:25:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138357; cv=none; d=google.com; s=arc-20240605; b=CyXCroGkYYMo3v7F03SFESfc+rabXnPoINk3Vs6WLxuo3oKvyiKA2OWJsEHhwlcEF7 xFWex2pIm6UMDYZdR3WAO26nLP1Q/DfGfs3PtNQqfYytAUMQIUFC8b3Z8rKsDxO00ZNF nQXdG3tBTK4lKjzRs4PLO+nUo/L6MO/eBgTl0bMl94NPRZ5o3qPgYbKSqwiVM7W3qwxv L75TZ13fP6zhyWfjwXzWSEo0X4jz5+pl56ss3CTG+2ABWurr4mWdqPG3vk3h98obTCE5 r5O4lkWkb2x5tnsHfwZ575X8ucZ6LC6EkSto3fAoLH15istuW5CaQCkcTQ7I5k6LBdte ZgtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=CuOvg1jVhP+07SLN4scRA4LJALOhPD2+nRCuijOhumU=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=A51F8AGN/vwp2LUVty/M/z4eysYDxVXKcEDxd39BTQFB5kbiehL6d2WpTD2glmx65G VsVkk7Ea/+eg7lwd6Wq+Zvpf1P8mmFQFrDNz6jUpDN9OeD3xaQLkq5UuDuJEe/t0pk8i iuD2rN1dLdsZsu/OTXPa5K2ZrsyYmW1LATr1riBv2Si6Wj1KucUvxmBRvQMDS9MebkFs Lay8nPE3D/DBbS05FQFpXl0kDe6ml9iJ8B1Pqn+gFFS1dkGh78iOmG9teohq2n8qRMnq zEyeydUnCKfWrJ2G4HiE7qD8Y6Ngp+lG2/xSDbWUny7N6/QfINYV/vtoA7kzcg6Eug1+ T3mA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nk7NtPV2; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46e10307143si28918551cf.182.2025.01.17.10.25.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:25:57 -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=nk7NtPV2; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr27-0004AD-RY; Fri, 17 Jan 2025 13:25:27 -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 1tYr21-000477-1A for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:21 -0500 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr1y-0007tM-RD for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:20 -0500 Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-21654fdd5daso44791515ad.1 for ; Fri, 17 Jan 2025 10:25:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138317; x=1737743117; 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=CuOvg1jVhP+07SLN4scRA4LJALOhPD2+nRCuijOhumU=; b=nk7NtPV28JoxB9VwpS2EAF5nbVVJZpOWVbDNhDpq5VZKCyUb4GWq+BAkL+2o9s3NmX pKwmY3zJ0imqYQ73fZ8sgWfUnBcrm9xp73s5a1JSwVZ7gBJ+tOWS4J0ML9sZj/iv1E3U 7bNGE8xcGMjy5MCOYAxdv/r50PooB3iS9dK3Km3kgn0tPHGYHqjd2unmm9KcNLpnR12i jq51dm9JU/rFJ2gYLPIRDMp2P42Hb29TNEWpto9cNxpNG5URmU6GaUIdsg/37AQ0jIj3 87ac0vG89RPAfEHLVBrwl1Le6PkdOE+mRtUunzxa5e4giYIVvwQI22vZoK0d7uNqDysf JaJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138317; x=1737743117; 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=CuOvg1jVhP+07SLN4scRA4LJALOhPD2+nRCuijOhumU=; b=Mi4SlODsdpj/1nLSll0Gyox3frjheU5SH93IierfBjl2wDQC6rSF5xPBzKbhV1Gapw /lV4cgXuoSyP+fHzGPYKP9u/knQUJ6kfnXXWkAXTdP1RgBYQ220NGFrs3Z265YmOrpKa d++qMBAciz6gCT6rwnuzm6C90CKYMqGN02KjR42Q5QEmKJuxqUi6MtNbuCmIE7GonsOK qa6Bp4hlemxEVlfN/rt4KfV4WBGOca+Giaspm9PoDt984uHGp996Q8OiZbt3z/kRlSKC aKSPg6mkDYwvU2PADM+emQ+zS62enxYajdhTJKSBIa6nnRDZ4yqidzOx+0hJvIzgqTxL ESIg== X-Gm-Message-State: AOJu0Yy7SYhbCn9j98FahSFF8VqDSTqG/z/Fuh4Cx40Jl2L7NyWKaAW4 hQuMY0KDU+J+PitFDOE7oDGT3YfpEyH1j0EUR2zwJ/ErUIaZyNJZPzdPaLMtmxpZkksLiiFd8MJ 7 X-Gm-Gg: ASbGncvrI7IIEdyAVXP5+XhPMqrEARtasbYfjTu5vugVMxcasgQXaGWhKH9whj1kkfE NZDHB9cwdmaPLWlL5wXelv/YO98qKLhq8ofsuBCgxQRgr3mF3B2EOov8PJbZ+a9Kzm5xDB0vcI1 cJJDXTfUwyU9FdUm9b/9bUBqYsrTqgJoAPfyoi1NN4n5fNkfPi0bQ1JB5VoJrICKRGBOAOZ6myh /Saaq2gY/KaQTCe266f35LE3W844UrQgZ8EVazSJ1vjLTb782kdPKsctmUpSlxN6JjP6ygPlOjS RXycwgNe/N2VVus= X-Received: by 2002:a17:902:db10:b0:215:a2e2:53fe with SMTP id d9443c01a7336-21c355c7a3dmr58489785ad.40.1737138317161; Fri, 17 Jan 2025 10:25:17 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21c2d3acccesm18879005ad.123.2025.01.17.10.25.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:25:16 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 26/68] tcg/ppc: Extract TCG_TARGET_HAS_foo defs to 'tcg-target-has.h' Date: Fri, 17 Jan 2025 10:24:14 -0800 Message-ID: <20250117182456.2077110-27-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::630; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x630.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 Signed-off-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20250108215156.8731-9-philmd@linaro.org> --- tcg/ppc/tcg-target-has.h | 124 +++++++++++++++++++++++++++++++++++++++ tcg/ppc/tcg-target.h | 114 +---------------------------------- 2 files changed, 125 insertions(+), 113 deletions(-) create mode 100644 tcg/ppc/tcg-target-has.h diff --git a/tcg/ppc/tcg-target-has.h b/tcg/ppc/tcg-target-has.h new file mode 100644 index 0000000000..a6c7cdba5d --- /dev/null +++ b/tcg/ppc/tcg-target-has.h @@ -0,0 +1,124 @@ +/* SPDX-License-Identifier: MIT */ +/* + * Define target-specific opcode support + * Copyright (c) 2008 Fabrice Bellard + */ + +#ifndef TCG_TARGET_HAS_H +#define TCG_TARGET_HAS_H + +#include "host/cpuinfo.h" + +#define have_isa_2_06 (cpuinfo & CPUINFO_V2_06) +#define have_isa_2_07 (cpuinfo & CPUINFO_V2_07) +#define have_isa_3_00 (cpuinfo & CPUINFO_V3_0) +#define have_isa_3_10 (cpuinfo & CPUINFO_V3_1) +#define have_altivec (cpuinfo & CPUINFO_ALTIVEC) +#define have_vsx (cpuinfo & CPUINFO_VSX) + +/* optional instructions automatically implemented */ +#define TCG_TARGET_HAS_ext8u_i32 0 /* andi */ +#define TCG_TARGET_HAS_ext16u_i32 0 + +/* optional instructions */ +#define TCG_TARGET_HAS_div_i32 1 +#define TCG_TARGET_HAS_rem_i32 have_isa_3_00 +#define TCG_TARGET_HAS_rot_i32 1 +#define TCG_TARGET_HAS_ext8s_i32 1 +#define TCG_TARGET_HAS_ext16s_i32 1 +#define TCG_TARGET_HAS_bswap16_i32 1 +#define TCG_TARGET_HAS_bswap32_i32 1 +#define TCG_TARGET_HAS_not_i32 1 +#define TCG_TARGET_HAS_andc_i32 1 +#define TCG_TARGET_HAS_orc_i32 1 +#define TCG_TARGET_HAS_eqv_i32 1 +#define TCG_TARGET_HAS_nand_i32 1 +#define TCG_TARGET_HAS_nor_i32 1 +#define TCG_TARGET_HAS_clz_i32 1 +#define TCG_TARGET_HAS_ctz_i32 have_isa_3_00 +#define TCG_TARGET_HAS_ctpop_i32 have_isa_2_06 +#define TCG_TARGET_HAS_deposit_i32 1 +#define TCG_TARGET_HAS_extract_i32 1 +#define TCG_TARGET_HAS_sextract_i32 0 +#define TCG_TARGET_HAS_extract2_i32 0 +#define TCG_TARGET_HAS_negsetcond_i32 1 +#define TCG_TARGET_HAS_mulu2_i32 0 +#define TCG_TARGET_HAS_muls2_i32 0 +#define TCG_TARGET_HAS_muluh_i32 1 +#define TCG_TARGET_HAS_mulsh_i32 1 +#define TCG_TARGET_HAS_qemu_st8_i32 0 + +#if TCG_TARGET_REG_BITS == 64 +#define TCG_TARGET_HAS_add2_i32 0 +#define TCG_TARGET_HAS_sub2_i32 0 +#define TCG_TARGET_HAS_extr_i64_i32 0 +#define TCG_TARGET_HAS_div_i64 1 +#define TCG_TARGET_HAS_rem_i64 have_isa_3_00 +#define TCG_TARGET_HAS_rot_i64 1 +#define TCG_TARGET_HAS_ext8s_i64 1 +#define TCG_TARGET_HAS_ext16s_i64 1 +#define TCG_TARGET_HAS_ext32s_i64 1 +#define TCG_TARGET_HAS_ext8u_i64 0 +#define TCG_TARGET_HAS_ext16u_i64 0 +#define TCG_TARGET_HAS_ext32u_i64 0 +#define TCG_TARGET_HAS_bswap16_i64 1 +#define TCG_TARGET_HAS_bswap32_i64 1 +#define TCG_TARGET_HAS_bswap64_i64 1 +#define TCG_TARGET_HAS_not_i64 1 +#define TCG_TARGET_HAS_andc_i64 1 +#define TCG_TARGET_HAS_orc_i64 1 +#define TCG_TARGET_HAS_eqv_i64 1 +#define TCG_TARGET_HAS_nand_i64 1 +#define TCG_TARGET_HAS_nor_i64 1 +#define TCG_TARGET_HAS_clz_i64 1 +#define TCG_TARGET_HAS_ctz_i64 have_isa_3_00 +#define TCG_TARGET_HAS_ctpop_i64 have_isa_2_06 +#define TCG_TARGET_HAS_deposit_i64 1 +#define TCG_TARGET_HAS_extract_i64 1 +#define TCG_TARGET_HAS_sextract_i64 0 +#define TCG_TARGET_HAS_extract2_i64 0 +#define TCG_TARGET_HAS_negsetcond_i64 1 +#define TCG_TARGET_HAS_add2_i64 1 +#define TCG_TARGET_HAS_sub2_i64 1 +#define TCG_TARGET_HAS_mulu2_i64 0 +#define TCG_TARGET_HAS_muls2_i64 0 +#define TCG_TARGET_HAS_muluh_i64 1 +#define TCG_TARGET_HAS_mulsh_i64 1 +#endif + +#define TCG_TARGET_HAS_qemu_ldst_i128 \ + (TCG_TARGET_REG_BITS == 64 && have_isa_2_07) + +#define TCG_TARGET_HAS_tst 1 + +/* + * While technically Altivec could support V64, it has no 64-bit store + * instruction and substituting two 32-bit stores makes the generated + * code quite large. + */ +#define TCG_TARGET_HAS_v64 have_vsx +#define TCG_TARGET_HAS_v128 have_altivec +#define TCG_TARGET_HAS_v256 0 + +#define TCG_TARGET_HAS_andc_vec 1 +#define TCG_TARGET_HAS_orc_vec have_isa_2_07 +#define TCG_TARGET_HAS_nand_vec have_isa_2_07 +#define TCG_TARGET_HAS_nor_vec 1 +#define TCG_TARGET_HAS_eqv_vec have_isa_2_07 +#define TCG_TARGET_HAS_not_vec 1 +#define TCG_TARGET_HAS_neg_vec have_isa_3_00 +#define TCG_TARGET_HAS_abs_vec 0 +#define TCG_TARGET_HAS_roti_vec 0 +#define TCG_TARGET_HAS_rots_vec 0 +#define TCG_TARGET_HAS_rotv_vec 1 +#define TCG_TARGET_HAS_shi_vec 0 +#define TCG_TARGET_HAS_shs_vec 0 +#define TCG_TARGET_HAS_shv_vec 1 +#define TCG_TARGET_HAS_mul_vec 1 +#define TCG_TARGET_HAS_sat_vec 1 +#define TCG_TARGET_HAS_minmax_vec 1 +#define TCG_TARGET_HAS_bitsel_vec have_vsx +#define TCG_TARGET_HAS_cmpsel_vec 1 +#define TCG_TARGET_HAS_tst_vec 0 + +#endif diff --git a/tcg/ppc/tcg-target.h b/tcg/ppc/tcg-target.h index 4fa4a30de4..fa2cc28183 100644 --- a/tcg/ppc/tcg-target.h +++ b/tcg/ppc/tcg-target.h @@ -25,8 +25,6 @@ #ifndef PPC_TCG_TARGET_H #define PPC_TCG_TARGET_H -#include "host/cpuinfo.h" - #define MAX_CODE_GEN_BUFFER_SIZE ((size_t)-1) #define TCG_TARGET_NB_REGS 64 @@ -55,117 +53,7 @@ typedef enum { TCG_AREG0 = TCG_REG_R27 } TCGReg; -#define have_isa_2_06 (cpuinfo & CPUINFO_V2_06) -#define have_isa_2_07 (cpuinfo & CPUINFO_V2_07) -#define have_isa_3_00 (cpuinfo & CPUINFO_V3_0) -#define have_isa_3_10 (cpuinfo & CPUINFO_V3_1) -#define have_altivec (cpuinfo & CPUINFO_ALTIVEC) -#define have_vsx (cpuinfo & CPUINFO_VSX) - -/* optional instructions automatically implemented */ -#define TCG_TARGET_HAS_ext8u_i32 0 /* andi */ -#define TCG_TARGET_HAS_ext16u_i32 0 - -/* optional instructions */ -#define TCG_TARGET_HAS_div_i32 1 -#define TCG_TARGET_HAS_rem_i32 have_isa_3_00 -#define TCG_TARGET_HAS_rot_i32 1 -#define TCG_TARGET_HAS_ext8s_i32 1 -#define TCG_TARGET_HAS_ext16s_i32 1 -#define TCG_TARGET_HAS_bswap16_i32 1 -#define TCG_TARGET_HAS_bswap32_i32 1 -#define TCG_TARGET_HAS_not_i32 1 -#define TCG_TARGET_HAS_andc_i32 1 -#define TCG_TARGET_HAS_orc_i32 1 -#define TCG_TARGET_HAS_eqv_i32 1 -#define TCG_TARGET_HAS_nand_i32 1 -#define TCG_TARGET_HAS_nor_i32 1 -#define TCG_TARGET_HAS_clz_i32 1 -#define TCG_TARGET_HAS_ctz_i32 have_isa_3_00 -#define TCG_TARGET_HAS_ctpop_i32 have_isa_2_06 -#define TCG_TARGET_HAS_deposit_i32 1 -#define TCG_TARGET_HAS_extract_i32 1 -#define TCG_TARGET_HAS_sextract_i32 0 -#define TCG_TARGET_HAS_extract2_i32 0 -#define TCG_TARGET_HAS_negsetcond_i32 1 -#define TCG_TARGET_HAS_mulu2_i32 0 -#define TCG_TARGET_HAS_muls2_i32 0 -#define TCG_TARGET_HAS_muluh_i32 1 -#define TCG_TARGET_HAS_mulsh_i32 1 -#define TCG_TARGET_HAS_qemu_st8_i32 0 - -#if TCG_TARGET_REG_BITS == 64 -#define TCG_TARGET_HAS_add2_i32 0 -#define TCG_TARGET_HAS_sub2_i32 0 -#define TCG_TARGET_HAS_extr_i64_i32 0 -#define TCG_TARGET_HAS_div_i64 1 -#define TCG_TARGET_HAS_rem_i64 have_isa_3_00 -#define TCG_TARGET_HAS_rot_i64 1 -#define TCG_TARGET_HAS_ext8s_i64 1 -#define TCG_TARGET_HAS_ext16s_i64 1 -#define TCG_TARGET_HAS_ext32s_i64 1 -#define TCG_TARGET_HAS_ext8u_i64 0 -#define TCG_TARGET_HAS_ext16u_i64 0 -#define TCG_TARGET_HAS_ext32u_i64 0 -#define TCG_TARGET_HAS_bswap16_i64 1 -#define TCG_TARGET_HAS_bswap32_i64 1 -#define TCG_TARGET_HAS_bswap64_i64 1 -#define TCG_TARGET_HAS_not_i64 1 -#define TCG_TARGET_HAS_andc_i64 1 -#define TCG_TARGET_HAS_orc_i64 1 -#define TCG_TARGET_HAS_eqv_i64 1 -#define TCG_TARGET_HAS_nand_i64 1 -#define TCG_TARGET_HAS_nor_i64 1 -#define TCG_TARGET_HAS_clz_i64 1 -#define TCG_TARGET_HAS_ctz_i64 have_isa_3_00 -#define TCG_TARGET_HAS_ctpop_i64 have_isa_2_06 -#define TCG_TARGET_HAS_deposit_i64 1 -#define TCG_TARGET_HAS_extract_i64 1 -#define TCG_TARGET_HAS_sextract_i64 0 -#define TCG_TARGET_HAS_extract2_i64 0 -#define TCG_TARGET_HAS_negsetcond_i64 1 -#define TCG_TARGET_HAS_add2_i64 1 -#define TCG_TARGET_HAS_sub2_i64 1 -#define TCG_TARGET_HAS_mulu2_i64 0 -#define TCG_TARGET_HAS_muls2_i64 0 -#define TCG_TARGET_HAS_muluh_i64 1 -#define TCG_TARGET_HAS_mulsh_i64 1 -#endif - -#define TCG_TARGET_HAS_qemu_ldst_i128 \ - (TCG_TARGET_REG_BITS == 64 && have_isa_2_07) - -#define TCG_TARGET_HAS_tst 1 - -/* - * While technically Altivec could support V64, it has no 64-bit store - * instruction and substituting two 32-bit stores makes the generated - * code quite large. - */ -#define TCG_TARGET_HAS_v64 have_vsx -#define TCG_TARGET_HAS_v128 have_altivec -#define TCG_TARGET_HAS_v256 0 - -#define TCG_TARGET_HAS_andc_vec 1 -#define TCG_TARGET_HAS_orc_vec have_isa_2_07 -#define TCG_TARGET_HAS_nand_vec have_isa_2_07 -#define TCG_TARGET_HAS_nor_vec 1 -#define TCG_TARGET_HAS_eqv_vec have_isa_2_07 -#define TCG_TARGET_HAS_not_vec 1 -#define TCG_TARGET_HAS_neg_vec have_isa_3_00 -#define TCG_TARGET_HAS_abs_vec 0 -#define TCG_TARGET_HAS_roti_vec 0 -#define TCG_TARGET_HAS_rots_vec 0 -#define TCG_TARGET_HAS_rotv_vec 1 -#define TCG_TARGET_HAS_shi_vec 0 -#define TCG_TARGET_HAS_shs_vec 0 -#define TCG_TARGET_HAS_shv_vec 1 -#define TCG_TARGET_HAS_mul_vec 1 -#define TCG_TARGET_HAS_sat_vec 1 -#define TCG_TARGET_HAS_minmax_vec 1 -#define TCG_TARGET_HAS_bitsel_vec have_vsx -#define TCG_TARGET_HAS_cmpsel_vec 1 -#define TCG_TARGET_HAS_tst_vec 0 +#include "tcg-target-has.h" #define TCG_TARGET_DEFAULT_MO (0) From patchwork Fri Jan 17 18:24:15 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858226 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp843001wrb; Fri, 17 Jan 2025 10:29:00 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVAPwxk30G7XSa1wCso1K9338u/+4MzppW9nzqc6mMplLIK8WOAeG0IJHZ6/kHaOEFbqTw5Mw==@linaro.org X-Google-Smtp-Source: AGHT+IHdmxtal8lHuTHPKhtnAMrD+xk0x1pLKrE3rsr7dJHFmar4sWtYn/XJZIHSm6F091ozcb+P X-Received: by 2002:ac8:5a93:0:b0:463:5cd7:ddd3 with SMTP id d75a77b69052e-46e12a0c12emr66670591cf.11.1737138540627; Fri, 17 Jan 2025 10:29:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138540; cv=none; d=google.com; s=arc-20240605; b=WO5OG0vrzI0zwx8yvKFnJf2LAwRkETeABZcBx1R4VZdTi+08OZu6hqGuyq3PTpEaW5 NMMsl7se+E8KKxEDIT1wpFCVi78s4zk7IWe9K60mUB7AaCMMLAf1G29Sv+nvpu+HZORp L8wp5RYMqQn0wh+9XvTNUweyMruSUE3nCS/Cb6A2gXpiZdcIQ9iXM2sUbqpKo+Elk0Ln BYkquTGuBh/R2ClW8m/PImwpnWZBt/M3HS5GMqWr4CJ/EVmMXMrB0x2Yrc429aJJXSgs M7kA0fzxUXZ9Q05B9a41aY9e72m00F1VmB6aiZXiMKiyx7E27ww0eeT0y+Ov178gKscQ DP+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=sA/doJH7ZeGKUSnoaEUxqrEsxSQmwTH08mJ/bqHWmSc=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=gN5GbVhk6YgavaJGImJ1xEGRLXtEIAR5rtkclltGu8FOwF4+tuP8YybMQQzTcXqZ/E rPmMETmtTHWi0Ky/FO+F0JlK9GqSzP5ILfdEfRYWA2yaOMTjxJ3hhYyLFzTXzGCf6ka6 s2FXnNPZGpp8uJsdUOB7WuGsZPRbzHJfpZqNEwng3Te/Iw5gw3N60XCDbdZmKyu4pR7K MyDvX9/rddZmrthR2T93KJRURo0IRPWUW8cjp8tGBRRGQG6D9kNrPhv4fF9TL6ndAbOg nlqz6fMj0D1dlsA1y0OO7ehSLmFtlSSdpdMaAyAr2fBZuYlj+Qq27EnHIVD1pdDzqwfg zMpQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BUKMBeLW; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46e1048ad90si29286591cf.518.2025.01.17.10.29.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:29:00 -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=BUKMBeLW; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr2C-0004Ao-Md; Fri, 17 Jan 2025 13:25:32 -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 1tYr22-00047z-S0 for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:22 -0500 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr20-0007tY-5d for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:22 -0500 Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-21bc1512a63so49515445ad.1 for ; Fri, 17 Jan 2025 10:25:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138318; x=1737743118; 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=sA/doJH7ZeGKUSnoaEUxqrEsxSQmwTH08mJ/bqHWmSc=; b=BUKMBeLWYRkAN+8jQwJMZ1810BZDRlk+HWOdAWW8hGhrz79bGTxT+WEf1x34Q2JUq6 dB2WLIUEGCe0y7MpgcvJjZwKl6ZGNN86r7sEi/O1c1n+/JS8rcM4h2B2Do3Gpf5nij17 mB29nBzweIWRMEyV7AUCFnZhmr6LvIR6FIHKSswytCDuKMhcb7VGD3N7zlOTr8nlPml9 cmTB/6+7dTsmWDrqOFpHUklDSPYyATqlauvQG7lXqFW1y7TH6vxwBi3zSFG7W9xgbXKp 7yGK8/mqNAchj7u1oFchGeTq/k9XV6fm3IHqbdoAZMmlLqw3XEX9LsONteJsHCIFVDt/ yx0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138318; x=1737743118; 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=sA/doJH7ZeGKUSnoaEUxqrEsxSQmwTH08mJ/bqHWmSc=; b=T37bjvg+TzVtyJV1PQb/iygEmsQhoFEhocH6rOXZrQvmS9oHlyD/5Zm3NW+uxsMq3r fJB21KasHKhqCZjVaYpFcebcTu9Dm4dPOszcgv+BV4wL0yiYRwQ6XyKZsZulo7bi3DVw trPt1PQvJnqBkQiF0pxZnChnAxtJ1zvpH+JC3N6PhE9Q/1tWn9HFysfV8pFWfTxc5CEm NooQKHeTszx+bKUL0PEhKav2Mt6qOmLL0S71vgw/KqxBWEd77SCu47MhR1Cmhw26/xWL 6xoLeGcCKJ8SCUlgurkTTWXQLChv01YBfS79O4Pa9LCS96U6tPckNsa945AQafddPIzJ BFHw== X-Gm-Message-State: AOJu0YzvzzecsJwqsZM8oxgSJwqFsw4TjCuyMliXLTOaFvDbCB0BObGw kHP+Dsn79h8VfeWns7N/x660m4fDt0BOXjVgPlEPIs5fmPknaSrrPkhH0Zood9d6/yq2TwmFQmk 9 X-Gm-Gg: ASbGncunimRpx0eiOBifVeiABH12R8hgfYFwvQg0yXbxazhfpQDBOEPOuAjT/GIgyBN 2FnIcw1kRt7kYfEVDaQ9ZDDn0AgFe0Ye+QMk+nyL+tb6AELE9u8P59j7DyB6O1jufxcYJY2wwYU JVGYfkpuaNxp4LkVOsdUwNpqrgFYmuTmHxhAX2IF5Oag8UwIAJHhxrz5SPygXllVSq8/8kch2Il NT2mCA8A0LITWxXvovAW5AB2XBCjpUQMAcNRVvwcfnsP4j2D9CRG77hql++B3jLo74T00EFCn17 yQCn6iXNVGc4eIw= X-Received: by 2002:a17:903:32cf:b0:216:5af7:5a8e with SMTP id d9443c01a7336-21c355ec9c0mr55276985ad.26.1737138318206; Fri, 17 Jan 2025 10:25:18 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21c2d3acccesm18879005ad.123.2025.01.17.10.25.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:25:17 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 27/68] tcg/riscv: Extract TCG_TARGET_HAS_foo defs to 'tcg-target-has.h' Date: Fri, 17 Jan 2025 10:24:15 -0800 Message-ID: <20250117182456.2077110-28-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::633; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x633.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 Signed-off-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20250108215156.8731-10-philmd@linaro.org> --- tcg/riscv/tcg-target-has.h | 112 +++++++++++++++++++++++++++++++++++++ tcg/riscv/tcg-target.h | 102 +-------------------------------- 2 files changed, 113 insertions(+), 101 deletions(-) create mode 100644 tcg/riscv/tcg-target-has.h diff --git a/tcg/riscv/tcg-target-has.h b/tcg/riscv/tcg-target-has.h new file mode 100644 index 0000000000..ddc759a533 --- /dev/null +++ b/tcg/riscv/tcg-target-has.h @@ -0,0 +1,112 @@ +/* SPDX-License-Identifier: MIT */ +/* + * Define target-specific opcode support + * Copyright (c) 2018 SiFive, Inc + */ + +#ifndef TCG_TARGET_HAS_H +#define TCG_TARGET_HAS_H + +#include "host/cpuinfo.h" + +/* optional instructions */ +#define TCG_TARGET_HAS_negsetcond_i32 1 +#define TCG_TARGET_HAS_div_i32 1 +#define TCG_TARGET_HAS_rem_i32 1 +#define TCG_TARGET_HAS_div2_i32 0 +#define TCG_TARGET_HAS_rot_i32 (cpuinfo & CPUINFO_ZBB) +#define TCG_TARGET_HAS_deposit_i32 0 +#define TCG_TARGET_HAS_extract_i32 0 +#define TCG_TARGET_HAS_sextract_i32 0 +#define TCG_TARGET_HAS_extract2_i32 0 +#define TCG_TARGET_HAS_add2_i32 1 +#define TCG_TARGET_HAS_sub2_i32 1 +#define TCG_TARGET_HAS_mulu2_i32 0 +#define TCG_TARGET_HAS_muls2_i32 0 +#define TCG_TARGET_HAS_muluh_i32 0 +#define TCG_TARGET_HAS_mulsh_i32 0 +#define TCG_TARGET_HAS_ext8s_i32 1 +#define TCG_TARGET_HAS_ext16s_i32 1 +#define TCG_TARGET_HAS_ext8u_i32 1 +#define TCG_TARGET_HAS_ext16u_i32 1 +#define TCG_TARGET_HAS_bswap16_i32 (cpuinfo & CPUINFO_ZBB) +#define TCG_TARGET_HAS_bswap32_i32 (cpuinfo & CPUINFO_ZBB) +#define TCG_TARGET_HAS_not_i32 1 +#define TCG_TARGET_HAS_andc_i32 (cpuinfo & CPUINFO_ZBB) +#define TCG_TARGET_HAS_orc_i32 (cpuinfo & CPUINFO_ZBB) +#define TCG_TARGET_HAS_eqv_i32 (cpuinfo & CPUINFO_ZBB) +#define TCG_TARGET_HAS_nand_i32 0 +#define TCG_TARGET_HAS_nor_i32 0 +#define TCG_TARGET_HAS_clz_i32 (cpuinfo & CPUINFO_ZBB) +#define TCG_TARGET_HAS_ctz_i32 (cpuinfo & CPUINFO_ZBB) +#define TCG_TARGET_HAS_ctpop_i32 (cpuinfo & CPUINFO_ZBB) +#define TCG_TARGET_HAS_brcond2 1 +#define TCG_TARGET_HAS_setcond2 1 +#define TCG_TARGET_HAS_qemu_st8_i32 0 + +#define TCG_TARGET_HAS_negsetcond_i64 1 +#define TCG_TARGET_HAS_div_i64 1 +#define TCG_TARGET_HAS_rem_i64 1 +#define TCG_TARGET_HAS_div2_i64 0 +#define TCG_TARGET_HAS_rot_i64 (cpuinfo & CPUINFO_ZBB) +#define TCG_TARGET_HAS_deposit_i64 0 +#define TCG_TARGET_HAS_extract_i64 0 +#define TCG_TARGET_HAS_sextract_i64 0 +#define TCG_TARGET_HAS_extract2_i64 0 +#define TCG_TARGET_HAS_extr_i64_i32 1 +#define TCG_TARGET_HAS_ext8s_i64 1 +#define TCG_TARGET_HAS_ext16s_i64 1 +#define TCG_TARGET_HAS_ext32s_i64 1 +#define TCG_TARGET_HAS_ext8u_i64 1 +#define TCG_TARGET_HAS_ext16u_i64 1 +#define TCG_TARGET_HAS_ext32u_i64 1 +#define TCG_TARGET_HAS_bswap16_i64 (cpuinfo & CPUINFO_ZBB) +#define TCG_TARGET_HAS_bswap32_i64 (cpuinfo & CPUINFO_ZBB) +#define TCG_TARGET_HAS_bswap64_i64 (cpuinfo & CPUINFO_ZBB) +#define TCG_TARGET_HAS_not_i64 1 +#define TCG_TARGET_HAS_andc_i64 (cpuinfo & CPUINFO_ZBB) +#define TCG_TARGET_HAS_orc_i64 (cpuinfo & CPUINFO_ZBB) +#define TCG_TARGET_HAS_eqv_i64 (cpuinfo & CPUINFO_ZBB) +#define TCG_TARGET_HAS_nand_i64 0 +#define TCG_TARGET_HAS_nor_i64 0 +#define TCG_TARGET_HAS_clz_i64 (cpuinfo & CPUINFO_ZBB) +#define TCG_TARGET_HAS_ctz_i64 (cpuinfo & CPUINFO_ZBB) +#define TCG_TARGET_HAS_ctpop_i64 (cpuinfo & CPUINFO_ZBB) +#define TCG_TARGET_HAS_add2_i64 1 +#define TCG_TARGET_HAS_sub2_i64 1 +#define TCG_TARGET_HAS_mulu2_i64 0 +#define TCG_TARGET_HAS_muls2_i64 0 +#define TCG_TARGET_HAS_muluh_i64 1 +#define TCG_TARGET_HAS_mulsh_i64 1 + +#define TCG_TARGET_HAS_qemu_ldst_i128 0 + +#define TCG_TARGET_HAS_tst 0 + +/* vector instructions */ +#define TCG_TARGET_HAS_v64 (cpuinfo & CPUINFO_ZVE64X) +#define TCG_TARGET_HAS_v128 (cpuinfo & CPUINFO_ZVE64X) +#define TCG_TARGET_HAS_v256 (cpuinfo & CPUINFO_ZVE64X) +#define TCG_TARGET_HAS_andc_vec 0 +#define TCG_TARGET_HAS_orc_vec 0 +#define TCG_TARGET_HAS_nand_vec 0 +#define TCG_TARGET_HAS_nor_vec 0 +#define TCG_TARGET_HAS_eqv_vec 0 +#define TCG_TARGET_HAS_not_vec 1 +#define TCG_TARGET_HAS_neg_vec 1 +#define TCG_TARGET_HAS_abs_vec 0 +#define TCG_TARGET_HAS_roti_vec 1 +#define TCG_TARGET_HAS_rots_vec 1 +#define TCG_TARGET_HAS_rotv_vec 1 +#define TCG_TARGET_HAS_shi_vec 1 +#define TCG_TARGET_HAS_shs_vec 1 +#define TCG_TARGET_HAS_shv_vec 1 +#define TCG_TARGET_HAS_mul_vec 1 +#define TCG_TARGET_HAS_sat_vec 1 +#define TCG_TARGET_HAS_minmax_vec 1 +#define TCG_TARGET_HAS_bitsel_vec 0 +#define TCG_TARGET_HAS_cmpsel_vec 1 + +#define TCG_TARGET_HAS_tst_vec 0 + +#endif diff --git a/tcg/riscv/tcg-target.h b/tcg/riscv/tcg-target.h index bfaa99ccdd..c710321bdb 100644 --- a/tcg/riscv/tcg-target.h +++ b/tcg/riscv/tcg-target.h @@ -25,8 +25,6 @@ #ifndef RISCV_TCG_TARGET_H #define RISCV_TCG_TARGET_H -#include "host/cpuinfo.h" - #define TCG_TARGET_INSN_UNIT_SIZE 4 #define TCG_TARGET_NB_REGS 64 #define MAX_CODE_GEN_BUFFER_SIZE ((size_t)-1) @@ -59,105 +57,7 @@ typedef enum { TCG_REG_TMP2 = TCG_REG_T4, } TCGReg; -/* optional instructions */ -#define TCG_TARGET_HAS_negsetcond_i32 1 -#define TCG_TARGET_HAS_div_i32 1 -#define TCG_TARGET_HAS_rem_i32 1 -#define TCG_TARGET_HAS_div2_i32 0 -#define TCG_TARGET_HAS_rot_i32 (cpuinfo & CPUINFO_ZBB) -#define TCG_TARGET_HAS_deposit_i32 0 -#define TCG_TARGET_HAS_extract_i32 0 -#define TCG_TARGET_HAS_sextract_i32 0 -#define TCG_TARGET_HAS_extract2_i32 0 -#define TCG_TARGET_HAS_add2_i32 1 -#define TCG_TARGET_HAS_sub2_i32 1 -#define TCG_TARGET_HAS_mulu2_i32 0 -#define TCG_TARGET_HAS_muls2_i32 0 -#define TCG_TARGET_HAS_muluh_i32 0 -#define TCG_TARGET_HAS_mulsh_i32 0 -#define TCG_TARGET_HAS_ext8s_i32 1 -#define TCG_TARGET_HAS_ext16s_i32 1 -#define TCG_TARGET_HAS_ext8u_i32 1 -#define TCG_TARGET_HAS_ext16u_i32 1 -#define TCG_TARGET_HAS_bswap16_i32 (cpuinfo & CPUINFO_ZBB) -#define TCG_TARGET_HAS_bswap32_i32 (cpuinfo & CPUINFO_ZBB) -#define TCG_TARGET_HAS_not_i32 1 -#define TCG_TARGET_HAS_andc_i32 (cpuinfo & CPUINFO_ZBB) -#define TCG_TARGET_HAS_orc_i32 (cpuinfo & CPUINFO_ZBB) -#define TCG_TARGET_HAS_eqv_i32 (cpuinfo & CPUINFO_ZBB) -#define TCG_TARGET_HAS_nand_i32 0 -#define TCG_TARGET_HAS_nor_i32 0 -#define TCG_TARGET_HAS_clz_i32 (cpuinfo & CPUINFO_ZBB) -#define TCG_TARGET_HAS_ctz_i32 (cpuinfo & CPUINFO_ZBB) -#define TCG_TARGET_HAS_ctpop_i32 (cpuinfo & CPUINFO_ZBB) -#define TCG_TARGET_HAS_brcond2 1 -#define TCG_TARGET_HAS_setcond2 1 -#define TCG_TARGET_HAS_qemu_st8_i32 0 - -#define TCG_TARGET_HAS_negsetcond_i64 1 -#define TCG_TARGET_HAS_div_i64 1 -#define TCG_TARGET_HAS_rem_i64 1 -#define TCG_TARGET_HAS_div2_i64 0 -#define TCG_TARGET_HAS_rot_i64 (cpuinfo & CPUINFO_ZBB) -#define TCG_TARGET_HAS_deposit_i64 0 -#define TCG_TARGET_HAS_extract_i64 0 -#define TCG_TARGET_HAS_sextract_i64 0 -#define TCG_TARGET_HAS_extract2_i64 0 -#define TCG_TARGET_HAS_extr_i64_i32 1 -#define TCG_TARGET_HAS_ext8s_i64 1 -#define TCG_TARGET_HAS_ext16s_i64 1 -#define TCG_TARGET_HAS_ext32s_i64 1 -#define TCG_TARGET_HAS_ext8u_i64 1 -#define TCG_TARGET_HAS_ext16u_i64 1 -#define TCG_TARGET_HAS_ext32u_i64 1 -#define TCG_TARGET_HAS_bswap16_i64 (cpuinfo & CPUINFO_ZBB) -#define TCG_TARGET_HAS_bswap32_i64 (cpuinfo & CPUINFO_ZBB) -#define TCG_TARGET_HAS_bswap64_i64 (cpuinfo & CPUINFO_ZBB) -#define TCG_TARGET_HAS_not_i64 1 -#define TCG_TARGET_HAS_andc_i64 (cpuinfo & CPUINFO_ZBB) -#define TCG_TARGET_HAS_orc_i64 (cpuinfo & CPUINFO_ZBB) -#define TCG_TARGET_HAS_eqv_i64 (cpuinfo & CPUINFO_ZBB) -#define TCG_TARGET_HAS_nand_i64 0 -#define TCG_TARGET_HAS_nor_i64 0 -#define TCG_TARGET_HAS_clz_i64 (cpuinfo & CPUINFO_ZBB) -#define TCG_TARGET_HAS_ctz_i64 (cpuinfo & CPUINFO_ZBB) -#define TCG_TARGET_HAS_ctpop_i64 (cpuinfo & CPUINFO_ZBB) -#define TCG_TARGET_HAS_add2_i64 1 -#define TCG_TARGET_HAS_sub2_i64 1 -#define TCG_TARGET_HAS_mulu2_i64 0 -#define TCG_TARGET_HAS_muls2_i64 0 -#define TCG_TARGET_HAS_muluh_i64 1 -#define TCG_TARGET_HAS_mulsh_i64 1 - -#define TCG_TARGET_HAS_qemu_ldst_i128 0 - -#define TCG_TARGET_HAS_tst 0 - -/* vector instructions */ -#define TCG_TARGET_HAS_v64 (cpuinfo & CPUINFO_ZVE64X) -#define TCG_TARGET_HAS_v128 (cpuinfo & CPUINFO_ZVE64X) -#define TCG_TARGET_HAS_v256 (cpuinfo & CPUINFO_ZVE64X) -#define TCG_TARGET_HAS_andc_vec 0 -#define TCG_TARGET_HAS_orc_vec 0 -#define TCG_TARGET_HAS_nand_vec 0 -#define TCG_TARGET_HAS_nor_vec 0 -#define TCG_TARGET_HAS_eqv_vec 0 -#define TCG_TARGET_HAS_not_vec 1 -#define TCG_TARGET_HAS_neg_vec 1 -#define TCG_TARGET_HAS_abs_vec 0 -#define TCG_TARGET_HAS_roti_vec 1 -#define TCG_TARGET_HAS_rots_vec 1 -#define TCG_TARGET_HAS_rotv_vec 1 -#define TCG_TARGET_HAS_shi_vec 1 -#define TCG_TARGET_HAS_shs_vec 1 -#define TCG_TARGET_HAS_shv_vec 1 -#define TCG_TARGET_HAS_mul_vec 1 -#define TCG_TARGET_HAS_sat_vec 1 -#define TCG_TARGET_HAS_minmax_vec 1 -#define TCG_TARGET_HAS_bitsel_vec 0 -#define TCG_TARGET_HAS_cmpsel_vec 1 - -#define TCG_TARGET_HAS_tst_vec 0 +#include "tcg-target-has.h" #define TCG_TARGET_DEFAULT_MO (0) From patchwork Fri Jan 17 18:24:16 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858223 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp842497wrb; Fri, 17 Jan 2025 10:27:42 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXIhcY1/FfciiToeEE42EFRWOt3o8RP0+kCGX2FGKpktZPcv45CdFb9SAHXiZTXRXoyZLpsag==@linaro.org X-Google-Smtp-Source: AGHT+IFLXEoTwyFWgSVTV4BItWEJdAg7/rmgfOJuW5jRDOmKSlAcz22TQyIWWd1JCDQd9urMm/QS X-Received: by 2002:ac8:5982:0:b0:46d:fd08:7ca7 with SMTP id d75a77b69052e-46e12a3a550mr46809731cf.6.1737138462417; Fri, 17 Jan 2025 10:27:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138462; cv=none; d=google.com; s=arc-20240605; b=KBd7A6T59HoG0gPTCu8M0R0DUDhz27/weDitSXK3g30B4Qg89C6oZ9H/QqyClU5n2U mZ4SdkAtZ0Zb4ds2yoqACzUcV0Dvb+ZaajVnVvnBWXGn5d8nSqWLozyhlCHotFhZ35tB SvCkB/oqmdTN6ny4OA5kMAqvooQTo9BC7L2t/OhMZpSPBDFBe0Bq8cnsA0GikPSsMJcx yf/Ot9mhV8qcOHe5Y3cl312Y5+pV8pNy4M6TYYkVeouFdA62y8gjrOIM3cl63r/tVrfI yxyhbdPPLXGEoHYGoW1GkufVQoOl2SYKdRP/gnp1TmrtDATmOGkyqw1ojpD7Umv+ltje YI3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=RfehOVGpYzJP7vz2pYEfQuMJrNb2n6xjeloWGc8gxK8=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=HbeKEWEeVwbyCrC4RbSWTGf3YJaP4YN55T8vQWwAVIfd7E6IRkiz3FiQjT71iLQwPx Up9oPT66s+qpm7pVBeGYa8HBRSpxASPnh6YtMZ2nGx1QXQos8vK/TcCLfA98TVUCDTnk aYntjdmT3DiTJuhuMJexWFMMi33u0xMucxFRbeTLSdhi63EihqJHiXkQDJw4lSTZMJUc /dAjwbKWlNiPj2t2F6zy4sQ7lQ4MYpO8KVAaSO82irD/RFaUwQg69hdeONeIq5LhDqCL 35CZs0Dtl7oWYehLRuQNccC8ei5ziPKCfCUTkHWYNORhqQUzvFUSyXfgzZpSsbYsBSXU aqPw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=A2hrSIni; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46e10409e69si30329481cf.311.2025.01.17.10.27.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:27:42 -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=A2hrSIni; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr2C-0004An-Lw; Fri, 17 Jan 2025 13:25:32 -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 1tYr22-000480-TG for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:22 -0500 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr20-0007th-O8 for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:22 -0500 Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-216426b0865so44701975ad.0 for ; Fri, 17 Jan 2025 10:25:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138319; x=1737743119; 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=RfehOVGpYzJP7vz2pYEfQuMJrNb2n6xjeloWGc8gxK8=; b=A2hrSIniJ4KAi1gdqkwVpXd5e29kphY1Eiw0bk63Lr3+KbuoAvS9d7hqbeexi8g85B kddCFzpS1m9A40t3ovKwm4vX7Rj+HQjLm34Ux9goUJhpOyjL3nATH1z8BebXe0QO26qY txnj8ei7T0et/Ob4BzSc5kuCtE0QdAUuew+qc9dpUYBSutt03+fVjQB5GXmvDALl26Xs 8lL3nfXQGwYb1WlL1ptVaLtsIKdMTrxeRn9GqobunL75sdppKPrycJbj6sSO0WIKwZBP rJ8vokMm1Yj5z41Mr8dd+g8/qF1QlW/YTnDC2CLVuFHaUajXmBe6Bfl+HKW//+NFGd92 acVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138319; x=1737743119; 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=RfehOVGpYzJP7vz2pYEfQuMJrNb2n6xjeloWGc8gxK8=; b=TwUkOUUakQe+Fowm5z24zCxFE3Laifn9nuaw9ZhmyVK1fEG4kwuXqZ07ex6Anz70Ey TgNKMcP5cYdkMn8ExX9KhvZraeTckaFh/UpoyOQxdd7LGXnEzKu/FBtppYfmGDU+12A0 k3jOkqjbo9F71bdTJYmhkhz2yi18bp5PBQjbbG39qS47l6GlvanHi797s85BiKZVFPYm +AOpPpRewXbdZNzhbe+KChMaYzhKz6KuxC3g6DPi0tsV8DMP7daxhKKRIp54ds34T5+8 8P7sIVQ96SlQceaFS67CfNZCcLPiQLGCA4qlH0thnBt6MNf2SKMoa2NNu56rLqADjcOE K/rg== X-Gm-Message-State: AOJu0Yx1rjA2gd+RdiqelKyKalUwGruzJ17semBM/BLcKZr5MrLJa6W0 Lw7HsvOet1bzHWKay7xDVpeZdidgdUIgWmr6oV/wCKsfzZQSwOJj1Bz4/XDdFP4zYd7Y4sL20KP 6 X-Gm-Gg: ASbGncsOaZCF5T1lp8rwj2Lo5kmdKALQ4y9oo1eajTd6pPZGSnUkWPPp5QO+HMHwb8Z 34d2lmI3G6Qwy3F0hTJOYdiyt5ot3grg/VLtk92gtF6/6V6iGAh6/0fNnbzrOo7c68lGrKlZycJ zTtiqF7gEKO0fIlWTSMRct2/w501dK6k0fLaogCOTiBgfuHKd8UoV3Gz+zcIwuFegv8rU6+YugJ pP5e/DIX/uAlOSpMjR7yxKR5r1EwD0nPrs71vYgO6cwK+d2zMPnCrePdFgByCzQ5kaNA4TwwTJO n1g6GGnp3ByabYU= X-Received: by 2002:a17:902:e94f:b0:216:53fa:634f with SMTP id d9443c01a7336-21c355f6e31mr56756145ad.48.1737138318888; Fri, 17 Jan 2025 10:25:18 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21c2d3acccesm18879005ad.123.2025.01.17.10.25.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:25:18 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 28/68] tcg/s390x: Extract TCG_TARGET_HAS_foo defs to 'tcg-target-has.h' Date: Fri, 17 Jan 2025 10:24:16 -0800 Message-ID: <20250117182456.2077110-29-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62e; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62e.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 Signed-off-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20250108215156.8731-11-philmd@linaro.org> --- tcg/s390x/tcg-target-has.h | 124 +++++++++++++++++++++++++++++++++++++ tcg/s390x/tcg-target.h | 114 +--------------------------------- 2 files changed, 125 insertions(+), 113 deletions(-) create mode 100644 tcg/s390x/tcg-target-has.h diff --git a/tcg/s390x/tcg-target-has.h b/tcg/s390x/tcg-target-has.h new file mode 100644 index 0000000000..4992d74f12 --- /dev/null +++ b/tcg/s390x/tcg-target-has.h @@ -0,0 +1,124 @@ +/* SPDX-License-Identifier: MIT */ +/* + * Define target-specific opcode support + * Copyright (c) 2009 Ulrich Hecht + */ + +#ifndef TCG_TARGET_HAS_H +#define TCG_TARGET_HAS_H + +/* Facilities required for proper operation; checked at startup. */ + +#define FACILITY_ZARCH_ACTIVE 2 +#define FACILITY_LONG_DISP 18 +#define FACILITY_EXT_IMM 21 +#define FACILITY_GEN_INST_EXT 34 +#define FACILITY_45 45 + +/* Facilities that are checked at runtime. */ + +#define FACILITY_LOAD_ON_COND2 53 +#define FACILITY_MISC_INSN_EXT2 58 +#define FACILITY_MISC_INSN_EXT3 61 +#define FACILITY_VECTOR 129 +#define FACILITY_VECTOR_ENH1 135 + +extern uint64_t s390_facilities[3]; + +#define HAVE_FACILITY(X) \ + ((s390_facilities[FACILITY_##X / 64] >> (63 - FACILITY_##X % 64)) & 1) + +/* optional instructions */ +#define TCG_TARGET_HAS_div2_i32 1 +#define TCG_TARGET_HAS_rot_i32 1 +#define TCG_TARGET_HAS_ext8s_i32 1 +#define TCG_TARGET_HAS_ext16s_i32 1 +#define TCG_TARGET_HAS_ext8u_i32 1 +#define TCG_TARGET_HAS_ext16u_i32 1 +#define TCG_TARGET_HAS_bswap16_i32 1 +#define TCG_TARGET_HAS_bswap32_i32 1 +#define TCG_TARGET_HAS_not_i32 HAVE_FACILITY(MISC_INSN_EXT3) +#define TCG_TARGET_HAS_andc_i32 HAVE_FACILITY(MISC_INSN_EXT3) +#define TCG_TARGET_HAS_orc_i32 HAVE_FACILITY(MISC_INSN_EXT3) +#define TCG_TARGET_HAS_eqv_i32 HAVE_FACILITY(MISC_INSN_EXT3) +#define TCG_TARGET_HAS_nand_i32 HAVE_FACILITY(MISC_INSN_EXT3) +#define TCG_TARGET_HAS_nor_i32 HAVE_FACILITY(MISC_INSN_EXT3) +#define TCG_TARGET_HAS_clz_i32 0 +#define TCG_TARGET_HAS_ctz_i32 0 +#define TCG_TARGET_HAS_ctpop_i32 1 +#define TCG_TARGET_HAS_deposit_i32 1 +#define TCG_TARGET_HAS_extract_i32 1 +#define TCG_TARGET_HAS_sextract_i32 0 +#define TCG_TARGET_HAS_extract2_i32 0 +#define TCG_TARGET_HAS_negsetcond_i32 1 +#define TCG_TARGET_HAS_add2_i32 1 +#define TCG_TARGET_HAS_sub2_i32 1 +#define TCG_TARGET_HAS_mulu2_i32 0 +#define TCG_TARGET_HAS_muls2_i32 0 +#define TCG_TARGET_HAS_muluh_i32 0 +#define TCG_TARGET_HAS_mulsh_i32 0 +#define TCG_TARGET_HAS_extr_i64_i32 0 +#define TCG_TARGET_HAS_qemu_st8_i32 0 + +#define TCG_TARGET_HAS_div2_i64 1 +#define TCG_TARGET_HAS_rot_i64 1 +#define TCG_TARGET_HAS_ext8s_i64 1 +#define TCG_TARGET_HAS_ext16s_i64 1 +#define TCG_TARGET_HAS_ext32s_i64 1 +#define TCG_TARGET_HAS_ext8u_i64 1 +#define TCG_TARGET_HAS_ext16u_i64 1 +#define TCG_TARGET_HAS_ext32u_i64 1 +#define TCG_TARGET_HAS_bswap16_i64 1 +#define TCG_TARGET_HAS_bswap32_i64 1 +#define TCG_TARGET_HAS_bswap64_i64 1 +#define TCG_TARGET_HAS_not_i64 HAVE_FACILITY(MISC_INSN_EXT3) +#define TCG_TARGET_HAS_andc_i64 HAVE_FACILITY(MISC_INSN_EXT3) +#define TCG_TARGET_HAS_orc_i64 HAVE_FACILITY(MISC_INSN_EXT3) +#define TCG_TARGET_HAS_eqv_i64 HAVE_FACILITY(MISC_INSN_EXT3) +#define TCG_TARGET_HAS_nand_i64 HAVE_FACILITY(MISC_INSN_EXT3) +#define TCG_TARGET_HAS_nor_i64 HAVE_FACILITY(MISC_INSN_EXT3) +#define TCG_TARGET_HAS_clz_i64 1 +#define TCG_TARGET_HAS_ctz_i64 0 +#define TCG_TARGET_HAS_ctpop_i64 1 +#define TCG_TARGET_HAS_deposit_i64 1 +#define TCG_TARGET_HAS_extract_i64 1 +#define TCG_TARGET_HAS_sextract_i64 0 +#define TCG_TARGET_HAS_extract2_i64 0 +#define TCG_TARGET_HAS_negsetcond_i64 1 +#define TCG_TARGET_HAS_add2_i64 1 +#define TCG_TARGET_HAS_sub2_i64 1 +#define TCG_TARGET_HAS_mulu2_i64 1 +#define TCG_TARGET_HAS_muls2_i64 HAVE_FACILITY(MISC_INSN_EXT2) +#define TCG_TARGET_HAS_muluh_i64 0 +#define TCG_TARGET_HAS_mulsh_i64 0 + +#define TCG_TARGET_HAS_qemu_ldst_i128 1 + +#define TCG_TARGET_HAS_tst 1 + +#define TCG_TARGET_HAS_v64 HAVE_FACILITY(VECTOR) +#define TCG_TARGET_HAS_v128 HAVE_FACILITY(VECTOR) +#define TCG_TARGET_HAS_v256 0 + +#define TCG_TARGET_HAS_andc_vec 1 +#define TCG_TARGET_HAS_orc_vec HAVE_FACILITY(VECTOR_ENH1) +#define TCG_TARGET_HAS_nand_vec HAVE_FACILITY(VECTOR_ENH1) +#define TCG_TARGET_HAS_nor_vec 1 +#define TCG_TARGET_HAS_eqv_vec HAVE_FACILITY(VECTOR_ENH1) +#define TCG_TARGET_HAS_not_vec 1 +#define TCG_TARGET_HAS_neg_vec 1 +#define TCG_TARGET_HAS_abs_vec 1 +#define TCG_TARGET_HAS_roti_vec 1 +#define TCG_TARGET_HAS_rots_vec 1 +#define TCG_TARGET_HAS_rotv_vec 1 +#define TCG_TARGET_HAS_shi_vec 1 +#define TCG_TARGET_HAS_shs_vec 1 +#define TCG_TARGET_HAS_shv_vec 1 +#define TCG_TARGET_HAS_mul_vec 1 +#define TCG_TARGET_HAS_sat_vec 0 +#define TCG_TARGET_HAS_minmax_vec 1 +#define TCG_TARGET_HAS_bitsel_vec 1 +#define TCG_TARGET_HAS_cmpsel_vec 1 +#define TCG_TARGET_HAS_tst_vec 0 + +#endif diff --git a/tcg/s390x/tcg-target.h b/tcg/s390x/tcg-target.h index 223d3f6ca1..220ed68b1f 100644 --- a/tcg/s390x/tcg-target.h +++ b/tcg/s390x/tcg-target.h @@ -51,119 +51,7 @@ typedef enum TCGReg { #define TCG_TARGET_NB_REGS 64 -/* Facilities required for proper operation; checked at startup. */ - -#define FACILITY_ZARCH_ACTIVE 2 -#define FACILITY_LONG_DISP 18 -#define FACILITY_EXT_IMM 21 -#define FACILITY_GEN_INST_EXT 34 -#define FACILITY_45 45 - -/* Facilities that are checked at runtime. */ - -#define FACILITY_LOAD_ON_COND2 53 -#define FACILITY_MISC_INSN_EXT2 58 -#define FACILITY_MISC_INSN_EXT3 61 -#define FACILITY_VECTOR 129 -#define FACILITY_VECTOR_ENH1 135 - -extern uint64_t s390_facilities[3]; - -#define HAVE_FACILITY(X) \ - ((s390_facilities[FACILITY_##X / 64] >> (63 - FACILITY_##X % 64)) & 1) - -/* optional instructions */ -#define TCG_TARGET_HAS_div2_i32 1 -#define TCG_TARGET_HAS_rot_i32 1 -#define TCG_TARGET_HAS_ext8s_i32 1 -#define TCG_TARGET_HAS_ext16s_i32 1 -#define TCG_TARGET_HAS_ext8u_i32 1 -#define TCG_TARGET_HAS_ext16u_i32 1 -#define TCG_TARGET_HAS_bswap16_i32 1 -#define TCG_TARGET_HAS_bswap32_i32 1 -#define TCG_TARGET_HAS_not_i32 HAVE_FACILITY(MISC_INSN_EXT3) -#define TCG_TARGET_HAS_andc_i32 HAVE_FACILITY(MISC_INSN_EXT3) -#define TCG_TARGET_HAS_orc_i32 HAVE_FACILITY(MISC_INSN_EXT3) -#define TCG_TARGET_HAS_eqv_i32 HAVE_FACILITY(MISC_INSN_EXT3) -#define TCG_TARGET_HAS_nand_i32 HAVE_FACILITY(MISC_INSN_EXT3) -#define TCG_TARGET_HAS_nor_i32 HAVE_FACILITY(MISC_INSN_EXT3) -#define TCG_TARGET_HAS_clz_i32 0 -#define TCG_TARGET_HAS_ctz_i32 0 -#define TCG_TARGET_HAS_ctpop_i32 1 -#define TCG_TARGET_HAS_deposit_i32 1 -#define TCG_TARGET_HAS_extract_i32 1 -#define TCG_TARGET_HAS_sextract_i32 0 -#define TCG_TARGET_HAS_extract2_i32 0 -#define TCG_TARGET_HAS_negsetcond_i32 1 -#define TCG_TARGET_HAS_add2_i32 1 -#define TCG_TARGET_HAS_sub2_i32 1 -#define TCG_TARGET_HAS_mulu2_i32 0 -#define TCG_TARGET_HAS_muls2_i32 0 -#define TCG_TARGET_HAS_muluh_i32 0 -#define TCG_TARGET_HAS_mulsh_i32 0 -#define TCG_TARGET_HAS_extr_i64_i32 0 -#define TCG_TARGET_HAS_qemu_st8_i32 0 - -#define TCG_TARGET_HAS_div2_i64 1 -#define TCG_TARGET_HAS_rot_i64 1 -#define TCG_TARGET_HAS_ext8s_i64 1 -#define TCG_TARGET_HAS_ext16s_i64 1 -#define TCG_TARGET_HAS_ext32s_i64 1 -#define TCG_TARGET_HAS_ext8u_i64 1 -#define TCG_TARGET_HAS_ext16u_i64 1 -#define TCG_TARGET_HAS_ext32u_i64 1 -#define TCG_TARGET_HAS_bswap16_i64 1 -#define TCG_TARGET_HAS_bswap32_i64 1 -#define TCG_TARGET_HAS_bswap64_i64 1 -#define TCG_TARGET_HAS_not_i64 HAVE_FACILITY(MISC_INSN_EXT3) -#define TCG_TARGET_HAS_andc_i64 HAVE_FACILITY(MISC_INSN_EXT3) -#define TCG_TARGET_HAS_orc_i64 HAVE_FACILITY(MISC_INSN_EXT3) -#define TCG_TARGET_HAS_eqv_i64 HAVE_FACILITY(MISC_INSN_EXT3) -#define TCG_TARGET_HAS_nand_i64 HAVE_FACILITY(MISC_INSN_EXT3) -#define TCG_TARGET_HAS_nor_i64 HAVE_FACILITY(MISC_INSN_EXT3) -#define TCG_TARGET_HAS_clz_i64 1 -#define TCG_TARGET_HAS_ctz_i64 0 -#define TCG_TARGET_HAS_ctpop_i64 1 -#define TCG_TARGET_HAS_deposit_i64 1 -#define TCG_TARGET_HAS_extract_i64 1 -#define TCG_TARGET_HAS_sextract_i64 0 -#define TCG_TARGET_HAS_extract2_i64 0 -#define TCG_TARGET_HAS_negsetcond_i64 1 -#define TCG_TARGET_HAS_add2_i64 1 -#define TCG_TARGET_HAS_sub2_i64 1 -#define TCG_TARGET_HAS_mulu2_i64 1 -#define TCG_TARGET_HAS_muls2_i64 HAVE_FACILITY(MISC_INSN_EXT2) -#define TCG_TARGET_HAS_muluh_i64 0 -#define TCG_TARGET_HAS_mulsh_i64 0 - -#define TCG_TARGET_HAS_qemu_ldst_i128 1 - -#define TCG_TARGET_HAS_tst 1 - -#define TCG_TARGET_HAS_v64 HAVE_FACILITY(VECTOR) -#define TCG_TARGET_HAS_v128 HAVE_FACILITY(VECTOR) -#define TCG_TARGET_HAS_v256 0 - -#define TCG_TARGET_HAS_andc_vec 1 -#define TCG_TARGET_HAS_orc_vec HAVE_FACILITY(VECTOR_ENH1) -#define TCG_TARGET_HAS_nand_vec HAVE_FACILITY(VECTOR_ENH1) -#define TCG_TARGET_HAS_nor_vec 1 -#define TCG_TARGET_HAS_eqv_vec HAVE_FACILITY(VECTOR_ENH1) -#define TCG_TARGET_HAS_not_vec 1 -#define TCG_TARGET_HAS_neg_vec 1 -#define TCG_TARGET_HAS_abs_vec 1 -#define TCG_TARGET_HAS_roti_vec 1 -#define TCG_TARGET_HAS_rots_vec 1 -#define TCG_TARGET_HAS_rotv_vec 1 -#define TCG_TARGET_HAS_shi_vec 1 -#define TCG_TARGET_HAS_shs_vec 1 -#define TCG_TARGET_HAS_shv_vec 1 -#define TCG_TARGET_HAS_mul_vec 1 -#define TCG_TARGET_HAS_sat_vec 0 -#define TCG_TARGET_HAS_minmax_vec 1 -#define TCG_TARGET_HAS_bitsel_vec 1 -#define TCG_TARGET_HAS_cmpsel_vec 1 -#define TCG_TARGET_HAS_tst_vec 0 +#include "tcg-target-has.h" #define TCG_TARGET_DEFAULT_MO (TCG_MO_ALL & ~TCG_MO_ST_LD) From patchwork Fri Jan 17 18:24:17 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858270 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp845288wrb; Fri, 17 Jan 2025 10:33:58 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWnF3XFCDxMFwHw1g9Ryckzey7+0EqiCPY8XRU5eNK8POdByKeQ9rkA46dzZWaDgfay8FjG2Q==@linaro.org X-Google-Smtp-Source: AGHT+IFNRAcSlNnRUpWWi928d4hDu0gdqe0oG3bAA0EDpSecrilFIE7X6yhFBvOBCSycIeuzwj3k X-Received: by 2002:a05:6214:4015:b0:6d8:a946:eee5 with SMTP id 6a1803df08f44-6e1b218a549mr75665426d6.23.1737138837985; Fri, 17 Jan 2025 10:33:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138837; cv=none; d=google.com; s=arc-20240605; b=ccNTpcW54Uz/7J6jlIpqa8GAobevx32guxBS6rq1Rbv1MqbsFHbAgiH7SxR7LvWJ3A b84ANkJCqiWXnI+evyPuS/3Yotr+A3eUnQVDjth6SPgqZgqglXNLPW4q/m4Hivk4aD0Q nB+l6Iz9jHtBe5zZnhlytDXhqttbTiujbYuynwioP0/AcbGfQ0WF+4hEQu1yL7AkZ2eo 4hoj3hwoFn0PV5F2hV17r7kdFE9JXmQKd+6msP+8ADUWATXCRpKhgQ1i11F5yBl7AjIC 2bW28ILiJWRjk0IZHjQsLCe+aHOtu51OM7WWk3xA+stu3Gfl7qCbkw8HOSzpT9+kRBwW 8ewQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=Olp2IikocotZkCcicaB2gg9bPyZ2s29wbBM/SVUjWt0=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=gQ4deB9s5rbNYotgroPMN/UfBat9mPGZ0kZGXhRhR5Ur53H7M8pEG6SFvVvR7oSmMh fS8na4Xnt62nTTCVP0TtHIWLN5ESmUYsH8fT3q2hf4MbujK9OIC7EIKXYva6AlLJjL9V 0QkAcLtc+3VZTReRk4tct/VSJzU5rTtYhYJHETK5wZyqq4m6f+x8RucWVC4Ks+Ti0N8M C0OFcRfiC5SUX59tA5/H8a7XHcN3WKhK1CTryyZhkFTwwETnRTQIp8EOpEJ23s5USYQA IMoVgRC9lrjFs1uehrWrI/zwtBMFBTdFxasu8770bnKwmMXWBHHZLAHULHzCB/t3n04v egCA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tKCvkgAM; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6e1afcd9403si34567106d6.206.2025.01.17.10.33.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:33:57 -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=tKCvkgAM; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr2L-0004Bz-NB; Fri, 17 Jan 2025 13:25:41 -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 1tYr24-00048t-B9 for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:24 -0500 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr21-0007tm-TS for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:24 -0500 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-2163b0c09afso49198105ad.0 for ; Fri, 17 Jan 2025 10:25:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138319; x=1737743119; 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=Olp2IikocotZkCcicaB2gg9bPyZ2s29wbBM/SVUjWt0=; b=tKCvkgAMOp7OvdOvwmh33xjZLJIKqnaMC30dHqXClmW1SANE1XdJV1imUTqtLF12BL Lac4YozM+7brLXyfrypYOvW1N4vkvPArikReFEs/D9XAm1z0/GdbETCl7BjmFqDUblyg k4V0jbxdfpsq0Yj5l4gSkKvcBwYQM1VIxPWQR/y9Fnv9vLxYs9TjYjjJlgq3Qx+ZYrBC 3RonZr2VWfAVr9vxHcAFlk3lgf/xvzIQ4UTlrPOxLON3Z61bTUgMGN2NLr8KQo46qwUl Zp3gFTlYTegWlf2Bfx5Q5Q8J+3SHQdak1/Nme2RcDeBRODn28FmMPvJaDI6/MK5L16rV +Sfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138319; x=1737743119; 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=Olp2IikocotZkCcicaB2gg9bPyZ2s29wbBM/SVUjWt0=; b=kievKzJy3ojLH601FeMbHi6nNDXVSLrJQlCYZR0PcR2VaaLpsFztCU/RDfwTd98MQ9 QXm5Dq1K1TtmjMzg1Wcuq9EXrTgIs9PA8+phIYmAVpjrll+BkBnCg9B/irYR/QcX06mZ wP6VXCjtJS1XAQxL6cg/fogjbw5B5wjpjurMBhd1bAkIeQ490nFXLCOaVQDdvpKIWnxr /ndhp9mNxiz8uXFnpm3hLN7c/93tvMMwEPQLOLCSCBJZWXf2Cdjz4frYgLyXRjZnva+e 0cJvioSHlXFttHXjofmYzFURIc/UaI/+5gY35TAidupYCnsetHZOB4EY5qw2GdzazZOl sWPw== X-Gm-Message-State: AOJu0YzIY/M3s/GamjQ1dxkj8ZfprCd2OUSiC0e8CJKc+p9Vd4Id0OXP qByMkirzk2GG7pZ0/Id3GI9xICjecgEMHmiHXc1ZQMXhYEzDYOZw0K8/Vfb+xZNxCwbBmyvnSWP L X-Gm-Gg: ASbGncvwZwJpFVDjoyw1ohz6BsQ+D3tHt4j3Wb4zPAPaj/fSnxaiNRtcMnjx49FwH6P RA8Lnhz7JBbbAY73u3dqgwcVPzXb9r/seNGViL2YUMoqFYTWlPh3c3EJZyoqHPjkn8lkxkhx9l2 BOKdFAJanZCijhvAKG/2aLZbtfrxh43qmPLMMZWN6QhhyMJa4knrT5OFU3RauXy1QU/SVoPllbR eYsecmiBx7/e95zp92oyveOKRkwa1ZDb1XEOBX0rBzDSNhnWbcN32eTCSFOCQB/yUu2p5I8O/lV qTnm6RCcPyrdx8s= X-Received: by 2002:a17:902:cec3:b0:21a:7cbe:3a9a with SMTP id d9443c01a7336-21c353ee9cfmr56365985ad.14.1737138319517; Fri, 17 Jan 2025 10:25:19 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21c2d3acccesm18879005ad.123.2025.01.17.10.25.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:25:19 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 29/68] tcg/sparc64: Extract TCG_TARGET_HAS_foo defs to 'tcg-target-has.h' Date: Fri, 17 Jan 2025 10:24:17 -0800 Message-ID: <20250117182456.2077110-30-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x632.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 Signed-off-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20250108215156.8731-12-philmd@linaro.org> --- tcg/sparc64/tcg-target-has.h | 86 ++++++++++++++++++++++++++++++++++++ tcg/sparc64/tcg-target.h | 78 +------------------------------- 2 files changed, 88 insertions(+), 76 deletions(-) create mode 100644 tcg/sparc64/tcg-target-has.h diff --git a/tcg/sparc64/tcg-target-has.h b/tcg/sparc64/tcg-target-has.h new file mode 100644 index 0000000000..d9ca14cc3d --- /dev/null +++ b/tcg/sparc64/tcg-target-has.h @@ -0,0 +1,86 @@ +/* SPDX-License-Identifier: MIT */ +/* + * Define target-specific opcode support + * Copyright (c) 2008 Fabrice Bellard + */ + +#ifndef TCG_TARGET_HAS_H +#define TCG_TARGET_HAS_H + +#if defined(__VIS__) && __VIS__ >= 0x300 +#define use_vis3_instructions 1 +#else +extern bool use_vis3_instructions; +#endif + +/* optional instructions */ +#define TCG_TARGET_HAS_div_i32 1 +#define TCG_TARGET_HAS_rem_i32 0 +#define TCG_TARGET_HAS_rot_i32 0 +#define TCG_TARGET_HAS_ext8s_i32 0 +#define TCG_TARGET_HAS_ext16s_i32 0 +#define TCG_TARGET_HAS_ext8u_i32 0 +#define TCG_TARGET_HAS_ext16u_i32 0 +#define TCG_TARGET_HAS_bswap16_i32 0 +#define TCG_TARGET_HAS_bswap32_i32 0 +#define TCG_TARGET_HAS_not_i32 1 +#define TCG_TARGET_HAS_andc_i32 1 +#define TCG_TARGET_HAS_orc_i32 1 +#define TCG_TARGET_HAS_eqv_i32 0 +#define TCG_TARGET_HAS_nand_i32 0 +#define TCG_TARGET_HAS_nor_i32 0 +#define TCG_TARGET_HAS_clz_i32 0 +#define TCG_TARGET_HAS_ctz_i32 0 +#define TCG_TARGET_HAS_ctpop_i32 0 +#define TCG_TARGET_HAS_deposit_i32 0 +#define TCG_TARGET_HAS_extract_i32 0 +#define TCG_TARGET_HAS_sextract_i32 0 +#define TCG_TARGET_HAS_extract2_i32 0 +#define TCG_TARGET_HAS_negsetcond_i32 1 +#define TCG_TARGET_HAS_add2_i32 1 +#define TCG_TARGET_HAS_sub2_i32 1 +#define TCG_TARGET_HAS_mulu2_i32 1 +#define TCG_TARGET_HAS_muls2_i32 1 +#define TCG_TARGET_HAS_muluh_i32 0 +#define TCG_TARGET_HAS_mulsh_i32 0 +#define TCG_TARGET_HAS_qemu_st8_i32 0 + +#define TCG_TARGET_HAS_extr_i64_i32 0 +#define TCG_TARGET_HAS_div_i64 1 +#define TCG_TARGET_HAS_rem_i64 0 +#define TCG_TARGET_HAS_rot_i64 0 +#define TCG_TARGET_HAS_ext8s_i64 0 +#define TCG_TARGET_HAS_ext16s_i64 0 +#define TCG_TARGET_HAS_ext32s_i64 1 +#define TCG_TARGET_HAS_ext8u_i64 0 +#define TCG_TARGET_HAS_ext16u_i64 0 +#define TCG_TARGET_HAS_ext32u_i64 1 +#define TCG_TARGET_HAS_bswap16_i64 0 +#define TCG_TARGET_HAS_bswap32_i64 0 +#define TCG_TARGET_HAS_bswap64_i64 0 +#define TCG_TARGET_HAS_not_i64 1 +#define TCG_TARGET_HAS_andc_i64 1 +#define TCG_TARGET_HAS_orc_i64 1 +#define TCG_TARGET_HAS_eqv_i64 0 +#define TCG_TARGET_HAS_nand_i64 0 +#define TCG_TARGET_HAS_nor_i64 0 +#define TCG_TARGET_HAS_clz_i64 0 +#define TCG_TARGET_HAS_ctz_i64 0 +#define TCG_TARGET_HAS_ctpop_i64 0 +#define TCG_TARGET_HAS_deposit_i64 0 +#define TCG_TARGET_HAS_extract_i64 0 +#define TCG_TARGET_HAS_sextract_i64 0 +#define TCG_TARGET_HAS_extract2_i64 0 +#define TCG_TARGET_HAS_negsetcond_i64 1 +#define TCG_TARGET_HAS_add2_i64 1 +#define TCG_TARGET_HAS_sub2_i64 1 +#define TCG_TARGET_HAS_mulu2_i64 0 +#define TCG_TARGET_HAS_muls2_i64 0 +#define TCG_TARGET_HAS_muluh_i64 use_vis3_instructions +#define TCG_TARGET_HAS_mulsh_i64 0 + +#define TCG_TARGET_HAS_qemu_ldst_i128 0 + +#define TCG_TARGET_HAS_tst 1 + +#endif diff --git a/tcg/sparc64/tcg-target.h b/tcg/sparc64/tcg-target.h index b560d43ed5..1462144631 100644 --- a/tcg/sparc64/tcg-target.h +++ b/tcg/sparc64/tcg-target.h @@ -64,84 +64,10 @@ typedef enum { TCG_REG_I7, } TCGReg; -#if defined(__VIS__) && __VIS__ >= 0x300 -#define use_vis3_instructions 1 -#else -extern bool use_vis3_instructions; -#endif - -/* optional instructions */ -#define TCG_TARGET_HAS_div_i32 1 -#define TCG_TARGET_HAS_rem_i32 0 -#define TCG_TARGET_HAS_rot_i32 0 -#define TCG_TARGET_HAS_ext8s_i32 0 -#define TCG_TARGET_HAS_ext16s_i32 0 -#define TCG_TARGET_HAS_ext8u_i32 0 -#define TCG_TARGET_HAS_ext16u_i32 0 -#define TCG_TARGET_HAS_bswap16_i32 0 -#define TCG_TARGET_HAS_bswap32_i32 0 -#define TCG_TARGET_HAS_not_i32 1 -#define TCG_TARGET_HAS_andc_i32 1 -#define TCG_TARGET_HAS_orc_i32 1 -#define TCG_TARGET_HAS_eqv_i32 0 -#define TCG_TARGET_HAS_nand_i32 0 -#define TCG_TARGET_HAS_nor_i32 0 -#define TCG_TARGET_HAS_clz_i32 0 -#define TCG_TARGET_HAS_ctz_i32 0 -#define TCG_TARGET_HAS_ctpop_i32 0 -#define TCG_TARGET_HAS_deposit_i32 0 -#define TCG_TARGET_HAS_extract_i32 0 -#define TCG_TARGET_HAS_sextract_i32 0 -#define TCG_TARGET_HAS_extract2_i32 0 -#define TCG_TARGET_HAS_negsetcond_i32 1 -#define TCG_TARGET_HAS_add2_i32 1 -#define TCG_TARGET_HAS_sub2_i32 1 -#define TCG_TARGET_HAS_mulu2_i32 1 -#define TCG_TARGET_HAS_muls2_i32 1 -#define TCG_TARGET_HAS_muluh_i32 0 -#define TCG_TARGET_HAS_mulsh_i32 0 -#define TCG_TARGET_HAS_qemu_st8_i32 0 - -#define TCG_TARGET_HAS_extr_i64_i32 0 -#define TCG_TARGET_HAS_div_i64 1 -#define TCG_TARGET_HAS_rem_i64 0 -#define TCG_TARGET_HAS_rot_i64 0 -#define TCG_TARGET_HAS_ext8s_i64 0 -#define TCG_TARGET_HAS_ext16s_i64 0 -#define TCG_TARGET_HAS_ext32s_i64 1 -#define TCG_TARGET_HAS_ext8u_i64 0 -#define TCG_TARGET_HAS_ext16u_i64 0 -#define TCG_TARGET_HAS_ext32u_i64 1 -#define TCG_TARGET_HAS_bswap16_i64 0 -#define TCG_TARGET_HAS_bswap32_i64 0 -#define TCG_TARGET_HAS_bswap64_i64 0 -#define TCG_TARGET_HAS_not_i64 1 -#define TCG_TARGET_HAS_andc_i64 1 -#define TCG_TARGET_HAS_orc_i64 1 -#define TCG_TARGET_HAS_eqv_i64 0 -#define TCG_TARGET_HAS_nand_i64 0 -#define TCG_TARGET_HAS_nor_i64 0 -#define TCG_TARGET_HAS_clz_i64 0 -#define TCG_TARGET_HAS_ctz_i64 0 -#define TCG_TARGET_HAS_ctpop_i64 0 -#define TCG_TARGET_HAS_deposit_i64 0 -#define TCG_TARGET_HAS_extract_i64 0 -#define TCG_TARGET_HAS_sextract_i64 0 -#define TCG_TARGET_HAS_extract2_i64 0 -#define TCG_TARGET_HAS_negsetcond_i64 1 -#define TCG_TARGET_HAS_add2_i64 1 -#define TCG_TARGET_HAS_sub2_i64 1 -#define TCG_TARGET_HAS_mulu2_i64 0 -#define TCG_TARGET_HAS_muls2_i64 0 -#define TCG_TARGET_HAS_muluh_i64 use_vis3_instructions -#define TCG_TARGET_HAS_mulsh_i64 0 - -#define TCG_TARGET_HAS_qemu_ldst_i128 0 - -#define TCG_TARGET_HAS_tst 1 - #define TCG_AREG0 TCG_REG_I0 +#include "tcg-target-has.h" + #define TCG_TARGET_DEFAULT_MO (0) #endif From patchwork Fri Jan 17 18:24:18 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858229 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp843048wrb; Fri, 17 Jan 2025 10:29:07 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVfGEqyNncWvNlbF0J/L+E/JI6FO+KIJBJ2pbW9laAgZilROnD8amr/U+R8Cwgzy2aYde+RzA==@linaro.org X-Google-Smtp-Source: AGHT+IH5tM+GZEGOB92mhklaVxlSAdbZC8nmRKwhMiA02eO5yCUllsMvuREfPFcp0iBSDiW/bbVS X-Received: by 2002:a05:620a:8812:b0:7b6:f17d:f5a7 with SMTP id af79cd13be357-7be631e56b4mr743663785a.6.1737138547708; Fri, 17 Jan 2025 10:29:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138547; cv=none; d=google.com; s=arc-20240605; b=ShtSjxOn1OFUCZQv9oHK5KD80zI58NmJVihnBg9V7X6k9i2VQ/gLbM1VqIs4kioJk3 9FICWgpiuWPbHt26siDtoAUEZaExS0gNVcQs2u20RteXhFM7PdN5TTdWTy4+KtOPIXWZ RNefA8tSwJYFVIrEWn5IVX+5Jiss6Vnv8mcnHfi02MbVNvXJZN6YE/1uTN0uJmSEQqLO 0hejse/F/acxuLOjuehWCYIxY8dBrvRTnybNCpBPrOkofNX7iUmfqnTbL69gLpjyoPOX 6LWv3bX7jsCdmDvQywmLhSt9AL97IqkvZ8Qj/aylRyfORI4XWBvBDIWUvXq1y2wXqIyy u/LQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=hCUX/DPDGPc0y6F9MMMJg3Ro6007rNQHHQot/Hz+zUg=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=FwBdQAWVFYrLgc1Fu4huzwOhqhbEQ+C8CQncRMA908T2Cx3D77WkGeEksqqAKR6WR1 gu07urf3C7y0kRj8u+8758kV5Ft9QQiYx5t8Qs2YkjBgW8g6Ksw7FSFylHq+CIaEr49x TnRong50fuetWFKifLF9x34oDGUZRm06tkIxON/+l9uvv/P/T00RwthEkKNIcBxhCmZz QFsJdU7/xVL97r5z/o/sx8P1Op+IH6vbRSSvvgwNtb3NRBCFhj75ExqwqfM3L39zlP2S HbQipQ9YlRfS7yWVfI2Bj8foeC5MMpfUqtCPQDWo5ax09HLBZU/oFOooyu1lldtPO10D 7+Gg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=G+IWmvYE; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7be614ee466si313011385a.521.2025.01.17.10.29.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:29: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=G+IWmvYE; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr27-0004A9-QV; Fri, 17 Jan 2025 13:25:27 -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 1tYr24-00048s-AV for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:24 -0500 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr21-0007tt-Uv for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:24 -0500 Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-21654fdd5daso44792115ad.1 for ; Fri, 17 Jan 2025 10:25:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138320; x=1737743120; 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=hCUX/DPDGPc0y6F9MMMJg3Ro6007rNQHHQot/Hz+zUg=; b=G+IWmvYEEYLi4ZfBNnBfARRXXpE7QNjgIuUhyxqqCkbtAZhOWrZmdhEv7ezL7p8ko6 YAb/Z/Q8SUO2KNcJ+2cF4KnUnNHx8Q9QmG1Da1UjJRh3KUZy2ZPACxY7xzKV4YtxBpRo cpHiNgaSOsDGVGjKHpmBv8CiO6WJqYzoGuP4Bh9MB5CsWLNBVdFr5HArC/UaDi+uJNaz yMQR3YrQEHC2R2rrTxDzMYjKBmfVKacM3ztl4mQ/fALGqV57q+CEUaMQ+YFLX0xbx1pp qtMYs44/70ydwup7fm1sqCbDOb24tjJ+tEYyI4Du6AZBsXJ9Fp+P6eY1kX++ff1BprIJ pnPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138320; x=1737743120; 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=hCUX/DPDGPc0y6F9MMMJg3Ro6007rNQHHQot/Hz+zUg=; b=TfU6J2mccZEQ+IdbgI2UwInX2ZgGPGFa65Th3KbjXwrOsfciJ1zqwfPj5kd2uVFmeh OusvxfKK85YOL+vi35Qkm7WyrET8NEC1h3uwGgZn+yAyVn76hj0s3r9zk7IeOufcTxwo 0Gzld/fIHDV2IeBcrpA7vKDgIb2Afjr3gGf004FUYPA5pvXn1wSxNn9jbzHv1u88ObyE 7meTJlQY13nrY50UfK5xJy3efTNgNTsyDDT0JjrOLjttf4gWQCzrkuGiZOuHxmLJJGp8 qso+zZNcxGL8x0w2KhjyTid+5G4ow/+gDenDc5MLQA/inHUbm40jqcih8AkC/MoMFKZ4 NSsA== X-Gm-Message-State: AOJu0Yxv4fRzzp6Zk4T2RLWY2FVprnDwVoLvlXAY8EiQqaG0Z0f8nuqp ks6d3WFDAkWWfmWbu896upOnp0Rw5MCBAQ3GhBYLPnjON0L/6gFoGlbusMJOrzzz5lnlQzZINDa b X-Gm-Gg: ASbGncu0hoUqZlDTG72zXTmuStqIXZF1NUxW2QhNX2hskVX7+qSvif7UnUfSB+0OECq /U60dNP3zcRo7QFrtY62EH+mpBzl/TgT/fVldTb1/hIbe6yC/0Nm++3Kc6Cnatup6EAFkWsoeVx buLrZY6QmeIXAF6uc4PTgvBMTYRBA6iSBcNPmpmjJnHyN7BMz6na245NdYcH2lHXoL7kjg3zeeA GCxr3IVYtfQisCx0aJeine1h4mb6lfnRka15caKAed9s2rR0Uwn9ZpGBlQ7GYclLEM9TOgtkaTE RxfaTVF7op51+LY= X-Received: by 2002:a17:902:cf01:b0:215:94e0:17 with SMTP id d9443c01a7336-21c35530228mr57777795ad.23.1737138320285; Fri, 17 Jan 2025 10:25:20 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21c2d3acccesm18879005ad.123.2025.01.17.10.25.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:25:19 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 30/68] tcg/tci: Extract TCG_TARGET_HAS_foo defs to 'tcg-target-has.h' Date: Fri, 17 Jan 2025 10:24:18 -0800 Message-ID: <20250117182456.2077110-31-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62c; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62c.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 Signed-off-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20250108215156.8731-13-philmd@linaro.org> --- tcg/tci/tcg-target-has.h | 83 ++++++++++++++++++++++++++++++++++++++++ tcg/tci/tcg-target.h | 75 +----------------------------------- 2 files changed, 84 insertions(+), 74 deletions(-) create mode 100644 tcg/tci/tcg-target-has.h diff --git a/tcg/tci/tcg-target-has.h b/tcg/tci/tcg-target-has.h new file mode 100644 index 0000000000..3397403910 --- /dev/null +++ b/tcg/tci/tcg-target-has.h @@ -0,0 +1,83 @@ +/* SPDX-License-Identifier: MIT */ +/* + * Define target-specific opcode support + * Copyright (c) 2009, 2011 Stefan Weil + */ + +#ifndef TCG_TARGET_HAS_H +#define TCG_TARGET_HAS_H + +#define TCG_TARGET_HAS_bswap16_i32 1 +#define TCG_TARGET_HAS_bswap32_i32 1 +#define TCG_TARGET_HAS_div_i32 1 +#define TCG_TARGET_HAS_rem_i32 1 +#define TCG_TARGET_HAS_ext8s_i32 1 +#define TCG_TARGET_HAS_ext16s_i32 1 +#define TCG_TARGET_HAS_ext8u_i32 1 +#define TCG_TARGET_HAS_ext16u_i32 1 +#define TCG_TARGET_HAS_andc_i32 1 +#define TCG_TARGET_HAS_deposit_i32 1 +#define TCG_TARGET_HAS_extract_i32 1 +#define TCG_TARGET_HAS_sextract_i32 1 +#define TCG_TARGET_HAS_extract2_i32 0 +#define TCG_TARGET_HAS_eqv_i32 1 +#define TCG_TARGET_HAS_nand_i32 1 +#define TCG_TARGET_HAS_nor_i32 1 +#define TCG_TARGET_HAS_clz_i32 1 +#define TCG_TARGET_HAS_ctz_i32 1 +#define TCG_TARGET_HAS_ctpop_i32 1 +#define TCG_TARGET_HAS_not_i32 1 +#define TCG_TARGET_HAS_orc_i32 1 +#define TCG_TARGET_HAS_rot_i32 1 +#define TCG_TARGET_HAS_negsetcond_i32 0 +#define TCG_TARGET_HAS_muls2_i32 1 +#define TCG_TARGET_HAS_muluh_i32 0 +#define TCG_TARGET_HAS_mulsh_i32 0 +#define TCG_TARGET_HAS_qemu_st8_i32 0 + +#if TCG_TARGET_REG_BITS == 64 +#define TCG_TARGET_HAS_extr_i64_i32 0 +#define TCG_TARGET_HAS_bswap16_i64 1 +#define TCG_TARGET_HAS_bswap32_i64 1 +#define TCG_TARGET_HAS_bswap64_i64 1 +#define TCG_TARGET_HAS_deposit_i64 1 +#define TCG_TARGET_HAS_extract_i64 1 +#define TCG_TARGET_HAS_sextract_i64 1 +#define TCG_TARGET_HAS_extract2_i64 0 +#define TCG_TARGET_HAS_div_i64 1 +#define TCG_TARGET_HAS_rem_i64 1 +#define TCG_TARGET_HAS_ext8s_i64 1 +#define TCG_TARGET_HAS_ext16s_i64 1 +#define TCG_TARGET_HAS_ext32s_i64 1 +#define TCG_TARGET_HAS_ext8u_i64 1 +#define TCG_TARGET_HAS_ext16u_i64 1 +#define TCG_TARGET_HAS_ext32u_i64 1 +#define TCG_TARGET_HAS_andc_i64 1 +#define TCG_TARGET_HAS_eqv_i64 1 +#define TCG_TARGET_HAS_nand_i64 1 +#define TCG_TARGET_HAS_nor_i64 1 +#define TCG_TARGET_HAS_clz_i64 1 +#define TCG_TARGET_HAS_ctz_i64 1 +#define TCG_TARGET_HAS_ctpop_i64 1 +#define TCG_TARGET_HAS_not_i64 1 +#define TCG_TARGET_HAS_orc_i64 1 +#define TCG_TARGET_HAS_rot_i64 1 +#define TCG_TARGET_HAS_negsetcond_i64 0 +#define TCG_TARGET_HAS_muls2_i64 1 +#define TCG_TARGET_HAS_add2_i32 1 +#define TCG_TARGET_HAS_sub2_i32 1 +#define TCG_TARGET_HAS_mulu2_i32 1 +#define TCG_TARGET_HAS_add2_i64 1 +#define TCG_TARGET_HAS_sub2_i64 1 +#define TCG_TARGET_HAS_mulu2_i64 1 +#define TCG_TARGET_HAS_muluh_i64 0 +#define TCG_TARGET_HAS_mulsh_i64 0 +#else +#define TCG_TARGET_HAS_mulu2_i32 1 +#endif /* TCG_TARGET_REG_BITS == 64 */ + +#define TCG_TARGET_HAS_qemu_ldst_i128 0 + +#define TCG_TARGET_HAS_tst 1 + +#endif diff --git a/tcg/tci/tcg-target.h b/tcg/tci/tcg-target.h index d7650343a3..899d9861a6 100644 --- a/tcg/tci/tcg-target.h +++ b/tcg/tci/tcg-target.h @@ -44,80 +44,7 @@ #define TCG_TARGET_INSN_UNIT_SIZE 4 #define MAX_CODE_GEN_BUFFER_SIZE ((size_t)-1) -/* Optional instructions. */ - -#define TCG_TARGET_HAS_bswap16_i32 1 -#define TCG_TARGET_HAS_bswap32_i32 1 -#define TCG_TARGET_HAS_div_i32 1 -#define TCG_TARGET_HAS_rem_i32 1 -#define TCG_TARGET_HAS_ext8s_i32 1 -#define TCG_TARGET_HAS_ext16s_i32 1 -#define TCG_TARGET_HAS_ext8u_i32 1 -#define TCG_TARGET_HAS_ext16u_i32 1 -#define TCG_TARGET_HAS_andc_i32 1 -#define TCG_TARGET_HAS_deposit_i32 1 -#define TCG_TARGET_HAS_extract_i32 1 -#define TCG_TARGET_HAS_sextract_i32 1 -#define TCG_TARGET_HAS_extract2_i32 0 -#define TCG_TARGET_HAS_eqv_i32 1 -#define TCG_TARGET_HAS_nand_i32 1 -#define TCG_TARGET_HAS_nor_i32 1 -#define TCG_TARGET_HAS_clz_i32 1 -#define TCG_TARGET_HAS_ctz_i32 1 -#define TCG_TARGET_HAS_ctpop_i32 1 -#define TCG_TARGET_HAS_not_i32 1 -#define TCG_TARGET_HAS_orc_i32 1 -#define TCG_TARGET_HAS_rot_i32 1 -#define TCG_TARGET_HAS_negsetcond_i32 0 -#define TCG_TARGET_HAS_muls2_i32 1 -#define TCG_TARGET_HAS_muluh_i32 0 -#define TCG_TARGET_HAS_mulsh_i32 0 -#define TCG_TARGET_HAS_qemu_st8_i32 0 - -#if TCG_TARGET_REG_BITS == 64 -#define TCG_TARGET_HAS_extr_i64_i32 0 -#define TCG_TARGET_HAS_bswap16_i64 1 -#define TCG_TARGET_HAS_bswap32_i64 1 -#define TCG_TARGET_HAS_bswap64_i64 1 -#define TCG_TARGET_HAS_deposit_i64 1 -#define TCG_TARGET_HAS_extract_i64 1 -#define TCG_TARGET_HAS_sextract_i64 1 -#define TCG_TARGET_HAS_extract2_i64 0 -#define TCG_TARGET_HAS_div_i64 1 -#define TCG_TARGET_HAS_rem_i64 1 -#define TCG_TARGET_HAS_ext8s_i64 1 -#define TCG_TARGET_HAS_ext16s_i64 1 -#define TCG_TARGET_HAS_ext32s_i64 1 -#define TCG_TARGET_HAS_ext8u_i64 1 -#define TCG_TARGET_HAS_ext16u_i64 1 -#define TCG_TARGET_HAS_ext32u_i64 1 -#define TCG_TARGET_HAS_andc_i64 1 -#define TCG_TARGET_HAS_eqv_i64 1 -#define TCG_TARGET_HAS_nand_i64 1 -#define TCG_TARGET_HAS_nor_i64 1 -#define TCG_TARGET_HAS_clz_i64 1 -#define TCG_TARGET_HAS_ctz_i64 1 -#define TCG_TARGET_HAS_ctpop_i64 1 -#define TCG_TARGET_HAS_not_i64 1 -#define TCG_TARGET_HAS_orc_i64 1 -#define TCG_TARGET_HAS_rot_i64 1 -#define TCG_TARGET_HAS_negsetcond_i64 0 -#define TCG_TARGET_HAS_muls2_i64 1 -#define TCG_TARGET_HAS_add2_i32 1 -#define TCG_TARGET_HAS_sub2_i32 1 -#define TCG_TARGET_HAS_mulu2_i32 1 -#define TCG_TARGET_HAS_add2_i64 1 -#define TCG_TARGET_HAS_sub2_i64 1 -#define TCG_TARGET_HAS_mulu2_i64 1 -#define TCG_TARGET_HAS_muluh_i64 0 -#define TCG_TARGET_HAS_mulsh_i64 0 -#else -#define TCG_TARGET_HAS_mulu2_i32 1 -#endif /* TCG_TARGET_REG_BITS == 64 */ - -#define TCG_TARGET_HAS_qemu_ldst_i128 0 - -#define TCG_TARGET_HAS_tst 1 +#include "tcg-target-has.h" /* Number of registers available. */ #define TCG_TARGET_NB_REGS 16 From patchwork Fri Jan 17 18:24:19 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858262 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp845058wrb; Fri, 17 Jan 2025 10:33:22 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXj4AO+cjf4c2lF8Tg/QvADjbZsywwY/CIuPClLKwLjpd5d4WU5Xx+KierLljeF2ZAlS1xgaA==@linaro.org X-Google-Smtp-Source: AGHT+IFpFrS4PWF59wRsCAfI6C1/w3/BvPdJc72vRLNx/nc8P3YZticaBGCTkynuK6ElFUUNIfEN X-Received: by 2002:a05:6102:2c8c:b0:4b1:1a9d:ecbc with SMTP id ada2fe7eead31-4b690c889c3mr4263532137.20.1737138801894; Fri, 17 Jan 2025 10:33:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138801; cv=none; d=google.com; s=arc-20240605; b=chdUBbLzJfVEt8AdZz9kd7txKB/CmWqb6ZttA4aqXoPK1jjeqydwHavFuRtXGzHDsW oK4OFHEYlgr3D1fSZiXi6c20/tLIqiwf/p5hc8b8c1B3gkbRHJKjjwt0y8SWa1PpCxAW bZi2K2pf7EITkxie/LoApk7CotubRPJ/0vohWw+exy92je2oLeG4f6u3tVqO+xSU0GNj ipl4mWGk05Dr8SEu+VyjN3PsZhym1l76ZXFbIW253ulRu3q7znbkYpsFe0sDAqGEBfLY 4QO96uO4XhwGauOa+IZOtjQ4zzJZm112Je9ZXV07OtJdF5vGwOmg/8zlFt+ZxgpFtCKR hsmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=IxMn5wJHRN3fIBCSyLsUosuOZgtHeKHyf3XHFjAQWv0=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=ZgMG0EwbZ8idZw9natBm5k7a0FexmMIh5miJZSdrHqfE+lNmeIgKAUTIC5odA8JpdI e2urTunZErJD/gPx25C2HvSk00EzuiW8gAw8G4U7H1gCBBVjqWCnc6CG7xl/d85hv/Bb kAOsBeWHa2dmR612kByQkh5kmXZGWWYi8Kbk6wGUWKTuHuIMlGtfAyyn0ei0zIJQ4tUD AsmMQULL0AB3aZXwR9ek0b8USCRfay9oPJkzxYnz40aqyWmw5dFr+1XG1Stpr8cBuKMq CirLWC4+5le80AJnO7mO35rDjpNhsX6Vr4DDZbYIZhICvAjhAyDMlbk0w2sSgqohPp5k S6Lw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SUjk52X9; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id ada2fe7eead31-4b68a34f556si1169654137.573.2025.01.17.10.33.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:33:21 -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=SUjk52X9; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr2A-0004Ag-O5; Fri, 17 Jan 2025 13:25:31 -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 1tYr27-00049o-Fx for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:27 -0500 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr23-0007uA-It for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:25 -0500 Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-2166f1e589cso61674395ad.3 for ; Fri, 17 Jan 2025 10:25:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138321; x=1737743121; 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=IxMn5wJHRN3fIBCSyLsUosuOZgtHeKHyf3XHFjAQWv0=; b=SUjk52X9Pg6mkAadYru6UctC223wShlaHNfiUbnVocZohP9J50zclBK8tyCM3xz86i CrIA1jjaN3S5v1SdQFZHHNbDZa+7xdL+C0NZohf4b6YYALCLd8JCcD67FXoXqmDtAAOO VCXThrYa/CZ0L012ZpIj4KRA7Otnee2CutFZUhU+DWnOUH4scX3ULtgoJRQxE0h0LYkE +baSn/LqzWS515MdQjl9SFAO0TGoMQZEyLRFm7lYLdkkemeBIcQ7ZFo0MY8GqyyZwygA 1S5OVO48ZUbZER+oOeaJl3YbxiqsW0opaqxRgGtgq9qpVLMcCy8SIKcS10z+pNM9FE12 UlTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138321; x=1737743121; 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=IxMn5wJHRN3fIBCSyLsUosuOZgtHeKHyf3XHFjAQWv0=; b=HVKXupYyXNpgXu8mjMRmGJRLcEQQjlY3vu4JDHcZxSheS9Lzqszl8lGJCO/V6+2ijd u+VsYtj9+CYgLZ3ux6jwUqV96Op2Q+IeCEpANoSeritT8gzZMjAPiTBN/KzoxVieiDgc +aFO92XYBTPRTXwcZoB1WIe7xUfwuMW3IlqVnogwewfyGg1j0CYWWjzXU5dev+se1DPR gXr+x0LOadCFJZWIZGqCDzAm9jIE5kKdqQPeqRprMcgJNGz/C/UuSKfmctTpN5bOynVd IehxOSHv9JpAQkZ+UlyhMUbDmiuYVgaTM2rbxyxc1si7pDECKbuust7mC8rIcVUJf6mN W9eg== X-Gm-Message-State: AOJu0Yw1bdvnpoTOD+TbG7/UBZ1ny/hOExr/2NDt/cIPU/iRWFcc3uyO ZYavpCowCIdUv3oxXxFRk+FfNP/PrKeYJslQqrU8J0qqx8sntcVJRAXUg8jOVLHEc5zEx9Gm8lS r X-Gm-Gg: ASbGncvv5nBdjRnfNTb1wMQdbj2jIfksTMwWAR3UoykvIOa6X/kXo0BPXW46SYVd2f9 I7YcVjUzF7IyNOtAyNlPlPHicJJDjB8wNlgAgjuyux8hngPET+R8kVb4HcVnDa94jykb8pQgKGA nHSwyYDb5k+RjvaDO/QlkWfAFhv6/jKtDll6fDqViPQ1ctTzGZODFA8FDUb1WE0WpWsSjJ/bXiK OapsJ6iBlwPijeEgocfK9d3XIDWbtpCWczpAwq2fY/hTtZn2bpSXg/zP7utPILWIiauSEBvCxUP sWYx8gohNeG8gwA= X-Received: by 2002:a17:903:244f:b0:216:643a:535a with SMTP id d9443c01a7336-21c355c7c15mr46382745ad.20.1737138321177; Fri, 17 Jan 2025 10:25:21 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21c2d3acccesm18879005ad.123.2025.01.17.10.25.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:25:20 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 31/68] tcg: Include 'tcg-target-has.h' once in 'tcg-has.h' Date: Fri, 17 Jan 2025 10:24:19 -0800 Message-ID: <20250117182456.2077110-32-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62e; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62e.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 Signed-off-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20250108215156.8731-14-philmd@linaro.org> --- tcg/aarch64/tcg-target.h | 2 -- tcg/arm/tcg-target.h | 2 -- tcg/i386/tcg-target.h | 2 -- tcg/loongarch64/tcg-target.h | 2 -- tcg/mips/tcg-target.h | 2 -- tcg/ppc/tcg-target.h | 2 -- tcg/riscv/tcg-target.h | 2 -- tcg/s390x/tcg-target.h | 2 -- tcg/sparc64/tcg-target.h | 2 -- tcg/tcg-has.h | 2 ++ tcg/tci/tcg-target.h | 2 -- 11 files changed, 2 insertions(+), 20 deletions(-) diff --git a/tcg/aarch64/tcg-target.h b/tcg/aarch64/tcg-target.h index 9a682e51a4..1ef8b2e300 100644 --- a/tcg/aarch64/tcg-target.h +++ b/tcg/aarch64/tcg-target.h @@ -47,8 +47,6 @@ typedef enum { #define TCG_TARGET_NB_REGS 64 -#include "tcg-target-has.h" - #define TCG_TARGET_DEFAULT_MO (0) #endif /* AARCH64_TCG_TARGET_H */ diff --git a/tcg/arm/tcg-target.h b/tcg/arm/tcg-target.h index e114f7ddf4..21563e00f9 100644 --- a/tcg/arm/tcg-target.h +++ b/tcg/arm/tcg-target.h @@ -70,8 +70,6 @@ typedef enum { #define TCG_TARGET_NB_REGS 32 -#include "tcg-target-has.h" - #define TCG_TARGET_DEFAULT_MO (0) #endif diff --git a/tcg/i386/tcg-target.h b/tcg/i386/tcg-target.h index a1dfdeb28d..e6d7fd526e 100644 --- a/tcg/i386/tcg-target.h +++ b/tcg/i386/tcg-target.h @@ -88,8 +88,6 @@ typedef enum { TCG_REG_CALL_STACK = TCG_REG_ESP } TCGReg; -#include "tcg-target-has.h" - /* This defines the natural memory order supported by this * architecture before guarantees made by various barrier * instructions. diff --git a/tcg/loongarch64/tcg-target.h b/tcg/loongarch64/tcg-target.h index a3a6130720..0432a4ebbd 100644 --- a/tcg/loongarch64/tcg-target.h +++ b/tcg/loongarch64/tcg-target.h @@ -85,8 +85,6 @@ typedef enum { TCG_VEC_TMP0 = TCG_REG_V23, } TCGReg; -#include "tcg-target-has.h" - #define TCG_TARGET_DEFAULT_MO (0) #endif /* LOONGARCH_TCG_TARGET_H */ diff --git a/tcg/mips/tcg-target.h b/tcg/mips/tcg-target.h index a34765b389..210044ca12 100644 --- a/tcg/mips/tcg-target.h +++ b/tcg/mips/tcg-target.h @@ -70,8 +70,6 @@ typedef enum { TCG_AREG0 = TCG_REG_S8, } TCGReg; -#include "tcg-target-has.h" - #define TCG_TARGET_DEFAULT_MO 0 #endif diff --git a/tcg/ppc/tcg-target.h b/tcg/ppc/tcg-target.h index fa2cc28183..0bc13d7363 100644 --- a/tcg/ppc/tcg-target.h +++ b/tcg/ppc/tcg-target.h @@ -53,8 +53,6 @@ typedef enum { TCG_AREG0 = TCG_REG_R27 } TCGReg; -#include "tcg-target-has.h" - #define TCG_TARGET_DEFAULT_MO (0) #endif diff --git a/tcg/riscv/tcg-target.h b/tcg/riscv/tcg-target.h index c710321bdb..4c40662402 100644 --- a/tcg/riscv/tcg-target.h +++ b/tcg/riscv/tcg-target.h @@ -57,8 +57,6 @@ typedef enum { TCG_REG_TMP2 = TCG_REG_T4, } TCGReg; -#include "tcg-target-has.h" - #define TCG_TARGET_DEFAULT_MO (0) #endif diff --git a/tcg/s390x/tcg-target.h b/tcg/s390x/tcg-target.h index 220ed68b1f..f790b77075 100644 --- a/tcg/s390x/tcg-target.h +++ b/tcg/s390x/tcg-target.h @@ -51,8 +51,6 @@ typedef enum TCGReg { #define TCG_TARGET_NB_REGS 64 -#include "tcg-target-has.h" - #define TCG_TARGET_DEFAULT_MO (TCG_MO_ALL & ~TCG_MO_ST_LD) #endif diff --git a/tcg/sparc64/tcg-target.h b/tcg/sparc64/tcg-target.h index 1462144631..5ecca5586b 100644 --- a/tcg/sparc64/tcg-target.h +++ b/tcg/sparc64/tcg-target.h @@ -66,8 +66,6 @@ typedef enum { #define TCG_AREG0 TCG_REG_I0 -#include "tcg-target-has.h" - #define TCG_TARGET_DEFAULT_MO (0) #endif diff --git a/tcg/tcg-has.h b/tcg/tcg-has.h index c09ce13389..65b6a0b0cf 100644 --- a/tcg/tcg-has.h +++ b/tcg/tcg-has.h @@ -7,6 +7,8 @@ #ifndef TCG_HAS_H #define TCG_HAS_H +#include "tcg-target-has.h" + #if TCG_TARGET_REG_BITS == 32 /* Turn some undef macros into false macros. */ #define TCG_TARGET_HAS_extr_i64_i32 0 diff --git a/tcg/tci/tcg-target.h b/tcg/tci/tcg-target.h index 899d9861a6..fea92f7848 100644 --- a/tcg/tci/tcg-target.h +++ b/tcg/tci/tcg-target.h @@ -44,8 +44,6 @@ #define TCG_TARGET_INSN_UNIT_SIZE 4 #define MAX_CODE_GEN_BUFFER_SIZE ((size_t)-1) -#include "tcg-target-has.h" - /* Number of registers available. */ #define TCG_TARGET_NB_REGS 16 From patchwork Fri Jan 17 18:24:20 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858213 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp841911wrb; Fri, 17 Jan 2025 10:26:15 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVWlsB25h8E854Bein5oKGQ+M3BoLhv7WDzA9Z0HazLvzpYPMLFol3haxWh8PgkK/1Eha+Icw==@linaro.org X-Google-Smtp-Source: AGHT+IFgZ0DQATZUi0lcA5g8H4SL1a+bWgNgzoWzDI3CSHCCVexeQ431QNA9D8hu+h8JdTRL/FPh X-Received: by 2002:a05:6214:20a1:b0:6d8:8742:137c with SMTP id 6a1803df08f44-6e1b21d8e2dmr55792656d6.24.1737138374929; Fri, 17 Jan 2025 10:26:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138374; cv=none; d=google.com; s=arc-20240605; b=Ybo2pV7jpJwpcA0gW6h0/JoY0jeriiBfDSLA7eEVCb4cHxGTZc7ZJlIQvKcExTMFhp jtvwMvY3wlv7f8diMruDbG7r7q6jU24VWM9RePsQalK836SWhCM2WcS5tY6R4gM1E3T7 pcrcqnlVU0PYs/q1zaelGuNgEOs8AZSL084BKYD1dDIip2zEr97SouDkNW0KMdbG8QIK 7X3OvN3xquFrItjZl0t4WeSA3LY12cLHxUqN1aFjP1NneeFPyL6K6+xFIoMn0nM13BJ0 cPBU+ZGArj60/mtJUAJp9u8HmmRY7M9xKq3zvKblCHyt0ff5qvc3pGY22rxMvtbKPoy/ KHfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=FMIoy9Qr4sAYc0TTIYm5/vud8Vv6iAFrh69jyElbj4I=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=hP2qwGB4alQjoweJ4nmgHRQqE/ZpU9d0Qdc4Eg/lwLrOM9krio9yct8r2AhuSJ/vDB G3cPFJxmpWLdHGRAnZ3Kn3eUH32ZDLxDStOMbnBsBO3Zmy/RD2WVWPe1Li/GKYZwZ27O M4JVO/hURXQbkDfrCoJyJS85vfujnRhIirx0I2rkLtd8hw4yiVZ2VNPXjyR3TYT+FGTa iJ9RPucXpU2g4P1LcFuaUOaAW/N/rI8Vt0UXL/v5pYWCNqoDY8jgraVN/apW8/Z+r+/3 Hc9HsYzBG9Tza5jtGgRntmVQEc1JEdQs4HCR2vdYunMwO2jKbNHEi+dx3qsQpx3VJVKs Cd0g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wSnrDg+F; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6e1afc006bbsi30999626d6.101.2025.01.17.10.26.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:26:14 -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=wSnrDg+F; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr29-0004AL-1V; Fri, 17 Jan 2025 13:25:29 -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 1tYr27-00049s-GW for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:27 -0500 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr24-0007uM-A7 for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:25 -0500 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-2163dc5155fso47383755ad.0 for ; Fri, 17 Jan 2025 10:25:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138322; x=1737743122; 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=FMIoy9Qr4sAYc0TTIYm5/vud8Vv6iAFrh69jyElbj4I=; b=wSnrDg+Fehy4DwnU1cxvg+lOYOp+ihKMQDFP/4H6Bsb8DOIxKJUmimuVif1er3uu5C OYZiJ5DjM0qBs/+QgFJQUHsJayTnuqT1k/ePNcCW9Mmh2YvZz5NUVhs5WFkxxWaUNyvB GKLeDD4YYcMzTTbdRHlMGbuFLv0MHQrLaSVEUPjEaus36rf75j3J23HAuXVzsWaO5Hqb XYiRS/LvT1UrfM4esXCg7imoK7LXfOnU4Fs+j8ccaNpBi8xbx8/fMymIf5o6hFBdcmHv 55SBoqTRlmanxcpRuJrorI3d5fRfyNJ2OmbfkWpkA1JqPEfLWg+Cv+HuLZBAXO58dGtZ LT1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138322; x=1737743122; 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=FMIoy9Qr4sAYc0TTIYm5/vud8Vv6iAFrh69jyElbj4I=; b=htDOIkLJoYiHLzLG6bUwov6ibXkl9K7j2GJIgoj4FGCXSUCSUjpaYcB5/rPLIt9Icc RsMNAdnBTv831LAN8LCjezO2fq+uHhNDuOIVkxDI0vZ+pVx7c//iMX9Mzo25oEIsCygc SZmNsZercHjNStFmYQrNn8y//VW1c4Bg8ukMuIjqowItmiwwX0JF4btR+wor0TVpr8Qi WFetOERfeA9C32CZEiYBp2SG0WTIgKgvPj414AOtlKKvp3znI/UUFReCPkx7umM/0z2t +/PQ89TxyzkgtH5aDYl6yzzcgt8+A2fWWkX9jI49LtztWFGH3nj6PTb7P/WIQpCCuNs+ pLGQ== X-Gm-Message-State: AOJu0YwNmVdnw3R0nm9LSxlHzisJ853NFcNDpOuYMX6P8gqtqGrsM881 QdOIm0cAKWWZ85slJG0SWakN7Z6DsJPME4phuIxoH1QXtAOoYddwGRB9CRfcuuiELbxypQIikNi r X-Gm-Gg: ASbGncu7B52Qm2A/V9s7bu6TSGXwF9RTPB+SgCYiFYcLEMZKfioBAhOdd6h4DECFlZF 69hAFRrnMhBGvNA+l6BEdNg246a/s2CSZToykChuYLqPKKjpsue3bK56vyCO2qKAZe5zglB56RH bNZGXxWwZYRDEo5zvt4ZeTE6QOfxDEVyE3ldTyzFJuRqHLgfwE5AlQS5FkbsaKP1/l5lWV4X71r T/32DjmwakNc5p7qqzCHICrqzVqjELoNF4qaz7qz5kjOb9iZD7RwnkX+KC5Mg9TEeuHog8N3QKq nsZrMmjVHWgC1nI= X-Received: by 2002:a17:902:c951:b0:20c:5533:36da with SMTP id d9443c01a7336-21c355ebb3dmr45385115ad.42.1737138321847; Fri, 17 Jan 2025 10:25:21 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21c2d3acccesm18879005ad.123.2025.01.17.10.25.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:25:21 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 32/68] tcg: Only include 'tcg-has.h' when necessary Date: Fri, 17 Jan 2025 10:24:20 -0800 Message-ID: <20250117182456.2077110-33-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::635; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x635.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 TCG_TARGET_HAS_* definitions don't need to be exposed by "tcg/tcg.h". Only include 'tcg-has.h' when necessary. Signed-off-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20250108215156.8731-15-philmd@linaro.org> --- include/tcg/tcg.h | 2 -- tcg/optimize.c | 1 + tcg/tcg-common.c | 1 + tcg/tcg-op-gvec.c | 1 + tcg/tcg-op-ldst.c | 2 +- tcg/tcg-op-vec.c | 1 + tcg/tcg-op.c | 2 +- tcg/tcg.c | 1 + tcg/tci.c | 1 + 9 files changed, 8 insertions(+), 4 deletions(-) diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h index 4352ec012f..e5fa69d20b 100644 --- a/include/tcg/tcg.h +++ b/include/tcg/tcg.h @@ -64,8 +64,6 @@ typedef uint64_t TCGRegSet; #error unsupported #endif -#include "tcg/tcg-has.h" - typedef enum TCGOpcode { #define DEF(name, oargs, iargs, cargs, flags) INDEX_op_ ## name, #include "tcg/tcg-opc.h" diff --git a/tcg/optimize.c b/tcg/optimize.c index 6823569ee2..c363c5c04b 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -28,6 +28,7 @@ #include "qemu/interval-tree.h" #include "tcg/tcg-op-common.h" #include "tcg-internal.h" +#include "tcg-has.h" #define CASE_OP_32_64(x) \ glue(glue(case INDEX_op_, x), _i32): \ diff --git a/tcg/tcg-common.c b/tcg/tcg-common.c index 35e7616ae9..fadc33c3d1 100644 --- a/tcg/tcg-common.c +++ b/tcg/tcg-common.c @@ -24,6 +24,7 @@ #include "qemu/osdep.h" #include "tcg/tcg.h" +#include "tcg-has.h" TCGOpDef tcg_op_defs[] = { #define DEF(s, oargs, iargs, cargs, flags) \ diff --git a/tcg/tcg-op-gvec.c b/tcg/tcg-op-gvec.c index 97e4df221a..d32a4f146d 100644 --- a/tcg/tcg-op-gvec.c +++ b/tcg/tcg-op-gvec.c @@ -23,6 +23,7 @@ #include "tcg/tcg-op-common.h" #include "tcg/tcg-op-gvec-common.h" #include "tcg/tcg-gvec-desc.h" +#include "tcg-has.h" #define MAX_UNROLL 4 diff --git a/tcg/tcg-op-ldst.c b/tcg/tcg-op-ldst.c index 0d8fe3b4f5..ec3ef4dcb4 100644 --- a/tcg/tcg-op-ldst.c +++ b/tcg/tcg-op-ldst.c @@ -30,7 +30,7 @@ #include "exec/translation-block.h" #include "exec/plugin-gen.h" #include "tcg-internal.h" - +#include "tcg-has.h" static void check_max_alignment(unsigned a_bits) { diff --git a/tcg/tcg-op-vec.c b/tcg/tcg-op-vec.c index 364cd089df..893d68e7d8 100644 --- a/tcg/tcg-op-vec.c +++ b/tcg/tcg-op-vec.c @@ -23,6 +23,7 @@ #include "tcg/tcg-op-common.h" #include "tcg/tcg-mo.h" #include "tcg-internal.h" +#include "tcg-has.h" /* * Vector optional opcode tracking. diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c index 872fb22ef8..ab5ccd8dcb 100644 --- a/tcg/tcg-op.c +++ b/tcg/tcg-op.c @@ -29,7 +29,7 @@ #include "exec/translation-block.h" #include "exec/plugin-gen.h" #include "tcg-internal.h" - +#include "tcg-has.h" /* * Encourage the compiler to tail-call to a function, rather than inlining. diff --git a/tcg/tcg.c b/tcg/tcg.c index 505e43c128..3576299a1c 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -56,6 +56,7 @@ #include "tcg/tcg-temp-internal.h" #include "tcg-internal.h" #include "tcg/perf.h" +#include "tcg-has.h" #ifdef CONFIG_USER_ONLY #include "user/guest-base.h" #endif diff --git a/tcg/tci.c b/tcg/tci.c index 3eb95e20b6..39a68db287 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -22,6 +22,7 @@ #include "tcg/helper-info.h" #include "tcg/tcg-ldst.h" #include "disas/dis-asm.h" +#include "tcg-has.h" #include From patchwork Fri Jan 17 18:24:21 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858218 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp842159wrb; Fri, 17 Jan 2025 10:26:47 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXoMrl5wKOCswEZ9reRoqFJ0XwWKXZxncA67CVPDTynSXlclMSSnqOb4yNSEm8ZLLmyUz8Ivw==@linaro.org X-Google-Smtp-Source: AGHT+IEbG3dWhohfWGcqx6ZEhJVQbCgsho+mAp8iH6DYggW1Xea5wehAOc/rGN5mYvLkHIT1OBnf X-Received: by 2002:a05:620a:4396:b0:7b7:2e7:7a88 with SMTP id af79cd13be357-7be6327cf0amr586035085a.44.1737138407304; Fri, 17 Jan 2025 10:26:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138407; cv=none; d=google.com; s=arc-20240605; b=LU2KwfwLzaaSS87eD96XKDoV48B+sHfyHUUEUkOXRthlWt+/MBjqMp8Pd2FsIekyVC UEuhGs/S2fWDf2XGZINWeev7hutQUcsYO2VtAH0sA02FTuJGNE+NqMWFIdkSsTJYEaei 9PttyB4VZqrQwPfH5eZX56XDpwWZybIk5kGjjTcjrnuwYXT/J7gH/fxo4b72pWPyjP92 sMs0wIUZF/NUZVrJIrEwnX5ByGflprEg7yVH//ScLTqHT+7R4eYq+slDTFGmrdxdiYuZ VWRDFDqqqmdKTSREnvKTby0Y/PrHyI7w1h8o4WJdR2B4pnADwL3kRSfHhlXRyIAZ9VtH NxeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=mYwpPjUswasVxQ+478Fd9keUw6A/plWLqaOi+0i6wO0=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=VrauB0zEpIzUbj3apz3VKeaw8eK83gd9um1Yr88WLy2A+fAJXien1ev+eQkgPpzQWG qnmtuDfnknx99G9bp8QVZPR42ve9hEti+hKfA8w9DEvQ1gqlYC6wF5a0/0i0MoeOCeWq X6aGyvsragCo+Imv8eu1s9D0+WYcO8xlloz8o27NlmPoWEC4XNNWpUZeAWiC3npJXLZQ ktbMYDrVTq1y/nnPoIrK4/T4iSu1ugqVZrzOkVgXoPwQEZ2fOsW9EMnm416mWY+rFIph B0HTW7Pyuep3m0hDL/sMT31s1pQ/41KtN4fSzP5lTBaUeH/MYFHIiXLhM+SsU6OVFVO4 OgEw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=e0A55ACT; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7be6147778csi323878485a.173.2025.01.17.10.26.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:26:47 -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=e0A55ACT; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr2N-0004Nv-57; Fri, 17 Jan 2025 13:25:43 -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 1tYr29-0004AP-Bi for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:30 -0500 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr24-0007ua-2d for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:29 -0500 Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-21661be2c2dso48278495ad.1 for ; Fri, 17 Jan 2025 10:25:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138322; x=1737743122; 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=mYwpPjUswasVxQ+478Fd9keUw6A/plWLqaOi+0i6wO0=; b=e0A55ACTIa79LLN1335KsY+viG+z6q6eoyP2jfZTsqJgfgg6opZZ+FBtZRhyilHKtR VXdCCjhJ76F2f26noGQbaiPTkjqNqEPUp2L6HTqGi0EjyC2X8De4hnsMqqi87OvrSOxJ +RVE8G/X6LEerR237KWRIJsH7wJ+MxpW4DAA2fmsqKI091cUC+wOrey/4kWOOVEjOlVI pK+SQEduLpOXKnTRPz788Ls8OHCeBk6tYBZ2JojFb5dkpi0Xk3tBjGskWz+RjVkATDpY VlOloWxBOMUeGf5PhctbDOn1gB9+0vIsbVzNCF6d4wlo3wzfKeJ10rAbQMy0Acql2Nff 0xFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138322; x=1737743122; 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=mYwpPjUswasVxQ+478Fd9keUw6A/plWLqaOi+0i6wO0=; b=di1jLktZoJoq1CxrA/8+lrL4yz3Xo2PZ+rk42LazNudhhiwc45LJAOeGzpANXRfQj8 dYPSVvxSV4ZO0kYo+PMT94CM9XMD1QsEW1jPLsgt6ksCwk6yGc/4Fp3i1r+SpvkDj+vQ R8LfiJTUK80E7S3aGr7hIOqvF8bo9oq7LB75m9ZeAz4TvsugoeaROOegu8M65JpSjC1h 5MGvqPAHkLDpVPH5XB2zaOqWrqvVf0ytjy3FEVRuRxICgke2UfSxDzW5XPB4/HjuTtns V7dwWKZfLhwoP4KfJU08uOfUD/YCExXKB5cHpQBz2WMnyMe9uMMsIxzzFKnKLFqMnvHX 3lUQ== X-Gm-Message-State: AOJu0YywHYu/sfnAELRchzPURjX9hhDDg2HvWJvxjeeA5ls2hDFR4igb Qm9sxs+ekyAh3/Gm3MD2nzOJmTbsDPhyKXFwlrf4QRG7tfvcz5xc4gnNV0VWTsTMVaVSC4/VT9Y z X-Gm-Gg: ASbGnctOXOgEnBcKtpcNfcSpF+eABhgZhZKHH0WO6zxwLp4s3oAq4YkRCNHSy6v/OBl k1gjWiq73HFK11Bf6AR+4CjcS4PXb/2wwCIzXRQuiDZJo910yYL1DfvrAtBqPnXwWCvbUZ91eY3 7ZDZM4mFlt9oiSZ+5oS4ZC9SDzlyQ4hro3EB6/V0LVw1knzs0vfJ1Z1iMwR8ewtaF0Z7ygpmWtg rVTEsjIQzZDZ0q0M5DXVaXFLqVse/xlN1dQW5WnxyxJJ+ih2UE9KH2ZopLQ+aMnPYz6+B5Bl3Gr HICeOX4MzCfSAz0= X-Received: by 2002:a17:902:f688:b0:215:aee1:7e3e with SMTP id d9443c01a7336-21c352d664fmr49600225ad.5.1737138322558; Fri, 17 Jan 2025 10:25:22 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21c2d3acccesm18879005ad.123.2025.01.17.10.25.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:25:22 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 33/68] tcg: Split out tcg-target-mo.h Date: Fri, 17 Jan 2025 10:24:21 -0800 Message-ID: <20250117182456.2077110-34-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::629; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x629.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 Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- accel/tcg/internal-target.h | 1 + tcg/aarch64/tcg-target-mo.h | 12 ++++++++++++ tcg/aarch64/tcg-target.h | 2 -- tcg/arm/tcg-target-mo.h | 13 +++++++++++++ tcg/arm/tcg-target.h | 2 -- tcg/i386/tcg-target-mo.h | 19 +++++++++++++++++++ tcg/i386/tcg-target.h | 11 ----------- tcg/loongarch64/tcg-target-mo.h | 12 ++++++++++++ tcg/loongarch64/tcg-target.h | 2 -- tcg/mips/tcg-target-mo.h | 13 +++++++++++++ tcg/mips/tcg-target.h | 2 -- tcg/ppc/tcg-target-mo.h | 12 ++++++++++++ tcg/ppc/tcg-target.h | 2 -- tcg/riscv/tcg-target-mo.h | 12 ++++++++++++ tcg/riscv/tcg-target.h | 2 -- tcg/s390x/tcg-target-mo.h | 12 ++++++++++++ tcg/s390x/tcg-target.h | 2 -- tcg/sparc64/tcg-target-mo.h | 12 ++++++++++++ tcg/sparc64/tcg-target.h | 2 -- tcg/tci/tcg-target-mo.h | 17 +++++++++++++++++ tcg/tci/tcg-target.h | 5 ----- tcg/tcg-op-ldst.c | 1 + 22 files changed, 136 insertions(+), 32 deletions(-) create mode 100644 tcg/aarch64/tcg-target-mo.h create mode 100644 tcg/arm/tcg-target-mo.h create mode 100644 tcg/i386/tcg-target-mo.h create mode 100644 tcg/loongarch64/tcg-target-mo.h create mode 100644 tcg/mips/tcg-target-mo.h create mode 100644 tcg/ppc/tcg-target-mo.h create mode 100644 tcg/riscv/tcg-target-mo.h create mode 100644 tcg/s390x/tcg-target-mo.h create mode 100644 tcg/sparc64/tcg-target-mo.h create mode 100644 tcg/tci/tcg-target-mo.h diff --git a/accel/tcg/internal-target.h b/accel/tcg/internal-target.h index a664be02cc..2cdf11c905 100644 --- a/accel/tcg/internal-target.h +++ b/accel/tcg/internal-target.h @@ -12,6 +12,7 @@ #include "exec/exec-all.h" #include "exec/translation-block.h" #include "tb-internal.h" +#include "tcg-target-mo.h" /* * Access to the various translations structures need to be serialised diff --git a/tcg/aarch64/tcg-target-mo.h b/tcg/aarch64/tcg-target-mo.h new file mode 100644 index 0000000000..e8e8923014 --- /dev/null +++ b/tcg/aarch64/tcg-target-mo.h @@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * Define target-specific memory model + * Copyright (c) 2013 Huawei Technologies Duesseldorf GmbH + */ + +#ifndef TCG_TARGET_MO_H +#define TCG_TARGET_MO_H + +#define TCG_TARGET_DEFAULT_MO 0 + +#endif diff --git a/tcg/aarch64/tcg-target.h b/tcg/aarch64/tcg-target.h index 1ef8b2e300..0dd6e1f069 100644 --- a/tcg/aarch64/tcg-target.h +++ b/tcg/aarch64/tcg-target.h @@ -47,6 +47,4 @@ typedef enum { #define TCG_TARGET_NB_REGS 64 -#define TCG_TARGET_DEFAULT_MO (0) - #endif /* AARCH64_TCG_TARGET_H */ diff --git a/tcg/arm/tcg-target-mo.h b/tcg/arm/tcg-target-mo.h new file mode 100644 index 0000000000..12542dfd1c --- /dev/null +++ b/tcg/arm/tcg-target-mo.h @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: MIT */ +/* + * Define target-specific memory model + * Copyright (c) 2008 Fabrice Bellard + * Copyright (c) 2008 Andrzej Zaborowski + */ + +#ifndef TCG_TARGET_MO_H +#define TCG_TARGET_MO_H + +#define TCG_TARGET_DEFAULT_MO 0 + +#endif diff --git a/tcg/arm/tcg-target.h b/tcg/arm/tcg-target.h index 21563e00f9..4f9f877121 100644 --- a/tcg/arm/tcg-target.h +++ b/tcg/arm/tcg-target.h @@ -70,6 +70,4 @@ typedef enum { #define TCG_TARGET_NB_REGS 32 -#define TCG_TARGET_DEFAULT_MO (0) - #endif diff --git a/tcg/i386/tcg-target-mo.h b/tcg/i386/tcg-target-mo.h new file mode 100644 index 0000000000..7567dc7248 --- /dev/null +++ b/tcg/i386/tcg-target-mo.h @@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: MIT */ +/* + * Define target-specific memory model + * Copyright (c) 2008 Fabrice Bellard + */ + +#ifndef TCG_TARGET_MO_H +#define TCG_TARGET_MO_H + +/* + * This defines the natural memory order supported by this architecture + * before guarantees made by various barrier instructions. + * + * The x86 has a pretty strong memory ordering which only really + * allows for some stores to be re-ordered after loads. + */ +#define TCG_TARGET_DEFAULT_MO (TCG_MO_ALL & ~TCG_MO_ST_LD) + +#endif diff --git a/tcg/i386/tcg-target.h b/tcg/i386/tcg-target.h index e6d7fd526e..3cbdfbca52 100644 --- a/tcg/i386/tcg-target.h +++ b/tcg/i386/tcg-target.h @@ -88,15 +88,4 @@ typedef enum { TCG_REG_CALL_STACK = TCG_REG_ESP } TCGReg; -/* This defines the natural memory order supported by this - * architecture before guarantees made by various barrier - * instructions. - * - * The x86 has a pretty strong memory ordering which only really - * allows for some stores to be re-ordered after loads. - */ -#include "tcg/tcg-mo.h" - -#define TCG_TARGET_DEFAULT_MO (TCG_MO_ALL & ~TCG_MO_ST_LD) - #endif diff --git a/tcg/loongarch64/tcg-target-mo.h b/tcg/loongarch64/tcg-target-mo.h new file mode 100644 index 0000000000..d35506957f --- /dev/null +++ b/tcg/loongarch64/tcg-target-mo.h @@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: MIT */ +/* + * Define target-specific memory model + * Copyright (c) 2021 WANG Xuerui + */ + +#ifndef TCG_TARGET_MO_H +#define TCG_TARGET_MO_H + +#define TCG_TARGET_DEFAULT_MO 0 + +#endif diff --git a/tcg/loongarch64/tcg-target.h b/tcg/loongarch64/tcg-target.h index 0432a4ebbd..8533284631 100644 --- a/tcg/loongarch64/tcg-target.h +++ b/tcg/loongarch64/tcg-target.h @@ -85,6 +85,4 @@ typedef enum { TCG_VEC_TMP0 = TCG_REG_V23, } TCGReg; -#define TCG_TARGET_DEFAULT_MO (0) - #endif /* LOONGARCH_TCG_TARGET_H */ diff --git a/tcg/mips/tcg-target-mo.h b/tcg/mips/tcg-target-mo.h new file mode 100644 index 0000000000..50cefc222d --- /dev/null +++ b/tcg/mips/tcg-target-mo.h @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: MIT */ +/* + * Define target-specific memory model + * Copyright (c) 2008-2009 Arnaud Patard + * Copyright (c) 2009 Aurelien Jarno + */ + +#ifndef TCG_TARGET_MO_H +#define TCG_TARGET_MO_H + +#define TCG_TARGET_DEFAULT_MO 0 + +#endif diff --git a/tcg/mips/tcg-target.h b/tcg/mips/tcg-target.h index 210044ca12..3090acc4f5 100644 --- a/tcg/mips/tcg-target.h +++ b/tcg/mips/tcg-target.h @@ -70,6 +70,4 @@ typedef enum { TCG_AREG0 = TCG_REG_S8, } TCGReg; -#define TCG_TARGET_DEFAULT_MO 0 - #endif diff --git a/tcg/ppc/tcg-target-mo.h b/tcg/ppc/tcg-target-mo.h new file mode 100644 index 0000000000..98bfe03b7a --- /dev/null +++ b/tcg/ppc/tcg-target-mo.h @@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: MIT */ +/* + * Define target-specific memory model + * Copyright (c) 2008 Fabrice Bellard + */ + +#ifndef TCG_TARGET_MO_H +#define TCG_TARGET_MO_H + +#define TCG_TARGET_DEFAULT_MO 0 + +#endif diff --git a/tcg/ppc/tcg-target.h b/tcg/ppc/tcg-target.h index 0bc13d7363..5607634e99 100644 --- a/tcg/ppc/tcg-target.h +++ b/tcg/ppc/tcg-target.h @@ -53,6 +53,4 @@ typedef enum { TCG_AREG0 = TCG_REG_R27 } TCGReg; -#define TCG_TARGET_DEFAULT_MO (0) - #endif diff --git a/tcg/riscv/tcg-target-mo.h b/tcg/riscv/tcg-target-mo.h new file mode 100644 index 0000000000..691b5d0da8 --- /dev/null +++ b/tcg/riscv/tcg-target-mo.h @@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: MIT */ +/* + * Define target-specific memory model + * Copyright (c) 2018 SiFive, Inc + */ + +#ifndef TCG_TARGET_MO_H +#define TCG_TARGET_MO_H + +#define TCG_TARGET_DEFAULT_MO 0 + +#endif diff --git a/tcg/riscv/tcg-target.h b/tcg/riscv/tcg-target.h index 4c40662402..db5f3d8b72 100644 --- a/tcg/riscv/tcg-target.h +++ b/tcg/riscv/tcg-target.h @@ -57,6 +57,4 @@ typedef enum { TCG_REG_TMP2 = TCG_REG_T4, } TCGReg; -#define TCG_TARGET_DEFAULT_MO (0) - #endif diff --git a/tcg/s390x/tcg-target-mo.h b/tcg/s390x/tcg-target-mo.h new file mode 100644 index 0000000000..962295ed51 --- /dev/null +++ b/tcg/s390x/tcg-target-mo.h @@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: MIT */ +/* + * Define target-specific memory model + * Copyright (c) 2009 Ulrich Hecht + */ + +#ifndef TCG_TARGET_MO_H +#define TCG_TARGET_MO_H + +#define TCG_TARGET_DEFAULT_MO (TCG_MO_ALL & ~TCG_MO_ST_LD) + +#endif diff --git a/tcg/s390x/tcg-target.h b/tcg/s390x/tcg-target.h index f790b77075..0ef5a6d3dd 100644 --- a/tcg/s390x/tcg-target.h +++ b/tcg/s390x/tcg-target.h @@ -51,6 +51,4 @@ typedef enum TCGReg { #define TCG_TARGET_NB_REGS 64 -#define TCG_TARGET_DEFAULT_MO (TCG_MO_ALL & ~TCG_MO_ST_LD) - #endif diff --git a/tcg/sparc64/tcg-target-mo.h b/tcg/sparc64/tcg-target-mo.h new file mode 100644 index 0000000000..98bfe03b7a --- /dev/null +++ b/tcg/sparc64/tcg-target-mo.h @@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: MIT */ +/* + * Define target-specific memory model + * Copyright (c) 2008 Fabrice Bellard + */ + +#ifndef TCG_TARGET_MO_H +#define TCG_TARGET_MO_H + +#define TCG_TARGET_DEFAULT_MO 0 + +#endif diff --git a/tcg/sparc64/tcg-target.h b/tcg/sparc64/tcg-target.h index 5ecca5586b..f7d75d5806 100644 --- a/tcg/sparc64/tcg-target.h +++ b/tcg/sparc64/tcg-target.h @@ -66,6 +66,4 @@ typedef enum { #define TCG_AREG0 TCG_REG_I0 -#define TCG_TARGET_DEFAULT_MO (0) - #endif diff --git a/tcg/tci/tcg-target-mo.h b/tcg/tci/tcg-target-mo.h new file mode 100644 index 0000000000..779872e39a --- /dev/null +++ b/tcg/tci/tcg-target-mo.h @@ -0,0 +1,17 @@ +/* SPDX-License-Identifier: MIT */ +/* + * Define target-specific memory model + * Copyright (c) 2009, 2011 Stefan Weil + */ + +#ifndef TCG_TARGET_MO_H +#define TCG_TARGET_MO_H + +/* + * We could notice __i386__ or __s390x__ and reduce the barriers depending + * on the host. But if you want performance, you use the normal backend. + * We prefer consistency across hosts on this. + */ +#define TCG_TARGET_DEFAULT_MO 0 + +#endif diff --git a/tcg/tci/tcg-target.h b/tcg/tci/tcg-target.h index fea92f7848..a9ca493d20 100644 --- a/tcg/tci/tcg-target.h +++ b/tcg/tci/tcg-target.h @@ -74,9 +74,4 @@ typedef enum { #define HAVE_TCG_QEMU_TB_EXEC #define TCG_TARGET_NEED_POOL_LABELS -/* We could notice __i386__ or __s390x__ and reduce the barriers depending - on the host. But if you want performance, you use the normal backend. - We prefer consistency across hosts on this. */ -#define TCG_TARGET_DEFAULT_MO (0) - #endif /* TCG_TARGET_H */ diff --git a/tcg/tcg-op-ldst.c b/tcg/tcg-op-ldst.c index ec3ef4dcb4..77271e0193 100644 --- a/tcg/tcg-op-ldst.c +++ b/tcg/tcg-op-ldst.c @@ -31,6 +31,7 @@ #include "exec/plugin-gen.h" #include "tcg-internal.h" #include "tcg-has.h" +#include "tcg-target-mo.h" static void check_max_alignment(unsigned a_bits) { From patchwork Fri Jan 17 18:24:22 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858227 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp843002wrb; Fri, 17 Jan 2025 10:29:01 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWGGi03+BoXWGWLhxHF7UTUrv+qMZKTFnLXBCONuAJt6bcZQpecP1kbgY0JRn+P1SFrhrCPLQ==@linaro.org X-Google-Smtp-Source: AGHT+IE5+YvctsW7RlktsszCZ523AVPYqtMavESRUr+n/sYIQDVaS1PKw0lsKgK7Kji0MydU0wy2 X-Received: by 2002:a05:620a:2990:b0:7b6:c92e:2e6f with SMTP id af79cd13be357-7be6323b786mr540133185a.22.1737138540870; Fri, 17 Jan 2025 10:29:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138540; cv=none; d=google.com; s=arc-20240605; b=W53jgm7yConc6q4t9anvHuKZyZZvHmwJmDaqQcDxT0R1OuBbppTW2ijA95yuIaPytN OZnNzOUXCm3CxRNnpT0F0/VPVn9U5t+eWEW1ICDJQzd+a6XWJ0J3yidWV3FBwfQA6VtQ RuTluAwF6UPX0dhu/Lv80Q/FiCAHxgxEqUuMbrbUNK6lh7ZLclL8teewEM+v0zAygO5r Yo7ORontDP3VBdTVhdyrSjieR/Tfl76D3sIV7ZkrfZi1KpyyQttA/rbU+8+/LSirQJRn 4YzG/8Xsw1qfwqKAnCRqbOd+NPvR1y/A4VXDzqAR5A+zEUqGAp9u3cWKXHIIbZ+AE6G+ 95zA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=+Du/hcUzCRJCFSS7gZnhBMRv2GOlMkHp+q13zYEfxw8=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=QHERdNcUD9z3l20F9jazNxEeaIgClFcAxMvZ8+Y3L+z7kl1Yy10Bra0uYU/tEyz1Mc tehMl2ABdp67/8mWQPvQ2ngvmcHb7reV/vylh1r4zgYQqVJviNKnlFTz3jAr4ra8kTV/ g8KfJblIhmdcOCpjsS9DCg1tO7ao3qao3qSqB47CcSTi2P71v3aT4XJZiv8hTFo7xX25 Wi5b4iFufzDOPJvg/r3JZI9ccZXHfISN50V1nDZr+x3HCn8huPw/x7OfmZ4w80LQoPOG hgQ3RpQ7LdJxu7rS7O/k7+kCDDqj2ZuYcaUP49Ce80rKflq9clmkAhgPi689xY5aXX/i 8J+g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ob6FmSdD; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7be614bfc1dsi357213385a.286.2025.01.17.10.29.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:29:00 -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=Ob6FmSdD; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr2P-0004UO-IM; Fri, 17 Jan 2025 13:25:45 -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 1tYr29-0004AO-5Q for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:29 -0500 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr27-0007uk-46 for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:28 -0500 Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-21661be2c2dso48278725ad.1 for ; Fri, 17 Jan 2025 10:25:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138323; x=1737743123; 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=+Du/hcUzCRJCFSS7gZnhBMRv2GOlMkHp+q13zYEfxw8=; b=Ob6FmSdDTixNi07w48hCDCOv0rcosHU9ELPR3aoBUd+VtR33ge7DMsYSeMe8SHaNrX 4osimsgMTlsNt96+9XUWHo1TcqLOS8qRDvx7edC1+mawxEQj86wLEtbG1xa5y9L3V/OC Z87HyiQBp8SV0ylmfCxjt+BA0s/Aj3Uy3eYCocLZ1Hpjv6z+0cmoBViuo5Bytwg83fiN ByhvHkhlj69nCjGJqfQuqcsfvyazS7p7NYs9fgfUWvep0osJnAHASe5wGap+T0ZbZKHl lbaAP0OTyv4Bpw9NOe2/3n4tBiZqw7XWKeQpxBH7Htwd152skBiMj8F85KwWv6LIGZle N7pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138323; x=1737743123; 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=+Du/hcUzCRJCFSS7gZnhBMRv2GOlMkHp+q13zYEfxw8=; b=b1BrHptAMBBoxJq9WDXg8UjDHoBNLNuv0NOdhJSVjEUjXESFr2y9qC0nAzF/99DYx+ 8yukzcHPNCwuYfNDNIjGoIgjuhxAorss/dhrsVfojDAGm7rTm/y7wSDhl96grKW7+ulR WuniHUAZEaOXT7OLvFKUkqBSu1+rLsvDtPmy4NCbXX1atsGkeUU6igse6cjyF4B2gOUZ D6CrK1X6TkDFsqh0B1NpIv815tsZIW3h4IgpIu//2bsomWMRLzopaWcR28/qNEZt4622 RX1PO1DJsgEqzLe3C5yG5IFILS9nbtKg9uFzaIofdLkMjjtgIVeGuTIiOYJMjrCsRw0H Z4jQ== X-Gm-Message-State: AOJu0Yzjjzq95jCp6eceLBmZ7FVwi2riHkHWP7ZYl9ol8RqASGDs3KIB 1fCIoUQSQpPZQXr4BPIK03ooyPreLFluv4ooDVPMFUkBpfCIXgWrE27P0Elvj2fwu5Te2vK++05 b X-Gm-Gg: ASbGncsFGmmXV35r+Q4hwJr/N22ypEaV7wUBa0mgB8pRKNrYKpi7f7Yc6FtIjQAlE7/ Uh+zAruw6pdwjIhoelhsgR9b6bkiRPF0iapWeLGI3GhdqnF99fiqEfbJ8gKziJmaamdP7F65tdF C+r+yBRApzg9eAtl//Fctojom9hQVErSTciPRSyiKRfpxU2CUeFebS6S59IwO9tt0f0esqwRfup WWTWgJ+KN6jQ/FyA4jIZWNKoWW4sJyqVc10o1K/qQmzPMR+D+aMitb1r87Yq/mvmqSekxVY3IvN 5k6q6eKScsBthNg= X-Received: by 2002:a17:902:e80a:b0:216:6769:9ed7 with SMTP id d9443c01a7336-21c355c7dc2mr59086525ad.40.1737138323361; Fri, 17 Jan 2025 10:25:23 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21c2d3acccesm18879005ad.123.2025.01.17.10.25.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:25:23 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 34/68] tcg: Use C_NotImplemented in tcg_target_op_def Date: Fri, 17 Jan 2025 10:24:22 -0800 Message-ID: <20250117182456.2077110-35-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62a; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62a.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 Return C_NotImplemented instead of asserting for opcodes not implemented by the backend. For now, the assertion moves to process_op_defs. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/tcg.c | 10 ++++++---- tcg/aarch64/tcg-target.c.inc | 2 +- tcg/arm/tcg-target.c.inc | 2 +- tcg/i386/tcg-target.c.inc | 2 +- tcg/loongarch64/tcg-target.c.inc | 2 +- tcg/mips/tcg-target.c.inc | 2 +- tcg/ppc/tcg-target.c.inc | 2 +- tcg/riscv/tcg-target.c.inc | 2 +- tcg/s390x/tcg-target.c.inc | 2 +- tcg/sparc64/tcg-target.c.inc | 2 +- tcg/tci/tcg-target.c.inc | 2 +- 11 files changed, 16 insertions(+), 14 deletions(-) diff --git a/tcg/tcg.c b/tcg/tcg.c index 3576299a1c..05bb464940 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -862,6 +862,7 @@ static int tcg_out_pool_finalize(TCGContext *s) #define C_N1_O1_I4(O1, O2, I1, I2, I3, I4) C_PFX6(c_n1_o1_i4_, O1, O2, I1, I2, I3, I4), typedef enum { + C_NotImplemented = -1, #include "tcg-target-con-set.h" } TCGConstraintSetIndex; @@ -3176,6 +3177,7 @@ static void process_op_defs(TCGContext *s) const TCGTargetOpDef *tdefs; bool saw_alias_pair = false; int i, o, i2, o2, nb_args; + TCGConstraintSetIndex con_set; if (def->flags & TCG_OPF_NOT_PRESENT) { continue; @@ -3188,11 +3190,11 @@ static void process_op_defs(TCGContext *s) /* * Macro magic should make it impossible, but double-check that - * the array index is in range. Since the signness of an enum - * is implementation defined, force the result to unsigned. + * the array index is in range. At the same time, double-check + * that the opcode is implemented, i.e. not C_NotImplemented. */ - unsigned con_set = tcg_target_op_def(op); - tcg_debug_assert(con_set < ARRAY_SIZE(constraint_sets)); + con_set = tcg_target_op_def(op); + tcg_debug_assert(con_set >= 0 && con_set < ARRAY_SIZE(constraint_sets)); tdefs = &constraint_sets[con_set]; for (i = 0; i < nb_args; i++) { diff --git a/tcg/aarch64/tcg-target.c.inc b/tcg/aarch64/tcg-target.c.inc index d77d305f30..d1e08def60 100644 --- a/tcg/aarch64/tcg-target.c.inc +++ b/tcg/aarch64/tcg-target.c.inc @@ -3158,7 +3158,7 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) return C_O1_I2(w, 0, w); default: - g_assert_not_reached(); + return C_NotImplemented; } } diff --git a/tcg/arm/tcg-target.c.inc b/tcg/arm/tcg-target.c.inc index 90ac80077f..b4cd36a9b8 100644 --- a/tcg/arm/tcg-target.c.inc +++ b/tcg/arm/tcg-target.c.inc @@ -2260,7 +2260,7 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) case INDEX_op_bitsel_vec: return C_O1_I3(w, w, w, w); default: - g_assert_not_reached(); + return C_NotImplemented; } } diff --git a/tcg/i386/tcg-target.c.inc b/tcg/i386/tcg-target.c.inc index 167228a781..813c12ca0e 100644 --- a/tcg/i386/tcg-target.c.inc +++ b/tcg/i386/tcg-target.c.inc @@ -3885,7 +3885,7 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) return C_O1_I4(x, x, x, xO, x); default: - g_assert_not_reached(); + return C_NotImplemented; } } diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc index a273e7fce5..686b94ccda 100644 --- a/tcg/loongarch64/tcg-target.c.inc +++ b/tcg/loongarch64/tcg-target.c.inc @@ -2391,7 +2391,7 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) return C_O1_I3(w, w, w, w); default: - g_assert_not_reached(); + return C_NotImplemented; } } diff --git a/tcg/mips/tcg-target.c.inc b/tcg/mips/tcg-target.c.inc index 8857398893..199bd97c0e 100644 --- a/tcg/mips/tcg-target.c.inc +++ b/tcg/mips/tcg-target.c.inc @@ -2292,7 +2292,7 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) : C_O0_I4(rZ, rZ, r, r)); default: - g_assert_not_reached(); + return C_NotImplemented; } } diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc index 94997b126f..3ce4fa1db6 100644 --- a/tcg/ppc/tcg-target.c.inc +++ b/tcg/ppc/tcg-target.c.inc @@ -4354,7 +4354,7 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) return C_O1_I4(v, v, v, vZM, v); default: - g_assert_not_reached(); + return C_NotImplemented; } } diff --git a/tcg/riscv/tcg-target.c.inc b/tcg/riscv/tcg-target.c.inc index 7d1bba100a..51cd7e7586 100644 --- a/tcg/riscv/tcg-target.c.inc +++ b/tcg/riscv/tcg-target.c.inc @@ -2767,7 +2767,7 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) case INDEX_op_cmpsel_vec: return C_O1_I4(v, v, vL, vK, vK); default: - g_assert_not_reached(); + return C_NotImplemented; } } diff --git a/tcg/s390x/tcg-target.c.inc b/tcg/s390x/tcg-target.c.inc index fdf57c0b07..98925b1d5d 100644 --- a/tcg/s390x/tcg-target.c.inc +++ b/tcg/s390x/tcg-target.c.inc @@ -3427,7 +3427,7 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) : C_O1_I4(v, v, v, vZ, v)); default: - g_assert_not_reached(); + return C_NotImplemented; } } diff --git a/tcg/sparc64/tcg-target.c.inc b/tcg/sparc64/tcg-target.c.inc index fe3e727399..1201607722 100644 --- a/tcg/sparc64/tcg-target.c.inc +++ b/tcg/sparc64/tcg-target.c.inc @@ -1627,7 +1627,7 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) return C_O1_I2(r, r, r); default: - g_assert_not_reached(); + return C_NotImplemented; } } diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index 5f88ca0537..74b649c902 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -186,7 +186,7 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) return TCG_TARGET_REG_BITS == 64 ? C_O0_I2(r, r) : C_O0_I4(r, r, r, r); default: - g_assert_not_reached(); + return C_NotImplemented; } } From patchwork Fri Jan 17 18:24:23 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858214 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp842042wrb; Fri, 17 Jan 2025 10:26:30 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCW3Ufr1BX6sHuCY//h4Td0hesmX2ybxVIFb34vPlcxhryDSt88+odoz82peEpNzwkFEWt2bkg==@linaro.org X-Google-Smtp-Source: AGHT+IHZmjJpH/uC0aijbxo+vFzTvGwBKjSeN+AI94dc1nJ4U2wyTZ0XM5sPzdEivX4ITwIfWERp X-Received: by 2002:a05:622a:2d5:b0:467:7441:2717 with SMTP id d75a77b69052e-46e12a40489mr66331071cf.19.1737138390676; Fri, 17 Jan 2025 10:26:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138390; cv=none; d=google.com; s=arc-20240605; b=dlqdA3eW/KquRCCdVfPUBwGXHhgWorrUwqcu7hRGNxxThigJTxfGlDw9aWMsYb2AFU K85QXWwLl5LcjD12jnMfRBOz2E3JP1pdmko6wWdI61OA/gCXwcA8CorVHDiy9Ny76Ozj iLqDreeNzOQQQ2lQTkcvkeXxkHtv3FyZlqf4pr2SlASKeKq/DSGDnrqDXEJ3QoKn0JEi L41/S2VX+53kBaV1LbjqUk2ngKucNQ3m7GnrxNVvt7ejauhyTuJK9IZszh4M1dkf+bIc cnUwIERgZ03fPWTghFZTPWv6Y41pkZ8sUdQXwukXEV85F7rPHLeo9WgxneK0H9Wfv6JA l3aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=jrF/n7KBeARlzDdAnf5wLY/6SKHxmfqpW88RYm3jHsU=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=PA9oRxAU7Y4J+jyBUNHco6TvwJjdX1pftVsNAup2DVkJ/nHsmzffEVk2g0F8oaL5WP QBjGX8CRoebme6xWCyZGkf2HtbZPTsUlmn6qGq1fYX1Mu5qcck915f/cBCvRiqoJKw1U TSKosPLBwtGh7NSbpcUumlFq+nezdD86nSKXnmTkEbLvcwuZFe+7h0zPk+rAhG9yY/zj wkqqy7GEvA9OMOhbxVkifJJYN3mVmOwfOY+ESWfQc/1IlITV/oAfc3bcvhKhwUK9Y5vd zlWE901vxuzneirHB866AVErubB2VleT+LdGeCAh8ZHdUGHyX74ASYdwkBPtbOSoK1ye pK+w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=v598refa; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46e1040e005si28602901cf.285.2025.01.17.10.26.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:26:30 -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=v598refa; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr2N-0004NZ-5Q; Fri, 17 Jan 2025 13:25:43 -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 1tYr29-0004AN-5H for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:29 -0500 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr27-0007uz-7w for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:28 -0500 Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-2166022c5caso43159885ad.2 for ; Fri, 17 Jan 2025 10:25:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138325; x=1737743125; 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=jrF/n7KBeARlzDdAnf5wLY/6SKHxmfqpW88RYm3jHsU=; b=v598refaZBk3OpcEhs9UPe0ukI3GALqplY/GVTyZxODh5gpmX9heaMFPeHKY/AQqGw NS0bhFMFgxfWi5AwoNs6ktwEEjA6aSy9e50vFqOi2WG84j6UvJPN9FPG5RH2XKjSdaQU bd3pnn0FUCUF9wAgvN5XEOs7GSn9rszN7Lw0EJxpg6N+zGddLSoFAwbbFCnd6BN3SK8h T2MqZvMf/t4D0YQLwz/RSMBqT64zvF/fj2tN/dvEEwU4d5fPpcG2Owe8Yn5C917XsFdQ Off9X1HOCAkoZUGH9I1CSAByJxVlss5rExeYws9NVf9+VJLduP6yv/w9XwYZyltCrTkH hH4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138325; x=1737743125; 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=jrF/n7KBeARlzDdAnf5wLY/6SKHxmfqpW88RYm3jHsU=; b=EwelbrX7pSeVBAwDXpWGdd+knOIPe4aiWZ08sgFpuv3ioeG4X5+80mAW5W3wpVh8S8 B+zqWLSnWW802XyQ5m4OAfbd5XY1s2INXN8UUGRr+Y2GjkkQEkku+4i7xoDi6xwh1NAc ebN1PvXBUW4ik5lYVBsqvmfGEOuLk4JAW0ETabdJJxKXzuiS5dUXY1P4IGGxtkYsefdc MsHYtKt0RTjTG8m9/fw99uPTe54oZj0u2ICKhrSmhdwD5CAuiUNgBElleNI9RzUU2oiU ieOvk16PwZeRQTgKNQ4t30cr700Cw0VcQHLUx2dSmS3xmx/Ya/+a6iqWQHLlAVOBkFCP XGUA== X-Gm-Message-State: AOJu0YwmSsq9T5bCndbDojXbgMqT6TntZWkaKLbi1D/D4kNC4xDcvNOy 2ZBONI6dh/766FokHlTy/1dhR4aNaOcmuEgwSjqH46d9Qgh4ftyO5B0/TEZUdX1vP+eBGtBztEM g X-Gm-Gg: ASbGncs1TqpEMl/jYfw6kVBqixMc0N9uUeyhb5CsS+Xt0NU0kmRnDskpo9YGtFdeGBN fABZy+S7VgmGPKySS9DAJ3MwvwCsT4JX5OfyS5Oe2zVNkHs7flZ8RsTErYsJjY6Ug5huaRsvOu+ q5YF60enKZw1EsSjF6LmWWYQEaHBazzntf4Nhyp3dcbPO1XrPgBeGlZK1ohrYxx8o00+4Ops+gB Jufpj/Dodzk/TgsEVr2g0T8E9C29yY1mLa5kBvs/bzhPZRIPoskbo1KQUQD5FEf4U9dFSJ8uH5e WmpslNOkGpO9X9g= X-Received: by 2002:a17:902:f105:b0:216:7c33:8994 with SMTP id d9443c01a7336-21c3561fef9mr40014485ad.53.1737138324705; Fri, 17 Jan 2025 10:25:24 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21c2d3acccesm18879005ad.123.2025.01.17.10.25.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:25:23 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 35/68] tcg: Change have_vec to has_type in tcg_op_supported Date: Fri, 17 Jan 2025 10:24:23 -0800 Message-ID: <20250117182456.2077110-36-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::630; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x630.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 Test each vector type, not just lumping them all together. Add tests for I32 (always true) and I64 (64-bit hosts). Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/tcg.c | 66 ++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 43 insertions(+), 23 deletions(-) diff --git a/tcg/tcg.c b/tcg/tcg.c index 05bb464940..915a181596 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -2136,8 +2136,28 @@ TCGTemp *tcgv_i32_temp(TCGv_i32 v) */ bool tcg_op_supported(TCGOpcode op, TCGType type, unsigned flags) { - const bool have_vec - = TCG_TARGET_HAS_v64 | TCG_TARGET_HAS_v128 | TCG_TARGET_HAS_v256; + bool has_type; + + switch (type) { + case TCG_TYPE_I32: + has_type = true; + break; + case TCG_TYPE_I64: + has_type = TCG_TARGET_REG_BITS == 64; + break; + case TCG_TYPE_V64: + has_type = TCG_TARGET_HAS_v64; + break; + case TCG_TYPE_V128: + has_type = TCG_TARGET_HAS_v128; + break; + case TCG_TYPE_V256: + has_type = TCG_TARGET_HAS_v256; + break; + default: + has_type = false; + break; + } switch (op) { case INDEX_op_discard: @@ -2376,60 +2396,60 @@ bool tcg_op_supported(TCGOpcode op, TCGType type, unsigned flags) case INDEX_op_or_vec: case INDEX_op_xor_vec: case INDEX_op_cmp_vec: - return have_vec; + return has_type; case INDEX_op_dup2_vec: - return have_vec && TCG_TARGET_REG_BITS == 32; + return has_type && TCG_TARGET_REG_BITS == 32; case INDEX_op_not_vec: - return have_vec && TCG_TARGET_HAS_not_vec; + return has_type && TCG_TARGET_HAS_not_vec; case INDEX_op_neg_vec: - return have_vec && TCG_TARGET_HAS_neg_vec; + return has_type && TCG_TARGET_HAS_neg_vec; case INDEX_op_abs_vec: - return have_vec && TCG_TARGET_HAS_abs_vec; + return has_type && TCG_TARGET_HAS_abs_vec; case INDEX_op_andc_vec: - return have_vec && TCG_TARGET_HAS_andc_vec; + return has_type && TCG_TARGET_HAS_andc_vec; case INDEX_op_orc_vec: - return have_vec && TCG_TARGET_HAS_orc_vec; + return has_type && TCG_TARGET_HAS_orc_vec; case INDEX_op_nand_vec: - return have_vec && TCG_TARGET_HAS_nand_vec; + return has_type && TCG_TARGET_HAS_nand_vec; case INDEX_op_nor_vec: - return have_vec && TCG_TARGET_HAS_nor_vec; + return has_type && TCG_TARGET_HAS_nor_vec; case INDEX_op_eqv_vec: - return have_vec && TCG_TARGET_HAS_eqv_vec; + return has_type && TCG_TARGET_HAS_eqv_vec; case INDEX_op_mul_vec: - return have_vec && TCG_TARGET_HAS_mul_vec; + return has_type && TCG_TARGET_HAS_mul_vec; case INDEX_op_shli_vec: case INDEX_op_shri_vec: case INDEX_op_sari_vec: - return have_vec && TCG_TARGET_HAS_shi_vec; + return has_type && TCG_TARGET_HAS_shi_vec; case INDEX_op_shls_vec: case INDEX_op_shrs_vec: case INDEX_op_sars_vec: - return have_vec && TCG_TARGET_HAS_shs_vec; + return has_type && TCG_TARGET_HAS_shs_vec; case INDEX_op_shlv_vec: case INDEX_op_shrv_vec: case INDEX_op_sarv_vec: - return have_vec && TCG_TARGET_HAS_shv_vec; + return has_type && TCG_TARGET_HAS_shv_vec; case INDEX_op_rotli_vec: - return have_vec && TCG_TARGET_HAS_roti_vec; + return has_type && TCG_TARGET_HAS_roti_vec; case INDEX_op_rotls_vec: - return have_vec && TCG_TARGET_HAS_rots_vec; + return has_type && TCG_TARGET_HAS_rots_vec; case INDEX_op_rotlv_vec: case INDEX_op_rotrv_vec: - return have_vec && TCG_TARGET_HAS_rotv_vec; + return has_type && TCG_TARGET_HAS_rotv_vec; case INDEX_op_ssadd_vec: case INDEX_op_usadd_vec: case INDEX_op_sssub_vec: case INDEX_op_ussub_vec: - return have_vec && TCG_TARGET_HAS_sat_vec; + return has_type && TCG_TARGET_HAS_sat_vec; case INDEX_op_smin_vec: case INDEX_op_umin_vec: case INDEX_op_smax_vec: case INDEX_op_umax_vec: - return have_vec && TCG_TARGET_HAS_minmax_vec; + return has_type && TCG_TARGET_HAS_minmax_vec; case INDEX_op_bitsel_vec: - return have_vec && TCG_TARGET_HAS_bitsel_vec; + return has_type && TCG_TARGET_HAS_bitsel_vec; case INDEX_op_cmpsel_vec: - return have_vec && TCG_TARGET_HAS_cmpsel_vec; + return has_type && TCG_TARGET_HAS_cmpsel_vec; default: tcg_debug_assert(op > INDEX_op_last_generic && op < NB_OPS); From patchwork Fri Jan 17 18:24:24 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858238 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp843400wrb; Fri, 17 Jan 2025 10:29:58 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXykoW6msSRTiq3Kxtkjzs1UV7zC4Cw045lErVojb1+MUIoXxbJzn9A5vURzMDeo4q9y+c4yA==@linaro.org X-Google-Smtp-Source: AGHT+IG6jsbg+u3Elmi0nxiPM+/04HPqmizP7cq0yDvpw0OGZgylS/eAoYgDe0IGW0jG1EuFK/V6 X-Received: by 2002:a05:620a:468a:b0:7b1:543d:c99 with SMTP id af79cd13be357-7be632024ebmr649600285a.24.1737138598217; Fri, 17 Jan 2025 10:29:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138598; cv=none; d=google.com; s=arc-20240605; b=hBbPp/nTKZDrN3tnI7y5rJKhPocnUX4g7tUktyFFh3PqteqaMwbws1TAQiY6Shlo/Z kH61K0A1UFc9uBcyCq3CU8TZNmI5vJk0Kn8l0xfNseNc/2f6UbLs2zMHRwbZaafP0Ws1 XcZ6PbCo4XgCFftqCtsE+qzuQvqHqB1IdqvR5S/IWAtN4y+B+ZZptZ2twRSqrl4VnYCn GA5diGk3WX+UVkLQEmmoDt5O/UBlAnnODguNoTq3Vb5RWGM7RnR3qHaXMcveghQQXBUB Up9Ef+Ds1sd6uh7wsTJIMpdZOq0Mo5E/Y00ehgdn0jrSZ5iwhRNAgzTeUYpesX4GM7IY Qb9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=DHOuFKbiyyQEX/klSmP2CeFyRwv+iNHGvEa+p7k0Rd8=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=aQ16FG9tt11/nf1+BKMFaNqVpCimRG3sUn2I9qT3zQAJN9cQtp/M+GzuNo3OH+UmDW rgpVUXbV74oFtcJ7pCy/feCKsOF3p6hXrxxr5QXntelxeJREYOHFMbHFNJ2aZFSmlY8G DF+El2VHWwSZPqfU1O+3+DBo+sGF3k6cRKM2PbkttUad4ZuPJtG0pXTfqJuamLdGgjk1 QvkHRlzWvT9Vq6BOS2sHG4oASuIF4gJoe8cP8RYqdvNQzaJakSh8v73ASTI/sdxQd0ck 8ESAy8heMui2L0h7C3UG7v3driyN8aXrLuTwnol2AGrP3ZGEOp5gFdGOtSqE57N2Q2v2 /khQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lmXMPTXJ; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7be6146cfd4si316080685a.96.2025.01.17.10.29.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:29:58 -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=lmXMPTXJ; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr2Q-0004WE-99; Fri, 17 Jan 2025 13:25:46 -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 1tYr2E-0004BT-S8 for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:36 -0500 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr27-0007v9-Bg for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:34 -0500 Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-2165448243fso57144995ad.1 for ; Fri, 17 Jan 2025 10:25:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138326; x=1737743126; 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=DHOuFKbiyyQEX/klSmP2CeFyRwv+iNHGvEa+p7k0Rd8=; b=lmXMPTXJ4qVTpzCjmMbZ6ezy53w/5BwExyCfHeLKtj4dT89kJ17w0Oq7P+/6vJcVvg GegT7k1fhjAO/ZT+8MkfVzdRk0zLBlldhkFR/qnMatNtsFxg/Y+JvrGDmzYzLAzYZmzJ KoAEiIX4Zo4/EK7S4S74QwNgVCMduKZbGiRlubyKDoS3wk0zMS+wYxArSlbA2vFivExh PoxzMkTjDtyOrt5LouvhpowuoLI6QbUcSdMn2uAuTSGYLblp8sLFYoFL1b0gGR4WKzQ0 JJpDmIAb4CitjM3NFL6b69pRYhJT87yhsDsHQt2fO4DH2XjRFAenPiGV3QY+to64qX4W 77iQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138326; x=1737743126; 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=DHOuFKbiyyQEX/klSmP2CeFyRwv+iNHGvEa+p7k0Rd8=; b=wOChX6VwPrjTVyNG635QUODy/wXqlHCcJYaVpz+Px1ZgwhX8TThJF23Ey1mMvrw76N glIShCluYUB4ipO50RmR3tgapkGP5b5eARF9Wkyv6OgsZE+PFhkVmR9vHmK/G2AlZUhH hQWy6NsQzjhlIs3yMDMY/TgGIp81EBi+E+emw2+JaNTBV/ShO8I/OvdMqHgZJhyZVupM gVPyg26rM8fSzFHvMitYHDkk9/x3LJ3uUz6oIv1+n1FjO2eZUR9rh15r4vFvwb4VSKjA 05vJyozh+U45vCqA8MsOC5xSd3OV4z+BKf7McuhskVgERZbvFZB4a/2sdZd1xANCcqDd 6YrA== X-Gm-Message-State: AOJu0YxFTo4dBjdfTOsZafmr0+W3gcTXWKq68fYMAP9zZxxbCdGkKAk0 OWtXHYJFduwjr1DeBCZ5zM068sh+JKJbOmxUVeArmH3xrkEyNvIX+XZsbo/FkPCZcecqiBSzJ7f y X-Gm-Gg: ASbGncsDFtCcXj3GFSx908pdynmMUz29WdsTRKi88wFBNGKoJr5jH7GE2huVFST47/l XhEKPSHRXLDXgJRloToxZopPNDXMxw70lH7C0sv0oUQIUH5iAbA06P8u81Tb+ySgyTm2vCbdeOv MnPX+mwPeYUfBD3yh5kmHKzyblKxxKcNzpfoiNoQ/opKF09nJ/+QgUsRGTFKfTwlYVZn+Gxivt9 AxqpOkl1SCL7hgqgSSizVR+ocOzhcEf+F3VgqxR1WuXiuyZKN7MjQuMIR7McfGuCMZFIPSFyCih z3ImhLB1vK3d1W8= X-Received: by 2002:a17:903:1d1:b0:216:4724:2757 with SMTP id d9443c01a7336-21c353eed3fmr55248215ad.4.1737138325883; Fri, 17 Jan 2025 10:25:25 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21c2d3acccesm18879005ad.123.2025.01.17.10.25.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:25:25 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 36/68] tcg: Reorg process_op_defs Date: Fri, 17 Jan 2025 10:24:24 -0800 Message-ID: <20250117182456.2077110-37-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::629; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x629.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 Process each TCGConstraintSetIndex first. Allocate TCGArgConstraint arrays based on those. Only afterward process the TCGOpcodes and share those TCGArgConstraint arrays. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/tcg/tcg.h | 7 +- tcg/tcg.c | 272 +++++++++++++++++++++++----------------------- 2 files changed, 136 insertions(+), 143 deletions(-) diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h index e5fa69d20b..a02de82508 100644 --- a/include/tcg/tcg.h +++ b/include/tcg/tcg.h @@ -714,17 +714,12 @@ typedef struct TCGOpDef { const char *name; uint8_t nb_oargs, nb_iargs, nb_cargs, nb_args; uint8_t flags; - TCGArgConstraint *args_ct; + const TCGArgConstraint *args_ct; } TCGOpDef; extern TCGOpDef tcg_op_defs[]; extern const size_t tcg_op_defs_max; -typedef struct TCGTargetOpDef { - TCGOpcode op; - const char *args_ct_str[TCG_MAX_OP_ARGS]; -} TCGTargetOpDef; - /* * tcg_op_supported: * Query if @op, for @type and @flags, is supported by the host diff --git a/tcg/tcg.c b/tcg/tcg.c index 915a181596..d5ab0abe9d 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -887,31 +887,35 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode); /* Put all of the constraint sets into an array, indexed by the enum. */ -#define C_O0_I1(I1) { .args_ct_str = { #I1 } }, -#define C_O0_I2(I1, I2) { .args_ct_str = { #I1, #I2 } }, -#define C_O0_I3(I1, I2, I3) { .args_ct_str = { #I1, #I2, #I3 } }, -#define C_O0_I4(I1, I2, I3, I4) { .args_ct_str = { #I1, #I2, #I3, #I4 } }, +typedef struct TCGConstraintSet { + uint8_t nb_oargs, nb_iargs; + const char *args_ct_str[TCG_MAX_OP_ARGS]; +} TCGConstraintSet; -#define C_O1_I1(O1, I1) { .args_ct_str = { #O1, #I1 } }, -#define C_O1_I2(O1, I1, I2) { .args_ct_str = { #O1, #I1, #I2 } }, -#define C_O1_I3(O1, I1, I2, I3) { .args_ct_str = { #O1, #I1, #I2, #I3 } }, -#define C_O1_I4(O1, I1, I2, I3, I4) { .args_ct_str = { #O1, #I1, #I2, #I3, #I4 } }, +#define C_O0_I1(I1) { 0, 1, { #I1 } }, +#define C_O0_I2(I1, I2) { 0, 2, { #I1, #I2 } }, +#define C_O0_I3(I1, I2, I3) { 0, 3, { #I1, #I2, #I3 } }, +#define C_O0_I4(I1, I2, I3, I4) { 0, 4, { #I1, #I2, #I3, #I4 } }, -#define C_N1_I2(O1, I1, I2) { .args_ct_str = { "&" #O1, #I1, #I2 } }, -#define C_N1O1_I1(O1, O2, I1) { .args_ct_str = { "&" #O1, #O2, #I1 } }, -#define C_N2_I1(O1, O2, I1) { .args_ct_str = { "&" #O1, "&" #O2, #I1 } }, +#define C_O1_I1(O1, I1) { 1, 1, { #O1, #I1 } }, +#define C_O1_I2(O1, I1, I2) { 1, 2, { #O1, #I1, #I2 } }, +#define C_O1_I3(O1, I1, I2, I3) { 1, 3, { #O1, #I1, #I2, #I3 } }, +#define C_O1_I4(O1, I1, I2, I3, I4) { 1, 4, { #O1, #I1, #I2, #I3, #I4 } }, -#define C_O2_I1(O1, O2, I1) { .args_ct_str = { #O1, #O2, #I1 } }, -#define C_O2_I2(O1, O2, I1, I2) { .args_ct_str = { #O1, #O2, #I1, #I2 } }, -#define C_O2_I3(O1, O2, I1, I2, I3) { .args_ct_str = { #O1, #O2, #I1, #I2, #I3 } }, -#define C_O2_I4(O1, O2, I1, I2, I3, I4) { .args_ct_str = { #O1, #O2, #I1, #I2, #I3, #I4 } }, -#define C_N1_O1_I4(O1, O2, I1, I2, I3, I4) { .args_ct_str = { "&" #O1, #O2, #I1, #I2, #I3, #I4 } }, +#define C_N1_I2(O1, I1, I2) { 1, 2, { "&" #O1, #I1, #I2 } }, +#define C_N1O1_I1(O1, O2, I1) { 2, 1, { "&" #O1, #O2, #I1 } }, +#define C_N2_I1(O1, O2, I1) { 2, 1, { "&" #O1, "&" #O2, #I1 } }, -static const TCGTargetOpDef constraint_sets[] = { +#define C_O2_I1(O1, O2, I1) { 2, 1, { #O1, #O2, #I1 } }, +#define C_O2_I2(O1, O2, I1, I2) { 2, 2, { #O1, #O2, #I1, #I2 } }, +#define C_O2_I3(O1, O2, I1, I2, I3) { 2, 3, { #O1, #O2, #I1, #I2, #I3 } }, +#define C_O2_I4(O1, O2, I1, I2, I3, I4) { 2, 4, { #O1, #O2, #I1, #I2, #I3, #I4 } }, +#define C_N1_O1_I4(O1, O2, I1, I2, I3, I4) { 2, 4, { "&" #O1, #O2, #I1, #I2, #I3, #I4 } }, + +static const TCGConstraintSet constraint_sets[] = { #include "tcg-target-con-set.h" }; - #undef C_O0_I1 #undef C_O0_I2 #undef C_O0_I3 @@ -1499,32 +1503,12 @@ static TCGTemp *tcg_global_reg_new_internal(TCGContext *s, TCGType type, static void tcg_context_init(unsigned max_cpus) { TCGContext *s = &tcg_init_ctx; - int op, total_args, n, i; - TCGOpDef *def; - TCGArgConstraint *args_ct; + int n, i; TCGTemp *ts; memset(s, 0, sizeof(*s)); s->nb_globals = 0; - /* Count total number of arguments and allocate the corresponding - space */ - total_args = 0; - for(op = 0; op < NB_OPS; op++) { - def = &tcg_op_defs[op]; - n = def->nb_iargs + def->nb_oargs; - total_args += n; - } - - args_ct = g_new0(TCGArgConstraint, total_args); - - for(op = 0; op < NB_OPS; op++) { - def = &tcg_op_defs[op]; - def->args_ct = args_ct; - n = def->nb_iargs + def->nb_oargs; - args_ct += n; - } - init_call_layout(&info_helper_ld32_mmu); init_call_layout(&info_helper_ld64_mmu); init_call_layout(&info_helper_ld128_mmu); @@ -3132,10 +3116,12 @@ void tcg_dump_ops(TCGContext *s, FILE *f, bool have_prefs) } /* we give more priority to constraints with less registers */ -static int get_constraint_priority(const TCGOpDef *def, int k) +static int get_constraint_priority(const TCGArgConstraint *arg_ct, int k) { - const TCGArgConstraint *arg_ct = &def->args_ct[k]; - int n = ctpop64(arg_ct->regs); + int n; + + arg_ct += k; + n = ctpop64(arg_ct->regs); /* * Sort constraints of a single register first, which includes output @@ -3164,10 +3150,9 @@ static int get_constraint_priority(const TCGOpDef *def, int k) } /* sort from highest priority to lowest */ -static void sort_constraints(TCGOpDef *def, int start, int n) +static void sort_constraints(TCGArgConstraint *a, int start, int n) { int i, j; - TCGArgConstraint *a = def->args_ct; for (i = 0; i < n; i++) { a[start + i].sort_index = start + i; @@ -3177,8 +3162,8 @@ static void sort_constraints(TCGOpDef *def, int start, int n) } for (i = 0; i < n - 1; i++) { for (j = i + 1; j < n; j++) { - int p1 = get_constraint_priority(def, a[start + i].sort_index); - int p2 = get_constraint_priority(def, a[start + j].sort_index); + int p1 = get_constraint_priority(a, a[start + i].sort_index); + int p2 = get_constraint_priority(a, a[start + j].sort_index); if (p1 < p2) { int tmp = a[start + i].sort_index; a[start + i].sort_index = a[start + j].sort_index; @@ -3188,57 +3173,39 @@ static void sort_constraints(TCGOpDef *def, int start, int n) } } +static const TCGArgConstraint empty_cts[TCG_MAX_OP_ARGS]; +static TCGArgConstraint all_cts[ARRAY_SIZE(constraint_sets)][TCG_MAX_OP_ARGS]; + static void process_op_defs(TCGContext *s) { - TCGOpcode op; - - for (op = 0; op < NB_OPS; op++) { - TCGOpDef *def = &tcg_op_defs[op]; - const TCGTargetOpDef *tdefs; + for (size_t c = 0; c < ARRAY_SIZE(constraint_sets); ++c) { + const TCGConstraintSet *tdefs = &constraint_sets[c]; + TCGArgConstraint *args_ct = all_cts[c]; + int nb_oargs = tdefs->nb_oargs; + int nb_iargs = tdefs->nb_iargs; + int nb_args = nb_oargs + nb_iargs; bool saw_alias_pair = false; - int i, o, i2, o2, nb_args; - TCGConstraintSetIndex con_set; - if (def->flags & TCG_OPF_NOT_PRESENT) { - continue; - } - - nb_args = def->nb_iargs + def->nb_oargs; - if (nb_args == 0) { - continue; - } - - /* - * Macro magic should make it impossible, but double-check that - * the array index is in range. At the same time, double-check - * that the opcode is implemented, i.e. not C_NotImplemented. - */ - con_set = tcg_target_op_def(op); - tcg_debug_assert(con_set >= 0 && con_set < ARRAY_SIZE(constraint_sets)); - tdefs = &constraint_sets[con_set]; - - for (i = 0; i < nb_args; i++) { + for (int i = 0; i < nb_args; i++) { const char *ct_str = tdefs->args_ct_str[i]; - bool input_p = i >= def->nb_oargs; - - /* Incomplete TCGTargetOpDef entry. */ - tcg_debug_assert(ct_str != NULL); + bool input_p = i >= nb_oargs; + int o; switch (*ct_str) { case '0' ... '9': o = *ct_str - '0'; tcg_debug_assert(input_p); - tcg_debug_assert(o < def->nb_oargs); - tcg_debug_assert(def->args_ct[o].regs != 0); - tcg_debug_assert(!def->args_ct[o].oalias); - def->args_ct[i] = def->args_ct[o]; + tcg_debug_assert(o < nb_oargs); + tcg_debug_assert(args_ct[o].regs != 0); + tcg_debug_assert(!args_ct[o].oalias); + args_ct[i] = args_ct[o]; /* The output sets oalias. */ - def->args_ct[o].oalias = 1; - def->args_ct[o].alias_index = i; + args_ct[o].oalias = 1; + args_ct[o].alias_index = i; /* The input sets ialias. */ - def->args_ct[i].ialias = 1; - def->args_ct[i].alias_index = o; - if (def->args_ct[i].pair) { + args_ct[i].ialias = 1; + args_ct[i].alias_index = o; + if (args_ct[i].pair) { saw_alias_pair = true; } tcg_debug_assert(ct_str[1] == '\0'); @@ -3246,41 +3213,41 @@ static void process_op_defs(TCGContext *s) case '&': tcg_debug_assert(!input_p); - def->args_ct[i].newreg = true; + args_ct[i].newreg = true; ct_str++; break; case 'p': /* plus */ /* Allocate to the register after the previous. */ - tcg_debug_assert(i > (input_p ? def->nb_oargs : 0)); + tcg_debug_assert(i > (input_p ? nb_oargs : 0)); o = i - 1; - tcg_debug_assert(!def->args_ct[o].pair); - tcg_debug_assert(!def->args_ct[o].ct); - def->args_ct[i] = (TCGArgConstraint){ + tcg_debug_assert(!args_ct[o].pair); + tcg_debug_assert(!args_ct[o].ct); + args_ct[i] = (TCGArgConstraint){ .pair = 2, .pair_index = o, - .regs = def->args_ct[o].regs << 1, - .newreg = def->args_ct[o].newreg, + .regs = args_ct[o].regs << 1, + .newreg = args_ct[o].newreg, }; - def->args_ct[o].pair = 1; - def->args_ct[o].pair_index = i; + args_ct[o].pair = 1; + args_ct[o].pair_index = i; tcg_debug_assert(ct_str[1] == '\0'); continue; case 'm': /* minus */ /* Allocate to the register before the previous. */ - tcg_debug_assert(i > (input_p ? def->nb_oargs : 0)); + tcg_debug_assert(i > (input_p ? nb_oargs : 0)); o = i - 1; - tcg_debug_assert(!def->args_ct[o].pair); - tcg_debug_assert(!def->args_ct[o].ct); - def->args_ct[i] = (TCGArgConstraint){ + tcg_debug_assert(!args_ct[o].pair); + tcg_debug_assert(!args_ct[o].ct); + args_ct[i] = (TCGArgConstraint){ .pair = 1, .pair_index = o, - .regs = def->args_ct[o].regs >> 1, - .newreg = def->args_ct[o].newreg, + .regs = args_ct[o].regs >> 1, + .newreg = args_ct[o].newreg, }; - def->args_ct[o].pair = 2; - def->args_ct[o].pair_index = i; + args_ct[o].pair = 2; + args_ct[o].pair_index = i; tcg_debug_assert(ct_str[1] == '\0'); continue; } @@ -3288,16 +3255,16 @@ static void process_op_defs(TCGContext *s) do { switch (*ct_str) { case 'i': - def->args_ct[i].ct |= TCG_CT_CONST; + args_ct[i].ct |= TCG_CT_CONST; break; /* Include all of the target-specific constraints. */ #undef CONST #define CONST(CASE, MASK) \ - case CASE: def->args_ct[i].ct |= MASK; break; + case CASE: args_ct[i].ct |= MASK; break; #define REGS(CASE, MASK) \ - case CASE: def->args_ct[i].regs |= MASK; break; + case CASE: args_ct[i].regs |= MASK; break; #include "tcg-target-con-str.h" @@ -3308,15 +3275,12 @@ static void process_op_defs(TCGContext *s) case '&': case 'p': case 'm': - /* Typo in TCGTargetOpDef constraint. */ + /* Typo in TCGConstraintSet constraint. */ g_assert_not_reached(); } } while (*++ct_str != '\0'); } - /* TCGTargetOpDef entry with too much information? */ - tcg_debug_assert(i == TCG_MAX_OP_ARGS || tdefs->args_ct_str[i] == NULL); - /* * Fix up output pairs that are aliased with inputs. * When we created the alias, we copied pair from the output. @@ -3337,51 +3301,53 @@ static void process_op_defs(TCGContext *s) * first output to pair=3, and the pair_index'es to match. */ if (saw_alias_pair) { - for (i = def->nb_oargs; i < nb_args; i++) { + for (int i = nb_oargs; i < nb_args; i++) { + int o, o2, i2; + /* * Since [0-9pm] must be alone in the constraint string, * the only way they can both be set is if the pair comes * from the output alias. */ - if (!def->args_ct[i].ialias) { + if (!args_ct[i].ialias) { continue; } - switch (def->args_ct[i].pair) { + switch (args_ct[i].pair) { case 0: break; case 1: - o = def->args_ct[i].alias_index; - o2 = def->args_ct[o].pair_index; - tcg_debug_assert(def->args_ct[o].pair == 1); - tcg_debug_assert(def->args_ct[o2].pair == 2); - if (def->args_ct[o2].oalias) { + o = args_ct[i].alias_index; + o2 = args_ct[o].pair_index; + tcg_debug_assert(args_ct[o].pair == 1); + tcg_debug_assert(args_ct[o2].pair == 2); + if (args_ct[o2].oalias) { /* Case 1a */ - i2 = def->args_ct[o2].alias_index; - tcg_debug_assert(def->args_ct[i2].pair == 2); - def->args_ct[i2].pair_index = i; - def->args_ct[i].pair_index = i2; + i2 = args_ct[o2].alias_index; + tcg_debug_assert(args_ct[i2].pair == 2); + args_ct[i2].pair_index = i; + args_ct[i].pair_index = i2; } else { /* Case 1b */ - def->args_ct[i].pair_index = i; + args_ct[i].pair_index = i; } break; case 2: - o = def->args_ct[i].alias_index; - o2 = def->args_ct[o].pair_index; - tcg_debug_assert(def->args_ct[o].pair == 2); - tcg_debug_assert(def->args_ct[o2].pair == 1); - if (def->args_ct[o2].oalias) { + o = args_ct[i].alias_index; + o2 = args_ct[o].pair_index; + tcg_debug_assert(args_ct[o].pair == 2); + tcg_debug_assert(args_ct[o2].pair == 1); + if (args_ct[o2].oalias) { /* Case 1a */ - i2 = def->args_ct[o2].alias_index; - tcg_debug_assert(def->args_ct[i2].pair == 1); - def->args_ct[i2].pair_index = i; - def->args_ct[i].pair_index = i2; + i2 = args_ct[o2].alias_index; + tcg_debug_assert(args_ct[i2].pair == 1); + args_ct[i2].pair_index = i; + args_ct[i].pair_index = i2; } else { /* Case 2 */ - def->args_ct[i].pair = 3; - def->args_ct[o2].pair = 3; - def->args_ct[i].pair_index = o2; - def->args_ct[o2].pair_index = i; + args_ct[i].pair = 3; + args_ct[o2].pair = 3; + args_ct[i].pair_index = o2; + args_ct[o2].pair_index = i; } break; default: @@ -3391,8 +3357,40 @@ static void process_op_defs(TCGContext *s) } /* sort the constraints (XXX: this is just an heuristic) */ - sort_constraints(def, 0, def->nb_oargs); - sort_constraints(def, def->nb_oargs, def->nb_iargs); + sort_constraints(args_ct, 0, nb_oargs); + sort_constraints(args_ct, nb_oargs, nb_iargs); + } + + for (TCGOpcode op = 0; op < NB_OPS; op++) { + TCGOpDef *def = &tcg_op_defs[op]; + const TCGConstraintSet *tdefs; + TCGConstraintSetIndex con_set; + int nb_args; + + nb_args = def->nb_iargs + def->nb_oargs; + if (nb_args == 0) { + continue; + } + + if (def->flags & TCG_OPF_NOT_PRESENT) { + def->args_ct = empty_cts; + continue; + } + + /* + * Macro magic should make it impossible, but double-check that + * the array index is in range. At the same time, double-check + * that the opcode is implemented, i.e. not C_NotImplemented. + */ + con_set = tcg_target_op_def(op); + tcg_debug_assert(con_set >= 0 && con_set < ARRAY_SIZE(constraint_sets)); + + /* The constraint arguments must match TCGOpcode arguments. */ + tdefs = &constraint_sets[con_set]; + tcg_debug_assert(tdefs->nb_oargs == def->nb_oargs); + tcg_debug_assert(tdefs->nb_iargs == def->nb_iargs); + + def->args_ct = all_cts[con_set]; } } From patchwork Fri Jan 17 18:24:25 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858217 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp842153wrb; Fri, 17 Jan 2025 10:26:47 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCV4hoXAtuWOfrdKbOm6Sch/tecAIUiaE+Qqx6tEOxURbCqzmbUDQbghxSZ3/JPPFo3tj7FgzQ==@linaro.org X-Google-Smtp-Source: AGHT+IFjJSMH39nrOW4aaoj6FOW0NxG5Wp7s/JWfmwxJ0L7+m1/uMJNKx5VH9cyAIZMNo4ZMDFfO X-Received: by 2002:a05:620a:4447:b0:7b8:626b:7ab with SMTP id af79cd13be357-7be6321c119mr618501285a.19.1737138406870; Fri, 17 Jan 2025 10:26:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138406; cv=none; d=google.com; s=arc-20240605; b=jNDEHyIyL47BQAGCWmgagQgm/lbyUjqzoTrN+JxyXGIiR8Z81yCYgcd7dJx0oBseUw a0FNvzAgzc1975xWyjH2DrHX0ACacbRLiNhSkcG/uJCapy6aXETW1CgvDih0Rieoc7Sw lJxOIuAOUjqGEAFpy14+JXQAxLdO+u0f0PW5DdMtXIxBTPZJvuFNBQHcd6xCJFvTLiXk 32EtowvJdux3LnFjz8PCtaq4s22J6mcchkHl/1Jzf+T1+jg/FWH07MYYFALXLZm5oB/x iHZszmlmNkiXKr2EYFyzoBOrmLUvtQE3Urly8e0vj5hVcej3oPuzYdAIv7uOBf0yEFQk yadA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=hZKhK0VW7EkxUROV1Mw2sNMrRo2GVhvDfIPbGj8+yGM=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=L5gq8WouV5CEc3l+1u7iltR5sZLGHhUE6d7MbMRh8xd5gShPSFCj2GzAK9Rs5f7pBR u1bhY+z7rv0VunzN7dBGqMIRGoPmKC8pDONXN3Rt2ZnhIg1gmhR6VAe5eQ29pvjsoAhO pikXZN7fxKrrK4Pj0DGXhYzlJgO+Y87uo5MqmoI2aTUTdbZi+f+19Qg/QhovP7CUamA8 9PyIboCFrYZVSdz9dZ3q62cQ19iQ/Z+WC/NnnJVkECS/nsqLGqXsHvHI1ejUR5Mno8Uh y3dsSHypuCyaw1Dbd++A76SxH496NLOdkq879LFNeJPn2Syv9AWqLJxS4rRb77PLFAqN WVXA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="kxs/3aUv"; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7be614ca5d7si394020685a.342.2025.01.17.10.26.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:26:46 -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="kxs/3aUv"; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr2N-0004C0-S2; Fri, 17 Jan 2025 13:25:43 -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 1tYr2B-0004Av-P5 for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:32 -0500 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 1tYr29-0007vd-IC for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:31 -0500 Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-2164b662090so47461115ad.1 for ; Fri, 17 Jan 2025 10:25:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138328; x=1737743128; 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=hZKhK0VW7EkxUROV1Mw2sNMrRo2GVhvDfIPbGj8+yGM=; b=kxs/3aUvMt+j/7V3pKAJl462xfS1Ru+9X/3po9ZZdSUqcljWSjH4GO77RPXClhCjFD 5ry0FVFjNtr6uVkL/iceClsuH6Mlvu/7A2VrnSDoIteu1Q5m3pMU55MrguCihIg0fO+V +RCbsYDpWfTkYknSIZdiJk7cwTtbg4B7Ng2110CE3YpY53Ca3AQ6ebo7v3BxOv5vYv4H q8hFVXk+UwxbcQVb09db8BnNzyB3ghf6LpDwzoh8FddJhmnfIZBuPoOr7pl1JY+DvdEo 0TH/dCLyrifI4w4SFHhIYMpukM9jKv9HeeSCsnwcrR9/1xq761YtYC7GvNvG8u7+vQDY kVZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138328; x=1737743128; 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=hZKhK0VW7EkxUROV1Mw2sNMrRo2GVhvDfIPbGj8+yGM=; b=hM9anJ3Y13rcNEjC4ilNvpUtM7yrya1dXx7KK6m+eyP1p/sNc3DSBMowTZL8cEQiCv 1Dl2slpAX8E5lkQGR5ABGyk3JP/al6n0nNUWr82DTP/ytwQIyTVRjfxkgCbeE1VpYxq5 aujaux+/sL2/hxvcjZE2WUgp4Vr3gxN5uPGtYsE3qNaTHlbMKntFt3cfZSlFOtgPIqO6 hRslPTFOwXMTAk5wRXHobRiy9UxLqxq7+UgBboFn6AdniONk+jV1m/y95uGvgGZ1XnRd pvM4hb8O+YYx3Nbdmr8xnv0UehmqcArw4fDIYkv5qCmUZBTvajQxegCZEyrMTNb5YBKu Xl/g== X-Gm-Message-State: AOJu0YwfY3rd5+to6xccwewJ8HMelqSxds3kmwfsU0TRLD2kXtOCPuTp urGpBT0VWlYyGv1jFiD1E0/A/lXxjvyzSUAgbPJHy52ryYfHfjaeqrTPHsLEcY+WCRYrMl91fGf + X-Gm-Gg: ASbGncsEb2NFbL/GB5j/G0ngYzbUCqI7j8wHQju66EgklhXSg1R9l6bXwsfg67gkst+ PfIXFlkgGGdoYdfcuJciTMYMs0+WoeBzsrN20gmNdbqaWs8vcqJYzyJBA1hJinjevUJHoAmrDc9 VIHd4hhVtlpJTozv6ZUSh3VdkIBqLw8TGwxDJMXNNtDh5yM3Ttp8pQWE9niJQQeZqBqGCOSISRR T0RjfdIBMCeFcl1h7BcZeibdnDF3Ly5eIg4MI21UK3bpZwl6diJT8fIbHWNZoPL44pVMM6mExv1 cgumpBdeeKM4+iM= X-Received: by 2002:a17:902:e548:b0:216:60a3:b3fd with SMTP id d9443c01a7336-21c351d345amr45013705ad.3.1737138328217; Fri, 17 Jan 2025 10:25:28 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21c2d3acccesm18879005ad.123.2025.01.17.10.25.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:25:26 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 37/68] tcg: Remove args_ct from TCGOpDef Date: Fri, 17 Jan 2025 10:24:25 -0800 Message-ID: <20250117182456.2077110-38-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Introduce a new function, opcode_args_ct, to look up the argument set for an opcode. We lose the ability to assert the correctness of the map from TCGOpcode to constraint sets at startup, but we can still validate at runtime upon lookup. Rename process_op_defs to process_constraint_sets, as it now does nothing to TCGOpDef. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/tcg/tcg.h | 1 - tcg/tcg-common.c | 2 +- tcg/tcg.c | 82 ++++++++++++++++++++++------------------------- 3 files changed, 40 insertions(+), 45 deletions(-) diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h index a02de82508..e28894c57b 100644 --- a/include/tcg/tcg.h +++ b/include/tcg/tcg.h @@ -714,7 +714,6 @@ typedef struct TCGOpDef { const char *name; uint8_t nb_oargs, nb_iargs, nb_cargs, nb_args; uint8_t flags; - const TCGArgConstraint *args_ct; } TCGOpDef; extern TCGOpDef tcg_op_defs[]; diff --git a/tcg/tcg-common.c b/tcg/tcg-common.c index fadc33c3d1..0f30e5b3ec 100644 --- a/tcg/tcg-common.c +++ b/tcg/tcg-common.c @@ -28,7 +28,7 @@ TCGOpDef tcg_op_defs[] = { #define DEF(s, oargs, iargs, cargs, flags) \ - { #s, oargs, iargs, cargs, iargs + oargs + cargs, flags, NULL }, + { #s, oargs, iargs, cargs, iargs + oargs + cargs, flags }, #include "tcg/tcg-opc.h" #undef DEF }; diff --git a/tcg/tcg.c b/tcg/tcg.c index d5ab0abe9d..df7c4dab88 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -1496,7 +1496,7 @@ static void init_call_layout(TCGHelperInfo *info) } static int indirect_reg_alloc_order[ARRAY_SIZE(tcg_target_reg_alloc_order)]; -static void process_op_defs(TCGContext *s); +static void process_constraint_sets(void); static TCGTemp *tcg_global_reg_new_internal(TCGContext *s, TCGType type, TCGReg reg, const char *name); @@ -1517,7 +1517,7 @@ static void tcg_context_init(unsigned max_cpus) init_call_layout(&info_helper_st128_mmu); tcg_target_init(s); - process_op_defs(s); + process_constraint_sets(); /* Reverse the order of the saved registers, assuming they're all at the start of tcg_target_reg_alloc_order. */ @@ -3176,7 +3176,7 @@ static void sort_constraints(TCGArgConstraint *a, int start, int n) static const TCGArgConstraint empty_cts[TCG_MAX_OP_ARGS]; static TCGArgConstraint all_cts[ARRAY_SIZE(constraint_sets)][TCG_MAX_OP_ARGS]; -static void process_op_defs(TCGContext *s) +static void process_constraint_sets(void) { for (size_t c = 0; c < ARRAY_SIZE(constraint_sets); ++c) { const TCGConstraintSet *tdefs = &constraint_sets[c]; @@ -3360,38 +3360,28 @@ static void process_op_defs(TCGContext *s) sort_constraints(args_ct, 0, nb_oargs); sort_constraints(args_ct, nb_oargs, nb_iargs); } +} - for (TCGOpcode op = 0; op < NB_OPS; op++) { - TCGOpDef *def = &tcg_op_defs[op]; - const TCGConstraintSet *tdefs; - TCGConstraintSetIndex con_set; - int nb_args; +static const TCGArgConstraint *opcode_args_ct(const TCGOp *op) +{ + TCGOpDef *def = &tcg_op_defs[op->opc]; + TCGConstraintSetIndex con_set; - nb_args = def->nb_iargs + def->nb_oargs; - if (nb_args == 0) { - continue; - } - - if (def->flags & TCG_OPF_NOT_PRESENT) { - def->args_ct = empty_cts; - continue; - } - - /* - * Macro magic should make it impossible, but double-check that - * the array index is in range. At the same time, double-check - * that the opcode is implemented, i.e. not C_NotImplemented. - */ - con_set = tcg_target_op_def(op); - tcg_debug_assert(con_set >= 0 && con_set < ARRAY_SIZE(constraint_sets)); - - /* The constraint arguments must match TCGOpcode arguments. */ - tdefs = &constraint_sets[con_set]; - tcg_debug_assert(tdefs->nb_oargs == def->nb_oargs); - tcg_debug_assert(tdefs->nb_iargs == def->nb_iargs); - - def->args_ct = all_cts[con_set]; + if (def->nb_iargs + def->nb_oargs == 0) { + return NULL; } + if (def->flags & TCG_OPF_NOT_PRESENT) { + return empty_cts; + } + + con_set = tcg_target_op_def(op->opc); + tcg_debug_assert(con_set >= 0 && con_set < ARRAY_SIZE(constraint_sets)); + + /* The constraint arguments must match TCGOpcode arguments. */ + tcg_debug_assert(constraint_sets[con_set].nb_oargs == def->nb_oargs); + tcg_debug_assert(constraint_sets[con_set].nb_iargs == def->nb_iargs); + + return all_cts[con_set]; } static void remove_label_use(TCGOp *op, int idx) @@ -3864,6 +3854,7 @@ liveness_pass_1(TCGContext *s) TCGTemp *ts; TCGOpcode opc = op->opc; const TCGOpDef *def = &tcg_op_defs[opc]; + const TCGArgConstraint *args_ct; switch (opc) { case INDEX_op_call: @@ -4153,8 +4144,9 @@ liveness_pass_1(TCGContext *s) break; default: + args_ct = opcode_args_ct(op); for (i = nb_oargs; i < nb_oargs + nb_iargs; i++) { - const TCGArgConstraint *ct = &def->args_ct[i]; + const TCGArgConstraint *ct = &args_ct[i]; TCGRegSet set, *pset; ts = arg_temp(op->args[i]); @@ -4941,6 +4933,7 @@ static void tcg_reg_alloc_dup(TCGContext *s, const TCGOp *op) { const TCGLifeData arg_life = op->life; TCGRegSet dup_out_regs, dup_in_regs; + const TCGArgConstraint *dup_args_ct; TCGTemp *its, *ots; TCGType itype, vtype; unsigned vece; @@ -4967,8 +4960,9 @@ static void tcg_reg_alloc_dup(TCGContext *s, const TCGOp *op) return; } - dup_out_regs = tcg_op_defs[INDEX_op_dup_vec].args_ct[0].regs; - dup_in_regs = tcg_op_defs[INDEX_op_dup_vec].args_ct[1].regs; + dup_args_ct = opcode_args_ct(op); + dup_out_regs = dup_args_ct[0].regs; + dup_in_regs = dup_args_ct[1].regs; /* Allocate the output register now. */ if (ots->val_type != TEMP_VAL_REG) { @@ -5054,6 +5048,7 @@ static void tcg_reg_alloc_op(TCGContext *s, const TCGOp *op) int i, k, nb_iargs, nb_oargs; TCGReg reg; TCGArg arg; + const TCGArgConstraint *args_ct; const TCGArgConstraint *arg_ct; TCGTemp *ts; TCGArg new_args[TCG_MAX_OP_ARGS]; @@ -5098,6 +5093,8 @@ static void tcg_reg_alloc_op(TCGContext *s, const TCGOp *op) break; } + args_ct = opcode_args_ct(op); + /* satisfy input constraints */ for (k = 0; k < nb_iargs; k++) { TCGRegSet i_preferred_regs, i_required_regs; @@ -5105,9 +5102,9 @@ static void tcg_reg_alloc_op(TCGContext *s, const TCGOp *op) TCGTemp *ts2; int i1, i2; - i = def->args_ct[nb_oargs + k].sort_index; + i = args_ct[nb_oargs + k].sort_index; arg = op->args[i]; - arg_ct = &def->args_ct[i]; + arg_ct = &args_ct[i]; ts = arg_temp(arg); if (ts->val_type == TEMP_VAL_CONST @@ -5137,7 +5134,7 @@ static void tcg_reg_alloc_op(TCGContext *s, const TCGOp *op) * register and move it. */ if (temp_readonly(ts) || !IS_DEAD_ARG(i) - || def->args_ct[arg_ct->alias_index].newreg) { + || args_ct[arg_ct->alias_index].newreg) { allocate_new_reg = true; } else if (ts->val_type == TEMP_VAL_REG) { /* @@ -5322,10 +5319,10 @@ static void tcg_reg_alloc_op(TCGContext *s, const TCGOp *op) } /* satisfy the output constraints */ - for(k = 0; k < nb_oargs; k++) { - i = def->args_ct[k].sort_index; + for (k = 0; k < nb_oargs; k++) { + i = args_ct[k].sort_index; arg = op->args[i]; - arg_ct = &def->args_ct[i]; + arg_ct = &args_ct[i]; ts = arg_temp(arg); /* ENV should not be modified. */ @@ -5465,8 +5462,7 @@ static bool tcg_reg_alloc_dup2(TCGContext *s, const TCGOp *op) /* Allocate the output register now. */ if (ots->val_type != TEMP_VAL_REG) { TCGRegSet allocated_regs = s->reserved_regs; - TCGRegSet dup_out_regs = - tcg_op_defs[INDEX_op_dup_vec].args_ct[0].regs; + TCGRegSet dup_out_regs = opcode_args_ct(op)[0].regs; TCGReg oreg; /* Make sure to not spill the input registers. */ From patchwork Fri Jan 17 18:24:26 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858272 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp845428wrb; Fri, 17 Jan 2025 10:34:17 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU9tQhJMGlR3/SbfboAVt0p4OyySDl5ntF+idFDBsUkCZD+xN3BVgzFWuBaTc2xzwsHthb/OA==@linaro.org X-Google-Smtp-Source: AGHT+IFHhEMUhIIQRUOVhxLq0Ehlm7Gp/dO5q6YBgG4fh2oIc6ZJUilwU8HYmKnJwiTpShQwRVcW X-Received: by 2002:ad4:576c:0:b0:6d8:adb8:4012 with SMTP id 6a1803df08f44-6e1b225054cmr59140026d6.45.1737138857625; Fri, 17 Jan 2025 10:34:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138857; cv=none; d=google.com; s=arc-20240605; b=B9kTheSmrgvAik8WvitFtMN5Gp7Hw2wDDzBQb7FrTgp33wK9ED7bFizpD9MUWU9UMM NMVuK3RsetMoeY69iAG+FFy2Kj0HinCEiX6qjTpRfVHFsLnuNOex0GvXrCEIEqiBBzX5 MrQ/YwGiDXDqt3gUvKQSm40J5TX2++wfYkU38p8bdHFAXC/w8GeNhPzFAjPG8Rsgd303 4W8CCOD5wDskLl0CEp2MmmcMPIc5dISujo0JYUWTXBafg5D3Tc4/uaHoJxdsGoL85lLx C4CD6NIBSlDfG6Ccz4cUh7YHoFbOb+cVGlJJsNOhvc9gpjl7W6/zMQgVXvYfkfiEbZSt 9C8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=VP0y8NpW/X+aOIiXkj/XmIYJ8qwvnfqBp4uvWUSussY=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=knuWEqQWrI71VUX4rx2zzOxpFvNqd+e3etArR0fKKeKtUYTTyRSEUFLSU/5tFY3gwK 9myRKZgU5kV6ZwDhZsk5KpqHMAIRs+UAwkgKrySX10XKXOOz2P5pQt/c9jj+NKJeE9Rn z2HmBFAaOl28m1XcFUsAMqkPrceY5E0L0GANz++bgmJomV1aLPsm8FYrihwze80qTiw3 Kqlr5nDGH4d/DL8JE9MLehcpeDrYqoxAYmykPJtbKewo9YC9Cihtkkjh3LubPy3Oc5KX axxBHPueuiONIqaVU/sRIl8kXfmhDdA96GJFRxUAiBeBp4p1qsgCffWQkZPL09oMLCiJ 8sjA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kakt6d6G; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46e1048a673si32304851cf.506.2025.01.17.10.34.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:34:17 -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=kakt6d6G; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr2R-0004Ym-0C; Fri, 17 Jan 2025 13:25:47 -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 1tYr2D-0004B6-53 for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:34 -0500 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr2B-0007vy-HI for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:32 -0500 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-2165cb60719so46223415ad.0 for ; Fri, 17 Jan 2025 10:25:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138330; x=1737743130; 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=VP0y8NpW/X+aOIiXkj/XmIYJ8qwvnfqBp4uvWUSussY=; b=kakt6d6GTdBxbVn6pw/B8pJKlL52PH7wC31G2gD2uixlo+J2mOtfowD7CLXyVrFd9i UuEbaeQjdIVbW+g3gavvIn8RkfTT855QWY66KMxUX/2HvIBhd3cGILYqOot83qUraXEn nTl4OyxDy9P1q9kUtNMIyptTmdKzcOAcqzfwfKst+5aPYGtgbhvtyyyt2dOpa+WMiNQr tDCNCUM6X9fzeFDuj0n2GOu7D09qCh8oP/McLOsQBEc+hrUR2SLz4fRBCggT7XkYh9Bm iZ+yv54v5YcJJvfqglR9rF84+Nx/mKAlG4JH6FMs7zN6WE8AaiaQFIzGML0PHt2KdJYl /geA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138330; x=1737743130; 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=VP0y8NpW/X+aOIiXkj/XmIYJ8qwvnfqBp4uvWUSussY=; b=Y1gMyxGbD9LrjCpZgrFs7Pcn2UWiVqt1zC96DCN9wqppBPi/PA/3bFmqZdUet8aBqU ihgrWLVVc2yGV+N2Qa5bTM3UdumJlqxko49v5yQKUaJ6HHj3nvUReOvgddBFXshqOwJK uFFgIobFbRfXCZ9DH3xjU+Hq6dppQm6ocbA32gb888ZaWnj0YI6fwfoWCSGjgnmFrHwA Qm1siobBaKPZyVqvG8sU1viyGcKKjiNcI3uRaDkk7NbQ7tEQWuls7qaxRGSHuVu3lsys MtAZDrBGI6RxbiM1OiHsnBQQz5gmJpM1up0EZnKspq60uAlAg2C77DVyPG8n4VHWhb8v oOEQ== X-Gm-Message-State: AOJu0YzUyffIuKENXRoHbEMorlZfjDq7D3Gl9TP/F0XcmxiuN9N2ueLR 3+HQTA3TjyI5/v/TbNWa7hCKcZeWmGFMEyYWr50k8d0QxeLIW2oef7AEz+6+aTeYzD2eIrEWM/u S X-Gm-Gg: ASbGncvqUskYrfInqe8VDYJmJujNjLmKHhSyju7am8z+nnAx1g6JJdveriKAeQeDySc 76mOu/dqPN79D0Hl5E+F2rhvVKDUnwACIgEheuhm8PYPuAjbkTWHiMfOWGpIHt/MnNE/C1UpkrG Pd81+JrGsGs25db44Jt2pGqlbPs86PjcNPosAEEm3Zqlzxtae+YFARDzvwzNz7pfxyCf6v1mb6q EdHS8cKJf3qvANMUfR/EofMWPAnTLL/N92t4oCIZt/OhSXtWBRd0pI+9hk6t/jJgOIY/vkDgZr1 swtmCHdOdCBVIEE= X-Received: by 2002:a17:903:2447:b0:215:8ca3:3bac with SMTP id d9443c01a7336-21c3540278dmr54210745ad.16.1737138329848; Fri, 17 Jan 2025 10:25:29 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21c2d3acccesm18879005ad.123.2025.01.17.10.25.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:25:28 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 38/68] tcg: Constify tcg_op_defs Date: Fri, 17 Jan 2025 10:24:26 -0800 Message-ID: <20250117182456.2077110-39-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x632.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 Now that we're no longer assigning to TCGOpDef.args_ct, we can make the array constant. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/tcg/tcg.h | 2 +- tcg/tcg-common.c | 2 +- tcg/tcg.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h index e28894c57b..a4630e44bc 100644 --- a/include/tcg/tcg.h +++ b/include/tcg/tcg.h @@ -716,7 +716,7 @@ typedef struct TCGOpDef { uint8_t flags; } TCGOpDef; -extern TCGOpDef tcg_op_defs[]; +extern const TCGOpDef tcg_op_defs[]; extern const size_t tcg_op_defs_max; /* diff --git a/tcg/tcg-common.c b/tcg/tcg-common.c index 0f30e5b3ec..e98b3e5fdd 100644 --- a/tcg/tcg-common.c +++ b/tcg/tcg-common.c @@ -26,7 +26,7 @@ #include "tcg/tcg.h" #include "tcg-has.h" -TCGOpDef tcg_op_defs[] = { +const TCGOpDef tcg_op_defs[] = { #define DEF(s, oargs, iargs, cargs, flags) \ { #s, oargs, iargs, cargs, iargs + oargs + cargs, flags }, #include "tcg/tcg-opc.h" diff --git a/tcg/tcg.c b/tcg/tcg.c index df7c4dab88..32975fe298 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -3364,7 +3364,7 @@ static void process_constraint_sets(void) static const TCGArgConstraint *opcode_args_ct(const TCGOp *op) { - TCGOpDef *def = &tcg_op_defs[op->opc]; + const TCGOpDef *def = &tcg_op_defs[op->opc]; TCGConstraintSetIndex con_set; if (def->nb_iargs + def->nb_oargs == 0) { From patchwork Fri Jan 17 18:24:27 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858277 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp845780wrb; Fri, 17 Jan 2025 10:35:10 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVA5W0RqeQKKgPotZBbBi32eb4GdblPj/2VxgUpMn8X7Ylz5ZCD7WTQ2f5E3uYiFgmCJOTW1g==@linaro.org X-Google-Smtp-Source: AGHT+IGpJ2cfzwpjUgFZu/j3hBdxQoNFjebW8EZu9gksyVimI2z5VqnMmWLaYpAFBsCsZxKwRTM6 X-Received: by 2002:ac8:5791:0:b0:466:91f3:12ca with SMTP id d75a77b69052e-46df56776ebmr172293601cf.8.1737138910519; Fri, 17 Jan 2025 10:35:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138910; cv=none; d=google.com; s=arc-20240605; b=kcWv9ZjuSzbx9mSiejAVP44ommXqRvFA90c+RjCFoOGL5tVmx1ManaQZs1oOf/oHdV 3K13M/cUH5uRxDMfQc6nEhmqNogtyXWYW7TFsycXsaTKpKBoC2B+PhBhvoLJ8nQpLg0w 4Cdryc+ud04Pr/EOe1nN5DitmLGaBjKetB/71taoPyvBnMOC1vV+ymVRiR2c6MvV9GAH N9T3tr+YDgU0StyIpru/j+hI8+mjfeQjxwglDicrAHvy14pBp4B9wL3lkYCaixlnfjBS 0ezW4hCDZ6yICkOq2cXK3acAJkFOKZ/8llmDAu8lUU2aGn4XxwMYh+uBcirpcxaRVT6G MvuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=i1SIeY37CMzXA5XDrmfkkdr3FnSIL/bvtLXVM8kBUK0=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=RceJozY3mXDQN3w3ASfQddXcpBI/qVp7+UE0rSCPKAcMNUCxFgSVPsGykYqy/JVUBh CJ3FvzZ+KUOXec0OOuXGzMMpwSxLoPiemAtXL9bha26I0vu7ejby7zJhv6DswZm1o9XG RwWDTM1jzPnB/kCZvZ/Xp1uw7+VhxD/WcrgCGM4iorOMFWaSj0XNliHGpI3aQ7C9BRNx IKtca8WjMgsRZrxPGdj7zPBZVrA4LIqYrKhd1i6VuHKDvMMcCP1j7NZdNzw5PIxJZOTI bSdJigHaCtYYBu5zLzuPL7S7sR1t15neHWHktlxGmv5tR1Ecn78T3BqYT165Iiaxf6wY 8ZmA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eroRHQNf; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6e1afc1b0cdsi30475086d6.149.2025.01.17.10.35.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:35:10 -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=eroRHQNf; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr2R-0004aI-6h; Fri, 17 Jan 2025 13:25:47 -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 1tYr2G-0004BW-05 for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:36 -0500 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr2E-0007wI-Gn for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:25:35 -0500 Received: by mail-pj1-x1034.google.com with SMTP id 98e67ed59e1d1-2ee50ffcf14so5847523a91.0 for ; Fri, 17 Jan 2025 10:25:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138333; x=1737743133; 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=i1SIeY37CMzXA5XDrmfkkdr3FnSIL/bvtLXVM8kBUK0=; b=eroRHQNfz40Ep5kdbR0ThLy+2PLQgUDM4eNtwQ0e56i7T8IwgMnlOaEZ0Y6xrM/PqH mzutK51ZmFmV4KrUVg9EkYzmpx8KtjDdCOsfup3VMyiipIJ9EyogIgEfLHVeNMqahAdr Y3UZY27ChkNi8Tn3md9xKwSjiL7bPnDapue4RYsQCUQc4DoR3vRDvs+7c6O2AQhR/kcl dVL52lW9hMcIAq3EroJCxz9ZOIbQI5MzqEaEBizQiXdhZzUS8UvqRn0sIOpY2MgkoVzL 0PRcS7oGKPI3BlL9R7FHbiBxaW04MijhqOv6FSpG1pauvWnzvnj3RSdtfyQmw6G2hp/r QTVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138333; x=1737743133; 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=i1SIeY37CMzXA5XDrmfkkdr3FnSIL/bvtLXVM8kBUK0=; b=dP1SQ7BG3gsGrFHODfPV79WfSfLQGyzXi1muIhPYr6En8/Hf0vKoLmKLTWamzs6IMY ufScGtfoRHURKY0OrpXK0jQsau0aRKxdBMCrb1kG7qr8WyJda3omaMbnhQEWZb8ZcfJL T3NfrWGasbjH3F/GbNs3k9nmLcCWg6FdJT1QpjxD7T9HiWbuTkcCWBtaDaG0jGZsmlqd IWwTKJEOqJur0aubzHhKpJpROMYzIaR6A6IkQHe+wzMvPgPyAd53gN1NMYtX3/RSOWsS TmOQK4NUuF0HEvDgnvvcaBGL93/xEfuujUEufV91BDq4ZS0956cJ1cgbXLPm/GBy7m59 7yNg== X-Gm-Message-State: AOJu0Yw5w4VJLkftSzrBMWejaaj6JCemuuvCEkejXNv7wSnxR3r+Oq3S ziMMnb2n81KYiOtL2FZLz83W3QM/ex8ZYw+5Ki9sDszetDJ9pf+sM7jBFpeGtcDKd9qT11cAHF5 5 X-Gm-Gg: ASbGncse7y5AiguirvTTwjf7a99EvR4fSd6BNF4soEkJFgBP7HF9ZP4Wyw9IUUHlpx2 NStbnWw/ZoDj6BcZQFOo6+O4h9S8fb06K49vkHrBvx5P2P52Mqc+MqFcLDfa9NexN7K37AQjCMH djMOkjPI98qiaxsxiTyE7RO3IHe1rdc67pswbUvttF5DJ3GIy9pNci8USKhPEln0qkml4VkJXRf 4z1suv5DiGh16Y6J5Z0Swg+TDFP8kKWdAG2DGCc9Jm6fmjTw4XNyJIDy0qKhV/wtCVJye38AEoz eoLebQn2kM2wLs0= X-Received: by 2002:a17:90b:350a:b0:2ef:e063:b3f8 with SMTP id 98e67ed59e1d1-2f728dc0772mr17944409a91.7.1737138331402; Fri, 17 Jan 2025 10:25:31 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21c2d3acccesm18879005ad.123.2025.01.17.10.25.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:25:30 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 39/68] tcg: Validate op supported in opcode_args_ct Date: Fri, 17 Jan 2025 10:24:27 -0800 Message-ID: <20250117182456.2077110-40-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1034; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1034.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 We should have checked that the op is supported before emitting it. The backend cannot be expected to have a constraint set for unsupported ops. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/tcg.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tcg/tcg.c b/tcg/tcg.c index 32975fe298..b9119a1ec7 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -3367,6 +3367,10 @@ static const TCGArgConstraint *opcode_args_ct(const TCGOp *op) const TCGOpDef *def = &tcg_op_defs[op->opc]; TCGConstraintSetIndex con_set; +#ifdef CONFIG_DEBUG_TCG + assert(tcg_op_supported(op->opc, TCGOP_TYPE(op), TCGOP_FLAGS(op))); +#endif + if (def->nb_iargs + def->nb_oargs == 0) { return NULL; } From patchwork Fri Jan 17 18:24:28 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858266 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp845260wrb; Fri, 17 Jan 2025 10:33:54 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWgFmlQv26RcN8UaDAf2lKSip6FZGq+ni8yQZkMCf5Hc6K+TH2sO9kDO6aUPvXmsbtjCrHW4A==@linaro.org X-Google-Smtp-Source: AGHT+IHwVZMGDy29wdlMzzXAamFBfaxbrG8CDIbZr8v3BbeQ9Gfm5QltKbg084RhvVv/d2hU/t3+ X-Received: by 2002:a05:6102:2c88:b0:4b2:cc94:1d6a with SMTP id ada2fe7eead31-4b690ca2b07mr4528529137.19.1737138834500; Fri, 17 Jan 2025 10:33:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138834; cv=none; d=google.com; s=arc-20240605; b=G6nmIVnA8DBv56ZkJC2/KfQ5RTGJ3nzXBV6rPtXEKMM7JUcnWCB/Z+/EeOhTPd7jTN TBplXR2umoAG1E9iW/igC6Iw+RUnnnc+RyR0e+W2TVYblQ6c8s1n33h9qFDZ+I5vE4lv ya7drdN1PqJCEXZS+iulh/1tJBWBmf9/Gt/AsVQMBp9gFiSaK5gx0ZddsR3RpN7YnhSV O4wOnV/kmeXk5hLrZKLKG/3Zapw8ayTCIaU87pn+kV8wZ/g+KDjJ0tY+ygMql/H+6225 atFOsCU7I2xeyqD7Z0Auv3glYCA5ocwU0pewc+XDhMv6USfhegxnCqY0iiM9YPrIsjb4 tGbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=7OmaCO2bufcDc4uzKJ+mlpKa3QcKVund6mv3MhkLwck=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=GVd85IFy0iCIUWY8P/fdEJsltWNKWq/+8dktcfc4AK7BY3D+m/AI2ukrIjnjcNAC4P B0hWxojigfS5SRuknJwVNBL9khfVRb5issp565R2LiTSdPT6J1CwlcQf3aaXuHFVzfN7 OQnmVThsP46DwVIk1CS8oF7AOhntFp5RjCgw26KrYYdUQQFrYHT05DSZgvIgozuUv9yE /U09ThFbj0AQ9pa2toZUEhfrxDvXhKAaXUbVasNDDWiy1PxQncsOd2C3hVXApVRY86g8 i4L6CaauPIlYrMBJkWHXFEvyo8rL5JIPgnhLq1mfPvwBYS5VvfhRQUO9Gqi+J950NVI1 2RiQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Yy4TVRyw; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id a1e0cc1a2514c-8642cac5a6bsi1361613241.76.2025.01.17.10.33.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:33:54 -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=Yy4TVRyw; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr5H-0003pv-O6; Fri, 17 Jan 2025 13:28:43 -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 1tYr5D-0003kI-RJ for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:28:39 -0500 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr58-00004w-NU for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:28:39 -0500 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-2166360285dso49851225ad.1 for ; Fri, 17 Jan 2025 10:28:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138513; x=1737743313; 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=7OmaCO2bufcDc4uzKJ+mlpKa3QcKVund6mv3MhkLwck=; b=Yy4TVRywzbFuyeYccvZjqe6JSWNq/1HsI3Vwyi/WeZ8DpKdZeW8tY4r1R/juuG9g49 j4EzLm+kxJasdu3Kq3XZvS5hNZYJSd1EjwKFj1OAJ3vO+qryxhvSHyR9KUzlWYqS4RMX jgNiHEgRMGwEBSTYuaoSqKxU9FXyrvw5PqUxpfMG3KhAo2+xk11KVELaiM2K+wefprn0 HVq1aQBKPmIf5skidhmf6PRZ7U4xFQwv+dMkGHJggOwdxQLHooKBqpWZgMVNjU0GmoGe WB1lsQwAJj9fIpILZT0vpxRWWUgBq5PM8B0s6YMplwCTbsPtM2WdXq+C+EzI5dsqALYc YGjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138513; x=1737743313; 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=7OmaCO2bufcDc4uzKJ+mlpKa3QcKVund6mv3MhkLwck=; b=tboOCuXpB/XM7oJv2fPv7O1aaszjsNJL0ROTpSGJrzZeI43LACufZmyrXhkS0epBpr 4QGiSFY8O1nnuoWCQFLxBCKatfHjkruBi8t46Y0l9C54FkgOst5yI1wg9N/kpj0Cvpgc DagiBfy/NVrDvit9rTB1IWzv6xDE2kUjeyCWmjBRB7MYIgBFIKA9mvvDDatWA2t8fNJp mOOUm4vKPrkUfxfSPsdxDU0vyw6oPsb1xW1ThGe+LPKPieFSX6s4Pd9K2sx9WBTVmlp4 XWjVjMMRyj5ywMH6+b9yTT1l3Q8m4oeCsDEQ6zmco22TKXY/VF5xHmgCfAPes9Dnpf/A zdVw== X-Gm-Message-State: AOJu0YwFXIcoGI1rYN0aMjzStWDwM4YScggn942TMJrcEey1wewp7dvx hte3rrG+Sxq6L1Pg+C1oalgTb96AbmyXSXN4PL9CSmcsmBhSV15FFWnYy71Q/gZX+OR4qvZYmya j X-Gm-Gg: ASbGnctUeM8OyO9jqiJncV5fI8IffelYhMC7WHVAs1zFuXw2BZEkczPS2HLGjvf4kyy tRuSkl7ONWtKaIpRxCwxw1en2Lu+JQzu1dvC5Bwlv9OV7ACIs+nK6dXeO/DppsjNmGM7+7rk9QZ 41T723bc/ocUqEBv3XEjC6soRxfaAPm7FI9uL0/0b+s1nw0b2q6W553YDLItETy65O8rwRK1wcS QZ/als7FL/kmpOqLCNtINuvt4I+oB0u2EVxxsAQTsq4VrsFwxAy3nwHH/Kyx//33hGhBDW2sjMJ hMw3h+TaAL6cFyo= X-Received: by 2002:a17:90a:da8e:b0:2f2:3efd:96da with SMTP id 98e67ed59e1d1-2f782d38a48mr5620633a91.24.1737138512849; Fri, 17 Jan 2025 10:28:32 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f77629bf96sm2614105a91.36.2025.01.17.10.28.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:28:32 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 40/68] tcg: Add TCG_OPF_NOT_PRESENT to opcodes without inputs or outputs Date: Fri, 17 Jan 2025 10:24:28 -0800 Message-ID: <20250117182456.2077110-41-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62d; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62d.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 The br, mb, goto_tb and exit_tb opcodes do not have register operands, only constants, flags, or labels. Remove the special case in opcode_args_ct by including TCG_OPF_NOT_PRESENT in the flags for these opcodes. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/tcg/tcg-opc.h | 8 ++++---- tcg/tcg.c | 3 --- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/include/tcg/tcg-opc.h b/include/tcg/tcg-opc.h index 14aff6e7f9..724e7a9de8 100644 --- a/include/tcg/tcg-opc.h +++ b/include/tcg/tcg-opc.h @@ -33,7 +33,7 @@ DEF(set_label, 0, 0, 1, TCG_OPF_BB_END | TCG_OPF_NOT_PRESENT) /* variable number of parameters */ DEF(call, 0, 0, 3, TCG_OPF_CALL_CLOBBER | TCG_OPF_NOT_PRESENT) -DEF(br, 0, 0, 1, TCG_OPF_BB_END) +DEF(br, 0, 0, 1, TCG_OPF_BB_END | TCG_OPF_NOT_PRESENT) #define IMPL(X) (__builtin_constant_p(X) && (X) <= 0 ? TCG_OPF_NOT_PRESENT : 0) #if TCG_TARGET_REG_BITS == 32 @@ -42,7 +42,7 @@ DEF(br, 0, 0, 1, TCG_OPF_BB_END) # define IMPL64 TCG_OPF_64BIT #endif -DEF(mb, 0, 0, 1, 0) +DEF(mb, 0, 0, 1, TCG_OPF_NOT_PRESENT) DEF(mov_i32, 1, 1, 0, TCG_OPF_NOT_PRESENT) DEF(setcond_i32, 1, 2, 1, 0) @@ -193,8 +193,8 @@ DEF(mulsh_i64, 1, 2, 0, IMPL64 | IMPL(TCG_TARGET_HAS_mulsh_i64)) /* There are tcg_ctx->insn_start_words here, not just one. */ DEF(insn_start, 0, 0, DATA64_ARGS, TCG_OPF_NOT_PRESENT) -DEF(exit_tb, 0, 0, 1, TCG_OPF_BB_EXIT | TCG_OPF_BB_END) -DEF(goto_tb, 0, 0, 1, TCG_OPF_BB_EXIT | TCG_OPF_BB_END) +DEF(exit_tb, 0, 0, 1, TCG_OPF_BB_EXIT | TCG_OPF_BB_END | TCG_OPF_NOT_PRESENT) +DEF(goto_tb, 0, 0, 1, TCG_OPF_BB_EXIT | TCG_OPF_BB_END | TCG_OPF_NOT_PRESENT) DEF(goto_ptr, 0, 1, 0, TCG_OPF_BB_EXIT | TCG_OPF_BB_END) DEF(plugin_cb, 0, 0, 1, TCG_OPF_NOT_PRESENT) diff --git a/tcg/tcg.c b/tcg/tcg.c index b9119a1ec7..e9ecdc5eeb 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -3371,9 +3371,6 @@ static const TCGArgConstraint *opcode_args_ct(const TCGOp *op) assert(tcg_op_supported(op->opc, TCGOP_TYPE(op), TCGOP_FLAGS(op))); #endif - if (def->nb_iargs + def->nb_oargs == 0) { - return NULL; - } if (def->flags & TCG_OPF_NOT_PRESENT) { return empty_cts; } From patchwork Fri Jan 17 18:24:29 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858230 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp843055wrb; Fri, 17 Jan 2025 10:29:08 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCV9TfpM5tL+5hdg9I7F/8RwSSFAXF/FFkI4m16S+mrqrHnVUALunYsPEZoQ3gt/i+eYJandfA==@linaro.org X-Google-Smtp-Source: AGHT+IG54SW5mFytyOAJgokp9fop7LZrE/5aJ5hAaBtwYvOJv2YWxo/c1OePZA8CSe72p8KbHQwP X-Received: by 2002:a05:620a:40c2:b0:7b6:d5cb:43a9 with SMTP id af79cd13be357-7be63202517mr669572785a.23.1737138548216; Fri, 17 Jan 2025 10:29:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138548; cv=none; d=google.com; s=arc-20240605; b=IxCAszF0y996OD02ujKv8RK/fIJMrEc0DBqa6Bk0UFo/M9fyjfgzSGjKog5QdlS3eH kxzAQaLOsRy6ADJ1wsTiZ4WtFsDBzY6baVsNR6NfP0q7yi0pDu7WiYhAzG2yVim62yo/ smyvqVuLeGW3kxnDo9nhH6kg7yawkDlmk7wxEEXg+Hyd7reKANsSfdlhKYs0vPg3VRn2 D0BRbbVtwi/dhqHX2rb0LbtynGwC08SmN9ulNRUy5IjoksxAIj6yAblEvoQsHY6dU/JW +lIvlwty0zWYT4tQrURHICQheCF/G9qZ6u2vFAi4W1fhhrgtsx0YNm7x40DHn6LYRPGo K8tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=lkg9fxzYnG4S81y8aBxwl4d3ZJN+dnyX/D5oQckVa00=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=bZHIhNAcpa9NblxZ/9qPzmKAEM/fHFExAlAOLSYVBk8jv0Vb704eYgrXYTLi/ExCGB cBZ1fj5TIuZYB0qtQ+LAdpOejU8rW5bqQYfJ7VuUDMUupoKZRojMrVLuNSKn43dNC6Lp WSB56d1DmRcPyaOXtNnlKiXPkRSKZbpvST0Gcn/XNsF686YXMM62GEh5+u8lI/GtqaHD 9hM4lBf8+0L2YxNK26wStZyPyi+lloCq/pkBlqW/HaOBYUvJYlErNs0oTY9GnwcZD58b FrT0C0q9O+QV/OeNT03BbbnvPVmkZvmeGtgIk90FtLwzLoPWy5RFF3kJ6bCaVQvXslEO jplQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ph5gSqgc; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7be614dd03asi312529885a.460.2025.01.17.10.29.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:29:08 -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=ph5gSqgc; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr5E-0003lH-TF; Fri, 17 Jan 2025 13:28:41 -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 1tYr5C-0003iH-9u for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:28:38 -0500 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr59-00005E-Oi for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:28:37 -0500 Received: by mail-pj1-x1032.google.com with SMTP id 98e67ed59e1d1-2ee86a1a92dso3574267a91.1 for ; Fri, 17 Jan 2025 10:28:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138514; x=1737743314; 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=lkg9fxzYnG4S81y8aBxwl4d3ZJN+dnyX/D5oQckVa00=; b=ph5gSqgc71dfoaFmnxi+7wOHOqomW2An5qVyi8Ptx93Z7M4WmCdvOJ/axPpz6uKSrc AYTwOE+xDxOUUbM62PctR+49RLrXGwVF7JXzw+LcbHcjObReNp26mVDH17kZqiG8MRUM NwIW+WBJoiYR8oYVYGTsPuq0Tq0CNqSqsMLqubhnDlO3vP5+m2gXB5hBP1qaZ9e8qJl3 QsMVYYNNO9EV8YAlKwkixRzNz1oP2jyAfTtS4ATagxcmke0C3UdgflA9DqrmB2PxCwAi 96c0RQVkfVxoKwxzMSgLEaUGAbZe1WUkYGuU4nWpqp+shjAtS7ME0dmabr5qnzg4MQ4B 7iEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138514; x=1737743314; 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=lkg9fxzYnG4S81y8aBxwl4d3ZJN+dnyX/D5oQckVa00=; b=JMGqCJWWTVP95wJkAkuGWt/aTZ7cjeubLKjuQ7QsubOMRE6rxtXyY7uE5LVI87Aavx ARIB1qtrzplscitnSDUSZrtuNGJmK/Gy45ISw8cjGoZHeiDmF/ODdg9EznP25h333qkl krhFkV6Mz4p+s5xtqzTTB2UNlWChCHOTeZ7gDrO1H/1z0uOaG7kmi2RrS02Zp8w/Nq+F ps8qJLTIz/1b3+y38yT7vYB8sS2XNJZAfgK3mWEp5qbXg+SZNTH8hTUruusYNE88DaYn 63OOpSkoErLo+LPpurSVhHBT7n99SnprAbn9Rknca1UJWnST5MpC7mUtZQtiZgqRYZ9Q ic7w== X-Gm-Message-State: AOJu0Yz64c/2eNjxkQiiaWTztg7f28a9nMcqAj82VbWfhbcJ187PEt1m INnhFz48JltIKpKxVyKrJaAEEaoMJhuR7HOIFmg9lALsBzYET/FRoB1XaalB+jEJlSbAtzMQX0r 1 X-Gm-Gg: ASbGncvufUmNVc2d+BBsICyUk1s42LtmyVgqzewkxpy/vvS6fjzOthJJsa7QB9brVrZ REV1lMHDp6ZoVrC4gp6ff4Ha1kzSfpZiVcreZp3JwjuhO//gLFOMTTlbdCsBH5Pn/ZHVpswI88v 0waILd4GVnCdgZMCAxk7GkDpBJoSLdGBFcpQhtFTgVjsEEb0SBYgz4fA3dxYmSdtcCip11tEW51 6GKlgd5cpOmCUO7MMdzWQfoJ/NuX0FbJYf52BYru2SoYJTTXraVPsHOdMr15XyOLMK6F2J7Z68M 0TDWPk/+IDGVmxs= X-Received: by 2002:a17:90a:e18f:b0:2ee:693e:ed7a with SMTP id 98e67ed59e1d1-2f782d8651amr5122327a91.35.1737138514015; Fri, 17 Jan 2025 10:28:34 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f77629bf96sm2614105a91.36.2025.01.17.10.28.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:28:33 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 41/68] tcg: Pass type and flags to tcg_target_op_def Date: Fri, 17 Jan 2025 10:24:29 -0800 Message-ID: <20250117182456.2077110-42-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1032; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1032.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 Allow the backend to make constraint choices based on more parameters. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/tcg.c | 4 ++-- tcg/aarch64/tcg-target.c.inc | 3 ++- tcg/arm/tcg-target.c.inc | 3 ++- tcg/i386/tcg-target.c.inc | 3 ++- tcg/loongarch64/tcg-target.c.inc | 3 ++- tcg/mips/tcg-target.c.inc | 3 ++- tcg/ppc/tcg-target.c.inc | 3 ++- tcg/riscv/tcg-target.c.inc | 3 ++- tcg/s390x/tcg-target.c.inc | 3 ++- tcg/sparc64/tcg-target.c.inc | 3 ++- tcg/tci/tcg-target.c.inc | 3 ++- 11 files changed, 22 insertions(+), 12 deletions(-) diff --git a/tcg/tcg.c b/tcg/tcg.c index e9ecdc5eeb..83356d932d 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -866,7 +866,7 @@ typedef enum { #include "tcg-target-con-set.h" } TCGConstraintSetIndex; -static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode); +static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode, TCGType, unsigned); #undef C_O0_I1 #undef C_O0_I2 @@ -3375,7 +3375,7 @@ static const TCGArgConstraint *opcode_args_ct(const TCGOp *op) return empty_cts; } - con_set = tcg_target_op_def(op->opc); + con_set = tcg_target_op_def(op->opc, TCGOP_TYPE(op), TCGOP_FLAGS(op)); tcg_debug_assert(con_set >= 0 && con_set < ARRAY_SIZE(constraint_sets)); /* The constraint arguments must match TCGOpcode arguments. */ diff --git a/tcg/aarch64/tcg-target.c.inc b/tcg/aarch64/tcg-target.c.inc index d1e08def60..9116f85667 100644 --- a/tcg/aarch64/tcg-target.c.inc +++ b/tcg/aarch64/tcg-target.c.inc @@ -2962,7 +2962,8 @@ void tcg_expand_vec_op(TCGOpcode opc, TCGType type, unsigned vece, } } -static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) +static TCGConstraintSetIndex +tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) { switch (op) { case INDEX_op_goto_ptr: diff --git a/tcg/arm/tcg-target.c.inc b/tcg/arm/tcg-target.c.inc index b4cd36a9b8..182cac1a8a 100644 --- a/tcg/arm/tcg-target.c.inc +++ b/tcg/arm/tcg-target.c.inc @@ -2124,7 +2124,8 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, } } -static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) +static TCGConstraintSetIndex +tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) { switch (op) { case INDEX_op_goto_ptr: diff --git a/tcg/i386/tcg-target.c.inc b/tcg/i386/tcg-target.c.inc index 813c12ca0e..64826c7419 100644 --- a/tcg/i386/tcg-target.c.inc +++ b/tcg/i386/tcg-target.c.inc @@ -3627,7 +3627,8 @@ static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc, } } -static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) +static TCGConstraintSetIndex +tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) { switch (op) { case INDEX_op_goto_ptr: diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc index 686b94ccda..2f0d4d01ff 100644 --- a/tcg/loongarch64/tcg-target.c.inc +++ b/tcg/loongarch64/tcg-target.c.inc @@ -2191,7 +2191,8 @@ void tcg_expand_vec_op(TCGOpcode opc, TCGType type, unsigned vece, g_assert_not_reached(); } -static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) +static TCGConstraintSetIndex +tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) { switch (op) { case INDEX_op_goto_ptr: diff --git a/tcg/mips/tcg-target.c.inc b/tcg/mips/tcg-target.c.inc index 199bd97c0e..b89b279a0e 100644 --- a/tcg/mips/tcg-target.c.inc +++ b/tcg/mips/tcg-target.c.inc @@ -2151,7 +2151,8 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, } } -static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) +static TCGConstraintSetIndex +tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) { switch (op) { case INDEX_op_goto_ptr: diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc index 3ce4fa1db6..1e7b8a204c 100644 --- a/tcg/ppc/tcg-target.c.inc +++ b/tcg/ppc/tcg-target.c.inc @@ -4140,7 +4140,8 @@ void tcg_expand_vec_op(TCGOpcode opc, TCGType type, unsigned vece, va_end(va); } -static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) +static TCGConstraintSetIndex +tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) { switch (op) { case INDEX_op_goto_ptr: diff --git a/tcg/riscv/tcg-target.c.inc b/tcg/riscv/tcg-target.c.inc index 51cd7e7586..432a2fe26f 100644 --- a/tcg/riscv/tcg-target.c.inc +++ b/tcg/riscv/tcg-target.c.inc @@ -2583,7 +2583,8 @@ int tcg_can_emit_vec_op(TCGOpcode opc, TCGType type, unsigned vece) } } -static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) +static TCGConstraintSetIndex +tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) { switch (op) { case INDEX_op_goto_ptr: diff --git a/tcg/s390x/tcg-target.c.inc b/tcg/s390x/tcg-target.c.inc index 98925b1d5d..e09a726ecf 100644 --- a/tcg/s390x/tcg-target.c.inc +++ b/tcg/s390x/tcg-target.c.inc @@ -3207,7 +3207,8 @@ void tcg_expand_vec_op(TCGOpcode opc, TCGType type, unsigned vece, va_end(va); } -static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) +static TCGConstraintSetIndex +tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) { switch (op) { case INDEX_op_goto_ptr: diff --git a/tcg/sparc64/tcg-target.c.inc b/tcg/sparc64/tcg-target.c.inc index 1201607722..48de490120 100644 --- a/tcg/sparc64/tcg-target.c.inc +++ b/tcg/sparc64/tcg-target.c.inc @@ -1532,7 +1532,8 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, } } -static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) +static TCGConstraintSetIndex +tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) { switch (op) { case INDEX_op_goto_ptr: diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index 74b649c902..662acbdcb6 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -36,7 +36,8 @@ #endif #define TCG_TARGET_CALL_RET_I128 TCG_CALL_RET_NORMAL -static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) +static TCGConstraintSetIndex +tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) { switch (op) { case INDEX_op_goto_ptr: From patchwork Fri Jan 17 18:24:30 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858247 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp844091wrb; Fri, 17 Jan 2025 10:31:16 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVaAwSoTBp6JOf0M96sSFAd3bxdEW6hpy7zH1Ng09sgbXQUxV5gYGwdUxFQPAEbKKAbZ1iIXQ==@linaro.org X-Google-Smtp-Source: AGHT+IHc8MPLsWCRjYIrmRm7LGC9skSAvwT3scxShCt6YTLrG1l8inonXe4BmIVe6/2uzgux2kBQ X-Received: by 2002:a05:6122:16a8:b0:517:4fca:86e2 with SMTP id 71dfb90a1353d-51d5b3b081emr3423710e0c.10.1737138675809; Fri, 17 Jan 2025 10:31:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138675; cv=none; d=google.com; s=arc-20240605; b=drRxOwCmJ151WvaD+hFHYMsOQWtBajZpnk7DKdUj7FKIpPzk+F8t7ht87Mvltd+oJl T1r0OGKTwOBIf1CHj3NuX9QFG6JsOCNttQbv3+MB88pnYEqX5HITvpInYlZ4/9vARL0d DiKwagqgSSoE9V1znaKg9hJDBqlUbKODijPivd0MG8gZKf6a778N3iWTHS+X5j9o8iJ/ 45Kvky84DRMEd7Y7093QZueFK44R/cBwxRFhq1pSqUNX1s7qUf3xxPyObVf4G7MfEZJ+ tnNMzEbLQyfImmDDfz/lUfqu0lKYaDGBatrWimIoCq+CPoLA7f1CYeYQpA4EKW6RZEDw a1/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=aQRj5TU2Posy8KjGsBBbhkR+my+46AivX5CKfGm3PoM=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=VaGQkB4Whe9s/O0dHHeBisJIWI1dClcnrJDUVjj2Yq7WxN/rkICuTCZbfMAudmQD2y WAIURf4JeRE1NClkSZuZv/Xg+/YW9skWu1PbWiCm59banxL4J+YhRFEJj+cOx0kMbEVX N5WOYv//k9tq6PZle6FVIPLFCJ701USrKKJ/L79WDUeju6qUvhjnVsAJIVoZgj6a/cxW 6aOAeKZZErQEkua0jLcOL8s68vZeJAIfxGLPf8ITT59MYajOl7hiRb2QE8+4jraljasB AFg9K5HfKT0zb1SRK1GWe3ipiflNaBTGk7eV1qAaMQnsaS9fJAsdBvxe71lkqSpU6cDr IqKA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="NItBjXZ/"; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 71dfb90a1353d-51cf571e896si1372775e0c.150.2025.01.17.10.31.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:31:15 -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="NItBjXZ/"; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr5K-0003u7-1y; Fri, 17 Jan 2025 13:28:46 -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 1tYr5H-0003qF-S0 for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:28:43 -0500 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr5F-00006e-FP for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:28:43 -0500 Received: by mail-pj1-x1030.google.com with SMTP id 98e67ed59e1d1-2ee46851b5eso3431519a91.1 for ; Fri, 17 Jan 2025 10:28:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138519; x=1737743319; 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=aQRj5TU2Posy8KjGsBBbhkR+my+46AivX5CKfGm3PoM=; b=NItBjXZ/Lxb498MWeJDdnbmOidYBla74PLq0HvUPq3b5xeYu+IgyueRWuXBfSRMdlB Jy72GnbVUBYwkdvkzyYSeM/k5m6/zoYQjigXAqlZcLGLGYJ8xzVjSYmngsXRNXChRgEW +yrl2Lguk4Jrof0BZ2CYEsGL1X41TSS8mIjfoYQjsqxM7qO5AvvFKnDEwA8l3btVtQZX Zbmpiq6q83rmp+eKjl8+i5yL3fiU4hdjNRImEy2fqZlPcPj/TFLuJCLvxF/uQcbpvUrG c7lrsBy2XsWpEIIMEpkZR3YvUyp2faChh1CPlRftIgPWqIkPa3rFBZkt54tdAZqXCcTr FMsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138519; x=1737743319; 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=aQRj5TU2Posy8KjGsBBbhkR+my+46AivX5CKfGm3PoM=; b=XwX/Nq8VuMu2EVef+652dLQ+RItOJovGOLEQO4+PzsZfl8oas0PTs7OqbomkvYU6Nz PfoXQqDljfwU4pnejvGp+d9+SPBPK0Ij017Dlk3R35HGEB7Ii7Go4u1QFwvwDcY9986+ cgpcKJ8svJNkdODXVt9idA/tjlw57b/wnnKXE3l4kYOgbZ4ZYGV3z2TJfyAD5Ez0CG8M wGezI6Ga8jk3ksHpYZcgXDVuyfr4DSQhEz2hrrfGx2Et0aNh9eF53n1+l4sXhm4lkJvN i2DNlpsOwa4mNKO2SQoarHMrLOO1+Xuky3CnSYiTiJrxXD2UzQD4oMB7+rqmcoCwiDTL E/yQ== X-Gm-Message-State: AOJu0YwRJyUy2SVMzM47E3tnTqXAhs4T64l55obHB18yLIaq2uOlSHrZ ++2+RhdknkGctRu+IujYoYgpm8exk3UYAdKBTTtkBAwZt/dhKjdFWf7tRZ6H1SOTH2sKDrqE2rM p X-Gm-Gg: ASbGnctDYYjGF0mbWFShVc60/F6ADeG5CcLa/PSIlMcTdPjPYBcemCPZF946tXszGFU RT0B/QSiYng9n2UasO4tPjY8QcycjddLC6IJe+e/wk/cMxYgQlgXmzi0ZRZVQ/uepDMj8NzKNun pSdNLQoGMZCxgChlOUI97hBvSrbZAZAs31M7Lk8V2xw9laVkbtC0/CO1AGMqVaICzhpRrb/z0ic qjSMEdxBJw2oha/ans1LKTehDYcOZb8QwiooTjuYOVSrFQzsyPPXpbgKRmKANecrODESvjFTp/K /zrmZKx4jsEJFFU= X-Received: by 2002:a17:90b:2748:b0:2ee:dd79:e046 with SMTP id 98e67ed59e1d1-2f782c79fe8mr5059590a91.13.1737138519441; Fri, 17 Jan 2025 10:28:39 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f77629bf96sm2614105a91.36.2025.01.17.10.28.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:28:34 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 42/68] tcg: Add TCGType argument to tcg_out_op Date: Fri, 17 Jan 2025 10:24:30 -0800 Message-ID: <20250117182456.2077110-43-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1030; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1030.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 Pass TCGOp.type to the output function. For aarch64 and tci, use this instead of testing TCG_OPF_64BIT. For s390x, use this instead of testing INDEX_op_deposit_i64. For i386, use this to initialize rexw. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/tcg.c | 4 ++-- tcg/aarch64/tcg-target.c.inc | 6 +----- tcg/arm/tcg-target.c.inc | 2 +- tcg/i386/tcg-target.c.inc | 10 +++++----- tcg/loongarch64/tcg-target.c.inc | 2 +- tcg/mips/tcg-target.c.inc | 2 +- tcg/ppc/tcg-target.c.inc | 2 +- tcg/riscv/tcg-target.c.inc | 2 +- tcg/s390x/tcg-target.c.inc | 7 +++---- tcg/sparc64/tcg-target.c.inc | 2 +- tcg/tci/tcg-target.c.inc | 4 ++-- 11 files changed, 19 insertions(+), 24 deletions(-) diff --git a/tcg/tcg.c b/tcg/tcg.c index 83356d932d..9b54a8bec8 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -134,7 +134,7 @@ static void tcg_out_addi_ptr(TCGContext *s, TCGReg, TCGReg, tcg_target_long); static bool tcg_out_xchg(TCGContext *s, TCGType type, TCGReg r1, TCGReg r2); static void tcg_out_exit_tb(TCGContext *s, uintptr_t arg); static void tcg_out_goto_tb(TCGContext *s, int which); -static void tcg_out_op(TCGContext *s, TCGOpcode opc, +static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType type, const TCGArg args[TCG_MAX_OP_ARGS], const int const_args[TCG_MAX_OP_ARGS]); #if TCG_TARGET_MAYBE_vec @@ -5423,7 +5423,7 @@ static void tcg_reg_alloc_op(TCGContext *s, const TCGOp *op) tcg_out_vec_op(s, op->opc, TCGOP_TYPE(op) - TCG_TYPE_V64, TCGOP_VECE(op), new_args, const_args); } else { - tcg_out_op(s, op->opc, new_args, const_args); + tcg_out_op(s, op->opc, TCGOP_TYPE(op), new_args, const_args); } break; } diff --git a/tcg/aarch64/tcg-target.c.inc b/tcg/aarch64/tcg-target.c.inc index 9116f85667..ede6f47235 100644 --- a/tcg/aarch64/tcg-target.c.inc +++ b/tcg/aarch64/tcg-target.c.inc @@ -2115,14 +2115,10 @@ void tb_target_set_jmp_target(const TranslationBlock *tb, int n, flush_idcache_range(jmp_rx, jmp_rw, 4); } -static void tcg_out_op(TCGContext *s, TCGOpcode opc, +static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType ext, const TCGArg args[TCG_MAX_OP_ARGS], const int const_args[TCG_MAX_OP_ARGS]) { - /* 99% of the time, we can signal the use of extension registers - by looking to see if the opcode handles 64-bit data. */ - TCGType ext = (tcg_op_defs[opc].flags & TCG_OPF_64BIT) != 0; - /* Hoist the loads of the most common arguments. */ TCGArg a0 = args[0]; TCGArg a1 = args[1]; diff --git a/tcg/arm/tcg-target.c.inc b/tcg/arm/tcg-target.c.inc index 182cac1a8a..9cfb733a14 100644 --- a/tcg/arm/tcg-target.c.inc +++ b/tcg/arm/tcg-target.c.inc @@ -1805,7 +1805,7 @@ void tb_target_set_jmp_target(const TranslationBlock *tb, int n, flush_idcache_range(jmp_rx, jmp_rw, 4); } -static void tcg_out_op(TCGContext *s, TCGOpcode opc, +static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType type, const TCGArg args[TCG_MAX_OP_ARGS], const int const_args[TCG_MAX_OP_ARGS]) { diff --git a/tcg/i386/tcg-target.c.inc b/tcg/i386/tcg-target.c.inc index 64826c7419..8d1057cdb3 100644 --- a/tcg/i386/tcg-target.c.inc +++ b/tcg/i386/tcg-target.c.inc @@ -2612,17 +2612,16 @@ void tb_target_set_jmp_target(const TranslationBlock *tb, int n, /* no need to flush icache explicitly */ } -static inline void tcg_out_op(TCGContext *s, TCGOpcode opc, - const TCGArg args[TCG_MAX_OP_ARGS], - const int const_args[TCG_MAX_OP_ARGS]) +static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType type, + const TCGArg args[TCG_MAX_OP_ARGS], + const int const_args[TCG_MAX_OP_ARGS]) { TCGArg a0, a1, a2; - int c, const_a2, vexop, rexw = 0; + int c, const_a2, vexop, rexw; #if TCG_TARGET_REG_BITS == 64 # define OP_32_64(x) \ case glue(glue(INDEX_op_, x), _i64): \ - rexw = P_REXW; /* FALLTHRU */ \ case glue(glue(INDEX_op_, x), _i32) #else # define OP_32_64(x) \ @@ -2634,6 +2633,7 @@ static inline void tcg_out_op(TCGContext *s, TCGOpcode opc, a1 = args[1]; a2 = args[2]; const_a2 = const_args[2]; + rexw = type == TCG_TYPE_I32 ? 0 : P_REXW; switch (opc) { case INDEX_op_goto_ptr: diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc index 2f0d4d01ff..3dff29facb 100644 --- a/tcg/loongarch64/tcg-target.c.inc +++ b/tcg/loongarch64/tcg-target.c.inc @@ -1278,7 +1278,7 @@ void tb_target_set_jmp_target(const TranslationBlock *tb, int n, flush_idcache_range(jmp_rx, jmp_rw, 4); } -static void tcg_out_op(TCGContext *s, TCGOpcode opc, +static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType type, const TCGArg args[TCG_MAX_OP_ARGS], const int const_args[TCG_MAX_OP_ARGS]) { diff --git a/tcg/mips/tcg-target.c.inc b/tcg/mips/tcg-target.c.inc index b89b279a0e..b31b8f0007 100644 --- a/tcg/mips/tcg-target.c.inc +++ b/tcg/mips/tcg-target.c.inc @@ -1678,7 +1678,7 @@ void tb_target_set_jmp_target(const TranslationBlock *tb, int n, /* Always indirect, nothing to do */ } -static void tcg_out_op(TCGContext *s, TCGOpcode opc, +static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType type, const TCGArg args[TCG_MAX_OP_ARGS], const int const_args[TCG_MAX_OP_ARGS]) { diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc index 1e7b8a204c..9205ac99e9 100644 --- a/tcg/ppc/tcg-target.c.inc +++ b/tcg/ppc/tcg-target.c.inc @@ -2940,7 +2940,7 @@ void tb_target_set_jmp_target(const TranslationBlock *tb, int n, flush_idcache_range(jmp_rx, jmp_rw, 4); } -static void tcg_out_op(TCGContext *s, TCGOpcode opc, +static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType type, const TCGArg args[TCG_MAX_OP_ARGS], const int const_args[TCG_MAX_OP_ARGS]) { diff --git a/tcg/riscv/tcg-target.c.inc b/tcg/riscv/tcg-target.c.inc index 432a2fe26f..e381ba4e77 100644 --- a/tcg/riscv/tcg-target.c.inc +++ b/tcg/riscv/tcg-target.c.inc @@ -1960,7 +1960,7 @@ void tb_target_set_jmp_target(const TranslationBlock *tb, int n, flush_idcache_range(jmp_rx, jmp_rw, 4); } -static void tcg_out_op(TCGContext *s, TCGOpcode opc, +static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType type, const TCGArg args[TCG_MAX_OP_ARGS], const int const_args[TCG_MAX_OP_ARGS]) { diff --git a/tcg/s390x/tcg-target.c.inc b/tcg/s390x/tcg-target.c.inc index e09a726ecf..fc7d986e68 100644 --- a/tcg/s390x/tcg-target.c.inc +++ b/tcg/s390x/tcg-target.c.inc @@ -2117,9 +2117,9 @@ void tb_target_set_jmp_target(const TranslationBlock *tb, int n, case glue(glue(INDEX_op_,x),_i32): \ case glue(glue(INDEX_op_,x),_i64) -static inline void tcg_out_op(TCGContext *s, TCGOpcode opc, - const TCGArg args[TCG_MAX_OP_ARGS], - const int const_args[TCG_MAX_OP_ARGS]) +static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType type, + const TCGArg args[TCG_MAX_OP_ARGS], + const int const_args[TCG_MAX_OP_ARGS]) { S390Opcode op, op2; TCGArg a0, a1, a2; @@ -2713,7 +2713,6 @@ static inline void tcg_out_op(TCGContext *s, TCGOpcode opc, /* Since we can't support "0Z" as a constraint, we allow a1 in any register. Fix things up as if a matching constraint. */ if (a0 != a1) { - TCGType type = (opc == INDEX_op_deposit_i64); if (a0 == a2) { tcg_out_mov(s, type, TCG_TMP0, a2); a2 = TCG_TMP0; diff --git a/tcg/sparc64/tcg-target.c.inc b/tcg/sparc64/tcg-target.c.inc index 48de490120..afc778fae7 100644 --- a/tcg/sparc64/tcg-target.c.inc +++ b/tcg/sparc64/tcg-target.c.inc @@ -1288,7 +1288,7 @@ void tb_target_set_jmp_target(const TranslationBlock *tb, int n, { } -static void tcg_out_op(TCGContext *s, TCGOpcode opc, +static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType type, const TCGArg args[TCG_MAX_OP_ARGS], const int const_args[TCG_MAX_OP_ARGS]) { diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index 662acbdcb6..88cecbd62f 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -708,7 +708,7 @@ void tb_target_set_jmp_target(const TranslationBlock *tb, int n, /* Always indirect, nothing to do */ } -static void tcg_out_op(TCGContext *s, TCGOpcode opc, +static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType type, const TCGArg args[TCG_MAX_OP_ARGS], const int const_args[TCG_MAX_OP_ARGS]) { @@ -790,7 +790,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, CASE_32_64(sextract) /* Optional (TCG_TARGET_HAS_sextract_*). */ { TCGArg pos = args[2], len = args[3]; - TCGArg max = tcg_op_defs[opc].flags & TCG_OPF_64BIT ? 64 : 32; + TCGArg max = type == TCG_TYPE_I32 ? 32 : 64; tcg_debug_assert(pos < max); tcg_debug_assert(pos + len <= max); From patchwork Fri Jan 17 18:24:31 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858268 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp845261wrb; Fri, 17 Jan 2025 10:33:54 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWUbFie+LMthzOB57bjGsD9vQVfH1E6JFlI9qp7qXQJn695viG6h7r9Ao4rwwnaL3CpBpGfsA==@linaro.org X-Google-Smtp-Source: AGHT+IEK3bYBKMcpJtelmkl5ywgLvSCQgqKKjL03CfjVWV1oTJf5U8ArFIe5WxBd9GXMy7JSha+3 X-Received: by 2002:a05:6102:504b:b0:4b2:7996:6ba4 with SMTP id ada2fe7eead31-4b690cf6423mr3633938137.25.1737138834550; Fri, 17 Jan 2025 10:33:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138834; cv=none; d=google.com; s=arc-20240605; b=O7LQUr1+mTv5ejVqjlg++fkr9x5lme7gQnklfAKlORgvIl4uB3X23+ulillyb/PdKE e4DjbS1XJ8ThiuC9zJyN3wDrall6s5qKUtloM0WCdSQ/dJaV7seb72YRw9lbtzzFm8Hu zFqDlrgr7U2xhYh/fT8g4qtm7vgsOwjVE8Bcexne8iarXiEgLBXLRre/XVfzZ9WuGLMG lNa9XZWCKg/9d2XziV90zQGOBcp4tNhqLE7sAoMBAn0etu2C0L2yWLaCXlLAfgrqaZx+ 6nIYU+wcaTysMayEGXjbBD4aWdF3ceR8SZoXJoZ22liOX0OC91x4k5ACJmXW7Rdcrysg xACw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=UYyOJoot88xHZloHmjY61PRyBo7semJlAInfhJboRyE=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=Ph/HGfKk0O+YUc0MXaQd77SPBr9jMxoOYRtwkoBwnbgaci4hIuNrR//TD0F1cZnCtb VEyLJ7ohMf5W8lMdC8FrbRvtpJys3a9ydvj4oH6m7Un5XheuCo7J5gwhIXPPTv/Ai/0I W+EfW8ALPEpQY9lnjyPB/uKzngWJS6rbhrTeHn+I414/UcVttULGzuYmIsjeRWELUpQO 7vNKT4Lgjf3GWFIG2pFi9btknaReymsGrc9IOTOcAxrsA+Fc1WM2pAXytJvBMyN3s/nP ULHCd//Iw3bH13v1FTquxMddwL4Ik2kqLjUlgOMgOvClnSAi3ylQKmicj2MEt+0y/9kj nFPQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Yz5bCsCQ; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id ada2fe7eead31-4b68a34f6b6si1131946137.580.2025.01.17.10.33.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:33:54 -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=Yz5bCsCQ; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr5O-00045k-RZ; Fri, 17 Jan 2025 13:28:50 -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 1tYr5M-0003zM-Dv for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:28:48 -0500 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr5K-00008I-Ex for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:28:47 -0500 Received: by mail-pj1-x1032.google.com with SMTP id 98e67ed59e1d1-2f44353649aso3447418a91.0 for ; Fri, 17 Jan 2025 10:28:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138525; x=1737743325; 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=UYyOJoot88xHZloHmjY61PRyBo7semJlAInfhJboRyE=; b=Yz5bCsCQiOI4JuZbVivRwEgh1D/mBYNz14RQWt1iULNC72Wnr0SSAD2/CUKTWKTWNa X2VeJiy6fnLTRdevfPb9cpSlMPmUYrVW2eN7HOPhRCty72c5ioNtbsIyqyqnQGh1rMU0 oMMGdtJaLjXI9Upt3pQnIdj+VyrN1+8nCIjr06iajdDjY60/HU+lgF70uWm+4NvUzAn0 X6oMbsarYMy/IDHBYkABxJlG1rDarhYF5cQEcunWJw7TnExS8HdOu9W7d/Hoc6suobWF 0c8ywuYF18XoDx9u87G6p9L0AbVw2kfwIBLmGZkShR7F2K5OaRBErPgOdIc462rI6+6E u+vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138525; x=1737743325; 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=UYyOJoot88xHZloHmjY61PRyBo7semJlAInfhJboRyE=; b=ibxfd54vT0j+vWPJHn8TLTWg2wLjPYjxfUDY3/GEbip6tt1OrXHRcpf6z+oq5R2u/a z4BZap3GXJyt65YGpGmYh88LEfxJbrWqnvFS7FXVWCeStytgnAkrwXVFTWAhzGOswd9Z a7urF8Qpo+Cyo0FR9fzurDmpHke1h9yB3k8rgQ+Co5Q0JXvRIjPsNxE2zDkIEBK71wzk //F7q3A4FbzuMUbTNntthEVged1ik3wx0rYax3IafRVxSjgWbecXuw4iJ2QRKugiJtX1 hs7yZOqw+WK6YBicNAk8IYLyEHTu0yvAdwzWu8U1yJJgLpbRa9fgdO9dLOIv7qlHVZhs 7yIw== X-Gm-Message-State: AOJu0YzTKEvvxuCJQ9ZavhzNqYq8B/XNeIcWZantLrIaIfrJ9Dzfe5zO Hh6jqzSXrYzZY1JtYbB6w+zb9BfnkJskFND+c04csMLwiDZGpsEdVWzjFeKklc9uU4TAAFID/O4 c X-Gm-Gg: ASbGnctMFzTAZ6kI8qieVYwwlVXtuVqqelrTxVtAe0vZp6ee0ig8YpfkxXev5/VCfJO 6VqARQkl2ZNgYEbUaDWF+021To6Q3XHEYKJwKt9S24QwB1p4uinK35Akli9UanXNpPIv+ksFE3b cY5hty8wzr8m4ptiGONxiAyvIC+sk5lbUCzS0VQbWX39tRhP6OSz8K943iaF45vWLlljmNdt0kN J7vxUde4v6x7+ihHMDkEAGGAUGaqUCSe+USJA6pATxrWLCkaBe8Kzhd0gHyXCIWM+M0OhYrCVHH q28A0bDqeswZxfE= X-Received: by 2002:a17:90b:2c84:b0:2f6:d266:f462 with SMTP id 98e67ed59e1d1-2f782d8c84fmr5019508a91.35.1737138525042; Fri, 17 Jan 2025 10:28:45 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f77629bf96sm2614105a91.36.2025.01.17.10.28.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:28:42 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 43/68] tcg: Remove TCG_OPF_64BIT Date: Fri, 17 Jan 2025 10:24:31 -0800 Message-ID: <20250117182456.2077110-44-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1032; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1032.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 This flag is no longer used. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/tcg/tcg-opc.h | 22 +++++++++++----------- include/tcg/tcg.h | 2 -- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/include/tcg/tcg-opc.h b/include/tcg/tcg-opc.h index 724e7a9de8..eb17a21f21 100644 --- a/include/tcg/tcg-opc.h +++ b/include/tcg/tcg-opc.h @@ -37,9 +37,9 @@ DEF(br, 0, 0, 1, TCG_OPF_BB_END | TCG_OPF_NOT_PRESENT) #define IMPL(X) (__builtin_constant_p(X) && (X) <= 0 ? TCG_OPF_NOT_PRESENT : 0) #if TCG_TARGET_REG_BITS == 32 -# define IMPL64 TCG_OPF_64BIT | TCG_OPF_NOT_PRESENT +# define IMPL64 TCG_OPF_NOT_PRESENT #else -# define IMPL64 TCG_OPF_64BIT +# define IMPL64 0 #endif DEF(mb, 0, 0, 1, TCG_OPF_NOT_PRESENT) @@ -110,7 +110,7 @@ DEF(clz_i32, 1, 2, 0, IMPL(TCG_TARGET_HAS_clz_i32)) DEF(ctz_i32, 1, 2, 0, IMPL(TCG_TARGET_HAS_ctz_i32)) DEF(ctpop_i32, 1, 1, 0, IMPL(TCG_TARGET_HAS_ctpop_i32)) -DEF(mov_i64, 1, 1, 0, TCG_OPF_64BIT | TCG_OPF_NOT_PRESENT) +DEF(mov_i64, 1, 1, 0, TCG_OPF_NOT_PRESENT) DEF(setcond_i64, 1, 2, 1, IMPL64) DEF(negsetcond_i64, 1, 2, 1, IMPL64 | IMPL(TCG_TARGET_HAS_negsetcond_i64)) DEF(movcond_i64, 1, 4, 1, IMPL64) @@ -206,18 +206,18 @@ DEF(qemu_ld_a32_i32, 1, 1, 1, DEF(qemu_st_a32_i32, 0, 1 + 1, 1, TCG_OPF_CALL_CLOBBER | TCG_OPF_SIDE_EFFECTS) DEF(qemu_ld_a32_i64, DATA64_ARGS, 1, 1, - TCG_OPF_CALL_CLOBBER | TCG_OPF_SIDE_EFFECTS | TCG_OPF_64BIT) + TCG_OPF_CALL_CLOBBER | TCG_OPF_SIDE_EFFECTS) DEF(qemu_st_a32_i64, 0, DATA64_ARGS + 1, 1, - TCG_OPF_CALL_CLOBBER | TCG_OPF_SIDE_EFFECTS | TCG_OPF_64BIT) + TCG_OPF_CALL_CLOBBER | TCG_OPF_SIDE_EFFECTS) DEF(qemu_ld_a64_i32, 1, DATA64_ARGS, 1, TCG_OPF_CALL_CLOBBER | TCG_OPF_SIDE_EFFECTS) DEF(qemu_st_a64_i32, 0, 1 + DATA64_ARGS, 1, TCG_OPF_CALL_CLOBBER | TCG_OPF_SIDE_EFFECTS) DEF(qemu_ld_a64_i64, DATA64_ARGS, DATA64_ARGS, 1, - TCG_OPF_CALL_CLOBBER | TCG_OPF_SIDE_EFFECTS | TCG_OPF_64BIT) + TCG_OPF_CALL_CLOBBER | TCG_OPF_SIDE_EFFECTS) DEF(qemu_st_a64_i64, 0, DATA64_ARGS + DATA64_ARGS, 1, - TCG_OPF_CALL_CLOBBER | TCG_OPF_SIDE_EFFECTS | TCG_OPF_64BIT) + TCG_OPF_CALL_CLOBBER | TCG_OPF_SIDE_EFFECTS) /* Only used by i386 to cope with stupid register constraints. */ DEF(qemu_st8_a32_i32, 0, 1 + 1, 1, @@ -229,16 +229,16 @@ DEF(qemu_st8_a64_i32, 0, 1 + DATA64_ARGS, 1, /* Only for 64-bit hosts at the moment. */ DEF(qemu_ld_a32_i128, 2, 1, 1, - TCG_OPF_CALL_CLOBBER | TCG_OPF_SIDE_EFFECTS | TCG_OPF_64BIT | + TCG_OPF_CALL_CLOBBER | TCG_OPF_SIDE_EFFECTS | IMPL(TCG_TARGET_HAS_qemu_ldst_i128)) DEF(qemu_ld_a64_i128, 2, 1, 1, - TCG_OPF_CALL_CLOBBER | TCG_OPF_SIDE_EFFECTS | TCG_OPF_64BIT | + TCG_OPF_CALL_CLOBBER | TCG_OPF_SIDE_EFFECTS | IMPL(TCG_TARGET_HAS_qemu_ldst_i128)) DEF(qemu_st_a32_i128, 0, 3, 1, - TCG_OPF_CALL_CLOBBER | TCG_OPF_SIDE_EFFECTS | TCG_OPF_64BIT | + TCG_OPF_CALL_CLOBBER | TCG_OPF_SIDE_EFFECTS | IMPL(TCG_TARGET_HAS_qemu_ldst_i128)) DEF(qemu_st_a64_i128, 0, 3, 1, - TCG_OPF_CALL_CLOBBER | TCG_OPF_SIDE_EFFECTS | TCG_OPF_64BIT | + TCG_OPF_CALL_CLOBBER | TCG_OPF_SIDE_EFFECTS | IMPL(TCG_TARGET_HAS_qemu_ldst_i128)) /* Host vector support. */ diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h index a4630e44bc..e7ddf979f6 100644 --- a/include/tcg/tcg.h +++ b/include/tcg/tcg.h @@ -699,8 +699,6 @@ enum { /* Instruction has side effects: it cannot be removed if its outputs are not used, and might trigger exceptions. */ TCG_OPF_SIDE_EFFECTS = 0x08, - /* Instruction operands are 64-bits (otherwise 32-bits). */ - TCG_OPF_64BIT = 0x10, /* Instruction is optional and not implemented by the host, or insn is generic and should not be implemented by the host. */ TCG_OPF_NOT_PRESENT = 0x20, From patchwork Fri Jan 17 18:24:32 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858246 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp844069wrb; Fri, 17 Jan 2025 10:31:14 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUsSM2sFeU8padLomNqcRAwJy73tUH+qxoPqQu8kmyvEDgqIHwnFc9RGRTFfomL9ofT+QCgEA==@linaro.org X-Google-Smtp-Source: AGHT+IEytXO9UglH8FUIa/ZUprfxyHQ2kZ5ekbJYRlBInHzDQEk4H+cjtLDhxO11NFKO7Ctt8fya X-Received: by 2002:a05:6122:438d:b0:518:9dca:f0fb with SMTP id 71dfb90a1353d-51d5b3b3da4mr3998652e0c.11.1737138673974; Fri, 17 Jan 2025 10:31:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138673; cv=none; d=google.com; s=arc-20240605; b=BVVd4MwEBusUKpt0eAemQLPdYhEGvrPk1oeK6Ezu8BJHQhY8I7FzBkTLx5unOeWSfV ChmSuTygDp7bp16ZeOQNGAo8AXI9s7+vszPkkbhl6t45umiJ6H1vaAFX85BjyyjZ+XZ+ FRqqSmmc49QRf1e2iRsfbVcgVww2SnXZr7NJlcE1SC84pZECQi0+dskz0c1jmpSY4nzk 5DoB8ail57fhOho6d2k56z8I7npoWU695deRf3MLWuxZsWQhrqZGz1l3x98c89Mqxu6A eaghgp6X2lQ4xv8fzEw8i8tVsNg2iQJ1kMxcv8IBV8EaihYp0IbVKi1uU+wnaPPQ4/Uk v3dQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=r7eBIyl0wZpu967JUtuB+u2AGsapT9SltfKDQGESryw=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=hakbf6YujvTOF0jh6yfUVJ+OCwIdU4b1AD51ZDF7eymjvjomLcLo6Dreio277LSVOy jT/JrWmgpWc7aqSkbqFA9fudpiF6LhwHgqpSOJWiIW4FvdFhDYDZt5F7nW9tWBC8a3Jc LHlIpAK6lr8l0TYOt5MY0D44VE2R0BGEfDDipTdYTT9yyHeWDH0Xhdve+tNUFRgotho7 A4ArdI2ZRjIuSLIXprJPMYeKFRMcTeCbbaJWEOVd5dd3MheOsUD+72u9anrJzr5YZU9h Kx/ogZxBdXiqxEUlHSkwrTxFCrHTY+GufNsG+01nBuSdgRoEe4pOyyXbkGM/sd30seHp Gjnw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lwbREm2I; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 71dfb90a1353d-51cf559f04esi1126596e0c.86.2025.01.17.10.31.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:31:13 -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=lwbREm2I; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr5c-0004ty-Tv; Fri, 17 Jan 2025 13:29:05 -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 1tYr5U-0004JB-0L for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:28:57 -0500 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr5P-00009k-EF for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:28:53 -0500 Received: by mail-pj1-x1032.google.com with SMTP id 98e67ed59e1d1-2ee46851b5eso3431723a91.1 for ; Fri, 17 Jan 2025 10:28:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138530; x=1737743330; 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=r7eBIyl0wZpu967JUtuB+u2AGsapT9SltfKDQGESryw=; b=lwbREm2I3DNLp8lmeCiGi/eMQwfVT1u1jExv4wg3u8QJhSnftpcFHn0iSDUhEPMGoE ICnVUQ5Jou5NAxFWLf3IevsYqCt+fbUVR4mg3KR2Vk4Yn01eiONGYNlItjUG/nr4FUVM IUjJX36zC5I6LN1AmFlwmgNTaUZQK/+E2EgZ2/0KV+6Mq/lCfZJRr7ghECfquPCR1qHo UHMGkHUpZNArQ5Qjf1V+kPCtUTdW6k0ZE3AnAUrCSDAWjvP8IuENXVBBSQ0yuwBjXAxd nOzJ+Wb9/NnAFJvuntOdr/MRET8kbwYlKCq0zb3VZpIHvSXtFDXgdnoz63NyUE8oT1kM paiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138530; x=1737743330; 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=r7eBIyl0wZpu967JUtuB+u2AGsapT9SltfKDQGESryw=; b=Jijr3asxZIHENCPN7r+3rtoESYJrWqQ8umjrdb5CaboRow4LZ7kb/GuMlV2Q4ViXvg 82ZKoS/MB64vDzQHjMzyjvCX06EawXZ1dlIHKh9j401oEoq+PHRodlHhqmSEXEJWuv3I 1RzVKFjl1K3c54HKB9f6iHxYFCXoJDqX2SRjEO6BoWDoLf7ooDHJxl3KLCEYerP710WD 3EW8EW+4FSNH0cwj0GcuBwiFPf4nHZxXAMBl9WGoZi6fiJj3vYquHwcSElW+nsztHkYD xK5VrdhJxZho1pGtd2ZU1XeTEuv4CorOSplXJ79oymUQHZEOb9InOwztpl1jwA81Npx2 dUqw== X-Gm-Message-State: AOJu0Yw0JCfGyp5EoncfM1pjEuZhfBNwWuy4UB6gDVqbE0+CbALwjm1p 9gLlyR5j5XV85v9nxVfprJzUiyaDOx7ArN1QKPVrko8FfTI9oOFu2EU4y4YEpJNaAFg4Nnw//op E X-Gm-Gg: ASbGnctrPq/D/JwWKlQkKY5/pB4yKaHhS1GN1NZ8jgvt7yUxiMoX8gQUsUUVOzgWPPz lnfH056I/LhQdUmpliS2T0GM+Nc/cOM/dA6H38Yt7zeIzbSwGbouLWCbuYSIcf/0w9Tnrb4q0DG icIIBOYVfwyr396IcKFvJFx7oeCBiIeGrJvllCRilzkIpnKFT+EE41M6xCinLYKK29IxzCV2bL3 POj6NNvlPCTLmgAQ5UTNjdD8TFwhhjN2ufesO7LDPQAzBmk9PxlnMrQ6I9twLDJL3qXmxRO5qd9 9iNaZAQFY/4PP6g= X-Received: by 2002:a17:90b:2b87:b0:2ee:a127:ba96 with SMTP id 98e67ed59e1d1-2f782d36030mr4314312a91.23.1737138528518; Fri, 17 Jan 2025 10:28:48 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f77629bf96sm2614105a91.36.2025.01.17.10.28.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:28:46 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 44/68] tcg: Drop implementation checks from tcg-opc.h Date: Fri, 17 Jan 2025 10:24:32 -0800 Message-ID: <20250117182456.2077110-45-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1032; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1032.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 Now that we use a functional interface to query whether the opcode is supported, we can drop the TCG_OPF_NOT_PRESENT bit mapping from TCG_TARGET_HAS_foo in tcg-opc.h Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/tcg/tcg-opc.h | 306 +++++++++++++++++++----------------------- 1 file changed, 141 insertions(+), 165 deletions(-) diff --git a/include/tcg/tcg-opc.h b/include/tcg/tcg-opc.h index eb17a21f21..559f5971e6 100644 --- a/include/tcg/tcg-opc.h +++ b/include/tcg/tcg-opc.h @@ -35,18 +35,11 @@ DEF(call, 0, 0, 3, TCG_OPF_CALL_CLOBBER | TCG_OPF_NOT_PRESENT) DEF(br, 0, 0, 1, TCG_OPF_BB_END | TCG_OPF_NOT_PRESENT) -#define IMPL(X) (__builtin_constant_p(X) && (X) <= 0 ? TCG_OPF_NOT_PRESENT : 0) -#if TCG_TARGET_REG_BITS == 32 -# define IMPL64 TCG_OPF_NOT_PRESENT -#else -# define IMPL64 0 -#endif - DEF(mb, 0, 0, 1, TCG_OPF_NOT_PRESENT) DEF(mov_i32, 1, 1, 0, TCG_OPF_NOT_PRESENT) DEF(setcond_i32, 1, 2, 1, 0) -DEF(negsetcond_i32, 1, 2, 1, IMPL(TCG_TARGET_HAS_negsetcond_i32)) +DEF(negsetcond_i32, 1, 2, 1, 0) DEF(movcond_i32, 1, 4, 1, 0) /* load/store */ DEF(ld8u_i32, 1, 1, 1, 0) @@ -61,12 +54,12 @@ DEF(st_i32, 0, 2, 1, 0) DEF(add_i32, 1, 2, 0, 0) DEF(sub_i32, 1, 2, 0, 0) DEF(mul_i32, 1, 2, 0, 0) -DEF(div_i32, 1, 2, 0, IMPL(TCG_TARGET_HAS_div_i32)) -DEF(divu_i32, 1, 2, 0, IMPL(TCG_TARGET_HAS_div_i32)) -DEF(rem_i32, 1, 2, 0, IMPL(TCG_TARGET_HAS_rem_i32)) -DEF(remu_i32, 1, 2, 0, IMPL(TCG_TARGET_HAS_rem_i32)) -DEF(div2_i32, 2, 3, 0, IMPL(TCG_TARGET_HAS_div2_i32)) -DEF(divu2_i32, 2, 3, 0, IMPL(TCG_TARGET_HAS_div2_i32)) +DEF(div_i32, 1, 2, 0, 0) +DEF(divu_i32, 1, 2, 0, 0) +DEF(rem_i32, 1, 2, 0, 0) +DEF(remu_i32, 1, 2, 0, 0) +DEF(div2_i32, 2, 3, 0, 0) +DEF(divu2_i32, 2, 3, 0, 0) DEF(and_i32, 1, 2, 0, 0) DEF(or_i32, 1, 2, 0, 0) DEF(xor_i32, 1, 2, 0, 0) @@ -74,119 +67,114 @@ DEF(xor_i32, 1, 2, 0, 0) DEF(shl_i32, 1, 2, 0, 0) DEF(shr_i32, 1, 2, 0, 0) DEF(sar_i32, 1, 2, 0, 0) -DEF(rotl_i32, 1, 2, 0, IMPL(TCG_TARGET_HAS_rot_i32)) -DEF(rotr_i32, 1, 2, 0, IMPL(TCG_TARGET_HAS_rot_i32)) -DEF(deposit_i32, 1, 2, 2, IMPL(TCG_TARGET_HAS_deposit_i32)) -DEF(extract_i32, 1, 1, 2, IMPL(TCG_TARGET_HAS_extract_i32)) -DEF(sextract_i32, 1, 1, 2, IMPL(TCG_TARGET_HAS_sextract_i32)) -DEF(extract2_i32, 1, 2, 1, IMPL(TCG_TARGET_HAS_extract2_i32)) +DEF(rotl_i32, 1, 2, 0, 0) +DEF(rotr_i32, 1, 2, 0, 0) +DEF(deposit_i32, 1, 2, 2, 0) +DEF(extract_i32, 1, 1, 2, 0) +DEF(sextract_i32, 1, 1, 2, 0) +DEF(extract2_i32, 1, 2, 1, 0) DEF(brcond_i32, 0, 2, 2, TCG_OPF_BB_END | TCG_OPF_COND_BRANCH) -DEF(add2_i32, 2, 4, 0, IMPL(TCG_TARGET_HAS_add2_i32)) -DEF(sub2_i32, 2, 4, 0, IMPL(TCG_TARGET_HAS_sub2_i32)) -DEF(mulu2_i32, 2, 2, 0, IMPL(TCG_TARGET_HAS_mulu2_i32)) -DEF(muls2_i32, 2, 2, 0, IMPL(TCG_TARGET_HAS_muls2_i32)) -DEF(muluh_i32, 1, 2, 0, IMPL(TCG_TARGET_HAS_muluh_i32)) -DEF(mulsh_i32, 1, 2, 0, IMPL(TCG_TARGET_HAS_mulsh_i32)) -DEF(brcond2_i32, 0, 4, 2, - TCG_OPF_BB_END | TCG_OPF_COND_BRANCH | IMPL(TCG_TARGET_REG_BITS == 32)) -DEF(setcond2_i32, 1, 4, 1, IMPL(TCG_TARGET_REG_BITS == 32)) +DEF(add2_i32, 2, 4, 0, 0) +DEF(sub2_i32, 2, 4, 0, 0) +DEF(mulu2_i32, 2, 2, 0, 0) +DEF(muls2_i32, 2, 2, 0, 0) +DEF(muluh_i32, 1, 2, 0, 0) +DEF(mulsh_i32, 1, 2, 0, 0) +DEF(brcond2_i32, 0, 4, 2, TCG_OPF_BB_END | TCG_OPF_COND_BRANCH) +DEF(setcond2_i32, 1, 4, 1, 0) -DEF(ext8s_i32, 1, 1, 0, IMPL(TCG_TARGET_HAS_ext8s_i32)) -DEF(ext16s_i32, 1, 1, 0, IMPL(TCG_TARGET_HAS_ext16s_i32)) -DEF(ext8u_i32, 1, 1, 0, IMPL(TCG_TARGET_HAS_ext8u_i32)) -DEF(ext16u_i32, 1, 1, 0, IMPL(TCG_TARGET_HAS_ext16u_i32)) -DEF(bswap16_i32, 1, 1, 1, IMPL(TCG_TARGET_HAS_bswap16_i32)) -DEF(bswap32_i32, 1, 1, 1, IMPL(TCG_TARGET_HAS_bswap32_i32)) -DEF(not_i32, 1, 1, 0, IMPL(TCG_TARGET_HAS_not_i32)) +DEF(ext8s_i32, 1, 1, 0, 0) +DEF(ext16s_i32, 1, 1, 0, 0) +DEF(ext8u_i32, 1, 1, 0, 0) +DEF(ext16u_i32, 1, 1, 0, 0) +DEF(bswap16_i32, 1, 1, 1, 0) +DEF(bswap32_i32, 1, 1, 1, 0) +DEF(not_i32, 1, 1, 0, 0) DEF(neg_i32, 1, 1, 0, 0) -DEF(andc_i32, 1, 2, 0, IMPL(TCG_TARGET_HAS_andc_i32)) -DEF(orc_i32, 1, 2, 0, IMPL(TCG_TARGET_HAS_orc_i32)) -DEF(eqv_i32, 1, 2, 0, IMPL(TCG_TARGET_HAS_eqv_i32)) -DEF(nand_i32, 1, 2, 0, IMPL(TCG_TARGET_HAS_nand_i32)) -DEF(nor_i32, 1, 2, 0, IMPL(TCG_TARGET_HAS_nor_i32)) -DEF(clz_i32, 1, 2, 0, IMPL(TCG_TARGET_HAS_clz_i32)) -DEF(ctz_i32, 1, 2, 0, IMPL(TCG_TARGET_HAS_ctz_i32)) -DEF(ctpop_i32, 1, 1, 0, IMPL(TCG_TARGET_HAS_ctpop_i32)) +DEF(andc_i32, 1, 2, 0, 0) +DEF(orc_i32, 1, 2, 0, 0) +DEF(eqv_i32, 1, 2, 0, 0) +DEF(nand_i32, 1, 2, 0, 0) +DEF(nor_i32, 1, 2, 0, 0) +DEF(clz_i32, 1, 2, 0, 0) +DEF(ctz_i32, 1, 2, 0, 0) +DEF(ctpop_i32, 1, 1, 0, 0) DEF(mov_i64, 1, 1, 0, TCG_OPF_NOT_PRESENT) -DEF(setcond_i64, 1, 2, 1, IMPL64) -DEF(negsetcond_i64, 1, 2, 1, IMPL64 | IMPL(TCG_TARGET_HAS_negsetcond_i64)) -DEF(movcond_i64, 1, 4, 1, IMPL64) +DEF(setcond_i64, 1, 2, 1, 0) +DEF(negsetcond_i64, 1, 2, 1, 0) +DEF(movcond_i64, 1, 4, 1, 0) /* load/store */ -DEF(ld8u_i64, 1, 1, 1, IMPL64) -DEF(ld8s_i64, 1, 1, 1, IMPL64) -DEF(ld16u_i64, 1, 1, 1, IMPL64) -DEF(ld16s_i64, 1, 1, 1, IMPL64) -DEF(ld32u_i64, 1, 1, 1, IMPL64) -DEF(ld32s_i64, 1, 1, 1, IMPL64) -DEF(ld_i64, 1, 1, 1, IMPL64) -DEF(st8_i64, 0, 2, 1, IMPL64) -DEF(st16_i64, 0, 2, 1, IMPL64) -DEF(st32_i64, 0, 2, 1, IMPL64) -DEF(st_i64, 0, 2, 1, IMPL64) +DEF(ld8u_i64, 1, 1, 1, 0) +DEF(ld8s_i64, 1, 1, 1, 0) +DEF(ld16u_i64, 1, 1, 1, 0) +DEF(ld16s_i64, 1, 1, 1, 0) +DEF(ld32u_i64, 1, 1, 1, 0) +DEF(ld32s_i64, 1, 1, 1, 0) +DEF(ld_i64, 1, 1, 1, 0) +DEF(st8_i64, 0, 2, 1, 0) +DEF(st16_i64, 0, 2, 1, 0) +DEF(st32_i64, 0, 2, 1, 0) +DEF(st_i64, 0, 2, 1, 0) /* arith */ -DEF(add_i64, 1, 2, 0, IMPL64) -DEF(sub_i64, 1, 2, 0, IMPL64) -DEF(mul_i64, 1, 2, 0, IMPL64) -DEF(div_i64, 1, 2, 0, IMPL64 | IMPL(TCG_TARGET_HAS_div_i64)) -DEF(divu_i64, 1, 2, 0, IMPL64 | IMPL(TCG_TARGET_HAS_div_i64)) -DEF(rem_i64, 1, 2, 0, IMPL64 | IMPL(TCG_TARGET_HAS_rem_i64)) -DEF(remu_i64, 1, 2, 0, IMPL64 | IMPL(TCG_TARGET_HAS_rem_i64)) -DEF(div2_i64, 2, 3, 0, IMPL64 | IMPL(TCG_TARGET_HAS_div2_i64)) -DEF(divu2_i64, 2, 3, 0, IMPL64 | IMPL(TCG_TARGET_HAS_div2_i64)) -DEF(and_i64, 1, 2, 0, IMPL64) -DEF(or_i64, 1, 2, 0, IMPL64) -DEF(xor_i64, 1, 2, 0, IMPL64) +DEF(add_i64, 1, 2, 0, 0) +DEF(sub_i64, 1, 2, 0, 0) +DEF(mul_i64, 1, 2, 0, 0) +DEF(div_i64, 1, 2, 0, 0) +DEF(divu_i64, 1, 2, 0, 0) +DEF(rem_i64, 1, 2, 0, 0) +DEF(remu_i64, 1, 2, 0, 0) +DEF(div2_i64, 2, 3, 0, 0) +DEF(divu2_i64, 2, 3, 0, 0) +DEF(and_i64, 1, 2, 0, 0) +DEF(or_i64, 1, 2, 0, 0) +DEF(xor_i64, 1, 2, 0, 0) /* shifts/rotates */ -DEF(shl_i64, 1, 2, 0, IMPL64) -DEF(shr_i64, 1, 2, 0, IMPL64) -DEF(sar_i64, 1, 2, 0, IMPL64) -DEF(rotl_i64, 1, 2, 0, IMPL64 | IMPL(TCG_TARGET_HAS_rot_i64)) -DEF(rotr_i64, 1, 2, 0, IMPL64 | IMPL(TCG_TARGET_HAS_rot_i64)) -DEF(deposit_i64, 1, 2, 2, IMPL64 | IMPL(TCG_TARGET_HAS_deposit_i64)) -DEF(extract_i64, 1, 1, 2, IMPL64 | IMPL(TCG_TARGET_HAS_extract_i64)) -DEF(sextract_i64, 1, 1, 2, IMPL64 | IMPL(TCG_TARGET_HAS_sextract_i64)) -DEF(extract2_i64, 1, 2, 1, IMPL64 | IMPL(TCG_TARGET_HAS_extract2_i64)) +DEF(shl_i64, 1, 2, 0, 0) +DEF(shr_i64, 1, 2, 0, 0) +DEF(sar_i64, 1, 2, 0, 0) +DEF(rotl_i64, 1, 2, 0, 0) +DEF(rotr_i64, 1, 2, 0, 0) +DEF(deposit_i64, 1, 2, 2, 0) +DEF(extract_i64, 1, 1, 2, 0) +DEF(sextract_i64, 1, 1, 2, 0) +DEF(extract2_i64, 1, 2, 1, 0) /* size changing ops */ -DEF(ext_i32_i64, 1, 1, 0, IMPL64) -DEF(extu_i32_i64, 1, 1, 0, IMPL64) -DEF(extrl_i64_i32, 1, 1, 0, - IMPL(TCG_TARGET_HAS_extr_i64_i32) - | (TCG_TARGET_REG_BITS == 32 ? TCG_OPF_NOT_PRESENT : 0)) -DEF(extrh_i64_i32, 1, 1, 0, - IMPL(TCG_TARGET_HAS_extr_i64_i32) - | (TCG_TARGET_REG_BITS == 32 ? TCG_OPF_NOT_PRESENT : 0)) +DEF(ext_i32_i64, 1, 1, 0, 0) +DEF(extu_i32_i64, 1, 1, 0, 0) +DEF(extrl_i64_i32, 1, 1, 0, 0) +DEF(extrh_i64_i32, 1, 1, 0, 0) -DEF(brcond_i64, 0, 2, 2, TCG_OPF_BB_END | TCG_OPF_COND_BRANCH | IMPL64) -DEF(ext8s_i64, 1, 1, 0, IMPL64 | IMPL(TCG_TARGET_HAS_ext8s_i64)) -DEF(ext16s_i64, 1, 1, 0, IMPL64 | IMPL(TCG_TARGET_HAS_ext16s_i64)) -DEF(ext32s_i64, 1, 1, 0, IMPL64 | IMPL(TCG_TARGET_HAS_ext32s_i64)) -DEF(ext8u_i64, 1, 1, 0, IMPL64 | IMPL(TCG_TARGET_HAS_ext8u_i64)) -DEF(ext16u_i64, 1, 1, 0, IMPL64 | IMPL(TCG_TARGET_HAS_ext16u_i64)) -DEF(ext32u_i64, 1, 1, 0, IMPL64 | IMPL(TCG_TARGET_HAS_ext32u_i64)) -DEF(bswap16_i64, 1, 1, 1, IMPL64 | IMPL(TCG_TARGET_HAS_bswap16_i64)) -DEF(bswap32_i64, 1, 1, 1, IMPL64 | IMPL(TCG_TARGET_HAS_bswap32_i64)) -DEF(bswap64_i64, 1, 1, 1, IMPL64 | IMPL(TCG_TARGET_HAS_bswap64_i64)) -DEF(not_i64, 1, 1, 0, IMPL64 | IMPL(TCG_TARGET_HAS_not_i64)) -DEF(neg_i64, 1, 1, 0, IMPL64) -DEF(andc_i64, 1, 2, 0, IMPL64 | IMPL(TCG_TARGET_HAS_andc_i64)) -DEF(orc_i64, 1, 2, 0, IMPL64 | IMPL(TCG_TARGET_HAS_orc_i64)) -DEF(eqv_i64, 1, 2, 0, IMPL64 | IMPL(TCG_TARGET_HAS_eqv_i64)) -DEF(nand_i64, 1, 2, 0, IMPL64 | IMPL(TCG_TARGET_HAS_nand_i64)) -DEF(nor_i64, 1, 2, 0, IMPL64 | IMPL(TCG_TARGET_HAS_nor_i64)) -DEF(clz_i64, 1, 2, 0, IMPL64 | IMPL(TCG_TARGET_HAS_clz_i64)) -DEF(ctz_i64, 1, 2, 0, IMPL64 | IMPL(TCG_TARGET_HAS_ctz_i64)) -DEF(ctpop_i64, 1, 1, 0, IMPL64 | IMPL(TCG_TARGET_HAS_ctpop_i64)) +DEF(brcond_i64, 0, 2, 2, TCG_OPF_BB_END | TCG_OPF_COND_BRANCH) +DEF(ext8s_i64, 1, 1, 0, 0) +DEF(ext16s_i64, 1, 1, 0, 0) +DEF(ext32s_i64, 1, 1, 0, 0) +DEF(ext8u_i64, 1, 1, 0, 0) +DEF(ext16u_i64, 1, 1, 0, 0) +DEF(ext32u_i64, 1, 1, 0, 0) +DEF(bswap16_i64, 1, 1, 1, 0) +DEF(bswap32_i64, 1, 1, 1, 0) +DEF(bswap64_i64, 1, 1, 1, 0) +DEF(not_i64, 1, 1, 0, 0) +DEF(neg_i64, 1, 1, 0, 0) +DEF(andc_i64, 1, 2, 0, 0) +DEF(orc_i64, 1, 2, 0, 0) +DEF(eqv_i64, 1, 2, 0, 0) +DEF(nand_i64, 1, 2, 0, 0) +DEF(nor_i64, 1, 2, 0, 0) +DEF(clz_i64, 1, 2, 0, 0) +DEF(ctz_i64, 1, 2, 0, 0) +DEF(ctpop_i64, 1, 1, 0, 0) -DEF(add2_i64, 2, 4, 0, IMPL64 | IMPL(TCG_TARGET_HAS_add2_i64)) -DEF(sub2_i64, 2, 4, 0, IMPL64 | IMPL(TCG_TARGET_HAS_sub2_i64)) -DEF(mulu2_i64, 2, 2, 0, IMPL64 | IMPL(TCG_TARGET_HAS_mulu2_i64)) -DEF(muls2_i64, 2, 2, 0, IMPL64 | IMPL(TCG_TARGET_HAS_muls2_i64)) -DEF(muluh_i64, 1, 2, 0, IMPL64 | IMPL(TCG_TARGET_HAS_muluh_i64)) -DEF(mulsh_i64, 1, 2, 0, IMPL64 | IMPL(TCG_TARGET_HAS_mulsh_i64)) +DEF(add2_i64, 2, 4, 0, 0) +DEF(sub2_i64, 2, 4, 0, 0) +DEF(mulu2_i64, 2, 2, 0, 0) +DEF(muls2_i64, 2, 2, 0, 0) +DEF(muluh_i64, 1, 2, 0, 0) +DEF(mulsh_i64, 1, 2, 0, 0) #define DATA64_ARGS (TCG_TARGET_REG_BITS == 64 ? 1 : 2) @@ -221,34 +209,24 @@ DEF(qemu_st_a64_i64, 0, DATA64_ARGS + DATA64_ARGS, 1, /* Only used by i386 to cope with stupid register constraints. */ DEF(qemu_st8_a32_i32, 0, 1 + 1, 1, - TCG_OPF_CALL_CLOBBER | TCG_OPF_SIDE_EFFECTS | - IMPL(TCG_TARGET_HAS_qemu_st8_i32)) + TCG_OPF_CALL_CLOBBER | TCG_OPF_SIDE_EFFECTS) DEF(qemu_st8_a64_i32, 0, 1 + DATA64_ARGS, 1, - TCG_OPF_CALL_CLOBBER | TCG_OPF_SIDE_EFFECTS | - IMPL(TCG_TARGET_HAS_qemu_st8_i32)) + TCG_OPF_CALL_CLOBBER | TCG_OPF_SIDE_EFFECTS) /* Only for 64-bit hosts at the moment. */ -DEF(qemu_ld_a32_i128, 2, 1, 1, - TCG_OPF_CALL_CLOBBER | TCG_OPF_SIDE_EFFECTS | - IMPL(TCG_TARGET_HAS_qemu_ldst_i128)) -DEF(qemu_ld_a64_i128, 2, 1, 1, - TCG_OPF_CALL_CLOBBER | TCG_OPF_SIDE_EFFECTS | - IMPL(TCG_TARGET_HAS_qemu_ldst_i128)) -DEF(qemu_st_a32_i128, 0, 3, 1, - TCG_OPF_CALL_CLOBBER | TCG_OPF_SIDE_EFFECTS | - IMPL(TCG_TARGET_HAS_qemu_ldst_i128)) -DEF(qemu_st_a64_i128, 0, 3, 1, - TCG_OPF_CALL_CLOBBER | TCG_OPF_SIDE_EFFECTS | - IMPL(TCG_TARGET_HAS_qemu_ldst_i128)) +DEF(qemu_ld_a32_i128, 2, 1, 1, TCG_OPF_CALL_CLOBBER | TCG_OPF_SIDE_EFFECTS) +DEF(qemu_ld_a64_i128, 2, 1, 1, TCG_OPF_CALL_CLOBBER | TCG_OPF_SIDE_EFFECTS) +DEF(qemu_st_a32_i128, 0, 3, 1, TCG_OPF_CALL_CLOBBER | TCG_OPF_SIDE_EFFECTS) +DEF(qemu_st_a64_i128, 0, 3, 1, TCG_OPF_CALL_CLOBBER | TCG_OPF_SIDE_EFFECTS) /* Host vector support. */ -#define IMPLVEC TCG_OPF_VECTOR | IMPL(TCG_TARGET_MAYBE_vec) +#define IMPLVEC TCG_OPF_VECTOR DEF(mov_vec, 1, 1, 0, TCG_OPF_VECTOR | TCG_OPF_NOT_PRESENT) DEF(dup_vec, 1, 1, 0, IMPLVEC) -DEF(dup2_vec, 1, 2, 0, IMPLVEC | IMPL(TCG_TARGET_REG_BITS == 32)) +DEF(dup2_vec, 1, 2, 0, IMPLVEC) DEF(ld_vec, 1, 1, 1, IMPLVEC) DEF(st_vec, 0, 2, 1, IMPLVEC) @@ -256,55 +234,53 @@ DEF(dupm_vec, 1, 1, 1, IMPLVEC) DEF(add_vec, 1, 2, 0, IMPLVEC) DEF(sub_vec, 1, 2, 0, IMPLVEC) -DEF(mul_vec, 1, 2, 0, IMPLVEC | IMPL(TCG_TARGET_HAS_mul_vec)) -DEF(neg_vec, 1, 1, 0, IMPLVEC | IMPL(TCG_TARGET_HAS_neg_vec)) -DEF(abs_vec, 1, 1, 0, IMPLVEC | IMPL(TCG_TARGET_HAS_abs_vec)) -DEF(ssadd_vec, 1, 2, 0, IMPLVEC | IMPL(TCG_TARGET_HAS_sat_vec)) -DEF(usadd_vec, 1, 2, 0, IMPLVEC | IMPL(TCG_TARGET_HAS_sat_vec)) -DEF(sssub_vec, 1, 2, 0, IMPLVEC | IMPL(TCG_TARGET_HAS_sat_vec)) -DEF(ussub_vec, 1, 2, 0, IMPLVEC | IMPL(TCG_TARGET_HAS_sat_vec)) -DEF(smin_vec, 1, 2, 0, IMPLVEC | IMPL(TCG_TARGET_HAS_minmax_vec)) -DEF(umin_vec, 1, 2, 0, IMPLVEC | IMPL(TCG_TARGET_HAS_minmax_vec)) -DEF(smax_vec, 1, 2, 0, IMPLVEC | IMPL(TCG_TARGET_HAS_minmax_vec)) -DEF(umax_vec, 1, 2, 0, IMPLVEC | IMPL(TCG_TARGET_HAS_minmax_vec)) +DEF(mul_vec, 1, 2, 0, IMPLVEC) +DEF(neg_vec, 1, 1, 0, IMPLVEC) +DEF(abs_vec, 1, 1, 0, IMPLVEC) +DEF(ssadd_vec, 1, 2, 0, IMPLVEC) +DEF(usadd_vec, 1, 2, 0, IMPLVEC) +DEF(sssub_vec, 1, 2, 0, IMPLVEC) +DEF(ussub_vec, 1, 2, 0, IMPLVEC) +DEF(smin_vec, 1, 2, 0, IMPLVEC) +DEF(umin_vec, 1, 2, 0, IMPLVEC) +DEF(smax_vec, 1, 2, 0, IMPLVEC) +DEF(umax_vec, 1, 2, 0, IMPLVEC) DEF(and_vec, 1, 2, 0, IMPLVEC) DEF(or_vec, 1, 2, 0, IMPLVEC) DEF(xor_vec, 1, 2, 0, IMPLVEC) -DEF(andc_vec, 1, 2, 0, IMPLVEC | IMPL(TCG_TARGET_HAS_andc_vec)) -DEF(orc_vec, 1, 2, 0, IMPLVEC | IMPL(TCG_TARGET_HAS_orc_vec)) -DEF(nand_vec, 1, 2, 0, IMPLVEC | IMPL(TCG_TARGET_HAS_nand_vec)) -DEF(nor_vec, 1, 2, 0, IMPLVEC | IMPL(TCG_TARGET_HAS_nor_vec)) -DEF(eqv_vec, 1, 2, 0, IMPLVEC | IMPL(TCG_TARGET_HAS_eqv_vec)) -DEF(not_vec, 1, 1, 0, IMPLVEC | IMPL(TCG_TARGET_HAS_not_vec)) +DEF(andc_vec, 1, 2, 0, IMPLVEC) +DEF(orc_vec, 1, 2, 0, IMPLVEC) +DEF(nand_vec, 1, 2, 0, IMPLVEC) +DEF(nor_vec, 1, 2, 0, IMPLVEC) +DEF(eqv_vec, 1, 2, 0, IMPLVEC) +DEF(not_vec, 1, 1, 0, IMPLVEC) -DEF(shli_vec, 1, 1, 1, IMPLVEC | IMPL(TCG_TARGET_HAS_shi_vec)) -DEF(shri_vec, 1, 1, 1, IMPLVEC | IMPL(TCG_TARGET_HAS_shi_vec)) -DEF(sari_vec, 1, 1, 1, IMPLVEC | IMPL(TCG_TARGET_HAS_shi_vec)) -DEF(rotli_vec, 1, 1, 1, IMPLVEC | IMPL(TCG_TARGET_HAS_roti_vec)) +DEF(shli_vec, 1, 1, 1, IMPLVEC) +DEF(shri_vec, 1, 1, 1, IMPLVEC) +DEF(sari_vec, 1, 1, 1, IMPLVEC) +DEF(rotli_vec, 1, 1, 1, IMPLVEC) -DEF(shls_vec, 1, 2, 0, IMPLVEC | IMPL(TCG_TARGET_HAS_shs_vec)) -DEF(shrs_vec, 1, 2, 0, IMPLVEC | IMPL(TCG_TARGET_HAS_shs_vec)) -DEF(sars_vec, 1, 2, 0, IMPLVEC | IMPL(TCG_TARGET_HAS_shs_vec)) -DEF(rotls_vec, 1, 2, 0, IMPLVEC | IMPL(TCG_TARGET_HAS_rots_vec)) +DEF(shls_vec, 1, 2, 0, IMPLVEC) +DEF(shrs_vec, 1, 2, 0, IMPLVEC) +DEF(sars_vec, 1, 2, 0, IMPLVEC) +DEF(rotls_vec, 1, 2, 0, IMPLVEC) -DEF(shlv_vec, 1, 2, 0, IMPLVEC | IMPL(TCG_TARGET_HAS_shv_vec)) -DEF(shrv_vec, 1, 2, 0, IMPLVEC | IMPL(TCG_TARGET_HAS_shv_vec)) -DEF(sarv_vec, 1, 2, 0, IMPLVEC | IMPL(TCG_TARGET_HAS_shv_vec)) -DEF(rotlv_vec, 1, 2, 0, IMPLVEC | IMPL(TCG_TARGET_HAS_rotv_vec)) -DEF(rotrv_vec, 1, 2, 0, IMPLVEC | IMPL(TCG_TARGET_HAS_rotv_vec)) +DEF(shlv_vec, 1, 2, 0, IMPLVEC) +DEF(shrv_vec, 1, 2, 0, IMPLVEC) +DEF(sarv_vec, 1, 2, 0, IMPLVEC) +DEF(rotlv_vec, 1, 2, 0, IMPLVEC) +DEF(rotrv_vec, 1, 2, 0, IMPLVEC) DEF(cmp_vec, 1, 2, 1, IMPLVEC) -DEF(bitsel_vec, 1, 3, 0, IMPLVEC | IMPL(TCG_TARGET_HAS_bitsel_vec)) -DEF(cmpsel_vec, 1, 4, 1, IMPLVEC | IMPL(TCG_TARGET_HAS_cmpsel_vec)) +DEF(bitsel_vec, 1, 3, 0, IMPLVEC) +DEF(cmpsel_vec, 1, 4, 1, IMPLVEC) DEF(last_generic, 0, 0, 0, TCG_OPF_NOT_PRESENT) #include "tcg-target-opc.h.inc" #undef DATA64_ARGS -#undef IMPL -#undef IMPL64 #undef IMPLVEC #undef DEF From patchwork Fri Jan 17 18:24:33 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858250 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp844368wrb; Fri, 17 Jan 2025 10:31:48 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXoWb06Dk11uQvo5UimNZMZDpHRZwQIYYEpWMcL+7/e90V9VtFsEMPYGgf23oqJKDBjNzytbg==@linaro.org X-Google-Smtp-Source: AGHT+IGslYr7rMPWxwEZRBnZwHnNjdyxpO9G+CC4UED/qyl/SriATRW4HU/GPPvnspm5x1tMDhGi X-Received: by 2002:a05:6122:4f96:b0:518:7bc4:fcc0 with SMTP id 71dfb90a1353d-51d763559admr3880560e0c.2.1737138708653; Fri, 17 Jan 2025 10:31:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138708; cv=none; d=google.com; s=arc-20240605; b=L9K9ehq5owpIKFviiQyTqVqNgJGiGzibA5zFOIwBUAtGKZCMuOlHsdvBAM9gA/CIhU QSP6tRAsyDvs+wL94ZjFXlzRzB0T4FTYLqh+wqXWuKtyK7UsU9YddUC7iDRbRVLmNHqX iUsro+jd8wQL9P8AKAWMuLxY6FPxyfyf5wHb9YHbIDmL3f5XgAseAjPOUa6+1gC7X8ul WgPZIDLbLSLdU0HaziGU5CNQ6HhRN0pmRdRAF38kmHU8btXXLXpFpnH3Ds4Ll/VlY5iO iDpC/9dDRXD6L0ng7jRM1SYIdOpPjcQD+VpzFajdtlrg+tW8YeLI1isOs5hMQsEx8f5A rjXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=ZfUBmqSQZyEtq+ZG7rFoErR6iukoMwH0uv4JfPR/g4E=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=B1NHG6z/hMf+5LGVMxva1+WMjB0dTKwGII1u2qau7iCaHvTt75ZYuRtVjODxLahIMb kJTCLMz+Kor+MUITbhBno2L1Lx+9d6RNzuEbI3MbAn1Y5pICD2VXyneyKa11czFdluhq M1M0Qg0KzFoa8sgpjZfB2tBdzOUe8Njap5eqMYNn2hdE9+vkHVoJb1WFPo5HcrEmk4rt Ky7laJqMfB1iu9a2eqjFjecxoTy28mFny15E0pEAD7b+G6vDvTKWqztcZM+R53qOREWc mbp4ttvI7KBm3vZpz1J+Di2EKCnqWY0rmMFloX9VbAjF7221BuL6Ng08zPXIO3cqHFPA d5eg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="J4NQ9/48"; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 71dfb90a1353d-51cf5720d7asi1112387e0c.141.2025.01.17.10.31.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:31:48 -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="J4NQ9/48"; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr5d-0004vb-Mx; Fri, 17 Jan 2025 13:29:05 -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 1tYr5V-0004NF-RE for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:28:58 -0500 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr5T-0000B4-KY for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:28:57 -0500 Received: by mail-pj1-x102c.google.com with SMTP id 98e67ed59e1d1-2ef714374c0so4069381a91.0 for ; Fri, 17 Jan 2025 10:28:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138534; x=1737743334; 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=ZfUBmqSQZyEtq+ZG7rFoErR6iukoMwH0uv4JfPR/g4E=; b=J4NQ9/48v6NCgYO/l1tp6Pq1S56bCCIhN83LE3haXGCNZtUyYf/NbN5tYXOEjowS+Y SAlhvhjLJ/1PlqtDTwOKlsVYPVuqriahfyWbh5gfKYJQ10yJ+8c/p8i5CBvmm3ktD7T7 3mRPX+JY8MQppc7bQl2KXzH1MdJ77IgG02Nb/mkaE7F1Z4DXvE8T1dgHVLR1MU7JBnAD BLL1OyNeXdfvc3b6GUcWYdOCHx79plsNPFAPb9xWbcAfyVAKcJEhjLNQvUBvXRmq2PLP wrZDvSZTUyg4AFo15e0KEcacuaU0kjI65qb6z2rtLgz1snsuUOH/yPUqb2Ga/k0j5H2G ui4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138534; x=1737743334; 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=ZfUBmqSQZyEtq+ZG7rFoErR6iukoMwH0uv4JfPR/g4E=; b=rteFx3JgWdF2rCGLQMbQG4DGCuaVcmIkmvC+TKmCspR9WYHA/dzQSyiJqItivD/RC1 2bN+lPDzGCPnj8I2jlILo3TQQIlkwHKI9bvJYB92f8Pj6oqw0Ay4xi4L+jDpLRvwuSal xvMdQk0dUyDKwpivzLeVjaF9DRJRpzDsLJVAt/0nALWZv+d9qQu8M4oKbOK9GP3bjDOR 3+I0XQhzM+Vy83Ka/6w8mmWU5KhiYlFeRvSjsQSB3QSmqwOlf1xPVjU7GawmT8LRXux8 dY+uS9aqbTa9Z7gcUMCnRu9iUPQZsxUtiOtnSTKkLLVshRsq6ryPeXLeBuU19QoSccMW zu+Q== X-Gm-Message-State: AOJu0Yyaho5uxxqJvyXO92fDbl3u2Dfwq0wfIIfdEaQn09if7sXfPeyi Mp5fCk9SbziiwqoUBJa20779/tknTdfJ6qPz3JUUJAENolqpxByQnhxu+RtQYdsg86iOuh3BR+q Q X-Gm-Gg: ASbGncty0my97G2yoQDjQ12xWDZRH6OVoINf67X3i0mYDkJ/RO+l2cy8umGLnmnrAEp bFrzOzU9eG2BXuf/9sdy4/+KdpAFF8a/Mgrf5B5wLUUuGxkINaf1urpNinlKxwyeSft7reSYAF/ yn5fylwCUW+0jOA7eNDm2c1Vd1Wwz0zfRp6LPObf0ZKogofXqFQERjbYlgXMy1AAhL/eRl6oeN4 7vchZnjUzKp0L79D0InEKzUq7hT3ZAP4AmAVDRUOHRusemoPFT2myA8jTba/zSIBc76/TQ0HVD0 SiCuXS4/ID+LRg0= X-Received: by 2002:a17:90b:3eca:b0:2ee:8253:9a9f with SMTP id 98e67ed59e1d1-2f728e48411mr18662547a91.11.1737138533963; Fri, 17 Jan 2025 10:28:53 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f77629bf96sm2614105a91.36.2025.01.17.10.28.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:28:50 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 45/68] tcg: Replace IMPLVEC with TCG_OPF_VECTOR Date: Fri, 17 Jan 2025 10:24:33 -0800 Message-ID: <20250117182456.2077110-46-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102c; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102c.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 This is now a direct replacement. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/tcg/tcg-opc.h | 89 +++++++++++++++----------------- tcg/aarch64/tcg-target-opc.h.inc | 4 +- tcg/arm/tcg-target-opc.h.inc | 6 +-- tcg/i386/tcg-target-opc.h.inc | 22 ++++---- tcg/ppc/tcg-target-opc.h.inc | 12 ++--- tcg/s390x/tcg-target-opc.h.inc | 6 +-- 6 files changed, 68 insertions(+), 71 deletions(-) diff --git a/include/tcg/tcg-opc.h b/include/tcg/tcg-opc.h index 559f5971e6..9383e295f4 100644 --- a/include/tcg/tcg-opc.h +++ b/include/tcg/tcg-opc.h @@ -221,66 +221,63 @@ DEF(qemu_st_a64_i128, 0, 3, 1, TCG_OPF_CALL_CLOBBER | TCG_OPF_SIDE_EFFECTS) /* Host vector support. */ -#define IMPLVEC TCG_OPF_VECTOR - DEF(mov_vec, 1, 1, 0, TCG_OPF_VECTOR | TCG_OPF_NOT_PRESENT) -DEF(dup_vec, 1, 1, 0, IMPLVEC) -DEF(dup2_vec, 1, 2, 0, IMPLVEC) +DEF(dup_vec, 1, 1, 0, TCG_OPF_VECTOR) +DEF(dup2_vec, 1, 2, 0, TCG_OPF_VECTOR) -DEF(ld_vec, 1, 1, 1, IMPLVEC) -DEF(st_vec, 0, 2, 1, IMPLVEC) -DEF(dupm_vec, 1, 1, 1, IMPLVEC) +DEF(ld_vec, 1, 1, 1, TCG_OPF_VECTOR) +DEF(st_vec, 0, 2, 1, TCG_OPF_VECTOR) +DEF(dupm_vec, 1, 1, 1, TCG_OPF_VECTOR) -DEF(add_vec, 1, 2, 0, IMPLVEC) -DEF(sub_vec, 1, 2, 0, IMPLVEC) -DEF(mul_vec, 1, 2, 0, IMPLVEC) -DEF(neg_vec, 1, 1, 0, IMPLVEC) -DEF(abs_vec, 1, 1, 0, IMPLVEC) -DEF(ssadd_vec, 1, 2, 0, IMPLVEC) -DEF(usadd_vec, 1, 2, 0, IMPLVEC) -DEF(sssub_vec, 1, 2, 0, IMPLVEC) -DEF(ussub_vec, 1, 2, 0, IMPLVEC) -DEF(smin_vec, 1, 2, 0, IMPLVEC) -DEF(umin_vec, 1, 2, 0, IMPLVEC) -DEF(smax_vec, 1, 2, 0, IMPLVEC) -DEF(umax_vec, 1, 2, 0, IMPLVEC) +DEF(add_vec, 1, 2, 0, TCG_OPF_VECTOR) +DEF(sub_vec, 1, 2, 0, TCG_OPF_VECTOR) +DEF(mul_vec, 1, 2, 0, TCG_OPF_VECTOR) +DEF(neg_vec, 1, 1, 0, TCG_OPF_VECTOR) +DEF(abs_vec, 1, 1, 0, TCG_OPF_VECTOR) +DEF(ssadd_vec, 1, 2, 0, TCG_OPF_VECTOR) +DEF(usadd_vec, 1, 2, 0, TCG_OPF_VECTOR) +DEF(sssub_vec, 1, 2, 0, TCG_OPF_VECTOR) +DEF(ussub_vec, 1, 2, 0, TCG_OPF_VECTOR) +DEF(smin_vec, 1, 2, 0, TCG_OPF_VECTOR) +DEF(umin_vec, 1, 2, 0, TCG_OPF_VECTOR) +DEF(smax_vec, 1, 2, 0, TCG_OPF_VECTOR) +DEF(umax_vec, 1, 2, 0, TCG_OPF_VECTOR) -DEF(and_vec, 1, 2, 0, IMPLVEC) -DEF(or_vec, 1, 2, 0, IMPLVEC) -DEF(xor_vec, 1, 2, 0, IMPLVEC) -DEF(andc_vec, 1, 2, 0, IMPLVEC) -DEF(orc_vec, 1, 2, 0, IMPLVEC) -DEF(nand_vec, 1, 2, 0, IMPLVEC) -DEF(nor_vec, 1, 2, 0, IMPLVEC) -DEF(eqv_vec, 1, 2, 0, IMPLVEC) -DEF(not_vec, 1, 1, 0, IMPLVEC) +DEF(and_vec, 1, 2, 0, TCG_OPF_VECTOR) +DEF(or_vec, 1, 2, 0, TCG_OPF_VECTOR) +DEF(xor_vec, 1, 2, 0, TCG_OPF_VECTOR) +DEF(andc_vec, 1, 2, 0, TCG_OPF_VECTOR) +DEF(orc_vec, 1, 2, 0, TCG_OPF_VECTOR) +DEF(nand_vec, 1, 2, 0, TCG_OPF_VECTOR) +DEF(nor_vec, 1, 2, 0, TCG_OPF_VECTOR) +DEF(eqv_vec, 1, 2, 0, TCG_OPF_VECTOR) +DEF(not_vec, 1, 1, 0, TCG_OPF_VECTOR) -DEF(shli_vec, 1, 1, 1, IMPLVEC) -DEF(shri_vec, 1, 1, 1, IMPLVEC) -DEF(sari_vec, 1, 1, 1, IMPLVEC) -DEF(rotli_vec, 1, 1, 1, IMPLVEC) +DEF(shli_vec, 1, 1, 1, TCG_OPF_VECTOR) +DEF(shri_vec, 1, 1, 1, TCG_OPF_VECTOR) +DEF(sari_vec, 1, 1, 1, TCG_OPF_VECTOR) +DEF(rotli_vec, 1, 1, 1, TCG_OPF_VECTOR) -DEF(shls_vec, 1, 2, 0, IMPLVEC) -DEF(shrs_vec, 1, 2, 0, IMPLVEC) -DEF(sars_vec, 1, 2, 0, IMPLVEC) -DEF(rotls_vec, 1, 2, 0, IMPLVEC) +DEF(shls_vec, 1, 2, 0, TCG_OPF_VECTOR) +DEF(shrs_vec, 1, 2, 0, TCG_OPF_VECTOR) +DEF(sars_vec, 1, 2, 0, TCG_OPF_VECTOR) +DEF(rotls_vec, 1, 2, 0, TCG_OPF_VECTOR) -DEF(shlv_vec, 1, 2, 0, IMPLVEC) -DEF(shrv_vec, 1, 2, 0, IMPLVEC) -DEF(sarv_vec, 1, 2, 0, IMPLVEC) -DEF(rotlv_vec, 1, 2, 0, IMPLVEC) -DEF(rotrv_vec, 1, 2, 0, IMPLVEC) +DEF(shlv_vec, 1, 2, 0, TCG_OPF_VECTOR) +DEF(shrv_vec, 1, 2, 0, TCG_OPF_VECTOR) +DEF(sarv_vec, 1, 2, 0, TCG_OPF_VECTOR) +DEF(rotlv_vec, 1, 2, 0, TCG_OPF_VECTOR) +DEF(rotrv_vec, 1, 2, 0, TCG_OPF_VECTOR) -DEF(cmp_vec, 1, 2, 1, IMPLVEC) +DEF(cmp_vec, 1, 2, 1, TCG_OPF_VECTOR) -DEF(bitsel_vec, 1, 3, 0, IMPLVEC) -DEF(cmpsel_vec, 1, 4, 1, IMPLVEC) +DEF(bitsel_vec, 1, 3, 0, TCG_OPF_VECTOR) +DEF(cmpsel_vec, 1, 4, 1, TCG_OPF_VECTOR) DEF(last_generic, 0, 0, 0, TCG_OPF_NOT_PRESENT) #include "tcg-target-opc.h.inc" #undef DATA64_ARGS -#undef IMPLVEC #undef DEF diff --git a/tcg/aarch64/tcg-target-opc.h.inc b/tcg/aarch64/tcg-target-opc.h.inc index bce30accd9..5382315c41 100644 --- a/tcg/aarch64/tcg-target-opc.h.inc +++ b/tcg/aarch64/tcg-target-opc.h.inc @@ -11,5 +11,5 @@ * consider these to be UNSPEC with names. */ -DEF(aa64_sshl_vec, 1, 2, 0, IMPLVEC) -DEF(aa64_sli_vec, 1, 2, 1, IMPLVEC) +DEF(aa64_sshl_vec, 1, 2, 0, TCG_OPF_VECTOR) +DEF(aa64_sli_vec, 1, 2, 1, TCG_OPF_VECTOR) diff --git a/tcg/arm/tcg-target-opc.h.inc b/tcg/arm/tcg-target-opc.h.inc index d38af9a808..70394e0282 100644 --- a/tcg/arm/tcg-target-opc.h.inc +++ b/tcg/arm/tcg-target-opc.h.inc @@ -11,6 +11,6 @@ * consider these to be UNSPEC with names. */ -DEF(arm_sli_vec, 1, 2, 1, IMPLVEC) -DEF(arm_sshl_vec, 1, 2, 0, IMPLVEC) -DEF(arm_ushl_vec, 1, 2, 0, IMPLVEC) +DEF(arm_sli_vec, 1, 2, 1, TCG_OPF_VECTOR) +DEF(arm_sshl_vec, 1, 2, 0, TCG_OPF_VECTOR) +DEF(arm_ushl_vec, 1, 2, 0, TCG_OPF_VECTOR) diff --git a/tcg/i386/tcg-target-opc.h.inc b/tcg/i386/tcg-target-opc.h.inc index 4ffc084bda..8cc0dbaeaf 100644 --- a/tcg/i386/tcg-target-opc.h.inc +++ b/tcg/i386/tcg-target-opc.h.inc @@ -24,14 +24,14 @@ * consider these to be UNSPEC with names. */ -DEF(x86_shufps_vec, 1, 2, 1, IMPLVEC) -DEF(x86_blend_vec, 1, 2, 1, IMPLVEC) -DEF(x86_packss_vec, 1, 2, 0, IMPLVEC) -DEF(x86_packus_vec, 1, 2, 0, IMPLVEC) -DEF(x86_psrldq_vec, 1, 1, 1, IMPLVEC) -DEF(x86_vperm2i128_vec, 1, 2, 1, IMPLVEC) -DEF(x86_punpckl_vec, 1, 2, 0, IMPLVEC) -DEF(x86_punpckh_vec, 1, 2, 0, IMPLVEC) -DEF(x86_vpshldi_vec, 1, 2, 1, IMPLVEC) -DEF(x86_vpshldv_vec, 1, 3, 0, IMPLVEC) -DEF(x86_vpshrdv_vec, 1, 3, 0, IMPLVEC) +DEF(x86_shufps_vec, 1, 2, 1, TCG_OPF_VECTOR) +DEF(x86_blend_vec, 1, 2, 1, TCG_OPF_VECTOR) +DEF(x86_packss_vec, 1, 2, 0, TCG_OPF_VECTOR) +DEF(x86_packus_vec, 1, 2, 0, TCG_OPF_VECTOR) +DEF(x86_psrldq_vec, 1, 1, 1, TCG_OPF_VECTOR) +DEF(x86_vperm2i128_vec, 1, 2, 1, TCG_OPF_VECTOR) +DEF(x86_punpckl_vec, 1, 2, 0, TCG_OPF_VECTOR) +DEF(x86_punpckh_vec, 1, 2, 0, TCG_OPF_VECTOR) +DEF(x86_vpshldi_vec, 1, 2, 1, TCG_OPF_VECTOR) +DEF(x86_vpshldv_vec, 1, 3, 0, TCG_OPF_VECTOR) +DEF(x86_vpshrdv_vec, 1, 3, 0, TCG_OPF_VECTOR) diff --git a/tcg/ppc/tcg-target-opc.h.inc b/tcg/ppc/tcg-target-opc.h.inc index db514403c3..c3635831b5 100644 --- a/tcg/ppc/tcg-target-opc.h.inc +++ b/tcg/ppc/tcg-target-opc.h.inc @@ -24,9 +24,9 @@ * consider these to be UNSPEC with names. */ -DEF(ppc_mrgh_vec, 1, 2, 0, IMPLVEC) -DEF(ppc_mrgl_vec, 1, 2, 0, IMPLVEC) -DEF(ppc_msum_vec, 1, 3, 0, IMPLVEC) -DEF(ppc_muleu_vec, 1, 2, 0, IMPLVEC) -DEF(ppc_mulou_vec, 1, 2, 0, IMPLVEC) -DEF(ppc_pkum_vec, 1, 2, 0, IMPLVEC) +DEF(ppc_mrgh_vec, 1, 2, 0, TCG_OPF_VECTOR) +DEF(ppc_mrgl_vec, 1, 2, 0, TCG_OPF_VECTOR) +DEF(ppc_msum_vec, 1, 3, 0, TCG_OPF_VECTOR) +DEF(ppc_muleu_vec, 1, 2, 0, TCG_OPF_VECTOR) +DEF(ppc_mulou_vec, 1, 2, 0, TCG_OPF_VECTOR) +DEF(ppc_pkum_vec, 1, 2, 0, TCG_OPF_VECTOR) diff --git a/tcg/s390x/tcg-target-opc.h.inc b/tcg/s390x/tcg-target-opc.h.inc index 0eb2350fb3..61237b39cd 100644 --- a/tcg/s390x/tcg-target-opc.h.inc +++ b/tcg/s390x/tcg-target-opc.h.inc @@ -10,6 +10,6 @@ * emitted by tcg_expand_vec_op. For those familiar with GCC internals, * consider these to be UNSPEC with names. */ -DEF(s390_vuph_vec, 1, 1, 0, IMPLVEC) -DEF(s390_vupl_vec, 1, 1, 0, IMPLVEC) -DEF(s390_vpks_vec, 1, 2, 0, IMPLVEC) +DEF(s390_vuph_vec, 1, 1, 0, TCG_OPF_VECTOR) +DEF(s390_vupl_vec, 1, 1, 0, TCG_OPF_VECTOR) +DEF(s390_vpks_vec, 1, 2, 0, TCG_OPF_VECTOR) From patchwork Fri Jan 17 18:24:34 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858248 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp844100wrb; Fri, 17 Jan 2025 10:31:16 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUeinjNnhezR4bq37vc67AQMPRKPy6KTtYA5XQnnn1X6uM+3fA+srHI4/CxexmhMpJhtKY5dg==@linaro.org X-Google-Smtp-Source: AGHT+IEheTEh8Y7im5hFlguy7pZsIGJ67QFaKoQi21U0t5TULUXEUw3SJCbmYBX6EppJYS990xrO X-Received: by 2002:a05:6102:570c:b0:4b2:5c1a:bb57 with SMTP id ada2fe7eead31-4b690cc50camr3798357137.20.1737138676545; Fri, 17 Jan 2025 10:31:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138676; cv=none; d=google.com; s=arc-20240605; b=VRfz9yX805fp1X9wfNMpLOIe9lFuzSxsfLF/+YYpeYToEmLX2L+xqH/wEzBJu3rVP9 UlCq5C7b1Ab57xegZwI8ZF2cJr07IKKt5FyMZBO6Hasoj+1RDn1NdEHm29WPoeO9eOHw tIlzDfS7RXWtUTCYIdfuPbhbNT2DrTSn1uy+z1yOi/GoUGzGa+yyBeN8zWOq3oFLg9j6 cQROgTqz/v3gqhlxzJC2yX5TVTIyREcdqxU3UpKnk+NO1cuOs+UkG2rrt6Ud7A0t7YpM tE04pp9TXjfvpM7UbXR0jwnTpq6urDioqsM7Db8zYDWpbaaF9KWIZAtXnHANktSMJ+Qc ILXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=oeoxNnJvMgFI3q4piiiduYU8RMXHoVGq3FrMzVqgkyQ=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=JaumivTenLDBbchXgGtL2jfL+M/8BaudZTiXNnaN+0AtNdw3zdWkno/yoqSAuF5vpE sVB4qzPEJpz9t2o9z7AmEscUShaO9UU3H9cewFuzYqM/5EVQeBx7Ax8vAqasGSq9xAfP DKgobq1sA0A3h+1Op29l7LwbkNlWPpyGIHkHyOTDLnK7svb+Dsh4MSvw01TmV0KjxatR SEgGL+bba4wETZwy33qYM4DvdcAzOWpSikzASZcsbGKwwW3ydk2HzT2g6nCyZTosAXxD F5qOTGqrrN4k0QBMz+bSyde45FYhVI1Rp7kmhiHe6NfIf2ElLg0B0eJUlgdAH5qZya1E W9fQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xegajlZ4; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id ada2fe7eead31-4b68a1b0008si1160561137.122.2025.01.17.10.31.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:31:16 -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=xegajlZ4; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr5h-0005Cp-Ep; Fri, 17 Jan 2025 13:29:09 -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 1tYr5a-0004th-MP for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:29:03 -0500 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr5Z-0000Do-3u for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:29:02 -0500 Received: by mail-pj1-x1032.google.com with SMTP id 98e67ed59e1d1-2ef6c56032eso3302762a91.2 for ; Fri, 17 Jan 2025 10:28:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138539; x=1737743339; 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=oeoxNnJvMgFI3q4piiiduYU8RMXHoVGq3FrMzVqgkyQ=; b=xegajlZ4Y7RdAIVY7r3vpR1gj167f/fztGcHm+eiqQZKPqvmC30NB8p92eq05+auCH qkVjSUOlUNFvebuehNp/wlQKXZ6KAykBMWW1H68dD0SBvHWupBME6J2mAhclJ8PBk8WO Y6sstZNzugb5q45qiNLh79TmCibKjz/OZEPNogg61fMwFAP1P0TFLYGluFasz3JlpDMf RSw9E2feIxJT1eovjyeUUlR3hsZ4CTqFqBpmPyfvx4gjWQjudslXDZtUPjNGF8ViPdKU +j8b+3mYW+tH6zrz0vRBewGCdm7n3ceBIKpPsDp3OW6sLuyWBKWSz2aJmcaGP1O0XVe4 KUbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138539; x=1737743339; 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=oeoxNnJvMgFI3q4piiiduYU8RMXHoVGq3FrMzVqgkyQ=; b=bkgtnsCVNqFKrzgoQCyHDyLJhMI9mcSQsVBV647hvGeGdUavJGuc2KkbxFvNR9gX1q 4oukd7P6evI6ZLriZB7oRfu8mXmy0OK9yuuIgpUdXNSDiV7L/P31qKNWKCZHOSWHVQmS c6RVJFY6kUEmoDeN4JvfH9bWJ623+NlcSJ5hLJLCY2eLATQLJfg8zKmT6SRq7+KF7fCZ V1qlV1DCFOQd8klH6pFUXzcTPi5cWKX2Ud7jvPU+oAr/h0VCMsxzwcO7OPrZHVmHztnz ljwenxiF5nX8dTSIue78vn/ZehPXRDcYMw6OkWfGKj87f7c90VSJ2Ru/B7cuxzd/t/T0 L4oA== X-Gm-Message-State: AOJu0YxGCtZqLh7Rzn5Ki5p15xwNIutWA/G6x8b0yZPMzgwW5kGJZTsl EQs2Hdxhvo7IFaeHsyG/hP5lOTQ9ZhP0seVPsyLdxqOFkWKjup8AB56n4e7y8aHphKY0rO++S/0 y X-Gm-Gg: ASbGncvNcvloO5hCo7yhJquJyD/F5r0XvP/BcRuM47pIrY8RC0Zi9V6FehoooROwNn8 NnV5UYm5HTv6GDqJfRRHUBgetaDsKgGwj0FOMDVM4lmpbKrcGgiZRLpwO/OoZx9h0xFYPSZTlKA ceHrIcig3+YD0isEu6yiTBPBiIunZgk2I49gHjvkzsh1PKW8GEIHoP4YZDbZgJtvYG1/AWMGcTn vtjQF1QC4tm7rFzjc2QPLp98/gB8YGJP7Bj799kux8eAcojq+EisJRlZk1qW+45W+X/REP2IbWQ IQ0ttDov3yxS4ys= X-Received: by 2002:a17:90b:1f8e:b0:2ef:114d:7bf8 with SMTP id 98e67ed59e1d1-2f782c4ff33mr4792978a91.6.1737138539086; Fri, 17 Jan 2025 10:28:59 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f77629bf96sm2614105a91.36.2025.01.17.10.28.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:28:55 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 46/68] tcg/mips: Expand bswap unconditionally Date: Fri, 17 Jan 2025 10:24:34 -0800 Message-ID: <20250117182456.2077110-47-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1032; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1032.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 We always provide bswap subroutines, whether they are optimized using mips32r2 when available or not. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/mips/tcg-target-has.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tcg/mips/tcg-target-has.h b/tcg/mips/tcg-target-has.h index 5dbc63cef6..d3d874ffd1 100644 --- a/tcg/mips/tcg-target-has.h +++ b/tcg/mips/tcg-target-has.h @@ -51,6 +51,7 @@ extern bool use_mips32r2_instructions; #define TCG_TARGET_HAS_muls2_i32 (!use_mips32r6_instructions) #define TCG_TARGET_HAS_muluh_i32 1 #define TCG_TARGET_HAS_mulsh_i32 1 +#define TCG_TARGET_HAS_bswap16_i32 1 #define TCG_TARGET_HAS_bswap32_i32 1 #define TCG_TARGET_HAS_negsetcond_i32 0 @@ -78,7 +79,6 @@ extern bool use_mips32r2_instructions; #endif /* optional instructions detected at runtime */ -#define TCG_TARGET_HAS_bswap16_i32 use_mips32r2_instructions #define TCG_TARGET_HAS_deposit_i32 use_mips32r2_instructions #define TCG_TARGET_HAS_extract_i32 use_mips32r2_instructions #define TCG_TARGET_HAS_sextract_i32 0 @@ -92,9 +92,9 @@ extern bool use_mips32r2_instructions; #define TCG_TARGET_HAS_qemu_st8_i32 0 #if TCG_TARGET_REG_BITS == 64 -#define TCG_TARGET_HAS_bswap16_i64 use_mips32r2_instructions -#define TCG_TARGET_HAS_bswap32_i64 use_mips32r2_instructions -#define TCG_TARGET_HAS_bswap64_i64 use_mips32r2_instructions +#define TCG_TARGET_HAS_bswap16_i64 1 +#define TCG_TARGET_HAS_bswap32_i64 1 +#define TCG_TARGET_HAS_bswap64_i64 1 #define TCG_TARGET_HAS_deposit_i64 use_mips32r2_instructions #define TCG_TARGET_HAS_extract_i64 use_mips32r2_instructions #define TCG_TARGET_HAS_sextract_i64 0 From patchwork Fri Jan 17 18:24:35 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858243 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp843997wrb; Fri, 17 Jan 2025 10:31:06 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU+j5FyrfO6Urf+anriKIZAh3WYM+e5dz8YOE9b6gvJ1x9Q75oZknAAWjkAdsnxbwF5CZVVPw==@linaro.org X-Google-Smtp-Source: AGHT+IGFK9DRIwmc0HnLJ2ZMlzrstcwHOxxbN90ANAR0aCBTdgG/fsjbwoRekSWp0mhX3DOwv6l6 X-Received: by 2002:a05:6102:571b:b0:4b4:7cb0:ac54 with SMTP id ada2fe7eead31-4b690b97757mr3492981137.5.1737138666256; Fri, 17 Jan 2025 10:31:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138666; cv=none; d=google.com; s=arc-20240605; b=UPV7bhIy2DcqFkguf4Qe9Cyo1RWurEP7BC05ZDUlv6ReTRlt8Y1pd/4CjVmC4TtETa ObZpwdwwAhPyK0q6gGLOkTkLNkrxQMJVp2XV77S/kJ3NCqjI4xxltvdbOyejITb/zJKz 8+nAAoxEuhwX/Ut6iW22wR/tZxc66JKz/ke3mP3lWQxquvG/xrm5xIYUpiuSlWV1Aalh 9+BLGPlCZfbFFmNJ/K6w28usq9A0rg5aNiXY0HSTrqyAAIgYbIjyXEeAfHAr1LSNnoaM hKjYK/teWpzmudvaWIu14QJD2VVCll95lz5KfvT9CoElEq+VShOSVEpVz/aVNKBQpho/ T85w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=q6H6mZe5i1rQYMAvgy3QE9HZBzXOhIJyN9wM3xSG7jg=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=cTQ+eMSZQ0hbQSQF7swlVZAOc8CqnxcyJIxqe/KjigaonEMG4HhDYQd5+6xiR51sPD o2HgTm+ubPl+rOC6gt8kJ9+WMQP72vmk55m+HnIz/ww+RwIA1NBOp1k2iDjSbyoxd1wO dlyEbt+lRvClrSOYSmdP8xIYb4toHS7w81J0gmCATa28NtlmcbanvXntE2kJts3P4tir ryykt0jHqD4aGwfafb/q3o+pXPuBP7OG74ZE0AmPRpWSaSqb8fw1oaCGtOYqfoK4Fvd7 9ksMtHNfECz6GZRXqiyVcVHmm16NXpoPEx4U1eA1lRHRSjjpx4qF2XwbAtuYdc1jBMub cdlg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YDEMQZv5; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id ada2fe7eead31-4b68a3202c0si1407035137.351.2025.01.17.10.31.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:31:06 -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=YDEMQZv5; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr5h-0005D6-GJ; Fri, 17 Jan 2025 13:29:10 -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 1tYr5f-00050s-2G for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:29:07 -0500 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr5Z-0000EF-N6 for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:29:06 -0500 Received: by mail-pj1-x1033.google.com with SMTP id 98e67ed59e1d1-2ef72924e53so4221098a91.3 for ; Fri, 17 Jan 2025 10:29:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138540; x=1737743340; 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=q6H6mZe5i1rQYMAvgy3QE9HZBzXOhIJyN9wM3xSG7jg=; b=YDEMQZv5gGtTy3LLnfiiC0eWiuNMBgM0a4R9/v2uPD+0XeDP1xsTA/AyjejOdfVVEq O8e7tr+8KKKlU+6aeuX6LMg0nkmbJUBAu+cl1Mu9bUC5v5OXq/Rvh8skG+C0cinmHSss jK4f8PH49RSnQxdPQTloI56ahzlOwhkEq3zc8PkxP8OeSPLhJaeV3MTTskGM4+3NQR4F oWPFY8Usn5/FYfA1VpV6h1Thb19q83SZ/xqSKPxKfDVm1D46KaLfW3PCKmTh60UOv6Uv aLcxrUNxQsqURAGxOg27wJRFx9m5+DlbMXU8VoGVIHfG4TM9RxmSrNWGUNE6VE2f+VUn ZfuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138540; x=1737743340; 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=q6H6mZe5i1rQYMAvgy3QE9HZBzXOhIJyN9wM3xSG7jg=; b=AvFFKs1FnRYiso+240t5Wiayql/rxZEhhrzFTGzY5HFO8Na5sDaiV9WwSBkfuyE2iz nOhHa8GK7j8VQlQrjey9IYR0SaB6x8wiJf4NCAfdMj8bpf2+/yOh6momu/X+KW75rSvD kLTdlRqlUltjSkxhMbGOSpmrV0KGDcn7gTsLuduZz6liN7GDbI+L4oD3tyFDYKznPkWO HLlMVOHoi8qSiwfaKtJCXBlz/3a0C0kFeJTYmktBns4pfPICPG5HkAUDipKlOFNrl2AG lKitRA+65s2oUvlYOKQ1fC6rLfa1dNvuKzFItHWAq+gj6cZY6jrUTxJ1xrbboI5oOHTX 0fcg== X-Gm-Message-State: AOJu0YyevKsS+yDjSr76yJc3lQ4fvLvXVapn1qo3ItALPlSw33pMcYeU Ya1tScYTsPDEQmQh1o1FYIrMp+PePp2goh3cEGrWWXRNrAhxR8luH47wq+0z4HNTmntQ7uElpzD A X-Gm-Gg: ASbGncselP0h8o+CiNizbMxZmXt1agzOKpTZsW+s1yr3ZDgHbb9+FX+fPonnArX5fii OZ9eNSvFfbUWhNEek4rG9MhHGb4tl0MfEruTv3zRIBRFXb+m9eV30zXlL1PjGHHXn/MEeGJXR+V 06dSGyy8vDpPI7QxSBn3Qm0BtXXCMvNYh6y+5poxKGhfEk2HDLQW6cLD1lg8q7XPceYKqSMtm1p GmtDc7O/Bo9i3U1tsC7x9+I9i47vtBrOQsHNjbFrpT+VIyI8NEvIFFVYHHc9CCZtgUZG9URvLkg s2gofl+lZrug4Tg= X-Received: by 2002:a17:90b:5211:b0:2ee:9902:18b4 with SMTP id 98e67ed59e1d1-2f782d4ef70mr5129078a91.27.1737138540376; Fri, 17 Jan 2025 10:29:00 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f77629bf96sm2614105a91.36.2025.01.17.10.28.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:28:59 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 47/68] tcg/i386: Handle all 8-bit extensions for i686 Date: Fri, 17 Jan 2025 10:24:35 -0800 Message-ID: <20250117182456.2077110-48-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1033; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1033.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 When we generalize {s}extract_i32, we'll lose the specific register constraints on ext8u and ext8s. It's just as easy to emit a couple of insns instead. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/i386/tcg-target.c.inc | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/tcg/i386/tcg-target.c.inc b/tcg/i386/tcg-target.c.inc index 8d1057cdb3..ed064c38d4 100644 --- a/tcg/i386/tcg-target.c.inc +++ b/tcg/i386/tcg-target.c.inc @@ -1329,16 +1329,31 @@ static inline void tcg_out_rolw_8(TCGContext *s, int reg) static void tcg_out_ext8u(TCGContext *s, TCGReg dest, TCGReg src) { - /* movzbl */ - tcg_debug_assert(src < 4 || TCG_TARGET_REG_BITS == 64); + if (TCG_TARGET_REG_BITS == 32 && src >= 4) { + tcg_out_mov(s, TCG_TYPE_I32, dest, src); + if (dest >= 4) { + tcg_out_modrm(s, OPC_ARITH_EvIz, ARITH_AND, dest); + tcg_out32(s, 0xff); + return; + } + src = dest; + } tcg_out_modrm(s, OPC_MOVZBL + P_REXB_RM, dest, src); } static void tcg_out_ext8s(TCGContext *s, TCGType type, TCGReg dest, TCGReg src) { int rexw = type == TCG_TYPE_I32 ? 0 : P_REXW; - /* movsbl */ - tcg_debug_assert(src < 4 || TCG_TARGET_REG_BITS == 64); + + if (TCG_TARGET_REG_BITS == 32 && src >= 4) { + tcg_out_mov(s, TCG_TYPE_I32, dest, src); + if (dest >= 4) { + tcg_out_shifti(s, SHIFT_SHL, dest, 24); + tcg_out_shifti(s, SHIFT_SAR, dest, 24); + return; + } + src = dest; + } tcg_out_modrm(s, OPC_MOVSBL + P_REXB_RM + rexw, dest, src); } From patchwork Fri Jan 17 18:24:36 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858254 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp844584wrb; Fri, 17 Jan 2025 10:32:20 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXjCLNeO/GXiRYXZ4CIEixbB2aRNI/lUFFMaDpOvbN9d71ohHZvAbCEix94P3IJm4cakIb/Rg==@linaro.org X-Google-Smtp-Source: AGHT+IHZh2CV6hJ6iw2wF6aIamPMGGGCD1nQfynfYheAwYkGh0AARKL5zdrNR3s4QDgvKp8Wzx3l X-Received: by 2002:a05:6214:48b:b0:6e1:a2c8:4a18 with SMTP id 6a1803df08f44-6e1b22300ffmr77208506d6.37.1737138740573; Fri, 17 Jan 2025 10:32:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138740; cv=none; d=google.com; s=arc-20240605; b=Uc+MSYeCcd2b89PPaez0/L38+udAnBT79YfgeY994XqniKJ9UkJujYn6QuX/aHwLGz QupyTLIV2JwAbCJlcaaBcDV0Ui9Qdgj9xt9bk32c+jGTRwri/SC3JagS6j0VjhoVUmI4 4dF3YE1EGAsH0AfWtNWwFClkVI9H/2gbRksJ1u5Mve/fzqM9CacN4HWoAXzXhrHvfFP0 UdZ2MIlvodlrKBOlNwJOLbdDM3bP9SWToxNOYQCXZWQ6bwj0X3h5OQprv9VoPOY/tcBp Yu0Yb27MUkSHyQxtBYVkIYr4HIn8y9YLJnSsC2hDsI9/jtDFRx17pPpuzJch0N9uHOJy iLeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=Vv5vAp8t2SNXmQRBLxaW2lCKzxMKMUFK28lOmaKL7Yk=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=gsfWUienWVecyFQaozMZ1IwDgEXU8r5MRAn9FV7A9q4+H/vIAEQOL8FiCXZQcG0x52 TcXdtdBdEppzYuLrH05fdJ4fcZAEHw+deDSvDYdUHcogxz468scqGTif1KDsh5B1Wchy ZzSxGWaubkq0xfnDivxzrxWc8Uk1ynPqDrBeDP/K8hs2Q8r7W7JSXawSrUMORmLtGMIK YfVLCi5gCcGkMCI+7STWEnwHhbOJ6c5z4/7A1AyMlYSP/1z8Llg5EFzpfTHzXl0f+M8e wc5jLyVmZUpVoH/2dtQMvroiLMK0AtZ+1nu02fCfI9WGyWMet22nysdyjP3hInkYP5ba ucLA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=YRy71CEx; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=fail header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46e102f172bsi31362581cf.19.2025.01.17.10.32.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:32:20 -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=fail header.i=@linaro.org header.s=google header.b=YRy71CEx; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=fail header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr5f-00051P-Pp; Fri, 17 Jan 2025 13:29:08 -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 1tYr5c-0004un-UQ for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:29:05 -0500 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr5a-0000Ee-Pc for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:29:04 -0500 Received: by mail-pj1-x102f.google.com with SMTP id 98e67ed59e1d1-2efb17478adso4256856a91.1 for ; Fri, 17 Jan 2025 10:29:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138541; x=1737743341; 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=Vv5vAp8t2SNXmQRBLxaW2lCKzxMKMUFK28lOmaKL7Yk=; b=YRy71CExa1j6BKjunrJSNokjbilxkEIE1E9S5ehdvOx2+CEDJ4QE3YtYtEbMKzJgg1 CGKHip+MO0dpZR8TvVpHggwWw3Bc8tNG91mNQSoyLqj8VRXHznwdGArjfDhv2bwIEOPY k+YcNUd3FP55dCFL9e/VzFtANeFZVB/nJtco5LnHd0sPAhhJYx3W9fdmw+EZdPY8kAb1 JeHnDj7sjOJkIuR61EMSXheR64CuuL6XFS1v877JBgt/Vbz9hRr5RgEUGd0JClLWM1xK lA6cYNaqpMhZ8jkr+Ek8Co9iQOMaPTEBXul7VwXbCVPtJTLma2Qb2U5JztD6h85YteOH lVLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138541; x=1737743341; 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=Vv5vAp8t2SNXmQRBLxaW2lCKzxMKMUFK28lOmaKL7Yk=; b=HxSwT2fuFRU8AFrJxdSonNGUfjaa9/0wknP0cTu7vANPY0TIctjGdbsbaKqK4Oc9zp xmkJIJ9A0gzLLuXWL/4HwSMqyBo0Cp6DdDRfZVSX04AJd6yk/PKwoGJKFShcyM2wAdif Jt0i75euFaVTeYJJjh/Yw+O/0NQNrwXKOAHzYKB0dKt+U0nlrD90MB2j2l340HYYa732 Sca8EXx1EMgkD1l+jIeDnmZ9Cjzhq/nMmVPMdO17Tc5fsr82zTuKZpNA1q8SFAirhNok PyhMyPtM6Lfl5AygtqKmdFs+wTeVijXXobdDZ67s6728IbQTz/zLM0SgwAITDR8w+0yu zrmw== X-Gm-Message-State: AOJu0YweEj2MUnEQtn/3yb8VAgawflRwDVv1zIPZXZaVxaolCHGzL69n CVsLLaoSwyu7nUA28hE/EMq9gvmjtwByiAaJSknqpi0qjWoy9BoWZkak4aJE+od97rUs7m/p8Oi D X-Gm-Gg: ASbGncvmOM+XIKYgjiRCF8XKTtW9aj4JDge99DnxC1cKsNYIDWAyVARh+pkxxsJa0Ka 2a8O0CMd7Mw3N9JBpLY/zXkBfClct+W71J15MOks+L9pFC7ZBrWFVohJj9D1IRyRzUMgva2BtGP k1MlERQt68dBT+huWO9Lro7Nl73573K9PsTO2bi3IsJMjf2zVm/394OB/ZcTjShQEgs+J7R8hWn UT/SlCzBFBO1Gv5T2e0I6V6T0Lf625NbPTq4dgnb0f0ehqSSzVRppDxY9wfdxea9QhiWk5HG84C B1UkubGNnKDlzd0= X-Received: by 2002:a17:90b:4ec8:b0:2ee:d18c:7d84 with SMTP id 98e67ed59e1d1-2f782c9b263mr5171578a91.20.1737138541293; Fri, 17 Jan 2025 10:29:01 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f77629bf96sm2614105a91.36.2025.01.17.10.29.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:29:00 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 48/68] tcg/i386: Fold the ext{8, 16, 32}[us] cases into {s}extract Date: Fri, 17 Jan 2025 10:24:36 -0800 Message-ID: <20250117182456.2077110-49-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102f; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102f.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 Accept byte and word extensions with the extract opcodes. This is preparatory to removing the specialized extracts. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/i386/tcg-target-has.h | 49 +++++++++++++++++++++++++++---- tcg/tcg-has.h | 12 +++++--- tcg/optimize.c | 8 +++-- tcg/tcg-op.c | 12 +++----- tcg/i386/tcg-target.c.inc | 62 +++++++++++++++++++++++++++++---------- 5 files changed, 107 insertions(+), 36 deletions(-) diff --git a/tcg/i386/tcg-target-has.h b/tcg/i386/tcg-target-has.h index 3ea2eab807..ad69f957a7 100644 --- a/tcg/i386/tcg-target-has.h +++ b/tcg/i386/tcg-target-has.h @@ -80,7 +80,7 @@ #define TCG_TARGET_HAS_ctpop_i64 have_popcnt #define TCG_TARGET_HAS_deposit_i64 1 #define TCG_TARGET_HAS_extract_i64 1 -#define TCG_TARGET_HAS_sextract_i64 0 +#define TCG_TARGET_HAS_sextract_i64 1 #define TCG_TARGET_HAS_extract2_i64 1 #define TCG_TARGET_HAS_negsetcond_i64 1 #define TCG_TARGET_HAS_add2_i64 1 @@ -130,10 +130,47 @@ (TCG_TARGET_REG_BITS == 32 && (ofs) == 8 && (len) == 8)) #define TCG_TARGET_deposit_i64_valid TCG_TARGET_deposit_i32_valid -/* Check for the possibility of high-byte extraction and, for 64-bit, - zero-extending 32-bit right-shift. */ -#define TCG_TARGET_extract_i32_valid(ofs, len) ((ofs) == 8 && (len) == 8) -#define TCG_TARGET_extract_i64_valid(ofs, len) \ - (((ofs) == 8 && (len) == 8) || ((ofs) + (len)) == 32) +/* + * Check for the possibility of low byte/word extraction, high-byte extraction + * and zero-extending 32-bit right-shift. + * + * We cannot sign-extend from high byte to 64-bits without using the + * REX prefix that explicitly excludes access to the high-byte registers. + */ +static inline bool +tcg_target_sextract_valid(TCGType type, unsigned ofs, unsigned len) +{ + switch (ofs) { + case 0: + switch (len) { + case 8: + case 16: + return true; + case 32: + return type == TCG_TYPE_I64; + } + return false; + case 8: + return len == 8 && type == TCG_TYPE_I32; + } + return false; +} +#define TCG_TARGET_sextract_valid tcg_target_sextract_valid + +static inline bool +tcg_target_extract_valid(TCGType type, unsigned ofs, unsigned len) +{ + if (type == TCG_TYPE_I64 && ofs + len == 32) { + return true; + } + switch (ofs) { + case 0: + return len == 8 || len == 16; + case 8: + return len == 8; + } + return false; +} +#define TCG_TARGET_extract_valid tcg_target_extract_valid #endif diff --git a/tcg/tcg-has.h b/tcg/tcg-has.h index 65b6a0b0cf..8ed35be8c3 100644 --- a/tcg/tcg-has.h +++ b/tcg/tcg-has.h @@ -56,11 +56,15 @@ #ifndef TCG_TARGET_deposit_i64_valid #define TCG_TARGET_deposit_i64_valid(ofs, len) 1 #endif -#ifndef TCG_TARGET_extract_i32_valid -#define TCG_TARGET_extract_i32_valid(ofs, len) 1 +#ifndef TCG_TARGET_extract_valid +#define TCG_TARGET_extract_valid(type, ofs, len) \ + ((type) == TCG_TYPE_I32 ? TCG_TARGET_HAS_extract_i32 \ + : TCG_TARGET_HAS_extract_i64) #endif -#ifndef TCG_TARGET_extract_i64_valid -#define TCG_TARGET_extract_i64_valid(ofs, len) 1 +#ifndef TCG_TARGET_sextract_valid +#define TCG_TARGET_sextract_valid(type, ofs, len) \ + ((type) == TCG_TYPE_I32 ? TCG_TARGET_HAS_sextract_i32 \ + : TCG_TARGET_HAS_sextract_i64) #endif /* Only one of DIV or DIV2 should be defined. */ diff --git a/tcg/optimize.c b/tcg/optimize.c index c363c5c04b..cd8ad712c4 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2362,8 +2362,10 @@ static void fold_setcond_tst_pow2(OptContext *ctx, TCGOp *op, bool neg) xor_opc = INDEX_op_xor_i32; shr_opc = INDEX_op_shr_i32; neg_opc = INDEX_op_neg_i32; - if (TCG_TARGET_extract_i32_valid(sh, 1)) { + if (TCG_TARGET_extract_valid(TCG_TYPE_I32, sh, 1)) { uext_opc = TCG_TARGET_HAS_extract_i32 ? INDEX_op_extract_i32 : 0; + } + if (TCG_TARGET_sextract_valid(TCG_TYPE_I32, sh, 1)) { sext_opc = TCG_TARGET_HAS_sextract_i32 ? INDEX_op_sextract_i32 : 0; } break; @@ -2373,8 +2375,10 @@ static void fold_setcond_tst_pow2(OptContext *ctx, TCGOp *op, bool neg) xor_opc = INDEX_op_xor_i64; shr_opc = INDEX_op_shr_i64; neg_opc = INDEX_op_neg_i64; - if (TCG_TARGET_extract_i64_valid(sh, 1)) { + if (TCG_TARGET_extract_valid(TCG_TYPE_I64, sh, 1)) { uext_opc = TCG_TARGET_HAS_extract_i64 ? INDEX_op_extract_i64 : 0; + } + if (TCG_TARGET_sextract_valid(TCG_TYPE_I64, sh, 1)) { sext_opc = TCG_TARGET_HAS_sextract_i64 ? INDEX_op_sextract_i64 : 0; } break; diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c index ab5ccd8dcb..d813a7f44e 100644 --- a/tcg/tcg-op.c +++ b/tcg/tcg-op.c @@ -1014,8 +1014,7 @@ void tcg_gen_extract_i32(TCGv_i32 ret, TCGv_i32 arg, return; } - if (TCG_TARGET_HAS_extract_i32 - && TCG_TARGET_extract_i32_valid(ofs, len)) { + if (TCG_TARGET_extract_valid(TCG_TYPE_I32, ofs, len)) { tcg_gen_op4ii_i32(INDEX_op_extract_i32, ret, arg, ofs, len); return; } @@ -1077,8 +1076,7 @@ void tcg_gen_sextract_i32(TCGv_i32 ret, TCGv_i32 arg, } } - if (TCG_TARGET_HAS_sextract_i32 - && TCG_TARGET_extract_i32_valid(ofs, len)) { + if (TCG_TARGET_sextract_valid(TCG_TYPE_I32, ofs, len)) { tcg_gen_op4ii_i32(INDEX_op_sextract_i32, ret, arg, ofs, len); return; } @@ -2811,8 +2809,7 @@ void tcg_gen_extract_i64(TCGv_i64 ret, TCGv_i64 arg, goto do_shift_and; } - if (TCG_TARGET_HAS_extract_i64 - && TCG_TARGET_extract_i64_valid(ofs, len)) { + if (TCG_TARGET_extract_valid(TCG_TYPE_I64, ofs, len)) { tcg_gen_op4ii_i64(INDEX_op_extract_i64, ret, arg, ofs, len); return; } @@ -2917,8 +2914,7 @@ void tcg_gen_sextract_i64(TCGv_i64 ret, TCGv_i64 arg, return; } - if (TCG_TARGET_HAS_sextract_i64 - && TCG_TARGET_extract_i64_valid(ofs, len)) { + if (TCG_TARGET_sextract_valid(TCG_TYPE_I64, ofs, len)) { tcg_gen_op4ii_i64(INDEX_op_sextract_i64, ret, arg, ofs, len); return; } diff --git a/tcg/i386/tcg-target.c.inc b/tcg/i386/tcg-target.c.inc index ed064c38d4..2cac151331 100644 --- a/tcg/i386/tcg-target.c.inc +++ b/tcg/i386/tcg-target.c.inc @@ -3035,6 +3035,10 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType type, case INDEX_op_extract_i64: if (a2 + args[3] == 32) { + if (a2 == 0) { + tcg_out_ext32u(s, a0, a1); + break; + } /* This is a 32-bit zero-extending right shift. */ tcg_out_mov(s, TCG_TYPE_I32, a0, a1); tcg_out_shifti(s, SHIFT_SHR, a0, a2); @@ -3042,28 +3046,53 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType type, } /* FALLTHRU */ case INDEX_op_extract_i32: - /* On the off-chance that we can use the high-byte registers. - Otherwise we emit the same ext16 + shift pattern that we - would have gotten from the normal tcg-op.c expansion. */ - tcg_debug_assert(a2 == 8 && args[3] == 8); - if (a1 < 4 && a0 < 8) { - tcg_out_modrm(s, OPC_MOVZBL, a0, a1 + 4); - } else { + if (a2 == 0 && args[3] == 8) { + tcg_out_ext8u(s, a0, a1); + } else if (a2 == 0 && args[3] == 16) { tcg_out_ext16u(s, a0, a1); - tcg_out_shifti(s, SHIFT_SHR, a0, 8); + } else if (a2 == 8 && args[3] == 8) { + /* + * On the off-chance that we can use the high-byte registers. + * Otherwise we emit the same ext16 + shift pattern that we + * would have gotten from the normal tcg-op.c expansion. + */ + if (a1 < 4 && a0 < 8) { + tcg_out_modrm(s, OPC_MOVZBL, a0, a1 + 4); + } else { + tcg_out_ext16u(s, a0, a1); + tcg_out_shifti(s, SHIFT_SHR, a0, 8); + } + } else { + g_assert_not_reached(); + } + break; + + case INDEX_op_sextract_i64: + if (a2 == 0 && args[3] == 8) { + tcg_out_ext8s(s, TCG_TYPE_I64, a0, a1); + } else if (a2 == 0 && args[3] == 16) { + tcg_out_ext16s(s, TCG_TYPE_I64, a0, a1); + } else if (a2 == 0 && args[3] == 32) { + tcg_out_ext32s(s, a0, a1); + } else { + g_assert_not_reached(); } break; case INDEX_op_sextract_i32: - /* We don't implement sextract_i64, as we cannot sign-extend to - 64-bits without using the REX prefix that explicitly excludes - access to the high-byte registers. */ - tcg_debug_assert(a2 == 8 && args[3] == 8); - if (a1 < 4 && a0 < 8) { - tcg_out_modrm(s, OPC_MOVSBL, a0, a1 + 4); - } else { + if (a2 == 0 && args[3] == 8) { + tcg_out_ext8s(s, TCG_TYPE_I32, a0, a1); + } else if (a2 == 0 && args[3] == 16) { tcg_out_ext16s(s, TCG_TYPE_I32, a0, a1); - tcg_out_shifti(s, SHIFT_SAR, a0, 8); + } else if (a2 == 8 && args[3] == 8) { + if (a1 < 4 && a0 < 8) { + tcg_out_modrm(s, OPC_MOVSBL, a0, a1 + 4); + } else { + tcg_out_ext16s(s, TCG_TYPE_I32, a0, a1); + tcg_out_shifti(s, SHIFT_SAR, a0, 8); + } + } else { + g_assert_not_reached(); } break; @@ -3746,6 +3775,7 @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) case INDEX_op_extract_i32: case INDEX_op_extract_i64: case INDEX_op_sextract_i32: + case INDEX_op_sextract_i64: case INDEX_op_ctpop_i32: case INDEX_op_ctpop_i64: return C_O1_I1(r, r); From patchwork Fri Jan 17 18:24:37 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858253 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp844573wrb; Fri, 17 Jan 2025 10:32:17 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU+nmGHyARkQZ7VZoGdjJiavRcYlzy0NxkJoJ/xdIeH8wVZaSJirBjtkVGVDMfFQt/N36DTTw==@linaro.org X-Google-Smtp-Source: AGHT+IG4SProBJ4x3ya8913Q6lG6aznYz8+VmGFxzZ8WxVKCxYoKR8YJ+dk33jKnXLI/6gZ/NqTw X-Received: by 2002:a05:6122:2403:b0:516:1582:f72e with SMTP id 71dfb90a1353d-51d51b782c3mr4280156e0c.2.1737138737593; Fri, 17 Jan 2025 10:32:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138737; cv=none; d=google.com; s=arc-20240605; b=WooPdu6KA5YuTEnr9NxM/KUSgLbVMZe+FLoFjJ/exp+Wz3BBuTZZcw7t4Ln6++dQsZ pwq9I3l0IA+tvKnWoZE7yNAR9Wb67LF3UZFjebrjKNgRU+md7wnp2clilFiFBRDC4T3f VE252N0NFovZXmT/c/wxKoQ1ULOoGOx2bTzgCw/2ZOYvIYY75/WXisR2G46J4TjhBvXG EyFTxNuOG/x4xHormyvxPg86YnQCxNKFQe6Mphv3fO4rwl4D5InIO/CymQL7HWkWZ1rA d1y94zUnSldoXrkXWnVGMvqimQSsDx+U4J2+0ub4GnuMuiITMoeBvwfC2Ffj4Om9IOBo e5tA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=aO2r2snLcJ0kLlp5tQSSFnCT2bNr1MNinqvZmmW2keo=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=b4q6Q4uWsUcN8+R5Lmo8bkCfluxtunMeKK/EZrQvXRj8HWb+zNbcBx1zHsTkiwD69c vIRo6R29IOsFgOgKQpqLiK4zay69kLoTEaltVXrv1T+Gm2k9Y/y3pSRpGvXosKzAseQq bO6UdS0e/u6HykimrJxiBmzv4Ef27xcCDfDwAkSxotAfyxwAA9wiGRAka26evp83O9Ea 9ruCflutybHuujFx/muAhPQ3ehTWFjwLQU4qc8aFpfzxbGo0hhdTDN+a/xg3t/cABoBy 4YrTKbRFduUJJVoE9HWOHgUt9rSc2Pbx34tNMhofXltDe8VbXJKT4HtBcPcgF/ROPMIw aWdg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bo1ksHgS; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 71dfb90a1353d-51de9a806dasi466705e0c.130.2025.01.17.10.32.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:32:17 -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=bo1ksHgS; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr5j-0005Ux-QF; Fri, 17 Jan 2025 13:29:11 -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 1tYr5e-0004xV-3k for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:29:06 -0500 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr5b-0000Ez-Iw for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:29:05 -0500 Received: by mail-pj1-x102b.google.com with SMTP id 98e67ed59e1d1-2ee67e9287fso4256736a91.0 for ; Fri, 17 Jan 2025 10:29:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138542; x=1737743342; 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=aO2r2snLcJ0kLlp5tQSSFnCT2bNr1MNinqvZmmW2keo=; b=bo1ksHgSokK/UKNeZvPIPft/mMRX2OlNdn8KFuxlkuCYRyOWKLIeh/e34Z3ObWrvSf Ww/0w3MnVw9pH1sqlDY2DMCd+PT+12Hmx5AdTky5YvkPBA7XAGfBCqe2EQXkS/tsn+4y 1IVpfX3Y7kaSliK43w027I3nQJ44urzzyTzJx+sz0xFWaJxcvi6Iu1T5Xt8XBXbj4lX9 /4iBHisXEr+HYM5s/hav6yldSlQOnRDdCxU4KrG/JrH1yWdkeAhc29n6rS14l7e1mpsQ hf4JhSJrOLyEP9Uyx/9ny92gj4DGNphJjYbl3B0eG+dt94usFybB82EArcGM6NztCPok +ShQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138542; x=1737743342; 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=aO2r2snLcJ0kLlp5tQSSFnCT2bNr1MNinqvZmmW2keo=; b=XhMxNkOsgtfjy4vZIle+n+xc+g8Gze00IY/zLAYaQv6UXZ3qcRLvsue47pZEWH2NLq LnKp5nixm6EUQkm8HDjCuhQ5guD6fQ1isB9SAq7I7KCPunZZ6rd7yTNp8kSy385fCEVl H05ljo3hS+IWsxiPK6as6xsvAHAPbUshGkuUQBYOGNXhKyQch2sm84YLBD1mD9aveLBa UzrplQLP0LgPwXZtQH+HTXboe2UDzLBqMSu/5v30wnPbA5J4rgA7ibcQrHwr7hpV8Tl6 jZe/lr1amHkRbZFZATUVF6AMmnC0td1OPdwZ8l60HAGdIe/egUNPZLOtug8ragxM3GAR Qz4g== X-Gm-Message-State: AOJu0YyFlUlES+EVeHDigEEuwwznGsrxeJOOZrbtov/NikrANCVSSFtF mswcjeOdUN9+aWLxZG1rVTwd4xgtpRGYuvFgsHcNHP4OwfnygaCTRRC/PGkGVnHv7bX/OwUKp8K z X-Gm-Gg: ASbGncsIo9Bw68o474PGE41INkdwD77U2Bnf0PirNzrMUIsh3+MU91sgT2nPxrjsooK OdQwzwa3iSWLpslrG17RweWCvbeRJrc9UtTU0nPZUf/ASdYTmJIndv+e73c7zoEf2g0xJ6GdAFP cRNgyIV0ECBAng8SGy55qyLs3FtUOjzbd8UMlfw8qqd3eOZIerE48jh2TKEr7gRJe6o/5WAW5WZ 7PEv+tHReXoYuViqy3KOH6+adOIY1r+9gz4XMtf9xGsIU3Bgh1JZjVMtF7K5YoUxR7UfIHscVJ5 Vw9dEdNT+9QOzjY= X-Received: by 2002:a17:90b:2709:b0:2f6:be57:49d2 with SMTP id 98e67ed59e1d1-2f782cb58b8mr6020109a91.17.1737138542154; Fri, 17 Jan 2025 10:29:02 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f77629bf96sm2614105a91.36.2025.01.17.10.29.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:29:01 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 49/68] tcg/aarch64: Provide TCG_TARGET_{s}extract_valid Date: Fri, 17 Jan 2025 10:24:37 -0800 Message-ID: <20250117182456.2077110-50-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102b; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102b.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 Trivially mirrors TCG_TARGET_HAS_{s}extract_*. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/aarch64/tcg-target-has.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tcg/aarch64/tcg-target-has.h b/tcg/aarch64/tcg-target-has.h index 0e79e01266..26ce65b6a5 100644 --- a/tcg/aarch64/tcg-target-has.h +++ b/tcg/aarch64/tcg-target-has.h @@ -116,4 +116,7 @@ #define TCG_TARGET_HAS_cmpsel_vec 0 #define TCG_TARGET_HAS_tst_vec 1 +#define TCG_TARGET_extract_valid(type, ofs, len) 1 +#define TCG_TARGET_sextract_valid(type, ofs, len) 1 + #endif From patchwork Fri Jan 17 18:24:38 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858263 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp845121wrb; Fri, 17 Jan 2025 10:33:33 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVsEjRMqPaQ8PsSYUNOuNA6BfB3inWFcVcnZl1TsyyOVUE5n65EgV8KkdvO383vhZc1fZgWfg==@linaro.org X-Google-Smtp-Source: AGHT+IEoLcsyfeRd/xXQj+Nq3OnrBeas2TRPiHWAO1CBa12UJ9dfeCAxKSepxugvGrM+QfvSqHsH X-Received: by 2002:a05:6122:1998:b0:518:9582:dba2 with SMTP id 71dfb90a1353d-51d5b3b51demr3513030e0c.10.1737138813273; Fri, 17 Jan 2025 10:33:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138813; cv=none; d=google.com; s=arc-20240605; b=MSrlWXVCmnQKA8opZH7uAyNQbOUyINOPi9qEPWFzq/s5eDY6rrzyA7eWyqOE+92Pmr 59DcK04vlzeJDcAt+wajWlT7UL1oQYvm9SnTThUtOudnd1KW7fvLS9qsyAx4Yuk32D/o ZdWCbVtEqYcGv/sTScc+YnxYb6H7EQLr8Ix89eSKVNuluKP0NKdEe8Li0rkKAsa7Xdvn 7LjH/5sr/1K/X5Ocj+tdMeQgVcBfxBsDqAD0BpRKwnEx4IIyE8oOG0Cp1RyC61e7Ky68 8Se4zPdFPP8QJKPKvAWBVnKxm9zoct0uS37AsuDe7yUps3EtwC0ymUhz/LRZ7szbk9xu eX9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=3NPfmN7vMo+libG/5c+CuF6EQ8tBzjs2DEYBljqFu3U=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=fSf/jQp/9eOHo+seYRqxRLw0eJVOB+uTYiBQiEi1Sfy+E3De+cVhJvn7JzZbbxVOuj om11RkbJYoPKtf6O2bRViDvD6swSkiqR18VY/WrNlQzqB50H4gNvBKEiNiqf3vO+fnda IA+k44rwWBJm7MLHhewOv+DLr9etbiOZPlrWyKR3um7izHDh2F9McNRl18tRuTMimCt+ aHZZLjIongIDdcaxxg22JrOmGCUS6s3ONJbTAaM8v1GyiwvxzTVsLNnyDz371SUw1U3+ P6GKx1YWeiqiNaYhevmvC5dDvQ9egCYWM9VcYZ/g1nIWOBQg+VLtKaoylXea4UkXxIzX SBtQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rySccsW3; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 71dfb90a1353d-51cf55736c3si1119343e0c.37.2025.01.17.10.33.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:33:33 -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=rySccsW3; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr5j-0005Q8-6m; Fri, 17 Jan 2025 13:29:11 -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 1tYr5e-0004xe-AN for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:29:06 -0500 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr5c-0000FF-4k for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:29:06 -0500 Received: by mail-pj1-x102f.google.com with SMTP id 98e67ed59e1d1-2f78a4ca5deso1118782a91.0 for ; Fri, 17 Jan 2025 10:29:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138543; x=1737743343; 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=3NPfmN7vMo+libG/5c+CuF6EQ8tBzjs2DEYBljqFu3U=; b=rySccsW3oRMJ2umc/HyGR/sQYRUKrBNxVjldTYe4eaaB131v8OcltddA8CKOnIjP54 HNcGywq+gCrxbrwDF7F1hhIDkHQxNQ/uGjX5qyqE7sSs6lXBLQuRl/q6hUyiApoKbj4/ fwTaY/0YtJEEwzu7QEtZrMZqOXtAm8nWfyYfsFM4MOz+4MjRyFeDL6rdOCbwQaaa/tVH 3Y5+NoaFPdZmzS6aT3qU2Jg2D4DM6sslhZquURZEPr2s8DNOm3tB82u1onvaZy4SZzDa 80ryaBVbYQ20ilqpcn9OJX8gOKpTAiJfbamF6Pmc87+eMM2EKWJeLTcuhwOc5RuVfI8Z W8OA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138543; x=1737743343; 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=3NPfmN7vMo+libG/5c+CuF6EQ8tBzjs2DEYBljqFu3U=; b=RWM1fkfdPMp+U6DcybMJSRtf+BhW3YuLFVXoLdvNdK3zrKTzDwU4sx7Sv6TawWRmU1 FK8Z2eAGsuJ9Gol3sr3/1FBQb1iwBuUOgf3eNgRt5LnNBADsdXKXBGEYwKvZiWhRUB8I a1qELHHAqo1E+m76/4agfx43gDkcMB7owsf/us/MTH4SUkC2k2bdLEkxziht9k0zmFKA dqNE7QBJJsdQq/RlA4T0jhKLuTgTk2vKSmzV5eL3w6hWjQpTLYiNx7qH3BhxjslOg8Kt Lu02HZYYFzcZmo9x17mCtbv8H4TRdNi0f98RTLlptaXt9Xx/Wa2DrVWOfTwfxF5I6q2A bxag== X-Gm-Message-State: AOJu0YyRlSztVlAY0YmNlL2W8xr4zT7y0I8rQJdsctM4HEw4mtJqcqsF 6bf/YvQoT1ABz3T59vfwJFgvI+TcA4OOjgD3yndhpXI2fy2FaGQ2YEKeiEDtA79ohcLkT+FE93s B X-Gm-Gg: ASbGncsGS+aeMNNISdZKvZyycC3h221fSLqUngwI2J4mo09CKvWTf9G0bIDVaeqS+nQ 6us8yRrlzdUkyH4XXgmFJy28z1AX6WDHHlRLh1p6BYqOyLQJL79vnmL08IU5qqukmP5ldLlV15w jQPWxEbFMGxEEWwcNzTJHLYcn1oB1G+is2r19B0Pnwfe5URfDtECNMwKhJbafoRbLbvE/XCHxXn AmX3p4b+bvZt2OYKo6rzpo+4cmnmw1hTeuPq7rSAQiOHkIXrLZ1udzju2MUlvFdjB1IhO3QDNoT I1Gx0AzeWNvcIkc= X-Received: by 2002:a17:90b:3a08:b0:2ee:dcf6:1c77 with SMTP id 98e67ed59e1d1-2f782c9cb1emr5784504a91.16.1737138542916; Fri, 17 Jan 2025 10:29:02 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f77629bf96sm2614105a91.36.2025.01.17.10.29.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:29:02 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 50/68] tcg/aarch64: Expand extract with offset 0 with andi Date: Fri, 17 Jan 2025 10:24:38 -0800 Message-ID: <20250117182456.2077110-51-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102f; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102f.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 We're about to change canonicalization of masks as extract instead of and. Retain the andi expansion here. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/aarch64/tcg-target.c.inc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tcg/aarch64/tcg-target.c.inc b/tcg/aarch64/tcg-target.c.inc index ede6f47235..66eb4b73b5 100644 --- a/tcg/aarch64/tcg-target.c.inc +++ b/tcg/aarch64/tcg-target.c.inc @@ -2450,7 +2450,12 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType ext, case INDEX_op_extract_i64: case INDEX_op_extract_i32: - tcg_out_ubfm(s, ext, a0, a1, a2, a2 + args[3] - 1); + if (a2 == 0) { + uint64_t mask = MAKE_64BIT_MASK(0, args[3]); + tcg_out_logicali(s, I3404_ANDI, ext, a0, a1, mask); + } else { + tcg_out_ubfm(s, ext, a0, a1, a2, a2 + args[3] - 1); + } break; case INDEX_op_sextract_i64: From patchwork Fri Jan 17 18:24:39 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858257 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp844924wrb; Fri, 17 Jan 2025 10:33:08 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXvjTHmtwY6rT8cYaT/8S6MWrNIUH6O/I5M069BQd76Kq/TmGdeFeKfNLdTxRmM18Ll3cFfIA==@linaro.org X-Google-Smtp-Source: AGHT+IFUAoYQ4tfVCCizPegZyhppkyAgPfSd556t1Z9td9e5Og+KPiH0S7c82LPn7Dd2FJuU2p5w X-Received: by 2002:a05:6122:3d46:b0:518:a261:adca with SMTP id 71dfb90a1353d-51d5b301146mr3703496e0c.8.1737138788151; Fri, 17 Jan 2025 10:33:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138788; cv=none; d=google.com; s=arc-20240605; b=fpYhznxFY4c98hGgGXCcjAte5gCi0cCNVspBo1x6+WjjlYej/rHm2fduJteJE3pDXH RVzjU2zSphmFXCX3fSGU8uJoLD3htNnzPTc979rKpxlqigHNiogcnbgcxK6LuYg6B5qy w7DhDRAk4p6zA8T2ilgvqdgdf3z4aj9cAtfqdssCrUP/sLVzn+LKdvr0DOAjBgMvyH8F X+pZSKKQ7YRB+jdelqgvx3hRKEs/t1GOXUDotb8tEPUtEBRC5ZXs+intSkgbtqiJaJaV YG+OsmDMAwzZOpaU/y+yVWDrzstlExRrRxLpsTOzGEoJP9A7F4vSc9aOvCN8n/42+xAE dJ1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=KWp2/JFv2fva2VTRy/d8GxCMMgAUanLYBFx81Z63oKk=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=CexvvOgl5/vNNAwl+kDiIkHBda8QPsmXFP/A+wyHPBE3AoKrXsN8kxsx9Ul+jWbBIf +StupNA3CN49ClAf3MlJq6P9Th14BjkYenE50zLNnE7jZ++M8ItFTarkdZgxiY3n/C19 7oDaKr8cwU6DPo/1LeKw1OQhJRK+SRUq30WvYCwyYOs4QvnmChGGU1BEoD0IgK3zXY1r yLOHvDcHx/eUfnd+ePbsNfWIjmOz8ALFk/WFAdcTRHnQTd7jIUhv9aPUZ1mrBcObx0a2 IbxBqYQVZrcwMld/xWsg4lswrbcxZXDpRx5/zSriC6uBY/XAc7dQ/gLQTAGlzpT+vMsY ERWA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=V8KaUMTk; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 71dfb90a1353d-51cf559ee67si1124575e0c.83.2025.01.17.10.33.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:33:08 -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=V8KaUMTk; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr5l-0005kp-IW; Fri, 17 Jan 2025 13:29:13 -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 1tYr5f-00050r-0C for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:29:07 -0500 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr5d-0000FY-2T for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:29:06 -0500 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-216728b1836so44552175ad.0 for ; Fri, 17 Jan 2025 10:29:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138543; x=1737743343; 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=KWp2/JFv2fva2VTRy/d8GxCMMgAUanLYBFx81Z63oKk=; b=V8KaUMTkGiukZ731Py50F1jIl2aGlOoq/Oxrm5+m/IY0tYy9nFbsak9W6fAy5jJkH/ E7PeUcMEV4kRhEGl3tOD+CFuuZNCC8PYXAnQkzMP6lzFmg2147oE5Ff8E7OgQQYu+e7Z fRNuXEE/HjbeA5dpQu4DcM4+FkH+gxHjw5DViqqchb/QK6pP2wTYPg4aDUU8BhKCVMt6 IvIWTfw7DUh+5q0K8ecXXtWhA4OpzgiH8bBmI3rbikaBwaBteQBNKY16VK8iAk8G35MX imoRgIVxZLqmfvGL2kRxCKUE8se38prj8c6FnA/krvYBMRdOwOoow4AVQ5Yz3F3Lz1px ZskA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138543; x=1737743343; 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=KWp2/JFv2fva2VTRy/d8GxCMMgAUanLYBFx81Z63oKk=; b=QjyxLplLc2MuPPw89iqDIFefZYx9SdKAuN4Ey4DhlEP2alVIaafe2Aoq+J0X/KO69G ATWo0mx/wRp972z29Q9a6YHXQJFciI78USkEuFWQeTzYjePwijAYkeQ1dMt18wdOFznv pmHE/grxaMIqJAyzEFve+cgxckNRfePsgPjsloKF+G8yLg3FnFUtNKrtsIPBypVNENDx 3F18KBxm6ytT6lg+ACBZAzNvj05s/xFZfOyH9ldkKE2gXuO/CFkqwMya15cNoceFn8JI C10YXBRg1jKeKfOMDTzApqOV4FzeFP1/jEF5UeVWhPMqxFwx6F3dPC3KKb5d8Qs0YUnR vUhA== X-Gm-Message-State: AOJu0YwAUbbgFKWpPtd+SFFYD9qpofWHxwK9dGO56NQxU28HxiROArFo G/Q4yEuhghpRVCcDnvloAfEfP6btpVqGvgkJkLZwqMauQXsbKG1bhEbG8/ADN3kjifAdKM6cUkW h X-Gm-Gg: ASbGncukrp0mY/VB2bg49hw6NISl5eQFVY99wcC/67qX7xVyfTOoXtpmHyjds2wYows 3/6Z0nRFH+2onFSj8GeJjyP5iX92bHBsJglppUE/BD/AT1DTggZYXSQRFFjh6XGvo2QiwpleBY8 pHSaDYcf3g+dvJCAQhx8x4/XAIrSRkYoQuCaSY0f65WGCtZdXIrOH7ZvOpc17Pw1VEYYz6p9m/K 0qYD0SxZj5TIlOZndAh+5kcLrD1dRBloBn47GDKe/H4H7iR1gIUY9+5WBQCphilOCnKJ4OuJ9+e oIs7pssEFQxFfZ8= X-Received: by 2002:a17:90b:3503:b0:2ea:61de:38f7 with SMTP id 98e67ed59e1d1-2f782d59adbmr5059850a91.29.1737138543528; Fri, 17 Jan 2025 10:29:03 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f77629bf96sm2614105a91.36.2025.01.17.10.29.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:29:03 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 51/68] tcg/arm: Add full [US]XT[BH] into {s}extract Date: Fri, 17 Jan 2025 10:24:39 -0800 Message-ID: <20250117182456.2077110-52-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::635; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x635.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 The armv6 uxt and sxt opcodes have a 2-bit rotate field which supports extractions from ofs = {0,8,16,24}. Special case ofs = 0, len <= 8 as AND. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/arm/tcg-target-has.h | 21 ++++++++++++++-- tcg/arm/tcg-target.c.inc | 54 +++++++++++++++++++++++++++++++++++----- 2 files changed, 67 insertions(+), 8 deletions(-) diff --git a/tcg/arm/tcg-target-has.h b/tcg/arm/tcg-target-has.h index 316185500d..d9f3311102 100644 --- a/tcg/arm/tcg-target-has.h +++ b/tcg/arm/tcg-target-has.h @@ -41,8 +41,8 @@ extern bool use_neon_instructions; #define TCG_TARGET_HAS_ctz_i32 use_armv7_instructions #define TCG_TARGET_HAS_ctpop_i32 0 #define TCG_TARGET_HAS_deposit_i32 use_armv7_instructions -#define TCG_TARGET_HAS_extract_i32 use_armv7_instructions -#define TCG_TARGET_HAS_sextract_i32 use_armv7_instructions +#define TCG_TARGET_HAS_extract_i32 1 +#define TCG_TARGET_HAS_sextract_i32 1 #define TCG_TARGET_HAS_extract2_i32 1 #define TCG_TARGET_HAS_negsetcond_i32 1 #define TCG_TARGET_HAS_mulu2_i32 1 @@ -82,4 +82,21 @@ extern bool use_neon_instructions; #define TCG_TARGET_HAS_cmpsel_vec 0 #define TCG_TARGET_HAS_tst_vec 1 +static inline bool +tcg_target_extract_valid(TCGType type, unsigned ofs, unsigned len) +{ + if (use_armv7_instructions) { + return true; /* SBFX or UBFX */ + } + switch (len) { + case 8: /* SXTB or UXTB */ + case 16: /* SXTH or UXTH */ + return (ofs % 8) == 0; + } + return false; +} + +#define TCG_TARGET_extract_valid tcg_target_extract_valid +#define TCG_TARGET_sextract_valid tcg_target_extract_valid + #endif diff --git a/tcg/arm/tcg-target.c.inc b/tcg/arm/tcg-target.c.inc index 9cfb733a14..12dad7307f 100644 --- a/tcg/arm/tcg-target.c.inc +++ b/tcg/arm/tcg-target.c.inc @@ -1036,19 +1036,61 @@ static void tcg_out_deposit(TCGContext *s, ARMCond cond, TCGReg rd, static void tcg_out_extract(TCGContext *s, ARMCond cond, TCGReg rd, TCGReg rn, int ofs, int len) { - /* ubfx */ - tcg_out32(s, 0x07e00050 | (cond << 28) | (rd << 12) | rn - | (ofs << 7) | ((len - 1) << 16)); + /* According to gcc, AND can be faster. */ + if (ofs == 0 && len <= 8) { + tcg_out_dat_imm(s, cond, ARITH_AND, rd, rn, + encode_imm_nofail((1 << len) - 1)); + return; + } + + if (use_armv7_instructions) { + /* ubfx */ + tcg_out32(s, 0x07e00050 | (cond << 28) | (rd << 12) | rn + | (ofs << 7) | ((len - 1) << 16)); + return; + } + + assert(ofs % 8 == 0); + switch (len) { + case 8: + /* uxtb */ + tcg_out32(s, 0x06ef0070 | (cond << 28) | (rd << 12) | (ofs << 7) | rn); + break; + case 16: + /* uxth */ + tcg_out32(s, 0x06ff0070 | (cond << 28) | (rd << 12) | (ofs << 7) | rn); + break; + default: + g_assert_not_reached(); + } } static void tcg_out_sextract(TCGContext *s, ARMCond cond, TCGReg rd, TCGReg rn, int ofs, int len) { - /* sbfx */ - tcg_out32(s, 0x07a00050 | (cond << 28) | (rd << 12) | rn - | (ofs << 7) | ((len - 1) << 16)); + if (use_armv7_instructions) { + /* sbfx */ + tcg_out32(s, 0x07a00050 | (cond << 28) | (rd << 12) | rn + | (ofs << 7) | ((len - 1) << 16)); + return; + } + + assert(ofs % 8 == 0); + switch (len) { + case 8: + /* sxtb */ + tcg_out32(s, 0x06af0070 | (cond << 28) | (rd << 12) | (ofs << 7) | rn); + break; + case 16: + /* sxth */ + tcg_out32(s, 0x06bf0070 | (cond << 28) | (rd << 12) | (ofs << 7) | rn); + break; + default: + g_assert_not_reached(); + } } + static void tcg_out_ld32u(TCGContext *s, ARMCond cond, TCGReg rd, TCGReg rn, int32_t offset) { From patchwork Fri Jan 17 18:24:40 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858271 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp845393wrb; Fri, 17 Jan 2025 10:34:11 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUEsIRchS8g5IMaWdjg3TuAUb2sxMHqD6xLJjRBEXkIjr0wPFjS2KatRwwiWv3ZY2FA9Ji5ZQ==@linaro.org X-Google-Smtp-Source: AGHT+IGhjp7BqS0nlehE3teIWoSc+ZhMrpzmn6Xip9seNkPZc6hv/Rb3FohqdeQ0R0gGJ6gjPAD1 X-Received: by 2002:a05:620a:4513:b0:7b6:dd9c:fac1 with SMTP id af79cd13be357-7be63287ac7mr611995985a.49.1737138851573; Fri, 17 Jan 2025 10:34:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138851; cv=none; d=google.com; s=arc-20240605; b=WKqMaEzMedykkCYg8p9QmuLDQ28S/sNE6LdB/j8kezuZUfoKbcntydSXxxGsHbDk8U XfOSG6Om+rNV0LTtSGgYjflGg9938jgIjpkmCHT19WhpkL95iX/ohVCW4sAtxPSnrXa9 5f5pTpAmAKmnqa6Jm1sQe3T5Cmt5Qr6+h70XuEYtSNX/9HQns9QtLKyriGM65BRtYCCs hpr+S3AhlytOX55ICvBCbbCC4vlftRAQIVJkXKzee14K9tggltwlGzXROx4UVUIQwhYi 1K1mFynXz4yCAVksK8ggl2HBKSokDsViltLydcpONAxp2TNJNlm6WF6nTkPLuOID/gHu aZ5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=jDdcDXXMoyLv7/1KfJ1cMXQbpZKLIjBYNpE33H5vAuk=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=gkvflpKzICy+wQk+Bv7vx0iMRs37J91R8I2Nd3s8Uj15P+xDbr0saBWAkz0bUFChIk tmLjYhEqkCxRdJ9JHCErAQaWtNsEPiboh8Ges5KZzt0uXZnMNMOS9K84D0vwNJGZExnX xmTciTsQliWF1moO6D2k5VLIs8QXVu0qCsKpJbqtp6CnA5j4Ch84ld/+FrY6mLzAr6xU d5YBrsQMLaj+Iwg7RAeuAobCqWK/gH1bO0ptJtwWAfdeZ72/Npk0Qtv+mjR0QslGjLsM X9gj0McyhLw9qWJUzcbNAJ8mE0qjNJR+jo717IwSDkAMWuq8gOvT/ymyroIkCCLjOVdu NCYA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=jew4jib4; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=fail header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7be61477a1csi336660485a.135.2025.01.17.10.34.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:34:11 -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=fail header.i=@linaro.org header.s=google header.b=jew4jib4; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=fail header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr5n-00060w-Ox; Fri, 17 Jan 2025 13:29:16 -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 1tYr5g-00056j-93 for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:29:08 -0500 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr5d-0000G0-Kd for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:29:07 -0500 Received: by mail-pj1-x1034.google.com with SMTP id 98e67ed59e1d1-2ee46851b5eso3431985a91.1 for ; Fri, 17 Jan 2025 10:29:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138544; x=1737743344; 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=jDdcDXXMoyLv7/1KfJ1cMXQbpZKLIjBYNpE33H5vAuk=; b=jew4jib4anYgh6ENrzSCU0qHEuml5TRs9rGx013k/soI+ZzSc54dX4/02tXVcOi02Y VEYpTEbmcfzL9qcnO6E2PPCACszMFi6sCV1ovbMlsZR+X2sQ3aRxfNGS14gQTyC7GYep y6IyF1XKNwmRBe0jF4Bxt8O+Wl189yPriAZ/tVBe8AteDIAF5pAL6+tKjqhzYun2S2RJ v8nm5V7GHKIQsDbBRfUz9wmqDYSj5iU4jNOIYz6mVERrW2vNUu1n7yQIZx4eLz4W36fg cMgiM/zk6qzfqgBrgKXN6lWl0UFAmGVSDWM/uYY4/r2nTpI2kqRuzavNkNiUWeBNV57V qgdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138544; x=1737743344; 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=jDdcDXXMoyLv7/1KfJ1cMXQbpZKLIjBYNpE33H5vAuk=; b=Gun5/CBZNnTiYVLu0lL3NfvOm6ALEg6iQQYUDKgnJ9TjNGvUC4wZUtUyI1VHn1qMjd cyNQhhzhkHJpCAPoVK+6cRBo36+wEKgc/sZFqm1TVrLXT+//KN01xmBrYVPxQlciO1Cv 8KNCFF0LEkWSHtOdyGq4aV13gYZy3KjZDaXnsc+2vPbryyBVSkwKIyum3DoA3w1nycM1 0p0fb4eOQH8aP2yUj9koTR1bkpMWIHaobUGOin/LIa32dUcYFVIrxV0j971Hucyw+Ptr bhU7u8zWSzctJH6qcfqALmaLMrXsibH4Ic3wF1cUHzz6h8ecHavXIoS/6BTi8Yp/KFNJ t+lg== X-Gm-Message-State: AOJu0YzFnPBBqBEZOAU2OiLT0R2+TOofe4GGXqiUMYIgUROx+7I1SgpP aTHeZdK5iaFMjAB5P7+56WfKOx5NRrkzkyoTRRhb1Fi7Pk0EP4wdAmOtNLDJmat4ok7J8PsvPbO m X-Gm-Gg: ASbGncsvNIaHq1+r7/PBEWg1ERH4aRI8xA1NV1qwAw+BRPNQhQwcj9BfX54q6drm96K 6/Q/iM5xMWpog621sTJcJWUATILY2B5eOCZlDEU3a6L+4epOheKw1Pid5UVHS5eQSb7OJ7Wb0w7 KAMjO6m6w5X1JAOgBMeaqbhOon088vqHjABF67ZLJn7QvHIzDUkGuQWCOmzX0FUFG8PuZRw8UnL mL8gNMg9mjcYa9tneABqYmOKTiaDwQxa7/b00PDFILcj8nq8oIhiLo3i0JkcAdj7N6x2R6+1/8L /A+oPsfsLjbWkPg= X-Received: by 2002:a17:90b:1f91:b0:2f4:465d:5c94 with SMTP id 98e67ed59e1d1-2f782c77124mr5469282a91.11.1737138544295; Fri, 17 Jan 2025 10:29:04 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f77629bf96sm2614105a91.36.2025.01.17.10.29.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:29:03 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 52/68] tcg/loongarch64: Fold the ext{8, 16, 32}[us] cases into {s}extract Date: Fri, 17 Jan 2025 10:24:40 -0800 Message-ID: <20250117182456.2077110-53-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1034; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1034.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 Accept byte and word extensions with the extract opcodes. This is preparatory to removing the specialized extracts. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/loongarch64/tcg-target-has.h | 15 ++++++++++++-- tcg/loongarch64/tcg-target.c.inc | 34 ++++++++++++++++++++++++++++++-- 2 files changed, 45 insertions(+), 4 deletions(-) diff --git a/tcg/loongarch64/tcg-target-has.h b/tcg/loongarch64/tcg-target-has.h index e4333c36c6..ac7d2fcdf9 100644 --- a/tcg/loongarch64/tcg-target-has.h +++ b/tcg/loongarch64/tcg-target-has.h @@ -17,7 +17,7 @@ #define TCG_TARGET_HAS_rot_i32 1 #define TCG_TARGET_HAS_deposit_i32 1 #define TCG_TARGET_HAS_extract_i32 1 -#define TCG_TARGET_HAS_sextract_i32 0 +#define TCG_TARGET_HAS_sextract_i32 1 #define TCG_TARGET_HAS_extract2_i32 0 #define TCG_TARGET_HAS_add2_i32 0 #define TCG_TARGET_HAS_sub2_i32 0 @@ -52,7 +52,7 @@ #define TCG_TARGET_HAS_rot_i64 1 #define TCG_TARGET_HAS_deposit_i64 1 #define TCG_TARGET_HAS_extract_i64 1 -#define TCG_TARGET_HAS_sextract_i64 0 +#define TCG_TARGET_HAS_sextract_i64 1 #define TCG_TARGET_HAS_extract2_i64 0 #define TCG_TARGET_HAS_extr_i64_i32 1 #define TCG_TARGET_HAS_ext8s_i64 1 @@ -109,5 +109,16 @@ #define TCG_TARGET_HAS_cmpsel_vec 0 #define TCG_TARGET_HAS_tst_vec 0 +#define TCG_TARGET_extract_valid(type, ofs, len) 1 + +static inline bool +tcg_target_sextract_valid(TCGType type, unsigned ofs, unsigned len) +{ + if (type == TCG_TYPE_I64 && ofs + len == 32) { + return true; + } + return ofs == 0 && (len == 8 || len == 16); +} +#define TCG_TARGET_sextract_valid tcg_target_sextract_valid #endif diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc index 3dff29facb..cebe8dd354 100644 --- a/tcg/loongarch64/tcg-target.c.inc +++ b/tcg/loongarch64/tcg-target.c.inc @@ -1375,10 +1375,38 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType type, break; case INDEX_op_extract_i32: - tcg_out_opc_bstrpick_w(s, a0, a1, a2, a2 + args[3] - 1); + if (a2 == 0 && args[3] <= 12) { + tcg_out_opc_andi(s, a0, a1, (1 << args[3]) - 1); + } else { + tcg_out_opc_bstrpick_w(s, a0, a1, a2, a2 + args[3] - 1); + } break; case INDEX_op_extract_i64: - tcg_out_opc_bstrpick_d(s, a0, a1, a2, a2 + args[3] - 1); + if (a2 == 0 && args[3] <= 12) { + tcg_out_opc_andi(s, a0, a1, (1 << args[3]) - 1); + } else { + tcg_out_opc_bstrpick_d(s, a0, a1, a2, a2 + args[3] - 1); + } + break; + + case INDEX_op_sextract_i64: + if (a2 + args[3] == 32) { + if (a2 == 0) { + tcg_out_ext32s(s, a0, a1); + } else { + tcg_out_opc_srai_w(s, a0, a1, a2); + } + break; + } + /* FALLTHRU */ + case INDEX_op_sextract_i32: + if (a2 == 0 && args[3] == 8) { + tcg_out_ext8s(s, TCG_TYPE_REG, a0, a1); + } else if (a2 == 0 && args[3] == 16) { + tcg_out_ext16s(s, TCG_TYPE_REG, a0, a1); + } else { + g_assert_not_reached(); + } break; case INDEX_op_deposit_i32: @@ -2243,6 +2271,8 @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) case INDEX_op_not_i64: case INDEX_op_extract_i32: case INDEX_op_extract_i64: + case INDEX_op_sextract_i32: + case INDEX_op_sextract_i64: case INDEX_op_bswap16_i32: case INDEX_op_bswap16_i64: case INDEX_op_bswap32_i32: From patchwork Fri Jan 17 18:24:41 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858239 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp843415wrb; Fri, 17 Jan 2025 10:30:01 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXwAKDKY5HXLoyfKJhRpXGlKlZ/3QFPqSchRngZa3bRbYaWU2s9BzoMTqHvykHsE1WW45P+xA==@linaro.org X-Google-Smtp-Source: AGHT+IEi6lKxegLdElCpcDcQUp7nXJiyxA2rsyykhxvC3ScOGACArL2gTnlmjjT4AZDadiy4G5aZ X-Received: by 2002:a05:620a:4456:b0:7be:4861:b218 with SMTP id af79cd13be357-7be6323b7c9mr538942485a.22.1737138601519; Fri, 17 Jan 2025 10:30:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138601; cv=none; d=google.com; s=arc-20240605; b=ae10fbI9XOy5XdQwlTV/6QjhlGHMz3nNjm0m62duTYubbh4lZaxTj0pDpEprqn+miT pR+/2xN1/8OhZ5RDTnOb6Hed3Ywi+BVUWddkpSy6sv7wpPWcZV0HzaITcnVwXjLG0EbW LUwUfGMJR9eywUYNqh0UaODV4rnLGBNyCCtv1qgawFEmQE00yB6VRLVSbjzWjd4iJclJ 2oSkg72XpmqSuR2hSl/lE8AmEVfh0RwOkKpz5sPG7k+FSv3/59EdaVjd/JMBYhxhxSHt XQyd+X9KlKkuvU9+hd39+oNNhQ9W8lJ7XcmCcIB31Exx7N+/QHjCZVr3xiCe2cYkvl0P iDCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=LgXM2SJhYN6NrfYWSGvykVkJvg5WrjNv6ztMf07JhME=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=YNHPMlYh8XmPNglPz9dV6ayZSHWafqxifZbKun2gzhq0jLup1T0YcKWCmERkkD6nCy gbIy/33C6D5iKdQlw/jFwR4337ly8YS/JKn5ZmhKAPi6Hlk51dWsWsdNqU/38rVMMwTR lEXLALOJ6TDtl8q0J76mMg6OKvQxPhzEzQJDb+hVBe0OVVdXik3DXowX0CRN5xnjLHEi weEI+3OjvrNEJo/OHjxX5DDKbYI+JvymB5mEvsCRYYFcWaY7mVptKD43B0C4JVWsUsUr ImmoD1NI9XC6PgKrVqaWsQ88PyEd2BOXXLFbtthhQIH5iTbUANLTG3L7y1YjiHg3U+XK xhwg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Bk3PeUpB; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=fail header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7be614ed23bsi335506885a.519.2025.01.17.10.30.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:30:01 -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=fail header.i=@linaro.org header.s=google header.b=Bk3PeUpB; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=fail header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr5s-0006Q7-Cf; Fri, 17 Jan 2025 13:29:20 -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 1tYr5g-00058F-HV for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:29:08 -0500 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr5e-0000Gb-L0 for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:29:08 -0500 Received: by mail-pj1-x1032.google.com with SMTP id 98e67ed59e1d1-2ef87d24c2dso3452704a91.1 for ; Fri, 17 Jan 2025 10:29:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138545; x=1737743345; 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=LgXM2SJhYN6NrfYWSGvykVkJvg5WrjNv6ztMf07JhME=; b=Bk3PeUpBiR3mtMi460YLysxv5wZeMoaCGEiSjnGWoclLHn+S5RBl9wATGWrUsf2OcR xe241xiiUdDpmX3nCxDfAra62//FJfV8k0jJjNP4xU5aa1pBaygOS0sYvpH7zDAPQrhF UXvl5dZcK5WYdr+9unEgOrkd0jlEiZDnOJCPAkB9oBrkei2br0a6HnCnYLQnBGm4I8rH ehSlwq42eyY93EguwFzHNINH898XFb/jY9wpWN/97WZOmGeim1ZoiHHjSG+VbGlnRRyI j5lalJRybHOtNPyJ1CD+l8vCiVbcu0jYNJ9Dtocx6lSgngr+pCgIeuf++rDzfxCX09fb jaJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138545; x=1737743345; 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=LgXM2SJhYN6NrfYWSGvykVkJvg5WrjNv6ztMf07JhME=; b=F6CG6iSmcmCGXpLbXKTA0brLXkmCjtjh3ytPZ/FflB+soW9lzVafLr+EnHOl+DGVvc Oz7xVjpRdNqb3BwvRwIelLQ+3ttxsBE4c3dAopAqKMByNnvglmyu5tk9+s4bZ5fnibnQ 9F387A+sPYtAWYEfxrQfY7SYCrJUcwfZ8RdoPguxlckHHfaVVt7unlR6+X3rbbwId8yu CZ9WYiwL233lL/6cxdan6i1b/UODeeAhJuZYpkrXDezG0G0Qpd5B1bLgbVPvuPx2F3Xg TyucSwLfmb05cybXUZFQ4WFhBoid4BpKzlEx37ND5ZV7MevvsemED6JTkCMgiSnafagp xtlQ== X-Gm-Message-State: AOJu0Yx7AVLsII85vTIakKUqo04S0l5BqVsGAikLdzeJL1ZGPMxiqlrR GXhMLcCk4hg9xNyKGItC4+l2fHaSd6b8GmgmWbtc/fcOEqY8rpgQ3m5jNAhU6V9H0ysZ3XeP8HZ 3 X-Gm-Gg: ASbGnct2Pi3emNzEaEoavdLmaYPgG6xESyQRjYU3oBzgx/ydhNmLtc06vYmlpNizvY6 kGXfE77YLv7OvXTG3RSmVGGsP6Qf9dsxLvIqPrjAfaag/UiK00RP0JEOyXkZqL4yImhQpRqOxrK wEGQw9rWaUC9mGcTIx5R44VAP7y82iPBBoCIytEmaSTKSysCDG+l4Ig3f5ReCWjp8Oxxu89jlvL nPi5fBhsy1YXKNTkCutHVv+bd6Nw8SfXdPZeDtnCo1P18wjql0Ro3rwTP3QFkqwo8YCVScfD5GP ost072Stdv9FbxM= X-Received: by 2002:a17:90b:258b:b0:2ee:f80c:688d with SMTP id 98e67ed59e1d1-2f782d4f168mr4940731a91.25.1737138544890; Fri, 17 Jan 2025 10:29:04 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f77629bf96sm2614105a91.36.2025.01.17.10.29.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:29:04 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 53/68] tcg/mips: Fold the ext{8, 16, 32}[us] cases into {s}extract Date: Fri, 17 Jan 2025 10:24:41 -0800 Message-ID: <20250117182456.2077110-54-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1032; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1032.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 Accept AND, ext32u, ext32s extensions with the extract opcodes. This is preparatory to removing the specialized extracts. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/mips/tcg-target-has.h | 26 ++++++++++++++++++++++---- tcg/mips/tcg-target.c.inc | 33 ++++++++++++++++++++++++++++++--- 2 files changed, 52 insertions(+), 7 deletions(-) diff --git a/tcg/mips/tcg-target-has.h b/tcg/mips/tcg-target-has.h index d3d874ffd1..e7914cc970 100644 --- a/tcg/mips/tcg-target-has.h +++ b/tcg/mips/tcg-target-has.h @@ -80,8 +80,8 @@ extern bool use_mips32r2_instructions; /* optional instructions detected at runtime */ #define TCG_TARGET_HAS_deposit_i32 use_mips32r2_instructions -#define TCG_TARGET_HAS_extract_i32 use_mips32r2_instructions -#define TCG_TARGET_HAS_sextract_i32 0 +#define TCG_TARGET_HAS_extract_i32 1 +#define TCG_TARGET_HAS_sextract_i32 1 #define TCG_TARGET_HAS_extract2_i32 0 #define TCG_TARGET_HAS_ext8s_i32 use_mips32r2_instructions #define TCG_TARGET_HAS_ext16s_i32 use_mips32r2_instructions @@ -96,8 +96,8 @@ extern bool use_mips32r2_instructions; #define TCG_TARGET_HAS_bswap32_i64 1 #define TCG_TARGET_HAS_bswap64_i64 1 #define TCG_TARGET_HAS_deposit_i64 use_mips32r2_instructions -#define TCG_TARGET_HAS_extract_i64 use_mips32r2_instructions -#define TCG_TARGET_HAS_sextract_i64 0 +#define TCG_TARGET_HAS_extract_i64 1 +#define TCG_TARGET_HAS_sextract_i64 1 #define TCG_TARGET_HAS_extract2_i64 0 #define TCG_TARGET_HAS_ext8s_i64 use_mips32r2_instructions #define TCG_TARGET_HAS_ext16s_i64 use_mips32r2_instructions @@ -119,4 +119,22 @@ extern bool use_mips32r2_instructions; #define TCG_TARGET_HAS_qemu_ldst_i128 0 #define TCG_TARGET_HAS_tst 0 +#define TCG_TARGET_extract_valid(type, ofs, len) use_mips32r2_instructions + +static inline bool +tcg_target_sextract_valid(TCGType type, unsigned ofs, unsigned len) +{ + if (ofs == 0) { + switch (len) { + case 8: + case 16: + return use_mips32r2_instructions; + case 32: + return type == TCG_TYPE_I64; + } + } + return false; +} +#define TCG_TARGET_sextract_valid tcg_target_sextract_valid + #endif diff --git a/tcg/mips/tcg-target.c.inc b/tcg/mips/tcg-target.c.inc index b31b8f0007..99f6ef6c76 100644 --- a/tcg/mips/tcg-target.c.inc +++ b/tcg/mips/tcg-target.c.inc @@ -2041,12 +2041,37 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType type, tcg_out_opc_bf64(s, OPC_DINS, OPC_DINSM, OPC_DINSU, a0, a2, args[3] + args[4] - 1, args[3]); break; + case INDEX_op_extract_i32: - tcg_out_opc_bf(s, OPC_EXT, a0, a1, args[3] - 1, a2); + if (a2 == 0 && args[3] <= 16) { + tcg_out_opc_imm(s, OPC_ANDI, a0, a1, (1 << args[3]) - 1); + } else { + tcg_out_opc_bf(s, OPC_EXT, a0, a1, args[3] - 1, a2); + } break; case INDEX_op_extract_i64: - tcg_out_opc_bf64(s, OPC_DEXT, OPC_DEXTM, OPC_DEXTU, a0, a1, - args[3] - 1, a2); + if (a2 == 0 && args[3] <= 16) { + tcg_out_opc_imm(s, OPC_ANDI, a0, a1, (1 << args[3]) - 1); + } else { + tcg_out_opc_bf64(s, OPC_DEXT, OPC_DEXTM, OPC_DEXTU, + a0, a1, args[3] - 1, a2); + } + break; + + case INDEX_op_sextract_i64: + if (a2 == 0 && args[3] == 32) { + tcg_out_ext32s(s, a0, a1); + break; + } + /* FALLTHRU */ + case INDEX_op_sextract_i32: + if (a2 == 0 && args[3] == 8) { + tcg_out_ext8s(s, TCG_TYPE_REG, a0, a1); + } else if (a2 == 0 && args[3] == 16) { + tcg_out_ext16s(s, TCG_TYPE_REG, a0, a1); + } else { + g_assert_not_reached(); + } break; case INDEX_op_brcond_i32: @@ -2170,6 +2195,7 @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) case INDEX_op_ext8s_i32: case INDEX_op_ext16s_i32: case INDEX_op_extract_i32: + case INDEX_op_sextract_i32: case INDEX_op_ld8u_i64: case INDEX_op_ld8s_i64: case INDEX_op_ld16u_i64: @@ -2191,6 +2217,7 @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) case INDEX_op_extrl_i64_i32: case INDEX_op_extrh_i64_i32: case INDEX_op_extract_i64: + case INDEX_op_sextract_i64: return C_O1_I1(r, r); case INDEX_op_st8_i32: From patchwork Fri Jan 17 18:24:42 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858261 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp845043wrb; Fri, 17 Jan 2025 10:33:20 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWP9piGz+YJmHD7ZjCo1+BhLQGYPBazJKt6bwlbGNWWnMUgK4ehnPLJ4ygtxQjEyBLEmLDg6g==@linaro.org X-Google-Smtp-Source: AGHT+IHV80jwTt9wCphvrJVlNeYTt+gxjO1Hppq9V+TRG25r1XfunaN/TB44wPD7eJn7wcZ8FRj+ X-Received: by 2002:ac8:590a:0:b0:467:5cfb:bd40 with SMTP id d75a77b69052e-46e12e8ea5dmr61032551cf.19.1737138800539; Fri, 17 Jan 2025 10:33:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138800; cv=none; d=google.com; s=arc-20240605; b=lYF+tIt79wgDRxuHSRXPU4ESCrVoGZXJGrxfQ5PyTy5ZHkYK10qXxCpr8HQ0WjRxNs TUaHtPTBD1nI/hpFUQLVxbbtjVTpIqbRMWg9AucRsW6HAoPaTUvi+uQUUfE43I+JdF1q Cy7/FbmaXib0pSHDBC/aRSiMF8xUU1FloJIO5aupqYX8EA2KCTgdMwitxEeTLTieAeQJ pDB76B9ylMQtrwknMwILEeWbTSSD05oqCFzHRfS8dicZ9LudKCJyDkAnIpQByNzIJZMx 9avV/EwNGu4Gld5ZL7efAZBsASy/OSdWbvPBfa4RHFjSe0sK0QSgpKZIz2gNWdrsDtjq yp4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=hMG+oLoCjABLWPojpZt4F9SjI0QtkGeaKIfn70EscWo=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=D4PqrGHOgZlshHX8aVz+D0RojxQyWNbeNJjWXWlFNLQnmTP6OdhNJ/a8wxqFWHE4k5 IloBaZsbg0d5FKlGe9PavLFoean60XQal8YHtijfoh7XklX0faXon/6+0obYyEptHSfz IGAw8wqVaclsoPFRqsnfrM+1Wbt3nWJu4Urbf9f7736gQOv1/K/MULSAuUJAxiT9qnLZ K7eOJ9/tXoLxvdVTilLAgmhAQseuy5q5uxoRi//b6czMDY38jYA/UN+dy30CWgzGMpEr 4Qt01pgLria8HdJBe+vUP9uHCskDLsf5Y32s+CW7EtHwyP8Mw0QoI8oNgc+G8CUfXgNd 4U7A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=KsraHB5y; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=fail header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46e104588f8si32611571cf.450.2025.01.17.10.33.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:33:20 -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=fail header.i=@linaro.org header.s=google header.b=KsraHB5y; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=fail header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr5l-0005jU-FL; Fri, 17 Jan 2025 13:29:13 -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 1tYr5h-0005Ca-2m for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:29:09 -0500 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr5f-0000Gr-3e for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:29:08 -0500 Received: by mail-pj1-x102c.google.com with SMTP id 98e67ed59e1d1-2f13acbe29bso5827623a91.1 for ; Fri, 17 Jan 2025 10:29:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138545; x=1737743345; 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=hMG+oLoCjABLWPojpZt4F9SjI0QtkGeaKIfn70EscWo=; b=KsraHB5yhZxa5hgQPUVZ7JR7eSaGkDhSqPuJMoKV8T+gx1AxutYsRJujWzX4Bwzu94 NUkv7EYLnUv8v3pA/4QoVwWf80akEanZE1uurCqBafe37QkueWLZhfu8kHTBiD9VFR39 fqrxf87xY0QPBpvxacxuPuIAui+dCOb8uydVqT5BnuEOsrJl9HV6wqpjtoLSvvyl5PMS ReecPtJGPkEhkwd/xquvUAGBrvu9iM68d5bQ8+2VlIyYEfiTa7eXZ0jlB4LDIe/oZgeA 2QWdoi3KITTBFiVIDemRfYzGk+TleNmC0lJ/bY+37EsHhLUdbKZWnDQbxhlSPu3XQhiW 8iKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138545; x=1737743345; 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=hMG+oLoCjABLWPojpZt4F9SjI0QtkGeaKIfn70EscWo=; b=cXxX154xZYjsP32xaKNUTzLrPqd0DbqCtb8NjcWfJAY7vFEBbc56pbBGRZASZSaLAn WURKmtcCL4JHqxHAhoQlNpN6Y4mhMPfPojlygqYMwvcOzQN2en5zSLruwJzqGP1VLMLl usjfSOBrJPZdFe9ThirkIsKI+GICgWvsk+c1iV0b6cJsjSs4N7sSjH9trRI930LOWsuv R3QcQg6QWfGYig02QWD4twJKdi5hg0irrh1zAJ3PYHa+FzK9oY8VmjaihX1FMMQImgup kkti69A/+uS4RF+AXt0BZOr7HvBWQ//9ROG1EYzBxqp8/52W93mN4ICIrLrAXss+gNEO X0uA== X-Gm-Message-State: AOJu0Yw6SNJx2tA5nhaiOs6qZXvqCUUhlQI2BYRZys7KmYrLMdzNChcR SBz2fwagGWldBQyhYb0uxz5Qd0xlf4CP4uMiz/EEYXwlew1l4RWyjoqR5rpENF9SuqESSLteYRl 6 X-Gm-Gg: ASbGnctt4/KOQZEJ7iqN2qORCYqsH5ruYwdW0tl98JPNX4KiHyZ0kS8RugzuhzujHF2 7FoXsWf7hJspVcslYjVAw7nlq20jN1dRo7sHigYg7qaP6iTT6Ljczo+5GL888Hu2sdi/LHgVoia GPKQHzHHhLehNHt07Cdb5WS2n78r1vO7KPbiokXE8bzv6CblPbCZpgJ+VZ/0SbDzirCSYcQ2GEm ccn06bEZZVCdh2WctOJ1qg5UQfSab1IUWV3/6WozGcAVcFKEGYQMDbYqJjECFh0U831wu8KM5hy KwUgzOb1/Reu17Q= X-Received: by 2002:a17:90b:1c91:b0:2f5:63a:44f8 with SMTP id 98e67ed59e1d1-2f728dc073emr20174529a91.8.1737138545595; Fri, 17 Jan 2025 10:29:05 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f77629bf96sm2614105a91.36.2025.01.17.10.29.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:29:05 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 54/68] tcg/ppc: Fold the ext{8, 16, 32}[us] cases into {s}extract Date: Fri, 17 Jan 2025 10:24:42 -0800 Message-ID: <20250117182456.2077110-55-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102c; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102c.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 Accept byte and word extensions with the extract opcodes. This is preparatory to removing the specialized extracts. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/ppc/tcg-target-has.h | 16 ++++++++++++++-- tcg/ppc/tcg-target.c.inc | 30 ++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/tcg/ppc/tcg-target-has.h b/tcg/ppc/tcg-target-has.h index a6c7cdba5d..d087189a77 100644 --- a/tcg/ppc/tcg-target-has.h +++ b/tcg/ppc/tcg-target-has.h @@ -39,7 +39,7 @@ #define TCG_TARGET_HAS_ctpop_i32 have_isa_2_06 #define TCG_TARGET_HAS_deposit_i32 1 #define TCG_TARGET_HAS_extract_i32 1 -#define TCG_TARGET_HAS_sextract_i32 0 +#define TCG_TARGET_HAS_sextract_i32 1 #define TCG_TARGET_HAS_extract2_i32 0 #define TCG_TARGET_HAS_negsetcond_i32 1 #define TCG_TARGET_HAS_mulu2_i32 0 @@ -75,7 +75,7 @@ #define TCG_TARGET_HAS_ctpop_i64 have_isa_2_06 #define TCG_TARGET_HAS_deposit_i64 1 #define TCG_TARGET_HAS_extract_i64 1 -#define TCG_TARGET_HAS_sextract_i64 0 +#define TCG_TARGET_HAS_sextract_i64 1 #define TCG_TARGET_HAS_extract2_i64 0 #define TCG_TARGET_HAS_negsetcond_i64 1 #define TCG_TARGET_HAS_add2_i64 1 @@ -121,4 +121,16 @@ #define TCG_TARGET_HAS_cmpsel_vec 1 #define TCG_TARGET_HAS_tst_vec 0 +#define TCG_TARGET_extract_valid(type, ofs, len) 1 + +static inline bool +tcg_target_sextract_valid(TCGType type, unsigned ofs, unsigned len) +{ + if (type == TCG_TYPE_I64 && ofs + len == 32) { + return true; + } + return ofs == 0 && (len == 8 || len == 16); +} +#define TCG_TARGET_sextract_valid tcg_target_sextract_valid + #endif diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc index 9205ac99e9..6e711cd53f 100644 --- a/tcg/ppc/tcg-target.c.inc +++ b/tcg/ppc/tcg-target.c.inc @@ -3430,13 +3430,41 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType type, break; case INDEX_op_extract_i32: + if (args[2] == 0 && args[3] <= 16) { + tcg_out32(s, ANDI | SAI(args[1], args[0], (1 << args[3]) - 1)); + break; + } tcg_out_rlw(s, RLWINM, args[0], args[1], 32 - args[2], 32 - args[3], 31); break; case INDEX_op_extract_i64: + if (args[2] == 0 && args[3] <= 16) { + tcg_out32(s, ANDI | SAI(args[1], args[0], (1 << args[3]) - 1)); + break; + } tcg_out_rld(s, RLDICL, args[0], args[1], 64 - args[2], 64 - args[3]); break; + case INDEX_op_sextract_i64: + if (args[2] + args[3] == 32) { + if (args[2] == 0) { + tcg_out_ext32s(s, args[0], args[1]); + } else { + tcg_out_sari32(s, args[0], args[1], args[2]); + } + break; + } + /* FALLTHRU */ + case INDEX_op_sextract_i32: + if (args[2] == 0 && args[3] == 8) { + tcg_out_ext8s(s, TCG_TYPE_I32, args[0], args[1]); + } else if (args[2] == 0 && args[3] == 16) { + tcg_out_ext16s(s, TCG_TYPE_I32, args[0], args[1]); + } else { + g_assert_not_reached(); + } + break; + case INDEX_op_movcond_i32: tcg_out_movcond(s, TCG_TYPE_I32, args[5], args[0], args[1], args[2], args[3], args[4], const_args[2]); @@ -4160,6 +4188,7 @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) case INDEX_op_bswap16_i32: case INDEX_op_bswap32_i32: case INDEX_op_extract_i32: + case INDEX_op_sextract_i32: case INDEX_op_ld8u_i64: case INDEX_op_ld8s_i64: case INDEX_op_ld16u_i64: @@ -4179,6 +4208,7 @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) case INDEX_op_bswap32_i64: case INDEX_op_bswap64_i64: case INDEX_op_extract_i64: + case INDEX_op_sextract_i64: return C_O1_I1(r, r); case INDEX_op_st8_i32: From patchwork Fri Jan 17 18:24:43 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858240 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp843506wrb; Fri, 17 Jan 2025 10:30:11 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWN7Be/G+M5yS99mVO8JX869UvT0I+S/6wI1Bg9NXgcxI/ds7mAqS4UGIEKjAkEZeGjvX3qHA==@linaro.org X-Google-Smtp-Source: AGHT+IE39im2oTLu3XidMI0flRKIuyM+yUtFfkGyRUSllv0V9OHNxzgFu8wpY207hkV9+F1RybJ8 X-Received: by 2002:a05:6214:3c9d:b0:6df:ba9b:35ba with SMTP id 6a1803df08f44-6e192ba8cd7mr190215276d6.12.1737138611774; Fri, 17 Jan 2025 10:30:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138611; cv=none; d=google.com; s=arc-20240605; b=aSm/9JhWBH/HZLlx4tMcIZ+h1Ipl5ox6hE0UExdimPx2D8eBZvk4GAa8np1R9PhX5H XaRY38OP9buIri4hbDSWpATZjnidYymQh0kXA4IhZZq+vZQH7GD3tIeswZ345T249wHk F1wXAzZkOwOfE2+pA716X2QMJNsSXST3BSJ3GTxFgaw8Wmew/EKLwC1rcfV4IPuT+e15 H8KLiEX9NZqks+ZXTiIEoLj1+Idg5v/2rYigr8cGPoA1fIlj/CKtC/4bzH2BG30MlXRw pGhGwEBafk+L0qqMgVMZEpCWTEyUcxGkCPF6iPAgcpSGIhLS0pm6/rmFJuud4grKsHRg LmSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=0COR0wGsJEy/ct0+IIODnhUoa5eU9hdaT7H7ngHo7to=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=ZmxYGgPFZ5wDjHocNkDFpcHh8kEMCTVbYCpIpUshCspMl9I6/E/W4k4Y0byYVJV+bs 3osfsAaLQHKX2yq7cyUb0MDu82nV6TZMPHDlMRgD3J+o3WtyEoJre5Z5L3TiXs1/F0q7 CoxCkuuxU506NqZurvvi5zHXeIHRrQWDNmKUE0J6Qir0MPDto1h6/VPYkKVlfdsOYK8l h/krQoUjs/v2MzzDa8wD2UJ0UIhCpb3U5k7HQti5ClZBZEXXLRyc7p0tsV/A5NfC4wYR HOjGSbgE7KRbuavnimsn2cauHuelkf9RoESovSJAiu4SpjTTzUZAaDq6TdHna6wo89w7 Id4g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=JTDtJRdq; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=fail header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6e1afbfada1si30568556d6.93.2025.01.17.10.30.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:30:11 -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=fail header.i=@linaro.org header.s=google header.b=JTDtJRdq; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=fail header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr5s-0006oJ-Vz; Fri, 17 Jan 2025 13:29:21 -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 1tYr5i-0005Ly-3U for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:29:10 -0500 Received: from mail-pj1-x102d.google.com ([2607:f8b0:4864:20::102d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr5g-0000HA-1m for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:29:09 -0500 Received: by mail-pj1-x102d.google.com with SMTP id 98e67ed59e1d1-2f4409fc8fdso4037153a91.1 for ; Fri, 17 Jan 2025 10:29:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138546; x=1737743346; 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=0COR0wGsJEy/ct0+IIODnhUoa5eU9hdaT7H7ngHo7to=; b=JTDtJRdqcYbUYar6EUMSeQ6offECcFNVWf/i7K/JKwFQaoT/mFYhW3BqTtZeMHhgi2 FLzfmiTJPtmEKYobI7zTHyX++im0t6s1x/Nsc1bal3plgbXSLlBbG59iHSNva6Minjzk /78DKiy0f5SjFZ02ENJUga/XtwjKzErqcQjg1QTYiidK21LuMnOBTwT0cQaIZjRX71Vr wte5qcIfcCd078DXauXSRJVAqx8saXhnmbJZw+543am7r4udDJY9/Clrsv7HH16b4DYx mAtXbnIxZ8RhsLzwgBwxEdA28rhOdNeEt7TMjWxJ5BPf9w6J8RmLUQjrMLGrxzu60APj sDug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138546; x=1737743346; 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=0COR0wGsJEy/ct0+IIODnhUoa5eU9hdaT7H7ngHo7to=; b=YiXy0T1vdAGA1aI673MAHVn1HUvMTJLV6tzVbF328VWdkEu9zXrB5mZ5PXgpSFpwlb CLgcr8f0kB9Nl7HPCncRJL7e0Xw/6Cy1cqKrykxG3QDUpPxk9wLppb7sk2dgFTzN4H4R WxJq47Dh4kocsGLW6VZ/BHG0m4y7LFUSeeyp4JiM3SFppEAM8hLSJChFaddCm0e735k6 Qt5XARAYKH3vo3IdInv5KTNE0QsvdFIUTHemp2aSXfv+swjuYBV1DqiT++o0xVG6AYl0 oHjh8vdw9khh/2CwPTeDU2aRUJZywAlBAXzhE2k6AV5I8NCdkNLHVUembmqCMjkWt027 QBlQ== X-Gm-Message-State: AOJu0YyH7vTmVPcVCcOL8lh8Iz5JeziUANbSL+g7Yw14zQagcONiSPBq /Sct+BeNQAHiPIxkaU1BO144lY92NP+7rqv6arhx3uLXUkfDibgzR9XTGwxoNrgOlx8rVtFbdVC 2 X-Gm-Gg: ASbGnctYyGFITfpC/vL4c9TmzGF9xzNbRFSoCx4wPPerkO0qOqhxZKnQfkVBl8ycwG+ /Cy2n+2hrm3vkiDZ4sRqdJm389TEAHSe049Dv62iyiWcMlEudE+c0tarWwgQKY44v7l5THKEiXF TjFjUBOo5AJI1k3lVkoqObYM736FHxVc7FufHZNEZycI7apF50313KWaahreD/4d/Mq0hJcAOFG 2XLbHXhh5zGHWTZoEIlaiUi/ZYO73gZIb4KzFTdPfVMbV7B38pjahRiL4OwcEyH4S1821ljjwoX sk+zz/gw/haKlDA= X-Received: by 2002:a17:90b:4c50:b0:2ea:61c4:a443 with SMTP id 98e67ed59e1d1-2f728da5ff5mr17520809a91.4.1737138546198; Fri, 17 Jan 2025 10:29:06 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f77629bf96sm2614105a91.36.2025.01.17.10.29.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:29:05 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 55/68] tcg/riscv64: Fold the ext{8, 16, 32}[us] cases into {s}extract Date: Fri, 17 Jan 2025 10:24:43 -0800 Message-ID: <20250117182456.2077110-56-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102d; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102d.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 Accept byte and word extensions with the extract opcodes. This is preparatory to removing the specialized extracts. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/riscv/tcg-target-has.h | 39 ++++++++++++++++++++++++++++++++++---- tcg/riscv/tcg-target.c.inc | 34 +++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+), 4 deletions(-) diff --git a/tcg/riscv/tcg-target-has.h b/tcg/riscv/tcg-target-has.h index ddc759a533..5bf62c7c7f 100644 --- a/tcg/riscv/tcg-target-has.h +++ b/tcg/riscv/tcg-target-has.h @@ -16,8 +16,8 @@ #define TCG_TARGET_HAS_div2_i32 0 #define TCG_TARGET_HAS_rot_i32 (cpuinfo & CPUINFO_ZBB) #define TCG_TARGET_HAS_deposit_i32 0 -#define TCG_TARGET_HAS_extract_i32 0 -#define TCG_TARGET_HAS_sextract_i32 0 +#define TCG_TARGET_HAS_extract_i32 1 +#define TCG_TARGET_HAS_sextract_i32 1 #define TCG_TARGET_HAS_extract2_i32 0 #define TCG_TARGET_HAS_add2_i32 1 #define TCG_TARGET_HAS_sub2_i32 1 @@ -50,8 +50,8 @@ #define TCG_TARGET_HAS_div2_i64 0 #define TCG_TARGET_HAS_rot_i64 (cpuinfo & CPUINFO_ZBB) #define TCG_TARGET_HAS_deposit_i64 0 -#define TCG_TARGET_HAS_extract_i64 0 -#define TCG_TARGET_HAS_sextract_i64 0 +#define TCG_TARGET_HAS_extract_i64 1 +#define TCG_TARGET_HAS_sextract_i64 1 #define TCG_TARGET_HAS_extract2_i64 0 #define TCG_TARGET_HAS_extr_i64_i32 1 #define TCG_TARGET_HAS_ext8s_i64 1 @@ -109,4 +109,35 @@ #define TCG_TARGET_HAS_tst_vec 0 +static inline bool +tcg_target_extract_valid(TCGType type, unsigned ofs, unsigned len) +{ + if (ofs == 0) { + switch (len) { + case 16: + return cpuinfo & CPUINFO_ZBB; + case 32: + return (cpuinfo & CPUINFO_ZBA) && type == TCG_TYPE_I64; + } + } + return false; +} +#define TCG_TARGET_extract_valid tcg_target_extract_valid + +static inline bool +tcg_target_sextract_valid(TCGType type, unsigned ofs, unsigned len) +{ + if (ofs == 0) { + switch (len) { + case 8: + case 16: + return cpuinfo & CPUINFO_ZBB; + case 32: + return type == TCG_TYPE_I64; + } + } + return false; +} +#define TCG_TARGET_sextract_valid tcg_target_sextract_valid + #endif diff --git a/tcg/riscv/tcg-target.c.inc b/tcg/riscv/tcg-target.c.inc index e381ba4e77..fc93900c6d 100644 --- a/tcg/riscv/tcg-target.c.inc +++ b/tcg/riscv/tcg-target.c.inc @@ -2343,6 +2343,36 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType type, tcg_out_mb(s, a0); break; + case INDEX_op_extract_i64: + if (a2 == 0 && args[3] == 32) { + tcg_out_ext32u(s, a0, a1); + break; + } + /* FALLTHRU */ + case INDEX_op_extract_i32: + if (a2 == 0 && args[3] == 16) { + tcg_out_ext16u(s, a0, a1); + } else { + g_assert_not_reached(); + } + break; + + case INDEX_op_sextract_i64: + if (a2 == 0 && args[3] == 32) { + tcg_out_ext32s(s, a0, a1); + break; + } + /* FALLTHRU */ + case INDEX_op_sextract_i32: + if (a2 == 0 && args[3] == 8) { + tcg_out_ext8s(s, TCG_TYPE_REG, a0, a1); + } else if (a2 == 0 && args[3] == 16) { + tcg_out_ext16s(s, TCG_TYPE_REG, a0, a1); + } else { + g_assert_not_reached(); + } + break; + case INDEX_op_mov_i32: /* Always emitted via tcg_out_mov. */ case INDEX_op_mov_i64: case INDEX_op_call: /* Always emitted via tcg_out_call. */ @@ -2620,6 +2650,10 @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) case INDEX_op_extrl_i64_i32: case INDEX_op_extrh_i64_i32: case INDEX_op_ext_i32_i64: + case INDEX_op_extract_i32: + case INDEX_op_extract_i64: + case INDEX_op_sextract_i32: + case INDEX_op_sextract_i64: case INDEX_op_bswap16_i32: case INDEX_op_bswap32_i32: case INDEX_op_bswap16_i64: From patchwork Fri Jan 17 18:24:44 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858259 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp844935wrb; Fri, 17 Jan 2025 10:33:09 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWhtFt0HEBp5dIgSuZIN1hrBl/MJ9oPxzxUzjSPvp5xehMS/hPcKHhsJYuWat/HdwaQdo4TeA==@linaro.org X-Google-Smtp-Source: AGHT+IFdlhjxci14lQGG5cpteKWuyhY/IhSAII37pZBz1ujdqfZOwWqawLHLZZI8eGq78LBXNWW2 X-Received: by 2002:a05:6102:3ec1:b0:4b1:16f8:efdf with SMTP id ada2fe7eead31-4b690d6889cmr4339522137.24.1737138789433; Fri, 17 Jan 2025 10:33:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138789; cv=none; d=google.com; s=arc-20240605; b=hXS4ijdsgKqiPZDdk3qyl7vTIbsGXbp1nZpTvxlBf4f7iN1+jtWPJGoSsL6Tbn6QcY PoTE28K/9Em3kHb+dIaYPzKYbIlocJiofRASVenb4fG8KcF6eq2ISMnVFFnKrkPLVOPx 7GTA30rmbZyM2JU8nxLKtUym3CJXyQzirLn6C/L096Ru9MQ251PJaysmeLoCVZP9ptaL AHTEJJLy0y/LTr0+OPemvS7Wg8CArtkKWofG3OBMtKHKx4QJxxpbqRpz+l5v23jtPJcj c37ZicVf+Y2N73MJU02UwvL+jK6qgUSCDmxudX4lk4G71TPYFxGqF3YvUVfvV7wPE1+C FshQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=GNuOBt1JSPghM0keCROPJeDQ4NGjiUPvhG7aOaf94cA=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=BZdWrI3DzYE4PXNF3HGc0a9uD33tjGbkACrLrSFftRK8ePsON35zUGhspK4z/CNHm3 gWpYEH4+2gVqnQYIQ13dV0WQPbi7JVwzeqDFgQojrfL27f4gpxmmDNpbCy1E7qBvjSD7 CHICkbVFLUdCjV9GdcYkcWo1z0GjLtxa80sjg56AH+1bw8gHPNE6G5DpZteuqF4gs/T0 wzFc6N2Jg4ZhanueEzOgGa1ewM4kTsQALWe7wRk/RkhOPETplIDlDvUuoohOMCcDgikv IMFnutBRoh/6tfIkfqGm+vixYVIh9PlqTT/0pHQ2Pwm5lEmv281sJJL+crI7Jb5PxfDn w4RQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JntfwglD; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id ada2fe7eead31-4b68a1c973csi1362459137.178.2025.01.17.10.33.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:33:09 -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=JntfwglD; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr5o-0006BO-Uj; Fri, 17 Jan 2025 13:29:17 -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 1tYr5j-0005UI-6F for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:29:11 -0500 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr5g-0000HY-9E for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:29:10 -0500 Received: by mail-pj1-x1032.google.com with SMTP id 98e67ed59e1d1-2ee8aa26415so4238192a91.1 for ; Fri, 17 Jan 2025 10:29:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138547; x=1737743347; 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=GNuOBt1JSPghM0keCROPJeDQ4NGjiUPvhG7aOaf94cA=; b=JntfwglDUCQzeVa8dpmwNya1AilOOl3pWz+YgxGZdiNQZsERzk4YHNLRYH1dgJTpF4 HNuAXPu9fvWpbKW9ltsRJGKqQwekmYoaqv3VLld4GKyYhX08tAcQKY3pMoQ4nqs0Pcc6 NIxKcqXmePTiOT81I88fwvOjIJEHz8fPdmaDN1pPxebRUO/gESjzp7UKtkdYbxCSi18q NWsAh79grHP4sgLQtfJ2lwXI6V69M27BKxHcK55JG7vJ7h+PWTwb90nNIMLp1/u1+yB8 CYhKfmlkFPil81q6AY/VRvbTTeK5rHqbclrRfUj4eXgYmztL59XZtQEZLTuSa+G6B6c+ WxtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138547; x=1737743347; 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=GNuOBt1JSPghM0keCROPJeDQ4NGjiUPvhG7aOaf94cA=; b=NxdpHb7+LAGcZzGByxRVJ7Slcb5s/lnas6R8GAX7J2rrwNzadJnPwSmu3N9mh5jwmP HuJIilFUiCxjreb1TopEJxYdiX9cdBwuhVksziTJly2ydW54dFNyH0VUHO23TatuAfvb j4eqOvC+JsgRecLK978DPu3JnFlGUjZcP5VG383tE5DlJPmaogCxfi4B5Ylj5R09w9os 46h9neCkIk1Ii3Nm2i+rolpewSLu1mGkUmZ90eEp07OIDqNNeRUkMcHtjrV6TxOwat4L C9CpSLBqJSVb39cD5YuXEvyZsM4X7uLpsKnw0jw+vvy58nb06OZw4K7dqcSV2UdjpkH3 jpxA== X-Gm-Message-State: AOJu0YypNk5R+crBMwLEz+XZ7FUC4eByFo+u2r35h29V4JHqJ4G0T/hC uxgF6JKgX/ZM4HAwOA3zysiSoHxM3mGE3CZiS6Rg1YKA2e14xxYkW8T3YBwn1rRjv+YAy6Z88Ly o X-Gm-Gg: ASbGncvWMmpwsfOGyJOuCGP6QjnjyBWQ+e2n42ZiiMtYUe7l14epVEVOHH+Y6gqum8/ botU5cUgsj8lnKN6yB9iwv/44z+lj+7+hYjY2wF7bARitAcovG+0jZ1p3um8cqTfVVyhw6WAgOK EqzapDFEEVH+F8DSL7fPKZQqDbufolD2NkvKAbtfkB5Pt2WB+LJhCYp1XhEkEbnzhJbLgKo2XBe njQxO5zWJE9SVuWciiKSqMAl6dOFapX1N/BoqRxlTYioomE/ipYYmwcm0nqa+XQzKR5LAIQ2T7z Vp3LJGgcu2z228s= X-Received: by 2002:a17:90b:2709:b0:2f6:be57:49d2 with SMTP id 98e67ed59e1d1-2f782cb58b8mr6020530a91.17.1737138546946; Fri, 17 Jan 2025 10:29:06 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f77629bf96sm2614105a91.36.2025.01.17.10.29.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:29:06 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 56/68] tcg/riscv: Use SRAIW, SRLIW for {s}extract_i64 Date: Fri, 17 Jan 2025 10:24:44 -0800 Message-ID: <20250117182456.2077110-57-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1032; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1032.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 Extracts which abut bit 32 may use 32-bit shifts. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/riscv/tcg-target-has.h | 24 +++++++----------------- tcg/riscv/tcg-target.c.inc | 16 ++++++++++++---- 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/tcg/riscv/tcg-target-has.h b/tcg/riscv/tcg-target-has.h index 5bf62c7c7f..e890546c3a 100644 --- a/tcg/riscv/tcg-target-has.h +++ b/tcg/riscv/tcg-target-has.h @@ -112,31 +112,21 @@ static inline bool tcg_target_extract_valid(TCGType type, unsigned ofs, unsigned len) { - if (ofs == 0) { - switch (len) { - case 16: - return cpuinfo & CPUINFO_ZBB; - case 32: - return (cpuinfo & CPUINFO_ZBA) && type == TCG_TYPE_I64; - } + if (type == TCG_TYPE_I64 && ofs + len == 32) { + /* ofs > 0 uses SRLIW; ofs == 0 uses add.uw. */ + return ofs || (cpuinfo & CPUINFO_ZBA); } - return false; + return (cpuinfo & CPUINFO_ZBB) && ofs == 0 && len == 16; } #define TCG_TARGET_extract_valid tcg_target_extract_valid static inline bool tcg_target_sextract_valid(TCGType type, unsigned ofs, unsigned len) { - if (ofs == 0) { - switch (len) { - case 8: - case 16: - return cpuinfo & CPUINFO_ZBB; - case 32: - return type == TCG_TYPE_I64; - } + if (type == TCG_TYPE_I64 && ofs + len == 32) { + return true; } - return false; + return (cpuinfo & CPUINFO_ZBB) && ofs == 0 && (len == 8 || len == 16); } #define TCG_TARGET_sextract_valid tcg_target_sextract_valid diff --git a/tcg/riscv/tcg-target.c.inc b/tcg/riscv/tcg-target.c.inc index fc93900c6d..4f6e18f59e 100644 --- a/tcg/riscv/tcg-target.c.inc +++ b/tcg/riscv/tcg-target.c.inc @@ -2344,8 +2344,12 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType type, break; case INDEX_op_extract_i64: - if (a2 == 0 && args[3] == 32) { - tcg_out_ext32u(s, a0, a1); + if (a2 + args[3] == 32) { + if (a2 == 0) { + tcg_out_ext32u(s, a0, a1); + } else { + tcg_out_opc_imm(s, OPC_SRLIW, a0, a1, a2); + } break; } /* FALLTHRU */ @@ -2358,8 +2362,12 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType type, break; case INDEX_op_sextract_i64: - if (a2 == 0 && args[3] == 32) { - tcg_out_ext32s(s, a0, a1); + if (a2 + args[3] == 32) { + if (a2 == 0) { + tcg_out_ext32s(s, a0, a1); + } else { + tcg_out_opc_imm(s, OPC_SRAIW, a0, a1, a2); + } break; } /* FALLTHRU */ From patchwork Fri Jan 17 18:24:45 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858265 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp845252wrb; Fri, 17 Jan 2025 10:33:54 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWx9oWrlP/8bR6BZN8NoDgTByHVQ1PD4HhnAAddJWPCcNA6r1efj1gXWREOoLzKeelNTiHB+g==@linaro.org X-Google-Smtp-Source: AGHT+IEJ/gpVnfmVYe0x2sVmrE848EhMnJw841GGaLt3EMCw65cLERkEMVU5t1rKkrPE88ZRpikn X-Received: by 2002:a05:6122:1988:b0:518:859e:87c3 with SMTP id 71dfb90a1353d-51d5b2c3406mr3902117e0c.7.1737138833888; Fri, 17 Jan 2025 10:33:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138833; cv=none; d=google.com; s=arc-20240605; b=HWH6aRMBszq+bdqZZK0OcgpV6F2zhJE2M7yprZJ/zdW2A2l5c5gzPrAdRr+sLyS7Og etiOaKLxFqwA5sMnbdq5L1/hID44j2cDQ7q31qjvdtdSvSb2eqzFTx4WzA3OmA58Bl4z PsY//qhbiDeElaqXui/JqDOcyFxckxtIFHgJnnbBdvbr+lD8cPumgyUp6/07+0tFcqol pXP+U3nWzhf3yN7Fdvtu2xH0zOYnUpm4qWukJXYsXiYWiy1wKFx3JhjL5ZZVjmidB4SY D/PYioS/LyRj/5U833cOZqQp/4wAci1qHlaZDKPdriz6/terLUQTe94Rtyl+POXvbDsX Q5MQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=vE6kmTZ7Zafe4pp+w0w04pzNctCrVCZYg/jS8o99R1M=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=P0KT6O6tOSOwOIf16qLGynMqXrtAc2IJVuLCtgeF9vwg/dOKe+8iyJpjI1JNIgY+PT p2bJRp8ElHEYHBN6oVqAwG1V/m0jEvU7m1tQSZWbE+qndV2Rgg3b/ICj2ZD98Aac/Yq9 kE5SF/6uLVJ03FzuVLa1qtkJ+uFG4opfaL64kcgSzcNEnlR1ksS00OOnmi3LNU9PN5h5 zMwYH7lf8ZS5dDdVmV0h2qjHYZNN8xps3lAYvTIWJUkuvhulaKgSx9AAIJF9/h2PX/H5 J2rXaSO5/k9jCiLrVRBqsHhWEDrR3eD2Cw6JTNtZgz8TCqoYAJwfn8Cr5Bovv4N3yNLk ssGw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=LXzoER8G; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=fail header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 71dfb90a1353d-51cf571e8aesi1338799e0c.165.2025.01.17.10.33.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:33:53 -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=fail header.i=@linaro.org header.s=google header.b=LXzoER8G; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=fail header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr5l-0005lJ-QH; Fri, 17 Jan 2025 13:29:13 -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 1tYr5j-0005RR-1K for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:29:11 -0500 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr5h-0000Hu-2Z for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:29:10 -0500 Received: by mail-pj1-x1034.google.com with SMTP id 98e67ed59e1d1-2ee76befe58so4224309a91.2 for ; Fri, 17 Jan 2025 10:29:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138547; x=1737743347; 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=vE6kmTZ7Zafe4pp+w0w04pzNctCrVCZYg/jS8o99R1M=; b=LXzoER8G9f2j8mGVBFO/+Vjnf2iRuNfGQtojG9r9RE2t2oxzz2W3eYRq8nM+ugAtE/ WAc7IwVcVykTVU9+yjazxajNJWFuw0W4+wBrzwLCzusI4AYJYmh1PybTNQIBSh5FPjzk RXxQww+DY60aMvUGeIwlyQTBD+J8Bq/8ra20JIOuUqsqeXYMrPudcsFl6VcQOFin7MTz S25DIL6ItO3aUscRYScBHR4Uz4Jn+c5O0YE9gHir3yzXlcYOP8CKY2S1HEMP0ZkPADxN 6UWpju1R14W/uck4nCNK7+DTiIvoNKjXKymOwG1ZJebN7VFBZS1ELLYK13JysWygSu1J Ymgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138547; x=1737743347; 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=vE6kmTZ7Zafe4pp+w0w04pzNctCrVCZYg/jS8o99R1M=; b=pToHtV+H4wVrrqXQs0MMZzWJOTZnFoSD6EontgtzIqHC/saQbHs41wQmIqQsAm6RZU rezULBOTULDDW8eOLa88SiBXoGaptz6690qKsHipPjFtfv9EtFzGOOxLA3B2Cos/DWHi PPnxBC0XS9l0GbKSNhfxDaaiI9VV+v9LNuBVajr7QYu9MQawy0ZtelFlfBM7CLH2dmnD SJEXh4M5Da2yE8jfaTYJ7M6X+ysqBXi66nllm15jK2kGwP8wCaWgklpXqIe4UMAdojei +ig+9M3fprZpqg+aZDmdZ+Vv7EPJPhoyrTe3Iuwq7ZT8U2d+GCikc/AQv7NPBBxzozqL ccyg== X-Gm-Message-State: AOJu0Yz+xKYTY+nJf1doKex6lEycO9pfidt+JRcVgm1VmBjg92VG87yA xUwDvsxKvHb2mvEBGTDQlqqTIsTvMQ/DWCOCOxY7Hk3Rr/k5YXmo/RbFxhnhW0nJvFzSExPsWLG H X-Gm-Gg: ASbGncuV/FMVD6Yjoq60SazWws4AKDuyln4uuz7CxL+K2AuBdViaLCx4+bK0J8zJDoz dmFuFSxkAi2GbfoR+D1z7WbvEfJ9LRaMEito/H7f6BCnRkA4BEF4qM6hBVFHGhmCLozmYLvjd8r l2TFbMZN+OhHQjO9C2PyapKt4+rn3RmCPIbec9fFD70U7lBrYhaLTNiqiJBj9yrFCK5BYauBfj6 GvQgdXVU8lFdtUOXqewyOYhLwawYmihk/KV0j3oX06kSvIwYysEyPmrd1MnDE72+s2at9qPTwFd CBnu6jFjjuu6tYI= X-Received: by 2002:a17:90b:54ce:b0:2f4:4003:f3d4 with SMTP id 98e67ed59e1d1-2f782d972c5mr5219219a91.30.1737138547560; Fri, 17 Jan 2025 10:29:07 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f77629bf96sm2614105a91.36.2025.01.17.10.29.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:29:07 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 57/68] tcg/s390x: Fold the ext{8, 16, 32}[us] cases into {s}extract Date: Fri, 17 Jan 2025 10:24:45 -0800 Message-ID: <20250117182456.2077110-58-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1034; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1034.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 Accept byte and word extensions with the extract opcodes. This is preparatory to removing the specialized extracts. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/s390x/tcg-target-has.h | 22 ++++++++++++++++++++-- tcg/s390x/tcg-target.c.inc | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 2 deletions(-) diff --git a/tcg/s390x/tcg-target-has.h b/tcg/s390x/tcg-target-has.h index 4992d74f12..72b57407d4 100644 --- a/tcg/s390x/tcg-target-has.h +++ b/tcg/s390x/tcg-target-has.h @@ -48,7 +48,7 @@ extern uint64_t s390_facilities[3]; #define TCG_TARGET_HAS_ctpop_i32 1 #define TCG_TARGET_HAS_deposit_i32 1 #define TCG_TARGET_HAS_extract_i32 1 -#define TCG_TARGET_HAS_sextract_i32 0 +#define TCG_TARGET_HAS_sextract_i32 1 #define TCG_TARGET_HAS_extract2_i32 0 #define TCG_TARGET_HAS_negsetcond_i32 1 #define TCG_TARGET_HAS_add2_i32 1 @@ -82,7 +82,7 @@ extern uint64_t s390_facilities[3]; #define TCG_TARGET_HAS_ctpop_i64 1 #define TCG_TARGET_HAS_deposit_i64 1 #define TCG_TARGET_HAS_extract_i64 1 -#define TCG_TARGET_HAS_sextract_i64 0 +#define TCG_TARGET_HAS_sextract_i64 1 #define TCG_TARGET_HAS_extract2_i64 0 #define TCG_TARGET_HAS_negsetcond_i64 1 #define TCG_TARGET_HAS_add2_i64 1 @@ -121,4 +121,22 @@ extern uint64_t s390_facilities[3]; #define TCG_TARGET_HAS_cmpsel_vec 1 #define TCG_TARGET_HAS_tst_vec 0 +#define TCG_TARGET_extract_valid(type, ofs, len) 1 + +static inline bool +tcg_target_sextract_valid(TCGType type, unsigned ofs, unsigned len) +{ + if (ofs == 0) { + switch (len) { + case 8: + case 16: + return true; + case 32: + return type == TCG_TYPE_I64; + } + } + return false; +} +#define TCG_TARGET_sextract_valid tcg_target_sextract_valid + #endif diff --git a/tcg/s390x/tcg-target.c.inc b/tcg/s390x/tcg-target.c.inc index fc7d986e68..dc7722dc31 100644 --- a/tcg/s390x/tcg-target.c.inc +++ b/tcg/s390x/tcg-target.c.inc @@ -1572,9 +1572,41 @@ static void tgen_deposit(TCGContext *s, TCGReg dest, TCGReg src, static void tgen_extract(TCGContext *s, TCGReg dest, TCGReg src, int ofs, int len) { + if (ofs == 0) { + switch (len) { + case 8: + tcg_out_ext8u(s, dest, src); + return; + case 16: + tcg_out_ext16u(s, dest, src); + return; + case 32: + tcg_out_ext32u(s, dest, src); + return; + } + } tcg_out_risbg(s, dest, src, 64 - len, 63, 64 - ofs, 1); } +static void tgen_sextract(TCGContext *s, TCGReg dest, TCGReg src, + int ofs, int len) +{ + if (ofs == 0) { + switch (len) { + case 8: + tcg_out_ext8s(s, TCG_TYPE_REG, dest, src); + return; + case 16: + tcg_out_ext16s(s, TCG_TYPE_REG, dest, src); + return; + case 32: + tcg_out_ext32s(s, dest, src); + return; + } + } + g_assert_not_reached(); +} + static void tgen_gotoi(TCGContext *s, int cc, const tcg_insn_unit *dest) { ptrdiff_t off = tcg_pcrel_diff(s, dest) >> 1; @@ -2726,6 +2758,9 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType type, OP_32_64(extract): tgen_extract(s, args[0], args[1], args[2], args[3]); break; + OP_32_64(sextract): + tgen_sextract(s, args[0], args[1], args[2], args[3]); + break; case INDEX_op_clz_i64: tgen_clz(s, args[0], args[1], args[2], const_args[2]); @@ -3325,6 +3360,8 @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) case INDEX_op_extu_i32_i64: case INDEX_op_extract_i32: case INDEX_op_extract_i64: + case INDEX_op_sextract_i32: + case INDEX_op_sextract_i64: case INDEX_op_ctpop_i32: case INDEX_op_ctpop_i64: return C_O1_I1(r, r); From patchwork Fri Jan 17 18:24:46 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858264 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp845154wrb; Fri, 17 Jan 2025 10:33:38 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWglH9cJmP/cL+cESKYmpLSIIwVq9VeJw8v2MIzztx5Rm4eUcDqIbjG0i1uABSP9j10lBOWpQ==@linaro.org X-Google-Smtp-Source: AGHT+IFt8/6uF9lF5r0EIV0ovz4p1TkWZjf58UW1NdUQIb6juO1rzfYPLWZeJALpe6Jg44aiKtTg X-Received: by 2002:a05:620a:2792:b0:7b7:7d6:dfe9 with SMTP id af79cd13be357-7be6325dbc7mr649083585a.48.1737138818736; Fri, 17 Jan 2025 10:33:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138818; cv=none; d=google.com; s=arc-20240605; b=Lp/DXJxq3NztAgvn00dnzca9Z+u9ttG30iqjS6wLCA1sYhvqN53NtZ6Z03qDZvTMDZ iyNNKldjffA2WuCp45zN06pQflH1Vacp8FFlW2uwSed6HG7yzkQdg9yPu5DEvPWVpxDZ t1QrUBpuu30XDf9hdtmp/NgaZ0gKHia8cLEg8I2qf0+kAHh2Wgc0ENmPNDXvGGR+swQm lU0hqJ+sOFRFwlFpWyUT6yEcb9sYYnRw9rW0xp3YS4qRaP59LmOR4I2RS3TVuhAuKMYX HLRtNamRKJ3i7gIGnrzxGDv9QJN/QZTskIZbh/dP4QD7c3KKnF2HyifXlvd40mJBtvUb /nqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=wCTRDw7PAbqCKYXvBgcxkNrgrmTWjt+YolnHFRZufm4=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=j2u46zEice5mnH/We1x/6nCt1AJTFvLBK4kMJfS7GOj4iZTYW9i6MkfludvzmTY9a0 S+AxW7v6ALZhc846tpPzvKFnQhwXawbIpKORu9dmILVh2E6F/TkW1k2jttLpuBLNCfR2 QVKBneLcdNk7F0W3GRYhnaXKADiOwAkSo5/cCp0fCbDiGkN+kjkTP53B8tDBNfLwBu+L AN8c+wtaRhIxaXE7VrbeFuKF+SKqO2CH5ijvRjYrZwRywF+3UbBfTHC8VQ9O/di116bJ DOWMmhyvskqxdBVv4klUY1ytaZT0itupQrPsdXgSL5dV35heTv2ie7PrThiHcxOh9ttJ PSVQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jSkN4S3z; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7be614774dasi318040285a.175.2025.01.17.10.33.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:33:38 -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=jSkN4S3z; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr5v-00079j-UX; Fri, 17 Jan 2025 13:29:24 -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 1tYr5j-0005W4-L2 for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:29:11 -0500 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr5h-0000II-QK for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:29:11 -0500 Received: by mail-pj1-x1029.google.com with SMTP id 98e67ed59e1d1-2ee86a1a92dso3575225a91.1 for ; Fri, 17 Jan 2025 10:29:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138548; x=1737743348; 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=wCTRDw7PAbqCKYXvBgcxkNrgrmTWjt+YolnHFRZufm4=; b=jSkN4S3zeMoFsamOK9r5MxY4Epy97M2+wdTusXvSFNANZjbIMBRiWVjrn9ru7LClO3 QTmTbfu3WeXfhL7yjLBWTtS3gqYLEPnA+apFRt8l4gKshrosZXEzKhXsIfYTi3ivrVnt sSKpZ29bkicE6eERX0p/YisxitOJhoifnE7u9WQN1oDsrnWViwoCUbfp4jeN5RjHX3+2 jyZPfI250XyoM3jZb9Hn08MsjzIfRB6+exiCzD9a3qXM9FrjXoBzjkMHM1egN4m1Te61 1yItx8rY4fRi3DVFsqNZ1HGtbsoo5aVD60Y1e+Tga9NdVFJMY/+uPCmuj/kR6G+MNbzo PGhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138548; x=1737743348; 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=wCTRDw7PAbqCKYXvBgcxkNrgrmTWjt+YolnHFRZufm4=; b=MLte+nbW5232NzUb5AoVjERURZEGUG5F4VkZxIDibDNTrEiDjFel8Lk2DCjcXWhZdp MzUYPWlmemq/diS9pqvp8sDnkXCAlp9HZurfIi1Gj5mL2+DN65SSm4vO6wij191eOmvw s3zN3FRhpygVRrAGjXPgygdA9gQhT6j8QWitGezWBBQVpZvifsFDqUPmyxtGN4jgHdaQ /ofZog9B5BhXOhxYFRt5YkdKfvlI8YnFgO+jZB7AvxaA3SdA6l3Xg+kHL8w592Qr5i5B yJkvqLh6ufCPKE2HGqJjfsOKMiRiWD1VSQCAvFx9kPbMgMcAfPUHLd6jjXP16chVoG8o 16Zw== X-Gm-Message-State: AOJu0YzBAkwnvXi3SGr/BdcC3vi/BciDIMyQHTtz5IqeC3NWjI/IRMB4 sleKxSbQF4QLsqcfW3P7qMK95ouxz91nc8KiPD8gBJxJGTaaxQ2SW/rH2lRQy2ABATARlcurIi2 P X-Gm-Gg: ASbGnctfgXNqCf2ITzak6y9T/ZKBq5u3wZFjVmdxkoEuCyiaXoGb82pxFPQU1BoNM0h V3b70De5Ts+QS/x7LRLfILrR6U8iOJw4wvrEq3Qx1WHCA2EuvYzh2a9k4VtFoo/UcK4vQFIgknJ PHaPA537/zh0ufAHoitdofzIgz190atSmvlHzPIHb0Kyz18wRwh164O6+EPkW/N9rHg/7yz43GH ZBdo7Xmmf5/yzGP7DWmY/SzQQvwGwYXFb8oVJTCYkvVnNUmpQJSQGG4dFrG7tcDxaAKON14y40x BGXdZ/OIrLTN+AY= X-Received: by 2002:a17:90b:534b:b0:2f6:f107:fae6 with SMTP id 98e67ed59e1d1-2f782d32397mr4402272a91.23.1737138548126; Fri, 17 Jan 2025 10:29:08 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f77629bf96sm2614105a91.36.2025.01.17.10.29.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:29:07 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 58/68] tcg/sparc64: Use SRA, SRL for {s}extract_i64 Date: Fri, 17 Jan 2025 10:24:46 -0800 Message-ID: <20250117182456.2077110-59-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1029; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1029.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 Extracts which abut bit 32 may use 32-bit shifts. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/sparc64/tcg-target-has.h | 13 +++++++++---- tcg/sparc64/tcg-target.c.inc | 11 +++++++++++ 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/tcg/sparc64/tcg-target-has.h b/tcg/sparc64/tcg-target-has.h index d9ca14cc3d..d3ec569592 100644 --- a/tcg/sparc64/tcg-target-has.h +++ b/tcg/sparc64/tcg-target-has.h @@ -33,8 +33,8 @@ extern bool use_vis3_instructions; #define TCG_TARGET_HAS_ctz_i32 0 #define TCG_TARGET_HAS_ctpop_i32 0 #define TCG_TARGET_HAS_deposit_i32 0 -#define TCG_TARGET_HAS_extract_i32 0 -#define TCG_TARGET_HAS_sextract_i32 0 +#define TCG_TARGET_HAS_extract_i32 1 +#define TCG_TARGET_HAS_sextract_i32 1 #define TCG_TARGET_HAS_extract2_i32 0 #define TCG_TARGET_HAS_negsetcond_i32 1 #define TCG_TARGET_HAS_add2_i32 1 @@ -68,8 +68,8 @@ extern bool use_vis3_instructions; #define TCG_TARGET_HAS_ctz_i64 0 #define TCG_TARGET_HAS_ctpop_i64 0 #define TCG_TARGET_HAS_deposit_i64 0 -#define TCG_TARGET_HAS_extract_i64 0 -#define TCG_TARGET_HAS_sextract_i64 0 +#define TCG_TARGET_HAS_extract_i64 1 +#define TCG_TARGET_HAS_sextract_i64 1 #define TCG_TARGET_HAS_extract2_i64 0 #define TCG_TARGET_HAS_negsetcond_i64 1 #define TCG_TARGET_HAS_add2_i64 1 @@ -83,4 +83,9 @@ extern bool use_vis3_instructions; #define TCG_TARGET_HAS_tst 1 +#define TCG_TARGET_extract_valid(type, ofs, len) \ + ((type) == TCG_TYPE_I64 && (ofs) + (len) == 32) + +#define TCG_TARGET_sextract_valid TCG_TARGET_extract_valid + #endif diff --git a/tcg/sparc64/tcg-target.c.inc b/tcg/sparc64/tcg-target.c.inc index afc778fae7..733cb51651 100644 --- a/tcg/sparc64/tcg-target.c.inc +++ b/tcg/sparc64/tcg-target.c.inc @@ -1510,6 +1510,15 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType type, tcg_out_mb(s, a0); break; + case INDEX_op_extract_i64: + tcg_debug_assert(a2 + args[3] == 32); + tcg_out_arithi(s, a0, a1, a2, SHIFT_SRL); + break; + case INDEX_op_sextract_i64: + tcg_debug_assert(a2 + args[3] == 32); + tcg_out_arithi(s, a0, a1, a2, SHIFT_SRA); + break; + case INDEX_op_mov_i32: /* Always emitted via tcg_out_mov. */ case INDEX_op_mov_i64: case INDEX_op_call: /* Always emitted via tcg_out_call. */ @@ -1559,6 +1568,8 @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) case INDEX_op_ext32u_i64: case INDEX_op_ext_i32_i64: case INDEX_op_extu_i32_i64: + case INDEX_op_extract_i64: + case INDEX_op_sextract_i64: case INDEX_op_qemu_ld_a32_i32: case INDEX_op_qemu_ld_a64_i32: case INDEX_op_qemu_ld_a32_i64: From patchwork Fri Jan 17 18:24:47 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858245 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp844015wrb; Fri, 17 Jan 2025 10:31:08 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUB5J15L9rVmwf05GubWnkJ+k1ctMp4DfjWVkTTUJl1/miTzSZZFoWYo1UEVreJlpHBOqijLA==@linaro.org X-Google-Smtp-Source: AGHT+IEGo6CEu1lFkUOesEfGrJHiHHk43ACcjhYtFOD+F7X6KpbgrDMvDFn5Uc2u7zchPiF8kTcL X-Received: by 2002:a05:620a:4502:b0:7b6:d420:7867 with SMTP id af79cd13be357-7be6320c320mr488095185a.11.1737138667915; Fri, 17 Jan 2025 10:31:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138667; cv=none; d=google.com; s=arc-20240605; b=G/ubCkQ3C0lwW5D3HhLuZZpc96kYaAQjQFnJPqx+QXBb3Y+wSSUzxERAbMSoeJt1wD a9tC7Klf1VSIbgVrBKyorEVGPtJ/HKxkAvPj76YhENDQEJR557Fb8lBuzLpxOhFNbTF+ F5W51KW74vV8fXdQ89QXaZrhrBPda7tGgJtYHBY9LWZihyZdto9JrEw+p0jFcZNVACs7 6Cb+rFxt//o9kpf1lLkSgoNzr5X90Z4wy72Dc0Ui0DEMkmbuTCu0qGwhrTpak3WbpM6o Jr+qJGoM6D6YpmmIjZonNwZbrcze1YplpAwcGtI8+pTw40FN7l8NkNyEuS76yQCrQAQy eVQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=QUoH6IderpX2SkSnRqodXnZDFZwnaaVDcCqIjakkjh4=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=Si7D1BJLnQuBC1ll+FTZ6wEslPBRpDbNb30l3RQ8QdD6/L9iJwe3VWNj+lcvgB0Xvb fvyRRy6pIabScUFKFiB4Pyd4ZHziZhhQCKKn8ad5MC1F+lsmHGOwTvX/PH+HkHRYcEof vvMQ9Es83bef2iXHqOplaGoMqXXXjFPJxvBCwyo52ZhUVNVqxCEfbE63kLIQDn5a/hqx ET53nCU2SkNzNKmAZsiYtyxzuFhN9++iEUaOZ97L9CASzpgGzASSQjmWfMEh5EQxX2cd I43aHWci4Z7rR+8l0BuJxawUIqDa6ZyYmX2jVR+R6n89AFX0+LuBnXhPOfOa0X1f4y5Z Ah6w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=W5nStGg3; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7be614f4883si319757485a.592.2025.01.17.10.31.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:31: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=W5nStGg3; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr6E-0008Io-C7; Fri, 17 Jan 2025 13:29:42 -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 1tYr5n-0005zS-Fa for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:29:15 -0500 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr5i-0000Ig-Cu for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:29:15 -0500 Received: by mail-pj1-x1033.google.com with SMTP id 98e67ed59e1d1-2ee786b3277so3314930a91.1 for ; Fri, 17 Jan 2025 10:29:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138549; x=1737743349; 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=QUoH6IderpX2SkSnRqodXnZDFZwnaaVDcCqIjakkjh4=; b=W5nStGg3aN00ZrdNnOXMWmUVqO1min0JvFuI9UgXIIpmXcT5TEpLIlw+EA9Ts0mDn6 Xe9F6POmAHTQXX/54o2zqbMetPt6PbVzMF9IPT3zKQ7EAwhuYpLkPsflc5G46wmcMAB/ T3mGn7NngNVGT+A08RWsvWnkwxFjt7Ah86N+/NyRbCjackYM9Cd55KXEi98qnCiwP3vG 99/yAmTTzfYsKuyrhgQ5CyhzOYwR0thOOH3h41yhTOY9GvNy5BXqI0kEbgAXJozDSr7y KGOCwo43T83ARVghXZ7rV8xiZkmHTwtb1L5G4B1/OxN921BYouQ9TbFjjGnlT5dfjWBo wEWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138549; x=1737743349; 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=QUoH6IderpX2SkSnRqodXnZDFZwnaaVDcCqIjakkjh4=; b=YdRyp1RalFyFkDl8EccMwN5GcY0Y8b9sja1E6vJExC8hgMyQF5ROn0rqqp5qbFTDCm TS5/ikDk3Gmm0wylCiCdtocxuNRR9+EOJD+GmFEa7cuEndcrhhKozbcUaDEnb2+sXL3c Z12VqjXMFH77IuOQA2P3uruL1V3nH9MvW0Yhmxk2baEtRMphab6f44XyTjPDrKy2jgpu e4Te7jiFmQHYpZRMO4LVo/7PHjHqksf1FABVrcbhp/KEAiW5VWezqr+61M1EfrbJSugs JTkFgEhwXmYbyIyTvzmUhNBMKIYnkBmMsc29IiTmE2pm5vOoVNmscYTytqe6+Y7QwGW/ tfew== X-Gm-Message-State: AOJu0YwvQbqZmgjLvnIZiXyiTQvs1pjp4h+Y4jUEexWlb5XyZVcxn+xi 8+6HPFcBDkLVbnXmuXsyoOo/Wi8NtOcLAwxIUgkATWqNemwORkg9Ks55SZZ6bCLN8YrZ8bICdQg O X-Gm-Gg: ASbGncue30Pg07EcoRGqArrS+kq+u3kvL81Mo/2i1aUAMe+39N/Dt3/Eq4b4eRHTpan SlzlJEtE3VwXwvOsXU2a4BHSTSIstAUIOkRgSxSBtm0BuTm+9HZhYqFPHNZ1jJASZhfzROZY0bD IPyLevLjgI2Gy9Jcx12H/FTr++EWD/bX3ORVikjrzND0gOkBAELBZvAHSGIUmmEIMSHbb1XrE8R xkWBbkxhzlzIjAvdz6woMNGYOprcB8T4AUfEDmnQaJKglgVTph+lOOH8azT+DXL+Gm8i9Prtqg4 4DWCgXSuwC8KeJs= X-Received: by 2002:a17:90b:51c6:b0:2ee:fdf3:38dd with SMTP id 98e67ed59e1d1-2f782d38454mr4343574a91.23.1737138548711; Fri, 17 Jan 2025 10:29:08 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f77629bf96sm2614105a91.36.2025.01.17.10.29.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:29:08 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 59/68] tcg/tci: Provide TCG_TARGET_{s}extract_valid Date: Fri, 17 Jan 2025 10:24:47 -0800 Message-ID: <20250117182456.2077110-60-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1033; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1033.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 Trivially mirrors TCG_TARGET_HAS_{s}extract_*. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/tci/tcg-target-has.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tcg/tci/tcg-target-has.h b/tcg/tci/tcg-target-has.h index 3397403910..2f45ad614f 100644 --- a/tcg/tci/tcg-target-has.h +++ b/tcg/tci/tcg-target-has.h @@ -80,4 +80,7 @@ #define TCG_TARGET_HAS_tst 1 +#define TCG_TARGET_extract_valid(type, ofs, len) 1 +#define TCG_TARGET_sextract_valid(type, ofs, len) 1 + #endif From patchwork Fri Jan 17 18:24:48 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858275 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp845635wrb; Fri, 17 Jan 2025 10:34:48 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWQlsV3zuSdF7xJHVa2TeNcbs6anTE4ZrHmHqQcbHRNutIA2X212jzWArxjpNnD38cx5fy9lg==@linaro.org X-Google-Smtp-Source: AGHT+IFt2sDjPiJj1bUleWZ9VCGUdPK4Gxw9N0Gqbv2KR77dSlxQm/frmVNNDCSAEp99VuDk3syI X-Received: by 2002:a05:620a:24cc:b0:7b6:d8da:90a3 with SMTP id af79cd13be357-7be6327c4f3mr506409785a.44.1737138888484; Fri, 17 Jan 2025 10:34:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138888; cv=none; d=google.com; s=arc-20240605; b=aSlYOUb0t3WQdGxS0yY5/pFXPPttGrn1V84D9lMkeagpnGHOUL20tA6gDo6fNRxXMI X1zLhC1U/N3E1ToKiRzG60WNaJd/KEzWMFLqy8IWSA+UTXy5mgtvK9RTnUeVcRSgap1Y znJX+ow2wwFItz7Zj8j54OBAizCxBnUMsmvEafHJNKENSgqgGf987IXdLRp7ifY9Zrni G7TvkHcvcyocyknyCWs6a9eGixz7CxfTscJR3XzIIhKXIywB1ntqTdse80asjUVhzBTg viIeh/4gqPPGouks3YGxKw6dBxrFVary+RtFT3v0kCCb1pp7/QCniaIcPa1ezRvDB3yO q3Mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=CPqE5pOJRUt4lCbKjtOFdsXTgP83uWIvLseojaZHM+8=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=XFedobPlbMwBQWW85UNF4eYtwJ45VAxxtkr8NPBoeXVjpSHZlDN+M5VwoegB/uOUug xdZGOwu2gDNcekc+if3QiiKoah603S7aMDxiO8PMW1E6l1e7s9pLHn1O19qpX7qpxsKW n6qA1C6WBLP8+ysz3ZCmBa9b4YtVnF+W19Mz9C10uiwiErg2+6AuromslXJrd01R0aiB xxs8E9AA90kztEkgyC3zjg8MSauYxvTrSMxNyUbNIyqXXODJh5NVyKujLpJXeQwaezvZ dqvua2zhNaEP7KFblDiLwXXlq4Z3qPVhHDLvgPOWDZsK/z1iLoxIcHGZXDgaxXtBcvOR 2aRw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eGlo++Cw; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7be614cbed4si317060385a.413.2025.01.17.10.34.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:34:48 -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=eGlo++Cw; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr66-0007Xy-3B; Fri, 17 Jan 2025 13:29:34 -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 1tYr5k-0005cc-MM for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:29:12 -0500 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr5i-0000J1-Ra for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:29:12 -0500 Received: by mail-pj1-x102f.google.com with SMTP id 98e67ed59e1d1-2ef87d24c2dso3452806a91.1 for ; Fri, 17 Jan 2025 10:29:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138549; x=1737743349; 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=CPqE5pOJRUt4lCbKjtOFdsXTgP83uWIvLseojaZHM+8=; b=eGlo++CwRfvLBDQtOSXfmuK7ZvMnYd8VqsH/Mhd5M6g9Vb97DP4k5ZJI4+1gY+roLF OrBSnOlNTl7GSRmtgJyd/yZ/0TjNPjNm5cMVlcQEQMEMzrORM9g87MPsCnOuwR7y/PDN 6XT5t10y9NqZuEUwwvDMenxyYT6iEFIJUTzf/3Ut9sEf7qs95JL1v1BinGLkbGBujnwy /O2SCleG0GUXqPV/7buaomCoDHSgUKOmw7mKoTfUHpAX766+8zso3x5NdaVQkXPZb0ne QAwNwnsthmBbKeRzgWOsTQ8oj3ffOVUevQImSgSC40fytGYVT1mUw+OBoRrnwVRstgyM 3tnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138549; x=1737743349; 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=CPqE5pOJRUt4lCbKjtOFdsXTgP83uWIvLseojaZHM+8=; b=hHtlpnMNIbwwFD7Cu5pr4vWVviObHweJqVuoDSIB1yqM+57HmPkyf+LQOTvDupUu1y /vB3RkHJ0vT9ts+b6PvHOFtIaWVcbjB66RDcmjQxNB4s3yR1sY0myBSCB6anngGZr043 cJkdcYYfeGZk2AQNi35c+yMXEM5bu8SUkxy4NoVQoJ7F/BpuViA5zrSUie0HnOCu/w4i QjcQv12TAt79z46KWNdwyAntTnNM9TePmnDBxuuJ2t2oGhw0EIiIDpr8pqgFKVTIsRUh 82VfPcoopH/w9yb6wszOjk83J7+XS+Hb9oamy3StJsGFcgFDZnqlQ5MZOlnQoG8UNVA6 7ZgA== X-Gm-Message-State: AOJu0YzKsShP43WenkCC2kUuzXbmZRMtIHy3Ujx2PAyGTttFy4YwoLdb g+ZMHo4kii55N+65PX5Ufk9LdgYI+swRq/5TJ89nTo0u/HuodrLSKZ9mrERRPi1A88CgB4ELx8d q X-Gm-Gg: ASbGncurlM+ELPp6f62XSyK07ZUYAqmEKtZPL1UOE4eesvDtZ/RsZkiQIeVak5jmaTx 8xfbagF9WbgORLi2BXGXVonvYrXo3RfXQKEo+UANK1JvYAcU26lX3zdDpUfnmvM8Jdf5Ur51oDF Ingtt+XlIp5AVy1YL6W118g10R61PN3g7ubeo63jqJPqzg4qJkmpJgFWS25k29XcJ8rJzkXTfvF aevow82RfqnMYQWY2kPu8imP4K95yS7JoQ28scvl9IPNrwMYEoe6E0aLgmjCT8VZAyIYDv3qtrj g/G1GxxSIZS+T/s= X-Received: by 2002:a17:90b:51c2:b0:2ee:8430:b831 with SMTP id 98e67ed59e1d1-2f782c65787mr5534314a91.2.1737138549388; Fri, 17 Jan 2025 10:29:09 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f77629bf96sm2614105a91.36.2025.01.17.10.29.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:29:09 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 60/68] tcg/tci: Remove assertions for deposit and extract Date: Fri, 17 Jan 2025 10:24:48 -0800 Message-ID: <20250117182456.2077110-61-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102f; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102f.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 We already have these assertions during opcode creation. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/tci/tcg-target.c.inc | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index 88cecbd62f..8dedddce5f 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -775,28 +775,12 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType type, break; CASE_32_64(deposit) /* Optional (TCG_TARGET_HAS_deposit_*). */ - { - TCGArg pos = args[3], len = args[4]; - TCGArg max = opc == INDEX_op_deposit_i32 ? 32 : 64; - - tcg_debug_assert(pos < max); - tcg_debug_assert(pos + len <= max); - - tcg_out_op_rrrbb(s, opc, args[0], args[1], args[2], pos, len); - } + tcg_out_op_rrrbb(s, opc, args[0], args[1], args[2], args[3], args[4]); break; CASE_32_64(extract) /* Optional (TCG_TARGET_HAS_extract_*). */ CASE_32_64(sextract) /* Optional (TCG_TARGET_HAS_sextract_*). */ - { - TCGArg pos = args[2], len = args[3]; - TCGArg max = type == TCG_TYPE_I32 ? 32 : 64; - - tcg_debug_assert(pos < max); - tcg_debug_assert(pos + len <= max); - - tcg_out_op_rrbb(s, opc, args[0], args[1], pos, len); - } + tcg_out_op_rrbb(s, opc, args[0], args[1], args[2], args[3]); break; CASE_32_64(brcond) From patchwork Fri Jan 17 18:24:49 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858274 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp845546wrb; Fri, 17 Jan 2025 10:34:37 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVgbzsLx85jM9B7C8XrUT8wO/3MTpzkVHsvrhWJjyr4tvPPN1vHjrtZ8aLyTGVujxBryxDWPA==@linaro.org X-Google-Smtp-Source: AGHT+IG69E2p+6o1Wm1OjvPQpeJJgdJbghNSwswPXBEc2Hwiy/QdabnH5YptVfAo+/G3BimWvTjL X-Received: by 2002:a05:620a:438d:b0:7a3:51ed:38b5 with SMTP id af79cd13be357-7be63159f42mr477994285a.0.1737138876962; Fri, 17 Jan 2025 10:34:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138876; cv=none; d=google.com; s=arc-20240605; b=Rp16okzW+kziZMIO45oRZ3tFWmQeCv2RgqWIvpg+BXNDBng5J6RE6D1doTDzj8+jEh G8Ddq4WkEro5oISoHh6r3yAEd7AC2KDqdaityFEFCZAHd+Qeijc9oOtUqOYeftLg5pbG mIXasV672P22tRgPlXGyJ25Jj7rl22CCSkR6+KYw00rcp9mIYYjgzUdGMp+vXrPmAZOf 1Bf/nOisKLXEnjROjbq8DOex2UEmDa9JlmOMVPiV9OQHzo5B9r+mk8iEzPEWitKYIQnS RXvq3xwT+OEvVhoPTw6ALG47KmWo6WekCqhUFM4en2hkNg2JvfGUhhh69AVrirqEPgmJ gh+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=ABEAogJ0ZL+pHZwQxZUGpqsMmWqdOXA3SAPSsWYT7XY=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=NnOSCjIGwQhNw88TFfxGytzjthHGlNz0GFZIzHO0UmqmVJGe8yKomJcUb5kGwI8AVf DHR+EUCoE/k35nVVaIs0neQx148dgtsJvWZ1NUC1/IC/LY8KOLgt4dQjcltO0TGqzGah 9+1ALGfuS7GA8WOx3T34q8jhcfWTykqTgVVfiAE3Rr2KIO+K6N48LiOR1b8yJjqhVP/h z3wL0O9iKrC9wxYQHXeEfKJQ3hS8T7hEZnH6icZS6yQvkETU3cb/xBcVuu8TnSw5RHDk 7j1CN4DmGc/D31PyKn6wMzo5CwQW2Dr9JptJMNblJj59JjocCgFE+F0v05kLCDRknFtN nJcg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SsjbOcap; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7be614cbf34si321922085a.434.2025.01.17.10.34.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:34:36 -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=SsjbOcap; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr66-0007Yy-CP; Fri, 17 Jan 2025 13:29:35 -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 1tYr5p-0006CI-0p for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:29:17 -0500 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 1tYr5k-0000JI-1X for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:29:16 -0500 Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-2165448243fso57223615ad.1 for ; Fri, 17 Jan 2025 10:29:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138550; x=1737743350; 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=ABEAogJ0ZL+pHZwQxZUGpqsMmWqdOXA3SAPSsWYT7XY=; b=SsjbOcapY5zITLL4he5+6a0W80D+2el2Esynfp1drL/xiwYTwXJdNoJ/SOiDb/NsZ5 doTTm8lI1YtIUbbTwoQM2NohU5W1nn6SaXqVnaGjAfwRCO9iXCysfO3/+PPmSK4/lqJS 1Ezqi2up11DzYyMhMksl4SeyoZWJrKvLj63De6R5nOirWLATeoy9tLGzxSEV8TSUfAbH iXXfJ6C3CSGrU4CAJXeNovLzARrKrFCwCmXepsyqNxOGLdXYJ0ge1yGXiYU9KSCb7Hd9 CecJzoszn0eW/xtDB5I4aTDMeDzmH1E3/sPe+aQi/NTmaawmyAvwVISTFA10OC8+X0zc KP7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138550; x=1737743350; 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=ABEAogJ0ZL+pHZwQxZUGpqsMmWqdOXA3SAPSsWYT7XY=; b=oHbVVdKWLu3a097eKTXG2IZB3eIhtEuQ+4wK9T60SI0GEfUMxrVCHUlqYck56OAPLw MZZHCNm9rqrPqRPUecGqgyutT4VB7R7qzhPW0eL6E9E3SyqwTP2GhgRMjmdJLiTsEpQ5 DDQ0O6hkKR/zklMgJJ9KqEtkR6cAOpruWBXDhTvyuqiDxbH7DmukO6AtOC8g2un0Q7i/ X6B0YcmXE8Cnu6w2cMIC7HaE6u9cUWIgaTZ+6x7Q61zZg8Lxz6G74WQ3qRtvSmQN5Pgx RI+wdxQ06fcBiSuWQ7zokLFiPmDr1kYuwQwOQXmSbe+vPExqviS0Cp/gOWWWG73CERLV ApLA== X-Gm-Message-State: AOJu0Yxk+UoP3tVuZ8HxkLhvKOtyjGugKKeyyYL15Lh/3/IatV2V5q2q wBabslUItB9ZCZttgQQdqXM8DKJ+5nEybX67HHKEFeUC6XJPTb7D7hb2S2zeEDh0Mq6qsPfxmIS 7 X-Gm-Gg: ASbGncvX9+B9gGrF/4OXELB3a8GmegbGTTu+eW53rmx6UvOkfW/XqLrl6g5jPMb75EF 5oQ805urkv8dx2nFsShqqqKwc8Nk1zsqzUVAoI+8mSrd2hkYdoXAhWWmjz4eZMeDXeMPMnauh5Q oY9c9ac5G1OI7tYesqgX690Oz0u9T4whibat0ZaXWDPihbXq8BgAeqhkTtuXMO5ioOA2h8qxE/D aCXLWuT6LxuI67FTRCGPfLH+qO9EGC5Jykncsp/hfe22risfzvVeupku41S0riKMgumoxMX1o2H 1UIazYCvqi73lBw= X-Received: by 2002:a17:90a:c883:b0:2ee:f687:6adb with SMTP id 98e67ed59e1d1-2f782c62722mr4934892a91.3.1737138550024; Fri, 17 Jan 2025 10:29:10 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f77629bf96sm2614105a91.36.2025.01.17.10.29.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:29:09 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 61/68] tcg: Remove TCG_TARGET_HAS_{s}extract_{i32,i64} Date: Fri, 17 Jan 2025 10:24:49 -0800 Message-ID: <20250117182456.2077110-62-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Make extract and sextract "unconditional" in the sense that the opcodes are always present. Rely instead on TCG_TARGET_HAS_{s}extract_valid, now always defined. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/aarch64/tcg-target-has.h | 4 ---- tcg/arm/tcg-target-has.h | 2 -- tcg/i386/tcg-target-has.h | 4 ---- tcg/loongarch64/tcg-target-has.h | 4 ---- tcg/mips/tcg-target-has.h | 4 ---- tcg/ppc/tcg-target-has.h | 4 ---- tcg/riscv/tcg-target-has.h | 4 ---- tcg/s390x/tcg-target-has.h | 4 ---- tcg/sparc64/tcg-target-has.h | 4 ---- tcg/tcg-has.h | 12 ------------ tcg/tci/tcg-target-has.h | 4 ---- tcg/optimize.c | 8 ++++---- tcg/tcg.c | 12 ++++-------- tcg/tci.c | 8 -------- 14 files changed, 8 insertions(+), 70 deletions(-) diff --git a/tcg/aarch64/tcg-target-has.h b/tcg/aarch64/tcg-target-has.h index 26ce65b6a5..43eaa2287c 100644 --- a/tcg/aarch64/tcg-target-has.h +++ b/tcg/aarch64/tcg-target-has.h @@ -32,8 +32,6 @@ #define TCG_TARGET_HAS_ctz_i32 1 #define TCG_TARGET_HAS_ctpop_i32 0 #define TCG_TARGET_HAS_deposit_i32 1 -#define TCG_TARGET_HAS_extract_i32 1 -#define TCG_TARGET_HAS_sextract_i32 1 #define TCG_TARGET_HAS_extract2_i32 1 #define TCG_TARGET_HAS_negsetcond_i32 1 #define TCG_TARGET_HAS_add2_i32 1 @@ -67,8 +65,6 @@ #define TCG_TARGET_HAS_ctz_i64 1 #define TCG_TARGET_HAS_ctpop_i64 0 #define TCG_TARGET_HAS_deposit_i64 1 -#define TCG_TARGET_HAS_extract_i64 1 -#define TCG_TARGET_HAS_sextract_i64 1 #define TCG_TARGET_HAS_extract2_i64 1 #define TCG_TARGET_HAS_negsetcond_i64 1 #define TCG_TARGET_HAS_add2_i64 1 diff --git a/tcg/arm/tcg-target-has.h b/tcg/arm/tcg-target-has.h index d9f3311102..7152dd6f5e 100644 --- a/tcg/arm/tcg-target-has.h +++ b/tcg/arm/tcg-target-has.h @@ -41,8 +41,6 @@ extern bool use_neon_instructions; #define TCG_TARGET_HAS_ctz_i32 use_armv7_instructions #define TCG_TARGET_HAS_ctpop_i32 0 #define TCG_TARGET_HAS_deposit_i32 use_armv7_instructions -#define TCG_TARGET_HAS_extract_i32 1 -#define TCG_TARGET_HAS_sextract_i32 1 #define TCG_TARGET_HAS_extract2_i32 1 #define TCG_TARGET_HAS_negsetcond_i32 1 #define TCG_TARGET_HAS_mulu2_i32 1 diff --git a/tcg/i386/tcg-target-has.h b/tcg/i386/tcg-target-has.h index ad69f957a7..833ccc411a 100644 --- a/tcg/i386/tcg-target-has.h +++ b/tcg/i386/tcg-target-has.h @@ -44,8 +44,6 @@ #define TCG_TARGET_HAS_ctz_i32 1 #define TCG_TARGET_HAS_ctpop_i32 have_popcnt #define TCG_TARGET_HAS_deposit_i32 1 -#define TCG_TARGET_HAS_extract_i32 1 -#define TCG_TARGET_HAS_sextract_i32 1 #define TCG_TARGET_HAS_extract2_i32 1 #define TCG_TARGET_HAS_negsetcond_i32 1 #define TCG_TARGET_HAS_add2_i32 1 @@ -79,8 +77,6 @@ #define TCG_TARGET_HAS_ctz_i64 1 #define TCG_TARGET_HAS_ctpop_i64 have_popcnt #define TCG_TARGET_HAS_deposit_i64 1 -#define TCG_TARGET_HAS_extract_i64 1 -#define TCG_TARGET_HAS_sextract_i64 1 #define TCG_TARGET_HAS_extract2_i64 1 #define TCG_TARGET_HAS_negsetcond_i64 1 #define TCG_TARGET_HAS_add2_i64 1 diff --git a/tcg/loongarch64/tcg-target-has.h b/tcg/loongarch64/tcg-target-has.h index ac7d2fcdf9..a15ab9cc28 100644 --- a/tcg/loongarch64/tcg-target-has.h +++ b/tcg/loongarch64/tcg-target-has.h @@ -16,8 +16,6 @@ #define TCG_TARGET_HAS_div2_i32 0 #define TCG_TARGET_HAS_rot_i32 1 #define TCG_TARGET_HAS_deposit_i32 1 -#define TCG_TARGET_HAS_extract_i32 1 -#define TCG_TARGET_HAS_sextract_i32 1 #define TCG_TARGET_HAS_extract2_i32 0 #define TCG_TARGET_HAS_add2_i32 0 #define TCG_TARGET_HAS_sub2_i32 0 @@ -51,8 +49,6 @@ #define TCG_TARGET_HAS_div2_i64 0 #define TCG_TARGET_HAS_rot_i64 1 #define TCG_TARGET_HAS_deposit_i64 1 -#define TCG_TARGET_HAS_extract_i64 1 -#define TCG_TARGET_HAS_sextract_i64 1 #define TCG_TARGET_HAS_extract2_i64 0 #define TCG_TARGET_HAS_extr_i64_i32 1 #define TCG_TARGET_HAS_ext8s_i64 1 diff --git a/tcg/mips/tcg-target-has.h b/tcg/mips/tcg-target-has.h index e7914cc970..1bc14f65dd 100644 --- a/tcg/mips/tcg-target-has.h +++ b/tcg/mips/tcg-target-has.h @@ -80,8 +80,6 @@ extern bool use_mips32r2_instructions; /* optional instructions detected at runtime */ #define TCG_TARGET_HAS_deposit_i32 use_mips32r2_instructions -#define TCG_TARGET_HAS_extract_i32 1 -#define TCG_TARGET_HAS_sextract_i32 1 #define TCG_TARGET_HAS_extract2_i32 0 #define TCG_TARGET_HAS_ext8s_i32 use_mips32r2_instructions #define TCG_TARGET_HAS_ext16s_i32 use_mips32r2_instructions @@ -96,8 +94,6 @@ extern bool use_mips32r2_instructions; #define TCG_TARGET_HAS_bswap32_i64 1 #define TCG_TARGET_HAS_bswap64_i64 1 #define TCG_TARGET_HAS_deposit_i64 use_mips32r2_instructions -#define TCG_TARGET_HAS_extract_i64 1 -#define TCG_TARGET_HAS_sextract_i64 1 #define TCG_TARGET_HAS_extract2_i64 0 #define TCG_TARGET_HAS_ext8s_i64 use_mips32r2_instructions #define TCG_TARGET_HAS_ext16s_i64 use_mips32r2_instructions diff --git a/tcg/ppc/tcg-target-has.h b/tcg/ppc/tcg-target-has.h index d087189a77..fa9275264c 100644 --- a/tcg/ppc/tcg-target-has.h +++ b/tcg/ppc/tcg-target-has.h @@ -38,8 +38,6 @@ #define TCG_TARGET_HAS_ctz_i32 have_isa_3_00 #define TCG_TARGET_HAS_ctpop_i32 have_isa_2_06 #define TCG_TARGET_HAS_deposit_i32 1 -#define TCG_TARGET_HAS_extract_i32 1 -#define TCG_TARGET_HAS_sextract_i32 1 #define TCG_TARGET_HAS_extract2_i32 0 #define TCG_TARGET_HAS_negsetcond_i32 1 #define TCG_TARGET_HAS_mulu2_i32 0 @@ -74,8 +72,6 @@ #define TCG_TARGET_HAS_ctz_i64 have_isa_3_00 #define TCG_TARGET_HAS_ctpop_i64 have_isa_2_06 #define TCG_TARGET_HAS_deposit_i64 1 -#define TCG_TARGET_HAS_extract_i64 1 -#define TCG_TARGET_HAS_sextract_i64 1 #define TCG_TARGET_HAS_extract2_i64 0 #define TCG_TARGET_HAS_negsetcond_i64 1 #define TCG_TARGET_HAS_add2_i64 1 diff --git a/tcg/riscv/tcg-target-has.h b/tcg/riscv/tcg-target-has.h index e890546c3a..5a39720ea9 100644 --- a/tcg/riscv/tcg-target-has.h +++ b/tcg/riscv/tcg-target-has.h @@ -16,8 +16,6 @@ #define TCG_TARGET_HAS_div2_i32 0 #define TCG_TARGET_HAS_rot_i32 (cpuinfo & CPUINFO_ZBB) #define TCG_TARGET_HAS_deposit_i32 0 -#define TCG_TARGET_HAS_extract_i32 1 -#define TCG_TARGET_HAS_sextract_i32 1 #define TCG_TARGET_HAS_extract2_i32 0 #define TCG_TARGET_HAS_add2_i32 1 #define TCG_TARGET_HAS_sub2_i32 1 @@ -50,8 +48,6 @@ #define TCG_TARGET_HAS_div2_i64 0 #define TCG_TARGET_HAS_rot_i64 (cpuinfo & CPUINFO_ZBB) #define TCG_TARGET_HAS_deposit_i64 0 -#define TCG_TARGET_HAS_extract_i64 1 -#define TCG_TARGET_HAS_sextract_i64 1 #define TCG_TARGET_HAS_extract2_i64 0 #define TCG_TARGET_HAS_extr_i64_i32 1 #define TCG_TARGET_HAS_ext8s_i64 1 diff --git a/tcg/s390x/tcg-target-has.h b/tcg/s390x/tcg-target-has.h index 72b57407d4..f3965c7df5 100644 --- a/tcg/s390x/tcg-target-has.h +++ b/tcg/s390x/tcg-target-has.h @@ -47,8 +47,6 @@ extern uint64_t s390_facilities[3]; #define TCG_TARGET_HAS_ctz_i32 0 #define TCG_TARGET_HAS_ctpop_i32 1 #define TCG_TARGET_HAS_deposit_i32 1 -#define TCG_TARGET_HAS_extract_i32 1 -#define TCG_TARGET_HAS_sextract_i32 1 #define TCG_TARGET_HAS_extract2_i32 0 #define TCG_TARGET_HAS_negsetcond_i32 1 #define TCG_TARGET_HAS_add2_i32 1 @@ -81,8 +79,6 @@ extern uint64_t s390_facilities[3]; #define TCG_TARGET_HAS_ctz_i64 0 #define TCG_TARGET_HAS_ctpop_i64 1 #define TCG_TARGET_HAS_deposit_i64 1 -#define TCG_TARGET_HAS_extract_i64 1 -#define TCG_TARGET_HAS_sextract_i64 1 #define TCG_TARGET_HAS_extract2_i64 0 #define TCG_TARGET_HAS_negsetcond_i64 1 #define TCG_TARGET_HAS_add2_i64 1 diff --git a/tcg/sparc64/tcg-target-has.h b/tcg/sparc64/tcg-target-has.h index d3ec569592..4a621313b7 100644 --- a/tcg/sparc64/tcg-target-has.h +++ b/tcg/sparc64/tcg-target-has.h @@ -33,8 +33,6 @@ extern bool use_vis3_instructions; #define TCG_TARGET_HAS_ctz_i32 0 #define TCG_TARGET_HAS_ctpop_i32 0 #define TCG_TARGET_HAS_deposit_i32 0 -#define TCG_TARGET_HAS_extract_i32 1 -#define TCG_TARGET_HAS_sextract_i32 1 #define TCG_TARGET_HAS_extract2_i32 0 #define TCG_TARGET_HAS_negsetcond_i32 1 #define TCG_TARGET_HAS_add2_i32 1 @@ -68,8 +66,6 @@ extern bool use_vis3_instructions; #define TCG_TARGET_HAS_ctz_i64 0 #define TCG_TARGET_HAS_ctpop_i64 0 #define TCG_TARGET_HAS_deposit_i64 0 -#define TCG_TARGET_HAS_extract_i64 1 -#define TCG_TARGET_HAS_sextract_i64 1 #define TCG_TARGET_HAS_extract2_i64 0 #define TCG_TARGET_HAS_negsetcond_i64 1 #define TCG_TARGET_HAS_add2_i64 1 diff --git a/tcg/tcg-has.h b/tcg/tcg-has.h index 8ed35be8c3..c93a98fb86 100644 --- a/tcg/tcg-has.h +++ b/tcg/tcg-has.h @@ -35,8 +35,6 @@ #define TCG_TARGET_HAS_ctz_i64 0 #define TCG_TARGET_HAS_ctpop_i64 0 #define TCG_TARGET_HAS_deposit_i64 0 -#define TCG_TARGET_HAS_extract_i64 0 -#define TCG_TARGET_HAS_sextract_i64 0 #define TCG_TARGET_HAS_extract2_i64 0 #define TCG_TARGET_HAS_negsetcond_i64 0 #define TCG_TARGET_HAS_add2_i64 0 @@ -56,16 +54,6 @@ #ifndef TCG_TARGET_deposit_i64_valid #define TCG_TARGET_deposit_i64_valid(ofs, len) 1 #endif -#ifndef TCG_TARGET_extract_valid -#define TCG_TARGET_extract_valid(type, ofs, len) \ - ((type) == TCG_TYPE_I32 ? TCG_TARGET_HAS_extract_i32 \ - : TCG_TARGET_HAS_extract_i64) -#endif -#ifndef TCG_TARGET_sextract_valid -#define TCG_TARGET_sextract_valid(type, ofs, len) \ - ((type) == TCG_TYPE_I32 ? TCG_TARGET_HAS_sextract_i32 \ - : TCG_TARGET_HAS_sextract_i64) -#endif /* Only one of DIV or DIV2 should be defined. */ #if defined(TCG_TARGET_HAS_div_i32) diff --git a/tcg/tci/tcg-target-has.h b/tcg/tci/tcg-target-has.h index 2f45ad614f..7a176b1fe5 100644 --- a/tcg/tci/tcg-target-has.h +++ b/tcg/tci/tcg-target-has.h @@ -17,8 +17,6 @@ #define TCG_TARGET_HAS_ext16u_i32 1 #define TCG_TARGET_HAS_andc_i32 1 #define TCG_TARGET_HAS_deposit_i32 1 -#define TCG_TARGET_HAS_extract_i32 1 -#define TCG_TARGET_HAS_sextract_i32 1 #define TCG_TARGET_HAS_extract2_i32 0 #define TCG_TARGET_HAS_eqv_i32 1 #define TCG_TARGET_HAS_nand_i32 1 @@ -41,8 +39,6 @@ #define TCG_TARGET_HAS_bswap32_i64 1 #define TCG_TARGET_HAS_bswap64_i64 1 #define TCG_TARGET_HAS_deposit_i64 1 -#define TCG_TARGET_HAS_extract_i64 1 -#define TCG_TARGET_HAS_sextract_i64 1 #define TCG_TARGET_HAS_extract2_i64 0 #define TCG_TARGET_HAS_div_i64 1 #define TCG_TARGET_HAS_rem_i64 1 diff --git a/tcg/optimize.c b/tcg/optimize.c index cd8ad712c4..8c6303e3af 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2363,10 +2363,10 @@ static void fold_setcond_tst_pow2(OptContext *ctx, TCGOp *op, bool neg) shr_opc = INDEX_op_shr_i32; neg_opc = INDEX_op_neg_i32; if (TCG_TARGET_extract_valid(TCG_TYPE_I32, sh, 1)) { - uext_opc = TCG_TARGET_HAS_extract_i32 ? INDEX_op_extract_i32 : 0; + uext_opc = INDEX_op_extract_i32; } if (TCG_TARGET_sextract_valid(TCG_TYPE_I32, sh, 1)) { - sext_opc = TCG_TARGET_HAS_sextract_i32 ? INDEX_op_sextract_i32 : 0; + sext_opc = INDEX_op_sextract_i32; } break; case TCG_TYPE_I64: @@ -2376,10 +2376,10 @@ static void fold_setcond_tst_pow2(OptContext *ctx, TCGOp *op, bool neg) shr_opc = INDEX_op_shr_i64; neg_opc = INDEX_op_neg_i64; if (TCG_TARGET_extract_valid(TCG_TYPE_I64, sh, 1)) { - uext_opc = TCG_TARGET_HAS_extract_i64 ? INDEX_op_extract_i64 : 0; + uext_opc = INDEX_op_extract_i64; } if (TCG_TARGET_sextract_valid(TCG_TYPE_I64, sh, 1)) { - sext_opc = TCG_TARGET_HAS_sextract_i64 ? INDEX_op_sextract_i64 : 0; + sext_opc = INDEX_op_sextract_i64; } break; default: diff --git a/tcg/tcg.c b/tcg/tcg.c index 9b54a8bec8..c584ca034f 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -2195,6 +2195,8 @@ bool tcg_op_supported(TCGOpcode op, TCGType type, unsigned flags) case INDEX_op_shl_i32: case INDEX_op_shr_i32: case INDEX_op_sar_i32: + case INDEX_op_extract_i32: + case INDEX_op_sextract_i32: return true; case INDEX_op_negsetcond_i32: @@ -2213,10 +2215,6 @@ bool tcg_op_supported(TCGOpcode op, TCGType type, unsigned flags) return TCG_TARGET_HAS_rot_i32; case INDEX_op_deposit_i32: return TCG_TARGET_HAS_deposit_i32; - case INDEX_op_extract_i32: - return TCG_TARGET_HAS_extract_i32; - case INDEX_op_sextract_i32: - return TCG_TARGET_HAS_sextract_i32; case INDEX_op_extract2_i32: return TCG_TARGET_HAS_extract2_i32; case INDEX_op_add2_i32: @@ -2293,6 +2291,8 @@ bool tcg_op_supported(TCGOpcode op, TCGType type, unsigned flags) case INDEX_op_sar_i64: case INDEX_op_ext_i32_i64: case INDEX_op_extu_i32_i64: + case INDEX_op_extract_i64: + case INDEX_op_sextract_i64: return TCG_TARGET_REG_BITS == 64; case INDEX_op_negsetcond_i64: @@ -2311,10 +2311,6 @@ bool tcg_op_supported(TCGOpcode op, TCGType type, unsigned flags) return TCG_TARGET_HAS_rot_i64; case INDEX_op_deposit_i64: return TCG_TARGET_HAS_deposit_i64; - case INDEX_op_extract_i64: - return TCG_TARGET_HAS_extract_i64; - case INDEX_op_sextract_i64: - return TCG_TARGET_HAS_sextract_i64; case INDEX_op_extract2_i64: return TCG_TARGET_HAS_extract2_i64; case INDEX_op_extrl_i64_i32: diff --git a/tcg/tci.c b/tcg/tci.c index 39a68db287..30d912d75d 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -657,18 +657,14 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, regs[r0] = deposit32(regs[r1], pos, len, regs[r2]); break; #endif -#if TCG_TARGET_HAS_extract_i32 case INDEX_op_extract_i32: tci_args_rrbb(insn, &r0, &r1, &pos, &len); regs[r0] = extract32(regs[r1], pos, len); break; -#endif -#if TCG_TARGET_HAS_sextract_i32 case INDEX_op_sextract_i32: tci_args_rrbb(insn, &r0, &r1, &pos, &len); regs[r0] = sextract32(regs[r1], pos, len); break; -#endif case INDEX_op_brcond_i32: tci_args_rl(insn, tb_ptr, &r0, &ptr); if ((uint32_t)regs[r0]) { @@ -868,18 +864,14 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, regs[r0] = deposit64(regs[r1], pos, len, regs[r2]); break; #endif -#if TCG_TARGET_HAS_extract_i64 case INDEX_op_extract_i64: tci_args_rrbb(insn, &r0, &r1, &pos, &len); regs[r0] = extract64(regs[r1], pos, len); break; -#endif -#if TCG_TARGET_HAS_sextract_i64 case INDEX_op_sextract_i64: tci_args_rrbb(insn, &r0, &r1, &pos, &len); regs[r0] = sextract64(regs[r1], pos, len); break; -#endif case INDEX_op_brcond_i64: tci_args_rl(insn, tb_ptr, &r0, &ptr); if (regs[r0]) { From patchwork Fri Jan 17 18:24:50 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858234 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp843299wrb; Fri, 17 Jan 2025 10:29:47 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCV3fZztrmQaK2ocmQyfO238AcSx4JcB43sYxC8i/eIknQopBRBAwBxmmgUX4ZevumI6dK+ohQ==@linaro.org X-Google-Smtp-Source: AGHT+IF1/al9FhLUZiwI1MdCsvm6Dx4Xha1trQOkQxZVjOUOnzsEw99Th9kTczmgJO6Bf2D8WoXq X-Received: by 2002:a05:620a:4410:b0:7be:3d06:9a02 with SMTP id af79cd13be357-7be6323cc33mr530502985a.28.1737138587225; Fri, 17 Jan 2025 10:29:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138587; cv=none; d=google.com; s=arc-20240605; b=UO1HtO9MWvZ6w8ommKqYeUFX4B1ca969eCrd4CZuPsWTnTTMwWrdi3c3dxhVltwHhk s1aGQGkuyaeDHBlJEN3j8El/+BnfpdlzbJL7IdNAvpILi39S7TbL8hxBuNiaLJYNCLME 7EBz4hxjDD6EF/2itVoqRDdNDQ7CoYSndadPhQDj+CFfJFiA2R8HSyK6yMPdO3L4TBXD UXJTlJ0SmSz9oIjtp9IvIyfbZE1t3AJynz4XqNPxcOoFWqz47qQNi0xxKdJf1PpxdVco v88USrjBGTU75PtfP/lQt1D041NtbVITt1VbiT+41kiB344FBM+Tp+25Dkeo1fQfhUqD CprA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=TVPleuy3Xsse7THT0N581o16Rcnrx3xvtx6X2aKOq/I=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=QxfHCuezeZYCjKcXPTJTxkqH8VBFARWH+NaDtb8AkNzmI5rqdlecFc5JuD3fnNF/Pn esEw+RlBzppbCzc9ebLlmo5kFQRtuW0uA14hA3UlRMKtMTjDSJgcmCOV9WbUo+j0fKN4 vNByZ4dNU2SX6d4ubkXYHJcwEJaXpisBw0zFt/CF3ZP0SjKOPnSxg0n+fyqzmW3j8Mq7 7JSs0fReswo1kkZWU6yxlPWl/lhdlBOWFAcR1AhosQ9Z3C4fnJ7BnaKynNA3pGQwAfMt pZsKoQbioIYiod9WjvnGlfckFk3Vo/sdKn+CZrgpqGmLwBg6imo3PlmgSWtMDkm8bjS8 zF9w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=z4mq+VYG; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7be614bfd6esi359011185a.299.2025.01.17.10.29.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:29:47 -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=z4mq+VYG; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr69-0007sZ-LJ; Fri, 17 Jan 2025 13:29:37 -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 1tYr5s-0006m0-5z for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:29:20 -0500 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr5k-0000Jm-B2 for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:29:19 -0500 Received: by mail-pj1-x1036.google.com with SMTP id 98e67ed59e1d1-2ee46851b5eso3432125a91.1 for ; Fri, 17 Jan 2025 10:29:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138551; x=1737743351; 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=TVPleuy3Xsse7THT0N581o16Rcnrx3xvtx6X2aKOq/I=; b=z4mq+VYGdKuQcbfEe2m27gRMZO3HO2hBHEshozy20tzFzMPeER9AGWbLle6t+fgQvw e7gfS0HY/G4sXQ1k4rcojlOoKtuRP/hS+VuBfQLZYBnFO7zq5N6MMp5pWVSuMxLEiQqf uyh4KFIr5hUiBH2hnY2MZ7EJdyMMJ8V3P8RVtVDWecPs9q55GVrCwwv44a/rV7+PNRp2 8TJd/EAybCBahCPEthajLW11t/a7VugRa+DSz1oyOfMdKLM61HQ82eoyxpGsVWX1E3nG FV62ZcwdyKBNrIZSxH0lMv8bbyFrv8XxLi4cUbJSIu6jVt6uADk3uKTCkUSB+PkQa3// YIPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138551; x=1737743351; 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=TVPleuy3Xsse7THT0N581o16Rcnrx3xvtx6X2aKOq/I=; b=ajn8gWny7auw62K86y0Ni4ghpSM2DhDkg8bWFh1+LRg5IyvOudNrqC4IkoIfVa5ToH HvyMdnXcTQmOwyTO2j5fTAfLjU+mxaUhSuDHEiiM/SbmNWOECzVrjsmNzjt0aij90WZb VwrRk53YUeSsp+Qtv1ZIxUCKcXHzYsG3soOeWSehZmxOW6ZhSXozRMkK3snc1UwaHPyx Mqpg9gTrmzoQegoC1IM34uxLoLS//MtymRBMvkBhzr1ZilXxZm9Qd0gYhckMY1tmPU0/ jWnVC0rWfAFuvwxXVaLje/IgZHD4YebkzZ9hU8y1VIUdYjkspHodF7QhWrKKp/v+bD75 yqtg== X-Gm-Message-State: AOJu0YwL1NKK2dk3Y71DtDZCvOwCnAScAWyrCG9MvOjncKo1W2GGQ3PP hwA9GChQwLnCdpW89YhPDaFabN2u8tHctYoW6ompnvZWvsjxn2LyOgS2xn7R5G8PbPrUp2JEVC7 6 X-Gm-Gg: ASbGncsJA6Bun4LCcj1LhE0KbG7F8XFtIzE1/RMkYlbmggesAPovqqxZGprKVvSKOq1 EHMcRCTayLt8pQbXQasjp1nPs4jtcgdQF1ruZjpynvHe8hrZxb/7dbXSVnWKA9JsZ7LrwamXqdC +c4hqzmHiojjOF6puHVy/XenezNYVVnxOLJBFPFhilvs/oIg2z6nsZklITsTSFyoU+WF/10KU4F /JlZB5+H537Ve3DKHisN1gOkg88ID5oAZFah1kfXMlM7kbE404RBjQv8v/CZDFaoKIVFp/a/6KT CdFjqaZKbNU66Ag= X-Received: by 2002:a17:90b:2b87:b0:2ee:a127:ba96 with SMTP id 98e67ed59e1d1-2f782d36030mr4315540a91.23.1737138550680; Fri, 17 Jan 2025 10:29:10 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f77629bf96sm2614105a91.36.2025.01.17.10.29.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:29:10 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 62/68] tcg: Remove TCG_TARGET_HAS_deposit_{i32,i64} Date: Fri, 17 Jan 2025 10:24:50 -0800 Message-ID: <20250117182456.2077110-63-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1036; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1036.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 Make deposit "unconditional" in the sense that the opcode is always present. Rely instead on TCG_TARGET_deposit_valid, now always defined. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/aarch64/tcg-target-has.h | 3 +-- tcg/arm/tcg-target-has.h | 2 +- tcg/i386/tcg-target-has.h | 5 +---- tcg/loongarch64/tcg-target-has.h | 3 +-- tcg/mips/tcg-target-has.h | 3 +-- tcg/ppc/tcg-target-has.h | 3 +-- tcg/riscv/tcg-target-has.h | 4 ++-- tcg/s390x/tcg-target-has.h | 3 +-- tcg/sparc64/tcg-target-has.h | 4 ++-- tcg/tcg-has.h | 8 -------- tcg/tci/tcg-target-has.h | 3 +-- tcg/tcg-op.c | 22 +++++++++++----------- tcg/tcg.c | 31 +++++++++++-------------------- tcg/tci.c | 4 ---- tcg/tci/tcg-target.c.inc | 2 +- 15 files changed, 35 insertions(+), 65 deletions(-) diff --git a/tcg/aarch64/tcg-target-has.h b/tcg/aarch64/tcg-target-has.h index 43eaa2287c..39f01c14cd 100644 --- a/tcg/aarch64/tcg-target-has.h +++ b/tcg/aarch64/tcg-target-has.h @@ -31,7 +31,6 @@ #define TCG_TARGET_HAS_clz_i32 1 #define TCG_TARGET_HAS_ctz_i32 1 #define TCG_TARGET_HAS_ctpop_i32 0 -#define TCG_TARGET_HAS_deposit_i32 1 #define TCG_TARGET_HAS_extract2_i32 1 #define TCG_TARGET_HAS_negsetcond_i32 1 #define TCG_TARGET_HAS_add2_i32 1 @@ -64,7 +63,6 @@ #define TCG_TARGET_HAS_clz_i64 1 #define TCG_TARGET_HAS_ctz_i64 1 #define TCG_TARGET_HAS_ctpop_i64 0 -#define TCG_TARGET_HAS_deposit_i64 1 #define TCG_TARGET_HAS_extract2_i64 1 #define TCG_TARGET_HAS_negsetcond_i64 1 #define TCG_TARGET_HAS_add2_i64 1 @@ -114,5 +112,6 @@ #define TCG_TARGET_extract_valid(type, ofs, len) 1 #define TCG_TARGET_sextract_valid(type, ofs, len) 1 +#define TCG_TARGET_deposit_valid(type, ofs, len) 1 #endif diff --git a/tcg/arm/tcg-target-has.h b/tcg/arm/tcg-target-has.h index 7152dd6f5e..e3510a8f7a 100644 --- a/tcg/arm/tcg-target-has.h +++ b/tcg/arm/tcg-target-has.h @@ -40,7 +40,6 @@ extern bool use_neon_instructions; #define TCG_TARGET_HAS_clz_i32 1 #define TCG_TARGET_HAS_ctz_i32 use_armv7_instructions #define TCG_TARGET_HAS_ctpop_i32 0 -#define TCG_TARGET_HAS_deposit_i32 use_armv7_instructions #define TCG_TARGET_HAS_extract2_i32 1 #define TCG_TARGET_HAS_negsetcond_i32 1 #define TCG_TARGET_HAS_mulu2_i32 1 @@ -96,5 +95,6 @@ tcg_target_extract_valid(TCGType type, unsigned ofs, unsigned len) #define TCG_TARGET_extract_valid tcg_target_extract_valid #define TCG_TARGET_sextract_valid tcg_target_extract_valid +#define TCG_TARGET_deposit_valid(type, ofs, len) use_armv7_instructions #endif diff --git a/tcg/i386/tcg-target-has.h b/tcg/i386/tcg-target-has.h index 833ccc411a..63768ff058 100644 --- a/tcg/i386/tcg-target-has.h +++ b/tcg/i386/tcg-target-has.h @@ -43,7 +43,6 @@ #define TCG_TARGET_HAS_clz_i32 1 #define TCG_TARGET_HAS_ctz_i32 1 #define TCG_TARGET_HAS_ctpop_i32 have_popcnt -#define TCG_TARGET_HAS_deposit_i32 1 #define TCG_TARGET_HAS_extract2_i32 1 #define TCG_TARGET_HAS_negsetcond_i32 1 #define TCG_TARGET_HAS_add2_i32 1 @@ -76,7 +75,6 @@ #define TCG_TARGET_HAS_clz_i64 1 #define TCG_TARGET_HAS_ctz_i64 1 #define TCG_TARGET_HAS_ctpop_i64 have_popcnt -#define TCG_TARGET_HAS_deposit_i64 1 #define TCG_TARGET_HAS_extract2_i64 1 #define TCG_TARGET_HAS_negsetcond_i64 1 #define TCG_TARGET_HAS_add2_i64 1 @@ -121,10 +119,9 @@ #define TCG_TARGET_HAS_cmpsel_vec 1 #define TCG_TARGET_HAS_tst_vec have_avx512bw -#define TCG_TARGET_deposit_i32_valid(ofs, len) \ +#define TCG_TARGET_deposit_valid(type, ofs, len) \ (((ofs) == 0 && ((len) == 8 || (len) == 16)) || \ (TCG_TARGET_REG_BITS == 32 && (ofs) == 8 && (len) == 8)) -#define TCG_TARGET_deposit_i64_valid TCG_TARGET_deposit_i32_valid /* * Check for the possibility of low byte/word extraction, high-byte extraction diff --git a/tcg/loongarch64/tcg-target-has.h b/tcg/loongarch64/tcg-target-has.h index a15ab9cc28..ac88522eef 100644 --- a/tcg/loongarch64/tcg-target-has.h +++ b/tcg/loongarch64/tcg-target-has.h @@ -15,7 +15,6 @@ #define TCG_TARGET_HAS_rem_i32 1 #define TCG_TARGET_HAS_div2_i32 0 #define TCG_TARGET_HAS_rot_i32 1 -#define TCG_TARGET_HAS_deposit_i32 1 #define TCG_TARGET_HAS_extract2_i32 0 #define TCG_TARGET_HAS_add2_i32 0 #define TCG_TARGET_HAS_sub2_i32 0 @@ -48,7 +47,6 @@ #define TCG_TARGET_HAS_rem_i64 1 #define TCG_TARGET_HAS_div2_i64 0 #define TCG_TARGET_HAS_rot_i64 1 -#define TCG_TARGET_HAS_deposit_i64 1 #define TCG_TARGET_HAS_extract2_i64 0 #define TCG_TARGET_HAS_extr_i64_i32 1 #define TCG_TARGET_HAS_ext8s_i64 1 @@ -106,6 +104,7 @@ #define TCG_TARGET_HAS_tst_vec 0 #define TCG_TARGET_extract_valid(type, ofs, len) 1 +#define TCG_TARGET_deposit_valid(type, ofs, len) 1 static inline bool tcg_target_sextract_valid(TCGType type, unsigned ofs, unsigned len) diff --git a/tcg/mips/tcg-target-has.h b/tcg/mips/tcg-target-has.h index 1bc14f65dd..df6960fe9a 100644 --- a/tcg/mips/tcg-target-has.h +++ b/tcg/mips/tcg-target-has.h @@ -79,7 +79,6 @@ extern bool use_mips32r2_instructions; #endif /* optional instructions detected at runtime */ -#define TCG_TARGET_HAS_deposit_i32 use_mips32r2_instructions #define TCG_TARGET_HAS_extract2_i32 0 #define TCG_TARGET_HAS_ext8s_i32 use_mips32r2_instructions #define TCG_TARGET_HAS_ext16s_i32 use_mips32r2_instructions @@ -93,7 +92,6 @@ extern bool use_mips32r2_instructions; #define TCG_TARGET_HAS_bswap16_i64 1 #define TCG_TARGET_HAS_bswap32_i64 1 #define TCG_TARGET_HAS_bswap64_i64 1 -#define TCG_TARGET_HAS_deposit_i64 use_mips32r2_instructions #define TCG_TARGET_HAS_extract2_i64 0 #define TCG_TARGET_HAS_ext8s_i64 use_mips32r2_instructions #define TCG_TARGET_HAS_ext16s_i64 use_mips32r2_instructions @@ -116,6 +114,7 @@ extern bool use_mips32r2_instructions; #define TCG_TARGET_HAS_tst 0 #define TCG_TARGET_extract_valid(type, ofs, len) use_mips32r2_instructions +#define TCG_TARGET_deposit_valid(type, ofs, len) use_mips32r2_instructions static inline bool tcg_target_sextract_valid(TCGType type, unsigned ofs, unsigned len) diff --git a/tcg/ppc/tcg-target-has.h b/tcg/ppc/tcg-target-has.h index fa9275264c..6db91f78ce 100644 --- a/tcg/ppc/tcg-target-has.h +++ b/tcg/ppc/tcg-target-has.h @@ -37,7 +37,6 @@ #define TCG_TARGET_HAS_clz_i32 1 #define TCG_TARGET_HAS_ctz_i32 have_isa_3_00 #define TCG_TARGET_HAS_ctpop_i32 have_isa_2_06 -#define TCG_TARGET_HAS_deposit_i32 1 #define TCG_TARGET_HAS_extract2_i32 0 #define TCG_TARGET_HAS_negsetcond_i32 1 #define TCG_TARGET_HAS_mulu2_i32 0 @@ -71,7 +70,6 @@ #define TCG_TARGET_HAS_clz_i64 1 #define TCG_TARGET_HAS_ctz_i64 have_isa_3_00 #define TCG_TARGET_HAS_ctpop_i64 have_isa_2_06 -#define TCG_TARGET_HAS_deposit_i64 1 #define TCG_TARGET_HAS_extract2_i64 0 #define TCG_TARGET_HAS_negsetcond_i64 1 #define TCG_TARGET_HAS_add2_i64 1 @@ -118,6 +116,7 @@ #define TCG_TARGET_HAS_tst_vec 0 #define TCG_TARGET_extract_valid(type, ofs, len) 1 +#define TCG_TARGET_deposit_valid(type, ofs, len) 1 static inline bool tcg_target_sextract_valid(TCGType type, unsigned ofs, unsigned len) diff --git a/tcg/riscv/tcg-target-has.h b/tcg/riscv/tcg-target-has.h index 5a39720ea9..0f9cc04f8c 100644 --- a/tcg/riscv/tcg-target-has.h +++ b/tcg/riscv/tcg-target-has.h @@ -15,7 +15,6 @@ #define TCG_TARGET_HAS_rem_i32 1 #define TCG_TARGET_HAS_div2_i32 0 #define TCG_TARGET_HAS_rot_i32 (cpuinfo & CPUINFO_ZBB) -#define TCG_TARGET_HAS_deposit_i32 0 #define TCG_TARGET_HAS_extract2_i32 0 #define TCG_TARGET_HAS_add2_i32 1 #define TCG_TARGET_HAS_sub2_i32 1 @@ -47,7 +46,6 @@ #define TCG_TARGET_HAS_rem_i64 1 #define TCG_TARGET_HAS_div2_i64 0 #define TCG_TARGET_HAS_rot_i64 (cpuinfo & CPUINFO_ZBB) -#define TCG_TARGET_HAS_deposit_i64 0 #define TCG_TARGET_HAS_extract2_i64 0 #define TCG_TARGET_HAS_extr_i64_i32 1 #define TCG_TARGET_HAS_ext8s_i64 1 @@ -126,4 +124,6 @@ tcg_target_sextract_valid(TCGType type, unsigned ofs, unsigned len) } #define TCG_TARGET_sextract_valid tcg_target_sextract_valid +#define TCG_TARGET_deposit_valid(type, ofs, len) 0 + #endif diff --git a/tcg/s390x/tcg-target-has.h b/tcg/s390x/tcg-target-has.h index f3965c7df5..e99e671642 100644 --- a/tcg/s390x/tcg-target-has.h +++ b/tcg/s390x/tcg-target-has.h @@ -46,7 +46,6 @@ extern uint64_t s390_facilities[3]; #define TCG_TARGET_HAS_clz_i32 0 #define TCG_TARGET_HAS_ctz_i32 0 #define TCG_TARGET_HAS_ctpop_i32 1 -#define TCG_TARGET_HAS_deposit_i32 1 #define TCG_TARGET_HAS_extract2_i32 0 #define TCG_TARGET_HAS_negsetcond_i32 1 #define TCG_TARGET_HAS_add2_i32 1 @@ -78,7 +77,6 @@ extern uint64_t s390_facilities[3]; #define TCG_TARGET_HAS_clz_i64 1 #define TCG_TARGET_HAS_ctz_i64 0 #define TCG_TARGET_HAS_ctpop_i64 1 -#define TCG_TARGET_HAS_deposit_i64 1 #define TCG_TARGET_HAS_extract2_i64 0 #define TCG_TARGET_HAS_negsetcond_i64 1 #define TCG_TARGET_HAS_add2_i64 1 @@ -118,6 +116,7 @@ extern uint64_t s390_facilities[3]; #define TCG_TARGET_HAS_tst_vec 0 #define TCG_TARGET_extract_valid(type, ofs, len) 1 +#define TCG_TARGET_deposit_valid(type, ofs, len) 1 static inline bool tcg_target_sextract_valid(TCGType type, unsigned ofs, unsigned len) diff --git a/tcg/sparc64/tcg-target-has.h b/tcg/sparc64/tcg-target-has.h index 4a621313b7..2f46df8c61 100644 --- a/tcg/sparc64/tcg-target-has.h +++ b/tcg/sparc64/tcg-target-has.h @@ -32,7 +32,6 @@ extern bool use_vis3_instructions; #define TCG_TARGET_HAS_clz_i32 0 #define TCG_TARGET_HAS_ctz_i32 0 #define TCG_TARGET_HAS_ctpop_i32 0 -#define TCG_TARGET_HAS_deposit_i32 0 #define TCG_TARGET_HAS_extract2_i32 0 #define TCG_TARGET_HAS_negsetcond_i32 1 #define TCG_TARGET_HAS_add2_i32 1 @@ -65,7 +64,6 @@ extern bool use_vis3_instructions; #define TCG_TARGET_HAS_clz_i64 0 #define TCG_TARGET_HAS_ctz_i64 0 #define TCG_TARGET_HAS_ctpop_i64 0 -#define TCG_TARGET_HAS_deposit_i64 0 #define TCG_TARGET_HAS_extract2_i64 0 #define TCG_TARGET_HAS_negsetcond_i64 1 #define TCG_TARGET_HAS_add2_i64 1 @@ -84,4 +82,6 @@ extern bool use_vis3_instructions; #define TCG_TARGET_sextract_valid TCG_TARGET_extract_valid +#define TCG_TARGET_deposit_valid(type, ofs, len) 0 + #endif diff --git a/tcg/tcg-has.h b/tcg/tcg-has.h index c93a98fb86..418e4673eb 100644 --- a/tcg/tcg-has.h +++ b/tcg/tcg-has.h @@ -34,7 +34,6 @@ #define TCG_TARGET_HAS_clz_i64 0 #define TCG_TARGET_HAS_ctz_i64 0 #define TCG_TARGET_HAS_ctpop_i64 0 -#define TCG_TARGET_HAS_deposit_i64 0 #define TCG_TARGET_HAS_extract2_i64 0 #define TCG_TARGET_HAS_negsetcond_i64 0 #define TCG_TARGET_HAS_add2_i64 0 @@ -48,13 +47,6 @@ #define TCG_TARGET_HAS_sub2_i32 1 #endif -#ifndef TCG_TARGET_deposit_i32_valid -#define TCG_TARGET_deposit_i32_valid(ofs, len) 1 -#endif -#ifndef TCG_TARGET_deposit_i64_valid -#define TCG_TARGET_deposit_i64_valid(ofs, len) 1 -#endif - /* Only one of DIV or DIV2 should be defined. */ #if defined(TCG_TARGET_HAS_div_i32) #define TCG_TARGET_HAS_div2_i32 0 diff --git a/tcg/tci/tcg-target-has.h b/tcg/tci/tcg-target-has.h index 7a176b1fe5..c8785ca8dc 100644 --- a/tcg/tci/tcg-target-has.h +++ b/tcg/tci/tcg-target-has.h @@ -16,7 +16,6 @@ #define TCG_TARGET_HAS_ext8u_i32 1 #define TCG_TARGET_HAS_ext16u_i32 1 #define TCG_TARGET_HAS_andc_i32 1 -#define TCG_TARGET_HAS_deposit_i32 1 #define TCG_TARGET_HAS_extract2_i32 0 #define TCG_TARGET_HAS_eqv_i32 1 #define TCG_TARGET_HAS_nand_i32 1 @@ -38,7 +37,6 @@ #define TCG_TARGET_HAS_bswap16_i64 1 #define TCG_TARGET_HAS_bswap32_i64 1 #define TCG_TARGET_HAS_bswap64_i64 1 -#define TCG_TARGET_HAS_deposit_i64 1 #define TCG_TARGET_HAS_extract2_i64 0 #define TCG_TARGET_HAS_div_i64 1 #define TCG_TARGET_HAS_rem_i64 1 @@ -78,5 +76,6 @@ #define TCG_TARGET_extract_valid(type, ofs, len) 1 #define TCG_TARGET_sextract_valid(type, ofs, len) 1 +#define TCG_TARGET_deposit_valid(type, ofs, len) 1 #endif diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c index d813a7f44e..fec6d678a2 100644 --- a/tcg/tcg-op.c +++ b/tcg/tcg-op.c @@ -906,7 +906,7 @@ void tcg_gen_deposit_i32(TCGv_i32 ret, TCGv_i32 arg1, TCGv_i32 arg2, tcg_gen_mov_i32(ret, arg2); return; } - if (TCG_TARGET_HAS_deposit_i32 && TCG_TARGET_deposit_i32_valid(ofs, len)) { + if (TCG_TARGET_deposit_valid(TCG_TYPE_I32, ofs, len)) { tcg_gen_op5ii_i32(INDEX_op_deposit_i32, ret, arg1, arg2, ofs, len); return; } @@ -951,8 +951,7 @@ void tcg_gen_deposit_z_i32(TCGv_i32 ret, TCGv_i32 arg, tcg_gen_shli_i32(ret, arg, ofs); } else if (ofs == 0) { tcg_gen_andi_i32(ret, arg, (1u << len) - 1); - } else if (TCG_TARGET_HAS_deposit_i32 - && TCG_TARGET_deposit_i32_valid(ofs, len)) { + } else if (TCG_TARGET_deposit_valid(TCG_TYPE_I32, ofs, len)) { TCGv_i32 zero = tcg_constant_i32(0); tcg_gen_op5ii_i32(INDEX_op_deposit_i32, ret, zero, arg, ofs, len); } else { @@ -2642,12 +2641,13 @@ void tcg_gen_deposit_i64(TCGv_i64 ret, TCGv_i64 arg1, TCGv_i64 arg2, tcg_gen_mov_i64(ret, arg2); return; } - if (TCG_TARGET_HAS_deposit_i64 && TCG_TARGET_deposit_i64_valid(ofs, len)) { - tcg_gen_op5ii_i64(INDEX_op_deposit_i64, ret, arg1, arg2, ofs, len); - return; - } - if (TCG_TARGET_REG_BITS == 32) { + if (TCG_TARGET_REG_BITS == 64) { + if (TCG_TARGET_deposit_valid(TCG_TYPE_I64, ofs, len)) { + tcg_gen_op5ii_i64(INDEX_op_deposit_i64, ret, arg1, arg2, ofs, len); + return; + } + } else { if (ofs >= 32) { tcg_gen_deposit_i32(TCGV_HIGH(ret), TCGV_HIGH(arg1), TCGV_LOW(arg2), ofs - 32, len); @@ -2702,8 +2702,8 @@ void tcg_gen_deposit_z_i64(TCGv_i64 ret, TCGv_i64 arg, tcg_gen_shli_i64(ret, arg, ofs); } else if (ofs == 0) { tcg_gen_andi_i64(ret, arg, (1ull << len) - 1); - } else if (TCG_TARGET_HAS_deposit_i64 - && TCG_TARGET_deposit_i64_valid(ofs, len)) { + } else if (TCG_TARGET_REG_BITS == 64 && + TCG_TARGET_deposit_valid(TCG_TYPE_I64, ofs, len)) { TCGv_i64 zero = tcg_constant_i64(0); tcg_gen_op5ii_i64(INDEX_op_deposit_i64, ret, zero, arg, ofs, len); } else { @@ -3226,7 +3226,7 @@ void tcg_gen_concat_i32_i64(TCGv_i64 dest, TCGv_i32 low, TCGv_i32 high) tcg_gen_extu_i32_i64(dest, low); /* If deposit is available, use it. Otherwise use the extra knowledge that we have of the zero-extensions above. */ - if (TCG_TARGET_HAS_deposit_i64 && TCG_TARGET_deposit_i64_valid(32, 32)) { + if (TCG_TARGET_deposit_valid(TCG_TYPE_I64, 32, 32)) { tcg_gen_deposit_i64(dest, dest, tmp, 32, 32); } else { tcg_gen_shli_i64(tmp, tmp, 32); diff --git a/tcg/tcg.c b/tcg/tcg.c index c584ca034f..43b6712286 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -2197,6 +2197,7 @@ bool tcg_op_supported(TCGOpcode op, TCGType type, unsigned flags) case INDEX_op_sar_i32: case INDEX_op_extract_i32: case INDEX_op_sextract_i32: + case INDEX_op_deposit_i32: return true; case INDEX_op_negsetcond_i32: @@ -2213,8 +2214,6 @@ bool tcg_op_supported(TCGOpcode op, TCGType type, unsigned flags) case INDEX_op_rotl_i32: case INDEX_op_rotr_i32: return TCG_TARGET_HAS_rot_i32; - case INDEX_op_deposit_i32: - return TCG_TARGET_HAS_deposit_i32; case INDEX_op_extract2_i32: return TCG_TARGET_HAS_extract2_i32; case INDEX_op_add2_i32: @@ -2293,6 +2292,7 @@ bool tcg_op_supported(TCGOpcode op, TCGType type, unsigned flags) case INDEX_op_extu_i32_i64: case INDEX_op_extract_i64: case INDEX_op_sextract_i64: + case INDEX_op_deposit_i64: return TCG_TARGET_REG_BITS == 64; case INDEX_op_negsetcond_i64: @@ -2309,8 +2309,6 @@ bool tcg_op_supported(TCGOpcode op, TCGType type, unsigned flags) case INDEX_op_rotl_i64: case INDEX_op_rotr_i64: return TCG_TARGET_HAS_rot_i64; - case INDEX_op_deposit_i64: - return TCG_TARGET_HAS_deposit_i64; case INDEX_op_extract2_i64: return TCG_TARGET_HAS_extract2_i64; case INDEX_op_extrl_i64_i32: @@ -2439,23 +2437,16 @@ bool tcg_op_supported(TCGOpcode op, TCGType type, unsigned flags) bool tcg_op_deposit_valid(TCGType type, unsigned ofs, unsigned len) { + unsigned width; + + tcg_debug_assert(type == TCG_TYPE_I32 || type == TCG_TYPE_I64); + width = (type == TCG_TYPE_I32 ? 32 : 64); + + tcg_debug_assert(ofs < width); tcg_debug_assert(len > 0); - switch (type) { - case TCG_TYPE_I32: - tcg_debug_assert(ofs < 32); - tcg_debug_assert(len <= 32); - tcg_debug_assert(ofs + len <= 32); - return TCG_TARGET_HAS_deposit_i32 && - TCG_TARGET_deposit_i32_valid(ofs, len); - case TCG_TYPE_I64: - tcg_debug_assert(ofs < 64); - tcg_debug_assert(len <= 64); - tcg_debug_assert(ofs + len <= 64); - return TCG_TARGET_HAS_deposit_i64 && - TCG_TARGET_deposit_i64_valid(ofs, len); - default: - g_assert_not_reached(); - } + tcg_debug_assert(len <= width - ofs); + + return TCG_TARGET_deposit_valid(type, ofs, len); } static TCGOp *tcg_op_alloc(TCGOpcode opc, unsigned nargs); diff --git a/tcg/tci.c b/tcg/tci.c index 30d912d75d..8c1c53424d 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -651,12 +651,10 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, regs[r0] = ror32(regs[r1], regs[r2] & 31); break; #endif -#if TCG_TARGET_HAS_deposit_i32 case INDEX_op_deposit_i32: tci_args_rrrbb(insn, &r0, &r1, &r2, &pos, &len); regs[r0] = deposit32(regs[r1], pos, len, regs[r2]); break; -#endif case INDEX_op_extract_i32: tci_args_rrbb(insn, &r0, &r1, &pos, &len); regs[r0] = extract32(regs[r1], pos, len); @@ -858,12 +856,10 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, regs[r0] = ror64(regs[r1], regs[r2] & 63); break; #endif -#if TCG_TARGET_HAS_deposit_i64 case INDEX_op_deposit_i64: tci_args_rrrbb(insn, &r0, &r1, &r2, &pos, &len); regs[r0] = deposit64(regs[r1], pos, len, regs[r2]); break; -#endif case INDEX_op_extract_i64: tci_args_rrbb(insn, &r0, &r1, &pos, &len); regs[r0] = extract64(regs[r1], pos, len); diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index 8dedddce5f..d6c77325a3 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -774,7 +774,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType type, tcg_out_op_rrr(s, opc, args[0], args[1], args[2]); break; - CASE_32_64(deposit) /* Optional (TCG_TARGET_HAS_deposit_*). */ + CASE_32_64(deposit) tcg_out_op_rrrbb(s, opc, args[0], args[1], args[2], args[3], args[4]); break; From patchwork Fri Jan 17 18:24:51 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858232 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp843294wrb; Fri, 17 Jan 2025 10:29:46 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUPncbEFftql7nBfrwYsNgS/i1/SRoMgY55sEoAD6+GR+6x9rL/SHd272QZn+6bxCcQcDnVeA==@linaro.org X-Google-Smtp-Source: AGHT+IFidS/fpqYxGcXLIbaIKR/GnWJUdwV039zsOgG+pSNUF3tJIPjTiqcDa8owwYcvrQfdRsJV X-Received: by 2002:ac8:5fd1:0:b0:467:73f3:887d with SMTP id d75a77b69052e-46e12b57b8dmr57023801cf.33.1737138586366; Fri, 17 Jan 2025 10:29:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138586; cv=none; d=google.com; s=arc-20240605; b=NjnMKU3a7ufnL+0SKMUn21OxcLN54U4+y0o+UOoG7udNnB/DmWblrzpn6LXBa/Jj5M 0l6CUw3fVEl4JDqdIPJBPqvNFtHQwmzv4t56rQf/zubjXPv6T6H56AZJ0r58voq3bt0B ItAGgGFpxKfcY5hDRFyOcwWSuEY1jbloj2hWj6ndMzSwzkjXljpruykTTZPxFCB314NW gsLng5UMzYt4w9em52/HUIu6x+ZpRDy+/BuoQv3ZC4BuRZYMYd+ZhaB+2MTh6KgL8Wo0 lVRgjYhwELNlRPrN0ci2C8xpadDl6tJX0fn6J3IvFjKrJNlF1EWkIE+u5dXsJGfX4VFW m1Ng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=0BxlAlZ9XLTNeL7T1oRc03rmXf8028Tv8zN2J/x03Ms=; fh=hCxFjoGWrGrRQspmq/CLS+yuX8/gGHZ6aT42c5brLWg=; b=ZJXtAmNmTYu7VS4rCAWOGD7A9L4nbu3yyR8yGSzoCQsIq0BG5rRdL2KJ5B3Cy3G040 fVC+9H+8QDEZzkMVGfALjf5ZOUEQsj/AsffJHVEQq4iIIAz9f+lCNs1Zi/0ktvuyqQxd ruEqYflBZ/gmfDTUv9B/P1Bvzi/H2T9JePcFXiCOmEkAMJGdMNGgbCggW69hCh2snKDv rp+PFHUERK6VoO5W7RNks0e9meoTX7jfLNdBwr/4i1xOq7WeP3Lu2onGg/oja+m5oAml 8Po6dPfiX74/AT9LrnCbkWdpBoFgBo5YjQEo6tNebvf61L6s0K3qEToYAK0J3JvEiome loXQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=H0QoWTdu; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6e1afcecb1bsi34506256d6.278.2025.01.17.10.29.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:29:46 -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=H0QoWTdu; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr5w-0007D3-UH; Fri, 17 Jan 2025 13:29:25 -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 1tYr5m-0005uv-UA for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:29:15 -0500 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr5k-0000K0-Pm for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:29:14 -0500 Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-21669fd5c7cso45917705ad.3 for ; Fri, 17 Jan 2025 10:29:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138551; x=1737743351; 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=0BxlAlZ9XLTNeL7T1oRc03rmXf8028Tv8zN2J/x03Ms=; b=H0QoWTduSe/TwLqIho0SC6EzyZO0G8GTlsM8WlPTOW7soCysFWqkWSh4HHwKUzuOg9 8rQz2XPCsvdy8LJpqh+vemZPx+ZqKcNzAjd8XHr86CvMqRLSPDK2TTEPIS1HGdL4f/f0 2jImlyi2yJ9Y6mUIDtfMvmtjXSuAz2V52eXHVP7v8jiZIVs+PcqOqVzp78Ki3LQlbjB5 sD0H29B/S9LF6ockF5gHQ4bI6KHZtVpPBpcXT4B5SFLt7ZrrE71DWbQZxXK0mgY5TEbA tKe19WJ2l5CCpfqlvyOaoQBfT/S3gLaNK28kSBBY5pxR+XPGP8NdyvdmP0X9kw98TCff f4Ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138551; x=1737743351; 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=0BxlAlZ9XLTNeL7T1oRc03rmXf8028Tv8zN2J/x03Ms=; b=KZ74kEE3I5e76IBOKUhHpNxKO6swRuc/LrVtzFk25/PsC2EiogVTXrwkuKgYH0uASx BbUW0ElHAxYgLVfcuYGXOBphrdPzw3W52l6r8r5bfjhOle23aQgAvUIG1KIG/xf+S46R J46A+/fbN9Qz7QXPI4qF3x9tmMzVSUVl8BFnzClNgFUZwjfgBROF7WPBHUMmzk7uf4QG 8lSbKrJmwEsAotUSSDpcWhf6CMyaGexLOghI50JeEzO7/FxJ2LesrIDoR+75oenzoxBE wj0Reh9fqzWtIesLRlFXfruSx+yE6leVlptnuOmGamWA0qokITgo85kfS50jEAa48yzL pC1A== X-Gm-Message-State: AOJu0Yz0uTzqI67gge0U8yGP1aROv8z7ml0AbRB6chfLmrOowLfi7yOH 74zKffQpIS7Hu+Q2FWDdxBFHaxdrHMerSVOIF8hXux2Mhw503MLIotYiLbm1glJKqDTFZatUlAJ b X-Gm-Gg: ASbGncv70xZB0Piw5LiC0kAVSeBHuDLIHOFrsLvQ0mfp7PpEzqCSeWPRq+Qi5XWtUF9 8fvz09Z02Zz9HP7ropKzsG+Tg4PGGATxwEpS20Q3aTm3nLIXjunN+dlht0VW4NiJFAdJI3sxVOB NR9Aq4cQLsgQHot4d98PTjE4OiD3bbLMawyFdh7P30huSFBNBJvP25MVW8XRHGfedIsr0zgQnFO Bs7i+pFBpZaUwLzP3o0o1wBBhfj8qip2n12GCZmgvwJwDFQlleYmpo7FN9MWQXMzN4nmGHCf5Qu 2b2oVomRwmIzPqU= X-Received: by 2002:a17:90b:1f88:b0:2ee:db8a:2a01 with SMTP id 98e67ed59e1d1-2f782d5d838mr5106023a91.30.1737138551290; Fri, 17 Jan 2025 10:29:11 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f77629bf96sm2614105a91.36.2025.01.17.10.29.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:29:10 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Alistair Francis , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= Subject: [PULL 63/68] util/cpuinfo-riscv: Detect Zbs Date: Fri, 17 Jan 2025 10:24:51 -0800 Message-ID: <20250117182456.2077110-64-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62a; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62a.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 Acked-by: Alistair Francis Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson Message-ID: <20250102181601.1421059-2-richard.henderson@linaro.org> --- host/include/riscv/host/cpuinfo.h | 5 +++-- util/cpuinfo-riscv.c | 18 ++++++++++++++++-- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/host/include/riscv/host/cpuinfo.h b/host/include/riscv/host/cpuinfo.h index cdc784e7b6..b2b53dbf62 100644 --- a/host/include/riscv/host/cpuinfo.h +++ b/host/include/riscv/host/cpuinfo.h @@ -9,8 +9,9 @@ #define CPUINFO_ALWAYS (1u << 0) /* so cpuinfo is nonzero */ #define CPUINFO_ZBA (1u << 1) #define CPUINFO_ZBB (1u << 2) -#define CPUINFO_ZICOND (1u << 3) -#define CPUINFO_ZVE64X (1u << 4) +#define CPUINFO_ZBS (1u << 3) +#define CPUINFO_ZICOND (1u << 4) +#define CPUINFO_ZVE64X (1u << 5) /* Initialized with a constructor. */ extern unsigned cpuinfo; diff --git a/util/cpuinfo-riscv.c b/util/cpuinfo-riscv.c index 971c924012..0291b7218a 100644 --- a/util/cpuinfo-riscv.c +++ b/util/cpuinfo-riscv.c @@ -36,7 +36,8 @@ static void sigill_handler(int signo, siginfo_t *si, void *data) /* Called both as constructor and (possibly) via other constructors. */ unsigned __attribute__((constructor)) cpuinfo_init(void) { - unsigned left = CPUINFO_ZBA | CPUINFO_ZBB | CPUINFO_ZICOND | CPUINFO_ZVE64X; + unsigned left = CPUINFO_ZBA | CPUINFO_ZBB | CPUINFO_ZBS + | CPUINFO_ZICOND | CPUINFO_ZVE64X; unsigned info = cpuinfo; if (info) { @@ -50,6 +51,9 @@ unsigned __attribute__((constructor)) cpuinfo_init(void) #if defined(__riscv_arch_test) && defined(__riscv_zbb) info |= CPUINFO_ZBB; #endif +#if defined(__riscv_arch_test) && defined(__riscv_zbs) + info |= CPUINFO_ZBS; +#endif #if defined(__riscv_arch_test) && defined(__riscv_zicond) info |= CPUINFO_ZICOND; #endif @@ -71,7 +75,8 @@ unsigned __attribute__((constructor)) cpuinfo_init(void) && pair.key >= 0) { info |= pair.value & RISCV_HWPROBE_EXT_ZBA ? CPUINFO_ZBA : 0; info |= pair.value & RISCV_HWPROBE_EXT_ZBB ? CPUINFO_ZBB : 0; - left &= ~(CPUINFO_ZBA | CPUINFO_ZBB); + info |= pair.value & RISCV_HWPROBE_EXT_ZBS ? CPUINFO_ZBS : 0; + left &= ~(CPUINFO_ZBA | CPUINFO_ZBB | CPUINFO_ZBS); #ifdef RISCV_HWPROBE_EXT_ZICOND info |= pair.value & RISCV_HWPROBE_EXT_ZICOND ? CPUINFO_ZICOND : 0; left &= ~CPUINFO_ZICOND; @@ -117,6 +122,15 @@ unsigned __attribute__((constructor)) cpuinfo_init(void) left &= ~CPUINFO_ZBB; } + if (left & CPUINFO_ZBS) { + /* Probe for Zbs: bext zero,zero,zero. */ + got_sigill = 0; + asm volatile(".insn r 0x33, 5, 0x24, zero, zero, zero" + : : : "memory"); + info |= got_sigill ? 0 : CPUINFO_ZBS; + left &= ~CPUINFO_ZBS; + } + if (left & CPUINFO_ZICOND) { /* Probe for Zicond: czero.eqz zero,zero,zero. */ got_sigill = 0; From patchwork Fri Jan 17 18:24:52 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858237 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp843403wrb; Fri, 17 Jan 2025 10:29:58 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUX4xV6FHpH+EDlillDbdwWzPPPqZjzNkFVwKTt1tt9LRuKe5EILKK3Pc5TU17kBT1YRIr1zw==@linaro.org X-Google-Smtp-Source: AGHT+IEnbFh1WUSwus/Kws112bxfR8mvJatwsdDTOjxFiGlyw/7WNk+f987nB9R7rZiNeAg+4Sbk X-Received: by 2002:a05:620a:1793:b0:7bd:bafc:32ad with SMTP id af79cd13be357-7be6320c3a3mr572860185a.34.1737138598350; Fri, 17 Jan 2025 10:29:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138598; cv=none; d=google.com; s=arc-20240605; b=LlTt8K1USUi88507tgBDPXuyxq46YSKfr2OBOuwxKNOB70d/1Zi+v7eGmHYDCzHSiZ WnPUHW0o6HSnRm6HBasnbPBmLt40Mo5V4YojLhkrmgZd9l2Ofa5bqTUu7NmC4rhROdy1 PkNZMKusQo3fbLMfLJTbmIQao3yzo0oB35uObuevYKnH/qFiJ5gfbIwYeLEyZyOPgioL fpCg6IwLOVXhcXx2HEIx3rgKp2Ngm74CkSNuSjqy6npS7vGlrnYQhHUR7Vlmz30AMqb3 gWVcagwtcyMm+wHvYc9tLfdeydAppgQvVHRCuZhCo0pwzuKS3vdxBHg7LjXpIlOyEQzA QoBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=crcvNbjkly9KMWSjp1gKNNJHKJypn6AEpvxWtvO08G0=; fh=OD2lp1dfJFstOGLpXnIzbHomhWx3nF/XGvY6bQVU7c8=; b=LYd6NG7IGRixCmjnwIjPE0cU/6zKmB/ZRKtpHIbS2L7lDXln0VCYP3fY2RsD2TK+om 6WJCYBu7lEHrellzK1oB/J2BOfgG6l6ZtRW4S91ptuOxbIuU6zxZXH2ea5Mx2UUzKk4R gQxgqSsa4PJmt8QSzZBLqMtH2npHoqg/55nckIZ1Iq8WLEsK4G2SrYMucbfxEenLCCT4 4RZGcG/RwRa+2Hj3L/BIAFGPR5bTQI47CGzuiknLa513fEmIhkY7SzmVwcdTPjQetdsU iLjT6osENkwgTmpiuTjcsqJgBQhmV89ShRvG68wchb/eSwcQkmZbliFu21qMhJUO9Dpq EiOg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=imTuE0jf; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7be614f569fsi319947385a.627.2025.01.17.10.29.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:29:58 -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=imTuE0jf; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr69-0007rj-L3; Fri, 17 Jan 2025 13:29:37 -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 1tYr5o-00063i-3M for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:29:16 -0500 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr5l-0000KO-HP for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:29:15 -0500 Received: by mail-pj1-x1030.google.com with SMTP id 98e67ed59e1d1-2f43d17b0e3so4449007a91.0 for ; Fri, 17 Jan 2025 10:29:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138552; x=1737743352; 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=crcvNbjkly9KMWSjp1gKNNJHKJypn6AEpvxWtvO08G0=; b=imTuE0jfSTcBSVkl2So3TvmA8VJJtwYN0TVwv9FcJpnqyTi2ElD/tbTjenin84aCTY opYcamu9HphkRStRzknwd3xYnuqOF092EFKMwXBKJKQZKmzu4F4h5hfOnOU4Tb4dg/9g X0VFBriayBzNyzyETDmI5VGErHLTlxwzCKEZsyMmzzwtccGNUa8aCZcA0SvdzE5Azhmm ktoLzSY5KLuGbUFPBjyL5cuPj6J3d8VuTRd8P7TWAgrDHSkwY1Ztw3HRgaJUh8QZ5icB K26fWZYnAR1cMCZ/s8pYfupUMIMvMFR7wyHN/1YQoPb54omqQzxCH09MhHBnfn6Bt4h2 mIkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138552; x=1737743352; 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=crcvNbjkly9KMWSjp1gKNNJHKJypn6AEpvxWtvO08G0=; b=mDqrVllPtWnuusXIE5i6Fqy0rrufSu6KL/Sv4kaWRfPe6/5WSHmyPwAMkPkuQBHBga NprTGWi9460iB0ItkNfqN7Ubir9koP7ZyaNLf22yDXJkkzYxDvkjP0hCpI6qDe0ZqmKB KTBLo9zUiWUVgvGMuduk9NGlvYfGTvpHnQkYIRxkxfGhRLMIY/CkFGFlNpgbNe4ElSNi hOvGxSRax9iau0JwjpF/8qDVv0URmhOgjPcqbkJ9VEYVn6nEnjgRSgf1QbRUi2odmyLP y7vL3o7BAnrlI6wyldLS2UCzs9BWOEClcIbBJjzC7vtLqUPaUUA+6NsSO8wqx5zGHf2f bUxw== X-Gm-Message-State: AOJu0YzycEMp4ntmpsLVI0AUVhxep4HVyL1P5kezAeSH7reyi84+57F9 WtCTOGVHb1bdf62L61ibUlQhPO9VSyeN2adbwedgCQo3D9q/lcYzum2lvvwPS8xh6QTTah3yCQK i X-Gm-Gg: ASbGncu3ZMwSQAHPIp/uqBoILLgHm/z5UZEBWhV/5T9wgIhh/mSidaBgnjTPi5lElno ejKirFILFKyNwqzPJ5A9D+2+jeLcn7upfA16ByafuhabcE8QZrZaZbt2UUrBHUsI6ULvQDIcPum PoysxDSkeHAIKal68J7Q+n9XyJeLr4gkLD4qXPzPwAE+tAto4JE9+O8vLxm25JYLkU0Oh1lhaoz dy/7VhQaKDAqkWq401nvt1hvnq/HIy9G+mtMs4vt0ijjx3SStMzpuV89nkYPVbSABFdejUQ0+lR RshvX0VqRKUYKJc= X-Received: by 2002:a17:90b:53c6:b0:2ee:4982:e59f with SMTP id 98e67ed59e1d1-2f782cbfa4cmr5914747a91.17.1737138551986; Fri, 17 Jan 2025 10:29:11 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f77629bf96sm2614105a91.36.2025.01.17.10.29.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:29:11 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Alistair Francis Subject: [PULL 64/68] tcg/riscv: Use BEXTI for single-bit extractions Date: Fri, 17 Jan 2025 10:24:52 -0800 Message-ID: <20250117182456.2077110-65-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1030; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1030.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 Acked-by: Alistair Francis Signed-off-by: Richard Henderson Message-ID: <20250102181601.1421059-3-richard.henderson@linaro.org> --- tcg/riscv/tcg-target-has.h | 8 +++++++- tcg/riscv/tcg-target.c.inc | 11 +++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/tcg/riscv/tcg-target-has.h b/tcg/riscv/tcg-target-has.h index 0f9cc04f8c..f35f9b31f5 100644 --- a/tcg/riscv/tcg-target-has.h +++ b/tcg/riscv/tcg-target-has.h @@ -110,7 +110,13 @@ tcg_target_extract_valid(TCGType type, unsigned ofs, unsigned len) /* ofs > 0 uses SRLIW; ofs == 0 uses add.uw. */ return ofs || (cpuinfo & CPUINFO_ZBA); } - return (cpuinfo & CPUINFO_ZBB) && ofs == 0 && len == 16; + switch (len) { + case 1: + return (cpuinfo & CPUINFO_ZBS) && ofs != 0; + case 16: + return (cpuinfo & CPUINFO_ZBB) && ofs == 0; + } + return false; } #define TCG_TARGET_extract_valid tcg_target_extract_valid diff --git a/tcg/riscv/tcg-target.c.inc b/tcg/riscv/tcg-target.c.inc index 4f6e18f59e..61dc310c1a 100644 --- a/tcg/riscv/tcg-target.c.inc +++ b/tcg/riscv/tcg-target.c.inc @@ -163,6 +163,7 @@ typedef enum { OPC_ANDI = 0x7013, OPC_AUIPC = 0x17, OPC_BEQ = 0x63, + OPC_BEXTI = 0x48005013, OPC_BGE = 0x5063, OPC_BGEU = 0x7063, OPC_BLT = 0x4063, @@ -2354,9 +2355,15 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType type, } /* FALLTHRU */ case INDEX_op_extract_i32: - if (a2 == 0 && args[3] == 16) { + switch (args[3]) { + case 1: + tcg_out_opc_imm(s, OPC_BEXTI, a0, a1, a2); + break; + case 16: + tcg_debug_assert(a2 == 0); tcg_out_ext16u(s, a0, a1); - } else { + break; + default: g_assert_not_reached(); } break; From patchwork Fri Jan 17 18:24:53 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858255 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp844800wrb; Fri, 17 Jan 2025 10:32:51 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXi63djQ8Ajl5yQrpQpJAwPJpSL2/XCEUfBlvx0xX+nVvlGsrtpYCIoH2BYNnzzF4VftfepfA==@linaro.org X-Google-Smtp-Source: AGHT+IF4VMY/zObKVBY6Us4+fzNNINkz1B+L0woDME25myvHr7vSBM/5YQX0NvUquNKA9zD1dGBk X-Received: by 2002:a05:620a:410a:b0:7b6:d870:ca2d with SMTP id af79cd13be357-7be6321be51mr689412985a.13.1737138770784; Fri, 17 Jan 2025 10:32:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138770; cv=none; d=google.com; s=arc-20240605; b=IXc7JqzY0KZvzFWUFPUpC6mx8NbG/GVU1K/K8SgLsrzAc0EInxq0afftyXY4t+qqqB bNNv8CshF7Q9IAdrX274RQBlOYzYNE4iSSP7BSBWPlY2nq3guuNIWgMORA0HqbepPYQJ RA+bIjrPo9htw4sMl8qDuz4pyGTGL6FRfQ7rlNEeuSBfw2s6NjZmo1DS2KFKFMCnpxF/ be5slQQZGjXMN2hcLoVEf5wRf3+IE/731Lwh58e/nqGDzG4ZWWk4nVwI76dw8JHV+6+c YxLtD3lQd6rLq1kJ826/j5DzPmws7enXQU4jMXnOUop49FRrGAZ0Nt8aM30jcz9JSPrP HD7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=i4dO1DHs3aMhbQoy6IdswUOKg4TsdDQ15BdXLkM5uuA=; fh=L/zcBenwEF5glhwyLP21Krd2deVqVkTL6GpZ6TwRGPk=; b=fngM0r/KN/BriFcFXgYX1FKc3qd20MPjlz8gycYw3otzyW3zqHobqBnd4PVbTXerSl bUUmThBvmzLsUTeEfWZWmDYjjQHoFcfrnxk/Y9fy7LliV47IKoql06f6UIb6A4OSxVrm N3e2IhVS4vkQ7v4MTsHpXcmquwYH00Kp5ekzkx4+zi/+BiYen25I31j+ueqZ87l2LLc9 5s63E4rp/D9WFiZkPXSdn4yRe2x3DyTLHIqA6HcX41y9E5ssi4J0jsa6Dz07goNjHx4v by29YIVFEre4lz101SYBMngV9L8eLFUEdH9wQ/z8Fc8Qb9ERDXdne/q0W+XuIhd2IF+D A+yg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="uL9oIiV/"; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7be614ca99esi331672485a.451.2025.01.17.10.32.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:32:50 -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="uL9oIiV/"; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr6I-00008Z-43; Fri, 17 Jan 2025 13:29:46 -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 1tYr5r-0006ZJ-C0 for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:29:19 -0500 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr5m-0000KX-23 for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:29:19 -0500 Received: by mail-pj1-x1030.google.com with SMTP id 98e67ed59e1d1-2ef760a1001so4276945a91.0 for ; Fri, 17 Jan 2025 10:29:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138553; x=1737743353; 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=i4dO1DHs3aMhbQoy6IdswUOKg4TsdDQ15BdXLkM5uuA=; b=uL9oIiV/RU2rTkv10nlRcbYZ5PnNpEnq6InXWdyd97UpZXFk1AdFhIywQlwcpVT3kT jTfXVNCSgsUT5UBzDWbCf1YdF2WtMpdUIqhXxpofEovPB0R4AowDg/hShACXqGV0hRIJ oPTkT6ViMeJVn1UNia+RWphXZhjW096NNVriGaCCIygC7N7VAstjR4lSpBDaoj4d9vtj CmgNM5kN4ZO5wOqYZhlcHZUmfpBRYN9P82vtm+RM3YhGgvdBTx22swdZht5SG3xsUr6C tCUmlkByF8Rogg6CZy/RpRQ9vHfsDdh+Hhm4qCGxwQNbek7Gl9MoPDzdPAbHfVbApBbF TSBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138553; x=1737743353; 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=i4dO1DHs3aMhbQoy6IdswUOKg4TsdDQ15BdXLkM5uuA=; b=wqdn7kxSxskiafFBDrs32rdlpvCtMyqMrhWWPnLCliv5COcmji+vINQtaGA9CVoEDF BlVtEGRbKvBTJY5I8TTeFDXwIETtIT2mVcNnICQ1gAOZXsf5GPb/WsRWDvHMwnfFZo9S A877VEJOJjCtzfUXBDGWg0rtfpeC5AFkvVq7WGZA5aNNpC57UwtFxfpYIQPnXCiqrIXu +82iH5lm017VzsTkP1EC2B0wH+gfkBLbXwjYSW/ZUc+3nSm1N6or+UMFMEhyQ4qAk3Ga 7xMHRjFtfIPUXMkBYGlZ4scsrjRvW1fOrcZMP9VjFEvBf02IvdGNBC1eYt/atSkKZ3sg NImg== X-Gm-Message-State: AOJu0Yy8Qc+JgEz4Lf5y1hPqUh/ZsVmgVkQC/pJxroIeysV8vaWsYODk 9OwCD3defuv6kit1xvapkzO/CbyjKy3dwnocznHoA5XA/lQA/A2FFe51KuKAk2e6xgbZlHN55kO L X-Gm-Gg: ASbGncs8GoJop4/8AnEwTouYmFEFynRddfsjgcs49gfOdo4fRROZEE7Z4VUeE89ZRaF P2GhxnRteglsqBtKhVVIpYZ7AnRUbXdkFTpemcxKkAw5hkwhcHgTwL4dD+3a4hUt6NxL0brC+0t AS3KTewtgrKgYoI6NLZ+r7Cdb+nim/yYTfeMySfzIEaepP3LnrRwnTiAZfXvfHtqjzVcQe+JZu2 Bn73+f21GACgEZGHrW6Xp4BNX8R2di16MPhVYjeMXM0FmFTfwrGYYEta+XdlckgD+sNEI7CpECg tw55e+iQEEsUUf8= X-Received: by 2002:a17:90a:d003:b0:2ea:712d:9a82 with SMTP id 98e67ed59e1d1-2f782d7dbe5mr5046329a91.29.1737138552696; Fri, 17 Jan 2025 10:29:12 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f77629bf96sm2614105a91.36.2025.01.17.10.29.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:29:12 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Helge Deller , Helge Deller Subject: [PULL 65/68] linux-user: Add missing /proc/cpuinfo fields for sparc Date: Fri, 17 Jan 2025 10:24:53 -0800 Message-ID: <20250117182456.2077110-66-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1030; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1030.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_PASS=-0.001, T_SPF_HELO_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 From: Helge Deller Add some missing fields which may be parsed by userspace applications. Signed-off-by: Helge Deller Reviewed-by: Richard Henderson Signed-off-by: Richard Henderson Message-ID: --- linux-user/sparc/target_proc.h | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/linux-user/sparc/target_proc.h b/linux-user/sparc/target_proc.h index 3bb3134a47..744fa10730 100644 --- a/linux-user/sparc/target_proc.h +++ b/linux-user/sparc/target_proc.h @@ -8,7 +8,25 @@ static int open_cpuinfo(CPUArchState *cpu_env, int fd) { - dprintf(fd, "type\t\t: sun4u\n"); + int i, num_cpus; + const char *cpu_type; + + num_cpus = sysconf(_SC_NPROCESSORS_ONLN); + if (cpu_env->def.features & CPU_FEATURE_HYPV) { + cpu_type = "sun4v"; + } else { + cpu_type = "sun4u"; + } + + dprintf(fd, "cpu\t\t: %s (QEMU)\n", cpu_env->def.name); + dprintf(fd, "type\t\t: %s\n", cpu_type); + dprintf(fd, "ncpus probed\t: %d\n", num_cpus); + dprintf(fd, "ncpus active\t: %d\n", num_cpus); + dprintf(fd, "State:\n"); + for (i = 0; i < num_cpus; i++) { + dprintf(fd, "CPU%d:\t\t: online\n", i); + } + return 0; } #define HAVE_ARCH_PROC_CPUINFO From patchwork Fri Jan 17 18:24:54 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858244 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp844002wrb; Fri, 17 Jan 2025 10:31:07 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXHi6KAWdqpQ9rWAx+u3ATZIoMWdJrzBpBaj5oF8NIzS5QhdYh3AhX+jSgcFjkHxE5qUWrrRw==@linaro.org X-Google-Smtp-Source: AGHT+IEQJTTishFFPbisKObKi/tSwdeaDWz358LIrDwxgpmww4DF22B5FY5wieuyugyJdo6q4Il2 X-Received: by 2002:a05:6102:370a:b0:4b1:1caf:f61b with SMTP id ada2fe7eead31-4b690ce4aedmr3341438137.18.1737138667089; Fri, 17 Jan 2025 10:31:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138667; cv=none; d=google.com; s=arc-20240605; b=TxUbTCMkpKvAMiM1eZtMRLTKoo54R2AW9XsTL+1T3rCpihCxvootoU6l8WRZ3dRlj5 +rmFzyA/UQBKBBvV5zeBAVklJGBRavYgDvSuLd6v+vOx2u3vORN5KRTmYjN7IoWBtlMJ 0bUA6kpB0Ia4GsqHO5Et993kkZb2DgN5JyBEE9aGkjlC9mdRcPezp4wjNd6OiTykVdmV d+HiGthifZArPS26wfogCIQG8d8etisSOb+fp/vEMr7wEoDFARaNVFfmaEl18/ZiDsNS WLYMOSS2ghsIziLe5JaZmWqdLv6jl0d7cVf/5KA7AvmsOERWj468WToNZ2D2LIhyxUsB nNJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=LBsqQj8rQBpzTgQIoyJGX8gEHYch3blKkFbgri8rIlE=; fh=m3bIYSMZqCABEJVkIKLKf3tNf8TH8EKhZ9yqNwsZqDo=; b=aIVvpPUqZanJvSVsHLSWaTaB0P0vNGwEH2vYdfssi9KyEXKCSa+UBE78kQolEP8cf3 DEjRYLWI1wML5abECR+/6a/wDayALl5FKhdVbvvc4PlltmsTbOC/VycgQUpTUXrdZSFK PG7q/mrHitSid2wrWafXAGTwzriOYalvs+I/8+Hh+eiP8ZgAQ+Kp4cF5h7WEj/vvO6Ye vLmMtXJIMxjHrepB/Dpqokssajggjm5qqR1orhXunBfnMU9hdxkP8CpOuEASt8Xg6vW5 BMhWgrS6Ebu+BxxMQsu3iGxn2Uj8l8nwa/i37I8+SVEtbdSQD84DxKzBmaE3TIP1FLAE zBPw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rUDKe1cm; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id ada2fe7eead31-4b68a380f2csi1108685137.695.2025.01.17.10.31.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:31: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=rUDKe1cm; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr6E-0008Jz-Mw; Fri, 17 Jan 2025 13:29:43 -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 1tYr5p-0006D6-31 for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:29:17 -0500 Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr5n-0000Kr-4y for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:29:16 -0500 Received: by mail-pj1-x1035.google.com with SMTP id 98e67ed59e1d1-2ee8aa26415so4238354a91.1 for ; Fri, 17 Jan 2025 10:29:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138553; x=1737743353; 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=LBsqQj8rQBpzTgQIoyJGX8gEHYch3blKkFbgri8rIlE=; b=rUDKe1cmxStgtO2G+OESB4FXvkI+9pnfm2RONz2YPe75eYaa732us2qrtJ0itSOQta MYcwRV5n/qWpq1AKcj5Q1ZmxEK8vrf6/8t17x1f5Gjd271LOzmfamypkR0AjZgR0i1kO x8VXf8ubP3mmAtGVm5GA7VImkz8dymmCLH1ctFcV6dUHkXHMD1DOMgDzPTocZRCK0Qzh dzCCWV1RkEC1Y2OGoRTbUeMizPJT66i+ZkW9XhwM7kzg/kqrLftmC9lrA3D5U84Jgi+A sOMAMtyv7f9gK1m/eiD37AtVa8+Wtp2fFwKLHJ3G+MXApSIRofFirIzlFO2GZm4Cizoz RVAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138553; x=1737743353; 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=LBsqQj8rQBpzTgQIoyJGX8gEHYch3blKkFbgri8rIlE=; b=RJGgSfYwBiWQOoHu6+EbnHFwYexjn6oFQ0I01hBuS99RxVUNVgYCl4gRgipudfv5cK dFTTnnHW4wkG4lrQ+revxQJIO2nK0dpPv0IfNcIC970G6ox1FoxN9Y0IlfxpgdUaXkUL +V91yEIYqlzAgobGuv9kK10szVcg4BTOY5JO6Ru3peRXM3T5BgDZd2/tf2tyaMXllQ+y 3bBexU0tnsAntn+Y9QGgNlXmACalXei/JDvx92X8ec5z5ZyxBaA1DLCk+WaggLZqr6kx 3Cc+gEEQdXut1Z0qdM3EgZvlV+OS3hIe7d/XUVRE/6gid3mT2f81YFkLnxYG4H24e7GV p0UQ== X-Gm-Message-State: AOJu0Yw/4aecUbNzCoHvx0/LiVGqOj8XQdGBiswq07CS74HpbN4s7j3W f+W4/7Cpe1k07RTrY+Xfo0iImmSWs6W5+7BbV0SLu8y9GJ3Mm39ivIzt1ik1hRL1/52qHXu+EaW j X-Gm-Gg: ASbGncu9qpbaR3Peu1LecOKcWE94Z2F+QFVtor9r+CaovElfIwz6DsiVFsPW+kvfKUg TVbQidTdAM/xhDrTTq26WfQZCMnazIM7ivw+3fgKFVk2gWpamPZRR9KHFbRbHPNfs6HdolDUeEL OTYd0rR8s2a936+YGW4gYsf/jhylzqi8sxmJsYxU+vnpTdp/u9sbWVwSanE9kMupJLnEedkWHT9 oImA8G6RINAyDkkPlnhvA/Sz7HNo7lpcH1dYFEPllrR/65NVIwQY5d978g5lTo48PPS6GTAPWZd KrRxIUZmPK1bOIQ= X-Received: by 2002:a17:90a:c888:b0:2f6:f32e:90ac with SMTP id 98e67ed59e1d1-2f782c90095mr5672794a91.11.1737138553521; Fri, 17 Jan 2025 10:29:13 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f77629bf96sm2614105a91.36.2025.01.17.10.29.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:29:13 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Ilya Leoshkevich , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PULL 66/68] tcg: Document tb_lookup() and tcg_tb_lookup() Date: Fri, 17 Jan 2025 10:24:54 -0800 Message-ID: <20250117182456.2077110-67-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1035; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1035.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: Ilya Leoshkevich These similarly named functions serve different purposes; add docstrings to highlight them. Suggested-by: Alex Bennée Signed-off-by: Ilya Leoshkevich Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson Signed-off-by: Richard Henderson Message-ID: <20250116213214.5695-1-iii@linux.ibm.com> --- include/tcg/tcg.h | 41 +++++++++++++++++++++++++++++++++++++++++ accel/tcg/cpu-exec.c | 15 ++++++++++++++- 2 files changed, 55 insertions(+), 1 deletion(-) diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h index e7ddf979f6..1d1d668f52 100644 --- a/include/tcg/tcg.h +++ b/include/tcg/tcg.h @@ -638,10 +638,51 @@ void tcg_region_reset_all(void); size_t tcg_code_size(void); size_t tcg_code_capacity(void); +/** + * tcg_tb_insert: + * @tb: translation block to insert + * + * Insert @tb into the region trees. + */ void tcg_tb_insert(TranslationBlock *tb); + +/** + * tcg_tb_remove: + * @tb: translation block to remove + * + * Remove @tb from the region trees. + */ void tcg_tb_remove(TranslationBlock *tb); + +/** + * tcg_tb_lookup: + * @tc_ptr: host PC to look up + * + * Look up a translation block inside the region trees by @tc_ptr. This is + * useful for exception handling, but must not be used for the purposes of + * executing the returned translation block. See struct tb_tc for more + * information. + * + * Returns: a translation block previously inserted into the region trees, + * such that @tc_ptr points anywhere inside the code generated for it, or + * NULL. + */ TranslationBlock *tcg_tb_lookup(uintptr_t tc_ptr); + +/** + * tcg_tb_foreach: + * @func: callback + * @user_data: opaque value to pass to @callback + * + * Call @func for each translation block inserted into the region trees. + */ void tcg_tb_foreach(GTraverseFunc func, gpointer user_data); + +/** + * tcg_nb_tbs: + * + * Returns: the number of translation blocks inserted into the region trees. + */ size_t tcg_nb_tbs(void); /* user-mode: Called with mmap_lock held. */ diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index d48b82a932..8b773d8847 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -249,7 +249,20 @@ static TranslationBlock *tb_htable_lookup(CPUState *cpu, vaddr pc, return qht_lookup_custom(&tb_ctx.htable, &desc, h, tb_lookup_cmp); } -/* Might cause an exception, so have a longjmp destination ready */ +/** + * tb_lookup: + * @cpu: CPU that will execute the returned translation block + * @pc: guest PC + * @cs_base: arch-specific value associated with translation block + * @flags: arch-specific translation block flags + * @cflags: CF_* flags + * + * Look up a translation block inside the QHT using @pc, @cs_base, @flags and + * @cflags. Uses @cpu's tb_jmp_cache. Might cause an exception, so have a + * longjmp destination ready. + * + * Returns: an existing translation block or NULL. + */ static inline TranslationBlock *tb_lookup(CPUState *cpu, vaddr pc, uint64_t cs_base, uint32_t flags, uint32_t cflags) From patchwork Fri Jan 17 18:24:55 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858251 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp844558wrb; Fri, 17 Jan 2025 10:32:16 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCV/ZmCcxYrzmBvOaA6duA9l0tnEWI8SAGmOF83t2b626Hex6NOye+GVtlRA1omocwZlbK8D1g==@linaro.org X-Google-Smtp-Source: AGHT+IH/tfm21UECVfdMKpbssnxBTfZ3xxgfv5TYr1kfMui48sflwkJwa7sfBBQXxnWyOtaq6Kpj X-Received: by 2002:ad4:5ced:0:b0:6d8:a64d:da51 with SMTP id 6a1803df08f44-6e1b216f1a2mr63757286d6.8.1737138736390; Fri, 17 Jan 2025 10:32:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138736; cv=none; d=google.com; s=arc-20240605; b=PV3gVnQg15HxCSJ+l9jHUk4aWNNmP4SWstkHetJ1dpbMmWMsT6D48KdL6JwjstuBB+ /G4rpCkVqysppoge2zWMl6MPJQ54VVMIdVi0Z4Xvg37p07D18xuxoJtQxfhusv2vP6ww O2/Ub3RZ0KAB3k1gKOdgyL7q6SbjFrEmlST1awDmewBtyOgf3xRtWvu+L1RNRqaQ4lxb yy5ZgxqxyWkUGWd0QghExIogtBNWcNToAhAk1Y6dN/8zQOB3yOvyyHbPIvH9fe/oTAu4 86MAxAFPCmQ+jygxEPp09E8sSHl/d4UQzEIusRFOSqrDviGJAmVm9vBJ/8ajlNWyotbA GeLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=VnAY5AK7GVGkWUkhZpxNBk2WcY053ri+rky+3yoomPk=; fh=TqOB0xKgps+dJHWYgi9D4ZkZ7WkIY4IyvHKGjOekCrw=; b=JUIwnl3uybWDG3PeSBNbeF7SwWqcLDiUX3/stPhvr+ppGxYiFZIgRS263wq7FZqoXQ DwZsLefo+cjXMTREXt9mlu4NrzHbzyIOuPbLayBt6hzpm2BTZw4hRELu9CnJFBT+XzPP ZcK/C7D1eTprvitQWE0FSnCdhDje/+rrCdd6cYx4Q4sL+M2aOE4vvBiMQSnQjSHZ+vp/ G8aNHpcZeIM8iKynAHmgSLT06d1dqtrwzMH5wRYhq15vB5xC+EiKvPEJNqhBWUMdDxn9 Cbtsijt8H8FZw+RaYzBOYKZ8p3NI7e6pt8VZD/75vz5dviiNeUfznSPXqv1+s9zHVt/Q crDg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VD+GDSpt; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46e1048faa1si30404961cf.560.2025.01.17.10.32.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:32:16 -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=VD+GDSpt; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr6D-0008Kk-SH; Fri, 17 Jan 2025 13:29:42 -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 1tYr5r-0006b2-LV for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:29:20 -0500 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr5p-0000L6-Kf for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:29:19 -0500 Received: by mail-pj1-x1030.google.com with SMTP id 98e67ed59e1d1-2ee709715d9so3560412a91.3 for ; Fri, 17 Jan 2025 10:29:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138554; x=1737743354; 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=VnAY5AK7GVGkWUkhZpxNBk2WcY053ri+rky+3yoomPk=; b=VD+GDSptTjAdDKHZO6FEb3apHCt5nEV1btM2+3s2CXtuHyn1UYFNOwq9I0mNDvfuS0 aWfAalYFdsWizylrOBVDTe5Rb1xWUz3/t6D27B57OpvJdeGwYIpbfClpJJsuoiU0xwFY IhQkMod6kGu/+gZyFfqUAnANWYJef9QlIIYnEBcYhEhZRqM7zgqAJZ/VI9LaiHCIakyb LbuT/Lj1FlvPVab2WQsFJAkk1VuygHNZj3HK3N6RIFIXyRATyY5O9UqU8gE5CVaKfzGi vbE3+FZ1OGeyXPDLXe42cHKniep2rbmP3gB5cL1Xa90xMt+p6xy398qqRZls3dv162Rr S9Kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138554; x=1737743354; 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=VnAY5AK7GVGkWUkhZpxNBk2WcY053ri+rky+3yoomPk=; b=Xe1RrtpKXWaU/gg5419gqJS3h4WJjm2Asw/scR74vo4pJPKujtqzCnugHvrJQoJ7Js zWL8Q/JR43LM8ac00hD22RG3OvvPQQ7rQkE56Un5nDfJBWZ/I54CeIJPsF55e9CbtQbs S6ac+8lSIO/7Gh1KhzVaQBq+d2OGu99DFyiok3v+phvRjnVZsAHScp6JJwsyUJa9jsZ5 aoVIhVODctp3lRFEt18fGSXuiNYyTaYme4REL9NzclEg/Mo4I2riKw/K90rKyJmdoFaN LCWRpPaE7lNOWsOxeswykI8HXu4L4Bka0BSROtbXq69DIbhVbFm4aJaqRvi1/udlnAAK U7fQ== X-Gm-Message-State: AOJu0YwdYdsr/oCaAyRlDaCYmENb6qDnyl8FkxUrLEvFzhW9FiLeXjEn u5dr+tLMNMCt5uKhLJK5sSWWQb5laIe+WoXIzadEuLIZ6IRmCX80FelevRmeN/QIFgU9RCl3ir1 I X-Gm-Gg: ASbGncuFGNNNo7+VcJAtNG0f1mdahfwZkkAebS29QhDN0JhQSzuL0Uzes2JEMesVznj bb43gUalLEnUUCu1AbLUZHUOh8PyhD7PRGx/V5CON6kozhXaHYf2RahajLq+sa5Lj66oHm/wYKM Psfo7Y2X2YS8YTBjQstPR9N3O/+DS2rLRFa8Wwroi5HsY937jLc6Squr7VSMbs8nrp096SxU+wm L4uQ/kLmtX1L1RT31ijtenCwiR4tWy6mdZJqCoRb99Q/CIu3TzhbhEwFxKhECmuipTn5jMvdKbC OifLKWCyfX7waTo= X-Received: by 2002:a17:90b:5249:b0:2ee:e518:c1cb with SMTP id 98e67ed59e1d1-2f782c4bdd2mr5615223a91.7.1737138554175; Fri, 17 Jan 2025 10:29:14 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f77629bf96sm2614105a91.36.2025.01.17.10.29.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:29:13 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Ilya Leoshkevich , Nina Schoetterl-Glausch , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PULL 67/68] accel/tcg: Call tcg_tb_insert() for one-insn TBs Date: Fri, 17 Jan 2025 10:24:55 -0800 Message-ID: <20250117182456.2077110-68-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1030; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1030.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: Ilya Leoshkevich Currently one-insn TBs created from I/O memory are not added to region_trees. Therefore, when they generate exceptions, they are not handled by cpu_restore_state_from_tb(). For x86 this is not a problem, because x86_restore_state_to_opc() only restores pc and cc, which already have the correct values if the first TB instruction causes an exception. However, on several other architectures, restore_state_to_opc() is not stricly limited to state restoration and affects some exception-related registers, where guests can notice incorrect values, for example: - arm's exception.syndrome; - hppa's unwind_breg; - riscv's excp_uw2; - s390x's int_pgm_ilen. Fix by always calling tcg_tb_insert(). This may increase the size of region_trees, but tcg_region_reset_all() clears it once code_gen_buffer fills up, so it will not grow uncontrollably. Do not call tb_link_page(), which would add such TBs to the QHT, to prevent tb_lookup() from finding them. These TBs are single-use, since subsequent reads from I/O memory may return different values; they are not removed from code_gen_buffer only in order to keep things simple. Co-developed-by: Nina Schoetterl-Glausch Reviewed-by: Richard Henderson Signed-off-by: Ilya Leoshkevich Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson Message-ID: <20250116213214.5695-2-iii@linux.ibm.com> --- accel/tcg/translate-all.c | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index 453eb20ec9..7ec1c53f24 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -531,16 +531,6 @@ TranslationBlock *tb_gen_code(CPUState *cpu, tb_reset_jump(tb, 1); } - /* - * If the TB is not associated with a physical RAM page then it must be - * a temporary one-insn TB, and we have nothing left to do. Return early - * before attempting to link to other TBs or add to the lookup table. - */ - if (tb_page_addr0(tb) == -1) { - assert_no_pages_locked(); - return tb; - } - /* * Insert TB into the corresponding region tree before publishing it * through QHT. Otherwise rewinding happened in the TB might fail to @@ -548,6 +538,25 @@ TranslationBlock *tb_gen_code(CPUState *cpu, */ tcg_tb_insert(tb); + /* + * If the TB is not associated with a physical RAM page then it must be + * a temporary one-insn TB. + * + * Such TBs must be added to region trees in order to make sure that + * restore_state_to_opc() - which on some architectures is not limited to + * rewinding, but also affects exception handling! - is called when such a + * TB causes an exception. + * + * At the same time, temporary one-insn TBs must be executed at most once, + * because subsequent reads from, e.g., I/O memory may return different + * values. So return early before attempting to link to other TBs or add + * to the QHT. + */ + if (tb_page_addr0(tb) == -1) { + assert_no_pages_locked(); + return tb; + } + /* * No explicit memory barrier is required -- tb_link_page() makes the * TB visible in a consistent state. From patchwork Fri Jan 17 18:24:56 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 858256 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp844867wrb; Fri, 17 Jan 2025 10:33:01 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVi452XQQIlVsBY/ABusbpO2raNt6OyZUOcKQ5YfZYebM9JVAgCicZ1LaZ+YImlf/3bI2p/CQ==@linaro.org X-Google-Smtp-Source: AGHT+IE3l2JOPedQE6T4zDEWHD/JlxB/1W6yNPvZwPHPSkjkWELTLYnGf56ZWf07i90C+T3abNA1 X-Received: by 2002:ad4:4eab:0:b0:6d8:99cf:d2eb with SMTP id 6a1803df08f44-6e1b216cbbamr64723236d6.21.1737138780603; Fri, 17 Jan 2025 10:33:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737138780; cv=none; d=google.com; s=arc-20240605; b=TDaa83Ad3mC+Io5X0Yzf7fP2aCkPuQyJvuwDk/f/Dq/UCMMnf4v7yncjbdR363UPjv B8JucjgXJw3FykDXgYyTrdB6f5LLo0c9Y7UBWrNaLuBLVvATYtMrUkuDOdUA4fA8G9Cw aYUPEtaFTQXKXn1RCiCemMI3R0uLLpR6LkY3RzQ5tQzgYESp+Q5et+S17k9g6g4MsrqK jY/K8lLNb3BYuolGaiuqPT67J0EZanPtAfX63kQz6YPpXWE4w5Y/jLTEpns0Ihbdd9FT koxI4MgNry5zLFyCqn5XDoMLhWnDbxE0YsXEc9pNRrLpNOwlaMGSLheni6Wt/vlx75Sh 3x4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=GAiwkYkJhNlr+QIGt+u6tAyqiV7uHPYy+16J2GO4X34=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=i4zmZ1J8e9NWGEFH/R2Dea8pR2G4C5A8Nzgismd4/7PMOlh3kjL8CyfvhvkqFYXB5h hSeRL+19RSfSbqMrUBdmc5YCXPu5OjyLfSeKjiO2BxRf4f02TFjrc6JnNc2KR8V2GGNX yuiTTdpnW7oZbKJwXz1vT5OfEr/kSGW7v93AUwk8jlePX9mEK6DZbR53Gu1XVAMZM5Gg hQgscL3EKELMP07EmkrA6b4GAkyzRP24BYlwmPWecH9VQQyx+cbxK3tlnQ5SreQHDfeb Y2QERwjLc9Y2Se+wkLEksek68AFpWVo+rye8sz3I6KungzevXoSyTsuzVZzt5lglYyuY ucOw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HsfBVp2S; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6e1afc19e2csi30875106d6.116.2025.01.17.10.33.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 10:33:00 -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=HsfBVp2S; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYr6L-0000Wc-J3; Fri, 17 Jan 2025 13:29:49 -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 1tYr5p-0006KA-U9 for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:29:18 -0500 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYr5o-0000LL-4P for qemu-devel@nongnu.org; Fri, 17 Jan 2025 13:29:17 -0500 Received: by mail-pj1-x1030.google.com with SMTP id 98e67ed59e1d1-2ef72924e53so4221460a91.3 for ; Fri, 17 Jan 2025 10:29:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737138555; x=1737743355; 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=GAiwkYkJhNlr+QIGt+u6tAyqiV7uHPYy+16J2GO4X34=; b=HsfBVp2SyIyE5i2N/TV+AUFckmV0WK7bpN78XdNdppQz2O16ynrO2SkFOMOYWk2bhF ekEeqr+YmOv7t8GMPy7ZVb8sCgV2xpPNIyDIr3kkBhOaavVF0ZQTaqzNpbCI0r1oXIaK EMX8D+ecLWaKqvW6olySImq8xGHClW8MpTwWGwL8CYxkKwLceIfJg7fHlqzgMDPHp5P3 pEUiRrbGqItuyj73n30JwSvWlSJe4B0Nbn0ONd+0RSR9c1S9PB9hlmoJr783wAR74/IJ jNM/hw0R0n6idRxdGtMW0uuwUQE8v6xr6BOn/zMx7onFwbraCt8aOm0T0jZudsnHS1gG MS8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737138555; x=1737743355; 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=GAiwkYkJhNlr+QIGt+u6tAyqiV7uHPYy+16J2GO4X34=; b=oQEHHy3x+Ib2sCVdWqdRHDbPYobFIVWQtyEZUjrbN+CN0I9fbV1QNxPBS3h1zmbOE/ 4F/dqOshF7P8Vu2G8EGW7alLGhSP6ikQeNzqzCjPQQ2CBzlNMNTUSUGRt6wtc125IlDM qoye6mJumEK/1dg2npU+33P+YJiAtNIEgbjvBzfONREIVhPqD6wFuf/XazXkPSCQsc8a JJgMZeggVm91Ld3zYzVnt3pi/JYlq1D7oCOP6GgwCAUM6Z7ij7TdKhC6ZcJH3O7US/I3 9jH8/pcwM1HTSkR3aHzYOr+MHfYNJHfArQE1U9GO8tITX56CNWaBbH952aSlbzW0OwPz eccw== X-Gm-Message-State: AOJu0Ywcza2hHP44xl12+w0cEIFUjK3cm5mpndR+7L06plpgYfxJKb+V /fBuwgsjwOrEwCk2+AOe3MSEzvsaag8Ggv3tVWjV8XDKN6zUD09dn+ZCKgXuaaRt0fwzzDHxMMF f X-Gm-Gg: ASbGncsHoss7GZXQ5zvpBJNRJJmJWWfvrSlDprPFgyp0r3XKksNqfpHeeJe5sXEj9Ou g3KcV+OrXB85G69H0b6wjZJDOFOixiiejsLnvxJoIOrRxzIUtO+5BRTgfMND9jkMid3AnKIEqkX /PefZR2Wb+ndHe7HOWLqr3GU+FcTEh/v3rBIetFlzlQallSWGOl8qxA9VLbzmuNPaIPNS9TG1gW ucB41midQt3ULuVBlxh85VHfjffAZciz06g1Z6K8XApH91e2eSJSqES3nhTMe/KN7VRWW6pAGZS 2sZ1QAZkh+CD4Y8= X-Received: by 2002:a17:90b:1f91:b0:2ee:45fd:34f2 with SMTP id 98e67ed59e1d1-2f782c62983mr4984856a91.6.1737138554829; Fri, 17 Jan 2025 10:29:14 -0800 (PST) Received: from stoup.. (174-21-71-127.tukw.qwest.net. [174.21.71.127]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f77629bf96sm2614105a91.36.2025.01.17.10.29.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 10:29:14 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 68/68] softfloat: Constify helpers returning float_status field Date: Fri, 17 Jan 2025 10:24:56 -0800 Message-ID: <20250117182456.2077110-69-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250117182456.2077110-1-richard.henderson@linaro.org> References: <20250117182456.2077110-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1030; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1030.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: Philippe Mathieu-Daudé These helpers don't alter float_status. Make it const. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Signed-off-by: Richard Henderson Message-ID: <20250116214359.67295-1-philmd@linaro.org> --- include/fpu/softfloat-helpers.h | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/include/fpu/softfloat-helpers.h b/include/fpu/softfloat-helpers.h index dceee23c82..4cb30a4822 100644 --- a/include/fpu/softfloat-helpers.h +++ b/include/fpu/softfloat-helpers.h @@ -124,58 +124,61 @@ static inline void set_no_signaling_nans(bool val, float_status *status) status->no_signaling_nans = val; } -static inline bool get_float_detect_tininess(float_status *status) +static inline bool get_float_detect_tininess(const float_status *status) { return status->tininess_before_rounding; } -static inline FloatRoundMode get_float_rounding_mode(float_status *status) +static inline FloatRoundMode get_float_rounding_mode(const float_status *status) { return status->float_rounding_mode; } -static inline int get_float_exception_flags(float_status *status) +static inline int get_float_exception_flags(const float_status *status) { return status->float_exception_flags; } static inline FloatX80RoundPrec -get_floatx80_rounding_precision(float_status *status) +get_floatx80_rounding_precision(const float_status *status) { return status->floatx80_rounding_precision; } -static inline Float2NaNPropRule get_float_2nan_prop_rule(float_status *status) +static inline Float2NaNPropRule +get_float_2nan_prop_rule(const float_status *status) { return status->float_2nan_prop_rule; } -static inline Float3NaNPropRule get_float_3nan_prop_rule(float_status *status) +static inline Float3NaNPropRule +get_float_3nan_prop_rule(const float_status *status) { return status->float_3nan_prop_rule; } -static inline FloatInfZeroNaNRule get_float_infzeronan_rule(float_status *status) +static inline FloatInfZeroNaNRule +get_float_infzeronan_rule(const float_status *status) { return status->float_infzeronan_rule; } -static inline uint8_t get_float_default_nan_pattern(float_status *status) +static inline uint8_t get_float_default_nan_pattern(const float_status *status) { return status->default_nan_pattern; } -static inline bool get_flush_to_zero(float_status *status) +static inline bool get_flush_to_zero(const float_status *status) { return status->flush_to_zero; } -static inline bool get_flush_inputs_to_zero(float_status *status) +static inline bool get_flush_inputs_to_zero(const float_status *status) { return status->flush_inputs_to_zero; } -static inline bool get_default_nan_mode(float_status *status) +static inline bool get_default_nan_mode(const float_status *status) { return status->default_nan_mode; }