From patchwork Mon May 15 14:32:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 681986 Delivered-To: patch@linaro.org Received: by 2002:adf:fd8f:0:0:0:0:0 with SMTP id d15csp1154873wrr; Mon, 15 May 2023 07:49:32 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6riKVIXAEBXhs5YmWIzDh1V7aOmW3AE6K8l7QAyKlacwORd+meZqwsAWRRrRAB1mEKfZ0q X-Received: by 2002:a17:907:9602:b0:965:77d2:7802 with SMTP id gb2-20020a170907960200b0096577d27802mr33517661ejc.0.1684162172330; Mon, 15 May 2023 07:49:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684162172; cv=none; d=google.com; s=arc-20160816; b=QZVcCtHsDcN6t9CIZtAvbA1WLOrjnNVyVEXKLd4DaMNVitnustk6TbK0Nz9jhPowfH 52u7QMSjGrkGY48bIQ5TVMXxSO7/OwXK+BaXG+9eQ6Pe64Hi2xZgZlq9aPrPyJMhG9aD VkguoEhoXcYTgce5VXqFl3/ZnW27WmMad+qsk23suTcHgvviFNt2mBFuVXT7XsJSOR5v ZzUkIBq5toSyAwqwKquBVU9Bye1IweqUD9ki4sLgwicKNxwwqnxRFvTqsnWx7QoYqnyC uPRBIVmVdKwvmh2AwOaOn/AU+qayBLrFCpTOGtOZ5ufvamGrOtxaqapdWF0YEK7Xjnw+ vrbQ== 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=t1hIIKUo7PoLuxvqXryvPnYOSzjxwn2GYHszm/BGZZQ=; b=xsVVgKCybaNWMSoYMbkA9wcE3E9meyCQNgFZ4hQhL2qQ4of2KGg71fi/so8Hd49OqL EJga+/MVII3VPB5wAQmJsGV/rYc5jFL4ffCF2MCrW8A36z1nbYtLmlOQ8MT1vjMCWztv s+UMCafhUvcSBCkbumAuHvLxDQU1BssLQmFpWw5nQ2eimtzf79Xard0MznpdUN/3Pne2 LCdCJr2kZzZhyV01ljVb+5OiL9J+NwN7Zl6IEzB7Zz0U0E79wJQ15Whj+MEV16CQnGMP X4TKFUIqDfQoY8EVADi1Sk6KTPHjgITkCM8btNdGEMu+seOZgDs+qgCih5a7+dwYETDZ tjvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wx1aOCcM; 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 fp1-20020a1709069e0100b0094f226d0073si12248549ejc.514.2023.05.15.07.49.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 15 May 2023 07:49:32 -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=wx1aOCcM; 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 1pyZJP-000315-Ll; Mon, 15 May 2023 10:36:32 -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 1pyZHg-00079f-WA for qemu-devel@nongnu.org; Mon, 15 May 2023 10:34:47 -0400 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pyZHa-00050a-Fg for qemu-devel@nongnu.org; Mon, 15 May 2023 10:34:43 -0400 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1aaf21bb42bso90759715ad.2 for ; Mon, 15 May 2023 07:33:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684161217; x=1686753217; 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=t1hIIKUo7PoLuxvqXryvPnYOSzjxwn2GYHszm/BGZZQ=; b=wx1aOCcMxrdRBcClXzU/JVDXzLeYSFDD/d4zTHM1y1SWA25cLtkLgG7hS2iIvfR3tL TpxtXw4huShC+24M2GF0TS7KLUm4+7ZX4NeJEKhmGH7dypvjg6Gy+cep6BBIQqc+kTti swexNPwxc72S3x2oZiVEhwgtsRBdOAU8gTwh4wpv0MuO2BOqh9bGJAZylQBOi9gKtKf1 qzSs0LxI1+FsctKB3EFn23Ig0s59nk0eZFEQnr349kGKetPEAVIfxhicxL1/reVglkoa 1JOpZm45Gdc8ShRaT3CErkqgNxgs3Jv8Ex/y/9DTcKolvv/S2MONqAj/pA5IsTVK2gqk duzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684161217; x=1686753217; 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=t1hIIKUo7PoLuxvqXryvPnYOSzjxwn2GYHszm/BGZZQ=; b=BcUHG0QvgwWDkafl4rYeFkmK6Q/ojuueucevdpOmbSyFbna6eElGM63Gmv9apUNSly 9TYNzUYfgd94AXTuUgvwI9+LsTu0bE+TvAttLbeKgHVfkn+zE7P9y55wi1pg0k3tjy5Q J/2KwgjuDLqbOf+fvywEpVxnEkNV9x0L2b0F367Gy5BdqBt6tooS3ObGBbFbhyYHqUE2 o6oJr5BMpZ1MWnq9aopaOQMRWkVWFWNYQkAYb6/0FirzXTFLoBolEZ9OqNiAWZgMYyZi +eJHfqd7N5fr5iUbQRGB/fEX3duK0KhlPAV33u0gWqmP+IzLXUhxPZAcVtVHMDS5f1AF CW2g== X-Gm-Message-State: AC+VfDx/VmIlpHrlYVM982JMHiBUovf9U+vkEASToZkKKhwerrZX+Q1s m8KIgh7znNmpHb3pwdI13fc+EYoBgSbj4FemRF4= X-Received: by 2002:a17:903:48e:b0:1a2:a904:c438 with SMTP id jj14-20020a170903048e00b001a2a904c438mr35834889plb.58.1684161217185; Mon, 15 May 2023 07:33:37 -0700 (PDT) Received: from stoup.. ([2602:ae:1598:4c01:9902:96ac:8d8c:4366]) by smtp.gmail.com with ESMTPSA id ik9-20020a170902ab0900b001ab0aec388bsm13694335plb.135.2023.05.15.07.33.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 May 2023 07:33:36 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org Subject: [PATCH v5 26/54] target/sparc64: Remove tcg_out_movi_s13 case from tcg_out_movi_imm32 Date: Mon, 15 May 2023 07:32:45 -0700 Message-Id: <20230515143313.734053-27-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230515143313.734053-1-richard.henderson@linaro.org> References: <20230515143313.734053-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::635; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x635.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=unavailable 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 Shuffle the order in tcg_out_movi_int to check s13 first, and drop this check from tcg_out_movi_imm32. This might make the sequence for in_prologue larger, but not with worrying about. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- tcg/sparc64/tcg-target.c.inc | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/tcg/sparc64/tcg-target.c.inc b/tcg/sparc64/tcg-target.c.inc index 15d6a9fd73..2689599fd6 100644 --- a/tcg/sparc64/tcg-target.c.inc +++ b/tcg/sparc64/tcg-target.c.inc @@ -407,15 +407,10 @@ static void tcg_out_movi_s13(TCGContext *s, TCGReg ret, int32_t arg) 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_s13(s, ret, arg); - } else { - /* A 32-bit constant zero-extended to 64 bits. */ - tcg_out_sethi(s, ret, arg); - if (arg & 0x3ff) { - tcg_out_arithi(s, ret, ret, arg & 0x3ff, ARITH_OR); - } + /* A 32-bit constant zero-extended to 64 bits. */ + tcg_out_sethi(s, ret, arg); + if (arg & 0x3ff) { + tcg_out_arithi(s, ret, ret, arg & 0x3ff, ARITH_OR); } } @@ -426,18 +421,18 @@ static void tcg_out_movi_int(TCGContext *s, TCGType type, TCGReg ret, tcg_target_long hi, lo = (int32_t)arg; tcg_target_long test, lsb; - /* A 32-bit constant, or 32-bit zero-extended to 64-bits. */ - if (type == TCG_TYPE_I32 || arg == (uint32_t)arg) { - tcg_out_movi_imm32(s, ret, arg); - return; - } - /* A 13-bit constant sign-extended to 64-bits. */ if (check_fit_tl(arg, 13)) { tcg_out_movi_s13(s, ret, arg); return; } + /* A 32-bit constant, or 32-bit zero-extended to 64-bits. */ + if (type == TCG_TYPE_I32 || arg == (uint32_t)arg) { + tcg_out_movi_imm32(s, ret, arg); + return; + } + /* A 13-bit constant relative to the TB. */ if (!in_prologue) { test = tcg_tbrel_diff(s, (void *)arg);