~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/mips/math-emu/ieee754.c

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 // SPDX-License-Identifier: GPL-2.0-only
  2 /* ieee754 floating point arithmetic
  3  * single and double precision
  4  *
  5  * BUGS
  6  * not much dp done
  7  * doesn't generate IEEE754_INEXACT
  8  */
  9 /*
 10  * MIPS floating point support
 11  * Copyright (C) 1994-2000 Algorithmics Ltd.
 12  */
 13 
 14 #include <linux/compiler.h>
 15 
 16 #include "ieee754.h"
 17 #include "ieee754sp.h"
 18 #include "ieee754dp.h"
 19 
 20 /*
 21  * Special constants
 22  */
 23 
 24 /*
 25  * Older GCC requires the inner braces for initialization of union ieee754dp's
 26  * anonymous struct member.  Without an error will result.
 27  */
 28 #define xPCNST(s, b, m, ebias)                                          \
 29 {                                                                       \
 30         {                                                               \
 31                 .sign   = (s),                                          \
 32                 .bexp   = (b) + ebias,                                  \
 33                 .mant   = (m)                                           \
 34         }                                                               \
 35 }
 36 
 37 #define DPCNST(s, b, m)                                                 \
 38         xPCNST(s, b, m, DP_EBIAS)
 39 
 40 const union ieee754dp __ieee754dp_spcvals[] = {
 41         DPCNST(0, DP_EMIN - 1, 0x0000000000000ULL),     /* + zero   */
 42         DPCNST(1, DP_EMIN - 1, 0x0000000000000ULL),     /* - zero   */
 43         DPCNST(0, 0,           0x0000000000000ULL),     /* + 1.0   */
 44         DPCNST(1, 0,           0x0000000000000ULL),     /* - 1.0   */
 45         DPCNST(0, 3,           0x4000000000000ULL),     /* + 10.0   */
 46         DPCNST(1, 3,           0x4000000000000ULL),     /* - 10.0   */
 47         DPCNST(0, DP_EMAX + 1, 0x0000000000000ULL),     /* + infinity */
 48         DPCNST(1, DP_EMAX + 1, 0x0000000000000ULL),     /* - infinity */
 49         DPCNST(0, DP_EMAX + 1, 0x7FFFFFFFFFFFFULL),     /* + ind legacy qNaN */
 50         DPCNST(0, DP_EMAX + 1, 0x8000000000000ULL),     /* + indef 2008 qNaN */
 51         DPCNST(0, DP_EMAX,     0xFFFFFFFFFFFFFULL),     /* + max */
 52         DPCNST(1, DP_EMAX,     0xFFFFFFFFFFFFFULL),     /* - max */
 53         DPCNST(0, DP_EMIN,     0x0000000000000ULL),     /* + min normal */
 54         DPCNST(1, DP_EMIN,     0x0000000000000ULL),     /* - min normal */
 55         DPCNST(0, DP_EMIN - 1, 0x0000000000001ULL),     /* + min denormal */
 56         DPCNST(1, DP_EMIN - 1, 0x0000000000001ULL),     /* - min denormal */
 57         DPCNST(0, 31,          0x0000000000000ULL),     /* + 1.0e31 */
 58         DPCNST(0, 63,          0x0000000000000ULL),     /* + 1.0e63 */
 59 };
 60 
 61 #define SPCNST(s, b, m)                                                 \
 62         xPCNST(s, b, m, SP_EBIAS)
 63 
 64 const union ieee754sp __ieee754sp_spcvals[] = {
 65         SPCNST(0, SP_EMIN - 1, 0x000000),       /* + zero   */
 66         SPCNST(1, SP_EMIN - 1, 0x000000),       /* - zero   */
 67         SPCNST(0, 0,           0x000000),       /* + 1.0   */
 68         SPCNST(1, 0,           0x000000),       /* - 1.0   */
 69         SPCNST(0, 3,           0x200000),       /* + 10.0   */
 70         SPCNST(1, 3,           0x200000),       /* - 10.0   */
 71         SPCNST(0, SP_EMAX + 1, 0x000000),       /* + infinity */
 72         SPCNST(1, SP_EMAX + 1, 0x000000),       /* - infinity */
 73         SPCNST(0, SP_EMAX + 1, 0x3FFFFF),       /* + indef legacy quiet NaN */
 74         SPCNST(0, SP_EMAX + 1, 0x400000),       /* + indef 2008 quiet NaN */
 75         SPCNST(0, SP_EMAX,     0x7FFFFF),       /* + max normal */
 76         SPCNST(1, SP_EMAX,     0x7FFFFF),       /* - max normal */
 77         SPCNST(0, SP_EMIN,     0x000000),       /* + min normal */
 78         SPCNST(1, SP_EMIN,     0x000000),       /* - min normal */
 79         SPCNST(0, SP_EMIN - 1, 0x000001),       /* + min denormal */
 80         SPCNST(1, SP_EMIN - 1, 0x000001),       /* - min denormal */
 81         SPCNST(0, 31,          0x000000),       /* + 1.0e31 */
 82         SPCNST(0, 63,          0x000000),       /* + 1.0e63 */
 83 };
 84 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php