epoc32/include/libc/machine/ieeefp.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:27:01 +0100
branchSymbian2
changeset 3 e1b950c65cb4
parent 0 061f57f2323e
child 4 837f303aceeb
permissions -rw-r--r--
Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
     1 /*
     2 * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     5 * under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description:
    15 *
    16 */
    17 
    18 
    19 
    20 
    21 
    22 
    23 /**
    24  @file
    25  @publishedAll
    26  @released
    27 */
    28 
    29 #ifndef __IEEE_BIG_ENDIAN
    30 #ifndef __IEEE_LITTLE_ENDIAN
    31 
    32 /**
    33 EPOC safety net - Check various EPOC defines to ensure that
    34 we get an appropriate endianness choice
    35 */
    36 #if (defined(__WINS__) || defined(__MX86__)) && !defined(__i386__)
    37 #define __i386__
    38 #elif defined(__MARM__) && !defined(__arm__)
    39 #define __arm__
    40 #endif
    41 
    42 #ifdef __arm__
    43 	#ifdef __EABI__
    44 	/**
    45 	EABI supports the VFP specification, where the ordering of the words
    46 	matches the endianness.
    47 	*/
    48 	#define __IEEE_LITTLE_ENDIAN
    49 #else
    50 	/** 
    51 	Pre-VFP, ARM used the big endian ordering of the words, regardless of
    52 	the endianess. 
    53 	*/
    54 	#define __IEEE_BIG_ENDIAN
    55 	#endif
    56 #endif
    57 
    58 #ifdef __hppa__
    59 
    60 #define __IEEE_BIG_ENDIAN
    61 #endif
    62 
    63 #ifdef __sparc__
    64 
    65 #define __IEEE_BIG_ENDIAN
    66 #endif
    67 
    68 #if defined(__m68k__) || defined(__mc68000__)
    69 
    70 #define __IEEE_BIG_ENDIAN
    71 #endif
    72 
    73 #if defined (__H8300__) || defined (__H8300H__)
    74 
    75 #define __IEEE_BIG_ENDIAN
    76 #define __SMALL_BITFIELDS
    77 #define _DOUBLE_IS_32BITS
    78 #endif
    79 
    80 #ifdef __H8500__
    81 
    82 #define __IEEE_BIG_ENDIAN
    83 #define __SMALL_BITFIELDS
    84 #define _DOUBLE_IS_32BITS
    85 #endif
    86 
    87 #ifdef __sh__
    88 #ifdef __LITTLE_ENDIAN__
    89 
    90 #define __IEEE_LITTLE_ENDIAN
    91 #else
    92 #define __IEEE_BIG_ENDIAN
    93 #endif
    94 #ifdef __SH3E__
    95 
    96 #define _DOUBLE_IS_32BITS
    97 #endif
    98 #endif
    99 
   100 #ifdef _AM29K
   101 
   102 #define __IEEE_BIG_ENDIAN
   103 #endif
   104 
   105 /* Added "&& !defined(__arm__)" to avoid the duplicate definition of the
   106    __ieee_[float|double]_shape_type structures in stdlib\LINC\IEEEFP.h 
   107    conditionally compiled using the __IEEE_LITTLE_ENDIAN && __IEEE_BIG_ENDIAN 
   108    in GCCXML builds. This is a work around as we can't get gccxml to stop 
   109    defining __i386__ as it's defined in the "<built-in>" header file of the 
   110    compiler.
   111 */
   112 #if defined(__i386__) && !defined(__arm__)
   113 
   114 #define __IEEE_LITTLE_ENDIAN
   115 #endif
   116 
   117 #ifdef __i960__
   118 
   119 #define __IEEE_LITTLE_ENDIAN
   120 #endif
   121 
   122 #ifdef __MIPSEL__
   123 
   124 #define __IEEE_LITTLE_ENDIAN
   125 #endif
   126 #ifdef __MIPSEB__
   127 
   128 #define __IEEE_BIG_ENDIAN
   129 #endif
   130 
   131 /**
   132 necv70 was __IEEE_LITTLE_ENDIAN. 
   133 */
   134 
   135 #ifdef __W65__
   136 
   137 #define __IEEE_LITTLE_ENDIAN
   138 #define __SMALL_BITFIELDS
   139 #define _DOUBLE_IS_32BITS
   140 #endif
   141 
   142 #if defined(__Z8001__) || defined(__Z8002__)
   143 
   144 #define __IEEE_BIG_ENDIAN
   145 #endif
   146 
   147 #ifdef __m88k__
   148 
   149 #define __IEEE_BIG_ENDIAN
   150 #endif
   151 
   152 #ifdef __v800
   153 
   154 #define __IEEE_LITTLE_ENDIAN
   155 #endif
   156 
   157 #ifdef __PPC__
   158 #ifdef _BIG_ENDIAN
   159 
   160 #define __IEEE_BIG_ENDIAN
   161 #else
   162 
   163 #define __IEEE_LITTLE_ENDIAN
   164 #endif
   165 #endif
   166 
   167 #ifdef __mcore__
   168 
   169 #define __IEEE_LITTLE_ENDIAN	/* always little-endian M*Core for EPOC */
   170 #endif
   171 
   172 #ifndef __IEEE_BIG_ENDIAN
   173 #ifndef __IEEE_LITTLE_ENDIAN
   174 #error Endianess not declared!!
   175 #endif /* not __IEEE_LITTLE_ENDIAN */
   176 #endif /* not __IEEE_BIG_ENDIAN */
   177 
   178 #endif /* not __IEEE_LITTLE_ENDIAN */
   179 #endif /* not __IEEE_BIG_ENDIAN */