< prev index next >

src/java.base/share/native/libfdlibm/fdlibm.h

Print this page


   1 /*
   2  * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 #ifdef _ALLBSD_SOURCE
  27 #include <machine/endian.h>
  28 #elif __linux__
  29 #define __USE_BSD 1
  30 #include <endian.h>
  31 #endif
  32 #include "jfdlibm.h"
  33 
  34 #ifdef __NEWVALID       /* special setup for Sun test regime */
  35 #if defined(i386) || defined(i486) || \
  36     defined(intel) || defined(x86) || defined(arm) || \
  37     defined(i86pc) || defined(_M_IA64) || defined(ia64)
  38 #define _LITTLE_ENDIAN
  39 #endif
  40 #endif
  41 
  42 #ifdef _LITTLE_ENDIAN
  43 #define __HI(x) *(1+(int*)&x)
  44 #define __LO(x) *(int*)&x
  45 #define __HIp(x) *(1+(int*)x)
  46 #define __LOp(x) *(int*)x
  47 #else
  48 #define __HI(x) *(int*)&x
  49 #define __LO(x) *(1+(int*)&x)
  50 #define __HIp(x) *(int*)x
  51 #define __LOp(x) *(1+(int*)x)
  52 #endif
  53 
  54 #ifndef __P
  55 #ifdef __STDC__
  56 #define __P(p)  p
  57 #else


   1 /*
   2  * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 #ifdef _ALLBSD_SOURCE
  27 #include <machine/endian.h>
  28 #elif __linux__
  29 #define __USE_BSD 1
  30 #include <endian.h>
  31 #endif
  32 #include "jfdlibm.h"
  33 
  34 #ifdef __NEWVALID       /* special setup for Sun test regime */
  35 #if defined(i386) || defined(i486) || \
  36     defined(intel) || defined(x86) || defined(arm) || \
  37     defined(i86pc) || defined(ia64)
  38 #define _LITTLE_ENDIAN
  39 #endif
  40 #endif
  41 
  42 #ifdef _LITTLE_ENDIAN
  43 #define __HI(x) *(1+(int*)&x)
  44 #define __LO(x) *(int*)&x
  45 #define __HIp(x) *(1+(int*)x)
  46 #define __LOp(x) *(int*)x
  47 #else
  48 #define __HI(x) *(int*)&x
  49 #define __LO(x) *(1+(int*)&x)
  50 #define __HIp(x) *(int*)x
  51 #define __LOp(x) *(1+(int*)x)
  52 #endif
  53 
  54 #ifndef __P
  55 #ifdef __STDC__
  56 #define __P(p)  p
  57 #else


< prev index next >