From patchwork Tue Nov 26 13:15:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 845583 Delivered-To: patch@linaro.org Received: by 2002:a5d:6989:0:b0:382:43a8:7b94 with SMTP id g9csp207624wru; Tue, 26 Nov 2024 05:18:38 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUzmut2dMNJd5wSsP2Lsjzqsp8zqBsxA9wieWTG/n6Y5IiA/XzeI+wm3QOEQYRs7h6cHGgJFg==@linaro.org X-Google-Smtp-Source: AGHT+IEKrpr7O6aEZL9qwWVpXHhNshMVmehyhyo5fTV0GqJ2ppr+Oa/bkq9ebt1/yxH12ixZ9vF+ X-Received: by 2002:a05:620a:3907:b0:7b6:6701:7a53 with SMTP id af79cd13be357-7b667018f34mr1280290585a.56.1732627118295; Tue, 26 Nov 2024 05:18:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1732627118; cv=none; d=google.com; s=arc-20240605; b=NBeZZbDpwHNWnK6OWXQniP8twaAcB3A1pKdo2XcjqbHY5t2Pl0WXhAA/fP2Nw14ptc EF41X9nNqjGAktBOuxR0tsYMZ1ZLefh+rZvpvNXjUri/KPaKaTexvAmZmEmAu+9fT7fK 7b2WBFl4m3lgD2worVLaIv4DyW70QnEYKDm8z/on0Jz8xnuBLnndjXLWaw7he+p6ENuB STjYpwXpmchBCZvHWPlWA80yk/VMj9j23p5b/STjE0dMYLGbc7HHHpSUPZLiaR6T3XOC 0VpoPVwYZZ1VywGhI8GFCbCIrWeGl9qHbq/jVcmCh+kli7wZvnJHADZ/82dGE/joJR+B 0WVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=Z1ZuRlLkL1yhuLbXRwUvfotEPQVAqZnSZGvAIWOZu34=; fh=ZPvo3rWtM/qKZe5AP9Rh1bkiroaPTbMKWypNbqenWZE=; b=jR7Cvzsqsqx9w9mlfL8ZqdEMnY+GH5W9INVI0m88Hxzu/pb+n9iOsMd7/48NDwZwSu K0Lx1yW2aBAYY6QoybgwZpGJ3We+/qLCMRYEKkDk8Bw02y70yAuSTPn9nvCX/e4ofBIc LwOJZaWNSG4f68TXEkQSiWgtx/7KHHv5RvZEhD6y48l45CfPXLYXlZRSfhLc8c2Gsjit eQvMfi6AUnk22bEMBkiEsDLbzvP/rN/dRwbehN0HLrfwxjAioUa0YOabKKHDT1wRNnff +zgyo3KeiGX781K7DVDY/H7ok6zZ0VAYx4+wi/8Zvn9UO5RMgoDbFn22RRAUiCtl924t Gmyg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lcnjZ5xR; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7b66ad8ce9dsi566650585a.656.2024.11.26.05.18.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Nov 2024 05:18:38 -0800 (PST) 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=lcnjZ5xR; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tFvRz-00013s-1b; Tue, 26 Nov 2024 08:17:56 -0500 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 1tFvQz-00007q-Dt for qemu-devel@nongnu.org; Tue, 26 Nov 2024 08:16:54 -0500 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tFvQv-0003jH-Sj for qemu-devel@nongnu.org; Tue, 26 Nov 2024 08:16:52 -0500 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-382376fcc4fso3310627f8f.2 for ; Tue, 26 Nov 2024 05:16:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732627008; x=1733231808; 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=Z1ZuRlLkL1yhuLbXRwUvfotEPQVAqZnSZGvAIWOZu34=; b=lcnjZ5xRLFoHH7T6rfLlL+gYkEIYyxDTyliyva8wRpZVWoxFwR21yrOv3D/OCayKO0 SOO9ScM09lwclOfxG2p+T+P4iLj1AT8tcGFF2p2+Kr44UPuIYcuOfyuubOpsz8bL9Pap k5jYzYkOPLBupBxzlGGti4gx7DtuYltDTjQGwD1o0srlA6VtwkQpmETrG5gCnDECEHtv cx1C/BEC9h2PfZdabronuHS7GjTfux/28fQqeoTWEkrRXTm2DV0LFsH80fZGgV+BPzAn pY2U6aT3vkDeum1fhgCHvWeAReDltTNms0p2TER38lh9vk9jLsUs8SFUICcg7moLylKw A6qQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732627008; x=1733231808; 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=Z1ZuRlLkL1yhuLbXRwUvfotEPQVAqZnSZGvAIWOZu34=; b=UdgTfCm/6rf6qRVkRSKJw6wD59qgl2e6+tenQtIBeOdsgXAoqx8fK8D8dmcl4GA1bd NRwDwxq7kZq+6fAoASCOQhvfbZMigM0omzRhXBBXWIu8BrsGlP3OBtKxmfQLJwZ144HR h+cyTUNfk5i/Mu6CBdnkJOcsoughpRhQOiG1nXB1nKwBI3ZCt5X8AqiIHvcbgIaKpZFf wdZFCW8Z323fYJ2b/6bpwfbSV5ei9VJQqmLmB/zeJ9VwjKJxYtTQL+K3d5ugo9iniCQq WQ5HlRZHrtsW/BjDenahWw5Oq/xqhsol+9OfuaFHuOEt6ccoy9cApS2iJ7yis1jncBOL F8sA== X-Gm-Message-State: AOJu0YzRy1UEvLsl4C0ZAbjFitpP72j9it9cK4EJwZeFbVJ17sEXNqe2 EW0lFKhKMCck34kz2DRNnULFansjU/wdELxNj2VtFFNFcZmUNRzK4Tl7pXTZlAYOfeyoNPmTX1M t X-Gm-Gg: ASbGncs9ctJK47BviXKTnTVlNuPwpH3l++9oNNiimlUGFYx5tfwDj24ItKish20WsCA H+M9UiQghhTbbc5Bic0oQodBU0KztSgf/9HY3BkafxkyPtgNpid8qcFlxDVAfBHtdPh7TOLovty QRxQKllUHgljpZRnfvpHDM9nYG83dVRGLsvz7Y8wFtts9PDt0Fz67HXrpx0YsilBZEul2FAy/32 81eEbECHWVJ0+Ss9DpHjjd92pEZyadKL6Fx7Lgvq4UOyAkMqXd1FHfEgJeAJSCzRZpBAg2t X-Received: by 2002:a5d:6dab:0:b0:382:4851:46d8 with SMTP id ffacd0b85a97d-38260b4d514mr13103906f8f.8.1732627008100; Tue, 26 Nov 2024 05:16:48 -0800 (PST) Received: from localhost.localdomain ([176.176.143.205]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3825fbed6b5sm13604378f8f.89.2024.11.26.05.16.46 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 26 Nov 2024 05:16:47 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Aurelien Jarno , Aleksandar Rikalo , Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Huacai Chen , Jiaxun Yang Subject: [PATCH 10/13] target/mips: Introduce gen_move_high32_i32() Date: Tue, 26 Nov 2024 14:15:42 +0100 Message-ID: <20241126131546.66145-11-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241126131546.66145-1-philmd@linaro.org> References: <20241126131546.66145-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=philmd@linaro.org; helo=mail-wr1-x436.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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Similarly to the gen_move_high32_tl() helper which sign-extract the 32-higher bits of a target-wide TCG register, add a helper to sign-extract from 32-bit TCG registers. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- target/mips/tcg/translate.h | 1 + target/mips/tcg/translate.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/target/mips/tcg/translate.h b/target/mips/tcg/translate.h index d5d74faad92..f974cf29297 100644 --- a/target/mips/tcg/translate.h +++ b/target/mips/tcg/translate.h @@ -156,6 +156,7 @@ void gen_base_offset_addr_tl(DisasContext *ctx, TCGv addr, int base, int offset) void gen_move_low32_tl(TCGv ret, TCGv_i64 arg); void gen_move_low32_i32(TCGv_i32 ret, TCGv_i64 arg); void gen_move_high32_tl(TCGv ret, TCGv_i64 arg); +void gen_move_high32_i32(TCGv_i32 ret, TCGv_i64 arg); void gen_load_gpr_tl(TCGv t, int reg); void gen_load_gpr_i32(TCGv_i32 t, int reg); void gen_store_gpr_tl(TCGv t, int reg); diff --git a/target/mips/tcg/translate.c b/target/mips/tcg/translate.c index 80e2a8e5256..d6be37d56d3 100644 --- a/target/mips/tcg/translate.c +++ b/target/mips/tcg/translate.c @@ -1494,6 +1494,11 @@ void gen_move_high32_tl(TCGv ret, TCGv_i64 arg) #endif } +void gen_move_high32_i32(TCGv_i32 ret, TCGv_i64 arg) +{ + tcg_gen_extrh_i64_i32(ret, arg); +} + bool check_cp0_enabled(DisasContext *ctx) { if (unlikely(!(ctx->hflags & MIPS_HFLAG_CP0))) {