From patchwork Tue May 16 19:40:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 682434 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp23618wrt; Tue, 16 May 2023 13:05:09 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ78bwJzdZdRBEWgISKcsFiOsa54U7biLisY0mCzgXc9NS7QTOBB7o0dBxXmpDxsF6DDgvC2 X-Received: by 2002:adf:fe51:0:b0:306:42e2:5ec3 with SMTP id m17-20020adffe51000000b0030642e25ec3mr27934962wrs.6.1684267509771; Tue, 16 May 2023 13:05:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684267509; cv=none; d=google.com; s=arc-20160816; b=lA1VGCxL9EZcMvRbDMvxVZHTPCehfpGyxSk/RpFAw5P6mrd9AGQwQtsiZ6+BqnkKnn 666gPFh61DE/vPO5CxGJfIIsfRjPVwhV1c4m1X007ZhJ+hBdC/7hWuuIhTBA2RPyPH6z pStIaOBCPEcVIvmFKoPBStN5zdHp/375w76wc5Z/KLRKGELj1V6T1I6dp9vvnAKm9TsF m9JQNQqUnN4Nw4d1cloGcla+4xrj3HJqZcXXMS23l2vQ7obZYrnoj0eVC6wPbzBaraJd cxHmRUpgtEMlCOZqRn94asbsvxsyAcdXVQNOY6xoJiInUUcLm92NSuS3oxKTVsN9zeud X62Q== 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=xCSbl8AzjqW4VuvLznNno/mM1J8MuXTXHDdG/XTdZZU=; b=PuY5EaMQQRmtsbfVWB+uDw4cWWPZHfQGObSDjn5Ae1sBKkG/FWwwJXSgLPCEDTMRdG o+PHKHqf5LlXzUh3Nyd0QlJdQDKvFWsKF+LtKUHhrFh3vhF78jkCmrPsNHwSsLl/2/dP ohuz6pLF9ydXQUmr5gGQ6STPX0u0KMxnJOD0NMUzG36sUUU8vxrpQFPHCMjZBIU80MYc j1DYe2A6NXiq5F9phwZB/fvGdyqzohOBuwmHPa7FNyvLRkuSCnxIdduVb/0R7un2rmuo Lm9JkXT/fVi5w5b2IAWEjw8ZL/O0PLM8wEtT4LKaObllxS1DjSSAC6FlvwjDo1AambDg Q3ZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DT6ZwjWo; 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 l5-20020a5d6685000000b00307a83e9bdcsi213338wru.320.2023.05.16.13.05.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 May 2023 13:05:09 -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=DT6ZwjWo; 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=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pz0Yn-0006jc-3q; Tue, 16 May 2023 15:42:13 -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 1pz0Yk-0006iM-GQ for qemu-devel@nongnu.org; Tue, 16 May 2023 15:42:10 -0400 Received: from mail-pg1-x534.google.com ([2607:f8b0:4864:20::534]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pz0Yi-0002kQ-L5 for qemu-devel@nongnu.org; Tue, 16 May 2023 15:42:10 -0400 Received: by mail-pg1-x534.google.com with SMTP id 41be03b00d2f7-517ab9a4a13so13454554a12.1 for ; Tue, 16 May 2023 12:42:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684266128; x=1686858128; 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=xCSbl8AzjqW4VuvLznNno/mM1J8MuXTXHDdG/XTdZZU=; b=DT6ZwjWo5Ezs4rKy9K4/t+Uv+xYRCU2AnNNHb9yjt2TIQzeHd6FRxcxNym+cTDdrX0 W2HTZhuASzf2vOiBSzRR93IUr4D0vsw30aPYL5PU31IhGolb3bnZgloc1T2dk3a4KZ4D 05WbYMnpQzBpz9guMGWUG0QHeXJBYrK5KIsKFFkLa1cc/h8xGka/4zhz0sIs5UOd8fOE dntNlz1RhZ5rsnVNxIa2kp5pbk+1Qf3RRHkuDk/TGgLBdhbg+oKpGyIJJ/Lnw7bs1z3H CckbAyvC2ODS9DpC1z5lMxu/Udw/TJIzfIxyqenCEi6syclLriDUInmljTdAKXAsP0gx UlAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684266128; x=1686858128; 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=xCSbl8AzjqW4VuvLznNno/mM1J8MuXTXHDdG/XTdZZU=; b=hZUOHzLtuZokpo0NzVKJlDD09FQxMueAtdJc5QlFFd7Z2SNOXzhspVkJNhlkCu6p1t 29liI49RYeI9QqTKCaoEi1EnVNOO9K+p6QLkVDWBgFYSaSJR6sBX1LNS/P7+0fz0Fkv8 oFo8pGrtGAuCSZOh3EJtNqpJKiLdsE+ct3zYsVrJ2ZsqqrghYf/8dMy+If1Gp6upgv+l j18nUZQ6VNocYClVEVld7ukGOj5bSHSj8aRxd2YjIa5OyNr9FpM3FqejsT1In0JH+1pi h1ISlEukps+9s3l9ueBg9K8iBJ2v71TA+esabCaZjXR4v6EgxOxeQ7ujdJ/RV5yw0EVP g4PA== X-Gm-Message-State: AC+VfDyvabRQplt/3GnhQ5fOlB31WjaKNaANzothbNzbz4MLPkU3v1Sl XHDy+qhEqp18wUq3b+VFFV7R7OQ0ICQus9OE9Mk= X-Received: by 2002:a05:6a20:7295:b0:f2:ae03:4020 with SMTP id o21-20020a056a20729500b000f2ae034020mr45936061pzk.54.1684266127859; Tue, 16 May 2023 12:42:07 -0700 (PDT) Received: from stoup.. ([2602:ae:1598:4c01:ec81:440e:33a4:40b9]) by smtp.gmail.com with ESMTPSA id z21-20020aa791d5000000b006260526cf0csm13771165pfa.116.2023.05.16.12.42.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 May 2023 12:42:07 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 23/80] tcg/sparc64: Rename tcg_out_movi_imm13 to tcg_out_movi_s13 Date: Tue, 16 May 2023 12:40:48 -0700 Message-Id: <20230516194145.1749305-24-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230516194145.1749305-1-richard.henderson@linaro.org> References: <20230516194145.1749305-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::534; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x534.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, T_SCC_BODY_TEXT_LINE=-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 Emphasize that the constant is signed. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- tcg/sparc64/tcg-target.c.inc | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/tcg/sparc64/tcg-target.c.inc b/tcg/sparc64/tcg-target.c.inc index 64464ab363..15d6a9fd73 100644 --- a/tcg/sparc64/tcg-target.c.inc +++ b/tcg/sparc64/tcg-target.c.inc @@ -399,7 +399,8 @@ static void tcg_out_sethi(TCGContext *s, TCGReg ret, uint32_t arg) tcg_out32(s, SETHI | INSN_RD(ret) | ((arg & 0xfffffc00) >> 10)); } -static void tcg_out_movi_imm13(TCGContext *s, TCGReg ret, int32_t arg) +/* A 13-bit constant sign-extended to 64 bits. */ +static void tcg_out_movi_s13(TCGContext *s, TCGReg ret, int32_t arg) { tcg_out_arithi(s, ret, TCG_REG_G0, arg, ARITH_OR); } @@ -408,7 +409,7 @@ static void tcg_out_movi_imm32(TCGContext *s, TCGReg ret, int32_t arg) { if (check_fit_i32(arg, 13)) { /* A 13-bit constant sign-extended to 64-bits. */ - tcg_out_movi_imm13(s, ret, arg); + tcg_out_movi_s13(s, ret, arg); } else { /* A 32-bit constant zero-extended to 64 bits. */ tcg_out_sethi(s, ret, arg); @@ -433,7 +434,7 @@ static void tcg_out_movi_int(TCGContext *s, TCGType type, TCGReg ret, /* A 13-bit constant sign-extended to 64-bits. */ if (check_fit_tl(arg, 13)) { - tcg_out_movi_imm13(s, ret, arg); + tcg_out_movi_s13(s, ret, arg); return; } @@ -767,7 +768,7 @@ static void tcg_out_setcond_i32(TCGContext *s, TCGCond cond, TCGReg ret, default: tcg_out_cmp(s, c1, c2, c2const); - tcg_out_movi_imm13(s, ret, 0); + tcg_out_movi_s13(s, ret, 0); tcg_out_movcc(s, cond, MOVCC_ICC, ret, 1, 1); return; } @@ -803,11 +804,11 @@ static void tcg_out_setcond_i64(TCGContext *s, TCGCond cond, TCGReg ret, /* For 64-bit signed comparisons vs zero, we can avoid the compare if the input does not overlap the output. */ if (c2 == 0 && !is_unsigned_cond(cond) && c1 != ret) { - tcg_out_movi_imm13(s, ret, 0); + tcg_out_movi_s13(s, ret, 0); tcg_out_movr(s, cond, ret, c1, 1, 1); } else { tcg_out_cmp(s, c1, c2, c2const); - tcg_out_movi_imm13(s, ret, 0); + tcg_out_movi_s13(s, ret, 0); tcg_out_movcc(s, cond, MOVCC_XCC, ret, 1, 1); } } @@ -844,7 +845,7 @@ static void tcg_out_addsub2_i64(TCGContext *s, TCGReg rl, TCGReg rh, if (use_vis3_instructions && !is_sub) { /* Note that ADDXC doesn't accept immediates. */ if (bhconst && bh != 0) { - tcg_out_movi_imm13(s, TCG_REG_T2, bh); + tcg_out_movi_s13(s, TCG_REG_T2, bh); bh = TCG_REG_T2; } tcg_out_arith(s, rh, ah, bh, ARITH_ADDXC); @@ -866,7 +867,7 @@ static void tcg_out_addsub2_i64(TCGContext *s, TCGReg rl, TCGReg rh, * so the adjustment fits 12 bits. */ if (bhconst) { - tcg_out_movi_imm13(s, TCG_REG_T2, bh + (is_sub ? -1 : 1)); + tcg_out_movi_s13(s, TCG_REG_T2, bh + (is_sub ? -1 : 1)); } else { tcg_out_arithi(s, TCG_REG_T2, bh, 1, is_sub ? ARITH_SUB : ARITH_ADD); @@ -1036,7 +1037,7 @@ static void tcg_target_qemu_prologue(TCGContext *s) tcg_code_gen_epilogue = tcg_splitwx_to_rx(s->code_ptr); tcg_out_arithi(s, TCG_REG_G0, TCG_REG_I7, 8, RETURN); /* delay slot */ - tcg_out_movi_imm13(s, TCG_REG_O0, 0); + tcg_out_movi_s13(s, TCG_REG_O0, 0); build_trampolines(s); } @@ -1430,7 +1431,7 @@ static void tcg_out_exit_tb(TCGContext *s, uintptr_t a0) { if (check_fit_ptr(a0, 13)) { tcg_out_arithi(s, TCG_REG_G0, TCG_REG_I7, 8, RETURN); - tcg_out_movi_imm13(s, TCG_REG_O0, a0); + tcg_out_movi_s13(s, TCG_REG_O0, a0); return; } else { intptr_t tb_diff = tcg_tbrel_diff(s, (void *)a0);