From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60136.outbound.protection.outlook.com [40.107.6.136]) by sourceware.org (Postfix) with ESMTPS id 1D1B3385AC08 for ; Tue, 1 Feb 2022 12:53:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1D1B3385AC08 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=syrmia.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=syrmia.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YrSeJwbqSRotvd7iRcOY9XS9gh3x/EmRNhiYd/HulrPr+QpIdeFJ35J+xyLxKFcvlYfh7wpQDo9p6MR+wQicN1GtcmPt/JTsIUxBORBg3dqTflA4vuY2UnzZh85m6hQdtol/B8XGgzXIC2n5TOEyjgXkHoZXaCB7CvA2GWrn1JZprkhAZHivMAfwxr8FiGTuKnLBoLJm1q06HP7YlZP7sSsCBoaPqHMyOkoVrVMidQSSjKzTgah493mfDvxCfvodAYDKAwfQHZWj0RaAuLYZr3k072LR+hEuYA2MbJPKB4LHRocDmn6v2RkU+7f++pfNyWui3Xu6E4EKvHryS/MvuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Z7DifkRJ5WpKPuCbk7jf9T3ECnLrjh8uPJafFzgKpO0=; b=lqqrjdKxMy3Y++CYWBEztaBolbB4FvbqD+QTwKGhuJVjobeOQbmckjW/Ss2gFG9UOXEe2AraAYjIPNZVTvbKxMUq2nUadVYaZQXtOg1SuxLsqK7fVNPM96f5ibc4MSgYoe1HZyYrKcHjyLhziyZTnArift49EUXC6C5N/NLTQmXrRj51jZn1fy7kRpsQ7NSXDBEsoc0QivBTV28v2rCBMhoB4MAaHgjwS1kgRDv8ieEMMi86cKIrDE+nBNp5h3LiGOLNL1+dA1Oge8M3UkeMLUUuD3WlnNNdcmyBdeNDC44Twmk6hfrkCmGr1FXbdfBRAOnZXypKuRwY2gDeJpMH6Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=syrmia.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Z7DifkRJ5WpKPuCbk7jf9T3ECnLrjh8uPJafFzgKpO0=; b=yuIkkOt1DzoyCvw8aq6IWXYflbmjm5OBeVccW2zo8AfUaxPle319WHtRJWHMRS9bOzF7Po5jmqEgDjS0ijqwqHsAqzfaOXy858waaPFfxT+hFYwu/62uEwUDMdwDJpYt3Nr0phifH/6M2hGZ0DYb1Il/l79H4vkEWGJaFDIcIY8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=syrmia.com; Received: from VI1PR03MB4208.eurprd03.prod.outlook.com (2603:10a6:803:51::25) by VE1PR03MB5407.eurprd03.prod.outlook.com (2603:10a6:802:ac::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.22; Tue, 1 Feb 2022 12:53:26 +0000 Received: from VI1PR03MB4208.eurprd03.prod.outlook.com ([fe80::2403:1065:f4bd:86c5]) by VI1PR03MB4208.eurprd03.prod.outlook.com ([fe80::2403:1065:f4bd:86c5%6]) with mapi id 15.20.4930.021; Tue, 1 Feb 2022 12:53:26 +0000 From: Dragan Mladjenovic To: gdb-patches@sourceware.org Cc: Mike Frysinger , "Maciej W . Rozycki" , Chao-ying Fu , Faraz Shahbazker Subject: [PATCH v4 3/4] sim: Add partial support for IEEE 754-2008 Date: Tue, 1 Feb 2022 13:53:01 +0100 Message-Id: <20220201125302.30137-4-Dragan.Mladjenovic@syrmia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220201125302.30137-1-Dragan.Mladjenovic@syrmia.com> References: <20220201125302.30137-1-Dragan.Mladjenovic@syrmia.com> Content-Type: text/plain X-ClientProxiedBy: VI1PR0102CA0057.eurprd01.prod.exchangelabs.com (2603:10a6:803::34) To VI1PR03MB4208.eurprd03.prod.outlook.com (2603:10a6:803:51::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 55962daf-e7c1-483f-f741-08d9e581d66b X-MS-TrafficTypeDiagnostic: VE1PR03MB5407:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tYvTsiLHdWHxj/wMWL5Wwa7VhUhB03rGsnQc131N7+u7uX5Tp5bHM9kbTdycRTRC5ymD963Tx9PycevW1/sOo+ssu2JNtgrw8kYYUUK6at0G6AemwxhhuIEMO9Ak4bmSLMRETxGHbQKKqBRLkoRNncXKR6C6+Le8IyPygHZTJX5Mvok6Dsp3SPsvcPMSajoAOVR0w1elZ11MgLJ6YQl5M3fJp4eCRpWNSzuP9SDwn1zTgORiL3nC1UYOgZcrosfW2oVPiKPE0ht3vj+6ke6leqG/P1a06/feWzW1OZVAwwiZwjMKoNZ+/f/x2jVU8E9tToke51B7yqd3xOEeE9+09B4g1caAcs9XgicQwUoXqLb4rx8CrSg85in+Nb6PqylmasjB6Io5webbou2jtd8cgiB7Y2a6RNwxL+ofemqGLc9fZffKi6JwrawFR5uM3hqyPG1hDXmxrDrAdI1p0Iem8JyWewdEyBTVo4CBEAnG38TQyyn5o/0tHF0esEENr++vwmS9vPBBK7u6jHKB2lRQ/SwNw60v3ESlEMttqEedGnzCeqsPLIrkSNwvIWkGeyxcnbI+Qi/j3P0JaMDdPM+38MdHfy4sihPPd1TG6FoewFHlIjXe6cKa85cXKCqgUm5tSV9afiijSQEg7XGO58stY3XO82UhcouPdIDleUA0Op+2iXlyNe3cF2I+Vt0C/DIgRttVNZct79A0u4thGkui5w== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR03MB4208.eurprd03.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(136003)(39840400004)(346002)(396003)(376002)(38350700002)(6506007)(2616005)(86362001)(6916009)(54906003)(1076003)(26005)(36756003)(38100700002)(186003)(316002)(8676002)(66476007)(83380400001)(6512007)(66946007)(6486002)(4326008)(66556008)(2906002)(52116002)(508600001)(6666004)(5660300002)(8936002)(20210929001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?zB5B/OgNXStUgvuHvgWZSEVWsnal6fLXolxYBjGeEYuvPA+FEE9GSJjYYn52?= =?us-ascii?Q?dnMdoYUjxrN8mu8w4CRg6DYt0U8idReIwzWqaavcrAKHgugr6BAN/3xKEArX?= =?us-ascii?Q?zh4vY4moIyvXp7fRvKDH19gLnVrVj1NNo89DOO8FBTjlr8auVtqysgd+rbwx?= =?us-ascii?Q?CFcuzN9y+SoFw9yqFFu+5I07OTpLTRrKgXf+nrzu1XmSr6jKUdQoI0/DgMu+?= =?us-ascii?Q?lEzgvoFql5zeA8NNdE7hCnT33PuNTchmKdjKC/16/6jVjhQ/6MmlcuDNQB5e?= =?us-ascii?Q?IgFSdzF9YHKzGqwRIpf6YNiizn3inL7sy0JuRuOYTNPEugr+qNrTmLWTbXH2?= =?us-ascii?Q?IVZTTb20oenJc6w4sFUS0PeX3MoKTsZQcxHV1PM4F1qvBqVuxonABrWNmNwF?= =?us-ascii?Q?1PNvA88j4k8P7qCh59HiHtYsu6VUb64hXteGEGUkUaAnMNVNYHvqMlwXQo9T?= =?us-ascii?Q?FxTK6pjVy2Nq4979In3ekDrTHQoqhXW7/LjwjDnZxcDHvfW0UeG/C3NB72Li?= =?us-ascii?Q?IGQFDcc2bSeYjs2qmM6K9Xz7z58j5rBHRJJT1+hk7GvELnDFUAXNlpaXuHPr?= =?us-ascii?Q?MVG9fJXiGO3LrAxnP2sAiBtDCroFFd303srDpGLQfTgkui2k3b1hDi4JYamu?= =?us-ascii?Q?LcZW/iTOUmFZzxqfCaiedpshZIuE0yGvw9Z+Zv7XnoTRQSOsFue2jD3xDQGq?= =?us-ascii?Q?OBH1mWNSM9SMU6BGlBguDoqX4zD13t9+Qcj9yhtahNcFeG5FNornSstAsebb?= =?us-ascii?Q?rWC8/xtDpI48VJCOj5vqm/gHeTyTabgoMcgzaxI12dcWFCChyj75sNP1Wjys?= =?us-ascii?Q?HiBEfMHuunXyJT4MDvWVizZM938PGUmTujPhpdPV7yvHSVFOWGnq9kwCUpQO?= =?us-ascii?Q?DqNs9fdbvf7P1lXQNmGi0DGgA4jCYOvkTGEJhobJ04Cn8aL7hdHvPNuR3DUE?= =?us-ascii?Q?0se6lpvIHScMEJMXp+kqplChlnnzsUkiRjc5bPwevnFX0g4pEzc6GnEiABHT?= =?us-ascii?Q?TWj2zIijjuOHZMl8n2y5OmWxNV+CvUsbYoIs4TlPQzzPiVd60vE80DPEmpgN?= =?us-ascii?Q?C9N4g12nyJOpwH3wVToFNlqJCOOTqW/cvuo7ZKM5kZReE6EFm2vlVnwmoibd?= =?us-ascii?Q?Rkdy8rMGCB9v7hMt1UKXc60zkDdo+iXSZaHRsIg06kzlXnnYurOTDIDCVC8g?= =?us-ascii?Q?6BIjm0Ud5xVaJ8LDKr+aDdTX2XiX1DwzzSL1LT7+AWgB1X/YE+pDu3SbnZ9C?= =?us-ascii?Q?x3EAegruhAnVmcnyC6GU1VGYjYlsCzcMZOMScfDeDGSk4MEqR0iITr8t0LQR?= =?us-ascii?Q?VAkLVBwX1zTsNkrBua+fXXhOCvxMR8JJSdm1BjwZFibmOEetHxXyOvN7M/OM?= =?us-ascii?Q?6MRERavwXXwIwoYaJvAUNsaUQtKLt2A6bou8C/3/AXyaN3lxPIHd1fzPzeHo?= =?us-ascii?Q?a8MG4T1fqbzeveTKLuprl4Hawf7aZhdRAlCw9tqMed+nznfnnevIy3UYv1nd?= =?us-ascii?Q?tj5lxwAoNezMyanA5YHC+Ga63iiehFujgkF8oHll2wJ5OGiOk4/aZUVSuNmZ?= =?us-ascii?Q?txkSgnEcATGf5Vy0nyHkxnhVE5l+BtA5qxktw5iPrhmR+bUBjfS7rFYQ54M6?= =?us-ascii?Q?YI91za/OZN5uXxHPQAvnPXu95m69FGjNnDTqgI1r3IAifNW9FGuxTaOcXpme?= =?us-ascii?Q?aATHtw=3D=3D?= X-OriginatorOrg: syrmia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 55962daf-e7c1-483f-f741-08d9e581d66b X-MS-Exchange-CrossTenant-AuthSource: VI1PR03MB4208.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Feb 2022 12:53:26.1983 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 19214a73-c1ab-4e19-8f59-14bdcb09a66e X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: xQ7eZY0RZep5cqvTCbMB6VdoZhOaL9VT1HmDzmwlZJUso6ZFg60EWmqh0rNIjqFf6ffwyWoADUZUQ2NiqPiNWnTqMiMe9WuXdSGZEc5pj/I= X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR03MB5407 X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Feb 2022 12:53:40 -0000 From: Faraz Shahbazker 2022-02-01 Faraz Shahbazker sim/common/ChangeLog: * sim-fpu.c (sim_fpu_minmax_nan): New. (sim_fpu_max): Add variant behaviour for IEEE 754-2008. (sim_fpu_min): Likewise. (sim_fpu_is_un, sim_fpu_is_or): New. (sim_fpu_un, sim_fpu_or): New. (sim_fpu_is_ieee754_2008, sim_fpu_is_ieee754_1985): New. (sim_fpu_set_mode): New. (sim_fpu_classify): New. * sim-fpu.h (sim_fpu_minmax_nan): New declaration. (sim_fpu_un, sim_fpu_or): New declarations. (sim_fpu_is_un, sim_fpu_is_or): New declarations. (sim_fpu_mode): New enum. [sim_fpu_state](current_mode): New field. (sim_fpu_current_mode): New define. (sim_fpu_is_ieee754_2008): New declaration. (sim_fpu_is_ieee754_1985): New declaration. (sim_fpu_set_mode): New declaration. (sim_fpu_classify): New declaration. --- sim/common/sim-fpu.c | 111 +++++++++++++++++++++++++++++++++++++++++-- sim/common/sim-fpu.h | 26 +++++++++- 2 files changed, 131 insertions(+), 6 deletions(-) Changes from v3: Moved current mode into sim_fpu_state. diff --git a/sim/common/sim-fpu.c b/sim/common/sim-fpu.c index 4d16a392dc9..c6f6622612c 100644 --- a/sim/common/sim-fpu.c +++ b/sim/common/sim-fpu.c @@ -1005,6 +1005,30 @@ sim_fpu_op_nan (sim_fpu *f, const sim_fpu *l, const sim_fpu *r) return 0; } +/* NaN handling specific to min/max operations. */ + +INLINE_SIM_FPU (int) +sim_fpu_minmax_nan (sim_fpu *f, const sim_fpu *l, const sim_fpu *r) +{ + if (sim_fpu_is_snan (l) + || sim_fpu_is_snan (r) + || sim_fpu_is_ieee754_1985 ()) + return sim_fpu_op_nan (f, l, r); + else + /* if sim_fpu_is_ieee754_2008() + && ((sim_fpu_is_qnan (l) || sim_fpu_is_qnan (r))) */ + { + /* In IEEE754-2008: + * "minNum/maxNum is ... the canonicalized number if one + * operand is a number and the other a quiet NaN." */ + if (sim_fpu_is_qnan (l)) + *f = *r; + else /* if (sim_fpu_is_qnan (r)) */ + *f = *l; + return 0; + } +} + /* Arithmetic ops */ INLINE_SIM_FPU (int) @@ -1553,7 +1577,7 @@ sim_fpu_max (sim_fpu *f, const sim_fpu *r) { if (sim_fpu_is_nan (l) || sim_fpu_is_nan (r)) - return sim_fpu_op_nan (f, l, r); + return sim_fpu_minmax_nan (f, l, r); if (sim_fpu_is_infinity (l)) { if (sim_fpu_is_infinity (r) @@ -1616,7 +1640,7 @@ sim_fpu_min (sim_fpu *f, const sim_fpu *r) { if (sim_fpu_is_nan (l) || sim_fpu_is_nan (r)) - return sim_fpu_op_nan (f, l, r); + return sim_fpu_minmax_nan (f, l, r); if (sim_fpu_is_infinity (l)) { if (sim_fpu_is_infinity (r) @@ -1677,7 +1701,7 @@ INLINE_SIM_FPU (int) sim_fpu_neg (sim_fpu *f, const sim_fpu *r) { - if (sim_fpu_is_snan (r)) + if (sim_fpu_is_ieee754_1985 () && sim_fpu_is_snan (r)) { *f = *r; f->class = sim_fpu_class_qnan; @@ -1700,7 +1724,7 @@ sim_fpu_abs (sim_fpu *f, { *f = *r; f->sign = 0; - if (sim_fpu_is_snan (r)) + if (sim_fpu_is_ieee754_1985 () && sim_fpu_is_snan (r)) { f->class = sim_fpu_class_qnan; return sim_fpu_status_invalid_snan; @@ -2255,6 +2279,21 @@ sim_fpu_is_gt (const sim_fpu *l, const sim_fpu *r) return is; } +INLINE_SIM_FPU (int) +sim_fpu_is_un (const sim_fpu *l, const sim_fpu *r) +{ + int is; + sim_fpu_un (&is, l, r); + return is; +} + +INLINE_SIM_FPU (int) +sim_fpu_is_or (const sim_fpu *l, const sim_fpu *r) +{ + int is; + sim_fpu_or (&is, l, r); + return is; +} /* Compare operators */ @@ -2378,11 +2417,55 @@ sim_fpu_gt (int *is, return sim_fpu_lt (is, r, l); } +INLINE_SIM_FPU (int) +sim_fpu_un (int *is, const sim_fpu *l, const sim_fpu *r) +{ + if (sim_fpu_is_nan (l) || sim_fpu_is_nan (r)) + { + *is = 1; + return 0; + } + + *is = 0; + return 0; +} + +INLINE_SIM_FPU (int) +sim_fpu_or (int *is, const sim_fpu *l, const sim_fpu *r) +{ + sim_fpu_un (is, l, r); + + /* Invert result. */ + *is = !*is; + return 0; +} + +INLINE_SIM_FPU(int) +sim_fpu_classify (const sim_fpu *f) +{ + switch (f->class) + { + case sim_fpu_class_snan: return SIM_FPU_IS_SNAN; + case sim_fpu_class_qnan: return SIM_FPU_IS_QNAN; + case sim_fpu_class_infinity: + return f->sign ? SIM_FPU_IS_NINF : SIM_FPU_IS_PINF; + case sim_fpu_class_zero: + return f->sign ? SIM_FPU_IS_NZERO : SIM_FPU_IS_PZERO; + case sim_fpu_class_number: + return f->sign ? SIM_FPU_IS_NNUMBER : SIM_FPU_IS_PNUMBER; + case sim_fpu_class_denorm: + return f->sign ? SIM_FPU_IS_NDENORM : SIM_FPU_IS_PDENORM; + default: + fprintf (stderr, "Bad switch\n"); + abort (); + } + return 0; +} /* A number of useful constants */ #if EXTERN_SIM_FPU_P -sim_fpu_state _sim_fpu = { /* quiet_nan_inverted */ false }; +sim_fpu_state _sim_fpu = { /* quiet_nan_inverted */ false, sim_fpu_ieee754_1985 }; const sim_fpu sim_fpu_zero = { sim_fpu_class_zero, 0, 0, 0 @@ -2404,6 +2487,24 @@ const sim_fpu sim_fpu_max64 = { }; #endif +/* Specification swapping behaviour */ +INLINE_SIM_FPU (bool) +sim_fpu_is_ieee754_1985 (void) +{ + return (sim_fpu_current_mode == sim_fpu_ieee754_1985); +} + +INLINE_SIM_FPU (bool) +sim_fpu_is_ieee754_2008 (void) +{ + return (sim_fpu_current_mode == sim_fpu_ieee754_2008); +} + +INLINE_SIM_FPU (void) +sim_fpu_set_mode (const sim_fpu_mode m) +{ + sim_fpu_current_mode = m; +} /* For debugging */ diff --git a/sim/common/sim-fpu.h b/sim/common/sim-fpu.h index 228d2c7e1d6..b192f2deaec 100644 --- a/sim/common/sim-fpu.h +++ b/sim/common/sim-fpu.h @@ -163,8 +163,15 @@ typedef enum FIXME: This state is global, but should be moved to SIM_CPU . */ +typedef enum +{ + sim_fpu_ieee754_1985, + sim_fpu_ieee754_2008, +} sim_fpu_mode; + typedef struct _sim_fpu_state { bool quiet_nan_inverted; /* Toggle quiet NaN semantics. */ + sim_fpu_mode current_mode; } sim_fpu_state; @@ -268,6 +275,8 @@ INLINE_SIM_FPU (int) sim_fpu_sqrt (sim_fpu *f, INLINE_SIM_FPU (int) sim_fpu_op_nan (sim_fpu *f, const sim_fpu *l, const sim_fpu *r); +INLINE_SIM_FPU (int) sim_fpu_minmax_nan (sim_fpu *f, + const sim_fpu *l, const sim_fpu *r); @@ -318,7 +327,8 @@ INLINE_SIM_FPU (double) sim_fpu_2d (const sim_fpu *d); /* INLINE_SIM_FPU (void) sim_fpu_f2 (sim_fpu *f, float s); */ INLINE_SIM_FPU (void) sim_fpu_d2 (sim_fpu *f, double d); - +/* IEEE754-2008 classifiction function. */ +INLINE_SIM_FPU (int) sim_fpu_classify (const sim_fpu *f); /* Specific number classes. @@ -367,7 +377,20 @@ INLINE_SIM_FPU (int) sim_fpu_is_ne (const sim_fpu *l, const sim_fpu *r); INLINE_SIM_FPU (int) sim_fpu_is_ge (const sim_fpu *l, const sim_fpu *r); INLINE_SIM_FPU (int) sim_fpu_is_gt (const sim_fpu *l, const sim_fpu *r); +/* Unordered/ordered comparison operators */ + +INLINE_SIM_FPU (int) sim_fpu_un (int *is, const sim_fpu *l, const sim_fpu *r); +INLINE_SIM_FPU (int) sim_fpu_or (int *is, const sim_fpu *l, const sim_fpu *r); + +INLINE_SIM_FPU (int) sim_fpu_is_un (const sim_fpu *l, const sim_fpu *r); +INLINE_SIM_FPU (int) sim_fpu_is_or (const sim_fpu *l, const sim_fpu *r); + +/* Changes the behaviour of the library to IEEE754-2008 or IEEE754-1985. + * The default for the library is IEEE754-1985. */ +INLINE_SIM_FPU (bool) sim_fpu_is_ieee754_1985 (void); +INLINE_SIM_FPU (bool) sim_fpu_is_ieee754_2008 (void); +INLINE_SIM_FPU (void) sim_fpu_set_mode (const sim_fpu_mode m); /* General number class and comparison operators. @@ -411,6 +434,7 @@ extern sim_fpu_state _sim_fpu; between pre-R6 and R6 MIPS cores. */ #define sim_fpu_quiet_nan_inverted _sim_fpu.quiet_nan_inverted +#define sim_fpu_current_mode _sim_fpu.current_mode /* A number of useful constants. */ -- 2.17.1