From nobody Sat Nov 23 23:32:01 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1728857613; cv=none; d=zohomail.com; s=zohoarc; b=OUk9MUoVVVirONm4E5RdbOCPR/VyTK+tXqSmJUAUqbUUK7U1WZFsCwwsU8nplC1Cd54VYEOMXdC4N/wJUHLXqW/9Z7MWogXPHvpTmOJ5JDNX81HGRsIjvHNRg3a2yIXcHJKF/o5z4cJdNmzu429zROAr4PxYAo1+MeAaBIIhksE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728857613; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=VxQQDPF3XbwGQMMjEi8JT0LcRz4F5ymP0/tmO2RuJRo=; b=O0fIyCnRv+WUGcGWsevcYDNtgD5UYea/iZ5ayC+bbYsB7azjE/oiB4+RVcyhp/cy1CZuzUhZegI4N6al1vQTyaBkAyLM1vVjPfG8SS1QtVbnrYlcBA//hJIrAabP7NIAmAybUmDx5tlZKCIAHo8+5WvtFgWhUTRfs7kfv5p0tCI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1728857613079307.0220734583287; Sun, 13 Oct 2024 15:13:33 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t06pc-0007BC-Fb; Sun, 13 Oct 2024 18:12:56 -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 1t06pX-00079v-Ap for qemu-devel@nongnu.org; Sun, 13 Oct 2024 18:12:53 -0400 Received: from mail-pg1-x52a.google.com ([2607:f8b0:4864:20::52a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t06pU-0000ux-Q4 for qemu-devel@nongnu.org; Sun, 13 Oct 2024 18:12:50 -0400 Received: by mail-pg1-x52a.google.com with SMTP id 41be03b00d2f7-7ea8c4ce232so174252a12.0 for ; Sun, 13 Oct 2024 15:12:47 -0700 (PDT) Received: from stoup.. (174-21-81-121.tukw.qwest.net. [174.21.81.121]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e2d5df1eebsm7271958a91.17.2024.10.13.15.12.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Oct 2024 15:12:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728857567; x=1729462367; 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=VxQQDPF3XbwGQMMjEi8JT0LcRz4F5ymP0/tmO2RuJRo=; b=ONaBSjLgrd13zmFhvVFjMYqZjGYQTn4nKm1prv+AZq5H9lWeAJI+8Ptr/Cx/N4lKaa QKT6NNClF4vKZy57ptqjiEG0YsjH6pH1GMc3U8M7NaQ1apyxA6tXme9+xPXDVapqG3wi 22I15AmdkBqB1M4kmPTj0MQ3PFluCLVHsZt4ut5yWxZP1lcaC84XWRf467WRoFDclbPT d3mrEiW6Duw+jUSjSZvjaWAYl+R8Z9rM3WKCB2rpB8xU2z1B3sBPHVKwLRAdxqU3kD7w +Nx48QID0hltwSiIc5gyg+hUJ7sk8NO6mt9ApAjSx4FVhCXEDzt5/unJ5UCPVXvN1+g5 LquA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728857567; x=1729462367; 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=VxQQDPF3XbwGQMMjEi8JT0LcRz4F5ymP0/tmO2RuJRo=; b=PIdwKH8vOLiWA4xNVr8WWPhWYQ8ohtObsm6HErUNSkZfC+Ols0mxeMMkeuCMYw0Es3 71ghtRSWrpgYQ5DEcTaC8W1ziiUAaoA0027uYNcMMromMPQFEKRz3EXvWQka0RHp4tUL 69J3Am8k6EJh1ldeNAGyA/h0jv3QIsVDRwE3944W3KmnQRpsLEzRviLsUWpJ5FdIrUHF nq/MAF6shHSTee4Wzc+pfIhMcE4c32EFMo/5jhy+J4By86hwIChVomtrHYdRmr6MG0jR SpojIfaCJCdqGsUnSHn7r6FSAklf6WPYa84wM/bgwR9ri/5pzdo9KfGAh6UNvT1qI6p9 LAow== X-Gm-Message-State: AOJu0Yz3lqJn2YOOc0xgfTghDePW2JJ/UWnTLecWEo99eMswwixlYD02 lF0UUludpafNMLWpdSGpiAzteVlHXvHSkFsz7DZmECQWSzW1IPL+FqkUflgDiy2boSPjcEbLtcH e X-Google-Smtp-Source: AGHT+IGPowYwaoawTjLXnJZj2jmig5ndMdIDsq5xhuFS5wUQFAJxS1q3dz2/FIs3frfa+ikQsVamwQ== X-Received: by 2002:a17:90b:1005:b0:2e2:e0c1:4452 with SMTP id 98e67ed59e1d1-2e31539036fmr7425969a91.41.1728857566627; Sun, 13 Oct 2024 15:12:46 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Helge Deller , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Maydell Subject: [PULL 10/27] include/exec/memop: Rename get_alignment_bits Date: Sun, 13 Oct 2024 15:12:18 -0700 Message-ID: <20241013221235.1585193-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241013221235.1585193-1-richard.henderson@linaro.org> References: <20241013221235.1585193-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::52a; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52a.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1728857613827116600 Rename to use "memop_" prefix, like other functions that operate on MemOp. Reviewed-by: Helge Deller Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- include/exec/memop.h | 4 ++-- accel/tcg/cputlb.c | 4 ++-- accel/tcg/user-exec.c | 4 ++-- target/arm/tcg/translate-a64.c | 4 ++-- target/xtensa/translate.c | 2 +- tcg/tcg-op-ldst.c | 6 +++--- tcg/tcg.c | 2 +- tcg/arm/tcg-target.c.inc | 4 ++-- tcg/sparc64/tcg-target.c.inc | 2 +- 9 files changed, 16 insertions(+), 16 deletions(-) diff --git a/include/exec/memop.h b/include/exec/memop.h index 97720a8ee7..f53bf618c6 100644 --- a/include/exec/memop.h +++ b/include/exec/memop.h @@ -171,12 +171,12 @@ static inline bool memop_big_endian(MemOp op) } =20 /** - * get_alignment_bits + * memop_alignment_bits: * @memop: MemOp value * * Extract the alignment size from the memop. */ -static inline unsigned get_alignment_bits(MemOp memop) +static inline unsigned memop_alignment_bits(MemOp memop) { unsigned a =3D memop & MO_AMASK; =20 diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index fd6459b695..a975fe5f89 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -1709,7 +1709,7 @@ static bool mmu_lookup(CPUState *cpu, vaddr addr, Mem= OpIdx oi, tcg_debug_assert(l->mmu_idx < NB_MMU_MODES); =20 /* Handle CPU specific unaligned behaviour */ - a_bits =3D get_alignment_bits(l->memop); + a_bits =3D memop_alignment_bits(l->memop); if (addr & ((1 << a_bits) - 1)) { cpu_unaligned_access(cpu, addr, type, l->mmu_idx, ra); } @@ -1797,7 +1797,7 @@ static void *atomic_mmu_lookup(CPUState *cpu, vaddr a= ddr, MemOpIdx oi, { uintptr_t mmu_idx =3D get_mmuidx(oi); MemOp mop =3D get_memop(oi); - int a_bits =3D get_alignment_bits(mop); + int a_bits =3D memop_alignment_bits(mop); uintptr_t index; CPUTLBEntry *tlbe; vaddr tlb_addr; diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c index 11b6d45e90..51b2c16dbe 100644 --- a/accel/tcg/user-exec.c +++ b/accel/tcg/user-exec.c @@ -954,7 +954,7 @@ void page_reset_target_data(target_ulong start, target_= ulong last) { } static void *cpu_mmu_lookup(CPUState *cpu, vaddr addr, MemOp mop, uintptr_t ra, MMUAccessType type) { - int a_bits =3D get_alignment_bits(mop); + int a_bits =3D memop_alignment_bits(mop); void *ret; =20 /* Enforce guest required alignment. */ @@ -1236,7 +1236,7 @@ static void *atomic_mmu_lookup(CPUState *cpu, vaddr a= ddr, MemOpIdx oi, int size, uintptr_t retaddr) { MemOp mop =3D get_memop(oi); - int a_bits =3D get_alignment_bits(mop); + int a_bits =3D memop_alignment_bits(mop); void *ret; =20 /* Enforce guest required alignment. */ diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 071b6349fc..ec0b1ee252 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -294,7 +294,7 @@ static TCGv_i64 gen_mte_check1_mmuidx(DisasContext *s, = TCGv_i64 addr, desc =3D FIELD_DP32(desc, MTEDESC, TBI, s->tbid); desc =3D FIELD_DP32(desc, MTEDESC, TCMA, s->tcma); desc =3D FIELD_DP32(desc, MTEDESC, WRITE, is_write); - desc =3D FIELD_DP32(desc, MTEDESC, ALIGN, get_alignment_bits(memop= )); + desc =3D FIELD_DP32(desc, MTEDESC, ALIGN, memop_alignment_bits(mem= op)); desc =3D FIELD_DP32(desc, MTEDESC, SIZEM1, memop_size(memop) - 1); =20 ret =3D tcg_temp_new_i64(); @@ -326,7 +326,7 @@ TCGv_i64 gen_mte_checkN(DisasContext *s, TCGv_i64 addr,= bool is_write, desc =3D FIELD_DP32(desc, MTEDESC, TBI, s->tbid); desc =3D FIELD_DP32(desc, MTEDESC, TCMA, s->tcma); desc =3D FIELD_DP32(desc, MTEDESC, WRITE, is_write); - desc =3D FIELD_DP32(desc, MTEDESC, ALIGN, get_alignment_bits(singl= e_mop)); + desc =3D FIELD_DP32(desc, MTEDESC, ALIGN, memop_alignment_bits(sin= gle_mop)); desc =3D FIELD_DP32(desc, MTEDESC, SIZEM1, total_size - 1); =20 ret =3D tcg_temp_new_i64(); diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c index 75b7bfda4c..f4da4a40f9 100644 --- a/target/xtensa/translate.c +++ b/target/xtensa/translate.c @@ -521,7 +521,7 @@ static MemOp gen_load_store_alignment(DisasContext *dc,= MemOp mop, mop |=3D MO_ALIGN; } if (!option_enabled(dc, XTENSA_OPTION_UNALIGNED_EXCEPTION)) { - tcg_gen_andi_i32(addr, addr, ~0 << get_alignment_bits(mop)); + tcg_gen_andi_i32(addr, addr, ~0 << memop_alignment_bits(mop)); } return mop; } diff --git a/tcg/tcg-op-ldst.c b/tcg/tcg-op-ldst.c index 23dc807f11..a318011229 100644 --- a/tcg/tcg-op-ldst.c +++ b/tcg/tcg-op-ldst.c @@ -45,7 +45,7 @@ static void check_max_alignment(unsigned a_bits) =20 static MemOp tcg_canonicalize_memop(MemOp op, bool is64, bool st) { - unsigned a_bits =3D get_alignment_bits(op); + unsigned a_bits =3D memop_alignment_bits(op); =20 check_max_alignment(a_bits); =20 @@ -559,7 +559,7 @@ static void tcg_gen_qemu_ld_i128_int(TCGv_i128 val, TCG= Temp *addr, TCGv_i64 ext_addr =3D NULL; TCGOpcode opc; =20 - check_max_alignment(get_alignment_bits(memop)); + check_max_alignment(memop_alignment_bits(memop)); tcg_gen_req_mo(TCG_MO_LD_LD | TCG_MO_ST_LD); =20 /* In serial mode, reduce atomicity. */ @@ -676,7 +676,7 @@ static void tcg_gen_qemu_st_i128_int(TCGv_i128 val, TCG= Temp *addr, TCGv_i64 ext_addr =3D NULL; TCGOpcode opc; =20 - check_max_alignment(get_alignment_bits(memop)); + check_max_alignment(memop_alignment_bits(memop)); tcg_gen_req_mo(TCG_MO_ST_LD | TCG_MO_ST_ST); =20 /* In serial mode, reduce atomicity. */ diff --git a/tcg/tcg.c b/tcg/tcg.c index 34e3056380..5decd83cf4 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -5506,7 +5506,7 @@ static void tcg_reg_alloc_call(TCGContext *s, TCGOp *= op) static TCGAtomAlign atom_and_align_for_opc(TCGContext *s, MemOp opc, MemOp host_atom, bool allow_two= _ops) { - MemOp align =3D get_alignment_bits(opc); + MemOp align =3D memop_alignment_bits(opc); MemOp size =3D opc & MO_SIZE; MemOp half =3D size ? size - 1 : 0; MemOp atom =3D opc & MO_ATOM_MASK; diff --git a/tcg/arm/tcg-target.c.inc b/tcg/arm/tcg-target.c.inc index 3de5f50b62..56072d89a2 100644 --- a/tcg/arm/tcg-target.c.inc +++ b/tcg/arm/tcg-target.c.inc @@ -1587,7 +1587,7 @@ static void tcg_out_qemu_ld_direct(TCGContext *s, Mem= Op opc, TCGReg datalo, tcg_debug_assert((datalo & 1) =3D=3D 0); tcg_debug_assert(datahi =3D=3D datalo + 1); /* LDRD requires alignment; double-check that. */ - if (get_alignment_bits(opc) >=3D MO_64) { + if (memop_alignment_bits(opc) >=3D MO_64) { if (h.index < 0) { tcg_out_ldrd_8(s, h.cond, datalo, h.base, 0); break; @@ -1691,7 +1691,7 @@ static void tcg_out_qemu_st_direct(TCGContext *s, Mem= Op opc, TCGReg datalo, tcg_debug_assert((datalo & 1) =3D=3D 0); tcg_debug_assert(datahi =3D=3D datalo + 1); /* STRD requires alignment; double-check that. */ - if (get_alignment_bits(opc) >=3D MO_64) { + if (memop_alignment_bits(opc) >=3D MO_64) { if (h.index < 0) { tcg_out_strd_8(s, h.cond, datalo, h.base, 0); } else { diff --git a/tcg/sparc64/tcg-target.c.inc b/tcg/sparc64/tcg-target.c.inc index 176c98740b..32f9ec24b5 100644 --- a/tcg/sparc64/tcg-target.c.inc +++ b/tcg/sparc64/tcg-target.c.inc @@ -1133,7 +1133,7 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext= *s, HostAddress *h, * Otherwise, test for at least natural alignment and defer * everything else to the helper functions. */ - if (s_bits !=3D get_alignment_bits(opc)) { + if (s_bits !=3D memop_alignment_bits(opc)) { tcg_debug_assert(check_fit_tl(a_mask, 13)); tcg_out_arithi(s, TCG_REG_G0, addr_reg, a_mask, ARITH_ANDCC); =20 --=20 2.43.0