From patchwork Mon Sep 30 09:10:51 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: 831545 Delivered-To: patch@linaro.org Received: by 2002:a5d:66c8:0:b0:367:895a:4699 with SMTP id k8csp1852524wrw; Mon, 30 Sep 2024 02:14:21 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXOepK8oxg4f59wrC+5S3gwSmSFIRZA+HlnQGjdyIJPi0s0ftoScgnaz3tBGtGmgT9MAed5zQ==@linaro.org X-Google-Smtp-Source: AGHT+IFE0pRItSpRFvF9Sa5bNV3IwpgAQMnYqZuEG6xDu9rVRowplWM/Q38xUOw0BZkvtThUF+1o X-Received: by 2002:ac8:7f52:0:b0:458:2f22:ee74 with SMTP id d75a77b69052e-45c9f20fd80mr161697061cf.32.1727687661003; Mon, 30 Sep 2024 02:14:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727687660; cv=none; d=google.com; s=arc-20240605; b=P0K8IeCjXXw44LMODYtTulx91uAGKZ2XchkuBlO9f2BUqPwCXts+hKOk7IHQOXo+S8 Q1KcMsj2AoSdthJymohht7Rn4MD8WhK5dQZk6mEg8csnxIbufppXuZei+TvuwdrWTRUa M88FVVPv9WDMf7m0OVADtqqFRRFEkdbkRPgwt6byS6dE5QXtMZD9PPI5gVThgrQgO9lr 4tjFrSb3BE0uv031X3WUiOZIkmsW6ratSwoRzJl0Ik4fC3iktYuJq8Hem9tU3CKBf7je PreAaQ9XYgaF6kEtDwKr2e+qmkUcEfR8Wp1c7IsrkAdlc+bNJJpHr5GeCyLfqae9VPgw RIhg== 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=gTfK1Y7AoteS474Co0RWkp3B9nFmF0nIHDb3RW7qOck=; fh=k5rVqKUsbd8Y0L3bPWUhjMmTdbpOHX+if6Hlm9il+vc=; b=QAeVYLmt23mVspq1sTxZfLfZav9Eszo2pOnh3Nxryk7qNVCY79WSqMHkofWJhYuIyn aLsKPWMUoH3Ro7Arnmnf2nLho+HuwTMn6Hf8MJB86hJmnqXKeOJ1PoBo6n/1Ka39L4YG gjEsZYpAw/9duNjXStertHR2SxyWyq5rRTuGX0GIRYm9Ewm/L7FEfJxrgX1DxKO95t4T 5A641XqZZMIkF6iAcTvhsxYHKJPMUDv7Pn4Q+57uoqAN8HGpTQfu1lteSoKa23AD2xXu 2Xlk2zO9oxIXg11+wq5UAdL0Up3ge9Yp4IYo9rDiaDtQxQIPZCF1iiwnOrWcgJqeXV/r +nbQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="H4BRA/NG"; 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 d75a77b69052e-45c9f32876fsi80175121cf.354.2024.09.30.02.14.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Sep 2024 02:14:20 -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="H4BRA/NG"; 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 1svCRA-0007m0-I0; Mon, 30 Sep 2024 05:11:24 -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 1svCR8-0007ep-Gp for qemu-devel@nongnu.org; Mon, 30 Sep 2024 05:11:22 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1svCR6-0004UL-Ty for qemu-devel@nongnu.org; Mon, 30 Sep 2024 05:11:22 -0400 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-37ce8458ae3so785137f8f.1 for ; Mon, 30 Sep 2024 02:11:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727687479; x=1728292279; 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=gTfK1Y7AoteS474Co0RWkp3B9nFmF0nIHDb3RW7qOck=; b=H4BRA/NGY8u5uyAmg0L+UL0hiDkf3e75Lu6iPFJ0oYGSXV3j1cN9fLUbork1xJZTeo HY1mO5z24Q08Di1/Gd6+guYis1rrQpqpjj5xFWzmSrO/x2iKQ7D9fOH01Tk8JZrRIS8t /q6uB3SafbOjebHuhF0Ly5MLsiQQXlHKIVN6nA3QHbwkid57VvP6L8ztTovcq8yYBwTK 91BLFvsURauN02zSE8vdVu/Opy/hANoinvVzKSgd2IkpUkUa9fyfIUhdbWNWAOPR0zNB /Ub/uWvzb47NS+aFPitKOCm1MCUwVdBGpF6QKtBYJOgbdvnYnR1LOrV19y0FJuNashkc CFXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727687479; x=1728292279; 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=gTfK1Y7AoteS474Co0RWkp3B9nFmF0nIHDb3RW7qOck=; b=HPIH/RmpIBokBWXrjutVLNeT/R/mBr/M9/tcOgMhm8O+TfaLVDMrufrdoEh/ETmCli A8p5sYOYgfhS2ZpdVVg1NyPEVw72WpFVY3h3lC9QjvrDIMhgBDUpIid4DvafeNePMj3X vP/ucZ3eP23QgDL5aN8aRQh7TQ8Sid/QVzohrn67RymtHCjTFfSZPw6pDH0Y1hnPk44O WIWdPeJ533mxfzRQ59ep2Urh4HKNfbUUseTT9ExLnevqtHZppRwQPkL5tu5sL6RPF/1R /AM8BrvGoM60mcWdXUcf6WnYoDYM4e8XLQJT+k5yLfFGAZnnWdHeRFKGTY3mW8MvB/MS JKCA== X-Gm-Message-State: AOJu0Yx9HerL4EWtXnm4HsGpFZEIJnqRMqqq24cmU4e7wa9CDyu/SQ8Q vPBJsoxh81o0XHu0HNiRVz4oB0mOGNxGVG0TUv5F5a6NwlwSeF95PZhl6qBwrC5VjhRTUOsbcxq 7 X-Received: by 2002:a5d:4b8e:0:b0:37c:d123:f3bf with SMTP id ffacd0b85a97d-37cd5a69735mr11617422f8f.3.1727687478879; Mon, 30 Sep 2024 02:11:18 -0700 (PDT) Received: from localhost.localdomain (183.red-88-28-18.dynamicip.rima-tde.net. [88.28.18.183]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37cd57429e5sm8486235f8f.98.2024.09.30.02.11.17 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 30 Sep 2024 02:11:18 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Aurelien Jarno , =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= , Richard Henderson , Jiaxun Yang , Aleksandar Rikalo , Huacai Chen , Anton Johansson Subject: [PATCH 02/12] target/mips: Introduce mo_endian_env() helper Date: Mon, 30 Sep 2024 11:10:51 +0200 Message-ID: <20240930091101.40591-3-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240930091101.40591-1-philmd@linaro.org> References: <20240930091101.40591-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=philmd@linaro.org; helo=mail-wr1-x42a.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, 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 Introduce mo_endian_env() which returns the endian MemOp corresponding to the vCPU env. Signed-off-by: Philippe Mathieu-Daudé --- target/mips/internal.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/target/mips/internal.h b/target/mips/internal.h index 1ce2bbf62d..5fe1af22ff 100644 --- a/target/mips/internal.h +++ b/target/mips/internal.h @@ -293,6 +293,11 @@ static inline bool cpu_is_bigendian_env(CPUMIPSState *env) return extract32(env->CP0_Config0, CP0C0_BE, 1); } +static inline MemOp mo_endian_env(CPUMIPSState *env) +{ + return cpu_is_bigendian_env(env) ? MO_BE : MO_LE; +} + static inline void compute_hflags(CPUMIPSState *env) { env->hflags &= ~(MIPS_HFLAG_COP1X | MIPS_HFLAG_64 | MIPS_HFLAG_CP0 |