From patchwork Tue Nov 2 18:25:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 516703 Delivered-To: patch@linaro.org Received: by 2002:ad5:5208:0:0:0:0:0 with SMTP id p8csp4880274iml; Tue, 2 Nov 2021 11:45:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6lfZ7e4j9anfQJYg+7RV0swoLPcTlRCd+fBv/470AE/4aXk6tS37iCbuGTqNhtjCkA2qW X-Received: by 2002:a9d:75d1:: with SMTP id c17mr24109593otl.304.1635878725978; Tue, 02 Nov 2021 11:45:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635878725; cv=none; d=google.com; s=arc-20160816; b=N77dIk6N2vnjzHBe1Hc37ED+MF/5eqQFuYh7VSNE9TdUDcwnom+CvDcDm3/vvldnCP /JxdcIajnpmvi7XPWjfiszMzwBWLVzxUgKzO15dVKcVHNO2ajeXWEWdjvc5Me0jrjJ1F c62IUDrZG6ve7Jajy4aFR2dPmYmmXgiUQCQleVY1OR1Rbq8ei3pf3RRTA47G+vN/fKse rQx1lymaGfynf5eWtG59BI4rS/1UBlisdwn+tHxm59KW/3QEOj2b/vDxQo8D6LbE6v7I Zd/CifYf7V85ThKaX9Y5SAvhrp+S9jbYIf0OUud9ES/nV2L21gK7RD2IkF2m/93e0sYp uXnA== 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=kgIAZfpBiG9Bp0aRLB9BDRfUW43JbXvDwVrmE2eY/v8=; b=S8SYwrKw5AuBXpgDpmLtcV0VDAPU+9NzFYra24Zv2wC33H7AFr1fvrB4MiwmBoawEf 9yO+PzS9F0MPStGSmK6Ezxm5vcsJ2BPcVrHsE9CYSAoVCQcwO1j8ZpYn3zPZTUDFwFol 7VQW29thUjKoMX09kx9fGRMmoTz/qZIE7yWQKX4GldT5qS2rLd1Be/5OFNWD9AYMWAhF K+gVUw16B5vVUvMzr6ajDDUqMVNaaIP+dP+p5iMiXa/NK9X2Uy155wx4UYj+pJHCKTAd jzqG2wCstw3Q1B3VTKu3pKF8/ZoGU61wLs/A7AODrYhd4AM/RSFsz+ptx1ZvPDAHWbcj xOwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QvBYPJ9e; 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 e25si19858706oth.342.2021.11.02.11.45.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 02 Nov 2021 11:45:25 -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=QvBYPJ9e; 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]:49458 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mhymj-00019M-DT for patch@linaro.org; Tue, 02 Nov 2021 14:45:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38766) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mhyTV-0005pE-If for qemu-devel@nongnu.org; Tue, 02 Nov 2021 14:25:37 -0400 Received: from mail-qk1-x734.google.com ([2607:f8b0:4864:20::734]:41524) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mhyTO-0004Du-6l for qemu-devel@nongnu.org; Tue, 02 Nov 2021 14:25:31 -0400 Received: by mail-qk1-x734.google.com with SMTP id br39so7352931qkb.8 for ; Tue, 02 Nov 2021 11:25:25 -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=kgIAZfpBiG9Bp0aRLB9BDRfUW43JbXvDwVrmE2eY/v8=; b=QvBYPJ9eP9HDjBTYk4pWXVBzsgnGUrcMi64W9WJ3B0vUXOA9pUjmBUkPdKALZZpCuI jxpxXcUByY6iiWHiZ7K+Xfzz3P0l7mZb3UVeiAe+3VKWWrmYXVx2LmpRqX64YVRP/aAZ 7T2qDEBLU/2p9cQI5flMXzVQc11kHXu7dTDmUiBLc7u71vGTcx0mpWeZBPZSwr9jmPcu FNeaE0vQdudI4YlHzak/K/bv3E3nVKFxHelBl7nLJI0eRHeplmu2Vl/EjhKa2FQEYTtA ia/qf4Y6LBuVMwaXKWjhH8nQarp7WybFtrr8Que6eZFbbt49iSlaZKfEHvSXMS8T+bRx 0tAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kgIAZfpBiG9Bp0aRLB9BDRfUW43JbXvDwVrmE2eY/v8=; b=199vet8K3ocbDvc+pLow8YIdaKKYEAgNMkvkYS+K5kvvqJO3MkXrzAgVXgxiUmkDd7 hwuWK9yoAJrvRpFkgOYpa4mRbiN0mCcBPBrMyQ+FRisUkxpHU/e5L93ztH1GDWCbEqNm YnD8v/JqdrCZDsF37HEBsDTnVMZ2ACXpPzVuA9Eu68gjmgGBa3SzssAIIC5lrfk3P0Eq uIWq91G50kIARCTU2J0IBix77V/SJQSTamLflIfyd3bjVyMfzjo9rl0oy4ohIrrDYL0G v94kA7q3DXZ3ob3EswgJcrjYPQ4mKTu516D4vgzX3LPySmMUfrTumBQrDhr8YDbpTRR1 f8HQ== X-Gm-Message-State: AOAM532hbi+BDCUk0LLvIBiLMTD3ac/4o7K/dNiwbArOOlxjwj3FNZy0 op7r3ea60n5tNKNiRliIfaYswTFDkrB0yA== X-Received: by 2002:a37:b386:: with SMTP id c128mr30251021qkf.426.1635877525259; Tue, 02 Nov 2021 11:25:25 -0700 (PDT) Received: from localhost.localdomain (rrcs-172-254-253-57.nyc.biz.rr.com. [172.254.253.57]) by smtp.gmail.com with ESMTPSA id y9sm13701081qko.74.2021.11.02.11.25.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Nov 2021 11:25:24 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL v2 07/12] target/arm: Introduce store_cpu_field_constant() helper Date: Tue, 2 Nov 2021 14:25:14 -0400 Message-Id: <20211102182519.320319-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211102182519.320319-1-richard.henderson@linaro.org> References: <20211102182519.320319-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::734; envelope-from=richard.henderson@linaro.org; helo=mail-qk1-x734.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: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Similarly to the store_cpu_field() helper which takes a TCG temporary, store its value to the CPUState, introduce the store_cpu_field_constant() helper which store a constant to CPUState (without using any TCG temporary). Suggested-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20211029231834.2476117-3-f4bug@amsat.org> Signed-off-by: Richard Henderson --- target/arm/translate-a32.h | 3 +++ 1 file changed, 3 insertions(+) -- 2.25.1 diff --git a/target/arm/translate-a32.h b/target/arm/translate-a32.h index 88f15df60e..17af8dc95a 100644 --- a/target/arm/translate-a32.h +++ b/target/arm/translate-a32.h @@ -70,6 +70,9 @@ static inline void store_cpu_offset(TCGv_i32 var, int offset) #define store_cpu_field(var, name) \ store_cpu_offset(var, offsetof(CPUARMState, name)) +#define store_cpu_field_constant(val, name) \ + tcg_gen_st_i32(tcg_constant_i32(val), cpu_env, offsetof(CPUARMState, name)) + /* Create a new temporary and set it to the value of a CPU register. */ static inline TCGv_i32 load_reg(DisasContext *s, int reg) {