From patchwork Fri Oct 21 07:15:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 617140 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp821508pvb; Fri, 21 Oct 2022 01:34:20 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5EEeCsneZF1lh/NM4aWup8muehqUSiVk1pJZMI8EfoffFxFuNmairBLMOtp8luKsaNlCOZ X-Received: by 2002:a05:620a:4712:b0:6ee:d23c:326e with SMTP id bs18-20020a05620a471200b006eed23c326emr12803280qkb.340.1666341260680; Fri, 21 Oct 2022 01:34:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666341260; cv=none; d=google.com; s=arc-20160816; b=WgpTyLJh1VxxlcyhrhcijzIkdU69WM+4+vF6Gvzxlrm/0hHYz+riZamJyZb7UZC0Jw IKXCqGzUryTubi0xJBX10T8KlJ7bBixhhLbQ7+gvGA9sxNabuSS1aZx84nM13iaTdisT iao5w7QlYGDM6eMaqn9pnzCX5s/HatnZ6NV5yH7GpxOArdipel2jaDJ77gu9D/YKAnVN 9BMD3vuCRhsUmqtGdmJrwpQlGsKuyU8A1Vcp8XTiBkSSsVHdUXh0jnU0MFmrZp9BqDlH Hsx5/fwFNgisB8hoLCfNPeOzn7GhXMs1ejK/ZVPnDCsX8jQExQZWlrRBvFxGNtWIq1sW uPmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=JuYObXlFmz1SmrGQdE1r0MOoxWD6WYua5nMC/+UaBVA=; b=YY3OAZSGriFbXNrOppwY95+M5OcuyLKb2ROpPmPQx+ZLzT8PwmkM2fHs5BGASZD0KK c1vm8p+18yejSBVa6qw+18FXDGDGi7gaoH9sMm3jOThp26RoXstRPTicZ1JVJ08lejEd 5Ih/dLA3OWk5B85iVd/Aio9s3Ns7DTvNI/O8ZY2CK523YXJSj/xSu6tcyhmBptqQuqjK zvVKRol2hA0tZTBD16z2lXEYSrr6HJ3SKwvGNr6AJuHLWlX0i8c7kuJi3/bxNthFTRRH bAj8p2nK3i3FVsrvy12J1Ekb6dmqK5D5/1Jny/77WmEySJteUBwP8Re+iZBBcbAjDPxg BKaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fNqdUS16; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id t23-20020a37ea17000000b006eae0f39c0esi11693350qkj.549.2022.10.21.01.34.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 21 Oct 2022 01:34:20 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fNqdUS16; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1olnTt-00033w-CV for patch@linaro.org; Fri, 21 Oct 2022 04:34:20 -0400 Received: from [::1] (helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1olmHA-0003Ah-Qi for patch@linaro.org; Fri, 21 Oct 2022 03:17:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1olmH5-00039P-3h for qemu-devel@nongnu.org; Fri, 21 Oct 2022 03:16:59 -0400 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1olmH0-0005d3-P8 for qemu-devel@nongnu.org; Fri, 21 Oct 2022 03:16:58 -0400 Received: by mail-pj1-x102e.google.com with SMTP id ez6so1689430pjb.1 for ; Fri, 21 Oct 2022 00:16:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=JuYObXlFmz1SmrGQdE1r0MOoxWD6WYua5nMC/+UaBVA=; b=fNqdUS16CSPmNuUqAF51Na2aaujn8wyzVkoyTlQujG7W6D+887kBWLGgukONLCtCVP snNutcu3RSX7S5Ud/lw9ZKfx22XpsLDxeL0hEOPWMJ6Xq+jJsBOoUZhQcKM1V2wvI/PF n3l9OUbv0HKPWhlPRdkrFM0ixw+4sTAFGrwb3z0L4Le9dpumnU7Ko5tVGkNcNRFOmnUK lEWK9436B38Tpu3ejDBLqJpc/PEGE0n4yLC0v4FDzt2p/huFajx74WVctn5wwgIIUMyb j2qy2aq4+ZCKA1149POJOfLJpI1lTLPBoGG3lJm6terfSe0hpnNwFtAhaHQsBQIhnKtm QuKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=JuYObXlFmz1SmrGQdE1r0MOoxWD6WYua5nMC/+UaBVA=; b=Vq6kRpWWyc/1MkTxV3sYj42Jkya/+KbsxJlTQ0n6fy6+8l/WHObMA1fa8CkC0ic4yu QGqHZs6r5e5IcuNgHsAx2nczUu/Nv/5al2/XoDpeUalWASBWhA15GtGMW1sJRIzbeLeL /HV71dU4iHNjFGr1/gOmfOFDJrsH/tpNI+9Dugbq+2DJgbxyVuoQJR4qxsGd/+f1R+yK gtoxh8WYSqS4DqhtmC2Cu1eCnLmYykZW3sM4spH2a5QwWKoQf2Cfvpjm5RoIfRr8HL9Q TYpT4IQPK1fr1iUFCwMI144bOCU5B5A9FoJM9USGY1e+OFeifpjcaTyMJ+fKvNuA6oDO /6OQ== X-Gm-Message-State: ACrzQf22pTqwNiEvxCfnjoLaNYvSqq/uqV8v9xXMNn0b2RQUAepCTcXh UxULC4gksobJpq5Eh+L2sAcbvNQWMVGcIC9F X-Received: by 2002:a17:90b:4a84:b0:20d:8953:5ab0 with SMTP id lp4-20020a17090b4a8400b0020d89535ab0mr55825022pjb.48.1666336612792; Fri, 21 Oct 2022 00:16:52 -0700 (PDT) Received: from localhost.localdomain ([149.135.10.35]) by smtp.gmail.com with ESMTPSA id q9-20020a638c49000000b0041cd5ddde6fsm13003327pgn.76.2022.10.21.00.16.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Oct 2022 00:16:52 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 10/36] tcg: Move TCG_{LOW,HIGH} to tcg-internal.h Date: Fri, 21 Oct 2022 17:15:23 +1000 Message-Id: <20221021071549.2398137-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221021071549.2398137-1-richard.henderson@linaro.org> References: <20221021071549.2398137-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102e; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102e.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" Move the error-generating fallback from tcg-op.c, and replace "_link_error" with modern QEMU_ERROR markup. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/tcg/tcg.h | 12 ------------ tcg/tcg-internal.h | 14 ++++++++++++++ tcg/tcg-op.c | 10 +--------- 3 files changed, 15 insertions(+), 21 deletions(-) diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h index 5c2254ce9f..d207bc47be 100644 --- a/include/tcg/tcg.h +++ b/include/tcg/tcg.h @@ -737,18 +737,6 @@ static inline TCGv_vec temp_tcgv_vec(TCGTemp *t) return (TCGv_vec)temp_tcgv_i32(t); } -#if TCG_TARGET_REG_BITS == 32 -static inline TCGv_i32 TCGV_LOW(TCGv_i64 t) -{ - return temp_tcgv_i32(tcgv_i64_temp(t)); -} - -static inline TCGv_i32 TCGV_HIGH(TCGv_i64 t) -{ - return temp_tcgv_i32(tcgv_i64_temp(t) + 1); -} -#endif - static inline TCGArg tcg_get_insn_param(TCGOp *op, int arg) { return op->args[arg]; diff --git a/tcg/tcg-internal.h b/tcg/tcg-internal.h index cc82088d52..a9ea27f67a 100644 --- a/tcg/tcg-internal.h +++ b/tcg/tcg-internal.h @@ -59,4 +59,18 @@ static inline unsigned tcg_call_flags(TCGOp *op) return tcg_call_info(op)->flags; } +#if TCG_TARGET_REG_BITS == 32 +static inline TCGv_i32 TCGV_LOW(TCGv_i64 t) +{ + return temp_tcgv_i32(tcgv_i64_temp(t)); +} +static inline TCGv_i32 TCGV_HIGH(TCGv_i64 t) +{ + return temp_tcgv_i32(tcgv_i64_temp(t) + 1); +} +#else +extern TCGv_i32 TCGV_LOW(TCGv_i64) QEMU_ERROR("32-bit code path is reachable"); +extern TCGv_i32 TCGV_HIGH(TCGv_i64) QEMU_ERROR("32-bit code path is reachable"); +#endif + #endif /* TCG_INTERNAL_H */ diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c index 019fab00cc..3ed98ffa01 100644 --- a/tcg/tcg-op.c +++ b/tcg/tcg-op.c @@ -28,16 +28,8 @@ #include "tcg/tcg-op.h" #include "tcg/tcg-mo.h" #include "exec/plugin-gen.h" +#include "tcg-internal.h" -/* Reduce the number of ifdefs below. This assumes that all uses of - TCGV_HIGH and TCGV_LOW are properly protected by a conditional that - the compiler can eliminate. */ -#if TCG_TARGET_REG_BITS == 64 -extern TCGv_i32 TCGV_LOW_link_error(TCGv_i64); -extern TCGv_i32 TCGV_HIGH_link_error(TCGv_i64); -#define TCGV_LOW TCGV_LOW_link_error -#define TCGV_HIGH TCGV_HIGH_link_error -#endif void tcg_gen_op1(TCGOpcode opc, TCGArg a1) {