From nobody Tue Feb 10 07:57:48 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.50 as permitted sender) client-ip=209.85.221.50; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f50.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.50 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1618859916; cv=none; d=zohomail.com; s=zohoarc; b=GbRxyUIjXHDg+SYIEOI33c5W/26H6lR7B0jHDUM1eNUwKBoXxwnImW3Ty8K8si9fORQSW6OwmIUo+/Hnpr4mUUPDoyFbo4Pp+s4+xj0qbv8h9FLdWBznjBYEpHi55D9GBJjaWexjSUyEvLO2vWriGFadbQv/gAY0H4l0gGtqR24= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618859916; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=fGOvaajXfmrpLSnOyhpIroCQXe3e+OS5MF3gQarLZWU=; b=Nhro8rppQX2Y0yP5vOUZTSxK293INh4tUjsKT1Aub9OUa28gJ54Kgsc30d64VR9bcSNoekr/OUGXzEGTlwvihfoy9ikXJewApN0byVhVud4VjZOUviv3Sg33xmKeS5dWao6Zt828ag3I0ldUPgKWkhDCRclzTHMPcu62BYfj0sg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.50 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) by mx.zohomail.com with SMTPS id 1618859916795811.3098013816987; Mon, 19 Apr 2021 12:18:36 -0700 (PDT) Received: by mail-wr1-f50.google.com with SMTP id x7so35150802wrw.10 for ; Mon, 19 Apr 2021 12:18:36 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.redhat.com (39.red-81-40-121.staticip.rima-tde.net. [81.40.121.39]) by smtp.gmail.com with ESMTPSA id f23sm545631wmf.37.2021.04.19.12.18.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Apr 2021 12:18:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=fGOvaajXfmrpLSnOyhpIroCQXe3e+OS5MF3gQarLZWU=; b=mOjaQ8Os+wMa5eXWTbLTFe+2E4ZBAkAODgCIhYnBE3BDDnlrR5zlUnwFzk9yaWXahU Gu0jEn3Wy0iRiPCm01xTmPLMK+9Sj9hjMEpFY9zbWPx+RPk4PJZS338Ugmdeys1g+pt2 ITDWb1jj7PvHI5nzTRypC76yZeHjLl8ltj8g6j2ZshPM4cKnfsHiaBb+5o3cCxxQmT2o 4wQ7UvjMGTXczER46qY6yAgkxFAvJJujtx42A+ACeiWVzIzQsRShbVN24LR77qoO84ze ojWg3G2B3xACMR9VXtdBSkNjP2uPc2kMiCmu4HibNPpvblRpNzcBAgzC7R7TDoxutby1 FSqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=fGOvaajXfmrpLSnOyhpIroCQXe3e+OS5MF3gQarLZWU=; b=YuhvcU4lT6MDA/taP7Pp/J+01QXIBB5uDdlHc8+4e7wQISe2gb+GLKAei+qHM5P5pL LupnHyjqNSu/t1OCJT+wi5Ssl28dPfblf0iYQ//dgj5I0LlIhSzyOQGDq99vKOh+xMSU 05+/ka43rPSXcjElMxCcMemVPiRW2s9x0k6wIBqAJurj1Zs+DjibGwi19G/esDcxXQWZ 6mTSvgSEF8W7I9dM98IY2z5NLLApklbJTqzXvw11ZL+u7jBuWMl2LDbd66oEkTF2mdxD JUvhfwRmPB0SYiQWMHcHzDuAuh6i3nmzQCPi8bZ6kk+oPqH424aal95ya6mkEXsLWRT+ dAjA== X-Gm-Message-State: AOAM5338GHKAVxgVAlLaTMRwApKKtAzHKY10y0IWZSD77CCXrhg07mpN QD69xkcGoGdRrkRxcZl5IYY= X-Google-Smtp-Source: ABdhPJxcFKG1mEOJQbvsCg2CAHPJb1YNiCdHaYAZPgOsUJi7bUQcClWyyyCNMSwt//Z3tejgG7RFrg== X-Received: by 2002:adf:8b02:: with SMTP id n2mr15720884wra.259.1618859914883; Mon, 19 Apr 2021 12:18:34 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aleksandar Rikalo , Aurelien Jarno , Huacai Chen Subject: [PATCH v3 02/30] target/mips: Move IEEE rounding mode array to new source file Date: Mon, 19 Apr 2021 21:17:55 +0200 Message-Id: <20210419191823.1555482-3-f4bug@amsat.org> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210419191823.1555482-1-f4bug@amsat.org> References: <20210419191823.1555482-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) restore_msa_fp_status() is declared inlined in fpu_helper.h, and uses the ieee_rm[] array. Therefore any code calling restore_msa_fp_status() must have access to this ieee_rm[] array. kvm_mips_get_fpu_registers(), which is in target/mips/kvm.c, calls restore_msa_fp_status. Except this tiny array, the rest of fpu_helper.c is only useful for the TCG accelerator. To be able to restrict fpu_helper.c to TCG, we need to move the ieee_rm[] array to a new source file. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/mips/fpu.c | 18 ++++++++++++++++++ target/mips/fpu_helper.c | 8 -------- target/mips/meson.build | 1 + 3 files changed, 19 insertions(+), 8 deletions(-) create mode 100644 target/mips/fpu.c diff --git a/target/mips/fpu.c b/target/mips/fpu.c new file mode 100644 index 00000000000..39a2f7fd22e --- /dev/null +++ b/target/mips/fpu.c @@ -0,0 +1,18 @@ +/* + * Helpers for emulation of FPU-related MIPS instructions. + * + * Copyright (C) 2004-2005 Jocelyn Mayer + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ +#include "qemu/osdep.h" +#include "fpu/softfloat-helpers.h" +#include "fpu_helper.h" + +/* convert MIPS rounding mode in FCR31 to IEEE library */ +const FloatRoundMode ieee_rm[4] =3D { + float_round_nearest_even, + float_round_to_zero, + float_round_up, + float_round_down +}; diff --git a/target/mips/fpu_helper.c b/target/mips/fpu_helper.c index 6dd853259e2..8ce56ed7c81 100644 --- a/target/mips/fpu_helper.c +++ b/target/mips/fpu_helper.c @@ -38,14 +38,6 @@ #define FP_TO_INT32_OVERFLOW 0x7fffffff #define FP_TO_INT64_OVERFLOW 0x7fffffffffffffffULL =20 -/* convert MIPS rounding mode in FCR31 to IEEE library */ -const FloatRoundMode ieee_rm[4] =3D { - float_round_nearest_even, - float_round_to_zero, - float_round_up, - float_round_down -}; - target_ulong helper_cfc1(CPUMIPSState *env, uint32_t reg) { target_ulong arg1 =3D 0; diff --git a/target/mips/meson.build b/target/mips/meson.build index 3733d1200f7..5fcb211ca9a 100644 --- a/target/mips/meson.build +++ b/target/mips/meson.build @@ -9,6 +9,7 @@ mips_ss =3D ss.source_set() mips_ss.add(files( 'cpu.c', + 'fpu.c', 'gdbstub.c', )) mips_tcg_ss =3D ss.source_set() --=20 2.26.3