From nobody Tue Feb 10 17:30:49 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.68 as permitted sender) client-ip=209.85.221.68; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f68.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.68 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail(p=none dis=none) header.from=amsat.org ARC-Seal: i=1; a=rsa-sha256; t=1602943395; cv=none; d=zohomail.com; s=zohoarc; b=RC6mqMvhvYOyqyqQsfDPH+jYQOysuCumR6+B4YIiI64MOdu1kQzxsCsJPDWMl/kS/3JsYDp92r+9urGi7nTMOHUCebKomCiY/PbbxrtJTRnTZMo16grWLI1XFBWEAJCGlqQO7ByI+zKod0Bx4i25JTSQMSHdu9RAkFgMbiznwQ4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602943395; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ixr+1nbJukvy2COfOoRzV+WTmXwjG84YPtvZ7E/7AI0=; b=bUy01ynhUdMFz0pJddcYGZk4cIV0R2VGa7OlzaLUqlFhJK0wA6k7BfIhGtBf+HEoV/iLpTSoCwyO6VdnEQawb6m/c+Yk3ARhL/fpjM9ehK6hKf1ZcKIuZSvfHKumzxNYm5U1C+U9t0tIbf8Ao8m0urz9XdIU5/8A43GHGlmBeF0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.68 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by mx.zohomail.com with SMTPS id 1602943395952670.2571291697093; Sat, 17 Oct 2020 07:03:15 -0700 (PDT) Received: by mail-wr1-f68.google.com with SMTP id j7so2484774wrt.9 for ; Sat, 17 Oct 2020 07:03:15 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (117.red-83-52-172.dynamicip.rima-tde.net. [83.52.172.117]) by smtp.gmail.com with ESMTPSA id h16sm9232144wre.87.2020.10.17.07.03.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 07:03:13 -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=ixr+1nbJukvy2COfOoRzV+WTmXwjG84YPtvZ7E/7AI0=; b=M19aeNKO/uroBwIY39BuP9GQV3DwHoBEGX5ArebTHGgr/T8YMKFeo0ucZNeWD6t90x XfEkqsX2JQSXJXM3ZyVwT/PfHnPzoxS8p83DmnXm/Bpw+6L0ce+nmQEVgfgaUvtE7pLF 0nOyLDp2JALNrbkBsgCybprMRrurcCyskwGA2yEy3Hw+VXoZUCHZ0C5dIfByeg7Vek6N o0Neb4k9MA9d4vM+FsrMjLlW3Mj6LnQVGGW3n5Ao9fQYd2DwN4cfPmMgcVZGvUvDgbdn k850hMGSZuA+2CCxzMRMi1rZJy9qNfhsliZK6lvGjSupQ64K6u5DjdxK2dtPSWNNAxSK GrLQ== 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=ixr+1nbJukvy2COfOoRzV+WTmXwjG84YPtvZ7E/7AI0=; b=Muc8qk3NTfmVFpPtMNIRuJW3HZb2H7QLMrR0t29j4nB+3U3YFAELQK7zguMaE4LWck SYJ+5pNaqbBYzMhB72uZRp213vw4LZSUYxJkWT/GvDAqIL2KAuppRaDAn+6o1BWXzFKt WbD7Y2Ce9PpSLDjQlK0pSafTRWTgf9rCe3KiMY885wLpHrz5dQis36DCTl7/5GLj5XCK 78HbpaGFVErrwR4mttj4zKen5KThTPaDISRLcIlzSKnRJ8XycrJgjOb+Bb9Y+RxWb3QR TUDUmkYMfP2m91wxvMIg+MbjulBHtL/V7Fz09VAfXoBPm0bFxu9NBsgY3IVUGqAnME9n eFCQ== X-Gm-Message-State: AOAM530pXxLcS0GkBkC0NZ67AKbqvK14aO5nlhMdqsRmy5rNOSuBp/Q2 762EOTIlYyg1t+Y/j8lKrMs= X-Google-Smtp-Source: ABdhPJwehpEamaBiHfGnLBIyOv5QOZYErEvZXca3Ijw6DyX132g7ZsetO2VcUjfx2+LfLh4UF02mpA== X-Received: by 2002:adf:bbc6:: with SMTP id z6mr10331941wrg.298.1602943394108; Sat, 17 Oct 2020 07:03:14 -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 , Huacai Chen , Paul Burton , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Aurelien Jarno , Aleksandar Rikalo , Aleksandar Markovic , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 06/44] target/mips: Demacro helpers for MF. Date: Sat, 17 Oct 2020 16:02:05 +0200 Message-Id: <20201017140243.1078718-7-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201017140243.1078718-1-f4bug@amsat.org> References: <20201017140243.1078718-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) From: Aleksandar Markovic Remove function definitions via macros to achieve better code clarity. Signed-off-by: Aleksandar Markovic Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <1602103041-32017-3-git-send-email-aleksandar.qemu.devel@gmail.= com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/mips/fpu_helper.c | 63 +++++++++++++++++++++++++++++----------- 1 file changed, 46 insertions(+), 17 deletions(-) diff --git a/target/mips/fpu_helper.c b/target/mips/fpu_helper.c index f851723f22d..b3c715494a9 100644 --- a/target/mips/fpu_helper.c +++ b/target/mips/fpu_helper.c @@ -1666,25 +1666,54 @@ uint64_t helper_float_nmsub_ps(CPUMIPSState *env, u= int64_t fdt0, } =20 =20 -#define FLOAT_FMADDSUB(name, bits, muladd_arg) \ -uint ## bits ## _t helper_float_ ## name(CPUMIPSState *env, \ - uint ## bits ## _t fs, \ - uint ## bits ## _t ft, \ - uint ## bits ## _t fd) \ -{ \ - uint ## bits ## _t fdret; \ - \ - fdret =3D float ## bits ## _muladd(fs, ft, fd, muladd_arg, \ - &env->active_fpu.fp_status); \ - update_fcr31(env, GETPC()); \ - return fdret; \ +uint32_t helper_float_maddf_s(CPUMIPSState *env, uint32_t fs, + uint32_t ft, uint32_t fd) +{ + uint32_t fdret; + + fdret =3D float32_muladd(fs, ft, fd, 0, + &env->active_fpu.fp_status); + + update_fcr31(env, GETPC()); + return fdret; +} + +uint64_t helper_float_maddf_d(CPUMIPSState *env, uint64_t fs, + uint64_t ft, uint64_t fd) +{ + uint64_t fdret; + + fdret =3D float64_muladd(fs, ft, fd, 0, + &env->active_fpu.fp_status); + + update_fcr31(env, GETPC()); + return fdret; +} + +uint32_t helper_float_msubf_s(CPUMIPSState *env, uint32_t fs, + uint32_t ft, uint32_t fd) +{ + uint32_t fdret; + + fdret =3D float32_muladd(fs, ft, fd, float_muladd_negate_product, + &env->active_fpu.fp_status); + + update_fcr31(env, GETPC()); + return fdret; +} + +uint64_t helper_float_msubf_d(CPUMIPSState *env, uint64_t fs, + uint64_t ft, uint64_t fd) +{ + uint64_t fdret; + + fdret =3D float64_muladd(fs, ft, fd, float_muladd_negate_product, + &env->active_fpu.fp_status); + + update_fcr31(env, GETPC()); + return fdret; } =20 -FLOAT_FMADDSUB(maddf_s, 32, 0) -FLOAT_FMADDSUB(maddf_d, 64, 0) -FLOAT_FMADDSUB(msubf_s, 32, float_muladd_negate_product) -FLOAT_FMADDSUB(msubf_d, 64, float_muladd_negate_product) -#undef FLOAT_FMADDSUB =20 /* compare operations */ #define FOP_COND_D(op, cond) \ --=20 2.26.2