From patchwork Sat Jun 19 18:14:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 463890 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:102:0:0:0:0 with SMTP id x2csp1045429jao; Sat, 19 Jun 2021 11:15:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxuEsRVfbU+4GhTLJW2u2+3f/miHkN231b4BJdauRiTZ1Ts8Zfo8uvWu6Uh/5BjBPjGcH6q X-Received: by 2002:ab0:140e:: with SMTP id b14mr17075521uae.94.1624126548058; Sat, 19 Jun 2021 11:15:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624126548; cv=none; d=google.com; s=arc-20160816; b=vj1ASulg5xnr0ZSltAFkr5aOr2Asdm5nmJUb22cLAmL7jIoQyIflGoWKvueog17KpB K1+EKfkaveq09PXswfCHcEBP0yWxDDBhIqdpmtw3lXVFp5/idgfnR2FypNONnvVsb+Xf JhDrch+HIAPtyw8MQiA3U3//P+cbw+kPYneOga/n9RFUxwf6oTDsIUKRpUP/+U31iU0f bJiG0N8dcDGyA3cRS6hQ0nh4rScpCQ2xAatJ7a+TnzMy8vy7OfPktYZdUDM4X7jfvipg fEwD5Tax8o3awD9kam8elD3aDGRvyjuIvY7cjBlljOOLMj58yagWIh1A6kxAU8qyVtB1 MKrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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=M6WR/q/XMRsg+9/4YpwLpIga2lF+a4ZN740h5QwBqxQ=; b=pb/OO3eaRIskND6b1ypLO9DFvtmncpUJIvBPI7BPHJfe5UfO9j8u6QqPETHtToLYro WHLvmhjbDneMpOY+pHvmt66l3id5XuUjoYW5fshtmDL3k0LFVNrLyvvzOnhIUc/gm5Wd UUdilvc75AO8PINmlMkuuVNmvEsFYsmYHwdHR91TVW+yjkSBwNWHTru3hWZuGVw0urJw bfdvh0U2MZeqz+FAv9bwTKDtBZOqrXA1WMT/x0xMoF2v4Y9zh4JW1sYctwQf7JTaJ+Fs qRolHOzHZZ7Y+EgjgNjfG5X/qQas+VPVdNPnLIRpplGkbTuHd9szfv9wr4x2Cp8CYb+C TNKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aMXVnWd5; 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 s23si8188709vsn.284.2021.06.19.11.15.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 19 Jun 2021 11:15:48 -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=aMXVnWd5; 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]:57858 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lufVT-0000hC-B8 for patch@linaro.org; Sat, 19 Jun 2021 14:15:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35762) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lufUi-0000fP-Bm for qemu-devel@nongnu.org; Sat, 19 Jun 2021 14:15:00 -0400 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]:37795) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lufUg-0002Eb-N6 for qemu-devel@nongnu.org; Sat, 19 Jun 2021 14:15:00 -0400 Received: by mail-pf1-x430.google.com with SMTP id w71so334886pfd.4 for ; Sat, 19 Jun 2021 11:14:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=M6WR/q/XMRsg+9/4YpwLpIga2lF+a4ZN740h5QwBqxQ=; b=aMXVnWd56iSrYam62Ts1D8MZVDqvi51XYiGcbsMMZja+05Q6/MPHkPC08/kYQIrCRh LOn17q9UTq5KTCykPty9lH0bZjqcbLSDvKX7W1zw0G4hXeOB5IUBBeEy1avdXIVxNCvp c4JXWtQVcR87NOioYr7qVIxSu9BuCzB1ieclHuGGPWX/zETqlynuNNP0s09Hw+FHoKBm JTxNqCv0HT0H1xFQHAv1Rcm7Yup8ovN3A7G+sN+WstDT9hmesb7jHi/hdwSIwQzlGT8Z JK0gEHA+edFn1mYCfqlr5AF1VPT5VMP5iFb55jQDrN3UcXLhiz19Z8NhkmW8suM+XB/q jc3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=M6WR/q/XMRsg+9/4YpwLpIga2lF+a4ZN740h5QwBqxQ=; b=a6Exac0j7kc+Q11/6ZNqNL2/dOYhmHEfzwgCV5k3HQ3TR8ynbTxZk+WGrqrs5WbPWf tGoGMEd0yb1wTnms8XExnPdAkR0gkeYxH/9O1F8BCA+aTimo9WSY51YpPFFq8tbnHAD0 yAOUMG7sZQ6qmK/COeXPAvEEnB8cxPkPgiCmfwiqxsZaTkTUylTiWaMjHtArmuy2KLQv RCybMi85RPtWIfNfUCNPKerPYHJnNHWgGq4Qbu0iw+X2KmJzzKgqYSr3nCJ0aAZzES8D b5vmXMHLatQf2tzrDYTsYPUn0HKQL25ECAF2a9OOLuRXj6+jpAe6H9D+B/nYFYMXw4lH y0fA== X-Gm-Message-State: AOAM531BpThFOGPCEcscdZRzVeG8+DtfRnaqOvduxO2IMu82rER+s+XK jS8tC2CXD1Np1Ww9d/RcgOTzMgd69mEbaQ== X-Received: by 2002:a63:d409:: with SMTP id a9mr16044437pgh.304.1624126497342; Sat, 19 Jun 2021 11:14:57 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id k35sm12059113pgi.21.2021.06.19.11.14.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Jun 2021 11:14:57 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 07/33] tcg: Add tcg_call_func Date: Sat, 19 Jun 2021 11:14:26 -0700 Message-Id: <20210619181452.877683-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210619181452.877683-1-richard.henderson@linaro.org> References: <20210619181452.877683-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::430; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x430.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/tcg-internal.h | 5 +++++ tcg/tcg.c | 5 ++--- 2 files changed, 7 insertions(+), 3 deletions(-) -- 2.25.1 diff --git a/tcg/tcg-internal.h b/tcg/tcg-internal.h index 6ab8910210..92c91dcde9 100644 --- a/tcg/tcg-internal.h +++ b/tcg/tcg-internal.h @@ -44,6 +44,11 @@ bool tcg_region_alloc(TCGContext *s); void tcg_region_initial_alloc(TCGContext *s); void tcg_region_prologue_set(TCGContext *s); +static inline void *tcg_call_func(TCGOp *op) +{ + return (void *)(uintptr_t)op->args[TCGOP_CALLO(op) + TCGOP_CALLI(op)]; +} + static inline const TCGHelperInfo *tcg_call_info(TCGOp *op) { return (void *)(uintptr_t)op->args[TCGOP_CALLO(op) + TCGOP_CALLI(op) + 1]; diff --git a/tcg/tcg.c b/tcg/tcg.c index 0dc99cc65b..8f4f1711cd 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -1740,7 +1740,7 @@ static void tcg_dump_ops(TCGContext *s, bool have_prefs) } } else if (c == INDEX_op_call) { const TCGHelperInfo *info = tcg_call_info(op); - void *func; + void *func = tcg_call_func(op); /* variable number of arguments */ nb_oargs = TCGOP_CALLO(op); @@ -1754,7 +1754,6 @@ static void tcg_dump_ops(TCGContext *s, bool have_prefs) * Note that plugins have a template function for the info, * but the actual function pointer comes from the plugin. */ - func = (void *)(uintptr_t)op->args[nb_oargs + nb_iargs]; if (func == info->func) { col += qemu_log("%s", info->name); } else { @@ -3789,7 +3788,7 @@ static void tcg_reg_alloc_call(TCGContext *s, TCGOp *op) int allocate_args; TCGRegSet allocated_regs; - func_addr = (tcg_insn_unit *)(intptr_t)op->args[nb_oargs + nb_iargs]; + func_addr = tcg_call_func(op); flags = tcg_call_flags(op); nb_regs = ARRAY_SIZE(tcg_target_call_iarg_regs);