# 1 "" # 1 "test2.cpp" // test framework #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 2 "test2.cpp" # 1 "/usr/include/stdio.h" 1 3 4 /* Define ISO C stdio on top of C++ iostreams. Copyright (C) 1991-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard: 7.19 Input/output */ #ifndef _STDIO_H #if !defined __need_FILE && !defined __need___FILE # define _STDIO_H 1 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 27 "/usr/include/stdio.h" 3 4 # 1 "/usr/include/features.h" 1 3 4 /* Copyright (C) 1991-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _FEATURES_H #define _FEATURES_H 1 /* These are defined by the user (or the compiler) to specify the desired environment: __STRICT_ANSI__ ISO Standard C. _ISOC99_SOURCE Extensions to ISO C89 from ISO C99. _ISOC11_SOURCE Extensions to ISO C99 from ISO C11. _POSIX_SOURCE IEEE Std 1003.1. _POSIX_C_SOURCE If ==1, like _POSIX_SOURCE; if >=2 add IEEE Std 1003.2; if >=199309L, add IEEE Std 1003.1b-1993; if >=199506L, add IEEE Std 1003.1c-1995; if >=200112L, all of IEEE 1003.1-2004 if >=200809L, all of IEEE 1003.1-2008 _XOPEN_SOURCE Includes POSIX and XPG things. Set to 500 if Single Unix conformance is wanted, to 600 for the sixth revision, to 700 for the seventh revision. _XOPEN_SOURCE_EXTENDED XPG things and X/Open Unix extensions. _LARGEFILE_SOURCE Some more functions for correct standard I/O. _LARGEFILE64_SOURCE Additional functionality from LFS for large files. _FILE_OFFSET_BITS=N Select default filesystem interface. _BSD_SOURCE ISO C, POSIX, and 4.3BSD things. _SVID_SOURCE ISO C, POSIX, and SVID things. _ATFILE_SOURCE Additional *at interfaces. _GNU_SOURCE All of the above, plus GNU extensions. _DEFAULT_SOURCE The default set of features (taking precedence over __STRICT_ANSI__). _REENTRANT Select additionally reentrant object. _THREAD_SAFE Same as _REENTRANT, often used by other systems. _FORTIFY_SOURCE If set to numeric value > 0 additional security measures are defined, according to level. The `-ansi' switch to the GNU C compiler, and standards conformance options such as `-std=c99', define __STRICT_ANSI__. If none of these are defined, or if _DEFAULT_SOURCE is defined, the default is to have _SVID_SOURCE, _BSD_SOURCE, and _POSIX_SOURCE set to one and _POSIX_C_SOURCE set to 200809L. If more than one of these are defined, they accumulate. For example __STRICT_ANSI__, _POSIX_SOURCE and _POSIX_C_SOURCE together give you ISO C, 1003.1, and 1003.2, but nothing else. These are defined by this file and are used by the header files to decide what to declare or define: __USE_ISOC11 Define ISO C11 things. __USE_ISOC99 Define ISO C99 things. __USE_ISOC95 Define ISO C90 AMD1 (C95) things. __USE_POSIX Define IEEE Std 1003.1 things. __USE_POSIX2 Define IEEE Std 1003.2 things. __USE_POSIX199309 Define IEEE Std 1003.1, and .1b things. __USE_POSIX199506 Define IEEE Std 1003.1, .1b, .1c and .1i things. __USE_XOPEN Define XPG things. __USE_XOPEN_EXTENDED Define X/Open Unix things. __USE_UNIX98 Define Single Unix V2 things. __USE_XOPEN2K Define XPG6 things. __USE_XOPEN2KXSI Define XPG6 XSI things. __USE_XOPEN2K8 Define XPG7 things. __USE_XOPEN2K8XSI Define XPG7 XSI things. __USE_LARGEFILE Define correct standard I/O things. __USE_LARGEFILE64 Define LFS things with separate names. __USE_FILE_OFFSET64 Define 64bit interface as default. __USE_BSD Define 4.3BSD things. __USE_SVID Define SVID things. __USE_MISC Define things common to BSD and System V Unix. __USE_ATFILE Define *at interfaces and AT_* constants for them. __USE_GNU Define GNU extensions. __USE_REENTRANT Define reentrant/thread-safe *_r functions. __USE_FORTIFY_LEVEL Additional security measures used, according to level. The macros `__GNU_LIBRARY__', `__GLIBC__', and `__GLIBC_MINOR__' are defined by this file unconditionally. `__GNU_LIBRARY__' is provided only for compatibility. All new code should use the other symbols to test for features. All macros listed above as possibly being defined by this file are explicitly undefined if they are not explicitly defined. Feature-test macros that are not defined by the user or compiler but are implied by the other feature-test macros defined (or by the lack of any definitions) are defined by the file. */ /* Undefine everything, so we get a clean slate. */ #undef __USE_ISOC11 #undef __USE_ISOC99 #undef __USE_ISOC95 #undef __USE_ISOCXX11 #undef __USE_POSIX #undef __USE_POSIX2 #undef __USE_POSIX199309 #undef __USE_POSIX199506 #undef __USE_XOPEN #undef __USE_XOPEN_EXTENDED #undef __USE_UNIX98 #undef __USE_XOPEN2K #undef __USE_XOPEN2KXSI #undef __USE_XOPEN2K8 #undef __USE_XOPEN2K8XSI #undef __USE_LARGEFILE #undef __USE_LARGEFILE64 #undef __USE_FILE_OFFSET64 #undef __USE_BSD #undef __USE_SVID #undef __USE_MISC #undef __USE_ATFILE #undef __USE_GNU #undef __USE_REENTRANT #undef __USE_FORTIFY_LEVEL #undef __KERNEL_STRICT_NAMES /* Suppress kernel-name space pollution unless user expressedly asks for it. */ #ifndef _LOOSE_KERNEL_NAMES # define __KERNEL_STRICT_NAMES #endif # 133 "/usr/include/features.h" 3 4 /* Convenience macros to test the versions of glibc and gcc. Use them like this: #if __GNUC_PREREQ (2,8) ... code requiring gcc 2.8 or later ... #endif Note - they won't work for gcc1 or glibc1, since the _MINOR macros were not defined then. */ #if defined __GNUC__ && defined __GNUC_MINOR__ # define __GNUC_PREREQ(maj, min) \ ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) #else # 145 "/usr/include/features.h" 3 4 # define __GNUC_PREREQ(maj, min) 0 #endif # 147 "/usr/include/features.h" 3 4 /* If _GNU_SOURCE was defined by the user, turn on all the other features. */ #ifdef _GNU_SOURCE # undef _ISOC95_SOURCE # define _ISOC95_SOURCE 1 # undef _ISOC99_SOURCE # define _ISOC99_SOURCE 1 # undef _ISOC11_SOURCE # define _ISOC11_SOURCE 1 # undef _POSIX_SOURCE # define _POSIX_SOURCE 1 # undef _POSIX_C_SOURCE # define _POSIX_C_SOURCE 200809L # undef _XOPEN_SOURCE # define _XOPEN_SOURCE 700 # undef _XOPEN_SOURCE_EXTENDED # define _XOPEN_SOURCE_EXTENDED 1 # undef _LARGEFILE64_SOURCE # define _LARGEFILE64_SOURCE 1 # undef _DEFAULT_SOURCE # define _DEFAULT_SOURCE 1 # undef _BSD_SOURCE # define _BSD_SOURCE 1 # undef _SVID_SOURCE # define _SVID_SOURCE 1 # undef _ATFILE_SOURCE # define _ATFILE_SOURCE 1 #endif # 176 "/usr/include/features.h" 3 4 /* If nothing (other than _GNU_SOURCE and _DEFAULT_SOURCE) is defined, define _DEFAULT_SOURCE, _BSD_SOURCE and _SVID_SOURCE. */ #if (defined _DEFAULT_SOURCE \ || (!defined __STRICT_ANSI__ \ && !defined _ISOC99_SOURCE \ && !defined _POSIX_SOURCE && !defined _POSIX_C_SOURCE \ && !defined _XOPEN_SOURCE \ && !defined _BSD_SOURCE && !defined _SVID_SOURCE)) # undef _DEFAULT_SOURCE # define _DEFAULT_SOURCE 1 # undef _BSD_SOURCE # define _BSD_SOURCE 1 # undef _SVID_SOURCE # define _SVID_SOURCE 1 #endif # 192 "/usr/include/features.h" 3 4 /* This is to enable the ISO C11 extension. */ #if (defined _ISOC11_SOURCE \ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 201112L)) # define __USE_ISOC11 1 #endif # 198 "/usr/include/features.h" 3 4 /* This is to enable the ISO C99 extension. */ #if (defined _ISOC99_SOURCE || defined _ISOC11_SOURCE \ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)) # define __USE_ISOC99 1 #endif # 204 "/usr/include/features.h" 3 4 /* This is to enable the ISO C90 Amendment 1:1995 extension. */ #if (defined _ISOC99_SOURCE || defined _ISOC11_SOURCE \ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199409L)) # define __USE_ISOC95 1 #endif # 210 "/usr/include/features.h" 3 4 /* This is to enable compatibility for ISO C++11. So far g++ does not provide a macro. Check the temporary macro for now, too. */ #if ((defined __cplusplus && __cplusplus >= 201103L) \ || defined __GXX_EXPERIMENTAL_CXX0X__) # define __USE_ISOCXX11 1 #endif # 219 "/usr/include/features.h" 3 4 /* If none of the ANSI/POSIX macros are defined, or if _DEFAULT_SOURCE is defined, use POSIX.1-2008 (or another version depending on _XOPEN_SOURCE). */ #ifdef _DEFAULT_SOURCE # if !defined _POSIX_SOURCE && !defined _POSIX_C_SOURCE # define __USE_POSIX_IMPLICITLY 1 # endif # 227 "/usr/include/features.h" 3 4 # undef _POSIX_SOURCE # define _POSIX_SOURCE 1 # undef _POSIX_C_SOURCE # define _POSIX_C_SOURCE 200809L #endif # 232 "/usr/include/features.h" 3 4 #if ((!defined __STRICT_ANSI__ || (_XOPEN_SOURCE - 0) >= 500) && \ !defined _POSIX_SOURCE && !defined _POSIX_C_SOURCE) # define _POSIX_SOURCE 1 # if defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) < 500 # define _POSIX_C_SOURCE 2 # elif defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) < 600 # 238 "/usr/include/features.h" 3 4 # define _POSIX_C_SOURCE 199506L # elif defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) < 700 # 240 "/usr/include/features.h" 3 4 # define _POSIX_C_SOURCE 200112L # else # 242 "/usr/include/features.h" 3 4 # define _POSIX_C_SOURCE 200809L # endif # 244 "/usr/include/features.h" 3 4 # define __USE_POSIX_IMPLICITLY 1 #endif # 246 "/usr/include/features.h" 3 4 #if defined _POSIX_SOURCE || _POSIX_C_SOURCE >= 1 || defined _XOPEN_SOURCE # define __USE_POSIX 1 #endif # 250 "/usr/include/features.h" 3 4 #if defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 2 || defined _XOPEN_SOURCE # define __USE_POSIX2 1 #endif # 254 "/usr/include/features.h" 3 4 #if (_POSIX_C_SOURCE - 0) >= 199309L # define __USE_POSIX199309 1 #endif # 258 "/usr/include/features.h" 3 4 #if (_POSIX_C_SOURCE - 0) >= 199506L # define __USE_POSIX199506 1 #endif # 262 "/usr/include/features.h" 3 4 #if (_POSIX_C_SOURCE - 0) >= 200112L # define __USE_XOPEN2K 1 # undef __USE_ISOC95 # define __USE_ISOC95 1 # undef __USE_ISOC99 # define __USE_ISOC99 1 #endif # 270 "/usr/include/features.h" 3 4 #if (_POSIX_C_SOURCE - 0) >= 200809L # define __USE_XOPEN2K8 1 # undef _ATFILE_SOURCE # define _ATFILE_SOURCE 1 #endif # 276 "/usr/include/features.h" 3 4 #ifdef _XOPEN_SOURCE # define __USE_XOPEN 1 # if (_XOPEN_SOURCE - 0) >= 500 # define __USE_XOPEN_EXTENDED 1 # define __USE_UNIX98 1 # undef _LARGEFILE_SOURCE # define _LARGEFILE_SOURCE 1 # if (_XOPEN_SOURCE - 0) >= 600 # if (_XOPEN_SOURCE - 0) >= 700 # define __USE_XOPEN2K8 1 # define __USE_XOPEN2K8XSI 1 # endif # 289 "/usr/include/features.h" 3 4 # define __USE_XOPEN2K 1 # define __USE_XOPEN2KXSI 1 # undef __USE_ISOC95 # define __USE_ISOC95 1 # undef __USE_ISOC99 # define __USE_ISOC99 1 # endif # 296 "/usr/include/features.h" 3 4 # else # 297 "/usr/include/features.h" 3 4 # ifdef _XOPEN_SOURCE_EXTENDED # define __USE_XOPEN_EXTENDED 1 # endif # 300 "/usr/include/features.h" 3 4 # endif # 301 "/usr/include/features.h" 3 4 #endif # 302 "/usr/include/features.h" 3 4 #ifdef _LARGEFILE_SOURCE # define __USE_LARGEFILE 1 #endif # 306 "/usr/include/features.h" 3 4 #ifdef _LARGEFILE64_SOURCE # define __USE_LARGEFILE64 1 #endif # 310 "/usr/include/features.h" 3 4 #if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64 # define __USE_FILE_OFFSET64 1 #endif # 314 "/usr/include/features.h" 3 4 #if defined _BSD_SOURCE || defined _SVID_SOURCE # define __USE_MISC 1 #endif # 318 "/usr/include/features.h" 3 4 #ifdef _BSD_SOURCE # define __USE_BSD 1 #endif # 322 "/usr/include/features.h" 3 4 #ifdef _SVID_SOURCE # define __USE_SVID 1 #endif # 326 "/usr/include/features.h" 3 4 #ifdef _ATFILE_SOURCE # define __USE_ATFILE 1 #endif # 330 "/usr/include/features.h" 3 4 #ifdef _GNU_SOURCE # define __USE_GNU 1 #endif # 334 "/usr/include/features.h" 3 4 #if defined _REENTRANT || defined _THREAD_SAFE # define __USE_REENTRANT 1 #endif # 338 "/usr/include/features.h" 3 4 #if defined _FORTIFY_SOURCE && _FORTIFY_SOURCE > 0 \ && __GNUC_PREREQ (4, 1) && defined __OPTIMIZE__ && __OPTIMIZE__ > 0 # if _FORTIFY_SOURCE > 1 # define __USE_FORTIFY_LEVEL 2 # else # 344 "/usr/include/features.h" 3 4 # define __USE_FORTIFY_LEVEL 1 # endif # 346 "/usr/include/features.h" 3 4 #else # 347 "/usr/include/features.h" 3 4 # define __USE_FORTIFY_LEVEL 0 #endif # 349 "/usr/include/features.h" 3 4 /* Get definitions of __STDC_* predefined macros, if the compiler has not preincluded this header automatically. */ #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 352 "/usr/include/features.h" 3 4 # 1 "/usr/include/stdc-predef.h" 1 3 4 /* Copyright (C) 1991-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _STDC_PREDEF_H #define _STDC_PREDEF_H 1 /* This header is separate from features.h so that the compiler can include it implicitly at the start of every compilation. It must not itself include or any other header that includes because the implicit include comes before any feature test macros that may be defined in a source file before it first explicitly includes a system header. GCC knows the name of this header in order to preinclude it. */ /* glibc's intent is to support the IEC 559 math functionality, real and complex. If the GCC (4.9 and later) predefined macros specifying compiler intent are available, use them to determine whether the overall intent is to support these features; otherwise, presume an older compiler has intent to support these features and define these macros by default. */ #ifdef __GCC_IEC_559 # if __GCC_IEC_559 > 0 # define __STDC_IEC_559__ 1 # endif # 40 "/usr/include/stdc-predef.h" 3 4 #else # 41 "/usr/include/stdc-predef.h" 3 4 # define __STDC_IEC_559__ 1 #endif # 43 "/usr/include/stdc-predef.h" 3 4 #ifdef __GCC_IEC_559_COMPLEX # if __GCC_IEC_559_COMPLEX > 0 # define __STDC_IEC_559_COMPLEX__ 1 # endif # 48 "/usr/include/stdc-predef.h" 3 4 #else # 49 "/usr/include/stdc-predef.h" 3 4 # define __STDC_IEC_559_COMPLEX__ 1 #endif # 51 "/usr/include/stdc-predef.h" 3 4 /* wchar_t uses ISO/IEC 10646 (2nd ed., published 2011-03-15) / Unicode 6.0. */ #define __STDC_ISO_10646__ 201103L /* We do not support C11 . */ #define __STDC_NO_THREADS__ 1 #endif # 60 "/usr/include/stdc-predef.h" 3 4 # 353 "/usr/include/features.h" 2 3 4 /* This macro indicates that the installed library is the GNU C Library. For historic reasons the value now is 6 and this will stay from now on. The use of this variable is deprecated. Use __GLIBC__ and __GLIBC_MINOR__ now (see below) when you want to test for a specific GNU C library version and use the values in to get the sonames of the shared libraries. */ #undef __GNU_LIBRARY__ #define __GNU_LIBRARY__ 6 /* Major and minor version number of the GNU C library package. Use these macros to test for features in specific releases. */ #define __GLIBC__ 2 #define __GLIBC_MINOR__ 19 #define __GLIBC_PREREQ(maj, min) \ ((__GLIBC__ << 16) + __GLIBC_MINOR__ >= ((maj) << 16) + (min)) /* This is here only because every header file already includes this one. */ #ifndef __ASSEMBLER__ # ifndef _SYS_CDEFS_H #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 374 "/usr/include/features.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4 /* Copyright (C) 1992-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_CDEFS_H #define _SYS_CDEFS_H 1 /* We are almost always included from features.h. */ #ifndef _FEATURES_H #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 23 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 # 24 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 #endif # 25 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 /* The GNU libc does not support any K&R compilers or the traditional mode of ISO C compilers anymore. Check for some of the combinations not anymore supported. */ #if defined __GNUC__ && !defined __STDC__ # error "You need a ISO C conforming compiler to use the glibc headers" #endif # 32 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 /* Some user header file might have defined this before. */ #undef __P #undef __PMT #ifdef __GNUC__ /* All functions, except those with callbacks or those that synchronize memory, are leaf functions. */ # if __GNUC_PREREQ (4, 6) && !defined _LIBC # define __LEAF , __leaf__ # define __LEAF_ATTR __attribute__ ((__leaf__)) # else # 45 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 # define __LEAF # define __LEAF_ATTR # endif # 48 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 /* GCC can always grok prototypes. For C++ programs we add throw() to help it optimize the function calls. But this works only with gcc 2.8.x and egcs. For gcc 3.2 and up we even mark C functions as non-throwing using a function attribute since programs can use the -fexceptions options for C code as well. */ # if !defined __cplusplus && __GNUC_PREREQ (3, 3) # define __THROW __attribute__ ((__nothrow__ __LEAF)) # define __THROWNL __attribute__ ((__nothrow__)) # define __NTH(fct) __attribute__ ((__nothrow__ __LEAF)) fct # else # 59 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 # if defined __cplusplus && __GNUC_PREREQ (2,8) # define __THROW throw () # define __THROWNL throw () # define __NTH(fct) __LEAF_ATTR fct throw () # else # 64 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 # define __THROW # define __THROWNL # define __NTH(fct) fct # endif # 68 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 # endif # 69 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 #else /* Not GCC. */ # 71 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 # define __inline /* No inline functions. */ # define __THROW # define __THROWNL # define __NTH(fct) fct #endif /* GCC. */ # 79 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 /* These two macros are not used in glibc anymore. They are kept here only because some other projects expect the macros to be defined. */ #define __P(args) args #define __PMT(args) args /* For these things, GCC behaves the ANSI way normally, and the non-ANSI way under -traditional. */ #define __CONCAT(x,y) x ## y #define __STRING(x) #x /* This is not a typedef so `const __ptr_t' does the right thing. */ #define __ptr_t void * #define __long_double_t long double /* C++ needs to know that types and declarations are C, not C++. */ #ifdef __cplusplus # define __BEGIN_DECLS extern "C" { # define __END_DECLS } #else # 101 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 # define __BEGIN_DECLS # define __END_DECLS #endif # 104 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 /* The standard library needs the functions from the ISO C90 standard in the std namespace. At the same time we want to be safe for future changes and we include the ISO C99 code in the non-standard namespace __c99. The C++ wrapper header take case of adding the definitions to the global namespace. */ #if defined __cplusplus && defined _GLIBCPP_USE_NAMESPACES # define __BEGIN_NAMESPACE_STD namespace std { # define __END_NAMESPACE_STD } # define __USING_NAMESPACE_STD(name) using std::name; # define __BEGIN_NAMESPACE_C99 namespace __c99 { # define __END_NAMESPACE_C99 } # define __USING_NAMESPACE_C99(name) using __c99::name; #else # 119 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 /* For compatibility we do not add the declarations into any namespace. They will end up in the global namespace which is what old code expects. */ # define __BEGIN_NAMESPACE_STD # define __END_NAMESPACE_STD # define __USING_NAMESPACE_STD(name) # define __BEGIN_NAMESPACE_C99 # define __END_NAMESPACE_C99 # define __USING_NAMESPACE_C99(name) #endif # 129 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 /* Fortify support. */ #define __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1) #define __bos0(ptr) __builtin_object_size (ptr, 0) #define __fortify_function __extern_always_inline __attribute_artificial__ #if __GNUC_PREREQ (4,3) # define __warndecl(name, msg) \ extern void name (void) __attribute__((__warning__ (msg))) # define __warnattr(msg) __attribute__((__warning__ (msg))) # define __errordecl(name, msg) \ extern void name (void) __attribute__((__error__ (msg))) #else # 143 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 # define __warndecl(name, msg) extern void name (void) # define __warnattr(msg) # define __errordecl(name, msg) extern void name (void) #endif # 147 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 /* Support for flexible arrays. */ #if __GNUC_PREREQ (2,97) /* GCC 2.97 supports C99 flexible array members. */ # define __flexarr [] #else # 153 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 # ifdef __GNUC__ # define __flexarr [0] # else # 156 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 # if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L # define __flexarr [] # else # 159 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 /* Some other non-C99 compiler. Approximate with [1]. */ # define __flexarr [1] # endif # 162 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 # endif # 163 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 #endif # 164 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 /* __asm__ ("xyz") is used throughout the headers to rename functions at the assembly language level. This is wrapped by the __REDIRECT macro, in order to support compilers that can do this some other way. When compilers don't support asm-names at all, we have to do preprocessor tricks instead (which don't have exactly the right semantics, but it's the best we can do). Example: int __REDIRECT(setpgrp, (__pid_t pid, __pid_t pgrp), setpgid); */ #if defined __GNUC__ && __GNUC__ >= 2 # define __REDIRECT(name, proto, alias) name proto __asm__ (__ASMNAME (#alias)) # ifdef __cplusplus # define __REDIRECT_NTH(name, proto, alias) \ name proto __THROW __asm__ (__ASMNAME (#alias)) # define __REDIRECT_NTHNL(name, proto, alias) \ name proto __THROWNL __asm__ (__ASMNAME (#alias)) # else # 185 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 # define __REDIRECT_NTH(name, proto, alias) \ name proto __asm__ (__ASMNAME (#alias)) __THROW # define __REDIRECT_NTHNL(name, proto, alias) \ name proto __asm__ (__ASMNAME (#alias)) __THROWNL # endif # 190 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 # define __ASMNAME(cname) __ASMNAME2 (__USER_LABEL_PREFIX__, cname) # define __ASMNAME2(prefix, cname) __STRING (prefix) cname /* #elif __SOME_OTHER_COMPILER__ # define __REDIRECT(name, proto, alias) name proto; \ _Pragma("let " #name " = " #alias) */ #endif # 200 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 /* GCC has various useful declarations that can be made with the `__attribute__' syntax. All of the ways we use this do fine if they are omitted for compilers that don't understand it. */ #if !defined __GNUC__ || __GNUC__ < 2 # define __attribute__(xyz) /* Ignore */ #endif # 207 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 /* At some point during the gcc 2.96 development the `malloc' attribute for functions was introduced. We don't want to use it unconditionally (although this would be possible) since it generates warnings. */ #if __GNUC_PREREQ (2,96) # define __attribute_malloc__ __attribute__ ((__malloc__)) #else # 214 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 # define __attribute_malloc__ /* Ignore */ #endif # 216 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 /* Tell the compiler which arguments to an allocation function indicate the size of the allocation. */ #if __GNUC_PREREQ (4, 3) # define __attribute_alloc_size__(params) \ __attribute__ ((__alloc_size__ params)) #else # 223 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 # define __attribute_alloc_size__(params) /* Ignore. */ #endif # 225 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 /* At some point during the gcc 2.96 development the `pure' attribute for functions was introduced. We don't want to use it unconditionally (although this would be possible) since it generates warnings. */ #if __GNUC_PREREQ (2,96) # define __attribute_pure__ __attribute__ ((__pure__)) #else # 232 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 # define __attribute_pure__ /* Ignore */ #endif # 234 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 /* This declaration tells the compiler that the value is constant. */ #if __GNUC_PREREQ (2,5) # define __attribute_const__ __attribute__ ((__const__)) #else # 239 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 # define __attribute_const__ /* Ignore */ #endif # 241 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 /* At some point during the gcc 3.1 development the `used' attribute for functions was introduced. We don't want to use it unconditionally (although this would be possible) since it generates warnings. */ #if __GNUC_PREREQ (3,1) # define __attribute_used__ __attribute__ ((__used__)) # define __attribute_noinline__ __attribute__ ((__noinline__)) #else # 249 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 # define __attribute_used__ __attribute__ ((__unused__)) # define __attribute_noinline__ /* Ignore */ #endif # 252 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 /* gcc allows marking deprecated functions. */ #if __GNUC_PREREQ (3,2) # define __attribute_deprecated__ __attribute__ ((__deprecated__)) #else # 257 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 # define __attribute_deprecated__ /* Ignore */ #endif # 259 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 /* At some point during the gcc 2.8 development the `format_arg' attribute for functions was introduced. We don't want to use it unconditionally (although this would be possible) since it generates warnings. If several `format_arg' attributes are given for the same function, in gcc-3.0 and older, all but the last one are ignored. In newer gccs, all designated arguments are considered. */ #if __GNUC_PREREQ (2,8) # define __attribute_format_arg__(x) __attribute__ ((__format_arg__ (x))) #else # 269 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 # define __attribute_format_arg__(x) /* Ignore */ #endif # 271 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 /* At some point during the gcc 2.97 development the `strfmon' format attribute for functions was introduced. We don't want to use it unconditionally (although this would be possible) since it generates warnings. */ #if __GNUC_PREREQ (2,97) # define __attribute_format_strfmon__(a,b) \ __attribute__ ((__format__ (__strfmon__, a, b))) #else # 280 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 # define __attribute_format_strfmon__(a,b) /* Ignore */ #endif # 282 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 /* The nonull function attribute allows to mark pointer parameters which must not be NULL. */ #if __GNUC_PREREQ (3,3) # define __nonnull(params) __attribute__ ((__nonnull__ params)) #else # 288 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 # define __nonnull(params) #endif # 290 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 /* If fortification mode, we warn about unused results of certain function calls which can lead to problems. */ #if __GNUC_PREREQ (3,4) # define __attribute_warn_unused_result__ \ __attribute__ ((__warn_unused_result__)) # if __USE_FORTIFY_LEVEL > 0 # define __wur __attribute_warn_unused_result__ # endif # 299 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 #else # 300 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 # define __attribute_warn_unused_result__ /* empty */ #endif # 302 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 #ifndef __wur # define __wur /* Ignore */ #endif # 305 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 /* Forces a function to be always inlined. */ #if __GNUC_PREREQ (3,2) # define __always_inline __inline __attribute__ ((__always_inline__)) #else # 310 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 # define __always_inline __inline #endif # 312 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 /* Associate error messages with the source location of the call site rather than with the source location inside the function. */ #if __GNUC_PREREQ (4,3) # define __attribute_artificial__ __attribute__ ((__artificial__)) #else # 318 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 # define __attribute_artificial__ /* Ignore */ #endif # 320 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 #ifdef __GNUC__ /* One of these will be defined if the __gnu_inline__ attribute is available. In C++, __GNUC_GNU_INLINE__ will be defined even though __inline does not use the GNU inlining rules. If neither macro is defined, this version of GCC only supports GNU inline semantics. */ # if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__ # define __extern_inline extern __inline __attribute__ ((__gnu_inline__)) # define __extern_always_inline \ extern __always_inline __attribute__ ((__gnu_inline__)) # else # 331 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 # define __extern_inline extern __inline # define __extern_always_inline extern __always_inline # endif # 334 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 #else /* Not GCC. */ # 335 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 # define __extern_inline /* Ignore */ # define __extern_always_inline /* Ignore */ #endif # 338 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 /* GCC 4.3 and above allow passing all anonymous arguments of an __extern_always_inline function to some other vararg function. */ #if __GNUC_PREREQ (4,3) # define __va_arg_pack() __builtin_va_arg_pack () # define __va_arg_pack_len() __builtin_va_arg_pack_len () #endif # 345 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 /* It is possible to compile containing GCC extensions even if GCC is run in pedantic mode if the uses are carefully marked using the `__extension__' keyword. But this is not generally available before version 2.8. */ #if !__GNUC_PREREQ (2,8) # define __extension__ /* Ignore */ #endif # 353 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 /* __restrict is known in EGCS 1.2 and above. */ #if !__GNUC_PREREQ (2,92) # define __restrict /* Ignore */ #endif # 358 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 /* ISO C99 also allows to declare arrays as non-overlapping. The syntax is array_name[restrict] GCC 3.1 supports this. */ #if __GNUC_PREREQ (3,1) && !defined __GNUG__ # define __restrict_arr __restrict #else # 365 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 # ifdef __GNUC__ # define __restrict_arr /* Not supported in old GCC. */ # else # 368 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 # if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L # define __restrict_arr restrict # else # 371 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 /* Some other non-C99 compiler. */ # define __restrict_arr /* Not supported. */ # endif # 374 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 # endif # 375 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 #endif # 376 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 #if __GNUC__ >= 3 # define __glibc_unlikely(cond) __builtin_expect ((cond), 0) # define __glibc_likely(cond) __builtin_expect ((cond), 1) #else # 381 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 # define __glibc_unlikely(cond) (cond) # define __glibc_likely(cond) (cond) #endif # 384 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 385 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4 /* Determine the wordsize from the preprocessor defines. */ #if defined __x86_64__ && !defined __ILP32__ # define __WORDSIZE 64 #else # 6 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 3 4 # define __WORDSIZE 32 #endif # 8 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 3 4 #ifdef __x86_64__ # define __WORDSIZE_TIME64_COMPAT32 1 /* Both x86-64 and x32 use the 64-bit system call interface. */ # define __SYSCALL_WORDSIZE 64 #endif # 14 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 3 4 # 386 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4 #if defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH # define __LDBL_COMPAT 1 # ifdef __REDIRECT # define __LDBL_REDIR1(name, proto, alias) __REDIRECT (name, proto, alias) # define __LDBL_REDIR(name, proto) \ __LDBL_REDIR1 (name, proto, __nldbl_##name) # define __LDBL_REDIR1_NTH(name, proto, alias) __REDIRECT_NTH (name, proto, alias) # define __LDBL_REDIR_NTH(name, proto) \ __LDBL_REDIR1_NTH (name, proto, __nldbl_##name) # define __LDBL_REDIR1_DECL(name, alias) \ extern __typeof (name) name __asm (__ASMNAME (#alias)); # define __LDBL_REDIR_DECL(name) \ extern __typeof (name) name __asm (__ASMNAME ("__nldbl_" #name)); # define __REDIRECT_LDBL(name, proto, alias) \ __LDBL_REDIR1 (name, proto, __nldbl_##alias) # define __REDIRECT_NTH_LDBL(name, proto, alias) \ __LDBL_REDIR1_NTH (name, proto, __nldbl_##alias) # endif # 405 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 #endif # 406 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 #if !defined __LDBL_COMPAT || !defined __REDIRECT # define __LDBL_REDIR1(name, proto, alias) name proto # define __LDBL_REDIR(name, proto) name proto # define __LDBL_REDIR1_NTH(name, proto, alias) name proto __THROW # define __LDBL_REDIR_NTH(name, proto) name proto __THROW # define __LDBL_REDIR_DECL(name) # ifdef __REDIRECT # define __REDIRECT_LDBL(name, proto, alias) __REDIRECT (name, proto, alias) # define __REDIRECT_NTH_LDBL(name, proto, alias) \ __REDIRECT_NTH (name, proto, alias) # endif # 417 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 #endif # 418 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 #endif /* sys/cdefs.h */ # 420 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 # 375 "/usr/include/features.h" 2 3 4 # endif # 376 "/usr/include/features.h" 3 4 /* If we don't have __REDIRECT, prototypes will be missing if __USE_FILE_OFFSET64 but not __USE_LARGEFILE[64]. */ # if defined __USE_FILE_OFFSET64 && !defined __REDIRECT # define __USE_LARGEFILE 1 # define __USE_LARGEFILE64 1 # endif # 383 "/usr/include/features.h" 3 4 #endif /* !ASSEMBLER */ # 385 "/usr/include/features.h" 3 4 /* Decide whether we can define 'extern inline' functions in headers. */ #if __GNUC_PREREQ (2, 7) && defined __OPTIMIZE__ \ && !defined __OPTIMIZE_SIZE__ && !defined __NO_INLINE__ \ && defined __extern_inline # define __USE_EXTERN_INLINES 1 #endif # 392 "/usr/include/features.h" 3 4 /* This is here only because every header file already includes this one. Get the definitions of all the appropriate `__stub_FUNCTION' symbols. contains `#define __stub_FUNCTION' when FUNCTION is a stub that will always return failure (and set errno to ENOSYS). */ #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 398 "/usr/include/features.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4 /* This file is automatically generated. This file selects the right generated file of `__stub_FUNCTION' macros based on the architecture being compiled for. */ #if !defined __x86_64__ #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 7 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4 # 8 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4 #endif # 9 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4 #if defined __x86_64__ && defined __LP64__ #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4 /* This file is automatically generated. It defines a symbol `__stub_FUNCTION' for each function in the C library which is a stub, meaning it will fail every time called, usually setting errno to ENOSYS. */ #ifdef _LIBC # error Applications may not define the macro _LIBC #endif # 9 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 3 4 #define __stub_bdflush #define __stub_chflags #define __stub_fattach #define __stub_fchflags #define __stub_fdetach #define __stub_getmsg #define __stub_gtty #define __stub_lchmod #define __stub_putmsg #define __stub_revoke #define __stub_setlogin #define __stub_sigreturn #define __stub_sstk #define __stub_stty # 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4 #endif # 12 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4 #if defined __x86_64__ && defined __ILP32__ #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 13 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4 # 14 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4 #endif # 15 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4 # 399 "/usr/include/features.h" 2 3 4 #endif /* features.h */ # 402 "/usr/include/features.h" 3 4 # 28 "/usr/include/stdio.h" 2 3 4 __BEGIN_DECLS # define __need_size_t # define __need_NULL #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 33 "/usr/include/stdio.h" 3 4 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 1 3 4 /*===---- stddef.h - Basic type definitions --------------------------------=== * * Copyright (c) 2008 Eli Friedman * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #if !defined(__STDDEF_H) || defined(__need_ptrdiff_t) || \ defined(__need_size_t) || defined(__need_wchar_t) || \ defined(__need_NULL) || defined(__need_wint_t) #if !defined(__need_ptrdiff_t) && !defined(__need_size_t) && \ !defined(__need_wchar_t) && !defined(__need_NULL) && \ !defined(__need_wint_t) /* Always define miscellaneous pieces when modules are available. */ #if !__has_feature(modules) #define __STDDEF_H #endif # 37 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #define __need_ptrdiff_t #define __need_size_t #define __need_wchar_t #define __need_NULL #define __need_STDDEF_H_misc /* __need_wint_t is intentionally not defined here. */ #endif # 44 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_ptrdiff_t) #if !defined(_PTRDIFF_T) || __has_feature(modules) /* Always define ptrdiff_t when modules are available. */ #if !__has_feature(modules) #define _PTRDIFF_T #endif # 51 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 typedef __PTRDIFF_TYPE__ ptrdiff_t; #endif # 53 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #undef __need_ptrdiff_t #endif /* defined(__need_ptrdiff_t) */ # 55 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_size_t) #if !defined(_SIZE_T) || __has_feature(modules) /* Always define size_t when modules are available. */ #if !__has_feature(modules) #define _SIZE_T #endif # 62 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 typedef __SIZE_TYPE__ size_t; #endif # 64 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #undef __need_size_t #endif /*defined(__need_size_t) */ # 66 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_STDDEF_H_misc) /* ISO9899:2011 7.20 (C11 Annex K): Define rsize_t if __STDC_WANT_LIB_EXT1__ is * enabled. */ #if (defined(__STDC_WANT_LIB_EXT1__) && __STDC_WANT_LIB_EXT1__ >= 1 && \ !defined(_RSIZE_T)) || __has_feature(modules) /* Always define rsize_t when modules are available. */ #if !__has_feature(modules) #define _RSIZE_T #endif # 76 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 typedef __SIZE_TYPE__ rsize_t; #endif # 78 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif /* defined(__need_STDDEF_H_misc) */ # 79 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_wchar_t) #ifndef __cplusplus /* Always define wchar_t when modules are available. */ #if !defined(_WCHAR_T) || __has_feature(modules) #if !__has_feature(modules) #define _WCHAR_T #if defined(_MSC_EXTENSIONS) #define _WCHAR_T_DEFINED #endif # 89 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif # 90 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 typedef __WCHAR_TYPE__ wchar_t; #endif # 92 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif # 93 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #undef __need_wchar_t #endif /* defined(__need_wchar_t) */ # 95 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_NULL) #undef NULL #ifdef __cplusplus # if !defined(__MINGW32__) && !defined(_MSC_VER) # define NULL __null # else # 102 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 # define NULL 0 # endif # 104 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #else # 105 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 # define NULL ((void*)0) #endif # 107 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #ifdef __cplusplus #if defined(_MSC_EXTENSIONS) && defined(_NATIVE_NULLPTR_SUPPORTED) namespace std { typedef decltype(nullptr) nullptr_t; } using ::std::nullptr_t; #endif # 112 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif # 113 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #undef __need_NULL #endif /* defined(__need_NULL) */ # 115 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_STDDEF_H_misc) #if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L #if 0 /* expanded by -frewrite-includes */ #include "__stddef_max_align_t.h" #endif /* expanded by -frewrite-includes */ # 118 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 # 119 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif # 120 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #define offsetof(t, d) __builtin_offsetof(t, d) #undef __need_STDDEF_H_misc #endif /* defined(__need_STDDEF_H_misc) */ # 123 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 /* Some C libraries expect to see a wint_t here. Others (notably MinGW) will use __WINT_TYPE__ directly; accommodate both by requiring __need_wint_t */ #if defined(__need_wint_t) /* Always define wint_t when modules are available. */ #if !defined(_WINT_T) || __has_feature(modules) #if !__has_feature(modules) #define _WINT_T #endif # 132 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 typedef __WINT_TYPE__ wint_t; #endif # 134 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #undef __need_wint_t #endif /* __need_wint_t */ # 136 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif # 138 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 # 34 "/usr/include/stdio.h" 2 3 4 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 35 "/usr/include/stdio.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/types.h" 1 3 4 /* bits/types.h -- definitions of __*_t types underlying *_t types. Copyright (C) 2002-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * Never include this file directly; use instead. */ #ifndef _BITS_TYPES_H #define _BITS_TYPES_H 1 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 26 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4 # 27 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 27 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4 /* Determine the wordsize from the preprocessor defines. */ #if defined __x86_64__ && !defined __ILP32__ # define __WORDSIZE 64 #else # 6 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 3 4 # define __WORDSIZE 32 #endif # 8 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 3 4 #ifdef __x86_64__ # define __WORDSIZE_TIME64_COMPAT32 1 /* Both x86-64 and x32 use the 64-bit system call interface. */ # define __SYSCALL_WORDSIZE 64 #endif # 14 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 3 4 # 28 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4 /* Convenience types. */ typedef unsigned char __u_char; typedef unsigned short int __u_short; typedef unsigned int __u_int; typedef unsigned long int __u_long; /* Fixed-size types, underlying types depend on word size and compiler. */ typedef signed char __int8_t; typedef unsigned char __uint8_t; typedef signed short int __int16_t; typedef unsigned short int __uint16_t; typedef signed int __int32_t; typedef unsigned int __uint32_t; #if __WORDSIZE == 64 typedef signed long int __int64_t; typedef unsigned long int __uint64_t; #else # 46 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4 __extension__ typedef signed long long int __int64_t; __extension__ typedef unsigned long long int __uint64_t; #endif # 49 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4 /* quad_t is also 64 bits. */ #if __WORDSIZE == 64 typedef long int __quad_t; typedef unsigned long int __u_quad_t; #else # 55 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4 __extension__ typedef long long int __quad_t; __extension__ typedef unsigned long long int __u_quad_t; #endif # 58 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4 /* The machine-dependent file defines __*_T_TYPE macros for each of the OS types we define below. The definitions of those macros must use the following macros for underlying types. We define __S_TYPE and __U_TYPE for the signed and unsigned variants of each of the following integer types on this machine. 16 -- "natural" 16-bit type (always short) 32 -- "natural" 32-bit type (always int) 64 -- "natural" 64-bit type (long or long long) LONG32 -- 32-bit type, traditionally long QUAD -- 64-bit type, always long long WORD -- natural type of __WORDSIZE bits (int or long) LONGWORD -- type of __WORDSIZE bits, traditionally long We distinguish WORD/LONGWORD, 32/LONG32, and 64/QUAD so that the conventional uses of `long' or `long long' type modifiers match the types we define, even when a less-adorned type would be the same size. This matters for (somewhat) portably writing printf/scanf formats for these types, where using the appropriate l or ll format modifiers can make the typedefs and the formats match up across all GNU platforms. If we used `long' when it's 64 bits where `long long' is expected, then the compiler would warn about the formats not matching the argument types, and the programmer changing them to shut up the compiler would break the program's portability. Here we assume what is presently the case in all the GCC configurations we support: long long is always 64 bits, long is always word/address size, and int is always 32 bits. */ #define __S16_TYPE short int #define __U16_TYPE unsigned short int #define __S32_TYPE int #define __U32_TYPE unsigned int #define __SLONGWORD_TYPE long int #define __ULONGWORD_TYPE unsigned long int #if __WORDSIZE == 32 # define __SQUAD_TYPE __quad_t # define __UQUAD_TYPE __u_quad_t # define __SWORD_TYPE int # define __UWORD_TYPE unsigned int # define __SLONG32_TYPE long int # define __ULONG32_TYPE unsigned long int # define __S64_TYPE __quad_t # define __U64_TYPE __u_quad_t /* We want __extension__ before typedef's that use nonstandard base types such as `long long' in C89 mode. */ # define __STD_TYPE __extension__ typedef #elif __WORDSIZE == 64 # 108 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4 # define __SQUAD_TYPE long int # define __UQUAD_TYPE unsigned long int # define __SWORD_TYPE long int # define __UWORD_TYPE unsigned long int # define __SLONG32_TYPE int # define __ULONG32_TYPE unsigned int # define __S64_TYPE long int # define __U64_TYPE unsigned long int /* No need to mark the typedef with __extension__. */ # define __STD_TYPE typedef #else # 119 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4 # error #endif # 121 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4 #if 0 /* expanded by -frewrite-includes */ #include /* Defines __*_T_TYPE macros. */ #endif /* expanded by -frewrite-includes */ # 121 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/typesizes.h" 1 3 4 /* bits/typesizes.h -- underlying types for *_t. Linux/x86-64 version. Copyright (C) 2012-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _BITS_TYPES_H # error "Never include directly; use instead." #endif # 22 "/usr/include/x86_64-linux-gnu/bits/typesizes.h" 3 4 #ifndef _BITS_TYPESIZES_H #define _BITS_TYPESIZES_H 1 /* See for the meaning of these macros. This file exists so that need not vary across different GNU platforms. */ /* X32 kernel interface is 64-bit. */ #if defined __x86_64__ && defined __ILP32__ # define __SYSCALL_SLONG_TYPE __SQUAD_TYPE # define __SYSCALL_ULONG_TYPE __UQUAD_TYPE #else # 34 "/usr/include/x86_64-linux-gnu/bits/typesizes.h" 3 4 # define __SYSCALL_SLONG_TYPE __SLONGWORD_TYPE # define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE #endif # 37 "/usr/include/x86_64-linux-gnu/bits/typesizes.h" 3 4 #define __DEV_T_TYPE __UQUAD_TYPE #define __UID_T_TYPE __U32_TYPE #define __GID_T_TYPE __U32_TYPE #define __INO_T_TYPE __SYSCALL_ULONG_TYPE #define __INO64_T_TYPE __UQUAD_TYPE #define __MODE_T_TYPE __U32_TYPE #ifdef __x86_64__ # define __NLINK_T_TYPE __SYSCALL_ULONG_TYPE # define __FSWORD_T_TYPE __SYSCALL_SLONG_TYPE #else # 48 "/usr/include/x86_64-linux-gnu/bits/typesizes.h" 3 4 # define __NLINK_T_TYPE __UWORD_TYPE # define __FSWORD_T_TYPE __SWORD_TYPE #endif # 51 "/usr/include/x86_64-linux-gnu/bits/typesizes.h" 3 4 #define __OFF_T_TYPE __SYSCALL_SLONG_TYPE #define __OFF64_T_TYPE __SQUAD_TYPE #define __PID_T_TYPE __S32_TYPE #define __RLIM_T_TYPE __SYSCALL_ULONG_TYPE #define __RLIM64_T_TYPE __UQUAD_TYPE #define __BLKCNT_T_TYPE __SYSCALL_SLONG_TYPE #define __BLKCNT64_T_TYPE __SQUAD_TYPE #define __FSBLKCNT_T_TYPE __SYSCALL_ULONG_TYPE #define __FSBLKCNT64_T_TYPE __UQUAD_TYPE #define __FSFILCNT_T_TYPE __SYSCALL_ULONG_TYPE #define __FSFILCNT64_T_TYPE __UQUAD_TYPE #define __ID_T_TYPE __U32_TYPE #define __CLOCK_T_TYPE __SYSCALL_SLONG_TYPE #define __TIME_T_TYPE __SYSCALL_SLONG_TYPE #define __USECONDS_T_TYPE __U32_TYPE #define __SUSECONDS_T_TYPE __SYSCALL_SLONG_TYPE #define __DADDR_T_TYPE __S32_TYPE #define __KEY_T_TYPE __S32_TYPE #define __CLOCKID_T_TYPE __S32_TYPE #define __TIMER_T_TYPE void * #define __BLKSIZE_T_TYPE __SYSCALL_SLONG_TYPE #define __FSID_T_TYPE struct { int __val[2]; } #define __SSIZE_T_TYPE __SWORD_TYPE #ifdef __x86_64__ /* Tell the libc code that off_t and off64_t are actually the same type for all ABI purposes, even if possibly expressed as different base types for C type-checking purposes. */ # define __OFF_T_MATCHES_OFF64_T 1 /* Same for ino_t and ino64_t. */ # define __INO_T_MATCHES_INO64_T 1 #endif # 84 "/usr/include/x86_64-linux-gnu/bits/typesizes.h" 3 4 /* Number of descriptors that can fit in an `fd_set'. */ #define __FD_SETSIZE 1024 #endif /* bits/typesizes.h */ # 90 "/usr/include/x86_64-linux-gnu/bits/typesizes.h" 3 4 # 122 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4 __STD_TYPE __DEV_T_TYPE __dev_t; /* Type of device numbers. */ __STD_TYPE __UID_T_TYPE __uid_t; /* Type of user identifications. */ __STD_TYPE __GID_T_TYPE __gid_t; /* Type of group identifications. */ __STD_TYPE __INO_T_TYPE __ino_t; /* Type of file serial numbers. */ __STD_TYPE __INO64_T_TYPE __ino64_t; /* Type of file serial numbers (LFS).*/ __STD_TYPE __MODE_T_TYPE __mode_t; /* Type of file attribute bitmasks. */ __STD_TYPE __NLINK_T_TYPE __nlink_t; /* Type of file link counts. */ __STD_TYPE __OFF_T_TYPE __off_t; /* Type of file sizes and offsets. */ __STD_TYPE __OFF64_T_TYPE __off64_t; /* Type of file sizes and offsets (LFS). */ __STD_TYPE __PID_T_TYPE __pid_t; /* Type of process identifications. */ __STD_TYPE __FSID_T_TYPE __fsid_t; /* Type of file system IDs. */ __STD_TYPE __CLOCK_T_TYPE __clock_t; /* Type of CPU usage counts. */ __STD_TYPE __RLIM_T_TYPE __rlim_t; /* Type for resource measurement. */ __STD_TYPE __RLIM64_T_TYPE __rlim64_t; /* Type for resource measurement (LFS). */ __STD_TYPE __ID_T_TYPE __id_t; /* General type for IDs. */ __STD_TYPE __TIME_T_TYPE __time_t; /* Seconds since the Epoch. */ __STD_TYPE __USECONDS_T_TYPE __useconds_t; /* Count of microseconds. */ __STD_TYPE __SUSECONDS_T_TYPE __suseconds_t; /* Signed count of microseconds. */ __STD_TYPE __DADDR_T_TYPE __daddr_t; /* The type of a disk address. */ __STD_TYPE __KEY_T_TYPE __key_t; /* Type of an IPC key. */ /* Clock ID used in clock and timer functions. */ __STD_TYPE __CLOCKID_T_TYPE __clockid_t; /* Timer ID returned by `timer_create'. */ __STD_TYPE __TIMER_T_TYPE __timer_t; /* Type to represent block size. */ __STD_TYPE __BLKSIZE_T_TYPE __blksize_t; /* Types from the Large File Support interface. */ /* Type to count number of disk blocks. */ __STD_TYPE __BLKCNT_T_TYPE __blkcnt_t; __STD_TYPE __BLKCNT64_T_TYPE __blkcnt64_t; /* Type to count file system blocks. */ __STD_TYPE __FSBLKCNT_T_TYPE __fsblkcnt_t; __STD_TYPE __FSBLKCNT64_T_TYPE __fsblkcnt64_t; /* Type to count file system nodes. */ __STD_TYPE __FSFILCNT_T_TYPE __fsfilcnt_t; __STD_TYPE __FSFILCNT64_T_TYPE __fsfilcnt64_t; /* Type of miscellaneous file system fields. */ __STD_TYPE __FSWORD_T_TYPE __fsword_t; __STD_TYPE __SSIZE_T_TYPE __ssize_t; /* Type of a byte count, or error. */ /* Signed long type used in system calls. */ __STD_TYPE __SYSCALL_SLONG_TYPE __syscall_slong_t; /* Unsigned long type used in system calls. */ __STD_TYPE __SYSCALL_ULONG_TYPE __syscall_ulong_t; /* These few don't really vary by system, they always correspond to one of the other defined types. */ typedef __off64_t __loff_t; /* Type of file sizes and offsets (LFS). */ typedef __quad_t *__qaddr_t; typedef char *__caddr_t; /* Duplicates info from stdint.h but this is used in unistd.h. */ __STD_TYPE __SWORD_TYPE __intptr_t; /* Duplicate info from sys/socket.h. */ __STD_TYPE __U32_TYPE __socklen_t; #undef __STD_TYPE #endif /* bits/types.h */ # 195 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4 # 36 "/usr/include/stdio.h" 2 3 4 # define __need_FILE # define __need___FILE #endif /* Don't need FILE. */ # 39 "/usr/include/stdio.h" 3 4 #if !defined __FILE_defined && defined __need_FILE /* Define outside of namespace so the C++ is happy. */ struct _IO_FILE; __BEGIN_NAMESPACE_STD /* The opaque type of streams. This is the definition used elsewhere. */ typedef struct _IO_FILE FILE; __END_NAMESPACE_STD #if defined __USE_LARGEFILE64 || defined __USE_SVID || defined __USE_POSIX \ || defined __USE_BSD || defined __USE_ISOC99 || defined __USE_XOPEN \ || defined __USE_POSIX2 __USING_NAMESPACE_STD(FILE) #endif # 55 "/usr/include/stdio.h" 3 4 # define __FILE_defined 1 #endif /* FILE not defined. */ # 58 "/usr/include/stdio.h" 3 4 #undef __need_FILE #if !defined ____FILE_defined && defined __need___FILE /* The opaque type of streams. This is the definition used elsewhere. */ typedef struct _IO_FILE __FILE; # define ____FILE_defined 1 #endif /* __FILE not defined. */ # 68 "/usr/include/stdio.h" 3 4 #undef __need___FILE #ifdef _STDIO_H #define _STDIO_USES_IOSTREAM #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 74 "/usr/include/stdio.h" 3 4 # 1 "/usr/include/libio.h" 1 3 4 /* Copyright (C) 1991-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Per Bothner . The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . As a special exception, if you link the code in this file with files compiled with a GNU compiler to produce an executable, that does not cause the resulting executable to be covered by the GNU Lesser General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Lesser General Public License. This exception applies to code released by its copyright holders in files containing the exception. */ #ifndef _IO_STDIO_H #define _IO_STDIO_H #if 0 /* expanded by -frewrite-includes */ #include <_G_config.h> #endif /* expanded by -frewrite-includes */ # 31 "/usr/include/libio.h" 3 4 # 1 "/usr/include/_G_config.h" 1 3 4 /* This file is needed by libio to define various configuration parameters. These are always the same in the GNU C library. */ #ifndef _G_config_h #define _G_config_h 1 /* Define types for libio in terms of the standard internal type names. */ #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 9 "/usr/include/_G_config.h" 3 4 # 10 "/usr/include/_G_config.h" 3 4 #define __need_size_t #if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T # define __need_wchar_t #endif # 14 "/usr/include/_G_config.h" 3 4 #define __need_NULL #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 15 "/usr/include/_G_config.h" 3 4 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 1 3 4 /*===---- stddef.h - Basic type definitions --------------------------------=== * * Copyright (c) 2008 Eli Friedman * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #if !defined(__STDDEF_H) || defined(__need_ptrdiff_t) || \ defined(__need_size_t) || defined(__need_wchar_t) || \ defined(__need_NULL) || defined(__need_wint_t) #if !defined(__need_ptrdiff_t) && !defined(__need_size_t) && \ !defined(__need_wchar_t) && !defined(__need_NULL) && \ !defined(__need_wint_t) /* Always define miscellaneous pieces when modules are available. */ #if !__has_feature(modules) #define __STDDEF_H #endif # 37 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #define __need_ptrdiff_t #define __need_size_t #define __need_wchar_t #define __need_NULL #define __need_STDDEF_H_misc /* __need_wint_t is intentionally not defined here. */ #endif # 44 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_ptrdiff_t) #if !defined(_PTRDIFF_T) || __has_feature(modules) /* Always define ptrdiff_t when modules are available. */ #if !__has_feature(modules) #define _PTRDIFF_T #endif # 51 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 typedef __PTRDIFF_TYPE__ ptrdiff_t; #endif # 53 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #undef __need_ptrdiff_t #endif /* defined(__need_ptrdiff_t) */ # 55 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_size_t) #if !defined(_SIZE_T) || __has_feature(modules) /* Always define size_t when modules are available. */ #if !__has_feature(modules) #define _SIZE_T #endif # 62 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 typedef __SIZE_TYPE__ size_t; #endif # 64 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #undef __need_size_t #endif /*defined(__need_size_t) */ # 66 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_STDDEF_H_misc) /* ISO9899:2011 7.20 (C11 Annex K): Define rsize_t if __STDC_WANT_LIB_EXT1__ is * enabled. */ #if (defined(__STDC_WANT_LIB_EXT1__) && __STDC_WANT_LIB_EXT1__ >= 1 && \ !defined(_RSIZE_T)) || __has_feature(modules) /* Always define rsize_t when modules are available. */ #if !__has_feature(modules) #define _RSIZE_T #endif # 76 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 typedef __SIZE_TYPE__ rsize_t; #endif # 78 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif /* defined(__need_STDDEF_H_misc) */ # 79 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_wchar_t) #ifndef __cplusplus /* Always define wchar_t when modules are available. */ #if !defined(_WCHAR_T) || __has_feature(modules) #if !__has_feature(modules) #define _WCHAR_T #if defined(_MSC_EXTENSIONS) #define _WCHAR_T_DEFINED #endif # 89 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif # 90 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 typedef __WCHAR_TYPE__ wchar_t; #endif # 92 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif # 93 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #undef __need_wchar_t #endif /* defined(__need_wchar_t) */ # 95 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_NULL) #undef NULL #ifdef __cplusplus # if !defined(__MINGW32__) && !defined(_MSC_VER) # define NULL __null # else # 102 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 # define NULL 0 # endif # 104 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #else # 105 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 # define NULL ((void*)0) #endif # 107 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #ifdef __cplusplus #if defined(_MSC_EXTENSIONS) && defined(_NATIVE_NULLPTR_SUPPORTED) namespace std { typedef decltype(nullptr) nullptr_t; } using ::std::nullptr_t; #endif # 112 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif # 113 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #undef __need_NULL #endif /* defined(__need_NULL) */ # 115 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_STDDEF_H_misc) #if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L #if 0 /* expanded by -frewrite-includes */ #include "__stddef_max_align_t.h" #endif /* expanded by -frewrite-includes */ # 118 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 # 119 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif # 120 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #define offsetof(t, d) __builtin_offsetof(t, d) #undef __need_STDDEF_H_misc #endif /* defined(__need_STDDEF_H_misc) */ # 123 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 /* Some C libraries expect to see a wint_t here. Others (notably MinGW) will use __WINT_TYPE__ directly; accommodate both by requiring __need_wint_t */ #if defined(__need_wint_t) /* Always define wint_t when modules are available. */ #if !defined(_WINT_T) || __has_feature(modules) #if !__has_feature(modules) #define _WINT_T #endif # 132 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 typedef __WINT_TYPE__ wint_t; #endif # 134 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #undef __need_wint_t #endif /* __need_wint_t */ # 136 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif # 138 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 # 16 "/usr/include/_G_config.h" 2 3 4 #define __need_mbstate_t #if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T # define __need_wint_t #endif # 20 "/usr/include/_G_config.h" 3 4 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 20 "/usr/include/_G_config.h" 3 4 # 1 "/usr/include/wchar.h" 1 3 4 /* Copyright (C) 1995-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard: 7.24 * Extended multibyte and wide character utilities */ #ifndef _WCHAR_H #if !defined __need_mbstate_t && !defined __need_wint_t # define _WCHAR_H 1 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 27 "/usr/include/wchar.h" 3 4 # 28 "/usr/include/wchar.h" 3 4 #endif # 29 "/usr/include/wchar.h" 3 4 #ifdef _WCHAR_H /* Get FILE definition. */ # define __need___FILE # if defined __USE_UNIX98 || defined __USE_XOPEN2K # define __need_FILE # endif # 36 "/usr/include/wchar.h" 3 4 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 36 "/usr/include/wchar.h" 3 4 # 37 "/usr/include/wchar.h" 3 4 /* Get va_list definition. */ # define __need___va_list #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 39 "/usr/include/wchar.h" 3 4 # 40 "/usr/include/wchar.h" 3 4 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 41 "/usr/include/wchar.h" 3 4 # 42 "/usr/include/wchar.h" 3 4 /* Get size_t, wchar_t, wint_t and NULL from . */ # define __need_size_t # define __need_wchar_t # define __need_NULL #endif # 48 "/usr/include/wchar.h" 3 4 #if defined _WCHAR_H || defined __need_wint_t || !defined __WINT_TYPE__ # undef __need_wint_t # define __need_wint_t #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 51 "/usr/include/wchar.h" 3 4 # 52 "/usr/include/wchar.h" 3 4 /* We try to get wint_t from , but not all GCC versions define it there. So define it ourselves if it remains undefined. */ # ifndef _WINT_T /* Integral type unchanged by default argument promotions that can hold any value corresponding to members of the extended character set, as well as at least one value that does not correspond to any member of the extended character set. */ # define _WINT_T typedef unsigned int wint_t; # else # 63 "/usr/include/wchar.h" 3 4 /* Work around problems with the file which doesn't put wint_t in the std namespace. */ # if defined __cplusplus && defined _GLIBCPP_USE_NAMESPACES \ && defined __WINT_TYPE__ __BEGIN_NAMESPACE_STD typedef __WINT_TYPE__ wint_t; __END_NAMESPACE_STD # endif # 71 "/usr/include/wchar.h" 3 4 # endif # 72 "/usr/include/wchar.h" 3 4 /* Tell the caller that we provide correct C++ prototypes. */ # if defined __cplusplus && __GNUC_PREREQ (4, 4) # define __CORRECT_ISO_CPP_WCHAR_H_PROTO # endif # 77 "/usr/include/wchar.h" 3 4 #endif # 78 "/usr/include/wchar.h" 3 4 #if (defined _WCHAR_H || defined __need_mbstate_t) && !defined ____mbstate_t_defined # define ____mbstate_t_defined 1 /* Conversion state information. */ typedef struct { int __count; union { # ifdef __WINT_TYPE__ __WINT_TYPE__ __wch; # else # 90 "/usr/include/wchar.h" 3 4 wint_t __wch; # endif # 92 "/usr/include/wchar.h" 3 4 char __wchb[4]; } __value; /* Value so far. */ } __mbstate_t; #endif # 96 "/usr/include/wchar.h" 3 4 #undef __need_mbstate_t /* The rest of the file is only used if used if __need_mbstate_t is not defined. */ #ifdef _WCHAR_H # ifndef __mbstate_t_defined __BEGIN_NAMESPACE_C99 /* Public type. */ typedef __mbstate_t mbstate_t; __END_NAMESPACE_C99 # define __mbstate_t_defined 1 # endif # 110 "/usr/include/wchar.h" 3 4 #ifdef __USE_GNU __USING_NAMESPACE_C99(mbstate_t) #endif # 114 "/usr/include/wchar.h" 3 4 #ifndef WCHAR_MIN /* These constants might also be defined in . */ # define WCHAR_MIN __WCHAR_MIN # define WCHAR_MAX __WCHAR_MAX #endif # 120 "/usr/include/wchar.h" 3 4 #ifndef WEOF # define WEOF (0xffffffffu) #endif # 124 "/usr/include/wchar.h" 3 4 /* For XPG4 compliance we have to define the stuff from here as well. */ #if defined __USE_XOPEN && !defined __USE_UNIX98 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 128 "/usr/include/wchar.h" 3 4 # 129 "/usr/include/wchar.h" 3 4 #endif # 130 "/usr/include/wchar.h" 3 4 __BEGIN_DECLS __BEGIN_NAMESPACE_STD /* This incomplete type is defined in but needed here because of `wcsftime'. */ struct tm; __END_NAMESPACE_STD /* XXX We have to clean this up at some point. Since tm is in the std namespace but wcsftime is in __c99 the type wouldn't be found without inserting it in the global namespace. */ __USING_NAMESPACE_STD(tm) __BEGIN_NAMESPACE_STD /* Copy SRC to DEST. */ extern wchar_t *wcscpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src) __THROW; /* Copy no more than N wide-characters of SRC to DEST. */ extern wchar_t *wcsncpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src, size_t __n) __THROW; /* Append SRC onto DEST. */ extern wchar_t *wcscat (wchar_t *__restrict __dest, const wchar_t *__restrict __src) __THROW; /* Append no more than N wide-characters of SRC onto DEST. */ extern wchar_t *wcsncat (wchar_t *__restrict __dest, const wchar_t *__restrict __src, size_t __n) __THROW; /* Compare S1 and S2. */ extern int wcscmp (const wchar_t *__s1, const wchar_t *__s2) __THROW __attribute_pure__; /* Compare N wide-characters of S1 and S2. */ extern int wcsncmp (const wchar_t *__s1, const wchar_t *__s2, size_t __n) __THROW __attribute_pure__; __END_NAMESPACE_STD #ifdef __USE_XOPEN2K8 /* Compare S1 and S2, ignoring case. */ extern int wcscasecmp (const wchar_t *__s1, const wchar_t *__s2) __THROW; /* Compare no more than N chars of S1 and S2, ignoring case. */ extern int wcsncasecmp (const wchar_t *__s1, const wchar_t *__s2, size_t __n) __THROW; /* Similar to the two functions above but take the information from the provided locale and not the global locale. */ #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 180 "/usr/include/wchar.h" 3 4 # 181 "/usr/include/wchar.h" 3 4 extern int wcscasecmp_l (const wchar_t *__s1, const wchar_t *__s2, __locale_t __loc) __THROW; extern int wcsncasecmp_l (const wchar_t *__s1, const wchar_t *__s2, size_t __n, __locale_t __loc) __THROW; #endif # 188 "/usr/include/wchar.h" 3 4 __BEGIN_NAMESPACE_STD /* Compare S1 and S2, both interpreted as appropriate to the LC_COLLATE category of the current locale. */ extern int wcscoll (const wchar_t *__s1, const wchar_t *__s2) __THROW; /* Transform S2 into array pointed to by S1 such that if wcscmp is applied to two transformed strings the result is the as applying `wcscoll' to the original strings. */ extern size_t wcsxfrm (wchar_t *__restrict __s1, const wchar_t *__restrict __s2, size_t __n) __THROW; __END_NAMESPACE_STD #ifdef __USE_XOPEN2K8 /* Similar to the two functions above but take the information from the provided locale and not the global locale. */ /* Compare S1 and S2, both interpreted as appropriate to the LC_COLLATE category of the given locale. */ extern int wcscoll_l (const wchar_t *__s1, const wchar_t *__s2, __locale_t __loc) __THROW; /* Transform S2 into array pointed to by S1 such that if wcscmp is applied to two transformed strings the result is the as applying `wcscoll' to the original strings. */ extern size_t wcsxfrm_l (wchar_t *__s1, const wchar_t *__s2, size_t __n, __locale_t __loc) __THROW; /* Duplicate S, returning an identical malloc'd string. */ extern wchar_t *wcsdup (const wchar_t *__s) __THROW __attribute_malloc__; #endif # 218 "/usr/include/wchar.h" 3 4 __BEGIN_NAMESPACE_STD /* Find the first occurrence of WC in WCS. */ #ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO extern "C++" wchar_t *wcschr (wchar_t *__wcs, wchar_t __wc) __THROW __asm ("wcschr") __attribute_pure__; extern "C++" const wchar_t *wcschr (const wchar_t *__wcs, wchar_t __wc) __THROW __asm ("wcschr") __attribute_pure__; #else # 227 "/usr/include/wchar.h" 3 4 extern wchar_t *wcschr (const wchar_t *__wcs, wchar_t __wc) __THROW __attribute_pure__; #endif # 230 "/usr/include/wchar.h" 3 4 /* Find the last occurrence of WC in WCS. */ #ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO extern "C++" wchar_t *wcsrchr (wchar_t *__wcs, wchar_t __wc) __THROW __asm ("wcsrchr") __attribute_pure__; extern "C++" const wchar_t *wcsrchr (const wchar_t *__wcs, wchar_t __wc) __THROW __asm ("wcsrchr") __attribute_pure__; #else # 237 "/usr/include/wchar.h" 3 4 extern wchar_t *wcsrchr (const wchar_t *__wcs, wchar_t __wc) __THROW __attribute_pure__; #endif # 240 "/usr/include/wchar.h" 3 4 __END_NAMESPACE_STD #ifdef __USE_GNU /* This function is similar to `wcschr'. But it returns a pointer to the closing NUL wide character in case C is not found in S. */ extern wchar_t *wcschrnul (const wchar_t *__s, wchar_t __wc) __THROW __attribute_pure__; #endif # 248 "/usr/include/wchar.h" 3 4 __BEGIN_NAMESPACE_STD /* Return the length of the initial segmet of WCS which consists entirely of wide characters not in REJECT. */ extern size_t wcscspn (const wchar_t *__wcs, const wchar_t *__reject) __THROW __attribute_pure__; /* Return the length of the initial segmet of WCS which consists entirely of wide characters in ACCEPT. */ extern size_t wcsspn (const wchar_t *__wcs, const wchar_t *__accept) __THROW __attribute_pure__; /* Find the first occurrence in WCS of any character in ACCEPT. */ #ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO extern "C++" wchar_t *wcspbrk (wchar_t *__wcs, const wchar_t *__accept) __THROW __asm ("wcspbrk") __attribute_pure__; extern "C++" const wchar_t *wcspbrk (const wchar_t *__wcs, const wchar_t *__accept) __THROW __asm ("wcspbrk") __attribute_pure__; #else # 266 "/usr/include/wchar.h" 3 4 extern wchar_t *wcspbrk (const wchar_t *__wcs, const wchar_t *__accept) __THROW __attribute_pure__; #endif # 269 "/usr/include/wchar.h" 3 4 /* Find the first occurrence of NEEDLE in HAYSTACK. */ #ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO extern "C++" wchar_t *wcsstr (wchar_t *__haystack, const wchar_t *__needle) __THROW __asm ("wcsstr") __attribute_pure__; extern "C++" const wchar_t *wcsstr (const wchar_t *__haystack, const wchar_t *__needle) __THROW __asm ("wcsstr") __attribute_pure__; #else # 277 "/usr/include/wchar.h" 3 4 extern wchar_t *wcsstr (const wchar_t *__haystack, const wchar_t *__needle) __THROW __attribute_pure__; #endif # 280 "/usr/include/wchar.h" 3 4 /* Divide WCS into tokens separated by characters in DELIM. */ extern wchar_t *wcstok (wchar_t *__restrict __s, const wchar_t *__restrict __delim, wchar_t **__restrict __ptr) __THROW; /* Return the number of wide characters in S. */ extern size_t wcslen (const wchar_t *__s) __THROW __attribute_pure__; __END_NAMESPACE_STD #ifdef __USE_XOPEN /* Another name for `wcsstr' from XPG4. */ # ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO extern "C++" wchar_t *wcswcs (wchar_t *__haystack, const wchar_t *__needle) __THROW __asm ("wcswcs") __attribute_pure__; extern "C++" const wchar_t *wcswcs (const wchar_t *__haystack, const wchar_t *__needle) __THROW __asm ("wcswcs") __attribute_pure__; # else # 299 "/usr/include/wchar.h" 3 4 extern wchar_t *wcswcs (const wchar_t *__haystack, const wchar_t *__needle) __THROW __attribute_pure__; # endif # 302 "/usr/include/wchar.h" 3 4 #endif # 303 "/usr/include/wchar.h" 3 4 #ifdef __USE_XOPEN2K8 /* Return the number of wide characters in S, but at most MAXLEN. */ extern size_t wcsnlen (const wchar_t *__s, size_t __maxlen) __THROW __attribute_pure__; #endif # 309 "/usr/include/wchar.h" 3 4 __BEGIN_NAMESPACE_STD /* Search N wide characters of S for C. */ #ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO extern "C++" wchar_t *wmemchr (wchar_t *__s, wchar_t __c, size_t __n) __THROW __asm ("wmemchr") __attribute_pure__; extern "C++" const wchar_t *wmemchr (const wchar_t *__s, wchar_t __c, size_t __n) __THROW __asm ("wmemchr") __attribute_pure__; #else # 320 "/usr/include/wchar.h" 3 4 extern wchar_t *wmemchr (const wchar_t *__s, wchar_t __c, size_t __n) __THROW __attribute_pure__; #endif # 323 "/usr/include/wchar.h" 3 4 /* Compare N wide characters of S1 and S2. */ extern int wmemcmp (const wchar_t *__s1, const wchar_t *__s2, size_t __n) __THROW __attribute_pure__; /* Copy N wide characters of SRC to DEST. */ extern wchar_t *wmemcpy (wchar_t *__restrict __s1, const wchar_t *__restrict __s2, size_t __n) __THROW; /* Copy N wide characters of SRC to DEST, guaranteeing correct behavior for overlapping strings. */ extern wchar_t *wmemmove (wchar_t *__s1, const wchar_t *__s2, size_t __n) __THROW; /* Set N wide characters of S to C. */ extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) __THROW; __END_NAMESPACE_STD #ifdef __USE_GNU /* Copy N wide characters of SRC to DEST and return pointer to following wide character. */ extern wchar_t *wmempcpy (wchar_t *__restrict __s1, const wchar_t *__restrict __s2, size_t __n) __THROW; #endif # 348 "/usr/include/wchar.h" 3 4 __BEGIN_NAMESPACE_STD /* Determine whether C constitutes a valid (one-byte) multibyte character. */ extern wint_t btowc (int __c) __THROW; /* Determine whether C corresponds to a member of the extended character set whose multibyte representation is a single byte. */ extern int wctob (wint_t __c) __THROW; /* Determine whether PS points to an object representing the initial state. */ extern int mbsinit (const mbstate_t *__ps) __THROW __attribute_pure__; /* Write wide character representation of multibyte character pointed to by S to PWC. */ extern size_t mbrtowc (wchar_t *__restrict __pwc, const char *__restrict __s, size_t __n, mbstate_t *__restrict __p) __THROW; /* Write multibyte representation of wide character WC to S. */ extern size_t wcrtomb (char *__restrict __s, wchar_t __wc, mbstate_t *__restrict __ps) __THROW; /* Return number of bytes in multibyte character pointed to by S. */ extern size_t __mbrlen (const char *__restrict __s, size_t __n, mbstate_t *__restrict __ps) __THROW; extern size_t mbrlen (const char *__restrict __s, size_t __n, mbstate_t *__restrict __ps) __THROW; __END_NAMESPACE_STD #ifdef __USE_EXTERN_INLINES /* Define inline function as optimization. */ /* We can use the BTOWC and WCTOB optimizations since we know that all locales must use ASCII encoding for the values in the ASCII range and because the wchar_t encoding is always ISO 10646. */ extern wint_t __btowc_alias (int __c) __asm ("btowc"); __extern_inline wint_t __NTH (btowc (int __c)) { return (__builtin_constant_p (__c) && __c >= '\0' && __c <= '\x7f' ? (wint_t) __c : __btowc_alias (__c)); } extern int __wctob_alias (wint_t __c) __asm ("wctob"); __extern_inline int __NTH (wctob (wint_t __wc)) { return (__builtin_constant_p (__wc) && __wc >= L'\0' && __wc <= L'\x7f' ? (int) __wc : __wctob_alias (__wc)); } __extern_inline size_t __NTH (mbrlen (const char *__restrict __s, size_t __n, mbstate_t *__restrict __ps)) { return (__ps != NULL ? mbrtowc (NULL, __s, __n, __ps) : __mbrlen (__s, __n, NULL)); } #endif # 404 "/usr/include/wchar.h" 3 4 __BEGIN_NAMESPACE_STD /* Write wide character representation of multibyte character string SRC to DST. */ extern size_t mbsrtowcs (wchar_t *__restrict __dst, const char **__restrict __src, size_t __len, mbstate_t *__restrict __ps) __THROW; /* Write multibyte character representation of wide character string SRC to DST. */ extern size_t wcsrtombs (char *__restrict __dst, const wchar_t **__restrict __src, size_t __len, mbstate_t *__restrict __ps) __THROW; __END_NAMESPACE_STD #ifdef __USE_XOPEN2K8 /* Write wide character representation of at most NMC bytes of the multibyte character string SRC to DST. */ extern size_t mbsnrtowcs (wchar_t *__restrict __dst, const char **__restrict __src, size_t __nmc, size_t __len, mbstate_t *__restrict __ps) __THROW; /* Write multibyte character representation of at most NWC characters from the wide character string SRC to DST. */ extern size_t wcsnrtombs (char *__restrict __dst, const wchar_t **__restrict __src, size_t __nwc, size_t __len, mbstate_t *__restrict __ps) __THROW; #endif /* use POSIX 2008 */ # 434 "/usr/include/wchar.h" 3 4 /* The following functions are extensions found in X/Open CAE. */ #ifdef __USE_XOPEN /* Determine number of column positions required for C. */ extern int wcwidth (wchar_t __c) __THROW; /* Determine number of column positions required for first N wide characters (or fewer if S ends before this) in S. */ extern int wcswidth (const wchar_t *__s, size_t __n) __THROW; #endif /* Use X/Open. */ # 445 "/usr/include/wchar.h" 3 4 __BEGIN_NAMESPACE_STD /* Convert initial portion of the wide string NPTR to `double' representation. */ extern double wcstod (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr) __THROW; __END_NAMESPACE_STD #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Likewise for `float' and `long double' sizes of floating-point numbers. */ extern float wcstof (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr) __THROW; extern long double wcstold (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr) __THROW; __END_NAMESPACE_C99 #endif /* C99 */ # 463 "/usr/include/wchar.h" 3 4 __BEGIN_NAMESPACE_STD /* Convert initial portion of wide string NPTR to `long int' representation. */ extern long int wcstol (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base) __THROW; /* Convert initial portion of wide string NPTR to `unsigned long int' representation. */ extern unsigned long int wcstoul (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base) __THROW; __END_NAMESPACE_STD #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Convert initial portion of wide string NPTR to `long long int' representation. */ __extension__ extern long long int wcstoll (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base) __THROW; /* Convert initial portion of wide string NPTR to `unsigned long long int' representation. */ __extension__ extern unsigned long long int wcstoull (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base) __THROW; __END_NAMESPACE_C99 #endif /* ISO C99. */ # 495 "/usr/include/wchar.h" 3 4 #ifdef __USE_GNU /* Convert initial portion of wide string NPTR to `long long int' representation. */ __extension__ extern long long int wcstoq (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base) __THROW; /* Convert initial portion of wide string NPTR to `unsigned long long int' representation. */ __extension__ extern unsigned long long int wcstouq (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base) __THROW; #endif /* Use GNU. */ # 511 "/usr/include/wchar.h" 3 4 #ifdef __USE_GNU /* The concept of one static locale per category is not very well thought out. Many applications will need to process its data using information from several different locales. Another application is the implementation of the internationalization handling in the upcoming ISO C++ standard library. To support this another set of the functions using locale data exist which have an additional argument. Attention: all these functions are *not* standardized in any form. This is a proof-of-concept implementation. */ /* Structure for reentrant locale using functions. This is an (almost) opaque type for the user level programs. */ #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 526 "/usr/include/wchar.h" 3 4 # 527 "/usr/include/wchar.h" 3 4 /* Special versions of the functions above which take the locale to use as an additional parameter. */ extern long int wcstol_l (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base, __locale_t __loc) __THROW; extern unsigned long int wcstoul_l (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base, __locale_t __loc) __THROW; __extension__ extern long long int wcstoll_l (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base, __locale_t __loc) __THROW; __extension__ extern unsigned long long int wcstoull_l (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base, __locale_t __loc) __THROW; extern double wcstod_l (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, __locale_t __loc) __THROW; extern float wcstof_l (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, __locale_t __loc) __THROW; extern long double wcstold_l (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, __locale_t __loc) __THROW; #endif /* use GNU */ # 561 "/usr/include/wchar.h" 3 4 #ifdef __USE_XOPEN2K8 /* Copy SRC to DEST, returning the address of the terminating L'\0' in DEST. */ extern wchar_t *wcpcpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src) __THROW; /* Copy no more than N characters of SRC to DEST, returning the address of the last character written into DEST. */ extern wchar_t *wcpncpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src, size_t __n) __THROW; /* Wide character I/O functions. */ /* Like OPEN_MEMSTREAM, but the stream is wide oriented and produces a wide character string. */ extern __FILE *open_wmemstream (wchar_t **__bufloc, size_t *__sizeloc) __THROW; #endif # 582 "/usr/include/wchar.h" 3 4 #if defined __USE_ISOC95 || defined __USE_UNIX98 __BEGIN_NAMESPACE_STD /* Select orientation for stream. */ extern int fwide (__FILE *__fp, int __mode) __THROW; /* Write formatted output to STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fwprintf (__FILE *__restrict __stream, const wchar_t *__restrict __format, ...) /* __attribute__ ((__format__ (__wprintf__, 2, 3))) */; /* Write formatted output to stdout. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int wprintf (const wchar_t *__restrict __format, ...) /* __attribute__ ((__format__ (__wprintf__, 1, 2))) */; /* Write formatted output of at most N characters to S. */ extern int swprintf (wchar_t *__restrict __s, size_t __n, const wchar_t *__restrict __format, ...) __THROW /* __attribute__ ((__format__ (__wprintf__, 3, 4))) */; /* Write formatted output to S from argument list ARG. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int vfwprintf (__FILE *__restrict __s, const wchar_t *__restrict __format, __gnuc_va_list __arg) /* __attribute__ ((__format__ (__wprintf__, 2, 0))) */; /* Write formatted output to stdout from argument list ARG. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int vwprintf (const wchar_t *__restrict __format, __gnuc_va_list __arg) /* __attribute__ ((__format__ (__wprintf__, 1, 0))) */; /* Write formatted output of at most N character to S from argument list ARG. */ extern int vswprintf (wchar_t *__restrict __s, size_t __n, const wchar_t *__restrict __format, __gnuc_va_list __arg) __THROW /* __attribute__ ((__format__ (__wprintf__, 3, 0))) */; /* Read formatted input from STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fwscanf (__FILE *__restrict __stream, const wchar_t *__restrict __format, ...) /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */; /* Read formatted input from stdin. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int wscanf (const wchar_t *__restrict __format, ...) /* __attribute__ ((__format__ (__wscanf__, 1, 2))) */; /* Read formatted input from S. */ extern int swscanf (const wchar_t *__restrict __s, const wchar_t *__restrict __format, ...) __THROW /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */; # if defined __USE_ISOC99 && !defined __USE_GNU \ && (!defined __LDBL_COMPAT || !defined __REDIRECT) \ && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K) # ifdef __REDIRECT /* For strict ISO C99 or POSIX compliance disallow %as, %aS and %a[ GNU extension which conflicts with valid %a followed by letter s, S or [. */ extern int __REDIRECT (fwscanf, (__FILE *__restrict __stream, const wchar_t *__restrict __format, ...), __isoc99_fwscanf) /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */; extern int __REDIRECT (wscanf, (const wchar_t *__restrict __format, ...), __isoc99_wscanf) /* __attribute__ ((__format__ (__wscanf__, 1, 2))) */; extern int __REDIRECT_NTH (swscanf, (const wchar_t *__restrict __s, const wchar_t *__restrict __format, ...), __isoc99_swscanf) /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */; # else # 668 "/usr/include/wchar.h" 3 4 extern int __isoc99_fwscanf (__FILE *__restrict __stream, const wchar_t *__restrict __format, ...); extern int __isoc99_wscanf (const wchar_t *__restrict __format, ...); extern int __isoc99_swscanf (const wchar_t *__restrict __s, const wchar_t *__restrict __format, ...) __THROW; # define fwscanf __isoc99_fwscanf # define wscanf __isoc99_wscanf # define swscanf __isoc99_swscanf # endif # 678 "/usr/include/wchar.h" 3 4 # endif # 679 "/usr/include/wchar.h" 3 4 __END_NAMESPACE_STD #endif /* Use ISO C95, C99 and Unix98. */ # 682 "/usr/include/wchar.h" 3 4 #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Read formatted input from S into argument list ARG. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int vfwscanf (__FILE *__restrict __s, const wchar_t *__restrict __format, __gnuc_va_list __arg) /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */; /* Read formatted input from stdin into argument list ARG. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int vwscanf (const wchar_t *__restrict __format, __gnuc_va_list __arg) /* __attribute__ ((__format__ (__wscanf__, 1, 0))) */; /* Read formatted input from S into argument list ARG. */ extern int vswscanf (const wchar_t *__restrict __s, const wchar_t *__restrict __format, __gnuc_va_list __arg) __THROW /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */; # if !defined __USE_GNU \ && (!defined __LDBL_COMPAT || !defined __REDIRECT) \ && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K) # ifdef __REDIRECT extern int __REDIRECT (vfwscanf, (__FILE *__restrict __s, const wchar_t *__restrict __format, __gnuc_va_list __arg), __isoc99_vfwscanf) /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */; extern int __REDIRECT (vwscanf, (const wchar_t *__restrict __format, __gnuc_va_list __arg), __isoc99_vwscanf) /* __attribute__ ((__format__ (__wscanf__, 1, 0))) */; extern int __REDIRECT_NTH (vswscanf, (const wchar_t *__restrict __s, const wchar_t *__restrict __format, __gnuc_va_list __arg), __isoc99_vswscanf) /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */; # else # 722 "/usr/include/wchar.h" 3 4 extern int __isoc99_vfwscanf (__FILE *__restrict __s, const wchar_t *__restrict __format, __gnuc_va_list __arg); extern int __isoc99_vwscanf (const wchar_t *__restrict __format, __gnuc_va_list __arg); extern int __isoc99_vswscanf (const wchar_t *__restrict __s, const wchar_t *__restrict __format, __gnuc_va_list __arg) __THROW; # define vfwscanf __isoc99_vfwscanf # define vwscanf __isoc99_vwscanf # define vswscanf __isoc99_vswscanf # endif # 734 "/usr/include/wchar.h" 3 4 # endif # 735 "/usr/include/wchar.h" 3 4 __END_NAMESPACE_C99 #endif /* Use ISO C99. */ # 738 "/usr/include/wchar.h" 3 4 __BEGIN_NAMESPACE_STD /* Read a character from STREAM. These functions are possible cancellation points and therefore not marked with __THROW. */ extern wint_t fgetwc (__FILE *__stream); extern wint_t getwc (__FILE *__stream); /* Read a character from stdin. This function is a possible cancellation point and therefore not marked with __THROW. */ extern wint_t getwchar (void); /* Write a character to STREAM. These functions are possible cancellation points and therefore not marked with __THROW. */ extern wint_t fputwc (wchar_t __wc, __FILE *__stream); extern wint_t putwc (wchar_t __wc, __FILE *__stream); /* Write a character to stdout. This function is a possible cancellation point and therefore not marked with __THROW. */ extern wint_t putwchar (wchar_t __wc); /* Get a newline-terminated wide character string of finite length from STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern wchar_t *fgetws (wchar_t *__restrict __ws, int __n, __FILE *__restrict __stream); /* Write a string to STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fputws (const wchar_t *__restrict __ws, __FILE *__restrict __stream); /* Push a character back onto the input buffer of STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern wint_t ungetwc (wint_t __wc, __FILE *__stream); __END_NAMESPACE_STD #ifdef __USE_GNU /* These are defined to be equivalent to the `char' functions defined in POSIX.1:1996. These functions are not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation they are cancellation points and therefore not marked with __THROW. */ extern wint_t getwc_unlocked (__FILE *__stream); extern wint_t getwchar_unlocked (void); /* This is the wide character version of a GNU extension. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern wint_t fgetwc_unlocked (__FILE *__stream); /* Faster version when locking is not necessary. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern wint_t fputwc_unlocked (wchar_t __wc, __FILE *__stream); /* These are defined to be equivalent to the `char' functions defined in POSIX.1:1996. These functions are not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation they are cancellation points and therefore not marked with __THROW. */ extern wint_t putwc_unlocked (wchar_t __wc, __FILE *__stream); extern wint_t putwchar_unlocked (wchar_t __wc); /* This function does the same as `fgetws' but does not lock the stream. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern wchar_t *fgetws_unlocked (wchar_t *__restrict __ws, int __n, __FILE *__restrict __stream); /* This function does the same as `fputws' but does not lock the stream. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int fputws_unlocked (const wchar_t *__restrict __ws, __FILE *__restrict __stream); #endif # 849 "/usr/include/wchar.h" 3 4 __BEGIN_NAMESPACE_C99 /* Format TP into S according to FORMAT. Write no more than MAXSIZE wide characters and return the number of wide characters written, or 0 if it would exceed MAXSIZE. */ extern size_t wcsftime (wchar_t *__restrict __s, size_t __maxsize, const wchar_t *__restrict __format, const struct tm *__restrict __tp) __THROW; __END_NAMESPACE_C99 # ifdef __USE_GNU #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 861 "/usr/include/wchar.h" 3 4 # 862 "/usr/include/wchar.h" 3 4 /* Similar to `wcsftime' but takes the information from the provided locale and not the global locale. */ extern size_t wcsftime_l (wchar_t *__restrict __s, size_t __maxsize, const wchar_t *__restrict __format, const struct tm *__restrict __tp, __locale_t __loc) __THROW; # endif # 870 "/usr/include/wchar.h" 3 4 /* The X/Open standard demands that most of the functions defined in the header must also appear here. This is probably because some X/Open members wrote their implementation before the ISO C standard was published and introduced the better solution. We have to provide these definitions for compliance reasons but we do this nonsense only if really necessary. */ #if defined __USE_UNIX98 && !defined __USE_GNU # define __need_iswxxx #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 879 "/usr/include/wchar.h" 3 4 # 880 "/usr/include/wchar.h" 3 4 #endif # 881 "/usr/include/wchar.h" 3 4 /* Define some macros helping to catch buffer overflows. */ #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 884 "/usr/include/wchar.h" 3 4 # 885 "/usr/include/wchar.h" 3 4 #endif # 886 "/usr/include/wchar.h" 3 4 #ifdef __LDBL_COMPAT #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 888 "/usr/include/wchar.h" 3 4 # 889 "/usr/include/wchar.h" 3 4 #endif # 890 "/usr/include/wchar.h" 3 4 __END_DECLS #endif /* _WCHAR_H defined */ # 894 "/usr/include/wchar.h" 3 4 #endif /* wchar.h */ # 896 "/usr/include/wchar.h" 3 4 /* Undefine all __need_* constants in case we are included to get those constants but the whole file was already read. */ #undef __need_mbstate_t #undef __need_wint_t # 21 "/usr/include/_G_config.h" 2 3 4 typedef struct { __off_t __pos; __mbstate_t __state; } _G_fpos_t; typedef struct { __off64_t __pos; __mbstate_t __state; } _G_fpos64_t; #if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 32 "/usr/include/_G_config.h" 3 4 # 33 "/usr/include/_G_config.h" 3 4 typedef union { struct __gconv_info __cd; struct { struct __gconv_info __cd; struct __gconv_step_data __data; } __combined; } _G_iconv_t; #endif # 43 "/usr/include/_G_config.h" 3 4 /* These library features are always available in the GNU C library. */ #define _G_va_list __gnuc_va_list #define _G_HAVE_MMAP 1 #define _G_HAVE_MREMAP 1 #define _G_IO_IO_FILE_VERSION 0x20001 /* This is defined by if `st_blksize' exists. */ #define _G_HAVE_ST_BLKSIZE defined (_STATBUF_ST_BLKSIZE) #define _G_BUFSIZ 8192 #endif /* _G_config.h */ # 59 "/usr/include/_G_config.h" 3 4 # 32 "/usr/include/libio.h" 2 3 4 /* ALL of these should be defined in _G_config.h */ #define _IO_fpos_t _G_fpos_t #define _IO_fpos64_t _G_fpos64_t #define _IO_size_t size_t #define _IO_ssize_t __ssize_t #define _IO_off_t __off_t #define _IO_off64_t __off64_t #define _IO_pid_t __pid_t #define _IO_uid_t __uid_t #define _IO_iconv_t _G_iconv_t #define _IO_HAVE_ST_BLKSIZE _G_HAVE_ST_BLKSIZE #define _IO_BUFSIZ _G_BUFSIZ #define _IO_va_list _G_va_list #define _IO_wint_t wint_t /* This define avoids name pollution if we're using GNU stdarg.h */ #define __need___va_list #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 49 "/usr/include/libio.h" 3 4 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdarg.h" 1 3 4 /*===---- stdarg.h - Variable argument handling ----------------------------=== * * Copyright (c) 2008 Eli Friedman * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __STDARG_H #define __STDARG_H #ifndef _VA_LIST typedef __builtin_va_list va_list; #define _VA_LIST #endif # 33 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdarg.h" 3 4 #define va_start(ap, param) __builtin_va_start(ap, param) #define va_end(ap) __builtin_va_end(ap) #define va_arg(ap, type) __builtin_va_arg(ap, type) /* GCC always defines __va_copy, but does not define va_copy unless in c99 mode * or -ansi is not specified, since it was not part of C90. */ #define __va_copy(d,s) __builtin_va_copy(d,s) #if __STDC_VERSION__ >= 199901L || __cplusplus >= 201103L || !defined(__STRICT_ANSI__) #define va_copy(dest, src) __builtin_va_copy(dest, src) #endif # 45 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdarg.h" 3 4 #ifndef __GNUC_VA_LIST #define __GNUC_VA_LIST 1 typedef __builtin_va_list __gnuc_va_list; #endif # 50 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdarg.h" 3 4 #endif /* __STDARG_H */ # 52 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdarg.h" 3 4 # 50 "/usr/include/libio.h" 2 3 4 #ifdef __GNUC_VA_LIST # undef _IO_va_list # define _IO_va_list __gnuc_va_list #endif /* __GNUC_VA_LIST */ # 54 "/usr/include/libio.h" 3 4 #ifndef __P #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 56 "/usr/include/libio.h" 3 4 # 57 "/usr/include/libio.h" 3 4 #endif /*!__P*/ # 58 "/usr/include/libio.h" 3 4 #define _IO_UNIFIED_JUMPTABLES 1 #ifndef EOF # define EOF (-1) #endif # 64 "/usr/include/libio.h" 3 4 #ifndef NULL # if defined __GNUG__ && \ (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8)) # define NULL (__null) # else # 69 "/usr/include/libio.h" 3 4 # if !defined(__cplusplus) # define NULL ((void*)0) # else # 72 "/usr/include/libio.h" 3 4 # define NULL (0) # endif # 74 "/usr/include/libio.h" 3 4 # endif # 75 "/usr/include/libio.h" 3 4 #endif # 76 "/usr/include/libio.h" 3 4 #define _IOS_INPUT 1 #define _IOS_OUTPUT 2 #define _IOS_ATEND 4 #define _IOS_APPEND 8 #define _IOS_TRUNC 16 #define _IOS_NOCREATE 32 #define _IOS_NOREPLACE 64 #define _IOS_BIN 128 /* Magic numbers and bits for the _flags field. The magic numbers use the high-order bits of _flags; the remaining bits are available for variable flags. Note: The magic numbers must all be negative if stdio emulation is desired. */ #define _IO_MAGIC 0xFBAD0000 /* Magic number */ #define _OLD_STDIO_MAGIC 0xFABC0000 /* Emulate old stdio. */ #define _IO_MAGIC_MASK 0xFFFF0000 #define _IO_USER_BUF 1 /* User owns buffer; don't delete it on close. */ #define _IO_UNBUFFERED 2 #define _IO_NO_READS 4 /* Reading not allowed */ #define _IO_NO_WRITES 8 /* Writing not allowd */ #define _IO_EOF_SEEN 0x10 #define _IO_ERR_SEEN 0x20 #define _IO_DELETE_DONT_CLOSE 0x40 /* Don't call close(_fileno) on cleanup. */ #define _IO_LINKED 0x80 /* Set if linked (using _chain) to streambuf::_list_all.*/ #define _IO_IN_BACKUP 0x100 #define _IO_LINE_BUF 0x200 #define _IO_TIED_PUT_GET 0x400 /* Set if put and get pointer logicly tied. */ #define _IO_CURRENTLY_PUTTING 0x800 #define _IO_IS_APPENDING 0x1000 #define _IO_IS_FILEBUF 0x2000 #define _IO_BAD_SEEN 0x4000 #define _IO_USER_LOCK 0x8000 #define _IO_FLAGS2_MMAP 1 #define _IO_FLAGS2_NOTCANCEL 2 #ifdef _LIBC # define _IO_FLAGS2_FORTIFY 4 #endif # 117 "/usr/include/libio.h" 3 4 #define _IO_FLAGS2_USER_WBUF 8 #ifdef _LIBC # define _IO_FLAGS2_SCANF_STD 16 # define _IO_FLAGS2_NOCLOSE 32 # define _IO_FLAGS2_CLOEXEC 64 #endif # 123 "/usr/include/libio.h" 3 4 /* These are "formatting flags" matching the iostream fmtflags enum values. */ #define _IO_SKIPWS 01 #define _IO_LEFT 02 #define _IO_RIGHT 04 #define _IO_INTERNAL 010 #define _IO_DEC 020 #define _IO_OCT 040 #define _IO_HEX 0100 #define _IO_SHOWBASE 0200 #define _IO_SHOWPOINT 0400 #define _IO_UPPERCASE 01000 #define _IO_SHOWPOS 02000 #define _IO_SCIENTIFIC 04000 #define _IO_FIXED 010000 #define _IO_UNITBUF 020000 #define _IO_STDIO 040000 #define _IO_DONT_CLOSE 0100000 #define _IO_BOOLALPHA 0200000 struct _IO_jump_t; struct _IO_FILE; /* Handle lock. */ #ifdef _IO_MTSAFE_IO # if defined __GLIBC__ && __GLIBC__ >= 2 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 149 "/usr/include/libio.h" 3 4 # 150 "/usr/include/libio.h" 3 4 # else # 151 "/usr/include/libio.h" 3 4 /*# include */ # endif # 153 "/usr/include/libio.h" 3 4 #else # 154 "/usr/include/libio.h" 3 4 typedef void _IO_lock_t; #endif # 156 "/usr/include/libio.h" 3 4 /* A streammarker remembers a position in a buffer. */ struct _IO_marker { struct _IO_marker *_next; struct _IO_FILE *_sbuf; /* If _pos >= 0 it points to _buf->Gbase()+_pos. FIXME comment */ /* if _pos < 0, it points to _buf->eBptr()+_pos. FIXME comment */ int _pos; #if 0 void set_streampos(streampos sp) { _spos = sp; } void set_offset(int offset) { _pos = offset; _spos = (streampos)(-2); } public: streammarker(streambuf *sb); ~streammarker(); int saving() { return _spos == -2; } int delta(streammarker&); int delta(); #endif # 177 "/usr/include/libio.h" 3 4 }; /* This is the structure from the libstdc++ codecvt class. */ enum __codecvt_result { __codecvt_ok, __codecvt_partial, __codecvt_error, __codecvt_noconv }; #if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T /* The order of the elements in the following struct must match the order of the virtual functions in the libstdc++ codecvt class. */ struct _IO_codecvt { void (*__codecvt_destr) (struct _IO_codecvt *); enum __codecvt_result (*__codecvt_do_out) (struct _IO_codecvt *, __mbstate_t *, const wchar_t *, const wchar_t *, const wchar_t **, char *, char *, char **); enum __codecvt_result (*__codecvt_do_unshift) (struct _IO_codecvt *, __mbstate_t *, char *, char *, char **); enum __codecvt_result (*__codecvt_do_in) (struct _IO_codecvt *, __mbstate_t *, const char *, const char *, const char **, wchar_t *, wchar_t *, wchar_t **); int (*__codecvt_do_encoding) (struct _IO_codecvt *); int (*__codecvt_do_always_noconv) (struct _IO_codecvt *); int (*__codecvt_do_length) (struct _IO_codecvt *, __mbstate_t *, const char *, const char *, _IO_size_t); int (*__codecvt_do_max_length) (struct _IO_codecvt *); _IO_iconv_t __cd_in; _IO_iconv_t __cd_out; }; /* Extra data for wide character streams. */ struct _IO_wide_data { wchar_t *_IO_read_ptr; /* Current read pointer */ wchar_t *_IO_read_end; /* End of get area. */ wchar_t *_IO_read_base; /* Start of putback+get area. */ wchar_t *_IO_write_base; /* Start of put area. */ wchar_t *_IO_write_ptr; /* Current put pointer. */ wchar_t *_IO_write_end; /* End of put area. */ wchar_t *_IO_buf_base; /* Start of reserve area. */ wchar_t *_IO_buf_end; /* End of reserve area. */ /* The following fields are used to support backing up and undo. */ wchar_t *_IO_save_base; /* Pointer to start of non-current get area. */ wchar_t *_IO_backup_base; /* Pointer to first valid character of backup area */ wchar_t *_IO_save_end; /* Pointer to end of non-current get area. */ __mbstate_t _IO_state; __mbstate_t _IO_last_state; struct _IO_codecvt _codecvt; wchar_t _shortbuf[1]; const struct _IO_jump_t *_wide_vtable; }; #endif # 244 "/usr/include/libio.h" 3 4 struct _IO_FILE { int _flags; /* High-order word is _IO_MAGIC; rest is flags. */ #define _IO_file_flags _flags /* The following pointers correspond to the C++ streambuf protocol. */ /* Note: Tk uses the _IO_read_ptr and _IO_read_end fields directly. */ char* _IO_read_ptr; /* Current read pointer */ char* _IO_read_end; /* End of get area. */ char* _IO_read_base; /* Start of putback+get area. */ char* _IO_write_base; /* Start of put area. */ char* _IO_write_ptr; /* Current put pointer. */ char* _IO_write_end; /* End of put area. */ char* _IO_buf_base; /* Start of reserve area. */ char* _IO_buf_end; /* End of reserve area. */ /* The following fields are used to support backing up and undo. */ char *_IO_save_base; /* Pointer to start of non-current get area. */ char *_IO_backup_base; /* Pointer to first valid character of backup area */ char *_IO_save_end; /* Pointer to end of non-current get area. */ struct _IO_marker *_markers; struct _IO_FILE *_chain; int _fileno; #if 0 int _blksize; #else # 272 "/usr/include/libio.h" 3 4 int _flags2; #endif # 274 "/usr/include/libio.h" 3 4 _IO_off_t _old_offset; /* This used to be _offset but it's too small. */ #define __HAVE_COLUMN /* temporary */ /* 1+column number of pbase(); 0 is unknown. */ unsigned short _cur_column; signed char _vtable_offset; char _shortbuf[1]; /* char* _save_gptr; char* _save_egptr; */ _IO_lock_t *_lock; #ifdef _IO_USE_OLD_IO_FILE }; struct _IO_FILE_complete { struct _IO_FILE _file; #endif # 292 "/usr/include/libio.h" 3 4 #if defined _G_IO_IO_FILE_VERSION && _G_IO_IO_FILE_VERSION == 0x20001 _IO_off64_t _offset; # if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T /* Wide character stream stuff. */ struct _IO_codecvt *_codecvt; struct _IO_wide_data *_wide_data; struct _IO_FILE *_freeres_list; void *_freeres_buf; size_t _freeres_size; # else # 302 "/usr/include/libio.h" 3 4 void *__pad1; void *__pad2; void *__pad3; void *__pad4; size_t __pad5; # endif # 308 "/usr/include/libio.h" 3 4 int _mode; /* Make sure we don't get into trouble again. */ char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)]; #endif # 312 "/usr/include/libio.h" 3 4 }; #ifndef __cplusplus typedef struct _IO_FILE _IO_FILE; #endif # 317 "/usr/include/libio.h" 3 4 struct _IO_FILE_plus; extern struct _IO_FILE_plus _IO_2_1_stdin_; extern struct _IO_FILE_plus _IO_2_1_stdout_; extern struct _IO_FILE_plus _IO_2_1_stderr_; #ifndef _LIBC #define _IO_stdin ((_IO_FILE*)(&_IO_2_1_stdin_)) #define _IO_stdout ((_IO_FILE*)(&_IO_2_1_stdout_)) #define _IO_stderr ((_IO_FILE*)(&_IO_2_1_stderr_)) #else # 328 "/usr/include/libio.h" 3 4 extern _IO_FILE *_IO_stdin attribute_hidden; extern _IO_FILE *_IO_stdout attribute_hidden; extern _IO_FILE *_IO_stderr attribute_hidden; #endif # 332 "/usr/include/libio.h" 3 4 /* Functions to do I/O and file management for a stream. */ /* Read NBYTES bytes from COOKIE into a buffer pointed to by BUF. Return number of bytes read. */ typedef __ssize_t __io_read_fn (void *__cookie, char *__buf, size_t __nbytes); /* Write N bytes pointed to by BUF to COOKIE. Write all N bytes unless there is an error. Return number of bytes written. If there is an error, return 0 and do not write anything. If the file has been opened for append (__mode.__append set), then set the file pointer to the end of the file and then do the write; if not, just write at the current file pointer. */ typedef __ssize_t __io_write_fn (void *__cookie, const char *__buf, size_t __n); /* Move COOKIE's file position to *POS bytes from the beginning of the file (if W is SEEK_SET), the current position (if W is SEEK_CUR), or the end of the file (if W is SEEK_END). Set *POS to the new file position. Returns zero if successful, nonzero if not. */ typedef int __io_seek_fn (void *__cookie, _IO_off64_t *__pos, int __w); /* Close COOKIE. */ typedef int __io_close_fn (void *__cookie); #ifdef _GNU_SOURCE /* User-visible names for the above. */ typedef __io_read_fn cookie_read_function_t; typedef __io_write_fn cookie_write_function_t; typedef __io_seek_fn cookie_seek_function_t; typedef __io_close_fn cookie_close_function_t; /* The structure with the cookie function pointers. */ typedef struct { __io_read_fn *read; /* Read bytes. */ __io_write_fn *write; /* Write bytes. */ __io_seek_fn *seek; /* Seek/tell file position. */ __io_close_fn *close; /* Close file. */ } _IO_cookie_io_functions_t; typedef _IO_cookie_io_functions_t cookie_io_functions_t; struct _IO_cookie_file; /* Initialize one of those. */ extern void _IO_cookie_init (struct _IO_cookie_file *__cfile, int __read_write, void *__cookie, _IO_cookie_io_functions_t __fns); #endif # 384 "/usr/include/libio.h" 3 4 #ifdef __cplusplus extern "C" { #endif # 389 "/usr/include/libio.h" 3 4 extern int __underflow (_IO_FILE *); extern int __uflow (_IO_FILE *); extern int __overflow (_IO_FILE *, int); #if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T extern _IO_wint_t __wunderflow (_IO_FILE *); extern _IO_wint_t __wuflow (_IO_FILE *); extern _IO_wint_t __woverflow (_IO_FILE *, _IO_wint_t); #endif # 398 "/usr/include/libio.h" 3 4 #if __GNUC__ >= 3 # define _IO_BE(expr, res) __builtin_expect ((expr), res) #else # 402 "/usr/include/libio.h" 3 4 # define _IO_BE(expr, res) (expr) #endif # 404 "/usr/include/libio.h" 3 4 #define _IO_getc_unlocked(_fp) \ (_IO_BE ((_fp)->_IO_read_ptr >= (_fp)->_IO_read_end, 0) \ ? __uflow (_fp) : *(unsigned char *) (_fp)->_IO_read_ptr++) #define _IO_peekc_unlocked(_fp) \ (_IO_BE ((_fp)->_IO_read_ptr >= (_fp)->_IO_read_end, 0) \ && __underflow (_fp) == EOF ? EOF \ : *(unsigned char *) (_fp)->_IO_read_ptr) #define _IO_putc_unlocked(_ch, _fp) \ (_IO_BE ((_fp)->_IO_write_ptr >= (_fp)->_IO_write_end, 0) \ ? __overflow (_fp, (unsigned char) (_ch)) \ : (unsigned char) (*(_fp)->_IO_write_ptr++ = (_ch))) #if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T # define _IO_getwc_unlocked(_fp) \ (_IO_BE ((_fp)->_wide_data == NULL \ || ((_fp)->_wide_data->_IO_read_ptr \ >= (_fp)->_wide_data->_IO_read_end), 0) \ ? __wuflow (_fp) : (_IO_wint_t) *(_fp)->_wide_data->_IO_read_ptr++) # define _IO_putwc_unlocked(_wch, _fp) \ (_IO_BE ((_fp)->_wide_data == NULL \ || ((_fp)->_wide_data->_IO_write_ptr \ >= (_fp)->_wide_data->_IO_write_end), 0) \ ? __woverflow (_fp, _wch) \ : (_IO_wint_t) (*(_fp)->_wide_data->_IO_write_ptr++ = (_wch))) #endif # 430 "/usr/include/libio.h" 3 4 #define _IO_feof_unlocked(__fp) (((__fp)->_flags & _IO_EOF_SEEN) != 0) #define _IO_ferror_unlocked(__fp) (((__fp)->_flags & _IO_ERR_SEEN) != 0) extern int _IO_getc (_IO_FILE *__fp); extern int _IO_putc (int __c, _IO_FILE *__fp); extern int _IO_feof (_IO_FILE *__fp) __THROW; extern int _IO_ferror (_IO_FILE *__fp) __THROW; extern int _IO_peekc_locked (_IO_FILE *__fp); /* This one is for Emacs. */ #define _IO_PENDING_OUTPUT_COUNT(_fp) \ ((_fp)->_IO_write_ptr - (_fp)->_IO_write_base) extern void _IO_flockfile (_IO_FILE *) __THROW; extern void _IO_funlockfile (_IO_FILE *) __THROW; extern int _IO_ftrylockfile (_IO_FILE *) __THROW; #ifdef _IO_MTSAFE_IO # define _IO_peekc(_fp) _IO_peekc_locked (_fp) # define _IO_flockfile(_fp) \ if (((_fp)->_flags & _IO_USER_LOCK) == 0) _IO_flockfile (_fp) # define _IO_funlockfile(_fp) \ if (((_fp)->_flags & _IO_USER_LOCK) == 0) _IO_funlockfile (_fp) #else # 456 "/usr/include/libio.h" 3 4 # define _IO_peekc(_fp) _IO_peekc_unlocked (_fp) # define _IO_flockfile(_fp) /**/ # define _IO_funlockfile(_fp) /**/ # define _IO_ftrylockfile(_fp) /**/ # define _IO_cleanup_region_start(_fct, _fp) /**/ # define _IO_cleanup_region_end(_Doit) /**/ #endif /* !_IO_MTSAFE_IO */ # 463 "/usr/include/libio.h" 3 4 extern int _IO_vfscanf (_IO_FILE * __restrict, const char * __restrict, _IO_va_list, int *__restrict); extern int _IO_vfprintf (_IO_FILE *__restrict, const char *__restrict, _IO_va_list); extern _IO_ssize_t _IO_padn (_IO_FILE *, int, _IO_ssize_t); extern _IO_size_t _IO_sgetn (_IO_FILE *, void *, _IO_size_t); extern _IO_off64_t _IO_seekoff (_IO_FILE *, _IO_off64_t, int, int); extern _IO_off64_t _IO_seekpos (_IO_FILE *, _IO_off64_t, int); extern void _IO_free_backup_area (_IO_FILE *) __THROW; #if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T extern _IO_wint_t _IO_getwc (_IO_FILE *__fp); extern _IO_wint_t _IO_putwc (wchar_t __wc, _IO_FILE *__fp); extern int _IO_fwide (_IO_FILE *__fp, int __mode) __THROW; # if __GNUC__ >= 2 /* While compiling glibc we have to handle compatibility with very old versions. */ # if defined _LIBC && defined SHARED #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 484 "/usr/include/libio.h" 3 4 # 485 "/usr/include/libio.h" 3 4 # if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1) # define _IO_fwide_maybe_incompatible \ (__builtin_expect (&_IO_stdin_used == NULL, 0)) extern const int _IO_stdin_used; weak_extern (_IO_stdin_used); # endif # 491 "/usr/include/libio.h" 3 4 # endif # 492 "/usr/include/libio.h" 3 4 # ifndef _IO_fwide_maybe_incompatible # define _IO_fwide_maybe_incompatible (0) # endif # 495 "/usr/include/libio.h" 3 4 /* A special optimized version of the function above. It optimizes the case of initializing an unoriented byte stream. */ # define _IO_fwide(__fp, __mode) \ ({ int __result = (__mode); \ if (__result < 0 && ! _IO_fwide_maybe_incompatible) \ { \ if ((__fp)->_mode == 0) \ /* We know that all we have to do is to set the flag. */ \ (__fp)->_mode = -1; \ __result = (__fp)->_mode; \ } \ else if (__builtin_constant_p (__mode) && (__mode) == 0) \ __result = _IO_fwide_maybe_incompatible ? -1 : (__fp)->_mode; \ else \ __result = _IO_fwide (__fp, __result); \ __result; }) # endif # 512 "/usr/include/libio.h" 3 4 extern int _IO_vfwscanf (_IO_FILE * __restrict, const wchar_t * __restrict, _IO_va_list, int *__restrict); extern int _IO_vfwprintf (_IO_FILE *__restrict, const wchar_t *__restrict, _IO_va_list); extern _IO_ssize_t _IO_wpadn (_IO_FILE *, wint_t, _IO_ssize_t); extern void _IO_free_wbackup_area (_IO_FILE *) __THROW; #endif # 520 "/usr/include/libio.h" 3 4 #ifdef __LDBL_COMPAT #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 522 "/usr/include/libio.h" 3 4 # 523 "/usr/include/libio.h" 3 4 #endif # 524 "/usr/include/libio.h" 3 4 #ifdef __cplusplus } #endif # 528 "/usr/include/libio.h" 3 4 #endif /* _IO_STDIO_H */ # 530 "/usr/include/libio.h" 3 4 # 75 "/usr/include/stdio.h" 2 3 4 #if defined __USE_XOPEN || defined __USE_XOPEN2K8 # ifdef __GNUC__ # ifndef _VA_LIST_DEFINED typedef _G_va_list va_list; # define _VA_LIST_DEFINED # endif # 82 "/usr/include/stdio.h" 3 4 # else # 83 "/usr/include/stdio.h" 3 4 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 83 "/usr/include/stdio.h" 3 4 # 84 "/usr/include/stdio.h" 3 4 # endif # 85 "/usr/include/stdio.h" 3 4 #endif # 86 "/usr/include/stdio.h" 3 4 #ifdef __USE_XOPEN2K8 # ifndef __off_t_defined # ifndef __USE_FILE_OFFSET64 typedef __off_t off_t; # else # 92 "/usr/include/stdio.h" 3 4 typedef __off64_t off_t; # endif # 94 "/usr/include/stdio.h" 3 4 # define __off_t_defined # endif # 96 "/usr/include/stdio.h" 3 4 # if defined __USE_LARGEFILE64 && !defined __off64_t_defined typedef __off64_t off64_t; # define __off64_t_defined # endif # 100 "/usr/include/stdio.h" 3 4 # ifndef __ssize_t_defined typedef __ssize_t ssize_t; # define __ssize_t_defined # endif # 105 "/usr/include/stdio.h" 3 4 #endif # 106 "/usr/include/stdio.h" 3 4 /* The type of the second argument to `fgetpos' and `fsetpos'. */ __BEGIN_NAMESPACE_STD #ifndef __USE_FILE_OFFSET64 typedef _G_fpos_t fpos_t; #else # 112 "/usr/include/stdio.h" 3 4 typedef _G_fpos64_t fpos_t; #endif # 114 "/usr/include/stdio.h" 3 4 __END_NAMESPACE_STD #ifdef __USE_LARGEFILE64 typedef _G_fpos64_t fpos64_t; #endif # 118 "/usr/include/stdio.h" 3 4 /* The possibilities for the third argument to `setvbuf'. */ #define _IOFBF 0 /* Fully buffered. */ #define _IOLBF 1 /* Line buffered. */ #define _IONBF 2 /* No buffering. */ /* Default buffer size. */ #ifndef BUFSIZ # define BUFSIZ _IO_BUFSIZ #endif # 129 "/usr/include/stdio.h" 3 4 /* End of file character. Some things throughout the library rely on this being -1. */ #ifndef EOF # define EOF (-1) #endif # 136 "/usr/include/stdio.h" 3 4 /* The possibilities for the third argument to `fseek'. These values should not be changed. */ #define SEEK_SET 0 /* Seek from beginning of file. */ #define SEEK_CUR 1 /* Seek from current position. */ #define SEEK_END 2 /* Seek from end of file. */ #ifdef __USE_GNU # define SEEK_DATA 3 /* Seek to next data. */ # define SEEK_HOLE 4 /* Seek to next hole. */ #endif # 147 "/usr/include/stdio.h" 3 4 #if defined __USE_SVID || defined __USE_XOPEN /* Default path prefix for `tempnam' and `tmpnam'. */ # define P_tmpdir "/tmp" #endif # 153 "/usr/include/stdio.h" 3 4 /* Get the values: L_tmpnam How long an array of chars must be to be passed to `tmpnam'. TMP_MAX The minimum number of unique filenames generated by tmpnam (and tempnam when it uses tmpnam's name space), or tempnam (the two are separate). L_ctermid How long an array to pass to `ctermid'. L_cuserid How long an array to pass to `cuserid'. FOPEN_MAX Minimum number of files that can be open at once. FILENAME_MAX Maximum length of a filename. */ #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 164 "/usr/include/stdio.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/stdio_lim.h" 1 3 4 /* Copyright (C) 1994-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #if !defined _STDIO_H && !defined __need_FOPEN_MAX && !defined __need_IOV_MAX # error "Never include directly; use instead." #endif # 21 "/usr/include/x86_64-linux-gnu/bits/stdio_lim.h" 3 4 #ifdef _STDIO_H # define L_tmpnam 20 # define TMP_MAX 238328 # define FILENAME_MAX 4096 # ifdef __USE_POSIX # define L_ctermid 9 # if !defined __USE_XOPEN2K || defined __USE_GNU # define L_cuserid 9 # endif # 32 "/usr/include/x86_64-linux-gnu/bits/stdio_lim.h" 3 4 # endif # 33 "/usr/include/x86_64-linux-gnu/bits/stdio_lim.h" 3 4 #endif # 34 "/usr/include/x86_64-linux-gnu/bits/stdio_lim.h" 3 4 #if defined __need_FOPEN_MAX || defined _STDIO_H # undef FOPEN_MAX # define FOPEN_MAX 16 #endif # 39 "/usr/include/x86_64-linux-gnu/bits/stdio_lim.h" 3 4 #if defined __need_IOV_MAX && !defined IOV_MAX # define IOV_MAX 1024 #endif # 43 "/usr/include/x86_64-linux-gnu/bits/stdio_lim.h" 3 4 # 165 "/usr/include/stdio.h" 2 3 4 /* Standard streams. */ extern struct _IO_FILE *stdin; /* Standard input stream. */ extern struct _IO_FILE *stdout; /* Standard output stream. */ extern struct _IO_FILE *stderr; /* Standard error output stream. */ /* C89/C99 say they're macros. Make them happy. */ #define stdin stdin #define stdout stdout #define stderr stderr __BEGIN_NAMESPACE_STD /* Remove file FILENAME. */ extern int remove (const char *__filename) __THROW; /* Rename file OLD to NEW. */ extern int rename (const char *__old, const char *__new) __THROW; __END_NAMESPACE_STD #ifdef __USE_ATFILE /* Rename file OLD relative to OLDFD to NEW relative to NEWFD. */ extern int renameat (int __oldfd, const char *__old, int __newfd, const char *__new) __THROW; #endif # 188 "/usr/include/stdio.h" 3 4 __BEGIN_NAMESPACE_STD /* Create a temporary file and open it read/write. This function is a possible cancellation point and therefore not marked with __THROW. */ #ifndef __USE_FILE_OFFSET64 extern FILE *tmpfile (void) __wur; #else # 197 "/usr/include/stdio.h" 3 4 # ifdef __REDIRECT extern FILE *__REDIRECT (tmpfile, (void), tmpfile64) __wur; # else # 200 "/usr/include/stdio.h" 3 4 # define tmpfile tmpfile64 # endif # 202 "/usr/include/stdio.h" 3 4 #endif # 203 "/usr/include/stdio.h" 3 4 #ifdef __USE_LARGEFILE64 extern FILE *tmpfile64 (void) __wur; #endif # 207 "/usr/include/stdio.h" 3 4 /* Generate a temporary filename. */ extern char *tmpnam (char *__s) __THROW __wur; __END_NAMESPACE_STD #ifdef __USE_MISC /* This is the reentrant variant of `tmpnam'. The only difference is that it does not allow S to be NULL. */ extern char *tmpnam_r (char *__s) __THROW __wur; #endif # 217 "/usr/include/stdio.h" 3 4 #if defined __USE_SVID || defined __USE_XOPEN /* Generate a unique temporary filename using up to five characters of PFX if it is not NULL. The directory to put this file in is searched for as follows: First the environment variable "TMPDIR" is checked. If it contains the name of a writable directory, that directory is used. If not and if DIR is not NULL, that value is checked. If that fails, P_tmpdir is tried and finally "/tmp". The storage for the filename is allocated by `malloc'. */ extern char *tempnam (const char *__dir, const char *__pfx) __THROW __attribute_malloc__ __wur; #endif # 230 "/usr/include/stdio.h" 3 4 __BEGIN_NAMESPACE_STD /* Close STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fclose (FILE *__stream); /* Flush STREAM, or all streams if STREAM is NULL. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fflush (FILE *__stream); __END_NAMESPACE_STD #ifdef __USE_MISC /* Faster versions when locking is not required. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int fflush_unlocked (FILE *__stream); #endif # 254 "/usr/include/stdio.h" 3 4 #ifdef __USE_GNU /* Close all streams. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int fcloseall (void); #endif # 264 "/usr/include/stdio.h" 3 4 __BEGIN_NAMESPACE_STD #ifndef __USE_FILE_OFFSET64 /* Open a file and create a new stream for it. This function is a possible cancellation point and therefore not marked with __THROW. */ extern FILE *fopen (const char *__restrict __filename, const char *__restrict __modes) __wur; /* Open a file, replacing an existing stream with it. This function is a possible cancellation point and therefore not marked with __THROW. */ extern FILE *freopen (const char *__restrict __filename, const char *__restrict __modes, FILE *__restrict __stream) __wur; #else # 282 "/usr/include/stdio.h" 3 4 # ifdef __REDIRECT extern FILE *__REDIRECT (fopen, (const char *__restrict __filename, const char *__restrict __modes), fopen64) __wur; extern FILE *__REDIRECT (freopen, (const char *__restrict __filename, const char *__restrict __modes, FILE *__restrict __stream), freopen64) __wur; # else # 291 "/usr/include/stdio.h" 3 4 # define fopen fopen64 # define freopen freopen64 # endif # 294 "/usr/include/stdio.h" 3 4 #endif # 295 "/usr/include/stdio.h" 3 4 __END_NAMESPACE_STD #ifdef __USE_LARGEFILE64 extern FILE *fopen64 (const char *__restrict __filename, const char *__restrict __modes) __wur; extern FILE *freopen64 (const char *__restrict __filename, const char *__restrict __modes, FILE *__restrict __stream) __wur; #endif # 303 "/usr/include/stdio.h" 3 4 #ifdef __USE_POSIX /* Create a new stream that refers to an existing system file descriptor. */ extern FILE *fdopen (int __fd, const char *__modes) __THROW __wur; #endif # 308 "/usr/include/stdio.h" 3 4 #ifdef __USE_GNU /* Create a new stream that refers to the given magic cookie, and uses the given functions for input and output. */ extern FILE *fopencookie (void *__restrict __magic_cookie, const char *__restrict __modes, _IO_cookie_io_functions_t __io_funcs) __THROW __wur; #endif # 316 "/usr/include/stdio.h" 3 4 #ifdef __USE_XOPEN2K8 /* Create a new stream that refers to a memory buffer. */ extern FILE *fmemopen (void *__s, size_t __len, const char *__modes) __THROW __wur; /* Open a stream that writes into a malloc'd buffer that is expanded as necessary. *BUFLOC and *SIZELOC are updated with the buffer's location and the number of characters written on fflush or fclose. */ extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __THROW __wur; #endif # 327 "/usr/include/stdio.h" 3 4 __BEGIN_NAMESPACE_STD /* If BUF is NULL, make STREAM unbuffered. Else make it use buffer BUF, of size BUFSIZ. */ extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __THROW; /* Make STREAM use buffering mode MODE. If BUF is not NULL, use N bytes of it for buffering; else allocate an internal buffer N bytes long. */ extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf, int __modes, size_t __n) __THROW; __END_NAMESPACE_STD #ifdef __USE_BSD /* If BUF is NULL, make STREAM unbuffered. Else make it use SIZE bytes of BUF for buffering. */ extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf, size_t __size) __THROW; /* Make STREAM line-buffered. */ extern void setlinebuf (FILE *__stream) __THROW; #endif # 349 "/usr/include/stdio.h" 3 4 __BEGIN_NAMESPACE_STD /* Write formatted output to STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fprintf (FILE *__restrict __stream, const char *__restrict __format, ...); /* Write formatted output to stdout. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int printf (const char *__restrict __format, ...); /* Write formatted output to S. */ extern int sprintf (char *__restrict __s, const char *__restrict __format, ...) __THROWNL; /* Write formatted output to S from argument list ARG. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int vfprintf (FILE *__restrict __s, const char *__restrict __format, _G_va_list __arg); /* Write formatted output to stdout from argument list ARG. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int vprintf (const char *__restrict __format, _G_va_list __arg); /* Write formatted output to S from argument list ARG. */ extern int vsprintf (char *__restrict __s, const char *__restrict __format, _G_va_list __arg) __THROWNL; __END_NAMESPACE_STD #if defined __USE_BSD || defined __USE_ISOC99 || defined __USE_UNIX98 __BEGIN_NAMESPACE_C99 /* Maximum chars of output to write in MAXLEN. */ extern int snprintf (char *__restrict __s, size_t __maxlen, const char *__restrict __format, ...) __THROWNL __attribute__ ((__format__ (__printf__, 3, 4))); extern int vsnprintf (char *__restrict __s, size_t __maxlen, const char *__restrict __format, _G_va_list __arg) __THROWNL __attribute__ ((__format__ (__printf__, 3, 0))); __END_NAMESPACE_C99 #endif # 395 "/usr/include/stdio.h" 3 4 #ifdef __USE_GNU /* Write formatted output to a string dynamically allocated with `malloc'. Store the address of the string in *PTR. */ extern int vasprintf (char **__restrict __ptr, const char *__restrict __f, _G_va_list __arg) __THROWNL __attribute__ ((__format__ (__printf__, 2, 0))) __wur; extern int __asprintf (char **__restrict __ptr, const char *__restrict __fmt, ...) __THROWNL __attribute__ ((__format__ (__printf__, 2, 3))) __wur; extern int asprintf (char **__restrict __ptr, const char *__restrict __fmt, ...) __THROWNL __attribute__ ((__format__ (__printf__, 2, 3))) __wur; #endif # 409 "/usr/include/stdio.h" 3 4 #ifdef __USE_XOPEN2K8 /* Write formatted output to a file descriptor. */ extern int vdprintf (int __fd, const char *__restrict __fmt, _G_va_list __arg) __attribute__ ((__format__ (__printf__, 2, 0))); extern int dprintf (int __fd, const char *__restrict __fmt, ...) __attribute__ ((__format__ (__printf__, 2, 3))); #endif # 418 "/usr/include/stdio.h" 3 4 __BEGIN_NAMESPACE_STD /* Read formatted input from STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fscanf (FILE *__restrict __stream, const char *__restrict __format, ...) __wur; /* Read formatted input from stdin. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int scanf (const char *__restrict __format, ...) __wur; /* Read formatted input from S. */ extern int sscanf (const char *__restrict __s, const char *__restrict __format, ...) __THROW; #if defined __USE_ISOC99 && !defined __USE_GNU \ && (!defined __LDBL_COMPAT || !defined __REDIRECT) \ && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K) # ifdef __REDIRECT /* For strict ISO C99 or POSIX compliance disallow %as, %aS and %a[ GNU extension which conflicts with valid %a followed by letter s, S or [. */ extern int __REDIRECT (fscanf, (FILE *__restrict __stream, const char *__restrict __format, ...), __isoc99_fscanf) __wur; extern int __REDIRECT (scanf, (const char *__restrict __format, ...), __isoc99_scanf) __wur; extern int __REDIRECT_NTH (sscanf, (const char *__restrict __s, const char *__restrict __format, ...), __isoc99_sscanf); # else # 452 "/usr/include/stdio.h" 3 4 extern int __isoc99_fscanf (FILE *__restrict __stream, const char *__restrict __format, ...) __wur; extern int __isoc99_scanf (const char *__restrict __format, ...) __wur; extern int __isoc99_sscanf (const char *__restrict __s, const char *__restrict __format, ...) __THROW; # define fscanf __isoc99_fscanf # define scanf __isoc99_scanf # define sscanf __isoc99_sscanf # endif # 461 "/usr/include/stdio.h" 3 4 #endif # 462 "/usr/include/stdio.h" 3 4 __END_NAMESPACE_STD #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Read formatted input from S into argument list ARG. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int vfscanf (FILE *__restrict __s, const char *__restrict __format, _G_va_list __arg) __attribute__ ((__format__ (__scanf__, 2, 0))) __wur; /* Read formatted input from stdin into argument list ARG. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int vscanf (const char *__restrict __format, _G_va_list __arg) __attribute__ ((__format__ (__scanf__, 1, 0))) __wur; /* Read formatted input from S into argument list ARG. */ extern int vsscanf (const char *__restrict __s, const char *__restrict __format, _G_va_list __arg) __THROW __attribute__ ((__format__ (__scanf__, 2, 0))); # if !defined __USE_GNU \ && (!defined __LDBL_COMPAT || !defined __REDIRECT) \ && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K) # ifdef __REDIRECT /* For strict ISO C99 or POSIX compliance disallow %as, %aS and %a[ GNU extension which conflicts with valid %a followed by letter s, S or [. */ extern int __REDIRECT (vfscanf, (FILE *__restrict __s, const char *__restrict __format, _G_va_list __arg), __isoc99_vfscanf) __attribute__ ((__format__ (__scanf__, 2, 0))) __wur; extern int __REDIRECT (vscanf, (const char *__restrict __format, _G_va_list __arg), __isoc99_vscanf) __attribute__ ((__format__ (__scanf__, 1, 0))) __wur; extern int __REDIRECT_NTH (vsscanf, (const char *__restrict __s, const char *__restrict __format, _G_va_list __arg), __isoc99_vsscanf) __attribute__ ((__format__ (__scanf__, 2, 0))); # else # 508 "/usr/include/stdio.h" 3 4 extern int __isoc99_vfscanf (FILE *__restrict __s, const char *__restrict __format, _G_va_list __arg) __wur; extern int __isoc99_vscanf (const char *__restrict __format, _G_va_list __arg) __wur; extern int __isoc99_vsscanf (const char *__restrict __s, const char *__restrict __format, _G_va_list __arg) __THROW; # define vfscanf __isoc99_vfscanf # define vscanf __isoc99_vscanf # define vsscanf __isoc99_vsscanf # endif # 520 "/usr/include/stdio.h" 3 4 # endif # 521 "/usr/include/stdio.h" 3 4 __END_NAMESPACE_C99 #endif /* Use ISO C9x. */ # 524 "/usr/include/stdio.h" 3 4 __BEGIN_NAMESPACE_STD /* Read a character from STREAM. These functions are possible cancellation points and therefore not marked with __THROW. */ extern int fgetc (FILE *__stream); extern int getc (FILE *__stream); /* Read a character from stdin. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int getchar (void); __END_NAMESPACE_STD /* The C standard explicitly says this is a macro, so we always do the optimization for it. */ #define getc(_fp) _IO_getc (_fp) #if defined __USE_POSIX || defined __USE_MISC /* These are defined in POSIX.1:1996. These functions are possible cancellation points and therefore not marked with __THROW. */ extern int getc_unlocked (FILE *__stream); extern int getchar_unlocked (void); #endif /* Use POSIX or MISC. */ # 553 "/usr/include/stdio.h" 3 4 #ifdef __USE_MISC /* Faster version when locking is not necessary. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int fgetc_unlocked (FILE *__stream); #endif /* Use MISC. */ # 563 "/usr/include/stdio.h" 3 4 __BEGIN_NAMESPACE_STD /* Write a character to STREAM. These functions are possible cancellation points and therefore not marked with __THROW. These functions is a possible cancellation point and therefore not marked with __THROW. */ extern int fputc (int __c, FILE *__stream); extern int putc (int __c, FILE *__stream); /* Write a character to stdout. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int putchar (int __c); __END_NAMESPACE_STD /* The C standard explicitly says this can be a macro, so we always do the optimization for it. */ #define putc(_ch, _fp) _IO_putc (_ch, _fp) #ifdef __USE_MISC /* Faster version when locking is not necessary. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int fputc_unlocked (int __c, FILE *__stream); #endif /* Use MISC. */ # 596 "/usr/include/stdio.h" 3 4 #if defined __USE_POSIX || defined __USE_MISC /* These are defined in POSIX.1:1996. These functions are possible cancellation points and therefore not marked with __THROW. */ extern int putc_unlocked (int __c, FILE *__stream); extern int putchar_unlocked (int __c); #endif /* Use POSIX or MISC. */ # 605 "/usr/include/stdio.h" 3 4 #if defined __USE_SVID || defined __USE_MISC \ || (defined __USE_XOPEN && !defined __USE_XOPEN2K) /* Get a word (int) from STREAM. */ extern int getw (FILE *__stream); /* Write a word (int) to STREAM. */ extern int putw (int __w, FILE *__stream); #endif # 615 "/usr/include/stdio.h" 3 4 __BEGIN_NAMESPACE_STD /* Get a newline-terminated string of finite length from STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream) __wur; #if !defined __USE_ISOC11 \ || (defined __cplusplus && __cplusplus <= 201103L) /* Get a newline-terminated string from stdin, removing the newline. DO NOT USE THIS FUNCTION!! There is no limit on how much it will read. The function has been officially removed in ISO C11. This opportunity is used to also remove it from the GNU feature list. It is now only available when explicitly using an old ISO C, Unix, or POSIX standard. GCC defines _GNU_SOURCE when building C++ code and the function is still in C++11, so it is also available for C++. This function is a possible cancellation point and therefore not marked with __THROW. */ extern char *gets (char *__s) __wur __attribute_deprecated__; #endif # 640 "/usr/include/stdio.h" 3 4 __END_NAMESPACE_STD #ifdef __USE_GNU /* This function does the same as `fgets' but does not lock the stream. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern char *fgets_unlocked (char *__restrict __s, int __n, FILE *__restrict __stream) __wur; #endif # 652 "/usr/include/stdio.h" 3 4 #ifdef __USE_XOPEN2K8 /* Read up to (and including) a DELIMITER from STREAM into *LINEPTR (and null-terminate it). *LINEPTR is a pointer returned from malloc (or NULL), pointing to *N characters of space. It is realloc'd as necessary. Returns the number of characters read (not including the null terminator), or -1 on error or EOF. These functions are not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation they are cancellation points and therefore not marked with __THROW. */ extern _IO_ssize_t __getdelim (char **__restrict __lineptr, size_t *__restrict __n, int __delimiter, FILE *__restrict __stream) __wur; extern _IO_ssize_t getdelim (char **__restrict __lineptr, size_t *__restrict __n, int __delimiter, FILE *__restrict __stream) __wur; /* Like `getdelim', but reads up to a newline. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern _IO_ssize_t getline (char **__restrict __lineptr, size_t *__restrict __n, FILE *__restrict __stream) __wur; #endif # 682 "/usr/include/stdio.h" 3 4 __BEGIN_NAMESPACE_STD /* Write a string to STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fputs (const char *__restrict __s, FILE *__restrict __stream); /* Write a string, followed by a newline, to stdout. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int puts (const char *__s); /* Push a character back onto the input buffer of STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int ungetc (int __c, FILE *__stream); /* Read chunks of generic data from STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern size_t fread (void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) __wur; /* Write chunks of generic data to STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern size_t fwrite (const void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __s); __END_NAMESPACE_STD #ifdef __USE_GNU /* This function does the same as `fputs' but does not lock the stream. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int fputs_unlocked (const char *__restrict __s, FILE *__restrict __stream); #endif # 729 "/usr/include/stdio.h" 3 4 #ifdef __USE_MISC /* Faster versions when locking is not necessary. These functions are not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation they are cancellation points and therefore not marked with __THROW. */ extern size_t fread_unlocked (void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) __wur; extern size_t fwrite_unlocked (const void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream); #endif # 742 "/usr/include/stdio.h" 3 4 __BEGIN_NAMESPACE_STD /* Seek to a certain position on STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fseek (FILE *__stream, long int __off, int __whence); /* Return the current position of STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern long int ftell (FILE *__stream) __wur; /* Rewind to the beginning of STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void rewind (FILE *__stream); __END_NAMESPACE_STD /* The Single Unix Specification, Version 2, specifies an alternative, more adequate interface for the two functions above which deal with file offset. `long int' is not the right type. These definitions are originally defined in the Large File Support API. */ #if defined __USE_LARGEFILE || defined __USE_XOPEN2K # ifndef __USE_FILE_OFFSET64 /* Seek to a certain position on STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fseeko (FILE *__stream, __off_t __off, int __whence); /* Return the current position of STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern __off_t ftello (FILE *__stream) __wur; # else # 780 "/usr/include/stdio.h" 3 4 # ifdef __REDIRECT extern int __REDIRECT (fseeko, (FILE *__stream, __off64_t __off, int __whence), fseeko64); extern __off64_t __REDIRECT (ftello, (FILE *__stream), ftello64); # else # 786 "/usr/include/stdio.h" 3 4 # define fseeko fseeko64 # define ftello ftello64 # endif # 789 "/usr/include/stdio.h" 3 4 # endif # 790 "/usr/include/stdio.h" 3 4 #endif # 791 "/usr/include/stdio.h" 3 4 __BEGIN_NAMESPACE_STD #ifndef __USE_FILE_OFFSET64 /* Get STREAM's position. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos); /* Set STREAM's position. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fsetpos (FILE *__stream, const fpos_t *__pos); #else # 805 "/usr/include/stdio.h" 3 4 # ifdef __REDIRECT extern int __REDIRECT (fgetpos, (FILE *__restrict __stream, fpos_t *__restrict __pos), fgetpos64); extern int __REDIRECT (fsetpos, (FILE *__stream, const fpos_t *__pos), fsetpos64); # else # 811 "/usr/include/stdio.h" 3 4 # define fgetpos fgetpos64 # define fsetpos fsetpos64 # endif # 814 "/usr/include/stdio.h" 3 4 #endif # 815 "/usr/include/stdio.h" 3 4 __END_NAMESPACE_STD #ifdef __USE_LARGEFILE64 extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence); extern __off64_t ftello64 (FILE *__stream) __wur; extern int fgetpos64 (FILE *__restrict __stream, fpos64_t *__restrict __pos); extern int fsetpos64 (FILE *__stream, const fpos64_t *__pos); #endif # 823 "/usr/include/stdio.h" 3 4 __BEGIN_NAMESPACE_STD /* Clear the error and EOF indicators for STREAM. */ extern void clearerr (FILE *__stream) __THROW; /* Return the EOF indicator for STREAM. */ extern int feof (FILE *__stream) __THROW __wur; /* Return the error indicator for STREAM. */ extern int ferror (FILE *__stream) __THROW __wur; __END_NAMESPACE_STD #ifdef __USE_MISC /* Faster versions when locking is not required. */ extern void clearerr_unlocked (FILE *__stream) __THROW; extern int feof_unlocked (FILE *__stream) __THROW __wur; extern int ferror_unlocked (FILE *__stream) __THROW __wur; #endif # 839 "/usr/include/stdio.h" 3 4 __BEGIN_NAMESPACE_STD /* Print a message describing the meaning of the value of errno. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void perror (const char *__s); __END_NAMESPACE_STD /* Provide the declarations for `sys_errlist' and `sys_nerr' if they are available on this system. Even if available, these variables should not be used directly. The `strerror' function provides all the necessary functionality. */ #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 853 "/usr/include/stdio.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/sys_errlist.h" 1 3 4 /* Declare sys_errlist and sys_nerr, or don't. Compatibility (do) version. Copyright (C) 2002-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _STDIO_H # error "Never include directly; use instead." #endif # 22 "/usr/include/x86_64-linux-gnu/bits/sys_errlist.h" 3 4 /* sys_errlist and sys_nerr are deprecated. Use strerror instead. */ #ifdef __USE_BSD extern int sys_nerr; extern const char *const sys_errlist[]; #endif # 29 "/usr/include/x86_64-linux-gnu/bits/sys_errlist.h" 3 4 #ifdef __USE_GNU extern int _sys_nerr; extern const char *const _sys_errlist[]; #endif # 33 "/usr/include/x86_64-linux-gnu/bits/sys_errlist.h" 3 4 # 854 "/usr/include/stdio.h" 2 3 4 #ifdef __USE_POSIX /* Return the system file descriptor for STREAM. */ extern int fileno (FILE *__stream) __THROW __wur; #endif /* Use POSIX. */ # 860 "/usr/include/stdio.h" 3 4 #ifdef __USE_MISC /* Faster version when locking is not required. */ extern int fileno_unlocked (FILE *__stream) __THROW __wur; #endif # 865 "/usr/include/stdio.h" 3 4 #if (defined __USE_POSIX2 || defined __USE_SVID || defined __USE_BSD || \ defined __USE_MISC) /* Create a new stream connected to a pipe running the given command. This function is a possible cancellation point and therefore not marked with __THROW. */ extern FILE *popen (const char *__command, const char *__modes) __wur; /* Close a stream opened by popen and return the status of its child. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int pclose (FILE *__stream); #endif # 881 "/usr/include/stdio.h" 3 4 #ifdef __USE_POSIX /* Return the name of the controlling terminal. */ extern char *ctermid (char *__s) __THROW; #endif /* Use POSIX. */ # 887 "/usr/include/stdio.h" 3 4 #ifdef __USE_XOPEN /* Return the name of the current user. */ extern char *cuserid (char *__s); #endif /* Use X/Open, but not issue 6. */ # 893 "/usr/include/stdio.h" 3 4 #ifdef __USE_GNU struct obstack; /* See . */ /* Write formatted output to an obstack. */ extern int obstack_printf (struct obstack *__restrict __obstack, const char *__restrict __format, ...) __THROWNL __attribute__ ((__format__ (__printf__, 2, 3))); extern int obstack_vprintf (struct obstack *__restrict __obstack, const char *__restrict __format, _G_va_list __args) __THROWNL __attribute__ ((__format__ (__printf__, 2, 0))); #endif /* Use GNU. */ # 907 "/usr/include/stdio.h" 3 4 #if defined __USE_POSIX || defined __USE_MISC /* These are defined in POSIX.1:1996. */ /* Acquire ownership of STREAM. */ extern void flockfile (FILE *__stream) __THROW; /* Try to acquire ownership of STREAM but do not block if it is not possible. */ extern int ftrylockfile (FILE *__stream) __THROW __wur; /* Relinquish the ownership granted for STREAM. */ extern void funlockfile (FILE *__stream) __THROW; #endif /* POSIX || misc */ # 922 "/usr/include/stdio.h" 3 4 #if defined __USE_XOPEN && !defined __USE_XOPEN2K && !defined __USE_GNU /* The X/Open standard requires some functions and variables to be declared here which do not belong into this header. But we have to follow. In GNU mode we don't do this nonsense. */ # define __need_getopt #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 928 "/usr/include/stdio.h" 3 4 # 929 "/usr/include/stdio.h" 3 4 #endif /* X/Open, but not issue 6 and not for GNU. */ # 930 "/usr/include/stdio.h" 3 4 /* If we are compiling with optimizing read this file. It contains several optimizing inline functions and macros. */ #ifdef __USE_EXTERN_INLINES #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 934 "/usr/include/stdio.h" 3 4 # 935 "/usr/include/stdio.h" 3 4 #endif # 936 "/usr/include/stdio.h" 3 4 #if __USE_FORTIFY_LEVEL > 0 && defined __extern_always_inline #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 937 "/usr/include/stdio.h" 3 4 # 938 "/usr/include/stdio.h" 3 4 #endif # 939 "/usr/include/stdio.h" 3 4 #ifdef __LDBL_COMPAT #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 940 "/usr/include/stdio.h" 3 4 # 941 "/usr/include/stdio.h" 3 4 #endif # 942 "/usr/include/stdio.h" 3 4 __END_DECLS #endif /* included. */ # 946 "/usr/include/stdio.h" 3 4 #endif /* !_STDIO_H */ # 948 "/usr/include/stdio.h" 3 4 # 3 "test2.cpp" 2 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 3 "test2.cpp" # 1 "/usr/include/stdlib.h" 1 3 4 /* Copyright (C) 1991-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard: 7.20 General utilities */ #ifndef _STDLIB_H #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 24 "/usr/include/stdlib.h" 3 4 # 25 "/usr/include/stdlib.h" 3 4 /* Get size_t, wchar_t and NULL from . */ #define __need_size_t #ifndef __need_malloc_and_calloc # define __need_wchar_t # define __need_NULL #endif # 32 "/usr/include/stdlib.h" 3 4 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 32 "/usr/include/stdlib.h" 3 4 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 1 3 4 /*===---- stddef.h - Basic type definitions --------------------------------=== * * Copyright (c) 2008 Eli Friedman * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #if !defined(__STDDEF_H) || defined(__need_ptrdiff_t) || \ defined(__need_size_t) || defined(__need_wchar_t) || \ defined(__need_NULL) || defined(__need_wint_t) #if !defined(__need_ptrdiff_t) && !defined(__need_size_t) && \ !defined(__need_wchar_t) && !defined(__need_NULL) && \ !defined(__need_wint_t) /* Always define miscellaneous pieces when modules are available. */ #if !__has_feature(modules) #define __STDDEF_H #endif # 37 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #define __need_ptrdiff_t #define __need_size_t #define __need_wchar_t #define __need_NULL #define __need_STDDEF_H_misc /* __need_wint_t is intentionally not defined here. */ #endif # 44 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_ptrdiff_t) #if !defined(_PTRDIFF_T) || __has_feature(modules) /* Always define ptrdiff_t when modules are available. */ #if !__has_feature(modules) #define _PTRDIFF_T #endif # 51 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 typedef __PTRDIFF_TYPE__ ptrdiff_t; #endif # 53 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #undef __need_ptrdiff_t #endif /* defined(__need_ptrdiff_t) */ # 55 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_size_t) #if !defined(_SIZE_T) || __has_feature(modules) /* Always define size_t when modules are available. */ #if !__has_feature(modules) #define _SIZE_T #endif # 62 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 typedef __SIZE_TYPE__ size_t; #endif # 64 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #undef __need_size_t #endif /*defined(__need_size_t) */ # 66 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_STDDEF_H_misc) /* ISO9899:2011 7.20 (C11 Annex K): Define rsize_t if __STDC_WANT_LIB_EXT1__ is * enabled. */ #if (defined(__STDC_WANT_LIB_EXT1__) && __STDC_WANT_LIB_EXT1__ >= 1 && \ !defined(_RSIZE_T)) || __has_feature(modules) /* Always define rsize_t when modules are available. */ #if !__has_feature(modules) #define _RSIZE_T #endif # 76 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 typedef __SIZE_TYPE__ rsize_t; #endif # 78 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif /* defined(__need_STDDEF_H_misc) */ # 79 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_wchar_t) #ifndef __cplusplus /* Always define wchar_t when modules are available. */ #if !defined(_WCHAR_T) || __has_feature(modules) #if !__has_feature(modules) #define _WCHAR_T #if defined(_MSC_EXTENSIONS) #define _WCHAR_T_DEFINED #endif # 89 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif # 90 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 typedef __WCHAR_TYPE__ wchar_t; #endif # 92 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif # 93 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #undef __need_wchar_t #endif /* defined(__need_wchar_t) */ # 95 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_NULL) #undef NULL #ifdef __cplusplus # if !defined(__MINGW32__) && !defined(_MSC_VER) # define NULL __null # else # 102 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 # define NULL 0 # endif # 104 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #else # 105 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 # define NULL ((void*)0) #endif # 107 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #ifdef __cplusplus #if defined(_MSC_EXTENSIONS) && defined(_NATIVE_NULLPTR_SUPPORTED) namespace std { typedef decltype(nullptr) nullptr_t; } using ::std::nullptr_t; #endif # 112 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif # 113 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #undef __need_NULL #endif /* defined(__need_NULL) */ # 115 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_STDDEF_H_misc) #if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L #if 0 /* expanded by -frewrite-includes */ #include "__stddef_max_align_t.h" #endif /* expanded by -frewrite-includes */ # 118 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 # 119 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif # 120 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #define offsetof(t, d) __builtin_offsetof(t, d) #undef __need_STDDEF_H_misc #endif /* defined(__need_STDDEF_H_misc) */ # 123 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 /* Some C libraries expect to see a wint_t here. Others (notably MinGW) will use __WINT_TYPE__ directly; accommodate both by requiring __need_wint_t */ #if defined(__need_wint_t) /* Always define wint_t when modules are available. */ #if !defined(_WINT_T) || __has_feature(modules) #if !__has_feature(modules) #define _WINT_T #endif # 132 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 typedef __WINT_TYPE__ wint_t; #endif # 134 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #undef __need_wint_t #endif /* __need_wint_t */ # 136 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif # 138 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 # 33 "/usr/include/stdlib.h" 2 3 4 __BEGIN_DECLS #ifndef __need_malloc_and_calloc #define _STDLIB_H 1 #if (defined __USE_XOPEN || defined __USE_XOPEN2K8) && !defined _SYS_WAIT_H /* XPG requires a few symbols from being defined. */ #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 41 "/usr/include/stdlib.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/waitflags.h" 1 3 4 /* Definitions of flag bits for `waitpid' et al. Copyright (C) 1992-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #if !defined _SYS_WAIT_H && !defined _STDLIB_H # error "Never include directly; use instead." #endif # 22 "/usr/include/x86_64-linux-gnu/bits/waitflags.h" 3 4 /* Bits in the third argument to `waitpid'. */ #define WNOHANG 1 /* Don't block waiting. */ #define WUNTRACED 2 /* Report status of stopped children. */ /* Bits in the fourth argument to `waitid'. */ #define WSTOPPED 2 /* Report stopped child (same as WUNTRACED). */ #define WEXITED 4 /* Report dead child. */ #define WCONTINUED 8 /* Report continued child. */ #define WNOWAIT 0x01000000 /* Don't reap, just poll status. */ #define __WNOTHREAD 0x20000000 /* Don't wait on children of other threads in this group */ #define __WALL 0x40000000 /* Wait for any child. */ #define __WCLONE 0x80000000 /* Wait for cloned process. */ /* The following values are used by the `waitid' function. */ #if defined __USE_SVID || defined __USE_XOPEN || defined __USE_XOPEN2K8 # ifndef __ENUM_IDTYPE_T # define __ENUM_IDTYPE_T 1 /* The Linux kernel defines these bare, rather than an enum, which causes a conflict if the include order is reversed. */ # undef P_ALL # undef P_PID # undef P_PGID typedef enum { P_ALL, /* Wait for any child. */ P_PID, /* Wait for specified process. */ P_PGID /* Wait for members of process group. */ } idtype_t; # endif # 57 "/usr/include/x86_64-linux-gnu/bits/waitflags.h" 3 4 #endif # 58 "/usr/include/x86_64-linux-gnu/bits/waitflags.h" 3 4 # 42 "/usr/include/stdlib.h" 2 3 4 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 42 "/usr/include/stdlib.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/waitstatus.h" 1 3 4 /* Definitions of status bits for `wait' et al. Copyright (C) 1992-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #if !defined _SYS_WAIT_H && !defined _STDLIB_H # error "Never include directly; use instead." #endif # 22 "/usr/include/x86_64-linux-gnu/bits/waitstatus.h" 3 4 /* Everything extant so far uses these same bits. */ /* If WIFEXITED(STATUS), the low-order 8 bits of the status. */ #define __WEXITSTATUS(status) (((status) & 0xff00) >> 8) /* If WIFSIGNALED(STATUS), the terminating signal. */ #define __WTERMSIG(status) ((status) & 0x7f) /* If WIFSTOPPED(STATUS), the signal that stopped the child. */ #define __WSTOPSIG(status) __WEXITSTATUS(status) /* Nonzero if STATUS indicates normal termination. */ #define __WIFEXITED(status) (__WTERMSIG(status) == 0) /* Nonzero if STATUS indicates termination by a signal. */ #define __WIFSIGNALED(status) \ (((signed char) (((status) & 0x7f) + 1) >> 1) > 0) /* Nonzero if STATUS indicates the child is stopped. */ #define __WIFSTOPPED(status) (((status) & 0xff) == 0x7f) /* Nonzero if STATUS indicates the child continued after a stop. We only define this if provides the WCONTINUED flag bit. */ #ifdef WCONTINUED # define __WIFCONTINUED(status) ((status) == __W_CONTINUED) #endif # 51 "/usr/include/x86_64-linux-gnu/bits/waitstatus.h" 3 4 /* Nonzero if STATUS indicates the child dumped core. */ #define __WCOREDUMP(status) ((status) & __WCOREFLAG) /* Macros for constructing status values. */ #define __W_EXITCODE(ret, sig) ((ret) << 8 | (sig)) #define __W_STOPCODE(sig) ((sig) << 8 | 0x7f) #define __W_CONTINUED 0xffff #define __WCOREFLAG 0x80 #ifdef __USE_BSD #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 64 "/usr/include/x86_64-linux-gnu/bits/waitstatus.h" 3 4 # 1 "/usr/include/endian.h" 1 3 4 /* Copyright (C) 1992-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _ENDIAN_H #define _ENDIAN_H 1 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 21 "/usr/include/endian.h" 3 4 # 22 "/usr/include/endian.h" 3 4 /* Definitions for byte order, according to significance of bytes, from low addresses to high addresses. The value is what you get by putting '4' in the most significant byte, '3' in the second most significant byte, '2' in the second least significant byte, and '1' in the least significant byte, and then writing down one digit for each byte, starting with the byte at the lowest address at the left, and proceeding to the byte with the highest address at the right. */ #define __LITTLE_ENDIAN 1234 #define __BIG_ENDIAN 4321 #define __PDP_ENDIAN 3412 /* This file defines `__BYTE_ORDER' for the particular machine. */ #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 36 "/usr/include/endian.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/endian.h" 1 3 4 /* i386/x86_64 are little-endian. */ #ifndef _ENDIAN_H # error "Never use directly; include instead." #endif # 6 "/usr/include/x86_64-linux-gnu/bits/endian.h" 3 4 #define __BYTE_ORDER __LITTLE_ENDIAN # 37 "/usr/include/endian.h" 2 3 4 /* Some machines may need to use a different endianness for floating point values. */ #ifndef __FLOAT_WORD_ORDER # define __FLOAT_WORD_ORDER __BYTE_ORDER #endif # 43 "/usr/include/endian.h" 3 4 #ifdef __USE_BSD # define LITTLE_ENDIAN __LITTLE_ENDIAN # define BIG_ENDIAN __BIG_ENDIAN # define PDP_ENDIAN __PDP_ENDIAN # define BYTE_ORDER __BYTE_ORDER #endif # 50 "/usr/include/endian.h" 3 4 #if __BYTE_ORDER == __LITTLE_ENDIAN # define __LONG_LONG_PAIR(HI, LO) LO, HI #elif __BYTE_ORDER == __BIG_ENDIAN # 54 "/usr/include/endian.h" 3 4 # define __LONG_LONG_PAIR(HI, LO) HI, LO #endif # 56 "/usr/include/endian.h" 3 4 #if defined __USE_BSD && !defined __ASSEMBLER__ /* Conversion interfaces. */ #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 60 "/usr/include/endian.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 1 3 4 /* Macros to swap the order of bytes in integer values. Copyright (C) 1997-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #if !defined _BYTESWAP_H && !defined _NETINET_IN_H && !defined _ENDIAN_H # error "Never use directly; include instead." #endif # 22 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4 #ifndef _BITS_BYTESWAP_H #define _BITS_BYTESWAP_H 1 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 26 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4 # 27 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 27 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4 # 28 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 28 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4 /* Determine the wordsize from the preprocessor defines. */ #if defined __x86_64__ && !defined __ILP32__ # define __WORDSIZE 64 #else # 6 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 3 4 # define __WORDSIZE 32 #endif # 8 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 3 4 #ifdef __x86_64__ # define __WORDSIZE_TIME64_COMPAT32 1 /* Both x86-64 and x32 use the 64-bit system call interface. */ # define __SYSCALL_WORDSIZE 64 #endif # 14 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 3 4 # 29 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 2 3 4 /* Swap bytes in 16 bit value. */ #define __bswap_constant_16(x) \ ((unsigned short int) ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8))) /* Get __bswap_16. */ #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 35 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/byteswap-16.h" 1 3 4 /* Macros to swap the order of bytes in 16-bit integer values. Copyright (C) 2012-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _BITS_BYTESWAP_H # error "Never use directly; include instead." #endif # 22 "/usr/include/x86_64-linux-gnu/bits/byteswap-16.h" 3 4 #ifdef __GNUC__ # if __GNUC__ >= 2 # define __bswap_16(x) \ (__extension__ \ ({ unsigned short int __v, __x = (unsigned short int) (x); \ if (__builtin_constant_p (__x)) \ __v = __bswap_constant_16 (__x); \ else \ __asm__ ("rorw $8, %w0" \ : "=r" (__v) \ : "0" (__x) \ : "cc"); \ __v; })) # else # 37 "/usr/include/x86_64-linux-gnu/bits/byteswap-16.h" 3 4 /* This is better than nothing. */ # define __bswap_16(x) \ (__extension__ \ ({ unsigned short int __x = (unsigned short int) (x); \ __bswap_constant_16 (__x); })) # endif # 43 "/usr/include/x86_64-linux-gnu/bits/byteswap-16.h" 3 4 #else # 44 "/usr/include/x86_64-linux-gnu/bits/byteswap-16.h" 3 4 static __inline unsigned short int __bswap_16 (unsigned short int __bsx) { return __bswap_constant_16 (__bsx); } #endif # 50 "/usr/include/x86_64-linux-gnu/bits/byteswap-16.h" 3 4 # 36 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 2 3 4 /* Swap bytes in 32 bit value. */ #define __bswap_constant_32(x) \ ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) | \ (((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24)) #ifdef __GNUC__ # if __GNUC_PREREQ (4, 3) static __inline unsigned int __bswap_32 (unsigned int __bsx) { return __builtin_bswap32 (__bsx); } # elif __GNUC__ >= 2 # 50 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4 # if __WORDSIZE == 64 || (defined __i486__ || defined __pentium__ \ || defined __pentiumpro__ || defined __pentium4__ \ || defined __k8__ || defined __athlon__ \ || defined __k6__ || defined __nocona__ \ || defined __core2__ || defined __geode__ \ || defined __amdfam10__) /* To swap the bytes in a word the i486 processors and up provide the `bswap' opcode. On i386 we have to use three instructions. */ # define __bswap_32(x) \ (__extension__ \ ({ unsigned int __v, __x = (x); \ if (__builtin_constant_p (__x)) \ __v = __bswap_constant_32 (__x); \ else \ __asm__ ("bswap %0" : "=r" (__v) : "0" (__x)); \ __v; })) # else # 67 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4 # define __bswap_32(x) \ (__extension__ \ ({ unsigned int __v, __x = (x); \ if (__builtin_constant_p (__x)) \ __v = __bswap_constant_32 (__x); \ else \ __asm__ ("rorw $8, %w0;" \ "rorl $16, %0;" \ "rorw $8, %w0" \ : "=r" (__v) \ : "0" (__x) \ : "cc"); \ __v; })) # endif # 81 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4 # else # 82 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4 # define __bswap_32(x) \ (__extension__ \ ({ unsigned int __x = (x); __bswap_constant_32 (__x); })) # endif # 86 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4 #else # 87 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4 static __inline unsigned int __bswap_32 (unsigned int __bsx) { return __bswap_constant_32 (__bsx); } #endif # 93 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4 #if __GNUC_PREREQ (2, 0) /* Swap bytes in 64 bit value. */ # define __bswap_constant_64(x) \ (__extension__ ((((x) & 0xff00000000000000ull) >> 56) \ | (((x) & 0x00ff000000000000ull) >> 40) \ | (((x) & 0x0000ff0000000000ull) >> 24) \ | (((x) & 0x000000ff00000000ull) >> 8) \ | (((x) & 0x00000000ff000000ull) << 8) \ | (((x) & 0x0000000000ff0000ull) << 24) \ | (((x) & 0x000000000000ff00ull) << 40) \ | (((x) & 0x00000000000000ffull) << 56))) # if __GNUC_PREREQ (4, 3) static __inline __uint64_t __bswap_64 (__uint64_t __bsx) { return __builtin_bswap64 (__bsx); } # elif __WORDSIZE == 64 # 114 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4 # define __bswap_64(x) \ (__extension__ \ ({ __uint64_t __v, __x = (x); \ if (__builtin_constant_p (__x)) \ __v = __bswap_constant_64 (__x); \ else \ __asm__ ("bswap %q0" : "=r" (__v) : "0" (__x)); \ __v; })) # else # 123 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4 # define __bswap_64(x) \ (__extension__ \ ({ union { __extension__ __uint64_t __ll; \ unsigned int __l[2]; } __w, __r; \ if (__builtin_constant_p (x)) \ __r.__ll = __bswap_constant_64 (x); \ else \ { \ __w.__ll = (x); \ __r.__l[0] = __bswap_32 (__w.__l[1]); \ __r.__l[1] = __bswap_32 (__w.__l[0]); \ } \ __r.__ll; })) # endif # 137 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4 #else # 138 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4 # define __bswap_constant_64(x) \ ((((x) & 0xff00000000000000ull) >> 56) \ | (((x) & 0x00ff000000000000ull) >> 40) \ | (((x) & 0x0000ff0000000000ull) >> 24) \ | (((x) & 0x000000ff00000000ull) >> 8) \ | (((x) & 0x00000000ff000000ull) << 8) \ | (((x) & 0x0000000000ff0000ull) << 24) \ | (((x) & 0x000000000000ff00ull) << 40) \ | (((x) & 0x00000000000000ffull) << 56)) static __inline __uint64_t __bswap_64 (__uint64_t __bsx) { return __bswap_constant_64 (__bsx); } #endif # 154 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4 #endif /* _BITS_BYTESWAP_H */ # 156 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4 # 61 "/usr/include/endian.h" 2 3 4 # if __BYTE_ORDER == __LITTLE_ENDIAN # define htobe16(x) __bswap_16 (x) # define htole16(x) (x) # define be16toh(x) __bswap_16 (x) # define le16toh(x) (x) # define htobe32(x) __bswap_32 (x) # define htole32(x) (x) # define be32toh(x) __bswap_32 (x) # define le32toh(x) (x) # define htobe64(x) __bswap_64 (x) # define htole64(x) (x) # define be64toh(x) __bswap_64 (x) # define le64toh(x) (x) # else # 79 "/usr/include/endian.h" 3 4 # define htobe16(x) (x) # define htole16(x) __bswap_16 (x) # define be16toh(x) (x) # define le16toh(x) __bswap_16 (x) # define htobe32(x) (x) # define htole32(x) __bswap_32 (x) # define be32toh(x) (x) # define le32toh(x) __bswap_32 (x) # define htobe64(x) (x) # define htole64(x) __bswap_64 (x) # define be64toh(x) (x) # define le64toh(x) __bswap_64 (x) # endif # 94 "/usr/include/endian.h" 3 4 #endif # 95 "/usr/include/endian.h" 3 4 #endif /* endian.h */ # 97 "/usr/include/endian.h" 3 4 # 65 "/usr/include/x86_64-linux-gnu/bits/waitstatus.h" 2 3 4 union wait { int w_status; struct { # if __BYTE_ORDER == __LITTLE_ENDIAN unsigned int __w_termsig:7; /* Terminating signal. */ unsigned int __w_coredump:1; /* Set if dumped core. */ unsigned int __w_retcode:8; /* Return code if exited normally. */ unsigned int:16; # endif /* Little endian. */ # 77 "/usr/include/x86_64-linux-gnu/bits/waitstatus.h" 3 4 # if __BYTE_ORDER == __BIG_ENDIAN unsigned int:16; unsigned int __w_retcode:8; unsigned int __w_coredump:1; unsigned int __w_termsig:7; # endif /* Big endian. */ # 83 "/usr/include/x86_64-linux-gnu/bits/waitstatus.h" 3 4 } __wait_terminated; struct { # if __BYTE_ORDER == __LITTLE_ENDIAN unsigned int __w_stopval:8; /* W_STOPPED if stopped. */ unsigned int __w_stopsig:8; /* Stopping signal. */ unsigned int:16; # endif /* Little endian. */ # 91 "/usr/include/x86_64-linux-gnu/bits/waitstatus.h" 3 4 # if __BYTE_ORDER == __BIG_ENDIAN unsigned int:16; unsigned int __w_stopsig:8; /* Stopping signal. */ unsigned int __w_stopval:8; /* W_STOPPED if stopped. */ # endif /* Big endian. */ # 96 "/usr/include/x86_64-linux-gnu/bits/waitstatus.h" 3 4 } __wait_stopped; }; # define w_termsig __wait_terminated.__w_termsig # define w_coredump __wait_terminated.__w_coredump # define w_retcode __wait_terminated.__w_retcode # define w_stopsig __wait_stopped.__w_stopsig # define w_stopval __wait_stopped.__w_stopval #endif /* Use BSD. */ # 106 "/usr/include/x86_64-linux-gnu/bits/waitstatus.h" 3 4 # 43 "/usr/include/stdlib.h" 2 3 4 # ifdef __USE_BSD /* Lots of hair to allow traditional BSD use of `union wait' as well as POSIX.1 use of `int' for the status word. */ # if defined __GNUC__ && !defined __cplusplus # define __WAIT_INT(status) \ (__extension__ (((union { __typeof(status) __in; int __i; }) \ { .__in = (status) }).__i)) # else # 54 "/usr/include/stdlib.h" 3 4 # define __WAIT_INT(status) (*(int *) &(status)) # endif # 56 "/usr/include/stdlib.h" 3 4 /* This is the type of the argument to `wait'. The funky union causes redeclarations with either `int *' or `union wait *' to be allowed without complaint. __WAIT_STATUS_DEFN is the type used in the actual function definitions. */ # if !defined __GNUC__ || __GNUC__ < 2 || defined __cplusplus # define __WAIT_STATUS void * # define __WAIT_STATUS_DEFN void * # else # 66 "/usr/include/stdlib.h" 3 4 /* This works in GCC 2.6.1 and later. */ typedef union { union wait *__uptr; int *__iptr; } __WAIT_STATUS __attribute__ ((__transparent_union__)); # define __WAIT_STATUS_DEFN int * # endif # 74 "/usr/include/stdlib.h" 3 4 # else /* Don't use BSD. */ # 76 "/usr/include/stdlib.h" 3 4 # define __WAIT_INT(status) (status) # define __WAIT_STATUS int * # define __WAIT_STATUS_DEFN int * # endif /* Use BSD. */ # 82 "/usr/include/stdlib.h" 3 4 /* Define the macros also would define this way. */ # define WEXITSTATUS(status) __WEXITSTATUS (__WAIT_INT (status)) # define WTERMSIG(status) __WTERMSIG (__WAIT_INT (status)) # define WSTOPSIG(status) __WSTOPSIG (__WAIT_INT (status)) # define WIFEXITED(status) __WIFEXITED (__WAIT_INT (status)) # define WIFSIGNALED(status) __WIFSIGNALED (__WAIT_INT (status)) # define WIFSTOPPED(status) __WIFSTOPPED (__WAIT_INT (status)) # ifdef __WIFCONTINUED # define WIFCONTINUED(status) __WIFCONTINUED (__WAIT_INT (status)) # endif # 93 "/usr/include/stdlib.h" 3 4 #endif /* X/Open or XPG7 and not included. */ # 94 "/usr/include/stdlib.h" 3 4 __BEGIN_NAMESPACE_STD /* Returned by `div'. */ typedef struct { int quot; /* Quotient. */ int rem; /* Remainder. */ } div_t; /* Returned by `ldiv'. */ #ifndef __ldiv_t_defined typedef struct { long int quot; /* Quotient. */ long int rem; /* Remainder. */ } ldiv_t; # define __ldiv_t_defined 1 #endif # 112 "/usr/include/stdlib.h" 3 4 __END_NAMESPACE_STD #if defined __USE_ISOC99 && !defined __lldiv_t_defined __BEGIN_NAMESPACE_C99 /* Returned by `lldiv'. */ __extension__ typedef struct { long long int quot; /* Quotient. */ long long int rem; /* Remainder. */ } lldiv_t; # define __lldiv_t_defined 1 __END_NAMESPACE_C99 #endif # 125 "/usr/include/stdlib.h" 3 4 /* The largest number rand will return (same as INT_MAX). */ #define RAND_MAX 2147483647 /* We define these the same for all machines. Changes from this to the outside world should be done in `_exit'. */ #define EXIT_FAILURE 1 /* Failing exit status. */ #define EXIT_SUCCESS 0 /* Successful exit status. */ /* Maximum length of a multibyte character in the current locale. */ #define MB_CUR_MAX (__ctype_get_mb_cur_max ()) extern size_t __ctype_get_mb_cur_max (void) __THROW __wur; __BEGIN_NAMESPACE_STD /* Convert a string to a floating-point number. */ extern double atof (const char *__nptr) __THROW __attribute_pure__ __nonnull ((1)) __wur; /* Convert a string to an integer. */ extern int atoi (const char *__nptr) __THROW __attribute_pure__ __nonnull ((1)) __wur; /* Convert a string to a long integer. */ extern long int atol (const char *__nptr) __THROW __attribute_pure__ __nonnull ((1)) __wur; __END_NAMESPACE_STD #if defined __USE_ISOC99 || defined __USE_MISC __BEGIN_NAMESPACE_C99 /* Convert a string to a long long integer. */ __extension__ extern long long int atoll (const char *__nptr) __THROW __attribute_pure__ __nonnull ((1)) __wur; __END_NAMESPACE_C99 #endif # 161 "/usr/include/stdlib.h" 3 4 __BEGIN_NAMESPACE_STD /* Convert a string to a floating-point number. */ extern double strtod (const char *__restrict __nptr, char **__restrict __endptr) __THROW __nonnull ((1)); __END_NAMESPACE_STD #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Likewise for `float' and `long double' sizes of floating-point numbers. */ extern float strtof (const char *__restrict __nptr, char **__restrict __endptr) __THROW __nonnull ((1)); extern long double strtold (const char *__restrict __nptr, char **__restrict __endptr) __THROW __nonnull ((1)); __END_NAMESPACE_C99 #endif # 180 "/usr/include/stdlib.h" 3 4 __BEGIN_NAMESPACE_STD /* Convert a string to a long integer. */ extern long int strtol (const char *__restrict __nptr, char **__restrict __endptr, int __base) __THROW __nonnull ((1)); /* Convert a string to an unsigned long integer. */ extern unsigned long int strtoul (const char *__restrict __nptr, char **__restrict __endptr, int __base) __THROW __nonnull ((1)); __END_NAMESPACE_STD #ifdef __USE_BSD /* Convert a string to a quadword integer. */ __extension__ extern long long int strtoq (const char *__restrict __nptr, char **__restrict __endptr, int __base) __THROW __nonnull ((1)); /* Convert a string to an unsigned quadword integer. */ __extension__ extern unsigned long long int strtouq (const char *__restrict __nptr, char **__restrict __endptr, int __base) __THROW __nonnull ((1)); #endif /* Use BSD. */ # 204 "/usr/include/stdlib.h" 3 4 #if defined __USE_ISOC99 || defined __USE_MISC __BEGIN_NAMESPACE_C99 /* Convert a string to a quadword integer. */ __extension__ extern long long int strtoll (const char *__restrict __nptr, char **__restrict __endptr, int __base) __THROW __nonnull ((1)); /* Convert a string to an unsigned quadword integer. */ __extension__ extern unsigned long long int strtoull (const char *__restrict __nptr, char **__restrict __endptr, int __base) __THROW __nonnull ((1)); __END_NAMESPACE_C99 #endif /* ISO C99 or use MISC. */ # 219 "/usr/include/stdlib.h" 3 4 #ifdef __USE_GNU /* The concept of one static locale per category is not very well thought out. Many applications will need to process its data using information from several different locales. Another problem is the implementation of the internationalization handling in the ISO C++ standard library. To support this another set of the functions using locale data exist which take an additional argument. Attention: even though several *_l interfaces are part of POSIX:2008, these are not. */ /* Structure for reentrant locale using functions. This is an (almost) opaque type for the user level programs. */ #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 235 "/usr/include/stdlib.h" 3 4 # 1 "/usr/include/xlocale.h" 1 3 4 /* Definition of locale datatype. Copyright (C) 1997-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1997. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _XLOCALE_H #define _XLOCALE_H 1 /* Structure for reentrant locale using functions. This is an (almost) opaque type for the user level programs. The file and this data structure is not standardized. Don't rely on it. It can go away without warning. */ typedef struct __locale_struct { /* Note: LC_ALL is not a valid index into this array. */ struct __locale_data *__locales[13]; /* 13 = __LC_LAST. */ /* To increase the speed of this solution we add some special members. */ const unsigned short int *__ctype_b; const int *__ctype_tolower; const int *__ctype_toupper; /* Note: LC_ALL is not a valid index into this array. */ const char *__names[13]; } *__locale_t; /* POSIX 2008 makes locale_t official. */ typedef __locale_t locale_t; #endif /* xlocale.h */ # 45 "/usr/include/xlocale.h" 3 4 # 236 "/usr/include/stdlib.h" 2 3 4 /* Special versions of the functions above which take the locale to use as an additional parameter. */ extern long int strtol_l (const char *__restrict __nptr, char **__restrict __endptr, int __base, __locale_t __loc) __THROW __nonnull ((1, 4)); extern unsigned long int strtoul_l (const char *__restrict __nptr, char **__restrict __endptr, int __base, __locale_t __loc) __THROW __nonnull ((1, 4)); __extension__ extern long long int strtoll_l (const char *__restrict __nptr, char **__restrict __endptr, int __base, __locale_t __loc) __THROW __nonnull ((1, 4)); __extension__ extern unsigned long long int strtoull_l (const char *__restrict __nptr, char **__restrict __endptr, int __base, __locale_t __loc) __THROW __nonnull ((1, 4)); extern double strtod_l (const char *__restrict __nptr, char **__restrict __endptr, __locale_t __loc) __THROW __nonnull ((1, 3)); extern float strtof_l (const char *__restrict __nptr, char **__restrict __endptr, __locale_t __loc) __THROW __nonnull ((1, 3)); extern long double strtold_l (const char *__restrict __nptr, char **__restrict __endptr, __locale_t __loc) __THROW __nonnull ((1, 3)); #endif /* GNU */ # 273 "/usr/include/stdlib.h" 3 4 #ifdef __USE_EXTERN_INLINES __BEGIN_NAMESPACE_STD __extern_inline int __NTH (atoi (const char *__nptr)) { return (int) strtol (__nptr, (char **) NULL, 10); } __extern_inline long int __NTH (atol (const char *__nptr)) { return strtol (__nptr, (char **) NULL, 10); } __END_NAMESPACE_STD # if defined __USE_MISC || defined __USE_ISOC99 __BEGIN_NAMESPACE_C99 __extension__ __extern_inline long long int __NTH (atoll (const char *__nptr)) { return strtoll (__nptr, (char **) NULL, 10); } __END_NAMESPACE_C99 # endif # 298 "/usr/include/stdlib.h" 3 4 #endif /* Optimizing and Inlining. */ # 299 "/usr/include/stdlib.h" 3 4 #if defined __USE_SVID || defined __USE_XOPEN_EXTENDED /* Convert N to base 64 using the digits "./0-9A-Za-z", least-significant digit first. Returns a pointer to static storage overwritten by the next call. */ extern char *l64a (long int __n) __THROW __wur; /* Read a number from a string S in base 64 as above. */ extern long int a64l (const char *__s) __THROW __attribute_pure__ __nonnull ((1)) __wur; #endif /* Use SVID || extended X/Open. */ # 312 "/usr/include/stdlib.h" 3 4 #if defined __USE_SVID || defined __USE_XOPEN_EXTENDED || defined __USE_BSD #if 0 /* expanded by -frewrite-includes */ # include /* we need int32_t... */ #endif /* expanded by -frewrite-includes */ # 314 "/usr/include/stdlib.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/sys/types.h" 1 3 4 /* Copyright (C) 1991-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * POSIX Standard: 2.6 Primitive System Data Types */ #ifndef _SYS_TYPES_H #define _SYS_TYPES_H 1 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 25 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 # 26 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 __BEGIN_DECLS #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 29 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 # 30 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 #ifdef __USE_BSD # ifndef __u_char_defined typedef __u_char u_char; typedef __u_short u_short; typedef __u_int u_int; typedef __u_long u_long; typedef __quad_t quad_t; typedef __u_quad_t u_quad_t; typedef __fsid_t fsid_t; # define __u_char_defined # endif # 42 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 #endif # 43 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 typedef __loff_t loff_t; #ifndef __ino_t_defined # ifndef __USE_FILE_OFFSET64 typedef __ino_t ino_t; # else # 50 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 typedef __ino64_t ino_t; # endif # 52 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 # define __ino_t_defined #endif # 54 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 #if defined __USE_LARGEFILE64 && !defined __ino64_t_defined typedef __ino64_t ino64_t; # define __ino64_t_defined #endif # 58 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 #ifndef __dev_t_defined typedef __dev_t dev_t; # define __dev_t_defined #endif # 63 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 #ifndef __gid_t_defined typedef __gid_t gid_t; # define __gid_t_defined #endif # 68 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 #ifndef __mode_t_defined typedef __mode_t mode_t; # define __mode_t_defined #endif # 73 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 #ifndef __nlink_t_defined typedef __nlink_t nlink_t; # define __nlink_t_defined #endif # 78 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 #ifndef __uid_t_defined typedef __uid_t uid_t; # define __uid_t_defined #endif # 83 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 #ifndef __off_t_defined # ifndef __USE_FILE_OFFSET64 typedef __off_t off_t; # else # 88 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 typedef __off64_t off_t; # endif # 90 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 # define __off_t_defined #endif # 92 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 #if defined __USE_LARGEFILE64 && !defined __off64_t_defined typedef __off64_t off64_t; # define __off64_t_defined #endif # 96 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 #ifndef __pid_t_defined typedef __pid_t pid_t; # define __pid_t_defined #endif # 101 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 #if (defined __USE_SVID || defined __USE_XOPEN || defined __USE_XOPEN2K8) \ && !defined __id_t_defined typedef __id_t id_t; # define __id_t_defined #endif # 107 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 #ifndef __ssize_t_defined typedef __ssize_t ssize_t; # define __ssize_t_defined #endif # 112 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 #ifdef __USE_BSD # ifndef __daddr_t_defined typedef __daddr_t daddr_t; typedef __caddr_t caddr_t; # define __daddr_t_defined # endif # 119 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 #endif # 120 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 #if (defined __USE_SVID || defined __USE_XOPEN) && !defined __key_t_defined typedef __key_t key_t; # define __key_t_defined #endif # 125 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 #if defined __USE_XOPEN || defined __USE_XOPEN2K8 # define __need_clock_t #endif # 129 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 #define __need_time_t #define __need_timer_t #define __need_clockid_t #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 132 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 # 1 "/usr/include/time.h" 1 3 4 /* Copyright (C) 1991-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard: 7.23 Date and time */ #ifndef _TIME_H #if (! defined __need_time_t && !defined __need_clock_t && \ ! defined __need_timespec) # define _TIME_H 1 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 27 "/usr/include/time.h" 3 4 # 28 "/usr/include/time.h" 3 4 __BEGIN_DECLS #endif # 32 "/usr/include/time.h" 3 4 #ifdef _TIME_H /* Get size_t and NULL from . */ # define __need_size_t # define __need_NULL #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 37 "/usr/include/time.h" 3 4 # 38 "/usr/include/time.h" 3 4 /* This defines CLOCKS_PER_SEC, which is the number of processor clock ticks per second. */ #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 41 "/usr/include/time.h" 3 4 # 42 "/usr/include/time.h" 3 4 /* This is the obsolete POSIX.1-1988 name for the same constant. */ # if !defined __STRICT_ANSI__ && !defined __USE_XOPEN2K # ifndef CLK_TCK # define CLK_TCK CLOCKS_PER_SEC # endif # 48 "/usr/include/time.h" 3 4 # endif # 49 "/usr/include/time.h" 3 4 #endif /* included. */ # 51 "/usr/include/time.h" 3 4 #if !defined __clock_t_defined && (defined _TIME_H || defined __need_clock_t) # define __clock_t_defined 1 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 55 "/usr/include/time.h" 3 4 # 56 "/usr/include/time.h" 3 4 __BEGIN_NAMESPACE_STD /* Returned by `clock'. */ typedef __clock_t clock_t; __END_NAMESPACE_STD #if defined __USE_XOPEN || defined __USE_POSIX || defined __USE_MISC __USING_NAMESPACE_STD(clock_t) #endif # 64 "/usr/include/time.h" 3 4 #endif /* clock_t not defined and or need clock_t. */ # 66 "/usr/include/time.h" 3 4 #undef __need_clock_t #if !defined __time_t_defined && (defined _TIME_H || defined __need_time_t) # define __time_t_defined 1 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 71 "/usr/include/time.h" 3 4 # 72 "/usr/include/time.h" 3 4 __BEGIN_NAMESPACE_STD /* Returned by `time'. */ typedef __time_t time_t; __END_NAMESPACE_STD #if defined __USE_POSIX || defined __USE_MISC || defined __USE_SVID __USING_NAMESPACE_STD(time_t) #endif # 80 "/usr/include/time.h" 3 4 #endif /* time_t not defined and or need time_t. */ # 82 "/usr/include/time.h" 3 4 #undef __need_time_t #if !defined __clockid_t_defined && \ ((defined _TIME_H && defined __USE_POSIX199309) || defined __need_clockid_t) # define __clockid_t_defined 1 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 88 "/usr/include/time.h" 3 4 # 89 "/usr/include/time.h" 3 4 /* Clock ID used in clock and timer functions. */ typedef __clockid_t clockid_t; #endif /* clockid_t not defined and or need clockid_t. */ # 94 "/usr/include/time.h" 3 4 #undef __clockid_time_t #if !defined __timer_t_defined && \ ((defined _TIME_H && defined __USE_POSIX199309) || defined __need_timer_t) # define __timer_t_defined 1 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 100 "/usr/include/time.h" 3 4 # 101 "/usr/include/time.h" 3 4 /* Timer ID returned by `timer_create'. */ typedef __timer_t timer_t; #endif /* timer_t not defined and or need timer_t. */ # 106 "/usr/include/time.h" 3 4 #undef __need_timer_t #if (!defined __timespec_defined \ && ((defined _TIME_H \ && (defined __USE_POSIX199309 || defined __USE_MISC \ || defined __USE_ISOC11)) \ || defined __need_timespec)) # define __timespec_defined 1 #if 0 /* expanded by -frewrite-includes */ # include /* This defines __time_t for us. */ #endif /* expanded by -frewrite-includes */ # 116 "/usr/include/time.h" 3 4 # 117 "/usr/include/time.h" 3 4 /* POSIX.1b structure for a time value. This is like a `struct timeval' but has nanoseconds instead of microseconds. */ struct timespec { __time_t tv_sec; /* Seconds. */ __syscall_slong_t tv_nsec; /* Nanoseconds. */ }; #endif /* timespec not defined and or need timespec. */ # 127 "/usr/include/time.h" 3 4 #undef __need_timespec #ifdef _TIME_H __BEGIN_NAMESPACE_STD /* Used by other time functions. */ struct tm { int tm_sec; /* Seconds. [0-60] (1 leap second) */ int tm_min; /* Minutes. [0-59] */ int tm_hour; /* Hours. [0-23] */ int tm_mday; /* Day. [1-31] */ int tm_mon; /* Month. [0-11] */ int tm_year; /* Year - 1900. */ int tm_wday; /* Day of week. [0-6] */ int tm_yday; /* Days in year.[0-365] */ int tm_isdst; /* DST. [-1/0/1]*/ # ifdef __USE_BSD long int tm_gmtoff; /* Seconds east of UTC. */ const char *tm_zone; /* Timezone abbreviation. */ # else # 149 "/usr/include/time.h" 3 4 long int __tm_gmtoff; /* Seconds east of UTC. */ const char *__tm_zone; /* Timezone abbreviation. */ # endif # 152 "/usr/include/time.h" 3 4 }; __END_NAMESPACE_STD #if defined __USE_XOPEN || defined __USE_POSIX || defined __USE_MISC __USING_NAMESPACE_STD(tm) #endif # 157 "/usr/include/time.h" 3 4 # ifdef __USE_POSIX199309 /* POSIX.1b structure for timer start values and intervals. */ struct itimerspec { struct timespec it_interval; struct timespec it_value; }; /* We can use a simple forward declaration. */ struct sigevent; # endif /* POSIX.1b */ # 171 "/usr/include/time.h" 3 4 # ifdef __USE_XOPEN2K # ifndef __pid_t_defined typedef __pid_t pid_t; # define __pid_t_defined # endif # 177 "/usr/include/time.h" 3 4 # endif # 178 "/usr/include/time.h" 3 4 # ifdef __USE_ISOC11 /* Time base values for timespec_get. */ # define TIME_UTC 1 # endif # 184 "/usr/include/time.h" 3 4 __BEGIN_NAMESPACE_STD /* Time used by the program so far (user time + system time). The result / CLOCKS_PER_SECOND is program time in seconds. */ extern clock_t clock (void) __THROW; /* Return the current time and put it in *TIMER if TIMER is not NULL. */ extern time_t time (time_t *__timer) __THROW; /* Return the difference between TIME1 and TIME0. */ extern double difftime (time_t __time1, time_t __time0) __THROW __attribute__ ((__const__)); /* Return the `time_t' representation of TP and normalize TP. */ extern time_t mktime (struct tm *__tp) __THROW; /* Format TP into S according to FORMAT. Write no more than MAXSIZE characters and return the number of characters written, or 0 if it would exceed MAXSIZE. */ extern size_t strftime (char *__restrict __s, size_t __maxsize, const char *__restrict __format, const struct tm *__restrict __tp) __THROW; __END_NAMESPACE_STD # ifdef __USE_XOPEN /* Parse S according to FORMAT and store binary time information in TP. The return value is a pointer to the first unparsed character in S. */ extern char *strptime (const char *__restrict __s, const char *__restrict __fmt, struct tm *__tp) __THROW; # endif # 217 "/usr/include/time.h" 3 4 # ifdef __USE_XOPEN2K8 /* Similar to the two functions above but take the information from the provided locale and not the global locale. */ #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 221 "/usr/include/time.h" 3 4 # 222 "/usr/include/time.h" 3 4 extern size_t strftime_l (char *__restrict __s, size_t __maxsize, const char *__restrict __format, const struct tm *__restrict __tp, __locale_t __loc) __THROW; # endif # 228 "/usr/include/time.h" 3 4 # ifdef __USE_GNU extern char *strptime_l (const char *__restrict __s, const char *__restrict __fmt, struct tm *__tp, __locale_t __loc) __THROW; # endif # 234 "/usr/include/time.h" 3 4 __BEGIN_NAMESPACE_STD /* Return the `struct tm' representation of *TIMER in Universal Coordinated Time (aka Greenwich Mean Time). */ extern struct tm *gmtime (const time_t *__timer) __THROW; /* Return the `struct tm' representation of *TIMER in the local timezone. */ extern struct tm *localtime (const time_t *__timer) __THROW; __END_NAMESPACE_STD # if defined __USE_POSIX || defined __USE_MISC /* Return the `struct tm' representation of *TIMER in UTC, using *TP to store the result. */ extern struct tm *gmtime_r (const time_t *__restrict __timer, struct tm *__restrict __tp) __THROW; /* Return the `struct tm' representation of *TIMER in local time, using *TP to store the result. */ extern struct tm *localtime_r (const time_t *__restrict __timer, struct tm *__restrict __tp) __THROW; # endif /* POSIX or misc */ # 257 "/usr/include/time.h" 3 4 __BEGIN_NAMESPACE_STD /* Return a string of the form "Day Mon dd hh:mm:ss yyyy\n" that is the representation of TP in this format. */ extern char *asctime (const struct tm *__tp) __THROW; /* Equivalent to `asctime (localtime (timer))'. */ extern char *ctime (const time_t *__timer) __THROW; __END_NAMESPACE_STD # if defined __USE_POSIX || defined __USE_MISC /* Reentrant versions of the above functions. */ /* Return in BUF a string of the form "Day Mon dd hh:mm:ss yyyy\n" that is the representation of TP in this format. */ extern char *asctime_r (const struct tm *__restrict __tp, char *__restrict __buf) __THROW; /* Equivalent to `asctime_r (localtime_r (timer, *TMP*), buf)'. */ extern char *ctime_r (const time_t *__restrict __timer, char *__restrict __buf) __THROW; # endif /* POSIX or misc */ # 279 "/usr/include/time.h" 3 4 /* Defined in localtime.c. */ extern char *__tzname[2]; /* Current timezone names. */ extern int __daylight; /* If daylight-saving time is ever in use. */ extern long int __timezone; /* Seconds west of UTC. */ # ifdef __USE_POSIX /* Same as above. */ extern char *tzname[2]; /* Set time conversion information from the TZ environment variable. If TZ is not defined, a locale-dependent default is used. */ extern void tzset (void) __THROW; # endif # 295 "/usr/include/time.h" 3 4 # if defined __USE_SVID || defined __USE_XOPEN extern int daylight; extern long int timezone; # endif # 300 "/usr/include/time.h" 3 4 # ifdef __USE_SVID /* Set the system time to *WHEN. This call is restricted to the superuser. */ extern int stime (const time_t *__when) __THROW; # endif # 306 "/usr/include/time.h" 3 4 /* Nonzero if YEAR is a leap year (every 4 years, except every 100th isn't, and every 400th is). */ # define __isleap(year) \ ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0)) # ifdef __USE_MISC /* Miscellaneous functions many Unices inherited from the public domain localtime package. These are included only for compatibility. */ /* Like `mktime', but for TP represents Universal Time, not local time. */ extern time_t timegm (struct tm *__tp) __THROW; /* Another name for `mktime'. */ extern time_t timelocal (struct tm *__tp) __THROW; /* Return the number of days in YEAR. */ extern int dysize (int __year) __THROW __attribute__ ((__const__)); # endif # 327 "/usr/include/time.h" 3 4 # ifdef __USE_POSIX199309 /* Pause execution for a number of nanoseconds. This function is a cancellation point and therefore not marked with __THROW. */ extern int nanosleep (const struct timespec *__requested_time, struct timespec *__remaining); /* Get resolution of clock CLOCK_ID. */ extern int clock_getres (clockid_t __clock_id, struct timespec *__res) __THROW; /* Get current value of clock CLOCK_ID and store it in TP. */ extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) __THROW; /* Set clock CLOCK_ID to value TP. */ extern int clock_settime (clockid_t __clock_id, const struct timespec *__tp) __THROW; # ifdef __USE_XOPEN2K /* High-resolution sleep with the specified clock. This function is a cancellation point and therefore not marked with __THROW. */ extern int clock_nanosleep (clockid_t __clock_id, int __flags, const struct timespec *__req, struct timespec *__rem); /* Return clock ID for CPU-time clock. */ extern int clock_getcpuclockid (pid_t __pid, clockid_t *__clock_id) __THROW; # endif # 360 "/usr/include/time.h" 3 4 /* Create new per-process timer using CLOCK_ID. */ extern int timer_create (clockid_t __clock_id, struct sigevent *__restrict __evp, timer_t *__restrict __timerid) __THROW; /* Delete timer TIMERID. */ extern int timer_delete (timer_t __timerid) __THROW; /* Set timer TIMERID to VALUE, returning old value in OVALUE. */ extern int timer_settime (timer_t __timerid, int __flags, const struct itimerspec *__restrict __value, struct itimerspec *__restrict __ovalue) __THROW; /* Get current value of timer TIMERID and store it in VALUE. */ extern int timer_gettime (timer_t __timerid, struct itimerspec *__value) __THROW; /* Get expiration overrun for timer TIMERID. */ extern int timer_getoverrun (timer_t __timerid) __THROW; # endif # 382 "/usr/include/time.h" 3 4 # ifdef __USE_ISOC11 /* Set TS to calendar time based in time base BASE. */ extern int timespec_get (struct timespec *__ts, int __base) __THROW __nonnull ((1)); # endif # 389 "/usr/include/time.h" 3 4 # ifdef __USE_XOPEN_EXTENDED /* Set to one of the following values to indicate an error. 1 the DATEMSK environment variable is null or undefined, 2 the template file cannot be opened for reading, 3 failed to get file status information, 4 the template file is not a regular file, 5 an error is encountered while reading the template file, 6 memory allication failed (not enough memory available), 7 there is no line in the template that matches the input, 8 invalid input specification Example: February 31 or a time is specified that can not be represented in a time_t (representing the time in seconds since 00:00:00 UTC, January 1, 1970) */ extern int getdate_err; /* Parse the given string as a date specification and return a value representing the value. The templates from the file identified by the environment variable DATEMSK are used. In case of an error `getdate_err' is set. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct tm *getdate (const char *__string); # endif # 414 "/usr/include/time.h" 3 4 # ifdef __USE_GNU /* Since `getdate' is not reentrant because of the use of `getdate_err' and the static buffer to return the result in, we provide a thread-safe variant. The functionality is the same. The result is returned in the buffer pointed to by RESBUFP and in case of an error the return value is != 0 with the same values as given above for `getdate_err'. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int getdate_r (const char *__restrict __string, struct tm *__restrict __resbufp); # endif # 429 "/usr/include/time.h" 3 4 __END_DECLS #endif /* included. */ # 433 "/usr/include/time.h" 3 4 #endif /* not already included. */ # 435 "/usr/include/time.h" 3 4 # 133 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4 #ifdef __USE_XOPEN # ifndef __useconds_t_defined typedef __useconds_t useconds_t; # define __useconds_t_defined # endif # 139 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 # ifndef __suseconds_t_defined typedef __suseconds_t suseconds_t; # define __suseconds_t_defined # endif # 143 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 #endif # 144 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 #define __need_size_t #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 146 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 1 3 4 /*===---- stddef.h - Basic type definitions --------------------------------=== * * Copyright (c) 2008 Eli Friedman * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #if !defined(__STDDEF_H) || defined(__need_ptrdiff_t) || \ defined(__need_size_t) || defined(__need_wchar_t) || \ defined(__need_NULL) || defined(__need_wint_t) #if !defined(__need_ptrdiff_t) && !defined(__need_size_t) && \ !defined(__need_wchar_t) && !defined(__need_NULL) && \ !defined(__need_wint_t) /* Always define miscellaneous pieces when modules are available. */ #if !__has_feature(modules) #define __STDDEF_H #endif # 37 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #define __need_ptrdiff_t #define __need_size_t #define __need_wchar_t #define __need_NULL #define __need_STDDEF_H_misc /* __need_wint_t is intentionally not defined here. */ #endif # 44 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_ptrdiff_t) #if !defined(_PTRDIFF_T) || __has_feature(modules) /* Always define ptrdiff_t when modules are available. */ #if !__has_feature(modules) #define _PTRDIFF_T #endif # 51 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 typedef __PTRDIFF_TYPE__ ptrdiff_t; #endif # 53 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #undef __need_ptrdiff_t #endif /* defined(__need_ptrdiff_t) */ # 55 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_size_t) #if !defined(_SIZE_T) || __has_feature(modules) /* Always define size_t when modules are available. */ #if !__has_feature(modules) #define _SIZE_T #endif # 62 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 typedef __SIZE_TYPE__ size_t; #endif # 64 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #undef __need_size_t #endif /*defined(__need_size_t) */ # 66 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_STDDEF_H_misc) /* ISO9899:2011 7.20 (C11 Annex K): Define rsize_t if __STDC_WANT_LIB_EXT1__ is * enabled. */ #if (defined(__STDC_WANT_LIB_EXT1__) && __STDC_WANT_LIB_EXT1__ >= 1 && \ !defined(_RSIZE_T)) || __has_feature(modules) /* Always define rsize_t when modules are available. */ #if !__has_feature(modules) #define _RSIZE_T #endif # 76 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 typedef __SIZE_TYPE__ rsize_t; #endif # 78 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif /* defined(__need_STDDEF_H_misc) */ # 79 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_wchar_t) #ifndef __cplusplus /* Always define wchar_t when modules are available. */ #if !defined(_WCHAR_T) || __has_feature(modules) #if !__has_feature(modules) #define _WCHAR_T #if defined(_MSC_EXTENSIONS) #define _WCHAR_T_DEFINED #endif # 89 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif # 90 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 typedef __WCHAR_TYPE__ wchar_t; #endif # 92 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif # 93 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #undef __need_wchar_t #endif /* defined(__need_wchar_t) */ # 95 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_NULL) #undef NULL #ifdef __cplusplus # if !defined(__MINGW32__) && !defined(_MSC_VER) # define NULL __null # else # 102 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 # define NULL 0 # endif # 104 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #else # 105 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 # define NULL ((void*)0) #endif # 107 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #ifdef __cplusplus #if defined(_MSC_EXTENSIONS) && defined(_NATIVE_NULLPTR_SUPPORTED) namespace std { typedef decltype(nullptr) nullptr_t; } using ::std::nullptr_t; #endif # 112 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif # 113 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #undef __need_NULL #endif /* defined(__need_NULL) */ # 115 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_STDDEF_H_misc) #if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L #if 0 /* expanded by -frewrite-includes */ #include "__stddef_max_align_t.h" #endif /* expanded by -frewrite-includes */ # 118 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 # 119 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif # 120 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #define offsetof(t, d) __builtin_offsetof(t, d) #undef __need_STDDEF_H_misc #endif /* defined(__need_STDDEF_H_misc) */ # 123 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 /* Some C libraries expect to see a wint_t here. Others (notably MinGW) will use __WINT_TYPE__ directly; accommodate both by requiring __need_wint_t */ #if defined(__need_wint_t) /* Always define wint_t when modules are available. */ #if !defined(_WINT_T) || __has_feature(modules) #if !__has_feature(modules) #define _WINT_T #endif # 132 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 typedef __WINT_TYPE__ wint_t; #endif # 134 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #undef __need_wint_t #endif /* __need_wint_t */ # 136 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif # 138 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 # 147 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4 #ifdef __USE_MISC /* Old compatibility names for C types. */ typedef unsigned long int ulong; typedef unsigned short int ushort; typedef unsigned int uint; #endif # 154 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 /* These size-specific names are used by some of the inet code. */ #if !__GNUC_PREREQ (2, 7) /* These types are defined by the ISO C99 header . */ # ifndef __int8_t_defined # define __int8_t_defined typedef char int8_t; typedef short int int16_t; typedef int int32_t; # if __WORDSIZE == 64 typedef long int int64_t; # else # 168 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 __extension__ typedef long long int int64_t; # endif # 170 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 # endif # 171 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 /* But these were defined by ISO C without the first `_'. */ typedef unsigned char u_int8_t; typedef unsigned short int u_int16_t; typedef unsigned int u_int32_t; # if __WORDSIZE == 64 typedef unsigned long int u_int64_t; # else # 179 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 __extension__ typedef unsigned long long int u_int64_t; # endif # 181 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 typedef int register_t; #else # 185 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 /* For GCC 2.7 and later, we can use specific type-size attributes. */ # define __intN_t(N, MODE) \ typedef int int##N##_t __attribute__ ((__mode__ (MODE))) # define __u_intN_t(N, MODE) \ typedef unsigned int u_int##N##_t __attribute__ ((__mode__ (MODE))) # ifndef __int8_t_defined # define __int8_t_defined __intN_t (8, __QI__); __intN_t (16, __HI__); __intN_t (32, __SI__); __intN_t (64, __DI__); # endif # 199 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 __u_intN_t (8, __QI__); __u_intN_t (16, __HI__); __u_intN_t (32, __SI__); __u_intN_t (64, __DI__); typedef int register_t __attribute__ ((__mode__ (__word__))); /* Some code from BIND tests this macro to see if the types above are defined. */ #endif # 211 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 #define __BIT_TYPES_DEFINED__ 1 #ifdef __USE_BSD /* In BSD is expected to define BYTE_ORDER. */ #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 216 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 # 217 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 /* It also defines `fd_set' and the FD_* macros for `select'. */ #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 219 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/sys/select.h" 1 3 4 /* `fd_set' type and related macros, and `select'/`pselect' declarations. Copyright (C) 1996-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* POSIX 1003.1g: 6.2 Select from File Descriptor Sets */ #ifndef _SYS_SELECT_H #define _SYS_SELECT_H 1 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 24 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4 # 25 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4 /* Get definition of needed basic types. */ #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 27 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4 # 28 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4 /* Get __FD_* definitions. */ #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 30 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/select.h" 1 3 4 /* Copyright (C) 1997-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_SELECT_H # error "Never use directly; include instead." #endif # 21 "/usr/include/x86_64-linux-gnu/bits/select.h" 3 4 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 22 "/usr/include/x86_64-linux-gnu/bits/select.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4 /* Determine the wordsize from the preprocessor defines. */ #if defined __x86_64__ && !defined __ILP32__ # define __WORDSIZE 64 #else # 6 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 3 4 # define __WORDSIZE 32 #endif # 8 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 3 4 #ifdef __x86_64__ # define __WORDSIZE_TIME64_COMPAT32 1 /* Both x86-64 and x32 use the 64-bit system call interface. */ # define __SYSCALL_WORDSIZE 64 #endif # 14 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 3 4 # 23 "/usr/include/x86_64-linux-gnu/bits/select.h" 2 3 4 #if defined __GNUC__ && __GNUC__ >= 2 # if __WORDSIZE == 64 # define __FD_ZERO_STOS "stosq" # else # 30 "/usr/include/x86_64-linux-gnu/bits/select.h" 3 4 # define __FD_ZERO_STOS "stosl" # endif # 32 "/usr/include/x86_64-linux-gnu/bits/select.h" 3 4 # define __FD_ZERO(fdsp) \ do { \ int __d0, __d1; \ __asm__ __volatile__ ("cld; rep; " __FD_ZERO_STOS \ : "=c" (__d0), "=D" (__d1) \ : "a" (0), "0" (sizeof (fd_set) \ / sizeof (__fd_mask)), \ "1" (&__FDS_BITS (fdsp)[0]) \ : "memory"); \ } while (0) #else /* ! GNU CC */ # 45 "/usr/include/x86_64-linux-gnu/bits/select.h" 3 4 /* We don't use `memset' because this would require a prototype and the array isn't too big. */ # define __FD_ZERO(set) \ do { \ unsigned int __i; \ fd_set *__arr = (set); \ for (__i = 0; __i < sizeof (fd_set) / sizeof (__fd_mask); ++__i) \ __FDS_BITS (__arr)[__i] = 0; \ } while (0) #endif /* GNU CC */ # 57 "/usr/include/x86_64-linux-gnu/bits/select.h" 3 4 #define __FD_SET(d, set) \ ((void) (__FDS_BITS (set)[__FD_ELT (d)] |= __FD_MASK (d))) #define __FD_CLR(d, set) \ ((void) (__FDS_BITS (set)[__FD_ELT (d)] &= ~__FD_MASK (d))) #define __FD_ISSET(d, set) \ ((__FDS_BITS (set)[__FD_ELT (d)] & __FD_MASK (d)) != 0) # 31 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4 /* Get __sigset_t. */ #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 33 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/sigset.h" 1 3 4 /* __sig_atomic_t, __sigset_t, and related definitions. Linux version. Copyright (C) 1991-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SIGSET_H_types # define _SIGSET_H_types 1 typedef int __sig_atomic_t; /* A `sigset_t' has a bit for each signal. */ # define _SIGSET_NWORDS (1024 / (8 * sizeof (unsigned long int))) typedef struct { unsigned long int __val[_SIGSET_NWORDS]; } __sigset_t; #endif # 33 "/usr/include/x86_64-linux-gnu/bits/sigset.h" 3 4 /* We only want to define these functions if was actually included; otherwise we were included just to define the types. Since we are namespace-clean, it wouldn't hurt to define extra macros. But trouble can be caused by functions being defined (e.g., any global register vars declared later will cause compilation errors). */ #if !defined _SIGSET_H_fns && defined _SIGNAL_H # define _SIGSET_H_fns 1 # ifndef _EXTERN_INLINE # define _EXTERN_INLINE __extern_inline # endif # 47 "/usr/include/x86_64-linux-gnu/bits/sigset.h" 3 4 /* Return a mask that includes the bit for SIG only. */ # define __sigmask(sig) \ (((unsigned long int) 1) << (((sig) - 1) % (8 * sizeof (unsigned long int)))) /* Return the word index for SIG. */ # define __sigword(sig) (((sig) - 1) / (8 * sizeof (unsigned long int))) # if defined __GNUC__ && __GNUC__ >= 2 # define __sigemptyset(set) \ (__extension__ ({ int __cnt = _SIGSET_NWORDS; \ sigset_t *__set = (set); \ while (--__cnt >= 0) __set->__val[__cnt] = 0; \ 0; })) # define __sigfillset(set) \ (__extension__ ({ int __cnt = _SIGSET_NWORDS; \ sigset_t *__set = (set); \ while (--__cnt >= 0) __set->__val[__cnt] = ~0UL; \ 0; })) # ifdef __USE_GNU /* The POSIX does not specify for handling the whole signal set in one command. This is often wanted and so we define three more functions here. */ # define __sigisemptyset(set) \ (__extension__ ({ int __cnt = _SIGSET_NWORDS; \ const sigset_t *__set = (set); \ int __ret = __set->__val[--__cnt]; \ while (!__ret && --__cnt >= 0) \ __ret = __set->__val[__cnt]; \ __ret == 0; })) # define __sigandset(dest, left, right) \ (__extension__ ({ int __cnt = _SIGSET_NWORDS; \ sigset_t *__dest = (dest); \ const sigset_t *__left = (left); \ const sigset_t *__right = (right); \ while (--__cnt >= 0) \ __dest->__val[__cnt] = (__left->__val[__cnt] \ & __right->__val[__cnt]); \ 0; })) # define __sigorset(dest, left, right) \ (__extension__ ({ int __cnt = _SIGSET_NWORDS; \ sigset_t *__dest = (dest); \ const sigset_t *__left = (left); \ const sigset_t *__right = (right); \ while (--__cnt >= 0) \ __dest->__val[__cnt] = (__left->__val[__cnt] \ | __right->__val[__cnt]); \ 0; })) # endif # 97 "/usr/include/x86_64-linux-gnu/bits/sigset.h" 3 4 # endif # 98 "/usr/include/x86_64-linux-gnu/bits/sigset.h" 3 4 /* These functions needn't check for a bogus signal number -- error checking is done in the non __ versions. */ extern int __sigismember (const __sigset_t *, int); extern int __sigaddset (__sigset_t *, int); extern int __sigdelset (__sigset_t *, int); # ifdef __USE_EXTERN_INLINES # define __SIGSETFN(NAME, BODY, CONST) \ _EXTERN_INLINE int \ NAME (CONST __sigset_t *__set, int __sig) \ { \ unsigned long int __mask = __sigmask (__sig); \ unsigned long int __word = __sigword (__sig); \ return BODY; \ } __SIGSETFN (__sigismember, (__set->__val[__word] & __mask) ? 1 : 0, const) __SIGSETFN (__sigaddset, ((__set->__val[__word] |= __mask), 0), ) __SIGSETFN (__sigdelset, ((__set->__val[__word] &= ~__mask), 0), ) # undef __SIGSETFN # endif # 122 "/usr/include/x86_64-linux-gnu/bits/sigset.h" 3 4 #endif /* ! _SIGSET_H_fns. */ # 125 "/usr/include/x86_64-linux-gnu/bits/sigset.h" 3 4 # 34 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4 #ifndef __sigset_t_defined # define __sigset_t_defined typedef __sigset_t sigset_t; #endif # 39 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4 /* Get definition of timer specification structures. */ #define __need_time_t #define __need_timespec #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 43 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4 # 1 "/usr/include/time.h" 1 3 4 /* Copyright (C) 1991-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard: 7.23 Date and time */ #ifndef _TIME_H #if (! defined __need_time_t && !defined __need_clock_t && \ ! defined __need_timespec) # define _TIME_H 1 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 27 "/usr/include/time.h" 3 4 # 28 "/usr/include/time.h" 3 4 __BEGIN_DECLS #endif # 32 "/usr/include/time.h" 3 4 #ifdef _TIME_H /* Get size_t and NULL from . */ # define __need_size_t # define __need_NULL #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 37 "/usr/include/time.h" 3 4 # 38 "/usr/include/time.h" 3 4 /* This defines CLOCKS_PER_SEC, which is the number of processor clock ticks per second. */ #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 41 "/usr/include/time.h" 3 4 # 42 "/usr/include/time.h" 3 4 /* This is the obsolete POSIX.1-1988 name for the same constant. */ # if !defined __STRICT_ANSI__ && !defined __USE_XOPEN2K # ifndef CLK_TCK # define CLK_TCK CLOCKS_PER_SEC # endif # 48 "/usr/include/time.h" 3 4 # endif # 49 "/usr/include/time.h" 3 4 #endif /* included. */ # 51 "/usr/include/time.h" 3 4 #if !defined __clock_t_defined && (defined _TIME_H || defined __need_clock_t) # define __clock_t_defined 1 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 55 "/usr/include/time.h" 3 4 # 56 "/usr/include/time.h" 3 4 __BEGIN_NAMESPACE_STD /* Returned by `clock'. */ typedef __clock_t clock_t; __END_NAMESPACE_STD #if defined __USE_XOPEN || defined __USE_POSIX || defined __USE_MISC __USING_NAMESPACE_STD(clock_t) #endif # 64 "/usr/include/time.h" 3 4 #endif /* clock_t not defined and or need clock_t. */ # 66 "/usr/include/time.h" 3 4 #undef __need_clock_t #if !defined __time_t_defined && (defined _TIME_H || defined __need_time_t) # define __time_t_defined 1 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 71 "/usr/include/time.h" 3 4 # 72 "/usr/include/time.h" 3 4 __BEGIN_NAMESPACE_STD /* Returned by `time'. */ typedef __time_t time_t; __END_NAMESPACE_STD #if defined __USE_POSIX || defined __USE_MISC || defined __USE_SVID __USING_NAMESPACE_STD(time_t) #endif # 80 "/usr/include/time.h" 3 4 #endif /* time_t not defined and or need time_t. */ # 82 "/usr/include/time.h" 3 4 #undef __need_time_t #if !defined __clockid_t_defined && \ ((defined _TIME_H && defined __USE_POSIX199309) || defined __need_clockid_t) # define __clockid_t_defined 1 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 88 "/usr/include/time.h" 3 4 # 89 "/usr/include/time.h" 3 4 /* Clock ID used in clock and timer functions. */ typedef __clockid_t clockid_t; #endif /* clockid_t not defined and or need clockid_t. */ # 94 "/usr/include/time.h" 3 4 #undef __clockid_time_t #if !defined __timer_t_defined && \ ((defined _TIME_H && defined __USE_POSIX199309) || defined __need_timer_t) # define __timer_t_defined 1 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 100 "/usr/include/time.h" 3 4 # 101 "/usr/include/time.h" 3 4 /* Timer ID returned by `timer_create'. */ typedef __timer_t timer_t; #endif /* timer_t not defined and or need timer_t. */ # 106 "/usr/include/time.h" 3 4 #undef __need_timer_t #if (!defined __timespec_defined \ && ((defined _TIME_H \ && (defined __USE_POSIX199309 || defined __USE_MISC \ || defined __USE_ISOC11)) \ || defined __need_timespec)) # define __timespec_defined 1 #if 0 /* expanded by -frewrite-includes */ # include /* This defines __time_t for us. */ #endif /* expanded by -frewrite-includes */ # 116 "/usr/include/time.h" 3 4 # 117 "/usr/include/time.h" 3 4 /* POSIX.1b structure for a time value. This is like a `struct timeval' but has nanoseconds instead of microseconds. */ struct timespec { __time_t tv_sec; /* Seconds. */ __syscall_slong_t tv_nsec; /* Nanoseconds. */ }; #endif /* timespec not defined and or need timespec. */ # 127 "/usr/include/time.h" 3 4 #undef __need_timespec #ifdef _TIME_H __BEGIN_NAMESPACE_STD /* Used by other time functions. */ struct tm { int tm_sec; /* Seconds. [0-60] (1 leap second) */ int tm_min; /* Minutes. [0-59] */ int tm_hour; /* Hours. [0-23] */ int tm_mday; /* Day. [1-31] */ int tm_mon; /* Month. [0-11] */ int tm_year; /* Year - 1900. */ int tm_wday; /* Day of week. [0-6] */ int tm_yday; /* Days in year.[0-365] */ int tm_isdst; /* DST. [-1/0/1]*/ # ifdef __USE_BSD long int tm_gmtoff; /* Seconds east of UTC. */ const char *tm_zone; /* Timezone abbreviation. */ # else # 149 "/usr/include/time.h" 3 4 long int __tm_gmtoff; /* Seconds east of UTC. */ const char *__tm_zone; /* Timezone abbreviation. */ # endif # 152 "/usr/include/time.h" 3 4 }; __END_NAMESPACE_STD #if defined __USE_XOPEN || defined __USE_POSIX || defined __USE_MISC __USING_NAMESPACE_STD(tm) #endif # 157 "/usr/include/time.h" 3 4 # ifdef __USE_POSIX199309 /* POSIX.1b structure for timer start values and intervals. */ struct itimerspec { struct timespec it_interval; struct timespec it_value; }; /* We can use a simple forward declaration. */ struct sigevent; # endif /* POSIX.1b */ # 171 "/usr/include/time.h" 3 4 # ifdef __USE_XOPEN2K # ifndef __pid_t_defined typedef __pid_t pid_t; # define __pid_t_defined # endif # 177 "/usr/include/time.h" 3 4 # endif # 178 "/usr/include/time.h" 3 4 # ifdef __USE_ISOC11 /* Time base values for timespec_get. */ # define TIME_UTC 1 # endif # 184 "/usr/include/time.h" 3 4 __BEGIN_NAMESPACE_STD /* Time used by the program so far (user time + system time). The result / CLOCKS_PER_SECOND is program time in seconds. */ extern clock_t clock (void) __THROW; /* Return the current time and put it in *TIMER if TIMER is not NULL. */ extern time_t time (time_t *__timer) __THROW; /* Return the difference between TIME1 and TIME0. */ extern double difftime (time_t __time1, time_t __time0) __THROW __attribute__ ((__const__)); /* Return the `time_t' representation of TP and normalize TP. */ extern time_t mktime (struct tm *__tp) __THROW; /* Format TP into S according to FORMAT. Write no more than MAXSIZE characters and return the number of characters written, or 0 if it would exceed MAXSIZE. */ extern size_t strftime (char *__restrict __s, size_t __maxsize, const char *__restrict __format, const struct tm *__restrict __tp) __THROW; __END_NAMESPACE_STD # ifdef __USE_XOPEN /* Parse S according to FORMAT and store binary time information in TP. The return value is a pointer to the first unparsed character in S. */ extern char *strptime (const char *__restrict __s, const char *__restrict __fmt, struct tm *__tp) __THROW; # endif # 217 "/usr/include/time.h" 3 4 # ifdef __USE_XOPEN2K8 /* Similar to the two functions above but take the information from the provided locale and not the global locale. */ #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 221 "/usr/include/time.h" 3 4 # 222 "/usr/include/time.h" 3 4 extern size_t strftime_l (char *__restrict __s, size_t __maxsize, const char *__restrict __format, const struct tm *__restrict __tp, __locale_t __loc) __THROW; # endif # 228 "/usr/include/time.h" 3 4 # ifdef __USE_GNU extern char *strptime_l (const char *__restrict __s, const char *__restrict __fmt, struct tm *__tp, __locale_t __loc) __THROW; # endif # 234 "/usr/include/time.h" 3 4 __BEGIN_NAMESPACE_STD /* Return the `struct tm' representation of *TIMER in Universal Coordinated Time (aka Greenwich Mean Time). */ extern struct tm *gmtime (const time_t *__timer) __THROW; /* Return the `struct tm' representation of *TIMER in the local timezone. */ extern struct tm *localtime (const time_t *__timer) __THROW; __END_NAMESPACE_STD # if defined __USE_POSIX || defined __USE_MISC /* Return the `struct tm' representation of *TIMER in UTC, using *TP to store the result. */ extern struct tm *gmtime_r (const time_t *__restrict __timer, struct tm *__restrict __tp) __THROW; /* Return the `struct tm' representation of *TIMER in local time, using *TP to store the result. */ extern struct tm *localtime_r (const time_t *__restrict __timer, struct tm *__restrict __tp) __THROW; # endif /* POSIX or misc */ # 257 "/usr/include/time.h" 3 4 __BEGIN_NAMESPACE_STD /* Return a string of the form "Day Mon dd hh:mm:ss yyyy\n" that is the representation of TP in this format. */ extern char *asctime (const struct tm *__tp) __THROW; /* Equivalent to `asctime (localtime (timer))'. */ extern char *ctime (const time_t *__timer) __THROW; __END_NAMESPACE_STD # if defined __USE_POSIX || defined __USE_MISC /* Reentrant versions of the above functions. */ /* Return in BUF a string of the form "Day Mon dd hh:mm:ss yyyy\n" that is the representation of TP in this format. */ extern char *asctime_r (const struct tm *__restrict __tp, char *__restrict __buf) __THROW; /* Equivalent to `asctime_r (localtime_r (timer, *TMP*), buf)'. */ extern char *ctime_r (const time_t *__restrict __timer, char *__restrict __buf) __THROW; # endif /* POSIX or misc */ # 279 "/usr/include/time.h" 3 4 /* Defined in localtime.c. */ extern char *__tzname[2]; /* Current timezone names. */ extern int __daylight; /* If daylight-saving time is ever in use. */ extern long int __timezone; /* Seconds west of UTC. */ # ifdef __USE_POSIX /* Same as above. */ extern char *tzname[2]; /* Set time conversion information from the TZ environment variable. If TZ is not defined, a locale-dependent default is used. */ extern void tzset (void) __THROW; # endif # 295 "/usr/include/time.h" 3 4 # if defined __USE_SVID || defined __USE_XOPEN extern int daylight; extern long int timezone; # endif # 300 "/usr/include/time.h" 3 4 # ifdef __USE_SVID /* Set the system time to *WHEN. This call is restricted to the superuser. */ extern int stime (const time_t *__when) __THROW; # endif # 306 "/usr/include/time.h" 3 4 /* Nonzero if YEAR is a leap year (every 4 years, except every 100th isn't, and every 400th is). */ # define __isleap(year) \ ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0)) # ifdef __USE_MISC /* Miscellaneous functions many Unices inherited from the public domain localtime package. These are included only for compatibility. */ /* Like `mktime', but for TP represents Universal Time, not local time. */ extern time_t timegm (struct tm *__tp) __THROW; /* Another name for `mktime'. */ extern time_t timelocal (struct tm *__tp) __THROW; /* Return the number of days in YEAR. */ extern int dysize (int __year) __THROW __attribute__ ((__const__)); # endif # 327 "/usr/include/time.h" 3 4 # ifdef __USE_POSIX199309 /* Pause execution for a number of nanoseconds. This function is a cancellation point and therefore not marked with __THROW. */ extern int nanosleep (const struct timespec *__requested_time, struct timespec *__remaining); /* Get resolution of clock CLOCK_ID. */ extern int clock_getres (clockid_t __clock_id, struct timespec *__res) __THROW; /* Get current value of clock CLOCK_ID and store it in TP. */ extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) __THROW; /* Set clock CLOCK_ID to value TP. */ extern int clock_settime (clockid_t __clock_id, const struct timespec *__tp) __THROW; # ifdef __USE_XOPEN2K /* High-resolution sleep with the specified clock. This function is a cancellation point and therefore not marked with __THROW. */ extern int clock_nanosleep (clockid_t __clock_id, int __flags, const struct timespec *__req, struct timespec *__rem); /* Return clock ID for CPU-time clock. */ extern int clock_getcpuclockid (pid_t __pid, clockid_t *__clock_id) __THROW; # endif # 360 "/usr/include/time.h" 3 4 /* Create new per-process timer using CLOCK_ID. */ extern int timer_create (clockid_t __clock_id, struct sigevent *__restrict __evp, timer_t *__restrict __timerid) __THROW; /* Delete timer TIMERID. */ extern int timer_delete (timer_t __timerid) __THROW; /* Set timer TIMERID to VALUE, returning old value in OVALUE. */ extern int timer_settime (timer_t __timerid, int __flags, const struct itimerspec *__restrict __value, struct itimerspec *__restrict __ovalue) __THROW; /* Get current value of timer TIMERID and store it in VALUE. */ extern int timer_gettime (timer_t __timerid, struct itimerspec *__value) __THROW; /* Get expiration overrun for timer TIMERID. */ extern int timer_getoverrun (timer_t __timerid) __THROW; # endif # 382 "/usr/include/time.h" 3 4 # ifdef __USE_ISOC11 /* Set TS to calendar time based in time base BASE. */ extern int timespec_get (struct timespec *__ts, int __base) __THROW __nonnull ((1)); # endif # 389 "/usr/include/time.h" 3 4 # ifdef __USE_XOPEN_EXTENDED /* Set to one of the following values to indicate an error. 1 the DATEMSK environment variable is null or undefined, 2 the template file cannot be opened for reading, 3 failed to get file status information, 4 the template file is not a regular file, 5 an error is encountered while reading the template file, 6 memory allication failed (not enough memory available), 7 there is no line in the template that matches the input, 8 invalid input specification Example: February 31 or a time is specified that can not be represented in a time_t (representing the time in seconds since 00:00:00 UTC, January 1, 1970) */ extern int getdate_err; /* Parse the given string as a date specification and return a value representing the value. The templates from the file identified by the environment variable DATEMSK are used. In case of an error `getdate_err' is set. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct tm *getdate (const char *__string); # endif # 414 "/usr/include/time.h" 3 4 # ifdef __USE_GNU /* Since `getdate' is not reentrant because of the use of `getdate_err' and the static buffer to return the result in, we provide a thread-safe variant. The functionality is the same. The result is returned in the buffer pointed to by RESBUFP and in case of an error the return value is != 0 with the same values as given above for `getdate_err'. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int getdate_r (const char *__restrict __string, struct tm *__restrict __resbufp); # endif # 429 "/usr/include/time.h" 3 4 __END_DECLS #endif /* included. */ # 433 "/usr/include/time.h" 3 4 #endif /* not already included. */ # 435 "/usr/include/time.h" 3 4 # 44 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4 #define __need_timeval #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 45 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/time.h" 1 3 4 /* System-dependent timing definitions. Linux version. Copyright (C) 1996-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * Never include this file directly; use instead. */ #if defined __need_timeval || defined __USE_GNU # ifndef _STRUCT_TIMEVAL # define _STRUCT_TIMEVAL 1 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 26 "/usr/include/x86_64-linux-gnu/bits/time.h" 3 4 # 27 "/usr/include/x86_64-linux-gnu/bits/time.h" 3 4 /* A time value that is accurate to the nearest microsecond but also has a range of years. */ struct timeval { __time_t tv_sec; /* Seconds. */ __suseconds_t tv_usec; /* Microseconds. */ }; # endif /* struct timeval */ # 36 "/usr/include/x86_64-linux-gnu/bits/time.h" 3 4 #endif # 37 "/usr/include/x86_64-linux-gnu/bits/time.h" 3 4 #ifndef __need_timeval # ifndef _BITS_TIME_H # define _BITS_TIME_H 1 /* ISO/IEC 9899:1990 7.12.1: The macro `CLOCKS_PER_SEC' is the number per second of the value returned by the `clock' function. */ /* CAE XSH, Issue 4, Version 2: The value of CLOCKS_PER_SEC is required to be 1 million on all XSI-conformant systems. */ # define CLOCKS_PER_SEC 1000000l # if (!defined __STRICT_ANSI__ || defined __USE_POSIX) \ && !defined __USE_XOPEN2K /* Even though CLOCKS_PER_SEC has such a strange value CLK_TCK presents the real value for clock ticks per second for the system. */ #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 54 "/usr/include/x86_64-linux-gnu/bits/time.h" 3 4 # 55 "/usr/include/x86_64-linux-gnu/bits/time.h" 3 4 extern long int __sysconf (int); # define CLK_TCK ((__clock_t) __sysconf (2)) /* 2 is _SC_CLK_TCK */ # endif # 58 "/usr/include/x86_64-linux-gnu/bits/time.h" 3 4 # ifdef __USE_POSIX199309 /* Identifier for system-wide realtime clock. */ # define CLOCK_REALTIME 0 /* Monotonic system-wide clock. */ # define CLOCK_MONOTONIC 1 /* High-resolution timer from the CPU. */ # define CLOCK_PROCESS_CPUTIME_ID 2 /* Thread-specific CPU-time clock. */ # define CLOCK_THREAD_CPUTIME_ID 3 /* Monotonic system-wide clock, not adjusted for frequency scaling. */ # define CLOCK_MONOTONIC_RAW 4 /* Identifier for system-wide realtime clock, updated only on ticks. */ # define CLOCK_REALTIME_COARSE 5 /* Monotonic system-wide clock, updated only on ticks. */ # define CLOCK_MONOTONIC_COARSE 6 /* Monotonic system-wide clock that includes time spent in suspension. */ # define CLOCK_BOOTTIME 7 /* Like CLOCK_REALTIME but also wakes suspended system. */ # define CLOCK_REALTIME_ALARM 8 /* Like CLOCK_BOOTTIME but also wakes suspended system. */ # define CLOCK_BOOTTIME_ALARM 9 /* Flag to indicate time is absolute. */ # define TIMER_ABSTIME 1 # endif # 84 "/usr/include/x86_64-linux-gnu/bits/time.h" 3 4 # ifdef __USE_GNU #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 86 "/usr/include/x86_64-linux-gnu/bits/time.h" 3 4 # 87 "/usr/include/x86_64-linux-gnu/bits/time.h" 3 4 __BEGIN_DECLS /* Tune a POSIX clock. */ extern int clock_adjtime (__clockid_t __clock_id, struct timex *__utx) __THROW; __END_DECLS # endif /* use GNU */ # 95 "/usr/include/x86_64-linux-gnu/bits/time.h" 3 4 # endif /* bits/time.h */ # 97 "/usr/include/x86_64-linux-gnu/bits/time.h" 3 4 #endif # 98 "/usr/include/x86_64-linux-gnu/bits/time.h" 3 4 #undef __need_timeval # 46 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4 #ifndef __suseconds_t_defined typedef __suseconds_t suseconds_t; # define __suseconds_t_defined #endif # 51 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4 /* The fd_set member is required to be an array of longs. */ typedef long int __fd_mask; /* Some versions of define this macros. */ #undef __NFDBITS /* It's easier to assume 8-bit bytes than to get CHAR_BIT. */ #define __NFDBITS (8 * (int) sizeof (__fd_mask)) #define __FD_ELT(d) ((d) / __NFDBITS) #define __FD_MASK(d) ((__fd_mask) 1 << ((d) % __NFDBITS)) /* fd_set for select and pselect. */ typedef struct { /* XPG4.2 requires this member name. Otherwise avoid the name from the global namespace. */ #ifdef __USE_XOPEN __fd_mask fds_bits[__FD_SETSIZE / __NFDBITS]; # define __FDS_BITS(set) ((set)->fds_bits) #else # 72 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4 __fd_mask __fds_bits[__FD_SETSIZE / __NFDBITS]; # define __FDS_BITS(set) ((set)->__fds_bits) #endif # 75 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4 } fd_set; /* Maximum number of file descriptors in `fd_set'. */ #define FD_SETSIZE __FD_SETSIZE #ifdef __USE_MISC /* Sometimes the fd_set member is assumed to have this type. */ typedef __fd_mask fd_mask; /* Number of bits per word of `fd_set' (some code assumes this is 32). */ # define NFDBITS __NFDBITS #endif # 87 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4 /* Access macros for `fd_set'. */ #define FD_SET(fd, fdsetp) __FD_SET (fd, fdsetp) #define FD_CLR(fd, fdsetp) __FD_CLR (fd, fdsetp) #define FD_ISSET(fd, fdsetp) __FD_ISSET (fd, fdsetp) #define FD_ZERO(fdsetp) __FD_ZERO (fdsetp) __BEGIN_DECLS /* Check the first NFDS descriptors each in READFDS (if not NULL) for read readiness, in WRITEFDS (if not NULL) for write readiness, and in EXCEPTFDS (if not NULL) for exceptional conditions. If TIMEOUT is not NULL, time out after waiting the interval specified therein. Returns the number of ready descriptors, or -1 for errors. This function is a cancellation point and therefore not marked with __THROW. */ extern int select (int __nfds, fd_set *__restrict __readfds, fd_set *__restrict __writefds, fd_set *__restrict __exceptfds, struct timeval *__restrict __timeout); #ifdef __USE_XOPEN2K /* Same as above only that the TIMEOUT value is given with higher resolution and a sigmask which is been set temporarily. This version should be used. This function is a cancellation point and therefore not marked with __THROW. */ extern int pselect (int __nfds, fd_set *__restrict __readfds, fd_set *__restrict __writefds, fd_set *__restrict __exceptfds, const struct timespec *__restrict __timeout, const __sigset_t *__restrict __sigmask); #endif # 124 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4 /* Define some inlines helping to catch common problems. */ #if __USE_FORTIFY_LEVEL > 0 && defined __GNUC__ #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 128 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4 # 129 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4 #endif # 130 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4 __END_DECLS #endif /* sys/select.h */ # 134 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4 # 220 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4 /* BSD defines these symbols, so we follow. */ #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 222 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/sys/sysmacros.h" 1 3 4 /* Definitions of macros to access `dev_t' values. Copyright (C) 1996-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_SYSMACROS_H #define _SYS_SYSMACROS_H 1 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 22 "/usr/include/x86_64-linux-gnu/sys/sysmacros.h" 3 4 # 23 "/usr/include/x86_64-linux-gnu/sys/sysmacros.h" 3 4 __BEGIN_DECLS __extension__ extern unsigned int gnu_dev_major (unsigned long long int __dev) __THROW __attribute_const__; __extension__ extern unsigned int gnu_dev_minor (unsigned long long int __dev) __THROW __attribute_const__; __extension__ extern unsigned long long int gnu_dev_makedev (unsigned int __major, unsigned int __minor) __THROW __attribute_const__; #ifdef __USE_EXTERN_INLINES __extension__ __extern_inline __attribute_const__ unsigned int __NTH (gnu_dev_major (unsigned long long int __dev)) { return ((__dev >> 8) & 0xfff) | ((unsigned int) (__dev >> 32) & ~0xfff); } __extension__ __extern_inline __attribute_const__ unsigned int __NTH (gnu_dev_minor (unsigned long long int __dev)) { return (__dev & 0xff) | ((unsigned int) (__dev >> 12) & ~0xff); } __extension__ __extern_inline __attribute_const__ unsigned long long int __NTH (gnu_dev_makedev (unsigned int __major, unsigned int __minor)) { return ((__minor & 0xff) | ((__major & 0xfff) << 8) | (((unsigned long long int) (__minor & ~0xff)) << 12) | (((unsigned long long int) (__major & ~0xfff)) << 32)); } #endif # 58 "/usr/include/x86_64-linux-gnu/sys/sysmacros.h" 3 4 __END_DECLS /* Access the functions with their traditional names. */ #define major(dev) gnu_dev_major (dev) #define minor(dev) gnu_dev_minor (dev) #define makedev(maj, min) gnu_dev_makedev (maj, min) #endif /* sys/sysmacros.h */ # 66 "/usr/include/x86_64-linux-gnu/sys/sysmacros.h" 3 4 # 223 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4 #endif /* Use BSD. */ # 224 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 #if (defined __USE_UNIX98 || defined __USE_XOPEN2K8) \ && !defined __blksize_t_defined typedef __blksize_t blksize_t; # define __blksize_t_defined #endif # 231 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 /* Types from the Large File Support interface. */ #ifndef __USE_FILE_OFFSET64 # ifndef __blkcnt_t_defined typedef __blkcnt_t blkcnt_t; /* Type to count number of disk blocks. */ # define __blkcnt_t_defined # endif # 238 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 # ifndef __fsblkcnt_t_defined typedef __fsblkcnt_t fsblkcnt_t; /* Type to count file system blocks. */ # define __fsblkcnt_t_defined # endif # 242 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 # ifndef __fsfilcnt_t_defined typedef __fsfilcnt_t fsfilcnt_t; /* Type to count file system inodes. */ # define __fsfilcnt_t_defined # endif # 246 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 #else # 247 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 # ifndef __blkcnt_t_defined typedef __blkcnt64_t blkcnt_t; /* Type to count number of disk blocks. */ # define __blkcnt_t_defined # endif # 251 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 # ifndef __fsblkcnt_t_defined typedef __fsblkcnt64_t fsblkcnt_t; /* Type to count file system blocks. */ # define __fsblkcnt_t_defined # endif # 255 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 # ifndef __fsfilcnt_t_defined typedef __fsfilcnt64_t fsfilcnt_t; /* Type to count file system inodes. */ # define __fsfilcnt_t_defined # endif # 259 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 #endif # 260 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 #ifdef __USE_LARGEFILE64 typedef __blkcnt64_t blkcnt64_t; /* Type to count number of disk blocks. */ typedef __fsblkcnt64_t fsblkcnt64_t; /* Type to count file system blocks. */ typedef __fsfilcnt64_t fsfilcnt64_t; /* Type to count file system inodes. */ #endif # 266 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 /* Now add the thread types. */ #if defined __USE_POSIX199506 || defined __USE_UNIX98 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 270 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 1 3 4 /* Copyright (C) 2002-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _BITS_PTHREADTYPES_H #define _BITS_PTHREADTYPES_H 1 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 21 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4 /* Determine the wordsize from the preprocessor defines. */ #if defined __x86_64__ && !defined __ILP32__ # define __WORDSIZE 64 #else # 6 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 3 4 # define __WORDSIZE 32 #endif # 8 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 3 4 #ifdef __x86_64__ # define __WORDSIZE_TIME64_COMPAT32 1 /* Both x86-64 and x32 use the 64-bit system call interface. */ # define __SYSCALL_WORDSIZE 64 #endif # 14 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 3 4 # 22 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 2 3 4 #ifdef __x86_64__ # if __WORDSIZE == 64 # define __SIZEOF_PTHREAD_ATTR_T 56 # define __SIZEOF_PTHREAD_MUTEX_T 40 # define __SIZEOF_PTHREAD_MUTEXATTR_T 4 # define __SIZEOF_PTHREAD_COND_T 48 # define __SIZEOF_PTHREAD_CONDATTR_T 4 # define __SIZEOF_PTHREAD_RWLOCK_T 56 # define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 # define __SIZEOF_PTHREAD_BARRIER_T 32 # define __SIZEOF_PTHREAD_BARRIERATTR_T 4 # else # 35 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 3 4 # define __SIZEOF_PTHREAD_ATTR_T 32 # define __SIZEOF_PTHREAD_MUTEX_T 32 # define __SIZEOF_PTHREAD_MUTEXATTR_T 4 # define __SIZEOF_PTHREAD_COND_T 48 # define __SIZEOF_PTHREAD_CONDATTR_T 4 # define __SIZEOF_PTHREAD_RWLOCK_T 44 # define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 # define __SIZEOF_PTHREAD_BARRIER_T 20 # define __SIZEOF_PTHREAD_BARRIERATTR_T 4 # endif # 45 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 3 4 #else # 46 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 3 4 # define __SIZEOF_PTHREAD_ATTR_T 36 # define __SIZEOF_PTHREAD_MUTEX_T 24 # define __SIZEOF_PTHREAD_MUTEXATTR_T 4 # define __SIZEOF_PTHREAD_COND_T 48 # define __SIZEOF_PTHREAD_CONDATTR_T 4 # define __SIZEOF_PTHREAD_RWLOCK_T 32 # define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 # define __SIZEOF_PTHREAD_BARRIER_T 20 # define __SIZEOF_PTHREAD_BARRIERATTR_T 4 #endif # 56 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 3 4 /* Thread identifiers. The structure of the attribute type is not exposed on purpose. */ typedef unsigned long int pthread_t; union pthread_attr_t { char __size[__SIZEOF_PTHREAD_ATTR_T]; long int __align; }; #ifndef __have_pthread_attr_t typedef union pthread_attr_t pthread_attr_t; # define __have_pthread_attr_t 1 #endif # 72 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 3 4 #ifdef __x86_64__ typedef struct __pthread_internal_list { struct __pthread_internal_list *__prev; struct __pthread_internal_list *__next; } __pthread_list_t; #else # 81 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 3 4 typedef struct __pthread_internal_slist { struct __pthread_internal_slist *__next; } __pthread_slist_t; #endif # 86 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 3 4 /* Data structures for mutex handling. The structure of the attribute type is not exposed on purpose. */ typedef union { struct __pthread_mutex_s { int __lock; unsigned int __count; int __owner; #ifdef __x86_64__ unsigned int __nusers; #endif # 100 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 3 4 /* KIND must stay at this position in the structure to maintain binary compatibility. */ int __kind; #ifdef __x86_64__ short __spins; short __elision; __pthread_list_t __list; # define __PTHREAD_MUTEX_HAVE_PREV 1 # define __PTHREAD_MUTEX_HAVE_ELISION 1 #else # 110 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 3 4 unsigned int __nusers; __extension__ union { struct { short __espins; short __elision; # define __spins d.__espins # define __elision d.__elision # define __PTHREAD_MUTEX_HAVE_ELISION 2 } d; __pthread_slist_t __list; }; #endif # 124 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 3 4 } __data; char __size[__SIZEOF_PTHREAD_MUTEX_T]; long int __align; } pthread_mutex_t; typedef union { char __size[__SIZEOF_PTHREAD_MUTEXATTR_T]; int __align; } pthread_mutexattr_t; /* Data structure for conditional variable handling. The structure of the attribute type is not exposed on purpose. */ typedef union { struct { int __lock; unsigned int __futex; __extension__ unsigned long long int __total_seq; __extension__ unsigned long long int __wakeup_seq; __extension__ unsigned long long int __woken_seq; void *__mutex; unsigned int __nwaiters; unsigned int __broadcast_seq; } __data; char __size[__SIZEOF_PTHREAD_COND_T]; __extension__ long long int __align; } pthread_cond_t; typedef union { char __size[__SIZEOF_PTHREAD_CONDATTR_T]; int __align; } pthread_condattr_t; /* Keys for thread-specific data */ typedef unsigned int pthread_key_t; /* Once-only execution */ typedef int pthread_once_t; #if defined __USE_UNIX98 || defined __USE_XOPEN2K /* Data structure for read-write lock variable handling. The structure of the attribute type is not exposed on purpose. */ typedef union { # ifdef __x86_64__ struct { int __lock; unsigned int __nr_readers; unsigned int __readers_wakeup; unsigned int __writer_wakeup; unsigned int __nr_readers_queued; unsigned int __nr_writers_queued; int __writer; int __shared; unsigned long int __pad1; unsigned long int __pad2; /* FLAGS must stay at this position in the structure to maintain binary compatibility. */ unsigned int __flags; # define __PTHREAD_RWLOCK_INT_FLAGS_SHARED 1 } __data; # else # 194 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 3 4 struct { int __lock; unsigned int __nr_readers; unsigned int __readers_wakeup; unsigned int __writer_wakeup; unsigned int __nr_readers_queued; unsigned int __nr_writers_queued; /* FLAGS must stay at this position in the structure to maintain binary compatibility. */ unsigned char __flags; unsigned char __shared; unsigned char __pad1; unsigned char __pad2; int __writer; } __data; # endif # 211 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 3 4 char __size[__SIZEOF_PTHREAD_RWLOCK_T]; long int __align; } pthread_rwlock_t; typedef union { char __size[__SIZEOF_PTHREAD_RWLOCKATTR_T]; long int __align; } pthread_rwlockattr_t; #endif # 221 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 3 4 #ifdef __USE_XOPEN2K /* POSIX spinlock data type. */ typedef volatile int pthread_spinlock_t; /* POSIX barriers data type. The structure of the type is deliberately not exposed. */ typedef union { char __size[__SIZEOF_PTHREAD_BARRIER_T]; long int __align; } pthread_barrier_t; typedef union { char __size[__SIZEOF_PTHREAD_BARRIERATTR_T]; int __align; } pthread_barrierattr_t; #endif # 242 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 3 4 #ifndef __x86_64__ /* Extra attributes for the cleanup functions. */ # define __cleanup_fct_attribute __attribute__ ((__regparm__ (1))) #endif # 248 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 3 4 #endif /* bits/pthreadtypes.h */ # 250 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 3 4 # 271 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4 #endif # 272 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 __END_DECLS #endif /* sys/types.h */ # 276 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 # 315 "/usr/include/stdlib.h" 2 3 4 /* These are the functions that actually do things. The `random', `srandom', `initstate' and `setstate' functions are those from BSD Unices. The `rand' and `srand' functions are required by the ANSI standard. We provide both interfaces to the same random number generator. */ /* Return a random long integer between 0 and RAND_MAX inclusive. */ extern long int random (void) __THROW; /* Seed the random number generator with the given number. */ extern void srandom (unsigned int __seed) __THROW; /* Initialize the random number generator to use state buffer STATEBUF, of length STATELEN, and seed it with SEED. Optimal lengths are 8, 16, 32, 64, 128 and 256, the bigger the better; values less than 8 will cause an error and values greater than 256 will be rounded down. */ extern char *initstate (unsigned int __seed, char *__statebuf, size_t __statelen) __THROW __nonnull ((2)); /* Switch the random number generator to state buffer STATEBUF, which should have been previously initialized by `initstate'. */ extern char *setstate (char *__statebuf) __THROW __nonnull ((1)); # ifdef __USE_MISC /* Reentrant versions of the `random' family of functions. These functions all use the following data structure to contain state, rather than global state variables. */ struct random_data { int32_t *fptr; /* Front pointer. */ int32_t *rptr; /* Rear pointer. */ int32_t *state; /* Array of state values. */ int rand_type; /* Type of random number generator. */ int rand_deg; /* Degree of random number generator. */ int rand_sep; /* Distance between front and rear. */ int32_t *end_ptr; /* Pointer behind state table. */ }; extern int random_r (struct random_data *__restrict __buf, int32_t *__restrict __result) __THROW __nonnull ((1, 2)); extern int srandom_r (unsigned int __seed, struct random_data *__buf) __THROW __nonnull ((2)); extern int initstate_r (unsigned int __seed, char *__restrict __statebuf, size_t __statelen, struct random_data *__restrict __buf) __THROW __nonnull ((2, 4)); extern int setstate_r (char *__restrict __statebuf, struct random_data *__restrict __buf) __THROW __nonnull ((1, 2)); # endif /* Use misc. */ # 369 "/usr/include/stdlib.h" 3 4 #endif /* Use SVID || extended X/Open || BSD. */ # 370 "/usr/include/stdlib.h" 3 4 __BEGIN_NAMESPACE_STD /* Return a random integer between 0 and RAND_MAX inclusive. */ extern int rand (void) __THROW; /* Seed the random number generator with the given number. */ extern void srand (unsigned int __seed) __THROW; __END_NAMESPACE_STD #ifdef __USE_POSIX /* Reentrant interface according to POSIX.1. */ extern int rand_r (unsigned int *__seed) __THROW; #endif # 383 "/usr/include/stdlib.h" 3 4 #if defined __USE_SVID || defined __USE_XOPEN /* System V style 48-bit random number generator functions. */ /* Return non-negative, double-precision floating-point value in [0.0,1.0). */ extern double drand48 (void) __THROW; extern double erand48 (unsigned short int __xsubi[3]) __THROW __nonnull ((1)); /* Return non-negative, long integer in [0,2^31). */ extern long int lrand48 (void) __THROW; extern long int nrand48 (unsigned short int __xsubi[3]) __THROW __nonnull ((1)); /* Return signed, long integers in [-2^31,2^31). */ extern long int mrand48 (void) __THROW; extern long int jrand48 (unsigned short int __xsubi[3]) __THROW __nonnull ((1)); /* Seed random number generator. */ extern void srand48 (long int __seedval) __THROW; extern unsigned short int *seed48 (unsigned short int __seed16v[3]) __THROW __nonnull ((1)); extern void lcong48 (unsigned short int __param[7]) __THROW __nonnull ((1)); # ifdef __USE_MISC /* Data structure for communication with thread safe versions. This type is to be regarded as opaque. It's only exported because users have to allocate objects of this type. */ struct drand48_data { unsigned short int __x[3]; /* Current state. */ unsigned short int __old_x[3]; /* Old state. */ unsigned short int __c; /* Additive const. in congruential formula. */ unsigned short int __init; /* Flag for initializing. */ __extension__ unsigned long long int __a; /* Factor in congruential formula. */ }; /* Return non-negative, double-precision floating-point value in [0.0,1.0). */ extern int drand48_r (struct drand48_data *__restrict __buffer, double *__restrict __result) __THROW __nonnull ((1, 2)); extern int erand48_r (unsigned short int __xsubi[3], struct drand48_data *__restrict __buffer, double *__restrict __result) __THROW __nonnull ((1, 2)); /* Return non-negative, long integer in [0,2^31). */ extern int lrand48_r (struct drand48_data *__restrict __buffer, long int *__restrict __result) __THROW __nonnull ((1, 2)); extern int nrand48_r (unsigned short int __xsubi[3], struct drand48_data *__restrict __buffer, long int *__restrict __result) __THROW __nonnull ((1, 2)); /* Return signed, long integers in [-2^31,2^31). */ extern int mrand48_r (struct drand48_data *__restrict __buffer, long int *__restrict __result) __THROW __nonnull ((1, 2)); extern int jrand48_r (unsigned short int __xsubi[3], struct drand48_data *__restrict __buffer, long int *__restrict __result) __THROW __nonnull ((1, 2)); /* Seed random number generator. */ extern int srand48_r (long int __seedval, struct drand48_data *__buffer) __THROW __nonnull ((2)); extern int seed48_r (unsigned short int __seed16v[3], struct drand48_data *__buffer) __THROW __nonnull ((1, 2)); extern int lcong48_r (unsigned short int __param[7], struct drand48_data *__buffer) __THROW __nonnull ((1, 2)); # endif /* Use misc. */ # 458 "/usr/include/stdlib.h" 3 4 #endif /* Use SVID or X/Open. */ # 459 "/usr/include/stdlib.h" 3 4 #endif /* don't just need malloc and calloc */ # 461 "/usr/include/stdlib.h" 3 4 #ifndef __malloc_and_calloc_defined # define __malloc_and_calloc_defined __BEGIN_NAMESPACE_STD /* Allocate SIZE bytes of memory. */ extern void *malloc (size_t __size) __THROW __attribute_malloc__ __wur; /* Allocate NMEMB elements of SIZE bytes each, all initialized to 0. */ extern void *calloc (size_t __nmemb, size_t __size) __THROW __attribute_malloc__ __wur; __END_NAMESPACE_STD #endif # 472 "/usr/include/stdlib.h" 3 4 #ifndef __need_malloc_and_calloc __BEGIN_NAMESPACE_STD /* Re-allocate the previously allocated block in PTR, making the new block SIZE bytes long. */ /* __attribute_malloc__ is not used, because if realloc returns the same pointer that was passed to it, aliasing needs to be allowed between objects pointed by the old and new pointers. */ extern void *realloc (void *__ptr, size_t __size) __THROW __attribute_warn_unused_result__; /* Free a block allocated by `malloc', `realloc' or `calloc'. */ extern void free (void *__ptr) __THROW; __END_NAMESPACE_STD #ifdef __USE_MISC /* Free a block. An alias for `free'. (Sun Unices). */ extern void cfree (void *__ptr) __THROW; #endif /* Use misc. */ # 490 "/usr/include/stdlib.h" 3 4 #if defined __USE_GNU || defined __USE_BSD || defined __USE_MISC #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 492 "/usr/include/stdlib.h" 3 4 # 1 "/usr/include/alloca.h" 1 3 4 /* Copyright (C) 1992-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _ALLOCA_H #define _ALLOCA_H 1 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 21 "/usr/include/alloca.h" 3 4 # 22 "/usr/include/alloca.h" 3 4 #define __need_size_t #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 24 "/usr/include/alloca.h" 3 4 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 1 3 4 /*===---- stddef.h - Basic type definitions --------------------------------=== * * Copyright (c) 2008 Eli Friedman * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #if !defined(__STDDEF_H) || defined(__need_ptrdiff_t) || \ defined(__need_size_t) || defined(__need_wchar_t) || \ defined(__need_NULL) || defined(__need_wint_t) #if !defined(__need_ptrdiff_t) && !defined(__need_size_t) && \ !defined(__need_wchar_t) && !defined(__need_NULL) && \ !defined(__need_wint_t) /* Always define miscellaneous pieces when modules are available. */ #if !__has_feature(modules) #define __STDDEF_H #endif # 37 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #define __need_ptrdiff_t #define __need_size_t #define __need_wchar_t #define __need_NULL #define __need_STDDEF_H_misc /* __need_wint_t is intentionally not defined here. */ #endif # 44 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_ptrdiff_t) #if !defined(_PTRDIFF_T) || __has_feature(modules) /* Always define ptrdiff_t when modules are available. */ #if !__has_feature(modules) #define _PTRDIFF_T #endif # 51 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 typedef __PTRDIFF_TYPE__ ptrdiff_t; #endif # 53 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #undef __need_ptrdiff_t #endif /* defined(__need_ptrdiff_t) */ # 55 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_size_t) #if !defined(_SIZE_T) || __has_feature(modules) /* Always define size_t when modules are available. */ #if !__has_feature(modules) #define _SIZE_T #endif # 62 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 typedef __SIZE_TYPE__ size_t; #endif # 64 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #undef __need_size_t #endif /*defined(__need_size_t) */ # 66 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_STDDEF_H_misc) /* ISO9899:2011 7.20 (C11 Annex K): Define rsize_t if __STDC_WANT_LIB_EXT1__ is * enabled. */ #if (defined(__STDC_WANT_LIB_EXT1__) && __STDC_WANT_LIB_EXT1__ >= 1 && \ !defined(_RSIZE_T)) || __has_feature(modules) /* Always define rsize_t when modules are available. */ #if !__has_feature(modules) #define _RSIZE_T #endif # 76 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 typedef __SIZE_TYPE__ rsize_t; #endif # 78 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif /* defined(__need_STDDEF_H_misc) */ # 79 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_wchar_t) #ifndef __cplusplus /* Always define wchar_t when modules are available. */ #if !defined(_WCHAR_T) || __has_feature(modules) #if !__has_feature(modules) #define _WCHAR_T #if defined(_MSC_EXTENSIONS) #define _WCHAR_T_DEFINED #endif # 89 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif # 90 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 typedef __WCHAR_TYPE__ wchar_t; #endif # 92 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif # 93 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #undef __need_wchar_t #endif /* defined(__need_wchar_t) */ # 95 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_NULL) #undef NULL #ifdef __cplusplus # if !defined(__MINGW32__) && !defined(_MSC_VER) # define NULL __null # else # 102 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 # define NULL 0 # endif # 104 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #else # 105 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 # define NULL ((void*)0) #endif # 107 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #ifdef __cplusplus #if defined(_MSC_EXTENSIONS) && defined(_NATIVE_NULLPTR_SUPPORTED) namespace std { typedef decltype(nullptr) nullptr_t; } using ::std::nullptr_t; #endif # 112 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif # 113 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #undef __need_NULL #endif /* defined(__need_NULL) */ # 115 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_STDDEF_H_misc) #if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L #if 0 /* expanded by -frewrite-includes */ #include "__stddef_max_align_t.h" #endif /* expanded by -frewrite-includes */ # 118 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 # 119 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif # 120 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #define offsetof(t, d) __builtin_offsetof(t, d) #undef __need_STDDEF_H_misc #endif /* defined(__need_STDDEF_H_misc) */ # 123 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 /* Some C libraries expect to see a wint_t here. Others (notably MinGW) will use __WINT_TYPE__ directly; accommodate both by requiring __need_wint_t */ #if defined(__need_wint_t) /* Always define wint_t when modules are available. */ #if !defined(_WINT_T) || __has_feature(modules) #if !__has_feature(modules) #define _WINT_T #endif # 132 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 typedef __WINT_TYPE__ wint_t; #endif # 134 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #undef __need_wint_t #endif /* __need_wint_t */ # 136 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif # 138 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 # 25 "/usr/include/alloca.h" 2 3 4 __BEGIN_DECLS /* Remove any previous definitions. */ #undef alloca /* Allocate a block that will be freed when the calling function exits. */ extern void *alloca (size_t __size) __THROW; #ifdef __GNUC__ # define alloca(size) __builtin_alloca (size) #endif /* GCC. */ # 37 "/usr/include/alloca.h" 3 4 __END_DECLS #endif /* alloca.h */ # 41 "/usr/include/alloca.h" 3 4 # 493 "/usr/include/stdlib.h" 2 3 4 #endif /* Use GNU, BSD, or misc. */ # 494 "/usr/include/stdlib.h" 3 4 #if (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K) \ || defined __USE_BSD /* Allocate SIZE bytes on a page boundary. The storage cannot be freed. */ extern void *valloc (size_t __size) __THROW __attribute_malloc__ __wur; #endif # 500 "/usr/include/stdlib.h" 3 4 #ifdef __USE_XOPEN2K /* Allocate memory of SIZE bytes with an alignment of ALIGNMENT. */ extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size) __THROW __nonnull ((1)) __wur; #endif # 506 "/usr/include/stdlib.h" 3 4 #ifdef __USE_ISOC11 /* ISO C variant of aligned allocation. */ extern void *aligned_alloc (size_t __alignment, size_t __size) __THROW __attribute_malloc__ __attribute_alloc_size__ ((2)) __wur; #endif # 512 "/usr/include/stdlib.h" 3 4 __BEGIN_NAMESPACE_STD /* Abort execution and generate a core-dump. */ extern void abort (void) __THROW __attribute__ ((__noreturn__)); /* Register a function to be called when `exit' is called. */ extern int atexit (void (*__func) (void)) __THROW __nonnull ((1)); #if defined __USE_ISOC11 || defined __USE_ISOCXX11 /* Register a function to be called when `quick_exit' is called. */ # ifdef __cplusplus extern "C++" int at_quick_exit (void (*__func) (void)) __THROW __asm ("at_quick_exit") __nonnull ((1)); # else # 527 "/usr/include/stdlib.h" 3 4 extern int at_quick_exit (void (*__func) (void)) __THROW __nonnull ((1)); # endif # 529 "/usr/include/stdlib.h" 3 4 #endif # 530 "/usr/include/stdlib.h" 3 4 __END_NAMESPACE_STD #ifdef __USE_MISC /* Register a function to be called with the status given to `exit' and the given argument. */ extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg) __THROW __nonnull ((1)); #endif # 538 "/usr/include/stdlib.h" 3 4 __BEGIN_NAMESPACE_STD /* Call all functions registered with `atexit' and `on_exit', in the reverse of the order in which they were registered, perform stdio cleanup, and terminate program execution with STATUS. */ extern void exit (int __status) __THROW __attribute__ ((__noreturn__)); #if defined __USE_ISOC11 || defined __USE_ISOCXX11 /* Call all functions registered with `at_quick_exit' in the reverse of the order in which they were registered and terminate program execution with STATUS. */ extern void quick_exit (int __status) __THROW __attribute__ ((__noreturn__)); #endif # 551 "/usr/include/stdlib.h" 3 4 __END_NAMESPACE_STD #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Terminate the program with STATUS without calling any of the functions registered with `atexit' or `on_exit'. */ extern void _Exit (int __status) __THROW __attribute__ ((__noreturn__)); __END_NAMESPACE_C99 #endif # 560 "/usr/include/stdlib.h" 3 4 __BEGIN_NAMESPACE_STD /* Return the value of envariable NAME, or NULL if it doesn't exist. */ extern char *getenv (const char *__name) __THROW __nonnull ((1)) __wur; __END_NAMESPACE_STD #ifdef __USE_GNU /* This function is similar to the above but returns NULL if the programs is running with SUID or SGID enabled. */ extern char *secure_getenv (const char *__name) __THROW __nonnull ((1)) __wur; #endif # 573 "/usr/include/stdlib.h" 3 4 #if defined __USE_SVID || defined __USE_XOPEN /* The SVID says this is in , but this seems a better place. */ /* Put STRING, which is of the form "NAME=VALUE", in the environment. If there is no `=', remove NAME from the environment. */ extern int putenv (char *__string) __THROW __nonnull ((1)); #endif # 580 "/usr/include/stdlib.h" 3 4 #if defined __USE_BSD || defined __USE_XOPEN2K /* Set NAME to VALUE in the environment. If REPLACE is nonzero, overwrite an existing value. */ extern int setenv (const char *__name, const char *__value, int __replace) __THROW __nonnull ((2)); /* Remove the variable NAME from the environment. */ extern int unsetenv (const char *__name) __THROW __nonnull ((1)); #endif # 590 "/usr/include/stdlib.h" 3 4 #ifdef __USE_MISC /* The `clearenv' was planned to be added to POSIX.1 but probably never made it. Nevertheless the POSIX.9 standard (POSIX bindings for Fortran 77) requires this function. */ extern int clearenv (void) __THROW; #endif # 597 "/usr/include/stdlib.h" 3 4 #if defined __USE_MISC \ || (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K8) /* Generate a unique temporary file name from TEMPLATE. The last six characters of TEMPLATE must be "XXXXXX"; they are replaced with a string that makes the file name unique. Always returns TEMPLATE, it's either a temporary file name or a null string if it cannot get a unique file name. */ extern char *mktemp (char *__template) __THROW __nonnull ((1)); #endif # 608 "/usr/include/stdlib.h" 3 4 #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED \ || defined __USE_XOPEN2K8 /* Generate a unique temporary file name from TEMPLATE. The last six characters of TEMPLATE must be "XXXXXX"; they are replaced with a string that makes the filename unique. Returns a file descriptor open on the file for reading and writing, or -1 if it cannot create a uniquely-named file. This function is a possible cancellation point and therefore not marked with __THROW. */ # ifndef __USE_FILE_OFFSET64 extern int mkstemp (char *__template) __nonnull ((1)) __wur; # else # 622 "/usr/include/stdlib.h" 3 4 # ifdef __REDIRECT extern int __REDIRECT (mkstemp, (char *__template), mkstemp64) __nonnull ((1)) __wur; # else # 626 "/usr/include/stdlib.h" 3 4 # define mkstemp mkstemp64 # endif # 628 "/usr/include/stdlib.h" 3 4 # endif # 629 "/usr/include/stdlib.h" 3 4 # ifdef __USE_LARGEFILE64 extern int mkstemp64 (char *__template) __nonnull ((1)) __wur; # endif # 632 "/usr/include/stdlib.h" 3 4 #endif # 633 "/usr/include/stdlib.h" 3 4 #ifdef __USE_MISC /* Similar to mkstemp, but the template can have a suffix after the XXXXXX. The length of the suffix is specified in the second parameter. This function is a possible cancellation point and therefore not marked with __THROW. */ # ifndef __USE_FILE_OFFSET64 extern int mkstemps (char *__template, int __suffixlen) __nonnull ((1)) __wur; # else # 644 "/usr/include/stdlib.h" 3 4 # ifdef __REDIRECT extern int __REDIRECT (mkstemps, (char *__template, int __suffixlen), mkstemps64) __nonnull ((1)) __wur; # else # 648 "/usr/include/stdlib.h" 3 4 # define mkstemps mkstemps64 # endif # 650 "/usr/include/stdlib.h" 3 4 # endif # 651 "/usr/include/stdlib.h" 3 4 # ifdef __USE_LARGEFILE64 extern int mkstemps64 (char *__template, int __suffixlen) __nonnull ((1)) __wur; # endif # 655 "/usr/include/stdlib.h" 3 4 #endif # 656 "/usr/include/stdlib.h" 3 4 #if defined __USE_BSD || defined __USE_XOPEN2K8 /* Create a unique temporary directory from TEMPLATE. The last six characters of TEMPLATE must be "XXXXXX"; they are replaced with a string that makes the directory name unique. Returns TEMPLATE, or a null pointer if it cannot get a unique name. The directory is created mode 700. */ extern char *mkdtemp (char *__template) __THROW __nonnull ((1)) __wur; #endif # 665 "/usr/include/stdlib.h" 3 4 #ifdef __USE_GNU /* Generate a unique temporary file name from TEMPLATE similar to mkstemp. But allow the caller to pass additional flags which are used in the open call to create the file.. This function is a possible cancellation point and therefore not marked with __THROW. */ # ifndef __USE_FILE_OFFSET64 extern int mkostemp (char *__template, int __flags) __nonnull ((1)) __wur; # else # 676 "/usr/include/stdlib.h" 3 4 # ifdef __REDIRECT extern int __REDIRECT (mkostemp, (char *__template, int __flags), mkostemp64) __nonnull ((1)) __wur; # else # 680 "/usr/include/stdlib.h" 3 4 # define mkostemp mkostemp64 # endif # 682 "/usr/include/stdlib.h" 3 4 # endif # 683 "/usr/include/stdlib.h" 3 4 # ifdef __USE_LARGEFILE64 extern int mkostemp64 (char *__template, int __flags) __nonnull ((1)) __wur; # endif # 686 "/usr/include/stdlib.h" 3 4 /* Similar to mkostemp, but the template can have a suffix after the XXXXXX. The length of the suffix is specified in the second parameter. This function is a possible cancellation point and therefore not marked with __THROW. */ # ifndef __USE_FILE_OFFSET64 extern int mkostemps (char *__template, int __suffixlen, int __flags) __nonnull ((1)) __wur; # else # 697 "/usr/include/stdlib.h" 3 4 # ifdef __REDIRECT extern int __REDIRECT (mkostemps, (char *__template, int __suffixlen, int __flags), mkostemps64) __nonnull ((1)) __wur; # else # 702 "/usr/include/stdlib.h" 3 4 # define mkostemps mkostemps64 # endif # 704 "/usr/include/stdlib.h" 3 4 # endif # 705 "/usr/include/stdlib.h" 3 4 # ifdef __USE_LARGEFILE64 extern int mkostemps64 (char *__template, int __suffixlen, int __flags) __nonnull ((1)) __wur; # endif # 709 "/usr/include/stdlib.h" 3 4 #endif # 710 "/usr/include/stdlib.h" 3 4 __BEGIN_NAMESPACE_STD /* Execute the given line as a shell command. This function is a cancellation point and therefore not marked with __THROW. */ extern int system (const char *__command) __wur; __END_NAMESPACE_STD #ifdef __USE_GNU /* Return a malloc'd string containing the canonical absolute name of the existing named file. */ extern char *canonicalize_file_name (const char *__name) __THROW __nonnull ((1)) __wur; #endif # 727 "/usr/include/stdlib.h" 3 4 #if defined __USE_BSD || defined __USE_XOPEN_EXTENDED /* Return the canonical absolute name of file NAME. If RESOLVED is null, the result is malloc'd; otherwise, if the canonical name is PATH_MAX chars or more, returns null with `errno' set to ENAMETOOLONG; if the name fits in fewer than PATH_MAX chars, returns the name in RESOLVED. */ extern char *realpath (const char *__restrict __name, char *__restrict __resolved) __THROW __wur; #endif # 737 "/usr/include/stdlib.h" 3 4 /* Shorthand for type of comparison functions. */ #ifndef __COMPAR_FN_T # define __COMPAR_FN_T typedef int (*__compar_fn_t) (const void *, const void *); # ifdef __USE_GNU typedef __compar_fn_t comparison_fn_t; # endif # 747 "/usr/include/stdlib.h" 3 4 #endif # 748 "/usr/include/stdlib.h" 3 4 #ifdef __USE_GNU typedef int (*__compar_d_fn_t) (const void *, const void *, void *); #endif # 751 "/usr/include/stdlib.h" 3 4 __BEGIN_NAMESPACE_STD /* Do a binary search for KEY in BASE, which consists of NMEMB elements of SIZE bytes each, using COMPAR to perform the comparisons. */ extern void *bsearch (const void *__key, const void *__base, size_t __nmemb, size_t __size, __compar_fn_t __compar) __nonnull ((1, 2, 5)) __wur; #ifdef __USE_EXTERN_INLINES #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 760 "/usr/include/stdlib.h" 3 4 # 761 "/usr/include/stdlib.h" 3 4 #endif # 762 "/usr/include/stdlib.h" 3 4 /* Sort NMEMB elements of BASE, of SIZE bytes each, using COMPAR to perform the comparisons. */ extern void qsort (void *__base, size_t __nmemb, size_t __size, __compar_fn_t __compar) __nonnull ((1, 4)); #ifdef __USE_GNU extern void qsort_r (void *__base, size_t __nmemb, size_t __size, __compar_d_fn_t __compar, void *__arg) __nonnull ((1, 4)); #endif # 772 "/usr/include/stdlib.h" 3 4 /* Return the absolute value of X. */ extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur; extern long int labs (long int __x) __THROW __attribute__ ((__const__)) __wur; __END_NAMESPACE_STD #ifdef __USE_ISOC99 __extension__ extern long long int llabs (long long int __x) __THROW __attribute__ ((__const__)) __wur; #endif # 783 "/usr/include/stdlib.h" 3 4 __BEGIN_NAMESPACE_STD /* Return the `div_t', `ldiv_t' or `lldiv_t' representation of the value of NUMER over DENOM. */ /* GCC may have built-ins for these someday. */ extern div_t div (int __numer, int __denom) __THROW __attribute__ ((__const__)) __wur; extern ldiv_t ldiv (long int __numer, long int __denom) __THROW __attribute__ ((__const__)) __wur; __END_NAMESPACE_STD #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 __extension__ extern lldiv_t lldiv (long long int __numer, long long int __denom) __THROW __attribute__ ((__const__)) __wur; __END_NAMESPACE_C99 #endif # 802 "/usr/include/stdlib.h" 3 4 #if (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K8) \ || defined __USE_SVID /* Convert floating point numbers to strings. The returned values are valid only until another call to the same function. */ /* Convert VALUE to a string with NDIGIT digits and return a pointer to this. Set *DECPT with the position of the decimal character and *SIGN with the sign of the number. */ extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign) __THROW __nonnull ((3, 4)) __wur; /* Convert VALUE to a string rounded to NDIGIT decimal digits. Set *DECPT with the position of the decimal character and *SIGN with the sign of the number. */ extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign) __THROW __nonnull ((3, 4)) __wur; /* If possible convert VALUE to a string with NDIGIT significant digits. Otherwise use exponential representation. The resulting string will be written to BUF. */ extern char *gcvt (double __value, int __ndigit, char *__buf) __THROW __nonnull ((3)) __wur; #endif # 827 "/usr/include/stdlib.h" 3 4 #ifdef __USE_MISC /* Long double versions of above functions. */ extern char *qecvt (long double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign) __THROW __nonnull ((3, 4)) __wur; extern char *qfcvt (long double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign) __THROW __nonnull ((3, 4)) __wur; extern char *qgcvt (long double __value, int __ndigit, char *__buf) __THROW __nonnull ((3)) __wur; /* Reentrant version of the functions above which provide their own buffers. */ extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign, char *__restrict __buf, size_t __len) __THROW __nonnull ((3, 4, 5)); extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign, char *__restrict __buf, size_t __len) __THROW __nonnull ((3, 4, 5)); extern int qecvt_r (long double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign, char *__restrict __buf, size_t __len) __THROW __nonnull ((3, 4, 5)); extern int qfcvt_r (long double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign, char *__restrict __buf, size_t __len) __THROW __nonnull ((3, 4, 5)); #endif /* misc */ # 858 "/usr/include/stdlib.h" 3 4 __BEGIN_NAMESPACE_STD /* Return the length of the multibyte character in S, which is no longer than N. */ extern int mblen (const char *__s, size_t __n) __THROW; /* Return the length of the given multibyte character, putting its `wchar_t' representation in *PWC. */ extern int mbtowc (wchar_t *__restrict __pwc, const char *__restrict __s, size_t __n) __THROW; /* Put the multibyte character represented by WCHAR in S, returning its length. */ extern int wctomb (char *__s, wchar_t __wchar) __THROW; /* Convert a multibyte string to a wide char string. */ extern size_t mbstowcs (wchar_t *__restrict __pwcs, const char *__restrict __s, size_t __n) __THROW; /* Convert a wide char string to multibyte string. */ extern size_t wcstombs (char *__restrict __s, const wchar_t *__restrict __pwcs, size_t __n) __THROW; __END_NAMESPACE_STD #ifdef __USE_SVID /* Determine whether the string value of RESPONSE matches the affirmation or negative response expression as specified by the LC_MESSAGES category in the program's current locale. Returns 1 if affirmative, 0 if negative, and -1 if not matching. */ extern int rpmatch (const char *__response) __THROW __nonnull ((1)) __wur; #endif # 890 "/usr/include/stdlib.h" 3 4 #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 /* Parse comma separated suboption from *OPTIONP and match against strings in TOKENS. If found return index and set *VALUEP to optional value introduced by an equal sign. If the suboption is not part of TOKENS return in *VALUEP beginning of unknown suboption. On exit *OPTIONP is set to the beginning of the next token or at the terminating NUL character. */ extern int getsubopt (char **__restrict __optionp, char *const *__restrict __tokens, char **__restrict __valuep) __THROW __nonnull ((1, 2, 3)) __wur; #endif # 904 "/usr/include/stdlib.h" 3 4 #ifdef __USE_XOPEN /* Setup DES tables according KEY. */ extern void setkey (const char *__key) __THROW __nonnull ((1)); #endif # 910 "/usr/include/stdlib.h" 3 4 /* X/Open pseudo terminal handling. */ #ifdef __USE_XOPEN2KXSI /* Return a master pseudo-terminal handle. */ extern int posix_openpt (int __oflag) __wur; #endif # 918 "/usr/include/stdlib.h" 3 4 #ifdef __USE_XOPEN /* The next four functions all take a master pseudo-tty fd and perform an operation on the associated slave: */ /* Chown the slave to the calling user. */ extern int grantpt (int __fd) __THROW; /* Release an internal lock so the slave can be opened. Call after grantpt(). */ extern int unlockpt (int __fd) __THROW; /* Return the pathname of the pseudo terminal slave associated with the master FD is open on, or NULL on errors. The returned storage is good until the next call to this function. */ extern char *ptsname (int __fd) __THROW __wur; #endif # 935 "/usr/include/stdlib.h" 3 4 #ifdef __USE_GNU /* Store at most BUFLEN characters of the pathname of the slave pseudo terminal associated with the master FD is open on in BUF. Return 0 on success, otherwise an error number. */ extern int ptsname_r (int __fd, char *__buf, size_t __buflen) __THROW __nonnull ((2)); /* Open a master pseudo terminal and return its file descriptor. */ extern int getpt (void); #endif # 946 "/usr/include/stdlib.h" 3 4 #ifdef __USE_BSD /* Put the 1 minute, 5 minute and 15 minute load averages into the first NELEM elements of LOADAVG. Return the number written (never more than three, but may be less than NELEM), or -1 if an error occurred. */ extern int getloadavg (double __loadavg[], int __nelem) __THROW __nonnull ((1)); #endif # 954 "/usr/include/stdlib.h" 3 4 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 955 "/usr/include/stdlib.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/stdlib-float.h" 1 3 4 /* Floating-point inline functions for stdlib.h. Copyright (C) 2012-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _STDLIB_H # error "Never use directly; include instead." #endif # 22 "/usr/include/x86_64-linux-gnu/bits/stdlib-float.h" 3 4 #ifdef __USE_EXTERN_INLINES __BEGIN_NAMESPACE_STD __extern_inline double __NTH (atof (const char *__nptr)) { return strtod (__nptr, (char **) NULL); } __END_NAMESPACE_STD #endif /* Optimizing and Inlining. */ # 32 "/usr/include/x86_64-linux-gnu/bits/stdlib-float.h" 3 4 # 956 "/usr/include/stdlib.h" 2 3 4 /* Define some macros helping to catch buffer overflows. */ #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 959 "/usr/include/stdlib.h" 3 4 # 960 "/usr/include/stdlib.h" 3 4 #endif # 961 "/usr/include/stdlib.h" 3 4 #ifdef __LDBL_COMPAT #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 962 "/usr/include/stdlib.h" 3 4 # 963 "/usr/include/stdlib.h" 3 4 #endif # 964 "/usr/include/stdlib.h" 3 4 #endif /* don't just need malloc and calloc */ # 966 "/usr/include/stdlib.h" 3 4 #undef __need_malloc_and_calloc __END_DECLS #endif /* stdlib.h */ # 971 "/usr/include/stdlib.h" 3 4 # 4 "test2.cpp" 2 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 4 "test2.cpp" # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 1 3 /*===---- stdint.h - Standard header for sized integer types --------------===*\ * * Copyright (c) 2009 Chris Lattner * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * \*===----------------------------------------------------------------------===*/ #ifndef __CLANG_STDINT_H #define __CLANG_STDINT_H /* If we're hosted, fall back to the system's stdint.h, which might have * additional definitions. */ #if __STDC_HOSTED__ && (1)/*__has_include_next()*/ // C99 7.18.3 Limits of other integer types // // Footnote 219, 220: C++ implementations should define these macros only when // __STDC_LIMIT_MACROS is defined before is included. // // Footnote 222: C++ implementations should define these macros only when // __STDC_CONSTANT_MACROS is defined before is included. // // C++11 [cstdint.syn]p2: // // The macros defined by are provided unconditionally. In particular, // the symbols __STDC_LIMIT_MACROS and __STDC_CONSTANT_MACROS (mentioned in // footnotes 219, 220, and 222 in the C standard) play no role in C++. // // C11 removed the problematic footnotes. // // Work around this inconsistency by always defining those macros in C++ mode, // so that a C library implementation which follows the C99 standard can be // used in C++. # ifdef __cplusplus # if !defined(__STDC_LIMIT_MACROS) # define __STDC_LIMIT_MACROS # define __STDC_LIMIT_MACROS_DEFINED_BY_CLANG # endif # 57 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 # if !defined(__STDC_CONSTANT_MACROS) # define __STDC_CONSTANT_MACROS # define __STDC_CONSTANT_MACROS_DEFINED_BY_CLANG # endif # 61 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 # endif # 62 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 #if 0 /* expanded by -frewrite-includes */ # include_next #endif /* expanded by -frewrite-includes */ # 63 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 # 1 "/usr/include/stdint.h" 1 3 4 /* Copyright (C) 1997-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99: 7.18 Integer types */ #ifndef _STDINT_H #define _STDINT_H 1 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 25 "/usr/include/stdint.h" 3 4 # 26 "/usr/include/stdint.h" 3 4 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 26 "/usr/include/stdint.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/wchar.h" 1 3 4 /* wchar_t type related definitions. Copyright (C) 2000-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _BITS_WCHAR_H #define _BITS_WCHAR_H 1 /* The fallback definitions, for when __WCHAR_MAX__ or __WCHAR_MIN__ are not defined, give the right value and type as long as both int and wchar_t are 32-bit types. Adding L'\0' to a constant value ensures that the type is correct; it is necessary to use (L'\0' + 0) rather than just L'\0' so that the type in C++ is the promoted version of wchar_t rather than the distinct wchar_t type itself. Because wchar_t in preprocessor #if expressions is treated as intmax_t or uintmax_t, the expression (L'\0' - 1) would have the wrong value for WCHAR_MAX in such expressions and so cannot be used to define __WCHAR_MAX in the unsigned case. */ #ifdef __WCHAR_MAX__ # define __WCHAR_MAX __WCHAR_MAX__ #elif L'\0' - 1 > 0 # 36 "/usr/include/x86_64-linux-gnu/bits/wchar.h" 3 4 # define __WCHAR_MAX (0xffffffffu + L'\0') #else # 38 "/usr/include/x86_64-linux-gnu/bits/wchar.h" 3 4 # define __WCHAR_MAX (0x7fffffff + L'\0') #endif # 40 "/usr/include/x86_64-linux-gnu/bits/wchar.h" 3 4 #ifdef __WCHAR_MIN__ # define __WCHAR_MIN __WCHAR_MIN__ #elif L'\0' - 1 > 0 # 44 "/usr/include/x86_64-linux-gnu/bits/wchar.h" 3 4 # define __WCHAR_MIN (L'\0' + 0) #else # 46 "/usr/include/x86_64-linux-gnu/bits/wchar.h" 3 4 # define __WCHAR_MIN (-__WCHAR_MAX - 1) #endif # 48 "/usr/include/x86_64-linux-gnu/bits/wchar.h" 3 4 #endif /* bits/wchar.h */ # 50 "/usr/include/x86_64-linux-gnu/bits/wchar.h" 3 4 # 27 "/usr/include/stdint.h" 2 3 4 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 27 "/usr/include/stdint.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4 /* Determine the wordsize from the preprocessor defines. */ #if defined __x86_64__ && !defined __ILP32__ # define __WORDSIZE 64 #else # 6 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 3 4 # define __WORDSIZE 32 #endif # 8 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 3 4 #ifdef __x86_64__ # define __WORDSIZE_TIME64_COMPAT32 1 /* Both x86-64 and x32 use the 64-bit system call interface. */ # define __SYSCALL_WORDSIZE 64 #endif # 14 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 3 4 # 28 "/usr/include/stdint.h" 2 3 4 /* Exact integral types. */ /* Signed. */ /* There is some amount of overlap with as known by inet code */ #ifndef __int8_t_defined # define __int8_t_defined typedef signed char int8_t; typedef short int int16_t; typedef int int32_t; # if __WORDSIZE == 64 typedef long int int64_t; # else # 42 "/usr/include/stdint.h" 3 4 __extension__ typedef long long int int64_t; # endif # 45 "/usr/include/stdint.h" 3 4 #endif # 46 "/usr/include/stdint.h" 3 4 /* Unsigned. */ typedef unsigned char uint8_t; typedef unsigned short int uint16_t; #ifndef __uint32_t_defined typedef unsigned int uint32_t; # define __uint32_t_defined #endif # 54 "/usr/include/stdint.h" 3 4 #if __WORDSIZE == 64 typedef unsigned long int uint64_t; #else # 57 "/usr/include/stdint.h" 3 4 __extension__ typedef unsigned long long int uint64_t; #endif # 60 "/usr/include/stdint.h" 3 4 /* Small types. */ /* Signed. */ typedef signed char int_least8_t; typedef short int int_least16_t; typedef int int_least32_t; #if __WORDSIZE == 64 typedef long int int_least64_t; #else # 71 "/usr/include/stdint.h" 3 4 __extension__ typedef long long int int_least64_t; #endif # 74 "/usr/include/stdint.h" 3 4 /* Unsigned. */ typedef unsigned char uint_least8_t; typedef unsigned short int uint_least16_t; typedef unsigned int uint_least32_t; #if __WORDSIZE == 64 typedef unsigned long int uint_least64_t; #else # 82 "/usr/include/stdint.h" 3 4 __extension__ typedef unsigned long long int uint_least64_t; #endif # 85 "/usr/include/stdint.h" 3 4 /* Fast types. */ /* Signed. */ typedef signed char int_fast8_t; #if __WORDSIZE == 64 typedef long int int_fast16_t; typedef long int int_fast32_t; typedef long int int_fast64_t; #else # 96 "/usr/include/stdint.h" 3 4 typedef int int_fast16_t; typedef int int_fast32_t; __extension__ typedef long long int int_fast64_t; #endif # 101 "/usr/include/stdint.h" 3 4 /* Unsigned. */ typedef unsigned char uint_fast8_t; #if __WORDSIZE == 64 typedef unsigned long int uint_fast16_t; typedef unsigned long int uint_fast32_t; typedef unsigned long int uint_fast64_t; #else # 109 "/usr/include/stdint.h" 3 4 typedef unsigned int uint_fast16_t; typedef unsigned int uint_fast32_t; __extension__ typedef unsigned long long int uint_fast64_t; #endif # 114 "/usr/include/stdint.h" 3 4 /* Types for `void *' pointers. */ #if __WORDSIZE == 64 # ifndef __intptr_t_defined typedef long int intptr_t; # define __intptr_t_defined # endif # 122 "/usr/include/stdint.h" 3 4 typedef unsigned long int uintptr_t; #else # 124 "/usr/include/stdint.h" 3 4 # ifndef __intptr_t_defined typedef int intptr_t; # define __intptr_t_defined # endif # 128 "/usr/include/stdint.h" 3 4 typedef unsigned int uintptr_t; #endif # 130 "/usr/include/stdint.h" 3 4 /* Largest integral types. */ #if __WORDSIZE == 64 typedef long int intmax_t; typedef unsigned long int uintmax_t; #else # 137 "/usr/include/stdint.h" 3 4 __extension__ typedef long long int intmax_t; __extension__ typedef unsigned long long int uintmax_t; #endif # 142 "/usr/include/stdint.h" 3 4 # if __WORDSIZE == 64 # define __INT64_C(c) c ## L # define __UINT64_C(c) c ## UL # else # 148 "/usr/include/stdint.h" 3 4 # define __INT64_C(c) c ## LL # define __UINT64_C(c) c ## ULL # endif # 151 "/usr/include/stdint.h" 3 4 /* Limits of integral types. */ /* Minimum of signed integral types. */ # define INT8_MIN (-128) # define INT16_MIN (-32767-1) # define INT32_MIN (-2147483647-1) # define INT64_MIN (-__INT64_C(9223372036854775807)-1) /* Maximum of signed integral types. */ # define INT8_MAX (127) # define INT16_MAX (32767) # define INT32_MAX (2147483647) # define INT64_MAX (__INT64_C(9223372036854775807)) /* Maximum of unsigned integral types. */ # define UINT8_MAX (255) # define UINT16_MAX (65535) # define UINT32_MAX (4294967295U) # define UINT64_MAX (__UINT64_C(18446744073709551615)) /* Minimum of signed integral types having a minimum size. */ # define INT_LEAST8_MIN (-128) # define INT_LEAST16_MIN (-32767-1) # define INT_LEAST32_MIN (-2147483647-1) # define INT_LEAST64_MIN (-__INT64_C(9223372036854775807)-1) /* Maximum of signed integral types having a minimum size. */ # define INT_LEAST8_MAX (127) # define INT_LEAST16_MAX (32767) # define INT_LEAST32_MAX (2147483647) # define INT_LEAST64_MAX (__INT64_C(9223372036854775807)) /* Maximum of unsigned integral types having a minimum size. */ # define UINT_LEAST8_MAX (255) # define UINT_LEAST16_MAX (65535) # define UINT_LEAST32_MAX (4294967295U) # define UINT_LEAST64_MAX (__UINT64_C(18446744073709551615)) /* Minimum of fast signed integral types having a minimum size. */ # define INT_FAST8_MIN (-128) # if __WORDSIZE == 64 # define INT_FAST16_MIN (-9223372036854775807L-1) # define INT_FAST32_MIN (-9223372036854775807L-1) # else # 196 "/usr/include/stdint.h" 3 4 # define INT_FAST16_MIN (-2147483647-1) # define INT_FAST32_MIN (-2147483647-1) # endif # 199 "/usr/include/stdint.h" 3 4 # define INT_FAST64_MIN (-__INT64_C(9223372036854775807)-1) /* Maximum of fast signed integral types having a minimum size. */ # define INT_FAST8_MAX (127) # if __WORDSIZE == 64 # define INT_FAST16_MAX (9223372036854775807L) # define INT_FAST32_MAX (9223372036854775807L) # else # 206 "/usr/include/stdint.h" 3 4 # define INT_FAST16_MAX (2147483647) # define INT_FAST32_MAX (2147483647) # endif # 209 "/usr/include/stdint.h" 3 4 # define INT_FAST64_MAX (__INT64_C(9223372036854775807)) /* Maximum of fast unsigned integral types having a minimum size. */ # define UINT_FAST8_MAX (255) # if __WORDSIZE == 64 # define UINT_FAST16_MAX (18446744073709551615UL) # define UINT_FAST32_MAX (18446744073709551615UL) # else # 217 "/usr/include/stdint.h" 3 4 # define UINT_FAST16_MAX (4294967295U) # define UINT_FAST32_MAX (4294967295U) # endif # 220 "/usr/include/stdint.h" 3 4 # define UINT_FAST64_MAX (__UINT64_C(18446744073709551615)) /* Values to test for integral types holding `void *' pointer. */ # if __WORDSIZE == 64 # define INTPTR_MIN (-9223372036854775807L-1) # define INTPTR_MAX (9223372036854775807L) # define UINTPTR_MAX (18446744073709551615UL) # else # 229 "/usr/include/stdint.h" 3 4 # define INTPTR_MIN (-2147483647-1) # define INTPTR_MAX (2147483647) # define UINTPTR_MAX (4294967295U) # endif # 233 "/usr/include/stdint.h" 3 4 /* Minimum for largest signed integral type. */ # define INTMAX_MIN (-__INT64_C(9223372036854775807)-1) /* Maximum for largest signed integral type. */ # define INTMAX_MAX (__INT64_C(9223372036854775807)) /* Maximum for largest unsigned integral type. */ # define UINTMAX_MAX (__UINT64_C(18446744073709551615)) /* Limits of other integer types. */ /* Limits of `ptrdiff_t' type. */ # if __WORDSIZE == 64 # define PTRDIFF_MIN (-9223372036854775807L-1) # define PTRDIFF_MAX (9223372036854775807L) # else # 251 "/usr/include/stdint.h" 3 4 # define PTRDIFF_MIN (-2147483647-1) # define PTRDIFF_MAX (2147483647) # endif # 254 "/usr/include/stdint.h" 3 4 /* Limits of `sig_atomic_t'. */ # define SIG_ATOMIC_MIN (-2147483647-1) # define SIG_ATOMIC_MAX (2147483647) /* Limit of `size_t' type. */ # if __WORDSIZE == 64 # define SIZE_MAX (18446744073709551615UL) # else # 263 "/usr/include/stdint.h" 3 4 # define SIZE_MAX (4294967295U) # endif # 265 "/usr/include/stdint.h" 3 4 /* Limits of `wchar_t'. */ # ifndef WCHAR_MIN /* These constants might also be defined in . */ # define WCHAR_MIN __WCHAR_MIN # define WCHAR_MAX __WCHAR_MAX # endif # 272 "/usr/include/stdint.h" 3 4 /* Limits of `wint_t'. */ # define WINT_MIN (0u) # define WINT_MAX (4294967295u) /* Signed. */ # define INT8_C(c) c # define INT16_C(c) c # define INT32_C(c) c # if __WORDSIZE == 64 # define INT64_C(c) c ## L # else # 284 "/usr/include/stdint.h" 3 4 # define INT64_C(c) c ## LL # endif # 286 "/usr/include/stdint.h" 3 4 /* Unsigned. */ # define UINT8_C(c) c # define UINT16_C(c) c # define UINT32_C(c) c ## U # if __WORDSIZE == 64 # define UINT64_C(c) c ## UL # else # 294 "/usr/include/stdint.h" 3 4 # define UINT64_C(c) c ## ULL # endif # 296 "/usr/include/stdint.h" 3 4 /* Maximal type. */ # if __WORDSIZE == 64 # define INTMAX_C(c) c ## L # define UINTMAX_C(c) c ## UL # else # 302 "/usr/include/stdint.h" 3 4 # define INTMAX_C(c) c ## LL # define UINTMAX_C(c) c ## ULL # endif # 305 "/usr/include/stdint.h" 3 4 #endif /* stdint.h */ # 307 "/usr/include/stdint.h" 3 4 # 64 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 2 3 # ifdef __STDC_LIMIT_MACROS_DEFINED_BY_CLANG # undef __STDC_LIMIT_MACROS # undef __STDC_LIMIT_MACROS_DEFINED_BY_CLANG # endif # 69 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 # ifdef __STDC_CONSTANT_MACROS_DEFINED_BY_CLANG # undef __STDC_CONSTANT_MACROS # undef __STDC_CONSTANT_MACROS_DEFINED_BY_CLANG # endif # 73 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 #else # 75 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 /* C99 7.18.1.1 Exact-width integer types. * C99 7.18.1.2 Minimum-width integer types. * C99 7.18.1.3 Fastest minimum-width integer types. * * The standard requires that exact-width type be defined for 8-, 16-, 32-, and * 64-bit types if they are implemented. Other exact width types are optional. * This implementation defines an exact-width types for every integer width * that is represented in the standard integer types. * * The standard also requires minimum-width types be defined for 8-, 16-, 32-, * and 64-bit widths regardless of whether there are corresponding exact-width * types. * * To accommodate targets that are missing types that are exactly 8, 16, 32, or * 64 bits wide, this implementation takes an approach of cascading * redefintions, redefining __int_leastN_t to successively smaller exact-width * types. It is therefore important that the types are defined in order of * descending widths. * * We currently assume that the minimum-width types and the fastest * minimum-width types are the same. This is allowed by the standard, but is * suboptimal. * * In violation of the standard, some targets do not implement a type that is * wide enough to represent all of the required widths (8-, 16-, 32-, 64-bit). * To accommodate these targets, a required minimum-width type is only * defined if there exists an exact-width type of equal or greater width. */ #ifdef __INT64_TYPE__ # ifndef __int8_t_defined /* glibc sys/types.h also defines int64_t*/ typedef __INT64_TYPE__ int64_t; # endif /* __int8_t_defined */ # 109 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 typedef __UINT64_TYPE__ uint64_t; # define __int_least64_t int64_t # define __uint_least64_t uint64_t # define __int_least32_t int64_t # define __uint_least32_t uint64_t # define __int_least16_t int64_t # define __uint_least16_t uint64_t # define __int_least8_t int64_t # define __uint_least8_t uint64_t #endif /* __INT64_TYPE__ */ # 119 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 #ifdef __int_least64_t typedef __int_least64_t int_least64_t; typedef __uint_least64_t uint_least64_t; typedef __int_least64_t int_fast64_t; typedef __uint_least64_t uint_fast64_t; #endif /* __int_least64_t */ # 126 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 #ifdef __INT56_TYPE__ typedef __INT56_TYPE__ int56_t; typedef __UINT56_TYPE__ uint56_t; typedef int56_t int_least56_t; typedef uint56_t uint_least56_t; typedef int56_t int_fast56_t; typedef uint56_t uint_fast56_t; # define __int_least32_t int56_t # define __uint_least32_t uint56_t # define __int_least16_t int56_t # define __uint_least16_t uint56_t # define __int_least8_t int56_t # define __uint_least8_t uint56_t #endif /* __INT56_TYPE__ */ # 141 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 #ifdef __INT48_TYPE__ typedef __INT48_TYPE__ int48_t; typedef __UINT48_TYPE__ uint48_t; typedef int48_t int_least48_t; typedef uint48_t uint_least48_t; typedef int48_t int_fast48_t; typedef uint48_t uint_fast48_t; # define __int_least32_t int48_t # define __uint_least32_t uint48_t # define __int_least16_t int48_t # define __uint_least16_t uint48_t # define __int_least8_t int48_t # define __uint_least8_t uint48_t #endif /* __INT48_TYPE__ */ # 157 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 #ifdef __INT40_TYPE__ typedef __INT40_TYPE__ int40_t; typedef __UINT40_TYPE__ uint40_t; typedef int40_t int_least40_t; typedef uint40_t uint_least40_t; typedef int40_t int_fast40_t; typedef uint40_t uint_fast40_t; # define __int_least32_t int40_t # define __uint_least32_t uint40_t # define __int_least16_t int40_t # define __uint_least16_t uint40_t # define __int_least8_t int40_t # define __uint_least8_t uint40_t #endif /* __INT40_TYPE__ */ # 173 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 #ifdef __INT32_TYPE__ # ifndef __int8_t_defined /* glibc sys/types.h also defines int32_t*/ typedef __INT32_TYPE__ int32_t; # endif /* __int8_t_defined */ # 180 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 # ifndef __uint32_t_defined /* more glibc compatibility */ # define __uint32_t_defined typedef __UINT32_TYPE__ uint32_t; # endif /* __uint32_t_defined */ # 185 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 # define __int_least32_t int32_t # define __uint_least32_t uint32_t # define __int_least16_t int32_t # define __uint_least16_t uint32_t # define __int_least8_t int32_t # define __uint_least8_t uint32_t #endif /* __INT32_TYPE__ */ # 193 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 #ifdef __int_least32_t typedef __int_least32_t int_least32_t; typedef __uint_least32_t uint_least32_t; typedef __int_least32_t int_fast32_t; typedef __uint_least32_t uint_fast32_t; #endif /* __int_least32_t */ # 200 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 #ifdef __INT24_TYPE__ typedef __INT24_TYPE__ int24_t; typedef __UINT24_TYPE__ uint24_t; typedef int24_t int_least24_t; typedef uint24_t uint_least24_t; typedef int24_t int_fast24_t; typedef uint24_t uint_fast24_t; # define __int_least16_t int24_t # define __uint_least16_t uint24_t # define __int_least8_t int24_t # define __uint_least8_t uint24_t #endif /* __INT24_TYPE__ */ # 213 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 #ifdef __INT16_TYPE__ #ifndef __int8_t_defined /* glibc sys/types.h also defines int16_t*/ typedef __INT16_TYPE__ int16_t; #endif /* __int8_t_defined */ # 218 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 typedef __UINT16_TYPE__ uint16_t; # define __int_least16_t int16_t # define __uint_least16_t uint16_t # define __int_least8_t int16_t # define __uint_least8_t uint16_t #endif /* __INT16_TYPE__ */ # 224 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 #ifdef __int_least16_t typedef __int_least16_t int_least16_t; typedef __uint_least16_t uint_least16_t; typedef __int_least16_t int_fast16_t; typedef __uint_least16_t uint_fast16_t; #endif /* __int_least16_t */ # 231 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 #ifdef __INT8_TYPE__ #ifndef __int8_t_defined /* glibc sys/types.h also defines int8_t*/ typedef __INT8_TYPE__ int8_t; #endif /* __int8_t_defined */ # 237 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 typedef __UINT8_TYPE__ uint8_t; # define __int_least8_t int8_t # define __uint_least8_t uint8_t #endif /* __INT8_TYPE__ */ # 241 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 #ifdef __int_least8_t typedef __int_least8_t int_least8_t; typedef __uint_least8_t uint_least8_t; typedef __int_least8_t int_fast8_t; typedef __uint_least8_t uint_fast8_t; #endif /* __int_least8_t */ # 248 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 /* prevent glibc sys/types.h from defining conflicting types */ #ifndef __int8_t_defined # define __int8_t_defined #endif /* __int8_t_defined */ # 253 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 /* C99 7.18.1.4 Integer types capable of holding object pointers. */ #define __stdint_join3(a,b,c) a ## b ## c #ifndef _INTPTR_T #ifndef __intptr_t_defined typedef __INTPTR_TYPE__ intptr_t; #define __intptr_t_defined #define _INTPTR_T #endif # 264 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 #endif # 265 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 #ifndef _UINTPTR_T typedef __UINTPTR_TYPE__ uintptr_t; #define _UINTPTR_T #endif # 270 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 /* C99 7.18.1.5 Greatest-width integer types. */ typedef __INTMAX_TYPE__ intmax_t; typedef __UINTMAX_TYPE__ uintmax_t; /* C99 7.18.4 Macros for minimum-width integer constants. * * The standard requires that integer constant macros be defined for all the * minimum-width types defined above. As 8-, 16-, 32-, and 64-bit minimum-width * types are required, the corresponding integer constant macros are defined * here. This implementation also defines minimum-width types for every other * integer width that the target implements, so corresponding macros are * defined below, too. * * These macros are defined using the same successive-shrinking approach as * the type definitions above. It is likewise important that macros are defined * in order of decending width. * * Note that C++ should not check __STDC_CONSTANT_MACROS here, contrary to the * claims of the C standard (see C++ 18.3.1p2, [cstdint.syn]). */ #define __int_c_join(a, b) a ## b #define __int_c(v, suffix) __int_c_join(v, suffix) #define __uint_c(v, suffix) __int_c_join(v##U, suffix) #ifdef __INT64_TYPE__ # ifdef __INT64_C_SUFFIX__ # define __int64_c_suffix __INT64_C_SUFFIX__ # define __int32_c_suffix __INT64_C_SUFFIX__ # define __int16_c_suffix __INT64_C_SUFFIX__ # define __int8_c_suffix __INT64_C_SUFFIX__ # else # 305 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 # undef __int64_c_suffix # undef __int32_c_suffix # undef __int16_c_suffix # undef __int8_c_suffix # endif /* __INT64_C_SUFFIX__ */ # 310 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 #endif /* __INT64_TYPE__ */ # 311 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 #ifdef __int_least64_t # ifdef __int64_c_suffix # define INT64_C(v) __int_c(v, __int64_c_suffix) # define UINT64_C(v) __uint_c(v, __int64_c_suffix) # else # 317 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 # define INT64_C(v) v # define UINT64_C(v) v ## U # endif /* __int64_c_suffix */ # 320 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 #endif /* __int_least64_t */ # 321 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 #ifdef __INT56_TYPE__ # ifdef __INT56_C_SUFFIX__ # define INT56_C(v) __int_c(v, __INT56_C_SUFFIX__) # define UINT56_C(v) __uint_c(v, __INT56_C_SUFFIX__) # define __int32_c_suffix __INT56_C_SUFFIX__ # define __int16_c_suffix __INT56_C_SUFFIX__ # define __int8_c_suffix __INT56_C_SUFFIX__ # else # 331 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 # define INT56_C(v) v # define UINT56_C(v) v ## U # undef __int32_c_suffix # undef __int16_c_suffix # undef __int8_c_suffix # endif /* __INT56_C_SUFFIX__ */ # 337 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 #endif /* __INT56_TYPE__ */ # 338 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 #ifdef __INT48_TYPE__ # ifdef __INT48_C_SUFFIX__ # define INT48_C(v) __int_c(v, __INT48_C_SUFFIX__) # define UINT48_C(v) __uint_c(v, __INT48_C_SUFFIX__) # define __int32_c_suffix __INT48_C_SUFFIX__ # define __int16_c_suffix __INT48_C_SUFFIX__ # define __int8_c_suffix __INT48_C_SUFFIX__ # else # 348 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 # define INT48_C(v) v # define UINT48_C(v) v ## U # undef __int32_c_suffix # undef __int16_c_suffix # undef __int8_c_suffix # endif /* __INT48_C_SUFFIX__ */ # 354 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 #endif /* __INT48_TYPE__ */ # 355 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 #ifdef __INT40_TYPE__ # ifdef __INT40_C_SUFFIX__ # define INT40_C(v) __int_c(v, __INT40_C_SUFFIX__) # define UINT40_C(v) __uint_c(v, __INT40_C_SUFFIX__) # define __int32_c_suffix __INT40_C_SUFFIX__ # define __int16_c_suffix __INT40_C_SUFFIX__ # define __int8_c_suffix __INT40_C_SUFFIX__ # else # 365 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 # define INT40_C(v) v # define UINT40_C(v) v ## U # undef __int32_c_suffix # undef __int16_c_suffix # undef __int8_c_suffix # endif /* __INT40_C_SUFFIX__ */ # 371 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 #endif /* __INT40_TYPE__ */ # 372 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 #ifdef __INT32_TYPE__ # ifdef __INT32_C_SUFFIX__ # define __int32_c_suffix __INT32_C_SUFFIX__ # define __int16_c_suffix __INT32_C_SUFFIX__ # define __int8_c_suffix __INT32_C_SUFFIX__ #else # 380 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 # undef __int32_c_suffix # undef __int16_c_suffix # undef __int8_c_suffix # endif /* __INT32_C_SUFFIX__ */ # 384 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 #endif /* __INT32_TYPE__ */ # 385 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 #ifdef __int_least32_t # ifdef __int32_c_suffix # define INT32_C(v) __int_c(v, __int32_c_suffix) # define UINT32_C(v) __uint_c(v, __int32_c_suffix) # else # 391 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 # define INT32_C(v) v # define UINT32_C(v) v ## U # endif /* __int32_c_suffix */ # 394 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 #endif /* __int_least32_t */ # 395 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 #ifdef __INT24_TYPE__ # ifdef __INT24_C_SUFFIX__ # define INT24_C(v) __int_c(v, __INT24_C_SUFFIX__) # define UINT24_C(v) __uint_c(v, __INT24_C_SUFFIX__) # define __int16_c_suffix __INT24_C_SUFFIX__ # define __int8_c_suffix __INT24_C_SUFFIX__ # else # 404 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 # define INT24_C(v) v # define UINT24_C(v) v ## U # undef __int16_c_suffix # undef __int8_c_suffix # endif /* __INT24_C_SUFFIX__ */ # 409 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 #endif /* __INT24_TYPE__ */ # 410 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 #ifdef __INT16_TYPE__ # ifdef __INT16_C_SUFFIX__ # define __int16_c_suffix __INT16_C_SUFFIX__ # define __int8_c_suffix __INT16_C_SUFFIX__ #else # 417 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 # undef __int16_c_suffix # undef __int8_c_suffix # endif /* __INT16_C_SUFFIX__ */ # 420 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 #endif /* __INT16_TYPE__ */ # 421 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 #ifdef __int_least16_t # ifdef __int16_c_suffix # define INT16_C(v) __int_c(v, __int16_c_suffix) # define UINT16_C(v) __uint_c(v, __int16_c_suffix) # else # 427 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 # define INT16_C(v) v # define UINT16_C(v) v ## U # endif /* __int16_c_suffix */ # 430 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 #endif /* __int_least16_t */ # 431 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 #ifdef __INT8_TYPE__ # ifdef __INT8_C_SUFFIX__ # define __int8_c_suffix __INT8_C_SUFFIX__ #else # 437 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 # undef __int8_c_suffix # endif /* __INT8_C_SUFFIX__ */ # 439 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 #endif /* __INT8_TYPE__ */ # 440 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 #ifdef __int_least8_t # ifdef __int8_c_suffix # define INT8_C(v) __int_c(v, __int8_c_suffix) # define UINT8_C(v) __uint_c(v, __int8_c_suffix) # else # 446 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 # define INT8_C(v) v # define UINT8_C(v) v ## U # endif /* __int8_c_suffix */ # 449 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 #endif /* __int_least8_t */ # 450 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 /* C99 7.18.2.1 Limits of exact-width integer types. * C99 7.18.2.2 Limits of minimum-width integer types. * C99 7.18.2.3 Limits of fastest minimum-width integer types. * * The presence of limit macros are completely optional in C99. This * implementation defines limits for all of the types (exact- and * minimum-width) that it defines above, using the limits of the minimum-width * type for any types that do not have exact-width representations. * * As in the type definitions, this section takes an approach of * successive-shrinking to determine which limits to use for the standard (8, * 16, 32, 64) bit widths when they don't have exact representations. It is * therefore important that the defintions be kept in order of decending * widths. * * Note that C++ should not check __STDC_LIMIT_MACROS here, contrary to the * claims of the C standard (see C++ 18.3.1p2, [cstdint.syn]). */ #ifdef __INT64_TYPE__ # define INT64_MAX INT64_C( 9223372036854775807) # define INT64_MIN (-INT64_C( 9223372036854775807)-1) # define UINT64_MAX UINT64_C(18446744073709551615) # define __INT_LEAST64_MIN INT64_MIN # define __INT_LEAST64_MAX INT64_MAX # define __UINT_LEAST64_MAX UINT64_MAX # define __INT_LEAST32_MIN INT64_MIN # define __INT_LEAST32_MAX INT64_MAX # define __UINT_LEAST32_MAX UINT64_MAX # define __INT_LEAST16_MIN INT64_MIN # define __INT_LEAST16_MAX INT64_MAX # define __UINT_LEAST16_MAX UINT64_MAX # define __INT_LEAST8_MIN INT64_MIN # define __INT_LEAST8_MAX INT64_MAX # define __UINT_LEAST8_MAX UINT64_MAX #endif /* __INT64_TYPE__ */ # 488 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 #ifdef __INT_LEAST64_MIN # define INT_LEAST64_MIN __INT_LEAST64_MIN # define INT_LEAST64_MAX __INT_LEAST64_MAX # define UINT_LEAST64_MAX __UINT_LEAST64_MAX # define INT_FAST64_MIN __INT_LEAST64_MIN # define INT_FAST64_MAX __INT_LEAST64_MAX # define UINT_FAST64_MAX __UINT_LEAST64_MAX #endif /* __INT_LEAST64_MIN */ # 497 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 #ifdef __INT56_TYPE__ # define INT56_MAX INT56_C(36028797018963967) # define INT56_MIN (-INT56_C(36028797018963967)-1) # define UINT56_MAX UINT56_C(72057594037927935) # define INT_LEAST56_MIN INT56_MIN # define INT_LEAST56_MAX INT56_MAX # define UINT_LEAST56_MAX UINT56_MAX # define INT_FAST56_MIN INT56_MIN # define INT_FAST56_MAX INT56_MAX # define UINT_FAST56_MAX UINT56_MAX # define __INT_LEAST32_MIN INT56_MIN # define __INT_LEAST32_MAX INT56_MAX # define __UINT_LEAST32_MAX UINT56_MAX # define __INT_LEAST16_MIN INT56_MIN # define __INT_LEAST16_MAX INT56_MAX # define __UINT_LEAST16_MAX UINT56_MAX # define __INT_LEAST8_MIN INT56_MIN # define __INT_LEAST8_MAX INT56_MAX # define __UINT_LEAST8_MAX UINT56_MAX #endif /* __INT56_TYPE__ */ # 519 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 #ifdef __INT48_TYPE__ # define INT48_MAX INT48_C(140737488355327) # define INT48_MIN (-INT48_C(140737488355327)-1) # define UINT48_MAX UINT48_C(281474976710655) # define INT_LEAST48_MIN INT48_MIN # define INT_LEAST48_MAX INT48_MAX # define UINT_LEAST48_MAX UINT48_MAX # define INT_FAST48_MIN INT48_MIN # define INT_FAST48_MAX INT48_MAX # define UINT_FAST48_MAX UINT48_MAX # define __INT_LEAST32_MIN INT48_MIN # define __INT_LEAST32_MAX INT48_MAX # define __UINT_LEAST32_MAX UINT48_MAX # define __INT_LEAST16_MIN INT48_MIN # define __INT_LEAST16_MAX INT48_MAX # define __UINT_LEAST16_MAX UINT48_MAX # define __INT_LEAST8_MIN INT48_MIN # define __INT_LEAST8_MAX INT48_MAX # define __UINT_LEAST8_MAX UINT48_MAX #endif /* __INT48_TYPE__ */ # 541 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 #ifdef __INT40_TYPE__ # define INT40_MAX INT40_C(549755813887) # define INT40_MIN (-INT40_C(549755813887)-1) # define UINT40_MAX UINT40_C(1099511627775) # define INT_LEAST40_MIN INT40_MIN # define INT_LEAST40_MAX INT40_MAX # define UINT_LEAST40_MAX UINT40_MAX # define INT_FAST40_MIN INT40_MIN # define INT_FAST40_MAX INT40_MAX # define UINT_FAST40_MAX UINT40_MAX # define __INT_LEAST32_MIN INT40_MIN # define __INT_LEAST32_MAX INT40_MAX # define __UINT_LEAST32_MAX UINT40_MAX # define __INT_LEAST16_MIN INT40_MIN # define __INT_LEAST16_MAX INT40_MAX # define __UINT_LEAST16_MAX UINT40_MAX # define __INT_LEAST8_MIN INT40_MIN # define __INT_LEAST8_MAX INT40_MAX # define __UINT_LEAST8_MAX UINT40_MAX #endif /* __INT40_TYPE__ */ # 563 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 #ifdef __INT32_TYPE__ # define INT32_MAX INT32_C(2147483647) # define INT32_MIN (-INT32_C(2147483647)-1) # define UINT32_MAX UINT32_C(4294967295) # define __INT_LEAST32_MIN INT32_MIN # define __INT_LEAST32_MAX INT32_MAX # define __UINT_LEAST32_MAX UINT32_MAX # define __INT_LEAST16_MIN INT32_MIN # define __INT_LEAST16_MAX INT32_MAX # define __UINT_LEAST16_MAX UINT32_MAX # define __INT_LEAST8_MIN INT32_MIN # define __INT_LEAST8_MAX INT32_MAX # define __UINT_LEAST8_MAX UINT32_MAX #endif /* __INT32_TYPE__ */ # 579 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 #ifdef __INT_LEAST32_MIN # define INT_LEAST32_MIN __INT_LEAST32_MIN # define INT_LEAST32_MAX __INT_LEAST32_MAX # define UINT_LEAST32_MAX __UINT_LEAST32_MAX # define INT_FAST32_MIN __INT_LEAST32_MIN # define INT_FAST32_MAX __INT_LEAST32_MAX # define UINT_FAST32_MAX __UINT_LEAST32_MAX #endif /* __INT_LEAST32_MIN */ # 588 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 #ifdef __INT24_TYPE__ # define INT24_MAX INT24_C(8388607) # define INT24_MIN (-INT24_C(8388607)-1) # define UINT24_MAX UINT24_C(16777215) # define INT_LEAST24_MIN INT24_MIN # define INT_LEAST24_MAX INT24_MAX # define UINT_LEAST24_MAX UINT24_MAX # define INT_FAST24_MIN INT24_MIN # define INT_FAST24_MAX INT24_MAX # define UINT_FAST24_MAX UINT24_MAX # define __INT_LEAST16_MIN INT24_MIN # define __INT_LEAST16_MAX INT24_MAX # define __UINT_LEAST16_MAX UINT24_MAX # define __INT_LEAST8_MIN INT24_MIN # define __INT_LEAST8_MAX INT24_MAX # define __UINT_LEAST8_MAX UINT24_MAX #endif /* __INT24_TYPE__ */ # 607 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 #ifdef __INT16_TYPE__ #define INT16_MAX INT16_C(32767) #define INT16_MIN (-INT16_C(32767)-1) #define UINT16_MAX UINT16_C(65535) # define __INT_LEAST16_MIN INT16_MIN # define __INT_LEAST16_MAX INT16_MAX # define __UINT_LEAST16_MAX UINT16_MAX # define __INT_LEAST8_MIN INT16_MIN # define __INT_LEAST8_MAX INT16_MAX # define __UINT_LEAST8_MAX UINT16_MAX #endif /* __INT16_TYPE__ */ # 620 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 #ifdef __INT_LEAST16_MIN # define INT_LEAST16_MIN __INT_LEAST16_MIN # define INT_LEAST16_MAX __INT_LEAST16_MAX # define UINT_LEAST16_MAX __UINT_LEAST16_MAX # define INT_FAST16_MIN __INT_LEAST16_MIN # define INT_FAST16_MAX __INT_LEAST16_MAX # define UINT_FAST16_MAX __UINT_LEAST16_MAX #endif /* __INT_LEAST16_MIN */ # 629 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 #ifdef __INT8_TYPE__ # define INT8_MAX INT8_C(127) # define INT8_MIN (-INT8_C(127)-1) # define UINT8_MAX UINT8_C(255) # define __INT_LEAST8_MIN INT8_MIN # define __INT_LEAST8_MAX INT8_MAX # define __UINT_LEAST8_MAX UINT8_MAX #endif /* __INT8_TYPE__ */ # 639 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 #ifdef __INT_LEAST8_MIN # define INT_LEAST8_MIN __INT_LEAST8_MIN # define INT_LEAST8_MAX __INT_LEAST8_MAX # define UINT_LEAST8_MAX __UINT_LEAST8_MAX # define INT_FAST8_MIN __INT_LEAST8_MIN # define INT_FAST8_MAX __INT_LEAST8_MAX # define UINT_FAST8_MAX __UINT_LEAST8_MAX #endif /* __INT_LEAST8_MIN */ # 648 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 /* Some utility macros */ #define __INTN_MIN(n) __stdint_join3( INT, n, _MIN) #define __INTN_MAX(n) __stdint_join3( INT, n, _MAX) #define __UINTN_MAX(n) __stdint_join3(UINT, n, _MAX) #define __INTN_C(n, v) __stdint_join3( INT, n, _C(v)) #define __UINTN_C(n, v) __stdint_join3(UINT, n, _C(v)) /* C99 7.18.2.4 Limits of integer types capable of holding object pointers. */ /* C99 7.18.3 Limits of other integer types. */ #define INTPTR_MIN (-__INTPTR_MAX__-1) #define INTPTR_MAX __INTPTR_MAX__ #define UINTPTR_MAX __UINTPTR_MAX__ #define PTRDIFF_MIN (-__PTRDIFF_MAX__-1) #define PTRDIFF_MAX __PTRDIFF_MAX__ #define SIZE_MAX __SIZE_MAX__ /* ISO9899:2011 7.20 (C11 Annex K): Define RSIZE_MAX if __STDC_WANT_LIB_EXT1__ * is enabled. */ #if defined(__STDC_WANT_LIB_EXT1__) && __STDC_WANT_LIB_EXT1__ >= 1 #define RSIZE_MAX (SIZE_MAX >> 1) #endif # 671 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 /* C99 7.18.2.5 Limits of greatest-width integer types. */ #define INTMAX_MIN (-__INTMAX_MAX__-1) #define INTMAX_MAX __INTMAX_MAX__ #define UINTMAX_MAX __UINTMAX_MAX__ /* C99 7.18.3 Limits of other integer types. */ #define SIG_ATOMIC_MIN __INTN_MIN(__SIG_ATOMIC_WIDTH__) #define SIG_ATOMIC_MAX __INTN_MAX(__SIG_ATOMIC_WIDTH__) #ifdef __WINT_UNSIGNED__ # define WINT_MIN __UINTN_C(__WINT_WIDTH__, 0) # define WINT_MAX __UINTN_MAX(__WINT_WIDTH__) #else # 684 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 # define WINT_MIN __INTN_MIN(__WINT_WIDTH__) # define WINT_MAX __INTN_MAX(__WINT_WIDTH__) #endif # 687 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 #ifndef WCHAR_MAX # define WCHAR_MAX __WCHAR_MAX__ #endif # 691 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 #ifndef WCHAR_MIN # if __WCHAR_MAX__ == __INTN_MAX(__WCHAR_WIDTH__) # define WCHAR_MIN __INTN_MIN(__WCHAR_WIDTH__) # else # 695 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 # define WCHAR_MIN __UINTN_C(__WCHAR_WIDTH__, 0) # endif # 697 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 #endif # 698 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 /* 7.18.4.2 Macros for greatest-width integer constants. */ #define INTMAX_C(v) __int_c(v, __INTMAX_C_SUFFIX__) #define UINTMAX_C(v) __int_c(v, __UINTMAX_C_SUFFIX__) #endif /* __STDC_HOSTED__ */ # 704 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 #endif /* __CLANG_STDINT_H */ # 705 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stdint.h" 3 # 5 "test2.cpp" 2 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 5 "test2.cpp" # 1 "/usr/include/time.h" 1 3 4 /* Copyright (C) 1991-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard: 7.23 Date and time */ #ifndef _TIME_H #if (! defined __need_time_t && !defined __need_clock_t && \ ! defined __need_timespec) # define _TIME_H 1 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 27 "/usr/include/time.h" 3 4 # 28 "/usr/include/time.h" 3 4 __BEGIN_DECLS #endif # 32 "/usr/include/time.h" 3 4 #ifdef _TIME_H /* Get size_t and NULL from . */ # define __need_size_t # define __need_NULL #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 37 "/usr/include/time.h" 3 4 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 1 3 4 /*===---- stddef.h - Basic type definitions --------------------------------=== * * Copyright (c) 2008 Eli Friedman * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #if !defined(__STDDEF_H) || defined(__need_ptrdiff_t) || \ defined(__need_size_t) || defined(__need_wchar_t) || \ defined(__need_NULL) || defined(__need_wint_t) #if !defined(__need_ptrdiff_t) && !defined(__need_size_t) && \ !defined(__need_wchar_t) && !defined(__need_NULL) && \ !defined(__need_wint_t) /* Always define miscellaneous pieces when modules are available. */ #if !__has_feature(modules) #define __STDDEF_H #endif # 37 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #define __need_ptrdiff_t #define __need_size_t #define __need_wchar_t #define __need_NULL #define __need_STDDEF_H_misc /* __need_wint_t is intentionally not defined here. */ #endif # 44 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_ptrdiff_t) #if !defined(_PTRDIFF_T) || __has_feature(modules) /* Always define ptrdiff_t when modules are available. */ #if !__has_feature(modules) #define _PTRDIFF_T #endif # 51 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 typedef __PTRDIFF_TYPE__ ptrdiff_t; #endif # 53 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #undef __need_ptrdiff_t #endif /* defined(__need_ptrdiff_t) */ # 55 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_size_t) #if !defined(_SIZE_T) || __has_feature(modules) /* Always define size_t when modules are available. */ #if !__has_feature(modules) #define _SIZE_T #endif # 62 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 typedef __SIZE_TYPE__ size_t; #endif # 64 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #undef __need_size_t #endif /*defined(__need_size_t) */ # 66 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_STDDEF_H_misc) /* ISO9899:2011 7.20 (C11 Annex K): Define rsize_t if __STDC_WANT_LIB_EXT1__ is * enabled. */ #if (defined(__STDC_WANT_LIB_EXT1__) && __STDC_WANT_LIB_EXT1__ >= 1 && \ !defined(_RSIZE_T)) || __has_feature(modules) /* Always define rsize_t when modules are available. */ #if !__has_feature(modules) #define _RSIZE_T #endif # 76 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 typedef __SIZE_TYPE__ rsize_t; #endif # 78 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif /* defined(__need_STDDEF_H_misc) */ # 79 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_wchar_t) #ifndef __cplusplus /* Always define wchar_t when modules are available. */ #if !defined(_WCHAR_T) || __has_feature(modules) #if !__has_feature(modules) #define _WCHAR_T #if defined(_MSC_EXTENSIONS) #define _WCHAR_T_DEFINED #endif # 89 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif # 90 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 typedef __WCHAR_TYPE__ wchar_t; #endif # 92 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif # 93 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #undef __need_wchar_t #endif /* defined(__need_wchar_t) */ # 95 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_NULL) #undef NULL #ifdef __cplusplus # if !defined(__MINGW32__) && !defined(_MSC_VER) # define NULL __null # else # 102 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 # define NULL 0 # endif # 104 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #else # 105 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 # define NULL ((void*)0) #endif # 107 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #ifdef __cplusplus #if defined(_MSC_EXTENSIONS) && defined(_NATIVE_NULLPTR_SUPPORTED) namespace std { typedef decltype(nullptr) nullptr_t; } using ::std::nullptr_t; #endif # 112 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif # 113 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #undef __need_NULL #endif /* defined(__need_NULL) */ # 115 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_STDDEF_H_misc) #if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L #if 0 /* expanded by -frewrite-includes */ #include "__stddef_max_align_t.h" #endif /* expanded by -frewrite-includes */ # 118 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 # 119 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif # 120 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #define offsetof(t, d) __builtin_offsetof(t, d) #undef __need_STDDEF_H_misc #endif /* defined(__need_STDDEF_H_misc) */ # 123 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 /* Some C libraries expect to see a wint_t here. Others (notably MinGW) will use __WINT_TYPE__ directly; accommodate both by requiring __need_wint_t */ #if defined(__need_wint_t) /* Always define wint_t when modules are available. */ #if !defined(_WINT_T) || __has_feature(modules) #if !__has_feature(modules) #define _WINT_T #endif # 132 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 typedef __WINT_TYPE__ wint_t; #endif # 134 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #undef __need_wint_t #endif /* __need_wint_t */ # 136 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif # 138 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 # 38 "/usr/include/time.h" 2 3 4 /* This defines CLOCKS_PER_SEC, which is the number of processor clock ticks per second. */ #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 41 "/usr/include/time.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/time.h" 1 3 4 /* System-dependent timing definitions. Linux version. Copyright (C) 1996-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * Never include this file directly; use instead. */ #if defined __need_timeval || defined __USE_GNU # ifndef _STRUCT_TIMEVAL # define _STRUCT_TIMEVAL 1 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 26 "/usr/include/x86_64-linux-gnu/bits/time.h" 3 4 # 27 "/usr/include/x86_64-linux-gnu/bits/time.h" 3 4 /* A time value that is accurate to the nearest microsecond but also has a range of years. */ struct timeval { __time_t tv_sec; /* Seconds. */ __suseconds_t tv_usec; /* Microseconds. */ }; # endif /* struct timeval */ # 36 "/usr/include/x86_64-linux-gnu/bits/time.h" 3 4 #endif # 37 "/usr/include/x86_64-linux-gnu/bits/time.h" 3 4 #ifndef __need_timeval # ifndef _BITS_TIME_H # define _BITS_TIME_H 1 /* ISO/IEC 9899:1990 7.12.1: The macro `CLOCKS_PER_SEC' is the number per second of the value returned by the `clock' function. */ /* CAE XSH, Issue 4, Version 2: The value of CLOCKS_PER_SEC is required to be 1 million on all XSI-conformant systems. */ # define CLOCKS_PER_SEC 1000000l # if (!defined __STRICT_ANSI__ || defined __USE_POSIX) \ && !defined __USE_XOPEN2K /* Even though CLOCKS_PER_SEC has such a strange value CLK_TCK presents the real value for clock ticks per second for the system. */ #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 54 "/usr/include/x86_64-linux-gnu/bits/time.h" 3 4 # 55 "/usr/include/x86_64-linux-gnu/bits/time.h" 3 4 extern long int __sysconf (int); # define CLK_TCK ((__clock_t) __sysconf (2)) /* 2 is _SC_CLK_TCK */ # endif # 58 "/usr/include/x86_64-linux-gnu/bits/time.h" 3 4 # ifdef __USE_POSIX199309 /* Identifier for system-wide realtime clock. */ # define CLOCK_REALTIME 0 /* Monotonic system-wide clock. */ # define CLOCK_MONOTONIC 1 /* High-resolution timer from the CPU. */ # define CLOCK_PROCESS_CPUTIME_ID 2 /* Thread-specific CPU-time clock. */ # define CLOCK_THREAD_CPUTIME_ID 3 /* Monotonic system-wide clock, not adjusted for frequency scaling. */ # define CLOCK_MONOTONIC_RAW 4 /* Identifier for system-wide realtime clock, updated only on ticks. */ # define CLOCK_REALTIME_COARSE 5 /* Monotonic system-wide clock, updated only on ticks. */ # define CLOCK_MONOTONIC_COARSE 6 /* Monotonic system-wide clock that includes time spent in suspension. */ # define CLOCK_BOOTTIME 7 /* Like CLOCK_REALTIME but also wakes suspended system. */ # define CLOCK_REALTIME_ALARM 8 /* Like CLOCK_BOOTTIME but also wakes suspended system. */ # define CLOCK_BOOTTIME_ALARM 9 /* Flag to indicate time is absolute. */ # define TIMER_ABSTIME 1 # endif # 84 "/usr/include/x86_64-linux-gnu/bits/time.h" 3 4 # ifdef __USE_GNU #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 86 "/usr/include/x86_64-linux-gnu/bits/time.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/timex.h" 1 3 4 /* Copyright (C) 1995-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _BITS_TIMEX_H #define _BITS_TIMEX_H 1 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 21 "/usr/include/x86_64-linux-gnu/bits/timex.h" 3 4 # 22 "/usr/include/x86_64-linux-gnu/bits/timex.h" 3 4 /* These definitions from linux/timex.h as of 2.6.30. */ struct timex { unsigned int modes; /* mode selector */ __syscall_slong_t offset; /* time offset (usec) */ __syscall_slong_t freq; /* frequency offset (scaled ppm) */ __syscall_slong_t maxerror; /* maximum error (usec) */ __syscall_slong_t esterror; /* estimated error (usec) */ int status; /* clock command/status */ __syscall_slong_t constant; /* pll time constant */ __syscall_slong_t precision; /* clock precision (usec) (ro) */ __syscall_slong_t tolerance; /* clock frequency tolerance (ppm) (ro) */ struct timeval time; /* (read only) */ __syscall_slong_t tick; /* (modified) usecs between clock ticks */ __syscall_slong_t ppsfreq; /* pps frequency (scaled ppm) (ro) */ __syscall_slong_t jitter; /* pps jitter (us) (ro) */ int shift; /* interval duration (s) (shift) (ro) */ __syscall_slong_t stabil; /* pps stability (scaled ppm) (ro) */ __syscall_slong_t jitcnt; /* jitter limit exceeded (ro) */ __syscall_slong_t calcnt; /* calibration intervals (ro) */ __syscall_slong_t errcnt; /* calibration errors (ro) */ __syscall_slong_t stbcnt; /* stability limit exceeded (ro) */ int tai; /* TAI offset (ro) */ /* ??? */ int :32; int :32; int :32; int :32; int :32; int :32; int :32; int :32; int :32; int :32; int :32; }; /* Mode codes (timex.mode) */ #define ADJ_OFFSET 0x0001 /* time offset */ #define ADJ_FREQUENCY 0x0002 /* frequency offset */ #define ADJ_MAXERROR 0x0004 /* maximum time error */ #define ADJ_ESTERROR 0x0008 /* estimated time error */ #define ADJ_STATUS 0x0010 /* clock status */ #define ADJ_TIMECONST 0x0020 /* pll time constant */ #define ADJ_TAI 0x0080 /* set TAI offset */ #define ADJ_MICRO 0x1000 /* select microsecond resolution */ #define ADJ_NANO 0x2000 /* select nanosecond resolution */ #define ADJ_TICK 0x4000 /* tick value */ #define ADJ_OFFSET_SINGLESHOT 0x8001 /* old-fashioned adjtime */ #define ADJ_OFFSET_SS_READ 0xa001 /* read-only adjtime */ /* xntp 3.4 compatibility names */ #define MOD_OFFSET ADJ_OFFSET #define MOD_FREQUENCY ADJ_FREQUENCY #define MOD_MAXERROR ADJ_MAXERROR #define MOD_ESTERROR ADJ_ESTERROR #define MOD_STATUS ADJ_STATUS #define MOD_TIMECONST ADJ_TIMECONST #define MOD_CLKB ADJ_TICK #define MOD_CLKA ADJ_OFFSET_SINGLESHOT /* 0x8000 in original */ #define MOD_TAI ADJ_TAI #define MOD_MICRO ADJ_MICRO #define MOD_NANO ADJ_NANO /* Status codes (timex.status) */ #define STA_PLL 0x0001 /* enable PLL updates (rw) */ #define STA_PPSFREQ 0x0002 /* enable PPS freq discipline (rw) */ #define STA_PPSTIME 0x0004 /* enable PPS time discipline (rw) */ #define STA_FLL 0x0008 /* select frequency-lock mode (rw) */ #define STA_INS 0x0010 /* insert leap (rw) */ #define STA_DEL 0x0020 /* delete leap (rw) */ #define STA_UNSYNC 0x0040 /* clock unsynchronized (rw) */ #define STA_FREQHOLD 0x0080 /* hold frequency (rw) */ #define STA_PPSSIGNAL 0x0100 /* PPS signal present (ro) */ #define STA_PPSJITTER 0x0200 /* PPS signal jitter exceeded (ro) */ #define STA_PPSWANDER 0x0400 /* PPS signal wander exceeded (ro) */ #define STA_PPSERROR 0x0800 /* PPS signal calibration error (ro) */ #define STA_CLOCKERR 0x1000 /* clock hardware fault (ro) */ #define STA_NANO 0x2000 /* resolution (0 = us, 1 = ns) (ro) */ #define STA_MODE 0x4000 /* mode (0 = PLL, 1 = FLL) (ro) */ #define STA_CLK 0x8000 /* clock source (0 = A, 1 = B) (ro) */ /* Read-only bits */ #define STA_RONLY (STA_PPSSIGNAL | STA_PPSJITTER | STA_PPSWANDER | \ STA_PPSERROR | STA_CLOCKERR | STA_NANO | STA_MODE | STA_CLK) #endif /* bits/timex.h */ # 109 "/usr/include/x86_64-linux-gnu/bits/timex.h" 3 4 # 87 "/usr/include/x86_64-linux-gnu/bits/time.h" 2 3 4 __BEGIN_DECLS /* Tune a POSIX clock. */ extern int clock_adjtime (__clockid_t __clock_id, struct timex *__utx) __THROW; __END_DECLS # endif /* use GNU */ # 95 "/usr/include/x86_64-linux-gnu/bits/time.h" 3 4 # endif /* bits/time.h */ # 97 "/usr/include/x86_64-linux-gnu/bits/time.h" 3 4 #endif # 98 "/usr/include/x86_64-linux-gnu/bits/time.h" 3 4 #undef __need_timeval # 42 "/usr/include/time.h" 2 3 4 /* This is the obsolete POSIX.1-1988 name for the same constant. */ # if !defined __STRICT_ANSI__ && !defined __USE_XOPEN2K # ifndef CLK_TCK # define CLK_TCK CLOCKS_PER_SEC # endif # 48 "/usr/include/time.h" 3 4 # endif # 49 "/usr/include/time.h" 3 4 #endif /* included. */ # 51 "/usr/include/time.h" 3 4 #if !defined __clock_t_defined && (defined _TIME_H || defined __need_clock_t) # define __clock_t_defined 1 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 55 "/usr/include/time.h" 3 4 # 56 "/usr/include/time.h" 3 4 __BEGIN_NAMESPACE_STD /* Returned by `clock'. */ typedef __clock_t clock_t; __END_NAMESPACE_STD #if defined __USE_XOPEN || defined __USE_POSIX || defined __USE_MISC __USING_NAMESPACE_STD(clock_t) #endif # 64 "/usr/include/time.h" 3 4 #endif /* clock_t not defined and or need clock_t. */ # 66 "/usr/include/time.h" 3 4 #undef __need_clock_t #if !defined __time_t_defined && (defined _TIME_H || defined __need_time_t) # define __time_t_defined 1 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 71 "/usr/include/time.h" 3 4 # 72 "/usr/include/time.h" 3 4 __BEGIN_NAMESPACE_STD /* Returned by `time'. */ typedef __time_t time_t; __END_NAMESPACE_STD #if defined __USE_POSIX || defined __USE_MISC || defined __USE_SVID __USING_NAMESPACE_STD(time_t) #endif # 80 "/usr/include/time.h" 3 4 #endif /* time_t not defined and or need time_t. */ # 82 "/usr/include/time.h" 3 4 #undef __need_time_t #if !defined __clockid_t_defined && \ ((defined _TIME_H && defined __USE_POSIX199309) || defined __need_clockid_t) # define __clockid_t_defined 1 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 88 "/usr/include/time.h" 3 4 # 89 "/usr/include/time.h" 3 4 /* Clock ID used in clock and timer functions. */ typedef __clockid_t clockid_t; #endif /* clockid_t not defined and or need clockid_t. */ # 94 "/usr/include/time.h" 3 4 #undef __clockid_time_t #if !defined __timer_t_defined && \ ((defined _TIME_H && defined __USE_POSIX199309) || defined __need_timer_t) # define __timer_t_defined 1 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 100 "/usr/include/time.h" 3 4 # 101 "/usr/include/time.h" 3 4 /* Timer ID returned by `timer_create'. */ typedef __timer_t timer_t; #endif /* timer_t not defined and or need timer_t. */ # 106 "/usr/include/time.h" 3 4 #undef __need_timer_t #if (!defined __timespec_defined \ && ((defined _TIME_H \ && (defined __USE_POSIX199309 || defined __USE_MISC \ || defined __USE_ISOC11)) \ || defined __need_timespec)) # define __timespec_defined 1 #if 0 /* expanded by -frewrite-includes */ # include /* This defines __time_t for us. */ #endif /* expanded by -frewrite-includes */ # 116 "/usr/include/time.h" 3 4 # 117 "/usr/include/time.h" 3 4 /* POSIX.1b structure for a time value. This is like a `struct timeval' but has nanoseconds instead of microseconds. */ struct timespec { __time_t tv_sec; /* Seconds. */ __syscall_slong_t tv_nsec; /* Nanoseconds. */ }; #endif /* timespec not defined and or need timespec. */ # 127 "/usr/include/time.h" 3 4 #undef __need_timespec #ifdef _TIME_H __BEGIN_NAMESPACE_STD /* Used by other time functions. */ struct tm { int tm_sec; /* Seconds. [0-60] (1 leap second) */ int tm_min; /* Minutes. [0-59] */ int tm_hour; /* Hours. [0-23] */ int tm_mday; /* Day. [1-31] */ int tm_mon; /* Month. [0-11] */ int tm_year; /* Year - 1900. */ int tm_wday; /* Day of week. [0-6] */ int tm_yday; /* Days in year.[0-365] */ int tm_isdst; /* DST. [-1/0/1]*/ # ifdef __USE_BSD long int tm_gmtoff; /* Seconds east of UTC. */ const char *tm_zone; /* Timezone abbreviation. */ # else # 149 "/usr/include/time.h" 3 4 long int __tm_gmtoff; /* Seconds east of UTC. */ const char *__tm_zone; /* Timezone abbreviation. */ # endif # 152 "/usr/include/time.h" 3 4 }; __END_NAMESPACE_STD #if defined __USE_XOPEN || defined __USE_POSIX || defined __USE_MISC __USING_NAMESPACE_STD(tm) #endif # 157 "/usr/include/time.h" 3 4 # ifdef __USE_POSIX199309 /* POSIX.1b structure for timer start values and intervals. */ struct itimerspec { struct timespec it_interval; struct timespec it_value; }; /* We can use a simple forward declaration. */ struct sigevent; # endif /* POSIX.1b */ # 171 "/usr/include/time.h" 3 4 # ifdef __USE_XOPEN2K # ifndef __pid_t_defined typedef __pid_t pid_t; # define __pid_t_defined # endif # 177 "/usr/include/time.h" 3 4 # endif # 178 "/usr/include/time.h" 3 4 # ifdef __USE_ISOC11 /* Time base values for timespec_get. */ # define TIME_UTC 1 # endif # 184 "/usr/include/time.h" 3 4 __BEGIN_NAMESPACE_STD /* Time used by the program so far (user time + system time). The result / CLOCKS_PER_SECOND is program time in seconds. */ extern clock_t clock (void) __THROW; /* Return the current time and put it in *TIMER if TIMER is not NULL. */ extern time_t time (time_t *__timer) __THROW; /* Return the difference between TIME1 and TIME0. */ extern double difftime (time_t __time1, time_t __time0) __THROW __attribute__ ((__const__)); /* Return the `time_t' representation of TP and normalize TP. */ extern time_t mktime (struct tm *__tp) __THROW; /* Format TP into S according to FORMAT. Write no more than MAXSIZE characters and return the number of characters written, or 0 if it would exceed MAXSIZE. */ extern size_t strftime (char *__restrict __s, size_t __maxsize, const char *__restrict __format, const struct tm *__restrict __tp) __THROW; __END_NAMESPACE_STD # ifdef __USE_XOPEN /* Parse S according to FORMAT and store binary time information in TP. The return value is a pointer to the first unparsed character in S. */ extern char *strptime (const char *__restrict __s, const char *__restrict __fmt, struct tm *__tp) __THROW; # endif # 217 "/usr/include/time.h" 3 4 # ifdef __USE_XOPEN2K8 /* Similar to the two functions above but take the information from the provided locale and not the global locale. */ #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 221 "/usr/include/time.h" 3 4 # 222 "/usr/include/time.h" 3 4 extern size_t strftime_l (char *__restrict __s, size_t __maxsize, const char *__restrict __format, const struct tm *__restrict __tp, __locale_t __loc) __THROW; # endif # 228 "/usr/include/time.h" 3 4 # ifdef __USE_GNU extern char *strptime_l (const char *__restrict __s, const char *__restrict __fmt, struct tm *__tp, __locale_t __loc) __THROW; # endif # 234 "/usr/include/time.h" 3 4 __BEGIN_NAMESPACE_STD /* Return the `struct tm' representation of *TIMER in Universal Coordinated Time (aka Greenwich Mean Time). */ extern struct tm *gmtime (const time_t *__timer) __THROW; /* Return the `struct tm' representation of *TIMER in the local timezone. */ extern struct tm *localtime (const time_t *__timer) __THROW; __END_NAMESPACE_STD # if defined __USE_POSIX || defined __USE_MISC /* Return the `struct tm' representation of *TIMER in UTC, using *TP to store the result. */ extern struct tm *gmtime_r (const time_t *__restrict __timer, struct tm *__restrict __tp) __THROW; /* Return the `struct tm' representation of *TIMER in local time, using *TP to store the result. */ extern struct tm *localtime_r (const time_t *__restrict __timer, struct tm *__restrict __tp) __THROW; # endif /* POSIX or misc */ # 257 "/usr/include/time.h" 3 4 __BEGIN_NAMESPACE_STD /* Return a string of the form "Day Mon dd hh:mm:ss yyyy\n" that is the representation of TP in this format. */ extern char *asctime (const struct tm *__tp) __THROW; /* Equivalent to `asctime (localtime (timer))'. */ extern char *ctime (const time_t *__timer) __THROW; __END_NAMESPACE_STD # if defined __USE_POSIX || defined __USE_MISC /* Reentrant versions of the above functions. */ /* Return in BUF a string of the form "Day Mon dd hh:mm:ss yyyy\n" that is the representation of TP in this format. */ extern char *asctime_r (const struct tm *__restrict __tp, char *__restrict __buf) __THROW; /* Equivalent to `asctime_r (localtime_r (timer, *TMP*), buf)'. */ extern char *ctime_r (const time_t *__restrict __timer, char *__restrict __buf) __THROW; # endif /* POSIX or misc */ # 279 "/usr/include/time.h" 3 4 /* Defined in localtime.c. */ extern char *__tzname[2]; /* Current timezone names. */ extern int __daylight; /* If daylight-saving time is ever in use. */ extern long int __timezone; /* Seconds west of UTC. */ # ifdef __USE_POSIX /* Same as above. */ extern char *tzname[2]; /* Set time conversion information from the TZ environment variable. If TZ is not defined, a locale-dependent default is used. */ extern void tzset (void) __THROW; # endif # 295 "/usr/include/time.h" 3 4 # if defined __USE_SVID || defined __USE_XOPEN extern int daylight; extern long int timezone; # endif # 300 "/usr/include/time.h" 3 4 # ifdef __USE_SVID /* Set the system time to *WHEN. This call is restricted to the superuser. */ extern int stime (const time_t *__when) __THROW; # endif # 306 "/usr/include/time.h" 3 4 /* Nonzero if YEAR is a leap year (every 4 years, except every 100th isn't, and every 400th is). */ # define __isleap(year) \ ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0)) # ifdef __USE_MISC /* Miscellaneous functions many Unices inherited from the public domain localtime package. These are included only for compatibility. */ /* Like `mktime', but for TP represents Universal Time, not local time. */ extern time_t timegm (struct tm *__tp) __THROW; /* Another name for `mktime'. */ extern time_t timelocal (struct tm *__tp) __THROW; /* Return the number of days in YEAR. */ extern int dysize (int __year) __THROW __attribute__ ((__const__)); # endif # 327 "/usr/include/time.h" 3 4 # ifdef __USE_POSIX199309 /* Pause execution for a number of nanoseconds. This function is a cancellation point and therefore not marked with __THROW. */ extern int nanosleep (const struct timespec *__requested_time, struct timespec *__remaining); /* Get resolution of clock CLOCK_ID. */ extern int clock_getres (clockid_t __clock_id, struct timespec *__res) __THROW; /* Get current value of clock CLOCK_ID and store it in TP. */ extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) __THROW; /* Set clock CLOCK_ID to value TP. */ extern int clock_settime (clockid_t __clock_id, const struct timespec *__tp) __THROW; # ifdef __USE_XOPEN2K /* High-resolution sleep with the specified clock. This function is a cancellation point and therefore not marked with __THROW. */ extern int clock_nanosleep (clockid_t __clock_id, int __flags, const struct timespec *__req, struct timespec *__rem); /* Return clock ID for CPU-time clock. */ extern int clock_getcpuclockid (pid_t __pid, clockid_t *__clock_id) __THROW; # endif # 360 "/usr/include/time.h" 3 4 /* Create new per-process timer using CLOCK_ID. */ extern int timer_create (clockid_t __clock_id, struct sigevent *__restrict __evp, timer_t *__restrict __timerid) __THROW; /* Delete timer TIMERID. */ extern int timer_delete (timer_t __timerid) __THROW; /* Set timer TIMERID to VALUE, returning old value in OVALUE. */ extern int timer_settime (timer_t __timerid, int __flags, const struct itimerspec *__restrict __value, struct itimerspec *__restrict __ovalue) __THROW; /* Get current value of timer TIMERID and store it in VALUE. */ extern int timer_gettime (timer_t __timerid, struct itimerspec *__value) __THROW; /* Get expiration overrun for timer TIMERID. */ extern int timer_getoverrun (timer_t __timerid) __THROW; # endif # 382 "/usr/include/time.h" 3 4 # ifdef __USE_ISOC11 /* Set TS to calendar time based in time base BASE. */ extern int timespec_get (struct timespec *__ts, int __base) __THROW __nonnull ((1)); # endif # 389 "/usr/include/time.h" 3 4 # ifdef __USE_XOPEN_EXTENDED /* Set to one of the following values to indicate an error. 1 the DATEMSK environment variable is null or undefined, 2 the template file cannot be opened for reading, 3 failed to get file status information, 4 the template file is not a regular file, 5 an error is encountered while reading the template file, 6 memory allication failed (not enough memory available), 7 there is no line in the template that matches the input, 8 invalid input specification Example: February 31 or a time is specified that can not be represented in a time_t (representing the time in seconds since 00:00:00 UTC, January 1, 1970) */ extern int getdate_err; /* Parse the given string as a date specification and return a value representing the value. The templates from the file identified by the environment variable DATEMSK are used. In case of an error `getdate_err' is set. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct tm *getdate (const char *__string); # endif # 414 "/usr/include/time.h" 3 4 # ifdef __USE_GNU /* Since `getdate' is not reentrant because of the use of `getdate_err' and the static buffer to return the result in, we provide a thread-safe variant. The functionality is the same. The result is returned in the buffer pointed to by RESBUFP and in case of an error the return value is != 0 with the same values as given above for `getdate_err'. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int getdate_r (const char *__restrict __string, struct tm *__restrict __resbufp); # endif # 429 "/usr/include/time.h" 3 4 __END_DECLS #endif /* included. */ # 433 "/usr/include/time.h" 3 4 #endif /* not already included. */ # 435 "/usr/include/time.h" 3 4 # 6 "test2.cpp" 2 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 6 "test2.cpp" # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/vector" 1 3 // -*- C++ -*- // Copyright (C) 2001-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /* * * Copyright (c) 1994 * Hewlett-Packard Company * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Hewlett-Packard Company makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. * * * Copyright (c) 1996 * Silicon Graphics Computer Systems, Inc. * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Silicon Graphics makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. */ /** @file include/vector * This is a Standard C++ Library header. */ #ifndef _GLIBCXX_VECTOR #define _GLIBCXX_VECTOR 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 59 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/vector" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 60 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/vector" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algobase.h" 1 3 // Core algorithmic facilities -*- C++ -*- // Copyright (C) 2001-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /* * * Copyright (c) 1994 * Hewlett-Packard Company * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Hewlett-Packard Company makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. * * * Copyright (c) 1996-1998 * Silicon Graphics Computer Systems, Inc. * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Silicon Graphics makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. */ /** @file bits/stl_algobase.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{algorithm} */ #ifndef _STL_ALGOBASE_H #define _STL_ALGOBASE_H 1 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 59 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algobase.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 1 3 // Predefined symbols and macros -*- C++ -*- // Copyright (C) 1997-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file bits/c++config.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{iosfwd} */ #ifndef _GLIBCXX_CXX_CONFIG_H #define _GLIBCXX_CXX_CONFIG_H 1 // The current version of the C++ library in compressed ISO date format. #define __GLIBCXX__ 20160904 // Macros for various attributes. // _GLIBCXX_PURE // _GLIBCXX_CONST // _GLIBCXX_NORETURN // _GLIBCXX_NOTHROW // _GLIBCXX_VISIBILITY #ifndef _GLIBCXX_PURE # define _GLIBCXX_PURE __attribute__ ((__pure__)) #endif # 45 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #ifndef _GLIBCXX_CONST # define _GLIBCXX_CONST __attribute__ ((__const__)) #endif # 49 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #ifndef _GLIBCXX_NORETURN # define _GLIBCXX_NORETURN __attribute__ ((__noreturn__)) #endif # 53 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 // See below for C++ #ifndef _GLIBCXX_NOTHROW # ifndef __cplusplus # define _GLIBCXX_NOTHROW __attribute__((__nothrow__)) # endif # 59 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #endif # 60 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 // Macros for visibility attributes. // _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY // _GLIBCXX_VISIBILITY # define _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY 1 #if _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY # define _GLIBCXX_VISIBILITY(V) __attribute__ ((__visibility__ (#V))) #else # 69 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 // If this is not supplied by the OS-specific or CPU-specific // headers included below, it will be defined to an empty default. # define _GLIBCXX_VISIBILITY(V) _GLIBCXX_PSEUDO_VISIBILITY(V) #endif # 73 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 // Macros for deprecated attributes. // _GLIBCXX_USE_DEPRECATED // _GLIBCXX_DEPRECATED #ifndef _GLIBCXX_USE_DEPRECATED # define _GLIBCXX_USE_DEPRECATED 1 #endif # 80 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined(__DEPRECATED) && (__cplusplus >= 201103L) # define _GLIBCXX_DEPRECATED __attribute__ ((__deprecated__)) #else # 84 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 # define _GLIBCXX_DEPRECATED #endif # 86 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 // Macros for ABI tag attributes. #ifndef _GLIBCXX_ABI_TAG_CXX11 # define _GLIBCXX_ABI_TAG_CXX11 __attribute ((__abi_tag__ ("cxx11"))) #endif # 91 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if __cplusplus // Macro for constexpr, to support in mixed 03/0x mode. #ifndef _GLIBCXX_CONSTEXPR # if __cplusplus >= 201103L # define _GLIBCXX_CONSTEXPR constexpr # define _GLIBCXX_USE_CONSTEXPR constexpr # else # 101 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 # define _GLIBCXX_CONSTEXPR # define _GLIBCXX_USE_CONSTEXPR const # endif # 104 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #endif # 105 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #ifndef _GLIBCXX14_CONSTEXPR # if __cplusplus >= 201402L # define _GLIBCXX14_CONSTEXPR constexpr # else # 110 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 # define _GLIBCXX14_CONSTEXPR # endif # 112 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #endif # 113 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 // Macro for noexcept, to support in mixed 03/0x mode. #ifndef _GLIBCXX_NOEXCEPT # if __cplusplus >= 201103L # define _GLIBCXX_NOEXCEPT noexcept # define _GLIBCXX_USE_NOEXCEPT noexcept # define _GLIBCXX_THROW(_EXC) # else # 121 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 # define _GLIBCXX_NOEXCEPT # define _GLIBCXX_USE_NOEXCEPT throw() # define _GLIBCXX_THROW(_EXC) throw(_EXC) # endif # 125 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #endif # 126 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #ifndef _GLIBCXX_NOTHROW # define _GLIBCXX_NOTHROW _GLIBCXX_USE_NOEXCEPT #endif # 130 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #ifndef _GLIBCXX_THROW_OR_ABORT # if __cpp_exceptions # define _GLIBCXX_THROW_OR_ABORT(_EXC) (throw (_EXC)) # else # 135 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 # define _GLIBCXX_THROW_OR_ABORT(_EXC) (__builtin_abort()) # endif # 137 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #endif # 138 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 // Macro for extern template, ie controling template linkage via use // of extern keyword on template declaration. As documented in the g++ // manual, it inhibits all implicit instantiations and is used // throughout the library to avoid multiple weak definitions for // required types that are already explicitly instantiated in the // library binary. This substantially reduces the binary size of // resulting executables. // Special case: _GLIBCXX_EXTERN_TEMPLATE == -1 disallows extern // templates only in basic_string, thus activating its debug-mode // checks even at -O0. # define _GLIBCXX_EXTERN_TEMPLATE 1 /* Outline of libstdc++ namespaces. namespace std { namespace __debug { } namespace __parallel { } namespace __profile { } namespace __cxx1998 { } namespace __detail { } namespace rel_ops { } namespace tr1 { namespace placeholders { } namespace regex_constants { } namespace __detail { } } namespace tr2 { } namespace decimal { } namespace chrono { } namespace placeholders { } namespace regex_constants { } namespace this_thread { } namespace experimental { } } namespace abi { } namespace __gnu_cxx { namespace __detail { } } For full details see: http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/namespaces.html */ namespace std { typedef __SIZE_TYPE__ size_t; typedef __PTRDIFF_TYPE__ ptrdiff_t; #if __cplusplus >= 201103L typedef decltype(nullptr) nullptr_t; #endif # 202 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 } # define _GLIBCXX_USE_DUAL_ABI 0 #if ! _GLIBCXX_USE_DUAL_ABI // Ignore any pre-defined value of _GLIBCXX_USE_CXX11_ABI # undef _GLIBCXX_USE_CXX11_ABI #endif # 210 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #ifndef _GLIBCXX_USE_CXX11_ABI # define _GLIBCXX_USE_CXX11_ABI 0 #endif # 214 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if _GLIBCXX_USE_CXX11_ABI namespace std { inline namespace __cxx11 __attribute__((__abi_tag__ ("cxx11"))) { } } namespace __gnu_cxx { inline namespace __cxx11 __attribute__((__abi_tag__ ("cxx11"))) { } } # define _GLIBCXX_NAMESPACE_CXX11 __cxx11:: # define _GLIBCXX_BEGIN_NAMESPACE_CXX11 namespace __cxx11 { # define _GLIBCXX_END_NAMESPACE_CXX11 } # define _GLIBCXX_DEFAULT_ABI_TAG _GLIBCXX_ABI_TAG_CXX11 #else # 229 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 # define _GLIBCXX_NAMESPACE_CXX11 # define _GLIBCXX_BEGIN_NAMESPACE_CXX11 # define _GLIBCXX_END_NAMESPACE_CXX11 # define _GLIBCXX_DEFAULT_ABI_TAG #endif # 234 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 // Defined if inline namespaces are used for versioning. # define _GLIBCXX_INLINE_VERSION 0 // Inline namespace for symbol versioning. #if _GLIBCXX_INLINE_VERSION namespace std { inline namespace __7 { } namespace rel_ops { inline namespace __7 { } } namespace tr1 { inline namespace __7 { } namespace placeholders { inline namespace __7 { } } namespace regex_constants { inline namespace __7 { } } namespace __detail { inline namespace __7 { } } } namespace tr2 { inline namespace __7 { } } namespace decimal { inline namespace __7 { } } namespace chrono { inline namespace __7 { } } namespace placeholders { inline namespace __7 { } } namespace regex_constants { inline namespace __7 { } } namespace this_thread { inline namespace __7 { } } namespace experimental { inline namespace __7 { } } namespace __detail { inline namespace __7 { } } } namespace __gnu_cxx { inline namespace __7 { } namespace __detail { inline namespace __7 { } } } # define _GLIBCXX_BEGIN_NAMESPACE_VERSION namespace __7 { # define _GLIBCXX_END_NAMESPACE_VERSION } #else # 279 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 # define _GLIBCXX_BEGIN_NAMESPACE_VERSION # define _GLIBCXX_END_NAMESPACE_VERSION #endif # 282 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 // Inline namespaces for special modes: debug, parallel, profile. #if defined(_GLIBCXX_DEBUG) || defined(_GLIBCXX_PARALLEL) \ || defined(_GLIBCXX_PROFILE) namespace std { // Non-inline namespace for components replaced by alternates in active mode. namespace __cxx1998 { # if _GLIBCXX_INLINE_VERSION inline namespace __7 { } # endif # 295 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 # if _GLIBCXX_USE_CXX11_ABI inline namespace __cxx11 __attribute__((__abi_tag__ ("cxx11"))) { } # endif # 299 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 } // Inline namespace for debug mode. # ifdef _GLIBCXX_DEBUG inline namespace __debug { } # endif # 305 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 // Inline namespaces for parallel mode. # ifdef _GLIBCXX_PARALLEL inline namespace __parallel { } # endif # 310 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 // Inline namespaces for profile mode # ifdef _GLIBCXX_PROFILE inline namespace __profile { } # endif # 315 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 } // Check for invalid usage and unsupported mixed-mode use. # if defined(_GLIBCXX_DEBUG) && defined(_GLIBCXX_PARALLEL) # error illegal use of multiple inlined namespaces # endif # 321 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 # if defined(_GLIBCXX_PROFILE) && defined(_GLIBCXX_DEBUG) # error illegal use of multiple inlined namespaces # endif # 324 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 # if defined(_GLIBCXX_PROFILE) && defined(_GLIBCXX_PARALLEL) # error illegal use of multiple inlined namespaces # endif # 327 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 // Check for invalid use due to lack for weak symbols. # if __NO_INLINE__ && !__GXX_WEAK__ # warning currently using inlined namespace mode which may fail \ without inlining due to lack of weak symbols # endif # 333 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #endif # 334 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 // Macros for namespace scope. Either namespace std:: or the name // of some nested namespace within it corresponding to the active mode. // _GLIBCXX_STD_A // _GLIBCXX_STD_C // // Macros for opening/closing conditional namespaces. // _GLIBCXX_BEGIN_NAMESPACE_ALGO // _GLIBCXX_END_NAMESPACE_ALGO // _GLIBCXX_BEGIN_NAMESPACE_CONTAINER // _GLIBCXX_END_NAMESPACE_CONTAINER #if defined(_GLIBCXX_DEBUG) || defined(_GLIBCXX_PROFILE) # define _GLIBCXX_STD_C __cxx1998 # define _GLIBCXX_BEGIN_NAMESPACE_CONTAINER \ namespace _GLIBCXX_STD_C { _GLIBCXX_BEGIN_NAMESPACE_VERSION # define _GLIBCXX_END_NAMESPACE_CONTAINER \ _GLIBCXX_END_NAMESPACE_VERSION } # undef _GLIBCXX_EXTERN_TEMPLATE # define _GLIBCXX_EXTERN_TEMPLATE -1 #endif # 354 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #ifdef _GLIBCXX_PARALLEL # define _GLIBCXX_STD_A __cxx1998 # define _GLIBCXX_BEGIN_NAMESPACE_ALGO \ namespace _GLIBCXX_STD_A { _GLIBCXX_BEGIN_NAMESPACE_VERSION # define _GLIBCXX_END_NAMESPACE_ALGO \ _GLIBCXX_END_NAMESPACE_VERSION } #endif # 362 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #ifndef _GLIBCXX_STD_A # define _GLIBCXX_STD_A std #endif # 366 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #ifndef _GLIBCXX_STD_C # define _GLIBCXX_STD_C std #endif # 370 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #ifndef _GLIBCXX_BEGIN_NAMESPACE_ALGO # define _GLIBCXX_BEGIN_NAMESPACE_ALGO #endif # 374 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #ifndef _GLIBCXX_END_NAMESPACE_ALGO # define _GLIBCXX_END_NAMESPACE_ALGO #endif # 378 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #ifndef _GLIBCXX_BEGIN_NAMESPACE_CONTAINER # define _GLIBCXX_BEGIN_NAMESPACE_CONTAINER #endif # 382 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #ifndef _GLIBCXX_END_NAMESPACE_CONTAINER # define _GLIBCXX_END_NAMESPACE_CONTAINER #endif # 386 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 // GLIBCXX_ABI Deprecated // Define if compatibility should be provided for -mlong-double-64. #undef _GLIBCXX_LONG_DOUBLE_COMPAT // Inline namespace for long double 128 mode. #if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__ namespace std { inline namespace __gnu_cxx_ldbl128 { } } # define _GLIBCXX_NAMESPACE_LDBL __gnu_cxx_ldbl128:: # define _GLIBCXX_BEGIN_NAMESPACE_LDBL namespace __gnu_cxx_ldbl128 { # define _GLIBCXX_END_NAMESPACE_LDBL } #else # 401 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 # define _GLIBCXX_NAMESPACE_LDBL # define _GLIBCXX_BEGIN_NAMESPACE_LDBL # define _GLIBCXX_END_NAMESPACE_LDBL #endif # 405 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if _GLIBCXX_USE_CXX11_ABI # define _GLIBCXX_NAMESPACE_LDBL_OR_CXX11 _GLIBCXX_NAMESPACE_CXX11 # define _GLIBCXX_BEGIN_NAMESPACE_LDBL_OR_CXX11 _GLIBCXX_BEGIN_NAMESPACE_CXX11 # define _GLIBCXX_END_NAMESPACE_LDBL_OR_CXX11 _GLIBCXX_END_NAMESPACE_CXX11 #else # 410 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 # define _GLIBCXX_NAMESPACE_LDBL_OR_CXX11 _GLIBCXX_NAMESPACE_LDBL # define _GLIBCXX_BEGIN_NAMESPACE_LDBL_OR_CXX11 _GLIBCXX_BEGIN_NAMESPACE_LDBL # define _GLIBCXX_END_NAMESPACE_LDBL_OR_CXX11 _GLIBCXX_END_NAMESPACE_LDBL #endif # 414 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 // Assert. #if !defined(_GLIBCXX_DEBUG) && !defined(_GLIBCXX_PARALLEL) # define __glibcxx_assert(_Condition) #else # 419 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 namespace std { // Avoid the use of assert, because we're trying to keep the // include out of the mix. inline void __replacement_assert(const char* __file, int __line, const char* __function, const char* __condition) { __builtin_printf("%s:%d: %s: Assertion '%s' failed.\n", __file, __line, __function, __condition); __builtin_abort(); } } #define __glibcxx_assert(_Condition) \ do \ { \ if (! (_Condition)) \ std::__replacement_assert(__FILE__, __LINE__, __PRETTY_FUNCTION__, \ #_Condition); \ } while (false) #endif # 440 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 // Macros for race detectors. // _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(A) and // _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(A) should be used to explain // atomic (lock-free) synchronization to race detectors: // the race detector will infer a happens-before arc from the former to the // latter when they share the same argument pointer. // // The most frequent use case for these macros (and the only case in the // current implementation of the library) is atomic reference counting: // void _M_remove_reference() // { // _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(&this->_M_refcount); // if (__gnu_cxx::__exchange_and_add_dispatch(&this->_M_refcount, -1) <= 0) // { // _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(&this->_M_refcount); // _M_destroy(__a); // } // } // The annotations in this example tell the race detector that all memory // accesses occurred when the refcount was positive do not race with // memory accesses which occurred after the refcount became zero. #ifndef _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE # define _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(A) #endif # 465 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #ifndef _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER # define _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(A) #endif # 468 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 // Macros for C linkage: define extern "C" linkage only when using C++. # define _GLIBCXX_BEGIN_EXTERN_C extern "C" { # define _GLIBCXX_END_EXTERN_C } #else // !__cplusplus # 474 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 # define _GLIBCXX_BEGIN_EXTERN_C # define _GLIBCXX_END_EXTERN_C #endif # 477 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 // First includes. // Pick up any OS-specific definitions. #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 482 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/os_defines.h" 1 3 // Specific definitions for GNU/Linux -*- C++ -*- // Copyright (C) 2000-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file bits/os_defines.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{iosfwd} */ #ifndef _GLIBCXX_OS_DEFINES #define _GLIBCXX_OS_DEFINES 1 // System-specific #define, typedefs, corrections, etc, go here. This // file will come before all others. // This keeps isanum, et al from being propagated as macros. #define __NO_CTYPE 1 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/os_defines.h" 3 # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/os_defines.h" 3 // Provide a declaration for the possibly deprecated gets function, as // glibc 2.15 and later does not declare gets for ISO C11 when // __GNU_SOURCE is defined. #if __GLIBC_PREREQ(2,15) && defined(_GNU_SOURCE) # undef _GLIBCXX_HAVE_GETS #endif # 47 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/os_defines.h" 3 #endif # 49 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/os_defines.h" 3 # 483 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 2 3 // Pick up any CPU-specific definitions. #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 485 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/cpu_defines.h" 1 3 // Specific definitions for generic platforms -*- C++ -*- // Copyright (C) 2005-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file bits/cpu_defines.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{iosfwd} */ #ifndef _GLIBCXX_CPU_DEFINES #define _GLIBCXX_CPU_DEFINES 1 #endif # 34 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/cpu_defines.h" 3 # 486 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 2 3 // If platform uses neither visibility nor psuedo-visibility, // specify empty default for namespace annotation macros. #ifndef _GLIBCXX_PSEUDO_VISIBILITY # define _GLIBCXX_PSEUDO_VISIBILITY(V) #endif # 492 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 // Certain function definitions that are meant to be overridable from // user code are decorated with this macro. For some targets, this // macro causes these definitions to be weak. #ifndef _GLIBCXX_WEAK_DEFINITION # define _GLIBCXX_WEAK_DEFINITION #endif # 499 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 // The remainder of the prewritten config is automatic; all the // user hooks are listed above. // Create a boolean flag to be used to determine if --fast-math is set. #ifdef __FAST_MATH__ # define _GLIBCXX_FAST_MATH 1 #else # 508 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 # define _GLIBCXX_FAST_MATH 0 #endif # 510 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 // This marks string literals in header files to be extracted for eventual // translation. It is primarily used for messages in thrown exceptions; see // src/functexcept.cc. We use __N because the more traditional _N is used // for something else under certain OSes (see BADNAMES). #define __N(msgid) (msgid) // For example, is known to #define min and max as macros... #undef min #undef max // End of prewritten config; the settings discovered at configure time follow. /* config.h. Generated from config.h.in by configure. */ /* config.h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if you have the `acosf' function. */ #define _GLIBCXX_HAVE_ACOSF 1 /* Define to 1 if you have the `acosl' function. */ #define _GLIBCXX_HAVE_ACOSL 1 /* Define to 1 if you have the `asinf' function. */ #define _GLIBCXX_HAVE_ASINF 1 /* Define to 1 if you have the `asinl' function. */ #define _GLIBCXX_HAVE_ASINL 1 /* Define to 1 if the target assembler supports .symver directive. */ #define _GLIBCXX_HAVE_AS_SYMVER_DIRECTIVE 1 /* Define to 1 if you have the `atan2f' function. */ #define _GLIBCXX_HAVE_ATAN2F 1 /* Define to 1 if you have the `atan2l' function. */ #define _GLIBCXX_HAVE_ATAN2L 1 /* Define to 1 if you have the `atanf' function. */ #define _GLIBCXX_HAVE_ATANF 1 /* Define to 1 if you have the `atanl' function. */ #define _GLIBCXX_HAVE_ATANL 1 /* Define to 1 if you have the `at_quick_exit' function. */ #define _GLIBCXX_HAVE_AT_QUICK_EXIT 1 /* Define to 1 if the target assembler supports thread-local storage. */ /* #undef _GLIBCXX_HAVE_CC_TLS */ /* Define to 1 if you have the `ceilf' function. */ #define _GLIBCXX_HAVE_CEILF 1 /* Define to 1 if you have the `ceill' function. */ #define _GLIBCXX_HAVE_CEILL 1 /* Define to 1 if you have the header file. */ #define _GLIBCXX_HAVE_COMPLEX_H 1 /* Define to 1 if you have the `cosf' function. */ #define _GLIBCXX_HAVE_COSF 1 /* Define to 1 if you have the `coshf' function. */ #define _GLIBCXX_HAVE_COSHF 1 /* Define to 1 if you have the `coshl' function. */ #define _GLIBCXX_HAVE_COSHL 1 /* Define to 1 if you have the `cosl' function. */ #define _GLIBCXX_HAVE_COSL 1 /* Define to 1 if you have the header file. */ #define _GLIBCXX_HAVE_DIRENT_H 1 /* Define to 1 if you have the header file. */ #define _GLIBCXX_HAVE_DLFCN_H 1 /* Define if EBADMSG exists. */ #define _GLIBCXX_HAVE_EBADMSG 1 /* Define if ECANCELED exists. */ #define _GLIBCXX_HAVE_ECANCELED 1 /* Define if ECHILD exists. */ #define _GLIBCXX_HAVE_ECHILD 1 /* Define if EIDRM exists. */ #define _GLIBCXX_HAVE_EIDRM 1 /* Define to 1 if you have the header file. */ #define _GLIBCXX_HAVE_ENDIAN_H 1 /* Define if ENODATA exists. */ #define _GLIBCXX_HAVE_ENODATA 1 /* Define if ENOLINK exists. */ #define _GLIBCXX_HAVE_ENOLINK 1 /* Define if ENOSPC exists. */ #define _GLIBCXX_HAVE_ENOSPC 1 /* Define if ENOSR exists. */ #define _GLIBCXX_HAVE_ENOSR 1 /* Define if ENOSTR exists. */ #define _GLIBCXX_HAVE_ENOSTR 1 /* Define if ENOTRECOVERABLE exists. */ #define _GLIBCXX_HAVE_ENOTRECOVERABLE 1 /* Define if ENOTSUP exists. */ #define _GLIBCXX_HAVE_ENOTSUP 1 /* Define if EOVERFLOW exists. */ #define _GLIBCXX_HAVE_EOVERFLOW 1 /* Define if EOWNERDEAD exists. */ #define _GLIBCXX_HAVE_EOWNERDEAD 1 /* Define if EPERM exists. */ #define _GLIBCXX_HAVE_EPERM 1 /* Define if EPROTO exists. */ #define _GLIBCXX_HAVE_EPROTO 1 /* Define if ETIME exists. */ #define _GLIBCXX_HAVE_ETIME 1 /* Define if ETIMEDOUT exists. */ #define _GLIBCXX_HAVE_ETIMEDOUT 1 /* Define if ETXTBSY exists. */ #define _GLIBCXX_HAVE_ETXTBSY 1 /* Define if EWOULDBLOCK exists. */ #define _GLIBCXX_HAVE_EWOULDBLOCK 1 /* Define to 1 if you have the header file. */ #define _GLIBCXX_HAVE_EXECINFO_H 1 /* Define to 1 if you have the `expf' function. */ #define _GLIBCXX_HAVE_EXPF 1 /* Define to 1 if you have the `expl' function. */ #define _GLIBCXX_HAVE_EXPL 1 /* Define to 1 if you have the `fabsf' function. */ #define _GLIBCXX_HAVE_FABSF 1 /* Define to 1 if you have the `fabsl' function. */ #define _GLIBCXX_HAVE_FABSL 1 /* Define to 1 if you have the header file. */ #define _GLIBCXX_HAVE_FCNTL_H 1 /* Define to 1 if you have the header file. */ #define _GLIBCXX_HAVE_FENV_H 1 /* Define to 1 if you have the `finite' function. */ #define _GLIBCXX_HAVE_FINITE 1 /* Define to 1 if you have the `finitef' function. */ #define _GLIBCXX_HAVE_FINITEF 1 /* Define to 1 if you have the `finitel' function. */ #define _GLIBCXX_HAVE_FINITEL 1 /* Define to 1 if you have the header file. */ #define _GLIBCXX_HAVE_FLOAT_H 1 /* Define to 1 if you have the `floorf' function. */ #define _GLIBCXX_HAVE_FLOORF 1 /* Define to 1 if you have the `floorl' function. */ #define _GLIBCXX_HAVE_FLOORL 1 /* Define to 1 if you have the `fmodf' function. */ #define _GLIBCXX_HAVE_FMODF 1 /* Define to 1 if you have the `fmodl' function. */ #define _GLIBCXX_HAVE_FMODL 1 /* Define to 1 if you have the `fpclass' function. */ /* #undef _GLIBCXX_HAVE_FPCLASS */ /* Define to 1 if you have the header file. */ /* #undef _GLIBCXX_HAVE_FP_H */ /* Define to 1 if you have the `frexpf' function. */ #define _GLIBCXX_HAVE_FREXPF 1 /* Define to 1 if you have the `frexpl' function. */ #define _GLIBCXX_HAVE_FREXPL 1 /* Define if _Unwind_GetIPInfo is available. */ #define _GLIBCXX_HAVE_GETIPINFO 1 /* Define if gets is available in . */ #define _GLIBCXX_HAVE_GETS 1 /* Define to 1 if you have the `hypot' function. */ #define _GLIBCXX_HAVE_HYPOT 1 /* Define to 1 if you have the `hypotf' function. */ #define _GLIBCXX_HAVE_HYPOTF 1 /* Define to 1 if you have the `hypotl' function. */ #define _GLIBCXX_HAVE_HYPOTL 1 /* Define if you have the iconv() function. */ #define _GLIBCXX_HAVE_ICONV 1 /* Define to 1 if you have the header file. */ /* #undef _GLIBCXX_HAVE_IEEEFP_H */ /* Define if int64_t is available in . */ #define _GLIBCXX_HAVE_INT64_T 1 /* Define if int64_t is a long. */ #define _GLIBCXX_HAVE_INT64_T_LONG 1 /* Define if int64_t is a long long. */ /* #undef _GLIBCXX_HAVE_INT64_T_LONG_LONG */ /* Define to 1 if you have the header file. */ #define _GLIBCXX_HAVE_INTTYPES_H 1 /* Define to 1 if you have the `isinf' function. */ #define _GLIBCXX_HAVE_ISINF 1 /* Define to 1 if you have the `isinff' function. */ #define _GLIBCXX_HAVE_ISINFF 1 /* Define to 1 if you have the `isinfl' function. */ #define _GLIBCXX_HAVE_ISINFL 1 /* Define to 1 if you have the `isnan' function. */ #define _GLIBCXX_HAVE_ISNAN 1 /* Define to 1 if you have the `isnanf' function. */ #define _GLIBCXX_HAVE_ISNANF 1 /* Define to 1 if you have the `isnanl' function. */ #define _GLIBCXX_HAVE_ISNANL 1 /* Defined if iswblank exists. */ #define _GLIBCXX_HAVE_ISWBLANK 1 /* Define if LC_MESSAGES is available in . */ #define _GLIBCXX_HAVE_LC_MESSAGES 1 /* Define to 1 if you have the `ldexpf' function. */ #define _GLIBCXX_HAVE_LDEXPF 1 /* Define to 1 if you have the `ldexpl' function. */ #define _GLIBCXX_HAVE_LDEXPL 1 /* Define to 1 if you have the header file. */ #define _GLIBCXX_HAVE_LIBINTL_H 1 /* Only used in build directory testsuite_hooks.h. */ #define _GLIBCXX_HAVE_LIMIT_AS 1 /* Only used in build directory testsuite_hooks.h. */ #define _GLIBCXX_HAVE_LIMIT_DATA 1 /* Only used in build directory testsuite_hooks.h. */ #define _GLIBCXX_HAVE_LIMIT_FSIZE 1 /* Only used in build directory testsuite_hooks.h. */ #define _GLIBCXX_HAVE_LIMIT_RSS 1 /* Only used in build directory testsuite_hooks.h. */ #define _GLIBCXX_HAVE_LIMIT_VMEM 0 /* Define if futex syscall is available. */ #define _GLIBCXX_HAVE_LINUX_FUTEX 1 /* Define to 1 if you have the header file. */ #define _GLIBCXX_HAVE_LOCALE_H 1 /* Define to 1 if you have the `log10f' function. */ #define _GLIBCXX_HAVE_LOG10F 1 /* Define to 1 if you have the `log10l' function. */ #define _GLIBCXX_HAVE_LOG10L 1 /* Define to 1 if you have the `logf' function. */ #define _GLIBCXX_HAVE_LOGF 1 /* Define to 1 if you have the `logl' function. */ #define _GLIBCXX_HAVE_LOGL 1 /* Define to 1 if you have the header file. */ /* #undef _GLIBCXX_HAVE_MACHINE_ENDIAN_H */ /* Define to 1 if you have the header file. */ /* #undef _GLIBCXX_HAVE_MACHINE_PARAM_H */ /* Define if mbstate_t exists in wchar.h. */ #define _GLIBCXX_HAVE_MBSTATE_T 1 /* Define to 1 if you have the header file. */ #define _GLIBCXX_HAVE_MEMORY_H 1 /* Define to 1 if you have the `modf' function. */ #define _GLIBCXX_HAVE_MODF 1 /* Define to 1 if you have the `modff' function. */ #define _GLIBCXX_HAVE_MODFF 1 /* Define to 1 if you have the `modfl' function. */ #define _GLIBCXX_HAVE_MODFL 1 /* Define to 1 if you have the header file. */ /* #undef _GLIBCXX_HAVE_NAN_H */ /* Define if poll is available in . */ #define _GLIBCXX_HAVE_POLL 1 /* Define to 1 if you have the `powf' function. */ #define _GLIBCXX_HAVE_POWF 1 /* Define to 1 if you have the `powl' function. */ #define _GLIBCXX_HAVE_POWL 1 /* Define to 1 if you have the `qfpclass' function. */ /* #undef _GLIBCXX_HAVE_QFPCLASS */ /* Define to 1 if you have the `quick_exit' function. */ #define _GLIBCXX_HAVE_QUICK_EXIT 1 /* Define to 1 if you have the `setenv' function. */ #define _GLIBCXX_HAVE_SETENV 1 /* Define to 1 if you have the `sincos' function. */ #define _GLIBCXX_HAVE_SINCOS 1 /* Define to 1 if you have the `sincosf' function. */ #define _GLIBCXX_HAVE_SINCOSF 1 /* Define to 1 if you have the `sincosl' function. */ #define _GLIBCXX_HAVE_SINCOSL 1 /* Define to 1 if you have the `sinf' function. */ #define _GLIBCXX_HAVE_SINF 1 /* Define to 1 if you have the `sinhf' function. */ #define _GLIBCXX_HAVE_SINHF 1 /* Define to 1 if you have the `sinhl' function. */ #define _GLIBCXX_HAVE_SINHL 1 /* Define to 1 if you have the `sinl' function. */ #define _GLIBCXX_HAVE_SINL 1 /* Defined if sleep exists. */ /* #undef _GLIBCXX_HAVE_SLEEP */ /* Define to 1 if you have the `sqrtf' function. */ #define _GLIBCXX_HAVE_SQRTF 1 /* Define to 1 if you have the `sqrtl' function. */ #define _GLIBCXX_HAVE_SQRTL 1 /* Define to 1 if you have the header file. */ #define _GLIBCXX_HAVE_STDALIGN_H 1 /* Define to 1 if you have the header file. */ #define _GLIBCXX_HAVE_STDBOOL_H 1 /* Define to 1 if you have the header file. */ #define _GLIBCXX_HAVE_STDINT_H 1 /* Define to 1 if you have the header file. */ #define _GLIBCXX_HAVE_STDLIB_H 1 /* Define if strerror_l is available in . */ #define _GLIBCXX_HAVE_STRERROR_L 1 /* Define if strerror_r is available in . */ #define _GLIBCXX_HAVE_STRERROR_R 1 /* Define to 1 if you have the header file. */ #define _GLIBCXX_HAVE_STRINGS_H 1 /* Define to 1 if you have the header file. */ #define _GLIBCXX_HAVE_STRING_H 1 /* Define to 1 if you have the `strtof' function. */ #define _GLIBCXX_HAVE_STRTOF 1 /* Define to 1 if you have the `strtold' function. */ #define _GLIBCXX_HAVE_STRTOLD 1 /* Define to 1 if `d_type' is a member of `struct dirent'. */ #define _GLIBCXX_HAVE_STRUCT_DIRENT_D_TYPE 1 /* Define if strxfrm_l is available in . */ #define _GLIBCXX_HAVE_STRXFRM_L 1 /* Define to 1 if the target runtime linker supports binding the same symbol to different versions. */ #define _GLIBCXX_HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT 1 /* Define to 1 if you have the header file. */ /* #undef _GLIBCXX_HAVE_SYS_FILIO_H */ /* Define to 1 if you have the header file. */ #define _GLIBCXX_HAVE_SYS_IOCTL_H 1 /* Define to 1 if you have the header file. */ #define _GLIBCXX_HAVE_SYS_IPC_H 1 /* Define to 1 if you have the header file. */ /* #undef _GLIBCXX_HAVE_SYS_ISA_DEFS_H */ /* Define to 1 if you have the header file. */ /* #undef _GLIBCXX_HAVE_SYS_MACHINE_H */ /* Define to 1 if you have the header file. */ #define _GLIBCXX_HAVE_SYS_PARAM_H 1 /* Define to 1 if you have the header file. */ #define _GLIBCXX_HAVE_SYS_RESOURCE_H 1 /* Define to 1 if you have a suitable header file */ /* #undef _GLIBCXX_HAVE_SYS_SDT_H */ /* Define to 1 if you have the header file. */ #define _GLIBCXX_HAVE_SYS_SEM_H 1 /* Define to 1 if you have the header file. */ #define _GLIBCXX_HAVE_SYS_STATVFS_H 1 /* Define to 1 if you have the header file. */ #define _GLIBCXX_HAVE_SYS_STAT_H 1 /* Define to 1 if you have the header file. */ #define _GLIBCXX_HAVE_SYS_SYSINFO_H 1 /* Define to 1 if you have the header file. */ #define _GLIBCXX_HAVE_SYS_TIME_H 1 /* Define to 1 if you have the header file. */ #define _GLIBCXX_HAVE_SYS_TYPES_H 1 /* Define to 1 if you have the header file. */ #define _GLIBCXX_HAVE_SYS_UIO_H 1 /* Define if S_IFREG is available in . */ /* #undef _GLIBCXX_HAVE_S_IFREG */ /* Define if S_IFREG is available in . */ #define _GLIBCXX_HAVE_S_ISREG 1 /* Define to 1 if you have the `tanf' function. */ #define _GLIBCXX_HAVE_TANF 1 /* Define to 1 if you have the `tanhf' function. */ #define _GLIBCXX_HAVE_TANHF 1 /* Define to 1 if you have the `tanhl' function. */ #define _GLIBCXX_HAVE_TANHL 1 /* Define to 1 if you have the `tanl' function. */ #define _GLIBCXX_HAVE_TANL 1 /* Define to 1 if you have the header file. */ #define _GLIBCXX_HAVE_TGMATH_H 1 /* Define to 1 if the target supports thread-local storage. */ #define _GLIBCXX_HAVE_TLS 1 /* Define to 1 if you have the header file. */ #define _GLIBCXX_HAVE_UNISTD_H 1 /* Defined if usleep exists. */ /* #undef _GLIBCXX_HAVE_USLEEP */ /* Define to 1 if you have the header file. */ #define _GLIBCXX_HAVE_UTIME_H 1 /* Defined if vfwscanf exists. */ #define _GLIBCXX_HAVE_VFWSCANF 1 /* Defined if vswscanf exists. */ #define _GLIBCXX_HAVE_VSWSCANF 1 /* Defined if vwscanf exists. */ #define _GLIBCXX_HAVE_VWSCANF 1 /* Define to 1 if you have the header file. */ #define _GLIBCXX_HAVE_WCHAR_H 1 /* Defined if wcstof exists. */ #define _GLIBCXX_HAVE_WCSTOF 1 /* Define to 1 if you have the header file. */ #define _GLIBCXX_HAVE_WCTYPE_H 1 /* Defined if Sleep exists. */ /* #undef _GLIBCXX_HAVE_WIN32_SLEEP */ /* Define if writev is available in . */ #define _GLIBCXX_HAVE_WRITEV 1 /* Define to 1 if you have the `_acosf' function. */ /* #undef _GLIBCXX_HAVE__ACOSF */ /* Define to 1 if you have the `_acosl' function. */ /* #undef _GLIBCXX_HAVE__ACOSL */ /* Define to 1 if you have the `_asinf' function. */ /* #undef _GLIBCXX_HAVE__ASINF */ /* Define to 1 if you have the `_asinl' function. */ /* #undef _GLIBCXX_HAVE__ASINL */ /* Define to 1 if you have the `_atan2f' function. */ /* #undef _GLIBCXX_HAVE__ATAN2F */ /* Define to 1 if you have the `_atan2l' function. */ /* #undef _GLIBCXX_HAVE__ATAN2L */ /* Define to 1 if you have the `_atanf' function. */ /* #undef _GLIBCXX_HAVE__ATANF */ /* Define to 1 if you have the `_atanl' function. */ /* #undef _GLIBCXX_HAVE__ATANL */ /* Define to 1 if you have the `_ceilf' function. */ /* #undef _GLIBCXX_HAVE__CEILF */ /* Define to 1 if you have the `_ceill' function. */ /* #undef _GLIBCXX_HAVE__CEILL */ /* Define to 1 if you have the `_cosf' function. */ /* #undef _GLIBCXX_HAVE__COSF */ /* Define to 1 if you have the `_coshf' function. */ /* #undef _GLIBCXX_HAVE__COSHF */ /* Define to 1 if you have the `_coshl' function. */ /* #undef _GLIBCXX_HAVE__COSHL */ /* Define to 1 if you have the `_cosl' function. */ /* #undef _GLIBCXX_HAVE__COSL */ /* Define to 1 if you have the `_expf' function. */ /* #undef _GLIBCXX_HAVE__EXPF */ /* Define to 1 if you have the `_expl' function. */ /* #undef _GLIBCXX_HAVE__EXPL */ /* Define to 1 if you have the `_fabsf' function. */ /* #undef _GLIBCXX_HAVE__FABSF */ /* Define to 1 if you have the `_fabsl' function. */ /* #undef _GLIBCXX_HAVE__FABSL */ /* Define to 1 if you have the `_finite' function. */ /* #undef _GLIBCXX_HAVE__FINITE */ /* Define to 1 if you have the `_finitef' function. */ /* #undef _GLIBCXX_HAVE__FINITEF */ /* Define to 1 if you have the `_finitel' function. */ /* #undef _GLIBCXX_HAVE__FINITEL */ /* Define to 1 if you have the `_floorf' function. */ /* #undef _GLIBCXX_HAVE__FLOORF */ /* Define to 1 if you have the `_floorl' function. */ /* #undef _GLIBCXX_HAVE__FLOORL */ /* Define to 1 if you have the `_fmodf' function. */ /* #undef _GLIBCXX_HAVE__FMODF */ /* Define to 1 if you have the `_fmodl' function. */ /* #undef _GLIBCXX_HAVE__FMODL */ /* Define to 1 if you have the `_fpclass' function. */ /* #undef _GLIBCXX_HAVE__FPCLASS */ /* Define to 1 if you have the `_frexpf' function. */ /* #undef _GLIBCXX_HAVE__FREXPF */ /* Define to 1 if you have the `_frexpl' function. */ /* #undef _GLIBCXX_HAVE__FREXPL */ /* Define to 1 if you have the `_hypot' function. */ /* #undef _GLIBCXX_HAVE__HYPOT */ /* Define to 1 if you have the `_hypotf' function. */ /* #undef _GLIBCXX_HAVE__HYPOTF */ /* Define to 1 if you have the `_hypotl' function. */ /* #undef _GLIBCXX_HAVE__HYPOTL */ /* Define to 1 if you have the `_isinf' function. */ /* #undef _GLIBCXX_HAVE__ISINF */ /* Define to 1 if you have the `_isinff' function. */ /* #undef _GLIBCXX_HAVE__ISINFF */ /* Define to 1 if you have the `_isinfl' function. */ /* #undef _GLIBCXX_HAVE__ISINFL */ /* Define to 1 if you have the `_isnan' function. */ /* #undef _GLIBCXX_HAVE__ISNAN */ /* Define to 1 if you have the `_isnanf' function. */ /* #undef _GLIBCXX_HAVE__ISNANF */ /* Define to 1 if you have the `_isnanl' function. */ /* #undef _GLIBCXX_HAVE__ISNANL */ /* Define to 1 if you have the `_ldexpf' function. */ /* #undef _GLIBCXX_HAVE__LDEXPF */ /* Define to 1 if you have the `_ldexpl' function. */ /* #undef _GLIBCXX_HAVE__LDEXPL */ /* Define to 1 if you have the `_log10f' function. */ /* #undef _GLIBCXX_HAVE__LOG10F */ /* Define to 1 if you have the `_log10l' function. */ /* #undef _GLIBCXX_HAVE__LOG10L */ /* Define to 1 if you have the `_logf' function. */ /* #undef _GLIBCXX_HAVE__LOGF */ /* Define to 1 if you have the `_logl' function. */ /* #undef _GLIBCXX_HAVE__LOGL */ /* Define to 1 if you have the `_modf' function. */ /* #undef _GLIBCXX_HAVE__MODF */ /* Define to 1 if you have the `_modff' function. */ /* #undef _GLIBCXX_HAVE__MODFF */ /* Define to 1 if you have the `_modfl' function. */ /* #undef _GLIBCXX_HAVE__MODFL */ /* Define to 1 if you have the `_powf' function. */ /* #undef _GLIBCXX_HAVE__POWF */ /* Define to 1 if you have the `_powl' function. */ /* #undef _GLIBCXX_HAVE__POWL */ /* Define to 1 if you have the `_qfpclass' function. */ /* #undef _GLIBCXX_HAVE__QFPCLASS */ /* Define to 1 if you have the `_sincos' function. */ /* #undef _GLIBCXX_HAVE__SINCOS */ /* Define to 1 if you have the `_sincosf' function. */ /* #undef _GLIBCXX_HAVE__SINCOSF */ /* Define to 1 if you have the `_sincosl' function. */ /* #undef _GLIBCXX_HAVE__SINCOSL */ /* Define to 1 if you have the `_sinf' function. */ /* #undef _GLIBCXX_HAVE__SINF */ /* Define to 1 if you have the `_sinhf' function. */ /* #undef _GLIBCXX_HAVE__SINHF */ /* Define to 1 if you have the `_sinhl' function. */ /* #undef _GLIBCXX_HAVE__SINHL */ /* Define to 1 if you have the `_sinl' function. */ /* #undef _GLIBCXX_HAVE__SINL */ /* Define to 1 if you have the `_sqrtf' function. */ /* #undef _GLIBCXX_HAVE__SQRTF */ /* Define to 1 if you have the `_sqrtl' function. */ /* #undef _GLIBCXX_HAVE__SQRTL */ /* Define to 1 if you have the `_tanf' function. */ /* #undef _GLIBCXX_HAVE__TANF */ /* Define to 1 if you have the `_tanhf' function. */ /* #undef _GLIBCXX_HAVE__TANHF */ /* Define to 1 if you have the `_tanhl' function. */ /* #undef _GLIBCXX_HAVE__TANHL */ /* Define to 1 if you have the `_tanl' function. */ /* #undef _GLIBCXX_HAVE__TANL */ /* Define to 1 if you have the `__cxa_thread_atexit_impl' function. */ #define _GLIBCXX_HAVE___CXA_THREAD_ATEXIT_IMPL 1 /* Define as const if the declaration of iconv() needs const. */ #define _GLIBCXX_ICONV_CONST /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" /* Name of package */ /* #undef _GLIBCXX_PACKAGE */ /* Define to the address where bug reports for this package should be sent. */ #define _GLIBCXX_PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ #define _GLIBCXX_PACKAGE_NAME "package-unused" /* Define to the full name and version of this package. */ #define _GLIBCXX_PACKAGE_STRING "package-unused version-unused" /* Define to the one symbol short name of this package. */ #define _GLIBCXX_PACKAGE_TARNAME "libstdc++" /* Define to the home page for this package. */ #define _GLIBCXX_PACKAGE_URL "" /* Define to the version of this package. */ #define _GLIBCXX_PACKAGE__GLIBCXX_VERSION "version-unused" /* The size of `char', as computed by sizeof. */ /* #undef SIZEOF_CHAR */ /* The size of `int', as computed by sizeof. */ /* #undef SIZEOF_INT */ /* The size of `long', as computed by sizeof. */ /* #undef SIZEOF_LONG */ /* The size of `short', as computed by sizeof. */ /* #undef SIZEOF_SHORT */ /* The size of `void *', as computed by sizeof. */ /* #undef SIZEOF_VOID_P */ /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Version number of package */ /* #undef _GLIBCXX_VERSION */ /* Define if the compiler supports C++11 atomics. */ #define _GLIBCXX_ATOMIC_BUILTINS 1 /* Define to use concept checking code from the boost libraries. */ /* #undef _GLIBCXX_CONCEPT_CHECKS */ /* Define to 1 if a fully dynamic basic_string is wanted, 0 to disable, undefined for platform defaults */ #define _GLIBCXX_FULLY_DYNAMIC_STRING 0 /* Define if gthreads library is available. */ #define _GLIBCXX_HAS_GTHREADS 1 /* Define to 1 if a full hosted library is built, or 0 if freestanding. */ #define _GLIBCXX_HOSTED 1 /* Define if compatibility should be provided for -mlong-double-64. */ /* Define if ptrdiff_t is int. */ /* #undef _GLIBCXX_PTRDIFF_T_IS_INT */ /* Define if using setrlimit to set resource limits during "make check" */ #define _GLIBCXX_RES_LIMITS 1 /* Define if size_t is unsigned int. */ /* #undef _GLIBCXX_SIZE_T_IS_UINT */ /* Define if the compiler is configured for setjmp/longjmp exceptions. */ /* #undef _GLIBCXX_SJLJ_EXCEPTIONS */ /* Define to the value of the EOF integer constant. */ #define _GLIBCXX_STDIO_EOF -1 /* Define to the value of the SEEK_CUR integer constant. */ #define _GLIBCXX_STDIO_SEEK_CUR 1 /* Define to the value of the SEEK_END integer constant. */ #define _GLIBCXX_STDIO_SEEK_END 2 /* Define to use symbol versioning in the shared library. */ #define _GLIBCXX_SYMVER 1 /* Define to use darwin versioning in the shared library. */ /* #undef _GLIBCXX_SYMVER_DARWIN */ /* Define to use GNU versioning in the shared library. */ #define _GLIBCXX_SYMVER_GNU 1 /* Define to use GNU namespace versioning in the shared library. */ /* #undef _GLIBCXX_SYMVER_GNU_NAMESPACE */ /* Define to use Sun versioning in the shared library. */ /* #undef _GLIBCXX_SYMVER_SUN */ /* Define if C99 functions or macros from , , , , and can be used or exposed. */ #define _GLIBCXX_USE_C99 1 /* Define if C99 functions in should be used in . Using compiler builtins for these functions requires corresponding C99 library functions to be present. */ #define _GLIBCXX_USE_C99_COMPLEX 1 /* Define if C99 functions in should be used in . Using compiler builtins for these functions requires corresponding C99 library functions to be present. */ #define _GLIBCXX_USE_C99_COMPLEX_TR1 1 /* Define if C99 functions in should be imported in in namespace std::tr1. */ #define _GLIBCXX_USE_C99_CTYPE_TR1 1 /* Define if C99 functions in should be imported in in namespace std::tr1. */ #define _GLIBCXX_USE_C99_FENV_TR1 1 /* Define if C99 functions in should be imported in in namespace std::tr1. */ #define _GLIBCXX_USE_C99_INTTYPES_TR1 1 /* Define if wchar_t C99 functions in should be imported in in namespace std::tr1. */ #define _GLIBCXX_USE_C99_INTTYPES_WCHAR_T_TR1 1 /* Define if C99 functions or macros in should be imported in in namespace std. */ #define _GLIBCXX_USE_C99_MATH 1 /* Define if C99 functions or macros in should be imported in in namespace std::tr1. */ #define _GLIBCXX_USE_C99_MATH_TR1 1 /* Define if C99 types in should be imported in in namespace std::tr1. */ #define _GLIBCXX_USE_C99_STDINT_TR1 1 /* Defined if clock_gettime syscall has monotonic and realtime clock support. */ /* #undef _GLIBCXX_USE_CLOCK_GETTIME_SYSCALL */ /* Defined if clock_gettime has monotonic clock support. */ #define _GLIBCXX_USE_CLOCK_MONOTONIC 1 /* Defined if clock_gettime has realtime clock support. */ #define _GLIBCXX_USE_CLOCK_REALTIME 1 /* Define if ISO/IEC TR 24733 decimal floating point types are supported on this host. */ #define _GLIBCXX_USE_DECIMAL_FLOAT 1 /* Define if fchmod is available in . */ #define _GLIBCXX_USE_FCHMOD 1 /* Define if fchmodat is available in . */ #define _GLIBCXX_USE_FCHMODAT 1 /* Define if __float128 is supported on this host. */ #define _GLIBCXX_USE_FLOAT128 1 /* Defined if gettimeofday is available. */ #define _GLIBCXX_USE_GETTIMEOFDAY 1 /* Define if get_nprocs is available in . */ #define _GLIBCXX_USE_GET_NPROCS 1 /* Define if __int128 is supported on this host. */ #define _GLIBCXX_USE_INT128 1 /* Define if LFS support is available. */ #define _GLIBCXX_USE_LFS 1 /* Define if code specialized for long long should be used. */ #define _GLIBCXX_USE_LONG_LONG 1 /* Defined if nanosleep is available. */ #define _GLIBCXX_USE_NANOSLEEP 1 /* Define if NLS translations are to be used. */ #define _GLIBCXX_USE_NLS 1 /* Define if pthreads_num_processors_np is available in . */ /* #undef _GLIBCXX_USE_PTHREADS_NUM_PROCESSORS_NP */ /* Define if POSIX read/write locks are available in . */ #define _GLIBCXX_USE_PTHREAD_RWLOCK_T 1 /* Define if /dev/random and /dev/urandom are available for the random_device of TR1 (Chapter 5.1). */ #define _GLIBCXX_USE_RANDOM_TR1 1 /* Define if usable realpath is available in . */ #define _GLIBCXX_USE_REALPATH 1 /* Defined if sched_yield is available. */ #define _GLIBCXX_USE_SCHED_YIELD 1 /* Define if _SC_NPROCESSORS_ONLN is available in . */ #define _GLIBCXX_USE_SC_NPROCESSORS_ONLN 1 /* Define if _SC_NPROC_ONLN is available in . */ /* #undef _GLIBCXX_USE_SC_NPROC_ONLN */ /* Define if sendfile is available in . */ /* #undef _GLIBCXX_USE_SENDFILE */ /* Define if struct stat has timespec members. */ #define _GLIBCXX_USE_ST_MTIM 1 /* Define if sysctl(), CTL_HW and HW_NCPU are available in . */ /* #undef _GLIBCXX_USE_SYSCTL_HW_NCPU */ /* Define if obsolescent tmpnam is available in . */ #define _GLIBCXX_USE_TMPNAM 1 /* Define if utimensat and UTIME_OMIT are available in and AT_FDCWD in . */ #define _GLIBCXX_USE_UTIMENSAT 1 /* Define if code specialized for wchar_t should be used. */ #define _GLIBCXX_USE_WCHAR_T 1 /* Define to 1 if a verbose library is built, or 0 otherwise. */ #define _GLIBCXX_VERBOSE 1 /* Defined if as can handle rdrand. */ #define _GLIBCXX_X86_RDRAND 1 /* Define to 1 if mutex_timedlock is available. */ #define _GTHREAD_USE_MUTEX_TIMEDLOCK 1 /* Define if all C++11 overloads are available in . */ #if __cplusplus >= 201103L /* #undef __CORRECT_ISO_CPP11_MATH_H_PROTO */ #endif # 1447 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__ACOSF) && ! defined (_GLIBCXX_HAVE_ACOSF) # define _GLIBCXX_HAVE_ACOSF 1 # define acosf _acosf #endif # 1452 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__ACOSL) && ! defined (_GLIBCXX_HAVE_ACOSL) # define _GLIBCXX_HAVE_ACOSL 1 # define acosl _acosl #endif # 1457 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__ASINF) && ! defined (_GLIBCXX_HAVE_ASINF) # define _GLIBCXX_HAVE_ASINF 1 # define asinf _asinf #endif # 1462 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__ASINL) && ! defined (_GLIBCXX_HAVE_ASINL) # define _GLIBCXX_HAVE_ASINL 1 # define asinl _asinl #endif # 1467 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__ATAN2F) && ! defined (_GLIBCXX_HAVE_ATAN2F) # define _GLIBCXX_HAVE_ATAN2F 1 # define atan2f _atan2f #endif # 1472 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__ATAN2L) && ! defined (_GLIBCXX_HAVE_ATAN2L) # define _GLIBCXX_HAVE_ATAN2L 1 # define atan2l _atan2l #endif # 1477 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__ATANF) && ! defined (_GLIBCXX_HAVE_ATANF) # define _GLIBCXX_HAVE_ATANF 1 # define atanf _atanf #endif # 1482 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__ATANL) && ! defined (_GLIBCXX_HAVE_ATANL) # define _GLIBCXX_HAVE_ATANL 1 # define atanl _atanl #endif # 1487 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__CEILF) && ! defined (_GLIBCXX_HAVE_CEILF) # define _GLIBCXX_HAVE_CEILF 1 # define ceilf _ceilf #endif # 1492 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__CEILL) && ! defined (_GLIBCXX_HAVE_CEILL) # define _GLIBCXX_HAVE_CEILL 1 # define ceill _ceill #endif # 1497 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__COSF) && ! defined (_GLIBCXX_HAVE_COSF) # define _GLIBCXX_HAVE_COSF 1 # define cosf _cosf #endif # 1502 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__COSHF) && ! defined (_GLIBCXX_HAVE_COSHF) # define _GLIBCXX_HAVE_COSHF 1 # define coshf _coshf #endif # 1507 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__COSHL) && ! defined (_GLIBCXX_HAVE_COSHL) # define _GLIBCXX_HAVE_COSHL 1 # define coshl _coshl #endif # 1512 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__COSL) && ! defined (_GLIBCXX_HAVE_COSL) # define _GLIBCXX_HAVE_COSL 1 # define cosl _cosl #endif # 1517 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__EXPF) && ! defined (_GLIBCXX_HAVE_EXPF) # define _GLIBCXX_HAVE_EXPF 1 # define expf _expf #endif # 1522 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__EXPL) && ! defined (_GLIBCXX_HAVE_EXPL) # define _GLIBCXX_HAVE_EXPL 1 # define expl _expl #endif # 1527 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__FABSF) && ! defined (_GLIBCXX_HAVE_FABSF) # define _GLIBCXX_HAVE_FABSF 1 # define fabsf _fabsf #endif # 1532 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__FABSL) && ! defined (_GLIBCXX_HAVE_FABSL) # define _GLIBCXX_HAVE_FABSL 1 # define fabsl _fabsl #endif # 1537 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__FINITE) && ! defined (_GLIBCXX_HAVE_FINITE) # define _GLIBCXX_HAVE_FINITE 1 # define finite _finite #endif # 1542 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__FINITEF) && ! defined (_GLIBCXX_HAVE_FINITEF) # define _GLIBCXX_HAVE_FINITEF 1 # define finitef _finitef #endif # 1547 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__FINITEL) && ! defined (_GLIBCXX_HAVE_FINITEL) # define _GLIBCXX_HAVE_FINITEL 1 # define finitel _finitel #endif # 1552 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__FLOORF) && ! defined (_GLIBCXX_HAVE_FLOORF) # define _GLIBCXX_HAVE_FLOORF 1 # define floorf _floorf #endif # 1557 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__FLOORL) && ! defined (_GLIBCXX_HAVE_FLOORL) # define _GLIBCXX_HAVE_FLOORL 1 # define floorl _floorl #endif # 1562 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__FMODF) && ! defined (_GLIBCXX_HAVE_FMODF) # define _GLIBCXX_HAVE_FMODF 1 # define fmodf _fmodf #endif # 1567 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__FMODL) && ! defined (_GLIBCXX_HAVE_FMODL) # define _GLIBCXX_HAVE_FMODL 1 # define fmodl _fmodl #endif # 1572 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__FPCLASS) && ! defined (_GLIBCXX_HAVE_FPCLASS) # define _GLIBCXX_HAVE_FPCLASS 1 # define fpclass _fpclass #endif # 1577 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__FREXPF) && ! defined (_GLIBCXX_HAVE_FREXPF) # define _GLIBCXX_HAVE_FREXPF 1 # define frexpf _frexpf #endif # 1582 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__FREXPL) && ! defined (_GLIBCXX_HAVE_FREXPL) # define _GLIBCXX_HAVE_FREXPL 1 # define frexpl _frexpl #endif # 1587 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__HYPOT) && ! defined (_GLIBCXX_HAVE_HYPOT) # define _GLIBCXX_HAVE_HYPOT 1 # define hypot _hypot #endif # 1592 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__HYPOTF) && ! defined (_GLIBCXX_HAVE_HYPOTF) # define _GLIBCXX_HAVE_HYPOTF 1 # define hypotf _hypotf #endif # 1597 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__HYPOTL) && ! defined (_GLIBCXX_HAVE_HYPOTL) # define _GLIBCXX_HAVE_HYPOTL 1 # define hypotl _hypotl #endif # 1602 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__ISINF) && ! defined (_GLIBCXX_HAVE_ISINF) # define _GLIBCXX_HAVE_ISINF 1 # define isinf _isinf #endif # 1607 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__ISINFF) && ! defined (_GLIBCXX_HAVE_ISINFF) # define _GLIBCXX_HAVE_ISINFF 1 # define isinff _isinff #endif # 1612 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__ISINFL) && ! defined (_GLIBCXX_HAVE_ISINFL) # define _GLIBCXX_HAVE_ISINFL 1 # define isinfl _isinfl #endif # 1617 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__ISNAN) && ! defined (_GLIBCXX_HAVE_ISNAN) # define _GLIBCXX_HAVE_ISNAN 1 # define isnan _isnan #endif # 1622 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__ISNANF) && ! defined (_GLIBCXX_HAVE_ISNANF) # define _GLIBCXX_HAVE_ISNANF 1 # define isnanf _isnanf #endif # 1627 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__ISNANL) && ! defined (_GLIBCXX_HAVE_ISNANL) # define _GLIBCXX_HAVE_ISNANL 1 # define isnanl _isnanl #endif # 1632 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__LDEXPF) && ! defined (_GLIBCXX_HAVE_LDEXPF) # define _GLIBCXX_HAVE_LDEXPF 1 # define ldexpf _ldexpf #endif # 1637 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__LDEXPL) && ! defined (_GLIBCXX_HAVE_LDEXPL) # define _GLIBCXX_HAVE_LDEXPL 1 # define ldexpl _ldexpl #endif # 1642 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__LOG10F) && ! defined (_GLIBCXX_HAVE_LOG10F) # define _GLIBCXX_HAVE_LOG10F 1 # define log10f _log10f #endif # 1647 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__LOG10L) && ! defined (_GLIBCXX_HAVE_LOG10L) # define _GLIBCXX_HAVE_LOG10L 1 # define log10l _log10l #endif # 1652 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__LOGF) && ! defined (_GLIBCXX_HAVE_LOGF) # define _GLIBCXX_HAVE_LOGF 1 # define logf _logf #endif # 1657 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__LOGL) && ! defined (_GLIBCXX_HAVE_LOGL) # define _GLIBCXX_HAVE_LOGL 1 # define logl _logl #endif # 1662 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__MODF) && ! defined (_GLIBCXX_HAVE_MODF) # define _GLIBCXX_HAVE_MODF 1 # define modf _modf #endif # 1667 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__MODFF) && ! defined (_GLIBCXX_HAVE_MODFF) # define _GLIBCXX_HAVE_MODFF 1 # define modff _modff #endif # 1672 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__MODFL) && ! defined (_GLIBCXX_HAVE_MODFL) # define _GLIBCXX_HAVE_MODFL 1 # define modfl _modfl #endif # 1677 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__POWF) && ! defined (_GLIBCXX_HAVE_POWF) # define _GLIBCXX_HAVE_POWF 1 # define powf _powf #endif # 1682 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__POWL) && ! defined (_GLIBCXX_HAVE_POWL) # define _GLIBCXX_HAVE_POWL 1 # define powl _powl #endif # 1687 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__QFPCLASS) && ! defined (_GLIBCXX_HAVE_QFPCLASS) # define _GLIBCXX_HAVE_QFPCLASS 1 # define qfpclass _qfpclass #endif # 1692 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__SINCOS) && ! defined (_GLIBCXX_HAVE_SINCOS) # define _GLIBCXX_HAVE_SINCOS 1 # define sincos _sincos #endif # 1697 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__SINCOSF) && ! defined (_GLIBCXX_HAVE_SINCOSF) # define _GLIBCXX_HAVE_SINCOSF 1 # define sincosf _sincosf #endif # 1702 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__SINCOSL) && ! defined (_GLIBCXX_HAVE_SINCOSL) # define _GLIBCXX_HAVE_SINCOSL 1 # define sincosl _sincosl #endif # 1707 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__SINF) && ! defined (_GLIBCXX_HAVE_SINF) # define _GLIBCXX_HAVE_SINF 1 # define sinf _sinf #endif # 1712 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__SINHF) && ! defined (_GLIBCXX_HAVE_SINHF) # define _GLIBCXX_HAVE_SINHF 1 # define sinhf _sinhf #endif # 1717 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__SINHL) && ! defined (_GLIBCXX_HAVE_SINHL) # define _GLIBCXX_HAVE_SINHL 1 # define sinhl _sinhl #endif # 1722 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__SINL) && ! defined (_GLIBCXX_HAVE_SINL) # define _GLIBCXX_HAVE_SINL 1 # define sinl _sinl #endif # 1727 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__SQRTF) && ! defined (_GLIBCXX_HAVE_SQRTF) # define _GLIBCXX_HAVE_SQRTF 1 # define sqrtf _sqrtf #endif # 1732 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__SQRTL) && ! defined (_GLIBCXX_HAVE_SQRTL) # define _GLIBCXX_HAVE_SQRTL 1 # define sqrtl _sqrtl #endif # 1737 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__STRTOF) && ! defined (_GLIBCXX_HAVE_STRTOF) # define _GLIBCXX_HAVE_STRTOF 1 # define strtof _strtof #endif # 1742 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__STRTOLD) && ! defined (_GLIBCXX_HAVE_STRTOLD) # define _GLIBCXX_HAVE_STRTOLD 1 # define strtold _strtold #endif # 1747 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__TANF) && ! defined (_GLIBCXX_HAVE_TANF) # define _GLIBCXX_HAVE_TANF 1 # define tanf _tanf #endif # 1752 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__TANHF) && ! defined (_GLIBCXX_HAVE_TANHF) # define _GLIBCXX_HAVE_TANHF 1 # define tanhf _tanhf #endif # 1757 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__TANHL) && ! defined (_GLIBCXX_HAVE_TANHL) # define _GLIBCXX_HAVE_TANHL 1 # define tanhl _tanhl #endif # 1762 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #if defined (_GLIBCXX_HAVE__TANL) && ! defined (_GLIBCXX_HAVE_TANL) # define _GLIBCXX_HAVE_TANL 1 # define tanl _tanl #endif # 1767 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 #endif // _GLIBCXX_CXX_CONFIG_H # 1769 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++config.h" 3 # 60 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algobase.h" 2 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 60 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algobase.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/functexcept.h" 1 3 // Function-Based Exception Support -*- C++ -*- // Copyright (C) 2001-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file bits/functexcept.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{exception} * * This header provides support for -fno-exceptions. */ // // ISO C++ 14882: 19.1 Exception classes // #ifndef _FUNCTEXCEPT_H #define _FUNCTEXCEPT_H 1 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/functexcept.h" 3 # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/functexcept.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/functexcept.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/exception_defines.h" 1 3 // -fno-exceptions Support -*- C++ -*- // Copyright (C) 2001-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file bits/exception_defines.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{exception} */ #ifndef _EXCEPTION_DEFINES_H #define _EXCEPTION_DEFINES_H 1 #if ! __cpp_exceptions // Iff -fno-exceptions, transform error handling code to work without it. # define __try if (true) # define __catch(X) if (false) # define __throw_exception_again #else # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/exception_defines.h" 3 // Else proceed normally. # define __try try # define __catch(X) catch(X) # define __throw_exception_again throw #endif # 44 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/exception_defines.h" 3 #endif # 46 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/exception_defines.h" 3 # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/functexcept.h" 2 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION // Helper for exception objects in void __throw_bad_exception(void) __attribute__((__noreturn__)); // Helper for exception objects in void __throw_bad_alloc(void) __attribute__((__noreturn__)); // Helper for exception objects in void __throw_bad_cast(void) __attribute__((__noreturn__)); void __throw_bad_typeid(void) __attribute__((__noreturn__)); // Helpers for exception objects in void __throw_logic_error(const char*) __attribute__((__noreturn__)); void __throw_domain_error(const char*) __attribute__((__noreturn__)); void __throw_invalid_argument(const char*) __attribute__((__noreturn__)); void __throw_length_error(const char*) __attribute__((__noreturn__)); void __throw_out_of_range(const char*) __attribute__((__noreturn__)); void __throw_out_of_range_fmt(const char*, ...) __attribute__((__noreturn__)) __attribute__((__format__(__gnu_printf__, 1, 2))); void __throw_runtime_error(const char*) __attribute__((__noreturn__)); void __throw_range_error(const char*) __attribute__((__noreturn__)); void __throw_overflow_error(const char*) __attribute__((__noreturn__)); void __throw_underflow_error(const char*) __attribute__((__noreturn__)); // Helpers for exception objects in void __throw_ios_failure(const char*) __attribute__((__noreturn__)); void __throw_system_error(int) __attribute__((__noreturn__)); void __throw_future_error(int) __attribute__((__noreturn__)); // Helpers for exception objects in void __throw_bad_function_call() __attribute__((__noreturn__)); _GLIBCXX_END_NAMESPACE_VERSION } // namespace #endif # 111 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/functexcept.h" 3 # 61 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algobase.h" 2 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 61 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algobase.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/cpp_type_traits.h" 1 3 // The -*- C++ -*- type traits classes for internal use in libstdc++ // Copyright (C) 2000-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file bits/cpp_type_traits.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{ext/type_traits} */ // Written by Gabriel Dos Reis #ifndef _CPP_TYPE_TRAITS_H #define _CPP_TYPE_TRAITS_H 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 36 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/cpp_type_traits.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 37 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/cpp_type_traits.h" 3 # 38 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/cpp_type_traits.h" 3 // // This file provides some compile-time information about various types. // These representations were designed, on purpose, to be constant-expressions // and not types as found in . In particular, they // can be used in control structures and the optimizer hopefully will do // the obvious thing. // // Why integral expressions, and not functions nor types? // Firstly, these compile-time entities are used as template-arguments // so function return values won't work: We need compile-time entities. // We're left with types and constant integral expressions. // Secondly, from the point of view of ease of use, type-based compile-time // information is -not- *that* convenient. On has to write lots of // overloaded functions and to hope that the compiler will select the right // one. As a net effect, the overall structure isn't very clear at first // glance. // Thirdly, partial ordering and overload resolution (of function templates) // is highly costly in terms of compiler-resource. It is a Good Thing to // keep these resource consumption as least as possible. // // See valarray_array.h for a case use. // // -- Gaby (dosreis@cmla.ens-cachan.fr) 2000-03-06. // // Update 2005: types are also provided and has been // removed. // // Forward declaration hack, should really include this from somewhere. namespace __gnu_cxx _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION template class __normal_iterator; _GLIBCXX_END_NAMESPACE_VERSION } // namespace namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION struct __true_type { }; struct __false_type { }; template struct __truth_type { typedef __false_type __type; }; template<> struct __truth_type { typedef __true_type __type; }; // N.B. The conversions to bool are needed due to the issue // explained in c++/19404. template struct __traitor { enum { __value = bool(_Sp::__value) || bool(_Tp::__value) }; typedef typename __truth_type<__value>::__type __type; }; // Compare for equality of types. template struct __are_same { enum { __value = 0 }; typedef __false_type __type; }; template struct __are_same<_Tp, _Tp> { enum { __value = 1 }; typedef __true_type __type; }; // Holds if the template-argument is a void type. template struct __is_void { enum { __value = 0 }; typedef __false_type __type; }; template<> struct __is_void { enum { __value = 1 }; typedef __true_type __type; }; // // Integer types // template struct __is_integer { enum { __value = 0 }; typedef __false_type __type; }; // Thirteen specializations (yes there are eleven standard integer // types; long long and unsigned long long are // supported as extensions). Up to four target-specific __int // types are supported as well. template<> struct __is_integer { enum { __value = 1 }; typedef __true_type __type; }; template<> struct __is_integer { enum { __value = 1 }; typedef __true_type __type; }; template<> struct __is_integer { enum { __value = 1 }; typedef __true_type __type; }; template<> struct __is_integer { enum { __value = 1 }; typedef __true_type __type; }; # ifdef _GLIBCXX_USE_WCHAR_T template<> struct __is_integer { enum { __value = 1 }; typedef __true_type __type; }; # endif # 182 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/cpp_type_traits.h" 3 #if __cplusplus >= 201103L template<> struct __is_integer { enum { __value = 1 }; typedef __true_type __type; }; template<> struct __is_integer { enum { __value = 1 }; typedef __true_type __type; }; #endif # 198 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/cpp_type_traits.h" 3 template<> struct __is_integer { enum { __value = 1 }; typedef __true_type __type; }; template<> struct __is_integer { enum { __value = 1 }; typedef __true_type __type; }; template<> struct __is_integer { enum { __value = 1 }; typedef __true_type __type; }; template<> struct __is_integer { enum { __value = 1 }; typedef __true_type __type; }; template<> struct __is_integer { enum { __value = 1 }; typedef __true_type __type; }; template<> struct __is_integer { enum { __value = 1 }; typedef __true_type __type; }; template<> struct __is_integer { enum { __value = 1 }; typedef __true_type __type; }; template<> struct __is_integer { enum { __value = 1 }; typedef __true_type __type; }; #define __INT_N(TYPE) \ template<> \ struct __is_integer \ { \ enum { __value = 1 }; \ typedef __true_type __type; \ }; \ template<> \ struct __is_integer \ { \ enum { __value = 1 }; \ typedef __true_type __type; \ }; #ifdef __GLIBCXX_TYPE_INT_N_0 __INT_N(__GLIBCXX_TYPE_INT_N_0) #endif # 272 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/cpp_type_traits.h" 3 #ifdef __GLIBCXX_TYPE_INT_N_1 __INT_N(__GLIBCXX_TYPE_INT_N_1) #endif # 275 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/cpp_type_traits.h" 3 #ifdef __GLIBCXX_TYPE_INT_N_2 __INT_N(__GLIBCXX_TYPE_INT_N_2) #endif # 278 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/cpp_type_traits.h" 3 #ifdef __GLIBCXX_TYPE_INT_N_3 __INT_N(__GLIBCXX_TYPE_INT_N_3) #endif # 281 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/cpp_type_traits.h" 3 #undef __INT_N // // Floating point types // template struct __is_floating { enum { __value = 0 }; typedef __false_type __type; }; // three specializations (float, double and 'long double') template<> struct __is_floating { enum { __value = 1 }; typedef __true_type __type; }; template<> struct __is_floating { enum { __value = 1 }; typedef __true_type __type; }; template<> struct __is_floating { enum { __value = 1 }; typedef __true_type __type; }; // // Pointer types // template struct __is_pointer { enum { __value = 0 }; typedef __false_type __type; }; template struct __is_pointer<_Tp*> { enum { __value = 1 }; typedef __true_type __type; }; // // Normal iterator type // template struct __is_normal_iterator { enum { __value = 0 }; typedef __false_type __type; }; template struct __is_normal_iterator< __gnu_cxx::__normal_iterator<_Iterator, _Container> > { enum { __value = 1 }; typedef __true_type __type; }; // // An arithmetic type is an integer type or a floating point type // template struct __is_arithmetic : public __traitor<__is_integer<_Tp>, __is_floating<_Tp> > { }; // // A scalar type is an arithmetic type or a pointer type // template struct __is_scalar : public __traitor<__is_arithmetic<_Tp>, __is_pointer<_Tp> > { }; // // For use in std::copy and std::find overloads for streambuf iterators. // template struct __is_char { enum { __value = 0 }; typedef __false_type __type; }; template<> struct __is_char { enum { __value = 1 }; typedef __true_type __type; }; #ifdef _GLIBCXX_USE_WCHAR_T template<> struct __is_char { enum { __value = 1 }; typedef __true_type __type; }; #endif # 392 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/cpp_type_traits.h" 3 template struct __is_byte { enum { __value = 0 }; typedef __false_type __type; }; template<> struct __is_byte { enum { __value = 1 }; typedef __true_type __type; }; template<> struct __is_byte { enum { __value = 1 }; typedef __true_type __type; }; template<> struct __is_byte { enum { __value = 1 }; typedef __true_type __type; }; // // Move iterator type // template struct __is_move_iterator { enum { __value = 0 }; typedef __false_type __type; }; #if __cplusplus >= 201103L template class move_iterator; template struct __is_move_iterator< move_iterator<_Iterator> > { enum { __value = 1 }; typedef __true_type __type; }; #endif # 442 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/cpp_type_traits.h" 3 _GLIBCXX_END_NAMESPACE_VERSION } // namespace #endif //_CPP_TYPE_TRAITS_H # 447 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/cpp_type_traits.h" 3 # 62 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algobase.h" 2 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 62 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algobase.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/type_traits.h" 1 3 // -*- C++ -*- // Copyright (C) 2005-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the terms // of the GNU General Public License as published by the Free Software // Foundation; either version 3, or (at your option) any later // version. // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file ext/type_traits.h * This file is a GNU extension to the Standard C++ Library. */ #ifndef _EXT_TYPE_TRAITS #define _EXT_TYPE_TRAITS 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 33 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/type_traits.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 34 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/type_traits.h" 3 # 35 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/type_traits.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 35 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/type_traits.h" 3 # 36 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/type_traits.h" 3 namespace __gnu_cxx _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION // Define a nested type if some predicate holds. template struct __enable_if { }; template struct __enable_if { typedef _Tp __type; }; // Conditional expression for types. If true, first, if false, second. template struct __conditional_type { typedef _Iftrue __type; }; template struct __conditional_type { typedef _Iffalse __type; }; // Given an integral builtin type, return the corresponding unsigned type. template struct __add_unsigned { private: typedef __enable_if::__value, _Tp> __if_type; public: typedef typename __if_type::__type __type; }; template<> struct __add_unsigned { typedef unsigned char __type; }; template<> struct __add_unsigned { typedef unsigned char __type; }; template<> struct __add_unsigned { typedef unsigned short __type; }; template<> struct __add_unsigned { typedef unsigned int __type; }; template<> struct __add_unsigned { typedef unsigned long __type; }; template<> struct __add_unsigned { typedef unsigned long long __type; }; // Declare but don't define. template<> struct __add_unsigned; template<> struct __add_unsigned; // Given an integral builtin type, return the corresponding signed type. template struct __remove_unsigned { private: typedef __enable_if::__value, _Tp> __if_type; public: typedef typename __if_type::__type __type; }; template<> struct __remove_unsigned { typedef signed char __type; }; template<> struct __remove_unsigned { typedef signed char __type; }; template<> struct __remove_unsigned { typedef short __type; }; template<> struct __remove_unsigned { typedef int __type; }; template<> struct __remove_unsigned { typedef long __type; }; template<> struct __remove_unsigned { typedef long long __type; }; // Declare but don't define. template<> struct __remove_unsigned; template<> struct __remove_unsigned; // For use in string and vstring. template inline bool __is_null_pointer(_Type* __ptr) { return __ptr == 0; } template inline bool __is_null_pointer(_Type) { return false; } #if __cplusplus >= 201103L inline bool __is_null_pointer(std::nullptr_t) { return true; } #endif # 163 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/type_traits.h" 3 // For complex and cmath template::__value> struct __promote { typedef double __type; }; // No nested __type member for non-integer non-floating point types, // allows this type to be used for SFINAE to constrain overloads in // and to only the intended types. template struct __promote<_Tp, false> { }; template<> struct __promote { typedef long double __type; }; template<> struct __promote { typedef double __type; }; template<> struct __promote { typedef float __type; }; template::__type, typename _Up2 = typename __promote<_Up>::__type> struct __promote_2 { typedef __typeof__(_Tp2() + _Up2()) __type; }; template::__type, typename _Up2 = typename __promote<_Up>::__type, typename _Vp2 = typename __promote<_Vp>::__type> struct __promote_3 { typedef __typeof__(_Tp2() + _Up2() + _Vp2()) __type; }; template::__type, typename _Up2 = typename __promote<_Up>::__type, typename _Vp2 = typename __promote<_Vp>::__type, typename _Wp2 = typename __promote<_Wp>::__type> struct __promote_4 { typedef __typeof__(_Tp2() + _Up2() + _Vp2() + _Wp2()) __type; }; _GLIBCXX_END_NAMESPACE_VERSION } // namespace #endif # 219 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/type_traits.h" 3 # 63 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algobase.h" 2 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 63 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algobase.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/numeric_traits.h" 1 3 // -*- C++ -*- // Copyright (C) 2007-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the terms // of the GNU General Public License as published by the Free Software // Foundation; either version 3, or (at your option) any later // version. // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file ext/numeric_traits.h * This file is a GNU extension to the Standard C++ Library. */ #ifndef _EXT_NUMERIC_TRAITS #define _EXT_NUMERIC_TRAITS 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 33 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/numeric_traits.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 34 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/numeric_traits.h" 3 # 35 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/numeric_traits.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 35 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/numeric_traits.h" 3 # 36 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/numeric_traits.h" 3 namespace __gnu_cxx _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION // Compile time constants for builtin types. // Sadly std::numeric_limits member functions cannot be used for this. #define __glibcxx_signed(_Tp) ((_Tp)(-1) < 0) #define __glibcxx_digits(_Tp) \ (sizeof(_Tp) * __CHAR_BIT__ - __glibcxx_signed(_Tp)) #define __glibcxx_min(_Tp) \ (__glibcxx_signed(_Tp) ? (_Tp)1 << __glibcxx_digits(_Tp) : (_Tp)0) #define __glibcxx_max(_Tp) \ (__glibcxx_signed(_Tp) ? \ (((((_Tp)1 << (__glibcxx_digits(_Tp) - 1)) - 1) << 1) + 1) : ~(_Tp)0) template struct __numeric_traits_integer { // Only integers for initialization of member constant. static const _Value __min = __glibcxx_min(_Value); static const _Value __max = __glibcxx_max(_Value); // NB: these two also available in std::numeric_limits as compile // time constants, but is big and we avoid including it. static const bool __is_signed = __glibcxx_signed(_Value); static const int __digits = __glibcxx_digits(_Value); }; template const _Value __numeric_traits_integer<_Value>::__min; template const _Value __numeric_traits_integer<_Value>::__max; template const bool __numeric_traits_integer<_Value>::__is_signed; template const int __numeric_traits_integer<_Value>::__digits; #undef __glibcxx_signed #undef __glibcxx_digits #undef __glibcxx_min #undef __glibcxx_max #define __glibcxx_floating(_Tp, _Fval, _Dval, _LDval) \ (std::__are_same<_Tp, float>::__value ? _Fval \ : std::__are_same<_Tp, double>::__value ? _Dval : _LDval) #define __glibcxx_max_digits10(_Tp) \ (2 + __glibcxx_floating(_Tp, __FLT_MANT_DIG__, __DBL_MANT_DIG__, \ __LDBL_MANT_DIG__) * 643L / 2136) #define __glibcxx_digits10(_Tp) \ __glibcxx_floating(_Tp, __FLT_DIG__, __DBL_DIG__, __LDBL_DIG__) #define __glibcxx_max_exponent10(_Tp) \ __glibcxx_floating(_Tp, __FLT_MAX_10_EXP__, __DBL_MAX_10_EXP__, \ __LDBL_MAX_10_EXP__) template struct __numeric_traits_floating { // Only floating point types. See N1822. static const int __max_digits10 = __glibcxx_max_digits10(_Value); // See above comment... static const bool __is_signed = true; static const int __digits10 = __glibcxx_digits10(_Value); static const int __max_exponent10 = __glibcxx_max_exponent10(_Value); }; template const int __numeric_traits_floating<_Value>::__max_digits10; template const bool __numeric_traits_floating<_Value>::__is_signed; template const int __numeric_traits_floating<_Value>::__digits10; template const int __numeric_traits_floating<_Value>::__max_exponent10; template struct __numeric_traits : public __conditional_type::__value, __numeric_traits_integer<_Value>, __numeric_traits_floating<_Value> >::__type { }; _GLIBCXX_END_NAMESPACE_VERSION } // namespace #undef __glibcxx_floating #undef __glibcxx_max_digits10 #undef __glibcxx_digits10 #undef __glibcxx_max_exponent10 #endif # 139 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/numeric_traits.h" 3 # 64 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algobase.h" 2 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 64 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algobase.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_pair.h" 1 3 // Pair implementation -*- C++ -*- // Copyright (C) 2001-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /* * * Copyright (c) 1994 * Hewlett-Packard Company * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Hewlett-Packard Company makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. * * * Copyright (c) 1996,1997 * Silicon Graphics Computer Systems, Inc. * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Silicon Graphics makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. */ /** @file bits/stl_pair.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{utility} */ #ifndef _STL_PAIR_H #define _STL_PAIR_H 1 #if 0 /* expanded by -frewrite-includes */ #include // for std::move / std::forward, and std::swap #endif /* expanded by -frewrite-includes */ # 59 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_pair.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/move.h" 1 3 // Move, forward and identity for C++0x + swap -*- C++ -*- // Copyright (C) 2007-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file bits/move.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{utility} */ #ifndef _MOVE_H #define _MOVE_H 1 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 33 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/move.h" 3 # 34 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/move.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 34 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/move.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/concept_check.h" 1 3 // Concept-checking control -*- C++ -*- // Copyright (C) 2001-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file bits/concept_check.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{iterator} */ #ifndef _CONCEPT_CHECK_H #define _CONCEPT_CHECK_H 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 34 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/concept_check.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 35 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/concept_check.h" 3 # 36 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/concept_check.h" 3 // All places in libstdc++-v3 where these are used, or /might/ be used, or // don't need to be used, or perhaps /should/ be used, are commented with // "concept requirements" (and maybe some more text). So grep like crazy // if you're looking for additional places to use these. // Concept-checking code is off by default unless users turn it on via // configure options or editing c++config.h. #ifndef _GLIBCXX_CONCEPT_CHECKS #define __glibcxx_function_requires(...) #define __glibcxx_class_requires(_a,_b) #define __glibcxx_class_requires2(_a,_b,_c) #define __glibcxx_class_requires3(_a,_b,_c,_d) #define __glibcxx_class_requires4(_a,_b,_c,_d,_e) #else // the checks are on # 54 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/concept_check.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 55 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/concept_check.h" 3 # 56 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/concept_check.h" 3 // Note that the obvious and elegant approach of // //#define glibcxx_function_requires(C) debug::function_requires< debug::C >() // // won't work due to concept templates with more than one parameter, e.g., // BinaryPredicateConcept. The preprocessor tries to split things up on // the commas in the template argument list. We can't use an inner pair of // parenthesis to hide the commas, because "debug::(Temp)" isn't // a valid instantiation pattern. Thus, we steal a feature from C99. #define __glibcxx_function_requires(...) \ __gnu_cxx::__function_requires< __gnu_cxx::__VA_ARGS__ >(); #define __glibcxx_class_requires(_a,_C) \ _GLIBCXX_CLASS_REQUIRES(_a, __gnu_cxx, _C); #define __glibcxx_class_requires2(_a,_b,_C) \ _GLIBCXX_CLASS_REQUIRES2(_a, _b, __gnu_cxx, _C); #define __glibcxx_class_requires3(_a,_b,_c,_C) \ _GLIBCXX_CLASS_REQUIRES3(_a, _b, _c, __gnu_cxx, _C); #define __glibcxx_class_requires4(_a,_b,_c,_d,_C) \ _GLIBCXX_CLASS_REQUIRES4(_a, _b, _c, _d, __gnu_cxx, _C); #endif // enable/disable # 79 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/concept_check.h" 3 #endif // _GLIBCXX_CONCEPT_CHECK # 81 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/concept_check.h" 3 # 35 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/move.h" 2 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION // Used, in C++03 mode too, by allocators, etc. /** * @brief Same as C++11 std::addressof * @ingroup utilities */ template inline _Tp* __addressof(_Tp& __r) _GLIBCXX_NOEXCEPT { return reinterpret_cast<_Tp*> (&const_cast(reinterpret_cast(__r))); } _GLIBCXX_END_NAMESPACE_VERSION } // namespace #if __cplusplus >= 201103L #if 0 /* expanded by -frewrite-includes */ #include // Brings in std::declval too. #endif /* expanded by -frewrite-includes */ # 57 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/move.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/type_traits" 1 3 // C++11 -*- C++ -*- // Copyright (C) 2007-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file include/type_traits * This is a Standard C++ Library header. */ #ifndef _GLIBCXX_TYPE_TRAITS #define _GLIBCXX_TYPE_TRAITS 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 33 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/type_traits" 3 #if __cplusplus < 201103L #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 35 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/type_traits" 3 # 36 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/type_traits" 3 #else # 37 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/type_traits" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 38 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/type_traits" 3 # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/type_traits" 3 #ifdef _GLIBCXX_USE_C99_STDINT_TR1 # if defined (__UINT_LEAST16_TYPE__) && defined(__UINT_LEAST32_TYPE__) namespace std { typedef __UINT_LEAST16_TYPE__ uint_least16_t; typedef __UINT_LEAST32_TYPE__ uint_least32_t; } # else # 48 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/type_traits" 3 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 48 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/type_traits" 3 # 49 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/type_traits" 3 # endif # 50 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/type_traits" 3 #endif # 51 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/type_traits" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION /** * @defgroup metaprogramming Metaprogramming * @ingroup utilities * * Template utilities for compile-time introspection and modification, * including type classification traits, type property inspection traits * and type transformation traits. * * @{ */ /// integral_constant template struct integral_constant { static constexpr _Tp value = __v; typedef _Tp value_type; typedef integral_constant<_Tp, __v> type; constexpr operator value_type() const { return value; } #if __cplusplus > 201103L #define __cpp_lib_integral_constant_callable 201304 constexpr value_type operator()() const { return value; } #endif # 81 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/type_traits" 3 }; template constexpr _Tp integral_constant<_Tp, __v>::value; /// The type used as a compile-time boolean with true value. typedef integral_constant true_type; /// The type used as a compile-time boolean with false value. typedef integral_constant false_type; template using __bool_constant = integral_constant; // Meta programming helper types. template struct conditional; template struct __or_; template<> struct __or_<> : public false_type { }; template struct __or_<_B1> : public _B1 { }; template struct __or_<_B1, _B2> : public conditional<_B1::value, _B1, _B2>::type { }; template struct __or_<_B1, _B2, _B3, _Bn...> : public conditional<_B1::value, _B1, __or_<_B2, _B3, _Bn...>>::type { }; template struct __and_; template<> struct __and_<> : public true_type { }; template struct __and_<_B1> : public _B1 { }; template struct __and_<_B1, _B2> : public conditional<_B1::value, _B2, _B1>::type { }; template struct __and_<_B1, _B2, _B3, _Bn...> : public conditional<_B1::value, __and_<_B2, _B3, _Bn...>, _B1>::type { }; template struct __not_ : public integral_constant { }; // For several sfinae-friendly trait implementations we transport both the // result information (as the member type) and the failure information (no // member type). This is very similar to std::enable_if, but we cannot use // them, because we need to derive from them as an implementation detail. template struct __success_type { typedef _Tp type; }; struct __failure_type { }; // Primary type categories. template struct remove_cv; template struct __is_void_helper : public false_type { }; template<> struct __is_void_helper : public true_type { }; /// is_void template struct is_void : public __is_void_helper::type>::type { }; template struct __is_integral_helper : public false_type { }; template<> struct __is_integral_helper : public true_type { }; template<> struct __is_integral_helper : public true_type { }; template<> struct __is_integral_helper : public true_type { }; template<> struct __is_integral_helper : public true_type { }; #ifdef _GLIBCXX_USE_WCHAR_T template<> struct __is_integral_helper : public true_type { }; #endif # 207 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/type_traits" 3 template<> struct __is_integral_helper : public true_type { }; template<> struct __is_integral_helper : public true_type { }; template<> struct __is_integral_helper : public true_type { }; template<> struct __is_integral_helper : public true_type { }; template<> struct __is_integral_helper : public true_type { }; template<> struct __is_integral_helper : public true_type { }; template<> struct __is_integral_helper : public true_type { }; template<> struct __is_integral_helper : public true_type { }; template<> struct __is_integral_helper : public true_type { }; template<> struct __is_integral_helper : public true_type { }; // Conditionalizing on __STRICT_ANSI__ here will break any port that // uses one of these types for size_t. #if defined(__GLIBCXX_TYPE_INT_N_0) template<> struct __is_integral_helper<__GLIBCXX_TYPE_INT_N_0> : public true_type { }; template<> struct __is_integral_helper : public true_type { }; #endif # 259 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/type_traits" 3 #if defined(__GLIBCXX_TYPE_INT_N_1) template<> struct __is_integral_helper<__GLIBCXX_TYPE_INT_N_1> : public true_type { }; template<> struct __is_integral_helper : public true_type { }; #endif # 268 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/type_traits" 3 #if defined(__GLIBCXX_TYPE_INT_N_2) template<> struct __is_integral_helper<__GLIBCXX_TYPE_INT_N_2> : public true_type { }; template<> struct __is_integral_helper : public true_type { }; #endif # 277 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/type_traits" 3 #if defined(__GLIBCXX_TYPE_INT_N_3) template<> struct __is_integral_helper<__GLIBCXX_TYPE_INT_N_3> : public true_type { }; template<> struct __is_integral_helper : public true_type { }; #endif # 286 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/type_traits" 3 /// is_integral template struct is_integral : public __is_integral_helper::type>::type { }; template struct __is_floating_point_helper : public false_type { }; template<> struct __is_floating_point_helper : public true_type { }; template<> struct __is_floating_point_helper : public true_type { }; template<> struct __is_floating_point_helper : public true_type { }; #if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_FLOAT128) template<> struct __is_floating_point_helper<__float128> : public true_type { }; #endif # 314 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/type_traits" 3 /// is_floating_point template struct is_floating_point : public __is_floating_point_helper::type>::type { }; /// is_array template struct is_array : public false_type { }; template struct is_array<_Tp[_Size]> : public true_type { }; template struct is_array<_Tp[]> : public true_type { }; template struct __is_pointer_helper : public false_type { }; template struct __is_pointer_helper<_Tp*> : public true_type { }; /// is_pointer template struct is_pointer : public __is_pointer_helper::type>::type { }; /// is_lvalue_reference template struct is_lvalue_reference : public false_type { }; template struct is_lvalue_reference<_Tp&> : public true_type { }; /// is_rvalue_reference template struct is_rvalue_reference : public false_type { }; template struct is_rvalue_reference<_Tp&&> : public true_type { }; template struct is_function; template struct __is_member_object_pointer_helper : public false_type { }; template struct __is_member_object_pointer_helper<_Tp _Cp::*> : public integral_constant::value> { }; /// is_member_object_pointer template struct is_member_object_pointer : public __is_member_object_pointer_helper< typename remove_cv<_Tp>::type>::type { }; template struct __is_member_function_pointer_helper : public false_type { }; template struct __is_member_function_pointer_helper<_Tp _Cp::*> : public integral_constant::value> { }; /// is_member_function_pointer template struct is_member_function_pointer : public __is_member_function_pointer_helper< typename remove_cv<_Tp>::type>::type { }; /// is_enum template struct is_enum : public integral_constant { }; /// is_union template struct is_union : public integral_constant { }; /// is_class template struct is_class : public integral_constant { }; /// is_function template struct is_function : public false_type { }; template struct is_function<_Res(_ArgTypes...)> : public true_type { }; template struct is_function<_Res(_ArgTypes...) &> : public true_type { }; template struct is_function<_Res(_ArgTypes...) &&> : public true_type { }; template struct is_function<_Res(_ArgTypes......)> : public true_type { }; template struct is_function<_Res(_ArgTypes......) &> : public true_type { }; template struct is_function<_Res(_ArgTypes......) &&> : public true_type { }; template struct is_function<_Res(_ArgTypes...) const> : public true_type { }; template struct is_function<_Res(_ArgTypes...) const &> : public true_type { }; template struct is_function<_Res(_ArgTypes...) const &&> : public true_type { }; template struct is_function<_Res(_ArgTypes......) const> : public true_type { }; template struct is_function<_Res(_ArgTypes......) const &> : public true_type { }; template struct is_function<_Res(_ArgTypes......) const &&> : public true_type { }; template struct is_function<_Res(_ArgTypes...) volatile> : public true_type { }; template struct is_function<_Res(_ArgTypes...) volatile &> : public true_type { }; template struct is_function<_Res(_ArgTypes...) volatile &&> : public true_type { }; template struct is_function<_Res(_ArgTypes......) volatile> : public true_type { }; template struct is_function<_Res(_ArgTypes......) volatile &> : public true_type { }; template struct is_function<_Res(_ArgTypes......) volatile &&> : public true_type { }; template struct is_function<_Res(_ArgTypes...) const volatile> : public true_type { }; template struct is_function<_Res(_ArgTypes...) const volatile &> : public true_type { }; template struct is_function<_Res(_ArgTypes...) const volatile &&> : public true_type { }; template struct is_function<_Res(_ArgTypes......) const volatile> : public true_type { }; template struct is_function<_Res(_ArgTypes......) const volatile &> : public true_type { }; template struct is_function<_Res(_ArgTypes......) const volatile &&> : public true_type { }; #define __cpp_lib_is_null_pointer 201309 template struct __is_null_pointer_helper : public false_type { }; template<> struct __is_null_pointer_helper : public true_type { }; /// is_null_pointer (LWG 2247). template struct is_null_pointer : public __is_null_pointer_helper::type>::type { }; /// __is_nullptr_t (extension). template struct __is_nullptr_t : public is_null_pointer<_Tp> { }; // Composite type categories. /// is_reference template struct is_reference : public __or_, is_rvalue_reference<_Tp>>::type { }; /// is_arithmetic template struct is_arithmetic : public __or_, is_floating_point<_Tp>>::type { }; /// is_fundamental template struct is_fundamental : public __or_, is_void<_Tp>, is_null_pointer<_Tp>>::type { }; /// is_object template struct is_object : public __not_<__or_, is_reference<_Tp>, is_void<_Tp>>>::type { }; template struct is_member_pointer; /// is_scalar template struct is_scalar : public __or_, is_enum<_Tp>, is_pointer<_Tp>, is_member_pointer<_Tp>, is_null_pointer<_Tp>>::type { }; /// is_compound template struct is_compound : public integral_constant::value> { }; template struct __is_member_pointer_helper : public false_type { }; template struct __is_member_pointer_helper<_Tp _Cp::*> : public true_type { }; /// is_member_pointer template struct is_member_pointer : public __is_member_pointer_helper::type>::type { }; // Utility to detect referenceable types ([defns.referenceable]). template struct __is_referenceable : public __or_, is_reference<_Tp>>::type { }; template struct __is_referenceable<_Res(_Args...)> : public true_type { }; template struct __is_referenceable<_Res(_Args......)> : public true_type { }; // Type properties. /// is_const template struct is_const : public false_type { }; template struct is_const<_Tp const> : public true_type { }; /// is_volatile template struct is_volatile : public false_type { }; template struct is_volatile<_Tp volatile> : public true_type { }; /// is_trivial template struct is_trivial : public integral_constant { }; // is_trivially_copyable template struct is_trivially_copyable : public integral_constant { }; /// is_standard_layout template struct is_standard_layout : public integral_constant { }; /// is_pod // Could use is_standard_layout && is_trivial instead of the builtin. template struct is_pod : public integral_constant { }; /// is_literal_type template struct is_literal_type : public integral_constant { }; /// is_empty template struct is_empty : public integral_constant { }; /// is_polymorphic template struct is_polymorphic : public integral_constant { }; #if __cplusplus >= 201402L #define __cpp_lib_is_final 201402L /// is_final template struct is_final : public integral_constant { }; #endif # 686 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/type_traits" 3 /// is_abstract template struct is_abstract : public integral_constant { }; template::value> struct __is_signed_helper : public false_type { }; template struct __is_signed_helper<_Tp, true> : public integral_constant { }; /// is_signed template struct is_signed : public __is_signed_helper<_Tp>::type { }; /// is_unsigned template struct is_unsigned : public __and_, __not_>>::type { }; // Destructible and constructible type properties. template struct add_rvalue_reference; /** * @brief Utility to simplify expressions used in unevaluated operands * @ingroup utilities */ template typename add_rvalue_reference<_Tp>::type declval() noexcept; template struct extent; template struct remove_all_extents; template struct __is_array_known_bounds : public integral_constant::value > 0)> { }; template struct __is_array_unknown_bounds : public __and_, __not_>>::type { }; // In N3290 is_destructible does not say anything about function // types and abstract types, see LWG 2049. This implementation // describes function types as non-destructible and all complete // object types as destructible, iff the explicit destructor // call expression is wellformed. struct __do_is_destructible_impl { template().~_Tp())> static true_type __test(int); template static false_type __test(...); }; template struct __is_destructible_impl : public __do_is_destructible_impl { typedef decltype(__test<_Tp>(0)) type; }; template, __is_array_unknown_bounds<_Tp>, is_function<_Tp>>::value, bool = __or_, is_scalar<_Tp>>::value> struct __is_destructible_safe; template struct __is_destructible_safe<_Tp, false, false> : public __is_destructible_impl::type>::type { }; template struct __is_destructible_safe<_Tp, true, false> : public false_type { }; template struct __is_destructible_safe<_Tp, false, true> : public true_type { }; /// is_destructible template struct is_destructible : public __is_destructible_safe<_Tp>::type { }; // is_nothrow_destructible requires that is_destructible is // satisfied as well. We realize that by mimicing the // implementation of is_destructible but refer to noexcept(expr) // instead of decltype(expr). struct __do_is_nt_destructible_impl { template static integral_constant().~_Tp())> __test(int); template static false_type __test(...); }; template struct __is_nt_destructible_impl : public __do_is_nt_destructible_impl { typedef decltype(__test<_Tp>(0)) type; }; template, __is_array_unknown_bounds<_Tp>, is_function<_Tp>>::value, bool = __or_, is_scalar<_Tp>>::value> struct __is_nt_destructible_safe; template struct __is_nt_destructible_safe<_Tp, false, false> : public __is_nt_destructible_impl::type>::type { }; template struct __is_nt_destructible_safe<_Tp, true, false> : public false_type { }; template struct __is_nt_destructible_safe<_Tp, false, true> : public true_type { }; /// is_nothrow_destructible template struct is_nothrow_destructible : public __is_nt_destructible_safe<_Tp>::type { }; struct __do_is_default_constructible_impl { template static true_type __test(int); template static false_type __test(...); }; template struct __is_default_constructible_impl : public __do_is_default_constructible_impl { typedef decltype(__test<_Tp>(0)) type; }; template struct __is_default_constructible_atom : public __and_<__not_>, __is_default_constructible_impl<_Tp>>::type { }; template::value> struct __is_default_constructible_safe; // The following technique is a workaround for a current core language // restriction, which does not allow for array types to occur in // functional casts of the form T(). Complete arrays can be default- // constructed, if the element type is default-constructible, but // arrays with unknown bounds are not. template struct __is_default_constructible_safe<_Tp, true> : public __and_<__is_array_known_bounds<_Tp>, __is_default_constructible_atom::type>>::type { }; template struct __is_default_constructible_safe<_Tp, false> : public __is_default_constructible_atom<_Tp>::type { }; /// is_default_constructible template struct is_default_constructible : public __is_default_constructible_safe<_Tp>::type { }; // Implementation of is_constructible. // The hardest part of this trait is the binary direct-initialization // case, because we hit into a functional cast of the form T(arg). // This implementation uses different strategies depending on the // target type to reduce the test overhead as much as possible: // // a) For a reference target type, we use a static_cast expression // modulo its extra cases. // // b) For a non-reference target type we use a ::new expression. struct __do_is_static_castable_impl { template(declval<_From>()))> static true_type __test(int); template static false_type __test(...); }; template struct __is_static_castable_impl : public __do_is_static_castable_impl { typedef decltype(__test<_From, _To>(0)) type; }; template struct __is_static_castable_safe : public __is_static_castable_impl<_From, _To>::type { }; // __is_static_castable template struct __is_static_castable : public integral_constant::value)> { }; // Implementation for non-reference types. To meet the proper // variable definition semantics, we also need to test for // is_destructible in this case. // This form should be simplified by a single expression: // ::delete ::new _Tp(declval<_Arg>()), see c++/51222. struct __do_is_direct_constructible_impl { template()))> static true_type __test(int); template static false_type __test(...); }; template struct __is_direct_constructible_impl : public __do_is_direct_constructible_impl { typedef decltype(__test<_Tp, _Arg>(0)) type; }; template struct __is_direct_constructible_new_safe : public __and_, __is_direct_constructible_impl<_Tp, _Arg>>::type { }; template struct is_same; template struct is_base_of; template struct remove_reference; template, is_function<_From>>>::value> struct __is_base_to_derived_ref; // Detect whether we have a downcast situation during // reference binding. template struct __is_base_to_derived_ref<_From, _To, true> { typedef typename remove_cv::type>::type __src_t; typedef typename remove_cv::type>::type __dst_t; typedef __and_<__not_>, is_base_of<__src_t, __dst_t>> type; static constexpr bool value = type::value; }; template struct __is_base_to_derived_ref<_From, _To, false> : public false_type { }; template, is_rvalue_reference<_To>>::value> struct __is_lvalue_to_rvalue_ref; // Detect whether we have an lvalue of non-function type // bound to a reference-compatible rvalue-reference. template struct __is_lvalue_to_rvalue_ref<_From, _To, true> { typedef typename remove_cv::type>::type __src_t; typedef typename remove_cv::type>::type __dst_t; typedef __and_<__not_>, __or_, is_base_of<__dst_t, __src_t>>> type; static constexpr bool value = type::value; }; template struct __is_lvalue_to_rvalue_ref<_From, _To, false> : public false_type { }; // Here we handle direct-initialization to a reference type as // equivalent to a static_cast modulo overshooting conversions. // These are restricted to the following conversions: // a) A base class value to a derived class reference // b) An lvalue to an rvalue-reference of reference-compatible // types that are not functions template struct __is_direct_constructible_ref_cast : public __and_<__is_static_castable<_Arg, _Tp>, __not_<__or_<__is_base_to_derived_ref<_Arg, _Tp>, __is_lvalue_to_rvalue_ref<_Arg, _Tp> >>>::type { }; template struct __is_direct_constructible_new : public conditional::value, __is_direct_constructible_ref_cast<_Tp, _Arg>, __is_direct_constructible_new_safe<_Tp, _Arg> >::type { }; template struct __is_direct_constructible : public __is_direct_constructible_new<_Tp, _Arg>::type { }; // Since default-construction and binary direct-initialization have // been handled separately, the implementation of the remaining // n-ary construction cases is rather straightforward. We can use // here a functional cast, because array types are excluded anyway // and this form is never interpreted as a C cast. struct __do_is_nary_constructible_impl { template()...))> static true_type __test(int); template static false_type __test(...); }; template struct __is_nary_constructible_impl : public __do_is_nary_constructible_impl { typedef decltype(__test<_Tp, _Args...>(0)) type; }; template struct __is_nary_constructible : public __is_nary_constructible_impl<_Tp, _Args...>::type { static_assert(sizeof...(_Args) > 1, "Only useful for > 1 arguments"); }; template struct __is_constructible_impl : public __is_nary_constructible<_Tp, _Args...> { }; template struct __is_constructible_impl<_Tp, _Arg> : public __is_direct_constructible<_Tp, _Arg> { }; template struct __is_constructible_impl<_Tp> : public is_default_constructible<_Tp> { }; /// is_constructible template struct is_constructible : public __is_constructible_impl<_Tp, _Args...>::type { }; template::value> struct __is_copy_constructible_impl; template struct __is_copy_constructible_impl<_Tp, false> : public false_type { }; template struct __is_copy_constructible_impl<_Tp, true> : public is_constructible<_Tp, const _Tp&> { }; /// is_copy_constructible template struct is_copy_constructible : public __is_copy_constructible_impl<_Tp> { }; template::value> struct __is_move_constructible_impl; template struct __is_move_constructible_impl<_Tp, false> : public false_type { }; template struct __is_move_constructible_impl<_Tp, true> : public is_constructible<_Tp, _Tp&&> { }; /// is_move_constructible template struct is_move_constructible : public __is_move_constructible_impl<_Tp> { }; template struct __is_nt_default_constructible_atom : public integral_constant { }; template::value> struct __is_nt_default_constructible_impl; template struct __is_nt_default_constructible_impl<_Tp, true> : public __and_<__is_array_known_bounds<_Tp>, __is_nt_default_constructible_atom::type>>::type { }; template struct __is_nt_default_constructible_impl<_Tp, false> : public __is_nt_default_constructible_atom<_Tp> { }; /// is_nothrow_default_constructible template struct is_nothrow_default_constructible : public __and_, __is_nt_default_constructible_impl<_Tp>>::type { }; template struct __is_nt_constructible_impl : public integral_constant()...))> { }; template struct __is_nt_constructible_impl<_Tp, _Arg> : public integral_constant(declval<_Arg>()))> { }; template struct __is_nt_constructible_impl<_Tp> : public is_nothrow_default_constructible<_Tp> { }; /// is_nothrow_constructible template struct is_nothrow_constructible : public __and_, __is_nt_constructible_impl<_Tp, _Args...>>::type { }; template::value> struct __is_nothrow_copy_constructible_impl; template struct __is_nothrow_copy_constructible_impl<_Tp, false> : public false_type { }; template struct __is_nothrow_copy_constructible_impl<_Tp, true> : public is_nothrow_constructible<_Tp, const _Tp&> { }; /// is_nothrow_copy_constructible template struct is_nothrow_copy_constructible : public __is_nothrow_copy_constructible_impl<_Tp> { }; template::value> struct __is_nothrow_move_constructible_impl; template struct __is_nothrow_move_constructible_impl<_Tp, false> : public false_type { }; template struct __is_nothrow_move_constructible_impl<_Tp, true> : public is_nothrow_constructible<_Tp, _Tp&&> { }; /// is_nothrow_move_constructible template struct is_nothrow_move_constructible : public __is_nothrow_move_constructible_impl<_Tp> { }; template class __is_assignable_helper { template() = declval<_Up1>())> static true_type __test(int); template static false_type __test(...); public: typedef decltype(__test<_Tp, _Up>(0)) type; }; /// is_assignable template struct is_assignable : public __is_assignable_helper<_Tp, _Up>::type { }; template::value> struct __is_copy_assignable_impl; template struct __is_copy_assignable_impl<_Tp, false> : public false_type { }; template struct __is_copy_assignable_impl<_Tp, true> : public is_assignable<_Tp&, const _Tp&> { }; /// is_copy_assignable template struct is_copy_assignable : public __is_copy_assignable_impl<_Tp> { }; template::value> struct __is_move_assignable_impl; template struct __is_move_assignable_impl<_Tp, false> : public false_type { }; template struct __is_move_assignable_impl<_Tp, true> : public is_assignable<_Tp&, _Tp&&> { }; /// is_move_assignable template struct is_move_assignable : public __is_move_assignable_impl<_Tp> { }; template struct __is_nt_assignable_impl : public integral_constant() = declval<_Up>())> { }; /// is_nothrow_assignable template struct is_nothrow_assignable : public __and_, __is_nt_assignable_impl<_Tp, _Up>>::type { }; template::value> struct __is_nt_copy_assignable_impl; template struct __is_nt_copy_assignable_impl<_Tp, false> : public false_type { }; template struct __is_nt_copy_assignable_impl<_Tp, true> : public is_nothrow_assignable<_Tp&, const _Tp&> { }; /// is_nothrow_copy_assignable template struct is_nothrow_copy_assignable : public __is_nt_copy_assignable_impl<_Tp> { }; template::value> struct __is_nt_move_assignable_impl; template struct __is_nt_move_assignable_impl<_Tp, false> : public false_type { }; template struct __is_nt_move_assignable_impl<_Tp, true> : public is_nothrow_assignable<_Tp&, _Tp&&> { }; /// is_nothrow_move_assignable template struct is_nothrow_move_assignable : public __is_nt_move_assignable_impl<_Tp> { }; /// is_trivially_constructible template struct is_trivially_constructible : public __and_, integral_constant>::type { }; /// is_trivially_default_constructible template struct is_trivially_default_constructible : public is_trivially_constructible<_Tp>::type { }; /// is_trivially_copy_constructible template struct is_trivially_copy_constructible : public __and_, integral_constant>::type { }; /// is_trivially_move_constructible template struct is_trivially_move_constructible : public __and_, integral_constant>::type { }; /// is_trivially_assignable template struct is_trivially_assignable : public __and_, integral_constant>::type { }; /// is_trivially_copy_assignable template struct is_trivially_copy_assignable : public __and_, integral_constant>::type { }; /// is_trivially_move_assignable template struct is_trivially_move_assignable : public __and_, integral_constant>::type { }; /// is_trivially_destructible template struct is_trivially_destructible : public __and_, integral_constant>::type { }; /// has_trivial_default_constructor (temporary legacy) template struct has_trivial_default_constructor : public integral_constant { } _GLIBCXX_DEPRECATED; /// has_trivial_copy_constructor (temporary legacy) template struct has_trivial_copy_constructor : public integral_constant { } _GLIBCXX_DEPRECATED; /// has_trivial_copy_assign (temporary legacy) template struct has_trivial_copy_assign : public integral_constant { } _GLIBCXX_DEPRECATED; /// has_virtual_destructor template struct has_virtual_destructor : public integral_constant { }; // type property queries. /// alignment_of template struct alignment_of : public integral_constant { }; /// rank template struct rank : public integral_constant { }; template struct rank<_Tp[_Size]> : public integral_constant::value> { }; template struct rank<_Tp[]> : public integral_constant::value> { }; /// extent template struct extent : public integral_constant { }; template struct extent<_Tp[_Size], _Uint> : public integral_constant::value> { }; template struct extent<_Tp[], _Uint> : public integral_constant::value> { }; // Type relations. /// is_same template struct is_same : public false_type { }; template struct is_same<_Tp, _Tp> : public true_type { }; /// is_base_of template struct is_base_of : public integral_constant { }; template, is_function<_To>, is_array<_To>>::value> struct __is_convertible_helper { typedef typename is_void<_To>::type type; }; template class __is_convertible_helper<_From, _To, false> { template static void __test_aux(_To1); template(std::declval<_From1>()))> static true_type __test(int); template static false_type __test(...); public: typedef decltype(__test<_From, _To>(0)) type; }; /// is_convertible template struct is_convertible : public __is_convertible_helper<_From, _To>::type { }; // Const-volatile modifications. /// remove_const template struct remove_const { typedef _Tp type; }; template struct remove_const<_Tp const> { typedef _Tp type; }; /// remove_volatile template struct remove_volatile { typedef _Tp type; }; template struct remove_volatile<_Tp volatile> { typedef _Tp type; }; /// remove_cv template struct remove_cv { typedef typename remove_const::type>::type type; }; /// add_const template struct add_const { typedef _Tp const type; }; /// add_volatile template struct add_volatile { typedef _Tp volatile type; }; /// add_cv template struct add_cv { typedef typename add_const::type>::type type; }; #if __cplusplus > 201103L #define __cpp_lib_transformation_trait_aliases 201304 /// Alias template for remove_const template using remove_const_t = typename remove_const<_Tp>::type; /// Alias template for remove_volatile template using remove_volatile_t = typename remove_volatile<_Tp>::type; /// Alias template for remove_cv template using remove_cv_t = typename remove_cv<_Tp>::type; /// Alias template for add_const template using add_const_t = typename add_const<_Tp>::type; /// Alias template for add_volatile template using add_volatile_t = typename add_volatile<_Tp>::type; /// Alias template for add_cv template using add_cv_t = typename add_cv<_Tp>::type; #endif # 1570 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/type_traits" 3 // Reference transformations. /// remove_reference template struct remove_reference { typedef _Tp type; }; template struct remove_reference<_Tp&> { typedef _Tp type; }; template struct remove_reference<_Tp&&> { typedef _Tp type; }; template::value> struct __add_lvalue_reference_helper { typedef _Tp type; }; template struct __add_lvalue_reference_helper<_Tp, true> { typedef _Tp& type; }; /// add_lvalue_reference template struct add_lvalue_reference : public __add_lvalue_reference_helper<_Tp> { }; template::value> struct __add_rvalue_reference_helper { typedef _Tp type; }; template struct __add_rvalue_reference_helper<_Tp, true> { typedef _Tp&& type; }; /// add_rvalue_reference template struct add_rvalue_reference : public __add_rvalue_reference_helper<_Tp> { }; #if __cplusplus > 201103L /// Alias template for remove_reference template using remove_reference_t = typename remove_reference<_Tp>::type; /// Alias template for add_lvalue_reference template using add_lvalue_reference_t = typename add_lvalue_reference<_Tp>::type; /// Alias template for add_rvalue_reference template using add_rvalue_reference_t = typename add_rvalue_reference<_Tp>::type; #endif # 1627 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/type_traits" 3 // Sign modifications. // Utility for constructing identically cv-qualified types. template struct __cv_selector; template struct __cv_selector<_Unqualified, false, false> { typedef _Unqualified __type; }; template struct __cv_selector<_Unqualified, false, true> { typedef volatile _Unqualified __type; }; template struct __cv_selector<_Unqualified, true, false> { typedef const _Unqualified __type; }; template struct __cv_selector<_Unqualified, true, true> { typedef const volatile _Unqualified __type; }; template::value, bool _IsVol = is_volatile<_Qualified>::value> class __match_cv_qualifiers { typedef __cv_selector<_Unqualified, _IsConst, _IsVol> __match; public: typedef typename __match::__type __type; }; // Utility for finding the unsigned versions of signed integral types. template struct __make_unsigned { typedef _Tp __type; }; template<> struct __make_unsigned { typedef unsigned char __type; }; template<> struct __make_unsigned { typedef unsigned char __type; }; template<> struct __make_unsigned { typedef unsigned short __type; }; template<> struct __make_unsigned { typedef unsigned int __type; }; template<> struct __make_unsigned { typedef unsigned long __type; }; template<> struct __make_unsigned { typedef unsigned long long __type; }; #if defined(_GLIBCXX_USE_WCHAR_T) && !defined(__WCHAR_UNSIGNED__) template<> struct __make_unsigned : __make_unsigned<__WCHAR_TYPE__> { }; #endif # 1695 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/type_traits" 3 #if defined(__GLIBCXX_TYPE_INT_N_0) template<> struct __make_unsigned<__GLIBCXX_TYPE_INT_N_0> { typedef unsigned __GLIBCXX_TYPE_INT_N_0 __type; }; #endif # 1701 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/type_traits" 3 #if defined(__GLIBCXX_TYPE_INT_N_1) template<> struct __make_unsigned<__GLIBCXX_TYPE_INT_N_1> { typedef unsigned __GLIBCXX_TYPE_INT_N_1 __type; }; #endif # 1706 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/type_traits" 3 #if defined(__GLIBCXX_TYPE_INT_N_2) template<> struct __make_unsigned<__GLIBCXX_TYPE_INT_N_2> { typedef unsigned __GLIBCXX_TYPE_INT_N_2 __type; }; #endif # 1711 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/type_traits" 3 #if defined(__GLIBCXX_TYPE_INT_N_3) template<> struct __make_unsigned<__GLIBCXX_TYPE_INT_N_3> { typedef unsigned __GLIBCXX_TYPE_INT_N_3 __type; }; #endif # 1716 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/type_traits" 3 // Select between integral and enum: not possible to be both. template::value, bool _IsEnum = is_enum<_Tp>::value> class __make_unsigned_selector; template class __make_unsigned_selector<_Tp, true, false> { typedef __make_unsigned::type> __unsignedt; typedef typename __unsignedt::__type __unsigned_type; typedef __match_cv_qualifiers<_Tp, __unsigned_type> __cv_unsigned; public: typedef typename __cv_unsigned::__type __type; }; template class __make_unsigned_selector<_Tp, false, true> { // With -fshort-enums, an enum may be as small as a char. typedef unsigned char __smallest; static const bool __b0 = sizeof(_Tp) <= sizeof(__smallest); static const bool __b1 = sizeof(_Tp) <= sizeof(unsigned short); static const bool __b2 = sizeof(_Tp) <= sizeof(unsigned int); typedef conditional<__b2, unsigned int, unsigned long> __cond2; typedef typename __cond2::type __cond2_type; typedef conditional<__b1, unsigned short, __cond2_type> __cond1; typedef typename __cond1::type __cond1_type; public: typedef typename conditional<__b0, __smallest, __cond1_type>::type __type; }; // Given an integral/enum type, return the corresponding unsigned // integer type. // Primary template. /// make_unsigned template struct make_unsigned { typedef typename __make_unsigned_selector<_Tp>::__type type; }; // Integral, but don't define. template<> struct make_unsigned; // Utility for finding the signed versions of unsigned integral types. template struct __make_signed { typedef _Tp __type; }; template<> struct __make_signed { typedef signed char __type; }; template<> struct __make_signed { typedef signed char __type; }; template<> struct __make_signed { typedef signed short __type; }; template<> struct __make_signed { typedef signed int __type; }; template<> struct __make_signed { typedef signed long __type; }; template<> struct __make_signed { typedef signed long long __type; }; #if defined(_GLIBCXX_USE_WCHAR_T) && defined(__WCHAR_UNSIGNED__) template<> struct __make_signed : __make_signed<__WCHAR_TYPE__> { }; #endif # 1798 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/type_traits" 3 #ifdef _GLIBCXX_USE_C99_STDINT_TR1 template<> struct __make_signed : __make_signed { }; template<> struct __make_signed : __make_signed { }; #endif # 1807 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/type_traits" 3 #if defined(__GLIBCXX_TYPE_INT_N_0) template<> struct __make_signed { typedef __GLIBCXX_TYPE_INT_N_0 __type; }; #endif # 1813 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/type_traits" 3 #if defined(__GLIBCXX_TYPE_INT_N_1) template<> struct __make_signed { typedef __GLIBCXX_TYPE_INT_N_1 __type; }; #endif # 1818 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/type_traits" 3 #if defined(__GLIBCXX_TYPE_INT_N_2) template<> struct __make_signed { typedef __GLIBCXX_TYPE_INT_N_2 __type; }; #endif # 1823 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/type_traits" 3 #if defined(__GLIBCXX_TYPE_INT_N_3) template<> struct __make_signed { typedef __GLIBCXX_TYPE_INT_N_3 __type; }; #endif # 1828 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/type_traits" 3 // Select between integral and enum: not possible to be both. template::value, bool _IsEnum = is_enum<_Tp>::value> class __make_signed_selector; template class __make_signed_selector<_Tp, true, false> { typedef __make_signed::type> __signedt; typedef typename __signedt::__type __signed_type; typedef __match_cv_qualifiers<_Tp, __signed_type> __cv_signed; public: typedef typename __cv_signed::__type __type; }; template class __make_signed_selector<_Tp, false, true> { // With -fshort-enums, an enum may be as small as a char. typedef signed char __smallest; static const bool __b0 = sizeof(_Tp) <= sizeof(__smallest); static const bool __b1 = sizeof(_Tp) <= sizeof(signed short); static const bool __b2 = sizeof(_Tp) <= sizeof(signed int); typedef conditional<__b2, signed int, signed long> __cond2; typedef typename __cond2::type __cond2_type; typedef conditional<__b1, signed short, __cond2_type> __cond1; typedef typename __cond1::type __cond1_type; public: typedef typename conditional<__b0, __smallest, __cond1_type>::type __type; }; // Given an integral/enum type, return the corresponding signed // integer type. // Primary template. /// make_signed template struct make_signed { typedef typename __make_signed_selector<_Tp>::__type type; }; // Integral, but don't define. template<> struct make_signed; #if __cplusplus > 201103L /// Alias template for make_signed template using make_signed_t = typename make_signed<_Tp>::type; /// Alias template for make_unsigned template using make_unsigned_t = typename make_unsigned<_Tp>::type; #endif # 1884 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/type_traits" 3 // Array modifications. /// remove_extent template struct remove_extent { typedef _Tp type; }; template struct remove_extent<_Tp[_Size]> { typedef _Tp type; }; template struct remove_extent<_Tp[]> { typedef _Tp type; }; /// remove_all_extents template struct remove_all_extents { typedef _Tp type; }; template struct remove_all_extents<_Tp[_Size]> { typedef typename remove_all_extents<_Tp>::type type; }; template struct remove_all_extents<_Tp[]> { typedef typename remove_all_extents<_Tp>::type type; }; #if __cplusplus > 201103L /// Alias template for remove_extent template using remove_extent_t = typename remove_extent<_Tp>::type; /// Alias template for remove_all_extents template using remove_all_extents_t = typename remove_all_extents<_Tp>::type; #endif # 1922 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/type_traits" 3 // Pointer modifications. template struct __remove_pointer_helper { typedef _Tp type; }; template struct __remove_pointer_helper<_Tp, _Up*> { typedef _Up type; }; /// remove_pointer template struct remove_pointer : public __remove_pointer_helper<_Tp, typename remove_cv<_Tp>::type> { }; /// add_pointer template, is_void<_Tp>>::value> struct __add_pointer_helper { typedef _Tp type; }; template struct __add_pointer_helper<_Tp, true> { typedef typename remove_reference<_Tp>::type* type; }; template struct add_pointer : public __add_pointer_helper<_Tp> { }; #if __cplusplus > 201103L /// Alias template for remove_pointer template using remove_pointer_t = typename remove_pointer<_Tp>::type; /// Alias template for add_pointer template using add_pointer_t = typename add_pointer<_Tp>::type; #endif # 1963 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/type_traits" 3 template struct __aligned_storage_msa { union __type { unsigned char __data[_Len]; struct __attribute__((__aligned__)) { } __align; }; }; /** * @brief Alignment type. * * The value of _Align is a default-alignment which shall be the * most stringent alignment requirement for any C++ object type * whose size is no greater than _Len (3.9). The member typedef * type shall be a POD type suitable for use as uninitialized * storage for any object whose size is at most _Len and whose * alignment is a divisor of _Align. */ template::__type)> struct aligned_storage { union type { unsigned char __data[_Len]; struct __attribute__((__aligned__((_Align)))) { } __align; }; }; template struct __strictest_alignment { static const size_t _S_alignment = 0; static const size_t _S_size = 0; }; template struct __strictest_alignment<_Tp, _Types...> { static const size_t _S_alignment = alignof(_Tp) > __strictest_alignment<_Types...>::_S_alignment ? alignof(_Tp) : __strictest_alignment<_Types...>::_S_alignment; static const size_t _S_size = sizeof(_Tp) > __strictest_alignment<_Types...>::_S_size ? sizeof(_Tp) : __strictest_alignment<_Types...>::_S_size; }; /** * @brief Provide aligned storage for types. * * [meta.trans.other] * * Provides aligned storage for any of the provided types of at * least size _Len. * * @see aligned_storage */ template struct aligned_union { private: static_assert(sizeof...(_Types) != 0, "At least one type is required"); using __strictest = __strictest_alignment<_Types...>; static const size_t _S_len = _Len > __strictest::_S_size ? _Len : __strictest::_S_size; public: /// The value of the strictest alignment of _Types. static const size_t alignment_value = __strictest::_S_alignment; /// The storage. typedef typename aligned_storage<_S_len, alignment_value>::type type; }; template const size_t aligned_union<_Len, _Types...>::alignment_value; // Decay trait for arrays and functions, used for perfect forwarding // in make_pair, make_tuple, etc. template::value, bool _IsFunction = is_function<_Up>::value> struct __decay_selector; // NB: DR 705. template struct __decay_selector<_Up, false, false> { typedef typename remove_cv<_Up>::type __type; }; template struct __decay_selector<_Up, true, false> { typedef typename remove_extent<_Up>::type* __type; }; template struct __decay_selector<_Up, false, true> { typedef typename add_pointer<_Up>::type __type; }; /// decay template class decay { typedef typename remove_reference<_Tp>::type __remove_type; public: typedef typename __decay_selector<__remove_type>::__type type; }; template class reference_wrapper; // Helper which adds a reference to a type when given a reference_wrapper template struct __strip_reference_wrapper { typedef _Tp __type; }; template struct __strip_reference_wrapper > { typedef _Tp& __type; }; template struct __decay_and_strip { typedef typename __strip_reference_wrapper< typename decay<_Tp>::type>::__type __type; }; // Primary template. /// Define a member typedef @c type only if a boolean constant is true. template struct enable_if { }; // Partial specialization for true. template struct enable_if { typedef _Tp type; }; template using _Require = typename enable_if<__and_<_Cond...>::value>::type; // Primary template. /// Define a member typedef @c type to one of two argument types. template struct conditional { typedef _Iftrue type; }; // Partial specialization for false. template struct conditional { typedef _Iffalse type; }; /// common_type template struct common_type; // Sfinae-friendly common_type implementation: struct __do_common_type_impl { template static __success_type() : std::declval<_Up>())>::type> _S_test(int); template static __failure_type _S_test(...); }; template struct __common_type_impl : private __do_common_type_impl { typedef decltype(_S_test<_Tp, _Up>(0)) type; }; struct __do_member_type_wrapper { template static __success_type _S_test(int); template static __failure_type _S_test(...); }; template struct __member_type_wrapper : private __do_member_type_wrapper { typedef decltype(_S_test<_Tp>(0)) type; }; template struct __expanded_common_type_wrapper { typedef common_type type; }; template struct __expanded_common_type_wrapper<__failure_type, _Args...> { typedef __failure_type type; }; template struct common_type<_Tp> { typedef typename decay<_Tp>::type type; }; template struct common_type<_Tp, _Up> : public __common_type_impl<_Tp, _Up>::type { }; template struct common_type<_Tp, _Up, _Vp...> : public __expanded_common_type_wrapper>::type, _Vp...>::type { }; /// The underlying type of an enum. template struct underlying_type { typedef __underlying_type(_Tp) type; }; template struct __declval_protector { static const bool __stop = false; static typename add_rvalue_reference<_Tp>::type __delegate(); }; template inline typename add_rvalue_reference<_Tp>::type declval() noexcept { static_assert(__declval_protector<_Tp>::__stop, "declval() must not be used!"); return __declval_protector<_Tp>::__delegate(); } /// result_of template class result_of; // Sfinae-friendly result_of implementation: #define __cpp_lib_result_of_sfinae 201210 // [func.require] paragraph 1 bullet 1: struct __result_of_memfun_ref_impl { template static __success_type().*std::declval<_Fp>())(std::declval<_Args>()...) )> _S_test(int); template static __failure_type _S_test(...); }; template struct __result_of_memfun_ref : private __result_of_memfun_ref_impl { typedef decltype(_S_test<_MemPtr, _Arg, _Args...>(0)) type; }; // [func.require] paragraph 1 bullet 2: struct __result_of_memfun_deref_impl { template static __success_type()).*std::declval<_Fp>())(std::declval<_Args>()...) )> _S_test(int); template static __failure_type _S_test(...); }; template struct __result_of_memfun_deref : private __result_of_memfun_deref_impl { typedef decltype(_S_test<_MemPtr, _Arg, _Args...>(0)) type; }; // [func.require] paragraph 1 bullet 3: struct __result_of_memobj_ref_impl { template static __success_type().*std::declval<_Fp>() )> _S_test(int); template static __failure_type _S_test(...); }; template struct __result_of_memobj_ref : private __result_of_memobj_ref_impl { typedef decltype(_S_test<_MemPtr, _Arg>(0)) type; }; // [func.require] paragraph 1 bullet 4: struct __result_of_memobj_deref_impl { template static __success_type()).*std::declval<_Fp>() )> _S_test(int); template static __failure_type _S_test(...); }; template struct __result_of_memobj_deref : private __result_of_memobj_deref_impl { typedef decltype(_S_test<_MemPtr, _Arg>(0)) type; }; template struct __result_of_memobj; template struct __result_of_memobj<_Res _Class::*, _Arg> { typedef typename remove_cv::type>::type _Argval; typedef _Res _Class::* _MemPtr; typedef typename conditional<__or_, is_base_of<_Class, _Argval>>::value, __result_of_memobj_ref<_MemPtr, _Arg>, __result_of_memobj_deref<_MemPtr, _Arg> >::type::type type; }; template struct __result_of_memfun; template struct __result_of_memfun<_Res _Class::*, _Arg, _Args...> { typedef typename remove_cv::type>::type _Argval; typedef _Res _Class::* _MemPtr; typedef typename conditional<__or_, is_base_of<_Class, _Argval>>::value, __result_of_memfun_ref<_MemPtr, _Arg, _Args...>, __result_of_memfun_deref<_MemPtr, _Arg, _Args...> >::type::type type; }; template struct __result_of_impl { typedef __failure_type type; }; template struct __result_of_impl : public __result_of_memobj::type, _Arg> { }; template struct __result_of_impl : public __result_of_memfun::type, _Arg, _Args...> { }; // [func.require] paragraph 1 bullet 5: struct __result_of_other_impl { template static __success_type()(std::declval<_Args>()...) )> _S_test(int); template static __failure_type _S_test(...); }; template struct __result_of_impl : private __result_of_other_impl { typedef decltype(_S_test<_Functor, _ArgTypes...>(0)) type; }; template struct result_of<_Functor(_ArgTypes...)> : public __result_of_impl< is_member_object_pointer< typename remove_reference<_Functor>::type >::value, is_member_function_pointer< typename remove_reference<_Functor>::type >::value, _Functor, _ArgTypes... >::type { }; #if __cplusplus > 201103L /// Alias template for aligned_storage template::__type)> using aligned_storage_t = typename aligned_storage<_Len, _Align>::type; template using aligned_union_t = typename aligned_union<_Len, _Types...>::type; /// Alias template for decay template using decay_t = typename decay<_Tp>::type; /// Alias template for enable_if template using enable_if_t = typename enable_if<_Cond, _Tp>::type; /// Alias template for conditional template using conditional_t = typename conditional<_Cond, _Iftrue, _Iffalse>::type; /// Alias template for common_type template using common_type_t = typename common_type<_Tp...>::type; /// Alias template for underlying_type template using underlying_type_t = typename underlying_type<_Tp>::type; /// Alias template for result_of template using result_of_t = typename result_of<_Tp>::type; #endif # 2406 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/type_traits" 3 template using __void_t = void; /// @} group metaprogramming /** * Use SFINAE to determine if the type _Tp has a publicly-accessible * member type _NTYPE. */ #define _GLIBCXX_HAS_NESTED_TYPE(_NTYPE) \ template> \ struct __has_##_NTYPE \ : false_type \ { }; \ template \ struct __has_##_NTYPE<_Tp, __void_t> \ : true_type \ { }; _GLIBCXX_END_NAMESPACE_VERSION } // namespace std #endif // C++11 # 2429 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/type_traits" 3 #endif // _GLIBCXX_TYPE_TRAITS # 2431 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/type_traits" 3 # 58 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/move.h" 2 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION /** * @addtogroup utilities * @{ */ /** * @brief Forward an lvalue. * @return The parameter cast to the specified type. * * This function is used to implement "perfect forwarding". */ template constexpr _Tp&& forward(typename std::remove_reference<_Tp>::type& __t) noexcept { return static_cast<_Tp&&>(__t); } /** * @brief Forward an rvalue. * @return The parameter cast to the specified type. * * This function is used to implement "perfect forwarding". */ template constexpr _Tp&& forward(typename std::remove_reference<_Tp>::type&& __t) noexcept { static_assert(!std::is_lvalue_reference<_Tp>::value, "template argument" " substituting _Tp is an lvalue reference type"); return static_cast<_Tp&&>(__t); } /** * @brief Convert a value to an rvalue. * @param __t A thing of arbitrary type. * @return The parameter cast to an rvalue-reference to allow moving it. */ template constexpr typename std::remove_reference<_Tp>::type&& move(_Tp&& __t) noexcept { return static_cast::type&&>(__t); } template struct __move_if_noexcept_cond : public __and_<__not_>, is_copy_constructible<_Tp>>::type { }; /** * @brief Conditionally convert a value to an rvalue. * @param __x A thing of arbitrary type. * @return The parameter, possibly cast to an rvalue-reference. * * Same as std::move unless the type's move constructor could throw and the * type is copyable, in which case an lvalue-reference is returned instead. */ template constexpr typename conditional<__move_if_noexcept_cond<_Tp>::value, const _Tp&, _Tp&&>::type move_if_noexcept(_Tp& __x) noexcept { return std::move(__x); } // declval, from type_traits. /** * @brief Returns the actual address of the object or function * referenced by r, even in the presence of an overloaded * operator&. * @param __r Reference to an object or function. * @return The actual address. */ template inline _Tp* addressof(_Tp& __r) noexcept { return std::__addressof(__r); } // C++11 version of std::exchange for internal use. template inline _Tp __exchange(_Tp& __obj, _Up&& __new_val) { _Tp __old_val = std::move(__obj); __obj = std::forward<_Up>(__new_val); return __old_val; } /// @} group utilities _GLIBCXX_END_NAMESPACE_VERSION } // namespace #define _GLIBCXX_MOVE(__val) std::move(__val) #define _GLIBCXX_FORWARD(_Tp, __val) std::forward<_Tp>(__val) #else # 155 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/move.h" 3 #define _GLIBCXX_MOVE(__val) (__val) #define _GLIBCXX_FORWARD(_Tp, __val) (__val) #endif # 158 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/move.h" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION /** * @addtogroup utilities * @{ */ /** * @brief Swaps two values. * @param __a A thing of arbitrary type. * @param __b Another thing of arbitrary type. * @return Nothing. */ template inline void swap(_Tp& __a, _Tp& __b) #if __cplusplus >= 201103L noexcept(__and_, is_nothrow_move_assignable<_Tp>>::value) #endif # 181 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/move.h" 3 { // concept requirements __glibcxx_function_requires(_SGIAssignableConcept<_Tp>) _Tp __tmp = _GLIBCXX_MOVE(__a); __a = _GLIBCXX_MOVE(__b); __b = _GLIBCXX_MOVE(__tmp); } // _GLIBCXX_RESOLVE_LIB_DEFECTS // DR 809. std::swap should be overloaded for array types. /// Swap the contents of two arrays. template inline void swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm]) #if __cplusplus >= 201103L noexcept(noexcept(swap(*__a, *__b))) #endif # 199 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/move.h" 3 { for (size_t __n = 0; __n < _Nm; ++__n) swap(__a[__n], __b[__n]); } /// @} group utilities _GLIBCXX_END_NAMESPACE_VERSION } // namespace #endif /* _MOVE_H */ # 209 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/move.h" 3 # 60 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_pair.h" 2 3 #if __cplusplus >= 201103L #if 0 /* expanded by -frewrite-includes */ #include // for std::__decay_and_strip too #endif /* expanded by -frewrite-includes */ # 62 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_pair.h" 3 # 63 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_pair.h" 3 #endif # 64 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_pair.h" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION /** * @addtogroup utilities * @{ */ #if __cplusplus >= 201103L /// piecewise_construct_t struct piecewise_construct_t { }; /// piecewise_construct constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t(); // Forward declarations. template class tuple; template struct _Index_tuple; #endif # 88 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_pair.h" 3 /** * @brief Struct holding two objects of arbitrary type. * * @tparam _T1 Type of first object. * @tparam _T2 Type of second object. */ template struct pair { typedef _T1 first_type; /// @c first_type is the first bound type typedef _T2 second_type; /// @c second_type is the second bound type _T1 first; /// @c first is a copy of the first object _T2 second; /// @c second is a copy of the second object // _GLIBCXX_RESOLVE_LIB_DEFECTS // 265. std::pair::pair() effects overly restrictive /** The default constructor creates @c first and @c second using their * respective default constructors. */ _GLIBCXX_CONSTEXPR pair() : first(), second() { } /** Two objects may be passed to a @c pair constructor to be copied. */ _GLIBCXX_CONSTEXPR pair(const _T1& __a, const _T2& __b) : first(__a), second(__b) { } /** There is also a templated copy ctor for the @c pair class itself. */ #if __cplusplus < 201103L template pair(const pair<_U1, _U2>& __p) : first(__p.first), second(__p.second) { } #else # 121 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_pair.h" 3 template, is_convertible>::value>::type> constexpr pair(const pair<_U1, _U2>& __p) : first(__p.first), second(__p.second) { } constexpr pair(const pair&) = default; constexpr pair(pair&&) = default; // DR 811. template::value>::type> constexpr pair(_U1&& __x, const _T2& __y) : first(std::forward<_U1>(__x)), second(__y) { } template::value>::type> constexpr pair(const _T1& __x, _U2&& __y) : first(__x), second(std::forward<_U2>(__y)) { } template, is_convertible<_U2, _T2>>::value>::type> constexpr pair(_U1&& __x, _U2&& __y) : first(std::forward<_U1>(__x)), second(std::forward<_U2>(__y)) { } template, is_convertible<_U2, _T2>>::value>::type> constexpr pair(pair<_U1, _U2>&& __p) : first(std::forward<_U1>(__p.first)), second(std::forward<_U2>(__p.second)) { } template pair(piecewise_construct_t, tuple<_Args1...>, tuple<_Args2...>); pair& operator=(const pair& __p) { first = __p.first; second = __p.second; return *this; } pair& operator=(pair&& __p) noexcept(__and_, is_nothrow_move_assignable<_T2>>::value) { first = std::forward(__p.first); second = std::forward(__p.second); return *this; } template pair& operator=(const pair<_U1, _U2>& __p) { first = __p.first; second = __p.second; return *this; } template pair& operator=(pair<_U1, _U2>&& __p) { first = std::forward<_U1>(__p.first); second = std::forward<_U2>(__p.second); return *this; } void swap(pair& __p) noexcept(noexcept(swap(first, __p.first)) && noexcept(swap(second, __p.second))) { using std::swap; swap(first, __p.first); swap(second, __p.second); } private: template pair(tuple<_Args1...>&, tuple<_Args2...>&, _Index_tuple<_Indexes1...>, _Index_tuple<_Indexes2...>); #endif # 209 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_pair.h" 3 }; /// Two pairs of the same type are equal iff their members are equal. template inline _GLIBCXX_CONSTEXPR bool operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) { return __x.first == __y.first && __x.second == __y.second; } /// template inline _GLIBCXX_CONSTEXPR bool operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) { return __x.first < __y.first || (!(__y.first < __x.first) && __x.second < __y.second); } /// Uses @c operator== to find the result. template inline _GLIBCXX_CONSTEXPR bool operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) { return !(__x == __y); } /// Uses @c operator< to find the result. template inline _GLIBCXX_CONSTEXPR bool operator>(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) { return __y < __x; } /// Uses @c operator< to find the result. template inline _GLIBCXX_CONSTEXPR bool operator<=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) { return !(__y < __x); } /// Uses @c operator< to find the result. template inline _GLIBCXX_CONSTEXPR bool operator>=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) { return !(__x < __y); } #if __cplusplus >= 201103L /// See std::pair::swap(). // Note: no std::swap overloads in C++03 mode, this has performance // implications, see, eg, libstdc++/38466. template inline void swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y) noexcept(noexcept(__x.swap(__y))) { __x.swap(__y); } #endif # 258 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_pair.h" 3 /** * @brief A convenience wrapper for creating a pair from two objects. * @param __x The first object. * @param __y The second object. * @return A newly-constructed pair<> object of the appropriate type. * * The standard requires that the objects be passed by reference-to-const, * but LWG issue #181 says they should be passed by const value. We follow * the LWG by default. */ // _GLIBCXX_RESOLVE_LIB_DEFECTS // 181. make_pair() unintended behavior #if __cplusplus >= 201103L // NB: DR 706. template constexpr pair::__type, typename __decay_and_strip<_T2>::__type> make_pair(_T1&& __x, _T2&& __y) { typedef typename __decay_and_strip<_T1>::__type __ds_type1; typedef typename __decay_and_strip<_T2>::__type __ds_type2; typedef pair<__ds_type1, __ds_type2> __pair_type; return __pair_type(std::forward<_T1>(__x), std::forward<_T2>(__y)); } #else # 284 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_pair.h" 3 template inline pair<_T1, _T2> make_pair(_T1 __x, _T2 __y) { return pair<_T1, _T2>(__x, __y); } #endif # 289 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_pair.h" 3 /// @} _GLIBCXX_END_NAMESPACE_VERSION } // namespace std #endif /* _STL_PAIR_H */ # 296 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_pair.h" 3 # 65 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algobase.h" 2 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 65 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algobase.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_iterator_base_types.h" 1 3 // Types used in iterator implementation -*- C++ -*- // Copyright (C) 2001-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /* * * Copyright (c) 1994 * Hewlett-Packard Company * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Hewlett-Packard Company makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. * * * Copyright (c) 1996-1998 * Silicon Graphics Computer Systems, Inc. * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Silicon Graphics makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. */ /** @file bits/stl_iterator_base_types.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{iterator} * * This file contains all of the general iterator-related utility types, * such as iterator_traits and struct iterator. */ #ifndef _STL_ITERATOR_BASE_TYPES_H #define _STL_ITERATOR_BASE_TYPES_H 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 63 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_iterator_base_types.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 64 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_iterator_base_types.h" 3 # 65 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_iterator_base_types.h" 3 #if __cplusplus >= 201103L #if 0 /* expanded by -frewrite-includes */ # include // For __void_t, is_convertible #endif /* expanded by -frewrite-includes */ # 67 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_iterator_base_types.h" 3 # 68 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_iterator_base_types.h" 3 #endif # 69 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_iterator_base_types.h" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION /** * @defgroup iterators Iterators * Abstractions for uniform iterating through various underlying types. */ //@{ /** * @defgroup iterator_tags Iterator Tags * These are empty types, used to distinguish different iterators. The * distinction is not made by what they contain, but simply by what they * are. Different underlying algorithms can then be used based on the * different operations supported by different iterator types. */ //@{ /// Marking input iterators. struct input_iterator_tag { }; /// Marking output iterators. struct output_iterator_tag { }; /// Forward iterators support a superset of input iterator operations. struct forward_iterator_tag : public input_iterator_tag { }; /// Bidirectional iterators support a superset of forward iterator /// operations. struct bidirectional_iterator_tag : public forward_iterator_tag { }; /// Random-access iterators support a superset of bidirectional /// iterator operations. struct random_access_iterator_tag : public bidirectional_iterator_tag { }; //@} /** * @brief Common %iterator class. * * This class does nothing but define nested typedefs. %Iterator classes * can inherit from this class to save some work. The typedefs are then * used in specializations and overloading. * * In particular, there are no default implementations of requirements * such as @c operator++ and the like. (How could there be?) */ template struct iterator { /// One of the @link iterator_tags tag types@endlink. typedef _Category iterator_category; /// The type "pointed to" by the iterator. typedef _Tp value_type; /// Distance between iterators is represented as this type. typedef _Distance difference_type; /// This type represents a pointer-to-value_type. typedef _Pointer pointer; /// This type represents a reference-to-value_type. typedef _Reference reference; }; /** * @brief Traits class for iterators. * * This class does nothing but define nested typedefs. The general * version simply @a forwards the nested typedefs from the Iterator * argument. Specialized versions for pointers and pointers-to-const * provide tighter, more correct semantics. */ #if __cplusplus >= 201103L // _GLIBCXX_RESOLVE_LIB_DEFECTS // 2408. SFINAE-friendly common_type/iterator_traits is missing in C++14 template> struct __iterator_traits { }; template struct __iterator_traits<_Iterator, __void_t> { typedef typename _Iterator::iterator_category iterator_category; typedef typename _Iterator::value_type value_type; typedef typename _Iterator::difference_type difference_type; typedef typename _Iterator::pointer pointer; typedef typename _Iterator::reference reference; }; template struct iterator_traits : public __iterator_traits<_Iterator> { }; #else # 165 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_iterator_base_types.h" 3 template struct iterator_traits { typedef typename _Iterator::iterator_category iterator_category; typedef typename _Iterator::value_type value_type; typedef typename _Iterator::difference_type difference_type; typedef typename _Iterator::pointer pointer; typedef typename _Iterator::reference reference; }; #endif # 175 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_iterator_base_types.h" 3 /// Partial specialization for pointer types. template struct iterator_traits<_Tp*> { typedef random_access_iterator_tag iterator_category; typedef _Tp value_type; typedef ptrdiff_t difference_type; typedef _Tp* pointer; typedef _Tp& reference; }; /// Partial specialization for const pointer types. template struct iterator_traits { typedef random_access_iterator_tag iterator_category; typedef _Tp value_type; typedef ptrdiff_t difference_type; typedef const _Tp* pointer; typedef const _Tp& reference; }; /** * This function is not a part of the C++ standard but is syntactic * sugar for internal library use only. */ template inline typename iterator_traits<_Iter>::iterator_category __iterator_category(const _Iter&) { return typename iterator_traits<_Iter>::iterator_category(); } //@} // If _Iterator has a base returns it otherwise _Iterator is returned // untouched template struct _Iter_base { typedef _Iterator iterator_type; static iterator_type _S_base(_Iterator __it) { return __it; } }; template struct _Iter_base<_Iterator, true> { typedef typename _Iterator::iterator_type iterator_type; static iterator_type _S_base(_Iterator __it) { return __it.base(); } }; #if __cplusplus >= 201103L template using _RequireInputIter = typename enable_if::iterator_category, input_iterator_tag>::value>::type; #endif # 234 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_iterator_base_types.h" 3 _GLIBCXX_END_NAMESPACE_VERSION } // namespace #endif /* _STL_ITERATOR_BASE_TYPES_H */ # 239 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_iterator_base_types.h" 3 # 66 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algobase.h" 2 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 66 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algobase.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_iterator_base_funcs.h" 1 3 // Functions used by iterators -*- C++ -*- // Copyright (C) 2001-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /* * * Copyright (c) 1994 * Hewlett-Packard Company * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Hewlett-Packard Company makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. * * * Copyright (c) 1996-1998 * Silicon Graphics Computer Systems, Inc. * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Silicon Graphics makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. */ /** @file bits/stl_iterator_base_funcs.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{iterator} * * This file contains all of the general iterator-related utility * functions, such as distance() and advance(). */ #ifndef _STL_ITERATOR_BASE_FUNCS_H #define _STL_ITERATOR_BASE_FUNCS_H 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 63 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_iterator_base_funcs.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 64 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_iterator_base_funcs.h" 3 # 65 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_iterator_base_funcs.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 65 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_iterator_base_funcs.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/debug/debug.h" 1 3 // Debugging support implementation -*- C++ -*- // Copyright (C) 2003-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file debug/debug.h * This file is a GNU debug extension to the Standard C++ Library. */ #ifndef _GLIBCXX_DEBUG_MACRO_SWITCH_H #define _GLIBCXX_DEBUG_MACRO_SWITCH_H 1 /** Macros and namespaces used by the implementation outside of debug * wrappers to verify certain properties. The __glibcxx_requires_xxx * macros are merely wrappers around the __glibcxx_check_xxx wrappers * when we are compiling with debug mode, but disappear when we are * in release mode so that there is no checking performed in, e.g., * the standard library algorithms. */ // Debug mode namespaces. /** * @namespace std::__debug * @brief GNU debug code, replaces standard behavior with debug behavior. */ namespace std { namespace __debug { } } /** @namespace __gnu_debug * @brief GNU debug classes for public use. */ namespace __gnu_debug { using namespace std::__debug; } #ifndef _GLIBCXX_DEBUG # define _GLIBCXX_DEBUG_ASSERT(_Condition) # define _GLIBCXX_DEBUG_PEDASSERT(_Condition) # define _GLIBCXX_DEBUG_ONLY(_Statement) ; # define __glibcxx_requires_cond(_Cond,_Msg) # define __glibcxx_requires_valid_range(_First,_Last) # define __glibcxx_requires_non_empty_range(_First,_Last) # define __glibcxx_requires_sorted(_First,_Last) # define __glibcxx_requires_sorted_pred(_First,_Last,_Pred) # define __glibcxx_requires_sorted_set(_First1,_Last1,_First2) # define __glibcxx_requires_sorted_set_pred(_First1,_Last1,_First2,_Pred) # define __glibcxx_requires_partitioned_lower(_First,_Last,_Value) # define __glibcxx_requires_partitioned_upper(_First,_Last,_Value) # define __glibcxx_requires_partitioned_lower_pred(_First,_Last,_Value,_Pred) # define __glibcxx_requires_partitioned_upper_pred(_First,_Last,_Value,_Pred) # define __glibcxx_requires_heap(_First,_Last) # define __glibcxx_requires_heap_pred(_First,_Last,_Pred) # define __glibcxx_requires_nonempty() # define __glibcxx_requires_string(_String) # define __glibcxx_requires_string_len(_String,_Len) # define __glibcxx_requires_subscript(_N) #else # 83 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/debug/debug.h" 3 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 84 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/debug/debug.h" 3 # 85 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/debug/debug.h" 3 #define _GLIBCXX_DEBUG_ASSERT(_Condition) __glibcxx_assert(_Condition) #ifdef _GLIBCXX_DEBUG_PEDANTIC # define _GLIBCXX_DEBUG_PEDASSERT(_Condition) _GLIBCXX_DEBUG_ASSERT(_Condition) #else # 91 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/debug/debug.h" 3 # define _GLIBCXX_DEBUG_PEDASSERT(_Condition) #endif # 93 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/debug/debug.h" 3 # define _GLIBCXX_DEBUG_ONLY(_Statement) _Statement # define __glibcxx_requires_cond(_Cond,_Msg) _GLIBCXX_DEBUG_VERIFY(_Cond,_Msg) # define __glibcxx_requires_valid_range(_First,_Last) \ __glibcxx_check_valid_range(_First,_Last) # define __glibcxx_requires_non_empty_range(_First,_Last) \ __glibcxx_check_non_empty_range(_First,_Last) # define __glibcxx_requires_sorted(_First,_Last) \ __glibcxx_check_sorted(_First,_Last) # define __glibcxx_requires_sorted_pred(_First,_Last,_Pred) \ __glibcxx_check_sorted_pred(_First,_Last,_Pred) # define __glibcxx_requires_sorted_set(_First1,_Last1,_First2) \ __glibcxx_check_sorted_set(_First1,_Last1,_First2) # define __glibcxx_requires_sorted_set_pred(_First1,_Last1,_First2,_Pred) \ __glibcxx_check_sorted_set_pred(_First1,_Last1,_First2,_Pred) # define __glibcxx_requires_partitioned_lower(_First,_Last,_Value) \ __glibcxx_check_partitioned_lower(_First,_Last,_Value) # define __glibcxx_requires_partitioned_upper(_First,_Last,_Value) \ __glibcxx_check_partitioned_upper(_First,_Last,_Value) # define __glibcxx_requires_partitioned_lower_pred(_First,_Last,_Value,_Pred) \ __glibcxx_check_partitioned_lower_pred(_First,_Last,_Value,_Pred) # define __glibcxx_requires_partitioned_upper_pred(_First,_Last,_Value,_Pred) \ __glibcxx_check_partitioned_upper_pred(_First,_Last,_Value,_Pred) # define __glibcxx_requires_heap(_First,_Last) \ __glibcxx_check_heap(_First,_Last) # define __glibcxx_requires_heap_pred(_First,_Last,_Pred) \ __glibcxx_check_heap_pred(_First,_Last,_Pred) # define __glibcxx_requires_nonempty() __glibcxx_check_nonempty() # define __glibcxx_requires_string(_String) __glibcxx_check_string(_String) # define __glibcxx_requires_string_len(_String,_Len) \ __glibcxx_check_string_len(_String,_Len) # define __glibcxx_requires_subscript(_N) __glibcxx_check_subscript(_N) #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 127 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/debug/debug.h" 3 # 128 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/debug/debug.h" 3 #endif # 130 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/debug/debug.h" 3 #endif // _GLIBCXX_DEBUG_MACRO_SWITCH_H # 132 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/debug/debug.h" 3 # 66 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_iterator_base_funcs.h" 2 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION template inline typename iterator_traits<_InputIterator>::difference_type __distance(_InputIterator __first, _InputIterator __last, input_iterator_tag) { // concept requirements __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) typename iterator_traits<_InputIterator>::difference_type __n = 0; while (__first != __last) { ++__first; ++__n; } return __n; } template inline typename iterator_traits<_RandomAccessIterator>::difference_type __distance(_RandomAccessIterator __first, _RandomAccessIterator __last, random_access_iterator_tag) { // concept requirements __glibcxx_function_requires(_RandomAccessIteratorConcept< _RandomAccessIterator>) return __last - __first; } /** * @brief A generalization of pointer arithmetic. * @param __first An input iterator. * @param __last An input iterator. * @return The distance between them. * * Returns @c n such that __first + n == __last. This requires * that @p __last must be reachable from @p __first. Note that @c * n may be negative. * * For random access iterators, this uses their @c + and @c - operations * and are constant time. For other %iterator classes they are linear time. */ template inline typename iterator_traits<_InputIterator>::difference_type distance(_InputIterator __first, _InputIterator __last) { // concept requirements -- taken care of in __distance return std::__distance(__first, __last, std::__iterator_category(__first)); } template inline void __advance(_InputIterator& __i, _Distance __n, input_iterator_tag) { // concept requirements __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) _GLIBCXX_DEBUG_ASSERT(__n >= 0); while (__n--) ++__i; } template inline void __advance(_BidirectionalIterator& __i, _Distance __n, bidirectional_iterator_tag) { // concept requirements __glibcxx_function_requires(_BidirectionalIteratorConcept< _BidirectionalIterator>) if (__n > 0) while (__n--) ++__i; else while (__n++) --__i; } template inline void __advance(_RandomAccessIterator& __i, _Distance __n, random_access_iterator_tag) { // concept requirements __glibcxx_function_requires(_RandomAccessIteratorConcept< _RandomAccessIterator>) __i += __n; } /** * @brief A generalization of pointer arithmetic. * @param __i An input iterator. * @param __n The @a delta by which to change @p __i. * @return Nothing. * * This increments @p i by @p n. For bidirectional and random access * iterators, @p __n may be negative, in which case @p __i is decremented. * * For random access iterators, this uses their @c + and @c - operations * and are constant time. For other %iterator classes they are linear time. */ template inline void advance(_InputIterator& __i, _Distance __n) { // concept requirements -- taken care of in __advance typename iterator_traits<_InputIterator>::difference_type __d = __n; std::__advance(__i, __d, std::__iterator_category(__i)); } #if __cplusplus >= 201103L template inline _ForwardIterator next(_ForwardIterator __x, typename iterator_traits<_ForwardIterator>::difference_type __n = 1) { std::advance(__x, __n); return __x; } template inline _BidirectionalIterator prev(_BidirectionalIterator __x, typename iterator_traits<_BidirectionalIterator>::difference_type __n = 1) { std::advance(__x, -__n); return __x; } #endif // C++11 # 201 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_iterator_base_funcs.h" 3 _GLIBCXX_END_NAMESPACE_VERSION } // namespace #endif /* _STL_ITERATOR_BASE_FUNCS_H */ # 206 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_iterator_base_funcs.h" 3 # 67 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algobase.h" 2 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 67 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algobase.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_iterator.h" 1 3 // Iterators -*- C++ -*- // Copyright (C) 2001-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /* * * Copyright (c) 1994 * Hewlett-Packard Company * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Hewlett-Packard Company makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. * * * Copyright (c) 1996-1998 * Silicon Graphics Computer Systems, Inc. * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Silicon Graphics makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. */ /** @file bits/stl_iterator.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{iterator} * * This file implements reverse_iterator, back_insert_iterator, * front_insert_iterator, insert_iterator, __normal_iterator, and their * supporting functions and overloaded operators. */ #ifndef _STL_ITERATOR_H #define _STL_ITERATOR_H 1 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 63 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_iterator.h" 3 # 64 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_iterator.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 64 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_iterator.h" 3 # 65 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_iterator.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 65 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_iterator.h" 3 # 66 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_iterator.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 66 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_iterator.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/ptr_traits.h" 1 3 // Pointer Traits -*- C++ -*- // Copyright (C) 2011-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file bits/ptr_traits.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{memory} */ #ifndef _PTR_TRAITS_H #define _PTR_TRAITS_H 1 #if __cplusplus >= 201103L #if 0 /* expanded by -frewrite-includes */ #include // For _GLIBCXX_HAS_NESTED_TYPE #endif /* expanded by -frewrite-includes */ # 35 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/ptr_traits.h" 3 # 36 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/ptr_traits.h" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION _GLIBCXX_HAS_NESTED_TYPE(element_type) _GLIBCXX_HAS_NESTED_TYPE(difference_type) template::value> struct __ptrtr_elt_type; template struct __ptrtr_elt_type<_Tp, true> { typedef typename _Tp::element_type __type; }; template class _SomePtr, typename _Tp, typename... _Args> struct __ptrtr_elt_type<_SomePtr<_Tp, _Args...>, false> { typedef _Tp __type; }; template::value> struct __ptrtr_diff_type { typedef typename _Tp::difference_type __type; }; template struct __ptrtr_diff_type<_Tp, false> { typedef ptrdiff_t __type; }; template class __ptrtr_rebind_helper { template static constexpr true_type _S_chk(typename _Ptr2::template rebind<_Up2>*); template static constexpr false_type _S_chk(...); public: using __type = decltype(_S_chk<_Ptr, _Up>(nullptr)); }; template::__type::value> struct __ptrtr_rebind; template struct __ptrtr_rebind<_Tp, _Up, true> { typedef typename _Tp::template rebind<_Up> __type; }; template class _SomePtr, typename _Up, typename _Tp, typename... _Args> struct __ptrtr_rebind<_SomePtr<_Tp, _Args...>, _Up, false> { typedef _SomePtr<_Up, _Args...> __type; }; template::type> struct __ptrtr_not_void { typedef _Tp __type; }; template struct __ptrtr_not_void<_Tp, void> { struct __type { }; }; template class __ptrtr_pointer_to { typedef typename __ptrtr_elt_type<_Ptr>::__type __orig_type; typedef typename __ptrtr_not_void<__orig_type>::__type __element_type; public: static _Ptr pointer_to(__element_type& __e) { return _Ptr::pointer_to(__e); } }; /** * @brief Uniform interface to all pointer-like types * @ingroup pointer_abstractions */ template struct pointer_traits : __ptrtr_pointer_to<_Ptr> { /// The pointer type typedef _Ptr pointer; /// The type pointed to typedef typename __ptrtr_elt_type<_Ptr>::__type element_type; /// Type used to represent the difference between two pointers typedef typename __ptrtr_diff_type<_Ptr>::__type difference_type; template using rebind = typename __ptrtr_rebind<_Ptr, _Up>::__type; }; /** * @brief Partial specialization for built-in pointers. * @ingroup pointer_abstractions */ template struct pointer_traits<_Tp*> { /// The pointer type typedef _Tp* pointer; /// The type pointed to typedef _Tp element_type; /// Type used to represent the difference between two pointers typedef ptrdiff_t difference_type; template using rebind = _Up*; /** * @brief Obtain a pointer to an object * @param __r A reference to an object of type @c element_type * @return @c addressof(__r) */ static pointer pointer_to(typename __ptrtr_not_void::__type& __r) noexcept { return std::addressof(__r); } }; _GLIBCXX_END_NAMESPACE_VERSION } // namespace std #endif # 176 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/ptr_traits.h" 3 #endif # 178 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/ptr_traits.h" 3 # 67 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_iterator.h" 2 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION /** * @addtogroup iterators * @{ */ // 24.4.1 Reverse iterators /** * Bidirectional and random access iterators have corresponding reverse * %iterator adaptors that iterate through the data structure in the * opposite direction. They have the same signatures as the corresponding * iterators. The fundamental relation between a reverse %iterator and its * corresponding %iterator @c i is established by the identity: * @code * &*(reverse_iterator(i)) == &*(i - 1) * @endcode * * This mapping is dictated by the fact that while there is always a * pointer past the end of an array, there might not be a valid pointer * before the beginning of an array. [24.4.1]/1,2 * * Reverse iterators can be tricky and surprising at first. Their * semantics make sense, however, and the trickiness is a side effect of * the requirement that the iterators must be safe. */ template class reverse_iterator : public iterator::iterator_category, typename iterator_traits<_Iterator>::value_type, typename iterator_traits<_Iterator>::difference_type, typename iterator_traits<_Iterator>::pointer, typename iterator_traits<_Iterator>::reference> { protected: _Iterator current; typedef iterator_traits<_Iterator> __traits_type; public: typedef _Iterator iterator_type; typedef typename __traits_type::difference_type difference_type; typedef typename __traits_type::pointer pointer; typedef typename __traits_type::reference reference; /** * The default constructor value-initializes member @p current. * If it is a pointer, that means it is zero-initialized. */ // _GLIBCXX_RESOLVE_LIB_DEFECTS // 235 No specification of default ctor for reverse_iterator reverse_iterator() : current() { } /** * This %iterator will move in the opposite direction that @p x does. */ explicit reverse_iterator(iterator_type __x) : current(__x) { } /** * The copy constructor is normal. */ reverse_iterator(const reverse_iterator& __x) : current(__x.current) { } /** * A %reverse_iterator across other types can be copied if the * underlying %iterator can be converted to the type of @c current. */ template reverse_iterator(const reverse_iterator<_Iter>& __x) : current(__x.base()) { } /** * @return @c current, the %iterator used for underlying work. */ iterator_type base() const { return current; } /** * @return A reference to the value at @c --current * * This requires that @c --current is dereferenceable. * * @warning This implementation requires that for an iterator of the * underlying iterator type, @c x, a reference obtained by * @c *x remains valid after @c x has been modified or * destroyed. This is a bug: http://gcc.gnu.org/PR51823 */ reference operator*() const { _Iterator __tmp = current; return *--__tmp; } /** * @return A pointer to the value at @c --current * * This requires that @c --current is dereferenceable. */ pointer operator->() const { return &(operator*()); } /** * @return @c *this * * Decrements the underlying iterator. */ reverse_iterator& operator++() { --current; return *this; } /** * @return The original value of @c *this * * Decrements the underlying iterator. */ reverse_iterator operator++(int) { reverse_iterator __tmp = *this; --current; return __tmp; } /** * @return @c *this * * Increments the underlying iterator. */ reverse_iterator& operator--() { ++current; return *this; } /** * @return A reverse_iterator with the previous value of @c *this * * Increments the underlying iterator. */ reverse_iterator operator--(int) { reverse_iterator __tmp = *this; ++current; return __tmp; } /** * @return A reverse_iterator that refers to @c current - @a __n * * The underlying iterator must be a Random Access Iterator. */ reverse_iterator operator+(difference_type __n) const { return reverse_iterator(current - __n); } /** * @return *this * * Moves the underlying iterator backwards @a __n steps. * The underlying iterator must be a Random Access Iterator. */ reverse_iterator& operator+=(difference_type __n) { current -= __n; return *this; } /** * @return A reverse_iterator that refers to @c current - @a __n * * The underlying iterator must be a Random Access Iterator. */ reverse_iterator operator-(difference_type __n) const { return reverse_iterator(current + __n); } /** * @return *this * * Moves the underlying iterator forwards @a __n steps. * The underlying iterator must be a Random Access Iterator. */ reverse_iterator& operator-=(difference_type __n) { current += __n; return *this; } /** * @return The value at @c current - @a __n - 1 * * The underlying iterator must be a Random Access Iterator. */ reference operator[](difference_type __n) const { return *(*this + __n); } }; //@{ /** * @param __x A %reverse_iterator. * @param __y A %reverse_iterator. * @return A simple bool. * * Reverse iterators forward many operations to their underlying base() * iterators. Others are implemented in terms of one another. * */ template inline bool operator==(const reverse_iterator<_Iterator>& __x, const reverse_iterator<_Iterator>& __y) { return __x.base() == __y.base(); } template inline bool operator<(const reverse_iterator<_Iterator>& __x, const reverse_iterator<_Iterator>& __y) { return __y.base() < __x.base(); } template inline bool operator!=(const reverse_iterator<_Iterator>& __x, const reverse_iterator<_Iterator>& __y) { return !(__x == __y); } template inline bool operator>(const reverse_iterator<_Iterator>& __x, const reverse_iterator<_Iterator>& __y) { return __y < __x; } template inline bool operator<=(const reverse_iterator<_Iterator>& __x, const reverse_iterator<_Iterator>& __y) { return !(__y < __x); } template inline bool operator>=(const reverse_iterator<_Iterator>& __x, const reverse_iterator<_Iterator>& __y) { return !(__x < __y); } template #if __cplusplus < 201103L inline typename reverse_iterator<_Iterator>::difference_type operator-(const reverse_iterator<_Iterator>& __x, const reverse_iterator<_Iterator>& __y) #else # 332 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_iterator.h" 3 inline auto operator-(const reverse_iterator<_Iterator>& __x, const reverse_iterator<_Iterator>& __y) -> decltype(__x.base() - __y.base()) #endif # 337 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_iterator.h" 3 { return __y.base() - __x.base(); } template inline reverse_iterator<_Iterator> operator+(typename reverse_iterator<_Iterator>::difference_type __n, const reverse_iterator<_Iterator>& __x) { return reverse_iterator<_Iterator>(__x.base() - __n); } // _GLIBCXX_RESOLVE_LIB_DEFECTS // DR 280. Comparison of reverse_iterator to const reverse_iterator. template inline bool operator==(const reverse_iterator<_IteratorL>& __x, const reverse_iterator<_IteratorR>& __y) { return __x.base() == __y.base(); } template inline bool operator<(const reverse_iterator<_IteratorL>& __x, const reverse_iterator<_IteratorR>& __y) { return __y.base() < __x.base(); } template inline bool operator!=(const reverse_iterator<_IteratorL>& __x, const reverse_iterator<_IteratorR>& __y) { return !(__x == __y); } template inline bool operator>(const reverse_iterator<_IteratorL>& __x, const reverse_iterator<_IteratorR>& __y) { return __y < __x; } template inline bool operator<=(const reverse_iterator<_IteratorL>& __x, const reverse_iterator<_IteratorR>& __y) { return !(__y < __x); } template inline bool operator>=(const reverse_iterator<_IteratorL>& __x, const reverse_iterator<_IteratorR>& __y) { return !(__x < __y); } template #if __cplusplus >= 201103L // DR 685. inline auto operator-(const reverse_iterator<_IteratorL>& __x, const reverse_iterator<_IteratorR>& __y) -> decltype(__y.base() - __x.base()) #else # 391 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_iterator.h" 3 inline typename reverse_iterator<_IteratorL>::difference_type operator-(const reverse_iterator<_IteratorL>& __x, const reverse_iterator<_IteratorR>& __y) #endif # 395 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_iterator.h" 3 { return __y.base() - __x.base(); } //@} #if __cplusplus > 201103L #define __cpp_lib_make_reverse_iterator 201402 // _GLIBCXX_RESOLVE_LIB_DEFECTS // DR 2285. make_reverse_iterator /// Generator function for reverse_iterator. template inline reverse_iterator<_Iterator> make_reverse_iterator(_Iterator __i) { return reverse_iterator<_Iterator>(__i); } #endif # 409 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_iterator.h" 3 // 24.4.2.2.1 back_insert_iterator /** * @brief Turns assignment into insertion. * * These are output iterators, constructed from a container-of-T. * Assigning a T to the iterator appends it to the container using * push_back. * * Tip: Using the back_inserter function to create these iterators can * save typing. */ template class back_insert_iterator : public iterator { protected: _Container* container; public: /// A nested typedef for the type of whatever container you used. typedef _Container container_type; /// The only way to create this %iterator is with a container. explicit back_insert_iterator(_Container& __x) : container(&__x) { } /** * @param __value An instance of whatever type * container_type::const_reference is; presumably a * reference-to-const T for container. * @return This %iterator, for chained operations. * * This kind of %iterator doesn't really have a @a position in the * container (you can think of the position as being permanently at * the end, if you like). Assigning a value to the %iterator will * always append the value to the end of the container. */ #if __cplusplus < 201103L back_insert_iterator& operator=(typename _Container::const_reference __value) { container->push_back(__value); return *this; } #else # 455 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_iterator.h" 3 back_insert_iterator& operator=(const typename _Container::value_type& __value) { container->push_back(__value); return *this; } back_insert_iterator& operator=(typename _Container::value_type&& __value) { container->push_back(std::move(__value)); return *this; } #endif # 469 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_iterator.h" 3 /// Simply returns *this. back_insert_iterator& operator*() { return *this; } /// Simply returns *this. (This %iterator does not @a move.) back_insert_iterator& operator++() { return *this; } /// Simply returns *this. (This %iterator does not @a move.) back_insert_iterator operator++(int) { return *this; } }; /** * @param __x A container of arbitrary type. * @return An instance of back_insert_iterator working on @p __x. * * This wrapper function helps in creating back_insert_iterator instances. * Typing the name of the %iterator requires knowing the precise full * type of the container, which can be tedious and impedes generic * programming. Using this function lets you take advantage of automatic * template parameter deduction, making the compiler match the correct * types for you. */ template inline back_insert_iterator<_Container> back_inserter(_Container& __x) { return back_insert_iterator<_Container>(__x); } /** * @brief Turns assignment into insertion. * * These are output iterators, constructed from a container-of-T. * Assigning a T to the iterator prepends it to the container using * push_front. * * Tip: Using the front_inserter function to create these iterators can * save typing. */ template class front_insert_iterator : public iterator { protected: _Container* container; public: /// A nested typedef for the type of whatever container you used. typedef _Container container_type; /// The only way to create this %iterator is with a container. explicit front_insert_iterator(_Container& __x) : container(&__x) { } /** * @param __value An instance of whatever type * container_type::const_reference is; presumably a * reference-to-const T for container. * @return This %iterator, for chained operations. * * This kind of %iterator doesn't really have a @a position in the * container (you can think of the position as being permanently at * the front, if you like). Assigning a value to the %iterator will * always prepend the value to the front of the container. */ #if __cplusplus < 201103L front_insert_iterator& operator=(typename _Container::const_reference __value) { container->push_front(__value); return *this; } #else # 545 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_iterator.h" 3 front_insert_iterator& operator=(const typename _Container::value_type& __value) { container->push_front(__value); return *this; } front_insert_iterator& operator=(typename _Container::value_type&& __value) { container->push_front(std::move(__value)); return *this; } #endif # 559 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_iterator.h" 3 /// Simply returns *this. front_insert_iterator& operator*() { return *this; } /// Simply returns *this. (This %iterator does not @a move.) front_insert_iterator& operator++() { return *this; } /// Simply returns *this. (This %iterator does not @a move.) front_insert_iterator operator++(int) { return *this; } }; /** * @param __x A container of arbitrary type. * @return An instance of front_insert_iterator working on @p x. * * This wrapper function helps in creating front_insert_iterator instances. * Typing the name of the %iterator requires knowing the precise full * type of the container, which can be tedious and impedes generic * programming. Using this function lets you take advantage of automatic * template parameter deduction, making the compiler match the correct * types for you. */ template inline front_insert_iterator<_Container> front_inserter(_Container& __x) { return front_insert_iterator<_Container>(__x); } /** * @brief Turns assignment into insertion. * * These are output iterators, constructed from a container-of-T. * Assigning a T to the iterator inserts it in the container at the * %iterator's position, rather than overwriting the value at that * position. * * (Sequences will actually insert a @e copy of the value before the * %iterator's position.) * * Tip: Using the inserter function to create these iterators can * save typing. */ template class insert_iterator : public iterator { protected: _Container* container; typename _Container::iterator iter; public: /// A nested typedef for the type of whatever container you used. typedef _Container container_type; /** * The only way to create this %iterator is with a container and an * initial position (a normal %iterator into the container). */ insert_iterator(_Container& __x, typename _Container::iterator __i) : container(&__x), iter(__i) {} /** * @param __value An instance of whatever type * container_type::const_reference is; presumably a * reference-to-const T for container. * @return This %iterator, for chained operations. * * This kind of %iterator maintains its own position in the * container. Assigning a value to the %iterator will insert the * value into the container at the place before the %iterator. * * The position is maintained such that subsequent assignments will * insert values immediately after one another. For example, * @code * // vector v contains A and Z * * insert_iterator i (v, ++v.begin()); * i = 1; * i = 2; * i = 3; * * // vector v contains A, 1, 2, 3, and Z * @endcode */ #if __cplusplus < 201103L insert_iterator& operator=(typename _Container::const_reference __value) { iter = container->insert(iter, __value); ++iter; return *this; } #else # 657 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_iterator.h" 3 insert_iterator& operator=(const typename _Container::value_type& __value) { iter = container->insert(iter, __value); ++iter; return *this; } insert_iterator& operator=(typename _Container::value_type&& __value) { iter = container->insert(iter, std::move(__value)); ++iter; return *this; } #endif # 673 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_iterator.h" 3 /// Simply returns *this. insert_iterator& operator*() { return *this; } /// Simply returns *this. (This %iterator does not @a move.) insert_iterator& operator++() { return *this; } /// Simply returns *this. (This %iterator does not @a move.) insert_iterator& operator++(int) { return *this; } }; /** * @param __x A container of arbitrary type. * @return An instance of insert_iterator working on @p __x. * * This wrapper function helps in creating insert_iterator instances. * Typing the name of the %iterator requires knowing the precise full * type of the container, which can be tedious and impedes generic * programming. Using this function lets you take advantage of automatic * template parameter deduction, making the compiler match the correct * types for you. */ template inline insert_iterator<_Container> inserter(_Container& __x, _Iterator __i) { return insert_iterator<_Container>(__x, typename _Container::iterator(__i)); } // @} group iterators _GLIBCXX_END_NAMESPACE_VERSION } // namespace namespace __gnu_cxx _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION // This iterator adapter is @a normal in the sense that it does not // change the semantics of any of the operators of its iterator // parameter. Its primary purpose is to convert an iterator that is // not a class, e.g. a pointer, into an iterator that is a class. // The _Container parameter exists solely so that different containers // using this template can instantiate different types, even if the // _Iterator parameter is the same. using std::iterator_traits; using std::iterator; template class __normal_iterator { protected: _Iterator _M_current; typedef iterator_traits<_Iterator> __traits_type; public: typedef _Iterator iterator_type; typedef typename __traits_type::iterator_category iterator_category; typedef typename __traits_type::value_type value_type; typedef typename __traits_type::difference_type difference_type; typedef typename __traits_type::reference reference; typedef typename __traits_type::pointer pointer; _GLIBCXX_CONSTEXPR __normal_iterator() _GLIBCXX_NOEXCEPT : _M_current(_Iterator()) { } explicit __normal_iterator(const _Iterator& __i) _GLIBCXX_NOEXCEPT : _M_current(__i) { } // Allow iterator to const_iterator conversion template __normal_iterator(const __normal_iterator<_Iter, typename __enable_if< (std::__are_same<_Iter, typename _Container::pointer>::__value), _Container>::__type>& __i) _GLIBCXX_NOEXCEPT : _M_current(__i.base()) { } // Forward iterator requirements reference operator*() const _GLIBCXX_NOEXCEPT { return *_M_current; } pointer operator->() const _GLIBCXX_NOEXCEPT { return _M_current; } __normal_iterator& operator++() _GLIBCXX_NOEXCEPT { ++_M_current; return *this; } __normal_iterator operator++(int) _GLIBCXX_NOEXCEPT { return __normal_iterator(_M_current++); } // Bidirectional iterator requirements __normal_iterator& operator--() _GLIBCXX_NOEXCEPT { --_M_current; return *this; } __normal_iterator operator--(int) _GLIBCXX_NOEXCEPT { return __normal_iterator(_M_current--); } // Random access iterator requirements reference operator[](difference_type __n) const _GLIBCXX_NOEXCEPT { return _M_current[__n]; } __normal_iterator& operator+=(difference_type __n) _GLIBCXX_NOEXCEPT { _M_current += __n; return *this; } __normal_iterator operator+(difference_type __n) const _GLIBCXX_NOEXCEPT { return __normal_iterator(_M_current + __n); } __normal_iterator& operator-=(difference_type __n) _GLIBCXX_NOEXCEPT { _M_current -= __n; return *this; } __normal_iterator operator-(difference_type __n) const _GLIBCXX_NOEXCEPT { return __normal_iterator(_M_current - __n); } const _Iterator& base() const _GLIBCXX_NOEXCEPT { return _M_current; } }; // Note: In what follows, the left- and right-hand-side iterators are // allowed to vary in types (conceptually in cv-qualification) so that // comparison between cv-qualified and non-cv-qualified iterators be // valid. However, the greedy and unfriendly operators in std::rel_ops // will make overload resolution ambiguous (when in scope) if we don't // provide overloads whose operands are of the same type. Can someone // remind me what generic programming is about? -- Gaby // Forward iterator requirements template inline bool operator==(const __normal_iterator<_IteratorL, _Container>& __lhs, const __normal_iterator<_IteratorR, _Container>& __rhs) _GLIBCXX_NOEXCEPT { return __lhs.base() == __rhs.base(); } template inline bool operator==(const __normal_iterator<_Iterator, _Container>& __lhs, const __normal_iterator<_Iterator, _Container>& __rhs) _GLIBCXX_NOEXCEPT { return __lhs.base() == __rhs.base(); } template inline bool operator!=(const __normal_iterator<_IteratorL, _Container>& __lhs, const __normal_iterator<_IteratorR, _Container>& __rhs) _GLIBCXX_NOEXCEPT { return __lhs.base() != __rhs.base(); } template inline bool operator!=(const __normal_iterator<_Iterator, _Container>& __lhs, const __normal_iterator<_Iterator, _Container>& __rhs) _GLIBCXX_NOEXCEPT { return __lhs.base() != __rhs.base(); } // Random access iterator requirements template inline bool operator<(const __normal_iterator<_IteratorL, _Container>& __lhs, const __normal_iterator<_IteratorR, _Container>& __rhs) _GLIBCXX_NOEXCEPT { return __lhs.base() < __rhs.base(); } template inline bool operator<(const __normal_iterator<_Iterator, _Container>& __lhs, const __normal_iterator<_Iterator, _Container>& __rhs) _GLIBCXX_NOEXCEPT { return __lhs.base() < __rhs.base(); } template inline bool operator>(const __normal_iterator<_IteratorL, _Container>& __lhs, const __normal_iterator<_IteratorR, _Container>& __rhs) _GLIBCXX_NOEXCEPT { return __lhs.base() > __rhs.base(); } template inline bool operator>(const __normal_iterator<_Iterator, _Container>& __lhs, const __normal_iterator<_Iterator, _Container>& __rhs) _GLIBCXX_NOEXCEPT { return __lhs.base() > __rhs.base(); } template inline bool operator<=(const __normal_iterator<_IteratorL, _Container>& __lhs, const __normal_iterator<_IteratorR, _Container>& __rhs) _GLIBCXX_NOEXCEPT { return __lhs.base() <= __rhs.base(); } template inline bool operator<=(const __normal_iterator<_Iterator, _Container>& __lhs, const __normal_iterator<_Iterator, _Container>& __rhs) _GLIBCXX_NOEXCEPT { return __lhs.base() <= __rhs.base(); } template inline bool operator>=(const __normal_iterator<_IteratorL, _Container>& __lhs, const __normal_iterator<_IteratorR, _Container>& __rhs) _GLIBCXX_NOEXCEPT { return __lhs.base() >= __rhs.base(); } template inline bool operator>=(const __normal_iterator<_Iterator, _Container>& __lhs, const __normal_iterator<_Iterator, _Container>& __rhs) _GLIBCXX_NOEXCEPT { return __lhs.base() >= __rhs.base(); } // _GLIBCXX_RESOLVE_LIB_DEFECTS // According to the resolution of DR179 not only the various comparison // operators but also operator- must accept mixed iterator/const_iterator // parameters. template #if __cplusplus >= 201103L // DR 685. inline auto operator-(const __normal_iterator<_IteratorL, _Container>& __lhs, const __normal_iterator<_IteratorR, _Container>& __rhs) noexcept -> decltype(__lhs.base() - __rhs.base()) #else # 922 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_iterator.h" 3 inline typename __normal_iterator<_IteratorL, _Container>::difference_type operator-(const __normal_iterator<_IteratorL, _Container>& __lhs, const __normal_iterator<_IteratorR, _Container>& __rhs) #endif # 926 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_iterator.h" 3 { return __lhs.base() - __rhs.base(); } template inline typename __normal_iterator<_Iterator, _Container>::difference_type operator-(const __normal_iterator<_Iterator, _Container>& __lhs, const __normal_iterator<_Iterator, _Container>& __rhs) _GLIBCXX_NOEXCEPT { return __lhs.base() - __rhs.base(); } template inline __normal_iterator<_Iterator, _Container> operator+(typename __normal_iterator<_Iterator, _Container>::difference_type __n, const __normal_iterator<_Iterator, _Container>& __i) _GLIBCXX_NOEXCEPT { return __normal_iterator<_Iterator, _Container>(__i.base() + __n); } _GLIBCXX_END_NAMESPACE_VERSION } // namespace #if __cplusplus >= 201103L namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION /** * @addtogroup iterators * @{ */ // 24.4.3 Move iterators /** * Class template move_iterator is an iterator adapter with the same * behavior as the underlying iterator except that its dereference * operator implicitly converts the value returned by the underlying * iterator's dereference operator to an rvalue reference. Some * generic algorithms can be called with move iterators to replace * copying with moving. */ template class move_iterator { protected: _Iterator _M_current; typedef iterator_traits<_Iterator> __traits_type; typedef typename __traits_type::reference __base_ref; public: typedef _Iterator iterator_type; typedef typename __traits_type::iterator_category iterator_category; typedef typename __traits_type::value_type value_type; typedef typename __traits_type::difference_type difference_type; // NB: DR 680. typedef _Iterator pointer; // _GLIBCXX_RESOLVE_LIB_DEFECTS // 2106. move_iterator wrapping iterators returning prvalues typedef typename conditional::value, typename remove_reference<__base_ref>::type&&, __base_ref>::type reference; move_iterator() : _M_current() { } explicit move_iterator(iterator_type __i) : _M_current(__i) { } template move_iterator(const move_iterator<_Iter>& __i) : _M_current(__i.base()) { } iterator_type base() const { return _M_current; } reference operator*() const { return static_cast(*_M_current); } pointer operator->() const { return _M_current; } move_iterator& operator++() { ++_M_current; return *this; } move_iterator operator++(int) { move_iterator __tmp = *this; ++_M_current; return __tmp; } move_iterator& operator--() { --_M_current; return *this; } move_iterator operator--(int) { move_iterator __tmp = *this; --_M_current; return __tmp; } move_iterator operator+(difference_type __n) const { return move_iterator(_M_current + __n); } move_iterator& operator+=(difference_type __n) { _M_current += __n; return *this; } move_iterator operator-(difference_type __n) const { return move_iterator(_M_current - __n); } move_iterator& operator-=(difference_type __n) { _M_current -= __n; return *this; } reference operator[](difference_type __n) const { return std::move(_M_current[__n]); } }; // Note: See __normal_iterator operators note from Gaby to understand // why there are always 2 versions for most of the move_iterator // operators. template inline bool operator==(const move_iterator<_IteratorL>& __x, const move_iterator<_IteratorR>& __y) { return __x.base() == __y.base(); } template inline bool operator==(const move_iterator<_Iterator>& __x, const move_iterator<_Iterator>& __y) { return __x.base() == __y.base(); } template inline bool operator!=(const move_iterator<_IteratorL>& __x, const move_iterator<_IteratorR>& __y) { return !(__x == __y); } template inline bool operator!=(const move_iterator<_Iterator>& __x, const move_iterator<_Iterator>& __y) { return !(__x == __y); } template inline bool operator<(const move_iterator<_IteratorL>& __x, const move_iterator<_IteratorR>& __y) { return __x.base() < __y.base(); } template inline bool operator<(const move_iterator<_Iterator>& __x, const move_iterator<_Iterator>& __y) { return __x.base() < __y.base(); } template inline bool operator<=(const move_iterator<_IteratorL>& __x, const move_iterator<_IteratorR>& __y) { return !(__y < __x); } template inline bool operator<=(const move_iterator<_Iterator>& __x, const move_iterator<_Iterator>& __y) { return !(__y < __x); } template inline bool operator>(const move_iterator<_IteratorL>& __x, const move_iterator<_IteratorR>& __y) { return __y < __x; } template inline bool operator>(const move_iterator<_Iterator>& __x, const move_iterator<_Iterator>& __y) { return __y < __x; } template inline bool operator>=(const move_iterator<_IteratorL>& __x, const move_iterator<_IteratorR>& __y) { return !(__x < __y); } template inline bool operator>=(const move_iterator<_Iterator>& __x, const move_iterator<_Iterator>& __y) { return !(__x < __y); } // DR 685. template inline auto operator-(const move_iterator<_IteratorL>& __x, const move_iterator<_IteratorR>& __y) -> decltype(__x.base() - __y.base()) { return __x.base() - __y.base(); } template inline auto operator-(const move_iterator<_Iterator>& __x, const move_iterator<_Iterator>& __y) -> decltype(__x.base() - __y.base()) { return __x.base() - __y.base(); } template inline move_iterator<_Iterator> operator+(typename move_iterator<_Iterator>::difference_type __n, const move_iterator<_Iterator>& __x) { return __x + __n; } template inline move_iterator<_Iterator> make_move_iterator(_Iterator __i) { return move_iterator<_Iterator>(__i); } template::value_type>::value, _Iterator, move_iterator<_Iterator>>::type> inline _ReturnType __make_move_if_noexcept_iterator(_Iterator __i) { return _ReturnType(__i); } // @} group iterators _GLIBCXX_END_NAMESPACE_VERSION } // namespace #define _GLIBCXX_MAKE_MOVE_ITERATOR(_Iter) std::make_move_iterator(_Iter) #define _GLIBCXX_MAKE_MOVE_IF_NOEXCEPT_ITERATOR(_Iter) \ std::__make_move_if_noexcept_iterator(_Iter) #else # 1185 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_iterator.h" 3 #define _GLIBCXX_MAKE_MOVE_ITERATOR(_Iter) (_Iter) #define _GLIBCXX_MAKE_MOVE_IF_NOEXCEPT_ITERATOR(_Iter) (_Iter) #endif // C++11 # 1188 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_iterator.h" 3 #endif # 1190 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_iterator.h" 3 # 68 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algobase.h" 2 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 68 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algobase.h" 3 # 69 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algobase.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 69 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algobase.h" 3 # 70 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algobase.h" 3 #if 0 /* expanded by -frewrite-includes */ #include // For std::swap and _GLIBCXX_MOVE #endif /* expanded by -frewrite-includes */ # 70 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algobase.h" 3 # 71 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algobase.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 71 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algobase.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/predefined_ops.h" 1 3 // Default predicates for internal use -*- C++ -*- // Copyright (C) 2013-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file predefined_ops.h * This is an internal header file, included by other library headers. * You should not attempt to use it directly. */ #ifndef _GLIBCXX_PREDEFINED_OPS_H #define _GLIBCXX_PREDEFINED_OPS_H 1 namespace __gnu_cxx { namespace __ops { struct _Iter_less_iter { template _GLIBCXX14_CONSTEXPR bool operator()(_Iterator1 __it1, _Iterator2 __it2) const { return *__it1 < *__it2; } }; _GLIBCXX14_CONSTEXPR inline _Iter_less_iter __iter_less_iter() { return _Iter_less_iter(); } struct _Iter_less_val { template bool operator()(_Iterator __it, _Value& __val) const { return *__it < __val; } }; inline _Iter_less_val __iter_less_val() { return _Iter_less_val(); } inline _Iter_less_val __iter_comp_val(_Iter_less_iter) { return _Iter_less_val(); } struct _Val_less_iter { template bool operator()(_Value& __val, _Iterator __it) const { return __val < *__it; } }; inline _Val_less_iter __val_less_iter() { return _Val_less_iter(); } inline _Val_less_iter __val_comp_iter(_Iter_less_iter) { return _Val_less_iter(); } struct _Iter_equal_to_iter { template bool operator()(_Iterator1 __it1, _Iterator2 __it2) const { return *__it1 == *__it2; } }; inline _Iter_equal_to_iter __iter_equal_to_iter() { return _Iter_equal_to_iter(); } struct _Iter_equal_to_val { template bool operator()(_Iterator __it, _Value& __val) const { return *__it == __val; } }; inline _Iter_equal_to_val __iter_equal_to_val() { return _Iter_equal_to_val(); } inline _Iter_equal_to_val __iter_comp_val(_Iter_equal_to_iter) { return _Iter_equal_to_val(); } template struct _Iter_comp_iter { _Compare _M_comp; _GLIBCXX14_CONSTEXPR _Iter_comp_iter(_Compare __comp) : _M_comp(__comp) { } template _GLIBCXX14_CONSTEXPR bool operator()(_Iterator1 __it1, _Iterator2 __it2) { return bool(_M_comp(*__it1, *__it2)); } }; template _GLIBCXX14_CONSTEXPR inline _Iter_comp_iter<_Compare> __iter_comp_iter(_Compare __comp) { return _Iter_comp_iter<_Compare>(__comp); } template struct _Iter_comp_val { _Compare _M_comp; _Iter_comp_val(_Compare __comp) : _M_comp(__comp) { } template bool operator()(_Iterator __it, _Value& __val) { return bool(_M_comp(*__it, __val)); } }; template inline _Iter_comp_val<_Compare> __iter_comp_val(_Compare __comp) { return _Iter_comp_val<_Compare>(__comp); } template inline _Iter_comp_val<_Compare> __iter_comp_val(_Iter_comp_iter<_Compare> __comp) { return _Iter_comp_val<_Compare>(__comp._M_comp); } template struct _Val_comp_iter { _Compare _M_comp; _Val_comp_iter(_Compare __comp) : _M_comp(__comp) { } template bool operator()(_Value& __val, _Iterator __it) { return bool(_M_comp(__val, *__it)); } }; template inline _Val_comp_iter<_Compare> __val_comp_iter(_Compare __comp) { return _Val_comp_iter<_Compare>(__comp); } template inline _Val_comp_iter<_Compare> __val_comp_iter(_Iter_comp_iter<_Compare> __comp) { return _Val_comp_iter<_Compare>(__comp._M_comp); } template struct _Iter_equals_val { _Value& _M_value; _Iter_equals_val(_Value& __value) : _M_value(__value) { } template bool operator()(_Iterator __it) { return *__it == _M_value; } }; template inline _Iter_equals_val<_Value> __iter_equals_val(_Value& __val) { return _Iter_equals_val<_Value>(__val); } template struct _Iter_equals_iter { typename std::iterator_traits<_Iterator1>::reference _M_ref; _Iter_equals_iter(_Iterator1 __it1) : _M_ref(*__it1) { } template bool operator()(_Iterator2 __it2) { return *__it2 == _M_ref; } }; template inline _Iter_equals_iter<_Iterator> __iter_comp_iter(_Iter_equal_to_iter, _Iterator __it) { return _Iter_equals_iter<_Iterator>(__it); } template struct _Iter_pred { _Predicate _M_pred; _Iter_pred(_Predicate __pred) : _M_pred(__pred) { } template bool operator()(_Iterator __it) { return bool(_M_pred(*__it)); } }; template inline _Iter_pred<_Predicate> __pred_iter(_Predicate __pred) { return _Iter_pred<_Predicate>(__pred); } template struct _Iter_comp_to_val { _Compare _M_comp; _Value& _M_value; _Iter_comp_to_val(_Compare __comp, _Value& __value) : _M_comp(__comp), _M_value(__value) { } template bool operator()(_Iterator __it) { return bool(_M_comp(*__it, _M_value)); } }; template _Iter_comp_to_val<_Compare, _Value> __iter_comp_val(_Compare __comp, _Value &__val) { return _Iter_comp_to_val<_Compare, _Value>(__comp, __val); } template struct _Iter_comp_to_iter { _Compare _M_comp; typename std::iterator_traits<_Iterator1>::reference _M_ref; _Iter_comp_to_iter(_Compare __comp, _Iterator1 __it1) : _M_comp(__comp), _M_ref(*__it1) { } template bool operator()(_Iterator2 __it2) { return bool(_M_comp(*__it2, _M_ref)); } }; template inline _Iter_comp_to_iter<_Compare, _Iterator> __iter_comp_iter(_Iter_comp_iter<_Compare> __comp, _Iterator __it) { return _Iter_comp_to_iter<_Compare, _Iterator>(__comp._M_comp, __it); } template struct _Iter_negate { _Predicate _M_pred; _Iter_negate(_Predicate __pred) : _M_pred(__pred) { } template bool operator()(_Iterator __it) { return !bool(_M_pred(*__it)); } }; template inline _Iter_negate<_Predicate> __negate(_Iter_pred<_Predicate> __pred) { return _Iter_negate<_Predicate>(__pred._M_pred); } } // namespace __ops } // namespace __gnu_cxx #endif # 308 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/predefined_ops.h" 3 # 72 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algobase.h" 2 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION #if __cplusplus < 201103L // See http://gcc.gnu.org/ml/libstdc++/2004-08/msg00167.html: in a // nutshell, we are partially implementing the resolution of DR 187, // when it's safe, i.e., the value_types are equal. template struct __iter_swap { template static void iter_swap(_ForwardIterator1 __a, _ForwardIterator2 __b) { typedef typename iterator_traits<_ForwardIterator1>::value_type _ValueType1; _ValueType1 __tmp = _GLIBCXX_MOVE(*__a); *__a = _GLIBCXX_MOVE(*__b); *__b = _GLIBCXX_MOVE(__tmp); } }; template<> struct __iter_swap { template static void iter_swap(_ForwardIterator1 __a, _ForwardIterator2 __b) { swap(*__a, *__b); } }; #endif # 107 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algobase.h" 3 /** * @brief Swaps the contents of two iterators. * @ingroup mutating_algorithms * @param __a An iterator. * @param __b Another iterator. * @return Nothing. * * This function swaps the values pointed to by two iterators, not the * iterators themselves. */ template inline void iter_swap(_ForwardIterator1 __a, _ForwardIterator2 __b) { // concept requirements __glibcxx_function_requires(_Mutable_ForwardIteratorConcept< _ForwardIterator1>) __glibcxx_function_requires(_Mutable_ForwardIteratorConcept< _ForwardIterator2>) #if __cplusplus < 201103L typedef typename iterator_traits<_ForwardIterator1>::value_type _ValueType1; typedef typename iterator_traits<_ForwardIterator2>::value_type _ValueType2; __glibcxx_function_requires(_ConvertibleConcept<_ValueType1, _ValueType2>) __glibcxx_function_requires(_ConvertibleConcept<_ValueType2, _ValueType1>) typedef typename iterator_traits<_ForwardIterator1>::reference _ReferenceType1; typedef typename iterator_traits<_ForwardIterator2>::reference _ReferenceType2; std::__iter_swap<__are_same<_ValueType1, _ValueType2>::__value && __are_same<_ValueType1&, _ReferenceType1>::__value && __are_same<_ValueType2&, _ReferenceType2>::__value>:: iter_swap(__a, __b); #else # 148 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algobase.h" 3 swap(*__a, *__b); #endif # 150 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algobase.h" 3 } /** * @brief Swap the elements of two sequences. * @ingroup mutating_algorithms * @param __first1 A forward iterator. * @param __last1 A forward iterator. * @param __first2 A forward iterator. * @return An iterator equal to @p first2+(last1-first1). * * Swaps each element in the range @p [first1,last1) with the * corresponding element in the range @p [first2,(last1-first1)). * The ranges must not overlap. */ template _ForwardIterator2 swap_ranges(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2) { // concept requirements __glibcxx_function_requires(_Mutable_ForwardIteratorConcept< _ForwardIterator1>) __glibcxx_function_requires(_Mutable_ForwardIteratorConcept< _ForwardIterator2>) __glibcxx_requires_valid_range(__first1, __last1); for (; __first1 != __last1; ++__first1, ++__first2) std::iter_swap(__first1, __first2); return __first2; } /** * @brief This does what you think it does. * @ingroup sorting_algorithms * @param __a A thing of arbitrary type. * @param __b Another thing of arbitrary type. * @return The lesser of the parameters. * * This is the simple classic generic implementation. It will work on * temporary expressions, since they are only evaluated once, unlike a * preprocessor macro. */ template _GLIBCXX14_CONSTEXPR inline const _Tp& min(const _Tp& __a, const _Tp& __b) { // concept requirements __glibcxx_function_requires(_LessThanComparableConcept<_Tp>) //return __b < __a ? __b : __a; if (__b < __a) return __b; return __a; } /** * @brief This does what you think it does. * @ingroup sorting_algorithms * @param __a A thing of arbitrary type. * @param __b Another thing of arbitrary type. * @return The greater of the parameters. * * This is the simple classic generic implementation. It will work on * temporary expressions, since they are only evaluated once, unlike a * preprocessor macro. */ template _GLIBCXX14_CONSTEXPR inline const _Tp& max(const _Tp& __a, const _Tp& __b) { // concept requirements __glibcxx_function_requires(_LessThanComparableConcept<_Tp>) //return __a < __b ? __b : __a; if (__a < __b) return __b; return __a; } /** * @brief This does what you think it does. * @ingroup sorting_algorithms * @param __a A thing of arbitrary type. * @param __b Another thing of arbitrary type. * @param __comp A @link comparison_functors comparison functor@endlink. * @return The lesser of the parameters. * * This will work on temporary expressions, since they are only evaluated * once, unlike a preprocessor macro. */ template _GLIBCXX14_CONSTEXPR inline const _Tp& min(const _Tp& __a, const _Tp& __b, _Compare __comp) { //return __comp(__b, __a) ? __b : __a; if (__comp(__b, __a)) return __b; return __a; } /** * @brief This does what you think it does. * @ingroup sorting_algorithms * @param __a A thing of arbitrary type. * @param __b Another thing of arbitrary type. * @param __comp A @link comparison_functors comparison functor@endlink. * @return The greater of the parameters. * * This will work on temporary expressions, since they are only evaluated * once, unlike a preprocessor macro. */ template _GLIBCXX14_CONSTEXPR inline const _Tp& max(const _Tp& __a, const _Tp& __b, _Compare __comp) { //return __comp(__a, __b) ? __b : __a; if (__comp(__a, __b)) return __b; return __a; } // If _Iterator is a __normal_iterator return its base (a plain pointer, // normally) otherwise return it untouched. See copy, fill, ... template struct _Niter_base : _Iter_base<_Iterator, __is_normal_iterator<_Iterator>::__value> { }; template inline typename _Niter_base<_Iterator>::iterator_type __niter_base(_Iterator __it) { return std::_Niter_base<_Iterator>::_S_base(__it); } // Likewise, for move_iterator. template struct _Miter_base : _Iter_base<_Iterator, __is_move_iterator<_Iterator>::__value> { }; template inline typename _Miter_base<_Iterator>::iterator_type __miter_base(_Iterator __it) { return std::_Miter_base<_Iterator>::_S_base(__it); } // All of these auxiliary structs serve two purposes. (1) Replace // calls to copy with memmove whenever possible. (Memmove, not memcpy, // because the input and output ranges are permitted to overlap.) // (2) If we're using random access iterators, then write the loop as // a for loop with an explicit count. template struct __copy_move { template static _OI __copy_m(_II __first, _II __last, _OI __result) { for (; __first != __last; ++__result, ++__first) *__result = *__first; return __result; } }; #if __cplusplus >= 201103L template struct __copy_move { template static _OI __copy_m(_II __first, _II __last, _OI __result) { for (; __first != __last; ++__result, ++__first) *__result = std::move(*__first); return __result; } }; #endif # 329 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algobase.h" 3 template<> struct __copy_move { template static _OI __copy_m(_II __first, _II __last, _OI __result) { typedef typename iterator_traits<_II>::difference_type _Distance; for(_Distance __n = __last - __first; __n > 0; --__n) { *__result = *__first; ++__first; ++__result; } return __result; } }; #if __cplusplus >= 201103L template<> struct __copy_move { template static _OI __copy_m(_II __first, _II __last, _OI __result) { typedef typename iterator_traits<_II>::difference_type _Distance; for(_Distance __n = __last - __first; __n > 0; --__n) { *__result = std::move(*__first); ++__first; ++__result; } return __result; } }; #endif # 367 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algobase.h" 3 template struct __copy_move<_IsMove, true, random_access_iterator_tag> { template static _Tp* __copy_m(const _Tp* __first, const _Tp* __last, _Tp* __result) { #if __cplusplus >= 201103L using __assignable = conditional<_IsMove, is_move_assignable<_Tp>, is_copy_assignable<_Tp>>; // trivial types can have deleted assignment static_assert( __assignable::type::value, "type is not assignable" ); #endif # 382 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algobase.h" 3 const ptrdiff_t _Num = __last - __first; if (_Num) __builtin_memmove(__result, __first, sizeof(_Tp) * _Num); return __result + _Num; } }; template inline _OI __copy_move_a(_II __first, _II __last, _OI __result) { typedef typename iterator_traits<_II>::value_type _ValueTypeI; typedef typename iterator_traits<_OI>::value_type _ValueTypeO; typedef typename iterator_traits<_II>::iterator_category _Category; const bool __simple = (__is_trivial(_ValueTypeI) && __is_pointer<_II>::__value && __is_pointer<_OI>::__value && __are_same<_ValueTypeI, _ValueTypeO>::__value); return std::__copy_move<_IsMove, __simple, _Category>::__copy_m(__first, __last, __result); } // Helpers for streambuf iterators (either istream or ostream). // NB: avoid including , relatively large. template struct char_traits; template class istreambuf_iterator; template class ostreambuf_iterator; template typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value, ostreambuf_iterator<_CharT, char_traits<_CharT> > >::__type __copy_move_a2(_CharT*, _CharT*, ostreambuf_iterator<_CharT, char_traits<_CharT> >); template typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value, ostreambuf_iterator<_CharT, char_traits<_CharT> > >::__type __copy_move_a2(const _CharT*, const _CharT*, ostreambuf_iterator<_CharT, char_traits<_CharT> >); template typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value, _CharT*>::__type __copy_move_a2(istreambuf_iterator<_CharT, char_traits<_CharT> >, istreambuf_iterator<_CharT, char_traits<_CharT> >, _CharT*); template inline _OI __copy_move_a2(_II __first, _II __last, _OI __result) { return _OI(std::__copy_move_a<_IsMove>(std::__niter_base(__first), std::__niter_base(__last), std::__niter_base(__result))); } /** * @brief Copies the range [first,last) into result. * @ingroup mutating_algorithms * @param __first An input iterator. * @param __last An input iterator. * @param __result An output iterator. * @return result + (first - last) * * This inline function will boil down to a call to @c memmove whenever * possible. Failing that, if random access iterators are passed, then the * loop count will be known (and therefore a candidate for compiler * optimizations such as unrolling). Result may not be contained within * [first,last); the copy_backward function should be used instead. * * Note that the end of the output range is permitted to be contained * within [first,last). */ template inline _OI copy(_II __first, _II __last, _OI __result) { // concept requirements __glibcxx_function_requires(_InputIteratorConcept<_II>) __glibcxx_function_requires(_OutputIteratorConcept<_OI, typename iterator_traits<_II>::value_type>) __glibcxx_requires_valid_range(__first, __last); return (std::__copy_move_a2<__is_move_iterator<_II>::__value> (std::__miter_base(__first), std::__miter_base(__last), __result)); } #if __cplusplus >= 201103L /** * @brief Moves the range [first,last) into result. * @ingroup mutating_algorithms * @param __first An input iterator. * @param __last An input iterator. * @param __result An output iterator. * @return result + (first - last) * * This inline function will boil down to a call to @c memmove whenever * possible. Failing that, if random access iterators are passed, then the * loop count will be known (and therefore a candidate for compiler * optimizations such as unrolling). Result may not be contained within * [first,last); the move_backward function should be used instead. * * Note that the end of the output range is permitted to be contained * within [first,last). */ template inline _OI move(_II __first, _II __last, _OI __result) { // concept requirements __glibcxx_function_requires(_InputIteratorConcept<_II>) __glibcxx_function_requires(_OutputIteratorConcept<_OI, typename iterator_traits<_II>::value_type>) __glibcxx_requires_valid_range(__first, __last); return std::__copy_move_a2(std::__miter_base(__first), std::__miter_base(__last), __result); } #define _GLIBCXX_MOVE3(_Tp, _Up, _Vp) std::move(_Tp, _Up, _Vp) #else # 509 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algobase.h" 3 #define _GLIBCXX_MOVE3(_Tp, _Up, _Vp) std::copy(_Tp, _Up, _Vp) #endif # 511 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algobase.h" 3 template struct __copy_move_backward { template static _BI2 __copy_move_b(_BI1 __first, _BI1 __last, _BI2 __result) { while (__first != __last) *--__result = *--__last; return __result; } }; #if __cplusplus >= 201103L template struct __copy_move_backward { template static _BI2 __copy_move_b(_BI1 __first, _BI1 __last, _BI2 __result) { while (__first != __last) *--__result = std::move(*--__last); return __result; } }; #endif # 539 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algobase.h" 3 template<> struct __copy_move_backward { template static _BI2 __copy_move_b(_BI1 __first, _BI1 __last, _BI2 __result) { typename iterator_traits<_BI1>::difference_type __n; for (__n = __last - __first; __n > 0; --__n) *--__result = *--__last; return __result; } }; #if __cplusplus >= 201103L template<> struct __copy_move_backward { template static _BI2 __copy_move_b(_BI1 __first, _BI1 __last, _BI2 __result) { typename iterator_traits<_BI1>::difference_type __n; for (__n = __last - __first; __n > 0; --__n) *--__result = std::move(*--__last); return __result; } }; #endif # 569 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algobase.h" 3 template struct __copy_move_backward<_IsMove, true, random_access_iterator_tag> { template static _Tp* __copy_move_b(const _Tp* __first, const _Tp* __last, _Tp* __result) { #if __cplusplus >= 201103L using __assignable = conditional<_IsMove, is_move_assignable<_Tp>, is_copy_assignable<_Tp>>; // trivial types can have deleted assignment static_assert( __assignable::type::value, "type is not assignable" ); #endif # 584 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algobase.h" 3 const ptrdiff_t _Num = __last - __first; if (_Num) __builtin_memmove(__result - _Num, __first, sizeof(_Tp) * _Num); return __result - _Num; } }; template inline _BI2 __copy_move_backward_a(_BI1 __first, _BI1 __last, _BI2 __result) { typedef typename iterator_traits<_BI1>::value_type _ValueType1; typedef typename iterator_traits<_BI2>::value_type _ValueType2; typedef typename iterator_traits<_BI1>::iterator_category _Category; const bool __simple = (__is_trivial(_ValueType1) && __is_pointer<_BI1>::__value && __is_pointer<_BI2>::__value && __are_same<_ValueType1, _ValueType2>::__value); return std::__copy_move_backward<_IsMove, __simple, _Category>::__copy_move_b(__first, __last, __result); } template inline _BI2 __copy_move_backward_a2(_BI1 __first, _BI1 __last, _BI2 __result) { return _BI2(std::__copy_move_backward_a<_IsMove> (std::__niter_base(__first), std::__niter_base(__last), std::__niter_base(__result))); } /** * @brief Copies the range [first,last) into result. * @ingroup mutating_algorithms * @param __first A bidirectional iterator. * @param __last A bidirectional iterator. * @param __result A bidirectional iterator. * @return result - (first - last) * * The function has the same effect as copy, but starts at the end of the * range and works its way to the start, returning the start of the result. * This inline function will boil down to a call to @c memmove whenever * possible. Failing that, if random access iterators are passed, then the * loop count will be known (and therefore a candidate for compiler * optimizations such as unrolling). * * Result may not be in the range (first,last]. Use copy instead. Note * that the start of the output range may overlap [first,last). */ template inline _BI2 copy_backward(_BI1 __first, _BI1 __last, _BI2 __result) { // concept requirements __glibcxx_function_requires(_BidirectionalIteratorConcept<_BI1>) __glibcxx_function_requires(_Mutable_BidirectionalIteratorConcept<_BI2>) __glibcxx_function_requires(_ConvertibleConcept< typename iterator_traits<_BI1>::value_type, typename iterator_traits<_BI2>::value_type>) __glibcxx_requires_valid_range(__first, __last); return (std::__copy_move_backward_a2<__is_move_iterator<_BI1>::__value> (std::__miter_base(__first), std::__miter_base(__last), __result)); } #if __cplusplus >= 201103L /** * @brief Moves the range [first,last) into result. * @ingroup mutating_algorithms * @param __first A bidirectional iterator. * @param __last A bidirectional iterator. * @param __result A bidirectional iterator. * @return result - (first - last) * * The function has the same effect as move, but starts at the end of the * range and works its way to the start, returning the start of the result. * This inline function will boil down to a call to @c memmove whenever * possible. Failing that, if random access iterators are passed, then the * loop count will be known (and therefore a candidate for compiler * optimizations such as unrolling). * * Result may not be in the range (first,last]. Use move instead. Note * that the start of the output range may overlap [first,last). */ template inline _BI2 move_backward(_BI1 __first, _BI1 __last, _BI2 __result) { // concept requirements __glibcxx_function_requires(_BidirectionalIteratorConcept<_BI1>) __glibcxx_function_requires(_Mutable_BidirectionalIteratorConcept<_BI2>) __glibcxx_function_requires(_ConvertibleConcept< typename iterator_traits<_BI1>::value_type, typename iterator_traits<_BI2>::value_type>) __glibcxx_requires_valid_range(__first, __last); return std::__copy_move_backward_a2(std::__miter_base(__first), std::__miter_base(__last), __result); } #define _GLIBCXX_MOVE_BACKWARD3(_Tp, _Up, _Vp) std::move_backward(_Tp, _Up, _Vp) #else # 691 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algobase.h" 3 #define _GLIBCXX_MOVE_BACKWARD3(_Tp, _Up, _Vp) std::copy_backward(_Tp, _Up, _Vp) #endif # 693 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algobase.h" 3 template inline typename __gnu_cxx::__enable_if::__value, void>::__type __fill_a(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) { for (; __first != __last; ++__first) *__first = __value; } template inline typename __gnu_cxx::__enable_if<__is_scalar<_Tp>::__value, void>::__type __fill_a(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) { const _Tp __tmp = __value; for (; __first != __last; ++__first) *__first = __tmp; } // Specialization: for char types we can use memset. template inline typename __gnu_cxx::__enable_if<__is_byte<_Tp>::__value, void>::__type __fill_a(_Tp* __first, _Tp* __last, const _Tp& __c) { const _Tp __tmp = __c; if (const size_t __len = __last - __first) __builtin_memset(__first, static_cast(__tmp), __len); } /** * @brief Fills the range [first,last) with copies of value. * @ingroup mutating_algorithms * @param __first A forward iterator. * @param __last A forward iterator. * @param __value A reference-to-const of arbitrary type. * @return Nothing. * * This function fills a range with copies of the same value. For char * types filling contiguous areas of memory, this becomes an inline call * to @c memset or @c wmemset. */ template inline void fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) { // concept requirements __glibcxx_function_requires(_Mutable_ForwardIteratorConcept< _ForwardIterator>) __glibcxx_requires_valid_range(__first, __last); std::__fill_a(std::__niter_base(__first), std::__niter_base(__last), __value); } template inline typename __gnu_cxx::__enable_if::__value, _OutputIterator>::__type __fill_n_a(_OutputIterator __first, _Size __n, const _Tp& __value) { for (__decltype(__n + 0) __niter = __n; __niter > 0; --__niter, ++__first) *__first = __value; return __first; } template inline typename __gnu_cxx::__enable_if<__is_scalar<_Tp>::__value, _OutputIterator>::__type __fill_n_a(_OutputIterator __first, _Size __n, const _Tp& __value) { const _Tp __tmp = __value; for (__decltype(__n + 0) __niter = __n; __niter > 0; --__niter, ++__first) *__first = __tmp; return __first; } template inline typename __gnu_cxx::__enable_if<__is_byte<_Tp>::__value, _Tp*>::__type __fill_n_a(_Tp* __first, _Size __n, const _Tp& __c) { std::__fill_a(__first, __first + __n, __c); return __first + __n; } /** * @brief Fills the range [first,first+n) with copies of value. * @ingroup mutating_algorithms * @param __first An output iterator. * @param __n The count of copies to perform. * @param __value A reference-to-const of arbitrary type. * @return The iterator at first+n. * * This function fills a range with copies of the same value. For char * types filling contiguous areas of memory, this becomes an inline call * to @c memset or @ wmemset. * * _GLIBCXX_RESOLVE_LIB_DEFECTS * DR 865. More algorithms that throw away information */ template inline _OI fill_n(_OI __first, _Size __n, const _Tp& __value) { // concept requirements __glibcxx_function_requires(_OutputIteratorConcept<_OI, _Tp>) return _OI(std::__fill_n_a(std::__niter_base(__first), __n, __value)); } template struct __equal { template static bool equal(_II1 __first1, _II1 __last1, _II2 __first2) { for (; __first1 != __last1; ++__first1, ++__first2) if (!(*__first1 == *__first2)) return false; return true; } }; template<> struct __equal { template static bool equal(const _Tp* __first1, const _Tp* __last1, const _Tp* __first2) { if (const size_t __len = (__last1 - __first1)) return !__builtin_memcmp(__first1, __first2, sizeof(_Tp) * __len); return true; } }; template inline bool __equal_aux(_II1 __first1, _II1 __last1, _II2 __first2) { typedef typename iterator_traits<_II1>::value_type _ValueType1; typedef typename iterator_traits<_II2>::value_type _ValueType2; const bool __simple = ((__is_integer<_ValueType1>::__value || __is_pointer<_ValueType1>::__value) && __is_pointer<_II1>::__value && __is_pointer<_II2>::__value && __are_same<_ValueType1, _ValueType2>::__value); return std::__equal<__simple>::equal(__first1, __last1, __first2); } template struct __lc_rai { template static _II1 __newlast1(_II1, _II1 __last1, _II2, _II2) { return __last1; } template static bool __cnd2(_II __first, _II __last) { return __first != __last; } }; template<> struct __lc_rai { template static _RAI1 __newlast1(_RAI1 __first1, _RAI1 __last1, _RAI2 __first2, _RAI2 __last2) { const typename iterator_traits<_RAI1>::difference_type __diff1 = __last1 - __first1; const typename iterator_traits<_RAI2>::difference_type __diff2 = __last2 - __first2; return __diff2 < __diff1 ? __first1 + __diff2 : __last1; } template static bool __cnd2(_RAI, _RAI) { return true; } }; template bool __lexicographical_compare_impl(_II1 __first1, _II1 __last1, _II2 __first2, _II2 __last2, _Compare __comp) { typedef typename iterator_traits<_II1>::iterator_category _Category1; typedef typename iterator_traits<_II2>::iterator_category _Category2; typedef std::__lc_rai<_Category1, _Category2> __rai_type; __last1 = __rai_type::__newlast1(__first1, __last1, __first2, __last2); for (; __first1 != __last1 && __rai_type::__cnd2(__first2, __last2); ++__first1, ++__first2) { if (__comp(__first1, __first2)) return true; if (__comp(__first2, __first1)) return false; } return __first1 == __last1 && __first2 != __last2; } template struct __lexicographical_compare { template static bool __lc(_II1, _II1, _II2, _II2); }; template template bool __lexicographical_compare<_BoolType>:: __lc(_II1 __first1, _II1 __last1, _II2 __first2, _II2 __last2) { return std::__lexicographical_compare_impl(__first1, __last1, __first2, __last2, __gnu_cxx::__ops::__iter_less_iter()); } template<> struct __lexicographical_compare { template static bool __lc(const _Tp* __first1, const _Tp* __last1, const _Up* __first2, const _Up* __last2) { const size_t __len1 = __last1 - __first1; const size_t __len2 = __last2 - __first2; if (const size_t __len = std::min(__len1, __len2)) if (int __result = __builtin_memcmp(__first1, __first2, __len)) return __result < 0; return __len1 < __len2; } }; template inline bool __lexicographical_compare_aux(_II1 __first1, _II1 __last1, _II2 __first2, _II2 __last2) { typedef typename iterator_traits<_II1>::value_type _ValueType1; typedef typename iterator_traits<_II2>::value_type _ValueType2; const bool __simple = (__is_byte<_ValueType1>::__value && __is_byte<_ValueType2>::__value && !__gnu_cxx::__numeric_traits<_ValueType1>::__is_signed && !__gnu_cxx::__numeric_traits<_ValueType2>::__is_signed && __is_pointer<_II1>::__value && __is_pointer<_II2>::__value); return std::__lexicographical_compare<__simple>::__lc(__first1, __last1, __first2, __last2); } template _ForwardIterator __lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __val, _Compare __comp) { typedef typename iterator_traits<_ForwardIterator>::difference_type _DistanceType; _DistanceType __len = std::distance(__first, __last); while (__len > 0) { _DistanceType __half = __len >> 1; _ForwardIterator __middle = __first; std::advance(__middle, __half); if (__comp(__middle, __val)) { __first = __middle; ++__first; __len = __len - __half - 1; } else __len = __half; } return __first; } /** * @brief Finds the first position in which @a val could be inserted * without changing the ordering. * @param __first An iterator. * @param __last Another iterator. * @param __val The search term. * @return An iterator pointing to the first element not less * than @a val, or end() if every element is less than * @a val. * @ingroup binary_search_algorithms */ template inline _ForwardIterator lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __val) { // concept requirements __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) __glibcxx_function_requires(_LessThanOpConcept< typename iterator_traits<_ForwardIterator>::value_type, _Tp>) __glibcxx_requires_partitioned_lower(__first, __last, __val); return std::__lower_bound(__first, __last, __val, __gnu_cxx::__ops::__iter_less_val()); } /// This is a helper function for the sort routines and for random.tcc. // Precondition: __n > 0. inline _GLIBCXX_CONSTEXPR int __lg(int __n) { return sizeof(int) * __CHAR_BIT__ - 1 - __builtin_clz(__n); } inline _GLIBCXX_CONSTEXPR unsigned __lg(unsigned __n) { return sizeof(int) * __CHAR_BIT__ - 1 - __builtin_clz(__n); } inline _GLIBCXX_CONSTEXPR long __lg(long __n) { return sizeof(long) * __CHAR_BIT__ - 1 - __builtin_clzl(__n); } inline _GLIBCXX_CONSTEXPR unsigned long __lg(unsigned long __n) { return sizeof(long) * __CHAR_BIT__ - 1 - __builtin_clzl(__n); } inline _GLIBCXX_CONSTEXPR long long __lg(long long __n) { return sizeof(long long) * __CHAR_BIT__ - 1 - __builtin_clzll(__n); } inline _GLIBCXX_CONSTEXPR unsigned long long __lg(unsigned long long __n) { return sizeof(long long) * __CHAR_BIT__ - 1 - __builtin_clzll(__n); } _GLIBCXX_END_NAMESPACE_VERSION _GLIBCXX_BEGIN_NAMESPACE_ALGO /** * @brief Tests a range for element-wise equality. * @ingroup non_mutating_algorithms * @param __first1 An input iterator. * @param __last1 An input iterator. * @param __first2 An input iterator. * @return A boolean true or false. * * This compares the elements of two ranges using @c == and returns true or * false depending on whether all of the corresponding elements of the * ranges are equal. */ template inline bool equal(_II1 __first1, _II1 __last1, _II2 __first2) { // concept requirements __glibcxx_function_requires(_InputIteratorConcept<_II1>) __glibcxx_function_requires(_InputIteratorConcept<_II2>) __glibcxx_function_requires(_EqualOpConcept< typename iterator_traits<_II1>::value_type, typename iterator_traits<_II2>::value_type>) __glibcxx_requires_valid_range(__first1, __last1); return std::__equal_aux(std::__niter_base(__first1), std::__niter_base(__last1), std::__niter_base(__first2)); } /** * @brief Tests a range for element-wise equality. * @ingroup non_mutating_algorithms * @param __first1 An input iterator. * @param __last1 An input iterator. * @param __first2 An input iterator. * @param __binary_pred A binary predicate @link functors * functor@endlink. * @return A boolean true or false. * * This compares the elements of two ranges using the binary_pred * parameter, and returns true or * false depending on whether all of the corresponding elements of the * ranges are equal. */ template inline bool equal(_IIter1 __first1, _IIter1 __last1, _IIter2 __first2, _BinaryPredicate __binary_pred) { // concept requirements __glibcxx_function_requires(_InputIteratorConcept<_IIter1>) __glibcxx_function_requires(_InputIteratorConcept<_IIter2>) __glibcxx_requires_valid_range(__first1, __last1); for (; __first1 != __last1; ++__first1, ++__first2) if (!bool(__binary_pred(*__first1, *__first2))) return false; return true; } #if __cplusplus > 201103L #define __cpp_lib_robust_nonmodifying_seq_ops 201304 /** * @brief Tests a range for element-wise equality. * @ingroup non_mutating_algorithms * @param __first1 An input iterator. * @param __last1 An input iterator. * @param __first2 An input iterator. * @param __last2 An input iterator. * @return A boolean true or false. * * This compares the elements of two ranges using @c == and returns true or * false depending on whether all of the corresponding elements of the * ranges are equal. */ template inline bool equal(_II1 __first1, _II1 __last1, _II2 __first2, _II2 __last2) { // concept requirements __glibcxx_function_requires(_InputIteratorConcept<_II1>) __glibcxx_function_requires(_InputIteratorConcept<_II2>) __glibcxx_function_requires(_EqualOpConcept< typename iterator_traits<_II1>::value_type, typename iterator_traits<_II2>::value_type>) __glibcxx_requires_valid_range(__first1, __last1); __glibcxx_requires_valid_range(__first2, __last2); using _RATag = random_access_iterator_tag; using _Cat1 = typename iterator_traits<_II1>::iterator_category; using _Cat2 = typename iterator_traits<_II2>::iterator_category; using _RAIters = __and_, is_same<_Cat2, _RATag>>; if (_RAIters()) { auto __d1 = std::distance(__first1, __last1); auto __d2 = std::distance(__first2, __last2); if (__d1 != __d2) return false; return _GLIBCXX_STD_A::equal(__first1, __last1, __first2); } for (; __first1 != __last1 && __first2 != __last2; ++__first1, ++__first2) if (!(*__first1 == *__first2)) return false; return __first1 == __last1 && __first2 == __last2; } /** * @brief Tests a range for element-wise equality. * @ingroup non_mutating_algorithms * @param __first1 An input iterator. * @param __last1 An input iterator. * @param __first2 An input iterator. * @param __last2 An input iterator. * @param __binary_pred A binary predicate @link functors * functor@endlink. * @return A boolean true or false. * * This compares the elements of two ranges using the binary_pred * parameter, and returns true or * false depending on whether all of the corresponding elements of the * ranges are equal. */ template inline bool equal(_IIter1 __first1, _IIter1 __last1, _IIter2 __first2, _IIter2 __last2, _BinaryPredicate __binary_pred) { // concept requirements __glibcxx_function_requires(_InputIteratorConcept<_IIter1>) __glibcxx_function_requires(_InputIteratorConcept<_IIter2>) __glibcxx_requires_valid_range(__first1, __last1); __glibcxx_requires_valid_range(__first2, __last2); using _RATag = random_access_iterator_tag; using _Cat1 = typename iterator_traits<_IIter1>::iterator_category; using _Cat2 = typename iterator_traits<_IIter2>::iterator_category; using _RAIters = __and_, is_same<_Cat2, _RATag>>; if (_RAIters()) { auto __d1 = std::distance(__first1, __last1); auto __d2 = std::distance(__first2, __last2); if (__d1 != __d2) return false; return _GLIBCXX_STD_A::equal(__first1, __last1, __first2, __binary_pred); } for (; __first1 != __last1 && __first2 != __last2; ++__first1, ++__first2) if (!bool(__binary_pred(*__first1, *__first2))) return false; return __first1 == __last1 && __first2 == __last2; } #endif # 1199 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algobase.h" 3 /** * @brief Performs @b dictionary comparison on ranges. * @ingroup sorting_algorithms * @param __first1 An input iterator. * @param __last1 An input iterator. * @param __first2 An input iterator. * @param __last2 An input iterator. * @return A boolean true or false. * * Returns true if the sequence of elements defined by the range * [first1,last1) is lexicographically less than the sequence of elements * defined by the range [first2,last2). Returns false otherwise. * (Quoted from [25.3.8]/1.) If the iterators are all character pointers, * then this is an inline call to @c memcmp. */ template inline bool lexicographical_compare(_II1 __first1, _II1 __last1, _II2 __first2, _II2 __last2) { #ifdef _GLIBCXX_CONCEPT_CHECKS // concept requirements typedef typename iterator_traits<_II1>::value_type _ValueType1; typedef typename iterator_traits<_II2>::value_type _ValueType2; #endif # 1225 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algobase.h" 3 __glibcxx_function_requires(_InputIteratorConcept<_II1>) __glibcxx_function_requires(_InputIteratorConcept<_II2>) __glibcxx_function_requires(_LessThanOpConcept<_ValueType1, _ValueType2>) __glibcxx_function_requires(_LessThanOpConcept<_ValueType2, _ValueType1>) __glibcxx_requires_valid_range(__first1, __last1); __glibcxx_requires_valid_range(__first2, __last2); return std::__lexicographical_compare_aux(std::__niter_base(__first1), std::__niter_base(__last1), std::__niter_base(__first2), std::__niter_base(__last2)); } /** * @brief Performs @b dictionary comparison on ranges. * @ingroup sorting_algorithms * @param __first1 An input iterator. * @param __last1 An input iterator. * @param __first2 An input iterator. * @param __last2 An input iterator. * @param __comp A @link comparison_functors comparison functor@endlink. * @return A boolean true or false. * * The same as the four-parameter @c lexicographical_compare, but uses the * comp parameter instead of @c <. */ template inline bool lexicographical_compare(_II1 __first1, _II1 __last1, _II2 __first2, _II2 __last2, _Compare __comp) { // concept requirements __glibcxx_function_requires(_InputIteratorConcept<_II1>) __glibcxx_function_requires(_InputIteratorConcept<_II2>) __glibcxx_requires_valid_range(__first1, __last1); __glibcxx_requires_valid_range(__first2, __last2); return std::__lexicographical_compare_impl (__first1, __last1, __first2, __last2, __gnu_cxx::__ops::__iter_comp_iter(__comp)); } template pair<_InputIterator1, _InputIterator2> __mismatch(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _BinaryPredicate __binary_pred) { while (__first1 != __last1 && __binary_pred(__first1, __first2)) { ++__first1; ++__first2; } return pair<_InputIterator1, _InputIterator2>(__first1, __first2); } /** * @brief Finds the places in ranges which don't match. * @ingroup non_mutating_algorithms * @param __first1 An input iterator. * @param __last1 An input iterator. * @param __first2 An input iterator. * @return A pair of iterators pointing to the first mismatch. * * This compares the elements of two ranges using @c == and returns a pair * of iterators. The first iterator points into the first range, the * second iterator points into the second range, and the elements pointed * to by the iterators are not equal. */ template inline pair<_InputIterator1, _InputIterator2> mismatch(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2) { // concept requirements __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>) __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>) __glibcxx_function_requires(_EqualOpConcept< typename iterator_traits<_InputIterator1>::value_type, typename iterator_traits<_InputIterator2>::value_type>) __glibcxx_requires_valid_range(__first1, __last1); return _GLIBCXX_STD_A::__mismatch(__first1, __last1, __first2, __gnu_cxx::__ops::__iter_equal_to_iter()); } /** * @brief Finds the places in ranges which don't match. * @ingroup non_mutating_algorithms * @param __first1 An input iterator. * @param __last1 An input iterator. * @param __first2 An input iterator. * @param __binary_pred A binary predicate @link functors * functor@endlink. * @return A pair of iterators pointing to the first mismatch. * * This compares the elements of two ranges using the binary_pred * parameter, and returns a pair * of iterators. The first iterator points into the first range, the * second iterator points into the second range, and the elements pointed * to by the iterators are not equal. */ template inline pair<_InputIterator1, _InputIterator2> mismatch(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _BinaryPredicate __binary_pred) { // concept requirements __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>) __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>) __glibcxx_requires_valid_range(__first1, __last1); return _GLIBCXX_STD_A::__mismatch(__first1, __last1, __first2, __gnu_cxx::__ops::__iter_comp_iter(__binary_pred)); } #if __cplusplus > 201103L template pair<_InputIterator1, _InputIterator2> __mismatch(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _BinaryPredicate __binary_pred) { while (__first1 != __last1 && __first2 != __last2 && __binary_pred(__first1, __first2)) { ++__first1; ++__first2; } return pair<_InputIterator1, _InputIterator2>(__first1, __first2); } /** * @brief Finds the places in ranges which don't match. * @ingroup non_mutating_algorithms * @param __first1 An input iterator. * @param __last1 An input iterator. * @param __first2 An input iterator. * @param __last2 An input iterator. * @return A pair of iterators pointing to the first mismatch. * * This compares the elements of two ranges using @c == and returns a pair * of iterators. The first iterator points into the first range, the * second iterator points into the second range, and the elements pointed * to by the iterators are not equal. */ template inline pair<_InputIterator1, _InputIterator2> mismatch(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2) { // concept requirements __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>) __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>) __glibcxx_function_requires(_EqualOpConcept< typename iterator_traits<_InputIterator1>::value_type, typename iterator_traits<_InputIterator2>::value_type>) __glibcxx_requires_valid_range(__first1, __last1); __glibcxx_requires_valid_range(__first2, __last2); return _GLIBCXX_STD_A::__mismatch(__first1, __last1, __first2, __last2, __gnu_cxx::__ops::__iter_equal_to_iter()); } /** * @brief Finds the places in ranges which don't match. * @ingroup non_mutating_algorithms * @param __first1 An input iterator. * @param __last1 An input iterator. * @param __first2 An input iterator. * @param __last2 An input iterator. * @param __binary_pred A binary predicate @link functors * functor@endlink. * @return A pair of iterators pointing to the first mismatch. * * This compares the elements of two ranges using the binary_pred * parameter, and returns a pair * of iterators. The first iterator points into the first range, the * second iterator points into the second range, and the elements pointed * to by the iterators are not equal. */ template inline pair<_InputIterator1, _InputIterator2> mismatch(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _BinaryPredicate __binary_pred) { // concept requirements __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>) __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>) __glibcxx_requires_valid_range(__first1, __last1); __glibcxx_requires_valid_range(__first2, __last2); return _GLIBCXX_STD_A::__mismatch(__first1, __last1, __first2, __last2, __gnu_cxx::__ops::__iter_comp_iter(__binary_pred)); } #endif # 1426 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algobase.h" 3 _GLIBCXX_END_NAMESPACE_ALGO } // namespace std // NB: This file is included within many other C++ includes, as a way // of getting the base algorithms. So, make sure that parallel bits // come in too if requested. #ifdef _GLIBCXX_PARALLEL #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 1434 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algobase.h" 3 # 1435 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algobase.h" 3 #endif # 1436 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algobase.h" 3 #endif # 1438 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algobase.h" 3 # 61 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/vector" 2 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 61 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/vector" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/allocator.h" 1 3 // Allocators -*- C++ -*- // Copyright (C) 2001-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /* * Copyright (c) 1996-1997 * Silicon Graphics Computer Systems, Inc. * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Silicon Graphics makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. */ /** @file bits/allocator.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{memory} */ #ifndef _ALLOCATOR_H #define _ALLOCATOR_H 1 #if 0 /* expanded by -frewrite-includes */ #include // Define the base class to std::allocator. #endif /* expanded by -frewrite-includes */ # 46 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/allocator.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++allocator.h" 1 3 // Base to std::allocator -*- C++ -*- // Copyright (C) 2004-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file bits/c++allocator.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{memory} */ #ifndef _GLIBCXX_CXX_ALLOCATOR_H #define _GLIBCXX_CXX_ALLOCATOR_H 1 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 33 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++allocator.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/new_allocator.h" 1 3 // Allocator that wraps operator new -*- C++ -*- // Copyright (C) 2001-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file ext/new_allocator.h * This file is a GNU extension to the Standard C++ Library. */ #ifndef _NEW_ALLOCATOR_H #define _NEW_ALLOCATOR_H 1 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 32 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/new_allocator.h" 3 # 33 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/new_allocator.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 33 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/new_allocator.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/new" 1 3 // The -*- C++ -*- dynamic memory management header. // Copyright (C) 1994-2015 Free Software Foundation, Inc. // This file is part of GCC. // // GCC is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 3, or (at your option) // any later version. // // GCC is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file new * This is a Standard C++ Library header. * * The header @c new defines several functions to manage dynamic memory and * handling memory allocation errors; see * http://gcc.gnu.org/onlinedocs/libstdc++/18_support/howto.html#4 for more. */ #ifndef _NEW #define _NEW #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 38 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/new" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/new" 3 # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/new" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/new" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/exception" 1 3 // Exception Handling support header for -*- C++ -*- // Copyright (C) 1995-2015 Free Software Foundation, Inc. // // This file is part of GCC. // // GCC is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 3, or (at your option) // any later version. // // GCC is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file exception * This is a Standard C++ Library header. */ #ifndef __EXCEPTION__ #define __EXCEPTION__ #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 34 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/exception" 3 #pragma GCC visibility push(default) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 37 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/exception" 3 # 38 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/exception" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 38 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/exception" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/atomic_lockfree_defines.h" 1 3 // -*- C++ -*- header. // Copyright (C) 2008-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file bits/atomic_lockfree_defines.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{atomic} */ #ifndef _GLIBCXX_ATOMIC_LOCK_FREE_H #define _GLIBCXX_ATOMIC_LOCK_FREE_H 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 34 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/atomic_lockfree_defines.h" 3 /** * @addtogroup atomics * @{ */ /** * Lock-free property. * * 0 indicates that the types are never lock-free. * 1 indicates that the types are sometimes lock-free. * 2 indicates that the types are always lock-free. */ #if __cplusplus >= 201103L #define ATOMIC_BOOL_LOCK_FREE __GCC_ATOMIC_BOOL_LOCK_FREE #define ATOMIC_CHAR_LOCK_FREE __GCC_ATOMIC_CHAR_LOCK_FREE #define ATOMIC_WCHAR_T_LOCK_FREE __GCC_ATOMIC_WCHAR_T_LOCK_FREE #define ATOMIC_CHAR16_T_LOCK_FREE __GCC_ATOMIC_CHAR16_T_LOCK_FREE #define ATOMIC_CHAR32_T_LOCK_FREE __GCC_ATOMIC_CHAR32_T_LOCK_FREE #define ATOMIC_SHORT_LOCK_FREE __GCC_ATOMIC_SHORT_LOCK_FREE #define ATOMIC_INT_LOCK_FREE __GCC_ATOMIC_INT_LOCK_FREE #define ATOMIC_LONG_LOCK_FREE __GCC_ATOMIC_LONG_LOCK_FREE #define ATOMIC_LLONG_LOCK_FREE __GCC_ATOMIC_LLONG_LOCK_FREE #define ATOMIC_POINTER_LOCK_FREE __GCC_ATOMIC_POINTER_LOCK_FREE #endif # 60 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/atomic_lockfree_defines.h" 3 // @} group atomics #endif # 64 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/atomic_lockfree_defines.h" 3 # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/exception" 2 3 extern "C++" { namespace std { /** * @defgroup exceptions Exceptions * @ingroup diagnostics * * Classes and functions for reporting errors via exception classes. * @{ */ /** * @brief Base class for all library exceptions. * * This is the base class for all exceptions thrown by the standard * library, and by certain language expressions. You are free to derive * your own %exception classes, or use a different hierarchy, or to * throw non-class data (e.g., fundamental types). */ class exception { public: exception() _GLIBCXX_USE_NOEXCEPT { } virtual ~exception() _GLIBCXX_USE_NOEXCEPT; /** Returns a C-style character string describing the general cause * of the current error. */ virtual const char* what() const _GLIBCXX_USE_NOEXCEPT; }; /** If an %exception is thrown which is not listed in a function's * %exception specification, one of these may be thrown. */ class bad_exception : public exception { public: bad_exception() _GLIBCXX_USE_NOEXCEPT { } // This declaration is not useless: // http://gcc.gnu.org/onlinedocs/gcc-3.0.2/gcc_6.html#SEC118 virtual ~bad_exception() _GLIBCXX_USE_NOEXCEPT; // See comment in eh_exception.cc. virtual const char* what() const _GLIBCXX_USE_NOEXCEPT; }; /// If you write a replacement %terminate handler, it must be of this type. typedef void (*terminate_handler) (); /// If you write a replacement %unexpected handler, it must be of this type. typedef void (*unexpected_handler) (); /// Takes a new handler function as an argument, returns the old function. terminate_handler set_terminate(terminate_handler) _GLIBCXX_USE_NOEXCEPT; #if __cplusplus >= 201103L /// Return the current terminate handler. terminate_handler get_terminate() noexcept; #endif # 99 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/exception" 3 /** The runtime will call this function if %exception handling must be * abandoned for any reason. It can also be called by the user. */ void terminate() _GLIBCXX_USE_NOEXCEPT __attribute__ ((__noreturn__)); /// Takes a new handler function as an argument, returns the old function. unexpected_handler set_unexpected(unexpected_handler) _GLIBCXX_USE_NOEXCEPT; #if __cplusplus >= 201103L /// Return the current unexpected handler. unexpected_handler get_unexpected() noexcept; #endif # 111 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/exception" 3 /** The runtime will call this function if an %exception is thrown which * violates the function's %exception specification. */ void unexpected() __attribute__ ((__noreturn__)); /** [18.6.4]/1: 'Returns true after completing evaluation of a * throw-expression until either completing initialization of the * exception-declaration in the matching handler or entering @c unexpected() * due to the throw; or after entering @c terminate() for any reason * other than an explicit call to @c terminate(). [Note: This includes * stack unwinding [15.2]. end note]' * * 2: 'When @c uncaught_exception() is true, throwing an * %exception can result in a call of @c terminate() * (15.5.1).' */ bool uncaught_exception() _GLIBCXX_USE_NOEXCEPT __attribute__ ((__pure__)); // @} group exceptions } // namespace std namespace __gnu_cxx { _GLIBCXX_BEGIN_NAMESPACE_VERSION /** * @brief A replacement for the standard terminate_handler which * prints more information about the terminating exception (if any) * on stderr. * * @ingroup exceptions * * Call * @code * std::set_terminate(__gnu_cxx::__verbose_terminate_handler) * @endcode * to use. For more info, see * http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt02ch06s02.html * * In 3.4 and later, this is on by default. */ void __verbose_terminate_handler(); _GLIBCXX_END_NAMESPACE_VERSION } // namespace } // extern "C++" #pragma GCC visibility pop #if (__cplusplus >= 201103L) && (ATOMIC_INT_LOCK_FREE > 1) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 162 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/exception" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/exception_ptr.h" 1 3 // Exception Handling support header (exception_ptr class) for -*- C++ -*- // Copyright (C) 2008-2015 Free Software Foundation, Inc. // // This file is part of GCC. // // GCC is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 3, or (at your option) // any later version. // // GCC is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file bits/exception_ptr.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{exception} */ #ifndef _EXCEPTION_PTR_H #define _EXCEPTION_PTR_H #pragma GCC visibility push(default) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 36 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/exception_ptr.h" 3 # 37 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/exception_ptr.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 37 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/exception_ptr.h" 3 # 38 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/exception_ptr.h" 3 #if ATOMIC_INT_LOCK_FREE < 2 # error This platform does not support exception propagation. #endif # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/exception_ptr.h" 3 extern "C++" { namespace std { class type_info; /** * @addtogroup exceptions * @{ */ namespace __exception_ptr { class exception_ptr; } using __exception_ptr::exception_ptr; /** Obtain an exception_ptr to the currently handled exception. If there * is none, or the currently handled exception is foreign, return the null * value. */ exception_ptr current_exception() _GLIBCXX_USE_NOEXCEPT; /// Throw the object pointed to by the exception_ptr. void rethrow_exception(exception_ptr) __attribute__ ((__noreturn__)); namespace __exception_ptr { /** * @brief An opaque pointer to an arbitrary exception. * @ingroup exceptions */ class exception_ptr { void* _M_exception_object; explicit exception_ptr(void* __e) _GLIBCXX_USE_NOEXCEPT; void _M_addref() _GLIBCXX_USE_NOEXCEPT; void _M_release() _GLIBCXX_USE_NOEXCEPT; void *_M_get() const _GLIBCXX_NOEXCEPT __attribute__ ((__pure__)); friend exception_ptr std::current_exception() _GLIBCXX_USE_NOEXCEPT; friend void std::rethrow_exception(exception_ptr); public: exception_ptr() _GLIBCXX_USE_NOEXCEPT; exception_ptr(const exception_ptr&) _GLIBCXX_USE_NOEXCEPT; #if __cplusplus >= 201103L exception_ptr(nullptr_t) noexcept : _M_exception_object(0) { } exception_ptr(exception_ptr&& __o) noexcept : _M_exception_object(__o._M_exception_object) { __o._M_exception_object = 0; } #endif # 103 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/exception_ptr.h" 3 #if (__cplusplus < 201103L) || defined (_GLIBCXX_EH_PTR_COMPAT) typedef void (exception_ptr::*__safe_bool)(); // For construction from nullptr or 0. exception_ptr(__safe_bool) _GLIBCXX_USE_NOEXCEPT; #endif # 110 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/exception_ptr.h" 3 exception_ptr& operator=(const exception_ptr&) _GLIBCXX_USE_NOEXCEPT; #if __cplusplus >= 201103L exception_ptr& operator=(exception_ptr&& __o) noexcept { exception_ptr(static_cast(__o)).swap(*this); return *this; } #endif # 122 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/exception_ptr.h" 3 ~exception_ptr() _GLIBCXX_USE_NOEXCEPT; void swap(exception_ptr&) _GLIBCXX_USE_NOEXCEPT; #ifdef _GLIBCXX_EH_PTR_COMPAT // Retained for compatibility with CXXABI_1.3. void _M_safe_bool_dummy() _GLIBCXX_USE_NOEXCEPT __attribute__ ((__const__)); bool operator!() const _GLIBCXX_USE_NOEXCEPT __attribute__ ((__pure__)); operator __safe_bool() const _GLIBCXX_USE_NOEXCEPT; #endif # 136 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/exception_ptr.h" 3 #if __cplusplus >= 201103L explicit operator bool() const { return _M_exception_object; } #endif # 141 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/exception_ptr.h" 3 friend bool operator==(const exception_ptr&, const exception_ptr&) _GLIBCXX_USE_NOEXCEPT __attribute__ ((__pure__)); const class std::type_info* __cxa_exception_type() const _GLIBCXX_USE_NOEXCEPT __attribute__ ((__pure__)); }; bool operator==(const exception_ptr&, const exception_ptr&) _GLIBCXX_USE_NOEXCEPT __attribute__ ((__pure__)); bool operator!=(const exception_ptr&, const exception_ptr&) _GLIBCXX_USE_NOEXCEPT __attribute__ ((__pure__)); inline void swap(exception_ptr& __lhs, exception_ptr& __rhs) { __lhs.swap(__rhs); } } // namespace __exception_ptr /// Obtain an exception_ptr pointing to a copy of the supplied object. template exception_ptr make_exception_ptr(_Ex __ex) _GLIBCXX_USE_NOEXCEPT { #if __cpp_exceptions try { throw __ex; } catch(...) { return current_exception(); } #else # 181 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/exception_ptr.h" 3 return exception_ptr(); #endif # 183 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/exception_ptr.h" 3 } // _GLIBCXX_RESOLVE_LIB_DEFECTS // 1130. copy_exception name misleading /// Obtain an exception_ptr pointing to a copy of the supplied object. /// This function is deprecated, use std::make_exception_ptr instead. template exception_ptr copy_exception(_Ex __ex) _GLIBCXX_USE_NOEXCEPT _GLIBCXX_DEPRECATED; template exception_ptr copy_exception(_Ex __ex) _GLIBCXX_USE_NOEXCEPT { return std::make_exception_ptr<_Ex>(__ex); } // @} group exceptions } // namespace std } // extern "C++" #pragma GCC visibility pop #endif # 206 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/exception_ptr.h" 3 # 163 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/exception" 2 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 163 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/exception" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/nested_exception.h" 1 3 // Nested Exception support header (nested_exception class) for -*- C++ -*- // Copyright (C) 2009-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file bits/nested_exception.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{exception} */ #ifndef _GLIBCXX_NESTED_EXCEPTION_H #define _GLIBCXX_NESTED_EXCEPTION_H 1 #pragma GCC visibility push(default) #if __cplusplus < 201103L #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 36 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/nested_exception.h" 3 # 37 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/nested_exception.h" 3 #else # 38 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/nested_exception.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/nested_exception.h" 3 # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/nested_exception.h" 3 #if ATOMIC_INT_LOCK_FREE < 2 # error This platform does not support exception propagation. #endif # 44 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/nested_exception.h" 3 extern "C++" { namespace std { /** * @addtogroup exceptions * @{ */ /// Exception class with exception_ptr data member. class nested_exception { exception_ptr _M_ptr; public: nested_exception() noexcept : _M_ptr(current_exception()) { } nested_exception(const nested_exception&) noexcept = default; nested_exception& operator=(const nested_exception&) noexcept = default; virtual ~nested_exception() noexcept; [[noreturn]] void rethrow_nested() const { if (_M_ptr) rethrow_exception(_M_ptr); std::terminate(); } exception_ptr nested_ptr() const noexcept { return _M_ptr; } }; template struct _Nested_exception : public _Except, public nested_exception { explicit _Nested_exception(const _Except& __ex) : _Except(__ex) { } explicit _Nested_exception(_Except&& __ex) : _Except(static_cast<_Except&&>(__ex)) { } }; template struct _Throw_with_nested_impl { template static void _S_throw(_Up&& __t) { throw _Nested_exception<_Tp>{static_cast<_Up&&>(__t)}; } }; template struct _Throw_with_nested_impl<_Tp, false> { template static void _S_throw(_Up&& __t) { throw static_cast<_Up&&>(__t); } }; template struct _Throw_with_nested_helper : _Throw_with_nested_impl<_Tp> { }; template struct _Throw_with_nested_helper<_Tp, false> : _Throw_with_nested_impl<_Tp, false> { }; template struct _Throw_with_nested_helper<_Tp&, false> : _Throw_with_nested_helper<_Tp> { }; template struct _Throw_with_nested_helper<_Tp&&, false> : _Throw_with_nested_helper<_Tp> { }; /// If @p __t is derived from nested_exception, throws @p __t. /// Else, throws an implementation-defined object derived from both. template [[noreturn]] inline void throw_with_nested(_Tp&& __t) { _Throw_with_nested_helper<_Tp>::_S_throw(static_cast<_Tp&&>(__t)); } template struct _Rethrow_if_nested_impl { static void _S_rethrow(const _Tp& __t) { if (auto __tp = dynamic_cast(&__t)) __tp->rethrow_nested(); } }; template struct _Rethrow_if_nested_impl<_Tp, false> { static void _S_rethrow(const _Tp&) { } }; /// If @p __ex is derived from nested_exception, @p __ex.rethrow_nested(). template inline void rethrow_if_nested(const _Ex& __ex) { _Rethrow_if_nested_impl<_Ex>::_S_rethrow(__ex); } // @} group exceptions } // namespace std } // extern "C++" #endif // C++11 # 170 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/nested_exception.h" 3 #pragma GCC visibility pop #endif // _GLIBCXX_NESTED_EXCEPTION_H # 174 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/nested_exception.h" 3 # 164 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/exception" 2 3 #endif # 165 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/exception" 3 #endif # 167 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/exception" 3 # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/new" 2 3 #pragma GCC visibility push(default) extern "C++" { namespace std { /** * @brief Exception possibly thrown by @c new. * @ingroup exceptions * * @c bad_alloc (or classes derived from it) is used to report allocation * errors from the throwing forms of @c new. */ class bad_alloc : public exception { public: bad_alloc() throw() { } // This declaration is not useless: // http://gcc.gnu.org/onlinedocs/gcc-3.0.2/gcc_6.html#SEC118 virtual ~bad_alloc() throw(); // See comment in eh_exception.cc. virtual const char* what() const throw(); }; #if __cplusplus >= 201103L class bad_array_new_length : public bad_alloc { public: bad_array_new_length() throw() { }; // This declaration is not useless: // http://gcc.gnu.org/onlinedocs/gcc-3.0.2/gcc_6.html#SEC118 virtual ~bad_array_new_length() throw(); // See comment in eh_exception.cc. virtual const char* what() const throw(); }; #endif # 81 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/new" 3 struct nothrow_t { }; extern const nothrow_t nothrow; /** If you write your own error handler to be called by @c new, it must * be of this type. */ typedef void (*new_handler)(); /// Takes a replacement handler as the argument, returns the /// previous handler. new_handler set_new_handler(new_handler) throw(); #if __cplusplus >= 201103L /// Return the current new handler. new_handler get_new_handler() noexcept; #endif # 98 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/new" 3 } // namespace std //@{ /** These are replaceable signatures: * - normal single new and delete (no arguments, throw @c bad_alloc on error) * - normal array new and delete (same) * - @c nothrow single new and delete (take a @c nothrow argument, return * @c NULL on error) * - @c nothrow array new and delete (same) * * Placement new and delete signatures (take a memory address argument, * does nothing) may not be replaced by a user's program. */ void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc) __attribute__((__externally_visible__)); void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc) __attribute__((__externally_visible__)); void operator delete(void*) _GLIBCXX_USE_NOEXCEPT __attribute__((__externally_visible__)); void operator delete[](void*) _GLIBCXX_USE_NOEXCEPT __attribute__((__externally_visible__)); void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT __attribute__((__externally_visible__)); void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT __attribute__((__externally_visible__)); void operator delete(void*, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT __attribute__((__externally_visible__)); void operator delete[](void*, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT __attribute__((__externally_visible__)); // Default placement versions of operator new. inline void* operator new(std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT { return __p; } inline void* operator new[](std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT { return __p; } // Default placement versions of operator delete. inline void operator delete (void*, void*) _GLIBCXX_USE_NOEXCEPT { } inline void operator delete[](void*, void*) _GLIBCXX_USE_NOEXCEPT { } //@} } // extern "C++" #pragma GCC visibility pop #endif # 143 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/new" 3 # 34 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/new_allocator.h" 2 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 34 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/new_allocator.h" 3 # 35 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/new_allocator.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 35 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/new_allocator.h" 3 # 36 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/new_allocator.h" 3 #if __cplusplus >= 201103L #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 37 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/new_allocator.h" 3 # 38 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/new_allocator.h" 3 #endif # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/new_allocator.h" 3 namespace __gnu_cxx _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION using std::size_t; using std::ptrdiff_t; /** * @brief An allocator that uses global new, as per [20.4]. * @ingroup allocators * * This is precisely the allocator defined in the C++ Standard. * - all allocation calls operator new * - all deallocation calls operator delete * * @tparam _Tp Type of allocated object. */ template class new_allocator { public: typedef size_t size_type; typedef ptrdiff_t difference_type; typedef _Tp* pointer; typedef const _Tp* const_pointer; typedef _Tp& reference; typedef const _Tp& const_reference; typedef _Tp value_type; template struct rebind { typedef new_allocator<_Tp1> other; }; #if __cplusplus >= 201103L // _GLIBCXX_RESOLVE_LIB_DEFECTS // 2103. propagate_on_container_move_assignment typedef std::true_type propagate_on_container_move_assignment; #endif # 78 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/new_allocator.h" 3 new_allocator() _GLIBCXX_USE_NOEXCEPT { } new_allocator(const new_allocator&) _GLIBCXX_USE_NOEXCEPT { } template new_allocator(const new_allocator<_Tp1>&) _GLIBCXX_USE_NOEXCEPT { } ~new_allocator() _GLIBCXX_USE_NOEXCEPT { } pointer address(reference __x) const _GLIBCXX_NOEXCEPT { return std::__addressof(__x); } const_pointer address(const_reference __x) const _GLIBCXX_NOEXCEPT { return std::__addressof(__x); } // NB: __n is permitted to be 0. The C++ standard says nothing // about what the return value is when __n == 0. pointer allocate(size_type __n, const void* = 0) { if (__n > this->max_size()) std::__throw_bad_alloc(); return static_cast<_Tp*>(::operator new(__n * sizeof(_Tp))); } // __p is not permitted to be a null pointer. void deallocate(pointer __p, size_type) { ::operator delete(__p); } size_type max_size() const _GLIBCXX_USE_NOEXCEPT { return size_t(-1) / sizeof(_Tp); } #if __cplusplus >= 201103L template void construct(_Up* __p, _Args&&... __args) { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); } template void destroy(_Up* __p) { __p->~_Up(); } #else # 126 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/new_allocator.h" 3 // _GLIBCXX_RESOLVE_LIB_DEFECTS // 402. wrong new expression in [some_] allocator::construct void construct(pointer __p, const _Tp& __val) { ::new((void *)__p) _Tp(__val); } void destroy(pointer __p) { __p->~_Tp(); } #endif # 135 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/new_allocator.h" 3 }; template inline bool operator==(const new_allocator<_Tp>&, const new_allocator<_Tp>&) { return true; } template inline bool operator!=(const new_allocator<_Tp>&, const new_allocator<_Tp>&) { return false; } _GLIBCXX_END_NAMESPACE_VERSION } // namespace #endif # 151 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/new_allocator.h" 3 # 34 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++allocator.h" 2 3 #if __cplusplus >= 201103L namespace std { /** * @brief An alias to the base class for std::allocator. * @ingroup allocators * * Used to set the std::allocator base class to * __gnu_cxx::new_allocator. * * @tparam _Tp Type of allocated object. */ template using __allocator_base = __gnu_cxx::new_allocator<_Tp>; } #else # 51 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++allocator.h" 3 // Define new_allocator as the base class to std::allocator. # define __allocator_base __gnu_cxx::new_allocator #endif # 54 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++allocator.h" 3 #endif # 56 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++allocator.h" 3 # 47 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/allocator.h" 2 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 47 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/allocator.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/memoryfwd.h" 1 3 // Forward declarations -*- C++ -*- // Copyright (C) 2001-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /* * Copyright (c) 1996-1997 * Silicon Graphics Computer Systems, Inc. * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Silicon Graphics makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. */ /** @file bits/memoryfwd.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{memory} */ #ifndef _MEMORYFWD_H #define _MEMORYFWD_H 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 47 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/memoryfwd.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 48 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/memoryfwd.h" 3 # 49 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/memoryfwd.h" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION /** * @defgroup allocators Allocators * @ingroup memory * * Classes encapsulating memory operations. * * @{ */ template class allocator; template<> class allocator; /// Declare uses_allocator so it can be specialized in \ etc. template struct uses_allocator; /// @} group memory _GLIBCXX_END_NAMESPACE_VERSION } // namespace std #endif # 79 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/memoryfwd.h" 3 # 48 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/allocator.h" 2 3 #if __cplusplus >= 201103L #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 49 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/allocator.h" 3 # 50 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/allocator.h" 3 #endif # 51 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/allocator.h" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION /** * @addtogroup allocators * @{ */ /// allocator specialization. template<> class allocator { public: typedef size_t size_type; typedef ptrdiff_t difference_type; typedef void* pointer; typedef const void* const_pointer; typedef void value_type; template struct rebind { typedef allocator<_Tp1> other; }; #if __cplusplus >= 201103L // _GLIBCXX_RESOLVE_LIB_DEFECTS // 2103. std::allocator propagate_on_container_move_assignment typedef true_type propagate_on_container_move_assignment; #endif # 81 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/allocator.h" 3 }; /** * @brief The @a standard allocator, as per [20.4]. * * See https://gcc.gnu.org/onlinedocs/libstdc++/manual/memory.html#std.util.memory.allocator * for further details. * * @tparam _Tp Type of allocated object. */ template class allocator: public __allocator_base<_Tp> { public: typedef size_t size_type; typedef ptrdiff_t difference_type; typedef _Tp* pointer; typedef const _Tp* const_pointer; typedef _Tp& reference; typedef const _Tp& const_reference; typedef _Tp value_type; template struct rebind { typedef allocator<_Tp1> other; }; #if __cplusplus >= 201103L // _GLIBCXX_RESOLVE_LIB_DEFECTS // 2103. std::allocator propagate_on_container_move_assignment typedef true_type propagate_on_container_move_assignment; #endif # 112 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/allocator.h" 3 allocator() throw() { } allocator(const allocator& __a) throw() : __allocator_base<_Tp>(__a) { } template allocator(const allocator<_Tp1>&) throw() { } ~allocator() throw() { } // Inherit everything else. }; template inline bool operator==(const allocator<_T1>&, const allocator<_T2>&) _GLIBCXX_USE_NOEXCEPT { return true; } template inline bool operator==(const allocator<_Tp>&, const allocator<_Tp>&) _GLIBCXX_USE_NOEXCEPT { return true; } template inline bool operator!=(const allocator<_T1>&, const allocator<_T2>&) _GLIBCXX_USE_NOEXCEPT { return false; } template inline bool operator!=(const allocator<_Tp>&, const allocator<_Tp>&) _GLIBCXX_USE_NOEXCEPT { return false; } /// @} group allocator // Inhibit implicit instantiations for required instantiations, // which are defined via explicit instantiations elsewhere. #if _GLIBCXX_EXTERN_TEMPLATE extern template class allocator; extern template class allocator; #endif # 158 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/allocator.h" 3 // Undefine. #undef __allocator_base // To implement Option 3 of DR 431. template struct __alloc_swap { static void _S_do_it(_Alloc&, _Alloc&) _GLIBCXX_NOEXCEPT { } }; template struct __alloc_swap<_Alloc, false> { static void _S_do_it(_Alloc& __one, _Alloc& __two) _GLIBCXX_NOEXCEPT { // Precondition: swappable allocators. if (__one != __two) swap(__one, __two); } }; // Optimize for stateless allocators. template struct __alloc_neq { static bool _S_do_it(const _Alloc&, const _Alloc&) { return false; } }; template struct __alloc_neq<_Alloc, false> { static bool _S_do_it(const _Alloc& __one, const _Alloc& __two) { return __one != __two; } }; #if __cplusplus >= 201103L template, is_nothrow_move_constructible>::value> struct __shrink_to_fit_aux { static bool _S_do_it(_Tp&) noexcept { return false; } }; template struct __shrink_to_fit_aux<_Tp, true> { static bool _S_do_it(_Tp& __c) noexcept { #if __cpp_exceptions try { _Tp(__make_move_if_noexcept_iterator(__c.begin()), __make_move_if_noexcept_iterator(__c.end()), __c.get_allocator()).swap(__c); return true; } catch(...) { return false; } #else # 220 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/allocator.h" 3 return false; #endif # 222 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/allocator.h" 3 } }; #endif # 225 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/allocator.h" 3 _GLIBCXX_END_NAMESPACE_VERSION } // namespace std #endif # 230 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/allocator.h" 3 # 62 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/vector" 2 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 62 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/vector" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_construct.h" 1 3 // nonstandard construct and destroy functions -*- C++ -*- // Copyright (C) 2001-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /* * * Copyright (c) 1994 * Hewlett-Packard Company * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Hewlett-Packard Company makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. * * * Copyright (c) 1996,1997 * Silicon Graphics Computer Systems, Inc. * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Silicon Graphics makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. */ /** @file bits/stl_construct.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{memory} */ #ifndef _STL_CONSTRUCT_H #define _STL_CONSTRUCT_H 1 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 59 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_construct.h" 3 # 60 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_construct.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 60 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_construct.h" 3 # 61 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_construct.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 61 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_construct.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/alloc_traits.h" 1 3 // Allocator traits -*- C++ -*- // Copyright (C) 2011-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file ext/alloc_traits.h * This file is a GNU extension to the Standard C++ Library. */ #ifndef _EXT_ALLOC_TRAITS_H #define _EXT_ALLOC_TRAITS_H 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 33 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/alloc_traits.h" 3 #if __cplusplus >= 201103L #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 35 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/alloc_traits.h" 3 # 36 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/alloc_traits.h" 3 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 36 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/alloc_traits.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/alloc_traits.h" 1 3 // Allocator traits -*- C++ -*- // Copyright (C) 2011-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file bits/alloc_traits.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{memory} */ #ifndef _ALLOC_TRAITS_H #define _ALLOC_TRAITS_H 1 #if __cplusplus >= 201103L #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 35 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/alloc_traits.h" 3 # 36 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/alloc_traits.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 36 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/alloc_traits.h" 3 # 37 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/alloc_traits.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 37 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/alloc_traits.h" 3 # 38 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/alloc_traits.h" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION template class __alloctr_rebind_helper { template static constexpr true_type _S_chk(typename _Alloc2::template rebind<_Tp2>::other*); template static constexpr false_type _S_chk(...); public: using __type = decltype(_S_chk<_Alloc, _Tp>(nullptr)); }; template::__type::value> struct __alloctr_rebind; template struct __alloctr_rebind<_Alloc, _Tp, true> { typedef typename _Alloc::template rebind<_Tp>::other __type; }; template class _Alloc, typename _Tp, typename _Up, typename... _Args> struct __alloctr_rebind<_Alloc<_Up, _Args...>, _Tp, false> { typedef _Alloc<_Tp, _Args...> __type; }; template using __alloc_rebind = typename __alloctr_rebind<_Alloc, _Tp>::__type; /** * @brief Uniform interface to all allocator types. * @ingroup allocators */ template struct allocator_traits { /// The allocator type typedef _Alloc allocator_type; /// The allocated type typedef typename _Alloc::value_type value_type; #define _GLIBCXX_ALLOC_TR_NESTED_TYPE(_NTYPE, _ALT) \ private: \ template \ static typename _Tp::_NTYPE _S_##_NTYPE##_helper(_Tp*); \ static _ALT _S_##_NTYPE##_helper(...); \ typedef decltype(_S_##_NTYPE##_helper((_Alloc*)0)) __##_NTYPE; \ public: _GLIBCXX_ALLOC_TR_NESTED_TYPE(pointer, value_type*) /** * @brief The allocator's pointer type. * * @c Alloc::pointer if that type exists, otherwise @c value_type* */ typedef __pointer pointer; _GLIBCXX_ALLOC_TR_NESTED_TYPE(const_pointer, typename pointer_traits::template rebind) /** * @brief The allocator's const pointer type. * * @c Alloc::const_pointer if that type exists, otherwise * pointer_traits::rebind */ typedef __const_pointer const_pointer; _GLIBCXX_ALLOC_TR_NESTED_TYPE(void_pointer, typename pointer_traits::template rebind) /** * @brief The allocator's void pointer type. * * @c Alloc::void_pointer if that type exists, otherwise * pointer_traits::rebind */ typedef __void_pointer void_pointer; _GLIBCXX_ALLOC_TR_NESTED_TYPE(const_void_pointer, typename pointer_traits::template rebind) /** * @brief The allocator's const void pointer type. * * @c Alloc::const_void_pointer if that type exists, otherwise * pointer_traits::rebind */ typedef __const_void_pointer const_void_pointer; _GLIBCXX_ALLOC_TR_NESTED_TYPE(difference_type, typename pointer_traits::difference_type) /** * @brief The allocator's difference type * * @c Alloc::difference_type if that type exists, otherwise * pointer_traits::difference_type */ typedef __difference_type difference_type; _GLIBCXX_ALLOC_TR_NESTED_TYPE(size_type, typename make_unsigned::type) /** * @brief The allocator's size type * * @c Alloc::size_type if that type exists, otherwise * make_unsigned::type */ typedef __size_type size_type; _GLIBCXX_ALLOC_TR_NESTED_TYPE(propagate_on_container_copy_assignment, false_type) /** * @brief How the allocator is propagated on copy assignment * * @c Alloc::propagate_on_container_copy_assignment if that type exists, * otherwise @c false_type */ typedef __propagate_on_container_copy_assignment propagate_on_container_copy_assignment; _GLIBCXX_ALLOC_TR_NESTED_TYPE(propagate_on_container_move_assignment, false_type) /** * @brief How the allocator is propagated on move assignment * * @c Alloc::propagate_on_container_move_assignment if that type exists, * otherwise @c false_type */ typedef __propagate_on_container_move_assignment propagate_on_container_move_assignment; _GLIBCXX_ALLOC_TR_NESTED_TYPE(propagate_on_container_swap, false_type) /** * @brief How the allocator is propagated on swap * * @c Alloc::propagate_on_container_swap if that type exists, * otherwise @c false_type */ typedef __propagate_on_container_swap propagate_on_container_swap; #undef _GLIBCXX_ALLOC_TR_NESTED_TYPE template using rebind_alloc = typename __alloctr_rebind<_Alloc, _Tp>::__type; template using rebind_traits = allocator_traits>; private: template struct __allocate_helper { template()->allocate( std::declval(), std::declval()))> static true_type __test(int); template static false_type __test(...); using type = decltype(__test<_Alloc>(0)); }; template using __has_allocate = typename __allocate_helper<_Alloc2>::type; template>> static pointer _S_allocate(_Alloc2& __a, size_type __n, const_void_pointer __hint) { return __a.allocate(__n, __hint); } template>>> static pointer _S_allocate(_Alloc2& __a, size_type __n, _UnusedHint) { return __a.allocate(__n); } template struct __construct_helper { template()->construct( std::declval<_Tp*>(), std::declval<_Args>()...))> static true_type __test(int); template static false_type __test(...); using type = decltype(__test<_Alloc>(0)); }; template using __has_construct = typename __construct_helper<_Tp, _Args...>::type; template static _Require<__has_construct<_Tp, _Args...>> _S_construct(_Alloc& __a, _Tp* __p, _Args&&... __args) { __a.construct(__p, std::forward<_Args>(__args)...); } template static _Require<__and_<__not_<__has_construct<_Tp, _Args...>>, is_constructible<_Tp, _Args...>>> _S_construct(_Alloc&, _Tp* __p, _Args&&... __args) { ::new((void*)__p) _Tp(std::forward<_Args>(__args)...); } template struct __destroy_helper { template()->destroy( std::declval<_Tp*>()))> static true_type __test(int); template static false_type __test(...); using type = decltype(__test<_Alloc>(0)); }; template using __has_destroy = typename __destroy_helper<_Tp>::type; template static _Require<__has_destroy<_Tp>> _S_destroy(_Alloc& __a, _Tp* __p) { __a.destroy(__p); } template static _Require<__not_<__has_destroy<_Tp>>> _S_destroy(_Alloc&, _Tp* __p) { __p->~_Tp(); } template struct __maxsize_helper { template()->max_size())> static true_type __test(int); template static false_type __test(...); using type = decltype(__test<_Alloc2>(0)); }; template using __has_max_size = typename __maxsize_helper<_Alloc2>::type; template>> static size_type _S_max_size(_Alloc2& __a, int) { return __a.max_size(); } template>>> static size_type _S_max_size(_Alloc2&, ...) { return __gnu_cxx::__numeric_traits::__max; } template struct __select_helper { template() ->select_on_container_copy_construction())> static true_type __test(int); template static false_type __test(...); using type = decltype(__test<_Alloc2>(0)); }; template using __has_soccc = typename __select_helper<_Alloc2>::type; template>> static _Alloc2 _S_select(_Alloc2& __a, int) { return __a.select_on_container_copy_construction(); } template>>> static _Alloc2 _S_select(_Alloc2& __a, ...) { return __a; } public: /** * @brief Allocate memory. * @param __a An allocator. * @param __n The number of objects to allocate space for. * * Calls @c a.allocate(n) */ static pointer allocate(_Alloc& __a, size_type __n) { return __a.allocate(__n); } /** * @brief Allocate memory. * @param __a An allocator. * @param __n The number of objects to allocate space for. * @param __hint Aid to locality. * @return Memory of suitable size and alignment for @a n objects * of type @c value_type * * Returns a.allocate(n, hint) if that expression is * well-formed, otherwise returns @c a.allocate(n) */ static pointer allocate(_Alloc& __a, size_type __n, const_void_pointer __hint) { return _S_allocate(__a, __n, __hint); } /** * @brief Deallocate memory. * @param __a An allocator. * @param __p Pointer to the memory to deallocate. * @param __n The number of objects space was allocated for. * * Calls a.deallocate(p, n) */ static void deallocate(_Alloc& __a, pointer __p, size_type __n) { __a.deallocate(__p, __n); } /** * @brief Construct an object of type @a _Tp * @param __a An allocator. * @param __p Pointer to memory of suitable size and alignment for Tp * @param __args Constructor arguments. * * Calls __a.construct(__p, std::forward(__args)...) * if that expression is well-formed, otherwise uses placement-new * to construct an object of type @a _Tp at location @a __p from the * arguments @a __args... */ template static auto construct(_Alloc& __a, _Tp* __p, _Args&&... __args) -> decltype(_S_construct(__a, __p, std::forward<_Args>(__args)...)) { _S_construct(__a, __p, std::forward<_Args>(__args)...); } /** * @brief Destroy an object of type @a _Tp * @param __a An allocator. * @param __p Pointer to the object to destroy * * Calls @c __a.destroy(__p) if that expression is well-formed, * otherwise calls @c __p->~_Tp() */ template static void destroy(_Alloc& __a, _Tp* __p) { _S_destroy(__a, __p); } /** * @brief The maximum supported allocation size * @param __a An allocator. * @return @c __a.max_size() or @c numeric_limits::max() * * Returns @c __a.max_size() if that expression is well-formed, * otherwise returns @c numeric_limits::max() */ static size_type max_size(const _Alloc& __a) noexcept { return _S_max_size(__a, 0); } /** * @brief Obtain an allocator to use when copying a container. * @param __rhs An allocator. * @return @c __rhs.select_on_container_copy_construction() or @a __rhs * * Returns @c __rhs.select_on_container_copy_construction() if that * expression is well-formed, otherwise returns @a __rhs */ static _Alloc select_on_container_copy_construction(const _Alloc& __rhs) { return _S_select(__rhs, 0); } }; /// Partial specialization for std::allocator. template struct allocator_traits> { /// The allocator type using allocator_type = allocator<_Tp>; /// The allocated type using value_type = _Tp; /// The allocator's pointer type. using pointer = _Tp*; /// The allocator's const pointer type. using const_pointer = const _Tp*; /// The allocator's void pointer type. using void_pointer = void*; /// The allocator's const void pointer type. using const_void_pointer = const void*; /// The allocator's difference type using difference_type = std::ptrdiff_t; /// The allocator's size type using size_type = std::size_t; /// How the allocator is propagated on copy assignment using propagate_on_container_copy_assignment = false_type; /// How the allocator is propagated on move assignment using propagate_on_container_move_assignment = true_type; /// How the allocator is propagated on swap using propagate_on_container_swap = false_type; template using rebind_alloc = allocator<_Up>; template using rebind_traits = allocator_traits>; /** * @brief Allocate memory. * @param __a An allocator. * @param __n The number of objects to allocate space for. * * Calls @c a.allocate(n) */ static pointer allocate(allocator_type& __a, size_type __n) { return __a.allocate(__n); } /** * @brief Allocate memory. * @param __a An allocator. * @param __n The number of objects to allocate space for. * @param __hint Aid to locality. * @return Memory of suitable size and alignment for @a n objects * of type @c value_type * * Returns a.allocate(n, hint) */ static pointer allocate(allocator_type& __a, size_type __n, const_void_pointer __hint) { return __a.allocate(__n, __hint); } /** * @brief Deallocate memory. * @param __a An allocator. * @param __p Pointer to the memory to deallocate. * @param __n The number of objects space was allocated for. * * Calls a.deallocate(p, n) */ static void deallocate(allocator_type& __a, pointer __p, size_type __n) { __a.deallocate(__p, __n); } /** * @brief Construct an object of type @a _Up * @param __a An allocator. * @param __p Pointer to memory of suitable size and alignment for Tp * @param __args Constructor arguments. * * Calls __a.construct(__p, std::forward(__args)...) */ template static void construct(allocator_type& __a, _Up* __p, _Args&&... __args) { __a.construct(__p, std::forward<_Args>(__args)...); } /** * @brief Destroy an object of type @a _Up * @param __a An allocator. * @param __p Pointer to the object to destroy * * Calls @c __a.destroy(__p). */ template static void destroy(allocator_type& __a, _Up* __p) { __a.destroy(__p); } /** * @brief The maximum supported allocation size * @param __a An allocator. * @return @c __a.max_size() */ static size_type max_size(const allocator_type& __a) noexcept { return __a.max_size(); } /** * @brief Obtain an allocator to use when copying a container. * @param __rhs An allocator. * @return @c __rhs */ static allocator_type select_on_container_copy_construction(const allocator_type& __rhs) { return __rhs; } }; template inline void __do_alloc_on_copy(_Alloc& __one, const _Alloc& __two, true_type) { __one = __two; } template inline void __do_alloc_on_copy(_Alloc&, const _Alloc&, false_type) { } template inline void __alloc_on_copy(_Alloc& __one, const _Alloc& __two) { typedef allocator_traits<_Alloc> __traits; typedef typename __traits::propagate_on_container_copy_assignment __pocca; __do_alloc_on_copy(__one, __two, __pocca()); } template inline _Alloc __alloc_on_copy(const _Alloc& __a) { typedef allocator_traits<_Alloc> __traits; return __traits::select_on_container_copy_construction(__a); } template inline void __do_alloc_on_move(_Alloc& __one, _Alloc& __two, true_type) { __one = std::move(__two); } template inline void __do_alloc_on_move(_Alloc&, _Alloc&, false_type) { } template inline void __alloc_on_move(_Alloc& __one, _Alloc& __two) { typedef allocator_traits<_Alloc> __traits; typedef typename __traits::propagate_on_container_move_assignment __pocma; __do_alloc_on_move(__one, __two, __pocma()); } template inline void __do_alloc_on_swap(_Alloc& __one, _Alloc& __two, true_type) { using std::swap; swap(__one, __two); } template inline void __do_alloc_on_swap(_Alloc&, _Alloc&, false_type) { } template inline void __alloc_on_swap(_Alloc& __one, _Alloc& __two) { typedef allocator_traits<_Alloc> __traits; typedef typename __traits::propagate_on_container_swap __pocs; __do_alloc_on_swap(__one, __two, __pocs()); } template class __is_copy_insertable_impl { typedef allocator_traits<_Alloc> _Traits; template(), std::declval<_Up*>(), std::declval()))> static true_type _M_select(int); template static false_type _M_select(...); public: typedef decltype(_M_select(0)) type; }; // true if _Alloc::value_type is CopyInsertable into containers using _Alloc template struct __is_copy_insertable : __is_copy_insertable_impl<_Alloc>::type { }; // std::allocator<_Tp> just requires CopyConstructible template struct __is_copy_insertable> : is_copy_constructible<_Tp> { }; _GLIBCXX_END_NAMESPACE_VERSION } // namespace std #endif # 660 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/alloc_traits.h" 3 #endif # 661 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/alloc_traits.h" 3 # 37 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/alloc_traits.h" 2 3 #else # 38 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/alloc_traits.h" 3 #if 0 /* expanded by -frewrite-includes */ # include // for __alloc_swap #endif /* expanded by -frewrite-includes */ # 38 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/alloc_traits.h" 3 # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/alloc_traits.h" 3 #endif # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/alloc_traits.h" 3 namespace __gnu_cxx _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION #if __cplusplus >= 201103L template struct __allocator_always_compares_equal : std::false_type { }; template struct __allocator_always_compares_equal> : std::true_type { }; template struct array_allocator; template struct __allocator_always_compares_equal> : std::true_type { }; template struct bitmap_allocator; template struct __allocator_always_compares_equal> : std::true_type { }; template struct malloc_allocator; template struct __allocator_always_compares_equal> : std::true_type { }; template struct mt_allocator; template struct __allocator_always_compares_equal> : std::true_type { }; template struct new_allocator; template struct __allocator_always_compares_equal> : std::true_type { }; template struct pool_allocator; template struct __allocator_always_compares_equal> : std::true_type { }; #endif # 89 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/alloc_traits.h" 3 /** * @brief Uniform interface to C++98 and C++0x allocators. * @ingroup allocators */ template struct __alloc_traits #if __cplusplus >= 201103L : std::allocator_traits<_Alloc> #endif # 99 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/alloc_traits.h" 3 { typedef _Alloc allocator_type; #if __cplusplus >= 201103L typedef std::allocator_traits<_Alloc> _Base_type; typedef typename _Base_type::value_type value_type; typedef typename _Base_type::pointer pointer; typedef typename _Base_type::const_pointer const_pointer; typedef typename _Base_type::size_type size_type; typedef typename _Base_type::difference_type difference_type; // C++11 allocators do not define reference or const_reference typedef value_type& reference; typedef const value_type& const_reference; using _Base_type::allocate; using _Base_type::deallocate; using _Base_type::construct; using _Base_type::destroy; using _Base_type::max_size; private: template using __is_custom_pointer = std::__and_, std::__not_>>; public: // overload construct for non-standard pointer types template static typename std::enable_if<__is_custom_pointer<_Ptr>::value>::type construct(_Alloc& __a, _Ptr __p, _Args&&... __args) { _Base_type::construct(__a, std::addressof(*__p), std::forward<_Args>(__args)...); } // overload destroy for non-standard pointer types template static typename std::enable_if<__is_custom_pointer<_Ptr>::value>::type destroy(_Alloc& __a, _Ptr __p) { _Base_type::destroy(__a, std::addressof(*__p)); } static _Alloc _S_select_on_copy(const _Alloc& __a) { return _Base_type::select_on_container_copy_construction(__a); } static void _S_on_swap(_Alloc& __a, _Alloc& __b) { std::__alloc_on_swap(__a, __b); } static constexpr bool _S_propagate_on_copy_assign() { return _Base_type::propagate_on_container_copy_assignment::value; } static constexpr bool _S_propagate_on_move_assign() { return _Base_type::propagate_on_container_move_assignment::value; } static constexpr bool _S_propagate_on_swap() { return _Base_type::propagate_on_container_swap::value; } static constexpr bool _S_always_equal() { return __allocator_always_compares_equal<_Alloc>::value; } static constexpr bool _S_nothrow_move() { return _S_propagate_on_move_assign() || _S_always_equal(); } static constexpr bool _S_nothrow_swap() { using std::swap; return !_S_propagate_on_swap() || noexcept(swap(std::declval<_Alloc&>(), std::declval<_Alloc&>())); } template struct rebind { typedef typename _Base_type::template rebind_alloc<_Tp> other; }; #else # 171 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/alloc_traits.h" 3 typedef typename _Alloc::pointer pointer; typedef typename _Alloc::const_pointer const_pointer; typedef typename _Alloc::value_type value_type; typedef typename _Alloc::reference reference; typedef typename _Alloc::const_reference const_reference; typedef typename _Alloc::size_type size_type; typedef typename _Alloc::difference_type difference_type; static pointer allocate(_Alloc& __a, size_type __n) { return __a.allocate(__n); } static void deallocate(_Alloc& __a, pointer __p, size_type __n) { __a.deallocate(__p, __n); } template static void construct(_Alloc& __a, pointer __p, const _Tp& __arg) { __a.construct(__p, __arg); } static void destroy(_Alloc& __a, pointer __p) { __a.destroy(__p); } static size_type max_size(const _Alloc& __a) { return __a.max_size(); } static const _Alloc& _S_select_on_copy(const _Alloc& __a) { return __a; } static void _S_on_swap(_Alloc& __a, _Alloc& __b) { // _GLIBCXX_RESOLVE_LIB_DEFECTS // 431. Swapping containers with unequal allocators. std::__alloc_swap<_Alloc>::_S_do_it(__a, __b); } template struct rebind { typedef typename _Alloc::template rebind<_Tp>::other other; }; #endif # 210 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/alloc_traits.h" 3 }; _GLIBCXX_END_NAMESPACE_VERSION } // namespace __gnu_cxx #endif # 216 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/alloc_traits.h" 3 # 62 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_construct.h" 2 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION /** * Constructs an object in existing memory by invoking an allocated * object's constructor with an initializer. */ #if __cplusplus >= 201103L template inline void _Construct(_T1* __p, _Args&&... __args) { ::new(static_cast(__p)) _T1(std::forward<_Args>(__args)...); } #else # 77 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_construct.h" 3 template inline void _Construct(_T1* __p, const _T2& __value) { // _GLIBCXX_RESOLVE_LIB_DEFECTS // 402. wrong new expression in [some_]allocator::construct ::new(static_cast(__p)) _T1(__value); } #endif # 86 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_construct.h" 3 /** * Destroy the object pointed to by a pointer type. */ template inline void _Destroy(_Tp* __pointer) { __pointer->~_Tp(); } template struct _Destroy_aux { template static void __destroy(_ForwardIterator __first, _ForwardIterator __last) { for (; __first != __last; ++__first) std::_Destroy(std::__addressof(*__first)); } }; template<> struct _Destroy_aux { template static void __destroy(_ForwardIterator, _ForwardIterator) { } }; /** * Destroy a range of objects. If the value_type of the object has * a trivial destructor, the compiler should optimize all of this * away, otherwise the objects' destructors must be invoked. */ template inline void _Destroy(_ForwardIterator __first, _ForwardIterator __last) { typedef typename iterator_traits<_ForwardIterator>::value_type _Value_type; std::_Destroy_aux<__has_trivial_destructor(_Value_type)>:: __destroy(__first, __last); } /** * Destroy a range of objects using the supplied allocator. For * nondefault allocators we do not optimize away invocation of * destroy() even if _Tp has a trivial destructor. */ template void _Destroy(_ForwardIterator __first, _ForwardIterator __last, _Allocator& __alloc) { typedef __gnu_cxx::__alloc_traits<_Allocator> __traits; for (; __first != __last; ++__first) __traits::destroy(__alloc, std::__addressof(*__first)); } template inline void _Destroy(_ForwardIterator __first, _ForwardIterator __last, allocator<_Tp>&) { _Destroy(__first, __last); } _GLIBCXX_END_NAMESPACE_VERSION } // namespace std #endif /* _STL_CONSTRUCT_H */ # 158 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_construct.h" 3 # 63 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/vector" 2 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 63 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/vector" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_uninitialized.h" 1 3 // Raw memory manipulators -*- C++ -*- // Copyright (C) 2001-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /* * * Copyright (c) 1994 * Hewlett-Packard Company * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Hewlett-Packard Company makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. * * * Copyright (c) 1996,1997 * Silicon Graphics Computer Systems, Inc. * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Silicon Graphics makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. */ /** @file bits/stl_uninitialized.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{memory} */ #ifndef _STL_UNINITIALIZED_H #define _STL_UNINITIALIZED_H 1 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION template struct __uninitialized_copy { template static _ForwardIterator __uninit_copy(_InputIterator __first, _InputIterator __last, _ForwardIterator __result) { _ForwardIterator __cur = __result; __try { for (; __first != __last; ++__first, ++__cur) std::_Construct(std::__addressof(*__cur), *__first); return __cur; } __catch(...) { std::_Destroy(__result, __cur); __throw_exception_again; } } }; template<> struct __uninitialized_copy { template static _ForwardIterator __uninit_copy(_InputIterator __first, _InputIterator __last, _ForwardIterator __result) { return std::copy(__first, __last, __result); } }; /** * @brief Copies the range [first,last) into result. * @param __first An input iterator. * @param __last An input iterator. * @param __result An output iterator. * @return __result + (__first - __last) * * Like copy(), but does not require an initialized output range. */ template inline _ForwardIterator uninitialized_copy(_InputIterator __first, _InputIterator __last, _ForwardIterator __result) { typedef typename iterator_traits<_InputIterator>::value_type _ValueType1; typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType2; #if __cplusplus < 201103L const bool __assignable = true; #else # 117 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_uninitialized.h" 3 // trivial types can have deleted assignment typedef typename iterator_traits<_InputIterator>::reference _RefType1; typedef typename iterator_traits<_ForwardIterator>::reference _RefType2; const bool __assignable = is_assignable<_RefType2, _RefType1>::value; #endif # 122 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_uninitialized.h" 3 return std::__uninitialized_copy<__is_trivial(_ValueType1) && __is_trivial(_ValueType2) && __assignable>:: __uninit_copy(__first, __last, __result); } template struct __uninitialized_fill { template static void __uninit_fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __x) { _ForwardIterator __cur = __first; __try { for (; __cur != __last; ++__cur) std::_Construct(std::__addressof(*__cur), __x); } __catch(...) { std::_Destroy(__first, __cur); __throw_exception_again; } } }; template<> struct __uninitialized_fill { template static void __uninit_fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __x) { std::fill(__first, __last, __x); } }; /** * @brief Copies the value x into the range [first,last). * @param __first An input iterator. * @param __last An input iterator. * @param __x The source value. * @return Nothing. * * Like fill(), but does not require an initialized output range. */ template inline void uninitialized_fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __x) { typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType; #if __cplusplus < 201103L const bool __assignable = true; #else # 181 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_uninitialized.h" 3 // trivial types can have deleted assignment const bool __assignable = is_copy_assignable<_ValueType>::value; #endif # 184 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_uninitialized.h" 3 std::__uninitialized_fill<__is_trivial(_ValueType) && __assignable>:: __uninit_fill(__first, __last, __x); } template struct __uninitialized_fill_n { template static _ForwardIterator __uninit_fill_n(_ForwardIterator __first, _Size __n, const _Tp& __x) { _ForwardIterator __cur = __first; __try { for (; __n > 0; --__n, ++__cur) std::_Construct(std::__addressof(*__cur), __x); return __cur; } __catch(...) { std::_Destroy(__first, __cur); __throw_exception_again; } } }; template<> struct __uninitialized_fill_n { template static _ForwardIterator __uninit_fill_n(_ForwardIterator __first, _Size __n, const _Tp& __x) { return std::fill_n(__first, __n, __x); } }; // _GLIBCXX_RESOLVE_LIB_DEFECTS // DR 1339. uninitialized_fill_n should return the end of its range /** * @brief Copies the value x into the range [first,first+n). * @param __first An input iterator. * @param __n The number of copies to make. * @param __x The source value. * @return Nothing. * * Like fill_n(), but does not require an initialized output range. */ template inline _ForwardIterator uninitialized_fill_n(_ForwardIterator __first, _Size __n, const _Tp& __x) { typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType; #if __cplusplus < 201103L const bool __assignable = true; #else # 243 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_uninitialized.h" 3 // trivial types can have deleted assignment const bool __assignable = is_copy_assignable<_ValueType>::value; #endif # 246 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_uninitialized.h" 3 return __uninitialized_fill_n<__is_trivial(_ValueType) && __assignable>:: __uninit_fill_n(__first, __n, __x); } // Extensions: versions of uninitialized_copy, uninitialized_fill, // and uninitialized_fill_n that take an allocator parameter. // We dispatch back to the standard versions when we're given the // default allocator. For nondefault allocators we do not use // any of the POD optimizations. template _ForwardIterator __uninitialized_copy_a(_InputIterator __first, _InputIterator __last, _ForwardIterator __result, _Allocator& __alloc) { _ForwardIterator __cur = __result; __try { typedef __gnu_cxx::__alloc_traits<_Allocator> __traits; for (; __first != __last; ++__first, ++__cur) __traits::construct(__alloc, std::__addressof(*__cur), *__first); return __cur; } __catch(...) { std::_Destroy(__result, __cur, __alloc); __throw_exception_again; } } template inline _ForwardIterator __uninitialized_copy_a(_InputIterator __first, _InputIterator __last, _ForwardIterator __result, allocator<_Tp>&) { return std::uninitialized_copy(__first, __last, __result); } template inline _ForwardIterator __uninitialized_move_a(_InputIterator __first, _InputIterator __last, _ForwardIterator __result, _Allocator& __alloc) { return std::__uninitialized_copy_a(_GLIBCXX_MAKE_MOVE_ITERATOR(__first), _GLIBCXX_MAKE_MOVE_ITERATOR(__last), __result, __alloc); } template inline _ForwardIterator __uninitialized_move_if_noexcept_a(_InputIterator __first, _InputIterator __last, _ForwardIterator __result, _Allocator& __alloc) { return std::__uninitialized_copy_a (_GLIBCXX_MAKE_MOVE_IF_NOEXCEPT_ITERATOR(__first), _GLIBCXX_MAKE_MOVE_IF_NOEXCEPT_ITERATOR(__last), __result, __alloc); } template void __uninitialized_fill_a(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __x, _Allocator& __alloc) { _ForwardIterator __cur = __first; __try { typedef __gnu_cxx::__alloc_traits<_Allocator> __traits; for (; __cur != __last; ++__cur) __traits::construct(__alloc, std::__addressof(*__cur), __x); } __catch(...) { std::_Destroy(__first, __cur, __alloc); __throw_exception_again; } } template inline void __uninitialized_fill_a(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __x, allocator<_Tp2>&) { std::uninitialized_fill(__first, __last, __x); } template _ForwardIterator __uninitialized_fill_n_a(_ForwardIterator __first, _Size __n, const _Tp& __x, _Allocator& __alloc) { _ForwardIterator __cur = __first; __try { typedef __gnu_cxx::__alloc_traits<_Allocator> __traits; for (; __n > 0; --__n, ++__cur) __traits::construct(__alloc, std::__addressof(*__cur), __x); return __cur; } __catch(...) { std::_Destroy(__first, __cur, __alloc); __throw_exception_again; } } template inline _ForwardIterator __uninitialized_fill_n_a(_ForwardIterator __first, _Size __n, const _Tp& __x, allocator<_Tp2>&) { return std::uninitialized_fill_n(__first, __n, __x); } // Extensions: __uninitialized_copy_move, __uninitialized_move_copy, // __uninitialized_fill_move, __uninitialized_move_fill. // All of these algorithms take a user-supplied allocator, which is used // for construction and destruction. // __uninitialized_copy_move // Copies [first1, last1) into [result, result + (last1 - first1)), and // move [first2, last2) into // [result, result + (last1 - first1) + (last2 - first2)). template inline _ForwardIterator __uninitialized_copy_move(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _ForwardIterator __result, _Allocator& __alloc) { _ForwardIterator __mid = std::__uninitialized_copy_a(__first1, __last1, __result, __alloc); __try { return std::__uninitialized_move_a(__first2, __last2, __mid, __alloc); } __catch(...) { std::_Destroy(__result, __mid, __alloc); __throw_exception_again; } } // __uninitialized_move_copy // Moves [first1, last1) into [result, result + (last1 - first1)), and // copies [first2, last2) into // [result, result + (last1 - first1) + (last2 - first2)). template inline _ForwardIterator __uninitialized_move_copy(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _ForwardIterator __result, _Allocator& __alloc) { _ForwardIterator __mid = std::__uninitialized_move_a(__first1, __last1, __result, __alloc); __try { return std::__uninitialized_copy_a(__first2, __last2, __mid, __alloc); } __catch(...) { std::_Destroy(__result, __mid, __alloc); __throw_exception_again; } } // __uninitialized_fill_move // Fills [result, mid) with x, and moves [first, last) into // [mid, mid + (last - first)). template inline _ForwardIterator __uninitialized_fill_move(_ForwardIterator __result, _ForwardIterator __mid, const _Tp& __x, _InputIterator __first, _InputIterator __last, _Allocator& __alloc) { std::__uninitialized_fill_a(__result, __mid, __x, __alloc); __try { return std::__uninitialized_move_a(__first, __last, __mid, __alloc); } __catch(...) { std::_Destroy(__result, __mid, __alloc); __throw_exception_again; } } // __uninitialized_move_fill // Moves [first1, last1) into [first2, first2 + (last1 - first1)), and // fills [first2 + (last1 - first1), last2) with x. template inline void __uninitialized_move_fill(_InputIterator __first1, _InputIterator __last1, _ForwardIterator __first2, _ForwardIterator __last2, const _Tp& __x, _Allocator& __alloc) { _ForwardIterator __mid2 = std::__uninitialized_move_a(__first1, __last1, __first2, __alloc); __try { std::__uninitialized_fill_a(__mid2, __last2, __x, __alloc); } __catch(...) { std::_Destroy(__first2, __mid2, __alloc); __throw_exception_again; } } #if __cplusplus >= 201103L // Extensions: __uninitialized_default, __uninitialized_default_n, // __uninitialized_default_a, __uninitialized_default_n_a. template struct __uninitialized_default_1 { template static void __uninit_default(_ForwardIterator __first, _ForwardIterator __last) { _ForwardIterator __cur = __first; __try { for (; __cur != __last; ++__cur) std::_Construct(std::__addressof(*__cur)); } __catch(...) { std::_Destroy(__first, __cur); __throw_exception_again; } } }; template<> struct __uninitialized_default_1 { template static void __uninit_default(_ForwardIterator __first, _ForwardIterator __last) { typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType; std::fill(__first, __last, _ValueType()); } }; template struct __uninitialized_default_n_1 { template static _ForwardIterator __uninit_default_n(_ForwardIterator __first, _Size __n) { _ForwardIterator __cur = __first; __try { for (; __n > 0; --__n, ++__cur) std::_Construct(std::__addressof(*__cur)); return __cur; } __catch(...) { std::_Destroy(__first, __cur); __throw_exception_again; } } }; template<> struct __uninitialized_default_n_1 { template static _ForwardIterator __uninit_default_n(_ForwardIterator __first, _Size __n) { typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType; return std::fill_n(__first, __n, _ValueType()); } }; // __uninitialized_default // Fills [first, last) with std::distance(first, last) default // constructed value_types(s). template inline void __uninitialized_default(_ForwardIterator __first, _ForwardIterator __last) { typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType; // trivial types can have deleted assignment const bool __assignable = is_copy_assignable<_ValueType>::value; std::__uninitialized_default_1<__is_trivial(_ValueType) && __assignable>:: __uninit_default(__first, __last); } // __uninitialized_default_n // Fills [first, first + n) with n default constructed value_type(s). template inline _ForwardIterator __uninitialized_default_n(_ForwardIterator __first, _Size __n) { typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType; // trivial types can have deleted assignment const bool __assignable = is_copy_assignable<_ValueType>::value; return __uninitialized_default_n_1<__is_trivial(_ValueType) && __assignable>:: __uninit_default_n(__first, __n); } // __uninitialized_default_a // Fills [first, last) with std::distance(first, last) default // constructed value_types(s), constructed with the allocator alloc. template void __uninitialized_default_a(_ForwardIterator __first, _ForwardIterator __last, _Allocator& __alloc) { _ForwardIterator __cur = __first; __try { typedef __gnu_cxx::__alloc_traits<_Allocator> __traits; for (; __cur != __last; ++__cur) __traits::construct(__alloc, std::__addressof(*__cur)); } __catch(...) { std::_Destroy(__first, __cur, __alloc); __throw_exception_again; } } template inline void __uninitialized_default_a(_ForwardIterator __first, _ForwardIterator __last, allocator<_Tp>&) { std::__uninitialized_default(__first, __last); } // __uninitialized_default_n_a // Fills [first, first + n) with n default constructed value_types(s), // constructed with the allocator alloc. template _ForwardIterator __uninitialized_default_n_a(_ForwardIterator __first, _Size __n, _Allocator& __alloc) { _ForwardIterator __cur = __first; __try { typedef __gnu_cxx::__alloc_traits<_Allocator> __traits; for (; __n > 0; --__n, ++__cur) __traits::construct(__alloc, std::__addressof(*__cur)); return __cur; } __catch(...) { std::_Destroy(__first, __cur, __alloc); __throw_exception_again; } } template inline _ForwardIterator __uninitialized_default_n_a(_ForwardIterator __first, _Size __n, allocator<_Tp>&) { return std::__uninitialized_default_n(__first, __n); } template _ForwardIterator __uninitialized_copy_n(_InputIterator __first, _Size __n, _ForwardIterator __result, input_iterator_tag) { _ForwardIterator __cur = __result; __try { for (; __n > 0; --__n, ++__first, ++__cur) std::_Construct(std::__addressof(*__cur), *__first); return __cur; } __catch(...) { std::_Destroy(__result, __cur); __throw_exception_again; } } template inline _ForwardIterator __uninitialized_copy_n(_RandomAccessIterator __first, _Size __n, _ForwardIterator __result, random_access_iterator_tag) { return std::uninitialized_copy(__first, __first + __n, __result); } /** * @brief Copies the range [first,first+n) into result. * @param __first An input iterator. * @param __n The number of elements to copy. * @param __result An output iterator. * @return __result + __n * * Like copy_n(), but does not require an initialized output range. */ template inline _ForwardIterator uninitialized_copy_n(_InputIterator __first, _Size __n, _ForwardIterator __result) { return std::__uninitialized_copy_n(__first, __n, __result, std::__iterator_category(__first)); } #endif # 684 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_uninitialized.h" 3 _GLIBCXX_END_NAMESPACE_VERSION } // namespace #endif /* _STL_UNINITIALIZED_H */ # 689 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_uninitialized.h" 3 # 64 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/vector" 2 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 64 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/vector" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_vector.h" 1 3 // Vector implementation -*- C++ -*- // Copyright (C) 2001-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /* * * Copyright (c) 1994 * Hewlett-Packard Company * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Hewlett-Packard Company makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. * * * Copyright (c) 1996 * Silicon Graphics Computer Systems, Inc. * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Silicon Graphics makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. */ /** @file bits/stl_vector.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{vector} */ #ifndef _STL_VECTOR_H #define _STL_VECTOR_H 1 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 59 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_vector.h" 3 # 60 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_vector.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 60 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_vector.h" 3 # 61 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_vector.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 61 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_vector.h" 3 # 62 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_vector.h" 3 #if __cplusplus >= 201103L #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 63 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_vector.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/initializer_list" 1 3 // std::initializer_list support -*- C++ -*- // Copyright (C) 2008-2015 Free Software Foundation, Inc. // // This file is part of GCC. // // GCC is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 3, or (at your option) // any later version. // // GCC is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file initializer_list * This is a Standard C++ Library header. */ #ifndef _INITIALIZER_LIST #define _INITIALIZER_LIST #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 34 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/initializer_list" 3 #if __cplusplus < 201103L #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 36 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/initializer_list" 3 # 37 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/initializer_list" 3 #else // C++0x # 38 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/initializer_list" 3 #pragma GCC visibility push(default) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/initializer_list" 3 # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/initializer_list" 3 namespace std { /// initializer_list template class initializer_list { public: typedef _E value_type; typedef const _E& reference; typedef const _E& const_reference; typedef size_t size_type; typedef const _E* iterator; typedef const _E* const_iterator; private: iterator _M_array; size_type _M_len; // The compiler can call a private constructor. constexpr initializer_list(const_iterator __a, size_type __l) : _M_array(__a), _M_len(__l) { } public: constexpr initializer_list() noexcept : _M_array(0), _M_len(0) { } // Number of elements. constexpr size_type size() const noexcept { return _M_len; } // First element. constexpr const_iterator begin() const noexcept { return _M_array; } // One past the last element. constexpr const_iterator end() const noexcept { return begin() + size(); } }; /** * @brief Return an iterator pointing to the first element of * the initializer_list. * @param __ils Initializer list. */ template constexpr const _Tp* begin(initializer_list<_Tp> __ils) noexcept { return __ils.begin(); } /** * @brief Return an iterator pointing to one past the last element * of the initializer_list. * @param __ils Initializer list. */ template constexpr const _Tp* end(initializer_list<_Tp> __ils) noexcept { return __ils.end(); } } #pragma GCC visibility pop #endif // C++11 # 106 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/initializer_list" 3 #endif // _INITIALIZER_LIST # 108 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/initializer_list" 3 # 64 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_vector.h" 2 3 #endif # 65 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_vector.h" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_CONTAINER /// See bits/stl_deque.h's _Deque_base for an explanation. template struct _Vector_base { typedef typename __gnu_cxx::__alloc_traits<_Alloc>::template rebind<_Tp>::other _Tp_alloc_type; typedef typename __gnu_cxx::__alloc_traits<_Tp_alloc_type>::pointer pointer; struct _Vector_impl : public _Tp_alloc_type { pointer _M_start; pointer _M_finish; pointer _M_end_of_storage; _Vector_impl() : _Tp_alloc_type(), _M_start(), _M_finish(), _M_end_of_storage() { } _Vector_impl(_Tp_alloc_type const& __a) _GLIBCXX_NOEXCEPT : _Tp_alloc_type(__a), _M_start(), _M_finish(), _M_end_of_storage() { } #if __cplusplus >= 201103L _Vector_impl(_Tp_alloc_type&& __a) noexcept : _Tp_alloc_type(std::move(__a)), _M_start(), _M_finish(), _M_end_of_storage() { } #endif # 100 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_vector.h" 3 void _M_swap_data(_Vector_impl& __x) _GLIBCXX_NOEXCEPT { std::swap(_M_start, __x._M_start); std::swap(_M_finish, __x._M_finish); std::swap(_M_end_of_storage, __x._M_end_of_storage); } }; public: typedef _Alloc allocator_type; _Tp_alloc_type& _M_get_Tp_allocator() _GLIBCXX_NOEXCEPT { return *static_cast<_Tp_alloc_type*>(&this->_M_impl); } const _Tp_alloc_type& _M_get_Tp_allocator() const _GLIBCXX_NOEXCEPT { return *static_cast(&this->_M_impl); } allocator_type get_allocator() const _GLIBCXX_NOEXCEPT { return allocator_type(_M_get_Tp_allocator()); } _Vector_base() : _M_impl() { } _Vector_base(const allocator_type& __a) _GLIBCXX_NOEXCEPT : _M_impl(__a) { } _Vector_base(size_t __n) : _M_impl() { _M_create_storage(__n); } _Vector_base(size_t __n, const allocator_type& __a) : _M_impl(__a) { _M_create_storage(__n); } #if __cplusplus >= 201103L _Vector_base(_Tp_alloc_type&& __a) noexcept : _M_impl(std::move(__a)) { } _Vector_base(_Vector_base&& __x) noexcept : _M_impl(std::move(__x._M_get_Tp_allocator())) { this->_M_impl._M_swap_data(__x._M_impl); } _Vector_base(_Vector_base&& __x, const allocator_type& __a) : _M_impl(__a) { if (__x.get_allocator() == __a) this->_M_impl._M_swap_data(__x._M_impl); else { size_t __n = __x._M_impl._M_finish - __x._M_impl._M_start; _M_create_storage(__n); } } #endif # 158 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_vector.h" 3 ~_Vector_base() _GLIBCXX_NOEXCEPT { _M_deallocate(this->_M_impl._M_start, this->_M_impl._M_end_of_storage - this->_M_impl._M_start); } public: _Vector_impl _M_impl; pointer _M_allocate(size_t __n) { typedef __gnu_cxx::__alloc_traits<_Tp_alloc_type> _Tr; return __n != 0 ? _Tr::allocate(_M_impl, __n) : pointer(); } void _M_deallocate(pointer __p, size_t __n) { typedef __gnu_cxx::__alloc_traits<_Tp_alloc_type> _Tr; if (__p) _Tr::deallocate(_M_impl, __p, __n); } private: void _M_create_storage(size_t __n) { this->_M_impl._M_start = this->_M_allocate(__n); this->_M_impl._M_finish = this->_M_impl._M_start; this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n; } }; /** * @brief A standard container which offers fixed time access to * individual elements in any order. * * @ingroup sequences * * @tparam _Tp Type of element. * @tparam _Alloc Allocator type, defaults to allocator<_Tp>. * * Meets the requirements of a container, a * reversible container, and a * sequence, including the * optional sequence requirements with the * %exception of @c push_front and @c pop_front. * * In some terminology a %vector can be described as a dynamic * C-style array, it offers fast and efficient access to individual * elements in any order and saves the user from worrying about * memory and size allocation. Subscripting ( @c [] ) access is * also provided as with C-style arrays. */ template > class vector : protected _Vector_base<_Tp, _Alloc> { // Concept requirements. typedef typename _Alloc::value_type _Alloc_value_type; __glibcxx_class_requires(_Tp, _SGIAssignableConcept) __glibcxx_class_requires2(_Tp, _Alloc_value_type, _SameTypeConcept) typedef _Vector_base<_Tp, _Alloc> _Base; typedef typename _Base::_Tp_alloc_type _Tp_alloc_type; typedef __gnu_cxx::__alloc_traits<_Tp_alloc_type> _Alloc_traits; public: typedef _Tp value_type; typedef typename _Base::pointer pointer; typedef typename _Alloc_traits::const_pointer const_pointer; typedef typename _Alloc_traits::reference reference; typedef typename _Alloc_traits::const_reference const_reference; typedef __gnu_cxx::__normal_iterator iterator; typedef __gnu_cxx::__normal_iterator const_iterator; typedef std::reverse_iterator const_reverse_iterator; typedef std::reverse_iterator reverse_iterator; typedef size_t size_type; typedef ptrdiff_t difference_type; typedef _Alloc allocator_type; protected: using _Base::_M_allocate; using _Base::_M_deallocate; using _Base::_M_impl; using _Base::_M_get_Tp_allocator; public: // [23.2.4.1] construct/copy/destroy // (assign() and get_allocator() are also listed in this section) /** * @brief Creates a %vector with no elements. */ vector() #if __cplusplus >= 201103L noexcept(is_nothrow_default_constructible<_Alloc>::value) #endif # 257 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_vector.h" 3 : _Base() { } /** * @brief Creates a %vector with no elements. * @param __a An allocator object. */ explicit vector(const allocator_type& __a) _GLIBCXX_NOEXCEPT : _Base(__a) { } #if __cplusplus >= 201103L /** * @brief Creates a %vector with default constructed elements. * @param __n The number of elements to initially create. * @param __a An allocator. * * This constructor fills the %vector with @a __n default * constructed elements. */ explicit vector(size_type __n, const allocator_type& __a = allocator_type()) : _Base(__n, __a) { _M_default_initialize(__n); } /** * @brief Creates a %vector with copies of an exemplar element. * @param __n The number of elements to initially create. * @param __value An element to copy. * @param __a An allocator. * * This constructor fills the %vector with @a __n copies of @a __value. */ vector(size_type __n, const value_type& __value, const allocator_type& __a = allocator_type()) : _Base(__n, __a) { _M_fill_initialize(__n, __value); } #else # 294 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_vector.h" 3 /** * @brief Creates a %vector with copies of an exemplar element. * @param __n The number of elements to initially create. * @param __value An element to copy. * @param __a An allocator. * * This constructor fills the %vector with @a __n copies of @a __value. */ explicit vector(size_type __n, const value_type& __value = value_type(), const allocator_type& __a = allocator_type()) : _Base(__n, __a) { _M_fill_initialize(__n, __value); } #endif # 308 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_vector.h" 3 /** * @brief %Vector copy constructor. * @param __x A %vector of identical element and allocator types. * * The newly-created %vector uses a copy of the allocation * object used by @a __x. All the elements of @a __x are copied, * but any extra memory in * @a __x (for fast expansion) will not be copied. */ vector(const vector& __x) : _Base(__x.size(), _Alloc_traits::_S_select_on_copy(__x._M_get_Tp_allocator())) { this->_M_impl._M_finish = std::__uninitialized_copy_a(__x.begin(), __x.end(), this->_M_impl._M_start, _M_get_Tp_allocator()); } #if __cplusplus >= 201103L /** * @brief %Vector move constructor. * @param __x A %vector of identical element and allocator types. * * The newly-created %vector contains the exact contents of @a __x. * The contents of @a __x are a valid, but unspecified %vector. */ vector(vector&& __x) noexcept : _Base(std::move(__x)) { } /// Copy constructor with alternative allocator vector(const vector& __x, const allocator_type& __a) : _Base(__x.size(), __a) { this->_M_impl._M_finish = std::__uninitialized_copy_a(__x.begin(), __x.end(), this->_M_impl._M_start, _M_get_Tp_allocator()); } /// Move constructor with alternative allocator vector(vector&& __rv, const allocator_type& __m) noexcept(_Alloc_traits::_S_always_equal()) : _Base(std::move(__rv), __m) { if (__rv.get_allocator() != __m) { this->_M_impl._M_finish = std::__uninitialized_move_a(__rv.begin(), __rv.end(), this->_M_impl._M_start, _M_get_Tp_allocator()); __rv.clear(); } } /** * @brief Builds a %vector from an initializer list. * @param __l An initializer_list. * @param __a An allocator. * * Create a %vector consisting of copies of the elements in the * initializer_list @a __l. * * This will call the element type's copy constructor N times * (where N is @a __l.size()) and do no memory reallocation. */ vector(initializer_list __l, const allocator_type& __a = allocator_type()) : _Base(__a) { _M_range_initialize(__l.begin(), __l.end(), random_access_iterator_tag()); } #endif # 381 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_vector.h" 3 /** * @brief Builds a %vector from a range. * @param __first An input iterator. * @param __last An input iterator. * @param __a An allocator. * * Create a %vector consisting of copies of the elements from * [first,last). * * If the iterators are forward, bidirectional, or * random-access, then this will call the elements' copy * constructor N times (where N is distance(first,last)) and do * no memory reallocation. But if only input iterators are * used, then this will do at most 2N calls to the copy * constructor, and logN memory reallocations. */ #if __cplusplus >= 201103L template> vector(_InputIterator __first, _InputIterator __last, const allocator_type& __a = allocator_type()) : _Base(__a) { _M_initialize_dispatch(__first, __last, __false_type()); } #else # 406 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_vector.h" 3 template vector(_InputIterator __first, _InputIterator __last, const allocator_type& __a = allocator_type()) : _Base(__a) { // Check whether it's an integral type. If so, it's not an iterator. typedef typename std::__is_integer<_InputIterator>::__type _Integral; _M_initialize_dispatch(__first, __last, _Integral()); } #endif # 416 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_vector.h" 3 /** * The dtor only erases the elements, and note that if the * elements themselves are pointers, the pointed-to memory is * not touched in any way. Managing the pointer is the user's * responsibility. */ ~vector() _GLIBCXX_NOEXCEPT { std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish, _M_get_Tp_allocator()); } /** * @brief %Vector assignment operator. * @param __x A %vector of identical element and allocator types. * * All the elements of @a __x are copied, but any extra memory in * @a __x (for fast expansion) will not be copied. Unlike the * copy constructor, the allocator object is not copied. */ vector& operator=(const vector& __x); #if __cplusplus >= 201103L /** * @brief %Vector move assignment operator. * @param __x A %vector of identical element and allocator types. * * The contents of @a __x are moved into this %vector (without copying, * if the allocators permit it). * @a __x is a valid, but unspecified %vector. */ vector& operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move()) { constexpr bool __move_storage = _Alloc_traits::_S_propagate_on_move_assign() || _Alloc_traits::_S_always_equal(); _M_move_assign(std::move(__x), integral_constant()); return *this; } /** * @brief %Vector list assignment operator. * @param __l An initializer_list. * * This function fills a %vector with copies of the elements in the * initializer list @a __l. * * Note that the assignment completely changes the %vector and * that the resulting %vector's size is the same as the number * of elements assigned. Old data may be lost. */ vector& operator=(initializer_list __l) { this->assign(__l.begin(), __l.end()); return *this; } #endif # 476 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_vector.h" 3 /** * @brief Assigns a given value to a %vector. * @param __n Number of elements to be assigned. * @param __val Value to be assigned. * * This function fills a %vector with @a __n copies of the given * value. Note that the assignment completely changes the * %vector and that the resulting %vector's size is the same as * the number of elements assigned. Old data may be lost. */ void assign(size_type __n, const value_type& __val) { _M_fill_assign(__n, __val); } /** * @brief Assigns a range to a %vector. * @param __first An input iterator. * @param __last An input iterator. * * This function fills a %vector with copies of the elements in the * range [__first,__last). * * Note that the assignment completely changes the %vector and * that the resulting %vector's size is the same as the number * of elements assigned. Old data may be lost. */ #if __cplusplus >= 201103L template> void assign(_InputIterator __first, _InputIterator __last) { _M_assign_dispatch(__first, __last, __false_type()); } #else # 510 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_vector.h" 3 template void assign(_InputIterator __first, _InputIterator __last) { // Check whether it's an integral type. If so, it's not an iterator. typedef typename std::__is_integer<_InputIterator>::__type _Integral; _M_assign_dispatch(__first, __last, _Integral()); } #endif # 519 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_vector.h" 3 #if __cplusplus >= 201103L /** * @brief Assigns an initializer list to a %vector. * @param __l An initializer_list. * * This function fills a %vector with copies of the elements in the * initializer list @a __l. * * Note that the assignment completely changes the %vector and * that the resulting %vector's size is the same as the number * of elements assigned. Old data may be lost. */ void assign(initializer_list __l) { this->assign(__l.begin(), __l.end()); } #endif # 536 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_vector.h" 3 /// Get a copy of the memory allocation object. using _Base::get_allocator; // iterators /** * Returns a read/write iterator that points to the first * element in the %vector. Iteration is done in ordinary * element order. */ iterator begin() _GLIBCXX_NOEXCEPT { return iterator(this->_M_impl._M_start); } /** * Returns a read-only (constant) iterator that points to the * first element in the %vector. Iteration is done in ordinary * element order. */ const_iterator begin() const _GLIBCXX_NOEXCEPT { return const_iterator(this->_M_impl._M_start); } /** * Returns a read/write iterator that points one past the last * element in the %vector. Iteration is done in ordinary * element order. */ iterator end() _GLIBCXX_NOEXCEPT { return iterator(this->_M_impl._M_finish); } /** * Returns a read-only (constant) iterator that points one past * the last element in the %vector. Iteration is done in * ordinary element order. */ const_iterator end() const _GLIBCXX_NOEXCEPT { return const_iterator(this->_M_impl._M_finish); } /** * Returns a read/write reverse iterator that points to the * last element in the %vector. Iteration is done in reverse * element order. */ reverse_iterator rbegin() _GLIBCXX_NOEXCEPT { return reverse_iterator(end()); } /** * Returns a read-only (constant) reverse iterator that points * to the last element in the %vector. Iteration is done in * reverse element order. */ const_reverse_iterator rbegin() const _GLIBCXX_NOEXCEPT { return const_reverse_iterator(end()); } /** * Returns a read/write reverse iterator that points to one * before the first element in the %vector. Iteration is done * in reverse element order. */ reverse_iterator rend() _GLIBCXX_NOEXCEPT { return reverse_iterator(begin()); } /** * Returns a read-only (constant) reverse iterator that points * to one before the first element in the %vector. Iteration * is done in reverse element order. */ const_reverse_iterator rend() const _GLIBCXX_NOEXCEPT { return const_reverse_iterator(begin()); } #if __cplusplus >= 201103L /** * Returns a read-only (constant) iterator that points to the * first element in the %vector. Iteration is done in ordinary * element order. */ const_iterator cbegin() const noexcept { return const_iterator(this->_M_impl._M_start); } /** * Returns a read-only (constant) iterator that points one past * the last element in the %vector. Iteration is done in * ordinary element order. */ const_iterator cend() const noexcept { return const_iterator(this->_M_impl._M_finish); } /** * Returns a read-only (constant) reverse iterator that points * to the last element in the %vector. Iteration is done in * reverse element order. */ const_reverse_iterator crbegin() const noexcept { return const_reverse_iterator(end()); } /** * Returns a read-only (constant) reverse iterator that points * to one before the first element in the %vector. Iteration * is done in reverse element order. */ const_reverse_iterator crend() const noexcept { return const_reverse_iterator(begin()); } #endif # 650 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_vector.h" 3 // [23.2.4.2] capacity /** Returns the number of elements in the %vector. */ size_type size() const _GLIBCXX_NOEXCEPT { return size_type(this->_M_impl._M_finish - this->_M_impl._M_start); } /** Returns the size() of the largest possible %vector. */ size_type max_size() const _GLIBCXX_NOEXCEPT { return _Alloc_traits::max_size(_M_get_Tp_allocator()); } #if __cplusplus >= 201103L /** * @brief Resizes the %vector to the specified number of elements. * @param __new_size Number of elements the %vector should contain. * * This function will %resize the %vector to the specified * number of elements. If the number is smaller than the * %vector's current size the %vector is truncated, otherwise * default constructed elements are appended. */ void resize(size_type __new_size) { if (__new_size > size()) _M_default_append(__new_size - size()); else if (__new_size < size()) _M_erase_at_end(this->_M_impl._M_start + __new_size); } /** * @brief Resizes the %vector to the specified number of elements. * @param __new_size Number of elements the %vector should contain. * @param __x Data with which new elements should be populated. * * This function will %resize the %vector to the specified * number of elements. If the number is smaller than the * %vector's current size the %vector is truncated, otherwise * the %vector is extended and new elements are populated with * given data. */ void resize(size_type __new_size, const value_type& __x) { if (__new_size > size()) insert(end(), __new_size - size(), __x); else if (__new_size < size()) _M_erase_at_end(this->_M_impl._M_start + __new_size); } #else # 701 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_vector.h" 3 /** * @brief Resizes the %vector to the specified number of elements. * @param __new_size Number of elements the %vector should contain. * @param __x Data with which new elements should be populated. * * This function will %resize the %vector to the specified * number of elements. If the number is smaller than the * %vector's current size the %vector is truncated, otherwise * the %vector is extended and new elements are populated with * given data. */ void resize(size_type __new_size, value_type __x = value_type()) { if (__new_size > size()) insert(end(), __new_size - size(), __x); else if (__new_size < size()) _M_erase_at_end(this->_M_impl._M_start + __new_size); } #endif # 721 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_vector.h" 3 #if __cplusplus >= 201103L /** A non-binding request to reduce capacity() to size(). */ void shrink_to_fit() { _M_shrink_to_fit(); } #endif # 728 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_vector.h" 3 /** * Returns the total number of elements that the %vector can * hold before needing to allocate more memory. */ size_type capacity() const _GLIBCXX_NOEXCEPT { return size_type(this->_M_impl._M_end_of_storage - this->_M_impl._M_start); } /** * Returns true if the %vector is empty. (Thus begin() would * equal end().) */ bool empty() const _GLIBCXX_NOEXCEPT { return begin() == end(); } /** * @brief Attempt to preallocate enough memory for specified number of * elements. * @param __n Number of elements required. * @throw std::length_error If @a n exceeds @c max_size(). * * This function attempts to reserve enough memory for the * %vector to hold the specified number of elements. If the * number requested is more than max_size(), length_error is * thrown. * * The advantage of this function is that if optimal code is a * necessity and the user can determine the number of elements * that will be required, the user can reserve the memory in * %advance, and thus prevent a possible reallocation of memory * and copying of %vector data. */ void reserve(size_type __n); // element access /** * @brief Subscript access to the data contained in the %vector. * @param __n The index of the element for which data should be * accessed. * @return Read/write reference to data. * * This operator allows for easy, array-style, data access. * Note that data access with this operator is unchecked and * out_of_range lookups are not defined. (For checked lookups * see at().) */ reference operator[](size_type __n) _GLIBCXX_NOEXCEPT { return *(this->_M_impl._M_start + __n); } /** * @brief Subscript access to the data contained in the %vector. * @param __n The index of the element for which data should be * accessed. * @return Read-only (constant) reference to data. * * This operator allows for easy, array-style, data access. * Note that data access with this operator is unchecked and * out_of_range lookups are not defined. (For checked lookups * see at().) */ const_reference operator[](size_type __n) const _GLIBCXX_NOEXCEPT { return *(this->_M_impl._M_start + __n); } protected: /// Safety check used only from at(). void _M_range_check(size_type __n) const { if (__n >= this->size()) __throw_out_of_range_fmt(__N("vector::_M_range_check: __n " "(which is %zu) >= this->size() " "(which is %zu)"), __n, this->size()); } public: /** * @brief Provides access to the data contained in the %vector. * @param __n The index of the element for which data should be * accessed. * @return Read/write reference to data. * @throw std::out_of_range If @a __n is an invalid index. * * This function provides for safer data access. The parameter * is first checked that it is in the range of the vector. The * function throws out_of_range if the check fails. */ reference at(size_type __n) { _M_range_check(__n); return (*this)[__n]; } /** * @brief Provides access to the data contained in the %vector. * @param __n The index of the element for which data should be * accessed. * @return Read-only (constant) reference to data. * @throw std::out_of_range If @a __n is an invalid index. * * This function provides for safer data access. The parameter * is first checked that it is in the range of the vector. The * function throws out_of_range if the check fails. */ const_reference at(size_type __n) const { _M_range_check(__n); return (*this)[__n]; } /** * Returns a read/write reference to the data at the first * element of the %vector. */ reference front() _GLIBCXX_NOEXCEPT { return *begin(); } /** * Returns a read-only (constant) reference to the data at the first * element of the %vector. */ const_reference front() const _GLIBCXX_NOEXCEPT { return *begin(); } /** * Returns a read/write reference to the data at the last * element of the %vector. */ reference back() _GLIBCXX_NOEXCEPT { return *(end() - 1); } /** * Returns a read-only (constant) reference to the data at the * last element of the %vector. */ const_reference back() const _GLIBCXX_NOEXCEPT { return *(end() - 1); } // _GLIBCXX_RESOLVE_LIB_DEFECTS // DR 464. Suggestion for new member functions in standard containers. // data access /** * Returns a pointer such that [data(), data() + size()) is a valid * range. For a non-empty %vector, data() == &front(). */ #if __cplusplus >= 201103L _Tp* #else # 888 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_vector.h" 3 pointer #endif # 890 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_vector.h" 3 data() _GLIBCXX_NOEXCEPT { return _M_data_ptr(this->_M_impl._M_start); } #if __cplusplus >= 201103L const _Tp* #else # 896 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_vector.h" 3 const_pointer #endif # 898 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_vector.h" 3 data() const _GLIBCXX_NOEXCEPT { return _M_data_ptr(this->_M_impl._M_start); } // [23.2.4.3] modifiers /** * @brief Add data to the end of the %vector. * @param __x Data to be added. * * This is a typical stack operation. The function creates an * element at the end of the %vector and assigns the given data * to it. Due to the nature of a %vector this operation can be * done in constant time if the %vector has preallocated space * available. */ void push_back(const value_type& __x) { if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage) { _Alloc_traits::construct(this->_M_impl, this->_M_impl._M_finish, __x); ++this->_M_impl._M_finish; } else #if __cplusplus >= 201103L _M_emplace_back_aux(__x); #else # 925 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_vector.h" 3 _M_insert_aux(end(), __x); #endif # 927 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_vector.h" 3 } #if __cplusplus >= 201103L void push_back(value_type&& __x) { emplace_back(std::move(__x)); } template void emplace_back(_Args&&... __args); #endif # 938 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_vector.h" 3 /** * @brief Removes last element. * * This is a typical stack operation. It shrinks the %vector by one. * * Note that no data is returned, and if the last element's * data is needed, it should be retrieved before pop_back() is * called. */ void pop_back() _GLIBCXX_NOEXCEPT { --this->_M_impl._M_finish; _Alloc_traits::destroy(this->_M_impl, this->_M_impl._M_finish); } #if __cplusplus >= 201103L /** * @brief Inserts an object in %vector before specified iterator. * @param __position A const_iterator into the %vector. * @param __args Arguments. * @return An iterator that points to the inserted data. * * This function will insert an object of type T constructed * with T(std::forward(args)...) before the specified location. * Note that this kind of operation could be expensive for a %vector * and if it is frequently used the user should consider using * std::list. */ template iterator emplace(const_iterator __position, _Args&&... __args); /** * @brief Inserts given value into %vector before specified iterator. * @param __position A const_iterator into the %vector. * @param __x Data to be inserted. * @return An iterator that points to the inserted data. * * This function will insert a copy of the given value before * the specified location. Note that this kind of operation * could be expensive for a %vector and if it is frequently * used the user should consider using std::list. */ iterator insert(const_iterator __position, const value_type& __x); #else # 986 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_vector.h" 3 /** * @brief Inserts given value into %vector before specified iterator. * @param __position An iterator into the %vector. * @param __x Data to be inserted. * @return An iterator that points to the inserted data. * * This function will insert a copy of the given value before * the specified location. Note that this kind of operation * could be expensive for a %vector and if it is frequently * used the user should consider using std::list. */ iterator insert(iterator __position, const value_type& __x); #endif # 1000 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_vector.h" 3 #if __cplusplus >= 201103L /** * @brief Inserts given rvalue into %vector before specified iterator. * @param __position A const_iterator into the %vector. * @param __x Data to be inserted. * @return An iterator that points to the inserted data. * * This function will insert a copy of the given rvalue before * the specified location. Note that this kind of operation * could be expensive for a %vector and if it is frequently * used the user should consider using std::list. */ iterator insert(const_iterator __position, value_type&& __x) { return emplace(__position, std::move(__x)); } /** * @brief Inserts an initializer_list into the %vector. * @param __position An iterator into the %vector. * @param __l An initializer_list. * * This function will insert copies of the data in the * initializer_list @a l into the %vector before the location * specified by @a position. * * Note that this kind of operation could be expensive for a * %vector and if it is frequently used the user should * consider using std::list. */ iterator insert(const_iterator __position, initializer_list __l) { return this->insert(__position, __l.begin(), __l.end()); } #endif # 1034 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_vector.h" 3 #if __cplusplus >= 201103L /** * @brief Inserts a number of copies of given data into the %vector. * @param __position A const_iterator into the %vector. * @param __n Number of elements to be inserted. * @param __x Data to be inserted. * @return An iterator that points to the inserted data. * * This function will insert a specified number of copies of * the given data before the location specified by @a position. * * Note that this kind of operation could be expensive for a * %vector and if it is frequently used the user should * consider using std::list. */ iterator insert(const_iterator __position, size_type __n, const value_type& __x) { difference_type __offset = __position - cbegin(); _M_fill_insert(begin() + __offset, __n, __x); return begin() + __offset; } #else # 1058 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_vector.h" 3 /** * @brief Inserts a number of copies of given data into the %vector. * @param __position An iterator into the %vector. * @param __n Number of elements to be inserted. * @param __x Data to be inserted. * * This function will insert a specified number of copies of * the given data before the location specified by @a position. * * Note that this kind of operation could be expensive for a * %vector and if it is frequently used the user should * consider using std::list. */ void insert(iterator __position, size_type __n, const value_type& __x) { _M_fill_insert(__position, __n, __x); } #endif # 1075 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_vector.h" 3 #if __cplusplus >= 201103L /** * @brief Inserts a range into the %vector. * @param __position A const_iterator into the %vector. * @param __first An input iterator. * @param __last An input iterator. * @return An iterator that points to the inserted data. * * This function will insert copies of the data in the range * [__first,__last) into the %vector before the location specified * by @a pos. * * Note that this kind of operation could be expensive for a * %vector and if it is frequently used the user should * consider using std::list. */ template> iterator insert(const_iterator __position, _InputIterator __first, _InputIterator __last) { difference_type __offset = __position - cbegin(); _M_insert_dispatch(begin() + __offset, __first, __last, __false_type()); return begin() + __offset; } #else # 1104 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_vector.h" 3 /** * @brief Inserts a range into the %vector. * @param __position An iterator into the %vector. * @param __first An input iterator. * @param __last An input iterator. * * This function will insert copies of the data in the range * [__first,__last) into the %vector before the location specified * by @a pos. * * Note that this kind of operation could be expensive for a * %vector and if it is frequently used the user should * consider using std::list. */ template void insert(iterator __position, _InputIterator __first, _InputIterator __last) { // Check whether it's an integral type. If so, it's not an iterator. typedef typename std::__is_integer<_InputIterator>::__type _Integral; _M_insert_dispatch(__position, __first, __last, _Integral()); } #endif # 1128 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_vector.h" 3 /** * @brief Remove element at given position. * @param __position Iterator pointing to element to be erased. * @return An iterator pointing to the next element (or end()). * * This function will erase the element at the given position and thus * shorten the %vector by one. * * Note This operation could be expensive and if it is * frequently used the user should consider using std::list. * The user is also cautioned that this function only erases * the element, and that if the element is itself a pointer, * the pointed-to memory is not touched in any way. Managing * the pointer is the user's responsibility. */ iterator #if __cplusplus >= 201103L erase(const_iterator __position) { return _M_erase(begin() + (__position - cbegin())); } #else # 1149 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_vector.h" 3 erase(iterator __position) { return _M_erase(__position); } #endif # 1152 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_vector.h" 3 /** * @brief Remove a range of elements. * @param __first Iterator pointing to the first element to be erased. * @param __last Iterator pointing to one past the last element to be * erased. * @return An iterator pointing to the element pointed to by @a __last * prior to erasing (or end()). * * This function will erase the elements in the range * [__first,__last) and shorten the %vector accordingly. * * Note This operation could be expensive and if it is * frequently used the user should consider using std::list. * The user is also cautioned that this function only erases * the elements, and that if the elements themselves are * pointers, the pointed-to memory is not touched in any way. * Managing the pointer is the user's responsibility. */ iterator #if __cplusplus >= 201103L erase(const_iterator __first, const_iterator __last) { const auto __beg = begin(); const auto __cbeg = cbegin(); return _M_erase(__beg + (__first - __cbeg), __beg + (__last - __cbeg)); } #else # 1180 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_vector.h" 3 erase(iterator __first, iterator __last) { return _M_erase(__first, __last); } #endif # 1183 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_vector.h" 3 /** * @brief Swaps data with another %vector. * @param __x A %vector of the same element and allocator types. * * This exchanges the elements between two vectors in constant time. * (Three pointers, so it should be quite fast.) * Note that the global std::swap() function is specialized such that * std::swap(v1,v2) will feed to this function. */ void swap(vector& __x) #if __cplusplus >= 201103L noexcept(_Alloc_traits::_S_nothrow_swap()) #endif # 1198 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_vector.h" 3 { this->_M_impl._M_swap_data(__x._M_impl); _Alloc_traits::_S_on_swap(_M_get_Tp_allocator(), __x._M_get_Tp_allocator()); } /** * Erases all the elements. Note that this function only erases the * elements, and that if the elements themselves are pointers, the * pointed-to memory is not touched in any way. Managing the pointer is * the user's responsibility. */ void clear() _GLIBCXX_NOEXCEPT { _M_erase_at_end(this->_M_impl._M_start); } protected: /** * Memory expansion handler. Uses the member allocation function to * obtain @a n bytes of memory, and then copies [first,last) into it. */ template pointer _M_allocate_and_copy(size_type __n, _ForwardIterator __first, _ForwardIterator __last) { pointer __result = this->_M_allocate(__n); __try { std::__uninitialized_copy_a(__first, __last, __result, _M_get_Tp_allocator()); return __result; } __catch(...) { _M_deallocate(__result, __n); __throw_exception_again; } } // Internal constructor functions follow. // Called by the range constructor to implement [23.1.1]/9 // _GLIBCXX_RESOLVE_LIB_DEFECTS // 438. Ambiguity in the "do the right thing" clause template void _M_initialize_dispatch(_Integer __n, _Integer __value, __true_type) { this->_M_impl._M_start = _M_allocate(static_cast(__n)); this->_M_impl._M_end_of_storage = this->_M_impl._M_start + static_cast(__n); _M_fill_initialize(static_cast(__n), __value); } // Called by the range constructor to implement [23.1.1]/9 template void _M_initialize_dispatch(_InputIterator __first, _InputIterator __last, __false_type) { typedef typename std::iterator_traits<_InputIterator>:: iterator_category _IterCategory; _M_range_initialize(__first, __last, _IterCategory()); } // Called by the second initialize_dispatch above template void _M_range_initialize(_InputIterator __first, _InputIterator __last, std::input_iterator_tag) { for (; __first != __last; ++__first) #if __cplusplus >= 201103L emplace_back(*__first); #else # 1276 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_vector.h" 3 push_back(*__first); #endif # 1278 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_vector.h" 3 } // Called by the second initialize_dispatch above template void _M_range_initialize(_ForwardIterator __first, _ForwardIterator __last, std::forward_iterator_tag) { const size_type __n = std::distance(__first, __last); this->_M_impl._M_start = this->_M_allocate(__n); this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n; this->_M_impl._M_finish = std::__uninitialized_copy_a(__first, __last, this->_M_impl._M_start, _M_get_Tp_allocator()); } // Called by the first initialize_dispatch above and by the // vector(n,value,a) constructor. void _M_fill_initialize(size_type __n, const value_type& __value) { this->_M_impl._M_finish = std::__uninitialized_fill_n_a(this->_M_impl._M_start, __n, __value, _M_get_Tp_allocator()); } #if __cplusplus >= 201103L // Called by the vector(n) constructor. void _M_default_initialize(size_type __n) { this->_M_impl._M_finish = std::__uninitialized_default_n_a(this->_M_impl._M_start, __n, _M_get_Tp_allocator()); } #endif # 1315 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_vector.h" 3 // Internal assign functions follow. The *_aux functions do the actual // assignment work for the range versions. // Called by the range assign to implement [23.1.1]/9 // _GLIBCXX_RESOLVE_LIB_DEFECTS // 438. Ambiguity in the "do the right thing" clause template void _M_assign_dispatch(_Integer __n, _Integer __val, __true_type) { _M_fill_assign(__n, __val); } // Called by the range assign to implement [23.1.1]/9 template void _M_assign_dispatch(_InputIterator __first, _InputIterator __last, __false_type) { typedef typename std::iterator_traits<_InputIterator>:: iterator_category _IterCategory; _M_assign_aux(__first, __last, _IterCategory()); } // Called by the second assign_dispatch above template void _M_assign_aux(_InputIterator __first, _InputIterator __last, std::input_iterator_tag); // Called by the second assign_dispatch above template void _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last, std::forward_iterator_tag); // Called by assign(n,t), and the range assign when it turns out // to be the same thing. void _M_fill_assign(size_type __n, const value_type& __val); // Internal insert functions follow. // Called by the range insert to implement [23.1.1]/9 // _GLIBCXX_RESOLVE_LIB_DEFECTS // 438. Ambiguity in the "do the right thing" clause template void _M_insert_dispatch(iterator __pos, _Integer __n, _Integer __val, __true_type) { _M_fill_insert(__pos, __n, __val); } // Called by the range insert to implement [23.1.1]/9 template void _M_insert_dispatch(iterator __pos, _InputIterator __first, _InputIterator __last, __false_type) { typedef typename std::iterator_traits<_InputIterator>:: iterator_category _IterCategory; _M_range_insert(__pos, __first, __last, _IterCategory()); } // Called by the second insert_dispatch above template void _M_range_insert(iterator __pos, _InputIterator __first, _InputIterator __last, std::input_iterator_tag); // Called by the second insert_dispatch above template void _M_range_insert(iterator __pos, _ForwardIterator __first, _ForwardIterator __last, std::forward_iterator_tag); // Called by insert(p,n,x), and the range insert when it turns out to be // the same thing. void _M_fill_insert(iterator __pos, size_type __n, const value_type& __x); #if __cplusplus >= 201103L // Called by resize(n). void _M_default_append(size_type __n); bool _M_shrink_to_fit(); #endif # 1405 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_vector.h" 3 // Called by insert(p,x) #if __cplusplus < 201103L void _M_insert_aux(iterator __position, const value_type& __x); #else # 1411 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_vector.h" 3 template void _M_insert_aux(iterator __position, _Args&&... __args); template void _M_emplace_back_aux(_Args&&... __args); #endif # 1419 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_vector.h" 3 // Called by the latter. size_type _M_check_len(size_type __n, const char* __s) const { if (max_size() - size() < __n) __throw_length_error(__N(__s)); const size_type __len = size() + std::max(size(), __n); return (__len < size() || __len > max_size()) ? max_size() : __len; } // Internal erase functions follow. // Called by erase(q1,q2), clear(), resize(), _M_fill_assign, // _M_assign_aux. void _M_erase_at_end(pointer __pos) _GLIBCXX_NOEXCEPT { std::_Destroy(__pos, this->_M_impl._M_finish, _M_get_Tp_allocator()); this->_M_impl._M_finish = __pos; } iterator _M_erase(iterator __position); iterator _M_erase(iterator __first, iterator __last); #if __cplusplus >= 201103L private: // Constant-time move assignment when source object's memory can be // moved, either because the source's allocator will move too // or because the allocators are equal. void _M_move_assign(vector&& __x, std::true_type) noexcept { vector __tmp(get_allocator()); this->_M_impl._M_swap_data(__tmp._M_impl); this->_M_impl._M_swap_data(__x._M_impl); std::__alloc_on_move(_M_get_Tp_allocator(), __x._M_get_Tp_allocator()); } // Do move assignment when it might not be possible to move source // object's memory, resulting in a linear-time operation. void _M_move_assign(vector&& __x, std::false_type) { if (__x._M_get_Tp_allocator() == this->_M_get_Tp_allocator()) _M_move_assign(std::move(__x), std::true_type()); else { // The rvalue's allocator cannot be moved and is not equal, // so we need to individually move each element. this->assign(std::__make_move_if_noexcept_iterator(__x.begin()), std::__make_move_if_noexcept_iterator(__x.end())); __x.clear(); } } #endif # 1479 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_vector.h" 3 #if __cplusplus >= 201103L template _Up* _M_data_ptr(_Up* __ptr) const { return __ptr; } template typename std::pointer_traits<_Ptr>::element_type* _M_data_ptr(_Ptr __ptr) const { return empty() ? nullptr : std::__addressof(*__ptr); } #else # 1491 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_vector.h" 3 template _Ptr _M_data_ptr(_Ptr __ptr) const { return __ptr; } #endif # 1496 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_vector.h" 3 }; /** * @brief Vector equality comparison. * @param __x A %vector. * @param __y A %vector of the same type as @a __x. * @return True iff the size and elements of the vectors are equal. * * This is an equivalence relation. It is linear in the size of the * vectors. Vectors are considered equivalent if their sizes are equal, * and if corresponding elements compare equal. */ template inline bool operator==(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y) { return (__x.size() == __y.size() && std::equal(__x.begin(), __x.end(), __y.begin())); } /** * @brief Vector ordering relation. * @param __x A %vector. * @param __y A %vector of the same type as @a __x. * @return True iff @a __x is lexicographically less than @a __y. * * This is a total ordering relation. It is linear in the size of the * vectors. The elements must be comparable with @c <. * * See std::lexicographical_compare() for how the determination is made. */ template inline bool operator<(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y) { return std::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end()); } /// Based on operator== template inline bool operator!=(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y) { return !(__x == __y); } /// Based on operator< template inline bool operator>(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y) { return __y < __x; } /// Based on operator< template inline bool operator<=(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y) { return !(__y < __x); } /// Based on operator< template inline bool operator>=(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y) { return !(__x < __y); } /// See std::vector::swap(). template inline void swap(vector<_Tp, _Alloc>& __x, vector<_Tp, _Alloc>& __y) { __x.swap(__y); } _GLIBCXX_END_NAMESPACE_CONTAINER } // namespace std #endif /* _STL_VECTOR_H */ # 1566 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_vector.h" 3 # 65 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/vector" 2 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 65 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/vector" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_bvector.h" 1 3 // vector specialization -*- C++ -*- // Copyright (C) 2001-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /* * * Copyright (c) 1994 * Hewlett-Packard Company * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Hewlett-Packard Company makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. * * * Copyright (c) 1996-1999 * Silicon Graphics Computer Systems, Inc. * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Silicon Graphics makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. */ /** @file bits/stl_bvector.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{vector} */ #ifndef _STL_BVECTOR_H #define _STL_BVECTOR_H 1 #if __cplusplus >= 201103L #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 60 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_bvector.h" 3 # 61 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_bvector.h" 3 #endif # 62 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_bvector.h" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_CONTAINER typedef unsigned long _Bit_type; enum { _S_word_bit = int(__CHAR_BIT__ * sizeof(_Bit_type)) }; struct _Bit_reference { _Bit_type * _M_p; _Bit_type _M_mask; _Bit_reference(_Bit_type * __x, _Bit_type __y) : _M_p(__x), _M_mask(__y) { } _Bit_reference() _GLIBCXX_NOEXCEPT : _M_p(0), _M_mask(0) { } operator bool() const _GLIBCXX_NOEXCEPT { return !!(*_M_p & _M_mask); } _Bit_reference& operator=(bool __x) _GLIBCXX_NOEXCEPT { if (__x) *_M_p |= _M_mask; else *_M_p &= ~_M_mask; return *this; } _Bit_reference& operator=(const _Bit_reference& __x) _GLIBCXX_NOEXCEPT { return *this = bool(__x); } bool operator==(const _Bit_reference& __x) const { return bool(*this) == bool(__x); } bool operator<(const _Bit_reference& __x) const { return !bool(*this) && bool(__x); } void flip() _GLIBCXX_NOEXCEPT { *_M_p ^= _M_mask; } }; #if __cplusplus >= 201103L inline void swap(_Bit_reference __x, _Bit_reference __y) noexcept { bool __tmp = __x; __x = __y; __y = __tmp; } inline void swap(_Bit_reference __x, bool& __y) noexcept { bool __tmp = __x; __x = __y; __y = __tmp; } inline void swap(bool& __x, _Bit_reference __y) noexcept { bool __tmp = __x; __x = __y; __y = __tmp; } #endif # 135 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_bvector.h" 3 struct _Bit_iterator_base : public std::iterator { _Bit_type * _M_p; unsigned int _M_offset; _Bit_iterator_base(_Bit_type * __x, unsigned int __y) : _M_p(__x), _M_offset(__y) { } void _M_bump_up() { if (_M_offset++ == int(_S_word_bit) - 1) { _M_offset = 0; ++_M_p; } } void _M_bump_down() { if (_M_offset-- == 0) { _M_offset = int(_S_word_bit) - 1; --_M_p; } } void _M_incr(ptrdiff_t __i) { difference_type __n = __i + _M_offset; _M_p += __n / int(_S_word_bit); __n = __n % int(_S_word_bit); if (__n < 0) { __n += int(_S_word_bit); --_M_p; } _M_offset = static_cast(__n); } bool operator==(const _Bit_iterator_base& __i) const { return _M_p == __i._M_p && _M_offset == __i._M_offset; } bool operator<(const _Bit_iterator_base& __i) const { return _M_p < __i._M_p || (_M_p == __i._M_p && _M_offset < __i._M_offset); } bool operator!=(const _Bit_iterator_base& __i) const { return !(*this == __i); } bool operator>(const _Bit_iterator_base& __i) const { return __i < *this; } bool operator<=(const _Bit_iterator_base& __i) const { return !(__i < *this); } bool operator>=(const _Bit_iterator_base& __i) const { return !(*this < __i); } }; inline ptrdiff_t operator-(const _Bit_iterator_base& __x, const _Bit_iterator_base& __y) { return (int(_S_word_bit) * (__x._M_p - __y._M_p) + __x._M_offset - __y._M_offset); } struct _Bit_iterator : public _Bit_iterator_base { typedef _Bit_reference reference; typedef _Bit_reference* pointer; typedef _Bit_iterator iterator; _Bit_iterator() : _Bit_iterator_base(0, 0) { } _Bit_iterator(_Bit_type * __x, unsigned int __y) : _Bit_iterator_base(__x, __y) { } iterator _M_const_cast() const { return *this; } reference operator*() const { return reference(_M_p, 1UL << _M_offset); } iterator& operator++() { _M_bump_up(); return *this; } iterator operator++(int) { iterator __tmp = *this; _M_bump_up(); return __tmp; } iterator& operator--() { _M_bump_down(); return *this; } iterator operator--(int) { iterator __tmp = *this; _M_bump_down(); return __tmp; } iterator& operator+=(difference_type __i) { _M_incr(__i); return *this; } iterator& operator-=(difference_type __i) { *this += -__i; return *this; } iterator operator+(difference_type __i) const { iterator __tmp = *this; return __tmp += __i; } iterator operator-(difference_type __i) const { iterator __tmp = *this; return __tmp -= __i; } reference operator[](difference_type __i) const { return *(*this + __i); } }; inline _Bit_iterator operator+(ptrdiff_t __n, const _Bit_iterator& __x) { return __x + __n; } struct _Bit_const_iterator : public _Bit_iterator_base { typedef bool reference; typedef bool const_reference; typedef const bool* pointer; typedef _Bit_const_iterator const_iterator; _Bit_const_iterator() : _Bit_iterator_base(0, 0) { } _Bit_const_iterator(_Bit_type * __x, unsigned int __y) : _Bit_iterator_base(__x, __y) { } _Bit_const_iterator(const _Bit_iterator& __x) : _Bit_iterator_base(__x._M_p, __x._M_offset) { } _Bit_iterator _M_const_cast() const { return _Bit_iterator(_M_p, _M_offset); } const_reference operator*() const { return _Bit_reference(_M_p, 1UL << _M_offset); } const_iterator& operator++() { _M_bump_up(); return *this; } const_iterator operator++(int) { const_iterator __tmp = *this; _M_bump_up(); return __tmp; } const_iterator& operator--() { _M_bump_down(); return *this; } const_iterator operator--(int) { const_iterator __tmp = *this; _M_bump_down(); return __tmp; } const_iterator& operator+=(difference_type __i) { _M_incr(__i); return *this; } const_iterator& operator-=(difference_type __i) { *this += -__i; return *this; } const_iterator operator+(difference_type __i) const { const_iterator __tmp = *this; return __tmp += __i; } const_iterator operator-(difference_type __i) const { const_iterator __tmp = *this; return __tmp -= __i; } const_reference operator[](difference_type __i) const { return *(*this + __i); } }; inline _Bit_const_iterator operator+(ptrdiff_t __n, const _Bit_const_iterator& __x) { return __x + __n; } inline void __fill_bvector(_Bit_iterator __first, _Bit_iterator __last, bool __x) { for (; __first != __last; ++__first) *__first = __x; } inline void fill(_Bit_iterator __first, _Bit_iterator __last, const bool& __x) { if (__first._M_p != __last._M_p) { std::fill(__first._M_p + 1, __last._M_p, __x ? ~0 : 0); __fill_bvector(__first, _Bit_iterator(__first._M_p + 1, 0), __x); __fill_bvector(_Bit_iterator(__last._M_p, 0), __last, __x); } else __fill_bvector(__first, __last, __x); } template struct _Bvector_base { typedef typename __gnu_cxx::__alloc_traits<_Alloc>::template rebind<_Bit_type>::other _Bit_alloc_type; typedef typename __gnu_cxx::__alloc_traits<_Bit_alloc_type> _Bit_alloc_traits; typedef typename _Bit_alloc_traits::pointer _Bit_pointer; struct _Bvector_impl : public _Bit_alloc_type { _Bit_iterator _M_start; _Bit_iterator _M_finish; _Bit_pointer _M_end_of_storage; _Bvector_impl() : _Bit_alloc_type(), _M_start(), _M_finish(), _M_end_of_storage() { } _Bvector_impl(const _Bit_alloc_type& __a) : _Bit_alloc_type(__a), _M_start(), _M_finish(), _M_end_of_storage() { } #if __cplusplus >= 201103L _Bvector_impl(_Bit_alloc_type&& __a) : _Bit_alloc_type(std::move(__a)), _M_start(), _M_finish(), _M_end_of_storage() { } #endif # 440 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_bvector.h" 3 _Bit_type* _M_end_addr() const _GLIBCXX_NOEXCEPT { if (_M_end_of_storage) return std::__addressof(_M_end_of_storage[-1]) + 1; return 0; } }; public: typedef _Alloc allocator_type; _Bit_alloc_type& _M_get_Bit_allocator() _GLIBCXX_NOEXCEPT { return *static_cast<_Bit_alloc_type*>(&this->_M_impl); } const _Bit_alloc_type& _M_get_Bit_allocator() const _GLIBCXX_NOEXCEPT { return *static_cast(&this->_M_impl); } allocator_type get_allocator() const _GLIBCXX_NOEXCEPT { return allocator_type(_M_get_Bit_allocator()); } _Bvector_base() : _M_impl() { } _Bvector_base(const allocator_type& __a) : _M_impl(__a) { } #if __cplusplus >= 201103L _Bvector_base(_Bvector_base&& __x) noexcept : _M_impl(std::move(__x._M_get_Bit_allocator())) { this->_M_impl._M_start = __x._M_impl._M_start; this->_M_impl._M_finish = __x._M_impl._M_finish; this->_M_impl._M_end_of_storage = __x._M_impl._M_end_of_storage; __x._M_impl._M_start = _Bit_iterator(); __x._M_impl._M_finish = _Bit_iterator(); __x._M_impl._M_end_of_storage = nullptr; } #endif # 483 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_bvector.h" 3 ~_Bvector_base() { this->_M_deallocate(); } protected: _Bvector_impl _M_impl; _Bit_pointer _M_allocate(size_t __n) { return _Bit_alloc_traits::allocate(_M_impl, _S_nword(__n)); } void _M_deallocate() { if (_M_impl._M_start._M_p) { const size_t __n = _M_impl._M_end_addr() - _M_impl._M_start._M_p; _Bit_alloc_traits::deallocate(_M_impl, _M_impl._M_end_of_storage - __n, __n); } } static size_t _S_nword(size_t __n) { return (__n + int(_S_word_bit) - 1) / int(_S_word_bit); } }; _GLIBCXX_END_NAMESPACE_CONTAINER } // namespace std // Declare a partial specialization of vector. #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 515 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_bvector.h" 3 # 516 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_bvector.h" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_CONTAINER /** * @brief A specialization of vector for booleans which offers fixed time * access to individual elements in any order. * * @ingroup sequences * * @tparam _Alloc Allocator type. * * Note that vector does not actually meet the requirements for being * a container. This is because the reference and pointer types are not * really references and pointers to bool. See DR96 for details. @see * vector for function documentation. * * In some terminology a %vector can be described as a dynamic * C-style array, it offers fast and efficient access to individual * elements in any order and saves the user from worrying about * memory and size allocation. Subscripting ( @c [] ) access is * also provided as with C-style arrays. */ template class vector : protected _Bvector_base<_Alloc> { typedef _Bvector_base<_Alloc> _Base; typedef typename _Base::_Bit_pointer _Bit_pointer; typedef typename _Base::_Bit_alloc_traits _Bit_alloc_traits; #if __cplusplus >= 201103L template friend struct hash; #endif # 550 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_bvector.h" 3 public: typedef bool value_type; typedef size_t size_type; typedef ptrdiff_t difference_type; typedef _Bit_reference reference; typedef bool const_reference; typedef _Bit_reference* pointer; typedef const bool* const_pointer; typedef _Bit_iterator iterator; typedef _Bit_const_iterator const_iterator; typedef std::reverse_iterator const_reverse_iterator; typedef std::reverse_iterator reverse_iterator; typedef _Alloc allocator_type; allocator_type get_allocator() const { return _Base::get_allocator(); } protected: using _Base::_M_allocate; using _Base::_M_deallocate; using _Base::_S_nword; using _Base::_M_get_Bit_allocator; public: vector() #if __cplusplus >= 201103L noexcept(is_nothrow_default_constructible::value) #endif # 579 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_bvector.h" 3 : _Base() { } explicit vector(const allocator_type& __a) : _Base(__a) { } #if __cplusplus >= 201103L explicit vector(size_type __n, const allocator_type& __a = allocator_type()) : vector(__n, false, __a) { } vector(size_type __n, const bool& __value, const allocator_type& __a = allocator_type()) : _Base(__a) { _M_initialize(__n); std::fill(this->_M_impl._M_start._M_p, this->_M_impl._M_end_addr(), __value ? ~0 : 0); } #else # 600 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_bvector.h" 3 explicit vector(size_type __n, const bool& __value = bool(), const allocator_type& __a = allocator_type()) : _Base(__a) { _M_initialize(__n); std::fill(this->_M_impl._M_start._M_p, this->_M_impl._M_end_addr(), __value ? ~0 : 0); } #endif # 610 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_bvector.h" 3 vector(const vector& __x) : _Base(_Bit_alloc_traits::_S_select_on_copy(__x._M_get_Bit_allocator())) { _M_initialize(__x.size()); _M_copy_aligned(__x.begin(), __x.end(), this->_M_impl._M_start); } #if __cplusplus >= 201103L vector(vector&& __x) noexcept : _Base(std::move(__x)) { } vector(vector&& __x, const allocator_type& __a) noexcept(_Bit_alloc_traits::_S_always_equal()) : _Base(__a) { if (__x.get_allocator() == __a) { this->_M_impl._M_start = __x._M_impl._M_start; this->_M_impl._M_finish = __x._M_impl._M_finish; this->_M_impl._M_end_of_storage = __x._M_impl._M_end_of_storage; __x._M_impl._M_start = _Bit_iterator(); __x._M_impl._M_finish = _Bit_iterator(); __x._M_impl._M_end_of_storage = nullptr; } else { _M_initialize(__x.size()); _M_copy_aligned(__x.begin(), __x.end(), begin()); __x.clear(); } } vector(const vector& __x, const allocator_type& __a) : _Base(__a) { _M_initialize(__x.size()); _M_copy_aligned(__x.begin(), __x.end(), this->_M_impl._M_start); } vector(initializer_list __l, const allocator_type& __a = allocator_type()) : _Base(__a) { _M_initialize_range(__l.begin(), __l.end(), random_access_iterator_tag()); } #endif # 658 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_bvector.h" 3 #if __cplusplus >= 201103L template> vector(_InputIterator __first, _InputIterator __last, const allocator_type& __a = allocator_type()) : _Base(__a) { _M_initialize_dispatch(__first, __last, __false_type()); } #else # 667 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_bvector.h" 3 template vector(_InputIterator __first, _InputIterator __last, const allocator_type& __a = allocator_type()) : _Base(__a) { typedef typename std::__is_integer<_InputIterator>::__type _Integral; _M_initialize_dispatch(__first, __last, _Integral()); } #endif # 676 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_bvector.h" 3 ~vector() _GLIBCXX_NOEXCEPT { } vector& operator=(const vector& __x) { if (&__x == this) return *this; #if __cplusplus >= 201103L if (_Bit_alloc_traits::_S_propagate_on_copy_assign()) { if (this->_M_get_Bit_allocator() != __x._M_get_Bit_allocator()) { this->_M_deallocate(); std::__alloc_on_copy(_M_get_Bit_allocator(), __x._M_get_Bit_allocator()); _M_initialize(__x.size()); } else std::__alloc_on_copy(_M_get_Bit_allocator(), __x._M_get_Bit_allocator()); } #endif # 699 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_bvector.h" 3 if (__x.size() > capacity()) { this->_M_deallocate(); _M_initialize(__x.size()); } this->_M_impl._M_finish = _M_copy_aligned(__x.begin(), __x.end(), begin()); return *this; } #if __cplusplus >= 201103L vector& operator=(vector&& __x) noexcept(_Bit_alloc_traits::_S_nothrow_move()) { if (_Bit_alloc_traits::_S_propagate_on_move_assign() || this->_M_get_Bit_allocator() == __x._M_get_Bit_allocator()) { this->_M_deallocate(); this->_M_impl._M_start = __x._M_impl._M_start; this->_M_impl._M_finish = __x._M_impl._M_finish; this->_M_impl._M_end_of_storage = __x._M_impl._M_end_of_storage; __x._M_impl._M_start = _Bit_iterator(); __x._M_impl._M_finish = _Bit_iterator(); __x._M_impl._M_end_of_storage = nullptr; std::__alloc_on_move(_M_get_Bit_allocator(), __x._M_get_Bit_allocator()); } else { if (__x.size() > capacity()) { this->_M_deallocate(); _M_initialize(__x.size()); } this->_M_impl._M_finish = _M_copy_aligned(__x.begin(), __x.end(), begin()); __x.clear(); } return *this; } vector& operator=(initializer_list __l) { this->assign (__l.begin(), __l.end()); return *this; } #endif # 747 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_bvector.h" 3 // assign(), a generalized assignment member function. Two // versions: one that takes a count, and one that takes a range. // The range version is a member template, so we dispatch on whether // or not the type is an integer. void assign(size_type __n, const bool& __x) { _M_fill_assign(__n, __x); } #if __cplusplus >= 201103L template> void assign(_InputIterator __first, _InputIterator __last) { _M_assign_dispatch(__first, __last, __false_type()); } #else # 763 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_bvector.h" 3 template void assign(_InputIterator __first, _InputIterator __last) { typedef typename std::__is_integer<_InputIterator>::__type _Integral; _M_assign_dispatch(__first, __last, _Integral()); } #endif # 771 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_bvector.h" 3 #if __cplusplus >= 201103L void assign(initializer_list __l) { this->assign(__l.begin(), __l.end()); } #endif # 777 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_bvector.h" 3 iterator begin() _GLIBCXX_NOEXCEPT { return this->_M_impl._M_start; } const_iterator begin() const _GLIBCXX_NOEXCEPT { return this->_M_impl._M_start; } iterator end() _GLIBCXX_NOEXCEPT { return this->_M_impl._M_finish; } const_iterator end() const _GLIBCXX_NOEXCEPT { return this->_M_impl._M_finish; } reverse_iterator rbegin() _GLIBCXX_NOEXCEPT { return reverse_iterator(end()); } const_reverse_iterator rbegin() const _GLIBCXX_NOEXCEPT { return const_reverse_iterator(end()); } reverse_iterator rend() _GLIBCXX_NOEXCEPT { return reverse_iterator(begin()); } const_reverse_iterator rend() const _GLIBCXX_NOEXCEPT { return const_reverse_iterator(begin()); } #if __cplusplus >= 201103L const_iterator cbegin() const noexcept { return this->_M_impl._M_start; } const_iterator cend() const noexcept { return this->_M_impl._M_finish; } const_reverse_iterator crbegin() const noexcept { return const_reverse_iterator(end()); } const_reverse_iterator crend() const noexcept { return const_reverse_iterator(begin()); } #endif # 827 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_bvector.h" 3 size_type size() const _GLIBCXX_NOEXCEPT { return size_type(end() - begin()); } size_type max_size() const _GLIBCXX_NOEXCEPT { const size_type __isize = __gnu_cxx::__numeric_traits::__max - int(_S_word_bit) + 1; const size_type __asize = _Bit_alloc_traits::max_size(_M_get_Bit_allocator()); return (__asize <= __isize / int(_S_word_bit) ? __asize * int(_S_word_bit) : __isize); } size_type capacity() const _GLIBCXX_NOEXCEPT { return size_type(const_iterator(this->_M_impl._M_end_addr(), 0) - begin()); } bool empty() const _GLIBCXX_NOEXCEPT { return begin() == end(); } reference operator[](size_type __n) { return *iterator(this->_M_impl._M_start._M_p + __n / int(_S_word_bit), __n % int(_S_word_bit)); } const_reference operator[](size_type __n) const { return *const_iterator(this->_M_impl._M_start._M_p + __n / int(_S_word_bit), __n % int(_S_word_bit)); } protected: void _M_range_check(size_type __n) const { if (__n >= this->size()) __throw_out_of_range_fmt(__N("vector::_M_range_check: __n " "(which is %zu) >= this->size() " "(which is %zu)"), __n, this->size()); } public: reference at(size_type __n) { _M_range_check(__n); return (*this)[__n]; } const_reference at(size_type __n) const { _M_range_check(__n); return (*this)[__n]; } void reserve(size_type __n) { if (__n > max_size()) __throw_length_error(__N("vector::reserve")); if (capacity() < __n) _M_reallocate(__n); } reference front() { return *begin(); } const_reference front() const { return *begin(); } reference back() { return *(end() - 1); } const_reference back() const { return *(end() - 1); } // _GLIBCXX_RESOLVE_LIB_DEFECTS // DR 464. Suggestion for new member functions in standard containers. // N.B. DR 464 says nothing about vector but we need something // here due to the way we are implementing DR 464 in the debug-mode // vector class. void data() _GLIBCXX_NOEXCEPT { } void push_back(bool __x) { if (this->_M_impl._M_finish._M_p != this->_M_impl._M_end_addr()) *this->_M_impl._M_finish++ = __x; else _M_insert_aux(end(), __x); } void swap(vector& __x) #if __cplusplus >= 201103L noexcept(_Bit_alloc_traits::_S_nothrow_swap()) #endif # 934 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_bvector.h" 3 { std::swap(this->_M_impl._M_start, __x._M_impl._M_start); std::swap(this->_M_impl._M_finish, __x._M_impl._M_finish); std::swap(this->_M_impl._M_end_of_storage, __x._M_impl._M_end_of_storage); _Bit_alloc_traits::_S_on_swap(_M_get_Bit_allocator(), __x._M_get_Bit_allocator()); } // [23.2.5]/1, third-to-last entry in synopsis listing static void swap(reference __x, reference __y) _GLIBCXX_NOEXCEPT { bool __tmp = __x; __x = __y; __y = __tmp; } iterator #if __cplusplus >= 201103L insert(const_iterator __position, const bool& __x = bool()) #else # 956 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_bvector.h" 3 insert(iterator __position, const bool& __x = bool()) #endif # 958 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_bvector.h" 3 { const difference_type __n = __position - begin(); if (this->_M_impl._M_finish._M_p != this->_M_impl._M_end_addr() && __position == end()) *this->_M_impl._M_finish++ = __x; else _M_insert_aux(__position._M_const_cast(), __x); return begin() + __n; } #if __cplusplus >= 201103L template> iterator insert(const_iterator __position, _InputIterator __first, _InputIterator __last) { difference_type __offset = __position - cbegin(); _M_insert_dispatch(__position._M_const_cast(), __first, __last, __false_type()); return begin() + __offset; } #else # 981 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_bvector.h" 3 template void insert(iterator __position, _InputIterator __first, _InputIterator __last) { typedef typename std::__is_integer<_InputIterator>::__type _Integral; _M_insert_dispatch(__position, __first, __last, _Integral()); } #endif # 990 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_bvector.h" 3 #if __cplusplus >= 201103L iterator insert(const_iterator __position, size_type __n, const bool& __x) { difference_type __offset = __position - cbegin(); _M_fill_insert(__position._M_const_cast(), __n, __x); return begin() + __offset; } #else # 1000 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_bvector.h" 3 void insert(iterator __position, size_type __n, const bool& __x) { _M_fill_insert(__position, __n, __x); } #endif # 1004 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_bvector.h" 3 #if __cplusplus >= 201103L iterator insert(const_iterator __p, initializer_list __l) { return this->insert(__p, __l.begin(), __l.end()); } #endif # 1010 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_bvector.h" 3 void pop_back() { --this->_M_impl._M_finish; } iterator #if __cplusplus >= 201103L erase(const_iterator __position) #else # 1019 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_bvector.h" 3 erase(iterator __position) #endif # 1021 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_bvector.h" 3 { return _M_erase(__position._M_const_cast()); } iterator #if __cplusplus >= 201103L erase(const_iterator __first, const_iterator __last) #else # 1027 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_bvector.h" 3 erase(iterator __first, iterator __last) #endif # 1029 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_bvector.h" 3 { return _M_erase(__first._M_const_cast(), __last._M_const_cast()); } void resize(size_type __new_size, bool __x = bool()) { if (__new_size < size()) _M_erase_at_end(begin() + difference_type(__new_size)); else insert(end(), __new_size - size(), __x); } #if __cplusplus >= 201103L void shrink_to_fit() { _M_shrink_to_fit(); } #endif # 1045 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_bvector.h" 3 void flip() _GLIBCXX_NOEXCEPT { _Bit_type * const __end = this->_M_impl._M_end_addr(); for (_Bit_type * __p = this->_M_impl._M_start._M_p; __p != __end; ++__p) *__p = ~*__p; } void clear() _GLIBCXX_NOEXCEPT { _M_erase_at_end(begin()); } #if __cplusplus >= 201103L template void emplace_back(_Args&&... __args) { push_back(bool(__args...)); } template iterator emplace(const_iterator __pos, _Args&&... __args) { return insert(__pos, bool(__args...)); } #endif # 1069 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_bvector.h" 3 protected: // Precondition: __first._M_offset == 0 && __result._M_offset == 0. iterator _M_copy_aligned(const_iterator __first, const_iterator __last, iterator __result) { _Bit_type* __q = std::copy(__first._M_p, __last._M_p, __result._M_p); return std::copy(const_iterator(__last._M_p, 0), __last, iterator(__q, 0)); } void _M_initialize(size_type __n) { _Bit_pointer __q = this->_M_allocate(__n); this->_M_impl._M_end_of_storage = __q + _S_nword(__n); this->_M_impl._M_start = iterator(std::__addressof(*__q), 0); this->_M_impl._M_finish = this->_M_impl._M_start + difference_type(__n); } void _M_reallocate(size_type __n); #if __cplusplus >= 201103L bool _M_shrink_to_fit(); #endif # 1097 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_bvector.h" 3 // Check whether it's an integral type. If so, it's not an iterator. // _GLIBCXX_RESOLVE_LIB_DEFECTS // 438. Ambiguity in the "do the right thing" clause template void _M_initialize_dispatch(_Integer __n, _Integer __x, __true_type) { _M_initialize(static_cast(__n)); std::fill(this->_M_impl._M_start._M_p, this->_M_impl._M_end_addr(), __x ? ~0 : 0); } template void _M_initialize_dispatch(_InputIterator __first, _InputIterator __last, __false_type) { _M_initialize_range(__first, __last, std::__iterator_category(__first)); } template void _M_initialize_range(_InputIterator __first, _InputIterator __last, std::input_iterator_tag) { for (; __first != __last; ++__first) push_back(*__first); } template void _M_initialize_range(_ForwardIterator __first, _ForwardIterator __last, std::forward_iterator_tag) { const size_type __n = std::distance(__first, __last); _M_initialize(__n); std::copy(__first, __last, this->_M_impl._M_start); } // _GLIBCXX_RESOLVE_LIB_DEFECTS // 438. Ambiguity in the "do the right thing" clause template void _M_assign_dispatch(_Integer __n, _Integer __val, __true_type) { _M_fill_assign(__n, __val); } template void _M_assign_dispatch(_InputIterator __first, _InputIterator __last, __false_type) { _M_assign_aux(__first, __last, std::__iterator_category(__first)); } void _M_fill_assign(size_t __n, bool __x) { if (__n > size()) { std::fill(this->_M_impl._M_start._M_p, this->_M_impl._M_end_addr(), __x ? ~0 : 0); insert(end(), __n - size(), __x); } else { _M_erase_at_end(begin() + __n); std::fill(this->_M_impl._M_start._M_p, this->_M_impl._M_end_addr(), __x ? ~0 : 0); } } template void _M_assign_aux(_InputIterator __first, _InputIterator __last, std::input_iterator_tag) { iterator __cur = begin(); for (; __first != __last && __cur != end(); ++__cur, ++__first) *__cur = *__first; if (__first == __last) _M_erase_at_end(__cur); else insert(end(), __first, __last); } template void _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last, std::forward_iterator_tag) { const size_type __len = std::distance(__first, __last); if (__len < size()) _M_erase_at_end(std::copy(__first, __last, begin())); else { _ForwardIterator __mid = __first; std::advance(__mid, size()); std::copy(__first, __mid, begin()); insert(end(), __mid, __last); } } // Check whether it's an integral type. If so, it's not an iterator. // _GLIBCXX_RESOLVE_LIB_DEFECTS // 438. Ambiguity in the "do the right thing" clause template void _M_insert_dispatch(iterator __pos, _Integer __n, _Integer __x, __true_type) { _M_fill_insert(__pos, __n, __x); } template void _M_insert_dispatch(iterator __pos, _InputIterator __first, _InputIterator __last, __false_type) { _M_insert_range(__pos, __first, __last, std::__iterator_category(__first)); } void _M_fill_insert(iterator __position, size_type __n, bool __x); template void _M_insert_range(iterator __pos, _InputIterator __first, _InputIterator __last, std::input_iterator_tag) { for (; __first != __last; ++__first) { __pos = insert(__pos, *__first); ++__pos; } } template void _M_insert_range(iterator __position, _ForwardIterator __first, _ForwardIterator __last, std::forward_iterator_tag); void _M_insert_aux(iterator __position, bool __x); size_type _M_check_len(size_type __n, const char* __s) const { if (max_size() - size() < __n) __throw_length_error(__N(__s)); const size_type __len = size() + std::max(size(), __n); return (__len < size() || __len > max_size()) ? max_size() : __len; } void _M_erase_at_end(iterator __pos) { this->_M_impl._M_finish = __pos; } iterator _M_erase(iterator __pos); iterator _M_erase(iterator __first, iterator __last); }; _GLIBCXX_END_NAMESPACE_CONTAINER } // namespace std #if __cplusplus >= 201103L #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 1265 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_bvector.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/functional_hash.h" 1 3 // functional_hash.h header -*- C++ -*- // Copyright (C) 2007-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file bits/functional_hash.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{functional} */ #ifndef _FUNCTIONAL_HASH_H #define _FUNCTIONAL_HASH_H 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 34 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/functional_hash.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 35 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/functional_hash.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/hash_bytes.h" 1 3 // Declarations for hash functions. -*- C++ -*- // Copyright (C) 2010-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file bits/hash_bytes.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{functional} */ #ifndef _HASH_BYTES_H #define _HASH_BYTES_H 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 34 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/hash_bytes.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 35 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/hash_bytes.h" 3 # 36 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/hash_bytes.h" 3 namespace std { _GLIBCXX_BEGIN_NAMESPACE_VERSION // Hash function implementation for the nontrivial specialization. // All of them are based on a primitive that hashes a pointer to a // byte array. The actual hash algorithm is not guaranteed to stay // the same from release to release -- it may be updated or tuned to // improve hash quality or speed. size_t _Hash_bytes(const void* __ptr, size_t __len, size_t __seed); // A similar hash primitive, using the FNV hash algorithm. This // algorithm is guaranteed to stay the same from release to release. // (although it might not produce the same values on different // machines.) size_t _Fnv_hash_bytes(const void* __ptr, size_t __len, size_t __seed); _GLIBCXX_END_NAMESPACE_VERSION } // namespace #endif # 60 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/hash_bytes.h" 3 # 36 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/functional_hash.h" 2 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION /** @defgroup hashes Hashes * @ingroup functors * * Hashing functors taking a variable type and returning a @c std::size_t. * * @{ */ template struct __hash_base { typedef _Result result_type; typedef _Arg argument_type; }; /// Primary class template hash. template struct hash; /// Partial specializations for pointer types. template struct hash<_Tp*> : public __hash_base { size_t operator()(_Tp* __p) const noexcept { return reinterpret_cast(__p); } }; // Explicit specializations for integer types. #define _Cxx_hashtable_define_trivial_hash(_Tp) \ template<> \ struct hash<_Tp> : public __hash_base \ { \ size_t \ operator()(_Tp __val) const noexcept \ { return static_cast(__val); } \ }; /// Explicit specialization for bool. _Cxx_hashtable_define_trivial_hash(bool) /// Explicit specialization for char. _Cxx_hashtable_define_trivial_hash(char) /// Explicit specialization for signed char. _Cxx_hashtable_define_trivial_hash(signed char) /// Explicit specialization for unsigned char. _Cxx_hashtable_define_trivial_hash(unsigned char) /// Explicit specialization for wchar_t. _Cxx_hashtable_define_trivial_hash(wchar_t) /// Explicit specialization for char16_t. _Cxx_hashtable_define_trivial_hash(char16_t) /// Explicit specialization for char32_t. _Cxx_hashtable_define_trivial_hash(char32_t) /// Explicit specialization for short. _Cxx_hashtable_define_trivial_hash(short) /// Explicit specialization for int. _Cxx_hashtable_define_trivial_hash(int) /// Explicit specialization for long. _Cxx_hashtable_define_trivial_hash(long) /// Explicit specialization for long long. _Cxx_hashtable_define_trivial_hash(long long) /// Explicit specialization for unsigned short. _Cxx_hashtable_define_trivial_hash(unsigned short) /// Explicit specialization for unsigned int. _Cxx_hashtable_define_trivial_hash(unsigned int) /// Explicit specialization for unsigned long. _Cxx_hashtable_define_trivial_hash(unsigned long) /// Explicit specialization for unsigned long long. _Cxx_hashtable_define_trivial_hash(unsigned long long) #undef _Cxx_hashtable_define_trivial_hash struct _Hash_impl { static size_t hash(const void* __ptr, size_t __clength, size_t __seed = static_cast(0xc70f6907UL)) { return _Hash_bytes(__ptr, __clength, __seed); } template static size_t hash(const _Tp& __val) { return hash(&__val, sizeof(__val)); } template static size_t __hash_combine(const _Tp& __val, size_t __hash) { return hash(&__val, sizeof(__val), __hash); } }; struct _Fnv_hash_impl { static size_t hash(const void* __ptr, size_t __clength, size_t __seed = static_cast(2166136261UL)) { return _Fnv_hash_bytes(__ptr, __clength, __seed); } template static size_t hash(const _Tp& __val) { return hash(&__val, sizeof(__val)); } template static size_t __hash_combine(const _Tp& __val, size_t __hash) { return hash(&__val, sizeof(__val), __hash); } }; /// Specialization for float. template<> struct hash : public __hash_base { size_t operator()(float __val) const noexcept { // 0 and -0 both hash to zero. return __val != 0.0f ? std::_Hash_impl::hash(__val) : 0; } }; /// Specialization for double. template<> struct hash : public __hash_base { size_t operator()(double __val) const noexcept { // 0 and -0 both hash to zero. return __val != 0.0 ? std::_Hash_impl::hash(__val) : 0; } }; /// Specialization for long double. template<> struct hash : public __hash_base { _GLIBCXX_PURE size_t operator()(long double __val) const noexcept; }; // @} group hashes // Hint about performance of hash functor. If not fast the hash based // containers will cache the hash code. // Default behavior is to consider that hasher are fast unless specified // otherwise. template struct __is_fast_hash : public std::true_type { }; template<> struct __is_fast_hash> : public std::false_type { }; _GLIBCXX_END_NAMESPACE_VERSION } // namespace #endif // _FUNCTIONAL_HASH_H # 213 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/functional_hash.h" 3 # 1266 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_bvector.h" 2 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION // DR 1182. /// std::hash specialization for vector. template struct hash<_GLIBCXX_STD_C::vector> : public __hash_base> { size_t operator()(const _GLIBCXX_STD_C::vector&) const noexcept; }; _GLIBCXX_END_NAMESPACE_VERSION }// namespace std #endif // C++11 # 1285 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_bvector.h" 3 #endif # 1287 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_bvector.h" 3 # 66 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/vector" 2 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 66 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/vector" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/range_access.h" 1 3 // -*- C++ -*- // Copyright (C) 2010-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file bits/range_access.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{iterator} */ #ifndef _GLIBCXX_RANGE_ACCESS_H #define _GLIBCXX_RANGE_ACCESS_H 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 34 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/range_access.h" 3 #if __cplusplus >= 201103L #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 36 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/range_access.h" 3 # 37 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/range_access.h" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION /** * @brief Return an iterator pointing to the first element of * the container. * @param __cont Container. */ template inline auto begin(_Container& __cont) -> decltype(__cont.begin()) { return __cont.begin(); } /** * @brief Return an iterator pointing to the first element of * the const container. * @param __cont Container. */ template inline auto begin(const _Container& __cont) -> decltype(__cont.begin()) { return __cont.begin(); } /** * @brief Return an iterator pointing to one past the last element of * the container. * @param __cont Container. */ template inline auto end(_Container& __cont) -> decltype(__cont.end()) { return __cont.end(); } /** * @brief Return an iterator pointing to one past the last element of * the const container. * @param __cont Container. */ template inline auto end(const _Container& __cont) -> decltype(__cont.end()) { return __cont.end(); } /** * @brief Return an iterator pointing to the first element of the array. * @param __arr Array. */ template inline _GLIBCXX14_CONSTEXPR _Tp* begin(_Tp (&__arr)[_Nm]) { return __arr; } /** * @brief Return an iterator pointing to one past the last element * of the array. * @param __arr Array. */ template inline _GLIBCXX14_CONSTEXPR _Tp* end(_Tp (&__arr)[_Nm]) { return __arr + _Nm; } #if __cplusplus >= 201402L template class valarray; // These overloads must be declared for cbegin and cend to use them. template _Tp* begin(valarray<_Tp>&); template const _Tp* begin(const valarray<_Tp>&); template _Tp* end(valarray<_Tp>&); template const _Tp* end(const valarray<_Tp>&); /** * @brief Return an iterator pointing to the first element of * the const container. * @param __cont Container. */ template inline constexpr auto cbegin(const _Container& __cont) noexcept(noexcept(std::begin(__cont))) -> decltype(std::begin(__cont)) { return std::begin(__cont); } /** * @brief Return an iterator pointing to one past the last element of * the const container. * @param __cont Container. */ template inline constexpr auto cend(const _Container& __cont) noexcept(noexcept(std::end(__cont))) -> decltype(std::end(__cont)) { return std::end(__cont); } /** * @brief Return a reverse iterator pointing to the last element of * the container. * @param __cont Container. */ template inline auto rbegin(_Container& __cont) -> decltype(__cont.rbegin()) { return __cont.rbegin(); } /** * @brief Return a reverse iterator pointing to the last element of * the const container. * @param __cont Container. */ template inline auto rbegin(const _Container& __cont) -> decltype(__cont.rbegin()) { return __cont.rbegin(); } /** * @brief Return a reverse iterator pointing one past the first element of * the container. * @param __cont Container. */ template inline auto rend(_Container& __cont) -> decltype(__cont.rend()) { return __cont.rend(); } /** * @brief Return a reverse iterator pointing one past the first element of * the const container. * @param __cont Container. */ template inline auto rend(const _Container& __cont) -> decltype(__cont.rend()) { return __cont.rend(); } /** * @brief Return a reverse iterator pointing to the last element of * the array. * @param __arr Array. */ template inline reverse_iterator<_Tp*> rbegin(_Tp (&__arr)[_Nm]) { return reverse_iterator<_Tp*>(__arr + _Nm); } /** * @brief Return a reverse iterator pointing one past the first element of * the array. * @param __arr Array. */ template inline reverse_iterator<_Tp*> rend(_Tp (&__arr)[_Nm]) { return reverse_iterator<_Tp*>(__arr); } /** * @brief Return a reverse iterator pointing to the last element of * the initializer_list. * @param __il initializer_list. */ template inline reverse_iterator rbegin(initializer_list<_Tp> __il) { return reverse_iterator(__il.end()); } /** * @brief Return a reverse iterator pointing one past the first element of * the initializer_list. * @param __il initializer_list. */ template inline reverse_iterator rend(initializer_list<_Tp> __il) { return reverse_iterator(__il.begin()); } /** * @brief Return a reverse iterator pointing to the last element of * the const container. * @param __cont Container. */ template inline auto crbegin(const _Container& __cont) -> decltype(std::rbegin(__cont)) { return std::rbegin(__cont); } /** * @brief Return a reverse iterator pointing one past the first element of * the const container. * @param __cont Container. */ template inline auto crend(const _Container& __cont) -> decltype(std::rend(__cont)) { return std::rend(__cont); } #endif // C++14 # 232 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/range_access.h" 3 _GLIBCXX_END_NAMESPACE_VERSION } // namespace #endif // C++11 # 237 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/range_access.h" 3 #endif // _GLIBCXX_RANGE_ACCESS_H # 239 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/range_access.h" 3 # 67 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/vector" 2 3 #ifndef _GLIBCXX_EXPORT_TEMPLATE #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 69 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/vector" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/vector.tcc" 1 3 // Vector implementation (out of line) -*- C++ -*- // Copyright (C) 2001-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /* * * Copyright (c) 1994 * Hewlett-Packard Company * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Hewlett-Packard Company makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. * * * Copyright (c) 1996 * Silicon Graphics Computer Systems, Inc. * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Silicon Graphics makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. */ /** @file bits/vector.tcc * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{vector} */ #ifndef _VECTOR_TCC #define _VECTOR_TCC 1 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_CONTAINER template void vector<_Tp, _Alloc>:: reserve(size_type __n) { if (__n > this->max_size()) __throw_length_error(__N("vector::reserve")); if (this->capacity() < __n) { const size_type __old_size = size(); pointer __tmp = _M_allocate_and_copy(__n, _GLIBCXX_MAKE_MOVE_IF_NOEXCEPT_ITERATOR(this->_M_impl._M_start), _GLIBCXX_MAKE_MOVE_IF_NOEXCEPT_ITERATOR(this->_M_impl._M_finish)); std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish, _M_get_Tp_allocator()); _M_deallocate(this->_M_impl._M_start, this->_M_impl._M_end_of_storage - this->_M_impl._M_start); this->_M_impl._M_start = __tmp; this->_M_impl._M_finish = __tmp + __old_size; this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n; } } #if __cplusplus >= 201103L template template void vector<_Tp, _Alloc>:: emplace_back(_Args&&... __args) { if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage) { _Alloc_traits::construct(this->_M_impl, this->_M_impl._M_finish, std::forward<_Args>(__args)...); ++this->_M_impl._M_finish; } else _M_emplace_back_aux(std::forward<_Args>(__args)...); } #endif # 104 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/vector.tcc" 3 template typename vector<_Tp, _Alloc>::iterator vector<_Tp, _Alloc>:: #if __cplusplus >= 201103L insert(const_iterator __position, const value_type& __x) #else # 111 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/vector.tcc" 3 insert(iterator __position, const value_type& __x) #endif # 113 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/vector.tcc" 3 { const size_type __n = __position - begin(); if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage && __position == end()) { _Alloc_traits::construct(this->_M_impl, this->_M_impl._M_finish, __x); ++this->_M_impl._M_finish; } else { #if __cplusplus >= 201103L const auto __pos = begin() + (__position - cbegin()); if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage) { _Tp __x_copy = __x; _M_insert_aux(__pos, std::move(__x_copy)); } else _M_insert_aux(__pos, __x); #else # 133 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/vector.tcc" 3 _M_insert_aux(__position, __x); #endif # 135 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/vector.tcc" 3 } return iterator(this->_M_impl._M_start + __n); } template typename vector<_Tp, _Alloc>::iterator vector<_Tp, _Alloc>:: _M_erase(iterator __position) { if (__position + 1 != end()) _GLIBCXX_MOVE3(__position + 1, end(), __position); --this->_M_impl._M_finish; _Alloc_traits::destroy(this->_M_impl, this->_M_impl._M_finish); return __position; } template typename vector<_Tp, _Alloc>::iterator vector<_Tp, _Alloc>:: _M_erase(iterator __first, iterator __last) { if (__first != __last) { if (__last != end()) _GLIBCXX_MOVE3(__last, end(), __first); _M_erase_at_end(__first.base() + (end() - __last)); } return __first; } template vector<_Tp, _Alloc>& vector<_Tp, _Alloc>:: operator=(const vector<_Tp, _Alloc>& __x) { if (&__x != this) { #if __cplusplus >= 201103L if (_Alloc_traits::_S_propagate_on_copy_assign()) { if (!_Alloc_traits::_S_always_equal() && _M_get_Tp_allocator() != __x._M_get_Tp_allocator()) { // replacement allocator cannot free existing storage this->clear(); _M_deallocate(this->_M_impl._M_start, this->_M_impl._M_end_of_storage - this->_M_impl._M_start); this->_M_impl._M_start = nullptr; this->_M_impl._M_finish = nullptr; this->_M_impl._M_end_of_storage = nullptr; } std::__alloc_on_copy(_M_get_Tp_allocator(), __x._M_get_Tp_allocator()); } #endif # 191 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/vector.tcc" 3 const size_type __xlen = __x.size(); if (__xlen > capacity()) { pointer __tmp = _M_allocate_and_copy(__xlen, __x.begin(), __x.end()); std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish, _M_get_Tp_allocator()); _M_deallocate(this->_M_impl._M_start, this->_M_impl._M_end_of_storage - this->_M_impl._M_start); this->_M_impl._M_start = __tmp; this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __xlen; } else if (size() >= __xlen) { std::_Destroy(std::copy(__x.begin(), __x.end(), begin()), end(), _M_get_Tp_allocator()); } else { std::copy(__x._M_impl._M_start, __x._M_impl._M_start + size(), this->_M_impl._M_start); std::__uninitialized_copy_a(__x._M_impl._M_start + size(), __x._M_impl._M_finish, this->_M_impl._M_finish, _M_get_Tp_allocator()); } this->_M_impl._M_finish = this->_M_impl._M_start + __xlen; } return *this; } template void vector<_Tp, _Alloc>:: _M_fill_assign(size_t __n, const value_type& __val) { if (__n > capacity()) { vector __tmp(__n, __val, _M_get_Tp_allocator()); __tmp._M_impl._M_swap_data(this->_M_impl); } else if (__n > size()) { std::fill(begin(), end(), __val); this->_M_impl._M_finish = std::__uninitialized_fill_n_a(this->_M_impl._M_finish, __n - size(), __val, _M_get_Tp_allocator()); } else _M_erase_at_end(std::fill_n(this->_M_impl._M_start, __n, __val)); } template template void vector<_Tp, _Alloc>:: _M_assign_aux(_InputIterator __first, _InputIterator __last, std::input_iterator_tag) { pointer __cur(this->_M_impl._M_start); for (; __first != __last && __cur != this->_M_impl._M_finish; ++__cur, ++__first) *__cur = *__first; if (__first == __last) _M_erase_at_end(__cur); else insert(end(), __first, __last); } template template void vector<_Tp, _Alloc>:: _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last, std::forward_iterator_tag) { const size_type __len = std::distance(__first, __last); if (__len > capacity()) { pointer __tmp(_M_allocate_and_copy(__len, __first, __last)); std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish, _M_get_Tp_allocator()); _M_deallocate(this->_M_impl._M_start, this->_M_impl._M_end_of_storage - this->_M_impl._M_start); this->_M_impl._M_start = __tmp; this->_M_impl._M_finish = this->_M_impl._M_start + __len; this->_M_impl._M_end_of_storage = this->_M_impl._M_finish; } else if (size() >= __len) _M_erase_at_end(std::copy(__first, __last, this->_M_impl._M_start)); else { _ForwardIterator __mid = __first; std::advance(__mid, size()); std::copy(__first, __mid, this->_M_impl._M_start); this->_M_impl._M_finish = std::__uninitialized_copy_a(__mid, __last, this->_M_impl._M_finish, _M_get_Tp_allocator()); } } #if __cplusplus >= 201103L template template typename vector<_Tp, _Alloc>::iterator vector<_Tp, _Alloc>:: emplace(const_iterator __position, _Args&&... __args) { const size_type __n = __position - begin(); if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage && __position == end()) { _Alloc_traits::construct(this->_M_impl, this->_M_impl._M_finish, std::forward<_Args>(__args)...); ++this->_M_impl._M_finish; } else _M_insert_aux(begin() + (__position - cbegin()), std::forward<_Args>(__args)...); return iterator(this->_M_impl._M_start + __n); } template template void vector<_Tp, _Alloc>:: _M_insert_aux(iterator __position, _Args&&... __args) #else # 324 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/vector.tcc" 3 template void vector<_Tp, _Alloc>:: _M_insert_aux(iterator __position, const _Tp& __x) #endif # 329 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/vector.tcc" 3 { if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage) { _Alloc_traits::construct(this->_M_impl, this->_M_impl._M_finish, _GLIBCXX_MOVE(*(this->_M_impl._M_finish - 1))); ++this->_M_impl._M_finish; #if __cplusplus < 201103L _Tp __x_copy = __x; #endif # 339 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/vector.tcc" 3 _GLIBCXX_MOVE_BACKWARD3(__position.base(), this->_M_impl._M_finish - 2, this->_M_impl._M_finish - 1); #if __cplusplus < 201103L *__position = __x_copy; #else # 345 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/vector.tcc" 3 *__position = _Tp(std::forward<_Args>(__args)...); #endif # 347 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/vector.tcc" 3 } else { const size_type __len = _M_check_len(size_type(1), "vector::_M_insert_aux"); const size_type __elems_before = __position - begin(); pointer __new_start(this->_M_allocate(__len)); pointer __new_finish(__new_start); __try { // The order of the three operations is dictated by the C++0x // case, where the moves could alter a new element belonging // to the existing vector. This is an issue only for callers // taking the element by const lvalue ref (see 23.1/13). _Alloc_traits::construct(this->_M_impl, __new_start + __elems_before, #if __cplusplus >= 201103L std::forward<_Args>(__args)...); #else # 366 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/vector.tcc" 3 __x); #endif # 368 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/vector.tcc" 3 __new_finish = pointer(); __new_finish = std::__uninitialized_move_if_noexcept_a (this->_M_impl._M_start, __position.base(), __new_start, _M_get_Tp_allocator()); ++__new_finish; __new_finish = std::__uninitialized_move_if_noexcept_a (__position.base(), this->_M_impl._M_finish, __new_finish, _M_get_Tp_allocator()); } __catch(...) { if (!__new_finish) _Alloc_traits::destroy(this->_M_impl, __new_start + __elems_before); else std::_Destroy(__new_start, __new_finish, _M_get_Tp_allocator()); _M_deallocate(__new_start, __len); __throw_exception_again; } std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish, _M_get_Tp_allocator()); _M_deallocate(this->_M_impl._M_start, this->_M_impl._M_end_of_storage - this->_M_impl._M_start); this->_M_impl._M_start = __new_start; this->_M_impl._M_finish = __new_finish; this->_M_impl._M_end_of_storage = __new_start + __len; } } #if __cplusplus >= 201103L template template void vector<_Tp, _Alloc>:: _M_emplace_back_aux(_Args&&... __args) { const size_type __len = _M_check_len(size_type(1), "vector::_M_emplace_back_aux"); pointer __new_start(this->_M_allocate(__len)); pointer __new_finish(__new_start); __try { _Alloc_traits::construct(this->_M_impl, __new_start + size(), std::forward<_Args>(__args)...); __new_finish = pointer(); __new_finish = std::__uninitialized_move_if_noexcept_a (this->_M_impl._M_start, this->_M_impl._M_finish, __new_start, _M_get_Tp_allocator()); ++__new_finish; } __catch(...) { if (!__new_finish) _Alloc_traits::destroy(this->_M_impl, __new_start + size()); else std::_Destroy(__new_start, __new_finish, _M_get_Tp_allocator()); _M_deallocate(__new_start, __len); __throw_exception_again; } std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish, _M_get_Tp_allocator()); _M_deallocate(this->_M_impl._M_start, this->_M_impl._M_end_of_storage - this->_M_impl._M_start); this->_M_impl._M_start = __new_start; this->_M_impl._M_finish = __new_finish; this->_M_impl._M_end_of_storage = __new_start + __len; } #endif # 446 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/vector.tcc" 3 template void vector<_Tp, _Alloc>:: _M_fill_insert(iterator __position, size_type __n, const value_type& __x) { if (__n != 0) { if (size_type(this->_M_impl._M_end_of_storage - this->_M_impl._M_finish) >= __n) { value_type __x_copy = __x; const size_type __elems_after = end() - __position; pointer __old_finish(this->_M_impl._M_finish); if (__elems_after > __n) { std::__uninitialized_move_a(this->_M_impl._M_finish - __n, this->_M_impl._M_finish, this->_M_impl._M_finish, _M_get_Tp_allocator()); this->_M_impl._M_finish += __n; _GLIBCXX_MOVE_BACKWARD3(__position.base(), __old_finish - __n, __old_finish); std::fill(__position.base(), __position.base() + __n, __x_copy); } else { this->_M_impl._M_finish = std::__uninitialized_fill_n_a(this->_M_impl._M_finish, __n - __elems_after, __x_copy, _M_get_Tp_allocator()); std::__uninitialized_move_a(__position.base(), __old_finish, this->_M_impl._M_finish, _M_get_Tp_allocator()); this->_M_impl._M_finish += __elems_after; std::fill(__position.base(), __old_finish, __x_copy); } } else { const size_type __len = _M_check_len(__n, "vector::_M_fill_insert"); const size_type __elems_before = __position - begin(); pointer __new_start(this->_M_allocate(__len)); pointer __new_finish(__new_start); __try { // See _M_insert_aux above. std::__uninitialized_fill_n_a(__new_start + __elems_before, __n, __x, _M_get_Tp_allocator()); __new_finish = pointer(); __new_finish = std::__uninitialized_move_if_noexcept_a (this->_M_impl._M_start, __position.base(), __new_start, _M_get_Tp_allocator()); __new_finish += __n; __new_finish = std::__uninitialized_move_if_noexcept_a (__position.base(), this->_M_impl._M_finish, __new_finish, _M_get_Tp_allocator()); } __catch(...) { if (!__new_finish) std::_Destroy(__new_start + __elems_before, __new_start + __elems_before + __n, _M_get_Tp_allocator()); else std::_Destroy(__new_start, __new_finish, _M_get_Tp_allocator()); _M_deallocate(__new_start, __len); __throw_exception_again; } std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish, _M_get_Tp_allocator()); _M_deallocate(this->_M_impl._M_start, this->_M_impl._M_end_of_storage - this->_M_impl._M_start); this->_M_impl._M_start = __new_start; this->_M_impl._M_finish = __new_finish; this->_M_impl._M_end_of_storage = __new_start + __len; } } } #if __cplusplus >= 201103L template void vector<_Tp, _Alloc>:: _M_default_append(size_type __n) { if (__n != 0) { if (size_type(this->_M_impl._M_end_of_storage - this->_M_impl._M_finish) >= __n) { this->_M_impl._M_finish = std::__uninitialized_default_n_a(this->_M_impl._M_finish, __n, _M_get_Tp_allocator()); } else { const size_type __len = _M_check_len(__n, "vector::_M_default_append"); const size_type __old_size = this->size(); pointer __new_start(this->_M_allocate(__len)); pointer __new_finish(__new_start); __try { __new_finish = std::__uninitialized_move_if_noexcept_a (this->_M_impl._M_start, this->_M_impl._M_finish, __new_start, _M_get_Tp_allocator()); __new_finish = std::__uninitialized_default_n_a(__new_finish, __n, _M_get_Tp_allocator()); } __catch(...) { std::_Destroy(__new_start, __new_finish, _M_get_Tp_allocator()); _M_deallocate(__new_start, __len); __throw_exception_again; } std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish, _M_get_Tp_allocator()); _M_deallocate(this->_M_impl._M_start, this->_M_impl._M_end_of_storage - this->_M_impl._M_start); this->_M_impl._M_start = __new_start; this->_M_impl._M_finish = __new_finish; this->_M_impl._M_end_of_storage = __new_start + __len; } } } template bool vector<_Tp, _Alloc>:: _M_shrink_to_fit() { if (capacity() == size()) return false; return std::__shrink_to_fit_aux::_S_do_it(*this); } #endif # 598 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/vector.tcc" 3 template template void vector<_Tp, _Alloc>:: _M_range_insert(iterator __pos, _InputIterator __first, _InputIterator __last, std::input_iterator_tag) { for (; __first != __last; ++__first) { __pos = insert(__pos, *__first); ++__pos; } } template template void vector<_Tp, _Alloc>:: _M_range_insert(iterator __position, _ForwardIterator __first, _ForwardIterator __last, std::forward_iterator_tag) { if (__first != __last) { const size_type __n = std::distance(__first, __last); if (size_type(this->_M_impl._M_end_of_storage - this->_M_impl._M_finish) >= __n) { const size_type __elems_after = end() - __position; pointer __old_finish(this->_M_impl._M_finish); if (__elems_after > __n) { std::__uninitialized_move_a(this->_M_impl._M_finish - __n, this->_M_impl._M_finish, this->_M_impl._M_finish, _M_get_Tp_allocator()); this->_M_impl._M_finish += __n; _GLIBCXX_MOVE_BACKWARD3(__position.base(), __old_finish - __n, __old_finish); std::copy(__first, __last, __position); } else { _ForwardIterator __mid = __first; std::advance(__mid, __elems_after); std::__uninitialized_copy_a(__mid, __last, this->_M_impl._M_finish, _M_get_Tp_allocator()); this->_M_impl._M_finish += __n - __elems_after; std::__uninitialized_move_a(__position.base(), __old_finish, this->_M_impl._M_finish, _M_get_Tp_allocator()); this->_M_impl._M_finish += __elems_after; std::copy(__first, __mid, __position); } } else { const size_type __len = _M_check_len(__n, "vector::_M_range_insert"); pointer __new_start(this->_M_allocate(__len)); pointer __new_finish(__new_start); __try { __new_finish = std::__uninitialized_move_if_noexcept_a (this->_M_impl._M_start, __position.base(), __new_start, _M_get_Tp_allocator()); __new_finish = std::__uninitialized_copy_a(__first, __last, __new_finish, _M_get_Tp_allocator()); __new_finish = std::__uninitialized_move_if_noexcept_a (__position.base(), this->_M_impl._M_finish, __new_finish, _M_get_Tp_allocator()); } __catch(...) { std::_Destroy(__new_start, __new_finish, _M_get_Tp_allocator()); _M_deallocate(__new_start, __len); __throw_exception_again; } std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish, _M_get_Tp_allocator()); _M_deallocate(this->_M_impl._M_start, this->_M_impl._M_end_of_storage - this->_M_impl._M_start); this->_M_impl._M_start = __new_start; this->_M_impl._M_finish = __new_finish; this->_M_impl._M_end_of_storage = __new_start + __len; } } } // vector template void vector:: _M_reallocate(size_type __n) { _Bit_pointer __q = this->_M_allocate(__n); iterator __start(std::__addressof(*__q), 0); this->_M_impl._M_finish = _M_copy_aligned(begin(), end(), __start); this->_M_deallocate(); this->_M_impl._M_start = __start; this->_M_impl._M_end_of_storage = __q + _S_nword(__n); } template void vector:: _M_fill_insert(iterator __position, size_type __n, bool __x) { if (__n == 0) return; if (capacity() - size() >= __n) { std::copy_backward(__position, end(), this->_M_impl._M_finish + difference_type(__n)); std::fill(__position, __position + difference_type(__n), __x); this->_M_impl._M_finish += difference_type(__n); } else { const size_type __len = _M_check_len(__n, "vector::_M_fill_insert"); _Bit_pointer __q = this->_M_allocate(__len); iterator __start(std::__addressof(*__q), 0); iterator __i = _M_copy_aligned(begin(), __position, __start); std::fill(__i, __i + difference_type(__n), __x); this->_M_impl._M_finish = std::copy(__position, end(), __i + difference_type(__n)); this->_M_deallocate(); this->_M_impl._M_end_of_storage = __q + _S_nword(__len); this->_M_impl._M_start = __start; } } template template void vector:: _M_insert_range(iterator __position, _ForwardIterator __first, _ForwardIterator __last, std::forward_iterator_tag) { if (__first != __last) { size_type __n = std::distance(__first, __last); if (capacity() - size() >= __n) { std::copy_backward(__position, end(), this->_M_impl._M_finish + difference_type(__n)); std::copy(__first, __last, __position); this->_M_impl._M_finish += difference_type(__n); } else { const size_type __len = _M_check_len(__n, "vector::_M_insert_range"); _Bit_pointer __q = this->_M_allocate(__len); iterator __start(std::__addressof(*__q), 0); iterator __i = _M_copy_aligned(begin(), __position, __start); __i = std::copy(__first, __last, __i); this->_M_impl._M_finish = std::copy(__position, end(), __i); this->_M_deallocate(); this->_M_impl._M_end_of_storage = __q + _S_nword(__len); this->_M_impl._M_start = __start; } } } template void vector:: _M_insert_aux(iterator __position, bool __x) { if (this->_M_impl._M_finish._M_p != this->_M_impl._M_end_addr()) { std::copy_backward(__position, this->_M_impl._M_finish, this->_M_impl._M_finish + 1); *__position = __x; ++this->_M_impl._M_finish; } else { const size_type __len = _M_check_len(size_type(1), "vector::_M_insert_aux"); _Bit_pointer __q = this->_M_allocate(__len); iterator __start(std::__addressof(*__q), 0); iterator __i = _M_copy_aligned(begin(), __position, __start); *__i++ = __x; this->_M_impl._M_finish = std::copy(__position, end(), __i); this->_M_deallocate(); this->_M_impl._M_end_of_storage = __q + _S_nword(__len); this->_M_impl._M_start = __start; } } template typename vector::iterator vector:: _M_erase(iterator __position) { if (__position + 1 != end()) std::copy(__position + 1, end(), __position); --this->_M_impl._M_finish; return __position; } template typename vector::iterator vector:: _M_erase(iterator __first, iterator __last) { if (__first != __last) _M_erase_at_end(std::copy(__last, end(), __first)); return __first; } #if __cplusplus >= 201103L template bool vector:: _M_shrink_to_fit() { if (capacity() - size() < int(_S_word_bit)) return false; __try { _M_reallocate(size()); return true; } __catch(...) { return false; } } #endif # 839 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/vector.tcc" 3 _GLIBCXX_END_NAMESPACE_CONTAINER } // namespace std #if __cplusplus >= 201103L namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION template size_t hash<_GLIBCXX_STD_C::vector>:: operator()(const _GLIBCXX_STD_C::vector& __b) const noexcept { size_t __hash = 0; using _GLIBCXX_STD_C::_S_word_bit; using _GLIBCXX_STD_C::_Bit_type; const size_t __words = __b.size() / _S_word_bit; if (__words) { const size_t __clength = __words * sizeof(_Bit_type); __hash = std::_Hash_impl::hash(__b._M_impl._M_start._M_p, __clength); } const size_t __extrabits = __b.size() % _S_word_bit; if (__extrabits) { _Bit_type __hiword = *__b._M_impl._M_finish._M_p; __hiword &= ~((~static_cast<_Bit_type>(0)) << __extrabits); const size_t __clength = (__extrabits + __CHAR_BIT__ - 1) / __CHAR_BIT__; if (__words) __hash = std::_Hash_impl::hash(&__hiword, __clength, __hash); else __hash = std::_Hash_impl::hash(&__hiword, __clength); } return __hash; } _GLIBCXX_END_NAMESPACE_VERSION } // namespace std #endif // C++11 # 886 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/vector.tcc" 3 #endif /* _VECTOR_TCC */ # 888 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/vector.tcc" 3 # 70 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/vector" 2 3 #endif # 71 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/vector" 3 #ifdef _GLIBCXX_DEBUG #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 73 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/vector" 3 # 74 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/vector" 3 #endif # 75 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/vector" 3 #ifdef _GLIBCXX_PROFILE #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 77 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/vector" 3 # 78 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/vector" 3 #endif # 79 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/vector" 3 #endif /* _GLIBCXX_VECTOR */ # 81 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/vector" 3 # 7 "test2.cpp" 2 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 7 "test2.cpp" # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/set" 1 3 // -*- C++ -*- // Copyright (C) 2001-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /* * * Copyright (c) 1994 * Hewlett-Packard Company * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Hewlett-Packard Company makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. * * * Copyright (c) 1996,1997 * Silicon Graphics Computer Systems, Inc. * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Silicon Graphics makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. */ /** @file include/set * This is a Standard C++ Library header. */ #ifndef _GLIBCXX_SET #define _GLIBCXX_SET 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 59 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/set" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 60 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/set" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 1 3 // RB tree implementation -*- C++ -*- // Copyright (C) 2001-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /* * * Copyright (c) 1996,1997 * Silicon Graphics Computer Systems, Inc. * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Silicon Graphics makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. * * * Copyright (c) 1994 * Hewlett-Packard Company * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Hewlett-Packard Company makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. * * */ /** @file bits/stl_tree.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{map,set} */ #ifndef _STL_TREE_H #define _STL_TREE_H 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 62 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 63 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 # 64 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 64 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 # 65 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 65 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_function.h" 1 3 // Functor implementations -*- C++ -*- // Copyright (C) 2001-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /* * * Copyright (c) 1994 * Hewlett-Packard Company * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Hewlett-Packard Company makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. * * * Copyright (c) 1996-1998 * Silicon Graphics Computer Systems, Inc. * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Silicon Graphics makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. */ /** @file bits/stl_function.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{functional} */ #ifndef _STL_FUNCTION_H #define _STL_FUNCTION_H 1 #if __cplusplus > 201103L #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 60 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_function.h" 3 # 61 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_function.h" 3 #endif # 62 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_function.h" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION // 20.3.1 base classes /** @defgroup functors Function Objects * @ingroup utilities * * Function objects, or @e functors, are objects with an @c operator() * defined and accessible. They can be passed as arguments to algorithm * templates and used in place of a function pointer. Not only is the * resulting expressiveness of the library increased, but the generated * code can be more efficient than what you might write by hand. When we * refer to @a functors, then, generally we include function pointers in * the description as well. * * Often, functors are only created as temporaries passed to algorithm * calls, rather than being created as named variables. * * Two examples taken from the standard itself follow. To perform a * by-element addition of two vectors @c a and @c b containing @c double, * and put the result in @c a, use * \code * transform (a.begin(), a.end(), b.begin(), a.begin(), plus()); * \endcode * To negate every element in @c a, use * \code * transform(a.begin(), a.end(), a.begin(), negate()); * \endcode * The addition and negation functions will be inlined directly. * * The standard functors are derived from structs named @c unary_function * and @c binary_function. These two classes contain nothing but typedefs, * to aid in generic (template) programming. If you write your own * functors, you might consider doing the same. * * @{ */ /** * This is one of the @link functors functor base classes@endlink. */ template struct unary_function { /// @c argument_type is the type of the argument typedef _Arg argument_type; /// @c result_type is the return type typedef _Result result_type; }; /** * This is one of the @link functors functor base classes@endlink. */ template struct binary_function { /// @c first_argument_type is the type of the first argument typedef _Arg1 first_argument_type; /// @c second_argument_type is the type of the second argument typedef _Arg2 second_argument_type; /// @c result_type is the return type typedef _Result result_type; }; /** @} */ // 20.3.2 arithmetic /** @defgroup arithmetic_functors Arithmetic Classes * @ingroup functors * * Because basic math often needs to be done during an algorithm, * the library provides functors for those operations. See the * documentation for @link functors the base classes@endlink * for examples of their use. * * @{ */ #if __cplusplus > 201103L struct __is_transparent; // undefined template struct plus; template struct minus; template struct multiplies; template struct divides; template struct modulus; template struct negate; #endif # 164 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_function.h" 3 /// One of the @link arithmetic_functors math functors@endlink. template struct plus : public binary_function<_Tp, _Tp, _Tp> { _GLIBCXX14_CONSTEXPR _Tp operator()(const _Tp& __x, const _Tp& __y) const { return __x + __y; } }; /// One of the @link arithmetic_functors math functors@endlink. template struct minus : public binary_function<_Tp, _Tp, _Tp> { _GLIBCXX14_CONSTEXPR _Tp operator()(const _Tp& __x, const _Tp& __y) const { return __x - __y; } }; /// One of the @link arithmetic_functors math functors@endlink. template struct multiplies : public binary_function<_Tp, _Tp, _Tp> { _GLIBCXX14_CONSTEXPR _Tp operator()(const _Tp& __x, const _Tp& __y) const { return __x * __y; } }; /// One of the @link arithmetic_functors math functors@endlink. template struct divides : public binary_function<_Tp, _Tp, _Tp> { _GLIBCXX14_CONSTEXPR _Tp operator()(const _Tp& __x, const _Tp& __y) const { return __x / __y; } }; /// One of the @link arithmetic_functors math functors@endlink. template struct modulus : public binary_function<_Tp, _Tp, _Tp> { _GLIBCXX14_CONSTEXPR _Tp operator()(const _Tp& __x, const _Tp& __y) const { return __x % __y; } }; /// One of the @link arithmetic_functors math functors@endlink. template struct negate : public unary_function<_Tp, _Tp> { _GLIBCXX14_CONSTEXPR _Tp operator()(const _Tp& __x) const { return -__x; } }; #if __cplusplus > 201103L #define __cpp_lib_transparent_operators 201210 //#define __cpp_lib_generic_associative_lookup 201304 template<> struct plus { template _GLIBCXX14_CONSTEXPR auto operator()(_Tp&& __t, _Up&& __u) const noexcept(noexcept(std::forward<_Tp>(__t) + std::forward<_Up>(__u))) -> decltype(std::forward<_Tp>(__t) + std::forward<_Up>(__u)) { return std::forward<_Tp>(__t) + std::forward<_Up>(__u); } typedef __is_transparent is_transparent; }; /// One of the @link arithmetic_functors math functors@endlink. template<> struct minus { template _GLIBCXX14_CONSTEXPR auto operator()(_Tp&& __t, _Up&& __u) const noexcept(noexcept(std::forward<_Tp>(__t) - std::forward<_Up>(__u))) -> decltype(std::forward<_Tp>(__t) - std::forward<_Up>(__u)) { return std::forward<_Tp>(__t) - std::forward<_Up>(__u); } typedef __is_transparent is_transparent; }; /// One of the @link arithmetic_functors math functors@endlink. template<> struct multiplies { template _GLIBCXX14_CONSTEXPR auto operator()(_Tp&& __t, _Up&& __u) const noexcept(noexcept(std::forward<_Tp>(__t) * std::forward<_Up>(__u))) -> decltype(std::forward<_Tp>(__t) * std::forward<_Up>(__u)) { return std::forward<_Tp>(__t) * std::forward<_Up>(__u); } typedef __is_transparent is_transparent; }; /// One of the @link arithmetic_functors math functors@endlink. template<> struct divides { template _GLIBCXX14_CONSTEXPR auto operator()(_Tp&& __t, _Up&& __u) const noexcept(noexcept(std::forward<_Tp>(__t) / std::forward<_Up>(__u))) -> decltype(std::forward<_Tp>(__t) / std::forward<_Up>(__u)) { return std::forward<_Tp>(__t) / std::forward<_Up>(__u); } typedef __is_transparent is_transparent; }; /// One of the @link arithmetic_functors math functors@endlink. template<> struct modulus { template _GLIBCXX14_CONSTEXPR auto operator()(_Tp&& __t, _Up&& __u) const noexcept(noexcept(std::forward<_Tp>(__t) % std::forward<_Up>(__u))) -> decltype(std::forward<_Tp>(__t) % std::forward<_Up>(__u)) { return std::forward<_Tp>(__t) % std::forward<_Up>(__u); } typedef __is_transparent is_transparent; }; /// One of the @link arithmetic_functors math functors@endlink. template<> struct negate { template _GLIBCXX14_CONSTEXPR auto operator()(_Tp&& __t) const noexcept(noexcept(-std::forward<_Tp>(__t))) -> decltype(-std::forward<_Tp>(__t)) { return -std::forward<_Tp>(__t); } typedef __is_transparent is_transparent; }; #endif # 319 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_function.h" 3 /** @} */ // 20.3.3 comparisons /** @defgroup comparison_functors Comparison Classes * @ingroup functors * * The library provides six wrapper functors for all the basic comparisons * in C++, like @c <. * * @{ */ #if __cplusplus > 201103L template struct equal_to; template struct not_equal_to; template struct greater; template struct less; template struct greater_equal; template struct less_equal; #endif # 349 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_function.h" 3 /// One of the @link comparison_functors comparison functors@endlink. template struct equal_to : public binary_function<_Tp, _Tp, bool> { _GLIBCXX14_CONSTEXPR bool operator()(const _Tp& __x, const _Tp& __y) const { return __x == __y; } }; /// One of the @link comparison_functors comparison functors@endlink. template struct not_equal_to : public binary_function<_Tp, _Tp, bool> { _GLIBCXX14_CONSTEXPR bool operator()(const _Tp& __x, const _Tp& __y) const { return __x != __y; } }; /// One of the @link comparison_functors comparison functors@endlink. template struct greater : public binary_function<_Tp, _Tp, bool> { _GLIBCXX14_CONSTEXPR bool operator()(const _Tp& __x, const _Tp& __y) const { return __x > __y; } }; /// One of the @link comparison_functors comparison functors@endlink. template struct less : public binary_function<_Tp, _Tp, bool> { _GLIBCXX14_CONSTEXPR bool operator()(const _Tp& __x, const _Tp& __y) const { return __x < __y; } }; /// One of the @link comparison_functors comparison functors@endlink. template struct greater_equal : public binary_function<_Tp, _Tp, bool> { _GLIBCXX14_CONSTEXPR bool operator()(const _Tp& __x, const _Tp& __y) const { return __x >= __y; } }; /// One of the @link comparison_functors comparison functors@endlink. template struct less_equal : public binary_function<_Tp, _Tp, bool> { _GLIBCXX14_CONSTEXPR bool operator()(const _Tp& __x, const _Tp& __y) const { return __x <= __y; } }; #if __cplusplus > 201103L /// One of the @link comparison_functors comparison functors@endlink. template<> struct equal_to { template _GLIBCXX14_CONSTEXPR auto operator()(_Tp&& __t, _Up&& __u) const noexcept(noexcept(std::forward<_Tp>(__t) == std::forward<_Up>(__u))) -> decltype(std::forward<_Tp>(__t) == std::forward<_Up>(__u)) { return std::forward<_Tp>(__t) == std::forward<_Up>(__u); } typedef __is_transparent is_transparent; }; /// One of the @link comparison_functors comparison functors@endlink. template<> struct not_equal_to { template _GLIBCXX14_CONSTEXPR auto operator()(_Tp&& __t, _Up&& __u) const noexcept(noexcept(std::forward<_Tp>(__t) != std::forward<_Up>(__u))) -> decltype(std::forward<_Tp>(__t) != std::forward<_Up>(__u)) { return std::forward<_Tp>(__t) != std::forward<_Up>(__u); } typedef __is_transparent is_transparent; }; /// One of the @link comparison_functors comparison functors@endlink. template<> struct greater { template _GLIBCXX14_CONSTEXPR auto operator()(_Tp&& __t, _Up&& __u) const noexcept(noexcept(std::forward<_Tp>(__t) > std::forward<_Up>(__u))) -> decltype(std::forward<_Tp>(__t) > std::forward<_Up>(__u)) { return std::forward<_Tp>(__t) > std::forward<_Up>(__u); } typedef __is_transparent is_transparent; }; /// One of the @link comparison_functors comparison functors@endlink. template<> struct less { template _GLIBCXX14_CONSTEXPR auto operator()(_Tp&& __t, _Up&& __u) const noexcept(noexcept(std::forward<_Tp>(__t) < std::forward<_Up>(__u))) -> decltype(std::forward<_Tp>(__t) < std::forward<_Up>(__u)) { return std::forward<_Tp>(__t) < std::forward<_Up>(__u); } typedef __is_transparent is_transparent; }; /// One of the @link comparison_functors comparison functors@endlink. template<> struct greater_equal { template _GLIBCXX14_CONSTEXPR auto operator()(_Tp&& __t, _Up&& __u) const noexcept(noexcept(std::forward<_Tp>(__t) >= std::forward<_Up>(__u))) -> decltype(std::forward<_Tp>(__t) >= std::forward<_Up>(__u)) { return std::forward<_Tp>(__t) >= std::forward<_Up>(__u); } typedef __is_transparent is_transparent; }; /// One of the @link comparison_functors comparison functors@endlink. template<> struct less_equal { template _GLIBCXX14_CONSTEXPR auto operator()(_Tp&& __t, _Up&& __u) const noexcept(noexcept(std::forward<_Tp>(__t) <= std::forward<_Up>(__u))) -> decltype(std::forward<_Tp>(__t) <= std::forward<_Up>(__u)) { return std::forward<_Tp>(__t) <= std::forward<_Up>(__u); } typedef __is_transparent is_transparent; }; #endif # 501 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_function.h" 3 /** @} */ // 20.3.4 logical operations /** @defgroup logical_functors Boolean Operations Classes * @ingroup functors * * Here are wrapper functors for Boolean operations: @c &&, @c ||, * and @c !. * * @{ */ #if __cplusplus > 201103L template struct logical_and; template struct logical_or; template struct logical_not; #endif # 522 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_function.h" 3 /// One of the @link logical_functors Boolean operations functors@endlink. template struct logical_and : public binary_function<_Tp, _Tp, bool> { _GLIBCXX14_CONSTEXPR bool operator()(const _Tp& __x, const _Tp& __y) const { return __x && __y; } }; /// One of the @link logical_functors Boolean operations functors@endlink. template struct logical_or : public binary_function<_Tp, _Tp, bool> { _GLIBCXX14_CONSTEXPR bool operator()(const _Tp& __x, const _Tp& __y) const { return __x || __y; } }; /// One of the @link logical_functors Boolean operations functors@endlink. template struct logical_not : public unary_function<_Tp, bool> { _GLIBCXX14_CONSTEXPR bool operator()(const _Tp& __x) const { return !__x; } }; #if __cplusplus > 201103L /// One of the @link logical_functors Boolean operations functors@endlink. template<> struct logical_and { template _GLIBCXX14_CONSTEXPR auto operator()(_Tp&& __t, _Up&& __u) const noexcept(noexcept(std::forward<_Tp>(__t) && std::forward<_Up>(__u))) -> decltype(std::forward<_Tp>(__t) && std::forward<_Up>(__u)) { return std::forward<_Tp>(__t) && std::forward<_Up>(__u); } typedef __is_transparent is_transparent; }; /// One of the @link logical_functors Boolean operations functors@endlink. template<> struct logical_or { template _GLIBCXX14_CONSTEXPR auto operator()(_Tp&& __t, _Up&& __u) const noexcept(noexcept(std::forward<_Tp>(__t) || std::forward<_Up>(__u))) -> decltype(std::forward<_Tp>(__t) || std::forward<_Up>(__u)) { return std::forward<_Tp>(__t) || std::forward<_Up>(__u); } typedef __is_transparent is_transparent; }; /// One of the @link logical_functors Boolean operations functors@endlink. template<> struct logical_not { template _GLIBCXX14_CONSTEXPR auto operator()(_Tp&& __t) const noexcept(noexcept(!std::forward<_Tp>(__t))) -> decltype(!std::forward<_Tp>(__t)) { return !std::forward<_Tp>(__t); } typedef __is_transparent is_transparent; }; #endif # 599 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_function.h" 3 /** @} */ #if __cplusplus > 201103L template struct bit_and; template struct bit_or; template struct bit_xor; template struct bit_not; #endif # 614 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_function.h" 3 // _GLIBCXX_RESOLVE_LIB_DEFECTS // DR 660. Missing Bitwise Operations. template struct bit_and : public binary_function<_Tp, _Tp, _Tp> { _GLIBCXX14_CONSTEXPR _Tp operator()(const _Tp& __x, const _Tp& __y) const { return __x & __y; } }; template struct bit_or : public binary_function<_Tp, _Tp, _Tp> { _GLIBCXX14_CONSTEXPR _Tp operator()(const _Tp& __x, const _Tp& __y) const { return __x | __y; } }; template struct bit_xor : public binary_function<_Tp, _Tp, _Tp> { _GLIBCXX14_CONSTEXPR _Tp operator()(const _Tp& __x, const _Tp& __y) const { return __x ^ __y; } }; template struct bit_not : public unary_function<_Tp, _Tp> { _GLIBCXX14_CONSTEXPR _Tp operator()(const _Tp& __x) const { return ~__x; } }; #if __cplusplus > 201103L template <> struct bit_and { template _GLIBCXX14_CONSTEXPR auto operator()(_Tp&& __t, _Up&& __u) const noexcept(noexcept(std::forward<_Tp>(__t) & std::forward<_Up>(__u))) -> decltype(std::forward<_Tp>(__t) & std::forward<_Up>(__u)) { return std::forward<_Tp>(__t) & std::forward<_Up>(__u); } typedef __is_transparent is_transparent; }; template <> struct bit_or { template _GLIBCXX14_CONSTEXPR auto operator()(_Tp&& __t, _Up&& __u) const noexcept(noexcept(std::forward<_Tp>(__t) | std::forward<_Up>(__u))) -> decltype(std::forward<_Tp>(__t) | std::forward<_Up>(__u)) { return std::forward<_Tp>(__t) | std::forward<_Up>(__u); } typedef __is_transparent is_transparent; }; template <> struct bit_xor { template _GLIBCXX14_CONSTEXPR auto operator()(_Tp&& __t, _Up&& __u) const noexcept(noexcept(std::forward<_Tp>(__t) ^ std::forward<_Up>(__u))) -> decltype(std::forward<_Tp>(__t) ^ std::forward<_Up>(__u)) { return std::forward<_Tp>(__t) ^ std::forward<_Up>(__u); } typedef __is_transparent is_transparent; }; template <> struct bit_not { template _GLIBCXX14_CONSTEXPR auto operator()(_Tp&& __t) const noexcept(noexcept(~std::forward<_Tp>(__t))) -> decltype(~std::forward<_Tp>(__t)) { return ~std::forward<_Tp>(__t); } typedef __is_transparent is_transparent; }; #endif # 710 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_function.h" 3 // 20.3.5 negators /** @defgroup negators Negators * @ingroup functors * * The functions @c not1 and @c not2 each take a predicate functor * and return an instance of @c unary_negate or * @c binary_negate, respectively. These classes are functors whose * @c operator() performs the stored predicate function and then returns * the negation of the result. * * For example, given a vector of integers and a trivial predicate, * \code * struct IntGreaterThanThree * : public std::unary_function * { * bool operator() (int x) { return x > 3; } * }; * * std::find_if (v.begin(), v.end(), not1(IntGreaterThanThree())); * \endcode * The call to @c find_if will locate the first index (i) of @c v for which * !(v[i] > 3) is true. * * The not1/unary_negate combination works on predicates taking a single * argument. The not2/binary_negate combination works on predicates which * take two arguments. * * @{ */ /// One of the @link negators negation functors@endlink. template class unary_negate : public unary_function { protected: _Predicate _M_pred; public: _GLIBCXX14_CONSTEXPR explicit unary_negate(const _Predicate& __x) : _M_pred(__x) { } _GLIBCXX14_CONSTEXPR bool operator()(const typename _Predicate::argument_type& __x) const { return !_M_pred(__x); } }; /// One of the @link negators negation functors@endlink. template _GLIBCXX14_CONSTEXPR inline unary_negate<_Predicate> not1(const _Predicate& __pred) { return unary_negate<_Predicate>(__pred); } /// One of the @link negators negation functors@endlink. template class binary_negate : public binary_function { protected: _Predicate _M_pred; public: _GLIBCXX14_CONSTEXPR explicit binary_negate(const _Predicate& __x) : _M_pred(__x) { } _GLIBCXX14_CONSTEXPR bool operator()(const typename _Predicate::first_argument_type& __x, const typename _Predicate::second_argument_type& __y) const { return !_M_pred(__x, __y); } }; /// One of the @link negators negation functors@endlink. template _GLIBCXX14_CONSTEXPR inline binary_negate<_Predicate> not2(const _Predicate& __pred) { return binary_negate<_Predicate>(__pred); } /** @} */ // 20.3.7 adaptors pointers functions /** @defgroup pointer_adaptors Adaptors for pointers to functions * @ingroup functors * * The advantage of function objects over pointers to functions is that * the objects in the standard library declare nested typedefs describing * their argument and result types with uniform names (e.g., @c result_type * from the base classes @c unary_function and @c binary_function). * Sometimes those typedefs are required, not just optional. * * Adaptors are provided to turn pointers to unary (single-argument) and * binary (double-argument) functions into function objects. The * long-winded functor @c pointer_to_unary_function is constructed with a * function pointer @c f, and its @c operator() called with argument @c x * returns @c f(x). The functor @c pointer_to_binary_function does the same * thing, but with a double-argument @c f and @c operator(). * * The function @c ptr_fun takes a pointer-to-function @c f and constructs * an instance of the appropriate functor. * * @{ */ /// One of the @link pointer_adaptors adaptors for function pointers@endlink. template class pointer_to_unary_function : public unary_function<_Arg, _Result> { protected: _Result (*_M_ptr)(_Arg); public: pointer_to_unary_function() { } explicit pointer_to_unary_function(_Result (*__x)(_Arg)) : _M_ptr(__x) { } _Result operator()(_Arg __x) const { return _M_ptr(__x); } }; /// One of the @link pointer_adaptors adaptors for function pointers@endlink. template inline pointer_to_unary_function<_Arg, _Result> ptr_fun(_Result (*__x)(_Arg)) { return pointer_to_unary_function<_Arg, _Result>(__x); } /// One of the @link pointer_adaptors adaptors for function pointers@endlink. template class pointer_to_binary_function : public binary_function<_Arg1, _Arg2, _Result> { protected: _Result (*_M_ptr)(_Arg1, _Arg2); public: pointer_to_binary_function() { } explicit pointer_to_binary_function(_Result (*__x)(_Arg1, _Arg2)) : _M_ptr(__x) { } _Result operator()(_Arg1 __x, _Arg2 __y) const { return _M_ptr(__x, __y); } }; /// One of the @link pointer_adaptors adaptors for function pointers@endlink. template inline pointer_to_binary_function<_Arg1, _Arg2, _Result> ptr_fun(_Result (*__x)(_Arg1, _Arg2)) { return pointer_to_binary_function<_Arg1, _Arg2, _Result>(__x); } /** @} */ template struct _Identity : public unary_function<_Tp,_Tp> { _Tp& operator()(_Tp& __x) const { return __x; } const _Tp& operator()(const _Tp& __x) const { return __x; } }; template struct _Select1st : public unary_function<_Pair, typename _Pair::first_type> { typename _Pair::first_type& operator()(_Pair& __x) const { return __x.first; } const typename _Pair::first_type& operator()(const _Pair& __x) const { return __x.first; } #if __cplusplus >= 201103L template typename _Pair2::first_type& operator()(_Pair2& __x) const { return __x.first; } template const typename _Pair2::first_type& operator()(const _Pair2& __x) const { return __x.first; } #endif # 905 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_function.h" 3 }; template struct _Select2nd : public unary_function<_Pair, typename _Pair::second_type> { typename _Pair::second_type& operator()(_Pair& __x) const { return __x.second; } const typename _Pair::second_type& operator()(const _Pair& __x) const { return __x.second; } }; // 20.3.8 adaptors pointers members /** @defgroup memory_adaptors Adaptors for pointers to members * @ingroup functors * * There are a total of 8 = 2^3 function objects in this family. * (1) Member functions taking no arguments vs member functions taking * one argument. * (2) Call through pointer vs call through reference. * (3) Const vs non-const member function. * * All of this complexity is in the function objects themselves. You can * ignore it by using the helper function mem_fun and mem_fun_ref, * which create whichever type of adaptor is appropriate. * * @{ */ /// One of the @link memory_adaptors adaptors for member /// pointers@endlink. template class mem_fun_t : public unary_function<_Tp*, _Ret> { public: explicit mem_fun_t(_Ret (_Tp::*__pf)()) : _M_f(__pf) { } _Ret operator()(_Tp* __p) const { return (__p->*_M_f)(); } private: _Ret (_Tp::*_M_f)(); }; /// One of the @link memory_adaptors adaptors for member /// pointers@endlink. template class const_mem_fun_t : public unary_function { public: explicit const_mem_fun_t(_Ret (_Tp::*__pf)() const) : _M_f(__pf) { } _Ret operator()(const _Tp* __p) const { return (__p->*_M_f)(); } private: _Ret (_Tp::*_M_f)() const; }; /// One of the @link memory_adaptors adaptors for member /// pointers@endlink. template class mem_fun_ref_t : public unary_function<_Tp, _Ret> { public: explicit mem_fun_ref_t(_Ret (_Tp::*__pf)()) : _M_f(__pf) { } _Ret operator()(_Tp& __r) const { return (__r.*_M_f)(); } private: _Ret (_Tp::*_M_f)(); }; /// One of the @link memory_adaptors adaptors for member /// pointers@endlink. template class const_mem_fun_ref_t : public unary_function<_Tp, _Ret> { public: explicit const_mem_fun_ref_t(_Ret (_Tp::*__pf)() const) : _M_f(__pf) { } _Ret operator()(const _Tp& __r) const { return (__r.*_M_f)(); } private: _Ret (_Tp::*_M_f)() const; }; /// One of the @link memory_adaptors adaptors for member /// pointers@endlink. template class mem_fun1_t : public binary_function<_Tp*, _Arg, _Ret> { public: explicit mem_fun1_t(_Ret (_Tp::*__pf)(_Arg)) : _M_f(__pf) { } _Ret operator()(_Tp* __p, _Arg __x) const { return (__p->*_M_f)(__x); } private: _Ret (_Tp::*_M_f)(_Arg); }; /// One of the @link memory_adaptors adaptors for member /// pointers@endlink. template class const_mem_fun1_t : public binary_function { public: explicit const_mem_fun1_t(_Ret (_Tp::*__pf)(_Arg) const) : _M_f(__pf) { } _Ret operator()(const _Tp* __p, _Arg __x) const { return (__p->*_M_f)(__x); } private: _Ret (_Tp::*_M_f)(_Arg) const; }; /// One of the @link memory_adaptors adaptors for member /// pointers@endlink. template class mem_fun1_ref_t : public binary_function<_Tp, _Arg, _Ret> { public: explicit mem_fun1_ref_t(_Ret (_Tp::*__pf)(_Arg)) : _M_f(__pf) { } _Ret operator()(_Tp& __r, _Arg __x) const { return (__r.*_M_f)(__x); } private: _Ret (_Tp::*_M_f)(_Arg); }; /// One of the @link memory_adaptors adaptors for member /// pointers@endlink. template class const_mem_fun1_ref_t : public binary_function<_Tp, _Arg, _Ret> { public: explicit const_mem_fun1_ref_t(_Ret (_Tp::*__pf)(_Arg) const) : _M_f(__pf) { } _Ret operator()(const _Tp& __r, _Arg __x) const { return (__r.*_M_f)(__x); } private: _Ret (_Tp::*_M_f)(_Arg) const; }; // Mem_fun adaptor helper functions. There are only two: // mem_fun and mem_fun_ref. template inline mem_fun_t<_Ret, _Tp> mem_fun(_Ret (_Tp::*__f)()) { return mem_fun_t<_Ret, _Tp>(__f); } template inline const_mem_fun_t<_Ret, _Tp> mem_fun(_Ret (_Tp::*__f)() const) { return const_mem_fun_t<_Ret, _Tp>(__f); } template inline mem_fun_ref_t<_Ret, _Tp> mem_fun_ref(_Ret (_Tp::*__f)()) { return mem_fun_ref_t<_Ret, _Tp>(__f); } template inline const_mem_fun_ref_t<_Ret, _Tp> mem_fun_ref(_Ret (_Tp::*__f)() const) { return const_mem_fun_ref_t<_Ret, _Tp>(__f); } template inline mem_fun1_t<_Ret, _Tp, _Arg> mem_fun(_Ret (_Tp::*__f)(_Arg)) { return mem_fun1_t<_Ret, _Tp, _Arg>(__f); } template inline const_mem_fun1_t<_Ret, _Tp, _Arg> mem_fun(_Ret (_Tp::*__f)(_Arg) const) { return const_mem_fun1_t<_Ret, _Tp, _Arg>(__f); } template inline mem_fun1_ref_t<_Ret, _Tp, _Arg> mem_fun_ref(_Ret (_Tp::*__f)(_Arg)) { return mem_fun1_ref_t<_Ret, _Tp, _Arg>(__f); } template inline const_mem_fun1_ref_t<_Ret, _Tp, _Arg> mem_fun_ref(_Ret (_Tp::*__f)(_Arg) const) { return const_mem_fun1_ref_t<_Ret, _Tp, _Arg>(__f); } /** @} */ _GLIBCXX_END_NAMESPACE_VERSION } // namespace #if (__cplusplus < 201103L) || _GLIBCXX_USE_DEPRECATED #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 1128 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_function.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/backward/binders.h" 1 3 // Functor implementations -*- C++ -*- // Copyright (C) 2001-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /* * * Copyright (c) 1994 * Hewlett-Packard Company * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Hewlett-Packard Company makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. * * * Copyright (c) 1996-1998 * Silicon Graphics Computer Systems, Inc. * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Silicon Graphics makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. */ /** @file backward/binders.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{functional} */ #ifndef _BACKWARD_BINDERS_H #define _BACKWARD_BINDERS_H 1 // Suppress deprecated warning for this file. #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdeprecated-declarations" namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION // 20.3.6 binders /** @defgroup binders Binder Classes * @ingroup functors * * Binders turn functions/functors with two arguments into functors * with a single argument, storing an argument to be applied later. * For example, a variable @c B of type @c binder1st is constructed * from a functor @c f and an argument @c x. Later, B's @c * operator() is called with a single argument @c y. The return * value is the value of @c f(x,y). @c B can be @a called with * various arguments (y1, y2, ...) and will in turn call @c * f(x,y1), @c f(x,y2), ... * * The function @c bind1st is provided to save some typing. It takes the * function and an argument as parameters, and returns an instance of * @c binder1st. * * The type @c binder2nd and its creator function @c bind2nd do the same * thing, but the stored argument is passed as the second parameter instead * of the first, e.g., @c bind2nd(std::minus(),1.3) will create a * functor whose @c operator() accepts a floating-point number, subtracts * 1.3 from it, and returns the result. (If @c bind1st had been used, * the functor would perform 1.3 - x instead. * * Creator-wrapper functions like @c bind1st are intended to be used in * calling algorithms. Their return values will be temporary objects. * (The goal is to not require you to type names like * @c std::binder1st> for declaring a variable to hold the * return value from @c bind1st(std::plus(),5). * * These become more useful when combined with the composition functions. * * These functions are deprecated in C++11 and can be replaced by * @c std::bind (or @c std::tr1::bind) which is more powerful and flexible, * supporting functions with any number of arguments. Uses of @c bind1st * can be replaced by @c std::bind(f, x, std::placeholders::_1) and * @c bind2nd by @c std::bind(f, std::placeholders::_1, x). * @{ */ /// One of the @link binders binder functors@endlink. template class binder1st : public unary_function { protected: _Operation op; typename _Operation::first_argument_type value; public: binder1st(const _Operation& __x, const typename _Operation::first_argument_type& __y) : op(__x), value(__y) { } typename _Operation::result_type operator()(const typename _Operation::second_argument_type& __x) const { return op(value, __x); } // _GLIBCXX_RESOLVE_LIB_DEFECTS // 109. Missing binders for non-const sequence elements typename _Operation::result_type operator()(typename _Operation::second_argument_type& __x) const { return op(value, __x); } } _GLIBCXX_DEPRECATED; /// One of the @link binders binder functors@endlink. template inline binder1st<_Operation> bind1st(const _Operation& __fn, const _Tp& __x) { typedef typename _Operation::first_argument_type _Arg1_type; return binder1st<_Operation>(__fn, _Arg1_type(__x)); } /// One of the @link binders binder functors@endlink. template class binder2nd : public unary_function { protected: _Operation op; typename _Operation::second_argument_type value; public: binder2nd(const _Operation& __x, const typename _Operation::second_argument_type& __y) : op(__x), value(__y) { } typename _Operation::result_type operator()(const typename _Operation::first_argument_type& __x) const { return op(__x, value); } // _GLIBCXX_RESOLVE_LIB_DEFECTS // 109. Missing binders for non-const sequence elements typename _Operation::result_type operator()(typename _Operation::first_argument_type& __x) const { return op(__x, value); } } _GLIBCXX_DEPRECATED; /// One of the @link binders binder functors@endlink. template inline binder2nd<_Operation> bind2nd(const _Operation& __fn, const _Tp& __x) { typedef typename _Operation::second_argument_type _Arg2_type; return binder2nd<_Operation>(__fn, _Arg2_type(__x)); } /** @} */ _GLIBCXX_END_NAMESPACE_VERSION } // namespace #pragma GCC diagnostic pop #endif /* _BACKWARD_BINDERS_H */ # 183 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/backward/binders.h" 3 # 1129 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_function.h" 2 3 #endif # 1130 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_function.h" 3 #endif /* _STL_FUNCTION_H */ # 1132 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_function.h" 3 # 66 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 2 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 66 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 # 67 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 67 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 # 68 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 #if __cplusplus >= 201103L #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 69 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/aligned_buffer.h" 1 3 // Aligned memory buffer -*- C++ -*- // Copyright (C) 2013-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file ext/aligned_buffer.h * This file is a GNU extension to the Standard C++ Library. */ #ifndef _ALIGNED_BUFFER_H #define _ALIGNED_BUFFER_H 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 33 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/aligned_buffer.h" 3 #if __cplusplus >= 201103L #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 35 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/aligned_buffer.h" 3 # 36 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/aligned_buffer.h" 3 #else # 37 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/aligned_buffer.h" 3 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 37 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/aligned_buffer.h" 3 # 38 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/aligned_buffer.h" 3 #endif # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/aligned_buffer.h" 3 namespace __gnu_cxx { // A utility type containing a POD object that can hold an object of type // _Tp initialized via placement new or allocator_traits::construct. // Intended for use as a data member subobject, use __aligned_buffer for // complete objects. template struct __aligned_membuf { // Target macro ADJUST_FIELD_ALIGN can produce different alignment for // types when used as class members. __aligned_membuf is intended // for use as a class member, so align the buffer as for a class member. struct _Tp2 { _Tp _M_t; }; alignas(__alignof__(_Tp2::_M_t)) unsigned char _M_storage[sizeof(_Tp)]; __aligned_membuf() = default; // Can be used to avoid value-initialization zeroing _M_storage. __aligned_membuf(std::nullptr_t) { } void* _M_addr() noexcept { return static_cast(&_M_storage); } const void* _M_addr() const noexcept { return static_cast(&_M_storage); } _Tp* _M_ptr() noexcept { return static_cast<_Tp*>(_M_addr()); } const _Tp* _M_ptr() const noexcept { return static_cast(_M_addr()); } }; // Similar to __aligned_membuf but aligned for complete objects, not members. // This type is used in , , // and , but ideally they would use __aligned_membuf // instead, as it has smaller size for some types on some targets. // This type is still used to avoid an ABI change. template struct __aligned_buffer : std::aligned_storage::value> { typename std::aligned_storage::value>::type _M_storage; __aligned_buffer() = default; // Can be used to avoid value-initialization __aligned_buffer(std::nullptr_t) { } void* _M_addr() noexcept { return static_cast(&_M_storage); } const void* _M_addr() const noexcept { return static_cast(&_M_storage); } _Tp* _M_ptr() noexcept { return static_cast<_Tp*>(_M_addr()); } const _Tp* _M_ptr() const noexcept { return static_cast(_M_addr()); } }; } // namespace #endif /* _ALIGNED_BUFFER_H */ # 120 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/aligned_buffer.h" 3 # 70 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 2 3 #endif # 71 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION // Red-black tree class, designed for use in implementing STL // associative containers (set, multiset, map, and multimap). The // insertion and deletion algorithms are based on those in Cormen, // Leiserson, and Rivest, Introduction to Algorithms (MIT Press, // 1990), except that // // (1) the header cell is maintained with links not only to the root // but also to the leftmost node of the tree, to enable constant // time begin(), and to the rightmost node of the tree, to enable // linear time performance when used with the generic set algorithms // (set_union, etc.) // // (2) when a node being deleted has two children its successor node // is relinked into its place, rather than copied, so that the only // iterators invalidated are those referring to the deleted node. enum _Rb_tree_color { _S_red = false, _S_black = true }; struct _Rb_tree_node_base { typedef _Rb_tree_node_base* _Base_ptr; typedef const _Rb_tree_node_base* _Const_Base_ptr; _Rb_tree_color _M_color; _Base_ptr _M_parent; _Base_ptr _M_left; _Base_ptr _M_right; static _Base_ptr _S_minimum(_Base_ptr __x) _GLIBCXX_NOEXCEPT { while (__x->_M_left != 0) __x = __x->_M_left; return __x; } static _Const_Base_ptr _S_minimum(_Const_Base_ptr __x) _GLIBCXX_NOEXCEPT { while (__x->_M_left != 0) __x = __x->_M_left; return __x; } static _Base_ptr _S_maximum(_Base_ptr __x) _GLIBCXX_NOEXCEPT { while (__x->_M_right != 0) __x = __x->_M_right; return __x; } static _Const_Base_ptr _S_maximum(_Const_Base_ptr __x) _GLIBCXX_NOEXCEPT { while (__x->_M_right != 0) __x = __x->_M_right; return __x; } }; template struct _Rb_tree_node : public _Rb_tree_node_base { typedef _Rb_tree_node<_Val>* _Link_type; #if __cplusplus < 201103L _Val _M_value_field; _Val* _M_valptr() { return std::__addressof(_M_value_field); } const _Val* _M_valptr() const { return std::__addressof(_M_value_field); } #else # 149 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 __gnu_cxx::__aligned_membuf<_Val> _M_storage; _Val* _M_valptr() { return _M_storage._M_ptr(); } const _Val* _M_valptr() const { return _M_storage._M_ptr(); } #endif # 159 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 }; _GLIBCXX_PURE _Rb_tree_node_base* _Rb_tree_increment(_Rb_tree_node_base* __x) throw (); _GLIBCXX_PURE const _Rb_tree_node_base* _Rb_tree_increment(const _Rb_tree_node_base* __x) throw (); _GLIBCXX_PURE _Rb_tree_node_base* _Rb_tree_decrement(_Rb_tree_node_base* __x) throw (); _GLIBCXX_PURE const _Rb_tree_node_base* _Rb_tree_decrement(const _Rb_tree_node_base* __x) throw (); template struct _Rb_tree_iterator { typedef _Tp value_type; typedef _Tp& reference; typedef _Tp* pointer; typedef bidirectional_iterator_tag iterator_category; typedef ptrdiff_t difference_type; typedef _Rb_tree_iterator<_Tp> _Self; typedef _Rb_tree_node_base::_Base_ptr _Base_ptr; typedef _Rb_tree_node<_Tp>* _Link_type; _Rb_tree_iterator() _GLIBCXX_NOEXCEPT : _M_node() { } explicit _Rb_tree_iterator(_Base_ptr __x) _GLIBCXX_NOEXCEPT : _M_node(__x) { } reference operator*() const _GLIBCXX_NOEXCEPT { return *static_cast<_Link_type>(_M_node)->_M_valptr(); } pointer operator->() const _GLIBCXX_NOEXCEPT { return static_cast<_Link_type> (_M_node)->_M_valptr(); } _Self& operator++() _GLIBCXX_NOEXCEPT { _M_node = _Rb_tree_increment(_M_node); return *this; } _Self operator++(int) _GLIBCXX_NOEXCEPT { _Self __tmp = *this; _M_node = _Rb_tree_increment(_M_node); return __tmp; } _Self& operator--() _GLIBCXX_NOEXCEPT { _M_node = _Rb_tree_decrement(_M_node); return *this; } _Self operator--(int) _GLIBCXX_NOEXCEPT { _Self __tmp = *this; _M_node = _Rb_tree_decrement(_M_node); return __tmp; } bool operator==(const _Self& __x) const _GLIBCXX_NOEXCEPT { return _M_node == __x._M_node; } bool operator!=(const _Self& __x) const _GLIBCXX_NOEXCEPT { return _M_node != __x._M_node; } _Base_ptr _M_node; }; template struct _Rb_tree_const_iterator { typedef _Tp value_type; typedef const _Tp& reference; typedef const _Tp* pointer; typedef _Rb_tree_iterator<_Tp> iterator; typedef bidirectional_iterator_tag iterator_category; typedef ptrdiff_t difference_type; typedef _Rb_tree_const_iterator<_Tp> _Self; typedef _Rb_tree_node_base::_Const_Base_ptr _Base_ptr; typedef const _Rb_tree_node<_Tp>* _Link_type; _Rb_tree_const_iterator() _GLIBCXX_NOEXCEPT : _M_node() { } explicit _Rb_tree_const_iterator(_Base_ptr __x) _GLIBCXX_NOEXCEPT : _M_node(__x) { } _Rb_tree_const_iterator(const iterator& __it) _GLIBCXX_NOEXCEPT : _M_node(__it._M_node) { } iterator _M_const_cast() const _GLIBCXX_NOEXCEPT { return iterator(const_cast(_M_node)); } reference operator*() const _GLIBCXX_NOEXCEPT { return *static_cast<_Link_type>(_M_node)->_M_valptr(); } pointer operator->() const _GLIBCXX_NOEXCEPT { return static_cast<_Link_type>(_M_node)->_M_valptr(); } _Self& operator++() _GLIBCXX_NOEXCEPT { _M_node = _Rb_tree_increment(_M_node); return *this; } _Self operator++(int) _GLIBCXX_NOEXCEPT { _Self __tmp = *this; _M_node = _Rb_tree_increment(_M_node); return __tmp; } _Self& operator--() _GLIBCXX_NOEXCEPT { _M_node = _Rb_tree_decrement(_M_node); return *this; } _Self operator--(int) _GLIBCXX_NOEXCEPT { _Self __tmp = *this; _M_node = _Rb_tree_decrement(_M_node); return __tmp; } bool operator==(const _Self& __x) const _GLIBCXX_NOEXCEPT { return _M_node == __x._M_node; } bool operator!=(const _Self& __x) const _GLIBCXX_NOEXCEPT { return _M_node != __x._M_node; } _Base_ptr _M_node; }; template inline bool operator==(const _Rb_tree_iterator<_Val>& __x, const _Rb_tree_const_iterator<_Val>& __y) _GLIBCXX_NOEXCEPT { return __x._M_node == __y._M_node; } template inline bool operator!=(const _Rb_tree_iterator<_Val>& __x, const _Rb_tree_const_iterator<_Val>& __y) _GLIBCXX_NOEXCEPT { return __x._M_node != __y._M_node; } void _Rb_tree_insert_and_rebalance(const bool __insert_left, _Rb_tree_node_base* __x, _Rb_tree_node_base* __p, _Rb_tree_node_base& __header) throw (); _Rb_tree_node_base* _Rb_tree_rebalance_for_erase(_Rb_tree_node_base* const __z, _Rb_tree_node_base& __header) throw (); template > class _Rb_tree { typedef typename __gnu_cxx::__alloc_traits<_Alloc>::template rebind<_Rb_tree_node<_Val> >::other _Node_allocator; typedef __gnu_cxx::__alloc_traits<_Node_allocator> _Alloc_traits; protected: typedef _Rb_tree_node_base* _Base_ptr; typedef const _Rb_tree_node_base* _Const_Base_ptr; typedef _Rb_tree_node<_Val>* _Link_type; typedef const _Rb_tree_node<_Val>* _Const_Link_type; private: // Functor recycling a pool of nodes and using allocation once the pool // is empty. struct _Reuse_or_alloc_node { _Reuse_or_alloc_node(_Rb_tree& __t) : _M_root(__t._M_root()), _M_nodes(__t._M_rightmost()), _M_t(__t) { if (_M_root) { _M_root->_M_parent = 0; if (_M_nodes->_M_left) _M_nodes = _M_nodes->_M_left; } else _M_nodes = 0; } #if __cplusplus >= 201103L _Reuse_or_alloc_node(const _Reuse_or_alloc_node&) = delete; #endif # 382 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 ~_Reuse_or_alloc_node() { _M_t._M_erase(static_cast<_Link_type>(_M_root)); } template _Link_type #if __cplusplus < 201103L operator()(const _Arg& __arg) #else # 391 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 operator()(_Arg&& __arg) #endif # 393 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 { _Link_type __node = static_cast<_Link_type>(_M_extract()); if (__node) { _M_t._M_destroy_node(__node); _M_t._M_construct_node(__node, _GLIBCXX_FORWARD(_Arg, __arg)); return __node; } return _M_t._M_create_node(_GLIBCXX_FORWARD(_Arg, __arg)); } private: _Base_ptr _M_extract() { if (!_M_nodes) return _M_nodes; _Base_ptr __node = _M_nodes; _M_nodes = _M_nodes->_M_parent; if (_M_nodes) { if (_M_nodes->_M_right == __node) { _M_nodes->_M_right = 0; if (_M_nodes->_M_left) { _M_nodes = _M_nodes->_M_left; while (_M_nodes->_M_right) _M_nodes = _M_nodes->_M_right; if (_M_nodes->_M_left) _M_nodes = _M_nodes->_M_left; } } else // __node is on the left. _M_nodes->_M_left = 0; } else _M_root = 0; return __node; } _Base_ptr _M_root; _Base_ptr _M_nodes; _Rb_tree& _M_t; }; // Functor similar to the previous one but without any pool of nodes to // recycle. struct _Alloc_node { _Alloc_node(_Rb_tree& __t) : _M_t(__t) { } template _Link_type #if __cplusplus < 201103L operator()(const _Arg& __arg) const #else # 457 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 operator()(_Arg&& __arg) const #endif # 459 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 { return _M_t._M_create_node(_GLIBCXX_FORWARD(_Arg, __arg)); } private: _Rb_tree& _M_t; }; public: typedef _Key key_type; typedef _Val value_type; typedef value_type* pointer; typedef const value_type* const_pointer; typedef value_type& reference; typedef const value_type& const_reference; typedef size_t size_type; typedef ptrdiff_t difference_type; typedef _Alloc allocator_type; _Node_allocator& _M_get_Node_allocator() _GLIBCXX_NOEXCEPT { return *static_cast<_Node_allocator*>(&this->_M_impl); } const _Node_allocator& _M_get_Node_allocator() const _GLIBCXX_NOEXCEPT { return *static_cast(&this->_M_impl); } allocator_type get_allocator() const _GLIBCXX_NOEXCEPT { return allocator_type(_M_get_Node_allocator()); } protected: _Link_type _M_get_node() { return _Alloc_traits::allocate(_M_get_Node_allocator(), 1); } void _M_put_node(_Link_type __p) _GLIBCXX_NOEXCEPT { _Alloc_traits::deallocate(_M_get_Node_allocator(), __p, 1); } #if __cplusplus < 201103L void _M_construct_node(_Link_type __node, const value_type& __x) { __try { get_allocator().construct(__node->_M_valptr(), __x); } __catch(...) { _M_put_node(__node); __throw_exception_again; } } _Link_type _M_create_node(const value_type& __x) { _Link_type __tmp = _M_get_node(); _M_construct_node(__tmp, __x); return __tmp; } void _M_destroy_node(_Link_type __p) { get_allocator().destroy(__p->_M_valptr()); } #else # 522 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 template void _M_construct_node(_Link_type __node, _Args&&... __args) { __try { ::new(__node) _Rb_tree_node<_Val>; _Alloc_traits::construct(_M_get_Node_allocator(), __node->_M_valptr(), std::forward<_Args>(__args)...); } __catch(...) { __node->~_Rb_tree_node<_Val>(); _M_put_node(__node); __throw_exception_again; } } template _Link_type _M_create_node(_Args&&... __args) { _Link_type __tmp = _M_get_node(); _M_construct_node(__tmp, std::forward<_Args>(__args)...); return __tmp; } void _M_destroy_node(_Link_type __p) noexcept { _Alloc_traits::destroy(_M_get_Node_allocator(), __p->_M_valptr()); __p->~_Rb_tree_node<_Val>(); } #endif # 557 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 void _M_drop_node(_Link_type __p) _GLIBCXX_NOEXCEPT { _M_destroy_node(__p); _M_put_node(__p); } template _Link_type _M_clone_node(_Const_Link_type __x, _NodeGen& __node_gen) { _Link_type __tmp = __node_gen(*__x->_M_valptr()); __tmp->_M_color = __x->_M_color; __tmp->_M_left = 0; __tmp->_M_right = 0; return __tmp; } protected: // Unused _Is_pod_comparator is kept as it is part of mangled name. template struct _Rb_tree_impl : public _Node_allocator { _Key_compare _M_key_compare; _Rb_tree_node_base _M_header; size_type _M_node_count; // Keeps track of size of tree. _Rb_tree_impl() : _Node_allocator(), _M_key_compare(), _M_header(), _M_node_count(0) { _M_initialize(); } _Rb_tree_impl(const _Key_compare& __comp, const _Node_allocator& __a) : _Node_allocator(__a), _M_key_compare(__comp), _M_header(), _M_node_count(0) { _M_initialize(); } #if __cplusplus >= 201103L _Rb_tree_impl(const _Key_compare& __comp, _Node_allocator&& __a) : _Node_allocator(std::move(__a)), _M_key_compare(__comp), _M_header(), _M_node_count(0) { _M_initialize(); } #endif # 602 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 void _M_reset() { this->_M_header._M_parent = 0; this->_M_header._M_left = &this->_M_header; this->_M_header._M_right = &this->_M_header; this->_M_node_count = 0; } private: void _M_initialize() { this->_M_header._M_color = _S_red; this->_M_header._M_parent = 0; this->_M_header._M_left = &this->_M_header; this->_M_header._M_right = &this->_M_header; } }; _Rb_tree_impl<_Compare> _M_impl; protected: _Base_ptr& _M_root() _GLIBCXX_NOEXCEPT { return this->_M_impl._M_header._M_parent; } _Const_Base_ptr _M_root() const _GLIBCXX_NOEXCEPT { return this->_M_impl._M_header._M_parent; } _Base_ptr& _M_leftmost() _GLIBCXX_NOEXCEPT { return this->_M_impl._M_header._M_left; } _Const_Base_ptr _M_leftmost() const _GLIBCXX_NOEXCEPT { return this->_M_impl._M_header._M_left; } _Base_ptr& _M_rightmost() _GLIBCXX_NOEXCEPT { return this->_M_impl._M_header._M_right; } _Const_Base_ptr _M_rightmost() const _GLIBCXX_NOEXCEPT { return this->_M_impl._M_header._M_right; } _Link_type _M_begin() _GLIBCXX_NOEXCEPT { return static_cast<_Link_type>(this->_M_impl._M_header._M_parent); } _Const_Link_type _M_begin() const _GLIBCXX_NOEXCEPT { return static_cast<_Const_Link_type> (this->_M_impl._M_header._M_parent); } _Link_type _M_end() _GLIBCXX_NOEXCEPT { return reinterpret_cast<_Link_type>(&this->_M_impl._M_header); } _Const_Link_type _M_end() const _GLIBCXX_NOEXCEPT { return reinterpret_cast<_Const_Link_type>(&this->_M_impl._M_header); } static const_reference _S_value(_Const_Link_type __x) { return *__x->_M_valptr(); } static const _Key& _S_key(_Const_Link_type __x) { return _KeyOfValue()(_S_value(__x)); } static _Link_type _S_left(_Base_ptr __x) _GLIBCXX_NOEXCEPT { return static_cast<_Link_type>(__x->_M_left); } static _Const_Link_type _S_left(_Const_Base_ptr __x) _GLIBCXX_NOEXCEPT { return static_cast<_Const_Link_type>(__x->_M_left); } static _Link_type _S_right(_Base_ptr __x) _GLIBCXX_NOEXCEPT { return static_cast<_Link_type>(__x->_M_right); } static _Const_Link_type _S_right(_Const_Base_ptr __x) _GLIBCXX_NOEXCEPT { return static_cast<_Const_Link_type>(__x->_M_right); } static const_reference _S_value(_Const_Base_ptr __x) { return *static_cast<_Const_Link_type>(__x)->_M_valptr(); } static const _Key& _S_key(_Const_Base_ptr __x) { return _KeyOfValue()(_S_value(__x)); } static _Base_ptr _S_minimum(_Base_ptr __x) _GLIBCXX_NOEXCEPT { return _Rb_tree_node_base::_S_minimum(__x); } static _Const_Base_ptr _S_minimum(_Const_Base_ptr __x) _GLIBCXX_NOEXCEPT { return _Rb_tree_node_base::_S_minimum(__x); } static _Base_ptr _S_maximum(_Base_ptr __x) _GLIBCXX_NOEXCEPT { return _Rb_tree_node_base::_S_maximum(__x); } static _Const_Base_ptr _S_maximum(_Const_Base_ptr __x) _GLIBCXX_NOEXCEPT { return _Rb_tree_node_base::_S_maximum(__x); } public: typedef _Rb_tree_iterator iterator; typedef _Rb_tree_const_iterator const_iterator; typedef std::reverse_iterator reverse_iterator; typedef std::reverse_iterator const_reverse_iterator; private: pair<_Base_ptr, _Base_ptr> _M_get_insert_unique_pos(const key_type& __k); pair<_Base_ptr, _Base_ptr> _M_get_insert_equal_pos(const key_type& __k); pair<_Base_ptr, _Base_ptr> _M_get_insert_hint_unique_pos(const_iterator __pos, const key_type& __k); pair<_Base_ptr, _Base_ptr> _M_get_insert_hint_equal_pos(const_iterator __pos, const key_type& __k); #if __cplusplus >= 201103L template iterator _M_insert_(_Base_ptr __x, _Base_ptr __y, _Arg&& __v, _NodeGen&); iterator _M_insert_node(_Base_ptr __x, _Base_ptr __y, _Link_type __z); template iterator _M_insert_lower(_Base_ptr __y, _Arg&& __v); template iterator _M_insert_equal_lower(_Arg&& __x); iterator _M_insert_lower_node(_Base_ptr __p, _Link_type __z); iterator _M_insert_equal_lower_node(_Link_type __z); #else # 761 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 template iterator _M_insert_(_Base_ptr __x, _Base_ptr __y, const value_type& __v, _NodeGen&); // _GLIBCXX_RESOLVE_LIB_DEFECTS // 233. Insertion hints in associative containers. iterator _M_insert_lower(_Base_ptr __y, const value_type& __v); iterator _M_insert_equal_lower(const value_type& __x); #endif # 774 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 template _Link_type _M_copy(_Const_Link_type __x, _Link_type __p, _NodeGen&); _Link_type _M_copy(_Const_Link_type __x, _Link_type __p) { _Alloc_node __an(*this); return _M_copy(__x, __p, __an); } void _M_erase(_Link_type __x); iterator _M_lower_bound(_Link_type __x, _Link_type __y, const _Key& __k); const_iterator _M_lower_bound(_Const_Link_type __x, _Const_Link_type __y, const _Key& __k) const; iterator _M_upper_bound(_Link_type __x, _Link_type __y, const _Key& __k); const_iterator _M_upper_bound(_Const_Link_type __x, _Const_Link_type __y, const _Key& __k) const; public: // allocation/deallocation _Rb_tree() { } _Rb_tree(const _Compare& __comp, const allocator_type& __a = allocator_type()) : _M_impl(__comp, _Node_allocator(__a)) { } _Rb_tree(const _Rb_tree& __x) : _M_impl(__x._M_impl._M_key_compare, _Alloc_traits::_S_select_on_copy(__x._M_get_Node_allocator())) { if (__x._M_root() != 0) { _M_root() = _M_copy(__x._M_begin(), _M_end()); _M_leftmost() = _S_minimum(_M_root()); _M_rightmost() = _S_maximum(_M_root()); _M_impl._M_node_count = __x._M_impl._M_node_count; } } #if __cplusplus >= 201103L _Rb_tree(const allocator_type& __a) : _M_impl(_Compare(), _Node_allocator(__a)) { } _Rb_tree(const _Rb_tree& __x, const allocator_type& __a) : _M_impl(__x._M_impl._M_key_compare, _Node_allocator(__a)) { if (__x._M_root() != nullptr) { _M_root() = _M_copy(__x._M_begin(), _M_end()); _M_leftmost() = _S_minimum(_M_root()); _M_rightmost() = _S_maximum(_M_root()); _M_impl._M_node_count = __x._M_impl._M_node_count; } } _Rb_tree(_Rb_tree&& __x) : _M_impl(__x._M_impl._M_key_compare, std::move(__x._M_get_Node_allocator())) { if (__x._M_root() != 0) _M_move_data(__x, std::true_type()); } _Rb_tree(_Rb_tree&& __x, const allocator_type& __a) : _Rb_tree(std::move(__x), _Node_allocator(__a)) { } _Rb_tree(_Rb_tree&& __x, _Node_allocator&& __a); #endif # 857 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 ~_Rb_tree() _GLIBCXX_NOEXCEPT { _M_erase(_M_begin()); } _Rb_tree& operator=(const _Rb_tree& __x); // Accessors. _Compare key_comp() const { return _M_impl._M_key_compare; } iterator begin() _GLIBCXX_NOEXCEPT { return iterator(this->_M_impl._M_header._M_left); } const_iterator begin() const _GLIBCXX_NOEXCEPT { return const_iterator(this->_M_impl._M_header._M_left); } iterator end() _GLIBCXX_NOEXCEPT { return iterator(&this->_M_impl._M_header); } const_iterator end() const _GLIBCXX_NOEXCEPT { return const_iterator(&this->_M_impl._M_header); } reverse_iterator rbegin() _GLIBCXX_NOEXCEPT { return reverse_iterator(end()); } const_reverse_iterator rbegin() const _GLIBCXX_NOEXCEPT { return const_reverse_iterator(end()); } reverse_iterator rend() _GLIBCXX_NOEXCEPT { return reverse_iterator(begin()); } const_reverse_iterator rend() const _GLIBCXX_NOEXCEPT { return const_reverse_iterator(begin()); } bool empty() const _GLIBCXX_NOEXCEPT { return _M_impl._M_node_count == 0; } size_type size() const _GLIBCXX_NOEXCEPT { return _M_impl._M_node_count; } size_type max_size() const _GLIBCXX_NOEXCEPT { return _Alloc_traits::max_size(_M_get_Node_allocator()); } void #if __cplusplus >= 201103L swap(_Rb_tree& __t) noexcept(_Alloc_traits::_S_nothrow_swap()); #else # 917 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 swap(_Rb_tree& __t); #endif # 919 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 // Insert/erase. #if __cplusplus >= 201103L template pair _M_insert_unique(_Arg&& __x); template iterator _M_insert_equal(_Arg&& __x); template iterator _M_insert_unique_(const_iterator __pos, _Arg&& __x, _NodeGen&); template iterator _M_insert_unique_(const_iterator __pos, _Arg&& __x) { _Alloc_node __an(*this); return _M_insert_unique_(__pos, std::forward<_Arg>(__x), __an); } template iterator _M_insert_equal_(const_iterator __pos, _Arg&& __x, _NodeGen&); template iterator _M_insert_equal_(const_iterator __pos, _Arg&& __x) { _Alloc_node __an(*this); return _M_insert_equal_(__pos, std::forward<_Arg>(__x), __an); } template pair _M_emplace_unique(_Args&&... __args); template iterator _M_emplace_equal(_Args&&... __args); template iterator _M_emplace_hint_unique(const_iterator __pos, _Args&&... __args); template iterator _M_emplace_hint_equal(const_iterator __pos, _Args&&... __args); #else # 970 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 pair _M_insert_unique(const value_type& __x); iterator _M_insert_equal(const value_type& __x); template iterator _M_insert_unique_(const_iterator __pos, const value_type& __x, _NodeGen&); iterator _M_insert_unique_(const_iterator __pos, const value_type& __x) { _Alloc_node __an(*this); return _M_insert_unique_(__pos, __x, __an); } template iterator _M_insert_equal_(const_iterator __pos, const value_type& __x, _NodeGen&); iterator _M_insert_equal_(const_iterator __pos, const value_type& __x) { _Alloc_node __an(*this); return _M_insert_equal_(__pos, __x, __an); } #endif # 999 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 template void _M_insert_unique(_InputIterator __first, _InputIterator __last); template void _M_insert_equal(_InputIterator __first, _InputIterator __last); private: void _M_erase_aux(const_iterator __position); void _M_erase_aux(const_iterator __first, const_iterator __last); public: #if __cplusplus >= 201103L // _GLIBCXX_RESOLVE_LIB_DEFECTS // DR 130. Associative erase should return an iterator. _GLIBCXX_ABI_TAG_CXX11 iterator erase(const_iterator __position) { const_iterator __result = __position; ++__result; _M_erase_aux(__position); return __result._M_const_cast(); } // LWG 2059. _GLIBCXX_ABI_TAG_CXX11 iterator erase(iterator __position) { iterator __result = __position; ++__result; _M_erase_aux(__position); return __result; } #else # 1040 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 void erase(iterator __position) { _M_erase_aux(__position); } void erase(const_iterator __position) { _M_erase_aux(__position); } #endif # 1048 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 size_type erase(const key_type& __x); #if __cplusplus >= 201103L // _GLIBCXX_RESOLVE_LIB_DEFECTS // DR 130. Associative erase should return an iterator. _GLIBCXX_ABI_TAG_CXX11 iterator erase(const_iterator __first, const_iterator __last) { _M_erase_aux(__first, __last); return __last._M_const_cast(); } #else # 1062 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 void erase(iterator __first, iterator __last) { _M_erase_aux(__first, __last); } void erase(const_iterator __first, const_iterator __last) { _M_erase_aux(__first, __last); } #endif # 1070 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 void erase(const key_type* __first, const key_type* __last); void clear() _GLIBCXX_NOEXCEPT { _M_erase(_M_begin()); _M_impl._M_reset(); } // Set operations. iterator find(const key_type& __k); const_iterator find(const key_type& __k) const; size_type count(const key_type& __k) const; iterator lower_bound(const key_type& __k) { return _M_lower_bound(_M_begin(), _M_end(), __k); } const_iterator lower_bound(const key_type& __k) const { return _M_lower_bound(_M_begin(), _M_end(), __k); } iterator upper_bound(const key_type& __k) { return _M_upper_bound(_M_begin(), _M_end(), __k); } const_iterator upper_bound(const key_type& __k) const { return _M_upper_bound(_M_begin(), _M_end(), __k); } pair equal_range(const key_type& __k); pair equal_range(const key_type& __k) const; #if __cplusplus > 201103L template> struct __is_transparent { }; template struct __is_transparent<_Cmp, _Kt, __void_t> { typedef void type; }; static auto _S_iter(_Link_type __x) { return iterator(__x); } static auto _S_iter(_Const_Link_type __x) { return const_iterator(__x); } template static auto _S_lower_bound_tr(_Cmp& __cmp, _Link __x, _Link __y, const _Kt& __k) { while (__x != 0) if (!__cmp(_S_key(__x), __k)) __y = __x, __x = _S_left(__x); else __x = _S_right(__x); return _S_iter(__y); } template static auto _S_upper_bound_tr(_Cmp& __cmp, _Link __x, _Link __y, const _Kt& __k) { while (__x != 0) if (__cmp(__k, _S_key(__x))) __y = __x, __x = _S_left(__x); else __x = _S_right(__x); return _S_iter(__y); } template::type> iterator _M_find_tr(const _Kt& __k) { auto& __cmp = _M_impl._M_key_compare; auto __j = _S_lower_bound_tr(__cmp, _M_begin(), _M_end(), __k); return (__j == end() || __cmp(__k, _S_key(__j._M_node))) ? end() : __j; } template::type> const_iterator _M_find_tr(const _Kt& __k) const { auto& __cmp = _M_impl._M_key_compare; auto __j = _S_lower_bound_tr(__cmp, _M_begin(), _M_end(), __k); return (__j == end() || __cmp(__k, _S_key(__j._M_node))) ? end() : __j; } template::type> size_type _M_count_tr(const _Kt& __k) const { auto __p = _M_equal_range_tr(__k); return std::distance(__p.first, __p.second); } template::type> iterator _M_lower_bound_tr(const _Kt& __k) { auto& __cmp = _M_impl._M_key_compare; return _S_lower_bound_tr(__cmp, _M_begin(), _M_end(), __k); } template::type> const_iterator _M_lower_bound_tr(const _Kt& __k) const { auto& __cmp = _M_impl._M_key_compare; return _S_lower_bound_tr(__cmp, _M_begin(), _M_end(), __k); } template::type> iterator _M_upper_bound_tr(const _Kt& __k) { auto& __cmp = _M_impl._M_key_compare; return _S_upper_bound_tr(__cmp, _M_begin(), _M_end(), __k); } template::type> const_iterator _M_upper_bound_tr(const _Kt& __k) const { auto& __cmp = _M_impl._M_key_compare; return _S_upper_bound_tr(__cmp, _M_begin(), _M_end(), __k); } template::type> pair _M_equal_range_tr(const _Kt& __k) { auto __low = _M_lower_bound_tr(__k); auto __high = __low; auto& __cmp = _M_impl._M_key_compare; while (__high != end() && !__cmp(__k, _S_key(__high._M_node))) ++__high; return { __low, __high }; } template::type> pair _M_equal_range_tr(const _Kt& __k) const { auto __low = _M_lower_bound_tr(__k); auto __high = __low; auto& __cmp = _M_impl._M_key_compare; while (__high != end() && !__cmp(__k, _S_key(__high._M_node))) ++__high; return { __low, __high }; } #endif # 1242 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 // Debugging. bool __rb_verify() const; #if __cplusplus >= 201103L _Rb_tree& operator=(_Rb_tree&&) noexcept(_Alloc_traits::_S_nothrow_move() && is_nothrow_move_assignable<_Compare>::value); template void _M_assign_unique(_Iterator, _Iterator); template void _M_assign_equal(_Iterator, _Iterator); private: // Move elements from container with equal allocator. void _M_move_data(_Rb_tree&, std::true_type); // Move elements from container with possibly non-equal allocator, // which might result in a copy not a move. void _M_move_data(_Rb_tree&, std::false_type); // Move assignment from container with equal allocator. void _M_move_assign(_Rb_tree&, std::true_type); // Move assignment from container with possibly non-equal allocator, // which might result in a copy not a move. void _M_move_assign(_Rb_tree&, std::false_type); #endif # 1280 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 }; template inline bool operator==(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x, const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y) { return __x.size() == __y.size() && std::equal(__x.begin(), __x.end(), __y.begin()); } template inline bool operator<(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x, const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y) { return std::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end()); } template inline bool operator!=(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x, const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y) { return !(__x == __y); } template inline bool operator>(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x, const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y) { return __y < __x; } template inline bool operator<=(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x, const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y) { return !(__y < __x); } template inline bool operator>=(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x, const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y) { return !(__x < __y); } template inline void swap(_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x, _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y) { __x.swap(__y); } #if __cplusplus >= 201103L template _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>:: _Rb_tree(_Rb_tree&& __x, _Node_allocator&& __a) : _M_impl(__x._M_impl._M_key_compare, std::move(__a)) { using __eq = integral_constant; if (__x._M_root() != nullptr) _M_move_data(__x, __eq()); } template void _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>:: _M_move_data(_Rb_tree& __x, std::true_type) { _M_root() = __x._M_root(); _M_leftmost() = __x._M_leftmost(); _M_rightmost() = __x._M_rightmost(); _M_root()->_M_parent = _M_end(); __x._M_root() = 0; __x._M_leftmost() = __x._M_end(); __x._M_rightmost() = __x._M_end(); this->_M_impl._M_node_count = __x._M_impl._M_node_count; __x._M_impl._M_node_count = 0; } template void _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>:: _M_move_data(_Rb_tree& __x, std::false_type) { if (_M_get_Node_allocator() == __x._M_get_Node_allocator()) _M_move_data(__x, std::true_type()); else { _Alloc_node __an(*this); auto __lbd = [&__an](const value_type& __cval) { auto& __val = const_cast(__cval); return __an(std::move_if_noexcept(__val)); }; _M_root() = _M_copy(__x._M_begin(), _M_end(), __lbd); _M_leftmost() = _S_minimum(_M_root()); _M_rightmost() = _S_maximum(_M_root()); _M_impl._M_node_count = __x._M_impl._M_node_count; } } template inline void _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>:: _M_move_assign(_Rb_tree& __x, true_type) { clear(); if (__x._M_root() != nullptr) _M_move_data(__x, std::true_type()); std::__alloc_on_move(_M_get_Node_allocator(), __x._M_get_Node_allocator()); } template void _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>:: _M_move_assign(_Rb_tree& __x, false_type) { if (_M_get_Node_allocator() == __x._M_get_Node_allocator()) return _M_move_assign(__x, true_type{}); // Try to move each node reusing existing nodes and copying __x nodes // structure. _Reuse_or_alloc_node __roan(*this); _M_impl._M_reset(); if (__x._M_root() != nullptr) { auto __lbd = [&__roan](const value_type& __cval) { auto& __val = const_cast(__cval); return __roan(std::move_if_noexcept(__val)); }; _M_root() = _M_copy(__x._M_begin(), _M_end(), __lbd); _M_leftmost() = _S_minimum(_M_root()); _M_rightmost() = _S_maximum(_M_root()); _M_impl._M_node_count = __x._M_impl._M_node_count; __x.clear(); } } template inline _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>:: operator=(_Rb_tree&& __x) noexcept(_Alloc_traits::_S_nothrow_move() && is_nothrow_move_assignable<_Compare>::value) { _M_impl._M_key_compare = __x._M_impl._M_key_compare; constexpr bool __move_storage = _Alloc_traits::_S_propagate_on_move_assign() || _Alloc_traits::_S_always_equal(); _M_move_assign(__x, __bool_constant<__move_storage>()); return *this; } template template void _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>:: _M_assign_unique(_Iterator __first, _Iterator __last) { _Reuse_or_alloc_node __roan(*this); _M_impl._M_reset(); for (; __first != __last; ++__first) _M_insert_unique_(end(), *__first, __roan); } template template void _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>:: _M_assign_equal(_Iterator __first, _Iterator __last) { _Reuse_or_alloc_node __roan(*this); _M_impl._M_reset(); for (; __first != __last; ++__first) _M_insert_equal_(end(), *__first, __roan); } #endif # 1476 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 template _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>:: operator=(const _Rb_tree& __x) { if (this != &__x) { // Note that _Key may be a constant type. #if __cplusplus >= 201103L if (_Alloc_traits::_S_propagate_on_copy_assign()) { auto& __this_alloc = this->_M_get_Node_allocator(); auto& __that_alloc = __x._M_get_Node_allocator(); if (!_Alloc_traits::_S_always_equal() && __this_alloc != __that_alloc) { // Replacement allocator cannot free existing storage, we need // to erase nodes first. clear(); std::__alloc_on_copy(__this_alloc, __that_alloc); } } #endif # 1501 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 _Reuse_or_alloc_node __roan(*this); _M_impl._M_reset(); _M_impl._M_key_compare = __x._M_impl._M_key_compare; if (__x._M_root() != 0) { _M_root() = _M_copy(__x._M_begin(), _M_end(), __roan); _M_leftmost() = _S_minimum(_M_root()); _M_rightmost() = _S_maximum(_M_root()); _M_impl._M_node_count = __x._M_impl._M_node_count; } } return *this; } template #if __cplusplus >= 201103L template #else # 1522 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 template #endif # 1524 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>:: _M_insert_(_Base_ptr __x, _Base_ptr __p, #if __cplusplus >= 201103L _Arg&& __v, #else # 1530 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 const _Val& __v, #endif # 1532 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 _NodeGen& __node_gen) { bool __insert_left = (__x != 0 || __p == _M_end() || _M_impl._M_key_compare(_KeyOfValue()(__v), _S_key(__p))); _Link_type __z = __node_gen(_GLIBCXX_FORWARD(_Arg, __v)); _Rb_tree_insert_and_rebalance(__insert_left, __z, __p, this->_M_impl._M_header); ++_M_impl._M_node_count; return iterator(__z); } template #if __cplusplus >= 201103L template #endif # 1551 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>:: #if __cplusplus >= 201103L _M_insert_lower(_Base_ptr __p, _Arg&& __v) #else # 1556 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 _M_insert_lower(_Base_ptr __p, const _Val& __v) #endif # 1558 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 { bool __insert_left = (__p == _M_end() || !_M_impl._M_key_compare(_S_key(__p), _KeyOfValue()(__v))); _Link_type __z = _M_create_node(_GLIBCXX_FORWARD(_Arg, __v)); _Rb_tree_insert_and_rebalance(__insert_left, __z, __p, this->_M_impl._M_header); ++_M_impl._M_node_count; return iterator(__z); } template #if __cplusplus >= 201103L template #endif # 1576 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>:: #if __cplusplus >= 201103L _M_insert_equal_lower(_Arg&& __v) #else # 1581 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 _M_insert_equal_lower(const _Val& __v) #endif # 1583 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 { _Link_type __x = _M_begin(); _Link_type __y = _M_end(); while (__x != 0) { __y = __x; __x = !_M_impl._M_key_compare(_S_key(__x), _KeyOfValue()(__v)) ? _S_left(__x) : _S_right(__x); } return _M_insert_lower(__y, _GLIBCXX_FORWARD(_Arg, __v)); } template template typename _Rb_tree<_Key, _Val, _KoV, _Compare, _Alloc>::_Link_type _Rb_tree<_Key, _Val, _KoV, _Compare, _Alloc>:: _M_copy(_Const_Link_type __x, _Link_type __p, _NodeGen& __node_gen) { // Structural copy. __x and __p must be non-null. _Link_type __top = _M_clone_node(__x, __node_gen); __top->_M_parent = __p; __try { if (__x->_M_right) __top->_M_right = _M_copy(_S_right(__x), __top, __node_gen); __p = __top; __x = _S_left(__x); while (__x != 0) { _Link_type __y = _M_clone_node(__x, __node_gen); __p->_M_left = __y; __y->_M_parent = __p; if (__x->_M_right) __y->_M_right = _M_copy(_S_right(__x), __y, __node_gen); __p = __y; __x = _S_left(__x); } } __catch(...) { _M_erase(__top); __throw_exception_again; } return __top; } template void _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>:: _M_erase(_Link_type __x) { // Erase without rebalancing. while (__x != 0) { _M_erase(_S_right(__x)); _Link_type __y = _S_left(__x); _M_drop_node(__x); __x = __y; } } template typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>:: _M_lower_bound(_Link_type __x, _Link_type __y, const _Key& __k) { while (__x != 0) if (!_M_impl._M_key_compare(_S_key(__x), __k)) __y = __x, __x = _S_left(__x); else __x = _S_right(__x); return iterator(__y); } template typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::const_iterator _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>:: _M_lower_bound(_Const_Link_type __x, _Const_Link_type __y, const _Key& __k) const { while (__x != 0) if (!_M_impl._M_key_compare(_S_key(__x), __k)) __y = __x, __x = _S_left(__x); else __x = _S_right(__x); return const_iterator(__y); } template typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>:: _M_upper_bound(_Link_type __x, _Link_type __y, const _Key& __k) { while (__x != 0) if (_M_impl._M_key_compare(__k, _S_key(__x))) __y = __x, __x = _S_left(__x); else __x = _S_right(__x); return iterator(__y); } template typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::const_iterator _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>:: _M_upper_bound(_Const_Link_type __x, _Const_Link_type __y, const _Key& __k) const { while (__x != 0) if (_M_impl._M_key_compare(__k, _S_key(__x))) __y = __x, __x = _S_left(__x); else __x = _S_right(__x); return const_iterator(__y); } template pair::iterator, typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator> _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>:: equal_range(const _Key& __k) { _Link_type __x = _M_begin(); _Link_type __y = _M_end(); while (__x != 0) { if (_M_impl._M_key_compare(_S_key(__x), __k)) __x = _S_right(__x); else if (_M_impl._M_key_compare(__k, _S_key(__x))) __y = __x, __x = _S_left(__x); else { _Link_type __xu(__x), __yu(__y); __y = __x, __x = _S_left(__x); __xu = _S_right(__xu); return pair(_M_lower_bound(__x, __y, __k), _M_upper_bound(__xu, __yu, __k)); } } return pair(iterator(__y), iterator(__y)); } template pair::const_iterator, typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::const_iterator> _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>:: equal_range(const _Key& __k) const { _Const_Link_type __x = _M_begin(); _Const_Link_type __y = _M_end(); while (__x != 0) { if (_M_impl._M_key_compare(_S_key(__x), __k)) __x = _S_right(__x); else if (_M_impl._M_key_compare(__k, _S_key(__x))) __y = __x, __x = _S_left(__x); else { _Const_Link_type __xu(__x), __yu(__y); __y = __x, __x = _S_left(__x); __xu = _S_right(__xu); return pair(_M_lower_bound(__x, __y, __k), _M_upper_bound(__xu, __yu, __k)); } } return pair(const_iterator(__y), const_iterator(__y)); } template void _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>:: swap(_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __t) #if __cplusplus >= 201103L noexcept(_Alloc_traits::_S_nothrow_swap()) #endif # 1782 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 { if (_M_root() == 0) { if (__t._M_root() != 0) { _M_root() = __t._M_root(); _M_leftmost() = __t._M_leftmost(); _M_rightmost() = __t._M_rightmost(); _M_root()->_M_parent = _M_end(); _M_impl._M_node_count = __t._M_impl._M_node_count; __t._M_impl._M_reset(); } } else if (__t._M_root() == 0) { __t._M_root() = _M_root(); __t._M_leftmost() = _M_leftmost(); __t._M_rightmost() = _M_rightmost(); __t._M_root()->_M_parent = __t._M_end(); __t._M_impl._M_node_count = _M_impl._M_node_count; _M_impl._M_reset(); } else { std::swap(_M_root(),__t._M_root()); std::swap(_M_leftmost(),__t._M_leftmost()); std::swap(_M_rightmost(),__t._M_rightmost()); _M_root()->_M_parent = _M_end(); __t._M_root()->_M_parent = __t._M_end(); std::swap(this->_M_impl._M_node_count, __t._M_impl._M_node_count); } // No need to swap header's color as it does not change. std::swap(this->_M_impl._M_key_compare, __t._M_impl._M_key_compare); _Alloc_traits::_S_on_swap(_M_get_Node_allocator(), __t._M_get_Node_allocator()); } template pair::_Base_ptr, typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Base_ptr> _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>:: _M_get_insert_unique_pos(const key_type& __k) { typedef pair<_Base_ptr, _Base_ptr> _Res; _Link_type __x = _M_begin(); _Link_type __y = _M_end(); bool __comp = true; while (__x != 0) { __y = __x; __comp = _M_impl._M_key_compare(__k, _S_key(__x)); __x = __comp ? _S_left(__x) : _S_right(__x); } iterator __j = iterator(__y); if (__comp) { if (__j == begin()) return _Res(__x, __y); else --__j; } if (_M_impl._M_key_compare(_S_key(__j._M_node), __k)) return _Res(__x, __y); return _Res(__j._M_node, 0); } template pair::_Base_ptr, typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Base_ptr> _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>:: _M_get_insert_equal_pos(const key_type& __k) { typedef pair<_Base_ptr, _Base_ptr> _Res; _Link_type __x = _M_begin(); _Link_type __y = _M_end(); while (__x != 0) { __y = __x; __x = _M_impl._M_key_compare(__k, _S_key(__x)) ? _S_left(__x) : _S_right(__x); } return _Res(__x, __y); } template #if __cplusplus >= 201103L template #endif # 1881 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 pair::iterator, bool> _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>:: #if __cplusplus >= 201103L _M_insert_unique(_Arg&& __v) #else # 1887 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 _M_insert_unique(const _Val& __v) #endif # 1889 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 { typedef pair _Res; pair<_Base_ptr, _Base_ptr> __res = _M_get_insert_unique_pos(_KeyOfValue()(__v)); if (__res.second) { _Alloc_node __an(*this); return _Res(_M_insert_(__res.first, __res.second, _GLIBCXX_FORWARD(_Arg, __v), __an), true); } return _Res(iterator(static_cast<_Link_type>(__res.first)), false); } template #if __cplusplus >= 201103L template #endif # 1910 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>:: #if __cplusplus >= 201103L _M_insert_equal(_Arg&& __v) #else # 1915 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 _M_insert_equal(const _Val& __v) #endif # 1917 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 { pair<_Base_ptr, _Base_ptr> __res = _M_get_insert_equal_pos(_KeyOfValue()(__v)); _Alloc_node __an(*this); return _M_insert_(__res.first, __res.second, _GLIBCXX_FORWARD(_Arg, __v), __an); } template pair::_Base_ptr, typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Base_ptr> _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>:: _M_get_insert_hint_unique_pos(const_iterator __position, const key_type& __k) { iterator __pos = __position._M_const_cast(); typedef pair<_Base_ptr, _Base_ptr> _Res; // end() if (__pos._M_node == _M_end()) { if (size() > 0 && _M_impl._M_key_compare(_S_key(_M_rightmost()), __k)) return _Res(0, _M_rightmost()); else return _M_get_insert_unique_pos(__k); } else if (_M_impl._M_key_compare(__k, _S_key(__pos._M_node))) { // First, try before... iterator __before = __pos; if (__pos._M_node == _M_leftmost()) // begin() return _Res(_M_leftmost(), _M_leftmost()); else if (_M_impl._M_key_compare(_S_key((--__before)._M_node), __k)) { if (_S_right(__before._M_node) == 0) return _Res(0, __before._M_node); else return _Res(__pos._M_node, __pos._M_node); } else return _M_get_insert_unique_pos(__k); } else if (_M_impl._M_key_compare(_S_key(__pos._M_node), __k)) { // ... then try after. iterator __after = __pos; if (__pos._M_node == _M_rightmost()) return _Res(0, _M_rightmost()); else if (_M_impl._M_key_compare(__k, _S_key((++__after)._M_node))) { if (_S_right(__pos._M_node) == 0) return _Res(0, __pos._M_node); else return _Res(__after._M_node, __after._M_node); } else return _M_get_insert_unique_pos(__k); } else // Equivalent keys. return _Res(__pos._M_node, 0); } template #if __cplusplus >= 201103L template #else # 1989 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 template #endif # 1991 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>:: _M_insert_unique_(const_iterator __position, #if __cplusplus >= 201103L _Arg&& __v, #else # 1997 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 const _Val& __v, #endif # 1999 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 _NodeGen& __node_gen) { pair<_Base_ptr, _Base_ptr> __res = _M_get_insert_hint_unique_pos(__position, _KeyOfValue()(__v)); if (__res.second) return _M_insert_(__res.first, __res.second, _GLIBCXX_FORWARD(_Arg, __v), __node_gen); return iterator(static_cast<_Link_type>(__res.first)); } template pair::_Base_ptr, typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Base_ptr> _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>:: _M_get_insert_hint_equal_pos(const_iterator __position, const key_type& __k) { iterator __pos = __position._M_const_cast(); typedef pair<_Base_ptr, _Base_ptr> _Res; // end() if (__pos._M_node == _M_end()) { if (size() > 0 && !_M_impl._M_key_compare(__k, _S_key(_M_rightmost()))) return _Res(0, _M_rightmost()); else return _M_get_insert_equal_pos(__k); } else if (!_M_impl._M_key_compare(_S_key(__pos._M_node), __k)) { // First, try before... iterator __before = __pos; if (__pos._M_node == _M_leftmost()) // begin() return _Res(_M_leftmost(), _M_leftmost()); else if (!_M_impl._M_key_compare(__k, _S_key((--__before)._M_node))) { if (_S_right(__before._M_node) == 0) return _Res(0, __before._M_node); else return _Res(__pos._M_node, __pos._M_node); } else return _M_get_insert_equal_pos(__k); } else { // ... then try after. iterator __after = __pos; if (__pos._M_node == _M_rightmost()) return _Res(0, _M_rightmost()); else if (!_M_impl._M_key_compare(_S_key((++__after)._M_node), __k)) { if (_S_right(__pos._M_node) == 0) return _Res(0, __pos._M_node); else return _Res(__after._M_node, __after._M_node); } else return _Res(0, 0); } } template #if __cplusplus >= 201103L template #else # 2071 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 template #endif # 2073 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>:: _M_insert_equal_(const_iterator __position, #if __cplusplus >= 201103L _Arg&& __v, #else # 2079 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 const _Val& __v, #endif # 2081 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 _NodeGen& __node_gen) { pair<_Base_ptr, _Base_ptr> __res = _M_get_insert_hint_equal_pos(__position, _KeyOfValue()(__v)); if (__res.second) return _M_insert_(__res.first, __res.second, _GLIBCXX_FORWARD(_Arg, __v), __node_gen); return _M_insert_equal_lower(_GLIBCXX_FORWARD(_Arg, __v)); } #if __cplusplus >= 201103L template typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>:: _M_insert_node(_Base_ptr __x, _Base_ptr __p, _Link_type __z) { bool __insert_left = (__x != 0 || __p == _M_end() || _M_impl._M_key_compare(_S_key(__z), _S_key(__p))); _Rb_tree_insert_and_rebalance(__insert_left, __z, __p, this->_M_impl._M_header); ++_M_impl._M_node_count; return iterator(__z); } template typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>:: _M_insert_lower_node(_Base_ptr __p, _Link_type __z) { bool __insert_left = (__p == _M_end() || !_M_impl._M_key_compare(_S_key(__p), _S_key(__z))); _Rb_tree_insert_and_rebalance(__insert_left, __z, __p, this->_M_impl._M_header); ++_M_impl._M_node_count; return iterator(__z); } template typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>:: _M_insert_equal_lower_node(_Link_type __z) { _Link_type __x = _M_begin(); _Link_type __y = _M_end(); while (__x != 0) { __y = __x; __x = !_M_impl._M_key_compare(_S_key(__x), _S_key(__z)) ? _S_left(__x) : _S_right(__x); } return _M_insert_lower_node(__y, __z); } template template pair::iterator, bool> _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>:: _M_emplace_unique(_Args&&... __args) { _Link_type __z = _M_create_node(std::forward<_Args>(__args)...); __try { typedef pair _Res; auto __res = _M_get_insert_unique_pos(_S_key(__z)); if (__res.second) return _Res(_M_insert_node(__res.first, __res.second, __z), true); _M_drop_node(__z); return _Res(iterator(static_cast<_Link_type>(__res.first)), false); } __catch(...) { _M_drop_node(__z); __throw_exception_again; } } template template typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>:: _M_emplace_equal(_Args&&... __args) { _Link_type __z = _M_create_node(std::forward<_Args>(__args)...); __try { auto __res = _M_get_insert_equal_pos(_S_key(__z)); return _M_insert_node(__res.first, __res.second, __z); } __catch(...) { _M_drop_node(__z); __throw_exception_again; } } template template typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>:: _M_emplace_hint_unique(const_iterator __pos, _Args&&... __args) { _Link_type __z = _M_create_node(std::forward<_Args>(__args)...); __try { auto __res = _M_get_insert_hint_unique_pos(__pos, _S_key(__z)); if (__res.second) return _M_insert_node(__res.first, __res.second, __z); _M_drop_node(__z); return iterator(static_cast<_Link_type>(__res.first)); } __catch(...) { _M_drop_node(__z); __throw_exception_again; } } template template typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>:: _M_emplace_hint_equal(const_iterator __pos, _Args&&... __args) { _Link_type __z = _M_create_node(std::forward<_Args>(__args)...); __try { auto __res = _M_get_insert_hint_equal_pos(__pos, _S_key(__z)); if (__res.second) return _M_insert_node(__res.first, __res.second, __z); return _M_insert_equal_lower_node(__z); } __catch(...) { _M_drop_node(__z); __throw_exception_again; } } #endif # 2243 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 template template void _Rb_tree<_Key, _Val, _KoV, _Cmp, _Alloc>:: _M_insert_unique(_II __first, _II __last) { _Alloc_node __an(*this); for (; __first != __last; ++__first) _M_insert_unique_(end(), *__first, __an); } template template void _Rb_tree<_Key, _Val, _KoV, _Cmp, _Alloc>:: _M_insert_equal(_II __first, _II __last) { _Alloc_node __an(*this); for (; __first != __last; ++__first) _M_insert_equal_(end(), *__first, __an); } template void _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>:: _M_erase_aux(const_iterator __position) { _Link_type __y = static_cast<_Link_type>(_Rb_tree_rebalance_for_erase (const_cast<_Base_ptr>(__position._M_node), this->_M_impl._M_header)); _M_drop_node(__y); --_M_impl._M_node_count; } template void _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>:: _M_erase_aux(const_iterator __first, const_iterator __last) { if (__first == begin() && __last == end()) clear(); else while (__first != __last) erase(__first++); } template typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::size_type _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>:: erase(const _Key& __x) { pair __p = equal_range(__x); const size_type __old_size = size(); erase(__p.first, __p.second); return __old_size - size(); } template void _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>:: erase(const _Key* __first, const _Key* __last) { while (__first != __last) erase(*__first++); } template typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>:: find(const _Key& __k) { iterator __j = _M_lower_bound(_M_begin(), _M_end(), __k); return (__j == end() || _M_impl._M_key_compare(__k, _S_key(__j._M_node))) ? end() : __j; } template typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::const_iterator _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>:: find(const _Key& __k) const { const_iterator __j = _M_lower_bound(_M_begin(), _M_end(), __k); return (__j == end() || _M_impl._M_key_compare(__k, _S_key(__j._M_node))) ? end() : __j; } template typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::size_type _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>:: count(const _Key& __k) const { pair __p = equal_range(__k); const size_type __n = std::distance(__p.first, __p.second); return __n; } _GLIBCXX_PURE unsigned int _Rb_tree_black_count(const _Rb_tree_node_base* __node, const _Rb_tree_node_base* __root) throw (); template bool _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::__rb_verify() const { if (_M_impl._M_node_count == 0 || begin() == end()) return _M_impl._M_node_count == 0 && begin() == end() && this->_M_impl._M_header._M_left == _M_end() && this->_M_impl._M_header._M_right == _M_end(); unsigned int __len = _Rb_tree_black_count(_M_leftmost(), _M_root()); for (const_iterator __it = begin(); __it != end(); ++__it) { _Const_Link_type __x = static_cast<_Const_Link_type>(__it._M_node); _Const_Link_type __L = _S_left(__x); _Const_Link_type __R = _S_right(__x); if (__x->_M_color == _S_red) if ((__L && __L->_M_color == _S_red) || (__R && __R->_M_color == _S_red)) return false; if (__L && _M_impl._M_key_compare(_S_key(__x), _S_key(__L))) return false; if (__R && _M_impl._M_key_compare(_S_key(__R), _S_key(__x))) return false; if (!__L && !__R && _Rb_tree_black_count(__x, _M_root()) != __len) return false; } if (_M_leftmost() != _Rb_tree_node_base::_S_minimum(_M_root())) return false; if (_M_rightmost() != _Rb_tree_node_base::_S_maximum(_M_root())) return false; return true; } _GLIBCXX_END_NAMESPACE_VERSION } // namespace #endif # 2400 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tree.h" 3 # 61 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/set" 2 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 61 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/set" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_set.h" 1 3 // Set implementation -*- C++ -*- // Copyright (C) 2001-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /* * * Copyright (c) 1994 * Hewlett-Packard Company * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Hewlett-Packard Company makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. * * * Copyright (c) 1996,1997 * Silicon Graphics Computer Systems, Inc. * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Silicon Graphics makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. */ /** @file bits/stl_set.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{set} */ #ifndef _STL_SET_H #define _STL_SET_H 1 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 59 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_set.h" 3 # 60 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_set.h" 3 #if __cplusplus >= 201103L #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 61 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_set.h" 3 # 62 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_set.h" 3 #endif # 63 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_set.h" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_CONTAINER /** * @brief A standard container made up of unique keys, which can be * retrieved in logarithmic time. * * @ingroup associative_containers * * @tparam _Key Type of key objects. * @tparam _Compare Comparison function object type, defaults to less<_Key>. * @tparam _Alloc Allocator type, defaults to allocator<_Key>. * * Meets the requirements of a container, a * reversible container, and an * associative container (using unique keys). * * Sets support bidirectional iterators. * * The private tree data is declared exactly the same way for set and * multiset; the distinction is made entirely in how the tree functions are * called (*_unique versus *_equal, same as the standard). */ template, typename _Alloc = std::allocator<_Key> > class set { // concept requirements typedef typename _Alloc::value_type _Alloc_value_type; __glibcxx_class_requires(_Key, _SGIAssignableConcept) __glibcxx_class_requires4(_Compare, bool, _Key, _Key, _BinaryFunctionConcept) __glibcxx_class_requires2(_Key, _Alloc_value_type, _SameTypeConcept) public: // typedefs: //@{ /// Public typedefs. typedef _Key key_type; typedef _Key value_type; typedef _Compare key_compare; typedef _Compare value_compare; typedef _Alloc allocator_type; //@} private: typedef typename __gnu_cxx::__alloc_traits<_Alloc>::template rebind<_Key>::other _Key_alloc_type; typedef _Rb_tree, key_compare, _Key_alloc_type> _Rep_type; _Rep_type _M_t; // Red-black tree representing set. typedef __gnu_cxx::__alloc_traits<_Key_alloc_type> _Alloc_traits; public: //@{ /// Iterator-related typedefs. typedef typename _Alloc_traits::pointer pointer; typedef typename _Alloc_traits::const_pointer const_pointer; typedef typename _Alloc_traits::reference reference; typedef typename _Alloc_traits::const_reference const_reference; // _GLIBCXX_RESOLVE_LIB_DEFECTS // DR 103. set::iterator is required to be modifiable, // but this allows modification of keys. typedef typename _Rep_type::const_iterator iterator; typedef typename _Rep_type::const_iterator const_iterator; typedef typename _Rep_type::const_reverse_iterator reverse_iterator; typedef typename _Rep_type::const_reverse_iterator const_reverse_iterator; typedef typename _Rep_type::size_type size_type; typedef typename _Rep_type::difference_type difference_type; //@} // allocation/deallocation /** * @brief Default constructor creates no elements. */ set() #if __cplusplus >= 201103L noexcept(is_nothrow_default_constructible::value) #endif # 146 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_set.h" 3 : _M_t() { } /** * @brief Creates a %set with no elements. * @param __comp Comparator to use. * @param __a An allocator object. */ explicit set(const _Compare& __comp, const allocator_type& __a = allocator_type()) : _M_t(__comp, _Key_alloc_type(__a)) { } /** * @brief Builds a %set from a range. * @param __first An input iterator. * @param __last An input iterator. * * Create a %set consisting of copies of the elements from * [__first,__last). This is linear in N if the range is * already sorted, and NlogN otherwise (where N is * distance(__first,__last)). */ template set(_InputIterator __first, _InputIterator __last) : _M_t() { _M_t._M_insert_unique(__first, __last); } /** * @brief Builds a %set from a range. * @param __first An input iterator. * @param __last An input iterator. * @param __comp A comparison functor. * @param __a An allocator object. * * Create a %set consisting of copies of the elements from * [__first,__last). This is linear in N if the range is * already sorted, and NlogN otherwise (where N is * distance(__first,__last)). */ template set(_InputIterator __first, _InputIterator __last, const _Compare& __comp, const allocator_type& __a = allocator_type()) : _M_t(__comp, _Key_alloc_type(__a)) { _M_t._M_insert_unique(__first, __last); } /** * @brief %Set copy constructor. * @param __x A %set of identical element and allocator types. * * The newly-created %set uses a copy of the allocation object used * by @a __x. */ set(const set& __x) : _M_t(__x._M_t) { } #if __cplusplus >= 201103L /** * @brief %Set move constructor * @param __x A %set of identical element and allocator types. * * The newly-created %set contains the exact contents of @a x. * The contents of @a x are a valid, but unspecified %set. */ set(set&& __x) noexcept(is_nothrow_copy_constructible<_Compare>::value) : _M_t(std::move(__x._M_t)) { } /** * @brief Builds a %set from an initializer_list. * @param __l An initializer_list. * @param __comp A comparison functor. * @param __a An allocator object. * * Create a %set consisting of copies of the elements in the list. * This is linear in N if the list is already sorted, and NlogN * otherwise (where N is @a __l.size()). */ set(initializer_list __l, const _Compare& __comp = _Compare(), const allocator_type& __a = allocator_type()) : _M_t(__comp, _Key_alloc_type(__a)) { _M_t._M_insert_unique(__l.begin(), __l.end()); } /// Allocator-extended default constructor. explicit set(const allocator_type& __a) : _M_t(_Compare(), _Key_alloc_type(__a)) { } /// Allocator-extended copy constructor. set(const set& __x, const allocator_type& __a) : _M_t(__x._M_t, _Key_alloc_type(__a)) { } /// Allocator-extended move constructor. set(set&& __x, const allocator_type& __a) noexcept(is_nothrow_copy_constructible<_Compare>::value && _Alloc_traits::_S_always_equal()) : _M_t(std::move(__x._M_t), _Key_alloc_type(__a)) { } /// Allocator-extended initialier-list constructor. set(initializer_list __l, const allocator_type& __a) : _M_t(_Compare(), _Key_alloc_type(__a)) { _M_t._M_insert_unique(__l.begin(), __l.end()); } /// Allocator-extended range constructor. template set(_InputIterator __first, _InputIterator __last, const allocator_type& __a) : _M_t(_Compare(), _Key_alloc_type(__a)) { _M_t._M_insert_unique(__first, __last); } #endif # 257 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_set.h" 3 /** * @brief %Set assignment operator. * @param __x A %set of identical element and allocator types. * * All the elements of @a __x are copied, but unlike the copy * constructor, the allocator object is not copied. */ set& operator=(const set& __x) { _M_t = __x._M_t; return *this; } #if __cplusplus >= 201103L /// Move assignment operator. set& operator=(set&&) = default; /** * @brief %Set list assignment operator. * @param __l An initializer_list. * * This function fills a %set with copies of the elements in the * initializer list @a __l. * * Note that the assignment completely changes the %set and * that the resulting %set's size is the same as the number * of elements assigned. Old data may be lost. */ set& operator=(initializer_list __l) { _M_t._M_assign_unique(__l.begin(), __l.end()); return *this; } #endif # 295 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_set.h" 3 // accessors: /// Returns the comparison object with which the %set was constructed. key_compare key_comp() const { return _M_t.key_comp(); } /// Returns the comparison object with which the %set was constructed. value_compare value_comp() const { return _M_t.key_comp(); } /// Returns the allocator object with which the %set was constructed. allocator_type get_allocator() const _GLIBCXX_NOEXCEPT { return allocator_type(_M_t.get_allocator()); } /** * Returns a read-only (constant) iterator that points to the first * element in the %set. Iteration is done in ascending order according * to the keys. */ iterator begin() const _GLIBCXX_NOEXCEPT { return _M_t.begin(); } /** * Returns a read-only (constant) iterator that points one past the last * element in the %set. Iteration is done in ascending order according * to the keys. */ iterator end() const _GLIBCXX_NOEXCEPT { return _M_t.end(); } /** * Returns a read-only (constant) iterator that points to the last * element in the %set. Iteration is done in descending order according * to the keys. */ reverse_iterator rbegin() const _GLIBCXX_NOEXCEPT { return _M_t.rbegin(); } /** * Returns a read-only (constant) reverse iterator that points to the * last pair in the %set. Iteration is done in descending order * according to the keys. */ reverse_iterator rend() const _GLIBCXX_NOEXCEPT { return _M_t.rend(); } #if __cplusplus >= 201103L /** * Returns a read-only (constant) iterator that points to the first * element in the %set. Iteration is done in ascending order according * to the keys. */ iterator cbegin() const noexcept { return _M_t.begin(); } /** * Returns a read-only (constant) iterator that points one past the last * element in the %set. Iteration is done in ascending order according * to the keys. */ iterator cend() const noexcept { return _M_t.end(); } /** * Returns a read-only (constant) iterator that points to the last * element in the %set. Iteration is done in descending order according * to the keys. */ reverse_iterator crbegin() const noexcept { return _M_t.rbegin(); } /** * Returns a read-only (constant) reverse iterator that points to the * last pair in the %set. Iteration is done in descending order * according to the keys. */ reverse_iterator crend() const noexcept { return _M_t.rend(); } #endif # 384 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_set.h" 3 /// Returns true if the %set is empty. bool empty() const _GLIBCXX_NOEXCEPT { return _M_t.empty(); } /// Returns the size of the %set. size_type size() const _GLIBCXX_NOEXCEPT { return _M_t.size(); } /// Returns the maximum size of the %set. size_type max_size() const _GLIBCXX_NOEXCEPT { return _M_t.max_size(); } /** * @brief Swaps data with another %set. * @param __x A %set of the same element and allocator types. * * This exchanges the elements between two sets in constant * time. (It is only swapping a pointer, an integer, and an * instance of the @c Compare type (which itself is often * stateless and empty), so it should be quite fast.) Note * that the global std::swap() function is specialized such * that std::swap(s1,s2) will feed to this function. */ void swap(set& __x) #if __cplusplus >= 201103L noexcept(_Alloc_traits::_S_nothrow_swap()) #endif # 416 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_set.h" 3 { _M_t.swap(__x._M_t); } // insert/erase #if __cplusplus >= 201103L /** * @brief Attempts to build and insert an element into the %set. * @param __args Arguments used to generate an element. * @return A pair, of which the first element is an iterator that points * to the possibly inserted element, and the second is a bool * that is true if the element was actually inserted. * * This function attempts to build and insert an element into the %set. * A %set relies on unique keys and thus an element is only inserted if * it is not already present in the %set. * * Insertion requires logarithmic time. */ template std::pair emplace(_Args&&... __args) { return _M_t._M_emplace_unique(std::forward<_Args>(__args)...); } /** * @brief Attempts to insert an element into the %set. * @param __pos An iterator that serves as a hint as to where the * element should be inserted. * @param __args Arguments used to generate the element to be * inserted. * @return An iterator that points to the element with key equivalent to * the one generated from @a __args (may or may not be the * element itself). * * This function is not concerned about whether the insertion took place, * and thus does not return a boolean like the single-argument emplace() * does. Note that the first parameter is only a hint and can * potentially improve the performance of the insertion process. A bad * hint would cause no gains in efficiency. * * For more on @a hinting, see: * https://gcc.gnu.org/onlinedocs/libstdc++/manual/associative.html#containers.associative.insert_hints * * Insertion requires logarithmic time (if the hint is not taken). */ template iterator emplace_hint(const_iterator __pos, _Args&&... __args) { return _M_t._M_emplace_hint_unique(__pos, std::forward<_Args>(__args)...); } #endif # 467 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_set.h" 3 /** * @brief Attempts to insert an element into the %set. * @param __x Element to be inserted. * @return A pair, of which the first element is an iterator that points * to the possibly inserted element, and the second is a bool * that is true if the element was actually inserted. * * This function attempts to insert an element into the %set. A %set * relies on unique keys and thus an element is only inserted if it is * not already present in the %set. * * Insertion requires logarithmic time. */ std::pair insert(const value_type& __x) { std::pair __p = _M_t._M_insert_unique(__x); return std::pair(__p.first, __p.second); } #if __cplusplus >= 201103L std::pair insert(value_type&& __x) { std::pair __p = _M_t._M_insert_unique(std::move(__x)); return std::pair(__p.first, __p.second); } #endif # 498 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_set.h" 3 /** * @brief Attempts to insert an element into the %set. * @param __position An iterator that serves as a hint as to where the * element should be inserted. * @param __x Element to be inserted. * @return An iterator that points to the element with key of * @a __x (may or may not be the element passed in). * * This function is not concerned about whether the insertion took place, * and thus does not return a boolean like the single-argument insert() * does. Note that the first parameter is only a hint and can * potentially improve the performance of the insertion process. A bad * hint would cause no gains in efficiency. * * For more on @a hinting, see: * https://gcc.gnu.org/onlinedocs/libstdc++/manual/associative.html#containers.associative.insert_hints * * Insertion requires logarithmic time (if the hint is not taken). */ iterator insert(const_iterator __position, const value_type& __x) { return _M_t._M_insert_unique_(__position, __x); } #if __cplusplus >= 201103L iterator insert(const_iterator __position, value_type&& __x) { return _M_t._M_insert_unique_(__position, std::move(__x)); } #endif # 527 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_set.h" 3 /** * @brief A template function that attempts to insert a range * of elements. * @param __first Iterator pointing to the start of the range to be * inserted. * @param __last Iterator pointing to the end of the range. * * Complexity similar to that of the range constructor. */ template void insert(_InputIterator __first, _InputIterator __last) { _M_t._M_insert_unique(__first, __last); } #if __cplusplus >= 201103L /** * @brief Attempts to insert a list of elements into the %set. * @param __l A std::initializer_list of elements * to be inserted. * * Complexity similar to that of the range constructor. */ void insert(initializer_list __l) { this->insert(__l.begin(), __l.end()); } #endif # 554 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_set.h" 3 #if __cplusplus >= 201103L // _GLIBCXX_RESOLVE_LIB_DEFECTS // DR 130. Associative erase should return an iterator. /** * @brief Erases an element from a %set. * @param __position An iterator pointing to the element to be erased. * @return An iterator pointing to the element immediately following * @a __position prior to the element being erased. If no such * element exists, end() is returned. * * This function erases an element, pointed to by the given iterator, * from a %set. Note that this function only erases the element, and * that if the element is itself a pointer, the pointed-to memory is not * touched in any way. Managing the pointer is the user's * responsibility. */ _GLIBCXX_ABI_TAG_CXX11 iterator erase(const_iterator __position) { return _M_t.erase(__position); } #else # 576 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_set.h" 3 /** * @brief Erases an element from a %set. * @param position An iterator pointing to the element to be erased. * * This function erases an element, pointed to by the given iterator, * from a %set. Note that this function only erases the element, and * that if the element is itself a pointer, the pointed-to memory is not * touched in any way. Managing the pointer is the user's * responsibility. */ void erase(iterator __position) { _M_t.erase(__position); } #endif # 590 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_set.h" 3 /** * @brief Erases elements according to the provided key. * @param __x Key of element to be erased. * @return The number of elements erased. * * This function erases all the elements located by the given key from * a %set. * Note that this function only erases the element, and that if * the element is itself a pointer, the pointed-to memory is not touched * in any way. Managing the pointer is the user's responsibility. */ size_type erase(const key_type& __x) { return _M_t.erase(__x); } #if __cplusplus >= 201103L // _GLIBCXX_RESOLVE_LIB_DEFECTS // DR 130. Associative erase should return an iterator. /** * @brief Erases a [__first,__last) range of elements from a %set. * @param __first Iterator pointing to the start of the range to be * erased. * @param __last Iterator pointing to the end of the range to * be erased. * @return The iterator @a __last. * * This function erases a sequence of elements from a %set. * Note that this function only erases the element, and that if * the element is itself a pointer, the pointed-to memory is not touched * in any way. Managing the pointer is the user's responsibility. */ _GLIBCXX_ABI_TAG_CXX11 iterator erase(const_iterator __first, const_iterator __last) { return _M_t.erase(__first, __last); } #else # 628 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_set.h" 3 /** * @brief Erases a [first,last) range of elements from a %set. * @param __first Iterator pointing to the start of the range to be * erased. * @param __last Iterator pointing to the end of the range to * be erased. * * This function erases a sequence of elements from a %set. * Note that this function only erases the element, and that if * the element is itself a pointer, the pointed-to memory is not touched * in any way. Managing the pointer is the user's responsibility. */ void erase(iterator __first, iterator __last) { _M_t.erase(__first, __last); } #endif # 644 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_set.h" 3 /** * Erases all elements in a %set. Note that this function only erases * the elements, and that if the elements themselves are pointers, the * pointed-to memory is not touched in any way. Managing the pointer is * the user's responsibility. */ void clear() _GLIBCXX_NOEXCEPT { _M_t.clear(); } // set operations: //@{ /** * @brief Finds the number of elements. * @param __x Element to located. * @return Number of elements with specified key. * * This function only makes sense for multisets; for set the result will * either be 0 (not present) or 1 (present). */ size_type count(const key_type& __x) const { return _M_t.find(__x) == _M_t.end() ? 0 : 1; } #if __cplusplus > 201103L template auto count(const _Kt& __x) const -> decltype(_M_t._M_count_tr(__x)) { return _M_t._M_find_tr(__x) == _M_t.end() ? 0 : 1; } #endif # 677 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_set.h" 3 //@} // _GLIBCXX_RESOLVE_LIB_DEFECTS // 214. set::find() missing const overload //@{ /** * @brief Tries to locate an element in a %set. * @param __x Element to be located. * @return Iterator pointing to sought-after element, or end() if not * found. * * This function takes a key and tries to locate the element with which * the key matches. If successful the function returns an iterator * pointing to the sought after element. If unsuccessful it returns the * past-the-end ( @c end() ) iterator. */ iterator find(const key_type& __x) { return _M_t.find(__x); } const_iterator find(const key_type& __x) const { return _M_t.find(__x); } #if __cplusplus > 201103L template auto find(const _Kt& __x) -> decltype(iterator{_M_t._M_find_tr(__x)}) { return iterator{_M_t._M_find_tr(__x)}; } template auto find(const _Kt& __x) const -> decltype(const_iterator{_M_t._M_find_tr(__x)}) { return const_iterator{_M_t._M_find_tr(__x)}; } #endif # 714 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_set.h" 3 //@} //@{ /** * @brief Finds the beginning of a subsequence matching given key. * @param __x Key to be located. * @return Iterator pointing to first element equal to or greater * than key, or end(). * * This function returns the first element of a subsequence of elements * that matches the given key. If unsuccessful it returns an iterator * pointing to the first element that has a greater value than given key * or end() if no such element exists. */ iterator lower_bound(const key_type& __x) { return _M_t.lower_bound(__x); } const_iterator lower_bound(const key_type& __x) const { return _M_t.lower_bound(__x); } #if __cplusplus > 201103L template auto lower_bound(const _Kt& __x) -> decltype(_M_t._M_lower_bound_tr(__x)) { return _M_t._M_lower_bound_tr(__x); } template auto lower_bound(const _Kt& __x) const -> decltype(_M_t._M_lower_bound_tr(__x)) { return _M_t._M_lower_bound_tr(__x); } #endif # 749 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_set.h" 3 //@} //@{ /** * @brief Finds the end of a subsequence matching given key. * @param __x Key to be located. * @return Iterator pointing to the first element * greater than key, or end(). */ iterator upper_bound(const key_type& __x) { return _M_t.upper_bound(__x); } const_iterator upper_bound(const key_type& __x) const { return _M_t.upper_bound(__x); } #if __cplusplus > 201103L template auto upper_bound(const _Kt& __x) -> decltype(_M_t._M_upper_bound_tr(__x)) { return _M_t._M_upper_bound_tr(__x); } template auto upper_bound(const _Kt& __x) const -> decltype(_M_t._M_upper_bound_tr(__x)) { return _M_t._M_upper_bound_tr(__x); } #endif # 779 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_set.h" 3 //@} //@{ /** * @brief Finds a subsequence matching given key. * @param __x Key to be located. * @return Pair of iterators that possibly points to the subsequence * matching given key. * * This function is equivalent to * @code * std::make_pair(c.lower_bound(val), * c.upper_bound(val)) * @endcode * (but is faster than making the calls separately). * * This function probably only makes sense for multisets. */ std::pair equal_range(const key_type& __x) { return _M_t.equal_range(__x); } std::pair equal_range(const key_type& __x) const { return _M_t.equal_range(__x); } #if __cplusplus > 201103L template auto equal_range(const _Kt& __x) -> decltype(_M_t._M_equal_range_tr(__x)) { return _M_t._M_equal_range_tr(__x); } template auto equal_range(const _Kt& __x) const -> decltype(_M_t._M_equal_range_tr(__x)) { return _M_t._M_equal_range_tr(__x); } #endif # 818 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_set.h" 3 //@} template friend bool operator==(const set<_K1, _C1, _A1>&, const set<_K1, _C1, _A1>&); template friend bool operator<(const set<_K1, _C1, _A1>&, const set<_K1, _C1, _A1>&); }; /** * @brief Set equality comparison. * @param __x A %set. * @param __y A %set of the same type as @a x. * @return True iff the size and elements of the sets are equal. * * This is an equivalence relation. It is linear in the size of the sets. * Sets are considered equivalent if their sizes are equal, and if * corresponding elements compare equal. */ template inline bool operator==(const set<_Key, _Compare, _Alloc>& __x, const set<_Key, _Compare, _Alloc>& __y) { return __x._M_t == __y._M_t; } /** * @brief Set ordering relation. * @param __x A %set. * @param __y A %set of the same type as @a x. * @return True iff @a __x is lexicographically less than @a __y. * * This is a total ordering relation. It is linear in the size of the * sets. The elements must be comparable with @c <. * * See std::lexicographical_compare() for how the determination is made. */ template inline bool operator<(const set<_Key, _Compare, _Alloc>& __x, const set<_Key, _Compare, _Alloc>& __y) { return __x._M_t < __y._M_t; } /// Returns !(x == y). template inline bool operator!=(const set<_Key, _Compare, _Alloc>& __x, const set<_Key, _Compare, _Alloc>& __y) { return !(__x == __y); } /// Returns y < x. template inline bool operator>(const set<_Key, _Compare, _Alloc>& __x, const set<_Key, _Compare, _Alloc>& __y) { return __y < __x; } /// Returns !(y < x) template inline bool operator<=(const set<_Key, _Compare, _Alloc>& __x, const set<_Key, _Compare, _Alloc>& __y) { return !(__y < __x); } /// Returns !(x < y) template inline bool operator>=(const set<_Key, _Compare, _Alloc>& __x, const set<_Key, _Compare, _Alloc>& __y) { return !(__x < __y); } /// See std::set::swap(). template inline void swap(set<_Key, _Compare, _Alloc>& __x, set<_Key, _Compare, _Alloc>& __y) { __x.swap(__y); } _GLIBCXX_END_NAMESPACE_CONTAINER } //namespace std #endif /* _STL_SET_H */ # 900 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_set.h" 3 # 62 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/set" 2 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 62 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/set" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_multiset.h" 1 3 // Multiset implementation -*- C++ -*- // Copyright (C) 2001-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /* * * Copyright (c) 1994 * Hewlett-Packard Company * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Hewlett-Packard Company makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. * * * Copyright (c) 1996 * Silicon Graphics Computer Systems, Inc. * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Silicon Graphics makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. */ /** @file bits/stl_multiset.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{set} */ #ifndef _STL_MULTISET_H #define _STL_MULTISET_H 1 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 59 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_multiset.h" 3 # 60 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_multiset.h" 3 #if __cplusplus >= 201103L #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 61 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_multiset.h" 3 # 62 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_multiset.h" 3 #endif # 63 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_multiset.h" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_CONTAINER /** * @brief A standard container made up of elements, which can be retrieved * in logarithmic time. * * @ingroup associative_containers * * * @tparam _Key Type of key objects. * @tparam _Compare Comparison function object type, defaults to less<_Key>. * @tparam _Alloc Allocator type, defaults to allocator<_Key>. * * Meets the requirements of a container, a * reversible container, and an * associative container (using equivalent * keys). For a @c multiset the key_type and value_type are Key. * * Multisets support bidirectional iterators. * * The private tree data is declared exactly the same way for set and * multiset; the distinction is made entirely in how the tree functions are * called (*_unique versus *_equal, same as the standard). */ template , typename _Alloc = std::allocator<_Key> > class multiset { // concept requirements typedef typename _Alloc::value_type _Alloc_value_type; __glibcxx_class_requires(_Key, _SGIAssignableConcept) __glibcxx_class_requires4(_Compare, bool, _Key, _Key, _BinaryFunctionConcept) __glibcxx_class_requires2(_Key, _Alloc_value_type, _SameTypeConcept) public: // typedefs: typedef _Key key_type; typedef _Key value_type; typedef _Compare key_compare; typedef _Compare value_compare; typedef _Alloc allocator_type; private: /// This turns a red-black tree into a [multi]set. typedef typename __gnu_cxx::__alloc_traits<_Alloc>::template rebind<_Key>::other _Key_alloc_type; typedef _Rb_tree, key_compare, _Key_alloc_type> _Rep_type; /// The actual tree structure. _Rep_type _M_t; typedef __gnu_cxx::__alloc_traits<_Key_alloc_type> _Alloc_traits; public: typedef typename _Alloc_traits::pointer pointer; typedef typename _Alloc_traits::const_pointer const_pointer; typedef typename _Alloc_traits::reference reference; typedef typename _Alloc_traits::const_reference const_reference; // _GLIBCXX_RESOLVE_LIB_DEFECTS // DR 103. set::iterator is required to be modifiable, // but this allows modification of keys. typedef typename _Rep_type::const_iterator iterator; typedef typename _Rep_type::const_iterator const_iterator; typedef typename _Rep_type::const_reverse_iterator reverse_iterator; typedef typename _Rep_type::const_reverse_iterator const_reverse_iterator; typedef typename _Rep_type::size_type size_type; typedef typename _Rep_type::difference_type difference_type; // allocation/deallocation /** * @brief Default constructor creates no elements. */ multiset() #if __cplusplus >= 201103L noexcept(is_nothrow_default_constructible::value) #endif # 144 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_multiset.h" 3 : _M_t() { } /** * @brief Creates a %multiset with no elements. * @param __comp Comparator to use. * @param __a An allocator object. */ explicit multiset(const _Compare& __comp, const allocator_type& __a = allocator_type()) : _M_t(__comp, _Key_alloc_type(__a)) { } /** * @brief Builds a %multiset from a range. * @param __first An input iterator. * @param __last An input iterator. * * Create a %multiset consisting of copies of the elements from * [first,last). This is linear in N if the range is already sorted, * and NlogN otherwise (where N is distance(__first,__last)). */ template multiset(_InputIterator __first, _InputIterator __last) : _M_t() { _M_t._M_insert_equal(__first, __last); } /** * @brief Builds a %multiset from a range. * @param __first An input iterator. * @param __last An input iterator. * @param __comp A comparison functor. * @param __a An allocator object. * * Create a %multiset consisting of copies of the elements from * [__first,__last). This is linear in N if the range is already sorted, * and NlogN otherwise (where N is distance(__first,__last)). */ template multiset(_InputIterator __first, _InputIterator __last, const _Compare& __comp, const allocator_type& __a = allocator_type()) : _M_t(__comp, _Key_alloc_type(__a)) { _M_t._M_insert_equal(__first, __last); } /** * @brief %Multiset copy constructor. * @param __x A %multiset of identical element and allocator types. * * The newly-created %multiset uses a copy of the allocation object used * by @a __x. */ multiset(const multiset& __x) : _M_t(__x._M_t) { } #if __cplusplus >= 201103L /** * @brief %Multiset move constructor. * @param __x A %multiset of identical element and allocator types. * * The newly-created %multiset contains the exact contents of @a __x. * The contents of @a __x are a valid, but unspecified %multiset. */ multiset(multiset&& __x) noexcept(is_nothrow_copy_constructible<_Compare>::value) : _M_t(std::move(__x._M_t)) { } /** * @brief Builds a %multiset from an initializer_list. * @param __l An initializer_list. * @param __comp A comparison functor. * @param __a An allocator object. * * Create a %multiset consisting of copies of the elements from * the list. This is linear in N if the list is already sorted, * and NlogN otherwise (where N is @a __l.size()). */ multiset(initializer_list __l, const _Compare& __comp = _Compare(), const allocator_type& __a = allocator_type()) : _M_t(__comp, _Key_alloc_type(__a)) { _M_t._M_insert_equal(__l.begin(), __l.end()); } /// Allocator-extended default constructor. explicit multiset(const allocator_type& __a) : _M_t(_Compare(), _Key_alloc_type(__a)) { } /// Allocator-extended copy constructor. multiset(const multiset& __m, const allocator_type& __a) : _M_t(__m._M_t, _Key_alloc_type(__a)) { } /// Allocator-extended move constructor. multiset(multiset&& __m, const allocator_type& __a) noexcept(is_nothrow_copy_constructible<_Compare>::value && _Alloc_traits::_S_always_equal()) : _M_t(std::move(__m._M_t), _Key_alloc_type(__a)) { } /// Allocator-extended initialier-list constructor. multiset(initializer_list __l, const allocator_type& __a) : _M_t(_Compare(), _Key_alloc_type(__a)) { _M_t._M_insert_equal(__l.begin(), __l.end()); } /// Allocator-extended range constructor. template multiset(_InputIterator __first, _InputIterator __last, const allocator_type& __a) : _M_t(_Compare(), _Key_alloc_type(__a)) { _M_t._M_insert_equal(__first, __last); } #endif # 253 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_multiset.h" 3 /** * @brief %Multiset assignment operator. * @param __x A %multiset of identical element and allocator types. * * All the elements of @a __x are copied, but unlike the copy * constructor, the allocator object is not copied. */ multiset& operator=(const multiset& __x) { _M_t = __x._M_t; return *this; } #if __cplusplus >= 201103L /// Move assignment operator. multiset& operator=(multiset&&) = default; /** * @brief %Multiset list assignment operator. * @param __l An initializer_list. * * This function fills a %multiset with copies of the elements in the * initializer list @a __l. * * Note that the assignment completely changes the %multiset and * that the resulting %multiset's size is the same as the number * of elements assigned. Old data may be lost. */ multiset& operator=(initializer_list __l) { _M_t._M_assign_equal(__l.begin(), __l.end()); return *this; } #endif # 291 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_multiset.h" 3 // accessors: /// Returns the comparison object. key_compare key_comp() const { return _M_t.key_comp(); } /// Returns the comparison object. value_compare value_comp() const { return _M_t.key_comp(); } /// Returns the memory allocation object. allocator_type get_allocator() const _GLIBCXX_NOEXCEPT { return allocator_type(_M_t.get_allocator()); } /** * Returns a read-only (constant) iterator that points to the first * element in the %multiset. Iteration is done in ascending order * according to the keys. */ iterator begin() const _GLIBCXX_NOEXCEPT { return _M_t.begin(); } /** * Returns a read-only (constant) iterator that points one past the last * element in the %multiset. Iteration is done in ascending order * according to the keys. */ iterator end() const _GLIBCXX_NOEXCEPT { return _M_t.end(); } /** * Returns a read-only (constant) reverse iterator that points to the * last element in the %multiset. Iteration is done in descending order * according to the keys. */ reverse_iterator rbegin() const _GLIBCXX_NOEXCEPT { return _M_t.rbegin(); } /** * Returns a read-only (constant) reverse iterator that points to the * last element in the %multiset. Iteration is done in descending order * according to the keys. */ reverse_iterator rend() const _GLIBCXX_NOEXCEPT { return _M_t.rend(); } #if __cplusplus >= 201103L /** * Returns a read-only (constant) iterator that points to the first * element in the %multiset. Iteration is done in ascending order * according to the keys. */ iterator cbegin() const noexcept { return _M_t.begin(); } /** * Returns a read-only (constant) iterator that points one past the last * element in the %multiset. Iteration is done in ascending order * according to the keys. */ iterator cend() const noexcept { return _M_t.end(); } /** * Returns a read-only (constant) reverse iterator that points to the * last element in the %multiset. Iteration is done in descending order * according to the keys. */ reverse_iterator crbegin() const noexcept { return _M_t.rbegin(); } /** * Returns a read-only (constant) reverse iterator that points to the * last element in the %multiset. Iteration is done in descending order * according to the keys. */ reverse_iterator crend() const noexcept { return _M_t.rend(); } #endif # 380 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_multiset.h" 3 /// Returns true if the %set is empty. bool empty() const _GLIBCXX_NOEXCEPT { return _M_t.empty(); } /// Returns the size of the %set. size_type size() const _GLIBCXX_NOEXCEPT { return _M_t.size(); } /// Returns the maximum size of the %set. size_type max_size() const _GLIBCXX_NOEXCEPT { return _M_t.max_size(); } /** * @brief Swaps data with another %multiset. * @param __x A %multiset of the same element and allocator types. * * This exchanges the elements between two multisets in constant time. * (It is only swapping a pointer, an integer, and an instance of the @c * Compare type (which itself is often stateless and empty), so it should * be quite fast.) * Note that the global std::swap() function is specialized such that * std::swap(s1,s2) will feed to this function. */ void swap(multiset& __x) #if __cplusplus >= 201103L noexcept(_Alloc_traits::_S_nothrow_swap()) #endif # 412 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_multiset.h" 3 { _M_t.swap(__x._M_t); } // insert/erase #if __cplusplus >= 201103L /** * @brief Builds and inserts an element into the %multiset. * @param __args Arguments used to generate the element instance to be * inserted. * @return An iterator that points to the inserted element. * * This function inserts an element into the %multiset. Contrary * to a std::set the %multiset does not rely on unique keys and thus * multiple copies of the same element can be inserted. * * Insertion requires logarithmic time. */ template iterator emplace(_Args&&... __args) { return _M_t._M_emplace_equal(std::forward<_Args>(__args)...); } /** * @brief Builds and inserts an element into the %multiset. * @param __pos An iterator that serves as a hint as to where the * element should be inserted. * @param __args Arguments used to generate the element instance to be * inserted. * @return An iterator that points to the inserted element. * * This function inserts an element into the %multiset. Contrary * to a std::set the %multiset does not rely on unique keys and thus * multiple copies of the same element can be inserted. * * Note that the first parameter is only a hint and can potentially * improve the performance of the insertion process. A bad hint would * cause no gains in efficiency. * * See https://gcc.gnu.org/onlinedocs/libstdc++/manual/associative.html#containers.associative.insert_hints * for more on @a hinting. * * Insertion requires logarithmic time (if the hint is not taken). */ template iterator emplace_hint(const_iterator __pos, _Args&&... __args) { return _M_t._M_emplace_hint_equal(__pos, std::forward<_Args>(__args)...); } #endif # 462 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_multiset.h" 3 /** * @brief Inserts an element into the %multiset. * @param __x Element to be inserted. * @return An iterator that points to the inserted element. * * This function inserts an element into the %multiset. Contrary * to a std::set the %multiset does not rely on unique keys and thus * multiple copies of the same element can be inserted. * * Insertion requires logarithmic time. */ iterator insert(const value_type& __x) { return _M_t._M_insert_equal(__x); } #if __cplusplus >= 201103L iterator insert(value_type&& __x) { return _M_t._M_insert_equal(std::move(__x)); } #endif # 483 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_multiset.h" 3 /** * @brief Inserts an element into the %multiset. * @param __position An iterator that serves as a hint as to where the * element should be inserted. * @param __x Element to be inserted. * @return An iterator that points to the inserted element. * * This function inserts an element into the %multiset. Contrary * to a std::set the %multiset does not rely on unique keys and thus * multiple copies of the same element can be inserted. * * Note that the first parameter is only a hint and can potentially * improve the performance of the insertion process. A bad hint would * cause no gains in efficiency. * * See https://gcc.gnu.org/onlinedocs/libstdc++/manual/associative.html#containers.associative.insert_hints * for more on @a hinting. * * Insertion requires logarithmic time (if the hint is not taken). */ iterator insert(const_iterator __position, const value_type& __x) { return _M_t._M_insert_equal_(__position, __x); } #if __cplusplus >= 201103L iterator insert(const_iterator __position, value_type&& __x) { return _M_t._M_insert_equal_(__position, std::move(__x)); } #endif # 513 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_multiset.h" 3 /** * @brief A template function that tries to insert a range of elements. * @param __first Iterator pointing to the start of the range to be * inserted. * @param __last Iterator pointing to the end of the range. * * Complexity similar to that of the range constructor. */ template void insert(_InputIterator __first, _InputIterator __last) { _M_t._M_insert_equal(__first, __last); } #if __cplusplus >= 201103L /** * @brief Attempts to insert a list of elements into the %multiset. * @param __l A std::initializer_list of elements * to be inserted. * * Complexity similar to that of the range constructor. */ void insert(initializer_list __l) { this->insert(__l.begin(), __l.end()); } #endif # 539 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_multiset.h" 3 #if __cplusplus >= 201103L // _GLIBCXX_RESOLVE_LIB_DEFECTS // DR 130. Associative erase should return an iterator. /** * @brief Erases an element from a %multiset. * @param __position An iterator pointing to the element to be erased. * @return An iterator pointing to the element immediately following * @a position prior to the element being erased. If no such * element exists, end() is returned. * * This function erases an element, pointed to by the given iterator, * from a %multiset. Note that this function only erases the element, * and that if the element is itself a pointer, the pointed-to memory is * not touched in any way. Managing the pointer is the user's * responsibility. */ _GLIBCXX_ABI_TAG_CXX11 iterator erase(const_iterator __position) { return _M_t.erase(__position); } #else # 561 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_multiset.h" 3 /** * @brief Erases an element from a %multiset. * @param __position An iterator pointing to the element to be erased. * * This function erases an element, pointed to by the given iterator, * from a %multiset. Note that this function only erases the element, * and that if the element is itself a pointer, the pointed-to memory is * not touched in any way. Managing the pointer is the user's * responsibility. */ void erase(iterator __position) { _M_t.erase(__position); } #endif # 575 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_multiset.h" 3 /** * @brief Erases elements according to the provided key. * @param __x Key of element to be erased. * @return The number of elements erased. * * This function erases all elements located by the given key from a * %multiset. * Note that this function only erases the element, and that if * the element is itself a pointer, the pointed-to memory is not touched * in any way. Managing the pointer is the user's responsibility. */ size_type erase(const key_type& __x) { return _M_t.erase(__x); } #if __cplusplus >= 201103L // _GLIBCXX_RESOLVE_LIB_DEFECTS // DR 130. Associative erase should return an iterator. /** * @brief Erases a [first,last) range of elements from a %multiset. * @param __first Iterator pointing to the start of the range to be * erased. * @param __last Iterator pointing to the end of the range to * be erased. * @return The iterator @a last. * * This function erases a sequence of elements from a %multiset. * Note that this function only erases the elements, and that if * the elements themselves are pointers, the pointed-to memory is not * touched in any way. Managing the pointer is the user's * responsibility. */ _GLIBCXX_ABI_TAG_CXX11 iterator erase(const_iterator __first, const_iterator __last) { return _M_t.erase(__first, __last); } #else # 613 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_multiset.h" 3 /** * @brief Erases a [first,last) range of elements from a %multiset. * @param first Iterator pointing to the start of the range to be * erased. * @param last Iterator pointing to the end of the range to be erased. * * This function erases a sequence of elements from a %multiset. * Note that this function only erases the elements, and that if * the elements themselves are pointers, the pointed-to memory is not * touched in any way. Managing the pointer is the user's * responsibility. */ void erase(iterator __first, iterator __last) { _M_t.erase(__first, __last); } #endif # 629 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_multiset.h" 3 /** * Erases all elements in a %multiset. Note that this function only * erases the elements, and that if the elements themselves are pointers, * the pointed-to memory is not touched in any way. Managing the pointer * is the user's responsibility. */ void clear() _GLIBCXX_NOEXCEPT { _M_t.clear(); } // multiset operations: //@{ /** * @brief Finds the number of elements with given key. * @param __x Key of elements to be located. * @return Number of elements with specified key. */ size_type count(const key_type& __x) const { return _M_t.count(__x); } #if __cplusplus > 201103L template auto count(const _Kt& __x) const -> decltype(_M_t._M_count_tr(__x)) { return _M_t._M_count_tr(__x); } #endif # 658 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_multiset.h" 3 //@} // _GLIBCXX_RESOLVE_LIB_DEFECTS // 214. set::find() missing const overload //@{ /** * @brief Tries to locate an element in a %set. * @param __x Element to be located. * @return Iterator pointing to sought-after element, or end() if not * found. * * This function takes a key and tries to locate the element with which * the key matches. If successful the function returns an iterator * pointing to the sought after element. If unsuccessful it returns the * past-the-end ( @c end() ) iterator. */ iterator find(const key_type& __x) { return _M_t.find(__x); } const_iterator find(const key_type& __x) const { return _M_t.find(__x); } #if __cplusplus > 201103L template auto find(const _Kt& __x) -> decltype(iterator{_M_t._M_find_tr(__x)}) { return iterator{_M_t._M_find_tr(__x)}; } template auto find(const _Kt& __x) const -> decltype(const_iterator{_M_t._M_find_tr(__x)}) { return const_iterator{_M_t._M_find_tr(__x)}; } #endif # 695 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_multiset.h" 3 //@} //@{ /** * @brief Finds the beginning of a subsequence matching given key. * @param __x Key to be located. * @return Iterator pointing to first element equal to or greater * than key, or end(). * * This function returns the first element of a subsequence of elements * that matches the given key. If unsuccessful it returns an iterator * pointing to the first element that has a greater value than given key * or end() if no such element exists. */ iterator lower_bound(const key_type& __x) { return _M_t.lower_bound(__x); } const_iterator lower_bound(const key_type& __x) const { return _M_t.lower_bound(__x); } #if __cplusplus > 201103L template auto lower_bound(const _Kt& __x) -> decltype(_M_t._M_lower_bound_tr(__x)) { return _M_t._M_lower_bound_tr(__x); } template auto lower_bound(const _Kt& __x) const -> decltype(_M_t._M_lower_bound_tr(__x)) { return _M_t._M_lower_bound_tr(__x); } #endif # 730 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_multiset.h" 3 //@} //@{ /** * @brief Finds the end of a subsequence matching given key. * @param __x Key to be located. * @return Iterator pointing to the first element * greater than key, or end(). */ iterator upper_bound(const key_type& __x) { return _M_t.upper_bound(__x); } const_iterator upper_bound(const key_type& __x) const { return _M_t.upper_bound(__x); } #if __cplusplus > 201103L template auto upper_bound(const _Kt& __x) -> decltype(_M_t._M_upper_bound_tr(__x)) { return _M_t._M_upper_bound_tr(__x); } template auto upper_bound(const _Kt& __x) const -> decltype(_M_t._M_upper_bound_tr(__x)) { return _M_t._M_upper_bound_tr(__x); } #endif # 760 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_multiset.h" 3 //@} //@{ /** * @brief Finds a subsequence matching given key. * @param __x Key to be located. * @return Pair of iterators that possibly points to the subsequence * matching given key. * * This function is equivalent to * @code * std::make_pair(c.lower_bound(val), * c.upper_bound(val)) * @endcode * (but is faster than making the calls separately). * * This function probably only makes sense for multisets. */ std::pair equal_range(const key_type& __x) { return _M_t.equal_range(__x); } std::pair equal_range(const key_type& __x) const { return _M_t.equal_range(__x); } #if __cplusplus > 201103L template auto equal_range(const _Kt& __x) -> decltype(_M_t._M_equal_range_tr(__x)) { return _M_t._M_equal_range_tr(__x); } template auto equal_range(const _Kt& __x) const -> decltype(_M_t._M_equal_range_tr(__x)) { return _M_t._M_equal_range_tr(__x); } #endif # 799 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_multiset.h" 3 //@} template friend bool operator==(const multiset<_K1, _C1, _A1>&, const multiset<_K1, _C1, _A1>&); template friend bool operator< (const multiset<_K1, _C1, _A1>&, const multiset<_K1, _C1, _A1>&); }; /** * @brief Multiset equality comparison. * @param __x A %multiset. * @param __y A %multiset of the same type as @a __x. * @return True iff the size and elements of the multisets are equal. * * This is an equivalence relation. It is linear in the size of the * multisets. * Multisets are considered equivalent if their sizes are equal, and if * corresponding elements compare equal. */ template inline bool operator==(const multiset<_Key, _Compare, _Alloc>& __x, const multiset<_Key, _Compare, _Alloc>& __y) { return __x._M_t == __y._M_t; } /** * @brief Multiset ordering relation. * @param __x A %multiset. * @param __y A %multiset of the same type as @a __x. * @return True iff @a __x is lexicographically less than @a __y. * * This is a total ordering relation. It is linear in the size of the * sets. The elements must be comparable with @c <. * * See std::lexicographical_compare() for how the determination is made. */ template inline bool operator<(const multiset<_Key, _Compare, _Alloc>& __x, const multiset<_Key, _Compare, _Alloc>& __y) { return __x._M_t < __y._M_t; } /// Returns !(x == y). template inline bool operator!=(const multiset<_Key, _Compare, _Alloc>& __x, const multiset<_Key, _Compare, _Alloc>& __y) { return !(__x == __y); } /// Returns y < x. template inline bool operator>(const multiset<_Key,_Compare,_Alloc>& __x, const multiset<_Key,_Compare,_Alloc>& __y) { return __y < __x; } /// Returns !(y < x) template inline bool operator<=(const multiset<_Key, _Compare, _Alloc>& __x, const multiset<_Key, _Compare, _Alloc>& __y) { return !(__y < __x); } /// Returns !(x < y) template inline bool operator>=(const multiset<_Key, _Compare, _Alloc>& __x, const multiset<_Key, _Compare, _Alloc>& __y) { return !(__x < __y); } /// See std::multiset::swap(). template inline void swap(multiset<_Key, _Compare, _Alloc>& __x, multiset<_Key, _Compare, _Alloc>& __y) { __x.swap(__y); } _GLIBCXX_END_NAMESPACE_CONTAINER } // namespace std #endif /* _STL_MULTISET_H */ # 885 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_multiset.h" 3 # 63 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/set" 2 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 63 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/set" 3 # 64 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/set" 3 #ifdef _GLIBCXX_DEBUG #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 66 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/set" 3 # 67 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/set" 3 #endif # 68 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/set" 3 #ifdef _GLIBCXX_PROFILE #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 70 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/set" 3 # 71 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/set" 3 #endif # 72 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/set" 3 #endif /* _GLIBCXX_SET */ # 74 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/set" 3 # 8 "test2.cpp" 2 // #include #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 9 "test2.cpp" # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ctime" 1 3 // -*- C++ -*- forwarding header. // Copyright (C) 1997-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file include/ctime * This is a Standard C++ Library file. You should @c \#include this file * in your programs, rather than any of the @a *.h implementation files. * * This is the C++ version of the Standard C Library header @c time.h, * and its contents are (mostly) the same as that header, but are all * contained in the namespace @c std (except for names which are defined * as macros in C). */ // // ISO C++ 14882: 20.5 Date and time // #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ctime" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ctime" 3 # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ctime" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ctime" 3 # 43 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ctime" 3 #ifndef _GLIBCXX_CTIME #define _GLIBCXX_CTIME 1 // Get rid of those macros defined in in lieu of real functions. #undef clock #undef difftime #undef mktime #undef time #undef asctime #undef ctime #undef gmtime #undef localtime #undef strftime namespace std { using ::clock_t; using ::time_t; using ::tm; using ::clock; using ::difftime; using ::mktime; using ::time; using ::asctime; using ::ctime; using ::gmtime; using ::localtime; using ::strftime; } // namespace #endif # 76 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ctime" 3 # 10 "test2.cpp" 2 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 10 "test2.cpp" # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/iostream" 1 3 // Standard iostream objects -*- C++ -*- // Copyright (C) 1997-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file include/iostream * This is a Standard C++ Library header. */ // // ISO C++ 14882: 27.3 Standard iostream objects // #ifndef _GLIBCXX_IOSTREAM #define _GLIBCXX_IOSTREAM 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 37 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/iostream" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 38 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/iostream" 3 # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/iostream" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/iostream" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ostream" 1 3 // Output streams -*- C++ -*- // Copyright (C) 1997-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file include/ostream * This is a Standard C++ Library header. */ // // ISO C++ 14882: 27.6.2 Output streams // #ifndef _GLIBCXX_OSTREAM #define _GLIBCXX_OSTREAM 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 37 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ostream" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 38 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ostream" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ios" 1 3 // Iostreams base classes -*- C++ -*- // Copyright (C) 1997-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file include/ios * This is a Standard C++ Library header. */ // // ISO C++ 14882: 27.4 Iostreams base classes // #ifndef _GLIBCXX_IOS #define _GLIBCXX_IOS 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 37 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ios" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 38 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ios" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/iosfwd" 1 3 // Forward declarations -*- C++ -*- // Copyright (C) 1997-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file include/iosfwd * This is a Standard C++ Library header. */ // // ISO C++ 14882: 27.2 Forward declarations // #ifndef _GLIBCXX_IOSFWD #define _GLIBCXX_IOSFWD 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 37 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/iosfwd" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 38 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/iosfwd" 3 # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/iosfwd" 3 #if 0 /* expanded by -frewrite-includes */ #include // For string forward declarations. #endif /* expanded by -frewrite-includes */ # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/iosfwd" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stringfwd.h" 1 3 // Forward declarations -*- C++ -*- // Copyright (C) 2001-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file bits/stringfwd.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{string} */ // // ISO C++ 14882: 21 Strings library // #ifndef _STRINGFWD_H #define _STRINGFWD_H 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 38 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stringfwd.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stringfwd.h" 3 # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stringfwd.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stringfwd.h" 3 # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stringfwd.h" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION /** * @defgroup strings Strings * * @{ */ template struct char_traits; template<> struct char_traits; #ifdef _GLIBCXX_USE_WCHAR_T template<> struct char_traits; #endif # 60 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stringfwd.h" 3 #if ((__cplusplus >= 201103L) \ && defined(_GLIBCXX_USE_C99_STDINT_TR1)) template<> struct char_traits; template<> struct char_traits; #endif # 66 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stringfwd.h" 3 _GLIBCXX_BEGIN_NAMESPACE_CXX11 template, typename _Alloc = allocator<_CharT> > class basic_string; /// A string of @c char typedef basic_string string; #ifdef _GLIBCXX_USE_WCHAR_T /// A string of @c wchar_t typedef basic_string wstring; #endif # 80 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stringfwd.h" 3 #if ((__cplusplus >= 201103L) \ && defined(_GLIBCXX_USE_C99_STDINT_TR1)) /// A string of @c char16_t typedef basic_string u16string; /// A string of @c char32_t typedef basic_string u32string; #endif # 89 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stringfwd.h" 3 _GLIBCXX_END_NAMESPACE_CXX11 /** @} */ _GLIBCXX_END_NAMESPACE_VERSION } // namespace std #endif // _STRINGFWD_H # 98 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stringfwd.h" 3 # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/iosfwd" 2 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/iosfwd" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/postypes.h" 1 3 // Position types -*- C++ -*- // Copyright (C) 1997-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file bits/postypes.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{iosfwd} */ // // ISO C++ 14882: 27.4.1 - Types // ISO C++ 14882: 27.4.3 - Template class fpos // #ifndef _GLIBCXX_POSTYPES_H #define _GLIBCXX_POSTYPES_H 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/postypes.h" 3 #if 0 /* expanded by -frewrite-includes */ #include // For mbstate_t #endif /* expanded by -frewrite-includes */ # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/postypes.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 1 3 // -*- C++ -*- forwarding header. // Copyright (C) 1997-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file include/cwchar * This is a Standard C++ Library file. You should @c \#include this file * in your programs, rather than any of the @a *.h implementation files. * * This is the C++ version of the Standard C Library header @c wchar.h, * and its contents are (mostly) the same as that header, but are all * contained in the namespace @c std (except for names which are defined * as macros in C). */ // // ISO C++ 14882: 21.4 // #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #if _GLIBCXX_HAVE_WCHAR_H #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 44 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 # 1 "/usr/include/wchar.h" 1 3 4 /* Copyright (C) 1995-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard: 7.24 * Extended multibyte and wide character utilities */ #ifndef _WCHAR_H #if !defined __need_mbstate_t && !defined __need_wint_t # define _WCHAR_H 1 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 27 "/usr/include/wchar.h" 3 4 # 28 "/usr/include/wchar.h" 3 4 #endif # 29 "/usr/include/wchar.h" 3 4 #ifdef _WCHAR_H /* Get FILE definition. */ # define __need___FILE # if defined __USE_UNIX98 || defined __USE_XOPEN2K # define __need_FILE # endif # 36 "/usr/include/wchar.h" 3 4 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 36 "/usr/include/wchar.h" 3 4 # 37 "/usr/include/wchar.h" 3 4 /* Get va_list definition. */ # define __need___va_list #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 39 "/usr/include/wchar.h" 3 4 # 40 "/usr/include/wchar.h" 3 4 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 41 "/usr/include/wchar.h" 3 4 # 42 "/usr/include/wchar.h" 3 4 /* Get size_t, wchar_t, wint_t and NULL from . */ # define __need_size_t # define __need_wchar_t # define __need_NULL #endif # 48 "/usr/include/wchar.h" 3 4 #if defined _WCHAR_H || defined __need_wint_t || !defined __WINT_TYPE__ # undef __need_wint_t # define __need_wint_t #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 51 "/usr/include/wchar.h" 3 4 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 1 3 4 /*===---- stddef.h - Basic type definitions --------------------------------=== * * Copyright (c) 2008 Eli Friedman * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #if !defined(__STDDEF_H) || defined(__need_ptrdiff_t) || \ defined(__need_size_t) || defined(__need_wchar_t) || \ defined(__need_NULL) || defined(__need_wint_t) #if !defined(__need_ptrdiff_t) && !defined(__need_size_t) && \ !defined(__need_wchar_t) && !defined(__need_NULL) && \ !defined(__need_wint_t) /* Always define miscellaneous pieces when modules are available. */ #if !__has_feature(modules) #define __STDDEF_H #endif # 37 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #define __need_ptrdiff_t #define __need_size_t #define __need_wchar_t #define __need_NULL #define __need_STDDEF_H_misc /* __need_wint_t is intentionally not defined here. */ #endif # 44 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_ptrdiff_t) #if !defined(_PTRDIFF_T) || __has_feature(modules) /* Always define ptrdiff_t when modules are available. */ #if !__has_feature(modules) #define _PTRDIFF_T #endif # 51 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 typedef __PTRDIFF_TYPE__ ptrdiff_t; #endif # 53 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #undef __need_ptrdiff_t #endif /* defined(__need_ptrdiff_t) */ # 55 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_size_t) #if !defined(_SIZE_T) || __has_feature(modules) /* Always define size_t when modules are available. */ #if !__has_feature(modules) #define _SIZE_T #endif # 62 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 typedef __SIZE_TYPE__ size_t; #endif # 64 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #undef __need_size_t #endif /*defined(__need_size_t) */ # 66 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_STDDEF_H_misc) /* ISO9899:2011 7.20 (C11 Annex K): Define rsize_t if __STDC_WANT_LIB_EXT1__ is * enabled. */ #if (defined(__STDC_WANT_LIB_EXT1__) && __STDC_WANT_LIB_EXT1__ >= 1 && \ !defined(_RSIZE_T)) || __has_feature(modules) /* Always define rsize_t when modules are available. */ #if !__has_feature(modules) #define _RSIZE_T #endif # 76 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 typedef __SIZE_TYPE__ rsize_t; #endif # 78 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif /* defined(__need_STDDEF_H_misc) */ # 79 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_wchar_t) #ifndef __cplusplus /* Always define wchar_t when modules are available. */ #if !defined(_WCHAR_T) || __has_feature(modules) #if !__has_feature(modules) #define _WCHAR_T #if defined(_MSC_EXTENSIONS) #define _WCHAR_T_DEFINED #endif # 89 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif # 90 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 typedef __WCHAR_TYPE__ wchar_t; #endif # 92 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif # 93 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #undef __need_wchar_t #endif /* defined(__need_wchar_t) */ # 95 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_NULL) #undef NULL #ifdef __cplusplus # if !defined(__MINGW32__) && !defined(_MSC_VER) # define NULL __null # else # 102 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 # define NULL 0 # endif # 104 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #else # 105 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 # define NULL ((void*)0) #endif # 107 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #ifdef __cplusplus #if defined(_MSC_EXTENSIONS) && defined(_NATIVE_NULLPTR_SUPPORTED) namespace std { typedef decltype(nullptr) nullptr_t; } using ::std::nullptr_t; #endif # 112 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif # 113 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #undef __need_NULL #endif /* defined(__need_NULL) */ # 115 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_STDDEF_H_misc) #if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L #if 0 /* expanded by -frewrite-includes */ #include "__stddef_max_align_t.h" #endif /* expanded by -frewrite-includes */ # 118 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 # 119 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif # 120 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #define offsetof(t, d) __builtin_offsetof(t, d) #undef __need_STDDEF_H_misc #endif /* defined(__need_STDDEF_H_misc) */ # 123 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 /* Some C libraries expect to see a wint_t here. Others (notably MinGW) will use __WINT_TYPE__ directly; accommodate both by requiring __need_wint_t */ #if defined(__need_wint_t) /* Always define wint_t when modules are available. */ #if !defined(_WINT_T) || __has_feature(modules) #if !__has_feature(modules) #define _WINT_T #endif # 132 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 typedef __WINT_TYPE__ wint_t; #endif # 134 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #undef __need_wint_t #endif /* __need_wint_t */ # 136 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif # 138 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 # 52 "/usr/include/wchar.h" 2 3 4 /* We try to get wint_t from , but not all GCC versions define it there. So define it ourselves if it remains undefined. */ # ifndef _WINT_T /* Integral type unchanged by default argument promotions that can hold any value corresponding to members of the extended character set, as well as at least one value that does not correspond to any member of the extended character set. */ # define _WINT_T typedef unsigned int wint_t; # else # 63 "/usr/include/wchar.h" 3 4 /* Work around problems with the file which doesn't put wint_t in the std namespace. */ # if defined __cplusplus && defined _GLIBCPP_USE_NAMESPACES \ && defined __WINT_TYPE__ __BEGIN_NAMESPACE_STD typedef __WINT_TYPE__ wint_t; __END_NAMESPACE_STD # endif # 71 "/usr/include/wchar.h" 3 4 # endif # 72 "/usr/include/wchar.h" 3 4 /* Tell the caller that we provide correct C++ prototypes. */ # if defined __cplusplus && __GNUC_PREREQ (4, 4) # define __CORRECT_ISO_CPP_WCHAR_H_PROTO # endif # 77 "/usr/include/wchar.h" 3 4 #endif # 78 "/usr/include/wchar.h" 3 4 #if (defined _WCHAR_H || defined __need_mbstate_t) && !defined ____mbstate_t_defined # define ____mbstate_t_defined 1 /* Conversion state information. */ typedef struct { int __count; union { # ifdef __WINT_TYPE__ __WINT_TYPE__ __wch; # else # 90 "/usr/include/wchar.h" 3 4 wint_t __wch; # endif # 92 "/usr/include/wchar.h" 3 4 char __wchb[4]; } __value; /* Value so far. */ } __mbstate_t; #endif # 96 "/usr/include/wchar.h" 3 4 #undef __need_mbstate_t /* The rest of the file is only used if used if __need_mbstate_t is not defined. */ #ifdef _WCHAR_H # ifndef __mbstate_t_defined __BEGIN_NAMESPACE_C99 /* Public type. */ typedef __mbstate_t mbstate_t; __END_NAMESPACE_C99 # define __mbstate_t_defined 1 # endif # 110 "/usr/include/wchar.h" 3 4 #ifdef __USE_GNU __USING_NAMESPACE_C99(mbstate_t) #endif # 114 "/usr/include/wchar.h" 3 4 #ifndef WCHAR_MIN /* These constants might also be defined in . */ # define WCHAR_MIN __WCHAR_MIN # define WCHAR_MAX __WCHAR_MAX #endif # 120 "/usr/include/wchar.h" 3 4 #ifndef WEOF # define WEOF (0xffffffffu) #endif # 124 "/usr/include/wchar.h" 3 4 /* For XPG4 compliance we have to define the stuff from here as well. */ #if defined __USE_XOPEN && !defined __USE_UNIX98 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 128 "/usr/include/wchar.h" 3 4 # 129 "/usr/include/wchar.h" 3 4 #endif # 130 "/usr/include/wchar.h" 3 4 __BEGIN_DECLS __BEGIN_NAMESPACE_STD /* This incomplete type is defined in but needed here because of `wcsftime'. */ struct tm; __END_NAMESPACE_STD /* XXX We have to clean this up at some point. Since tm is in the std namespace but wcsftime is in __c99 the type wouldn't be found without inserting it in the global namespace. */ __USING_NAMESPACE_STD(tm) __BEGIN_NAMESPACE_STD /* Copy SRC to DEST. */ extern wchar_t *wcscpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src) __THROW; /* Copy no more than N wide-characters of SRC to DEST. */ extern wchar_t *wcsncpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src, size_t __n) __THROW; /* Append SRC onto DEST. */ extern wchar_t *wcscat (wchar_t *__restrict __dest, const wchar_t *__restrict __src) __THROW; /* Append no more than N wide-characters of SRC onto DEST. */ extern wchar_t *wcsncat (wchar_t *__restrict __dest, const wchar_t *__restrict __src, size_t __n) __THROW; /* Compare S1 and S2. */ extern int wcscmp (const wchar_t *__s1, const wchar_t *__s2) __THROW __attribute_pure__; /* Compare N wide-characters of S1 and S2. */ extern int wcsncmp (const wchar_t *__s1, const wchar_t *__s2, size_t __n) __THROW __attribute_pure__; __END_NAMESPACE_STD #ifdef __USE_XOPEN2K8 /* Compare S1 and S2, ignoring case. */ extern int wcscasecmp (const wchar_t *__s1, const wchar_t *__s2) __THROW; /* Compare no more than N chars of S1 and S2, ignoring case. */ extern int wcsncasecmp (const wchar_t *__s1, const wchar_t *__s2, size_t __n) __THROW; /* Similar to the two functions above but take the information from the provided locale and not the global locale. */ #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 180 "/usr/include/wchar.h" 3 4 # 181 "/usr/include/wchar.h" 3 4 extern int wcscasecmp_l (const wchar_t *__s1, const wchar_t *__s2, __locale_t __loc) __THROW; extern int wcsncasecmp_l (const wchar_t *__s1, const wchar_t *__s2, size_t __n, __locale_t __loc) __THROW; #endif # 188 "/usr/include/wchar.h" 3 4 __BEGIN_NAMESPACE_STD /* Compare S1 and S2, both interpreted as appropriate to the LC_COLLATE category of the current locale. */ extern int wcscoll (const wchar_t *__s1, const wchar_t *__s2) __THROW; /* Transform S2 into array pointed to by S1 such that if wcscmp is applied to two transformed strings the result is the as applying `wcscoll' to the original strings. */ extern size_t wcsxfrm (wchar_t *__restrict __s1, const wchar_t *__restrict __s2, size_t __n) __THROW; __END_NAMESPACE_STD #ifdef __USE_XOPEN2K8 /* Similar to the two functions above but take the information from the provided locale and not the global locale. */ /* Compare S1 and S2, both interpreted as appropriate to the LC_COLLATE category of the given locale. */ extern int wcscoll_l (const wchar_t *__s1, const wchar_t *__s2, __locale_t __loc) __THROW; /* Transform S2 into array pointed to by S1 such that if wcscmp is applied to two transformed strings the result is the as applying `wcscoll' to the original strings. */ extern size_t wcsxfrm_l (wchar_t *__s1, const wchar_t *__s2, size_t __n, __locale_t __loc) __THROW; /* Duplicate S, returning an identical malloc'd string. */ extern wchar_t *wcsdup (const wchar_t *__s) __THROW __attribute_malloc__; #endif # 218 "/usr/include/wchar.h" 3 4 __BEGIN_NAMESPACE_STD /* Find the first occurrence of WC in WCS. */ #ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO extern "C++" wchar_t *wcschr (wchar_t *__wcs, wchar_t __wc) __THROW __asm ("wcschr") __attribute_pure__; extern "C++" const wchar_t *wcschr (const wchar_t *__wcs, wchar_t __wc) __THROW __asm ("wcschr") __attribute_pure__; #else # 227 "/usr/include/wchar.h" 3 4 extern wchar_t *wcschr (const wchar_t *__wcs, wchar_t __wc) __THROW __attribute_pure__; #endif # 230 "/usr/include/wchar.h" 3 4 /* Find the last occurrence of WC in WCS. */ #ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO extern "C++" wchar_t *wcsrchr (wchar_t *__wcs, wchar_t __wc) __THROW __asm ("wcsrchr") __attribute_pure__; extern "C++" const wchar_t *wcsrchr (const wchar_t *__wcs, wchar_t __wc) __THROW __asm ("wcsrchr") __attribute_pure__; #else # 237 "/usr/include/wchar.h" 3 4 extern wchar_t *wcsrchr (const wchar_t *__wcs, wchar_t __wc) __THROW __attribute_pure__; #endif # 240 "/usr/include/wchar.h" 3 4 __END_NAMESPACE_STD #ifdef __USE_GNU /* This function is similar to `wcschr'. But it returns a pointer to the closing NUL wide character in case C is not found in S. */ extern wchar_t *wcschrnul (const wchar_t *__s, wchar_t __wc) __THROW __attribute_pure__; #endif # 248 "/usr/include/wchar.h" 3 4 __BEGIN_NAMESPACE_STD /* Return the length of the initial segmet of WCS which consists entirely of wide characters not in REJECT. */ extern size_t wcscspn (const wchar_t *__wcs, const wchar_t *__reject) __THROW __attribute_pure__; /* Return the length of the initial segmet of WCS which consists entirely of wide characters in ACCEPT. */ extern size_t wcsspn (const wchar_t *__wcs, const wchar_t *__accept) __THROW __attribute_pure__; /* Find the first occurrence in WCS of any character in ACCEPT. */ #ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO extern "C++" wchar_t *wcspbrk (wchar_t *__wcs, const wchar_t *__accept) __THROW __asm ("wcspbrk") __attribute_pure__; extern "C++" const wchar_t *wcspbrk (const wchar_t *__wcs, const wchar_t *__accept) __THROW __asm ("wcspbrk") __attribute_pure__; #else # 266 "/usr/include/wchar.h" 3 4 extern wchar_t *wcspbrk (const wchar_t *__wcs, const wchar_t *__accept) __THROW __attribute_pure__; #endif # 269 "/usr/include/wchar.h" 3 4 /* Find the first occurrence of NEEDLE in HAYSTACK. */ #ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO extern "C++" wchar_t *wcsstr (wchar_t *__haystack, const wchar_t *__needle) __THROW __asm ("wcsstr") __attribute_pure__; extern "C++" const wchar_t *wcsstr (const wchar_t *__haystack, const wchar_t *__needle) __THROW __asm ("wcsstr") __attribute_pure__; #else # 277 "/usr/include/wchar.h" 3 4 extern wchar_t *wcsstr (const wchar_t *__haystack, const wchar_t *__needle) __THROW __attribute_pure__; #endif # 280 "/usr/include/wchar.h" 3 4 /* Divide WCS into tokens separated by characters in DELIM. */ extern wchar_t *wcstok (wchar_t *__restrict __s, const wchar_t *__restrict __delim, wchar_t **__restrict __ptr) __THROW; /* Return the number of wide characters in S. */ extern size_t wcslen (const wchar_t *__s) __THROW __attribute_pure__; __END_NAMESPACE_STD #ifdef __USE_XOPEN /* Another name for `wcsstr' from XPG4. */ # ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO extern "C++" wchar_t *wcswcs (wchar_t *__haystack, const wchar_t *__needle) __THROW __asm ("wcswcs") __attribute_pure__; extern "C++" const wchar_t *wcswcs (const wchar_t *__haystack, const wchar_t *__needle) __THROW __asm ("wcswcs") __attribute_pure__; # else # 299 "/usr/include/wchar.h" 3 4 extern wchar_t *wcswcs (const wchar_t *__haystack, const wchar_t *__needle) __THROW __attribute_pure__; # endif # 302 "/usr/include/wchar.h" 3 4 #endif # 303 "/usr/include/wchar.h" 3 4 #ifdef __USE_XOPEN2K8 /* Return the number of wide characters in S, but at most MAXLEN. */ extern size_t wcsnlen (const wchar_t *__s, size_t __maxlen) __THROW __attribute_pure__; #endif # 309 "/usr/include/wchar.h" 3 4 __BEGIN_NAMESPACE_STD /* Search N wide characters of S for C. */ #ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO extern "C++" wchar_t *wmemchr (wchar_t *__s, wchar_t __c, size_t __n) __THROW __asm ("wmemchr") __attribute_pure__; extern "C++" const wchar_t *wmemchr (const wchar_t *__s, wchar_t __c, size_t __n) __THROW __asm ("wmemchr") __attribute_pure__; #else # 320 "/usr/include/wchar.h" 3 4 extern wchar_t *wmemchr (const wchar_t *__s, wchar_t __c, size_t __n) __THROW __attribute_pure__; #endif # 323 "/usr/include/wchar.h" 3 4 /* Compare N wide characters of S1 and S2. */ extern int wmemcmp (const wchar_t *__s1, const wchar_t *__s2, size_t __n) __THROW __attribute_pure__; /* Copy N wide characters of SRC to DEST. */ extern wchar_t *wmemcpy (wchar_t *__restrict __s1, const wchar_t *__restrict __s2, size_t __n) __THROW; /* Copy N wide characters of SRC to DEST, guaranteeing correct behavior for overlapping strings. */ extern wchar_t *wmemmove (wchar_t *__s1, const wchar_t *__s2, size_t __n) __THROW; /* Set N wide characters of S to C. */ extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) __THROW; __END_NAMESPACE_STD #ifdef __USE_GNU /* Copy N wide characters of SRC to DEST and return pointer to following wide character. */ extern wchar_t *wmempcpy (wchar_t *__restrict __s1, const wchar_t *__restrict __s2, size_t __n) __THROW; #endif # 348 "/usr/include/wchar.h" 3 4 __BEGIN_NAMESPACE_STD /* Determine whether C constitutes a valid (one-byte) multibyte character. */ extern wint_t btowc (int __c) __THROW; /* Determine whether C corresponds to a member of the extended character set whose multibyte representation is a single byte. */ extern int wctob (wint_t __c) __THROW; /* Determine whether PS points to an object representing the initial state. */ extern int mbsinit (const mbstate_t *__ps) __THROW __attribute_pure__; /* Write wide character representation of multibyte character pointed to by S to PWC. */ extern size_t mbrtowc (wchar_t *__restrict __pwc, const char *__restrict __s, size_t __n, mbstate_t *__restrict __p) __THROW; /* Write multibyte representation of wide character WC to S. */ extern size_t wcrtomb (char *__restrict __s, wchar_t __wc, mbstate_t *__restrict __ps) __THROW; /* Return number of bytes in multibyte character pointed to by S. */ extern size_t __mbrlen (const char *__restrict __s, size_t __n, mbstate_t *__restrict __ps) __THROW; extern size_t mbrlen (const char *__restrict __s, size_t __n, mbstate_t *__restrict __ps) __THROW; __END_NAMESPACE_STD #ifdef __USE_EXTERN_INLINES /* Define inline function as optimization. */ /* We can use the BTOWC and WCTOB optimizations since we know that all locales must use ASCII encoding for the values in the ASCII range and because the wchar_t encoding is always ISO 10646. */ extern wint_t __btowc_alias (int __c) __asm ("btowc"); __extern_inline wint_t __NTH (btowc (int __c)) { return (__builtin_constant_p (__c) && __c >= '\0' && __c <= '\x7f' ? (wint_t) __c : __btowc_alias (__c)); } extern int __wctob_alias (wint_t __c) __asm ("wctob"); __extern_inline int __NTH (wctob (wint_t __wc)) { return (__builtin_constant_p (__wc) && __wc >= L'\0' && __wc <= L'\x7f' ? (int) __wc : __wctob_alias (__wc)); } __extern_inline size_t __NTH (mbrlen (const char *__restrict __s, size_t __n, mbstate_t *__restrict __ps)) { return (__ps != NULL ? mbrtowc (NULL, __s, __n, __ps) : __mbrlen (__s, __n, NULL)); } #endif # 404 "/usr/include/wchar.h" 3 4 __BEGIN_NAMESPACE_STD /* Write wide character representation of multibyte character string SRC to DST. */ extern size_t mbsrtowcs (wchar_t *__restrict __dst, const char **__restrict __src, size_t __len, mbstate_t *__restrict __ps) __THROW; /* Write multibyte character representation of wide character string SRC to DST. */ extern size_t wcsrtombs (char *__restrict __dst, const wchar_t **__restrict __src, size_t __len, mbstate_t *__restrict __ps) __THROW; __END_NAMESPACE_STD #ifdef __USE_XOPEN2K8 /* Write wide character representation of at most NMC bytes of the multibyte character string SRC to DST. */ extern size_t mbsnrtowcs (wchar_t *__restrict __dst, const char **__restrict __src, size_t __nmc, size_t __len, mbstate_t *__restrict __ps) __THROW; /* Write multibyte character representation of at most NWC characters from the wide character string SRC to DST. */ extern size_t wcsnrtombs (char *__restrict __dst, const wchar_t **__restrict __src, size_t __nwc, size_t __len, mbstate_t *__restrict __ps) __THROW; #endif /* use POSIX 2008 */ # 434 "/usr/include/wchar.h" 3 4 /* The following functions are extensions found in X/Open CAE. */ #ifdef __USE_XOPEN /* Determine number of column positions required for C. */ extern int wcwidth (wchar_t __c) __THROW; /* Determine number of column positions required for first N wide characters (or fewer if S ends before this) in S. */ extern int wcswidth (const wchar_t *__s, size_t __n) __THROW; #endif /* Use X/Open. */ # 445 "/usr/include/wchar.h" 3 4 __BEGIN_NAMESPACE_STD /* Convert initial portion of the wide string NPTR to `double' representation. */ extern double wcstod (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr) __THROW; __END_NAMESPACE_STD #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Likewise for `float' and `long double' sizes of floating-point numbers. */ extern float wcstof (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr) __THROW; extern long double wcstold (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr) __THROW; __END_NAMESPACE_C99 #endif /* C99 */ # 463 "/usr/include/wchar.h" 3 4 __BEGIN_NAMESPACE_STD /* Convert initial portion of wide string NPTR to `long int' representation. */ extern long int wcstol (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base) __THROW; /* Convert initial portion of wide string NPTR to `unsigned long int' representation. */ extern unsigned long int wcstoul (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base) __THROW; __END_NAMESPACE_STD #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Convert initial portion of wide string NPTR to `long long int' representation. */ __extension__ extern long long int wcstoll (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base) __THROW; /* Convert initial portion of wide string NPTR to `unsigned long long int' representation. */ __extension__ extern unsigned long long int wcstoull (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base) __THROW; __END_NAMESPACE_C99 #endif /* ISO C99. */ # 495 "/usr/include/wchar.h" 3 4 #ifdef __USE_GNU /* Convert initial portion of wide string NPTR to `long long int' representation. */ __extension__ extern long long int wcstoq (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base) __THROW; /* Convert initial portion of wide string NPTR to `unsigned long long int' representation. */ __extension__ extern unsigned long long int wcstouq (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base) __THROW; #endif /* Use GNU. */ # 511 "/usr/include/wchar.h" 3 4 #ifdef __USE_GNU /* The concept of one static locale per category is not very well thought out. Many applications will need to process its data using information from several different locales. Another application is the implementation of the internationalization handling in the upcoming ISO C++ standard library. To support this another set of the functions using locale data exist which have an additional argument. Attention: all these functions are *not* standardized in any form. This is a proof-of-concept implementation. */ /* Structure for reentrant locale using functions. This is an (almost) opaque type for the user level programs. */ #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 526 "/usr/include/wchar.h" 3 4 # 527 "/usr/include/wchar.h" 3 4 /* Special versions of the functions above which take the locale to use as an additional parameter. */ extern long int wcstol_l (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base, __locale_t __loc) __THROW; extern unsigned long int wcstoul_l (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base, __locale_t __loc) __THROW; __extension__ extern long long int wcstoll_l (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base, __locale_t __loc) __THROW; __extension__ extern unsigned long long int wcstoull_l (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base, __locale_t __loc) __THROW; extern double wcstod_l (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, __locale_t __loc) __THROW; extern float wcstof_l (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, __locale_t __loc) __THROW; extern long double wcstold_l (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, __locale_t __loc) __THROW; #endif /* use GNU */ # 561 "/usr/include/wchar.h" 3 4 #ifdef __USE_XOPEN2K8 /* Copy SRC to DEST, returning the address of the terminating L'\0' in DEST. */ extern wchar_t *wcpcpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src) __THROW; /* Copy no more than N characters of SRC to DEST, returning the address of the last character written into DEST. */ extern wchar_t *wcpncpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src, size_t __n) __THROW; /* Wide character I/O functions. */ /* Like OPEN_MEMSTREAM, but the stream is wide oriented and produces a wide character string. */ extern __FILE *open_wmemstream (wchar_t **__bufloc, size_t *__sizeloc) __THROW; #endif # 582 "/usr/include/wchar.h" 3 4 #if defined __USE_ISOC95 || defined __USE_UNIX98 __BEGIN_NAMESPACE_STD /* Select orientation for stream. */ extern int fwide (__FILE *__fp, int __mode) __THROW; /* Write formatted output to STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fwprintf (__FILE *__restrict __stream, const wchar_t *__restrict __format, ...) /* __attribute__ ((__format__ (__wprintf__, 2, 3))) */; /* Write formatted output to stdout. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int wprintf (const wchar_t *__restrict __format, ...) /* __attribute__ ((__format__ (__wprintf__, 1, 2))) */; /* Write formatted output of at most N characters to S. */ extern int swprintf (wchar_t *__restrict __s, size_t __n, const wchar_t *__restrict __format, ...) __THROW /* __attribute__ ((__format__ (__wprintf__, 3, 4))) */; /* Write formatted output to S from argument list ARG. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int vfwprintf (__FILE *__restrict __s, const wchar_t *__restrict __format, __gnuc_va_list __arg) /* __attribute__ ((__format__ (__wprintf__, 2, 0))) */; /* Write formatted output to stdout from argument list ARG. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int vwprintf (const wchar_t *__restrict __format, __gnuc_va_list __arg) /* __attribute__ ((__format__ (__wprintf__, 1, 0))) */; /* Write formatted output of at most N character to S from argument list ARG. */ extern int vswprintf (wchar_t *__restrict __s, size_t __n, const wchar_t *__restrict __format, __gnuc_va_list __arg) __THROW /* __attribute__ ((__format__ (__wprintf__, 3, 0))) */; /* Read formatted input from STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fwscanf (__FILE *__restrict __stream, const wchar_t *__restrict __format, ...) /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */; /* Read formatted input from stdin. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int wscanf (const wchar_t *__restrict __format, ...) /* __attribute__ ((__format__ (__wscanf__, 1, 2))) */; /* Read formatted input from S. */ extern int swscanf (const wchar_t *__restrict __s, const wchar_t *__restrict __format, ...) __THROW /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */; # if defined __USE_ISOC99 && !defined __USE_GNU \ && (!defined __LDBL_COMPAT || !defined __REDIRECT) \ && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K) # ifdef __REDIRECT /* For strict ISO C99 or POSIX compliance disallow %as, %aS and %a[ GNU extension which conflicts with valid %a followed by letter s, S or [. */ extern int __REDIRECT (fwscanf, (__FILE *__restrict __stream, const wchar_t *__restrict __format, ...), __isoc99_fwscanf) /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */; extern int __REDIRECT (wscanf, (const wchar_t *__restrict __format, ...), __isoc99_wscanf) /* __attribute__ ((__format__ (__wscanf__, 1, 2))) */; extern int __REDIRECT_NTH (swscanf, (const wchar_t *__restrict __s, const wchar_t *__restrict __format, ...), __isoc99_swscanf) /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */; # else # 668 "/usr/include/wchar.h" 3 4 extern int __isoc99_fwscanf (__FILE *__restrict __stream, const wchar_t *__restrict __format, ...); extern int __isoc99_wscanf (const wchar_t *__restrict __format, ...); extern int __isoc99_swscanf (const wchar_t *__restrict __s, const wchar_t *__restrict __format, ...) __THROW; # define fwscanf __isoc99_fwscanf # define wscanf __isoc99_wscanf # define swscanf __isoc99_swscanf # endif # 678 "/usr/include/wchar.h" 3 4 # endif # 679 "/usr/include/wchar.h" 3 4 __END_NAMESPACE_STD #endif /* Use ISO C95, C99 and Unix98. */ # 682 "/usr/include/wchar.h" 3 4 #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Read formatted input from S into argument list ARG. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int vfwscanf (__FILE *__restrict __s, const wchar_t *__restrict __format, __gnuc_va_list __arg) /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */; /* Read formatted input from stdin into argument list ARG. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int vwscanf (const wchar_t *__restrict __format, __gnuc_va_list __arg) /* __attribute__ ((__format__ (__wscanf__, 1, 0))) */; /* Read formatted input from S into argument list ARG. */ extern int vswscanf (const wchar_t *__restrict __s, const wchar_t *__restrict __format, __gnuc_va_list __arg) __THROW /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */; # if !defined __USE_GNU \ && (!defined __LDBL_COMPAT || !defined __REDIRECT) \ && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K) # ifdef __REDIRECT extern int __REDIRECT (vfwscanf, (__FILE *__restrict __s, const wchar_t *__restrict __format, __gnuc_va_list __arg), __isoc99_vfwscanf) /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */; extern int __REDIRECT (vwscanf, (const wchar_t *__restrict __format, __gnuc_va_list __arg), __isoc99_vwscanf) /* __attribute__ ((__format__ (__wscanf__, 1, 0))) */; extern int __REDIRECT_NTH (vswscanf, (const wchar_t *__restrict __s, const wchar_t *__restrict __format, __gnuc_va_list __arg), __isoc99_vswscanf) /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */; # else # 722 "/usr/include/wchar.h" 3 4 extern int __isoc99_vfwscanf (__FILE *__restrict __s, const wchar_t *__restrict __format, __gnuc_va_list __arg); extern int __isoc99_vwscanf (const wchar_t *__restrict __format, __gnuc_va_list __arg); extern int __isoc99_vswscanf (const wchar_t *__restrict __s, const wchar_t *__restrict __format, __gnuc_va_list __arg) __THROW; # define vfwscanf __isoc99_vfwscanf # define vwscanf __isoc99_vwscanf # define vswscanf __isoc99_vswscanf # endif # 734 "/usr/include/wchar.h" 3 4 # endif # 735 "/usr/include/wchar.h" 3 4 __END_NAMESPACE_C99 #endif /* Use ISO C99. */ # 738 "/usr/include/wchar.h" 3 4 __BEGIN_NAMESPACE_STD /* Read a character from STREAM. These functions are possible cancellation points and therefore not marked with __THROW. */ extern wint_t fgetwc (__FILE *__stream); extern wint_t getwc (__FILE *__stream); /* Read a character from stdin. This function is a possible cancellation point and therefore not marked with __THROW. */ extern wint_t getwchar (void); /* Write a character to STREAM. These functions are possible cancellation points and therefore not marked with __THROW. */ extern wint_t fputwc (wchar_t __wc, __FILE *__stream); extern wint_t putwc (wchar_t __wc, __FILE *__stream); /* Write a character to stdout. This function is a possible cancellation point and therefore not marked with __THROW. */ extern wint_t putwchar (wchar_t __wc); /* Get a newline-terminated wide character string of finite length from STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern wchar_t *fgetws (wchar_t *__restrict __ws, int __n, __FILE *__restrict __stream); /* Write a string to STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fputws (const wchar_t *__restrict __ws, __FILE *__restrict __stream); /* Push a character back onto the input buffer of STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern wint_t ungetwc (wint_t __wc, __FILE *__stream); __END_NAMESPACE_STD #ifdef __USE_GNU /* These are defined to be equivalent to the `char' functions defined in POSIX.1:1996. These functions are not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation they are cancellation points and therefore not marked with __THROW. */ extern wint_t getwc_unlocked (__FILE *__stream); extern wint_t getwchar_unlocked (void); /* This is the wide character version of a GNU extension. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern wint_t fgetwc_unlocked (__FILE *__stream); /* Faster version when locking is not necessary. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern wint_t fputwc_unlocked (wchar_t __wc, __FILE *__stream); /* These are defined to be equivalent to the `char' functions defined in POSIX.1:1996. These functions are not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation they are cancellation points and therefore not marked with __THROW. */ extern wint_t putwc_unlocked (wchar_t __wc, __FILE *__stream); extern wint_t putwchar_unlocked (wchar_t __wc); /* This function does the same as `fgetws' but does not lock the stream. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern wchar_t *fgetws_unlocked (wchar_t *__restrict __ws, int __n, __FILE *__restrict __stream); /* This function does the same as `fputws' but does not lock the stream. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int fputws_unlocked (const wchar_t *__restrict __ws, __FILE *__restrict __stream); #endif # 849 "/usr/include/wchar.h" 3 4 __BEGIN_NAMESPACE_C99 /* Format TP into S according to FORMAT. Write no more than MAXSIZE wide characters and return the number of wide characters written, or 0 if it would exceed MAXSIZE. */ extern size_t wcsftime (wchar_t *__restrict __s, size_t __maxsize, const wchar_t *__restrict __format, const struct tm *__restrict __tp) __THROW; __END_NAMESPACE_C99 # ifdef __USE_GNU #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 861 "/usr/include/wchar.h" 3 4 # 862 "/usr/include/wchar.h" 3 4 /* Similar to `wcsftime' but takes the information from the provided locale and not the global locale. */ extern size_t wcsftime_l (wchar_t *__restrict __s, size_t __maxsize, const wchar_t *__restrict __format, const struct tm *__restrict __tp, __locale_t __loc) __THROW; # endif # 870 "/usr/include/wchar.h" 3 4 /* The X/Open standard demands that most of the functions defined in the header must also appear here. This is probably because some X/Open members wrote their implementation before the ISO C standard was published and introduced the better solution. We have to provide these definitions for compliance reasons but we do this nonsense only if really necessary. */ #if defined __USE_UNIX98 && !defined __USE_GNU # define __need_iswxxx #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 879 "/usr/include/wchar.h" 3 4 # 880 "/usr/include/wchar.h" 3 4 #endif # 881 "/usr/include/wchar.h" 3 4 /* Define some macros helping to catch buffer overflows. */ #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 884 "/usr/include/wchar.h" 3 4 # 885 "/usr/include/wchar.h" 3 4 #endif # 886 "/usr/include/wchar.h" 3 4 #ifdef __LDBL_COMPAT #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 888 "/usr/include/wchar.h" 3 4 # 889 "/usr/include/wchar.h" 3 4 #endif # 890 "/usr/include/wchar.h" 3 4 __END_DECLS #endif /* _WCHAR_H defined */ # 894 "/usr/include/wchar.h" 3 4 #endif /* wchar.h */ # 896 "/usr/include/wchar.h" 3 4 /* Undefine all __need_* constants in case we are included to get those constants but the whole file was already read. */ #undef __need_mbstate_t #undef __need_wint_t # 45 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 2 3 #endif # 46 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #ifndef _GLIBCXX_CWCHAR #define _GLIBCXX_CWCHAR 1 // Need to do a bit of trickery here with mbstate_t as char_traits // assumes it is in wchar.h, regardless of wchar_t specializations. #ifndef _GLIBCXX_HAVE_MBSTATE_T extern "C" { typedef struct { int __fill[6]; } mbstate_t; } #endif # 61 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 namespace std { using ::mbstate_t; } // namespace std // Get rid of those macros defined in in lieu of real functions. #undef btowc #undef fgetwc #undef fgetws #undef fputwc #undef fputws #undef fwide #undef fwprintf #undef fwscanf #undef getwc #undef getwchar #undef mbrlen #undef mbrtowc #undef mbsinit #undef mbsrtowcs #undef putwc #undef putwchar #undef swprintf #undef swscanf #undef ungetwc #undef vfwprintf #if _GLIBCXX_HAVE_VFWSCANF # undef vfwscanf #endif # 91 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #undef vswprintf #if _GLIBCXX_HAVE_VSWSCANF # undef vswscanf #endif # 95 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #undef vwprintf #if _GLIBCXX_HAVE_VWSCANF # undef vwscanf #endif # 99 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #undef wcrtomb #undef wcscat #undef wcschr #undef wcscmp #undef wcscoll #undef wcscpy #undef wcscspn #undef wcsftime #undef wcslen #undef wcsncat #undef wcsncmp #undef wcsncpy #undef wcspbrk #undef wcsrchr #undef wcsrtombs #undef wcsspn #undef wcsstr #undef wcstod #if _GLIBCXX_HAVE_WCSTOF # undef wcstof #endif # 120 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #undef wcstok #undef wcstol #undef wcstoul #undef wcsxfrm #undef wctob #undef wmemchr #undef wmemcmp #undef wmemcpy #undef wmemmove #undef wmemset #undef wprintf #undef wscanf #if _GLIBCXX_USE_WCHAR_T namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION using ::wint_t; using ::btowc; using ::fgetwc; using ::fgetws; using ::fputwc; using ::fputws; using ::fwide; using ::fwprintf; using ::fwscanf; using ::getwc; using ::getwchar; using ::mbrlen; using ::mbrtowc; using ::mbsinit; using ::mbsrtowcs; using ::putwc; using ::putwchar; #ifndef _GLIBCXX_HAVE_BROKEN_VSWPRINTF using ::swprintf; #endif # 160 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 using ::swscanf; using ::ungetwc; using ::vfwprintf; #if _GLIBCXX_HAVE_VFWSCANF using ::vfwscanf; #endif # 166 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #ifndef _GLIBCXX_HAVE_BROKEN_VSWPRINTF using ::vswprintf; #endif # 169 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #if _GLIBCXX_HAVE_VSWSCANF using ::vswscanf; #endif # 172 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 using ::vwprintf; #if _GLIBCXX_HAVE_VWSCANF using ::vwscanf; #endif # 176 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 using ::wcrtomb; using ::wcscat; using ::wcscmp; using ::wcscoll; using ::wcscpy; using ::wcscspn; using ::wcsftime; using ::wcslen; using ::wcsncat; using ::wcsncmp; using ::wcsncpy; using ::wcsrtombs; using ::wcsspn; using ::wcstod; #if _GLIBCXX_HAVE_WCSTOF using ::wcstof; #endif # 193 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 using ::wcstok; using ::wcstol; using ::wcstoul; using ::wcsxfrm; using ::wctob; using ::wmemcmp; using ::wmemcpy; using ::wmemmove; using ::wmemset; using ::wprintf; using ::wscanf; using ::wcschr; using ::wcspbrk; using ::wcsrchr; using ::wcsstr; using ::wmemchr; #ifndef __CORRECT_ISO_CPP_WCHAR_H_PROTO inline wchar_t* wcschr(wchar_t* __p, wchar_t __c) { return wcschr(const_cast(__p), __c); } inline wchar_t* wcspbrk(wchar_t* __s1, const wchar_t* __s2) { return wcspbrk(const_cast(__s1), __s2); } inline wchar_t* wcsrchr(wchar_t* __p, wchar_t __c) { return wcsrchr(const_cast(__p), __c); } inline wchar_t* wcsstr(wchar_t* __s1, const wchar_t* __s2) { return wcsstr(const_cast(__s1), __s2); } inline wchar_t* wmemchr(wchar_t* __p, wchar_t __c, size_t __n) { return wmemchr(const_cast(__p), __c, __n); } #endif # 231 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 _GLIBCXX_END_NAMESPACE_VERSION } // namespace #if _GLIBCXX_USE_C99 #undef wcstold #undef wcstoll #undef wcstoull namespace __gnu_cxx { #if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC extern "C" long double (wcstold)(const wchar_t * __restrict, wchar_t ** __restrict) throw (); #endif # 247 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #if !_GLIBCXX_USE_C99_DYNAMIC using ::wcstold; #endif # 250 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #if _GLIBCXX_USE_C99_LONG_LONG_CHECK || _GLIBCXX_USE_C99_LONG_LONG_DYNAMIC extern "C" long long int (wcstoll)(const wchar_t * __restrict, wchar_t ** __restrict, int) throw (); extern "C" unsigned long long int (wcstoull)(const wchar_t * __restrict, wchar_t ** __restrict, int) throw (); #endif # 256 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC using ::wcstoll; using ::wcstoull; #endif # 260 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 } // namespace __gnu_cxx namespace std { using ::__gnu_cxx::wcstold; using ::__gnu_cxx::wcstoll; using ::__gnu_cxx::wcstoull; } // namespace #endif # 270 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #endif //_GLIBCXX_USE_WCHAR_T # 272 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #if __cplusplus >= 201103L #ifdef _GLIBCXX_USE_WCHAR_T namespace std { #if _GLIBCXX_HAVE_WCSTOF using std::wcstof; #endif # 282 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #if _GLIBCXX_HAVE_VFWSCANF using std::vfwscanf; #endif # 285 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #if _GLIBCXX_HAVE_VSWSCANF using std::vswscanf; #endif # 288 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #if _GLIBCXX_HAVE_VWSCANF using std::vwscanf; #endif # 291 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #if _GLIBCXX_USE_C99 using std::wcstold; using std::wcstoll; using std::wcstoull; #endif # 297 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 } // namespace #endif // _GLIBCXX_USE_WCHAR_T # 300 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #endif // C++11 # 302 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #endif # 304 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/postypes.h" 2 3 // XXX If is really needed, make sure to define the macros // before including it, in order not to break (and // in C++0x). Reconsider all this as soon as possible... #if (defined(_GLIBCXX_HAVE_INT64_T) && !defined(_GLIBCXX_HAVE_INT64_T_LONG) \ && !defined(_GLIBCXX_HAVE_INT64_T_LONG_LONG)) #ifndef __STDC_LIMIT_MACROS # define _UNDEF__STDC_LIMIT_MACROS # define __STDC_LIMIT_MACROS #endif # 52 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/postypes.h" 3 #ifndef __STDC_CONSTANT_MACROS # define _UNDEF__STDC_CONSTANT_MACROS # define __STDC_CONSTANT_MACROS #endif # 56 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/postypes.h" 3 #if 0 /* expanded by -frewrite-includes */ #include // For int64_t #endif /* expanded by -frewrite-includes */ # 56 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/postypes.h" 3 # 57 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/postypes.h" 3 #ifdef _UNDEF__STDC_LIMIT_MACROS # undef __STDC_LIMIT_MACROS # undef _UNDEF__STDC_LIMIT_MACROS #endif # 61 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/postypes.h" 3 #ifdef _UNDEF__STDC_CONSTANT_MACROS # undef __STDC_CONSTANT_MACROS # undef _UNDEF__STDC_CONSTANT_MACROS #endif # 65 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/postypes.h" 3 #endif # 67 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/postypes.h" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION // The types streamoff, streampos and wstreampos and the class // template fpos<> are described in clauses 21.1.2, 21.1.3, 27.1.2, // 27.2, 27.4.1, 27.4.3 and D.6. Despite all this verbiage, the // behaviour of these types is mostly implementation defined or // unspecified. The behaviour in this implementation is as noted // below. /** * @brief Type used by fpos, char_traits, and char_traits. * * In clauses 21.1.3.1 and 27.4.1 streamoff is described as an * implementation defined type. * Note: In versions of GCC up to and including GCC 3.3, streamoff * was typedef long. */ #ifdef _GLIBCXX_HAVE_INT64_T_LONG typedef long streamoff; #elif defined(_GLIBCXX_HAVE_INT64_T_LONG_LONG) # 90 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/postypes.h" 3 typedef long long streamoff; #elif defined(_GLIBCXX_HAVE_INT64_T) # 92 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/postypes.h" 3 typedef int64_t streamoff; #else # 94 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/postypes.h" 3 typedef long long streamoff; #endif # 96 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/postypes.h" 3 /// Integral type for I/O operation counts and buffer sizes. typedef ptrdiff_t streamsize; // Signed integral type /** * @brief Class representing stream positions. * * The standard places no requirements upon the template parameter StateT. * In this implementation StateT must be DefaultConstructible, * CopyConstructible and Assignable. The standard only requires that fpos * should contain a member of type StateT. In this implementation it also * contains an offset stored as a signed integer. * * @param StateT Type passed to and returned from state(). */ template class fpos { private: streamoff _M_off; _StateT _M_state; public: // The standard doesn't require that fpos objects can be default // constructed. This implementation provides a default // constructor that initializes the offset to 0 and default // constructs the state. fpos() : _M_off(0), _M_state() { } // The standard requires that fpos objects can be constructed // from streamoff objects using the constructor syntax, and // fails to give any meaningful semantics. In this // implementation implicit conversion is also allowed, and this // constructor stores the streamoff as the offset and default // constructs the state. /// Construct position from offset. fpos(streamoff __off) : _M_off(__off), _M_state() { } /// Convert to streamoff. operator streamoff() const { return _M_off; } /// Remember the value of @a st. void state(_StateT __st) { _M_state = __st; } /// Return the last set value of @a st. _StateT state() const { return _M_state; } // The standard requires that this operator must be defined, but // gives no semantics. In this implementation it just adds its // argument to the stored offset and returns *this. /// Add offset to this position. fpos& operator+=(streamoff __off) { _M_off += __off; return *this; } // The standard requires that this operator must be defined, but // gives no semantics. In this implementation it just subtracts // its argument from the stored offset and returns *this. /// Subtract offset from this position. fpos& operator-=(streamoff __off) { _M_off -= __off; return *this; } // The standard requires that this operator must be defined, but // defines its semantics only in terms of operator-. In this // implementation it constructs a copy of *this, adds the // argument to that copy using operator+= and then returns the // copy. /// Add position and offset. fpos operator+(streamoff __off) const { fpos __pos(*this); __pos += __off; return __pos; } // The standard requires that this operator must be defined, but // defines its semantics only in terms of operator+. In this // implementation it constructs a copy of *this, subtracts the // argument from that copy using operator-= and then returns the // copy. /// Subtract offset from position. fpos operator-(streamoff __off) const { fpos __pos(*this); __pos -= __off; return __pos; } // The standard requires that this operator must be defined, but // defines its semantics only in terms of operator+. In this // implementation it returns the difference between the offset // stored in *this and in the argument. /// Subtract position to return offset. streamoff operator-(const fpos& __other) const { return _M_off - __other._M_off; } }; // The standard only requires that operator== must be an // equivalence relation. In this implementation two fpos // objects belong to the same equivalence class if the contained // offsets compare equal. /// Test if equivalent to another position. template inline bool operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) { return streamoff(__lhs) == streamoff(__rhs); } template inline bool operator!=(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) { return streamoff(__lhs) != streamoff(__rhs); } // Clauses 21.1.3.1 and 21.1.3.2 describe streampos and wstreampos // as implementation defined types, but clause 27.2 requires that // they must both be typedefs for fpos /// File position for char streams. typedef fpos streampos; /// File position for wchar_t streams. typedef fpos wstreampos; #if __cplusplus >= 201103L /// File position for char16_t streams. typedef fpos u16streampos; /// File position for char32_t streams. typedef fpos u32streampos; #endif # 238 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/postypes.h" 3 _GLIBCXX_END_NAMESPACE_VERSION } // namespace #endif # 243 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/postypes.h" 3 # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/iosfwd" 2 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION /** * @defgroup io I/O * * Nearly all of the I/O classes are parameterized on the type of * characters they read and write. (The major exception is ios_base at * the top of the hierarchy.) This is a change from pre-Standard * streams, which were not templates. * * For ease of use and compatibility, all of the basic_* I/O-related * classes are given typedef names for both of the builtin character * widths (wide and narrow). The typedefs are the same as the * pre-Standard names, for example: * * @code * typedef basic_ifstream ifstream; * @endcode * * Because properly forward-declaring these classes can be difficult, you * should not do it yourself. Instead, include the <iosfwd> * header, which contains only declarations of all the I/O classes as * well as the typedefs. Trying to forward-declare the typedefs * themselves (e.g., class ostream;) is not valid ISO C++. * * For more specific declarations, see * https://gcc.gnu.org/onlinedocs/libstdc++/manual/io.html#std.io.objects * * @{ */ class ios_base; template > class basic_ios; template > class basic_streambuf; template > class basic_istream; template > class basic_ostream; template > class basic_iostream; _GLIBCXX_BEGIN_NAMESPACE_CXX11 template, typename _Alloc = allocator<_CharT> > class basic_stringbuf; template, typename _Alloc = allocator<_CharT> > class basic_istringstream; template, typename _Alloc = allocator<_CharT> > class basic_ostringstream; template, typename _Alloc = allocator<_CharT> > class basic_stringstream; _GLIBCXX_END_NAMESPACE_CXX11 template > class basic_filebuf; template > class basic_ifstream; template > class basic_ofstream; template > class basic_fstream; template > class istreambuf_iterator; template > class ostreambuf_iterator; /// Base class for @c char streams. typedef basic_ios ios; /// Base class for @c char buffers. typedef basic_streambuf streambuf; /// Base class for @c char input streams. typedef basic_istream istream; /// Base class for @c char output streams. typedef basic_ostream ostream; /// Base class for @c char mixed input and output streams. typedef basic_iostream iostream; /// Class for @c char memory buffers. typedef basic_stringbuf stringbuf; /// Class for @c char input memory streams. typedef basic_istringstream istringstream; /// Class for @c char output memory streams. typedef basic_ostringstream ostringstream; /// Class for @c char mixed input and output memory streams. typedef basic_stringstream stringstream; /// Class for @c char file buffers. typedef basic_filebuf filebuf; /// Class for @c char input file streams. typedef basic_ifstream ifstream; /// Class for @c char output file streams. typedef basic_ofstream ofstream; /// Class for @c char mixed input and output file streams. typedef basic_fstream fstream; #ifdef _GLIBCXX_USE_WCHAR_T /// Base class for @c wchar_t streams. typedef basic_ios wios; /// Base class for @c wchar_t buffers. typedef basic_streambuf wstreambuf; /// Base class for @c wchar_t input streams. typedef basic_istream wistream; /// Base class for @c wchar_t output streams. typedef basic_ostream wostream; /// Base class for @c wchar_t mixed input and output streams. typedef basic_iostream wiostream; /// Class for @c wchar_t memory buffers. typedef basic_stringbuf wstringbuf; /// Class for @c wchar_t input memory streams. typedef basic_istringstream wistringstream; /// Class for @c wchar_t output memory streams. typedef basic_ostringstream wostringstream; /// Class for @c wchar_t mixed input and output memory streams. typedef basic_stringstream wstringstream; /// Class for @c wchar_t file buffers. typedef basic_filebuf wfilebuf; /// Class for @c wchar_t input file streams. typedef basic_ifstream wifstream; /// Class for @c wchar_t output file streams. typedef basic_ofstream wofstream; /// Class for @c wchar_t mixed input and output file streams. typedef basic_fstream wfstream; #endif # 210 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/iosfwd" 3 /** @} */ _GLIBCXX_END_NAMESPACE_VERSION } // namespace #endif /* _GLIBCXX_IOSFWD */ # 216 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/iosfwd" 3 # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ios" 2 3 #if 0 /* expanded by -frewrite-includes */ #include // For ios_base::failure #endif /* expanded by -frewrite-includes */ # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ios" 3 # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ios" 3 #if 0 /* expanded by -frewrite-includes */ #include // For char_traits, streamoff, streamsize, fpos #endif /* expanded by -frewrite-includes */ # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ios" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/char_traits.h" 1 3 // Character Traits for use by standard string and iostream -*- C++ -*- // Copyright (C) 1997-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file bits/char_traits.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{string} */ // // ISO C++ 14882: 21 Strings library // #ifndef _CHAR_TRAITS_H #define _CHAR_TRAITS_H 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 38 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/char_traits.h" 3 #if 0 /* expanded by -frewrite-includes */ #include // std::copy, std::fill_n #endif /* expanded by -frewrite-includes */ # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/char_traits.h" 3 # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/char_traits.h" 3 #if 0 /* expanded by -frewrite-includes */ #include // For streampos #endif /* expanded by -frewrite-includes */ # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/char_traits.h" 3 # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/char_traits.h" 3 #if 0 /* expanded by -frewrite-includes */ #include // For WEOF, wmemmove, wmemset, etc. #endif /* expanded by -frewrite-includes */ # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/char_traits.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 1 3 // -*- C++ -*- forwarding header. // Copyright (C) 1997-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file include/cwchar * This is a Standard C++ Library file. You should @c \#include this file * in your programs, rather than any of the @a *.h implementation files. * * This is the C++ version of the Standard C Library header @c wchar.h, * and its contents are (mostly) the same as that header, but are all * contained in the namespace @c std (except for names which are defined * as macros in C). */ // // ISO C++ 14882: 21.4 // #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #if _GLIBCXX_HAVE_WCHAR_H #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 44 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 # 1 "/usr/include/wchar.h" 1 3 4 /* Copyright (C) 1995-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard: 7.24 * Extended multibyte and wide character utilities */ #ifndef _WCHAR_H #if !defined __need_mbstate_t && !defined __need_wint_t # define _WCHAR_H 1 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 27 "/usr/include/wchar.h" 3 4 # 28 "/usr/include/wchar.h" 3 4 #endif # 29 "/usr/include/wchar.h" 3 4 #ifdef _WCHAR_H /* Get FILE definition. */ # define __need___FILE # if defined __USE_UNIX98 || defined __USE_XOPEN2K # define __need_FILE # endif # 36 "/usr/include/wchar.h" 3 4 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 36 "/usr/include/wchar.h" 3 4 # 37 "/usr/include/wchar.h" 3 4 /* Get va_list definition. */ # define __need___va_list #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 39 "/usr/include/wchar.h" 3 4 # 40 "/usr/include/wchar.h" 3 4 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 41 "/usr/include/wchar.h" 3 4 # 42 "/usr/include/wchar.h" 3 4 /* Get size_t, wchar_t, wint_t and NULL from . */ # define __need_size_t # define __need_wchar_t # define __need_NULL #endif # 48 "/usr/include/wchar.h" 3 4 #if defined _WCHAR_H || defined __need_wint_t || !defined __WINT_TYPE__ # undef __need_wint_t # define __need_wint_t #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 51 "/usr/include/wchar.h" 3 4 # 52 "/usr/include/wchar.h" 3 4 /* We try to get wint_t from , but not all GCC versions define it there. So define it ourselves if it remains undefined. */ # ifndef _WINT_T /* Integral type unchanged by default argument promotions that can hold any value corresponding to members of the extended character set, as well as at least one value that does not correspond to any member of the extended character set. */ # define _WINT_T typedef unsigned int wint_t; # else # 63 "/usr/include/wchar.h" 3 4 /* Work around problems with the file which doesn't put wint_t in the std namespace. */ # if defined __cplusplus && defined _GLIBCPP_USE_NAMESPACES \ && defined __WINT_TYPE__ __BEGIN_NAMESPACE_STD typedef __WINT_TYPE__ wint_t; __END_NAMESPACE_STD # endif # 71 "/usr/include/wchar.h" 3 4 # endif # 72 "/usr/include/wchar.h" 3 4 /* Tell the caller that we provide correct C++ prototypes. */ # if defined __cplusplus && __GNUC_PREREQ (4, 4) # define __CORRECT_ISO_CPP_WCHAR_H_PROTO # endif # 77 "/usr/include/wchar.h" 3 4 #endif # 78 "/usr/include/wchar.h" 3 4 #if (defined _WCHAR_H || defined __need_mbstate_t) && !defined ____mbstate_t_defined # define ____mbstate_t_defined 1 /* Conversion state information. */ typedef struct { int __count; union { # ifdef __WINT_TYPE__ __WINT_TYPE__ __wch; # else # 90 "/usr/include/wchar.h" 3 4 wint_t __wch; # endif # 92 "/usr/include/wchar.h" 3 4 char __wchb[4]; } __value; /* Value so far. */ } __mbstate_t; #endif # 96 "/usr/include/wchar.h" 3 4 #undef __need_mbstate_t /* The rest of the file is only used if used if __need_mbstate_t is not defined. */ #ifdef _WCHAR_H # ifndef __mbstate_t_defined __BEGIN_NAMESPACE_C99 /* Public type. */ typedef __mbstate_t mbstate_t; __END_NAMESPACE_C99 # define __mbstate_t_defined 1 # endif # 110 "/usr/include/wchar.h" 3 4 #ifdef __USE_GNU __USING_NAMESPACE_C99(mbstate_t) #endif # 114 "/usr/include/wchar.h" 3 4 #ifndef WCHAR_MIN /* These constants might also be defined in . */ # define WCHAR_MIN __WCHAR_MIN # define WCHAR_MAX __WCHAR_MAX #endif # 120 "/usr/include/wchar.h" 3 4 #ifndef WEOF # define WEOF (0xffffffffu) #endif # 124 "/usr/include/wchar.h" 3 4 /* For XPG4 compliance we have to define the stuff from here as well. */ #if defined __USE_XOPEN && !defined __USE_UNIX98 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 128 "/usr/include/wchar.h" 3 4 # 129 "/usr/include/wchar.h" 3 4 #endif # 130 "/usr/include/wchar.h" 3 4 __BEGIN_DECLS __BEGIN_NAMESPACE_STD /* This incomplete type is defined in but needed here because of `wcsftime'. */ struct tm; __END_NAMESPACE_STD /* XXX We have to clean this up at some point. Since tm is in the std namespace but wcsftime is in __c99 the type wouldn't be found without inserting it in the global namespace. */ __USING_NAMESPACE_STD(tm) __BEGIN_NAMESPACE_STD /* Copy SRC to DEST. */ extern wchar_t *wcscpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src) __THROW; /* Copy no more than N wide-characters of SRC to DEST. */ extern wchar_t *wcsncpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src, size_t __n) __THROW; /* Append SRC onto DEST. */ extern wchar_t *wcscat (wchar_t *__restrict __dest, const wchar_t *__restrict __src) __THROW; /* Append no more than N wide-characters of SRC onto DEST. */ extern wchar_t *wcsncat (wchar_t *__restrict __dest, const wchar_t *__restrict __src, size_t __n) __THROW; /* Compare S1 and S2. */ extern int wcscmp (const wchar_t *__s1, const wchar_t *__s2) __THROW __attribute_pure__; /* Compare N wide-characters of S1 and S2. */ extern int wcsncmp (const wchar_t *__s1, const wchar_t *__s2, size_t __n) __THROW __attribute_pure__; __END_NAMESPACE_STD #ifdef __USE_XOPEN2K8 /* Compare S1 and S2, ignoring case. */ extern int wcscasecmp (const wchar_t *__s1, const wchar_t *__s2) __THROW; /* Compare no more than N chars of S1 and S2, ignoring case. */ extern int wcsncasecmp (const wchar_t *__s1, const wchar_t *__s2, size_t __n) __THROW; /* Similar to the two functions above but take the information from the provided locale and not the global locale. */ #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 180 "/usr/include/wchar.h" 3 4 # 181 "/usr/include/wchar.h" 3 4 extern int wcscasecmp_l (const wchar_t *__s1, const wchar_t *__s2, __locale_t __loc) __THROW; extern int wcsncasecmp_l (const wchar_t *__s1, const wchar_t *__s2, size_t __n, __locale_t __loc) __THROW; #endif # 188 "/usr/include/wchar.h" 3 4 __BEGIN_NAMESPACE_STD /* Compare S1 and S2, both interpreted as appropriate to the LC_COLLATE category of the current locale. */ extern int wcscoll (const wchar_t *__s1, const wchar_t *__s2) __THROW; /* Transform S2 into array pointed to by S1 such that if wcscmp is applied to two transformed strings the result is the as applying `wcscoll' to the original strings. */ extern size_t wcsxfrm (wchar_t *__restrict __s1, const wchar_t *__restrict __s2, size_t __n) __THROW; __END_NAMESPACE_STD #ifdef __USE_XOPEN2K8 /* Similar to the two functions above but take the information from the provided locale and not the global locale. */ /* Compare S1 and S2, both interpreted as appropriate to the LC_COLLATE category of the given locale. */ extern int wcscoll_l (const wchar_t *__s1, const wchar_t *__s2, __locale_t __loc) __THROW; /* Transform S2 into array pointed to by S1 such that if wcscmp is applied to two transformed strings the result is the as applying `wcscoll' to the original strings. */ extern size_t wcsxfrm_l (wchar_t *__s1, const wchar_t *__s2, size_t __n, __locale_t __loc) __THROW; /* Duplicate S, returning an identical malloc'd string. */ extern wchar_t *wcsdup (const wchar_t *__s) __THROW __attribute_malloc__; #endif # 218 "/usr/include/wchar.h" 3 4 __BEGIN_NAMESPACE_STD /* Find the first occurrence of WC in WCS. */ #ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO extern "C++" wchar_t *wcschr (wchar_t *__wcs, wchar_t __wc) __THROW __asm ("wcschr") __attribute_pure__; extern "C++" const wchar_t *wcschr (const wchar_t *__wcs, wchar_t __wc) __THROW __asm ("wcschr") __attribute_pure__; #else # 227 "/usr/include/wchar.h" 3 4 extern wchar_t *wcschr (const wchar_t *__wcs, wchar_t __wc) __THROW __attribute_pure__; #endif # 230 "/usr/include/wchar.h" 3 4 /* Find the last occurrence of WC in WCS. */ #ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO extern "C++" wchar_t *wcsrchr (wchar_t *__wcs, wchar_t __wc) __THROW __asm ("wcsrchr") __attribute_pure__; extern "C++" const wchar_t *wcsrchr (const wchar_t *__wcs, wchar_t __wc) __THROW __asm ("wcsrchr") __attribute_pure__; #else # 237 "/usr/include/wchar.h" 3 4 extern wchar_t *wcsrchr (const wchar_t *__wcs, wchar_t __wc) __THROW __attribute_pure__; #endif # 240 "/usr/include/wchar.h" 3 4 __END_NAMESPACE_STD #ifdef __USE_GNU /* This function is similar to `wcschr'. But it returns a pointer to the closing NUL wide character in case C is not found in S. */ extern wchar_t *wcschrnul (const wchar_t *__s, wchar_t __wc) __THROW __attribute_pure__; #endif # 248 "/usr/include/wchar.h" 3 4 __BEGIN_NAMESPACE_STD /* Return the length of the initial segmet of WCS which consists entirely of wide characters not in REJECT. */ extern size_t wcscspn (const wchar_t *__wcs, const wchar_t *__reject) __THROW __attribute_pure__; /* Return the length of the initial segmet of WCS which consists entirely of wide characters in ACCEPT. */ extern size_t wcsspn (const wchar_t *__wcs, const wchar_t *__accept) __THROW __attribute_pure__; /* Find the first occurrence in WCS of any character in ACCEPT. */ #ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO extern "C++" wchar_t *wcspbrk (wchar_t *__wcs, const wchar_t *__accept) __THROW __asm ("wcspbrk") __attribute_pure__; extern "C++" const wchar_t *wcspbrk (const wchar_t *__wcs, const wchar_t *__accept) __THROW __asm ("wcspbrk") __attribute_pure__; #else # 266 "/usr/include/wchar.h" 3 4 extern wchar_t *wcspbrk (const wchar_t *__wcs, const wchar_t *__accept) __THROW __attribute_pure__; #endif # 269 "/usr/include/wchar.h" 3 4 /* Find the first occurrence of NEEDLE in HAYSTACK. */ #ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO extern "C++" wchar_t *wcsstr (wchar_t *__haystack, const wchar_t *__needle) __THROW __asm ("wcsstr") __attribute_pure__; extern "C++" const wchar_t *wcsstr (const wchar_t *__haystack, const wchar_t *__needle) __THROW __asm ("wcsstr") __attribute_pure__; #else # 277 "/usr/include/wchar.h" 3 4 extern wchar_t *wcsstr (const wchar_t *__haystack, const wchar_t *__needle) __THROW __attribute_pure__; #endif # 280 "/usr/include/wchar.h" 3 4 /* Divide WCS into tokens separated by characters in DELIM. */ extern wchar_t *wcstok (wchar_t *__restrict __s, const wchar_t *__restrict __delim, wchar_t **__restrict __ptr) __THROW; /* Return the number of wide characters in S. */ extern size_t wcslen (const wchar_t *__s) __THROW __attribute_pure__; __END_NAMESPACE_STD #ifdef __USE_XOPEN /* Another name for `wcsstr' from XPG4. */ # ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO extern "C++" wchar_t *wcswcs (wchar_t *__haystack, const wchar_t *__needle) __THROW __asm ("wcswcs") __attribute_pure__; extern "C++" const wchar_t *wcswcs (const wchar_t *__haystack, const wchar_t *__needle) __THROW __asm ("wcswcs") __attribute_pure__; # else # 299 "/usr/include/wchar.h" 3 4 extern wchar_t *wcswcs (const wchar_t *__haystack, const wchar_t *__needle) __THROW __attribute_pure__; # endif # 302 "/usr/include/wchar.h" 3 4 #endif # 303 "/usr/include/wchar.h" 3 4 #ifdef __USE_XOPEN2K8 /* Return the number of wide characters in S, but at most MAXLEN. */ extern size_t wcsnlen (const wchar_t *__s, size_t __maxlen) __THROW __attribute_pure__; #endif # 309 "/usr/include/wchar.h" 3 4 __BEGIN_NAMESPACE_STD /* Search N wide characters of S for C. */ #ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO extern "C++" wchar_t *wmemchr (wchar_t *__s, wchar_t __c, size_t __n) __THROW __asm ("wmemchr") __attribute_pure__; extern "C++" const wchar_t *wmemchr (const wchar_t *__s, wchar_t __c, size_t __n) __THROW __asm ("wmemchr") __attribute_pure__; #else # 320 "/usr/include/wchar.h" 3 4 extern wchar_t *wmemchr (const wchar_t *__s, wchar_t __c, size_t __n) __THROW __attribute_pure__; #endif # 323 "/usr/include/wchar.h" 3 4 /* Compare N wide characters of S1 and S2. */ extern int wmemcmp (const wchar_t *__s1, const wchar_t *__s2, size_t __n) __THROW __attribute_pure__; /* Copy N wide characters of SRC to DEST. */ extern wchar_t *wmemcpy (wchar_t *__restrict __s1, const wchar_t *__restrict __s2, size_t __n) __THROW; /* Copy N wide characters of SRC to DEST, guaranteeing correct behavior for overlapping strings. */ extern wchar_t *wmemmove (wchar_t *__s1, const wchar_t *__s2, size_t __n) __THROW; /* Set N wide characters of S to C. */ extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) __THROW; __END_NAMESPACE_STD #ifdef __USE_GNU /* Copy N wide characters of SRC to DEST and return pointer to following wide character. */ extern wchar_t *wmempcpy (wchar_t *__restrict __s1, const wchar_t *__restrict __s2, size_t __n) __THROW; #endif # 348 "/usr/include/wchar.h" 3 4 __BEGIN_NAMESPACE_STD /* Determine whether C constitutes a valid (one-byte) multibyte character. */ extern wint_t btowc (int __c) __THROW; /* Determine whether C corresponds to a member of the extended character set whose multibyte representation is a single byte. */ extern int wctob (wint_t __c) __THROW; /* Determine whether PS points to an object representing the initial state. */ extern int mbsinit (const mbstate_t *__ps) __THROW __attribute_pure__; /* Write wide character representation of multibyte character pointed to by S to PWC. */ extern size_t mbrtowc (wchar_t *__restrict __pwc, const char *__restrict __s, size_t __n, mbstate_t *__restrict __p) __THROW; /* Write multibyte representation of wide character WC to S. */ extern size_t wcrtomb (char *__restrict __s, wchar_t __wc, mbstate_t *__restrict __ps) __THROW; /* Return number of bytes in multibyte character pointed to by S. */ extern size_t __mbrlen (const char *__restrict __s, size_t __n, mbstate_t *__restrict __ps) __THROW; extern size_t mbrlen (const char *__restrict __s, size_t __n, mbstate_t *__restrict __ps) __THROW; __END_NAMESPACE_STD #ifdef __USE_EXTERN_INLINES /* Define inline function as optimization. */ /* We can use the BTOWC and WCTOB optimizations since we know that all locales must use ASCII encoding for the values in the ASCII range and because the wchar_t encoding is always ISO 10646. */ extern wint_t __btowc_alias (int __c) __asm ("btowc"); __extern_inline wint_t __NTH (btowc (int __c)) { return (__builtin_constant_p (__c) && __c >= '\0' && __c <= '\x7f' ? (wint_t) __c : __btowc_alias (__c)); } extern int __wctob_alias (wint_t __c) __asm ("wctob"); __extern_inline int __NTH (wctob (wint_t __wc)) { return (__builtin_constant_p (__wc) && __wc >= L'\0' && __wc <= L'\x7f' ? (int) __wc : __wctob_alias (__wc)); } __extern_inline size_t __NTH (mbrlen (const char *__restrict __s, size_t __n, mbstate_t *__restrict __ps)) { return (__ps != NULL ? mbrtowc (NULL, __s, __n, __ps) : __mbrlen (__s, __n, NULL)); } #endif # 404 "/usr/include/wchar.h" 3 4 __BEGIN_NAMESPACE_STD /* Write wide character representation of multibyte character string SRC to DST. */ extern size_t mbsrtowcs (wchar_t *__restrict __dst, const char **__restrict __src, size_t __len, mbstate_t *__restrict __ps) __THROW; /* Write multibyte character representation of wide character string SRC to DST. */ extern size_t wcsrtombs (char *__restrict __dst, const wchar_t **__restrict __src, size_t __len, mbstate_t *__restrict __ps) __THROW; __END_NAMESPACE_STD #ifdef __USE_XOPEN2K8 /* Write wide character representation of at most NMC bytes of the multibyte character string SRC to DST. */ extern size_t mbsnrtowcs (wchar_t *__restrict __dst, const char **__restrict __src, size_t __nmc, size_t __len, mbstate_t *__restrict __ps) __THROW; /* Write multibyte character representation of at most NWC characters from the wide character string SRC to DST. */ extern size_t wcsnrtombs (char *__restrict __dst, const wchar_t **__restrict __src, size_t __nwc, size_t __len, mbstate_t *__restrict __ps) __THROW; #endif /* use POSIX 2008 */ # 434 "/usr/include/wchar.h" 3 4 /* The following functions are extensions found in X/Open CAE. */ #ifdef __USE_XOPEN /* Determine number of column positions required for C. */ extern int wcwidth (wchar_t __c) __THROW; /* Determine number of column positions required for first N wide characters (or fewer if S ends before this) in S. */ extern int wcswidth (const wchar_t *__s, size_t __n) __THROW; #endif /* Use X/Open. */ # 445 "/usr/include/wchar.h" 3 4 __BEGIN_NAMESPACE_STD /* Convert initial portion of the wide string NPTR to `double' representation. */ extern double wcstod (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr) __THROW; __END_NAMESPACE_STD #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Likewise for `float' and `long double' sizes of floating-point numbers. */ extern float wcstof (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr) __THROW; extern long double wcstold (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr) __THROW; __END_NAMESPACE_C99 #endif /* C99 */ # 463 "/usr/include/wchar.h" 3 4 __BEGIN_NAMESPACE_STD /* Convert initial portion of wide string NPTR to `long int' representation. */ extern long int wcstol (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base) __THROW; /* Convert initial portion of wide string NPTR to `unsigned long int' representation. */ extern unsigned long int wcstoul (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base) __THROW; __END_NAMESPACE_STD #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Convert initial portion of wide string NPTR to `long long int' representation. */ __extension__ extern long long int wcstoll (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base) __THROW; /* Convert initial portion of wide string NPTR to `unsigned long long int' representation. */ __extension__ extern unsigned long long int wcstoull (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base) __THROW; __END_NAMESPACE_C99 #endif /* ISO C99. */ # 495 "/usr/include/wchar.h" 3 4 #ifdef __USE_GNU /* Convert initial portion of wide string NPTR to `long long int' representation. */ __extension__ extern long long int wcstoq (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base) __THROW; /* Convert initial portion of wide string NPTR to `unsigned long long int' representation. */ __extension__ extern unsigned long long int wcstouq (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base) __THROW; #endif /* Use GNU. */ # 511 "/usr/include/wchar.h" 3 4 #ifdef __USE_GNU /* The concept of one static locale per category is not very well thought out. Many applications will need to process its data using information from several different locales. Another application is the implementation of the internationalization handling in the upcoming ISO C++ standard library. To support this another set of the functions using locale data exist which have an additional argument. Attention: all these functions are *not* standardized in any form. This is a proof-of-concept implementation. */ /* Structure for reentrant locale using functions. This is an (almost) opaque type for the user level programs. */ #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 526 "/usr/include/wchar.h" 3 4 # 527 "/usr/include/wchar.h" 3 4 /* Special versions of the functions above which take the locale to use as an additional parameter. */ extern long int wcstol_l (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base, __locale_t __loc) __THROW; extern unsigned long int wcstoul_l (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base, __locale_t __loc) __THROW; __extension__ extern long long int wcstoll_l (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base, __locale_t __loc) __THROW; __extension__ extern unsigned long long int wcstoull_l (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base, __locale_t __loc) __THROW; extern double wcstod_l (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, __locale_t __loc) __THROW; extern float wcstof_l (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, __locale_t __loc) __THROW; extern long double wcstold_l (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, __locale_t __loc) __THROW; #endif /* use GNU */ # 561 "/usr/include/wchar.h" 3 4 #ifdef __USE_XOPEN2K8 /* Copy SRC to DEST, returning the address of the terminating L'\0' in DEST. */ extern wchar_t *wcpcpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src) __THROW; /* Copy no more than N characters of SRC to DEST, returning the address of the last character written into DEST. */ extern wchar_t *wcpncpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src, size_t __n) __THROW; /* Wide character I/O functions. */ /* Like OPEN_MEMSTREAM, but the stream is wide oriented and produces a wide character string. */ extern __FILE *open_wmemstream (wchar_t **__bufloc, size_t *__sizeloc) __THROW; #endif # 582 "/usr/include/wchar.h" 3 4 #if defined __USE_ISOC95 || defined __USE_UNIX98 __BEGIN_NAMESPACE_STD /* Select orientation for stream. */ extern int fwide (__FILE *__fp, int __mode) __THROW; /* Write formatted output to STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fwprintf (__FILE *__restrict __stream, const wchar_t *__restrict __format, ...) /* __attribute__ ((__format__ (__wprintf__, 2, 3))) */; /* Write formatted output to stdout. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int wprintf (const wchar_t *__restrict __format, ...) /* __attribute__ ((__format__ (__wprintf__, 1, 2))) */; /* Write formatted output of at most N characters to S. */ extern int swprintf (wchar_t *__restrict __s, size_t __n, const wchar_t *__restrict __format, ...) __THROW /* __attribute__ ((__format__ (__wprintf__, 3, 4))) */; /* Write formatted output to S from argument list ARG. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int vfwprintf (__FILE *__restrict __s, const wchar_t *__restrict __format, __gnuc_va_list __arg) /* __attribute__ ((__format__ (__wprintf__, 2, 0))) */; /* Write formatted output to stdout from argument list ARG. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int vwprintf (const wchar_t *__restrict __format, __gnuc_va_list __arg) /* __attribute__ ((__format__ (__wprintf__, 1, 0))) */; /* Write formatted output of at most N character to S from argument list ARG. */ extern int vswprintf (wchar_t *__restrict __s, size_t __n, const wchar_t *__restrict __format, __gnuc_va_list __arg) __THROW /* __attribute__ ((__format__ (__wprintf__, 3, 0))) */; /* Read formatted input from STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fwscanf (__FILE *__restrict __stream, const wchar_t *__restrict __format, ...) /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */; /* Read formatted input from stdin. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int wscanf (const wchar_t *__restrict __format, ...) /* __attribute__ ((__format__ (__wscanf__, 1, 2))) */; /* Read formatted input from S. */ extern int swscanf (const wchar_t *__restrict __s, const wchar_t *__restrict __format, ...) __THROW /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */; # if defined __USE_ISOC99 && !defined __USE_GNU \ && (!defined __LDBL_COMPAT || !defined __REDIRECT) \ && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K) # ifdef __REDIRECT /* For strict ISO C99 or POSIX compliance disallow %as, %aS and %a[ GNU extension which conflicts with valid %a followed by letter s, S or [. */ extern int __REDIRECT (fwscanf, (__FILE *__restrict __stream, const wchar_t *__restrict __format, ...), __isoc99_fwscanf) /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */; extern int __REDIRECT (wscanf, (const wchar_t *__restrict __format, ...), __isoc99_wscanf) /* __attribute__ ((__format__ (__wscanf__, 1, 2))) */; extern int __REDIRECT_NTH (swscanf, (const wchar_t *__restrict __s, const wchar_t *__restrict __format, ...), __isoc99_swscanf) /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */; # else # 668 "/usr/include/wchar.h" 3 4 extern int __isoc99_fwscanf (__FILE *__restrict __stream, const wchar_t *__restrict __format, ...); extern int __isoc99_wscanf (const wchar_t *__restrict __format, ...); extern int __isoc99_swscanf (const wchar_t *__restrict __s, const wchar_t *__restrict __format, ...) __THROW; # define fwscanf __isoc99_fwscanf # define wscanf __isoc99_wscanf # define swscanf __isoc99_swscanf # endif # 678 "/usr/include/wchar.h" 3 4 # endif # 679 "/usr/include/wchar.h" 3 4 __END_NAMESPACE_STD #endif /* Use ISO C95, C99 and Unix98. */ # 682 "/usr/include/wchar.h" 3 4 #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Read formatted input from S into argument list ARG. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int vfwscanf (__FILE *__restrict __s, const wchar_t *__restrict __format, __gnuc_va_list __arg) /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */; /* Read formatted input from stdin into argument list ARG. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int vwscanf (const wchar_t *__restrict __format, __gnuc_va_list __arg) /* __attribute__ ((__format__ (__wscanf__, 1, 0))) */; /* Read formatted input from S into argument list ARG. */ extern int vswscanf (const wchar_t *__restrict __s, const wchar_t *__restrict __format, __gnuc_va_list __arg) __THROW /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */; # if !defined __USE_GNU \ && (!defined __LDBL_COMPAT || !defined __REDIRECT) \ && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K) # ifdef __REDIRECT extern int __REDIRECT (vfwscanf, (__FILE *__restrict __s, const wchar_t *__restrict __format, __gnuc_va_list __arg), __isoc99_vfwscanf) /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */; extern int __REDIRECT (vwscanf, (const wchar_t *__restrict __format, __gnuc_va_list __arg), __isoc99_vwscanf) /* __attribute__ ((__format__ (__wscanf__, 1, 0))) */; extern int __REDIRECT_NTH (vswscanf, (const wchar_t *__restrict __s, const wchar_t *__restrict __format, __gnuc_va_list __arg), __isoc99_vswscanf) /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */; # else # 722 "/usr/include/wchar.h" 3 4 extern int __isoc99_vfwscanf (__FILE *__restrict __s, const wchar_t *__restrict __format, __gnuc_va_list __arg); extern int __isoc99_vwscanf (const wchar_t *__restrict __format, __gnuc_va_list __arg); extern int __isoc99_vswscanf (const wchar_t *__restrict __s, const wchar_t *__restrict __format, __gnuc_va_list __arg) __THROW; # define vfwscanf __isoc99_vfwscanf # define vwscanf __isoc99_vwscanf # define vswscanf __isoc99_vswscanf # endif # 734 "/usr/include/wchar.h" 3 4 # endif # 735 "/usr/include/wchar.h" 3 4 __END_NAMESPACE_C99 #endif /* Use ISO C99. */ # 738 "/usr/include/wchar.h" 3 4 __BEGIN_NAMESPACE_STD /* Read a character from STREAM. These functions are possible cancellation points and therefore not marked with __THROW. */ extern wint_t fgetwc (__FILE *__stream); extern wint_t getwc (__FILE *__stream); /* Read a character from stdin. This function is a possible cancellation point and therefore not marked with __THROW. */ extern wint_t getwchar (void); /* Write a character to STREAM. These functions are possible cancellation points and therefore not marked with __THROW. */ extern wint_t fputwc (wchar_t __wc, __FILE *__stream); extern wint_t putwc (wchar_t __wc, __FILE *__stream); /* Write a character to stdout. This function is a possible cancellation point and therefore not marked with __THROW. */ extern wint_t putwchar (wchar_t __wc); /* Get a newline-terminated wide character string of finite length from STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern wchar_t *fgetws (wchar_t *__restrict __ws, int __n, __FILE *__restrict __stream); /* Write a string to STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fputws (const wchar_t *__restrict __ws, __FILE *__restrict __stream); /* Push a character back onto the input buffer of STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern wint_t ungetwc (wint_t __wc, __FILE *__stream); __END_NAMESPACE_STD #ifdef __USE_GNU /* These are defined to be equivalent to the `char' functions defined in POSIX.1:1996. These functions are not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation they are cancellation points and therefore not marked with __THROW. */ extern wint_t getwc_unlocked (__FILE *__stream); extern wint_t getwchar_unlocked (void); /* This is the wide character version of a GNU extension. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern wint_t fgetwc_unlocked (__FILE *__stream); /* Faster version when locking is not necessary. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern wint_t fputwc_unlocked (wchar_t __wc, __FILE *__stream); /* These are defined to be equivalent to the `char' functions defined in POSIX.1:1996. These functions are not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation they are cancellation points and therefore not marked with __THROW. */ extern wint_t putwc_unlocked (wchar_t __wc, __FILE *__stream); extern wint_t putwchar_unlocked (wchar_t __wc); /* This function does the same as `fgetws' but does not lock the stream. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern wchar_t *fgetws_unlocked (wchar_t *__restrict __ws, int __n, __FILE *__restrict __stream); /* This function does the same as `fputws' but does not lock the stream. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int fputws_unlocked (const wchar_t *__restrict __ws, __FILE *__restrict __stream); #endif # 849 "/usr/include/wchar.h" 3 4 __BEGIN_NAMESPACE_C99 /* Format TP into S according to FORMAT. Write no more than MAXSIZE wide characters and return the number of wide characters written, or 0 if it would exceed MAXSIZE. */ extern size_t wcsftime (wchar_t *__restrict __s, size_t __maxsize, const wchar_t *__restrict __format, const struct tm *__restrict __tp) __THROW; __END_NAMESPACE_C99 # ifdef __USE_GNU #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 861 "/usr/include/wchar.h" 3 4 # 862 "/usr/include/wchar.h" 3 4 /* Similar to `wcsftime' but takes the information from the provided locale and not the global locale. */ extern size_t wcsftime_l (wchar_t *__restrict __s, size_t __maxsize, const wchar_t *__restrict __format, const struct tm *__restrict __tp, __locale_t __loc) __THROW; # endif # 870 "/usr/include/wchar.h" 3 4 /* The X/Open standard demands that most of the functions defined in the header must also appear here. This is probably because some X/Open members wrote their implementation before the ISO C standard was published and introduced the better solution. We have to provide these definitions for compliance reasons but we do this nonsense only if really necessary. */ #if defined __USE_UNIX98 && !defined __USE_GNU # define __need_iswxxx #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 879 "/usr/include/wchar.h" 3 4 # 880 "/usr/include/wchar.h" 3 4 #endif # 881 "/usr/include/wchar.h" 3 4 /* Define some macros helping to catch buffer overflows. */ #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 884 "/usr/include/wchar.h" 3 4 # 885 "/usr/include/wchar.h" 3 4 #endif # 886 "/usr/include/wchar.h" 3 4 #ifdef __LDBL_COMPAT #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 888 "/usr/include/wchar.h" 3 4 # 889 "/usr/include/wchar.h" 3 4 #endif # 890 "/usr/include/wchar.h" 3 4 __END_DECLS #endif /* _WCHAR_H defined */ # 894 "/usr/include/wchar.h" 3 4 #endif /* wchar.h */ # 896 "/usr/include/wchar.h" 3 4 /* Undefine all __need_* constants in case we are included to get those constants but the whole file was already read. */ #undef __need_mbstate_t #undef __need_wint_t # 45 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 2 3 #endif # 46 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #ifndef _GLIBCXX_CWCHAR #define _GLIBCXX_CWCHAR 1 // Need to do a bit of trickery here with mbstate_t as char_traits // assumes it is in wchar.h, regardless of wchar_t specializations. #ifndef _GLIBCXX_HAVE_MBSTATE_T extern "C" { typedef struct { int __fill[6]; } mbstate_t; } #endif # 61 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 namespace std { using ::mbstate_t; } // namespace std // Get rid of those macros defined in in lieu of real functions. #undef btowc #undef fgetwc #undef fgetws #undef fputwc #undef fputws #undef fwide #undef fwprintf #undef fwscanf #undef getwc #undef getwchar #undef mbrlen #undef mbrtowc #undef mbsinit #undef mbsrtowcs #undef putwc #undef putwchar #undef swprintf #undef swscanf #undef ungetwc #undef vfwprintf #if _GLIBCXX_HAVE_VFWSCANF # undef vfwscanf #endif # 91 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #undef vswprintf #if _GLIBCXX_HAVE_VSWSCANF # undef vswscanf #endif # 95 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #undef vwprintf #if _GLIBCXX_HAVE_VWSCANF # undef vwscanf #endif # 99 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #undef wcrtomb #undef wcscat #undef wcschr #undef wcscmp #undef wcscoll #undef wcscpy #undef wcscspn #undef wcsftime #undef wcslen #undef wcsncat #undef wcsncmp #undef wcsncpy #undef wcspbrk #undef wcsrchr #undef wcsrtombs #undef wcsspn #undef wcsstr #undef wcstod #if _GLIBCXX_HAVE_WCSTOF # undef wcstof #endif # 120 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #undef wcstok #undef wcstol #undef wcstoul #undef wcsxfrm #undef wctob #undef wmemchr #undef wmemcmp #undef wmemcpy #undef wmemmove #undef wmemset #undef wprintf #undef wscanf #if _GLIBCXX_USE_WCHAR_T namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION using ::wint_t; using ::btowc; using ::fgetwc; using ::fgetws; using ::fputwc; using ::fputws; using ::fwide; using ::fwprintf; using ::fwscanf; using ::getwc; using ::getwchar; using ::mbrlen; using ::mbrtowc; using ::mbsinit; using ::mbsrtowcs; using ::putwc; using ::putwchar; #ifndef _GLIBCXX_HAVE_BROKEN_VSWPRINTF using ::swprintf; #endif # 160 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 using ::swscanf; using ::ungetwc; using ::vfwprintf; #if _GLIBCXX_HAVE_VFWSCANF using ::vfwscanf; #endif # 166 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #ifndef _GLIBCXX_HAVE_BROKEN_VSWPRINTF using ::vswprintf; #endif # 169 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #if _GLIBCXX_HAVE_VSWSCANF using ::vswscanf; #endif # 172 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 using ::vwprintf; #if _GLIBCXX_HAVE_VWSCANF using ::vwscanf; #endif # 176 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 using ::wcrtomb; using ::wcscat; using ::wcscmp; using ::wcscoll; using ::wcscpy; using ::wcscspn; using ::wcsftime; using ::wcslen; using ::wcsncat; using ::wcsncmp; using ::wcsncpy; using ::wcsrtombs; using ::wcsspn; using ::wcstod; #if _GLIBCXX_HAVE_WCSTOF using ::wcstof; #endif # 193 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 using ::wcstok; using ::wcstol; using ::wcstoul; using ::wcsxfrm; using ::wctob; using ::wmemcmp; using ::wmemcpy; using ::wmemmove; using ::wmemset; using ::wprintf; using ::wscanf; using ::wcschr; using ::wcspbrk; using ::wcsrchr; using ::wcsstr; using ::wmemchr; #ifndef __CORRECT_ISO_CPP_WCHAR_H_PROTO inline wchar_t* wcschr(wchar_t* __p, wchar_t __c) { return wcschr(const_cast(__p), __c); } inline wchar_t* wcspbrk(wchar_t* __s1, const wchar_t* __s2) { return wcspbrk(const_cast(__s1), __s2); } inline wchar_t* wcsrchr(wchar_t* __p, wchar_t __c) { return wcsrchr(const_cast(__p), __c); } inline wchar_t* wcsstr(wchar_t* __s1, const wchar_t* __s2) { return wcsstr(const_cast(__s1), __s2); } inline wchar_t* wmemchr(wchar_t* __p, wchar_t __c, size_t __n) { return wmemchr(const_cast(__p), __c, __n); } #endif # 231 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 _GLIBCXX_END_NAMESPACE_VERSION } // namespace #if _GLIBCXX_USE_C99 #undef wcstold #undef wcstoll #undef wcstoull namespace __gnu_cxx { #if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC extern "C" long double (wcstold)(const wchar_t * __restrict, wchar_t ** __restrict) throw (); #endif # 247 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #if !_GLIBCXX_USE_C99_DYNAMIC using ::wcstold; #endif # 250 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #if _GLIBCXX_USE_C99_LONG_LONG_CHECK || _GLIBCXX_USE_C99_LONG_LONG_DYNAMIC extern "C" long long int (wcstoll)(const wchar_t * __restrict, wchar_t ** __restrict, int) throw (); extern "C" unsigned long long int (wcstoull)(const wchar_t * __restrict, wchar_t ** __restrict, int) throw (); #endif # 256 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC using ::wcstoll; using ::wcstoull; #endif # 260 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 } // namespace __gnu_cxx namespace std { using ::__gnu_cxx::wcstold; using ::__gnu_cxx::wcstoll; using ::__gnu_cxx::wcstoull; } // namespace #endif # 270 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #endif //_GLIBCXX_USE_WCHAR_T # 272 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #if __cplusplus >= 201103L #ifdef _GLIBCXX_USE_WCHAR_T namespace std { #if _GLIBCXX_HAVE_WCSTOF using std::wcstof; #endif # 282 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #if _GLIBCXX_HAVE_VFWSCANF using std::vfwscanf; #endif # 285 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #if _GLIBCXX_HAVE_VSWSCANF using std::vswscanf; #endif # 288 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #if _GLIBCXX_HAVE_VWSCANF using std::vwscanf; #endif # 291 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #if _GLIBCXX_USE_C99 using std::wcstold; using std::wcstoll; using std::wcstoull; #endif # 297 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 } // namespace #endif // _GLIBCXX_USE_WCHAR_T # 300 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #endif // C++11 # 302 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #endif # 304 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/char_traits.h" 2 3 namespace __gnu_cxx _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION /** * @brief Mapping from character type to associated types. * * @note This is an implementation class for the generic version * of char_traits. It defines int_type, off_type, pos_type, and * state_type. By default these are unsigned long, streamoff, * streampos, and mbstate_t. Users who need a different set of * types, but who don't need to change the definitions of any function * defined in char_traits, can specialize __gnu_cxx::_Char_types * while leaving __gnu_cxx::char_traits alone. */ template struct _Char_types { typedef unsigned long int_type; typedef std::streampos pos_type; typedef std::streamoff off_type; typedef std::mbstate_t state_type; }; /** * @brief Base class used to implement std::char_traits. * * @note For any given actual character type, this definition is * probably wrong. (Most of the member functions are likely to be * right, but the int_type and state_type typedefs, and the eof() * member function, are likely to be wrong.) The reason this class * exists is so users can specialize it. Classes in namespace std * may not be specialized for fundamental types, but classes in * namespace __gnu_cxx may be. * * See https://gcc.gnu.org/onlinedocs/libstdc++/manual/strings.html#strings.string.character_types * for advice on how to make use of this class for @a unusual character * types. Also, check out include/ext/pod_char_traits.h. */ template struct char_traits { typedef _CharT char_type; typedef typename _Char_types<_CharT>::int_type int_type; typedef typename _Char_types<_CharT>::pos_type pos_type; typedef typename _Char_types<_CharT>::off_type off_type; typedef typename _Char_types<_CharT>::state_type state_type; static void assign(char_type& __c1, const char_type& __c2) { __c1 = __c2; } static _GLIBCXX_CONSTEXPR bool eq(const char_type& __c1, const char_type& __c2) { return __c1 == __c2; } static _GLIBCXX_CONSTEXPR bool lt(const char_type& __c1, const char_type& __c2) { return __c1 < __c2; } static int compare(const char_type* __s1, const char_type* __s2, std::size_t __n); static std::size_t length(const char_type* __s); static const char_type* find(const char_type* __s, std::size_t __n, const char_type& __a); static char_type* move(char_type* __s1, const char_type* __s2, std::size_t __n); static char_type* copy(char_type* __s1, const char_type* __s2, std::size_t __n); static char_type* assign(char_type* __s, std::size_t __n, char_type __a); static _GLIBCXX_CONSTEXPR char_type to_char_type(const int_type& __c) { return static_cast(__c); } static _GLIBCXX_CONSTEXPR int_type to_int_type(const char_type& __c) { return static_cast(__c); } static _GLIBCXX_CONSTEXPR bool eq_int_type(const int_type& __c1, const int_type& __c2) { return __c1 == __c2; } static _GLIBCXX_CONSTEXPR int_type eof() { return static_cast(_GLIBCXX_STDIO_EOF); } static _GLIBCXX_CONSTEXPR int_type not_eof(const int_type& __c) { return !eq_int_type(__c, eof()) ? __c : to_int_type(char_type()); } }; template int char_traits<_CharT>:: compare(const char_type* __s1, const char_type* __s2, std::size_t __n) { for (std::size_t __i = 0; __i < __n; ++__i) if (lt(__s1[__i], __s2[__i])) return -1; else if (lt(__s2[__i], __s1[__i])) return 1; return 0; } template std::size_t char_traits<_CharT>:: length(const char_type* __p) { std::size_t __i = 0; while (!eq(__p[__i], char_type())) ++__i; return __i; } template const typename char_traits<_CharT>::char_type* char_traits<_CharT>:: find(const char_type* __s, std::size_t __n, const char_type& __a) { for (std::size_t __i = 0; __i < __n; ++__i) if (eq(__s[__i], __a)) return __s + __i; return 0; } template typename char_traits<_CharT>::char_type* char_traits<_CharT>:: move(char_type* __s1, const char_type* __s2, std::size_t __n) { return static_cast<_CharT*>(__builtin_memmove(__s1, __s2, __n * sizeof(char_type))); } template typename char_traits<_CharT>::char_type* char_traits<_CharT>:: copy(char_type* __s1, const char_type* __s2, std::size_t __n) { // NB: Inline std::copy so no recursive dependencies. std::copy(__s2, __s2 + __n, __s1); return __s1; } template typename char_traits<_CharT>::char_type* char_traits<_CharT>:: assign(char_type* __s, std::size_t __n, char_type __a) { // NB: Inline std::fill_n so no recursive dependencies. std::fill_n(__s, __n, __a); return __s; } _GLIBCXX_END_NAMESPACE_VERSION } // namespace namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION // 21.1 /** * @brief Basis for explicit traits specializations. * * @note For any given actual character type, this definition is * probably wrong. Since this is just a thin wrapper around * __gnu_cxx::char_traits, it is possible to achieve a more * appropriate definition by specializing __gnu_cxx::char_traits. * * See https://gcc.gnu.org/onlinedocs/libstdc++/manual/strings.html#strings.string.character_types * for advice on how to make use of this class for @a unusual character * types. Also, check out include/ext/pod_char_traits.h. */ template struct char_traits : public __gnu_cxx::char_traits<_CharT> { }; /// 21.1.3.1 char_traits specializations template<> struct char_traits { typedef char char_type; typedef int int_type; typedef streampos pos_type; typedef streamoff off_type; typedef mbstate_t state_type; static void assign(char_type& __c1, const char_type& __c2) _GLIBCXX_NOEXCEPT { __c1 = __c2; } static _GLIBCXX_CONSTEXPR bool eq(const char_type& __c1, const char_type& __c2) _GLIBCXX_NOEXCEPT { return __c1 == __c2; } static _GLIBCXX_CONSTEXPR bool lt(const char_type& __c1, const char_type& __c2) _GLIBCXX_NOEXCEPT { // LWG 467. return (static_cast(__c1) < static_cast(__c2)); } static int compare(const char_type* __s1, const char_type* __s2, size_t __n) { if (__n == 0) return 0; return __builtin_memcmp(__s1, __s2, __n); } static size_t length(const char_type* __s) { return __builtin_strlen(__s); } static const char_type* find(const char_type* __s, size_t __n, const char_type& __a) { if (__n == 0) return 0; return static_cast(__builtin_memchr(__s, __a, __n)); } static char_type* move(char_type* __s1, const char_type* __s2, size_t __n) { if (__n == 0) return __s1; return static_cast(__builtin_memmove(__s1, __s2, __n)); } static char_type* copy(char_type* __s1, const char_type* __s2, size_t __n) { if (__n == 0) return __s1; return static_cast(__builtin_memcpy(__s1, __s2, __n)); } static char_type* assign(char_type* __s, size_t __n, char_type __a) { if (__n == 0) return __s; return static_cast(__builtin_memset(__s, __a, __n)); } static _GLIBCXX_CONSTEXPR char_type to_char_type(const int_type& __c) _GLIBCXX_NOEXCEPT { return static_cast(__c); } // To keep both the byte 0xff and the eof symbol 0xffffffff // from ending up as 0xffffffff. static _GLIBCXX_CONSTEXPR int_type to_int_type(const char_type& __c) _GLIBCXX_NOEXCEPT { return static_cast(static_cast(__c)); } static _GLIBCXX_CONSTEXPR bool eq_int_type(const int_type& __c1, const int_type& __c2) _GLIBCXX_NOEXCEPT { return __c1 == __c2; } static _GLIBCXX_CONSTEXPR int_type eof() _GLIBCXX_NOEXCEPT { return static_cast(_GLIBCXX_STDIO_EOF); } static _GLIBCXX_CONSTEXPR int_type not_eof(const int_type& __c) _GLIBCXX_NOEXCEPT { return (__c == eof()) ? 0 : __c; } }; #ifdef _GLIBCXX_USE_WCHAR_T /// 21.1.3.2 char_traits specializations template<> struct char_traits { typedef wchar_t char_type; typedef wint_t int_type; typedef streamoff off_type; typedef wstreampos pos_type; typedef mbstate_t state_type; static void assign(char_type& __c1, const char_type& __c2) _GLIBCXX_NOEXCEPT { __c1 = __c2; } static _GLIBCXX_CONSTEXPR bool eq(const char_type& __c1, const char_type& __c2) _GLIBCXX_NOEXCEPT { return __c1 == __c2; } static _GLIBCXX_CONSTEXPR bool lt(const char_type& __c1, const char_type& __c2) _GLIBCXX_NOEXCEPT { return __c1 < __c2; } static int compare(const char_type* __s1, const char_type* __s2, size_t __n) { if (__n == 0) return 0; return wmemcmp(__s1, __s2, __n); } static size_t length(const char_type* __s) { return wcslen(__s); } static const char_type* find(const char_type* __s, size_t __n, const char_type& __a) { if (__n == 0) return 0; return wmemchr(__s, __a, __n); } static char_type* move(char_type* __s1, const char_type* __s2, size_t __n) { if (__n == 0) return __s1; return wmemmove(__s1, __s2, __n); } static char_type* copy(char_type* __s1, const char_type* __s2, size_t __n) { if (__n == 0) return __s1; return wmemcpy(__s1, __s2, __n); } static char_type* assign(char_type* __s, size_t __n, char_type __a) { if (__n == 0) return __s; return wmemset(__s, __a, __n); } static _GLIBCXX_CONSTEXPR char_type to_char_type(const int_type& __c) _GLIBCXX_NOEXCEPT { return char_type(__c); } static _GLIBCXX_CONSTEXPR int_type to_int_type(const char_type& __c) _GLIBCXX_NOEXCEPT { return int_type(__c); } static _GLIBCXX_CONSTEXPR bool eq_int_type(const int_type& __c1, const int_type& __c2) _GLIBCXX_NOEXCEPT { return __c1 == __c2; } static _GLIBCXX_CONSTEXPR int_type eof() _GLIBCXX_NOEXCEPT { return static_cast(WEOF); } static _GLIBCXX_CONSTEXPR int_type not_eof(const int_type& __c) _GLIBCXX_NOEXCEPT { return eq_int_type(__c, eof()) ? 0 : __c; } }; #endif //_GLIBCXX_USE_WCHAR_T # 413 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/char_traits.h" 3 _GLIBCXX_END_NAMESPACE_VERSION } // namespace #if ((__cplusplus >= 201103L) \ && defined(_GLIBCXX_USE_C99_STDINT_TR1)) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 420 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/char_traits.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdint" 1 3 // -*- C++ -*- // Copyright (C) 2007-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file include/cstdint * This is a Standard C++ Library header. */ #ifndef _GLIBCXX_CSTDINT #define _GLIBCXX_CSTDINT 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 33 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdint" 3 #if __cplusplus < 201103L #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 35 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdint" 3 # 36 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdint" 3 #else # 37 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdint" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 38 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdint" 3 # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdint" 3 #if _GLIBCXX_HAVE_STDINT_H #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdint" 3 # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdint" 3 #endif # 43 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdint" 3 #ifdef _GLIBCXX_USE_C99_STDINT_TR1 namespace std { using ::int8_t; using ::int16_t; using ::int32_t; using ::int64_t; using ::int_fast8_t; using ::int_fast16_t; using ::int_fast32_t; using ::int_fast64_t; using ::int_least8_t; using ::int_least16_t; using ::int_least32_t; using ::int_least64_t; using ::intmax_t; using ::intptr_t; using ::uint8_t; using ::uint16_t; using ::uint32_t; using ::uint64_t; using ::uint_fast8_t; using ::uint_fast16_t; using ::uint_fast32_t; using ::uint_fast64_t; using ::uint_least8_t; using ::uint_least16_t; using ::uint_least32_t; using ::uint_least64_t; using ::uintmax_t; using ::uintptr_t; } // namespace std #endif // _GLIBCXX_USE_C99_STDINT_TR1 # 86 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdint" 3 #endif // C++11 # 88 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdint" 3 #endif // _GLIBCXX_CSTDINT # 90 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdint" 3 # 421 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/char_traits.h" 2 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION template<> struct char_traits { typedef char16_t char_type; typedef uint_least16_t int_type; typedef streamoff off_type; typedef u16streampos pos_type; typedef mbstate_t state_type; static void assign(char_type& __c1, const char_type& __c2) noexcept { __c1 = __c2; } static constexpr bool eq(const char_type& __c1, const char_type& __c2) noexcept { return __c1 == __c2; } static constexpr bool lt(const char_type& __c1, const char_type& __c2) noexcept { return __c1 < __c2; } static int compare(const char_type* __s1, const char_type* __s2, size_t __n) { for (size_t __i = 0; __i < __n; ++__i) if (lt(__s1[__i], __s2[__i])) return -1; else if (lt(__s2[__i], __s1[__i])) return 1; return 0; } static size_t length(const char_type* __s) { size_t __i = 0; while (!eq(__s[__i], char_type())) ++__i; return __i; } static const char_type* find(const char_type* __s, size_t __n, const char_type& __a) { for (size_t __i = 0; __i < __n; ++__i) if (eq(__s[__i], __a)) return __s + __i; return 0; } static char_type* move(char_type* __s1, const char_type* __s2, size_t __n) { if (__n == 0) return __s1; return (static_cast (__builtin_memmove(__s1, __s2, __n * sizeof(char_type)))); } static char_type* copy(char_type* __s1, const char_type* __s2, size_t __n) { if (__n == 0) return __s1; return (static_cast (__builtin_memcpy(__s1, __s2, __n * sizeof(char_type)))); } static char_type* assign(char_type* __s, size_t __n, char_type __a) { for (size_t __i = 0; __i < __n; ++__i) assign(__s[__i], __a); return __s; } static constexpr char_type to_char_type(const int_type& __c) noexcept { return char_type(__c); } static constexpr int_type to_int_type(const char_type& __c) noexcept { return int_type(__c); } static constexpr bool eq_int_type(const int_type& __c1, const int_type& __c2) noexcept { return __c1 == __c2; } static constexpr int_type eof() noexcept { return static_cast(-1); } static constexpr int_type not_eof(const int_type& __c) noexcept { return eq_int_type(__c, eof()) ? 0 : __c; } }; template<> struct char_traits { typedef char32_t char_type; typedef uint_least32_t int_type; typedef streamoff off_type; typedef u32streampos pos_type; typedef mbstate_t state_type; static void assign(char_type& __c1, const char_type& __c2) noexcept { __c1 = __c2; } static constexpr bool eq(const char_type& __c1, const char_type& __c2) noexcept { return __c1 == __c2; } static constexpr bool lt(const char_type& __c1, const char_type& __c2) noexcept { return __c1 < __c2; } static int compare(const char_type* __s1, const char_type* __s2, size_t __n) { for (size_t __i = 0; __i < __n; ++__i) if (lt(__s1[__i], __s2[__i])) return -1; else if (lt(__s2[__i], __s1[__i])) return 1; return 0; } static size_t length(const char_type* __s) { size_t __i = 0; while (!eq(__s[__i], char_type())) ++__i; return __i; } static const char_type* find(const char_type* __s, size_t __n, const char_type& __a) { for (size_t __i = 0; __i < __n; ++__i) if (eq(__s[__i], __a)) return __s + __i; return 0; } static char_type* move(char_type* __s1, const char_type* __s2, size_t __n) { if (__n == 0) return __s1; return (static_cast (__builtin_memmove(__s1, __s2, __n * sizeof(char_type)))); } static char_type* copy(char_type* __s1, const char_type* __s2, size_t __n) { if (__n == 0) return __s1; return (static_cast (__builtin_memcpy(__s1, __s2, __n * sizeof(char_type)))); } static char_type* assign(char_type* __s, size_t __n, char_type __a) { for (size_t __i = 0; __i < __n; ++__i) assign(__s[__i], __a); return __s; } static constexpr char_type to_char_type(const int_type& __c) noexcept { return char_type(__c); } static constexpr int_type to_int_type(const char_type& __c) noexcept { return int_type(__c); } static constexpr bool eq_int_type(const int_type& __c1, const int_type& __c2) noexcept { return __c1 == __c2; } static constexpr int_type eof() noexcept { return static_cast(-1); } static constexpr int_type not_eof(const int_type& __c) noexcept { return eq_int_type(__c, eof()) ? 0 : __c; } }; _GLIBCXX_END_NAMESPACE_VERSION } // namespace #endif # 624 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/char_traits.h" 3 #endif // _CHAR_TRAITS_H # 626 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/char_traits.h" 3 # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ios" 2 3 #if 0 /* expanded by -frewrite-includes */ #include // For class locale #endif /* expanded by -frewrite-includes */ # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ios" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/localefwd.h" 1 3 // Forward declarations -*- C++ -*- // Copyright (C) 1997-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file bits/localefwd.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{locale} */ // // ISO C++ 14882: 22.1 Locales // #ifndef _LOCALE_FWD_H #define _LOCALE_FWD_H 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 38 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/localefwd.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/localefwd.h" 3 # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/localefwd.h" 3 #if 0 /* expanded by -frewrite-includes */ #include // Defines __c_locale, config-specific include #endif /* expanded by -frewrite-includes */ # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/localefwd.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++locale.h" 1 3 // Wrapper for underlying C-language localization -*- C++ -*- // Copyright (C) 2001-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file bits/c++locale.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{locale} */ // // ISO C++ 14882: 22.8 Standard locale categories. // // Written by Benjamin Kosnik #ifndef _GLIBCXX_CXX_LOCALE_H #define _GLIBCXX_CXX_LOCALE_H 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++locale.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++locale.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/clocale" 1 3 // -*- C++ -*- forwarding header. // Copyright (C) 1997-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file clocale * This is a Standard C++ Library file. You should @c \#include this file * in your programs, rather than any of the @a *.h implementation files. * * This is the C++ version of the Standard C Library header @c locale.h, * and its contents are (mostly) the same as that header, but are all * contained in the namespace @c std (except for names which are defined * as macros in C). */ // // ISO C++ 14882: 18.2.2 Implementation properties: C library // #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/clocale" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/clocale" 3 # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/clocale" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/clocale" 3 # 1 "/usr/include/locale.h" 1 3 4 /* Copyright (C) 1991-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard: 7.11 Localization */ #ifndef _LOCALE_H #define _LOCALE_H 1 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 25 "/usr/include/locale.h" 3 4 # 26 "/usr/include/locale.h" 3 4 #define __need_NULL #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 28 "/usr/include/locale.h" 3 4 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 1 3 4 /*===---- stddef.h - Basic type definitions --------------------------------=== * * Copyright (c) 2008 Eli Friedman * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #if !defined(__STDDEF_H) || defined(__need_ptrdiff_t) || \ defined(__need_size_t) || defined(__need_wchar_t) || \ defined(__need_NULL) || defined(__need_wint_t) #if !defined(__need_ptrdiff_t) && !defined(__need_size_t) && \ !defined(__need_wchar_t) && !defined(__need_NULL) && \ !defined(__need_wint_t) /* Always define miscellaneous pieces when modules are available. */ #if !__has_feature(modules) #define __STDDEF_H #endif # 37 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #define __need_ptrdiff_t #define __need_size_t #define __need_wchar_t #define __need_NULL #define __need_STDDEF_H_misc /* __need_wint_t is intentionally not defined here. */ #endif # 44 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_ptrdiff_t) #if !defined(_PTRDIFF_T) || __has_feature(modules) /* Always define ptrdiff_t when modules are available. */ #if !__has_feature(modules) #define _PTRDIFF_T #endif # 51 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 typedef __PTRDIFF_TYPE__ ptrdiff_t; #endif # 53 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #undef __need_ptrdiff_t #endif /* defined(__need_ptrdiff_t) */ # 55 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_size_t) #if !defined(_SIZE_T) || __has_feature(modules) /* Always define size_t when modules are available. */ #if !__has_feature(modules) #define _SIZE_T #endif # 62 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 typedef __SIZE_TYPE__ size_t; #endif # 64 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #undef __need_size_t #endif /*defined(__need_size_t) */ # 66 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_STDDEF_H_misc) /* ISO9899:2011 7.20 (C11 Annex K): Define rsize_t if __STDC_WANT_LIB_EXT1__ is * enabled. */ #if (defined(__STDC_WANT_LIB_EXT1__) && __STDC_WANT_LIB_EXT1__ >= 1 && \ !defined(_RSIZE_T)) || __has_feature(modules) /* Always define rsize_t when modules are available. */ #if !__has_feature(modules) #define _RSIZE_T #endif # 76 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 typedef __SIZE_TYPE__ rsize_t; #endif # 78 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif /* defined(__need_STDDEF_H_misc) */ # 79 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_wchar_t) #ifndef __cplusplus /* Always define wchar_t when modules are available. */ #if !defined(_WCHAR_T) || __has_feature(modules) #if !__has_feature(modules) #define _WCHAR_T #if defined(_MSC_EXTENSIONS) #define _WCHAR_T_DEFINED #endif # 89 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif # 90 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 typedef __WCHAR_TYPE__ wchar_t; #endif # 92 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif # 93 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #undef __need_wchar_t #endif /* defined(__need_wchar_t) */ # 95 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_NULL) #undef NULL #ifdef __cplusplus # if !defined(__MINGW32__) && !defined(_MSC_VER) # define NULL __null # else # 102 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 # define NULL 0 # endif # 104 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #else # 105 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 # define NULL ((void*)0) #endif # 107 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #ifdef __cplusplus #if defined(_MSC_EXTENSIONS) && defined(_NATIVE_NULLPTR_SUPPORTED) namespace std { typedef decltype(nullptr) nullptr_t; } using ::std::nullptr_t; #endif # 112 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif # 113 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #undef __need_NULL #endif /* defined(__need_NULL) */ # 115 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_STDDEF_H_misc) #if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L #if 0 /* expanded by -frewrite-includes */ #include "__stddef_max_align_t.h" #endif /* expanded by -frewrite-includes */ # 118 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 # 119 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif # 120 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #define offsetof(t, d) __builtin_offsetof(t, d) #undef __need_STDDEF_H_misc #endif /* defined(__need_STDDEF_H_misc) */ # 123 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 /* Some C libraries expect to see a wint_t here. Others (notably MinGW) will use __WINT_TYPE__ directly; accommodate both by requiring __need_wint_t */ #if defined(__need_wint_t) /* Always define wint_t when modules are available. */ #if !defined(_WINT_T) || __has_feature(modules) #if !__has_feature(modules) #define _WINT_T #endif # 132 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 typedef __WINT_TYPE__ wint_t; #endif # 134 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #undef __need_wint_t #endif /* __need_wint_t */ # 136 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif # 138 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 # 29 "/usr/include/locale.h" 2 3 4 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 29 "/usr/include/locale.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/locale.h" 1 3 4 /* Definition of locale category symbol values. Copyright (C) 2001-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #if !defined _LOCALE_H && !defined _LANGINFO_H # error "Never use directly; include instead." #endif # 22 "/usr/include/x86_64-linux-gnu/bits/locale.h" 3 4 #ifndef _BITS_LOCALE_H #define _BITS_LOCALE_H 1 #define __LC_CTYPE 0 #define __LC_NUMERIC 1 #define __LC_TIME 2 #define __LC_COLLATE 3 #define __LC_MONETARY 4 #define __LC_MESSAGES 5 #define __LC_ALL 6 #define __LC_PAPER 7 #define __LC_NAME 8 #define __LC_ADDRESS 9 #define __LC_TELEPHONE 10 #define __LC_MEASUREMENT 11 #define __LC_IDENTIFICATION 12 #endif /* bits/locale.h */ # 41 "/usr/include/x86_64-linux-gnu/bits/locale.h" 3 4 # 30 "/usr/include/locale.h" 2 3 4 __BEGIN_DECLS /* These are the possibilities for the first argument to setlocale. The code assumes that the lowest LC_* symbol has the value zero. */ #define LC_CTYPE __LC_CTYPE #define LC_NUMERIC __LC_NUMERIC #define LC_TIME __LC_TIME #define LC_COLLATE __LC_COLLATE #define LC_MONETARY __LC_MONETARY #define LC_MESSAGES __LC_MESSAGES #define LC_ALL __LC_ALL #define LC_PAPER __LC_PAPER #define LC_NAME __LC_NAME #define LC_ADDRESS __LC_ADDRESS #define LC_TELEPHONE __LC_TELEPHONE #define LC_MEASUREMENT __LC_MEASUREMENT #define LC_IDENTIFICATION __LC_IDENTIFICATION __BEGIN_NAMESPACE_STD /* Structure giving information about numeric and monetary notation. */ struct lconv { /* Numeric (non-monetary) information. */ char *decimal_point; /* Decimal point character. */ char *thousands_sep; /* Thousands separator. */ /* Each element is the number of digits in each group; elements with higher indices are farther left. An element with value CHAR_MAX means that no further grouping is done. An element with value 0 means that the previous element is used for all groups farther left. */ char *grouping; /* Monetary information. */ /* First three chars are a currency symbol from ISO 4217. Fourth char is the separator. Fifth char is '\0'. */ char *int_curr_symbol; char *currency_symbol; /* Local currency symbol. */ char *mon_decimal_point; /* Decimal point character. */ char *mon_thousands_sep; /* Thousands separator. */ char *mon_grouping; /* Like `grouping' element (above). */ char *positive_sign; /* Sign for positive values. */ char *negative_sign; /* Sign for negative values. */ char int_frac_digits; /* Int'l fractional digits. */ char frac_digits; /* Local fractional digits. */ /* 1 if currency_symbol precedes a positive value, 0 if succeeds. */ char p_cs_precedes; /* 1 iff a space separates currency_symbol from a positive value. */ char p_sep_by_space; /* 1 if currency_symbol precedes a negative value, 0 if succeeds. */ char n_cs_precedes; /* 1 iff a space separates currency_symbol from a negative value. */ char n_sep_by_space; /* Positive and negative sign positions: 0 Parentheses surround the quantity and currency_symbol. 1 The sign string precedes the quantity and currency_symbol. 2 The sign string follows the quantity and currency_symbol. 3 The sign string immediately precedes the currency_symbol. 4 The sign string immediately follows the currency_symbol. */ char p_sign_posn; char n_sign_posn; #ifdef __USE_ISOC99 /* 1 if int_curr_symbol precedes a positive value, 0 if succeeds. */ char int_p_cs_precedes; /* 1 iff a space separates int_curr_symbol from a positive value. */ char int_p_sep_by_space; /* 1 if int_curr_symbol precedes a negative value, 0 if succeeds. */ char int_n_cs_precedes; /* 1 iff a space separates int_curr_symbol from a negative value. */ char int_n_sep_by_space; /* Positive and negative sign positions: 0 Parentheses surround the quantity and int_curr_symbol. 1 The sign string precedes the quantity and int_curr_symbol. 2 The sign string follows the quantity and int_curr_symbol. 3 The sign string immediately precedes the int_curr_symbol. 4 The sign string immediately follows the int_curr_symbol. */ char int_p_sign_posn; char int_n_sign_posn; #else # 113 "/usr/include/locale.h" 3 4 char __int_p_cs_precedes; char __int_p_sep_by_space; char __int_n_cs_precedes; char __int_n_sep_by_space; char __int_p_sign_posn; char __int_n_sign_posn; #endif # 120 "/usr/include/locale.h" 3 4 }; /* Set and/or return the current locale. */ extern char *setlocale (int __category, const char *__locale) __THROW; /* Return the numeric/monetary information for the current locale. */ extern struct lconv *localeconv (void) __THROW; __END_NAMESPACE_STD #ifdef __USE_XOPEN2K8 /* The concept of one static locale per category is not very well thought out. Many applications will need to process its data using information from several different locales. Another application is the implementation of the internationalization handling in the upcoming ISO C++ standard library. To support this another set of the functions using locale data exist which have an additional argument. Attention: all these functions are *not* standardized in any form. This is a proof-of-concept implementation. */ /* Get locale datatype definition. */ #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 145 "/usr/include/locale.h" 3 4 # 146 "/usr/include/locale.h" 3 4 /* Return a reference to a data structure representing a set of locale datasets. Unlike for the CATEGORY parameter for `setlocale' the CATEGORY_MASK parameter here uses a single bit for each category, made by OR'ing together LC_*_MASK bits above. */ extern __locale_t newlocale (int __category_mask, const char *__locale, __locale_t __base) __THROW; /* These are the bits that can be set in the CATEGORY_MASK argument to `newlocale'. In the GNU implementation, LC_FOO_MASK has the value of (1 << LC_FOO), but this is not a part of the interface that callers can assume will be true. */ # define LC_CTYPE_MASK (1 << __LC_CTYPE) # define LC_NUMERIC_MASK (1 << __LC_NUMERIC) # define LC_TIME_MASK (1 << __LC_TIME) # define LC_COLLATE_MASK (1 << __LC_COLLATE) # define LC_MONETARY_MASK (1 << __LC_MONETARY) # define LC_MESSAGES_MASK (1 << __LC_MESSAGES) # define LC_PAPER_MASK (1 << __LC_PAPER) # define LC_NAME_MASK (1 << __LC_NAME) # define LC_ADDRESS_MASK (1 << __LC_ADDRESS) # define LC_TELEPHONE_MASK (1 << __LC_TELEPHONE) # define LC_MEASUREMENT_MASK (1 << __LC_MEASUREMENT) # define LC_IDENTIFICATION_MASK (1 << __LC_IDENTIFICATION) # define LC_ALL_MASK (LC_CTYPE_MASK \ | LC_NUMERIC_MASK \ | LC_TIME_MASK \ | LC_COLLATE_MASK \ | LC_MONETARY_MASK \ | LC_MESSAGES_MASK \ | LC_PAPER_MASK \ | LC_NAME_MASK \ | LC_ADDRESS_MASK \ | LC_TELEPHONE_MASK \ | LC_MEASUREMENT_MASK \ | LC_IDENTIFICATION_MASK \ ) /* Return a duplicate of the set of locale in DATASET. All usage counters are increased if necessary. */ extern __locale_t duplocale (__locale_t __dataset) __THROW; /* Free the data associated with a locale dataset previously returned by a call to `setlocale_r'. */ extern void freelocale (__locale_t __dataset) __THROW; /* Switch the current thread's locale to DATASET. If DATASET is null, instead just return the current setting. The special value LC_GLOBAL_LOCALE is the initial setting for all threads and can also be installed any time, meaning the thread uses the global settings controlled by `setlocale'. */ extern __locale_t uselocale (__locale_t __dataset) __THROW; /* This value can be passed to `uselocale' and may be returned by it. Passing this value to any other function has undefined behavior. */ # define LC_GLOBAL_LOCALE ((__locale_t) -1L) #endif # 204 "/usr/include/locale.h" 3 4 __END_DECLS #endif /* locale.h */ # 208 "/usr/include/locale.h" 3 4 # 43 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/clocale" 2 3 #ifndef _GLIBCXX_CLOCALE #define _GLIBCXX_CLOCALE 1 // Get rid of those macros defined in in lieu of real functions. #undef setlocale #undef localeconv namespace std { using ::lconv; using ::setlocale; using ::localeconv; } // namespace std #endif # 59 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/clocale" 3 # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++locale.h" 2 3 #define _GLIBCXX_C_LOCALE_GNU 1 #define _GLIBCXX_NUM_CATEGORIES 6 #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) namespace __gnu_cxx _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION extern "C" __typeof(uselocale) __uselocale; _GLIBCXX_END_NAMESPACE_VERSION } // namespace #endif # 57 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++locale.h" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION typedef __locale_t __c_locale; // Convert numeric value of type double and long double to string and // return length of string. If vsnprintf is available use it, otherwise // fall back to the unsafe vsprintf which, in general, can be dangerous // and should be avoided. inline int __convert_from_v(const __c_locale& __cloc __attribute__ ((__unused__)), char* __out, const int __size __attribute__ ((__unused__)), const char* __fmt, ...) { #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) __c_locale __old = __gnu_cxx::__uselocale(__cloc); #else # 77 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++locale.h" 3 char* __old = std::setlocale(LC_NUMERIC, 0); char* __sav = 0; if (__builtin_strcmp(__old, "C")) { const size_t __len = __builtin_strlen(__old) + 1; __sav = new char[__len]; __builtin_memcpy(__sav, __old, __len); std::setlocale(LC_NUMERIC, "C"); } #endif # 87 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++locale.h" 3 __builtin_va_list __args; __builtin_va_start(__args, __fmt); #ifdef _GLIBCXX_USE_C99 const int __ret = __builtin_vsnprintf(__out, __size, __fmt, __args); #else # 94 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++locale.h" 3 const int __ret = __builtin_vsprintf(__out, __fmt, __args); #endif # 96 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++locale.h" 3 __builtin_va_end(__args); #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) __gnu_cxx::__uselocale(__old); #else # 102 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++locale.h" 3 if (__sav) { std::setlocale(LC_NUMERIC, __sav); delete [] __sav; } #endif # 108 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++locale.h" 3 return __ret; } _GLIBCXX_END_NAMESPACE_VERSION } // namespace #endif # 115 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++locale.h" 3 # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/localefwd.h" 2 3 #if 0 /* expanded by -frewrite-includes */ #include // For ostreambuf_iterator, istreambuf_iterator #endif /* expanded by -frewrite-includes */ # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/localefwd.h" 3 # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/localefwd.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/localefwd.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cctype" 1 3 // -*- C++ -*- forwarding header. // Copyright (C) 1997-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file include/cctype * This is a Standard C++ Library file. You should @c \#include this file * in your programs, rather than any of the @a *.h implementation files. * * This is the C++ version of the Standard C Library header @c ctype.h, * and its contents are (mostly) the same as that header, but are all * contained in the namespace @c std (except for names which are defined * as macros in C). */ // // ISO C++ 14882: // #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cctype" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cctype" 3 # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cctype" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cctype" 3 # 1 "/usr/include/ctype.h" 1 3 4 /* Copyright (C) 1991-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard 7.4: Character handling */ #ifndef _CTYPE_H #define _CTYPE_H 1 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 25 "/usr/include/ctype.h" 3 4 # 26 "/usr/include/ctype.h" 3 4 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 26 "/usr/include/ctype.h" 3 4 # 27 "/usr/include/ctype.h" 3 4 __BEGIN_DECLS #ifndef _ISbit /* These are all the characteristics of characters. If there get to be more than 16 distinct characteristics, many things must be changed that use `unsigned short int's. The characteristics are stored always in network byte order (big endian). We define the bit value interpretations here dependent on the machine's byte order. */ #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 39 "/usr/include/ctype.h" 3 4 # 40 "/usr/include/ctype.h" 3 4 # if __BYTE_ORDER == __BIG_ENDIAN # define _ISbit(bit) (1 << (bit)) # else /* __BYTE_ORDER == __LITTLE_ENDIAN */ # 43 "/usr/include/ctype.h" 3 4 # define _ISbit(bit) ((bit) < 8 ? ((1 << (bit)) << 8) : ((1 << (bit)) >> 8)) # endif # 45 "/usr/include/ctype.h" 3 4 enum { _ISupper = _ISbit (0), /* UPPERCASE. */ _ISlower = _ISbit (1), /* lowercase. */ _ISalpha = _ISbit (2), /* Alphabetic. */ _ISdigit = _ISbit (3), /* Numeric. */ _ISxdigit = _ISbit (4), /* Hexadecimal numeric. */ _ISspace = _ISbit (5), /* Whitespace. */ _ISprint = _ISbit (6), /* Printing. */ _ISgraph = _ISbit (7), /* Graphical. */ _ISblank = _ISbit (8), /* Blank (usually SPC and TAB). */ _IScntrl = _ISbit (9), /* Control character. */ _ISpunct = _ISbit (10), /* Punctuation. */ _ISalnum = _ISbit (11) /* Alphanumeric. */ }; #endif /* ! _ISbit */ # 62 "/usr/include/ctype.h" 3 4 /* These are defined in ctype-info.c. The declarations here must match those in localeinfo.h. In the thread-specific locale model (see `uselocale' in ) we cannot use global variables for these as was done in the past. Instead, the following accessor functions return the address of each variable, which is local to the current thread if multithreaded. These point into arrays of 384, so they can be indexed by any `unsigned char' value [0,255]; by EOF (-1); or by any `signed char' value [-128,-1). ISO C requires that the ctype functions work for `unsigned char' values and for EOF; we also support negative `signed char' values for broken old programs. The case conversion arrays are of `int's rather than `unsigned char's because tolower (EOF) must be EOF, which doesn't fit into an `unsigned char'. But today more important is that the arrays are also used for multi-byte character sets. */ extern const unsigned short int **__ctype_b_loc (void) __THROW __attribute__ ((__const__)); extern const __int32_t **__ctype_tolower_loc (void) __THROW __attribute__ ((__const__)); extern const __int32_t **__ctype_toupper_loc (void) __THROW __attribute__ ((__const__)); #ifndef __cplusplus # define __isctype(c, type) \ ((*__ctype_b_loc ())[(int) (c)] & (unsigned short int) type) #elif defined __USE_EXTERN_INLINES # 91 "/usr/include/ctype.h" 3 4 # define __isctype_f(type) \ __extern_inline int \ is##type (int __c) __THROW \ { \ return (*__ctype_b_loc ())[(int) (__c)] & (unsigned short int) _IS##type; \ } #endif # 98 "/usr/include/ctype.h" 3 4 #define __isascii(c) (((c) & ~0x7f) == 0) /* If C is a 7 bit value. */ #define __toascii(c) ((c) & 0x7f) /* Mask off high bits. */ #define __exctype(name) extern int name (int) __THROW __BEGIN_NAMESPACE_STD /* The following names are all functions: int isCHARACTERISTIC(int c); which return nonzero iff C has CHARACTERISTIC. For the meaning of the characteristic names, see the `enum' above. */ __exctype (isalnum); __exctype (isalpha); __exctype (iscntrl); __exctype (isdigit); __exctype (islower); __exctype (isgraph); __exctype (isprint); __exctype (ispunct); __exctype (isspace); __exctype (isupper); __exctype (isxdigit); /* Return the lowercase version of C. */ extern int tolower (int __c) __THROW; /* Return the uppercase version of C. */ extern int toupper (int __c) __THROW; __END_NAMESPACE_STD /* ISO C99 introduced one new function. */ #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 __exctype (isblank); __END_NAMESPACE_C99 #endif # 140 "/usr/include/ctype.h" 3 4 #ifdef __USE_GNU /* Test C for a set of character classes according to MASK. */ extern int isctype (int __c, int __mask) __THROW; #endif # 145 "/usr/include/ctype.h" 3 4 #if defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN /* Return nonzero iff C is in the ASCII set (i.e., is no more than 7 bits wide). */ extern int isascii (int __c) __THROW; /* Return the part of C that is in the ASCII set (i.e., the low-order 7 bits of C). */ extern int toascii (int __c) __THROW; /* These are the same as `toupper' and `tolower' except that they do not check the argument for being in the range of a `char'. */ __exctype (_toupper); __exctype (_tolower); #endif /* Use SVID or use misc. */ # 161 "/usr/include/ctype.h" 3 4 /* This code is needed for the optimized mapping functions. */ #define __tobody(c, f, a, args) \ (__extension__ \ ({ int __res; \ if (sizeof (c) > 1) \ { \ if (__builtin_constant_p (c)) \ { \ int __c = (c); \ __res = __c < -128 || __c > 255 ? __c : (a)[__c]; \ } \ else \ __res = f args; \ } \ else \ __res = (a)[(int) (c)]; \ __res; })) #if !defined __NO_CTYPE # ifdef __isctype_f __isctype_f (alnum) __isctype_f (alpha) __isctype_f (cntrl) __isctype_f (digit) __isctype_f (lower) __isctype_f (graph) __isctype_f (print) __isctype_f (punct) __isctype_f (space) __isctype_f (upper) __isctype_f (xdigit) # ifdef __USE_ISOC99 __isctype_f (blank) # endif # 196 "/usr/include/ctype.h" 3 4 # elif defined __isctype # 197 "/usr/include/ctype.h" 3 4 # define isalnum(c) __isctype((c), _ISalnum) # define isalpha(c) __isctype((c), _ISalpha) # define iscntrl(c) __isctype((c), _IScntrl) # define isdigit(c) __isctype((c), _ISdigit) # define islower(c) __isctype((c), _ISlower) # define isgraph(c) __isctype((c), _ISgraph) # define isprint(c) __isctype((c), _ISprint) # define ispunct(c) __isctype((c), _ISpunct) # define isspace(c) __isctype((c), _ISspace) # define isupper(c) __isctype((c), _ISupper) # define isxdigit(c) __isctype((c), _ISxdigit) # ifdef __USE_ISOC99 # define isblank(c) __isctype((c), _ISblank) # endif # 211 "/usr/include/ctype.h" 3 4 # endif # 212 "/usr/include/ctype.h" 3 4 # ifdef __USE_EXTERN_INLINES __extern_inline int __NTH (tolower (int __c)) { return __c >= -128 && __c < 256 ? (*__ctype_tolower_loc ())[__c] : __c; } __extern_inline int __NTH (toupper (int __c)) { return __c >= -128 && __c < 256 ? (*__ctype_toupper_loc ())[__c] : __c; } # endif # 226 "/usr/include/ctype.h" 3 4 # if __GNUC__ >= 2 && defined __OPTIMIZE__ && !defined __cplusplus # define tolower(c) __tobody (c, tolower, *__ctype_tolower_loc (), (c)) # define toupper(c) __tobody (c, toupper, *__ctype_toupper_loc (), (c)) # endif /* Optimizing gcc */ # 231 "/usr/include/ctype.h" 3 4 # if defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN # define isascii(c) __isascii (c) # define toascii(c) __toascii (c) # define _tolower(c) ((int) (*__ctype_tolower_loc ())[(int) (c)]) # define _toupper(c) ((int) (*__ctype_toupper_loc ())[(int) (c)]) # endif # 239 "/usr/include/ctype.h" 3 4 #endif /* Not __NO_CTYPE. */ # 241 "/usr/include/ctype.h" 3 4 #ifdef __USE_XOPEN2K8 /* The concept of one static locale per category is not very well thought out. Many applications will need to process its data using information from several different locales. Another application is the implementation of the internationalization handling in the upcoming ISO C++ standard library. To support this another set of the functions using locale data exist which have an additional argument. Attention: all these functions are *not* standardized in any form. This is a proof-of-concept implementation. */ /* Structure for reentrant locale using functions. This is an (almost) opaque type for the user level programs. */ #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 257 "/usr/include/ctype.h" 3 4 # 258 "/usr/include/ctype.h" 3 4 /* These definitions are similar to the ones above but all functions take as an argument a handle for the locale which shall be used. */ # define __isctype_l(c, type, locale) \ ((locale)->__ctype_b[(int) (c)] & (unsigned short int) type) # define __exctype_l(name) \ extern int name (int, __locale_t) __THROW /* The following names are all functions: int isCHARACTERISTIC(int c, locale_t *locale); which return nonzero iff C has CHARACTERISTIC. For the meaning of the characteristic names, see the `enum' above. */ __exctype_l (isalnum_l); __exctype_l (isalpha_l); __exctype_l (iscntrl_l); __exctype_l (isdigit_l); __exctype_l (islower_l); __exctype_l (isgraph_l); __exctype_l (isprint_l); __exctype_l (ispunct_l); __exctype_l (isspace_l); __exctype_l (isupper_l); __exctype_l (isxdigit_l); __exctype_l (isblank_l); /* Return the lowercase version of C in locale L. */ extern int __tolower_l (int __c, __locale_t __l) __THROW; extern int tolower_l (int __c, __locale_t __l) __THROW; /* Return the uppercase version of C. */ extern int __toupper_l (int __c, __locale_t __l) __THROW; extern int toupper_l (int __c, __locale_t __l) __THROW; # if __GNUC__ >= 2 && defined __OPTIMIZE__ && !defined __cplusplus # define __tolower_l(c, locale) \ __tobody (c, __tolower_l, (locale)->__ctype_tolower, (c, locale)) # define __toupper_l(c, locale) \ __tobody (c, __toupper_l, (locale)->__ctype_toupper, (c, locale)) # define tolower_l(c, locale) __tolower_l ((c), (locale)) # define toupper_l(c, locale) __toupper_l ((c), (locale)) # endif /* Optimizing gcc */ # 302 "/usr/include/ctype.h" 3 4 # ifndef __NO_CTYPE # define __isalnum_l(c,l) __isctype_l((c), _ISalnum, (l)) # define __isalpha_l(c,l) __isctype_l((c), _ISalpha, (l)) # define __iscntrl_l(c,l) __isctype_l((c), _IScntrl, (l)) # define __isdigit_l(c,l) __isctype_l((c), _ISdigit, (l)) # define __islower_l(c,l) __isctype_l((c), _ISlower, (l)) # define __isgraph_l(c,l) __isctype_l((c), _ISgraph, (l)) # define __isprint_l(c,l) __isctype_l((c), _ISprint, (l)) # define __ispunct_l(c,l) __isctype_l((c), _ISpunct, (l)) # define __isspace_l(c,l) __isctype_l((c), _ISspace, (l)) # define __isupper_l(c,l) __isctype_l((c), _ISupper, (l)) # define __isxdigit_l(c,l) __isctype_l((c), _ISxdigit, (l)) # define __isblank_l(c,l) __isctype_l((c), _ISblank, (l)) # if defined __USE_SVID || defined __USE_MISC # define __isascii_l(c,l) ((l), __isascii (c)) # define __toascii_l(c,l) ((l), __toascii (c)) # endif # 323 "/usr/include/ctype.h" 3 4 # define isalnum_l(c,l) __isalnum_l ((c), (l)) # define isalpha_l(c,l) __isalpha_l ((c), (l)) # define iscntrl_l(c,l) __iscntrl_l ((c), (l)) # define isdigit_l(c,l) __isdigit_l ((c), (l)) # define islower_l(c,l) __islower_l ((c), (l)) # define isgraph_l(c,l) __isgraph_l ((c), (l)) # define isprint_l(c,l) __isprint_l ((c), (l)) # define ispunct_l(c,l) __ispunct_l ((c), (l)) # define isspace_l(c,l) __isspace_l ((c), (l)) # define isupper_l(c,l) __isupper_l ((c), (l)) # define isxdigit_l(c,l) __isxdigit_l ((c), (l)) # define isblank_l(c,l) __isblank_l ((c), (l)) # if defined __USE_SVID || defined __USE_MISC # define isascii_l(c,l) __isascii_l ((c), (l)) # define toascii_l(c,l) __toascii_l ((c), (l)) # endif # 342 "/usr/include/ctype.h" 3 4 # endif /* Not __NO_CTYPE. */ # 344 "/usr/include/ctype.h" 3 4 #endif /* Use POSIX 2008. */ # 346 "/usr/include/ctype.h" 3 4 __END_DECLS #endif /* ctype.h */ # 350 "/usr/include/ctype.h" 3 4 # 43 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cctype" 2 3 #ifndef _GLIBCXX_CCTYPE #define _GLIBCXX_CCTYPE 1 // Get rid of those macros defined in in lieu of real functions. #undef isalnum #undef isalpha #undef iscntrl #undef isdigit #undef isgraph #undef islower #undef isprint #undef ispunct #undef isspace #undef isupper #undef isxdigit #undef tolower #undef toupper namespace std { using ::isalnum; using ::isalpha; using ::iscntrl; using ::isdigit; using ::isgraph; using ::islower; using ::isprint; using ::ispunct; using ::isspace; using ::isupper; using ::isxdigit; using ::tolower; using ::toupper; } // namespace std #if __cplusplus >= 201103L #ifdef _GLIBCXX_USE_C99_CTYPE_TR1 #undef isblank namespace std { using ::isblank; } // namespace std #endif // _GLIBCXX_USE_C99_CTYPE_TR1 # 91 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cctype" 3 #endif // C++11 # 93 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cctype" 3 #endif # 95 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cctype" 3 # 43 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/localefwd.h" 2 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION /** * @defgroup locales Locales * * Classes and functions for internationalization and localization. */ // 22.1.1 Locale class locale; template bool has_facet(const locale&) throw(); template const _Facet& use_facet(const locale&); // 22.1.3 Convenience interfaces template bool isspace(_CharT, const locale&); template bool isprint(_CharT, const locale&); template bool iscntrl(_CharT, const locale&); template bool isupper(_CharT, const locale&); template bool islower(_CharT, const locale&); template bool isalpha(_CharT, const locale&); template bool isdigit(_CharT, const locale&); template bool ispunct(_CharT, const locale&); template bool isxdigit(_CharT, const locale&); template bool isalnum(_CharT, const locale&); template bool isgraph(_CharT, const locale&); #if __cplusplus >= 201103L template bool isblank(_CharT, const locale&); #endif # 115 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/localefwd.h" 3 template _CharT toupper(_CharT, const locale&); template _CharT tolower(_CharT, const locale&); // 22.2.1 and 22.2.1.3 ctype class ctype_base; template class ctype; template<> class ctype; #ifdef _GLIBCXX_USE_WCHAR_T template<> class ctype; #endif # 132 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/localefwd.h" 3 template class ctype_byname; // NB: Specialized for char and wchar_t in locale_facets.h. class codecvt_base; template class codecvt; template<> class codecvt; #ifdef _GLIBCXX_USE_WCHAR_T template<> class codecvt; #endif # 143 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/localefwd.h" 3 template class codecvt_byname; // 22.2.2 and 22.2.3 numeric _GLIBCXX_BEGIN_NAMESPACE_LDBL template > class num_get; template > class num_put; _GLIBCXX_END_NAMESPACE_LDBL _GLIBCXX_BEGIN_NAMESPACE_CXX11 template class numpunct; template class numpunct_byname; _GLIBCXX_END_NAMESPACE_CXX11 _GLIBCXX_BEGIN_NAMESPACE_CXX11 // 22.2.4 collation template class collate; template class collate_byname; _GLIBCXX_END_NAMESPACE_CXX11 // 22.2.5 date and time class time_base; _GLIBCXX_BEGIN_NAMESPACE_CXX11 template > class time_get; template > class time_get_byname; _GLIBCXX_END_NAMESPACE_CXX11 template > class time_put; template > class time_put_byname; // 22.2.6 money class money_base; _GLIBCXX_BEGIN_NAMESPACE_LDBL_OR_CXX11 template > class money_get; template > class money_put; _GLIBCXX_END_NAMESPACE_LDBL_OR_CXX11 _GLIBCXX_BEGIN_NAMESPACE_CXX11 template class moneypunct; template class moneypunct_byname; _GLIBCXX_END_NAMESPACE_CXX11 // 22.2.7 message retrieval class messages_base; _GLIBCXX_BEGIN_NAMESPACE_CXX11 template class messages; template class messages_byname; _GLIBCXX_END_NAMESPACE_CXX11 _GLIBCXX_END_NAMESPACE_VERSION } // namespace std #endif # 207 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/localefwd.h" 3 # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ios" 2 3 #if 0 /* expanded by -frewrite-includes */ #include // For ios_base declarations. #endif /* expanded by -frewrite-includes */ # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ios" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/ios_base.h" 1 3 // Iostreams base classes -*- C++ -*- // Copyright (C) 1997-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file bits/ios_base.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{ios} */ // // ISO C++ 14882: 27.4 Iostreams base classes // #ifndef _IOS_BASE_H #define _IOS_BASE_H 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 38 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/ios_base.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/ios_base.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/atomicity.h" 1 3 // Support for atomic operations -*- C++ -*- // Copyright (C) 2004-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file ext/atomicity.h * This file is a GNU extension to the Standard C++ Library. */ #ifndef _GLIBCXX_ATOMICITY_H #define _GLIBCXX_ATOMICITY_H 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 33 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/atomicity.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 34 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/atomicity.h" 3 # 35 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/atomicity.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 35 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/atomicity.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/gthr.h" 1 3 /* Threads compatibility routines for libgcc2. */ /* Compile this one with gcc. */ /* Copyright (C) 1997-2015 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #ifndef _GLIBCXX_GCC_GTHR_H #define _GLIBCXX_GCC_GTHR_H #ifndef _GLIBCXX_HIDE_EXPORTS #pragma GCC visibility push(default) #endif # 32 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/gthr.h" 3 /* If this file is compiled with threads support, it must #define __GTHREADS 1 to indicate that threads support is present. Also it has define function int __gthread_active_p () that returns 1 if thread system is active, 0 if not. The threads interface must define the following types: __gthread_key_t __gthread_once_t __gthread_mutex_t __gthread_recursive_mutex_t The threads interface must define the following macros: __GTHREAD_ONCE_INIT to initialize __gthread_once_t __GTHREAD_MUTEX_INIT to initialize __gthread_mutex_t to get a fast non-recursive mutex. __GTHREAD_MUTEX_INIT_FUNCTION to initialize __gthread_mutex_t to get a fast non-recursive mutex. Define this to a function which looks like this: void __GTHREAD_MUTEX_INIT_FUNCTION (__gthread_mutex_t *) Some systems can't initialize a mutex without a function call. Don't define __GTHREAD_MUTEX_INIT in this case. __GTHREAD_RECURSIVE_MUTEX_INIT __GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION as above, but for a recursive mutex. The threads interface must define the following static functions: int __gthread_once (__gthread_once_t *once, void (*func) ()) int __gthread_key_create (__gthread_key_t *keyp, void (*dtor) (void *)) int __gthread_key_delete (__gthread_key_t key) void *__gthread_getspecific (__gthread_key_t key) int __gthread_setspecific (__gthread_key_t key, const void *ptr) int __gthread_mutex_destroy (__gthread_mutex_t *mutex); int __gthread_recursive_mutex_destroy (__gthread_recursive_mutex_t *mutex); int __gthread_mutex_lock (__gthread_mutex_t *mutex); int __gthread_mutex_trylock (__gthread_mutex_t *mutex); int __gthread_mutex_unlock (__gthread_mutex_t *mutex); int __gthread_recursive_mutex_lock (__gthread_recursive_mutex_t *mutex); int __gthread_recursive_mutex_trylock (__gthread_recursive_mutex_t *mutex); int __gthread_recursive_mutex_unlock (__gthread_recursive_mutex_t *mutex); The following are supported in POSIX threads only. They are required to fix a deadlock in static initialization inside libsupc++. The header file gthr-posix.h defines a symbol __GTHREAD_HAS_COND to signify that these extra features are supported. Types: __gthread_cond_t Macros: __GTHREAD_COND_INIT __GTHREAD_COND_INIT_FUNCTION Interface: int __gthread_cond_broadcast (__gthread_cond_t *cond); int __gthread_cond_wait (__gthread_cond_t *cond, __gthread_mutex_t *mutex); int __gthread_cond_wait_recursive (__gthread_cond_t *cond, __gthread_recursive_mutex_t *mutex); All functions returning int should return zero on success or the error number. If the operation is not supported, -1 is returned. If the following are also defined, you should #define __GTHREADS_CXX0X 1 to enable the c++0x thread library. Types: __gthread_t __gthread_time_t Interface: int __gthread_create (__gthread_t *thread, void *(*func) (void*), void *args); int __gthread_join (__gthread_t thread, void **value_ptr); int __gthread_detach (__gthread_t thread); int __gthread_equal (__gthread_t t1, __gthread_t t2); __gthread_t __gthread_self (void); int __gthread_yield (void); int __gthread_mutex_timedlock (__gthread_mutex_t *m, const __gthread_time_t *abs_timeout); int __gthread_recursive_mutex_timedlock (__gthread_recursive_mutex_t *m, const __gthread_time_t *abs_time); int __gthread_cond_signal (__gthread_cond_t *cond); int __gthread_cond_timedwait (__gthread_cond_t *cond, __gthread_mutex_t *mutex, const __gthread_time_t *abs_timeout); */ #if __GXX_WEAK__ /* The pe-coff weak support isn't fully compatible to ELF's weak. For static libraries it might would work, but as we need to deal with shared versions too, we disable it for mingw-targets. */ #ifdef __MINGW32__ #undef _GLIBCXX_GTHREAD_USE_WEAK #define _GLIBCXX_GTHREAD_USE_WEAK 0 #endif # 143 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/gthr.h" 3 #ifndef _GLIBCXX_GTHREAD_USE_WEAK #define _GLIBCXX_GTHREAD_USE_WEAK 1 #endif # 147 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/gthr.h" 3 #endif # 148 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/gthr.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 148 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/gthr.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/gthr-default.h" 1 3 /* Threads compatibility routines for libgcc2 and libobjc. */ /* Compile this one with gcc. */ /* Copyright (C) 1997-2015 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ #ifndef _GLIBCXX_GCC_GTHR_POSIX_H #define _GLIBCXX_GCC_GTHR_POSIX_H /* POSIX threads specific definitions. Easy, since the interface is just one-to-one mapping. */ #define __GTHREADS 1 #define __GTHREADS_CXX0X 1 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 35 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/gthr-default.h" 3 # 1 "/usr/include/pthread.h" 1 3 4 /* Copyright (C) 2002-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _PTHREAD_H #define _PTHREAD_H 1 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 21 "/usr/include/pthread.h" 3 4 # 22 "/usr/include/pthread.h" 3 4 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 22 "/usr/include/pthread.h" 3 4 # 23 "/usr/include/pthread.h" 3 4 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 23 "/usr/include/pthread.h" 3 4 # 1 "/usr/include/sched.h" 1 3 4 /* Definitions for POSIX 1003.1b-1993 (aka POSIX.4) scheduling interface. Copyright (C) 1996-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SCHED_H #define _SCHED_H 1 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 22 "/usr/include/sched.h" 3 4 # 23 "/usr/include/sched.h" 3 4 /* Get type definitions. */ #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 25 "/usr/include/sched.h" 3 4 # 26 "/usr/include/sched.h" 3 4 #define __need_size_t #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 28 "/usr/include/sched.h" 3 4 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 1 3 4 /*===---- stddef.h - Basic type definitions --------------------------------=== * * Copyright (c) 2008 Eli Friedman * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #if !defined(__STDDEF_H) || defined(__need_ptrdiff_t) || \ defined(__need_size_t) || defined(__need_wchar_t) || \ defined(__need_NULL) || defined(__need_wint_t) #if !defined(__need_ptrdiff_t) && !defined(__need_size_t) && \ !defined(__need_wchar_t) && !defined(__need_NULL) && \ !defined(__need_wint_t) /* Always define miscellaneous pieces when modules are available. */ #if !__has_feature(modules) #define __STDDEF_H #endif # 37 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #define __need_ptrdiff_t #define __need_size_t #define __need_wchar_t #define __need_NULL #define __need_STDDEF_H_misc /* __need_wint_t is intentionally not defined here. */ #endif # 44 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_ptrdiff_t) #if !defined(_PTRDIFF_T) || __has_feature(modules) /* Always define ptrdiff_t when modules are available. */ #if !__has_feature(modules) #define _PTRDIFF_T #endif # 51 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 typedef __PTRDIFF_TYPE__ ptrdiff_t; #endif # 53 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #undef __need_ptrdiff_t #endif /* defined(__need_ptrdiff_t) */ # 55 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_size_t) #if !defined(_SIZE_T) || __has_feature(modules) /* Always define size_t when modules are available. */ #if !__has_feature(modules) #define _SIZE_T #endif # 62 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 typedef __SIZE_TYPE__ size_t; #endif # 64 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #undef __need_size_t #endif /*defined(__need_size_t) */ # 66 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_STDDEF_H_misc) /* ISO9899:2011 7.20 (C11 Annex K): Define rsize_t if __STDC_WANT_LIB_EXT1__ is * enabled. */ #if (defined(__STDC_WANT_LIB_EXT1__) && __STDC_WANT_LIB_EXT1__ >= 1 && \ !defined(_RSIZE_T)) || __has_feature(modules) /* Always define rsize_t when modules are available. */ #if !__has_feature(modules) #define _RSIZE_T #endif # 76 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 typedef __SIZE_TYPE__ rsize_t; #endif # 78 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif /* defined(__need_STDDEF_H_misc) */ # 79 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_wchar_t) #ifndef __cplusplus /* Always define wchar_t when modules are available. */ #if !defined(_WCHAR_T) || __has_feature(modules) #if !__has_feature(modules) #define _WCHAR_T #if defined(_MSC_EXTENSIONS) #define _WCHAR_T_DEFINED #endif # 89 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif # 90 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 typedef __WCHAR_TYPE__ wchar_t; #endif # 92 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif # 93 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #undef __need_wchar_t #endif /* defined(__need_wchar_t) */ # 95 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_NULL) #undef NULL #ifdef __cplusplus # if !defined(__MINGW32__) && !defined(_MSC_VER) # define NULL __null # else # 102 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 # define NULL 0 # endif # 104 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #else # 105 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 # define NULL ((void*)0) #endif # 107 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #ifdef __cplusplus #if defined(_MSC_EXTENSIONS) && defined(_NATIVE_NULLPTR_SUPPORTED) namespace std { typedef decltype(nullptr) nullptr_t; } using ::std::nullptr_t; #endif # 112 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif # 113 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #undef __need_NULL #endif /* defined(__need_NULL) */ # 115 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_STDDEF_H_misc) #if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L #if 0 /* expanded by -frewrite-includes */ #include "__stddef_max_align_t.h" #endif /* expanded by -frewrite-includes */ # 118 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 # 119 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif # 120 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #define offsetof(t, d) __builtin_offsetof(t, d) #undef __need_STDDEF_H_misc #endif /* defined(__need_STDDEF_H_misc) */ # 123 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 /* Some C libraries expect to see a wint_t here. Others (notably MinGW) will use __WINT_TYPE__ directly; accommodate both by requiring __need_wint_t */ #if defined(__need_wint_t) /* Always define wint_t when modules are available. */ #if !defined(_WINT_T) || __has_feature(modules) #if !__has_feature(modules) #define _WINT_T #endif # 132 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 typedef __WINT_TYPE__ wint_t; #endif # 134 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #undef __need_wint_t #endif /* __need_wint_t */ # 136 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif # 138 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 # 29 "/usr/include/sched.h" 2 3 4 #define __need_time_t #define __need_timespec #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 32 "/usr/include/sched.h" 3 4 # 33 "/usr/include/sched.h" 3 4 #ifndef __pid_t_defined typedef __pid_t pid_t; # define __pid_t_defined #endif # 38 "/usr/include/sched.h" 3 4 /* Get system specific constant and data structure definitions. */ #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 41 "/usr/include/sched.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/sched.h" 1 3 4 /* Definitions of constants and data structure for POSIX 1003.1b-1993 scheduling interface. Copyright (C) 1996-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef __need_schedparam #ifndef _SCHED_H # error "Never include directly; use instead." #endif # 25 "/usr/include/x86_64-linux-gnu/bits/sched.h" 3 4 /* Scheduling algorithms. */ #define SCHED_OTHER 0 #define SCHED_FIFO 1 #define SCHED_RR 2 #ifdef __USE_GNU # define SCHED_BATCH 3 # define SCHED_IDLE 5 # define SCHED_RESET_ON_FORK 0x40000000 #endif # 37 "/usr/include/x86_64-linux-gnu/bits/sched.h" 3 4 #ifdef __USE_GNU /* Cloning flags. */ # define CSIGNAL 0x000000ff /* Signal mask to be sent at exit. */ # define CLONE_VM 0x00000100 /* Set if VM shared between processes. */ # define CLONE_FS 0x00000200 /* Set if fs info shared between processes. */ # define CLONE_FILES 0x00000400 /* Set if open files shared between processes. */ # define CLONE_SIGHAND 0x00000800 /* Set if signal handlers shared. */ # define CLONE_PTRACE 0x00002000 /* Set if tracing continues on the child. */ # define CLONE_VFORK 0x00004000 /* Set if the parent wants the child to wake it up on mm_release. */ # define CLONE_PARENT 0x00008000 /* Set if we want to have the same parent as the cloner. */ # define CLONE_THREAD 0x00010000 /* Set to add to same thread group. */ # define CLONE_NEWNS 0x00020000 /* Set to create new namespace. */ # define CLONE_SYSVSEM 0x00040000 /* Set to shared SVID SEM_UNDO semantics. */ # define CLONE_SETTLS 0x00080000 /* Set TLS info. */ # define CLONE_PARENT_SETTID 0x00100000 /* Store TID in userlevel buffer before MM copy. */ # define CLONE_CHILD_CLEARTID 0x00200000 /* Register exit futex and memory location to clear. */ # define CLONE_DETACHED 0x00400000 /* Create clone detached. */ # define CLONE_UNTRACED 0x00800000 /* Set if the tracing process can't force CLONE_PTRACE on this clone. */ # define CLONE_CHILD_SETTID 0x01000000 /* Store TID in userlevel buffer in the child. */ # define CLONE_NEWUTS 0x04000000 /* New utsname group. */ # define CLONE_NEWIPC 0x08000000 /* New ipcs. */ # define CLONE_NEWUSER 0x10000000 /* New user namespace. */ # define CLONE_NEWPID 0x20000000 /* New pid namespace. */ # define CLONE_NEWNET 0x40000000 /* New network namespace. */ # define CLONE_IO 0x80000000 /* Clone I/O context. */ #endif # 70 "/usr/include/x86_64-linux-gnu/bits/sched.h" 3 4 /* The official definition. */ struct sched_param { int __sched_priority; }; __BEGIN_DECLS #ifdef __USE_GNU /* Clone current process. */ extern int clone (int (*__fn) (void *__arg), void *__child_stack, int __flags, void *__arg, ...) __THROW; /* Unshare the specified resources. */ extern int unshare (int __flags) __THROW; /* Get index of currently used CPU. */ extern int sched_getcpu (void) __THROW; /* Switch process to namespace of type NSTYPE indicated by FD. */ extern int setns (int __fd, int __nstype) __THROW; #endif # 93 "/usr/include/x86_64-linux-gnu/bits/sched.h" 3 4 __END_DECLS #endif /* need schedparam */ # 98 "/usr/include/x86_64-linux-gnu/bits/sched.h" 3 4 #if !defined __defined_schedparam \ && (defined __need_schedparam || defined _SCHED_H) # define __defined_schedparam 1 /* Data structure to describe a process' schedulability. */ struct __sched_param { int __sched_priority; }; # undef __need_schedparam #endif # 109 "/usr/include/x86_64-linux-gnu/bits/sched.h" 3 4 #if defined _SCHED_H && !defined __cpu_set_t_defined # define __cpu_set_t_defined /* Size definition for CPU sets. */ # define __CPU_SETSIZE 1024 # define __NCPUBITS (8 * sizeof (__cpu_mask)) /* Type for array elements in 'cpu_set_t'. */ typedef unsigned long int __cpu_mask; /* Basic access functions. */ # define __CPUELT(cpu) ((cpu) / __NCPUBITS) # define __CPUMASK(cpu) ((__cpu_mask) 1 << ((cpu) % __NCPUBITS)) /* Data structure to describe CPU mask. */ typedef struct { __cpu_mask __bits[__CPU_SETSIZE / __NCPUBITS]; } cpu_set_t; /* Access functions for CPU masks. */ # if __GNUC_PREREQ (2, 91) # define __CPU_ZERO_S(setsize, cpusetp) \ do __builtin_memset (cpusetp, '\0', setsize); while (0) # else # 135 "/usr/include/x86_64-linux-gnu/bits/sched.h" 3 4 # define __CPU_ZERO_S(setsize, cpusetp) \ do { \ size_t __i; \ size_t __imax = (setsize) / sizeof (__cpu_mask); \ __cpu_mask *__bits = (cpusetp)->__bits; \ for (__i = 0; __i < __imax; ++__i) \ __bits[__i] = 0; \ } while (0) # endif # 144 "/usr/include/x86_64-linux-gnu/bits/sched.h" 3 4 # define __CPU_SET_S(cpu, setsize, cpusetp) \ (__extension__ \ ({ size_t __cpu = (cpu); \ __cpu / 8 < (setsize) \ ? (((__cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)] \ |= __CPUMASK (__cpu)) \ : 0; })) # define __CPU_CLR_S(cpu, setsize, cpusetp) \ (__extension__ \ ({ size_t __cpu = (cpu); \ __cpu / 8 < (setsize) \ ? (((__cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)] \ &= ~__CPUMASK (__cpu)) \ : 0; })) # define __CPU_ISSET_S(cpu, setsize, cpusetp) \ (__extension__ \ ({ size_t __cpu = (cpu); \ __cpu / 8 < (setsize) \ ? ((((const __cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)] \ & __CPUMASK (__cpu))) != 0 \ : 0; })) # define __CPU_COUNT_S(setsize, cpusetp) \ __sched_cpucount (setsize, cpusetp) # if __GNUC_PREREQ (2, 91) # define __CPU_EQUAL_S(setsize, cpusetp1, cpusetp2) \ (__builtin_memcmp (cpusetp1, cpusetp2, setsize) == 0) # else # 173 "/usr/include/x86_64-linux-gnu/bits/sched.h" 3 4 # define __CPU_EQUAL_S(setsize, cpusetp1, cpusetp2) \ (__extension__ \ ({ const __cpu_mask *__arr1 = (cpusetp1)->__bits; \ const __cpu_mask *__arr2 = (cpusetp2)->__bits; \ size_t __imax = (setsize) / sizeof (__cpu_mask); \ size_t __i; \ for (__i = 0; __i < __imax; ++__i) \ if (__arr1[__i] != __arr2[__i]) \ break; \ __i == __imax; })) # endif # 184 "/usr/include/x86_64-linux-gnu/bits/sched.h" 3 4 # define __CPU_OP_S(setsize, destset, srcset1, srcset2, op) \ (__extension__ \ ({ cpu_set_t *__dest = (destset); \ const __cpu_mask *__arr1 = (srcset1)->__bits; \ const __cpu_mask *__arr2 = (srcset2)->__bits; \ size_t __imax = (setsize) / sizeof (__cpu_mask); \ size_t __i; \ for (__i = 0; __i < __imax; ++__i) \ ((__cpu_mask *) __dest->__bits)[__i] = __arr1[__i] op __arr2[__i]; \ __dest; })) # define __CPU_ALLOC_SIZE(count) \ ((((count) + __NCPUBITS - 1) / __NCPUBITS) * sizeof (__cpu_mask)) # define __CPU_ALLOC(count) __sched_cpualloc (count) # define __CPU_FREE(cpuset) __sched_cpufree (cpuset) __BEGIN_DECLS extern int __sched_cpucount (size_t __setsize, const cpu_set_t *__setp) __THROW; extern cpu_set_t *__sched_cpualloc (size_t __count) __THROW __wur; extern void __sched_cpufree (cpu_set_t *__set) __THROW; __END_DECLS #endif # 211 "/usr/include/x86_64-linux-gnu/bits/sched.h" 3 4 # 42 "/usr/include/sched.h" 2 3 4 /* Define the real names for the elements of `struct sched_param'. */ #define sched_priority __sched_priority __BEGIN_DECLS /* Set scheduling parameters for a process. */ extern int sched_setparam (__pid_t __pid, const struct sched_param *__param) __THROW; /* Retrieve scheduling parameters for a particular process. */ extern int sched_getparam (__pid_t __pid, struct sched_param *__param) __THROW; /* Set scheduling algorithm and/or parameters for a process. */ extern int sched_setscheduler (__pid_t __pid, int __policy, const struct sched_param *__param) __THROW; /* Retrieve scheduling algorithm for a particular purpose. */ extern int sched_getscheduler (__pid_t __pid) __THROW; /* Yield the processor. */ extern int sched_yield (void) __THROW; /* Get maximum priority value for a scheduler. */ extern int sched_get_priority_max (int __algorithm) __THROW; /* Get minimum priority value for a scheduler. */ extern int sched_get_priority_min (int __algorithm) __THROW; /* Get the SCHED_RR interval for the named process. */ extern int sched_rr_get_interval (__pid_t __pid, struct timespec *__t) __THROW; #ifdef __USE_GNU /* Access macros for `cpu_set'. */ # define CPU_SETSIZE __CPU_SETSIZE # define CPU_SET(cpu, cpusetp) __CPU_SET_S (cpu, sizeof (cpu_set_t), cpusetp) # define CPU_CLR(cpu, cpusetp) __CPU_CLR_S (cpu, sizeof (cpu_set_t), cpusetp) # define CPU_ISSET(cpu, cpusetp) __CPU_ISSET_S (cpu, sizeof (cpu_set_t), \ cpusetp) # define CPU_ZERO(cpusetp) __CPU_ZERO_S (sizeof (cpu_set_t), cpusetp) # define CPU_COUNT(cpusetp) __CPU_COUNT_S (sizeof (cpu_set_t), cpusetp) # define CPU_SET_S(cpu, setsize, cpusetp) __CPU_SET_S (cpu, setsize, cpusetp) # define CPU_CLR_S(cpu, setsize, cpusetp) __CPU_CLR_S (cpu, setsize, cpusetp) # define CPU_ISSET_S(cpu, setsize, cpusetp) __CPU_ISSET_S (cpu, setsize, \ cpusetp) # define CPU_ZERO_S(setsize, cpusetp) __CPU_ZERO_S (setsize, cpusetp) # define CPU_COUNT_S(setsize, cpusetp) __CPU_COUNT_S (setsize, cpusetp) # define CPU_EQUAL(cpusetp1, cpusetp2) \ __CPU_EQUAL_S (sizeof (cpu_set_t), cpusetp1, cpusetp2) # define CPU_EQUAL_S(setsize, cpusetp1, cpusetp2) \ __CPU_EQUAL_S (setsize, cpusetp1, cpusetp2) # define CPU_AND(destset, srcset1, srcset2) \ __CPU_OP_S (sizeof (cpu_set_t), destset, srcset1, srcset2, &) # define CPU_OR(destset, srcset1, srcset2) \ __CPU_OP_S (sizeof (cpu_set_t), destset, srcset1, srcset2, |) # define CPU_XOR(destset, srcset1, srcset2) \ __CPU_OP_S (sizeof (cpu_set_t), destset, srcset1, srcset2, ^) # define CPU_AND_S(setsize, destset, srcset1, srcset2) \ __CPU_OP_S (setsize, destset, srcset1, srcset2, &) # define CPU_OR_S(setsize, destset, srcset1, srcset2) \ __CPU_OP_S (setsize, destset, srcset1, srcset2, |) # define CPU_XOR_S(setsize, destset, srcset1, srcset2) \ __CPU_OP_S (setsize, destset, srcset1, srcset2, ^) # define CPU_ALLOC_SIZE(count) __CPU_ALLOC_SIZE (count) # define CPU_ALLOC(count) __CPU_ALLOC (count) # define CPU_FREE(cpuset) __CPU_FREE (cpuset) /* Set the CPU affinity for a task */ extern int sched_setaffinity (__pid_t __pid, size_t __cpusetsize, const cpu_set_t *__cpuset) __THROW; /* Get the CPU affinity for a task */ extern int sched_getaffinity (__pid_t __pid, size_t __cpusetsize, cpu_set_t *__cpuset) __THROW; #endif # 123 "/usr/include/sched.h" 3 4 __END_DECLS #endif /* sched.h */ # 127 "/usr/include/sched.h" 3 4 # 24 "/usr/include/pthread.h" 2 3 4 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 24 "/usr/include/pthread.h" 3 4 # 25 "/usr/include/pthread.h" 3 4 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 26 "/usr/include/pthread.h" 3 4 # 27 "/usr/include/pthread.h" 3 4 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 27 "/usr/include/pthread.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 1 3 4 /* Copyright (C) 2001-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* Define the machine-dependent type `jmp_buf'. x86-64 version. */ #ifndef _BITS_SETJMP_H #define _BITS_SETJMP_H 1 #if !defined _SETJMP_H && !defined _PTHREAD_H # error "Never include directly; use instead." #endif # 25 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 3 4 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 26 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4 /* Determine the wordsize from the preprocessor defines. */ #if defined __x86_64__ && !defined __ILP32__ # define __WORDSIZE 64 #else # 6 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 3 4 # define __WORDSIZE 32 #endif # 8 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 3 4 #ifdef __x86_64__ # define __WORDSIZE_TIME64_COMPAT32 1 /* Both x86-64 and x32 use the 64-bit system call interface. */ # define __SYSCALL_WORDSIZE 64 #endif # 14 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 3 4 # 27 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 2 3 4 #ifndef _ASM # if __WORDSIZE == 64 typedef long int __jmp_buf[8]; # elif defined __x86_64__ # 33 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 3 4 __extension__ typedef long long int __jmp_buf[8]; # else # 35 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 3 4 typedef int __jmp_buf[6]; # endif # 37 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 3 4 #endif # 39 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 3 4 #endif /* bits/setjmp.h */ # 41 "/usr/include/x86_64-linux-gnu/bits/setjmp.h" 3 4 # 28 "/usr/include/pthread.h" 2 3 4 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 28 "/usr/include/pthread.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4 /* Determine the wordsize from the preprocessor defines. */ #if defined __x86_64__ && !defined __ILP32__ # define __WORDSIZE 64 #else # 6 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 3 4 # define __WORDSIZE 32 #endif # 8 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 3 4 #ifdef __x86_64__ # define __WORDSIZE_TIME64_COMPAT32 1 /* Both x86-64 and x32 use the 64-bit system call interface. */ # define __SYSCALL_WORDSIZE 64 #endif # 14 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 3 4 # 29 "/usr/include/pthread.h" 2 3 4 /* Detach state. */ enum { PTHREAD_CREATE_JOINABLE, #define PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_DETACHED #define PTHREAD_CREATE_DETACHED PTHREAD_CREATE_DETACHED }; /* Mutex types. */ enum { PTHREAD_MUTEX_TIMED_NP, PTHREAD_MUTEX_RECURSIVE_NP, PTHREAD_MUTEX_ERRORCHECK_NP, PTHREAD_MUTEX_ADAPTIVE_NP #if defined __USE_UNIX98 || defined __USE_XOPEN2K8 , PTHREAD_MUTEX_NORMAL = PTHREAD_MUTEX_TIMED_NP, PTHREAD_MUTEX_RECURSIVE = PTHREAD_MUTEX_RECURSIVE_NP, PTHREAD_MUTEX_ERRORCHECK = PTHREAD_MUTEX_ERRORCHECK_NP, PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL #endif # 55 "/usr/include/pthread.h" 3 4 #ifdef __USE_GNU /* For compatibility. */ , PTHREAD_MUTEX_FAST_NP = PTHREAD_MUTEX_TIMED_NP #endif # 59 "/usr/include/pthread.h" 3 4 }; #ifdef __USE_XOPEN2K /* Robust mutex or not flags. */ enum { PTHREAD_MUTEX_STALLED, PTHREAD_MUTEX_STALLED_NP = PTHREAD_MUTEX_STALLED, PTHREAD_MUTEX_ROBUST, PTHREAD_MUTEX_ROBUST_NP = PTHREAD_MUTEX_ROBUST }; #endif # 72 "/usr/include/pthread.h" 3 4 #if defined __USE_POSIX199506 || defined __USE_UNIX98 /* Mutex protocols. */ enum { PTHREAD_PRIO_NONE, PTHREAD_PRIO_INHERIT, PTHREAD_PRIO_PROTECT }; #endif # 83 "/usr/include/pthread.h" 3 4 /* Mutex initializers. */ #if __PTHREAD_MUTEX_HAVE_ELISION == 1 /* 64bit layout. */ #define __PTHREAD_SPINS 0, 0 #elif __PTHREAD_MUTEX_HAVE_ELISION == 2 /* 32bit layout. */ # 89 "/usr/include/pthread.h" 3 4 #define __PTHREAD_SPINS { 0, 0 } #else # 91 "/usr/include/pthread.h" 3 4 #define __PTHREAD_SPINS 0 #endif # 93 "/usr/include/pthread.h" 3 4 #ifdef __PTHREAD_MUTEX_HAVE_PREV # define PTHREAD_MUTEX_INITIALIZER \ { { 0, 0, 0, 0, 0, __PTHREAD_SPINS, { 0, 0 } } } # ifdef __USE_GNU # define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \ { { 0, 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP, __PTHREAD_SPINS, { 0, 0 } } } # define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \ { { 0, 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP, __PTHREAD_SPINS, { 0, 0 } } } # define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \ { { 0, 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP, __PTHREAD_SPINS, { 0, 0 } } } # define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \ { { 0, 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP, __PTHREAD_SPINS, { 0, 0 } } } # endif # 108 "/usr/include/pthread.h" 3 4 #else # 109 "/usr/include/pthread.h" 3 4 # define PTHREAD_MUTEX_INITIALIZER \ { { 0, 0, 0, 0, 0, { __PTHREAD_SPINS } } } # ifdef __USE_GNU # define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \ { { 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP, 0, { __PTHREAD_SPINS } } } # define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \ { { 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP, 0, { __PTHREAD_SPINS } } } # define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \ { { 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP, 0, { __PTHREAD_SPINS } } } # endif # 120 "/usr/include/pthread.h" 3 4 #endif # 121 "/usr/include/pthread.h" 3 4 /* Read-write lock types. */ #if defined __USE_UNIX98 || defined __USE_XOPEN2K enum { PTHREAD_RWLOCK_PREFER_READER_NP, PTHREAD_RWLOCK_PREFER_WRITER_NP, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP, PTHREAD_RWLOCK_DEFAULT_NP = PTHREAD_RWLOCK_PREFER_READER_NP }; /* Define __PTHREAD_RWLOCK_INT_FLAGS_SHARED to 1 if pthread_rwlock_t has the shared field. All 64-bit architectures have the shared field in pthread_rwlock_t. */ #ifndef __PTHREAD_RWLOCK_INT_FLAGS_SHARED # if __WORDSIZE == 64 # define __PTHREAD_RWLOCK_INT_FLAGS_SHARED 1 # endif # 140 "/usr/include/pthread.h" 3 4 #endif # 141 "/usr/include/pthread.h" 3 4 /* Read-write lock initializers. */ # define PTHREAD_RWLOCK_INITIALIZER \ { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } } # ifdef __USE_GNU # ifdef __PTHREAD_RWLOCK_INT_FLAGS_SHARED # define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \ { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP } } # else # 151 "/usr/include/pthread.h" 3 4 # if __BYTE_ORDER == __LITTLE_ENDIAN # define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \ { { 0, 0, 0, 0, 0, 0, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP, \ 0, 0, 0, 0 } } # else # 156 "/usr/include/pthread.h" 3 4 # define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \ { { 0, 0, 0, 0, 0, 0, 0, 0, 0, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP,\ 0 } } # endif # 160 "/usr/include/pthread.h" 3 4 # endif # 161 "/usr/include/pthread.h" 3 4 # endif # 162 "/usr/include/pthread.h" 3 4 #endif /* Unix98 or XOpen2K */ # 163 "/usr/include/pthread.h" 3 4 /* Scheduler inheritance. */ enum { PTHREAD_INHERIT_SCHED, #define PTHREAD_INHERIT_SCHED PTHREAD_INHERIT_SCHED PTHREAD_EXPLICIT_SCHED #define PTHREAD_EXPLICIT_SCHED PTHREAD_EXPLICIT_SCHED }; /* Scope handling. */ enum { PTHREAD_SCOPE_SYSTEM, #define PTHREAD_SCOPE_SYSTEM PTHREAD_SCOPE_SYSTEM PTHREAD_SCOPE_PROCESS #define PTHREAD_SCOPE_PROCESS PTHREAD_SCOPE_PROCESS }; /* Process shared or private flag. */ enum { PTHREAD_PROCESS_PRIVATE, #define PTHREAD_PROCESS_PRIVATE PTHREAD_PROCESS_PRIVATE PTHREAD_PROCESS_SHARED #define PTHREAD_PROCESS_SHARED PTHREAD_PROCESS_SHARED }; /* Conditional variable handling. */ #define PTHREAD_COND_INITIALIZER { { 0, 0, 0, 0, 0, (void *) 0, 0, 0 } } /* Cleanup buffers */ struct _pthread_cleanup_buffer { void (*__routine) (void *); /* Function to call. */ void *__arg; /* Its argument. */ int __canceltype; /* Saved cancellation type. */ struct _pthread_cleanup_buffer *__prev; /* Chaining of cleanup functions. */ }; /* Cancellation */ enum { PTHREAD_CANCEL_ENABLE, #define PTHREAD_CANCEL_ENABLE PTHREAD_CANCEL_ENABLE PTHREAD_CANCEL_DISABLE #define PTHREAD_CANCEL_DISABLE PTHREAD_CANCEL_DISABLE }; enum { PTHREAD_CANCEL_DEFERRED, #define PTHREAD_CANCEL_DEFERRED PTHREAD_CANCEL_DEFERRED PTHREAD_CANCEL_ASYNCHRONOUS #define PTHREAD_CANCEL_ASYNCHRONOUS PTHREAD_CANCEL_ASYNCHRONOUS }; #define PTHREAD_CANCELED ((void *) -1) /* Single execution handling. */ #define PTHREAD_ONCE_INIT 0 #ifdef __USE_XOPEN2K /* Value returned by 'pthread_barrier_wait' for one of the threads after the required number of threads have called this function. -1 is distinct from 0 and all errno constants */ # define PTHREAD_BARRIER_SERIAL_THREAD -1 #endif # 237 "/usr/include/pthread.h" 3 4 __BEGIN_DECLS /* Create a new thread, starting with execution of START-ROUTINE getting passed ARG. Creation attributed come from ATTR. The new handle is stored in *NEWTHREAD. */ extern int pthread_create (pthread_t *__restrict __newthread, const pthread_attr_t *__restrict __attr, void *(*__start_routine) (void *), void *__restrict __arg) __THROWNL __nonnull ((1, 3)); /* Terminate calling thread. The registered cleanup handlers are called via exception handling so we cannot mark this function with __THROW.*/ extern void pthread_exit (void *__retval) __attribute__ ((__noreturn__)); /* Make calling thread wait for termination of the thread TH. The exit status of the thread is stored in *THREAD_RETURN, if THREAD_RETURN is not NULL. This function is a cancellation point and therefore not marked with __THROW. */ extern int pthread_join (pthread_t __th, void **__thread_return); #ifdef __USE_GNU /* Check whether thread TH has terminated. If yes return the status of the thread in *THREAD_RETURN, if THREAD_RETURN is not NULL. */ extern int pthread_tryjoin_np (pthread_t __th, void **__thread_return) __THROW; /* Make calling thread wait for termination of the thread TH, but only until TIMEOUT. The exit status of the thread is stored in *THREAD_RETURN, if THREAD_RETURN is not NULL. This function is a cancellation point and therefore not marked with __THROW. */ extern int pthread_timedjoin_np (pthread_t __th, void **__thread_return, const struct timespec *__abstime); #endif # 277 "/usr/include/pthread.h" 3 4 /* Indicate that the thread TH is never to be joined with PTHREAD_JOIN. The resources of TH will therefore be freed immediately when it terminates, instead of waiting for another thread to perform PTHREAD_JOIN on it. */ extern int pthread_detach (pthread_t __th) __THROW; /* Obtain the identifier of the current thread. */ extern pthread_t pthread_self (void) __THROW __attribute__ ((__const__)); /* Compare two thread identifiers. */ extern int pthread_equal (pthread_t __thread1, pthread_t __thread2) __THROW __attribute__ ((__const__)); /* Thread attribute handling. */ /* Initialize thread attribute *ATTR with default attributes (detachstate is PTHREAD_JOINABLE, scheduling policy is SCHED_OTHER, no user-provided stack). */ extern int pthread_attr_init (pthread_attr_t *__attr) __THROW __nonnull ((1)); /* Destroy thread attribute *ATTR. */ extern int pthread_attr_destroy (pthread_attr_t *__attr) __THROW __nonnull ((1)); /* Get detach state attribute. */ extern int pthread_attr_getdetachstate (const pthread_attr_t *__attr, int *__detachstate) __THROW __nonnull ((1, 2)); /* Set detach state attribute. */ extern int pthread_attr_setdetachstate (pthread_attr_t *__attr, int __detachstate) __THROW __nonnull ((1)); /* Get the size of the guard area created for stack overflow protection. */ extern int pthread_attr_getguardsize (const pthread_attr_t *__attr, size_t *__guardsize) __THROW __nonnull ((1, 2)); /* Set the size of the guard area created for stack overflow protection. */ extern int pthread_attr_setguardsize (pthread_attr_t *__attr, size_t __guardsize) __THROW __nonnull ((1)); /* Return in *PARAM the scheduling parameters of *ATTR. */ extern int pthread_attr_getschedparam (const pthread_attr_t *__restrict __attr, struct sched_param *__restrict __param) __THROW __nonnull ((1, 2)); /* Set scheduling parameters (priority, etc) in *ATTR according to PARAM. */ extern int pthread_attr_setschedparam (pthread_attr_t *__restrict __attr, const struct sched_param *__restrict __param) __THROW __nonnull ((1, 2)); /* Return in *POLICY the scheduling policy of *ATTR. */ extern int pthread_attr_getschedpolicy (const pthread_attr_t *__restrict __attr, int *__restrict __policy) __THROW __nonnull ((1, 2)); /* Set scheduling policy in *ATTR according to POLICY. */ extern int pthread_attr_setschedpolicy (pthread_attr_t *__attr, int __policy) __THROW __nonnull ((1)); /* Return in *INHERIT the scheduling inheritance mode of *ATTR. */ extern int pthread_attr_getinheritsched (const pthread_attr_t *__restrict __attr, int *__restrict __inherit) __THROW __nonnull ((1, 2)); /* Set scheduling inheritance mode in *ATTR according to INHERIT. */ extern int pthread_attr_setinheritsched (pthread_attr_t *__attr, int __inherit) __THROW __nonnull ((1)); /* Return in *SCOPE the scheduling contention scope of *ATTR. */ extern int pthread_attr_getscope (const pthread_attr_t *__restrict __attr, int *__restrict __scope) __THROW __nonnull ((1, 2)); /* Set scheduling contention scope in *ATTR according to SCOPE. */ extern int pthread_attr_setscope (pthread_attr_t *__attr, int __scope) __THROW __nonnull ((1)); /* Return the previously set address for the stack. */ extern int pthread_attr_getstackaddr (const pthread_attr_t *__restrict __attr, void **__restrict __stackaddr) __THROW __nonnull ((1, 2)) __attribute_deprecated__; /* Set the starting address of the stack of the thread to be created. Depending on whether the stack grows up or down the value must either be higher or lower than all the address in the memory block. The minimal size of the block must be PTHREAD_STACK_MIN. */ extern int pthread_attr_setstackaddr (pthread_attr_t *__attr, void *__stackaddr) __THROW __nonnull ((1)) __attribute_deprecated__; /* Return the currently used minimal stack size. */ extern int pthread_attr_getstacksize (const pthread_attr_t *__restrict __attr, size_t *__restrict __stacksize) __THROW __nonnull ((1, 2)); /* Add information about the minimum stack size needed for the thread to be started. This size must never be less than PTHREAD_STACK_MIN and must also not exceed the system limits. */ extern int pthread_attr_setstacksize (pthread_attr_t *__attr, size_t __stacksize) __THROW __nonnull ((1)); #ifdef __USE_XOPEN2K /* Return the previously set address for the stack. */ extern int pthread_attr_getstack (const pthread_attr_t *__restrict __attr, void **__restrict __stackaddr, size_t *__restrict __stacksize) __THROW __nonnull ((1, 2, 3)); /* The following two interfaces are intended to replace the last two. They require setting the address as well as the size since only setting the address will make the implementation on some architectures impossible. */ extern int pthread_attr_setstack (pthread_attr_t *__attr, void *__stackaddr, size_t __stacksize) __THROW __nonnull ((1)); #endif # 403 "/usr/include/pthread.h" 3 4 #ifdef __USE_GNU /* Thread created with attribute ATTR will be limited to run only on the processors represented in CPUSET. */ extern int pthread_attr_setaffinity_np (pthread_attr_t *__attr, size_t __cpusetsize, const cpu_set_t *__cpuset) __THROW __nonnull ((1, 3)); /* Get bit set in CPUSET representing the processors threads created with ATTR can run on. */ extern int pthread_attr_getaffinity_np (const pthread_attr_t *__attr, size_t __cpusetsize, cpu_set_t *__cpuset) __THROW __nonnull ((1, 3)); /* Get the default attributes used by pthread_create in this process. */ extern int pthread_getattr_default_np (pthread_attr_t *__attr) __THROW __nonnull ((1)); /* Set the default attributes to be used by pthread_create in this process. */ extern int pthread_setattr_default_np (const pthread_attr_t *__attr) __THROW __nonnull ((1)); /* Initialize thread attribute *ATTR with attributes corresponding to the already running thread TH. It shall be called on uninitialized ATTR and destroyed with pthread_attr_destroy when no longer needed. */ extern int pthread_getattr_np (pthread_t __th, pthread_attr_t *__attr) __THROW __nonnull ((2)); #endif # 434 "/usr/include/pthread.h" 3 4 /* Functions for scheduling control. */ /* Set the scheduling parameters for TARGET_THREAD according to POLICY and *PARAM. */ extern int pthread_setschedparam (pthread_t __target_thread, int __policy, const struct sched_param *__param) __THROW __nonnull ((3)); /* Return in *POLICY and *PARAM the scheduling parameters for TARGET_THREAD. */ extern int pthread_getschedparam (pthread_t __target_thread, int *__restrict __policy, struct sched_param *__restrict __param) __THROW __nonnull ((2, 3)); /* Set the scheduling priority for TARGET_THREAD. */ extern int pthread_setschedprio (pthread_t __target_thread, int __prio) __THROW; #ifdef __USE_GNU /* Get thread name visible in the kernel and its interfaces. */ extern int pthread_getname_np (pthread_t __target_thread, char *__buf, size_t __buflen) __THROW __nonnull ((2)); /* Set thread name visible in the kernel and its interfaces. */ extern int pthread_setname_np (pthread_t __target_thread, const char *__name) __THROW __nonnull ((2)); #endif # 465 "/usr/include/pthread.h" 3 4 #ifdef __USE_UNIX98 /* Determine level of concurrency. */ extern int pthread_getconcurrency (void) __THROW; /* Set new concurrency level to LEVEL. */ extern int pthread_setconcurrency (int __level) __THROW; #endif # 474 "/usr/include/pthread.h" 3 4 #ifdef __USE_GNU /* Yield the processor to another thread or process. This function is similar to the POSIX `sched_yield' function but might be differently implemented in the case of a m-on-n thread implementation. */ extern int pthread_yield (void) __THROW; /* Limit specified thread TH to run only on the processors represented in CPUSET. */ extern int pthread_setaffinity_np (pthread_t __th, size_t __cpusetsize, const cpu_set_t *__cpuset) __THROW __nonnull ((3)); /* Get bit set in CPUSET representing the processors TH can run on. */ extern int pthread_getaffinity_np (pthread_t __th, size_t __cpusetsize, cpu_set_t *__cpuset) __THROW __nonnull ((3)); #endif # 494 "/usr/include/pthread.h" 3 4 /* Functions for handling initialization. */ /* Guarantee that the initialization function INIT_ROUTINE will be called only once, even if pthread_once is executed several times with the same ONCE_CONTROL argument. ONCE_CONTROL must point to a static or extern variable initialized to PTHREAD_ONCE_INIT. The initialization functions might throw exception which is why this function is not marked with __THROW. */ extern int pthread_once (pthread_once_t *__once_control, void (*__init_routine) (void)) __nonnull ((1, 2)); /* Functions for handling cancellation. Note that these functions are explicitly not marked to not throw an exception in C++ code. If cancellation is implemented by unwinding this is necessary to have the compiler generate the unwind information. */ /* Set cancelability state of current thread to STATE, returning old state in *OLDSTATE if OLDSTATE is not NULL. */ extern int pthread_setcancelstate (int __state, int *__oldstate); /* Set cancellation state of current thread to TYPE, returning the old type in *OLDTYPE if OLDTYPE is not NULL. */ extern int pthread_setcanceltype (int __type, int *__oldtype); /* Cancel THREAD immediately or at the next possibility. */ extern int pthread_cancel (pthread_t __th); /* Test for pending cancellation for the current thread and terminate the thread as per pthread_exit(PTHREAD_CANCELED) if it has been cancelled. */ extern void pthread_testcancel (void); /* Cancellation handling with integration into exception handling. */ typedef struct { struct { __jmp_buf __cancel_jmp_buf; int __mask_was_saved; } __cancel_jmp_buf[1]; void *__pad[4]; } __pthread_unwind_buf_t __attribute__ ((__aligned__)); /* No special attributes by default. */ #ifndef __cleanup_fct_attribute # define __cleanup_fct_attribute #endif # 548 "/usr/include/pthread.h" 3 4 /* Structure to hold the cleanup handler information. */ struct __pthread_cleanup_frame { void (*__cancel_routine) (void *); void *__cancel_arg; int __do_it; int __cancel_type; }; #if defined __GNUC__ && defined __EXCEPTIONS # ifdef __cplusplus /* Class to handle cancellation handler invocation. */ class __pthread_cleanup_class { void (*__cancel_routine) (void *); void *__cancel_arg; int __do_it; int __cancel_type; public: __pthread_cleanup_class (void (*__fct) (void *), void *__arg) : __cancel_routine (__fct), __cancel_arg (__arg), __do_it (1) { } ~__pthread_cleanup_class () { if (__do_it) __cancel_routine (__cancel_arg); } void __setdoit (int __newval) { __do_it = __newval; } void __defer () { pthread_setcanceltype (PTHREAD_CANCEL_DEFERRED, &__cancel_type); } void __restore () const { pthread_setcanceltype (__cancel_type, 0); } }; /* Install a cleanup handler: ROUTINE will be called with arguments ARG when the thread is canceled or calls pthread_exit. ROUTINE will also be called with arguments ARG when the matching pthread_cleanup_pop is executed with non-zero EXECUTE argument. pthread_cleanup_push and pthread_cleanup_pop are macros and must always be used in matching pairs at the same nesting level of braces. */ # define pthread_cleanup_push(routine, arg) \ do { \ __pthread_cleanup_class __clframe (routine, arg) /* Remove a cleanup handler installed by the matching pthread_cleanup_push. If EXECUTE is non-zero, the handler function is called. */ # define pthread_cleanup_pop(execute) \ __clframe.__setdoit (execute); \ } while (0) # ifdef __USE_GNU /* Install a cleanup handler as pthread_cleanup_push does, but also saves the current cancellation type and sets it to deferred cancellation. */ # define pthread_cleanup_push_defer_np(routine, arg) \ do { \ __pthread_cleanup_class __clframe (routine, arg); \ __clframe.__defer () /* Remove a cleanup handler as pthread_cleanup_pop does, but also restores the cancellation type that was in effect when the matching pthread_cleanup_push_defer was called. */ # define pthread_cleanup_pop_restore_np(execute) \ __clframe.__restore (); \ __clframe.__setdoit (execute); \ } while (0) # endif # 613 "/usr/include/pthread.h" 3 4 # else # 614 "/usr/include/pthread.h" 3 4 /* Function called to call the cleanup handler. As an extern inline function the compiler is free to decide inlining the change when needed or fall back on the copy which must exist somewhere else. */ __extern_inline void __pthread_cleanup_routine (struct __pthread_cleanup_frame *__frame) { if (__frame->__do_it) __frame->__cancel_routine (__frame->__cancel_arg); } /* Install a cleanup handler: ROUTINE will be called with arguments ARG when the thread is canceled or calls pthread_exit. ROUTINE will also be called with arguments ARG when the matching pthread_cleanup_pop is executed with non-zero EXECUTE argument. pthread_cleanup_push and pthread_cleanup_pop are macros and must always be used in matching pairs at the same nesting level of braces. */ # define pthread_cleanup_push(routine, arg) \ do { \ struct __pthread_cleanup_frame __clframe \ __attribute__ ((__cleanup__ (__pthread_cleanup_routine))) \ = { .__cancel_routine = (routine), .__cancel_arg = (arg), \ .__do_it = 1 }; /* Remove a cleanup handler installed by the matching pthread_cleanup_push. If EXECUTE is non-zero, the handler function is called. */ # define pthread_cleanup_pop(execute) \ __clframe.__do_it = (execute); \ } while (0) # ifdef __USE_GNU /* Install a cleanup handler as pthread_cleanup_push does, but also saves the current cancellation type and sets it to deferred cancellation. */ # define pthread_cleanup_push_defer_np(routine, arg) \ do { \ struct __pthread_cleanup_frame __clframe \ __attribute__ ((__cleanup__ (__pthread_cleanup_routine))) \ = { .__cancel_routine = (routine), .__cancel_arg = (arg), \ .__do_it = 1 }; \ (void) pthread_setcanceltype (PTHREAD_CANCEL_DEFERRED, \ &__clframe.__cancel_type) /* Remove a cleanup handler as pthread_cleanup_pop does, but also restores the cancellation type that was in effect when the matching pthread_cleanup_push_defer was called. */ # define pthread_cleanup_pop_restore_np(execute) \ (void) pthread_setcanceltype (__clframe.__cancel_type, NULL); \ __clframe.__do_it = (execute); \ } while (0) # endif # 666 "/usr/include/pthread.h" 3 4 # endif # 667 "/usr/include/pthread.h" 3 4 #else # 668 "/usr/include/pthread.h" 3 4 /* Install a cleanup handler: ROUTINE will be called with arguments ARG when the thread is canceled or calls pthread_exit. ROUTINE will also be called with arguments ARG when the matching pthread_cleanup_pop is executed with non-zero EXECUTE argument. pthread_cleanup_push and pthread_cleanup_pop are macros and must always be used in matching pairs at the same nesting level of braces. */ # define pthread_cleanup_push(routine, arg) \ do { \ __pthread_unwind_buf_t __cancel_buf; \ void (*__cancel_routine) (void *) = (routine); \ void *__cancel_arg = (arg); \ int __not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *) \ __cancel_buf.__cancel_jmp_buf, 0); \ if (__glibc_unlikely (__not_first_call)) \ { \ __cancel_routine (__cancel_arg); \ __pthread_unwind_next (&__cancel_buf); \ /* NOTREACHED */ \ } \ \ __pthread_register_cancel (&__cancel_buf); \ do { extern void __pthread_register_cancel (__pthread_unwind_buf_t *__buf) __cleanup_fct_attribute; /* Remove a cleanup handler installed by the matching pthread_cleanup_push. If EXECUTE is non-zero, the handler function is called. */ # define pthread_cleanup_pop(execute) \ do { } while (0);/* Empty to allow label before pthread_cleanup_pop. */\ } while (0); \ __pthread_unregister_cancel (&__cancel_buf); \ if (execute) \ __cancel_routine (__cancel_arg); \ } while (0) extern void __pthread_unregister_cancel (__pthread_unwind_buf_t *__buf) __cleanup_fct_attribute; # ifdef __USE_GNU /* Install a cleanup handler as pthread_cleanup_push does, but also saves the current cancellation type and sets it to deferred cancellation. */ # define pthread_cleanup_push_defer_np(routine, arg) \ do { \ __pthread_unwind_buf_t __cancel_buf; \ void (*__cancel_routine) (void *) = (routine); \ void *__cancel_arg = (arg); \ int __not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *) \ __cancel_buf.__cancel_jmp_buf, 0); \ if (__glibc_unlikely (__not_first_call)) \ { \ __cancel_routine (__cancel_arg); \ __pthread_unwind_next (&__cancel_buf); \ /* NOTREACHED */ \ } \ \ __pthread_register_cancel_defer (&__cancel_buf); \ do { extern void __pthread_register_cancel_defer (__pthread_unwind_buf_t *__buf) __cleanup_fct_attribute; /* Remove a cleanup handler as pthread_cleanup_pop does, but also restores the cancellation type that was in effect when the matching pthread_cleanup_push_defer was called. */ # define pthread_cleanup_pop_restore_np(execute) \ do { } while (0);/* Empty to allow label before pthread_cleanup_pop. */\ } while (0); \ __pthread_unregister_cancel_restore (&__cancel_buf); \ if (execute) \ __cancel_routine (__cancel_arg); \ } while (0) extern void __pthread_unregister_cancel_restore (__pthread_unwind_buf_t *__buf) __cleanup_fct_attribute; # endif # 742 "/usr/include/pthread.h" 3 4 /* Internal interface to initiate cleanup. */ extern void __pthread_unwind_next (__pthread_unwind_buf_t *__buf) __cleanup_fct_attribute __attribute__ ((__noreturn__)) # ifndef SHARED __attribute__ ((__weak__)) # endif # 749 "/usr/include/pthread.h" 3 4 ; #endif # 751 "/usr/include/pthread.h" 3 4 /* Function used in the macros. */ struct __jmp_buf_tag; extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask) __THROWNL; /* Mutex handling. */ /* Initialize a mutex. */ extern int pthread_mutex_init (pthread_mutex_t *__mutex, const pthread_mutexattr_t *__mutexattr) __THROW __nonnull ((1)); /* Destroy a mutex. */ extern int pthread_mutex_destroy (pthread_mutex_t *__mutex) __THROW __nonnull ((1)); /* Try locking a mutex. */ extern int pthread_mutex_trylock (pthread_mutex_t *__mutex) __THROWNL __nonnull ((1)); /* Lock a mutex. */ extern int pthread_mutex_lock (pthread_mutex_t *__mutex) __THROWNL __nonnull ((1)); #ifdef __USE_XOPEN2K /* Wait until lock becomes available, or specified time passes. */ extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex, const struct timespec *__restrict __abstime) __THROWNL __nonnull ((1, 2)); #endif # 782 "/usr/include/pthread.h" 3 4 /* Unlock a mutex. */ extern int pthread_mutex_unlock (pthread_mutex_t *__mutex) __THROWNL __nonnull ((1)); /* Get the priority ceiling of MUTEX. */ extern int pthread_mutex_getprioceiling (const pthread_mutex_t * __restrict __mutex, int *__restrict __prioceiling) __THROW __nonnull ((1, 2)); /* Set the priority ceiling of MUTEX to PRIOCEILING, return old priority ceiling value in *OLD_CEILING. */ extern int pthread_mutex_setprioceiling (pthread_mutex_t *__restrict __mutex, int __prioceiling, int *__restrict __old_ceiling) __THROW __nonnull ((1, 3)); #ifdef __USE_XOPEN2K8 /* Declare the state protected by MUTEX as consistent. */ extern int pthread_mutex_consistent (pthread_mutex_t *__mutex) __THROW __nonnull ((1)); # ifdef __USE_GNU extern int pthread_mutex_consistent_np (pthread_mutex_t *__mutex) __THROW __nonnull ((1)); # endif # 810 "/usr/include/pthread.h" 3 4 #endif # 811 "/usr/include/pthread.h" 3 4 /* Functions for handling mutex attributes. */ /* Initialize mutex attribute object ATTR with default attributes (kind is PTHREAD_MUTEX_TIMED_NP). */ extern int pthread_mutexattr_init (pthread_mutexattr_t *__attr) __THROW __nonnull ((1)); /* Destroy mutex attribute object ATTR. */ extern int pthread_mutexattr_destroy (pthread_mutexattr_t *__attr) __THROW __nonnull ((1)); /* Get the process-shared flag of the mutex attribute ATTR. */ extern int pthread_mutexattr_getpshared (const pthread_mutexattr_t * __restrict __attr, int *__restrict __pshared) __THROW __nonnull ((1, 2)); /* Set the process-shared flag of the mutex attribute ATTR. */ extern int pthread_mutexattr_setpshared (pthread_mutexattr_t *__attr, int __pshared) __THROW __nonnull ((1)); #if defined __USE_UNIX98 || defined __USE_XOPEN2K8 /* Return in *KIND the mutex kind attribute in *ATTR. */ extern int pthread_mutexattr_gettype (const pthread_mutexattr_t *__restrict __attr, int *__restrict __kind) __THROW __nonnull ((1, 2)); /* Set the mutex kind attribute in *ATTR to KIND (either PTHREAD_MUTEX_NORMAL, PTHREAD_MUTEX_RECURSIVE, PTHREAD_MUTEX_ERRORCHECK, or PTHREAD_MUTEX_DEFAULT). */ extern int pthread_mutexattr_settype (pthread_mutexattr_t *__attr, int __kind) __THROW __nonnull ((1)); #endif # 847 "/usr/include/pthread.h" 3 4 /* Return in *PROTOCOL the mutex protocol attribute in *ATTR. */ extern int pthread_mutexattr_getprotocol (const pthread_mutexattr_t * __restrict __attr, int *__restrict __protocol) __THROW __nonnull ((1, 2)); /* Set the mutex protocol attribute in *ATTR to PROTOCOL (either PTHREAD_PRIO_NONE, PTHREAD_PRIO_INHERIT, or PTHREAD_PRIO_PROTECT). */ extern int pthread_mutexattr_setprotocol (pthread_mutexattr_t *__attr, int __protocol) __THROW __nonnull ((1)); /* Return in *PRIOCEILING the mutex prioceiling attribute in *ATTR. */ extern int pthread_mutexattr_getprioceiling (const pthread_mutexattr_t * __restrict __attr, int *__restrict __prioceiling) __THROW __nonnull ((1, 2)); /* Set the mutex prioceiling attribute in *ATTR to PRIOCEILING. */ extern int pthread_mutexattr_setprioceiling (pthread_mutexattr_t *__attr, int __prioceiling) __THROW __nonnull ((1)); #ifdef __USE_XOPEN2K /* Get the robustness flag of the mutex attribute ATTR. */ extern int pthread_mutexattr_getrobust (const pthread_mutexattr_t *__attr, int *__robustness) __THROW __nonnull ((1, 2)); # ifdef __USE_GNU extern int pthread_mutexattr_getrobust_np (const pthread_mutexattr_t *__attr, int *__robustness) __THROW __nonnull ((1, 2)); # endif # 881 "/usr/include/pthread.h" 3 4 /* Set the robustness flag of the mutex attribute ATTR. */ extern int pthread_mutexattr_setrobust (pthread_mutexattr_t *__attr, int __robustness) __THROW __nonnull ((1)); # ifdef __USE_GNU extern int pthread_mutexattr_setrobust_np (pthread_mutexattr_t *__attr, int __robustness) __THROW __nonnull ((1)); # endif # 891 "/usr/include/pthread.h" 3 4 #endif # 892 "/usr/include/pthread.h" 3 4 #if defined __USE_UNIX98 || defined __USE_XOPEN2K /* Functions for handling read-write locks. */ /* Initialize read-write lock RWLOCK using attributes ATTR, or use the default values if later is NULL. */ extern int pthread_rwlock_init (pthread_rwlock_t *__restrict __rwlock, const pthread_rwlockattr_t *__restrict __attr) __THROW __nonnull ((1)); /* Destroy read-write lock RWLOCK. */ extern int pthread_rwlock_destroy (pthread_rwlock_t *__rwlock) __THROW __nonnull ((1)); /* Acquire read lock for RWLOCK. */ extern int pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock) __THROWNL __nonnull ((1)); /* Try to acquire read lock for RWLOCK. */ extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock) __THROWNL __nonnull ((1)); # ifdef __USE_XOPEN2K /* Try to acquire read lock for RWLOCK or return after specfied time. */ extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock, const struct timespec *__restrict __abstime) __THROWNL __nonnull ((1, 2)); # endif # 921 "/usr/include/pthread.h" 3 4 /* Acquire write lock for RWLOCK. */ extern int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock) __THROWNL __nonnull ((1)); /* Try to acquire write lock for RWLOCK. */ extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock) __THROWNL __nonnull ((1)); # ifdef __USE_XOPEN2K /* Try to acquire write lock for RWLOCK or return after specfied time. */ extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock, const struct timespec *__restrict __abstime) __THROWNL __nonnull ((1, 2)); # endif # 936 "/usr/include/pthread.h" 3 4 /* Unlock RWLOCK. */ extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock) __THROWNL __nonnull ((1)); /* Functions for handling read-write lock attributes. */ /* Initialize attribute object ATTR with default values. */ extern int pthread_rwlockattr_init (pthread_rwlockattr_t *__attr) __THROW __nonnull ((1)); /* Destroy attribute object ATTR. */ extern int pthread_rwlockattr_destroy (pthread_rwlockattr_t *__attr) __THROW __nonnull ((1)); /* Return current setting of process-shared attribute of ATTR in PSHARED. */ extern int pthread_rwlockattr_getpshared (const pthread_rwlockattr_t * __restrict __attr, int *__restrict __pshared) __THROW __nonnull ((1, 2)); /* Set process-shared attribute of ATTR to PSHARED. */ extern int pthread_rwlockattr_setpshared (pthread_rwlockattr_t *__attr, int __pshared) __THROW __nonnull ((1)); /* Return current setting of reader/writer preference. */ extern int pthread_rwlockattr_getkind_np (const pthread_rwlockattr_t * __restrict __attr, int *__restrict __pref) __THROW __nonnull ((1, 2)); /* Set reader/write preference. */ extern int pthread_rwlockattr_setkind_np (pthread_rwlockattr_t *__attr, int __pref) __THROW __nonnull ((1)); #endif # 973 "/usr/include/pthread.h" 3 4 /* Functions for handling conditional variables. */ /* Initialize condition variable COND using attributes ATTR, or use the default values if later is NULL. */ extern int pthread_cond_init (pthread_cond_t *__restrict __cond, const pthread_condattr_t *__restrict __cond_attr) __THROW __nonnull ((1)); /* Destroy condition variable COND. */ extern int pthread_cond_destroy (pthread_cond_t *__cond) __THROW __nonnull ((1)); /* Wake up one thread waiting for condition variable COND. */ extern int pthread_cond_signal (pthread_cond_t *__cond) __THROWNL __nonnull ((1)); /* Wake up all threads waiting for condition variables COND. */ extern int pthread_cond_broadcast (pthread_cond_t *__cond) __THROWNL __nonnull ((1)); /* Wait for condition variable COND to be signaled or broadcast. MUTEX is assumed to be locked before. This function is a cancellation point and therefore not marked with __THROW. */ extern int pthread_cond_wait (pthread_cond_t *__restrict __cond, pthread_mutex_t *__restrict __mutex) __nonnull ((1, 2)); /* Wait for condition variable COND to be signaled or broadcast until ABSTIME. MUTEX is assumed to be locked before. ABSTIME is an absolute time specification; zero is the beginning of the epoch (00:00:00 GMT, January 1, 1970). This function is a cancellation point and therefore not marked with __THROW. */ extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond, pthread_mutex_t *__restrict __mutex, const struct timespec *__restrict __abstime) __nonnull ((1, 2, 3)); /* Functions for handling condition variable attributes. */ /* Initialize condition variable attribute ATTR. */ extern int pthread_condattr_init (pthread_condattr_t *__attr) __THROW __nonnull ((1)); /* Destroy condition variable attribute ATTR. */ extern int pthread_condattr_destroy (pthread_condattr_t *__attr) __THROW __nonnull ((1)); /* Get the process-shared flag of the condition variable attribute ATTR. */ extern int pthread_condattr_getpshared (const pthread_condattr_t * __restrict __attr, int *__restrict __pshared) __THROW __nonnull ((1, 2)); /* Set the process-shared flag of the condition variable attribute ATTR. */ extern int pthread_condattr_setpshared (pthread_condattr_t *__attr, int __pshared) __THROW __nonnull ((1)); #ifdef __USE_XOPEN2K /* Get the clock selected for the condition variable attribute ATTR. */ extern int pthread_condattr_getclock (const pthread_condattr_t * __restrict __attr, __clockid_t *__restrict __clock_id) __THROW __nonnull ((1, 2)); /* Set the clock selected for the condition variable attribute ATTR. */ extern int pthread_condattr_setclock (pthread_condattr_t *__attr, __clockid_t __clock_id) __THROW __nonnull ((1)); #endif # 1048 "/usr/include/pthread.h" 3 4 #ifdef __USE_XOPEN2K /* Functions to handle spinlocks. */ /* Initialize the spinlock LOCK. If PSHARED is nonzero the spinlock can be shared between different processes. */ extern int pthread_spin_init (pthread_spinlock_t *__lock, int __pshared) __THROW __nonnull ((1)); /* Destroy the spinlock LOCK. */ extern int pthread_spin_destroy (pthread_spinlock_t *__lock) __THROW __nonnull ((1)); /* Wait until spinlock LOCK is retrieved. */ extern int pthread_spin_lock (pthread_spinlock_t *__lock) __THROWNL __nonnull ((1)); /* Try to lock spinlock LOCK. */ extern int pthread_spin_trylock (pthread_spinlock_t *__lock) __THROWNL __nonnull ((1)); /* Release spinlock LOCK. */ extern int pthread_spin_unlock (pthread_spinlock_t *__lock) __THROWNL __nonnull ((1)); /* Functions to handle barriers. */ /* Initialize BARRIER with the attributes in ATTR. The barrier is opened when COUNT waiters arrived. */ extern int pthread_barrier_init (pthread_barrier_t *__restrict __barrier, const pthread_barrierattr_t *__restrict __attr, unsigned int __count) __THROW __nonnull ((1)); /* Destroy a previously dynamically initialized barrier BARRIER. */ extern int pthread_barrier_destroy (pthread_barrier_t *__barrier) __THROW __nonnull ((1)); /* Wait on barrier BARRIER. */ extern int pthread_barrier_wait (pthread_barrier_t *__barrier) __THROWNL __nonnull ((1)); /* Initialize barrier attribute ATTR. */ extern int pthread_barrierattr_init (pthread_barrierattr_t *__attr) __THROW __nonnull ((1)); /* Destroy previously dynamically initialized barrier attribute ATTR. */ extern int pthread_barrierattr_destroy (pthread_barrierattr_t *__attr) __THROW __nonnull ((1)); /* Get the process-shared flag of the barrier attribute ATTR. */ extern int pthread_barrierattr_getpshared (const pthread_barrierattr_t * __restrict __attr, int *__restrict __pshared) __THROW __nonnull ((1, 2)); /* Set the process-shared flag of the barrier attribute ATTR. */ extern int pthread_barrierattr_setpshared (pthread_barrierattr_t *__attr, int __pshared) __THROW __nonnull ((1)); #endif # 1112 "/usr/include/pthread.h" 3 4 /* Functions for handling thread-specific data. */ /* Create a key value identifying a location in the thread-specific data area. Each thread maintains a distinct thread-specific data area. DESTR_FUNCTION, if non-NULL, is called with the value associated to that key when the key is destroyed. DESTR_FUNCTION is not called if the value associated is NULL when the key is destroyed. */ extern int pthread_key_create (pthread_key_t *__key, void (*__destr_function) (void *)) __THROW __nonnull ((1)); /* Destroy KEY. */ extern int pthread_key_delete (pthread_key_t __key) __THROW; /* Return current value of the thread-specific data slot identified by KEY. */ extern void *pthread_getspecific (pthread_key_t __key) __THROW; /* Store POINTER in the thread-specific data slot identified by KEY. */ extern int pthread_setspecific (pthread_key_t __key, const void *__pointer) __THROW ; #ifdef __USE_XOPEN2K /* Get ID of CPU-time clock for thread THREAD_ID. */ extern int pthread_getcpuclockid (pthread_t __thread_id, __clockid_t *__clock_id) __THROW __nonnull ((2)); #endif # 1143 "/usr/include/pthread.h" 3 4 /* Install handlers to be called when a new process is created with FORK. The PREPARE handler is called in the parent process just before performing FORK. The PARENT handler is called in the parent process just after FORK. The CHILD handler is called in the child process. Each of the three handlers can be NULL, meaning that no handler needs to be called at that point. PTHREAD_ATFORK can be called several times, in which case the PREPARE handlers are called in LIFO order (last added with PTHREAD_ATFORK, first called before FORK), and the PARENT and CHILD handlers are called in FIFO (first added, first called). */ extern int pthread_atfork (void (*__prepare) (void), void (*__parent) (void), void (*__child) (void)) __THROW; #ifdef __USE_EXTERN_INLINES /* Optimizations. */ __extern_inline int __NTH (pthread_equal (pthread_t __thread1, pthread_t __thread2)) { return __thread1 == __thread2; } #endif # 1169 "/usr/include/pthread.h" 3 4 __END_DECLS #endif /* pthread.h */ # 1173 "/usr/include/pthread.h" 3 4 # 36 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/gthr-default.h" 2 3 #if ((defined(_LIBOBJC) || defined(_LIBOBJC_WEAK)) \ || !defined(_GTHREAD_USE_MUTEX_TIMEDLOCK)) #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/gthr-default.h" 3 # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/gthr-default.h" 3 # if defined(_POSIX_TIMEOUTS) && _POSIX_TIMEOUTS >= 0 # define _GTHREAD_USE_MUTEX_TIMEDLOCK 1 # else # 43 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/gthr-default.h" 3 # define _GTHREAD_USE_MUTEX_TIMEDLOCK 0 # endif # 45 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/gthr-default.h" 3 #endif # 46 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/gthr-default.h" 3 typedef pthread_t __gthread_t; typedef pthread_key_t __gthread_key_t; typedef pthread_once_t __gthread_once_t; typedef pthread_mutex_t __gthread_mutex_t; typedef pthread_mutex_t __gthread_recursive_mutex_t; typedef pthread_cond_t __gthread_cond_t; typedef struct timespec __gthread_time_t; /* POSIX like conditional variables are supported. Please look at comments in gthr.h for details. */ #define __GTHREAD_HAS_COND 1 #define __GTHREAD_MUTEX_INIT PTHREAD_MUTEX_INITIALIZER #define __GTHREAD_MUTEX_INIT_FUNCTION __gthread_mutex_init_function #define __GTHREAD_ONCE_INIT PTHREAD_ONCE_INIT #if defined(PTHREAD_RECURSIVE_MUTEX_INITIALIZER) #define __GTHREAD_RECURSIVE_MUTEX_INIT PTHREAD_RECURSIVE_MUTEX_INITIALIZER #elif defined(PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP) # 65 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/gthr-default.h" 3 #define __GTHREAD_RECURSIVE_MUTEX_INIT PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP #else # 67 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/gthr-default.h" 3 #define __GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION __gthread_recursive_mutex_init_function #endif # 69 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/gthr-default.h" 3 #define __GTHREAD_COND_INIT PTHREAD_COND_INITIALIZER #define __GTHREAD_TIME_INIT {0,0} #ifdef _GTHREAD_USE_MUTEX_INIT_FUNC # undef __GTHREAD_MUTEX_INIT #endif # 75 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/gthr-default.h" 3 #ifdef _GTHREAD_USE_RECURSIVE_MUTEX_INIT_FUNC # undef __GTHREAD_RECURSIVE_MUTEX_INIT # undef __GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION # define __GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION __gthread_recursive_mutex_init_function #endif # 80 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/gthr-default.h" 3 #ifdef _GTHREAD_USE_COND_INIT_FUNC # undef __GTHREAD_COND_INIT # define __GTHREAD_COND_INIT_FUNCTION __gthread_cond_init_function #endif # 84 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/gthr-default.h" 3 #if __GXX_WEAK__ && _GLIBCXX_GTHREAD_USE_WEAK # ifndef __gthrw_pragma # define __gthrw_pragma(pragma) # endif # 89 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/gthr-default.h" 3 # define __gthrw2(name,name2,type) \ static __typeof(type) name __attribute__ ((__weakref__(#name2))); \ __gthrw_pragma(weak type) # define __gthrw_(name) __gthrw_ ## name #else # 94 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/gthr-default.h" 3 # define __gthrw2(name,name2,type) # define __gthrw_(name) name #endif # 97 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/gthr-default.h" 3 /* Typically, __gthrw_foo is a weak reference to symbol foo. */ #define __gthrw(name) __gthrw2(__gthrw_ ## name,name,name) __gthrw(pthread_once) __gthrw(pthread_getspecific) __gthrw(pthread_setspecific) __gthrw(pthread_create) __gthrw(pthread_join) __gthrw(pthread_equal) __gthrw(pthread_self) __gthrw(pthread_detach) #ifndef __BIONIC__ __gthrw(pthread_cancel) #endif # 113 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/gthr-default.h" 3 __gthrw(sched_yield) __gthrw(pthread_mutex_lock) __gthrw(pthread_mutex_trylock) #if _GTHREAD_USE_MUTEX_TIMEDLOCK __gthrw(pthread_mutex_timedlock) #endif # 120 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/gthr-default.h" 3 __gthrw(pthread_mutex_unlock) __gthrw(pthread_mutex_init) __gthrw(pthread_mutex_destroy) __gthrw(pthread_cond_init) __gthrw(pthread_cond_broadcast) __gthrw(pthread_cond_signal) __gthrw(pthread_cond_wait) __gthrw(pthread_cond_timedwait) __gthrw(pthread_cond_destroy) __gthrw(pthread_key_create) __gthrw(pthread_key_delete) __gthrw(pthread_mutexattr_init) __gthrw(pthread_mutexattr_settype) __gthrw(pthread_mutexattr_destroy) #if defined(_LIBOBJC) || defined(_LIBOBJC_WEAK) /* Objective-C. */ __gthrw(pthread_exit) #ifdef _POSIX_PRIORITY_SCHEDULING #ifdef _POSIX_THREAD_PRIORITY_SCHEDULING __gthrw(sched_get_priority_max) __gthrw(sched_get_priority_min) #endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */ # 146 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/gthr-default.h" 3 #endif /* _POSIX_PRIORITY_SCHEDULING */ # 147 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/gthr-default.h" 3 __gthrw(pthread_attr_destroy) __gthrw(pthread_attr_init) __gthrw(pthread_attr_setdetachstate) #ifdef _POSIX_THREAD_PRIORITY_SCHEDULING __gthrw(pthread_getschedparam) __gthrw(pthread_setschedparam) #endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */ # 154 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/gthr-default.h" 3 #endif /* _LIBOBJC || _LIBOBJC_WEAK */ # 155 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/gthr-default.h" 3 #if __GXX_WEAK__ && _GLIBCXX_GTHREAD_USE_WEAK /* On Solaris 2.6 up to 9, the libc exposes a POSIX threads interface even if -pthreads is not specified. The functions are dummies and most return an error value. However pthread_once returns 0 without invoking the routine it is passed so we cannot pretend that the interface is active if -pthreads is not specified. On Solaris 2.5.1, the interface is not exposed at all so we need to play the usual game with weak symbols. On Solaris 10 and up, a working interface is always exposed. On FreeBSD 6 and later, libc also exposes a dummy POSIX threads interface, similar to what Solaris 2.6 up to 9 does. FreeBSD >= 700014 even provides a pthread_cancel stub in libc, which means the alternate __gthread_active_p below cannot be used there. */ #if defined(__FreeBSD__) || (defined(__sun) && defined(__svr4__)) static volatile int __gthread_active = -1; static void __gthread_trigger (void) { __gthread_active = 1; } static inline int __gthread_active_p (void) { static pthread_mutex_t __gthread_active_mutex = PTHREAD_MUTEX_INITIALIZER; static pthread_once_t __gthread_active_once = PTHREAD_ONCE_INIT; /* Avoid reading __gthread_active twice on the main code path. */ int __gthread_active_latest_value = __gthread_active; /* This test is not protected to avoid taking a lock on the main code path so every update of __gthread_active in a threaded program must be atomic with regard to the result of the test. */ if (__builtin_expect (__gthread_active_latest_value < 0, 0)) { if (__gthrw_(pthread_once)) { /* If this really is a threaded program, then we must ensure that __gthread_active has been set to 1 before exiting this block. */ __gthrw_(pthread_mutex_lock) (&__gthread_active_mutex); __gthrw_(pthread_once) (&__gthread_active_once, __gthread_trigger); __gthrw_(pthread_mutex_unlock) (&__gthread_active_mutex); } /* Make sure we'll never enter this block again. */ if (__gthread_active < 0) __gthread_active = 0; __gthread_active_latest_value = __gthread_active; } return __gthread_active_latest_value != 0; } #else /* neither FreeBSD nor Solaris */ # 213 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/gthr-default.h" 3 /* For a program to be multi-threaded the only thing that it certainly must be using is pthread_create. However, there may be other libraries that intercept pthread_create with their own definitions to wrap pthreads functionality for some purpose. In those cases, pthread_create being defined might not necessarily mean that libpthread is actually linked in. For the GNU C library, we can use a known internal name. This is always available in the ABI, but no other library would define it. That is ideal, since any public pthread function might be intercepted just as pthread_create might be. __pthread_key_create is an "internal" implementation symbol, but it is part of the public exported ABI. Also, it's among the symbols that the static libpthread.a always links in whenever pthread_create is used, so there is no danger of a false negative result in any statically-linked, multi-threaded program. For others, we choose pthread_cancel as a function that seems unlikely to be redefined by an interceptor library. The bionic (Android) C library does not provide pthread_cancel, so we do use pthread_create there (and interceptor libraries lose). */ #ifdef __GLIBC__ __gthrw2(__gthrw_(__pthread_key_create), __pthread_key_create, pthread_key_create) # define GTHR_ACTIVE_PROXY __gthrw_(__pthread_key_create) #elif defined (__BIONIC__) # 241 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/gthr-default.h" 3 # define GTHR_ACTIVE_PROXY __gthrw_(pthread_create) #else # 243 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/gthr-default.h" 3 # define GTHR_ACTIVE_PROXY __gthrw_(pthread_cancel) #endif # 245 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/gthr-default.h" 3 static inline int __gthread_active_p (void) { static void *const __gthread_active_ptr = __extension__ (void *) >HR_ACTIVE_PROXY; return __gthread_active_ptr != 0; } #endif /* FreeBSD or Solaris */ # 255 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/gthr-default.h" 3 #else /* not __GXX_WEAK__ */ # 257 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/gthr-default.h" 3 /* Similar to Solaris, HP-UX 11 for PA-RISC provides stubs for pthread calls in shared flavors of the HP-UX C library. Most of the stubs have no functionality. The details are described in the "libc cumulative patch" for each subversion of HP-UX 11. There are two special interfaces provided for checking whether an application is linked to a shared pthread library or not. However, these interfaces aren't available in early libpthread libraries. We also need a test that works for archive libraries. We can't use pthread_once as some libc versions call the init function. We also can't use pthread_create or pthread_attr_init as these create a thread and thereby prevent changing the default stack size. The function pthread_default_stacksize_np is available in both the archive and shared versions of libpthread. It can be used to determine the default pthread stack size. There is a stub in some shared libc versions which returns a zero size if pthreads are not active. We provide an equivalent stub to handle cases where libc doesn't provide one. */ #if defined(__hppa__) && defined(__hpux__) static volatile int __gthread_active = -1; static inline int __gthread_active_p (void) { /* Avoid reading __gthread_active twice on the main code path. */ int __gthread_active_latest_value = __gthread_active; size_t __s; if (__builtin_expect (__gthread_active_latest_value < 0, 0)) { pthread_default_stacksize_np (0, &__s); __gthread_active = __s ? 1 : 0; __gthread_active_latest_value = __gthread_active; } return __gthread_active_latest_value != 0; } #else /* not hppa-hpux */ # 297 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/gthr-default.h" 3 static inline int __gthread_active_p (void) { return 1; } #endif /* hppa-hpux */ # 305 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/gthr-default.h" 3 #endif /* __GXX_WEAK__ */ # 307 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/gthr-default.h" 3 #ifdef _LIBOBJC /* This is the config.h file in libobjc/ */ #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 311 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/gthr-default.h" 3 # 312 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/gthr-default.h" 3 #ifdef HAVE_SCHED_H #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 314 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/gthr-default.h" 3 # 315 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/gthr-default.h" 3 #endif # 316 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/gthr-default.h" 3 /* Key structure for maintaining thread specific storage */ static pthread_key_t _objc_thread_storage; static pthread_attr_t _objc_thread_attribs; /* Thread local storage for a single thread */ static void *thread_local_storage = NULL; /* Backend initialization functions */ /* Initialize the threads subsystem. */ static inline int __gthread_objc_init_thread_system (void) { if (__gthread_active_p ()) { /* Initialize the thread storage key. */ if (__gthrw_(pthread_key_create) (&_objc_thread_storage, NULL) == 0) { /* The normal default detach state for threads is * PTHREAD_CREATE_JOINABLE which causes threads to not die * when you think they should. */ if (__gthrw_(pthread_attr_init) (&_objc_thread_attribs) == 0 && __gthrw_(pthread_attr_setdetachstate) (&_objc_thread_attribs, PTHREAD_CREATE_DETACHED) == 0) return 0; } } return -1; } /* Close the threads subsystem. */ static inline int __gthread_objc_close_thread_system (void) { if (__gthread_active_p () && __gthrw_(pthread_key_delete) (_objc_thread_storage) == 0 && __gthrw_(pthread_attr_destroy) (&_objc_thread_attribs) == 0) return 0; return -1; } /* Backend thread functions */ /* Create a new thread of execution. */ static inline objc_thread_t __gthread_objc_thread_detach (void (*func)(void *), void *arg) { objc_thread_t thread_id; pthread_t new_thread_handle; if (!__gthread_active_p ()) return NULL; if (!(__gthrw_(pthread_create) (&new_thread_handle, &_objc_thread_attribs, (void *) func, arg))) thread_id = (objc_thread_t) new_thread_handle; else thread_id = NULL; return thread_id; } /* Set the current thread's priority. */ static inline int __gthread_objc_thread_set_priority (int priority) { if (!__gthread_active_p ()) return -1; else { #ifdef _POSIX_PRIORITY_SCHEDULING #ifdef _POSIX_THREAD_PRIORITY_SCHEDULING pthread_t thread_id = __gthrw_(pthread_self) (); int policy; struct sched_param params; int priority_min, priority_max; if (__gthrw_(pthread_getschedparam) (thread_id, &policy, ¶ms) == 0) { if ((priority_max = __gthrw_(sched_get_priority_max) (policy)) == -1) return -1; if ((priority_min = __gthrw_(sched_get_priority_min) (policy)) == -1) return -1; if (priority > priority_max) priority = priority_max; else if (priority < priority_min) priority = priority_min; params.sched_priority = priority; /* * The solaris 7 and several other man pages incorrectly state that * this should be a pointer to policy but pthread.h is universally * at odds with this. */ if (__gthrw_(pthread_setschedparam) (thread_id, policy, ¶ms) == 0) return 0; } #endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */ # 419 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/gthr-default.h" 3 #endif /* _POSIX_PRIORITY_SCHEDULING */ # 420 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/gthr-default.h" 3 return -1; } } /* Return the current thread's priority. */ static inline int __gthread_objc_thread_get_priority (void) { #ifdef _POSIX_PRIORITY_SCHEDULING #ifdef _POSIX_THREAD_PRIORITY_SCHEDULING if (__gthread_active_p ()) { int policy; struct sched_param params; if (__gthrw_(pthread_getschedparam) (__gthrw_(pthread_self) (), &policy, ¶ms) == 0) return params.sched_priority; else return -1; } else #endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */ # 442 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/gthr-default.h" 3 #endif /* _POSIX_PRIORITY_SCHEDULING */ # 443 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/gthr-default.h" 3 return OBJC_THREAD_INTERACTIVE_PRIORITY; } /* Yield our process time to another thread. */ static inline void __gthread_objc_thread_yield (void) { if (__gthread_active_p ()) __gthrw_(sched_yield) (); } /* Terminate the current thread. */ static inline int __gthread_objc_thread_exit (void) { if (__gthread_active_p ()) /* exit the thread */ __gthrw_(pthread_exit) (&__objc_thread_exit_status); /* Failed if we reached here */ return -1; } /* Returns an integer value which uniquely describes a thread. */ static inline objc_thread_t __gthread_objc_thread_id (void) { if (__gthread_active_p ()) return (objc_thread_t) __gthrw_(pthread_self) (); else return (objc_thread_t) 1; } /* Sets the thread's local storage pointer. */ static inline int __gthread_objc_thread_set_data (void *value) { if (__gthread_active_p ()) return __gthrw_(pthread_setspecific) (_objc_thread_storage, value); else { thread_local_storage = value; return 0; } } /* Returns the thread's local storage pointer. */ static inline void * __gthread_objc_thread_get_data (void) { if (__gthread_active_p ()) return __gthrw_(pthread_getspecific) (_objc_thread_storage); else return thread_local_storage; } /* Backend mutex functions */ /* Allocate a mutex. */ static inline int __gthread_objc_mutex_allocate (objc_mutex_t mutex) { if (__gthread_active_p ()) { mutex->backend = objc_malloc (sizeof (pthread_mutex_t)); if (__gthrw_(pthread_mutex_init) ((pthread_mutex_t *) mutex->backend, NULL)) { objc_free (mutex->backend); mutex->backend = NULL; return -1; } } return 0; } /* Deallocate a mutex. */ static inline int __gthread_objc_mutex_deallocate (objc_mutex_t mutex) { if (__gthread_active_p ()) { int count; /* * Posix Threads specifically require that the thread be unlocked * for __gthrw_(pthread_mutex_destroy) to work. */ do { count = __gthrw_(pthread_mutex_unlock) ((pthread_mutex_t *) mutex->backend); if (count < 0) return -1; } while (count); if (__gthrw_(pthread_mutex_destroy) ((pthread_mutex_t *) mutex->backend)) return -1; objc_free (mutex->backend); mutex->backend = NULL; } return 0; } /* Grab a lock on a mutex. */ static inline int __gthread_objc_mutex_lock (objc_mutex_t mutex) { if (__gthread_active_p () && __gthrw_(pthread_mutex_lock) ((pthread_mutex_t *) mutex->backend) != 0) { return -1; } return 0; } /* Try to grab a lock on a mutex. */ static inline int __gthread_objc_mutex_trylock (objc_mutex_t mutex) { if (__gthread_active_p () && __gthrw_(pthread_mutex_trylock) ((pthread_mutex_t *) mutex->backend) != 0) { return -1; } return 0; } /* Unlock the mutex */ static inline int __gthread_objc_mutex_unlock (objc_mutex_t mutex) { if (__gthread_active_p () && __gthrw_(pthread_mutex_unlock) ((pthread_mutex_t *) mutex->backend) != 0) { return -1; } return 0; } /* Backend condition mutex functions */ /* Allocate a condition. */ static inline int __gthread_objc_condition_allocate (objc_condition_t condition) { if (__gthread_active_p ()) { condition->backend = objc_malloc (sizeof (pthread_cond_t)); if (__gthrw_(pthread_cond_init) ((pthread_cond_t *) condition->backend, NULL)) { objc_free (condition->backend); condition->backend = NULL; return -1; } } return 0; } /* Deallocate a condition. */ static inline int __gthread_objc_condition_deallocate (objc_condition_t condition) { if (__gthread_active_p ()) { if (__gthrw_(pthread_cond_destroy) ((pthread_cond_t *) condition->backend)) return -1; objc_free (condition->backend); condition->backend = NULL; } return 0; } /* Wait on the condition */ static inline int __gthread_objc_condition_wait (objc_condition_t condition, objc_mutex_t mutex) { if (__gthread_active_p ()) return __gthrw_(pthread_cond_wait) ((pthread_cond_t *) condition->backend, (pthread_mutex_t *) mutex->backend); else return 0; } /* Wake up all threads waiting on this condition. */ static inline int __gthread_objc_condition_broadcast (objc_condition_t condition) { if (__gthread_active_p ()) return __gthrw_(pthread_cond_broadcast) ((pthread_cond_t *) condition->backend); else return 0; } /* Wake up one thread waiting on this condition. */ static inline int __gthread_objc_condition_signal (objc_condition_t condition) { if (__gthread_active_p ()) return __gthrw_(pthread_cond_signal) ((pthread_cond_t *) condition->backend); else return 0; } #else /* _LIBOBJC */ # 657 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/gthr-default.h" 3 static inline int __gthread_create (__gthread_t *__threadid, void *(*__func) (void*), void *__args) { return __gthrw_(pthread_create) (__threadid, NULL, __func, __args); } static inline int __gthread_join (__gthread_t __threadid, void **__value_ptr) { return __gthrw_(pthread_join) (__threadid, __value_ptr); } static inline int __gthread_detach (__gthread_t __threadid) { return __gthrw_(pthread_detach) (__threadid); } static inline int __gthread_equal (__gthread_t __t1, __gthread_t __t2) { return __gthrw_(pthread_equal) (__t1, __t2); } static inline __gthread_t __gthread_self (void) { return __gthrw_(pthread_self) (); } static inline int __gthread_yield (void) { return __gthrw_(sched_yield) (); } static inline int __gthread_once (__gthread_once_t *__once, void (*__func) (void)) { if (__gthread_active_p ()) return __gthrw_(pthread_once) (__once, __func); else return -1; } static inline int __gthread_key_create (__gthread_key_t *__key, void (*__dtor) (void *)) { return __gthrw_(pthread_key_create) (__key, __dtor); } static inline int __gthread_key_delete (__gthread_key_t __key) { return __gthrw_(pthread_key_delete) (__key); } static inline void * __gthread_getspecific (__gthread_key_t __key) { return __gthrw_(pthread_getspecific) (__key); } static inline int __gthread_setspecific (__gthread_key_t __key, const void *__ptr) { return __gthrw_(pthread_setspecific) (__key, __ptr); } static inline void __gthread_mutex_init_function (__gthread_mutex_t *__mutex) { if (__gthread_active_p ()) __gthrw_(pthread_mutex_init) (__mutex, NULL); } static inline int __gthread_mutex_destroy (__gthread_mutex_t *__mutex) { if (__gthread_active_p ()) return __gthrw_(pthread_mutex_destroy) (__mutex); else return 0; } static inline int __gthread_mutex_lock (__gthread_mutex_t *__mutex) { if (__gthread_active_p ()) return __gthrw_(pthread_mutex_lock) (__mutex); else return 0; } static inline int __gthread_mutex_trylock (__gthread_mutex_t *__mutex) { if (__gthread_active_p ()) return __gthrw_(pthread_mutex_trylock) (__mutex); else return 0; } #if _GTHREAD_USE_MUTEX_TIMEDLOCK static inline int __gthread_mutex_timedlock (__gthread_mutex_t *__mutex, const __gthread_time_t *__abs_timeout) { if (__gthread_active_p ()) return __gthrw_(pthread_mutex_timedlock) (__mutex, __abs_timeout); else return 0; } #endif # 773 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/gthr-default.h" 3 static inline int __gthread_mutex_unlock (__gthread_mutex_t *__mutex) { if (__gthread_active_p ()) return __gthrw_(pthread_mutex_unlock) (__mutex); else return 0; } #if !defined( PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP) \ || defined(_GTHREAD_USE_RECURSIVE_MUTEX_INIT_FUNC) static inline int __gthread_recursive_mutex_init_function (__gthread_recursive_mutex_t *__mutex) { if (__gthread_active_p ()) { pthread_mutexattr_t __attr; int __r; __r = __gthrw_(pthread_mutexattr_init) (&__attr); if (!__r) __r = __gthrw_(pthread_mutexattr_settype) (&__attr, PTHREAD_MUTEX_RECURSIVE); if (!__r) __r = __gthrw_(pthread_mutex_init) (__mutex, &__attr); if (!__r) __r = __gthrw_(pthread_mutexattr_destroy) (&__attr); return __r; } return 0; } #endif # 806 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/gthr-default.h" 3 static inline int __gthread_recursive_mutex_lock (__gthread_recursive_mutex_t *__mutex) { return __gthread_mutex_lock (__mutex); } static inline int __gthread_recursive_mutex_trylock (__gthread_recursive_mutex_t *__mutex) { return __gthread_mutex_trylock (__mutex); } #if _GTHREAD_USE_MUTEX_TIMEDLOCK static inline int __gthread_recursive_mutex_timedlock (__gthread_recursive_mutex_t *__mutex, const __gthread_time_t *__abs_timeout) { return __gthread_mutex_timedlock (__mutex, __abs_timeout); } #endif # 827 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/gthr-default.h" 3 static inline int __gthread_recursive_mutex_unlock (__gthread_recursive_mutex_t *__mutex) { return __gthread_mutex_unlock (__mutex); } static inline int __gthread_recursive_mutex_destroy (__gthread_recursive_mutex_t *__mutex) { return __gthread_mutex_destroy (__mutex); } #ifdef _GTHREAD_USE_COND_INIT_FUNC static inline void __gthread_cond_init_function (__gthread_cond_t *__cond) { if (__gthread_active_p ()) __gthrw_(pthread_cond_init) (__cond, NULL); } #endif # 848 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/gthr-default.h" 3 static inline int __gthread_cond_broadcast (__gthread_cond_t *__cond) { return __gthrw_(pthread_cond_broadcast) (__cond); } static inline int __gthread_cond_signal (__gthread_cond_t *__cond) { return __gthrw_(pthread_cond_signal) (__cond); } static inline int __gthread_cond_wait (__gthread_cond_t *__cond, __gthread_mutex_t *__mutex) { return __gthrw_(pthread_cond_wait) (__cond, __mutex); } static inline int __gthread_cond_timedwait (__gthread_cond_t *__cond, __gthread_mutex_t *__mutex, const __gthread_time_t *__abs_timeout) { return __gthrw_(pthread_cond_timedwait) (__cond, __mutex, __abs_timeout); } static inline int __gthread_cond_wait_recursive (__gthread_cond_t *__cond, __gthread_recursive_mutex_t *__mutex) { return __gthread_cond_wait (__cond, __mutex); } static inline int __gthread_cond_destroy (__gthread_cond_t* __cond) { return __gthrw_(pthread_cond_destroy) (__cond); } #endif /* _LIBOBJC */ # 888 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/gthr-default.h" 3 #endif /* ! _GLIBCXX_GCC_GTHR_POSIX_H */ # 890 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/gthr-default.h" 3 # 149 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/gthr.h" 2 3 #ifndef _GLIBCXX_HIDE_EXPORTS #pragma GCC visibility pop #endif # 153 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/gthr.h" 3 #endif /* ! _GLIBCXX_GCC_GTHR_H */ # 155 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/gthr.h" 3 # 36 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/atomicity.h" 2 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 36 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/atomicity.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/atomic_word.h" 1 3 // Low-level type for atomic operations -*- C++ -*- // Copyright (C) 2004-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file atomic_word.h * This file is a GNU extension to the Standard C++ Library. */ #ifndef _GLIBCXX_ATOMIC_WORD_H #define _GLIBCXX_ATOMIC_WORD_H 1 typedef int _Atomic_word; // Define these two macros using the appropriate memory barrier for the target. // The commented out versions below are the defaults. // See ia64/atomic_word.h for an alternative approach. // This one prevents loads from being hoisted across the barrier; // in other words, this is a Load-Load acquire barrier. // This is necessary iff TARGET_RELAXED_ORDERING is defined in tm.h. // #define _GLIBCXX_READ_MEM_BARRIER __asm __volatile ("":::"memory") // This one prevents stores from being sunk across the barrier; in other // words, a Store-Store release barrier. // #define _GLIBCXX_WRITE_MEM_BARRIER __asm __volatile ("":::"memory") #endif # 48 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/atomic_word.h" 3 # 37 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/atomicity.h" 2 3 namespace __gnu_cxx _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION // Functions for portable atomic access. // To abstract locking primitives across all thread policies, use: // __exchange_and_add_dispatch // __atomic_add_dispatch #ifdef _GLIBCXX_ATOMIC_BUILTINS static inline _Atomic_word __exchange_and_add(volatile _Atomic_word* __mem, int __val) { return __atomic_fetch_add(__mem, __val, __ATOMIC_ACQ_REL); } static inline void __atomic_add(volatile _Atomic_word* __mem, int __val) { __atomic_fetch_add(__mem, __val, __ATOMIC_ACQ_REL); } #else # 55 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/atomicity.h" 3 _Atomic_word __attribute__ ((__unused__)) __exchange_and_add(volatile _Atomic_word*, int) throw (); void __attribute__ ((__unused__)) __atomic_add(volatile _Atomic_word*, int) throw (); #endif # 63 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/atomicity.h" 3 static inline _Atomic_word __exchange_and_add_single(_Atomic_word* __mem, int __val) { _Atomic_word __result = *__mem; *__mem += __val; return __result; } static inline void __atomic_add_single(_Atomic_word* __mem, int __val) { *__mem += __val; } static inline _Atomic_word __attribute__ ((__unused__)) __exchange_and_add_dispatch(_Atomic_word* __mem, int __val) { #ifdef __GTHREADS if (__gthread_active_p()) return __exchange_and_add(__mem, __val); else return __exchange_and_add_single(__mem, __val); #else # 86 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/atomicity.h" 3 return __exchange_and_add_single(__mem, __val); #endif # 88 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/atomicity.h" 3 } static inline void __attribute__ ((__unused__)) __atomic_add_dispatch(_Atomic_word* __mem, int __val) { #ifdef __GTHREADS if (__gthread_active_p()) __atomic_add(__mem, __val); else __atomic_add_single(__mem, __val); #else # 100 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/atomicity.h" 3 __atomic_add_single(__mem, __val); #endif # 102 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/atomicity.h" 3 } _GLIBCXX_END_NAMESPACE_VERSION } // namespace // Even if the CPU doesn't need a memory barrier, we need to ensure // that the compiler doesn't reorder memory accesses across the // barriers. #ifndef _GLIBCXX_READ_MEM_BARRIER #define _GLIBCXX_READ_MEM_BARRIER __asm __volatile ("":::"memory") #endif # 113 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/atomicity.h" 3 #ifndef _GLIBCXX_WRITE_MEM_BARRIER #define _GLIBCXX_WRITE_MEM_BARRIER __asm __volatile ("":::"memory") #endif # 116 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/atomicity.h" 3 #endif # 118 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/atomicity.h" 3 # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/ios_base.h" 2 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/ios_base.h" 3 # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/ios_base.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/ios_base.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_classes.h" 1 3 // Locale support -*- C++ -*- // Copyright (C) 1997-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file bits/locale_classes.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{locale} */ // // ISO C++ 14882: 22.1 Locales // #ifndef _LOCALE_CLASSES_H #define _LOCALE_CLASSES_H 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 38 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_classes.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_classes.h" 3 # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_classes.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_classes.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/string" 1 3 // Components for manipulating sequences of characters -*- C++ -*- // Copyright (C) 1997-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file include/string * This is a Standard C++ Library header. */ // // ISO C++ 14882: 21 Strings library // #ifndef _GLIBCXX_STRING #define _GLIBCXX_STRING 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 37 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/string" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 38 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/string" 3 # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/string" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/string" 3 # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/string" 3 #if 0 /* expanded by -frewrite-includes */ #include // NB: In turn includes stl_algobase.h #endif /* expanded by -frewrite-includes */ # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/string" 3 # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/string" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/string" 3 # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/string" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/string" 3 # 43 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/string" 3 #if 0 /* expanded by -frewrite-includes */ #include // For operators >>, <<, and getline. #endif /* expanded by -frewrite-includes */ # 43 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/string" 3 # 44 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/string" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 44 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/string" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/ostream_insert.h" 1 3 // Helpers for ostream inserters -*- C++ -*- // Copyright (C) 2007-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file bits/ostream_insert.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{ostream} */ #ifndef _OSTREAM_INSERT_H #define _OSTREAM_INSERT_H 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 34 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/ostream_insert.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 35 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/ostream_insert.h" 3 # 36 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/ostream_insert.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 36 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/ostream_insert.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/cxxabi_forced.h" 1 3 // cxxabi.h subset for cancellation -*- C++ -*- // Copyright (C) 2007-2015 Free Software Foundation, Inc. // // This file is part of GCC. // // GCC is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 3, or (at your option) // any later version. // // GCC is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file bits/cxxabi_forced.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{cxxabi.h} */ #ifndef _CXXABI_FORCED_H #define _CXXABI_FORCED_H 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 35 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/cxxabi_forced.h" 3 #pragma GCC visibility push(default) #ifdef __cplusplus namespace __cxxabiv1 { /** * @brief Thrown as part of forced unwinding. * @ingroup exceptions * * A magic placeholder class that can be caught by reference to * recognize forced unwinding. */ class __forced_unwind { virtual ~__forced_unwind() throw(); // Prevent catch by value. virtual void __pure_dummy() = 0; }; } #endif // __cplusplus # 57 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/cxxabi_forced.h" 3 #pragma GCC visibility pop #endif // __CXXABI_FORCED_H # 61 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/cxxabi_forced.h" 3 # 37 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/ostream_insert.h" 2 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION template inline void __ostream_write(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s, streamsize __n) { typedef basic_ostream<_CharT, _Traits> __ostream_type; typedef typename __ostream_type::ios_base __ios_base; const streamsize __put = __out.rdbuf()->sputn(__s, __n); if (__put != __n) __out.setstate(__ios_base::badbit); } template inline void __ostream_fill(basic_ostream<_CharT, _Traits>& __out, streamsize __n) { typedef basic_ostream<_CharT, _Traits> __ostream_type; typedef typename __ostream_type::ios_base __ios_base; const _CharT __c = __out.fill(); for (; __n > 0; --__n) { const typename _Traits::int_type __put = __out.rdbuf()->sputc(__c); if (_Traits::eq_int_type(__put, _Traits::eof())) { __out.setstate(__ios_base::badbit); break; } } } template basic_ostream<_CharT, _Traits>& __ostream_insert(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s, streamsize __n) { typedef basic_ostream<_CharT, _Traits> __ostream_type; typedef typename __ostream_type::ios_base __ios_base; typename __ostream_type::sentry __cerb(__out); if (__cerb) { __try { const streamsize __w = __out.width(); if (__w > __n) { const bool __left = ((__out.flags() & __ios_base::adjustfield) == __ios_base::left); if (!__left) __ostream_fill(__out, __w - __n); if (__out.good()) __ostream_write(__out, __s, __n); if (__left && __out.good()) __ostream_fill(__out, __w - __n); } else __ostream_write(__out, __s, __n); __out.width(0); } __catch(__cxxabiv1::__forced_unwind&) { __out._M_setstate(__ios_base::badbit); __throw_exception_again; } __catch(...) { __out._M_setstate(__ios_base::badbit); } } return __out; } // Inhibit implicit instantiations for required instantiations, // which are defined via explicit instantiations elsewhere. #if _GLIBCXX_EXTERN_TEMPLATE extern template ostream& __ostream_insert(ostream&, const char*, streamsize); #ifdef _GLIBCXX_USE_WCHAR_T extern template wostream& __ostream_insert(wostream&, const wchar_t*, streamsize); #endif # 124 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/ostream_insert.h" 3 #endif # 125 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/ostream_insert.h" 3 _GLIBCXX_END_NAMESPACE_VERSION } // namespace std #endif /* _OSTREAM_INSERT_H */ # 130 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/ostream_insert.h" 3 # 45 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/string" 2 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 45 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/string" 3 # 46 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/string" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 46 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/string" 3 # 47 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/string" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 47 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/string" 3 # 48 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/string" 3 #if 0 /* expanded by -frewrite-includes */ #include // For less #endif /* expanded by -frewrite-includes */ # 48 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/string" 3 # 49 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/string" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 49 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/string" 3 # 50 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/string" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 50 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/string" 3 # 51 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/string" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 51 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/string" 3 # 52 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/string" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 52 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/string" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 1 3 // Components for manipulating sequences of characters -*- C++ -*- // Copyright (C) 1997-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file bits/basic_string.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{string} */ // // ISO C++ 14882: 21 Strings library // #ifndef _BASIC_STRING_H #define _BASIC_STRING_H 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 38 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 #if __cplusplus >= 201103L #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 43 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 # 44 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 #endif # 45 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION #if _GLIBCXX_USE_CXX11_ABI _GLIBCXX_BEGIN_NAMESPACE_CXX11 /** * @class basic_string basic_string.h * @brief Managing sequences of characters and character-like objects. * * @ingroup strings * @ingroup sequences * * @tparam _CharT Type of character * @tparam _Traits Traits for character type, defaults to * char_traits<_CharT>. * @tparam _Alloc Allocator type, defaults to allocator<_CharT>. * * Meets the requirements of a container, a * reversible container, and a * sequence. Of the * optional sequence requirements, only * @c push_back, @c at, and @c %array access are supported. */ template class basic_string { typedef typename __gnu_cxx::__alloc_traits<_Alloc>::template rebind<_CharT>::other _Char_alloc_type; typedef __gnu_cxx::__alloc_traits<_Char_alloc_type> _Alloc_traits; // Types: public: typedef _Traits traits_type; typedef typename _Traits::char_type value_type; typedef _Char_alloc_type allocator_type; typedef typename _Alloc_traits::size_type size_type; typedef typename _Alloc_traits::difference_type difference_type; typedef typename _Alloc_traits::reference reference; typedef typename _Alloc_traits::const_reference const_reference; typedef typename _Alloc_traits::pointer pointer; typedef typename _Alloc_traits::const_pointer const_pointer; typedef __gnu_cxx::__normal_iterator iterator; typedef __gnu_cxx::__normal_iterator const_iterator; typedef std::reverse_iterator const_reverse_iterator; typedef std::reverse_iterator reverse_iterator; /// Value returned by various member functions when they fail. static const size_type npos = static_cast(-1); private: // type used for positions in insert, erase etc. #if __cplusplus < 201103L typedef iterator __const_iterator; #else # 102 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 typedef const_iterator __const_iterator; #endif # 104 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 // Use empty-base optimization: http://www.cantrip.org/emptyopt.html struct _Alloc_hider : allocator_type // TODO check __is_final { _Alloc_hider(pointer __dat, const _Alloc& __a = _Alloc()) : allocator_type(__a), _M_p(__dat) { } pointer _M_p; // The actual data. }; _Alloc_hider _M_dataplus; size_type _M_string_length; enum { _S_local_capacity = 15 / sizeof(_CharT) }; union { _CharT _M_local_buf[_S_local_capacity + 1]; size_type _M_allocated_capacity; }; void _M_data(pointer __p) { _M_dataplus._M_p = __p; } void _M_length(size_type __length) { _M_string_length = __length; } pointer _M_data() const { return _M_dataplus._M_p; } pointer _M_local_data() { #if __cplusplus >= 201103L return std::pointer_traits::pointer_to(*_M_local_buf); #else # 143 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 return pointer(_M_local_buf); #endif # 145 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 } const_pointer _M_local_data() const { #if __cplusplus >= 201103L return std::pointer_traits::pointer_to(*_M_local_buf); #else # 153 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 return const_pointer(_M_local_buf); #endif # 155 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 } void _M_capacity(size_type __capacity) { _M_allocated_capacity = __capacity; } void _M_set_length(size_type __n) { _M_length(__n); traits_type::assign(_M_data()[__n], _CharT()); } bool _M_is_local() const { return _M_data() == _M_local_data(); } // Create & Destroy pointer _M_create(size_type&, size_type); void _M_dispose() { if (!_M_is_local()) _M_destroy(_M_allocated_capacity); } void _M_destroy(size_type __size) throw() { _Alloc_traits::deallocate(_M_get_allocator(), _M_data(), __size + 1); } // _M_construct_aux is used to implement the 21.3.1 para 15 which // requires special behaviour if _InIterator is an integral type template void _M_construct_aux(_InIterator __beg, _InIterator __end, std::__false_type) { typedef typename iterator_traits<_InIterator>::iterator_category _Tag; _M_construct(__beg, __end, _Tag()); } // _GLIBCXX_RESOLVE_LIB_DEFECTS // 438. Ambiguity in the "do the right thing" clause template void _M_construct_aux(_Integer __beg, _Integer __end, std::__true_type) { _M_construct_aux_2(static_cast(__beg), __end); } void _M_construct_aux_2(size_type __req, _CharT __c) { _M_construct(__req, __c); } template void _M_construct(_InIterator __beg, _InIterator __end) { typedef typename std::__is_integer<_InIterator>::__type _Integral; _M_construct_aux(__beg, __end, _Integral()); } // For Input Iterators, used in istreambuf_iterators, etc. template void _M_construct(_InIterator __beg, _InIterator __end, std::input_iterator_tag); // For forward_iterators up to random_access_iterators, used for // string::iterator, _CharT*, etc. template void _M_construct(_FwdIterator __beg, _FwdIterator __end, std::forward_iterator_tag); void _M_construct(size_type __req, _CharT __c); allocator_type& _M_get_allocator() { return _M_dataplus; } const allocator_type& _M_get_allocator() const { return _M_dataplus; } private: #ifdef _GLIBCXX_DISAMBIGUATE_REPLACE_INST // The explicit instantiations in misc-inst.cc require this due to // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64063 template::__value && !__are_same<_Tp, const _CharT*>::__value && !__are_same<_Tp, iterator>::__value && !__are_same<_Tp, const_iterator>::__value> struct __enable_if_not_native_iterator { typedef basic_string& __type; }; template struct __enable_if_not_native_iterator<_Tp, false> { }; #endif # 256 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 size_type _M_check(size_type __pos, const char* __s) const { if (__pos > this->size()) __throw_out_of_range_fmt(__N("%s: __pos (which is %zu) > " "this->size() (which is %zu)"), __s, __pos, this->size()); return __pos; } void _M_check_length(size_type __n1, size_type __n2, const char* __s) const { if (this->max_size() - (this->size() - __n1) < __n2) __throw_length_error(__N(__s)); } // NB: _M_limit doesn't check for a bad __pos value. size_type _M_limit(size_type __pos, size_type __off) const _GLIBCXX_NOEXCEPT { const bool __testoff = __off < this->size() - __pos; return __testoff ? __off : this->size() - __pos; } // True if _Rep and source do not overlap. bool _M_disjunct(const _CharT* __s) const _GLIBCXX_NOEXCEPT { return (less()(__s, _M_data()) || less()(_M_data() + this->size(), __s)); } // When __n = 1 way faster than the general multichar // traits_type::copy/move/assign. static void _S_copy(_CharT* __d, const _CharT* __s, size_type __n) { if (__n == 1) traits_type::assign(*__d, *__s); else traits_type::copy(__d, __s, __n); } static void _S_move(_CharT* __d, const _CharT* __s, size_type __n) { if (__n == 1) traits_type::assign(*__d, *__s); else traits_type::move(__d, __s, __n); } static void _S_assign(_CharT* __d, size_type __n, _CharT __c) { if (__n == 1) traits_type::assign(*__d, __c); else traits_type::assign(__d, __n, __c); } // _S_copy_chars is a separate template to permit specialization // to optimize for the common case of pointers as iterators. template static void _S_copy_chars(_CharT* __p, _Iterator __k1, _Iterator __k2) { for (; __k1 != __k2; ++__k1, ++__p) traits_type::assign(*__p, *__k1); // These types are off. } static void _S_copy_chars(_CharT* __p, iterator __k1, iterator __k2) _GLIBCXX_NOEXCEPT { _S_copy_chars(__p, __k1.base(), __k2.base()); } static void _S_copy_chars(_CharT* __p, const_iterator __k1, const_iterator __k2) _GLIBCXX_NOEXCEPT { _S_copy_chars(__p, __k1.base(), __k2.base()); } static void _S_copy_chars(_CharT* __p, _CharT* __k1, _CharT* __k2) _GLIBCXX_NOEXCEPT { _S_copy(__p, __k1, __k2 - __k1); } static void _S_copy_chars(_CharT* __p, const _CharT* __k1, const _CharT* __k2) _GLIBCXX_NOEXCEPT { _S_copy(__p, __k1, __k2 - __k1); } static int _S_compare(size_type __n1, size_type __n2) _GLIBCXX_NOEXCEPT { const difference_type __d = difference_type(__n1 - __n2); if (__d > __gnu_cxx::__numeric_traits::__max) return __gnu_cxx::__numeric_traits::__max; else if (__d < __gnu_cxx::__numeric_traits::__min) return __gnu_cxx::__numeric_traits::__min; else return int(__d); } void _M_assign(const basic_string& __rcs); void _M_mutate(size_type __pos, size_type __len1, const _CharT* __s, size_type __len2); void _M_erase(size_type __pos, size_type __n); public: // Construct/copy/destroy: // NB: We overload ctors in some cases instead of using default // arguments, per 17.4.4.4 para. 2 item 2. /** * @brief Default constructor creates an empty string. */ basic_string() #if __cplusplus >= 201103L noexcept(is_nothrow_default_constructible<_Alloc>::value) #endif # 383 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 : _M_dataplus(_M_local_data()) { _M_set_length(0); } /** * @brief Construct an empty string using allocator @a a. */ explicit basic_string(const _Alloc& __a) _GLIBCXX_NOEXCEPT : _M_dataplus(_M_local_data(), __a) { _M_set_length(0); } /** * @brief Construct string with copy of value of @a __str. * @param __str Source string. */ basic_string(const basic_string& __str) : _M_dataplus(_M_local_data(), _Alloc_traits::_S_select_on_copy(__str._M_get_allocator())) { _M_construct(__str._M_data(), __str._M_data() + __str.length()); } /** * @brief Construct string as copy of a substring. * @param __str Source string. * @param __pos Index of first character to copy from. * @param __n Number of characters to copy (default remainder). */ // _GLIBCXX_RESOLVE_LIB_DEFECTS // 2402. [this constructor] shouldn't use Allocator() basic_string(const basic_string& __str, size_type __pos, size_type __n = npos) : _M_dataplus(_M_local_data()) { const _CharT* __start = __str._M_data() + __str._M_check(__pos, "basic_string::basic_string"); _M_construct(__start, __start + __str._M_limit(__pos, __n)); } /** * @brief Construct string as copy of a substring. * @param __str Source string. * @param __pos Index of first character to copy from. * @param __n Number of characters to copy (default remainder). * @param __a Allocator to use. */ basic_string(const basic_string& __str, size_type __pos, size_type __n, const _Alloc& __a) : _M_dataplus(_M_local_data(), __a) { const _CharT* __start = __str._M_data() + __str._M_check(__pos, "string::string"); _M_construct(__start, __start + __str._M_limit(__pos, __n)); } /** * @brief Construct string initialized by a character %array. * @param __s Source character %array. * @param __n Number of characters to copy. * @param __a Allocator to use (default is default allocator). * * NB: @a __s must have at least @a __n characters, '\\0' * has no special meaning. */ basic_string(const _CharT* __s, size_type __n, const _Alloc& __a = _Alloc()) : _M_dataplus(_M_local_data(), __a) { _M_construct(__s, __s + __n); } /** * @brief Construct string as copy of a C string. * @param __s Source C string. * @param __a Allocator to use (default is default allocator). */ basic_string(const _CharT* __s, const _Alloc& __a = _Alloc()) : _M_dataplus(_M_local_data(), __a) { _M_construct(__s, __s ? __s + traits_type::length(__s) : __s+npos); } /** * @brief Construct string as multiple characters. * @param __n Number of characters. * @param __c Character to use. * @param __a Allocator to use (default is default allocator). */ basic_string(size_type __n, _CharT __c, const _Alloc& __a = _Alloc()) : _M_dataplus(_M_local_data(), __a) { _M_construct(__n, __c); } #if __cplusplus >= 201103L /** * @brief Move construct string. * @param __str Source string. * * The newly-created string contains the exact contents of @a __str. * @a __str is a valid, but unspecified string. **/ basic_string(basic_string&& __str) noexcept : _M_dataplus(_M_local_data(), std::move(__str._M_get_allocator())) { if (__str._M_is_local()) { traits_type::copy(_M_local_buf, __str._M_local_buf, _S_local_capacity + 1); } else { _M_data(__str._M_data()); _M_capacity(__str._M_allocated_capacity); } // Must use _M_length() here not _M_set_length() because // basic_stringbuf relies on writing into unallocated capacity so // we mess up the contents if we put a '\0' in the string. _M_length(__str.length()); __str._M_data(__str._M_local_data()); __str._M_set_length(0); } /** * @brief Construct string from an initializer %list. * @param __l std::initializer_list of characters. * @param __a Allocator to use (default is default allocator). */ basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc()) : _M_dataplus(_M_local_data(), __a) { _M_construct(__l.begin(), __l.end()); } basic_string(const basic_string& __str, const _Alloc& __a) : _M_dataplus(_M_local_data(), __a) { _M_construct(__str.begin(), __str.end()); } basic_string(basic_string&& __str, const _Alloc& __a) noexcept(_Alloc_traits::_S_always_equal()) : _M_dataplus(_M_local_data(), __a) { if (__str._M_is_local()) { traits_type::copy(_M_local_buf, __str._M_local_buf, _S_local_capacity + 1); _M_length(__str.length()); __str._M_set_length(0); } else if (_Alloc_traits::_S_always_equal() || __str.get_allocator() == __a) { _M_data(__str._M_data()); _M_length(__str.length()); _M_capacity(__str._M_allocated_capacity); __str._M_data(__str._M_local_buf); __str._M_set_length(0); } else _M_construct(__str.begin(), __str.end()); } #endif // C++11 # 537 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 /** * @brief Construct string as copy of a range. * @param __beg Start of range. * @param __end End of range. * @param __a Allocator to use (default is default allocator). */ #if __cplusplus >= 201103L template> #else # 548 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 template #endif # 550 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 basic_string(_InputIterator __beg, _InputIterator __end, const _Alloc& __a = _Alloc()) : _M_dataplus(_M_local_data(), __a) { _M_construct(__beg, __end); } /** * @brief Destroy the string instance. */ ~basic_string() { _M_dispose(); } /** * @brief Assign the value of @a str to this string. * @param __str Source string. */ basic_string& operator=(const basic_string& __str) { #if __cplusplus >= 201103L if (_Alloc_traits::_S_propagate_on_copy_assign()) { if (!_Alloc_traits::_S_always_equal() && !_M_is_local() && _M_get_allocator() != __str._M_get_allocator()) { // replacement allocator cannot free existing storage _M_destroy(_M_allocated_capacity); _M_data(_M_local_data()); _M_set_length(0); } std::__alloc_on_copy(_M_get_allocator(), __str._M_get_allocator()); } #endif # 582 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 return this->assign(__str); } /** * @brief Copy contents of @a s into this string. * @param __s Source null-terminated string. */ basic_string& operator=(const _CharT* __s) { return this->assign(__s); } /** * @brief Set value to string of length 1. * @param __c Source character. * * Assigning to a character makes this string length 1 and * (*this)[0] == @a c. */ basic_string& operator=(_CharT __c) { this->assign(1, __c); return *this; } #if __cplusplus >= 201103L /** * @brief Move assign the value of @a str to this string. * @param __str Source string. * * The contents of @a str are moved into this string (without copying). * @a str is a valid, but unspecified string. **/ // PR 58265, this should be noexcept. // _GLIBCXX_RESOLVE_LIB_DEFECTS // 2063. Contradictory requirements for string move assignment basic_string& operator=(basic_string&& __str) noexcept(_Alloc_traits::_S_nothrow_move()) { if (!_M_is_local() && _Alloc_traits::_S_propagate_on_move_assign() && !_Alloc_traits::_S_always_equal() && _M_get_allocator() != __str._M_get_allocator()) { // Destroy existing storage before replacing allocator. _M_destroy(_M_allocated_capacity); _M_data(_M_local_data()); _M_set_length(0); } // Replace allocator if POCMA is true. std::__alloc_on_move(_M_get_allocator(), __str._M_get_allocator()); if (!__str._M_is_local() && (_Alloc_traits::_S_propagate_on_move_assign() || _Alloc_traits::_S_always_equal())) { pointer __data = nullptr; size_type __capacity; if (!_M_is_local()) { if (_Alloc_traits::_S_always_equal()) { __data = _M_data(); __capacity = _M_allocated_capacity; } else _M_destroy(_M_allocated_capacity); } _M_data(__str._M_data()); _M_length(__str.length()); _M_capacity(__str._M_allocated_capacity); if (__data) { __str._M_data(__data); __str._M_capacity(__capacity); } else __str._M_data(__str._M_local_buf); } else assign(__str); __str.clear(); return *this; } /** * @brief Set value to string constructed from initializer %list. * @param __l std::initializer_list. */ basic_string& operator=(initializer_list<_CharT> __l) { this->assign(__l.begin(), __l.size()); return *this; } #endif // C++11 # 679 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 // Iterators: /** * Returns a read/write iterator that points to the first character in * the %string. */ iterator begin() _GLIBCXX_NOEXCEPT { return iterator(_M_data()); } /** * Returns a read-only (constant) iterator that points to the first * character in the %string. */ const_iterator begin() const _GLIBCXX_NOEXCEPT { return const_iterator(_M_data()); } /** * Returns a read/write iterator that points one past the last * character in the %string. */ iterator end() _GLIBCXX_NOEXCEPT { return iterator(_M_data() + this->size()); } /** * Returns a read-only (constant) iterator that points one past the * last character in the %string. */ const_iterator end() const _GLIBCXX_NOEXCEPT { return const_iterator(_M_data() + this->size()); } /** * Returns a read/write reverse iterator that points to the last * character in the %string. Iteration is done in reverse element * order. */ reverse_iterator rbegin() _GLIBCXX_NOEXCEPT { return reverse_iterator(this->end()); } /** * Returns a read-only (constant) reverse iterator that points * to the last character in the %string. Iteration is done in * reverse element order. */ const_reverse_iterator rbegin() const _GLIBCXX_NOEXCEPT { return const_reverse_iterator(this->end()); } /** * Returns a read/write reverse iterator that points to one before the * first character in the %string. Iteration is done in reverse * element order. */ reverse_iterator rend() _GLIBCXX_NOEXCEPT { return reverse_iterator(this->begin()); } /** * Returns a read-only (constant) reverse iterator that points * to one before the first character in the %string. Iteration * is done in reverse element order. */ const_reverse_iterator rend() const _GLIBCXX_NOEXCEPT { return const_reverse_iterator(this->begin()); } #if __cplusplus >= 201103L /** * Returns a read-only (constant) iterator that points to the first * character in the %string. */ const_iterator cbegin() const noexcept { return const_iterator(this->_M_data()); } /** * Returns a read-only (constant) iterator that points one past the * last character in the %string. */ const_iterator cend() const noexcept { return const_iterator(this->_M_data() + this->size()); } /** * Returns a read-only (constant) reverse iterator that points * to the last character in the %string. Iteration is done in * reverse element order. */ const_reverse_iterator crbegin() const noexcept { return const_reverse_iterator(this->end()); } /** * Returns a read-only (constant) reverse iterator that points * to one before the first character in the %string. Iteration * is done in reverse element order. */ const_reverse_iterator crend() const noexcept { return const_reverse_iterator(this->begin()); } #endif # 784 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 public: // Capacity: /// Returns the number of characters in the string, not including any /// null-termination. size_type size() const _GLIBCXX_NOEXCEPT { return _M_string_length; } /// Returns the number of characters in the string, not including any /// null-termination. size_type length() const _GLIBCXX_NOEXCEPT { return _M_string_length; } /// Returns the size() of the largest possible %string. size_type max_size() const _GLIBCXX_NOEXCEPT { return (_Alloc_traits::max_size(_M_get_allocator()) - 1) / 2; } /** * @brief Resizes the %string to the specified number of characters. * @param __n Number of characters the %string should contain. * @param __c Character to fill any new elements. * * This function will %resize the %string to the specified * number of characters. If the number is smaller than the * %string's current size the %string is truncated, otherwise * the %string is extended and new elements are %set to @a __c. */ void resize(size_type __n, _CharT __c); /** * @brief Resizes the %string to the specified number of characters. * @param __n Number of characters the %string should contain. * * This function will resize the %string to the specified length. If * the new size is smaller than the %string's current size the %string * is truncated, otherwise the %string is extended and new characters * are default-constructed. For basic types such as char, this means * setting them to 0. */ void resize(size_type __n) { this->resize(__n, _CharT()); } #if __cplusplus >= 201103L /// A non-binding request to reduce capacity() to size(). void shrink_to_fit() noexcept { #if __cpp_exceptions if (capacity() > size()) { try { reserve(0); } catch(...) { } } #endif # 845 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 } #endif # 847 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 /** * Returns the total number of characters that the %string can hold * before needing to allocate more memory. */ size_type capacity() const _GLIBCXX_NOEXCEPT { return _M_is_local() ? size_type(_S_local_capacity) : _M_allocated_capacity; } /** * @brief Attempt to preallocate enough memory for specified number of * characters. * @param __res_arg Number of characters required. * @throw std::length_error If @a __res_arg exceeds @c max_size(). * * This function attempts to reserve enough memory for the * %string to hold the specified number of characters. If the * number requested is more than max_size(), length_error is * thrown. * * The advantage of this function is that if optimal code is a * necessity and the user can determine the string length that will be * required, the user can reserve the memory in %advance, and thus * prevent a possible reallocation of memory and copying of %string * data. */ void reserve(size_type __res_arg = 0); /** * Erases the string, making it empty. */ void clear() _GLIBCXX_NOEXCEPT { _M_set_length(0); } /** * Returns true if the %string is empty. Equivalent to * *this == "". */ bool empty() const _GLIBCXX_NOEXCEPT { return this->size() == 0; } // Element access: /** * @brief Subscript access to the data contained in the %string. * @param __pos The index of the character to access. * @return Read-only (constant) reference to the character. * * This operator allows for easy, array-style, data access. * Note that data access with this operator is unchecked and * out_of_range lookups are not defined. (For checked lookups * see at().) */ const_reference operator[] (size_type __pos) const _GLIBCXX_NOEXCEPT { _GLIBCXX_DEBUG_ASSERT(__pos <= size()); return _M_data()[__pos]; } /** * @brief Subscript access to the data contained in the %string. * @param __pos The index of the character to access. * @return Read/write reference to the character. * * This operator allows for easy, array-style, data access. * Note that data access with this operator is unchecked and * out_of_range lookups are not defined. (For checked lookups * see at().) */ reference operator[](size_type __pos) { // Allow pos == size() both in C++98 mode, as v3 extension, // and in C++11 mode. _GLIBCXX_DEBUG_ASSERT(__pos <= size()); // In pedantic mode be strict in C++98 mode. _GLIBCXX_DEBUG_PEDASSERT(__cplusplus >= 201103L || __pos < size()); return _M_data()[__pos]; } /** * @brief Provides access to the data contained in the %string. * @param __n The index of the character to access. * @return Read-only (const) reference to the character. * @throw std::out_of_range If @a n is an invalid index. * * This function provides for safer data access. The parameter is * first checked that it is in the range of the string. The function * throws out_of_range if the check fails. */ const_reference at(size_type __n) const { if (__n >= this->size()) __throw_out_of_range_fmt(__N("basic_string::at: __n " "(which is %zu) >= this->size() " "(which is %zu)"), __n, this->size()); return _M_data()[__n]; } /** * @brief Provides access to the data contained in the %string. * @param __n The index of the character to access. * @return Read/write reference to the character. * @throw std::out_of_range If @a n is an invalid index. * * This function provides for safer data access. The parameter is * first checked that it is in the range of the string. The function * throws out_of_range if the check fails. */ reference at(size_type __n) { if (__n >= size()) __throw_out_of_range_fmt(__N("basic_string::at: __n " "(which is %zu) >= this->size() " "(which is %zu)"), __n, this->size()); return _M_data()[__n]; } #if __cplusplus >= 201103L /** * Returns a read/write reference to the data at the first * element of the %string. */ reference front() noexcept { return operator[](0); } /** * Returns a read-only (constant) reference to the data at the first * element of the %string. */ const_reference front() const noexcept { return operator[](0); } /** * Returns a read/write reference to the data at the last * element of the %string. */ reference back() noexcept { return operator[](this->size() - 1); } /** * Returns a read-only (constant) reference to the data at the * last element of the %string. */ const_reference back() const noexcept { return operator[](this->size() - 1); } #endif # 1008 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 // Modifiers: /** * @brief Append a string to this string. * @param __str The string to append. * @return Reference to this string. */ basic_string& operator+=(const basic_string& __str) { return this->append(__str); } /** * @brief Append a C string. * @param __s The C string to append. * @return Reference to this string. */ basic_string& operator+=(const _CharT* __s) { return this->append(__s); } /** * @brief Append a character. * @param __c The character to append. * @return Reference to this string. */ basic_string& operator+=(_CharT __c) { this->push_back(__c); return *this; } #if __cplusplus >= 201103L /** * @brief Append an initializer_list of characters. * @param __l The initializer_list of characters to be appended. * @return Reference to this string. */ basic_string& operator+=(initializer_list<_CharT> __l) { return this->append(__l.begin(), __l.size()); } #endif // C++11 # 1050 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 /** * @brief Append a string to this string. * @param __str The string to append. * @return Reference to this string. */ basic_string& append(const basic_string& __str) { return _M_append(__str._M_data(), __str.size()); } /** * @brief Append a substring. * @param __str The string to append. * @param __pos Index of the first character of str to append. * @param __n The number of characters to append. * @return Reference to this string. * @throw std::out_of_range if @a __pos is not a valid index. * * This function appends @a __n characters from @a __str * starting at @a __pos to this string. If @a __n is is larger * than the number of available characters in @a __str, the * remainder of @a __str is appended. */ basic_string& append(const basic_string& __str, size_type __pos, size_type __n) { return _M_append(__str._M_data() + __str._M_check(__pos, "basic_string::append"), __str._M_limit(__pos, __n)); } /** * @brief Append a C substring. * @param __s The C string to append. * @param __n The number of characters to append. * @return Reference to this string. */ basic_string& append(const _CharT* __s, size_type __n) { __glibcxx_requires_string_len(__s, __n); _M_check_length(size_type(0), __n, "basic_string::append"); return _M_append(__s, __n); } /** * @brief Append a C string. * @param __s The C string to append. * @return Reference to this string. */ basic_string& append(const _CharT* __s) { __glibcxx_requires_string(__s); const size_type __n = traits_type::length(__s); _M_check_length(size_type(0), __n, "basic_string::append"); return _M_append(__s, __n); } /** * @brief Append multiple characters. * @param __n The number of characters to append. * @param __c The character to use. * @return Reference to this string. * * Appends __n copies of __c to this string. */ basic_string& append(size_type __n, _CharT __c) { return _M_replace_aux(this->size(), size_type(0), __n, __c); } #if __cplusplus >= 201103L /** * @brief Append an initializer_list of characters. * @param __l The initializer_list of characters to append. * @return Reference to this string. */ basic_string& append(initializer_list<_CharT> __l) { return this->append(__l.begin(), __l.size()); } #endif // C++11 # 1129 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 /** * @brief Append a range of characters. * @param __first Iterator referencing the first character to append. * @param __last Iterator marking the end of the range. * @return Reference to this string. * * Appends characters in the range [__first,__last) to this string. */ #if __cplusplus >= 201103L template> #else # 1142 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 template #endif # 1144 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 basic_string& append(_InputIterator __first, _InputIterator __last) { return this->replace(end(), end(), __first, __last); } /** * @brief Append a single character. * @param __c Character to append. */ void push_back(_CharT __c) { const size_type __size = this->size(); if (__size + 1 > this->capacity()) this->_M_mutate(__size, size_type(0), 0, size_type(1)); traits_type::assign(this->_M_data()[__size], __c); this->_M_set_length(__size + 1); } /** * @brief Set value to contents of another string. * @param __str Source string to use. * @return Reference to this string. */ basic_string& assign(const basic_string& __str) { this->_M_assign(__str); return *this; } #if __cplusplus >= 201103L /** * @brief Set value to contents of another string. * @param __str Source string to use. * @return Reference to this string. * * This function sets this string to the exact contents of @a __str. * @a __str is a valid, but unspecified string. */ basic_string& assign(basic_string&& __str) noexcept(_Alloc_traits::_S_nothrow_move()) { // _GLIBCXX_RESOLVE_LIB_DEFECTS // 2063. Contradictory requirements for string move assignment return *this = std::move(__str); } #endif // C++11 # 1192 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 /** * @brief Set value to a substring of a string. * @param __str The string to use. * @param __pos Index of the first character of str. * @param __n Number of characters to use. * @return Reference to this string. * @throw std::out_of_range if @a pos is not a valid index. * * This function sets this string to the substring of @a __str * consisting of @a __n characters at @a __pos. If @a __n is * is larger than the number of available characters in @a * __str, the remainder of @a __str is used. */ basic_string& assign(const basic_string& __str, size_type __pos, size_type __n) { return _M_replace(size_type(0), this->size(), __str._M_data() + __str._M_check(__pos, "basic_string::assign"), __str._M_limit(__pos, __n)); } /** * @brief Set value to a C substring. * @param __s The C string to use. * @param __n Number of characters to use. * @return Reference to this string. * * This function sets the value of this string to the first @a __n * characters of @a __s. If @a __n is is larger than the number of * available characters in @a __s, the remainder of @a __s is used. */ basic_string& assign(const _CharT* __s, size_type __n) { __glibcxx_requires_string_len(__s, __n); return _M_replace(size_type(0), this->size(), __s, __n); } /** * @brief Set value to contents of a C string. * @param __s The C string to use. * @return Reference to this string. * * This function sets the value of this string to the value of @a __s. * The data is copied, so there is no dependence on @a __s once the * function returns. */ basic_string& assign(const _CharT* __s) { __glibcxx_requires_string(__s); return _M_replace(size_type(0), this->size(), __s, traits_type::length(__s)); } /** * @brief Set value to multiple characters. * @param __n Length of the resulting string. * @param __c The character to use. * @return Reference to this string. * * This function sets the value of this string to @a __n copies of * character @a __c. */ basic_string& assign(size_type __n, _CharT __c) { return _M_replace_aux(size_type(0), this->size(), __n, __c); } /** * @brief Set value to a range of characters. * @param __first Iterator referencing the first character to append. * @param __last Iterator marking the end of the range. * @return Reference to this string. * * Sets value of string to characters in the range [__first,__last). */ #if __cplusplus >= 201103L template> #else # 1271 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 template #endif # 1273 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 basic_string& assign(_InputIterator __first, _InputIterator __last) { return this->replace(begin(), end(), __first, __last); } #if __cplusplus >= 201103L /** * @brief Set value to an initializer_list of characters. * @param __l The initializer_list of characters to assign. * @return Reference to this string. */ basic_string& assign(initializer_list<_CharT> __l) { return this->assign(__l.begin(), __l.size()); } #endif // C++11 # 1287 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 #if __cplusplus >= 201103L /** * @brief Insert multiple characters. * @param __p Const_iterator referencing location in string to * insert at. * @param __n Number of characters to insert * @param __c The character to insert. * @return Iterator referencing the first inserted char. * @throw std::length_error If new length exceeds @c max_size(). * * Inserts @a __n copies of character @a __c starting at the * position referenced by iterator @a __p. If adding * characters causes the length to exceed max_size(), * length_error is thrown. The value of the string doesn't * change if an error is thrown. */ iterator insert(const_iterator __p, size_type __n, _CharT __c) { _GLIBCXX_DEBUG_PEDASSERT(__p >= begin() && __p <= end()); const size_type __pos = __p - begin(); this->replace(__p, __p, __n, __c); return iterator(this->_M_data() + __pos); } #else # 1313 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 /** * @brief Insert multiple characters. * @param __p Iterator referencing location in string to insert at. * @param __n Number of characters to insert * @param __c The character to insert. * @throw std::length_error If new length exceeds @c max_size(). * * Inserts @a __n copies of character @a __c starting at the * position referenced by iterator @a __p. If adding * characters causes the length to exceed max_size(), * length_error is thrown. The value of the string doesn't * change if an error is thrown. */ void insert(iterator __p, size_type __n, _CharT __c) { this->replace(__p, __p, __n, __c); } #endif # 1330 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 #if __cplusplus >= 201103L /** * @brief Insert a range of characters. * @param __p Const_iterator referencing location in string to * insert at. * @param __beg Start of range. * @param __end End of range. * @return Iterator referencing the first inserted char. * @throw std::length_error If new length exceeds @c max_size(). * * Inserts characters in range [beg,end). If adding characters * causes the length to exceed max_size(), length_error is * thrown. The value of the string doesn't change if an error * is thrown. */ template> iterator insert(const_iterator __p, _InputIterator __beg, _InputIterator __end) { _GLIBCXX_DEBUG_PEDASSERT(__p >= begin() && __p <= end()); const size_type __pos = __p - begin(); this->replace(__p, __p, __beg, __end); return iterator(this->_M_data() + __pos); } #else # 1357 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 /** * @brief Insert a range of characters. * @param __p Iterator referencing location in string to insert at. * @param __beg Start of range. * @param __end End of range. * @throw std::length_error If new length exceeds @c max_size(). * * Inserts characters in range [__beg,__end). If adding * characters causes the length to exceed max_size(), * length_error is thrown. The value of the string doesn't * change if an error is thrown. */ template void insert(iterator __p, _InputIterator __beg, _InputIterator __end) { this->replace(__p, __p, __beg, __end); } #endif # 1374 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 #if __cplusplus >= 201103L /** * @brief Insert an initializer_list of characters. * @param __p Iterator referencing location in string to insert at. * @param __l The initializer_list of characters to insert. * @throw std::length_error If new length exceeds @c max_size(). */ void insert(iterator __p, initializer_list<_CharT> __l) { _GLIBCXX_DEBUG_PEDASSERT(__p >= begin() && __p <= end()); this->insert(__p - begin(), __l.begin(), __l.size()); } #endif // C++11 # 1389 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 /** * @brief Insert value of a string. * @param __pos1 Iterator referencing location in string to insert at. * @param __str The string to insert. * @return Reference to this string. * @throw std::length_error If new length exceeds @c max_size(). * * Inserts value of @a __str starting at @a __pos1. If adding * characters causes the length to exceed max_size(), * length_error is thrown. The value of the string doesn't * change if an error is thrown. */ basic_string& insert(size_type __pos1, const basic_string& __str) { return this->replace(__pos1, size_type(0), __str._M_data(), __str.size()); } /** * @brief Insert a substring. * @param __pos1 Iterator referencing location in string to insert at. * @param __str The string to insert. * @param __pos2 Start of characters in str to insert. * @param __n Number of characters to insert. * @return Reference to this string. * @throw std::length_error If new length exceeds @c max_size(). * @throw std::out_of_range If @a pos1 > size() or * @a __pos2 > @a str.size(). * * Starting at @a pos1, insert @a __n character of @a __str * beginning with @a __pos2. If adding characters causes the * length to exceed max_size(), length_error is thrown. If @a * __pos1 is beyond the end of this string or @a __pos2 is * beyond the end of @a __str, out_of_range is thrown. The * value of the string doesn't change if an error is thrown. */ basic_string& insert(size_type __pos1, const basic_string& __str, size_type __pos2, size_type __n) { return this->replace(__pos1, size_type(0), __str._M_data() + __str._M_check(__pos2, "basic_string::insert"), __str._M_limit(__pos2, __n)); } /** * @brief Insert a C substring. * @param __pos Iterator referencing location in string to insert at. * @param __s The C string to insert. * @param __n The number of characters to insert. * @return Reference to this string. * @throw std::length_error If new length exceeds @c max_size(). * @throw std::out_of_range If @a __pos is beyond the end of this * string. * * Inserts the first @a __n characters of @a __s starting at @a * __pos. If adding characters causes the length to exceed * max_size(), length_error is thrown. If @a __pos is beyond * end(), out_of_range is thrown. The value of the string * doesn't change if an error is thrown. */ basic_string& insert(size_type __pos, const _CharT* __s, size_type __n) { return this->replace(__pos, size_type(0), __s, __n); } /** * @brief Insert a C string. * @param __pos Iterator referencing location in string to insert at. * @param __s The C string to insert. * @return Reference to this string. * @throw std::length_error If new length exceeds @c max_size(). * @throw std::out_of_range If @a pos is beyond the end of this * string. * * Inserts the first @a n characters of @a __s starting at @a __pos. If * adding characters causes the length to exceed max_size(), * length_error is thrown. If @a __pos is beyond end(), out_of_range is * thrown. The value of the string doesn't change if an error is * thrown. */ basic_string& insert(size_type __pos, const _CharT* __s) { __glibcxx_requires_string(__s); return this->replace(__pos, size_type(0), __s, traits_type::length(__s)); } /** * @brief Insert multiple characters. * @param __pos Index in string to insert at. * @param __n Number of characters to insert * @param __c The character to insert. * @return Reference to this string. * @throw std::length_error If new length exceeds @c max_size(). * @throw std::out_of_range If @a __pos is beyond the end of this * string. * * Inserts @a __n copies of character @a __c starting at index * @a __pos. If adding characters causes the length to exceed * max_size(), length_error is thrown. If @a __pos > length(), * out_of_range is thrown. The value of the string doesn't * change if an error is thrown. */ basic_string& insert(size_type __pos, size_type __n, _CharT __c) { return _M_replace_aux(_M_check(__pos, "basic_string::insert"), size_type(0), __n, __c); } /** * @brief Insert one character. * @param __p Iterator referencing position in string to insert at. * @param __c The character to insert. * @return Iterator referencing newly inserted char. * @throw std::length_error If new length exceeds @c max_size(). * * Inserts character @a __c at position referenced by @a __p. * If adding character causes the length to exceed max_size(), * length_error is thrown. If @a __p is beyond end of string, * out_of_range is thrown. The value of the string doesn't * change if an error is thrown. */ iterator insert(__const_iterator __p, _CharT __c) { _GLIBCXX_DEBUG_PEDASSERT(__p >= begin() && __p <= end()); const size_type __pos = __p - begin(); _M_replace_aux(__pos, size_type(0), size_type(1), __c); return iterator(_M_data() + __pos); } /** * @brief Remove characters. * @param __pos Index of first character to remove (default 0). * @param __n Number of characters to remove (default remainder). * @return Reference to this string. * @throw std::out_of_range If @a pos is beyond the end of this * string. * * Removes @a __n characters from this string starting at @a * __pos. The length of the string is reduced by @a __n. If * there are < @a __n characters to remove, the remainder of * the string is truncated. If @a __p is beyond end of string, * out_of_range is thrown. The value of the string doesn't * change if an error is thrown. */ basic_string& erase(size_type __pos = 0, size_type __n = npos) { this->_M_erase(_M_check(__pos, "basic_string::erase"), _M_limit(__pos, __n)); return *this; } /** * @brief Remove one character. * @param __position Iterator referencing the character to remove. * @return iterator referencing same location after removal. * * Removes the character at @a __position from this string. The value * of the string doesn't change if an error is thrown. */ iterator erase(__const_iterator __position) { _GLIBCXX_DEBUG_PEDASSERT(__position >= begin() && __position < end()); const size_type __pos = __position - begin(); this->_M_erase(__pos, size_type(1)); return iterator(_M_data() + __pos); } /** * @brief Remove a range of characters. * @param __first Iterator referencing the first character to remove. * @param __last Iterator referencing the end of the range. * @return Iterator referencing location of first after removal. * * Removes the characters in the range [first,last) from this string. * The value of the string doesn't change if an error is thrown. */ iterator erase(__const_iterator __first, __const_iterator __last) { _GLIBCXX_DEBUG_PEDASSERT(__first >= begin() && __first <= __last && __last <= end()); const size_type __pos = __first - begin(); this->_M_erase(__pos, __last - __first); return iterator(this->_M_data() + __pos); } #if __cplusplus >= 201103L /** * @brief Remove the last character. * * The string must be non-empty. */ void pop_back() noexcept { _M_erase(size()-1, 1); } #endif // C++11 # 1588 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 /** * @brief Replace characters with value from another string. * @param __pos Index of first character to replace. * @param __n Number of characters to be replaced. * @param __str String to insert. * @return Reference to this string. * @throw std::out_of_range If @a pos is beyond the end of this * string. * @throw std::length_error If new length exceeds @c max_size(). * * Removes the characters in the range [__pos,__pos+__n) from * this string. In place, the value of @a __str is inserted. * If @a __pos is beyond end of string, out_of_range is thrown. * If the length of the result exceeds max_size(), length_error * is thrown. The value of the string doesn't change if an * error is thrown. */ basic_string& replace(size_type __pos, size_type __n, const basic_string& __str) { return this->replace(__pos, __n, __str._M_data(), __str.size()); } /** * @brief Replace characters with value from another string. * @param __pos1 Index of first character to replace. * @param __n1 Number of characters to be replaced. * @param __str String to insert. * @param __pos2 Index of first character of str to use. * @param __n2 Number of characters from str to use. * @return Reference to this string. * @throw std::out_of_range If @a __pos1 > size() or @a __pos2 > * __str.size(). * @throw std::length_error If new length exceeds @c max_size(). * * Removes the characters in the range [__pos1,__pos1 + n) from this * string. In place, the value of @a __str is inserted. If @a __pos is * beyond end of string, out_of_range is thrown. If the length of the * result exceeds max_size(), length_error is thrown. The value of the * string doesn't change if an error is thrown. */ basic_string& replace(size_type __pos1, size_type __n1, const basic_string& __str, size_type __pos2, size_type __n2) { return this->replace(__pos1, __n1, __str._M_data() + __str._M_check(__pos2, "basic_string::replace"), __str._M_limit(__pos2, __n2)); } /** * @brief Replace characters with value of a C substring. * @param __pos Index of first character to replace. * @param __n1 Number of characters to be replaced. * @param __s C string to insert. * @param __n2 Number of characters from @a s to use. * @return Reference to this string. * @throw std::out_of_range If @a pos1 > size(). * @throw std::length_error If new length exceeds @c max_size(). * * Removes the characters in the range [__pos,__pos + __n1) * from this string. In place, the first @a __n2 characters of * @a __s are inserted, or all of @a __s if @a __n2 is too large. If * @a __pos is beyond end of string, out_of_range is thrown. If * the length of result exceeds max_size(), length_error is * thrown. The value of the string doesn't change if an error * is thrown. */ basic_string& replace(size_type __pos, size_type __n1, const _CharT* __s, size_type __n2) { __glibcxx_requires_string_len(__s, __n2); return _M_replace(_M_check(__pos, "basic_string::replace"), _M_limit(__pos, __n1), __s, __n2); } /** * @brief Replace characters with value of a C string. * @param __pos Index of first character to replace. * @param __n1 Number of characters to be replaced. * @param __s C string to insert. * @return Reference to this string. * @throw std::out_of_range If @a pos > size(). * @throw std::length_error If new length exceeds @c max_size(). * * Removes the characters in the range [__pos,__pos + __n1) * from this string. In place, the characters of @a __s are * inserted. If @a __pos is beyond end of string, out_of_range * is thrown. If the length of result exceeds max_size(), * length_error is thrown. The value of the string doesn't * change if an error is thrown. */ basic_string& replace(size_type __pos, size_type __n1, const _CharT* __s) { __glibcxx_requires_string(__s); return this->replace(__pos, __n1, __s, traits_type::length(__s)); } /** * @brief Replace characters with multiple characters. * @param __pos Index of first character to replace. * @param __n1 Number of characters to be replaced. * @param __n2 Number of characters to insert. * @param __c Character to insert. * @return Reference to this string. * @throw std::out_of_range If @a __pos > size(). * @throw std::length_error If new length exceeds @c max_size(). * * Removes the characters in the range [pos,pos + n1) from this * string. In place, @a __n2 copies of @a __c are inserted. * If @a __pos is beyond end of string, out_of_range is thrown. * If the length of result exceeds max_size(), length_error is * thrown. The value of the string doesn't change if an error * is thrown. */ basic_string& replace(size_type __pos, size_type __n1, size_type __n2, _CharT __c) { return _M_replace_aux(_M_check(__pos, "basic_string::replace"), _M_limit(__pos, __n1), __n2, __c); } /** * @brief Replace range of characters with string. * @param __i1 Iterator referencing start of range to replace. * @param __i2 Iterator referencing end of range to replace. * @param __str String value to insert. * @return Reference to this string. * @throw std::length_error If new length exceeds @c max_size(). * * Removes the characters in the range [__i1,__i2). In place, * the value of @a __str is inserted. If the length of result * exceeds max_size(), length_error is thrown. The value of * the string doesn't change if an error is thrown. */ basic_string& replace(__const_iterator __i1, __const_iterator __i2, const basic_string& __str) { return this->replace(__i1, __i2, __str._M_data(), __str.size()); } /** * @brief Replace range of characters with C substring. * @param __i1 Iterator referencing start of range to replace. * @param __i2 Iterator referencing end of range to replace. * @param __s C string value to insert. * @param __n Number of characters from s to insert. * @return Reference to this string. * @throw std::length_error If new length exceeds @c max_size(). * * Removes the characters in the range [__i1,__i2). In place, * the first @a __n characters of @a __s are inserted. If the * length of result exceeds max_size(), length_error is thrown. * The value of the string doesn't change if an error is * thrown. */ basic_string& replace(__const_iterator __i1, __const_iterator __i2, const _CharT* __s, size_type __n) { _GLIBCXX_DEBUG_PEDASSERT(begin() <= __i1 && __i1 <= __i2 && __i2 <= end()); return this->replace(__i1 - begin(), __i2 - __i1, __s, __n); } /** * @brief Replace range of characters with C string. * @param __i1 Iterator referencing start of range to replace. * @param __i2 Iterator referencing end of range to replace. * @param __s C string value to insert. * @return Reference to this string. * @throw std::length_error If new length exceeds @c max_size(). * * Removes the characters in the range [__i1,__i2). In place, * the characters of @a __s are inserted. If the length of * result exceeds max_size(), length_error is thrown. The * value of the string doesn't change if an error is thrown. */ basic_string& replace(__const_iterator __i1, __const_iterator __i2, const _CharT* __s) { __glibcxx_requires_string(__s); return this->replace(__i1, __i2, __s, traits_type::length(__s)); } /** * @brief Replace range of characters with multiple characters * @param __i1 Iterator referencing start of range to replace. * @param __i2 Iterator referencing end of range to replace. * @param __n Number of characters to insert. * @param __c Character to insert. * @return Reference to this string. * @throw std::length_error If new length exceeds @c max_size(). * * Removes the characters in the range [__i1,__i2). In place, * @a __n copies of @a __c are inserted. If the length of * result exceeds max_size(), length_error is thrown. The * value of the string doesn't change if an error is thrown. */ basic_string& replace(__const_iterator __i1, __const_iterator __i2, size_type __n, _CharT __c) { _GLIBCXX_DEBUG_PEDASSERT(begin() <= __i1 && __i1 <= __i2 && __i2 <= end()); return _M_replace_aux(__i1 - begin(), __i2 - __i1, __n, __c); } /** * @brief Replace range of characters with range. * @param __i1 Iterator referencing start of range to replace. * @param __i2 Iterator referencing end of range to replace. * @param __k1 Iterator referencing start of range to insert. * @param __k2 Iterator referencing end of range to insert. * @return Reference to this string. * @throw std::length_error If new length exceeds @c max_size(). * * Removes the characters in the range [__i1,__i2). In place, * characters in the range [__k1,__k2) are inserted. If the * length of result exceeds max_size(), length_error is thrown. * The value of the string doesn't change if an error is * thrown. */ #if __cplusplus >= 201103L template> basic_string& replace(const_iterator __i1, const_iterator __i2, _InputIterator __k1, _InputIterator __k2) { _GLIBCXX_DEBUG_PEDASSERT(begin() <= __i1 && __i1 <= __i2 && __i2 <= end()); __glibcxx_requires_valid_range(__k1, __k2); return this->_M_replace_dispatch(__i1, __i2, __k1, __k2, std::__false_type()); } #else # 1821 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 template #ifdef _GLIBCXX_DISAMBIGUATE_REPLACE_INST typename __enable_if_not_native_iterator<_InputIterator>::__type #else # 1825 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 basic_string& #endif # 1827 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 replace(iterator __i1, iterator __i2, _InputIterator __k1, _InputIterator __k2) { _GLIBCXX_DEBUG_PEDASSERT(begin() <= __i1 && __i1 <= __i2 && __i2 <= end()); __glibcxx_requires_valid_range(__k1, __k2); typedef typename std::__is_integer<_InputIterator>::__type _Integral; return _M_replace_dispatch(__i1, __i2, __k1, __k2, _Integral()); } #endif # 1837 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 // Specializations for the common case of pointer and iterator: // useful to avoid the overhead of temporary buffering in _M_replace. basic_string& replace(__const_iterator __i1, __const_iterator __i2, _CharT* __k1, _CharT* __k2) { _GLIBCXX_DEBUG_PEDASSERT(begin() <= __i1 && __i1 <= __i2 && __i2 <= end()); __glibcxx_requires_valid_range(__k1, __k2); return this->replace(__i1 - begin(), __i2 - __i1, __k1, __k2 - __k1); } basic_string& replace(__const_iterator __i1, __const_iterator __i2, const _CharT* __k1, const _CharT* __k2) { _GLIBCXX_DEBUG_PEDASSERT(begin() <= __i1 && __i1 <= __i2 && __i2 <= end()); __glibcxx_requires_valid_range(__k1, __k2); return this->replace(__i1 - begin(), __i2 - __i1, __k1, __k2 - __k1); } basic_string& replace(__const_iterator __i1, __const_iterator __i2, iterator __k1, iterator __k2) { _GLIBCXX_DEBUG_PEDASSERT(begin() <= __i1 && __i1 <= __i2 && __i2 <= end()); __glibcxx_requires_valid_range(__k1, __k2); return this->replace(__i1 - begin(), __i2 - __i1, __k1.base(), __k2 - __k1); } basic_string& replace(__const_iterator __i1, __const_iterator __i2, const_iterator __k1, const_iterator __k2) { _GLIBCXX_DEBUG_PEDASSERT(begin() <= __i1 && __i1 <= __i2 && __i2 <= end()); __glibcxx_requires_valid_range(__k1, __k2); return this->replace(__i1 - begin(), __i2 - __i1, __k1.base(), __k2 - __k1); } #if __cplusplus >= 201103L /** * @brief Replace range of characters with initializer_list. * @param __i1 Iterator referencing start of range to replace. * @param __i2 Iterator referencing end of range to replace. * @param __l The initializer_list of characters to insert. * @return Reference to this string. * @throw std::length_error If new length exceeds @c max_size(). * * Removes the characters in the range [__i1,__i2). In place, * characters in the range [__k1,__k2) are inserted. If the * length of result exceeds max_size(), length_error is thrown. * The value of the string doesn't change if an error is * thrown. */ basic_string& replace(const_iterator __i1, const_iterator __i2, initializer_list<_CharT> __l) { return this->replace(__i1, __i2, __l.begin(), __l.end()); } #endif // C++11 # 1903 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 private: template basic_string& _M_replace_dispatch(const_iterator __i1, const_iterator __i2, _Integer __n, _Integer __val, __true_type) { return _M_replace_aux(__i1 - begin(), __i2 - __i1, __n, __val); } template basic_string& _M_replace_dispatch(const_iterator __i1, const_iterator __i2, _InputIterator __k1, _InputIterator __k2, __false_type); basic_string& _M_replace_aux(size_type __pos1, size_type __n1, size_type __n2, _CharT __c); basic_string& _M_replace(size_type __pos, size_type __len1, const _CharT* __s, const size_type __len2); basic_string& _M_append(const _CharT* __s, size_type __n); public: /** * @brief Copy substring into C string. * @param __s C string to copy value into. * @param __n Number of characters to copy. * @param __pos Index of first character to copy. * @return Number of characters actually copied * @throw std::out_of_range If __pos > size(). * * Copies up to @a __n characters starting at @a __pos into the * C string @a __s. If @a __pos is %greater than size(), * out_of_range is thrown. */ size_type copy(_CharT* __s, size_type __n, size_type __pos = 0) const; /** * @brief Swap contents with another string. * @param __s String to swap with. * * Exchanges the contents of this string with that of @a __s in constant * time. */ void swap(basic_string& __s) _GLIBCXX_NOEXCEPT; // String operations: /** * @brief Return const pointer to null-terminated contents. * * This is a handle to internal data. Do not modify or dire things may * happen. */ const _CharT* c_str() const _GLIBCXX_NOEXCEPT { return _M_data(); } /** * @brief Return const pointer to contents. * * This is a handle to internal data. Do not modify or dire things may * happen. */ const _CharT* data() const _GLIBCXX_NOEXCEPT { return _M_data(); } /** * @brief Return copy of allocator used to construct this string. */ allocator_type get_allocator() const _GLIBCXX_NOEXCEPT { return _M_get_allocator(); } /** * @brief Find position of a C substring. * @param __s C string to locate. * @param __pos Index of character to search from. * @param __n Number of characters from @a s to search for. * @return Index of start of first occurrence. * * Starting from @a __pos, searches forward for the first @a * __n characters in @a __s within this string. If found, * returns the index where it begins. If not found, returns * npos. */ size_type find(const _CharT* __s, size_type __pos, size_type __n) const; /** * @brief Find position of a string. * @param __str String to locate. * @param __pos Index of character to search from (default 0). * @return Index of start of first occurrence. * * Starting from @a __pos, searches forward for value of @a __str within * this string. If found, returns the index where it begins. If not * found, returns npos. */ size_type find(const basic_string& __str, size_type __pos = 0) const _GLIBCXX_NOEXCEPT { return this->find(__str.data(), __pos, __str.size()); } /** * @brief Find position of a C string. * @param __s C string to locate. * @param __pos Index of character to search from (default 0). * @return Index of start of first occurrence. * * Starting from @a __pos, searches forward for the value of @a * __s within this string. If found, returns the index where * it begins. If not found, returns npos. */ size_type find(const _CharT* __s, size_type __pos = 0) const { __glibcxx_requires_string(__s); return this->find(__s, __pos, traits_type::length(__s)); } /** * @brief Find position of a character. * @param __c Character to locate. * @param __pos Index of character to search from (default 0). * @return Index of first occurrence. * * Starting from @a __pos, searches forward for @a __c within * this string. If found, returns the index where it was * found. If not found, returns npos. */ size_type find(_CharT __c, size_type __pos = 0) const _GLIBCXX_NOEXCEPT; /** * @brief Find last position of a string. * @param __str String to locate. * @param __pos Index of character to search back from (default end). * @return Index of start of last occurrence. * * Starting from @a __pos, searches backward for value of @a * __str within this string. If found, returns the index where * it begins. If not found, returns npos. */ size_type rfind(const basic_string& __str, size_type __pos = npos) const _GLIBCXX_NOEXCEPT { return this->rfind(__str.data(), __pos, __str.size()); } /** * @brief Find last position of a C substring. * @param __s C string to locate. * @param __pos Index of character to search back from. * @param __n Number of characters from s to search for. * @return Index of start of last occurrence. * * Starting from @a __pos, searches backward for the first @a * __n characters in @a __s within this string. If found, * returns the index where it begins. If not found, returns * npos. */ size_type rfind(const _CharT* __s, size_type __pos, size_type __n) const; /** * @brief Find last position of a C string. * @param __s C string to locate. * @param __pos Index of character to start search at (default end). * @return Index of start of last occurrence. * * Starting from @a __pos, searches backward for the value of * @a __s within this string. If found, returns the index * where it begins. If not found, returns npos. */ size_type rfind(const _CharT* __s, size_type __pos = npos) const { __glibcxx_requires_string(__s); return this->rfind(__s, __pos, traits_type::length(__s)); } /** * @brief Find last position of a character. * @param __c Character to locate. * @param __pos Index of character to search back from (default end). * @return Index of last occurrence. * * Starting from @a __pos, searches backward for @a __c within * this string. If found, returns the index where it was * found. If not found, returns npos. */ size_type rfind(_CharT __c, size_type __pos = npos) const _GLIBCXX_NOEXCEPT; /** * @brief Find position of a character of string. * @param __str String containing characters to locate. * @param __pos Index of character to search from (default 0). * @return Index of first occurrence. * * Starting from @a __pos, searches forward for one of the * characters of @a __str within this string. If found, * returns the index where it was found. If not found, returns * npos. */ size_type find_first_of(const basic_string& __str, size_type __pos = 0) const _GLIBCXX_NOEXCEPT { return this->find_first_of(__str.data(), __pos, __str.size()); } /** * @brief Find position of a character of C substring. * @param __s String containing characters to locate. * @param __pos Index of character to search from. * @param __n Number of characters from s to search for. * @return Index of first occurrence. * * Starting from @a __pos, searches forward for one of the * first @a __n characters of @a __s within this string. If * found, returns the index where it was found. If not found, * returns npos. */ size_type find_first_of(const _CharT* __s, size_type __pos, size_type __n) const; /** * @brief Find position of a character of C string. * @param __s String containing characters to locate. * @param __pos Index of character to search from (default 0). * @return Index of first occurrence. * * Starting from @a __pos, searches forward for one of the * characters of @a __s within this string. If found, returns * the index where it was found. If not found, returns npos. */ size_type find_first_of(const _CharT* __s, size_type __pos = 0) const { __glibcxx_requires_string(__s); return this->find_first_of(__s, __pos, traits_type::length(__s)); } /** * @brief Find position of a character. * @param __c Character to locate. * @param __pos Index of character to search from (default 0). * @return Index of first occurrence. * * Starting from @a __pos, searches forward for the character * @a __c within this string. If found, returns the index * where it was found. If not found, returns npos. * * Note: equivalent to find(__c, __pos). */ size_type find_first_of(_CharT __c, size_type __pos = 0) const _GLIBCXX_NOEXCEPT { return this->find(__c, __pos); } /** * @brief Find last position of a character of string. * @param __str String containing characters to locate. * @param __pos Index of character to search back from (default end). * @return Index of last occurrence. * * Starting from @a __pos, searches backward for one of the * characters of @a __str within this string. If found, * returns the index where it was found. If not found, returns * npos. */ size_type find_last_of(const basic_string& __str, size_type __pos = npos) const _GLIBCXX_NOEXCEPT { return this->find_last_of(__str.data(), __pos, __str.size()); } /** * @brief Find last position of a character of C substring. * @param __s C string containing characters to locate. * @param __pos Index of character to search back from. * @param __n Number of characters from s to search for. * @return Index of last occurrence. * * Starting from @a __pos, searches backward for one of the * first @a __n characters of @a __s within this string. If * found, returns the index where it was found. If not found, * returns npos. */ size_type find_last_of(const _CharT* __s, size_type __pos, size_type __n) const; /** * @brief Find last position of a character of C string. * @param __s C string containing characters to locate. * @param __pos Index of character to search back from (default end). * @return Index of last occurrence. * * Starting from @a __pos, searches backward for one of the * characters of @a __s within this string. If found, returns * the index where it was found. If not found, returns npos. */ size_type find_last_of(const _CharT* __s, size_type __pos = npos) const { __glibcxx_requires_string(__s); return this->find_last_of(__s, __pos, traits_type::length(__s)); } /** * @brief Find last position of a character. * @param __c Character to locate. * @param __pos Index of character to search back from (default end). * @return Index of last occurrence. * * Starting from @a __pos, searches backward for @a __c within * this string. If found, returns the index where it was * found. If not found, returns npos. * * Note: equivalent to rfind(__c, __pos). */ size_type find_last_of(_CharT __c, size_type __pos = npos) const _GLIBCXX_NOEXCEPT { return this->rfind(__c, __pos); } /** * @brief Find position of a character not in string. * @param __str String containing characters to avoid. * @param __pos Index of character to search from (default 0). * @return Index of first occurrence. * * Starting from @a __pos, searches forward for a character not contained * in @a __str within this string. If found, returns the index where it * was found. If not found, returns npos. */ size_type find_first_not_of(const basic_string& __str, size_type __pos = 0) const _GLIBCXX_NOEXCEPT { return this->find_first_not_of(__str.data(), __pos, __str.size()); } /** * @brief Find position of a character not in C substring. * @param __s C string containing characters to avoid. * @param __pos Index of character to search from. * @param __n Number of characters from __s to consider. * @return Index of first occurrence. * * Starting from @a __pos, searches forward for a character not * contained in the first @a __n characters of @a __s within * this string. If found, returns the index where it was * found. If not found, returns npos. */ size_type find_first_not_of(const _CharT* __s, size_type __pos, size_type __n) const; /** * @brief Find position of a character not in C string. * @param __s C string containing characters to avoid. * @param __pos Index of character to search from (default 0). * @return Index of first occurrence. * * Starting from @a __pos, searches forward for a character not * contained in @a __s within this string. If found, returns * the index where it was found. If not found, returns npos. */ size_type find_first_not_of(const _CharT* __s, size_type __pos = 0) const { __glibcxx_requires_string(__s); return this->find_first_not_of(__s, __pos, traits_type::length(__s)); } /** * @brief Find position of a different character. * @param __c Character to avoid. * @param __pos Index of character to search from (default 0). * @return Index of first occurrence. * * Starting from @a __pos, searches forward for a character * other than @a __c within this string. If found, returns the * index where it was found. If not found, returns npos. */ size_type find_first_not_of(_CharT __c, size_type __pos = 0) const _GLIBCXX_NOEXCEPT; /** * @brief Find last position of a character not in string. * @param __str String containing characters to avoid. * @param __pos Index of character to search back from (default end). * @return Index of last occurrence. * * Starting from @a __pos, searches backward for a character * not contained in @a __str within this string. If found, * returns the index where it was found. If not found, returns * npos. */ size_type find_last_not_of(const basic_string& __str, size_type __pos = npos) const _GLIBCXX_NOEXCEPT { return this->find_last_not_of(__str.data(), __pos, __str.size()); } /** * @brief Find last position of a character not in C substring. * @param __s C string containing characters to avoid. * @param __pos Index of character to search back from. * @param __n Number of characters from s to consider. * @return Index of last occurrence. * * Starting from @a __pos, searches backward for a character not * contained in the first @a __n characters of @a __s within this string. * If found, returns the index where it was found. If not found, * returns npos. */ size_type find_last_not_of(const _CharT* __s, size_type __pos, size_type __n) const; /** * @brief Find last position of a character not in C string. * @param __s C string containing characters to avoid. * @param __pos Index of character to search back from (default end). * @return Index of last occurrence. * * Starting from @a __pos, searches backward for a character * not contained in @a __s within this string. If found, * returns the index where it was found. If not found, returns * npos. */ size_type find_last_not_of(const _CharT* __s, size_type __pos = npos) const { __glibcxx_requires_string(__s); return this->find_last_not_of(__s, __pos, traits_type::length(__s)); } /** * @brief Find last position of a different character. * @param __c Character to avoid. * @param __pos Index of character to search back from (default end). * @return Index of last occurrence. * * Starting from @a __pos, searches backward for a character other than * @a __c within this string. If found, returns the index where it was * found. If not found, returns npos. */ size_type find_last_not_of(_CharT __c, size_type __pos = npos) const _GLIBCXX_NOEXCEPT; /** * @brief Get a substring. * @param __pos Index of first character (default 0). * @param __n Number of characters in substring (default remainder). * @return The new string. * @throw std::out_of_range If __pos > size(). * * Construct and return a new string using the @a __n * characters starting at @a __pos. If the string is too * short, use the remainder of the characters. If @a __pos is * beyond the end of the string, out_of_range is thrown. */ basic_string substr(size_type __pos = 0, size_type __n = npos) const { return basic_string(*this, _M_check(__pos, "basic_string::substr"), __n); } /** * @brief Compare to a string. * @param __str String to compare against. * @return Integer < 0, 0, or > 0. * * Returns an integer < 0 if this string is ordered before @a * __str, 0 if their values are equivalent, or > 0 if this * string is ordered after @a __str. Determines the effective * length rlen of the strings to compare as the smallest of * size() and str.size(). The function then compares the two * strings by calling traits::compare(data(), str.data(),rlen). * If the result of the comparison is nonzero returns it, * otherwise the shorter one is ordered first. */ int compare(const basic_string& __str) const { const size_type __size = this->size(); const size_type __osize = __str.size(); const size_type __len = std::min(__size, __osize); int __r = traits_type::compare(_M_data(), __str.data(), __len); if (!__r) __r = _S_compare(__size, __osize); return __r; } /** * @brief Compare substring to a string. * @param __pos Index of first character of substring. * @param __n Number of characters in substring. * @param __str String to compare against. * @return Integer < 0, 0, or > 0. * * Form the substring of this string from the @a __n characters * starting at @a __pos. Returns an integer < 0 if the * substring is ordered before @a __str, 0 if their values are * equivalent, or > 0 if the substring is ordered after @a * __str. Determines the effective length rlen of the strings * to compare as the smallest of the length of the substring * and @a __str.size(). The function then compares the two * strings by calling * traits::compare(substring.data(),str.data(),rlen). If the * result of the comparison is nonzero returns it, otherwise * the shorter one is ordered first. */ int compare(size_type __pos, size_type __n, const basic_string& __str) const; /** * @brief Compare substring to a substring. * @param __pos1 Index of first character of substring. * @param __n1 Number of characters in substring. * @param __str String to compare against. * @param __pos2 Index of first character of substring of str. * @param __n2 Number of characters in substring of str. * @return Integer < 0, 0, or > 0. * * Form the substring of this string from the @a __n1 * characters starting at @a __pos1. Form the substring of @a * __str from the @a __n2 characters starting at @a __pos2. * Returns an integer < 0 if this substring is ordered before * the substring of @a __str, 0 if their values are equivalent, * or > 0 if this substring is ordered after the substring of * @a __str. Determines the effective length rlen of the * strings to compare as the smallest of the lengths of the * substrings. The function then compares the two strings by * calling * traits::compare(substring.data(),str.substr(pos2,n2).data(),rlen). * If the result of the comparison is nonzero returns it, * otherwise the shorter one is ordered first. */ int compare(size_type __pos1, size_type __n1, const basic_string& __str, size_type __pos2, size_type __n2) const; /** * @brief Compare to a C string. * @param __s C string to compare against. * @return Integer < 0, 0, or > 0. * * Returns an integer < 0 if this string is ordered before @a __s, 0 if * their values are equivalent, or > 0 if this string is ordered after * @a __s. Determines the effective length rlen of the strings to * compare as the smallest of size() and the length of a string * constructed from @a __s. The function then compares the two strings * by calling traits::compare(data(),s,rlen). If the result of the * comparison is nonzero returns it, otherwise the shorter one is * ordered first. */ int compare(const _CharT* __s) const; // _GLIBCXX_RESOLVE_LIB_DEFECTS // 5 String::compare specification questionable /** * @brief Compare substring to a C string. * @param __pos Index of first character of substring. * @param __n1 Number of characters in substring. * @param __s C string to compare against. * @return Integer < 0, 0, or > 0. * * Form the substring of this string from the @a __n1 * characters starting at @a pos. Returns an integer < 0 if * the substring is ordered before @a __s, 0 if their values * are equivalent, or > 0 if the substring is ordered after @a * __s. Determines the effective length rlen of the strings to * compare as the smallest of the length of the substring and * the length of a string constructed from @a __s. The * function then compares the two string by calling * traits::compare(substring.data(),__s,rlen). If the result of * the comparison is nonzero returns it, otherwise the shorter * one is ordered first. */ int compare(size_type __pos, size_type __n1, const _CharT* __s) const; /** * @brief Compare substring against a character %array. * @param __pos Index of first character of substring. * @param __n1 Number of characters in substring. * @param __s character %array to compare against. * @param __n2 Number of characters of s. * @return Integer < 0, 0, or > 0. * * Form the substring of this string from the @a __n1 * characters starting at @a __pos. Form a string from the * first @a __n2 characters of @a __s. Returns an integer < 0 * if this substring is ordered before the string from @a __s, * 0 if their values are equivalent, or > 0 if this substring * is ordered after the string from @a __s. Determines the * effective length rlen of the strings to compare as the * smallest of the length of the substring and @a __n2. The * function then compares the two strings by calling * traits::compare(substring.data(),s,rlen). If the result of * the comparison is nonzero returns it, otherwise the shorter * one is ordered first. * * NB: s must have at least n2 characters, '\\0' has * no special meaning. */ int compare(size_type __pos, size_type __n1, const _CharT* __s, size_type __n2) const; }; _GLIBCXX_END_NAMESPACE_CXX11 #else // !_GLIBCXX_USE_CXX11_ABI # 2520 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 // Reference-counted COW string implentation /** * @class basic_string basic_string.h * @brief Managing sequences of characters and character-like objects. * * @ingroup strings * @ingroup sequences * * @tparam _CharT Type of character * @tparam _Traits Traits for character type, defaults to * char_traits<_CharT>. * @tparam _Alloc Allocator type, defaults to allocator<_CharT>. * * Meets the requirements of a container, a * reversible container, and a * sequence. Of the * optional sequence requirements, only * @c push_back, @c at, and @c %array access are supported. * * @doctodo * * * Documentation? What's that? * Nathan Myers . * * A string looks like this: * * @code * [_Rep] * _M_length * [basic_string] _M_capacity * _M_dataplus _M_refcount * _M_p ----------------> unnamed array of char_type * @endcode * * Where the _M_p points to the first character in the string, and * you cast it to a pointer-to-_Rep and subtract 1 to get a * pointer to the header. * * This approach has the enormous advantage that a string object * requires only one allocation. All the ugliness is confined * within a single %pair of inline functions, which each compile to * a single @a add instruction: _Rep::_M_data(), and * string::_M_rep(); and the allocation function which gets a * block of raw bytes and with room enough and constructs a _Rep * object at the front. * * The reason you want _M_data pointing to the character %array and * not the _Rep is so that the debugger can see the string * contents. (Probably we should add a non-inline member to get * the _Rep for the debugger to use, so users can check the actual * string length.) * * Note that the _Rep object is a POD so that you can have a * static empty string _Rep object already @a constructed before * static constructors have run. The reference-count encoding is * chosen so that a 0 indicates one reference, so you never try to * destroy the empty-string _Rep object. * * All but the last paragraph is considered pretty conventional * for a C++ string implementation. */ // 21.3 Template class basic_string template class basic_string { typedef typename _Alloc::template rebind<_CharT>::other _CharT_alloc_type; // Types: public: typedef _Traits traits_type; typedef typename _Traits::char_type value_type; typedef _Alloc allocator_type; typedef typename _CharT_alloc_type::size_type size_type; typedef typename _CharT_alloc_type::difference_type difference_type; typedef typename _CharT_alloc_type::reference reference; typedef typename _CharT_alloc_type::const_reference const_reference; typedef typename _CharT_alloc_type::pointer pointer; typedef typename _CharT_alloc_type::const_pointer const_pointer; typedef __gnu_cxx::__normal_iterator iterator; typedef __gnu_cxx::__normal_iterator const_iterator; typedef std::reverse_iterator const_reverse_iterator; typedef std::reverse_iterator reverse_iterator; private: // _Rep: string representation // Invariants: // 1. String really contains _M_length + 1 characters: due to 21.3.4 // must be kept null-terminated. // 2. _M_capacity >= _M_length // Allocated memory is always (_M_capacity + 1) * sizeof(_CharT). // 3. _M_refcount has three states: // -1: leaked, one reference, no ref-copies allowed, non-const. // 0: one reference, non-const. // n>0: n + 1 references, operations require a lock, const. // 4. All fields==0 is an empty string, given the extra storage // beyond-the-end for a null terminator; thus, the shared // empty string representation needs no constructor. struct _Rep_base { size_type _M_length; size_type _M_capacity; _Atomic_word _M_refcount; }; struct _Rep : _Rep_base { // Types: typedef typename _Alloc::template rebind::other _Raw_bytes_alloc; // (Public) Data members: // The maximum number of individual char_type elements of an // individual string is determined by _S_max_size. This is the // value that will be returned by max_size(). (Whereas npos // is the maximum number of bytes the allocator can allocate.) // If one was to divvy up the theoretical largest size string, // with a terminating character and m _CharT elements, it'd // look like this: // npos = sizeof(_Rep) + (m * sizeof(_CharT)) + sizeof(_CharT) // Solving for m: // m = ((npos - sizeof(_Rep))/sizeof(CharT)) - 1 // In addition, this implementation quarters this amount. static const size_type _S_max_size; static const _CharT _S_terminal; // The following storage is init'd to 0 by the linker, resulting // (carefully) in an empty string with one reference. static size_type _S_empty_rep_storage[]; static _Rep& _S_empty_rep() _GLIBCXX_NOEXCEPT { // NB: Mild hack to avoid strict-aliasing warnings. Note that // _S_empty_rep_storage is never modified and the punning should // be reasonably safe in this case. void* __p = reinterpret_cast(&_S_empty_rep_storage); return *reinterpret_cast<_Rep*>(__p); } bool _M_is_leaked() const _GLIBCXX_NOEXCEPT { return this->_M_refcount < 0; } bool _M_is_shared() const _GLIBCXX_NOEXCEPT { return this->_M_refcount > 0; } void _M_set_leaked() _GLIBCXX_NOEXCEPT { this->_M_refcount = -1; } void _M_set_sharable() _GLIBCXX_NOEXCEPT { this->_M_refcount = 0; } void _M_set_length_and_sharable(size_type __n) _GLIBCXX_NOEXCEPT { #if _GLIBCXX_FULLY_DYNAMIC_STRING == 0 if (__builtin_expect(this != &_S_empty_rep(), false)) #endif # 2685 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 { this->_M_set_sharable(); // One reference. this->_M_length = __n; traits_type::assign(this->_M_refdata()[__n], _S_terminal); // grrr. (per 21.3.4) // You cannot leave those LWG people alone for a second. } } _CharT* _M_refdata() throw() { return reinterpret_cast<_CharT*>(this + 1); } _CharT* _M_grab(const _Alloc& __alloc1, const _Alloc& __alloc2) { return (!_M_is_leaked() && __alloc1 == __alloc2) ? _M_refcopy() : _M_clone(__alloc1); } // Create & Destroy static _Rep* _S_create(size_type, size_type, const _Alloc&); void _M_dispose(const _Alloc& __a) _GLIBCXX_NOEXCEPT { #if _GLIBCXX_FULLY_DYNAMIC_STRING == 0 if (__builtin_expect(this != &_S_empty_rep(), false)) #endif # 2715 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 { // Be race-detector-friendly. For more info see bits/c++config. _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(&this->_M_refcount); if (__gnu_cxx::__exchange_and_add_dispatch(&this->_M_refcount, -1) <= 0) { _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(&this->_M_refcount); _M_destroy(__a); } } } // XXX MT void _M_destroy(const _Alloc&) throw(); _CharT* _M_refcopy() throw() { #if _GLIBCXX_FULLY_DYNAMIC_STRING == 0 if (__builtin_expect(this != &_S_empty_rep(), false)) #endif # 2736 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 __gnu_cxx::__atomic_add_dispatch(&this->_M_refcount, 1); return _M_refdata(); } // XXX MT _CharT* _M_clone(const _Alloc&, size_type __res = 0); }; // Use empty-base optimization: http://www.cantrip.org/emptyopt.html struct _Alloc_hider : _Alloc { _Alloc_hider(_CharT* __dat, const _Alloc& __a) _GLIBCXX_NOEXCEPT : _Alloc(__a), _M_p(__dat) { } _CharT* _M_p; // The actual data. }; public: // Data Members (public): // NB: This is an unsigned type, and thus represents the maximum // size that the allocator can hold. /// Value returned by various member functions when they fail. static const size_type npos = static_cast(-1); private: // Data Members (private): mutable _Alloc_hider _M_dataplus; _CharT* _M_data() const _GLIBCXX_NOEXCEPT { return _M_dataplus._M_p; } _CharT* _M_data(_CharT* __p) _GLIBCXX_NOEXCEPT { return (_M_dataplus._M_p = __p); } _Rep* _M_rep() const _GLIBCXX_NOEXCEPT { return &((reinterpret_cast<_Rep*> (_M_data()))[-1]); } // For the internal use we have functions similar to `begin'/`end' // but they do not call _M_leak. iterator _M_ibegin() const _GLIBCXX_NOEXCEPT { return iterator(_M_data()); } iterator _M_iend() const _GLIBCXX_NOEXCEPT { return iterator(_M_data() + this->size()); } void _M_leak() // for use in begin() & non-const op[] { if (!_M_rep()->_M_is_leaked()) _M_leak_hard(); } size_type _M_check(size_type __pos, const char* __s) const { if (__pos > this->size()) __throw_out_of_range_fmt(__N("%s: __pos (which is %zu) > " "this->size() (which is %zu)"), __s, __pos, this->size()); return __pos; } void _M_check_length(size_type __n1, size_type __n2, const char* __s) const { if (this->max_size() - (this->size() - __n1) < __n2) __throw_length_error(__N(__s)); } // NB: _M_limit doesn't check for a bad __pos value. size_type _M_limit(size_type __pos, size_type __off) const _GLIBCXX_NOEXCEPT { const bool __testoff = __off < this->size() - __pos; return __testoff ? __off : this->size() - __pos; } // True if _Rep and source do not overlap. bool _M_disjunct(const _CharT* __s) const _GLIBCXX_NOEXCEPT { return (less()(__s, _M_data()) || less()(_M_data() + this->size(), __s)); } // When __n = 1 way faster than the general multichar // traits_type::copy/move/assign. static void _M_copy(_CharT* __d, const _CharT* __s, size_type __n) _GLIBCXX_NOEXCEPT { if (__n == 1) traits_type::assign(*__d, *__s); else traits_type::copy(__d, __s, __n); } static void _M_move(_CharT* __d, const _CharT* __s, size_type __n) _GLIBCXX_NOEXCEPT { if (__n == 1) traits_type::assign(*__d, *__s); else traits_type::move(__d, __s, __n); } static void _M_assign(_CharT* __d, size_type __n, _CharT __c) _GLIBCXX_NOEXCEPT { if (__n == 1) traits_type::assign(*__d, __c); else traits_type::assign(__d, __n, __c); } // _S_copy_chars is a separate template to permit specialization // to optimize for the common case of pointers as iterators. template static void _S_copy_chars(_CharT* __p, _Iterator __k1, _Iterator __k2) { for (; __k1 != __k2; ++__k1, ++__p) traits_type::assign(*__p, *__k1); // These types are off. } static void _S_copy_chars(_CharT* __p, iterator __k1, iterator __k2) _GLIBCXX_NOEXCEPT { _S_copy_chars(__p, __k1.base(), __k2.base()); } static void _S_copy_chars(_CharT* __p, const_iterator __k1, const_iterator __k2) _GLIBCXX_NOEXCEPT { _S_copy_chars(__p, __k1.base(), __k2.base()); } static void _S_copy_chars(_CharT* __p, _CharT* __k1, _CharT* __k2) _GLIBCXX_NOEXCEPT { _M_copy(__p, __k1, __k2 - __k1); } static void _S_copy_chars(_CharT* __p, const _CharT* __k1, const _CharT* __k2) _GLIBCXX_NOEXCEPT { _M_copy(__p, __k1, __k2 - __k1); } static int _S_compare(size_type __n1, size_type __n2) _GLIBCXX_NOEXCEPT { const difference_type __d = difference_type(__n1 - __n2); if (__d > __gnu_cxx::__numeric_traits::__max) return __gnu_cxx::__numeric_traits::__max; else if (__d < __gnu_cxx::__numeric_traits::__min) return __gnu_cxx::__numeric_traits::__min; else return int(__d); } void _M_mutate(size_type __pos, size_type __len1, size_type __len2); void _M_leak_hard(); static _Rep& _S_empty_rep() _GLIBCXX_NOEXCEPT { return _Rep::_S_empty_rep(); } public: // Construct/copy/destroy: // NB: We overload ctors in some cases instead of using default // arguments, per 17.4.4.4 para. 2 item 2. /** * @brief Default constructor creates an empty string. */ basic_string() #if _GLIBCXX_FULLY_DYNAMIC_STRING == 0 : _M_dataplus(_S_empty_rep()._M_refdata(), _Alloc()) { } #else # 2918 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 : _M_dataplus(_S_construct(size_type(), _CharT(), _Alloc()), _Alloc()){ } #endif # 2920 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 /** * @brief Construct an empty string using allocator @a a. */ explicit basic_string(const _Alloc& __a); // NB: per LWG issue 42, semantics different from IS: /** * @brief Construct string with copy of value of @a str. * @param __str Source string. */ basic_string(const basic_string& __str); /** * @brief Construct string as copy of a substring. * @param __str Source string. * @param __pos Index of first character to copy from. * @param __n Number of characters to copy (default remainder). */ basic_string(const basic_string& __str, size_type __pos, size_type __n = npos); /** * @brief Construct string as copy of a substring. * @param __str Source string. * @param __pos Index of first character to copy from. * @param __n Number of characters to copy. * @param __a Allocator to use. */ basic_string(const basic_string& __str, size_type __pos, size_type __n, const _Alloc& __a); /** * @brief Construct string initialized by a character %array. * @param __s Source character %array. * @param __n Number of characters to copy. * @param __a Allocator to use (default is default allocator). * * NB: @a __s must have at least @a __n characters, '\\0' * has no special meaning. */ basic_string(const _CharT* __s, size_type __n, const _Alloc& __a = _Alloc()); /** * @brief Construct string as copy of a C string. * @param __s Source C string. * @param __a Allocator to use (default is default allocator). */ basic_string(const _CharT* __s, const _Alloc& __a = _Alloc()); /** * @brief Construct string as multiple characters. * @param __n Number of characters. * @param __c Character to use. * @param __a Allocator to use (default is default allocator). */ basic_string(size_type __n, _CharT __c, const _Alloc& __a = _Alloc()); #if __cplusplus >= 201103L /** * @brief Move construct string. * @param __str Source string. * * The newly-created string contains the exact contents of @a __str. * @a __str is a valid, but unspecified string. **/ basic_string(basic_string&& __str) #if _GLIBCXX_FULLY_DYNAMIC_STRING == 0 noexcept // FIXME C++11: should always be noexcept. #endif # 2988 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 : _M_dataplus(__str._M_dataplus) { #if _GLIBCXX_FULLY_DYNAMIC_STRING == 0 __str._M_data(_S_empty_rep()._M_refdata()); #else # 2993 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 __str._M_data(_S_construct(size_type(), _CharT(), get_allocator())); #endif # 2995 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 } /** * @brief Construct string from an initializer %list. * @param __l std::initializer_list of characters. * @param __a Allocator to use (default is default allocator). */ basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc()); #endif // C++11 # 3004 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 /** * @brief Construct string as copy of a range. * @param __beg Start of range. * @param __end End of range. * @param __a Allocator to use (default is default allocator). */ template basic_string(_InputIterator __beg, _InputIterator __end, const _Alloc& __a = _Alloc()); /** * @brief Destroy the string instance. */ ~basic_string() _GLIBCXX_NOEXCEPT { _M_rep()->_M_dispose(this->get_allocator()); } /** * @brief Assign the value of @a str to this string. * @param __str Source string. */ basic_string& operator=(const basic_string& __str) { return this->assign(__str); } /** * @brief Copy contents of @a s into this string. * @param __s Source null-terminated string. */ basic_string& operator=(const _CharT* __s) { return this->assign(__s); } /** * @brief Set value to string of length 1. * @param __c Source character. * * Assigning to a character makes this string length 1 and * (*this)[0] == @a c. */ basic_string& operator=(_CharT __c) { this->assign(1, __c); return *this; } #if __cplusplus >= 201103L /** * @brief Move assign the value of @a str to this string. * @param __str Source string. * * The contents of @a str are moved into this string (without copying). * @a str is a valid, but unspecified string. **/ // PR 58265, this should be noexcept. basic_string& operator=(basic_string&& __str) { // NB: DR 1204. this->swap(__str); return *this; } /** * @brief Set value to string constructed from initializer %list. * @param __l std::initializer_list. */ basic_string& operator=(initializer_list<_CharT> __l) { this->assign(__l.begin(), __l.size()); return *this; } #endif // C++11 # 3079 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 // Iterators: /** * Returns a read/write iterator that points to the first character in * the %string. Unshares the string. */ iterator begin() // FIXME C++11: should be noexcept. { _M_leak(); return iterator(_M_data()); } /** * Returns a read-only (constant) iterator that points to the first * character in the %string. */ const_iterator begin() const _GLIBCXX_NOEXCEPT { return const_iterator(_M_data()); } /** * Returns a read/write iterator that points one past the last * character in the %string. Unshares the string. */ iterator end() // FIXME C++11: should be noexcept. { _M_leak(); return iterator(_M_data() + this->size()); } /** * Returns a read-only (constant) iterator that points one past the * last character in the %string. */ const_iterator end() const _GLIBCXX_NOEXCEPT { return const_iterator(_M_data() + this->size()); } /** * Returns a read/write reverse iterator that points to the last * character in the %string. Iteration is done in reverse element * order. Unshares the string. */ reverse_iterator rbegin() // FIXME C++11: should be noexcept. { return reverse_iterator(this->end()); } /** * Returns a read-only (constant) reverse iterator that points * to the last character in the %string. Iteration is done in * reverse element order. */ const_reverse_iterator rbegin() const _GLIBCXX_NOEXCEPT { return const_reverse_iterator(this->end()); } /** * Returns a read/write reverse iterator that points to one before the * first character in the %string. Iteration is done in reverse * element order. Unshares the string. */ reverse_iterator rend() // FIXME C++11: should be noexcept. { return reverse_iterator(this->begin()); } /** * Returns a read-only (constant) reverse iterator that points * to one before the first character in the %string. Iteration * is done in reverse element order. */ const_reverse_iterator rend() const _GLIBCXX_NOEXCEPT { return const_reverse_iterator(this->begin()); } #if __cplusplus >= 201103L /** * Returns a read-only (constant) iterator that points to the first * character in the %string. */ const_iterator cbegin() const noexcept { return const_iterator(this->_M_data()); } /** * Returns a read-only (constant) iterator that points one past the * last character in the %string. */ const_iterator cend() const noexcept { return const_iterator(this->_M_data() + this->size()); } /** * Returns a read-only (constant) reverse iterator that points * to the last character in the %string. Iteration is done in * reverse element order. */ const_reverse_iterator crbegin() const noexcept { return const_reverse_iterator(this->end()); } /** * Returns a read-only (constant) reverse iterator that points * to one before the first character in the %string. Iteration * is done in reverse element order. */ const_reverse_iterator crend() const noexcept { return const_reverse_iterator(this->begin()); } #endif # 3190 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 public: // Capacity: /// Returns the number of characters in the string, not including any /// null-termination. size_type size() const _GLIBCXX_NOEXCEPT { return _M_rep()->_M_length; } /// Returns the number of characters in the string, not including any /// null-termination. size_type length() const _GLIBCXX_NOEXCEPT { return _M_rep()->_M_length; } /// Returns the size() of the largest possible %string. size_type max_size() const _GLIBCXX_NOEXCEPT { return _Rep::_S_max_size; } /** * @brief Resizes the %string to the specified number of characters. * @param __n Number of characters the %string should contain. * @param __c Character to fill any new elements. * * This function will %resize the %string to the specified * number of characters. If the number is smaller than the * %string's current size the %string is truncated, otherwise * the %string is extended and new elements are %set to @a __c. */ void resize(size_type __n, _CharT __c); /** * @brief Resizes the %string to the specified number of characters. * @param __n Number of characters the %string should contain. * * This function will resize the %string to the specified length. If * the new size is smaller than the %string's current size the %string * is truncated, otherwise the %string is extended and new characters * are default-constructed. For basic types such as char, this means * setting them to 0. */ void resize(size_type __n) { this->resize(__n, _CharT()); } #if __cplusplus >= 201103L /// A non-binding request to reduce capacity() to size(). void shrink_to_fit() _GLIBCXX_NOEXCEPT { #if __cpp_exceptions if (capacity() > size()) { try { reserve(0); } catch(...) { } } #endif # 3251 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 } #endif # 3253 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 /** * Returns the total number of characters that the %string can hold * before needing to allocate more memory. */ size_type capacity() const _GLIBCXX_NOEXCEPT { return _M_rep()->_M_capacity; } /** * @brief Attempt to preallocate enough memory for specified number of * characters. * @param __res_arg Number of characters required. * @throw std::length_error If @a __res_arg exceeds @c max_size(). * * This function attempts to reserve enough memory for the * %string to hold the specified number of characters. If the * number requested is more than max_size(), length_error is * thrown. * * The advantage of this function is that if optimal code is a * necessity and the user can determine the string length that will be * required, the user can reserve the memory in %advance, and thus * prevent a possible reallocation of memory and copying of %string * data. */ void reserve(size_type __res_arg = 0); /** * Erases the string, making it empty. */ // PR 56166: this should not throw. void clear() { _M_mutate(0, this->size(), 0); } /** * Returns true if the %string is empty. Equivalent to * *this == "". */ bool empty() const _GLIBCXX_NOEXCEPT { return this->size() == 0; } // Element access: /** * @brief Subscript access to the data contained in the %string. * @param __pos The index of the character to access. * @return Read-only (constant) reference to the character. * * This operator allows for easy, array-style, data access. * Note that data access with this operator is unchecked and * out_of_range lookups are not defined. (For checked lookups * see at().) */ const_reference operator[] (size_type __pos) const _GLIBCXX_NOEXCEPT { _GLIBCXX_DEBUG_ASSERT(__pos <= size()); return _M_data()[__pos]; } /** * @brief Subscript access to the data contained in the %string. * @param __pos The index of the character to access. * @return Read/write reference to the character. * * This operator allows for easy, array-style, data access. * Note that data access with this operator is unchecked and * out_of_range lookups are not defined. (For checked lookups * see at().) Unshares the string. */ reference operator[](size_type __pos) { // Allow pos == size() both in C++98 mode, as v3 extension, // and in C++11 mode. _GLIBCXX_DEBUG_ASSERT(__pos <= size()); // In pedantic mode be strict in C++98 mode. _GLIBCXX_DEBUG_PEDASSERT(__cplusplus >= 201103L || __pos < size()); _M_leak(); return _M_data()[__pos]; } /** * @brief Provides access to the data contained in the %string. * @param __n The index of the character to access. * @return Read-only (const) reference to the character. * @throw std::out_of_range If @a n is an invalid index. * * This function provides for safer data access. The parameter is * first checked that it is in the range of the string. The function * throws out_of_range if the check fails. */ const_reference at(size_type __n) const { if (__n >= this->size()) __throw_out_of_range_fmt(__N("basic_string::at: __n " "(which is %zu) >= this->size() " "(which is %zu)"), __n, this->size()); return _M_data()[__n]; } /** * @brief Provides access to the data contained in the %string. * @param __n The index of the character to access. * @return Read/write reference to the character. * @throw std::out_of_range If @a n is an invalid index. * * This function provides for safer data access. The parameter is * first checked that it is in the range of the string. The function * throws out_of_range if the check fails. Success results in * unsharing the string. */ reference at(size_type __n) { if (__n >= size()) __throw_out_of_range_fmt(__N("basic_string::at: __n " "(which is %zu) >= this->size() " "(which is %zu)"), __n, this->size()); _M_leak(); return _M_data()[__n]; } #if __cplusplus >= 201103L /** * Returns a read/write reference to the data at the first * element of the %string. */ reference front() { return operator[](0); } /** * Returns a read-only (constant) reference to the data at the first * element of the %string. */ const_reference front() const _GLIBCXX_NOEXCEPT { return operator[](0); } /** * Returns a read/write reference to the data at the last * element of the %string. */ reference back() { return operator[](this->size() - 1); } /** * Returns a read-only (constant) reference to the data at the * last element of the %string. */ const_reference back() const _GLIBCXX_NOEXCEPT { return operator[](this->size() - 1); } #endif # 3415 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 // Modifiers: /** * @brief Append a string to this string. * @param __str The string to append. * @return Reference to this string. */ basic_string& operator+=(const basic_string& __str) { return this->append(__str); } /** * @brief Append a C string. * @param __s The C string to append. * @return Reference to this string. */ basic_string& operator+=(const _CharT* __s) { return this->append(__s); } /** * @brief Append a character. * @param __c The character to append. * @return Reference to this string. */ basic_string& operator+=(_CharT __c) { this->push_back(__c); return *this; } #if __cplusplus >= 201103L /** * @brief Append an initializer_list of characters. * @param __l The initializer_list of characters to be appended. * @return Reference to this string. */ basic_string& operator+=(initializer_list<_CharT> __l) { return this->append(__l.begin(), __l.size()); } #endif // C++11 # 3457 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 /** * @brief Append a string to this string. * @param __str The string to append. * @return Reference to this string. */ basic_string& append(const basic_string& __str); /** * @brief Append a substring. * @param __str The string to append. * @param __pos Index of the first character of str to append. * @param __n The number of characters to append. * @return Reference to this string. * @throw std::out_of_range if @a __pos is not a valid index. * * This function appends @a __n characters from @a __str * starting at @a __pos to this string. If @a __n is is larger * than the number of available characters in @a __str, the * remainder of @a __str is appended. */ basic_string& append(const basic_string& __str, size_type __pos, size_type __n); /** * @brief Append a C substring. * @param __s The C string to append. * @param __n The number of characters to append. * @return Reference to this string. */ basic_string& append(const _CharT* __s, size_type __n); /** * @brief Append a C string. * @param __s The C string to append. * @return Reference to this string. */ basic_string& append(const _CharT* __s) { __glibcxx_requires_string(__s); return this->append(__s, traits_type::length(__s)); } /** * @brief Append multiple characters. * @param __n The number of characters to append. * @param __c The character to use. * @return Reference to this string. * * Appends __n copies of __c to this string. */ basic_string& append(size_type __n, _CharT __c); #if __cplusplus >= 201103L /** * @brief Append an initializer_list of characters. * @param __l The initializer_list of characters to append. * @return Reference to this string. */ basic_string& append(initializer_list<_CharT> __l) { return this->append(__l.begin(), __l.size()); } #endif // C++11 # 3524 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 /** * @brief Append a range of characters. * @param __first Iterator referencing the first character to append. * @param __last Iterator marking the end of the range. * @return Reference to this string. * * Appends characters in the range [__first,__last) to this string. */ template basic_string& append(_InputIterator __first, _InputIterator __last) { return this->replace(_M_iend(), _M_iend(), __first, __last); } /** * @brief Append a single character. * @param __c Character to append. */ void push_back(_CharT __c) { const size_type __len = 1 + this->size(); if (__len > this->capacity() || _M_rep()->_M_is_shared()) this->reserve(__len); traits_type::assign(_M_data()[this->size()], __c); _M_rep()->_M_set_length_and_sharable(__len); } /** * @brief Set value to contents of another string. * @param __str Source string to use. * @return Reference to this string. */ basic_string& assign(const basic_string& __str); #if __cplusplus >= 201103L /** * @brief Set value to contents of another string. * @param __str Source string to use. * @return Reference to this string. * * This function sets this string to the exact contents of @a __str. * @a __str is a valid, but unspecified string. */ // PR 58265, this should be noexcept. basic_string& assign(basic_string&& __str) { this->swap(__str); return *this; } #endif // C++11 # 3577 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 /** * @brief Set value to a substring of a string. * @param __str The string to use. * @param __pos Index of the first character of str. * @param __n Number of characters to use. * @return Reference to this string. * @throw std::out_of_range if @a pos is not a valid index. * * This function sets this string to the substring of @a __str * consisting of @a __n characters at @a __pos. If @a __n is * is larger than the number of available characters in @a * __str, the remainder of @a __str is used. */ basic_string& assign(const basic_string& __str, size_type __pos, size_type __n) { return this->assign(__str._M_data() + __str._M_check(__pos, "basic_string::assign"), __str._M_limit(__pos, __n)); } /** * @brief Set value to a C substring. * @param __s The C string to use. * @param __n Number of characters to use. * @return Reference to this string. * * This function sets the value of this string to the first @a __n * characters of @a __s. If @a __n is is larger than the number of * available characters in @a __s, the remainder of @a __s is used. */ basic_string& assign(const _CharT* __s, size_type __n); /** * @brief Set value to contents of a C string. * @param __s The C string to use. * @return Reference to this string. * * This function sets the value of this string to the value of @a __s. * The data is copied, so there is no dependence on @a __s once the * function returns. */ basic_string& assign(const _CharT* __s) { __glibcxx_requires_string(__s); return this->assign(__s, traits_type::length(__s)); } /** * @brief Set value to multiple characters. * @param __n Length of the resulting string. * @param __c The character to use. * @return Reference to this string. * * This function sets the value of this string to @a __n copies of * character @a __c. */ basic_string& assign(size_type __n, _CharT __c) { return _M_replace_aux(size_type(0), this->size(), __n, __c); } /** * @brief Set value to a range of characters. * @param __first Iterator referencing the first character to append. * @param __last Iterator marking the end of the range. * @return Reference to this string. * * Sets value of string to characters in the range [__first,__last). */ template basic_string& assign(_InputIterator __first, _InputIterator __last) { return this->replace(_M_ibegin(), _M_iend(), __first, __last); } #if __cplusplus >= 201103L /** * @brief Set value to an initializer_list of characters. * @param __l The initializer_list of characters to assign. * @return Reference to this string. */ basic_string& assign(initializer_list<_CharT> __l) { return this->assign(__l.begin(), __l.size()); } #endif // C++11 # 3662 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 /** * @brief Insert multiple characters. * @param __p Iterator referencing location in string to insert at. * @param __n Number of characters to insert * @param __c The character to insert. * @throw std::length_error If new length exceeds @c max_size(). * * Inserts @a __n copies of character @a __c starting at the * position referenced by iterator @a __p. If adding * characters causes the length to exceed max_size(), * length_error is thrown. The value of the string doesn't * change if an error is thrown. */ void insert(iterator __p, size_type __n, _CharT __c) { this->replace(__p, __p, __n, __c); } /** * @brief Insert a range of characters. * @param __p Iterator referencing location in string to insert at. * @param __beg Start of range. * @param __end End of range. * @throw std::length_error If new length exceeds @c max_size(). * * Inserts characters in range [__beg,__end). If adding * characters causes the length to exceed max_size(), * length_error is thrown. The value of the string doesn't * change if an error is thrown. */ template void insert(iterator __p, _InputIterator __beg, _InputIterator __end) { this->replace(__p, __p, __beg, __end); } #if __cplusplus >= 201103L /** * @brief Insert an initializer_list of characters. * @param __p Iterator referencing location in string to insert at. * @param __l The initializer_list of characters to insert. * @throw std::length_error If new length exceeds @c max_size(). */ void insert(iterator __p, initializer_list<_CharT> __l) { _GLIBCXX_DEBUG_PEDASSERT(__p >= _M_ibegin() && __p <= _M_iend()); this->insert(__p - _M_ibegin(), __l.begin(), __l.size()); } #endif // C++11 # 3711 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 /** * @brief Insert value of a string. * @param __pos1 Iterator referencing location in string to insert at. * @param __str The string to insert. * @return Reference to this string. * @throw std::length_error If new length exceeds @c max_size(). * * Inserts value of @a __str starting at @a __pos1. If adding * characters causes the length to exceed max_size(), * length_error is thrown. The value of the string doesn't * change if an error is thrown. */ basic_string& insert(size_type __pos1, const basic_string& __str) { return this->insert(__pos1, __str, size_type(0), __str.size()); } /** * @brief Insert a substring. * @param __pos1 Iterator referencing location in string to insert at. * @param __str The string to insert. * @param __pos2 Start of characters in str to insert. * @param __n Number of characters to insert. * @return Reference to this string. * @throw std::length_error If new length exceeds @c max_size(). * @throw std::out_of_range If @a pos1 > size() or * @a __pos2 > @a str.size(). * * Starting at @a pos1, insert @a __n character of @a __str * beginning with @a __pos2. If adding characters causes the * length to exceed max_size(), length_error is thrown. If @a * __pos1 is beyond the end of this string or @a __pos2 is * beyond the end of @a __str, out_of_range is thrown. The * value of the string doesn't change if an error is thrown. */ basic_string& insert(size_type __pos1, const basic_string& __str, size_type __pos2, size_type __n) { return this->insert(__pos1, __str._M_data() + __str._M_check(__pos2, "basic_string::insert"), __str._M_limit(__pos2, __n)); } /** * @brief Insert a C substring. * @param __pos Iterator referencing location in string to insert at. * @param __s The C string to insert. * @param __n The number of characters to insert. * @return Reference to this string. * @throw std::length_error If new length exceeds @c max_size(). * @throw std::out_of_range If @a __pos is beyond the end of this * string. * * Inserts the first @a __n characters of @a __s starting at @a * __pos. If adding characters causes the length to exceed * max_size(), length_error is thrown. If @a __pos is beyond * end(), out_of_range is thrown. The value of the string * doesn't change if an error is thrown. */ basic_string& insert(size_type __pos, const _CharT* __s, size_type __n); /** * @brief Insert a C string. * @param __pos Iterator referencing location in string to insert at. * @param __s The C string to insert. * @return Reference to this string. * @throw std::length_error If new length exceeds @c max_size(). * @throw std::out_of_range If @a pos is beyond the end of this * string. * * Inserts the first @a n characters of @a __s starting at @a __pos. If * adding characters causes the length to exceed max_size(), * length_error is thrown. If @a __pos is beyond end(), out_of_range is * thrown. The value of the string doesn't change if an error is * thrown. */ basic_string& insert(size_type __pos, const _CharT* __s) { __glibcxx_requires_string(__s); return this->insert(__pos, __s, traits_type::length(__s)); } /** * @brief Insert multiple characters. * @param __pos Index in string to insert at. * @param __n Number of characters to insert * @param __c The character to insert. * @return Reference to this string. * @throw std::length_error If new length exceeds @c max_size(). * @throw std::out_of_range If @a __pos is beyond the end of this * string. * * Inserts @a __n copies of character @a __c starting at index * @a __pos. If adding characters causes the length to exceed * max_size(), length_error is thrown. If @a __pos > length(), * out_of_range is thrown. The value of the string doesn't * change if an error is thrown. */ basic_string& insert(size_type __pos, size_type __n, _CharT __c) { return _M_replace_aux(_M_check(__pos, "basic_string::insert"), size_type(0), __n, __c); } /** * @brief Insert one character. * @param __p Iterator referencing position in string to insert at. * @param __c The character to insert. * @return Iterator referencing newly inserted char. * @throw std::length_error If new length exceeds @c max_size(). * * Inserts character @a __c at position referenced by @a __p. * If adding character causes the length to exceed max_size(), * length_error is thrown. If @a __p is beyond end of string, * out_of_range is thrown. The value of the string doesn't * change if an error is thrown. */ iterator insert(iterator __p, _CharT __c) { _GLIBCXX_DEBUG_PEDASSERT(__p >= _M_ibegin() && __p <= _M_iend()); const size_type __pos = __p - _M_ibegin(); _M_replace_aux(__pos, size_type(0), size_type(1), __c); _M_rep()->_M_set_leaked(); return iterator(_M_data() + __pos); } /** * @brief Remove characters. * @param __pos Index of first character to remove (default 0). * @param __n Number of characters to remove (default remainder). * @return Reference to this string. * @throw std::out_of_range If @a pos is beyond the end of this * string. * * Removes @a __n characters from this string starting at @a * __pos. The length of the string is reduced by @a __n. If * there are < @a __n characters to remove, the remainder of * the string is truncated. If @a __p is beyond end of string, * out_of_range is thrown. The value of the string doesn't * change if an error is thrown. */ basic_string& erase(size_type __pos = 0, size_type __n = npos) { _M_mutate(_M_check(__pos, "basic_string::erase"), _M_limit(__pos, __n), size_type(0)); return *this; } /** * @brief Remove one character. * @param __position Iterator referencing the character to remove. * @return iterator referencing same location after removal. * * Removes the character at @a __position from this string. The value * of the string doesn't change if an error is thrown. */ iterator erase(iterator __position) { _GLIBCXX_DEBUG_PEDASSERT(__position >= _M_ibegin() && __position < _M_iend()); const size_type __pos = __position - _M_ibegin(); _M_mutate(__pos, size_type(1), size_type(0)); _M_rep()->_M_set_leaked(); return iterator(_M_data() + __pos); } /** * @brief Remove a range of characters. * @param __first Iterator referencing the first character to remove. * @param __last Iterator referencing the end of the range. * @return Iterator referencing location of first after removal. * * Removes the characters in the range [first,last) from this string. * The value of the string doesn't change if an error is thrown. */ iterator erase(iterator __first, iterator __last); #if __cplusplus >= 201103L /** * @brief Remove the last character. * * The string must be non-empty. */ void pop_back() // FIXME C++11: should be noexcept. { erase(size()-1, 1); } #endif // C++11 # 3902 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 /** * @brief Replace characters with value from another string. * @param __pos Index of first character to replace. * @param __n Number of characters to be replaced. * @param __str String to insert. * @return Reference to this string. * @throw std::out_of_range If @a pos is beyond the end of this * string. * @throw std::length_error If new length exceeds @c max_size(). * * Removes the characters in the range [__pos,__pos+__n) from * this string. In place, the value of @a __str is inserted. * If @a __pos is beyond end of string, out_of_range is thrown. * If the length of the result exceeds max_size(), length_error * is thrown. The value of the string doesn't change if an * error is thrown. */ basic_string& replace(size_type __pos, size_type __n, const basic_string& __str) { return this->replace(__pos, __n, __str._M_data(), __str.size()); } /** * @brief Replace characters with value from another string. * @param __pos1 Index of first character to replace. * @param __n1 Number of characters to be replaced. * @param __str String to insert. * @param __pos2 Index of first character of str to use. * @param __n2 Number of characters from str to use. * @return Reference to this string. * @throw std::out_of_range If @a __pos1 > size() or @a __pos2 > * __str.size(). * @throw std::length_error If new length exceeds @c max_size(). * * Removes the characters in the range [__pos1,__pos1 + n) from this * string. In place, the value of @a __str is inserted. If @a __pos is * beyond end of string, out_of_range is thrown. If the length of the * result exceeds max_size(), length_error is thrown. The value of the * string doesn't change if an error is thrown. */ basic_string& replace(size_type __pos1, size_type __n1, const basic_string& __str, size_type __pos2, size_type __n2) { return this->replace(__pos1, __n1, __str._M_data() + __str._M_check(__pos2, "basic_string::replace"), __str._M_limit(__pos2, __n2)); } /** * @brief Replace characters with value of a C substring. * @param __pos Index of first character to replace. * @param __n1 Number of characters to be replaced. * @param __s C string to insert. * @param __n2 Number of characters from @a s to use. * @return Reference to this string. * @throw std::out_of_range If @a pos1 > size(). * @throw std::length_error If new length exceeds @c max_size(). * * Removes the characters in the range [__pos,__pos + __n1) * from this string. In place, the first @a __n2 characters of * @a __s are inserted, or all of @a __s if @a __n2 is too large. If * @a __pos is beyond end of string, out_of_range is thrown. If * the length of result exceeds max_size(), length_error is * thrown. The value of the string doesn't change if an error * is thrown. */ basic_string& replace(size_type __pos, size_type __n1, const _CharT* __s, size_type __n2); /** * @brief Replace characters with value of a C string. * @param __pos Index of first character to replace. * @param __n1 Number of characters to be replaced. * @param __s C string to insert. * @return Reference to this string. * @throw std::out_of_range If @a pos > size(). * @throw std::length_error If new length exceeds @c max_size(). * * Removes the characters in the range [__pos,__pos + __n1) * from this string. In place, the characters of @a __s are * inserted. If @a __pos is beyond end of string, out_of_range * is thrown. If the length of result exceeds max_size(), * length_error is thrown. The value of the string doesn't * change if an error is thrown. */ basic_string& replace(size_type __pos, size_type __n1, const _CharT* __s) { __glibcxx_requires_string(__s); return this->replace(__pos, __n1, __s, traits_type::length(__s)); } /** * @brief Replace characters with multiple characters. * @param __pos Index of first character to replace. * @param __n1 Number of characters to be replaced. * @param __n2 Number of characters to insert. * @param __c Character to insert. * @return Reference to this string. * @throw std::out_of_range If @a __pos > size(). * @throw std::length_error If new length exceeds @c max_size(). * * Removes the characters in the range [pos,pos + n1) from this * string. In place, @a __n2 copies of @a __c are inserted. * If @a __pos is beyond end of string, out_of_range is thrown. * If the length of result exceeds max_size(), length_error is * thrown. The value of the string doesn't change if an error * is thrown. */ basic_string& replace(size_type __pos, size_type __n1, size_type __n2, _CharT __c) { return _M_replace_aux(_M_check(__pos, "basic_string::replace"), _M_limit(__pos, __n1), __n2, __c); } /** * @brief Replace range of characters with string. * @param __i1 Iterator referencing start of range to replace. * @param __i2 Iterator referencing end of range to replace. * @param __str String value to insert. * @return Reference to this string. * @throw std::length_error If new length exceeds @c max_size(). * * Removes the characters in the range [__i1,__i2). In place, * the value of @a __str is inserted. If the length of result * exceeds max_size(), length_error is thrown. The value of * the string doesn't change if an error is thrown. */ basic_string& replace(iterator __i1, iterator __i2, const basic_string& __str) { return this->replace(__i1, __i2, __str._M_data(), __str.size()); } /** * @brief Replace range of characters with C substring. * @param __i1 Iterator referencing start of range to replace. * @param __i2 Iterator referencing end of range to replace. * @param __s C string value to insert. * @param __n Number of characters from s to insert. * @return Reference to this string. * @throw std::length_error If new length exceeds @c max_size(). * * Removes the characters in the range [__i1,__i2). In place, * the first @a __n characters of @a __s are inserted. If the * length of result exceeds max_size(), length_error is thrown. * The value of the string doesn't change if an error is * thrown. */ basic_string& replace(iterator __i1, iterator __i2, const _CharT* __s, size_type __n) { _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2 && __i2 <= _M_iend()); return this->replace(__i1 - _M_ibegin(), __i2 - __i1, __s, __n); } /** * @brief Replace range of characters with C string. * @param __i1 Iterator referencing start of range to replace. * @param __i2 Iterator referencing end of range to replace. * @param __s C string value to insert. * @return Reference to this string. * @throw std::length_error If new length exceeds @c max_size(). * * Removes the characters in the range [__i1,__i2). In place, * the characters of @a __s are inserted. If the length of * result exceeds max_size(), length_error is thrown. The * value of the string doesn't change if an error is thrown. */ basic_string& replace(iterator __i1, iterator __i2, const _CharT* __s) { __glibcxx_requires_string(__s); return this->replace(__i1, __i2, __s, traits_type::length(__s)); } /** * @brief Replace range of characters with multiple characters * @param __i1 Iterator referencing start of range to replace. * @param __i2 Iterator referencing end of range to replace. * @param __n Number of characters to insert. * @param __c Character to insert. * @return Reference to this string. * @throw std::length_error If new length exceeds @c max_size(). * * Removes the characters in the range [__i1,__i2). In place, * @a __n copies of @a __c are inserted. If the length of * result exceeds max_size(), length_error is thrown. The * value of the string doesn't change if an error is thrown. */ basic_string& replace(iterator __i1, iterator __i2, size_type __n, _CharT __c) { _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2 && __i2 <= _M_iend()); return _M_replace_aux(__i1 - _M_ibegin(), __i2 - __i1, __n, __c); } /** * @brief Replace range of characters with range. * @param __i1 Iterator referencing start of range to replace. * @param __i2 Iterator referencing end of range to replace. * @param __k1 Iterator referencing start of range to insert. * @param __k2 Iterator referencing end of range to insert. * @return Reference to this string. * @throw std::length_error If new length exceeds @c max_size(). * * Removes the characters in the range [__i1,__i2). In place, * characters in the range [__k1,__k2) are inserted. If the * length of result exceeds max_size(), length_error is thrown. * The value of the string doesn't change if an error is * thrown. */ template basic_string& replace(iterator __i1, iterator __i2, _InputIterator __k1, _InputIterator __k2) { _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2 && __i2 <= _M_iend()); __glibcxx_requires_valid_range(__k1, __k2); typedef typename std::__is_integer<_InputIterator>::__type _Integral; return _M_replace_dispatch(__i1, __i2, __k1, __k2, _Integral()); } // Specializations for the common case of pointer and iterator: // useful to avoid the overhead of temporary buffering in _M_replace. basic_string& replace(iterator __i1, iterator __i2, _CharT* __k1, _CharT* __k2) { _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2 && __i2 <= _M_iend()); __glibcxx_requires_valid_range(__k1, __k2); return this->replace(__i1 - _M_ibegin(), __i2 - __i1, __k1, __k2 - __k1); } basic_string& replace(iterator __i1, iterator __i2, const _CharT* __k1, const _CharT* __k2) { _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2 && __i2 <= _M_iend()); __glibcxx_requires_valid_range(__k1, __k2); return this->replace(__i1 - _M_ibegin(), __i2 - __i1, __k1, __k2 - __k1); } basic_string& replace(iterator __i1, iterator __i2, iterator __k1, iterator __k2) { _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2 && __i2 <= _M_iend()); __glibcxx_requires_valid_range(__k1, __k2); return this->replace(__i1 - _M_ibegin(), __i2 - __i1, __k1.base(), __k2 - __k1); } basic_string& replace(iterator __i1, iterator __i2, const_iterator __k1, const_iterator __k2) { _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2 && __i2 <= _M_iend()); __glibcxx_requires_valid_range(__k1, __k2); return this->replace(__i1 - _M_ibegin(), __i2 - __i1, __k1.base(), __k2 - __k1); } #if __cplusplus >= 201103L /** * @brief Replace range of characters with initializer_list. * @param __i1 Iterator referencing start of range to replace. * @param __i2 Iterator referencing end of range to replace. * @param __l The initializer_list of characters to insert. * @return Reference to this string. * @throw std::length_error If new length exceeds @c max_size(). * * Removes the characters in the range [__i1,__i2). In place, * characters in the range [__k1,__k2) are inserted. If the * length of result exceeds max_size(), length_error is thrown. * The value of the string doesn't change if an error is * thrown. */ basic_string& replace(iterator __i1, iterator __i2, initializer_list<_CharT> __l) { return this->replace(__i1, __i2, __l.begin(), __l.end()); } #endif // C++11 # 4188 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 private: template basic_string& _M_replace_dispatch(iterator __i1, iterator __i2, _Integer __n, _Integer __val, __true_type) { return _M_replace_aux(__i1 - _M_ibegin(), __i2 - __i1, __n, __val); } template basic_string& _M_replace_dispatch(iterator __i1, iterator __i2, _InputIterator __k1, _InputIterator __k2, __false_type); basic_string& _M_replace_aux(size_type __pos1, size_type __n1, size_type __n2, _CharT __c); basic_string& _M_replace_safe(size_type __pos1, size_type __n1, const _CharT* __s, size_type __n2); // _S_construct_aux is used to implement the 21.3.1 para 15 which // requires special behaviour if _InIter is an integral type template static _CharT* _S_construct_aux(_InIterator __beg, _InIterator __end, const _Alloc& __a, __false_type) { typedef typename iterator_traits<_InIterator>::iterator_category _Tag; return _S_construct(__beg, __end, __a, _Tag()); } // _GLIBCXX_RESOLVE_LIB_DEFECTS // 438. Ambiguity in the "do the right thing" clause template static _CharT* _S_construct_aux(_Integer __beg, _Integer __end, const _Alloc& __a, __true_type) { return _S_construct_aux_2(static_cast(__beg), __end, __a); } static _CharT* _S_construct_aux_2(size_type __req, _CharT __c, const _Alloc& __a) { return _S_construct(__req, __c, __a); } template static _CharT* _S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a) { typedef typename std::__is_integer<_InIterator>::__type _Integral; return _S_construct_aux(__beg, __end, __a, _Integral()); } // For Input Iterators, used in istreambuf_iterators, etc. template static _CharT* _S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a, input_iterator_tag); // For forward_iterators up to random_access_iterators, used for // string::iterator, _CharT*, etc. template static _CharT* _S_construct(_FwdIterator __beg, _FwdIterator __end, const _Alloc& __a, forward_iterator_tag); static _CharT* _S_construct(size_type __req, _CharT __c, const _Alloc& __a); public: /** * @brief Copy substring into C string. * @param __s C string to copy value into. * @param __n Number of characters to copy. * @param __pos Index of first character to copy. * @return Number of characters actually copied * @throw std::out_of_range If __pos > size(). * * Copies up to @a __n characters starting at @a __pos into the * C string @a __s. If @a __pos is %greater than size(), * out_of_range is thrown. */ size_type copy(_CharT* __s, size_type __n, size_type __pos = 0) const; /** * @brief Swap contents with another string. * @param __s String to swap with. * * Exchanges the contents of this string with that of @a __s in constant * time. */ // PR 58265, this should be noexcept. void swap(basic_string& __s); // String operations: /** * @brief Return const pointer to null-terminated contents. * * This is a handle to internal data. Do not modify or dire things may * happen. */ const _CharT* c_str() const _GLIBCXX_NOEXCEPT { return _M_data(); } /** * @brief Return const pointer to contents. * * This is a handle to internal data. Do not modify or dire things may * happen. */ const _CharT* data() const _GLIBCXX_NOEXCEPT { return _M_data(); } /** * @brief Return copy of allocator used to construct this string. */ allocator_type get_allocator() const _GLIBCXX_NOEXCEPT { return _M_dataplus; } /** * @brief Find position of a C substring. * @param __s C string to locate. * @param __pos Index of character to search from. * @param __n Number of characters from @a s to search for. * @return Index of start of first occurrence. * * Starting from @a __pos, searches forward for the first @a * __n characters in @a __s within this string. If found, * returns the index where it begins. If not found, returns * npos. */ size_type find(const _CharT* __s, size_type __pos, size_type __n) const; /** * @brief Find position of a string. * @param __str String to locate. * @param __pos Index of character to search from (default 0). * @return Index of start of first occurrence. * * Starting from @a __pos, searches forward for value of @a __str within * this string. If found, returns the index where it begins. If not * found, returns npos. */ size_type find(const basic_string& __str, size_type __pos = 0) const _GLIBCXX_NOEXCEPT { return this->find(__str.data(), __pos, __str.size()); } /** * @brief Find position of a C string. * @param __s C string to locate. * @param __pos Index of character to search from (default 0). * @return Index of start of first occurrence. * * Starting from @a __pos, searches forward for the value of @a * __s within this string. If found, returns the index where * it begins. If not found, returns npos. */ size_type find(const _CharT* __s, size_type __pos = 0) const { __glibcxx_requires_string(__s); return this->find(__s, __pos, traits_type::length(__s)); } /** * @brief Find position of a character. * @param __c Character to locate. * @param __pos Index of character to search from (default 0). * @return Index of first occurrence. * * Starting from @a __pos, searches forward for @a __c within * this string. If found, returns the index where it was * found. If not found, returns npos. */ size_type find(_CharT __c, size_type __pos = 0) const _GLIBCXX_NOEXCEPT; /** * @brief Find last position of a string. * @param __str String to locate. * @param __pos Index of character to search back from (default end). * @return Index of start of last occurrence. * * Starting from @a __pos, searches backward for value of @a * __str within this string. If found, returns the index where * it begins. If not found, returns npos. */ size_type rfind(const basic_string& __str, size_type __pos = npos) const _GLIBCXX_NOEXCEPT { return this->rfind(__str.data(), __pos, __str.size()); } /** * @brief Find last position of a C substring. * @param __s C string to locate. * @param __pos Index of character to search back from. * @param __n Number of characters from s to search for. * @return Index of start of last occurrence. * * Starting from @a __pos, searches backward for the first @a * __n characters in @a __s within this string. If found, * returns the index where it begins. If not found, returns * npos. */ size_type rfind(const _CharT* __s, size_type __pos, size_type __n) const; /** * @brief Find last position of a C string. * @param __s C string to locate. * @param __pos Index of character to start search at (default end). * @return Index of start of last occurrence. * * Starting from @a __pos, searches backward for the value of * @a __s within this string. If found, returns the index * where it begins. If not found, returns npos. */ size_type rfind(const _CharT* __s, size_type __pos = npos) const { __glibcxx_requires_string(__s); return this->rfind(__s, __pos, traits_type::length(__s)); } /** * @brief Find last position of a character. * @param __c Character to locate. * @param __pos Index of character to search back from (default end). * @return Index of last occurrence. * * Starting from @a __pos, searches backward for @a __c within * this string. If found, returns the index where it was * found. If not found, returns npos. */ size_type rfind(_CharT __c, size_type __pos = npos) const _GLIBCXX_NOEXCEPT; /** * @brief Find position of a character of string. * @param __str String containing characters to locate. * @param __pos Index of character to search from (default 0). * @return Index of first occurrence. * * Starting from @a __pos, searches forward for one of the * characters of @a __str within this string. If found, * returns the index where it was found. If not found, returns * npos. */ size_type find_first_of(const basic_string& __str, size_type __pos = 0) const _GLIBCXX_NOEXCEPT { return this->find_first_of(__str.data(), __pos, __str.size()); } /** * @brief Find position of a character of C substring. * @param __s String containing characters to locate. * @param __pos Index of character to search from. * @param __n Number of characters from s to search for. * @return Index of first occurrence. * * Starting from @a __pos, searches forward for one of the * first @a __n characters of @a __s within this string. If * found, returns the index where it was found. If not found, * returns npos. */ size_type find_first_of(const _CharT* __s, size_type __pos, size_type __n) const; /** * @brief Find position of a character of C string. * @param __s String containing characters to locate. * @param __pos Index of character to search from (default 0). * @return Index of first occurrence. * * Starting from @a __pos, searches forward for one of the * characters of @a __s within this string. If found, returns * the index where it was found. If not found, returns npos. */ size_type find_first_of(const _CharT* __s, size_type __pos = 0) const { __glibcxx_requires_string(__s); return this->find_first_of(__s, __pos, traits_type::length(__s)); } /** * @brief Find position of a character. * @param __c Character to locate. * @param __pos Index of character to search from (default 0). * @return Index of first occurrence. * * Starting from @a __pos, searches forward for the character * @a __c within this string. If found, returns the index * where it was found. If not found, returns npos. * * Note: equivalent to find(__c, __pos). */ size_type find_first_of(_CharT __c, size_type __pos = 0) const _GLIBCXX_NOEXCEPT { return this->find(__c, __pos); } /** * @brief Find last position of a character of string. * @param __str String containing characters to locate. * @param __pos Index of character to search back from (default end). * @return Index of last occurrence. * * Starting from @a __pos, searches backward for one of the * characters of @a __str within this string. If found, * returns the index where it was found. If not found, returns * npos. */ size_type find_last_of(const basic_string& __str, size_type __pos = npos) const _GLIBCXX_NOEXCEPT { return this->find_last_of(__str.data(), __pos, __str.size()); } /** * @brief Find last position of a character of C substring. * @param __s C string containing characters to locate. * @param __pos Index of character to search back from. * @param __n Number of characters from s to search for. * @return Index of last occurrence. * * Starting from @a __pos, searches backward for one of the * first @a __n characters of @a __s within this string. If * found, returns the index where it was found. If not found, * returns npos. */ size_type find_last_of(const _CharT* __s, size_type __pos, size_type __n) const; /** * @brief Find last position of a character of C string. * @param __s C string containing characters to locate. * @param __pos Index of character to search back from (default end). * @return Index of last occurrence. * * Starting from @a __pos, searches backward for one of the * characters of @a __s within this string. If found, returns * the index where it was found. If not found, returns npos. */ size_type find_last_of(const _CharT* __s, size_type __pos = npos) const { __glibcxx_requires_string(__s); return this->find_last_of(__s, __pos, traits_type::length(__s)); } /** * @brief Find last position of a character. * @param __c Character to locate. * @param __pos Index of character to search back from (default end). * @return Index of last occurrence. * * Starting from @a __pos, searches backward for @a __c within * this string. If found, returns the index where it was * found. If not found, returns npos. * * Note: equivalent to rfind(__c, __pos). */ size_type find_last_of(_CharT __c, size_type __pos = npos) const _GLIBCXX_NOEXCEPT { return this->rfind(__c, __pos); } /** * @brief Find position of a character not in string. * @param __str String containing characters to avoid. * @param __pos Index of character to search from (default 0). * @return Index of first occurrence. * * Starting from @a __pos, searches forward for a character not contained * in @a __str within this string. If found, returns the index where it * was found. If not found, returns npos. */ size_type find_first_not_of(const basic_string& __str, size_type __pos = 0) const _GLIBCXX_NOEXCEPT { return this->find_first_not_of(__str.data(), __pos, __str.size()); } /** * @brief Find position of a character not in C substring. * @param __s C string containing characters to avoid. * @param __pos Index of character to search from. * @param __n Number of characters from __s to consider. * @return Index of first occurrence. * * Starting from @a __pos, searches forward for a character not * contained in the first @a __n characters of @a __s within * this string. If found, returns the index where it was * found. If not found, returns npos. */ size_type find_first_not_of(const _CharT* __s, size_type __pos, size_type __n) const; /** * @brief Find position of a character not in C string. * @param __s C string containing characters to avoid. * @param __pos Index of character to search from (default 0). * @return Index of first occurrence. * * Starting from @a __pos, searches forward for a character not * contained in @a __s within this string. If found, returns * the index where it was found. If not found, returns npos. */ size_type find_first_not_of(const _CharT* __s, size_type __pos = 0) const { __glibcxx_requires_string(__s); return this->find_first_not_of(__s, __pos, traits_type::length(__s)); } /** * @brief Find position of a different character. * @param __c Character to avoid. * @param __pos Index of character to search from (default 0). * @return Index of first occurrence. * * Starting from @a __pos, searches forward for a character * other than @a __c within this string. If found, returns the * index where it was found. If not found, returns npos. */ size_type find_first_not_of(_CharT __c, size_type __pos = 0) const _GLIBCXX_NOEXCEPT; /** * @brief Find last position of a character not in string. * @param __str String containing characters to avoid. * @param __pos Index of character to search back from (default end). * @return Index of last occurrence. * * Starting from @a __pos, searches backward for a character * not contained in @a __str within this string. If found, * returns the index where it was found. If not found, returns * npos. */ size_type find_last_not_of(const basic_string& __str, size_type __pos = npos) const _GLIBCXX_NOEXCEPT { return this->find_last_not_of(__str.data(), __pos, __str.size()); } /** * @brief Find last position of a character not in C substring. * @param __s C string containing characters to avoid. * @param __pos Index of character to search back from. * @param __n Number of characters from s to consider. * @return Index of last occurrence. * * Starting from @a __pos, searches backward for a character not * contained in the first @a __n characters of @a __s within this string. * If found, returns the index where it was found. If not found, * returns npos. */ size_type find_last_not_of(const _CharT* __s, size_type __pos, size_type __n) const; /** * @brief Find last position of a character not in C string. * @param __s C string containing characters to avoid. * @param __pos Index of character to search back from (default end). * @return Index of last occurrence. * * Starting from @a __pos, searches backward for a character * not contained in @a __s within this string. If found, * returns the index where it was found. If not found, returns * npos. */ size_type find_last_not_of(const _CharT* __s, size_type __pos = npos) const { __glibcxx_requires_string(__s); return this->find_last_not_of(__s, __pos, traits_type::length(__s)); } /** * @brief Find last position of a different character. * @param __c Character to avoid. * @param __pos Index of character to search back from (default end). * @return Index of last occurrence. * * Starting from @a __pos, searches backward for a character other than * @a __c within this string. If found, returns the index where it was * found. If not found, returns npos. */ size_type find_last_not_of(_CharT __c, size_type __pos = npos) const _GLIBCXX_NOEXCEPT; /** * @brief Get a substring. * @param __pos Index of first character (default 0). * @param __n Number of characters in substring (default remainder). * @return The new string. * @throw std::out_of_range If __pos > size(). * * Construct and return a new string using the @a __n * characters starting at @a __pos. If the string is too * short, use the remainder of the characters. If @a __pos is * beyond the end of the string, out_of_range is thrown. */ basic_string substr(size_type __pos = 0, size_type __n = npos) const { return basic_string(*this, _M_check(__pos, "basic_string::substr"), __n); } /** * @brief Compare to a string. * @param __str String to compare against. * @return Integer < 0, 0, or > 0. * * Returns an integer < 0 if this string is ordered before @a * __str, 0 if their values are equivalent, or > 0 if this * string is ordered after @a __str. Determines the effective * length rlen of the strings to compare as the smallest of * size() and str.size(). The function then compares the two * strings by calling traits::compare(data(), str.data(),rlen). * If the result of the comparison is nonzero returns it, * otherwise the shorter one is ordered first. */ int compare(const basic_string& __str) const { const size_type __size = this->size(); const size_type __osize = __str.size(); const size_type __len = std::min(__size, __osize); int __r = traits_type::compare(_M_data(), __str.data(), __len); if (!__r) __r = _S_compare(__size, __osize); return __r; } /** * @brief Compare substring to a string. * @param __pos Index of first character of substring. * @param __n Number of characters in substring. * @param __str String to compare against. * @return Integer < 0, 0, or > 0. * * Form the substring of this string from the @a __n characters * starting at @a __pos. Returns an integer < 0 if the * substring is ordered before @a __str, 0 if their values are * equivalent, or > 0 if the substring is ordered after @a * __str. Determines the effective length rlen of the strings * to compare as the smallest of the length of the substring * and @a __str.size(). The function then compares the two * strings by calling * traits::compare(substring.data(),str.data(),rlen). If the * result of the comparison is nonzero returns it, otherwise * the shorter one is ordered first. */ int compare(size_type __pos, size_type __n, const basic_string& __str) const; /** * @brief Compare substring to a substring. * @param __pos1 Index of first character of substring. * @param __n1 Number of characters in substring. * @param __str String to compare against. * @param __pos2 Index of first character of substring of str. * @param __n2 Number of characters in substring of str. * @return Integer < 0, 0, or > 0. * * Form the substring of this string from the @a __n1 * characters starting at @a __pos1. Form the substring of @a * __str from the @a __n2 characters starting at @a __pos2. * Returns an integer < 0 if this substring is ordered before * the substring of @a __str, 0 if their values are equivalent, * or > 0 if this substring is ordered after the substring of * @a __str. Determines the effective length rlen of the * strings to compare as the smallest of the lengths of the * substrings. The function then compares the two strings by * calling * traits::compare(substring.data(),str.substr(pos2,n2).data(),rlen). * If the result of the comparison is nonzero returns it, * otherwise the shorter one is ordered first. */ int compare(size_type __pos1, size_type __n1, const basic_string& __str, size_type __pos2, size_type __n2) const; /** * @brief Compare to a C string. * @param __s C string to compare against. * @return Integer < 0, 0, or > 0. * * Returns an integer < 0 if this string is ordered before @a __s, 0 if * their values are equivalent, or > 0 if this string is ordered after * @a __s. Determines the effective length rlen of the strings to * compare as the smallest of size() and the length of a string * constructed from @a __s. The function then compares the two strings * by calling traits::compare(data(),s,rlen). If the result of the * comparison is nonzero returns it, otherwise the shorter one is * ordered first. */ int compare(const _CharT* __s) const; // _GLIBCXX_RESOLVE_LIB_DEFECTS // 5 String::compare specification questionable /** * @brief Compare substring to a C string. * @param __pos Index of first character of substring. * @param __n1 Number of characters in substring. * @param __s C string to compare against. * @return Integer < 0, 0, or > 0. * * Form the substring of this string from the @a __n1 * characters starting at @a pos. Returns an integer < 0 if * the substring is ordered before @a __s, 0 if their values * are equivalent, or > 0 if the substring is ordered after @a * __s. Determines the effective length rlen of the strings to * compare as the smallest of the length of the substring and * the length of a string constructed from @a __s. The * function then compares the two string by calling * traits::compare(substring.data(),__s,rlen). If the result of * the comparison is nonzero returns it, otherwise the shorter * one is ordered first. */ int compare(size_type __pos, size_type __n1, const _CharT* __s) const; /** * @brief Compare substring against a character %array. * @param __pos Index of first character of substring. * @param __n1 Number of characters in substring. * @param __s character %array to compare against. * @param __n2 Number of characters of s. * @return Integer < 0, 0, or > 0. * * Form the substring of this string from the @a __n1 * characters starting at @a __pos. Form a string from the * first @a __n2 characters of @a __s. Returns an integer < 0 * if this substring is ordered before the string from @a __s, * 0 if their values are equivalent, or > 0 if this substring * is ordered after the string from @a __s. Determines the * effective length rlen of the strings to compare as the * smallest of the length of the substring and @a __n2. The * function then compares the two strings by calling * traits::compare(substring.data(),s,rlen). If the result of * the comparison is nonzero returns it, otherwise the shorter * one is ordered first. * * NB: s must have at least n2 characters, '\\0' has * no special meaning. */ int compare(size_type __pos, size_type __n1, const _CharT* __s, size_type __n2) const; }; #endif // !_GLIBCXX_USE_CXX11_ABI # 4849 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 // operator+ /** * @brief Concatenate two strings. * @param __lhs First string. * @param __rhs Last string. * @return New string with value of @a __lhs followed by @a __rhs. */ template basic_string<_CharT, _Traits, _Alloc> operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, const basic_string<_CharT, _Traits, _Alloc>& __rhs) { basic_string<_CharT, _Traits, _Alloc> __str(__lhs); __str.append(__rhs); return __str; } /** * @brief Concatenate C string and string. * @param __lhs First string. * @param __rhs Last string. * @return New string with value of @a __lhs followed by @a __rhs. */ template basic_string<_CharT,_Traits,_Alloc> operator+(const _CharT* __lhs, const basic_string<_CharT,_Traits,_Alloc>& __rhs); /** * @brief Concatenate character and string. * @param __lhs First string. * @param __rhs Last string. * @return New string with @a __lhs followed by @a __rhs. */ template basic_string<_CharT,_Traits,_Alloc> operator+(_CharT __lhs, const basic_string<_CharT,_Traits,_Alloc>& __rhs); /** * @brief Concatenate string and C string. * @param __lhs First string. * @param __rhs Last string. * @return New string with @a __lhs followed by @a __rhs. */ template inline basic_string<_CharT, _Traits, _Alloc> operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, const _CharT* __rhs) { basic_string<_CharT, _Traits, _Alloc> __str(__lhs); __str.append(__rhs); return __str; } /** * @brief Concatenate string and character. * @param __lhs First string. * @param __rhs Last string. * @return New string with @a __lhs followed by @a __rhs. */ template inline basic_string<_CharT, _Traits, _Alloc> operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs) { typedef basic_string<_CharT, _Traits, _Alloc> __string_type; typedef typename __string_type::size_type __size_type; __string_type __str(__lhs); __str.append(__size_type(1), __rhs); return __str; } #if __cplusplus >= 201103L template inline basic_string<_CharT, _Traits, _Alloc> operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, const basic_string<_CharT, _Traits, _Alloc>& __rhs) { return std::move(__lhs.append(__rhs)); } template inline basic_string<_CharT, _Traits, _Alloc> operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, basic_string<_CharT, _Traits, _Alloc>&& __rhs) { return std::move(__rhs.insert(0, __lhs)); } template inline basic_string<_CharT, _Traits, _Alloc> operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, basic_string<_CharT, _Traits, _Alloc>&& __rhs) { const auto __size = __lhs.size() + __rhs.size(); const bool __cond = (__size > __lhs.capacity() && __size <= __rhs.capacity()); return __cond ? std::move(__rhs.insert(0, __lhs)) : std::move(__lhs.append(__rhs)); } template inline basic_string<_CharT, _Traits, _Alloc> operator+(const _CharT* __lhs, basic_string<_CharT, _Traits, _Alloc>&& __rhs) { return std::move(__rhs.insert(0, __lhs)); } template inline basic_string<_CharT, _Traits, _Alloc> operator+(_CharT __lhs, basic_string<_CharT, _Traits, _Alloc>&& __rhs) { return std::move(__rhs.insert(0, 1, __lhs)); } template inline basic_string<_CharT, _Traits, _Alloc> operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, const _CharT* __rhs) { return std::move(__lhs.append(__rhs)); } template inline basic_string<_CharT, _Traits, _Alloc> operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, _CharT __rhs) { return std::move(__lhs.append(1, __rhs)); } #endif # 4970 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 // operator == /** * @brief Test equivalence of two strings. * @param __lhs First string. * @param __rhs Second string. * @return True if @a __lhs.compare(@a __rhs) == 0. False otherwise. */ template inline bool operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs, const basic_string<_CharT, _Traits, _Alloc>& __rhs) _GLIBCXX_NOEXCEPT { return __lhs.compare(__rhs) == 0; } template inline typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value, bool>::__type operator==(const basic_string<_CharT>& __lhs, const basic_string<_CharT>& __rhs) _GLIBCXX_NOEXCEPT { return (__lhs.size() == __rhs.size() && !std::char_traits<_CharT>::compare(__lhs.data(), __rhs.data(), __lhs.size())); } /** * @brief Test equivalence of C string and string. * @param __lhs C string. * @param __rhs String. * @return True if @a __rhs.compare(@a __lhs) == 0. False otherwise. */ template inline bool operator==(const _CharT* __lhs, const basic_string<_CharT, _Traits, _Alloc>& __rhs) { return __rhs.compare(__lhs) == 0; } /** * @brief Test equivalence of string and C string. * @param __lhs String. * @param __rhs C string. * @return True if @a __lhs.compare(@a __rhs) == 0. False otherwise. */ template inline bool operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs, const _CharT* __rhs) { return __lhs.compare(__rhs) == 0; } // operator != /** * @brief Test difference of two strings. * @param __lhs First string. * @param __rhs Second string. * @return True if @a __lhs.compare(@a __rhs) != 0. False otherwise. */ template inline bool operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, const basic_string<_CharT, _Traits, _Alloc>& __rhs) _GLIBCXX_NOEXCEPT { return !(__lhs == __rhs); } /** * @brief Test difference of C string and string. * @param __lhs C string. * @param __rhs String. * @return True if @a __rhs.compare(@a __lhs) != 0. False otherwise. */ template inline bool operator!=(const _CharT* __lhs, const basic_string<_CharT, _Traits, _Alloc>& __rhs) { return !(__lhs == __rhs); } /** * @brief Test difference of string and C string. * @param __lhs String. * @param __rhs C string. * @return True if @a __lhs.compare(@a __rhs) != 0. False otherwise. */ template inline bool operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, const _CharT* __rhs) { return !(__lhs == __rhs); } // operator < /** * @brief Test if string precedes string. * @param __lhs First string. * @param __rhs Second string. * @return True if @a __lhs precedes @a __rhs. False otherwise. */ template inline bool operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs, const basic_string<_CharT, _Traits, _Alloc>& __rhs) _GLIBCXX_NOEXCEPT { return __lhs.compare(__rhs) < 0; } /** * @brief Test if string precedes C string. * @param __lhs String. * @param __rhs C string. * @return True if @a __lhs precedes @a __rhs. False otherwise. */ template inline bool operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs, const _CharT* __rhs) { return __lhs.compare(__rhs) < 0; } /** * @brief Test if C string precedes string. * @param __lhs C string. * @param __rhs String. * @return True if @a __lhs precedes @a __rhs. False otherwise. */ template inline bool operator<(const _CharT* __lhs, const basic_string<_CharT, _Traits, _Alloc>& __rhs) { return __rhs.compare(__lhs) > 0; } // operator > /** * @brief Test if string follows string. * @param __lhs First string. * @param __rhs Second string. * @return True if @a __lhs follows @a __rhs. False otherwise. */ template inline bool operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs, const basic_string<_CharT, _Traits, _Alloc>& __rhs) _GLIBCXX_NOEXCEPT { return __lhs.compare(__rhs) > 0; } /** * @brief Test if string follows C string. * @param __lhs String. * @param __rhs C string. * @return True if @a __lhs follows @a __rhs. False otherwise. */ template inline bool operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs, const _CharT* __rhs) { return __lhs.compare(__rhs) > 0; } /** * @brief Test if C string follows string. * @param __lhs C string. * @param __rhs String. * @return True if @a __lhs follows @a __rhs. False otherwise. */ template inline bool operator>(const _CharT* __lhs, const basic_string<_CharT, _Traits, _Alloc>& __rhs) { return __rhs.compare(__lhs) < 0; } // operator <= /** * @brief Test if string doesn't follow string. * @param __lhs First string. * @param __rhs Second string. * @return True if @a __lhs doesn't follow @a __rhs. False otherwise. */ template inline bool operator<=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, const basic_string<_CharT, _Traits, _Alloc>& __rhs) _GLIBCXX_NOEXCEPT { return __lhs.compare(__rhs) <= 0; } /** * @brief Test if string doesn't follow C string. * @param __lhs String. * @param __rhs C string. * @return True if @a __lhs doesn't follow @a __rhs. False otherwise. */ template inline bool operator<=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, const _CharT* __rhs) { return __lhs.compare(__rhs) <= 0; } /** * @brief Test if C string doesn't follow string. * @param __lhs C string. * @param __rhs String. * @return True if @a __lhs doesn't follow @a __rhs. False otherwise. */ template inline bool operator<=(const _CharT* __lhs, const basic_string<_CharT, _Traits, _Alloc>& __rhs) { return __rhs.compare(__lhs) >= 0; } // operator >= /** * @brief Test if string doesn't precede string. * @param __lhs First string. * @param __rhs Second string. * @return True if @a __lhs doesn't precede @a __rhs. False otherwise. */ template inline bool operator>=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, const basic_string<_CharT, _Traits, _Alloc>& __rhs) _GLIBCXX_NOEXCEPT { return __lhs.compare(__rhs) >= 0; } /** * @brief Test if string doesn't precede C string. * @param __lhs String. * @param __rhs C string. * @return True if @a __lhs doesn't precede @a __rhs. False otherwise. */ template inline bool operator>=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, const _CharT* __rhs) { return __lhs.compare(__rhs) >= 0; } /** * @brief Test if C string doesn't precede string. * @param __lhs C string. * @param __rhs String. * @return True if @a __lhs doesn't precede @a __rhs. False otherwise. */ template inline bool operator>=(const _CharT* __lhs, const basic_string<_CharT, _Traits, _Alloc>& __rhs) { return __rhs.compare(__lhs) <= 0; } /** * @brief Swap contents of two strings. * @param __lhs First string. * @param __rhs Second string. * * Exchanges the contents of @a __lhs and @a __rhs in constant time. */ template inline void swap(basic_string<_CharT, _Traits, _Alloc>& __lhs, basic_string<_CharT, _Traits, _Alloc>& __rhs) #if __cplusplus >= 201103L noexcept(noexcept(__lhs.swap(__rhs))) #endif # 5222 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 { __lhs.swap(__rhs); } /** * @brief Read stream into a string. * @param __is Input stream. * @param __str Buffer to store into. * @return Reference to the input stream. * * Stores characters from @a __is into @a __str until whitespace is * found, the end of the stream is encountered, or str.max_size() * is reached. If is.width() is non-zero, that is the limit on the * number of characters stored into @a __str. Any previous * contents of @a __str are erased. */ template basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, basic_string<_CharT, _Traits, _Alloc>& __str); template<> basic_istream& operator>>(basic_istream& __is, basic_string& __str); /** * @brief Write string to a stream. * @param __os Output stream. * @param __str String to write out. * @return Reference to the output stream. * * Output characters of @a __str into os following the same rules as for * writing a C string. */ template inline basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const basic_string<_CharT, _Traits, _Alloc>& __str) { // _GLIBCXX_RESOLVE_LIB_DEFECTS // 586. string inserter not a formatted function return __ostream_insert(__os, __str.data(), __str.size()); } /** * @brief Read a line from stream into a string. * @param __is Input stream. * @param __str Buffer to store into. * @param __delim Character marking end of line. * @return Reference to the input stream. * * Stores characters from @a __is into @a __str until @a __delim is * found, the end of the stream is encountered, or str.max_size() * is reached. Any previous contents of @a __str are erased. If * @a __delim is encountered, it is extracted but not stored into * @a __str. */ template basic_istream<_CharT, _Traits>& getline(basic_istream<_CharT, _Traits>& __is, basic_string<_CharT, _Traits, _Alloc>& __str, _CharT __delim); /** * @brief Read a line from stream into a string. * @param __is Input stream. * @param __str Buffer to store into. * @return Reference to the input stream. * * Stores characters from is into @a __str until '\n' is * found, the end of the stream is encountered, or str.max_size() * is reached. Any previous contents of @a __str are erased. If * end of line is encountered, it is extracted but not stored into * @a __str. */ template inline basic_istream<_CharT, _Traits>& getline(basic_istream<_CharT, _Traits>& __is, basic_string<_CharT, _Traits, _Alloc>& __str) { return std::getline(__is, __str, __is.widen('\n')); } #if __cplusplus >= 201103L /// Read a line from an rvalue stream into a string. template inline basic_istream<_CharT, _Traits>& getline(basic_istream<_CharT, _Traits>&& __is, basic_string<_CharT, _Traits, _Alloc>& __str, _CharT __delim) { return std::getline(__is, __str, __delim); } /// Read a line from an rvalue stream into a string. template inline basic_istream<_CharT, _Traits>& getline(basic_istream<_CharT, _Traits>&& __is, basic_string<_CharT, _Traits, _Alloc>& __str) { return std::getline(__is, __str); } #endif # 5316 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 template<> basic_istream& getline(basic_istream& __in, basic_string& __str, char __delim); #ifdef _GLIBCXX_USE_WCHAR_T template<> basic_istream& getline(basic_istream& __in, basic_string& __str, wchar_t __delim); #endif # 5328 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 _GLIBCXX_END_NAMESPACE_VERSION } // namespace #if __cplusplus >= 201103L && defined(_GLIBCXX_USE_C99) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 5334 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/string_conversions.h" 1 3 // String Conversions -*- C++ -*- // Copyright (C) 2008-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file ext/string_conversions.h * This file is a GNU extension to the Standard C++ Library. */ #ifndef _STRING_CONVERSIONS_H #define _STRING_CONVERSIONS_H 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 33 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/string_conversions.h" 3 #if __cplusplus < 201103L #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 35 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/string_conversions.h" 3 # 36 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/string_conversions.h" 3 #else # 37 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/string_conversions.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 38 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/string_conversions.h" 3 # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/string_conversions.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/string_conversions.h" 3 # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/string_conversions.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/string_conversions.h" 3 # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/string_conversions.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/string_conversions.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 1 3 // -*- C++ -*- forwarding header. // Copyright (C) 1997-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file include/cstdlib * This is a Standard C++ Library file. You should @c \#include this file * in your programs, rather than any of the @a *.h implementation files. * * This is the C++ version of the Standard C Library header @c stdlib.h, * and its contents are (mostly) the same as that header, but are all * contained in the namespace @c std (except for names which are defined * as macros in C). */ // // ISO C++ 14882: 20.4.6 C library // #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #ifndef _GLIBCXX_CSTDLIB #define _GLIBCXX_CSTDLIB 1 #if !_GLIBCXX_HOSTED // The C standard does not require a freestanding implementation to // provide . However, the C++ standard does still require // -- but only the functionality mentioned in // [lib.support.start.term]. #define EXIT_SUCCESS 0 #define EXIT_FAILURE 1 namespace std { extern "C" void abort(void) throw () _GLIBCXX_NORETURN; extern "C" int atexit(void (*)(void)) throw (); extern "C" void exit(int) throw () _GLIBCXX_NORETURN; #if __cplusplus >= 201103L # ifdef _GLIBCXX_HAVE_AT_QUICK_EXIT extern "C" int at_quick_exit(void (*)(void)) throw (); # endif # 64 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 # ifdef _GLIBCXX_HAVE_QUICK_EXIT extern "C" void quick_exit(int) throw() _GLIBCXX_NORETURN; # endif # 67 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #endif # 68 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 } // namespace std #else # 71 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 72 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 # 73 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 // Get rid of those macros defined in in lieu of real functions. #undef abort #undef abs #undef atexit #if __cplusplus >= 201103L # ifdef _GLIBCXX_HAVE_AT_QUICK_EXIT # undef at_quick_exit # endif # 82 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #endif # 83 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #undef atof #undef atoi #undef atol #undef bsearch #undef calloc #undef div #undef exit #undef free #undef getenv #undef labs #undef ldiv #undef malloc #undef mblen #undef mbstowcs #undef mbtowc #undef qsort #if __cplusplus >= 201103L # ifdef _GLIBCXX_HAVE_QUICK_EXIT # undef quick_exit # endif # 103 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #endif # 104 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #undef rand #undef realloc #undef srand #undef strtod #undef strtol #undef strtoul #undef system #undef wcstombs #undef wctomb namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION using ::div_t; using ::ldiv_t; using ::abort; using ::abs; using ::atexit; #if __cplusplus >= 201103L # ifdef _GLIBCXX_HAVE_AT_QUICK_EXIT using ::at_quick_exit; # endif # 128 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #endif # 129 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 using ::atof; using ::atoi; using ::atol; using ::bsearch; using ::calloc; using ::div; using ::exit; using ::free; using ::getenv; using ::labs; using ::ldiv; using ::malloc; #ifdef _GLIBCXX_HAVE_MBSTATE_T using ::mblen; using ::mbstowcs; using ::mbtowc; #endif // _GLIBCXX_HAVE_MBSTATE_T # 146 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 using ::qsort; #if __cplusplus >= 201103L # ifdef _GLIBCXX_HAVE_QUICK_EXIT using ::quick_exit; # endif # 151 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #endif # 152 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 using ::rand; using ::realloc; using ::srand; using ::strtod; using ::strtol; using ::strtoul; using ::system; #ifdef _GLIBCXX_USE_WCHAR_T using ::wcstombs; using ::wctomb; #endif // _GLIBCXX_USE_WCHAR_T # 163 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #ifndef __CORRECT_ISO_CPP_STDLIB_H_PROTO inline long abs(long __i) { return __builtin_labs(__i); } inline ldiv_t div(long __i, long __j) { return ldiv(__i, __j); } #endif # 171 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #ifdef _GLIBCXX_USE_LONG_LONG inline long long abs(long long __x) { return __builtin_llabs (__x); } #endif # 176 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #if defined(__GLIBCXX_TYPE_INT_N_0) inline __GLIBCXX_TYPE_INT_N_0 abs(__GLIBCXX_TYPE_INT_N_0 __x) { return __x >= 0 ? __x : -__x; } #endif # 181 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #if defined(__GLIBCXX_TYPE_INT_N_1) inline __GLIBCXX_TYPE_INT_N_1 abs(__GLIBCXX_TYPE_INT_N_1 __x) { return __x >= 0 ? __x : -__x; } #endif # 185 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #if defined(__GLIBCXX_TYPE_INT_N_2) inline __GLIBCXX_TYPE_INT_N_2 abs(__GLIBCXX_TYPE_INT_N_2 __x) { return __x >= 0 ? __x : -__x; } #endif # 189 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #if defined(__GLIBCXX_TYPE_INT_N_3) inline __GLIBCXX_TYPE_INT_N_3 abs(__GLIBCXX_TYPE_INT_N_3 __x) { return __x >= 0 ? __x : -__x; } #endif # 193 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 _GLIBCXX_END_NAMESPACE_VERSION } // namespace #if _GLIBCXX_USE_C99 #undef _Exit #undef llabs #undef lldiv #undef atoll #undef strtoll #undef strtoull #undef strtof #undef strtold namespace __gnu_cxx _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC using ::lldiv_t; #endif # 216 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC extern "C" void (_Exit)(int) throw () _GLIBCXX_NORETURN; #endif # 219 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #if !_GLIBCXX_USE_C99_DYNAMIC using ::_Exit; #endif # 222 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC using ::llabs; inline lldiv_t div(long long __n, long long __d) { lldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; } using ::lldiv; #endif # 232 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #if _GLIBCXX_USE_C99_LONG_LONG_CHECK || _GLIBCXX_USE_C99_LONG_LONG_DYNAMIC extern "C" long long int (atoll)(const char *) throw (); extern "C" long long int (strtoll)(const char * __restrict, char ** __restrict, int) throw (); extern "C" unsigned long long int (strtoull)(const char * __restrict, char ** __restrict, int) throw (); #endif # 240 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC using ::atoll; using ::strtoll; using ::strtoull; #endif # 245 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 using ::strtof; using ::strtold; _GLIBCXX_END_NAMESPACE_VERSION } // namespace __gnu_cxx namespace std { #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC using ::__gnu_cxx::lldiv_t; #endif # 256 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 using ::__gnu_cxx::_Exit; #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC using ::__gnu_cxx::llabs; using ::__gnu_cxx::div; using ::__gnu_cxx::lldiv; #endif # 262 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 using ::__gnu_cxx::atoll; using ::__gnu_cxx::strtof; using ::__gnu_cxx::strtoll; using ::__gnu_cxx::strtoull; using ::__gnu_cxx::strtold; } // namespace std #endif // _GLIBCXX_USE_C99 # 270 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #endif // !_GLIBCXX_HOSTED # 272 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #endif # 274 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/string_conversions.h" 2 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/string_conversions.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 1 3 // -*- C++ -*- forwarding header. // Copyright (C) 1997-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file include/cwchar * This is a Standard C++ Library file. You should @c \#include this file * in your programs, rather than any of the @a *.h implementation files. * * This is the C++ version of the Standard C Library header @c wchar.h, * and its contents are (mostly) the same as that header, but are all * contained in the namespace @c std (except for names which are defined * as macros in C). */ // // ISO C++ 14882: 21.4 // #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #if _GLIBCXX_HAVE_WCHAR_H #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 44 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 # 1 "/usr/include/wchar.h" 1 3 4 /* Copyright (C) 1995-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard: 7.24 * Extended multibyte and wide character utilities */ #ifndef _WCHAR_H #if !defined __need_mbstate_t && !defined __need_wint_t # define _WCHAR_H 1 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 27 "/usr/include/wchar.h" 3 4 # 28 "/usr/include/wchar.h" 3 4 #endif # 29 "/usr/include/wchar.h" 3 4 #ifdef _WCHAR_H /* Get FILE definition. */ # define __need___FILE # if defined __USE_UNIX98 || defined __USE_XOPEN2K # define __need_FILE # endif # 36 "/usr/include/wchar.h" 3 4 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 36 "/usr/include/wchar.h" 3 4 # 37 "/usr/include/wchar.h" 3 4 /* Get va_list definition. */ # define __need___va_list #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 39 "/usr/include/wchar.h" 3 4 # 40 "/usr/include/wchar.h" 3 4 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 41 "/usr/include/wchar.h" 3 4 # 42 "/usr/include/wchar.h" 3 4 /* Get size_t, wchar_t, wint_t and NULL from . */ # define __need_size_t # define __need_wchar_t # define __need_NULL #endif # 48 "/usr/include/wchar.h" 3 4 #if defined _WCHAR_H || defined __need_wint_t || !defined __WINT_TYPE__ # undef __need_wint_t # define __need_wint_t #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 51 "/usr/include/wchar.h" 3 4 # 52 "/usr/include/wchar.h" 3 4 /* We try to get wint_t from , but not all GCC versions define it there. So define it ourselves if it remains undefined. */ # ifndef _WINT_T /* Integral type unchanged by default argument promotions that can hold any value corresponding to members of the extended character set, as well as at least one value that does not correspond to any member of the extended character set. */ # define _WINT_T typedef unsigned int wint_t; # else # 63 "/usr/include/wchar.h" 3 4 /* Work around problems with the file which doesn't put wint_t in the std namespace. */ # if defined __cplusplus && defined _GLIBCPP_USE_NAMESPACES \ && defined __WINT_TYPE__ __BEGIN_NAMESPACE_STD typedef __WINT_TYPE__ wint_t; __END_NAMESPACE_STD # endif # 71 "/usr/include/wchar.h" 3 4 # endif # 72 "/usr/include/wchar.h" 3 4 /* Tell the caller that we provide correct C++ prototypes. */ # if defined __cplusplus && __GNUC_PREREQ (4, 4) # define __CORRECT_ISO_CPP_WCHAR_H_PROTO # endif # 77 "/usr/include/wchar.h" 3 4 #endif # 78 "/usr/include/wchar.h" 3 4 #if (defined _WCHAR_H || defined __need_mbstate_t) && !defined ____mbstate_t_defined # define ____mbstate_t_defined 1 /* Conversion state information. */ typedef struct { int __count; union { # ifdef __WINT_TYPE__ __WINT_TYPE__ __wch; # else # 90 "/usr/include/wchar.h" 3 4 wint_t __wch; # endif # 92 "/usr/include/wchar.h" 3 4 char __wchb[4]; } __value; /* Value so far. */ } __mbstate_t; #endif # 96 "/usr/include/wchar.h" 3 4 #undef __need_mbstate_t /* The rest of the file is only used if used if __need_mbstate_t is not defined. */ #ifdef _WCHAR_H # ifndef __mbstate_t_defined __BEGIN_NAMESPACE_C99 /* Public type. */ typedef __mbstate_t mbstate_t; __END_NAMESPACE_C99 # define __mbstate_t_defined 1 # endif # 110 "/usr/include/wchar.h" 3 4 #ifdef __USE_GNU __USING_NAMESPACE_C99(mbstate_t) #endif # 114 "/usr/include/wchar.h" 3 4 #ifndef WCHAR_MIN /* These constants might also be defined in . */ # define WCHAR_MIN __WCHAR_MIN # define WCHAR_MAX __WCHAR_MAX #endif # 120 "/usr/include/wchar.h" 3 4 #ifndef WEOF # define WEOF (0xffffffffu) #endif # 124 "/usr/include/wchar.h" 3 4 /* For XPG4 compliance we have to define the stuff from here as well. */ #if defined __USE_XOPEN && !defined __USE_UNIX98 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 128 "/usr/include/wchar.h" 3 4 # 129 "/usr/include/wchar.h" 3 4 #endif # 130 "/usr/include/wchar.h" 3 4 __BEGIN_DECLS __BEGIN_NAMESPACE_STD /* This incomplete type is defined in but needed here because of `wcsftime'. */ struct tm; __END_NAMESPACE_STD /* XXX We have to clean this up at some point. Since tm is in the std namespace but wcsftime is in __c99 the type wouldn't be found without inserting it in the global namespace. */ __USING_NAMESPACE_STD(tm) __BEGIN_NAMESPACE_STD /* Copy SRC to DEST. */ extern wchar_t *wcscpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src) __THROW; /* Copy no more than N wide-characters of SRC to DEST. */ extern wchar_t *wcsncpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src, size_t __n) __THROW; /* Append SRC onto DEST. */ extern wchar_t *wcscat (wchar_t *__restrict __dest, const wchar_t *__restrict __src) __THROW; /* Append no more than N wide-characters of SRC onto DEST. */ extern wchar_t *wcsncat (wchar_t *__restrict __dest, const wchar_t *__restrict __src, size_t __n) __THROW; /* Compare S1 and S2. */ extern int wcscmp (const wchar_t *__s1, const wchar_t *__s2) __THROW __attribute_pure__; /* Compare N wide-characters of S1 and S2. */ extern int wcsncmp (const wchar_t *__s1, const wchar_t *__s2, size_t __n) __THROW __attribute_pure__; __END_NAMESPACE_STD #ifdef __USE_XOPEN2K8 /* Compare S1 and S2, ignoring case. */ extern int wcscasecmp (const wchar_t *__s1, const wchar_t *__s2) __THROW; /* Compare no more than N chars of S1 and S2, ignoring case. */ extern int wcsncasecmp (const wchar_t *__s1, const wchar_t *__s2, size_t __n) __THROW; /* Similar to the two functions above but take the information from the provided locale and not the global locale. */ #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 180 "/usr/include/wchar.h" 3 4 # 181 "/usr/include/wchar.h" 3 4 extern int wcscasecmp_l (const wchar_t *__s1, const wchar_t *__s2, __locale_t __loc) __THROW; extern int wcsncasecmp_l (const wchar_t *__s1, const wchar_t *__s2, size_t __n, __locale_t __loc) __THROW; #endif # 188 "/usr/include/wchar.h" 3 4 __BEGIN_NAMESPACE_STD /* Compare S1 and S2, both interpreted as appropriate to the LC_COLLATE category of the current locale. */ extern int wcscoll (const wchar_t *__s1, const wchar_t *__s2) __THROW; /* Transform S2 into array pointed to by S1 such that if wcscmp is applied to two transformed strings the result is the as applying `wcscoll' to the original strings. */ extern size_t wcsxfrm (wchar_t *__restrict __s1, const wchar_t *__restrict __s2, size_t __n) __THROW; __END_NAMESPACE_STD #ifdef __USE_XOPEN2K8 /* Similar to the two functions above but take the information from the provided locale and not the global locale. */ /* Compare S1 and S2, both interpreted as appropriate to the LC_COLLATE category of the given locale. */ extern int wcscoll_l (const wchar_t *__s1, const wchar_t *__s2, __locale_t __loc) __THROW; /* Transform S2 into array pointed to by S1 such that if wcscmp is applied to two transformed strings the result is the as applying `wcscoll' to the original strings. */ extern size_t wcsxfrm_l (wchar_t *__s1, const wchar_t *__s2, size_t __n, __locale_t __loc) __THROW; /* Duplicate S, returning an identical malloc'd string. */ extern wchar_t *wcsdup (const wchar_t *__s) __THROW __attribute_malloc__; #endif # 218 "/usr/include/wchar.h" 3 4 __BEGIN_NAMESPACE_STD /* Find the first occurrence of WC in WCS. */ #ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO extern "C++" wchar_t *wcschr (wchar_t *__wcs, wchar_t __wc) __THROW __asm ("wcschr") __attribute_pure__; extern "C++" const wchar_t *wcschr (const wchar_t *__wcs, wchar_t __wc) __THROW __asm ("wcschr") __attribute_pure__; #else # 227 "/usr/include/wchar.h" 3 4 extern wchar_t *wcschr (const wchar_t *__wcs, wchar_t __wc) __THROW __attribute_pure__; #endif # 230 "/usr/include/wchar.h" 3 4 /* Find the last occurrence of WC in WCS. */ #ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO extern "C++" wchar_t *wcsrchr (wchar_t *__wcs, wchar_t __wc) __THROW __asm ("wcsrchr") __attribute_pure__; extern "C++" const wchar_t *wcsrchr (const wchar_t *__wcs, wchar_t __wc) __THROW __asm ("wcsrchr") __attribute_pure__; #else # 237 "/usr/include/wchar.h" 3 4 extern wchar_t *wcsrchr (const wchar_t *__wcs, wchar_t __wc) __THROW __attribute_pure__; #endif # 240 "/usr/include/wchar.h" 3 4 __END_NAMESPACE_STD #ifdef __USE_GNU /* This function is similar to `wcschr'. But it returns a pointer to the closing NUL wide character in case C is not found in S. */ extern wchar_t *wcschrnul (const wchar_t *__s, wchar_t __wc) __THROW __attribute_pure__; #endif # 248 "/usr/include/wchar.h" 3 4 __BEGIN_NAMESPACE_STD /* Return the length of the initial segmet of WCS which consists entirely of wide characters not in REJECT. */ extern size_t wcscspn (const wchar_t *__wcs, const wchar_t *__reject) __THROW __attribute_pure__; /* Return the length of the initial segmet of WCS which consists entirely of wide characters in ACCEPT. */ extern size_t wcsspn (const wchar_t *__wcs, const wchar_t *__accept) __THROW __attribute_pure__; /* Find the first occurrence in WCS of any character in ACCEPT. */ #ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO extern "C++" wchar_t *wcspbrk (wchar_t *__wcs, const wchar_t *__accept) __THROW __asm ("wcspbrk") __attribute_pure__; extern "C++" const wchar_t *wcspbrk (const wchar_t *__wcs, const wchar_t *__accept) __THROW __asm ("wcspbrk") __attribute_pure__; #else # 266 "/usr/include/wchar.h" 3 4 extern wchar_t *wcspbrk (const wchar_t *__wcs, const wchar_t *__accept) __THROW __attribute_pure__; #endif # 269 "/usr/include/wchar.h" 3 4 /* Find the first occurrence of NEEDLE in HAYSTACK. */ #ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO extern "C++" wchar_t *wcsstr (wchar_t *__haystack, const wchar_t *__needle) __THROW __asm ("wcsstr") __attribute_pure__; extern "C++" const wchar_t *wcsstr (const wchar_t *__haystack, const wchar_t *__needle) __THROW __asm ("wcsstr") __attribute_pure__; #else # 277 "/usr/include/wchar.h" 3 4 extern wchar_t *wcsstr (const wchar_t *__haystack, const wchar_t *__needle) __THROW __attribute_pure__; #endif # 280 "/usr/include/wchar.h" 3 4 /* Divide WCS into tokens separated by characters in DELIM. */ extern wchar_t *wcstok (wchar_t *__restrict __s, const wchar_t *__restrict __delim, wchar_t **__restrict __ptr) __THROW; /* Return the number of wide characters in S. */ extern size_t wcslen (const wchar_t *__s) __THROW __attribute_pure__; __END_NAMESPACE_STD #ifdef __USE_XOPEN /* Another name for `wcsstr' from XPG4. */ # ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO extern "C++" wchar_t *wcswcs (wchar_t *__haystack, const wchar_t *__needle) __THROW __asm ("wcswcs") __attribute_pure__; extern "C++" const wchar_t *wcswcs (const wchar_t *__haystack, const wchar_t *__needle) __THROW __asm ("wcswcs") __attribute_pure__; # else # 299 "/usr/include/wchar.h" 3 4 extern wchar_t *wcswcs (const wchar_t *__haystack, const wchar_t *__needle) __THROW __attribute_pure__; # endif # 302 "/usr/include/wchar.h" 3 4 #endif # 303 "/usr/include/wchar.h" 3 4 #ifdef __USE_XOPEN2K8 /* Return the number of wide characters in S, but at most MAXLEN. */ extern size_t wcsnlen (const wchar_t *__s, size_t __maxlen) __THROW __attribute_pure__; #endif # 309 "/usr/include/wchar.h" 3 4 __BEGIN_NAMESPACE_STD /* Search N wide characters of S for C. */ #ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO extern "C++" wchar_t *wmemchr (wchar_t *__s, wchar_t __c, size_t __n) __THROW __asm ("wmemchr") __attribute_pure__; extern "C++" const wchar_t *wmemchr (const wchar_t *__s, wchar_t __c, size_t __n) __THROW __asm ("wmemchr") __attribute_pure__; #else # 320 "/usr/include/wchar.h" 3 4 extern wchar_t *wmemchr (const wchar_t *__s, wchar_t __c, size_t __n) __THROW __attribute_pure__; #endif # 323 "/usr/include/wchar.h" 3 4 /* Compare N wide characters of S1 and S2. */ extern int wmemcmp (const wchar_t *__s1, const wchar_t *__s2, size_t __n) __THROW __attribute_pure__; /* Copy N wide characters of SRC to DEST. */ extern wchar_t *wmemcpy (wchar_t *__restrict __s1, const wchar_t *__restrict __s2, size_t __n) __THROW; /* Copy N wide characters of SRC to DEST, guaranteeing correct behavior for overlapping strings. */ extern wchar_t *wmemmove (wchar_t *__s1, const wchar_t *__s2, size_t __n) __THROW; /* Set N wide characters of S to C. */ extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) __THROW; __END_NAMESPACE_STD #ifdef __USE_GNU /* Copy N wide characters of SRC to DEST and return pointer to following wide character. */ extern wchar_t *wmempcpy (wchar_t *__restrict __s1, const wchar_t *__restrict __s2, size_t __n) __THROW; #endif # 348 "/usr/include/wchar.h" 3 4 __BEGIN_NAMESPACE_STD /* Determine whether C constitutes a valid (one-byte) multibyte character. */ extern wint_t btowc (int __c) __THROW; /* Determine whether C corresponds to a member of the extended character set whose multibyte representation is a single byte. */ extern int wctob (wint_t __c) __THROW; /* Determine whether PS points to an object representing the initial state. */ extern int mbsinit (const mbstate_t *__ps) __THROW __attribute_pure__; /* Write wide character representation of multibyte character pointed to by S to PWC. */ extern size_t mbrtowc (wchar_t *__restrict __pwc, const char *__restrict __s, size_t __n, mbstate_t *__restrict __p) __THROW; /* Write multibyte representation of wide character WC to S. */ extern size_t wcrtomb (char *__restrict __s, wchar_t __wc, mbstate_t *__restrict __ps) __THROW; /* Return number of bytes in multibyte character pointed to by S. */ extern size_t __mbrlen (const char *__restrict __s, size_t __n, mbstate_t *__restrict __ps) __THROW; extern size_t mbrlen (const char *__restrict __s, size_t __n, mbstate_t *__restrict __ps) __THROW; __END_NAMESPACE_STD #ifdef __USE_EXTERN_INLINES /* Define inline function as optimization. */ /* We can use the BTOWC and WCTOB optimizations since we know that all locales must use ASCII encoding for the values in the ASCII range and because the wchar_t encoding is always ISO 10646. */ extern wint_t __btowc_alias (int __c) __asm ("btowc"); __extern_inline wint_t __NTH (btowc (int __c)) { return (__builtin_constant_p (__c) && __c >= '\0' && __c <= '\x7f' ? (wint_t) __c : __btowc_alias (__c)); } extern int __wctob_alias (wint_t __c) __asm ("wctob"); __extern_inline int __NTH (wctob (wint_t __wc)) { return (__builtin_constant_p (__wc) && __wc >= L'\0' && __wc <= L'\x7f' ? (int) __wc : __wctob_alias (__wc)); } __extern_inline size_t __NTH (mbrlen (const char *__restrict __s, size_t __n, mbstate_t *__restrict __ps)) { return (__ps != NULL ? mbrtowc (NULL, __s, __n, __ps) : __mbrlen (__s, __n, NULL)); } #endif # 404 "/usr/include/wchar.h" 3 4 __BEGIN_NAMESPACE_STD /* Write wide character representation of multibyte character string SRC to DST. */ extern size_t mbsrtowcs (wchar_t *__restrict __dst, const char **__restrict __src, size_t __len, mbstate_t *__restrict __ps) __THROW; /* Write multibyte character representation of wide character string SRC to DST. */ extern size_t wcsrtombs (char *__restrict __dst, const wchar_t **__restrict __src, size_t __len, mbstate_t *__restrict __ps) __THROW; __END_NAMESPACE_STD #ifdef __USE_XOPEN2K8 /* Write wide character representation of at most NMC bytes of the multibyte character string SRC to DST. */ extern size_t mbsnrtowcs (wchar_t *__restrict __dst, const char **__restrict __src, size_t __nmc, size_t __len, mbstate_t *__restrict __ps) __THROW; /* Write multibyte character representation of at most NWC characters from the wide character string SRC to DST. */ extern size_t wcsnrtombs (char *__restrict __dst, const wchar_t **__restrict __src, size_t __nwc, size_t __len, mbstate_t *__restrict __ps) __THROW; #endif /* use POSIX 2008 */ # 434 "/usr/include/wchar.h" 3 4 /* The following functions are extensions found in X/Open CAE. */ #ifdef __USE_XOPEN /* Determine number of column positions required for C. */ extern int wcwidth (wchar_t __c) __THROW; /* Determine number of column positions required for first N wide characters (or fewer if S ends before this) in S. */ extern int wcswidth (const wchar_t *__s, size_t __n) __THROW; #endif /* Use X/Open. */ # 445 "/usr/include/wchar.h" 3 4 __BEGIN_NAMESPACE_STD /* Convert initial portion of the wide string NPTR to `double' representation. */ extern double wcstod (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr) __THROW; __END_NAMESPACE_STD #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Likewise for `float' and `long double' sizes of floating-point numbers. */ extern float wcstof (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr) __THROW; extern long double wcstold (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr) __THROW; __END_NAMESPACE_C99 #endif /* C99 */ # 463 "/usr/include/wchar.h" 3 4 __BEGIN_NAMESPACE_STD /* Convert initial portion of wide string NPTR to `long int' representation. */ extern long int wcstol (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base) __THROW; /* Convert initial portion of wide string NPTR to `unsigned long int' representation. */ extern unsigned long int wcstoul (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base) __THROW; __END_NAMESPACE_STD #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Convert initial portion of wide string NPTR to `long long int' representation. */ __extension__ extern long long int wcstoll (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base) __THROW; /* Convert initial portion of wide string NPTR to `unsigned long long int' representation. */ __extension__ extern unsigned long long int wcstoull (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base) __THROW; __END_NAMESPACE_C99 #endif /* ISO C99. */ # 495 "/usr/include/wchar.h" 3 4 #ifdef __USE_GNU /* Convert initial portion of wide string NPTR to `long long int' representation. */ __extension__ extern long long int wcstoq (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base) __THROW; /* Convert initial portion of wide string NPTR to `unsigned long long int' representation. */ __extension__ extern unsigned long long int wcstouq (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base) __THROW; #endif /* Use GNU. */ # 511 "/usr/include/wchar.h" 3 4 #ifdef __USE_GNU /* The concept of one static locale per category is not very well thought out. Many applications will need to process its data using information from several different locales. Another application is the implementation of the internationalization handling in the upcoming ISO C++ standard library. To support this another set of the functions using locale data exist which have an additional argument. Attention: all these functions are *not* standardized in any form. This is a proof-of-concept implementation. */ /* Structure for reentrant locale using functions. This is an (almost) opaque type for the user level programs. */ #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 526 "/usr/include/wchar.h" 3 4 # 527 "/usr/include/wchar.h" 3 4 /* Special versions of the functions above which take the locale to use as an additional parameter. */ extern long int wcstol_l (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base, __locale_t __loc) __THROW; extern unsigned long int wcstoul_l (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base, __locale_t __loc) __THROW; __extension__ extern long long int wcstoll_l (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base, __locale_t __loc) __THROW; __extension__ extern unsigned long long int wcstoull_l (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base, __locale_t __loc) __THROW; extern double wcstod_l (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, __locale_t __loc) __THROW; extern float wcstof_l (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, __locale_t __loc) __THROW; extern long double wcstold_l (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, __locale_t __loc) __THROW; #endif /* use GNU */ # 561 "/usr/include/wchar.h" 3 4 #ifdef __USE_XOPEN2K8 /* Copy SRC to DEST, returning the address of the terminating L'\0' in DEST. */ extern wchar_t *wcpcpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src) __THROW; /* Copy no more than N characters of SRC to DEST, returning the address of the last character written into DEST. */ extern wchar_t *wcpncpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src, size_t __n) __THROW; /* Wide character I/O functions. */ /* Like OPEN_MEMSTREAM, but the stream is wide oriented and produces a wide character string. */ extern __FILE *open_wmemstream (wchar_t **__bufloc, size_t *__sizeloc) __THROW; #endif # 582 "/usr/include/wchar.h" 3 4 #if defined __USE_ISOC95 || defined __USE_UNIX98 __BEGIN_NAMESPACE_STD /* Select orientation for stream. */ extern int fwide (__FILE *__fp, int __mode) __THROW; /* Write formatted output to STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fwprintf (__FILE *__restrict __stream, const wchar_t *__restrict __format, ...) /* __attribute__ ((__format__ (__wprintf__, 2, 3))) */; /* Write formatted output to stdout. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int wprintf (const wchar_t *__restrict __format, ...) /* __attribute__ ((__format__ (__wprintf__, 1, 2))) */; /* Write formatted output of at most N characters to S. */ extern int swprintf (wchar_t *__restrict __s, size_t __n, const wchar_t *__restrict __format, ...) __THROW /* __attribute__ ((__format__ (__wprintf__, 3, 4))) */; /* Write formatted output to S from argument list ARG. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int vfwprintf (__FILE *__restrict __s, const wchar_t *__restrict __format, __gnuc_va_list __arg) /* __attribute__ ((__format__ (__wprintf__, 2, 0))) */; /* Write formatted output to stdout from argument list ARG. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int vwprintf (const wchar_t *__restrict __format, __gnuc_va_list __arg) /* __attribute__ ((__format__ (__wprintf__, 1, 0))) */; /* Write formatted output of at most N character to S from argument list ARG. */ extern int vswprintf (wchar_t *__restrict __s, size_t __n, const wchar_t *__restrict __format, __gnuc_va_list __arg) __THROW /* __attribute__ ((__format__ (__wprintf__, 3, 0))) */; /* Read formatted input from STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fwscanf (__FILE *__restrict __stream, const wchar_t *__restrict __format, ...) /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */; /* Read formatted input from stdin. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int wscanf (const wchar_t *__restrict __format, ...) /* __attribute__ ((__format__ (__wscanf__, 1, 2))) */; /* Read formatted input from S. */ extern int swscanf (const wchar_t *__restrict __s, const wchar_t *__restrict __format, ...) __THROW /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */; # if defined __USE_ISOC99 && !defined __USE_GNU \ && (!defined __LDBL_COMPAT || !defined __REDIRECT) \ && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K) # ifdef __REDIRECT /* For strict ISO C99 or POSIX compliance disallow %as, %aS and %a[ GNU extension which conflicts with valid %a followed by letter s, S or [. */ extern int __REDIRECT (fwscanf, (__FILE *__restrict __stream, const wchar_t *__restrict __format, ...), __isoc99_fwscanf) /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */; extern int __REDIRECT (wscanf, (const wchar_t *__restrict __format, ...), __isoc99_wscanf) /* __attribute__ ((__format__ (__wscanf__, 1, 2))) */; extern int __REDIRECT_NTH (swscanf, (const wchar_t *__restrict __s, const wchar_t *__restrict __format, ...), __isoc99_swscanf) /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */; # else # 668 "/usr/include/wchar.h" 3 4 extern int __isoc99_fwscanf (__FILE *__restrict __stream, const wchar_t *__restrict __format, ...); extern int __isoc99_wscanf (const wchar_t *__restrict __format, ...); extern int __isoc99_swscanf (const wchar_t *__restrict __s, const wchar_t *__restrict __format, ...) __THROW; # define fwscanf __isoc99_fwscanf # define wscanf __isoc99_wscanf # define swscanf __isoc99_swscanf # endif # 678 "/usr/include/wchar.h" 3 4 # endif # 679 "/usr/include/wchar.h" 3 4 __END_NAMESPACE_STD #endif /* Use ISO C95, C99 and Unix98. */ # 682 "/usr/include/wchar.h" 3 4 #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Read formatted input from S into argument list ARG. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int vfwscanf (__FILE *__restrict __s, const wchar_t *__restrict __format, __gnuc_va_list __arg) /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */; /* Read formatted input from stdin into argument list ARG. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int vwscanf (const wchar_t *__restrict __format, __gnuc_va_list __arg) /* __attribute__ ((__format__ (__wscanf__, 1, 0))) */; /* Read formatted input from S into argument list ARG. */ extern int vswscanf (const wchar_t *__restrict __s, const wchar_t *__restrict __format, __gnuc_va_list __arg) __THROW /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */; # if !defined __USE_GNU \ && (!defined __LDBL_COMPAT || !defined __REDIRECT) \ && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K) # ifdef __REDIRECT extern int __REDIRECT (vfwscanf, (__FILE *__restrict __s, const wchar_t *__restrict __format, __gnuc_va_list __arg), __isoc99_vfwscanf) /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */; extern int __REDIRECT (vwscanf, (const wchar_t *__restrict __format, __gnuc_va_list __arg), __isoc99_vwscanf) /* __attribute__ ((__format__ (__wscanf__, 1, 0))) */; extern int __REDIRECT_NTH (vswscanf, (const wchar_t *__restrict __s, const wchar_t *__restrict __format, __gnuc_va_list __arg), __isoc99_vswscanf) /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */; # else # 722 "/usr/include/wchar.h" 3 4 extern int __isoc99_vfwscanf (__FILE *__restrict __s, const wchar_t *__restrict __format, __gnuc_va_list __arg); extern int __isoc99_vwscanf (const wchar_t *__restrict __format, __gnuc_va_list __arg); extern int __isoc99_vswscanf (const wchar_t *__restrict __s, const wchar_t *__restrict __format, __gnuc_va_list __arg) __THROW; # define vfwscanf __isoc99_vfwscanf # define vwscanf __isoc99_vwscanf # define vswscanf __isoc99_vswscanf # endif # 734 "/usr/include/wchar.h" 3 4 # endif # 735 "/usr/include/wchar.h" 3 4 __END_NAMESPACE_C99 #endif /* Use ISO C99. */ # 738 "/usr/include/wchar.h" 3 4 __BEGIN_NAMESPACE_STD /* Read a character from STREAM. These functions are possible cancellation points and therefore not marked with __THROW. */ extern wint_t fgetwc (__FILE *__stream); extern wint_t getwc (__FILE *__stream); /* Read a character from stdin. This function is a possible cancellation point and therefore not marked with __THROW. */ extern wint_t getwchar (void); /* Write a character to STREAM. These functions are possible cancellation points and therefore not marked with __THROW. */ extern wint_t fputwc (wchar_t __wc, __FILE *__stream); extern wint_t putwc (wchar_t __wc, __FILE *__stream); /* Write a character to stdout. This function is a possible cancellation point and therefore not marked with __THROW. */ extern wint_t putwchar (wchar_t __wc); /* Get a newline-terminated wide character string of finite length from STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern wchar_t *fgetws (wchar_t *__restrict __ws, int __n, __FILE *__restrict __stream); /* Write a string to STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fputws (const wchar_t *__restrict __ws, __FILE *__restrict __stream); /* Push a character back onto the input buffer of STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern wint_t ungetwc (wint_t __wc, __FILE *__stream); __END_NAMESPACE_STD #ifdef __USE_GNU /* These are defined to be equivalent to the `char' functions defined in POSIX.1:1996. These functions are not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation they are cancellation points and therefore not marked with __THROW. */ extern wint_t getwc_unlocked (__FILE *__stream); extern wint_t getwchar_unlocked (void); /* This is the wide character version of a GNU extension. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern wint_t fgetwc_unlocked (__FILE *__stream); /* Faster version when locking is not necessary. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern wint_t fputwc_unlocked (wchar_t __wc, __FILE *__stream); /* These are defined to be equivalent to the `char' functions defined in POSIX.1:1996. These functions are not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation they are cancellation points and therefore not marked with __THROW. */ extern wint_t putwc_unlocked (wchar_t __wc, __FILE *__stream); extern wint_t putwchar_unlocked (wchar_t __wc); /* This function does the same as `fgetws' but does not lock the stream. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern wchar_t *fgetws_unlocked (wchar_t *__restrict __ws, int __n, __FILE *__restrict __stream); /* This function does the same as `fputws' but does not lock the stream. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int fputws_unlocked (const wchar_t *__restrict __ws, __FILE *__restrict __stream); #endif # 849 "/usr/include/wchar.h" 3 4 __BEGIN_NAMESPACE_C99 /* Format TP into S according to FORMAT. Write no more than MAXSIZE wide characters and return the number of wide characters written, or 0 if it would exceed MAXSIZE. */ extern size_t wcsftime (wchar_t *__restrict __s, size_t __maxsize, const wchar_t *__restrict __format, const struct tm *__restrict __tp) __THROW; __END_NAMESPACE_C99 # ifdef __USE_GNU #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 861 "/usr/include/wchar.h" 3 4 # 862 "/usr/include/wchar.h" 3 4 /* Similar to `wcsftime' but takes the information from the provided locale and not the global locale. */ extern size_t wcsftime_l (wchar_t *__restrict __s, size_t __maxsize, const wchar_t *__restrict __format, const struct tm *__restrict __tp, __locale_t __loc) __THROW; # endif # 870 "/usr/include/wchar.h" 3 4 /* The X/Open standard demands that most of the functions defined in the header must also appear here. This is probably because some X/Open members wrote their implementation before the ISO C standard was published and introduced the better solution. We have to provide these definitions for compliance reasons but we do this nonsense only if really necessary. */ #if defined __USE_UNIX98 && !defined __USE_GNU # define __need_iswxxx #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 879 "/usr/include/wchar.h" 3 4 # 880 "/usr/include/wchar.h" 3 4 #endif # 881 "/usr/include/wchar.h" 3 4 /* Define some macros helping to catch buffer overflows. */ #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 884 "/usr/include/wchar.h" 3 4 # 885 "/usr/include/wchar.h" 3 4 #endif # 886 "/usr/include/wchar.h" 3 4 #ifdef __LDBL_COMPAT #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 888 "/usr/include/wchar.h" 3 4 # 889 "/usr/include/wchar.h" 3 4 #endif # 890 "/usr/include/wchar.h" 3 4 __END_DECLS #endif /* _WCHAR_H defined */ # 894 "/usr/include/wchar.h" 3 4 #endif /* wchar.h */ # 896 "/usr/include/wchar.h" 3 4 /* Undefine all __need_* constants in case we are included to get those constants but the whole file was already read. */ #undef __need_mbstate_t #undef __need_wint_t # 45 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 2 3 #endif # 46 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #ifndef _GLIBCXX_CWCHAR #define _GLIBCXX_CWCHAR 1 // Need to do a bit of trickery here with mbstate_t as char_traits // assumes it is in wchar.h, regardless of wchar_t specializations. #ifndef _GLIBCXX_HAVE_MBSTATE_T extern "C" { typedef struct { int __fill[6]; } mbstate_t; } #endif # 61 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 namespace std { using ::mbstate_t; } // namespace std // Get rid of those macros defined in in lieu of real functions. #undef btowc #undef fgetwc #undef fgetws #undef fputwc #undef fputws #undef fwide #undef fwprintf #undef fwscanf #undef getwc #undef getwchar #undef mbrlen #undef mbrtowc #undef mbsinit #undef mbsrtowcs #undef putwc #undef putwchar #undef swprintf #undef swscanf #undef ungetwc #undef vfwprintf #if _GLIBCXX_HAVE_VFWSCANF # undef vfwscanf #endif # 91 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #undef vswprintf #if _GLIBCXX_HAVE_VSWSCANF # undef vswscanf #endif # 95 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #undef vwprintf #if _GLIBCXX_HAVE_VWSCANF # undef vwscanf #endif # 99 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #undef wcrtomb #undef wcscat #undef wcschr #undef wcscmp #undef wcscoll #undef wcscpy #undef wcscspn #undef wcsftime #undef wcslen #undef wcsncat #undef wcsncmp #undef wcsncpy #undef wcspbrk #undef wcsrchr #undef wcsrtombs #undef wcsspn #undef wcsstr #undef wcstod #if _GLIBCXX_HAVE_WCSTOF # undef wcstof #endif # 120 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #undef wcstok #undef wcstol #undef wcstoul #undef wcsxfrm #undef wctob #undef wmemchr #undef wmemcmp #undef wmemcpy #undef wmemmove #undef wmemset #undef wprintf #undef wscanf #if _GLIBCXX_USE_WCHAR_T namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION using ::wint_t; using ::btowc; using ::fgetwc; using ::fgetws; using ::fputwc; using ::fputws; using ::fwide; using ::fwprintf; using ::fwscanf; using ::getwc; using ::getwchar; using ::mbrlen; using ::mbrtowc; using ::mbsinit; using ::mbsrtowcs; using ::putwc; using ::putwchar; #ifndef _GLIBCXX_HAVE_BROKEN_VSWPRINTF using ::swprintf; #endif # 160 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 using ::swscanf; using ::ungetwc; using ::vfwprintf; #if _GLIBCXX_HAVE_VFWSCANF using ::vfwscanf; #endif # 166 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #ifndef _GLIBCXX_HAVE_BROKEN_VSWPRINTF using ::vswprintf; #endif # 169 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #if _GLIBCXX_HAVE_VSWSCANF using ::vswscanf; #endif # 172 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 using ::vwprintf; #if _GLIBCXX_HAVE_VWSCANF using ::vwscanf; #endif # 176 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 using ::wcrtomb; using ::wcscat; using ::wcscmp; using ::wcscoll; using ::wcscpy; using ::wcscspn; using ::wcsftime; using ::wcslen; using ::wcsncat; using ::wcsncmp; using ::wcsncpy; using ::wcsrtombs; using ::wcsspn; using ::wcstod; #if _GLIBCXX_HAVE_WCSTOF using ::wcstof; #endif # 193 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 using ::wcstok; using ::wcstol; using ::wcstoul; using ::wcsxfrm; using ::wctob; using ::wmemcmp; using ::wmemcpy; using ::wmemmove; using ::wmemset; using ::wprintf; using ::wscanf; using ::wcschr; using ::wcspbrk; using ::wcsrchr; using ::wcsstr; using ::wmemchr; #ifndef __CORRECT_ISO_CPP_WCHAR_H_PROTO inline wchar_t* wcschr(wchar_t* __p, wchar_t __c) { return wcschr(const_cast(__p), __c); } inline wchar_t* wcspbrk(wchar_t* __s1, const wchar_t* __s2) { return wcspbrk(const_cast(__s1), __s2); } inline wchar_t* wcsrchr(wchar_t* __p, wchar_t __c) { return wcsrchr(const_cast(__p), __c); } inline wchar_t* wcsstr(wchar_t* __s1, const wchar_t* __s2) { return wcsstr(const_cast(__s1), __s2); } inline wchar_t* wmemchr(wchar_t* __p, wchar_t __c, size_t __n) { return wmemchr(const_cast(__p), __c, __n); } #endif # 231 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 _GLIBCXX_END_NAMESPACE_VERSION } // namespace #if _GLIBCXX_USE_C99 #undef wcstold #undef wcstoll #undef wcstoull namespace __gnu_cxx { #if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC extern "C" long double (wcstold)(const wchar_t * __restrict, wchar_t ** __restrict) throw (); #endif # 247 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #if !_GLIBCXX_USE_C99_DYNAMIC using ::wcstold; #endif # 250 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #if _GLIBCXX_USE_C99_LONG_LONG_CHECK || _GLIBCXX_USE_C99_LONG_LONG_DYNAMIC extern "C" long long int (wcstoll)(const wchar_t * __restrict, wchar_t ** __restrict, int) throw (); extern "C" unsigned long long int (wcstoull)(const wchar_t * __restrict, wchar_t ** __restrict, int) throw (); #endif # 256 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC using ::wcstoll; using ::wcstoull; #endif # 260 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 } // namespace __gnu_cxx namespace std { using ::__gnu_cxx::wcstold; using ::__gnu_cxx::wcstoll; using ::__gnu_cxx::wcstoull; } // namespace #endif # 270 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #endif //_GLIBCXX_USE_WCHAR_T # 272 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #if __cplusplus >= 201103L #ifdef _GLIBCXX_USE_WCHAR_T namespace std { #if _GLIBCXX_HAVE_WCSTOF using std::wcstof; #endif # 282 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #if _GLIBCXX_HAVE_VFWSCANF using std::vfwscanf; #endif # 285 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #if _GLIBCXX_HAVE_VSWSCANF using std::vswscanf; #endif # 288 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #if _GLIBCXX_HAVE_VWSCANF using std::vwscanf; #endif # 291 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #if _GLIBCXX_USE_C99 using std::wcstold; using std::wcstoll; using std::wcstoull; #endif # 297 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 } // namespace #endif // _GLIBCXX_USE_WCHAR_T # 300 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #endif // C++11 # 302 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 #endif # 304 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwchar" 3 # 43 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/string_conversions.h" 2 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 43 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/string_conversions.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdio" 1 3 // -*- C++ -*- forwarding header. // Copyright (C) 1997-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file include/cstdio * This is a Standard C++ Library file. You should @c \#include this file * in your programs, rather than any of the @a *.h implementation files. * * This is the C++ version of the Standard C Library header @c stdio.h, * and its contents are (mostly) the same as that header, but are all * contained in the namespace @c std (except for names which are defined * as macros in C). */ // // ISO C++ 14882: 27.8.2 C Library files // #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdio" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdio" 3 # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdio" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdio" 3 # 43 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdio" 3 #ifndef _GLIBCXX_CSTDIO #define _GLIBCXX_CSTDIO 1 #ifndef _GLIBCXX_HAVE_GETS extern "C" char* gets (char* __s) __attribute__((__deprecated__)); #endif # 50 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdio" 3 // Get rid of those macros defined in in lieu of real functions. #undef clearerr #undef fclose #undef feof #undef ferror #undef fflush #undef fgetc #undef fgetpos #undef fgets #undef fopen #undef fprintf #undef fputc #undef fputs #undef fread #undef freopen #undef fscanf #undef fseek #undef fsetpos #undef ftell #undef fwrite #undef getc #undef getchar #if __cplusplus <= 201103L # undef gets #endif # 76 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdio" 3 #undef perror #undef printf #undef putc #undef putchar #undef puts #undef remove #undef rename #undef rewind #undef scanf #undef setbuf #undef setvbuf #undef sprintf #undef sscanf #undef tmpfile #undef tmpnam #undef ungetc #undef vfprintf #undef vprintf #undef vsprintf namespace std { using ::FILE; using ::fpos_t; using ::clearerr; using ::fclose; using ::feof; using ::ferror; using ::fflush; using ::fgetc; using ::fgetpos; using ::fgets; using ::fopen; using ::fprintf; using ::fputc; using ::fputs; using ::fread; using ::freopen; using ::fscanf; using ::fseek; using ::fsetpos; using ::ftell; using ::fwrite; using ::getc; using ::getchar; #if __cplusplus <= 201103L // LWG 2249 using ::gets; #endif # 126 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdio" 3 using ::perror; using ::printf; using ::putc; using ::putchar; using ::puts; using ::remove; using ::rename; using ::rewind; using ::scanf; using ::setbuf; using ::setvbuf; using ::sprintf; using ::sscanf; using ::tmpfile; #if _GLIBCXX_USE_TMPNAM using ::tmpnam; #endif # 143 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdio" 3 using ::ungetc; using ::vfprintf; using ::vprintf; using ::vsprintf; } // namespace #if _GLIBCXX_USE_C99 #undef snprintf #undef vfscanf #undef vscanf #undef vsnprintf #undef vsscanf namespace __gnu_cxx { #if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC extern "C" int (snprintf)(char * __restrict, std::size_t, const char * __restrict, ...) throw (); extern "C" int (vfscanf)(FILE * __restrict, const char * __restrict, __gnuc_va_list); extern "C" int (vscanf)(const char * __restrict, __gnuc_va_list); extern "C" int (vsnprintf)(char * __restrict, std::size_t, const char * __restrict, __gnuc_va_list) throw (); extern "C" int (vsscanf)(const char * __restrict, const char * __restrict, __gnuc_va_list) throw (); #endif # 173 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdio" 3 #if !_GLIBCXX_USE_C99_DYNAMIC using ::snprintf; using ::vfscanf; using ::vscanf; using ::vsnprintf; using ::vsscanf; #endif # 181 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdio" 3 } // namespace __gnu_cxx namespace std { using ::__gnu_cxx::snprintf; using ::__gnu_cxx::vfscanf; using ::__gnu_cxx::vscanf; using ::__gnu_cxx::vsnprintf; using ::__gnu_cxx::vsscanf; } // namespace std #endif // _GLIBCXX_USE_C99 # 193 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdio" 3 #endif # 195 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdio" 3 # 44 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/string_conversions.h" 2 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 44 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/string_conversions.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cerrno" 1 3 // The -*- C++ -*- forwarding header. // Copyright (C) 1997-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file cerrno * This is a Standard C++ Library file. You should @c \#include this file * in your programs, rather than any of the @a *.h implementation files. * * This is the C++ version of the Standard C Library header @c errno.h, * and its contents are (mostly) the same as that header, but are all * contained in the namespace @c std (except for names which are defined * as macros in C). */ // // ISO C++ 14882: 19.3 Error numbers // #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cerrno" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cerrno" 3 # 1 "/usr/include/errno.h" 1 3 4 /* Copyright (C) 1991-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard: 7.5 Errors */ #ifndef _ERRNO_H /* The includer defined __need_Emath if he wants only the definitions of EDOM and ERANGE, and not everything else. */ #ifndef __need_Emath # define _ERRNO_H 1 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 28 "/usr/include/errno.h" 3 4 # 29 "/usr/include/errno.h" 3 4 #endif # 30 "/usr/include/errno.h" 3 4 __BEGIN_DECLS /* Get the error number constants from the system-specific file. This file will test __need_Emath and _ERRNO_H. */ #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 35 "/usr/include/errno.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/errno.h" 1 3 4 /* Error constants. Linux specific version. Copyright (C) 1996-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifdef _ERRNO_H # undef EDOM # undef EILSEQ # undef ERANGE #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 24 "/usr/include/x86_64-linux-gnu/bits/errno.h" 3 4 # 1 "/usr/include/linux/errno.h" 1 3 4 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 1 "/usr/include/linux/errno.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/asm/errno.h" 1 3 4 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 1 "/usr/include/x86_64-linux-gnu/asm/errno.h" 3 4 # 1 "/usr/include/asm-generic/errno.h" 1 3 4 #ifndef _ASM_GENERIC_ERRNO_H #define _ASM_GENERIC_ERRNO_H #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 4 "/usr/include/asm-generic/errno.h" 3 4 # 1 "/usr/include/asm-generic/errno-base.h" 1 3 4 #ifndef _ASM_GENERIC_ERRNO_BASE_H #define _ASM_GENERIC_ERRNO_BASE_H #define EPERM 1 /* Operation not permitted */ #define ENOENT 2 /* No such file or directory */ #define ESRCH 3 /* No such process */ #define EINTR 4 /* Interrupted system call */ #define EIO 5 /* I/O error */ #define ENXIO 6 /* No such device or address */ #define E2BIG 7 /* Argument list too long */ #define ENOEXEC 8 /* Exec format error */ #define EBADF 9 /* Bad file number */ #define ECHILD 10 /* No child processes */ #define EAGAIN 11 /* Try again */ #define ENOMEM 12 /* Out of memory */ #define EACCES 13 /* Permission denied */ #define EFAULT 14 /* Bad address */ #define ENOTBLK 15 /* Block device required */ #define EBUSY 16 /* Device or resource busy */ #define EEXIST 17 /* File exists */ #define EXDEV 18 /* Cross-device link */ #define ENODEV 19 /* No such device */ #define ENOTDIR 20 /* Not a directory */ #define EISDIR 21 /* Is a directory */ #define EINVAL 22 /* Invalid argument */ #define ENFILE 23 /* File table overflow */ #define EMFILE 24 /* Too many open files */ #define ENOTTY 25 /* Not a typewriter */ #define ETXTBSY 26 /* Text file busy */ #define EFBIG 27 /* File too large */ #define ENOSPC 28 /* No space left on device */ #define ESPIPE 29 /* Illegal seek */ #define EROFS 30 /* Read-only file system */ #define EMLINK 31 /* Too many links */ #define EPIPE 32 /* Broken pipe */ #define EDOM 33 /* Math argument out of domain of func */ #define ERANGE 34 /* Math result not representable */ #endif # 40 "/usr/include/asm-generic/errno-base.h" 3 4 # 5 "/usr/include/asm-generic/errno.h" 2 3 4 #define EDEADLK 35 /* Resource deadlock would occur */ #define ENAMETOOLONG 36 /* File name too long */ #define ENOLCK 37 /* No record locks available */ #define ENOSYS 38 /* Function not implemented */ #define ENOTEMPTY 39 /* Directory not empty */ #define ELOOP 40 /* Too many symbolic links encountered */ #define EWOULDBLOCK EAGAIN /* Operation would block */ #define ENOMSG 42 /* No message of desired type */ #define EIDRM 43 /* Identifier removed */ #define ECHRNG 44 /* Channel number out of range */ #define EL2NSYNC 45 /* Level 2 not synchronized */ #define EL3HLT 46 /* Level 3 halted */ #define EL3RST 47 /* Level 3 reset */ #define ELNRNG 48 /* Link number out of range */ #define EUNATCH 49 /* Protocol driver not attached */ #define ENOCSI 50 /* No CSI structure available */ #define EL2HLT 51 /* Level 2 halted */ #define EBADE 52 /* Invalid exchange */ #define EBADR 53 /* Invalid request descriptor */ #define EXFULL 54 /* Exchange full */ #define ENOANO 55 /* No anode */ #define EBADRQC 56 /* Invalid request code */ #define EBADSLT 57 /* Invalid slot */ #define EDEADLOCK EDEADLK #define EBFONT 59 /* Bad font file format */ #define ENOSTR 60 /* Device not a stream */ #define ENODATA 61 /* No data available */ #define ETIME 62 /* Timer expired */ #define ENOSR 63 /* Out of streams resources */ #define ENONET 64 /* Machine is not on the network */ #define ENOPKG 65 /* Package not installed */ #define EREMOTE 66 /* Object is remote */ #define ENOLINK 67 /* Link has been severed */ #define EADV 68 /* Advertise error */ #define ESRMNT 69 /* Srmount error */ #define ECOMM 70 /* Communication error on send */ #define EPROTO 71 /* Protocol error */ #define EMULTIHOP 72 /* Multihop attempted */ #define EDOTDOT 73 /* RFS specific error */ #define EBADMSG 74 /* Not a data message */ #define EOVERFLOW 75 /* Value too large for defined data type */ #define ENOTUNIQ 76 /* Name not unique on network */ #define EBADFD 77 /* File descriptor in bad state */ #define EREMCHG 78 /* Remote address changed */ #define ELIBACC 79 /* Can not access a needed shared library */ #define ELIBBAD 80 /* Accessing a corrupted shared library */ #define ELIBSCN 81 /* .lib section in a.out corrupted */ #define ELIBMAX 82 /* Attempting to link in too many shared libraries */ #define ELIBEXEC 83 /* Cannot exec a shared library directly */ #define EILSEQ 84 /* Illegal byte sequence */ #define ERESTART 85 /* Interrupted system call should be restarted */ #define ESTRPIPE 86 /* Streams pipe error */ #define EUSERS 87 /* Too many users */ #define ENOTSOCK 88 /* Socket operation on non-socket */ #define EDESTADDRREQ 89 /* Destination address required */ #define EMSGSIZE 90 /* Message too long */ #define EPROTOTYPE 91 /* Protocol wrong type for socket */ #define ENOPROTOOPT 92 /* Protocol not available */ #define EPROTONOSUPPORT 93 /* Protocol not supported */ #define ESOCKTNOSUPPORT 94 /* Socket type not supported */ #define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */ #define EPFNOSUPPORT 96 /* Protocol family not supported */ #define EAFNOSUPPORT 97 /* Address family not supported by protocol */ #define EADDRINUSE 98 /* Address already in use */ #define EADDRNOTAVAIL 99 /* Cannot assign requested address */ #define ENETDOWN 100 /* Network is down */ #define ENETUNREACH 101 /* Network is unreachable */ #define ENETRESET 102 /* Network dropped connection because of reset */ #define ECONNABORTED 103 /* Software caused connection abort */ #define ECONNRESET 104 /* Connection reset by peer */ #define ENOBUFS 105 /* No buffer space available */ #define EISCONN 106 /* Transport endpoint is already connected */ #define ENOTCONN 107 /* Transport endpoint is not connected */ #define ESHUTDOWN 108 /* Cannot send after transport endpoint shutdown */ #define ETOOMANYREFS 109 /* Too many references: cannot splice */ #define ETIMEDOUT 110 /* Connection timed out */ #define ECONNREFUSED 111 /* Connection refused */ #define EHOSTDOWN 112 /* Host is down */ #define EHOSTUNREACH 113 /* No route to host */ #define EALREADY 114 /* Operation already in progress */ #define EINPROGRESS 115 /* Operation now in progress */ #define ESTALE 116 /* Stale file handle */ #define EUCLEAN 117 /* Structure needs cleaning */ #define ENOTNAM 118 /* Not a XENIX named type file */ #define ENAVAIL 119 /* No XENIX semaphores available */ #define EISNAM 120 /* Is a named type file */ #define EREMOTEIO 121 /* Remote I/O error */ #define EDQUOT 122 /* Quota exceeded */ #define ENOMEDIUM 123 /* No medium found */ #define EMEDIUMTYPE 124 /* Wrong medium type */ #define ECANCELED 125 /* Operation Canceled */ #define ENOKEY 126 /* Required key not available */ #define EKEYEXPIRED 127 /* Key has expired */ #define EKEYREVOKED 128 /* Key has been revoked */ #define EKEYREJECTED 129 /* Key was rejected by service */ /* for robust mutexes */ #define EOWNERDEAD 130 /* Owner died */ #define ENOTRECOVERABLE 131 /* State not recoverable */ #define ERFKILL 132 /* Operation not possible due to RF-kill */ #define EHWPOISON 133 /* Memory page has hardware error */ #endif # 114 "/usr/include/asm-generic/errno.h" 3 4 # 2 "/usr/include/x86_64-linux-gnu/asm/errno.h" 2 3 4 # 2 "/usr/include/linux/errno.h" 2 3 4 # 25 "/usr/include/x86_64-linux-gnu/bits/errno.h" 2 3 4 /* Linux has no ENOTSUP error code. */ # define ENOTSUP EOPNOTSUPP /* Older Linux versions also had no ECANCELED error code. */ # ifndef ECANCELED # define ECANCELED 125 # endif # 33 "/usr/include/x86_64-linux-gnu/bits/errno.h" 3 4 /* Support for error codes to support robust mutexes was added later, too. */ # ifndef EOWNERDEAD # define EOWNERDEAD 130 # define ENOTRECOVERABLE 131 # endif # 39 "/usr/include/x86_64-linux-gnu/bits/errno.h" 3 4 # ifndef ERFKILL # define ERFKILL 132 # endif # 43 "/usr/include/x86_64-linux-gnu/bits/errno.h" 3 4 # ifndef EHWPOISON # define EHWPOISON 133 # endif # 47 "/usr/include/x86_64-linux-gnu/bits/errno.h" 3 4 # ifndef __ASSEMBLER__ /* Function to get address of global `errno' variable. */ extern int *__errno_location (void) __THROW __attribute__ ((__const__)); # if !defined _LIBC || defined _LIBC_REENTRANT /* When using threads, errno is a per-thread value. */ # define errno (*__errno_location ()) # endif # 56 "/usr/include/x86_64-linux-gnu/bits/errno.h" 3 4 # endif /* !__ASSEMBLER__ */ # 57 "/usr/include/x86_64-linux-gnu/bits/errno.h" 3 4 #endif /* _ERRNO_H */ # 58 "/usr/include/x86_64-linux-gnu/bits/errno.h" 3 4 #if !defined _ERRNO_H && defined __need_Emath /* This is ugly but the kernel header is not clean enough. We must define only the values EDOM, EILSEQ and ERANGE in case __need_Emath is defined. */ # define EDOM 33 /* Math argument out of domain of function. */ # define EILSEQ 84 /* Illegal byte sequence. */ # define ERANGE 34 /* Math result not representable. */ #endif /* !_ERRNO_H && __need_Emath */ # 67 "/usr/include/x86_64-linux-gnu/bits/errno.h" 3 4 # 36 "/usr/include/errno.h" 2 3 4 #undef __need_Emath #ifdef _ERRNO_H /* Declare the `errno' variable, unless it's defined as a macro by bits/errno.h. This is the case in GNU, where it is a per-thread variable. This redeclaration using the macro still works, but it will be a function declaration without a prototype and may trigger a -Wstrict-prototypes warning. */ #ifndef errno extern int errno; #endif # 48 "/usr/include/errno.h" 3 4 #ifdef __USE_GNU /* The full and simple forms of the name with which the program was invoked. These variables are set up automatically at startup based on the value of ARGV[0] (this works only if you use GNU ld). */ extern char *program_invocation_name, *program_invocation_short_name; #endif /* __USE_GNU */ # 56 "/usr/include/errno.h" 3 4 #endif /* _ERRNO_H */ # 57 "/usr/include/errno.h" 3 4 __END_DECLS #endif /* _ERRNO_H */ # 61 "/usr/include/errno.h" 3 4 /* The Hurd defines `error_t' as an enumerated type so that printing `error_t' values in the debugger shows the names. We might need this definition sometimes even if this file was included before. */ #if defined __USE_GNU || defined __need_error_t # ifndef __error_t_defined typedef int error_t; # define __error_t_defined 1 # endif # 71 "/usr/include/errno.h" 3 4 # undef __need_error_t #endif # 73 "/usr/include/errno.h" 3 4 # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cerrno" 2 3 #ifndef _GLIBCXX_CERRNO #define _GLIBCXX_CERRNO 1 // Adhere to section 17.4.1.2 clause 5 of ISO 14882:1998 #ifndef errno #define errno errno #endif # 50 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cerrno" 3 #endif # 52 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cerrno" 3 # 45 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/string_conversions.h" 2 3 namespace __gnu_cxx _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION // Helper for all the sto* functions. template _Ret __stoa(_TRet (*__convf) (const _CharT*, _CharT**, _Base...), const char* __name, const _CharT* __str, std::size_t* __idx, _Base... __base) { _Ret __ret; _CharT* __endptr; errno = 0; const _TRet __tmp = __convf(__str, &__endptr, __base...); if (__endptr == __str) std::__throw_invalid_argument(__name); else if (errno == ERANGE || (std::__are_same<_Ret, int>::__value && (__tmp < __numeric_traits::__min || __tmp > __numeric_traits::__max))) std::__throw_out_of_range(__name); else __ret = __tmp; if (__idx) *__idx = __endptr - __str; return __ret; } // Helper for the to_string / to_wstring functions. template _String __to_xstring(int (*__convf) (_CharT*, std::size_t, const _CharT*, __builtin_va_list), std::size_t __n, const _CharT* __fmt, ...) { // XXX Eventually the result will be constructed in place in // the C++0x string, likely with the help of internal hooks. _CharT* __s = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) * __n)); __builtin_va_list __args; __builtin_va_start(__args, __fmt); const int __len = __convf(__s, __n, __fmt, __args); __builtin_va_end(__args); return _String(__s, __s + __len); } _GLIBCXX_END_NAMESPACE_VERSION } // namespace #endif // C++11 # 106 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/string_conversions.h" 3 #endif // _STRING_CONVERSIONS_H # 108 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ext/string_conversions.h" 3 # 5335 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 2 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION _GLIBCXX_BEGIN_NAMESPACE_CXX11 // 21.4 Numeric Conversions [string.conversions]. inline int stoi(const string& __str, size_t* __idx = 0, int __base = 10) { return __gnu_cxx::__stoa(&std::strtol, "stoi", __str.c_str(), __idx, __base); } inline long stol(const string& __str, size_t* __idx = 0, int __base = 10) { return __gnu_cxx::__stoa(&std::strtol, "stol", __str.c_str(), __idx, __base); } inline unsigned long stoul(const string& __str, size_t* __idx = 0, int __base = 10) { return __gnu_cxx::__stoa(&std::strtoul, "stoul", __str.c_str(), __idx, __base); } inline long long stoll(const string& __str, size_t* __idx = 0, int __base = 10) { return __gnu_cxx::__stoa(&std::strtoll, "stoll", __str.c_str(), __idx, __base); } inline unsigned long long stoull(const string& __str, size_t* __idx = 0, int __base = 10) { return __gnu_cxx::__stoa(&std::strtoull, "stoull", __str.c_str(), __idx, __base); } // NB: strtof vs strtod. inline float stof(const string& __str, size_t* __idx = 0) { return __gnu_cxx::__stoa(&std::strtof, "stof", __str.c_str(), __idx); } inline double stod(const string& __str, size_t* __idx = 0) { return __gnu_cxx::__stoa(&std::strtod, "stod", __str.c_str(), __idx); } inline long double stold(const string& __str, size_t* __idx = 0) { return __gnu_cxx::__stoa(&std::strtold, "stold", __str.c_str(), __idx); } // NB: (v)snprintf vs sprintf. // DR 1261. inline string to_string(int __val) { return __gnu_cxx::__to_xstring(&std::vsnprintf, 4 * sizeof(int), "%d", __val); } inline string to_string(unsigned __val) { return __gnu_cxx::__to_xstring(&std::vsnprintf, 4 * sizeof(unsigned), "%u", __val); } inline string to_string(long __val) { return __gnu_cxx::__to_xstring(&std::vsnprintf, 4 * sizeof(long), "%ld", __val); } inline string to_string(unsigned long __val) { return __gnu_cxx::__to_xstring(&std::vsnprintf, 4 * sizeof(unsigned long), "%lu", __val); } inline string to_string(long long __val) { return __gnu_cxx::__to_xstring(&std::vsnprintf, 4 * sizeof(long long), "%lld", __val); } inline string to_string(unsigned long long __val) { return __gnu_cxx::__to_xstring(&std::vsnprintf, 4 * sizeof(unsigned long long), "%llu", __val); } inline string to_string(float __val) { const int __n = __gnu_cxx::__numeric_traits::__max_exponent10 + 20; return __gnu_cxx::__to_xstring(&std::vsnprintf, __n, "%f", __val); } inline string to_string(double __val) { const int __n = __gnu_cxx::__numeric_traits::__max_exponent10 + 20; return __gnu_cxx::__to_xstring(&std::vsnprintf, __n, "%f", __val); } inline string to_string(long double __val) { const int __n = __gnu_cxx::__numeric_traits::__max_exponent10 + 20; return __gnu_cxx::__to_xstring(&std::vsnprintf, __n, "%Lf", __val); } #ifdef _GLIBCXX_USE_WCHAR_T inline int stoi(const wstring& __str, size_t* __idx = 0, int __base = 10) { return __gnu_cxx::__stoa(&std::wcstol, "stoi", __str.c_str(), __idx, __base); } inline long stol(const wstring& __str, size_t* __idx = 0, int __base = 10) { return __gnu_cxx::__stoa(&std::wcstol, "stol", __str.c_str(), __idx, __base); } inline unsigned long stoul(const wstring& __str, size_t* __idx = 0, int __base = 10) { return __gnu_cxx::__stoa(&std::wcstoul, "stoul", __str.c_str(), __idx, __base); } inline long long stoll(const wstring& __str, size_t* __idx = 0, int __base = 10) { return __gnu_cxx::__stoa(&std::wcstoll, "stoll", __str.c_str(), __idx, __base); } inline unsigned long long stoull(const wstring& __str, size_t* __idx = 0, int __base = 10) { return __gnu_cxx::__stoa(&std::wcstoull, "stoull", __str.c_str(), __idx, __base); } // NB: wcstof vs wcstod. inline float stof(const wstring& __str, size_t* __idx = 0) { return __gnu_cxx::__stoa(&std::wcstof, "stof", __str.c_str(), __idx); } inline double stod(const wstring& __str, size_t* __idx = 0) { return __gnu_cxx::__stoa(&std::wcstod, "stod", __str.c_str(), __idx); } inline long double stold(const wstring& __str, size_t* __idx = 0) { return __gnu_cxx::__stoa(&std::wcstold, "stold", __str.c_str(), __idx); } #ifndef _GLIBCXX_HAVE_BROKEN_VSWPRINTF // DR 1261. inline wstring to_wstring(int __val) { return __gnu_cxx::__to_xstring(&std::vswprintf, 4 * sizeof(int), L"%d", __val); } inline wstring to_wstring(unsigned __val) { return __gnu_cxx::__to_xstring(&std::vswprintf, 4 * sizeof(unsigned), L"%u", __val); } inline wstring to_wstring(long __val) { return __gnu_cxx::__to_xstring(&std::vswprintf, 4 * sizeof(long), L"%ld", __val); } inline wstring to_wstring(unsigned long __val) { return __gnu_cxx::__to_xstring(&std::vswprintf, 4 * sizeof(unsigned long), L"%lu", __val); } inline wstring to_wstring(long long __val) { return __gnu_cxx::__to_xstring(&std::vswprintf, 4 * sizeof(long long), L"%lld", __val); } inline wstring to_wstring(unsigned long long __val) { return __gnu_cxx::__to_xstring(&std::vswprintf, 4 * sizeof(unsigned long long), L"%llu", __val); } inline wstring to_wstring(float __val) { const int __n = __gnu_cxx::__numeric_traits::__max_exponent10 + 20; return __gnu_cxx::__to_xstring(&std::vswprintf, __n, L"%f", __val); } inline wstring to_wstring(double __val) { const int __n = __gnu_cxx::__numeric_traits::__max_exponent10 + 20; return __gnu_cxx::__to_xstring(&std::vswprintf, __n, L"%f", __val); } inline wstring to_wstring(long double __val) { const int __n = __gnu_cxx::__numeric_traits::__max_exponent10 + 20; return __gnu_cxx::__to_xstring(&std::vswprintf, __n, L"%Lf", __val); } #endif // _GLIBCXX_HAVE_BROKEN_VSWPRINTF # 5546 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 #endif # 5547 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 _GLIBCXX_END_NAMESPACE_CXX11 _GLIBCXX_END_NAMESPACE_VERSION } // namespace #endif /* C++11 && _GLIBCXX_USE_C99 ... */ # 5553 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 #if __cplusplus >= 201103L #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 5556 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 # 5557 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION // DR 1182. #ifndef _GLIBCXX_COMPATIBILITY_CXX0X /// std::hash specialization for string. template<> struct hash : public __hash_base { size_t operator()(const string& __s) const noexcept { return std::_Hash_impl::hash(__s.data(), __s.length()); } }; template<> struct __is_fast_hash> : std::false_type { }; #ifdef _GLIBCXX_USE_WCHAR_T /// std::hash specialization for wstring. template<> struct hash : public __hash_base { size_t operator()(const wstring& __s) const noexcept { return std::_Hash_impl::hash(__s.data(), __s.length() * sizeof(wchar_t)); } }; template<> struct __is_fast_hash> : std::false_type { }; #endif # 5595 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 #endif /* _GLIBCXX_COMPATIBILITY_CXX0X */ # 5596 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 #ifdef _GLIBCXX_USE_C99_STDINT_TR1 /// std::hash specialization for u16string. template<> struct hash : public __hash_base { size_t operator()(const u16string& __s) const noexcept { return std::_Hash_impl::hash(__s.data(), __s.length() * sizeof(char16_t)); } }; template<> struct __is_fast_hash> : std::false_type { }; /// std::hash specialization for u32string. template<> struct hash : public __hash_base { size_t operator()(const u32string& __s) const noexcept { return std::_Hash_impl::hash(__s.data(), __s.length() * sizeof(char32_t)); } }; template<> struct __is_fast_hash> : std::false_type { }; #endif # 5628 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 #if __cplusplus > 201103L #define __cpp_lib_string_udls 201304 inline namespace literals { inline namespace string_literals { _GLIBCXX_DEFAULT_ABI_TAG inline basic_string operator""s(const char* __str, size_t __len) { return basic_string{__str, __len}; } #ifdef _GLIBCXX_USE_WCHAR_T _GLIBCXX_DEFAULT_ABI_TAG inline basic_string operator""s(const wchar_t* __str, size_t __len) { return basic_string{__str, __len}; } #endif # 5649 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 #ifdef _GLIBCXX_USE_C99_STDINT_TR1 _GLIBCXX_DEFAULT_ABI_TAG inline basic_string operator""s(const char16_t* __str, size_t __len) { return basic_string{__str, __len}; } _GLIBCXX_DEFAULT_ABI_TAG inline basic_string operator""s(const char32_t* __str, size_t __len) { return basic_string{__str, __len}; } #endif # 5661 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 } // inline namespace string_literals } // inline namespace literals #endif // __cplusplus > 201103L # 5666 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 _GLIBCXX_END_NAMESPACE_VERSION } // namespace std #endif // C++11 # 5671 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 #endif /* _BASIC_STRING_H */ # 5673 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.h" 3 # 53 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/string" 2 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 53 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/string" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.tcc" 1 3 // Components for manipulating sequences of characters -*- C++ -*- // Copyright (C) 1997-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file bits/basic_string.tcc * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{string} */ // // ISO C++ 14882: 21 Strings library // // Written by Jason Merrill based upon the specification by Takanori Adachi // in ANSI X3J16/94-0013R2. Rewritten by Nathan Myers to ISO-14882. // Non-reference-counted implementation written by Paolo Carlini and // updated by Jonathan Wakely for ISO-14882-2011. #ifndef _BASIC_STRING_TCC #define _BASIC_STRING_TCC 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 43 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.tcc" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 44 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.tcc" 3 # 45 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.tcc" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION #if _GLIBCXX_USE_CXX11_ABI template const typename basic_string<_CharT, _Traits, _Alloc>::size_type basic_string<_CharT, _Traits, _Alloc>::npos; template void basic_string<_CharT, _Traits, _Alloc>:: swap(basic_string& __s) _GLIBCXX_NOEXCEPT { if (this == &__s) return; _Alloc_traits::_S_on_swap(_M_get_allocator(), __s._M_get_allocator()); if (_M_is_local()) if (__s._M_is_local()) { if (length() && __s.length()) { _CharT __tmp_data[_S_local_capacity + 1]; traits_type::copy(__tmp_data, __s._M_local_buf, _S_local_capacity + 1); traits_type::copy(__s._M_local_buf, _M_local_buf, _S_local_capacity + 1); traits_type::copy(_M_local_buf, __tmp_data, _S_local_capacity + 1); } else if (__s.length()) { traits_type::copy(_M_local_buf, __s._M_local_buf, _S_local_capacity + 1); _M_length(__s.length()); __s._M_set_length(0); return; } else if (length()) { traits_type::copy(__s._M_local_buf, _M_local_buf, _S_local_capacity + 1); __s._M_length(length()); _M_set_length(0); return; } } else { const size_type __tmp_capacity = __s._M_allocated_capacity; traits_type::copy(__s._M_local_buf, _M_local_buf, _S_local_capacity + 1); _M_data(__s._M_data()); __s._M_data(__s._M_local_buf); _M_capacity(__tmp_capacity); } else { const size_type __tmp_capacity = _M_allocated_capacity; if (__s._M_is_local()) { traits_type::copy(_M_local_buf, __s._M_local_buf, _S_local_capacity + 1); __s._M_data(_M_data()); _M_data(_M_local_buf); } else { pointer __tmp_ptr = _M_data(); _M_data(__s._M_data()); __s._M_data(__tmp_ptr); _M_capacity(__s._M_allocated_capacity); } __s._M_capacity(__tmp_capacity); } const size_type __tmp_length = length(); _M_length(__s.length()); __s._M_length(__tmp_length); } template typename basic_string<_CharT, _Traits, _Alloc>::pointer basic_string<_CharT, _Traits, _Alloc>:: _M_create(size_type& __capacity, size_type __old_capacity) { // _GLIBCXX_RESOLVE_LIB_DEFECTS // 83. String::npos vs. string::max_size() if (__capacity > max_size()) std::__throw_length_error(__N("basic_string::_M_create")); // The below implements an exponential growth policy, necessary to // meet amortized linear time requirements of the library: see // http://gcc.gnu.org/ml/libstdc++/2001-07/msg00085.html. if (__capacity > __old_capacity && __capacity < 2 * __old_capacity) { __capacity = 2 * __old_capacity; // Never allocate a string bigger than max_size. if (__capacity > max_size()) __capacity = max_size(); } // NB: Need an array of char_type[__capacity], plus a terminating // null char_type() element. return _Alloc_traits::allocate(_M_get_allocator(), __capacity + 1); } // NB: This is the special case for Input Iterators, used in // istreambuf_iterators, etc. // Input Iterators have a cost structure very different from // pointers, calling for a different coding style. template template void basic_string<_CharT, _Traits, _Alloc>:: _M_construct(_InIterator __beg, _InIterator __end, std::input_iterator_tag) { size_type __len = 0; size_type __capacity = size_type(_S_local_capacity); while (__beg != __end && __len < __capacity) { _M_data()[__len++] = *__beg; ++__beg; } __try { while (__beg != __end) { if (__len == __capacity) { // Allocate more space. __capacity = __len + 1; pointer __another = _M_create(__capacity, __len); this->_S_copy(__another, _M_data(), __len); _M_dispose(); _M_data(__another); _M_capacity(__capacity); } _M_data()[__len++] = *__beg; ++__beg; } } __catch(...) { _M_dispose(); __throw_exception_again; } _M_set_length(__len); } template template void basic_string<_CharT, _Traits, _Alloc>:: _M_construct(_InIterator __beg, _InIterator __end, std::forward_iterator_tag) { // NB: Not required, but considered best practice. if (__gnu_cxx::__is_null_pointer(__beg) && __beg != __end) std::__throw_logic_error(__N("basic_string::" "_M_construct null not valid")); size_type __dnew = static_cast(std::distance(__beg, __end)); if (__dnew > size_type(_S_local_capacity)) { _M_data(_M_create(__dnew, size_type(0))); _M_capacity(__dnew); } // Check for out_of_range and length_error exceptions. __try { this->_S_copy_chars(_M_data(), __beg, __end); } __catch(...) { _M_dispose(); __throw_exception_again; } _M_set_length(__dnew); } template void basic_string<_CharT, _Traits, _Alloc>:: _M_construct(size_type __n, _CharT __c) { if (__n > size_type(_S_local_capacity)) { _M_data(_M_create(__n, size_type(0))); _M_capacity(__n); } if (__n) this->_S_assign(_M_data(), __n, __c); _M_set_length(__n); } template void basic_string<_CharT, _Traits, _Alloc>:: _M_assign(const basic_string& __str) { if (this != &__str) { const size_type __rsize = __str.length(); const size_type __capacity = capacity(); if (__rsize > __capacity) { size_type __new_capacity = __rsize; pointer __tmp = _M_create(__new_capacity, __capacity); _M_dispose(); _M_data(__tmp); _M_capacity(__new_capacity); } if (__rsize) this->_S_copy(_M_data(), __str._M_data(), __rsize); _M_set_length(__rsize); } } template void basic_string<_CharT, _Traits, _Alloc>:: reserve(size_type __res) { // Make sure we don't shrink below the current size. if (__res < length()) __res = length(); const size_type __capacity = capacity(); if (__res != __capacity) { if (__res > __capacity || __res > size_type(_S_local_capacity)) { pointer __tmp = _M_create(__res, __capacity); this->_S_copy(__tmp, _M_data(), length() + 1); _M_dispose(); _M_data(__tmp); _M_capacity(__res); } else if (!_M_is_local()) { this->_S_copy(_M_local_data(), _M_data(), length() + 1); _M_destroy(__capacity); _M_data(_M_local_data()); } } } template void basic_string<_CharT, _Traits, _Alloc>:: _M_mutate(size_type __pos, size_type __len1, const _CharT* __s, size_type __len2) { const size_type __how_much = length() - __pos - __len1; size_type __new_capacity = length() + __len2 - __len1; pointer __r = _M_create(__new_capacity, capacity()); if (__pos) this->_S_copy(__r, _M_data(), __pos); if (__s && __len2) this->_S_copy(__r + __pos, __s, __len2); if (__how_much) this->_S_copy(__r + __pos + __len2, _M_data() + __pos + __len1, __how_much); _M_dispose(); _M_data(__r); _M_capacity(__new_capacity); } template void basic_string<_CharT, _Traits, _Alloc>:: _M_erase(size_type __pos, size_type __n) { const size_type __how_much = length() - __pos - __n; if (__how_much && __n) this->_S_move(_M_data() + __pos, _M_data() + __pos + __n, __how_much); _M_set_length(length() - __n); } template void basic_string<_CharT, _Traits, _Alloc>:: resize(size_type __n, _CharT __c) { const size_type __size = this->size(); if (__size < __n) this->append(__n - __size, __c); else if (__n < __size) this->_M_erase(__n, __size - __n); } template basic_string<_CharT, _Traits, _Alloc>& basic_string<_CharT, _Traits, _Alloc>:: _M_append(const _CharT* __s, size_type __n) { const size_type __len = __n + this->size(); if (__len <= this->capacity()) { if (__n) this->_S_copy(this->_M_data() + this->size(), __s, __n); } else this->_M_mutate(this->size(), size_type(0), __s, __n); this->_M_set_length(__len); return *this; } template template basic_string<_CharT, _Traits, _Alloc>& basic_string<_CharT, _Traits, _Alloc>:: _M_replace_dispatch(const_iterator __i1, const_iterator __i2, _InputIterator __k1, _InputIterator __k2, std::__false_type) { const basic_string __s(__k1, __k2); const size_type __n1 = __i2 - __i1; return _M_replace(__i1 - begin(), __n1, __s._M_data(), __s.size()); } template basic_string<_CharT, _Traits, _Alloc>& basic_string<_CharT, _Traits, _Alloc>:: _M_replace_aux(size_type __pos1, size_type __n1, size_type __n2, _CharT __c) { _M_check_length(__n1, __n2, "basic_string::_M_replace_aux"); const size_type __old_size = this->size(); const size_type __new_size = __old_size + __n2 - __n1; if (__new_size <= this->capacity()) { pointer __p = this->_M_data() + __pos1; const size_type __how_much = __old_size - __pos1 - __n1; if (__how_much && __n1 != __n2) this->_S_move(__p + __n2, __p + __n1, __how_much); } else this->_M_mutate(__pos1, __n1, 0, __n2); if (__n2) this->_S_assign(this->_M_data() + __pos1, __n2, __c); this->_M_set_length(__new_size); return *this; } template basic_string<_CharT, _Traits, _Alloc>& basic_string<_CharT, _Traits, _Alloc>:: _M_replace(size_type __pos, size_type __len1, const _CharT* __s, const size_type __len2) { _M_check_length(__len1, __len2, "basic_string::_M_replace"); const size_type __old_size = this->size(); const size_type __new_size = __old_size + __len2 - __len1; if (__new_size <= this->capacity()) { pointer __p = this->_M_data() + __pos; const size_type __how_much = __old_size - __pos - __len1; if (_M_disjunct(__s)) { if (__how_much && __len1 != __len2) this->_S_move(__p + __len2, __p + __len1, __how_much); if (__len2) this->_S_copy(__p, __s, __len2); } else { // Work in-place. if (__len2 && __len2 <= __len1) this->_S_move(__p, __s, __len2); if (__how_much && __len1 != __len2) this->_S_move(__p + __len2, __p + __len1, __how_much); if (__len2 > __len1) { if (__s + __len2 <= __p + __len1) this->_S_move(__p, __s, __len2); else if (__s >= __p + __len1) this->_S_copy(__p, __s + __len2 - __len1, __len2); else { const size_type __nleft = (__p + __len1) - __s; this->_S_move(__p, __s, __nleft); this->_S_copy(__p + __nleft, __p + __len2, __len2 - __nleft); } } } } else this->_M_mutate(__pos, __len1, __s, __len2); this->_M_set_length(__new_size); return *this; } template typename basic_string<_CharT, _Traits, _Alloc>::size_type basic_string<_CharT, _Traits, _Alloc>:: copy(_CharT* __s, size_type __n, size_type __pos) const { _M_check(__pos, "basic_string::copy"); __n = _M_limit(__pos, __n); __glibcxx_requires_string_len(__s, __n); if (__n) _S_copy(__s, _M_data() + __pos, __n); // 21.3.5.7 par 3: do not append null. (good.) return __n; } #else // !_GLIBCXX_USE_CXX11_ABI # 487 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.tcc" 3 template const typename basic_string<_CharT, _Traits, _Alloc>::size_type basic_string<_CharT, _Traits, _Alloc>:: _Rep::_S_max_size = (((npos - sizeof(_Rep_base))/sizeof(_CharT)) - 1) / 4; template const _CharT basic_string<_CharT, _Traits, _Alloc>:: _Rep::_S_terminal = _CharT(); template const typename basic_string<_CharT, _Traits, _Alloc>::size_type basic_string<_CharT, _Traits, _Alloc>::npos; // Linker sets _S_empty_rep_storage to all 0s (one reference, empty string) // at static init time (before static ctors are run). template typename basic_string<_CharT, _Traits, _Alloc>::size_type basic_string<_CharT, _Traits, _Alloc>::_Rep::_S_empty_rep_storage[ (sizeof(_Rep_base) + sizeof(_CharT) + sizeof(size_type) - 1) / sizeof(size_type)]; // NB: This is the special case for Input Iterators, used in // istreambuf_iterators, etc. // Input Iterators have a cost structure very different from // pointers, calling for a different coding style. template template _CharT* basic_string<_CharT, _Traits, _Alloc>:: _S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a, input_iterator_tag) { #if _GLIBCXX_FULLY_DYNAMIC_STRING == 0 if (__beg == __end && __a == _Alloc()) return _S_empty_rep()._M_refdata(); #endif # 525 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.tcc" 3 // Avoid reallocation for common case. _CharT __buf[128]; size_type __len = 0; while (__beg != __end && __len < sizeof(__buf) / sizeof(_CharT)) { __buf[__len++] = *__beg; ++__beg; } _Rep* __r = _Rep::_S_create(__len, size_type(0), __a); _M_copy(__r->_M_refdata(), __buf, __len); __try { while (__beg != __end) { if (__len == __r->_M_capacity) { // Allocate more space. _Rep* __another = _Rep::_S_create(__len + 1, __len, __a); _M_copy(__another->_M_refdata(), __r->_M_refdata(), __len); __r->_M_destroy(__a); __r = __another; } __r->_M_refdata()[__len++] = *__beg; ++__beg; } } __catch(...) { __r->_M_destroy(__a); __throw_exception_again; } __r->_M_set_length_and_sharable(__len); return __r->_M_refdata(); } template template _CharT* basic_string<_CharT, _Traits, _Alloc>:: _S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a, forward_iterator_tag) { #if _GLIBCXX_FULLY_DYNAMIC_STRING == 0 if (__beg == __end && __a == _Alloc()) return _S_empty_rep()._M_refdata(); #endif # 571 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.tcc" 3 // NB: Not required, but considered best practice. if (__gnu_cxx::__is_null_pointer(__beg) && __beg != __end) __throw_logic_error(__N("basic_string::_S_construct null not valid")); const size_type __dnew = static_cast(std::distance(__beg, __end)); // Check for out_of_range and length_error exceptions. _Rep* __r = _Rep::_S_create(__dnew, size_type(0), __a); __try { _S_copy_chars(__r->_M_refdata(), __beg, __end); } __catch(...) { __r->_M_destroy(__a); __throw_exception_again; } __r->_M_set_length_and_sharable(__dnew); return __r->_M_refdata(); } template _CharT* basic_string<_CharT, _Traits, _Alloc>:: _S_construct(size_type __n, _CharT __c, const _Alloc& __a) { #if _GLIBCXX_FULLY_DYNAMIC_STRING == 0 if (__n == 0 && __a == _Alloc()) return _S_empty_rep()._M_refdata(); #endif # 599 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.tcc" 3 // Check for out_of_range and length_error exceptions. _Rep* __r = _Rep::_S_create(__n, size_type(0), __a); if (__n) _M_assign(__r->_M_refdata(), __n, __c); __r->_M_set_length_and_sharable(__n); return __r->_M_refdata(); } template basic_string<_CharT, _Traits, _Alloc>:: basic_string(const basic_string& __str) : _M_dataplus(__str._M_rep()->_M_grab(_Alloc(__str.get_allocator()), __str.get_allocator()), __str.get_allocator()) { } template basic_string<_CharT, _Traits, _Alloc>:: basic_string(const _Alloc& __a) : _M_dataplus(_S_construct(size_type(), _CharT(), __a), __a) { } template basic_string<_CharT, _Traits, _Alloc>:: basic_string(const basic_string& __str, size_type __pos, size_type __n) : _M_dataplus(_S_construct(__str._M_data() + __str._M_check(__pos, "basic_string::basic_string"), __str._M_data() + __str._M_limit(__pos, __n) + __pos, _Alloc()), _Alloc()) { } template basic_string<_CharT, _Traits, _Alloc>:: basic_string(const basic_string& __str, size_type __pos, size_type __n, const _Alloc& __a) : _M_dataplus(_S_construct(__str._M_data() + __str._M_check(__pos, "basic_string::basic_string"), __str._M_data() + __str._M_limit(__pos, __n) + __pos, __a), __a) { } // TBD: DPG annotate template basic_string<_CharT, _Traits, _Alloc>:: basic_string(const _CharT* __s, size_type __n, const _Alloc& __a) : _M_dataplus(_S_construct(__s, __s + __n, __a), __a) { } // TBD: DPG annotate template basic_string<_CharT, _Traits, _Alloc>:: basic_string(const _CharT* __s, const _Alloc& __a) : _M_dataplus(_S_construct(__s, __s ? __s + traits_type::length(__s) : __s + npos, __a), __a) { } template basic_string<_CharT, _Traits, _Alloc>:: basic_string(size_type __n, _CharT __c, const _Alloc& __a) : _M_dataplus(_S_construct(__n, __c, __a), __a) { } // TBD: DPG annotate template template basic_string<_CharT, _Traits, _Alloc>:: basic_string(_InputIterator __beg, _InputIterator __end, const _Alloc& __a) : _M_dataplus(_S_construct(__beg, __end, __a), __a) { } #if __cplusplus >= 201103L template basic_string<_CharT, _Traits, _Alloc>:: basic_string(initializer_list<_CharT> __l, const _Alloc& __a) : _M_dataplus(_S_construct(__l.begin(), __l.end(), __a), __a) { } #endif # 679 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.tcc" 3 template basic_string<_CharT, _Traits, _Alloc>& basic_string<_CharT, _Traits, _Alloc>:: assign(const basic_string& __str) { if (_M_rep() != __str._M_rep()) { // XXX MT const allocator_type __a = this->get_allocator(); _CharT* __tmp = __str._M_rep()->_M_grab(__a, __str.get_allocator()); _M_rep()->_M_dispose(__a); _M_data(__tmp); } return *this; } template basic_string<_CharT, _Traits, _Alloc>& basic_string<_CharT, _Traits, _Alloc>:: assign(const _CharT* __s, size_type __n) { __glibcxx_requires_string_len(__s, __n); _M_check_length(this->size(), __n, "basic_string::assign"); if (_M_disjunct(__s) || _M_rep()->_M_is_shared()) return _M_replace_safe(size_type(0), this->size(), __s, __n); else { // Work in-place. const size_type __pos = __s - _M_data(); if (__pos >= __n) _M_copy(_M_data(), __s, __n); else if (__pos) _M_move(_M_data(), __s, __n); _M_rep()->_M_set_length_and_sharable(__n); return *this; } } template basic_string<_CharT, _Traits, _Alloc>& basic_string<_CharT, _Traits, _Alloc>:: append(size_type __n, _CharT __c) { if (__n) { _M_check_length(size_type(0), __n, "basic_string::append"); const size_type __len = __n + this->size(); if (__len > this->capacity() || _M_rep()->_M_is_shared()) this->reserve(__len); _M_assign(_M_data() + this->size(), __n, __c); _M_rep()->_M_set_length_and_sharable(__len); } return *this; } template basic_string<_CharT, _Traits, _Alloc>& basic_string<_CharT, _Traits, _Alloc>:: append(const _CharT* __s, size_type __n) { __glibcxx_requires_string_len(__s, __n); if (__n) { _M_check_length(size_type(0), __n, "basic_string::append"); const size_type __len = __n + this->size(); if (__len > this->capacity() || _M_rep()->_M_is_shared()) { if (_M_disjunct(__s)) this->reserve(__len); else { const size_type __off = __s - _M_data(); this->reserve(__len); __s = _M_data() + __off; } } _M_copy(_M_data() + this->size(), __s, __n); _M_rep()->_M_set_length_and_sharable(__len); } return *this; } template basic_string<_CharT, _Traits, _Alloc>& basic_string<_CharT, _Traits, _Alloc>:: append(const basic_string& __str) { const size_type __size = __str.size(); if (__size) { const size_type __len = __size + this->size(); if (__len > this->capacity() || _M_rep()->_M_is_shared()) this->reserve(__len); _M_copy(_M_data() + this->size(), __str._M_data(), __size); _M_rep()->_M_set_length_and_sharable(__len); } return *this; } template basic_string<_CharT, _Traits, _Alloc>& basic_string<_CharT, _Traits, _Alloc>:: append(const basic_string& __str, size_type __pos, size_type __n) { __str._M_check(__pos, "basic_string::append"); __n = __str._M_limit(__pos, __n); if (__n) { const size_type __len = __n + this->size(); if (__len > this->capacity() || _M_rep()->_M_is_shared()) this->reserve(__len); _M_copy(_M_data() + this->size(), __str._M_data() + __pos, __n); _M_rep()->_M_set_length_and_sharable(__len); } return *this; } template basic_string<_CharT, _Traits, _Alloc>& basic_string<_CharT, _Traits, _Alloc>:: insert(size_type __pos, const _CharT* __s, size_type __n) { __glibcxx_requires_string_len(__s, __n); _M_check(__pos, "basic_string::insert"); _M_check_length(size_type(0), __n, "basic_string::insert"); if (_M_disjunct(__s) || _M_rep()->_M_is_shared()) return _M_replace_safe(__pos, size_type(0), __s, __n); else { // Work in-place. const size_type __off = __s - _M_data(); _M_mutate(__pos, 0, __n); __s = _M_data() + __off; _CharT* __p = _M_data() + __pos; if (__s + __n <= __p) _M_copy(__p, __s, __n); else if (__s >= __p) _M_copy(__p, __s + __n, __n); else { const size_type __nleft = __p - __s; _M_copy(__p, __s, __nleft); _M_copy(__p + __nleft, __p + __n, __n - __nleft); } return *this; } } template typename basic_string<_CharT, _Traits, _Alloc>::iterator basic_string<_CharT, _Traits, _Alloc>:: erase(iterator __first, iterator __last) { _GLIBCXX_DEBUG_PEDASSERT(__first >= _M_ibegin() && __first <= __last && __last <= _M_iend()); // NB: This isn't just an optimization (bail out early when // there is nothing to do, really), it's also a correctness // issue vs MT, see libstdc++/40518. const size_type __size = __last - __first; if (__size) { const size_type __pos = __first - _M_ibegin(); _M_mutate(__pos, __size, size_type(0)); _M_rep()->_M_set_leaked(); return iterator(_M_data() + __pos); } else return __first; } template basic_string<_CharT, _Traits, _Alloc>& basic_string<_CharT, _Traits, _Alloc>:: replace(size_type __pos, size_type __n1, const _CharT* __s, size_type __n2) { __glibcxx_requires_string_len(__s, __n2); _M_check(__pos, "basic_string::replace"); __n1 = _M_limit(__pos, __n1); _M_check_length(__n1, __n2, "basic_string::replace"); bool __left; if (_M_disjunct(__s) || _M_rep()->_M_is_shared()) return _M_replace_safe(__pos, __n1, __s, __n2); else if ((__left = __s + __n2 <= _M_data() + __pos) || _M_data() + __pos + __n1 <= __s) { // Work in-place: non-overlapping case. size_type __off = __s - _M_data(); __left ? __off : (__off += __n2 - __n1); _M_mutate(__pos, __n1, __n2); _M_copy(_M_data() + __pos, _M_data() + __off, __n2); return *this; } else { // Todo: overlapping case. const basic_string __tmp(__s, __n2); return _M_replace_safe(__pos, __n1, __tmp._M_data(), __n2); } } template void basic_string<_CharT, _Traits, _Alloc>::_Rep:: _M_destroy(const _Alloc& __a) throw () { const size_type __size = sizeof(_Rep_base) + (this->_M_capacity + 1) * sizeof(_CharT); _Raw_bytes_alloc(__a).deallocate(reinterpret_cast(this), __size); } template void basic_string<_CharT, _Traits, _Alloc>:: _M_leak_hard() { #if _GLIBCXX_FULLY_DYNAMIC_STRING == 0 if (_M_rep() == &_S_empty_rep()) return; #endif # 901 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.tcc" 3 if (_M_rep()->_M_is_shared()) _M_mutate(0, 0, 0); _M_rep()->_M_set_leaked(); } template void basic_string<_CharT, _Traits, _Alloc>:: _M_mutate(size_type __pos, size_type __len1, size_type __len2) { const size_type __old_size = this->size(); const size_type __new_size = __old_size + __len2 - __len1; const size_type __how_much = __old_size - __pos - __len1; if (__new_size > this->capacity() || _M_rep()->_M_is_shared()) { // Must reallocate. const allocator_type __a = get_allocator(); _Rep* __r = _Rep::_S_create(__new_size, this->capacity(), __a); if (__pos) _M_copy(__r->_M_refdata(), _M_data(), __pos); if (__how_much) _M_copy(__r->_M_refdata() + __pos + __len2, _M_data() + __pos + __len1, __how_much); _M_rep()->_M_dispose(__a); _M_data(__r->_M_refdata()); } else if (__how_much && __len1 != __len2) { // Work in-place. _M_move(_M_data() + __pos + __len2, _M_data() + __pos + __len1, __how_much); } _M_rep()->_M_set_length_and_sharable(__new_size); } template void basic_string<_CharT, _Traits, _Alloc>:: reserve(size_type __res) { if (__res != this->capacity() || _M_rep()->_M_is_shared()) { // Make sure we don't shrink below the current size if (__res < this->size()) __res = this->size(); const allocator_type __a = get_allocator(); _CharT* __tmp = _M_rep()->_M_clone(__a, __res - this->size()); _M_rep()->_M_dispose(__a); _M_data(__tmp); } } template void basic_string<_CharT, _Traits, _Alloc>:: swap(basic_string& __s) { if (_M_rep()->_M_is_leaked()) _M_rep()->_M_set_sharable(); if (__s._M_rep()->_M_is_leaked()) __s._M_rep()->_M_set_sharable(); if (this->get_allocator() == __s.get_allocator()) { _CharT* __tmp = _M_data(); _M_data(__s._M_data()); __s._M_data(__tmp); } // The code below can usually be optimized away. else { const basic_string __tmp1(_M_ibegin(), _M_iend(), __s.get_allocator()); const basic_string __tmp2(__s._M_ibegin(), __s._M_iend(), this->get_allocator()); *this = __tmp2; __s = __tmp1; } } template typename basic_string<_CharT, _Traits, _Alloc>::_Rep* basic_string<_CharT, _Traits, _Alloc>::_Rep:: _S_create(size_type __capacity, size_type __old_capacity, const _Alloc& __alloc) { // _GLIBCXX_RESOLVE_LIB_DEFECTS // 83. String::npos vs. string::max_size() if (__capacity > _S_max_size) __throw_length_error(__N("basic_string::_S_create")); // The standard places no restriction on allocating more memory // than is strictly needed within this layer at the moment or as // requested by an explicit application call to reserve(). // Many malloc implementations perform quite poorly when an // application attempts to allocate memory in a stepwise fashion // growing each allocation size by only 1 char. Additionally, // it makes little sense to allocate less linear memory than the // natural blocking size of the malloc implementation. // Unfortunately, we would need a somewhat low-level calculation // with tuned parameters to get this perfect for any particular // malloc implementation. Fortunately, generalizations about // common features seen among implementations seems to suffice. // __pagesize need not match the actual VM page size for good // results in practice, thus we pick a common value on the low // side. __malloc_header_size is an estimate of the amount of // overhead per memory allocation (in practice seen N * sizeof // (void*) where N is 0, 2 or 4). According to folklore, // picking this value on the high side is better than // low-balling it (especially when this algorithm is used with // malloc implementations that allocate memory blocks rounded up // to a size which is a power of 2). const size_type __pagesize = 4096; const size_type __malloc_header_size = 4 * sizeof(void*); // The below implements an exponential growth policy, necessary to // meet amortized linear time requirements of the library: see // http://gcc.gnu.org/ml/libstdc++/2001-07/msg00085.html. // It's active for allocations requiring an amount of memory above // system pagesize. This is consistent with the requirements of the // standard: http://gcc.gnu.org/ml/libstdc++/2001-07/msg00130.html if (__capacity > __old_capacity && __capacity < 2 * __old_capacity) __capacity = 2 * __old_capacity; // NB: Need an array of char_type[__capacity], plus a terminating // null char_type() element, plus enough for the _Rep data structure. // Whew. Seemingly so needy, yet so elemental. size_type __size = (__capacity + 1) * sizeof(_CharT) + sizeof(_Rep); const size_type __adj_size = __size + __malloc_header_size; if (__adj_size > __pagesize && __capacity > __old_capacity) { const size_type __extra = __pagesize - __adj_size % __pagesize; __capacity += __extra / sizeof(_CharT); // Never allocate a string bigger than _S_max_size. if (__capacity > _S_max_size) __capacity = _S_max_size; __size = (__capacity + 1) * sizeof(_CharT) + sizeof(_Rep); } // NB: Might throw, but no worries about a leak, mate: _Rep() // does not throw. void* __place = _Raw_bytes_alloc(__alloc).allocate(__size); _Rep *__p = new (__place) _Rep; __p->_M_capacity = __capacity; // ABI compatibility - 3.4.x set in _S_create both // _M_refcount and _M_length. All callers of _S_create // in basic_string.tcc then set just _M_length. // In 4.0.x and later both _M_refcount and _M_length // are initialized in the callers, unfortunately we can // have 3.4.x compiled code with _S_create callers inlined // calling 4.0.x+ _S_create. __p->_M_set_sharable(); return __p; } template _CharT* basic_string<_CharT, _Traits, _Alloc>::_Rep:: _M_clone(const _Alloc& __alloc, size_type __res) { // Requested capacity of the clone. const size_type __requested_cap = this->_M_length + __res; _Rep* __r = _Rep::_S_create(__requested_cap, this->_M_capacity, __alloc); if (this->_M_length) _M_copy(__r->_M_refdata(), _M_refdata(), this->_M_length); __r->_M_set_length_and_sharable(this->_M_length); return __r->_M_refdata(); } template void basic_string<_CharT, _Traits, _Alloc>:: resize(size_type __n, _CharT __c) { const size_type __size = this->size(); _M_check_length(__size, __n, "basic_string::resize"); if (__size < __n) this->append(__n - __size, __c); else if (__n < __size) this->erase(__n); // else nothing (in particular, avoid calling _M_mutate() unnecessarily.) } template template basic_string<_CharT, _Traits, _Alloc>& basic_string<_CharT, _Traits, _Alloc>:: _M_replace_dispatch(iterator __i1, iterator __i2, _InputIterator __k1, _InputIterator __k2, __false_type) { const basic_string __s(__k1, __k2); const size_type __n1 = __i2 - __i1; _M_check_length(__n1, __s.size(), "basic_string::_M_replace_dispatch"); return _M_replace_safe(__i1 - _M_ibegin(), __n1, __s._M_data(), __s.size()); } template basic_string<_CharT, _Traits, _Alloc>& basic_string<_CharT, _Traits, _Alloc>:: _M_replace_aux(size_type __pos1, size_type __n1, size_type __n2, _CharT __c) { _M_check_length(__n1, __n2, "basic_string::_M_replace_aux"); _M_mutate(__pos1, __n1, __n2); if (__n2) _M_assign(_M_data() + __pos1, __n2, __c); return *this; } template basic_string<_CharT, _Traits, _Alloc>& basic_string<_CharT, _Traits, _Alloc>:: _M_replace_safe(size_type __pos1, size_type __n1, const _CharT* __s, size_type __n2) { _M_mutate(__pos1, __n1, __n2); if (__n2) _M_copy(_M_data() + __pos1, __s, __n2); return *this; } template typename basic_string<_CharT, _Traits, _Alloc>::size_type basic_string<_CharT, _Traits, _Alloc>:: copy(_CharT* __s, size_type __n, size_type __pos) const { _M_check(__pos, "basic_string::copy"); __n = _M_limit(__pos, __n); __glibcxx_requires_string_len(__s, __n); if (__n) _M_copy(__s, _M_data() + __pos, __n); // 21.3.5.7 par 3: do not append null. (good.) return __n; } #endif // !_GLIBCXX_USE_CXX11_ABI # 1144 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.tcc" 3 template basic_string<_CharT, _Traits, _Alloc> operator+(const _CharT* __lhs, const basic_string<_CharT, _Traits, _Alloc>& __rhs) { __glibcxx_requires_string(__lhs); typedef basic_string<_CharT, _Traits, _Alloc> __string_type; typedef typename __string_type::size_type __size_type; const __size_type __len = _Traits::length(__lhs); __string_type __str; __str.reserve(__len + __rhs.size()); __str.append(__lhs, __len); __str.append(__rhs); return __str; } template basic_string<_CharT, _Traits, _Alloc> operator+(_CharT __lhs, const basic_string<_CharT, _Traits, _Alloc>& __rhs) { typedef basic_string<_CharT, _Traits, _Alloc> __string_type; typedef typename __string_type::size_type __size_type; __string_type __str; const __size_type __len = __rhs.size(); __str.reserve(__len + 1); __str.append(__size_type(1), __lhs); __str.append(__rhs); return __str; } template typename basic_string<_CharT, _Traits, _Alloc>::size_type basic_string<_CharT, _Traits, _Alloc>:: find(const _CharT* __s, size_type __pos, size_type __n) const { __glibcxx_requires_string_len(__s, __n); const size_type __size = this->size(); const _CharT* __data = _M_data(); if (__n == 0) return __pos <= __size ? __pos : npos; if (__n <= __size) { for (; __pos <= __size - __n; ++__pos) if (traits_type::eq(__data[__pos], __s[0]) && traits_type::compare(__data + __pos + 1, __s + 1, __n - 1) == 0) return __pos; } return npos; } template typename basic_string<_CharT, _Traits, _Alloc>::size_type basic_string<_CharT, _Traits, _Alloc>:: find(_CharT __c, size_type __pos) const _GLIBCXX_NOEXCEPT { size_type __ret = npos; const size_type __size = this->size(); if (__pos < __size) { const _CharT* __data = _M_data(); const size_type __n = __size - __pos; const _CharT* __p = traits_type::find(__data + __pos, __n, __c); if (__p) __ret = __p - __data; } return __ret; } template typename basic_string<_CharT, _Traits, _Alloc>::size_type basic_string<_CharT, _Traits, _Alloc>:: rfind(const _CharT* __s, size_type __pos, size_type __n) const { __glibcxx_requires_string_len(__s, __n); const size_type __size = this->size(); if (__n <= __size) { __pos = std::min(size_type(__size - __n), __pos); const _CharT* __data = _M_data(); do { if (traits_type::compare(__data + __pos, __s, __n) == 0) return __pos; } while (__pos-- > 0); } return npos; } template typename basic_string<_CharT, _Traits, _Alloc>::size_type basic_string<_CharT, _Traits, _Alloc>:: rfind(_CharT __c, size_type __pos) const _GLIBCXX_NOEXCEPT { size_type __size = this->size(); if (__size) { if (--__size > __pos) __size = __pos; for (++__size; __size-- > 0; ) if (traits_type::eq(_M_data()[__size], __c)) return __size; } return npos; } template typename basic_string<_CharT, _Traits, _Alloc>::size_type basic_string<_CharT, _Traits, _Alloc>:: find_first_of(const _CharT* __s, size_type __pos, size_type __n) const { __glibcxx_requires_string_len(__s, __n); for (; __n && __pos < this->size(); ++__pos) { const _CharT* __p = traits_type::find(__s, __n, _M_data()[__pos]); if (__p) return __pos; } return npos; } template typename basic_string<_CharT, _Traits, _Alloc>::size_type basic_string<_CharT, _Traits, _Alloc>:: find_last_of(const _CharT* __s, size_type __pos, size_type __n) const { __glibcxx_requires_string_len(__s, __n); size_type __size = this->size(); if (__size && __n) { if (--__size > __pos) __size = __pos; do { if (traits_type::find(__s, __n, _M_data()[__size])) return __size; } while (__size-- != 0); } return npos; } template typename basic_string<_CharT, _Traits, _Alloc>::size_type basic_string<_CharT, _Traits, _Alloc>:: find_first_not_of(const _CharT* __s, size_type __pos, size_type __n) const { __glibcxx_requires_string_len(__s, __n); for (; __pos < this->size(); ++__pos) if (!traits_type::find(__s, __n, _M_data()[__pos])) return __pos; return npos; } template typename basic_string<_CharT, _Traits, _Alloc>::size_type basic_string<_CharT, _Traits, _Alloc>:: find_first_not_of(_CharT __c, size_type __pos) const _GLIBCXX_NOEXCEPT { for (; __pos < this->size(); ++__pos) if (!traits_type::eq(_M_data()[__pos], __c)) return __pos; return npos; } template typename basic_string<_CharT, _Traits, _Alloc>::size_type basic_string<_CharT, _Traits, _Alloc>:: find_last_not_of(const _CharT* __s, size_type __pos, size_type __n) const { __glibcxx_requires_string_len(__s, __n); size_type __size = this->size(); if (__size) { if (--__size > __pos) __size = __pos; do { if (!traits_type::find(__s, __n, _M_data()[__size])) return __size; } while (__size--); } return npos; } template typename basic_string<_CharT, _Traits, _Alloc>::size_type basic_string<_CharT, _Traits, _Alloc>:: find_last_not_of(_CharT __c, size_type __pos) const _GLIBCXX_NOEXCEPT { size_type __size = this->size(); if (__size) { if (--__size > __pos) __size = __pos; do { if (!traits_type::eq(_M_data()[__size], __c)) return __size; } while (__size--); } return npos; } template int basic_string<_CharT, _Traits, _Alloc>:: compare(size_type __pos, size_type __n, const basic_string& __str) const { _M_check(__pos, "basic_string::compare"); __n = _M_limit(__pos, __n); const size_type __osize = __str.size(); const size_type __len = std::min(__n, __osize); int __r = traits_type::compare(_M_data() + __pos, __str.data(), __len); if (!__r) __r = _S_compare(__n, __osize); return __r; } template int basic_string<_CharT, _Traits, _Alloc>:: compare(size_type __pos1, size_type __n1, const basic_string& __str, size_type __pos2, size_type __n2) const { _M_check(__pos1, "basic_string::compare"); __str._M_check(__pos2, "basic_string::compare"); __n1 = _M_limit(__pos1, __n1); __n2 = __str._M_limit(__pos2, __n2); const size_type __len = std::min(__n1, __n2); int __r = traits_type::compare(_M_data() + __pos1, __str.data() + __pos2, __len); if (!__r) __r = _S_compare(__n1, __n2); return __r; } template int basic_string<_CharT, _Traits, _Alloc>:: compare(const _CharT* __s) const { __glibcxx_requires_string(__s); const size_type __size = this->size(); const size_type __osize = traits_type::length(__s); const size_type __len = std::min(__size, __osize); int __r = traits_type::compare(_M_data(), __s, __len); if (!__r) __r = _S_compare(__size, __osize); return __r; } template int basic_string <_CharT, _Traits, _Alloc>:: compare(size_type __pos, size_type __n1, const _CharT* __s) const { __glibcxx_requires_string(__s); _M_check(__pos, "basic_string::compare"); __n1 = _M_limit(__pos, __n1); const size_type __osize = traits_type::length(__s); const size_type __len = std::min(__n1, __osize); int __r = traits_type::compare(_M_data() + __pos, __s, __len); if (!__r) __r = _S_compare(__n1, __osize); return __r; } template int basic_string <_CharT, _Traits, _Alloc>:: compare(size_type __pos, size_type __n1, const _CharT* __s, size_type __n2) const { __glibcxx_requires_string_len(__s, __n2); _M_check(__pos, "basic_string::compare"); __n1 = _M_limit(__pos, __n1); const size_type __len = std::min(__n1, __n2); int __r = traits_type::compare(_M_data() + __pos, __s, __len); if (!__r) __r = _S_compare(__n1, __n2); return __r; } // 21.3.7.9 basic_string::getline and operators template basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __in, basic_string<_CharT, _Traits, _Alloc>& __str) { typedef basic_istream<_CharT, _Traits> __istream_type; typedef basic_string<_CharT, _Traits, _Alloc> __string_type; typedef typename __istream_type::ios_base __ios_base; typedef typename __istream_type::int_type __int_type; typedef typename __string_type::size_type __size_type; typedef ctype<_CharT> __ctype_type; typedef typename __ctype_type::ctype_base __ctype_base; __size_type __extracted = 0; typename __ios_base::iostate __err = __ios_base::goodbit; typename __istream_type::sentry __cerb(__in, false); if (__cerb) { __try { // Avoid reallocation for common case. __str.erase(); _CharT __buf[128]; __size_type __len = 0; const streamsize __w = __in.width(); const __size_type __n = __w > 0 ? static_cast<__size_type>(__w) : __str.max_size(); const __ctype_type& __ct = use_facet<__ctype_type>(__in.getloc()); const __int_type __eof = _Traits::eof(); __int_type __c = __in.rdbuf()->sgetc(); while (__extracted < __n && !_Traits::eq_int_type(__c, __eof) && !__ct.is(__ctype_base::space, _Traits::to_char_type(__c))) { if (__len == sizeof(__buf) / sizeof(_CharT)) { __str.append(__buf, sizeof(__buf) / sizeof(_CharT)); __len = 0; } __buf[__len++] = _Traits::to_char_type(__c); ++__extracted; __c = __in.rdbuf()->snextc(); } __str.append(__buf, __len); if (_Traits::eq_int_type(__c, __eof)) __err |= __ios_base::eofbit; __in.width(0); } __catch(__cxxabiv1::__forced_unwind&) { __in._M_setstate(__ios_base::badbit); __throw_exception_again; } __catch(...) { // _GLIBCXX_RESOLVE_LIB_DEFECTS // 91. Description of operator>> and getline() for string<> // might cause endless loop __in._M_setstate(__ios_base::badbit); } } // 211. operator>>(istream&, string&) doesn't set failbit if (!__extracted) __err |= __ios_base::failbit; if (__err) __in.setstate(__err); return __in; } template basic_istream<_CharT, _Traits>& getline(basic_istream<_CharT, _Traits>& __in, basic_string<_CharT, _Traits, _Alloc>& __str, _CharT __delim) { typedef basic_istream<_CharT, _Traits> __istream_type; typedef basic_string<_CharT, _Traits, _Alloc> __string_type; typedef typename __istream_type::ios_base __ios_base; typedef typename __istream_type::int_type __int_type; typedef typename __string_type::size_type __size_type; __size_type __extracted = 0; const __size_type __n = __str.max_size(); typename __ios_base::iostate __err = __ios_base::goodbit; typename __istream_type::sentry __cerb(__in, true); if (__cerb) { __try { __str.erase(); const __int_type __idelim = _Traits::to_int_type(__delim); const __int_type __eof = _Traits::eof(); __int_type __c = __in.rdbuf()->sgetc(); while (__extracted < __n && !_Traits::eq_int_type(__c, __eof) && !_Traits::eq_int_type(__c, __idelim)) { __str += _Traits::to_char_type(__c); ++__extracted; __c = __in.rdbuf()->snextc(); } if (_Traits::eq_int_type(__c, __eof)) __err |= __ios_base::eofbit; else if (_Traits::eq_int_type(__c, __idelim)) { ++__extracted; __in.rdbuf()->sbumpc(); } else __err |= __ios_base::failbit; } __catch(__cxxabiv1::__forced_unwind&) { __in._M_setstate(__ios_base::badbit); __throw_exception_again; } __catch(...) { // _GLIBCXX_RESOLVE_LIB_DEFECTS // 91. Description of operator>> and getline() for string<> // might cause endless loop __in._M_setstate(__ios_base::badbit); } } if (!__extracted) __err |= __ios_base::failbit; if (__err) __in.setstate(__err); return __in; } // Inhibit implicit instantiations for required instantiations, // which are defined via explicit instantiations elsewhere. #if _GLIBCXX_EXTERN_TEMPLATE > 0 extern template class basic_string; extern template basic_istream& operator>>(basic_istream&, string&); extern template basic_ostream& operator<<(basic_ostream&, const string&); extern template basic_istream& getline(basic_istream&, string&, char); extern template basic_istream& getline(basic_istream&, string&); #ifdef _GLIBCXX_USE_WCHAR_T extern template class basic_string; extern template basic_istream& operator>>(basic_istream&, wstring&); extern template basic_ostream& operator<<(basic_ostream&, const wstring&); extern template basic_istream& getline(basic_istream&, wstring&, wchar_t); extern template basic_istream& getline(basic_istream&, wstring&); #endif # 1602 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.tcc" 3 #endif # 1603 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.tcc" 3 _GLIBCXX_END_NAMESPACE_VERSION } // namespace std #endif # 1608 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_string.tcc" 3 # 54 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/string" 2 3 #endif /* _GLIBCXX_STRING */ # 56 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/string" 3 # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_classes.h" 2 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_classes.h" 3 # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_classes.h" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION // 22.1.1 Class locale /** * @brief Container class for localization functionality. * @ingroup locales * * The locale class is first a class wrapper for C library locales. It is * also an extensible container for user-defined localization. A locale is * a collection of facets that implement various localization features such * as money, time, and number printing. * * Constructing C++ locales does not change the C library locale. * * This library supports efficient construction and copying of locales * through a reference counting implementation of the locale class. */ class locale { public: // Types: /// Definition of locale::category. typedef int category; // Forward decls and friends: class facet; class id; class _Impl; friend class facet; friend class _Impl; template friend bool has_facet(const locale&) throw(); template friend const _Facet& use_facet(const locale&); template friend struct __use_cache; //@{ /** * @brief Category values. * * The standard category values are none, ctype, numeric, collate, time, * monetary, and messages. They form a bitmask that supports union and * intersection. The category all is the union of these values. * * NB: Order must match _S_facet_categories definition in locale.cc */ static const category none = 0; static const category ctype = 1L << 0; static const category numeric = 1L << 1; static const category collate = 1L << 2; static const category time = 1L << 3; static const category monetary = 1L << 4; static const category messages = 1L << 5; static const category all = (ctype | numeric | collate | time | monetary | messages); //@} // Construct/copy/destroy: /** * @brief Default constructor. * * Constructs a copy of the global locale. If no locale has been * explicitly set, this is the C locale. */ locale() throw(); /** * @brief Copy constructor. * * Constructs a copy of @a other. * * @param __other The locale to copy. */ locale(const locale& __other) throw(); /** * @brief Named locale constructor. * * Constructs a copy of the named C library locale. * * @param __s Name of the locale to construct. * @throw std::runtime_error if __s is null or an undefined locale. */ explicit locale(const char* __s); /** * @brief Construct locale with facets from another locale. * * Constructs a copy of the locale @a base. The facets specified by @a * cat are replaced with those from the locale named by @a s. If base is * named, this locale instance will also be named. * * @param __base The locale to copy. * @param __s Name of the locale to use facets from. * @param __cat Set of categories defining the facets to use from __s. * @throw std::runtime_error if __s is null or an undefined locale. */ locale(const locale& __base, const char* __s, category __cat); #if __cplusplus >= 201103L /** * @brief Named locale constructor. * * Constructs a copy of the named C library locale. * * @param __s Name of the locale to construct. * @throw std::runtime_error if __s is an undefined locale. */ explicit locale(const std::string& __s) : locale(__s.c_str()) { } /** * @brief Construct locale with facets from another locale. * * Constructs a copy of the locale @a base. The facets specified by @a * cat are replaced with those from the locale named by @a s. If base is * named, this locale instance will also be named. * * @param __base The locale to copy. * @param __s Name of the locale to use facets from. * @param __cat Set of categories defining the facets to use from __s. * @throw std::runtime_error if __s is an undefined locale. */ locale(const locale& __base, const std::string& __s, category __cat) : locale(__base, __s.c_str(), __cat) { } #endif # 180 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_classes.h" 3 /** * @brief Construct locale with facets from another locale. * * Constructs a copy of the locale @a base. The facets specified by @a * cat are replaced with those from the locale @a add. If @a base and @a * add are named, this locale instance will also be named. * * @param __base The locale to copy. * @param __add The locale to use facets from. * @param __cat Set of categories defining the facets to use from add. */ locale(const locale& __base, const locale& __add, category __cat); /** * @brief Construct locale with another facet. * * Constructs a copy of the locale @a __other. The facet @a __f * is added to @a __other, replacing an existing facet of type * Facet if there is one. If @a __f is null, this locale is a * copy of @a __other. * * @param __other The locale to copy. * @param __f The facet to add in. */ template locale(const locale& __other, _Facet* __f); /// Locale destructor. ~locale() throw(); /** * @brief Assignment operator. * * Set this locale to be a copy of @a other. * * @param __other The locale to copy. * @return A reference to this locale. */ const locale& operator=(const locale& __other) throw(); /** * @brief Construct locale with another facet. * * Constructs and returns a new copy of this locale. Adds or replaces an * existing facet of type Facet from the locale @a other into the new * locale. * * @tparam _Facet The facet type to copy from other * @param __other The locale to copy from. * @return Newly constructed locale. * @throw std::runtime_error if __other has no facet of type _Facet. */ template locale combine(const locale& __other) const; // Locale operations: /** * @brief Return locale name. * @return Locale name or "*" if unnamed. */ _GLIBCXX_DEFAULT_ABI_TAG string name() const; /** * @brief Locale equality. * * @param __other The locale to compare against. * @return True if other and this refer to the same locale instance, are * copies, or have the same name. False otherwise. */ bool operator==(const locale& __other) const throw(); /** * @brief Locale inequality. * * @param __other The locale to compare against. * @return ! (*this == __other) */ bool operator!=(const locale& __other) const throw() { return !(this->operator==(__other)); } /** * @brief Compare two strings according to collate. * * Template operator to compare two strings using the compare function of * the collate facet in this locale. One use is to provide the locale to * the sort function. For example, a vector v of strings could be sorted * according to locale loc by doing: * @code * std::sort(v.begin(), v.end(), loc); * @endcode * * @param __s1 First string to compare. * @param __s2 Second string to compare. * @return True if collate<_Char> facet compares __s1 < __s2, else false. */ template bool operator()(const basic_string<_Char, _Traits, _Alloc>& __s1, const basic_string<_Char, _Traits, _Alloc>& __s2) const; // Global locale objects: /** * @brief Set global locale * * This function sets the global locale to the argument and returns a * copy of the previous global locale. If the argument has a name, it * will also call std::setlocale(LC_ALL, loc.name()). * * @param __loc The new locale to make global. * @return Copy of the old global locale. */ static locale global(const locale& __loc); /** * @brief Return reference to the C locale. */ static const locale& classic(); private: // The (shared) implementation _Impl* _M_impl; // The "C" reference locale static _Impl* _S_classic; // Current global locale static _Impl* _S_global; // Names of underlying locale categories. // NB: locale::global() has to know how to modify all the // underlying categories, not just the ones required by the C++ // standard. static const char* const* const _S_categories; // Number of standard categories. For C++, these categories are // collate, ctype, monetary, numeric, time, and messages. These // directly correspond to ISO C99 macros LC_COLLATE, LC_CTYPE, // LC_MONETARY, LC_NUMERIC, and LC_TIME. In addition, POSIX (IEEE // 1003.1-2001) specifies LC_MESSAGES. // In addition to the standard categories, the underlying // operating system is allowed to define extra LC_* // macros. For GNU systems, the following are also valid: // LC_PAPER, LC_NAME, LC_ADDRESS, LC_TELEPHONE, LC_MEASUREMENT, // and LC_IDENTIFICATION. enum { _S_categories_size = 6 + _GLIBCXX_NUM_CATEGORIES }; #ifdef __GTHREADS static __gthread_once_t _S_once; #endif # 338 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_classes.h" 3 explicit locale(_Impl*) throw(); static void _S_initialize(); static void _S_initialize_once() throw(); static category _S_normalize_category(category); void _M_coalesce(const locale& __base, const locale& __add, category __cat); #if _GLIBCXX_USE_CXX11_ABI static const id* const _S_twinned_facets[]; #endif # 357 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_classes.h" 3 }; // 22.1.1.1.2 Class locale::facet /** * @brief Localization functionality base class. * @ingroup locales * * The facet class is the base class for a localization feature, such as * money, time, and number printing. It provides common support for facets * and reference management. * * Facets may not be copied or assigned. */ class locale::facet { private: friend class locale; friend class locale::_Impl; mutable _Atomic_word _M_refcount; // Contains data from the underlying "C" library for the classic locale. static __c_locale _S_c_locale; // String literal for the name of the classic locale. static const char _S_c_name[2]; #ifdef __GTHREADS static __gthread_once_t _S_once; #endif # 388 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_classes.h" 3 static void _S_initialize_once(); protected: /** * @brief Facet constructor. * * This is the constructor provided by the standard. If refs is 0, the * facet is destroyed when the last referencing locale is destroyed. * Otherwise the facet will never be destroyed. * * @param __refs The initial value for reference count. */ explicit facet(size_t __refs = 0) throw() : _M_refcount(__refs ? 1 : 0) { } /// Facet destructor. virtual ~facet(); static void _S_create_c_locale(__c_locale& __cloc, const char* __s, __c_locale __old = 0); static __c_locale _S_clone_c_locale(__c_locale& __cloc) throw(); static void _S_destroy_c_locale(__c_locale& __cloc); static __c_locale _S_lc_ctype_c_locale(__c_locale __cloc, const char* __s); // Returns data from the underlying "C" library data for the // classic locale. static __c_locale _S_get_c_locale(); _GLIBCXX_CONST static const char* _S_get_c_name() throw(); private: void _M_add_reference() const throw() { __gnu_cxx::__atomic_add_dispatch(&_M_refcount, 1); } void _M_remove_reference() const throw() { // Be race-detector-friendly. For more info see bits/c++config. _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(&_M_refcount); if (__gnu_cxx::__exchange_and_add_dispatch(&_M_refcount, -1) == 1) { _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(&_M_refcount); __try { delete this; } __catch(...) { } } } facet(const facet&); // Not defined. facet& operator=(const facet&); // Not defined. class __shim; const facet* _M_sso_shim(const id*) const; const facet* _M_cow_shim(const id*) const; }; // 22.1.1.1.3 Class locale::id /** * @brief Facet ID class. * @ingroup locales * * The ID class provides facets with an index used to identify them. * Every facet class must define a public static member locale::id, or be * derived from a facet that provides this member, otherwise the facet * cannot be used in a locale. The locale::id ensures that each class * type gets a unique identifier. */ class locale::id { private: friend class locale; friend class locale::_Impl; template friend const _Facet& use_facet(const locale&); template friend bool has_facet(const locale&) throw(); // NB: There is no accessor for _M_index because it may be used // before the constructor is run; the effect of calling a member // function (even an inline) would be undefined. mutable size_t _M_index; // Last id number assigned. static _Atomic_word _S_refcount; void operator=(const id&); // Not defined. id(const id&); // Not defined. public: // NB: This class is always a static data member, and thus can be // counted on to be zero-initialized. /// Constructor. id() { } size_t _M_id() const throw(); }; // Implementation object for locale. class locale::_Impl { public: // Friends. friend class locale; friend class locale::facet; template friend bool has_facet(const locale&) throw(); template friend const _Facet& use_facet(const locale&); template friend struct __use_cache; private: // Data Members. _Atomic_word _M_refcount; const facet** _M_facets; size_t _M_facets_size; const facet** _M_caches; char** _M_names; static const locale::id* const _S_id_ctype[]; static const locale::id* const _S_id_numeric[]; static const locale::id* const _S_id_collate[]; static const locale::id* const _S_id_time[]; static const locale::id* const _S_id_monetary[]; static const locale::id* const _S_id_messages[]; static const locale::id* const* const _S_facet_categories[]; void _M_add_reference() throw() { __gnu_cxx::__atomic_add_dispatch(&_M_refcount, 1); } void _M_remove_reference() throw() { // Be race-detector-friendly. For more info see bits/c++config. _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(&_M_refcount); if (__gnu_cxx::__exchange_and_add_dispatch(&_M_refcount, -1) == 1) { _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(&_M_refcount); __try { delete this; } __catch(...) { } } } _Impl(const _Impl&, size_t); _Impl(const char*, size_t); _Impl(size_t) throw(); ~_Impl() throw(); _Impl(const _Impl&); // Not defined. void operator=(const _Impl&); // Not defined. bool _M_check_same_name() { bool __ret = true; if (_M_names[1]) // We must actually compare all the _M_names: can be all equal! for (size_t __i = 0; __ret && __i < _S_categories_size - 1; ++__i) __ret = __builtin_strcmp(_M_names[__i], _M_names[__i + 1]) == 0; return __ret; } void _M_replace_categories(const _Impl*, category); void _M_replace_category(const _Impl*, const locale::id* const*); void _M_replace_facet(const _Impl*, const locale::id*); void _M_install_facet(const locale::id*, const facet*); template void _M_init_facet(_Facet* __facet) { _M_install_facet(&_Facet::id, __facet); } template void _M_init_facet_unchecked(_Facet* __facet) { __facet->_M_add_reference(); _M_facets[_Facet::id._M_id()] = __facet; } void _M_install_cache(const facet*, size_t); void _M_init_extra(facet**); void _M_init_extra(void*, void*, const char*, const char*); }; /** * @brief Facet for localized string comparison. * * This facet encapsulates the code to compare strings in a localized * manner. * * The collate template uses protected virtual functions to provide * the actual results. The public accessors forward the call to * the virtual functions. These virtual functions are hooks for * developers to implement the behavior they require from the * collate facet. */ template class _GLIBCXX_NAMESPACE_CXX11 collate : public locale::facet { public: // Types: //@{ /// Public typedefs typedef _CharT char_type; typedef basic_string<_CharT> string_type; //@} protected: // Underlying "C" library locale information saved from // initialization, needed by collate_byname as well. __c_locale _M_c_locale_collate; public: /// Numpunct facet id. static locale::id id; /** * @brief Constructor performs initialization. * * This is the constructor provided by the standard. * * @param __refs Passed to the base facet class. */ explicit collate(size_t __refs = 0) : facet(__refs), _M_c_locale_collate(_S_get_c_locale()) { } /** * @brief Internal constructor. Not for general use. * * This is a constructor for use by the library itself to set up new * locales. * * @param __cloc The C locale. * @param __refs Passed to the base facet class. */ explicit collate(__c_locale __cloc, size_t __refs = 0) : facet(__refs), _M_c_locale_collate(_S_clone_c_locale(__cloc)) { } /** * @brief Compare two strings. * * This function compares two strings and returns the result by calling * collate::do_compare(). * * @param __lo1 Start of string 1. * @param __hi1 End of string 1. * @param __lo2 Start of string 2. * @param __hi2 End of string 2. * @return 1 if string1 > string2, -1 if string1 < string2, else 0. */ int compare(const _CharT* __lo1, const _CharT* __hi1, const _CharT* __lo2, const _CharT* __hi2) const { return this->do_compare(__lo1, __hi1, __lo2, __hi2); } /** * @brief Transform string to comparable form. * * This function is a wrapper for strxfrm functionality. It takes the * input string and returns a modified string that can be directly * compared to other transformed strings. In the C locale, this * function just returns a copy of the input string. In some other * locales, it may replace two chars with one, change a char for * another, etc. It does so by returning collate::do_transform(). * * @param __lo Start of string. * @param __hi End of string. * @return Transformed string_type. */ string_type transform(const _CharT* __lo, const _CharT* __hi) const { return this->do_transform(__lo, __hi); } /** * @brief Return hash of a string. * * This function computes and returns a hash on the input string. It * does so by returning collate::do_hash(). * * @param __lo Start of string. * @param __hi End of string. * @return Hash value. */ long hash(const _CharT* __lo, const _CharT* __hi) const { return this->do_hash(__lo, __hi); } // Used to abstract out _CharT bits in virtual member functions, below. int _M_compare(const _CharT*, const _CharT*) const throw(); size_t _M_transform(_CharT*, const _CharT*, size_t) const throw(); protected: /// Destructor. virtual ~collate() { _S_destroy_c_locale(_M_c_locale_collate); } /** * @brief Compare two strings. * * This function is a hook for derived classes to change the value * returned. @see compare(). * * @param __lo1 Start of string 1. * @param __hi1 End of string 1. * @param __lo2 Start of string 2. * @param __hi2 End of string 2. * @return 1 if string1 > string2, -1 if string1 < string2, else 0. */ virtual int do_compare(const _CharT* __lo1, const _CharT* __hi1, const _CharT* __lo2, const _CharT* __hi2) const; /** * @brief Transform string to comparable form. * * This function is a hook for derived classes to change the value * returned. * * @param __lo Start. * @param __hi End. * @return transformed string. */ virtual string_type do_transform(const _CharT* __lo, const _CharT* __hi) const; /** * @brief Return hash of a string. * * This function computes and returns a hash on the input string. This * function is a hook for derived classes to change the value returned. * * @param __lo Start of string. * @param __hi End of string. * @return Hash value. */ virtual long do_hash(const _CharT* __lo, const _CharT* __hi) const; }; template locale::id collate<_CharT>::id; // Specializations. template<> int collate::_M_compare(const char*, const char*) const throw(); template<> size_t collate::_M_transform(char*, const char*, size_t) const throw(); #ifdef _GLIBCXX_USE_WCHAR_T template<> int collate::_M_compare(const wchar_t*, const wchar_t*) const throw(); template<> size_t collate::_M_transform(wchar_t*, const wchar_t*, size_t) const throw(); #endif # 804 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_classes.h" 3 /// class collate_byname [22.2.4.2]. template class _GLIBCXX_NAMESPACE_CXX11 collate_byname : public collate<_CharT> { public: //@{ /// Public typedefs typedef _CharT char_type; typedef basic_string<_CharT> string_type; //@} explicit collate_byname(const char* __s, size_t __refs = 0) : collate<_CharT>(__refs) { if (__builtin_strcmp(__s, "C") != 0 && __builtin_strcmp(__s, "POSIX") != 0) { this->_S_destroy_c_locale(this->_M_c_locale_collate); this->_S_create_c_locale(this->_M_c_locale_collate, __s); } } #if __cplusplus >= 201103L explicit collate_byname(const string& __s, size_t __refs = 0) : collate_byname(__s.c_str(), __refs) { } #endif # 833 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_classes.h" 3 protected: virtual ~collate_byname() { } }; _GLIBCXX_END_NAMESPACE_VERSION } // namespace #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 842 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_classes.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_classes.tcc" 1 3 // Locale support -*- C++ -*- // Copyright (C) 2007-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file bits/locale_classes.tcc * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{locale} */ // // ISO C++ 14882: 22.1 Locales // #ifndef _LOCALE_CLASSES_TCC #define _LOCALE_CLASSES_TCC 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 38 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_classes.tcc" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION template locale:: locale(const locale& __other, _Facet* __f) { _M_impl = new _Impl(*__other._M_impl, 1); __try { _M_impl->_M_install_facet(&_Facet::id, __f); } __catch(...) { _M_impl->_M_remove_reference(); __throw_exception_again; } delete [] _M_impl->_M_names[0]; _M_impl->_M_names[0] = 0; // Unnamed. } template locale locale:: combine(const locale& __other) const { _Impl* __tmp = new _Impl(*_M_impl, 1); __try { __tmp->_M_replace_facet(__other._M_impl, &_Facet::id); } __catch(...) { __tmp->_M_remove_reference(); __throw_exception_again; } return locale(__tmp); } template bool locale:: operator()(const basic_string<_CharT, _Traits, _Alloc>& __s1, const basic_string<_CharT, _Traits, _Alloc>& __s2) const { typedef std::collate<_CharT> __collate_type; const __collate_type& __collate = use_facet<__collate_type>(*this); return (__collate.compare(__s1.data(), __s1.data() + __s1.length(), __s2.data(), __s2.data() + __s2.length()) < 0); } /** * @brief Test for the presence of a facet. * @ingroup locales * * has_facet tests the locale argument for the presence of the facet type * provided as the template parameter. Facets derived from the facet * parameter will also return true. * * @tparam _Facet The facet type to test the presence of. * @param __loc The locale to test. * @return true if @p __loc contains a facet of type _Facet, else false. */ template bool has_facet(const locale& __loc) throw() { const size_t __i = _Facet::id._M_id(); const locale::facet** __facets = __loc._M_impl->_M_facets; return (__i < __loc._M_impl->_M_facets_size #if __cpp_rtti && dynamic_cast(__facets[__i])); #else # 112 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_classes.tcc" 3 && static_cast(__facets[__i])); #endif # 114 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_classes.tcc" 3 } /** * @brief Return a facet. * @ingroup locales * * use_facet looks for and returns a reference to a facet of type Facet * where Facet is the template parameter. If has_facet(locale) is true, * there is a suitable facet to return. It throws std::bad_cast if the * locale doesn't contain a facet of type Facet. * * @tparam _Facet The facet type to access. * @param __loc The locale to use. * @return Reference to facet of type Facet. * @throw std::bad_cast if @p __loc doesn't contain a facet of type _Facet. */ template const _Facet& use_facet(const locale& __loc) { const size_t __i = _Facet::id._M_id(); const locale::facet** __facets = __loc._M_impl->_M_facets; if (__i >= __loc._M_impl->_M_facets_size || !__facets[__i]) __throw_bad_cast(); #if __cpp_rtti return dynamic_cast(*__facets[__i]); #else # 141 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_classes.tcc" 3 return static_cast(*__facets[__i]); #endif # 143 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_classes.tcc" 3 } // Generic version does nothing. template int collate<_CharT>::_M_compare(const _CharT*, const _CharT*) const throw () { return 0; } // Generic version does nothing. template size_t collate<_CharT>::_M_transform(_CharT*, const _CharT*, size_t) const throw () { return 0; } template int collate<_CharT>:: do_compare(const _CharT* __lo1, const _CharT* __hi1, const _CharT* __lo2, const _CharT* __hi2) const { // strcoll assumes zero-terminated strings so we make a copy // and then put a zero at the end. const string_type __one(__lo1, __hi1); const string_type __two(__lo2, __hi2); const _CharT* __p = __one.c_str(); const _CharT* __pend = __one.data() + __one.length(); const _CharT* __q = __two.c_str(); const _CharT* __qend = __two.data() + __two.length(); // strcoll stops when it sees a nul character so we break // the strings into zero-terminated substrings and pass those // to strcoll. for (;;) { const int __res = _M_compare(__p, __q); if (__res) return __res; __p += char_traits<_CharT>::length(__p); __q += char_traits<_CharT>::length(__q); if (__p == __pend && __q == __qend) return 0; else if (__p == __pend) return -1; else if (__q == __qend) return 1; __p++; __q++; } } template typename collate<_CharT>::string_type collate<_CharT>:: do_transform(const _CharT* __lo, const _CharT* __hi) const { string_type __ret; // strxfrm assumes zero-terminated strings so we make a copy const string_type __str(__lo, __hi); const _CharT* __p = __str.c_str(); const _CharT* __pend = __str.data() + __str.length(); size_t __len = (__hi - __lo) * 2; _CharT* __c = new _CharT[__len]; __try { // strxfrm stops when it sees a nul character so we break // the string into zero-terminated substrings and pass those // to strxfrm. for (;;) { // First try a buffer perhaps big enough. size_t __res = _M_transform(__c, __p, __len); // If the buffer was not large enough, try again with the // correct size. if (__res >= __len) { __len = __res + 1; delete [] __c, __c = 0; __c = new _CharT[__len]; __res = _M_transform(__c, __p, __len); } __ret.append(__c, __res); __p += char_traits<_CharT>::length(__p); if (__p == __pend) break; __p++; __ret.push_back(_CharT()); } } __catch(...) { delete [] __c; __throw_exception_again; } delete [] __c; return __ret; } template long collate<_CharT>:: do_hash(const _CharT* __lo, const _CharT* __hi) const { unsigned long __val = 0; for (; __lo < __hi; ++__lo) __val = *__lo + ((__val << 7) | (__val >> (__gnu_cxx::__numeric_traits:: __digits - 7))); return static_cast(__val); } // Inhibit implicit instantiations for required instantiations, // which are defined via explicit instantiations elsewhere. #if _GLIBCXX_EXTERN_TEMPLATE extern template class collate; extern template class collate_byname; extern template const collate& use_facet >(const locale&); extern template bool has_facet >(const locale&); #ifdef _GLIBCXX_USE_WCHAR_T extern template class collate; extern template class collate_byname; extern template const collate& use_facet >(const locale&); extern template bool has_facet >(const locale&); #endif # 293 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_classes.tcc" 3 #endif # 294 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_classes.tcc" 3 _GLIBCXX_END_NAMESPACE_VERSION } // namespace std #endif # 299 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_classes.tcc" 3 # 843 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_classes.h" 2 3 #endif # 845 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_classes.h" 3 # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/ios_base.h" 2 3 #if __cplusplus < 201103L #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 44 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/ios_base.h" 3 # 45 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/ios_base.h" 3 #else # 46 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/ios_base.h" 3 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 46 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/ios_base.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/system_error" 1 3 // -*- C++ -*- // Copyright (C) 2007-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file include/system_error * This is a Standard C++ Library header. */ #ifndef _GLIBCXX_SYSTEM_ERROR #define _GLIBCXX_SYSTEM_ERROR 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 33 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/system_error" 3 #if __cplusplus < 201103L #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 35 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/system_error" 3 # 36 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/system_error" 3 #else # 37 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/system_error" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 38 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/system_error" 3 # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/system_error" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/system_error" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/error_constants.h" 1 3 // Specific definitions for generic platforms -*- C++ -*- // Copyright (C) 2007-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file bits/error_constants.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{system_error} */ #ifndef _GLIBCXX_ERROR_CONSTANTS #define _GLIBCXX_ERROR_CONSTANTS 1 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 33 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/error_constants.h" 3 # 34 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/error_constants.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 34 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/error_constants.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cerrno" 1 3 // The -*- C++ -*- forwarding header. // Copyright (C) 1997-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file cerrno * This is a Standard C++ Library file. You should @c \#include this file * in your programs, rather than any of the @a *.h implementation files. * * This is the C++ version of the Standard C Library header @c errno.h, * and its contents are (mostly) the same as that header, but are all * contained in the namespace @c std (except for names which are defined * as macros in C). */ // // ISO C++ 14882: 19.3 Error numbers // #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cerrno" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cerrno" 3 # 1 "/usr/include/errno.h" 1 3 4 /* Copyright (C) 1991-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard: 7.5 Errors */ #ifndef _ERRNO_H /* The includer defined __need_Emath if he wants only the definitions of EDOM and ERANGE, and not everything else. */ #ifndef __need_Emath # define _ERRNO_H 1 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 28 "/usr/include/errno.h" 3 4 # 29 "/usr/include/errno.h" 3 4 #endif # 30 "/usr/include/errno.h" 3 4 __BEGIN_DECLS /* Get the error number constants from the system-specific file. This file will test __need_Emath and _ERRNO_H. */ #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 35 "/usr/include/errno.h" 3 4 # 36 "/usr/include/errno.h" 3 4 #undef __need_Emath #ifdef _ERRNO_H /* Declare the `errno' variable, unless it's defined as a macro by bits/errno.h. This is the case in GNU, where it is a per-thread variable. This redeclaration using the macro still works, but it will be a function declaration without a prototype and may trigger a -Wstrict-prototypes warning. */ #ifndef errno extern int errno; #endif # 48 "/usr/include/errno.h" 3 4 #ifdef __USE_GNU /* The full and simple forms of the name with which the program was invoked. These variables are set up automatically at startup based on the value of ARGV[0] (this works only if you use GNU ld). */ extern char *program_invocation_name, *program_invocation_short_name; #endif /* __USE_GNU */ # 56 "/usr/include/errno.h" 3 4 #endif /* _ERRNO_H */ # 57 "/usr/include/errno.h" 3 4 __END_DECLS #endif /* _ERRNO_H */ # 61 "/usr/include/errno.h" 3 4 /* The Hurd defines `error_t' as an enumerated type so that printing `error_t' values in the debugger shows the names. We might need this definition sometimes even if this file was included before. */ #if defined __USE_GNU || defined __need_error_t # ifndef __error_t_defined typedef int error_t; # define __error_t_defined 1 # endif # 71 "/usr/include/errno.h" 3 4 # undef __need_error_t #endif # 73 "/usr/include/errno.h" 3 4 # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cerrno" 2 3 #ifndef _GLIBCXX_CERRNO #define _GLIBCXX_CERRNO 1 // Adhere to section 17.4.1.2 clause 5 of ISO 14882:1998 #ifndef errno #define errno errno #endif # 50 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cerrno" 3 #endif # 52 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cerrno" 3 # 35 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/error_constants.h" 2 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION enum class errc { address_family_not_supported = EAFNOSUPPORT, address_in_use = EADDRINUSE, address_not_available = EADDRNOTAVAIL, already_connected = EISCONN, argument_list_too_long = E2BIG, argument_out_of_domain = EDOM, bad_address = EFAULT, bad_file_descriptor = EBADF, #ifdef _GLIBCXX_HAVE_EBADMSG bad_message = EBADMSG, #endif # 54 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/error_constants.h" 3 broken_pipe = EPIPE, connection_aborted = ECONNABORTED, connection_already_in_progress = EALREADY, connection_refused = ECONNREFUSED, connection_reset = ECONNRESET, cross_device_link = EXDEV, destination_address_required = EDESTADDRREQ, device_or_resource_busy = EBUSY, directory_not_empty = ENOTEMPTY, executable_format_error = ENOEXEC, file_exists = EEXIST, file_too_large = EFBIG, filename_too_long = ENAMETOOLONG, function_not_supported = ENOSYS, host_unreachable = EHOSTUNREACH, #ifdef _GLIBCXX_HAVE_EIDRM identifier_removed = EIDRM, #endif # 74 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/error_constants.h" 3 illegal_byte_sequence = EILSEQ, inappropriate_io_control_operation = ENOTTY, interrupted = EINTR, invalid_argument = EINVAL, invalid_seek = ESPIPE, io_error = EIO, is_a_directory = EISDIR, message_size = EMSGSIZE, network_down = ENETDOWN, network_reset = ENETRESET, network_unreachable = ENETUNREACH, no_buffer_space = ENOBUFS, no_child_process = ECHILD, #ifdef _GLIBCXX_HAVE_ENOLINK no_link = ENOLINK, #endif # 92 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/error_constants.h" 3 no_lock_available = ENOLCK, #ifdef _GLIBCXX_HAVE_ENODATA no_message_available = ENODATA, #endif # 98 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/error_constants.h" 3 no_message = ENOMSG, no_protocol_option = ENOPROTOOPT, no_space_on_device = ENOSPC, #ifdef _GLIBCXX_HAVE_ENOSR no_stream_resources = ENOSR, #endif # 106 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/error_constants.h" 3 no_such_device_or_address = ENXIO, no_such_device = ENODEV, no_such_file_or_directory = ENOENT, no_such_process = ESRCH, not_a_directory = ENOTDIR, not_a_socket = ENOTSOCK, #ifdef _GLIBCXX_HAVE_ENOSTR not_a_stream = ENOSTR, #endif # 117 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/error_constants.h" 3 not_connected = ENOTCONN, not_enough_memory = ENOMEM, #ifdef _GLIBCXX_HAVE_ENOTSUP not_supported = ENOTSUP, #endif # 124 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/error_constants.h" 3 #ifdef _GLIBCXX_HAVE_ECANCELED operation_canceled = ECANCELED, #endif # 128 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/error_constants.h" 3 operation_in_progress = EINPROGRESS, operation_not_permitted = EPERM, operation_not_supported = EOPNOTSUPP, operation_would_block = EWOULDBLOCK, #ifdef _GLIBCXX_HAVE_EOWNERDEAD owner_dead = EOWNERDEAD, #endif # 137 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/error_constants.h" 3 permission_denied = EACCES, #ifdef _GLIBCXX_HAVE_EPROTO protocol_error = EPROTO, #endif # 143 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/error_constants.h" 3 protocol_not_supported = EPROTONOSUPPORT, read_only_file_system = EROFS, resource_deadlock_would_occur = EDEADLK, resource_unavailable_try_again = EAGAIN, result_out_of_range = ERANGE, #ifdef _GLIBCXX_HAVE_ENOTRECOVERABLE state_not_recoverable = ENOTRECOVERABLE, #endif # 153 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/error_constants.h" 3 #ifdef _GLIBCXX_HAVE_ETIME stream_timeout = ETIME, #endif # 157 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/error_constants.h" 3 #ifdef _GLIBCXX_HAVE_ETXTBSY text_file_busy = ETXTBSY, #endif # 161 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/error_constants.h" 3 timed_out = ETIMEDOUT, too_many_files_open_in_system = ENFILE, too_many_files_open = EMFILE, too_many_links = EMLINK, too_many_symbolic_link_levels = ELOOP, #ifdef _GLIBCXX_HAVE_EOVERFLOW value_too_large = EOVERFLOW, #endif # 171 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/error_constants.h" 3 wrong_protocol_type = EPROTOTYPE }; _GLIBCXX_END_NAMESPACE_VERSION } // namespace #endif # 179 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/error_constants.h" 3 # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/system_error" 2 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/system_error" 3 # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/system_error" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/system_error" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/stdexcept" 1 3 // Standard exception classes -*- C++ -*- // Copyright (C) 2001-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file include/stdexcept * This is a Standard C++ Library header. */ // // ISO C++ 19.1 Exception classes // #ifndef _GLIBCXX_STDEXCEPT #define _GLIBCXX_STDEXCEPT 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 37 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/stdexcept" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 38 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/stdexcept" 3 # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/stdexcept" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/stdexcept" 3 # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/stdexcept" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION #if _GLIBCXX_USE_DUAL_ABI #if _GLIBCXX_USE_CXX11_ABI // Emulates an old COW string when the new std::string is in use. struct __cow_string { union { const char* _M_p; char _M_bytes[sizeof(const char*)]; }; __cow_string(); __cow_string(const std::string&); __cow_string(const char*, size_t); __cow_string(const __cow_string&) _GLIBCXX_USE_NOEXCEPT; __cow_string& operator=(const __cow_string&) _GLIBCXX_USE_NOEXCEPT; ~__cow_string(); #if __cplusplus >= 201103L __cow_string(__cow_string&&) noexcept; __cow_string& operator=(__cow_string&&) noexcept; #endif # 65 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/stdexcept" 3 }; typedef basic_string __sso_string; #else // _GLIBCXX_USE_CXX11_ABI # 69 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/stdexcept" 3 typedef basic_string __cow_string; // Emulates a new SSO string when the old std::string is in use. struct __sso_string { struct __str { const char* _M_p; size_t _M_string_length; char _M_local_buf[16]; }; union { __str _M_s; char _M_bytes[sizeof(__str)]; }; __sso_string() _GLIBCXX_USE_NOEXCEPT; __sso_string(const std::string&); __sso_string(const char*, size_t); __sso_string(const __sso_string&); __sso_string& operator=(const __sso_string&); ~__sso_string(); #if __cplusplus >= 201103L __sso_string(__sso_string&&) noexcept; __sso_string& operator=(__sso_string&&) noexcept; #endif # 96 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/stdexcept" 3 }; #endif // _GLIBCXX_USE_CXX11_ABI # 98 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/stdexcept" 3 #else // _GLIBCXX_USE_DUAL_ABI # 99 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/stdexcept" 3 typedef basic_string __sso_string; typedef basic_string __cow_string; #endif # 102 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/stdexcept" 3 /** * @addtogroup exceptions * @{ */ /** Logic errors represent problems in the internal logic of a program; * in theory, these are preventable, and even detectable before the * program runs (e.g., violations of class invariants). * @brief One of two subclasses of exception. */ class logic_error : public exception { __cow_string _M_msg; public: /** Takes a character string describing the error. */ explicit logic_error(const string& __arg); #if __cplusplus >= 201103L explicit logic_error(const char*); #endif # 126 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/stdexcept" 3 #if _GLIBCXX_USE_CXX11_ABI || _GLIBCXX_DEFINE_STDEXCEPT_COPY_OPS logic_error(const logic_error&) _GLIBCXX_USE_NOEXCEPT; logic_error& operator=(const logic_error&) _GLIBCXX_USE_NOEXCEPT; #endif # 131 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/stdexcept" 3 virtual ~logic_error() _GLIBCXX_USE_NOEXCEPT; /** Returns a C-style character string describing the general cause of * the current error (the same string passed to the ctor). */ virtual const char* what() const _GLIBCXX_USE_NOEXCEPT; }; /** Thrown by the library, or by you, to report domain errors (domain in * the mathematical sense). */ class domain_error : public logic_error { public: explicit domain_error(const string& __arg); #if __cplusplus >= 201103L explicit domain_error(const char*); #endif # 149 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/stdexcept" 3 virtual ~domain_error() _GLIBCXX_USE_NOEXCEPT; }; /** Thrown to report invalid arguments to functions. */ class invalid_argument : public logic_error { public: explicit invalid_argument(const string& __arg); #if __cplusplus >= 201103L explicit invalid_argument(const char*); #endif # 160 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/stdexcept" 3 virtual ~invalid_argument() _GLIBCXX_USE_NOEXCEPT; }; /** Thrown when an object is constructed that would exceed its maximum * permitted size (e.g., a basic_string instance). */ class length_error : public logic_error { public: explicit length_error(const string& __arg); #if __cplusplus >= 201103L explicit length_error(const char*); #endif # 172 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/stdexcept" 3 virtual ~length_error() _GLIBCXX_USE_NOEXCEPT; }; /** This represents an argument whose value is not within the expected * range (e.g., boundary checks in basic_string). */ class out_of_range : public logic_error { public: explicit out_of_range(const string& __arg); #if __cplusplus >= 201103L explicit out_of_range(const char*); #endif # 184 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/stdexcept" 3 virtual ~out_of_range() _GLIBCXX_USE_NOEXCEPT; }; /** Runtime errors represent problems outside the scope of a program; * they cannot be easily predicted and can generally only be caught as * the program executes. * @brief One of two subclasses of exception. */ class runtime_error : public exception { __cow_string _M_msg; public: /** Takes a character string describing the error. */ explicit runtime_error(const string& __arg); #if __cplusplus >= 201103L explicit runtime_error(const char*); #endif # 205 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/stdexcept" 3 #if _GLIBCXX_USE_CXX11_ABI || _GLIBCXX_DEFINE_STDEXCEPT_COPY_OPS runtime_error(const runtime_error&) _GLIBCXX_USE_NOEXCEPT; runtime_error& operator=(const runtime_error&) _GLIBCXX_USE_NOEXCEPT; #endif # 210 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/stdexcept" 3 virtual ~runtime_error() _GLIBCXX_USE_NOEXCEPT; /** Returns a C-style character string describing the general cause of * the current error (the same string passed to the ctor). */ virtual const char* what() const _GLIBCXX_USE_NOEXCEPT; }; /** Thrown to indicate range errors in internal computations. */ class range_error : public runtime_error { public: explicit range_error(const string& __arg); #if __cplusplus >= 201103L explicit range_error(const char*); #endif # 227 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/stdexcept" 3 virtual ~range_error() _GLIBCXX_USE_NOEXCEPT; }; /** Thrown to indicate arithmetic overflow. */ class overflow_error : public runtime_error { public: explicit overflow_error(const string& __arg); #if __cplusplus >= 201103L explicit overflow_error(const char*); #endif # 238 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/stdexcept" 3 virtual ~overflow_error() _GLIBCXX_USE_NOEXCEPT; }; /** Thrown to indicate arithmetic underflow. */ class underflow_error : public runtime_error { public: explicit underflow_error(const string& __arg); #if __cplusplus >= 201103L explicit underflow_error(const char*); #endif # 249 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/stdexcept" 3 virtual ~underflow_error() _GLIBCXX_USE_NOEXCEPT; }; // @} group exceptions _GLIBCXX_END_NAMESPACE_VERSION } // namespace #endif /* _GLIBCXX_STDEXCEPT */ # 258 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/stdexcept" 3 # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/system_error" 2 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION class error_code; class error_condition; class system_error; /// is_error_code_enum template struct is_error_code_enum : public false_type { }; /// is_error_condition_enum template struct is_error_condition_enum : public false_type { }; template<> struct is_error_condition_enum : public true_type { }; inline namespace _V2 { /// error_category class error_category { public: constexpr error_category() noexcept = default; virtual ~error_category(); error_category(const error_category&) = delete; error_category& operator=(const error_category&) = delete; virtual const char* name() const noexcept = 0; // We need two different virtual functions here, one returning a // COW string and one returning an SSO string. Their positions in the // vtable must be consistent for dynamic dispatch to work, but which one // the name "message()" finds depends on which ABI the caller is using. #if _GLIBCXX_USE_CXX11_ABI private: _GLIBCXX_DEFAULT_ABI_TAG virtual __cow_string _M_message(int) const; public: _GLIBCXX_DEFAULT_ABI_TAG virtual string message(int) const = 0; #else # 94 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/system_error" 3 virtual string message(int) const = 0; private: virtual __sso_string _M_message(int) const; #endif # 101 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/system_error" 3 public: virtual error_condition default_error_condition(int __i) const noexcept; virtual bool equivalent(int __i, const error_condition& __cond) const noexcept; virtual bool equivalent(const error_code& __code, int __i) const noexcept; bool operator<(const error_category& __other) const noexcept { return less()(this, &__other); } bool operator==(const error_category& __other) const noexcept { return this == &__other; } bool operator!=(const error_category& __other) const noexcept { return this != &__other; } }; // DR 890. _GLIBCXX_CONST const error_category& system_category() noexcept; _GLIBCXX_CONST const error_category& generic_category() noexcept; } // end inline namespace error_code make_error_code(errc) noexcept; template struct hash; /// error_code // Implementation-specific error identification struct error_code { error_code() noexcept : _M_value(0), _M_cat(&system_category()) { } error_code(int __v, const error_category& __cat) noexcept : _M_value(__v), _M_cat(&__cat) { } template::value>::type> error_code(_ErrorCodeEnum __e) noexcept { *this = make_error_code(__e); } void assign(int __v, const error_category& __cat) noexcept { _M_value = __v; _M_cat = &__cat; } void clear() noexcept { assign(0, system_category()); } // DR 804. template typename enable_if::value, error_code&>::type operator=(_ErrorCodeEnum __e) noexcept { return *this = make_error_code(__e); } int value() const noexcept { return _M_value; } const error_category& category() const noexcept { return *_M_cat; } error_condition default_error_condition() const noexcept; _GLIBCXX_DEFAULT_ABI_TAG string message() const { return category().message(value()); } explicit operator bool() const noexcept { return _M_value != 0 ? true : false; } // DR 804. private: friend class hash; int _M_value; const error_category* _M_cat; }; // 19.4.2.6 non-member functions inline error_code make_error_code(errc __e) noexcept { return error_code(static_cast(__e), generic_category()); } inline bool operator<(const error_code& __lhs, const error_code& __rhs) noexcept { return (__lhs.category() < __rhs.category() || (__lhs.category() == __rhs.category() && __lhs.value() < __rhs.value())); } template basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e) { return (__os << __e.category().name() << ':' << __e.value()); } error_condition make_error_condition(errc) noexcept; /// error_condition // Portable error identification struct error_condition { error_condition() noexcept : _M_value(0), _M_cat(&generic_category()) { } error_condition(int __v, const error_category& __cat) noexcept : _M_value(__v), _M_cat(&__cat) { } template::value>::type> error_condition(_ErrorConditionEnum __e) noexcept { *this = make_error_condition(__e); } void assign(int __v, const error_category& __cat) noexcept { _M_value = __v; _M_cat = &__cat; } // DR 804. template typename enable_if::value, error_condition&>::type operator=(_ErrorConditionEnum __e) noexcept { return *this = make_error_condition(__e); } void clear() noexcept { assign(0, generic_category()); } // 19.4.3.4 observers int value() const noexcept { return _M_value; } const error_category& category() const noexcept { return *_M_cat; } _GLIBCXX_DEFAULT_ABI_TAG string message() const { return category().message(value()); } explicit operator bool() const noexcept { return _M_value != 0 ? true : false; } // DR 804. private: int _M_value; const error_category* _M_cat; }; // 19.4.3.6 non-member functions inline error_condition make_error_condition(errc __e) noexcept { return error_condition(static_cast(__e), generic_category()); } inline bool operator<(const error_condition& __lhs, const error_condition& __rhs) noexcept { return (__lhs.category() < __rhs.category() || (__lhs.category() == __rhs.category() && __lhs.value() < __rhs.value())); } // 19.4.4 Comparison operators inline bool operator==(const error_code& __lhs, const error_code& __rhs) noexcept { return (__lhs.category() == __rhs.category() && __lhs.value() == __rhs.value()); } inline bool operator==(const error_code& __lhs, const error_condition& __rhs) noexcept { return (__lhs.category().equivalent(__lhs.value(), __rhs) || __rhs.category().equivalent(__lhs, __rhs.value())); } inline bool operator==(const error_condition& __lhs, const error_code& __rhs) noexcept { return (__rhs.category().equivalent(__rhs.value(), __lhs) || __lhs.category().equivalent(__rhs, __lhs.value())); } inline bool operator==(const error_condition& __lhs, const error_condition& __rhs) noexcept { return (__lhs.category() == __rhs.category() && __lhs.value() == __rhs.value()); } inline bool operator!=(const error_code& __lhs, const error_code& __rhs) noexcept { return !(__lhs == __rhs); } inline bool operator!=(const error_code& __lhs, const error_condition& __rhs) noexcept { return !(__lhs == __rhs); } inline bool operator!=(const error_condition& __lhs, const error_code& __rhs) noexcept { return !(__lhs == __rhs); } inline bool operator!=(const error_condition& __lhs, const error_condition& __rhs) noexcept { return !(__lhs == __rhs); } /** * @brief Thrown to indicate error code of underlying system. * * @ingroup exceptions */ class system_error : public std::runtime_error { private: error_code _M_code; public: system_error(error_code __ec = error_code()) : runtime_error(__ec.message()), _M_code(__ec) { } system_error(error_code __ec, const string& __what) : runtime_error(__what + ": " + __ec.message()), _M_code(__ec) { } system_error(error_code __ec, const char* __what) : runtime_error(__what + (": " + __ec.message())), _M_code(__ec) { } system_error(int __v, const error_category& __ecat, const char* __what) : system_error(error_code(__v, __ecat), __what) { } system_error(int __v, const error_category& __ecat) : runtime_error(error_code(__v, __ecat).message()), _M_code(__v, __ecat) { } system_error(int __v, const error_category& __ecat, const string& __what) : runtime_error(__what + ": " + error_code(__v, __ecat).message()), _M_code(__v, __ecat) { } virtual ~system_error() noexcept; const error_code& code() const noexcept { return _M_code; } }; _GLIBCXX_END_NAMESPACE_VERSION } // namespace #ifndef _GLIBCXX_COMPATIBILITY_CXX0X #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 370 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/system_error" 3 # 371 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/system_error" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION // DR 1182. /// std::hash specialization for error_code. template<> struct hash : public __hash_base { size_t operator()(const error_code& __e) const noexcept { const size_t __tmp = std::_Hash_impl::hash(__e._M_value); return std::_Hash_impl::__hash_combine(__e._M_cat, __tmp); } }; _GLIBCXX_END_NAMESPACE_VERSION } // namespace #endif // _GLIBCXX_COMPATIBILITY_CXX0X # 394 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/system_error" 3 #endif // C++11 # 396 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/system_error" 3 #endif // _GLIBCXX_SYSTEM_ERROR # 398 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/system_error" 3 # 47 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/ios_base.h" 2 3 #endif # 48 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/ios_base.h" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION // The following definitions of bitmask types are enums, not ints, // as permitted (but not required) in the standard, in order to provide // better type safety in iostream calls. A side effect is that // expressions involving them are no longer compile-time constants. enum _Ios_Fmtflags { _S_boolalpha = 1L << 0, _S_dec = 1L << 1, _S_fixed = 1L << 2, _S_hex = 1L << 3, _S_internal = 1L << 4, _S_left = 1L << 5, _S_oct = 1L << 6, _S_right = 1L << 7, _S_scientific = 1L << 8, _S_showbase = 1L << 9, _S_showpoint = 1L << 10, _S_showpos = 1L << 11, _S_skipws = 1L << 12, _S_unitbuf = 1L << 13, _S_uppercase = 1L << 14, _S_adjustfield = _S_left | _S_right | _S_internal, _S_basefield = _S_dec | _S_oct | _S_hex, _S_floatfield = _S_scientific | _S_fixed, _S_ios_fmtflags_end = 1L << 16, _S_ios_fmtflags_max = __INT_MAX__, _S_ios_fmtflags_min = ~__INT_MAX__ }; inline _GLIBCXX_CONSTEXPR _Ios_Fmtflags operator&(_Ios_Fmtflags __a, _Ios_Fmtflags __b) { return _Ios_Fmtflags(static_cast(__a) & static_cast(__b)); } inline _GLIBCXX_CONSTEXPR _Ios_Fmtflags operator|(_Ios_Fmtflags __a, _Ios_Fmtflags __b) { return _Ios_Fmtflags(static_cast(__a) | static_cast(__b)); } inline _GLIBCXX_CONSTEXPR _Ios_Fmtflags operator^(_Ios_Fmtflags __a, _Ios_Fmtflags __b) { return _Ios_Fmtflags(static_cast(__a) ^ static_cast(__b)); } inline _GLIBCXX_CONSTEXPR _Ios_Fmtflags operator~(_Ios_Fmtflags __a) { return _Ios_Fmtflags(~static_cast(__a)); } inline const _Ios_Fmtflags& operator|=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b) { return __a = __a | __b; } inline const _Ios_Fmtflags& operator&=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b) { return __a = __a & __b; } inline const _Ios_Fmtflags& operator^=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b) { return __a = __a ^ __b; } enum _Ios_Openmode { _S_app = 1L << 0, _S_ate = 1L << 1, _S_bin = 1L << 2, _S_in = 1L << 3, _S_out = 1L << 4, _S_trunc = 1L << 5, _S_ios_openmode_end = 1L << 16, _S_ios_openmode_max = __INT_MAX__, _S_ios_openmode_min = ~__INT_MAX__ }; inline _GLIBCXX_CONSTEXPR _Ios_Openmode operator&(_Ios_Openmode __a, _Ios_Openmode __b) { return _Ios_Openmode(static_cast(__a) & static_cast(__b)); } inline _GLIBCXX_CONSTEXPR _Ios_Openmode operator|(_Ios_Openmode __a, _Ios_Openmode __b) { return _Ios_Openmode(static_cast(__a) | static_cast(__b)); } inline _GLIBCXX_CONSTEXPR _Ios_Openmode operator^(_Ios_Openmode __a, _Ios_Openmode __b) { return _Ios_Openmode(static_cast(__a) ^ static_cast(__b)); } inline _GLIBCXX_CONSTEXPR _Ios_Openmode operator~(_Ios_Openmode __a) { return _Ios_Openmode(~static_cast(__a)); } inline const _Ios_Openmode& operator|=(_Ios_Openmode& __a, _Ios_Openmode __b) { return __a = __a | __b; } inline const _Ios_Openmode& operator&=(_Ios_Openmode& __a, _Ios_Openmode __b) { return __a = __a & __b; } inline const _Ios_Openmode& operator^=(_Ios_Openmode& __a, _Ios_Openmode __b) { return __a = __a ^ __b; } enum _Ios_Iostate { _S_goodbit = 0, _S_badbit = 1L << 0, _S_eofbit = 1L << 1, _S_failbit = 1L << 2, _S_ios_iostate_end = 1L << 16, _S_ios_iostate_max = __INT_MAX__, _S_ios_iostate_min = ~__INT_MAX__ }; inline _GLIBCXX_CONSTEXPR _Ios_Iostate operator&(_Ios_Iostate __a, _Ios_Iostate __b) { return _Ios_Iostate(static_cast(__a) & static_cast(__b)); } inline _GLIBCXX_CONSTEXPR _Ios_Iostate operator|(_Ios_Iostate __a, _Ios_Iostate __b) { return _Ios_Iostate(static_cast(__a) | static_cast(__b)); } inline _GLIBCXX_CONSTEXPR _Ios_Iostate operator^(_Ios_Iostate __a, _Ios_Iostate __b) { return _Ios_Iostate(static_cast(__a) ^ static_cast(__b)); } inline _GLIBCXX_CONSTEXPR _Ios_Iostate operator~(_Ios_Iostate __a) { return _Ios_Iostate(~static_cast(__a)); } inline const _Ios_Iostate& operator|=(_Ios_Iostate& __a, _Ios_Iostate __b) { return __a = __a | __b; } inline const _Ios_Iostate& operator&=(_Ios_Iostate& __a, _Ios_Iostate __b) { return __a = __a & __b; } inline const _Ios_Iostate& operator^=(_Ios_Iostate& __a, _Ios_Iostate __b) { return __a = __a ^ __b; } enum _Ios_Seekdir { _S_beg = 0, _S_cur = _GLIBCXX_STDIO_SEEK_CUR, _S_end = _GLIBCXX_STDIO_SEEK_END, _S_ios_seekdir_end = 1L << 16 }; #if __cplusplus >= 201103L /// I/O error code enum class io_errc { stream = 1 }; template <> struct is_error_code_enum : public true_type { }; const error_category& iostream_category() noexcept; inline error_code make_error_code(io_errc e) noexcept { return error_code(static_cast(e), iostream_category()); } inline error_condition make_error_condition(io_errc e) noexcept { return error_condition(static_cast(e), iostream_category()); } #endif # 217 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/ios_base.h" 3 // 27.4.2 Class ios_base /** * @brief The base of the I/O class hierarchy. * @ingroup io * * This class defines everything that can be defined about I/O that does * not depend on the type of characters being input or output. Most * people will only see @c ios_base when they need to specify the full * name of the various I/O flags (e.g., the openmodes). */ class ios_base { #if _GLIBCXX_USE_CXX11_ABI #if __cplusplus < 201103L // Type that is layout-compatible with std::system_error struct system_error : std::runtime_error { // Type that is layout-compatible with std::error_code struct error_code { error_code() { } private: int _M_value; const void* _M_cat; } _M_code; }; #endif # 245 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/ios_base.h" 3 #endif # 246 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/ios_base.h" 3 public: /** * @brief These are thrown to indicate problems with io. * @ingroup exceptions * * 27.4.2.1.1 Class ios_base::failure */ #if _GLIBCXX_USE_CXX11_ABI class _GLIBCXX_ABI_TAG_CXX11 failure : public system_error { public: explicit failure(const string& __str); #if __cplusplus >= 201103L explicit failure(const string&, const error_code&); explicit failure(const char*, const error_code& = io_errc::stream); #endif # 268 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/ios_base.h" 3 virtual ~failure() throw(); virtual const char* what() const throw(); }; #else # 276 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/ios_base.h" 3 class failure : public exception { public: // _GLIBCXX_RESOLVE_LIB_DEFECTS // 48. Use of non-existent exception constructor explicit failure(const string& __str) throw(); // This declaration is not useless: // http://gcc.gnu.org/onlinedocs/gcc-4.3.2/gcc/Vague-Linkage.html virtual ~failure() throw(); virtual const char* what() const throw(); private: string _M_msg; }; #endif # 296 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/ios_base.h" 3 // 27.4.2.1.2 Type ios_base::fmtflags /** * @brief This is a bitmask type. * * @c @a _Ios_Fmtflags is implementation-defined, but it is valid to * perform bitwise operations on these values and expect the Right * Thing to happen. Defined objects of type fmtflags are: * - boolalpha * - dec * - fixed * - hex * - internal * - left * - oct * - right * - scientific * - showbase * - showpoint * - showpos * - skipws * - unitbuf * - uppercase * - adjustfield * - basefield * - floatfield */ typedef _Ios_Fmtflags fmtflags; /// Insert/extract @c bool in alphabetic rather than numeric format. static const fmtflags boolalpha = _S_boolalpha; /// Converts integer input or generates integer output in decimal base. static const fmtflags dec = _S_dec; /// Generate floating-point output in fixed-point notation. static const fmtflags fixed = _S_fixed; /// Converts integer input or generates integer output in hexadecimal base. static const fmtflags hex = _S_hex; /// Adds fill characters at a designated internal point in certain /// generated output, or identical to @c right if no such point is /// designated. static const fmtflags internal = _S_internal; /// Adds fill characters on the right (final positions) of certain /// generated output. (I.e., the thing you print is flush left.) static const fmtflags left = _S_left; /// Converts integer input or generates integer output in octal base. static const fmtflags oct = _S_oct; /// Adds fill characters on the left (initial positions) of certain /// generated output. (I.e., the thing you print is flush right.) static const fmtflags right = _S_right; /// Generates floating-point output in scientific notation. static const fmtflags scientific = _S_scientific; /// Generates a prefix indicating the numeric base of generated integer /// output. static const fmtflags showbase = _S_showbase; /// Generates a decimal-point character unconditionally in generated /// floating-point output. static const fmtflags showpoint = _S_showpoint; /// Generates a + sign in non-negative generated numeric output. static const fmtflags showpos = _S_showpos; /// Skips leading white space before certain input operations. static const fmtflags skipws = _S_skipws; /// Flushes output after each output operation. static const fmtflags unitbuf = _S_unitbuf; /// Replaces certain lowercase letters with their uppercase equivalents /// in generated output. static const fmtflags uppercase = _S_uppercase; /// A mask of left|right|internal. Useful for the 2-arg form of @c setf. static const fmtflags adjustfield = _S_adjustfield; /// A mask of dec|oct|hex. Useful for the 2-arg form of @c setf. static const fmtflags basefield = _S_basefield; /// A mask of scientific|fixed. Useful for the 2-arg form of @c setf. static const fmtflags floatfield = _S_floatfield; // 27.4.2.1.3 Type ios_base::iostate /** * @brief This is a bitmask type. * * @c @a _Ios_Iostate is implementation-defined, but it is valid to * perform bitwise operations on these values and expect the Right * Thing to happen. Defined objects of type iostate are: * - badbit * - eofbit * - failbit * - goodbit */ typedef _Ios_Iostate iostate; /// Indicates a loss of integrity in an input or output sequence (such /// as an irrecoverable read error from a file). static const iostate badbit = _S_badbit; /// Indicates that an input operation reached the end of an input sequence. static const iostate eofbit = _S_eofbit; /// Indicates that an input operation failed to read the expected /// characters, or that an output operation failed to generate the /// desired characters. static const iostate failbit = _S_failbit; /// Indicates all is well. static const iostate goodbit = _S_goodbit; // 27.4.2.1.4 Type ios_base::openmode /** * @brief This is a bitmask type. * * @c @a _Ios_Openmode is implementation-defined, but it is valid to * perform bitwise operations on these values and expect the Right * Thing to happen. Defined objects of type openmode are: * - app * - ate * - binary * - in * - out * - trunc */ typedef _Ios_Openmode openmode; /// Seek to end before each write. static const openmode app = _S_app; /// Open and seek to end immediately after opening. static const openmode ate = _S_ate; /// Perform input and output in binary mode (as opposed to text mode). /// This is probably not what you think it is; see /// https://gcc.gnu.org/onlinedocs/libstdc++/manual/fstreams.html#std.io.filestreams.binary static const openmode binary = _S_bin; /// Open for input. Default for @c ifstream and fstream. static const openmode in = _S_in; /// Open for output. Default for @c ofstream and fstream. static const openmode out = _S_out; /// Open for input. Default for @c ofstream. static const openmode trunc = _S_trunc; // 27.4.2.1.5 Type ios_base::seekdir /** * @brief This is an enumerated type. * * @c @a _Ios_Seekdir is implementation-defined. Defined values * of type seekdir are: * - beg * - cur, equivalent to @c SEEK_CUR in the C standard library. * - end, equivalent to @c SEEK_END in the C standard library. */ typedef _Ios_Seekdir seekdir; /// Request a seek relative to the beginning of the stream. static const seekdir beg = _S_beg; /// Request a seek relative to the current position within the sequence. static const seekdir cur = _S_cur; /// Request a seek relative to the current end of the sequence. static const seekdir end = _S_end; // Annex D.6 typedef int io_state; typedef int open_mode; typedef int seek_dir; typedef std::streampos streampos; typedef std::streamoff streamoff; // Callbacks; /** * @brief The set of events that may be passed to an event callback. * * erase_event is used during ~ios() and copyfmt(). imbue_event is used * during imbue(). copyfmt_event is used during copyfmt(). */ enum event { erase_event, imbue_event, copyfmt_event }; /** * @brief The type of an event callback function. * @param __e One of the members of the event enum. * @param __b Reference to the ios_base object. * @param __i The integer provided when the callback was registered. * * Event callbacks are user defined functions that get called during * several ios_base and basic_ios functions, specifically imbue(), * copyfmt(), and ~ios(). */ typedef void (*event_callback) (event __e, ios_base& __b, int __i); /** * @brief Add the callback __fn with parameter __index. * @param __fn The function to add. * @param __index The integer to pass to the function when invoked. * * Registers a function as an event callback with an integer parameter to * be passed to the function when invoked. Multiple copies of the * function are allowed. If there are multiple callbacks, they are * invoked in the order they were registered. */ void register_callback(event_callback __fn, int __index); protected: streamsize _M_precision; streamsize _M_width; fmtflags _M_flags; iostate _M_exception; iostate _M_streambuf_state; // 27.4.2.6 Members for callbacks // 27.4.2.6 ios_base callbacks struct _Callback_list { // Data Members _Callback_list* _M_next; ios_base::event_callback _M_fn; int _M_index; _Atomic_word _M_refcount; // 0 means one reference. _Callback_list(ios_base::event_callback __fn, int __index, _Callback_list* __cb) : _M_next(__cb), _M_fn(__fn), _M_index(__index), _M_refcount(0) { } void _M_add_reference() { __gnu_cxx::__atomic_add_dispatch(&_M_refcount, 1); } // 0 => OK to delete. int _M_remove_reference() { // Be race-detector-friendly. For more info see bits/c++config. _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(&_M_refcount); int __res = __gnu_cxx::__exchange_and_add_dispatch(&_M_refcount, -1); if (__res == 0) { _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(&_M_refcount); } return __res; } }; _Callback_list* _M_callbacks; void _M_call_callbacks(event __ev) throw(); void _M_dispose_callbacks(void) throw(); // 27.4.2.5 Members for iword/pword storage struct _Words { void* _M_pword; long _M_iword; _Words() : _M_pword(0), _M_iword(0) { } }; // Only for failed iword/pword calls. _Words _M_word_zero; // Guaranteed storage. // The first 5 iword and pword slots are reserved for internal use. enum { _S_local_word_size = 8 }; _Words _M_local_word[_S_local_word_size]; // Allocated storage. int _M_word_size; _Words* _M_word; _Words& _M_grow_words(int __index, bool __iword); // Members for locale and locale caching. locale _M_ios_locale; void _M_init() throw(); public: // 27.4.2.1.6 Class ios_base::Init // Used to initialize standard streams. In theory, g++ could use // -finit-priority to order this stuff correctly without going // through these machinations. class Init { friend class ios_base; public: Init(); ~Init(); private: static _Atomic_word _S_refcount; static bool _S_synced_with_stdio; }; // [27.4.2.2] fmtflags state functions /** * @brief Access to format flags. * @return The format control flags for both input and output. */ fmtflags flags() const { return _M_flags; } /** * @brief Setting new format flags all at once. * @param __fmtfl The new flags to set. * @return The previous format control flags. * * This function overwrites all the format flags with @a __fmtfl. */ fmtflags flags(fmtflags __fmtfl) { fmtflags __old = _M_flags; _M_flags = __fmtfl; return __old; } /** * @brief Setting new format flags. * @param __fmtfl Additional flags to set. * @return The previous format control flags. * * This function sets additional flags in format control. Flags that * were previously set remain set. */ fmtflags setf(fmtflags __fmtfl) { fmtflags __old = _M_flags; _M_flags |= __fmtfl; return __old; } /** * @brief Setting new format flags. * @param __fmtfl Additional flags to set. * @param __mask The flags mask for @a fmtfl. * @return The previous format control flags. * * This function clears @a mask in the format flags, then sets * @a fmtfl @c & @a mask. An example mask is @c ios_base::adjustfield. */ fmtflags setf(fmtflags __fmtfl, fmtflags __mask) { fmtflags __old = _M_flags; _M_flags &= ~__mask; _M_flags |= (__fmtfl & __mask); return __old; } /** * @brief Clearing format flags. * @param __mask The flags to unset. * * This function clears @a __mask in the format flags. */ void unsetf(fmtflags __mask) { _M_flags &= ~__mask; } /** * @brief Flags access. * @return The precision to generate on certain output operations. * * Be careful if you try to give a definition of @a precision here; see * DR 189. */ streamsize precision() const { return _M_precision; } /** * @brief Changing flags. * @param __prec The new precision value. * @return The previous value of precision(). */ streamsize precision(streamsize __prec) { streamsize __old = _M_precision; _M_precision = __prec; return __old; } /** * @brief Flags access. * @return The minimum field width to generate on output operations. * * Minimum field width refers to the number of characters. */ streamsize width() const { return _M_width; } /** * @brief Changing flags. * @param __wide The new width value. * @return The previous value of width(). */ streamsize width(streamsize __wide) { streamsize __old = _M_width; _M_width = __wide; return __old; } // [27.4.2.4] ios_base static members /** * @brief Interaction with the standard C I/O objects. * @param __sync Whether to synchronize or not. * @return True if the standard streams were previously synchronized. * * The synchronization referred to is @e only that between the standard * C facilities (e.g., stdout) and the standard C++ objects (e.g., * cout). User-declared streams are unaffected. See * https://gcc.gnu.org/onlinedocs/libstdc++/manual/fstreams.html#std.io.filestreams.binary */ static bool sync_with_stdio(bool __sync = true); // [27.4.2.3] ios_base locale functions /** * @brief Setting a new locale. * @param __loc The new locale. * @return The previous locale. * * Sets the new locale for this stream, and then invokes each callback * with imbue_event. */ locale imbue(const locale& __loc) throw(); /** * @brief Locale access * @return A copy of the current locale. * * If @c imbue(loc) has previously been called, then this function * returns @c loc. Otherwise, it returns a copy of @c std::locale(), * the global C++ locale. */ locale getloc() const { return _M_ios_locale; } /** * @brief Locale access * @return A reference to the current locale. * * Like getloc above, but returns a reference instead of * generating a copy. */ const locale& _M_getloc() const { return _M_ios_locale; } // [27.4.2.5] ios_base storage functions /** * @brief Access to unique indices. * @return An integer different from all previous calls. * * This function returns a unique integer every time it is called. It * can be used for any purpose, but is primarily intended to be a unique * index for the iword and pword functions. The expectation is that an * application calls xalloc in order to obtain an index in the iword and * pword arrays that can be used without fear of conflict. * * The implementation maintains a static variable that is incremented and * returned on each invocation. xalloc is guaranteed to return an index * that is safe to use in the iword and pword arrays. */ static int xalloc() throw(); /** * @brief Access to integer array. * @param __ix Index into the array. * @return A reference to an integer associated with the index. * * The iword function provides access to an array of integers that can be * used for any purpose. The array grows as required to hold the * supplied index. All integers in the array are initialized to 0. * * The implementation reserves several indices. You should use xalloc to * obtain an index that is safe to use. Also note that since the array * can grow dynamically, it is not safe to hold onto the reference. */ long& iword(int __ix) { _Words& __word = (__ix < _M_word_size) ? _M_word[__ix] : _M_grow_words(__ix, true); return __word._M_iword; } /** * @brief Access to void pointer array. * @param __ix Index into the array. * @return A reference to a void* associated with the index. * * The pword function provides access to an array of pointers that can be * used for any purpose. The array grows as required to hold the * supplied index. All pointers in the array are initialized to 0. * * The implementation reserves several indices. You should use xalloc to * obtain an index that is safe to use. Also note that since the array * can grow dynamically, it is not safe to hold onto the reference. */ void*& pword(int __ix) { _Words& __word = (__ix < _M_word_size) ? _M_word[__ix] : _M_grow_words(__ix, false); return __word._M_pword; } // Destructor /** * Invokes each callback with erase_event. Destroys local storage. * * Note that the ios_base object for the standard streams never gets * destroyed. As a result, any callbacks registered with the standard * streams will not get invoked with erase_event (unless copyfmt is * used). */ virtual ~ios_base(); protected: ios_base() throw (); #if __cplusplus < 201103L // _GLIBCXX_RESOLVE_LIB_DEFECTS // 50. Copy constructor and assignment operator of ios_base private: ios_base(const ios_base&); ios_base& operator=(const ios_base&); #else # 860 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/ios_base.h" 3 public: ios_base(const ios_base&) = delete; ios_base& operator=(const ios_base&) = delete; protected: void _M_move(ios_base&) noexcept; void _M_swap(ios_base& __rhs) noexcept; #endif # 873 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/ios_base.h" 3 }; // [27.4.5.1] fmtflags manipulators /// Calls base.setf(ios_base::boolalpha). inline ios_base& boolalpha(ios_base& __base) { __base.setf(ios_base::boolalpha); return __base; } /// Calls base.unsetf(ios_base::boolalpha). inline ios_base& noboolalpha(ios_base& __base) { __base.unsetf(ios_base::boolalpha); return __base; } /// Calls base.setf(ios_base::showbase). inline ios_base& showbase(ios_base& __base) { __base.setf(ios_base::showbase); return __base; } /// Calls base.unsetf(ios_base::showbase). inline ios_base& noshowbase(ios_base& __base) { __base.unsetf(ios_base::showbase); return __base; } /// Calls base.setf(ios_base::showpoint). inline ios_base& showpoint(ios_base& __base) { __base.setf(ios_base::showpoint); return __base; } /// Calls base.unsetf(ios_base::showpoint). inline ios_base& noshowpoint(ios_base& __base) { __base.unsetf(ios_base::showpoint); return __base; } /// Calls base.setf(ios_base::showpos). inline ios_base& showpos(ios_base& __base) { __base.setf(ios_base::showpos); return __base; } /// Calls base.unsetf(ios_base::showpos). inline ios_base& noshowpos(ios_base& __base) { __base.unsetf(ios_base::showpos); return __base; } /// Calls base.setf(ios_base::skipws). inline ios_base& skipws(ios_base& __base) { __base.setf(ios_base::skipws); return __base; } /// Calls base.unsetf(ios_base::skipws). inline ios_base& noskipws(ios_base& __base) { __base.unsetf(ios_base::skipws); return __base; } /// Calls base.setf(ios_base::uppercase). inline ios_base& uppercase(ios_base& __base) { __base.setf(ios_base::uppercase); return __base; } /// Calls base.unsetf(ios_base::uppercase). inline ios_base& nouppercase(ios_base& __base) { __base.unsetf(ios_base::uppercase); return __base; } /// Calls base.setf(ios_base::unitbuf). inline ios_base& unitbuf(ios_base& __base) { __base.setf(ios_base::unitbuf); return __base; } /// Calls base.unsetf(ios_base::unitbuf). inline ios_base& nounitbuf(ios_base& __base) { __base.unsetf(ios_base::unitbuf); return __base; } // [27.4.5.2] adjustfield manipulators /// Calls base.setf(ios_base::internal, ios_base::adjustfield). inline ios_base& internal(ios_base& __base) { __base.setf(ios_base::internal, ios_base::adjustfield); return __base; } /// Calls base.setf(ios_base::left, ios_base::adjustfield). inline ios_base& left(ios_base& __base) { __base.setf(ios_base::left, ios_base::adjustfield); return __base; } /// Calls base.setf(ios_base::right, ios_base::adjustfield). inline ios_base& right(ios_base& __base) { __base.setf(ios_base::right, ios_base::adjustfield); return __base; } // [27.4.5.3] basefield manipulators /// Calls base.setf(ios_base::dec, ios_base::basefield). inline ios_base& dec(ios_base& __base) { __base.setf(ios_base::dec, ios_base::basefield); return __base; } /// Calls base.setf(ios_base::hex, ios_base::basefield). inline ios_base& hex(ios_base& __base) { __base.setf(ios_base::hex, ios_base::basefield); return __base; } /// Calls base.setf(ios_base::oct, ios_base::basefield). inline ios_base& oct(ios_base& __base) { __base.setf(ios_base::oct, ios_base::basefield); return __base; } // [27.4.5.4] floatfield manipulators /// Calls base.setf(ios_base::fixed, ios_base::floatfield). inline ios_base& fixed(ios_base& __base) { __base.setf(ios_base::fixed, ios_base::floatfield); return __base; } /// Calls base.setf(ios_base::scientific, ios_base::floatfield). inline ios_base& scientific(ios_base& __base) { __base.setf(ios_base::scientific, ios_base::floatfield); return __base; } #if __cplusplus >= 201103L // New C++11 floatfield manipulators /// Calls /// base.setf(ios_base::fixed|ios_base::scientific, ios_base::floatfield) inline ios_base& hexfloat(ios_base& __base) { __base.setf(ios_base::fixed | ios_base::scientific, ios_base::floatfield); return __base; } /// Calls @c base.unsetf(ios_base::floatfield) inline ios_base& defaultfloat(ios_base& __base) { __base.unsetf(ios_base::floatfield); return __base; } #endif # 1075 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/ios_base.h" 3 _GLIBCXX_END_NAMESPACE_VERSION } // namespace #endif /* _IOS_BASE_H */ # 1080 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/ios_base.h" 3 # 43 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ios" 2 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 43 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ios" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/streambuf" 1 3 // Stream buffer classes -*- C++ -*- // Copyright (C) 1997-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file include/streambuf * This is a Standard C++ Library header. */ // // ISO C++ 14882: 27.5 Stream buffers // #ifndef _GLIBXX_STREAMBUF #define _GLIBXX_STREAMBUF 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 37 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/streambuf" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 38 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/streambuf" 3 # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/streambuf" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/streambuf" 3 # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/streambuf" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/streambuf" 3 # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/streambuf" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/streambuf" 3 # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/streambuf" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/streambuf" 3 # 43 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/streambuf" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 43 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/streambuf" 3 # 44 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/streambuf" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION template streamsize __copy_streambufs_eof(basic_streambuf<_CharT, _Traits>*, basic_streambuf<_CharT, _Traits>*, bool&); /** * @brief The actual work of input and output (interface). * @ingroup io * * @tparam _CharT Type of character stream. * @tparam _Traits Traits for character type, defaults to * char_traits<_CharT>. * * This is a base class. Derived stream buffers each control a * pair of character sequences: one for input, and one for output. * * Section [27.5.1] of the standard describes the requirements and * behavior of stream buffer classes. That section (three paragraphs) * is reproduced here, for simplicity and accuracy. * * -# Stream buffers can impose various constraints on the sequences * they control. Some constraints are: * - The controlled input sequence can be not readable. * - The controlled output sequence can be not writable. * - The controlled sequences can be associated with the contents of * other representations for character sequences, such as external * files. * - The controlled sequences can support operations @e directly to or * from associated sequences. * - The controlled sequences can impose limitations on how the * program can read characters from a sequence, write characters to * a sequence, put characters back into an input sequence, or alter * the stream position. * . * -# Each sequence is characterized by three pointers which, if non-null, * all point into the same @c charT array object. The array object * represents, at any moment, a (sub)sequence of characters from the * sequence. Operations performed on a sequence alter the values * stored in these pointers, perform reads and writes directly to or * from associated sequences, and alter the stream position and * conversion state as needed to maintain this subsequence relationship. * The three pointers are: * - the beginning pointer, or lowest element address in the * array (called @e xbeg here); * - the next pointer, or next element address that is a * current candidate for reading or writing (called @e xnext here); * - the end pointer, or first element address beyond the * end of the array (called @e xend here). * . * -# The following semantic constraints shall always apply for any set * of three pointers for a sequence, using the pointer names given * immediately above: * - If @e xnext is not a null pointer, then @e xbeg and @e xend shall * also be non-null pointers into the same @c charT array, as * described above; otherwise, @e xbeg and @e xend shall also be null. * - If @e xnext is not a null pointer and @e xnext < @e xend for an * output sequence, then a write position is available. * In this case, @e *xnext shall be assignable as the next element * to write (to put, or to store a character value, into the sequence). * - If @e xnext is not a null pointer and @e xbeg < @e xnext for an * input sequence, then a putback position is available. * In this case, @e xnext[-1] shall have a defined value and is the * next (preceding) element to store a character that is put back * into the input sequence. * - If @e xnext is not a null pointer and @e xnext< @e xend for an * input sequence, then a read position is available. * In this case, @e *xnext shall have a defined value and is the * next element to read (to get, or to obtain a character value, * from the sequence). */ template class basic_streambuf { public: //@{ /** * These are standard types. They permit a standardized way of * referring to names of (or names dependent on) the template * parameters, which are specific to the implementation. */ typedef _CharT char_type; typedef _Traits traits_type; typedef typename traits_type::int_type int_type; typedef typename traits_type::pos_type pos_type; typedef typename traits_type::off_type off_type; //@} //@{ /// This is a non-standard type. typedef basic_streambuf __streambuf_type; //@} friend class basic_ios; friend class basic_istream; friend class basic_ostream; friend class istreambuf_iterator; friend class ostreambuf_iterator; friend streamsize __copy_streambufs_eof<>(basic_streambuf*, basic_streambuf*, bool&); template friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value, _CharT2*>::__type __copy_move_a2(istreambuf_iterator<_CharT2>, istreambuf_iterator<_CharT2>, _CharT2*); template friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value, istreambuf_iterator<_CharT2> >::__type find(istreambuf_iterator<_CharT2>, istreambuf_iterator<_CharT2>, const _CharT2&); template friend basic_istream<_CharT2, _Traits2>& operator>>(basic_istream<_CharT2, _Traits2>&, _CharT2*); template friend basic_istream<_CharT2, _Traits2>& operator>>(basic_istream<_CharT2, _Traits2>&, basic_string<_CharT2, _Traits2, _Alloc>&); template friend basic_istream<_CharT2, _Traits2>& getline(basic_istream<_CharT2, _Traits2>&, basic_string<_CharT2, _Traits2, _Alloc>&, _CharT2); protected: /* * This is based on _IO_FILE, just reordered to be more consistent, * and is intended to be the most minimal abstraction for an * internal buffer. * - get == input == read * - put == output == write */ char_type* _M_in_beg; ///< Start of get area. char_type* _M_in_cur; ///< Current read area. char_type* _M_in_end; ///< End of get area. char_type* _M_out_beg; ///< Start of put area. char_type* _M_out_cur; ///< Current put area. char_type* _M_out_end; ///< End of put area. /// Current locale setting. locale _M_buf_locale; public: /// Destructor deallocates no buffer space. virtual ~basic_streambuf() { } // [27.5.2.2.1] locales /** * @brief Entry point for imbue(). * @param __loc The new locale. * @return The previous locale. * * Calls the derived imbue(__loc). */ locale pubimbue(const locale& __loc) { locale __tmp(this->getloc()); this->imbue(__loc); _M_buf_locale = __loc; return __tmp; } /** * @brief Locale access. * @return The current locale in effect. * * If pubimbue(loc) has been called, then the most recent @c loc * is returned. Otherwise the global locale in effect at the time * of construction is returned. */ locale getloc() const { return _M_buf_locale; } // [27.5.2.2.2] buffer management and positioning //@{ /** * @brief Entry points for derived buffer functions. * * The public versions of @c pubfoo dispatch to the protected * derived @c foo member functions, passing the arguments (if any) * and returning the result unchanged. */ basic_streambuf* pubsetbuf(char_type* __s, streamsize __n) { return this->setbuf(__s, __n); } /** * @brief Alters the stream position. * @param __off Offset. * @param __way Value for ios_base::seekdir. * @param __mode Value for ios_base::openmode. * * Calls virtual seekoff function. */ pos_type pubseekoff(off_type __off, ios_base::seekdir __way, ios_base::openmode __mode = ios_base::in | ios_base::out) { return this->seekoff(__off, __way, __mode); } /** * @brief Alters the stream position. * @param __sp Position * @param __mode Value for ios_base::openmode. * * Calls virtual seekpos function. */ pos_type pubseekpos(pos_type __sp, ios_base::openmode __mode = ios_base::in | ios_base::out) { return this->seekpos(__sp, __mode); } /** * @brief Calls virtual sync function. */ int pubsync() { return this->sync(); } //@} // [27.5.2.2.3] get area /** * @brief Looking ahead into the stream. * @return The number of characters available. * * If a read position is available, returns the number of characters * available for reading before the buffer must be refilled. * Otherwise returns the derived @c showmanyc(). */ streamsize in_avail() { const streamsize __ret = this->egptr() - this->gptr(); return __ret ? __ret : this->showmanyc(); } /** * @brief Getting the next character. * @return The next character, or eof. * * Calls @c sbumpc(), and if that function returns * @c traits::eof(), so does this function. Otherwise, @c sgetc(). */ int_type snextc() { int_type __ret = traits_type::eof(); if (__builtin_expect(!traits_type::eq_int_type(this->sbumpc(), __ret), true)) __ret = this->sgetc(); return __ret; } /** * @brief Getting the next character. * @return The next character, or eof. * * If the input read position is available, returns that character * and increments the read pointer, otherwise calls and returns * @c uflow(). */ int_type sbumpc() { int_type __ret; if (__builtin_expect(this->gptr() < this->egptr(), true)) { __ret = traits_type::to_int_type(*this->gptr()); this->gbump(1); } else __ret = this->uflow(); return __ret; } /** * @brief Getting the next character. * @return The next character, or eof. * * If the input read position is available, returns that character, * otherwise calls and returns @c underflow(). Does not move the * read position after fetching the character. */ int_type sgetc() { int_type __ret; if (__builtin_expect(this->gptr() < this->egptr(), true)) __ret = traits_type::to_int_type(*this->gptr()); else __ret = this->underflow(); return __ret; } /** * @brief Entry point for xsgetn. * @param __s A buffer area. * @param __n A count. * * Returns xsgetn(__s,__n). The effect is to fill @a __s[0] through * @a __s[__n-1] with characters from the input sequence, if possible. */ streamsize sgetn(char_type* __s, streamsize __n) { return this->xsgetn(__s, __n); } // [27.5.2.2.4] putback /** * @brief Pushing characters back into the input stream. * @param __c The character to push back. * @return The previous character, if possible. * * Similar to sungetc(), but @a __c is pushed onto the stream * instead of the previous character. If successful, * the next character fetched from the input stream will be @a * __c. */ int_type sputbackc(char_type __c) { int_type __ret; const bool __testpos = this->eback() < this->gptr(); if (__builtin_expect(!__testpos || !traits_type::eq(__c, this->gptr()[-1]), false)) __ret = this->pbackfail(traits_type::to_int_type(__c)); else { this->gbump(-1); __ret = traits_type::to_int_type(*this->gptr()); } return __ret; } /** * @brief Moving backwards in the input stream. * @return The previous character, if possible. * * If a putback position is available, this function decrements * the input pointer and returns that character. Otherwise, * calls and returns pbackfail(). The effect is to @a unget * the last character @a gotten. */ int_type sungetc() { int_type __ret; if (__builtin_expect(this->eback() < this->gptr(), true)) { this->gbump(-1); __ret = traits_type::to_int_type(*this->gptr()); } else __ret = this->pbackfail(); return __ret; } // [27.5.2.2.5] put area /** * @brief Entry point for all single-character output functions. * @param __c A character to output. * @return @a __c, if possible. * * One of two public output functions. * * If a write position is available for the output sequence (i.e., * the buffer is not full), stores @a __c in that position, increments * the position, and returns @c traits::to_int_type(__c). If a write * position is not available, returns @c overflow(__c). */ int_type sputc(char_type __c) { int_type __ret; if (__builtin_expect(this->pptr() < this->epptr(), true)) { *this->pptr() = __c; this->pbump(1); __ret = traits_type::to_int_type(__c); } else __ret = this->overflow(traits_type::to_int_type(__c)); return __ret; } /** * @brief Entry point for all single-character output functions. * @param __s A buffer read area. * @param __n A count. * * One of two public output functions. * * * Returns xsputn(__s,__n). The effect is to write @a __s[0] through * @a __s[__n-1] to the output sequence, if possible. */ streamsize sputn(const char_type* __s, streamsize __n) { return this->xsputn(__s, __n); } protected: /** * @brief Base constructor. * * Only called from derived constructors, and sets up all the * buffer data to zero, including the pointers described in the * basic_streambuf class description. Note that, as a result, * - the class starts with no read nor write positions available, * - this is not an error */ basic_streambuf() : _M_in_beg(0), _M_in_cur(0), _M_in_end(0), _M_out_beg(0), _M_out_cur(0), _M_out_end(0), _M_buf_locale(locale()) { } // [27.5.2.3.1] get area access //@{ /** * @brief Access to the get area. * * These functions are only available to other protected functions, * including derived classes. * * - eback() returns the beginning pointer for the input sequence * - gptr() returns the next pointer for the input sequence * - egptr() returns the end pointer for the input sequence */ char_type* eback() const { return _M_in_beg; } char_type* gptr() const { return _M_in_cur; } char_type* egptr() const { return _M_in_end; } //@} /** * @brief Moving the read position. * @param __n The delta by which to move. * * This just advances the read position without returning any data. */ void gbump(int __n) { _M_in_cur += __n; } /** * @brief Setting the three read area pointers. * @param __gbeg A pointer. * @param __gnext A pointer. * @param __gend A pointer. * @post @a __gbeg == @c eback(), @a __gnext == @c gptr(), and * @a __gend == @c egptr() */ void setg(char_type* __gbeg, char_type* __gnext, char_type* __gend) { _M_in_beg = __gbeg; _M_in_cur = __gnext; _M_in_end = __gend; } // [27.5.2.3.2] put area access //@{ /** * @brief Access to the put area. * * These functions are only available to other protected functions, * including derived classes. * * - pbase() returns the beginning pointer for the output sequence * - pptr() returns the next pointer for the output sequence * - epptr() returns the end pointer for the output sequence */ char_type* pbase() const { return _M_out_beg; } char_type* pptr() const { return _M_out_cur; } char_type* epptr() const { return _M_out_end; } //@} /** * @brief Moving the write position. * @param __n The delta by which to move. * * This just advances the write position without returning any data. */ void pbump(int __n) { _M_out_cur += __n; } /** * @brief Setting the three write area pointers. * @param __pbeg A pointer. * @param __pend A pointer. * @post @a __pbeg == @c pbase(), @a __pbeg == @c pptr(), and * @a __pend == @c epptr() */ void setp(char_type* __pbeg, char_type* __pend) { _M_out_beg = _M_out_cur = __pbeg; _M_out_end = __pend; } // [27.5.2.4] virtual functions // [27.5.2.4.1] locales /** * @brief Changes translations. * @param __loc A new locale. * * Translations done during I/O which depend on the current * locale are changed by this call. The standard adds, * Between invocations of this function a class derived * from streambuf can safely cache results of calls to locale * functions and to members of facets so obtained. * * @note Base class version does nothing. */ virtual void imbue(const locale& __loc) { } // [27.5.2.4.2] buffer management and positioning /** * @brief Manipulates the buffer. * * Each derived class provides its own appropriate behavior. See * the next-to-last paragraph of * https://gcc.gnu.org/onlinedocs/libstdc++/manual/streambufs.html#io.streambuf.buffering * for more on this function. * * @note Base class version does nothing, returns @c this. */ virtual basic_streambuf* setbuf(char_type*, streamsize) { return this; } /** * @brief Alters the stream positions. * * Each derived class provides its own appropriate behavior. * @note Base class version does nothing, returns a @c pos_type * that represents an invalid stream position. */ virtual pos_type seekoff(off_type, ios_base::seekdir, ios_base::openmode /*__mode*/ = ios_base::in | ios_base::out) { return pos_type(off_type(-1)); } /** * @brief Alters the stream positions. * * Each derived class provides its own appropriate behavior. * @note Base class version does nothing, returns a @c pos_type * that represents an invalid stream position. */ virtual pos_type seekpos(pos_type, ios_base::openmode /*__mode*/ = ios_base::in | ios_base::out) { return pos_type(off_type(-1)); } /** * @brief Synchronizes the buffer arrays with the controlled sequences. * @return -1 on failure. * * Each derived class provides its own appropriate behavior, * including the definition of @a failure. * @note Base class version does nothing, returns zero. */ virtual int sync() { return 0; } // [27.5.2.4.3] get area /** * @brief Investigating the data available. * @return An estimate of the number of characters available in the * input sequence, or -1. * * If it returns a positive value, then successive calls to * @c underflow() will not return @c traits::eof() until at * least that number of characters have been supplied. If @c * showmanyc() returns -1, then calls to @c underflow() or @c * uflow() will fail. [27.5.2.4.3]/1 * * @note Base class version does nothing, returns zero. * @note The standard adds that the intention is not only that the * calls [to underflow or uflow] will not return @c eof() but * that they will return immediately. * @note The standard adds that the morphemes of @c showmanyc are * @b es-how-many-see, not @b show-manic. */ virtual streamsize showmanyc() { return 0; } /** * @brief Multiple character extraction. * @param __s A buffer area. * @param __n Maximum number of characters to assign. * @return The number of characters assigned. * * Fills @a __s[0] through @a __s[__n-1] with characters from the input * sequence, as if by @c sbumpc(). Stops when either @a __n characters * have been copied, or when @c traits::eof() would be copied. * * It is expected that derived classes provide a more efficient * implementation by overriding this definition. */ virtual streamsize xsgetn(char_type* __s, streamsize __n); /** * @brief Fetches more data from the controlled sequence. * @return The first character from the pending sequence. * * Informally, this function is called when the input buffer is * exhausted (or does not exist, as buffering need not actually be * done). If a buffer exists, it is @a refilled. In either case, the * next available character is returned, or @c traits::eof() to * indicate a null pending sequence. * * For a formal definition of the pending sequence, see a good text * such as Langer & Kreft, or [27.5.2.4.3]/7-14. * * A functioning input streambuf can be created by overriding only * this function (no buffer area will be used). For an example, see * https://gcc.gnu.org/onlinedocs/libstdc++/manual/streambufs.html * * @note Base class version does nothing, returns eof(). */ virtual int_type underflow() { return traits_type::eof(); } /** * @brief Fetches more data from the controlled sequence. * @return The first character from the pending sequence. * * Informally, this function does the same thing as @c underflow(), * and in fact is required to call that function. It also returns * the new character, like @c underflow() does. However, this * function also moves the read position forward by one. */ virtual int_type uflow() { int_type __ret = traits_type::eof(); const bool __testeof = traits_type::eq_int_type(this->underflow(), __ret); if (!__testeof) { __ret = traits_type::to_int_type(*this->gptr()); this->gbump(1); } return __ret; } // [27.5.2.4.4] putback /** * @brief Tries to back up the input sequence. * @param __c The character to be inserted back into the sequence. * @return eof() on failure, some other value on success * @post The constraints of @c gptr(), @c eback(), and @c pptr() * are the same as for @c underflow(). * * @note Base class version does nothing, returns eof(). */ virtual int_type pbackfail(int_type __c = traits_type::eof()) { return traits_type::eof(); } // Put area: /** * @brief Multiple character insertion. * @param __s A buffer area. * @param __n Maximum number of characters to write. * @return The number of characters written. * * Writes @a __s[0] through @a __s[__n-1] to the output sequence, as if * by @c sputc(). Stops when either @a n characters have been * copied, or when @c sputc() would return @c traits::eof(). * * It is expected that derived classes provide a more efficient * implementation by overriding this definition. */ virtual streamsize xsputn(const char_type* __s, streamsize __n); /** * @brief Consumes data from the buffer; writes to the * controlled sequence. * @param __c An additional character to consume. * @return eof() to indicate failure, something else (usually * @a __c, or not_eof()) * * Informally, this function is called when the output buffer * is full (or does not exist, as buffering need not actually * be done). If a buffer exists, it is @a consumed, with * some effect on the controlled sequence. * (Typically, the buffer is written out to the sequence * verbatim.) In either case, the character @a c is also * written out, if @a __c is not @c eof(). * * For a formal definition of this function, see a good text * such as Langer & Kreft, or [27.5.2.4.5]/3-7. * * A functioning output streambuf can be created by overriding only * this function (no buffer area will be used). * * @note Base class version does nothing, returns eof(). */ virtual int_type overflow(int_type __c = traits_type::eof()) { return traits_type::eof(); } #if _GLIBCXX_USE_DEPRECATED // Annex D.6 public: /** * @brief Tosses a character. * * Advances the read pointer, ignoring the character that would have * been read. * * See http://gcc.gnu.org/ml/libstdc++/2002-05/msg00168.html */ void stossc() { if (this->gptr() < this->egptr()) this->gbump(1); else this->uflow(); } #endif # 791 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/streambuf" 3 // Also used by specializations for char and wchar_t in src. void __safe_gbump(streamsize __n) { _M_in_cur += __n; } void __safe_pbump(streamsize __n) { _M_out_cur += __n; } #if __cplusplus < 201103L private: #else # 802 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/streambuf" 3 protected: #endif # 804 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/streambuf" 3 basic_streambuf(const basic_streambuf&); basic_streambuf& operator=(const basic_streambuf&); #if __cplusplus >= 201103L void swap(basic_streambuf& __sb) { std::swap(_M_in_beg, __sb._M_in_beg); std::swap(_M_in_cur, __sb._M_in_cur); std::swap(_M_in_end, __sb._M_in_end); std::swap(_M_out_beg, __sb._M_out_beg); std::swap(_M_out_cur, __sb._M_out_cur); std::swap(_M_out_end, __sb._M_out_end); std::swap(_M_buf_locale, __sb._M_buf_locale); } #endif # 822 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/streambuf" 3 }; #if __cplusplus >= 201103L template std::basic_streambuf<_CharT, _Traits>:: basic_streambuf(const basic_streambuf&) = default; template std::basic_streambuf<_CharT, _Traits>& std::basic_streambuf<_CharT, _Traits>:: operator=(const basic_streambuf&) = default; #endif # 834 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/streambuf" 3 // Explicit specialization declarations, defined in src/streambuf.cc. template<> streamsize __copy_streambufs_eof(basic_streambuf* __sbin, basic_streambuf* __sbout, bool& __ineof); #ifdef _GLIBCXX_USE_WCHAR_T template<> streamsize __copy_streambufs_eof(basic_streambuf* __sbin, basic_streambuf* __sbout, bool& __ineof); #endif # 846 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/streambuf" 3 _GLIBCXX_END_NAMESPACE_VERSION } // namespace #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 850 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/streambuf" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/streambuf.tcc" 1 3 // Stream buffer classes -*- C++ -*- // Copyright (C) 1997-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file bits/streambuf.tcc * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{streambuf} */ // // ISO C++ 14882: 27.5 Stream buffers // #ifndef _STREAMBUF_TCC #define _STREAMBUF_TCC 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 38 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/streambuf.tcc" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION template streamsize basic_streambuf<_CharT, _Traits>:: xsgetn(char_type* __s, streamsize __n) { streamsize __ret = 0; while (__ret < __n) { const streamsize __buf_len = this->egptr() - this->gptr(); if (__buf_len) { const streamsize __remaining = __n - __ret; const streamsize __len = std::min(__buf_len, __remaining); traits_type::copy(__s, this->gptr(), __len); __ret += __len; __s += __len; this->__safe_gbump(__len); } if (__ret < __n) { const int_type __c = this->uflow(); if (!traits_type::eq_int_type(__c, traits_type::eof())) { traits_type::assign(*__s++, traits_type::to_char_type(__c)); ++__ret; } else break; } } return __ret; } template streamsize basic_streambuf<_CharT, _Traits>:: xsputn(const char_type* __s, streamsize __n) { streamsize __ret = 0; while (__ret < __n) { const streamsize __buf_len = this->epptr() - this->pptr(); if (__buf_len) { const streamsize __remaining = __n - __ret; const streamsize __len = std::min(__buf_len, __remaining); traits_type::copy(this->pptr(), __s, __len); __ret += __len; __s += __len; this->__safe_pbump(__len); } if (__ret < __n) { int_type __c = this->overflow(traits_type::to_int_type(*__s)); if (!traits_type::eq_int_type(__c, traits_type::eof())) { ++__ret; ++__s; } else break; } } return __ret; } // Conceivably, this could be used to implement buffer-to-buffer // copies, if this was ever desired in an un-ambiguous way by the // standard. template streamsize __copy_streambufs_eof(basic_streambuf<_CharT, _Traits>* __sbin, basic_streambuf<_CharT, _Traits>* __sbout, bool& __ineof) { streamsize __ret = 0; __ineof = true; typename _Traits::int_type __c = __sbin->sgetc(); while (!_Traits::eq_int_type(__c, _Traits::eof())) { __c = __sbout->sputc(_Traits::to_char_type(__c)); if (_Traits::eq_int_type(__c, _Traits::eof())) { __ineof = false; break; } ++__ret; __c = __sbin->snextc(); } return __ret; } template inline streamsize __copy_streambufs(basic_streambuf<_CharT, _Traits>* __sbin, basic_streambuf<_CharT, _Traits>* __sbout) { bool __ineof; return __copy_streambufs_eof(__sbin, __sbout, __ineof); } // Inhibit implicit instantiations for required instantiations, // which are defined via explicit instantiations elsewhere. #if _GLIBCXX_EXTERN_TEMPLATE extern template class basic_streambuf; extern template streamsize __copy_streambufs(basic_streambuf*, basic_streambuf*); extern template streamsize __copy_streambufs_eof(basic_streambuf*, basic_streambuf*, bool&); #ifdef _GLIBCXX_USE_WCHAR_T extern template class basic_streambuf; extern template streamsize __copy_streambufs(basic_streambuf*, basic_streambuf*); extern template streamsize __copy_streambufs_eof(basic_streambuf*, basic_streambuf*, bool&); #endif # 170 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/streambuf.tcc" 3 #endif # 171 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/streambuf.tcc" 3 _GLIBCXX_END_NAMESPACE_VERSION } // namespace std #endif # 176 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/streambuf.tcc" 3 # 851 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/streambuf" 2 3 #endif /* _GLIBCXX_STREAMBUF */ # 853 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/streambuf" 3 # 44 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ios" 2 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 44 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ios" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_ios.h" 1 3 // Iostreams base classes -*- C++ -*- // Copyright (C) 1997-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file bits/basic_ios.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{ios} */ #ifndef _BASIC_IOS_H #define _BASIC_IOS_H 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 34 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_ios.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 35 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_ios.h" 3 # 36 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_ios.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 36 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_ios.h" 3 # 37 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_ios.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 37 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_ios.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets.h" 1 3 // Locale support -*- C++ -*- // Copyright (C) 1997-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file bits/locale_facets.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{locale} */ // // ISO C++ 14882: 22.1 Locales // #ifndef _LOCALE_FACETS_H #define _LOCALE_FACETS_H 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 38 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets.h" 3 #if 0 /* expanded by -frewrite-includes */ #include // For wctype_t #endif /* expanded by -frewrite-includes */ # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwctype" 1 3 // -*- C++ -*- forwarding header. // Copyright (C) 1997-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file include/cwctype * This is a Standard C++ Library file. You should @c \#include this file * in your programs, rather than any of the @a *.h implementation files. * * This is the C++ version of the Standard C Library header @c wctype.h, * and its contents are (mostly) the same as that header, but are all * contained in the namespace @c std (except for names which are defined * as macros in C). */ // // ISO C++ 14882: // #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwctype" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwctype" 3 # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwctype" 3 #if _GLIBCXX_HAVE_WCTYPE_H #if __GLIBC__ == 2 && __GLIBC_MINOR__ < 10 // Work around glibc BZ 9694 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 47 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwctype" 3 # 48 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwctype" 3 #endif # 49 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwctype" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 50 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwctype" 3 # 1 "/usr/include/wctype.h" 1 3 4 /* Copyright (C) 1996-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard: 7.25 * Wide character classification and mapping utilities */ #ifndef _WCTYPE_H #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 25 "/usr/include/wctype.h" 3 4 # 26 "/usr/include/wctype.h" 3 4 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 26 "/usr/include/wctype.h" 3 4 # 27 "/usr/include/wctype.h" 3 4 #ifndef __need_iswxxx # define _WCTYPE_H 1 /* Get wint_t from . */ # define __need_wint_t #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 33 "/usr/include/wctype.h" 3 4 # 1 "/usr/include/wchar.h" 1 3 4 /* Copyright (C) 1995-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard: 7.24 * Extended multibyte and wide character utilities */ #ifndef _WCHAR_H #if !defined __need_mbstate_t && !defined __need_wint_t # define _WCHAR_H 1 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 27 "/usr/include/wchar.h" 3 4 # 28 "/usr/include/wchar.h" 3 4 #endif # 29 "/usr/include/wchar.h" 3 4 #ifdef _WCHAR_H /* Get FILE definition. */ # define __need___FILE # if defined __USE_UNIX98 || defined __USE_XOPEN2K # define __need_FILE # endif # 36 "/usr/include/wchar.h" 3 4 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 36 "/usr/include/wchar.h" 3 4 # 37 "/usr/include/wchar.h" 3 4 /* Get va_list definition. */ # define __need___va_list #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 39 "/usr/include/wchar.h" 3 4 # 40 "/usr/include/wchar.h" 3 4 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 41 "/usr/include/wchar.h" 3 4 # 42 "/usr/include/wchar.h" 3 4 /* Get size_t, wchar_t, wint_t and NULL from . */ # define __need_size_t # define __need_wchar_t # define __need_NULL #endif # 48 "/usr/include/wchar.h" 3 4 #if defined _WCHAR_H || defined __need_wint_t || !defined __WINT_TYPE__ # undef __need_wint_t # define __need_wint_t #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 51 "/usr/include/wchar.h" 3 4 # 52 "/usr/include/wchar.h" 3 4 /* We try to get wint_t from , but not all GCC versions define it there. So define it ourselves if it remains undefined. */ # ifndef _WINT_T /* Integral type unchanged by default argument promotions that can hold any value corresponding to members of the extended character set, as well as at least one value that does not correspond to any member of the extended character set. */ # define _WINT_T typedef unsigned int wint_t; # else # 63 "/usr/include/wchar.h" 3 4 /* Work around problems with the file which doesn't put wint_t in the std namespace. */ # if defined __cplusplus && defined _GLIBCPP_USE_NAMESPACES \ && defined __WINT_TYPE__ __BEGIN_NAMESPACE_STD typedef __WINT_TYPE__ wint_t; __END_NAMESPACE_STD # endif # 71 "/usr/include/wchar.h" 3 4 # endif # 72 "/usr/include/wchar.h" 3 4 /* Tell the caller that we provide correct C++ prototypes. */ # if defined __cplusplus && __GNUC_PREREQ (4, 4) # define __CORRECT_ISO_CPP_WCHAR_H_PROTO # endif # 77 "/usr/include/wchar.h" 3 4 #endif # 78 "/usr/include/wchar.h" 3 4 #if (defined _WCHAR_H || defined __need_mbstate_t) && !defined ____mbstate_t_defined # define ____mbstate_t_defined 1 /* Conversion state information. */ typedef struct { int __count; union { # ifdef __WINT_TYPE__ __WINT_TYPE__ __wch; # else # 90 "/usr/include/wchar.h" 3 4 wint_t __wch; # endif # 92 "/usr/include/wchar.h" 3 4 char __wchb[4]; } __value; /* Value so far. */ } __mbstate_t; #endif # 96 "/usr/include/wchar.h" 3 4 #undef __need_mbstate_t /* The rest of the file is only used if used if __need_mbstate_t is not defined. */ #ifdef _WCHAR_H # ifndef __mbstate_t_defined __BEGIN_NAMESPACE_C99 /* Public type. */ typedef __mbstate_t mbstate_t; __END_NAMESPACE_C99 # define __mbstate_t_defined 1 # endif # 110 "/usr/include/wchar.h" 3 4 #ifdef __USE_GNU __USING_NAMESPACE_C99(mbstate_t) #endif # 114 "/usr/include/wchar.h" 3 4 #ifndef WCHAR_MIN /* These constants might also be defined in . */ # define WCHAR_MIN __WCHAR_MIN # define WCHAR_MAX __WCHAR_MAX #endif # 120 "/usr/include/wchar.h" 3 4 #ifndef WEOF # define WEOF (0xffffffffu) #endif # 124 "/usr/include/wchar.h" 3 4 /* For XPG4 compliance we have to define the stuff from here as well. */ #if defined __USE_XOPEN && !defined __USE_UNIX98 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 128 "/usr/include/wchar.h" 3 4 # 129 "/usr/include/wchar.h" 3 4 #endif # 130 "/usr/include/wchar.h" 3 4 __BEGIN_DECLS __BEGIN_NAMESPACE_STD /* This incomplete type is defined in but needed here because of `wcsftime'. */ struct tm; __END_NAMESPACE_STD /* XXX We have to clean this up at some point. Since tm is in the std namespace but wcsftime is in __c99 the type wouldn't be found without inserting it in the global namespace. */ __USING_NAMESPACE_STD(tm) __BEGIN_NAMESPACE_STD /* Copy SRC to DEST. */ extern wchar_t *wcscpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src) __THROW; /* Copy no more than N wide-characters of SRC to DEST. */ extern wchar_t *wcsncpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src, size_t __n) __THROW; /* Append SRC onto DEST. */ extern wchar_t *wcscat (wchar_t *__restrict __dest, const wchar_t *__restrict __src) __THROW; /* Append no more than N wide-characters of SRC onto DEST. */ extern wchar_t *wcsncat (wchar_t *__restrict __dest, const wchar_t *__restrict __src, size_t __n) __THROW; /* Compare S1 and S2. */ extern int wcscmp (const wchar_t *__s1, const wchar_t *__s2) __THROW __attribute_pure__; /* Compare N wide-characters of S1 and S2. */ extern int wcsncmp (const wchar_t *__s1, const wchar_t *__s2, size_t __n) __THROW __attribute_pure__; __END_NAMESPACE_STD #ifdef __USE_XOPEN2K8 /* Compare S1 and S2, ignoring case. */ extern int wcscasecmp (const wchar_t *__s1, const wchar_t *__s2) __THROW; /* Compare no more than N chars of S1 and S2, ignoring case. */ extern int wcsncasecmp (const wchar_t *__s1, const wchar_t *__s2, size_t __n) __THROW; /* Similar to the two functions above but take the information from the provided locale and not the global locale. */ #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 180 "/usr/include/wchar.h" 3 4 # 181 "/usr/include/wchar.h" 3 4 extern int wcscasecmp_l (const wchar_t *__s1, const wchar_t *__s2, __locale_t __loc) __THROW; extern int wcsncasecmp_l (const wchar_t *__s1, const wchar_t *__s2, size_t __n, __locale_t __loc) __THROW; #endif # 188 "/usr/include/wchar.h" 3 4 __BEGIN_NAMESPACE_STD /* Compare S1 and S2, both interpreted as appropriate to the LC_COLLATE category of the current locale. */ extern int wcscoll (const wchar_t *__s1, const wchar_t *__s2) __THROW; /* Transform S2 into array pointed to by S1 such that if wcscmp is applied to two transformed strings the result is the as applying `wcscoll' to the original strings. */ extern size_t wcsxfrm (wchar_t *__restrict __s1, const wchar_t *__restrict __s2, size_t __n) __THROW; __END_NAMESPACE_STD #ifdef __USE_XOPEN2K8 /* Similar to the two functions above but take the information from the provided locale and not the global locale. */ /* Compare S1 and S2, both interpreted as appropriate to the LC_COLLATE category of the given locale. */ extern int wcscoll_l (const wchar_t *__s1, const wchar_t *__s2, __locale_t __loc) __THROW; /* Transform S2 into array pointed to by S1 such that if wcscmp is applied to two transformed strings the result is the as applying `wcscoll' to the original strings. */ extern size_t wcsxfrm_l (wchar_t *__s1, const wchar_t *__s2, size_t __n, __locale_t __loc) __THROW; /* Duplicate S, returning an identical malloc'd string. */ extern wchar_t *wcsdup (const wchar_t *__s) __THROW __attribute_malloc__; #endif # 218 "/usr/include/wchar.h" 3 4 __BEGIN_NAMESPACE_STD /* Find the first occurrence of WC in WCS. */ #ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO extern "C++" wchar_t *wcschr (wchar_t *__wcs, wchar_t __wc) __THROW __asm ("wcschr") __attribute_pure__; extern "C++" const wchar_t *wcschr (const wchar_t *__wcs, wchar_t __wc) __THROW __asm ("wcschr") __attribute_pure__; #else # 227 "/usr/include/wchar.h" 3 4 extern wchar_t *wcschr (const wchar_t *__wcs, wchar_t __wc) __THROW __attribute_pure__; #endif # 230 "/usr/include/wchar.h" 3 4 /* Find the last occurrence of WC in WCS. */ #ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO extern "C++" wchar_t *wcsrchr (wchar_t *__wcs, wchar_t __wc) __THROW __asm ("wcsrchr") __attribute_pure__; extern "C++" const wchar_t *wcsrchr (const wchar_t *__wcs, wchar_t __wc) __THROW __asm ("wcsrchr") __attribute_pure__; #else # 237 "/usr/include/wchar.h" 3 4 extern wchar_t *wcsrchr (const wchar_t *__wcs, wchar_t __wc) __THROW __attribute_pure__; #endif # 240 "/usr/include/wchar.h" 3 4 __END_NAMESPACE_STD #ifdef __USE_GNU /* This function is similar to `wcschr'. But it returns a pointer to the closing NUL wide character in case C is not found in S. */ extern wchar_t *wcschrnul (const wchar_t *__s, wchar_t __wc) __THROW __attribute_pure__; #endif # 248 "/usr/include/wchar.h" 3 4 __BEGIN_NAMESPACE_STD /* Return the length of the initial segmet of WCS which consists entirely of wide characters not in REJECT. */ extern size_t wcscspn (const wchar_t *__wcs, const wchar_t *__reject) __THROW __attribute_pure__; /* Return the length of the initial segmet of WCS which consists entirely of wide characters in ACCEPT. */ extern size_t wcsspn (const wchar_t *__wcs, const wchar_t *__accept) __THROW __attribute_pure__; /* Find the first occurrence in WCS of any character in ACCEPT. */ #ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO extern "C++" wchar_t *wcspbrk (wchar_t *__wcs, const wchar_t *__accept) __THROW __asm ("wcspbrk") __attribute_pure__; extern "C++" const wchar_t *wcspbrk (const wchar_t *__wcs, const wchar_t *__accept) __THROW __asm ("wcspbrk") __attribute_pure__; #else # 266 "/usr/include/wchar.h" 3 4 extern wchar_t *wcspbrk (const wchar_t *__wcs, const wchar_t *__accept) __THROW __attribute_pure__; #endif # 269 "/usr/include/wchar.h" 3 4 /* Find the first occurrence of NEEDLE in HAYSTACK. */ #ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO extern "C++" wchar_t *wcsstr (wchar_t *__haystack, const wchar_t *__needle) __THROW __asm ("wcsstr") __attribute_pure__; extern "C++" const wchar_t *wcsstr (const wchar_t *__haystack, const wchar_t *__needle) __THROW __asm ("wcsstr") __attribute_pure__; #else # 277 "/usr/include/wchar.h" 3 4 extern wchar_t *wcsstr (const wchar_t *__haystack, const wchar_t *__needle) __THROW __attribute_pure__; #endif # 280 "/usr/include/wchar.h" 3 4 /* Divide WCS into tokens separated by characters in DELIM. */ extern wchar_t *wcstok (wchar_t *__restrict __s, const wchar_t *__restrict __delim, wchar_t **__restrict __ptr) __THROW; /* Return the number of wide characters in S. */ extern size_t wcslen (const wchar_t *__s) __THROW __attribute_pure__; __END_NAMESPACE_STD #ifdef __USE_XOPEN /* Another name for `wcsstr' from XPG4. */ # ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO extern "C++" wchar_t *wcswcs (wchar_t *__haystack, const wchar_t *__needle) __THROW __asm ("wcswcs") __attribute_pure__; extern "C++" const wchar_t *wcswcs (const wchar_t *__haystack, const wchar_t *__needle) __THROW __asm ("wcswcs") __attribute_pure__; # else # 299 "/usr/include/wchar.h" 3 4 extern wchar_t *wcswcs (const wchar_t *__haystack, const wchar_t *__needle) __THROW __attribute_pure__; # endif # 302 "/usr/include/wchar.h" 3 4 #endif # 303 "/usr/include/wchar.h" 3 4 #ifdef __USE_XOPEN2K8 /* Return the number of wide characters in S, but at most MAXLEN. */ extern size_t wcsnlen (const wchar_t *__s, size_t __maxlen) __THROW __attribute_pure__; #endif # 309 "/usr/include/wchar.h" 3 4 __BEGIN_NAMESPACE_STD /* Search N wide characters of S for C. */ #ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO extern "C++" wchar_t *wmemchr (wchar_t *__s, wchar_t __c, size_t __n) __THROW __asm ("wmemchr") __attribute_pure__; extern "C++" const wchar_t *wmemchr (const wchar_t *__s, wchar_t __c, size_t __n) __THROW __asm ("wmemchr") __attribute_pure__; #else # 320 "/usr/include/wchar.h" 3 4 extern wchar_t *wmemchr (const wchar_t *__s, wchar_t __c, size_t __n) __THROW __attribute_pure__; #endif # 323 "/usr/include/wchar.h" 3 4 /* Compare N wide characters of S1 and S2. */ extern int wmemcmp (const wchar_t *__s1, const wchar_t *__s2, size_t __n) __THROW __attribute_pure__; /* Copy N wide characters of SRC to DEST. */ extern wchar_t *wmemcpy (wchar_t *__restrict __s1, const wchar_t *__restrict __s2, size_t __n) __THROW; /* Copy N wide characters of SRC to DEST, guaranteeing correct behavior for overlapping strings. */ extern wchar_t *wmemmove (wchar_t *__s1, const wchar_t *__s2, size_t __n) __THROW; /* Set N wide characters of S to C. */ extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) __THROW; __END_NAMESPACE_STD #ifdef __USE_GNU /* Copy N wide characters of SRC to DEST and return pointer to following wide character. */ extern wchar_t *wmempcpy (wchar_t *__restrict __s1, const wchar_t *__restrict __s2, size_t __n) __THROW; #endif # 348 "/usr/include/wchar.h" 3 4 __BEGIN_NAMESPACE_STD /* Determine whether C constitutes a valid (one-byte) multibyte character. */ extern wint_t btowc (int __c) __THROW; /* Determine whether C corresponds to a member of the extended character set whose multibyte representation is a single byte. */ extern int wctob (wint_t __c) __THROW; /* Determine whether PS points to an object representing the initial state. */ extern int mbsinit (const mbstate_t *__ps) __THROW __attribute_pure__; /* Write wide character representation of multibyte character pointed to by S to PWC. */ extern size_t mbrtowc (wchar_t *__restrict __pwc, const char *__restrict __s, size_t __n, mbstate_t *__restrict __p) __THROW; /* Write multibyte representation of wide character WC to S. */ extern size_t wcrtomb (char *__restrict __s, wchar_t __wc, mbstate_t *__restrict __ps) __THROW; /* Return number of bytes in multibyte character pointed to by S. */ extern size_t __mbrlen (const char *__restrict __s, size_t __n, mbstate_t *__restrict __ps) __THROW; extern size_t mbrlen (const char *__restrict __s, size_t __n, mbstate_t *__restrict __ps) __THROW; __END_NAMESPACE_STD #ifdef __USE_EXTERN_INLINES /* Define inline function as optimization. */ /* We can use the BTOWC and WCTOB optimizations since we know that all locales must use ASCII encoding for the values in the ASCII range and because the wchar_t encoding is always ISO 10646. */ extern wint_t __btowc_alias (int __c) __asm ("btowc"); __extern_inline wint_t __NTH (btowc (int __c)) { return (__builtin_constant_p (__c) && __c >= '\0' && __c <= '\x7f' ? (wint_t) __c : __btowc_alias (__c)); } extern int __wctob_alias (wint_t __c) __asm ("wctob"); __extern_inline int __NTH (wctob (wint_t __wc)) { return (__builtin_constant_p (__wc) && __wc >= L'\0' && __wc <= L'\x7f' ? (int) __wc : __wctob_alias (__wc)); } __extern_inline size_t __NTH (mbrlen (const char *__restrict __s, size_t __n, mbstate_t *__restrict __ps)) { return (__ps != NULL ? mbrtowc (NULL, __s, __n, __ps) : __mbrlen (__s, __n, NULL)); } #endif # 404 "/usr/include/wchar.h" 3 4 __BEGIN_NAMESPACE_STD /* Write wide character representation of multibyte character string SRC to DST. */ extern size_t mbsrtowcs (wchar_t *__restrict __dst, const char **__restrict __src, size_t __len, mbstate_t *__restrict __ps) __THROW; /* Write multibyte character representation of wide character string SRC to DST. */ extern size_t wcsrtombs (char *__restrict __dst, const wchar_t **__restrict __src, size_t __len, mbstate_t *__restrict __ps) __THROW; __END_NAMESPACE_STD #ifdef __USE_XOPEN2K8 /* Write wide character representation of at most NMC bytes of the multibyte character string SRC to DST. */ extern size_t mbsnrtowcs (wchar_t *__restrict __dst, const char **__restrict __src, size_t __nmc, size_t __len, mbstate_t *__restrict __ps) __THROW; /* Write multibyte character representation of at most NWC characters from the wide character string SRC to DST. */ extern size_t wcsnrtombs (char *__restrict __dst, const wchar_t **__restrict __src, size_t __nwc, size_t __len, mbstate_t *__restrict __ps) __THROW; #endif /* use POSIX 2008 */ # 434 "/usr/include/wchar.h" 3 4 /* The following functions are extensions found in X/Open CAE. */ #ifdef __USE_XOPEN /* Determine number of column positions required for C. */ extern int wcwidth (wchar_t __c) __THROW; /* Determine number of column positions required for first N wide characters (or fewer if S ends before this) in S. */ extern int wcswidth (const wchar_t *__s, size_t __n) __THROW; #endif /* Use X/Open. */ # 445 "/usr/include/wchar.h" 3 4 __BEGIN_NAMESPACE_STD /* Convert initial portion of the wide string NPTR to `double' representation. */ extern double wcstod (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr) __THROW; __END_NAMESPACE_STD #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Likewise for `float' and `long double' sizes of floating-point numbers. */ extern float wcstof (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr) __THROW; extern long double wcstold (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr) __THROW; __END_NAMESPACE_C99 #endif /* C99 */ # 463 "/usr/include/wchar.h" 3 4 __BEGIN_NAMESPACE_STD /* Convert initial portion of wide string NPTR to `long int' representation. */ extern long int wcstol (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base) __THROW; /* Convert initial portion of wide string NPTR to `unsigned long int' representation. */ extern unsigned long int wcstoul (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base) __THROW; __END_NAMESPACE_STD #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Convert initial portion of wide string NPTR to `long long int' representation. */ __extension__ extern long long int wcstoll (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base) __THROW; /* Convert initial portion of wide string NPTR to `unsigned long long int' representation. */ __extension__ extern unsigned long long int wcstoull (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base) __THROW; __END_NAMESPACE_C99 #endif /* ISO C99. */ # 495 "/usr/include/wchar.h" 3 4 #ifdef __USE_GNU /* Convert initial portion of wide string NPTR to `long long int' representation. */ __extension__ extern long long int wcstoq (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base) __THROW; /* Convert initial portion of wide string NPTR to `unsigned long long int' representation. */ __extension__ extern unsigned long long int wcstouq (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base) __THROW; #endif /* Use GNU. */ # 511 "/usr/include/wchar.h" 3 4 #ifdef __USE_GNU /* The concept of one static locale per category is not very well thought out. Many applications will need to process its data using information from several different locales. Another application is the implementation of the internationalization handling in the upcoming ISO C++ standard library. To support this another set of the functions using locale data exist which have an additional argument. Attention: all these functions are *not* standardized in any form. This is a proof-of-concept implementation. */ /* Structure for reentrant locale using functions. This is an (almost) opaque type for the user level programs. */ #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 526 "/usr/include/wchar.h" 3 4 # 527 "/usr/include/wchar.h" 3 4 /* Special versions of the functions above which take the locale to use as an additional parameter. */ extern long int wcstol_l (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base, __locale_t __loc) __THROW; extern unsigned long int wcstoul_l (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base, __locale_t __loc) __THROW; __extension__ extern long long int wcstoll_l (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base, __locale_t __loc) __THROW; __extension__ extern unsigned long long int wcstoull_l (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base, __locale_t __loc) __THROW; extern double wcstod_l (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, __locale_t __loc) __THROW; extern float wcstof_l (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, __locale_t __loc) __THROW; extern long double wcstold_l (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, __locale_t __loc) __THROW; #endif /* use GNU */ # 561 "/usr/include/wchar.h" 3 4 #ifdef __USE_XOPEN2K8 /* Copy SRC to DEST, returning the address of the terminating L'\0' in DEST. */ extern wchar_t *wcpcpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src) __THROW; /* Copy no more than N characters of SRC to DEST, returning the address of the last character written into DEST. */ extern wchar_t *wcpncpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src, size_t __n) __THROW; /* Wide character I/O functions. */ /* Like OPEN_MEMSTREAM, but the stream is wide oriented and produces a wide character string. */ extern __FILE *open_wmemstream (wchar_t **__bufloc, size_t *__sizeloc) __THROW; #endif # 582 "/usr/include/wchar.h" 3 4 #if defined __USE_ISOC95 || defined __USE_UNIX98 __BEGIN_NAMESPACE_STD /* Select orientation for stream. */ extern int fwide (__FILE *__fp, int __mode) __THROW; /* Write formatted output to STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fwprintf (__FILE *__restrict __stream, const wchar_t *__restrict __format, ...) /* __attribute__ ((__format__ (__wprintf__, 2, 3))) */; /* Write formatted output to stdout. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int wprintf (const wchar_t *__restrict __format, ...) /* __attribute__ ((__format__ (__wprintf__, 1, 2))) */; /* Write formatted output of at most N characters to S. */ extern int swprintf (wchar_t *__restrict __s, size_t __n, const wchar_t *__restrict __format, ...) __THROW /* __attribute__ ((__format__ (__wprintf__, 3, 4))) */; /* Write formatted output to S from argument list ARG. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int vfwprintf (__FILE *__restrict __s, const wchar_t *__restrict __format, __gnuc_va_list __arg) /* __attribute__ ((__format__ (__wprintf__, 2, 0))) */; /* Write formatted output to stdout from argument list ARG. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int vwprintf (const wchar_t *__restrict __format, __gnuc_va_list __arg) /* __attribute__ ((__format__ (__wprintf__, 1, 0))) */; /* Write formatted output of at most N character to S from argument list ARG. */ extern int vswprintf (wchar_t *__restrict __s, size_t __n, const wchar_t *__restrict __format, __gnuc_va_list __arg) __THROW /* __attribute__ ((__format__ (__wprintf__, 3, 0))) */; /* Read formatted input from STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fwscanf (__FILE *__restrict __stream, const wchar_t *__restrict __format, ...) /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */; /* Read formatted input from stdin. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int wscanf (const wchar_t *__restrict __format, ...) /* __attribute__ ((__format__ (__wscanf__, 1, 2))) */; /* Read formatted input from S. */ extern int swscanf (const wchar_t *__restrict __s, const wchar_t *__restrict __format, ...) __THROW /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */; # if defined __USE_ISOC99 && !defined __USE_GNU \ && (!defined __LDBL_COMPAT || !defined __REDIRECT) \ && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K) # ifdef __REDIRECT /* For strict ISO C99 or POSIX compliance disallow %as, %aS and %a[ GNU extension which conflicts with valid %a followed by letter s, S or [. */ extern int __REDIRECT (fwscanf, (__FILE *__restrict __stream, const wchar_t *__restrict __format, ...), __isoc99_fwscanf) /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */; extern int __REDIRECT (wscanf, (const wchar_t *__restrict __format, ...), __isoc99_wscanf) /* __attribute__ ((__format__ (__wscanf__, 1, 2))) */; extern int __REDIRECT_NTH (swscanf, (const wchar_t *__restrict __s, const wchar_t *__restrict __format, ...), __isoc99_swscanf) /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */; # else # 668 "/usr/include/wchar.h" 3 4 extern int __isoc99_fwscanf (__FILE *__restrict __stream, const wchar_t *__restrict __format, ...); extern int __isoc99_wscanf (const wchar_t *__restrict __format, ...); extern int __isoc99_swscanf (const wchar_t *__restrict __s, const wchar_t *__restrict __format, ...) __THROW; # define fwscanf __isoc99_fwscanf # define wscanf __isoc99_wscanf # define swscanf __isoc99_swscanf # endif # 678 "/usr/include/wchar.h" 3 4 # endif # 679 "/usr/include/wchar.h" 3 4 __END_NAMESPACE_STD #endif /* Use ISO C95, C99 and Unix98. */ # 682 "/usr/include/wchar.h" 3 4 #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Read formatted input from S into argument list ARG. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int vfwscanf (__FILE *__restrict __s, const wchar_t *__restrict __format, __gnuc_va_list __arg) /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */; /* Read formatted input from stdin into argument list ARG. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int vwscanf (const wchar_t *__restrict __format, __gnuc_va_list __arg) /* __attribute__ ((__format__ (__wscanf__, 1, 0))) */; /* Read formatted input from S into argument list ARG. */ extern int vswscanf (const wchar_t *__restrict __s, const wchar_t *__restrict __format, __gnuc_va_list __arg) __THROW /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */; # if !defined __USE_GNU \ && (!defined __LDBL_COMPAT || !defined __REDIRECT) \ && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K) # ifdef __REDIRECT extern int __REDIRECT (vfwscanf, (__FILE *__restrict __s, const wchar_t *__restrict __format, __gnuc_va_list __arg), __isoc99_vfwscanf) /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */; extern int __REDIRECT (vwscanf, (const wchar_t *__restrict __format, __gnuc_va_list __arg), __isoc99_vwscanf) /* __attribute__ ((__format__ (__wscanf__, 1, 0))) */; extern int __REDIRECT_NTH (vswscanf, (const wchar_t *__restrict __s, const wchar_t *__restrict __format, __gnuc_va_list __arg), __isoc99_vswscanf) /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */; # else # 722 "/usr/include/wchar.h" 3 4 extern int __isoc99_vfwscanf (__FILE *__restrict __s, const wchar_t *__restrict __format, __gnuc_va_list __arg); extern int __isoc99_vwscanf (const wchar_t *__restrict __format, __gnuc_va_list __arg); extern int __isoc99_vswscanf (const wchar_t *__restrict __s, const wchar_t *__restrict __format, __gnuc_va_list __arg) __THROW; # define vfwscanf __isoc99_vfwscanf # define vwscanf __isoc99_vwscanf # define vswscanf __isoc99_vswscanf # endif # 734 "/usr/include/wchar.h" 3 4 # endif # 735 "/usr/include/wchar.h" 3 4 __END_NAMESPACE_C99 #endif /* Use ISO C99. */ # 738 "/usr/include/wchar.h" 3 4 __BEGIN_NAMESPACE_STD /* Read a character from STREAM. These functions are possible cancellation points and therefore not marked with __THROW. */ extern wint_t fgetwc (__FILE *__stream); extern wint_t getwc (__FILE *__stream); /* Read a character from stdin. This function is a possible cancellation point and therefore not marked with __THROW. */ extern wint_t getwchar (void); /* Write a character to STREAM. These functions are possible cancellation points and therefore not marked with __THROW. */ extern wint_t fputwc (wchar_t __wc, __FILE *__stream); extern wint_t putwc (wchar_t __wc, __FILE *__stream); /* Write a character to stdout. This function is a possible cancellation point and therefore not marked with __THROW. */ extern wint_t putwchar (wchar_t __wc); /* Get a newline-terminated wide character string of finite length from STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern wchar_t *fgetws (wchar_t *__restrict __ws, int __n, __FILE *__restrict __stream); /* Write a string to STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int fputws (const wchar_t *__restrict __ws, __FILE *__restrict __stream); /* Push a character back onto the input buffer of STREAM. This function is a possible cancellation point and therefore not marked with __THROW. */ extern wint_t ungetwc (wint_t __wc, __FILE *__stream); __END_NAMESPACE_STD #ifdef __USE_GNU /* These are defined to be equivalent to the `char' functions defined in POSIX.1:1996. These functions are not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation they are cancellation points and therefore not marked with __THROW. */ extern wint_t getwc_unlocked (__FILE *__stream); extern wint_t getwchar_unlocked (void); /* This is the wide character version of a GNU extension. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern wint_t fgetwc_unlocked (__FILE *__stream); /* Faster version when locking is not necessary. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern wint_t fputwc_unlocked (wchar_t __wc, __FILE *__stream); /* These are defined to be equivalent to the `char' functions defined in POSIX.1:1996. These functions are not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation they are cancellation points and therefore not marked with __THROW. */ extern wint_t putwc_unlocked (wchar_t __wc, __FILE *__stream); extern wint_t putwchar_unlocked (wchar_t __wc); /* This function does the same as `fgetws' but does not lock the stream. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern wchar_t *fgetws_unlocked (wchar_t *__restrict __ws, int __n, __FILE *__restrict __stream); /* This function does the same as `fputws' but does not lock the stream. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int fputws_unlocked (const wchar_t *__restrict __ws, __FILE *__restrict __stream); #endif # 849 "/usr/include/wchar.h" 3 4 __BEGIN_NAMESPACE_C99 /* Format TP into S according to FORMAT. Write no more than MAXSIZE wide characters and return the number of wide characters written, or 0 if it would exceed MAXSIZE. */ extern size_t wcsftime (wchar_t *__restrict __s, size_t __maxsize, const wchar_t *__restrict __format, const struct tm *__restrict __tp) __THROW; __END_NAMESPACE_C99 # ifdef __USE_GNU #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 861 "/usr/include/wchar.h" 3 4 # 862 "/usr/include/wchar.h" 3 4 /* Similar to `wcsftime' but takes the information from the provided locale and not the global locale. */ extern size_t wcsftime_l (wchar_t *__restrict __s, size_t __maxsize, const wchar_t *__restrict __format, const struct tm *__restrict __tp, __locale_t __loc) __THROW; # endif # 870 "/usr/include/wchar.h" 3 4 /* The X/Open standard demands that most of the functions defined in the header must also appear here. This is probably because some X/Open members wrote their implementation before the ISO C standard was published and introduced the better solution. We have to provide these definitions for compliance reasons but we do this nonsense only if really necessary. */ #if defined __USE_UNIX98 && !defined __USE_GNU # define __need_iswxxx #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 879 "/usr/include/wchar.h" 3 4 # 880 "/usr/include/wchar.h" 3 4 #endif # 881 "/usr/include/wchar.h" 3 4 /* Define some macros helping to catch buffer overflows. */ #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 884 "/usr/include/wchar.h" 3 4 # 885 "/usr/include/wchar.h" 3 4 #endif # 886 "/usr/include/wchar.h" 3 4 #ifdef __LDBL_COMPAT #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 888 "/usr/include/wchar.h" 3 4 # 889 "/usr/include/wchar.h" 3 4 #endif # 890 "/usr/include/wchar.h" 3 4 __END_DECLS #endif /* _WCHAR_H defined */ # 894 "/usr/include/wchar.h" 3 4 #endif /* wchar.h */ # 896 "/usr/include/wchar.h" 3 4 /* Undefine all __need_* constants in case we are included to get those constants but the whole file was already read. */ #undef __need_mbstate_t #undef __need_wint_t # 34 "/usr/include/wctype.h" 2 3 4 /* Constant expression of type `wint_t' whose value does not correspond to any member of the extended character set. */ # ifndef WEOF # define WEOF (0xffffffffu) # endif # 40 "/usr/include/wctype.h" 3 4 #endif # 41 "/usr/include/wctype.h" 3 4 #undef __need_iswxxx /* The following part is also used in the header when compiled in the Unix98 compatibility mode. */ #ifndef __iswxxx_defined # define __iswxxx_defined 1 __BEGIN_NAMESPACE_C99 /* Scalar type that can hold values which represent locale-specific character classifications. */ typedef unsigned long int wctype_t; __END_NAMESPACE_C99 # ifndef _ISwbit /* The characteristics are stored always in network byte order (big endian). We define the bit value interpretations here dependent on the machine's byte order. */ #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 60 "/usr/include/wctype.h" 3 4 # 61 "/usr/include/wctype.h" 3 4 # if __BYTE_ORDER == __BIG_ENDIAN # define _ISwbit(bit) (1 << (bit)) # else /* __BYTE_ORDER == __LITTLE_ENDIAN */ # 64 "/usr/include/wctype.h" 3 4 # define _ISwbit(bit) \ ((bit) < 8 ? (int) ((1UL << (bit)) << 24) \ : ((bit) < 16 ? (int) ((1UL << (bit)) << 8) \ : ((bit) < 24 ? (int) ((1UL << (bit)) >> 8) \ : (int) ((1UL << (bit)) >> 24)))) # endif # 70 "/usr/include/wctype.h" 3 4 enum { __ISwupper = 0, /* UPPERCASE. */ __ISwlower = 1, /* lowercase. */ __ISwalpha = 2, /* Alphabetic. */ __ISwdigit = 3, /* Numeric. */ __ISwxdigit = 4, /* Hexadecimal numeric. */ __ISwspace = 5, /* Whitespace. */ __ISwprint = 6, /* Printing. */ __ISwgraph = 7, /* Graphical. */ __ISwblank = 8, /* Blank (usually SPC and TAB). */ __ISwcntrl = 9, /* Control character. */ __ISwpunct = 10, /* Punctuation. */ __ISwalnum = 11, /* Alphanumeric. */ _ISwupper = _ISwbit (__ISwupper), /* UPPERCASE. */ _ISwlower = _ISwbit (__ISwlower), /* lowercase. */ _ISwalpha = _ISwbit (__ISwalpha), /* Alphabetic. */ _ISwdigit = _ISwbit (__ISwdigit), /* Numeric. */ _ISwxdigit = _ISwbit (__ISwxdigit), /* Hexadecimal numeric. */ _ISwspace = _ISwbit (__ISwspace), /* Whitespace. */ _ISwprint = _ISwbit (__ISwprint), /* Printing. */ _ISwgraph = _ISwbit (__ISwgraph), /* Graphical. */ _ISwblank = _ISwbit (__ISwblank), /* Blank (usually SPC and TAB). */ _ISwcntrl = _ISwbit (__ISwcntrl), /* Control character. */ _ISwpunct = _ISwbit (__ISwpunct), /* Punctuation. */ _ISwalnum = _ISwbit (__ISwalnum) /* Alphanumeric. */ }; # endif /* Not _ISwbit */ # 100 "/usr/include/wctype.h" 3 4 __BEGIN_DECLS __BEGIN_NAMESPACE_C99 /* * Wide-character classification functions: 7.15.2.1. */ /* Test for any wide character for which `iswalpha' or `iswdigit' is true. */ extern int iswalnum (wint_t __wc) __THROW; /* Test for any wide character for which `iswupper' or 'iswlower' is true, or any wide character that is one of a locale-specific set of wide-characters for which none of `iswcntrl', `iswdigit', `iswpunct', or `iswspace' is true. */ extern int iswalpha (wint_t __wc) __THROW; /* Test for any control wide character. */ extern int iswcntrl (wint_t __wc) __THROW; /* Test for any wide character that corresponds to a decimal-digit character. */ extern int iswdigit (wint_t __wc) __THROW; /* Test for any wide character for which `iswprint' is true and `iswspace' is false. */ extern int iswgraph (wint_t __wc) __THROW; /* Test for any wide character that corresponds to a lowercase letter or is one of a locale-specific set of wide characters for which none of `iswcntrl', `iswdigit', `iswpunct', or `iswspace' is true. */ extern int iswlower (wint_t __wc) __THROW; /* Test for any printing wide character. */ extern int iswprint (wint_t __wc) __THROW; /* Test for any printing wide character that is one of a locale-specific et of wide characters for which neither `iswspace' nor `iswalnum' is true. */ extern int iswpunct (wint_t __wc) __THROW; /* Test for any wide character that corresponds to a locale-specific set of wide characters for which none of `iswalnum', `iswgraph', or `iswpunct' is true. */ extern int iswspace (wint_t __wc) __THROW; /* Test for any wide character that corresponds to an uppercase letter or is one of a locale-specific set of wide character for which none of `iswcntrl', `iswdigit', `iswpunct', or `iswspace' is true. */ extern int iswupper (wint_t __wc) __THROW; /* Test for any wide character that corresponds to a hexadecimal-digit character equivalent to that performed be the functions described in the previous subclause. */ extern int iswxdigit (wint_t __wc) __THROW; /* Test for any wide character that corresponds to a standard blank wide character or a locale-specific set of wide characters for which `iswalnum' is false. */ # ifdef __USE_ISOC99 extern int iswblank (wint_t __wc) __THROW; # endif # 164 "/usr/include/wctype.h" 3 4 /* * Extensible wide-character classification functions: 7.15.2.2. */ /* Construct value that describes a class of wide characters identified by the string argument PROPERTY. */ extern wctype_t wctype (const char *__property) __THROW; /* Determine whether the wide-character WC has the property described by DESC. */ extern int iswctype (wint_t __wc, wctype_t __desc) __THROW; __END_NAMESPACE_C99 /* * Wide-character case-mapping functions: 7.15.3.1. */ __BEGIN_NAMESPACE_C99 /* Scalar type that can hold values which represent locale-specific character mappings. */ typedef const __int32_t *wctrans_t; __END_NAMESPACE_C99 #ifdef __USE_GNU __USING_NAMESPACE_C99(wctrans_t) #endif # 191 "/usr/include/wctype.h" 3 4 __BEGIN_NAMESPACE_C99 /* Converts an uppercase letter to the corresponding lowercase letter. */ extern wint_t towlower (wint_t __wc) __THROW; /* Converts an lowercase letter to the corresponding uppercase letter. */ extern wint_t towupper (wint_t __wc) __THROW; __END_NAMESPACE_C99 __END_DECLS #endif /* need iswxxx. */ # 203 "/usr/include/wctype.h" 3 4 /* The remaining definitions and declarations must not appear in the header. */ #ifdef _WCTYPE_H /* * Extensible wide-character mapping functions: 7.15.3.2. */ __BEGIN_DECLS __BEGIN_NAMESPACE_C99 /* Construct value that describes a mapping between wide characters identified by the string argument PROPERTY. */ extern wctrans_t wctrans (const char *__property) __THROW; /* Map the wide character WC using the mapping described by DESC. */ extern wint_t towctrans (wint_t __wc, wctrans_t __desc) __THROW; __END_NAMESPACE_C99 # ifdef __USE_XOPEN2K8 /* Declare the interface to extended locale model. */ #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 226 "/usr/include/wctype.h" 3 4 # 227 "/usr/include/wctype.h" 3 4 /* Test for any wide character for which `iswalpha' or `iswdigit' is true. */ extern int iswalnum_l (wint_t __wc, __locale_t __locale) __THROW; /* Test for any wide character for which `iswupper' or 'iswlower' is true, or any wide character that is one of a locale-specific set of wide-characters for which none of `iswcntrl', `iswdigit', `iswpunct', or `iswspace' is true. */ extern int iswalpha_l (wint_t __wc, __locale_t __locale) __THROW; /* Test for any control wide character. */ extern int iswcntrl_l (wint_t __wc, __locale_t __locale) __THROW; /* Test for any wide character that corresponds to a decimal-digit character. */ extern int iswdigit_l (wint_t __wc, __locale_t __locale) __THROW; /* Test for any wide character for which `iswprint' is true and `iswspace' is false. */ extern int iswgraph_l (wint_t __wc, __locale_t __locale) __THROW; /* Test for any wide character that corresponds to a lowercase letter or is one of a locale-specific set of wide characters for which none of `iswcntrl', `iswdigit', `iswpunct', or `iswspace' is true. */ extern int iswlower_l (wint_t __wc, __locale_t __locale) __THROW; /* Test for any printing wide character. */ extern int iswprint_l (wint_t __wc, __locale_t __locale) __THROW; /* Test for any printing wide character that is one of a locale-specific et of wide characters for which neither `iswspace' nor `iswalnum' is true. */ extern int iswpunct_l (wint_t __wc, __locale_t __locale) __THROW; /* Test for any wide character that corresponds to a locale-specific set of wide characters for which none of `iswalnum', `iswgraph', or `iswpunct' is true. */ extern int iswspace_l (wint_t __wc, __locale_t __locale) __THROW; /* Test for any wide character that corresponds to an uppercase letter or is one of a locale-specific set of wide character for which none of `iswcntrl', `iswdigit', `iswpunct', or `iswspace' is true. */ extern int iswupper_l (wint_t __wc, __locale_t __locale) __THROW; /* Test for any wide character that corresponds to a hexadecimal-digit character equivalent to that performed be the functions described in the previous subclause. */ extern int iswxdigit_l (wint_t __wc, __locale_t __locale) __THROW; /* Test for any wide character that corresponds to a standard blank wide character or a locale-specific set of wide characters for which `iswalnum' is false. */ extern int iswblank_l (wint_t __wc, __locale_t __locale) __THROW; /* Construct value that describes a class of wide characters identified by the string argument PROPERTY. */ extern wctype_t wctype_l (const char *__property, __locale_t __locale) __THROW; /* Determine whether the wide-character WC has the property described by DESC. */ extern int iswctype_l (wint_t __wc, wctype_t __desc, __locale_t __locale) __THROW; /* * Wide-character case-mapping functions. */ /* Converts an uppercase letter to the corresponding lowercase letter. */ extern wint_t towlower_l (wint_t __wc, __locale_t __locale) __THROW; /* Converts an lowercase letter to the corresponding uppercase letter. */ extern wint_t towupper_l (wint_t __wc, __locale_t __locale) __THROW; /* Construct value that describes a mapping between wide characters identified by the string argument PROPERTY. */ extern wctrans_t wctrans_l (const char *__property, __locale_t __locale) __THROW; /* Map the wide character WC using the mapping described by DESC. */ extern wint_t towctrans_l (wint_t __wc, wctrans_t __desc, __locale_t __locale) __THROW; # endif /* Use POSIX 2008. */ # 313 "/usr/include/wctype.h" 3 4 __END_DECLS #endif /* __WCTYPE_H defined. */ # 317 "/usr/include/wctype.h" 3 4 #endif /* wctype.h */ # 319 "/usr/include/wctype.h" 3 4 # 51 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwctype" 2 3 #endif // _GLIBCXX_HAVE_WCTYPE_H # 52 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwctype" 3 #ifndef _GLIBCXX_CWCTYPE #define _GLIBCXX_CWCTYPE 1 // Get rid of those macros defined in in lieu of real functions. #undef iswalnum #undef iswalpha #if _GLIBCXX_HAVE_ISWBLANK # undef iswblank #endif # 62 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwctype" 3 #undef iswcntrl #undef iswctype #undef iswdigit #undef iswgraph #undef iswlower #undef iswprint #undef iswpunct #undef iswspace #undef iswupper #undef iswxdigit #undef towctrans #undef towlower #undef towupper #undef wctrans #undef wctype #if _GLIBCXX_USE_WCHAR_T namespace std { using ::wctrans_t; using ::wctype_t; using ::wint_t; using ::iswalnum; using ::iswalpha; #if _GLIBCXX_HAVE_ISWBLANK using ::iswblank; #endif # 91 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwctype" 3 using ::iswcntrl; using ::iswctype; using ::iswdigit; using ::iswgraph; using ::iswlower; using ::iswprint; using ::iswpunct; using ::iswspace; using ::iswupper; using ::iswxdigit; using ::towctrans; using ::towlower; using ::towupper; using ::wctrans; using ::wctype; } // namespace #endif //_GLIBCXX_USE_WCHAR_T # 109 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwctype" 3 #endif // _GLIBCXX_CWCTYPE # 111 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cwctype" 3 # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets.h" 2 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cctype" 1 3 // -*- C++ -*- forwarding header. // Copyright (C) 1997-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file include/cctype * This is a Standard C++ Library file. You should @c \#include this file * in your programs, rather than any of the @a *.h implementation files. * * This is the C++ version of the Standard C Library header @c ctype.h, * and its contents are (mostly) the same as that header, but are all * contained in the namespace @c std (except for names which are defined * as macros in C). */ // // ISO C++ 14882: // #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cctype" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cctype" 3 # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cctype" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cctype" 3 # 43 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cctype" 3 #ifndef _GLIBCXX_CCTYPE #define _GLIBCXX_CCTYPE 1 // Get rid of those macros defined in in lieu of real functions. #undef isalnum #undef isalpha #undef iscntrl #undef isdigit #undef isgraph #undef islower #undef isprint #undef ispunct #undef isspace #undef isupper #undef isxdigit #undef tolower #undef toupper namespace std { using ::isalnum; using ::isalpha; using ::iscntrl; using ::isdigit; using ::isgraph; using ::islower; using ::isprint; using ::ispunct; using ::isspace; using ::isupper; using ::isxdigit; using ::tolower; using ::toupper; } // namespace std #if __cplusplus >= 201103L #ifdef _GLIBCXX_USE_C99_CTYPE_TR1 #undef isblank namespace std { using ::isblank; } // namespace std #endif // _GLIBCXX_USE_C99_CTYPE_TR1 # 91 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cctype" 3 #endif // C++11 # 93 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cctype" 3 #endif # 95 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cctype" 3 # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets.h" 2 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/ctype_base.h" 1 3 // Locale support -*- C++ -*- // Copyright (C) 1997-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file bits/ctype_base.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{locale} */ // // ISO C++ 14882: 22.1 Locales // // Information as gleaned from /usr/include/ctype.h namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION /// @brief Base class for ctype. struct ctype_base { // Non-standard typedefs. typedef const int* __to_type; // NB: Offsets into ctype::_M_table force a particular size // on the mask type. Because of this, we don't use an enum. typedef unsigned short mask; static const mask upper = _ISupper; static const mask lower = _ISlower; static const mask alpha = _ISalpha; static const mask digit = _ISdigit; static const mask xdigit = _ISxdigit; static const mask space = _ISspace; static const mask print = _ISprint; static const mask graph = _ISalpha | _ISdigit | _ISpunct; static const mask cntrl = _IScntrl; static const mask punct = _ISpunct; static const mask alnum = _ISalpha | _ISdigit; #if __cplusplus >= 201103L static const mask blank = _ISblank; #endif # 63 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/ctype_base.h" 3 }; _GLIBCXX_END_NAMESPACE_VERSION } // namespace # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets.h" 2 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets.h" 3 # 43 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets.h" 3 #if 0 /* expanded by -frewrite-includes */ #include // For ios_base, ios_base::iostate #endif /* expanded by -frewrite-includes */ # 43 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets.h" 3 # 44 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 44 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets.h" 3 # 45 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 45 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets.h" 3 # 46 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 46 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets.h" 3 # 47 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 47 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets.h" 3 # 48 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 48 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/streambuf_iterator.h" 1 3 // Streambuf iterators // Copyright (C) 1997-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file bits/streambuf_iterator.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{iterator} */ #ifndef _STREAMBUF_ITERATOR_H #define _STREAMBUF_ITERATOR_H 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 34 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/streambuf_iterator.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 35 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/streambuf_iterator.h" 3 # 36 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/streambuf_iterator.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 36 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/streambuf_iterator.h" 3 # 37 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/streambuf_iterator.h" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION /** * @addtogroup iterators * @{ */ // 24.5.3 Template class istreambuf_iterator /// Provides input iterator semantics for streambufs. template class istreambuf_iterator : public iterator= 201103L // LWG 445. _CharT> #else # 57 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/streambuf_iterator.h" 3 _CharT&> #endif # 59 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/streambuf_iterator.h" 3 { public: // Types: //@{ /// Public typedefs typedef _CharT char_type; typedef _Traits traits_type; typedef typename _Traits::int_type int_type; typedef basic_streambuf<_CharT, _Traits> streambuf_type; typedef basic_istream<_CharT, _Traits> istream_type; //@} template friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value, ostreambuf_iterator<_CharT2> >::__type copy(istreambuf_iterator<_CharT2>, istreambuf_iterator<_CharT2>, ostreambuf_iterator<_CharT2>); template friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value, _CharT2*>::__type __copy_move_a2(istreambuf_iterator<_CharT2>, istreambuf_iterator<_CharT2>, _CharT2*); template friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value, istreambuf_iterator<_CharT2> >::__type find(istreambuf_iterator<_CharT2>, istreambuf_iterator<_CharT2>, const _CharT2&); private: // 24.5.3 istreambuf_iterator // p 1 // If the end of stream is reached (streambuf_type::sgetc() // returns traits_type::eof()), the iterator becomes equal to // the "end of stream" iterator value. // NB: This implementation assumes the "end of stream" value // is EOF, or -1. mutable streambuf_type* _M_sbuf; mutable int_type _M_c; public: /// Construct end of input stream iterator. _GLIBCXX_CONSTEXPR istreambuf_iterator() _GLIBCXX_USE_NOEXCEPT : _M_sbuf(0), _M_c(traits_type::eof()) { } #if __cplusplus >= 201103L istreambuf_iterator(const istreambuf_iterator&) noexcept = default; ~istreambuf_iterator() = default; #endif # 110 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/streambuf_iterator.h" 3 /// Construct start of input stream iterator. istreambuf_iterator(istream_type& __s) _GLIBCXX_USE_NOEXCEPT : _M_sbuf(__s.rdbuf()), _M_c(traits_type::eof()) { } /// Construct start of streambuf iterator. istreambuf_iterator(streambuf_type* __s) _GLIBCXX_USE_NOEXCEPT : _M_sbuf(__s), _M_c(traits_type::eof()) { } /// Return the current character pointed to by iterator. This returns /// streambuf.sgetc(). It cannot be assigned. NB: The result of /// operator*() on an end of stream is undefined. char_type operator*() const { #ifdef _GLIBCXX_DEBUG_PEDANTIC // Dereferencing a past-the-end istreambuf_iterator is a // libstdc++ extension __glibcxx_requires_cond(!_M_at_eof(), _M_message(__gnu_debug::__msg_deref_istreambuf) ._M_iterator(*this)); #endif # 132 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/streambuf_iterator.h" 3 return traits_type::to_char_type(_M_get()); } /// Advance the iterator. Calls streambuf.sbumpc(). istreambuf_iterator& operator++() { __glibcxx_requires_cond(!_M_at_eof(), _M_message(__gnu_debug::__msg_inc_istreambuf) ._M_iterator(*this)); if (_M_sbuf) { _M_sbuf->sbumpc(); _M_c = traits_type::eof(); } return *this; } /// Advance the iterator. Calls streambuf.sbumpc(). istreambuf_iterator operator++(int) { __glibcxx_requires_cond(!_M_at_eof(), _M_message(__gnu_debug::__msg_inc_istreambuf) ._M_iterator(*this)); istreambuf_iterator __old = *this; if (_M_sbuf) { __old._M_c = _M_sbuf->sbumpc(); _M_c = traits_type::eof(); } return __old; } // _GLIBCXX_RESOLVE_LIB_DEFECTS // 110 istreambuf_iterator::equal not const // NB: there is also number 111 (NAD, Future) pending on this function. /// Return true both iterators are end or both are not end. bool equal(const istreambuf_iterator& __b) const { return _M_at_eof() == __b._M_at_eof(); } private: int_type _M_get() const { const int_type __eof = traits_type::eof(); int_type __ret = __eof; if (_M_sbuf) { if (!traits_type::eq_int_type(_M_c, __eof)) __ret = _M_c; else if (!traits_type::eq_int_type((__ret = _M_sbuf->sgetc()), __eof)) _M_c = __ret; else _M_sbuf = 0; } return __ret; } bool _M_at_eof() const { const int_type __eof = traits_type::eof(); return traits_type::eq_int_type(_M_get(), __eof); } }; template inline bool operator==(const istreambuf_iterator<_CharT, _Traits>& __a, const istreambuf_iterator<_CharT, _Traits>& __b) { return __a.equal(__b); } template inline bool operator!=(const istreambuf_iterator<_CharT, _Traits>& __a, const istreambuf_iterator<_CharT, _Traits>& __b) { return !__a.equal(__b); } /// Provides output iterator semantics for streambufs. template class ostreambuf_iterator : public iterator { public: // Types: //@{ /// Public typedefs typedef _CharT char_type; typedef _Traits traits_type; typedef basic_streambuf<_CharT, _Traits> streambuf_type; typedef basic_ostream<_CharT, _Traits> ostream_type; //@} template friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value, ostreambuf_iterator<_CharT2> >::__type copy(istreambuf_iterator<_CharT2>, istreambuf_iterator<_CharT2>, ostreambuf_iterator<_CharT2>); private: streambuf_type* _M_sbuf; bool _M_failed; public: /// Construct output iterator from ostream. ostreambuf_iterator(ostream_type& __s) _GLIBCXX_USE_NOEXCEPT : _M_sbuf(__s.rdbuf()), _M_failed(!_M_sbuf) { } /// Construct output iterator from streambuf. ostreambuf_iterator(streambuf_type* __s) _GLIBCXX_USE_NOEXCEPT : _M_sbuf(__s), _M_failed(!_M_sbuf) { } /// Write character to streambuf. Calls streambuf.sputc(). ostreambuf_iterator& operator=(_CharT __c) { if (!_M_failed && _Traits::eq_int_type(_M_sbuf->sputc(__c), _Traits::eof())) _M_failed = true; return *this; } /// Return *this. ostreambuf_iterator& operator*() { return *this; } /// Return *this. ostreambuf_iterator& operator++(int) { return *this; } /// Return *this. ostreambuf_iterator& operator++() { return *this; } /// Return true if previous operator=() failed. bool failed() const _GLIBCXX_USE_NOEXCEPT { return _M_failed; } ostreambuf_iterator& _M_put(const _CharT* __ws, streamsize __len) { if (__builtin_expect(!_M_failed, true) && __builtin_expect(this->_M_sbuf->sputn(__ws, __len) != __len, false)) _M_failed = true; return *this; } }; // Overloads for streambuf iterators. template typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value, ostreambuf_iterator<_CharT> >::__type copy(istreambuf_iterator<_CharT> __first, istreambuf_iterator<_CharT> __last, ostreambuf_iterator<_CharT> __result) { if (__first._M_sbuf && !__last._M_sbuf && !__result._M_failed) { bool __ineof; __copy_streambufs_eof(__first._M_sbuf, __result._M_sbuf, __ineof); if (!__ineof) __result._M_failed = true; } return __result; } template typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value, ostreambuf_iterator<_CharT> >::__type __copy_move_a2(_CharT* __first, _CharT* __last, ostreambuf_iterator<_CharT> __result) { const streamsize __num = __last - __first; if (__num > 0) __result._M_put(__first, __num); return __result; } template typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value, ostreambuf_iterator<_CharT> >::__type __copy_move_a2(const _CharT* __first, const _CharT* __last, ostreambuf_iterator<_CharT> __result) { const streamsize __num = __last - __first; if (__num > 0) __result._M_put(__first, __num); return __result; } template typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value, _CharT*>::__type __copy_move_a2(istreambuf_iterator<_CharT> __first, istreambuf_iterator<_CharT> __last, _CharT* __result) { typedef istreambuf_iterator<_CharT> __is_iterator_type; typedef typename __is_iterator_type::traits_type traits_type; typedef typename __is_iterator_type::streambuf_type streambuf_type; typedef typename traits_type::int_type int_type; if (__first._M_sbuf && !__last._M_sbuf) { streambuf_type* __sb = __first._M_sbuf; int_type __c = __sb->sgetc(); while (!traits_type::eq_int_type(__c, traits_type::eof())) { const streamsize __n = __sb->egptr() - __sb->gptr(); if (__n > 1) { traits_type::copy(__result, __sb->gptr(), __n); __sb->__safe_gbump(__n); __result += __n; __c = __sb->underflow(); } else { *__result++ = traits_type::to_char_type(__c); __c = __sb->snextc(); } } } return __result; } template typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value, istreambuf_iterator<_CharT> >::__type find(istreambuf_iterator<_CharT> __first, istreambuf_iterator<_CharT> __last, const _CharT& __val) { typedef istreambuf_iterator<_CharT> __is_iterator_type; typedef typename __is_iterator_type::traits_type traits_type; typedef typename __is_iterator_type::streambuf_type streambuf_type; typedef typename traits_type::int_type int_type; if (__first._M_sbuf && !__last._M_sbuf) { const int_type __ival = traits_type::to_int_type(__val); streambuf_type* __sb = __first._M_sbuf; int_type __c = __sb->sgetc(); while (!traits_type::eq_int_type(__c, traits_type::eof()) && !traits_type::eq_int_type(__c, __ival)) { streamsize __n = __sb->egptr() - __sb->gptr(); if (__n > 1) { const _CharT* __p = traits_type::find(__sb->gptr(), __n, __val); if (__p) __n = __p - __sb->gptr(); __sb->__safe_gbump(__n); __c = __sb->sgetc(); } else __c = __sb->snextc(); } if (!traits_type::eq_int_type(__c, traits_type::eof())) __first._M_c = __c; else __first._M_sbuf = 0; } return __first; } // @} group iterators _GLIBCXX_END_NAMESPACE_VERSION } // namespace #endif # 413 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/streambuf_iterator.h" 3 # 49 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets.h" 2 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION // NB: Don't instantiate required wchar_t facets if no wchar_t support. #ifdef _GLIBCXX_USE_WCHAR_T # define _GLIBCXX_NUM_FACETS 28 # define _GLIBCXX_NUM_CXX11_FACETS 16 #else # 59 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets.h" 3 # define _GLIBCXX_NUM_FACETS 14 # define _GLIBCXX_NUM_CXX11_FACETS 8 #endif # 62 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets.h" 3 #ifdef _GLIBCXX_USE_C99_STDINT_TR1 # define _GLIBCXX_NUM_UNICODE_FACETS 2 #else # 65 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets.h" 3 # define _GLIBCXX_NUM_UNICODE_FACETS 0 #endif # 67 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets.h" 3 // Convert string to numeric value of type _Tp and store results. // NB: This is specialized for all required types, there is no // generic definition. template void __convert_to_v(const char*, _Tp&, ios_base::iostate&, const __c_locale&) throw(); // Explicit specializations for required types. template<> void __convert_to_v(const char*, float&, ios_base::iostate&, const __c_locale&) throw(); template<> void __convert_to_v(const char*, double&, ios_base::iostate&, const __c_locale&) throw(); template<> void __convert_to_v(const char*, long double&, ios_base::iostate&, const __c_locale&) throw(); // NB: __pad is a struct, rather than a function, so it can be // partially-specialized. template struct __pad { static void _S_pad(ios_base& __io, _CharT __fill, _CharT* __news, const _CharT* __olds, streamsize __newlen, streamsize __oldlen); }; // Used by both numeric and monetary facets. // Inserts "group separator" characters into an array of characters. // It's recursive, one iteration per group. It moves the characters // in the buffer this way: "xxxx12345" -> "12,345xxx". Call this // only with __gsize != 0. template _CharT* __add_grouping(_CharT* __s, _CharT __sep, const char* __gbeg, size_t __gsize, const _CharT* __first, const _CharT* __last); // This template permits specializing facet output code for // ostreambuf_iterator. For ostreambuf_iterator, sputn is // significantly more efficient than incrementing iterators. template inline ostreambuf_iterator<_CharT> __write(ostreambuf_iterator<_CharT> __s, const _CharT* __ws, int __len) { __s._M_put(__ws, __len); return __s; } // This is the unspecialized form of the template. template inline _OutIter __write(_OutIter __s, const _CharT* __ws, int __len) { for (int __j = 0; __j < __len; __j++, ++__s) *__s = __ws[__j]; return __s; } // 22.2.1.1 Template class ctype // Include host and configuration specific ctype enums for ctype_base. /** * @brief Common base for ctype facet * * This template class provides implementations of the public functions * that forward to the protected virtual functions. * * This template also provides abstract stubs for the protected virtual * functions. */ template class __ctype_abstract_base : public locale::facet, public ctype_base { public: // Types: /// Typedef for the template parameter typedef _CharT char_type; /** * @brief Test char_type classification. * * This function finds a mask M for @a __c and compares it to * mask @a __m. It does so by returning the value of * ctype::do_is(). * * @param __c The char_type to compare the mask of. * @param __m The mask to compare against. * @return (M & __m) != 0. */ bool is(mask __m, char_type __c) const { return this->do_is(__m, __c); } /** * @brief Return a mask array. * * This function finds the mask for each char_type in the range [lo,hi) * and successively writes it to vec. vec must have as many elements * as the char array. It does so by returning the value of * ctype::do_is(). * * @param __lo Pointer to start of range. * @param __hi Pointer to end of range. * @param __vec Pointer to an array of mask storage. * @return @a __hi. */ const char_type* is(const char_type *__lo, const char_type *__hi, mask *__vec) const { return this->do_is(__lo, __hi, __vec); } /** * @brief Find char_type matching a mask * * This function searches for and returns the first char_type c in * [lo,hi) for which is(m,c) is true. It does so by returning * ctype::do_scan_is(). * * @param __m The mask to compare against. * @param __lo Pointer to start of range. * @param __hi Pointer to end of range. * @return Pointer to matching char_type if found, else @a __hi. */ const char_type* scan_is(mask __m, const char_type* __lo, const char_type* __hi) const { return this->do_scan_is(__m, __lo, __hi); } /** * @brief Find char_type not matching a mask * * This function searches for and returns the first char_type c in * [lo,hi) for which is(m,c) is false. It does so by returning * ctype::do_scan_not(). * * @param __m The mask to compare against. * @param __lo Pointer to first char in range. * @param __hi Pointer to end of range. * @return Pointer to non-matching char if found, else @a __hi. */ const char_type* scan_not(mask __m, const char_type* __lo, const char_type* __hi) const { return this->do_scan_not(__m, __lo, __hi); } /** * @brief Convert to uppercase. * * This function converts the argument to uppercase if possible. * If not possible (for example, '2'), returns the argument. It does * so by returning ctype::do_toupper(). * * @param __c The char_type to convert. * @return The uppercase char_type if convertible, else @a __c. */ char_type toupper(char_type __c) const { return this->do_toupper(__c); } /** * @brief Convert array to uppercase. * * This function converts each char_type in the range [lo,hi) to * uppercase if possible. Other elements remain untouched. It does so * by returning ctype:: do_toupper(lo, hi). * * @param __lo Pointer to start of range. * @param __hi Pointer to end of range. * @return @a __hi. */ const char_type* toupper(char_type *__lo, const char_type* __hi) const { return this->do_toupper(__lo, __hi); } /** * @brief Convert to lowercase. * * This function converts the argument to lowercase if possible. If * not possible (for example, '2'), returns the argument. It does so * by returning ctype::do_tolower(c). * * @param __c The char_type to convert. * @return The lowercase char_type if convertible, else @a __c. */ char_type tolower(char_type __c) const { return this->do_tolower(__c); } /** * @brief Convert array to lowercase. * * This function converts each char_type in the range [__lo,__hi) to * lowercase if possible. Other elements remain untouched. It does so * by returning ctype:: do_tolower(__lo, __hi). * * @param __lo Pointer to start of range. * @param __hi Pointer to end of range. * @return @a __hi. */ const char_type* tolower(char_type* __lo, const char_type* __hi) const { return this->do_tolower(__lo, __hi); } /** * @brief Widen char to char_type * * This function converts the char argument to char_type using the * simplest reasonable transformation. It does so by returning * ctype::do_widen(c). * * Note: this is not what you want for codepage conversions. See * codecvt for that. * * @param __c The char to convert. * @return The converted char_type. */ char_type widen(char __c) const { return this->do_widen(__c); } /** * @brief Widen array to char_type * * This function converts each char in the input to char_type using the * simplest reasonable transformation. It does so by returning * ctype::do_widen(c). * * Note: this is not what you want for codepage conversions. See * codecvt for that. * * @param __lo Pointer to start of range. * @param __hi Pointer to end of range. * @param __to Pointer to the destination array. * @return @a __hi. */ const char* widen(const char* __lo, const char* __hi, char_type* __to) const { return this->do_widen(__lo, __hi, __to); } /** * @brief Narrow char_type to char * * This function converts the char_type to char using the simplest * reasonable transformation. If the conversion fails, dfault is * returned instead. It does so by returning * ctype::do_narrow(__c). * * Note: this is not what you want for codepage conversions. See * codecvt for that. * * @param __c The char_type to convert. * @param __dfault Char to return if conversion fails. * @return The converted char. */ char narrow(char_type __c, char __dfault) const { return this->do_narrow(__c, __dfault); } /** * @brief Narrow array to char array * * This function converts each char_type in the input to char using the * simplest reasonable transformation and writes the results to the * destination array. For any char_type in the input that cannot be * converted, @a dfault is used instead. It does so by returning * ctype::do_narrow(__lo, __hi, __dfault, __to). * * Note: this is not what you want for codepage conversions. See * codecvt for that. * * @param __lo Pointer to start of range. * @param __hi Pointer to end of range. * @param __dfault Char to use if conversion fails. * @param __to Pointer to the destination array. * @return @a __hi. */ const char_type* narrow(const char_type* __lo, const char_type* __hi, char __dfault, char* __to) const { return this->do_narrow(__lo, __hi, __dfault, __to); } protected: explicit __ctype_abstract_base(size_t __refs = 0): facet(__refs) { } virtual ~__ctype_abstract_base() { } /** * @brief Test char_type classification. * * This function finds a mask M for @a c and compares it to mask @a m. * * do_is() is a hook for a derived facet to change the behavior of * classifying. do_is() must always return the same result for the * same input. * * @param __c The char_type to find the mask of. * @param __m The mask to compare against. * @return (M & __m) != 0. */ virtual bool do_is(mask __m, char_type __c) const = 0; /** * @brief Return a mask array. * * This function finds the mask for each char_type in the range [lo,hi) * and successively writes it to vec. vec must have as many elements * as the input. * * do_is() is a hook for a derived facet to change the behavior of * classifying. do_is() must always return the same result for the * same input. * * @param __lo Pointer to start of range. * @param __hi Pointer to end of range. * @param __vec Pointer to an array of mask storage. * @return @a __hi. */ virtual const char_type* do_is(const char_type* __lo, const char_type* __hi, mask* __vec) const = 0; /** * @brief Find char_type matching mask * * This function searches for and returns the first char_type c in * [__lo,__hi) for which is(__m,c) is true. * * do_scan_is() is a hook for a derived facet to change the behavior of * match searching. do_is() must always return the same result for the * same input. * * @param __m The mask to compare against. * @param __lo Pointer to start of range. * @param __hi Pointer to end of range. * @return Pointer to a matching char_type if found, else @a __hi. */ virtual const char_type* do_scan_is(mask __m, const char_type* __lo, const char_type* __hi) const = 0; /** * @brief Find char_type not matching mask * * This function searches for and returns a pointer to the first * char_type c of [lo,hi) for which is(m,c) is false. * * do_scan_is() is a hook for a derived facet to change the behavior of * match searching. do_is() must always return the same result for the * same input. * * @param __m The mask to compare against. * @param __lo Pointer to start of range. * @param __hi Pointer to end of range. * @return Pointer to a non-matching char_type if found, else @a __hi. */ virtual const char_type* do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const = 0; /** * @brief Convert to uppercase. * * This virtual function converts the char_type argument to uppercase * if possible. If not possible (for example, '2'), returns the * argument. * * do_toupper() is a hook for a derived facet to change the behavior of * uppercasing. do_toupper() must always return the same result for * the same input. * * @param __c The char_type to convert. * @return The uppercase char_type if convertible, else @a __c. */ virtual char_type do_toupper(char_type __c) const = 0; /** * @brief Convert array to uppercase. * * This virtual function converts each char_type in the range [__lo,__hi) * to uppercase if possible. Other elements remain untouched. * * do_toupper() is a hook for a derived facet to change the behavior of * uppercasing. do_toupper() must always return the same result for * the same input. * * @param __lo Pointer to start of range. * @param __hi Pointer to end of range. * @return @a __hi. */ virtual const char_type* do_toupper(char_type* __lo, const char_type* __hi) const = 0; /** * @brief Convert to lowercase. * * This virtual function converts the argument to lowercase if * possible. If not possible (for example, '2'), returns the argument. * * do_tolower() is a hook for a derived facet to change the behavior of * lowercasing. do_tolower() must always return the same result for * the same input. * * @param __c The char_type to convert. * @return The lowercase char_type if convertible, else @a __c. */ virtual char_type do_tolower(char_type __c) const = 0; /** * @brief Convert array to lowercase. * * This virtual function converts each char_type in the range [__lo,__hi) * to lowercase if possible. Other elements remain untouched. * * do_tolower() is a hook for a derived facet to change the behavior of * lowercasing. do_tolower() must always return the same result for * the same input. * * @param __lo Pointer to start of range. * @param __hi Pointer to end of range. * @return @a __hi. */ virtual const char_type* do_tolower(char_type* __lo, const char_type* __hi) const = 0; /** * @brief Widen char * * This virtual function converts the char to char_type using the * simplest reasonable transformation. * * do_widen() is a hook for a derived facet to change the behavior of * widening. do_widen() must always return the same result for the * same input. * * Note: this is not what you want for codepage conversions. See * codecvt for that. * * @param __c The char to convert. * @return The converted char_type */ virtual char_type do_widen(char __c) const = 0; /** * @brief Widen char array * * This function converts each char in the input to char_type using the * simplest reasonable transformation. * * do_widen() is a hook for a derived facet to change the behavior of * widening. do_widen() must always return the same result for the * same input. * * Note: this is not what you want for codepage conversions. See * codecvt for that. * * @param __lo Pointer to start range. * @param __hi Pointer to end of range. * @param __to Pointer to the destination array. * @return @a __hi. */ virtual const char* do_widen(const char* __lo, const char* __hi, char_type* __to) const = 0; /** * @brief Narrow char_type to char * * This virtual function converts the argument to char using the * simplest reasonable transformation. If the conversion fails, dfault * is returned instead. * * do_narrow() is a hook for a derived facet to change the behavior of * narrowing. do_narrow() must always return the same result for the * same input. * * Note: this is not what you want for codepage conversions. See * codecvt for that. * * @param __c The char_type to convert. * @param __dfault Char to return if conversion fails. * @return The converted char. */ virtual char do_narrow(char_type __c, char __dfault) const = 0; /** * @brief Narrow char_type array to char * * This virtual function converts each char_type in the range * [__lo,__hi) to char using the simplest reasonable * transformation and writes the results to the destination * array. For any element in the input that cannot be * converted, @a __dfault is used instead. * * do_narrow() is a hook for a derived facet to change the behavior of * narrowing. do_narrow() must always return the same result for the * same input. * * Note: this is not what you want for codepage conversions. See * codecvt for that. * * @param __lo Pointer to start of range. * @param __hi Pointer to end of range. * @param __dfault Char to use if conversion fails. * @param __to Pointer to the destination array. * @return @a __hi. */ virtual const char_type* do_narrow(const char_type* __lo, const char_type* __hi, char __dfault, char* __to) const = 0; }; /** * @brief Primary class template ctype facet. * @ingroup locales * * This template class defines classification and conversion functions for * character sets. It wraps cctype functionality. Ctype gets used by * streams for many I/O operations. * * This template provides the protected virtual functions the developer * will have to replace in a derived class or specialization to make a * working facet. The public functions that access them are defined in * __ctype_abstract_base, to allow for implementation flexibility. See * ctype for an example. The functions are documented in * __ctype_abstract_base. * * Note: implementations are provided for all the protected virtual * functions, but will likely not be useful. */ template class ctype : public __ctype_abstract_base<_CharT> { public: // Types: typedef _CharT char_type; typedef typename __ctype_abstract_base<_CharT>::mask mask; /// The facet id for ctype static locale::id id; explicit ctype(size_t __refs = 0) : __ctype_abstract_base<_CharT>(__refs) { } protected: virtual ~ctype(); virtual bool do_is(mask __m, char_type __c) const; virtual const char_type* do_is(const char_type* __lo, const char_type* __hi, mask* __vec) const; virtual const char_type* do_scan_is(mask __m, const char_type* __lo, const char_type* __hi) const; virtual const char_type* do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const; virtual char_type do_toupper(char_type __c) const; virtual const char_type* do_toupper(char_type* __lo, const char_type* __hi) const; virtual char_type do_tolower(char_type __c) const; virtual const char_type* do_tolower(char_type* __lo, const char_type* __hi) const; virtual char_type do_widen(char __c) const; virtual const char* do_widen(const char* __lo, const char* __hi, char_type* __dest) const; virtual char do_narrow(char_type, char __dfault) const; virtual const char_type* do_narrow(const char_type* __lo, const char_type* __hi, char __dfault, char* __to) const; }; template locale::id ctype<_CharT>::id; /** * @brief The ctype specialization. * @ingroup locales * * This class defines classification and conversion functions for * the char type. It gets used by char streams for many I/O * operations. The char specialization provides a number of * optimizations as well. */ template<> class ctype : public locale::facet, public ctype_base { public: // Types: /// Typedef for the template parameter char. typedef char char_type; protected: // Data Members: __c_locale _M_c_locale_ctype; bool _M_del; __to_type _M_toupper; __to_type _M_tolower; const mask* _M_table; mutable char _M_widen_ok; mutable char _M_widen[1 + static_cast(-1)]; mutable char _M_narrow[1 + static_cast(-1)]; mutable char _M_narrow_ok; // 0 uninitialized, 1 init, // 2 memcpy can't be used public: /// The facet id for ctype static locale::id id; /// The size of the mask table. It is SCHAR_MAX + 1. static const size_t table_size = 1 + static_cast(-1); /** * @brief Constructor performs initialization. * * This is the constructor provided by the standard. * * @param __table If non-zero, table is used as the per-char mask. * Else classic_table() is used. * @param __del If true, passes ownership of table to this facet. * @param __refs Passed to the base facet class. */ explicit ctype(const mask* __table = 0, bool __del = false, size_t __refs = 0); /** * @brief Constructor performs static initialization. * * This constructor is used to construct the initial C locale facet. * * @param __cloc Handle to C locale data. * @param __table If non-zero, table is used as the per-char mask. * @param __del If true, passes ownership of table to this facet. * @param __refs Passed to the base facet class. */ explicit ctype(__c_locale __cloc, const mask* __table = 0, bool __del = false, size_t __refs = 0); /** * @brief Test char classification. * * This function compares the mask table[c] to @a __m. * * @param __c The char to compare the mask of. * @param __m The mask to compare against. * @return True if __m & table[__c] is true, false otherwise. */ inline bool is(mask __m, char __c) const; /** * @brief Return a mask array. * * This function finds the mask for each char in the range [lo, hi) and * successively writes it to vec. vec must have as many elements as * the char array. * * @param __lo Pointer to start of range. * @param __hi Pointer to end of range. * @param __vec Pointer to an array of mask storage. * @return @a __hi. */ inline const char* is(const char* __lo, const char* __hi, mask* __vec) const; /** * @brief Find char matching a mask * * This function searches for and returns the first char in [lo,hi) for * which is(m,char) is true. * * @param __m The mask to compare against. * @param __lo Pointer to start of range. * @param __hi Pointer to end of range. * @return Pointer to a matching char if found, else @a __hi. */ inline const char* scan_is(mask __m, const char* __lo, const char* __hi) const; /** * @brief Find char not matching a mask * * This function searches for and returns a pointer to the first char * in [__lo,__hi) for which is(m,char) is false. * * @param __m The mask to compare against. * @param __lo Pointer to start of range. * @param __hi Pointer to end of range. * @return Pointer to a non-matching char if found, else @a __hi. */ inline const char* scan_not(mask __m, const char* __lo, const char* __hi) const; /** * @brief Convert to uppercase. * * This function converts the char argument to uppercase if possible. * If not possible (for example, '2'), returns the argument. * * toupper() acts as if it returns ctype::do_toupper(c). * do_toupper() must always return the same result for the same input. * * @param __c The char to convert. * @return The uppercase char if convertible, else @a __c. */ char_type toupper(char_type __c) const { return this->do_toupper(__c); } /** * @brief Convert array to uppercase. * * This function converts each char in the range [__lo,__hi) to uppercase * if possible. Other chars remain untouched. * * toupper() acts as if it returns ctype:: do_toupper(__lo, __hi). * do_toupper() must always return the same result for the same input. * * @param __lo Pointer to first char in range. * @param __hi Pointer to end of range. * @return @a __hi. */ const char_type* toupper(char_type *__lo, const char_type* __hi) const { return this->do_toupper(__lo, __hi); } /** * @brief Convert to lowercase. * * This function converts the char argument to lowercase if possible. * If not possible (for example, '2'), returns the argument. * * tolower() acts as if it returns ctype::do_tolower(__c). * do_tolower() must always return the same result for the same input. * * @param __c The char to convert. * @return The lowercase char if convertible, else @a __c. */ char_type tolower(char_type __c) const { return this->do_tolower(__c); } /** * @brief Convert array to lowercase. * * This function converts each char in the range [lo,hi) to lowercase * if possible. Other chars remain untouched. * * tolower() acts as if it returns ctype:: do_tolower(__lo, __hi). * do_tolower() must always return the same result for the same input. * * @param __lo Pointer to first char in range. * @param __hi Pointer to end of range. * @return @a __hi. */ const char_type* tolower(char_type* __lo, const char_type* __hi) const { return this->do_tolower(__lo, __hi); } /** * @brief Widen char * * This function converts the char to char_type using the simplest * reasonable transformation. For an underived ctype facet, the * argument will be returned unchanged. * * This function works as if it returns ctype::do_widen(c). * do_widen() must always return the same result for the same input. * * Note: this is not what you want for codepage conversions. See * codecvt for that. * * @param __c The char to convert. * @return The converted character. */ char_type widen(char __c) const { if (_M_widen_ok) return _M_widen[static_cast(__c)]; this->_M_widen_init(); return this->do_widen(__c); } /** * @brief Widen char array * * This function converts each char in the input to char using the * simplest reasonable transformation. For an underived ctype * facet, the argument will be copied unchanged. * * This function works as if it returns ctype::do_widen(c). * do_widen() must always return the same result for the same input. * * Note: this is not what you want for codepage conversions. See * codecvt for that. * * @param __lo Pointer to first char in range. * @param __hi Pointer to end of range. * @param __to Pointer to the destination array. * @return @a __hi. */ const char* widen(const char* __lo, const char* __hi, char_type* __to) const { if (_M_widen_ok == 1) { __builtin_memcpy(__to, __lo, __hi - __lo); return __hi; } if (!_M_widen_ok) _M_widen_init(); return this->do_widen(__lo, __hi, __to); } /** * @brief Narrow char * * This function converts the char to char using the simplest * reasonable transformation. If the conversion fails, dfault is * returned instead. For an underived ctype facet, @a c * will be returned unchanged. * * This function works as if it returns ctype::do_narrow(c). * do_narrow() must always return the same result for the same input. * * Note: this is not what you want for codepage conversions. See * codecvt for that. * * @param __c The char to convert. * @param __dfault Char to return if conversion fails. * @return The converted character. */ char narrow(char_type __c, char __dfault) const { if (_M_narrow[static_cast(__c)]) return _M_narrow[static_cast(__c)]; const char __t = do_narrow(__c, __dfault); if (__t != __dfault) _M_narrow[static_cast(__c)] = __t; return __t; } /** * @brief Narrow char array * * This function converts each char in the input to char using the * simplest reasonable transformation and writes the results to the * destination array. For any char in the input that cannot be * converted, @a dfault is used instead. For an underived ctype * facet, the argument will be copied unchanged. * * This function works as if it returns ctype::do_narrow(lo, hi, * dfault, to). do_narrow() must always return the same result for the * same input. * * Note: this is not what you want for codepage conversions. See * codecvt for that. * * @param __lo Pointer to start of range. * @param __hi Pointer to end of range. * @param __dfault Char to use if conversion fails. * @param __to Pointer to the destination array. * @return @a __hi. */ const char_type* narrow(const char_type* __lo, const char_type* __hi, char __dfault, char* __to) const { if (__builtin_expect(_M_narrow_ok == 1, true)) { __builtin_memcpy(__to, __lo, __hi - __lo); return __hi; } if (!_M_narrow_ok) _M_narrow_init(); return this->do_narrow(__lo, __hi, __dfault, __to); } // _GLIBCXX_RESOLVE_LIB_DEFECTS // DR 695. ctype::classic_table() not accessible. /// Returns a pointer to the mask table provided to the constructor, or /// the default from classic_table() if none was provided. const mask* table() const throw() { return _M_table; } /// Returns a pointer to the C locale mask table. static const mask* classic_table() throw(); protected: /** * @brief Destructor. * * This function deletes table() if @a del was true in the * constructor. */ virtual ~ctype(); /** * @brief Convert to uppercase. * * This virtual function converts the char argument to uppercase if * possible. If not possible (for example, '2'), returns the argument. * * do_toupper() is a hook for a derived facet to change the behavior of * uppercasing. do_toupper() must always return the same result for * the same input. * * @param __c The char to convert. * @return The uppercase char if convertible, else @a __c. */ virtual char_type do_toupper(char_type __c) const; /** * @brief Convert array to uppercase. * * This virtual function converts each char in the range [lo,hi) to * uppercase if possible. Other chars remain untouched. * * do_toupper() is a hook for a derived facet to change the behavior of * uppercasing. do_toupper() must always return the same result for * the same input. * * @param __lo Pointer to start of range. * @param __hi Pointer to end of range. * @return @a __hi. */ virtual const char_type* do_toupper(char_type* __lo, const char_type* __hi) const; /** * @brief Convert to lowercase. * * This virtual function converts the char argument to lowercase if * possible. If not possible (for example, '2'), returns the argument. * * do_tolower() is a hook for a derived facet to change the behavior of * lowercasing. do_tolower() must always return the same result for * the same input. * * @param __c The char to convert. * @return The lowercase char if convertible, else @a __c. */ virtual char_type do_tolower(char_type __c) const; /** * @brief Convert array to lowercase. * * This virtual function converts each char in the range [lo,hi) to * lowercase if possible. Other chars remain untouched. * * do_tolower() is a hook for a derived facet to change the behavior of * lowercasing. do_tolower() must always return the same result for * the same input. * * @param __lo Pointer to first char in range. * @param __hi Pointer to end of range. * @return @a __hi. */ virtual const char_type* do_tolower(char_type* __lo, const char_type* __hi) const; /** * @brief Widen char * * This virtual function converts the char to char using the simplest * reasonable transformation. For an underived ctype facet, the * argument will be returned unchanged. * * do_widen() is a hook for a derived facet to change the behavior of * widening. do_widen() must always return the same result for the * same input. * * Note: this is not what you want for codepage conversions. See * codecvt for that. * * @param __c The char to convert. * @return The converted character. */ virtual char_type do_widen(char __c) const { return __c; } /** * @brief Widen char array * * This function converts each char in the range [lo,hi) to char using * the simplest reasonable transformation. For an underived * ctype facet, the argument will be copied unchanged. * * do_widen() is a hook for a derived facet to change the behavior of * widening. do_widen() must always return the same result for the * same input. * * Note: this is not what you want for codepage conversions. See * codecvt for that. * * @param __lo Pointer to start of range. * @param __hi Pointer to end of range. * @param __to Pointer to the destination array. * @return @a __hi. */ virtual const char* do_widen(const char* __lo, const char* __hi, char_type* __to) const { __builtin_memcpy(__to, __lo, __hi - __lo); return __hi; } /** * @brief Narrow char * * This virtual function converts the char to char using the simplest * reasonable transformation. If the conversion fails, dfault is * returned instead. For an underived ctype facet, @a c will be * returned unchanged. * * do_narrow() is a hook for a derived facet to change the behavior of * narrowing. do_narrow() must always return the same result for the * same input. * * Note: this is not what you want for codepage conversions. See * codecvt for that. * * @param __c The char to convert. * @param __dfault Char to return if conversion fails. * @return The converted char. */ virtual char do_narrow(char_type __c, char __dfault) const { return __c; } /** * @brief Narrow char array to char array * * This virtual function converts each char in the range [lo,hi) to * char using the simplest reasonable transformation and writes the * results to the destination array. For any char in the input that * cannot be converted, @a dfault is used instead. For an underived * ctype facet, the argument will be copied unchanged. * * do_narrow() is a hook for a derived facet to change the behavior of * narrowing. do_narrow() must always return the same result for the * same input. * * Note: this is not what you want for codepage conversions. See * codecvt for that. * * @param __lo Pointer to start of range. * @param __hi Pointer to end of range. * @param __dfault Char to use if conversion fails. * @param __to Pointer to the destination array. * @return @a __hi. */ virtual const char_type* do_narrow(const char_type* __lo, const char_type* __hi, char __dfault, char* __to) const { __builtin_memcpy(__to, __lo, __hi - __lo); return __hi; } private: void _M_narrow_init() const; void _M_widen_init() const; }; #ifdef _GLIBCXX_USE_WCHAR_T /** * @brief The ctype specialization. * @ingroup locales * * This class defines classification and conversion functions for the * wchar_t type. It gets used by wchar_t streams for many I/O operations. * The wchar_t specialization provides a number of optimizations as well. * * ctype inherits its public methods from * __ctype_abstract_base. */ template<> class ctype : public __ctype_abstract_base { public: // Types: /// Typedef for the template parameter wchar_t. typedef wchar_t char_type; typedef wctype_t __wmask_type; protected: __c_locale _M_c_locale_ctype; // Pre-computed narrowed and widened chars. bool _M_narrow_ok; char _M_narrow[128]; wint_t _M_widen[1 + static_cast(-1)]; // Pre-computed elements for do_is. mask _M_bit[16]; __wmask_type _M_wmask[16]; public: // Data Members: /// The facet id for ctype static locale::id id; /** * @brief Constructor performs initialization. * * This is the constructor provided by the standard. * * @param __refs Passed to the base facet class. */ explicit ctype(size_t __refs = 0); /** * @brief Constructor performs static initialization. * * This constructor is used to construct the initial C locale facet. * * @param __cloc Handle to C locale data. * @param __refs Passed to the base facet class. */ explicit ctype(__c_locale __cloc, size_t __refs = 0); protected: __wmask_type _M_convert_to_wmask(const mask __m) const throw(); /// Destructor virtual ~ctype(); /** * @brief Test wchar_t classification. * * This function finds a mask M for @a c and compares it to mask @a m. * * do_is() is a hook for a derived facet to change the behavior of * classifying. do_is() must always return the same result for the * same input. * * @param __c The wchar_t to find the mask of. * @param __m The mask to compare against. * @return (M & __m) != 0. */ virtual bool do_is(mask __m, char_type __c) const; /** * @brief Return a mask array. * * This function finds the mask for each wchar_t in the range [lo,hi) * and successively writes it to vec. vec must have as many elements * as the input. * * do_is() is a hook for a derived facet to change the behavior of * classifying. do_is() must always return the same result for the * same input. * * @param __lo Pointer to start of range. * @param __hi Pointer to end of range. * @param __vec Pointer to an array of mask storage. * @return @a __hi. */ virtual const char_type* do_is(const char_type* __lo, const char_type* __hi, mask* __vec) const; /** * @brief Find wchar_t matching mask * * This function searches for and returns the first wchar_t c in * [__lo,__hi) for which is(__m,c) is true. * * do_scan_is() is a hook for a derived facet to change the behavior of * match searching. do_is() must always return the same result for the * same input. * * @param __m The mask to compare against. * @param __lo Pointer to start of range. * @param __hi Pointer to end of range. * @return Pointer to a matching wchar_t if found, else @a __hi. */ virtual const char_type* do_scan_is(mask __m, const char_type* __lo, const char_type* __hi) const; /** * @brief Find wchar_t not matching mask * * This function searches for and returns a pointer to the first * wchar_t c of [__lo,__hi) for which is(__m,c) is false. * * do_scan_is() is a hook for a derived facet to change the behavior of * match searching. do_is() must always return the same result for the * same input. * * @param __m The mask to compare against. * @param __lo Pointer to start of range. * @param __hi Pointer to end of range. * @return Pointer to a non-matching wchar_t if found, else @a __hi. */ virtual const char_type* do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const; /** * @brief Convert to uppercase. * * This virtual function converts the wchar_t argument to uppercase if * possible. If not possible (for example, '2'), returns the argument. * * do_toupper() is a hook for a derived facet to change the behavior of * uppercasing. do_toupper() must always return the same result for * the same input. * * @param __c The wchar_t to convert. * @return The uppercase wchar_t if convertible, else @a __c. */ virtual char_type do_toupper(char_type __c) const; /** * @brief Convert array to uppercase. * * This virtual function converts each wchar_t in the range [lo,hi) to * uppercase if possible. Other elements remain untouched. * * do_toupper() is a hook for a derived facet to change the behavior of * uppercasing. do_toupper() must always return the same result for * the same input. * * @param __lo Pointer to start of range. * @param __hi Pointer to end of range. * @return @a __hi. */ virtual const char_type* do_toupper(char_type* __lo, const char_type* __hi) const; /** * @brief Convert to lowercase. * * This virtual function converts the argument to lowercase if * possible. If not possible (for example, '2'), returns the argument. * * do_tolower() is a hook for a derived facet to change the behavior of * lowercasing. do_tolower() must always return the same result for * the same input. * * @param __c The wchar_t to convert. * @return The lowercase wchar_t if convertible, else @a __c. */ virtual char_type do_tolower(char_type __c) const; /** * @brief Convert array to lowercase. * * This virtual function converts each wchar_t in the range [lo,hi) to * lowercase if possible. Other elements remain untouched. * * do_tolower() is a hook for a derived facet to change the behavior of * lowercasing. do_tolower() must always return the same result for * the same input. * * @param __lo Pointer to start of range. * @param __hi Pointer to end of range. * @return @a __hi. */ virtual const char_type* do_tolower(char_type* __lo, const char_type* __hi) const; /** * @brief Widen char to wchar_t * * This virtual function converts the char to wchar_t using the * simplest reasonable transformation. For an underived ctype * facet, the argument will be cast to wchar_t. * * do_widen() is a hook for a derived facet to change the behavior of * widening. do_widen() must always return the same result for the * same input. * * Note: this is not what you want for codepage conversions. See * codecvt for that. * * @param __c The char to convert. * @return The converted wchar_t. */ virtual char_type do_widen(char __c) const; /** * @brief Widen char array to wchar_t array * * This function converts each char in the input to wchar_t using the * simplest reasonable transformation. For an underived ctype * facet, the argument will be copied, casting each element to wchar_t. * * do_widen() is a hook for a derived facet to change the behavior of * widening. do_widen() must always return the same result for the * same input. * * Note: this is not what you want for codepage conversions. See * codecvt for that. * * @param __lo Pointer to start range. * @param __hi Pointer to end of range. * @param __to Pointer to the destination array. * @return @a __hi. */ virtual const char* do_widen(const char* __lo, const char* __hi, char_type* __to) const; /** * @brief Narrow wchar_t to char * * This virtual function converts the argument to char using * the simplest reasonable transformation. If the conversion * fails, dfault is returned instead. For an underived * ctype facet, @a c will be cast to char and * returned. * * do_narrow() is a hook for a derived facet to change the * behavior of narrowing. do_narrow() must always return the * same result for the same input. * * Note: this is not what you want for codepage conversions. See * codecvt for that. * * @param __c The wchar_t to convert. * @param __dfault Char to return if conversion fails. * @return The converted char. */ virtual char do_narrow(char_type __c, char __dfault) const; /** * @brief Narrow wchar_t array to char array * * This virtual function converts each wchar_t in the range [lo,hi) to * char using the simplest reasonable transformation and writes the * results to the destination array. For any wchar_t in the input that * cannot be converted, @a dfault is used instead. For an underived * ctype facet, the argument will be copied, casting each * element to char. * * do_narrow() is a hook for a derived facet to change the behavior of * narrowing. do_narrow() must always return the same result for the * same input. * * Note: this is not what you want for codepage conversions. See * codecvt for that. * * @param __lo Pointer to start of range. * @param __hi Pointer to end of range. * @param __dfault Char to use if conversion fails. * @param __to Pointer to the destination array. * @return @a __hi. */ virtual const char_type* do_narrow(const char_type* __lo, const char_type* __hi, char __dfault, char* __to) const; // For use at construction time only. void _M_initialize_ctype() throw(); }; #endif //_GLIBCXX_USE_WCHAR_T # 1471 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets.h" 3 /// class ctype_byname [22.2.1.2]. template class ctype_byname : public ctype<_CharT> { public: typedef typename ctype<_CharT>::mask mask; explicit ctype_byname(const char* __s, size_t __refs = 0); #if __cplusplus >= 201103L explicit ctype_byname(const string& __s, size_t __refs = 0) : ctype_byname(__s.c_str(), __refs) { } #endif # 1487 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets.h" 3 protected: virtual ~ctype_byname() { }; }; /// 22.2.1.4 Class ctype_byname specializations. template<> class ctype_byname : public ctype { public: explicit ctype_byname(const char* __s, size_t __refs = 0); #if __cplusplus >= 201103L explicit ctype_byname(const string& __s, size_t __refs = 0); #endif # 1505 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets.h" 3 protected: virtual ~ctype_byname(); }; #ifdef _GLIBCXX_USE_WCHAR_T template<> class ctype_byname : public ctype { public: explicit ctype_byname(const char* __s, size_t __refs = 0); #if __cplusplus >= 201103L explicit ctype_byname(const string& __s, size_t __refs = 0); #endif # 1523 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets.h" 3 protected: virtual ~ctype_byname(); }; #endif # 1529 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets.h" 3 _GLIBCXX_END_NAMESPACE_VERSION } // namespace // Include host and configuration specific ctype inlines. #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 1534 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/ctype_inline.h" 1 3 // Locale support -*- C++ -*- // Copyright (C) 2000-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file bits/ctype_inline.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{locale} */ // // ISO C++ 14882: 22.1 Locales // // ctype bits to be inlined go here. Non-inlinable (ie virtual do_*) // functions go in ctype.cc namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION bool ctype:: is(mask __m, char __c) const { return _M_table[static_cast(__c)] & __m; } const char* ctype:: is(const char* __low, const char* __high, mask* __vec) const { while (__low < __high) *__vec++ = _M_table[static_cast(*__low++)]; return __high; } const char* ctype:: scan_is(mask __m, const char* __low, const char* __high) const { while (__low < __high && !(_M_table[static_cast(*__low)] & __m)) ++__low; return __low; } const char* ctype:: scan_not(mask __m, const char* __low, const char* __high) const { while (__low < __high && (_M_table[static_cast(*__low)] & __m) != 0) ++__low; return __low; } _GLIBCXX_END_NAMESPACE_VERSION } // namespace # 1535 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets.h" 2 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION // 22.2.2 The numeric category. class __num_base { public: // NB: Code depends on the order of _S_atoms_out elements. // Below are the indices into _S_atoms_out. enum { _S_ominus, _S_oplus, _S_ox, _S_oX, _S_odigits, _S_odigits_end = _S_odigits + 16, _S_oudigits = _S_odigits_end, _S_oudigits_end = _S_oudigits + 16, _S_oe = _S_odigits + 14, // For scientific notation, 'e' _S_oE = _S_oudigits + 14, // For scientific notation, 'E' _S_oend = _S_oudigits_end }; // A list of valid numeric literals for output. This array // contains chars that will be passed through the current locale's // ctype<_CharT>.widen() and then used to render numbers. // For the standard "C" locale, this is // "-+xX0123456789abcdef0123456789ABCDEF". static const char* _S_atoms_out; // String literal of acceptable (narrow) input, for num_get. // "-+xX0123456789abcdefABCDEF" static const char* _S_atoms_in; enum { _S_iminus, _S_iplus, _S_ix, _S_iX, _S_izero, _S_ie = _S_izero + 14, _S_iE = _S_izero + 20, _S_iend = 26 }; // num_put // Construct and return valid scanf format for floating point types. static void _S_format_float(const ios_base& __io, char* __fptr, char __mod) throw(); }; template struct __numpunct_cache : public locale::facet { const char* _M_grouping; size_t _M_grouping_size; bool _M_use_grouping; const _CharT* _M_truename; size_t _M_truename_size; const _CharT* _M_falsename; size_t _M_falsename_size; _CharT _M_decimal_point; _CharT _M_thousands_sep; // A list of valid numeric literals for output: in the standard // "C" locale, this is "-+xX0123456789abcdef0123456789ABCDEF". // This array contains the chars after having been passed // through the current locale's ctype<_CharT>.widen(). _CharT _M_atoms_out[__num_base::_S_oend]; // A list of valid numeric literals for input: in the standard // "C" locale, this is "-+xX0123456789abcdefABCDEF" // This array contains the chars after having been passed // through the current locale's ctype<_CharT>.widen(). _CharT _M_atoms_in[__num_base::_S_iend]; bool _M_allocated; __numpunct_cache(size_t __refs = 0) : facet(__refs), _M_grouping(0), _M_grouping_size(0), _M_use_grouping(false), _M_truename(0), _M_truename_size(0), _M_falsename(0), _M_falsename_size(0), _M_decimal_point(_CharT()), _M_thousands_sep(_CharT()), _M_allocated(false) { } ~__numpunct_cache(); void _M_cache(const locale& __loc); private: __numpunct_cache& operator=(const __numpunct_cache&); explicit __numpunct_cache(const __numpunct_cache&); }; template __numpunct_cache<_CharT>::~__numpunct_cache() { if (_M_allocated) { delete [] _M_grouping; delete [] _M_truename; delete [] _M_falsename; } } _GLIBCXX_BEGIN_NAMESPACE_CXX11 /** * @brief Primary class template numpunct. * @ingroup locales * * This facet stores several pieces of information related to printing and * scanning numbers, such as the decimal point character. It takes a * template parameter specifying the char type. The numpunct facet is * used by streams for many I/O operations involving numbers. * * The numpunct template uses protected virtual functions to provide the * actual results. The public accessors forward the call to the virtual * functions. These virtual functions are hooks for developers to * implement the behavior they require from a numpunct facet. */ template class numpunct : public locale::facet { public: // Types: //@{ /// Public typedefs typedef _CharT char_type; typedef basic_string<_CharT> string_type; //@} typedef __numpunct_cache<_CharT> __cache_type; protected: __cache_type* _M_data; public: /// Numpunct facet id. static locale::id id; /** * @brief Numpunct constructor. * * @param __refs Refcount to pass to the base class. */ explicit numpunct(size_t __refs = 0) : facet(__refs), _M_data(0) { _M_initialize_numpunct(); } /** * @brief Internal constructor. Not for general use. * * This is a constructor for use by the library itself to set up the * predefined locale facets. * * @param __cache __numpunct_cache object. * @param __refs Refcount to pass to the base class. */ explicit numpunct(__cache_type* __cache, size_t __refs = 0) : facet(__refs), _M_data(__cache) { _M_initialize_numpunct(); } /** * @brief Internal constructor. Not for general use. * * This is a constructor for use by the library itself to set up new * locales. * * @param __cloc The C locale. * @param __refs Refcount to pass to the base class. */ explicit numpunct(__c_locale __cloc, size_t __refs = 0) : facet(__refs), _M_data(0) { _M_initialize_numpunct(__cloc); } /** * @brief Return decimal point character. * * This function returns a char_type to use as a decimal point. It * does so by returning returning * numpunct::do_decimal_point(). * * @return @a char_type representing a decimal point. */ char_type decimal_point() const { return this->do_decimal_point(); } /** * @brief Return thousands separator character. * * This function returns a char_type to use as a thousands * separator. It does so by returning returning * numpunct::do_thousands_sep(). * * @return char_type representing a thousands separator. */ char_type thousands_sep() const { return this->do_thousands_sep(); } /** * @brief Return grouping specification. * * This function returns a string representing groupings for the * integer part of a number. Groupings indicate where thousands * separators should be inserted in the integer part of a number. * * Each char in the return string is interpret as an integer * rather than a character. These numbers represent the number * of digits in a group. The first char in the string * represents the number of digits in the least significant * group. If a char is negative, it indicates an unlimited * number of digits for the group. If more chars from the * string are required to group a number, the last char is used * repeatedly. * * For example, if the grouping() returns "\003\002" and is * applied to the number 123456789, this corresponds to * 12,34,56,789. Note that if the string was "32", this would * put more than 50 digits into the least significant group if * the character set is ASCII. * * The string is returned by calling * numpunct::do_grouping(). * * @return string representing grouping specification. */ string grouping() const { return this->do_grouping(); } /** * @brief Return string representation of bool true. * * This function returns a string_type containing the text * representation for true bool variables. It does so by calling * numpunct::do_truename(). * * @return string_type representing printed form of true. */ string_type truename() const { return this->do_truename(); } /** * @brief Return string representation of bool false. * * This function returns a string_type containing the text * representation for false bool variables. It does so by calling * numpunct::do_falsename(). * * @return string_type representing printed form of false. */ string_type falsename() const { return this->do_falsename(); } protected: /// Destructor. virtual ~numpunct(); /** * @brief Return decimal point character. * * Returns a char_type to use as a decimal point. This function is a * hook for derived classes to change the value returned. * * @return @a char_type representing a decimal point. */ virtual char_type do_decimal_point() const { return _M_data->_M_decimal_point; } /** * @brief Return thousands separator character. * * Returns a char_type to use as a thousands separator. This function * is a hook for derived classes to change the value returned. * * @return @a char_type representing a thousands separator. */ virtual char_type do_thousands_sep() const { return _M_data->_M_thousands_sep; } /** * @brief Return grouping specification. * * Returns a string representing groupings for the integer part of a * number. This function is a hook for derived classes to change the * value returned. @see grouping() for details. * * @return String representing grouping specification. */ virtual string do_grouping() const { return _M_data->_M_grouping; } /** * @brief Return string representation of bool true. * * Returns a string_type containing the text representation for true * bool variables. This function is a hook for derived classes to * change the value returned. * * @return string_type representing printed form of true. */ virtual string_type do_truename() const { return _M_data->_M_truename; } /** * @brief Return string representation of bool false. * * Returns a string_type containing the text representation for false * bool variables. This function is a hook for derived classes to * change the value returned. * * @return string_type representing printed form of false. */ virtual string_type do_falsename() const { return _M_data->_M_falsename; } // For use at construction time only. void _M_initialize_numpunct(__c_locale __cloc = 0); }; template locale::id numpunct<_CharT>::id; template<> numpunct::~numpunct(); template<> void numpunct::_M_initialize_numpunct(__c_locale __cloc); #ifdef _GLIBCXX_USE_WCHAR_T template<> numpunct::~numpunct(); template<> void numpunct::_M_initialize_numpunct(__c_locale __cloc); #endif # 1896 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets.h" 3 /// class numpunct_byname [22.2.3.2]. template class numpunct_byname : public numpunct<_CharT> { public: typedef _CharT char_type; typedef basic_string<_CharT> string_type; explicit numpunct_byname(const char* __s, size_t __refs = 0) : numpunct<_CharT>(__refs) { if (__builtin_strcmp(__s, "C") != 0 && __builtin_strcmp(__s, "POSIX") != 0) { __c_locale __tmp; this->_S_create_c_locale(__tmp, __s); this->_M_initialize_numpunct(__tmp); this->_S_destroy_c_locale(__tmp); } } #if __cplusplus >= 201103L explicit numpunct_byname(const string& __s, size_t __refs = 0) : numpunct_byname(__s.c_str(), __refs) { } #endif # 1924 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets.h" 3 protected: virtual ~numpunct_byname() { } }; _GLIBCXX_END_NAMESPACE_CXX11 _GLIBCXX_BEGIN_NAMESPACE_LDBL /** * @brief Primary class template num_get. * @ingroup locales * * This facet encapsulates the code to parse and return a number * from a string. It is used by the istream numeric extraction * operators. * * The num_get template uses protected virtual functions to provide the * actual results. The public accessors forward the call to the virtual * functions. These virtual functions are hooks for developers to * implement the behavior they require from the num_get facet. */ template class num_get : public locale::facet { public: // Types: //@{ /// Public typedefs typedef _CharT char_type; typedef _InIter iter_type; //@} /// Numpunct facet id. static locale::id id; /** * @brief Constructor performs initialization. * * This is the constructor provided by the standard. * * @param __refs Passed to the base facet class. */ explicit num_get(size_t __refs = 0) : facet(__refs) { } /** * @brief Numeric parsing. * * Parses the input stream into the bool @a v. It does so by calling * num_get::do_get(). * * If ios_base::boolalpha is set, attempts to read * ctype::truename() or ctype::falsename(). Sets * @a v to true or false if successful. Sets err to * ios_base::failbit if reading the string fails. Sets err to * ios_base::eofbit if the stream is emptied. * * If ios_base::boolalpha is not set, proceeds as with reading a long, * except if the value is 1, sets @a v to true, if the value is 0, sets * @a v to false, and otherwise set err to ios_base::failbit. * * @param __in Start of input stream. * @param __end End of input stream. * @param __io Source of locale and flags. * @param __err Error flags to set. * @param __v Value to format and insert. * @return Iterator after reading. */ iter_type get(iter_type __in, iter_type __end, ios_base& __io, ios_base::iostate& __err, bool& __v) const { return this->do_get(__in, __end, __io, __err, __v); } //@{ /** * @brief Numeric parsing. * * Parses the input stream into the integral variable @a v. It does so * by calling num_get::do_get(). * * Parsing is affected by the flag settings in @a io. * * The basic parse is affected by the value of io.flags() & * ios_base::basefield. If equal to ios_base::oct, parses like the * scanf %o specifier. Else if equal to ios_base::hex, parses like %X * specifier. Else if basefield equal to 0, parses like the %i * specifier. Otherwise, parses like %d for signed and %u for unsigned * types. The matching type length modifier is also used. * * Digit grouping is interpreted according to * numpunct::grouping() and numpunct::thousands_sep(). If the * pattern of digit groups isn't consistent, sets err to * ios_base::failbit. * * If parsing the string yields a valid value for @a v, @a v is set. * Otherwise, sets err to ios_base::failbit and leaves @a v unaltered. * Sets err to ios_base::eofbit if the stream is emptied. * * @param __in Start of input stream. * @param __end End of input stream. * @param __io Source of locale and flags. * @param __err Error flags to set. * @param __v Value to format and insert. * @return Iterator after reading. */ iter_type get(iter_type __in, iter_type __end, ios_base& __io, ios_base::iostate& __err, long& __v) const { return this->do_get(__in, __end, __io, __err, __v); } iter_type get(iter_type __in, iter_type __end, ios_base& __io, ios_base::iostate& __err, unsigned short& __v) const { return this->do_get(__in, __end, __io, __err, __v); } iter_type get(iter_type __in, iter_type __end, ios_base& __io, ios_base::iostate& __err, unsigned int& __v) const { return this->do_get(__in, __end, __io, __err, __v); } iter_type get(iter_type __in, iter_type __end, ios_base& __io, ios_base::iostate& __err, unsigned long& __v) const { return this->do_get(__in, __end, __io, __err, __v); } #ifdef _GLIBCXX_USE_LONG_LONG iter_type get(iter_type __in, iter_type __end, ios_base& __io, ios_base::iostate& __err, long long& __v) const { return this->do_get(__in, __end, __io, __err, __v); } iter_type get(iter_type __in, iter_type __end, ios_base& __io, ios_base::iostate& __err, unsigned long long& __v) const { return this->do_get(__in, __end, __io, __err, __v); } #endif # 2062 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets.h" 3 //@} //@{ /** * @brief Numeric parsing. * * Parses the input stream into the integral variable @a v. It does so * by calling num_get::do_get(). * * The input characters are parsed like the scanf %g specifier. The * matching type length modifier is also used. * * The decimal point character used is numpunct::decimal_point(). * Digit grouping is interpreted according to * numpunct::grouping() and numpunct::thousands_sep(). If the * pattern of digit groups isn't consistent, sets err to * ios_base::failbit. * * If parsing the string yields a valid value for @a v, @a v is set. * Otherwise, sets err to ios_base::failbit and leaves @a v unaltered. * Sets err to ios_base::eofbit if the stream is emptied. * * @param __in Start of input stream. * @param __end End of input stream. * @param __io Source of locale and flags. * @param __err Error flags to set. * @param __v Value to format and insert. * @return Iterator after reading. */ iter_type get(iter_type __in, iter_type __end, ios_base& __io, ios_base::iostate& __err, float& __v) const { return this->do_get(__in, __end, __io, __err, __v); } iter_type get(iter_type __in, iter_type __end, ios_base& __io, ios_base::iostate& __err, double& __v) const { return this->do_get(__in, __end, __io, __err, __v); } iter_type get(iter_type __in, iter_type __end, ios_base& __io, ios_base::iostate& __err, long double& __v) const { return this->do_get(__in, __end, __io, __err, __v); } //@} /** * @brief Numeric parsing. * * Parses the input stream into the pointer variable @a v. It does so * by calling num_get::do_get(). * * The input characters are parsed like the scanf %p specifier. * * Digit grouping is interpreted according to * numpunct::grouping() and numpunct::thousands_sep(). If the * pattern of digit groups isn't consistent, sets err to * ios_base::failbit. * * Note that the digit grouping effect for pointers is a bit ambiguous * in the standard and shouldn't be relied on. See DR 344. * * If parsing the string yields a valid value for @a v, @a v is set. * Otherwise, sets err to ios_base::failbit and leaves @a v unaltered. * Sets err to ios_base::eofbit if the stream is emptied. * * @param __in Start of input stream. * @param __end End of input stream. * @param __io Source of locale and flags. * @param __err Error flags to set. * @param __v Value to format and insert. * @return Iterator after reading. */ iter_type get(iter_type __in, iter_type __end, ios_base& __io, ios_base::iostate& __err, void*& __v) const { return this->do_get(__in, __end, __io, __err, __v); } protected: /// Destructor. virtual ~num_get() { } _GLIBCXX_DEFAULT_ABI_TAG iter_type _M_extract_float(iter_type, iter_type, ios_base&, ios_base::iostate&, string&) const; template _GLIBCXX_DEFAULT_ABI_TAG iter_type _M_extract_int(iter_type, iter_type, ios_base&, ios_base::iostate&, _ValueT&) const; template typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value, int>::__type _M_find(const _CharT2*, size_t __len, _CharT2 __c) const { int __ret = -1; if (__len <= 10) { if (__c >= _CharT2('0') && __c < _CharT2(_CharT2('0') + __len)) __ret = __c - _CharT2('0'); } else { if (__c >= _CharT2('0') && __c <= _CharT2('9')) __ret = __c - _CharT2('0'); else if (__c >= _CharT2('a') && __c <= _CharT2('f')) __ret = 10 + (__c - _CharT2('a')); else if (__c >= _CharT2('A') && __c <= _CharT2('F')) __ret = 10 + (__c - _CharT2('A')); } return __ret; } template typename __gnu_cxx::__enable_if::__value, int>::__type _M_find(const _CharT2* __zero, size_t __len, _CharT2 __c) const { int __ret = -1; const char_type* __q = char_traits<_CharT2>::find(__zero, __len, __c); if (__q) { __ret = __q - __zero; if (__ret > 15) __ret -= 6; } return __ret; } //@{ /** * @brief Numeric parsing. * * Parses the input stream into the variable @a v. This function is a * hook for derived classes to change the value returned. @see get() * for more details. * * @param __beg Start of input stream. * @param __end End of input stream. * @param __io Source of locale and flags. * @param __err Error flags to set. * @param __v Value to format and insert. * @return Iterator after reading. */ virtual iter_type do_get(iter_type, iter_type, ios_base&, ios_base::iostate&, bool&) const; virtual iter_type do_get(iter_type __beg, iter_type __end, ios_base& __io, ios_base::iostate& __err, long& __v) const { return _M_extract_int(__beg, __end, __io, __err, __v); } virtual iter_type do_get(iter_type __beg, iter_type __end, ios_base& __io, ios_base::iostate& __err, unsigned short& __v) const { return _M_extract_int(__beg, __end, __io, __err, __v); } virtual iter_type do_get(iter_type __beg, iter_type __end, ios_base& __io, ios_base::iostate& __err, unsigned int& __v) const { return _M_extract_int(__beg, __end, __io, __err, __v); } virtual iter_type do_get(iter_type __beg, iter_type __end, ios_base& __io, ios_base::iostate& __err, unsigned long& __v) const { return _M_extract_int(__beg, __end, __io, __err, __v); } #ifdef _GLIBCXX_USE_LONG_LONG virtual iter_type do_get(iter_type __beg, iter_type __end, ios_base& __io, ios_base::iostate& __err, long long& __v) const { return _M_extract_int(__beg, __end, __io, __err, __v); } virtual iter_type do_get(iter_type __beg, iter_type __end, ios_base& __io, ios_base::iostate& __err, unsigned long long& __v) const { return _M_extract_int(__beg, __end, __io, __err, __v); } #endif # 2241 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets.h" 3 virtual iter_type do_get(iter_type, iter_type, ios_base&, ios_base::iostate&, float&) const; virtual iter_type do_get(iter_type, iter_type, ios_base&, ios_base::iostate&, double&) const; // XXX GLIBCXX_ABI Deprecated #if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__ virtual iter_type __do_get(iter_type, iter_type, ios_base&, ios_base::iostate&, double&) const; #else # 2255 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets.h" 3 virtual iter_type do_get(iter_type, iter_type, ios_base&, ios_base::iostate&, long double&) const; #endif # 2259 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets.h" 3 virtual iter_type do_get(iter_type, iter_type, ios_base&, ios_base::iostate&, void*&) const; // XXX GLIBCXX_ABI Deprecated #if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__ virtual iter_type do_get(iter_type, iter_type, ios_base&, ios_base::iostate&, long double&) const; #endif # 2269 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets.h" 3 //@} }; template locale::id num_get<_CharT, _InIter>::id; /** * @brief Primary class template num_put. * @ingroup locales * * This facet encapsulates the code to convert a number to a string. It is * used by the ostream numeric insertion operators. * * The num_put template uses protected virtual functions to provide the * actual results. The public accessors forward the call to the virtual * functions. These virtual functions are hooks for developers to * implement the behavior they require from the num_put facet. */ template class num_put : public locale::facet { public: // Types: //@{ /// Public typedefs typedef _CharT char_type; typedef _OutIter iter_type; //@} /// Numpunct facet id. static locale::id id; /** * @brief Constructor performs initialization. * * This is the constructor provided by the standard. * * @param __refs Passed to the base facet class. */ explicit num_put(size_t __refs = 0) : facet(__refs) { } /** * @brief Numeric formatting. * * Formats the boolean @a v and inserts it into a stream. It does so * by calling num_put::do_put(). * * If ios_base::boolalpha is set, writes ctype::truename() or * ctype::falsename(). Otherwise formats @a v as an int. * * @param __s Stream to write to. * @param __io Source of locale and flags. * @param __fill Char_type to use for filling. * @param __v Value to format and insert. * @return Iterator after writing. */ iter_type put(iter_type __s, ios_base& __io, char_type __fill, bool __v) const { return this->do_put(__s, __io, __fill, __v); } //@{ /** * @brief Numeric formatting. * * Formats the integral value @a v and inserts it into a * stream. It does so by calling num_put::do_put(). * * Formatting is affected by the flag settings in @a io. * * The basic format is affected by the value of io.flags() & * ios_base::basefield. If equal to ios_base::oct, formats like the * printf %o specifier. Else if equal to ios_base::hex, formats like * %x or %X with ios_base::uppercase unset or set respectively. * Otherwise, formats like %d, %ld, %lld for signed and %u, %lu, %llu * for unsigned values. Note that if both oct and hex are set, neither * will take effect. * * If ios_base::showpos is set, '+' is output before positive values. * If ios_base::showbase is set, '0' precedes octal values (except 0) * and '0[xX]' precedes hex values. * * The decimal point character used is numpunct::decimal_point(). * Thousands separators are inserted according to * numpunct::grouping() and numpunct::thousands_sep(). * * If io.width() is non-zero, enough @a fill characters are inserted to * make the result at least that wide. If * (io.flags() & ios_base::adjustfield) == ios_base::left, result is * padded at the end. If ios_base::internal, then padding occurs * immediately after either a '+' or '-' or after '0x' or '0X'. * Otherwise, padding occurs at the beginning. * * @param __s Stream to write to. * @param __io Source of locale and flags. * @param __fill Char_type to use for filling. * @param __v Value to format and insert. * @return Iterator after writing. */ iter_type put(iter_type __s, ios_base& __io, char_type __fill, long __v) const { return this->do_put(__s, __io, __fill, __v); } iter_type put(iter_type __s, ios_base& __io, char_type __fill, unsigned long __v) const { return this->do_put(__s, __io, __fill, __v); } #ifdef _GLIBCXX_USE_LONG_LONG iter_type put(iter_type __s, ios_base& __io, char_type __fill, long long __v) const { return this->do_put(__s, __io, __fill, __v); } iter_type put(iter_type __s, ios_base& __io, char_type __fill, unsigned long long __v) const { return this->do_put(__s, __io, __fill, __v); } #endif # 2388 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets.h" 3 //@} //@{ /** * @brief Numeric formatting. * * Formats the floating point value @a v and inserts it into a stream. * It does so by calling num_put::do_put(). * * Formatting is affected by the flag settings in @a io. * * The basic format is affected by the value of io.flags() & * ios_base::floatfield. If equal to ios_base::fixed, formats like the * printf %f specifier. Else if equal to ios_base::scientific, formats * like %e or %E with ios_base::uppercase unset or set respectively. * Otherwise, formats like %g or %G depending on uppercase. Note that * if both fixed and scientific are set, the effect will also be like * %g or %G. * * The output precision is given by io.precision(). This precision is * capped at numeric_limits::digits10 + 2 (different for double and * long double). The default precision is 6. * * If ios_base::showpos is set, '+' is output before positive values. * If ios_base::showpoint is set, a decimal point will always be * output. * * The decimal point character used is numpunct::decimal_point(). * Thousands separators are inserted according to * numpunct::grouping() and numpunct::thousands_sep(). * * If io.width() is non-zero, enough @a fill characters are inserted to * make the result at least that wide. If * (io.flags() & ios_base::adjustfield) == ios_base::left, result is * padded at the end. If ios_base::internal, then padding occurs * immediately after either a '+' or '-' or after '0x' or '0X'. * Otherwise, padding occurs at the beginning. * * @param __s Stream to write to. * @param __io Source of locale and flags. * @param __fill Char_type to use for filling. * @param __v Value to format and insert. * @return Iterator after writing. */ iter_type put(iter_type __s, ios_base& __io, char_type __fill, double __v) const { return this->do_put(__s, __io, __fill, __v); } iter_type put(iter_type __s, ios_base& __io, char_type __fill, long double __v) const { return this->do_put(__s, __io, __fill, __v); } //@} /** * @brief Numeric formatting. * * Formats the pointer value @a v and inserts it into a stream. It * does so by calling num_put::do_put(). * * This function formats @a v as an unsigned long with ios_base::hex * and ios_base::showbase set. * * @param __s Stream to write to. * @param __io Source of locale and flags. * @param __fill Char_type to use for filling. * @param __v Value to format and insert. * @return Iterator after writing. */ iter_type put(iter_type __s, ios_base& __io, char_type __fill, const void* __v) const { return this->do_put(__s, __io, __fill, __v); } protected: template iter_type _M_insert_float(iter_type, ios_base& __io, char_type __fill, char __mod, _ValueT __v) const; void _M_group_float(const char* __grouping, size_t __grouping_size, char_type __sep, const char_type* __p, char_type* __new, char_type* __cs, int& __len) const; template iter_type _M_insert_int(iter_type, ios_base& __io, char_type __fill, _ValueT __v) const; void _M_group_int(const char* __grouping, size_t __grouping_size, char_type __sep, ios_base& __io, char_type* __new, char_type* __cs, int& __len) const; void _M_pad(char_type __fill, streamsize __w, ios_base& __io, char_type* __new, const char_type* __cs, int& __len) const; /// Destructor. virtual ~num_put() { }; //@{ /** * @brief Numeric formatting. * * These functions do the work of formatting numeric values and * inserting them into a stream. This function is a hook for derived * classes to change the value returned. * * @param __s Stream to write to. * @param __io Source of locale and flags. * @param __fill Char_type to use for filling. * @param __v Value to format and insert. * @return Iterator after writing. */ virtual iter_type do_put(iter_type __s, ios_base& __io, char_type __fill, bool __v) const; virtual iter_type do_put(iter_type __s, ios_base& __io, char_type __fill, long __v) const { return _M_insert_int(__s, __io, __fill, __v); } virtual iter_type do_put(iter_type __s, ios_base& __io, char_type __fill, unsigned long __v) const { return _M_insert_int(__s, __io, __fill, __v); } #ifdef _GLIBCXX_USE_LONG_LONG virtual iter_type do_put(iter_type __s, ios_base& __io, char_type __fill, long long __v) const { return _M_insert_int(__s, __io, __fill, __v); } virtual iter_type do_put(iter_type __s, ios_base& __io, char_type __fill, unsigned long long __v) const { return _M_insert_int(__s, __io, __fill, __v); } #endif # 2528 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets.h" 3 virtual iter_type do_put(iter_type, ios_base&, char_type, double) const; // XXX GLIBCXX_ABI Deprecated #if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__ virtual iter_type __do_put(iter_type, ios_base&, char_type, double) const; #else # 2537 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets.h" 3 virtual iter_type do_put(iter_type, ios_base&, char_type, long double) const; #endif # 2540 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets.h" 3 virtual iter_type do_put(iter_type, ios_base&, char_type, const void*) const; // XXX GLIBCXX_ABI Deprecated #if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__ virtual iter_type do_put(iter_type, ios_base&, char_type, long double) const; #endif # 2549 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets.h" 3 //@} }; template locale::id num_put<_CharT, _OutIter>::id; _GLIBCXX_END_NAMESPACE_LDBL // Subclause convenience interfaces, inlines. // NB: These are inline because, when used in a loop, some compilers // can hoist the body out of the loop; then it's just as fast as the // C is*() function. /// Convenience interface to ctype.is(ctype_base::space, __c). template inline bool isspace(_CharT __c, const locale& __loc) { return use_facet >(__loc).is(ctype_base::space, __c); } /// Convenience interface to ctype.is(ctype_base::print, __c). template inline bool isprint(_CharT __c, const locale& __loc) { return use_facet >(__loc).is(ctype_base::print, __c); } /// Convenience interface to ctype.is(ctype_base::cntrl, __c). template inline bool iscntrl(_CharT __c, const locale& __loc) { return use_facet >(__loc).is(ctype_base::cntrl, __c); } /// Convenience interface to ctype.is(ctype_base::upper, __c). template inline bool isupper(_CharT __c, const locale& __loc) { return use_facet >(__loc).is(ctype_base::upper, __c); } /// Convenience interface to ctype.is(ctype_base::lower, __c). template inline bool islower(_CharT __c, const locale& __loc) { return use_facet >(__loc).is(ctype_base::lower, __c); } /// Convenience interface to ctype.is(ctype_base::alpha, __c). template inline bool isalpha(_CharT __c, const locale& __loc) { return use_facet >(__loc).is(ctype_base::alpha, __c); } /// Convenience interface to ctype.is(ctype_base::digit, __c). template inline bool isdigit(_CharT __c, const locale& __loc) { return use_facet >(__loc).is(ctype_base::digit, __c); } /// Convenience interface to ctype.is(ctype_base::punct, __c). template inline bool ispunct(_CharT __c, const locale& __loc) { return use_facet >(__loc).is(ctype_base::punct, __c); } /// Convenience interface to ctype.is(ctype_base::xdigit, __c). template inline bool isxdigit(_CharT __c, const locale& __loc) { return use_facet >(__loc).is(ctype_base::xdigit, __c); } /// Convenience interface to ctype.is(ctype_base::alnum, __c). template inline bool isalnum(_CharT __c, const locale& __loc) { return use_facet >(__loc).is(ctype_base::alnum, __c); } /// Convenience interface to ctype.is(ctype_base::graph, __c). template inline bool isgraph(_CharT __c, const locale& __loc) { return use_facet >(__loc).is(ctype_base::graph, __c); } #if __cplusplus >= 201103L /// Convenience interface to ctype.is(ctype_base::blank, __c). template inline bool isblank(_CharT __c, const locale& __loc) { return use_facet >(__loc).is(ctype_base::blank, __c); } #endif # 2635 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets.h" 3 /// Convenience interface to ctype.toupper(__c). template inline _CharT toupper(_CharT __c, const locale& __loc) { return use_facet >(__loc).toupper(__c); } /// Convenience interface to ctype.tolower(__c). template inline _CharT tolower(_CharT __c, const locale& __loc) { return use_facet >(__loc).tolower(__c); } _GLIBCXX_END_NAMESPACE_VERSION } // namespace std #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 2651 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets.tcc" 1 3 // Locale support -*- C++ -*- // Copyright (C) 1997-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file bits/locale_facets.tcc * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{locale} */ #ifndef _LOCALE_FACETS_TCC #define _LOCALE_FACETS_TCC 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 34 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets.tcc" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION // Routine to access a cache for the facet. If the cache didn't // exist before, it gets constructed on the fly. template struct __use_cache { const _Facet* operator() (const locale& __loc) const; }; // Specializations. template struct __use_cache<__numpunct_cache<_CharT> > { const __numpunct_cache<_CharT>* operator() (const locale& __loc) const { const size_t __i = numpunct<_CharT>::id._M_id(); const locale::facet** __caches = __loc._M_impl->_M_caches; if (!__caches[__i]) { __numpunct_cache<_CharT>* __tmp = 0; __try { __tmp = new __numpunct_cache<_CharT>; __tmp->_M_cache(__loc); } __catch(...) { delete __tmp; __throw_exception_again; } __loc._M_impl->_M_install_cache(__tmp, __i); } return static_cast*>(__caches[__i]); } }; template void __numpunct_cache<_CharT>::_M_cache(const locale& __loc) { const numpunct<_CharT>& __np = use_facet >(__loc); char* __grouping = 0; _CharT* __truename = 0; _CharT* __falsename = 0; __try { const string& __g = __np.grouping(); _M_grouping_size = __g.size(); __grouping = new char[_M_grouping_size]; __g.copy(__grouping, _M_grouping_size); _M_use_grouping = (_M_grouping_size && static_cast(__grouping[0]) > 0 && (__grouping[0] != __gnu_cxx::__numeric_traits::__max)); const basic_string<_CharT>& __tn = __np.truename(); _M_truename_size = __tn.size(); __truename = new _CharT[_M_truename_size]; __tn.copy(__truename, _M_truename_size); const basic_string<_CharT>& __fn = __np.falsename(); _M_falsename_size = __fn.size(); __falsename = new _CharT[_M_falsename_size]; __fn.copy(__falsename, _M_falsename_size); _M_decimal_point = __np.decimal_point(); _M_thousands_sep = __np.thousands_sep(); const ctype<_CharT>& __ct = use_facet >(__loc); __ct.widen(__num_base::_S_atoms_out, __num_base::_S_atoms_out + __num_base::_S_oend, _M_atoms_out); __ct.widen(__num_base::_S_atoms_in, __num_base::_S_atoms_in + __num_base::_S_iend, _M_atoms_in); _M_grouping = __grouping; _M_truename = __truename; _M_falsename = __falsename; _M_allocated = true; } __catch(...) { delete [] __grouping; delete [] __truename; delete [] __falsename; __throw_exception_again; } } // Used by both numeric and monetary facets. // Check to make sure that the __grouping_tmp string constructed in // money_get or num_get matches the canonical grouping for a given // locale. // __grouping_tmp is parsed L to R // 1,222,444 == __grouping_tmp of "\1\3\3" // __grouping is parsed R to L // 1,222,444 == __grouping of "\3" == "\3\3\3" _GLIBCXX_PURE bool __verify_grouping(const char* __grouping, size_t __grouping_size, const string& __grouping_tmp) throw (); _GLIBCXX_BEGIN_NAMESPACE_LDBL template _GLIBCXX_DEFAULT_ABI_TAG _InIter num_get<_CharT, _InIter>:: _M_extract_float(_InIter __beg, _InIter __end, ios_base& __io, ios_base::iostate& __err, string& __xtrc) const { typedef char_traits<_CharT> __traits_type; typedef __numpunct_cache<_CharT> __cache_type; __use_cache<__cache_type> __uc; const locale& __loc = __io._M_getloc(); const __cache_type* __lc = __uc(__loc); const _CharT* __lit = __lc->_M_atoms_in; char_type __c = char_type(); // True if __beg becomes equal to __end. bool __testeof = __beg == __end; // First check for sign. if (!__testeof) { __c = *__beg; const bool __plus = __c == __lit[__num_base::_S_iplus]; if ((__plus || __c == __lit[__num_base::_S_iminus]) && !(__lc->_M_use_grouping && __c == __lc->_M_thousands_sep) && !(__c == __lc->_M_decimal_point)) { __xtrc += __plus ? '+' : '-'; if (++__beg != __end) __c = *__beg; else __testeof = true; } } // Next, look for leading zeros. bool __found_mantissa = false; int __sep_pos = 0; while (!__testeof) { if ((__lc->_M_use_grouping && __c == __lc->_M_thousands_sep) || __c == __lc->_M_decimal_point) break; else if (__c == __lit[__num_base::_S_izero]) { if (!__found_mantissa) { __xtrc += '0'; __found_mantissa = true; } ++__sep_pos; if (++__beg != __end) __c = *__beg; else __testeof = true; } else break; } // Only need acceptable digits for floating point numbers. bool __found_dec = false; bool __found_sci = false; string __found_grouping; if (__lc->_M_use_grouping) __found_grouping.reserve(32); const char_type* __lit_zero = __lit + __num_base::_S_izero; if (!__lc->_M_allocated) // "C" locale while (!__testeof) { const int __digit = _M_find(__lit_zero, 10, __c); if (__digit != -1) { __xtrc += '0' + __digit; __found_mantissa = true; } else if (__c == __lc->_M_decimal_point && !__found_dec && !__found_sci) { __xtrc += '.'; __found_dec = true; } else if ((__c == __lit[__num_base::_S_ie] || __c == __lit[__num_base::_S_iE]) && !__found_sci && __found_mantissa) { // Scientific notation. __xtrc += 'e'; __found_sci = true; // Remove optional plus or minus sign, if they exist. if (++__beg != __end) { __c = *__beg; const bool __plus = __c == __lit[__num_base::_S_iplus]; if (__plus || __c == __lit[__num_base::_S_iminus]) __xtrc += __plus ? '+' : '-'; else continue; } else { __testeof = true; break; } } else break; if (++__beg != __end) __c = *__beg; else __testeof = true; } else while (!__testeof) { // According to 22.2.2.1.2, p8-9, first look for thousands_sep // and decimal_point. if (__lc->_M_use_grouping && __c == __lc->_M_thousands_sep) { if (!__found_dec && !__found_sci) { // NB: Thousands separator at the beginning of a string // is a no-no, as is two consecutive thousands separators. if (__sep_pos) { __found_grouping += static_cast(__sep_pos); __sep_pos = 0; } else { // NB: __convert_to_v will not assign __v and will // set the failbit. __xtrc.clear(); break; } } else break; } else if (__c == __lc->_M_decimal_point) { if (!__found_dec && !__found_sci) { // If no grouping chars are seen, no grouping check // is applied. Therefore __found_grouping is adjusted // only if decimal_point comes after some thousands_sep. if (__found_grouping.size()) __found_grouping += static_cast(__sep_pos); __xtrc += '.'; __found_dec = true; } else break; } else { const char_type* __q = __traits_type::find(__lit_zero, 10, __c); if (__q) { __xtrc += '0' + (__q - __lit_zero); __found_mantissa = true; ++__sep_pos; } else if ((__c == __lit[__num_base::_S_ie] || __c == __lit[__num_base::_S_iE]) && !__found_sci && __found_mantissa) { // Scientific notation. if (__found_grouping.size() && !__found_dec) __found_grouping += static_cast(__sep_pos); __xtrc += 'e'; __found_sci = true; // Remove optional plus or minus sign, if they exist. if (++__beg != __end) { __c = *__beg; const bool __plus = __c == __lit[__num_base::_S_iplus]; if ((__plus || __c == __lit[__num_base::_S_iminus]) && !(__lc->_M_use_grouping && __c == __lc->_M_thousands_sep) && !(__c == __lc->_M_decimal_point)) __xtrc += __plus ? '+' : '-'; else continue; } else { __testeof = true; break; } } else break; } if (++__beg != __end) __c = *__beg; else __testeof = true; } // Digit grouping is checked. If grouping and found_grouping don't // match, then get very very upset, and set failbit. if (__found_grouping.size()) { // Add the ending grouping if a decimal or 'e'/'E' wasn't found. if (!__found_dec && !__found_sci) __found_grouping += static_cast(__sep_pos); if (!std::__verify_grouping(__lc->_M_grouping, __lc->_M_grouping_size, __found_grouping)) __err = ios_base::failbit; } return __beg; } template template _GLIBCXX_DEFAULT_ABI_TAG _InIter num_get<_CharT, _InIter>:: _M_extract_int(_InIter __beg, _InIter __end, ios_base& __io, ios_base::iostate& __err, _ValueT& __v) const { typedef char_traits<_CharT> __traits_type; using __gnu_cxx::__add_unsigned; typedef typename __add_unsigned<_ValueT>::__type __unsigned_type; typedef __numpunct_cache<_CharT> __cache_type; __use_cache<__cache_type> __uc; const locale& __loc = __io._M_getloc(); const __cache_type* __lc = __uc(__loc); const _CharT* __lit = __lc->_M_atoms_in; char_type __c = char_type(); // NB: Iff __basefield == 0, __base can change based on contents. const ios_base::fmtflags __basefield = __io.flags() & ios_base::basefield; const bool __oct = __basefield == ios_base::oct; int __base = __oct ? 8 : (__basefield == ios_base::hex ? 16 : 10); // True if __beg becomes equal to __end. bool __testeof = __beg == __end; // First check for sign. bool __negative = false; if (!__testeof) { __c = *__beg; __negative = __c == __lit[__num_base::_S_iminus]; if ((__negative || __c == __lit[__num_base::_S_iplus]) && !(__lc->_M_use_grouping && __c == __lc->_M_thousands_sep) && !(__c == __lc->_M_decimal_point)) { if (++__beg != __end) __c = *__beg; else __testeof = true; } } // Next, look for leading zeros and check required digits // for base formats. bool __found_zero = false; int __sep_pos = 0; while (!__testeof) { if ((__lc->_M_use_grouping && __c == __lc->_M_thousands_sep) || __c == __lc->_M_decimal_point) break; else if (__c == __lit[__num_base::_S_izero] && (!__found_zero || __base == 10)) { __found_zero = true; ++__sep_pos; if (__basefield == 0) __base = 8; if (__base == 8) __sep_pos = 0; } else if (__found_zero && (__c == __lit[__num_base::_S_ix] || __c == __lit[__num_base::_S_iX])) { if (__basefield == 0) __base = 16; if (__base == 16) { __found_zero = false; __sep_pos = 0; } else break; } else break; if (++__beg != __end) { __c = *__beg; if (!__found_zero) break; } else __testeof = true; } // At this point, base is determined. If not hex, only allow // base digits as valid input. const size_t __len = (__base == 16 ? __num_base::_S_iend - __num_base::_S_izero : __base); // Extract. string __found_grouping; if (__lc->_M_use_grouping) __found_grouping.reserve(32); bool __testfail = false; bool __testoverflow = false; const __unsigned_type __max = (__negative && __gnu_cxx::__numeric_traits<_ValueT>::__is_signed) ? -__gnu_cxx::__numeric_traits<_ValueT>::__min : __gnu_cxx::__numeric_traits<_ValueT>::__max; const __unsigned_type __smax = __max / __base; __unsigned_type __result = 0; int __digit = 0; const char_type* __lit_zero = __lit + __num_base::_S_izero; if (!__lc->_M_allocated) // "C" locale while (!__testeof) { __digit = _M_find(__lit_zero, __len, __c); if (__digit == -1) break; if (__result > __smax) __testoverflow = true; else { __result *= __base; __testoverflow |= __result > __max - __digit; __result += __digit; ++__sep_pos; } if (++__beg != __end) __c = *__beg; else __testeof = true; } else while (!__testeof) { // According to 22.2.2.1.2, p8-9, first look for thousands_sep // and decimal_point. if (__lc->_M_use_grouping && __c == __lc->_M_thousands_sep) { // NB: Thousands separator at the beginning of a string // is a no-no, as is two consecutive thousands separators. if (__sep_pos) { __found_grouping += static_cast(__sep_pos); __sep_pos = 0; } else { __testfail = true; break; } } else if (__c == __lc->_M_decimal_point) break; else { const char_type* __q = __traits_type::find(__lit_zero, __len, __c); if (!__q) break; __digit = __q - __lit_zero; if (__digit > 15) __digit -= 6; if (__result > __smax) __testoverflow = true; else { __result *= __base; __testoverflow |= __result > __max - __digit; __result += __digit; ++__sep_pos; } } if (++__beg != __end) __c = *__beg; else __testeof = true; } // Digit grouping is checked. If grouping and found_grouping don't // match, then get very very upset, and set failbit. if (__found_grouping.size()) { // Add the ending grouping. __found_grouping += static_cast(__sep_pos); if (!std::__verify_grouping(__lc->_M_grouping, __lc->_M_grouping_size, __found_grouping)) __err = ios_base::failbit; } // _GLIBCXX_RESOLVE_LIB_DEFECTS // 23. Num_get overflow result. if ((!__sep_pos && !__found_zero && !__found_grouping.size()) || __testfail) { __v = 0; __err = ios_base::failbit; } else if (__testoverflow) { if (__negative && __gnu_cxx::__numeric_traits<_ValueT>::__is_signed) __v = __gnu_cxx::__numeric_traits<_ValueT>::__min; else __v = __gnu_cxx::__numeric_traits<_ValueT>::__max; __err = ios_base::failbit; } else __v = __negative ? -__result : __result; if (__testeof) __err |= ios_base::eofbit; return __beg; } // _GLIBCXX_RESOLVE_LIB_DEFECTS // 17. Bad bool parsing template _InIter num_get<_CharT, _InIter>:: do_get(iter_type __beg, iter_type __end, ios_base& __io, ios_base::iostate& __err, bool& __v) const { if (!(__io.flags() & ios_base::boolalpha)) { // Parse bool values as long. // NB: We can't just call do_get(long) here, as it might // refer to a derived class. long __l = -1; __beg = _M_extract_int(__beg, __end, __io, __err, __l); if (__l == 0 || __l == 1) __v = bool(__l); else { // _GLIBCXX_RESOLVE_LIB_DEFECTS // 23. Num_get overflow result. __v = true; __err = ios_base::failbit; if (__beg == __end) __err |= ios_base::eofbit; } } else { // Parse bool values as alphanumeric. typedef __numpunct_cache<_CharT> __cache_type; __use_cache<__cache_type> __uc; const locale& __loc = __io._M_getloc(); const __cache_type* __lc = __uc(__loc); bool __testf = true; bool __testt = true; bool __donef = __lc->_M_falsename_size == 0; bool __donet = __lc->_M_truename_size == 0; bool __testeof = false; size_t __n = 0; while (!__donef || !__donet) { if (__beg == __end) { __testeof = true; break; } const char_type __c = *__beg; if (!__donef) __testf = __c == __lc->_M_falsename[__n]; if (!__testf && __donet) break; if (!__donet) __testt = __c == __lc->_M_truename[__n]; if (!__testt && __donef) break; if (!__testt && !__testf) break; ++__n; ++__beg; __donef = !__testf || __n >= __lc->_M_falsename_size; __donet = !__testt || __n >= __lc->_M_truename_size; } if (__testf && __n == __lc->_M_falsename_size && __n) { __v = false; if (__testt && __n == __lc->_M_truename_size) __err = ios_base::failbit; else __err = __testeof ? ios_base::eofbit : ios_base::goodbit; } else if (__testt && __n == __lc->_M_truename_size && __n) { __v = true; __err = __testeof ? ios_base::eofbit : ios_base::goodbit; } else { // _GLIBCXX_RESOLVE_LIB_DEFECTS // 23. Num_get overflow result. __v = false; __err = ios_base::failbit; if (__testeof) __err |= ios_base::eofbit; } } return __beg; } template _InIter num_get<_CharT, _InIter>:: do_get(iter_type __beg, iter_type __end, ios_base& __io, ios_base::iostate& __err, float& __v) const { string __xtrc; __xtrc.reserve(32); __beg = _M_extract_float(__beg, __end, __io, __err, __xtrc); std::__convert_to_v(__xtrc.c_str(), __v, __err, _S_get_c_locale()); if (__beg == __end) __err |= ios_base::eofbit; return __beg; } template _InIter num_get<_CharT, _InIter>:: do_get(iter_type __beg, iter_type __end, ios_base& __io, ios_base::iostate& __err, double& __v) const { string __xtrc; __xtrc.reserve(32); __beg = _M_extract_float(__beg, __end, __io, __err, __xtrc); std::__convert_to_v(__xtrc.c_str(), __v, __err, _S_get_c_locale()); if (__beg == __end) __err |= ios_base::eofbit; return __beg; } #if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__ template _InIter num_get<_CharT, _InIter>:: __do_get(iter_type __beg, iter_type __end, ios_base& __io, ios_base::iostate& __err, double& __v) const { string __xtrc; __xtrc.reserve(32); __beg = _M_extract_float(__beg, __end, __io, __err, __xtrc); std::__convert_to_v(__xtrc.c_str(), __v, __err, _S_get_c_locale()); if (__beg == __end) __err |= ios_base::eofbit; return __beg; } #endif # 734 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets.tcc" 3 template _InIter num_get<_CharT, _InIter>:: do_get(iter_type __beg, iter_type __end, ios_base& __io, ios_base::iostate& __err, long double& __v) const { string __xtrc; __xtrc.reserve(32); __beg = _M_extract_float(__beg, __end, __io, __err, __xtrc); std::__convert_to_v(__xtrc.c_str(), __v, __err, _S_get_c_locale()); if (__beg == __end) __err |= ios_base::eofbit; return __beg; } template _InIter num_get<_CharT, _InIter>:: do_get(iter_type __beg, iter_type __end, ios_base& __io, ios_base::iostate& __err, void*& __v) const { // Prepare for hex formatted input. typedef ios_base::fmtflags fmtflags; const fmtflags __fmt = __io.flags(); __io.flags((__fmt & ~ios_base::basefield) | ios_base::hex); typedef __gnu_cxx::__conditional_type<(sizeof(void*) <= sizeof(unsigned long)), unsigned long, unsigned long long>::__type _UIntPtrType; _UIntPtrType __ul; __beg = _M_extract_int(__beg, __end, __io, __err, __ul); // Reset from hex formatted input. __io.flags(__fmt); __v = reinterpret_cast(__ul); return __beg; } // For use by integer and floating-point types after they have been // converted into a char_type string. template void num_put<_CharT, _OutIter>:: _M_pad(_CharT __fill, streamsize __w, ios_base& __io, _CharT* __new, const _CharT* __cs, int& __len) const { // [22.2.2.2.2] Stage 3. // If necessary, pad. __pad<_CharT, char_traits<_CharT> >::_S_pad(__io, __fill, __new, __cs, __w, __len); __len = static_cast(__w); } _GLIBCXX_END_NAMESPACE_LDBL template int __int_to_char(_CharT* __bufend, _ValueT __v, const _CharT* __lit, ios_base::fmtflags __flags, bool __dec) { _CharT* __buf = __bufend; if (__builtin_expect(__dec, true)) { // Decimal. do { *--__buf = __lit[(__v % 10) + __num_base::_S_odigits]; __v /= 10; } while (__v != 0); } else if ((__flags & ios_base::basefield) == ios_base::oct) { // Octal. do { *--__buf = __lit[(__v & 0x7) + __num_base::_S_odigits]; __v >>= 3; } while (__v != 0); } else { // Hex. const bool __uppercase = __flags & ios_base::uppercase; const int __case_offset = __uppercase ? __num_base::_S_oudigits : __num_base::_S_odigits; do { *--__buf = __lit[(__v & 0xf) + __case_offset]; __v >>= 4; } while (__v != 0); } return __bufend - __buf; } _GLIBCXX_BEGIN_NAMESPACE_LDBL template void num_put<_CharT, _OutIter>:: _M_group_int(const char* __grouping, size_t __grouping_size, _CharT __sep, ios_base&, _CharT* __new, _CharT* __cs, int& __len) const { _CharT* __p = std::__add_grouping(__new, __sep, __grouping, __grouping_size, __cs, __cs + __len); __len = __p - __new; } template template _OutIter num_put<_CharT, _OutIter>:: _M_insert_int(_OutIter __s, ios_base& __io, _CharT __fill, _ValueT __v) const { using __gnu_cxx::__add_unsigned; typedef typename __add_unsigned<_ValueT>::__type __unsigned_type; typedef __numpunct_cache<_CharT> __cache_type; __use_cache<__cache_type> __uc; const locale& __loc = __io._M_getloc(); const __cache_type* __lc = __uc(__loc); const _CharT* __lit = __lc->_M_atoms_out; const ios_base::fmtflags __flags = __io.flags(); // Long enough to hold hex, dec, and octal representations. const int __ilen = 5 * sizeof(_ValueT); _CharT* __cs = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) * __ilen)); // [22.2.2.2.2] Stage 1, numeric conversion to character. // Result is returned right-justified in the buffer. const ios_base::fmtflags __basefield = __flags & ios_base::basefield; const bool __dec = (__basefield != ios_base::oct && __basefield != ios_base::hex); const __unsigned_type __u = ((__v > 0 || !__dec) ? __unsigned_type(__v) : -__unsigned_type(__v)); int __len = __int_to_char(__cs + __ilen, __u, __lit, __flags, __dec); __cs += __ilen - __len; // Add grouping, if necessary. if (__lc->_M_use_grouping) { // Grouping can add (almost) as many separators as the number // of digits + space is reserved for numeric base or sign. _CharT* __cs2 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) * (__len + 1) * 2)); _M_group_int(__lc->_M_grouping, __lc->_M_grouping_size, __lc->_M_thousands_sep, __io, __cs2 + 2, __cs, __len); __cs = __cs2 + 2; } // Complete Stage 1, prepend numeric base or sign. if (__builtin_expect(__dec, true)) { // Decimal. if (__v >= 0) { if (bool(__flags & ios_base::showpos) && __gnu_cxx::__numeric_traits<_ValueT>::__is_signed) *--__cs = __lit[__num_base::_S_oplus], ++__len; } else *--__cs = __lit[__num_base::_S_ominus], ++__len; } else if (bool(__flags & ios_base::showbase) && __v) { if (__basefield == ios_base::oct) *--__cs = __lit[__num_base::_S_odigits], ++__len; else { // 'x' or 'X' const bool __uppercase = __flags & ios_base::uppercase; *--__cs = __lit[__num_base::_S_ox + __uppercase]; // '0' *--__cs = __lit[__num_base::_S_odigits]; __len += 2; } } // Pad. const streamsize __w = __io.width(); if (__w > static_cast(__len)) { _CharT* __cs3 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) * __w)); _M_pad(__fill, __w, __io, __cs3, __cs, __len); __cs = __cs3; } __io.width(0); // [22.2.2.2.2] Stage 4. // Write resulting, fully-formatted string to output iterator. return std::__write(__s, __cs, __len); } template void num_put<_CharT, _OutIter>:: _M_group_float(const char* __grouping, size_t __grouping_size, _CharT __sep, const _CharT* __p, _CharT* __new, _CharT* __cs, int& __len) const { // _GLIBCXX_RESOLVE_LIB_DEFECTS // 282. What types does numpunct grouping refer to? // Add grouping, if necessary. const int __declen = __p ? __p - __cs : __len; _CharT* __p2 = std::__add_grouping(__new, __sep, __grouping, __grouping_size, __cs, __cs + __declen); // Tack on decimal part. int __newlen = __p2 - __new; if (__p) { char_traits<_CharT>::copy(__p2, __p, __len - __declen); __newlen += __len - __declen; } __len = __newlen; } // The following code uses vsnprintf (or vsprintf(), when // _GLIBCXX_USE_C99 is not defined) to convert floating point values // for insertion into a stream. An optimization would be to replace // them with code that works directly on a wide buffer and then use // __pad to do the padding. It would be good to replace them anyway // to gain back the efficiency that C++ provides by knowing up front // the type of the values to insert. Also, sprintf is dangerous // since may lead to accidental buffer overruns. This // implementation follows the C++ standard fairly directly as // outlined in 22.2.2.2 [lib.locale.num.put] template template _OutIter num_put<_CharT, _OutIter>:: _M_insert_float(_OutIter __s, ios_base& __io, _CharT __fill, char __mod, _ValueT __v) const { typedef __numpunct_cache<_CharT> __cache_type; __use_cache<__cache_type> __uc; const locale& __loc = __io._M_getloc(); const __cache_type* __lc = __uc(__loc); // Use default precision if out of range. const streamsize __prec = __io.precision() < 0 ? 6 : __io.precision(); const int __max_digits = __gnu_cxx::__numeric_traits<_ValueT>::__digits10; // [22.2.2.2.2] Stage 1, numeric conversion to character. int __len; // Long enough for the max format spec. char __fbuf[16]; __num_base::_S_format_float(__io, __fbuf, __mod); #ifdef _GLIBCXX_USE_C99 // Precision is always used except for hexfloat format. const bool __use_prec = (__io.flags() & ios_base::floatfield) != ios_base::floatfield; // First try a buffer perhaps big enough (most probably sufficient // for non-ios_base::fixed outputs) int __cs_size = __max_digits * 3; char* __cs = static_cast(__builtin_alloca(__cs_size)); if (__use_prec) __len = std::__convert_from_v(_S_get_c_locale(), __cs, __cs_size, __fbuf, __prec, __v); else __len = std::__convert_from_v(_S_get_c_locale(), __cs, __cs_size, __fbuf, __v); // If the buffer was not large enough, try again with the correct size. if (__len >= __cs_size) { __cs_size = __len + 1; __cs = static_cast(__builtin_alloca(__cs_size)); if (__use_prec) __len = std::__convert_from_v(_S_get_c_locale(), __cs, __cs_size, __fbuf, __prec, __v); else __len = std::__convert_from_v(_S_get_c_locale(), __cs, __cs_size, __fbuf, __v); } #else # 1024 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets.tcc" 3 // Consider the possibility of long ios_base::fixed outputs const bool __fixed = __io.flags() & ios_base::fixed; const int __max_exp = __gnu_cxx::__numeric_traits<_ValueT>::__max_exponent10; // The size of the output string is computed as follows. // ios_base::fixed outputs may need up to __max_exp + 1 chars // for the integer part + __prec chars for the fractional part // + 3 chars for sign, decimal point, '\0'. On the other hand, // for non-fixed outputs __max_digits * 2 + __prec chars are // largely sufficient. const int __cs_size = __fixed ? __max_exp + __prec + 4 : __max_digits * 2 + __prec; char* __cs = static_cast(__builtin_alloca(__cs_size)); __len = std::__convert_from_v(_S_get_c_locale(), __cs, 0, __fbuf, __prec, __v); #endif # 1041 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets.tcc" 3 // [22.2.2.2.2] Stage 2, convert to char_type, using correct // numpunct.decimal_point() values for '.' and adding grouping. const ctype<_CharT>& __ctype = use_facet >(__loc); _CharT* __ws = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) * __len)); __ctype.widen(__cs, __cs + __len, __ws); // Replace decimal point. _CharT* __wp = 0; const char* __p = char_traits::find(__cs, __len, '.'); if (__p) { __wp = __ws + (__p - __cs); *__wp = __lc->_M_decimal_point; } // Add grouping, if necessary. // N.B. Make sure to not group things like 2e20, i.e., no decimal // point, scientific notation. if (__lc->_M_use_grouping && (__wp || __len < 3 || (__cs[1] <= '9' && __cs[2] <= '9' && __cs[1] >= '0' && __cs[2] >= '0'))) { // Grouping can add (almost) as many separators as the // number of digits, but no more. _CharT* __ws2 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) * __len * 2)); streamsize __off = 0; if (__cs[0] == '-' || __cs[0] == '+') { __off = 1; __ws2[0] = __ws[0]; __len -= 1; } _M_group_float(__lc->_M_grouping, __lc->_M_grouping_size, __lc->_M_thousands_sep, __wp, __ws2 + __off, __ws + __off, __len); __len += __off; __ws = __ws2; } // Pad. const streamsize __w = __io.width(); if (__w > static_cast(__len)) { _CharT* __ws3 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) * __w)); _M_pad(__fill, __w, __io, __ws3, __ws, __len); __ws = __ws3; } __io.width(0); // [22.2.2.2.2] Stage 4. // Write resulting, fully-formatted string to output iterator. return std::__write(__s, __ws, __len); } template _OutIter num_put<_CharT, _OutIter>:: do_put(iter_type __s, ios_base& __io, char_type __fill, bool __v) const { const ios_base::fmtflags __flags = __io.flags(); if ((__flags & ios_base::boolalpha) == 0) { const long __l = __v; __s = _M_insert_int(__s, __io, __fill, __l); } else { typedef __numpunct_cache<_CharT> __cache_type; __use_cache<__cache_type> __uc; const locale& __loc = __io._M_getloc(); const __cache_type* __lc = __uc(__loc); const _CharT* __name = __v ? __lc->_M_truename : __lc->_M_falsename; int __len = __v ? __lc->_M_truename_size : __lc->_M_falsename_size; const streamsize __w = __io.width(); if (__w > static_cast(__len)) { const streamsize __plen = __w - __len; _CharT* __ps = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) * __plen)); char_traits<_CharT>::assign(__ps, __plen, __fill); __io.width(0); if ((__flags & ios_base::adjustfield) == ios_base::left) { __s = std::__write(__s, __name, __len); __s = std::__write(__s, __ps, __plen); } else { __s = std::__write(__s, __ps, __plen); __s = std::__write(__s, __name, __len); } return __s; } __io.width(0); __s = std::__write(__s, __name, __len); } return __s; } template _OutIter num_put<_CharT, _OutIter>:: do_put(iter_type __s, ios_base& __io, char_type __fill, double __v) const { return _M_insert_float(__s, __io, __fill, char(), __v); } #if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__ template _OutIter num_put<_CharT, _OutIter>:: __do_put(iter_type __s, ios_base& __io, char_type __fill, double __v) const { return _M_insert_float(__s, __io, __fill, char(), __v); } #endif # 1168 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets.tcc" 3 template _OutIter num_put<_CharT, _OutIter>:: do_put(iter_type __s, ios_base& __io, char_type __fill, long double __v) const { return _M_insert_float(__s, __io, __fill, 'L', __v); } template _OutIter num_put<_CharT, _OutIter>:: do_put(iter_type __s, ios_base& __io, char_type __fill, const void* __v) const { const ios_base::fmtflags __flags = __io.flags(); const ios_base::fmtflags __fmt = ~(ios_base::basefield | ios_base::uppercase); __io.flags((__flags & __fmt) | (ios_base::hex | ios_base::showbase)); typedef __gnu_cxx::__conditional_type<(sizeof(const void*) <= sizeof(unsigned long)), unsigned long, unsigned long long>::__type _UIntPtrType; __s = _M_insert_int(__s, __io, __fill, reinterpret_cast<_UIntPtrType>(__v)); __io.flags(__flags); return __s; } _GLIBCXX_END_NAMESPACE_LDBL // Construct correctly padded string, as per 22.2.2.2.2 // Assumes // __newlen > __oldlen // __news is allocated for __newlen size // NB: Of the two parameters, _CharT can be deduced from the // function arguments. The other (_Traits) has to be explicitly specified. template void __pad<_CharT, _Traits>::_S_pad(ios_base& __io, _CharT __fill, _CharT* __news, const _CharT* __olds, streamsize __newlen, streamsize __oldlen) { const size_t __plen = static_cast(__newlen - __oldlen); const ios_base::fmtflags __adjust = __io.flags() & ios_base::adjustfield; // Padding last. if (__adjust == ios_base::left) { _Traits::copy(__news, __olds, __oldlen); _Traits::assign(__news + __oldlen, __plen, __fill); return; } size_t __mod = 0; if (__adjust == ios_base::internal) { // Pad after the sign, if there is one. // Pad after 0[xX], if there is one. // Who came up with these rules, anyway? Jeeze. const locale& __loc = __io._M_getloc(); const ctype<_CharT>& __ctype = use_facet >(__loc); if (__ctype.widen('-') == __olds[0] || __ctype.widen('+') == __olds[0]) { __news[0] = __olds[0]; __mod = 1; ++__news; } else if (__ctype.widen('0') == __olds[0] && __oldlen > 1 && (__ctype.widen('x') == __olds[1] || __ctype.widen('X') == __olds[1])) { __news[0] = __olds[0]; __news[1] = __olds[1]; __mod = 2; __news += 2; } // else Padding first. } _Traits::assign(__news, __plen, __fill); _Traits::copy(__news + __plen, __olds + __mod, __oldlen - __mod); } template _CharT* __add_grouping(_CharT* __s, _CharT __sep, const char* __gbeg, size_t __gsize, const _CharT* __first, const _CharT* __last) { size_t __idx = 0; size_t __ctr = 0; while (__last - __first > __gbeg[__idx] && static_cast(__gbeg[__idx]) > 0 && __gbeg[__idx] != __gnu_cxx::__numeric_traits::__max) { __last -= __gbeg[__idx]; __idx < __gsize - 1 ? ++__idx : ++__ctr; } while (__first != __last) *__s++ = *__first++; while (__ctr--) { *__s++ = __sep; for (char __i = __gbeg[__idx]; __i > 0; --__i) *__s++ = *__first++; } while (__idx--) { *__s++ = __sep; for (char __i = __gbeg[__idx]; __i > 0; --__i) *__s++ = *__first++; } return __s; } // Inhibit implicit instantiations for required instantiations, // which are defined via explicit instantiations elsewhere. #if _GLIBCXX_EXTERN_TEMPLATE extern template class _GLIBCXX_NAMESPACE_CXX11 numpunct; extern template class _GLIBCXX_NAMESPACE_CXX11 numpunct_byname; extern template class _GLIBCXX_NAMESPACE_LDBL num_get; extern template class _GLIBCXX_NAMESPACE_LDBL num_put; extern template class ctype_byname; extern template const ctype& use_facet >(const locale&); extern template const numpunct& use_facet >(const locale&); extern template const num_put& use_facet >(const locale&); extern template const num_get& use_facet >(const locale&); extern template bool has_facet >(const locale&); extern template bool has_facet >(const locale&); extern template bool has_facet >(const locale&); extern template bool has_facet >(const locale&); #ifdef _GLIBCXX_USE_WCHAR_T extern template class _GLIBCXX_NAMESPACE_CXX11 numpunct; extern template class _GLIBCXX_NAMESPACE_CXX11 numpunct_byname; extern template class _GLIBCXX_NAMESPACE_LDBL num_get; extern template class _GLIBCXX_NAMESPACE_LDBL num_put; extern template class ctype_byname; extern template const ctype& use_facet >(const locale&); extern template const numpunct& use_facet >(const locale&); extern template const num_put& use_facet >(const locale&); extern template const num_get& use_facet >(const locale&); extern template bool has_facet >(const locale&); extern template bool has_facet >(const locale&); extern template bool has_facet >(const locale&); extern template bool has_facet >(const locale&); #endif # 1372 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets.tcc" 3 #endif # 1373 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets.tcc" 3 _GLIBCXX_END_NAMESPACE_VERSION } // namespace #endif # 1378 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets.tcc" 3 # 2652 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets.h" 2 3 #endif # 2654 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets.h" 3 # 38 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_ios.h" 2 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 38 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_ios.h" 3 # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_ios.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_ios.h" 3 # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_ios.h" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION template inline const _Facet& __check_facet(const _Facet* __f) { if (!__f) __throw_bad_cast(); return *__f; } /** * @brief Template class basic_ios, virtual base class for all * stream classes. * @ingroup io * * @tparam _CharT Type of character stream. * @tparam _Traits Traits for character type, defaults to * char_traits<_CharT>. * * Most of the member functions called dispatched on stream objects * (e.g., @c std::cout.foo(bar);) are consolidated in this class. */ template class basic_ios : public ios_base { public: //@{ /** * These are standard types. They permit a standardized way of * referring to names of (or names dependent on) the template * parameters, which are specific to the implementation. */ typedef _CharT char_type; typedef typename _Traits::int_type int_type; typedef typename _Traits::pos_type pos_type; typedef typename _Traits::off_type off_type; typedef _Traits traits_type; //@} //@{ /** * These are non-standard types. */ typedef ctype<_CharT> __ctype_type; typedef num_put<_CharT, ostreambuf_iterator<_CharT, _Traits> > __num_put_type; typedef num_get<_CharT, istreambuf_iterator<_CharT, _Traits> > __num_get_type; //@} // Data members: protected: basic_ostream<_CharT, _Traits>* _M_tie; mutable char_type _M_fill; mutable bool _M_fill_init; basic_streambuf<_CharT, _Traits>* _M_streambuf; // Cached use_facet, which is based on the current locale info. const __ctype_type* _M_ctype; // For ostream. const __num_put_type* _M_num_put; // For istream. const __num_get_type* _M_num_get; public: //@{ /** * @brief The quick-and-easy status check. * * This allows you to write constructs such as * if (!a_stream) ... and while (a_stream) ... */ #if __cplusplus >= 201103L explicit operator bool() const { return !this->fail(); } #else # 120 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_ios.h" 3 operator void*() const { return this->fail() ? 0 : const_cast(this); } #endif # 123 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_ios.h" 3 bool operator!() const { return this->fail(); } //@} /** * @brief Returns the error state of the stream buffer. * @return A bit pattern (well, isn't everything?) * * See std::ios_base::iostate for the possible bit values. Most * users will call one of the interpreting wrappers, e.g., good(). */ iostate rdstate() const { return _M_streambuf_state; } /** * @brief [Re]sets the error state. * @param __state The new state flag(s) to set. * * See std::ios_base::iostate for the possible bit values. Most * users will not need to pass an argument. */ void clear(iostate __state = goodbit); /** * @brief Sets additional flags in the error state. * @param __state The additional state flag(s) to set. * * See std::ios_base::iostate for the possible bit values. */ void setstate(iostate __state) { this->clear(this->rdstate() | __state); } // Flip the internal state on for the proper state bits, then re // throws the propagated exception if bit also set in // exceptions(). void _M_setstate(iostate __state) { // 27.6.1.2.1 Common requirements. // Turn this on without causing an ios::failure to be thrown. _M_streambuf_state |= __state; if (this->exceptions() & __state) __throw_exception_again; } /** * @brief Fast error checking. * @return True if no error flags are set. * * A wrapper around rdstate. */ bool good() const { return this->rdstate() == 0; } /** * @brief Fast error checking. * @return True if the eofbit is set. * * Note that other iostate flags may also be set. */ bool eof() const { return (this->rdstate() & eofbit) != 0; } /** * @brief Fast error checking. * @return True if either the badbit or the failbit is set. * * Checking the badbit in fail() is historical practice. * Note that other iostate flags may also be set. */ bool fail() const { return (this->rdstate() & (badbit | failbit)) != 0; } /** * @brief Fast error checking. * @return True if the badbit is set. * * Note that other iostate flags may also be set. */ bool bad() const { return (this->rdstate() & badbit) != 0; } /** * @brief Throwing exceptions on errors. * @return The current exceptions mask. * * This changes nothing in the stream. See the one-argument version * of exceptions(iostate) for the meaning of the return value. */ iostate exceptions() const { return _M_exception; } /** * @brief Throwing exceptions on errors. * @param __except The new exceptions mask. * * By default, error flags are set silently. You can set an * exceptions mask for each stream; if a bit in the mask becomes set * in the error flags, then an exception of type * std::ios_base::failure is thrown. * * If the error flag is already set when the exceptions mask is * added, the exception is immediately thrown. Try running the * following under GCC 3.1 or later: * @code * #include * #include * #include * * int main() * { * std::set_terminate (__gnu_cxx::__verbose_terminate_handler); * * std::ifstream f ("/etc/motd"); * * std::cerr << "Setting badbit\n"; * f.setstate (std::ios_base::badbit); * * std::cerr << "Setting exception mask\n"; * f.exceptions (std::ios_base::badbit); * } * @endcode */ void exceptions(iostate __except) { _M_exception = __except; this->clear(_M_streambuf_state); } // Constructor/destructor: /** * @brief Constructor performs initialization. * * The parameter is passed by derived streams. */ explicit basic_ios(basic_streambuf<_CharT, _Traits>* __sb) : ios_base(), _M_tie(0), _M_fill(), _M_fill_init(false), _M_streambuf(0), _M_ctype(0), _M_num_put(0), _M_num_get(0) { this->init(__sb); } /** * @brief Empty. * * The destructor does nothing. More specifically, it does not * destroy the streambuf held by rdbuf(). */ virtual ~basic_ios() { } // Members: /** * @brief Fetches the current @e tied stream. * @return A pointer to the tied stream, or NULL if the stream is * not tied. * * A stream may be @e tied (or synchronized) to a second output * stream. When this stream performs any I/O, the tied stream is * first flushed. For example, @c std::cin is tied to @c std::cout. */ basic_ostream<_CharT, _Traits>* tie() const { return _M_tie; } /** * @brief Ties this stream to an output stream. * @param __tiestr The output stream. * @return The previously tied output stream, or NULL if the stream * was not tied. * * This sets up a new tie; see tie() for more. */ basic_ostream<_CharT, _Traits>* tie(basic_ostream<_CharT, _Traits>* __tiestr) { basic_ostream<_CharT, _Traits>* __old = _M_tie; _M_tie = __tiestr; return __old; } /** * @brief Accessing the underlying buffer. * @return The current stream buffer. * * This does not change the state of the stream. */ basic_streambuf<_CharT, _Traits>* rdbuf() const { return _M_streambuf; } /** * @brief Changing the underlying buffer. * @param __sb The new stream buffer. * @return The previous stream buffer. * * Associates a new buffer with the current stream, and clears the * error state. * * Due to historical accidents which the LWG refuses to correct, the * I/O library suffers from a design error: this function is hidden * in derived classes by overrides of the zero-argument @c rdbuf(), * which is non-virtual for hysterical raisins. As a result, you * must use explicit qualifications to access this function via any * derived class. For example: * * @code * std::fstream foo; // or some other derived type * std::streambuf* p = .....; * * foo.ios::rdbuf(p); // ios == basic_ios * @endcode */ basic_streambuf<_CharT, _Traits>* rdbuf(basic_streambuf<_CharT, _Traits>* __sb); /** * @brief Copies fields of __rhs into this. * @param __rhs The source values for the copies. * @return Reference to this object. * * All fields of __rhs are copied into this object except that rdbuf() * and rdstate() remain unchanged. All values in the pword and iword * arrays are copied. Before copying, each callback is invoked with * erase_event. After copying, each (new) callback is invoked with * copyfmt_event. The final step is to copy exceptions(). */ basic_ios& copyfmt(const basic_ios& __rhs); /** * @brief Retrieves the @a empty character. * @return The current fill character. * * It defaults to a space (' ') in the current locale. */ char_type fill() const { if (!_M_fill_init) { _M_fill = this->widen(' '); _M_fill_init = true; } return _M_fill; } /** * @brief Sets a new @a empty character. * @param __ch The new character. * @return The previous fill character. * * The fill character is used to fill out space when P+ characters * have been requested (e.g., via setw), Q characters are actually * used, and Qfill(); _M_fill = __ch; return __old; } // Locales: /** * @brief Moves to a new locale. * @param __loc The new locale. * @return The previous locale. * * Calls @c ios_base::imbue(loc), and if a stream buffer is associated * with this stream, calls that buffer's @c pubimbue(loc). * * Additional l10n notes are at * http://gcc.gnu.org/onlinedocs/libstdc++/manual/localization.html */ locale imbue(const locale& __loc); /** * @brief Squeezes characters. * @param __c The character to narrow. * @param __dfault The character to narrow. * @return The narrowed character. * * Maps a character of @c char_type to a character of @c char, * if possible. * * Returns the result of * @code * std::use_facet >(getloc()).narrow(c,dfault) * @endcode * * Additional l10n notes are at * http://gcc.gnu.org/onlinedocs/libstdc++/manual/localization.html */ char narrow(char_type __c, char __dfault) const { return __check_facet(_M_ctype).narrow(__c, __dfault); } /** * @brief Widens characters. * @param __c The character to widen. * @return The widened character. * * Maps a character of @c char to a character of @c char_type. * * Returns the result of * @code * std::use_facet >(getloc()).widen(c) * @endcode * * Additional l10n notes are at * http://gcc.gnu.org/onlinedocs/libstdc++/manual/localization.html */ char_type widen(char __c) const { return __check_facet(_M_ctype).widen(__c); } protected: // 27.4.5.1 basic_ios constructors /** * @brief Empty. * * The default constructor does nothing and is not normally * accessible to users. */ basic_ios() : ios_base(), _M_tie(0), _M_fill(char_type()), _M_fill_init(false), _M_streambuf(0), _M_ctype(0), _M_num_put(0), _M_num_get(0) { } /** * @brief All setup is performed here. * * This is called from the public constructor. It is not virtual and * cannot be redefined. */ void init(basic_streambuf<_CharT, _Traits>* __sb); #if __cplusplus >= 201103L basic_ios(const basic_ios&) = delete; basic_ios& operator=(const basic_ios&) = delete; void move(basic_ios& __rhs) { ios_base::_M_move(__rhs); _M_cache_locale(_M_ios_locale); this->tie(__rhs.tie(nullptr)); _M_fill = __rhs._M_fill; _M_fill_init = __rhs._M_fill_init; _M_streambuf = nullptr; } void move(basic_ios&& __rhs) { this->move(__rhs); } void swap(basic_ios& __rhs) noexcept { ios_base::_M_swap(__rhs); _M_cache_locale(_M_ios_locale); __rhs._M_cache_locale(__rhs._M_ios_locale); std::swap(_M_tie, __rhs._M_tie); std::swap(_M_fill, __rhs._M_fill); std::swap(_M_fill_init, __rhs._M_fill_init); } void set_rdbuf(basic_streambuf<_CharT, _Traits>* __sb) { _M_streambuf = __sb; } #endif # 508 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_ios.h" 3 void _M_cache_locale(const locale& __loc); }; _GLIBCXX_END_NAMESPACE_VERSION } // namespace #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 516 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_ios.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_ios.tcc" 1 3 // basic_ios member functions -*- C++ -*- // Copyright (C) 1999-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file bits/basic_ios.tcc * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{ios} */ #ifndef _BASIC_IOS_TCC #define _BASIC_IOS_TCC 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 34 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_ios.tcc" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION template void basic_ios<_CharT, _Traits>::clear(iostate __state) { if (this->rdbuf()) _M_streambuf_state = __state; else _M_streambuf_state = __state | badbit; if (this->exceptions() & this->rdstate()) __throw_ios_failure(__N("basic_ios::clear")); } template basic_streambuf<_CharT, _Traits>* basic_ios<_CharT, _Traits>::rdbuf(basic_streambuf<_CharT, _Traits>* __sb) { basic_streambuf<_CharT, _Traits>* __old = _M_streambuf; _M_streambuf = __sb; this->clear(); return __old; } template basic_ios<_CharT, _Traits>& basic_ios<_CharT, _Traits>::copyfmt(const basic_ios& __rhs) { // _GLIBCXX_RESOLVE_LIB_DEFECTS // 292. effects of a.copyfmt (a) if (this != &__rhs) { // Per 27.1.1, do not call imbue, yet must trash all caches // associated with imbue() // Alloc any new word array first, so if it fails we have "rollback". _Words* __words = (__rhs._M_word_size <= _S_local_word_size) ? _M_local_word : new _Words[__rhs._M_word_size]; // Bump refs before doing callbacks, for safety. _Callback_list* __cb = __rhs._M_callbacks; if (__cb) __cb->_M_add_reference(); _M_call_callbacks(erase_event); if (_M_word != _M_local_word) { delete [] _M_word; _M_word = 0; } _M_dispose_callbacks(); // NB: Don't want any added during above. _M_callbacks = __cb; for (int __i = 0; __i < __rhs._M_word_size; ++__i) __words[__i] = __rhs._M_word[__i]; _M_word = __words; _M_word_size = __rhs._M_word_size; this->flags(__rhs.flags()); this->width(__rhs.width()); this->precision(__rhs.precision()); this->tie(__rhs.tie()); this->fill(__rhs.fill()); _M_ios_locale = __rhs.getloc(); _M_cache_locale(_M_ios_locale); _M_call_callbacks(copyfmt_event); // The next is required to be the last assignment. this->exceptions(__rhs.exceptions()); } return *this; } // Locales: template locale basic_ios<_CharT, _Traits>::imbue(const locale& __loc) { locale __old(this->getloc()); ios_base::imbue(__loc); _M_cache_locale(__loc); if (this->rdbuf() != 0) this->rdbuf()->pubimbue(__loc); return __old; } template void basic_ios<_CharT, _Traits>::init(basic_streambuf<_CharT, _Traits>* __sb) { // NB: This may be called more than once on the same object. ios_base::_M_init(); // Cache locale data and specific facets used by iostreams. _M_cache_locale(_M_ios_locale); // NB: The 27.4.4.1 Postconditions Table specifies requirements // after basic_ios::init() has been called. As part of this, // fill() must return widen(' ') any time after init() has been // called, which needs an imbued ctype facet of char_type to // return without throwing an exception. Unfortunately, // ctype is not necessarily a required facet, so // streams with char_type != [char, wchar_t] will not have it by // default. Because of this, the correct value for _M_fill is // constructed on the first call of fill(). That way, // unformatted input and output with non-required basic_ios // instantiations is possible even without imbuing the expected // ctype facet. _M_fill = _CharT(); _M_fill_init = false; _M_tie = 0; _M_exception = goodbit; _M_streambuf = __sb; _M_streambuf_state = __sb ? goodbit : badbit; } template void basic_ios<_CharT, _Traits>::_M_cache_locale(const locale& __loc) { if (__builtin_expect(has_facet<__ctype_type>(__loc), true)) _M_ctype = &use_facet<__ctype_type>(__loc); else _M_ctype = 0; if (__builtin_expect(has_facet<__num_put_type>(__loc), true)) _M_num_put = &use_facet<__num_put_type>(__loc); else _M_num_put = 0; if (__builtin_expect(has_facet<__num_get_type>(__loc), true)) _M_num_get = &use_facet<__num_get_type>(__loc); else _M_num_get = 0; } // Inhibit implicit instantiations for required instantiations, // which are defined via explicit instantiations elsewhere. #if _GLIBCXX_EXTERN_TEMPLATE extern template class basic_ios; #ifdef _GLIBCXX_USE_WCHAR_T extern template class basic_ios; #endif # 183 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_ios.tcc" 3 #endif # 184 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_ios.tcc" 3 _GLIBCXX_END_NAMESPACE_VERSION } // namespace std #endif # 189 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_ios.tcc" 3 # 517 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_ios.h" 2 3 #endif /* _BASIC_IOS_H */ # 519 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/basic_ios.h" 3 # 45 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ios" 2 3 #endif /* _GLIBCXX_IOS */ # 47 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ios" 3 # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ostream" 2 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ostream" 3 # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ostream" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION /** * @brief Template class basic_ostream. * @ingroup io * * @tparam _CharT Type of character stream. * @tparam _Traits Traits for character type, defaults to * char_traits<_CharT>. * * This is the base class for all output streams. It provides text * formatting of all builtin types, and communicates with any class * derived from basic_streambuf to do the actual output. */ template class basic_ostream : virtual public basic_ios<_CharT, _Traits> { public: // Types (inherited from basic_ios): typedef _CharT char_type; typedef typename _Traits::int_type int_type; typedef typename _Traits::pos_type pos_type; typedef typename _Traits::off_type off_type; typedef _Traits traits_type; // Non-standard Types: typedef basic_streambuf<_CharT, _Traits> __streambuf_type; typedef basic_ios<_CharT, _Traits> __ios_type; typedef basic_ostream<_CharT, _Traits> __ostream_type; typedef num_put<_CharT, ostreambuf_iterator<_CharT, _Traits> > __num_put_type; typedef ctype<_CharT> __ctype_type; /** * @brief Base constructor. * * This ctor is almost never called by the user directly, rather from * derived classes' initialization lists, which pass a pointer to * their own stream buffer. */ explicit basic_ostream(__streambuf_type* __sb) { this->init(__sb); } /** * @brief Base destructor. * * This does very little apart from providing a virtual base dtor. */ virtual ~basic_ostream() { } /// Safe prefix/suffix operations. class sentry; friend class sentry; //@{ /** * @brief Interface for manipulators. * * Manipulators such as @c std::endl and @c std::hex use these * functions in constructs like "std::cout << std::endl". For more * information, see the iomanip header. */ __ostream_type& operator<<(__ostream_type& (*__pf)(__ostream_type&)) { // _GLIBCXX_RESOLVE_LIB_DEFECTS // DR 60. What is a formatted input function? // The inserters for manipulators are *not* formatted output functions. return __pf(*this); } __ostream_type& operator<<(__ios_type& (*__pf)(__ios_type&)) { // _GLIBCXX_RESOLVE_LIB_DEFECTS // DR 60. What is a formatted input function? // The inserters for manipulators are *not* formatted output functions. __pf(*this); return *this; } __ostream_type& operator<<(ios_base& (*__pf) (ios_base&)) { // _GLIBCXX_RESOLVE_LIB_DEFECTS // DR 60. What is a formatted input function? // The inserters for manipulators are *not* formatted output functions. __pf(*this); return *this; } //@} //@{ /** * @name Inserters * * All the @c operator<< functions (aka formatted output * functions) have some common behavior. Each starts by * constructing a temporary object of type std::basic_ostream::sentry. * This can have several effects, concluding with the setting of a * status flag; see the sentry documentation for more. * * If the sentry status is good, the function tries to generate * whatever data is appropriate for the type of the argument. * * If an exception is thrown during insertion, ios_base::badbit * will be turned on in the stream's error state without causing an * ios_base::failure to be thrown. The original exception will then * be rethrown. */ //@{ /** * @brief Integer arithmetic inserters * @param __n A variable of builtin integral type. * @return @c *this if successful * * These functions use the stream's current locale (specifically, the * @c num_get facet) to perform numeric formatting. */ __ostream_type& operator<<(long __n) { return _M_insert(__n); } __ostream_type& operator<<(unsigned long __n) { return _M_insert(__n); } __ostream_type& operator<<(bool __n) { return _M_insert(__n); } __ostream_type& operator<<(short __n); __ostream_type& operator<<(unsigned short __n) { // _GLIBCXX_RESOLVE_LIB_DEFECTS // 117. basic_ostream uses nonexistent num_put member functions. return _M_insert(static_cast(__n)); } __ostream_type& operator<<(int __n); __ostream_type& operator<<(unsigned int __n) { // _GLIBCXX_RESOLVE_LIB_DEFECTS // 117. basic_ostream uses nonexistent num_put member functions. return _M_insert(static_cast(__n)); } #ifdef _GLIBCXX_USE_LONG_LONG __ostream_type& operator<<(long long __n) { return _M_insert(__n); } __ostream_type& operator<<(unsigned long long __n) { return _M_insert(__n); } #endif # 208 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ostream" 3 //@} //@{ /** * @brief Floating point arithmetic inserters * @param __f A variable of builtin floating point type. * @return @c *this if successful * * These functions use the stream's current locale (specifically, the * @c num_get facet) to perform numeric formatting. */ __ostream_type& operator<<(double __f) { return _M_insert(__f); } __ostream_type& operator<<(float __f) { // _GLIBCXX_RESOLVE_LIB_DEFECTS // 117. basic_ostream uses nonexistent num_put member functions. return _M_insert(static_cast(__f)); } __ostream_type& operator<<(long double __f) { return _M_insert(__f); } //@} /** * @brief Pointer arithmetic inserters * @param __p A variable of pointer type. * @return @c *this if successful * * These functions use the stream's current locale (specifically, the * @c num_get facet) to perform numeric formatting. */ __ostream_type& operator<<(const void* __p) { return _M_insert(__p); } /** * @brief Extracting from another streambuf. * @param __sb A pointer to a streambuf * * This function behaves like one of the basic arithmetic extractors, * in that it also constructs a sentry object and has the same error * handling behavior. * * If @p __sb is NULL, the stream will set failbit in its error state. * * Characters are extracted from @p __sb and inserted into @c *this * until one of the following occurs: * * - the input stream reaches end-of-file, * - insertion into the output sequence fails (in this case, the * character that would have been inserted is not extracted), or * - an exception occurs while getting a character from @p __sb, which * sets failbit in the error state * * If the function inserts no characters, failbit is set. */ __ostream_type& operator<<(__streambuf_type* __sb); //@} //@{ /** * @name Unformatted Output Functions * * All the unformatted output functions have some common behavior. * Each starts by constructing a temporary object of type * std::basic_ostream::sentry. This has several effects, concluding * with the setting of a status flag; see the sentry documentation * for more. * * If the sentry status is good, the function tries to generate * whatever data is appropriate for the type of the argument. * * If an exception is thrown during insertion, ios_base::badbit * will be turned on in the stream's error state. If badbit is on in * the stream's exceptions mask, the exception will be rethrown * without completing its actions. */ /** * @brief Simple insertion. * @param __c The character to insert. * @return *this * * Tries to insert @p __c. * * @note This function is not overloaded on signed char and * unsigned char. */ __ostream_type& put(char_type __c); /** * @brief Core write functionality, without sentry. * @param __s The array to insert. * @param __n Maximum number of characters to insert. */ void _M_write(const char_type* __s, streamsize __n) { const streamsize __put = this->rdbuf()->sputn(__s, __n); if (__put != __n) this->setstate(ios_base::badbit); } /** * @brief Character string insertion. * @param __s The array to insert. * @param __n Maximum number of characters to insert. * @return *this * * Characters are copied from @p __s and inserted into the stream until * one of the following happens: * * - @p __n characters are inserted * - inserting into the output sequence fails (in this case, badbit * will be set in the stream's error state) * * @note This function is not overloaded on signed char and * unsigned char. */ __ostream_type& write(const char_type* __s, streamsize __n); //@} /** * @brief Synchronizing the stream buffer. * @return *this * * If @c rdbuf() is a null pointer, changes nothing. * * Otherwise, calls @c rdbuf()->pubsync(), and if that returns -1, * sets badbit. */ __ostream_type& flush(); /** * @brief Getting the current write position. * @return A file position object. * * If @c fail() is not false, returns @c pos_type(-1) to indicate * failure. Otherwise returns @c rdbuf()->pubseekoff(0,cur,out). */ pos_type tellp(); /** * @brief Changing the current write position. * @param __pos A file position object. * @return *this * * If @c fail() is not true, calls @c rdbuf()->pubseekpos(pos). If * that function fails, sets failbit. */ __ostream_type& seekp(pos_type); /** * @brief Changing the current write position. * @param __off A file offset object. * @param __dir The direction in which to seek. * @return *this * * If @c fail() is not true, calls @c rdbuf()->pubseekoff(off,dir). * If that function fails, sets failbit. */ __ostream_type& seekp(off_type, ios_base::seekdir); protected: basic_ostream() { this->init(0); } #if __cplusplus >= 201103L // Non-standard constructor that does not call init() basic_ostream(basic_iostream<_CharT, _Traits>&) { } basic_ostream(const basic_ostream&) = delete; basic_ostream(basic_ostream&& __rhs) : __ios_type() { __ios_type::move(__rhs); } // 27.7.3.3 Assign/swap basic_ostream& operator=(const basic_ostream&) = delete; basic_ostream& operator=(basic_ostream&& __rhs) { swap(__rhs); return *this; } void swap(basic_ostream& __rhs) { __ios_type::swap(__rhs); } #endif # 412 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ostream" 3 template __ostream_type& _M_insert(_ValueT __v); }; /** * @brief Performs setup work for output streams. * * Objects of this class are created before all of the standard * inserters are run. It is responsible for exception-safe prefix and * suffix operations. */ template class basic_ostream<_CharT, _Traits>::sentry { // Data Members. bool _M_ok; basic_ostream<_CharT, _Traits>& _M_os; public: /** * @brief The constructor performs preparatory work. * @param __os The output stream to guard. * * If the stream state is good (@a __os.good() is true), then if the * stream is tied to another output stream, @c is.tie()->flush() * is called to synchronize the output sequences. * * If the stream state is still good, then the sentry state becomes * true (@a okay). */ explicit sentry(basic_ostream<_CharT, _Traits>& __os); /** * @brief Possibly flushes the stream. * * If @c ios_base::unitbuf is set in @c os.flags(), and * @c std::uncaught_exception() is true, the sentry destructor calls * @c flush() on the output stream. */ ~sentry() { // XXX MT if (bool(_M_os.flags() & ios_base::unitbuf) && !uncaught_exception()) { // Can't call flush directly or else will get into recursive lock. if (_M_os.rdbuf() && _M_os.rdbuf()->pubsync() == -1) _M_os.setstate(ios_base::badbit); } } /** * @brief Quick status checking. * @return The sentry state. * * For ease of use, sentries may be converted to booleans. The * return value is that of the sentry state (true == okay). */ #if __cplusplus >= 201103L explicit #endif # 475 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ostream" 3 operator bool() const { return _M_ok; } }; //@{ /** * @brief Character inserters * @param __out An output stream. * @param __c A character. * @return out * * Behaves like one of the formatted arithmetic inserters described in * std::basic_ostream. After constructing a sentry object with good * status, this function inserts a single character and any required * padding (as determined by [22.2.2.2.2]). @c __out.width(0) is then * called. * * If @p __c is of type @c char and the character type of the stream is not * @c char, the character is widened before insertion. */ template inline basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c) { return __ostream_insert(__out, &__c, 1); } template inline basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __out, char __c) { return (__out << __out.widen(__c)); } // Specialization template inline basic_ostream& operator<<(basic_ostream& __out, char __c) { return __ostream_insert(__out, &__c, 1); } // Signed and unsigned template inline basic_ostream& operator<<(basic_ostream& __out, signed char __c) { return (__out << static_cast(__c)); } template inline basic_ostream& operator<<(basic_ostream& __out, unsigned char __c) { return (__out << static_cast(__c)); } //@} //@{ /** * @brief String inserters * @param __out An output stream. * @param __s A character string. * @return out * @pre @p __s must be a non-NULL pointer * * Behaves like one of the formatted arithmetic inserters described in * std::basic_ostream. After constructing a sentry object with good * status, this function inserts @c traits::length(__s) characters starting * at @p __s, widened if necessary, followed by any required padding (as * determined by [22.2.2.2.2]). @c __out.width(0) is then called. */ template inline basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s) { if (!__s) __out.setstate(ios_base::badbit); else __ostream_insert(__out, __s, static_cast(_Traits::length(__s))); return __out; } template basic_ostream<_CharT, _Traits> & operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s); // Partial specializations template inline basic_ostream& operator<<(basic_ostream& __out, const char* __s) { if (!__s) __out.setstate(ios_base::badbit); else __ostream_insert(__out, __s, static_cast(_Traits::length(__s))); return __out; } // Signed and unsigned template inline basic_ostream& operator<<(basic_ostream& __out, const signed char* __s) { return (__out << reinterpret_cast(__s)); } template inline basic_ostream & operator<<(basic_ostream& __out, const unsigned char* __s) { return (__out << reinterpret_cast(__s)); } //@} // Standard basic_ostream manipulators /** * @brief Write a newline and flush the stream. * * This manipulator is often mistakenly used when a simple newline is * desired, leading to poor buffering performance. See * https://gcc.gnu.org/onlinedocs/libstdc++/manual/streambufs.html#io.streambuf.buffering * for more on this subject. */ template inline basic_ostream<_CharT, _Traits>& endl(basic_ostream<_CharT, _Traits>& __os) { return flush(__os.put(__os.widen('\n'))); } /** * @brief Write a null character into the output sequence. * * Null character is @c CharT() by definition. For CharT * of @c char, this correctly writes the ASCII @c NUL character * string terminator. */ template inline basic_ostream<_CharT, _Traits>& ends(basic_ostream<_CharT, _Traits>& __os) { return __os.put(_CharT()); } /** * @brief Flushes the output stream. * * This manipulator simply calls the stream's @c flush() member function. */ template inline basic_ostream<_CharT, _Traits>& flush(basic_ostream<_CharT, _Traits>& __os) { return __os.flush(); } #if __cplusplus >= 201103L /** * @brief Generic inserter for rvalue stream * @param __os An input stream. * @param __x A reference to the object being inserted. * @return os * * This is just a forwarding function to allow insertion to * rvalue streams since they won't bind to the inserter functions * that take an lvalue reference. */ template inline basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>&& __os, const _Tp& __x) { __os << __x; return __os; } #endif // C++11 # 634 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ostream" 3 _GLIBCXX_END_NAMESPACE_VERSION } // namespace std #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 638 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ostream" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/ostream.tcc" 1 3 // ostream classes -*- C++ -*- // Copyright (C) 1997-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file bits/ostream.tcc * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{ostream} */ // // ISO C++ 14882: 27.6.2 Output streams // #ifndef _OSTREAM_TCC #define _OSTREAM_TCC 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 38 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/ostream.tcc" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/ostream.tcc" 3 # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/ostream.tcc" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION template basic_ostream<_CharT, _Traits>::sentry:: sentry(basic_ostream<_CharT, _Traits>& __os) : _M_ok(false), _M_os(__os) { // XXX MT if (__os.tie() && __os.good()) __os.tie()->flush(); if (__os.good()) _M_ok = true; else __os.setstate(ios_base::failbit); } template template basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>:: _M_insert(_ValueT __v) { sentry __cerb(*this); if (__cerb) { ios_base::iostate __err = ios_base::goodbit; __try { const __num_put_type& __np = __check_facet(this->_M_num_put); if (__np.put(*this, *this, this->fill(), __v).failed()) __err |= ios_base::badbit; } __catch(__cxxabiv1::__forced_unwind&) { this->_M_setstate(ios_base::badbit); __throw_exception_again; } __catch(...) { this->_M_setstate(ios_base::badbit); } if (__err) this->setstate(__err); } return *this; } template basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>:: operator<<(short __n) { // _GLIBCXX_RESOLVE_LIB_DEFECTS // 117. basic_ostream uses nonexistent num_put member functions. const ios_base::fmtflags __fmt = this->flags() & ios_base::basefield; if (__fmt == ios_base::oct || __fmt == ios_base::hex) return _M_insert(static_cast(static_cast(__n))); else return _M_insert(static_cast(__n)); } template basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>:: operator<<(int __n) { // _GLIBCXX_RESOLVE_LIB_DEFECTS // 117. basic_ostream uses nonexistent num_put member functions. const ios_base::fmtflags __fmt = this->flags() & ios_base::basefield; if (__fmt == ios_base::oct || __fmt == ios_base::hex) return _M_insert(static_cast(static_cast(__n))); else return _M_insert(static_cast(__n)); } template basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>:: operator<<(__streambuf_type* __sbin) { ios_base::iostate __err = ios_base::goodbit; sentry __cerb(*this); if (__cerb && __sbin) { __try { if (!__copy_streambufs(__sbin, this->rdbuf())) __err |= ios_base::failbit; } __catch(__cxxabiv1::__forced_unwind&) { this->_M_setstate(ios_base::badbit); __throw_exception_again; } __catch(...) { this->_M_setstate(ios_base::failbit); } } else if (!__sbin) __err |= ios_base::badbit; if (__err) this->setstate(__err); return *this; } template basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>:: put(char_type __c) { // _GLIBCXX_RESOLVE_LIB_DEFECTS // DR 60. What is a formatted input function? // basic_ostream::put(char_type) is an unformatted output function. // DR 63. Exception-handling policy for unformatted output. // Unformatted output functions should catch exceptions thrown // from streambuf members. sentry __cerb(*this); if (__cerb) { ios_base::iostate __err = ios_base::goodbit; __try { const int_type __put = this->rdbuf()->sputc(__c); if (traits_type::eq_int_type(__put, traits_type::eof())) __err |= ios_base::badbit; } __catch(__cxxabiv1::__forced_unwind&) { this->_M_setstate(ios_base::badbit); __throw_exception_again; } __catch(...) { this->_M_setstate(ios_base::badbit); } if (__err) this->setstate(__err); } return *this; } template basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>:: write(const _CharT* __s, streamsize __n) { // _GLIBCXX_RESOLVE_LIB_DEFECTS // DR 60. What is a formatted input function? // basic_ostream::write(const char_type*, streamsize) is an // unformatted output function. // DR 63. Exception-handling policy for unformatted output. // Unformatted output functions should catch exceptions thrown // from streambuf members. sentry __cerb(*this); if (__cerb) { __try { _M_write(__s, __n); } __catch(__cxxabiv1::__forced_unwind&) { this->_M_setstate(ios_base::badbit); __throw_exception_again; } __catch(...) { this->_M_setstate(ios_base::badbit); } } return *this; } template basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>:: flush() { // _GLIBCXX_RESOLVE_LIB_DEFECTS // DR 60. What is a formatted input function? // basic_ostream::flush() is *not* an unformatted output function. ios_base::iostate __err = ios_base::goodbit; __try { if (this->rdbuf() && this->rdbuf()->pubsync() == -1) __err |= ios_base::badbit; } __catch(__cxxabiv1::__forced_unwind&) { this->_M_setstate(ios_base::badbit); __throw_exception_again; } __catch(...) { this->_M_setstate(ios_base::badbit); } if (__err) this->setstate(__err); return *this; } template typename basic_ostream<_CharT, _Traits>::pos_type basic_ostream<_CharT, _Traits>:: tellp() { pos_type __ret = pos_type(-1); __try { if (!this->fail()) __ret = this->rdbuf()->pubseekoff(0, ios_base::cur, ios_base::out); } __catch(__cxxabiv1::__forced_unwind&) { this->_M_setstate(ios_base::badbit); __throw_exception_again; } __catch(...) { this->_M_setstate(ios_base::badbit); } return __ret; } template basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>:: seekp(pos_type __pos) { ios_base::iostate __err = ios_base::goodbit; __try { if (!this->fail()) { // _GLIBCXX_RESOLVE_LIB_DEFECTS // 136. seekp, seekg setting wrong streams? const pos_type __p = this->rdbuf()->pubseekpos(__pos, ios_base::out); // 129. Need error indication from seekp() and seekg() if (__p == pos_type(off_type(-1))) __err |= ios_base::failbit; } } __catch(__cxxabiv1::__forced_unwind&) { this->_M_setstate(ios_base::badbit); __throw_exception_again; } __catch(...) { this->_M_setstate(ios_base::badbit); } if (__err) this->setstate(__err); return *this; } template basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>:: seekp(off_type __off, ios_base::seekdir __dir) { ios_base::iostate __err = ios_base::goodbit; __try { if (!this->fail()) { // _GLIBCXX_RESOLVE_LIB_DEFECTS // 136. seekp, seekg setting wrong streams? const pos_type __p = this->rdbuf()->pubseekoff(__off, __dir, ios_base::out); // 129. Need error indication from seekp() and seekg() if (__p == pos_type(off_type(-1))) __err |= ios_base::failbit; } } __catch(__cxxabiv1::__forced_unwind&) { this->_M_setstate(ios_base::badbit); __throw_exception_again; } __catch(...) { this->_M_setstate(ios_base::badbit); } if (__err) this->setstate(__err); return *this; } template basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s) { if (!__s) __out.setstate(ios_base::badbit); else { // _GLIBCXX_RESOLVE_LIB_DEFECTS // 167. Improper use of traits_type::length() const size_t __clen = char_traits::length(__s); __try { struct __ptr_guard { _CharT *__p; __ptr_guard (_CharT *__ip): __p(__ip) { } ~__ptr_guard() { delete[] __p; } _CharT* __get() { return __p; } } __pg (new _CharT[__clen]); _CharT *__ws = __pg.__get(); for (size_t __i = 0; __i < __clen; ++__i) __ws[__i] = __out.widen(__s[__i]); __ostream_insert(__out, __ws, __clen); } __catch(__cxxabiv1::__forced_unwind&) { __out._M_setstate(ios_base::badbit); __throw_exception_again; } __catch(...) { __out._M_setstate(ios_base::badbit); } } return __out; } // Inhibit implicit instantiations for required instantiations, // which are defined via explicit instantiations elsewhere. #if _GLIBCXX_EXTERN_TEMPLATE extern template class basic_ostream; extern template ostream& endl(ostream&); extern template ostream& ends(ostream&); extern template ostream& flush(ostream&); extern template ostream& operator<<(ostream&, char); extern template ostream& operator<<(ostream&, unsigned char); extern template ostream& operator<<(ostream&, signed char); extern template ostream& operator<<(ostream&, const char*); extern template ostream& operator<<(ostream&, const unsigned char*); extern template ostream& operator<<(ostream&, const signed char*); extern template ostream& ostream::_M_insert(long); extern template ostream& ostream::_M_insert(unsigned long); extern template ostream& ostream::_M_insert(bool); #ifdef _GLIBCXX_USE_LONG_LONG extern template ostream& ostream::_M_insert(long long); extern template ostream& ostream::_M_insert(unsigned long long); #endif # 377 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/ostream.tcc" 3 extern template ostream& ostream::_M_insert(double); extern template ostream& ostream::_M_insert(long double); extern template ostream& ostream::_M_insert(const void*); #ifdef _GLIBCXX_USE_WCHAR_T extern template class basic_ostream; extern template wostream& endl(wostream&); extern template wostream& ends(wostream&); extern template wostream& flush(wostream&); extern template wostream& operator<<(wostream&, wchar_t); extern template wostream& operator<<(wostream&, char); extern template wostream& operator<<(wostream&, const wchar_t*); extern template wostream& operator<<(wostream&, const char*); extern template wostream& wostream::_M_insert(long); extern template wostream& wostream::_M_insert(unsigned long); extern template wostream& wostream::_M_insert(bool); #ifdef _GLIBCXX_USE_LONG_LONG extern template wostream& wostream::_M_insert(long long); extern template wostream& wostream::_M_insert(unsigned long long); #endif # 398 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/ostream.tcc" 3 extern template wostream& wostream::_M_insert(double); extern template wostream& wostream::_M_insert(long double); extern template wostream& wostream::_M_insert(const void*); #endif # 402 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/ostream.tcc" 3 #endif # 403 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/ostream.tcc" 3 _GLIBCXX_END_NAMESPACE_VERSION } // namespace std #endif # 408 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/ostream.tcc" 3 # 639 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ostream" 2 3 #endif /* _GLIBCXX_OSTREAM */ # 641 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ostream" 3 # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/iostream" 2 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/iostream" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/istream" 1 3 // Input streams -*- C++ -*- // Copyright (C) 1997-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . // // ISO C++ 14882: 27.6.1 Input streams // /** @file include/istream * This is a Standard C++ Library header. */ #ifndef _GLIBCXX_ISTREAM #define _GLIBCXX_ISTREAM 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 37 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/istream" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 38 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/istream" 3 # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/istream" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/istream" 3 # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/istream" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION /** * @brief Template class basic_istream. * @ingroup io * * @tparam _CharT Type of character stream. * @tparam _Traits Traits for character type, defaults to * char_traits<_CharT>. * * This is the base class for all input streams. It provides text * formatting of all builtin types, and communicates with any class * derived from basic_streambuf to do the actual input. */ template class basic_istream : virtual public basic_ios<_CharT, _Traits> { public: // Types (inherited from basic_ios (27.4.4)): typedef _CharT char_type; typedef typename _Traits::int_type int_type; typedef typename _Traits::pos_type pos_type; typedef typename _Traits::off_type off_type; typedef _Traits traits_type; // Non-standard Types: typedef basic_streambuf<_CharT, _Traits> __streambuf_type; typedef basic_ios<_CharT, _Traits> __ios_type; typedef basic_istream<_CharT, _Traits> __istream_type; typedef num_get<_CharT, istreambuf_iterator<_CharT, _Traits> > __num_get_type; typedef ctype<_CharT> __ctype_type; protected: // Data Members: /** * The number of characters extracted in the previous unformatted * function; see gcount(). */ streamsize _M_gcount; public: /** * @brief Base constructor. * * This ctor is almost never called by the user directly, rather from * derived classes' initialization lists, which pass a pointer to * their own stream buffer. */ explicit basic_istream(__streambuf_type* __sb) : _M_gcount(streamsize(0)) { this->init(__sb); } /** * @brief Base destructor. * * This does very little apart from providing a virtual base dtor. */ virtual ~basic_istream() { _M_gcount = streamsize(0); } /// Safe prefix/suffix operations. class sentry; friend class sentry; //@{ /** * @brief Interface for manipulators. * * Manipulators such as @c std::ws and @c std::dec use these * functions in constructs like * std::cin >> std::ws. * For more information, see the iomanip header. */ __istream_type& operator>>(__istream_type& (*__pf)(__istream_type&)) { return __pf(*this); } __istream_type& operator>>(__ios_type& (*__pf)(__ios_type&)) { __pf(*this); return *this; } __istream_type& operator>>(ios_base& (*__pf)(ios_base&)) { __pf(*this); return *this; } //@} //@{ /** * @name Extractors * * All the @c operator>> functions (aka formatted input * functions) have some common behavior. Each starts by * constructing a temporary object of type std::basic_istream::sentry * with the second argument (noskipws) set to false. This has several * effects, concluding with the setting of a status flag; see the * sentry documentation for more. * * If the sentry status is good, the function tries to extract * whatever data is appropriate for the type of the argument. * * If an exception is thrown during extraction, ios_base::badbit * will be turned on in the stream's error state without causing an * ios_base::failure to be thrown. The original exception will then * be rethrown. */ //@{ /** * @brief Integer arithmetic extractors * @param __n A variable of builtin integral type. * @return @c *this if successful * * These functions use the stream's current locale (specifically, the * @c num_get facet) to parse the input data. */ __istream_type& operator>>(bool& __n) { return _M_extract(__n); } __istream_type& operator>>(short& __n); __istream_type& operator>>(unsigned short& __n) { return _M_extract(__n); } __istream_type& operator>>(int& __n); __istream_type& operator>>(unsigned int& __n) { return _M_extract(__n); } __istream_type& operator>>(long& __n) { return _M_extract(__n); } __istream_type& operator>>(unsigned long& __n) { return _M_extract(__n); } #ifdef _GLIBCXX_USE_LONG_LONG __istream_type& operator>>(long long& __n) { return _M_extract(__n); } __istream_type& operator>>(unsigned long long& __n) { return _M_extract(__n); } #endif # 202 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/istream" 3 //@} //@{ /** * @brief Floating point arithmetic extractors * @param __f A variable of builtin floating point type. * @return @c *this if successful * * These functions use the stream's current locale (specifically, the * @c num_get facet) to parse the input data. */ __istream_type& operator>>(float& __f) { return _M_extract(__f); } __istream_type& operator>>(double& __f) { return _M_extract(__f); } __istream_type& operator>>(long double& __f) { return _M_extract(__f); } //@} /** * @brief Basic arithmetic extractors * @param __p A variable of pointer type. * @return @c *this if successful * * These functions use the stream's current locale (specifically, the * @c num_get facet) to parse the input data. */ __istream_type& operator>>(void*& __p) { return _M_extract(__p); } /** * @brief Extracting into another streambuf. * @param __sb A pointer to a streambuf * * This function behaves like one of the basic arithmetic extractors, * in that it also constructs a sentry object and has the same error * handling behavior. * * If @p __sb is NULL, the stream will set failbit in its error state. * * Characters are extracted from this stream and inserted into the * @p __sb streambuf until one of the following occurs: * * - the input stream reaches end-of-file, * - insertion into the output buffer fails (in this case, the * character that would have been inserted is not extracted), or * - an exception occurs (and in this case is caught) * * If the function inserts no characters, failbit is set. */ __istream_type& operator>>(__streambuf_type* __sb); //@} // [27.6.1.3] unformatted input /** * @brief Character counting * @return The number of characters extracted by the previous * unformatted input function dispatched for this stream. */ streamsize gcount() const { return _M_gcount; } //@{ /** * @name Unformatted Input Functions * * All the unformatted input functions have some common behavior. * Each starts by constructing a temporary object of type * std::basic_istream::sentry with the second argument (noskipws) * set to true. This has several effects, concluding with the * setting of a status flag; see the sentry documentation for more. * * If the sentry status is good, the function tries to extract * whatever data is appropriate for the type of the argument. * * The number of characters extracted is stored for later retrieval * by gcount(). * * If an exception is thrown during extraction, ios_base::badbit * will be turned on in the stream's error state without causing an * ios_base::failure to be thrown. The original exception will then * be rethrown. */ /** * @brief Simple extraction. * @return A character, or eof(). * * Tries to extract a character. If none are available, sets failbit * and returns traits::eof(). */ int_type get(); /** * @brief Simple extraction. * @param __c The character in which to store data. * @return *this * * Tries to extract a character and store it in @a __c. If none are * available, sets failbit and returns traits::eof(). * * @note This function is not overloaded on signed char and * unsigned char. */ __istream_type& get(char_type& __c); /** * @brief Simple multiple-character extraction. * @param __s Pointer to an array. * @param __n Maximum number of characters to store in @a __s. * @param __delim A "stop" character. * @return *this * * Characters are extracted and stored into @a __s until one of the * following happens: * * - @c __n-1 characters are stored * - the input sequence reaches EOF * - the next character equals @a __delim, in which case the character * is not extracted * * If no characters are stored, failbit is set in the stream's error * state. * * In any case, a null character is stored into the next location in * the array. * * @note This function is not overloaded on signed char and * unsigned char. */ __istream_type& get(char_type* __s, streamsize __n, char_type __delim); /** * @brief Simple multiple-character extraction. * @param __s Pointer to an array. * @param __n Maximum number of characters to store in @a s. * @return *this * * Returns @c get(__s,__n,widen('\\n')). */ __istream_type& get(char_type* __s, streamsize __n) { return this->get(__s, __n, this->widen('\n')); } /** * @brief Extraction into another streambuf. * @param __sb A streambuf in which to store data. * @param __delim A "stop" character. * @return *this * * Characters are extracted and inserted into @a __sb until one of the * following happens: * * - the input sequence reaches EOF * - insertion into the output buffer fails (in this case, the * character that would have been inserted is not extracted) * - the next character equals @a __delim (in this case, the character * is not extracted) * - an exception occurs (and in this case is caught) * * If no characters are stored, failbit is set in the stream's error * state. */ __istream_type& get(__streambuf_type& __sb, char_type __delim); /** * @brief Extraction into another streambuf. * @param __sb A streambuf in which to store data. * @return *this * * Returns @c get(__sb,widen('\\n')). */ __istream_type& get(__streambuf_type& __sb) { return this->get(__sb, this->widen('\n')); } /** * @brief String extraction. * @param __s A character array in which to store the data. * @param __n Maximum number of characters to extract. * @param __delim A "stop" character. * @return *this * * Extracts and stores characters into @a __s until one of the * following happens. Note that these criteria are required to be * tested in the order listed here, to allow an input line to exactly * fill the @a __s array without setting failbit. * * -# the input sequence reaches end-of-file, in which case eofbit * is set in the stream error state * -# the next character equals @c __delim, in which case the character * is extracted (and therefore counted in @c gcount()) but not stored * -# @c __n-1 characters are stored, in which case failbit is set * in the stream error state * * If no characters are extracted, failbit is set. (An empty line of * input should therefore not cause failbit to be set.) * * In any case, a null character is stored in the next location in * the array. */ __istream_type& getline(char_type* __s, streamsize __n, char_type __delim); /** * @brief String extraction. * @param __s A character array in which to store the data. * @param __n Maximum number of characters to extract. * @return *this * * Returns @c getline(__s,__n,widen('\\n')). */ __istream_type& getline(char_type* __s, streamsize __n) { return this->getline(__s, __n, this->widen('\n')); } /** * @brief Discarding characters * @param __n Number of characters to discard. * @param __delim A "stop" character. * @return *this * * Extracts characters and throws them away until one of the * following happens: * - if @a __n @c != @c std::numeric_limits::max(), @a __n * characters are extracted * - the input sequence reaches end-of-file * - the next character equals @a __delim (in this case, the character * is extracted); note that this condition will never occur if * @a __delim equals @c traits::eof(). * * NB: Provide three overloads, instead of the single function * (with defaults) mandated by the Standard: this leads to a * better performing implementation, while still conforming to * the Standard. */ __istream_type& ignore(streamsize __n, int_type __delim); __istream_type& ignore(streamsize __n); __istream_type& ignore(); /** * @brief Looking ahead in the stream * @return The next character, or eof(). * * If, after constructing the sentry object, @c good() is false, * returns @c traits::eof(). Otherwise reads but does not extract * the next input character. */ int_type peek(); /** * @brief Extraction without delimiters. * @param __s A character array. * @param __n Maximum number of characters to store. * @return *this * * If the stream state is @c good(), extracts characters and stores * them into @a __s until one of the following happens: * - @a __n characters are stored * - the input sequence reaches end-of-file, in which case the error * state is set to @c failbit|eofbit. * * @note This function is not overloaded on signed char and * unsigned char. */ __istream_type& read(char_type* __s, streamsize __n); /** * @brief Extraction until the buffer is exhausted, but no more. * @param __s A character array. * @param __n Maximum number of characters to store. * @return The number of characters extracted. * * Extracts characters and stores them into @a __s depending on the * number of characters remaining in the streambuf's buffer, * @c rdbuf()->in_avail(), called @c A here: * - if @c A @c == @c -1, sets eofbit and extracts no characters * - if @c A @c == @c 0, extracts no characters * - if @c A @c > @c 0, extracts @c min(A,n) * * The goal is to empty the current buffer, and to not request any * more from the external input sequence controlled by the streambuf. */ streamsize readsome(char_type* __s, streamsize __n); /** * @brief Unextracting a single character. * @param __c The character to push back into the input stream. * @return *this * * If @c rdbuf() is not null, calls @c rdbuf()->sputbackc(c). * * If @c rdbuf() is null or if @c sputbackc() fails, sets badbit in * the error state. * * @note This function first clears eofbit. Since no characters * are extracted, the next call to @c gcount() will return 0, * as required by DR 60. */ __istream_type& putback(char_type __c); /** * @brief Unextracting the previous character. * @return *this * * If @c rdbuf() is not null, calls @c rdbuf()->sungetc(c). * * If @c rdbuf() is null or if @c sungetc() fails, sets badbit in * the error state. * * @note This function first clears eofbit. Since no characters * are extracted, the next call to @c gcount() will return 0, * as required by DR 60. */ __istream_type& unget(); /** * @brief Synchronizing the stream buffer. * @return 0 on success, -1 on failure * * If @c rdbuf() is a null pointer, returns -1. * * Otherwise, calls @c rdbuf()->pubsync(), and if that returns -1, * sets badbit and returns -1. * * Otherwise, returns 0. * * @note This function does not count the number of characters * extracted, if any, and therefore does not affect the next * call to @c gcount(). */ int sync(); /** * @brief Getting the current read position. * @return A file position object. * * If @c fail() is not false, returns @c pos_type(-1) to indicate * failure. Otherwise returns @c rdbuf()->pubseekoff(0,cur,in). * * @note This function does not count the number of characters * extracted, if any, and therefore does not affect the next * call to @c gcount(). At variance with putback, unget and * seekg, eofbit is not cleared first. */ pos_type tellg(); /** * @brief Changing the current read position. * @param __pos A file position object. * @return *this * * If @c fail() is not true, calls @c rdbuf()->pubseekpos(__pos). If * that function fails, sets failbit. * * @note This function first clears eofbit. It does not count the * number of characters extracted, if any, and therefore does * not affect the next call to @c gcount(). */ __istream_type& seekg(pos_type); /** * @brief Changing the current read position. * @param __off A file offset object. * @param __dir The direction in which to seek. * @return *this * * If @c fail() is not true, calls @c rdbuf()->pubseekoff(__off,__dir). * If that function fails, sets failbit. * * @note This function first clears eofbit. It does not count the * number of characters extracted, if any, and therefore does * not affect the next call to @c gcount(). */ __istream_type& seekg(off_type, ios_base::seekdir); //@} protected: basic_istream() : _M_gcount(streamsize(0)) { this->init(0); } #if __cplusplus >= 201103L basic_istream(const basic_istream&) = delete; basic_istream(basic_istream&& __rhs) : __ios_type(), _M_gcount(__rhs._M_gcount) { __ios_type::move(__rhs); __rhs._M_gcount = 0; } // 27.7.3.3 Assign/swap basic_istream& operator=(const basic_istream&) = delete; basic_istream& operator=(basic_istream&& __rhs) { swap(__rhs); return *this; } void swap(basic_istream& __rhs) { __ios_type::swap(__rhs); std::swap(_M_gcount, __rhs._M_gcount); } #endif # 638 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/istream" 3 template __istream_type& _M_extract(_ValueT& __v); }; /// Explicit specialization declarations, defined in src/istream.cc. template<> basic_istream& basic_istream:: getline(char_type* __s, streamsize __n, char_type __delim); template<> basic_istream& basic_istream:: ignore(streamsize __n); template<> basic_istream& basic_istream:: ignore(streamsize __n, int_type __delim); #ifdef _GLIBCXX_USE_WCHAR_T template<> basic_istream& basic_istream:: getline(char_type* __s, streamsize __n, char_type __delim); template<> basic_istream& basic_istream:: ignore(streamsize __n); template<> basic_istream& basic_istream:: ignore(streamsize __n, int_type __delim); #endif # 676 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/istream" 3 /** * @brief Performs setup work for input streams. * * Objects of this class are created before all of the standard * extractors are run. It is responsible for exception-safe * prefix and suffix operations, although only prefix actions * are currently required by the standard. */ template class basic_istream<_CharT, _Traits>::sentry { // Data Members. bool _M_ok; public: /// Easy access to dependent types. typedef _Traits traits_type; typedef basic_streambuf<_CharT, _Traits> __streambuf_type; typedef basic_istream<_CharT, _Traits> __istream_type; typedef typename __istream_type::__ctype_type __ctype_type; typedef typename _Traits::int_type __int_type; /** * @brief The constructor performs all the work. * @param __is The input stream to guard. * @param __noskipws Whether to consume whitespace or not. * * If the stream state is good (@a __is.good() is true), then the * following actions are performed, otherwise the sentry state * is false (not okay) and failbit is set in the * stream state. * * The sentry's preparatory actions are: * * -# if the stream is tied to an output stream, @c is.tie()->flush() * is called to synchronize the output sequence * -# if @a __noskipws is false, and @c ios_base::skipws is set in * @c is.flags(), the sentry extracts and discards whitespace * characters from the stream. The currently imbued locale is * used to determine whether each character is whitespace. * * If the stream state is still good, then the sentry state becomes * true (@a okay). */ explicit sentry(basic_istream<_CharT, _Traits>& __is, bool __noskipws = false); /** * @brief Quick status checking. * @return The sentry state. * * For ease of use, sentries may be converted to booleans. The * return value is that of the sentry state (true == okay). */ #if __cplusplus >= 201103L explicit #endif # 734 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/istream" 3 operator bool() const { return _M_ok; } }; //@{ /** * @brief Character extractors * @param __in An input stream. * @param __c A character reference. * @return in * * Behaves like one of the formatted arithmetic extractors described in * std::basic_istream. After constructing a sentry object with good * status, this function extracts a character (if one is available) and * stores it in @a __c. Otherwise, sets failbit in the input stream. */ template basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c); template inline basic_istream& operator>>(basic_istream& __in, unsigned char& __c) { return (__in >> reinterpret_cast(__c)); } template inline basic_istream& operator>>(basic_istream& __in, signed char& __c) { return (__in >> reinterpret_cast(__c)); } //@} //@{ /** * @brief Character string extractors * @param __in An input stream. * @param __s A pointer to a character array. * @return __in * * Behaves like one of the formatted arithmetic extractors described in * std::basic_istream. After constructing a sentry object with good * status, this function extracts up to @c n characters and stores them * into the array starting at @a __s. @c n is defined as: * * - if @c width() is greater than zero, @c n is width() otherwise * - @c n is the number of elements of the largest array of * * - @c char_type that can store a terminating @c eos. * - [27.6.1.2.3]/6 * * Characters are extracted and stored until one of the following happens: * - @c n-1 characters are stored * - EOF is reached * - the next character is whitespace according to the current locale * - the next character is a null byte (i.e., @c charT() ) * * @c width(0) is then called for the input stream. * * If no characters are extracted, sets failbit. */ template basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s); // Explicit specialization declaration, defined in src/istream.cc. template<> basic_istream& operator>>(basic_istream& __in, char* __s); template inline basic_istream& operator>>(basic_istream& __in, unsigned char* __s) { return (__in >> reinterpret_cast(__s)); } template inline basic_istream& operator>>(basic_istream& __in, signed char* __s) { return (__in >> reinterpret_cast(__s)); } //@} /** * @brief Template class basic_iostream * @ingroup io * * @tparam _CharT Type of character stream. * @tparam _Traits Traits for character type, defaults to * char_traits<_CharT>. * * This class multiply inherits from the input and output stream classes * simply to provide a single interface. */ template class basic_iostream : public basic_istream<_CharT, _Traits>, public basic_ostream<_CharT, _Traits> { public: // _GLIBCXX_RESOLVE_LIB_DEFECTS // 271. basic_iostream missing typedefs // Types (inherited): typedef _CharT char_type; typedef typename _Traits::int_type int_type; typedef typename _Traits::pos_type pos_type; typedef typename _Traits::off_type off_type; typedef _Traits traits_type; // Non-standard Types: typedef basic_istream<_CharT, _Traits> __istream_type; typedef basic_ostream<_CharT, _Traits> __ostream_type; /** * @brief Constructor does nothing. * * Both of the parent classes are initialized with the same * streambuf pointer passed to this constructor. */ explicit basic_iostream(basic_streambuf<_CharT, _Traits>* __sb) : __istream_type(__sb), __ostream_type(__sb) { } /** * @brief Destructor does nothing. */ virtual ~basic_iostream() { } protected: basic_iostream() : __istream_type(), __ostream_type() { } #if __cplusplus >= 201103L basic_iostream(const basic_iostream&) = delete; basic_iostream(basic_iostream&& __rhs) : __istream_type(std::move(__rhs)), __ostream_type(*this) { } // 27.7.3.3 Assign/swap basic_iostream& operator=(const basic_iostream&) = delete; basic_iostream& operator=(basic_iostream&& __rhs) { swap(__rhs); return *this; } void swap(basic_iostream& __rhs) { __istream_type::swap(__rhs); } #endif # 884 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/istream" 3 }; /** * @brief Quick and easy way to eat whitespace * * This manipulator extracts whitespace characters, stopping when the * next character is non-whitespace, or when the input sequence is empty. * If the sequence is empty, @c eofbit is set in the stream, but not * @c failbit. * * The current locale is used to distinguish whitespace characters. * * Example: * @code * MyClass mc; * * std::cin >> std::ws >> mc; * @endcode * will skip leading whitespace before calling operator>> on cin and your * object. Note that the same effect can be achieved by creating a * std::basic_istream::sentry inside your definition of operator>>. */ template basic_istream<_CharT, _Traits>& ws(basic_istream<_CharT, _Traits>& __is); #if __cplusplus >= 201103L // [27.7.1.6] Rvalue stream extraction /** * @brief Generic extractor for rvalue stream * @param __is An input stream. * @param __x A reference to the extraction target. * @return is * * This is just a forwarding function to allow extraction from * rvalue streams since they won't bind to the extractor functions * that take an lvalue reference. */ template inline basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>&& __is, _Tp& __x) { __is >> __x; return __is; } #endif // C++11 # 930 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/istream" 3 _GLIBCXX_END_NAMESPACE_VERSION } // namespace #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 934 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/istream" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/istream.tcc" 1 3 // istream classes -*- C++ -*- // Copyright (C) 1997-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file bits/istream.tcc * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{istream} */ // // ISO C++ 14882: 27.6.1 Input streams // #ifndef _ISTREAM_TCC #define _ISTREAM_TCC 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 38 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/istream.tcc" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/istream.tcc" 3 # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/istream.tcc" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION template basic_istream<_CharT, _Traits>::sentry:: sentry(basic_istream<_CharT, _Traits>& __in, bool __noskip) : _M_ok(false) { ios_base::iostate __err = ios_base::goodbit; if (__in.good()) { if (__in.tie()) __in.tie()->flush(); if (!__noskip && bool(__in.flags() & ios_base::skipws)) { const __int_type __eof = traits_type::eof(); __streambuf_type* __sb = __in.rdbuf(); __int_type __c = __sb->sgetc(); const __ctype_type& __ct = __check_facet(__in._M_ctype); while (!traits_type::eq_int_type(__c, __eof) && __ct.is(ctype_base::space, traits_type::to_char_type(__c))) __c = __sb->snextc(); // _GLIBCXX_RESOLVE_LIB_DEFECTS // 195. Should basic_istream::sentry's constructor ever // set eofbit? if (traits_type::eq_int_type(__c, __eof)) __err |= ios_base::eofbit; } } if (__in.good() && __err == ios_base::goodbit) _M_ok = true; else { __err |= ios_base::failbit; __in.setstate(__err); } } template template basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>:: _M_extract(_ValueT& __v) { sentry __cerb(*this, false); if (__cerb) { ios_base::iostate __err = ios_base::goodbit; __try { const __num_get_type& __ng = __check_facet(this->_M_num_get); __ng.get(*this, 0, *this, __err, __v); } __catch(__cxxabiv1::__forced_unwind&) { this->_M_setstate(ios_base::badbit); __throw_exception_again; } __catch(...) { this->_M_setstate(ios_base::badbit); } if (__err) this->setstate(__err); } return *this; } template basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>:: operator>>(short& __n) { // _GLIBCXX_RESOLVE_LIB_DEFECTS // 118. basic_istream uses nonexistent num_get member functions. sentry __cerb(*this, false); if (__cerb) { ios_base::iostate __err = ios_base::goodbit; __try { long __l; const __num_get_type& __ng = __check_facet(this->_M_num_get); __ng.get(*this, 0, *this, __err, __l); // _GLIBCXX_RESOLVE_LIB_DEFECTS // 696. istream::operator>>(int&) broken. if (__l < __gnu_cxx::__numeric_traits::__min) { __err |= ios_base::failbit; __n = __gnu_cxx::__numeric_traits::__min; } else if (__l > __gnu_cxx::__numeric_traits::__max) { __err |= ios_base::failbit; __n = __gnu_cxx::__numeric_traits::__max; } else __n = short(__l); } __catch(__cxxabiv1::__forced_unwind&) { this->_M_setstate(ios_base::badbit); __throw_exception_again; } __catch(...) { this->_M_setstate(ios_base::badbit); } if (__err) this->setstate(__err); } return *this; } template basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>:: operator>>(int& __n) { // _GLIBCXX_RESOLVE_LIB_DEFECTS // 118. basic_istream uses nonexistent num_get member functions. sentry __cerb(*this, false); if (__cerb) { ios_base::iostate __err = ios_base::goodbit; __try { long __l; const __num_get_type& __ng = __check_facet(this->_M_num_get); __ng.get(*this, 0, *this, __err, __l); // _GLIBCXX_RESOLVE_LIB_DEFECTS // 696. istream::operator>>(int&) broken. if (__l < __gnu_cxx::__numeric_traits::__min) { __err |= ios_base::failbit; __n = __gnu_cxx::__numeric_traits::__min; } else if (__l > __gnu_cxx::__numeric_traits::__max) { __err |= ios_base::failbit; __n = __gnu_cxx::__numeric_traits::__max; } else __n = int(__l); } __catch(__cxxabiv1::__forced_unwind&) { this->_M_setstate(ios_base::badbit); __throw_exception_again; } __catch(...) { this->_M_setstate(ios_base::badbit); } if (__err) this->setstate(__err); } return *this; } template basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>:: operator>>(__streambuf_type* __sbout) { ios_base::iostate __err = ios_base::goodbit; sentry __cerb(*this, false); if (__cerb && __sbout) { __try { bool __ineof; if (!__copy_streambufs_eof(this->rdbuf(), __sbout, __ineof)) __err |= ios_base::failbit; if (__ineof) __err |= ios_base::eofbit; } __catch(__cxxabiv1::__forced_unwind&) { this->_M_setstate(ios_base::failbit); __throw_exception_again; } __catch(...) { this->_M_setstate(ios_base::failbit); } } else if (!__sbout) __err |= ios_base::failbit; if (__err) this->setstate(__err); return *this; } template typename basic_istream<_CharT, _Traits>::int_type basic_istream<_CharT, _Traits>:: get(void) { const int_type __eof = traits_type::eof(); int_type __c = __eof; _M_gcount = 0; ios_base::iostate __err = ios_base::goodbit; sentry __cerb(*this, true); if (__cerb) { __try { __c = this->rdbuf()->sbumpc(); // 27.6.1.1 paragraph 3 if (!traits_type::eq_int_type(__c, __eof)) _M_gcount = 1; else __err |= ios_base::eofbit; } __catch(__cxxabiv1::__forced_unwind&) { this->_M_setstate(ios_base::badbit); __throw_exception_again; } __catch(...) { this->_M_setstate(ios_base::badbit); } } if (!_M_gcount) __err |= ios_base::failbit; if (__err) this->setstate(__err); return __c; } template basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>:: get(char_type& __c) { _M_gcount = 0; ios_base::iostate __err = ios_base::goodbit; sentry __cerb(*this, true); if (__cerb) { __try { const int_type __cb = this->rdbuf()->sbumpc(); // 27.6.1.1 paragraph 3 if (!traits_type::eq_int_type(__cb, traits_type::eof())) { _M_gcount = 1; __c = traits_type::to_char_type(__cb); } else __err |= ios_base::eofbit; } __catch(__cxxabiv1::__forced_unwind&) { this->_M_setstate(ios_base::badbit); __throw_exception_again; } __catch(...) { this->_M_setstate(ios_base::badbit); } } if (!_M_gcount) __err |= ios_base::failbit; if (__err) this->setstate(__err); return *this; } template basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>:: get(char_type* __s, streamsize __n, char_type __delim) { _M_gcount = 0; ios_base::iostate __err = ios_base::goodbit; sentry __cerb(*this, true); if (__cerb) { __try { const int_type __idelim = traits_type::to_int_type(__delim); const int_type __eof = traits_type::eof(); __streambuf_type* __sb = this->rdbuf(); int_type __c = __sb->sgetc(); while (_M_gcount + 1 < __n && !traits_type::eq_int_type(__c, __eof) && !traits_type::eq_int_type(__c, __idelim)) { *__s++ = traits_type::to_char_type(__c); ++_M_gcount; __c = __sb->snextc(); } if (traits_type::eq_int_type(__c, __eof)) __err |= ios_base::eofbit; } __catch(__cxxabiv1::__forced_unwind&) { this->_M_setstate(ios_base::badbit); __throw_exception_again; } __catch(...) { this->_M_setstate(ios_base::badbit); } } // _GLIBCXX_RESOLVE_LIB_DEFECTS // 243. get and getline when sentry reports failure. if (__n > 0) *__s = char_type(); if (!_M_gcount) __err |= ios_base::failbit; if (__err) this->setstate(__err); return *this; } template basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>:: get(__streambuf_type& __sb, char_type __delim) { _M_gcount = 0; ios_base::iostate __err = ios_base::goodbit; sentry __cerb(*this, true); if (__cerb) { __try { const int_type __idelim = traits_type::to_int_type(__delim); const int_type __eof = traits_type::eof(); __streambuf_type* __this_sb = this->rdbuf(); int_type __c = __this_sb->sgetc(); char_type __c2 = traits_type::to_char_type(__c); while (!traits_type::eq_int_type(__c, __eof) && !traits_type::eq_int_type(__c, __idelim) && !traits_type::eq_int_type(__sb.sputc(__c2), __eof)) { ++_M_gcount; __c = __this_sb->snextc(); __c2 = traits_type::to_char_type(__c); } if (traits_type::eq_int_type(__c, __eof)) __err |= ios_base::eofbit; } __catch(__cxxabiv1::__forced_unwind&) { this->_M_setstate(ios_base::badbit); __throw_exception_again; } __catch(...) { this->_M_setstate(ios_base::badbit); } } if (!_M_gcount) __err |= ios_base::failbit; if (__err) this->setstate(__err); return *this; } template basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>:: getline(char_type* __s, streamsize __n, char_type __delim) { _M_gcount = 0; ios_base::iostate __err = ios_base::goodbit; sentry __cerb(*this, true); if (__cerb) { __try { const int_type __idelim = traits_type::to_int_type(__delim); const int_type __eof = traits_type::eof(); __streambuf_type* __sb = this->rdbuf(); int_type __c = __sb->sgetc(); while (_M_gcount + 1 < __n && !traits_type::eq_int_type(__c, __eof) && !traits_type::eq_int_type(__c, __idelim)) { *__s++ = traits_type::to_char_type(__c); __c = __sb->snextc(); ++_M_gcount; } if (traits_type::eq_int_type(__c, __eof)) __err |= ios_base::eofbit; else { if (traits_type::eq_int_type(__c, __idelim)) { __sb->sbumpc(); ++_M_gcount; } else __err |= ios_base::failbit; } } __catch(__cxxabiv1::__forced_unwind&) { this->_M_setstate(ios_base::badbit); __throw_exception_again; } __catch(...) { this->_M_setstate(ios_base::badbit); } } // _GLIBCXX_RESOLVE_LIB_DEFECTS // 243. get and getline when sentry reports failure. if (__n > 0) *__s = char_type(); if (!_M_gcount) __err |= ios_base::failbit; if (__err) this->setstate(__err); return *this; } // We provide three overloads, since the first two are much simpler // than the general case. Also, the latter two can thus adopt the // same "batchy" strategy used by getline above. template basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>:: ignore(void) { _M_gcount = 0; sentry __cerb(*this, true); if (__cerb) { ios_base::iostate __err = ios_base::goodbit; __try { const int_type __eof = traits_type::eof(); __streambuf_type* __sb = this->rdbuf(); if (traits_type::eq_int_type(__sb->sbumpc(), __eof)) __err |= ios_base::eofbit; else _M_gcount = 1; } __catch(__cxxabiv1::__forced_unwind&) { this->_M_setstate(ios_base::badbit); __throw_exception_again; } __catch(...) { this->_M_setstate(ios_base::badbit); } if (__err) this->setstate(__err); } return *this; } template basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>:: ignore(streamsize __n) { _M_gcount = 0; sentry __cerb(*this, true); if (__cerb && __n > 0) { ios_base::iostate __err = ios_base::goodbit; __try { const int_type __eof = traits_type::eof(); __streambuf_type* __sb = this->rdbuf(); int_type __c = __sb->sgetc(); // N.B. On LFS-enabled platforms streamsize is still 32 bits // wide: if we want to implement the standard mandated behavior // for n == max() (see 27.6.1.3/24) we are at risk of signed // integer overflow: thus these contortions. Also note that, // by definition, when more than 2G chars are actually ignored, // _M_gcount (the return value of gcount, that is) cannot be // really correct, being unavoidably too small. bool __large_ignore = false; while (true) { while (_M_gcount < __n && !traits_type::eq_int_type(__c, __eof)) { ++_M_gcount; __c = __sb->snextc(); } if (__n == __gnu_cxx::__numeric_traits::__max && !traits_type::eq_int_type(__c, __eof)) { _M_gcount = __gnu_cxx::__numeric_traits::__min; __large_ignore = true; } else break; } if (__large_ignore) _M_gcount = __gnu_cxx::__numeric_traits::__max; if (traits_type::eq_int_type(__c, __eof)) __err |= ios_base::eofbit; } __catch(__cxxabiv1::__forced_unwind&) { this->_M_setstate(ios_base::badbit); __throw_exception_again; } __catch(...) { this->_M_setstate(ios_base::badbit); } if (__err) this->setstate(__err); } return *this; } template basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>:: ignore(streamsize __n, int_type __delim) { _M_gcount = 0; sentry __cerb(*this, true); if (__cerb && __n > 0) { ios_base::iostate __err = ios_base::goodbit; __try { const int_type __eof = traits_type::eof(); __streambuf_type* __sb = this->rdbuf(); int_type __c = __sb->sgetc(); // See comment above. bool __large_ignore = false; while (true) { while (_M_gcount < __n && !traits_type::eq_int_type(__c, __eof) && !traits_type::eq_int_type(__c, __delim)) { ++_M_gcount; __c = __sb->snextc(); } if (__n == __gnu_cxx::__numeric_traits::__max && !traits_type::eq_int_type(__c, __eof) && !traits_type::eq_int_type(__c, __delim)) { _M_gcount = __gnu_cxx::__numeric_traits::__min; __large_ignore = true; } else break; } if (__large_ignore) _M_gcount = __gnu_cxx::__numeric_traits::__max; if (traits_type::eq_int_type(__c, __eof)) __err |= ios_base::eofbit; else if (traits_type::eq_int_type(__c, __delim)) { if (_M_gcount < __gnu_cxx::__numeric_traits::__max) ++_M_gcount; __sb->sbumpc(); } } __catch(__cxxabiv1::__forced_unwind&) { this->_M_setstate(ios_base::badbit); __throw_exception_again; } __catch(...) { this->_M_setstate(ios_base::badbit); } if (__err) this->setstate(__err); } return *this; } template typename basic_istream<_CharT, _Traits>::int_type basic_istream<_CharT, _Traits>:: peek(void) { int_type __c = traits_type::eof(); _M_gcount = 0; sentry __cerb(*this, true); if (__cerb) { ios_base::iostate __err = ios_base::goodbit; __try { __c = this->rdbuf()->sgetc(); if (traits_type::eq_int_type(__c, traits_type::eof())) __err |= ios_base::eofbit; } __catch(__cxxabiv1::__forced_unwind&) { this->_M_setstate(ios_base::badbit); __throw_exception_again; } __catch(...) { this->_M_setstate(ios_base::badbit); } if (__err) this->setstate(__err); } return __c; } template basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>:: read(char_type* __s, streamsize __n) { _M_gcount = 0; sentry __cerb(*this, true); if (__cerb) { ios_base::iostate __err = ios_base::goodbit; __try { _M_gcount = this->rdbuf()->sgetn(__s, __n); if (_M_gcount != __n) __err |= (ios_base::eofbit | ios_base::failbit); } __catch(__cxxabiv1::__forced_unwind&) { this->_M_setstate(ios_base::badbit); __throw_exception_again; } __catch(...) { this->_M_setstate(ios_base::badbit); } if (__err) this->setstate(__err); } return *this; } template streamsize basic_istream<_CharT, _Traits>:: readsome(char_type* __s, streamsize __n) { _M_gcount = 0; sentry __cerb(*this, true); if (__cerb) { ios_base::iostate __err = ios_base::goodbit; __try { // Cannot compare int_type with streamsize generically. const streamsize __num = this->rdbuf()->in_avail(); if (__num > 0) _M_gcount = this->rdbuf()->sgetn(__s, std::min(__num, __n)); else if (__num == -1) __err |= ios_base::eofbit; } __catch(__cxxabiv1::__forced_unwind&) { this->_M_setstate(ios_base::badbit); __throw_exception_again; } __catch(...) { this->_M_setstate(ios_base::badbit); } if (__err) this->setstate(__err); } return _M_gcount; } template basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>:: putback(char_type __c) { // _GLIBCXX_RESOLVE_LIB_DEFECTS // 60. What is a formatted input function? _M_gcount = 0; // Clear eofbit per N3168. this->clear(this->rdstate() & ~ios_base::eofbit); sentry __cerb(*this, true); if (__cerb) { ios_base::iostate __err = ios_base::goodbit; __try { const int_type __eof = traits_type::eof(); __streambuf_type* __sb = this->rdbuf(); if (!__sb || traits_type::eq_int_type(__sb->sputbackc(__c), __eof)) __err |= ios_base::badbit; } __catch(__cxxabiv1::__forced_unwind&) { this->_M_setstate(ios_base::badbit); __throw_exception_again; } __catch(...) { this->_M_setstate(ios_base::badbit); } if (__err) this->setstate(__err); } return *this; } template basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>:: unget(void) { // _GLIBCXX_RESOLVE_LIB_DEFECTS // 60. What is a formatted input function? _M_gcount = 0; // Clear eofbit per N3168. this->clear(this->rdstate() & ~ios_base::eofbit); sentry __cerb(*this, true); if (__cerb) { ios_base::iostate __err = ios_base::goodbit; __try { const int_type __eof = traits_type::eof(); __streambuf_type* __sb = this->rdbuf(); if (!__sb || traits_type::eq_int_type(__sb->sungetc(), __eof)) __err |= ios_base::badbit; } __catch(__cxxabiv1::__forced_unwind&) { this->_M_setstate(ios_base::badbit); __throw_exception_again; } __catch(...) { this->_M_setstate(ios_base::badbit); } if (__err) this->setstate(__err); } return *this; } template int basic_istream<_CharT, _Traits>:: sync(void) { // _GLIBCXX_RESOLVE_LIB_DEFECTS // DR60. Do not change _M_gcount. int __ret = -1; sentry __cerb(*this, true); if (__cerb) { ios_base::iostate __err = ios_base::goodbit; __try { __streambuf_type* __sb = this->rdbuf(); if (__sb) { if (__sb->pubsync() == -1) __err |= ios_base::badbit; else __ret = 0; } } __catch(__cxxabiv1::__forced_unwind&) { this->_M_setstate(ios_base::badbit); __throw_exception_again; } __catch(...) { this->_M_setstate(ios_base::badbit); } if (__err) this->setstate(__err); } return __ret; } template typename basic_istream<_CharT, _Traits>::pos_type basic_istream<_CharT, _Traits>:: tellg(void) { // _GLIBCXX_RESOLVE_LIB_DEFECTS // DR60. Do not change _M_gcount. pos_type __ret = pos_type(-1); sentry __cerb(*this, true); if (__cerb) { __try { if (!this->fail()) __ret = this->rdbuf()->pubseekoff(0, ios_base::cur, ios_base::in); } __catch(__cxxabiv1::__forced_unwind&) { this->_M_setstate(ios_base::badbit); __throw_exception_again; } __catch(...) { this->_M_setstate(ios_base::badbit); } } return __ret; } template basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>:: seekg(pos_type __pos) { // _GLIBCXX_RESOLVE_LIB_DEFECTS // DR60. Do not change _M_gcount. // Clear eofbit per N3168. this->clear(this->rdstate() & ~ios_base::eofbit); sentry __cerb(*this, true); if (__cerb) { ios_base::iostate __err = ios_base::goodbit; __try { if (!this->fail()) { // 136. seekp, seekg setting wrong streams? const pos_type __p = this->rdbuf()->pubseekpos(__pos, ios_base::in); // 129. Need error indication from seekp() and seekg() if (__p == pos_type(off_type(-1))) __err |= ios_base::failbit; } } __catch(__cxxabiv1::__forced_unwind&) { this->_M_setstate(ios_base::badbit); __throw_exception_again; } __catch(...) { this->_M_setstate(ios_base::badbit); } if (__err) this->setstate(__err); } return *this; } template basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>:: seekg(off_type __off, ios_base::seekdir __dir) { // _GLIBCXX_RESOLVE_LIB_DEFECTS // DR60. Do not change _M_gcount. // Clear eofbit per N3168. this->clear(this->rdstate() & ~ios_base::eofbit); sentry __cerb(*this, true); if (__cerb) { ios_base::iostate __err = ios_base::goodbit; __try { if (!this->fail()) { // 136. seekp, seekg setting wrong streams? const pos_type __p = this->rdbuf()->pubseekoff(__off, __dir, ios_base::in); // 129. Need error indication from seekp() and seekg() if (__p == pos_type(off_type(-1))) __err |= ios_base::failbit; } } __catch(__cxxabiv1::__forced_unwind&) { this->_M_setstate(ios_base::badbit); __throw_exception_again; } __catch(...) { this->_M_setstate(ios_base::badbit); } if (__err) this->setstate(__err); } return *this; } // 27.6.1.2.3 Character extraction templates template basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c) { typedef basic_istream<_CharT, _Traits> __istream_type; typedef typename __istream_type::int_type __int_type; typename __istream_type::sentry __cerb(__in, false); if (__cerb) { ios_base::iostate __err = ios_base::goodbit; __try { const __int_type __cb = __in.rdbuf()->sbumpc(); if (!_Traits::eq_int_type(__cb, _Traits::eof())) __c = _Traits::to_char_type(__cb); else __err |= (ios_base::eofbit | ios_base::failbit); } __catch(__cxxabiv1::__forced_unwind&) { __in._M_setstate(ios_base::badbit); __throw_exception_again; } __catch(...) { __in._M_setstate(ios_base::badbit); } if (__err) __in.setstate(__err); } return __in; } template basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s) { typedef basic_istream<_CharT, _Traits> __istream_type; typedef basic_streambuf<_CharT, _Traits> __streambuf_type; typedef typename _Traits::int_type int_type; typedef _CharT char_type; typedef ctype<_CharT> __ctype_type; streamsize __extracted = 0; ios_base::iostate __err = ios_base::goodbit; typename __istream_type::sentry __cerb(__in, false); if (__cerb) { __try { // Figure out how many characters to extract. streamsize __num = __in.width(); if (__num <= 0) __num = __gnu_cxx::__numeric_traits::__max; const __ctype_type& __ct = use_facet<__ctype_type>(__in.getloc()); const int_type __eof = _Traits::eof(); __streambuf_type* __sb = __in.rdbuf(); int_type __c = __sb->sgetc(); while (__extracted < __num - 1 && !_Traits::eq_int_type(__c, __eof) && !__ct.is(ctype_base::space, _Traits::to_char_type(__c))) { *__s++ = _Traits::to_char_type(__c); ++__extracted; __c = __sb->snextc(); } if (_Traits::eq_int_type(__c, __eof)) __err |= ios_base::eofbit; // _GLIBCXX_RESOLVE_LIB_DEFECTS // 68. Extractors for char* should store null at end *__s = char_type(); __in.width(0); } __catch(__cxxabiv1::__forced_unwind&) { __in._M_setstate(ios_base::badbit); __throw_exception_again; } __catch(...) { __in._M_setstate(ios_base::badbit); } } if (!__extracted) __err |= ios_base::failbit; if (__err) __in.setstate(__err); return __in; } // 27.6.1.4 Standard basic_istream manipulators template basic_istream<_CharT, _Traits>& ws(basic_istream<_CharT, _Traits>& __in) { typedef basic_istream<_CharT, _Traits> __istream_type; typedef basic_streambuf<_CharT, _Traits> __streambuf_type; typedef typename __istream_type::int_type __int_type; typedef ctype<_CharT> __ctype_type; const __ctype_type& __ct = use_facet<__ctype_type>(__in.getloc()); const __int_type __eof = _Traits::eof(); __streambuf_type* __sb = __in.rdbuf(); __int_type __c = __sb->sgetc(); while (!_Traits::eq_int_type(__c, __eof) && __ct.is(ctype_base::space, _Traits::to_char_type(__c))) __c = __sb->snextc(); if (_Traits::eq_int_type(__c, __eof)) __in.setstate(ios_base::eofbit); return __in; } // Inhibit implicit instantiations for required instantiations, // which are defined via explicit instantiations elsewhere. #if _GLIBCXX_EXTERN_TEMPLATE extern template class basic_istream; extern template istream& ws(istream&); extern template istream& operator>>(istream&, char&); extern template istream& operator>>(istream&, char*); extern template istream& operator>>(istream&, unsigned char&); extern template istream& operator>>(istream&, signed char&); extern template istream& operator>>(istream&, unsigned char*); extern template istream& operator>>(istream&, signed char*); extern template istream& istream::_M_extract(unsigned short&); extern template istream& istream::_M_extract(unsigned int&); extern template istream& istream::_M_extract(long&); extern template istream& istream::_M_extract(unsigned long&); extern template istream& istream::_M_extract(bool&); #ifdef _GLIBCXX_USE_LONG_LONG extern template istream& istream::_M_extract(long long&); extern template istream& istream::_M_extract(unsigned long long&); #endif # 1058 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/istream.tcc" 3 extern template istream& istream::_M_extract(float&); extern template istream& istream::_M_extract(double&); extern template istream& istream::_M_extract(long double&); extern template istream& istream::_M_extract(void*&); extern template class basic_iostream; #ifdef _GLIBCXX_USE_WCHAR_T extern template class basic_istream; extern template wistream& ws(wistream&); extern template wistream& operator>>(wistream&, wchar_t&); extern template wistream& operator>>(wistream&, wchar_t*); extern template wistream& wistream::_M_extract(unsigned short&); extern template wistream& wistream::_M_extract(unsigned int&); extern template wistream& wistream::_M_extract(long&); extern template wistream& wistream::_M_extract(unsigned long&); extern template wistream& wistream::_M_extract(bool&); #ifdef _GLIBCXX_USE_LONG_LONG extern template wistream& wistream::_M_extract(long long&); extern template wistream& wistream::_M_extract(unsigned long long&); #endif # 1080 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/istream.tcc" 3 extern template wistream& wistream::_M_extract(float&); extern template wistream& wistream::_M_extract(double&); extern template wistream& wistream::_M_extract(long double&); extern template wistream& wistream::_M_extract(void*&); extern template class basic_iostream; #endif # 1087 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/istream.tcc" 3 #endif # 1088 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/istream.tcc" 3 _GLIBCXX_END_NAMESPACE_VERSION } // namespace std #endif # 1093 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/istream.tcc" 3 # 935 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/istream" 2 3 #endif /* _GLIBCXX_ISTREAM */ # 937 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/istream" 3 # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/iostream" 2 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION /** * @name Standard Stream Objects * * The <iostream> header declares the eight standard stream * objects. For other declarations, see * http://gcc.gnu.org/onlinedocs/libstdc++/manual/io.html * and the @link iosfwd I/O forward declarations @endlink * * They are required by default to cooperate with the global C * library's @c FILE streams, and to be available during program * startup and termination. For more information, see the section of the * manual linked to above. */ //@{ extern istream cin; /// Linked to standard input extern ostream cout; /// Linked to standard output extern ostream cerr; /// Linked to standard error (unbuffered) extern ostream clog; /// Linked to standard error (buffered) #ifdef _GLIBCXX_USE_WCHAR_T extern wistream wcin; /// Linked to standard input extern wostream wcout; /// Linked to standard output extern wostream wcerr; /// Linked to standard error (unbuffered) extern wostream wclog; /// Linked to standard error (buffered) #endif # 71 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/iostream" 3 //@} // For construction of filebuffers for cout, cin, cerr, clog et. al. static ios_base::Init __ioinit; _GLIBCXX_END_NAMESPACE_VERSION } // namespace #endif /* _GLIBCXX_IOSTREAM */ # 80 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/iostream" 3 # 11 "test2.cpp" 2 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 11 "test2.cpp" # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/random" 1 3 // -*- C++ -*- // Copyright (C) 2007-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file include/random * This is a Standard C++ Library header. */ #ifndef _GLIBCXX_RANDOM #define _GLIBCXX_RANDOM 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 33 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/random" 3 #if __cplusplus < 201103L #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 35 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/random" 3 # 36 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/random" 3 #else # 37 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/random" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 38 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/random" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 1 3 // -*- C++ -*- C forwarding header. // Copyright (C) 1997-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file include/cmath * This is a Standard C++ Library file. You should @c \#include this file * in your programs, rather than any of the @a *.h implementation files. * * This is the C++ version of the Standard C Library header @c math.h, * and its contents are (mostly) the same as that header, but are all * contained in the namespace @c std (except for names which are defined * as macros in C). */ // // ISO C++ 14882: 26.5 C library // #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 # 43 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 43 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 # 44 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 44 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 # 1 "/usr/include/math.h" 1 3 4 /* Declarations for math functions. Copyright (C) 1991-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard: 7.12 Mathematics */ #ifndef _MATH_H #define _MATH_H 1 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 26 "/usr/include/math.h" 3 4 # 27 "/usr/include/math.h" 3 4 __BEGIN_DECLS /* Get machine-dependent HUGE_VAL value (returned on overflow). On all IEEE754 machines, this is +Infinity. */ #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 32 "/usr/include/math.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/huge_val.h" 1 3 4 /* `HUGE_VAL' constant for IEEE 754 machines (where it is infinity). Used by and functions for overflow. Copyright (C) 1992-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _MATH_H # error "Never use directly; include instead." #endif # 23 "/usr/include/x86_64-linux-gnu/bits/huge_val.h" 3 4 /* IEEE positive infinity (-HUGE_VAL is negative infinity). */ #if __GNUC_PREREQ(3,3) # define HUGE_VAL (__builtin_huge_val()) #elif __GNUC_PREREQ(2,96) # 29 "/usr/include/x86_64-linux-gnu/bits/huge_val.h" 3 4 # define HUGE_VAL (__extension__ 0x1.0p2047) #elif defined __GNUC__ # 31 "/usr/include/x86_64-linux-gnu/bits/huge_val.h" 3 4 # define HUGE_VAL \ (__extension__ \ ((union { unsigned __l __attribute__((__mode__(__DI__))); double __d; }) \ { __l: 0x7ff0000000000000ULL }).__d) #else /* not GCC */ # 38 "/usr/include/x86_64-linux-gnu/bits/huge_val.h" 3 4 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 39 "/usr/include/x86_64-linux-gnu/bits/huge_val.h" 3 4 # 40 "/usr/include/x86_64-linux-gnu/bits/huge_val.h" 3 4 typedef union { unsigned char __c[8]; double __d; } __huge_val_t; # if __BYTE_ORDER == __BIG_ENDIAN # define __HUGE_VAL_bytes { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 } # endif # 46 "/usr/include/x86_64-linux-gnu/bits/huge_val.h" 3 4 # if __BYTE_ORDER == __LITTLE_ENDIAN # define __HUGE_VAL_bytes { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f } # endif # 49 "/usr/include/x86_64-linux-gnu/bits/huge_val.h" 3 4 static __huge_val_t __huge_val = { __HUGE_VAL_bytes }; # define HUGE_VAL (__huge_val.__d) #endif /* GCC. */ # 54 "/usr/include/x86_64-linux-gnu/bits/huge_val.h" 3 4 # 33 "/usr/include/math.h" 2 3 4 #ifdef __USE_ISOC99 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 34 "/usr/include/math.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/huge_valf.h" 1 3 4 /* `HUGE_VALF' constant for IEEE 754 machines (where it is infinity). Used by and functions for overflow. Copyright (C) 1992-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _MATH_H # error "Never use directly; include instead." #endif # 23 "/usr/include/x86_64-linux-gnu/bits/huge_valf.h" 3 4 /* IEEE positive infinity (-HUGE_VAL is negative infinity). */ #if __GNUC_PREREQ(3,3) # define HUGE_VALF (__builtin_huge_valf()) #elif __GNUC_PREREQ(2,96) # 29 "/usr/include/x86_64-linux-gnu/bits/huge_valf.h" 3 4 # define HUGE_VALF (__extension__ 0x1.0p255f) #elif defined __GNUC__ # 31 "/usr/include/x86_64-linux-gnu/bits/huge_valf.h" 3 4 # define HUGE_VALF \ (__extension__ \ ((union { unsigned __l __attribute__((__mode__(__SI__))); float __d; }) \ { __l: 0x7f800000UL }).__d) #else /* not GCC */ # 38 "/usr/include/x86_64-linux-gnu/bits/huge_valf.h" 3 4 typedef union { unsigned char __c[4]; float __f; } __huge_valf_t; # if __BYTE_ORDER == __BIG_ENDIAN # define __HUGE_VALF_bytes { 0x7f, 0x80, 0, 0 } # endif # 44 "/usr/include/x86_64-linux-gnu/bits/huge_valf.h" 3 4 # if __BYTE_ORDER == __LITTLE_ENDIAN # define __HUGE_VALF_bytes { 0, 0, 0x80, 0x7f } # endif # 47 "/usr/include/x86_64-linux-gnu/bits/huge_valf.h" 3 4 static __huge_valf_t __huge_valf = { __HUGE_VALF_bytes }; # define HUGE_VALF (__huge_valf.__f) #endif /* GCC. */ # 52 "/usr/include/x86_64-linux-gnu/bits/huge_valf.h" 3 4 # 35 "/usr/include/math.h" 2 3 4 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 35 "/usr/include/math.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/huge_vall.h" 1 3 4 /* `HUGE_VALL' constant for ix86 (where it is infinity). Used by and functions for overflow. Copyright (C) 1992-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _MATH_H # error "Never use directly; include instead." #endif # 23 "/usr/include/x86_64-linux-gnu/bits/huge_vall.h" 3 4 #if __GNUC_PREREQ(3,3) # define HUGE_VALL (__builtin_huge_vall()) #elif __GNUC_PREREQ(2,96) # 27 "/usr/include/x86_64-linux-gnu/bits/huge_vall.h" 3 4 # define HUGE_VALL (__extension__ 0x1.0p32767L) #else # 29 "/usr/include/x86_64-linux-gnu/bits/huge_vall.h" 3 4 # define __HUGE_VALL_bytes { 0, 0, 0, 0, 0, 0, 0, 0x80, 0xff, 0x7f, 0, 0 } # define __huge_vall_t union { unsigned char __c[12]; long double __ld; } # ifdef __GNUC__ # define HUGE_VALL (__extension__ \ ((__huge_vall_t) { __c: __HUGE_VALL_bytes }).__ld) # else /* Not GCC. */ # 37 "/usr/include/x86_64-linux-gnu/bits/huge_vall.h" 3 4 static __huge_vall_t __huge_vall = { __HUGE_VALL_bytes }; # define HUGE_VALL (__huge_vall.__ld) # endif /* GCC. */ # 40 "/usr/include/x86_64-linux-gnu/bits/huge_vall.h" 3 4 #endif /* GCC 2.95 */ # 42 "/usr/include/x86_64-linux-gnu/bits/huge_vall.h" 3 4 # 36 "/usr/include/math.h" 2 3 4 /* Get machine-dependent INFINITY value. */ #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 38 "/usr/include/math.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/inf.h" 1 3 4 /* `INFINITY' constant for IEEE 754 machines. Copyright (C) 2004-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _MATH_H # error "Never use directly; include instead." #endif # 22 "/usr/include/x86_64-linux-gnu/bits/inf.h" 3 4 /* IEEE positive infinity. */ #if __GNUC_PREREQ(3,3) # define INFINITY (__builtin_inff()) #else # 28 "/usr/include/x86_64-linux-gnu/bits/inf.h" 3 4 # define INFINITY HUGE_VALF #endif # 30 "/usr/include/x86_64-linux-gnu/bits/inf.h" 3 4 # 39 "/usr/include/math.h" 2 3 4 /* Get machine-dependent NAN value (returned for some domain errors). */ #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 41 "/usr/include/math.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/nan.h" 1 3 4 /* `NAN' constant for IEEE 754 machines. Copyright (C) 1992-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _MATH_H # error "Never use directly; include instead." #endif # 22 "/usr/include/x86_64-linux-gnu/bits/nan.h" 3 4 /* IEEE Not A Number. */ #if __GNUC_PREREQ(3,3) # define NAN (__builtin_nanf ("")) #elif defined __GNUC__ # 31 "/usr/include/x86_64-linux-gnu/bits/nan.h" 3 4 # define NAN \ (__extension__ \ ((union { unsigned __l __attribute__ ((__mode__ (__SI__))); float __d; }) \ { __l: 0x7fc00000UL }).__d) #else # 38 "/usr/include/x86_64-linux-gnu/bits/nan.h" 3 4 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 39 "/usr/include/x86_64-linux-gnu/bits/nan.h" 3 4 # 40 "/usr/include/x86_64-linux-gnu/bits/nan.h" 3 4 # if __BYTE_ORDER == __BIG_ENDIAN # define __qnan_bytes { 0x7f, 0xc0, 0, 0 } # endif # 44 "/usr/include/x86_64-linux-gnu/bits/nan.h" 3 4 # if __BYTE_ORDER == __LITTLE_ENDIAN # define __qnan_bytes { 0, 0, 0xc0, 0x7f } # endif # 47 "/usr/include/x86_64-linux-gnu/bits/nan.h" 3 4 static union { unsigned char __c[4]; float __d; } __qnan_union __attribute__ ((__unused__)) = { __qnan_bytes }; # define NAN (__qnan_union.__d) #endif /* GCC. */ # 53 "/usr/include/x86_64-linux-gnu/bits/nan.h" 3 4 # 42 "/usr/include/math.h" 2 3 4 #endif /* __USE_ISOC99 */ # 43 "/usr/include/math.h" 3 4 /* Get general and ISO C99 specific information. */ #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 45 "/usr/include/math.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/mathdef.h" 1 3 4 /* Copyright (C) 2001-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #if !defined _MATH_H && !defined _COMPLEX_H # error "Never use directly; include instead" #endif # 21 "/usr/include/x86_64-linux-gnu/bits/mathdef.h" 3 4 #if defined __USE_ISOC99 && defined _MATH_H && !defined _MATH_H_MATHDEF # define _MATH_H_MATHDEF 1 # if defined __x86_64__ || (defined __FLT_EVAL_METHOD__ && __FLT_EVAL_METHOD__ == 0) /* The x86-64 architecture computes values with the precission of the used type. Similarly for -m32 -mfpmath=sse. */ typedef float float_t; /* `float' expressions are evaluated as `float'. */ typedef double double_t; /* `double' expressions are evaluated as `double'. */ # else # 32 "/usr/include/x86_64-linux-gnu/bits/mathdef.h" 3 4 /* The ix87 FPUs evaluate all values in the 80 bit floating-point format which is also available for the user as `long double'. Therefore we define: */ typedef long double float_t; /* `float' expressions are evaluated as `long double'. */ typedef long double double_t; /* `double' expressions are evaluated as `long double'. */ # endif # 40 "/usr/include/x86_64-linux-gnu/bits/mathdef.h" 3 4 /* The values returned by `ilogb' for 0 and NaN respectively. */ # define FP_ILOGB0 (-2147483647 - 1) # define FP_ILOGBNAN (-2147483647 - 1) /* The GCC 4.6 compiler will define __FP_FAST_FMA{,F,L} if the fma{,f,l} builtins are supported. */ # if __FP_FAST_FMA # define FP_FAST_FMA 1 # endif # 50 "/usr/include/x86_64-linux-gnu/bits/mathdef.h" 3 4 # if __FP_FAST_FMAF # define FP_FAST_FMAF 1 # endif # 54 "/usr/include/x86_64-linux-gnu/bits/mathdef.h" 3 4 # if __FP_FAST_FMAL # define FP_FAST_FMAL 1 # endif # 58 "/usr/include/x86_64-linux-gnu/bits/mathdef.h" 3 4 #endif /* ISO C99 */ # 60 "/usr/include/x86_64-linux-gnu/bits/mathdef.h" 3 4 # 46 "/usr/include/math.h" 2 3 4 /* The file contains the prototypes for all the actual math functions. These macros are used for those prototypes, so we can easily declare each function as both `name' and `__name', and can declare the float versions `namef' and `__namef'. */ #define __MATHCALL(function,suffix, args) \ __MATHDECL (_Mdouble_,function,suffix, args) #define __MATHDECL(type, function,suffix, args) \ __MATHDECL_1(type, function,suffix, args); \ __MATHDECL_1(type, __CONCAT(__,function),suffix, args) #define __MATHCALLX(function,suffix, args, attrib) \ __MATHDECLX (_Mdouble_,function,suffix, args, attrib) #define __MATHDECLX(type, function,suffix, args, attrib) \ __MATHDECL_1(type, function,suffix, args) __attribute__ (attrib); \ __MATHDECL_1(type, __CONCAT(__,function),suffix, args) __attribute__ (attrib) #define __MATHDECL_1(type, function,suffix, args) \ extern type __MATH_PRECNAME(function,suffix) args __THROW #define _Mdouble_ double #define __MATH_PRECNAME(name,r) __CONCAT(name,r) #define _Mdouble_BEGIN_NAMESPACE __BEGIN_NAMESPACE_STD #define _Mdouble_END_NAMESPACE __END_NAMESPACE_STD #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 69 "/usr/include/math.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 1 3 4 /* Prototype declarations for math functions; helper file for . Copyright (C) 1996-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* NOTE: Because of the special way this file is used by , this file must NOT be protected from multiple inclusion as header files usually are. This file provides prototype declarations for the math functions. Most functions are declared using the macro: __MATHCALL (NAME,[_r], (ARGS...)); This means there is a function `NAME' returning `double' and a function `NAMEf' returning `float'. Each place `_Mdouble_' appears in the prototype, that is actually `double' in the prototype for `NAME' and `float' in the prototype for `NAMEf'. Reentrant variant functions are called `NAME_r' and `NAMEf_r'. Functions returning other types like `int' are declared using the macro: __MATHDECL (TYPE, NAME,[_r], (ARGS...)); This is just like __MATHCALL but for a function returning `TYPE' instead of `_Mdouble_'. In all of these cases, there is still both a `NAME' and a `NAMEf' that takes `float' arguments. Note that there must be no whitespace before the argument passed for NAME, to make token pasting work with -traditional. */ #ifndef _MATH_H # error "Never include directly; include instead." #endif # 48 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 /* Trigonometric functions. */ _Mdouble_BEGIN_NAMESPACE /* Arc cosine of X. */ __MATHCALL (acos,, (_Mdouble_ __x)); /* Arc sine of X. */ __MATHCALL (asin,, (_Mdouble_ __x)); /* Arc tangent of X. */ __MATHCALL (atan,, (_Mdouble_ __x)); /* Arc tangent of Y/X. */ __MATHCALL (atan2,, (_Mdouble_ __y, _Mdouble_ __x)); /* Cosine of X. */ __MATHCALL (cos,, (_Mdouble_ __x)); /* Sine of X. */ __MATHCALL (sin,, (_Mdouble_ __x)); /* Tangent of X. */ __MATHCALL (tan,, (_Mdouble_ __x)); /* Hyperbolic functions. */ /* Hyperbolic cosine of X. */ __MATHCALL (cosh,, (_Mdouble_ __x)); /* Hyperbolic sine of X. */ __MATHCALL (sinh,, (_Mdouble_ __x)); /* Hyperbolic tangent of X. */ __MATHCALL (tanh,, (_Mdouble_ __x)); _Mdouble_END_NAMESPACE #ifdef __USE_GNU /* Cosine and sine of X. */ __MATHDECL (void,sincos,, (_Mdouble_ __x, _Mdouble_ *__sinx, _Mdouble_ *__cosx)); #endif # 84 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Hyperbolic arc cosine of X. */ __MATHCALL (acosh,, (_Mdouble_ __x)); /* Hyperbolic arc sine of X. */ __MATHCALL (asinh,, (_Mdouble_ __x)); /* Hyperbolic arc tangent of X. */ __MATHCALL (atanh,, (_Mdouble_ __x)); __END_NAMESPACE_C99 #endif # 95 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 /* Exponential and logarithmic functions. */ _Mdouble_BEGIN_NAMESPACE /* Exponential function of X. */ __MATHCALL (exp,, (_Mdouble_ __x)); /* Break VALUE into a normalized fraction and an integral power of 2. */ __MATHCALL (frexp,, (_Mdouble_ __x, int *__exponent)); /* X times (two to the EXP power). */ __MATHCALL (ldexp,, (_Mdouble_ __x, int __exponent)); /* Natural logarithm of X. */ __MATHCALL (log,, (_Mdouble_ __x)); /* Base-ten logarithm of X. */ __MATHCALL (log10,, (_Mdouble_ __x)); /* Break VALUE into integral and fractional parts. */ __MATHCALL (modf,, (_Mdouble_ __x, _Mdouble_ *__iptr)) __nonnull ((2)); _Mdouble_END_NAMESPACE #ifdef __USE_GNU /* A function missing in all standards: compute exponent to base ten. */ __MATHCALL (exp10,, (_Mdouble_ __x)); /* Another name occasionally used. */ __MATHCALL (pow10,, (_Mdouble_ __x)); #endif # 124 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Return exp(X) - 1. */ __MATHCALL (expm1,, (_Mdouble_ __x)); /* Return log(1 + X). */ __MATHCALL (log1p,, (_Mdouble_ __x)); /* Return the base 2 signed integral exponent of X. */ __MATHCALL (logb,, (_Mdouble_ __x)); __END_NAMESPACE_C99 #endif # 137 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Compute base-2 exponential of X. */ __MATHCALL (exp2,, (_Mdouble_ __x)); /* Compute base-2 logarithm of X. */ __MATHCALL (log2,, (_Mdouble_ __x)); __END_NAMESPACE_C99 #endif # 147 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 /* Power functions. */ _Mdouble_BEGIN_NAMESPACE /* Return X to the Y power. */ __MATHCALL (pow,, (_Mdouble_ __x, _Mdouble_ __y)); /* Return the square root of X. */ __MATHCALL (sqrt,, (_Mdouble_ __x)); _Mdouble_END_NAMESPACE #if defined __USE_MISC || defined __USE_XOPEN || defined __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Return `sqrt(X*X + Y*Y)'. */ __MATHCALL (hypot,, (_Mdouble_ __x, _Mdouble_ __y)); __END_NAMESPACE_C99 #endif # 165 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Return the cube root of X. */ __MATHCALL (cbrt,, (_Mdouble_ __x)); __END_NAMESPACE_C99 #endif # 172 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 /* Nearest integer, absolute value, and remainder functions. */ _Mdouble_BEGIN_NAMESPACE /* Smallest integral value not less than X. */ __MATHCALLX (ceil,, (_Mdouble_ __x), (__const__)); /* Absolute value of X. */ __MATHCALLX (fabs,, (_Mdouble_ __x), (__const__)); /* Largest integer not greater than X. */ __MATHCALLX (floor,, (_Mdouble_ __x), (__const__)); /* Floating-point modulo remainder of X/Y. */ __MATHCALL (fmod,, (_Mdouble_ __x, _Mdouble_ __y)); /* Return 0 if VALUE is finite or NaN, +1 if it is +Infinity, -1 if it is -Infinity. */ __MATHDECL_1 (int,__isinf,, (_Mdouble_ __value)) __attribute__ ((__const__)); /* Return nonzero if VALUE is finite and not NaN. */ __MATHDECL_1 (int,__finite,, (_Mdouble_ __value)) __attribute__ ((__const__)); _Mdouble_END_NAMESPACE #ifdef __USE_MISC /* Return 0 if VALUE is finite or NaN, +1 if it is +Infinity, -1 if it is -Infinity. */ __MATHDECL_1 (int,isinf,, (_Mdouble_ __value)) __attribute__ ((__const__)); /* Return nonzero if VALUE is finite and not NaN. */ __MATHDECL_1 (int,finite,, (_Mdouble_ __value)) __attribute__ ((__const__)); /* Return the remainder of X/Y. */ __MATHCALL (drem,, (_Mdouble_ __x, _Mdouble_ __y)); /* Return the fractional part of X after dividing out `ilogb (X)'. */ __MATHCALL (significand,, (_Mdouble_ __x)); #endif /* Use misc. */ # 213 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 #if defined __USE_MISC || defined __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Return X with its signed changed to Y's. */ __MATHCALLX (copysign,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); __END_NAMESPACE_C99 #endif # 220 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Return representation of qNaN for double type. */ __MATHCALLX (nan,, (const char *__tagb), (__const__)); __END_NAMESPACE_C99 #endif # 227 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 /* Return nonzero if VALUE is not a number. */ __MATHDECL_1 (int,__isnan,, (_Mdouble_ __value)) __attribute__ ((__const__)); #if defined __USE_MISC || defined __USE_XOPEN /* Return nonzero if VALUE is not a number. */ __MATHDECL_1 (int,isnan,, (_Mdouble_ __value)) __attribute__ ((__const__)); /* Bessel functions. */ __MATHCALL (j0,, (_Mdouble_)); __MATHCALL (j1,, (_Mdouble_)); __MATHCALL (jn,, (int, _Mdouble_)); __MATHCALL (y0,, (_Mdouble_)); __MATHCALL (y1,, (_Mdouble_)); __MATHCALL (yn,, (int, _Mdouble_)); #endif # 244 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 #if defined __USE_MISC || defined __USE_XOPEN || defined __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Error and gamma functions. */ __MATHCALL (erf,, (_Mdouble_)); __MATHCALL (erfc,, (_Mdouble_)); __MATHCALL (lgamma,, (_Mdouble_)); __END_NAMESPACE_C99 #endif # 254 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* True gamma function. */ __MATHCALL (tgamma,, (_Mdouble_)); __END_NAMESPACE_C99 #endif # 261 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 #if defined __USE_MISC || defined __USE_XOPEN /* Obsolete alias for `lgamma'. */ __MATHCALL (gamma,, (_Mdouble_)); #endif # 266 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 #ifdef __USE_MISC /* Reentrant version of lgamma. This function uses the global variable `signgam'. The reentrant version instead takes a pointer and stores the value through it. */ __MATHCALL (lgamma,_r, (_Mdouble_, int *__signgamp)); #endif # 273 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Return the integer nearest X in the direction of the prevailing rounding mode. */ __MATHCALL (rint,, (_Mdouble_ __x)); /* Return X + epsilon if X < Y, X - epsilon if X > Y. */ __MATHCALLX (nextafter,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); # if defined __USE_ISOC99 && !defined __LDBL_COMPAT __MATHCALLX (nexttoward,, (_Mdouble_ __x, long double __y), (__const__)); # endif # 286 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 /* Return the remainder of integer divison X / Y with infinite precision. */ __MATHCALL (remainder,, (_Mdouble_ __x, _Mdouble_ __y)); # if defined __USE_MISC || defined __USE_ISOC99 /* Return X times (2 to the Nth power). */ __MATHCALL (scalbn,, (_Mdouble_ __x, int __n)); # endif # 294 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 /* Return the binary exponent of X, which must be nonzero. */ __MATHDECL (int,ilogb,, (_Mdouble_ __x)); #endif # 298 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 #ifdef __USE_ISOC99 /* Return X times (2 to the Nth power). */ __MATHCALL (scalbln,, (_Mdouble_ __x, long int __n)); /* Round X to integral value in floating-point format using current rounding direction, but do not raise inexact exception. */ __MATHCALL (nearbyint,, (_Mdouble_ __x)); /* Round X to nearest integral value, rounding halfway cases away from zero. */ __MATHCALLX (round,, (_Mdouble_ __x), (__const__)); /* Round X to the integral value in floating-point format nearest but not larger in magnitude. */ __MATHCALLX (trunc,, (_Mdouble_ __x), (__const__)); /* Compute remainder of X and Y and put in *QUO a value with sign of x/y and magnitude congruent `mod 2^n' to the magnitude of the integral quotient x/y, with n >= 3. */ __MATHCALL (remquo,, (_Mdouble_ __x, _Mdouble_ __y, int *__quo)); /* Conversion functions. */ /* Round X to nearest integral value according to current rounding direction. */ __MATHDECL (long int,lrint,, (_Mdouble_ __x)); __extension__ __MATHDECL (long long int,llrint,, (_Mdouble_ __x)); /* Round X to nearest integral value, rounding halfway cases away from zero. */ __MATHDECL (long int,lround,, (_Mdouble_ __x)); __extension__ __MATHDECL (long long int,llround,, (_Mdouble_ __x)); /* Return positive difference between X and Y. */ __MATHCALL (fdim,, (_Mdouble_ __x, _Mdouble_ __y)); /* Return maximum numeric value from X and Y. */ __MATHCALLX (fmax,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); /* Return minimum numeric value from X and Y. */ __MATHCALLX (fmin,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); /* Classify given number. */ __MATHDECL_1 (int, __fpclassify,, (_Mdouble_ __value)) __attribute__ ((__const__)); /* Test for negative number. */ __MATHDECL_1 (int, __signbit,, (_Mdouble_ __value)) __attribute__ ((__const__)); /* Multiply-add function computed as a ternary operation. */ __MATHCALL (fma,, (_Mdouble_ __x, _Mdouble_ __y, _Mdouble_ __z)); #endif /* Use ISO C99. */ # 358 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 __END_NAMESPACE_C99 #endif # 362 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 #ifdef __USE_GNU /* Test for signaling NaN. */ __MATHDECL_1 (int, __issignaling,, (_Mdouble_ __value)) __attribute__ ((__const__)); #endif # 368 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED /* Return X times (2 to the Nth power). */ __MATHCALL (scalb,, (_Mdouble_ __x, _Mdouble_ __n)); #endif # 373 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 # 70 "/usr/include/math.h" 2 3 4 #undef _Mdouble_ #undef _Mdouble_BEGIN_NAMESPACE #undef _Mdouble_END_NAMESPACE #undef __MATH_PRECNAME #if defined __USE_MISC || defined __USE_ISOC99 /* Include the file of declarations again, this time using `float' instead of `double' and appending f to each function name. */ # ifndef _Mfloat_ # define _Mfloat_ float # endif # 84 "/usr/include/math.h" 3 4 # define _Mdouble_ _Mfloat_ # define __MATH_PRECNAME(name,r) name##f##r # define _Mdouble_BEGIN_NAMESPACE __BEGIN_NAMESPACE_C99 # define _Mdouble_END_NAMESPACE __END_NAMESPACE_C99 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 88 "/usr/include/math.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 1 3 4 /* Prototype declarations for math functions; helper file for . Copyright (C) 1996-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* NOTE: Because of the special way this file is used by , this file must NOT be protected from multiple inclusion as header files usually are. This file provides prototype declarations for the math functions. Most functions are declared using the macro: __MATHCALL (NAME,[_r], (ARGS...)); This means there is a function `NAME' returning `double' and a function `NAMEf' returning `float'. Each place `_Mdouble_' appears in the prototype, that is actually `double' in the prototype for `NAME' and `float' in the prototype for `NAMEf'. Reentrant variant functions are called `NAME_r' and `NAMEf_r'. Functions returning other types like `int' are declared using the macro: __MATHDECL (TYPE, NAME,[_r], (ARGS...)); This is just like __MATHCALL but for a function returning `TYPE' instead of `_Mdouble_'. In all of these cases, there is still both a `NAME' and a `NAMEf' that takes `float' arguments. Note that there must be no whitespace before the argument passed for NAME, to make token pasting work with -traditional. */ #ifndef _MATH_H # error "Never include directly; include instead." #endif # 48 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 /* Trigonometric functions. */ _Mdouble_BEGIN_NAMESPACE /* Arc cosine of X. */ __MATHCALL (acos,, (_Mdouble_ __x)); /* Arc sine of X. */ __MATHCALL (asin,, (_Mdouble_ __x)); /* Arc tangent of X. */ __MATHCALL (atan,, (_Mdouble_ __x)); /* Arc tangent of Y/X. */ __MATHCALL (atan2,, (_Mdouble_ __y, _Mdouble_ __x)); /* Cosine of X. */ __MATHCALL (cos,, (_Mdouble_ __x)); /* Sine of X. */ __MATHCALL (sin,, (_Mdouble_ __x)); /* Tangent of X. */ __MATHCALL (tan,, (_Mdouble_ __x)); /* Hyperbolic functions. */ /* Hyperbolic cosine of X. */ __MATHCALL (cosh,, (_Mdouble_ __x)); /* Hyperbolic sine of X. */ __MATHCALL (sinh,, (_Mdouble_ __x)); /* Hyperbolic tangent of X. */ __MATHCALL (tanh,, (_Mdouble_ __x)); _Mdouble_END_NAMESPACE #ifdef __USE_GNU /* Cosine and sine of X. */ __MATHDECL (void,sincos,, (_Mdouble_ __x, _Mdouble_ *__sinx, _Mdouble_ *__cosx)); #endif # 84 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Hyperbolic arc cosine of X. */ __MATHCALL (acosh,, (_Mdouble_ __x)); /* Hyperbolic arc sine of X. */ __MATHCALL (asinh,, (_Mdouble_ __x)); /* Hyperbolic arc tangent of X. */ __MATHCALL (atanh,, (_Mdouble_ __x)); __END_NAMESPACE_C99 #endif # 95 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 /* Exponential and logarithmic functions. */ _Mdouble_BEGIN_NAMESPACE /* Exponential function of X. */ __MATHCALL (exp,, (_Mdouble_ __x)); /* Break VALUE into a normalized fraction and an integral power of 2. */ __MATHCALL (frexp,, (_Mdouble_ __x, int *__exponent)); /* X times (two to the EXP power). */ __MATHCALL (ldexp,, (_Mdouble_ __x, int __exponent)); /* Natural logarithm of X. */ __MATHCALL (log,, (_Mdouble_ __x)); /* Base-ten logarithm of X. */ __MATHCALL (log10,, (_Mdouble_ __x)); /* Break VALUE into integral and fractional parts. */ __MATHCALL (modf,, (_Mdouble_ __x, _Mdouble_ *__iptr)) __nonnull ((2)); _Mdouble_END_NAMESPACE #ifdef __USE_GNU /* A function missing in all standards: compute exponent to base ten. */ __MATHCALL (exp10,, (_Mdouble_ __x)); /* Another name occasionally used. */ __MATHCALL (pow10,, (_Mdouble_ __x)); #endif # 124 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Return exp(X) - 1. */ __MATHCALL (expm1,, (_Mdouble_ __x)); /* Return log(1 + X). */ __MATHCALL (log1p,, (_Mdouble_ __x)); /* Return the base 2 signed integral exponent of X. */ __MATHCALL (logb,, (_Mdouble_ __x)); __END_NAMESPACE_C99 #endif # 137 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Compute base-2 exponential of X. */ __MATHCALL (exp2,, (_Mdouble_ __x)); /* Compute base-2 logarithm of X. */ __MATHCALL (log2,, (_Mdouble_ __x)); __END_NAMESPACE_C99 #endif # 147 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 /* Power functions. */ _Mdouble_BEGIN_NAMESPACE /* Return X to the Y power. */ __MATHCALL (pow,, (_Mdouble_ __x, _Mdouble_ __y)); /* Return the square root of X. */ __MATHCALL (sqrt,, (_Mdouble_ __x)); _Mdouble_END_NAMESPACE #if defined __USE_MISC || defined __USE_XOPEN || defined __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Return `sqrt(X*X + Y*Y)'. */ __MATHCALL (hypot,, (_Mdouble_ __x, _Mdouble_ __y)); __END_NAMESPACE_C99 #endif # 165 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Return the cube root of X. */ __MATHCALL (cbrt,, (_Mdouble_ __x)); __END_NAMESPACE_C99 #endif # 172 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 /* Nearest integer, absolute value, and remainder functions. */ _Mdouble_BEGIN_NAMESPACE /* Smallest integral value not less than X. */ __MATHCALLX (ceil,, (_Mdouble_ __x), (__const__)); /* Absolute value of X. */ __MATHCALLX (fabs,, (_Mdouble_ __x), (__const__)); /* Largest integer not greater than X. */ __MATHCALLX (floor,, (_Mdouble_ __x), (__const__)); /* Floating-point modulo remainder of X/Y. */ __MATHCALL (fmod,, (_Mdouble_ __x, _Mdouble_ __y)); /* Return 0 if VALUE is finite or NaN, +1 if it is +Infinity, -1 if it is -Infinity. */ __MATHDECL_1 (int,__isinf,, (_Mdouble_ __value)) __attribute__ ((__const__)); /* Return nonzero if VALUE is finite and not NaN. */ __MATHDECL_1 (int,__finite,, (_Mdouble_ __value)) __attribute__ ((__const__)); _Mdouble_END_NAMESPACE #ifdef __USE_MISC /* Return 0 if VALUE is finite or NaN, +1 if it is +Infinity, -1 if it is -Infinity. */ __MATHDECL_1 (int,isinf,, (_Mdouble_ __value)) __attribute__ ((__const__)); /* Return nonzero if VALUE is finite and not NaN. */ __MATHDECL_1 (int,finite,, (_Mdouble_ __value)) __attribute__ ((__const__)); /* Return the remainder of X/Y. */ __MATHCALL (drem,, (_Mdouble_ __x, _Mdouble_ __y)); /* Return the fractional part of X after dividing out `ilogb (X)'. */ __MATHCALL (significand,, (_Mdouble_ __x)); #endif /* Use misc. */ # 213 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 #if defined __USE_MISC || defined __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Return X with its signed changed to Y's. */ __MATHCALLX (copysign,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); __END_NAMESPACE_C99 #endif # 220 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Return representation of qNaN for double type. */ __MATHCALLX (nan,, (const char *__tagb), (__const__)); __END_NAMESPACE_C99 #endif # 227 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 /* Return nonzero if VALUE is not a number. */ __MATHDECL_1 (int,__isnan,, (_Mdouble_ __value)) __attribute__ ((__const__)); #if defined __USE_MISC || defined __USE_XOPEN /* Return nonzero if VALUE is not a number. */ __MATHDECL_1 (int,isnan,, (_Mdouble_ __value)) __attribute__ ((__const__)); /* Bessel functions. */ __MATHCALL (j0,, (_Mdouble_)); __MATHCALL (j1,, (_Mdouble_)); __MATHCALL (jn,, (int, _Mdouble_)); __MATHCALL (y0,, (_Mdouble_)); __MATHCALL (y1,, (_Mdouble_)); __MATHCALL (yn,, (int, _Mdouble_)); #endif # 244 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 #if defined __USE_MISC || defined __USE_XOPEN || defined __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Error and gamma functions. */ __MATHCALL (erf,, (_Mdouble_)); __MATHCALL (erfc,, (_Mdouble_)); __MATHCALL (lgamma,, (_Mdouble_)); __END_NAMESPACE_C99 #endif # 254 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* True gamma function. */ __MATHCALL (tgamma,, (_Mdouble_)); __END_NAMESPACE_C99 #endif # 261 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 #if defined __USE_MISC || defined __USE_XOPEN /* Obsolete alias for `lgamma'. */ __MATHCALL (gamma,, (_Mdouble_)); #endif # 266 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 #ifdef __USE_MISC /* Reentrant version of lgamma. This function uses the global variable `signgam'. The reentrant version instead takes a pointer and stores the value through it. */ __MATHCALL (lgamma,_r, (_Mdouble_, int *__signgamp)); #endif # 273 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Return the integer nearest X in the direction of the prevailing rounding mode. */ __MATHCALL (rint,, (_Mdouble_ __x)); /* Return X + epsilon if X < Y, X - epsilon if X > Y. */ __MATHCALLX (nextafter,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); # if defined __USE_ISOC99 && !defined __LDBL_COMPAT __MATHCALLX (nexttoward,, (_Mdouble_ __x, long double __y), (__const__)); # endif # 286 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 /* Return the remainder of integer divison X / Y with infinite precision. */ __MATHCALL (remainder,, (_Mdouble_ __x, _Mdouble_ __y)); # if defined __USE_MISC || defined __USE_ISOC99 /* Return X times (2 to the Nth power). */ __MATHCALL (scalbn,, (_Mdouble_ __x, int __n)); # endif # 294 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 /* Return the binary exponent of X, which must be nonzero. */ __MATHDECL (int,ilogb,, (_Mdouble_ __x)); #endif # 298 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 #ifdef __USE_ISOC99 /* Return X times (2 to the Nth power). */ __MATHCALL (scalbln,, (_Mdouble_ __x, long int __n)); /* Round X to integral value in floating-point format using current rounding direction, but do not raise inexact exception. */ __MATHCALL (nearbyint,, (_Mdouble_ __x)); /* Round X to nearest integral value, rounding halfway cases away from zero. */ __MATHCALLX (round,, (_Mdouble_ __x), (__const__)); /* Round X to the integral value in floating-point format nearest but not larger in magnitude. */ __MATHCALLX (trunc,, (_Mdouble_ __x), (__const__)); /* Compute remainder of X and Y and put in *QUO a value with sign of x/y and magnitude congruent `mod 2^n' to the magnitude of the integral quotient x/y, with n >= 3. */ __MATHCALL (remquo,, (_Mdouble_ __x, _Mdouble_ __y, int *__quo)); /* Conversion functions. */ /* Round X to nearest integral value according to current rounding direction. */ __MATHDECL (long int,lrint,, (_Mdouble_ __x)); __extension__ __MATHDECL (long long int,llrint,, (_Mdouble_ __x)); /* Round X to nearest integral value, rounding halfway cases away from zero. */ __MATHDECL (long int,lround,, (_Mdouble_ __x)); __extension__ __MATHDECL (long long int,llround,, (_Mdouble_ __x)); /* Return positive difference between X and Y. */ __MATHCALL (fdim,, (_Mdouble_ __x, _Mdouble_ __y)); /* Return maximum numeric value from X and Y. */ __MATHCALLX (fmax,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); /* Return minimum numeric value from X and Y. */ __MATHCALLX (fmin,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); /* Classify given number. */ __MATHDECL_1 (int, __fpclassify,, (_Mdouble_ __value)) __attribute__ ((__const__)); /* Test for negative number. */ __MATHDECL_1 (int, __signbit,, (_Mdouble_ __value)) __attribute__ ((__const__)); /* Multiply-add function computed as a ternary operation. */ __MATHCALL (fma,, (_Mdouble_ __x, _Mdouble_ __y, _Mdouble_ __z)); #endif /* Use ISO C99. */ # 358 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 __END_NAMESPACE_C99 #endif # 362 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 #ifdef __USE_GNU /* Test for signaling NaN. */ __MATHDECL_1 (int, __issignaling,, (_Mdouble_ __value)) __attribute__ ((__const__)); #endif # 368 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED /* Return X times (2 to the Nth power). */ __MATHCALL (scalb,, (_Mdouble_ __x, _Mdouble_ __n)); #endif # 373 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 # 89 "/usr/include/math.h" 2 3 4 # undef _Mdouble_ # undef _Mdouble_BEGIN_NAMESPACE # undef _Mdouble_END_NAMESPACE # undef __MATH_PRECNAME # if !(defined __NO_LONG_DOUBLE_MATH && defined _LIBC) \ || defined __LDBL_COMPAT # ifdef __LDBL_COMPAT # ifdef __USE_ISOC99 extern float __nldbl_nexttowardf (float __x, long double __y) __THROW __attribute__ ((__const__)); # ifdef __REDIRECT_NTH extern float __REDIRECT_NTH (nexttowardf, (float __x, long double __y), __nldbl_nexttowardf) __attribute__ ((__const__)); extern double __REDIRECT_NTH (nexttoward, (double __x, long double __y), nextafter) __attribute__ ((__const__)); extern long double __REDIRECT_NTH (nexttowardl, (long double __x, long double __y), nextafter) __attribute__ ((__const__)); # endif # 111 "/usr/include/math.h" 3 4 # endif # 112 "/usr/include/math.h" 3 4 # undef __MATHDECL_1 # define __MATHDECL_2(type, function,suffix, args, alias) \ extern type __REDIRECT_NTH(__MATH_PRECNAME(function,suffix), \ args, alias) # define __MATHDECL_1(type, function,suffix, args) \ __MATHDECL_2(type, function,suffix, args, __CONCAT(function,suffix)) # endif # 120 "/usr/include/math.h" 3 4 /* Include the file of declarations again, this time using `long double' instead of `double' and appending l to each function name. */ # ifndef _Mlong_double_ # define _Mlong_double_ long double # endif # 127 "/usr/include/math.h" 3 4 # define _Mdouble_ _Mlong_double_ # define __MATH_PRECNAME(name,r) name##l##r # define _Mdouble_BEGIN_NAMESPACE __BEGIN_NAMESPACE_C99 # define _Mdouble_END_NAMESPACE __END_NAMESPACE_C99 # define __MATH_DECLARE_LDOUBLE 1 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 132 "/usr/include/math.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 1 3 4 /* Prototype declarations for math functions; helper file for . Copyright (C) 1996-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* NOTE: Because of the special way this file is used by , this file must NOT be protected from multiple inclusion as header files usually are. This file provides prototype declarations for the math functions. Most functions are declared using the macro: __MATHCALL (NAME,[_r], (ARGS...)); This means there is a function `NAME' returning `double' and a function `NAMEf' returning `float'. Each place `_Mdouble_' appears in the prototype, that is actually `double' in the prototype for `NAME' and `float' in the prototype for `NAMEf'. Reentrant variant functions are called `NAME_r' and `NAMEf_r'. Functions returning other types like `int' are declared using the macro: __MATHDECL (TYPE, NAME,[_r], (ARGS...)); This is just like __MATHCALL but for a function returning `TYPE' instead of `_Mdouble_'. In all of these cases, there is still both a `NAME' and a `NAMEf' that takes `float' arguments. Note that there must be no whitespace before the argument passed for NAME, to make token pasting work with -traditional. */ #ifndef _MATH_H # error "Never include directly; include instead." #endif # 48 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 /* Trigonometric functions. */ _Mdouble_BEGIN_NAMESPACE /* Arc cosine of X. */ __MATHCALL (acos,, (_Mdouble_ __x)); /* Arc sine of X. */ __MATHCALL (asin,, (_Mdouble_ __x)); /* Arc tangent of X. */ __MATHCALL (atan,, (_Mdouble_ __x)); /* Arc tangent of Y/X. */ __MATHCALL (atan2,, (_Mdouble_ __y, _Mdouble_ __x)); /* Cosine of X. */ __MATHCALL (cos,, (_Mdouble_ __x)); /* Sine of X. */ __MATHCALL (sin,, (_Mdouble_ __x)); /* Tangent of X. */ __MATHCALL (tan,, (_Mdouble_ __x)); /* Hyperbolic functions. */ /* Hyperbolic cosine of X. */ __MATHCALL (cosh,, (_Mdouble_ __x)); /* Hyperbolic sine of X. */ __MATHCALL (sinh,, (_Mdouble_ __x)); /* Hyperbolic tangent of X. */ __MATHCALL (tanh,, (_Mdouble_ __x)); _Mdouble_END_NAMESPACE #ifdef __USE_GNU /* Cosine and sine of X. */ __MATHDECL (void,sincos,, (_Mdouble_ __x, _Mdouble_ *__sinx, _Mdouble_ *__cosx)); #endif # 84 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Hyperbolic arc cosine of X. */ __MATHCALL (acosh,, (_Mdouble_ __x)); /* Hyperbolic arc sine of X. */ __MATHCALL (asinh,, (_Mdouble_ __x)); /* Hyperbolic arc tangent of X. */ __MATHCALL (atanh,, (_Mdouble_ __x)); __END_NAMESPACE_C99 #endif # 95 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 /* Exponential and logarithmic functions. */ _Mdouble_BEGIN_NAMESPACE /* Exponential function of X. */ __MATHCALL (exp,, (_Mdouble_ __x)); /* Break VALUE into a normalized fraction and an integral power of 2. */ __MATHCALL (frexp,, (_Mdouble_ __x, int *__exponent)); /* X times (two to the EXP power). */ __MATHCALL (ldexp,, (_Mdouble_ __x, int __exponent)); /* Natural logarithm of X. */ __MATHCALL (log,, (_Mdouble_ __x)); /* Base-ten logarithm of X. */ __MATHCALL (log10,, (_Mdouble_ __x)); /* Break VALUE into integral and fractional parts. */ __MATHCALL (modf,, (_Mdouble_ __x, _Mdouble_ *__iptr)) __nonnull ((2)); _Mdouble_END_NAMESPACE #ifdef __USE_GNU /* A function missing in all standards: compute exponent to base ten. */ __MATHCALL (exp10,, (_Mdouble_ __x)); /* Another name occasionally used. */ __MATHCALL (pow10,, (_Mdouble_ __x)); #endif # 124 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Return exp(X) - 1. */ __MATHCALL (expm1,, (_Mdouble_ __x)); /* Return log(1 + X). */ __MATHCALL (log1p,, (_Mdouble_ __x)); /* Return the base 2 signed integral exponent of X. */ __MATHCALL (logb,, (_Mdouble_ __x)); __END_NAMESPACE_C99 #endif # 137 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Compute base-2 exponential of X. */ __MATHCALL (exp2,, (_Mdouble_ __x)); /* Compute base-2 logarithm of X. */ __MATHCALL (log2,, (_Mdouble_ __x)); __END_NAMESPACE_C99 #endif # 147 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 /* Power functions. */ _Mdouble_BEGIN_NAMESPACE /* Return X to the Y power. */ __MATHCALL (pow,, (_Mdouble_ __x, _Mdouble_ __y)); /* Return the square root of X. */ __MATHCALL (sqrt,, (_Mdouble_ __x)); _Mdouble_END_NAMESPACE #if defined __USE_MISC || defined __USE_XOPEN || defined __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Return `sqrt(X*X + Y*Y)'. */ __MATHCALL (hypot,, (_Mdouble_ __x, _Mdouble_ __y)); __END_NAMESPACE_C99 #endif # 165 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Return the cube root of X. */ __MATHCALL (cbrt,, (_Mdouble_ __x)); __END_NAMESPACE_C99 #endif # 172 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 /* Nearest integer, absolute value, and remainder functions. */ _Mdouble_BEGIN_NAMESPACE /* Smallest integral value not less than X. */ __MATHCALLX (ceil,, (_Mdouble_ __x), (__const__)); /* Absolute value of X. */ __MATHCALLX (fabs,, (_Mdouble_ __x), (__const__)); /* Largest integer not greater than X. */ __MATHCALLX (floor,, (_Mdouble_ __x), (__const__)); /* Floating-point modulo remainder of X/Y. */ __MATHCALL (fmod,, (_Mdouble_ __x, _Mdouble_ __y)); /* Return 0 if VALUE is finite or NaN, +1 if it is +Infinity, -1 if it is -Infinity. */ __MATHDECL_1 (int,__isinf,, (_Mdouble_ __value)) __attribute__ ((__const__)); /* Return nonzero if VALUE is finite and not NaN. */ __MATHDECL_1 (int,__finite,, (_Mdouble_ __value)) __attribute__ ((__const__)); _Mdouble_END_NAMESPACE #ifdef __USE_MISC /* Return 0 if VALUE is finite or NaN, +1 if it is +Infinity, -1 if it is -Infinity. */ __MATHDECL_1 (int,isinf,, (_Mdouble_ __value)) __attribute__ ((__const__)); /* Return nonzero if VALUE is finite and not NaN. */ __MATHDECL_1 (int,finite,, (_Mdouble_ __value)) __attribute__ ((__const__)); /* Return the remainder of X/Y. */ __MATHCALL (drem,, (_Mdouble_ __x, _Mdouble_ __y)); /* Return the fractional part of X after dividing out `ilogb (X)'. */ __MATHCALL (significand,, (_Mdouble_ __x)); #endif /* Use misc. */ # 213 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 #if defined __USE_MISC || defined __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Return X with its signed changed to Y's. */ __MATHCALLX (copysign,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); __END_NAMESPACE_C99 #endif # 220 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Return representation of qNaN for double type. */ __MATHCALLX (nan,, (const char *__tagb), (__const__)); __END_NAMESPACE_C99 #endif # 227 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 /* Return nonzero if VALUE is not a number. */ __MATHDECL_1 (int,__isnan,, (_Mdouble_ __value)) __attribute__ ((__const__)); #if defined __USE_MISC || defined __USE_XOPEN /* Return nonzero if VALUE is not a number. */ __MATHDECL_1 (int,isnan,, (_Mdouble_ __value)) __attribute__ ((__const__)); /* Bessel functions. */ __MATHCALL (j0,, (_Mdouble_)); __MATHCALL (j1,, (_Mdouble_)); __MATHCALL (jn,, (int, _Mdouble_)); __MATHCALL (y0,, (_Mdouble_)); __MATHCALL (y1,, (_Mdouble_)); __MATHCALL (yn,, (int, _Mdouble_)); #endif # 244 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 #if defined __USE_MISC || defined __USE_XOPEN || defined __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Error and gamma functions. */ __MATHCALL (erf,, (_Mdouble_)); __MATHCALL (erfc,, (_Mdouble_)); __MATHCALL (lgamma,, (_Mdouble_)); __END_NAMESPACE_C99 #endif # 254 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* True gamma function. */ __MATHCALL (tgamma,, (_Mdouble_)); __END_NAMESPACE_C99 #endif # 261 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 #if defined __USE_MISC || defined __USE_XOPEN /* Obsolete alias for `lgamma'. */ __MATHCALL (gamma,, (_Mdouble_)); #endif # 266 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 #ifdef __USE_MISC /* Reentrant version of lgamma. This function uses the global variable `signgam'. The reentrant version instead takes a pointer and stores the value through it. */ __MATHCALL (lgamma,_r, (_Mdouble_, int *__signgamp)); #endif # 273 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Return the integer nearest X in the direction of the prevailing rounding mode. */ __MATHCALL (rint,, (_Mdouble_ __x)); /* Return X + epsilon if X < Y, X - epsilon if X > Y. */ __MATHCALLX (nextafter,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); # if defined __USE_ISOC99 && !defined __LDBL_COMPAT __MATHCALLX (nexttoward,, (_Mdouble_ __x, long double __y), (__const__)); # endif # 286 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 /* Return the remainder of integer divison X / Y with infinite precision. */ __MATHCALL (remainder,, (_Mdouble_ __x, _Mdouble_ __y)); # if defined __USE_MISC || defined __USE_ISOC99 /* Return X times (2 to the Nth power). */ __MATHCALL (scalbn,, (_Mdouble_ __x, int __n)); # endif # 294 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 /* Return the binary exponent of X, which must be nonzero. */ __MATHDECL (int,ilogb,, (_Mdouble_ __x)); #endif # 298 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 #ifdef __USE_ISOC99 /* Return X times (2 to the Nth power). */ __MATHCALL (scalbln,, (_Mdouble_ __x, long int __n)); /* Round X to integral value in floating-point format using current rounding direction, but do not raise inexact exception. */ __MATHCALL (nearbyint,, (_Mdouble_ __x)); /* Round X to nearest integral value, rounding halfway cases away from zero. */ __MATHCALLX (round,, (_Mdouble_ __x), (__const__)); /* Round X to the integral value in floating-point format nearest but not larger in magnitude. */ __MATHCALLX (trunc,, (_Mdouble_ __x), (__const__)); /* Compute remainder of X and Y and put in *QUO a value with sign of x/y and magnitude congruent `mod 2^n' to the magnitude of the integral quotient x/y, with n >= 3. */ __MATHCALL (remquo,, (_Mdouble_ __x, _Mdouble_ __y, int *__quo)); /* Conversion functions. */ /* Round X to nearest integral value according to current rounding direction. */ __MATHDECL (long int,lrint,, (_Mdouble_ __x)); __extension__ __MATHDECL (long long int,llrint,, (_Mdouble_ __x)); /* Round X to nearest integral value, rounding halfway cases away from zero. */ __MATHDECL (long int,lround,, (_Mdouble_ __x)); __extension__ __MATHDECL (long long int,llround,, (_Mdouble_ __x)); /* Return positive difference between X and Y. */ __MATHCALL (fdim,, (_Mdouble_ __x, _Mdouble_ __y)); /* Return maximum numeric value from X and Y. */ __MATHCALLX (fmax,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); /* Return minimum numeric value from X and Y. */ __MATHCALLX (fmin,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); /* Classify given number. */ __MATHDECL_1 (int, __fpclassify,, (_Mdouble_ __value)) __attribute__ ((__const__)); /* Test for negative number. */ __MATHDECL_1 (int, __signbit,, (_Mdouble_ __value)) __attribute__ ((__const__)); /* Multiply-add function computed as a ternary operation. */ __MATHCALL (fma,, (_Mdouble_ __x, _Mdouble_ __y, _Mdouble_ __z)); #endif /* Use ISO C99. */ # 358 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 __END_NAMESPACE_C99 #endif # 362 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 #ifdef __USE_GNU /* Test for signaling NaN. */ __MATHDECL_1 (int, __issignaling,, (_Mdouble_ __value)) __attribute__ ((__const__)); #endif # 368 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED /* Return X times (2 to the Nth power). */ __MATHCALL (scalb,, (_Mdouble_ __x, _Mdouble_ __n)); #endif # 373 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 # 133 "/usr/include/math.h" 2 3 4 # undef _Mdouble_ # undef _Mdouble_BEGIN_NAMESPACE # undef _Mdouble_END_NAMESPACE # undef __MATH_PRECNAME # endif /* !(__NO_LONG_DOUBLE_MATH && _LIBC) || __LDBL_COMPAT */ # 139 "/usr/include/math.h" 3 4 #endif /* Use misc or ISO C99. */ # 141 "/usr/include/math.h" 3 4 #undef __MATHDECL_1 #undef __MATHDECL #undef __MATHCALL #if defined __USE_MISC || defined __USE_XOPEN /* This variable is used by `gamma' and `lgamma'. */ extern int signgam; #endif # 150 "/usr/include/math.h" 3 4 /* ISO C99 defines some generic macros which work on any data type. */ #ifdef __USE_ISOC99 /* Get the architecture specific values describing the floating-point evaluation. The following symbols will get defined: float_t floating-point type at least as wide as `float' used to evaluate `float' expressions double_t floating-point type at least as wide as `double' used to evaluate `double' expressions FLT_EVAL_METHOD Defined to 0 if `float_t' is `float' and `double_t' is `double' 1 if `float_t' and `double_t' are `double' 2 if `float_t' and `double_t' are `long double' else `float_t' and `double_t' are unspecified INFINITY representation of the infinity value of type `float' FP_FAST_FMA FP_FAST_FMAF FP_FAST_FMAL If defined it indicates that the `fma' function generally executes about as fast as a multiply and an add. This macro is defined only iff the `fma' function is implemented directly with a hardware multiply-add instructions. FP_ILOGB0 Expands to a value returned by `ilogb (0.0)'. FP_ILOGBNAN Expands to a value returned by `ilogb (NAN)'. DECIMAL_DIG Number of decimal digits supported by conversion between decimal and all internal floating-point formats. */ /* All floating-point numbers can be put in one of these categories. */ enum { FP_NAN = # define FP_NAN 0 FP_NAN, FP_INFINITE = # define FP_INFINITE 1 FP_INFINITE, FP_ZERO = # define FP_ZERO 2 FP_ZERO, FP_SUBNORMAL = # define FP_SUBNORMAL 3 FP_SUBNORMAL, FP_NORMAL = # define FP_NORMAL 4 FP_NORMAL }; /* Return number of classification appropriate for X. */ # ifdef __NO_LONG_DOUBLE_MATH # define fpclassify(x) \ (sizeof (x) == sizeof (float) ? __fpclassifyf (x) : __fpclassify (x)) # else # 213 "/usr/include/math.h" 3 4 # define fpclassify(x) \ (sizeof (x) == sizeof (float) \ ? __fpclassifyf (x) \ : sizeof (x) == sizeof (double) \ ? __fpclassify (x) : __fpclassifyl (x)) # endif # 219 "/usr/include/math.h" 3 4 /* Return nonzero value if sign of X is negative. */ # ifdef __NO_LONG_DOUBLE_MATH # define signbit(x) \ (sizeof (x) == sizeof (float) ? __signbitf (x) : __signbit (x)) # else # 225 "/usr/include/math.h" 3 4 # define signbit(x) \ (sizeof (x) == sizeof (float) \ ? __signbitf (x) \ : sizeof (x) == sizeof (double) \ ? __signbit (x) : __signbitl (x)) # endif # 231 "/usr/include/math.h" 3 4 /* Return nonzero value if X is not +-Inf or NaN. */ # ifdef __NO_LONG_DOUBLE_MATH # define isfinite(x) \ (sizeof (x) == sizeof (float) ? __finitef (x) : __finite (x)) # else # 237 "/usr/include/math.h" 3 4 # define isfinite(x) \ (sizeof (x) == sizeof (float) \ ? __finitef (x) \ : sizeof (x) == sizeof (double) \ ? __finite (x) : __finitel (x)) # endif # 243 "/usr/include/math.h" 3 4 /* Return nonzero value if X is neither zero, subnormal, Inf, nor NaN. */ # define isnormal(x) (fpclassify (x) == FP_NORMAL) /* Return nonzero value if X is a NaN. We could use `fpclassify' but we already have this functions `__isnan' and it is faster. */ # ifdef __NO_LONG_DOUBLE_MATH # define isnan(x) \ (sizeof (x) == sizeof (float) ? __isnanf (x) : __isnan (x)) # else # 253 "/usr/include/math.h" 3 4 # define isnan(x) \ (sizeof (x) == sizeof (float) \ ? __isnanf (x) \ : sizeof (x) == sizeof (double) \ ? __isnan (x) : __isnanl (x)) # endif # 259 "/usr/include/math.h" 3 4 /* Return nonzero value if X is positive or negative infinity. */ # ifdef __NO_LONG_DOUBLE_MATH # define isinf(x) \ (sizeof (x) == sizeof (float) ? __isinff (x) : __isinf (x)) # else # 265 "/usr/include/math.h" 3 4 # define isinf(x) \ (sizeof (x) == sizeof (float) \ ? __isinff (x) \ : sizeof (x) == sizeof (double) \ ? __isinf (x) : __isinfl (x)) # endif # 271 "/usr/include/math.h" 3 4 /* Bitmasks for the math_errhandling macro. */ # define MATH_ERRNO 1 /* errno set by math functions. */ # define MATH_ERREXCEPT 2 /* Exceptions raised by math functions. */ /* By default all functions support both errno and exception handling. In gcc's fast math mode and if inline functions are defined this might not be true. */ # ifndef __FAST_MATH__ # define math_errhandling (MATH_ERRNO | MATH_ERREXCEPT) # endif # 282 "/usr/include/math.h" 3 4 #endif /* Use ISO C99. */ # 284 "/usr/include/math.h" 3 4 #ifdef __USE_GNU /* Return nonzero value if X is a signaling NaN. */ # ifdef __NO_LONG_DOUBLE_MATH # define issignaling(x) \ (sizeof (x) == sizeof (float) ? __issignalingf (x) : __issignaling (x)) # else # 291 "/usr/include/math.h" 3 4 # define issignaling(x) \ (sizeof (x) == sizeof (float) \ ? __issignalingf (x) \ : sizeof (x) == sizeof (double) \ ? __issignaling (x) : __issignalingl (x)) # endif # 297 "/usr/include/math.h" 3 4 #endif /* Use GNU. */ # 298 "/usr/include/math.h" 3 4 #ifdef __USE_MISC /* Support for various different standard error handling behaviors. */ typedef enum { _IEEE_ = -1, /* According to IEEE 754/IEEE 854. */ _SVID_, /* According to System V, release 4. */ _XOPEN_, /* Nowadays also Unix98. */ _POSIX_, _ISOC_ /* Actually this is ISO C99. */ } _LIB_VERSION_TYPE; /* This variable can be changed at run-time to any of the values above to affect floating point error handling behavior (it may also be necessary to change the hardware FPU exception settings). */ extern _LIB_VERSION_TYPE _LIB_VERSION; #endif # 315 "/usr/include/math.h" 3 4 #ifdef __USE_SVID /* In SVID error handling, `matherr' is called with this description of the exceptional condition. We have a problem when using C++ since `exception' is a reserved name in C++. */ # ifdef __cplusplus struct __exception # else # 326 "/usr/include/math.h" 3 4 struct exception # endif # 328 "/usr/include/math.h" 3 4 { int type; char *name; double arg1; double arg2; double retval; }; # ifdef __cplusplus extern int matherr (struct __exception *__exc) throw (); # else # 339 "/usr/include/math.h" 3 4 extern int matherr (struct exception *__exc); # endif # 341 "/usr/include/math.h" 3 4 # define X_TLOSS 1.41484755040568800000e+16 /* Types of exceptions in the `type' field. */ # define DOMAIN 1 # define SING 2 # define OVERFLOW 3 # define UNDERFLOW 4 # define TLOSS 5 # define PLOSS 6 /* SVID mode specifies returning this large value instead of infinity. */ # define HUGE 3.40282347e+38F #else /* !SVID */ # 356 "/usr/include/math.h" 3 4 # ifdef __USE_XOPEN /* X/Open wants another strange constant. */ # define MAXFLOAT 3.40282347e+38F # endif # 361 "/usr/include/math.h" 3 4 #endif /* SVID */ # 363 "/usr/include/math.h" 3 4 /* Some useful constants. */ #if defined __USE_BSD || defined __USE_XOPEN # define M_E 2.7182818284590452354 /* e */ # define M_LOG2E 1.4426950408889634074 /* log_2 e */ # define M_LOG10E 0.43429448190325182765 /* log_10 e */ # define M_LN2 0.69314718055994530942 /* log_e 2 */ # define M_LN10 2.30258509299404568402 /* log_e 10 */ # define M_PI 3.14159265358979323846 /* pi */ # define M_PI_2 1.57079632679489661923 /* pi/2 */ # define M_PI_4 0.78539816339744830962 /* pi/4 */ # define M_1_PI 0.31830988618379067154 /* 1/pi */ # define M_2_PI 0.63661977236758134308 /* 2/pi */ # define M_2_SQRTPI 1.12837916709551257390 /* 2/sqrt(pi) */ # define M_SQRT2 1.41421356237309504880 /* sqrt(2) */ # define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */ #endif # 381 "/usr/include/math.h" 3 4 /* The above constants are not adequate for computation using `long double's. Therefore we provide as an extension constants with similar names as a GNU extension. Provide enough digits for the 128-bit IEEE quad. */ #ifdef __USE_GNU # define M_El 2.718281828459045235360287471352662498L /* e */ # define M_LOG2El 1.442695040888963407359924681001892137L /* log_2 e */ # define M_LOG10El 0.434294481903251827651128918916605082L /* log_10 e */ # define M_LN2l 0.693147180559945309417232121458176568L /* log_e 2 */ # define M_LN10l 2.302585092994045684017991454684364208L /* log_e 10 */ # define M_PIl 3.141592653589793238462643383279502884L /* pi */ # define M_PI_2l 1.570796326794896619231321691639751442L /* pi/2 */ # define M_PI_4l 0.785398163397448309615660845819875721L /* pi/4 */ # define M_1_PIl 0.318309886183790671537767526745028724L /* 1/pi */ # define M_2_PIl 0.636619772367581343075535053490057448L /* 2/pi */ # define M_2_SQRTPIl 1.128379167095512573896158903121545172L /* 2/sqrt(pi) */ # define M_SQRT2l 1.414213562373095048801688724209698079L /* sqrt(2) */ # define M_SQRT1_2l 0.707106781186547524400844362104849039L /* 1/sqrt(2) */ #endif # 400 "/usr/include/math.h" 3 4 /* When compiling in strict ISO C compatible mode we must not use the inline functions since they, among other things, do not set the `errno' variable correctly. */ #if defined __STRICT_ANSI__ && !defined __NO_MATH_INLINES # define __NO_MATH_INLINES 1 #endif # 408 "/usr/include/math.h" 3 4 #if defined __USE_ISOC99 && __GNUC_PREREQ(2,97) /* ISO C99 defines some macros to compare number while taking care for unordered numbers. Many FPUs provide special instructions to support these operations. Generic support in GCC for these as builtins went in before 3.0.0, but not all cpus added their patterns. We define versions that use the builtins here, and will undef/redefine as appropriate for the specific GCC version in use. */ # define isgreater(x, y) __builtin_isgreater(x, y) # define isgreaterequal(x, y) __builtin_isgreaterequal(x, y) # define isless(x, y) __builtin_isless(x, y) # define islessequal(x, y) __builtin_islessequal(x, y) # define islessgreater(x, y) __builtin_islessgreater(x, y) # define isunordered(u, v) __builtin_isunordered(u, v) #endif # 423 "/usr/include/math.h" 3 4 /* Get machine-dependent inline versions (if there are any). */ #ifdef __USE_EXTERN_INLINES #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 426 "/usr/include/math.h" 3 4 # 427 "/usr/include/math.h" 3 4 #endif # 428 "/usr/include/math.h" 3 4 /* Define special entry points to use when the compiler got told to only expect finite results. */ #if defined __FINITE_MATH_ONLY__ && __FINITE_MATH_ONLY__ > 0 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 432 "/usr/include/math.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 1 3 4 /* Entry points to finite-math-only compiler runs. Copyright (C) 2011-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _MATH_H # error "Never use directly; include instead." #endif # 22 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 /* acos. */ extern double __REDIRECT_NTH (acos, (double), __acos_finite); extern float __REDIRECT_NTH (acosf, (float), __acosf_finite); #ifdef __MATH_DECLARE_LDOUBLE # ifdef __NO_LONG_DOUBLE_MATH extern long double __REDIRECT_NTH (acosl, (long double), __acos_finite); # else # 30 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 extern long double __REDIRECT_NTH (acosl, (long double), __acosl_finite); # endif # 32 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 #endif # 33 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 /* acosh. */ extern double __REDIRECT_NTH (acosh, (double), __acosh_finite); extern float __REDIRECT_NTH (acoshf, (float), __acoshf_finite); # ifdef __MATH_DECLARE_LDOUBLE # ifdef __NO_LONG_DOUBLE_MATH extern long double __REDIRECT_NTH (acoshl, (long double), __acosh_finite); # else # 42 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 extern long double __REDIRECT_NTH (acoshl, (long double), __acoshl_finite); # endif # 44 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 # endif # 45 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 #endif # 46 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 /* asin. */ extern double __REDIRECT_NTH (asin, (double), __asin_finite); extern float __REDIRECT_NTH (asinf, (float), __asinf_finite); #ifdef __MATH_DECLARE_LDOUBLE # ifdef __NO_LONG_DOUBLE_MATH extern long double __REDIRECT_NTH (asinl, (long double), __asin_finite); # else # 54 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 extern long double __REDIRECT_NTH (asinl, (long double), __asinl_finite); # endif # 56 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 #endif # 57 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 /* atan2. */ extern double __REDIRECT_NTH (atan2, (double, double), __atan2_finite); extern float __REDIRECT_NTH (atan2f, (float, float), __atan2f_finite); #ifdef __MATH_DECLARE_LDOUBLE # ifdef __NO_LONG_DOUBLE_MATH extern long double __REDIRECT_NTH (atan2l, (long double, long double), __atan2_finite); # else # 66 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 extern long double __REDIRECT_NTH (atan2l, (long double, long double), __atan2l_finite); # endif # 69 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 #endif # 70 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 /* atanh. */ extern double __REDIRECT_NTH (atanh, (double), __atanh_finite); extern float __REDIRECT_NTH (atanhf, (float), __atanhf_finite); # ifdef __MATH_DECLARE_LDOUBLE # ifdef __NO_LONG_DOUBLE_MATH extern long double __REDIRECT_NTH (atanhl, (long double), __atanh_finite); # else # 79 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 extern long double __REDIRECT_NTH (atanhl, (long double), __atanhl_finite); # endif # 81 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 # endif # 82 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 #endif # 83 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 /* cosh. */ extern double __REDIRECT_NTH (cosh, (double), __cosh_finite); extern float __REDIRECT_NTH (coshf, (float), __coshf_finite); #ifdef __MATH_DECLARE_LDOUBLE # ifdef __NO_LONG_DOUBLE_MATH extern long double __REDIRECT_NTH (coshl, (long double), __cosh_finite); # else # 91 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 extern long double __REDIRECT_NTH (coshl, (long double), __coshl_finite); # endif # 93 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 #endif # 94 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 /* exp. */ extern double __REDIRECT_NTH (exp, (double), __exp_finite); extern float __REDIRECT_NTH (expf, (float), __expf_finite); #ifdef __MATH_DECLARE_LDOUBLE # ifdef __NO_LONG_DOUBLE_MATH extern long double __REDIRECT_NTH (expl, (long double), __exp_finite); # else # 102 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 extern long double __REDIRECT_NTH (expl, (long double), __expl_finite); # endif # 104 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 #endif # 105 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 #ifdef __USE_GNU /* exp10. */ extern double __REDIRECT_NTH (exp10, (double), __exp10_finite); extern float __REDIRECT_NTH (exp10f, (float), __exp10f_finite); # ifdef __MATH_DECLARE_LDOUBLE # ifdef __NO_LONG_DOUBLE_MATH extern long double __REDIRECT_NTH (exp10l, (long double), __exp10_finite); # else # 114 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 extern long double __REDIRECT_NTH (exp10l, (long double), __exp10l_finite); # endif # 116 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 # endif # 117 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 /* pow10. */ extern double __REDIRECT_NTH (pow10, (double), __exp10_finite); extern float __REDIRECT_NTH (pow10f, (float), __exp10f_finite); # ifdef __MATH_DECLARE_LDOUBLE # ifdef __NO_LONG_DOUBLE_MATH extern long double __REDIRECT_NTH (pow10l, (long double), __exp10_finite); # else # 125 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 extern long double __REDIRECT_NTH (pow10l, (long double), __exp10l_finite); # endif # 127 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 # endif # 128 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 #endif # 129 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 #ifdef __USE_ISOC99 /* exp2. */ extern double __REDIRECT_NTH (exp2, (double), __exp2_finite); extern float __REDIRECT_NTH (exp2f, (float), __exp2f_finite); # ifdef __MATH_DECLARE_LDOUBLE # ifdef __NO_LONG_DOUBLE_MATH extern long double __REDIRECT_NTH (exp2l, (long double), __exp2_finite); # else # 138 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 extern long double __REDIRECT_NTH (exp2l, (long double), __exp2l_finite); # endif # 140 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 # endif # 141 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 #endif # 142 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 /* fmod. */ extern double __REDIRECT_NTH (fmod, (double, double), __fmod_finite); extern float __REDIRECT_NTH (fmodf, (float, float), __fmodf_finite); #ifdef __MATH_DECLARE_LDOUBLE # ifdef __NO_LONG_DOUBLE_MATH extern long double __REDIRECT_NTH (fmodl, (long double, long double), __fmod_finite); # else # 151 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 extern long double __REDIRECT_NTH (fmodl, (long double, long double), __fmodl_finite); # endif # 154 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 #endif # 155 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 #ifdef __USE_ISOC99 /* hypot. */ extern double __REDIRECT_NTH (hypot, (double, double), __hypot_finite); extern float __REDIRECT_NTH (hypotf, (float, float), __hypotf_finite); # ifdef __MATH_DECLARE_LDOUBLE # ifdef __NO_LONG_DOUBLE_MATH extern long double __REDIRECT_NTH (hypotl, (long double, long double), __hypot_finite); # else # 165 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 extern long double __REDIRECT_NTH (hypotl, (long double, long double), __hypotl_finite); # endif # 168 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 # endif # 169 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 #endif # 170 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 #if defined __USE_MISC || defined __USE_XOPEN /* j0. */ extern double __REDIRECT_NTH (j0, (double), __j0_finite); extern float __REDIRECT_NTH (j0f, (float), __j0f_finite); # ifdef __MATH_DECLARE_LDOUBLE # ifdef __NO_LONG_DOUBLE_MATH extern long double __REDIRECT_NTH (j0l, (long double), __j0_finite); # else # 179 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 extern long double __REDIRECT_NTH (j0l, (long double), __j0l_finite); # endif # 181 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 # endif # 182 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 /* y0. */ extern double __REDIRECT_NTH (y0, (double), __y0_finite); extern float __REDIRECT_NTH (y0f, (float), __y0f_finite); # ifdef __MATH_DECLARE_LDOUBLE # ifdef __NO_LONG_DOUBLE_MATH extern long double __REDIRECT_NTH (y0l, (long double), __y0_finite); # else # 190 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 extern long double __REDIRECT_NTH (y0l, (long double), __y0l_finite); # endif # 192 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 # endif # 193 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 /* j1. */ extern double __REDIRECT_NTH (j1, (double), __j1_finite); extern float __REDIRECT_NTH (j1f, (float), __j1f_finite); # ifdef __MATH_DECLARE_LDOUBLE # ifdef __NO_LONG_DOUBLE_MATH extern long double __REDIRECT_NTH (j1l, (long double), __j1_finite); # else # 201 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 extern long double __REDIRECT_NTH (j1l, (long double), __j1l_finite); # endif # 203 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 # endif # 204 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 /* y1. */ extern double __REDIRECT_NTH (y1, (double), __y1_finite); extern float __REDIRECT_NTH (y1f, (float), __y1f_finite); # ifdef __MATH_DECLARE_LDOUBLE # ifdef __NO_LONG_DOUBLE_MATH extern long double __REDIRECT_NTH (y1l, (long double), __y1_finite); # else # 212 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 extern long double __REDIRECT_NTH (y1l, (long double), __y1l_finite); # endif # 214 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 # endif # 215 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 /* jn. */ extern double __REDIRECT_NTH (jn, (int, double), __jn_finite); extern float __REDIRECT_NTH (jnf, (int, float), __jnf_finite); # ifdef __MATH_DECLARE_LDOUBLE # ifdef __NO_LONG_DOUBLE_MATH extern long double __REDIRECT_NTH (jnl, (int, long double), __jn_finite); # else # 223 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 extern long double __REDIRECT_NTH (jnl, (int, long double), __jnl_finite); # endif # 225 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 # endif # 226 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 /* yn. */ extern double __REDIRECT_NTH (yn, (int, double), __yn_finite); extern float __REDIRECT_NTH (ynf, (int, float), __ynf_finite); # ifdef __MATH_DECLARE_LDOUBLE # ifdef __NO_LONG_DOUBLE_MATH extern long double __REDIRECT_NTH (ynl, (int, long double), __yn_finite); # else # 234 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 extern long double __REDIRECT_NTH (ynl, (int, long double), __ynl_finite); # endif # 236 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 # endif # 237 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 #endif # 238 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 #ifdef __USE_MISC /* lgamma_r. */ extern double __REDIRECT_NTH (lgamma_r, (double, int *), __lgamma_r_finite); extern float __REDIRECT_NTH (lgammaf_r, (float, int *), __lgammaf_r_finite); # ifdef __MATH_DECLARE_LDOUBLE # ifdef __NO_LONG_DOUBLE_MATH extern long double __REDIRECT_NTH (lgammal_r, (long double, int *), __lgamma_r_finite); # else # 248 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 extern long double __REDIRECT_NTH (lgammal_r, (long double, int *), __lgammal_r_finite); # endif # 251 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 # endif # 252 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 #endif # 253 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 #if defined __USE_MISC || defined __USE_XOPEN || defined __USE_ISOC99 /* lgamma. */ __extern_always_inline double __NTH (lgamma (double __d)) { # ifdef __USE_ISOC99 int __local_signgam = 0; return lgamma_r (__d, &__local_signgam); # else # 262 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 return lgamma_r (__d, &signgam); # endif # 264 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 } __extern_always_inline float __NTH (lgammaf (float __d)) { # ifdef __USE_ISOC99 int __local_signgam = 0; return lgammaf_r (__d, &__local_signgam); # else # 271 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 return lgammaf_r (__d, &signgam); # endif # 273 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 } # ifdef __MATH_DECLARE_LDOUBLE __extern_always_inline long double __NTH (lgammal (long double __d)) { # ifdef __USE_ISOC99 int __local_signgam = 0; return lgammal_r (__d, &__local_signgam); # else # 281 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 return lgammal_r (__d, &signgam); # endif # 283 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 } # endif # 285 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 #endif # 286 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 #if defined __USE_MISC || defined __USE_XOPEN /* gamma. */ __extern_always_inline double __NTH (gamma (double __d)) { # ifdef __USE_ISOC99 int __local_signgam = 0; return lgamma_r (__d, &__local_signgam); # else # 295 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 return lgamma_r (__d, &signgam); # endif # 297 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 } __extern_always_inline float __NTH (gammaf (float __d)) { # ifdef __USE_ISOC99 int __local_signgam = 0; return lgammaf_r (__d, &__local_signgam); # else # 304 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 return lgammaf_r (__d, &signgam); # endif # 306 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 } # ifdef __MATH_DECLARE_LDOUBLE __extern_always_inline long double __NTH (gammal (long double __d)) { # ifdef __USE_ISOC99 int __local_signgam = 0; return lgammal_r (__d, &__local_signgam); # else # 314 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 return lgammal_r (__d, &signgam); # endif # 316 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 } # endif # 318 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 #endif # 319 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 /* log. */ extern double __REDIRECT_NTH (log, (double), __log_finite); extern float __REDIRECT_NTH (logf, (float), __logf_finite); #ifdef __MATH_DECLARE_LDOUBLE # ifdef __NO_LONG_DOUBLE_MATH extern long double __REDIRECT_NTH (logl, (long double), __log_finite); # else # 327 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 extern long double __REDIRECT_NTH (logl, (long double), __logl_finite); # endif # 329 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 #endif # 330 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 /* log10. */ extern double __REDIRECT_NTH (log10, (double), __log10_finite); extern float __REDIRECT_NTH (log10f, (float), __log10f_finite); #ifdef __MATH_DECLARE_LDOUBLE # ifdef __NO_LONG_DOUBLE_MATH extern long double __REDIRECT_NTH (log10l, (long double), __log10_finite); # else # 338 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 extern long double __REDIRECT_NTH (log10l, (long double), __log10l_finite); # endif # 340 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 #endif # 341 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 #ifdef __USE_ISOC99 /* log2. */ extern double __REDIRECT_NTH (log2, (double), __log2_finite); extern float __REDIRECT_NTH (log2f, (float), __log2f_finite); # ifdef __MATH_DECLARE_LDOUBLE # ifdef __NO_LONG_DOUBLE_MATH extern long double __REDIRECT_NTH (log2l, (long double), __log2_finite); # else # 350 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 extern long double __REDIRECT_NTH (log2l, (long double), __log2l_finite); # endif # 352 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 # endif # 353 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 #endif # 354 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 /* ldexp. */ extern double __REDIRECT_NTH (ldexp, (double, int), scalbn); extern float __REDIRECT_NTH (ldexpf, (float, int), scalbnf); #ifdef __MATH_DECLARE_LDOUBLE extern long double __REDIRECT_NTH (ldexpl, (long double, int), scalbnl); #endif # 361 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 /* pow. */ extern double __REDIRECT_NTH (pow, (double, double), __pow_finite); extern float __REDIRECT_NTH (powf, (float, float), __powf_finite); #ifdef __MATH_DECLARE_LDOUBLE # ifdef __NO_LONG_DOUBLE_MATH extern long double __REDIRECT_NTH (powl, (long double, long double), __pow_finite); # else # 370 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 extern long double __REDIRECT_NTH (powl, (long double, long double), __powl_finite); # endif # 373 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 #endif # 374 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 /* remainder. */ extern double __REDIRECT_NTH (remainder, (double, double), __remainder_finite); extern float __REDIRECT_NTH (remainderf, (float, float), __remainderf_finite); #ifdef __MATH_DECLARE_LDOUBLE # ifdef __NO_LONG_DOUBLE_MATH extern long double __REDIRECT_NTH (remainderl, (long double, long double), __remainder_finite); # else # 383 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 extern long double __REDIRECT_NTH (remainderl, (long double, long double), __remainderl_finite); # endif # 386 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 #endif # 387 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED /* scalb. */ extern double __REDIRECT_NTH (scalb, (double, double), __scalb_finite); extern float __REDIRECT_NTH (scalbf, (float, float), __scalbf_finite); # ifdef __MATH_DECLARE_LDOUBLE # ifdef __NO_LONG_DOUBLE_MATH extern long double __REDIRECT_NTH (scalbl, (long double, long double), __scalb_finite); # else # 397 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 extern long double __REDIRECT_NTH (scalbl, (long double, long double), __scalbl_finite); # endif # 400 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 # endif # 401 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 #endif # 402 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 /* sinh. */ extern double __REDIRECT_NTH (sinh, (double), __sinh_finite); extern float __REDIRECT_NTH (sinhf, (float), __sinhf_finite); #ifdef __MATH_DECLARE_LDOUBLE # ifdef __NO_LONG_DOUBLE_MATH extern long double __REDIRECT_NTH (sinhl, (long double), __sinh_finite); # else # 410 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 extern long double __REDIRECT_NTH (sinhl, (long double), __sinhl_finite); # endif # 412 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 #endif # 413 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 /* sqrt. */ extern double __REDIRECT_NTH (sqrt, (double), __sqrt_finite); extern float __REDIRECT_NTH (sqrtf, (float), __sqrtf_finite); #ifdef __MATH_DECLARE_LDOUBLE # ifdef __NO_LONG_DOUBLE_MATH extern long double __REDIRECT_NTH (sqrtl, (long double), __sqrt_finite); # else # 421 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 extern long double __REDIRECT_NTH (sqrtl, (long double), __sqrtl_finite); # endif # 423 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 #endif # 424 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 #ifdef __USE_ISOC99 /* tgamma. */ extern double __gamma_r_finite (double, int *); __extern_always_inline double __NTH (tgamma (double __d)) { int __local_signgam = 0; double __res = __gamma_r_finite (__d, &__local_signgam); return __local_signgam < 0 ? -__res : __res; } extern float __gammaf_r_finite (float, int *); __extern_always_inline float __NTH (tgammaf (float __d)) { int __local_signgam = 0; float __res = __gammaf_r_finite (__d, &__local_signgam); return __local_signgam < 0 ? -__res : __res; } # ifdef __MATH_DECLARE_LDOUBLE extern long double __gammal_r_finite (long double, int *); __extern_always_inline long double __NTH (tgammal (long double __d)) { int __local_signgam = 0; # ifdef __NO_LONG_DOUBLE_MATH long double __res = __gamma_r_finite (__d, &__local_signgam); # else # 449 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 long double __res = __gammal_r_finite (__d, &__local_signgam); # endif # 451 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 return __local_signgam < 0 ? -__res : __res; } # endif # 454 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 #endif # 455 "/usr/include/x86_64-linux-gnu/bits/math-finite.h" 3 4 # 433 "/usr/include/math.h" 2 3 4 #endif # 434 "/usr/include/math.h" 3 4 #ifdef __USE_ISOC99 /* If we've still got undefined comparison macros, provide defaults. */ /* Return nonzero value if X is greater than Y. */ # ifndef isgreater # define isgreater(x, y) \ (__extension__ \ ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \ !isunordered (__x, __y) && __x > __y; })) # endif # 445 "/usr/include/math.h" 3 4 /* Return nonzero value if X is greater than or equal to Y. */ # ifndef isgreaterequal # define isgreaterequal(x, y) \ (__extension__ \ ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \ !isunordered (__x, __y) && __x >= __y; })) # endif # 453 "/usr/include/math.h" 3 4 /* Return nonzero value if X is less than Y. */ # ifndef isless # define isless(x, y) \ (__extension__ \ ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \ !isunordered (__x, __y) && __x < __y; })) # endif # 461 "/usr/include/math.h" 3 4 /* Return nonzero value if X is less than or equal to Y. */ # ifndef islessequal # define islessequal(x, y) \ (__extension__ \ ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \ !isunordered (__x, __y) && __x <= __y; })) # endif # 469 "/usr/include/math.h" 3 4 /* Return nonzero value if either X is less than Y or Y is less than X. */ # ifndef islessgreater # define islessgreater(x, y) \ (__extension__ \ ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \ !isunordered (__x, __y) && (__x < __y || __y < __x); })) # endif # 477 "/usr/include/math.h" 3 4 /* Return nonzero value if arguments are unordered. */ # ifndef isunordered # define isunordered(u, v) \ (__extension__ \ ({ __typeof__(u) __u = (u); __typeof__(v) __v = (v); \ fpclassify (__u) == FP_NAN || fpclassify (__v) == FP_NAN; })) # endif # 485 "/usr/include/math.h" 3 4 #endif # 487 "/usr/include/math.h" 3 4 __END_DECLS #endif /* math.h */ # 492 "/usr/include/math.h" 3 4 # 45 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 2 3 #ifndef _GLIBCXX_CMATH #define _GLIBCXX_CMATH 1 // Get rid of those macros defined in in lieu of real functions. #undef abs #undef div #undef acos #undef asin #undef atan #undef atan2 #undef ceil #undef cos #undef cosh #undef exp #undef fabs #undef floor #undef fmod #undef frexp #undef ldexp #undef log #undef log10 #undef modf #undef pow #undef sin #undef sinh #undef sqrt #undef tan #undef tanh namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO inline _GLIBCXX_CONSTEXPR double abs(double __x) { return __builtin_fabs(__x); } #endif # 84 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO inline _GLIBCXX_CONSTEXPR float abs(float __x) { return __builtin_fabsf(__x); } inline _GLIBCXX_CONSTEXPR long double abs(long double __x) { return __builtin_fabsl(__x); } #endif # 94 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template inline _GLIBCXX_CONSTEXPR typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, double>::__type abs(_Tp __x) { return __builtin_fabs(__x); } using ::acos; #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO inline _GLIBCXX_CONSTEXPR float acos(float __x) { return __builtin_acosf(__x); } inline _GLIBCXX_CONSTEXPR long double acos(long double __x) { return __builtin_acosl(__x); } #endif # 113 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template inline _GLIBCXX_CONSTEXPR typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, double>::__type acos(_Tp __x) { return __builtin_acos(__x); } using ::asin; #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO inline _GLIBCXX_CONSTEXPR float asin(float __x) { return __builtin_asinf(__x); } inline _GLIBCXX_CONSTEXPR long double asin(long double __x) { return __builtin_asinl(__x); } #endif # 132 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template inline _GLIBCXX_CONSTEXPR typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, double>::__type asin(_Tp __x) { return __builtin_asin(__x); } using ::atan; #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO inline _GLIBCXX_CONSTEXPR float atan(float __x) { return __builtin_atanf(__x); } inline _GLIBCXX_CONSTEXPR long double atan(long double __x) { return __builtin_atanl(__x); } #endif # 151 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template inline _GLIBCXX_CONSTEXPR typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, double>::__type atan(_Tp __x) { return __builtin_atan(__x); } using ::atan2; #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO inline _GLIBCXX_CONSTEXPR float atan2(float __y, float __x) { return __builtin_atan2f(__y, __x); } inline _GLIBCXX_CONSTEXPR long double atan2(long double __y, long double __x) { return __builtin_atan2l(__y, __x); } #endif # 170 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template inline _GLIBCXX_CONSTEXPR typename __gnu_cxx::__promote_2<_Tp, _Up>::__type atan2(_Tp __y, _Up __x) { typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; return atan2(__type(__y), __type(__x)); } using ::ceil; #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO inline _GLIBCXX_CONSTEXPR float ceil(float __x) { return __builtin_ceilf(__x); } inline _GLIBCXX_CONSTEXPR long double ceil(long double __x) { return __builtin_ceill(__x); } #endif # 191 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template inline _GLIBCXX_CONSTEXPR typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, double>::__type ceil(_Tp __x) { return __builtin_ceil(__x); } using ::cos; #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO inline _GLIBCXX_CONSTEXPR float cos(float __x) { return __builtin_cosf(__x); } inline _GLIBCXX_CONSTEXPR long double cos(long double __x) { return __builtin_cosl(__x); } #endif # 210 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template inline _GLIBCXX_CONSTEXPR typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, double>::__type cos(_Tp __x) { return __builtin_cos(__x); } using ::cosh; #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO inline _GLIBCXX_CONSTEXPR float cosh(float __x) { return __builtin_coshf(__x); } inline _GLIBCXX_CONSTEXPR long double cosh(long double __x) { return __builtin_coshl(__x); } #endif # 229 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template inline _GLIBCXX_CONSTEXPR typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, double>::__type cosh(_Tp __x) { return __builtin_cosh(__x); } using ::exp; #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO inline _GLIBCXX_CONSTEXPR float exp(float __x) { return __builtin_expf(__x); } inline _GLIBCXX_CONSTEXPR long double exp(long double __x) { return __builtin_expl(__x); } #endif # 248 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template inline _GLIBCXX_CONSTEXPR typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, double>::__type exp(_Tp __x) { return __builtin_exp(__x); } using ::fabs; #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO inline _GLIBCXX_CONSTEXPR float fabs(float __x) { return __builtin_fabsf(__x); } inline _GLIBCXX_CONSTEXPR long double fabs(long double __x) { return __builtin_fabsl(__x); } #endif # 267 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template inline _GLIBCXX_CONSTEXPR typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, double>::__type fabs(_Tp __x) { return __builtin_fabs(__x); } using ::floor; #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO inline _GLIBCXX_CONSTEXPR float floor(float __x) { return __builtin_floorf(__x); } inline _GLIBCXX_CONSTEXPR long double floor(long double __x) { return __builtin_floorl(__x); } #endif # 286 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template inline _GLIBCXX_CONSTEXPR typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, double>::__type floor(_Tp __x) { return __builtin_floor(__x); } using ::fmod; #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO inline _GLIBCXX_CONSTEXPR float fmod(float __x, float __y) { return __builtin_fmodf(__x, __y); } inline _GLIBCXX_CONSTEXPR long double fmod(long double __x, long double __y) { return __builtin_fmodl(__x, __y); } #endif # 305 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template inline _GLIBCXX_CONSTEXPR typename __gnu_cxx::__promote_2<_Tp, _Up>::__type fmod(_Tp __x, _Up __y) { typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; return fmod(__type(__x), __type(__y)); } using ::frexp; #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO inline float frexp(float __x, int* __exp) { return __builtin_frexpf(__x, __exp); } inline long double frexp(long double __x, int* __exp) { return __builtin_frexpl(__x, __exp); } #endif # 326 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template inline _GLIBCXX_CONSTEXPR typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, double>::__type frexp(_Tp __x, int* __exp) { return __builtin_frexp(__x, __exp); } using ::ldexp; #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO inline _GLIBCXX_CONSTEXPR float ldexp(float __x, int __exp) { return __builtin_ldexpf(__x, __exp); } inline _GLIBCXX_CONSTEXPR long double ldexp(long double __x, int __exp) { return __builtin_ldexpl(__x, __exp); } #endif # 345 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template inline _GLIBCXX_CONSTEXPR typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, double>::__type ldexp(_Tp __x, int __exp) { return __builtin_ldexp(__x, __exp); } using ::log; #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO inline _GLIBCXX_CONSTEXPR float log(float __x) { return __builtin_logf(__x); } inline _GLIBCXX_CONSTEXPR long double log(long double __x) { return __builtin_logl(__x); } #endif # 364 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template inline _GLIBCXX_CONSTEXPR typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, double>::__type log(_Tp __x) { return __builtin_log(__x); } using ::log10; #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO inline _GLIBCXX_CONSTEXPR float log10(float __x) { return __builtin_log10f(__x); } inline _GLIBCXX_CONSTEXPR long double log10(long double __x) { return __builtin_log10l(__x); } #endif # 383 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template inline _GLIBCXX_CONSTEXPR typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, double>::__type log10(_Tp __x) { return __builtin_log10(__x); } using ::modf; #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO inline float modf(float __x, float* __iptr) { return __builtin_modff(__x, __iptr); } inline long double modf(long double __x, long double* __iptr) { return __builtin_modfl(__x, __iptr); } #endif # 402 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 using ::pow; #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO inline _GLIBCXX_CONSTEXPR float pow(float __x, float __y) { return __builtin_powf(__x, __y); } inline _GLIBCXX_CONSTEXPR long double pow(long double __x, long double __y) { return __builtin_powl(__x, __y); } #if __cplusplus < 201103L // _GLIBCXX_RESOLVE_LIB_DEFECTS // DR 550. What should the return type of pow(float,int) be? inline double pow(double __x, int __i) { return __builtin_powi(__x, __i); } inline float pow(float __x, int __n) { return __builtin_powif(__x, __n); } inline long double pow(long double __x, int __n) { return __builtin_powil(__x, __n); } #endif # 429 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 #endif # 430 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template inline _GLIBCXX_CONSTEXPR typename __gnu_cxx::__promote_2<_Tp, _Up>::__type pow(_Tp __x, _Up __y) { typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; return pow(__type(__x), __type(__y)); } using ::sin; #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO inline _GLIBCXX_CONSTEXPR float sin(float __x) { return __builtin_sinf(__x); } inline _GLIBCXX_CONSTEXPR long double sin(long double __x) { return __builtin_sinl(__x); } #endif # 451 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template inline _GLIBCXX_CONSTEXPR typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, double>::__type sin(_Tp __x) { return __builtin_sin(__x); } using ::sinh; #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO inline _GLIBCXX_CONSTEXPR float sinh(float __x) { return __builtin_sinhf(__x); } inline _GLIBCXX_CONSTEXPR long double sinh(long double __x) { return __builtin_sinhl(__x); } #endif # 470 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template inline _GLIBCXX_CONSTEXPR typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, double>::__type sinh(_Tp __x) { return __builtin_sinh(__x); } using ::sqrt; #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO inline _GLIBCXX_CONSTEXPR float sqrt(float __x) { return __builtin_sqrtf(__x); } inline _GLIBCXX_CONSTEXPR long double sqrt(long double __x) { return __builtin_sqrtl(__x); } #endif # 489 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template inline _GLIBCXX_CONSTEXPR typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, double>::__type sqrt(_Tp __x) { return __builtin_sqrt(__x); } using ::tan; #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO inline _GLIBCXX_CONSTEXPR float tan(float __x) { return __builtin_tanf(__x); } inline _GLIBCXX_CONSTEXPR long double tan(long double __x) { return __builtin_tanl(__x); } #endif # 508 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template inline _GLIBCXX_CONSTEXPR typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, double>::__type tan(_Tp __x) { return __builtin_tan(__x); } using ::tanh; #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO inline _GLIBCXX_CONSTEXPR float tanh(float __x) { return __builtin_tanhf(__x); } inline _GLIBCXX_CONSTEXPR long double tanh(long double __x) { return __builtin_tanhl(__x); } #endif # 527 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template inline _GLIBCXX_CONSTEXPR typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, double>::__type tanh(_Tp __x) { return __builtin_tanh(__x); } _GLIBCXX_END_NAMESPACE_VERSION } // namespace #if _GLIBCXX_USE_C99_MATH #if !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC // These are possible macros imported from C99-land. #undef fpclassify #undef isfinite #undef isinf #undef isnan #undef isnormal #undef signbit #undef isgreater #undef isgreaterequal #undef isless #undef islessequal #undef islessgreater #undef isunordered namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION #if __cplusplus >= 201103L #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO constexpr int fpclassify(float __x) { return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, FP_SUBNORMAL, FP_ZERO, __x); } constexpr int fpclassify(double __x) { return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, FP_SUBNORMAL, FP_ZERO, __x); } constexpr int fpclassify(long double __x) { return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, FP_SUBNORMAL, FP_ZERO, __x); } #endif # 577 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, int>::__type fpclassify(_Tp __x) { return __x != 0 ? FP_NORMAL : FP_ZERO; } #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO constexpr bool isfinite(float __x) { return __builtin_isfinite(__x); } constexpr bool isfinite(double __x) { return __builtin_isfinite(__x); } constexpr bool isfinite(long double __x) { return __builtin_isfinite(__x); } #endif # 597 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, bool>::__type isfinite(_Tp __x) { return true; } #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO constexpr bool isinf(float __x) { return __builtin_isinf(__x); } constexpr bool isinf(double __x) { return __builtin_isinf(__x); } constexpr bool isinf(long double __x) { return __builtin_isinf(__x); } #endif # 617 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, bool>::__type isinf(_Tp __x) { return false; } #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO constexpr bool isnan(float __x) { return __builtin_isnan(__x); } constexpr bool isnan(double __x) { return __builtin_isnan(__x); } constexpr bool isnan(long double __x) { return __builtin_isnan(__x); } #endif # 637 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, bool>::__type isnan(_Tp __x) { return false; } #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO constexpr bool isnormal(float __x) { return __builtin_isnormal(__x); } constexpr bool isnormal(double __x) { return __builtin_isnormal(__x); } constexpr bool isnormal(long double __x) { return __builtin_isnormal(__x); } #endif # 657 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, bool>::__type isnormal(_Tp __x) { return __x != 0 ? true : false; } #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO // The front-end doesn't provide a type generic builtin (libstdc++/58625). constexpr bool signbit(float __x) { return __builtin_signbitf(__x); } constexpr bool signbit(double __x) { return __builtin_signbit(__x); } constexpr bool signbit(long double __x) { return __builtin_signbitl(__x); } #endif # 678 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, bool>::__type signbit(_Tp __x) { return __x < 0 ? true : false; } #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO constexpr bool isgreater(float __x, float __y) { return __builtin_isgreater(__x, __y); } constexpr bool isgreater(double __x, double __y) { return __builtin_isgreater(__x, __y); } constexpr bool isgreater(long double __x, long double __y) { return __builtin_isgreater(__x, __y); } #endif # 698 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template constexpr typename __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value && __is_arithmetic<_Up>::__value), bool>::__type isgreater(_Tp __x, _Up __y) { typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; return __builtin_isgreater(__type(__x), __type(__y)); } #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO constexpr bool isgreaterequal(float __x, float __y) { return __builtin_isgreaterequal(__x, __y); } constexpr bool isgreaterequal(double __x, double __y) { return __builtin_isgreaterequal(__x, __y); } constexpr bool isgreaterequal(long double __x, long double __y) { return __builtin_isgreaterequal(__x, __y); } #endif # 722 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template constexpr typename __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value && __is_arithmetic<_Up>::__value), bool>::__type isgreaterequal(_Tp __x, _Up __y) { typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; return __builtin_isgreaterequal(__type(__x), __type(__y)); } #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO constexpr bool isless(float __x, float __y) { return __builtin_isless(__x, __y); } constexpr bool isless(double __x, double __y) { return __builtin_isless(__x, __y); } constexpr bool isless(long double __x, long double __y) { return __builtin_isless(__x, __y); } #endif # 746 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template constexpr typename __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value && __is_arithmetic<_Up>::__value), bool>::__type isless(_Tp __x, _Up __y) { typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; return __builtin_isless(__type(__x), __type(__y)); } #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO constexpr bool islessequal(float __x, float __y) { return __builtin_islessequal(__x, __y); } constexpr bool islessequal(double __x, double __y) { return __builtin_islessequal(__x, __y); } constexpr bool islessequal(long double __x, long double __y) { return __builtin_islessequal(__x, __y); } #endif # 770 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template constexpr typename __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value && __is_arithmetic<_Up>::__value), bool>::__type islessequal(_Tp __x, _Up __y) { typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; return __builtin_islessequal(__type(__x), __type(__y)); } #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO constexpr bool islessgreater(float __x, float __y) { return __builtin_islessgreater(__x, __y); } constexpr bool islessgreater(double __x, double __y) { return __builtin_islessgreater(__x, __y); } constexpr bool islessgreater(long double __x, long double __y) { return __builtin_islessgreater(__x, __y); } #endif # 794 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template constexpr typename __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value && __is_arithmetic<_Up>::__value), bool>::__type islessgreater(_Tp __x, _Up __y) { typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; return __builtin_islessgreater(__type(__x), __type(__y)); } #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO constexpr bool isunordered(float __x, float __y) { return __builtin_isunordered(__x, __y); } constexpr bool isunordered(double __x, double __y) { return __builtin_isunordered(__x, __y); } constexpr bool isunordered(long double __x, long double __y) { return __builtin_isunordered(__x, __y); } #endif # 818 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template constexpr typename __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value && __is_arithmetic<_Up>::__value), bool>::__type isunordered(_Tp __x, _Up __y) { typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; return __builtin_isunordered(__type(__x), __type(__y)); } #else # 830 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, int>::__type fpclassify(_Tp __f) { typedef typename __gnu_cxx::__promote<_Tp>::__type __type; return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, FP_SUBNORMAL, FP_ZERO, __type(__f)); } template inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, int>::__type isfinite(_Tp __f) { typedef typename __gnu_cxx::__promote<_Tp>::__type __type; return __builtin_isfinite(__type(__f)); } template inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, int>::__type isinf(_Tp __f) { typedef typename __gnu_cxx::__promote<_Tp>::__type __type; return __builtin_isinf(__type(__f)); } template inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, int>::__type isnan(_Tp __f) { typedef typename __gnu_cxx::__promote<_Tp>::__type __type; return __builtin_isnan(__type(__f)); } template inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, int>::__type isnormal(_Tp __f) { typedef typename __gnu_cxx::__promote<_Tp>::__type __type; return __builtin_isnormal(__type(__f)); } template inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, int>::__type signbit(_Tp __f) { typedef typename __gnu_cxx::__promote<_Tp>::__type __type; return sizeof(__type) == sizeof(float) ? __builtin_signbitf(__type(__f)) : sizeof(__type) == sizeof(double) ? __builtin_signbit(__type(__f)) : __builtin_signbitl(__type(__f)); } template inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, int>::__type isgreater(_Tp __f1, _Tp __f2) { typedef typename __gnu_cxx::__promote<_Tp>::__type __type; return __builtin_isgreater(__type(__f1), __type(__f2)); } template inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, int>::__type isgreaterequal(_Tp __f1, _Tp __f2) { typedef typename __gnu_cxx::__promote<_Tp>::__type __type; return __builtin_isgreaterequal(__type(__f1), __type(__f2)); } template inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, int>::__type isless(_Tp __f1, _Tp __f2) { typedef typename __gnu_cxx::__promote<_Tp>::__type __type; return __builtin_isless(__type(__f1), __type(__f2)); } template inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, int>::__type islessequal(_Tp __f1, _Tp __f2) { typedef typename __gnu_cxx::__promote<_Tp>::__type __type; return __builtin_islessequal(__type(__f1), __type(__f2)); } template inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, int>::__type islessgreater(_Tp __f1, _Tp __f2) { typedef typename __gnu_cxx::__promote<_Tp>::__type __type; return __builtin_islessgreater(__type(__f1), __type(__f2)); } template inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, int>::__type isunordered(_Tp __f1, _Tp __f2) { typedef typename __gnu_cxx::__promote<_Tp>::__type __type; return __builtin_isunordered(__type(__f1), __type(__f2)); } #endif # 945 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 _GLIBCXX_END_NAMESPACE_VERSION } // namespace #endif /* _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC */ # 950 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 #endif # 951 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 #if __cplusplus >= 201103L #ifdef _GLIBCXX_USE_C99_MATH_TR1 #undef acosh #undef acoshf #undef acoshl #undef asinh #undef asinhf #undef asinhl #undef atanh #undef atanhf #undef atanhl #undef cbrt #undef cbrtf #undef cbrtl #undef copysign #undef copysignf #undef copysignl #undef erf #undef erff #undef erfl #undef erfc #undef erfcf #undef erfcl #undef exp2 #undef exp2f #undef exp2l #undef expm1 #undef expm1f #undef expm1l #undef fdim #undef fdimf #undef fdiml #undef fma #undef fmaf #undef fmal #undef fmax #undef fmaxf #undef fmaxl #undef fmin #undef fminf #undef fminl #undef hypot #undef hypotf #undef hypotl #undef ilogb #undef ilogbf #undef ilogbl #undef lgamma #undef lgammaf #undef lgammal #undef llrint #undef llrintf #undef llrintl #undef llround #undef llroundf #undef llroundl #undef log1p #undef log1pf #undef log1pl #undef log2 #undef log2f #undef log2l #undef logb #undef logbf #undef logbl #undef lrint #undef lrintf #undef lrintl #undef lround #undef lroundf #undef lroundl #undef nan #undef nanf #undef nanl #undef nearbyint #undef nearbyintf #undef nearbyintl #undef nextafter #undef nextafterf #undef nextafterl #undef nexttoward #undef nexttowardf #undef nexttowardl #undef remainder #undef remainderf #undef remainderl #undef remquo #undef remquof #undef remquol #undef rint #undef rintf #undef rintl #undef round #undef roundf #undef roundl #undef scalbln #undef scalblnf #undef scalblnl #undef scalbn #undef scalbnf #undef scalbnl #undef tgamma #undef tgammaf #undef tgammal #undef trunc #undef truncf #undef truncl namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION // types using ::double_t; using ::float_t; // functions using ::acosh; using ::acoshf; using ::acoshl; using ::asinh; using ::asinhf; using ::asinhl; using ::atanh; using ::atanhf; using ::atanhl; using ::cbrt; using ::cbrtf; using ::cbrtl; using ::copysign; using ::copysignf; using ::copysignl; using ::erf; using ::erff; using ::erfl; using ::erfc; using ::erfcf; using ::erfcl; using ::exp2; using ::exp2f; using ::exp2l; using ::expm1; using ::expm1f; using ::expm1l; using ::fdim; using ::fdimf; using ::fdiml; using ::fma; using ::fmaf; using ::fmal; using ::fmax; using ::fmaxf; using ::fmaxl; using ::fmin; using ::fminf; using ::fminl; using ::hypot; using ::hypotf; using ::hypotl; using ::ilogb; using ::ilogbf; using ::ilogbl; using ::lgamma; using ::lgammaf; using ::lgammal; using ::llrint; using ::llrintf; using ::llrintl; using ::llround; using ::llroundf; using ::llroundl; using ::log1p; using ::log1pf; using ::log1pl; using ::log2; using ::log2f; using ::log2l; using ::logb; using ::logbf; using ::logbl; using ::lrint; using ::lrintf; using ::lrintl; using ::lround; using ::lroundf; using ::lroundl; using ::nan; using ::nanf; using ::nanl; using ::nearbyint; using ::nearbyintf; using ::nearbyintl; using ::nextafter; using ::nextafterf; using ::nextafterl; using ::nexttoward; using ::nexttowardf; using ::nexttowardl; using ::remainder; using ::remainderf; using ::remainderl; using ::remquo; using ::remquof; using ::remquol; using ::rint; using ::rintf; using ::rintl; using ::round; using ::roundf; using ::roundl; using ::scalbln; using ::scalblnf; using ::scalblnl; using ::scalbn; using ::scalbnf; using ::scalbnl; using ::tgamma; using ::tgammaf; using ::tgammal; using ::trunc; using ::truncf; using ::truncl; /// Additional overloads. #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO constexpr float acosh(float __x) { return __builtin_acoshf(__x); } constexpr long double acosh(long double __x) { return __builtin_acoshl(__x); } #endif # 1221 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, double>::__type acosh(_Tp __x) { return __builtin_acosh(__x); } #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO constexpr float asinh(float __x) { return __builtin_asinhf(__x); } constexpr long double asinh(long double __x) { return __builtin_asinhl(__x); } #endif # 1237 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, double>::__type asinh(_Tp __x) { return __builtin_asinh(__x); } #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO constexpr float atanh(float __x) { return __builtin_atanhf(__x); } constexpr long double atanh(long double __x) { return __builtin_atanhl(__x); } #endif # 1253 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, double>::__type atanh(_Tp __x) { return __builtin_atanh(__x); } #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO constexpr float cbrt(float __x) { return __builtin_cbrtf(__x); } constexpr long double cbrt(long double __x) { return __builtin_cbrtl(__x); } #endif # 1269 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, double>::__type cbrt(_Tp __x) { return __builtin_cbrt(__x); } #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO constexpr float copysign(float __x, float __y) { return __builtin_copysignf(__x, __y); } constexpr long double copysign(long double __x, long double __y) { return __builtin_copysignl(__x, __y); } #endif # 1285 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type copysign(_Tp __x, _Up __y) { typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; return copysign(__type(__x), __type(__y)); } #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO constexpr float erf(float __x) { return __builtin_erff(__x); } constexpr long double erf(long double __x) { return __builtin_erfl(__x); } #endif # 1303 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, double>::__type erf(_Tp __x) { return __builtin_erf(__x); } #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO constexpr float erfc(float __x) { return __builtin_erfcf(__x); } constexpr long double erfc(long double __x) { return __builtin_erfcl(__x); } #endif # 1319 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, double>::__type erfc(_Tp __x) { return __builtin_erfc(__x); } #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO constexpr float exp2(float __x) { return __builtin_exp2f(__x); } constexpr long double exp2(long double __x) { return __builtin_exp2l(__x); } #endif # 1335 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, double>::__type exp2(_Tp __x) { return __builtin_exp2(__x); } #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO constexpr float expm1(float __x) { return __builtin_expm1f(__x); } constexpr long double expm1(long double __x) { return __builtin_expm1l(__x); } #endif # 1351 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, double>::__type expm1(_Tp __x) { return __builtin_expm1(__x); } #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO constexpr float fdim(float __x, float __y) { return __builtin_fdimf(__x, __y); } constexpr long double fdim(long double __x, long double __y) { return __builtin_fdiml(__x, __y); } #endif # 1367 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type fdim(_Tp __x, _Up __y) { typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; return fdim(__type(__x), __type(__y)); } #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO constexpr float fma(float __x, float __y, float __z) { return __builtin_fmaf(__x, __y, __z); } constexpr long double fma(long double __x, long double __y, long double __z) { return __builtin_fmal(__x, __y, __z); } #endif # 1385 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template constexpr typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type fma(_Tp __x, _Up __y, _Vp __z) { typedef typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type __type; return fma(__type(__x), __type(__y), __type(__z)); } #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO constexpr float fmax(float __x, float __y) { return __builtin_fmaxf(__x, __y); } constexpr long double fmax(long double __x, long double __y) { return __builtin_fmaxl(__x, __y); } #endif # 1403 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type fmax(_Tp __x, _Up __y) { typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; return fmax(__type(__x), __type(__y)); } #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO constexpr float fmin(float __x, float __y) { return __builtin_fminf(__x, __y); } constexpr long double fmin(long double __x, long double __y) { return __builtin_fminl(__x, __y); } #endif # 1421 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type fmin(_Tp __x, _Up __y) { typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; return fmin(__type(__x), __type(__y)); } #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO constexpr float hypot(float __x, float __y) { return __builtin_hypotf(__x, __y); } constexpr long double hypot(long double __x, long double __y) { return __builtin_hypotl(__x, __y); } #endif # 1439 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type hypot(_Tp __x, _Up __y) { typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; return hypot(__type(__x), __type(__y)); } #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO constexpr int ilogb(float __x) { return __builtin_ilogbf(__x); } constexpr int ilogb(long double __x) { return __builtin_ilogbl(__x); } #endif # 1457 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, int>::__type ilogb(_Tp __x) { return __builtin_ilogb(__x); } #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO constexpr float lgamma(float __x) { return __builtin_lgammaf(__x); } constexpr long double lgamma(long double __x) { return __builtin_lgammal(__x); } #endif # 1474 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, double>::__type lgamma(_Tp __x) { return __builtin_lgamma(__x); } #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO constexpr long long llrint(float __x) { return __builtin_llrintf(__x); } constexpr long long llrint(long double __x) { return __builtin_llrintl(__x); } #endif # 1490 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, long long>::__type llrint(_Tp __x) { return __builtin_llrint(__x); } #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO constexpr long long llround(float __x) { return __builtin_llroundf(__x); } constexpr long long llround(long double __x) { return __builtin_llroundl(__x); } #endif # 1506 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, long long>::__type llround(_Tp __x) { return __builtin_llround(__x); } #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO constexpr float log1p(float __x) { return __builtin_log1pf(__x); } constexpr long double log1p(long double __x) { return __builtin_log1pl(__x); } #endif # 1522 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, double>::__type log1p(_Tp __x) { return __builtin_log1p(__x); } #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO // DR 568. constexpr float log2(float __x) { return __builtin_log2f(__x); } constexpr long double log2(long double __x) { return __builtin_log2l(__x); } #endif # 1539 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, double>::__type log2(_Tp __x) { return __builtin_log2(__x); } #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO constexpr float logb(float __x) { return __builtin_logbf(__x); } constexpr long double logb(long double __x) { return __builtin_logbl(__x); } #endif # 1555 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, double>::__type logb(_Tp __x) { return __builtin_logb(__x); } #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO constexpr long lrint(float __x) { return __builtin_lrintf(__x); } constexpr long lrint(long double __x) { return __builtin_lrintl(__x); } #endif # 1571 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, long>::__type lrint(_Tp __x) { return __builtin_lrint(__x); } #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO constexpr long lround(float __x) { return __builtin_lroundf(__x); } constexpr long lround(long double __x) { return __builtin_lroundl(__x); } #endif # 1587 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, long>::__type lround(_Tp __x) { return __builtin_lround(__x); } #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO constexpr float nearbyint(float __x) { return __builtin_nearbyintf(__x); } constexpr long double nearbyint(long double __x) { return __builtin_nearbyintl(__x); } #endif # 1603 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, double>::__type nearbyint(_Tp __x) { return __builtin_nearbyint(__x); } #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO constexpr float nextafter(float __x, float __y) { return __builtin_nextafterf(__x, __y); } constexpr long double nextafter(long double __x, long double __y) { return __builtin_nextafterl(__x, __y); } #endif # 1619 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type nextafter(_Tp __x, _Up __y) { typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; return nextafter(__type(__x), __type(__y)); } #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO constexpr float nexttoward(float __x, long double __y) { return __builtin_nexttowardf(__x, __y); } constexpr long double nexttoward(long double __x, long double __y) { return __builtin_nexttowardl(__x, __y); } #endif # 1637 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, double>::__type nexttoward(_Tp __x, long double __y) { return __builtin_nexttoward(__x, __y); } #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO constexpr float remainder(float __x, float __y) { return __builtin_remainderf(__x, __y); } constexpr long double remainder(long double __x, long double __y) { return __builtin_remainderl(__x, __y); } #endif # 1653 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type remainder(_Tp __x, _Up __y) { typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; return remainder(__type(__x), __type(__y)); } #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO inline float remquo(float __x, float __y, int* __pquo) { return __builtin_remquof(__x, __y, __pquo); } inline long double remquo(long double __x, long double __y, int* __pquo) { return __builtin_remquol(__x, __y, __pquo); } #endif # 1671 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type remquo(_Tp __x, _Up __y, int* __pquo) { typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; return remquo(__type(__x), __type(__y), __pquo); } #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO constexpr float rint(float __x) { return __builtin_rintf(__x); } constexpr long double rint(long double __x) { return __builtin_rintl(__x); } #endif # 1689 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, double>::__type rint(_Tp __x) { return __builtin_rint(__x); } #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO constexpr float round(float __x) { return __builtin_roundf(__x); } constexpr long double round(long double __x) { return __builtin_roundl(__x); } #endif # 1705 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, double>::__type round(_Tp __x) { return __builtin_round(__x); } #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO constexpr float scalbln(float __x, long __ex) { return __builtin_scalblnf(__x, __ex); } constexpr long double scalbln(long double __x, long __ex) { return __builtin_scalblnl(__x, __ex); } #endif # 1721 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, double>::__type scalbln(_Tp __x, long __ex) { return __builtin_scalbln(__x, __ex); } #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO constexpr float scalbn(float __x, int __ex) { return __builtin_scalbnf(__x, __ex); } constexpr long double scalbn(long double __x, int __ex) { return __builtin_scalbnl(__x, __ex); } #endif # 1737 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, double>::__type scalbn(_Tp __x, int __ex) { return __builtin_scalbn(__x, __ex); } #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO constexpr float tgamma(float __x) { return __builtin_tgammaf(__x); } constexpr long double tgamma(long double __x) { return __builtin_tgammal(__x); } #endif # 1753 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, double>::__type tgamma(_Tp __x) { return __builtin_tgamma(__x); } #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO constexpr float trunc(float __x) { return __builtin_truncf(__x); } constexpr long double trunc(long double __x) { return __builtin_truncl(__x); } #endif # 1769 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, double>::__type trunc(_Tp __x) { return __builtin_trunc(__x); } _GLIBCXX_END_NAMESPACE_VERSION } // namespace #endif // _GLIBCXX_USE_C99_MATH_TR1 # 1780 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 #endif // C++11 # 1782 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 #endif # 1784 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cmath" 3 # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/random" 2 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/random" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 1 3 // -*- C++ -*- forwarding header. // Copyright (C) 1997-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file include/cstdlib * This is a Standard C++ Library file. You should @c \#include this file * in your programs, rather than any of the @a *.h implementation files. * * This is the C++ version of the Standard C Library header @c stdlib.h, * and its contents are (mostly) the same as that header, but are all * contained in the namespace @c std (except for names which are defined * as macros in C). */ // // ISO C++ 14882: 20.4.6 C library // #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #ifndef _GLIBCXX_CSTDLIB #define _GLIBCXX_CSTDLIB 1 #if !_GLIBCXX_HOSTED // The C standard does not require a freestanding implementation to // provide . However, the C++ standard does still require // -- but only the functionality mentioned in // [lib.support.start.term]. #define EXIT_SUCCESS 0 #define EXIT_FAILURE 1 namespace std { extern "C" void abort(void) throw () _GLIBCXX_NORETURN; extern "C" int atexit(void (*)(void)) throw (); extern "C" void exit(int) throw () _GLIBCXX_NORETURN; #if __cplusplus >= 201103L # ifdef _GLIBCXX_HAVE_AT_QUICK_EXIT extern "C" int at_quick_exit(void (*)(void)) throw (); # endif # 64 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 # ifdef _GLIBCXX_HAVE_QUICK_EXIT extern "C" void quick_exit(int) throw() _GLIBCXX_NORETURN; # endif # 67 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #endif # 68 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 } // namespace std #else # 71 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 72 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 # 73 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 // Get rid of those macros defined in in lieu of real functions. #undef abort #undef abs #undef atexit #if __cplusplus >= 201103L # ifdef _GLIBCXX_HAVE_AT_QUICK_EXIT # undef at_quick_exit # endif # 82 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #endif # 83 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #undef atof #undef atoi #undef atol #undef bsearch #undef calloc #undef div #undef exit #undef free #undef getenv #undef labs #undef ldiv #undef malloc #undef mblen #undef mbstowcs #undef mbtowc #undef qsort #if __cplusplus >= 201103L # ifdef _GLIBCXX_HAVE_QUICK_EXIT # undef quick_exit # endif # 103 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #endif # 104 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #undef rand #undef realloc #undef srand #undef strtod #undef strtol #undef strtoul #undef system #undef wcstombs #undef wctomb namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION using ::div_t; using ::ldiv_t; using ::abort; using ::abs; using ::atexit; #if __cplusplus >= 201103L # ifdef _GLIBCXX_HAVE_AT_QUICK_EXIT using ::at_quick_exit; # endif # 128 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #endif # 129 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 using ::atof; using ::atoi; using ::atol; using ::bsearch; using ::calloc; using ::div; using ::exit; using ::free; using ::getenv; using ::labs; using ::ldiv; using ::malloc; #ifdef _GLIBCXX_HAVE_MBSTATE_T using ::mblen; using ::mbstowcs; using ::mbtowc; #endif // _GLIBCXX_HAVE_MBSTATE_T # 146 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 using ::qsort; #if __cplusplus >= 201103L # ifdef _GLIBCXX_HAVE_QUICK_EXIT using ::quick_exit; # endif # 151 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #endif # 152 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 using ::rand; using ::realloc; using ::srand; using ::strtod; using ::strtol; using ::strtoul; using ::system; #ifdef _GLIBCXX_USE_WCHAR_T using ::wcstombs; using ::wctomb; #endif // _GLIBCXX_USE_WCHAR_T # 163 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #ifndef __CORRECT_ISO_CPP_STDLIB_H_PROTO inline long abs(long __i) { return __builtin_labs(__i); } inline ldiv_t div(long __i, long __j) { return ldiv(__i, __j); } #endif # 171 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #ifdef _GLIBCXX_USE_LONG_LONG inline long long abs(long long __x) { return __builtin_llabs (__x); } #endif # 176 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #if defined(__GLIBCXX_TYPE_INT_N_0) inline __GLIBCXX_TYPE_INT_N_0 abs(__GLIBCXX_TYPE_INT_N_0 __x) { return __x >= 0 ? __x : -__x; } #endif # 181 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #if defined(__GLIBCXX_TYPE_INT_N_1) inline __GLIBCXX_TYPE_INT_N_1 abs(__GLIBCXX_TYPE_INT_N_1 __x) { return __x >= 0 ? __x : -__x; } #endif # 185 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #if defined(__GLIBCXX_TYPE_INT_N_2) inline __GLIBCXX_TYPE_INT_N_2 abs(__GLIBCXX_TYPE_INT_N_2 __x) { return __x >= 0 ? __x : -__x; } #endif # 189 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #if defined(__GLIBCXX_TYPE_INT_N_3) inline __GLIBCXX_TYPE_INT_N_3 abs(__GLIBCXX_TYPE_INT_N_3 __x) { return __x >= 0 ? __x : -__x; } #endif # 193 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 _GLIBCXX_END_NAMESPACE_VERSION } // namespace #if _GLIBCXX_USE_C99 #undef _Exit #undef llabs #undef lldiv #undef atoll #undef strtoll #undef strtoull #undef strtof #undef strtold namespace __gnu_cxx _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC using ::lldiv_t; #endif # 216 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC extern "C" void (_Exit)(int) throw () _GLIBCXX_NORETURN; #endif # 219 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #if !_GLIBCXX_USE_C99_DYNAMIC using ::_Exit; #endif # 222 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC using ::llabs; inline lldiv_t div(long long __n, long long __d) { lldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; } using ::lldiv; #endif # 232 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #if _GLIBCXX_USE_C99_LONG_LONG_CHECK || _GLIBCXX_USE_C99_LONG_LONG_DYNAMIC extern "C" long long int (atoll)(const char *) throw (); extern "C" long long int (strtoll)(const char * __restrict, char ** __restrict, int) throw (); extern "C" unsigned long long int (strtoull)(const char * __restrict, char ** __restrict, int) throw (); #endif # 240 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC using ::atoll; using ::strtoll; using ::strtoull; #endif # 245 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 using ::strtof; using ::strtold; _GLIBCXX_END_NAMESPACE_VERSION } // namespace __gnu_cxx namespace std { #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC using ::__gnu_cxx::lldiv_t; #endif # 256 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 using ::__gnu_cxx::_Exit; #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC using ::__gnu_cxx::llabs; using ::__gnu_cxx::div; using ::__gnu_cxx::lldiv; #endif # 262 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 using ::__gnu_cxx::atoll; using ::__gnu_cxx::strtof; using ::__gnu_cxx::strtoll; using ::__gnu_cxx::strtoull; using ::__gnu_cxx::strtold; } // namespace std #endif // _GLIBCXX_USE_C99 # 270 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #endif // !_GLIBCXX_HOSTED # 272 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #endif # 274 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/random" 2 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/random" 3 # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/random" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/random" 3 # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/random" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/random" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/limits" 1 3 // The template and inlines for the numeric_limits classes. -*- C++ -*- // Copyright (C) 1999-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file include/limits * This is a Standard C++ Library header. */ // Note: this is not a conforming implementation. // Written by Gabriel Dos Reis // // ISO 14882:1998 // 18.2.1 // #ifndef _GLIBCXX_NUMERIC_LIMITS #define _GLIBCXX_NUMERIC_LIMITS 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/limits" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/limits" 3 # 43 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/limits" 3 // // The numeric_limits<> traits document implementation-defined aspects // of fundamental arithmetic data types (integers and floating points). // From Standard C++ point of view, there are 14 such types: // * integers // bool (1) // char, signed char, unsigned char, wchar_t (4) // short, unsigned short (2) // int, unsigned (2) // long, unsigned long (2) // // * floating points // float (1) // double (1) // long double (1) // // GNU C++ understands (where supported by the host C-library) // * integer // long long, unsigned long long (2) // // which brings us to 16 fundamental arithmetic data types in GNU C++. // // // Since a numeric_limits<> is a bit tricky to get right, we rely on // an interface composed of macros which should be defined in config/os // or config/cpu when they differ from the generic (read arbitrary) // definitions given here. // // These values can be overridden in the target configuration file. // The default values are appropriate for many 32-bit targets. // GCC only intrinsically supports modulo integral types. The only remaining // integral exceptional values is division by zero. Only targets that do not // signal division by zero in some "hard to ignore" way should use false. #ifndef __glibcxx_integral_traps # define __glibcxx_integral_traps true #endif # 82 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/limits" 3 // float // // Default values. Should be overridden in configuration files if necessary. #ifndef __glibcxx_float_has_denorm_loss # define __glibcxx_float_has_denorm_loss false #endif # 91 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/limits" 3 #ifndef __glibcxx_float_traps # define __glibcxx_float_traps false #endif # 94 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/limits" 3 #ifndef __glibcxx_float_tinyness_before # define __glibcxx_float_tinyness_before false #endif # 97 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/limits" 3 // double // Default values. Should be overridden in configuration files if necessary. #ifndef __glibcxx_double_has_denorm_loss # define __glibcxx_double_has_denorm_loss false #endif # 105 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/limits" 3 #ifndef __glibcxx_double_traps # define __glibcxx_double_traps false #endif # 108 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/limits" 3 #ifndef __glibcxx_double_tinyness_before # define __glibcxx_double_tinyness_before false #endif # 111 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/limits" 3 // long double // Default values. Should be overridden in configuration files if necessary. #ifndef __glibcxx_long_double_has_denorm_loss # define __glibcxx_long_double_has_denorm_loss false #endif # 119 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/limits" 3 #ifndef __glibcxx_long_double_traps # define __glibcxx_long_double_traps false #endif # 122 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/limits" 3 #ifndef __glibcxx_long_double_tinyness_before # define __glibcxx_long_double_tinyness_before false #endif # 125 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/limits" 3 // You should not need to define any macros below this point. #define __glibcxx_signed_b(T,B) ((T)(-1) < 0) #define __glibcxx_min_b(T,B) \ (__glibcxx_signed_b (T,B) ? -__glibcxx_max_b (T,B) - 1 : (T)0) #define __glibcxx_max_b(T,B) \ (__glibcxx_signed_b (T,B) ? \ (((((T)1 << (__glibcxx_digits_b (T,B) - 1)) - 1) << 1) + 1) : ~(T)0) #define __glibcxx_digits_b(T,B) \ (B - __glibcxx_signed_b (T,B)) // The fraction 643/2136 approximates log10(2) to 7 significant digits. #define __glibcxx_digits10_b(T,B) \ (__glibcxx_digits_b (T,B) * 643L / 2136) #define __glibcxx_signed(T) \ __glibcxx_signed_b (T, sizeof(T) * __CHAR_BIT__) #define __glibcxx_min(T) \ __glibcxx_min_b (T, sizeof(T) * __CHAR_BIT__) #define __glibcxx_max(T) \ __glibcxx_max_b (T, sizeof(T) * __CHAR_BIT__) #define __glibcxx_digits(T) \ __glibcxx_digits_b (T, sizeof(T) * __CHAR_BIT__) #define __glibcxx_digits10(T) \ __glibcxx_digits10_b (T, sizeof(T) * __CHAR_BIT__) #define __glibcxx_max_digits10(T) \ (2 + (T) * 643L / 2136) namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION /** * @brief Describes the rounding style for floating-point types. * * This is used in the std::numeric_limits class. */ enum float_round_style { round_indeterminate = -1, /// Intermediate. round_toward_zero = 0, /// To zero. round_to_nearest = 1, /// To the nearest representable value. round_toward_infinity = 2, /// To infinity. round_toward_neg_infinity = 3 /// To negative infinity. }; /** * @brief Describes the denormalization for floating-point types. * * These values represent the presence or absence of a variable number * of exponent bits. This type is used in the std::numeric_limits class. */ enum float_denorm_style { /// Indeterminate at compile time whether denormalized values are allowed. denorm_indeterminate = -1, /// The type does not allow denormalized values. denorm_absent = 0, /// The type allows denormalized values. denorm_present = 1 }; /** * @brief Part of std::numeric_limits. * * The @c static @c const members are usable as integral constant * expressions. * * @note This is a separate class for purposes of efficiency; you * should only access these members as part of an instantiation * of the std::numeric_limits class. */ struct __numeric_limits_base { /** This will be true for all fundamental types (which have specializations), and false for everything else. */ static _GLIBCXX_USE_CONSTEXPR bool is_specialized = false; /** The number of @c radix digits that be represented without change: for integer types, the number of non-sign bits in the mantissa; for floating types, the number of @c radix digits in the mantissa. */ static _GLIBCXX_USE_CONSTEXPR int digits = 0; /** The number of base 10 digits that can be represented without change. */ static _GLIBCXX_USE_CONSTEXPR int digits10 = 0; #if __cplusplus >= 201103L /** The number of base 10 digits required to ensure that values which differ are always differentiated. */ static constexpr int max_digits10 = 0; #endif # 221 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/limits" 3 /** True if the type is signed. */ static _GLIBCXX_USE_CONSTEXPR bool is_signed = false; /** True if the type is integer. */ static _GLIBCXX_USE_CONSTEXPR bool is_integer = false; /** True if the type uses an exact representation. All integer types are exact, but not all exact types are integer. For example, rational and fixed-exponent representations are exact but not integer. */ static _GLIBCXX_USE_CONSTEXPR bool is_exact = false; /** For integer types, specifies the base of the representation. For floating types, specifies the base of the exponent representation. */ static _GLIBCXX_USE_CONSTEXPR int radix = 0; /** The minimum negative integer such that @c radix raised to the power of (one less than that integer) is a normalized floating point number. */ static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0; /** The minimum negative integer such that 10 raised to that power is in the range of normalized floating point numbers. */ static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0; /** The maximum positive integer such that @c radix raised to the power of (one less than that integer) is a representable finite floating point number. */ static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0; /** The maximum positive integer such that 10 raised to that power is in the range of representable finite floating point numbers. */ static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0; /** True if the type has a representation for positive infinity. */ static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; /** True if the type has a representation for a quiet (non-signaling) Not a Number. */ static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; /** True if the type has a representation for a signaling Not a Number. */ static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; /** See std::float_denorm_style for more information. */ static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm = denorm_absent; /** True if loss of accuracy is detected as a denormalization loss, rather than as an inexact result. */ static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; /** True if-and-only-if the type adheres to the IEC 559 standard, also known as IEEE 754. (Only makes sense for floating point types.) */ static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false; /** True if the set of values representable by the type is finite. All built-in types are bounded, this member would be false for arbitrary precision types. */ static _GLIBCXX_USE_CONSTEXPR bool is_bounded = false; /** True if the type is @e modulo. A type is modulo if, for any operation involving +, -, or * on values of that type whose result would fall outside the range [min(),max()], the value returned differs from the true value by an integer multiple of max() - min() + 1. On most machines, this is false for floating types, true for unsigned integers, and true for signed integers. See PR22200 about signed integers. */ static _GLIBCXX_USE_CONSTEXPR bool is_modulo = false; /** True if trapping is implemented for this type. */ static _GLIBCXX_USE_CONSTEXPR bool traps = false; /** True if tininess is detected before rounding. (see IEC 559) */ static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false; /** See std::float_round_style for more information. This is only meaningful for floating types; integer types will all be round_toward_zero. */ static _GLIBCXX_USE_CONSTEXPR float_round_style round_style = round_toward_zero; }; /** * @brief Properties of fundamental types. * * This class allows a program to obtain information about the * representation of a fundamental type on a given platform. For * non-fundamental types, the functions will return 0 and the data * members will all be @c false. * * _GLIBCXX_RESOLVE_LIB_DEFECTS: DRs 201 and 184 (hi Gaby!) are * noted, but not incorporated in this documented (yet). */ template struct numeric_limits : public __numeric_limits_base { /** The minimum finite value, or for floating types with denormalization, the minimum positive normalized value. */ static _GLIBCXX_CONSTEXPR _Tp min() _GLIBCXX_USE_NOEXCEPT { return _Tp(); } /** The maximum finite value. */ static _GLIBCXX_CONSTEXPR _Tp max() _GLIBCXX_USE_NOEXCEPT { return _Tp(); } #if __cplusplus >= 201103L /** A finite value x such that there is no other finite value y * where y < x. */ static constexpr _Tp lowest() noexcept { return _Tp(); } #endif # 332 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/limits" 3 /** The @e machine @e epsilon: the difference between 1 and the least value greater than 1 that is representable. */ static _GLIBCXX_CONSTEXPR _Tp epsilon() _GLIBCXX_USE_NOEXCEPT { return _Tp(); } /** The maximum rounding error measurement (see LIA-1). */ static _GLIBCXX_CONSTEXPR _Tp round_error() _GLIBCXX_USE_NOEXCEPT { return _Tp(); } /** The representation of positive infinity, if @c has_infinity. */ static _GLIBCXX_CONSTEXPR _Tp infinity() _GLIBCXX_USE_NOEXCEPT { return _Tp(); } /** The representation of a quiet Not a Number, if @c has_quiet_NaN. */ static _GLIBCXX_CONSTEXPR _Tp quiet_NaN() _GLIBCXX_USE_NOEXCEPT { return _Tp(); } /** The representation of a signaling Not a Number, if @c has_signaling_NaN. */ static _GLIBCXX_CONSTEXPR _Tp signaling_NaN() _GLIBCXX_USE_NOEXCEPT { return _Tp(); } /** The minimum positive denormalized value. For types where @c has_denorm is false, this is the minimum positive normalized value. */ static _GLIBCXX_CONSTEXPR _Tp denorm_min() _GLIBCXX_USE_NOEXCEPT { return _Tp(); } }; #if __cplusplus >= 201103L template struct numeric_limits : public numeric_limits<_Tp> { }; template struct numeric_limits : public numeric_limits<_Tp> { }; template struct numeric_limits : public numeric_limits<_Tp> { }; #endif # 376 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/limits" 3 // Now there follow 16 explicit specializations. Yes, 16. Make sure // you get the count right. (18 in c++0x mode) /// numeric_limits specialization. template<> struct numeric_limits { static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; static _GLIBCXX_CONSTEXPR bool min() _GLIBCXX_USE_NOEXCEPT { return false; } static _GLIBCXX_CONSTEXPR bool max() _GLIBCXX_USE_NOEXCEPT { return true; } #if __cplusplus >= 201103L static constexpr bool lowest() noexcept { return min(); } #endif # 396 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/limits" 3 static _GLIBCXX_USE_CONSTEXPR int digits = 1; static _GLIBCXX_USE_CONSTEXPR int digits10 = 0; #if __cplusplus >= 201103L static constexpr int max_digits10 = 0; #endif # 401 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/limits" 3 static _GLIBCXX_USE_CONSTEXPR bool is_signed = false; static _GLIBCXX_USE_CONSTEXPR bool is_integer = true; static _GLIBCXX_USE_CONSTEXPR bool is_exact = true; static _GLIBCXX_USE_CONSTEXPR int radix = 2; static _GLIBCXX_CONSTEXPR bool epsilon() _GLIBCXX_USE_NOEXCEPT { return false; } static _GLIBCXX_CONSTEXPR bool round_error() _GLIBCXX_USE_NOEXCEPT { return false; } static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0; static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0; static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0; static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0; static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm = denorm_absent; static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; static _GLIBCXX_CONSTEXPR bool infinity() _GLIBCXX_USE_NOEXCEPT { return false; } static _GLIBCXX_CONSTEXPR bool quiet_NaN() _GLIBCXX_USE_NOEXCEPT { return false; } static _GLIBCXX_CONSTEXPR bool signaling_NaN() _GLIBCXX_USE_NOEXCEPT { return false; } static _GLIBCXX_CONSTEXPR bool denorm_min() _GLIBCXX_USE_NOEXCEPT { return false; } static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false; static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; static _GLIBCXX_USE_CONSTEXPR bool is_modulo = false; // It is not clear what it means for a boolean type to trap. // This is a DR on the LWG issue list. Here, I use integer // promotion semantics. static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps; static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false; static _GLIBCXX_USE_CONSTEXPR float_round_style round_style = round_toward_zero; }; /// numeric_limits specialization. template<> struct numeric_limits { static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; static _GLIBCXX_CONSTEXPR char min() _GLIBCXX_USE_NOEXCEPT { return __glibcxx_min(char); } static _GLIBCXX_CONSTEXPR char max() _GLIBCXX_USE_NOEXCEPT { return __glibcxx_max(char); } #if __cplusplus >= 201103L static constexpr char lowest() noexcept { return min(); } #endif # 465 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/limits" 3 static _GLIBCXX_USE_CONSTEXPR int digits = __glibcxx_digits (char); static _GLIBCXX_USE_CONSTEXPR int digits10 = __glibcxx_digits10 (char); #if __cplusplus >= 201103L static constexpr int max_digits10 = 0; #endif # 471 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/limits" 3 static _GLIBCXX_USE_CONSTEXPR bool is_signed = __glibcxx_signed (char); static _GLIBCXX_USE_CONSTEXPR bool is_integer = true; static _GLIBCXX_USE_CONSTEXPR bool is_exact = true; static _GLIBCXX_USE_CONSTEXPR int radix = 2; static _GLIBCXX_CONSTEXPR char epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; } static _GLIBCXX_CONSTEXPR char round_error() _GLIBCXX_USE_NOEXCEPT { return 0; } static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0; static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0; static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0; static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0; static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm = denorm_absent; static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; static _GLIBCXX_CONSTEXPR char infinity() _GLIBCXX_USE_NOEXCEPT { return char(); } static _GLIBCXX_CONSTEXPR char quiet_NaN() _GLIBCXX_USE_NOEXCEPT { return char(); } static _GLIBCXX_CONSTEXPR char signaling_NaN() _GLIBCXX_USE_NOEXCEPT { return char(); } static _GLIBCXX_CONSTEXPR char denorm_min() _GLIBCXX_USE_NOEXCEPT { return static_cast(0); } static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false; static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; static _GLIBCXX_USE_CONSTEXPR bool is_modulo = !is_signed; static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps; static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false; static _GLIBCXX_USE_CONSTEXPR float_round_style round_style = round_toward_zero; }; /// numeric_limits specialization. template<> struct numeric_limits { static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; static _GLIBCXX_CONSTEXPR signed char min() _GLIBCXX_USE_NOEXCEPT { return -__SCHAR_MAX__ - 1; } static _GLIBCXX_CONSTEXPR signed char max() _GLIBCXX_USE_NOEXCEPT { return __SCHAR_MAX__; } #if __cplusplus >= 201103L static constexpr signed char lowest() noexcept { return min(); } #endif # 532 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/limits" 3 static _GLIBCXX_USE_CONSTEXPR int digits = __glibcxx_digits (signed char); static _GLIBCXX_USE_CONSTEXPR int digits10 = __glibcxx_digits10 (signed char); #if __cplusplus >= 201103L static constexpr int max_digits10 = 0; #endif # 539 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/limits" 3 static _GLIBCXX_USE_CONSTEXPR bool is_signed = true; static _GLIBCXX_USE_CONSTEXPR bool is_integer = true; static _GLIBCXX_USE_CONSTEXPR bool is_exact = true; static _GLIBCXX_USE_CONSTEXPR int radix = 2; static _GLIBCXX_CONSTEXPR signed char epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; } static _GLIBCXX_CONSTEXPR signed char round_error() _GLIBCXX_USE_NOEXCEPT { return 0; } static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0; static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0; static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0; static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0; static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm = denorm_absent; static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; static _GLIBCXX_CONSTEXPR signed char infinity() _GLIBCXX_USE_NOEXCEPT { return static_cast(0); } static _GLIBCXX_CONSTEXPR signed char quiet_NaN() _GLIBCXX_USE_NOEXCEPT { return static_cast(0); } static _GLIBCXX_CONSTEXPR signed char signaling_NaN() _GLIBCXX_USE_NOEXCEPT { return static_cast(0); } static _GLIBCXX_CONSTEXPR signed char denorm_min() _GLIBCXX_USE_NOEXCEPT { return static_cast(0); } static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false; static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; static _GLIBCXX_USE_CONSTEXPR bool is_modulo = false; static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps; static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false; static _GLIBCXX_USE_CONSTEXPR float_round_style round_style = round_toward_zero; }; /// numeric_limits specialization. template<> struct numeric_limits { static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; static _GLIBCXX_CONSTEXPR unsigned char min() _GLIBCXX_USE_NOEXCEPT { return 0; } static _GLIBCXX_CONSTEXPR unsigned char max() _GLIBCXX_USE_NOEXCEPT { return __SCHAR_MAX__ * 2U + 1; } #if __cplusplus >= 201103L static constexpr unsigned char lowest() noexcept { return min(); } #endif # 602 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/limits" 3 static _GLIBCXX_USE_CONSTEXPR int digits = __glibcxx_digits (unsigned char); static _GLIBCXX_USE_CONSTEXPR int digits10 = __glibcxx_digits10 (unsigned char); #if __cplusplus >= 201103L static constexpr int max_digits10 = 0; #endif # 610 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/limits" 3 static _GLIBCXX_USE_CONSTEXPR bool is_signed = false; static _GLIBCXX_USE_CONSTEXPR bool is_integer = true; static _GLIBCXX_USE_CONSTEXPR bool is_exact = true; static _GLIBCXX_USE_CONSTEXPR int radix = 2; static _GLIBCXX_CONSTEXPR unsigned char epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; } static _GLIBCXX_CONSTEXPR unsigned char round_error() _GLIBCXX_USE_NOEXCEPT { return 0; } static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0; static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0; static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0; static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0; static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm = denorm_absent; static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; static _GLIBCXX_CONSTEXPR unsigned char infinity() _GLIBCXX_USE_NOEXCEPT { return static_cast(0); } static _GLIBCXX_CONSTEXPR unsigned char quiet_NaN() _GLIBCXX_USE_NOEXCEPT { return static_cast(0); } static _GLIBCXX_CONSTEXPR unsigned char signaling_NaN() _GLIBCXX_USE_NOEXCEPT { return static_cast(0); } static _GLIBCXX_CONSTEXPR unsigned char denorm_min() _GLIBCXX_USE_NOEXCEPT { return static_cast(0); } static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false; static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; static _GLIBCXX_USE_CONSTEXPR bool is_modulo = true; static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps; static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false; static _GLIBCXX_USE_CONSTEXPR float_round_style round_style = round_toward_zero; }; /// numeric_limits specialization. template<> struct numeric_limits { static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; static _GLIBCXX_CONSTEXPR wchar_t min() _GLIBCXX_USE_NOEXCEPT { return __glibcxx_min (wchar_t); } static _GLIBCXX_CONSTEXPR wchar_t max() _GLIBCXX_USE_NOEXCEPT { return __glibcxx_max (wchar_t); } #if __cplusplus >= 201103L static constexpr wchar_t lowest() noexcept { return min(); } #endif # 675 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/limits" 3 static _GLIBCXX_USE_CONSTEXPR int digits = __glibcxx_digits (wchar_t); static _GLIBCXX_USE_CONSTEXPR int digits10 = __glibcxx_digits10 (wchar_t); #if __cplusplus >= 201103L static constexpr int max_digits10 = 0; #endif # 682 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/limits" 3 static _GLIBCXX_USE_CONSTEXPR bool is_signed = __glibcxx_signed (wchar_t); static _GLIBCXX_USE_CONSTEXPR bool is_integer = true; static _GLIBCXX_USE_CONSTEXPR bool is_exact = true; static _GLIBCXX_USE_CONSTEXPR int radix = 2; static _GLIBCXX_CONSTEXPR wchar_t epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; } static _GLIBCXX_CONSTEXPR wchar_t round_error() _GLIBCXX_USE_NOEXCEPT { return 0; } static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0; static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0; static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0; static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0; static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm = denorm_absent; static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; static _GLIBCXX_CONSTEXPR wchar_t infinity() _GLIBCXX_USE_NOEXCEPT { return wchar_t(); } static _GLIBCXX_CONSTEXPR wchar_t quiet_NaN() _GLIBCXX_USE_NOEXCEPT { return wchar_t(); } static _GLIBCXX_CONSTEXPR wchar_t signaling_NaN() _GLIBCXX_USE_NOEXCEPT { return wchar_t(); } static _GLIBCXX_CONSTEXPR wchar_t denorm_min() _GLIBCXX_USE_NOEXCEPT { return wchar_t(); } static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false; static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; static _GLIBCXX_USE_CONSTEXPR bool is_modulo = !is_signed; static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps; static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false; static _GLIBCXX_USE_CONSTEXPR float_round_style round_style = round_toward_zero; }; #if __cplusplus >= 201103L /// numeric_limits specialization. template<> struct numeric_limits { static constexpr bool is_specialized = true; static constexpr char16_t min() noexcept { return __glibcxx_min (char16_t); } static constexpr char16_t max() noexcept { return __glibcxx_max (char16_t); } static constexpr char16_t lowest() noexcept { return min(); } static constexpr int digits = __glibcxx_digits (char16_t); static constexpr int digits10 = __glibcxx_digits10 (char16_t); static constexpr int max_digits10 = 0; static constexpr bool is_signed = __glibcxx_signed (char16_t); static constexpr bool is_integer = true; static constexpr bool is_exact = true; static constexpr int radix = 2; static constexpr char16_t epsilon() noexcept { return 0; } static constexpr char16_t round_error() noexcept { return 0; } static constexpr int min_exponent = 0; static constexpr int min_exponent10 = 0; static constexpr int max_exponent = 0; static constexpr int max_exponent10 = 0; static constexpr bool has_infinity = false; static constexpr bool has_quiet_NaN = false; static constexpr bool has_signaling_NaN = false; static constexpr float_denorm_style has_denorm = denorm_absent; static constexpr bool has_denorm_loss = false; static constexpr char16_t infinity() noexcept { return char16_t(); } static constexpr char16_t quiet_NaN() noexcept { return char16_t(); } static constexpr char16_t signaling_NaN() noexcept { return char16_t(); } static constexpr char16_t denorm_min() noexcept { return char16_t(); } static constexpr bool is_iec559 = false; static constexpr bool is_bounded = true; static constexpr bool is_modulo = !is_signed; static constexpr bool traps = __glibcxx_integral_traps; static constexpr bool tinyness_before = false; static constexpr float_round_style round_style = round_toward_zero; }; /// numeric_limits specialization. template<> struct numeric_limits { static constexpr bool is_specialized = true; static constexpr char32_t min() noexcept { return __glibcxx_min (char32_t); } static constexpr char32_t max() noexcept { return __glibcxx_max (char32_t); } static constexpr char32_t lowest() noexcept { return min(); } static constexpr int digits = __glibcxx_digits (char32_t); static constexpr int digits10 = __glibcxx_digits10 (char32_t); static constexpr int max_digits10 = 0; static constexpr bool is_signed = __glibcxx_signed (char32_t); static constexpr bool is_integer = true; static constexpr bool is_exact = true; static constexpr int radix = 2; static constexpr char32_t epsilon() noexcept { return 0; } static constexpr char32_t round_error() noexcept { return 0; } static constexpr int min_exponent = 0; static constexpr int min_exponent10 = 0; static constexpr int max_exponent = 0; static constexpr int max_exponent10 = 0; static constexpr bool has_infinity = false; static constexpr bool has_quiet_NaN = false; static constexpr bool has_signaling_NaN = false; static constexpr float_denorm_style has_denorm = denorm_absent; static constexpr bool has_denorm_loss = false; static constexpr char32_t infinity() noexcept { return char32_t(); } static constexpr char32_t quiet_NaN() noexcept { return char32_t(); } static constexpr char32_t signaling_NaN() noexcept { return char32_t(); } static constexpr char32_t denorm_min() noexcept { return char32_t(); } static constexpr bool is_iec559 = false; static constexpr bool is_bounded = true; static constexpr bool is_modulo = !is_signed; static constexpr bool traps = __glibcxx_integral_traps; static constexpr bool tinyness_before = false; static constexpr float_round_style round_style = round_toward_zero; }; #endif # 850 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/limits" 3 /// numeric_limits specialization. template<> struct numeric_limits { static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; static _GLIBCXX_CONSTEXPR short min() _GLIBCXX_USE_NOEXCEPT { return -__SHRT_MAX__ - 1; } static _GLIBCXX_CONSTEXPR short max() _GLIBCXX_USE_NOEXCEPT { return __SHRT_MAX__; } #if __cplusplus >= 201103L static constexpr short lowest() noexcept { return min(); } #endif # 867 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/limits" 3 static _GLIBCXX_USE_CONSTEXPR int digits = __glibcxx_digits (short); static _GLIBCXX_USE_CONSTEXPR int digits10 = __glibcxx_digits10 (short); #if __cplusplus >= 201103L static constexpr int max_digits10 = 0; #endif # 873 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/limits" 3 static _GLIBCXX_USE_CONSTEXPR bool is_signed = true; static _GLIBCXX_USE_CONSTEXPR bool is_integer = true; static _GLIBCXX_USE_CONSTEXPR bool is_exact = true; static _GLIBCXX_USE_CONSTEXPR int radix = 2; static _GLIBCXX_CONSTEXPR short epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; } static _GLIBCXX_CONSTEXPR short round_error() _GLIBCXX_USE_NOEXCEPT { return 0; } static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0; static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0; static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0; static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0; static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm = denorm_absent; static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; static _GLIBCXX_CONSTEXPR short infinity() _GLIBCXX_USE_NOEXCEPT { return short(); } static _GLIBCXX_CONSTEXPR short quiet_NaN() _GLIBCXX_USE_NOEXCEPT { return short(); } static _GLIBCXX_CONSTEXPR short signaling_NaN() _GLIBCXX_USE_NOEXCEPT { return short(); } static _GLIBCXX_CONSTEXPR short denorm_min() _GLIBCXX_USE_NOEXCEPT { return short(); } static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false; static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; static _GLIBCXX_USE_CONSTEXPR bool is_modulo = false; static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps; static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false; static _GLIBCXX_USE_CONSTEXPR float_round_style round_style = round_toward_zero; }; /// numeric_limits specialization. template<> struct numeric_limits { static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; static _GLIBCXX_CONSTEXPR unsigned short min() _GLIBCXX_USE_NOEXCEPT { return 0; } static _GLIBCXX_CONSTEXPR unsigned short max() _GLIBCXX_USE_NOEXCEPT { return __SHRT_MAX__ * 2U + 1; } #if __cplusplus >= 201103L static constexpr unsigned short lowest() noexcept { return min(); } #endif # 934 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/limits" 3 static _GLIBCXX_USE_CONSTEXPR int digits = __glibcxx_digits (unsigned short); static _GLIBCXX_USE_CONSTEXPR int digits10 = __glibcxx_digits10 (unsigned short); #if __cplusplus >= 201103L static constexpr int max_digits10 = 0; #endif # 942 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/limits" 3 static _GLIBCXX_USE_CONSTEXPR bool is_signed = false; static _GLIBCXX_USE_CONSTEXPR bool is_integer = true; static _GLIBCXX_USE_CONSTEXPR bool is_exact = true; static _GLIBCXX_USE_CONSTEXPR int radix = 2; static _GLIBCXX_CONSTEXPR unsigned short epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; } static _GLIBCXX_CONSTEXPR unsigned short round_error() _GLIBCXX_USE_NOEXCEPT { return 0; } static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0; static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0; static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0; static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0; static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm = denorm_absent; static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; static _GLIBCXX_CONSTEXPR unsigned short infinity() _GLIBCXX_USE_NOEXCEPT { return static_cast(0); } static _GLIBCXX_CONSTEXPR unsigned short quiet_NaN() _GLIBCXX_USE_NOEXCEPT { return static_cast(0); } static _GLIBCXX_CONSTEXPR unsigned short signaling_NaN() _GLIBCXX_USE_NOEXCEPT { return static_cast(0); } static _GLIBCXX_CONSTEXPR unsigned short denorm_min() _GLIBCXX_USE_NOEXCEPT { return static_cast(0); } static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false; static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; static _GLIBCXX_USE_CONSTEXPR bool is_modulo = true; static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps; static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false; static _GLIBCXX_USE_CONSTEXPR float_round_style round_style = round_toward_zero; }; /// numeric_limits specialization. template<> struct numeric_limits { static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; static _GLIBCXX_CONSTEXPR int min() _GLIBCXX_USE_NOEXCEPT { return -__INT_MAX__ - 1; } static _GLIBCXX_CONSTEXPR int max() _GLIBCXX_USE_NOEXCEPT { return __INT_MAX__; } #if __cplusplus >= 201103L static constexpr int lowest() noexcept { return min(); } #endif # 1007 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/limits" 3 static _GLIBCXX_USE_CONSTEXPR int digits = __glibcxx_digits (int); static _GLIBCXX_USE_CONSTEXPR int digits10 = __glibcxx_digits10 (int); #if __cplusplus >= 201103L static constexpr int max_digits10 = 0; #endif # 1013 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/limits" 3 static _GLIBCXX_USE_CONSTEXPR bool is_signed = true; static _GLIBCXX_USE_CONSTEXPR bool is_integer = true; static _GLIBCXX_USE_CONSTEXPR bool is_exact = true; static _GLIBCXX_USE_CONSTEXPR int radix = 2; static _GLIBCXX_CONSTEXPR int epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; } static _GLIBCXX_CONSTEXPR int round_error() _GLIBCXX_USE_NOEXCEPT { return 0; } static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0; static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0; static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0; static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0; static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm = denorm_absent; static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; static _GLIBCXX_CONSTEXPR int infinity() _GLIBCXX_USE_NOEXCEPT { return static_cast(0); } static _GLIBCXX_CONSTEXPR int quiet_NaN() _GLIBCXX_USE_NOEXCEPT { return static_cast(0); } static _GLIBCXX_CONSTEXPR int signaling_NaN() _GLIBCXX_USE_NOEXCEPT { return static_cast(0); } static _GLIBCXX_CONSTEXPR int denorm_min() _GLIBCXX_USE_NOEXCEPT { return static_cast(0); } static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false; static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; static _GLIBCXX_USE_CONSTEXPR bool is_modulo = false; static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps; static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false; static _GLIBCXX_USE_CONSTEXPR float_round_style round_style = round_toward_zero; }; /// numeric_limits specialization. template<> struct numeric_limits { static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; static _GLIBCXX_CONSTEXPR unsigned int min() _GLIBCXX_USE_NOEXCEPT { return 0; } static _GLIBCXX_CONSTEXPR unsigned int max() _GLIBCXX_USE_NOEXCEPT { return __INT_MAX__ * 2U + 1; } #if __cplusplus >= 201103L static constexpr unsigned int lowest() noexcept { return min(); } #endif # 1074 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/limits" 3 static _GLIBCXX_USE_CONSTEXPR int digits = __glibcxx_digits (unsigned int); static _GLIBCXX_USE_CONSTEXPR int digits10 = __glibcxx_digits10 (unsigned int); #if __cplusplus >= 201103L static constexpr int max_digits10 = 0; #endif # 1082 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/limits" 3 static _GLIBCXX_USE_CONSTEXPR bool is_signed = false; static _GLIBCXX_USE_CONSTEXPR bool is_integer = true; static _GLIBCXX_USE_CONSTEXPR bool is_exact = true; static _GLIBCXX_USE_CONSTEXPR int radix = 2; static _GLIBCXX_CONSTEXPR unsigned int epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; } static _GLIBCXX_CONSTEXPR unsigned int round_error() _GLIBCXX_USE_NOEXCEPT { return 0; } static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0; static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0; static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0; static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0; static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm = denorm_absent; static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; static _GLIBCXX_CONSTEXPR unsigned int infinity() _GLIBCXX_USE_NOEXCEPT { return static_cast(0); } static _GLIBCXX_CONSTEXPR unsigned int quiet_NaN() _GLIBCXX_USE_NOEXCEPT { return static_cast(0); } static _GLIBCXX_CONSTEXPR unsigned int signaling_NaN() _GLIBCXX_USE_NOEXCEPT { return static_cast(0); } static _GLIBCXX_CONSTEXPR unsigned int denorm_min() _GLIBCXX_USE_NOEXCEPT { return static_cast(0); } static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false; static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; static _GLIBCXX_USE_CONSTEXPR bool is_modulo = true; static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps; static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false; static _GLIBCXX_USE_CONSTEXPR float_round_style round_style = round_toward_zero; }; /// numeric_limits specialization. template<> struct numeric_limits { static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; static _GLIBCXX_CONSTEXPR long min() _GLIBCXX_USE_NOEXCEPT { return -__LONG_MAX__ - 1; } static _GLIBCXX_CONSTEXPR long max() _GLIBCXX_USE_NOEXCEPT { return __LONG_MAX__; } #if __cplusplus >= 201103L static constexpr long lowest() noexcept { return min(); } #endif # 1146 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/limits" 3 static _GLIBCXX_USE_CONSTEXPR int digits = __glibcxx_digits (long); static _GLIBCXX_USE_CONSTEXPR int digits10 = __glibcxx_digits10 (long); #if __cplusplus >= 201103L static constexpr int max_digits10 = 0; #endif # 1152 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/limits" 3 static _GLIBCXX_USE_CONSTEXPR bool is_signed = true; static _GLIBCXX_USE_CONSTEXPR bool is_integer = true; static _GLIBCXX_USE_CONSTEXPR bool is_exact = true; static _GLIBCXX_USE_CONSTEXPR int radix = 2; static _GLIBCXX_CONSTEXPR long epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; } static _GLIBCXX_CONSTEXPR long round_error() _GLIBCXX_USE_NOEXCEPT { return 0; } static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0; static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0; static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0; static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0; static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm = denorm_absent; static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; static _GLIBCXX_CONSTEXPR long infinity() _GLIBCXX_USE_NOEXCEPT { return static_cast(0); } static _GLIBCXX_CONSTEXPR long quiet_NaN() _GLIBCXX_USE_NOEXCEPT { return static_cast(0); } static _GLIBCXX_CONSTEXPR long signaling_NaN() _GLIBCXX_USE_NOEXCEPT { return static_cast(0); } static _GLIBCXX_CONSTEXPR long denorm_min() _GLIBCXX_USE_NOEXCEPT { return static_cast(0); } static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false; static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; static _GLIBCXX_USE_CONSTEXPR bool is_modulo = false; static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps; static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false; static _GLIBCXX_USE_CONSTEXPR float_round_style round_style = round_toward_zero; }; /// numeric_limits specialization. template<> struct numeric_limits { static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; static _GLIBCXX_CONSTEXPR unsigned long min() _GLIBCXX_USE_NOEXCEPT { return 0; } static _GLIBCXX_CONSTEXPR unsigned long max() _GLIBCXX_USE_NOEXCEPT { return __LONG_MAX__ * 2UL + 1; } #if __cplusplus >= 201103L static constexpr unsigned long lowest() noexcept { return min(); } #endif # 1213 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/limits" 3 static _GLIBCXX_USE_CONSTEXPR int digits = __glibcxx_digits (unsigned long); static _GLIBCXX_USE_CONSTEXPR int digits10 = __glibcxx_digits10 (unsigned long); #if __cplusplus >= 201103L static constexpr int max_digits10 = 0; #endif # 1221 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/limits" 3 static _GLIBCXX_USE_CONSTEXPR bool is_signed = false; static _GLIBCXX_USE_CONSTEXPR bool is_integer = true; static _GLIBCXX_USE_CONSTEXPR bool is_exact = true; static _GLIBCXX_USE_CONSTEXPR int radix = 2; static _GLIBCXX_CONSTEXPR unsigned long epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; } static _GLIBCXX_CONSTEXPR unsigned long round_error() _GLIBCXX_USE_NOEXCEPT { return 0; } static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0; static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0; static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0; static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0; static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm = denorm_absent; static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; static _GLIBCXX_CONSTEXPR unsigned long infinity() _GLIBCXX_USE_NOEXCEPT { return static_cast(0); } static _GLIBCXX_CONSTEXPR unsigned long quiet_NaN() _GLIBCXX_USE_NOEXCEPT { return static_cast(0); } static _GLIBCXX_CONSTEXPR unsigned long signaling_NaN() _GLIBCXX_USE_NOEXCEPT { return static_cast(0); } static _GLIBCXX_CONSTEXPR unsigned long denorm_min() _GLIBCXX_USE_NOEXCEPT { return static_cast(0); } static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false; static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; static _GLIBCXX_USE_CONSTEXPR bool is_modulo = true; static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps; static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false; static _GLIBCXX_USE_CONSTEXPR float_round_style round_style = round_toward_zero; }; /// numeric_limits specialization. template<> struct numeric_limits { static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; static _GLIBCXX_CONSTEXPR long long min() _GLIBCXX_USE_NOEXCEPT { return -__LONG_LONG_MAX__ - 1; } static _GLIBCXX_CONSTEXPR long long max() _GLIBCXX_USE_NOEXCEPT { return __LONG_LONG_MAX__; } #if __cplusplus >= 201103L static constexpr long long lowest() noexcept { return min(); } #endif # 1286 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/limits" 3 static _GLIBCXX_USE_CONSTEXPR int digits = __glibcxx_digits (long long); static _GLIBCXX_USE_CONSTEXPR int digits10 = __glibcxx_digits10 (long long); #if __cplusplus >= 201103L static constexpr int max_digits10 = 0; #endif # 1294 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/limits" 3 static _GLIBCXX_USE_CONSTEXPR bool is_signed = true; static _GLIBCXX_USE_CONSTEXPR bool is_integer = true; static _GLIBCXX_USE_CONSTEXPR bool is_exact = true; static _GLIBCXX_USE_CONSTEXPR int radix = 2; static _GLIBCXX_CONSTEXPR long long epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; } static _GLIBCXX_CONSTEXPR long long round_error() _GLIBCXX_USE_NOEXCEPT { return 0; } static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0; static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0; static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0; static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0; static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm = denorm_absent; static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; static _GLIBCXX_CONSTEXPR long long infinity() _GLIBCXX_USE_NOEXCEPT { return static_cast(0); } static _GLIBCXX_CONSTEXPR long long quiet_NaN() _GLIBCXX_USE_NOEXCEPT { return static_cast(0); } static _GLIBCXX_CONSTEXPR long long signaling_NaN() _GLIBCXX_USE_NOEXCEPT { return static_cast(0); } static _GLIBCXX_CONSTEXPR long long denorm_min() _GLIBCXX_USE_NOEXCEPT { return static_cast(0); } static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false; static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; static _GLIBCXX_USE_CONSTEXPR bool is_modulo = false; static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps; static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false; static _GLIBCXX_USE_CONSTEXPR float_round_style round_style = round_toward_zero; }; /// numeric_limits specialization. template<> struct numeric_limits { static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; static _GLIBCXX_CONSTEXPR unsigned long long min() _GLIBCXX_USE_NOEXCEPT { return 0; } static _GLIBCXX_CONSTEXPR unsigned long long max() _GLIBCXX_USE_NOEXCEPT { return __LONG_LONG_MAX__ * 2ULL + 1; } #if __cplusplus >= 201103L static constexpr unsigned long long lowest() noexcept { return min(); } #endif # 1356 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/limits" 3 static _GLIBCXX_USE_CONSTEXPR int digits = __glibcxx_digits (unsigned long long); static _GLIBCXX_USE_CONSTEXPR int digits10 = __glibcxx_digits10 (unsigned long long); #if __cplusplus >= 201103L static constexpr int max_digits10 = 0; #endif # 1364 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/limits" 3 static _GLIBCXX_USE_CONSTEXPR bool is_signed = false; static _GLIBCXX_USE_CONSTEXPR bool is_integer = true; static _GLIBCXX_USE_CONSTEXPR bool is_exact = true; static _GLIBCXX_USE_CONSTEXPR int radix = 2; static _GLIBCXX_CONSTEXPR unsigned long long epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; } static _GLIBCXX_CONSTEXPR unsigned long long round_error() _GLIBCXX_USE_NOEXCEPT { return 0; } static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0; static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0; static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0; static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0; static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm = denorm_absent; static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; static _GLIBCXX_CONSTEXPR unsigned long long infinity() _GLIBCXX_USE_NOEXCEPT { return static_cast(0); } static _GLIBCXX_CONSTEXPR unsigned long long quiet_NaN() _GLIBCXX_USE_NOEXCEPT { return static_cast(0); } static _GLIBCXX_CONSTEXPR unsigned long long signaling_NaN() _GLIBCXX_USE_NOEXCEPT { return static_cast(0); } static _GLIBCXX_CONSTEXPR unsigned long long denorm_min() _GLIBCXX_USE_NOEXCEPT { return static_cast(0); } static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false; static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; static _GLIBCXX_USE_CONSTEXPR bool is_modulo = true; static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps; static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false; static _GLIBCXX_USE_CONSTEXPR float_round_style round_style = round_toward_zero; }; #if !defined(__STRICT_ANSI__) #define __INT_N(TYPE, BITSIZE, EXT, UEXT) \ template<> \ struct numeric_limits \ { \ static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; \ \ static _GLIBCXX_CONSTEXPR TYPE \ min() _GLIBCXX_USE_NOEXCEPT { return __glibcxx_min_b (TYPE, BITSIZE); } \ \ static _GLIBCXX_CONSTEXPR TYPE \ max() _GLIBCXX_USE_NOEXCEPT { return __glibcxx_max_b (TYPE, BITSIZE); } \ \ static _GLIBCXX_USE_CONSTEXPR int digits \ = BITSIZE - 1; \ static _GLIBCXX_USE_CONSTEXPR int digits10 \ = (BITSIZE - 1) * 643L / 2136; \ \ static _GLIBCXX_USE_CONSTEXPR bool is_signed = true; \ static _GLIBCXX_USE_CONSTEXPR bool is_integer = true; \ static _GLIBCXX_USE_CONSTEXPR bool is_exact = true; \ static _GLIBCXX_USE_CONSTEXPR int radix = 2; \ \ static _GLIBCXX_CONSTEXPR TYPE \ epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; } \ \ static _GLIBCXX_CONSTEXPR TYPE \ round_error() _GLIBCXX_USE_NOEXCEPT { return 0; } \ \ EXT \ \ static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0; \ static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0; \ static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0; \ static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0; \ \ static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; \ static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; \ static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; \ static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm \ = denorm_absent; \ static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; \ \ static _GLIBCXX_CONSTEXPR TYPE \ infinity() _GLIBCXX_USE_NOEXCEPT \ { return static_cast(0); } \ \ static _GLIBCXX_CONSTEXPR TYPE \ quiet_NaN() _GLIBCXX_USE_NOEXCEPT \ { return static_cast(0); } \ \ static _GLIBCXX_CONSTEXPR TYPE \ signaling_NaN() _GLIBCXX_USE_NOEXCEPT \ { return static_cast(0); } \ \ static _GLIBCXX_CONSTEXPR TYPE \ denorm_min() _GLIBCXX_USE_NOEXCEPT \ { return static_cast(0); } \ \ static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false; \ static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; \ static _GLIBCXX_USE_CONSTEXPR bool is_modulo = false; \ \ static _GLIBCXX_USE_CONSTEXPR bool traps \ = __glibcxx_integral_traps; \ static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false; \ static _GLIBCXX_USE_CONSTEXPR float_round_style round_style \ = round_toward_zero; \ }; \ \ template<> \ struct numeric_limits \ { \ static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; \ \ static _GLIBCXX_CONSTEXPR unsigned TYPE \ min() _GLIBCXX_USE_NOEXCEPT { return 0; } \ \ static _GLIBCXX_CONSTEXPR unsigned TYPE \ max() _GLIBCXX_USE_NOEXCEPT \ { return __glibcxx_max_b (unsigned TYPE, BITSIZE); } \ \ UEXT \ \ static _GLIBCXX_USE_CONSTEXPR int digits \ = BITSIZE; \ static _GLIBCXX_USE_CONSTEXPR int digits10 \ = BITSIZE * 643L / 2136; \ static _GLIBCXX_USE_CONSTEXPR bool is_signed = false; \ static _GLIBCXX_USE_CONSTEXPR bool is_integer = true; \ static _GLIBCXX_USE_CONSTEXPR bool is_exact = true; \ static _GLIBCXX_USE_CONSTEXPR int radix = 2; \ \ static _GLIBCXX_CONSTEXPR unsigned TYPE \ epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; } \ \ static _GLIBCXX_CONSTEXPR unsigned TYPE \ round_error() _GLIBCXX_USE_NOEXCEPT { return 0; } \ \ static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0; \ static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0; \ static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0; \ static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0; \ \ static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; \ static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; \ static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; \ static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm \ = denorm_absent; \ static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; \ \ static _GLIBCXX_CONSTEXPR unsigned TYPE \ infinity() _GLIBCXX_USE_NOEXCEPT \ { return static_cast(0); } \ \ static _GLIBCXX_CONSTEXPR unsigned TYPE \ quiet_NaN() _GLIBCXX_USE_NOEXCEPT \ { return static_cast(0); } \ \ static _GLIBCXX_CONSTEXPR unsigned TYPE \ signaling_NaN() _GLIBCXX_USE_NOEXCEPT \ { return static_cast(0); } \ \ static _GLIBCXX_CONSTEXPR unsigned TYPE \ denorm_min() _GLIBCXX_USE_NOEXCEPT \ { return static_cast(0); } \ \ static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false; \ static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; \ static _GLIBCXX_USE_CONSTEXPR bool is_modulo = true; \ \ static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps; \ static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false; \ static _GLIBCXX_USE_CONSTEXPR float_round_style round_style \ = round_toward_zero; \ }; #if __cplusplus >= 201103L #define __INT_N_201103(TYPE) \ static constexpr TYPE \ lowest() noexcept { return min(); } \ static constexpr int max_digits10 = 0; #define __INT_N_U201103(TYPE) \ static constexpr unsigned TYPE \ lowest() noexcept { return min(); } \ static constexpr int max_digits10 = 0; #else # 1564 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/limits" 3 #define __INT_N_201103(TYPE) #define __INT_N_U201103(TYPE) #endif # 1567 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/limits" 3 #ifdef __GLIBCXX_TYPE_INT_N_0 __INT_N(__GLIBCXX_TYPE_INT_N_0, __GLIBCXX_BITSIZE_INT_N_0, __INT_N_201103 (__GLIBCXX_TYPE_INT_N_0), __INT_N_U201103 (__GLIBCXX_TYPE_INT_N_0)) #endif # 1572 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/limits" 3 #ifdef __GLIBCXX_TYPE_INT_N_1 __INT_N (__GLIBCXX_TYPE_INT_N_1, __GLIBCXX_BITSIZE_INT_N_1, __INT_N_201103 (__GLIBCXX_TYPE_INT_N_1), __INT_N_U201103 (__GLIBCXX_TYPE_INT_N_1)) #endif # 1576 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/limits" 3 #ifdef __GLIBCXX_TYPE_INT_N_2 __INT_N (__GLIBCXX_TYPE_INT_N_2, __GLIBCXX_BITSIZE_INT_N_2, __INT_N_201103 (__GLIBCXX_TYPE_INT_N_2), __INT_N_U201103 (__GLIBCXX_TYPE_INT_N_2)) #endif # 1580 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/limits" 3 #ifdef __GLIBCXX_TYPE_INT_N_3 __INT_N (__GLIBCXX_TYPE_INT_N_3, __GLIBCXX_BITSIZE_INT_N_3, __INT_N_201103 (__GLIBCXX_TYPE_INT_N_3), __INT_N_U201103 (__GLIBCXX_TYPE_INT_N_3)) #endif # 1584 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/limits" 3 #undef __INT_N #undef __INT_N_201103 #undef __INT_N_U201103 #endif # 1590 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/limits" 3 /// numeric_limits specialization. template<> struct numeric_limits { static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; static _GLIBCXX_CONSTEXPR float min() _GLIBCXX_USE_NOEXCEPT { return __FLT_MIN__; } static _GLIBCXX_CONSTEXPR float max() _GLIBCXX_USE_NOEXCEPT { return __FLT_MAX__; } #if __cplusplus >= 201103L static constexpr float lowest() noexcept { return -__FLT_MAX__; } #endif # 1607 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/limits" 3 static _GLIBCXX_USE_CONSTEXPR int digits = __FLT_MANT_DIG__; static _GLIBCXX_USE_CONSTEXPR int digits10 = __FLT_DIG__; #if __cplusplus >= 201103L static constexpr int max_digits10 = __glibcxx_max_digits10 (__FLT_MANT_DIG__); #endif # 1614 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/limits" 3 static _GLIBCXX_USE_CONSTEXPR bool is_signed = true; static _GLIBCXX_USE_CONSTEXPR bool is_integer = false; static _GLIBCXX_USE_CONSTEXPR bool is_exact = false; static _GLIBCXX_USE_CONSTEXPR int radix = __FLT_RADIX__; static _GLIBCXX_CONSTEXPR float epsilon() _GLIBCXX_USE_NOEXCEPT { return __FLT_EPSILON__; } static _GLIBCXX_CONSTEXPR float round_error() _GLIBCXX_USE_NOEXCEPT { return 0.5F; } static _GLIBCXX_USE_CONSTEXPR int min_exponent = __FLT_MIN_EXP__; static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = __FLT_MIN_10_EXP__; static _GLIBCXX_USE_CONSTEXPR int max_exponent = __FLT_MAX_EXP__; static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = __FLT_MAX_10_EXP__; static _GLIBCXX_USE_CONSTEXPR bool has_infinity = __FLT_HAS_INFINITY__; static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = __FLT_HAS_QUIET_NAN__; static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = has_quiet_NaN; static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm = bool(__FLT_HAS_DENORM__) ? denorm_present : denorm_absent; static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = __glibcxx_float_has_denorm_loss; static _GLIBCXX_CONSTEXPR float infinity() _GLIBCXX_USE_NOEXCEPT { return __builtin_huge_valf(); } static _GLIBCXX_CONSTEXPR float quiet_NaN() _GLIBCXX_USE_NOEXCEPT { return __builtin_nanf(""); } static _GLIBCXX_CONSTEXPR float signaling_NaN() _GLIBCXX_USE_NOEXCEPT { return __builtin_nansf(""); } static _GLIBCXX_CONSTEXPR float denorm_min() _GLIBCXX_USE_NOEXCEPT { return __FLT_DENORM_MIN__; } static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = has_infinity && has_quiet_NaN && has_denorm == denorm_present; static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; static _GLIBCXX_USE_CONSTEXPR bool is_modulo = false; static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_float_traps; static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = __glibcxx_float_tinyness_before; static _GLIBCXX_USE_CONSTEXPR float_round_style round_style = round_to_nearest; }; #undef __glibcxx_float_has_denorm_loss #undef __glibcxx_float_traps #undef __glibcxx_float_tinyness_before /// numeric_limits specialization. template<> struct numeric_limits { static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; static _GLIBCXX_CONSTEXPR double min() _GLIBCXX_USE_NOEXCEPT { return __DBL_MIN__; } static _GLIBCXX_CONSTEXPR double max() _GLIBCXX_USE_NOEXCEPT { return __DBL_MAX__; } #if __cplusplus >= 201103L static constexpr double lowest() noexcept { return -__DBL_MAX__; } #endif # 1682 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/limits" 3 static _GLIBCXX_USE_CONSTEXPR int digits = __DBL_MANT_DIG__; static _GLIBCXX_USE_CONSTEXPR int digits10 = __DBL_DIG__; #if __cplusplus >= 201103L static constexpr int max_digits10 = __glibcxx_max_digits10 (__DBL_MANT_DIG__); #endif # 1689 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/limits" 3 static _GLIBCXX_USE_CONSTEXPR bool is_signed = true; static _GLIBCXX_USE_CONSTEXPR bool is_integer = false; static _GLIBCXX_USE_CONSTEXPR bool is_exact = false; static _GLIBCXX_USE_CONSTEXPR int radix = __FLT_RADIX__; static _GLIBCXX_CONSTEXPR double epsilon() _GLIBCXX_USE_NOEXCEPT { return __DBL_EPSILON__; } static _GLIBCXX_CONSTEXPR double round_error() _GLIBCXX_USE_NOEXCEPT { return 0.5; } static _GLIBCXX_USE_CONSTEXPR int min_exponent = __DBL_MIN_EXP__; static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = __DBL_MIN_10_EXP__; static _GLIBCXX_USE_CONSTEXPR int max_exponent = __DBL_MAX_EXP__; static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = __DBL_MAX_10_EXP__; static _GLIBCXX_USE_CONSTEXPR bool has_infinity = __DBL_HAS_INFINITY__; static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = __DBL_HAS_QUIET_NAN__; static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = has_quiet_NaN; static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm = bool(__DBL_HAS_DENORM__) ? denorm_present : denorm_absent; static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = __glibcxx_double_has_denorm_loss; static _GLIBCXX_CONSTEXPR double infinity() _GLIBCXX_USE_NOEXCEPT { return __builtin_huge_val(); } static _GLIBCXX_CONSTEXPR double quiet_NaN() _GLIBCXX_USE_NOEXCEPT { return __builtin_nan(""); } static _GLIBCXX_CONSTEXPR double signaling_NaN() _GLIBCXX_USE_NOEXCEPT { return __builtin_nans(""); } static _GLIBCXX_CONSTEXPR double denorm_min() _GLIBCXX_USE_NOEXCEPT { return __DBL_DENORM_MIN__; } static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = has_infinity && has_quiet_NaN && has_denorm == denorm_present; static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; static _GLIBCXX_USE_CONSTEXPR bool is_modulo = false; static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_double_traps; static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = __glibcxx_double_tinyness_before; static _GLIBCXX_USE_CONSTEXPR float_round_style round_style = round_to_nearest; }; #undef __glibcxx_double_has_denorm_loss #undef __glibcxx_double_traps #undef __glibcxx_double_tinyness_before /// numeric_limits specialization. template<> struct numeric_limits { static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; static _GLIBCXX_CONSTEXPR long double min() _GLIBCXX_USE_NOEXCEPT { return __LDBL_MIN__; } static _GLIBCXX_CONSTEXPR long double max() _GLIBCXX_USE_NOEXCEPT { return __LDBL_MAX__; } #if __cplusplus >= 201103L static constexpr long double lowest() noexcept { return -__LDBL_MAX__; } #endif # 1757 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/limits" 3 static _GLIBCXX_USE_CONSTEXPR int digits = __LDBL_MANT_DIG__; static _GLIBCXX_USE_CONSTEXPR int digits10 = __LDBL_DIG__; #if __cplusplus >= 201103L static _GLIBCXX_USE_CONSTEXPR int max_digits10 = __glibcxx_max_digits10 (__LDBL_MANT_DIG__); #endif # 1764 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/limits" 3 static _GLIBCXX_USE_CONSTEXPR bool is_signed = true; static _GLIBCXX_USE_CONSTEXPR bool is_integer = false; static _GLIBCXX_USE_CONSTEXPR bool is_exact = false; static _GLIBCXX_USE_CONSTEXPR int radix = __FLT_RADIX__; static _GLIBCXX_CONSTEXPR long double epsilon() _GLIBCXX_USE_NOEXCEPT { return __LDBL_EPSILON__; } static _GLIBCXX_CONSTEXPR long double round_error() _GLIBCXX_USE_NOEXCEPT { return 0.5L; } static _GLIBCXX_USE_CONSTEXPR int min_exponent = __LDBL_MIN_EXP__; static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = __LDBL_MIN_10_EXP__; static _GLIBCXX_USE_CONSTEXPR int max_exponent = __LDBL_MAX_EXP__; static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = __LDBL_MAX_10_EXP__; static _GLIBCXX_USE_CONSTEXPR bool has_infinity = __LDBL_HAS_INFINITY__; static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = __LDBL_HAS_QUIET_NAN__; static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = has_quiet_NaN; static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm = bool(__LDBL_HAS_DENORM__) ? denorm_present : denorm_absent; static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = __glibcxx_long_double_has_denorm_loss; static _GLIBCXX_CONSTEXPR long double infinity() _GLIBCXX_USE_NOEXCEPT { return __builtin_huge_vall(); } static _GLIBCXX_CONSTEXPR long double quiet_NaN() _GLIBCXX_USE_NOEXCEPT { return __builtin_nanl(""); } static _GLIBCXX_CONSTEXPR long double signaling_NaN() _GLIBCXX_USE_NOEXCEPT { return __builtin_nansl(""); } static _GLIBCXX_CONSTEXPR long double denorm_min() _GLIBCXX_USE_NOEXCEPT { return __LDBL_DENORM_MIN__; } static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = has_infinity && has_quiet_NaN && has_denorm == denorm_present; static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; static _GLIBCXX_USE_CONSTEXPR bool is_modulo = false; static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_long_double_traps; static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = __glibcxx_long_double_tinyness_before; static _GLIBCXX_USE_CONSTEXPR float_round_style round_style = round_to_nearest; }; #undef __glibcxx_long_double_has_denorm_loss #undef __glibcxx_long_double_traps #undef __glibcxx_long_double_tinyness_before _GLIBCXX_END_NAMESPACE_VERSION } // namespace #undef __glibcxx_signed #undef __glibcxx_min #undef __glibcxx_max #undef __glibcxx_digits #undef __glibcxx_digits10 #undef __glibcxx_max_digits10 #endif // _GLIBCXX_NUMERIC_LIMITS # 1827 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/limits" 3 # 43 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/random" 2 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 43 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/random" 3 # 44 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/random" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 44 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/random" 3 # 45 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/random" 3 #ifdef _GLIBCXX_USE_C99_STDINT_TR1 #if 0 /* expanded by -frewrite-includes */ #include // For uint_fast32_t, uint_fast64_t, uint_least32_t #endif /* expanded by -frewrite-includes */ # 48 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/random" 3 # 49 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/random" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 49 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/random" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/random.h" 1 3 // random number generation -*- C++ -*- // Copyright (C) 2009-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** * @file bits/random.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{random} */ #ifndef _RANDOM_H #define _RANDOM_H 1 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 34 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/random.h" 3 # 35 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/random.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 35 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/random.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/uniform_int_dist.h" 1 3 // Class template uniform_int_distribution -*- C++ -*- // Copyright (C) 2009-2016 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** * @file bits/uniform_int_dist.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{random} */ #ifndef _GLIBCXX_BITS_UNIFORM_INT_DIST_H #define _GLIBCXX_BITS_UNIFORM_INT_DIST_H #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 34 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/uniform_int_dist.h" 3 # 35 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/uniform_int_dist.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 35 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/uniform_int_dist.h" 3 # 36 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/uniform_int_dist.h" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION namespace __detail { /* Determine whether number is a power of 2. */ template inline bool _Power_of_2(_Tp __x) { return ((__x - 1) & __x) == 0; }; } /** * @brief Uniform discrete distribution for random numbers. * * A discrete random distribution on the range @f$[min, max]@f$ with equal * probability throughout the range. * * @ingroup random_distributions_uniform */ template class uniform_int_distribution { static_assert(std::is_integral<_IntType>::value, "template argument not an integral type"); public: /** The type of the range of the distribution. */ typedef _IntType result_type; /** Parameter type. */ struct param_type { typedef uniform_int_distribution<_IntType> distribution_type; explicit param_type(_IntType __a = 0, _IntType __b = std::numeric_limits<_IntType>::max()) : _M_a(__a), _M_b(__b) { _GLIBCXX_DEBUG_ASSERT(_M_a <= _M_b); } result_type a() const { return _M_a; } result_type b() const { return _M_b; } friend bool operator==(const param_type& __p1, const param_type& __p2) { return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; } private: _IntType _M_a; _IntType _M_b; }; public: /** * @brief Constructs a uniform distribution object. */ explicit uniform_int_distribution(_IntType __a = 0, _IntType __b = std::numeric_limits<_IntType>::max()) : _M_param(__a, __b) { } explicit uniform_int_distribution(const param_type& __p) : _M_param(__p) { } /** * @brief Resets the distribution state. * * Does nothing for the uniform integer distribution. */ void reset() { } result_type a() const { return _M_param.a(); } result_type b() const { return _M_param.b(); } /** * @brief Returns the parameter set of the distribution. */ param_type param() const { return _M_param; } /** * @brief Sets the parameter set of the distribution. * @param __param The new parameter set of the distribution. */ void param(const param_type& __param) { _M_param = __param; } /** * @brief Returns the inclusive lower bound of the distribution range. */ result_type min() const { return this->a(); } /** * @brief Returns the inclusive upper bound of the distribution range. */ result_type max() const { return this->b(); } /** * @brief Generating functions. */ template result_type operator()(_UniformRandomNumberGenerator& __urng) { return this->operator()(__urng, _M_param); } template result_type operator()(_UniformRandomNumberGenerator& __urng, const param_type& __p); template void __generate(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng) { this->__generate(__f, __t, __urng, _M_param); } template void __generate(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const param_type& __p) { this->__generate_impl(__f, __t, __urng, __p); } template void __generate(result_type* __f, result_type* __t, _UniformRandomNumberGenerator& __urng, const param_type& __p) { this->__generate_impl(__f, __t, __urng, __p); } /** * @brief Return true if two uniform integer distributions have * the same parameters. */ friend bool operator==(const uniform_int_distribution& __d1, const uniform_int_distribution& __d2) { return __d1._M_param == __d2._M_param; } private: template void __generate_impl(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const param_type& __p); param_type _M_param; }; template template typename uniform_int_distribution<_IntType>::result_type uniform_int_distribution<_IntType>:: operator()(_UniformRandomNumberGenerator& __urng, const param_type& __param) { typedef typename _UniformRandomNumberGenerator::result_type _Gresult_type; typedef typename std::make_unsigned::type __utype; typedef typename std::common_type<_Gresult_type, __utype>::type __uctype; const __uctype __urngmin = __urng.min(); const __uctype __urngmax = __urng.max(); const __uctype __urngrange = __urngmax - __urngmin; const __uctype __urange = __uctype(__param.b()) - __uctype(__param.a()); __uctype __ret; if (__urngrange > __urange) { // downscaling const __uctype __uerange = __urange + 1; // __urange can be zero const __uctype __scaling = __urngrange / __uerange; const __uctype __past = __uerange * __scaling; do __ret = __uctype(__urng()) - __urngmin; while (__ret >= __past); __ret /= __scaling; } else if (__urngrange < __urange) { // upscaling /* Note that every value in [0, urange] can be written uniquely as (urngrange + 1) * high + low where high in [0, urange / (urngrange + 1)] and low in [0, urngrange]. */ __uctype __tmp; // wraparound control do { const __uctype __uerngrange = __urngrange + 1; __tmp = (__uerngrange * operator() (__urng, param_type(0, __urange / __uerngrange))); __ret = __tmp + (__uctype(__urng()) - __urngmin); } while (__ret > __urange || __ret < __tmp); } else __ret = __uctype(__urng()) - __urngmin; return __ret + __param.a(); } template template void uniform_int_distribution<_IntType>:: __generate_impl(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const param_type& __param) { __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) typedef typename _UniformRandomNumberGenerator::result_type _Gresult_type; typedef typename std::make_unsigned::type __utype; typedef typename std::common_type<_Gresult_type, __utype>::type __uctype; const __uctype __urngmin = __urng.min(); const __uctype __urngmax = __urng.max(); const __uctype __urngrange = __urngmax - __urngmin; const __uctype __urange = __uctype(__param.b()) - __uctype(__param.a()); __uctype __ret; if (__urngrange > __urange) { if (__detail::_Power_of_2(__urngrange + 1) && __detail::_Power_of_2(__urange + 1)) { while (__f != __t) { __ret = __uctype(__urng()) - __urngmin; *__f++ = (__ret & __urange) + __param.a(); } } else { // downscaling const __uctype __uerange = __urange + 1; // __urange can be zero const __uctype __scaling = __urngrange / __uerange; const __uctype __past = __uerange * __scaling; while (__f != __t) { do __ret = __uctype(__urng()) - __urngmin; while (__ret >= __past); *__f++ = __ret / __scaling + __param.a(); } } } else if (__urngrange < __urange) { // upscaling /* Note that every value in [0, urange] can be written uniquely as (urngrange + 1) * high + low where high in [0, urange / (urngrange + 1)] and low in [0, urngrange]. */ __uctype __tmp; // wraparound control while (__f != __t) { do { const __uctype __uerngrange = __urngrange + 1; __tmp = (__uerngrange * operator() (__urng, param_type(0, __urange / __uerngrange))); __ret = __tmp + (__uctype(__urng()) - __urngmin); } while (__ret > __urange || __ret < __tmp); *__f++ = __ret; } } else while (__f != __t) *__f++ = __uctype(__urng()) - __urngmin + __param.a(); } _GLIBCXX_END_NAMESPACE_VERSION } // namespace std #endif # 370 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/uniform_int_dist.h" 3 # 36 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/random.h" 2 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION // [26.4] Random number generation /** * @defgroup random Random Number Generation * @ingroup numerics * * A facility for generating random numbers on selected distributions. * @{ */ /** * @brief A function template for converting the output of a (integral) * uniform random number generator to a floatng point result in the range * [0-1). */ template _RealType generate_canonical(_UniformRandomNumberGenerator& __g); _GLIBCXX_END_NAMESPACE_VERSION /* * Implementation-space details. */ namespace __detail { _GLIBCXX_BEGIN_NAMESPACE_VERSION template (std::numeric_limits<_UIntType>::digits)> struct _Shift { static const _UIntType __value = 0; }; template struct _Shift<_UIntType, __w, true> { static const _UIntType __value = _UIntType(1) << __w; }; template struct _Select_uint_least_t { static_assert(__which < 0, /* needs to be dependent */ "sorry, would be too much trouble for a slow result"); }; template struct _Select_uint_least_t<__s, 4> { typedef unsigned int type; }; template struct _Select_uint_least_t<__s, 3> { typedef unsigned long type; }; template struct _Select_uint_least_t<__s, 2> { typedef unsigned long long type; }; #ifdef _GLIBCXX_USE_INT128 template struct _Select_uint_least_t<__s, 1> { typedef unsigned __int128 type; }; #endif # 109 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/random.h" 3 // Assume a != 0, a < m, c < m, x < m. template= __m - 1), bool __schrage_ok = __m % __a < __m / __a> struct _Mod { typedef typename _Select_uint_least_t::type _Tp2; static _Tp __calc(_Tp __x) { return static_cast<_Tp>((_Tp2(__a) * __x + __c) % __m); } }; // Schrage. template struct _Mod<_Tp, __m, __a, __c, false, true> { static _Tp __calc(_Tp __x); }; // Special cases: // - for m == 2^n or m == 0, unsigned integer overflow is safe. // - a * (m - 1) + c fits in _Tp, there is no overflow. template struct _Mod<_Tp, __m, __a, __c, true, __s> { static _Tp __calc(_Tp __x) { _Tp __res = __a * __x + __c; if (__m) __res %= __m; return __res; } }; template inline _Tp __mod(_Tp __x) { return _Mod<_Tp, __m, __a, __c>::__calc(__x); } /* * An adaptor class for converting the output of any Generator into * the input for a specific Distribution. */ template struct _Adaptor { static_assert(std::is_floating_point<_DInputType>::value, "template argument not a floating point type"); public: _Adaptor(_Engine& __g) : _M_g(__g) { } _DInputType min() const { return _DInputType(0); } _DInputType max() const { return _DInputType(1); } /* * Converts a value generated by the adapted random number generator * into a value in the input domain for the dependent random number * distribution. */ _DInputType operator()() { return std::generate_canonical<_DInputType, std::numeric_limits<_DInputType>::digits, _Engine>(_M_g); } private: _Engine& _M_g; }; _GLIBCXX_END_NAMESPACE_VERSION } // namespace __detail _GLIBCXX_BEGIN_NAMESPACE_VERSION /** * @addtogroup random_generators Random Number Generators * @ingroup random * * These classes define objects which provide random or pseudorandom * numbers, either from a discrete or a continuous interval. The * random number generator supplied as a part of this library are * all uniform random number generators which provide a sequence of * random number uniformly distributed over their range. * * A number generator is a function object with an operator() that * takes zero arguments and returns a number. * * A compliant random number generator must satisfy the following * requirements. * *
Random Number Generator Requirements
To be documented.
* * @{ */ /** * @brief A model of a linear congruential random number generator. * * A random number generator that produces pseudorandom numbers via * linear function: * @f[ * x_{i+1}\leftarrow(ax_{i} + c) \bmod m * @f] * * The template parameter @p _UIntType must be an unsigned integral type * large enough to store values up to (__m-1). If the template parameter * @p __m is 0, the modulus @p __m used is * std::numeric_limits<_UIntType>::max() plus 1. Otherwise, the template * parameters @p __a and @p __c must be less than @p __m. * * The size of the state is @f$1@f$. */ template class linear_congruential_engine { static_assert(std::is_unsigned<_UIntType>::value, "template argument " "substituting _UIntType not an unsigned integral type"); static_assert(__m == 0u || (__a < __m && __c < __m), "template argument substituting __m out of bounds"); public: /** The type of the generated random value. */ typedef _UIntType result_type; /** The multiplier. */ static constexpr result_type multiplier = __a; /** An increment. */ static constexpr result_type increment = __c; /** The modulus. */ static constexpr result_type modulus = __m; static constexpr result_type default_seed = 1u; /** * @brief Constructs a %linear_congruential_engine random number * generator engine with seed @p __s. The default seed value * is 1. * * @param __s The initial seed value. */ explicit linear_congruential_engine(result_type __s = default_seed) { seed(__s); } /** * @brief Constructs a %linear_congruential_engine random number * generator engine seeded from the seed sequence @p __q. * * @param __q the seed sequence. */ template::value> ::type> explicit linear_congruential_engine(_Sseq& __q) { seed(__q); } /** * @brief Reseeds the %linear_congruential_engine random number generator * engine sequence to the seed @p __s. * * @param __s The new seed. */ void seed(result_type __s = default_seed); /** * @brief Reseeds the %linear_congruential_engine random number generator * engine * sequence using values from the seed sequence @p __q. * * @param __q the seed sequence. */ template typename std::enable_if::value>::type seed(_Sseq& __q); /** * @brief Gets the smallest possible value in the output range. * * The minimum depends on the @p __c parameter: if it is zero, the * minimum generated must be > 0, otherwise 0 is allowed. */ static constexpr result_type min() { return __c == 0u ? 1u : 0u; } /** * @brief Gets the largest possible value in the output range. */ static constexpr result_type max() { return __m - 1u; } /** * @brief Discard a sequence of random numbers. */ void discard(unsigned long long __z) { for (; __z != 0ULL; --__z) (*this)(); } /** * @brief Gets the next random number in the sequence. */ result_type operator()() { _M_x = __detail::__mod<_UIntType, __m, __a, __c>(_M_x); return _M_x; } /** * @brief Compares two linear congruential random number generator * objects of the same type for equality. * * @param __lhs A linear congruential random number generator object. * @param __rhs Another linear congruential random number generator * object. * * @returns true if the infinite sequences of generated values * would be equal, false otherwise. */ friend bool operator==(const linear_congruential_engine& __lhs, const linear_congruential_engine& __rhs) { return __lhs._M_x == __rhs._M_x; } /** * @brief Writes the textual representation of the state x(i) of x to * @p __os. * * @param __os The output stream. * @param __lcr A % linear_congruential_engine random number generator. * @returns __os. */ template friend std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>& __os, const std::linear_congruential_engine<_UIntType1, __a1, __c1, __m1>& __lcr); /** * @brief Sets the state of the engine by reading its textual * representation from @p __is. * * The textual representation must have been previously written using * an output stream whose imbued locale and whose type's template * specialization arguments _CharT and _Traits were the same as those * of @p __is. * * @param __is The input stream. * @param __lcr A % linear_congruential_engine random number generator. * @returns __is. */ template friend std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>& __is, std::linear_congruential_engine<_UIntType1, __a1, __c1, __m1>& __lcr); private: _UIntType _M_x; }; /** * @brief Compares two linear congruential random number generator * objects of the same type for inequality. * * @param __lhs A linear congruential random number generator object. * @param __rhs Another linear congruential random number generator * object. * * @returns true if the infinite sequences of generated values * would be different, false otherwise. */ template inline bool operator!=(const std::linear_congruential_engine<_UIntType, __a, __c, __m>& __lhs, const std::linear_congruential_engine<_UIntType, __a, __c, __m>& __rhs) { return !(__lhs == __rhs); } /** * A generalized feedback shift register discrete random number generator. * * This algorithm avoids multiplication and division and is designed to be * friendly to a pipelined architecture. If the parameters are chosen * correctly, this generator will produce numbers with a very long period and * fairly good apparent entropy, although still not cryptographically strong. * * The best way to use this generator is with the predefined mt19937 class. * * This algorithm was originally invented by Makoto Matsumoto and * Takuji Nishimura. * * @tparam __w Word size, the number of bits in each element of * the state vector. * @tparam __n The degree of recursion. * @tparam __m The period parameter. * @tparam __r The separation point bit index. * @tparam __a The last row of the twist matrix. * @tparam __u The first right-shift tempering matrix parameter. * @tparam __d The first right-shift tempering matrix mask. * @tparam __s The first left-shift tempering matrix parameter. * @tparam __b The first left-shift tempering matrix mask. * @tparam __t The second left-shift tempering matrix parameter. * @tparam __c The second left-shift tempering matrix mask. * @tparam __l The second right-shift tempering matrix parameter. * @tparam __f Initialization multiplier. */ template class mersenne_twister_engine { static_assert(std::is_unsigned<_UIntType>::value, "template argument " "substituting _UIntType not an unsigned integral type"); static_assert(1u <= __m && __m <= __n, "template argument substituting __m out of bounds"); static_assert(__r <= __w, "template argument substituting " "__r out of bound"); static_assert(__u <= __w, "template argument substituting " "__u out of bound"); static_assert(__s <= __w, "template argument substituting " "__s out of bound"); static_assert(__t <= __w, "template argument substituting " "__t out of bound"); static_assert(__l <= __w, "template argument substituting " "__l out of bound"); static_assert(__w <= std::numeric_limits<_UIntType>::digits, "template argument substituting __w out of bound"); static_assert(__a <= (__detail::_Shift<_UIntType, __w>::__value - 1), "template argument substituting __a out of bound"); static_assert(__b <= (__detail::_Shift<_UIntType, __w>::__value - 1), "template argument substituting __b out of bound"); static_assert(__c <= (__detail::_Shift<_UIntType, __w>::__value - 1), "template argument substituting __c out of bound"); static_assert(__d <= (__detail::_Shift<_UIntType, __w>::__value - 1), "template argument substituting __d out of bound"); static_assert(__f <= (__detail::_Shift<_UIntType, __w>::__value - 1), "template argument substituting __f out of bound"); public: /** The type of the generated random value. */ typedef _UIntType result_type; // parameter values static constexpr size_t word_size = __w; static constexpr size_t state_size = __n; static constexpr size_t shift_size = __m; static constexpr size_t mask_bits = __r; static constexpr result_type xor_mask = __a; static constexpr size_t tempering_u = __u; static constexpr result_type tempering_d = __d; static constexpr size_t tempering_s = __s; static constexpr result_type tempering_b = __b; static constexpr size_t tempering_t = __t; static constexpr result_type tempering_c = __c; static constexpr size_t tempering_l = __l; static constexpr result_type initialization_multiplier = __f; static constexpr result_type default_seed = 5489u; // constructors and member function explicit mersenne_twister_engine(result_type __sd = default_seed) { seed(__sd); } /** * @brief Constructs a %mersenne_twister_engine random number generator * engine seeded from the seed sequence @p __q. * * @param __q the seed sequence. */ template::value> ::type> explicit mersenne_twister_engine(_Sseq& __q) { seed(__q); } void seed(result_type __sd = default_seed); template typename std::enable_if::value>::type seed(_Sseq& __q); /** * @brief Gets the smallest possible value in the output range. */ static constexpr result_type min() { return 0; }; /** * @brief Gets the largest possible value in the output range. */ static constexpr result_type max() { return __detail::_Shift<_UIntType, __w>::__value - 1; } /** * @brief Discard a sequence of random numbers. */ void discard(unsigned long long __z); result_type operator()(); /** * @brief Compares two % mersenne_twister_engine random number generator * objects of the same type for equality. * * @param __lhs A % mersenne_twister_engine random number generator * object. * @param __rhs Another % mersenne_twister_engine random number * generator object. * * @returns true if the infinite sequences of generated values * would be equal, false otherwise. */ friend bool operator==(const mersenne_twister_engine& __lhs, const mersenne_twister_engine& __rhs) { return (std::equal(__lhs._M_x, __lhs._M_x + state_size, __rhs._M_x) && __lhs._M_p == __rhs._M_p); } /** * @brief Inserts the current state of a % mersenne_twister_engine * random number generator engine @p __x into the output stream * @p __os. * * @param __os An output stream. * @param __x A % mersenne_twister_engine random number generator * engine. * * @returns The output stream with the state of @p __x inserted or in * an error state. */ template friend std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>& __os, const std::mersenne_twister_engine<_UIntType1, __w1, __n1, __m1, __r1, __a1, __u1, __d1, __s1, __b1, __t1, __c1, __l1, __f1>& __x); /** * @brief Extracts the current state of a % mersenne_twister_engine * random number generator engine @p __x from the input stream * @p __is. * * @param __is An input stream. * @param __x A % mersenne_twister_engine random number generator * engine. * * @returns The input stream with the state of @p __x extracted or in * an error state. */ template friend std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>& __is, std::mersenne_twister_engine<_UIntType1, __w1, __n1, __m1, __r1, __a1, __u1, __d1, __s1, __b1, __t1, __c1, __l1, __f1>& __x); private: void _M_gen_rand(); _UIntType _M_x[state_size]; size_t _M_p; }; /** * @brief Compares two % mersenne_twister_engine random number generator * objects of the same type for inequality. * * @param __lhs A % mersenne_twister_engine random number generator * object. * @param __rhs Another % mersenne_twister_engine random number * generator object. * * @returns true if the infinite sequences of generated values * would be different, false otherwise. */ template inline bool operator!=(const std::mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>& __lhs, const std::mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>& __rhs) { return !(__lhs == __rhs); } /** * @brief The Marsaglia-Zaman generator. * * This is a model of a Generalized Fibonacci discrete random number * generator, sometimes referred to as the SWC generator. * * A discrete random number generator that produces pseudorandom * numbers using: * @f[ * x_{i}\leftarrow(x_{i - s} - x_{i - r} - carry_{i-1}) \bmod m * @f] * * The size of the state is @f$r@f$ * and the maximum period of the generator is @f$(m^r - m^s - 1)@f$. */ template class subtract_with_carry_engine { static_assert(std::is_unsigned<_UIntType>::value, "template argument " "substituting _UIntType not an unsigned integral type"); static_assert(0u < __s && __s < __r, "template argument substituting __s out of bounds"); static_assert(0u < __w && __w <= std::numeric_limits<_UIntType>::digits, "template argument substituting __w out of bounds"); public: /** The type of the generated random value. */ typedef _UIntType result_type; // parameter values static constexpr size_t word_size = __w; static constexpr size_t short_lag = __s; static constexpr size_t long_lag = __r; static constexpr result_type default_seed = 19780503u; /** * @brief Constructs an explicitly seeded % subtract_with_carry_engine * random number generator. */ explicit subtract_with_carry_engine(result_type __sd = default_seed) { seed(__sd); } /** * @brief Constructs a %subtract_with_carry_engine random number engine * seeded from the seed sequence @p __q. * * @param __q the seed sequence. */ template::value> ::type> explicit subtract_with_carry_engine(_Sseq& __q) { seed(__q); } /** * @brief Seeds the initial state @f$x_0@f$ of the random number * generator. * * N1688[4.19] modifies this as follows. If @p __value == 0, * sets value to 19780503. In any case, with a linear * congruential generator lcg(i) having parameters @f$ m_{lcg} = * 2147483563, a_{lcg} = 40014, c_{lcg} = 0, and lcg(0) = value * @f$, sets @f$ x_{-r} \dots x_{-1} @f$ to @f$ lcg(1) \bmod m * \dots lcg(r) \bmod m @f$ respectively. If @f$ x_{-1} = 0 @f$ * set carry to 1, otherwise sets carry to 0. */ void seed(result_type __sd = default_seed); /** * @brief Seeds the initial state @f$x_0@f$ of the * % subtract_with_carry_engine random number generator. */ template typename std::enable_if::value>::type seed(_Sseq& __q); /** * @brief Gets the inclusive minimum value of the range of random * integers returned by this generator. */ static constexpr result_type min() { return 0; } /** * @brief Gets the inclusive maximum value of the range of random * integers returned by this generator. */ static constexpr result_type max() { return __detail::_Shift<_UIntType, __w>::__value - 1; } /** * @brief Discard a sequence of random numbers. */ void discard(unsigned long long __z) { for (; __z != 0ULL; --__z) (*this)(); } /** * @brief Gets the next random number in the sequence. */ result_type operator()(); /** * @brief Compares two % subtract_with_carry_engine random number * generator objects of the same type for equality. * * @param __lhs A % subtract_with_carry_engine random number generator * object. * @param __rhs Another % subtract_with_carry_engine random number * generator object. * * @returns true if the infinite sequences of generated values * would be equal, false otherwise. */ friend bool operator==(const subtract_with_carry_engine& __lhs, const subtract_with_carry_engine& __rhs) { return (std::equal(__lhs._M_x, __lhs._M_x + long_lag, __rhs._M_x) && __lhs._M_carry == __rhs._M_carry && __lhs._M_p == __rhs._M_p); } /** * @brief Inserts the current state of a % subtract_with_carry_engine * random number generator engine @p __x into the output stream * @p __os. * * @param __os An output stream. * @param __x A % subtract_with_carry_engine random number generator * engine. * * @returns The output stream with the state of @p __x inserted or in * an error state. */ template friend std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>& __os, const std::subtract_with_carry_engine<_UIntType1, __w1, __s1, __r1>& __x); /** * @brief Extracts the current state of a % subtract_with_carry_engine * random number generator engine @p __x from the input stream * @p __is. * * @param __is An input stream. * @param __x A % subtract_with_carry_engine random number generator * engine. * * @returns The input stream with the state of @p __x extracted or in * an error state. */ template friend std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>& __is, std::subtract_with_carry_engine<_UIntType1, __w1, __s1, __r1>& __x); private: /// The state of the generator. This is a ring buffer. _UIntType _M_x[long_lag]; _UIntType _M_carry; ///< The carry size_t _M_p; ///< Current index of x(i - r). }; /** * @brief Compares two % subtract_with_carry_engine random number * generator objects of the same type for inequality. * * @param __lhs A % subtract_with_carry_engine random number generator * object. * @param __rhs Another % subtract_with_carry_engine random number * generator object. * * @returns true if the infinite sequences of generated values * would be different, false otherwise. */ template inline bool operator!=(const std::subtract_with_carry_engine<_UIntType, __w, __s, __r>& __lhs, const std::subtract_with_carry_engine<_UIntType, __w, __s, __r>& __rhs) { return !(__lhs == __rhs); } /** * Produces random numbers from some base engine by discarding blocks of * data. * * 0 <= @p __r <= @p __p */ template class discard_block_engine { static_assert(1 <= __r && __r <= __p, "template argument substituting __r out of bounds"); public: /** The type of the generated random value. */ typedef typename _RandomNumberEngine::result_type result_type; // parameter values static constexpr size_t block_size = __p; static constexpr size_t used_block = __r; /** * @brief Constructs a default %discard_block_engine engine. * * The underlying engine is default constructed as well. */ discard_block_engine() : _M_b(), _M_n(0) { } /** * @brief Copy constructs a %discard_block_engine engine. * * Copies an existing base class random number generator. * @param __rng An existing (base class) engine object. */ explicit discard_block_engine(const _RandomNumberEngine& __rng) : _M_b(__rng), _M_n(0) { } /** * @brief Move constructs a %discard_block_engine engine. * * Copies an existing base class random number generator. * @param __rng An existing (base class) engine object. */ explicit discard_block_engine(_RandomNumberEngine&& __rng) : _M_b(std::move(__rng)), _M_n(0) { } /** * @brief Seed constructs a %discard_block_engine engine. * * Constructs the underlying generator engine seeded with @p __s. * @param __s A seed value for the base class engine. */ explicit discard_block_engine(result_type __s) : _M_b(__s), _M_n(0) { } /** * @brief Generator construct a %discard_block_engine engine. * * @param __q A seed sequence. */ template::value && !std::is_same<_Sseq, _RandomNumberEngine>::value> ::type> explicit discard_block_engine(_Sseq& __q) : _M_b(__q), _M_n(0) { } /** * @brief Reseeds the %discard_block_engine object with the default * seed for the underlying base class generator engine. */ void seed() { _M_b.seed(); _M_n = 0; } /** * @brief Reseeds the %discard_block_engine object with the default * seed for the underlying base class generator engine. */ void seed(result_type __s) { _M_b.seed(__s); _M_n = 0; } /** * @brief Reseeds the %discard_block_engine object with the given seed * sequence. * @param __q A seed generator function. */ template void seed(_Sseq& __q) { _M_b.seed(__q); _M_n = 0; } /** * @brief Gets a const reference to the underlying generator engine * object. */ const _RandomNumberEngine& base() const noexcept { return _M_b; } /** * @brief Gets the minimum value in the generated random number range. */ static constexpr result_type min() { return _RandomNumberEngine::min(); } /** * @brief Gets the maximum value in the generated random number range. */ static constexpr result_type max() { return _RandomNumberEngine::max(); } /** * @brief Discard a sequence of random numbers. */ void discard(unsigned long long __z) { for (; __z != 0ULL; --__z) (*this)(); } /** * @brief Gets the next value in the generated random number sequence. */ result_type operator()(); /** * @brief Compares two %discard_block_engine random number generator * objects of the same type for equality. * * @param __lhs A %discard_block_engine random number generator object. * @param __rhs Another %discard_block_engine random number generator * object. * * @returns true if the infinite sequences of generated values * would be equal, false otherwise. */ friend bool operator==(const discard_block_engine& __lhs, const discard_block_engine& __rhs) { return __lhs._M_b == __rhs._M_b && __lhs._M_n == __rhs._M_n; } /** * @brief Inserts the current state of a %discard_block_engine random * number generator engine @p __x into the output stream * @p __os. * * @param __os An output stream. * @param __x A %discard_block_engine random number generator engine. * * @returns The output stream with the state of @p __x inserted or in * an error state. */ template friend std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>& __os, const std::discard_block_engine<_RandomNumberEngine1, __p1, __r1>& __x); /** * @brief Extracts the current state of a % subtract_with_carry_engine * random number generator engine @p __x from the input stream * @p __is. * * @param __is An input stream. * @param __x A %discard_block_engine random number generator engine. * * @returns The input stream with the state of @p __x extracted or in * an error state. */ template friend std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>& __is, std::discard_block_engine<_RandomNumberEngine1, __p1, __r1>& __x); private: _RandomNumberEngine _M_b; size_t _M_n; }; /** * @brief Compares two %discard_block_engine random number generator * objects of the same type for inequality. * * @param __lhs A %discard_block_engine random number generator object. * @param __rhs Another %discard_block_engine random number generator * object. * * @returns true if the infinite sequences of generated values * would be different, false otherwise. */ template inline bool operator!=(const std::discard_block_engine<_RandomNumberEngine, __p, __r>& __lhs, const std::discard_block_engine<_RandomNumberEngine, __p, __r>& __rhs) { return !(__lhs == __rhs); } /** * Produces random numbers by combining random numbers from some base * engine to produce random numbers with a specifies number of bits @p __w. */ template class independent_bits_engine { static_assert(std::is_unsigned<_UIntType>::value, "template argument " "substituting _UIntType not an unsigned integral type"); static_assert(0u < __w && __w <= std::numeric_limits<_UIntType>::digits, "template argument substituting __w out of bounds"); public: /** The type of the generated random value. */ typedef _UIntType result_type; /** * @brief Constructs a default %independent_bits_engine engine. * * The underlying engine is default constructed as well. */ independent_bits_engine() : _M_b() { } /** * @brief Copy constructs a %independent_bits_engine engine. * * Copies an existing base class random number generator. * @param __rng An existing (base class) engine object. */ explicit independent_bits_engine(const _RandomNumberEngine& __rng) : _M_b(__rng) { } /** * @brief Move constructs a %independent_bits_engine engine. * * Copies an existing base class random number generator. * @param __rng An existing (base class) engine object. */ explicit independent_bits_engine(_RandomNumberEngine&& __rng) : _M_b(std::move(__rng)) { } /** * @brief Seed constructs a %independent_bits_engine engine. * * Constructs the underlying generator engine seeded with @p __s. * @param __s A seed value for the base class engine. */ explicit independent_bits_engine(result_type __s) : _M_b(__s) { } /** * @brief Generator construct a %independent_bits_engine engine. * * @param __q A seed sequence. */ template::value && !std::is_same<_Sseq, _RandomNumberEngine>::value> ::type> explicit independent_bits_engine(_Sseq& __q) : _M_b(__q) { } /** * @brief Reseeds the %independent_bits_engine object with the default * seed for the underlying base class generator engine. */ void seed() { _M_b.seed(); } /** * @brief Reseeds the %independent_bits_engine object with the default * seed for the underlying base class generator engine. */ void seed(result_type __s) { _M_b.seed(__s); } /** * @brief Reseeds the %independent_bits_engine object with the given * seed sequence. * @param __q A seed generator function. */ template void seed(_Sseq& __q) { _M_b.seed(__q); } /** * @brief Gets a const reference to the underlying generator engine * object. */ const _RandomNumberEngine& base() const noexcept { return _M_b; } /** * @brief Gets the minimum value in the generated random number range. */ static constexpr result_type min() { return 0U; } /** * @brief Gets the maximum value in the generated random number range. */ static constexpr result_type max() { return __detail::_Shift<_UIntType, __w>::__value - 1; } /** * @brief Discard a sequence of random numbers. */ void discard(unsigned long long __z) { for (; __z != 0ULL; --__z) (*this)(); } /** * @brief Gets the next value in the generated random number sequence. */ result_type operator()(); /** * @brief Compares two %independent_bits_engine random number generator * objects of the same type for equality. * * @param __lhs A %independent_bits_engine random number generator * object. * @param __rhs Another %independent_bits_engine random number generator * object. * * @returns true if the infinite sequences of generated values * would be equal, false otherwise. */ friend bool operator==(const independent_bits_engine& __lhs, const independent_bits_engine& __rhs) { return __lhs._M_b == __rhs._M_b; } /** * @brief Extracts the current state of a % subtract_with_carry_engine * random number generator engine @p __x from the input stream * @p __is. * * @param __is An input stream. * @param __x A %independent_bits_engine random number generator * engine. * * @returns The input stream with the state of @p __x extracted or in * an error state. */ template friend std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>& __is, std::independent_bits_engine<_RandomNumberEngine, __w, _UIntType>& __x) { __is >> __x._M_b; return __is; } private: _RandomNumberEngine _M_b; }; /** * @brief Compares two %independent_bits_engine random number generator * objects of the same type for inequality. * * @param __lhs A %independent_bits_engine random number generator * object. * @param __rhs Another %independent_bits_engine random number generator * object. * * @returns true if the infinite sequences of generated values * would be different, false otherwise. */ template inline bool operator!=(const std::independent_bits_engine<_RandomNumberEngine, __w, _UIntType>& __lhs, const std::independent_bits_engine<_RandomNumberEngine, __w, _UIntType>& __rhs) { return !(__lhs == __rhs); } /** * @brief Inserts the current state of a %independent_bits_engine random * number generator engine @p __x into the output stream @p __os. * * @param __os An output stream. * @param __x A %independent_bits_engine random number generator engine. * * @returns The output stream with the state of @p __x inserted or in * an error state. */ template std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>& __os, const std::independent_bits_engine<_RandomNumberEngine, __w, _UIntType>& __x) { __os << __x.base(); return __os; } /** * @brief Produces random numbers by combining random numbers from some * base engine to produce random numbers with a specifies number of bits * @p __w. */ template class shuffle_order_engine { static_assert(1u <= __k, "template argument substituting " "__k out of bound"); public: /** The type of the generated random value. */ typedef typename _RandomNumberEngine::result_type result_type; static constexpr size_t table_size = __k; /** * @brief Constructs a default %shuffle_order_engine engine. * * The underlying engine is default constructed as well. */ shuffle_order_engine() : _M_b() { _M_initialize(); } /** * @brief Copy constructs a %shuffle_order_engine engine. * * Copies an existing base class random number generator. * @param __rng An existing (base class) engine object. */ explicit shuffle_order_engine(const _RandomNumberEngine& __rng) : _M_b(__rng) { _M_initialize(); } /** * @brief Move constructs a %shuffle_order_engine engine. * * Copies an existing base class random number generator. * @param __rng An existing (base class) engine object. */ explicit shuffle_order_engine(_RandomNumberEngine&& __rng) : _M_b(std::move(__rng)) { _M_initialize(); } /** * @brief Seed constructs a %shuffle_order_engine engine. * * Constructs the underlying generator engine seeded with @p __s. * @param __s A seed value for the base class engine. */ explicit shuffle_order_engine(result_type __s) : _M_b(__s) { _M_initialize(); } /** * @brief Generator construct a %shuffle_order_engine engine. * * @param __q A seed sequence. */ template::value && !std::is_same<_Sseq, _RandomNumberEngine>::value> ::type> explicit shuffle_order_engine(_Sseq& __q) : _M_b(__q) { _M_initialize(); } /** * @brief Reseeds the %shuffle_order_engine object with the default seed for the underlying base class generator engine. */ void seed() { _M_b.seed(); _M_initialize(); } /** * @brief Reseeds the %shuffle_order_engine object with the default seed * for the underlying base class generator engine. */ void seed(result_type __s) { _M_b.seed(__s); _M_initialize(); } /** * @brief Reseeds the %shuffle_order_engine object with the given seed * sequence. * @param __q A seed generator function. */ template void seed(_Sseq& __q) { _M_b.seed(__q); _M_initialize(); } /** * Gets a const reference to the underlying generator engine object. */ const _RandomNumberEngine& base() const noexcept { return _M_b; } /** * Gets the minimum value in the generated random number range. */ static constexpr result_type min() { return _RandomNumberEngine::min(); } /** * Gets the maximum value in the generated random number range. */ static constexpr result_type max() { return _RandomNumberEngine::max(); } /** * Discard a sequence of random numbers. */ void discard(unsigned long long __z) { for (; __z != 0ULL; --__z) (*this)(); } /** * Gets the next value in the generated random number sequence. */ result_type operator()(); /** * Compares two %shuffle_order_engine random number generator objects * of the same type for equality. * * @param __lhs A %shuffle_order_engine random number generator object. * @param __rhs Another %shuffle_order_engine random number generator * object. * * @returns true if the infinite sequences of generated values * would be equal, false otherwise. */ friend bool operator==(const shuffle_order_engine& __lhs, const shuffle_order_engine& __rhs) { return (__lhs._M_b == __rhs._M_b && std::equal(__lhs._M_v, __lhs._M_v + __k, __rhs._M_v) && __lhs._M_y == __rhs._M_y); } /** * @brief Inserts the current state of a %shuffle_order_engine random * number generator engine @p __x into the output stream @p __os. * * @param __os An output stream. * @param __x A %shuffle_order_engine random number generator engine. * * @returns The output stream with the state of @p __x inserted or in * an error state. */ template friend std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>& __os, const std::shuffle_order_engine<_RandomNumberEngine1, __k1>& __x); /** * @brief Extracts the current state of a % subtract_with_carry_engine * random number generator engine @p __x from the input stream * @p __is. * * @param __is An input stream. * @param __x A %shuffle_order_engine random number generator engine. * * @returns The input stream with the state of @p __x extracted or in * an error state. */ template friend std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>& __is, std::shuffle_order_engine<_RandomNumberEngine1, __k1>& __x); private: void _M_initialize() { for (size_t __i = 0; __i < __k; ++__i) _M_v[__i] = _M_b(); _M_y = _M_b(); } _RandomNumberEngine _M_b; result_type _M_v[__k]; result_type _M_y; }; /** * Compares two %shuffle_order_engine random number generator objects * of the same type for inequality. * * @param __lhs A %shuffle_order_engine random number generator object. * @param __rhs Another %shuffle_order_engine random number generator * object. * * @returns true if the infinite sequences of generated values * would be different, false otherwise. */ template inline bool operator!=(const std::shuffle_order_engine<_RandomNumberEngine, __k>& __lhs, const std::shuffle_order_engine<_RandomNumberEngine, __k>& __rhs) { return !(__lhs == __rhs); } /** * The classic Minimum Standard rand0 of Lewis, Goodman, and Miller. */ typedef linear_congruential_engine minstd_rand0; /** * An alternative LCR (Lehmer Generator function). */ typedef linear_congruential_engine minstd_rand; /** * The classic Mersenne Twister. * * Reference: * M. Matsumoto and T. Nishimura, Mersenne Twister: A 623-Dimensionally * Equidistributed Uniform Pseudo-Random Number Generator, ACM Transactions * on Modeling and Computer Simulation, Vol. 8, No. 1, January 1998, pp 3-30. */ typedef mersenne_twister_engine< uint_fast32_t, 32, 624, 397, 31, 0x9908b0dfUL, 11, 0xffffffffUL, 7, 0x9d2c5680UL, 15, 0xefc60000UL, 18, 1812433253UL> mt19937; /** * An alternative Mersenne Twister. */ typedef mersenne_twister_engine< uint_fast64_t, 64, 312, 156, 31, 0xb5026f5aa96619e9ULL, 29, 0x5555555555555555ULL, 17, 0x71d67fffeda60000ULL, 37, 0xfff7eee000000000ULL, 43, 6364136223846793005ULL> mt19937_64; typedef subtract_with_carry_engine ranlux24_base; typedef subtract_with_carry_engine ranlux48_base; typedef discard_block_engine ranlux24; typedef discard_block_engine ranlux48; typedef shuffle_order_engine knuth_b; typedef minstd_rand0 default_random_engine; /** * A standard interface to a platform-specific non-deterministic * random number generator (if any are available). */ class random_device { public: /** The type of the generated random value. */ typedef unsigned int result_type; // constructors, destructors and member functions #ifdef _GLIBCXX_USE_RANDOM_TR1 explicit random_device(const std::string& __token = "default") { _M_init(__token); } ~random_device() { _M_fini(); } #else # 1587 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/random.h" 3 explicit random_device(const std::string& __token = "mt19937") { _M_init_pretr1(__token); } public: #endif # 1595 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/random.h" 3 static constexpr result_type min() { return std::numeric_limits::min(); } static constexpr result_type max() { return std::numeric_limits::max(); } double entropy() const noexcept { return 0.0; } result_type operator()() { #ifdef _GLIBCXX_USE_RANDOM_TR1 return this->_M_getval(); #else # 1614 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/random.h" 3 return this->_M_getval_pretr1(); #endif # 1616 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/random.h" 3 } // No copy functions. random_device(const random_device&) = delete; void operator=(const random_device&) = delete; private: void _M_init(const std::string& __token); void _M_init_pretr1(const std::string& __token); void _M_fini(); result_type _M_getval(); result_type _M_getval_pretr1(); union { void* _M_file; mt19937 _M_mt; }; }; /* @} */ // group random_generators /** * @addtogroup random_distributions Random Number Distributions * @ingroup random * @{ */ /** * @addtogroup random_distributions_uniform Uniform Distributions * @ingroup random_distributions * @{ */ // std::uniform_int_distribution is defined in /** * @brief Return true if two uniform integer distributions have * different parameters. */ template inline bool operator!=(const std::uniform_int_distribution<_IntType>& __d1, const std::uniform_int_distribution<_IntType>& __d2) { return !(__d1 == __d2); } /** * @brief Inserts a %uniform_int_distribution random number * distribution @p __x into the output stream @p os. * * @param __os An output stream. * @param __x A %uniform_int_distribution random number distribution. * * @returns The output stream with the state of @p __x inserted or in * an error state. */ template std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>&, const std::uniform_int_distribution<_IntType>&); /** * @brief Extracts a %uniform_int_distribution random number distribution * @p __x from the input stream @p __is. * * @param __is An input stream. * @param __x A %uniform_int_distribution random number generator engine. * * @returns The input stream with @p __x extracted or in an error state. */ template std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>&, std::uniform_int_distribution<_IntType>&); /** * @brief Uniform continuous distribution for random numbers. * * A continuous random distribution on the range [min, max) with equal * probability throughout the range. The URNG should be real-valued and * deliver number in the range [0, 1). */ template class uniform_real_distribution { static_assert(std::is_floating_point<_RealType>::value, "template argument not a floating point type"); public: /** The type of the range of the distribution. */ typedef _RealType result_type; /** Parameter type. */ struct param_type { typedef uniform_real_distribution<_RealType> distribution_type; explicit param_type(_RealType __a = _RealType(0), _RealType __b = _RealType(1)) : _M_a(__a), _M_b(__b) { _GLIBCXX_DEBUG_ASSERT(_M_a <= _M_b); } result_type a() const { return _M_a; } result_type b() const { return _M_b; } friend bool operator==(const param_type& __p1, const param_type& __p2) { return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; } private: _RealType _M_a; _RealType _M_b; }; public: /** * @brief Constructs a uniform_real_distribution object. * * @param __a [IN] The lower bound of the distribution. * @param __b [IN] The upper bound of the distribution. */ explicit uniform_real_distribution(_RealType __a = _RealType(0), _RealType __b = _RealType(1)) : _M_param(__a, __b) { } explicit uniform_real_distribution(const param_type& __p) : _M_param(__p) { } /** * @brief Resets the distribution state. * * Does nothing for the uniform real distribution. */ void reset() { } result_type a() const { return _M_param.a(); } result_type b() const { return _M_param.b(); } /** * @brief Returns the parameter set of the distribution. */ param_type param() const { return _M_param; } /** * @brief Sets the parameter set of the distribution. * @param __param The new parameter set of the distribution. */ void param(const param_type& __param) { _M_param = __param; } /** * @brief Returns the inclusive lower bound of the distribution range. */ result_type min() const { return this->a(); } /** * @brief Returns the inclusive upper bound of the distribution range. */ result_type max() const { return this->b(); } /** * @brief Generating functions. */ template result_type operator()(_UniformRandomNumberGenerator& __urng) { return this->operator()(__urng, _M_param); } template result_type operator()(_UniformRandomNumberGenerator& __urng, const param_type& __p) { __detail::_Adaptor<_UniformRandomNumberGenerator, result_type> __aurng(__urng); return (__aurng() * (__p.b() - __p.a())) + __p.a(); } template void __generate(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng) { this->__generate(__f, __t, __urng, _M_param); } template void __generate(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const param_type& __p) { this->__generate_impl(__f, __t, __urng, __p); } template void __generate(result_type* __f, result_type* __t, _UniformRandomNumberGenerator& __urng, const param_type& __p) { this->__generate_impl(__f, __t, __urng, __p); } /** * @brief Return true if two uniform real distributions have * the same parameters. */ friend bool operator==(const uniform_real_distribution& __d1, const uniform_real_distribution& __d2) { return __d1._M_param == __d2._M_param; } private: template void __generate_impl(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const param_type& __p); param_type _M_param; }; /** * @brief Return true if two uniform real distributions have * different parameters. */ template inline bool operator!=(const std::uniform_real_distribution<_IntType>& __d1, const std::uniform_real_distribution<_IntType>& __d2) { return !(__d1 == __d2); } /** * @brief Inserts a %uniform_real_distribution random number * distribution @p __x into the output stream @p __os. * * @param __os An output stream. * @param __x A %uniform_real_distribution random number distribution. * * @returns The output stream with the state of @p __x inserted or in * an error state. */ template std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>&, const std::uniform_real_distribution<_RealType>&); /** * @brief Extracts a %uniform_real_distribution random number distribution * @p __x from the input stream @p __is. * * @param __is An input stream. * @param __x A %uniform_real_distribution random number generator engine. * * @returns The input stream with @p __x extracted or in an error state. */ template std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>&, std::uniform_real_distribution<_RealType>&); /* @} */ // group random_distributions_uniform /** * @addtogroup random_distributions_normal Normal Distributions * @ingroup random_distributions * @{ */ /** * @brief A normal continuous distribution for random numbers. * * The formula for the normal probability density function is * @f[ * p(x|\mu,\sigma) = \frac{1}{\sigma \sqrt{2 \pi}} * e^{- \frac{{x - \mu}^ {2}}{2 \sigma ^ {2}} } * @f] */ template class normal_distribution { static_assert(std::is_floating_point<_RealType>::value, "template argument not a floating point type"); public: /** The type of the range of the distribution. */ typedef _RealType result_type; /** Parameter type. */ struct param_type { typedef normal_distribution<_RealType> distribution_type; explicit param_type(_RealType __mean = _RealType(0), _RealType __stddev = _RealType(1)) : _M_mean(__mean), _M_stddev(__stddev) { _GLIBCXX_DEBUG_ASSERT(_M_stddev > _RealType(0)); } _RealType mean() const { return _M_mean; } _RealType stddev() const { return _M_stddev; } friend bool operator==(const param_type& __p1, const param_type& __p2) { return (__p1._M_mean == __p2._M_mean && __p1._M_stddev == __p2._M_stddev); } private: _RealType _M_mean; _RealType _M_stddev; }; public: /** * Constructs a normal distribution with parameters @f$mean@f$ and * standard deviation. */ explicit normal_distribution(result_type __mean = result_type(0), result_type __stddev = result_type(1)) : _M_param(__mean, __stddev), _M_saved_available(false) { } explicit normal_distribution(const param_type& __p) : _M_param(__p), _M_saved_available(false) { } /** * @brief Resets the distribution state. */ void reset() { _M_saved_available = false; } /** * @brief Returns the mean of the distribution. */ _RealType mean() const { return _M_param.mean(); } /** * @brief Returns the standard deviation of the distribution. */ _RealType stddev() const { return _M_param.stddev(); } /** * @brief Returns the parameter set of the distribution. */ param_type param() const { return _M_param; } /** * @brief Sets the parameter set of the distribution. * @param __param The new parameter set of the distribution. */ void param(const param_type& __param) { _M_param = __param; } /** * @brief Returns the greatest lower bound value of the distribution. */ result_type min() const { return std::numeric_limits::lowest(); } /** * @brief Returns the least upper bound value of the distribution. */ result_type max() const { return std::numeric_limits::max(); } /** * @brief Generating functions. */ template result_type operator()(_UniformRandomNumberGenerator& __urng) { return this->operator()(__urng, _M_param); } template result_type operator()(_UniformRandomNumberGenerator& __urng, const param_type& __p); template void __generate(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng) { this->__generate(__f, __t, __urng, _M_param); } template void __generate(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const param_type& __p) { this->__generate_impl(__f, __t, __urng, __p); } template void __generate(result_type* __f, result_type* __t, _UniformRandomNumberGenerator& __urng, const param_type& __p) { this->__generate_impl(__f, __t, __urng, __p); } /** * @brief Return true if two normal distributions have * the same parameters and the sequences that would * be generated are equal. */ template friend bool operator==(const std::normal_distribution<_RealType1>& __d1, const std::normal_distribution<_RealType1>& __d2); /** * @brief Inserts a %normal_distribution random number distribution * @p __x into the output stream @p __os. * * @param __os An output stream. * @param __x A %normal_distribution random number distribution. * * @returns The output stream with the state of @p __x inserted or in * an error state. */ template friend std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>& __os, const std::normal_distribution<_RealType1>& __x); /** * @brief Extracts a %normal_distribution random number distribution * @p __x from the input stream @p __is. * * @param __is An input stream. * @param __x A %normal_distribution random number generator engine. * * @returns The input stream with @p __x extracted or in an error * state. */ template friend std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>& __is, std::normal_distribution<_RealType1>& __x); private: template void __generate_impl(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const param_type& __p); param_type _M_param; result_type _M_saved; bool _M_saved_available; }; /** * @brief Return true if two normal distributions are different. */ template inline bool operator!=(const std::normal_distribution<_RealType>& __d1, const std::normal_distribution<_RealType>& __d2) { return !(__d1 == __d2); } /** * @brief A lognormal_distribution random number distribution. * * The formula for the normal probability mass function is * @f[ * p(x|m,s) = \frac{1}{sx\sqrt{2\pi}} * \exp{-\frac{(\ln{x} - m)^2}{2s^2}} * @f] */ template class lognormal_distribution { static_assert(std::is_floating_point<_RealType>::value, "template argument not a floating point type"); public: /** The type of the range of the distribution. */ typedef _RealType result_type; /** Parameter type. */ struct param_type { typedef lognormal_distribution<_RealType> distribution_type; explicit param_type(_RealType __m = _RealType(0), _RealType __s = _RealType(1)) : _M_m(__m), _M_s(__s) { } _RealType m() const { return _M_m; } _RealType s() const { return _M_s; } friend bool operator==(const param_type& __p1, const param_type& __p2) { return __p1._M_m == __p2._M_m && __p1._M_s == __p2._M_s; } private: _RealType _M_m; _RealType _M_s; }; explicit lognormal_distribution(_RealType __m = _RealType(0), _RealType __s = _RealType(1)) : _M_param(__m, __s), _M_nd() { } explicit lognormal_distribution(const param_type& __p) : _M_param(__p), _M_nd() { } /** * Resets the distribution state. */ void reset() { _M_nd.reset(); } /** * */ _RealType m() const { return _M_param.m(); } _RealType s() const { return _M_param.s(); } /** * @brief Returns the parameter set of the distribution. */ param_type param() const { return _M_param; } /** * @brief Sets the parameter set of the distribution. * @param __param The new parameter set of the distribution. */ void param(const param_type& __param) { _M_param = __param; } /** * @brief Returns the greatest lower bound value of the distribution. */ result_type min() const { return result_type(0); } /** * @brief Returns the least upper bound value of the distribution. */ result_type max() const { return std::numeric_limits::max(); } /** * @brief Generating functions. */ template result_type operator()(_UniformRandomNumberGenerator& __urng) { return this->operator()(__urng, _M_param); } template result_type operator()(_UniformRandomNumberGenerator& __urng, const param_type& __p) { return std::exp(__p.s() * _M_nd(__urng) + __p.m()); } template void __generate(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng) { this->__generate(__f, __t, __urng, _M_param); } template void __generate(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const param_type& __p) { this->__generate_impl(__f, __t, __urng, __p); } template void __generate(result_type* __f, result_type* __t, _UniformRandomNumberGenerator& __urng, const param_type& __p) { this->__generate_impl(__f, __t, __urng, __p); } /** * @brief Return true if two lognormal distributions have * the same parameters and the sequences that would * be generated are equal. */ friend bool operator==(const lognormal_distribution& __d1, const lognormal_distribution& __d2) { return (__d1._M_param == __d2._M_param && __d1._M_nd == __d2._M_nd); } /** * @brief Inserts a %lognormal_distribution random number distribution * @p __x into the output stream @p __os. * * @param __os An output stream. * @param __x A %lognormal_distribution random number distribution. * * @returns The output stream with the state of @p __x inserted or in * an error state. */ template friend std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>& __os, const std::lognormal_distribution<_RealType1>& __x); /** * @brief Extracts a %lognormal_distribution random number distribution * @p __x from the input stream @p __is. * * @param __is An input stream. * @param __x A %lognormal_distribution random number * generator engine. * * @returns The input stream with @p __x extracted or in an error state. */ template friend std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>& __is, std::lognormal_distribution<_RealType1>& __x); private: template void __generate_impl(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const param_type& __p); param_type _M_param; std::normal_distribution _M_nd; }; /** * @brief Return true if two lognormal distributions are different. */ template inline bool operator!=(const std::lognormal_distribution<_RealType>& __d1, const std::lognormal_distribution<_RealType>& __d2) { return !(__d1 == __d2); } /** * @brief A gamma continuous distribution for random numbers. * * The formula for the gamma probability density function is: * @f[ * p(x|\alpha,\beta) = \frac{1}{\beta\Gamma(\alpha)} * (x/\beta)^{\alpha - 1} e^{-x/\beta} * @f] */ template class gamma_distribution { static_assert(std::is_floating_point<_RealType>::value, "template argument not a floating point type"); public: /** The type of the range of the distribution. */ typedef _RealType result_type; /** Parameter type. */ struct param_type { typedef gamma_distribution<_RealType> distribution_type; friend class gamma_distribution<_RealType>; explicit param_type(_RealType __alpha_val = _RealType(1), _RealType __beta_val = _RealType(1)) : _M_alpha(__alpha_val), _M_beta(__beta_val) { _GLIBCXX_DEBUG_ASSERT(_M_alpha > _RealType(0)); _M_initialize(); } _RealType alpha() const { return _M_alpha; } _RealType beta() const { return _M_beta; } friend bool operator==(const param_type& __p1, const param_type& __p2) { return (__p1._M_alpha == __p2._M_alpha && __p1._M_beta == __p2._M_beta); } private: void _M_initialize(); _RealType _M_alpha; _RealType _M_beta; _RealType _M_malpha, _M_a2; }; public: /** * @brief Constructs a gamma distribution with parameters * @f$\alpha@f$ and @f$\beta@f$. */ explicit gamma_distribution(_RealType __alpha_val = _RealType(1), _RealType __beta_val = _RealType(1)) : _M_param(__alpha_val, __beta_val), _M_nd() { } explicit gamma_distribution(const param_type& __p) : _M_param(__p), _M_nd() { } /** * @brief Resets the distribution state. */ void reset() { _M_nd.reset(); } /** * @brief Returns the @f$\alpha@f$ of the distribution. */ _RealType alpha() const { return _M_param.alpha(); } /** * @brief Returns the @f$\beta@f$ of the distribution. */ _RealType beta() const { return _M_param.beta(); } /** * @brief Returns the parameter set of the distribution. */ param_type param() const { return _M_param; } /** * @brief Sets the parameter set of the distribution. * @param __param The new parameter set of the distribution. */ void param(const param_type& __param) { _M_param = __param; } /** * @brief Returns the greatest lower bound value of the distribution. */ result_type min() const { return result_type(0); } /** * @brief Returns the least upper bound value of the distribution. */ result_type max() const { return std::numeric_limits::max(); } /** * @brief Generating functions. */ template result_type operator()(_UniformRandomNumberGenerator& __urng) { return this->operator()(__urng, _M_param); } template result_type operator()(_UniformRandomNumberGenerator& __urng, const param_type& __p); template void __generate(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng) { this->__generate(__f, __t, __urng, _M_param); } template void __generate(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const param_type& __p) { this->__generate_impl(__f, __t, __urng, __p); } template void __generate(result_type* __f, result_type* __t, _UniformRandomNumberGenerator& __urng, const param_type& __p) { this->__generate_impl(__f, __t, __urng, __p); } /** * @brief Return true if two gamma distributions have the same * parameters and the sequences that would be generated * are equal. */ friend bool operator==(const gamma_distribution& __d1, const gamma_distribution& __d2) { return (__d1._M_param == __d2._M_param && __d1._M_nd == __d2._M_nd); } /** * @brief Inserts a %gamma_distribution random number distribution * @p __x into the output stream @p __os. * * @param __os An output stream. * @param __x A %gamma_distribution random number distribution. * * @returns The output stream with the state of @p __x inserted or in * an error state. */ template friend std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>& __os, const std::gamma_distribution<_RealType1>& __x); /** * @brief Extracts a %gamma_distribution random number distribution * @p __x from the input stream @p __is. * * @param __is An input stream. * @param __x A %gamma_distribution random number generator engine. * * @returns The input stream with @p __x extracted or in an error state. */ template friend std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>& __is, std::gamma_distribution<_RealType1>& __x); private: template void __generate_impl(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const param_type& __p); param_type _M_param; std::normal_distribution _M_nd; }; /** * @brief Return true if two gamma distributions are different. */ template inline bool operator!=(const std::gamma_distribution<_RealType>& __d1, const std::gamma_distribution<_RealType>& __d2) { return !(__d1 == __d2); } /** * @brief A chi_squared_distribution random number distribution. * * The formula for the normal probability mass function is * @f$p(x|n) = \frac{x^{(n/2) - 1}e^{-x/2}}{\Gamma(n/2) 2^{n/2}}@f$ */ template class chi_squared_distribution { static_assert(std::is_floating_point<_RealType>::value, "template argument not a floating point type"); public: /** The type of the range of the distribution. */ typedef _RealType result_type; /** Parameter type. */ struct param_type { typedef chi_squared_distribution<_RealType> distribution_type; explicit param_type(_RealType __n = _RealType(1)) : _M_n(__n) { } _RealType n() const { return _M_n; } friend bool operator==(const param_type& __p1, const param_type& __p2) { return __p1._M_n == __p2._M_n; } private: _RealType _M_n; }; explicit chi_squared_distribution(_RealType __n = _RealType(1)) : _M_param(__n), _M_gd(__n / 2) { } explicit chi_squared_distribution(const param_type& __p) : _M_param(__p), _M_gd(__p.n() / 2) { } /** * @brief Resets the distribution state. */ void reset() { _M_gd.reset(); } /** * */ _RealType n() const { return _M_param.n(); } /** * @brief Returns the parameter set of the distribution. */ param_type param() const { return _M_param; } /** * @brief Sets the parameter set of the distribution. * @param __param The new parameter set of the distribution. */ void param(const param_type& __param) { _M_param = __param; } /** * @brief Returns the greatest lower bound value of the distribution. */ result_type min() const { return result_type(0); } /** * @brief Returns the least upper bound value of the distribution. */ result_type max() const { return std::numeric_limits::max(); } /** * @brief Generating functions. */ template result_type operator()(_UniformRandomNumberGenerator& __urng) { return 2 * _M_gd(__urng); } template result_type operator()(_UniformRandomNumberGenerator& __urng, const param_type& __p) { typedef typename std::gamma_distribution::param_type param_type; return 2 * _M_gd(__urng, param_type(__p.n() / 2)); } template void __generate(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng) { this->__generate_impl(__f, __t, __urng); } template void __generate(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const param_type& __p) { typename std::gamma_distribution::param_type __p2(__p.n() / 2); this->__generate_impl(__f, __t, __urng, __p2); } template void __generate(result_type* __f, result_type* __t, _UniformRandomNumberGenerator& __urng) { this->__generate_impl(__f, __t, __urng); } template void __generate(result_type* __f, result_type* __t, _UniformRandomNumberGenerator& __urng, const param_type& __p) { typename std::gamma_distribution::param_type __p2(__p.n() / 2); this->__generate_impl(__f, __t, __urng, __p2); } /** * @brief Return true if two Chi-squared distributions have * the same parameters and the sequences that would be * generated are equal. */ friend bool operator==(const chi_squared_distribution& __d1, const chi_squared_distribution& __d2) { return __d1._M_param == __d2._M_param && __d1._M_gd == __d2._M_gd; } /** * @brief Inserts a %chi_squared_distribution random number distribution * @p __x into the output stream @p __os. * * @param __os An output stream. * @param __x A %chi_squared_distribution random number distribution. * * @returns The output stream with the state of @p __x inserted or in * an error state. */ template friend std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>& __os, const std::chi_squared_distribution<_RealType1>& __x); /** * @brief Extracts a %chi_squared_distribution random number distribution * @p __x from the input stream @p __is. * * @param __is An input stream. * @param __x A %chi_squared_distribution random number * generator engine. * * @returns The input stream with @p __x extracted or in an error state. */ template friend std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>& __is, std::chi_squared_distribution<_RealType1>& __x); private: template void __generate_impl(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng); template void __generate_impl(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const typename std::gamma_distribution::param_type& __p); param_type _M_param; std::gamma_distribution _M_gd; }; /** * @brief Return true if two Chi-squared distributions are different. */ template inline bool operator!=(const std::chi_squared_distribution<_RealType>& __d1, const std::chi_squared_distribution<_RealType>& __d2) { return !(__d1 == __d2); } /** * @brief A cauchy_distribution random number distribution. * * The formula for the normal probability mass function is * @f$p(x|a,b) = (\pi b (1 + (\frac{x-a}{b})^2))^{-1}@f$ */ template class cauchy_distribution { static_assert(std::is_floating_point<_RealType>::value, "template argument not a floating point type"); public: /** The type of the range of the distribution. */ typedef _RealType result_type; /** Parameter type. */ struct param_type { typedef cauchy_distribution<_RealType> distribution_type; explicit param_type(_RealType __a = _RealType(0), _RealType __b = _RealType(1)) : _M_a(__a), _M_b(__b) { } _RealType a() const { return _M_a; } _RealType b() const { return _M_b; } friend bool operator==(const param_type& __p1, const param_type& __p2) { return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; } private: _RealType _M_a; _RealType _M_b; }; explicit cauchy_distribution(_RealType __a = _RealType(0), _RealType __b = _RealType(1)) : _M_param(__a, __b) { } explicit cauchy_distribution(const param_type& __p) : _M_param(__p) { } /** * @brief Resets the distribution state. */ void reset() { } /** * */ _RealType a() const { return _M_param.a(); } _RealType b() const { return _M_param.b(); } /** * @brief Returns the parameter set of the distribution. */ param_type param() const { return _M_param; } /** * @brief Sets the parameter set of the distribution. * @param __param The new parameter set of the distribution. */ void param(const param_type& __param) { _M_param = __param; } /** * @brief Returns the greatest lower bound value of the distribution. */ result_type min() const { return std::numeric_limits::lowest(); } /** * @brief Returns the least upper bound value of the distribution. */ result_type max() const { return std::numeric_limits::max(); } /** * @brief Generating functions. */ template result_type operator()(_UniformRandomNumberGenerator& __urng) { return this->operator()(__urng, _M_param); } template result_type operator()(_UniformRandomNumberGenerator& __urng, const param_type& __p); template void __generate(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng) { this->__generate(__f, __t, __urng, _M_param); } template void __generate(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const param_type& __p) { this->__generate_impl(__f, __t, __urng, __p); } template void __generate(result_type* __f, result_type* __t, _UniformRandomNumberGenerator& __urng, const param_type& __p) { this->__generate_impl(__f, __t, __urng, __p); } /** * @brief Return true if two Cauchy distributions have * the same parameters. */ friend bool operator==(const cauchy_distribution& __d1, const cauchy_distribution& __d2) { return __d1._M_param == __d2._M_param; } private: template void __generate_impl(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const param_type& __p); param_type _M_param; }; /** * @brief Return true if two Cauchy distributions have * different parameters. */ template inline bool operator!=(const std::cauchy_distribution<_RealType>& __d1, const std::cauchy_distribution<_RealType>& __d2) { return !(__d1 == __d2); } /** * @brief Inserts a %cauchy_distribution random number distribution * @p __x into the output stream @p __os. * * @param __os An output stream. * @param __x A %cauchy_distribution random number distribution. * * @returns The output stream with the state of @p __x inserted or in * an error state. */ template std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>& __os, const std::cauchy_distribution<_RealType>& __x); /** * @brief Extracts a %cauchy_distribution random number distribution * @p __x from the input stream @p __is. * * @param __is An input stream. * @param __x A %cauchy_distribution random number * generator engine. * * @returns The input stream with @p __x extracted or in an error state. */ template std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>& __is, std::cauchy_distribution<_RealType>& __x); /** * @brief A fisher_f_distribution random number distribution. * * The formula for the normal probability mass function is * @f[ * p(x|m,n) = \frac{\Gamma((m+n)/2)}{\Gamma(m/2)\Gamma(n/2)} * (\frac{m}{n})^{m/2} x^{(m/2)-1} * (1 + \frac{mx}{n})^{-(m+n)/2} * @f] */ template class fisher_f_distribution { static_assert(std::is_floating_point<_RealType>::value, "template argument not a floating point type"); public: /** The type of the range of the distribution. */ typedef _RealType result_type; /** Parameter type. */ struct param_type { typedef fisher_f_distribution<_RealType> distribution_type; explicit param_type(_RealType __m = _RealType(1), _RealType __n = _RealType(1)) : _M_m(__m), _M_n(__n) { } _RealType m() const { return _M_m; } _RealType n() const { return _M_n; } friend bool operator==(const param_type& __p1, const param_type& __p2) { return __p1._M_m == __p2._M_m && __p1._M_n == __p2._M_n; } private: _RealType _M_m; _RealType _M_n; }; explicit fisher_f_distribution(_RealType __m = _RealType(1), _RealType __n = _RealType(1)) : _M_param(__m, __n), _M_gd_x(__m / 2), _M_gd_y(__n / 2) { } explicit fisher_f_distribution(const param_type& __p) : _M_param(__p), _M_gd_x(__p.m() / 2), _M_gd_y(__p.n() / 2) { } /** * @brief Resets the distribution state. */ void reset() { _M_gd_x.reset(); _M_gd_y.reset(); } /** * */ _RealType m() const { return _M_param.m(); } _RealType n() const { return _M_param.n(); } /** * @brief Returns the parameter set of the distribution. */ param_type param() const { return _M_param; } /** * @brief Sets the parameter set of the distribution. * @param __param The new parameter set of the distribution. */ void param(const param_type& __param) { _M_param = __param; } /** * @brief Returns the greatest lower bound value of the distribution. */ result_type min() const { return result_type(0); } /** * @brief Returns the least upper bound value of the distribution. */ result_type max() const { return std::numeric_limits::max(); } /** * @brief Generating functions. */ template result_type operator()(_UniformRandomNumberGenerator& __urng) { return (_M_gd_x(__urng) * n()) / (_M_gd_y(__urng) * m()); } template result_type operator()(_UniformRandomNumberGenerator& __urng, const param_type& __p) { typedef typename std::gamma_distribution::param_type param_type; return ((_M_gd_x(__urng, param_type(__p.m() / 2)) * n()) / (_M_gd_y(__urng, param_type(__p.n() / 2)) * m())); } template void __generate(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng) { this->__generate_impl(__f, __t, __urng); } template void __generate(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const param_type& __p) { this->__generate_impl(__f, __t, __urng, __p); } template void __generate(result_type* __f, result_type* __t, _UniformRandomNumberGenerator& __urng) { this->__generate_impl(__f, __t, __urng); } template void __generate(result_type* __f, result_type* __t, _UniformRandomNumberGenerator& __urng, const param_type& __p) { this->__generate_impl(__f, __t, __urng, __p); } /** * @brief Return true if two Fisher f distributions have * the same parameters and the sequences that would * be generated are equal. */ friend bool operator==(const fisher_f_distribution& __d1, const fisher_f_distribution& __d2) { return (__d1._M_param == __d2._M_param && __d1._M_gd_x == __d2._M_gd_x && __d1._M_gd_y == __d2._M_gd_y); } /** * @brief Inserts a %fisher_f_distribution random number distribution * @p __x into the output stream @p __os. * * @param __os An output stream. * @param __x A %fisher_f_distribution random number distribution. * * @returns The output stream with the state of @p __x inserted or in * an error state. */ template friend std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>& __os, const std::fisher_f_distribution<_RealType1>& __x); /** * @brief Extracts a %fisher_f_distribution random number distribution * @p __x from the input stream @p __is. * * @param __is An input stream. * @param __x A %fisher_f_distribution random number * generator engine. * * @returns The input stream with @p __x extracted or in an error state. */ template friend std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>& __is, std::fisher_f_distribution<_RealType1>& __x); private: template void __generate_impl(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng); template void __generate_impl(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const param_type& __p); param_type _M_param; std::gamma_distribution _M_gd_x, _M_gd_y; }; /** * @brief Return true if two Fisher f distributions are different. */ template inline bool operator!=(const std::fisher_f_distribution<_RealType>& __d1, const std::fisher_f_distribution<_RealType>& __d2) { return !(__d1 == __d2); } /** * @brief A student_t_distribution random number distribution. * * The formula for the normal probability mass function is: * @f[ * p(x|n) = \frac{1}{\sqrt(n\pi)} \frac{\Gamma((n+1)/2)}{\Gamma(n/2)} * (1 + \frac{x^2}{n}) ^{-(n+1)/2} * @f] */ template class student_t_distribution { static_assert(std::is_floating_point<_RealType>::value, "template argument not a floating point type"); public: /** The type of the range of the distribution. */ typedef _RealType result_type; /** Parameter type. */ struct param_type { typedef student_t_distribution<_RealType> distribution_type; explicit param_type(_RealType __n = _RealType(1)) : _M_n(__n) { } _RealType n() const { return _M_n; } friend bool operator==(const param_type& __p1, const param_type& __p2) { return __p1._M_n == __p2._M_n; } private: _RealType _M_n; }; explicit student_t_distribution(_RealType __n = _RealType(1)) : _M_param(__n), _M_nd(), _M_gd(__n / 2, 2) { } explicit student_t_distribution(const param_type& __p) : _M_param(__p), _M_nd(), _M_gd(__p.n() / 2, 2) { } /** * @brief Resets the distribution state. */ void reset() { _M_nd.reset(); _M_gd.reset(); } /** * */ _RealType n() const { return _M_param.n(); } /** * @brief Returns the parameter set of the distribution. */ param_type param() const { return _M_param; } /** * @brief Sets the parameter set of the distribution. * @param __param The new parameter set of the distribution. */ void param(const param_type& __param) { _M_param = __param; } /** * @brief Returns the greatest lower bound value of the distribution. */ result_type min() const { return std::numeric_limits::lowest(); } /** * @brief Returns the least upper bound value of the distribution. */ result_type max() const { return std::numeric_limits::max(); } /** * @brief Generating functions. */ template result_type operator()(_UniformRandomNumberGenerator& __urng) { return _M_nd(__urng) * std::sqrt(n() / _M_gd(__urng)); } template result_type operator()(_UniformRandomNumberGenerator& __urng, const param_type& __p) { typedef typename std::gamma_distribution::param_type param_type; const result_type __g = _M_gd(__urng, param_type(__p.n() / 2, 2)); return _M_nd(__urng) * std::sqrt(__p.n() / __g); } template void __generate(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng) { this->__generate_impl(__f, __t, __urng); } template void __generate(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const param_type& __p) { this->__generate_impl(__f, __t, __urng, __p); } template void __generate(result_type* __f, result_type* __t, _UniformRandomNumberGenerator& __urng) { this->__generate_impl(__f, __t, __urng); } template void __generate(result_type* __f, result_type* __t, _UniformRandomNumberGenerator& __urng, const param_type& __p) { this->__generate_impl(__f, __t, __urng, __p); } /** * @brief Return true if two Student t distributions have * the same parameters and the sequences that would * be generated are equal. */ friend bool operator==(const student_t_distribution& __d1, const student_t_distribution& __d2) { return (__d1._M_param == __d2._M_param && __d1._M_nd == __d2._M_nd && __d1._M_gd == __d2._M_gd); } /** * @brief Inserts a %student_t_distribution random number distribution * @p __x into the output stream @p __os. * * @param __os An output stream. * @param __x A %student_t_distribution random number distribution. * * @returns The output stream with the state of @p __x inserted or in * an error state. */ template friend std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>& __os, const std::student_t_distribution<_RealType1>& __x); /** * @brief Extracts a %student_t_distribution random number distribution * @p __x from the input stream @p __is. * * @param __is An input stream. * @param __x A %student_t_distribution random number * generator engine. * * @returns The input stream with @p __x extracted or in an error state. */ template friend std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>& __is, std::student_t_distribution<_RealType1>& __x); private: template void __generate_impl(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng); template void __generate_impl(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const param_type& __p); param_type _M_param; std::normal_distribution _M_nd; std::gamma_distribution _M_gd; }; /** * @brief Return true if two Student t distributions are different. */ template inline bool operator!=(const std::student_t_distribution<_RealType>& __d1, const std::student_t_distribution<_RealType>& __d2) { return !(__d1 == __d2); } /* @} */ // group random_distributions_normal /** * @addtogroup random_distributions_bernoulli Bernoulli Distributions * @ingroup random_distributions * @{ */ /** * @brief A Bernoulli random number distribution. * * Generates a sequence of true and false values with likelihood @f$p@f$ * that true will come up and @f$(1 - p)@f$ that false will appear. */ class bernoulli_distribution { public: /** The type of the range of the distribution. */ typedef bool result_type; /** Parameter type. */ struct param_type { typedef bernoulli_distribution distribution_type; explicit param_type(double __p = 0.5) : _M_p(__p) { _GLIBCXX_DEBUG_ASSERT((_M_p >= 0.0) && (_M_p <= 1.0)); } double p() const { return _M_p; } friend bool operator==(const param_type& __p1, const param_type& __p2) { return __p1._M_p == __p2._M_p; } private: double _M_p; }; public: /** * @brief Constructs a Bernoulli distribution with likelihood @p p. * * @param __p [IN] The likelihood of a true result being returned. * Must be in the interval @f$[0, 1]@f$. */ explicit bernoulli_distribution(double __p = 0.5) : _M_param(__p) { } explicit bernoulli_distribution(const param_type& __p) : _M_param(__p) { } /** * @brief Resets the distribution state. * * Does nothing for a Bernoulli distribution. */ void reset() { } /** * @brief Returns the @p p parameter of the distribution. */ double p() const { return _M_param.p(); } /** * @brief Returns the parameter set of the distribution. */ param_type param() const { return _M_param; } /** * @brief Sets the parameter set of the distribution. * @param __param The new parameter set of the distribution. */ void param(const param_type& __param) { _M_param = __param; } /** * @brief Returns the greatest lower bound value of the distribution. */ result_type min() const { return std::numeric_limits::min(); } /** * @brief Returns the least upper bound value of the distribution. */ result_type max() const { return std::numeric_limits::max(); } /** * @brief Generating functions. */ template result_type operator()(_UniformRandomNumberGenerator& __urng) { return this->operator()(__urng, _M_param); } template result_type operator()(_UniformRandomNumberGenerator& __urng, const param_type& __p) { __detail::_Adaptor<_UniformRandomNumberGenerator, double> __aurng(__urng); if ((__aurng() - __aurng.min()) < __p.p() * (__aurng.max() - __aurng.min())) return true; return false; } template void __generate(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng) { this->__generate(__f, __t, __urng, _M_param); } template void __generate(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const param_type& __p) { this->__generate_impl(__f, __t, __urng, __p); } template void __generate(result_type* __f, result_type* __t, _UniformRandomNumberGenerator& __urng, const param_type& __p) { this->__generate_impl(__f, __t, __urng, __p); } /** * @brief Return true if two Bernoulli distributions have * the same parameters. */ friend bool operator==(const bernoulli_distribution& __d1, const bernoulli_distribution& __d2) { return __d1._M_param == __d2._M_param; } private: template void __generate_impl(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const param_type& __p); param_type _M_param; }; /** * @brief Return true if two Bernoulli distributions have * different parameters. */ inline bool operator!=(const std::bernoulli_distribution& __d1, const std::bernoulli_distribution& __d2) { return !(__d1 == __d2); } /** * @brief Inserts a %bernoulli_distribution random number distribution * @p __x into the output stream @p __os. * * @param __os An output stream. * @param __x A %bernoulli_distribution random number distribution. * * @returns The output stream with the state of @p __x inserted or in * an error state. */ template std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>& __os, const std::bernoulli_distribution& __x); /** * @brief Extracts a %bernoulli_distribution random number distribution * @p __x from the input stream @p __is. * * @param __is An input stream. * @param __x A %bernoulli_distribution random number generator engine. * * @returns The input stream with @p __x extracted or in an error state. */ template std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>& __is, std::bernoulli_distribution& __x) { double __p; __is >> __p; __x.param(bernoulli_distribution::param_type(__p)); return __is; } /** * @brief A discrete binomial random number distribution. * * The formula for the binomial probability density function is * @f$p(i|t,p) = \binom{t}{i} p^i (1 - p)^{t - i}@f$ where @f$t@f$ * and @f$p@f$ are the parameters of the distribution. */ template class binomial_distribution { static_assert(std::is_integral<_IntType>::value, "template argument not an integral type"); public: /** The type of the range of the distribution. */ typedef _IntType result_type; /** Parameter type. */ struct param_type { typedef binomial_distribution<_IntType> distribution_type; friend class binomial_distribution<_IntType>; explicit param_type(_IntType __t = _IntType(1), double __p = 0.5) : _M_t(__t), _M_p(__p) { _GLIBCXX_DEBUG_ASSERT((_M_t >= _IntType(0)) && (_M_p >= 0.0) && (_M_p <= 1.0)); _M_initialize(); } _IntType t() const { return _M_t; } double p() const { return _M_p; } friend bool operator==(const param_type& __p1, const param_type& __p2) { return __p1._M_t == __p2._M_t && __p1._M_p == __p2._M_p; } private: void _M_initialize(); _IntType _M_t; double _M_p; double _M_q; #if _GLIBCXX_USE_C99_MATH_TR1 double _M_d1, _M_d2, _M_s1, _M_s2, _M_c, _M_a1, _M_a123, _M_s, _M_lf, _M_lp1p; #endif # 3660 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/random.h" 3 bool _M_easy; }; // constructors and member function explicit binomial_distribution(_IntType __t = _IntType(1), double __p = 0.5) : _M_param(__t, __p), _M_nd() { } explicit binomial_distribution(const param_type& __p) : _M_param(__p), _M_nd() { } /** * @brief Resets the distribution state. */ void reset() { _M_nd.reset(); } /** * @brief Returns the distribution @p t parameter. */ _IntType t() const { return _M_param.t(); } /** * @brief Returns the distribution @p p parameter. */ double p() const { return _M_param.p(); } /** * @brief Returns the parameter set of the distribution. */ param_type param() const { return _M_param; } /** * @brief Sets the parameter set of the distribution. * @param __param The new parameter set of the distribution. */ void param(const param_type& __param) { _M_param = __param; } /** * @brief Returns the greatest lower bound value of the distribution. */ result_type min() const { return 0; } /** * @brief Returns the least upper bound value of the distribution. */ result_type max() const { return _M_param.t(); } /** * @brief Generating functions. */ template result_type operator()(_UniformRandomNumberGenerator& __urng) { return this->operator()(__urng, _M_param); } template result_type operator()(_UniformRandomNumberGenerator& __urng, const param_type& __p); template void __generate(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng) { this->__generate(__f, __t, __urng, _M_param); } template void __generate(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const param_type& __p) { this->__generate_impl(__f, __t, __urng, __p); } template void __generate(result_type* __f, result_type* __t, _UniformRandomNumberGenerator& __urng, const param_type& __p) { this->__generate_impl(__f, __t, __urng, __p); } /** * @brief Return true if two binomial distributions have * the same parameters and the sequences that would * be generated are equal. */ friend bool operator==(const binomial_distribution& __d1, const binomial_distribution& __d2) #ifdef _GLIBCXX_USE_C99_MATH_TR1 { return __d1._M_param == __d2._M_param && __d1._M_nd == __d2._M_nd; } #else # 3771 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/random.h" 3 { return __d1._M_param == __d2._M_param; } #endif # 3773 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/random.h" 3 /** * @brief Inserts a %binomial_distribution random number distribution * @p __x into the output stream @p __os. * * @param __os An output stream. * @param __x A %binomial_distribution random number distribution. * * @returns The output stream with the state of @p __x inserted or in * an error state. */ template friend std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>& __os, const std::binomial_distribution<_IntType1>& __x); /** * @brief Extracts a %binomial_distribution random number distribution * @p __x from the input stream @p __is. * * @param __is An input stream. * @param __x A %binomial_distribution random number generator engine. * * @returns The input stream with @p __x extracted or in an error * state. */ template friend std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>& __is, std::binomial_distribution<_IntType1>& __x); private: template void __generate_impl(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const param_type& __p); template result_type _M_waiting(_UniformRandomNumberGenerator& __urng, _IntType __t, double __q); param_type _M_param; // NB: Unused when _GLIBCXX_USE_C99_MATH_TR1 is undefined. std::normal_distribution _M_nd; }; /** * @brief Return true if two binomial distributions are different. */ template inline bool operator!=(const std::binomial_distribution<_IntType>& __d1, const std::binomial_distribution<_IntType>& __d2) { return !(__d1 == __d2); } /** * @brief A discrete geometric random number distribution. * * The formula for the geometric probability density function is * @f$p(i|p) = p(1 - p)^{i}@f$ where @f$p@f$ is the parameter of the * distribution. */ template class geometric_distribution { static_assert(std::is_integral<_IntType>::value, "template argument not an integral type"); public: /** The type of the range of the distribution. */ typedef _IntType result_type; /** Parameter type. */ struct param_type { typedef geometric_distribution<_IntType> distribution_type; friend class geometric_distribution<_IntType>; explicit param_type(double __p = 0.5) : _M_p(__p) { _GLIBCXX_DEBUG_ASSERT((_M_p > 0.0) && (_M_p < 1.0)); _M_initialize(); } double p() const { return _M_p; } friend bool operator==(const param_type& __p1, const param_type& __p2) { return __p1._M_p == __p2._M_p; } private: void _M_initialize() { _M_log_1_p = std::log(1.0 - _M_p); } double _M_p; double _M_log_1_p; }; // constructors and member function explicit geometric_distribution(double __p = 0.5) : _M_param(__p) { } explicit geometric_distribution(const param_type& __p) : _M_param(__p) { } /** * @brief Resets the distribution state. * * Does nothing for the geometric distribution. */ void reset() { } /** * @brief Returns the distribution parameter @p p. */ double p() const { return _M_param.p(); } /** * @brief Returns the parameter set of the distribution. */ param_type param() const { return _M_param; } /** * @brief Sets the parameter set of the distribution. * @param __param The new parameter set of the distribution. */ void param(const param_type& __param) { _M_param = __param; } /** * @brief Returns the greatest lower bound value of the distribution. */ result_type min() const { return 0; } /** * @brief Returns the least upper bound value of the distribution. */ result_type max() const { return std::numeric_limits::max(); } /** * @brief Generating functions. */ template result_type operator()(_UniformRandomNumberGenerator& __urng) { return this->operator()(__urng, _M_param); } template result_type operator()(_UniformRandomNumberGenerator& __urng, const param_type& __p); template void __generate(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng) { this->__generate(__f, __t, __urng, _M_param); } template void __generate(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const param_type& __p) { this->__generate_impl(__f, __t, __urng, __p); } template void __generate(result_type* __f, result_type* __t, _UniformRandomNumberGenerator& __urng, const param_type& __p) { this->__generate_impl(__f, __t, __urng, __p); } /** * @brief Return true if two geometric distributions have * the same parameters. */ friend bool operator==(const geometric_distribution& __d1, const geometric_distribution& __d2) { return __d1._M_param == __d2._M_param; } private: template void __generate_impl(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const param_type& __p); param_type _M_param; }; /** * @brief Return true if two geometric distributions have * different parameters. */ template inline bool operator!=(const std::geometric_distribution<_IntType>& __d1, const std::geometric_distribution<_IntType>& __d2) { return !(__d1 == __d2); } /** * @brief Inserts a %geometric_distribution random number distribution * @p __x into the output stream @p __os. * * @param __os An output stream. * @param __x A %geometric_distribution random number distribution. * * @returns The output stream with the state of @p __x inserted or in * an error state. */ template std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>& __os, const std::geometric_distribution<_IntType>& __x); /** * @brief Extracts a %geometric_distribution random number distribution * @p __x from the input stream @p __is. * * @param __is An input stream. * @param __x A %geometric_distribution random number generator engine. * * @returns The input stream with @p __x extracted or in an error state. */ template std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>& __is, std::geometric_distribution<_IntType>& __x); /** * @brief A negative_binomial_distribution random number distribution. * * The formula for the negative binomial probability mass function is * @f$p(i) = \binom{n}{i} p^i (1 - p)^{t - i}@f$ where @f$t@f$ * and @f$p@f$ are the parameters of the distribution. */ template class negative_binomial_distribution { static_assert(std::is_integral<_IntType>::value, "template argument not an integral type"); public: /** The type of the range of the distribution. */ typedef _IntType result_type; /** Parameter type. */ struct param_type { typedef negative_binomial_distribution<_IntType> distribution_type; explicit param_type(_IntType __k = 1, double __p = 0.5) : _M_k(__k), _M_p(__p) { _GLIBCXX_DEBUG_ASSERT((_M_k > 0) && (_M_p > 0.0) && (_M_p <= 1.0)); } _IntType k() const { return _M_k; } double p() const { return _M_p; } friend bool operator==(const param_type& __p1, const param_type& __p2) { return __p1._M_k == __p2._M_k && __p1._M_p == __p2._M_p; } private: _IntType _M_k; double _M_p; }; explicit negative_binomial_distribution(_IntType __k = 1, double __p = 0.5) : _M_param(__k, __p), _M_gd(__k, (1.0 - __p) / __p) { } explicit negative_binomial_distribution(const param_type& __p) : _M_param(__p), _M_gd(__p.k(), (1.0 - __p.p()) / __p.p()) { } /** * @brief Resets the distribution state. */ void reset() { _M_gd.reset(); } /** * @brief Return the @f$k@f$ parameter of the distribution. */ _IntType k() const { return _M_param.k(); } /** * @brief Return the @f$p@f$ parameter of the distribution. */ double p() const { return _M_param.p(); } /** * @brief Returns the parameter set of the distribution. */ param_type param() const { return _M_param; } /** * @brief Sets the parameter set of the distribution. * @param __param The new parameter set of the distribution. */ void param(const param_type& __param) { _M_param = __param; } /** * @brief Returns the greatest lower bound value of the distribution. */ result_type min() const { return result_type(0); } /** * @brief Returns the least upper bound value of the distribution. */ result_type max() const { return std::numeric_limits::max(); } /** * @brief Generating functions. */ template result_type operator()(_UniformRandomNumberGenerator& __urng); template result_type operator()(_UniformRandomNumberGenerator& __urng, const param_type& __p); template void __generate(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng) { this->__generate_impl(__f, __t, __urng); } template void __generate(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const param_type& __p) { this->__generate_impl(__f, __t, __urng, __p); } template void __generate(result_type* __f, result_type* __t, _UniformRandomNumberGenerator& __urng) { this->__generate_impl(__f, __t, __urng); } template void __generate(result_type* __f, result_type* __t, _UniformRandomNumberGenerator& __urng, const param_type& __p) { this->__generate_impl(__f, __t, __urng, __p); } /** * @brief Return true if two negative binomial distributions have * the same parameters and the sequences that would be * generated are equal. */ friend bool operator==(const negative_binomial_distribution& __d1, const negative_binomial_distribution& __d2) { return __d1._M_param == __d2._M_param && __d1._M_gd == __d2._M_gd; } /** * @brief Inserts a %negative_binomial_distribution random * number distribution @p __x into the output stream @p __os. * * @param __os An output stream. * @param __x A %negative_binomial_distribution random number * distribution. * * @returns The output stream with the state of @p __x inserted or in * an error state. */ template friend std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>& __os, const std::negative_binomial_distribution<_IntType1>& __x); /** * @brief Extracts a %negative_binomial_distribution random number * distribution @p __x from the input stream @p __is. * * @param __is An input stream. * @param __x A %negative_binomial_distribution random number * generator engine. * * @returns The input stream with @p __x extracted or in an error state. */ template friend std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>& __is, std::negative_binomial_distribution<_IntType1>& __x); private: template void __generate_impl(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng); template void __generate_impl(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const param_type& __p); param_type _M_param; std::gamma_distribution _M_gd; }; /** * @brief Return true if two negative binomial distributions are different. */ template inline bool operator!=(const std::negative_binomial_distribution<_IntType>& __d1, const std::negative_binomial_distribution<_IntType>& __d2) { return !(__d1 == __d2); } /* @} */ // group random_distributions_bernoulli /** * @addtogroup random_distributions_poisson Poisson Distributions * @ingroup random_distributions * @{ */ /** * @brief A discrete Poisson random number distribution. * * The formula for the Poisson probability density function is * @f$p(i|\mu) = \frac{\mu^i}{i!} e^{-\mu}@f$ where @f$\mu@f$ is the * parameter of the distribution. */ template class poisson_distribution { static_assert(std::is_integral<_IntType>::value, "template argument not an integral type"); public: /** The type of the range of the distribution. */ typedef _IntType result_type; /** Parameter type. */ struct param_type { typedef poisson_distribution<_IntType> distribution_type; friend class poisson_distribution<_IntType>; explicit param_type(double __mean = 1.0) : _M_mean(__mean) { _GLIBCXX_DEBUG_ASSERT(_M_mean > 0.0); _M_initialize(); } double mean() const { return _M_mean; } friend bool operator==(const param_type& __p1, const param_type& __p2) { return __p1._M_mean == __p2._M_mean; } private: // Hosts either log(mean) or the threshold of the simple method. void _M_initialize(); double _M_mean; double _M_lm_thr; #if _GLIBCXX_USE_C99_MATH_TR1 double _M_lfm, _M_sm, _M_d, _M_scx, _M_1cx, _M_c2b, _M_cb; #endif # 4306 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/random.h" 3 }; // constructors and member function explicit poisson_distribution(double __mean = 1.0) : _M_param(__mean), _M_nd() { } explicit poisson_distribution(const param_type& __p) : _M_param(__p), _M_nd() { } /** * @brief Resets the distribution state. */ void reset() { _M_nd.reset(); } /** * @brief Returns the distribution parameter @p mean. */ double mean() const { return _M_param.mean(); } /** * @brief Returns the parameter set of the distribution. */ param_type param() const { return _M_param; } /** * @brief Sets the parameter set of the distribution. * @param __param The new parameter set of the distribution. */ void param(const param_type& __param) { _M_param = __param; } /** * @brief Returns the greatest lower bound value of the distribution. */ result_type min() const { return 0; } /** * @brief Returns the least upper bound value of the distribution. */ result_type max() const { return std::numeric_limits::max(); } /** * @brief Generating functions. */ template result_type operator()(_UniformRandomNumberGenerator& __urng) { return this->operator()(__urng, _M_param); } template result_type operator()(_UniformRandomNumberGenerator& __urng, const param_type& __p); template void __generate(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng) { this->__generate(__f, __t, __urng, _M_param); } template void __generate(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const param_type& __p) { this->__generate_impl(__f, __t, __urng, __p); } template void __generate(result_type* __f, result_type* __t, _UniformRandomNumberGenerator& __urng, const param_type& __p) { this->__generate_impl(__f, __t, __urng, __p); } /** * @brief Return true if two Poisson distributions have the same * parameters and the sequences that would be generated * are equal. */ friend bool operator==(const poisson_distribution& __d1, const poisson_distribution& __d2) #ifdef _GLIBCXX_USE_C99_MATH_TR1 { return __d1._M_param == __d2._M_param && __d1._M_nd == __d2._M_nd; } #else # 4408 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/random.h" 3 { return __d1._M_param == __d2._M_param; } #endif # 4410 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/random.h" 3 /** * @brief Inserts a %poisson_distribution random number distribution * @p __x into the output stream @p __os. * * @param __os An output stream. * @param __x A %poisson_distribution random number distribution. * * @returns The output stream with the state of @p __x inserted or in * an error state. */ template friend std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>& __os, const std::poisson_distribution<_IntType1>& __x); /** * @brief Extracts a %poisson_distribution random number distribution * @p __x from the input stream @p __is. * * @param __is An input stream. * @param __x A %poisson_distribution random number generator engine. * * @returns The input stream with @p __x extracted or in an error * state. */ template friend std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>& __is, std::poisson_distribution<_IntType1>& __x); private: template void __generate_impl(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const param_type& __p); param_type _M_param; // NB: Unused when _GLIBCXX_USE_C99_MATH_TR1 is undefined. std::normal_distribution _M_nd; }; /** * @brief Return true if two Poisson distributions are different. */ template inline bool operator!=(const std::poisson_distribution<_IntType>& __d1, const std::poisson_distribution<_IntType>& __d2) { return !(__d1 == __d2); } /** * @brief An exponential continuous distribution for random numbers. * * The formula for the exponential probability density function is * @f$p(x|\lambda) = \lambda e^{-\lambda x}@f$. * * * * * * * * *
Distribution Statistics
Mean@f$\frac{1}{\lambda}@f$
Median@f$\frac{\ln 2}{\lambda}@f$
Mode@f$zero@f$
Range@f$[0, \infty]@f$
Standard Deviation@f$\frac{1}{\lambda}@f$
*/ template class exponential_distribution { static_assert(std::is_floating_point<_RealType>::value, "template argument not a floating point type"); public: /** The type of the range of the distribution. */ typedef _RealType result_type; /** Parameter type. */ struct param_type { typedef exponential_distribution<_RealType> distribution_type; explicit param_type(_RealType __lambda = _RealType(1)) : _M_lambda(__lambda) { _GLIBCXX_DEBUG_ASSERT(_M_lambda > _RealType(0)); } _RealType lambda() const { return _M_lambda; } friend bool operator==(const param_type& __p1, const param_type& __p2) { return __p1._M_lambda == __p2._M_lambda; } private: _RealType _M_lambda; }; public: /** * @brief Constructs an exponential distribution with inverse scale * parameter @f$\lambda@f$. */ explicit exponential_distribution(const result_type& __lambda = result_type(1)) : _M_param(__lambda) { } explicit exponential_distribution(const param_type& __p) : _M_param(__p) { } /** * @brief Resets the distribution state. * * Has no effect on exponential distributions. */ void reset() { } /** * @brief Returns the inverse scale parameter of the distribution. */ _RealType lambda() const { return _M_param.lambda(); } /** * @brief Returns the parameter set of the distribution. */ param_type param() const { return _M_param; } /** * @brief Sets the parameter set of the distribution. * @param __param The new parameter set of the distribution. */ void param(const param_type& __param) { _M_param = __param; } /** * @brief Returns the greatest lower bound value of the distribution. */ result_type min() const { return result_type(0); } /** * @brief Returns the least upper bound value of the distribution. */ result_type max() const { return std::numeric_limits::max(); } /** * @brief Generating functions. */ template result_type operator()(_UniformRandomNumberGenerator& __urng) { return this->operator()(__urng, _M_param); } template result_type operator()(_UniformRandomNumberGenerator& __urng, const param_type& __p) { __detail::_Adaptor<_UniformRandomNumberGenerator, result_type> __aurng(__urng); return -std::log(result_type(1) - __aurng()) / __p.lambda(); } template void __generate(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng) { this->__generate(__f, __t, __urng, _M_param); } template void __generate(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const param_type& __p) { this->__generate_impl(__f, __t, __urng, __p); } template void __generate(result_type* __f, result_type* __t, _UniformRandomNumberGenerator& __urng, const param_type& __p) { this->__generate_impl(__f, __t, __urng, __p); } /** * @brief Return true if two exponential distributions have the same * parameters. */ friend bool operator==(const exponential_distribution& __d1, const exponential_distribution& __d2) { return __d1._M_param == __d2._M_param; } private: template void __generate_impl(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const param_type& __p); param_type _M_param; }; /** * @brief Return true if two exponential distributions have different * parameters. */ template inline bool operator!=(const std::exponential_distribution<_RealType>& __d1, const std::exponential_distribution<_RealType>& __d2) { return !(__d1 == __d2); } /** * @brief Inserts a %exponential_distribution random number distribution * @p __x into the output stream @p __os. * * @param __os An output stream. * @param __x A %exponential_distribution random number distribution. * * @returns The output stream with the state of @p __x inserted or in * an error state. */ template std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>& __os, const std::exponential_distribution<_RealType>& __x); /** * @brief Extracts a %exponential_distribution random number distribution * @p __x from the input stream @p __is. * * @param __is An input stream. * @param __x A %exponential_distribution random number * generator engine. * * @returns The input stream with @p __x extracted or in an error state. */ template std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>& __is, std::exponential_distribution<_RealType>& __x); /** * @brief A weibull_distribution random number distribution. * * The formula for the normal probability density function is: * @f[ * p(x|\alpha,\beta) = \frac{\alpha}{\beta} (\frac{x}{\beta})^{\alpha-1} * \exp{(-(\frac{x}{\beta})^\alpha)} * @f] */ template class weibull_distribution { static_assert(std::is_floating_point<_RealType>::value, "template argument not a floating point type"); public: /** The type of the range of the distribution. */ typedef _RealType result_type; /** Parameter type. */ struct param_type { typedef weibull_distribution<_RealType> distribution_type; explicit param_type(_RealType __a = _RealType(1), _RealType __b = _RealType(1)) : _M_a(__a), _M_b(__b) { } _RealType a() const { return _M_a; } _RealType b() const { return _M_b; } friend bool operator==(const param_type& __p1, const param_type& __p2) { return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; } private: _RealType _M_a; _RealType _M_b; }; explicit weibull_distribution(_RealType __a = _RealType(1), _RealType __b = _RealType(1)) : _M_param(__a, __b) { } explicit weibull_distribution(const param_type& __p) : _M_param(__p) { } /** * @brief Resets the distribution state. */ void reset() { } /** * @brief Return the @f$a@f$ parameter of the distribution. */ _RealType a() const { return _M_param.a(); } /** * @brief Return the @f$b@f$ parameter of the distribution. */ _RealType b() const { return _M_param.b(); } /** * @brief Returns the parameter set of the distribution. */ param_type param() const { return _M_param; } /** * @brief Sets the parameter set of the distribution. * @param __param The new parameter set of the distribution. */ void param(const param_type& __param) { _M_param = __param; } /** * @brief Returns the greatest lower bound value of the distribution. */ result_type min() const { return result_type(0); } /** * @brief Returns the least upper bound value of the distribution. */ result_type max() const { return std::numeric_limits::max(); } /** * @brief Generating functions. */ template result_type operator()(_UniformRandomNumberGenerator& __urng) { return this->operator()(__urng, _M_param); } template result_type operator()(_UniformRandomNumberGenerator& __urng, const param_type& __p); template void __generate(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng) { this->__generate(__f, __t, __urng, _M_param); } template void __generate(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const param_type& __p) { this->__generate_impl(__f, __t, __urng, __p); } template void __generate(result_type* __f, result_type* __t, _UniformRandomNumberGenerator& __urng, const param_type& __p) { this->__generate_impl(__f, __t, __urng, __p); } /** * @brief Return true if two Weibull distributions have the same * parameters. */ friend bool operator==(const weibull_distribution& __d1, const weibull_distribution& __d2) { return __d1._M_param == __d2._M_param; } private: template void __generate_impl(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const param_type& __p); param_type _M_param; }; /** * @brief Return true if two Weibull distributions have different * parameters. */ template inline bool operator!=(const std::weibull_distribution<_RealType>& __d1, const std::weibull_distribution<_RealType>& __d2) { return !(__d1 == __d2); } /** * @brief Inserts a %weibull_distribution random number distribution * @p __x into the output stream @p __os. * * @param __os An output stream. * @param __x A %weibull_distribution random number distribution. * * @returns The output stream with the state of @p __x inserted or in * an error state. */ template std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>& __os, const std::weibull_distribution<_RealType>& __x); /** * @brief Extracts a %weibull_distribution random number distribution * @p __x from the input stream @p __is. * * @param __is An input stream. * @param __x A %weibull_distribution random number * generator engine. * * @returns The input stream with @p __x extracted or in an error state. */ template std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>& __is, std::weibull_distribution<_RealType>& __x); /** * @brief A extreme_value_distribution random number distribution. * * The formula for the normal probability mass function is * @f[ * p(x|a,b) = \frac{1}{b} * \exp( \frac{a-x}{b} - \exp(\frac{a-x}{b})) * @f] */ template class extreme_value_distribution { static_assert(std::is_floating_point<_RealType>::value, "template argument not a floating point type"); public: /** The type of the range of the distribution. */ typedef _RealType result_type; /** Parameter type. */ struct param_type { typedef extreme_value_distribution<_RealType> distribution_type; explicit param_type(_RealType __a = _RealType(0), _RealType __b = _RealType(1)) : _M_a(__a), _M_b(__b) { } _RealType a() const { return _M_a; } _RealType b() const { return _M_b; } friend bool operator==(const param_type& __p1, const param_type& __p2) { return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; } private: _RealType _M_a; _RealType _M_b; }; explicit extreme_value_distribution(_RealType __a = _RealType(0), _RealType __b = _RealType(1)) : _M_param(__a, __b) { } explicit extreme_value_distribution(const param_type& __p) : _M_param(__p) { } /** * @brief Resets the distribution state. */ void reset() { } /** * @brief Return the @f$a@f$ parameter of the distribution. */ _RealType a() const { return _M_param.a(); } /** * @brief Return the @f$b@f$ parameter of the distribution. */ _RealType b() const { return _M_param.b(); } /** * @brief Returns the parameter set of the distribution. */ param_type param() const { return _M_param; } /** * @brief Sets the parameter set of the distribution. * @param __param The new parameter set of the distribution. */ void param(const param_type& __param) { _M_param = __param; } /** * @brief Returns the greatest lower bound value of the distribution. */ result_type min() const { return std::numeric_limits::lowest(); } /** * @brief Returns the least upper bound value of the distribution. */ result_type max() const { return std::numeric_limits::max(); } /** * @brief Generating functions. */ template result_type operator()(_UniformRandomNumberGenerator& __urng) { return this->operator()(__urng, _M_param); } template result_type operator()(_UniformRandomNumberGenerator& __urng, const param_type& __p); template void __generate(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng) { this->__generate(__f, __t, __urng, _M_param); } template void __generate(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const param_type& __p) { this->__generate_impl(__f, __t, __urng, __p); } template void __generate(result_type* __f, result_type* __t, _UniformRandomNumberGenerator& __urng, const param_type& __p) { this->__generate_impl(__f, __t, __urng, __p); } /** * @brief Return true if two extreme value distributions have the same * parameters. */ friend bool operator==(const extreme_value_distribution& __d1, const extreme_value_distribution& __d2) { return __d1._M_param == __d2._M_param; } private: template void __generate_impl(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const param_type& __p); param_type _M_param; }; /** * @brief Return true if two extreme value distributions have different * parameters. */ template inline bool operator!=(const std::extreme_value_distribution<_RealType>& __d1, const std::extreme_value_distribution<_RealType>& __d2) { return !(__d1 == __d2); } /** * @brief Inserts a %extreme_value_distribution random number distribution * @p __x into the output stream @p __os. * * @param __os An output stream. * @param __x A %extreme_value_distribution random number distribution. * * @returns The output stream with the state of @p __x inserted or in * an error state. */ template std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>& __os, const std::extreme_value_distribution<_RealType>& __x); /** * @brief Extracts a %extreme_value_distribution random number * distribution @p __x from the input stream @p __is. * * @param __is An input stream. * @param __x A %extreme_value_distribution random number * generator engine. * * @returns The input stream with @p __x extracted or in an error state. */ template std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>& __is, std::extreme_value_distribution<_RealType>& __x); /** * @brief A discrete_distribution random number distribution. * * The formula for the discrete probability mass function is * */ template class discrete_distribution { static_assert(std::is_integral<_IntType>::value, "template argument not an integral type"); public: /** The type of the range of the distribution. */ typedef _IntType result_type; /** Parameter type. */ struct param_type { typedef discrete_distribution<_IntType> distribution_type; friend class discrete_distribution<_IntType>; param_type() : _M_prob(), _M_cp() { } template param_type(_InputIterator __wbegin, _InputIterator __wend) : _M_prob(__wbegin, __wend), _M_cp() { _M_initialize(); } param_type(initializer_list __wil) : _M_prob(__wil.begin(), __wil.end()), _M_cp() { _M_initialize(); } template param_type(size_t __nw, double __xmin, double __xmax, _Func __fw); // See: http://cpp-next.com/archive/2010/10/implicit-move-must-go/ param_type(const param_type&) = default; param_type& operator=(const param_type&) = default; std::vector probabilities() const { return _M_prob.empty() ? std::vector(1, 1.0) : _M_prob; } friend bool operator==(const param_type& __p1, const param_type& __p2) { return __p1._M_prob == __p2._M_prob; } private: void _M_initialize(); std::vector _M_prob; std::vector _M_cp; }; discrete_distribution() : _M_param() { } template discrete_distribution(_InputIterator __wbegin, _InputIterator __wend) : _M_param(__wbegin, __wend) { } discrete_distribution(initializer_list __wl) : _M_param(__wl) { } template discrete_distribution(size_t __nw, double __xmin, double __xmax, _Func __fw) : _M_param(__nw, __xmin, __xmax, __fw) { } explicit discrete_distribution(const param_type& __p) : _M_param(__p) { } /** * @brief Resets the distribution state. */ void reset() { } /** * @brief Returns the probabilities of the distribution. */ std::vector probabilities() const { return _M_param._M_prob.empty() ? std::vector(1, 1.0) : _M_param._M_prob; } /** * @brief Returns the parameter set of the distribution. */ param_type param() const { return _M_param; } /** * @brief Sets the parameter set of the distribution. * @param __param The new parameter set of the distribution. */ void param(const param_type& __param) { _M_param = __param; } /** * @brief Returns the greatest lower bound value of the distribution. */ result_type min() const { return result_type(0); } /** * @brief Returns the least upper bound value of the distribution. */ result_type max() const { return _M_param._M_prob.empty() ? result_type(0) : result_type(_M_param._M_prob.size() - 1); } /** * @brief Generating functions. */ template result_type operator()(_UniformRandomNumberGenerator& __urng) { return this->operator()(__urng, _M_param); } template result_type operator()(_UniformRandomNumberGenerator& __urng, const param_type& __p); template void __generate(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng) { this->__generate(__f, __t, __urng, _M_param); } template void __generate(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const param_type& __p) { this->__generate_impl(__f, __t, __urng, __p); } template void __generate(result_type* __f, result_type* __t, _UniformRandomNumberGenerator& __urng, const param_type& __p) { this->__generate_impl(__f, __t, __urng, __p); } /** * @brief Return true if two discrete distributions have the same * parameters. */ friend bool operator==(const discrete_distribution& __d1, const discrete_distribution& __d2) { return __d1._M_param == __d2._M_param; } /** * @brief Inserts a %discrete_distribution random number distribution * @p __x into the output stream @p __os. * * @param __os An output stream. * @param __x A %discrete_distribution random number distribution. * * @returns The output stream with the state of @p __x inserted or in * an error state. */ template friend std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>& __os, const std::discrete_distribution<_IntType1>& __x); /** * @brief Extracts a %discrete_distribution random number distribution * @p __x from the input stream @p __is. * * @param __is An input stream. * @param __x A %discrete_distribution random number * generator engine. * * @returns The input stream with @p __x extracted or in an error * state. */ template friend std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>& __is, std::discrete_distribution<_IntType1>& __x); private: template void __generate_impl(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const param_type& __p); param_type _M_param; }; /** * @brief Return true if two discrete distributions have different * parameters. */ template inline bool operator!=(const std::discrete_distribution<_IntType>& __d1, const std::discrete_distribution<_IntType>& __d2) { return !(__d1 == __d2); } /** * @brief A piecewise_constant_distribution random number distribution. * * The formula for the piecewise constant probability mass function is * */ template class piecewise_constant_distribution { static_assert(std::is_floating_point<_RealType>::value, "template argument not a floating point type"); public: /** The type of the range of the distribution. */ typedef _RealType result_type; /** Parameter type. */ struct param_type { typedef piecewise_constant_distribution<_RealType> distribution_type; friend class piecewise_constant_distribution<_RealType>; param_type() : _M_int(), _M_den(), _M_cp() { } template param_type(_InputIteratorB __bfirst, _InputIteratorB __bend, _InputIteratorW __wbegin); template param_type(initializer_list<_RealType> __bi, _Func __fw); template param_type(size_t __nw, _RealType __xmin, _RealType __xmax, _Func __fw); // See: http://cpp-next.com/archive/2010/10/implicit-move-must-go/ param_type(const param_type&) = default; param_type& operator=(const param_type&) = default; std::vector<_RealType> intervals() const { if (_M_int.empty()) { std::vector<_RealType> __tmp(2); __tmp[1] = _RealType(1); return __tmp; } else return _M_int; } std::vector densities() const { return _M_den.empty() ? std::vector(1, 1.0) : _M_den; } friend bool operator==(const param_type& __p1, const param_type& __p2) { return __p1._M_int == __p2._M_int && __p1._M_den == __p2._M_den; } private: void _M_initialize(); std::vector<_RealType> _M_int; std::vector _M_den; std::vector _M_cp; }; explicit piecewise_constant_distribution() : _M_param() { } template piecewise_constant_distribution(_InputIteratorB __bfirst, _InputIteratorB __bend, _InputIteratorW __wbegin) : _M_param(__bfirst, __bend, __wbegin) { } template piecewise_constant_distribution(initializer_list<_RealType> __bl, _Func __fw) : _M_param(__bl, __fw) { } template piecewise_constant_distribution(size_t __nw, _RealType __xmin, _RealType __xmax, _Func __fw) : _M_param(__nw, __xmin, __xmax, __fw) { } explicit piecewise_constant_distribution(const param_type& __p) : _M_param(__p) { } /** * @brief Resets the distribution state. */ void reset() { } /** * @brief Returns a vector of the intervals. */ std::vector<_RealType> intervals() const { if (_M_param._M_int.empty()) { std::vector<_RealType> __tmp(2); __tmp[1] = _RealType(1); return __tmp; } else return _M_param._M_int; } /** * @brief Returns a vector of the probability densities. */ std::vector densities() const { return _M_param._M_den.empty() ? std::vector(1, 1.0) : _M_param._M_den; } /** * @brief Returns the parameter set of the distribution. */ param_type param() const { return _M_param; } /** * @brief Sets the parameter set of the distribution. * @param __param The new parameter set of the distribution. */ void param(const param_type& __param) { _M_param = __param; } /** * @brief Returns the greatest lower bound value of the distribution. */ result_type min() const { return _M_param._M_int.empty() ? result_type(0) : _M_param._M_int.front(); } /** * @brief Returns the least upper bound value of the distribution. */ result_type max() const { return _M_param._M_int.empty() ? result_type(1) : _M_param._M_int.back(); } /** * @brief Generating functions. */ template result_type operator()(_UniformRandomNumberGenerator& __urng) { return this->operator()(__urng, _M_param); } template result_type operator()(_UniformRandomNumberGenerator& __urng, const param_type& __p); template void __generate(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng) { this->__generate(__f, __t, __urng, _M_param); } template void __generate(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const param_type& __p) { this->__generate_impl(__f, __t, __urng, __p); } template void __generate(result_type* __f, result_type* __t, _UniformRandomNumberGenerator& __urng, const param_type& __p) { this->__generate_impl(__f, __t, __urng, __p); } /** * @brief Return true if two piecewise constant distributions have the * same parameters. */ friend bool operator==(const piecewise_constant_distribution& __d1, const piecewise_constant_distribution& __d2) { return __d1._M_param == __d2._M_param; } /** * @brief Inserts a %piecewise_constant_distribution random * number distribution @p __x into the output stream @p __os. * * @param __os An output stream. * @param __x A %piecewise_constant_distribution random number * distribution. * * @returns The output stream with the state of @p __x inserted or in * an error state. */ template friend std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>& __os, const std::piecewise_constant_distribution<_RealType1>& __x); /** * @brief Extracts a %piecewise_constant_distribution random * number distribution @p __x from the input stream @p __is. * * @param __is An input stream. * @param __x A %piecewise_constant_distribution random number * generator engine. * * @returns The input stream with @p __x extracted or in an error * state. */ template friend std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>& __is, std::piecewise_constant_distribution<_RealType1>& __x); private: template void __generate_impl(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const param_type& __p); param_type _M_param; }; /** * @brief Return true if two piecewise constant distributions have * different parameters. */ template inline bool operator!=(const std::piecewise_constant_distribution<_RealType>& __d1, const std::piecewise_constant_distribution<_RealType>& __d2) { return !(__d1 == __d2); } /** * @brief A piecewise_linear_distribution random number distribution. * * The formula for the piecewise linear probability mass function is * */ template class piecewise_linear_distribution { static_assert(std::is_floating_point<_RealType>::value, "template argument not a floating point type"); public: /** The type of the range of the distribution. */ typedef _RealType result_type; /** Parameter type. */ struct param_type { typedef piecewise_linear_distribution<_RealType> distribution_type; friend class piecewise_linear_distribution<_RealType>; param_type() : _M_int(), _M_den(), _M_cp(), _M_m() { } template param_type(_InputIteratorB __bfirst, _InputIteratorB __bend, _InputIteratorW __wbegin); template param_type(initializer_list<_RealType> __bl, _Func __fw); template param_type(size_t __nw, _RealType __xmin, _RealType __xmax, _Func __fw); // See: http://cpp-next.com/archive/2010/10/implicit-move-must-go/ param_type(const param_type&) = default; param_type& operator=(const param_type&) = default; std::vector<_RealType> intervals() const { if (_M_int.empty()) { std::vector<_RealType> __tmp(2); __tmp[1] = _RealType(1); return __tmp; } else return _M_int; } std::vector densities() const { return _M_den.empty() ? std::vector(2, 1.0) : _M_den; } friend bool operator==(const param_type& __p1, const param_type& __p2) { return (__p1._M_int == __p2._M_int && __p1._M_den == __p2._M_den); } private: void _M_initialize(); std::vector<_RealType> _M_int; std::vector _M_den; std::vector _M_cp; std::vector _M_m; }; explicit piecewise_linear_distribution() : _M_param() { } template piecewise_linear_distribution(_InputIteratorB __bfirst, _InputIteratorB __bend, _InputIteratorW __wbegin) : _M_param(__bfirst, __bend, __wbegin) { } template piecewise_linear_distribution(initializer_list<_RealType> __bl, _Func __fw) : _M_param(__bl, __fw) { } template piecewise_linear_distribution(size_t __nw, _RealType __xmin, _RealType __xmax, _Func __fw) : _M_param(__nw, __xmin, __xmax, __fw) { } explicit piecewise_linear_distribution(const param_type& __p) : _M_param(__p) { } /** * Resets the distribution state. */ void reset() { } /** * @brief Return the intervals of the distribution. */ std::vector<_RealType> intervals() const { if (_M_param._M_int.empty()) { std::vector<_RealType> __tmp(2); __tmp[1] = _RealType(1); return __tmp; } else return _M_param._M_int; } /** * @brief Return a vector of the probability densities of the * distribution. */ std::vector densities() const { return _M_param._M_den.empty() ? std::vector(2, 1.0) : _M_param._M_den; } /** * @brief Returns the parameter set of the distribution. */ param_type param() const { return _M_param; } /** * @brief Sets the parameter set of the distribution. * @param __param The new parameter set of the distribution. */ void param(const param_type& __param) { _M_param = __param; } /** * @brief Returns the greatest lower bound value of the distribution. */ result_type min() const { return _M_param._M_int.empty() ? result_type(0) : _M_param._M_int.front(); } /** * @brief Returns the least upper bound value of the distribution. */ result_type max() const { return _M_param._M_int.empty() ? result_type(1) : _M_param._M_int.back(); } /** * @brief Generating functions. */ template result_type operator()(_UniformRandomNumberGenerator& __urng) { return this->operator()(__urng, _M_param); } template result_type operator()(_UniformRandomNumberGenerator& __urng, const param_type& __p); template void __generate(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng) { this->__generate(__f, __t, __urng, _M_param); } template void __generate(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const param_type& __p) { this->__generate_impl(__f, __t, __urng, __p); } template void __generate(result_type* __f, result_type* __t, _UniformRandomNumberGenerator& __urng, const param_type& __p) { this->__generate_impl(__f, __t, __urng, __p); } /** * @brief Return true if two piecewise linear distributions have the * same parameters. */ friend bool operator==(const piecewise_linear_distribution& __d1, const piecewise_linear_distribution& __d2) { return __d1._M_param == __d2._M_param; } /** * @brief Inserts a %piecewise_linear_distribution random number * distribution @p __x into the output stream @p __os. * * @param __os An output stream. * @param __x A %piecewise_linear_distribution random number * distribution. * * @returns The output stream with the state of @p __x inserted or in * an error state. */ template friend std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>& __os, const std::piecewise_linear_distribution<_RealType1>& __x); /** * @brief Extracts a %piecewise_linear_distribution random number * distribution @p __x from the input stream @p __is. * * @param __is An input stream. * @param __x A %piecewise_linear_distribution random number * generator engine. * * @returns The input stream with @p __x extracted or in an error * state. */ template friend std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>& __is, std::piecewise_linear_distribution<_RealType1>& __x); private: template void __generate_impl(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const param_type& __p); param_type _M_param; }; /** * @brief Return true if two piecewise linear distributions have * different parameters. */ template inline bool operator!=(const std::piecewise_linear_distribution<_RealType>& __d1, const std::piecewise_linear_distribution<_RealType>& __d2) { return !(__d1 == __d2); } /* @} */ // group random_distributions_poisson /* @} */ // group random_distributions /** * @addtogroup random_utilities Random Number Utilities * @ingroup random * @{ */ /** * @brief The seed_seq class generates sequences of seeds for random * number generators. */ class seed_seq { public: /** The type of the seed vales. */ typedef uint_least32_t result_type; /** Default constructor. */ seed_seq() : _M_v() { } template seed_seq(std::initializer_list<_IntType> il); template seed_seq(_InputIterator __begin, _InputIterator __end); // generating functions template void generate(_RandomAccessIterator __begin, _RandomAccessIterator __end); // property functions size_t size() const { return _M_v.size(); } template void param(OutputIterator __dest) const { std::copy(_M_v.begin(), _M_v.end(), __dest); } private: /// std::vector _M_v; }; /* @} */ // group random_utilities /* @} */ // group random _GLIBCXX_END_NAMESPACE_VERSION } // namespace std #endif # 5905 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/random.h" 3 # 50 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/random" 2 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 50 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/random" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/opt_random.h" 1 3 // Optimizations for random number functions, x86 version -*- C++ -*- // Copyright (C) 2012-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file bits/opt_random.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{random} */ #ifndef _BITS_OPT_RANDOM_H #define _BITS_OPT_RANDOM_H 1 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 33 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/opt_random.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/x86intrin.h" 1 3 /*===---- x86intrin.h - X86 intrinsics -------------------------------------=== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __X86INTRIN_H #define __X86INTRIN_H #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/x86intrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/ia32intrin.h" 1 3 /* ===-------- ia32intrin.h ---------------------------------------------------=== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __X86INTRIN_H #error "Never use directly; include instead." #endif # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/ia32intrin.h" 3 #ifndef __IA32INTRIN_H #define __IA32INTRIN_H #ifdef __x86_64__ static __inline__ unsigned long long __attribute__((__always_inline__, __nodebug__)) __readeflags(void) { return __builtin_ia32_readeflags_u64(); } static __inline__ void __attribute__((__always_inline__, __nodebug__)) __writeeflags(unsigned long long __f) { __builtin_ia32_writeeflags_u64(__f); } #else /* !__x86_64__ */ # 45 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/ia32intrin.h" 3 static __inline__ unsigned int __attribute__((__always_inline__, __nodebug__)) __readeflags(void) { return __builtin_ia32_readeflags_u32(); } static __inline__ void __attribute__((__always_inline__, __nodebug__)) __writeeflags(unsigned int __f) { __builtin_ia32_writeeflags_u32(__f); } #endif /* !__x86_64__ */ # 57 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/ia32intrin.h" 3 static __inline__ unsigned long long __attribute__((__always_inline__, __nodebug__)) __rdpmc(int __A) { return __builtin_ia32_rdpmc(__A); } /* __rdtscp */ static __inline__ unsigned long long __attribute__((__always_inline__, __nodebug__)) __rdtscp(unsigned int *__A) { return __builtin_ia32_rdtscp(__A); } #define _rdtsc() __rdtsc() #define _rdpmc(A) __rdpmc(A) #endif /* __IA32INTRIN_H */ # 74 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/ia32intrin.h" 3 # 28 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/x86intrin.h" 2 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 29 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/x86intrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 1 3 /*===---- immintrin.h - Intel intrinsics -----------------------------------=== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __IMMINTRIN_H #define __IMMINTRIN_H #if !defined(_MSC_VER) || __has_feature(modules) || defined(__MMX__) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 28 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/mmintrin.h" 1 3 /*===---- mmintrin.h - MMX intrinsics --------------------------------------=== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __MMINTRIN_H #define __MMINTRIN_H typedef long long __m64 __attribute__((__vector_size__(8))); typedef long long __v1di __attribute__((__vector_size__(8))); typedef int __v2si __attribute__((__vector_size__(8))); typedef short __v4hi __attribute__((__vector_size__(8))); typedef char __v8qi __attribute__((__vector_size__(8))); /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("mmx"))) /// \brief Clears the MMX state by setting the state of the x87 stack registers /// to empty. /// /// \headerfile /// /// This intrinsic corresponds to the EMMS instruction. /// static __inline__ void __DEFAULT_FN_ATTRS _mm_empty(void) { __builtin_ia32_emms(); } /// \brief Constructs a 64-bit integer vector, setting the lower 32 bits to the /// value of the 32-bit integer parameter and setting the upper 32 bits to 0. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVD / MOVD instruction. /// /// \param __i /// A 32-bit integer value. /// \returns A 64-bit integer vector. The lower 32 bits contain the value of the /// parameter. The upper 32 bits are set to 0. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_cvtsi32_si64(int __i) { return (__m64)__builtin_ia32_vec_init_v2si(__i, 0); } /// \brief Returns the lower 32 bits of a 64-bit integer vector as a 32-bit /// signed integer. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVD / MOVD instruction. /// /// \param __m /// A 64-bit integer vector. /// \returns A 32-bit signed integer value containing the lower 32 bits of the /// parameter. static __inline__ int __DEFAULT_FN_ATTRS _mm_cvtsi64_si32(__m64 __m) { return __builtin_ia32_vec_ext_v2si((__v2si)__m, 0); } /// \brief Casts a 64-bit signed integer value into a 64-bit integer vector. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVQ / MOVD instruction. /// /// \param __i /// A 64-bit signed integer. /// \returns A 64-bit integer vector containing the same bitwise pattern as the /// parameter. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_cvtsi64_m64(long long __i) { return (__m64)__i; } /// \brief Casts a 64-bit integer vector into a 64-bit signed integer value. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVQ / MOVD instruction. /// /// \param __m /// A 64-bit integer vector. /// \returns A 64-bit signed integer containing the same bitwise pattern as the /// parameter. static __inline__ long long __DEFAULT_FN_ATTRS _mm_cvtm64_si64(__m64 __m) { return (long long)__m; } /// \brief Converts 16-bit signed integers from both 64-bit integer vector /// parameters of [4 x i16] into 8-bit signed integer values, and constructs /// a 64-bit integer vector of [8 x i8] as the result. Positive values /// greater than 0x7F are saturated to 0x7F. Negative values less than 0x80 /// are saturated to 0x80. /// /// \headerfile /// /// This intrinsic corresponds to the PACKSSWB instruction. /// /// \param __m1 /// A 64-bit integer vector of [4 x i16]. Each 16-bit element is treated as a /// 16-bit signed integer and is converted to an 8-bit signed integer with /// saturation. Positive values greater than 0x7F are saturated to 0x7F. /// Negative values less than 0x80 are saturated to 0x80. The converted /// [4 x i8] values are written to the lower 32 bits of the result. /// \param __m2 /// A 64-bit integer vector of [4 x i16]. Each 16-bit element is treated as a /// 16-bit signed integer and is converted to an 8-bit signed integer with /// saturation. Positive values greater than 0x7F are saturated to 0x7F. /// Negative values less than 0x80 are saturated to 0x80. The converted /// [4 x i8] values are written to the upper 32 bits of the result. /// \returns A 64-bit integer vector of [8 x i8] containing the converted /// values. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_packs_pi16(__m64 __m1, __m64 __m2) { return (__m64)__builtin_ia32_packsswb((__v4hi)__m1, (__v4hi)__m2); } /// \brief Converts 32-bit signed integers from both 64-bit integer vector /// parameters of [2 x i32] into 16-bit signed integer values, and constructs /// a 64-bit integer vector of [4 x i16] as the result. Positive values /// greater than 0x7FFF are saturated to 0x7FFF. Negative values less than /// 0x8000 are saturated to 0x8000. /// /// \headerfile /// /// This intrinsic corresponds to the PACKSSDW instruction. /// /// \param __m1 /// A 64-bit integer vector of [2 x i32]. Each 32-bit element is treated as a /// 32-bit signed integer and is converted to a 16-bit signed integer with /// saturation. Positive values greater than 0x7FFF are saturated to 0x7FFF. /// Negative values less than 0x8000 are saturated to 0x8000. The converted /// [2 x i16] values are written to the lower 32 bits of the result. /// \param __m2 /// A 64-bit integer vector of [2 x i32]. Each 32-bit element is treated as a /// 32-bit signed integer and is converted to a 16-bit signed integer with /// saturation. Positive values greater than 0x7FFF are saturated to 0x7FFF. /// Negative values less than 0x8000 are saturated to 0x8000. The converted /// [2 x i16] values are written to the upper 32 bits of the result. /// \returns A 64-bit integer vector of [4 x i16] containing the converted /// values. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_packs_pi32(__m64 __m1, __m64 __m2) { return (__m64)__builtin_ia32_packssdw((__v2si)__m1, (__v2si)__m2); } /// \brief Converts 16-bit signed integers from both 64-bit integer vector /// parameters of [4 x i16] into 8-bit unsigned integer values, and /// constructs a 64-bit integer vector of [8 x i8] as the result. Values /// greater than 0xFF are saturated to 0xFF. Values less than 0 are saturated /// to 0. /// /// \headerfile /// /// This intrinsic corresponds to the PACKUSWB instruction. /// /// \param __m1 /// A 64-bit integer vector of [4 x i16]. Each 16-bit element is treated as a /// 16-bit signed integer and is converted to an 8-bit unsigned integer with /// saturation. Values greater than 0xFF are saturated to 0xFF. Values less /// than 0 are saturated to 0. The converted [4 x i8] values are written to /// the lower 32 bits of the result. /// \param __m2 /// A 64-bit integer vector of [4 x i16]. Each 16-bit element is treated as a /// 16-bit signed integer and is converted to an 8-bit unsigned integer with /// saturation. Values greater than 0xFF are saturated to 0xFF. Values less /// than 0 are saturated to 0. The converted [4 x i8] values are written to /// the upper 32 bits of the result. /// \returns A 64-bit integer vector of [8 x i8] containing the converted /// values. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_packs_pu16(__m64 __m1, __m64 __m2) { return (__m64)__builtin_ia32_packuswb((__v4hi)__m1, (__v4hi)__m2); } /// \brief Unpacks the upper 32 bits from two 64-bit integer vectors of [8 x i8] /// and interleaves them into a 64-bit integer vector of [8 x i8]. /// /// \headerfile /// /// This intrinsic corresponds to the PUNPCKHBW instruction. /// /// \param __m1 /// A 64-bit integer vector of [8 x i8]. \n /// Bits [39:32] are written to bits [7:0] of the result. \n /// Bits [47:40] are written to bits [23:16] of the result. \n /// Bits [55:48] are written to bits [39:32] of the result. \n /// Bits [63:56] are written to bits [55:48] of the result. /// \param __m2 /// A 64-bit integer vector of [8 x i8]. /// Bits [39:32] are written to bits [15:8] of the result. \n /// Bits [47:40] are written to bits [31:24] of the result. \n /// Bits [55:48] are written to bits [47:40] of the result. \n /// Bits [63:56] are written to bits [63:56] of the result. /// \returns A 64-bit integer vector of [8 x i8] containing the interleaved /// values. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_unpackhi_pi8(__m64 __m1, __m64 __m2) { return (__m64)__builtin_ia32_punpckhbw((__v8qi)__m1, (__v8qi)__m2); } /// \brief Unpacks the upper 32 bits from two 64-bit integer vectors of /// [4 x i16] and interleaves them into a 64-bit integer vector of [4 x i16]. /// /// \headerfile /// /// This intrinsic corresponds to the PUNPCKHWD instruction. /// /// \param __m1 /// A 64-bit integer vector of [4 x i16]. /// Bits [47:32] are written to bits [15:0] of the result. \n /// Bits [63:48] are written to bits [47:32] of the result. /// \param __m2 /// A 64-bit integer vector of [4 x i16]. /// Bits [47:32] are written to bits [31:16] of the result. \n /// Bits [63:48] are written to bits [63:48] of the result. /// \returns A 64-bit integer vector of [4 x i16] containing the interleaved /// values. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_unpackhi_pi16(__m64 __m1, __m64 __m2) { return (__m64)__builtin_ia32_punpckhwd((__v4hi)__m1, (__v4hi)__m2); } /// \brief Unpacks the upper 32 bits from two 64-bit integer vectors of /// [2 x i32] and interleaves them into a 64-bit integer vector of [2 x i32]. /// /// \headerfile /// /// This intrinsic corresponds to the PUNPCKHDQ instruction. /// /// \param __m1 /// A 64-bit integer vector of [2 x i32]. The upper 32 bits are written to /// the lower 32 bits of the result. /// \param __m2 /// A 64-bit integer vector of [2 x i32]. The upper 32 bits are written to /// the upper 32 bits of the result. /// \returns A 64-bit integer vector of [2 x i32] containing the interleaved /// values. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_unpackhi_pi32(__m64 __m1, __m64 __m2) { return (__m64)__builtin_ia32_punpckhdq((__v2si)__m1, (__v2si)__m2); } /// \brief Unpacks the lower 32 bits from two 64-bit integer vectors of [8 x i8] /// and interleaves them into a 64-bit integer vector of [8 x i8]. /// /// \headerfile /// /// This intrinsic corresponds to the PUNPCKLBW instruction. /// /// \param __m1 /// A 64-bit integer vector of [8 x i8]. /// Bits [7:0] are written to bits [7:0] of the result. \n /// Bits [15:8] are written to bits [23:16] of the result. \n /// Bits [23:16] are written to bits [39:32] of the result. \n /// Bits [31:24] are written to bits [55:48] of the result. /// \param __m2 /// A 64-bit integer vector of [8 x i8]. /// Bits [7:0] are written to bits [15:8] of the result. \n /// Bits [15:8] are written to bits [31:24] of the result. \n /// Bits [23:16] are written to bits [47:40] of the result. \n /// Bits [31:24] are written to bits [63:56] of the result. /// \returns A 64-bit integer vector of [8 x i8] containing the interleaved /// values. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_unpacklo_pi8(__m64 __m1, __m64 __m2) { return (__m64)__builtin_ia32_punpcklbw((__v8qi)__m1, (__v8qi)__m2); } /// \brief Unpacks the lower 32 bits from two 64-bit integer vectors of /// [4 x i16] and interleaves them into a 64-bit integer vector of [4 x i16]. /// /// \headerfile /// /// This intrinsic corresponds to the PUNPCKLWD instruction. /// /// \param __m1 /// A 64-bit integer vector of [4 x i16]. /// Bits [15:0] are written to bits [15:0] of the result. \n /// Bits [31:16] are written to bits [47:32] of the result. /// \param __m2 /// A 64-bit integer vector of [4 x i16]. /// Bits [15:0] are written to bits [31:16] of the result. \n /// Bits [31:16] are written to bits [63:48] of the result. /// \returns A 64-bit integer vector of [4 x i16] containing the interleaved /// values. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_unpacklo_pi16(__m64 __m1, __m64 __m2) { return (__m64)__builtin_ia32_punpcklwd((__v4hi)__m1, (__v4hi)__m2); } /// \brief Unpacks the lower 32 bits from two 64-bit integer vectors of /// [2 x i32] and interleaves them into a 64-bit integer vector of [2 x i32]. /// /// \headerfile /// /// This intrinsic corresponds to the PUNPCKLDQ instruction. /// /// \param __m1 /// A 64-bit integer vector of [2 x i32]. The lower 32 bits are written to /// the lower 32 bits of the result. /// \param __m2 /// A 64-bit integer vector of [2 x i32]. The lower 32 bits are written to /// the upper 32 bits of the result. /// \returns A 64-bit integer vector of [2 x i32] containing the interleaved /// values. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_unpacklo_pi32(__m64 __m1, __m64 __m2) { return (__m64)__builtin_ia32_punpckldq((__v2si)__m1, (__v2si)__m2); } /// \brief Adds each 8-bit integer element of the first 64-bit integer vector /// of [8 x i8] to the corresponding 8-bit integer element of the second /// 64-bit integer vector of [8 x i8]. The lower 8 bits of the results are /// packed into a 64-bit integer vector of [8 x i8]. /// /// \headerfile /// /// This intrinsic corresponds to the PADDB instruction. /// /// \param __m1 /// A 64-bit integer vector of [8 x i8]. /// \param __m2 /// A 64-bit integer vector of [8 x i8]. /// \returns A 64-bit integer vector of [8 x i8] containing the sums of both /// parameters. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_add_pi8(__m64 __m1, __m64 __m2) { return (__m64)__builtin_ia32_paddb((__v8qi)__m1, (__v8qi)__m2); } /// \brief Adds each 16-bit integer element of the first 64-bit integer vector /// of [4 x i16] to the corresponding 16-bit integer element of the second /// 64-bit integer vector of [4 x i16]. The lower 16 bits of the results are /// packed into a 64-bit integer vector of [4 x i16]. /// /// \headerfile /// /// This intrinsic corresponds to the PADDW instruction. /// /// \param __m1 /// A 64-bit integer vector of [4 x i16]. /// \param __m2 /// A 64-bit integer vector of [4 x i16]. /// \returns A 64-bit integer vector of [4 x i16] containing the sums of both /// parameters. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_add_pi16(__m64 __m1, __m64 __m2) { return (__m64)__builtin_ia32_paddw((__v4hi)__m1, (__v4hi)__m2); } /// \brief Adds each 32-bit integer element of the first 64-bit integer vector /// of [2 x i32] to the corresponding 32-bit integer element of the second /// 64-bit integer vector of [2 x i32]. The lower 32 bits of the results are /// packed into a 64-bit integer vector of [2 x i32]. /// /// \headerfile /// /// This intrinsic corresponds to the PADDD instruction. /// /// \param __m1 /// A 64-bit integer vector of [2 x i32]. /// \param __m2 /// A 64-bit integer vector of [2 x i32]. /// \returns A 64-bit integer vector of [2 x i32] containing the sums of both /// parameters. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_add_pi32(__m64 __m1, __m64 __m2) { return (__m64)__builtin_ia32_paddd((__v2si)__m1, (__v2si)__m2); } /// \brief Adds each 8-bit signed integer element of the first 64-bit integer /// vector of [8 x i8] to the corresponding 8-bit signed integer element of /// the second 64-bit integer vector of [8 x i8]. Positive sums greater than /// 0x7F are saturated to 0x7F. Negative sums less than 0x80 are saturated to /// 0x80. The results are packed into a 64-bit integer vector of [8 x i8]. /// /// \headerfile /// /// This intrinsic corresponds to the PADDSB instruction. /// /// \param __m1 /// A 64-bit integer vector of [8 x i8]. /// \param __m2 /// A 64-bit integer vector of [8 x i8]. /// \returns A 64-bit integer vector of [8 x i8] containing the saturated sums /// of both parameters. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_adds_pi8(__m64 __m1, __m64 __m2) { return (__m64)__builtin_ia32_paddsb((__v8qi)__m1, (__v8qi)__m2); } /// \brief Adds each 16-bit signed integer element of the first 64-bit integer /// vector of [4 x i16] to the corresponding 16-bit signed integer element of /// the second 64-bit integer vector of [4 x i16]. Positive sums greater than /// 0x7FFF are saturated to 0x7FFF. Negative sums less than 0x8000 are /// saturated to 0x8000. The results are packed into a 64-bit integer vector /// of [4 x i16]. /// /// \headerfile /// /// This intrinsic corresponds to the PADDSW instruction. /// /// \param __m1 /// A 64-bit integer vector of [4 x i16]. /// \param __m2 /// A 64-bit integer vector of [4 x i16]. /// \returns A 64-bit integer vector of [4 x i16] containing the saturated sums /// of both parameters. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_adds_pi16(__m64 __m1, __m64 __m2) { return (__m64)__builtin_ia32_paddsw((__v4hi)__m1, (__v4hi)__m2); } /// \brief Adds each 8-bit unsigned integer element of the first 64-bit integer /// vector of [8 x i8] to the corresponding 8-bit unsigned integer element of /// the second 64-bit integer vector of [8 x i8]. Sums greater than 0xFF are /// saturated to 0xFF. The results are packed into a 64-bit integer vector of /// [8 x i8]. /// /// \headerfile /// /// This intrinsic corresponds to the PADDUSB instruction. /// /// \param __m1 /// A 64-bit integer vector of [8 x i8]. /// \param __m2 /// A 64-bit integer vector of [8 x i8]. /// \returns A 64-bit integer vector of [8 x i8] containing the saturated /// unsigned sums of both parameters. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_adds_pu8(__m64 __m1, __m64 __m2) { return (__m64)__builtin_ia32_paddusb((__v8qi)__m1, (__v8qi)__m2); } /// \brief Adds each 16-bit unsigned integer element of the first 64-bit integer /// vector of [4 x i16] to the corresponding 16-bit unsigned integer element /// of the second 64-bit integer vector of [4 x i16]. Sums greater than /// 0xFFFF are saturated to 0xFFFF. The results are packed into a 64-bit /// integer vector of [4 x i16]. /// /// \headerfile /// /// This intrinsic corresponds to the PADDUSW instruction. /// /// \param __m1 /// A 64-bit integer vector of [4 x i16]. /// \param __m2 /// A 64-bit integer vector of [4 x i16]. /// \returns A 64-bit integer vector of [4 x i16] containing the saturated /// unsigned sums of both parameters. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_adds_pu16(__m64 __m1, __m64 __m2) { return (__m64)__builtin_ia32_paddusw((__v4hi)__m1, (__v4hi)__m2); } /// \brief Subtracts each 8-bit integer element of the second 64-bit integer /// vector of [8 x i8] from the corresponding 8-bit integer element of the /// first 64-bit integer vector of [8 x i8]. The lower 8 bits of the results /// are packed into a 64-bit integer vector of [8 x i8]. /// /// \headerfile /// /// This intrinsic corresponds to the PSUBB instruction. /// /// \param __m1 /// A 64-bit integer vector of [8 x i8] containing the minuends. /// \param __m2 /// A 64-bit integer vector of [8 x i8] containing the subtrahends. /// \returns A 64-bit integer vector of [8 x i8] containing the differences of /// both parameters. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_sub_pi8(__m64 __m1, __m64 __m2) { return (__m64)__builtin_ia32_psubb((__v8qi)__m1, (__v8qi)__m2); } /// \brief Subtracts each 16-bit integer element of the second 64-bit integer /// vector of [4 x i16] from the corresponding 16-bit integer element of the /// first 64-bit integer vector of [4 x i16]. The lower 16 bits of the /// results are packed into a 64-bit integer vector of [4 x i16]. /// /// \headerfile /// /// This intrinsic corresponds to the PSUBW instruction. /// /// \param __m1 /// A 64-bit integer vector of [4 x i16] containing the minuends. /// \param __m2 /// A 64-bit integer vector of [4 x i16] containing the subtrahends. /// \returns A 64-bit integer vector of [4 x i16] containing the differences of /// both parameters. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_sub_pi16(__m64 __m1, __m64 __m2) { return (__m64)__builtin_ia32_psubw((__v4hi)__m1, (__v4hi)__m2); } /// \brief Subtracts each 32-bit integer element of the second 64-bit integer /// vector of [2 x i32] from the corresponding 32-bit integer element of the /// first 64-bit integer vector of [2 x i32]. The lower 32 bits of the /// results are packed into a 64-bit integer vector of [2 x i32]. /// /// \headerfile /// /// This intrinsic corresponds to the PSUBD instruction. /// /// \param __m1 /// A 64-bit integer vector of [2 x i32] containing the minuends. /// \param __m2 /// A 64-bit integer vector of [2 x i32] containing the subtrahends. /// \returns A 64-bit integer vector of [2 x i32] containing the differences of /// both parameters. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_sub_pi32(__m64 __m1, __m64 __m2) { return (__m64)__builtin_ia32_psubd((__v2si)__m1, (__v2si)__m2); } /// \brief Subtracts each 8-bit signed integer element of the second 64-bit /// integer vector of [8 x i8] from the corresponding 8-bit signed integer /// element of the first 64-bit integer vector of [8 x i8]. Positive results /// greater than 0x7F are saturated to 0x7F. Negative results less than 0x80 /// are saturated to 0x80. The results are packed into a 64-bit integer /// vector of [8 x i8]. /// /// \headerfile /// /// This intrinsic corresponds to the PSUBSB instruction. /// /// \param __m1 /// A 64-bit integer vector of [8 x i8] containing the minuends. /// \param __m2 /// A 64-bit integer vector of [8 x i8] containing the subtrahends. /// \returns A 64-bit integer vector of [8 x i8] containing the saturated /// differences of both parameters. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_subs_pi8(__m64 __m1, __m64 __m2) { return (__m64)__builtin_ia32_psubsb((__v8qi)__m1, (__v8qi)__m2); } /// \brief Subtracts each 16-bit signed integer element of the second 64-bit /// integer vector of [4 x i16] from the corresponding 16-bit signed integer /// element of the first 64-bit integer vector of [4 x i16]. Positive results /// greater than 0x7FFF are saturated to 0x7FFF. Negative results less than /// 0x8000 are saturated to 0x8000. The results are packed into a 64-bit /// integer vector of [4 x i16]. /// /// \headerfile /// /// This intrinsic corresponds to the PSUBSW instruction. /// /// \param __m1 /// A 64-bit integer vector of [4 x i16] containing the minuends. /// \param __m2 /// A 64-bit integer vector of [4 x i16] containing the subtrahends. /// \returns A 64-bit integer vector of [4 x i16] containing the saturated /// differences of both parameters. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_subs_pi16(__m64 __m1, __m64 __m2) { return (__m64)__builtin_ia32_psubsw((__v4hi)__m1, (__v4hi)__m2); } /// \brief Subtracts each 8-bit unsigned integer element of the second 64-bit /// integer vector of [8 x i8] from the corresponding 8-bit unsigned integer /// element of the first 64-bit integer vector of [8 x i8]. /// /// If an element of the first vector is less than the corresponding element /// of the second vector, the result is saturated to 0. The results are /// packed into a 64-bit integer vector of [8 x i8]. /// /// \headerfile /// /// This intrinsic corresponds to the PSUBUSB instruction. /// /// \param __m1 /// A 64-bit integer vector of [8 x i8] containing the minuends. /// \param __m2 /// A 64-bit integer vector of [8 x i8] containing the subtrahends. /// \returns A 64-bit integer vector of [8 x i8] containing the saturated /// differences of both parameters. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_subs_pu8(__m64 __m1, __m64 __m2) { return (__m64)__builtin_ia32_psubusb((__v8qi)__m1, (__v8qi)__m2); } /// \brief Subtracts each 16-bit unsigned integer element of the second 64-bit /// integer vector of [4 x i16] from the corresponding 16-bit unsigned /// integer element of the first 64-bit integer vector of [4 x i16]. /// /// If an element of the first vector is less than the corresponding element /// of the second vector, the result is saturated to 0. The results are /// packed into a 64-bit integer vector of [4 x i16]. /// /// \headerfile /// /// This intrinsic corresponds to the PSUBUSW instruction. /// /// \param __m1 /// A 64-bit integer vector of [4 x i16] containing the minuends. /// \param __m2 /// A 64-bit integer vector of [4 x i16] containing the subtrahends. /// \returns A 64-bit integer vector of [4 x i16] containing the saturated /// differences of both parameters. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_subs_pu16(__m64 __m1, __m64 __m2) { return (__m64)__builtin_ia32_psubusw((__v4hi)__m1, (__v4hi)__m2); } /// \brief Multiplies each 16-bit signed integer element of the first 64-bit /// integer vector of [4 x i16] by the corresponding 16-bit signed integer /// element of the second 64-bit integer vector of [4 x i16] and get four /// 32-bit products. Adds adjacent pairs of products to get two 32-bit sums. /// The lower 32 bits of these two sums are packed into a 64-bit integer /// vector of [2 x i32]. /// /// For example, bits [15:0] of both parameters are multiplied, bits [31:16] /// of both parameters are multiplied, and the sum of both results is written /// to bits [31:0] of the result. /// /// \headerfile /// /// This intrinsic corresponds to the PMADDWD instruction. /// /// \param __m1 /// A 64-bit integer vector of [4 x i16]. /// \param __m2 /// A 64-bit integer vector of [4 x i16]. /// \returns A 64-bit integer vector of [2 x i32] containing the sums of /// products of both parameters. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_madd_pi16(__m64 __m1, __m64 __m2) { return (__m64)__builtin_ia32_pmaddwd((__v4hi)__m1, (__v4hi)__m2); } /// \brief Multiplies each 16-bit signed integer element of the first 64-bit /// integer vector of [4 x i16] by the corresponding 16-bit signed integer /// element of the second 64-bit integer vector of [4 x i16]. Packs the upper /// 16 bits of the 32-bit products into a 64-bit integer vector of [4 x i16]. /// /// \headerfile /// /// This intrinsic corresponds to the PMULHW instruction. /// /// \param __m1 /// A 64-bit integer vector of [4 x i16]. /// \param __m2 /// A 64-bit integer vector of [4 x i16]. /// \returns A 64-bit integer vector of [4 x i16] containing the upper 16 bits /// of the products of both parameters. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_mulhi_pi16(__m64 __m1, __m64 __m2) { return (__m64)__builtin_ia32_pmulhw((__v4hi)__m1, (__v4hi)__m2); } /// \brief Multiplies each 16-bit signed integer element of the first 64-bit /// integer vector of [4 x i16] by the corresponding 16-bit signed integer /// element of the second 64-bit integer vector of [4 x i16]. Packs the lower /// 16 bits of the 32-bit products into a 64-bit integer vector of [4 x i16]. /// /// \headerfile /// /// This intrinsic corresponds to the PMULLW instruction. /// /// \param __m1 /// A 64-bit integer vector of [4 x i16]. /// \param __m2 /// A 64-bit integer vector of [4 x i16]. /// \returns A 64-bit integer vector of [4 x i16] containing the lower 16 bits /// of the products of both parameters. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_mullo_pi16(__m64 __m1, __m64 __m2) { return (__m64)__builtin_ia32_pmullw((__v4hi)__m1, (__v4hi)__m2); } /// \brief Left-shifts each 16-bit signed integer element of the first /// parameter, which is a 64-bit integer vector of [4 x i16], by the number /// of bits specified by the second parameter, which is a 64-bit integer. The /// lower 16 bits of the results are packed into a 64-bit integer vector of /// [4 x i16]. /// /// \headerfile /// /// This intrinsic corresponds to the PSLLW instruction. /// /// \param __m /// A 64-bit integer vector of [4 x i16]. /// \param __count /// A 64-bit integer vector interpreted as a single 64-bit integer. /// \returns A 64-bit integer vector of [4 x i16] containing the left-shifted /// values. If \a __count is greater or equal to 16, the result is set to all /// 0. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_sll_pi16(__m64 __m, __m64 __count) { return (__m64)__builtin_ia32_psllw((__v4hi)__m, __count); } /// \brief Left-shifts each 16-bit signed integer element of a 64-bit integer /// vector of [4 x i16] by the number of bits specified by a 32-bit integer. /// The lower 16 bits of the results are packed into a 64-bit integer vector /// of [4 x i16]. /// /// \headerfile /// /// This intrinsic corresponds to the PSLLW instruction. /// /// \param __m /// A 64-bit integer vector of [4 x i16]. /// \param __count /// A 32-bit integer value. /// \returns A 64-bit integer vector of [4 x i16] containing the left-shifted /// values. If \a __count is greater or equal to 16, the result is set to all /// 0. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_slli_pi16(__m64 __m, int __count) { return (__m64)__builtin_ia32_psllwi((__v4hi)__m, __count); } /// \brief Left-shifts each 32-bit signed integer element of the first /// parameter, which is a 64-bit integer vector of [2 x i32], by the number /// of bits specified by the second parameter, which is a 64-bit integer. The /// lower 32 bits of the results are packed into a 64-bit integer vector of /// [2 x i32]. /// /// \headerfile /// /// This intrinsic corresponds to the PSLLD instruction. /// /// \param __m /// A 64-bit integer vector of [2 x i32]. /// \param __count /// A 64-bit integer vector interpreted as a single 64-bit integer. /// \returns A 64-bit integer vector of [2 x i32] containing the left-shifted /// values. If \a __count is greater or equal to 32, the result is set to all /// 0. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_sll_pi32(__m64 __m, __m64 __count) { return (__m64)__builtin_ia32_pslld((__v2si)__m, __count); } /// \brief Left-shifts each 32-bit signed integer element of a 64-bit integer /// vector of [2 x i32] by the number of bits specified by a 32-bit integer. /// The lower 32 bits of the results are packed into a 64-bit integer vector /// of [2 x i32]. /// /// \headerfile /// /// This intrinsic corresponds to the PSLLD instruction. /// /// \param __m /// A 64-bit integer vector of [2 x i32]. /// \param __count /// A 32-bit integer value. /// \returns A 64-bit integer vector of [2 x i32] containing the left-shifted /// values. If \a __count is greater or equal to 32, the result is set to all /// 0. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_slli_pi32(__m64 __m, int __count) { return (__m64)__builtin_ia32_pslldi((__v2si)__m, __count); } /// \brief Left-shifts the first 64-bit integer parameter by the number of bits /// specified by the second 64-bit integer parameter. The lower 64 bits of /// result are returned. /// /// \headerfile /// /// This intrinsic corresponds to the PSLLQ instruction. /// /// \param __m /// A 64-bit integer vector interpreted as a single 64-bit integer. /// \param __count /// A 64-bit integer vector interpreted as a single 64-bit integer. /// \returns A 64-bit integer vector containing the left-shifted value. If /// \a __count is greater or equal to 64, the result is set to 0. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_sll_si64(__m64 __m, __m64 __count) { return (__m64)__builtin_ia32_psllq((__v1di)__m, __count); } /// \brief Left-shifts the first parameter, which is a 64-bit integer, by the /// number of bits specified by the second parameter, which is a 32-bit /// integer. The lower 64 bits of result are returned. /// /// \headerfile /// /// This intrinsic corresponds to the PSLLQ instruction. /// /// \param __m /// A 64-bit integer vector interpreted as a single 64-bit integer. /// \param __count /// A 32-bit integer value. /// \returns A 64-bit integer vector containing the left-shifted value. If /// \a __count is greater or equal to 64, the result is set to 0. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_slli_si64(__m64 __m, int __count) { return (__m64)__builtin_ia32_psllqi((__v1di)__m, __count); } /// \brief Right-shifts each 16-bit integer element of the first parameter, /// which is a 64-bit integer vector of [4 x i16], by the number of bits /// specified by the second parameter, which is a 64-bit integer. /// /// High-order bits are filled with the sign bit of the initial value of each /// 16-bit element. The 16-bit results are packed into a 64-bit integer /// vector of [4 x i16]. /// /// \headerfile /// /// This intrinsic corresponds to the PSRAW instruction. /// /// \param __m /// A 64-bit integer vector of [4 x i16]. /// \param __count /// A 64-bit integer vector interpreted as a single 64-bit integer. /// \returns A 64-bit integer vector of [4 x i16] containing the right-shifted /// values. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_sra_pi16(__m64 __m, __m64 __count) { return (__m64)__builtin_ia32_psraw((__v4hi)__m, __count); } /// \brief Right-shifts each 16-bit integer element of a 64-bit integer vector /// of [4 x i16] by the number of bits specified by a 32-bit integer. /// /// High-order bits are filled with the sign bit of the initial value of each /// 16-bit element. The 16-bit results are packed into a 64-bit integer /// vector of [4 x i16]. /// /// \headerfile /// /// This intrinsic corresponds to the PSRAW instruction. /// /// \param __m /// A 64-bit integer vector of [4 x i16]. /// \param __count /// A 32-bit integer value. /// \returns A 64-bit integer vector of [4 x i16] containing the right-shifted /// values. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_srai_pi16(__m64 __m, int __count) { return (__m64)__builtin_ia32_psrawi((__v4hi)__m, __count); } /// \brief Right-shifts each 32-bit integer element of the first parameter, /// which is a 64-bit integer vector of [2 x i32], by the number of bits /// specified by the second parameter, which is a 64-bit integer. /// /// High-order bits are filled with the sign bit of the initial value of each /// 32-bit element. The 32-bit results are packed into a 64-bit integer /// vector of [2 x i32]. /// /// \headerfile /// /// This intrinsic corresponds to the PSRAD instruction. /// /// \param __m /// A 64-bit integer vector of [2 x i32]. /// \param __count /// A 64-bit integer vector interpreted as a single 64-bit integer. /// \returns A 64-bit integer vector of [2 x i32] containing the right-shifted /// values. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_sra_pi32(__m64 __m, __m64 __count) { return (__m64)__builtin_ia32_psrad((__v2si)__m, __count); } /// \brief Right-shifts each 32-bit integer element of a 64-bit integer vector /// of [2 x i32] by the number of bits specified by a 32-bit integer. /// /// High-order bits are filled with the sign bit of the initial value of each /// 32-bit element. The 32-bit results are packed into a 64-bit integer /// vector of [2 x i32]. /// /// \headerfile /// /// This intrinsic corresponds to the PSRAD instruction. /// /// \param __m /// A 64-bit integer vector of [2 x i32]. /// \param __count /// A 32-bit integer value. /// \returns A 64-bit integer vector of [2 x i32] containing the right-shifted /// values. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_srai_pi32(__m64 __m, int __count) { return (__m64)__builtin_ia32_psradi((__v2si)__m, __count); } /// \brief Right-shifts each 16-bit integer element of the first parameter, /// which is a 64-bit integer vector of [4 x i16], by the number of bits /// specified by the second parameter, which is a 64-bit integer. /// /// High-order bits are cleared. The 16-bit results are packed into a 64-bit /// integer vector of [4 x i16]. /// /// \headerfile /// /// This intrinsic corresponds to the PSRLW instruction. /// /// \param __m /// A 64-bit integer vector of [4 x i16]. /// \param __count /// A 64-bit integer vector interpreted as a single 64-bit integer. /// \returns A 64-bit integer vector of [4 x i16] containing the right-shifted /// values. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_srl_pi16(__m64 __m, __m64 __count) { return (__m64)__builtin_ia32_psrlw((__v4hi)__m, __count); } /// \brief Right-shifts each 16-bit integer element of a 64-bit integer vector /// of [4 x i16] by the number of bits specified by a 32-bit integer. /// /// High-order bits are cleared. The 16-bit results are packed into a 64-bit /// integer vector of [4 x i16]. /// /// \headerfile /// /// This intrinsic corresponds to the PSRLW instruction. /// /// \param __m /// A 64-bit integer vector of [4 x i16]. /// \param __count /// A 32-bit integer value. /// \returns A 64-bit integer vector of [4 x i16] containing the right-shifted /// values. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_srli_pi16(__m64 __m, int __count) { return (__m64)__builtin_ia32_psrlwi((__v4hi)__m, __count); } /// \brief Right-shifts each 32-bit integer element of the first parameter, /// which is a 64-bit integer vector of [2 x i32], by the number of bits /// specified by the second parameter, which is a 64-bit integer. /// /// High-order bits are cleared. The 32-bit results are packed into a 64-bit /// integer vector of [2 x i32]. /// /// \headerfile /// /// This intrinsic corresponds to the PSRLD instruction. /// /// \param __m /// A 64-bit integer vector of [2 x i32]. /// \param __count /// A 64-bit integer vector interpreted as a single 64-bit integer. /// \returns A 64-bit integer vector of [2 x i32] containing the right-shifted /// values. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_srl_pi32(__m64 __m, __m64 __count) { return (__m64)__builtin_ia32_psrld((__v2si)__m, __count); } /// \brief Right-shifts each 32-bit integer element of a 64-bit integer vector /// of [2 x i32] by the number of bits specified by a 32-bit integer. /// /// High-order bits are cleared. The 32-bit results are packed into a 64-bit /// integer vector of [2 x i32]. /// /// \headerfile /// /// This intrinsic corresponds to the PSRLD instruction. /// /// \param __m /// A 64-bit integer vector of [2 x i32]. /// \param __count /// A 32-bit integer value. /// \returns A 64-bit integer vector of [2 x i32] containing the right-shifted /// values. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_srli_pi32(__m64 __m, int __count) { return (__m64)__builtin_ia32_psrldi((__v2si)__m, __count); } /// \brief Right-shifts the first 64-bit integer parameter by the number of bits /// specified by the second 64-bit integer parameter. /// /// High-order bits are cleared. /// /// \headerfile /// /// This intrinsic corresponds to the PSRLQ instruction. /// /// \param __m /// A 64-bit integer vector interpreted as a single 64-bit integer. /// \param __count /// A 64-bit integer vector interpreted as a single 64-bit integer. /// \returns A 64-bit integer vector containing the right-shifted value. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_srl_si64(__m64 __m, __m64 __count) { return (__m64)__builtin_ia32_psrlq((__v1di)__m, __count); } /// \brief Right-shifts the first parameter, which is a 64-bit integer, by the /// number of bits specified by the second parameter, which is a 32-bit /// integer. /// /// High-order bits are cleared. /// /// \headerfile /// /// This intrinsic corresponds to the PSRLQ instruction. /// /// \param __m /// A 64-bit integer vector interpreted as a single 64-bit integer. /// \param __count /// A 32-bit integer value. /// \returns A 64-bit integer vector containing the right-shifted value. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_srli_si64(__m64 __m, int __count) { return (__m64)__builtin_ia32_psrlqi((__v1di)__m, __count); } /// \brief Performs a bitwise AND of two 64-bit integer vectors. /// /// \headerfile /// /// This intrinsic corresponds to the PAND instruction. /// /// \param __m1 /// A 64-bit integer vector. /// \param __m2 /// A 64-bit integer vector. /// \returns A 64-bit integer vector containing the bitwise AND of both /// parameters. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_and_si64(__m64 __m1, __m64 __m2) { return __builtin_ia32_pand((__v1di)__m1, (__v1di)__m2); } /// \brief Performs a bitwise NOT of the first 64-bit integer vector, and then /// performs a bitwise AND of the intermediate result and the second 64-bit /// integer vector. /// /// \headerfile /// /// This intrinsic corresponds to the PANDN instruction. /// /// \param __m1 /// A 64-bit integer vector. The one's complement of this parameter is used /// in the bitwise AND. /// \param __m2 /// A 64-bit integer vector. /// \returns A 64-bit integer vector containing the bitwise AND of the second /// parameter and the one's complement of the first parameter. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_andnot_si64(__m64 __m1, __m64 __m2) { return __builtin_ia32_pandn((__v1di)__m1, (__v1di)__m2); } /// \brief Performs a bitwise OR of two 64-bit integer vectors. /// /// \headerfile /// /// This intrinsic corresponds to the POR instruction. /// /// \param __m1 /// A 64-bit integer vector. /// \param __m2 /// A 64-bit integer vector. /// \returns A 64-bit integer vector containing the bitwise OR of both /// parameters. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_or_si64(__m64 __m1, __m64 __m2) { return __builtin_ia32_por((__v1di)__m1, (__v1di)__m2); } /// \brief Performs a bitwise exclusive OR of two 64-bit integer vectors. /// /// \headerfile /// /// This intrinsic corresponds to the PXOR instruction. /// /// \param __m1 /// A 64-bit integer vector. /// \param __m2 /// A 64-bit integer vector. /// \returns A 64-bit integer vector containing the bitwise exclusive OR of both /// parameters. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_xor_si64(__m64 __m1, __m64 __m2) { return __builtin_ia32_pxor((__v1di)__m1, (__v1di)__m2); } /// \brief Compares the 8-bit integer elements of two 64-bit integer vectors of /// [8 x i8] to determine if the element of the first vector is equal to the /// corresponding element of the second vector. /// /// The comparison yields 0 for false, 0xFF for true. /// /// \headerfile /// /// This intrinsic corresponds to the PCMPEQB instruction. /// /// \param __m1 /// A 64-bit integer vector of [8 x i8]. /// \param __m2 /// A 64-bit integer vector of [8 x i8]. /// \returns A 64-bit integer vector of [8 x i8] containing the comparison /// results. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_cmpeq_pi8(__m64 __m1, __m64 __m2) { return (__m64)__builtin_ia32_pcmpeqb((__v8qi)__m1, (__v8qi)__m2); } /// \brief Compares the 16-bit integer elements of two 64-bit integer vectors of /// [4 x i16] to determine if the element of the first vector is equal to the /// corresponding element of the second vector. /// /// The comparison yields 0 for false, 0xFFFF for true. /// /// \headerfile /// /// This intrinsic corresponds to the PCMPEQW instruction. /// /// \param __m1 /// A 64-bit integer vector of [4 x i16]. /// \param __m2 /// A 64-bit integer vector of [4 x i16]. /// \returns A 64-bit integer vector of [4 x i16] containing the comparison /// results. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_cmpeq_pi16(__m64 __m1, __m64 __m2) { return (__m64)__builtin_ia32_pcmpeqw((__v4hi)__m1, (__v4hi)__m2); } /// \brief Compares the 32-bit integer elements of two 64-bit integer vectors of /// [2 x i32] to determine if the element of the first vector is equal to the /// corresponding element of the second vector. /// /// The comparison yields 0 for false, 0xFFFFFFFF for true. /// /// \headerfile /// /// This intrinsic corresponds to the PCMPEQD instruction. /// /// \param __m1 /// A 64-bit integer vector of [2 x i32]. /// \param __m2 /// A 64-bit integer vector of [2 x i32]. /// \returns A 64-bit integer vector of [2 x i32] containing the comparison /// results. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_cmpeq_pi32(__m64 __m1, __m64 __m2) { return (__m64)__builtin_ia32_pcmpeqd((__v2si)__m1, (__v2si)__m2); } /// \brief Compares the 8-bit integer elements of two 64-bit integer vectors of /// [8 x i8] to determine if the element of the first vector is greater than /// the corresponding element of the second vector. /// /// The comparison yields 0 for false, 0xFF for true. /// /// \headerfile /// /// This intrinsic corresponds to the PCMPGTB instruction. /// /// \param __m1 /// A 64-bit integer vector of [8 x i8]. /// \param __m2 /// A 64-bit integer vector of [8 x i8]. /// \returns A 64-bit integer vector of [8 x i8] containing the comparison /// results. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_cmpgt_pi8(__m64 __m1, __m64 __m2) { return (__m64)__builtin_ia32_pcmpgtb((__v8qi)__m1, (__v8qi)__m2); } /// \brief Compares the 16-bit integer elements of two 64-bit integer vectors of /// [4 x i16] to determine if the element of the first vector is greater than /// the corresponding element of the second vector. /// /// The comparison yields 0 for false, 0xFFFF for true. /// /// \headerfile /// /// This intrinsic corresponds to the PCMPGTW instruction. /// /// \param __m1 /// A 64-bit integer vector of [4 x i16]. /// \param __m2 /// A 64-bit integer vector of [4 x i16]. /// \returns A 64-bit integer vector of [4 x i16] containing the comparison /// results. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_cmpgt_pi16(__m64 __m1, __m64 __m2) { return (__m64)__builtin_ia32_pcmpgtw((__v4hi)__m1, (__v4hi)__m2); } /// \brief Compares the 32-bit integer elements of two 64-bit integer vectors of /// [2 x i32] to determine if the element of the first vector is greater than /// the corresponding element of the second vector. /// /// The comparison yields 0 for false, 0xFFFFFFFF for true. /// /// \headerfile /// /// This intrinsic corresponds to the PCMPGTD instruction. /// /// \param __m1 /// A 64-bit integer vector of [2 x i32]. /// \param __m2 /// A 64-bit integer vector of [2 x i32]. /// \returns A 64-bit integer vector of [2 x i32] containing the comparison /// results. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_cmpgt_pi32(__m64 __m1, __m64 __m2) { return (__m64)__builtin_ia32_pcmpgtd((__v2si)__m1, (__v2si)__m2); } /// \brief Constructs a 64-bit integer vector initialized to zero. /// /// \headerfile /// /// This intrinsic corresponds to the VXORPS / XORPS instruction. /// /// \returns An initialized 64-bit integer vector with all elements set to zero. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_setzero_si64(void) { return (__m64){ 0LL }; } /// \brief Constructs a 64-bit integer vector initialized with the specified /// 32-bit integer values. /// /// \headerfile /// /// This intrinsic is a utility function and does not correspond to a specific /// instruction. /// /// \param __i1 /// A 32-bit integer value used to initialize the upper 32 bits of the /// result. /// \param __i0 /// A 32-bit integer value used to initialize the lower 32 bits of the /// result. /// \returns An initialized 64-bit integer vector. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_set_pi32(int __i1, int __i0) { return (__m64)__builtin_ia32_vec_init_v2si(__i0, __i1); } /// \brief Constructs a 64-bit integer vector initialized with the specified /// 16-bit integer values. /// /// \headerfile /// /// This intrinsic is a utility function and does not correspond to a specific /// instruction. /// /// \param __s3 /// A 16-bit integer value used to initialize bits [63:48] of the result. /// \param __s2 /// A 16-bit integer value used to initialize bits [47:32] of the result. /// \param __s1 /// A 16-bit integer value used to initialize bits [31:16] of the result. /// \param __s0 /// A 16-bit integer value used to initialize bits [15:0] of the result. /// \returns An initialized 64-bit integer vector. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_set_pi16(short __s3, short __s2, short __s1, short __s0) { return (__m64)__builtin_ia32_vec_init_v4hi(__s0, __s1, __s2, __s3); } /// \brief Constructs a 64-bit integer vector initialized with the specified /// 8-bit integer values. /// /// \headerfile /// /// This intrinsic is a utility function and does not correspond to a specific /// instruction. /// /// \param __b7 /// An 8-bit integer value used to initialize bits [63:56] of the result. /// \param __b6 /// An 8-bit integer value used to initialize bits [55:48] of the result. /// \param __b5 /// An 8-bit integer value used to initialize bits [47:40] of the result. /// \param __b4 /// An 8-bit integer value used to initialize bits [39:32] of the result. /// \param __b3 /// An 8-bit integer value used to initialize bits [31:24] of the result. /// \param __b2 /// An 8-bit integer value used to initialize bits [23:16] of the result. /// \param __b1 /// An 8-bit integer value used to initialize bits [15:8] of the result. /// \param __b0 /// An 8-bit integer value used to initialize bits [7:0] of the result. /// \returns An initialized 64-bit integer vector. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_set_pi8(char __b7, char __b6, char __b5, char __b4, char __b3, char __b2, char __b1, char __b0) { return (__m64)__builtin_ia32_vec_init_v8qi(__b0, __b1, __b2, __b3, __b4, __b5, __b6, __b7); } /// \brief Constructs a 64-bit integer vector of [2 x i32], with each of the /// 32-bit integer vector elements set to the specified 32-bit integer /// value. /// /// \headerfile /// /// This intrinsic corresponds to the VPSHUFD / PSHUFD instruction. /// /// \param __i /// A 32-bit integer value used to initialize each vector element of the /// result. /// \returns An initialized 64-bit integer vector of [2 x i32]. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_set1_pi32(int __i) { return _mm_set_pi32(__i, __i); } /// \brief Constructs a 64-bit integer vector of [4 x i16], with each of the /// 16-bit integer vector elements set to the specified 16-bit integer /// value. /// /// \headerfile /// /// This intrinsic corresponds to the VPSHUFLW / PSHUFLW instruction. /// /// \param __w /// A 16-bit integer value used to initialize each vector element of the /// result. /// \returns An initialized 64-bit integer vector of [4 x i16]. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_set1_pi16(short __w) { return _mm_set_pi16(__w, __w, __w, __w); } /// \brief Constructs a 64-bit integer vector of [8 x i8], with each of the /// 8-bit integer vector elements set to the specified 8-bit integer value. /// /// \headerfile /// /// This intrinsic corresponds to the VPUNPCKLBW + VPSHUFLW / PUNPCKLBW + /// PSHUFLW instruction. /// /// \param __b /// An 8-bit integer value used to initialize each vector element of the /// result. /// \returns An initialized 64-bit integer vector of [8 x i8]. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_set1_pi8(char __b) { return _mm_set_pi8(__b, __b, __b, __b, __b, __b, __b, __b); } /// \brief Constructs a 64-bit integer vector, initialized in reverse order with /// the specified 32-bit integer values. /// /// \headerfile /// /// This intrinsic is a utility function and does not correspond to a specific /// instruction. /// /// \param __i0 /// A 32-bit integer value used to initialize the lower 32 bits of the /// result. /// \param __i1 /// A 32-bit integer value used to initialize the upper 32 bits of the /// result. /// \returns An initialized 64-bit integer vector. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_setr_pi32(int __i0, int __i1) { return _mm_set_pi32(__i1, __i0); } /// \brief Constructs a 64-bit integer vector, initialized in reverse order with /// the specified 16-bit integer values. /// /// \headerfile /// /// This intrinsic is a utility function and does not correspond to a specific /// instruction. /// /// \param __w0 /// A 16-bit integer value used to initialize bits [15:0] of the result. /// \param __w1 /// A 16-bit integer value used to initialize bits [31:16] of the result. /// \param __w2 /// A 16-bit integer value used to initialize bits [47:32] of the result. /// \param __w3 /// A 16-bit integer value used to initialize bits [63:48] of the result. /// \returns An initialized 64-bit integer vector. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_setr_pi16(short __w0, short __w1, short __w2, short __w3) { return _mm_set_pi16(__w3, __w2, __w1, __w0); } /// \brief Constructs a 64-bit integer vector, initialized in reverse order with /// the specified 8-bit integer values. /// /// \headerfile /// /// This intrinsic is a utility function and does not correspond to a specific /// instruction. /// /// \param __b0 /// An 8-bit integer value used to initialize bits [7:0] of the result. /// \param __b1 /// An 8-bit integer value used to initialize bits [15:8] of the result. /// \param __b2 /// An 8-bit integer value used to initialize bits [23:16] of the result. /// \param __b3 /// An 8-bit integer value used to initialize bits [31:24] of the result. /// \param __b4 /// An 8-bit integer value used to initialize bits [39:32] of the result. /// \param __b5 /// An 8-bit integer value used to initialize bits [47:40] of the result. /// \param __b6 /// An 8-bit integer value used to initialize bits [55:48] of the result. /// \param __b7 /// An 8-bit integer value used to initialize bits [63:56] of the result. /// \returns An initialized 64-bit integer vector. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_setr_pi8(char __b0, char __b1, char __b2, char __b3, char __b4, char __b5, char __b6, char __b7) { return _mm_set_pi8(__b7, __b6, __b5, __b4, __b3, __b2, __b1, __b0); } #undef __DEFAULT_FN_ATTRS /* Aliases for compatibility. */ #define _m_empty _mm_empty #define _m_from_int _mm_cvtsi32_si64 #define _m_from_int64 _mm_cvtsi64_m64 #define _m_to_int _mm_cvtsi64_si32 #define _m_to_int64 _mm_cvtm64_si64 #define _m_packsswb _mm_packs_pi16 #define _m_packssdw _mm_packs_pi32 #define _m_packuswb _mm_packs_pu16 #define _m_punpckhbw _mm_unpackhi_pi8 #define _m_punpckhwd _mm_unpackhi_pi16 #define _m_punpckhdq _mm_unpackhi_pi32 #define _m_punpcklbw _mm_unpacklo_pi8 #define _m_punpcklwd _mm_unpacklo_pi16 #define _m_punpckldq _mm_unpacklo_pi32 #define _m_paddb _mm_add_pi8 #define _m_paddw _mm_add_pi16 #define _m_paddd _mm_add_pi32 #define _m_paddsb _mm_adds_pi8 #define _m_paddsw _mm_adds_pi16 #define _m_paddusb _mm_adds_pu8 #define _m_paddusw _mm_adds_pu16 #define _m_psubb _mm_sub_pi8 #define _m_psubw _mm_sub_pi16 #define _m_psubd _mm_sub_pi32 #define _m_psubsb _mm_subs_pi8 #define _m_psubsw _mm_subs_pi16 #define _m_psubusb _mm_subs_pu8 #define _m_psubusw _mm_subs_pu16 #define _m_pmaddwd _mm_madd_pi16 #define _m_pmulhw _mm_mulhi_pi16 #define _m_pmullw _mm_mullo_pi16 #define _m_psllw _mm_sll_pi16 #define _m_psllwi _mm_slli_pi16 #define _m_pslld _mm_sll_pi32 #define _m_pslldi _mm_slli_pi32 #define _m_psllq _mm_sll_si64 #define _m_psllqi _mm_slli_si64 #define _m_psraw _mm_sra_pi16 #define _m_psrawi _mm_srai_pi16 #define _m_psrad _mm_sra_pi32 #define _m_psradi _mm_srai_pi32 #define _m_psrlw _mm_srl_pi16 #define _m_psrlwi _mm_srli_pi16 #define _m_psrld _mm_srl_pi32 #define _m_psrldi _mm_srli_pi32 #define _m_psrlq _mm_srl_si64 #define _m_psrlqi _mm_srli_si64 #define _m_pand _mm_and_si64 #define _m_pandn _mm_andnot_si64 #define _m_por _mm_or_si64 #define _m_pxor _mm_xor_si64 #define _m_pcmpeqb _mm_cmpeq_pi8 #define _m_pcmpeqw _mm_cmpeq_pi16 #define _m_pcmpeqd _mm_cmpeq_pi32 #define _m_pcmpgtb _mm_cmpgt_pi8 #define _m_pcmpgtw _mm_cmpgt_pi16 #define _m_pcmpgtd _mm_cmpgt_pi32 #endif /* __MMINTRIN_H */ # 1570 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/mmintrin.h" 3 # 29 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 2 3 #endif # 30 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || defined(__SSE__) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 32 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xmmintrin.h" 1 3 /*===---- xmmintrin.h - SSE intrinsics -------------------------------------=== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __XMMINTRIN_H #define __XMMINTRIN_H #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xmmintrin.h" 3 # 28 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xmmintrin.h" 3 typedef int __v4si __attribute__((__vector_size__(16))); typedef float __v4sf __attribute__((__vector_size__(16))); typedef float __m128 __attribute__((__vector_size__(16))); /* Unsigned types */ typedef unsigned int __v4su __attribute__((__vector_size__(16))); /* This header should only be included in a hosted environment as it depends on * a standard library to provide allocation routines. */ #if __STDC_HOSTED__ #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 39 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xmmintrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/mm_malloc.h" 1 3 /*===---- mm_malloc.h - Allocating and Freeing Aligned Memory Blocks -------=== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __MM_MALLOC_H #define __MM_MALLOC_H #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/mm_malloc.h" 3 # 28 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/mm_malloc.h" 3 #ifdef _WIN32 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 30 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/mm_malloc.h" 3 # 31 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/mm_malloc.h" 3 #else # 32 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/mm_malloc.h" 3 #ifndef __cplusplus extern int posix_memalign(void **__memptr, size_t __alignment, size_t __size); #else # 35 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/mm_malloc.h" 3 // Some systems (e.g. those with GNU libc) declare posix_memalign with an // exception specifier. Via an "egregious workaround" in // Sema::CheckEquivalentExceptionSpec, Clang accepts the following as a valid // redeclaration of glibc's declaration. extern "C" int posix_memalign(void **__memptr, size_t __alignment, size_t __size); #endif # 41 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/mm_malloc.h" 3 #endif # 42 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/mm_malloc.h" 3 #if !(defined(_WIN32) && defined(_mm_malloc)) static __inline__ void *__attribute__((__always_inline__, __nodebug__, __malloc__)) _mm_malloc(size_t __size, size_t __align) { if (__align == 1) { return malloc(__size); } if (!(__align & (__align - 1)) && __align < sizeof(void *)) __align = sizeof(void *); void *__mallocedMemory; #if defined(__MINGW32__) __mallocedMemory = __mingw_aligned_malloc(__size, __align); #elif defined(_WIN32) # 59 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/mm_malloc.h" 3 __mallocedMemory = _aligned_malloc(__size, __align); #else # 61 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/mm_malloc.h" 3 if (posix_memalign(&__mallocedMemory, __align, __size)) return 0; #endif # 64 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/mm_malloc.h" 3 return __mallocedMemory; } static __inline__ void __attribute__((__always_inline__, __nodebug__)) _mm_free(void *__p) { free(__p); } #endif # 74 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/mm_malloc.h" 3 #endif /* __MM_MALLOC_H */ # 76 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/mm_malloc.h" 3 # 40 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xmmintrin.h" 2 3 #endif # 41 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xmmintrin.h" 3 /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("sse"))) /// \brief Adds the 32-bit float values in the low-order bits of the operands. /// /// \headerfile /// /// This intrinsic corresponds to the VADDSS / ADDSS instructions. /// /// \param __a /// A 128-bit vector of [4 x float] containing one of the source operands. /// The lower 32 bits of this operand are used in the calculation. /// \param __b /// A 128-bit vector of [4 x float] containing one of the source operands. /// The lower 32 bits of this operand are used in the calculation. /// \returns A 128-bit vector of [4 x float] whose lower 32 bits contain the sum /// of the lower 32 bits of both operands. The upper 96 bits are copied from /// the upper 96 bits of the first source operand. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_add_ss(__m128 __a, __m128 __b) { __a[0] += __b[0]; return __a; } /// \brief Adds two 128-bit vectors of [4 x float], and returns the results of /// the addition. /// /// \headerfile /// /// This intrinsic corresponds to the VADDPS / ADDPS instructions. /// /// \param __a /// A 128-bit vector of [4 x float] containing one of the source operands. /// \param __b /// A 128-bit vector of [4 x float] containing one of the source operands. /// \returns A 128-bit vector of [4 x float] containing the sums of both /// operands. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_add_ps(__m128 __a, __m128 __b) { return (__m128)((__v4sf)__a + (__v4sf)__b); } /// \brief Subtracts the 32-bit float value in the low-order bits of the second /// operand from the corresponding value in the first operand. /// /// \headerfile /// /// This intrinsic corresponds to the VSUBSS / SUBSS instructions. /// /// \param __a /// A 128-bit vector of [4 x float] containing the minuend. The lower 32 bits /// of this operand are used in the calculation. /// \param __b /// A 128-bit vector of [4 x float] containing the subtrahend. The lower 32 /// bits of this operand are used in the calculation. /// \returns A 128-bit vector of [4 x float] whose lower 32 bits contain the /// difference of the lower 32 bits of both operands. The upper 96 bits are /// copied from the upper 96 bits of the first source operand. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_sub_ss(__m128 __a, __m128 __b) { __a[0] -= __b[0]; return __a; } /// \brief Subtracts each of the values of the second operand from the first /// operand, both of which are 128-bit vectors of [4 x float] and returns /// the results of the subtraction. /// /// \headerfile /// /// This intrinsic corresponds to the VSUBPS / SUBPS instructions. /// /// \param __a /// A 128-bit vector of [4 x float] containing the minuend. /// \param __b /// A 128-bit vector of [4 x float] containing the subtrahend. /// \returns A 128-bit vector of [4 x float] containing the differences between /// both operands. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_sub_ps(__m128 __a, __m128 __b) { return (__m128)((__v4sf)__a - (__v4sf)__b); } /// \brief Multiplies two 32-bit float values in the low-order bits of the /// operands. /// /// \headerfile /// /// This intrinsic corresponds to the VMULSS / MULSS instructions. /// /// \param __a /// A 128-bit vector of [4 x float] containing one of the source operands. /// The lower 32 bits of this operand are used in the calculation. /// \param __b /// A 128-bit vector of [4 x float] containing one of the source operands. /// The lower 32 bits of this operand are used in the calculation. /// \returns A 128-bit vector of [4 x float] containing the product of the lower /// 32 bits of both operands. The upper 96 bits are copied from the upper 96 /// bits of the first source operand. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mul_ss(__m128 __a, __m128 __b) { __a[0] *= __b[0]; return __a; } /// \brief Multiplies two 128-bit vectors of [4 x float] and returns the /// results of the multiplication. /// /// \headerfile /// /// This intrinsic corresponds to the VMULPS / MULPS instructions. /// /// \param __a /// A 128-bit vector of [4 x float] containing one of the source operands. /// \param __b /// A 128-bit vector of [4 x float] containing one of the source operands. /// \returns A 128-bit vector of [4 x float] containing the products of both /// operands. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mul_ps(__m128 __a, __m128 __b) { return (__m128)((__v4sf)__a * (__v4sf)__b); } /// \brief Divides the value in the low-order 32 bits of the first operand by /// the corresponding value in the second operand. /// /// \headerfile /// /// This intrinsic corresponds to the VDIVSS / DIVSS instructions. /// /// \param __a /// A 128-bit vector of [4 x float] containing the dividend. The lower 32 /// bits of this operand are used in the calculation. /// \param __b /// A 128-bit vector of [4 x float] containing the divisor. The lower 32 bits /// of this operand are used in the calculation. /// \returns A 128-bit vector of [4 x float] containing the quotients of the /// lower 32 bits of both operands. The upper 96 bits are copied from the /// upper 96 bits of the first source operand. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_div_ss(__m128 __a, __m128 __b) { __a[0] /= __b[0]; return __a; } /// \brief Divides two 128-bit vectors of [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VDIVPS / DIVPS instructions. /// /// \param __a /// A 128-bit vector of [4 x float] containing the dividend. /// \param __b /// A 128-bit vector of [4 x float] containing the divisor. /// \returns A 128-bit vector of [4 x float] containing the quotients of both /// operands. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_div_ps(__m128 __a, __m128 __b) { return (__m128)((__v4sf)__a / (__v4sf)__b); } /// \brief Calculates the square root of the value stored in the low-order bits /// of a 128-bit vector of [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VSQRTSS / SQRTSS instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the calculation. /// \returns A 128-bit vector of [4 x float] containing the square root of the /// value in the low-order bits of the operand. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_sqrt_ss(__m128 __a) { __m128 __c = __builtin_ia32_sqrtss((__v4sf)__a); return (__m128) { __c[0], __a[1], __a[2], __a[3] }; } /// \brief Calculates the square roots of the values stored in a 128-bit vector /// of [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VSQRTPS / SQRTPS instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. /// \returns A 128-bit vector of [4 x float] containing the square roots of the /// values in the operand. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_sqrt_ps(__m128 __a) { return __builtin_ia32_sqrtps((__v4sf)__a); } /// \brief Calculates the approximate reciprocal of the value stored in the /// low-order bits of a 128-bit vector of [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VRCPSS / RCPSS instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the calculation. /// \returns A 128-bit vector of [4 x float] containing the approximate /// reciprocal of the value in the low-order bits of the operand. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_rcp_ss(__m128 __a) { __m128 __c = __builtin_ia32_rcpss((__v4sf)__a); return (__m128) { __c[0], __a[1], __a[2], __a[3] }; } /// \brief Calculates the approximate reciprocals of the values stored in a /// 128-bit vector of [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VRCPPS / RCPPS instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. /// \returns A 128-bit vector of [4 x float] containing the approximate /// reciprocals of the values in the operand. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_rcp_ps(__m128 __a) { return __builtin_ia32_rcpps((__v4sf)__a); } /// \brief Calculates the approximate reciprocal of the square root of the value /// stored in the low-order bits of a 128-bit vector of [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VRSQRTSS / RSQRTSS instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the calculation. /// \returns A 128-bit vector of [4 x float] containing the approximate /// reciprocal of the square root of the value in the low-order bits of the /// operand. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_rsqrt_ss(__m128 __a) { __m128 __c = __builtin_ia32_rsqrtss((__v4sf)__a); return (__m128) { __c[0], __a[1], __a[2], __a[3] }; } /// \brief Calculates the approximate reciprocals of the square roots of the /// values stored in a 128-bit vector of [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VRSQRTPS / RSQRTPS instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. /// \returns A 128-bit vector of [4 x float] containing the approximate /// reciprocals of the square roots of the values in the operand. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_rsqrt_ps(__m128 __a) { return __builtin_ia32_rsqrtps((__v4sf)__a); } /// \brief Compares two 32-bit float values in the low-order bits of both /// operands and returns the lesser value in the low-order bits of the /// vector of [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VMINSS / MINSS instructions. /// /// \param __a /// A 128-bit vector of [4 x float] containing one of the operands. The lower /// 32 bits of this operand are used in the comparison. /// \param __b /// A 128-bit vector of [4 x float] containing one of the operands. The lower /// 32 bits of this operand are used in the comparison. /// \returns A 128-bit vector of [4 x float] whose lower 32 bits contain the /// minimum value between both operands. The upper 96 bits are copied from /// the upper 96 bits of the first source operand. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_min_ss(__m128 __a, __m128 __b) { return __builtin_ia32_minss((__v4sf)__a, (__v4sf)__b); } /// \brief Compares two 128-bit vectors of [4 x float] and returns the lesser /// of each pair of values. /// /// \headerfile /// /// This intrinsic corresponds to the VMINPS / MINPS instructions. /// /// \param __a /// A 128-bit vector of [4 x float] containing one of the operands. /// \param __b /// A 128-bit vector of [4 x float] containing one of the operands. /// \returns A 128-bit vector of [4 x float] containing the minimum values /// between both operands. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_min_ps(__m128 __a, __m128 __b) { return __builtin_ia32_minps((__v4sf)__a, (__v4sf)__b); } /// \brief Compares two 32-bit float values in the low-order bits of both /// operands and returns the greater value in the low-order bits of a 128-bit /// vector of [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VMAXSS / MAXSS instructions. /// /// \param __a /// A 128-bit vector of [4 x float] containing one of the operands. The lower /// 32 bits of this operand are used in the comparison. /// \param __b /// A 128-bit vector of [4 x float] containing one of the operands. The lower /// 32 bits of this operand are used in the comparison. /// \returns A 128-bit vector of [4 x float] whose lower 32 bits contain the /// maximum value between both operands. The upper 96 bits are copied from /// the upper 96 bits of the first source operand. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_max_ss(__m128 __a, __m128 __b) { return __builtin_ia32_maxss((__v4sf)__a, (__v4sf)__b); } /// \brief Compares two 128-bit vectors of [4 x float] and returns the greater /// of each pair of values. /// /// \headerfile /// /// This intrinsic corresponds to the VMAXPS / MAXPS instructions. /// /// \param __a /// A 128-bit vector of [4 x float] containing one of the operands. /// \param __b /// A 128-bit vector of [4 x float] containing one of the operands. /// \returns A 128-bit vector of [4 x float] containing the maximum values /// between both operands. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_max_ps(__m128 __a, __m128 __b) { return __builtin_ia32_maxps((__v4sf)__a, (__v4sf)__b); } /// \brief Performs a bitwise AND of two 128-bit vectors of [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VANDPS / ANDPS instructions. /// /// \param __a /// A 128-bit vector containing one of the source operands. /// \param __b /// A 128-bit vector containing one of the source operands. /// \returns A 128-bit vector of [4 x float] containing the bitwise AND of the /// values between both operands. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_and_ps(__m128 __a, __m128 __b) { return (__m128)((__v4su)__a & (__v4su)__b); } /// \brief Performs a bitwise AND of two 128-bit vectors of [4 x float], using /// the one's complement of the values contained in the first source /// operand. /// /// \headerfile /// /// This intrinsic corresponds to the VANDNPS / ANDNPS instructions. /// /// \param __a /// A 128-bit vector of [4 x float] containing the first source operand. The /// one's complement of this value is used in the bitwise AND. /// \param __b /// A 128-bit vector of [4 x float] containing the second source operand. /// \returns A 128-bit vector of [4 x float] containing the bitwise AND of the /// one's complement of the first operand and the values in the second /// operand. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_andnot_ps(__m128 __a, __m128 __b) { return (__m128)(~(__v4su)__a & (__v4su)__b); } /// \brief Performs a bitwise OR of two 128-bit vectors of [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VORPS / ORPS instructions. /// /// \param __a /// A 128-bit vector of [4 x float] containing one of the source operands. /// \param __b /// A 128-bit vector of [4 x float] containing one of the source operands. /// \returns A 128-bit vector of [4 x float] containing the bitwise OR of the /// values between both operands. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_or_ps(__m128 __a, __m128 __b) { return (__m128)((__v4su)__a | (__v4su)__b); } /// \brief Performs a bitwise exclusive OR of two 128-bit vectors of /// [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VXORPS / XORPS instructions. /// /// \param __a /// A 128-bit vector of [4 x float] containing one of the source operands. /// \param __b /// A 128-bit vector of [4 x float] containing one of the source operands. /// \returns A 128-bit vector of [4 x float] containing the bitwise exclusive OR /// of the values between both operands. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_xor_ps(__m128 __a, __m128 __b) { return (__m128)((__v4su)__a ^ (__v4su)__b); } /// \brief Compares two 32-bit float values in the low-order bits of both /// operands for equality and returns the result of the comparison in the /// low-order bits of a vector [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPEQSS / CMPEQSS instructions. /// /// \param __a /// A 128-bit vector of [4 x float] containing one of the operands. The lower /// 32 bits of this operand are used in the comparison. /// \param __b /// A 128-bit vector of [4 x float] containing one of the operands. The lower /// 32 bits of this operand are used in the comparison. /// \returns A 128-bit vector of [4 x float] containing the comparison results /// in the low-order bits. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cmpeq_ss(__m128 __a, __m128 __b) { return (__m128)__builtin_ia32_cmpeqss((__v4sf)__a, (__v4sf)__b); } /// \brief Compares each of the corresponding 32-bit float values of the /// 128-bit vectors of [4 x float] for equality. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPEQPS / CMPEQPS instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. /// \param __b /// A 128-bit vector of [4 x float]. /// \returns A 128-bit vector of [4 x float] containing the comparison results. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cmpeq_ps(__m128 __a, __m128 __b) { return (__m128)__builtin_ia32_cmpeqps((__v4sf)__a, (__v4sf)__b); } /// \brief Compares two 32-bit float values in the low-order bits of both /// operands to determine if the value in the first operand is less than the /// corresponding value in the second operand and returns the result of the /// comparison in the low-order bits of a vector of [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPLTSS / CMPLTSS instructions. /// /// \param __a /// A 128-bit vector of [4 x float] containing one of the operands. The lower /// 32 bits of this operand are used in the comparison. /// \param __b /// A 128-bit vector of [4 x float] containing one of the operands. The lower /// 32 bits of this operand are used in the comparison. /// \returns A 128-bit vector of [4 x float] containing the comparison results /// in the low-order bits. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cmplt_ss(__m128 __a, __m128 __b) { return (__m128)__builtin_ia32_cmpltss((__v4sf)__a, (__v4sf)__b); } /// \brief Compares each of the corresponding 32-bit float values of the /// 128-bit vectors of [4 x float] to determine if the values in the first /// operand are less than those in the second operand. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPLTPS / CMPLTPS instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. /// \param __b /// A 128-bit vector of [4 x float]. /// \returns A 128-bit vector of [4 x float] containing the comparison results. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cmplt_ps(__m128 __a, __m128 __b) { return (__m128)__builtin_ia32_cmpltps((__v4sf)__a, (__v4sf)__b); } /// \brief Compares two 32-bit float values in the low-order bits of both /// operands to determine if the value in the first operand is less than or /// equal to the corresponding value in the second operand and returns the /// result of the comparison in the low-order bits of a vector of /// [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPLESS / CMPLESS instructions. /// /// \param __a /// A 128-bit vector of [4 x float] containing one of the operands. The lower /// 32 bits of this operand are used in the comparison. /// \param __b /// A 128-bit vector of [4 x float] containing one of the operands. The lower /// 32 bits of this operand are used in the comparison. /// \returns A 128-bit vector of [4 x float] containing the comparison results /// in the low-order bits. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cmple_ss(__m128 __a, __m128 __b) { return (__m128)__builtin_ia32_cmpless((__v4sf)__a, (__v4sf)__b); } /// \brief Compares each of the corresponding 32-bit float values of the /// 128-bit vectors of [4 x float] to determine if the values in the first /// operand are less than or equal to those in the second operand. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPLEPS / CMPLEPS instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. /// \param __b /// A 128-bit vector of [4 x float]. /// \returns A 128-bit vector of [4 x float] containing the comparison results. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cmple_ps(__m128 __a, __m128 __b) { return (__m128)__builtin_ia32_cmpleps((__v4sf)__a, (__v4sf)__b); } /// \brief Compares two 32-bit float values in the low-order bits of both /// operands to determine if the value in the first operand is greater than /// the corresponding value in the second operand and returns the result of /// the comparison in the low-order bits of a vector of [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPLTSS / CMPLTSS instructions. /// /// \param __a /// A 128-bit vector of [4 x float] containing one of the operands. The lower /// 32 bits of this operand are used in the comparison. /// \param __b /// A 128-bit vector of [4 x float] containing one of the operands. The lower /// 32 bits of this operand are used in the comparison. /// \returns A 128-bit vector of [4 x float] containing the comparison results /// in the low-order bits. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cmpgt_ss(__m128 __a, __m128 __b) { return (__m128)__builtin_shufflevector((__v4sf)__a, (__v4sf)__builtin_ia32_cmpltss((__v4sf)__b, (__v4sf)__a), 4, 1, 2, 3); } /// \brief Compares each of the corresponding 32-bit float values of the /// 128-bit vectors of [4 x float] to determine if the values in the first /// operand are greater than those in the second operand. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPLTPS / CMPLTPS instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. /// \param __b /// A 128-bit vector of [4 x float]. /// \returns A 128-bit vector of [4 x float] containing the comparison results. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cmpgt_ps(__m128 __a, __m128 __b) { return (__m128)__builtin_ia32_cmpltps((__v4sf)__b, (__v4sf)__a); } /// \brief Compares two 32-bit float values in the low-order bits of both /// operands to determine if the value in the first operand is greater than /// or equal to the corresponding value in the second operand and returns /// the result of the comparison in the low-order bits of a vector of /// [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPLESS / CMPLESS instructions. /// /// \param __a /// A 128-bit vector of [4 x float] containing one of the operands. The lower /// 32 bits of this operand are used in the comparison. /// \param __b /// A 128-bit vector of [4 x float] containing one of the operands. The lower /// 32 bits of this operand are used in the comparison. /// \returns A 128-bit vector of [4 x float] containing the comparison results /// in the low-order bits. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cmpge_ss(__m128 __a, __m128 __b) { return (__m128)__builtin_shufflevector((__v4sf)__a, (__v4sf)__builtin_ia32_cmpless((__v4sf)__b, (__v4sf)__a), 4, 1, 2, 3); } /// \brief Compares each of the corresponding 32-bit float values of the /// 128-bit vectors of [4 x float] to determine if the values in the first /// operand are greater than or equal to those in the second operand. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPLEPS / CMPLEPS instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. /// \param __b /// A 128-bit vector of [4 x float]. /// \returns A 128-bit vector of [4 x float] containing the comparison results. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cmpge_ps(__m128 __a, __m128 __b) { return (__m128)__builtin_ia32_cmpleps((__v4sf)__b, (__v4sf)__a); } /// \brief Compares two 32-bit float values in the low-order bits of both /// operands for inequality and returns the result of the comparison in the /// low-order bits of a vector of [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPNEQSS / CMPNEQSS /// instructions. /// /// \param __a /// A 128-bit vector of [4 x float] containing one of the operands. The lower /// 32 bits of this operand are used in the comparison. /// \param __b /// A 128-bit vector of [4 x float] containing one of the operands. The lower /// 32 bits of this operand are used in the comparison. /// \returns A 128-bit vector of [4 x float] containing the comparison results /// in the low-order bits. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cmpneq_ss(__m128 __a, __m128 __b) { return (__m128)__builtin_ia32_cmpneqss((__v4sf)__a, (__v4sf)__b); } /// \brief Compares each of the corresponding 32-bit float values of the /// 128-bit vectors of [4 x float] for inequality. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPNEQPS / CMPNEQPS /// instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. /// \param __b /// A 128-bit vector of [4 x float]. /// \returns A 128-bit vector of [4 x float] containing the comparison results. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cmpneq_ps(__m128 __a, __m128 __b) { return (__m128)__builtin_ia32_cmpneqps((__v4sf)__a, (__v4sf)__b); } /// \brief Compares two 32-bit float values in the low-order bits of both /// operands to determine if the value in the first operand is not less than /// the corresponding value in the second operand and returns the result of /// the comparison in the low-order bits of a vector of [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPNLTSS / CMPNLTSS /// instructions. /// /// \param __a /// A 128-bit vector of [4 x float] containing one of the operands. The lower /// 32 bits of this operand are used in the comparison. /// \param __b /// A 128-bit vector of [4 x float] containing one of the operands. The lower /// 32 bits of this operand are used in the comparison. /// \returns A 128-bit vector of [4 x float] containing the comparison results /// in the low-order bits. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cmpnlt_ss(__m128 __a, __m128 __b) { return (__m128)__builtin_ia32_cmpnltss((__v4sf)__a, (__v4sf)__b); } /// \brief Compares each of the corresponding 32-bit float values of the /// 128-bit vectors of [4 x float] to determine if the values in the first /// operand are not less than those in the second operand. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPNLTPS / CMPNLTPS /// instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. /// \param __b /// A 128-bit vector of [4 x float]. /// \returns A 128-bit vector of [4 x float] containing the comparison results. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cmpnlt_ps(__m128 __a, __m128 __b) { return (__m128)__builtin_ia32_cmpnltps((__v4sf)__a, (__v4sf)__b); } /// \brief Compares two 32-bit float values in the low-order bits of both /// operands to determine if the value in the first operand is not less than /// or equal to the corresponding value in the second operand and returns /// the result of the comparison in the low-order bits of a vector of /// [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPNLESS / CMPNLESS /// instructions. /// /// \param __a /// A 128-bit vector of [4 x float] containing one of the operands. The lower /// 32 bits of this operand are used in the comparison. /// \param __b /// A 128-bit vector of [4 x float] containing one of the operands. The lower /// 32 bits of this operand are used in the comparison. /// \returns A 128-bit vector of [4 x float] containing the comparison results /// in the low-order bits. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cmpnle_ss(__m128 __a, __m128 __b) { return (__m128)__builtin_ia32_cmpnless((__v4sf)__a, (__v4sf)__b); } /// \brief Compares each of the corresponding 32-bit float values of the /// 128-bit vectors of [4 x float] to determine if the values in the first /// operand are not less than or equal to those in the second operand. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPNLEPS / CMPNLEPS /// instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. /// \param __b /// A 128-bit vector of [4 x float]. /// \returns A 128-bit vector of [4 x float] containing the comparison results. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cmpnle_ps(__m128 __a, __m128 __b) { return (__m128)__builtin_ia32_cmpnleps((__v4sf)__a, (__v4sf)__b); } /// \brief Compares two 32-bit float values in the low-order bits of both /// operands to determine if the value in the first operand is not greater /// than the corresponding value in the second operand and returns the /// result of the comparison in the low-order bits of a vector of /// [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPNLTSS / CMPNLTSS /// instructions. /// /// \param __a /// A 128-bit vector of [4 x float] containing one of the operands. The lower /// 32 bits of this operand are used in the comparison. /// \param __b /// A 128-bit vector of [4 x float] containing one of the operands. The lower /// 32 bits of this operand are used in the comparison. /// \returns A 128-bit vector of [4 x float] containing the comparison results /// in the low-order bits. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cmpngt_ss(__m128 __a, __m128 __b) { return (__m128)__builtin_shufflevector((__v4sf)__a, (__v4sf)__builtin_ia32_cmpnltss((__v4sf)__b, (__v4sf)__a), 4, 1, 2, 3); } /// \brief Compares each of the corresponding 32-bit float values of the /// 128-bit vectors of [4 x float] to determine if the values in the first /// operand are not greater than those in the second operand. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPNLTPS / CMPNLTPS /// instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. /// \param __b /// A 128-bit vector of [4 x float]. /// \returns A 128-bit vector of [4 x float] containing the comparison results. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cmpngt_ps(__m128 __a, __m128 __b) { return (__m128)__builtin_ia32_cmpnltps((__v4sf)__b, (__v4sf)__a); } /// \brief Compares two 32-bit float values in the low-order bits of both /// operands to determine if the value in the first operand is not greater /// than or equal to the corresponding value in the second operand and /// returns the result of the comparison in the low-order bits of a vector /// of [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPNLESS / CMPNLESS /// instructions. /// /// \param __a /// A 128-bit vector of [4 x float] containing one of the operands. The lower /// 32 bits of this operand are used in the comparison. /// \param __b /// A 128-bit vector of [4 x float] containing one of the operands. The lower /// 32 bits of this operand are used in the comparison. /// \returns A 128-bit vector of [4 x float] containing the comparison results /// in the low-order bits. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cmpnge_ss(__m128 __a, __m128 __b) { return (__m128)__builtin_shufflevector((__v4sf)__a, (__v4sf)__builtin_ia32_cmpnless((__v4sf)__b, (__v4sf)__a), 4, 1, 2, 3); } /// \brief Compares each of the corresponding 32-bit float values of the /// 128-bit vectors of [4 x float] to determine if the values in the first /// operand are not greater than or equal to those in the second operand. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPNLEPS / CMPNLEPS /// instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. /// \param __b /// A 128-bit vector of [4 x float]. /// \returns A 128-bit vector of [4 x float] containing the comparison results. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cmpnge_ps(__m128 __a, __m128 __b) { return (__m128)__builtin_ia32_cmpnleps((__v4sf)__b, (__v4sf)__a); } /// \brief Compares two 32-bit float values in the low-order bits of both /// operands to determine if the value in the first operand is ordered with /// respect to the corresponding value in the second operand and returns the /// result of the comparison in the low-order bits of a vector of /// [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPORDSS / CMPORDSS /// instructions. /// /// \param __a /// A 128-bit vector of [4 x float] containing one of the operands. The lower /// 32 bits of this operand are used in the comparison. /// \param __b /// A 128-bit vector of [4 x float] containing one of the operands. The lower /// 32 bits of this operand are used in the comparison. /// \returns A 128-bit vector of [4 x float] containing the comparison results /// in the low-order bits. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cmpord_ss(__m128 __a, __m128 __b) { return (__m128)__builtin_ia32_cmpordss((__v4sf)__a, (__v4sf)__b); } /// \brief Compares each of the corresponding 32-bit float values of the /// 128-bit vectors of [4 x float] to determine if the values in the first /// operand are ordered with respect to those in the second operand. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPORDPS / CMPORDPS /// instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. /// \param __b /// A 128-bit vector of [4 x float]. /// \returns A 128-bit vector of [4 x float] containing the comparison results. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cmpord_ps(__m128 __a, __m128 __b) { return (__m128)__builtin_ia32_cmpordps((__v4sf)__a, (__v4sf)__b); } /// \brief Compares two 32-bit float values in the low-order bits of both /// operands to determine if the value in the first operand is unordered /// with respect to the corresponding value in the second operand and /// returns the result of the comparison in the low-order bits of a vector /// of [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPUNORDSS / CMPUNORDSS /// instructions. /// /// \param __a /// A 128-bit vector of [4 x float] containing one of the operands. The lower /// 32 bits of this operand are used in the comparison. /// \param __b /// A 128-bit vector of [4 x float] containing one of the operands. The lower /// 32 bits of this operand are used in the comparison. /// \returns A 128-bit vector of [4 x float] containing the comparison results /// in the low-order bits. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cmpunord_ss(__m128 __a, __m128 __b) { return (__m128)__builtin_ia32_cmpunordss((__v4sf)__a, (__v4sf)__b); } /// \brief Compares each of the corresponding 32-bit float values of the /// 128-bit vectors of [4 x float] to determine if the values in the first /// operand are unordered with respect to those in the second operand. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPUNORDPS / CMPUNORDPS /// instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. /// \param __b /// A 128-bit vector of [4 x float]. /// \returns A 128-bit vector of [4 x float] containing the comparison results. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cmpunord_ps(__m128 __a, __m128 __b) { return (__m128)__builtin_ia32_cmpunordps((__v4sf)__a, (__v4sf)__b); } /// \brief Compares two 32-bit float values in the low-order bits of both /// operands for equality and returns the result of the comparison. /// /// \headerfile /// /// This intrinsic corresponds to the VCOMISS / COMISS /// instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the comparison. /// \param __b /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the comparison. /// \returns An integer containing the comparison results. static __inline__ int __DEFAULT_FN_ATTRS _mm_comieq_ss(__m128 __a, __m128 __b) { return __builtin_ia32_comieq((__v4sf)__a, (__v4sf)__b); } /// \brief Compares two 32-bit float values in the low-order bits of both /// operands to determine if the first operand is less than the second /// operand and returns the result of the comparison. /// /// \headerfile /// /// This intrinsic corresponds to the VCOMISS / COMISS /// instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the comparison. /// \param __b /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the comparison. /// \returns An integer containing the comparison results. static __inline__ int __DEFAULT_FN_ATTRS _mm_comilt_ss(__m128 __a, __m128 __b) { return __builtin_ia32_comilt((__v4sf)__a, (__v4sf)__b); } /// \brief Compares two 32-bit float values in the low-order bits of both /// operands to determine if the first operand is less than or equal to the /// second operand and returns the result of the comparison. /// /// \headerfile /// /// This intrinsic corresponds to the VCOMISS / COMISS instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the comparison. /// \param __b /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the comparison. /// \returns An integer containing the comparison results. static __inline__ int __DEFAULT_FN_ATTRS _mm_comile_ss(__m128 __a, __m128 __b) { return __builtin_ia32_comile((__v4sf)__a, (__v4sf)__b); } /// \brief Compares two 32-bit float values in the low-order bits of both /// operands to determine if the first operand is greater than the second /// operand and returns the result of the comparison. /// /// \headerfile /// /// This intrinsic corresponds to the VCOMISS / COMISS instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the comparison. /// \param __b /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the comparison. /// \returns An integer containing the comparison results. static __inline__ int __DEFAULT_FN_ATTRS _mm_comigt_ss(__m128 __a, __m128 __b) { return __builtin_ia32_comigt((__v4sf)__a, (__v4sf)__b); } /// \brief Compares two 32-bit float values in the low-order bits of both /// operands to determine if the first operand is greater than or equal to /// the second operand and returns the result of the comparison. /// /// \headerfile /// /// This intrinsic corresponds to the VCOMISS / COMISS instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the comparison. /// \param __b /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the comparison. /// \returns An integer containing the comparison results. static __inline__ int __DEFAULT_FN_ATTRS _mm_comige_ss(__m128 __a, __m128 __b) { return __builtin_ia32_comige((__v4sf)__a, (__v4sf)__b); } /// \brief Compares two 32-bit float values in the low-order bits of both /// operands to determine if the first operand is not equal to the second /// operand and returns the result of the comparison. /// /// \headerfile /// /// This intrinsic corresponds to the VCOMISS / COMISS instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the comparison. /// \param __b /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the comparison. /// \returns An integer containing the comparison results. static __inline__ int __DEFAULT_FN_ATTRS _mm_comineq_ss(__m128 __a, __m128 __b) { return __builtin_ia32_comineq((__v4sf)__a, (__v4sf)__b); } /// \brief Performs an unordered comparison of two 32-bit float values using /// the low-order bits of both operands to determine equality and returns /// the result of the comparison. /// /// \headerfile /// /// This intrinsic corresponds to the VUCOMISS / UCOMISS instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the comparison. /// \param __b /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the comparison. /// \returns An integer containing the comparison results. static __inline__ int __DEFAULT_FN_ATTRS _mm_ucomieq_ss(__m128 __a, __m128 __b) { return __builtin_ia32_ucomieq((__v4sf)__a, (__v4sf)__b); } /// \brief Performs an unordered comparison of two 32-bit float values using /// the low-order bits of both operands to determine if the first operand is /// less than the second operand and returns the result of the comparison. /// /// \headerfile /// /// This intrinsic corresponds to the VUCOMISS / UCOMISS instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the comparison. /// \param __b /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the comparison. /// \returns An integer containing the comparison results. static __inline__ int __DEFAULT_FN_ATTRS _mm_ucomilt_ss(__m128 __a, __m128 __b) { return __builtin_ia32_ucomilt((__v4sf)__a, (__v4sf)__b); } /// \brief Performs an unordered comparison of two 32-bit float values using /// the low-order bits of both operands to determine if the first operand is /// less than or equal to the second operand and returns the result of the /// comparison. /// /// \headerfile /// /// This intrinsic corresponds to the VUCOMISS / UCOMISS instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the comparison. /// \param __b /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the comparison. /// \returns An integer containing the comparison results. static __inline__ int __DEFAULT_FN_ATTRS _mm_ucomile_ss(__m128 __a, __m128 __b) { return __builtin_ia32_ucomile((__v4sf)__a, (__v4sf)__b); } /// \brief Performs an unordered comparison of two 32-bit float values using /// the low-order bits of both operands to determine if the first operand is /// greater than the second operand and returns the result of the /// comparison. /// /// \headerfile /// /// This intrinsic corresponds to the VUCOMISS / UCOMISS instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the comparison. /// \param __b /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the comparison. /// \returns An integer containing the comparison results. static __inline__ int __DEFAULT_FN_ATTRS _mm_ucomigt_ss(__m128 __a, __m128 __b) { return __builtin_ia32_ucomigt((__v4sf)__a, (__v4sf)__b); } /// \brief Performs an unordered comparison of two 32-bit float values using /// the low-order bits of both operands to determine if the first operand is /// greater than or equal to the second operand and returns the result of /// the comparison. /// /// \headerfile /// /// This intrinsic corresponds to the VUCOMISS / UCOMISS instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the comparison. /// \param __b /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the comparison. /// \returns An integer containing the comparison results. static __inline__ int __DEFAULT_FN_ATTRS _mm_ucomige_ss(__m128 __a, __m128 __b) { return __builtin_ia32_ucomige((__v4sf)__a, (__v4sf)__b); } /// \brief Performs an unordered comparison of two 32-bit float values using /// the low-order bits of both operands to determine inequality and returns /// the result of the comparison. /// /// \headerfile /// /// This intrinsic corresponds to the VUCOMISS / UCOMISS instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the comparison. /// \param __b /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the comparison. /// \returns An integer containing the comparison results. static __inline__ int __DEFAULT_FN_ATTRS _mm_ucomineq_ss(__m128 __a, __m128 __b) { return __builtin_ia32_ucomineq((__v4sf)__a, (__v4sf)__b); } /// \brief Converts a float value contained in the lower 32 bits of a vector of /// [4 x float] into a 32-bit integer. /// /// \headerfile /// /// This intrinsic corresponds to the VCVTSS2SI / CVTSS2SI /// instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the conversion. /// \returns A 32-bit integer containing the converted value. static __inline__ int __DEFAULT_FN_ATTRS _mm_cvtss_si32(__m128 __a) { return __builtin_ia32_cvtss2si((__v4sf)__a); } /// \brief Converts a float value contained in the lower 32 bits of a vector of /// [4 x float] into a 32-bit integer. /// /// \headerfile /// /// This intrinsic corresponds to the VCVTSS2SI / CVTSS2SI /// instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the conversion. /// \returns A 32-bit integer containing the converted value. static __inline__ int __DEFAULT_FN_ATTRS _mm_cvt_ss2si(__m128 __a) { return _mm_cvtss_si32(__a); } #ifdef __x86_64__ /// \brief Converts a float value contained in the lower 32 bits of a vector of /// [4 x float] into a 64-bit integer. /// /// \headerfile /// /// This intrinsic corresponds to the VCVTSS2SI / CVTSS2SI /// instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the conversion. /// \returns A 64-bit integer containing the converted value. static __inline__ long long __DEFAULT_FN_ATTRS _mm_cvtss_si64(__m128 __a) { return __builtin_ia32_cvtss2si64((__v4sf)__a); } #endif # 1324 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xmmintrin.h" 3 /// \brief Converts two low-order float values in a 128-bit vector of /// [4 x float] into a 64-bit vector of [2 x i32]. /// /// \headerfile /// /// This intrinsic corresponds to the CVTPS2PI instruction. /// /// \param __a /// A 128-bit vector of [4 x float]. /// \returns A 64-bit integer vector containing the converted values. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_cvtps_pi32(__m128 __a) { return (__m64)__builtin_ia32_cvtps2pi((__v4sf)__a); } /// \brief Converts two low-order float values in a 128-bit vector of /// [4 x float] into a 64-bit vector of [2 x i32]. /// /// \headerfile /// /// This intrinsic corresponds to the CVTPS2PI instruction. /// /// \param __a /// A 128-bit vector of [4 x float]. /// \returns A 64-bit integer vector containing the converted values. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_cvt_ps2pi(__m128 __a) { return _mm_cvtps_pi32(__a); } /// \brief Converts a float value contained in the lower 32 bits of a vector of /// [4 x float] into a 32-bit integer, truncating the result when it is /// inexact. /// /// \headerfile /// /// This intrinsic corresponds to the VCVTTSS2SI / CVTTSS2SI /// instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the conversion. /// \returns A 32-bit integer containing the converted value. static __inline__ int __DEFAULT_FN_ATTRS _mm_cvttss_si32(__m128 __a) { return __builtin_ia32_cvttss2si((__v4sf)__a); } /// \brief Converts a float value contained in the lower 32 bits of a vector of /// [4 x float] into a 32-bit integer, truncating the result when it is /// inexact. /// /// \headerfile /// /// This intrinsic corresponds to the VCVTTSS2SI / CVTTSS2SI /// instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the conversion. /// \returns A 32-bit integer containing the converted value. static __inline__ int __DEFAULT_FN_ATTRS _mm_cvtt_ss2si(__m128 __a) { return _mm_cvttss_si32(__a); } #ifdef __x86_64__ /// \brief Converts a float value contained in the lower 32 bits of a vector of /// [4 x float] into a 64-bit integer, truncating the result when it is /// inexact. /// /// \headerfile /// /// This intrinsic corresponds to the VCVTTSS2SI / CVTTSS2SI /// instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the conversion. /// \returns A 64-bit integer containing the converted value. static __inline__ long long __DEFAULT_FN_ATTRS _mm_cvttss_si64(__m128 __a) { return __builtin_ia32_cvttss2si64((__v4sf)__a); } #endif # 1415 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xmmintrin.h" 3 /// \brief Converts two low-order float values in a 128-bit vector of /// [4 x float] into a 64-bit vector of [2 x i32], truncating the result /// when it is inexact. /// /// \headerfile /// /// This intrinsic corresponds to the CVTTPS2PI / VTTPS2PI /// instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. /// \returns A 64-bit integer vector containing the converted values. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_cvttps_pi32(__m128 __a) { return (__m64)__builtin_ia32_cvttps2pi((__v4sf)__a); } /// \brief Converts two low-order float values in a 128-bit vector of [4 x /// float] into a 64-bit vector of [2 x i32], truncating the result when it /// is inexact. /// /// \headerfile /// /// This intrinsic corresponds to the CVTTPS2PI instruction. /// /// \param __a /// A 128-bit vector of [4 x float]. /// \returns A 64-bit integer vector containing the converted values. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_cvtt_ps2pi(__m128 __a) { return _mm_cvttps_pi32(__a); } /// \brief Converts a 32-bit signed integer value into a floating point value /// and writes it to the lower 32 bits of the destination. The remaining /// higher order elements of the destination vector are copied from the /// corresponding elements in the first operand. /// /// \headerfile /// /// This intrinsic corresponds to the VCVTSI2SS / CVTSI2SS instruction. /// /// \param __a /// A 128-bit vector of [4 x float]. /// \param __b /// A 32-bit signed integer operand containing the value to be converted. /// \returns A 128-bit vector of [4 x float] whose lower 32 bits contain the /// converted value of the second operand. The upper 96 bits are copied from /// the upper 96 bits of the first operand. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cvtsi32_ss(__m128 __a, int __b) { __a[0] = __b; return __a; } /// \brief Converts a 32-bit signed integer value into a floating point value /// and writes it to the lower 32 bits of the destination. The remaining /// higher order elements of the destination are copied from the /// corresponding elements in the first operand. /// /// \headerfile /// /// This intrinsic corresponds to the VCVTSI2SS / CVTSI2SS instruction. /// /// \param __a /// A 128-bit vector of [4 x float]. /// \param __b /// A 32-bit signed integer operand containing the value to be converted. /// \returns A 128-bit vector of [4 x float] whose lower 32 bits contain the /// converted value of the second operand. The upper 96 bits are copied from /// the upper 96 bits of the first operand. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cvt_si2ss(__m128 __a, int __b) { return _mm_cvtsi32_ss(__a, __b); } #ifdef __x86_64__ /// \brief Converts a 64-bit signed integer value into a floating point value /// and writes it to the lower 32 bits of the destination. The remaining /// higher order elements of the destination are copied from the /// corresponding elements in the first operand. /// /// \headerfile /// /// This intrinsic corresponds to the VCVTSI2SS / CVTSI2SS instruction. /// /// \param __a /// A 128-bit vector of [4 x float]. /// \param __b /// A 64-bit signed integer operand containing the value to be converted. /// \returns A 128-bit vector of [4 x float] whose lower 32 bits contain the /// converted value of the second operand. The upper 96 bits are copied from /// the upper 96 bits of the first operand. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cvtsi64_ss(__m128 __a, long long __b) { __a[0] = __b; return __a; } #endif # 1522 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xmmintrin.h" 3 /// \brief Converts two elements of a 64-bit vector of [2 x i32] into two /// floating point values and writes them to the lower 64-bits of the /// destination. The remaining higher order elements of the destination are /// copied from the corresponding elements in the first operand. /// /// \headerfile /// /// This intrinsic corresponds to the CVTPI2PS instruction. /// /// \param __a /// A 128-bit vector of [4 x float]. /// \param __b /// A 64-bit vector of [2 x i32]. The elements in this vector are converted /// and written to the corresponding low-order elements in the destination. /// \returns A 128-bit vector of [4 x float] whose lower 64 bits contain the /// converted value of the second operand. The upper 64 bits are copied from /// the upper 64 bits of the first operand. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cvtpi32_ps(__m128 __a, __m64 __b) { return __builtin_ia32_cvtpi2ps((__v4sf)__a, (__v2si)__b); } /// \brief Converts two elements of a 64-bit vector of [2 x i32] into two /// floating point values and writes them to the lower 64-bits of the /// destination. The remaining higher order elements of the destination are /// copied from the corresponding elements in the first operand. /// /// \headerfile /// /// This intrinsic corresponds to the CVTPI2PS instruction. /// /// \param __a /// A 128-bit vector of [4 x float]. /// \param __b /// A 64-bit vector of [2 x i32]. The elements in this vector are converted /// and written to the corresponding low-order elements in the destination. /// \returns A 128-bit vector of [4 x float] whose lower 64 bits contain the /// converted value from the second operand. The upper 64 bits are copied /// from the upper 64 bits of the first operand. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cvt_pi2ps(__m128 __a, __m64 __b) { return _mm_cvtpi32_ps(__a, __b); } /// \brief Extracts a float value contained in the lower 32 bits of a vector of /// [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVSS / MOVSS instruction. /// /// \param __a /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the extraction. /// \returns A 32-bit float containing the extracted value. static __inline__ float __DEFAULT_FN_ATTRS _mm_cvtss_f32(__m128 __a) { return __a[0]; } /// \brief Loads two packed float values from the address \a __p into the /// high-order bits of a 128-bit vector of [4 x float]. The low-order bits /// are copied from the low-order bits of the first operand. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVHPD / MOVHPD instruction. /// /// \param __a /// A 128-bit vector of [4 x float]. Bits [63:0] are written to bits [63:0] /// of the destination. /// \param __p /// A pointer to two packed float values. Bits [63:0] are written to bits /// [127:64] of the destination. /// \returns A 128-bit vector of [4 x float] containing the moved values. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_loadh_pi(__m128 __a, const __m64 *__p) { typedef float __mm_loadh_pi_v2f32 __attribute__((__vector_size__(8))); struct __mm_loadh_pi_struct { __mm_loadh_pi_v2f32 __u; } __attribute__((__packed__, __may_alias__)); __mm_loadh_pi_v2f32 __b = ((struct __mm_loadh_pi_struct*)__p)->__u; __m128 __bb = __builtin_shufflevector(__b, __b, 0, 1, 0, 1); return __builtin_shufflevector(__a, __bb, 0, 1, 4, 5); } /// \brief Loads two packed float values from the address \a __p into the /// low-order bits of a 128-bit vector of [4 x float]. The high-order bits /// are copied from the high-order bits of the first operand. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVLPD / MOVLPD instruction. /// /// \param __a /// A 128-bit vector of [4 x float]. Bits [127:64] are written to bits /// [127:64] of the destination. /// \param __p /// A pointer to two packed float values. Bits [63:0] are written to bits /// [63:0] of the destination. /// \returns A 128-bit vector of [4 x float] containing the moved values. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_loadl_pi(__m128 __a, const __m64 *__p) { typedef float __mm_loadl_pi_v2f32 __attribute__((__vector_size__(8))); struct __mm_loadl_pi_struct { __mm_loadl_pi_v2f32 __u; } __attribute__((__packed__, __may_alias__)); __mm_loadl_pi_v2f32 __b = ((struct __mm_loadl_pi_struct*)__p)->__u; __m128 __bb = __builtin_shufflevector(__b, __b, 0, 1, 0, 1); return __builtin_shufflevector(__a, __bb, 4, 5, 2, 3); } /// \brief Constructs a 128-bit floating-point vector of [4 x float]. The lower /// 32 bits of the vector are initialized with the single-precision /// floating-point value loaded from a specified memory location. The upper /// 96 bits are set to zero. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVSS / MOVSS instruction. /// /// \param __p /// A pointer to a 32-bit memory location containing a single-precision /// floating-point value. /// \returns An initialized 128-bit floating-point vector of [4 x float]. The /// lower 32 bits contain the value loaded from the memory location. The /// upper 96 bits are set to zero. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_load_ss(const float *__p) { struct __mm_load_ss_struct { float __u; } __attribute__((__packed__, __may_alias__)); float __u = ((struct __mm_load_ss_struct*)__p)->__u; return (__m128){ __u, 0, 0, 0 }; } /// \brief Loads a 32-bit float value and duplicates it to all four vector /// elements of a 128-bit vector of [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVSS / MOVSS + shuffling /// instruction. /// /// \param __p /// A pointer to a float value to be loaded and duplicated. /// \returns A 128-bit vector of [4 x float] containing the loaded and /// duplicated values. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_load1_ps(const float *__p) { struct __mm_load1_ps_struct { float __u; } __attribute__((__packed__, __may_alias__)); float __u = ((struct __mm_load1_ps_struct*)__p)->__u; return (__m128){ __u, __u, __u, __u }; } #define _mm_load_ps1(p) _mm_load1_ps(p) /// \brief Loads a 128-bit floating-point vector of [4 x float] from an aligned /// memory location. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVAPS / MOVAPS instruction. /// /// \param __p /// A pointer to a 128-bit memory location. The address of the memory /// location has to be 128-bit aligned. /// \returns A 128-bit vector of [4 x float] containing the loaded valus. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_load_ps(const float *__p) { return *(__m128*)__p; } /// \brief Loads a 128-bit floating-point vector of [4 x float] from an /// unaligned memory location. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVUPS / MOVUPS instruction. /// /// \param __p /// A pointer to a 128-bit memory location. The address of the memory /// location does not have to be aligned. /// \returns A 128-bit vector of [4 x float] containing the loaded values. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_loadu_ps(const float *__p) { struct __loadu_ps { __m128 __v; } __attribute__((__packed__, __may_alias__)); return ((struct __loadu_ps*)__p)->__v; } /// \brief Loads four packed float values, in reverse order, from an aligned /// memory location to 32-bit elements in a 128-bit vector of [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVAPS / MOVAPS + shuffling /// instruction. /// /// \param __p /// A pointer to a 128-bit memory location. The address of the memory /// location has to be 128-bit aligned. /// \returns A 128-bit vector of [4 x float] containing the moved values, loaded /// in reverse order. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_loadr_ps(const float *__p) { __m128 __a = _mm_load_ps(__p); return __builtin_shufflevector((__v4sf)__a, (__v4sf)__a, 3, 2, 1, 0); } /// \brief Create a 128-bit vector of [4 x float] with undefined values. /// /// \headerfile /// /// This intrinsic has no corresponding instruction. /// /// \returns A 128-bit vector of [4 x float] containing undefined values. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_undefined_ps(void) { return (__m128)__builtin_ia32_undef128(); } /// \brief Constructs a 128-bit floating-point vector of [4 x float]. The lower /// 32 bits of the vector are initialized with the specified single-precision /// floating-point value. The upper 96 bits are set to zero. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVSS / MOVSS instruction. /// /// \param __w /// A single-precision floating-point value used to initialize the lower 32 /// bits of the result. /// \returns An initialized 128-bit floating-point vector of [4 x float]. The /// lower 32 bits contain the value provided in the source operand. The /// upper 96 bits are set to zero. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_set_ss(float __w) { return (__m128){ __w, 0, 0, 0 }; } /// \brief Constructs a 128-bit floating-point vector of [4 x float], with each /// of the four single-precision floating-point vector elements set to the /// specified single-precision floating-point value. /// /// \headerfile /// /// This intrinsic corresponds to the VPERMILPS / PERMILPS instruction. /// /// \param __w /// A single-precision floating-point value used to initialize each vector /// element of the result. /// \returns An initialized 128-bit floating-point vector of [4 x float]. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_set1_ps(float __w) { return (__m128){ __w, __w, __w, __w }; } /* Microsoft specific. */ /// \brief Constructs a 128-bit floating-point vector of [4 x float], with each /// of the four single-precision floating-point vector elements set to the /// specified single-precision floating-point value. /// /// \headerfile /// /// This intrinsic corresponds to the VPERMILPS / PERMILPS instruction. /// /// \param __w /// A single-precision floating-point value used to initialize each vector /// element of the result. /// \returns An initialized 128-bit floating-point vector of [4 x float]. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_set_ps1(float __w) { return _mm_set1_ps(__w); } /// \brief Constructs a 128-bit floating-point vector of [4 x float] /// initialized with the specified single-precision floating-point values. /// /// \headerfile /// /// This intrinsic is a utility function and does not correspond to a specific /// instruction. /// /// \param __z /// A single-precision floating-point value used to initialize bits [127:96] /// of the result. /// \param __y /// A single-precision floating-point value used to initialize bits [95:64] /// of the result. /// \param __x /// A single-precision floating-point value used to initialize bits [63:32] /// of the result. /// \param __w /// A single-precision floating-point value used to initialize bits [31:0] /// of the result. /// \returns An initialized 128-bit floating-point vector of [4 x float]. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_set_ps(float __z, float __y, float __x, float __w) { return (__m128){ __w, __x, __y, __z }; } /// \brief Constructs a 128-bit floating-point vector of [4 x float], /// initialized in reverse order with the specified 32-bit single-precision /// float-point values. /// /// \headerfile /// /// This intrinsic is a utility function and does not correspond to a specific /// instruction. /// /// \param __z /// A single-precision floating-point value used to initialize bits [31:0] /// of the result. /// \param __y /// A single-precision floating-point value used to initialize bits [63:32] /// of the result. /// \param __x /// A single-precision floating-point value used to initialize bits [95:64] /// of the result. /// \param __w /// A single-precision floating-point value used to initialize bits [127:96] /// of the result. /// \returns An initialized 128-bit floating-point vector of [4 x float]. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_setr_ps(float __z, float __y, float __x, float __w) { return (__m128){ __z, __y, __x, __w }; } /// \brief Constructs a 128-bit floating-point vector of [4 x float] initialized /// to zero. /// /// \headerfile /// /// This intrinsic corresponds to the VXORPS / XORPS instruction. /// /// \returns An initialized 128-bit floating-point vector of [4 x float] with /// all elements set to zero. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_setzero_ps(void) { return (__m128){ 0, 0, 0, 0 }; } /// \brief Stores the upper 64 bits of a 128-bit vector of [4 x float] to a /// memory location. /// /// \headerfile /// /// This intrinsic corresponds to the VPEXTRQ / MOVQ instruction. /// /// \param __p /// A pointer to a 64-bit memory location. /// \param __a /// A 128-bit vector of [4 x float] containing the values to be stored. static __inline__ void __DEFAULT_FN_ATTRS _mm_storeh_pi(__m64 *__p, __m128 __a) { __builtin_ia32_storehps((__v2si *)__p, (__v4sf)__a); } /// \brief Stores the lower 64 bits of a 128-bit vector of [4 x float] to a /// memory location. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVLPS / MOVLPS instruction. /// /// \param __p /// A pointer to a memory location that will receive the float values. /// \param __a /// A 128-bit vector of [4 x float] containing the values to be stored. static __inline__ void __DEFAULT_FN_ATTRS _mm_storel_pi(__m64 *__p, __m128 __a) { __builtin_ia32_storelps((__v2si *)__p, (__v4sf)__a); } /// \brief Stores the lower 32 bits of a 128-bit vector of [4 x float] to a /// memory location. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVSS / MOVSS instruction. /// /// \param __p /// A pointer to a 32-bit memory location. /// \param __a /// A 128-bit vector of [4 x float] containing the value to be stored. static __inline__ void __DEFAULT_FN_ATTRS _mm_store_ss(float *__p, __m128 __a) { struct __mm_store_ss_struct { float __u; } __attribute__((__packed__, __may_alias__)); ((struct __mm_store_ss_struct*)__p)->__u = __a[0]; } /// \brief Stores a 128-bit vector of [4 x float] to an unaligned memory /// location. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVUPS / MOVUPS instruction. /// /// \param __p /// A pointer to a 128-bit memory location. The address of the memory /// location does not have to be aligned. /// \param __a /// A 128-bit vector of [4 x float] containing the values to be stored. static __inline__ void __DEFAULT_FN_ATTRS _mm_storeu_ps(float *__p, __m128 __a) { struct __storeu_ps { __m128 __v; } __attribute__((__packed__, __may_alias__)); ((struct __storeu_ps*)__p)->__v = __a; } /// \brief Stores a 128-bit vector of [4 x float] into an aligned memory /// location. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVAPS / MOVAPS instruction. /// /// \param __p /// A pointer to a 128-bit memory location. The address of the memory /// location has to be 16-byte aligned. /// \param __a /// A 128-bit vector of [4 x float] containing the values to be stored. static __inline__ void __DEFAULT_FN_ATTRS _mm_store_ps(float *__p, __m128 __a) { *(__m128*)__p = __a; } /// \brief Stores the lower 32 bits of a 128-bit vector of [4 x float] into /// four contiguous elements in an aligned memory location. /// /// \headerfile /// /// This intrinsic corresponds to VMOVAPS / MOVAPS + shuffling /// instruction. /// /// \param __p /// A pointer to a 128-bit memory location. /// \param __a /// A 128-bit vector of [4 x float] whose lower 32 bits are stored to each /// of the four contiguous elements pointed by \a __p. static __inline__ void __DEFAULT_FN_ATTRS _mm_store1_ps(float *__p, __m128 __a) { __a = __builtin_shufflevector((__v4sf)__a, (__v4sf)__a, 0, 0, 0, 0); _mm_store_ps(__p, __a); } /// \brief Stores the lower 32 bits of a 128-bit vector of [4 x float] into /// four contiguous elements in an aligned memory location. /// /// \headerfile /// /// This intrinsic corresponds to VMOVAPS / MOVAPS + shuffling /// instruction. /// /// \param __p /// A pointer to a 128-bit memory location. /// \param __a /// A 128-bit vector of [4 x float] whose lower 32 bits are stored to each /// of the four contiguous elements pointed by \a __p. static __inline__ void __DEFAULT_FN_ATTRS _mm_store_ps1(float *__p, __m128 __a) { return _mm_store1_ps(__p, __a); } /// \brief Stores float values from a 128-bit vector of [4 x float] to an /// aligned memory location in reverse order. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVAPS / MOVAPS + shuffling /// instruction. /// /// \param __p /// A pointer to a 128-bit memory location. The address of the memory /// location has to be 128-bit aligned. /// \param __a /// A 128-bit vector of [4 x float] containing the values to be stored. static __inline__ void __DEFAULT_FN_ATTRS _mm_storer_ps(float *__p, __m128 __a) { __a = __builtin_shufflevector((__v4sf)__a, (__v4sf)__a, 3, 2, 1, 0); _mm_store_ps(__p, __a); } #define _MM_HINT_ET0 7 #define _MM_HINT_ET1 6 #define _MM_HINT_T0 3 #define _MM_HINT_T1 2 #define _MM_HINT_T2 1 #define _MM_HINT_NTA 0 #ifndef _MSC_VER /* FIXME: We have to #define this because "sel" must be a constant integer, and Sema doesn't do any form of constant propagation yet. */ /// \brief Loads one cache line of data from the specified address to a location /// closer to the processor. /// /// \headerfile /// /// \code /// void _mm_prefetch(const void * a, const int sel); /// \endcode /// /// This intrinsic corresponds to the PREFETCHNTA instruction. /// /// \param a /// A pointer to a memory location containing a cache line of data. /// \param sel /// A predefined integer constant specifying the type of prefetch /// operation: \n /// _MM_HINT_NTA: Move data using the non-temporal access (NTA) hint. The /// PREFETCHNTA instruction will be generated. \n /// _MM_HINT_T0: Move data using the T0 hint. The PREFETCHT0 instruction will /// be generated. \n /// _MM_HINT_T1: Move data using the T1 hint. The PREFETCHT1 instruction will /// be generated. \n /// _MM_HINT_T2: Move data using the T2 hint. The PREFETCHT2 instruction will /// be generated. #define _mm_prefetch(a, sel) (__builtin_prefetch((void *)(a), \ ((sel) >> 2) & 1, (sel) & 0x3)) #endif # 2076 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xmmintrin.h" 3 /// \brief Stores a 64-bit integer in the specified aligned memory location. To /// minimize caching, the data is flagged as non-temporal (unlikely to be /// used again soon). /// /// \headerfile /// /// This intrinsic corresponds to the MOVNTQ instruction. /// /// \param __p /// A pointer to an aligned memory location used to store the register value. /// \param __a /// A 64-bit integer containing the value to be stored. static __inline__ void __DEFAULT_FN_ATTRS _mm_stream_pi(__m64 *__p, __m64 __a) { __builtin_ia32_movntq(__p, __a); } /// \brief Moves packed float values from a 128-bit vector of [4 x float] to a /// 128-bit aligned memory location. To minimize caching, the data is flagged /// as non-temporal (unlikely to be used again soon). /// /// \headerfile /// /// This intrinsic corresponds to the VMOVNTPS / MOVNTPS instruction. /// /// \param __p /// A pointer to a 128-bit aligned memory location that will receive the /// single-precision floating-point values. /// \param __a /// A 128-bit vector of [4 x float] containing the values to be moved. static __inline__ void __DEFAULT_FN_ATTRS _mm_stream_ps(float *__p, __m128 __a) { __builtin_nontemporal_store((__v4sf)__a, (__v4sf*)__p); } #if defined(__cplusplus) extern "C" { #endif # 2117 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xmmintrin.h" 3 /// \brief Forces strong memory ordering (serialization) between store /// instructions preceding this instruction and store instructions following /// this instruction, ensuring the system completes all previous stores /// before executing subsequent stores. /// /// \headerfile /// /// This intrinsic corresponds to the SFENCE instruction. /// void _mm_sfence(void); #if defined(__cplusplus) } // extern "C" #endif # 2132 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xmmintrin.h" 3 /// \brief Extracts 16-bit element from a 64-bit vector of [4 x i16] and /// returns it, as specified by the immediate integer operand. /// /// \headerfile /// /// \code /// int _mm_extract_pi16(__m64 a, int n); /// \endcode /// /// This intrinsic corresponds to the VPEXTRW / PEXTRW instruction. /// /// \param a /// A 64-bit vector of [4 x i16]. /// \param n /// An immediate integer operand that determines which bits are extracted: \n /// 0: Bits [15:0] are copied to the destination. \n /// 1: Bits [31:16] are copied to the destination. \n /// 2: Bits [47:32] are copied to the destination. \n /// 3: Bits [63:48] are copied to the destination. /// \returns A 16-bit integer containing the extracted 16 bits of packed data. #define _mm_extract_pi16(a, n) __extension__ ({ \ (int)__builtin_ia32_vec_ext_v4hi((__m64)a, (int)n); }) /// \brief Copies data from the 64-bit vector of [4 x i16] to the destination, /// and inserts the lower 16-bits of an integer operand at the 16-bit offset /// specified by the immediate operand \a n. /// /// \headerfile /// /// \code /// __m64 _mm_insert_pi16(__m64 a, int d, int n); /// \endcode /// /// This intrinsic corresponds to the VPINSRW / PINSRW instruction. /// /// \param a /// A 64-bit vector of [4 x i16]. /// \param d /// An integer. The lower 16-bit value from this operand is written to the /// destination at the offset specified by operand \a n. /// \param n /// An immediate integer operant that determines which the bits to be used /// in the destination. \n /// 0: Bits [15:0] are copied to the destination. \n /// 1: Bits [31:16] are copied to the destination. \n /// 2: Bits [47:32] are copied to the destination. \n /// 3: Bits [63:48] are copied to the destination. \n /// The remaining bits in the destination are copied from the corresponding /// bits in operand \a a. /// \returns A 64-bit integer vector containing the copied packed data from the /// operands. #define _mm_insert_pi16(a, d, n) __extension__ ({ \ (__m64)__builtin_ia32_vec_set_v4hi((__m64)a, (int)d, (int)n); }) /// \brief Compares each of the corresponding packed 16-bit integer values of /// the 64-bit integer vectors, and writes the greater value to the /// corresponding bits in the destination. /// /// \headerfile /// /// This intrinsic corresponds to the PMAXSW instruction. /// /// \param __a /// A 64-bit integer vector containing one of the source operands. /// \param __b /// A 64-bit integer vector containing one of the source operands. /// \returns A 64-bit integer vector containing the comparison results. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_max_pi16(__m64 __a, __m64 __b) { return (__m64)__builtin_ia32_pmaxsw((__v4hi)__a, (__v4hi)__b); } /// \brief Compares each of the corresponding packed 8-bit unsigned integer /// values of the 64-bit integer vectors, and writes the greater value to the /// corresponding bits in the destination. /// /// \headerfile /// /// This intrinsic corresponds to the PMAXUB instruction. /// /// \param __a /// A 64-bit integer vector containing one of the source operands. /// \param __b /// A 64-bit integer vector containing one of the source operands. /// \returns A 64-bit integer vector containing the comparison results. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_max_pu8(__m64 __a, __m64 __b) { return (__m64)__builtin_ia32_pmaxub((__v8qi)__a, (__v8qi)__b); } /// \brief Compares each of the corresponding packed 16-bit integer values of /// the 64-bit integer vectors, and writes the lesser value to the /// corresponding bits in the destination. /// /// \headerfile /// /// This intrinsic corresponds to the PMINSW instruction. /// /// \param __a /// A 64-bit integer vector containing one of the source operands. /// \param __b /// A 64-bit integer vector containing one of the source operands. /// \returns A 64-bit integer vector containing the comparison results. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_min_pi16(__m64 __a, __m64 __b) { return (__m64)__builtin_ia32_pminsw((__v4hi)__a, (__v4hi)__b); } /// \brief Compares each of the corresponding packed 8-bit unsigned integer /// values of the 64-bit integer vectors, and writes the lesser value to the /// corresponding bits in the destination. /// /// \headerfile /// /// This intrinsic corresponds to the PMINUB instruction. /// /// \param __a /// A 64-bit integer vector containing one of the source operands. /// \param __b /// A 64-bit integer vector containing one of the source operands. /// \returns A 64-bit integer vector containing the comparison results. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_min_pu8(__m64 __a, __m64 __b) { return (__m64)__builtin_ia32_pminub((__v8qi)__a, (__v8qi)__b); } /// \brief Takes the most significant bit from each 8-bit element in a 64-bit /// integer vector to create a 16-bit mask value. Zero-extends the value to /// 32-bit integer and writes it to the destination. /// /// \headerfile /// /// This intrinsic corresponds to the PMOVMSKB instruction. /// /// \param __a /// A 64-bit integer vector containing the values with bits to be extracted. /// \returns The most significant bit from each 8-bit element in the operand, /// written to bits [15:0]. static __inline__ int __DEFAULT_FN_ATTRS _mm_movemask_pi8(__m64 __a) { return __builtin_ia32_pmovmskb((__v8qi)__a); } /// \brief Multiplies packed 16-bit unsigned integer values and writes the /// high-order 16 bits of each 32-bit product to the corresponding bits in /// the destination. /// /// \headerfile /// /// This intrinsic corresponds to the PMULHUW instruction. /// /// \param __a /// A 64-bit integer vector containing one of the source operands. /// \param __b /// A 64-bit integer vector containing one of the source operands. /// \returns A 64-bit integer vector containing the products of both operands. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_mulhi_pu16(__m64 __a, __m64 __b) { return (__m64)__builtin_ia32_pmulhuw((__v4hi)__a, (__v4hi)__b); } /// \brief Shuffles the 4 16-bit integers from a 64-bit integer vector to the /// destination, as specified by the immediate value operand. /// /// \headerfile /// /// \code /// __m64 _mm_shuffle_pi16(__m64 a, const int n); /// \endcode /// /// This intrinsic corresponds to the PSHUFW instruction. /// /// \param a /// A 64-bit integer vector containing the values to be shuffled. /// \param n /// An immediate value containing an 8-bit value specifying which elements to /// copy from \a a. The destinations within the 64-bit destination are /// assigned values as follows: \n /// Bits [1:0] are used to assign values to bits [15:0] in the /// destination. \n /// Bits [3:2] are used to assign values to bits [31:16] in the /// destination. \n /// Bits [5:4] are used to assign values to bits [47:32] in the /// destination. \n /// Bits [7:6] are used to assign values to bits [63:48] in the /// destination. \n /// Bit value assignments: \n /// 00: assigned from bits [15:0] of \a a. \n /// 01: assigned from bits [31:16] of \a a. \n /// 10: assigned from bits [47:32] of \a a. \n /// 11: assigned from bits [63:48] of \a a. /// \returns A 64-bit integer vector containing the shuffled values. #define _mm_shuffle_pi16(a, n) __extension__ ({ \ (__m64)__builtin_ia32_pshufw((__v4hi)(__m64)(a), (n)); }) /// \brief Conditionally copies the values from each 8-bit element in the first /// 64-bit integer vector operand to the specified memory location, as /// specified by the most significant bit in the corresponding element in the /// second 64-bit integer vector operand. /// /// To minimize caching, the data is flagged as non-temporal /// (unlikely to be used again soon). /// /// \headerfile /// /// This intrinsic corresponds to the MASKMOVQ instruction. /// /// \param __d /// A 64-bit integer vector containing the values with elements to be copied. /// \param __n /// A 64-bit integer vector operand. The most significant bit from each 8-bit /// element determines whether the corresponding element in operand \a __d /// is copied. If the most significant bit of a given element is 1, the /// corresponding element in operand \a __d is copied. /// \param __p /// A pointer to a 64-bit memory location that will receive the conditionally /// copied integer values. The address of the memory location does not have /// to be aligned. static __inline__ void __DEFAULT_FN_ATTRS _mm_maskmove_si64(__m64 __d, __m64 __n, char *__p) { __builtin_ia32_maskmovq((__v8qi)__d, (__v8qi)__n, __p); } /// \brief Computes the rounded averages of the packed unsigned 8-bit integer /// values and writes the averages to the corresponding bits in the /// destination. /// /// \headerfile /// /// This intrinsic corresponds to the PAVGB instruction. /// /// \param __a /// A 64-bit integer vector containing one of the source operands. /// \param __b /// A 64-bit integer vector containing one of the source operands. /// \returns A 64-bit integer vector containing the averages of both operands. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_avg_pu8(__m64 __a, __m64 __b) { return (__m64)__builtin_ia32_pavgb((__v8qi)__a, (__v8qi)__b); } /// \brief Computes the rounded averages of the packed unsigned 16-bit integer /// values and writes the averages to the corresponding bits in the /// destination. /// /// \headerfile /// /// This intrinsic corresponds to the PAVGW instruction. /// /// \param __a /// A 64-bit integer vector containing one of the source operands. /// \param __b /// A 64-bit integer vector containing one of the source operands. /// \returns A 64-bit integer vector containing the averages of both operands. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_avg_pu16(__m64 __a, __m64 __b) { return (__m64)__builtin_ia32_pavgw((__v4hi)__a, (__v4hi)__b); } /// \brief Subtracts the corresponding 8-bit unsigned integer values of the two /// 64-bit vector operands and computes the absolute value for each of the /// difference. Then sum of the 8 absolute differences is written to the /// bits [15:0] of the destination; the remaining bits [63:16] are cleared. /// /// \headerfile /// /// This intrinsic corresponds to the PSADBW instruction. /// /// \param __a /// A 64-bit integer vector containing one of the source operands. /// \param __b /// A 64-bit integer vector containing one of the source operands. /// \returns A 64-bit integer vector whose lower 16 bits contain the sums of the /// sets of absolute differences between both operands. The upper bits are /// cleared. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_sad_pu8(__m64 __a, __m64 __b) { return (__m64)__builtin_ia32_psadbw((__v8qi)__a, (__v8qi)__b); } #if defined(__cplusplus) extern "C" { #endif # 2426 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xmmintrin.h" 3 /// \brief Returns the contents of the MXCSR register as a 32-bit unsigned /// integer value. /// /// There are several groups of macros associated with this /// intrinsic, including: ///
    ///
  • /// For checking exception states: _MM_EXCEPT_INVALID, _MM_EXCEPT_DIV_ZERO, /// _MM_EXCEPT_DENORM, _MM_EXCEPT_OVERFLOW, _MM_EXCEPT_UNDERFLOW, /// _MM_EXCEPT_INEXACT. There is a convenience wrapper /// _MM_GET_EXCEPTION_STATE(). ///
  • ///
  • /// For checking exception masks: _MM_MASK_UNDERFLOW, _MM_MASK_OVERFLOW, /// _MM_MASK_INVALID, _MM_MASK_DENORM, _MM_MASK_DIV_ZERO, _MM_MASK_INEXACT. /// There is a convenience wrapper _MM_GET_EXCEPTION_MASK(). ///
  • ///
  • /// For checking rounding modes: _MM_ROUND_NEAREST, _MM_ROUND_DOWN, /// _MM_ROUND_UP, _MM_ROUND_TOWARD_ZERO. There is a convenience wrapper /// _MM_GET_ROUNDING_MODE(x) where x is one of these macros. ///
  • ///
  • /// For checking flush-to-zero mode: _MM_FLUSH_ZERO_ON, _MM_FLUSH_ZERO_OFF. /// There is a convenience wrapper _MM_GET_FLUSH_ZERO_MODE(). ///
  • ///
  • /// For checking denormals-are-zero mode: _MM_DENORMALS_ZERO_ON, /// _MM_DENORMALS_ZERO_OFF. There is a convenience wrapper /// _MM_GET_DENORMALS_ZERO_MODE(). ///
  • ///
/// /// For example, the expression below checks if an overflow exception has /// occurred: /// ( _mm_getcsr() & _MM_EXCEPT_OVERFLOW ) /// /// The following example gets the current rounding mode: /// _MM_GET_ROUNDING_MODE() /// /// \headerfile /// /// This intrinsic corresponds to the VSTMXCSR / STMXCSR instruction. /// /// \returns A 32-bit unsigned integer containing the contents of the MXCSR /// register. unsigned int _mm_getcsr(void); /// \brief Sets the MXCSR register with the 32-bit unsigned integer value. /// /// There are several groups of macros associated with this intrinsic, /// including: ///
    ///
  • /// For setting exception states: _MM_EXCEPT_INVALID, _MM_EXCEPT_DIV_ZERO, /// _MM_EXCEPT_DENORM, _MM_EXCEPT_OVERFLOW, _MM_EXCEPT_UNDERFLOW, /// _MM_EXCEPT_INEXACT. There is a convenience wrapper /// _MM_SET_EXCEPTION_STATE(x) where x is one of these macros. ///
  • ///
  • /// For setting exception masks: _MM_MASK_UNDERFLOW, _MM_MASK_OVERFLOW, /// _MM_MASK_INVALID, _MM_MASK_DENORM, _MM_MASK_DIV_ZERO, _MM_MASK_INEXACT. /// There is a convenience wrapper _MM_SET_EXCEPTION_MASK(x) where x is one /// of these macros. ///
  • ///
  • /// For setting rounding modes: _MM_ROUND_NEAREST, _MM_ROUND_DOWN, /// _MM_ROUND_UP, _MM_ROUND_TOWARD_ZERO. There is a convenience wrapper /// _MM_SET_ROUNDING_MODE(x) where x is one of these macros. ///
  • ///
  • /// For setting flush-to-zero mode: _MM_FLUSH_ZERO_ON, _MM_FLUSH_ZERO_OFF. /// There is a convenience wrapper _MM_SET_FLUSH_ZERO_MODE(x) where x is /// one of these macros. ///
  • ///
  • /// For setting denormals-are-zero mode: _MM_DENORMALS_ZERO_ON, /// _MM_DENORMALS_ZERO_OFF. There is a convenience wrapper /// _MM_SET_DENORMALS_ZERO_MODE(x) where x is one of these macros. ///
  • ///
/// /// For example, the following expression causes subsequent floating-point /// operations to round up: /// _mm_setcsr(_mm_getcsr() | _MM_ROUND_UP) /// /// The following example sets the DAZ and FTZ flags: /// void setFlags() { /// _MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON) /// _MM_SET_DENORMALS_ZERO_MODE(_MM_DENORMALS_ZERO_ON) /// } /// /// \headerfile /// /// This intrinsic corresponds to the VLDMXCSR / LDMXCSR instruction. /// /// \param __i /// A 32-bit unsigned integer value to be written to the MXCSR register. void _mm_setcsr(unsigned int __i); #if defined(__cplusplus) } // extern "C" #endif # 2530 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xmmintrin.h" 3 /// \brief Selects 4 float values from the 128-bit operands of [4 x float], as /// specified by the immediate value operand. /// /// \headerfile /// /// \code /// __m128 _mm_shuffle_ps(__m128 a, __m128 b, const int mask); /// \endcode /// /// This intrinsic corresponds to the VSHUFPS / SHUFPS instruction. /// /// \param a /// A 128-bit vector of [4 x float]. /// \param b /// A 128-bit vector of [4 x float]. /// \param mask /// An immediate value containing an 8-bit value specifying which elements to /// copy from \a a and \a b. \n /// Bits [3:0] specify the values copied from operand \a a. \n /// Bits [7:4] specify the values copied from operand \a b. \n /// The destinations within the 128-bit destination are assigned values as /// follows: \n /// Bits [1:0] are used to assign values to bits [31:0] in the /// destination. \n /// Bits [3:2] are used to assign values to bits [63:32] in the /// destination. \n /// Bits [5:4] are used to assign values to bits [95:64] in the /// destination. \n /// Bits [7:6] are used to assign values to bits [127:96] in the /// destination. \n /// Bit value assignments: \n /// 00: Bits [31:0] copied from the specified operand. \n /// 01: Bits [63:32] copied from the specified operand. \n /// 10: Bits [95:64] copied from the specified operand. \n /// 11: Bits [127:96] copied from the specified operand. /// \returns A 128-bit vector of [4 x float] containing the shuffled values. #define _mm_shuffle_ps(a, b, mask) __extension__ ({ \ (__m128)__builtin_shufflevector((__v4sf)(__m128)(a), (__v4sf)(__m128)(b), \ 0 + (((mask) >> 0) & 0x3), \ 0 + (((mask) >> 2) & 0x3), \ 4 + (((mask) >> 4) & 0x3), \ 4 + (((mask) >> 6) & 0x3)); }) /// \brief Unpacks the high-order (index 2,3) values from two 128-bit vectors of /// [4 x float] and interleaves them into a 128-bit vector of [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VUNPCKHPS / UNPCKHPS instruction. /// /// \param __a /// A 128-bit vector of [4 x float]. \n /// Bits [95:64] are written to bits [31:0] of the destination. \n /// Bits [127:96] are written to bits [95:64] of the destination. /// \param __b /// A 128-bit vector of [4 x float]. /// Bits [95:64] are written to bits [63:32] of the destination. \n /// Bits [127:96] are written to bits [127:96] of the destination. /// \returns A 128-bit vector of [4 x float] containing the interleaved values. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_unpackhi_ps(__m128 __a, __m128 __b) { return __builtin_shufflevector((__v4sf)__a, (__v4sf)__b, 2, 6, 3, 7); } /// \brief Unpacks the low-order (index 0,1) values from two 128-bit vectors of /// [4 x float] and interleaves them into a 128-bit vector of [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VUNPCKLPS / UNPCKLPS instruction. /// /// \param __a /// A 128-bit vector of [4 x float]. \n /// Bits [31:0] are written to bits [31:0] of the destination. \n /// Bits [63:32] are written to bits [95:64] of the destination. /// \param __b /// A 128-bit vector of [4 x float]. \n /// Bits [31:0] are written to bits [63:32] of the destination. \n /// Bits [63:32] are written to bits [127:96] of the destination. /// \returns A 128-bit vector of [4 x float] containing the interleaved values. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_unpacklo_ps(__m128 __a, __m128 __b) { return __builtin_shufflevector((__v4sf)__a, (__v4sf)__b, 0, 4, 1, 5); } /// \brief Constructs a 128-bit floating-point vector of [4 x float]. The lower /// 32 bits are set to the lower 32 bits of the second parameter. The upper /// 96 bits are set to the upper 96 bits of the first parameter. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVSS / MOVSS instruction. /// /// \param __a /// A 128-bit floating-point vector of [4 x float]. The upper 96 bits are /// written to the upper 96 bits of the result. /// \param __b /// A 128-bit floating-point vector of [4 x float]. The lower 32 bits are /// written to the lower 32 bits of the result. /// \returns A 128-bit floating-point vector of [4 x float]. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_move_ss(__m128 __a, __m128 __b) { return __builtin_shufflevector((__v4sf)__a, (__v4sf)__b, 4, 1, 2, 3); } /// \brief Constructs a 128-bit floating-point vector of [4 x float]. The lower /// 64 bits are set to the upper 64 bits of the second parameter. The upper /// 64 bits are set to the upper 64 bits of the first parameter. /// /// \headerfile /// /// This intrinsic corresponds to the VUNPCKHPD / UNPCKHPD instruction. /// /// \param __a /// A 128-bit floating-point vector of [4 x float]. The upper 64 bits are /// written to the upper 64 bits of the result. /// \param __b /// A 128-bit floating-point vector of [4 x float]. The upper 64 bits are /// written to the lower 64 bits of the result. /// \returns A 128-bit floating-point vector of [4 x float]. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_movehl_ps(__m128 __a, __m128 __b) { return __builtin_shufflevector((__v4sf)__a, (__v4sf)__b, 6, 7, 2, 3); } /// \brief Constructs a 128-bit floating-point vector of [4 x float]. The lower /// 64 bits are set to the lower 64 bits of the first parameter. The upper /// 64 bits are set to the lower 64 bits of the second parameter. /// /// \headerfile /// /// This intrinsic corresponds to the VUNPCKLPD / UNPCKLPD instruction. /// /// \param __a /// A 128-bit floating-point vector of [4 x float]. The lower 64 bits are /// written to the lower 64 bits of the result. /// \param __b /// A 128-bit floating-point vector of [4 x float]. The lower 64 bits are /// written to the upper 64 bits of the result. /// \returns A 128-bit floating-point vector of [4 x float]. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_movelh_ps(__m128 __a, __m128 __b) { return __builtin_shufflevector((__v4sf)__a, (__v4sf)__b, 0, 1, 4, 5); } /// \brief Converts a 64-bit vector of [4 x i16] into a 128-bit vector of [4 x /// float]. /// /// \headerfile /// /// This intrinsic corresponds to the CVTPI2PS + COMPOSITE instruction. /// /// \param __a /// A 64-bit vector of [4 x i16]. The elements of the destination are copied /// from the corresponding elements in this operand. /// \returns A 128-bit vector of [4 x float] containing the copied and converted /// values from the operand. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cvtpi16_ps(__m64 __a) { __m64 __b, __c; __m128 __r; __b = _mm_setzero_si64(); __b = _mm_cmpgt_pi16(__b, __a); __c = _mm_unpackhi_pi16(__a, __b); __r = _mm_setzero_ps(); __r = _mm_cvtpi32_ps(__r, __c); __r = _mm_movelh_ps(__r, __r); __c = _mm_unpacklo_pi16(__a, __b); __r = _mm_cvtpi32_ps(__r, __c); return __r; } /// \brief Converts a 64-bit vector of 16-bit unsigned integer values into a /// 128-bit vector of [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the CVTPI2PS + COMPOSITE instruction. /// /// \param __a /// A 64-bit vector of 16-bit unsigned integer values. The elements of the /// destination are copied from the corresponding elements in this operand. /// \returns A 128-bit vector of [4 x float] containing the copied and converted /// values from the operand. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cvtpu16_ps(__m64 __a) { __m64 __b, __c; __m128 __r; __b = _mm_setzero_si64(); __c = _mm_unpackhi_pi16(__a, __b); __r = _mm_setzero_ps(); __r = _mm_cvtpi32_ps(__r, __c); __r = _mm_movelh_ps(__r, __r); __c = _mm_unpacklo_pi16(__a, __b); __r = _mm_cvtpi32_ps(__r, __c); return __r; } /// \brief Converts the lower four 8-bit values from a 64-bit vector of [8 x i8] /// into a 128-bit vector of [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the CVTPI2PS + COMPOSITE instruction. /// /// \param __a /// A 64-bit vector of [8 x i8]. The elements of the destination are copied /// from the corresponding lower 4 elements in this operand. /// \returns A 128-bit vector of [4 x float] containing the copied and converted /// values from the operand. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cvtpi8_ps(__m64 __a) { __m64 __b; __b = _mm_setzero_si64(); __b = _mm_cmpgt_pi8(__b, __a); __b = _mm_unpacklo_pi8(__a, __b); return _mm_cvtpi16_ps(__b); } /// \brief Converts the lower four unsigned 8-bit integer values from a 64-bit /// vector of [8 x u8] into a 128-bit vector of [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the CVTPI2PS + COMPOSITE instruction. /// /// \param __a /// A 64-bit vector of unsigned 8-bit integer values. The elements of the /// destination are copied from the corresponding lower 4 elements in this /// operand. /// \returns A 128-bit vector of [4 x float] containing the copied and converted /// values from the source operand. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cvtpu8_ps(__m64 __a) { __m64 __b; __b = _mm_setzero_si64(); __b = _mm_unpacklo_pi8(__a, __b); return _mm_cvtpi16_ps(__b); } /// \brief Converts the two 32-bit signed integer values from each 64-bit vector /// operand of [2 x i32] into a 128-bit vector of [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the CVTPI2PS + COMPOSITE instruction. /// /// \param __a /// A 64-bit vector of [2 x i32]. The lower elements of the destination are /// copied from the elements in this operand. /// \param __b /// A 64-bit vector of [2 x i32]. The upper elements of the destination are /// copied from the elements in this operand. /// \returns A 128-bit vector of [4 x float] whose lower 64 bits contain the /// copied and converted values from the first operand. The upper 64 bits /// contain the copied and converted values from the second operand. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cvtpi32x2_ps(__m64 __a, __m64 __b) { __m128 __c; __c = _mm_setzero_ps(); __c = _mm_cvtpi32_ps(__c, __b); __c = _mm_movelh_ps(__c, __c); return _mm_cvtpi32_ps(__c, __a); } /// \brief Converts each single-precision floating-point element of a 128-bit /// floating-point vector of [4 x float] into a 16-bit signed integer, and /// packs the results into a 64-bit integer vector of [4 x i16]. /// /// If the floating-point element is NaN or infinity, or if the /// floating-point element is greater than 0x7FFFFFFF or less than -0x8000, /// it is converted to 0x8000. Otherwise if the floating-point element is /// greater than 0x7FFF, it is converted to 0x7FFF. /// /// \headerfile /// /// This intrinsic corresponds to the CVTPS2PI + COMPOSITE instruction. /// /// \param __a /// A 128-bit floating-point vector of [4 x float]. /// \returns A 64-bit integer vector of [4 x i16] containing the converted /// values. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_cvtps_pi16(__m128 __a) { __m64 __b, __c; __b = _mm_cvtps_pi32(__a); __a = _mm_movehl_ps(__a, __a); __c = _mm_cvtps_pi32(__a); return _mm_packs_pi32(__b, __c); } /// \brief Converts each single-precision floating-point element of a 128-bit /// floating-point vector of [4 x float] into an 8-bit signed integer, and /// packs the results into the lower 32 bits of a 64-bit integer vector of /// [8 x i8]. The upper 32 bits of the vector are set to 0. /// /// If the floating-point element is NaN or infinity, or if the /// floating-point element is greater than 0x7FFFFFFF or less than -0x80, it /// is converted to 0x80. Otherwise if the floating-point element is greater /// than 0x7F, it is converted to 0x7F. /// /// \headerfile /// /// This intrinsic corresponds to the CVTPS2PI + COMPOSITE instruction. /// /// \param __a /// 128-bit floating-point vector of [4 x float]. /// \returns A 64-bit integer vector of [8 x i8]. The lower 32 bits contain the /// converted values and the uppper 32 bits are set to zero. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_cvtps_pi8(__m128 __a) { __m64 __b, __c; __b = _mm_cvtps_pi16(__a); __c = _mm_setzero_si64(); return _mm_packs_pi16(__b, __c); } /// \brief Extracts the sign bits from each single-precision floating-point /// element of a 128-bit floating-point vector of [4 x float] and returns the /// sign bits in bits [0:3] of the result. Bits [31:4] of the result are set /// to zero. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVMSKPS / MOVMSKPS instruction. /// /// \param __a /// A 128-bit floating-point vector of [4 x float]. /// \returns A 32-bit integer value. Bits [3:0] contain the sign bits from each /// single-precision floating-point element of the parameter. Bits [31:4] are /// set to zero. static __inline__ int __DEFAULT_FN_ATTRS _mm_movemask_ps(__m128 __a) { return __builtin_ia32_movmskps((__v4sf)__a); } #define _MM_ALIGN16 __attribute__((aligned(16))) #define _MM_SHUFFLE(z, y, x, w) (((z) << 6) | ((y) << 4) | ((x) << 2) | (w)) #define _MM_EXCEPT_INVALID (0x0001) #define _MM_EXCEPT_DENORM (0x0002) #define _MM_EXCEPT_DIV_ZERO (0x0004) #define _MM_EXCEPT_OVERFLOW (0x0008) #define _MM_EXCEPT_UNDERFLOW (0x0010) #define _MM_EXCEPT_INEXACT (0x0020) #define _MM_EXCEPT_MASK (0x003f) #define _MM_MASK_INVALID (0x0080) #define _MM_MASK_DENORM (0x0100) #define _MM_MASK_DIV_ZERO (0x0200) #define _MM_MASK_OVERFLOW (0x0400) #define _MM_MASK_UNDERFLOW (0x0800) #define _MM_MASK_INEXACT (0x1000) #define _MM_MASK_MASK (0x1f80) #define _MM_ROUND_NEAREST (0x0000) #define _MM_ROUND_DOWN (0x2000) #define _MM_ROUND_UP (0x4000) #define _MM_ROUND_TOWARD_ZERO (0x6000) #define _MM_ROUND_MASK (0x6000) #define _MM_FLUSH_ZERO_MASK (0x8000) #define _MM_FLUSH_ZERO_ON (0x8000) #define _MM_FLUSH_ZERO_OFF (0x0000) #define _MM_GET_EXCEPTION_MASK() (_mm_getcsr() & _MM_MASK_MASK) #define _MM_GET_EXCEPTION_STATE() (_mm_getcsr() & _MM_EXCEPT_MASK) #define _MM_GET_FLUSH_ZERO_MODE() (_mm_getcsr() & _MM_FLUSH_ZERO_MASK) #define _MM_GET_ROUNDING_MODE() (_mm_getcsr() & _MM_ROUND_MASK) #define _MM_SET_EXCEPTION_MASK(x) (_mm_setcsr((_mm_getcsr() & ~_MM_MASK_MASK) | (x))) #define _MM_SET_EXCEPTION_STATE(x) (_mm_setcsr((_mm_getcsr() & ~_MM_EXCEPT_MASK) | (x))) #define _MM_SET_FLUSH_ZERO_MODE(x) (_mm_setcsr((_mm_getcsr() & ~_MM_FLUSH_ZERO_MASK) | (x))) #define _MM_SET_ROUNDING_MODE(x) (_mm_setcsr((_mm_getcsr() & ~_MM_ROUND_MASK) | (x))) #define _MM_TRANSPOSE4_PS(row0, row1, row2, row3) \ do { \ __m128 tmp3, tmp2, tmp1, tmp0; \ tmp0 = _mm_unpacklo_ps((row0), (row1)); \ tmp2 = _mm_unpacklo_ps((row2), (row3)); \ tmp1 = _mm_unpackhi_ps((row0), (row1)); \ tmp3 = _mm_unpackhi_ps((row2), (row3)); \ (row0) = _mm_movelh_ps(tmp0, tmp2); \ (row1) = _mm_movehl_ps(tmp2, tmp0); \ (row2) = _mm_movelh_ps(tmp1, tmp3); \ (row3) = _mm_movehl_ps(tmp3, tmp1); \ } while (0) /* Aliases for compatibility. */ #define _m_pextrw _mm_extract_pi16 #define _m_pinsrw _mm_insert_pi16 #define _m_pmaxsw _mm_max_pi16 #define _m_pmaxub _mm_max_pu8 #define _m_pminsw _mm_min_pi16 #define _m_pminub _mm_min_pu8 #define _m_pmovmskb _mm_movemask_pi8 #define _m_pmulhuw _mm_mulhi_pu16 #define _m_pshufw _mm_shuffle_pi16 #define _m_maskmovq _mm_maskmove_si64 #define _m_pavgb _mm_avg_pu8 #define _m_pavgw _mm_avg_pu16 #define _m_psadbw _mm_sad_pu8 #define _m_ _mm_ #define _m_ _mm_ #undef __DEFAULT_FN_ATTRS /* Ugly hack for backwards-compatibility (compatible with gcc) */ #if defined(__SSE2__) && !__building_module(_Builtin_intrinsics) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 2969 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xmmintrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/emmintrin.h" 1 3 /*===---- emmintrin.h - SSE2 intrinsics ------------------------------------=== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __EMMINTRIN_H #define __EMMINTRIN_H #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/emmintrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xmmintrin.h" 1 3 /*===---- xmmintrin.h - SSE intrinsics -------------------------------------=== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __XMMINTRIN_H #define __XMMINTRIN_H #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xmmintrin.h" 3 # 28 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xmmintrin.h" 3 typedef int __v4si __attribute__((__vector_size__(16))); typedef float __v4sf __attribute__((__vector_size__(16))); typedef float __m128 __attribute__((__vector_size__(16))); /* Unsigned types */ typedef unsigned int __v4su __attribute__((__vector_size__(16))); /* This header should only be included in a hosted environment as it depends on * a standard library to provide allocation routines. */ #if __STDC_HOSTED__ #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 39 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xmmintrin.h" 3 # 40 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xmmintrin.h" 3 #endif # 41 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xmmintrin.h" 3 /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("sse"))) /// \brief Adds the 32-bit float values in the low-order bits of the operands. /// /// \headerfile /// /// This intrinsic corresponds to the VADDSS / ADDSS instructions. /// /// \param __a /// A 128-bit vector of [4 x float] containing one of the source operands. /// The lower 32 bits of this operand are used in the calculation. /// \param __b /// A 128-bit vector of [4 x float] containing one of the source operands. /// The lower 32 bits of this operand are used in the calculation. /// \returns A 128-bit vector of [4 x float] whose lower 32 bits contain the sum /// of the lower 32 bits of both operands. The upper 96 bits are copied from /// the upper 96 bits of the first source operand. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_add_ss(__m128 __a, __m128 __b) { __a[0] += __b[0]; return __a; } /// \brief Adds two 128-bit vectors of [4 x float], and returns the results of /// the addition. /// /// \headerfile /// /// This intrinsic corresponds to the VADDPS / ADDPS instructions. /// /// \param __a /// A 128-bit vector of [4 x float] containing one of the source operands. /// \param __b /// A 128-bit vector of [4 x float] containing one of the source operands. /// \returns A 128-bit vector of [4 x float] containing the sums of both /// operands. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_add_ps(__m128 __a, __m128 __b) { return (__m128)((__v4sf)__a + (__v4sf)__b); } /// \brief Subtracts the 32-bit float value in the low-order bits of the second /// operand from the corresponding value in the first operand. /// /// \headerfile /// /// This intrinsic corresponds to the VSUBSS / SUBSS instructions. /// /// \param __a /// A 128-bit vector of [4 x float] containing the minuend. The lower 32 bits /// of this operand are used in the calculation. /// \param __b /// A 128-bit vector of [4 x float] containing the subtrahend. The lower 32 /// bits of this operand are used in the calculation. /// \returns A 128-bit vector of [4 x float] whose lower 32 bits contain the /// difference of the lower 32 bits of both operands. The upper 96 bits are /// copied from the upper 96 bits of the first source operand. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_sub_ss(__m128 __a, __m128 __b) { __a[0] -= __b[0]; return __a; } /// \brief Subtracts each of the values of the second operand from the first /// operand, both of which are 128-bit vectors of [4 x float] and returns /// the results of the subtraction. /// /// \headerfile /// /// This intrinsic corresponds to the VSUBPS / SUBPS instructions. /// /// \param __a /// A 128-bit vector of [4 x float] containing the minuend. /// \param __b /// A 128-bit vector of [4 x float] containing the subtrahend. /// \returns A 128-bit vector of [4 x float] containing the differences between /// both operands. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_sub_ps(__m128 __a, __m128 __b) { return (__m128)((__v4sf)__a - (__v4sf)__b); } /// \brief Multiplies two 32-bit float values in the low-order bits of the /// operands. /// /// \headerfile /// /// This intrinsic corresponds to the VMULSS / MULSS instructions. /// /// \param __a /// A 128-bit vector of [4 x float] containing one of the source operands. /// The lower 32 bits of this operand are used in the calculation. /// \param __b /// A 128-bit vector of [4 x float] containing one of the source operands. /// The lower 32 bits of this operand are used in the calculation. /// \returns A 128-bit vector of [4 x float] containing the product of the lower /// 32 bits of both operands. The upper 96 bits are copied from the upper 96 /// bits of the first source operand. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mul_ss(__m128 __a, __m128 __b) { __a[0] *= __b[0]; return __a; } /// \brief Multiplies two 128-bit vectors of [4 x float] and returns the /// results of the multiplication. /// /// \headerfile /// /// This intrinsic corresponds to the VMULPS / MULPS instructions. /// /// \param __a /// A 128-bit vector of [4 x float] containing one of the source operands. /// \param __b /// A 128-bit vector of [4 x float] containing one of the source operands. /// \returns A 128-bit vector of [4 x float] containing the products of both /// operands. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mul_ps(__m128 __a, __m128 __b) { return (__m128)((__v4sf)__a * (__v4sf)__b); } /// \brief Divides the value in the low-order 32 bits of the first operand by /// the corresponding value in the second operand. /// /// \headerfile /// /// This intrinsic corresponds to the VDIVSS / DIVSS instructions. /// /// \param __a /// A 128-bit vector of [4 x float] containing the dividend. The lower 32 /// bits of this operand are used in the calculation. /// \param __b /// A 128-bit vector of [4 x float] containing the divisor. The lower 32 bits /// of this operand are used in the calculation. /// \returns A 128-bit vector of [4 x float] containing the quotients of the /// lower 32 bits of both operands. The upper 96 bits are copied from the /// upper 96 bits of the first source operand. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_div_ss(__m128 __a, __m128 __b) { __a[0] /= __b[0]; return __a; } /// \brief Divides two 128-bit vectors of [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VDIVPS / DIVPS instructions. /// /// \param __a /// A 128-bit vector of [4 x float] containing the dividend. /// \param __b /// A 128-bit vector of [4 x float] containing the divisor. /// \returns A 128-bit vector of [4 x float] containing the quotients of both /// operands. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_div_ps(__m128 __a, __m128 __b) { return (__m128)((__v4sf)__a / (__v4sf)__b); } /// \brief Calculates the square root of the value stored in the low-order bits /// of a 128-bit vector of [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VSQRTSS / SQRTSS instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the calculation. /// \returns A 128-bit vector of [4 x float] containing the square root of the /// value in the low-order bits of the operand. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_sqrt_ss(__m128 __a) { __m128 __c = __builtin_ia32_sqrtss((__v4sf)__a); return (__m128) { __c[0], __a[1], __a[2], __a[3] }; } /// \brief Calculates the square roots of the values stored in a 128-bit vector /// of [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VSQRTPS / SQRTPS instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. /// \returns A 128-bit vector of [4 x float] containing the square roots of the /// values in the operand. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_sqrt_ps(__m128 __a) { return __builtin_ia32_sqrtps((__v4sf)__a); } /// \brief Calculates the approximate reciprocal of the value stored in the /// low-order bits of a 128-bit vector of [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VRCPSS / RCPSS instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the calculation. /// \returns A 128-bit vector of [4 x float] containing the approximate /// reciprocal of the value in the low-order bits of the operand. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_rcp_ss(__m128 __a) { __m128 __c = __builtin_ia32_rcpss((__v4sf)__a); return (__m128) { __c[0], __a[1], __a[2], __a[3] }; } /// \brief Calculates the approximate reciprocals of the values stored in a /// 128-bit vector of [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VRCPPS / RCPPS instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. /// \returns A 128-bit vector of [4 x float] containing the approximate /// reciprocals of the values in the operand. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_rcp_ps(__m128 __a) { return __builtin_ia32_rcpps((__v4sf)__a); } /// \brief Calculates the approximate reciprocal of the square root of the value /// stored in the low-order bits of a 128-bit vector of [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VRSQRTSS / RSQRTSS instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the calculation. /// \returns A 128-bit vector of [4 x float] containing the approximate /// reciprocal of the square root of the value in the low-order bits of the /// operand. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_rsqrt_ss(__m128 __a) { __m128 __c = __builtin_ia32_rsqrtss((__v4sf)__a); return (__m128) { __c[0], __a[1], __a[2], __a[3] }; } /// \brief Calculates the approximate reciprocals of the square roots of the /// values stored in a 128-bit vector of [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VRSQRTPS / RSQRTPS instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. /// \returns A 128-bit vector of [4 x float] containing the approximate /// reciprocals of the square roots of the values in the operand. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_rsqrt_ps(__m128 __a) { return __builtin_ia32_rsqrtps((__v4sf)__a); } /// \brief Compares two 32-bit float values in the low-order bits of both /// operands and returns the lesser value in the low-order bits of the /// vector of [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VMINSS / MINSS instructions. /// /// \param __a /// A 128-bit vector of [4 x float] containing one of the operands. The lower /// 32 bits of this operand are used in the comparison. /// \param __b /// A 128-bit vector of [4 x float] containing one of the operands. The lower /// 32 bits of this operand are used in the comparison. /// \returns A 128-bit vector of [4 x float] whose lower 32 bits contain the /// minimum value between both operands. The upper 96 bits are copied from /// the upper 96 bits of the first source operand. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_min_ss(__m128 __a, __m128 __b) { return __builtin_ia32_minss((__v4sf)__a, (__v4sf)__b); } /// \brief Compares two 128-bit vectors of [4 x float] and returns the lesser /// of each pair of values. /// /// \headerfile /// /// This intrinsic corresponds to the VMINPS / MINPS instructions. /// /// \param __a /// A 128-bit vector of [4 x float] containing one of the operands. /// \param __b /// A 128-bit vector of [4 x float] containing one of the operands. /// \returns A 128-bit vector of [4 x float] containing the minimum values /// between both operands. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_min_ps(__m128 __a, __m128 __b) { return __builtin_ia32_minps((__v4sf)__a, (__v4sf)__b); } /// \brief Compares two 32-bit float values in the low-order bits of both /// operands and returns the greater value in the low-order bits of a 128-bit /// vector of [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VMAXSS / MAXSS instructions. /// /// \param __a /// A 128-bit vector of [4 x float] containing one of the operands. The lower /// 32 bits of this operand are used in the comparison. /// \param __b /// A 128-bit vector of [4 x float] containing one of the operands. The lower /// 32 bits of this operand are used in the comparison. /// \returns A 128-bit vector of [4 x float] whose lower 32 bits contain the /// maximum value between both operands. The upper 96 bits are copied from /// the upper 96 bits of the first source operand. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_max_ss(__m128 __a, __m128 __b) { return __builtin_ia32_maxss((__v4sf)__a, (__v4sf)__b); } /// \brief Compares two 128-bit vectors of [4 x float] and returns the greater /// of each pair of values. /// /// \headerfile /// /// This intrinsic corresponds to the VMAXPS / MAXPS instructions. /// /// \param __a /// A 128-bit vector of [4 x float] containing one of the operands. /// \param __b /// A 128-bit vector of [4 x float] containing one of the operands. /// \returns A 128-bit vector of [4 x float] containing the maximum values /// between both operands. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_max_ps(__m128 __a, __m128 __b) { return __builtin_ia32_maxps((__v4sf)__a, (__v4sf)__b); } /// \brief Performs a bitwise AND of two 128-bit vectors of [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VANDPS / ANDPS instructions. /// /// \param __a /// A 128-bit vector containing one of the source operands. /// \param __b /// A 128-bit vector containing one of the source operands. /// \returns A 128-bit vector of [4 x float] containing the bitwise AND of the /// values between both operands. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_and_ps(__m128 __a, __m128 __b) { return (__m128)((__v4su)__a & (__v4su)__b); } /// \brief Performs a bitwise AND of two 128-bit vectors of [4 x float], using /// the one's complement of the values contained in the first source /// operand. /// /// \headerfile /// /// This intrinsic corresponds to the VANDNPS / ANDNPS instructions. /// /// \param __a /// A 128-bit vector of [4 x float] containing the first source operand. The /// one's complement of this value is used in the bitwise AND. /// \param __b /// A 128-bit vector of [4 x float] containing the second source operand. /// \returns A 128-bit vector of [4 x float] containing the bitwise AND of the /// one's complement of the first operand and the values in the second /// operand. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_andnot_ps(__m128 __a, __m128 __b) { return (__m128)(~(__v4su)__a & (__v4su)__b); } /// \brief Performs a bitwise OR of two 128-bit vectors of [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VORPS / ORPS instructions. /// /// \param __a /// A 128-bit vector of [4 x float] containing one of the source operands. /// \param __b /// A 128-bit vector of [4 x float] containing one of the source operands. /// \returns A 128-bit vector of [4 x float] containing the bitwise OR of the /// values between both operands. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_or_ps(__m128 __a, __m128 __b) { return (__m128)((__v4su)__a | (__v4su)__b); } /// \brief Performs a bitwise exclusive OR of two 128-bit vectors of /// [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VXORPS / XORPS instructions. /// /// \param __a /// A 128-bit vector of [4 x float] containing one of the source operands. /// \param __b /// A 128-bit vector of [4 x float] containing one of the source operands. /// \returns A 128-bit vector of [4 x float] containing the bitwise exclusive OR /// of the values between both operands. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_xor_ps(__m128 __a, __m128 __b) { return (__m128)((__v4su)__a ^ (__v4su)__b); } /// \brief Compares two 32-bit float values in the low-order bits of both /// operands for equality and returns the result of the comparison in the /// low-order bits of a vector [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPEQSS / CMPEQSS instructions. /// /// \param __a /// A 128-bit vector of [4 x float] containing one of the operands. The lower /// 32 bits of this operand are used in the comparison. /// \param __b /// A 128-bit vector of [4 x float] containing one of the operands. The lower /// 32 bits of this operand are used in the comparison. /// \returns A 128-bit vector of [4 x float] containing the comparison results /// in the low-order bits. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cmpeq_ss(__m128 __a, __m128 __b) { return (__m128)__builtin_ia32_cmpeqss((__v4sf)__a, (__v4sf)__b); } /// \brief Compares each of the corresponding 32-bit float values of the /// 128-bit vectors of [4 x float] for equality. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPEQPS / CMPEQPS instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. /// \param __b /// A 128-bit vector of [4 x float]. /// \returns A 128-bit vector of [4 x float] containing the comparison results. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cmpeq_ps(__m128 __a, __m128 __b) { return (__m128)__builtin_ia32_cmpeqps((__v4sf)__a, (__v4sf)__b); } /// \brief Compares two 32-bit float values in the low-order bits of both /// operands to determine if the value in the first operand is less than the /// corresponding value in the second operand and returns the result of the /// comparison in the low-order bits of a vector of [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPLTSS / CMPLTSS instructions. /// /// \param __a /// A 128-bit vector of [4 x float] containing one of the operands. The lower /// 32 bits of this operand are used in the comparison. /// \param __b /// A 128-bit vector of [4 x float] containing one of the operands. The lower /// 32 bits of this operand are used in the comparison. /// \returns A 128-bit vector of [4 x float] containing the comparison results /// in the low-order bits. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cmplt_ss(__m128 __a, __m128 __b) { return (__m128)__builtin_ia32_cmpltss((__v4sf)__a, (__v4sf)__b); } /// \brief Compares each of the corresponding 32-bit float values of the /// 128-bit vectors of [4 x float] to determine if the values in the first /// operand are less than those in the second operand. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPLTPS / CMPLTPS instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. /// \param __b /// A 128-bit vector of [4 x float]. /// \returns A 128-bit vector of [4 x float] containing the comparison results. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cmplt_ps(__m128 __a, __m128 __b) { return (__m128)__builtin_ia32_cmpltps((__v4sf)__a, (__v4sf)__b); } /// \brief Compares two 32-bit float values in the low-order bits of both /// operands to determine if the value in the first operand is less than or /// equal to the corresponding value in the second operand and returns the /// result of the comparison in the low-order bits of a vector of /// [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPLESS / CMPLESS instructions. /// /// \param __a /// A 128-bit vector of [4 x float] containing one of the operands. The lower /// 32 bits of this operand are used in the comparison. /// \param __b /// A 128-bit vector of [4 x float] containing one of the operands. The lower /// 32 bits of this operand are used in the comparison. /// \returns A 128-bit vector of [4 x float] containing the comparison results /// in the low-order bits. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cmple_ss(__m128 __a, __m128 __b) { return (__m128)__builtin_ia32_cmpless((__v4sf)__a, (__v4sf)__b); } /// \brief Compares each of the corresponding 32-bit float values of the /// 128-bit vectors of [4 x float] to determine if the values in the first /// operand are less than or equal to those in the second operand. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPLEPS / CMPLEPS instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. /// \param __b /// A 128-bit vector of [4 x float]. /// \returns A 128-bit vector of [4 x float] containing the comparison results. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cmple_ps(__m128 __a, __m128 __b) { return (__m128)__builtin_ia32_cmpleps((__v4sf)__a, (__v4sf)__b); } /// \brief Compares two 32-bit float values in the low-order bits of both /// operands to determine if the value in the first operand is greater than /// the corresponding value in the second operand and returns the result of /// the comparison in the low-order bits of a vector of [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPLTSS / CMPLTSS instructions. /// /// \param __a /// A 128-bit vector of [4 x float] containing one of the operands. The lower /// 32 bits of this operand are used in the comparison. /// \param __b /// A 128-bit vector of [4 x float] containing one of the operands. The lower /// 32 bits of this operand are used in the comparison. /// \returns A 128-bit vector of [4 x float] containing the comparison results /// in the low-order bits. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cmpgt_ss(__m128 __a, __m128 __b) { return (__m128)__builtin_shufflevector((__v4sf)__a, (__v4sf)__builtin_ia32_cmpltss((__v4sf)__b, (__v4sf)__a), 4, 1, 2, 3); } /// \brief Compares each of the corresponding 32-bit float values of the /// 128-bit vectors of [4 x float] to determine if the values in the first /// operand are greater than those in the second operand. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPLTPS / CMPLTPS instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. /// \param __b /// A 128-bit vector of [4 x float]. /// \returns A 128-bit vector of [4 x float] containing the comparison results. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cmpgt_ps(__m128 __a, __m128 __b) { return (__m128)__builtin_ia32_cmpltps((__v4sf)__b, (__v4sf)__a); } /// \brief Compares two 32-bit float values in the low-order bits of both /// operands to determine if the value in the first operand is greater than /// or equal to the corresponding value in the second operand and returns /// the result of the comparison in the low-order bits of a vector of /// [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPLESS / CMPLESS instructions. /// /// \param __a /// A 128-bit vector of [4 x float] containing one of the operands. The lower /// 32 bits of this operand are used in the comparison. /// \param __b /// A 128-bit vector of [4 x float] containing one of the operands. The lower /// 32 bits of this operand are used in the comparison. /// \returns A 128-bit vector of [4 x float] containing the comparison results /// in the low-order bits. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cmpge_ss(__m128 __a, __m128 __b) { return (__m128)__builtin_shufflevector((__v4sf)__a, (__v4sf)__builtin_ia32_cmpless((__v4sf)__b, (__v4sf)__a), 4, 1, 2, 3); } /// \brief Compares each of the corresponding 32-bit float values of the /// 128-bit vectors of [4 x float] to determine if the values in the first /// operand are greater than or equal to those in the second operand. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPLEPS / CMPLEPS instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. /// \param __b /// A 128-bit vector of [4 x float]. /// \returns A 128-bit vector of [4 x float] containing the comparison results. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cmpge_ps(__m128 __a, __m128 __b) { return (__m128)__builtin_ia32_cmpleps((__v4sf)__b, (__v4sf)__a); } /// \brief Compares two 32-bit float values in the low-order bits of both /// operands for inequality and returns the result of the comparison in the /// low-order bits of a vector of [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPNEQSS / CMPNEQSS /// instructions. /// /// \param __a /// A 128-bit vector of [4 x float] containing one of the operands. The lower /// 32 bits of this operand are used in the comparison. /// \param __b /// A 128-bit vector of [4 x float] containing one of the operands. The lower /// 32 bits of this operand are used in the comparison. /// \returns A 128-bit vector of [4 x float] containing the comparison results /// in the low-order bits. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cmpneq_ss(__m128 __a, __m128 __b) { return (__m128)__builtin_ia32_cmpneqss((__v4sf)__a, (__v4sf)__b); } /// \brief Compares each of the corresponding 32-bit float values of the /// 128-bit vectors of [4 x float] for inequality. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPNEQPS / CMPNEQPS /// instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. /// \param __b /// A 128-bit vector of [4 x float]. /// \returns A 128-bit vector of [4 x float] containing the comparison results. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cmpneq_ps(__m128 __a, __m128 __b) { return (__m128)__builtin_ia32_cmpneqps((__v4sf)__a, (__v4sf)__b); } /// \brief Compares two 32-bit float values in the low-order bits of both /// operands to determine if the value in the first operand is not less than /// the corresponding value in the second operand and returns the result of /// the comparison in the low-order bits of a vector of [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPNLTSS / CMPNLTSS /// instructions. /// /// \param __a /// A 128-bit vector of [4 x float] containing one of the operands. The lower /// 32 bits of this operand are used in the comparison. /// \param __b /// A 128-bit vector of [4 x float] containing one of the operands. The lower /// 32 bits of this operand are used in the comparison. /// \returns A 128-bit vector of [4 x float] containing the comparison results /// in the low-order bits. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cmpnlt_ss(__m128 __a, __m128 __b) { return (__m128)__builtin_ia32_cmpnltss((__v4sf)__a, (__v4sf)__b); } /// \brief Compares each of the corresponding 32-bit float values of the /// 128-bit vectors of [4 x float] to determine if the values in the first /// operand are not less than those in the second operand. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPNLTPS / CMPNLTPS /// instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. /// \param __b /// A 128-bit vector of [4 x float]. /// \returns A 128-bit vector of [4 x float] containing the comparison results. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cmpnlt_ps(__m128 __a, __m128 __b) { return (__m128)__builtin_ia32_cmpnltps((__v4sf)__a, (__v4sf)__b); } /// \brief Compares two 32-bit float values in the low-order bits of both /// operands to determine if the value in the first operand is not less than /// or equal to the corresponding value in the second operand and returns /// the result of the comparison in the low-order bits of a vector of /// [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPNLESS / CMPNLESS /// instructions. /// /// \param __a /// A 128-bit vector of [4 x float] containing one of the operands. The lower /// 32 bits of this operand are used in the comparison. /// \param __b /// A 128-bit vector of [4 x float] containing one of the operands. The lower /// 32 bits of this operand are used in the comparison. /// \returns A 128-bit vector of [4 x float] containing the comparison results /// in the low-order bits. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cmpnle_ss(__m128 __a, __m128 __b) { return (__m128)__builtin_ia32_cmpnless((__v4sf)__a, (__v4sf)__b); } /// \brief Compares each of the corresponding 32-bit float values of the /// 128-bit vectors of [4 x float] to determine if the values in the first /// operand are not less than or equal to those in the second operand. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPNLEPS / CMPNLEPS /// instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. /// \param __b /// A 128-bit vector of [4 x float]. /// \returns A 128-bit vector of [4 x float] containing the comparison results. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cmpnle_ps(__m128 __a, __m128 __b) { return (__m128)__builtin_ia32_cmpnleps((__v4sf)__a, (__v4sf)__b); } /// \brief Compares two 32-bit float values in the low-order bits of both /// operands to determine if the value in the first operand is not greater /// than the corresponding value in the second operand and returns the /// result of the comparison in the low-order bits of a vector of /// [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPNLTSS / CMPNLTSS /// instructions. /// /// \param __a /// A 128-bit vector of [4 x float] containing one of the operands. The lower /// 32 bits of this operand are used in the comparison. /// \param __b /// A 128-bit vector of [4 x float] containing one of the operands. The lower /// 32 bits of this operand are used in the comparison. /// \returns A 128-bit vector of [4 x float] containing the comparison results /// in the low-order bits. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cmpngt_ss(__m128 __a, __m128 __b) { return (__m128)__builtin_shufflevector((__v4sf)__a, (__v4sf)__builtin_ia32_cmpnltss((__v4sf)__b, (__v4sf)__a), 4, 1, 2, 3); } /// \brief Compares each of the corresponding 32-bit float values of the /// 128-bit vectors of [4 x float] to determine if the values in the first /// operand are not greater than those in the second operand. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPNLTPS / CMPNLTPS /// instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. /// \param __b /// A 128-bit vector of [4 x float]. /// \returns A 128-bit vector of [4 x float] containing the comparison results. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cmpngt_ps(__m128 __a, __m128 __b) { return (__m128)__builtin_ia32_cmpnltps((__v4sf)__b, (__v4sf)__a); } /// \brief Compares two 32-bit float values in the low-order bits of both /// operands to determine if the value in the first operand is not greater /// than or equal to the corresponding value in the second operand and /// returns the result of the comparison in the low-order bits of a vector /// of [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPNLESS / CMPNLESS /// instructions. /// /// \param __a /// A 128-bit vector of [4 x float] containing one of the operands. The lower /// 32 bits of this operand are used in the comparison. /// \param __b /// A 128-bit vector of [4 x float] containing one of the operands. The lower /// 32 bits of this operand are used in the comparison. /// \returns A 128-bit vector of [4 x float] containing the comparison results /// in the low-order bits. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cmpnge_ss(__m128 __a, __m128 __b) { return (__m128)__builtin_shufflevector((__v4sf)__a, (__v4sf)__builtin_ia32_cmpnless((__v4sf)__b, (__v4sf)__a), 4, 1, 2, 3); } /// \brief Compares each of the corresponding 32-bit float values of the /// 128-bit vectors of [4 x float] to determine if the values in the first /// operand are not greater than or equal to those in the second operand. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPNLEPS / CMPNLEPS /// instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. /// \param __b /// A 128-bit vector of [4 x float]. /// \returns A 128-bit vector of [4 x float] containing the comparison results. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cmpnge_ps(__m128 __a, __m128 __b) { return (__m128)__builtin_ia32_cmpnleps((__v4sf)__b, (__v4sf)__a); } /// \brief Compares two 32-bit float values in the low-order bits of both /// operands to determine if the value in the first operand is ordered with /// respect to the corresponding value in the second operand and returns the /// result of the comparison in the low-order bits of a vector of /// [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPORDSS / CMPORDSS /// instructions. /// /// \param __a /// A 128-bit vector of [4 x float] containing one of the operands. The lower /// 32 bits of this operand are used in the comparison. /// \param __b /// A 128-bit vector of [4 x float] containing one of the operands. The lower /// 32 bits of this operand are used in the comparison. /// \returns A 128-bit vector of [4 x float] containing the comparison results /// in the low-order bits. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cmpord_ss(__m128 __a, __m128 __b) { return (__m128)__builtin_ia32_cmpordss((__v4sf)__a, (__v4sf)__b); } /// \brief Compares each of the corresponding 32-bit float values of the /// 128-bit vectors of [4 x float] to determine if the values in the first /// operand are ordered with respect to those in the second operand. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPORDPS / CMPORDPS /// instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. /// \param __b /// A 128-bit vector of [4 x float]. /// \returns A 128-bit vector of [4 x float] containing the comparison results. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cmpord_ps(__m128 __a, __m128 __b) { return (__m128)__builtin_ia32_cmpordps((__v4sf)__a, (__v4sf)__b); } /// \brief Compares two 32-bit float values in the low-order bits of both /// operands to determine if the value in the first operand is unordered /// with respect to the corresponding value in the second operand and /// returns the result of the comparison in the low-order bits of a vector /// of [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPUNORDSS / CMPUNORDSS /// instructions. /// /// \param __a /// A 128-bit vector of [4 x float] containing one of the operands. The lower /// 32 bits of this operand are used in the comparison. /// \param __b /// A 128-bit vector of [4 x float] containing one of the operands. The lower /// 32 bits of this operand are used in the comparison. /// \returns A 128-bit vector of [4 x float] containing the comparison results /// in the low-order bits. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cmpunord_ss(__m128 __a, __m128 __b) { return (__m128)__builtin_ia32_cmpunordss((__v4sf)__a, (__v4sf)__b); } /// \brief Compares each of the corresponding 32-bit float values of the /// 128-bit vectors of [4 x float] to determine if the values in the first /// operand are unordered with respect to those in the second operand. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPUNORDPS / CMPUNORDPS /// instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. /// \param __b /// A 128-bit vector of [4 x float]. /// \returns A 128-bit vector of [4 x float] containing the comparison results. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cmpunord_ps(__m128 __a, __m128 __b) { return (__m128)__builtin_ia32_cmpunordps((__v4sf)__a, (__v4sf)__b); } /// \brief Compares two 32-bit float values in the low-order bits of both /// operands for equality and returns the result of the comparison. /// /// \headerfile /// /// This intrinsic corresponds to the VCOMISS / COMISS /// instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the comparison. /// \param __b /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the comparison. /// \returns An integer containing the comparison results. static __inline__ int __DEFAULT_FN_ATTRS _mm_comieq_ss(__m128 __a, __m128 __b) { return __builtin_ia32_comieq((__v4sf)__a, (__v4sf)__b); } /// \brief Compares two 32-bit float values in the low-order bits of both /// operands to determine if the first operand is less than the second /// operand and returns the result of the comparison. /// /// \headerfile /// /// This intrinsic corresponds to the VCOMISS / COMISS /// instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the comparison. /// \param __b /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the comparison. /// \returns An integer containing the comparison results. static __inline__ int __DEFAULT_FN_ATTRS _mm_comilt_ss(__m128 __a, __m128 __b) { return __builtin_ia32_comilt((__v4sf)__a, (__v4sf)__b); } /// \brief Compares two 32-bit float values in the low-order bits of both /// operands to determine if the first operand is less than or equal to the /// second operand and returns the result of the comparison. /// /// \headerfile /// /// This intrinsic corresponds to the VCOMISS / COMISS instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the comparison. /// \param __b /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the comparison. /// \returns An integer containing the comparison results. static __inline__ int __DEFAULT_FN_ATTRS _mm_comile_ss(__m128 __a, __m128 __b) { return __builtin_ia32_comile((__v4sf)__a, (__v4sf)__b); } /// \brief Compares two 32-bit float values in the low-order bits of both /// operands to determine if the first operand is greater than the second /// operand and returns the result of the comparison. /// /// \headerfile /// /// This intrinsic corresponds to the VCOMISS / COMISS instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the comparison. /// \param __b /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the comparison. /// \returns An integer containing the comparison results. static __inline__ int __DEFAULT_FN_ATTRS _mm_comigt_ss(__m128 __a, __m128 __b) { return __builtin_ia32_comigt((__v4sf)__a, (__v4sf)__b); } /// \brief Compares two 32-bit float values in the low-order bits of both /// operands to determine if the first operand is greater than or equal to /// the second operand and returns the result of the comparison. /// /// \headerfile /// /// This intrinsic corresponds to the VCOMISS / COMISS instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the comparison. /// \param __b /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the comparison. /// \returns An integer containing the comparison results. static __inline__ int __DEFAULT_FN_ATTRS _mm_comige_ss(__m128 __a, __m128 __b) { return __builtin_ia32_comige((__v4sf)__a, (__v4sf)__b); } /// \brief Compares two 32-bit float values in the low-order bits of both /// operands to determine if the first operand is not equal to the second /// operand and returns the result of the comparison. /// /// \headerfile /// /// This intrinsic corresponds to the VCOMISS / COMISS instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the comparison. /// \param __b /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the comparison. /// \returns An integer containing the comparison results. static __inline__ int __DEFAULT_FN_ATTRS _mm_comineq_ss(__m128 __a, __m128 __b) { return __builtin_ia32_comineq((__v4sf)__a, (__v4sf)__b); } /// \brief Performs an unordered comparison of two 32-bit float values using /// the low-order bits of both operands to determine equality and returns /// the result of the comparison. /// /// \headerfile /// /// This intrinsic corresponds to the VUCOMISS / UCOMISS instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the comparison. /// \param __b /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the comparison. /// \returns An integer containing the comparison results. static __inline__ int __DEFAULT_FN_ATTRS _mm_ucomieq_ss(__m128 __a, __m128 __b) { return __builtin_ia32_ucomieq((__v4sf)__a, (__v4sf)__b); } /// \brief Performs an unordered comparison of two 32-bit float values using /// the low-order bits of both operands to determine if the first operand is /// less than the second operand and returns the result of the comparison. /// /// \headerfile /// /// This intrinsic corresponds to the VUCOMISS / UCOMISS instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the comparison. /// \param __b /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the comparison. /// \returns An integer containing the comparison results. static __inline__ int __DEFAULT_FN_ATTRS _mm_ucomilt_ss(__m128 __a, __m128 __b) { return __builtin_ia32_ucomilt((__v4sf)__a, (__v4sf)__b); } /// \brief Performs an unordered comparison of two 32-bit float values using /// the low-order bits of both operands to determine if the first operand is /// less than or equal to the second operand and returns the result of the /// comparison. /// /// \headerfile /// /// This intrinsic corresponds to the VUCOMISS / UCOMISS instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the comparison. /// \param __b /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the comparison. /// \returns An integer containing the comparison results. static __inline__ int __DEFAULT_FN_ATTRS _mm_ucomile_ss(__m128 __a, __m128 __b) { return __builtin_ia32_ucomile((__v4sf)__a, (__v4sf)__b); } /// \brief Performs an unordered comparison of two 32-bit float values using /// the low-order bits of both operands to determine if the first operand is /// greater than the second operand and returns the result of the /// comparison. /// /// \headerfile /// /// This intrinsic corresponds to the VUCOMISS / UCOMISS instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the comparison. /// \param __b /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the comparison. /// \returns An integer containing the comparison results. static __inline__ int __DEFAULT_FN_ATTRS _mm_ucomigt_ss(__m128 __a, __m128 __b) { return __builtin_ia32_ucomigt((__v4sf)__a, (__v4sf)__b); } /// \brief Performs an unordered comparison of two 32-bit float values using /// the low-order bits of both operands to determine if the first operand is /// greater than or equal to the second operand and returns the result of /// the comparison. /// /// \headerfile /// /// This intrinsic corresponds to the VUCOMISS / UCOMISS instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the comparison. /// \param __b /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the comparison. /// \returns An integer containing the comparison results. static __inline__ int __DEFAULT_FN_ATTRS _mm_ucomige_ss(__m128 __a, __m128 __b) { return __builtin_ia32_ucomige((__v4sf)__a, (__v4sf)__b); } /// \brief Performs an unordered comparison of two 32-bit float values using /// the low-order bits of both operands to determine inequality and returns /// the result of the comparison. /// /// \headerfile /// /// This intrinsic corresponds to the VUCOMISS / UCOMISS instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the comparison. /// \param __b /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the comparison. /// \returns An integer containing the comparison results. static __inline__ int __DEFAULT_FN_ATTRS _mm_ucomineq_ss(__m128 __a, __m128 __b) { return __builtin_ia32_ucomineq((__v4sf)__a, (__v4sf)__b); } /// \brief Converts a float value contained in the lower 32 bits of a vector of /// [4 x float] into a 32-bit integer. /// /// \headerfile /// /// This intrinsic corresponds to the VCVTSS2SI / CVTSS2SI /// instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the conversion. /// \returns A 32-bit integer containing the converted value. static __inline__ int __DEFAULT_FN_ATTRS _mm_cvtss_si32(__m128 __a) { return __builtin_ia32_cvtss2si((__v4sf)__a); } /// \brief Converts a float value contained in the lower 32 bits of a vector of /// [4 x float] into a 32-bit integer. /// /// \headerfile /// /// This intrinsic corresponds to the VCVTSS2SI / CVTSS2SI /// instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the conversion. /// \returns A 32-bit integer containing the converted value. static __inline__ int __DEFAULT_FN_ATTRS _mm_cvt_ss2si(__m128 __a) { return _mm_cvtss_si32(__a); } #ifdef __x86_64__ /// \brief Converts a float value contained in the lower 32 bits of a vector of /// [4 x float] into a 64-bit integer. /// /// \headerfile /// /// This intrinsic corresponds to the VCVTSS2SI / CVTSS2SI /// instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the conversion. /// \returns A 64-bit integer containing the converted value. static __inline__ long long __DEFAULT_FN_ATTRS _mm_cvtss_si64(__m128 __a) { return __builtin_ia32_cvtss2si64((__v4sf)__a); } #endif # 1324 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xmmintrin.h" 3 /// \brief Converts two low-order float values in a 128-bit vector of /// [4 x float] into a 64-bit vector of [2 x i32]. /// /// \headerfile /// /// This intrinsic corresponds to the CVTPS2PI instruction. /// /// \param __a /// A 128-bit vector of [4 x float]. /// \returns A 64-bit integer vector containing the converted values. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_cvtps_pi32(__m128 __a) { return (__m64)__builtin_ia32_cvtps2pi((__v4sf)__a); } /// \brief Converts two low-order float values in a 128-bit vector of /// [4 x float] into a 64-bit vector of [2 x i32]. /// /// \headerfile /// /// This intrinsic corresponds to the CVTPS2PI instruction. /// /// \param __a /// A 128-bit vector of [4 x float]. /// \returns A 64-bit integer vector containing the converted values. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_cvt_ps2pi(__m128 __a) { return _mm_cvtps_pi32(__a); } /// \brief Converts a float value contained in the lower 32 bits of a vector of /// [4 x float] into a 32-bit integer, truncating the result when it is /// inexact. /// /// \headerfile /// /// This intrinsic corresponds to the VCVTTSS2SI / CVTTSS2SI /// instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the conversion. /// \returns A 32-bit integer containing the converted value. static __inline__ int __DEFAULT_FN_ATTRS _mm_cvttss_si32(__m128 __a) { return __builtin_ia32_cvttss2si((__v4sf)__a); } /// \brief Converts a float value contained in the lower 32 bits of a vector of /// [4 x float] into a 32-bit integer, truncating the result when it is /// inexact. /// /// \headerfile /// /// This intrinsic corresponds to the VCVTTSS2SI / CVTTSS2SI /// instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the conversion. /// \returns A 32-bit integer containing the converted value. static __inline__ int __DEFAULT_FN_ATTRS _mm_cvtt_ss2si(__m128 __a) { return _mm_cvttss_si32(__a); } #ifdef __x86_64__ /// \brief Converts a float value contained in the lower 32 bits of a vector of /// [4 x float] into a 64-bit integer, truncating the result when it is /// inexact. /// /// \headerfile /// /// This intrinsic corresponds to the VCVTTSS2SI / CVTTSS2SI /// instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the conversion. /// \returns A 64-bit integer containing the converted value. static __inline__ long long __DEFAULT_FN_ATTRS _mm_cvttss_si64(__m128 __a) { return __builtin_ia32_cvttss2si64((__v4sf)__a); } #endif # 1415 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xmmintrin.h" 3 /// \brief Converts two low-order float values in a 128-bit vector of /// [4 x float] into a 64-bit vector of [2 x i32], truncating the result /// when it is inexact. /// /// \headerfile /// /// This intrinsic corresponds to the CVTTPS2PI / VTTPS2PI /// instructions. /// /// \param __a /// A 128-bit vector of [4 x float]. /// \returns A 64-bit integer vector containing the converted values. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_cvttps_pi32(__m128 __a) { return (__m64)__builtin_ia32_cvttps2pi((__v4sf)__a); } /// \brief Converts two low-order float values in a 128-bit vector of [4 x /// float] into a 64-bit vector of [2 x i32], truncating the result when it /// is inexact. /// /// \headerfile /// /// This intrinsic corresponds to the CVTTPS2PI instruction. /// /// \param __a /// A 128-bit vector of [4 x float]. /// \returns A 64-bit integer vector containing the converted values. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_cvtt_ps2pi(__m128 __a) { return _mm_cvttps_pi32(__a); } /// \brief Converts a 32-bit signed integer value into a floating point value /// and writes it to the lower 32 bits of the destination. The remaining /// higher order elements of the destination vector are copied from the /// corresponding elements in the first operand. /// /// \headerfile /// /// This intrinsic corresponds to the VCVTSI2SS / CVTSI2SS instruction. /// /// \param __a /// A 128-bit vector of [4 x float]. /// \param __b /// A 32-bit signed integer operand containing the value to be converted. /// \returns A 128-bit vector of [4 x float] whose lower 32 bits contain the /// converted value of the second operand. The upper 96 bits are copied from /// the upper 96 bits of the first operand. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cvtsi32_ss(__m128 __a, int __b) { __a[0] = __b; return __a; } /// \brief Converts a 32-bit signed integer value into a floating point value /// and writes it to the lower 32 bits of the destination. The remaining /// higher order elements of the destination are copied from the /// corresponding elements in the first operand. /// /// \headerfile /// /// This intrinsic corresponds to the VCVTSI2SS / CVTSI2SS instruction. /// /// \param __a /// A 128-bit vector of [4 x float]. /// \param __b /// A 32-bit signed integer operand containing the value to be converted. /// \returns A 128-bit vector of [4 x float] whose lower 32 bits contain the /// converted value of the second operand. The upper 96 bits are copied from /// the upper 96 bits of the first operand. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cvt_si2ss(__m128 __a, int __b) { return _mm_cvtsi32_ss(__a, __b); } #ifdef __x86_64__ /// \brief Converts a 64-bit signed integer value into a floating point value /// and writes it to the lower 32 bits of the destination. The remaining /// higher order elements of the destination are copied from the /// corresponding elements in the first operand. /// /// \headerfile /// /// This intrinsic corresponds to the VCVTSI2SS / CVTSI2SS instruction. /// /// \param __a /// A 128-bit vector of [4 x float]. /// \param __b /// A 64-bit signed integer operand containing the value to be converted. /// \returns A 128-bit vector of [4 x float] whose lower 32 bits contain the /// converted value of the second operand. The upper 96 bits are copied from /// the upper 96 bits of the first operand. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cvtsi64_ss(__m128 __a, long long __b) { __a[0] = __b; return __a; } #endif # 1522 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xmmintrin.h" 3 /// \brief Converts two elements of a 64-bit vector of [2 x i32] into two /// floating point values and writes them to the lower 64-bits of the /// destination. The remaining higher order elements of the destination are /// copied from the corresponding elements in the first operand. /// /// \headerfile /// /// This intrinsic corresponds to the CVTPI2PS instruction. /// /// \param __a /// A 128-bit vector of [4 x float]. /// \param __b /// A 64-bit vector of [2 x i32]. The elements in this vector are converted /// and written to the corresponding low-order elements in the destination. /// \returns A 128-bit vector of [4 x float] whose lower 64 bits contain the /// converted value of the second operand. The upper 64 bits are copied from /// the upper 64 bits of the first operand. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cvtpi32_ps(__m128 __a, __m64 __b) { return __builtin_ia32_cvtpi2ps((__v4sf)__a, (__v2si)__b); } /// \brief Converts two elements of a 64-bit vector of [2 x i32] into two /// floating point values and writes them to the lower 64-bits of the /// destination. The remaining higher order elements of the destination are /// copied from the corresponding elements in the first operand. /// /// \headerfile /// /// This intrinsic corresponds to the CVTPI2PS instruction. /// /// \param __a /// A 128-bit vector of [4 x float]. /// \param __b /// A 64-bit vector of [2 x i32]. The elements in this vector are converted /// and written to the corresponding low-order elements in the destination. /// \returns A 128-bit vector of [4 x float] whose lower 64 bits contain the /// converted value from the second operand. The upper 64 bits are copied /// from the upper 64 bits of the first operand. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cvt_pi2ps(__m128 __a, __m64 __b) { return _mm_cvtpi32_ps(__a, __b); } /// \brief Extracts a float value contained in the lower 32 bits of a vector of /// [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVSS / MOVSS instruction. /// /// \param __a /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are /// used in the extraction. /// \returns A 32-bit float containing the extracted value. static __inline__ float __DEFAULT_FN_ATTRS _mm_cvtss_f32(__m128 __a) { return __a[0]; } /// \brief Loads two packed float values from the address \a __p into the /// high-order bits of a 128-bit vector of [4 x float]. The low-order bits /// are copied from the low-order bits of the first operand. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVHPD / MOVHPD instruction. /// /// \param __a /// A 128-bit vector of [4 x float]. Bits [63:0] are written to bits [63:0] /// of the destination. /// \param __p /// A pointer to two packed float values. Bits [63:0] are written to bits /// [127:64] of the destination. /// \returns A 128-bit vector of [4 x float] containing the moved values. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_loadh_pi(__m128 __a, const __m64 *__p) { typedef float __mm_loadh_pi_v2f32 __attribute__((__vector_size__(8))); struct __mm_loadh_pi_struct { __mm_loadh_pi_v2f32 __u; } __attribute__((__packed__, __may_alias__)); __mm_loadh_pi_v2f32 __b = ((struct __mm_loadh_pi_struct*)__p)->__u; __m128 __bb = __builtin_shufflevector(__b, __b, 0, 1, 0, 1); return __builtin_shufflevector(__a, __bb, 0, 1, 4, 5); } /// \brief Loads two packed float values from the address \a __p into the /// low-order bits of a 128-bit vector of [4 x float]. The high-order bits /// are copied from the high-order bits of the first operand. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVLPD / MOVLPD instruction. /// /// \param __a /// A 128-bit vector of [4 x float]. Bits [127:64] are written to bits /// [127:64] of the destination. /// \param __p /// A pointer to two packed float values. Bits [63:0] are written to bits /// [63:0] of the destination. /// \returns A 128-bit vector of [4 x float] containing the moved values. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_loadl_pi(__m128 __a, const __m64 *__p) { typedef float __mm_loadl_pi_v2f32 __attribute__((__vector_size__(8))); struct __mm_loadl_pi_struct { __mm_loadl_pi_v2f32 __u; } __attribute__((__packed__, __may_alias__)); __mm_loadl_pi_v2f32 __b = ((struct __mm_loadl_pi_struct*)__p)->__u; __m128 __bb = __builtin_shufflevector(__b, __b, 0, 1, 0, 1); return __builtin_shufflevector(__a, __bb, 4, 5, 2, 3); } /// \brief Constructs a 128-bit floating-point vector of [4 x float]. The lower /// 32 bits of the vector are initialized with the single-precision /// floating-point value loaded from a specified memory location. The upper /// 96 bits are set to zero. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVSS / MOVSS instruction. /// /// \param __p /// A pointer to a 32-bit memory location containing a single-precision /// floating-point value. /// \returns An initialized 128-bit floating-point vector of [4 x float]. The /// lower 32 bits contain the value loaded from the memory location. The /// upper 96 bits are set to zero. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_load_ss(const float *__p) { struct __mm_load_ss_struct { float __u; } __attribute__((__packed__, __may_alias__)); float __u = ((struct __mm_load_ss_struct*)__p)->__u; return (__m128){ __u, 0, 0, 0 }; } /// \brief Loads a 32-bit float value and duplicates it to all four vector /// elements of a 128-bit vector of [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVSS / MOVSS + shuffling /// instruction. /// /// \param __p /// A pointer to a float value to be loaded and duplicated. /// \returns A 128-bit vector of [4 x float] containing the loaded and /// duplicated values. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_load1_ps(const float *__p) { struct __mm_load1_ps_struct { float __u; } __attribute__((__packed__, __may_alias__)); float __u = ((struct __mm_load1_ps_struct*)__p)->__u; return (__m128){ __u, __u, __u, __u }; } #define _mm_load_ps1(p) _mm_load1_ps(p) /// \brief Loads a 128-bit floating-point vector of [4 x float] from an aligned /// memory location. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVAPS / MOVAPS instruction. /// /// \param __p /// A pointer to a 128-bit memory location. The address of the memory /// location has to be 128-bit aligned. /// \returns A 128-bit vector of [4 x float] containing the loaded valus. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_load_ps(const float *__p) { return *(__m128*)__p; } /// \brief Loads a 128-bit floating-point vector of [4 x float] from an /// unaligned memory location. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVUPS / MOVUPS instruction. /// /// \param __p /// A pointer to a 128-bit memory location. The address of the memory /// location does not have to be aligned. /// \returns A 128-bit vector of [4 x float] containing the loaded values. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_loadu_ps(const float *__p) { struct __loadu_ps { __m128 __v; } __attribute__((__packed__, __may_alias__)); return ((struct __loadu_ps*)__p)->__v; } /// \brief Loads four packed float values, in reverse order, from an aligned /// memory location to 32-bit elements in a 128-bit vector of [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVAPS / MOVAPS + shuffling /// instruction. /// /// \param __p /// A pointer to a 128-bit memory location. The address of the memory /// location has to be 128-bit aligned. /// \returns A 128-bit vector of [4 x float] containing the moved values, loaded /// in reverse order. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_loadr_ps(const float *__p) { __m128 __a = _mm_load_ps(__p); return __builtin_shufflevector((__v4sf)__a, (__v4sf)__a, 3, 2, 1, 0); } /// \brief Create a 128-bit vector of [4 x float] with undefined values. /// /// \headerfile /// /// This intrinsic has no corresponding instruction. /// /// \returns A 128-bit vector of [4 x float] containing undefined values. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_undefined_ps(void) { return (__m128)__builtin_ia32_undef128(); } /// \brief Constructs a 128-bit floating-point vector of [4 x float]. The lower /// 32 bits of the vector are initialized with the specified single-precision /// floating-point value. The upper 96 bits are set to zero. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVSS / MOVSS instruction. /// /// \param __w /// A single-precision floating-point value used to initialize the lower 32 /// bits of the result. /// \returns An initialized 128-bit floating-point vector of [4 x float]. The /// lower 32 bits contain the value provided in the source operand. The /// upper 96 bits are set to zero. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_set_ss(float __w) { return (__m128){ __w, 0, 0, 0 }; } /// \brief Constructs a 128-bit floating-point vector of [4 x float], with each /// of the four single-precision floating-point vector elements set to the /// specified single-precision floating-point value. /// /// \headerfile /// /// This intrinsic corresponds to the VPERMILPS / PERMILPS instruction. /// /// \param __w /// A single-precision floating-point value used to initialize each vector /// element of the result. /// \returns An initialized 128-bit floating-point vector of [4 x float]. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_set1_ps(float __w) { return (__m128){ __w, __w, __w, __w }; } /* Microsoft specific. */ /// \brief Constructs a 128-bit floating-point vector of [4 x float], with each /// of the four single-precision floating-point vector elements set to the /// specified single-precision floating-point value. /// /// \headerfile /// /// This intrinsic corresponds to the VPERMILPS / PERMILPS instruction. /// /// \param __w /// A single-precision floating-point value used to initialize each vector /// element of the result. /// \returns An initialized 128-bit floating-point vector of [4 x float]. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_set_ps1(float __w) { return _mm_set1_ps(__w); } /// \brief Constructs a 128-bit floating-point vector of [4 x float] /// initialized with the specified single-precision floating-point values. /// /// \headerfile /// /// This intrinsic is a utility function and does not correspond to a specific /// instruction. /// /// \param __z /// A single-precision floating-point value used to initialize bits [127:96] /// of the result. /// \param __y /// A single-precision floating-point value used to initialize bits [95:64] /// of the result. /// \param __x /// A single-precision floating-point value used to initialize bits [63:32] /// of the result. /// \param __w /// A single-precision floating-point value used to initialize bits [31:0] /// of the result. /// \returns An initialized 128-bit floating-point vector of [4 x float]. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_set_ps(float __z, float __y, float __x, float __w) { return (__m128){ __w, __x, __y, __z }; } /// \brief Constructs a 128-bit floating-point vector of [4 x float], /// initialized in reverse order with the specified 32-bit single-precision /// float-point values. /// /// \headerfile /// /// This intrinsic is a utility function and does not correspond to a specific /// instruction. /// /// \param __z /// A single-precision floating-point value used to initialize bits [31:0] /// of the result. /// \param __y /// A single-precision floating-point value used to initialize bits [63:32] /// of the result. /// \param __x /// A single-precision floating-point value used to initialize bits [95:64] /// of the result. /// \param __w /// A single-precision floating-point value used to initialize bits [127:96] /// of the result. /// \returns An initialized 128-bit floating-point vector of [4 x float]. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_setr_ps(float __z, float __y, float __x, float __w) { return (__m128){ __z, __y, __x, __w }; } /// \brief Constructs a 128-bit floating-point vector of [4 x float] initialized /// to zero. /// /// \headerfile /// /// This intrinsic corresponds to the VXORPS / XORPS instruction. /// /// \returns An initialized 128-bit floating-point vector of [4 x float] with /// all elements set to zero. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_setzero_ps(void) { return (__m128){ 0, 0, 0, 0 }; } /// \brief Stores the upper 64 bits of a 128-bit vector of [4 x float] to a /// memory location. /// /// \headerfile /// /// This intrinsic corresponds to the VPEXTRQ / MOVQ instruction. /// /// \param __p /// A pointer to a 64-bit memory location. /// \param __a /// A 128-bit vector of [4 x float] containing the values to be stored. static __inline__ void __DEFAULT_FN_ATTRS _mm_storeh_pi(__m64 *__p, __m128 __a) { __builtin_ia32_storehps((__v2si *)__p, (__v4sf)__a); } /// \brief Stores the lower 64 bits of a 128-bit vector of [4 x float] to a /// memory location. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVLPS / MOVLPS instruction. /// /// \param __p /// A pointer to a memory location that will receive the float values. /// \param __a /// A 128-bit vector of [4 x float] containing the values to be stored. static __inline__ void __DEFAULT_FN_ATTRS _mm_storel_pi(__m64 *__p, __m128 __a) { __builtin_ia32_storelps((__v2si *)__p, (__v4sf)__a); } /// \brief Stores the lower 32 bits of a 128-bit vector of [4 x float] to a /// memory location. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVSS / MOVSS instruction. /// /// \param __p /// A pointer to a 32-bit memory location. /// \param __a /// A 128-bit vector of [4 x float] containing the value to be stored. static __inline__ void __DEFAULT_FN_ATTRS _mm_store_ss(float *__p, __m128 __a) { struct __mm_store_ss_struct { float __u; } __attribute__((__packed__, __may_alias__)); ((struct __mm_store_ss_struct*)__p)->__u = __a[0]; } /// \brief Stores a 128-bit vector of [4 x float] to an unaligned memory /// location. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVUPS / MOVUPS instruction. /// /// \param __p /// A pointer to a 128-bit memory location. The address of the memory /// location does not have to be aligned. /// \param __a /// A 128-bit vector of [4 x float] containing the values to be stored. static __inline__ void __DEFAULT_FN_ATTRS _mm_storeu_ps(float *__p, __m128 __a) { struct __storeu_ps { __m128 __v; } __attribute__((__packed__, __may_alias__)); ((struct __storeu_ps*)__p)->__v = __a; } /// \brief Stores a 128-bit vector of [4 x float] into an aligned memory /// location. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVAPS / MOVAPS instruction. /// /// \param __p /// A pointer to a 128-bit memory location. The address of the memory /// location has to be 16-byte aligned. /// \param __a /// A 128-bit vector of [4 x float] containing the values to be stored. static __inline__ void __DEFAULT_FN_ATTRS _mm_store_ps(float *__p, __m128 __a) { *(__m128*)__p = __a; } /// \brief Stores the lower 32 bits of a 128-bit vector of [4 x float] into /// four contiguous elements in an aligned memory location. /// /// \headerfile /// /// This intrinsic corresponds to VMOVAPS / MOVAPS + shuffling /// instruction. /// /// \param __p /// A pointer to a 128-bit memory location. /// \param __a /// A 128-bit vector of [4 x float] whose lower 32 bits are stored to each /// of the four contiguous elements pointed by \a __p. static __inline__ void __DEFAULT_FN_ATTRS _mm_store1_ps(float *__p, __m128 __a) { __a = __builtin_shufflevector((__v4sf)__a, (__v4sf)__a, 0, 0, 0, 0); _mm_store_ps(__p, __a); } /// \brief Stores the lower 32 bits of a 128-bit vector of [4 x float] into /// four contiguous elements in an aligned memory location. /// /// \headerfile /// /// This intrinsic corresponds to VMOVAPS / MOVAPS + shuffling /// instruction. /// /// \param __p /// A pointer to a 128-bit memory location. /// \param __a /// A 128-bit vector of [4 x float] whose lower 32 bits are stored to each /// of the four contiguous elements pointed by \a __p. static __inline__ void __DEFAULT_FN_ATTRS _mm_store_ps1(float *__p, __m128 __a) { return _mm_store1_ps(__p, __a); } /// \brief Stores float values from a 128-bit vector of [4 x float] to an /// aligned memory location in reverse order. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVAPS / MOVAPS + shuffling /// instruction. /// /// \param __p /// A pointer to a 128-bit memory location. The address of the memory /// location has to be 128-bit aligned. /// \param __a /// A 128-bit vector of [4 x float] containing the values to be stored. static __inline__ void __DEFAULT_FN_ATTRS _mm_storer_ps(float *__p, __m128 __a) { __a = __builtin_shufflevector((__v4sf)__a, (__v4sf)__a, 3, 2, 1, 0); _mm_store_ps(__p, __a); } #define _MM_HINT_ET0 7 #define _MM_HINT_ET1 6 #define _MM_HINT_T0 3 #define _MM_HINT_T1 2 #define _MM_HINT_T2 1 #define _MM_HINT_NTA 0 #ifndef _MSC_VER /* FIXME: We have to #define this because "sel" must be a constant integer, and Sema doesn't do any form of constant propagation yet. */ /// \brief Loads one cache line of data from the specified address to a location /// closer to the processor. /// /// \headerfile /// /// \code /// void _mm_prefetch(const void * a, const int sel); /// \endcode /// /// This intrinsic corresponds to the PREFETCHNTA instruction. /// /// \param a /// A pointer to a memory location containing a cache line of data. /// \param sel /// A predefined integer constant specifying the type of prefetch /// operation: \n /// _MM_HINT_NTA: Move data using the non-temporal access (NTA) hint. The /// PREFETCHNTA instruction will be generated. \n /// _MM_HINT_T0: Move data using the T0 hint. The PREFETCHT0 instruction will /// be generated. \n /// _MM_HINT_T1: Move data using the T1 hint. The PREFETCHT1 instruction will /// be generated. \n /// _MM_HINT_T2: Move data using the T2 hint. The PREFETCHT2 instruction will /// be generated. #define _mm_prefetch(a, sel) (__builtin_prefetch((void *)(a), \ ((sel) >> 2) & 1, (sel) & 0x3)) #endif # 2076 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xmmintrin.h" 3 /// \brief Stores a 64-bit integer in the specified aligned memory location. To /// minimize caching, the data is flagged as non-temporal (unlikely to be /// used again soon). /// /// \headerfile /// /// This intrinsic corresponds to the MOVNTQ instruction. /// /// \param __p /// A pointer to an aligned memory location used to store the register value. /// \param __a /// A 64-bit integer containing the value to be stored. static __inline__ void __DEFAULT_FN_ATTRS _mm_stream_pi(__m64 *__p, __m64 __a) { __builtin_ia32_movntq(__p, __a); } /// \brief Moves packed float values from a 128-bit vector of [4 x float] to a /// 128-bit aligned memory location. To minimize caching, the data is flagged /// as non-temporal (unlikely to be used again soon). /// /// \headerfile /// /// This intrinsic corresponds to the VMOVNTPS / MOVNTPS instruction. /// /// \param __p /// A pointer to a 128-bit aligned memory location that will receive the /// single-precision floating-point values. /// \param __a /// A 128-bit vector of [4 x float] containing the values to be moved. static __inline__ void __DEFAULT_FN_ATTRS _mm_stream_ps(float *__p, __m128 __a) { __builtin_nontemporal_store((__v4sf)__a, (__v4sf*)__p); } #if defined(__cplusplus) extern "C" { #endif # 2117 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xmmintrin.h" 3 /// \brief Forces strong memory ordering (serialization) between store /// instructions preceding this instruction and store instructions following /// this instruction, ensuring the system completes all previous stores /// before executing subsequent stores. /// /// \headerfile /// /// This intrinsic corresponds to the SFENCE instruction. /// void _mm_sfence(void); #if defined(__cplusplus) } // extern "C" #endif # 2132 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xmmintrin.h" 3 /// \brief Extracts 16-bit element from a 64-bit vector of [4 x i16] and /// returns it, as specified by the immediate integer operand. /// /// \headerfile /// /// \code /// int _mm_extract_pi16(__m64 a, int n); /// \endcode /// /// This intrinsic corresponds to the VPEXTRW / PEXTRW instruction. /// /// \param a /// A 64-bit vector of [4 x i16]. /// \param n /// An immediate integer operand that determines which bits are extracted: \n /// 0: Bits [15:0] are copied to the destination. \n /// 1: Bits [31:16] are copied to the destination. \n /// 2: Bits [47:32] are copied to the destination. \n /// 3: Bits [63:48] are copied to the destination. /// \returns A 16-bit integer containing the extracted 16 bits of packed data. #define _mm_extract_pi16(a, n) __extension__ ({ \ (int)__builtin_ia32_vec_ext_v4hi((__m64)a, (int)n); }) /// \brief Copies data from the 64-bit vector of [4 x i16] to the destination, /// and inserts the lower 16-bits of an integer operand at the 16-bit offset /// specified by the immediate operand \a n. /// /// \headerfile /// /// \code /// __m64 _mm_insert_pi16(__m64 a, int d, int n); /// \endcode /// /// This intrinsic corresponds to the VPINSRW / PINSRW instruction. /// /// \param a /// A 64-bit vector of [4 x i16]. /// \param d /// An integer. The lower 16-bit value from this operand is written to the /// destination at the offset specified by operand \a n. /// \param n /// An immediate integer operant that determines which the bits to be used /// in the destination. \n /// 0: Bits [15:0] are copied to the destination. \n /// 1: Bits [31:16] are copied to the destination. \n /// 2: Bits [47:32] are copied to the destination. \n /// 3: Bits [63:48] are copied to the destination. \n /// The remaining bits in the destination are copied from the corresponding /// bits in operand \a a. /// \returns A 64-bit integer vector containing the copied packed data from the /// operands. #define _mm_insert_pi16(a, d, n) __extension__ ({ \ (__m64)__builtin_ia32_vec_set_v4hi((__m64)a, (int)d, (int)n); }) /// \brief Compares each of the corresponding packed 16-bit integer values of /// the 64-bit integer vectors, and writes the greater value to the /// corresponding bits in the destination. /// /// \headerfile /// /// This intrinsic corresponds to the PMAXSW instruction. /// /// \param __a /// A 64-bit integer vector containing one of the source operands. /// \param __b /// A 64-bit integer vector containing one of the source operands. /// \returns A 64-bit integer vector containing the comparison results. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_max_pi16(__m64 __a, __m64 __b) { return (__m64)__builtin_ia32_pmaxsw((__v4hi)__a, (__v4hi)__b); } /// \brief Compares each of the corresponding packed 8-bit unsigned integer /// values of the 64-bit integer vectors, and writes the greater value to the /// corresponding bits in the destination. /// /// \headerfile /// /// This intrinsic corresponds to the PMAXUB instruction. /// /// \param __a /// A 64-bit integer vector containing one of the source operands. /// \param __b /// A 64-bit integer vector containing one of the source operands. /// \returns A 64-bit integer vector containing the comparison results. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_max_pu8(__m64 __a, __m64 __b) { return (__m64)__builtin_ia32_pmaxub((__v8qi)__a, (__v8qi)__b); } /// \brief Compares each of the corresponding packed 16-bit integer values of /// the 64-bit integer vectors, and writes the lesser value to the /// corresponding bits in the destination. /// /// \headerfile /// /// This intrinsic corresponds to the PMINSW instruction. /// /// \param __a /// A 64-bit integer vector containing one of the source operands. /// \param __b /// A 64-bit integer vector containing one of the source operands. /// \returns A 64-bit integer vector containing the comparison results. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_min_pi16(__m64 __a, __m64 __b) { return (__m64)__builtin_ia32_pminsw((__v4hi)__a, (__v4hi)__b); } /// \brief Compares each of the corresponding packed 8-bit unsigned integer /// values of the 64-bit integer vectors, and writes the lesser value to the /// corresponding bits in the destination. /// /// \headerfile /// /// This intrinsic corresponds to the PMINUB instruction. /// /// \param __a /// A 64-bit integer vector containing one of the source operands. /// \param __b /// A 64-bit integer vector containing one of the source operands. /// \returns A 64-bit integer vector containing the comparison results. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_min_pu8(__m64 __a, __m64 __b) { return (__m64)__builtin_ia32_pminub((__v8qi)__a, (__v8qi)__b); } /// \brief Takes the most significant bit from each 8-bit element in a 64-bit /// integer vector to create a 16-bit mask value. Zero-extends the value to /// 32-bit integer and writes it to the destination. /// /// \headerfile /// /// This intrinsic corresponds to the PMOVMSKB instruction. /// /// \param __a /// A 64-bit integer vector containing the values with bits to be extracted. /// \returns The most significant bit from each 8-bit element in the operand, /// written to bits [15:0]. static __inline__ int __DEFAULT_FN_ATTRS _mm_movemask_pi8(__m64 __a) { return __builtin_ia32_pmovmskb((__v8qi)__a); } /// \brief Multiplies packed 16-bit unsigned integer values and writes the /// high-order 16 bits of each 32-bit product to the corresponding bits in /// the destination. /// /// \headerfile /// /// This intrinsic corresponds to the PMULHUW instruction. /// /// \param __a /// A 64-bit integer vector containing one of the source operands. /// \param __b /// A 64-bit integer vector containing one of the source operands. /// \returns A 64-bit integer vector containing the products of both operands. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_mulhi_pu16(__m64 __a, __m64 __b) { return (__m64)__builtin_ia32_pmulhuw((__v4hi)__a, (__v4hi)__b); } /// \brief Shuffles the 4 16-bit integers from a 64-bit integer vector to the /// destination, as specified by the immediate value operand. /// /// \headerfile /// /// \code /// __m64 _mm_shuffle_pi16(__m64 a, const int n); /// \endcode /// /// This intrinsic corresponds to the PSHUFW instruction. /// /// \param a /// A 64-bit integer vector containing the values to be shuffled. /// \param n /// An immediate value containing an 8-bit value specifying which elements to /// copy from \a a. The destinations within the 64-bit destination are /// assigned values as follows: \n /// Bits [1:0] are used to assign values to bits [15:0] in the /// destination. \n /// Bits [3:2] are used to assign values to bits [31:16] in the /// destination. \n /// Bits [5:4] are used to assign values to bits [47:32] in the /// destination. \n /// Bits [7:6] are used to assign values to bits [63:48] in the /// destination. \n /// Bit value assignments: \n /// 00: assigned from bits [15:0] of \a a. \n /// 01: assigned from bits [31:16] of \a a. \n /// 10: assigned from bits [47:32] of \a a. \n /// 11: assigned from bits [63:48] of \a a. /// \returns A 64-bit integer vector containing the shuffled values. #define _mm_shuffle_pi16(a, n) __extension__ ({ \ (__m64)__builtin_ia32_pshufw((__v4hi)(__m64)(a), (n)); }) /// \brief Conditionally copies the values from each 8-bit element in the first /// 64-bit integer vector operand to the specified memory location, as /// specified by the most significant bit in the corresponding element in the /// second 64-bit integer vector operand. /// /// To minimize caching, the data is flagged as non-temporal /// (unlikely to be used again soon). /// /// \headerfile /// /// This intrinsic corresponds to the MASKMOVQ instruction. /// /// \param __d /// A 64-bit integer vector containing the values with elements to be copied. /// \param __n /// A 64-bit integer vector operand. The most significant bit from each 8-bit /// element determines whether the corresponding element in operand \a __d /// is copied. If the most significant bit of a given element is 1, the /// corresponding element in operand \a __d is copied. /// \param __p /// A pointer to a 64-bit memory location that will receive the conditionally /// copied integer values. The address of the memory location does not have /// to be aligned. static __inline__ void __DEFAULT_FN_ATTRS _mm_maskmove_si64(__m64 __d, __m64 __n, char *__p) { __builtin_ia32_maskmovq((__v8qi)__d, (__v8qi)__n, __p); } /// \brief Computes the rounded averages of the packed unsigned 8-bit integer /// values and writes the averages to the corresponding bits in the /// destination. /// /// \headerfile /// /// This intrinsic corresponds to the PAVGB instruction. /// /// \param __a /// A 64-bit integer vector containing one of the source operands. /// \param __b /// A 64-bit integer vector containing one of the source operands. /// \returns A 64-bit integer vector containing the averages of both operands. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_avg_pu8(__m64 __a, __m64 __b) { return (__m64)__builtin_ia32_pavgb((__v8qi)__a, (__v8qi)__b); } /// \brief Computes the rounded averages of the packed unsigned 16-bit integer /// values and writes the averages to the corresponding bits in the /// destination. /// /// \headerfile /// /// This intrinsic corresponds to the PAVGW instruction. /// /// \param __a /// A 64-bit integer vector containing one of the source operands. /// \param __b /// A 64-bit integer vector containing one of the source operands. /// \returns A 64-bit integer vector containing the averages of both operands. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_avg_pu16(__m64 __a, __m64 __b) { return (__m64)__builtin_ia32_pavgw((__v4hi)__a, (__v4hi)__b); } /// \brief Subtracts the corresponding 8-bit unsigned integer values of the two /// 64-bit vector operands and computes the absolute value for each of the /// difference. Then sum of the 8 absolute differences is written to the /// bits [15:0] of the destination; the remaining bits [63:16] are cleared. /// /// \headerfile /// /// This intrinsic corresponds to the PSADBW instruction. /// /// \param __a /// A 64-bit integer vector containing one of the source operands. /// \param __b /// A 64-bit integer vector containing one of the source operands. /// \returns A 64-bit integer vector whose lower 16 bits contain the sums of the /// sets of absolute differences between both operands. The upper bits are /// cleared. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_sad_pu8(__m64 __a, __m64 __b) { return (__m64)__builtin_ia32_psadbw((__v8qi)__a, (__v8qi)__b); } #if defined(__cplusplus) extern "C" { #endif # 2426 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xmmintrin.h" 3 /// \brief Returns the contents of the MXCSR register as a 32-bit unsigned /// integer value. /// /// There are several groups of macros associated with this /// intrinsic, including: ///
    ///
  • /// For checking exception states: _MM_EXCEPT_INVALID, _MM_EXCEPT_DIV_ZERO, /// _MM_EXCEPT_DENORM, _MM_EXCEPT_OVERFLOW, _MM_EXCEPT_UNDERFLOW, /// _MM_EXCEPT_INEXACT. There is a convenience wrapper /// _MM_GET_EXCEPTION_STATE(). ///
  • ///
  • /// For checking exception masks: _MM_MASK_UNDERFLOW, _MM_MASK_OVERFLOW, /// _MM_MASK_INVALID, _MM_MASK_DENORM, _MM_MASK_DIV_ZERO, _MM_MASK_INEXACT. /// There is a convenience wrapper _MM_GET_EXCEPTION_MASK(). ///
  • ///
  • /// For checking rounding modes: _MM_ROUND_NEAREST, _MM_ROUND_DOWN, /// _MM_ROUND_UP, _MM_ROUND_TOWARD_ZERO. There is a convenience wrapper /// _MM_GET_ROUNDING_MODE(x) where x is one of these macros. ///
  • ///
  • /// For checking flush-to-zero mode: _MM_FLUSH_ZERO_ON, _MM_FLUSH_ZERO_OFF. /// There is a convenience wrapper _MM_GET_FLUSH_ZERO_MODE(). ///
  • ///
  • /// For checking denormals-are-zero mode: _MM_DENORMALS_ZERO_ON, /// _MM_DENORMALS_ZERO_OFF. There is a convenience wrapper /// _MM_GET_DENORMALS_ZERO_MODE(). ///
  • ///
/// /// For example, the expression below checks if an overflow exception has /// occurred: /// ( _mm_getcsr() & _MM_EXCEPT_OVERFLOW ) /// /// The following example gets the current rounding mode: /// _MM_GET_ROUNDING_MODE() /// /// \headerfile /// /// This intrinsic corresponds to the VSTMXCSR / STMXCSR instruction. /// /// \returns A 32-bit unsigned integer containing the contents of the MXCSR /// register. unsigned int _mm_getcsr(void); /// \brief Sets the MXCSR register with the 32-bit unsigned integer value. /// /// There are several groups of macros associated with this intrinsic, /// including: ///
    ///
  • /// For setting exception states: _MM_EXCEPT_INVALID, _MM_EXCEPT_DIV_ZERO, /// _MM_EXCEPT_DENORM, _MM_EXCEPT_OVERFLOW, _MM_EXCEPT_UNDERFLOW, /// _MM_EXCEPT_INEXACT. There is a convenience wrapper /// _MM_SET_EXCEPTION_STATE(x) where x is one of these macros. ///
  • ///
  • /// For setting exception masks: _MM_MASK_UNDERFLOW, _MM_MASK_OVERFLOW, /// _MM_MASK_INVALID, _MM_MASK_DENORM, _MM_MASK_DIV_ZERO, _MM_MASK_INEXACT. /// There is a convenience wrapper _MM_SET_EXCEPTION_MASK(x) where x is one /// of these macros. ///
  • ///
  • /// For setting rounding modes: _MM_ROUND_NEAREST, _MM_ROUND_DOWN, /// _MM_ROUND_UP, _MM_ROUND_TOWARD_ZERO. There is a convenience wrapper /// _MM_SET_ROUNDING_MODE(x) where x is one of these macros. ///
  • ///
  • /// For setting flush-to-zero mode: _MM_FLUSH_ZERO_ON, _MM_FLUSH_ZERO_OFF. /// There is a convenience wrapper _MM_SET_FLUSH_ZERO_MODE(x) where x is /// one of these macros. ///
  • ///
  • /// For setting denormals-are-zero mode: _MM_DENORMALS_ZERO_ON, /// _MM_DENORMALS_ZERO_OFF. There is a convenience wrapper /// _MM_SET_DENORMALS_ZERO_MODE(x) where x is one of these macros. ///
  • ///
/// /// For example, the following expression causes subsequent floating-point /// operations to round up: /// _mm_setcsr(_mm_getcsr() | _MM_ROUND_UP) /// /// The following example sets the DAZ and FTZ flags: /// void setFlags() { /// _MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON) /// _MM_SET_DENORMALS_ZERO_MODE(_MM_DENORMALS_ZERO_ON) /// } /// /// \headerfile /// /// This intrinsic corresponds to the VLDMXCSR / LDMXCSR instruction. /// /// \param __i /// A 32-bit unsigned integer value to be written to the MXCSR register. void _mm_setcsr(unsigned int __i); #if defined(__cplusplus) } // extern "C" #endif # 2530 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xmmintrin.h" 3 /// \brief Selects 4 float values from the 128-bit operands of [4 x float], as /// specified by the immediate value operand. /// /// \headerfile /// /// \code /// __m128 _mm_shuffle_ps(__m128 a, __m128 b, const int mask); /// \endcode /// /// This intrinsic corresponds to the VSHUFPS / SHUFPS instruction. /// /// \param a /// A 128-bit vector of [4 x float]. /// \param b /// A 128-bit vector of [4 x float]. /// \param mask /// An immediate value containing an 8-bit value specifying which elements to /// copy from \a a and \a b. \n /// Bits [3:0] specify the values copied from operand \a a. \n /// Bits [7:4] specify the values copied from operand \a b. \n /// The destinations within the 128-bit destination are assigned values as /// follows: \n /// Bits [1:0] are used to assign values to bits [31:0] in the /// destination. \n /// Bits [3:2] are used to assign values to bits [63:32] in the /// destination. \n /// Bits [5:4] are used to assign values to bits [95:64] in the /// destination. \n /// Bits [7:6] are used to assign values to bits [127:96] in the /// destination. \n /// Bit value assignments: \n /// 00: Bits [31:0] copied from the specified operand. \n /// 01: Bits [63:32] copied from the specified operand. \n /// 10: Bits [95:64] copied from the specified operand. \n /// 11: Bits [127:96] copied from the specified operand. /// \returns A 128-bit vector of [4 x float] containing the shuffled values. #define _mm_shuffle_ps(a, b, mask) __extension__ ({ \ (__m128)__builtin_shufflevector((__v4sf)(__m128)(a), (__v4sf)(__m128)(b), \ 0 + (((mask) >> 0) & 0x3), \ 0 + (((mask) >> 2) & 0x3), \ 4 + (((mask) >> 4) & 0x3), \ 4 + (((mask) >> 6) & 0x3)); }) /// \brief Unpacks the high-order (index 2,3) values from two 128-bit vectors of /// [4 x float] and interleaves them into a 128-bit vector of [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VUNPCKHPS / UNPCKHPS instruction. /// /// \param __a /// A 128-bit vector of [4 x float]. \n /// Bits [95:64] are written to bits [31:0] of the destination. \n /// Bits [127:96] are written to bits [95:64] of the destination. /// \param __b /// A 128-bit vector of [4 x float]. /// Bits [95:64] are written to bits [63:32] of the destination. \n /// Bits [127:96] are written to bits [127:96] of the destination. /// \returns A 128-bit vector of [4 x float] containing the interleaved values. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_unpackhi_ps(__m128 __a, __m128 __b) { return __builtin_shufflevector((__v4sf)__a, (__v4sf)__b, 2, 6, 3, 7); } /// \brief Unpacks the low-order (index 0,1) values from two 128-bit vectors of /// [4 x float] and interleaves them into a 128-bit vector of [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VUNPCKLPS / UNPCKLPS instruction. /// /// \param __a /// A 128-bit vector of [4 x float]. \n /// Bits [31:0] are written to bits [31:0] of the destination. \n /// Bits [63:32] are written to bits [95:64] of the destination. /// \param __b /// A 128-bit vector of [4 x float]. \n /// Bits [31:0] are written to bits [63:32] of the destination. \n /// Bits [63:32] are written to bits [127:96] of the destination. /// \returns A 128-bit vector of [4 x float] containing the interleaved values. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_unpacklo_ps(__m128 __a, __m128 __b) { return __builtin_shufflevector((__v4sf)__a, (__v4sf)__b, 0, 4, 1, 5); } /// \brief Constructs a 128-bit floating-point vector of [4 x float]. The lower /// 32 bits are set to the lower 32 bits of the second parameter. The upper /// 96 bits are set to the upper 96 bits of the first parameter. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVSS / MOVSS instruction. /// /// \param __a /// A 128-bit floating-point vector of [4 x float]. The upper 96 bits are /// written to the upper 96 bits of the result. /// \param __b /// A 128-bit floating-point vector of [4 x float]. The lower 32 bits are /// written to the lower 32 bits of the result. /// \returns A 128-bit floating-point vector of [4 x float]. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_move_ss(__m128 __a, __m128 __b) { return __builtin_shufflevector((__v4sf)__a, (__v4sf)__b, 4, 1, 2, 3); } /// \brief Constructs a 128-bit floating-point vector of [4 x float]. The lower /// 64 bits are set to the upper 64 bits of the second parameter. The upper /// 64 bits are set to the upper 64 bits of the first parameter. /// /// \headerfile /// /// This intrinsic corresponds to the VUNPCKHPD / UNPCKHPD instruction. /// /// \param __a /// A 128-bit floating-point vector of [4 x float]. The upper 64 bits are /// written to the upper 64 bits of the result. /// \param __b /// A 128-bit floating-point vector of [4 x float]. The upper 64 bits are /// written to the lower 64 bits of the result. /// \returns A 128-bit floating-point vector of [4 x float]. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_movehl_ps(__m128 __a, __m128 __b) { return __builtin_shufflevector((__v4sf)__a, (__v4sf)__b, 6, 7, 2, 3); } /// \brief Constructs a 128-bit floating-point vector of [4 x float]. The lower /// 64 bits are set to the lower 64 bits of the first parameter. The upper /// 64 bits are set to the lower 64 bits of the second parameter. /// /// \headerfile /// /// This intrinsic corresponds to the VUNPCKLPD / UNPCKLPD instruction. /// /// \param __a /// A 128-bit floating-point vector of [4 x float]. The lower 64 bits are /// written to the lower 64 bits of the result. /// \param __b /// A 128-bit floating-point vector of [4 x float]. The lower 64 bits are /// written to the upper 64 bits of the result. /// \returns A 128-bit floating-point vector of [4 x float]. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_movelh_ps(__m128 __a, __m128 __b) { return __builtin_shufflevector((__v4sf)__a, (__v4sf)__b, 0, 1, 4, 5); } /// \brief Converts a 64-bit vector of [4 x i16] into a 128-bit vector of [4 x /// float]. /// /// \headerfile /// /// This intrinsic corresponds to the CVTPI2PS + COMPOSITE instruction. /// /// \param __a /// A 64-bit vector of [4 x i16]. The elements of the destination are copied /// from the corresponding elements in this operand. /// \returns A 128-bit vector of [4 x float] containing the copied and converted /// values from the operand. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cvtpi16_ps(__m64 __a) { __m64 __b, __c; __m128 __r; __b = _mm_setzero_si64(); __b = _mm_cmpgt_pi16(__b, __a); __c = _mm_unpackhi_pi16(__a, __b); __r = _mm_setzero_ps(); __r = _mm_cvtpi32_ps(__r, __c); __r = _mm_movelh_ps(__r, __r); __c = _mm_unpacklo_pi16(__a, __b); __r = _mm_cvtpi32_ps(__r, __c); return __r; } /// \brief Converts a 64-bit vector of 16-bit unsigned integer values into a /// 128-bit vector of [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the CVTPI2PS + COMPOSITE instruction. /// /// \param __a /// A 64-bit vector of 16-bit unsigned integer values. The elements of the /// destination are copied from the corresponding elements in this operand. /// \returns A 128-bit vector of [4 x float] containing the copied and converted /// values from the operand. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cvtpu16_ps(__m64 __a) { __m64 __b, __c; __m128 __r; __b = _mm_setzero_si64(); __c = _mm_unpackhi_pi16(__a, __b); __r = _mm_setzero_ps(); __r = _mm_cvtpi32_ps(__r, __c); __r = _mm_movelh_ps(__r, __r); __c = _mm_unpacklo_pi16(__a, __b); __r = _mm_cvtpi32_ps(__r, __c); return __r; } /// \brief Converts the lower four 8-bit values from a 64-bit vector of [8 x i8] /// into a 128-bit vector of [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the CVTPI2PS + COMPOSITE instruction. /// /// \param __a /// A 64-bit vector of [8 x i8]. The elements of the destination are copied /// from the corresponding lower 4 elements in this operand. /// \returns A 128-bit vector of [4 x float] containing the copied and converted /// values from the operand. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cvtpi8_ps(__m64 __a) { __m64 __b; __b = _mm_setzero_si64(); __b = _mm_cmpgt_pi8(__b, __a); __b = _mm_unpacklo_pi8(__a, __b); return _mm_cvtpi16_ps(__b); } /// \brief Converts the lower four unsigned 8-bit integer values from a 64-bit /// vector of [8 x u8] into a 128-bit vector of [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the CVTPI2PS + COMPOSITE instruction. /// /// \param __a /// A 64-bit vector of unsigned 8-bit integer values. The elements of the /// destination are copied from the corresponding lower 4 elements in this /// operand. /// \returns A 128-bit vector of [4 x float] containing the copied and converted /// values from the source operand. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cvtpu8_ps(__m64 __a) { __m64 __b; __b = _mm_setzero_si64(); __b = _mm_unpacklo_pi8(__a, __b); return _mm_cvtpi16_ps(__b); } /// \brief Converts the two 32-bit signed integer values from each 64-bit vector /// operand of [2 x i32] into a 128-bit vector of [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the CVTPI2PS + COMPOSITE instruction. /// /// \param __a /// A 64-bit vector of [2 x i32]. The lower elements of the destination are /// copied from the elements in this operand. /// \param __b /// A 64-bit vector of [2 x i32]. The upper elements of the destination are /// copied from the elements in this operand. /// \returns A 128-bit vector of [4 x float] whose lower 64 bits contain the /// copied and converted values from the first operand. The upper 64 bits /// contain the copied and converted values from the second operand. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cvtpi32x2_ps(__m64 __a, __m64 __b) { __m128 __c; __c = _mm_setzero_ps(); __c = _mm_cvtpi32_ps(__c, __b); __c = _mm_movelh_ps(__c, __c); return _mm_cvtpi32_ps(__c, __a); } /// \brief Converts each single-precision floating-point element of a 128-bit /// floating-point vector of [4 x float] into a 16-bit signed integer, and /// packs the results into a 64-bit integer vector of [4 x i16]. /// /// If the floating-point element is NaN or infinity, or if the /// floating-point element is greater than 0x7FFFFFFF or less than -0x8000, /// it is converted to 0x8000. Otherwise if the floating-point element is /// greater than 0x7FFF, it is converted to 0x7FFF. /// /// \headerfile /// /// This intrinsic corresponds to the CVTPS2PI + COMPOSITE instruction. /// /// \param __a /// A 128-bit floating-point vector of [4 x float]. /// \returns A 64-bit integer vector of [4 x i16] containing the converted /// values. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_cvtps_pi16(__m128 __a) { __m64 __b, __c; __b = _mm_cvtps_pi32(__a); __a = _mm_movehl_ps(__a, __a); __c = _mm_cvtps_pi32(__a); return _mm_packs_pi32(__b, __c); } /// \brief Converts each single-precision floating-point element of a 128-bit /// floating-point vector of [4 x float] into an 8-bit signed integer, and /// packs the results into the lower 32 bits of a 64-bit integer vector of /// [8 x i8]. The upper 32 bits of the vector are set to 0. /// /// If the floating-point element is NaN or infinity, or if the /// floating-point element is greater than 0x7FFFFFFF or less than -0x80, it /// is converted to 0x80. Otherwise if the floating-point element is greater /// than 0x7F, it is converted to 0x7F. /// /// \headerfile /// /// This intrinsic corresponds to the CVTPS2PI + COMPOSITE instruction. /// /// \param __a /// 128-bit floating-point vector of [4 x float]. /// \returns A 64-bit integer vector of [8 x i8]. The lower 32 bits contain the /// converted values and the uppper 32 bits are set to zero. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_cvtps_pi8(__m128 __a) { __m64 __b, __c; __b = _mm_cvtps_pi16(__a); __c = _mm_setzero_si64(); return _mm_packs_pi16(__b, __c); } /// \brief Extracts the sign bits from each single-precision floating-point /// element of a 128-bit floating-point vector of [4 x float] and returns the /// sign bits in bits [0:3] of the result. Bits [31:4] of the result are set /// to zero. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVMSKPS / MOVMSKPS instruction. /// /// \param __a /// A 128-bit floating-point vector of [4 x float]. /// \returns A 32-bit integer value. Bits [3:0] contain the sign bits from each /// single-precision floating-point element of the parameter. Bits [31:4] are /// set to zero. static __inline__ int __DEFAULT_FN_ATTRS _mm_movemask_ps(__m128 __a) { return __builtin_ia32_movmskps((__v4sf)__a); } #define _MM_ALIGN16 __attribute__((aligned(16))) #define _MM_SHUFFLE(z, y, x, w) (((z) << 6) | ((y) << 4) | ((x) << 2) | (w)) #define _MM_EXCEPT_INVALID (0x0001) #define _MM_EXCEPT_DENORM (0x0002) #define _MM_EXCEPT_DIV_ZERO (0x0004) #define _MM_EXCEPT_OVERFLOW (0x0008) #define _MM_EXCEPT_UNDERFLOW (0x0010) #define _MM_EXCEPT_INEXACT (0x0020) #define _MM_EXCEPT_MASK (0x003f) #define _MM_MASK_INVALID (0x0080) #define _MM_MASK_DENORM (0x0100) #define _MM_MASK_DIV_ZERO (0x0200) #define _MM_MASK_OVERFLOW (0x0400) #define _MM_MASK_UNDERFLOW (0x0800) #define _MM_MASK_INEXACT (0x1000) #define _MM_MASK_MASK (0x1f80) #define _MM_ROUND_NEAREST (0x0000) #define _MM_ROUND_DOWN (0x2000) #define _MM_ROUND_UP (0x4000) #define _MM_ROUND_TOWARD_ZERO (0x6000) #define _MM_ROUND_MASK (0x6000) #define _MM_FLUSH_ZERO_MASK (0x8000) #define _MM_FLUSH_ZERO_ON (0x8000) #define _MM_FLUSH_ZERO_OFF (0x0000) #define _MM_GET_EXCEPTION_MASK() (_mm_getcsr() & _MM_MASK_MASK) #define _MM_GET_EXCEPTION_STATE() (_mm_getcsr() & _MM_EXCEPT_MASK) #define _MM_GET_FLUSH_ZERO_MODE() (_mm_getcsr() & _MM_FLUSH_ZERO_MASK) #define _MM_GET_ROUNDING_MODE() (_mm_getcsr() & _MM_ROUND_MASK) #define _MM_SET_EXCEPTION_MASK(x) (_mm_setcsr((_mm_getcsr() & ~_MM_MASK_MASK) | (x))) #define _MM_SET_EXCEPTION_STATE(x) (_mm_setcsr((_mm_getcsr() & ~_MM_EXCEPT_MASK) | (x))) #define _MM_SET_FLUSH_ZERO_MODE(x) (_mm_setcsr((_mm_getcsr() & ~_MM_FLUSH_ZERO_MASK) | (x))) #define _MM_SET_ROUNDING_MODE(x) (_mm_setcsr((_mm_getcsr() & ~_MM_ROUND_MASK) | (x))) #define _MM_TRANSPOSE4_PS(row0, row1, row2, row3) \ do { \ __m128 tmp3, tmp2, tmp1, tmp0; \ tmp0 = _mm_unpacklo_ps((row0), (row1)); \ tmp2 = _mm_unpacklo_ps((row2), (row3)); \ tmp1 = _mm_unpackhi_ps((row0), (row1)); \ tmp3 = _mm_unpackhi_ps((row2), (row3)); \ (row0) = _mm_movelh_ps(tmp0, tmp2); \ (row1) = _mm_movehl_ps(tmp2, tmp0); \ (row2) = _mm_movelh_ps(tmp1, tmp3); \ (row3) = _mm_movehl_ps(tmp3, tmp1); \ } while (0) /* Aliases for compatibility. */ #define _m_pextrw _mm_extract_pi16 #define _m_pinsrw _mm_insert_pi16 #define _m_pmaxsw _mm_max_pi16 #define _m_pmaxub _mm_max_pu8 #define _m_pminsw _mm_min_pi16 #define _m_pminub _mm_min_pu8 #define _m_pmovmskb _mm_movemask_pi8 #define _m_pmulhuw _mm_mulhi_pu16 #define _m_pshufw _mm_shuffle_pi16 #define _m_maskmovq _mm_maskmove_si64 #define _m_pavgb _mm_avg_pu8 #define _m_pavgw _mm_avg_pu16 #define _m_psadbw _mm_sad_pu8 #define _m_ _mm_ #define _m_ _mm_ #undef __DEFAULT_FN_ATTRS /* Ugly hack for backwards-compatibility (compatible with gcc) */ #if defined(__SSE2__) && !__building_module(_Builtin_intrinsics) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 2969 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xmmintrin.h" 3 # 2970 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xmmintrin.h" 3 #endif # 2971 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xmmintrin.h" 3 #endif /* __XMMINTRIN_H */ # 2973 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xmmintrin.h" 3 # 28 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/emmintrin.h" 2 3 typedef double __m128d __attribute__((__vector_size__(16))); typedef long long __m128i __attribute__((__vector_size__(16))); /* Type defines. */ typedef double __v2df __attribute__ ((__vector_size__ (16))); typedef long long __v2di __attribute__ ((__vector_size__ (16))); typedef short __v8hi __attribute__((__vector_size__(16))); typedef char __v16qi __attribute__((__vector_size__(16))); /* Unsigned types */ typedef unsigned long long __v2du __attribute__ ((__vector_size__ (16))); typedef unsigned short __v8hu __attribute__((__vector_size__(16))); typedef unsigned char __v16qu __attribute__((__vector_size__(16))); /* We need an explicitly signed variant for char. Note that this shouldn't * appear in the interface though. */ typedef signed char __v16qs __attribute__((__vector_size__(16))); #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 47 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/emmintrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/f16cintrin.h" 1 3 /*===---- f16cintrin.h - F16C intrinsics -----------------------------------=== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #if !defined __X86INTRIN_H && !defined __EMMINTRIN_H && !defined __IMMINTRIN_H #error "Never use directly; include instead." #endif # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/f16cintrin.h" 3 #ifndef __F16CINTRIN_H #define __F16CINTRIN_H /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS \ __attribute__((__always_inline__, __nodebug__, __target__("f16c"))) /// \brief Converts a 16-bit half-precision float value into a 32-bit float /// value. /// /// \headerfile /// /// This intrinsic corresponds to the VCVTPH2PS instruction. /// /// \param __a /// A 16-bit half-precision float value. /// \returns The converted 32-bit float value. static __inline float __DEFAULT_FN_ATTRS _cvtsh_ss(unsigned short __a) { __v8hi v = {(short)__a, 0, 0, 0, 0, 0, 0, 0}; __v4sf r = __builtin_ia32_vcvtph2ps(v); return r[0]; } /// \brief Converts a 32-bit single-precision float value to a 16-bit /// half-precision float value. /// /// \headerfile /// /// \code /// unsigned short _cvtss_sh(float a, const int imm); /// \endcode /// /// This intrinsic corresponds to the VCVTPS2PH instruction. /// /// \param a /// A 32-bit single-precision float value to be converted to a 16-bit /// half-precision float value. /// \param imm /// An immediate value controlling rounding using bits [2:0]: \n /// 000: Nearest \n /// 001: Down \n /// 010: Up \n /// 011: Truncate \n /// 1XX: Use MXCSR.RC for rounding /// \returns The converted 16-bit half-precision float value. #define _cvtss_sh(a, imm) __extension__ ({ \ (unsigned short)(((__v8hi)__builtin_ia32_vcvtps2ph((__v4sf){a, 0, 0, 0}, \ (imm)))[0]); }) /// \brief Converts a 128-bit vector containing 32-bit float values into a /// 128-bit vector containing 16-bit half-precision float values. /// /// \headerfile /// /// \code /// __m128i _mm_cvtps_ph(__m128 a, const int imm); /// \endcode /// /// This intrinsic corresponds to the VCVTPS2PH instruction. /// /// \param a /// A 128-bit vector containing 32-bit float values. /// \param imm /// An immediate value controlling rounding using bits [2:0]: \n /// 000: Nearest \n /// 001: Down \n /// 010: Up \n /// 011: Truncate \n /// 1XX: Use MXCSR.RC for rounding /// \returns A 128-bit vector containing converted 16-bit half-precision float /// values. The lower 64 bits are used to store the converted 16-bit /// half-precision floating-point values. #define _mm_cvtps_ph(a, imm) __extension__ ({ \ (__m128i)__builtin_ia32_vcvtps2ph((__v4sf)(__m128)(a), (imm)); }) /// \brief Converts a 128-bit vector containing 16-bit half-precision float /// values into a 128-bit vector containing 32-bit float values. /// /// \headerfile /// /// This intrinsic corresponds to the VCVTPH2PS instruction. /// /// \param __a /// A 128-bit vector containing 16-bit half-precision float values. The lower /// 64 bits are used in the conversion. /// \returns A 128-bit vector of [4 x float] containing converted float values. static __inline __m128 __DEFAULT_FN_ATTRS _mm_cvtph_ps(__m128i __a) { return (__m128)__builtin_ia32_vcvtph2ps((__v8hi)__a); } #undef __DEFAULT_FN_ATTRS #endif /* __F16CINTRIN_H */ # 125 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/f16cintrin.h" 3 # 48 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/emmintrin.h" 2 3 /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("sse2"))) /// \brief Adds lower double-precision values in both operands and returns the /// sum in the lower 64 bits of the result. The upper 64 bits of the result /// are copied from the upper double-precision value of the first operand. /// /// \headerfile /// /// This intrinsic corresponds to the VADDSD / ADDSD instruction. /// /// \param __a /// A 128-bit vector of [2 x double] containing one of the source operands. /// \param __b /// A 128-bit vector of [2 x double] containing one of the source operands. /// \returns A 128-bit vector of [2 x double] whose lower 64 bits contain the /// sum of the lower 64 bits of both operands. The upper 64 bits are copied /// from the upper 64 bits of the first source operand. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_add_sd(__m128d __a, __m128d __b) { __a[0] += __b[0]; return __a; } /// \brief Adds two 128-bit vectors of [2 x double]. /// /// \headerfile /// /// This intrinsic corresponds to the VADDPD / ADDPD instruction. /// /// \param __a /// A 128-bit vector of [2 x double] containing one of the source operands. /// \param __b /// A 128-bit vector of [2 x double] containing one of the source operands. /// \returns A 128-bit vector of [2 x double] containing the sums of both /// operands. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_add_pd(__m128d __a, __m128d __b) { return (__m128d)((__v2df)__a + (__v2df)__b); } /// \brief Subtracts the lower double-precision value of the second operand /// from the lower double-precision value of the first operand and returns /// the difference in the lower 64 bits of the result. The upper 64 bits of /// the result are copied from the upper double-precision value of the first /// operand. /// /// \headerfile /// /// This intrinsic corresponds to the VSUBSD / SUBSD instruction. /// /// \param __a /// A 128-bit vector of [2 x double] containing the minuend. /// \param __b /// A 128-bit vector of [2 x double] containing the subtrahend. /// \returns A 128-bit vector of [2 x double] whose lower 64 bits contain the /// difference of the lower 64 bits of both operands. The upper 64 bits are /// copied from the upper 64 bits of the first source operand. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_sub_sd(__m128d __a, __m128d __b) { __a[0] -= __b[0]; return __a; } /// \brief Subtracts two 128-bit vectors of [2 x double]. /// /// \headerfile /// /// This intrinsic corresponds to the VSUBPD / SUBPD instruction. /// /// \param __a /// A 128-bit vector of [2 x double] containing the minuend. /// \param __b /// A 128-bit vector of [2 x double] containing the subtrahend. /// \returns A 128-bit vector of [2 x double] containing the differences between /// both operands. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_sub_pd(__m128d __a, __m128d __b) { return (__m128d)((__v2df)__a - (__v2df)__b); } /// \brief Multiplies lower double-precision values in both operands and returns /// the product in the lower 64 bits of the result. The upper 64 bits of the /// result are copied from the upper double-precision value of the first /// operand. /// /// \headerfile /// /// This intrinsic corresponds to the VMULSD / MULSD instruction. /// /// \param __a /// A 128-bit vector of [2 x double] containing one of the source operands. /// \param __b /// A 128-bit vector of [2 x double] containing one of the source operands. /// \returns A 128-bit vector of [2 x double] whose lower 64 bits contain the /// product of the lower 64 bits of both operands. The upper 64 bits are /// copied from the upper 64 bits of the first source operand. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mul_sd(__m128d __a, __m128d __b) { __a[0] *= __b[0]; return __a; } /// \brief Multiplies two 128-bit vectors of [2 x double]. /// /// \headerfile /// /// This intrinsic corresponds to the VMULPD / MULPD instruction. /// /// \param __a /// A 128-bit vector of [2 x double] containing one of the operands. /// \param __b /// A 128-bit vector of [2 x double] containing one of the operands. /// \returns A 128-bit vector of [2 x double] containing the products of both /// operands. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mul_pd(__m128d __a, __m128d __b) { return (__m128d)((__v2df)__a * (__v2df)__b); } /// \brief Divides the lower double-precision value of the first operand by the /// lower double-precision value of the second operand and returns the /// quotient in the lower 64 bits of the result. The upper 64 bits of the /// result are copied from the upper double-precision value of the first /// operand. /// /// \headerfile /// /// This intrinsic corresponds to the VDIVSD / DIVSD instruction. /// /// \param __a /// A 128-bit vector of [2 x double] containing the dividend. /// \param __b /// A 128-bit vector of [2 x double] containing divisor. /// \returns A 128-bit vector of [2 x double] whose lower 64 bits contain the /// quotient of the lower 64 bits of both operands. The upper 64 bits are /// copied from the upper 64 bits of the first source operand. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_div_sd(__m128d __a, __m128d __b) { __a[0] /= __b[0]; return __a; } /// \brief Performs an element-by-element division of two 128-bit vectors of /// [2 x double]. /// /// \headerfile /// /// This intrinsic corresponds to the VDIVPD / DIVPD instruction. /// /// \param __a /// A 128-bit vector of [2 x double] containing the dividend. /// \param __b /// A 128-bit vector of [2 x double] containing the divisor. /// \returns A 128-bit vector of [2 x double] containing the quotients of both /// operands. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_div_pd(__m128d __a, __m128d __b) { return (__m128d)((__v2df)__a / (__v2df)__b); } /// \brief Calculates the square root of the lower double-precision value of /// the second operand and returns it in the lower 64 bits of the result. /// The upper 64 bits of the result are copied from the upper /// double-precision value of the first operand. /// /// \headerfile /// /// This intrinsic corresponds to the VSQRTSD / SQRTSD instruction. /// /// \param __a /// A 128-bit vector of [2 x double] containing one of the operands. The /// upper 64 bits of this operand are copied to the upper 64 bits of the /// result. /// \param __b /// A 128-bit vector of [2 x double] containing one of the operands. The /// square root is calculated using the lower 64 bits of this operand. /// \returns A 128-bit vector of [2 x double] whose lower 64 bits contain the /// square root of the lower 64 bits of operand \a __b, and whose upper 64 /// bits are copied from the upper 64 bits of operand \a __a. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_sqrt_sd(__m128d __a, __m128d __b) { __m128d __c = __builtin_ia32_sqrtsd((__v2df)__b); return (__m128d) { __c[0], __a[1] }; } /// \brief Calculates the square root of the each of two values stored in a /// 128-bit vector of [2 x double]. /// /// \headerfile /// /// This intrinsic corresponds to the VSQRTPD / SQRTPD instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. /// \returns A 128-bit vector of [2 x double] containing the square roots of the /// values in the operand. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_sqrt_pd(__m128d __a) { return __builtin_ia32_sqrtpd((__v2df)__a); } /// \brief Compares lower 64-bit double-precision values of both operands, and /// returns the lesser of the pair of values in the lower 64-bits of the /// result. The upper 64 bits of the result are copied from the upper /// double-precision value of the first operand. /// /// \headerfile /// /// This intrinsic corresponds to the VMINSD / MINSD instruction. /// /// \param __a /// A 128-bit vector of [2 x double] containing one of the operands. The /// lower 64 bits of this operand are used in the comparison. /// \param __b /// A 128-bit vector of [2 x double] containing one of the operands. The /// lower 64 bits of this operand are used in the comparison. /// \returns A 128-bit vector of [2 x double] whose lower 64 bits contain the /// minimum value between both operands. The upper 64 bits are copied from /// the upper 64 bits of the first source operand. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_min_sd(__m128d __a, __m128d __b) { return __builtin_ia32_minsd((__v2df)__a, (__v2df)__b); } /// \brief Performs element-by-element comparison of the two 128-bit vectors of /// [2 x double] and returns the vector containing the lesser of each pair of /// values. /// /// \headerfile /// /// This intrinsic corresponds to the VMINPD / MINPD instruction. /// /// \param __a /// A 128-bit vector of [2 x double] containing one of the operands. /// \param __b /// A 128-bit vector of [2 x double] containing one of the operands. /// \returns A 128-bit vector of [2 x double] containing the minimum values /// between both operands. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_min_pd(__m128d __a, __m128d __b) { return __builtin_ia32_minpd((__v2df)__a, (__v2df)__b); } /// \brief Compares lower 64-bit double-precision values of both operands, and /// returns the greater of the pair of values in the lower 64-bits of the /// result. The upper 64 bits of the result are copied from the upper /// double-precision value of the first operand. /// /// \headerfile /// /// This intrinsic corresponds to the VMAXSD / MAXSD instruction. /// /// \param __a /// A 128-bit vector of [2 x double] containing one of the operands. The /// lower 64 bits of this operand are used in the comparison. /// \param __b /// A 128-bit vector of [2 x double] containing one of the operands. The /// lower 64 bits of this operand are used in the comparison. /// \returns A 128-bit vector of [2 x double] whose lower 64 bits contain the /// maximum value between both operands. The upper 64 bits are copied from /// the upper 64 bits of the first source operand. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_max_sd(__m128d __a, __m128d __b) { return __builtin_ia32_maxsd((__v2df)__a, (__v2df)__b); } /// \brief Performs element-by-element comparison of the two 128-bit vectors of /// [2 x double] and returns the vector containing the greater of each pair /// of values. /// /// \headerfile /// /// This intrinsic corresponds to the VMAXPD / MAXPD instruction. /// /// \param __a /// A 128-bit vector of [2 x double] containing one of the operands. /// \param __b /// A 128-bit vector of [2 x double] containing one of the operands. /// \returns A 128-bit vector of [2 x double] containing the maximum values /// between both operands. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_max_pd(__m128d __a, __m128d __b) { return __builtin_ia32_maxpd((__v2df)__a, (__v2df)__b); } /// \brief Performs a bitwise AND of two 128-bit vectors of [2 x double]. /// /// \headerfile /// /// This intrinsic corresponds to the VPAND / PAND instruction. /// /// \param __a /// A 128-bit vector of [2 x double] containing one of the source operands. /// \param __b /// A 128-bit vector of [2 x double] containing one of the source operands. /// \returns A 128-bit vector of [2 x double] containing the bitwise AND of the /// values between both operands. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_and_pd(__m128d __a, __m128d __b) { return (__m128d)((__v2du)__a & (__v2du)__b); } /// \brief Performs a bitwise AND of two 128-bit vectors of [2 x double], using /// the one's complement of the values contained in the first source operand. /// /// \headerfile /// /// This intrinsic corresponds to the VPANDN / PANDN instruction. /// /// \param __a /// A 128-bit vector of [2 x double] containing the left source operand. The /// one's complement of this value is used in the bitwise AND. /// \param __b /// A 128-bit vector of [2 x double] containing the right source operand. /// \returns A 128-bit vector of [2 x double] containing the bitwise AND of the /// values in the second operand and the one's complement of the first /// operand. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_andnot_pd(__m128d __a, __m128d __b) { return (__m128d)(~(__v2du)__a & (__v2du)__b); } /// \brief Performs a bitwise OR of two 128-bit vectors of [2 x double]. /// /// \headerfile /// /// This intrinsic corresponds to the VPOR / POR instruction. /// /// \param __a /// A 128-bit vector of [2 x double] containing one of the source operands. /// \param __b /// A 128-bit vector of [2 x double] containing one of the source operands. /// \returns A 128-bit vector of [2 x double] containing the bitwise OR of the /// values between both operands. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_or_pd(__m128d __a, __m128d __b) { return (__m128d)((__v2du)__a | (__v2du)__b); } /// \brief Performs a bitwise XOR of two 128-bit vectors of [2 x double]. /// /// \headerfile /// /// This intrinsic corresponds to the VPXOR / PXOR instruction. /// /// \param __a /// A 128-bit vector of [2 x double] containing one of the source operands. /// \param __b /// A 128-bit vector of [2 x double] containing one of the source operands. /// \returns A 128-bit vector of [2 x double] containing the bitwise XOR of the /// values between both operands. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_xor_pd(__m128d __a, __m128d __b) { return (__m128d)((__v2du)__a ^ (__v2du)__b); } /// \brief Compares each of the corresponding double-precision values of the /// 128-bit vectors of [2 x double] for equality. Each comparison yields 0h /// for false, FFFFFFFFFFFFFFFFh for true. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPEQPD / CMPEQPD instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. /// \param __b /// A 128-bit vector of [2 x double]. /// \returns A 128-bit vector containing the comparison results. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpeq_pd(__m128d __a, __m128d __b) { return (__m128d)__builtin_ia32_cmpeqpd((__v2df)__a, (__v2df)__b); } /// \brief Compares each of the corresponding double-precision values of the /// 128-bit vectors of [2 x double] to determine if the values in the first /// operand are less than those in the second operand. Each comparison /// yields 0h for false, FFFFFFFFFFFFFFFFh for true. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPLTPD / CMPLTPD instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. /// \param __b /// A 128-bit vector of [2 x double]. /// \returns A 128-bit vector containing the comparison results. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmplt_pd(__m128d __a, __m128d __b) { return (__m128d)__builtin_ia32_cmpltpd((__v2df)__a, (__v2df)__b); } /// \brief Compares each of the corresponding double-precision values of the /// 128-bit vectors of [2 x double] to determine if the values in the first /// operand are less than or equal to those in the second operand. /// /// Each comparison yields 0h for false, FFFFFFFFFFFFFFFFh for true. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPLEPD / CMPLEPD instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. /// \param __b /// A 128-bit vector of [2 x double]. /// \returns A 128-bit vector containing the comparison results. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmple_pd(__m128d __a, __m128d __b) { return (__m128d)__builtin_ia32_cmplepd((__v2df)__a, (__v2df)__b); } /// \brief Compares each of the corresponding double-precision values of the /// 128-bit vectors of [2 x double] to determine if the values in the first /// operand are greater than those in the second operand. /// /// Each comparison yields 0h for false, FFFFFFFFFFFFFFFFh for true. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPLTPD / CMPLTPD instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. /// \param __b /// A 128-bit vector of [2 x double]. /// \returns A 128-bit vector containing the comparison results. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpgt_pd(__m128d __a, __m128d __b) { return (__m128d)__builtin_ia32_cmpltpd((__v2df)__b, (__v2df)__a); } /// \brief Compares each of the corresponding double-precision values of the /// 128-bit vectors of [2 x double] to determine if the values in the first /// operand are greater than or equal to those in the second operand. /// /// Each comparison yields 0h for false, FFFFFFFFFFFFFFFFh for true. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPLEPD / CMPLEPD instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. /// \param __b /// A 128-bit vector of [2 x double]. /// \returns A 128-bit vector containing the comparison results. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpge_pd(__m128d __a, __m128d __b) { return (__m128d)__builtin_ia32_cmplepd((__v2df)__b, (__v2df)__a); } /// \brief Compares each of the corresponding double-precision values of the /// 128-bit vectors of [2 x double] to determine if the values in the first /// operand are ordered with respect to those in the second operand. /// /// A pair of double-precision values are "ordered" with respect to each /// other if neither value is a NaN. Each comparison yields 0h for false, /// FFFFFFFFFFFFFFFFh for true. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPORDPD / CMPORDPD instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. /// \param __b /// A 128-bit vector of [2 x double]. /// \returns A 128-bit vector containing the comparison results. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpord_pd(__m128d __a, __m128d __b) { return (__m128d)__builtin_ia32_cmpordpd((__v2df)__a, (__v2df)__b); } /// \brief Compares each of the corresponding double-precision values of the /// 128-bit vectors of [2 x double] to determine if the values in the first /// operand are unordered with respect to those in the second operand. /// /// A pair of double-precision values are "unordered" with respect to each /// other if one or both values are NaN. Each comparison yields 0h for false, /// FFFFFFFFFFFFFFFFh for true. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPUNORDPD / CMPUNORDPD /// instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. /// \param __b /// A 128-bit vector of [2 x double]. /// \returns A 128-bit vector containing the comparison results. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpunord_pd(__m128d __a, __m128d __b) { return (__m128d)__builtin_ia32_cmpunordpd((__v2df)__a, (__v2df)__b); } /// \brief Compares each of the corresponding double-precision values of the /// 128-bit vectors of [2 x double] to determine if the values in the first /// operand are unequal to those in the second operand. /// /// Each comparison yields 0h for false, FFFFFFFFFFFFFFFFh for true. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPNEQPD / CMPNEQPD instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. /// \param __b /// A 128-bit vector of [2 x double]. /// \returns A 128-bit vector containing the comparison results. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpneq_pd(__m128d __a, __m128d __b) { return (__m128d)__builtin_ia32_cmpneqpd((__v2df)__a, (__v2df)__b); } /// \brief Compares each of the corresponding double-precision values of the /// 128-bit vectors of [2 x double] to determine if the values in the first /// operand are not less than those in the second operand. /// /// Each comparison yields 0h for false, FFFFFFFFFFFFFFFFh for true. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPNLTPD / CMPNLTPD instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. /// \param __b /// A 128-bit vector of [2 x double]. /// \returns A 128-bit vector containing the comparison results. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpnlt_pd(__m128d __a, __m128d __b) { return (__m128d)__builtin_ia32_cmpnltpd((__v2df)__a, (__v2df)__b); } /// \brief Compares each of the corresponding double-precision values of the /// 128-bit vectors of [2 x double] to determine if the values in the first /// operand are not less than or equal to those in the second operand. /// /// Each comparison yields 0h for false, FFFFFFFFFFFFFFFFh for true. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPNLEPD / CMPNLEPD instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. /// \param __b /// A 128-bit vector of [2 x double]. /// \returns A 128-bit vector containing the comparison results. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpnle_pd(__m128d __a, __m128d __b) { return (__m128d)__builtin_ia32_cmpnlepd((__v2df)__a, (__v2df)__b); } /// \brief Compares each of the corresponding double-precision values of the /// 128-bit vectors of [2 x double] to determine if the values in the first /// operand are not greater than those in the second operand. /// /// Each comparison yields 0h for false, FFFFFFFFFFFFFFFFh for true. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPNLTPD / CMPNLTPD instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. /// \param __b /// A 128-bit vector of [2 x double]. /// \returns A 128-bit vector containing the comparison results. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpngt_pd(__m128d __a, __m128d __b) { return (__m128d)__builtin_ia32_cmpnltpd((__v2df)__b, (__v2df)__a); } /// \brief Compares each of the corresponding double-precision values of the /// 128-bit vectors of [2 x double] to determine if the values in the first /// operand are not greater than or equal to those in the second operand. /// /// Each comparison yields 0h for false, FFFFFFFFFFFFFFFFh for true. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPNLEPD / CMPNLEPD instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. /// \param __b /// A 128-bit vector of [2 x double]. /// \returns A 128-bit vector containing the comparison results. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpnge_pd(__m128d __a, __m128d __b) { return (__m128d)__builtin_ia32_cmpnlepd((__v2df)__b, (__v2df)__a); } /// \brief Compares the lower double-precision floating-point values in each of /// the two 128-bit floating-point vectors of [2 x double] for equality. /// /// The comparison yields 0h for false, FFFFFFFFFFFFFFFFh for true. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPEQSD / CMPEQSD instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. The lower double-precision value is /// compared to the lower double-precision value of \a __b. /// \param __b /// A 128-bit vector of [2 x double]. The lower double-precision value is /// compared to the lower double-precision value of \a __a. /// \returns A 128-bit vector. The lower 64 bits contains the comparison /// results. The upper 64 bits are copied from the upper 64 bits of \a __a. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpeq_sd(__m128d __a, __m128d __b) { return (__m128d)__builtin_ia32_cmpeqsd((__v2df)__a, (__v2df)__b); } /// \brief Compares the lower double-precision floating-point values in each of /// the two 128-bit floating-point vectors of [2 x double] to determine if /// the value in the first parameter is less than the corresponding value in /// the second parameter. /// /// The comparison yields 0h for false, FFFFFFFFFFFFFFFFh for true. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPLTSD / CMPLTSD instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. The lower double-precision value is /// compared to the lower double-precision value of \a __b. /// \param __b /// A 128-bit vector of [2 x double]. The lower double-precision value is /// compared to the lower double-precision value of \a __a. /// \returns A 128-bit vector. The lower 64 bits contains the comparison /// results. The upper 64 bits are copied from the upper 64 bits of \a __a. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmplt_sd(__m128d __a, __m128d __b) { return (__m128d)__builtin_ia32_cmpltsd((__v2df)__a, (__v2df)__b); } /// \brief Compares the lower double-precision floating-point values in each of /// the two 128-bit floating-point vectors of [2 x double] to determine if /// the value in the first parameter is less than or equal to the /// corresponding value in the second parameter. /// /// The comparison yields 0h for false, FFFFFFFFFFFFFFFFh for true. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPLESD / CMPLESD instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. The lower double-precision value is /// compared to the lower double-precision value of \a __b. /// \param __b /// A 128-bit vector of [2 x double]. The lower double-precision value is /// compared to the lower double-precision value of \a __a. /// \returns A 128-bit vector. The lower 64 bits contains the comparison /// results. The upper 64 bits are copied from the upper 64 bits of \a __a. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmple_sd(__m128d __a, __m128d __b) { return (__m128d)__builtin_ia32_cmplesd((__v2df)__a, (__v2df)__b); } /// \brief Compares the lower double-precision floating-point values in each of /// the two 128-bit floating-point vectors of [2 x double] to determine if /// the value in the first parameter is greater than the corresponding value /// in the second parameter. /// /// The comparison yields 0h for false, FFFFFFFFFFFFFFFFh for true. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPLTSD / CMPLTSD instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. The lower double-precision value is /// compared to the lower double-precision value of \a __b. /// \param __b /// A 128-bit vector of [2 x double]. The lower double-precision value is /// compared to the lower double-precision value of \a __a. /// \returns A 128-bit vector. The lower 64 bits contains the comparison /// results. The upper 64 bits are copied from the upper 64 bits of \a __a. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpgt_sd(__m128d __a, __m128d __b) { __m128d __c = __builtin_ia32_cmpltsd((__v2df)__b, (__v2df)__a); return (__m128d) { __c[0], __a[1] }; } /// \brief Compares the lower double-precision floating-point values in each of /// the two 128-bit floating-point vectors of [2 x double] to determine if /// the value in the first parameter is greater than or equal to the /// corresponding value in the second parameter. /// /// The comparison yields 0h for false, FFFFFFFFFFFFFFFFh for true. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPLESD / CMPLESD instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. The lower double-precision value is /// compared to the lower double-precision value of \a __b. /// \param __b /// A 128-bit vector of [2 x double]. The lower double-precision value is /// compared to the lower double-precision value of \a __a. /// \returns A 128-bit vector. The lower 64 bits contains the comparison /// results. The upper 64 bits are copied from the upper 64 bits of \a __a. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpge_sd(__m128d __a, __m128d __b) { __m128d __c = __builtin_ia32_cmplesd((__v2df)__b, (__v2df)__a); return (__m128d) { __c[0], __a[1] }; } /// \brief Compares the lower double-precision floating-point values in each of /// the two 128-bit floating-point vectors of [2 x double] to determine if /// the value in the first parameter is "ordered" with respect to the /// corresponding value in the second parameter. /// /// The comparison yields 0h for false, FFFFFFFFFFFFFFFFh for true. A pair of /// double-precision values are "ordered" with respect to each other if /// neither value is a NaN. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPORDSD / CMPORDSD instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. The lower double-precision value is /// compared to the lower double-precision value of \a __b. /// \param __b /// A 128-bit vector of [2 x double]. The lower double-precision value is /// compared to the lower double-precision value of \a __a. /// \returns A 128-bit vector. The lower 64 bits contains the comparison /// results. The upper 64 bits are copied from the upper 64 bits of \a __a. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpord_sd(__m128d __a, __m128d __b) { return (__m128d)__builtin_ia32_cmpordsd((__v2df)__a, (__v2df)__b); } /// \brief Compares the lower double-precision floating-point values in each of /// the two 128-bit floating-point vectors of [2 x double] to determine if /// the value in the first parameter is "unordered" with respect to the /// corresponding value in the second parameter. /// /// The comparison yields 0h for false, FFFFFFFFFFFFFFFFh for true. A pair of /// double-precision values are "unordered" with respect to each other if one /// or both values are NaN. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPUNORDSD / CMPUNORDSD /// instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. The lower double-precision value is /// compared to the lower double-precision value of \a __b. /// \param __b /// A 128-bit vector of [2 x double]. The lower double-precision value is /// compared to the lower double-precision value of \a __a. /// \returns A 128-bit vector. The lower 64 bits contains the comparison /// results. The upper 64 bits are copied from the upper 64 bits of \a __a. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpunord_sd(__m128d __a, __m128d __b) { return (__m128d)__builtin_ia32_cmpunordsd((__v2df)__a, (__v2df)__b); } /// \brief Compares the lower double-precision floating-point values in each of /// the two 128-bit floating-point vectors of [2 x double] to determine if /// the value in the first parameter is unequal to the corresponding value in /// the second parameter. /// /// The comparison yields 0h for false, FFFFFFFFFFFFFFFFh for true. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPNEQSD / CMPNEQSD instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. The lower double-precision value is /// compared to the lower double-precision value of \a __b. /// \param __b /// A 128-bit vector of [2 x double]. The lower double-precision value is /// compared to the lower double-precision value of \a __a. /// \returns A 128-bit vector. The lower 64 bits contains the comparison /// results. The upper 64 bits are copied from the upper 64 bits of \a __a. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpneq_sd(__m128d __a, __m128d __b) { return (__m128d)__builtin_ia32_cmpneqsd((__v2df)__a, (__v2df)__b); } /// \brief Compares the lower double-precision floating-point values in each of /// the two 128-bit floating-point vectors of [2 x double] to determine if /// the value in the first parameter is not less than the corresponding /// value in the second parameter. /// /// The comparison yields 0h for false, FFFFFFFFFFFFFFFFh for true. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPNLTSD / CMPNLTSD instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. The lower double-precision value is /// compared to the lower double-precision value of \a __b. /// \param __b /// A 128-bit vector of [2 x double]. The lower double-precision value is /// compared to the lower double-precision value of \a __a. /// \returns A 128-bit vector. The lower 64 bits contains the comparison /// results. The upper 64 bits are copied from the upper 64 bits of \a __a. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpnlt_sd(__m128d __a, __m128d __b) { return (__m128d)__builtin_ia32_cmpnltsd((__v2df)__a, (__v2df)__b); } /// \brief Compares the lower double-precision floating-point values in each of /// the two 128-bit floating-point vectors of [2 x double] to determine if /// the value in the first parameter is not less than or equal to the /// corresponding value in the second parameter. /// /// The comparison yields 0h for false, FFFFFFFFFFFFFFFFh for true. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPNLESD / CMPNLESD instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. The lower double-precision value is /// compared to the lower double-precision value of \a __b. /// \param __b /// A 128-bit vector of [2 x double]. The lower double-precision value is /// compared to the lower double-precision value of \a __a. /// \returns A 128-bit vector. The lower 64 bits contains the comparison /// results. The upper 64 bits are copied from the upper 64 bits of \a __a. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpnle_sd(__m128d __a, __m128d __b) { return (__m128d)__builtin_ia32_cmpnlesd((__v2df)__a, (__v2df)__b); } /// \brief Compares the lower double-precision floating-point values in each of /// the two 128-bit floating-point vectors of [2 x double] to determine if /// the value in the first parameter is not greater than the corresponding /// value in the second parameter. /// /// The comparison yields 0h for false, FFFFFFFFFFFFFFFFh for true. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPNLTSD / CMPNLTSD instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. The lower double-precision value is /// compared to the lower double-precision value of \a __b. /// \param __b /// A 128-bit vector of [2 x double]. The lower double-precision value is /// compared to the lower double-precision value of \a __a. /// \returns A 128-bit vector. The lower 64 bits contains the comparison /// results. The upper 64 bits are copied from the upper 64 bits of \a __a. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpngt_sd(__m128d __a, __m128d __b) { __m128d __c = __builtin_ia32_cmpnltsd((__v2df)__b, (__v2df)__a); return (__m128d) { __c[0], __a[1] }; } /// \brief Compares the lower double-precision floating-point values in each of /// the two 128-bit floating-point vectors of [2 x double] to determine if /// the value in the first parameter is not greater than or equal to the /// corresponding value in the second parameter. /// /// The comparison yields 0h for false, FFFFFFFFFFFFFFFFh for true. /// /// \headerfile /// /// This intrinsic corresponds to the VCMPNLESD / CMPNLESD instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. The lower double-precision value is /// compared to the lower double-precision value of \a __b. /// \param __b /// A 128-bit vector of [2 x double]. The lower double-precision value is /// compared to the lower double-precision value of \a __a. /// \returns A 128-bit vector. The lower 64 bits contains the comparison /// results. The upper 64 bits are copied from the upper 64 bits of \a __a. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cmpnge_sd(__m128d __a, __m128d __b) { __m128d __c = __builtin_ia32_cmpnlesd((__v2df)__b, (__v2df)__a); return (__m128d) { __c[0], __a[1] }; } /// \brief Compares the lower double-precision floating-point values in each of /// the two 128-bit floating-point vectors of [2 x double] for equality. /// /// The comparison yields 0 for false, 1 for true. If either of the two /// lower double-precision values is NaN, 0 is returned. /// /// \headerfile /// /// This intrinsic corresponds to the VCOMISD / COMISD instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. The lower double-precision value is /// compared to the lower double-precision value of \a __b. /// \param __b /// A 128-bit vector of [2 x double]. The lower double-precision value is /// compared to the lower double-precision value of \a __a. /// \returns An integer containing the comparison results. If either of the two /// lower double-precision values is NaN, 0 is returned. static __inline__ int __DEFAULT_FN_ATTRS _mm_comieq_sd(__m128d __a, __m128d __b) { return __builtin_ia32_comisdeq((__v2df)__a, (__v2df)__b); } /// \brief Compares the lower double-precision floating-point values in each of /// the two 128-bit floating-point vectors of [2 x double] to determine if /// the value in the first parameter is less than the corresponding value in /// the second parameter. /// /// The comparison yields 0 for false, 1 for true. If either of the two /// lower double-precision values is NaN, 0 is returned. /// /// \headerfile /// /// This intrinsic corresponds to the VCOMISD / COMISD instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. The lower double-precision value is /// compared to the lower double-precision value of \a __b. /// \param __b /// A 128-bit vector of [2 x double]. The lower double-precision value is /// compared to the lower double-precision value of \a __a. /// \returns An integer containing the comparison results. If either of the two /// lower double-precision values is NaN, 0 is returned. static __inline__ int __DEFAULT_FN_ATTRS _mm_comilt_sd(__m128d __a, __m128d __b) { return __builtin_ia32_comisdlt((__v2df)__a, (__v2df)__b); } /// \brief Compares the lower double-precision floating-point values in each of /// the two 128-bit floating-point vectors of [2 x double] to determine if /// the value in the first parameter is less than or equal to the /// corresponding value in the second parameter. /// /// The comparison yields 0 for false, 1 for true. If either of the two /// lower double-precision values is NaN, 0 is returned. /// /// \headerfile /// /// This intrinsic corresponds to the VCOMISD / COMISD instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. The lower double-precision value is /// compared to the lower double-precision value of \a __b. /// \param __b /// A 128-bit vector of [2 x double]. The lower double-precision value is /// compared to the lower double-precision value of \a __a. /// \returns An integer containing the comparison results. If either of the two /// lower double-precision values is NaN, 0 is returned. static __inline__ int __DEFAULT_FN_ATTRS _mm_comile_sd(__m128d __a, __m128d __b) { return __builtin_ia32_comisdle((__v2df)__a, (__v2df)__b); } /// \brief Compares the lower double-precision floating-point values in each of /// the two 128-bit floating-point vectors of [2 x double] to determine if /// the value in the first parameter is greater than the corresponding value /// in the second parameter. /// /// The comparison yields 0 for false, 1 for true. If either of the two /// lower double-precision values is NaN, 0 is returned. /// /// \headerfile /// /// This intrinsic corresponds to the VCOMISD / COMISD instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. The lower double-precision value is /// compared to the lower double-precision value of \a __b. /// \param __b /// A 128-bit vector of [2 x double]. The lower double-precision value is /// compared to the lower double-precision value of \a __a. /// \returns An integer containing the comparison results. If either of the two /// lower double-precision values is NaN, 0 is returned. static __inline__ int __DEFAULT_FN_ATTRS _mm_comigt_sd(__m128d __a, __m128d __b) { return __builtin_ia32_comisdgt((__v2df)__a, (__v2df)__b); } /// \brief Compares the lower double-precision floating-point values in each of /// the two 128-bit floating-point vectors of [2 x double] to determine if /// the value in the first parameter is greater than or equal to the /// corresponding value in the second parameter. /// /// The comparison yields 0 for false, 1 for true. If either of the two /// lower double-precision values is NaN, 0 is returned. /// /// \headerfile /// /// This intrinsic corresponds to the VCOMISD / COMISD instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. The lower double-precision value is /// compared to the lower double-precision value of \a __b. /// \param __b /// A 128-bit vector of [2 x double]. The lower double-precision value is /// compared to the lower double-precision value of \a __a. /// \returns An integer containing the comparison results. If either of the two /// lower double-precision values is NaN, 0 is returned. static __inline__ int __DEFAULT_FN_ATTRS _mm_comige_sd(__m128d __a, __m128d __b) { return __builtin_ia32_comisdge((__v2df)__a, (__v2df)__b); } /// \brief Compares the lower double-precision floating-point values in each of /// the two 128-bit floating-point vectors of [2 x double] to determine if /// the value in the first parameter is unequal to the corresponding value in /// the second parameter. /// /// The comparison yields 0 for false, 1 for true. If either of the two /// lower double-precision values is NaN, 1 is returned. /// /// \headerfile /// /// This intrinsic corresponds to the VCOMISD / COMISD instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. The lower double-precision value is /// compared to the lower double-precision value of \a __b. /// \param __b /// A 128-bit vector of [2 x double]. The lower double-precision value is /// compared to the lower double-precision value of \a __a. /// \returns An integer containing the comparison results. If either of the two /// lower double-precision values is NaN, 1 is returned. static __inline__ int __DEFAULT_FN_ATTRS _mm_comineq_sd(__m128d __a, __m128d __b) { return __builtin_ia32_comisdneq((__v2df)__a, (__v2df)__b); } /// \brief Compares the lower double-precision floating-point values in each of /// the two 128-bit floating-point vectors of [2 x double] for equality. The /// comparison yields 0 for false, 1 for true. /// /// If either of the two lower double-precision values is NaN, 0 is returned. /// /// \headerfile /// /// This intrinsic corresponds to the VUCOMISD / UCOMISD instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. The lower double-precision value is /// compared to the lower double-precision value of \a __b. /// \param __b /// A 128-bit vector of [2 x double]. The lower double-precision value is /// compared to the lower double-precision value of \a __a. /// \returns An integer containing the comparison results. If either of the two /// lower double-precision values is NaN, 0 is returned. static __inline__ int __DEFAULT_FN_ATTRS _mm_ucomieq_sd(__m128d __a, __m128d __b) { return __builtin_ia32_ucomisdeq((__v2df)__a, (__v2df)__b); } /// \brief Compares the lower double-precision floating-point values in each of /// the two 128-bit floating-point vectors of [2 x double] to determine if /// the value in the first parameter is less than the corresponding value in /// the second parameter. /// /// The comparison yields 0 for false, 1 for true. If either of the two lower /// double-precision values is NaN, 0 is returned. /// /// \headerfile /// /// This intrinsic corresponds to the VUCOMISD / UCOMISD instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. The lower double-precision value is /// compared to the lower double-precision value of \a __b. /// \param __b /// A 128-bit vector of [2 x double]. The lower double-precision value is /// compared to the lower double-precision value of \a __a. /// \returns An integer containing the comparison results. If either of the two /// lower double-precision values is NaN, 0 is returned. static __inline__ int __DEFAULT_FN_ATTRS _mm_ucomilt_sd(__m128d __a, __m128d __b) { return __builtin_ia32_ucomisdlt((__v2df)__a, (__v2df)__b); } /// \brief Compares the lower double-precision floating-point values in each of /// the two 128-bit floating-point vectors of [2 x double] to determine if /// the value in the first parameter is less than or equal to the /// corresponding value in the second parameter. /// /// The comparison yields 0 for false, 1 for true. If either of the two lower /// double-precision values is NaN, 0 is returned. /// /// \headerfile /// /// This intrinsic corresponds to the VUCOMISD / UCOMISD instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. The lower double-precision value is /// compared to the lower double-precision value of \a __b. /// \param __b /// A 128-bit vector of [2 x double]. The lower double-precision value is /// compared to the lower double-precision value of \a __a. /// \returns An integer containing the comparison results. If either of the two /// lower double-precision values is NaN, 0 is returned. static __inline__ int __DEFAULT_FN_ATTRS _mm_ucomile_sd(__m128d __a, __m128d __b) { return __builtin_ia32_ucomisdle((__v2df)__a, (__v2df)__b); } /// \brief Compares the lower double-precision floating-point values in each of /// the two 128-bit floating-point vectors of [2 x double] to determine if /// the value in the first parameter is greater than the corresponding value /// in the second parameter. /// /// The comparison yields 0 for false, 1 for true. If either of the two lower /// double-precision values is NaN, 0 is returned. /// /// \headerfile /// /// This intrinsic corresponds to the VUCOMISD / UCOMISD instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. The lower double-precision value is /// compared to the lower double-precision value of \a __b. /// \param __b /// A 128-bit vector of [2 x double]. The lower double-precision value is /// compared to the lower double-precision value of \a __a. /// \returns An integer containing the comparison results. If either of the two /// lower double-precision values is NaN, 0 is returned. static __inline__ int __DEFAULT_FN_ATTRS _mm_ucomigt_sd(__m128d __a, __m128d __b) { return __builtin_ia32_ucomisdgt((__v2df)__a, (__v2df)__b); } /// \brief Compares the lower double-precision floating-point values in each of /// the two 128-bit floating-point vectors of [2 x double] to determine if /// the value in the first parameter is greater than or equal to the /// corresponding value in the second parameter. /// /// The comparison yields 0 for false, 1 for true. If either of the two /// lower double-precision values is NaN, 0 is returned. /// /// \headerfile /// /// This intrinsic corresponds to the VUCOMISD / UCOMISD instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. The lower double-precision value is /// compared to the lower double-precision value of \a __b. /// \param __b /// A 128-bit vector of [2 x double]. The lower double-precision value is /// compared to the lower double-precision value of \a __a. /// \returns An integer containing the comparison results. If either of the two /// lower double-precision values is NaN, 0 is returned. static __inline__ int __DEFAULT_FN_ATTRS _mm_ucomige_sd(__m128d __a, __m128d __b) { return __builtin_ia32_ucomisdge((__v2df)__a, (__v2df)__b); } /// \brief Compares the lower double-precision floating-point values in each of /// the two 128-bit floating-point vectors of [2 x double] to determine if /// the value in the first parameter is unequal to the corresponding value in /// the second parameter. /// /// The comparison yields 0 for false, 1 for true. If either of the two lower /// double-precision values is NaN, 1 is returned. /// /// \headerfile /// /// This intrinsic corresponds to the VUCOMISD / UCOMISD instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. The lower double-precision value is /// compared to the lower double-precision value of \a __b. /// \param __b /// A 128-bit vector of [2 x double]. The lower double-precision value is /// compared to the lower double-precision value of \a __a. /// \returns An integer containing the comparison result. If either of the two /// lower double-precision values is NaN, 1 is returned. static __inline__ int __DEFAULT_FN_ATTRS _mm_ucomineq_sd(__m128d __a, __m128d __b) { return __builtin_ia32_ucomisdneq((__v2df)__a, (__v2df)__b); } /// \brief Converts the two double-precision floating-point elements of a /// 128-bit vector of [2 x double] into two single-precision floating-point /// values, returned in the lower 64 bits of a 128-bit vector of [4 x float]. /// The upper 64 bits of the result vector are set to zero. /// /// \headerfile /// /// This intrinsic corresponds to the VCVTPD2PS / CVTPD2PS instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. /// \returns A 128-bit vector of [4 x float] whose lower 64 bits contain the /// converted values. The upper 64 bits are set to zero. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cvtpd_ps(__m128d __a) { return __builtin_ia32_cvtpd2ps((__v2df)__a); } /// \brief Converts the lower two single-precision floating-point elements of a /// 128-bit vector of [4 x float] into two double-precision floating-point /// values, returned in a 128-bit vector of [2 x double]. The upper two /// elements of the input vector are unused. /// /// \headerfile /// /// This intrinsic corresponds to the VCVTPS2PD / CVTPS2PD instruction. /// /// \param __a /// A 128-bit vector of [4 x float]. The lower two single-precision /// floating-point elements are converted to double-precision values. The /// upper two elements are unused. /// \returns A 128-bit vector of [2 x double] containing the converted values. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cvtps_pd(__m128 __a) { return (__m128d) __builtin_convertvector( __builtin_shufflevector((__v4sf)__a, (__v4sf)__a, 0, 1), __v2df); } /// \brief Converts the lower two integer elements of a 128-bit vector of /// [4 x i32] into two double-precision floating-point values, returned in a /// 128-bit vector of [2 x double]. /// /// The upper two elements of the input vector are unused. /// /// \headerfile /// /// This intrinsic corresponds to the VCVTDQ2PD / CVTDQ2PD instruction. /// /// \param __a /// A 128-bit integer vector of [4 x i32]. The lower two integer elements are /// converted to double-precision values. /// /// The upper two elements are unused. /// \returns A 128-bit vector of [2 x double] containing the converted values. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cvtepi32_pd(__m128i __a) { return (__m128d) __builtin_convertvector( __builtin_shufflevector((__v4si)__a, (__v4si)__a, 0, 1), __v2df); } /// \brief Converts the two double-precision floating-point elements of a /// 128-bit vector of [2 x double] into two signed 32-bit integer values, /// returned in the lower 64 bits of a 128-bit vector of [4 x i32]. The upper /// 64 bits of the result vector are set to zero. /// /// \headerfile /// /// This intrinsic corresponds to the VCVTPD2DQ / CVTPD2DQ instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. /// \returns A 128-bit vector of [4 x i32] whose lower 64 bits contain the /// converted values. The upper 64 bits are set to zero. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtpd_epi32(__m128d __a) { return __builtin_ia32_cvtpd2dq((__v2df)__a); } /// \brief Converts the low-order element of a 128-bit vector of [2 x double] /// into a 32-bit signed integer value. /// /// \headerfile /// /// This intrinsic corresponds to the VCVTSD2SI / CVTSD2SI instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. The lower 64 bits are used in the /// conversion. /// \returns A 32-bit signed integer containing the converted value. static __inline__ int __DEFAULT_FN_ATTRS _mm_cvtsd_si32(__m128d __a) { return __builtin_ia32_cvtsd2si((__v2df)__a); } /// \brief Converts the lower double-precision floating-point element of a /// 128-bit vector of [2 x double], in the second parameter, into a /// single-precision floating-point value, returned in the lower 32 bits of a /// 128-bit vector of [4 x float]. The upper 96 bits of the result vector are /// copied from the upper 96 bits of the first parameter. /// /// \headerfile /// /// This intrinsic corresponds to the VCVTSD2SS / CVTSD2SS instruction. /// /// \param __a /// A 128-bit vector of [4 x float]. The upper 96 bits of this parameter are /// copied to the upper 96 bits of the result. /// \param __b /// A 128-bit vector of [2 x double]. The lower double-precision /// floating-point element is used in the conversion. /// \returns A 128-bit vector of [4 x float]. The lower 32 bits contain the /// converted value from the second parameter. The upper 96 bits are copied /// from the upper 96 bits of the first parameter. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cvtsd_ss(__m128 __a, __m128d __b) { return (__m128)__builtin_ia32_cvtsd2ss((__v4sf)__a, (__v2df)__b); } /// \brief Converts a 32-bit signed integer value, in the second parameter, into /// a double-precision floating-point value, returned in the lower 64 bits of /// a 128-bit vector of [2 x double]. The upper 64 bits of the result vector /// are copied from the upper 64 bits of the first parameter. /// /// \headerfile /// /// This intrinsic corresponds to the VCVTSI2SD / CVTSI2SD instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. The upper 64 bits of this parameter are /// copied to the upper 64 bits of the result. /// \param __b /// A 32-bit signed integer containing the value to be converted. /// \returns A 128-bit vector of [2 x double]. The lower 64 bits contain the /// converted value from the second parameter. The upper 64 bits are copied /// from the upper 64 bits of the first parameter. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cvtsi32_sd(__m128d __a, int __b) { __a[0] = __b; return __a; } /// \brief Converts the lower single-precision floating-point element of a /// 128-bit vector of [4 x float], in the second parameter, into a /// double-precision floating-point value, returned in the lower 64 bits of /// a 128-bit vector of [2 x double]. The upper 64 bits of the result vector /// are copied from the upper 64 bits of the first parameter. /// /// \headerfile /// /// This intrinsic corresponds to the VCVTSS2SD / CVTSS2SD instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. The upper 64 bits of this parameter are /// copied to the upper 64 bits of the result. /// \param __b /// A 128-bit vector of [4 x float]. The lower single-precision /// floating-point element is used in the conversion. /// \returns A 128-bit vector of [2 x double]. The lower 64 bits contain the /// converted value from the second parameter. The upper 64 bits are copied /// from the upper 64 bits of the first parameter. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cvtss_sd(__m128d __a, __m128 __b) { __a[0] = __b[0]; return __a; } /// \brief Converts the two double-precision floating-point elements of a /// 128-bit vector of [2 x double] into two signed 32-bit integer values, /// returned in the lower 64 bits of a 128-bit vector of [4 x i32]. /// /// If the result of either conversion is inexact, the result is truncated /// (rounded towards zero) regardless of the current MXCSR setting. The upper /// 64 bits of the result vector are set to zero. /// /// \headerfile /// /// This intrinsic corresponds to the VCVTTPD2DQ / CVTTPD2DQ /// instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. /// \returns A 128-bit vector of [4 x i32] whose lower 64 bits contain the /// converted values. The upper 64 bits are set to zero. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvttpd_epi32(__m128d __a) { return (__m128i)__builtin_ia32_cvttpd2dq((__v2df)__a); } /// \brief Converts the low-order element of a [2 x double] vector into a 32-bit /// signed integer value, truncating the result when it is inexact. /// /// \headerfile /// /// This intrinsic corresponds to the VCVTTSD2SI / CVTTSD2SI /// instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. The lower 64 bits are used in the /// conversion. /// \returns A 32-bit signed integer containing the converted value. static __inline__ int __DEFAULT_FN_ATTRS _mm_cvttsd_si32(__m128d __a) { return __builtin_ia32_cvttsd2si((__v2df)__a); } /// \brief Converts the two double-precision floating-point elements of a /// 128-bit vector of [2 x double] into two signed 32-bit integer values, /// returned in a 64-bit vector of [2 x i32]. /// /// \headerfile /// /// This intrinsic corresponds to the CVTPD2PI instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. /// \returns A 64-bit vector of [2 x i32] containing the converted values. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_cvtpd_pi32(__m128d __a) { return (__m64)__builtin_ia32_cvtpd2pi((__v2df)__a); } /// \brief Converts the two double-precision floating-point elements of a /// 128-bit vector of [2 x double] into two signed 32-bit integer values, /// returned in a 64-bit vector of [2 x i32]. /// /// If the result of either conversion is inexact, the result is truncated /// (rounded towards zero) regardless of the current MXCSR setting. /// /// \headerfile /// /// This intrinsic corresponds to the CVTTPD2PI instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. /// \returns A 64-bit vector of [2 x i32] containing the converted values. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_cvttpd_pi32(__m128d __a) { return (__m64)__builtin_ia32_cvttpd2pi((__v2df)__a); } /// \brief Converts the two signed 32-bit integer elements of a 64-bit vector of /// [2 x i32] into two double-precision floating-point values, returned in a /// 128-bit vector of [2 x double]. /// /// \headerfile /// /// This intrinsic corresponds to the CVTPI2PD instruction. /// /// \param __a /// A 64-bit vector of [2 x i32]. /// \returns A 128-bit vector of [2 x double] containing the converted values. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cvtpi32_pd(__m64 __a) { return __builtin_ia32_cvtpi2pd((__v2si)__a); } /// \brief Returns the low-order element of a 128-bit vector of [2 x double] as /// a double-precision floating-point value. /// /// \headerfile /// /// This intrinsic has no corresponding instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. The lower 64 bits are returned. /// \returns A double-precision floating-point value copied from the lower 64 /// bits of \a __a. static __inline__ double __DEFAULT_FN_ATTRS _mm_cvtsd_f64(__m128d __a) { return __a[0]; } /// \brief Loads a 128-bit floating-point vector of [2 x double] from an aligned /// memory location. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVAPD / MOVAPD instruction. /// /// \param __dp /// A pointer to a 128-bit memory location. The address of the memory /// location has to be 16-byte aligned. /// \returns A 128-bit vector of [2 x double] containing the loaded values. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_load_pd(double const *__dp) { return *(__m128d*)__dp; } /// \brief Loads a double-precision floating-point value from a specified memory /// location and duplicates it to both vector elements of a 128-bit vector of /// [2 x double]. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVDDUP / MOVDDUP instruction. /// /// \param __dp /// A pointer to a memory location containing a double-precision value. /// \returns A 128-bit vector of [2 x double] containing the loaded and /// duplicated values. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_load1_pd(double const *__dp) { struct __mm_load1_pd_struct { double __u; } __attribute__((__packed__, __may_alias__)); double __u = ((struct __mm_load1_pd_struct*)__dp)->__u; return (__m128d){ __u, __u }; } #define _mm_load_pd1(dp) _mm_load1_pd(dp) /// \brief Loads two double-precision values, in reverse order, from an aligned /// memory location into a 128-bit vector of [2 x double]. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVAPD / MOVAPD instruction + /// needed shuffling instructions. In AVX mode, the shuffling may be combined /// with the \c VMOVAPD, resulting in only a \c VPERMILPD instruction. /// /// \param __dp /// A 16-byte aligned pointer to an array of double-precision values to be /// loaded in reverse order. /// \returns A 128-bit vector of [2 x double] containing the reversed loaded /// values. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_loadr_pd(double const *__dp) { __m128d __u = *(__m128d*)__dp; return __builtin_shufflevector((__v2df)__u, (__v2df)__u, 1, 0); } /// \brief Loads a 128-bit floating-point vector of [2 x double] from an /// unaligned memory location. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVUPD / MOVUPD instruction. /// /// \param __dp /// A pointer to a 128-bit memory location. The address of the memory /// location does not have to be aligned. /// \returns A 128-bit vector of [2 x double] containing the loaded values. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_loadu_pd(double const *__dp) { struct __loadu_pd { __m128d __v; } __attribute__((__packed__, __may_alias__)); return ((struct __loadu_pd*)__dp)->__v; } /// \brief Loads a 64-bit integer value to the low element of a 128-bit integer /// vector and clears the upper element. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVQ / MOVQ instruction. /// /// \param __a /// A pointer to a 64-bit memory location. The address of the memory /// location does not have to be aligned. /// \returns A 128-bit vector of [2 x i64] containing the loaded value. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_loadu_si64(void const *__a) { struct __loadu_si64 { long long __v; } __attribute__((__packed__, __may_alias__)); long long __u = ((struct __loadu_si64*)__a)->__v; return (__m128i){__u, 0L}; } /// \brief Loads a 64-bit double-precision value to the low element of a /// 128-bit integer vector and clears the upper element. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVSD / MOVSD instruction. /// /// \param __dp /// A pointer to a memory location containing a double-precision value. /// The address of the memory location does not have to be aligned. /// \returns A 128-bit vector of [2 x double] containing the loaded value. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_load_sd(double const *__dp) { struct __mm_load_sd_struct { double __u; } __attribute__((__packed__, __may_alias__)); double __u = ((struct __mm_load_sd_struct*)__dp)->__u; return (__m128d){ __u, 0 }; } /// \brief Loads a double-precision value into the high-order bits of a 128-bit /// vector of [2 x double]. The low-order bits are copied from the low-order /// bits of the first operand. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVHPD / MOVHPD instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. \n /// Bits [63:0] are written to bits [63:0] of the result. /// \param __dp /// A pointer to a 64-bit memory location containing a double-precision /// floating-point value that is loaded. The loaded value is written to bits /// [127:64] of the result. The address of the memory location does not have /// to be aligned. /// \returns A 128-bit vector of [2 x double] containing the moved values. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_loadh_pd(__m128d __a, double const *__dp) { struct __mm_loadh_pd_struct { double __u; } __attribute__((__packed__, __may_alias__)); double __u = ((struct __mm_loadh_pd_struct*)__dp)->__u; return (__m128d){ __a[0], __u }; } /// \brief Loads a double-precision value into the low-order bits of a 128-bit /// vector of [2 x double]. The high-order bits are copied from the /// high-order bits of the first operand. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVLPD / MOVLPD instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. \n /// Bits [127:64] are written to bits [127:64] of the result. /// \param __dp /// A pointer to a 64-bit memory location containing a double-precision /// floating-point value that is loaded. The loaded value is written to bits /// [63:0] of the result. The address of the memory location does not have to /// be aligned. /// \returns A 128-bit vector of [2 x double] containing the moved values. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_loadl_pd(__m128d __a, double const *__dp) { struct __mm_loadl_pd_struct { double __u; } __attribute__((__packed__, __may_alias__)); double __u = ((struct __mm_loadl_pd_struct*)__dp)->__u; return (__m128d){ __u, __a[1] }; } /// \brief Constructs a 128-bit floating-point vector of [2 x double] with /// unspecified content. This could be used as an argument to another /// intrinsic function where the argument is required but the value is not /// actually used. /// /// \headerfile /// /// This intrinsic has no corresponding instruction. /// /// \returns A 128-bit floating-point vector of [2 x double] with unspecified /// content. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_undefined_pd(void) { return (__m128d)__builtin_ia32_undef128(); } /// \brief Constructs a 128-bit floating-point vector of [2 x double]. The lower /// 64 bits of the vector are initialized with the specified double-precision /// floating-point value. The upper 64 bits are set to zero. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVQ / MOVQ instruction. /// /// \param __w /// A double-precision floating-point value used to initialize the lower 64 /// bits of the result. /// \returns An initialized 128-bit floating-point vector of [2 x double]. The /// lower 64 bits contain the value of the parameter. The upper 64 bits are /// set to zero. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_set_sd(double __w) { return (__m128d){ __w, 0 }; } /// \brief Constructs a 128-bit floating-point vector of [2 x double], with each /// of the two double-precision floating-point vector elements set to the /// specified double-precision floating-point value. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVDDUP / MOVLHPS instruction. /// /// \param __w /// A double-precision floating-point value used to initialize each vector /// element of the result. /// \returns An initialized 128-bit floating-point vector of [2 x double]. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_set1_pd(double __w) { return (__m128d){ __w, __w }; } /// \brief Constructs a 128-bit floating-point vector of [2 x double], with each /// of the two double-precision floating-point vector elements set to the /// specified double-precision floating-point value. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVDDUP / MOVLHPS instruction. /// /// \param __w /// A double-precision floating-point value used to initialize each vector /// element of the result. /// \returns An initialized 128-bit floating-point vector of [2 x double]. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_set_pd1(double __w) { return _mm_set1_pd(__w); } /// \brief Constructs a 128-bit floating-point vector of [2 x double] /// initialized with the specified double-precision floating-point values. /// /// \headerfile /// /// This intrinsic corresponds to the VUNPCKLPD / UNPCKLPD instruction. /// /// \param __w /// A double-precision floating-point value used to initialize the upper 64 /// bits of the result. /// \param __x /// A double-precision floating-point value used to initialize the lower 64 /// bits of the result. /// \returns An initialized 128-bit floating-point vector of [2 x double]. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_set_pd(double __w, double __x) { return (__m128d){ __x, __w }; } /// \brief Constructs a 128-bit floating-point vector of [2 x double], /// initialized in reverse order with the specified double-precision /// floating-point values. /// /// \headerfile /// /// This intrinsic corresponds to the VUNPCKLPD / UNPCKLPD instruction. /// /// \param __w /// A double-precision floating-point value used to initialize the lower 64 /// bits of the result. /// \param __x /// A double-precision floating-point value used to initialize the upper 64 /// bits of the result. /// \returns An initialized 128-bit floating-point vector of [2 x double]. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_setr_pd(double __w, double __x) { return (__m128d){ __w, __x }; } /// \brief Constructs a 128-bit floating-point vector of [2 x double] /// initialized to zero. /// /// \headerfile /// /// This intrinsic corresponds to the VXORPS / XORPS instruction. /// /// \returns An initialized 128-bit floating-point vector of [2 x double] with /// all elements set to zero. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_setzero_pd(void) { return (__m128d){ 0, 0 }; } /// \brief Constructs a 128-bit floating-point vector of [2 x double]. The lower /// 64 bits are set to the lower 64 bits of the second parameter. The upper /// 64 bits are set to the upper 64 bits of the first parameter. /// /// \headerfile /// /// This intrinsic corresponds to the VBLENDPD / BLENDPD instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. The upper 64 bits are written to the /// upper 64 bits of the result. /// \param __b /// A 128-bit vector of [2 x double]. The lower 64 bits are written to the /// lower 64 bits of the result. /// \returns A 128-bit vector of [2 x double] containing the moved values. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_move_sd(__m128d __a, __m128d __b) { return (__m128d){ __b[0], __a[1] }; } /// \brief Stores the lower 64 bits of a 128-bit vector of [2 x double] to a /// memory location. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVSD / MOVSD instruction. /// /// \param __dp /// A pointer to a 64-bit memory location. /// \param __a /// A 128-bit vector of [2 x double] containing the value to be stored. static __inline__ void __DEFAULT_FN_ATTRS _mm_store_sd(double *__dp, __m128d __a) { struct __mm_store_sd_struct { double __u; } __attribute__((__packed__, __may_alias__)); ((struct __mm_store_sd_struct*)__dp)->__u = __a[0]; } /// \brief Moves packed double-precision values from a 128-bit vector of /// [2 x double] to a memory location. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVAPD / MOVAPS instruction. /// /// \param __dp /// A pointer to an aligned memory location that can store two /// double-precision values. /// \param __a /// A packed 128-bit vector of [2 x double] containing the values to be /// moved. static __inline__ void __DEFAULT_FN_ATTRS _mm_store_pd(double *__dp, __m128d __a) { *(__m128d*)__dp = __a; } /// \brief Moves the lower 64 bits of a 128-bit vector of [2 x double] twice to /// the upper and lower 64 bits of a memory location. /// /// \headerfile /// /// This intrinsic corresponds to the /// VMOVDDUP + VMOVAPD / MOVLHPS + MOVAPS instruction. /// /// \param __dp /// A pointer to a memory location that can store two double-precision /// values. /// \param __a /// A 128-bit vector of [2 x double] whose lower 64 bits are copied to each /// of the values in \a __dp. static __inline__ void __DEFAULT_FN_ATTRS _mm_store1_pd(double *__dp, __m128d __a) { __a = __builtin_shufflevector((__v2df)__a, (__v2df)__a, 0, 0); _mm_store_pd(__dp, __a); } /// \brief Moves the lower 64 bits of a 128-bit vector of [2 x double] twice to /// the upper and lower 64 bits of a memory location. /// /// \headerfile /// /// This intrinsic corresponds to the /// VMOVDDUP + VMOVAPD / MOVLHPS + MOVAPS instruction. /// /// \param __dp /// A pointer to a memory location that can store two double-precision /// values. /// \param __a /// A 128-bit vector of [2 x double] whose lower 64 bits are copied to each /// of the values in \a __dp. static __inline__ void __DEFAULT_FN_ATTRS _mm_store_pd1(double *__dp, __m128d __a) { return _mm_store1_pd(__dp, __a); } /// \brief Stores a 128-bit vector of [2 x double] into an unaligned memory /// location. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVUPD / MOVUPD instruction. /// /// \param __dp /// A pointer to a 128-bit memory location. The address of the memory /// location does not have to be aligned. /// \param __a /// A 128-bit vector of [2 x double] containing the values to be stored. static __inline__ void __DEFAULT_FN_ATTRS _mm_storeu_pd(double *__dp, __m128d __a) { struct __storeu_pd { __m128d __v; } __attribute__((__packed__, __may_alias__)); ((struct __storeu_pd*)__dp)->__v = __a; } /// \brief Stores two double-precision values, in reverse order, from a 128-bit /// vector of [2 x double] to a 16-byte aligned memory location. /// /// \headerfile /// /// This intrinsic corresponds to a shuffling instruction followed by a /// VMOVAPD / MOVAPD instruction. /// /// \param __dp /// A pointer to a 16-byte aligned memory location that can store two /// double-precision values. /// \param __a /// A 128-bit vector of [2 x double] containing the values to be reversed and /// stored. static __inline__ void __DEFAULT_FN_ATTRS _mm_storer_pd(double *__dp, __m128d __a) { __a = __builtin_shufflevector((__v2df)__a, (__v2df)__a, 1, 0); *(__m128d *)__dp = __a; } /// \brief Stores the upper 64 bits of a 128-bit vector of [2 x double] to a /// memory location. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVHPD / MOVHPD instruction. /// /// \param __dp /// A pointer to a 64-bit memory location. /// \param __a /// A 128-bit vector of [2 x double] containing the value to be stored. static __inline__ void __DEFAULT_FN_ATTRS _mm_storeh_pd(double *__dp, __m128d __a) { struct __mm_storeh_pd_struct { double __u; } __attribute__((__packed__, __may_alias__)); ((struct __mm_storeh_pd_struct*)__dp)->__u = __a[1]; } /// \brief Stores the lower 64 bits of a 128-bit vector of [2 x double] to a /// memory location. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVLPD / MOVLPD instruction. /// /// \param __dp /// A pointer to a 64-bit memory location. /// \param __a /// A 128-bit vector of [2 x double] containing the value to be stored. static __inline__ void __DEFAULT_FN_ATTRS _mm_storel_pd(double *__dp, __m128d __a) { struct __mm_storeh_pd_struct { double __u; } __attribute__((__packed__, __may_alias__)); ((struct __mm_storeh_pd_struct*)__dp)->__u = __a[0]; } /// \brief Adds the corresponding elements of two 128-bit vectors of [16 x i8], /// saving the lower 8 bits of each sum in the corresponding element of a /// 128-bit result vector of [16 x i8]. /// /// The integer elements of both parameters can be either signed or unsigned. /// /// \headerfile /// /// This intrinsic corresponds to the VPADDB / PADDB instruction. /// /// \param __a /// A 128-bit vector of [16 x i8]. /// \param __b /// A 128-bit vector of [16 x i8]. /// \returns A 128-bit vector of [16 x i8] containing the sums of both /// parameters. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_add_epi8(__m128i __a, __m128i __b) { return (__m128i)((__v16qu)__a + (__v16qu)__b); } /// \brief Adds the corresponding elements of two 128-bit vectors of [8 x i16], /// saving the lower 16 bits of each sum in the corresponding element of a /// 128-bit result vector of [8 x i16]. /// /// The integer elements of both parameters can be either signed or unsigned. /// /// \headerfile /// /// This intrinsic corresponds to the VPADDW / PADDW instruction. /// /// \param __a /// A 128-bit vector of [8 x i16]. /// \param __b /// A 128-bit vector of [8 x i16]. /// \returns A 128-bit vector of [8 x i16] containing the sums of both /// parameters. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_add_epi16(__m128i __a, __m128i __b) { return (__m128i)((__v8hu)__a + (__v8hu)__b); } /// \brief Adds the corresponding elements of two 128-bit vectors of [4 x i32], /// saving the lower 32 bits of each sum in the corresponding element of a /// 128-bit result vector of [4 x i32]. /// /// The integer elements of both parameters can be either signed or unsigned. /// /// \headerfile /// /// This intrinsic corresponds to the VPADDD / PADDD instruction. /// /// \param __a /// A 128-bit vector of [4 x i32]. /// \param __b /// A 128-bit vector of [4 x i32]. /// \returns A 128-bit vector of [4 x i32] containing the sums of both /// parameters. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_add_epi32(__m128i __a, __m128i __b) { return (__m128i)((__v4su)__a + (__v4su)__b); } /// \brief Adds two signed or unsigned 64-bit integer values, returning the /// lower 64 bits of the sum. /// /// \headerfile /// /// This intrinsic corresponds to the PADDQ instruction. /// /// \param __a /// A 64-bit integer. /// \param __b /// A 64-bit integer. /// \returns A 64-bit integer containing the sum of both parameters. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_add_si64(__m64 __a, __m64 __b) { return (__m64)__builtin_ia32_paddq((__v1di)__a, (__v1di)__b); } /// \brief Adds the corresponding elements of two 128-bit vectors of [2 x i64], /// saving the lower 64 bits of each sum in the corresponding element of a /// 128-bit result vector of [2 x i64]. /// /// The integer elements of both parameters can be either signed or unsigned. /// /// \headerfile /// /// This intrinsic corresponds to the VPADDQ / PADDQ instruction. /// /// \param __a /// A 128-bit vector of [2 x i64]. /// \param __b /// A 128-bit vector of [2 x i64]. /// \returns A 128-bit vector of [2 x i64] containing the sums of both /// parameters. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_add_epi64(__m128i __a, __m128i __b) { return (__m128i)((__v2du)__a + (__v2du)__b); } /// \brief Adds, with saturation, the corresponding elements of two 128-bit /// signed [16 x i8] vectors, saving each sum in the corresponding element of /// a 128-bit result vector of [16 x i8]. Positive sums greater than 7Fh are /// saturated to 7Fh. Negative sums less than 80h are saturated to 80h. /// /// \headerfile /// /// This intrinsic corresponds to the VPADDSB / PADDSB instruction. /// /// \param __a /// A 128-bit signed [16 x i8] vector. /// \param __b /// A 128-bit signed [16 x i8] vector. /// \returns A 128-bit signed [16 x i8] vector containing the saturated sums of /// both parameters. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_adds_epi8(__m128i __a, __m128i __b) { return (__m128i)__builtin_ia32_paddsb128((__v16qi)__a, (__v16qi)__b); } /// \brief Adds, with saturation, the corresponding elements of two 128-bit /// signed [8 x i16] vectors, saving each sum in the corresponding element of /// a 128-bit result vector of [8 x i16]. Positive sums greater than 7FFFh /// are saturated to 7FFFh. Negative sums less than 8000h are saturated to /// 8000h. /// /// \headerfile /// /// This intrinsic corresponds to the VPADDSW / PADDSW instruction. /// /// \param __a /// A 128-bit signed [8 x i16] vector. /// \param __b /// A 128-bit signed [8 x i16] vector. /// \returns A 128-bit signed [8 x i16] vector containing the saturated sums of /// both parameters. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_adds_epi16(__m128i __a, __m128i __b) { return (__m128i)__builtin_ia32_paddsw128((__v8hi)__a, (__v8hi)__b); } /// \brief Adds, with saturation, the corresponding elements of two 128-bit /// unsigned [16 x i8] vectors, saving each sum in the corresponding element /// of a 128-bit result vector of [16 x i8]. Positive sums greater than FFh /// are saturated to FFh. Negative sums are saturated to 00h. /// /// \headerfile /// /// This intrinsic corresponds to the VPADDUSB / PADDUSB instruction. /// /// \param __a /// A 128-bit unsigned [16 x i8] vector. /// \param __b /// A 128-bit unsigned [16 x i8] vector. /// \returns A 128-bit unsigned [16 x i8] vector containing the saturated sums /// of both parameters. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_adds_epu8(__m128i __a, __m128i __b) { return (__m128i)__builtin_ia32_paddusb128((__v16qi)__a, (__v16qi)__b); } /// \brief Adds, with saturation, the corresponding elements of two 128-bit /// unsigned [8 x i16] vectors, saving each sum in the corresponding element /// of a 128-bit result vector of [8 x i16]. Positive sums greater than FFFFh /// are saturated to FFFFh. Negative sums are saturated to 0000h. /// /// \headerfile /// /// This intrinsic corresponds to the VPADDUSB / PADDUSB instruction. /// /// \param __a /// A 128-bit unsigned [8 x i16] vector. /// \param __b /// A 128-bit unsigned [8 x i16] vector. /// \returns A 128-bit unsigned [8 x i16] vector containing the saturated sums /// of both parameters. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_adds_epu16(__m128i __a, __m128i __b) { return (__m128i)__builtin_ia32_paddusw128((__v8hi)__a, (__v8hi)__b); } /// \brief Computes the rounded avarages of corresponding elements of two /// 128-bit unsigned [16 x i8] vectors, saving each result in the /// corresponding element of a 128-bit result vector of [16 x i8]. /// /// \headerfile /// /// This intrinsic corresponds to the VPAVGB / PAVGB instruction. /// /// \param __a /// A 128-bit unsigned [16 x i8] vector. /// \param __b /// A 128-bit unsigned [16 x i8] vector. /// \returns A 128-bit unsigned [16 x i8] vector containing the rounded /// averages of both parameters. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_avg_epu8(__m128i __a, __m128i __b) { typedef unsigned short __v16hu __attribute__ ((__vector_size__ (32))); return (__m128i)__builtin_convertvector( ((__builtin_convertvector((__v16qu)__a, __v16hu) + __builtin_convertvector((__v16qu)__b, __v16hu)) + 1) >> 1, __v16qu); } /// \brief Computes the rounded avarages of corresponding elements of two /// 128-bit unsigned [8 x i16] vectors, saving each result in the /// corresponding element of a 128-bit result vector of [8 x i16]. /// /// \headerfile /// /// This intrinsic corresponds to the VPAVGW / PAVGW instruction. /// /// \param __a /// A 128-bit unsigned [8 x i16] vector. /// \param __b /// A 128-bit unsigned [8 x i16] vector. /// \returns A 128-bit unsigned [8 x i16] vector containing the rounded /// averages of both parameters. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_avg_epu16(__m128i __a, __m128i __b) { typedef unsigned int __v8su __attribute__ ((__vector_size__ (32))); return (__m128i)__builtin_convertvector( ((__builtin_convertvector((__v8hu)__a, __v8su) + __builtin_convertvector((__v8hu)__b, __v8su)) + 1) >> 1, __v8hu); } /// \brief Multiplies the corresponding elements of two 128-bit signed [8 x i16] /// vectors, producing eight intermediate 32-bit signed integer products, and /// adds the consecutive pairs of 32-bit products to form a 128-bit signed /// [4 x i32] vector. /// /// For example, bits [15:0] of both parameters are multiplied producing a /// 32-bit product, bits [31:16] of both parameters are multiplied producing /// a 32-bit product, and the sum of those two products becomes bits [31:0] /// of the result. /// /// \headerfile /// /// This intrinsic corresponds to the VPMADDWD / PMADDWD instruction. /// /// \param __a /// A 128-bit signed [8 x i16] vector. /// \param __b /// A 128-bit signed [8 x i16] vector. /// \returns A 128-bit signed [4 x i32] vector containing the sums of products /// of both parameters. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_madd_epi16(__m128i __a, __m128i __b) { return (__m128i)__builtin_ia32_pmaddwd128((__v8hi)__a, (__v8hi)__b); } /// \brief Compares corresponding elements of two 128-bit signed [8 x i16] /// vectors, saving the greater value from each comparison in the /// corresponding element of a 128-bit result vector of [8 x i16]. /// /// \headerfile /// /// This intrinsic corresponds to the VPMAXSW / PMAXSW instruction. /// /// \param __a /// A 128-bit signed [8 x i16] vector. /// \param __b /// A 128-bit signed [8 x i16] vector. /// \returns A 128-bit signed [8 x i16] vector containing the greater value of /// each comparison. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_max_epi16(__m128i __a, __m128i __b) { return (__m128i)__builtin_ia32_pmaxsw128((__v8hi)__a, (__v8hi)__b); } /// \brief Compares corresponding elements of two 128-bit unsigned [16 x i8] /// vectors, saving the greater value from each comparison in the /// corresponding element of a 128-bit result vector of [16 x i8]. /// /// \headerfile /// /// This intrinsic corresponds to the VPMAXUB / PMAXUB instruction. /// /// \param __a /// A 128-bit unsigned [16 x i8] vector. /// \param __b /// A 128-bit unsigned [16 x i8] vector. /// \returns A 128-bit unsigned [16 x i8] vector containing the greater value of /// each comparison. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_max_epu8(__m128i __a, __m128i __b) { return (__m128i)__builtin_ia32_pmaxub128((__v16qi)__a, (__v16qi)__b); } /// \brief Compares corresponding elements of two 128-bit signed [8 x i16] /// vectors, saving the smaller value from each comparison in the /// corresponding element of a 128-bit result vector of [8 x i16]. /// /// \headerfile /// /// This intrinsic corresponds to the VPMINSW / PMINSW instruction. /// /// \param __a /// A 128-bit signed [8 x i16] vector. /// \param __b /// A 128-bit signed [8 x i16] vector. /// \returns A 128-bit signed [8 x i16] vector containing the smaller value of /// each comparison. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_min_epi16(__m128i __a, __m128i __b) { return (__m128i)__builtin_ia32_pminsw128((__v8hi)__a, (__v8hi)__b); } /// \brief Compares corresponding elements of two 128-bit unsigned [16 x i8] /// vectors, saving the smaller value from each comparison in the /// corresponding element of a 128-bit result vector of [16 x i8]. /// /// \headerfile /// /// This intrinsic corresponds to the VPMINUB / PMINUB instruction. /// /// \param __a /// A 128-bit unsigned [16 x i8] vector. /// \param __b /// A 128-bit unsigned [16 x i8] vector. /// \returns A 128-bit unsigned [16 x i8] vector containing the smaller value of /// each comparison. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_min_epu8(__m128i __a, __m128i __b) { return (__m128i)__builtin_ia32_pminub128((__v16qi)__a, (__v16qi)__b); } /// \brief Multiplies the corresponding elements of two signed [8 x i16] /// vectors, saving the upper 16 bits of each 32-bit product in the /// corresponding element of a 128-bit signed [8 x i16] result vector. /// /// \headerfile /// /// This intrinsic corresponds to the VPMULHW / PMULHW instruction. /// /// \param __a /// A 128-bit signed [8 x i16] vector. /// \param __b /// A 128-bit signed [8 x i16] vector. /// \returns A 128-bit signed [8 x i16] vector containing the upper 16 bits of /// each of the eight 32-bit products. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mulhi_epi16(__m128i __a, __m128i __b) { return (__m128i)__builtin_ia32_pmulhw128((__v8hi)__a, (__v8hi)__b); } /// \brief Multiplies the corresponding elements of two unsigned [8 x i16] /// vectors, saving the upper 16 bits of each 32-bit product in the /// corresponding element of a 128-bit unsigned [8 x i16] result vector. /// /// \headerfile /// /// This intrinsic corresponds to the VPMULHUW / PMULHUW instruction. /// /// \param __a /// A 128-bit unsigned [8 x i16] vector. /// \param __b /// A 128-bit unsigned [8 x i16] vector. /// \returns A 128-bit unsigned [8 x i16] vector containing the upper 16 bits /// of each of the eight 32-bit products. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mulhi_epu16(__m128i __a, __m128i __b) { return (__m128i)__builtin_ia32_pmulhuw128((__v8hi)__a, (__v8hi)__b); } /// \brief Multiplies the corresponding elements of two signed [8 x i16] /// vectors, saving the lower 16 bits of each 32-bit product in the /// corresponding element of a 128-bit signed [8 x i16] result vector. /// /// \headerfile /// /// This intrinsic corresponds to the VPMULLW / PMULLW instruction. /// /// \param __a /// A 128-bit signed [8 x i16] vector. /// \param __b /// A 128-bit signed [8 x i16] vector. /// \returns A 128-bit signed [8 x i16] vector containing the lower 16 bits of /// each of the eight 32-bit products. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mullo_epi16(__m128i __a, __m128i __b) { return (__m128i)((__v8hu)__a * (__v8hu)__b); } /// \brief Multiplies 32-bit unsigned integer values contained in the lower bits /// of the two 64-bit integer vectors and returns the 64-bit unsigned /// product. /// /// \headerfile /// /// This intrinsic corresponds to the PMULUDQ instruction. /// /// \param __a /// A 64-bit integer containing one of the source operands. /// \param __b /// A 64-bit integer containing one of the source operands. /// \returns A 64-bit integer vector containing the product of both operands. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_mul_su32(__m64 __a, __m64 __b) { return __builtin_ia32_pmuludq((__v2si)__a, (__v2si)__b); } /// \brief Multiplies 32-bit unsigned integer values contained in the lower /// bits of the corresponding elements of two [2 x i64] vectors, and returns /// the 64-bit products in the corresponding elements of a [2 x i64] vector. /// /// \headerfile /// /// This intrinsic corresponds to the VPMULUDQ / PMULUDQ instruction. /// /// \param __a /// A [2 x i64] vector containing one of the source operands. /// \param __b /// A [2 x i64] vector containing one of the source operands. /// \returns A [2 x i64] vector containing the product of both operands. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mul_epu32(__m128i __a, __m128i __b) { return __builtin_ia32_pmuludq128((__v4si)__a, (__v4si)__b); } /// \brief Computes the absolute differences of corresponding 8-bit integer /// values in two 128-bit vectors. Sums the first 8 absolute differences, and /// separately sums the second 8 absolute differences. Packs these two /// unsigned 16-bit integer sums into the upper and lower elements of a /// [2 x i64] vector. /// /// \headerfile /// /// This intrinsic corresponds to the VPSADBW / PSADBW instruction. /// /// \param __a /// A 128-bit integer vector containing one of the source operands. /// \param __b /// A 128-bit integer vector containing one of the source operands. /// \returns A [2 x i64] vector containing the sums of the sets of absolute /// differences between both operands. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sad_epu8(__m128i __a, __m128i __b) { return __builtin_ia32_psadbw128((__v16qi)__a, (__v16qi)__b); } /// \brief Subtracts the corresponding 8-bit integer values in the operands. /// /// \headerfile /// /// This intrinsic corresponds to the VPSUBB / PSUBB instruction. /// /// \param __a /// A 128-bit integer vector containing the minuends. /// \param __b /// A 128-bit integer vector containing the subtrahends. /// \returns A 128-bit integer vector containing the differences of the values /// in the operands. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sub_epi8(__m128i __a, __m128i __b) { return (__m128i)((__v16qu)__a - (__v16qu)__b); } /// \brief Subtracts the corresponding 16-bit integer values in the operands. /// /// \headerfile /// /// This intrinsic corresponds to the VPSUBW / PSUBW instruction. /// /// \param __a /// A 128-bit integer vector containing the minuends. /// \param __b /// A 128-bit integer vector containing the subtrahends. /// \returns A 128-bit integer vector containing the differences of the values /// in the operands. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sub_epi16(__m128i __a, __m128i __b) { return (__m128i)((__v8hu)__a - (__v8hu)__b); } /// \brief Subtracts the corresponding 32-bit integer values in the operands. /// /// \headerfile /// /// This intrinsic corresponds to the VPSUBD / PSUBD instruction. /// /// \param __a /// A 128-bit integer vector containing the minuends. /// \param __b /// A 128-bit integer vector containing the subtrahends. /// \returns A 128-bit integer vector containing the differences of the values /// in the operands. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sub_epi32(__m128i __a, __m128i __b) { return (__m128i)((__v4su)__a - (__v4su)__b); } /// \brief Subtracts signed or unsigned 64-bit integer values and writes the /// difference to the corresponding bits in the destination. /// /// \headerfile /// /// This intrinsic corresponds to the PSUBQ instruction. /// /// \param __a /// A 64-bit integer vector containing the minuend. /// \param __b /// A 64-bit integer vector containing the subtrahend. /// \returns A 64-bit integer vector containing the difference of the values in /// the operands. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_sub_si64(__m64 __a, __m64 __b) { return (__m64)__builtin_ia32_psubq((__v1di)__a, (__v1di)__b); } /// \brief Subtracts the corresponding elements of two [2 x i64] vectors. /// /// \headerfile /// /// This intrinsic corresponds to the VPSUBQ / PSUBQ instruction. /// /// \param __a /// A 128-bit integer vector containing the minuends. /// \param __b /// A 128-bit integer vector containing the subtrahends. /// \returns A 128-bit integer vector containing the differences of the values /// in the operands. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sub_epi64(__m128i __a, __m128i __b) { return (__m128i)((__v2du)__a - (__v2du)__b); } /// \brief Subtracts corresponding 8-bit signed integer values in the input and /// returns the differences in the corresponding bytes in the destination. /// Differences greater than 7Fh are saturated to 7Fh, and differences less /// than 80h are saturated to 80h. /// /// \headerfile /// /// This intrinsic corresponds to the VPSUBSB / PSUBSB instruction. /// /// \param __a /// A 128-bit integer vector containing the minuends. /// \param __b /// A 128-bit integer vector containing the subtrahends. /// \returns A 128-bit integer vector containing the differences of the values /// in the operands. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_subs_epi8(__m128i __a, __m128i __b) { return (__m128i)__builtin_ia32_psubsb128((__v16qi)__a, (__v16qi)__b); } /// \brief Subtracts corresponding 16-bit signed integer values in the input and /// returns the differences in the corresponding bytes in the destination. /// Differences greater than 7FFFh are saturated to 7FFFh, and values less /// than 8000h are saturated to 8000h. /// /// \headerfile /// /// This intrinsic corresponds to the VPSUBSW / PSUBSW instruction. /// /// \param __a /// A 128-bit integer vector containing the minuends. /// \param __b /// A 128-bit integer vector containing the subtrahends. /// \returns A 128-bit integer vector containing the differences of the values /// in the operands. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_subs_epi16(__m128i __a, __m128i __b) { return (__m128i)__builtin_ia32_psubsw128((__v8hi)__a, (__v8hi)__b); } /// \brief Subtracts corresponding 8-bit unsigned integer values in the input /// and returns the differences in the corresponding bytes in the /// destination. Differences less than 00h are saturated to 00h. /// /// \headerfile /// /// This intrinsic corresponds to the VPSUBUSB / PSUBUSB instruction. /// /// \param __a /// A 128-bit integer vector containing the minuends. /// \param __b /// A 128-bit integer vector containing the subtrahends. /// \returns A 128-bit integer vector containing the unsigned integer /// differences of the values in the operands. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_subs_epu8(__m128i __a, __m128i __b) { return (__m128i)__builtin_ia32_psubusb128((__v16qi)__a, (__v16qi)__b); } /// \brief Subtracts corresponding 16-bit unsigned integer values in the input /// and returns the differences in the corresponding bytes in the /// destination. Differences less than 0000h are saturated to 0000h. /// /// \headerfile /// /// This intrinsic corresponds to the VPSUBUSW / PSUBUSW instruction. /// /// \param __a /// A 128-bit integer vector containing the minuends. /// \param __b /// A 128-bit integer vector containing the subtrahends. /// \returns A 128-bit integer vector containing the unsigned integer /// differences of the values in the operands. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_subs_epu16(__m128i __a, __m128i __b) { return (__m128i)__builtin_ia32_psubusw128((__v8hi)__a, (__v8hi)__b); } /// \brief Performs a bitwise AND of two 128-bit integer vectors. /// /// \headerfile /// /// This intrinsic corresponds to the VPAND / PAND instruction. /// /// \param __a /// A 128-bit integer vector containing one of the source operands. /// \param __b /// A 128-bit integer vector containing one of the source operands. /// \returns A 128-bit integer vector containing the bitwise AND of the values /// in both operands. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_and_si128(__m128i __a, __m128i __b) { return (__m128i)((__v2du)__a & (__v2du)__b); } /// \brief Performs a bitwise AND of two 128-bit integer vectors, using the /// one's complement of the values contained in the first source operand. /// /// \headerfile /// /// This intrinsic corresponds to the VPANDN / PANDN instruction. /// /// \param __a /// A 128-bit vector containing the left source operand. The one's complement /// of this value is used in the bitwise AND. /// \param __b /// A 128-bit vector containing the right source operand. /// \returns A 128-bit integer vector containing the bitwise AND of the one's /// complement of the first operand and the values in the second operand. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_andnot_si128(__m128i __a, __m128i __b) { return (__m128i)(~(__v2du)__a & (__v2du)__b); } /// \brief Performs a bitwise OR of two 128-bit integer vectors. /// /// \headerfile /// /// This intrinsic corresponds to the VPOR / POR instruction. /// /// \param __a /// A 128-bit integer vector containing one of the source operands. /// \param __b /// A 128-bit integer vector containing one of the source operands. /// \returns A 128-bit integer vector containing the bitwise OR of the values /// in both operands. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_or_si128(__m128i __a, __m128i __b) { return (__m128i)((__v2du)__a | (__v2du)__b); } /// \brief Performs a bitwise exclusive OR of two 128-bit integer vectors. /// /// \headerfile /// /// This intrinsic corresponds to the VPXOR / PXOR instruction. /// /// \param __a /// A 128-bit integer vector containing one of the source operands. /// \param __b /// A 128-bit integer vector containing one of the source operands. /// \returns A 128-bit integer vector containing the bitwise exclusive OR of the /// values in both operands. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_xor_si128(__m128i __a, __m128i __b) { return (__m128i)((__v2du)__a ^ (__v2du)__b); } /// \brief Left-shifts the 128-bit integer vector operand by the specified /// number of bytes. Low-order bits are cleared. /// /// \headerfile /// /// \code /// __m128i _mm_slli_si128(__m128i a, const int imm); /// \endcode /// /// This intrinsic corresponds to the VPSLLDQ / PSLLDQ instruction. /// /// \param a /// A 128-bit integer vector containing the source operand. /// \param imm /// An immediate value specifying the number of bytes to left-shift operand /// \a a. /// \returns A 128-bit integer vector containing the left-shifted value. #define _mm_slli_si128(a, imm) __extension__ ({ \ (__m128i)__builtin_shufflevector( \ (__v16qi)_mm_setzero_si128(), \ (__v16qi)(__m128i)(a), \ ((char)(imm)&0xF0) ? 0 : 16 - (char)(imm), \ ((char)(imm)&0xF0) ? 1 : 17 - (char)(imm), \ ((char)(imm)&0xF0) ? 2 : 18 - (char)(imm), \ ((char)(imm)&0xF0) ? 3 : 19 - (char)(imm), \ ((char)(imm)&0xF0) ? 4 : 20 - (char)(imm), \ ((char)(imm)&0xF0) ? 5 : 21 - (char)(imm), \ ((char)(imm)&0xF0) ? 6 : 22 - (char)(imm), \ ((char)(imm)&0xF0) ? 7 : 23 - (char)(imm), \ ((char)(imm)&0xF0) ? 8 : 24 - (char)(imm), \ ((char)(imm)&0xF0) ? 9 : 25 - (char)(imm), \ ((char)(imm)&0xF0) ? 10 : 26 - (char)(imm), \ ((char)(imm)&0xF0) ? 11 : 27 - (char)(imm), \ ((char)(imm)&0xF0) ? 12 : 28 - (char)(imm), \ ((char)(imm)&0xF0) ? 13 : 29 - (char)(imm), \ ((char)(imm)&0xF0) ? 14 : 30 - (char)(imm), \ ((char)(imm)&0xF0) ? 15 : 31 - (char)(imm)); }) #define _mm_bslli_si128(a, imm) \ _mm_slli_si128((a), (imm)) /// \brief Left-shifts each 16-bit value in the 128-bit integer vector operand /// by the specified number of bits. Low-order bits are cleared. /// /// \headerfile /// /// This intrinsic corresponds to the VPSLLW / PSLLW instruction. /// /// \param __a /// A 128-bit integer vector containing the source operand. /// \param __count /// An integer value specifying the number of bits to left-shift each value /// in operand \a __a. /// \returns A 128-bit integer vector containing the left-shifted values. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_slli_epi16(__m128i __a, int __count) { return (__m128i)__builtin_ia32_psllwi128((__v8hi)__a, __count); } /// \brief Left-shifts each 16-bit value in the 128-bit integer vector operand /// by the specified number of bits. Low-order bits are cleared. /// /// \headerfile /// /// This intrinsic corresponds to the VPSLLW / PSLLW instruction. /// /// \param __a /// A 128-bit integer vector containing the source operand. /// \param __count /// A 128-bit integer vector in which bits [63:0] specify the number of bits /// to left-shift each value in operand \a __a. /// \returns A 128-bit integer vector containing the left-shifted values. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sll_epi16(__m128i __a, __m128i __count) { return (__m128i)__builtin_ia32_psllw128((__v8hi)__a, (__v8hi)__count); } /// \brief Left-shifts each 32-bit value in the 128-bit integer vector operand /// by the specified number of bits. Low-order bits are cleared. /// /// \headerfile /// /// This intrinsic corresponds to the VPSLLD / PSLLD instruction. /// /// \param __a /// A 128-bit integer vector containing the source operand. /// \param __count /// An integer value specifying the number of bits to left-shift each value /// in operand \a __a. /// \returns A 128-bit integer vector containing the left-shifted values. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_slli_epi32(__m128i __a, int __count) { return (__m128i)__builtin_ia32_pslldi128((__v4si)__a, __count); } /// \brief Left-shifts each 32-bit value in the 128-bit integer vector operand /// by the specified number of bits. Low-order bits are cleared. /// /// \headerfile /// /// This intrinsic corresponds to the VPSLLD / PSLLD instruction. /// /// \param __a /// A 128-bit integer vector containing the source operand. /// \param __count /// A 128-bit integer vector in which bits [63:0] specify the number of bits /// to left-shift each value in operand \a __a. /// \returns A 128-bit integer vector containing the left-shifted values. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sll_epi32(__m128i __a, __m128i __count) { return (__m128i)__builtin_ia32_pslld128((__v4si)__a, (__v4si)__count); } /// \brief Left-shifts each 64-bit value in the 128-bit integer vector operand /// by the specified number of bits. Low-order bits are cleared. /// /// \headerfile /// /// This intrinsic corresponds to the VPSLLQ / PSLLQ instruction. /// /// \param __a /// A 128-bit integer vector containing the source operand. /// \param __count /// An integer value specifying the number of bits to left-shift each value /// in operand \a __a. /// \returns A 128-bit integer vector containing the left-shifted values. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_slli_epi64(__m128i __a, int __count) { return __builtin_ia32_psllqi128((__v2di)__a, __count); } /// \brief Left-shifts each 64-bit value in the 128-bit integer vector operand /// by the specified number of bits. Low-order bits are cleared. /// /// \headerfile /// /// This intrinsic corresponds to the VPSLLQ / PSLLQ instruction. /// /// \param __a /// A 128-bit integer vector containing the source operand. /// \param __count /// A 128-bit integer vector in which bits [63:0] specify the number of bits /// to left-shift each value in operand \a __a. /// \returns A 128-bit integer vector containing the left-shifted values. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sll_epi64(__m128i __a, __m128i __count) { return __builtin_ia32_psllq128((__v2di)__a, (__v2di)__count); } /// \brief Right-shifts each 16-bit value in the 128-bit integer vector operand /// by the specified number of bits. High-order bits are filled with the sign /// bit of the initial value. /// /// \headerfile /// /// This intrinsic corresponds to the VPSRAW / PSRAW instruction. /// /// \param __a /// A 128-bit integer vector containing the source operand. /// \param __count /// An integer value specifying the number of bits to right-shift each value /// in operand \a __a. /// \returns A 128-bit integer vector containing the right-shifted values. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_srai_epi16(__m128i __a, int __count) { return (__m128i)__builtin_ia32_psrawi128((__v8hi)__a, __count); } /// \brief Right-shifts each 16-bit value in the 128-bit integer vector operand /// by the specified number of bits. High-order bits are filled with the sign /// bit of the initial value. /// /// \headerfile /// /// This intrinsic corresponds to the VPSRAW / PSRAW instruction. /// /// \param __a /// A 128-bit integer vector containing the source operand. /// \param __count /// A 128-bit integer vector in which bits [63:0] specify the number of bits /// to right-shift each value in operand \a __a. /// \returns A 128-bit integer vector containing the right-shifted values. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sra_epi16(__m128i __a, __m128i __count) { return (__m128i)__builtin_ia32_psraw128((__v8hi)__a, (__v8hi)__count); } /// \brief Right-shifts each 32-bit value in the 128-bit integer vector operand /// by the specified number of bits. High-order bits are filled with the sign /// bit of the initial value. /// /// \headerfile /// /// This intrinsic corresponds to the VPSRAD / PSRAD instruction. /// /// \param __a /// A 128-bit integer vector containing the source operand. /// \param __count /// An integer value specifying the number of bits to right-shift each value /// in operand \a __a. /// \returns A 128-bit integer vector containing the right-shifted values. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_srai_epi32(__m128i __a, int __count) { return (__m128i)__builtin_ia32_psradi128((__v4si)__a, __count); } /// \brief Right-shifts each 32-bit value in the 128-bit integer vector operand /// by the specified number of bits. High-order bits are filled with the sign /// bit of the initial value. /// /// \headerfile /// /// This intrinsic corresponds to the VPSRAD / PSRAD instruction. /// /// \param __a /// A 128-bit integer vector containing the source operand. /// \param __count /// A 128-bit integer vector in which bits [63:0] specify the number of bits /// to right-shift each value in operand \a __a. /// \returns A 128-bit integer vector containing the right-shifted values. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sra_epi32(__m128i __a, __m128i __count) { return (__m128i)__builtin_ia32_psrad128((__v4si)__a, (__v4si)__count); } /// \brief Right-shifts the 128-bit integer vector operand by the specified /// number of bytes. High-order bits are cleared. /// /// \headerfile /// /// \code /// __m128i _mm_srli_si128(__m128i a, const int imm); /// \endcode /// /// This intrinsic corresponds to the VPSRLDQ / PSRLDQ instruction. /// /// \param a /// A 128-bit integer vector containing the source operand. /// \param imm /// An immediate value specifying the number of bytes to right-shift operand /// \a a. /// \returns A 128-bit integer vector containing the right-shifted value. #define _mm_srli_si128(a, imm) __extension__ ({ \ (__m128i)__builtin_shufflevector( \ (__v16qi)(__m128i)(a), \ (__v16qi)_mm_setzero_si128(), \ ((char)(imm)&0xF0) ? 16 : (char)(imm) + 0, \ ((char)(imm)&0xF0) ? 17 : (char)(imm) + 1, \ ((char)(imm)&0xF0) ? 18 : (char)(imm) + 2, \ ((char)(imm)&0xF0) ? 19 : (char)(imm) + 3, \ ((char)(imm)&0xF0) ? 20 : (char)(imm) + 4, \ ((char)(imm)&0xF0) ? 21 : (char)(imm) + 5, \ ((char)(imm)&0xF0) ? 22 : (char)(imm) + 6, \ ((char)(imm)&0xF0) ? 23 : (char)(imm) + 7, \ ((char)(imm)&0xF0) ? 24 : (char)(imm) + 8, \ ((char)(imm)&0xF0) ? 25 : (char)(imm) + 9, \ ((char)(imm)&0xF0) ? 26 : (char)(imm) + 10, \ ((char)(imm)&0xF0) ? 27 : (char)(imm) + 11, \ ((char)(imm)&0xF0) ? 28 : (char)(imm) + 12, \ ((char)(imm)&0xF0) ? 29 : (char)(imm) + 13, \ ((char)(imm)&0xF0) ? 30 : (char)(imm) + 14, \ ((char)(imm)&0xF0) ? 31 : (char)(imm) + 15); }) #define _mm_bsrli_si128(a, imm) \ _mm_srli_si128((a), (imm)) /// \brief Right-shifts each of 16-bit values in the 128-bit integer vector /// operand by the specified number of bits. High-order bits are cleared. /// /// \headerfile /// /// This intrinsic corresponds to the VPSRLW / PSRLW instruction. /// /// \param __a /// A 128-bit integer vector containing the source operand. /// \param __count /// An integer value specifying the number of bits to right-shift each value /// in operand \a __a. /// \returns A 128-bit integer vector containing the right-shifted values. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_srli_epi16(__m128i __a, int __count) { return (__m128i)__builtin_ia32_psrlwi128((__v8hi)__a, __count); } /// \brief Right-shifts each of 16-bit values in the 128-bit integer vector /// operand by the specified number of bits. High-order bits are cleared. /// /// \headerfile /// /// This intrinsic corresponds to the VPSRLW / PSRLW instruction. /// /// \param __a /// A 128-bit integer vector containing the source operand. /// \param __count /// A 128-bit integer vector in which bits [63:0] specify the number of bits /// to right-shift each value in operand \a __a. /// \returns A 128-bit integer vector containing the right-shifted values. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_srl_epi16(__m128i __a, __m128i __count) { return (__m128i)__builtin_ia32_psrlw128((__v8hi)__a, (__v8hi)__count); } /// \brief Right-shifts each of 32-bit values in the 128-bit integer vector /// operand by the specified number of bits. High-order bits are cleared. /// /// \headerfile /// /// This intrinsic corresponds to the VPSRLD / PSRLD instruction. /// /// \param __a /// A 128-bit integer vector containing the source operand. /// \param __count /// An integer value specifying the number of bits to right-shift each value /// in operand \a __a. /// \returns A 128-bit integer vector containing the right-shifted values. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_srli_epi32(__m128i __a, int __count) { return (__m128i)__builtin_ia32_psrldi128((__v4si)__a, __count); } /// \brief Right-shifts each of 32-bit values in the 128-bit integer vector /// operand by the specified number of bits. High-order bits are cleared. /// /// \headerfile /// /// This intrinsic corresponds to the VPSRLD / PSRLD instruction. /// /// \param __a /// A 128-bit integer vector containing the source operand. /// \param __count /// A 128-bit integer vector in which bits [63:0] specify the number of bits /// to right-shift each value in operand \a __a. /// \returns A 128-bit integer vector containing the right-shifted values. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_srl_epi32(__m128i __a, __m128i __count) { return (__m128i)__builtin_ia32_psrld128((__v4si)__a, (__v4si)__count); } /// \brief Right-shifts each of 64-bit values in the 128-bit integer vector /// operand by the specified number of bits. High-order bits are cleared. /// /// \headerfile /// /// This intrinsic corresponds to the VPSRLQ / PSRLQ instruction. /// /// \param __a /// A 128-bit integer vector containing the source operand. /// \param __count /// An integer value specifying the number of bits to right-shift each value /// in operand \a __a. /// \returns A 128-bit integer vector containing the right-shifted values. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_srli_epi64(__m128i __a, int __count) { return __builtin_ia32_psrlqi128((__v2di)__a, __count); } /// \brief Right-shifts each of 64-bit values in the 128-bit integer vector /// operand by the specified number of bits. High-order bits are cleared. /// /// \headerfile /// /// This intrinsic corresponds to the VPSRLQ / PSRLQ instruction. /// /// \param __a /// A 128-bit integer vector containing the source operand. /// \param __count /// A 128-bit integer vector in which bits [63:0] specify the number of bits /// to right-shift each value in operand \a __a. /// \returns A 128-bit integer vector containing the right-shifted values. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_srl_epi64(__m128i __a, __m128i __count) { return __builtin_ia32_psrlq128((__v2di)__a, (__v2di)__count); } /// \brief Compares each of the corresponding 8-bit values of the 128-bit /// integer vectors for equality. Each comparison yields 0h for false, FFh /// for true. /// /// \headerfile /// /// This intrinsic corresponds to the VPCMPEQB / PCMPEQB instruction. /// /// \param __a /// A 128-bit integer vector. /// \param __b /// A 128-bit integer vector. /// \returns A 128-bit integer vector containing the comparison results. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cmpeq_epi8(__m128i __a, __m128i __b) { return (__m128i)((__v16qi)__a == (__v16qi)__b); } /// \brief Compares each of the corresponding 16-bit values of the 128-bit /// integer vectors for equality. Each comparison yields 0h for false, FFFFh /// for true. /// /// \headerfile /// /// This intrinsic corresponds to the VPCMPEQW / PCMPEQW instruction. /// /// \param __a /// A 128-bit integer vector. /// \param __b /// A 128-bit integer vector. /// \returns A 128-bit integer vector containing the comparison results. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cmpeq_epi16(__m128i __a, __m128i __b) { return (__m128i)((__v8hi)__a == (__v8hi)__b); } /// \brief Compares each of the corresponding 32-bit values of the 128-bit /// integer vectors for equality. Each comparison yields 0h for false, /// FFFFFFFFh for true. /// /// \headerfile /// /// This intrinsic corresponds to the VPCMPEQD / PCMPEQD instruction. /// /// \param __a /// A 128-bit integer vector. /// \param __b /// A 128-bit integer vector. /// \returns A 128-bit integer vector containing the comparison results. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cmpeq_epi32(__m128i __a, __m128i __b) { return (__m128i)((__v4si)__a == (__v4si)__b); } /// \brief Compares each of the corresponding signed 8-bit values of the 128-bit /// integer vectors to determine if the values in the first operand are /// greater than those in the second operand. Each comparison yields 0h for /// false, FFh for true. /// /// \headerfile /// /// This intrinsic corresponds to the VPCMPGTB / PCMPGTB instruction. /// /// \param __a /// A 128-bit integer vector. /// \param __b /// A 128-bit integer vector. /// \returns A 128-bit integer vector containing the comparison results. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cmpgt_epi8(__m128i __a, __m128i __b) { /* This function always performs a signed comparison, but __v16qi is a char which may be signed or unsigned, so use __v16qs. */ return (__m128i)((__v16qs)__a > (__v16qs)__b); } /// \brief Compares each of the corresponding signed 16-bit values of the /// 128-bit integer vectors to determine if the values in the first operand /// are greater than those in the second operand. /// /// Each comparison yields 0h for false, FFFFh for true. /// /// \headerfile /// /// This intrinsic corresponds to the VPCMPGTW / PCMPGTW instruction. /// /// \param __a /// A 128-bit integer vector. /// \param __b /// A 128-bit integer vector. /// \returns A 128-bit integer vector containing the comparison results. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cmpgt_epi16(__m128i __a, __m128i __b) { return (__m128i)((__v8hi)__a > (__v8hi)__b); } /// \brief Compares each of the corresponding signed 32-bit values of the /// 128-bit integer vectors to determine if the values in the first operand /// are greater than those in the second operand. /// /// Each comparison yields 0h for false, FFFFFFFFh for true. /// /// \headerfile /// /// This intrinsic corresponds to the VPCMPGTD / PCMPGTD instruction. /// /// \param __a /// A 128-bit integer vector. /// \param __b /// A 128-bit integer vector. /// \returns A 128-bit integer vector containing the comparison results. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cmpgt_epi32(__m128i __a, __m128i __b) { return (__m128i)((__v4si)__a > (__v4si)__b); } /// \brief Compares each of the corresponding signed 8-bit values of the 128-bit /// integer vectors to determine if the values in the first operand are less /// than those in the second operand. /// /// Each comparison yields 0h for false, FFh for true. /// /// \headerfile /// /// This intrinsic corresponds to the VPCMPGTB / PCMPGTB instruction. /// /// \param __a /// A 128-bit integer vector. /// \param __b /// A 128-bit integer vector. /// \returns A 128-bit integer vector containing the comparison results. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cmplt_epi8(__m128i __a, __m128i __b) { return _mm_cmpgt_epi8(__b, __a); } /// \brief Compares each of the corresponding signed 16-bit values of the /// 128-bit integer vectors to determine if the values in the first operand /// are less than those in the second operand. /// /// Each comparison yields 0h for false, FFFFh for true. /// /// \headerfile /// /// This intrinsic corresponds to the VPCMPGTW / PCMPGTW instruction. /// /// \param __a /// A 128-bit integer vector. /// \param __b /// A 128-bit integer vector. /// \returns A 128-bit integer vector containing the comparison results. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cmplt_epi16(__m128i __a, __m128i __b) { return _mm_cmpgt_epi16(__b, __a); } /// \brief Compares each of the corresponding signed 32-bit values of the /// 128-bit integer vectors to determine if the values in the first operand /// are less than those in the second operand. /// /// Each comparison yields 0h for false, FFFFFFFFh for true. /// /// \headerfile /// /// This intrinsic corresponds to the VPCMPGTD / PCMPGTD instruction. /// /// \param __a /// A 128-bit integer vector. /// \param __b /// A 128-bit integer vector. /// \returns A 128-bit integer vector containing the comparison results. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cmplt_epi32(__m128i __a, __m128i __b) { return _mm_cmpgt_epi32(__b, __a); } #ifdef __x86_64__ /// \brief Converts a 64-bit signed integer value from the second operand into a /// double-precision value and returns it in the lower element of a [2 x /// double] vector; the upper element of the returned vector is copied from /// the upper element of the first operand. /// /// \headerfile /// /// This intrinsic corresponds to the VCVTSI2SD / CVTSI2SD instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. The upper 64 bits of this operand are /// copied to the upper 64 bits of the destination. /// \param __b /// A 64-bit signed integer operand containing the value to be converted. /// \returns A 128-bit vector of [2 x double] whose lower 64 bits contain the /// converted value of the second operand. The upper 64 bits are copied from /// the upper 64 bits of the first operand. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cvtsi64_sd(__m128d __a, long long __b) { __a[0] = __b; return __a; } /// \brief Converts the first (lower) element of a vector of [2 x double] into a /// 64-bit signed integer value, according to the current rounding mode. /// /// \headerfile /// /// This intrinsic corresponds to the VCVTSD2SI / CVTSD2SI instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. The lower 64 bits are used in the /// conversion. /// \returns A 64-bit signed integer containing the converted value. static __inline__ long long __DEFAULT_FN_ATTRS _mm_cvtsd_si64(__m128d __a) { return __builtin_ia32_cvtsd2si64((__v2df)__a); } /// \brief Converts the first (lower) element of a vector of [2 x double] into a /// 64-bit signed integer value, truncating the result when it is inexact. /// /// \headerfile /// /// This intrinsic corresponds to the VCVTTSD2SI / CVTTSD2SI /// instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. The lower 64 bits are used in the /// conversion. /// \returns A 64-bit signed integer containing the converted value. static __inline__ long long __DEFAULT_FN_ATTRS _mm_cvttsd_si64(__m128d __a) { return __builtin_ia32_cvttsd2si64((__v2df)__a); } #endif # 3414 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/emmintrin.h" 3 /// \brief Converts a vector of [4 x i32] into a vector of [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VCVTDQ2PS / CVTDQ2PS instruction. /// /// \param __a /// A 128-bit integer vector. /// \returns A 128-bit vector of [4 x float] containing the converted values. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cvtepi32_ps(__m128i __a) { return __builtin_ia32_cvtdq2ps((__v4si)__a); } /// \brief Converts a vector of [4 x float] into a vector of [4 x i32]. /// /// \headerfile /// /// This intrinsic corresponds to the VCVTPS2DQ / CVTPS2DQ instruction. /// /// \param __a /// A 128-bit vector of [4 x float]. /// \returns A 128-bit integer vector of [4 x i32] containing the converted /// values. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtps_epi32(__m128 __a) { return (__m128i)__builtin_ia32_cvtps2dq((__v4sf)__a); } /// \brief Converts a vector of [4 x float] into a vector of [4 x i32], /// truncating the result when it is inexact. /// /// \headerfile /// /// This intrinsic corresponds to the VCVTTPS2DQ / CVTTPS2DQ /// instruction. /// /// \param __a /// A 128-bit vector of [4 x float]. /// \returns A 128-bit vector of [4 x i32] containing the converted values. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvttps_epi32(__m128 __a) { return (__m128i)__builtin_ia32_cvttps2dq((__v4sf)__a); } /// \brief Returns a vector of [4 x i32] where the lowest element is the input /// operand and the remaining elements are zero. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVD / MOVD instruction. /// /// \param __a /// A 32-bit signed integer operand. /// \returns A 128-bit vector of [4 x i32]. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtsi32_si128(int __a) { return (__m128i)(__v4si){ __a, 0, 0, 0 }; } #ifdef __x86_64__ /// \brief Returns a vector of [2 x i64] where the lower element is the input /// operand and the upper element is zero. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVQ / MOVQ instruction. /// /// \param __a /// A 64-bit signed integer operand containing the value to be converted. /// \returns A 128-bit vector of [2 x i64] containing the converted value. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtsi64_si128(long long __a) { return (__m128i){ __a, 0 }; } #endif # 3496 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/emmintrin.h" 3 /// \brief Moves the least significant 32 bits of a vector of [4 x i32] to a /// 32-bit signed integer value. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVD / MOVD instruction. /// /// \param __a /// A vector of [4 x i32]. The least significant 32 bits are moved to the /// destination. /// \returns A 32-bit signed integer containing the moved value. static __inline__ int __DEFAULT_FN_ATTRS _mm_cvtsi128_si32(__m128i __a) { __v4si __b = (__v4si)__a; return __b[0]; } #ifdef __x86_64__ /// \brief Moves the least significant 64 bits of a vector of [2 x i64] to a /// 64-bit signed integer value. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVQ / MOVQ instruction. /// /// \param __a /// A vector of [2 x i64]. The least significant 64 bits are moved to the /// destination. /// \returns A 64-bit signed integer containing the moved value. static __inline__ long long __DEFAULT_FN_ATTRS _mm_cvtsi128_si64(__m128i __a) { return __a[0]; } #endif # 3533 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/emmintrin.h" 3 /// \brief Moves packed integer values from an aligned 128-bit memory location /// to elements in a 128-bit integer vector. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVDQA / MOVDQA instruction. /// /// \param __p /// An aligned pointer to a memory location containing integer values. /// \returns A 128-bit integer vector containing the moved values. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_load_si128(__m128i const *__p) { return *__p; } /// \brief Moves packed integer values from an unaligned 128-bit memory location /// to elements in a 128-bit integer vector. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVDQU / MOVDQU instruction. /// /// \param __p /// A pointer to a memory location containing integer values. /// \returns A 128-bit integer vector containing the moved values. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_loadu_si128(__m128i const *__p) { struct __loadu_si128 { __m128i __v; } __attribute__((__packed__, __may_alias__)); return ((struct __loadu_si128*)__p)->__v; } /// \brief Returns a vector of [2 x i64] where the lower element is taken from /// the lower element of the operand, and the upper element is zero. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVQ / MOVQ instruction. /// /// \param __p /// A 128-bit vector of [2 x i64]. Bits [63:0] are written to bits [63:0] of /// the destination. /// \returns A 128-bit vector of [2 x i64]. The lower order bits contain the /// moved value. The higher order bits are cleared. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_loadl_epi64(__m128i const *__p) { struct __mm_loadl_epi64_struct { long long __u; } __attribute__((__packed__, __may_alias__)); return (__m128i) { ((struct __mm_loadl_epi64_struct*)__p)->__u, 0}; } /// \brief Generates a 128-bit vector of [4 x i32] with unspecified content. /// This could be used as an argument to another intrinsic function where the /// argument is required but the value is not actually used. /// /// \headerfile /// /// This intrinsic has no corresponding instruction. /// /// \returns A 128-bit vector of [4 x i32] with unspecified content. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_undefined_si128(void) { return (__m128i)__builtin_ia32_undef128(); } /// \brief Initializes both 64-bit values in a 128-bit vector of [2 x i64] with /// the specified 64-bit integer values. /// /// \headerfile /// /// This intrinsic is a utility function and does not correspond to a specific /// instruction. /// /// \param __q1 /// A 64-bit integer value used to initialize the upper 64 bits of the /// destination vector of [2 x i64]. /// \param __q0 /// A 64-bit integer value used to initialize the lower 64 bits of the /// destination vector of [2 x i64]. /// \returns An initialized 128-bit vector of [2 x i64] containing the values /// provided in the operands. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_set_epi64x(long long __q1, long long __q0) { return (__m128i){ __q0, __q1 }; } /// \brief Initializes both 64-bit values in a 128-bit vector of [2 x i64] with /// the specified 64-bit integer values. /// /// \headerfile /// /// This intrinsic is a utility function and does not correspond to a specific /// instruction. /// /// \param __q1 /// A 64-bit integer value used to initialize the upper 64 bits of the /// destination vector of [2 x i64]. /// \param __q0 /// A 64-bit integer value used to initialize the lower 64 bits of the /// destination vector of [2 x i64]. /// \returns An initialized 128-bit vector of [2 x i64] containing the values /// provided in the operands. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_set_epi64(__m64 __q1, __m64 __q0) { return (__m128i){ (long long)__q0, (long long)__q1 }; } /// \brief Initializes the 32-bit values in a 128-bit vector of [4 x i32] with /// the specified 32-bit integer values. /// /// \headerfile /// /// This intrinsic is a utility function and does not correspond to a specific /// instruction. /// /// \param __i3 /// A 32-bit integer value used to initialize bits [127:96] of the /// destination vector. /// \param __i2 /// A 32-bit integer value used to initialize bits [95:64] of the destination /// vector. /// \param __i1 /// A 32-bit integer value used to initialize bits [63:32] of the destination /// vector. /// \param __i0 /// A 32-bit integer value used to initialize bits [31:0] of the destination /// vector. /// \returns An initialized 128-bit vector of [4 x i32] containing the values /// provided in the operands. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_set_epi32(int __i3, int __i2, int __i1, int __i0) { return (__m128i)(__v4si){ __i0, __i1, __i2, __i3}; } /// \brief Initializes the 16-bit values in a 128-bit vector of [8 x i16] with /// the specified 16-bit integer values. /// /// \headerfile /// /// This intrinsic is a utility function and does not correspond to a specific /// instruction. /// /// \param __w7 /// A 16-bit integer value used to initialize bits [127:112] of the /// destination vector. /// \param __w6 /// A 16-bit integer value used to initialize bits [111:96] of the /// destination vector. /// \param __w5 /// A 16-bit integer value used to initialize bits [95:80] of the destination /// vector. /// \param __w4 /// A 16-bit integer value used to initialize bits [79:64] of the destination /// vector. /// \param __w3 /// A 16-bit integer value used to initialize bits [63:48] of the destination /// vector. /// \param __w2 /// A 16-bit integer value used to initialize bits [47:32] of the destination /// vector. /// \param __w1 /// A 16-bit integer value used to initialize bits [31:16] of the destination /// vector. /// \param __w0 /// A 16-bit integer value used to initialize bits [15:0] of the destination /// vector. /// \returns An initialized 128-bit vector of [8 x i16] containing the values /// provided in the operands. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_set_epi16(short __w7, short __w6, short __w5, short __w4, short __w3, short __w2, short __w1, short __w0) { return (__m128i)(__v8hi){ __w0, __w1, __w2, __w3, __w4, __w5, __w6, __w7 }; } /// \brief Initializes the 8-bit values in a 128-bit vector of [16 x i8] with /// the specified 8-bit integer values. /// /// \headerfile /// /// This intrinsic is a utility function and does not correspond to a specific /// instruction. /// /// \param __b15 /// Initializes bits [127:120] of the destination vector. /// \param __b14 /// Initializes bits [119:112] of the destination vector. /// \param __b13 /// Initializes bits [111:104] of the destination vector. /// \param __b12 /// Initializes bits [103:96] of the destination vector. /// \param __b11 /// Initializes bits [95:88] of the destination vector. /// \param __b10 /// Initializes bits [87:80] of the destination vector. /// \param __b9 /// Initializes bits [79:72] of the destination vector. /// \param __b8 /// Initializes bits [71:64] of the destination vector. /// \param __b7 /// Initializes bits [63:56] of the destination vector. /// \param __b6 /// Initializes bits [55:48] of the destination vector. /// \param __b5 /// Initializes bits [47:40] of the destination vector. /// \param __b4 /// Initializes bits [39:32] of the destination vector. /// \param __b3 /// Initializes bits [31:24] of the destination vector. /// \param __b2 /// Initializes bits [23:16] of the destination vector. /// \param __b1 /// Initializes bits [15:8] of the destination vector. /// \param __b0 /// Initializes bits [7:0] of the destination vector. /// \returns An initialized 128-bit vector of [16 x i8] containing the values /// provided in the operands. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_set_epi8(char __b15, char __b14, char __b13, char __b12, char __b11, char __b10, char __b9, char __b8, char __b7, char __b6, char __b5, char __b4, char __b3, char __b2, char __b1, char __b0) { return (__m128i)(__v16qi){ __b0, __b1, __b2, __b3, __b4, __b5, __b6, __b7, __b8, __b9, __b10, __b11, __b12, __b13, __b14, __b15 }; } /// \brief Initializes both values in a 128-bit integer vector with the /// specified 64-bit integer value. /// /// \headerfile /// /// This intrinsic is a utility function and does not correspond to a specific /// instruction. /// /// \param __q /// Integer value used to initialize the elements of the destination integer /// vector. /// \returns An initialized 128-bit integer vector of [2 x i64] with both /// elements containing the value provided in the operand. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_set1_epi64x(long long __q) { return (__m128i){ __q, __q }; } /// \brief Initializes both values in a 128-bit vector of [2 x i64] with the /// specified 64-bit value. /// /// \headerfile /// /// This intrinsic is a utility function and does not correspond to a specific /// instruction. /// /// \param __q /// A 64-bit value used to initialize the elements of the destination integer /// vector. /// \returns An initialized 128-bit vector of [2 x i64] with all elements /// containing the value provided in the operand. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_set1_epi64(__m64 __q) { return (__m128i){ (long long)__q, (long long)__q }; } /// \brief Initializes all values in a 128-bit vector of [4 x i32] with the /// specified 32-bit value. /// /// \headerfile /// /// This intrinsic is a utility function and does not correspond to a specific /// instruction. /// /// \param __i /// A 32-bit value used to initialize the elements of the destination integer /// vector. /// \returns An initialized 128-bit vector of [4 x i32] with all elements /// containing the value provided in the operand. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_set1_epi32(int __i) { return (__m128i)(__v4si){ __i, __i, __i, __i }; } /// \brief Initializes all values in a 128-bit vector of [8 x i16] with the /// specified 16-bit value. /// /// \headerfile /// /// This intrinsic is a utility function and does not correspond to a specific /// instruction. /// /// \param __w /// A 16-bit value used to initialize the elements of the destination integer /// vector. /// \returns An initialized 128-bit vector of [8 x i16] with all elements /// containing the value provided in the operand. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_set1_epi16(short __w) { return (__m128i)(__v8hi){ __w, __w, __w, __w, __w, __w, __w, __w }; } /// \brief Initializes all values in a 128-bit vector of [16 x i8] with the /// specified 8-bit value. /// /// \headerfile /// /// This intrinsic is a utility function and does not correspond to a specific /// instruction. /// /// \param __b /// An 8-bit value used to initialize the elements of the destination integer /// vector. /// \returns An initialized 128-bit vector of [16 x i8] with all elements /// containing the value provided in the operand. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_set1_epi8(char __b) { return (__m128i)(__v16qi){ __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b }; } /// \brief Constructs a 128-bit integer vector, initialized in reverse order /// with the specified 64-bit integral values. /// /// \headerfile /// /// This intrinsic does not correspond to a specific instruction. /// /// \param __q0 /// A 64-bit integral value used to initialize the lower 64 bits of the /// result. /// \param __q1 /// A 64-bit integral value used to initialize the upper 64 bits of the /// result. /// \returns An initialized 128-bit integer vector. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_setr_epi64(__m64 __q0, __m64 __q1) { return (__m128i){ (long long)__q0, (long long)__q1 }; } /// \brief Constructs a 128-bit integer vector, initialized in reverse order /// with the specified 32-bit integral values. /// /// \headerfile /// /// This intrinsic is a utility function and does not correspond to a specific /// instruction. /// /// \param __i0 /// A 32-bit integral value used to initialize bits [31:0] of the result. /// \param __i1 /// A 32-bit integral value used to initialize bits [63:32] of the result. /// \param __i2 /// A 32-bit integral value used to initialize bits [95:64] of the result. /// \param __i3 /// A 32-bit integral value used to initialize bits [127:96] of the result. /// \returns An initialized 128-bit integer vector. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_setr_epi32(int __i0, int __i1, int __i2, int __i3) { return (__m128i)(__v4si){ __i0, __i1, __i2, __i3}; } /// \brief Constructs a 128-bit integer vector, initialized in reverse order /// with the specified 16-bit integral values. /// /// \headerfile /// /// This intrinsic is a utility function and does not correspond to a specific /// instruction. /// /// \param __w0 /// A 16-bit integral value used to initialize bits [15:0] of the result. /// \param __w1 /// A 16-bit integral value used to initialize bits [31:16] of the result. /// \param __w2 /// A 16-bit integral value used to initialize bits [47:32] of the result. /// \param __w3 /// A 16-bit integral value used to initialize bits [63:48] of the result. /// \param __w4 /// A 16-bit integral value used to initialize bits [79:64] of the result. /// \param __w5 /// A 16-bit integral value used to initialize bits [95:80] of the result. /// \param __w6 /// A 16-bit integral value used to initialize bits [111:96] of the result. /// \param __w7 /// A 16-bit integral value used to initialize bits [127:112] of the result. /// \returns An initialized 128-bit integer vector. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_setr_epi16(short __w0, short __w1, short __w2, short __w3, short __w4, short __w5, short __w6, short __w7) { return (__m128i)(__v8hi){ __w0, __w1, __w2, __w3, __w4, __w5, __w6, __w7 }; } /// \brief Constructs a 128-bit integer vector, initialized in reverse order /// with the specified 8-bit integral values. /// /// \headerfile /// /// This intrinsic is a utility function and does not correspond to a specific /// instruction. /// /// \param __b0 /// An 8-bit integral value used to initialize bits [7:0] of the result. /// \param __b1 /// An 8-bit integral value used to initialize bits [15:8] of the result. /// \param __b2 /// An 8-bit integral value used to initialize bits [23:16] of the result. /// \param __b3 /// An 8-bit integral value used to initialize bits [31:24] of the result. /// \param __b4 /// An 8-bit integral value used to initialize bits [39:32] of the result. /// \param __b5 /// An 8-bit integral value used to initialize bits [47:40] of the result. /// \param __b6 /// An 8-bit integral value used to initialize bits [55:48] of the result. /// \param __b7 /// An 8-bit integral value used to initialize bits [63:56] of the result. /// \param __b8 /// An 8-bit integral value used to initialize bits [71:64] of the result. /// \param __b9 /// An 8-bit integral value used to initialize bits [79:72] of the result. /// \param __b10 /// An 8-bit integral value used to initialize bits [87:80] of the result. /// \param __b11 /// An 8-bit integral value used to initialize bits [95:88] of the result. /// \param __b12 /// An 8-bit integral value used to initialize bits [103:96] of the result. /// \param __b13 /// An 8-bit integral value used to initialize bits [111:104] of the result. /// \param __b14 /// An 8-bit integral value used to initialize bits [119:112] of the result. /// \param __b15 /// An 8-bit integral value used to initialize bits [127:120] of the result. /// \returns An initialized 128-bit integer vector. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_setr_epi8(char __b0, char __b1, char __b2, char __b3, char __b4, char __b5, char __b6, char __b7, char __b8, char __b9, char __b10, char __b11, char __b12, char __b13, char __b14, char __b15) { return (__m128i)(__v16qi){ __b0, __b1, __b2, __b3, __b4, __b5, __b6, __b7, __b8, __b9, __b10, __b11, __b12, __b13, __b14, __b15 }; } /// \brief Creates a 128-bit integer vector initialized to zero. /// /// \headerfile /// /// This intrinsic corresponds to the VXORPS / XORPS instruction. /// /// \returns An initialized 128-bit integer vector with all elements set to /// zero. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_setzero_si128(void) { return (__m128i){ 0LL, 0LL }; } /// \brief Stores a 128-bit integer vector to a memory location aligned on a /// 128-bit boundary. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVAPS / MOVAPS instruction. /// /// \param __p /// A pointer to an aligned memory location that will receive the integer /// values. /// \param __b /// A 128-bit integer vector containing the values to be moved. static __inline__ void __DEFAULT_FN_ATTRS _mm_store_si128(__m128i *__p, __m128i __b) { *__p = __b; } /// \brief Stores a 128-bit integer vector to an unaligned memory location. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVUPS / MOVUPS instruction. /// /// \param __p /// A pointer to a memory location that will receive the integer values. /// \param __b /// A 128-bit integer vector containing the values to be moved. static __inline__ void __DEFAULT_FN_ATTRS _mm_storeu_si128(__m128i *__p, __m128i __b) { struct __storeu_si128 { __m128i __v; } __attribute__((__packed__, __may_alias__)); ((struct __storeu_si128*)__p)->__v = __b; } /// \brief Moves bytes selected by the mask from the first operand to the /// specified unaligned memory location. When a mask bit is 1, the /// corresponding byte is written, otherwise it is not written. /// /// To minimize caching, the data is flagged as non-temporal (unlikely to be /// used again soon). Exception and trap behavior for elements not selected /// for storage to memory are implementation dependent. /// /// \headerfile /// /// This intrinsic corresponds to the VMASKMOVDQU / MASKMOVDQU /// instruction. /// /// \param __d /// A 128-bit integer vector containing the values to be moved. /// \param __n /// A 128-bit integer vector containing the mask. The most significant bit of /// each byte represents the mask bits. /// \param __p /// A pointer to an unaligned 128-bit memory location where the specified /// values are moved. static __inline__ void __DEFAULT_FN_ATTRS _mm_maskmoveu_si128(__m128i __d, __m128i __n, char *__p) { __builtin_ia32_maskmovdqu((__v16qi)__d, (__v16qi)__n, __p); } /// \brief Stores the lower 64 bits of a 128-bit integer vector of [2 x i64] to /// a memory location. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVLPS / MOVLPS instruction. /// /// \param __p /// A pointer to a 64-bit memory location that will receive the lower 64 bits /// of the integer vector parameter. /// \param __a /// A 128-bit integer vector of [2 x i64]. The lower 64 bits contain the /// value to be stored. static __inline__ void __DEFAULT_FN_ATTRS _mm_storel_epi64(__m128i *__p, __m128i __a) { struct __mm_storel_epi64_struct { long long __u; } __attribute__((__packed__, __may_alias__)); ((struct __mm_storel_epi64_struct*)__p)->__u = __a[0]; } /// \brief Stores a 128-bit floating point vector of [2 x double] to a 128-bit /// aligned memory location. /// /// To minimize caching, the data is flagged as non-temporal (unlikely to be /// used again soon). /// /// \headerfile /// /// This intrinsic corresponds to the VMOVNTPS / MOVNTPS instruction. /// /// \param __p /// A pointer to the 128-bit aligned memory location used to store the value. /// \param __a /// A vector of [2 x double] containing the 64-bit values to be stored. static __inline__ void __DEFAULT_FN_ATTRS _mm_stream_pd(double *__p, __m128d __a) { __builtin_nontemporal_store((__v2df)__a, (__v2df*)__p); } /// \brief Stores a 128-bit integer vector to a 128-bit aligned memory location. /// /// To minimize caching, the data is flagged as non-temporal (unlikely to be /// used again soon). /// /// \headerfile /// /// This intrinsic corresponds to the VMOVNTPS / MOVNTPS instruction. /// /// \param __p /// A pointer to the 128-bit aligned memory location used to store the value. /// \param __a /// A 128-bit integer vector containing the values to be stored. static __inline__ void __DEFAULT_FN_ATTRS _mm_stream_si128(__m128i *__p, __m128i __a) { __builtin_nontemporal_store((__v2di)__a, (__v2di*)__p); } /// \brief Stores a 32-bit integer value in the specified memory location. /// /// To minimize caching, the data is flagged as non-temporal (unlikely to be /// used again soon). /// /// \headerfile /// /// This intrinsic corresponds to the MOVNTI instruction. /// /// \param __p /// A pointer to the 32-bit memory location used to store the value. /// \param __a /// A 32-bit integer containing the value to be stored. static __inline__ void __DEFAULT_FN_ATTRS _mm_stream_si32(int *__p, int __a) { __builtin_ia32_movnti(__p, __a); } #ifdef __x86_64__ /// \brief Stores a 64-bit integer value in the specified memory location. /// /// To minimize caching, the data is flagged as non-temporal (unlikely to be /// used again soon). /// /// \headerfile /// /// This intrinsic corresponds to the MOVNTIQ instruction. /// /// \param __p /// A pointer to the 64-bit memory location used to store the value. /// \param __a /// A 64-bit integer containing the value to be stored. static __inline__ void __DEFAULT_FN_ATTRS _mm_stream_si64(long long *__p, long long __a) { __builtin_ia32_movnti64(__p, __a); } #endif # 4159 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/emmintrin.h" 3 #if defined(__cplusplus) extern "C" { #endif # 4163 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/emmintrin.h" 3 /// \brief The cache line containing \a __p is flushed and invalidated from all /// caches in the coherency domain. /// /// \headerfile /// /// This intrinsic corresponds to the CLFLUSH instruction. /// /// \param __p /// A pointer to the memory location used to identify the cache line to be /// flushed. void _mm_clflush(void const * __p); /// \brief Forces strong memory ordering (serialization) between load /// instructions preceding this instruction and load instructions following /// this instruction, ensuring the system completes all previous loads before /// executing subsequent loads. /// /// \headerfile /// /// This intrinsic corresponds to the LFENCE instruction. /// void _mm_lfence(void); /// \brief Forces strong memory ordering (serialization) between load and store /// instructions preceding this instruction and load and store instructions /// following this instruction, ensuring that the system completes all /// previous memory accesses before executing subsequent memory accesses. /// /// \headerfile /// /// This intrinsic corresponds to the MFENCE instruction. /// void _mm_mfence(void); #if defined(__cplusplus) } // extern "C" #endif # 4201 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/emmintrin.h" 3 /// \brief Converts 16-bit signed integers from both 128-bit integer vector /// operands into 8-bit signed integers, and packs the results into the /// destination. Positive values greater than 0x7F are saturated to 0x7F. /// Negative values less than 0x80 are saturated to 0x80. /// /// \headerfile /// /// This intrinsic corresponds to the VPACKSSWB / PACKSSWB instruction. /// /// \param __a /// A 128-bit integer vector of [8 x i16]. Each 16-bit element is treated as /// a signed integer and is converted to a 8-bit signed integer with /// saturation. Values greater than 0x7F are saturated to 0x7F. Values less /// than 0x80 are saturated to 0x80. The converted [8 x i8] values are /// written to the lower 64 bits of the result. /// \param __b /// A 128-bit integer vector of [8 x i16]. Each 16-bit element is treated as /// a signed integer and is converted to a 8-bit signed integer with /// saturation. Values greater than 0x7F are saturated to 0x7F. Values less /// than 0x80 are saturated to 0x80. The converted [8 x i8] values are /// written to the higher 64 bits of the result. /// \returns A 128-bit vector of [16 x i8] containing the converted values. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_packs_epi16(__m128i __a, __m128i __b) { return (__m128i)__builtin_ia32_packsswb128((__v8hi)__a, (__v8hi)__b); } /// \brief Converts 32-bit signed integers from both 128-bit integer vector /// operands into 16-bit signed integers, and packs the results into the /// destination. Positive values greater than 0x7FFF are saturated to 0x7FFF. /// Negative values less than 0x8000 are saturated to 0x8000. /// /// \headerfile /// /// This intrinsic corresponds to the VPACKSSDW / PACKSSDW instruction. /// /// \param __a /// A 128-bit integer vector of [4 x i32]. Each 32-bit element is treated as /// a signed integer and is converted to a 16-bit signed integer with /// saturation. Values greater than 0x7FFF are saturated to 0x7FFF. Values /// less than 0x8000 are saturated to 0x8000. The converted [4 x i16] values /// are written to the lower 64 bits of the result. /// \param __b /// A 128-bit integer vector of [4 x i32]. Each 32-bit element is treated as /// a signed integer and is converted to a 16-bit signed integer with /// saturation. Values greater than 0x7FFF are saturated to 0x7FFF. Values /// less than 0x8000 are saturated to 0x8000. The converted [4 x i16] values /// are written to the higher 64 bits of the result. /// \returns A 128-bit vector of [8 x i16] containing the converted values. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_packs_epi32(__m128i __a, __m128i __b) { return (__m128i)__builtin_ia32_packssdw128((__v4si)__a, (__v4si)__b); } /// \brief Converts 16-bit signed integers from both 128-bit integer vector /// operands into 8-bit unsigned integers, and packs the results into the /// destination. Values greater than 0xFF are saturated to 0xFF. Values less /// than 0x00 are saturated to 0x00. /// /// \headerfile /// /// This intrinsic corresponds to the VPACKUSWB / PACKUSWB instruction. /// /// \param __a /// A 128-bit integer vector of [8 x i16]. Each 16-bit element is treated as /// a signed integer and is converted to an 8-bit unsigned integer with /// saturation. Values greater than 0xFF are saturated to 0xFF. Values less /// than 0x00 are saturated to 0x00. The converted [8 x i8] values are /// written to the lower 64 bits of the result. /// \param __b /// A 128-bit integer vector of [8 x i16]. Each 16-bit element is treated as /// a signed integer and is converted to an 8-bit unsigned integer with /// saturation. Values greater than 0xFF are saturated to 0xFF. Values less /// than 0x00 are saturated to 0x00. The converted [8 x i8] values are /// written to the higher 64 bits of the result. /// \returns A 128-bit vector of [16 x i8] containing the converted values. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_packus_epi16(__m128i __a, __m128i __b) { return (__m128i)__builtin_ia32_packuswb128((__v8hi)__a, (__v8hi)__b); } /// \brief Extracts 16 bits from a 128-bit integer vector of [8 x i16], using /// the immediate-value parameter as a selector. /// /// \headerfile /// /// This intrinsic corresponds to the VPEXTRW / PEXTRW instruction. /// /// \param __a /// A 128-bit integer vector. /// \param __imm /// An immediate value. Bits [2:0] selects values from \a __a to be assigned /// to bits[15:0] of the result. \n /// 000: assign values from bits [15:0] of \a __a. \n /// 001: assign values from bits [31:16] of \a __a. \n /// 010: assign values from bits [47:32] of \a __a. \n /// 011: assign values from bits [63:48] of \a __a. \n /// 100: assign values from bits [79:64] of \a __a. \n /// 101: assign values from bits [95:80] of \a __a. \n /// 110: assign values from bits [111:96] of \a __a. \n /// 111: assign values from bits [127:112] of \a __a. /// \returns An integer, whose lower 16 bits are selected from the 128-bit /// integer vector parameter and the remaining bits are assigned zeros. static __inline__ int __DEFAULT_FN_ATTRS _mm_extract_epi16(__m128i __a, int __imm) { __v8hi __b = (__v8hi)__a; return (unsigned short)__b[__imm & 7]; } /// \brief Constructs a 128-bit integer vector by first making a copy of the /// 128-bit integer vector parameter, and then inserting the lower 16 bits /// of an integer parameter into an offset specified by the immediate-value /// parameter. /// /// \headerfile /// /// This intrinsic corresponds to the VPINSRW / PINSRW instruction. /// /// \param __a /// A 128-bit integer vector of [8 x i16]. This vector is copied to the /// result and then one of the eight elements in the result is replaced by /// the lower 16 bits of \a __b. /// \param __b /// An integer. The lower 16 bits of this parameter are written to the /// result beginning at an offset specified by \a __imm. /// \param __imm /// An immediate value specifying the bit offset in the result at which the /// lower 16 bits of \a __b are written. /// \returns A 128-bit integer vector containing the constructed values. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_insert_epi16(__m128i __a, int __b, int __imm) { __v8hi __c = (__v8hi)__a; __c[__imm & 7] = __b; return (__m128i)__c; } /// \brief Copies the values of the most significant bits from each 8-bit /// element in a 128-bit integer vector of [16 x i8] to create a 16-bit mask /// value, zero-extends the value, and writes it to the destination. /// /// \headerfile /// /// This intrinsic corresponds to the VPMOVMSKB / PMOVMSKB instruction. /// /// \param __a /// A 128-bit integer vector containing the values with bits to be extracted. /// \returns The most significant bits from each 8-bit element in \a __a, /// written to bits [15:0]. The other bits are assigned zeros. static __inline__ int __DEFAULT_FN_ATTRS _mm_movemask_epi8(__m128i __a) { return __builtin_ia32_pmovmskb128((__v16qi)__a); } /// \brief Constructs a 128-bit integer vector by shuffling four 32-bit /// elements of a 128-bit integer vector parameter, using the immediate-value /// parameter as a specifier. /// /// \headerfile /// /// \code /// __m128i _mm_shuffle_epi32(__m128i a, const int imm); /// \endcode /// /// This intrinsic corresponds to the VPSHUFD / PSHUFD instruction. /// /// \param a /// A 128-bit integer vector containing the values to be copied. /// \param imm /// An immediate value containing an 8-bit value specifying which elements to /// copy from a. The destinations within the 128-bit destination are assigned /// values as follows: \n /// Bits [1:0] are used to assign values to bits [31:0] of the result. \n /// Bits [3:2] are used to assign values to bits [63:32] of the result. \n /// Bits [5:4] are used to assign values to bits [95:64] of the result. \n /// Bits [7:6] are used to assign values to bits [127:96] of the result. \n /// Bit value assignments: \n /// 00: assign values from bits [31:0] of \a a. \n /// 01: assign values from bits [63:32] of \a a. \n /// 10: assign values from bits [95:64] of \a a. \n /// 11: assign values from bits [127:96] of \a a. /// \returns A 128-bit integer vector containing the shuffled values. #define _mm_shuffle_epi32(a, imm) __extension__ ({ \ (__m128i)__builtin_shufflevector((__v4si)(__m128i)(a), \ (__v4si)_mm_undefined_si128(), \ ((imm) >> 0) & 0x3, ((imm) >> 2) & 0x3, \ ((imm) >> 4) & 0x3, ((imm) >> 6) & 0x3); }) /// \brief Constructs a 128-bit integer vector by shuffling four lower 16-bit /// elements of a 128-bit integer vector of [8 x i16], using the immediate /// value parameter as a specifier. /// /// \headerfile /// /// \code /// __m128i _mm_shufflelo_epi16(__m128i a, const int imm); /// \endcode /// /// This intrinsic corresponds to the VPSHUFLW / PSHUFLW instruction. /// /// \param a /// A 128-bit integer vector of [8 x i16]. Bits [127:64] are copied to bits /// [127:64] of the result. /// \param imm /// An 8-bit immediate value specifying which elements to copy from \a a. \n /// Bits[1:0] are used to assign values to bits [15:0] of the result. \n /// Bits[3:2] are used to assign values to bits [31:16] of the result. \n /// Bits[5:4] are used to assign values to bits [47:32] of the result. \n /// Bits[7:6] are used to assign values to bits [63:48] of the result. \n /// Bit value assignments: \n /// 00: assign values from bits [15:0] of \a a. \n /// 01: assign values from bits [31:16] of \a a. \n /// 10: assign values from bits [47:32] of \a a. \n /// 11: assign values from bits [63:48] of \a a. \n /// \returns A 128-bit integer vector containing the shuffled values. #define _mm_shufflelo_epi16(a, imm) __extension__ ({ \ (__m128i)__builtin_shufflevector((__v8hi)(__m128i)(a), \ (__v8hi)_mm_undefined_si128(), \ ((imm) >> 0) & 0x3, ((imm) >> 2) & 0x3, \ ((imm) >> 4) & 0x3, ((imm) >> 6) & 0x3, \ 4, 5, 6, 7); }) /// \brief Constructs a 128-bit integer vector by shuffling four upper 16-bit /// elements of a 128-bit integer vector of [8 x i16], using the immediate /// value parameter as a specifier. /// /// \headerfile /// /// \code /// __m128i _mm_shufflehi_epi16(__m128i a, const int imm); /// \endcode /// /// This intrinsic corresponds to the VPSHUFHW / PSHUFHW instruction. /// /// \param a /// A 128-bit integer vector of [8 x i16]. Bits [63:0] are copied to bits /// [63:0] of the result. /// \param imm /// An 8-bit immediate value specifying which elements to copy from \a a. \n /// Bits[1:0] are used to assign values to bits [79:64] of the result. \n /// Bits[3:2] are used to assign values to bits [95:80] of the result. \n /// Bits[5:4] are used to assign values to bits [111:96] of the result. \n /// Bits[7:6] are used to assign values to bits [127:112] of the result. \n /// Bit value assignments: \n /// 00: assign values from bits [79:64] of \a a. \n /// 01: assign values from bits [95:80] of \a a. \n /// 10: assign values from bits [111:96] of \a a. \n /// 11: assign values from bits [127:112] of \a a. \n /// \returns A 128-bit integer vector containing the shuffled values. #define _mm_shufflehi_epi16(a, imm) __extension__ ({ \ (__m128i)__builtin_shufflevector((__v8hi)(__m128i)(a), \ (__v8hi)_mm_undefined_si128(), \ 0, 1, 2, 3, \ 4 + (((imm) >> 0) & 0x3), \ 4 + (((imm) >> 2) & 0x3), \ 4 + (((imm) >> 4) & 0x3), \ 4 + (((imm) >> 6) & 0x3)); }) /// \brief Unpacks the high-order (index 8-15) values from two 128-bit vectors /// of [16 x i8] and interleaves them into a 128-bit vector of [16 x i8]. /// /// \headerfile /// /// This intrinsic corresponds to the VPUNPCKHBW / PUNPCKHBW /// instruction. /// /// \param __a /// A 128-bit vector of [16 x i8]. /// Bits [71:64] are written to bits [7:0] of the result. \n /// Bits [79:72] are written to bits [23:16] of the result. \n /// Bits [87:80] are written to bits [39:32] of the result. \n /// Bits [95:88] are written to bits [55:48] of the result. \n /// Bits [103:96] are written to bits [71:64] of the result. \n /// Bits [111:104] are written to bits [87:80] of the result. \n /// Bits [119:112] are written to bits [103:96] of the result. \n /// Bits [127:120] are written to bits [119:112] of the result. /// \param __b /// A 128-bit vector of [16 x i8]. \n /// Bits [71:64] are written to bits [15:8] of the result. \n /// Bits [79:72] are written to bits [31:24] of the result. \n /// Bits [87:80] are written to bits [47:40] of the result. \n /// Bits [95:88] are written to bits [63:56] of the result. \n /// Bits [103:96] are written to bits [79:72] of the result. \n /// Bits [111:104] are written to bits [95:88] of the result. \n /// Bits [119:112] are written to bits [111:104] of the result. \n /// Bits [127:120] are written to bits [127:120] of the result. /// \returns A 128-bit vector of [16 x i8] containing the interleaved values. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_unpackhi_epi8(__m128i __a, __m128i __b) { return (__m128i)__builtin_shufflevector((__v16qi)__a, (__v16qi)__b, 8, 16+8, 9, 16+9, 10, 16+10, 11, 16+11, 12, 16+12, 13, 16+13, 14, 16+14, 15, 16+15); } /// \brief Unpacks the high-order (index 4-7) values from two 128-bit vectors of /// [8 x i16] and interleaves them into a 128-bit vector of [8 x i16]. /// /// \headerfile /// /// This intrinsic corresponds to the VPUNPCKHWD / PUNPCKHWD /// instruction. /// /// \param __a /// A 128-bit vector of [8 x i16]. /// Bits [79:64] are written to bits [15:0] of the result. \n /// Bits [95:80] are written to bits [47:32] of the result. \n /// Bits [111:96] are written to bits [79:64] of the result. \n /// Bits [127:112] are written to bits [111:96] of the result. /// \param __b /// A 128-bit vector of [8 x i16]. /// Bits [79:64] are written to bits [31:16] of the result. \n /// Bits [95:80] are written to bits [63:48] of the result. \n /// Bits [111:96] are written to bits [95:80] of the result. \n /// Bits [127:112] are written to bits [127:112] of the result. /// \returns A 128-bit vector of [8 x i16] containing the interleaved values. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_unpackhi_epi16(__m128i __a, __m128i __b) { return (__m128i)__builtin_shufflevector((__v8hi)__a, (__v8hi)__b, 4, 8+4, 5, 8+5, 6, 8+6, 7, 8+7); } /// \brief Unpacks the high-order (index 2,3) values from two 128-bit vectors of /// [4 x i32] and interleaves them into a 128-bit vector of [4 x i32]. /// /// \headerfile /// /// This intrinsic corresponds to the VPUNPCKHDQ / PUNPCKHDQ /// instruction. /// /// \param __a /// A 128-bit vector of [4 x i32]. \n /// Bits [95:64] are written to bits [31:0] of the destination. \n /// Bits [127:96] are written to bits [95:64] of the destination. /// \param __b /// A 128-bit vector of [4 x i32]. \n /// Bits [95:64] are written to bits [64:32] of the destination. \n /// Bits [127:96] are written to bits [127:96] of the destination. /// \returns A 128-bit vector of [4 x i32] containing the interleaved values. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_unpackhi_epi32(__m128i __a, __m128i __b) { return (__m128i)__builtin_shufflevector((__v4si)__a, (__v4si)__b, 2, 4+2, 3, 4+3); } /// \brief Unpacks the high-order 64-bit elements from two 128-bit vectors of /// [2 x i64] and interleaves them into a 128-bit vector of [2 x i64]. /// /// \headerfile /// /// This intrinsic corresponds to the VPUNPCKHQDQ / PUNPCKHQDQ /// instruction. /// /// \param __a /// A 128-bit vector of [2 x i64]. \n /// Bits [127:64] are written to bits [63:0] of the destination. /// \param __b /// A 128-bit vector of [2 x i64]. \n /// Bits [127:64] are written to bits [127:64] of the destination. /// \returns A 128-bit vector of [2 x i64] containing the interleaved values. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_unpackhi_epi64(__m128i __a, __m128i __b) { return (__m128i)__builtin_shufflevector((__v2di)__a, (__v2di)__b, 1, 2+1); } /// \brief Unpacks the low-order (index 0-7) values from two 128-bit vectors of /// [16 x i8] and interleaves them into a 128-bit vector of [16 x i8]. /// /// \headerfile /// /// This intrinsic corresponds to the VPUNPCKLBW / PUNPCKLBW /// instruction. /// /// \param __a /// A 128-bit vector of [16 x i8]. \n /// Bits [7:0] are written to bits [7:0] of the result. \n /// Bits [15:8] are written to bits [23:16] of the result. \n /// Bits [23:16] are written to bits [39:32] of the result. \n /// Bits [31:24] are written to bits [55:48] of the result. \n /// Bits [39:32] are written to bits [71:64] of the result. \n /// Bits [47:40] are written to bits [87:80] of the result. \n /// Bits [55:48] are written to bits [103:96] of the result. \n /// Bits [63:56] are written to bits [119:112] of the result. /// \param __b /// A 128-bit vector of [16 x i8]. /// Bits [7:0] are written to bits [15:8] of the result. \n /// Bits [15:8] are written to bits [31:24] of the result. \n /// Bits [23:16] are written to bits [47:40] of the result. \n /// Bits [31:24] are written to bits [63:56] of the result. \n /// Bits [39:32] are written to bits [79:72] of the result. \n /// Bits [47:40] are written to bits [95:88] of the result. \n /// Bits [55:48] are written to bits [111:104] of the result. \n /// Bits [63:56] are written to bits [127:120] of the result. /// \returns A 128-bit vector of [16 x i8] containing the interleaved values. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_unpacklo_epi8(__m128i __a, __m128i __b) { return (__m128i)__builtin_shufflevector((__v16qi)__a, (__v16qi)__b, 0, 16+0, 1, 16+1, 2, 16+2, 3, 16+3, 4, 16+4, 5, 16+5, 6, 16+6, 7, 16+7); } /// \brief Unpacks the low-order (index 0-3) values from each of the two 128-bit /// vectors of [8 x i16] and interleaves them into a 128-bit vector of /// [8 x i16]. /// /// \headerfile /// /// This intrinsic corresponds to the VPUNPCKLWD / PUNPCKLWD /// instruction. /// /// \param __a /// A 128-bit vector of [8 x i16]. /// Bits [15:0] are written to bits [15:0] of the result. \n /// Bits [31:16] are written to bits [47:32] of the result. \n /// Bits [47:32] are written to bits [79:64] of the result. \n /// Bits [63:48] are written to bits [111:96] of the result. /// \param __b /// A 128-bit vector of [8 x i16]. /// Bits [15:0] are written to bits [31:16] of the result. \n /// Bits [31:16] are written to bits [63:48] of the result. \n /// Bits [47:32] are written to bits [95:80] of the result. \n /// Bits [63:48] are written to bits [127:112] of the result. /// \returns A 128-bit vector of [8 x i16] containing the interleaved values. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_unpacklo_epi16(__m128i __a, __m128i __b) { return (__m128i)__builtin_shufflevector((__v8hi)__a, (__v8hi)__b, 0, 8+0, 1, 8+1, 2, 8+2, 3, 8+3); } /// \brief Unpacks the low-order (index 0,1) values from two 128-bit vectors of /// [4 x i32] and interleaves them into a 128-bit vector of [4 x i32]. /// /// \headerfile /// /// This intrinsic corresponds to the VPUNPCKLDQ / PUNPCKLDQ /// instruction. /// /// \param __a /// A 128-bit vector of [4 x i32]. \n /// Bits [31:0] are written to bits [31:0] of the destination. \n /// Bits [63:32] are written to bits [95:64] of the destination. /// \param __b /// A 128-bit vector of [4 x i32]. \n /// Bits [31:0] are written to bits [64:32] of the destination. \n /// Bits [63:32] are written to bits [127:96] of the destination. /// \returns A 128-bit vector of [4 x i32] containing the interleaved values. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_unpacklo_epi32(__m128i __a, __m128i __b) { return (__m128i)__builtin_shufflevector((__v4si)__a, (__v4si)__b, 0, 4+0, 1, 4+1); } /// \brief Unpacks the low-order 64-bit elements from two 128-bit vectors of /// [2 x i64] and interleaves them into a 128-bit vector of [2 x i64]. /// /// \headerfile /// /// This intrinsic corresponds to the VPUNPCKLQDQ / PUNPCKLQDQ /// instruction. /// /// \param __a /// A 128-bit vector of [2 x i64]. \n /// Bits [63:0] are written to bits [63:0] of the destination. \n /// \param __b /// A 128-bit vector of [2 x i64]. \n /// Bits [63:0] are written to bits [127:64] of the destination. \n /// \returns A 128-bit vector of [2 x i64] containing the interleaved values. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_unpacklo_epi64(__m128i __a, __m128i __b) { return (__m128i)__builtin_shufflevector((__v2di)__a, (__v2di)__b, 0, 2+0); } /// \brief Returns the lower 64 bits of a 128-bit integer vector as a 64-bit /// integer. /// /// \headerfile /// /// This intrinsic corresponds to the MOVDQ2Q instruction. /// /// \param __a /// A 128-bit integer vector operand. The lower 64 bits are moved to the /// destination. /// \returns A 64-bit integer containing the lower 64 bits of the parameter. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_movepi64_pi64(__m128i __a) { return (__m64)__a[0]; } /// \brief Moves the 64-bit operand to a 128-bit integer vector, zeroing the /// upper bits. /// /// \headerfile /// /// This intrinsic corresponds to the MOVD+VMOVQ instruction. /// /// \param __a /// A 64-bit value. /// \returns A 128-bit integer vector. The lower 64 bits contain the value from /// the operand. The upper 64 bits are assigned zeros. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_movpi64_epi64(__m64 __a) { return (__m128i){ (long long)__a, 0 }; } /// \brief Moves the lower 64 bits of a 128-bit integer vector to a 128-bit /// integer vector, zeroing the upper bits. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVQ / MOVQ instruction. /// /// \param __a /// A 128-bit integer vector operand. The lower 64 bits are moved to the /// destination. /// \returns A 128-bit integer vector. The lower 64 bits contain the value from /// the operand. The upper 64 bits are assigned zeros. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_move_epi64(__m128i __a) { return __builtin_shufflevector((__v2di)__a, (__m128i){ 0 }, 0, 2); } /// \brief Unpacks the high-order 64-bit elements from two 128-bit vectors of /// [2 x double] and interleaves them into a 128-bit vector of [2 x /// double]. /// /// \headerfile /// /// This intrinsic corresponds to the VUNPCKHPD / UNPCKHPD instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. \n /// Bits [127:64] are written to bits [63:0] of the destination. /// \param __b /// A 128-bit vector of [2 x double]. \n /// Bits [127:64] are written to bits [127:64] of the destination. /// \returns A 128-bit vector of [2 x double] containing the interleaved values. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_unpackhi_pd(__m128d __a, __m128d __b) { return __builtin_shufflevector((__v2df)__a, (__v2df)__b, 1, 2+1); } /// \brief Unpacks the low-order 64-bit elements from two 128-bit vectors /// of [2 x double] and interleaves them into a 128-bit vector of [2 x /// double]. /// /// \headerfile /// /// This intrinsic corresponds to the VUNPCKLPD / UNPCKLPD instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. \n /// Bits [63:0] are written to bits [63:0] of the destination. /// \param __b /// A 128-bit vector of [2 x double]. \n /// Bits [63:0] are written to bits [127:64] of the destination. /// \returns A 128-bit vector of [2 x double] containing the interleaved values. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_unpacklo_pd(__m128d __a, __m128d __b) { return __builtin_shufflevector((__v2df)__a, (__v2df)__b, 0, 2+0); } /// \brief Extracts the sign bits of the double-precision values in the 128-bit /// vector of [2 x double], zero-extends the value, and writes it to the /// low-order bits of the destination. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVMSKPD / MOVMSKPD instruction. /// /// \param __a /// A 128-bit vector of [2 x double] containing the values with sign bits to /// be extracted. /// \returns The sign bits from each of the double-precision elements in \a __a, /// written to bits [1:0]. The remaining bits are assigned values of zero. static __inline__ int __DEFAULT_FN_ATTRS _mm_movemask_pd(__m128d __a) { return __builtin_ia32_movmskpd((__v2df)__a); } /// \brief Constructs a 128-bit floating-point vector of [2 x double] from two /// 128-bit vector parameters of [2 x double], using the immediate-value /// parameter as a specifier. /// /// \headerfile /// /// \code /// __m128d _mm_shuffle_pd(__m128d a, __m128d b, const int i); /// \endcode /// /// This intrinsic corresponds to the VSHUFPD / SHUFPD instruction. /// /// \param a /// A 128-bit vector of [2 x double]. /// \param b /// A 128-bit vector of [2 x double]. /// \param i /// An 8-bit immediate value. The least significant two bits specify which /// elements to copy from \a a and \a b: \n /// Bit[0] = 0: lower element of \a a copied to lower element of result. \n /// Bit[0] = 1: upper element of \a a copied to lower element of result. \n /// Bit[1] = 0: lower element of \a b copied to upper element of result. \n /// Bit[1] = 1: upper element of \a b copied to upper element of result. \n /// \returns A 128-bit vector of [2 x double] containing the shuffled values. #define _mm_shuffle_pd(a, b, i) __extension__ ({ \ (__m128d)__builtin_shufflevector((__v2df)(__m128d)(a), (__v2df)(__m128d)(b), \ 0 + (((i) >> 0) & 0x1), \ 2 + (((i) >> 1) & 0x1)); }) /// \brief Casts a 128-bit floating-point vector of [2 x double] into a 128-bit /// floating-point vector of [4 x float]. /// /// \headerfile /// /// This intrinsic has no corresponding instruction. /// /// \param __a /// A 128-bit floating-point vector of [2 x double]. /// \returns A 128-bit floating-point vector of [4 x float] containing the same /// bitwise pattern as the parameter. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_castpd_ps(__m128d __a) { return (__m128)__a; } /// \brief Casts a 128-bit floating-point vector of [2 x double] into a 128-bit /// integer vector. /// /// \headerfile /// /// This intrinsic has no corresponding instruction. /// /// \param __a /// A 128-bit floating-point vector of [2 x double]. /// \returns A 128-bit integer vector containing the same bitwise pattern as the /// parameter. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_castpd_si128(__m128d __a) { return (__m128i)__a; } /// \brief Casts a 128-bit floating-point vector of [4 x float] into a 128-bit /// floating-point vector of [2 x double]. /// /// \headerfile /// /// This intrinsic has no corresponding instruction. /// /// \param __a /// A 128-bit floating-point vector of [4 x float]. /// \returns A 128-bit floating-point vector of [2 x double] containing the same /// bitwise pattern as the parameter. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_castps_pd(__m128 __a) { return (__m128d)__a; } /// \brief Casts a 128-bit floating-point vector of [4 x float] into a 128-bit /// integer vector. /// /// \headerfile /// /// This intrinsic has no corresponding instruction. /// /// \param __a /// A 128-bit floating-point vector of [4 x float]. /// \returns A 128-bit integer vector containing the same bitwise pattern as the /// parameter. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_castps_si128(__m128 __a) { return (__m128i)__a; } /// \brief Casts a 128-bit integer vector into a 128-bit floating-point vector /// of [4 x float]. /// /// \headerfile /// /// This intrinsic has no corresponding instruction. /// /// \param __a /// A 128-bit integer vector. /// \returns A 128-bit floating-point vector of [4 x float] containing the same /// bitwise pattern as the parameter. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_castsi128_ps(__m128i __a) { return (__m128)__a; } /// \brief Casts a 128-bit integer vector into a 128-bit floating-point vector /// of [2 x double]. /// /// \headerfile /// /// This intrinsic has no corresponding instruction. /// /// \param __a /// A 128-bit integer vector. /// \returns A 128-bit floating-point vector of [2 x double] containing the same /// bitwise pattern as the parameter. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_castsi128_pd(__m128i __a) { return (__m128d)__a; } #if defined(__cplusplus) extern "C" { #endif # 4926 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/emmintrin.h" 3 /// \brief Indicates that a spin loop is being executed for the purposes of /// optimizing power consumption during the loop. /// /// \headerfile /// /// This intrinsic corresponds to the PAUSE instruction. /// void _mm_pause(void); #if defined(__cplusplus) } // extern "C" #endif # 4939 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/emmintrin.h" 3 #undef __DEFAULT_FN_ATTRS #define _MM_SHUFFLE2(x, y) (((x) << 1) | (y)) #define _MM_DENORMALS_ZERO_ON (0x0040) #define _MM_DENORMALS_ZERO_OFF (0x0000) #define _MM_DENORMALS_ZERO_MASK (0x0040) #define _MM_GET_DENORMALS_ZERO_MODE() (_mm_getcsr() & _MM_DENORMALS_ZERO_MASK) #define _MM_SET_DENORMALS_ZERO_MODE(x) (_mm_setcsr((_mm_getcsr() & ~_MM_DENORMALS_ZERO_MASK) | (x))) #endif /* __EMMINTRIN_H */ # 4952 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/emmintrin.h" 3 # 2970 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xmmintrin.h" 2 3 #endif # 2971 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xmmintrin.h" 3 #endif /* __XMMINTRIN_H */ # 2973 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xmmintrin.h" 3 # 33 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 2 3 #endif # 34 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || defined(__SSE2__) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 36 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 # 37 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 #endif # 38 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || defined(__SSE3__) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 40 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/pmmintrin.h" 1 3 /*===---- pmmintrin.h - SSE3 intrinsics ------------------------------------=== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __PMMINTRIN_H #define __PMMINTRIN_H #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/pmmintrin.h" 3 # 28 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/pmmintrin.h" 3 /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS \ __attribute__((__always_inline__, __nodebug__, __target__("sse3"))) /// \brief Loads data from an unaligned memory location to elements in a 128-bit /// vector. /// /// If the address of the data is not 16-byte aligned, the instruction may /// read two adjacent aligned blocks of memory to retrieve the requested /// data. /// /// \headerfile /// /// This intrinsic corresponds to the VLDDQU instruction. /// /// \param __p /// A pointer to a 128-bit integer vector containing integer values. /// \returns A 128-bit vector containing the moved values. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_lddqu_si128(__m128i const *__p) { return (__m128i)__builtin_ia32_lddqu((char const *)__p); } /// \brief Adds the even-indexed values and subtracts the odd-indexed values of /// two 128-bit vectors of [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VADDSUBPS instruction. /// /// \param __a /// A 128-bit vector of [4 x float] containing the left source operand. /// \param __b /// A 128-bit vector of [4 x float] containing the right source operand. /// \returns A 128-bit vector of [4 x float] containing the alternating sums and /// differences of both operands. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_addsub_ps(__m128 __a, __m128 __b) { return __builtin_ia32_addsubps((__v4sf)__a, (__v4sf)__b); } /// \brief Horizontally adds the adjacent pairs of values contained in two /// 128-bit vectors of [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VHADDPS instruction. /// /// \param __a /// A 128-bit vector of [4 x float] containing one of the source operands. /// The horizontal sums of the values are stored in the lower bits of the /// destination. /// \param __b /// A 128-bit vector of [4 x float] containing one of the source operands. /// The horizontal sums of the values are stored in the upper bits of the /// destination. /// \returns A 128-bit vector of [4 x float] containing the horizontal sums of /// both operands. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_hadd_ps(__m128 __a, __m128 __b) { return __builtin_ia32_haddps((__v4sf)__a, (__v4sf)__b); } /// \brief Horizontally subtracts the adjacent pairs of values contained in two /// 128-bit vectors of [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VHSUBPS instruction. /// /// \param __a /// A 128-bit vector of [4 x float] containing one of the source operands. /// The horizontal differences between the values are stored in the lower /// bits of the destination. /// \param __b /// A 128-bit vector of [4 x float] containing one of the source operands. /// The horizontal differences between the values are stored in the upper /// bits of the destination. /// \returns A 128-bit vector of [4 x float] containing the horizontal /// differences of both operands. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_hsub_ps(__m128 __a, __m128 __b) { return __builtin_ia32_hsubps((__v4sf)__a, (__v4sf)__b); } /// \brief Moves and duplicates odd-indexed values from a 128-bit vector /// of [4 x float] to float values stored in a 128-bit vector of /// [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVSHDUP instruction. /// /// \param __a /// A 128-bit vector of [4 x float]. \n /// Bits [127:96] of the source are written to bits [127:96] and [95:64] of /// the destination. \n /// Bits [63:32] of the source are written to bits [63:32] and [31:0] of the /// destination. /// \returns A 128-bit vector of [4 x float] containing the moved and duplicated /// values. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_movehdup_ps(__m128 __a) { return __builtin_shufflevector((__v4sf)__a, (__v4sf)__a, 1, 1, 3, 3); } /// \brief Duplicates even-indexed values from a 128-bit vector of /// [4 x float] to float values stored in a 128-bit vector of [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVSLDUP instruction. /// /// \param __a /// A 128-bit vector of [4 x float] \n /// Bits [95:64] of the source are written to bits [127:96] and [95:64] of /// the destination. \n /// Bits [31:0] of the source are written to bits [63:32] and [31:0] of the /// destination. /// \returns A 128-bit vector of [4 x float] containing the moved and duplicated /// values. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_moveldup_ps(__m128 __a) { return __builtin_shufflevector((__v4sf)__a, (__v4sf)__a, 0, 0, 2, 2); } /// \brief Adds the even-indexed values and subtracts the odd-indexed values of /// two 128-bit vectors of [2 x double]. /// /// \headerfile /// /// This intrinsic corresponds to the VADDSUBPD instruction. /// /// \param __a /// A 128-bit vector of [2 x double] containing the left source operand. /// \param __b /// A 128-bit vector of [2 x double] containing the right source operand. /// \returns A 128-bit vector of [2 x double] containing the alternating sums /// and differences of both operands. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_addsub_pd(__m128d __a, __m128d __b) { return __builtin_ia32_addsubpd((__v2df)__a, (__v2df)__b); } /// \brief Horizontally adds the pairs of values contained in two 128-bit /// vectors of [2 x double]. /// /// \headerfile /// /// This intrinsic corresponds to the VHADDPD instruction. /// /// \param __a /// A 128-bit vector of [2 x double] containing one of the source operands. /// The horizontal sum of the values is stored in the lower bits of the /// destination. /// \param __b /// A 128-bit vector of [2 x double] containing one of the source operands. /// The horizontal sum of the values is stored in the upper bits of the /// destination. /// \returns A 128-bit vector of [2 x double] containing the horizontal sums of /// both operands. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_hadd_pd(__m128d __a, __m128d __b) { return __builtin_ia32_haddpd((__v2df)__a, (__v2df)__b); } /// \brief Horizontally subtracts the pairs of values contained in two 128-bit /// vectors of [2 x double]. /// /// \headerfile /// /// This intrinsic corresponds to the VHSUBPD instruction. /// /// \param __a /// A 128-bit vector of [2 x double] containing one of the source operands. /// The horizontal difference of the values is stored in the lower bits of /// the destination. /// \param __b /// A 128-bit vector of [2 x double] containing one of the source operands. /// The horizontal difference of the values is stored in the upper bits of /// the destination. /// \returns A 128-bit vector of [2 x double] containing the horizontal /// differences of both operands. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_hsub_pd(__m128d __a, __m128d __b) { return __builtin_ia32_hsubpd((__v2df)__a, (__v2df)__b); } /// \brief Moves and duplicates one double-precision value to double-precision /// values stored in a 128-bit vector of [2 x double]. /// /// \headerfile /// /// \code /// __m128d _mm_loaddup_pd(double const * dp); /// \endcode /// /// This intrinsic corresponds to the VMOVDDUP instruction. /// /// \param dp /// A pointer to a double-precision value to be moved and duplicated. /// \returns A 128-bit vector of [2 x double] containing the moved and /// duplicated values. #define _mm_loaddup_pd(dp) _mm_load1_pd(dp) /// \brief Moves and duplicates the double-precision value in the lower bits of /// a 128-bit vector of [2 x double] to double-precision values stored in a /// 128-bit vector of [2 x double]. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVDDUP instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. Bits [63:0] are written to bits /// [127:64] and [63:0] of the destination. /// \returns A 128-bit vector of [2 x double] containing the moved and /// duplicated values. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_movedup_pd(__m128d __a) { return __builtin_shufflevector((__v2df)__a, (__v2df)__a, 0, 0); } /// \brief Establishes a linear address memory range to be monitored and puts /// the processor in the monitor event pending state. Data stored in the /// monitored address range causes the processor to exit the pending state. /// /// \headerfile /// /// This intrinsic corresponds to the MONITOR instruction. /// /// \param __p /// The memory range to be monitored. The size of the range is determined by /// CPUID function 0000_0005h. /// \param __extensions /// Optional extensions for the monitoring state. /// \param __hints /// Optional hints for the monitoring state. static __inline__ void __DEFAULT_FN_ATTRS _mm_monitor(void const *__p, unsigned __extensions, unsigned __hints) { __builtin_ia32_monitor((void *)__p, __extensions, __hints); } /// \brief Used with the MONITOR instruction to wait while the processor is in /// the monitor event pending state. Data stored in the monitored address /// range causes the processor to exit the pending state. /// /// \headerfile /// /// This intrinsic corresponds to the MWAIT instruction. /// /// \param __extensions /// Optional extensions for the monitoring state, which may vary by /// processor. /// \param __hints /// Optional hints for the monitoring state, which may vary by processor. static __inline__ void __DEFAULT_FN_ATTRS _mm_mwait(unsigned __extensions, unsigned __hints) { __builtin_ia32_mwait(__extensions, __hints); } #undef __DEFAULT_FN_ATTRS #endif /* __PMMINTRIN_H */ # 305 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/pmmintrin.h" 3 # 41 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 2 3 #endif # 42 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || defined(__SSSE3__) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 44 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/tmmintrin.h" 1 3 /*===---- tmmintrin.h - SSSE3 intrinsics -----------------------------------=== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __TMMINTRIN_H #define __TMMINTRIN_H #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/tmmintrin.h" 3 # 28 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/tmmintrin.h" 3 /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("ssse3"))) /// \brief Computes the absolute value of each of the packed 8-bit signed /// integers in the source operand and stores the 8-bit unsigned integer /// results in the destination. /// /// \headerfile /// /// This intrinsic corresponds to the \c PABSB instruction. /// /// \param __a /// A 64-bit vector of [8 x i8]. /// \returns A 64-bit integer vector containing the absolute values of the /// elements in the operand. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_abs_pi8(__m64 __a) { return (__m64)__builtin_ia32_pabsb((__v8qi)__a); } /// \brief Computes the absolute value of each of the packed 8-bit signed /// integers in the source operand and stores the 8-bit unsigned integer /// results in the destination. /// /// \headerfile /// /// This intrinsic corresponds to the \c VPABSB instruction. /// /// \param __a /// A 128-bit vector of [16 x i8]. /// \returns A 128-bit integer vector containing the absolute values of the /// elements in the operand. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_abs_epi8(__m128i __a) { return (__m128i)__builtin_ia32_pabsb128((__v16qi)__a); } /// \brief Computes the absolute value of each of the packed 16-bit signed /// integers in the source operand and stores the 16-bit unsigned integer /// results in the destination. /// /// \headerfile /// /// This intrinsic corresponds to the \c PABSW instruction. /// /// \param __a /// A 64-bit vector of [4 x i16]. /// \returns A 64-bit integer vector containing the absolute values of the /// elements in the operand. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_abs_pi16(__m64 __a) { return (__m64)__builtin_ia32_pabsw((__v4hi)__a); } /// \brief Computes the absolute value of each of the packed 16-bit signed /// integers in the source operand and stores the 16-bit unsigned integer /// results in the destination. /// /// \headerfile /// /// This intrinsic corresponds to the \c VPABSW instruction. /// /// \param __a /// A 128-bit vector of [8 x i16]. /// \returns A 128-bit integer vector containing the absolute values of the /// elements in the operand. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_abs_epi16(__m128i __a) { return (__m128i)__builtin_ia32_pabsw128((__v8hi)__a); } /// \brief Computes the absolute value of each of the packed 32-bit signed /// integers in the source operand and stores the 32-bit unsigned integer /// results in the destination. /// /// \headerfile /// /// This intrinsic corresponds to the \c PABSD instruction. /// /// \param __a /// A 64-bit vector of [2 x i32]. /// \returns A 64-bit integer vector containing the absolute values of the /// elements in the operand. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_abs_pi32(__m64 __a) { return (__m64)__builtin_ia32_pabsd((__v2si)__a); } /// \brief Computes the absolute value of each of the packed 32-bit signed /// integers in the source operand and stores the 32-bit unsigned integer /// results in the destination. /// /// \headerfile /// /// This intrinsic corresponds to the \c VPABSD instruction. /// /// \param __a /// A 128-bit vector of [4 x i32]. /// \returns A 128-bit integer vector containing the absolute values of the /// elements in the operand. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_abs_epi32(__m128i __a) { return (__m128i)__builtin_ia32_pabsd128((__v4si)__a); } /// \brief Concatenates the two 128-bit integer vector operands, and /// right-shifts the result by the number of bytes specified in the immediate /// operand. /// /// \headerfile /// /// \code /// __m128i _mm_alignr_epi8(__m128i a, __m128i b, const int n); /// \endcode /// /// This intrinsic corresponds to the \c PALIGNR instruction. /// /// \param a /// A 128-bit vector of [16 x i8] containing one of the source operands. /// \param b /// A 128-bit vector of [16 x i8] containing one of the source operands. /// \param n /// An immediate operand specifying how many bytes to right-shift the result. /// \returns A 128-bit integer vector containing the concatenated right-shifted /// value. #define _mm_alignr_epi8(a, b, n) __extension__ ({ \ (__m128i)__builtin_ia32_palignr128((__v16qi)(__m128i)(a), \ (__v16qi)(__m128i)(b), (n)); }) /// \brief Concatenates the two 64-bit integer vector operands, and right-shifts /// the result by the number of bytes specified in the immediate operand. /// /// \headerfile /// /// \code /// __m64 _mm_alignr_pi8(__m64 a, __m64 b, const int n); /// \endcode /// /// This intrinsic corresponds to the \c PALIGNR instruction. /// /// \param a /// A 64-bit vector of [8 x i8] containing one of the source operands. /// \param b /// A 64-bit vector of [8 x i8] containing one of the source operands. /// \param n /// An immediate operand specifying how many bytes to right-shift the result. /// \returns A 64-bit integer vector containing the concatenated right-shifted /// value. #define _mm_alignr_pi8(a, b, n) __extension__ ({ \ (__m64)__builtin_ia32_palignr((__v8qi)(__m64)(a), (__v8qi)(__m64)(b), (n)); }) /// \brief Horizontally adds the adjacent pairs of values contained in 2 packed /// 128-bit vectors of [8 x i16]. /// /// \headerfile /// /// This intrinsic corresponds to the \c VPHADDW instruction. /// /// \param __a /// A 128-bit vector of [8 x i16] containing one of the source operands. The /// horizontal sums of the values are stored in the lower bits of the /// destination. /// \param __b /// A 128-bit vector of [8 x i16] containing one of the source operands. The /// horizontal sums of the values are stored in the upper bits of the /// destination. /// \returns A 128-bit vector of [8 x i16] containing the horizontal sums of /// both operands. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_hadd_epi16(__m128i __a, __m128i __b) { return (__m128i)__builtin_ia32_phaddw128((__v8hi)__a, (__v8hi)__b); } /// \brief Horizontally adds the adjacent pairs of values contained in 2 packed /// 128-bit vectors of [4 x i32]. /// /// \headerfile /// /// This intrinsic corresponds to the \c VPHADDD instruction. /// /// \param __a /// A 128-bit vector of [4 x i32] containing one of the source operands. The /// horizontal sums of the values are stored in the lower bits of the /// destination. /// \param __b /// A 128-bit vector of [4 x i32] containing one of the source operands. The /// horizontal sums of the values are stored in the upper bits of the /// destination. /// \returns A 128-bit vector of [4 x i32] containing the horizontal sums of /// both operands. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_hadd_epi32(__m128i __a, __m128i __b) { return (__m128i)__builtin_ia32_phaddd128((__v4si)__a, (__v4si)__b); } /// \brief Horizontally adds the adjacent pairs of values contained in 2 packed /// 64-bit vectors of [4 x i16]. /// /// \headerfile /// /// This intrinsic corresponds to the \c PHADDW instruction. /// /// \param __a /// A 64-bit vector of [4 x i16] containing one of the source operands. The /// horizontal sums of the values are stored in the lower bits of the /// destination. /// \param __b /// A 64-bit vector of [4 x i16] containing one of the source operands. The /// horizontal sums of the values are stored in the upper bits of the /// destination. /// \returns A 64-bit vector of [4 x i16] containing the horizontal sums of both /// operands. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_hadd_pi16(__m64 __a, __m64 __b) { return (__m64)__builtin_ia32_phaddw((__v4hi)__a, (__v4hi)__b); } /// \brief Horizontally adds the adjacent pairs of values contained in 2 packed /// 64-bit vectors of [2 x i32]. /// /// \headerfile /// /// This intrinsic corresponds to the \c PHADDD instruction. /// /// \param __a /// A 64-bit vector of [2 x i32] containing one of the source operands. The /// horizontal sums of the values are stored in the lower bits of the /// destination. /// \param __b /// A 64-bit vector of [2 x i32] containing one of the source operands. The /// horizontal sums of the values are stored in the upper bits of the /// destination. /// \returns A 64-bit vector of [2 x i32] containing the horizontal sums of both /// operands. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_hadd_pi32(__m64 __a, __m64 __b) { return (__m64)__builtin_ia32_phaddd((__v2si)__a, (__v2si)__b); } /// \brief Horizontally adds the adjacent pairs of values contained in 2 packed /// 128-bit vectors of [8 x i16]. Positive sums greater than 7FFFh are /// saturated to 7FFFh. Negative sums less than 8000h are saturated to 8000h. /// /// \headerfile /// /// This intrinsic corresponds to the \c VPHADDSW instruction. /// /// \param __a /// A 128-bit vector of [8 x i16] containing one of the source operands. The /// horizontal sums of the values are stored in the lower bits of the /// destination. /// \param __b /// A 128-bit vector of [8 x i16] containing one of the source operands. The /// horizontal sums of the values are stored in the upper bits of the /// destination. /// \returns A 128-bit vector of [8 x i16] containing the horizontal saturated /// sums of both operands. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_hadds_epi16(__m128i __a, __m128i __b) { return (__m128i)__builtin_ia32_phaddsw128((__v8hi)__a, (__v8hi)__b); } /// \brief Horizontally adds the adjacent pairs of values contained in 2 packed /// 64-bit vectors of [4 x i16]. Positive sums greater than 7FFFh are /// saturated to 7FFFh. Negative sums less than 8000h are saturated to 8000h. /// /// \headerfile /// /// This intrinsic corresponds to the \c PHADDSW instruction. /// /// \param __a /// A 64-bit vector of [4 x i16] containing one of the source operands. The /// horizontal sums of the values are stored in the lower bits of the /// destination. /// \param __b /// A 64-bit vector of [4 x i16] containing one of the source operands. The /// horizontal sums of the values are stored in the upper bits of the /// destination. /// \returns A 64-bit vector of [4 x i16] containing the horizontal saturated /// sums of both operands. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_hadds_pi16(__m64 __a, __m64 __b) { return (__m64)__builtin_ia32_phaddsw((__v4hi)__a, (__v4hi)__b); } /// \brief Horizontally subtracts the adjacent pairs of values contained in 2 /// packed 128-bit vectors of [8 x i16]. /// /// \headerfile /// /// This intrinsic corresponds to the \c VPHSUBW instruction. /// /// \param __a /// A 128-bit vector of [8 x i16] containing one of the source operands. The /// horizontal differences between the values are stored in the lower bits of /// the destination. /// \param __b /// A 128-bit vector of [8 x i16] containing one of the source operands. The /// horizontal differences between the values are stored in the upper bits of /// the destination. /// \returns A 128-bit vector of [8 x i16] containing the horizontal differences /// of both operands. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_hsub_epi16(__m128i __a, __m128i __b) { return (__m128i)__builtin_ia32_phsubw128((__v8hi)__a, (__v8hi)__b); } /// \brief Horizontally subtracts the adjacent pairs of values contained in 2 /// packed 128-bit vectors of [4 x i32]. /// /// \headerfile /// /// This intrinsic corresponds to the \c VPHSUBD instruction. /// /// \param __a /// A 128-bit vector of [4 x i32] containing one of the source operands. The /// horizontal differences between the values are stored in the lower bits of /// the destination. /// \param __b /// A 128-bit vector of [4 x i32] containing one of the source operands. The /// horizontal differences between the values are stored in the upper bits of /// the destination. /// \returns A 128-bit vector of [4 x i32] containing the horizontal differences /// of both operands. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_hsub_epi32(__m128i __a, __m128i __b) { return (__m128i)__builtin_ia32_phsubd128((__v4si)__a, (__v4si)__b); } /// \brief Horizontally subtracts the adjacent pairs of values contained in 2 /// packed 64-bit vectors of [4 x i16]. /// /// \headerfile /// /// This intrinsic corresponds to the \c PHSUBW instruction. /// /// \param __a /// A 64-bit vector of [4 x i16] containing one of the source operands. The /// horizontal differences between the values are stored in the lower bits of /// the destination. /// \param __b /// A 64-bit vector of [4 x i16] containing one of the source operands. The /// horizontal differences between the values are stored in the upper bits of /// the destination. /// \returns A 64-bit vector of [4 x i16] containing the horizontal differences /// of both operands. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_hsub_pi16(__m64 __a, __m64 __b) { return (__m64)__builtin_ia32_phsubw((__v4hi)__a, (__v4hi)__b); } /// \brief Horizontally subtracts the adjacent pairs of values contained in 2 /// packed 64-bit vectors of [2 x i32]. /// /// \headerfile /// /// This intrinsic corresponds to the \c PHSUBD instruction. /// /// \param __a /// A 64-bit vector of [2 x i32] containing one of the source operands. The /// horizontal differences between the values are stored in the lower bits of /// the destination. /// \param __b /// A 64-bit vector of [2 x i32] containing one of the source operands. The /// horizontal differences between the values are stored in the upper bits of /// the destination. /// \returns A 64-bit vector of [2 x i32] containing the horizontal differences /// of both operands. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_hsub_pi32(__m64 __a, __m64 __b) { return (__m64)__builtin_ia32_phsubd((__v2si)__a, (__v2si)__b); } /// \brief Horizontally subtracts the adjacent pairs of values contained in 2 /// packed 128-bit vectors of [8 x i16]. Positive differences greater than /// 7FFFh are saturated to 7FFFh. Negative differences less than 8000h are /// saturated to 8000h. /// /// \headerfile /// /// This intrinsic corresponds to the \c VPHSUBSW instruction. /// /// \param __a /// A 128-bit vector of [8 x i16] containing one of the source operands. The /// horizontal differences between the values are stored in the lower bits of /// the destination. /// \param __b /// A 128-bit vector of [8 x i16] containing one of the source operands. The /// horizontal differences between the values are stored in the upper bits of /// the destination. /// \returns A 128-bit vector of [8 x i16] containing the horizontal saturated /// differences of both operands. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_hsubs_epi16(__m128i __a, __m128i __b) { return (__m128i)__builtin_ia32_phsubsw128((__v8hi)__a, (__v8hi)__b); } /// \brief Horizontally subtracts the adjacent pairs of values contained in 2 /// packed 64-bit vectors of [4 x i16]. Positive differences greater than /// 7FFFh are saturated to 7FFFh. Negative differences less than 8000h are /// saturated to 8000h. /// /// \headerfile /// /// This intrinsic corresponds to the \c PHSUBSW instruction. /// /// \param __a /// A 64-bit vector of [4 x i16] containing one of the source operands. The /// horizontal differences between the values are stored in the lower bits of /// the destination. /// \param __b /// A 64-bit vector of [4 x i16] containing one of the source operands. The /// horizontal differences between the values are stored in the upper bits of /// the destination. /// \returns A 64-bit vector of [4 x i16] containing the horizontal saturated /// differences of both operands. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_hsubs_pi16(__m64 __a, __m64 __b) { return (__m64)__builtin_ia32_phsubsw((__v4hi)__a, (__v4hi)__b); } /// \brief Multiplies corresponding pairs of packed 8-bit unsigned integer /// values contained in the first source operand and packed 8-bit signed /// integer values contained in the second source operand, adds pairs of /// contiguous products with signed saturation, and writes the 16-bit sums to /// the corresponding bits in the destination. /// /// For example, bits [7:0] of both operands are multiplied, bits [15:8] of /// both operands are multiplied, and the sum of both results is written to /// bits [15:0] of the destination. /// /// \headerfile /// /// This intrinsic corresponds to the \c VPMADDUBSW instruction. /// /// \param __a /// A 128-bit integer vector containing the first source operand. /// \param __b /// A 128-bit integer vector containing the second source operand. /// \returns A 128-bit integer vector containing the sums of products of both /// operands: \n /// \a R0 := (\a __a0 * \a __b0) + (\a __a1 * \a __b1) \n /// \a R1 := (\a __a2 * \a __b2) + (\a __a3 * \a __b3) \n /// \a R2 := (\a __a4 * \a __b4) + (\a __a5 * \a __b5) \n /// \a R3 := (\a __a6 * \a __b6) + (\a __a7 * \a __b7) \n /// \a R4 := (\a __a8 * \a __b8) + (\a __a9 * \a __b9) \n /// \a R5 := (\a __a10 * \a __b10) + (\a __a11 * \a __b11) \n /// \a R6 := (\a __a12 * \a __b12) + (\a __a13 * \a __b13) \n /// \a R7 := (\a __a14 * \a __b14) + (\a __a15 * \a __b15) static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maddubs_epi16(__m128i __a, __m128i __b) { return (__m128i)__builtin_ia32_pmaddubsw128((__v16qi)__a, (__v16qi)__b); } /// \brief Multiplies corresponding pairs of packed 8-bit unsigned integer /// values contained in the first source operand and packed 8-bit signed /// integer values contained in the second source operand, adds pairs of /// contiguous products with signed saturation, and writes the 16-bit sums to /// the corresponding bits in the destination. /// /// For example, bits [7:0] of both operands are multiplied, bits [15:8] of /// both operands are multiplied, and the sum of both results is written to /// bits [15:0] of the destination. /// /// \headerfile /// /// This intrinsic corresponds to the \c PMADDUBSW instruction. /// /// \param __a /// A 64-bit integer vector containing the first source operand. /// \param __b /// A 64-bit integer vector containing the second source operand. /// \returns A 64-bit integer vector containing the sums of products of both /// operands: \n /// \a R0 := (\a __a0 * \a __b0) + (\a __a1 * \a __b1) \n /// \a R1 := (\a __a2 * \a __b2) + (\a __a3 * \a __b3) \n /// \a R2 := (\a __a4 * \a __b4) + (\a __a5 * \a __b5) \n /// \a R3 := (\a __a6 * \a __b6) + (\a __a7 * \a __b7) static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_maddubs_pi16(__m64 __a, __m64 __b) { return (__m64)__builtin_ia32_pmaddubsw((__v8qi)__a, (__v8qi)__b); } /// \brief Multiplies packed 16-bit signed integer values, truncates the 32-bit /// products to the 18 most significant bits by right-shifting, rounds the /// truncated value by adding 1, and writes bits [16:1] to the destination. /// /// \headerfile /// /// This intrinsic corresponds to the \c VPMULHRSW instruction. /// /// \param __a /// A 128-bit vector of [8 x i16] containing one of the source operands. /// \param __b /// A 128-bit vector of [8 x i16] containing one of the source operands. /// \returns A 128-bit vector of [8 x i16] containing the rounded and scaled /// products of both operands. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mulhrs_epi16(__m128i __a, __m128i __b) { return (__m128i)__builtin_ia32_pmulhrsw128((__v8hi)__a, (__v8hi)__b); } /// \brief Multiplies packed 16-bit signed integer values, truncates the 32-bit /// products to the 18 most significant bits by right-shifting, rounds the /// truncated value by adding 1, and writes bits [16:1] to the destination. /// /// \headerfile /// /// This intrinsic corresponds to the \c PMULHRSW instruction. /// /// \param __a /// A 64-bit vector of [4 x i16] containing one of the source operands. /// \param __b /// A 64-bit vector of [4 x i16] containing one of the source operands. /// \returns A 64-bit vector of [4 x i16] containing the rounded and scaled /// products of both operands. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_mulhrs_pi16(__m64 __a, __m64 __b) { return (__m64)__builtin_ia32_pmulhrsw((__v4hi)__a, (__v4hi)__b); } /// \brief Copies the 8-bit integers from a 128-bit integer vector to the /// destination or clears 8-bit values in the destination, as specified by /// the second source operand. /// /// \headerfile /// /// This intrinsic corresponds to the \c VPSHUFB instruction. /// /// \param __a /// A 128-bit integer vector containing the values to be copied. /// \param __b /// A 128-bit integer vector containing control bytes corresponding to /// positions in the destination: /// Bit 7: \n /// 1: Clear the corresponding byte in the destination. \n /// 0: Copy the selected source byte to the corresponding byte in the /// destination. \n /// Bits [6:4] Reserved. \n /// Bits [3:0] select the source byte to be copied. /// \returns A 128-bit integer vector containing the copied or cleared values. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_shuffle_epi8(__m128i __a, __m128i __b) { return (__m128i)__builtin_ia32_pshufb128((__v16qi)__a, (__v16qi)__b); } /// \brief Copies the 8-bit integers from a 64-bit integer vector to the /// destination or clears 8-bit values in the destination, as specified by /// the second source operand. /// /// \headerfile /// /// This intrinsic corresponds to the \c PSHUFB instruction. /// /// \param __a /// A 64-bit integer vector containing the values to be copied. /// \param __b /// A 64-bit integer vector containing control bytes corresponding to /// positions in the destination: /// Bit 7: \n /// 1: Clear the corresponding byte in the destination. \n /// 0: Copy the selected source byte to the corresponding byte in the /// destination. \n /// Bits [3:0] select the source byte to be copied. /// \returns A 64-bit integer vector containing the copied or cleared values. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_shuffle_pi8(__m64 __a, __m64 __b) { return (__m64)__builtin_ia32_pshufb((__v8qi)__a, (__v8qi)__b); } /// \brief For each 8-bit integer in the first source operand, perform one of /// the following actions as specified by the second source operand. /// /// If the byte in the second source is negative, calculate the two's /// complement of the corresponding byte in the first source, and write that /// value to the destination. If the byte in the second source is positive, /// copy the corresponding byte from the first source to the destination. If /// the byte in the second source is zero, clear the corresponding byte in /// the destination. /// /// \headerfile /// /// This intrinsic corresponds to the \c VPSIGNB instruction. /// /// \param __a /// A 128-bit integer vector containing the values to be copied. /// \param __b /// A 128-bit integer vector containing control bytes corresponding to /// positions in the destination. /// \returns A 128-bit integer vector containing the resultant values. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sign_epi8(__m128i __a, __m128i __b) { return (__m128i)__builtin_ia32_psignb128((__v16qi)__a, (__v16qi)__b); } /// \brief For each 16-bit integer in the first source operand, perform one of /// the following actions as specified by the second source operand. /// /// If the word in the second source is negative, calculate the two's /// complement of the corresponding word in the first source, and write that /// value to the destination. If the word in the second source is positive, /// copy the corresponding word from the first source to the destination. If /// the word in the second source is zero, clear the corresponding word in /// the destination. /// /// \headerfile /// /// This intrinsic corresponds to the \c VPSIGNW instruction. /// /// \param __a /// A 128-bit integer vector containing the values to be copied. /// \param __b /// A 128-bit integer vector containing control words corresponding to /// positions in the destination. /// \returns A 128-bit integer vector containing the resultant values. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sign_epi16(__m128i __a, __m128i __b) { return (__m128i)__builtin_ia32_psignw128((__v8hi)__a, (__v8hi)__b); } /// \brief For each 32-bit integer in the first source operand, perform one of /// the following actions as specified by the second source operand. /// /// If the doubleword in the second source is negative, calculate the two's /// complement of the corresponding word in the first source, and write that /// value to the destination. If the doubleword in the second source is /// positive, copy the corresponding word from the first source to the /// destination. If the doubleword in the second source is zero, clear the /// corresponding word in the destination. /// /// \headerfile /// /// This intrinsic corresponds to the \c VPSIGND instruction. /// /// \param __a /// A 128-bit integer vector containing the values to be copied. /// \param __b /// A 128-bit integer vector containing control doublewords corresponding to /// positions in the destination. /// \returns A 128-bit integer vector containing the resultant values. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sign_epi32(__m128i __a, __m128i __b) { return (__m128i)__builtin_ia32_psignd128((__v4si)__a, (__v4si)__b); } /// \brief For each 8-bit integer in the first source operand, perform one of /// the following actions as specified by the second source operand. /// /// If the byte in the second source is negative, calculate the two's /// complement of the corresponding byte in the first source, and write that /// value to the destination. If the byte in the second source is positive, /// copy the corresponding byte from the first source to the destination. If /// the byte in the second source is zero, clear the corresponding byte in /// the destination. /// /// \headerfile /// /// This intrinsic corresponds to the \c PSIGNB instruction. /// /// \param __a /// A 64-bit integer vector containing the values to be copied. /// \param __b /// A 64-bit integer vector containing control bytes corresponding to /// positions in the destination. /// \returns A 64-bit integer vector containing the resultant values. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_sign_pi8(__m64 __a, __m64 __b) { return (__m64)__builtin_ia32_psignb((__v8qi)__a, (__v8qi)__b); } /// \brief For each 16-bit integer in the first source operand, perform one of /// the following actions as specified by the second source operand. /// /// If the word in the second source is negative, calculate the two's /// complement of the corresponding word in the first source, and write that /// value to the destination. If the word in the second source is positive, /// copy the corresponding word from the first source to the destination. If /// the word in the second source is zero, clear the corresponding word in /// the destination. /// /// \headerfile /// /// This intrinsic corresponds to the \c PSIGNW instruction. /// /// \param __a /// A 64-bit integer vector containing the values to be copied. /// \param __b /// A 64-bit integer vector containing control words corresponding to /// positions in the destination. /// \returns A 64-bit integer vector containing the resultant values. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_sign_pi16(__m64 __a, __m64 __b) { return (__m64)__builtin_ia32_psignw((__v4hi)__a, (__v4hi)__b); } /// \brief For each 32-bit integer in the first source operand, perform one of /// the following actions as specified by the second source operand. /// /// If the doubleword in the second source is negative, calculate the two's /// complement of the corresponding doubleword in the first source, and /// write that value to the destination. If the doubleword in the second /// source is positive, copy the corresponding doubleword from the first /// source to the destination. If the doubleword in the second source is /// zero, clear the corresponding doubleword in the destination. /// /// \headerfile /// /// This intrinsic corresponds to the \c PSIGND instruction. /// /// \param __a /// A 64-bit integer vector containing the values to be copied. /// \param __b /// A 64-bit integer vector containing two control doublewords corresponding /// to positions in the destination. /// \returns A 64-bit integer vector containing the resultant values. static __inline__ __m64 __DEFAULT_FN_ATTRS _mm_sign_pi32(__m64 __a, __m64 __b) { return (__m64)__builtin_ia32_psignd((__v2si)__a, (__v2si)__b); } #undef __DEFAULT_FN_ATTRS #endif /* __TMMINTRIN_H */ # 782 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/tmmintrin.h" 3 # 45 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 2 3 #endif # 46 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || \ (defined(__SSE4_2__) || defined(__SSE4_1__)) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 49 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/smmintrin.h" 1 3 /*===---- smmintrin.h - SSE4 intrinsics ------------------------------------=== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef _SMMINTRIN_H #define _SMMINTRIN_H #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/smmintrin.h" 3 # 28 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/smmintrin.h" 3 /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("sse4.1"))) /* SSE4 Rounding macros. */ #define _MM_FROUND_TO_NEAREST_INT 0x00 #define _MM_FROUND_TO_NEG_INF 0x01 #define _MM_FROUND_TO_POS_INF 0x02 #define _MM_FROUND_TO_ZERO 0x03 #define _MM_FROUND_CUR_DIRECTION 0x04 #define _MM_FROUND_RAISE_EXC 0x00 #define _MM_FROUND_NO_EXC 0x08 #define _MM_FROUND_NINT (_MM_FROUND_RAISE_EXC | _MM_FROUND_TO_NEAREST_INT) #define _MM_FROUND_FLOOR (_MM_FROUND_RAISE_EXC | _MM_FROUND_TO_NEG_INF) #define _MM_FROUND_CEIL (_MM_FROUND_RAISE_EXC | _MM_FROUND_TO_POS_INF) #define _MM_FROUND_TRUNC (_MM_FROUND_RAISE_EXC | _MM_FROUND_TO_ZERO) #define _MM_FROUND_RINT (_MM_FROUND_RAISE_EXC | _MM_FROUND_CUR_DIRECTION) #define _MM_FROUND_NEARBYINT (_MM_FROUND_NO_EXC | _MM_FROUND_CUR_DIRECTION) /// \brief Rounds up each element of the 128-bit vector of [4 x float] to an /// integer and returns the rounded values in a 128-bit vector of /// [4 x float]. /// /// \headerfile /// /// \code /// __m128 _mm_ceil_ps(__m128 X); /// \endcode /// /// This intrinsic corresponds to the VROUNDPS / ROUNDPS instruction. /// /// \param X /// A 128-bit vector of [4 x float] values to be rounded up. /// \returns A 128-bit vector of [4 x float] containing the rounded values. #define _mm_ceil_ps(X) _mm_round_ps((X), _MM_FROUND_CEIL) /// \brief Rounds up each element of the 128-bit vector of [2 x double] to an /// integer and returns the rounded values in a 128-bit vector of /// [2 x double]. /// /// \headerfile /// /// \code /// __m128d _mm_ceil_pd(__m128d X); /// \endcode /// /// This intrinsic corresponds to the VROUNDPD / ROUNDPD instruction. /// /// \param X /// A 128-bit vector of [2 x double] values to be rounded up. /// \returns A 128-bit vector of [2 x double] containing the rounded values. #define _mm_ceil_pd(X) _mm_round_pd((X), _MM_FROUND_CEIL) /// \brief Copies three upper elements of the first 128-bit vector operand to /// the corresponding three upper elements of the 128-bit result vector of /// [4 x float]. Rounds up the lowest element of the second 128-bit vector /// operand to an integer and copies it to the lowest element of the 128-bit /// result vector of [4 x float]. /// /// \headerfile /// /// \code /// __m128 _mm_ceil_ss(__m128 X, __m128 Y); /// \endcode /// /// This intrinsic corresponds to the VROUNDSS / ROUNDSS instruction. /// /// \param X /// A 128-bit vector of [4 x float]. The values stored in bits [127:32] are /// copied to the corresponding bits of the result. /// \param Y /// A 128-bit vector of [4 x float]. The value stored in bits [31:0] is /// rounded up to the nearest integer and copied to the corresponding bits /// of the result. /// \returns A 128-bit vector of [4 x float] containing the copied and rounded /// values. #define _mm_ceil_ss(X, Y) _mm_round_ss((X), (Y), _MM_FROUND_CEIL) /// \brief Copies the upper element of the first 128-bit vector operand to the /// corresponding upper element of the 128-bit result vector of [2 x double]. /// Rounds up the lower element of the second 128-bit vector operand to an /// integer and copies it to the lower element of the 128-bit result vector /// of [2 x double]. /// /// \headerfile /// /// \code /// __m128d _mm_ceil_sd(__m128d X, __m128d Y); /// \endcode /// /// This intrinsic corresponds to the VROUNDSD / ROUNDSD instruction. /// /// \param X /// A 128-bit vector of [2 x double]. The value stored in bits [127:64] is /// copied to the corresponding bits of the result. /// \param Y /// A 128-bit vector of [2 x double]. The value stored in bits [63:0] is /// rounded up to the nearest integer and copied to the corresponding bits /// of the result. /// \returns A 128-bit vector of [2 x double] containing the copied and rounded /// values. #define _mm_ceil_sd(X, Y) _mm_round_sd((X), (Y), _MM_FROUND_CEIL) /// \brief Rounds down each element of the 128-bit vector of [4 x float] to an /// an integer and returns the rounded values in a 128-bit vector of /// [4 x float]. /// /// \headerfile /// /// \code /// __m128 _mm_floor_ps(__m128 X); /// \endcode /// /// This intrinsic corresponds to the VROUNDPS / ROUNDPS instruction. /// /// \param X /// A 128-bit vector of [4 x float] values to be rounded down. /// \returns A 128-bit vector of [4 x float] containing the rounded values. #define _mm_floor_ps(X) _mm_round_ps((X), _MM_FROUND_FLOOR) /// \brief Rounds down each element of the 128-bit vector of [2 x double] to an /// integer and returns the rounded values in a 128-bit vector of /// [2 x double]. /// /// \headerfile /// /// \code /// __m128d _mm_floor_pd(__m128d X); /// \endcode /// /// This intrinsic corresponds to the VROUNDPD / ROUNDPD instruction. /// /// \param X /// A 128-bit vector of [2 x double]. /// \returns A 128-bit vector of [2 x double] containing the rounded values. #define _mm_floor_pd(X) _mm_round_pd((X), _MM_FROUND_FLOOR) /// \brief Copies three upper elements of the first 128-bit vector operand to /// the corresponding three upper elements of the 128-bit result vector of /// [4 x float]. Rounds down the lowest element of the second 128-bit vector /// operand to an integer and copies it to the lowest element of the 128-bit /// result vector of [4 x float]. /// /// \headerfile /// /// \code /// __m128 _mm_floor_ss(__m128 X, __m128 Y); /// \endcode /// /// This intrinsic corresponds to the VROUNDSS / ROUNDSS instruction. /// /// \param X /// A 128-bit vector of [4 x float]. The values stored in bits [127:32] are /// copied to the corresponding bits of the result. /// \param Y /// A 128-bit vector of [4 x float]. The value stored in bits [31:0] is /// rounded down to the nearest integer and copied to the corresponding bits /// of the result. /// \returns A 128-bit vector of [4 x float] containing the copied and rounded /// values. #define _mm_floor_ss(X, Y) _mm_round_ss((X), (Y), _MM_FROUND_FLOOR) /// \brief Copies the upper element of the first 128-bit vector operand to the /// corresponding upper element of the 128-bit result vector of [2 x double]. /// Rounds down the lower element of the second 128-bit vector operand to an /// integer and copies it to the lower element of the 128-bit result vector /// of [2 x double]. /// /// \headerfile /// /// \code /// __m128d _mm_floor_sd(__m128d X, __m128d Y); /// \endcode /// /// This intrinsic corresponds to the VROUNDSD / ROUNDSD instruction. /// /// \param X /// A 128-bit vector of [2 x double]. The value stored in bits [127:64] is /// copied to the corresponding bits of the result. /// \param Y /// A 128-bit vector of [2 x double]. The value stored in bits [63:0] is /// rounded down to the nearest integer and copied to the corresponding bits /// of the result. /// \returns A 128-bit vector of [2 x double] containing the copied and rounded /// values. #define _mm_floor_sd(X, Y) _mm_round_sd((X), (Y), _MM_FROUND_FLOOR) /// \brief Rounds each element of the 128-bit vector of [4 x float] to an /// integer value according to the rounding control specified by the second /// argument and returns the rounded values in a 128-bit vector of /// [4 x float]. /// /// \headerfile /// /// \code /// __m128 _mm_round_ps(__m128 X, const int M); /// \endcode /// /// This intrinsic corresponds to the VROUNDPS / ROUNDPS instruction. /// /// \param X /// A 128-bit vector of [4 x float]. /// \param M /// An integer value that specifies the rounding operation. \n /// Bits [7:4] are reserved. \n /// Bit [3] is a precision exception value: \n /// 0: A normal PE exception is used \n /// 1: The PE field is not updated \n /// Bit [2] is the rounding control source: \n /// 0: Use bits [1:0] of \a M \n /// 1: Use the current MXCSR setting \n /// Bits [1:0] contain the rounding control definition: \n /// 00: Nearest \n /// 01: Downward (toward negative infinity) \n /// 10: Upward (toward positive infinity) \n /// 11: Truncated /// \returns A 128-bit vector of [4 x float] containing the rounded values. #define _mm_round_ps(X, M) __extension__ ({ \ (__m128)__builtin_ia32_roundps((__v4sf)(__m128)(X), (M)); }) /// \brief Copies three upper elements of the first 128-bit vector operand to /// the corresponding three upper elements of the 128-bit result vector of /// [4 x float]. Rounds the lowest element of the second 128-bit vector /// operand to an integer value according to the rounding control specified /// by the third argument and copies it to the lowest element of the 128-bit /// result vector of [4 x float]. /// /// \headerfile /// /// \code /// __m128 _mm_round_ss(__m128 X, __m128 Y, const int M); /// \endcode /// /// This intrinsic corresponds to the VROUNDSS / ROUNDSS instruction. /// /// \param X /// A 128-bit vector of [4 x float]. The values stored in bits [127:32] are /// copied to the corresponding bits of the result. /// \param Y /// A 128-bit vector of [4 x float]. The value stored in bits [31:0] is /// rounded to the nearest integer using the specified rounding control and /// copied to the corresponding bits of the result. /// \param M /// An integer value that specifies the rounding operation. \n /// Bits [7:4] are reserved. \n /// Bit [3] is a precision exception value: \n /// 0: A normal PE exception is used \n /// 1: The PE field is not updated \n /// Bit [2] is the rounding control source: \n /// 0: Use bits [1:0] of \a M \n /// 1: Use the current MXCSR setting \n /// Bits [1:0] contain the rounding control definition: \n /// 00: Nearest \n /// 01: Downward (toward negative infinity) \n /// 10: Upward (toward positive infinity) \n /// 11: Truncated /// \returns A 128-bit vector of [4 x float] containing the copied and rounded /// values. #define _mm_round_ss(X, Y, M) __extension__ ({ \ (__m128)__builtin_ia32_roundss((__v4sf)(__m128)(X), \ (__v4sf)(__m128)(Y), (M)); }) /// \brief Rounds each element of the 128-bit vector of [2 x double] to an /// integer value according to the rounding control specified by the second /// argument and returns the rounded values in a 128-bit vector of /// [2 x double]. /// /// \headerfile /// /// \code /// __m128d _mm_round_pd(__m128d X, const int M); /// \endcode /// /// This intrinsic corresponds to the VROUNDPD / ROUNDPD instruction. /// /// \param X /// A 128-bit vector of [2 x double]. /// \param M /// An integer value that specifies the rounding operation. \n /// Bits [7:4] are reserved. \n /// Bit [3] is a precision exception value: \n /// 0: A normal PE exception is used \n /// 1: The PE field is not updated \n /// Bit [2] is the rounding control source: \n /// 0: Use bits [1:0] of \a M \n /// 1: Use the current MXCSR setting \n /// Bits [1:0] contain the rounding control definition: \n /// 00: Nearest \n /// 01: Downward (toward negative infinity) \n /// 10: Upward (toward positive infinity) \n /// 11: Truncated /// \returns A 128-bit vector of [2 x double] containing the rounded values. #define _mm_round_pd(X, M) __extension__ ({ \ (__m128d)__builtin_ia32_roundpd((__v2df)(__m128d)(X), (M)); }) /// \brief Copies the upper element of the first 128-bit vector operand to the /// corresponding upper element of the 128-bit result vector of [2 x double]. /// Rounds the lower element of the second 128-bit vector operand to an /// integer value according to the rounding control specified by the third /// argument and copies it to the lower element of the 128-bit result vector /// of [2 x double]. /// /// \headerfile /// /// \code /// __m128d _mm_round_sd(__m128d X, __m128d Y, const int M); /// \endcode /// /// This intrinsic corresponds to the VROUNDSD / ROUNDSD instruction. /// /// \param X /// A 128-bit vector of [2 x double]. The value stored in bits [127:64] is /// copied to the corresponding bits of the result. /// \param Y /// A 128-bit vector of [2 x double]. The value stored in bits [63:0] is /// rounded to the nearest integer using the specified rounding control and /// copied to the corresponding bits of the result. /// \param M /// An integer value that specifies the rounding operation. \n /// Bits [7:4] are reserved. \n /// Bit [3] is a precision exception value: \n /// 0: A normal PE exception is used \n /// 1: The PE field is not updated \n /// Bit [2] is the rounding control source: \n /// 0: Use bits [1:0] of \a M \n /// 1: Use the current MXCSR setting \n /// Bits [1:0] contain the rounding control definition: \n /// 00: Nearest \n /// 01: Downward (toward negative infinity) \n /// 10: Upward (toward positive infinity) \n /// 11: Truncated /// \returns A 128-bit vector of [2 x double] containing the copied and rounded /// values. #define _mm_round_sd(X, Y, M) __extension__ ({ \ (__m128d)__builtin_ia32_roundsd((__v2df)(__m128d)(X), \ (__v2df)(__m128d)(Y), (M)); }) /* SSE4 Packed Blending Intrinsics. */ /// \brief Returns a 128-bit vector of [2 x double] where the values are /// selected from either the first or second operand as specified by the /// third operand, the control mask. /// /// \headerfile /// /// \code /// __m128d _mm_blend_pd(__m128d V1, __m128d V2, const int M); /// \endcode /// /// This intrinsic corresponds to the VBLENDPD / BLENDPD instruction. /// /// \param V1 /// A 128-bit vector of [2 x double]. /// \param V2 /// A 128-bit vector of [2 x double]. /// \param M /// An immediate integer operand, with mask bits [1:0] specifying how the /// values are to be copied. The position of the mask bit corresponds to the /// index of a copied value. When a mask bit is 0, the corresponding 64-bit /// element in operand \a V1 is copied to the same position in the result. /// When a mask bit is 1, the corresponding 64-bit element in operand \a V2 /// is copied to the same position in the result. /// \returns A 128-bit vector of [2 x double] containing the copied values. #define _mm_blend_pd(V1, V2, M) __extension__ ({ \ (__m128d)__builtin_shufflevector((__v2df)(__m128d)(V1), \ (__v2df)(__m128d)(V2), \ (((M) & 0x01) ? 2 : 0), \ (((M) & 0x02) ? 3 : 1)); }) /// \brief Returns a 128-bit vector of [4 x float] where the values are selected /// from either the first or second operand as specified by the third /// operand, the control mask. /// /// \headerfile /// /// \code /// __m128 _mm_blend_ps(__m128 V1, __m128 V2, const int M); /// \endcode /// /// This intrinsic corresponds to the VBLENDPS / BLENDPS instruction. /// /// \param V1 /// A 128-bit vector of [4 x float]. /// \param V2 /// A 128-bit vector of [4 x float]. /// \param M /// An immediate integer operand, with mask bits [3:0] specifying how the /// values are to be copied. The position of the mask bit corresponds to the /// index of a copied value. When a mask bit is 0, the corresponding 32-bit /// element in operand \a V1 is copied to the same position in the result. /// When a mask bit is 1, the corresponding 32-bit element in operand \a V2 /// is copied to the same position in the result. /// \returns A 128-bit vector of [4 x float] containing the copied values. #define _mm_blend_ps(V1, V2, M) __extension__ ({ \ (__m128)__builtin_shufflevector((__v4sf)(__m128)(V1), (__v4sf)(__m128)(V2), \ (((M) & 0x01) ? 4 : 0), \ (((M) & 0x02) ? 5 : 1), \ (((M) & 0x04) ? 6 : 2), \ (((M) & 0x08) ? 7 : 3)); }) /// \brief Returns a 128-bit vector of [2 x double] where the values are /// selected from either the first or second operand as specified by the /// third operand, the control mask. /// /// \headerfile /// /// This intrinsic corresponds to the VBLENDVPD / BLENDVPD instruction. /// /// \param __V1 /// A 128-bit vector of [2 x double]. /// \param __V2 /// A 128-bit vector of [2 x double]. /// \param __M /// A 128-bit vector operand, with mask bits 127 and 63 specifying how the /// values are to be copied. The position of the mask bit corresponds to the /// most significant bit of a copied value. When a mask bit is 0, the /// corresponding 64-bit element in operand \a __V1 is copied to the same /// position in the result. When a mask bit is 1, the corresponding 64-bit /// element in operand \a __V2 is copied to the same position in the result. /// \returns A 128-bit vector of [2 x double] containing the copied values. static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_blendv_pd (__m128d __V1, __m128d __V2, __m128d __M) { return (__m128d) __builtin_ia32_blendvpd ((__v2df)__V1, (__v2df)__V2, (__v2df)__M); } /// \brief Returns a 128-bit vector of [4 x float] where the values are /// selected from either the first or second operand as specified by the /// third operand, the control mask. /// /// \headerfile /// /// This intrinsic corresponds to the VBLENDVPS / BLENDVPS instruction. /// /// \param __V1 /// A 128-bit vector of [4 x float]. /// \param __V2 /// A 128-bit vector of [4 x float]. /// \param __M /// A 128-bit vector operand, with mask bits 127, 95, 63, and 31 specifying /// how the values are to be copied. The position of the mask bit corresponds /// to the most significant bit of a copied value. When a mask bit is 0, the /// corresponding 32-bit element in operand \a __V1 is copied to the same /// position in the result. When a mask bit is 1, the corresponding 32-bit /// element in operand \a __V2 is copied to the same position in the result. /// \returns A 128-bit vector of [4 x float] containing the copied values. static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_blendv_ps (__m128 __V1, __m128 __V2, __m128 __M) { return (__m128) __builtin_ia32_blendvps ((__v4sf)__V1, (__v4sf)__V2, (__v4sf)__M); } /// \brief Returns a 128-bit vector of [16 x i8] where the values are selected /// from either of the first or second operand as specified by the third /// operand, the control mask. /// /// \headerfile /// /// This intrinsic corresponds to the VPBLENDVB / PBLENDVB instruction. /// /// \param __V1 /// A 128-bit vector of [16 x i8]. /// \param __V2 /// A 128-bit vector of [16 x i8]. /// \param __M /// A 128-bit vector operand, with mask bits 127, 119, 111 ... 7 specifying /// how the values are to be copied. The position of the mask bit corresponds /// to the most significant bit of a copied value. When a mask bit is 0, the /// corresponding 8-bit element in operand \a __V1 is copied to the same /// position in the result. When a mask bit is 1, the corresponding 8-bit /// element in operand \a __V2 is copied to the same position in the result. /// \returns A 128-bit vector of [16 x i8] containing the copied values. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_blendv_epi8 (__m128i __V1, __m128i __V2, __m128i __M) { return (__m128i) __builtin_ia32_pblendvb128 ((__v16qi)__V1, (__v16qi)__V2, (__v16qi)__M); } /// \brief Returns a 128-bit vector of [8 x i16] where the values are selected /// from either of the first or second operand as specified by the third /// operand, the control mask. /// /// \headerfile /// /// \code /// __m128i _mm_blend_epi16(__m128i V1, __m128i V2, const int M); /// \endcode /// /// This intrinsic corresponds to the VPBLENDW / PBLENDW instruction. /// /// \param V1 /// A 128-bit vector of [8 x i16]. /// \param V2 /// A 128-bit vector of [8 x i16]. /// \param M /// An immediate integer operand, with mask bits [7:0] specifying how the /// values are to be copied. The position of the mask bit corresponds to the /// index of a copied value. When a mask bit is 0, the corresponding 16-bit /// element in operand \a V1 is copied to the same position in the result. /// When a mask bit is 1, the corresponding 16-bit element in operand \a V2 /// is copied to the same position in the result. /// \returns A 128-bit vector of [8 x i16] containing the copied values. #define _mm_blend_epi16(V1, V2, M) __extension__ ({ \ (__m128i)__builtin_shufflevector((__v8hi)(__m128i)(V1), \ (__v8hi)(__m128i)(V2), \ (((M) & 0x01) ? 8 : 0), \ (((M) & 0x02) ? 9 : 1), \ (((M) & 0x04) ? 10 : 2), \ (((M) & 0x08) ? 11 : 3), \ (((M) & 0x10) ? 12 : 4), \ (((M) & 0x20) ? 13 : 5), \ (((M) & 0x40) ? 14 : 6), \ (((M) & 0x80) ? 15 : 7)); }) /* SSE4 Dword Multiply Instructions. */ /// \brief Multiples corresponding elements of two 128-bit vectors of [4 x i32] /// and returns the lower 32 bits of the each product in a 128-bit vector of /// [4 x i32]. /// /// \headerfile /// /// This intrinsic corresponds to the VPMULLD / PMULLD instruction. /// /// \param __V1 /// A 128-bit integer vector. /// \param __V2 /// A 128-bit integer vector. /// \returns A 128-bit integer vector containing the products of both operands. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mullo_epi32 (__m128i __V1, __m128i __V2) { return (__m128i) ((__v4su)__V1 * (__v4su)__V2); } /// \brief Multiplies corresponding even-indexed elements of two 128-bit /// vectors of [4 x i32] and returns a 128-bit vector of [2 x i64] /// containing the products. /// /// \headerfile /// /// This intrinsic corresponds to the VPMULDQ / PMULDQ instruction. /// /// \param __V1 /// A 128-bit vector of [4 x i32]. /// \param __V2 /// A 128-bit vector of [4 x i32]. /// \returns A 128-bit vector of [2 x i64] containing the products of both /// operands. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mul_epi32 (__m128i __V1, __m128i __V2) { return (__m128i) __builtin_ia32_pmuldq128 ((__v4si)__V1, (__v4si)__V2); } /* SSE4 Floating Point Dot Product Instructions. */ /// \brief Computes the dot product of the two 128-bit vectors of [4 x float] /// and returns it in the elements of the 128-bit result vector of /// [4 x float]. /// /// The immediate integer operand controls which input elements /// will contribute to the dot product, and where the final results are /// returned. /// /// \headerfile /// /// \code /// __m128 _mm_dp_ps(__m128 X, __m128 Y, const int M); /// \endcode /// /// This intrinsic corresponds to the VDPPS / DPPS instruction. /// /// \param X /// A 128-bit vector of [4 x float]. /// \param Y /// A 128-bit vector of [4 x float]. /// \param M /// An immediate integer operand. Mask bits [7:4] determine which elements /// of the input vectors are used, with bit [4] corresponding to the lowest /// element and bit [7] corresponding to the highest element of each [4 x /// float] vector. If a bit is set, the corresponding elements from the two /// input vectors are used as an input for dot product; otherwise that input /// is treated as zero. Bits [3:0] determine which elements of the result /// will receive a copy of the final dot product, with bit [0] corresponding /// to the lowest element and bit [3] corresponding to the highest element of /// each [4 x float] subvector. If a bit is set, the dot product is returned /// in the corresponding element; otherwise that element is set to zero. /// \returns A 128-bit vector of [4 x float] containing the dot product. #define _mm_dp_ps(X, Y, M) __extension__ ({ \ (__m128) __builtin_ia32_dpps((__v4sf)(__m128)(X), \ (__v4sf)(__m128)(Y), (M)); }) /// \brief Computes the dot product of the two 128-bit vectors of [2 x double] /// and returns it in the elements of the 128-bit result vector of /// [2 x double]. /// /// The immediate integer operand controls which input /// elements will contribute to the dot product, and where the final results /// are returned. /// /// \headerfile /// /// \code /// __m128d _mm_dp_pd(__m128d X, __m128d Y, const int M); /// \endcode /// /// This intrinsic corresponds to the VDPPD / DPPD instruction. /// /// \param X /// A 128-bit vector of [2 x double]. /// \param Y /// A 128-bit vector of [2 x double]. /// \param M /// An immediate integer operand. Mask bits [5:4] determine which elements /// of the input vectors are used, with bit [4] corresponding to the lowest /// element and bit [5] corresponding to the highest element of each of [2 x /// double] vector. If a bit is set, the corresponding elements from the two /// input vectors are used as an input for dot product; otherwise that input /// is treated as zero. Bits [1:0] determine which elements of the result /// will receive a copy of the final dot product, with bit [0] corresponding /// to the lowest element and bit [1] corresponding to the highest element of /// each [2 x double] vector. If a bit is set, the dot product is returned in /// the corresponding element; otherwise that element is set to zero. #define _mm_dp_pd(X, Y, M) __extension__ ({\ (__m128d) __builtin_ia32_dppd((__v2df)(__m128d)(X), \ (__v2df)(__m128d)(Y), (M)); }) /* SSE4 Streaming Load Hint Instruction. */ /// \brief Loads integer values from a 128-bit aligned memory location to a /// 128-bit integer vector. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVNTDQA / MOVNTDQA instruction. /// /// \param __V /// A pointer to a 128-bit aligned memory location that contains the integer /// values. /// \returns A 128-bit integer vector containing the data stored at the /// specified memory location. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_stream_load_si128 (__m128i const *__V) { return (__m128i) __builtin_nontemporal_load ((const __v2di *) __V); } /* SSE4 Packed Integer Min/Max Instructions. */ /// \brief Compares the corresponding elements of two 128-bit vectors of /// [16 x i8] and returns a 128-bit vector of [16 x i8] containing the lesser /// of the two values. /// /// \headerfile /// /// This intrinsic corresponds to the VPMINSB / PMINSB instruction. /// /// \param __V1 /// A 128-bit vector of [16 x i8]. /// \param __V2 /// A 128-bit vector of [16 x i8] /// \returns A 128-bit vector of [16 x i8] containing the lesser values. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_min_epi8 (__m128i __V1, __m128i __V2) { return (__m128i) __builtin_ia32_pminsb128 ((__v16qi) __V1, (__v16qi) __V2); } /// \brief Compares the corresponding elements of two 128-bit vectors of /// [16 x i8] and returns a 128-bit vector of [16 x i8] containing the /// greater value of the two. /// /// \headerfile /// /// This intrinsic corresponds to the VPMAXSB / PMAXSB instruction. /// /// \param __V1 /// A 128-bit vector of [16 x i8]. /// \param __V2 /// A 128-bit vector of [16 x i8]. /// \returns A 128-bit vector of [16 x i8] containing the greater values. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_max_epi8 (__m128i __V1, __m128i __V2) { return (__m128i) __builtin_ia32_pmaxsb128 ((__v16qi) __V1, (__v16qi) __V2); } /// \brief Compares the corresponding elements of two 128-bit vectors of /// [8 x u16] and returns a 128-bit vector of [8 x u16] containing the lesser /// value of the two. /// /// \headerfile /// /// This intrinsic corresponds to the VPMINUW / PMINUW instruction. /// /// \param __V1 /// A 128-bit vector of [8 x u16]. /// \param __V2 /// A 128-bit vector of [8 x u16]. /// \returns A 128-bit vector of [8 x u16] containing the lesser values. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_min_epu16 (__m128i __V1, __m128i __V2) { return (__m128i) __builtin_ia32_pminuw128 ((__v8hi) __V1, (__v8hi) __V2); } /// \brief Compares the corresponding elements of two 128-bit vectors of /// [8 x u16] and returns a 128-bit vector of [8 x u16] containing the /// greater value of the two. /// /// \headerfile /// /// This intrinsic corresponds to the VPMAXUW / PMAXUW instruction. /// /// \param __V1 /// A 128-bit vector of [8 x u16]. /// \param __V2 /// A 128-bit vector of [8 x u16]. /// \returns A 128-bit vector of [8 x u16] containing the greater values. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_max_epu16 (__m128i __V1, __m128i __V2) { return (__m128i) __builtin_ia32_pmaxuw128 ((__v8hi) __V1, (__v8hi) __V2); } /// \brief Compares the corresponding elements of two 128-bit vectors of /// [4 x i32] and returns a 128-bit vector of [4 x i32] containing the lesser /// value of the two. /// /// \headerfile /// /// This intrinsic corresponds to the VPMINSD / PMINSD instruction. /// /// \param __V1 /// A 128-bit vector of [4 x i32]. /// \param __V2 /// A 128-bit vector of [4 x i32]. /// \returns A 128-bit vector of [4 x i32] containing the lesser values. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_min_epi32 (__m128i __V1, __m128i __V2) { return (__m128i) __builtin_ia32_pminsd128 ((__v4si) __V1, (__v4si) __V2); } /// \brief Compares the corresponding elements of two 128-bit vectors of /// [4 x i32] and returns a 128-bit vector of [4 x i32] containing the /// greater value of the two. /// /// \headerfile /// /// This intrinsic corresponds to the VPMAXSD / PMAXSD instruction. /// /// \param __V1 /// A 128-bit vector of [4 x i32]. /// \param __V2 /// A 128-bit vector of [4 x i32]. /// \returns A 128-bit vector of [4 x i32] containing the greater values. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_max_epi32 (__m128i __V1, __m128i __V2) { return (__m128i) __builtin_ia32_pmaxsd128 ((__v4si) __V1, (__v4si) __V2); } /// \brief Compares the corresponding elements of two 128-bit vectors of /// [4 x u32] and returns a 128-bit vector of [4 x u32] containing the lesser /// value of the two. /// /// \headerfile /// /// This intrinsic corresponds to the VPMINUD / PMINUD instruction. /// /// \param __V1 /// A 128-bit vector of [4 x u32]. /// \param __V2 /// A 128-bit vector of [4 x u32]. /// \returns A 128-bit vector of [4 x u32] containing the lesser values. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_min_epu32 (__m128i __V1, __m128i __V2) { return (__m128i) __builtin_ia32_pminud128((__v4si) __V1, (__v4si) __V2); } /// \brief Compares the corresponding elements of two 128-bit vectors of /// [4 x u32] and returns a 128-bit vector of [4 x u32] containing the /// greater value of the two. /// /// \headerfile /// /// This intrinsic corresponds to the VPMAXUD / PMAXUD instruction. /// /// \param __V1 /// A 128-bit vector of [4 x u32]. /// \param __V2 /// A 128-bit vector of [4 x u32]. /// \returns A 128-bit vector of [4 x u32] containing the greater values. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_max_epu32 (__m128i __V1, __m128i __V2) { return (__m128i) __builtin_ia32_pmaxud128((__v4si) __V1, (__v4si) __V2); } /* SSE4 Insertion and Extraction from XMM Register Instructions. */ /// \brief Takes the first argument \a X and inserts an element from the second /// argument \a Y as selected by the third argument \a N. That result then /// has elements zeroed out also as selected by the third argument \a N. The /// resulting 128-bit vector of [4 x float] is then returned. /// /// \headerfile /// /// \code /// __m128 _mm_insert_ps(__m128 X, __m128 Y, const int N); /// \endcode /// /// This intrinsic corresponds to the VINSERTPS instruction. /// /// \param X /// A 128-bit vector source operand of [4 x float]. With the exception of /// those bits in the result copied from parameter \a Y and zeroed by bits /// [3:0] of \a N, all bits from this parameter are copied to the result. /// \param Y /// A 128-bit vector source operand of [4 x float]. One single-precision /// floating-point element from this source, as determined by the immediate /// parameter, is copied to the result. /// \param N /// Specifies which bits from operand \a Y will be copied, which bits in the /// result they will be be copied to, and which bits in the result will be /// cleared. The following assignments are made: \n /// Bits [7:6] specify the bits to copy from operand \a Y: \n /// 00: Selects bits [31:0] from operand \a Y. \n /// 01: Selects bits [63:32] from operand \a Y. \n /// 10: Selects bits [95:64] from operand \a Y. \n /// 11: Selects bits [127:96] from operand \a Y. \n /// Bits [5:4] specify the bits in the result to which the selected bits /// from operand \a Y are copied: \n /// 00: Copies the selected bits from \a Y to result bits [31:0]. \n /// 01: Copies the selected bits from \a Y to result bits [63:32]. \n /// 10: Copies the selected bits from \a Y to result bits [95:64]. \n /// 11: Copies the selected bits from \a Y to result bits [127:96]. \n /// Bits[3:0]: If any of these bits are set, the corresponding result /// element is cleared. /// \returns A 128-bit vector of [4 x float] containing the copied /// single-precision floating point elements from the operands. #define _mm_insert_ps(X, Y, N) __builtin_ia32_insertps128((X), (Y), (N)) /// \brief Extracts a 32-bit integer from a 128-bit vector of [4 x float] and /// returns it, using the immediate value parameter \a N as a selector. /// /// \headerfile /// /// \code /// int _mm_extract_ps(__m128 X, const int N); /// \endcode /// /// This intrinsic corresponds to the VEXTRACTPS / EXTRACTPS /// instruction. /// /// \param X /// A 128-bit vector of [4 x float]. /// \param N /// An immediate value. Bits [1:0] determines which bits from the argument /// \a X are extracted and returned: \n /// 00: Bits [31:0] of parameter \a X are returned. \n /// 01: Bits [63:32] of parameter \a X are returned. \n /// 10: Bits [95:64] of parameter \a X are returned. \n /// 11: Bits [127:96] of parameter \a X are returned. /// \returns A 32-bit integer containing the extracted 32 bits of float data. #define _mm_extract_ps(X, N) (__extension__ \ ({ union { int __i; float __f; } __t; \ __v4sf __a = (__v4sf)(__m128)(X); \ __t.__f = __a[(N) & 3]; \ __t.__i;})) /* Miscellaneous insert and extract macros. */ /* Extract a single-precision float from X at index N into D. */ #define _MM_EXTRACT_FLOAT(D, X, N) (__extension__ ({ __v4sf __a = (__v4sf)(X); \ (D) = __a[N]; })) /* Or together 2 sets of indexes (X and Y) with the zeroing bits (Z) to create an index suitable for _mm_insert_ps. */ #define _MM_MK_INSERTPS_NDX(X, Y, Z) (((X) << 6) | ((Y) << 4) | (Z)) /* Extract a float from X at index N into the first index of the return. */ #define _MM_PICK_OUT_PS(X, N) _mm_insert_ps (_mm_setzero_ps(), (X), \ _MM_MK_INSERTPS_NDX((N), 0, 0x0e)) /* Insert int into packed integer array at index. */ /// \brief Constructs a 128-bit vector of [16 x i8] by first making a copy of /// the 128-bit integer vector parameter, and then inserting the lower 8 bits /// of an integer parameter \a I into an offset specified by the immediate /// value parameter \a N. /// /// \headerfile /// /// \code /// __m128i _mm_insert_epi8(__m128i X, int I, const int N); /// \endcode /// /// This intrinsic corresponds to the VPINSRB / PINSRB instruction. /// /// \param X /// A 128-bit integer vector of [16 x i8]. This vector is copied to the /// result and then one of the sixteen elements in the result vector is /// replaced by the lower 8 bits of \a I. /// \param I /// An integer. The lower 8 bits of this operand are written to the result /// beginning at the offset specified by \a N. /// \param N /// An immediate value. Bits [3:0] specify the bit offset in the result at /// which the lower 8 bits of \a I are written. \n /// 0000: Bits [7:0] of the result are used for insertion. \n /// 0001: Bits [15:8] of the result are used for insertion. \n /// 0010: Bits [23:16] of the result are used for insertion. \n /// 0011: Bits [31:24] of the result are used for insertion. \n /// 0100: Bits [39:32] of the result are used for insertion. \n /// 0101: Bits [47:40] of the result are used for insertion. \n /// 0110: Bits [55:48] of the result are used for insertion. \n /// 0111: Bits [63:56] of the result are used for insertion. \n /// 1000: Bits [71:64] of the result are used for insertion. \n /// 1001: Bits [79:72] of the result are used for insertion. \n /// 1010: Bits [87:80] of the result are used for insertion. \n /// 1011: Bits [95:88] of the result are used for insertion. \n /// 1100: Bits [103:96] of the result are used for insertion. \n /// 1101: Bits [111:104] of the result are used for insertion. \n /// 1110: Bits [119:112] of the result are used for insertion. \n /// 1111: Bits [127:120] of the result are used for insertion. /// \returns A 128-bit integer vector containing the constructed values. #define _mm_insert_epi8(X, I, N) (__extension__ \ ({ __v16qi __a = (__v16qi)(__m128i)(X); \ __a[(N) & 15] = (I); \ (__m128i)__a;})) /// \brief Constructs a 128-bit vector of [4 x i32] by first making a copy of /// the 128-bit integer vector parameter, and then inserting the 32-bit /// integer parameter \a I at the offset specified by the immediate value /// parameter \a N. /// /// \headerfile /// /// \code /// __m128i _mm_insert_epi32(__m128i X, int I, const int N); /// \endcode /// /// This intrinsic corresponds to the VPINSRD / PINSRD instruction. /// /// \param X /// A 128-bit integer vector of [4 x i32]. This vector is copied to the /// result and then one of the four elements in the result vector is /// replaced by \a I. /// \param I /// A 32-bit integer that is written to the result beginning at the offset /// specified by \a N. /// \param N /// An immediate value. Bits [1:0] specify the bit offset in the result at /// which the integer \a I is written. \n /// 00: Bits [31:0] of the result are used for insertion. \n /// 01: Bits [63:32] of the result are used for insertion. \n /// 10: Bits [95:64] of the result are used for insertion. \n /// 11: Bits [127:96] of the result are used for insertion. /// \returns A 128-bit integer vector containing the constructed values. #define _mm_insert_epi32(X, I, N) (__extension__ \ ({ __v4si __a = (__v4si)(__m128i)(X); \ __a[(N) & 3] = (I); \ (__m128i)__a;})) #ifdef __x86_64__ /// \brief Constructs a 128-bit vector of [2 x i64] by first making a copy of /// the 128-bit integer vector parameter, and then inserting the 64-bit /// integer parameter \a I, using the immediate value parameter \a N as an /// insertion location selector. /// /// \headerfile /// /// \code /// __m128i _mm_insert_epi64(__m128i X, long long I, const int N); /// \endcode /// /// This intrinsic corresponds to the VPINSRQ / PINSRQ instruction. /// /// \param X /// A 128-bit integer vector of [2 x i64]. This vector is copied to the /// result and then one of the two elements in the result vector is replaced /// by \a I. /// \param I /// A 64-bit integer that is written to the result beginning at the offset /// specified by \a N. /// \param N /// An immediate value. Bit [0] specifies the bit offset in the result at /// which the integer \a I is written. \n /// 0: Bits [63:0] of the result are used for insertion. \n /// 1: Bits [127:64] of the result are used for insertion. \n /// \returns A 128-bit integer vector containing the constructed values. #define _mm_insert_epi64(X, I, N) (__extension__ \ ({ __v2di __a = (__v2di)(__m128i)(X); \ __a[(N) & 1] = (I); \ (__m128i)__a;})) #endif /* __x86_64__ */ # 1025 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/smmintrin.h" 3 /* Extract int from packed integer array at index. This returns the element * as a zero extended value, so it is unsigned. */ /// \brief Extracts an 8-bit element from the 128-bit integer vector of /// [16 x i8], using the immediate value parameter \a N as a selector. /// /// \headerfile /// /// \code /// int _mm_extract_epi8(__m128i X, const int N); /// \endcode /// /// This intrinsic corresponds to the VPEXTRB / PEXTRB instruction. /// /// \param X /// A 128-bit integer vector. /// \param N /// An immediate value. Bits [3:0] specify which 8-bit vector element from /// the argument \a X to extract and copy to the result. \n /// 0000: Bits [7:0] of parameter \a X are extracted. \n /// 0001: Bits [15:8] of the parameter \a X are extracted. \n /// 0010: Bits [23:16] of the parameter \a X are extracted. \n /// 0011: Bits [31:24] of the parameter \a X are extracted. \n /// 0100: Bits [39:32] of the parameter \a X are extracted. \n /// 0101: Bits [47:40] of the parameter \a X are extracted. \n /// 0110: Bits [55:48] of the parameter \a X are extracted. \n /// 0111: Bits [63:56] of the parameter \a X are extracted. \n /// 1000: Bits [71:64] of the parameter \a X are extracted. \n /// 1001: Bits [79:72] of the parameter \a X are extracted. \n /// 1010: Bits [87:80] of the parameter \a X are extracted. \n /// 1011: Bits [95:88] of the parameter \a X are extracted. \n /// 1100: Bits [103:96] of the parameter \a X are extracted. \n /// 1101: Bits [111:104] of the parameter \a X are extracted. \n /// 1110: Bits [119:112] of the parameter \a X are extracted. \n /// 1111: Bits [127:120] of the parameter \a X are extracted. /// \returns An unsigned integer, whose lower 8 bits are selected from the /// 128-bit integer vector parameter and the remaining bits are assigned /// zeros. #define _mm_extract_epi8(X, N) (__extension__ \ ({ __v16qi __a = (__v16qi)(__m128i)(X); \ (int)(unsigned char) __a[(N) & 15];})) /// \brief Extracts a 32-bit element from the 128-bit integer vector of /// [4 x i32], using the immediate value parameter \a N as a selector. /// /// \headerfile /// /// \code /// int _mm_extract_epi32(__m128i X, const int N); /// \endcode /// /// This intrinsic corresponds to the VPEXTRD / PEXTRD instruction. /// /// \param X /// A 128-bit integer vector. /// \param N /// An immediate value. Bits [1:0] specify which 32-bit vector element from /// the argument \a X to extract and copy to the result. \n /// 00: Bits [31:0] of the parameter \a X are extracted. \n /// 01: Bits [63:32] of the parameter \a X are extracted. \n /// 10: Bits [95:64] of the parameter \a X are extracted. \n /// 11: Bits [127:96] of the parameter \a X are exracted. /// \returns An integer, whose lower 32 bits are selected from the 128-bit /// integer vector parameter and the remaining bits are assigned zeros. #define _mm_extract_epi32(X, N) (__extension__ \ ({ __v4si __a = (__v4si)(__m128i)(X); \ (int)__a[(N) & 3];})) #ifdef __x86_64__ /// \brief Extracts a 64-bit element from the 128-bit integer vector of /// [2 x i64], using the immediate value parameter \a N as a selector. /// /// \headerfile /// /// \code /// long long _mm_extract_epi64(__m128i X, const int N); /// \endcode /// /// This intrinsic corresponds to the VPEXTRQ / PEXTRQ instruction. /// /// \param X /// A 128-bit integer vector. /// \param N /// An immediate value. Bit [0] specifies which 64-bit vector element from /// the argument \a X to return. \n /// 0: Bits [63:0] are returned. \n /// 1: Bits [127:64] are returned. \n /// \returns A 64-bit integer. #define _mm_extract_epi64(X, N) (__extension__ \ ({ __v2di __a = (__v2di)(__m128i)(X); \ (long long)__a[(N) & 1];})) #endif /* __x86_64 */ # 1118 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/smmintrin.h" 3 /* SSE4 128-bit Packed Integer Comparisons. */ /// \brief Tests whether the specified bits in a 128-bit integer vector are all /// zeros. /// /// \headerfile /// /// This intrinsic corresponds to the VPTEST / PTEST instruction. /// /// \param __M /// A 128-bit integer vector containing the bits to be tested. /// \param __V /// A 128-bit integer vector selecting which bits to test in operand \a __M. /// \returns TRUE if the specified bits are all zeros; FALSE otherwise. static __inline__ int __DEFAULT_FN_ATTRS _mm_testz_si128(__m128i __M, __m128i __V) { return __builtin_ia32_ptestz128((__v2di)__M, (__v2di)__V); } /// \brief Tests whether the specified bits in a 128-bit integer vector are all /// ones. /// /// \headerfile /// /// This intrinsic corresponds to the VPTEST / PTEST instruction. /// /// \param __M /// A 128-bit integer vector containing the bits to be tested. /// \param __V /// A 128-bit integer vector selecting which bits to test in operand \a __M. /// \returns TRUE if the specified bits are all ones; FALSE otherwise. static __inline__ int __DEFAULT_FN_ATTRS _mm_testc_si128(__m128i __M, __m128i __V) { return __builtin_ia32_ptestc128((__v2di)__M, (__v2di)__V); } /// \brief Tests whether the specified bits in a 128-bit integer vector are /// neither all zeros nor all ones. /// /// \headerfile /// /// This intrinsic corresponds to the VPTEST / PTEST instruction. /// /// \param __M /// A 128-bit integer vector containing the bits to be tested. /// \param __V /// A 128-bit integer vector selecting which bits to test in operand \a __M. /// \returns TRUE if the specified bits are neither all zeros nor all ones; /// FALSE otherwise. static __inline__ int __DEFAULT_FN_ATTRS _mm_testnzc_si128(__m128i __M, __m128i __V) { return __builtin_ia32_ptestnzc128((__v2di)__M, (__v2di)__V); } /// \brief Tests whether the specified bits in a 128-bit integer vector are all /// ones. /// /// \headerfile /// /// \code /// int _mm_test_all_ones(__m128i V); /// \endcode /// /// This intrinsic corresponds to the VPTEST / PTEST instruction. /// /// \param V /// A 128-bit integer vector containing the bits to be tested. /// \returns TRUE if the bits specified in the operand are all set to 1; FALSE /// otherwise. #define _mm_test_all_ones(V) _mm_testc_si128((V), _mm_cmpeq_epi32((V), (V))) /// \brief Tests whether the specified bits in a 128-bit integer vector are /// neither all zeros nor all ones. /// /// \headerfile /// /// \code /// int _mm_test_mix_ones_zeros(__m128i M, __m128i V); /// \endcode /// /// This intrinsic corresponds to the VPTEST / PTEST instruction. /// /// \param M /// A 128-bit integer vector containing the bits to be tested. /// \param V /// A 128-bit integer vector selecting which bits to test in operand \a M. /// \returns TRUE if the specified bits are neither all zeros nor all ones; /// FALSE otherwise. #define _mm_test_mix_ones_zeros(M, V) _mm_testnzc_si128((M), (V)) /// \brief Tests whether the specified bits in a 128-bit integer vector are all /// zeros. /// /// \headerfile /// /// \code /// int _mm_test_all_zeros(__m128i M, __m128i V); /// \endcode /// /// This intrinsic corresponds to the VPTEST / PTEST instruction. /// /// \param M /// A 128-bit integer vector containing the bits to be tested. /// \param V /// A 128-bit integer vector selecting which bits to test in operand \a M. /// \returns TRUE if the specified bits are all zeros; FALSE otherwise. #define _mm_test_all_zeros(M, V) _mm_testz_si128 ((M), (V)) /* SSE4 64-bit Packed Integer Comparisons. */ /// \brief Compares each of the corresponding 64-bit values of the 128-bit /// integer vectors for equality. /// /// \headerfile /// /// This intrinsic corresponds to the VPCMPEQQ / PCMPEQQ instruction. /// /// \param __V1 /// A 128-bit integer vector. /// \param __V2 /// A 128-bit integer vector. /// \returns A 128-bit integer vector containing the comparison results. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cmpeq_epi64(__m128i __V1, __m128i __V2) { return (__m128i)((__v2di)__V1 == (__v2di)__V2); } /* SSE4 Packed Integer Sign-Extension. */ /// \brief Sign-extends each of the lower eight 8-bit integer elements of a /// 128-bit vector of [16 x i8] to 16-bit values and returns them in a /// 128-bit vector of [8 x i16]. The upper eight elements of the input vector /// are unused. /// /// \headerfile /// /// This intrinsic corresponds to the VPMOVSXBW / PMOVSXBW instruction. /// /// \param __V /// A 128-bit vector of [16 x i8]. The lower eight 8-bit elements are sign- /// extended to 16-bit values. /// \returns A 128-bit vector of [8 x i16] containing the sign-extended values. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtepi8_epi16(__m128i __V) { /* This function always performs a signed extension, but __v16qi is a char which may be signed or unsigned, so use __v16qs. */ return (__m128i)__builtin_convertvector(__builtin_shufflevector((__v16qs)__V, (__v16qs)__V, 0, 1, 2, 3, 4, 5, 6, 7), __v8hi); } /// \brief Sign-extends each of the lower four 8-bit integer elements of a /// 128-bit vector of [16 x i8] to 32-bit values and returns them in a /// 128-bit vector of [4 x i32]. The upper twelve elements of the input /// vector are unused. /// /// \headerfile /// /// This intrinsic corresponds to the VPMOVSXBD / PMOVSXBD instruction. /// /// \param __V /// A 128-bit vector of [16 x i8]. The lower four 8-bit elements are sign- /// extended to 32-bit values. /// \returns A 128-bit vector of [4 x i32] containing the sign-extended values. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtepi8_epi32(__m128i __V) { /* This function always performs a signed extension, but __v16qi is a char which may be signed or unsigned, so use __v16qs. */ return (__m128i)__builtin_convertvector(__builtin_shufflevector((__v16qs)__V, (__v16qs)__V, 0, 1, 2, 3), __v4si); } /// \brief Sign-extends each of the lower two 8-bit integer elements of a /// 128-bit integer vector of [16 x i8] to 64-bit values and returns them in /// a 128-bit vector of [2 x i64]. The upper fourteen elements of the input /// vector are unused. /// /// \headerfile /// /// This intrinsic corresponds to the VPMOVSXBQ / PMOVSXBQ instruction. /// /// \param __V /// A 128-bit vector of [16 x i8]. The lower two 8-bit elements are sign- /// extended to 64-bit values. /// \returns A 128-bit vector of [2 x i64] containing the sign-extended values. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtepi8_epi64(__m128i __V) { /* This function always performs a signed extension, but __v16qi is a char which may be signed or unsigned, so use __v16qs. */ return (__m128i)__builtin_convertvector(__builtin_shufflevector((__v16qs)__V, (__v16qs)__V, 0, 1), __v2di); } /// \brief Sign-extends each of the lower four 16-bit integer elements of a /// 128-bit integer vector of [8 x i16] to 32-bit values and returns them in /// a 128-bit vector of [4 x i32]. The upper four elements of the input /// vector are unused. /// /// \headerfile /// /// This intrinsic corresponds to the VPMOVSXWD / PMOVSXWD instruction. /// /// \param __V /// A 128-bit vector of [8 x i16]. The lower four 16-bit elements are sign- /// extended to 32-bit values. /// \returns A 128-bit vector of [4 x i32] containing the sign-extended values. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtepi16_epi32(__m128i __V) { return (__m128i)__builtin_convertvector(__builtin_shufflevector((__v8hi)__V, (__v8hi)__V, 0, 1, 2, 3), __v4si); } /// \brief Sign-extends each of the lower two 16-bit integer elements of a /// 128-bit integer vector of [8 x i16] to 64-bit values and returns them in /// a 128-bit vector of [2 x i64]. The upper six elements of the input /// vector are unused. /// /// \headerfile /// /// This intrinsic corresponds to the VPMOVSXWQ / PMOVSXWQ instruction. /// /// \param __V /// A 128-bit vector of [8 x i16]. The lower two 16-bit elements are sign- /// extended to 64-bit values. /// \returns A 128-bit vector of [2 x i64] containing the sign-extended values. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtepi16_epi64(__m128i __V) { return (__m128i)__builtin_convertvector(__builtin_shufflevector((__v8hi)__V, (__v8hi)__V, 0, 1), __v2di); } /// \brief Sign-extends each of the lower two 32-bit integer elements of a /// 128-bit integer vector of [4 x i32] to 64-bit values and returns them in /// a 128-bit vector of [2 x i64]. The upper two elements of the input vector /// are unused. /// /// \headerfile /// /// This intrinsic corresponds to the VPMOVSXDQ / PMOVSXDQ instruction. /// /// \param __V /// A 128-bit vector of [4 x i32]. The lower two 32-bit elements are sign- /// extended to 64-bit values. /// \returns A 128-bit vector of [2 x i64] containing the sign-extended values. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtepi32_epi64(__m128i __V) { return (__m128i)__builtin_convertvector(__builtin_shufflevector((__v4si)__V, (__v4si)__V, 0, 1), __v2di); } /* SSE4 Packed Integer Zero-Extension. */ /// \brief Zero-extends each of the lower eight 8-bit integer elements of a /// 128-bit vector of [16 x i8] to 16-bit values and returns them in a /// 128-bit vector of [8 x i16]. The upper eight elements of the input vector /// are unused. /// /// \headerfile /// /// This intrinsic corresponds to the VPMOVZXBW / PMOVZXBW instruction. /// /// \param __V /// A 128-bit vector of [16 x i8]. The lower eight 8-bit elements are zero- /// extended to 16-bit values. /// \returns A 128-bit vector of [8 x i16] containing the zero-extended values. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtepu8_epi16(__m128i __V) { return (__m128i)__builtin_convertvector(__builtin_shufflevector((__v16qu)__V, (__v16qu)__V, 0, 1, 2, 3, 4, 5, 6, 7), __v8hi); } /// \brief Zero-extends each of the lower four 8-bit integer elements of a /// 128-bit vector of [16 x i8] to 32-bit values and returns them in a /// 128-bit vector of [4 x i32]. The upper twelve elements of the input /// vector are unused. /// /// \headerfile /// /// This intrinsic corresponds to the VPMOVZXBD / PMOVZXBD instruction. /// /// \param __V /// A 128-bit vector of [16 x i8]. The lower four 8-bit elements are zero- /// extended to 32-bit values. /// \returns A 128-bit vector of [4 x i32] containing the zero-extended values. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtepu8_epi32(__m128i __V) { return (__m128i)__builtin_convertvector(__builtin_shufflevector((__v16qu)__V, (__v16qu)__V, 0, 1, 2, 3), __v4si); } /// \brief Zero-extends each of the lower two 8-bit integer elements of a /// 128-bit integer vector of [16 x i8] to 64-bit values and returns them in /// a 128-bit vector of [2 x i64]. The upper fourteen elements of the input /// vector are unused. /// /// \headerfile /// /// This intrinsic corresponds to the VPMOVZXBQ / PMOVZXBQ instruction. /// /// \param __V /// A 128-bit vector of [16 x i8]. The lower two 8-bit elements are zero- /// extended to 64-bit values. /// \returns A 128-bit vector of [2 x i64] containing the zero-extended values. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtepu8_epi64(__m128i __V) { return (__m128i)__builtin_convertvector(__builtin_shufflevector((__v16qu)__V, (__v16qu)__V, 0, 1), __v2di); } /// \brief Zero-extends each of the lower four 16-bit integer elements of a /// 128-bit integer vector of [8 x i16] to 32-bit values and returns them in /// a 128-bit vector of [4 x i32]. The upper four elements of the input /// vector are unused. /// /// \headerfile /// /// This intrinsic corresponds to the VPMOVZXWD / PMOVZXWD instruction. /// /// \param __V /// A 128-bit vector of [8 x i16]. The lower four 16-bit elements are zero- /// extended to 32-bit values. /// \returns A 128-bit vector of [4 x i32] containing the zero-extended values. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtepu16_epi32(__m128i __V) { return (__m128i)__builtin_convertvector(__builtin_shufflevector((__v8hu)__V, (__v8hu)__V, 0, 1, 2, 3), __v4si); } /// \brief Zero-extends each of the lower two 16-bit integer elements of a /// 128-bit integer vector of [8 x i16] to 64-bit values and returns them in /// a 128-bit vector of [2 x i64]. The upper six elements of the input vector /// are unused. /// /// \headerfile /// /// This intrinsic corresponds to the VPMOVZXWQ / PMOVZXWQ instruction. /// /// \param __V /// A 128-bit vector of [8 x i16]. The lower two 16-bit elements are zero- /// extended to 64-bit values. /// \returns A 128-bit vector of [2 x i64] containing the zero-extended values. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtepu16_epi64(__m128i __V) { return (__m128i)__builtin_convertvector(__builtin_shufflevector((__v8hu)__V, (__v8hu)__V, 0, 1), __v2di); } /// \brief Zero-extends each of the lower two 32-bit integer elements of a /// 128-bit integer vector of [4 x i32] to 64-bit values and returns them in /// a 128-bit vector of [2 x i64]. The upper two elements of the input vector /// are unused. /// /// \headerfile /// /// This intrinsic corresponds to the VPMOVZXDQ / PMOVZXDQ instruction. /// /// \param __V /// A 128-bit vector of [4 x i32]. The lower two 32-bit elements are zero- /// extended to 64-bit values. /// \returns A 128-bit vector of [2 x i64] containing the zero-extended values. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtepu32_epi64(__m128i __V) { return (__m128i)__builtin_convertvector(__builtin_shufflevector((__v4su)__V, (__v4su)__V, 0, 1), __v2di); } /* SSE4 Pack with Unsigned Saturation. */ /// \brief Converts 32-bit signed integers from both 128-bit integer vector /// operands into 16-bit unsigned integers, and returns the packed result. /// Values greater than 0xFFFF are saturated to 0xFFFF. Values less than /// 0x0000 are saturated to 0x0000. /// /// \headerfile /// /// This intrinsic corresponds to the VPACKUSDW / PACKUSDW instruction. /// /// \param __V1 /// A 128-bit vector of [4 x i32]. Each 32-bit element is treated as a /// signed integer and is converted to a 16-bit unsigned integer with /// saturation. Values greater than 0xFFFF are saturated to 0xFFFF. Values /// less than 0x0000 are saturated to 0x0000. The converted [4 x i16] values /// are written to the lower 64 bits of the result. /// \param __V2 /// A 128-bit vector of [4 x i32]. Each 32-bit element is treated as a /// signed integer and is converted to a 16-bit unsigned integer with /// saturation. Values greater than 0xFFFF are saturated to 0xFFFF. Values /// less than 0x0000 are saturated to 0x0000. The converted [4 x i16] values /// are written to the higher 64 bits of the result. /// \returns A 128-bit vector of [8 x i16] containing the converted values. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_packus_epi32(__m128i __V1, __m128i __V2) { return (__m128i) __builtin_ia32_packusdw128((__v4si)__V1, (__v4si)__V2); } /* SSE4 Multiple Packed Sums of Absolute Difference. */ /// \brief Subtracts 8-bit unsigned integer values and computes the absolute /// values of the differences to the corresponding bits in the destination. /// Then sums of the absolute differences are returned according to the bit /// fields in the immediate operand. /// /// \headerfile /// /// \code /// __m128i _mm_mpsadbw_epu8(__m128i X, __m128i Y, const int M); /// \endcode /// /// This intrinsic corresponds to the VMPSADBW / MPSADBW instruction. /// /// \param X /// A 128-bit vector of [16 x i8]. /// \param Y /// A 128-bit vector of [16 x i8]. /// \param M /// An 8-bit immediate operand specifying how the absolute differences are to /// be calculated, according to the following algorithm: /// \code /// // M2 represents bit 2 of the immediate operand /// // M10 represents bits [1:0] of the immediate operand /// i = M2 * 4 /// j = M10 * 4 /// for (k = 0; k < 8; k = k + 1) { /// d0 = abs(X[i + k + 0] - Y[j + 0]) /// d1 = abs(X[i + k + 1] - Y[j + 1]) /// d2 = abs(X[i + k + 2] - Y[j + 2]) /// d3 = abs(X[i + k + 3] - Y[j + 3]) /// r[k] = d0 + d1 + d2 + d3 /// } /// \endcode /// \returns A 128-bit integer vector containing the sums of the sets of /// absolute differences between both operands. #define _mm_mpsadbw_epu8(X, Y, M) __extension__ ({ \ (__m128i) __builtin_ia32_mpsadbw128((__v16qi)(__m128i)(X), \ (__v16qi)(__m128i)(Y), (M)); }) /// \brief Finds the minimum unsigned 16-bit element in the input 128-bit /// vector of [8 x u16] and returns it and along with its index. /// /// \headerfile /// /// This intrinsic corresponds to the VPHMINPOSUW / PHMINPOSUW /// instruction. /// /// \param __V /// A 128-bit vector of [8 x u16]. /// \returns A 128-bit value where bits [15:0] contain the minimum value found /// in parameter \a __V, bits [18:16] contain the index of the minimum value /// and the remaining bits are set to 0. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_minpos_epu16(__m128i __V) { return (__m128i) __builtin_ia32_phminposuw128((__v8hi)__V); } /* Handle the sse4.2 definitions here. */ /* These definitions are normally in nmmintrin.h, but gcc puts them in here so we'll do the same. */ #undef __DEFAULT_FN_ATTRS #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("sse4.2"))) /* These specify the type of data that we're comparing. */ #define _SIDD_UBYTE_OPS 0x00 #define _SIDD_UWORD_OPS 0x01 #define _SIDD_SBYTE_OPS 0x02 #define _SIDD_SWORD_OPS 0x03 /* These specify the type of comparison operation. */ #define _SIDD_CMP_EQUAL_ANY 0x00 #define _SIDD_CMP_RANGES 0x04 #define _SIDD_CMP_EQUAL_EACH 0x08 #define _SIDD_CMP_EQUAL_ORDERED 0x0c /* These macros specify the polarity of the operation. */ #define _SIDD_POSITIVE_POLARITY 0x00 #define _SIDD_NEGATIVE_POLARITY 0x10 #define _SIDD_MASKED_POSITIVE_POLARITY 0x20 #define _SIDD_MASKED_NEGATIVE_POLARITY 0x30 /* These macros are used in _mm_cmpXstri() to specify the return. */ #define _SIDD_LEAST_SIGNIFICANT 0x00 #define _SIDD_MOST_SIGNIFICANT 0x40 /* These macros are used in _mm_cmpXstri() to specify the return. */ #define _SIDD_BIT_MASK 0x00 #define _SIDD_UNIT_MASK 0x40 /* SSE4.2 Packed Comparison Intrinsics. */ /// \brief Uses the immediate operand \a M to perform a comparison of string /// data with implicitly defined lengths that is contained in source operands /// \a A and \a B. Returns a 128-bit integer vector representing the result /// mask of the comparison. /// /// \headerfile /// /// \code /// __m128i _mm_cmpistrm(__m128i A, __m128i B, const int M); /// \endcode /// /// This intrinsic corresponds to the VPCMPISTRM / PCMPISTRM /// instruction. /// /// \param A /// A 128-bit integer vector containing one of the source operands to be /// compared. /// \param B /// A 128-bit integer vector containing one of the source operands to be /// compared. /// \param M /// An 8-bit immediate operand specifying whether the characters are bytes or /// words, the type of comparison to perform, and the format of the return /// value. \n /// Bits [1:0]: Determine source data format. \n /// 00: 16 unsigned bytes \n /// 01: 8 unsigned words \n /// 10: 16 signed bytes \n /// 11: 8 signed words \n /// Bits [3:2]: Determine comparison type and aggregation method. \n /// 00: Subset: Each character in \a B is compared for equality with all /// the characters in \a A. \n /// 01: Ranges: Each character in \a B is compared to \a A. The comparison /// basis is greater than or equal for even-indexed elements in \a A, /// and less than or equal for odd-indexed elements in \a A. \n /// 10: Match: Compare each pair of corresponding characters in \a A and /// \a B for equality. \n /// 11: Substring: Search \a B for substring matches of \a A. \n /// Bits [5:4]: Determine whether to perform a one's complement on the bit /// mask of the comparison results. \n /// 00: No effect. \n /// 01: Negate the bit mask. \n /// 10: No effect. \n /// 11: Negate the bit mask only for bits with an index less than or equal /// to the size of \a A or \a B. \n /// Bit [6]: Determines whether the result is zero-extended or expanded to 16 /// bytes. \n /// 0: The result is zero-extended to 16 bytes. \n /// 1: The result is expanded to 16 bytes (this expansion is performed by /// repeating each bit 8 or 16 times). /// \returns Returns a 128-bit integer vector representing the result mask of /// the comparison. #define _mm_cmpistrm(A, B, M) \ (__m128i)__builtin_ia32_pcmpistrm128((__v16qi)(__m128i)(A), \ (__v16qi)(__m128i)(B), (int)(M)) /// \brief Uses the immediate operand \a M to perform a comparison of string /// data with implicitly defined lengths that is contained in source operands /// \a A and \a B. Returns an integer representing the result index of the /// comparison. /// /// \headerfile /// /// \code /// int _mm_cmpistri(__m128i A, __m128i B, const int M); /// \endcode /// /// This intrinsic corresponds to the VPCMPISTRI / PCMPISTRI /// instruction. /// /// \param A /// A 128-bit integer vector containing one of the source operands to be /// compared. /// \param B /// A 128-bit integer vector containing one of the source operands to be /// compared. /// \param M /// An 8-bit immediate operand specifying whether the characters are bytes or /// words, the type of comparison to perform, and the format of the return /// value. \n /// Bits [1:0]: Determine source data format. \n /// 00: 16 unsigned bytes \n /// 01: 8 unsigned words \n /// 10: 16 signed bytes \n /// 11: 8 signed words \n /// Bits [3:2]: Determine comparison type and aggregation method. \n /// 00: Subset: Each character in \a B is compared for equality with all /// the characters in \a A. \n /// 01: Ranges: Each character in \a B is compared to \a A. The comparison /// basis is greater than or equal for even-indexed elements in \a A, /// and less than or equal for odd-indexed elements in \a A. \n /// 10: Match: Compare each pair of corresponding characters in \a A and /// \a B for equality. \n /// 11: Substring: Search B for substring matches of \a A. \n /// Bits [5:4]: Determine whether to perform a one's complement on the bit /// mask of the comparison results. \n /// 00: No effect. \n /// 01: Negate the bit mask. \n /// 10: No effect. \n /// 11: Negate the bit mask only for bits with an index less than or equal /// to the size of \a A or \a B. \n /// Bit [6]: Determines whether the index of the lowest set bit or the /// highest set bit is returned. \n /// 0: The index of the least significant set bit. \n /// 1: The index of the most significant set bit. \n /// \returns Returns an integer representing the result index of the comparison. #define _mm_cmpistri(A, B, M) \ (int)__builtin_ia32_pcmpistri128((__v16qi)(__m128i)(A), \ (__v16qi)(__m128i)(B), (int)(M)) /// \brief Uses the immediate operand \a M to perform a comparison of string /// data with explicitly defined lengths that is contained in source operands /// \a A and \a B. Returns a 128-bit integer vector representing the result /// mask of the comparison. /// /// \headerfile /// /// \code /// __m128i _mm_cmpestrm(__m128i A, int LA, __m128i B, int LB, const int M); /// \endcode /// /// This intrinsic corresponds to the VPCMPESTRM / PCMPESTRM /// instruction. /// /// \param A /// A 128-bit integer vector containing one of the source operands to be /// compared. /// \param LA /// An integer that specifies the length of the string in \a A. /// \param B /// A 128-bit integer vector containing one of the source operands to be /// compared. /// \param LB /// An integer that specifies the length of the string in \a B. /// \param M /// An 8-bit immediate operand specifying whether the characters are bytes or /// words, the type of comparison to perform, and the format of the return /// value. \n /// Bits [1:0]: Determine source data format. \n /// 00: 16 unsigned bytes \n /// 01: 8 unsigned words \n /// 10: 16 signed bytes \n /// 11: 8 signed words \n /// Bits [3:2]: Determine comparison type and aggregation method. \n /// 00: Subset: Each character in \a B is compared for equality with all /// the characters in \a A. \n /// 01: Ranges: Each character in \a B is compared to \a A. The comparison /// basis is greater than or equal for even-indexed elements in \a A, /// and less than or equal for odd-indexed elements in \a A. \n /// 10: Match: Compare each pair of corresponding characters in \a A and /// \a B for equality. \n /// 11: Substring: Search \a B for substring matches of \a A. \n /// Bits [5:4]: Determine whether to perform a one's complement on the bit /// mask of the comparison results. \n /// 00: No effect. \n /// 01: Negate the bit mask. \n /// 10: No effect. \n /// 11: Negate the bit mask only for bits with an index less than or equal /// to the size of \a A or \a B. \n /// Bit [6]: Determines whether the result is zero-extended or expanded to 16 /// bytes. \n /// 0: The result is zero-extended to 16 bytes. \n /// 1: The result is expanded to 16 bytes (this expansion is performed by /// repeating each bit 8 or 16 times). \n /// \returns Returns a 128-bit integer vector representing the result mask of /// the comparison. #define _mm_cmpestrm(A, LA, B, LB, M) \ (__m128i)__builtin_ia32_pcmpestrm128((__v16qi)(__m128i)(A), (int)(LA), \ (__v16qi)(__m128i)(B), (int)(LB), \ (int)(M)) /// \brief Uses the immediate operand \a M to perform a comparison of string /// data with explicitly defined lengths that is contained in source operands /// \a A and \a B. Returns an integer representing the result index of the /// comparison. /// /// \headerfile /// /// \code /// int _mm_cmpestri(__m128i A, int LA, __m128i B, int LB, const int M); /// \endcode /// /// This intrinsic corresponds to the VPCMPESTRI / PCMPESTRI /// instruction. /// /// \param A /// A 128-bit integer vector containing one of the source operands to be /// compared. /// \param LA /// An integer that specifies the length of the string in \a A. /// \param B /// A 128-bit integer vector containing one of the source operands to be /// compared. /// \param LB /// An integer that specifies the length of the string in \a B. /// \param M /// An 8-bit immediate operand specifying whether the characters are bytes or /// words, the type of comparison to perform, and the format of the return /// value. \n /// Bits [1:0]: Determine source data format. \n /// 00: 16 unsigned bytes \n /// 01: 8 unsigned words \n /// 10: 16 signed bytes \n /// 11: 8 signed words \n /// Bits [3:2]: Determine comparison type and aggregation method. \n /// 00: Subset: Each character in \a B is compared for equality with all /// the characters in \a A. \n /// 01: Ranges: Each character in \a B is compared to \a A. The comparison /// basis is greater than or equal for even-indexed elements in \a A, /// and less than or equal for odd-indexed elements in \a A. \n /// 10: Match: Compare each pair of corresponding characters in \a A and /// \a B for equality. \n /// 11: Substring: Search B for substring matches of \a A. \n /// Bits [5:4]: Determine whether to perform a one's complement on the bit /// mask of the comparison results. \n /// 00: No effect. \n /// 01: Negate the bit mask. \n /// 10: No effect. \n /// 11: Negate the bit mask only for bits with an index less than or equal /// to the size of \a A or \a B. \n /// Bit [6]: Determines whether the index of the lowest set bit or the /// highest set bit is returned. \n /// 0: The index of the least significant set bit. \n /// 1: The index of the most significant set bit. \n /// \returns Returns an integer representing the result index of the comparison. #define _mm_cmpestri(A, LA, B, LB, M) \ (int)__builtin_ia32_pcmpestri128((__v16qi)(__m128i)(A), (int)(LA), \ (__v16qi)(__m128i)(B), (int)(LB), \ (int)(M)) /* SSE4.2 Packed Comparison Intrinsics and EFlag Reading. */ /// \brief Uses the immediate operand \a M to perform a comparison of string /// data with implicitly defined lengths that is contained in source operands /// \a A and \a B. Returns 1 if the bit mask is zero and the length of the /// string in \a B is the maximum, otherwise, returns 0. /// /// \headerfile /// /// \code /// int _mm_cmpistra(__m128i A, __m128i B, const int M); /// \endcode /// /// This intrinsic corresponds to the VPCMPISTRI / PCMPISTRI /// instruction. /// /// \param A /// A 128-bit integer vector containing one of the source operands to be /// compared. /// \param B /// A 128-bit integer vector containing one of the source operands to be /// compared. /// \param M /// An 8-bit immediate operand specifying whether the characters are bytes or /// words and the type of comparison to perform. \n /// Bits [1:0]: Determine source data format. \n /// 00: 16 unsigned bytes \n /// 01: 8 unsigned words \n /// 10: 16 signed bytes \n /// 11: 8 signed words \n /// Bits [3:2]: Determine comparison type and aggregation method. \n /// 00: Subset: Each character in \a B is compared for equality with all /// the characters in \a A. \n /// 01: Ranges: Each character in \a B is compared to \a A. The comparison /// basis is greater than or equal for even-indexed elements in \a A, /// and less than or equal for odd-indexed elements in \a A. \n /// 10: Match: Compare each pair of corresponding characters in \a A and /// \a B for equality. \n /// 11: Substring: Search \a B for substring matches of \a A. \n /// Bits [5:4]: Determine whether to perform a one's complement on the bit /// mask of the comparison results. \n /// 00: No effect. \n /// 01: Negate the bit mask. \n /// 10: No effect. \n /// 11: Negate the bit mask only for bits with an index less than or equal /// to the size of \a A or \a B. \n /// \returns Returns 1 if the bit mask is zero and the length of the string in /// \a B is the maximum; otherwise, returns 0. #define _mm_cmpistra(A, B, M) \ (int)__builtin_ia32_pcmpistria128((__v16qi)(__m128i)(A), \ (__v16qi)(__m128i)(B), (int)(M)) /// \brief Uses the immediate operand \a M to perform a comparison of string /// data with implicitly defined lengths that is contained in source operands /// \a A and \a B. Returns 1 if the bit mask is non-zero, otherwise, returns /// 0. /// /// \headerfile /// /// \code /// int _mm_cmpistrc(__m128i A, __m128i B, const int M); /// \endcode /// /// This intrinsic corresponds to the VPCMPISTRI / PCMPISTRI /// instruction. /// /// \param A /// A 128-bit integer vector containing one of the source operands to be /// compared. /// \param B /// A 128-bit integer vector containing one of the source operands to be /// compared. /// \param M /// An 8-bit immediate operand specifying whether the characters are bytes or /// words and the type of comparison to perform. \n /// Bits [1:0]: Determine source data format. \n /// 00: 16 unsigned bytes \n /// 01: 8 unsigned words \n /// 10: 16 signed bytes \n /// 11: 8 signed words \n /// Bits [3:2]: Determine comparison type and aggregation method. \n /// 00: Subset: Each character in \a B is compared for equality with all /// the characters in \a A. \n /// 01: Ranges: Each character in \a B is compared to \a A. The comparison /// basis is greater than or equal for even-indexed elements in \a A, /// and less than or equal for odd-indexed elements in \a A. \n /// 10: Match: Compare each pair of corresponding characters in \a A and /// \a B for equality. \n /// 11: Substring: Search B for substring matches of \a A. \n /// Bits [5:4]: Determine whether to perform a one's complement on the bit /// mask of the comparison results. \n /// 00: No effect. \n /// 01: Negate the bit mask. \n /// 10: No effect. \n /// 11: Negate the bit mask only for bits with an index less than or equal /// to the size of \a A or \a B. /// \returns Returns 1 if the bit mask is non-zero, otherwise, returns 0. #define _mm_cmpistrc(A, B, M) \ (int)__builtin_ia32_pcmpistric128((__v16qi)(__m128i)(A), \ (__v16qi)(__m128i)(B), (int)(M)) /// \brief Uses the immediate operand \a M to perform a comparison of string /// data with implicitly defined lengths that is contained in source operands /// \a A and \a B. Returns bit 0 of the resulting bit mask. /// /// \headerfile /// /// \code /// int _mm_cmpistro(__m128i A, __m128i B, const int M); /// \endcode /// /// This intrinsic corresponds to the VPCMPISTRI / PCMPISTRI /// instruction. /// /// \param A /// A 128-bit integer vector containing one of the source operands to be /// compared. /// \param B /// A 128-bit integer vector containing one of the source operands to be /// compared. /// \param M /// An 8-bit immediate operand specifying whether the characters are bytes or /// words and the type of comparison to perform. \n /// Bits [1:0]: Determine source data format. \n /// 00: 16 unsigned bytes \n /// 01: 8 unsigned words \n /// 10: 16 signed bytes \n /// 11: 8 signed words \n /// Bits [3:2]: Determine comparison type and aggregation method. \n /// 00: Subset: Each character in \a B is compared for equality with all /// the characters in \a A. \n /// 01: Ranges: Each character in \a B is compared to \a A. The comparison /// basis is greater than or equal for even-indexed elements in \a A, /// and less than or equal for odd-indexed elements in \a A. \n /// 10: Match: Compare each pair of corresponding characters in \a A and /// \a B for equality. \n /// 11: Substring: Search B for substring matches of \a A. \n /// Bits [5:4]: Determine whether to perform a one's complement on the bit /// mask of the comparison results. \n /// 00: No effect. \n /// 01: Negate the bit mask. \n /// 10: No effect. \n /// 11: Negate the bit mask only for bits with an index less than or equal /// to the size of \a A or \a B. \n /// \returns Returns bit 0 of the resulting bit mask. #define _mm_cmpistro(A, B, M) \ (int)__builtin_ia32_pcmpistrio128((__v16qi)(__m128i)(A), \ (__v16qi)(__m128i)(B), (int)(M)) /// \brief Uses the immediate operand \a M to perform a comparison of string /// data with implicitly defined lengths that is contained in source operands /// \a A and \a B. Returns 1 if the length of the string in \a A is less than /// the maximum, otherwise, returns 0. /// /// \headerfile /// /// \code /// int _mm_cmpistrs(__m128i A, __m128i B, const int M); /// \endcode /// /// This intrinsic corresponds to the VPCMPISTRI / PCMPISTRI /// instruction. /// /// \param A /// A 128-bit integer vector containing one of the source operands to be /// compared. /// \param B /// A 128-bit integer vector containing one of the source operands to be /// compared. /// \param M /// An 8-bit immediate operand specifying whether the characters are bytes or /// words and the type of comparison to perform. \n /// Bits [1:0]: Determine source data format. \n /// 00: 16 unsigned bytes \n /// 01: 8 unsigned words \n /// 10: 16 signed bytes \n /// 11: 8 signed words \n /// Bits [3:2]: Determine comparison type and aggregation method. \n /// 00: Subset: Each character in \a B is compared for equality with all /// the characters in \a A. \n /// 01: Ranges: Each character in \a B is compared to \a A. The comparison /// basis is greater than or equal for even-indexed elements in \a A, /// and less than or equal for odd-indexed elements in \a A. \n /// 10: Match: Compare each pair of corresponding characters in \a A and /// \a B for equality. \n /// 11: Substring: Search \a B for substring matches of \a A. \n /// Bits [5:4]: Determine whether to perform a one's complement on the bit /// mask of the comparison results. \n /// 00: No effect. \n /// 01: Negate the bit mask. \n /// 10: No effect. \n /// 11: Negate the bit mask only for bits with an index less than or equal /// to the size of \a A or \a B. \n /// \returns Returns 1 if the length of the string in \a A is less than the /// maximum, otherwise, returns 0. #define _mm_cmpistrs(A, B, M) \ (int)__builtin_ia32_pcmpistris128((__v16qi)(__m128i)(A), \ (__v16qi)(__m128i)(B), (int)(M)) /// \brief Uses the immediate operand \a M to perform a comparison of string /// data with implicitly defined lengths that is contained in source operands /// \a A and \a B. Returns 1 if the length of the string in \a B is less than /// the maximum, otherwise, returns 0. /// /// \headerfile /// /// \code /// int _mm_cmpistrz(__m128i A, __m128i B, const int M); /// \endcode /// /// This intrinsic corresponds to the VPCMPISTRI / PCMPISTRI /// instruction. /// /// \param A /// A 128-bit integer vector containing one of the source operands to be /// compared. /// \param B /// A 128-bit integer vector containing one of the source operands to be /// compared. /// \param M /// An 8-bit immediate operand specifying whether the characters are bytes or /// words and the type of comparison to perform. \n /// Bits [1:0]: Determine source data format. \n /// 00: 16 unsigned bytes \n /// 01: 8 unsigned words \n /// 10: 16 signed bytes \n /// 11: 8 signed words \n /// Bits [3:2]: Determine comparison type and aggregation method. \n /// 00: Subset: Each character in \a B is compared for equality with all /// the characters in \a A. \n /// 01: Ranges: Each character in \a B is compared to \a A. The comparison /// basis is greater than or equal for even-indexed elements in \a A, /// and less than or equal for odd-indexed elements in \a A. \n /// 10: Match: Compare each pair of corresponding characters in \a A and /// \a B for equality. \n /// 11: Substring: Search \a B for substring matches of \a A. \n /// Bits [5:4]: Determine whether to perform a one's complement on the bit /// mask of the comparison results. \n /// 00: No effect. \n /// 01: Negate the bit mask. \n /// 10: No effect. \n /// 11: Negate the bit mask only for bits with an index less than or equal /// to the size of \a A or \a B. /// \returns Returns 1 if the length of the string in \a B is less than the /// maximum, otherwise, returns 0. #define _mm_cmpistrz(A, B, M) \ (int)__builtin_ia32_pcmpistriz128((__v16qi)(__m128i)(A), \ (__v16qi)(__m128i)(B), (int)(M)) /// \brief Uses the immediate operand \a M to perform a comparison of string /// data with explicitly defined lengths that is contained in source operands /// \a A and \a B. Returns 1 if the bit mask is zero and the length of the /// string in \a B is the maximum, otherwise, returns 0. /// /// \headerfile /// /// \code /// int _mm_cmpestra(__m128i A, int LA, __m128i B, int LB, const int M); /// \endcode /// /// This intrinsic corresponds to the VPCMPESTRI / PCMPESTRI /// instruction. /// /// \param A /// A 128-bit integer vector containing one of the source operands to be /// compared. /// \param LA /// An integer that specifies the length of the string in \a A. /// \param B /// A 128-bit integer vector containing one of the source operands to be /// compared. /// \param LB /// An integer that specifies the length of the string in \a B. /// \param M /// An 8-bit immediate operand specifying whether the characters are bytes or /// words and the type of comparison to perform. \n /// Bits [1:0]: Determine source data format. \n /// 00: 16 unsigned bytes \n /// 01: 8 unsigned words \n /// 10: 16 signed bytes \n /// 11: 8 signed words \n /// Bits [3:2]: Determine comparison type and aggregation method. \n /// 00: Subset: Each character in \a B is compared for equality with all /// the characters in \a A. \n /// 01: Ranges: Each character in \a B is compared to \a A. The comparison /// basis is greater than or equal for even-indexed elements in \a A, /// and less than or equal for odd-indexed elements in \a A. \n /// 10: Match: Compare each pair of corresponding characters in \a A and /// \a B for equality. \n /// 11: Substring: Search \a B for substring matches of \a A. \n /// Bits [5:4]: Determine whether to perform a one's complement on the bit /// mask of the comparison results. \n /// 00: No effect. \n /// 01: Negate the bit mask. \n /// 10: No effect. \n /// 11: Negate the bit mask only for bits with an index less than or equal /// to the size of \a A or \a B. /// \returns Returns 1 if the bit mask is zero and the length of the string in /// \a B is the maximum, otherwise, returns 0. #define _mm_cmpestra(A, LA, B, LB, M) \ (int)__builtin_ia32_pcmpestria128((__v16qi)(__m128i)(A), (int)(LA), \ (__v16qi)(__m128i)(B), (int)(LB), \ (int)(M)) /// \brief Uses the immediate operand \a M to perform a comparison of string /// data with explicitly defined lengths that is contained in source operands /// \a A and \a B. Returns 1 if the resulting mask is non-zero, otherwise, /// returns 0. /// /// \headerfile /// /// \code /// int _mm_cmpestrc(__m128i A, int LA, __m128i B, int LB, const int M); /// \endcode /// /// This intrinsic corresponds to the VPCMPESTRI / PCMPESTRI /// instruction. /// /// \param A /// A 128-bit integer vector containing one of the source operands to be /// compared. /// \param LA /// An integer that specifies the length of the string in \a A. /// \param B /// A 128-bit integer vector containing one of the source operands to be /// compared. /// \param LB /// An integer that specifies the length of the string in \a B. /// \param M /// An 8-bit immediate operand specifying whether the characters are bytes or /// words and the type of comparison to perform. \n /// Bits [1:0]: Determine source data format. \n /// 00: 16 unsigned bytes \n /// 01: 8 unsigned words \n /// 10: 16 signed bytes \n /// 11: 8 signed words \n /// Bits [3:2]: Determine comparison type and aggregation method. \n /// 00: Subset: Each character in \a B is compared for equality with all /// the characters in \a A. \n /// 01: Ranges: Each character in \a B is compared to \a A. The comparison /// basis is greater than or equal for even-indexed elements in \a A, /// and less than or equal for odd-indexed elements in \a A. \n /// 10: Match: Compare each pair of corresponding characters in \a A and /// \a B for equality. \n /// 11: Substring: Search \a B for substring matches of \a A. \n /// Bits [5:4]: Determine whether to perform a one's complement on the bit /// mask of the comparison results. \n /// 00: No effect. \n /// 01: Negate the bit mask. \n /// 10: No effect. \n /// 11: Negate the bit mask only for bits with an index less than or equal /// to the size of \a A or \a B. \n /// \returns Returns 1 if the resulting mask is non-zero, otherwise, returns 0. #define _mm_cmpestrc(A, LA, B, LB, M) \ (int)__builtin_ia32_pcmpestric128((__v16qi)(__m128i)(A), (int)(LA), \ (__v16qi)(__m128i)(B), (int)(LB), \ (int)(M)) /// \brief Uses the immediate operand \a M to perform a comparison of string /// data with explicitly defined lengths that is contained in source operands /// \a A and \a B. Returns bit 0 of the resulting bit mask. /// /// \headerfile /// /// \code /// int _mm_cmpestro(__m128i A, int LA, __m128i B, int LB, const int M); /// \endcode /// /// This intrinsic corresponds to the VPCMPESTRI / PCMPESTRI /// instruction. /// /// \param A /// A 128-bit integer vector containing one of the source operands to be /// compared. /// \param LA /// An integer that specifies the length of the string in \a A. /// \param B /// A 128-bit integer vector containing one of the source operands to be /// compared. /// \param LB /// An integer that specifies the length of the string in \a B. /// \param M /// An 8-bit immediate operand specifying whether the characters are bytes or /// words and the type of comparison to perform. \n /// Bits [1:0]: Determine source data format. \n /// 00: 16 unsigned bytes \n /// 01: 8 unsigned words \n /// 10: 16 signed bytes \n /// 11: 8 signed words \n /// Bits [3:2]: Determine comparison type and aggregation method. \n /// 00: Subset: Each character in \a B is compared for equality with all /// the characters in \a A. \n /// 01: Ranges: Each character in \a B is compared to \a A. The comparison /// basis is greater than or equal for even-indexed elements in \a A, /// and less than or equal for odd-indexed elements in \a A. \n /// 10: Match: Compare each pair of corresponding characters in \a A and /// \a B for equality. \n /// 11: Substring: Search \a B for substring matches of \a A. \n /// Bits [5:4]: Determine whether to perform a one's complement on the bit /// mask of the comparison results. \n /// 00: No effect. \n /// 01: Negate the bit mask. \n /// 10: No effect. \n /// 11: Negate the bit mask only for bits with an index less than or equal /// to the size of \a A or \a B. /// \returns Returns bit 0 of the resulting bit mask. #define _mm_cmpestro(A, LA, B, LB, M) \ (int)__builtin_ia32_pcmpestrio128((__v16qi)(__m128i)(A), (int)(LA), \ (__v16qi)(__m128i)(B), (int)(LB), \ (int)(M)) /// \brief Uses the immediate operand \a M to perform a comparison of string /// data with explicitly defined lengths that is contained in source operands /// \a A and \a B. Returns 1 if the length of the string in \a A is less than /// the maximum, otherwise, returns 0. /// /// \headerfile /// /// \code /// int _mm_cmpestrs(__m128i A, int LA, __m128i B, int LB, const int M); /// \endcode /// /// This intrinsic corresponds to the VPCMPESTRI / PCMPESTRI /// instruction. /// /// \param A /// A 128-bit integer vector containing one of the source operands to be /// compared. /// \param LA /// An integer that specifies the length of the string in \a A. /// \param B /// A 128-bit integer vector containing one of the source operands to be /// compared. /// \param LB /// An integer that specifies the length of the string in \a B. /// \param M /// An 8-bit immediate operand specifying whether the characters are bytes or /// words and the type of comparison to perform. \n /// Bits [1:0]: Determine source data format. \n /// 00: 16 unsigned bytes \n /// 01: 8 unsigned words \n /// 10: 16 signed bytes \n /// 11: 8 signed words \n /// Bits [3:2]: Determine comparison type and aggregation method. \n /// 00: Subset: Each character in \a B is compared for equality with all /// the characters in \a A. \n /// 01: Ranges: Each character in \a B is compared to \a A. The comparison /// basis is greater than or equal for even-indexed elements in \a A, /// and less than or equal for odd-indexed elements in \a A. \n /// 10: Match: Compare each pair of corresponding characters in \a A and /// \a B for equality. \n /// 11: Substring: Search \a B for substring matches of \a A. \n /// Bits [5:4]: Determine whether to perform a one's complement in the bit /// mask of the comparison results. \n /// 00: No effect. \n /// 01: Negate the bit mask. \n /// 10: No effect. \n /// 11: Negate the bit mask only for bits with an index less than or equal /// to the size of \a A or \a B. \n /// \returns Returns 1 if the length of the string in \a A is less than the /// maximum, otherwise, returns 0. #define _mm_cmpestrs(A, LA, B, LB, M) \ (int)__builtin_ia32_pcmpestris128((__v16qi)(__m128i)(A), (int)(LA), \ (__v16qi)(__m128i)(B), (int)(LB), \ (int)(M)) /// \brief Uses the immediate operand \a M to perform a comparison of string /// data with explicitly defined lengths that is contained in source operands /// \a A and \a B. Returns 1 if the length of the string in \a B is less than /// the maximum, otherwise, returns 0. /// /// \headerfile /// /// \code /// int _mm_cmpestrz(__m128i A, int LA, __m128i B, int LB, const int M); /// \endcode /// /// This intrinsic corresponds to the VPCMPESTRI instruction. /// /// \param A /// A 128-bit integer vector containing one of the source operands to be /// compared. /// \param LA /// An integer that specifies the length of the string in \a A. /// \param B /// A 128-bit integer vector containing one of the source operands to be /// compared. /// \param LB /// An integer that specifies the length of the string in \a B. /// \param M /// An 8-bit immediate operand specifying whether the characters are bytes or /// words and the type of comparison to perform. \n /// Bits [1:0]: Determine source data format. \n /// 00: 16 unsigned bytes \n /// 01: 8 unsigned words \n /// 10: 16 signed bytes \n /// 11: 8 signed words \n /// Bits [3:2]: Determine comparison type and aggregation method. \n /// 00: Subset: Each character in \a B is compared for equality with all /// the characters in \a A. \n /// 01: Ranges: Each character in \a B is compared to \a A. The comparison /// basis is greater than or equal for even-indexed elements in \a A, /// and less than or equal for odd-indexed elements in \a A. \n /// 10: Match: Compare each pair of corresponding characters in \a A and /// \a B for equality. \n /// 11: Substring: Search \a B for substring matches of \a A. \n /// Bits [5:4]: Determine whether to perform a one's complement on the bit /// mask of the comparison results. \n /// 00: No effect. \n /// 01: Negate the bit mask. \n /// 10: No effect. \n /// 11: Negate the bit mask only for bits with an index less than or equal /// to the size of \a A or \a B. /// \returns Returns 1 if the length of the string in \a B is less than the /// maximum, otherwise, returns 0. #define _mm_cmpestrz(A, LA, B, LB, M) \ (int)__builtin_ia32_pcmpestriz128((__v16qi)(__m128i)(A), (int)(LA), \ (__v16qi)(__m128i)(B), (int)(LB), \ (int)(M)) /* SSE4.2 Compare Packed Data -- Greater Than. */ /// \brief Compares each of the corresponding 64-bit values of the 128-bit /// integer vectors to determine if the values in the first operand are /// greater than those in the second operand. /// /// \headerfile /// /// This intrinsic corresponds to the VPCMPGTQ / PCMPGTQ instruction. /// /// \param __V1 /// A 128-bit integer vector. /// \param __V2 /// A 128-bit integer vector. /// \returns A 128-bit integer vector containing the comparison results. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cmpgt_epi64(__m128i __V1, __m128i __V2) { return (__m128i)((__v2di)__V1 > (__v2di)__V2); } /* SSE4.2 Accumulate CRC32. */ /// \brief Adds the unsigned integer operand to the CRC-32C checksum of the /// unsigned char operand. /// /// \headerfile /// /// This intrinsic corresponds to the CRC32B instruction. /// /// \param __C /// An unsigned integer operand to add to the CRC-32C checksum of operand /// \a __D. /// \param __D /// An unsigned 8-bit integer operand used to compute the CRC-32C checksum. /// \returns The result of adding operand \a __C to the CRC-32C checksum of /// operand \a __D. static __inline__ unsigned int __DEFAULT_FN_ATTRS _mm_crc32_u8(unsigned int __C, unsigned char __D) { return __builtin_ia32_crc32qi(__C, __D); } /// \brief Adds the unsigned integer operand to the CRC-32C checksum of the /// unsigned short operand. /// /// \headerfile /// /// This intrinsic corresponds to the CRC32W instruction. /// /// \param __C /// An unsigned integer operand to add to the CRC-32C checksum of operand /// \a __D. /// \param __D /// An unsigned 16-bit integer operand used to compute the CRC-32C checksum. /// \returns The result of adding operand \a __C to the CRC-32C checksum of /// operand \a __D. static __inline__ unsigned int __DEFAULT_FN_ATTRS _mm_crc32_u16(unsigned int __C, unsigned short __D) { return __builtin_ia32_crc32hi(__C, __D); } /// \brief Adds the first unsigned integer operand to the CRC-32C checksum of /// the second unsigned integer operand. /// /// \headerfile /// /// This intrinsic corresponds to the CRC32L instruction. /// /// \param __C /// An unsigned integer operand to add to the CRC-32C checksum of operand /// \a __D. /// \param __D /// An unsigned 32-bit integer operand used to compute the CRC-32C checksum. /// \returns The result of adding operand \a __C to the CRC-32C checksum of /// operand \a __D. static __inline__ unsigned int __DEFAULT_FN_ATTRS _mm_crc32_u32(unsigned int __C, unsigned int __D) { return __builtin_ia32_crc32si(__C, __D); } #ifdef __x86_64__ /// \brief Adds the unsigned integer operand to the CRC-32C checksum of the /// unsigned 64-bit integer operand. /// /// \headerfile /// /// This intrinsic corresponds to the CRC32Q instruction. /// /// \param __C /// An unsigned integer operand to add to the CRC-32C checksum of operand /// \a __D. /// \param __D /// An unsigned 64-bit integer operand used to compute the CRC-32C checksum. /// \returns The result of adding operand \a __C to the CRC-32C checksum of /// operand \a __D. static __inline__ unsigned long long __DEFAULT_FN_ATTRS _mm_crc32_u64(unsigned long long __C, unsigned long long __D) { return __builtin_ia32_crc32di(__C, __D); } #endif /* __x86_64__ */ # 2458 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/smmintrin.h" 3 #undef __DEFAULT_FN_ATTRS #ifdef __POPCNT__ #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 2462 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/smmintrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/popcntintrin.h" 1 3 /*===---- popcntintrin.h - POPCNT intrinsics -------------------------------=== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef _POPCNTINTRIN_H #define _POPCNTINTRIN_H /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("popcnt"))) /// \brief Counts the number of bits in the source operand having a value of 1. /// /// \headerfile /// /// This intrinsic corresponds to the POPCNT instruction. /// /// \param __A /// An unsigned 32-bit integer operand. /// \returns A 32-bit integer containing the number of bits with value 1 in the /// source operand. static __inline__ int __DEFAULT_FN_ATTRS _mm_popcnt_u32(unsigned int __A) { return __builtin_popcount(__A); } /// \brief Counts the number of bits in the source operand having a value of 1. /// /// \headerfile /// /// This intrinsic corresponds to the POPCNT instruction. /// /// \param __A /// A signed 32-bit integer operand. /// \returns A 32-bit integer containing the number of bits with value 1 in the /// source operand. static __inline__ int __DEFAULT_FN_ATTRS _popcnt32(int __A) { return __builtin_popcount(__A); } #ifdef __x86_64__ /// \brief Counts the number of bits in the source operand having a value of 1. /// /// \headerfile /// /// This intrinsic corresponds to the POPCNT instruction. /// /// \param __A /// An unsigned 64-bit integer operand. /// \returns A 64-bit integer containing the number of bits with value 1 in the /// source operand. static __inline__ long long __DEFAULT_FN_ATTRS _mm_popcnt_u64(unsigned long long __A) { return __builtin_popcountll(__A); } /// \brief Counts the number of bits in the source operand having a value of 1. /// /// \headerfile /// /// This intrinsic corresponds to the POPCNT instruction. /// /// \param __A /// A signed 64-bit integer operand. /// \returns A 64-bit integer containing the number of bits with value 1 in the /// source operand. static __inline__ long long __DEFAULT_FN_ATTRS _popcnt64(long long __A) { return __builtin_popcountll(__A); } #endif /* __x86_64__ */ # 95 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/popcntintrin.h" 3 #undef __DEFAULT_FN_ATTRS #endif /* _POPCNTINTRIN_H */ # 99 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/popcntintrin.h" 3 # 2463 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/smmintrin.h" 2 3 #endif # 2464 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/smmintrin.h" 3 #endif /* _SMMINTRIN_H */ # 2466 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/smmintrin.h" 3 # 50 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 2 3 #endif # 51 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || \ (defined(__AES__) || defined(__PCLMUL__)) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 54 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/wmmintrin.h" 1 3 /*===---- wmmintrin.h - AES intrinsics ------------------------------------=== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef _WMMINTRIN_H #define _WMMINTRIN_H #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/wmmintrin.h" 3 # 28 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/wmmintrin.h" 3 #if 0 /* expanded by -frewrite-includes */ #include <__wmmintrin_aes.h> #endif /* expanded by -frewrite-includes */ # 29 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/wmmintrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/__wmmintrin_aes.h" 1 3 /*===---- __wmmintrin_aes.h - AES intrinsics -------------------------------=== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef _WMMINTRIN_AES_H #define _WMMINTRIN_AES_H #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 26 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/__wmmintrin_aes.h" 3 # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/__wmmintrin_aes.h" 3 /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("aes"))) /// \brief Performs a single round of AES encryption using the Equivalent /// Inverse Cipher, transforming the state value from the first source /// operand using a 128-bit round key value contained in the second source /// operand, and writes the result to the destination. /// /// \headerfile /// /// This intrinsic corresponds to the VAESENC instruction. /// /// \param __V /// A 128-bit integer vector containing the state value. /// \param __R /// A 128-bit integer vector containing the round key value. /// \returns A 128-bit integer vector containing the encrypted value. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_aesenc_si128(__m128i __V, __m128i __R) { return (__m128i)__builtin_ia32_aesenc128((__v2di)__V, (__v2di)__R); } /// \brief Performs the final round of AES encryption using the Equivalent /// Inverse Cipher, transforming the state value from the first source /// operand using a 128-bit round key value contained in the second source /// operand, and writes the result to the destination. /// /// \headerfile /// /// This intrinsic corresponds to the VAESENCLAST instruction. /// /// \param __V /// A 128-bit integer vector containing the state value. /// \param __R /// A 128-bit integer vector containing the round key value. /// \returns A 128-bit integer vector containing the encrypted value. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_aesenclast_si128(__m128i __V, __m128i __R) { return (__m128i)__builtin_ia32_aesenclast128((__v2di)__V, (__v2di)__R); } /// \brief Performs a single round of AES decryption using the Equivalent /// Inverse Cipher, transforming the state value from the first source /// operand using a 128-bit round key value contained in the second source /// operand, and writes the result to the destination. /// /// \headerfile /// /// This intrinsic corresponds to the VAESDEC instruction. /// /// \param __V /// A 128-bit integer vector containing the state value. /// \param __R /// A 128-bit integer vector containing the round key value. /// \returns A 128-bit integer vector containing the decrypted value. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_aesdec_si128(__m128i __V, __m128i __R) { return (__m128i)__builtin_ia32_aesdec128((__v2di)__V, (__v2di)__R); } /// \brief Performs the final round of AES decryption using the Equivalent /// Inverse Cipher, transforming the state value from the first source /// operand using a 128-bit round key value contained in the second source /// operand, and writes the result to the destination. /// /// \headerfile /// /// This intrinsic corresponds to the VAESDECLAST instruction. /// /// \param __V /// A 128-bit integer vector containing the state value. /// \param __R /// A 128-bit integer vector containing the round key value. /// \returns A 128-bit integer vector containing the decrypted value. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_aesdeclast_si128(__m128i __V, __m128i __R) { return (__m128i)__builtin_ia32_aesdeclast128((__v2di)__V, (__v2di)__R); } /// \brief Applies the AES InvMixColumns() transformation to an expanded key /// contained in the source operand, and writes the result to the /// destination. /// /// \headerfile /// /// This intrinsic corresponds to the VAESIMC instruction. /// /// \param __V /// A 128-bit integer vector containing the expanded key. /// \returns A 128-bit integer vector containing the transformed value. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_aesimc_si128(__m128i __V) { return (__m128i)__builtin_ia32_aesimc128((__v2di)__V); } /// \brief Generates a round key for AES encyption, operating on 128-bit data /// specified in the first source operand and using an 8-bit round constant /// specified by the second source operand, and writes the result to the /// destination. /// /// \headerfile /// /// \code /// __m128i _mm_aeskeygenassist_si128(__m128i C, const int R); /// \endcode /// /// This intrinsic corresponds to the AESKEYGENASSIST instruction. /// /// \param C /// A 128-bit integer vector that is used to generate the AES encryption key. /// \param R /// An 8-bit round constant used to generate the AES encryption key. /// \returns A 128-bit round key for AES encryption. #define _mm_aeskeygenassist_si128(C, R) \ (__m128i)__builtin_ia32_aeskeygenassist128((__v2di)(__m128i)(C), (int)(R)) #undef __DEFAULT_FN_ATTRS #endif /* _WMMINTRIN_AES_H */ # 152 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/__wmmintrin_aes.h" 3 # 30 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/wmmintrin.h" 2 3 #if 0 /* expanded by -frewrite-includes */ #include <__wmmintrin_pclmul.h> #endif /* expanded by -frewrite-includes */ # 31 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/wmmintrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/__wmmintrin_pclmul.h" 1 3 /*===---- __wmmintrin_pclmul.h - PCMUL intrinsics ---------------------------=== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef _WMMINTRIN_PCLMUL_H #define _WMMINTRIN_PCLMUL_H /// \brief Multiplies two 64-bit integer values, which are selected from source /// operands using the immediate-value operand. The multiplication is a /// carry-less multiplication, and the 128-bit integer product is stored in /// the destination. /// /// \headerfile /// /// \code /// __m128i _mm_clmulepi64_si128(__m128i __X, __m128i __Y, const int __I); /// \endcode /// /// This intrinsic corresponds to the VPCLMULQDQ instruction. /// /// \param __X /// A 128-bit vector of [2 x i64] containing one of the source operands. /// \param __Y /// A 128-bit vector of [2 x i64] containing one of the source operands. /// \param __I /// An immediate value specifying which 64-bit values to select from the /// operands. Bit 0 is used to select a value from operand \a __X, and bit /// 4 is used to select a value from operand \a __Y: \n /// Bit[0]=0 indicates that bits[63:0] of operand \a __X are used. \n /// Bit[0]=1 indicates that bits[127:64] of operand \a __X are used. \n /// Bit[4]=0 indicates that bits[63:0] of operand \a __Y are used. \n /// Bit[4]=1 indicates that bits[127:64] of operand \a __Y are used. /// \returns The 128-bit integer vector containing the result of the carry-less /// multiplication of the selected 64-bit values. #define _mm_clmulepi64_si128(__X, __Y, __I) \ ((__m128i)__builtin_ia32_pclmulqdq128((__v2di)(__m128i)(__X), \ (__v2di)(__m128i)(__Y), (char)(__I))) #endif /* _WMMINTRIN_PCLMUL_H */ # 58 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/__wmmintrin_pclmul.h" 3 # 32 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/wmmintrin.h" 2 3 #endif /* _WMMINTRIN_H */ # 34 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/wmmintrin.h" 3 # 55 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 2 3 #endif # 56 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || defined(__CLFLUSHOPT__) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 58 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/clflushoptintrin.h" 1 3 /*===---- clflushoptintrin.h - CLFLUSHOPT intrinsic ------------------------------------=== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __IMMINTRIN_H #error "Never use directly; include instead." #endif # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/clflushoptintrin.h" 3 #ifndef __CLFLUSHOPTINTRIN_H #define __CLFLUSHOPTINTRIN_H /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("clflushopt"))) static __inline__ void __DEFAULT_FN_ATTRS _mm_clflushopt(void const * __m) { __builtin_ia32_clflushopt(__m); } #undef __DEFAULT_FN_ATTRS #endif # 42 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/clflushoptintrin.h" 3 # 59 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 2 3 #endif # 60 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || defined(__CLWB__) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 62 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/clwbintrin.h" 1 3 /*===---- clwbintrin.h - CLWB intrinsic ------------------------------------=== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __IMMINTRIN_H #error "Never use directly; include instead." #endif # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/clwbintrin.h" 3 #ifndef __CLWBINTRIN_H #define __CLWBINTRIN_H /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("clwb"))) /// \brief Writes back to memory the cache line (if modified) that contains the /// linear address specified in \a __p from any level of the cache hierarchy in /// the cache coherence domain /// /// \headerfile /// /// This intrinsic corresponds to the CLWB instruction. /// /// \param __p /// A pointer to the memory location used to identify the cache line to be /// written back. static __inline__ void __DEFAULT_FN_ATTRS _mm_clwb(void const *__p) { __builtin_ia32_clwb(__p); } #undef __DEFAULT_FN_ATTRS #endif # 53 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/clwbintrin.h" 3 # 63 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 2 3 #endif # 64 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || defined(__AVX__) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 66 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avxintrin.h" 1 3 /*===---- avxintrin.h - AVX intrinsics -------------------------------------=== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __IMMINTRIN_H #error "Never use directly; include instead." #endif # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avxintrin.h" 3 #ifndef __AVXINTRIN_H #define __AVXINTRIN_H typedef double __v4df __attribute__ ((__vector_size__ (32))); typedef float __v8sf __attribute__ ((__vector_size__ (32))); typedef long long __v4di __attribute__ ((__vector_size__ (32))); typedef int __v8si __attribute__ ((__vector_size__ (32))); typedef short __v16hi __attribute__ ((__vector_size__ (32))); typedef char __v32qi __attribute__ ((__vector_size__ (32))); /* Unsigned types */ typedef unsigned long long __v4du __attribute__ ((__vector_size__ (32))); typedef unsigned int __v8su __attribute__ ((__vector_size__ (32))); typedef unsigned short __v16hu __attribute__ ((__vector_size__ (32))); typedef unsigned char __v32qu __attribute__ ((__vector_size__ (32))); /* We need an explicitly signed variant for char. Note that this shouldn't * appear in the interface though. */ typedef signed char __v32qs __attribute__((__vector_size__(32))); typedef float __m256 __attribute__ ((__vector_size__ (32))); typedef double __m256d __attribute__((__vector_size__(32))); typedef long long __m256i __attribute__((__vector_size__(32))); /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("avx"))) /* Arithmetic */ /// \brief Adds two 256-bit vectors of [4 x double]. /// /// \headerfile /// /// This intrinsic corresponds to the VADDPD instruction. /// /// \param __a /// A 256-bit vector of [4 x double] containing one of the source operands. /// \param __b /// A 256-bit vector of [4 x double] containing one of the source operands. /// \returns A 256-bit vector of [4 x double] containing the sums of both /// operands. static __inline __m256d __DEFAULT_FN_ATTRS _mm256_add_pd(__m256d __a, __m256d __b) { return (__m256d)((__v4df)__a+(__v4df)__b); } /// \brief Adds two 256-bit vectors of [8 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VADDPS instruction. /// /// \param __a /// A 256-bit vector of [8 x float] containing one of the source operands. /// \param __b /// A 256-bit vector of [8 x float] containing one of the source operands. /// \returns A 256-bit vector of [8 x float] containing the sums of both /// operands. static __inline __m256 __DEFAULT_FN_ATTRS _mm256_add_ps(__m256 __a, __m256 __b) { return (__m256)((__v8sf)__a+(__v8sf)__b); } /// \brief Subtracts two 256-bit vectors of [4 x double]. /// /// \headerfile /// /// This intrinsic corresponds to the VSUBPD instruction. /// /// \param __a /// A 256-bit vector of [4 x double] containing the minuend. /// \param __b /// A 256-bit vector of [4 x double] containing the subtrahend. /// \returns A 256-bit vector of [4 x double] containing the differences between /// both operands. static __inline __m256d __DEFAULT_FN_ATTRS _mm256_sub_pd(__m256d __a, __m256d __b) { return (__m256d)((__v4df)__a-(__v4df)__b); } /// \brief Subtracts two 256-bit vectors of [8 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VSUBPS instruction. /// /// \param __a /// A 256-bit vector of [8 x float] containing the minuend. /// \param __b /// A 256-bit vector of [8 x float] containing the subtrahend. /// \returns A 256-bit vector of [8 x float] containing the differences between /// both operands. static __inline __m256 __DEFAULT_FN_ATTRS _mm256_sub_ps(__m256 __a, __m256 __b) { return (__m256)((__v8sf)__a-(__v8sf)__b); } /// \brief Adds the even-indexed values and subtracts the odd-indexed values of /// two 256-bit vectors of [4 x double]. /// /// \headerfile /// /// This intrinsic corresponds to the VADDSUBPD instruction. /// /// \param __a /// A 256-bit vector of [4 x double] containing the left source operand. /// \param __b /// A 256-bit vector of [4 x double] containing the right source operand. /// \returns A 256-bit vector of [4 x double] containing the alternating sums /// and differences between both operands. static __inline __m256d __DEFAULT_FN_ATTRS _mm256_addsub_pd(__m256d __a, __m256d __b) { return (__m256d)__builtin_ia32_addsubpd256((__v4df)__a, (__v4df)__b); } /// \brief Adds the even-indexed values and subtracts the odd-indexed values of /// two 256-bit vectors of [8 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VADDSUBPS instruction. /// /// \param __a /// A 256-bit vector of [8 x float] containing the left source operand. /// \param __b /// A 256-bit vector of [8 x float] containing the right source operand. /// \returns A 256-bit vector of [8 x float] containing the alternating sums and /// differences between both operands. static __inline __m256 __DEFAULT_FN_ATTRS _mm256_addsub_ps(__m256 __a, __m256 __b) { return (__m256)__builtin_ia32_addsubps256((__v8sf)__a, (__v8sf)__b); } /// \brief Divides two 256-bit vectors of [4 x double]. /// /// \headerfile /// /// This intrinsic corresponds to the VDIVPD instruction. /// /// \param __a /// A 256-bit vector of [4 x double] containing the dividend. /// \param __b /// A 256-bit vector of [4 x double] containing the divisor. /// \returns A 256-bit vector of [4 x double] containing the quotients of both /// operands. static __inline __m256d __DEFAULT_FN_ATTRS _mm256_div_pd(__m256d __a, __m256d __b) { return (__m256d)((__v4df)__a/(__v4df)__b); } /// \brief Divides two 256-bit vectors of [8 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VDIVPS instruction. /// /// \param __a /// A 256-bit vector of [8 x float] containing the dividend. /// \param __b /// A 256-bit vector of [8 x float] containing the divisor. /// \returns A 256-bit vector of [8 x float] containing the quotients of both /// operands. static __inline __m256 __DEFAULT_FN_ATTRS _mm256_div_ps(__m256 __a, __m256 __b) { return (__m256)((__v8sf)__a/(__v8sf)__b); } /// \brief Compares two 256-bit vectors of [4 x double] and returns the greater /// of each pair of values. /// /// \headerfile /// /// This intrinsic corresponds to the VMAXPD instruction. /// /// \param __a /// A 256-bit vector of [4 x double] containing one of the operands. /// \param __b /// A 256-bit vector of [4 x double] containing one of the operands. /// \returns A 256-bit vector of [4 x double] containing the maximum values /// between both operands. static __inline __m256d __DEFAULT_FN_ATTRS _mm256_max_pd(__m256d __a, __m256d __b) { return (__m256d)__builtin_ia32_maxpd256((__v4df)__a, (__v4df)__b); } /// \brief Compares two 256-bit vectors of [8 x float] and returns the greater /// of each pair of values. /// /// \headerfile /// /// This intrinsic corresponds to the VMAXPS instruction. /// /// \param __a /// A 256-bit vector of [8 x float] containing one of the operands. /// \param __b /// A 256-bit vector of [8 x float] containing one of the operands. /// \returns A 256-bit vector of [8 x float] containing the maximum values /// between both operands. static __inline __m256 __DEFAULT_FN_ATTRS _mm256_max_ps(__m256 __a, __m256 __b) { return (__m256)__builtin_ia32_maxps256((__v8sf)__a, (__v8sf)__b); } /// \brief Compares two 256-bit vectors of [4 x double] and returns the lesser /// of each pair of values. /// /// \headerfile /// /// This intrinsic corresponds to the VMINPD instruction. /// /// \param __a /// A 256-bit vector of [4 x double] containing one of the operands. /// \param __b /// A 256-bit vector of [4 x double] containing one of the operands. /// \returns A 256-bit vector of [4 x double] containing the minimum values /// between both operands. static __inline __m256d __DEFAULT_FN_ATTRS _mm256_min_pd(__m256d __a, __m256d __b) { return (__m256d)__builtin_ia32_minpd256((__v4df)__a, (__v4df)__b); } /// \brief Compares two 256-bit vectors of [8 x float] and returns the lesser /// of each pair of values. /// /// \headerfile /// /// This intrinsic corresponds to the VMINPS instruction. /// /// \param __a /// A 256-bit vector of [8 x float] containing one of the operands. /// \param __b /// A 256-bit vector of [8 x float] containing one of the operands. /// \returns A 256-bit vector of [8 x float] containing the minimum values /// between both operands. static __inline __m256 __DEFAULT_FN_ATTRS _mm256_min_ps(__m256 __a, __m256 __b) { return (__m256)__builtin_ia32_minps256((__v8sf)__a, (__v8sf)__b); } /// \brief Multiplies two 256-bit vectors of [4 x double]. /// /// \headerfile /// /// This intrinsic corresponds to the VMULPD instruction. /// /// \param __a /// A 256-bit vector of [4 x double] containing one of the operands. /// \param __b /// A 256-bit vector of [4 x double] containing one of the operands. /// \returns A 256-bit vector of [4 x double] containing the products of both /// operands. static __inline __m256d __DEFAULT_FN_ATTRS _mm256_mul_pd(__m256d __a, __m256d __b) { return (__m256d)((__v4df)__a * (__v4df)__b); } /// \brief Multiplies two 256-bit vectors of [8 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VMULPS instruction. /// /// \param __a /// A 256-bit vector of [8 x float] containing one of the operands. /// \param __b /// A 256-bit vector of [8 x float] containing one of the operands. /// \returns A 256-bit vector of [8 x float] containing the products of both /// operands. static __inline __m256 __DEFAULT_FN_ATTRS _mm256_mul_ps(__m256 __a, __m256 __b) { return (__m256)((__v8sf)__a * (__v8sf)__b); } /// \brief Calculates the square roots of the values in a 256-bit vector of /// [4 x double]. /// /// \headerfile /// /// This intrinsic corresponds to the VSQRTPD instruction. /// /// \param __a /// A 256-bit vector of [4 x double]. /// \returns A 256-bit vector of [4 x double] containing the square roots of the /// values in the operand. static __inline __m256d __DEFAULT_FN_ATTRS _mm256_sqrt_pd(__m256d __a) { return (__m256d)__builtin_ia32_sqrtpd256((__v4df)__a); } /// \brief Calculates the square roots of the values in a 256-bit vector of /// [8 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VSQRTPS instruction. /// /// \param __a /// A 256-bit vector of [8 x float]. /// \returns A 256-bit vector of [8 x float] containing the square roots of the /// values in the operand. static __inline __m256 __DEFAULT_FN_ATTRS _mm256_sqrt_ps(__m256 __a) { return (__m256)__builtin_ia32_sqrtps256((__v8sf)__a); } /// \brief Calculates the reciprocal square roots of the values in a 256-bit /// vector of [8 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VRSQRTPS instruction. /// /// \param __a /// A 256-bit vector of [8 x float]. /// \returns A 256-bit vector of [8 x float] containing the reciprocal square /// roots of the values in the operand. static __inline __m256 __DEFAULT_FN_ATTRS _mm256_rsqrt_ps(__m256 __a) { return (__m256)__builtin_ia32_rsqrtps256((__v8sf)__a); } /// \brief Calculates the reciprocals of the values in a 256-bit vector of /// [8 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VRCPPS instruction. /// /// \param __a /// A 256-bit vector of [8 x float]. /// \returns A 256-bit vector of [8 x float] containing the reciprocals of the /// values in the operand. static __inline __m256 __DEFAULT_FN_ATTRS _mm256_rcp_ps(__m256 __a) { return (__m256)__builtin_ia32_rcpps256((__v8sf)__a); } /// \brief Rounds the values in a 256-bit vector of [4 x double] as specified /// by the byte operand. The source values are rounded to integer values and /// returned as 64-bit double-precision floating-point values. /// /// \headerfile /// /// \code /// __m256d _mm256_round_pd(__m256d V, const int M); /// \endcode /// /// This intrinsic corresponds to the VROUNDPD instruction. /// /// \param V /// A 256-bit vector of [4 x double]. /// \param M /// An integer value that specifies the rounding operation. \n /// Bits [7:4] are reserved. \n /// Bit [3] is a precision exception value: \n /// 0: A normal PE exception is used. \n /// 1: The PE field is not updated. \n /// Bit [2] is the rounding control source: \n /// 0: Use bits [1:0] of \a M. \n /// 1: Use the current MXCSR setting. \n /// Bits [1:0] contain the rounding control definition: \n /// 00: Nearest. \n /// 01: Downward (toward negative infinity). \n /// 10: Upward (toward positive infinity). \n /// 11: Truncated. /// \returns A 256-bit vector of [4 x double] containing the rounded values. #define _mm256_round_pd(V, M) __extension__ ({ \ (__m256d)__builtin_ia32_roundpd256((__v4df)(__m256d)(V), (M)); }) /// \brief Rounds the values stored in a 256-bit vector of [8 x float] as /// specified by the byte operand. The source values are rounded to integer /// values and returned as floating-point values. /// /// \headerfile /// /// \code /// __m256 _mm256_round_ps(__m256 V, const int M); /// \endcode /// /// This intrinsic corresponds to the VROUNDPS instruction. /// /// \param V /// A 256-bit vector of [8 x float]. /// \param M /// An integer value that specifies the rounding operation. \n /// Bits [7:4] are reserved. \n /// Bit [3] is a precision exception value: \n /// 0: A normal PE exception is used. \n /// 1: The PE field is not updated. \n /// Bit [2] is the rounding control source: \n /// 0: Use bits [1:0] of \a M. \n /// 1: Use the current MXCSR setting. \n /// Bits [1:0] contain the rounding control definition: \n /// 00: Nearest. \n /// 01: Downward (toward negative infinity). \n /// 10: Upward (toward positive infinity). \n /// 11: Truncated. /// \returns A 256-bit vector of [8 x float] containing the rounded values. #define _mm256_round_ps(V, M) __extension__ ({ \ (__m256)__builtin_ia32_roundps256((__v8sf)(__m256)(V), (M)); }) /// \brief Rounds up the values stored in a 256-bit vector of [4 x double]. The /// source values are rounded up to integer values and returned as 64-bit /// double-precision floating-point values. /// /// \headerfile /// /// \code /// __m256d _mm256_ceil_pd(__m256d V); /// \endcode /// /// This intrinsic corresponds to the VROUNDPD instruction. /// /// \param V /// A 256-bit vector of [4 x double]. /// \returns A 256-bit vector of [4 x double] containing the rounded up values. #define _mm256_ceil_pd(V) _mm256_round_pd((V), _MM_FROUND_CEIL) /// \brief Rounds down the values stored in a 256-bit vector of [4 x double]. /// The source values are rounded down to integer values and returned as /// 64-bit double-precision floating-point values. /// /// \headerfile /// /// \code /// __m256d _mm256_floor_pd(__m256d V); /// \endcode /// /// This intrinsic corresponds to the VROUNDPD instruction. /// /// \param V /// A 256-bit vector of [4 x double]. /// \returns A 256-bit vector of [4 x double] containing the rounded down /// values. #define _mm256_floor_pd(V) _mm256_round_pd((V), _MM_FROUND_FLOOR) /// \brief Rounds up the values stored in a 256-bit vector of [8 x float]. The /// source values are rounded up to integer values and returned as /// floating-point values. /// /// \headerfile /// /// \code /// __m256 _mm256_ceil_ps(__m256 V); /// \endcode /// /// This intrinsic corresponds to the VROUNDPS instruction. /// /// \param V /// A 256-bit vector of [8 x float]. /// \returns A 256-bit vector of [8 x float] containing the rounded up values. #define _mm256_ceil_ps(V) _mm256_round_ps((V), _MM_FROUND_CEIL) /// \brief Rounds down the values stored in a 256-bit vector of [8 x float]. The /// source values are rounded down to integer values and returned as /// floating-point values. /// /// \headerfile /// /// \code /// __m256 _mm256_floor_ps(__m256 V); /// \endcode /// /// This intrinsic corresponds to the VROUNDPS instruction. /// /// \param V /// A 256-bit vector of [8 x float]. /// \returns A 256-bit vector of [8 x float] containing the rounded down values. #define _mm256_floor_ps(V) _mm256_round_ps((V), _MM_FROUND_FLOOR) /* Logical */ /// \brief Performs a bitwise AND of two 256-bit vectors of [4 x double]. /// /// \headerfile /// /// This intrinsic corresponds to the VANDPD instruction. /// /// \param __a /// A 256-bit vector of [4 x double] containing one of the source operands. /// \param __b /// A 256-bit vector of [4 x double] containing one of the source operands. /// \returns A 256-bit vector of [4 x double] containing the bitwise AND of the /// values between both operands. static __inline __m256d __DEFAULT_FN_ATTRS _mm256_and_pd(__m256d __a, __m256d __b) { return (__m256d)((__v4du)__a & (__v4du)__b); } /// \brief Performs a bitwise AND of two 256-bit vectors of [8 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VANDPS instruction. /// /// \param __a /// A 256-bit vector of [8 x float] containing one of the source operands. /// \param __b /// A 256-bit vector of [8 x float] containing one of the source operands. /// \returns A 256-bit vector of [8 x float] containing the bitwise AND of the /// values between both operands. static __inline __m256 __DEFAULT_FN_ATTRS _mm256_and_ps(__m256 __a, __m256 __b) { return (__m256)((__v8su)__a & (__v8su)__b); } /// \brief Performs a bitwise AND of two 256-bit vectors of [4 x double], using /// the one's complement of the values contained in the first source operand. /// /// \headerfile /// /// This intrinsic corresponds to the VANDNPD instruction. /// /// \param __a /// A 256-bit vector of [4 x double] containing the left source operand. The /// one's complement of this value is used in the bitwise AND. /// \param __b /// A 256-bit vector of [4 x double] containing the right source operand. /// \returns A 256-bit vector of [4 x double] containing the bitwise AND of the /// values of the second operand and the one's complement of the first /// operand. static __inline __m256d __DEFAULT_FN_ATTRS _mm256_andnot_pd(__m256d __a, __m256d __b) { return (__m256d)(~(__v4du)__a & (__v4du)__b); } /// \brief Performs a bitwise AND of two 256-bit vectors of [8 x float], using /// the one's complement of the values contained in the first source operand. /// /// \headerfile /// /// This intrinsic corresponds to the VANDNPS instruction. /// /// \param __a /// A 256-bit vector of [8 x float] containing the left source operand. The /// one's complement of this value is used in the bitwise AND. /// \param __b /// A 256-bit vector of [8 x float] containing the right source operand. /// \returns A 256-bit vector of [8 x float] containing the bitwise AND of the /// values of the second operand and the one's complement of the first /// operand. static __inline __m256 __DEFAULT_FN_ATTRS _mm256_andnot_ps(__m256 __a, __m256 __b) { return (__m256)(~(__v8su)__a & (__v8su)__b); } /// \brief Performs a bitwise OR of two 256-bit vectors of [4 x double]. /// /// \headerfile /// /// This intrinsic corresponds to the VORPD instruction. /// /// \param __a /// A 256-bit vector of [4 x double] containing one of the source operands. /// \param __b /// A 256-bit vector of [4 x double] containing one of the source operands. /// \returns A 256-bit vector of [4 x double] containing the bitwise OR of the /// values between both operands. static __inline __m256d __DEFAULT_FN_ATTRS _mm256_or_pd(__m256d __a, __m256d __b) { return (__m256d)((__v4du)__a | (__v4du)__b); } /// \brief Performs a bitwise OR of two 256-bit vectors of [8 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VORPS instruction. /// /// \param __a /// A 256-bit vector of [8 x float] containing one of the source operands. /// \param __b /// A 256-bit vector of [8 x float] containing one of the source operands. /// \returns A 256-bit vector of [8 x float] containing the bitwise OR of the /// values between both operands. static __inline __m256 __DEFAULT_FN_ATTRS _mm256_or_ps(__m256 __a, __m256 __b) { return (__m256)((__v8su)__a | (__v8su)__b); } /// \brief Performs a bitwise XOR of two 256-bit vectors of [4 x double]. /// /// \headerfile /// /// This intrinsic corresponds to the VXORPD instruction. /// /// \param __a /// A 256-bit vector of [4 x double] containing one of the source operands. /// \param __b /// A 256-bit vector of [4 x double] containing one of the source operands. /// \returns A 256-bit vector of [4 x double] containing the bitwise XOR of the /// values between both operands. static __inline __m256d __DEFAULT_FN_ATTRS _mm256_xor_pd(__m256d __a, __m256d __b) { return (__m256d)((__v4du)__a ^ (__v4du)__b); } /// \brief Performs a bitwise XOR of two 256-bit vectors of [8 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VXORPS instruction. /// /// \param __a /// A 256-bit vector of [8 x float] containing one of the source operands. /// \param __b /// A 256-bit vector of [8 x float] containing one of the source operands. /// \returns A 256-bit vector of [8 x float] containing the bitwise XOR of the /// values between both operands. static __inline __m256 __DEFAULT_FN_ATTRS _mm256_xor_ps(__m256 __a, __m256 __b) { return (__m256)((__v8su)__a ^ (__v8su)__b); } /* Horizontal arithmetic */ /// \brief Horizontally adds the adjacent pairs of values contained in two /// 256-bit vectors of [4 x double]. /// /// \headerfile /// /// This intrinsic corresponds to the VHADDPD instruction. /// /// \param __a /// A 256-bit vector of [4 x double] containing one of the source operands. /// The horizontal sums of the values are returned in the even-indexed /// elements of a vector of [4 x double]. /// \param __b /// A 256-bit vector of [4 x double] containing one of the source operands. /// The horizontal sums of the values are returned in the odd-indexed /// elements of a vector of [4 x double]. /// \returns A 256-bit vector of [4 x double] containing the horizontal sums of /// both operands. static __inline __m256d __DEFAULT_FN_ATTRS _mm256_hadd_pd(__m256d __a, __m256d __b) { return (__m256d)__builtin_ia32_haddpd256((__v4df)__a, (__v4df)__b); } /// \brief Horizontally adds the adjacent pairs of values contained in two /// 256-bit vectors of [8 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VHADDPS instruction. /// /// \param __a /// A 256-bit vector of [8 x float] containing one of the source operands. /// The horizontal sums of the values are returned in the elements with /// index 0, 1, 4, 5 of a vector of [8 x float]. /// \param __b /// A 256-bit vector of [8 x float] containing one of the source operands. /// The horizontal sums of the values are returned in the elements with /// index 2, 3, 6, 7 of a vector of [8 x float]. /// \returns A 256-bit vector of [8 x float] containing the horizontal sums of /// both operands. static __inline __m256 __DEFAULT_FN_ATTRS _mm256_hadd_ps(__m256 __a, __m256 __b) { return (__m256)__builtin_ia32_haddps256((__v8sf)__a, (__v8sf)__b); } /// \brief Horizontally subtracts the adjacent pairs of values contained in two /// 256-bit vectors of [4 x double]. /// /// \headerfile /// /// This intrinsic corresponds to the VHSUBPD instruction. /// /// \param __a /// A 256-bit vector of [4 x double] containing one of the source operands. /// The horizontal differences between the values are returned in the /// even-indexed elements of a vector of [4 x double]. /// \param __b /// A 256-bit vector of [4 x double] containing one of the source operands. /// The horizontal differences between the values are returned in the /// odd-indexed elements of a vector of [4 x double]. /// \returns A 256-bit vector of [4 x double] containing the horizontal /// differences of both operands. static __inline __m256d __DEFAULT_FN_ATTRS _mm256_hsub_pd(__m256d __a, __m256d __b) { return (__m256d)__builtin_ia32_hsubpd256((__v4df)__a, (__v4df)__b); } /// \brief Horizontally subtracts the adjacent pairs of values contained in two /// 256-bit vectors of [8 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VHSUBPS instruction. /// /// \param __a /// A 256-bit vector of [8 x float] containing one of the source operands. /// The horizontal differences between the values are returned in the /// elements with index 0, 1, 4, 5 of a vector of [8 x float]. /// \param __b /// A 256-bit vector of [8 x float] containing one of the source operands. /// The horizontal differences between the values are returned in the /// elements with index 2, 3, 6, 7 of a vector of [8 x float]. /// \returns A 256-bit vector of [8 x float] containing the horizontal /// differences of both operands. static __inline __m256 __DEFAULT_FN_ATTRS _mm256_hsub_ps(__m256 __a, __m256 __b) { return (__m256)__builtin_ia32_hsubps256((__v8sf)__a, (__v8sf)__b); } /* Vector permutations */ /// \brief Copies the values in a 128-bit vector of [2 x double] as specified /// by the 128-bit integer vector operand. /// /// \headerfile /// /// This intrinsic corresponds to the VPERMILPD instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. /// \param __c /// A 128-bit integer vector operand specifying how the values are to be /// copied. \n /// Bit [1]: \n /// 0: Bits [63:0] of the source are copied to bits [63:0] of the returned /// vector. \n /// 1: Bits [127:64] of the source are copied to bits [63:0] of the /// returned vector. \n /// Bit [65]: \n /// 0: Bits [63:0] of the source are copied to bits [127:64] of the /// returned vector. \n /// 1: Bits [127:64] of the source are copied to bits [127:64] of the /// returned vector. /// \returns A 128-bit vector of [2 x double] containing the copied values. static __inline __m128d __DEFAULT_FN_ATTRS _mm_permutevar_pd(__m128d __a, __m128i __c) { return (__m128d)__builtin_ia32_vpermilvarpd((__v2df)__a, (__v2di)__c); } /// \brief Copies the values in a 256-bit vector of [4 x double] as specified /// by the 256-bit integer vector operand. /// /// \headerfile /// /// This intrinsic corresponds to the VPERMILPD instruction. /// /// \param __a /// A 256-bit vector of [4 x double]. /// \param __c /// A 256-bit integer vector operand specifying how the values are to be /// copied. \n /// Bit [1]: \n /// 0: Bits [63:0] of the source are copied to bits [63:0] of the returned /// vector. \n /// 1: Bits [127:64] of the source are copied to bits [63:0] of the /// returned vector. \n /// Bit [65]: \n /// 0: Bits [63:0] of the source are copied to bits [127:64] of the /// returned vector. \n /// 1: Bits [127:64] of the source are copied to bits [127:64] of the /// returned vector. \n /// Bit [129]: \n /// 0: Bits [191:128] of the source are copied to bits [191:128] of the /// returned vector. \n /// 1: Bits [255:192] of the source are copied to bits [191:128] of the /// returned vector. \n /// Bit [193]: \n /// 0: Bits [191:128] of the source are copied to bits [255:192] of the /// returned vector. \n /// 1: Bits [255:192] of the source are copied to bits [255:192] of the /// returned vector. /// \returns A 256-bit vector of [4 x double] containing the copied values. static __inline __m256d __DEFAULT_FN_ATTRS _mm256_permutevar_pd(__m256d __a, __m256i __c) { return (__m256d)__builtin_ia32_vpermilvarpd256((__v4df)__a, (__v4di)__c); } /// \brief Copies the values stored in a 128-bit vector of [4 x float] as /// specified by the 128-bit integer vector operand. /// \headerfile /// /// This intrinsic corresponds to the VPERMILPS instruction. /// /// \param __a /// A 128-bit vector of [4 x float]. /// \param __c /// A 128-bit integer vector operand specifying how the values are to be /// copied. \n /// Bits [1:0]: \n /// 00: Bits [31:0] of the source are copied to bits [31:0] of the /// returned vector. \n /// 01: Bits [63:32] of the source are copied to bits [31:0] of the /// returned vector. \n /// 10: Bits [95:64] of the source are copied to bits [31:0] of the /// returned vector. \n /// 11: Bits [127:96] of the source are copied to bits [31:0] of the /// returned vector. \n /// Bits [33:32]: \n /// 00: Bits [31:0] of the source are copied to bits [63:32] of the /// returned vector. \n /// 01: Bits [63:32] of the source are copied to bits [63:32] of the /// returned vector. \n /// 10: Bits [95:64] of the source are copied to bits [63:32] of the /// returned vector. \n /// 11: Bits [127:96] of the source are copied to bits [63:32] of the /// returned vector. \n /// Bits [65:64]: \n /// 00: Bits [31:0] of the source are copied to bits [95:64] of the /// returned vector. \n /// 01: Bits [63:32] of the source are copied to bits [95:64] of the /// returned vector. \n /// 10: Bits [95:64] of the source are copied to bits [95:64] of the /// returned vector. \n /// 11: Bits [127:96] of the source are copied to bits [95:64] of the /// returned vector. \n /// Bits [97:96]: \n /// 00: Bits [31:0] of the source are copied to bits [127:96] of the /// returned vector. \n /// 01: Bits [63:32] of the source are copied to bits [127:96] of the /// returned vector. \n /// 10: Bits [95:64] of the source are copied to bits [127:96] of the /// returned vector. \n /// 11: Bits [127:96] of the source are copied to bits [127:96] of the /// returned vector. /// \returns A 128-bit vector of [4 x float] containing the copied values. static __inline __m128 __DEFAULT_FN_ATTRS _mm_permutevar_ps(__m128 __a, __m128i __c) { return (__m128)__builtin_ia32_vpermilvarps((__v4sf)__a, (__v4si)__c); } /// \brief Copies the values stored in a 256-bit vector of [8 x float] as /// specified by the 256-bit integer vector operand. /// /// \headerfile /// /// This intrinsic corresponds to the VPERMILPS instruction. /// /// \param __a /// A 256-bit vector of [8 x float]. /// \param __c /// A 256-bit integer vector operand specifying how the values are to be /// copied. \n /// Bits [1:0]: \n /// 00: Bits [31:0] of the source are copied to bits [31:0] of the /// returned vector. \n /// 01: Bits [63:32] of the source are copied to bits [31:0] of the /// returned vector. \n /// 10: Bits [95:64] of the source are copied to bits [31:0] of the /// returned vector. \n /// 11: Bits [127:96] of the source are copied to bits [31:0] of the /// returned vector. \n /// Bits [33:32]: \n /// 00: Bits [31:0] of the source are copied to bits [63:32] of the /// returned vector. \n /// 01: Bits [63:32] of the source are copied to bits [63:32] of the /// returned vector. \n /// 10: Bits [95:64] of the source are copied to bits [63:32] of the /// returned vector. \n /// 11: Bits [127:96] of the source are copied to bits [63:32] of the /// returned vector. \n /// Bits [65:64]: \n /// 00: Bits [31:0] of the source are copied to bits [95:64] of the /// returned vector. \n /// 01: Bits [63:32] of the source are copied to bits [95:64] of the /// returned vector. \n /// 10: Bits [95:64] of the source are copied to bits [95:64] of the /// returned vector. \n /// 11: Bits [127:96] of the source are copied to bits [95:64] of the /// returned vector. \n /// Bits [97:96]: \n /// 00: Bits [31:0] of the source are copied to bits [127:96] of the /// returned vector. \n /// 01: Bits [63:32] of the source are copied to bits [127:96] of the /// returned vector. \n /// 10: Bits [95:64] of the source are copied to bits [127:96] of the /// returned vector. \n /// 11: Bits [127:96] of the source are copied to bits [127:96] of the /// returned vector. \n /// Bits [129:128]: \n /// 00: Bits [159:128] of the source are copied to bits [159:128] of the /// returned vector. \n /// 01: Bits [191:160] of the source are copied to bits [159:128] of the /// returned vector. \n /// 10: Bits [223:192] of the source are copied to bits [159:128] of the /// returned vector. \n /// 11: Bits [255:224] of the source are copied to bits [159:128] of the /// returned vector. \n /// Bits [161:160]: \n /// 00: Bits [159:128] of the source are copied to bits [191:160] of the /// returned vector. \n /// 01: Bits [191:160] of the source are copied to bits [191:160] of the /// returned vector. \n /// 10: Bits [223:192] of the source are copied to bits [191:160] of the /// returned vector. \n /// 11: Bits [255:224] of the source are copied to bits [191:160] of the /// returned vector. \n /// Bits [193:192]: \n /// 00: Bits [159:128] of the source are copied to bits [223:192] of the /// returned vector. \n /// 01: Bits [191:160] of the source are copied to bits [223:192] of the /// returned vector. \n /// 10: Bits [223:192] of the source are copied to bits [223:192] of the /// returned vector. \n /// 11: Bits [255:224] of the source are copied to bits [223:192] of the /// returned vector. \n /// Bits [225:224]: \n /// 00: Bits [159:128] of the source are copied to bits [255:224] of the /// returned vector. \n /// 01: Bits [191:160] of the source are copied to bits [255:224] of the /// returned vector. \n /// 10: Bits [223:192] of the source are copied to bits [255:224] of the /// returned vector. \n /// 11: Bits [255:224] of the source are copied to bits [255:224] of the /// returned vector. /// \returns A 256-bit vector of [8 x float] containing the copied values. static __inline __m256 __DEFAULT_FN_ATTRS _mm256_permutevar_ps(__m256 __a, __m256i __c) { return (__m256)__builtin_ia32_vpermilvarps256((__v8sf)__a, (__v8si)__c); } /// \brief Copies the values in a 128-bit vector of [2 x double] as specified /// by the immediate integer operand. /// /// \headerfile /// /// \code /// __m128d _mm_permute_pd(__m128d A, const int C); /// \endcode /// /// This intrinsic corresponds to the VPERMILPD instruction. /// /// \param A /// A 128-bit vector of [2 x double]. /// \param C /// An immediate integer operand specifying how the values are to be /// copied. \n /// Bit [0]: \n /// 0: Bits [63:0] of the source are copied to bits [63:0] of the returned /// vector. \n /// 1: Bits [127:64] of the source are copied to bits [63:0] of the /// returned vector. \n /// Bit [1]: \n /// 0: Bits [63:0] of the source are copied to bits [127:64] of the /// returned vector. \n /// 1: Bits [127:64] of the source are copied to bits [127:64] of the /// returned vector. /// \returns A 128-bit vector of [2 x double] containing the copied values. #define _mm_permute_pd(A, C) __extension__ ({ \ (__m128d)__builtin_shufflevector((__v2df)(__m128d)(A), \ (__v2df)_mm_undefined_pd(), \ ((C) >> 0) & 0x1, ((C) >> 1) & 0x1); }) /// \brief Copies the values in a 256-bit vector of [4 x double] as specified by /// the immediate integer operand. /// /// \headerfile /// /// \code /// __m256d _mm256_permute_pd(__m256d A, const int C); /// \endcode /// /// This intrinsic corresponds to the VPERMILPD instruction. /// /// \param A /// A 256-bit vector of [4 x double]. /// \param C /// An immediate integer operand specifying how the values are to be /// copied. \n /// Bit [0]: \n /// 0: Bits [63:0] of the source are copied to bits [63:0] of the returned /// vector. \n /// 1: Bits [127:64] of the source are copied to bits [63:0] of the /// returned vector. \n /// Bit [1]: \n /// 0: Bits [63:0] of the source are copied to bits [127:64] of the /// returned vector. \n /// 1: Bits [127:64] of the source are copied to bits [127:64] of the /// returned vector. \n /// Bit [2]: \n /// 0: Bits [191:128] of the source are copied to bits [191:128] of the /// returned vector. \n /// 1: Bits [255:192] of the source are copied to bits [191:128] of the /// returned vector. \n /// Bit [3]: \n /// 0: Bits [191:128] of the source are copied to bits [255:192] of the /// returned vector. \n /// 1: Bits [255:192] of the source are copied to bits [255:192] of the /// returned vector. /// \returns A 256-bit vector of [4 x double] containing the copied values. #define _mm256_permute_pd(A, C) __extension__ ({ \ (__m256d)__builtin_shufflevector((__v4df)(__m256d)(A), \ (__v4df)_mm256_undefined_pd(), \ 0 + (((C) >> 0) & 0x1), \ 0 + (((C) >> 1) & 0x1), \ 2 + (((C) >> 2) & 0x1), \ 2 + (((C) >> 3) & 0x1)); }) /// \brief Copies the values in a 128-bit vector of [4 x float] as specified by /// the immediate integer operand. /// /// \headerfile /// /// \code /// __m128 _mm_permute_ps(__m128 A, const int C); /// \endcode /// /// This intrinsic corresponds to the VPERMILPS instruction. /// /// \param A /// A 128-bit vector of [4 x float]. /// \param C /// An immediate integer operand specifying how the values are to be /// copied. \n /// Bits [1:0]: \n /// 00: Bits [31:0] of the source are copied to bits [31:0] of the /// returned vector. \n /// 01: Bits [63:32] of the source are copied to bits [31:0] of the /// returned vector. \n /// 10: Bits [95:64] of the source are copied to bits [31:0] of the /// returned vector. \n /// 11: Bits [127:96] of the source are copied to bits [31:0] of the /// returned vector. \n /// Bits [3:2]: \n /// 00: Bits [31:0] of the source are copied to bits [63:32] of the /// returned vector. \n /// 01: Bits [63:32] of the source are copied to bits [63:32] of the /// returned vector. \n /// 10: Bits [95:64] of the source are copied to bits [63:32] of the /// returned vector. \n /// 11: Bits [127:96] of the source are copied to bits [63:32] of the /// returned vector. \n /// Bits [5:4]: \n /// 00: Bits [31:0] of the source are copied to bits [95:64] of the /// returned vector. \n /// 01: Bits [63:32] of the source are copied to bits [95:64] of the /// returned vector. \n /// 10: Bits [95:64] of the source are copied to bits [95:64] of the /// returned vector. \n /// 11: Bits [127:96] of the source are copied to bits [95:64] of the /// returned vector. \n /// Bits [7:6]: \n /// 00: Bits [31:0] of the source are copied to bits [127:96] of the /// returned vector. \n /// 01: Bits [63:32] of the source are copied to bits [127:96] of the /// returned vector. \n /// 10: Bits [95:64] of the source are copied to bits [127:96] of the /// returned vector. \n /// 11: Bits [127:96] of the source are copied to bits [127:96] of the /// returned vector. /// \returns A 128-bit vector of [4 x float] containing the copied values. #define _mm_permute_ps(A, C) __extension__ ({ \ (__m128)__builtin_shufflevector((__v4sf)(__m128)(A), \ (__v4sf)_mm_undefined_ps(), \ ((C) >> 0) & 0x3, ((C) >> 2) & 0x3, \ ((C) >> 4) & 0x3, ((C) >> 6) & 0x3); }) /// \brief Copies the values in a 256-bit vector of [8 x float] as specified by /// the immediate integer operand. /// /// \headerfile /// /// \code /// __m256 _mm256_permute_ps(__m256 A, const int C); /// \endcode /// /// This intrinsic corresponds to the VPERMILPS instruction. /// /// \param A /// A 256-bit vector of [8 x float]. /// \param C /// An immediate integer operand specifying how the values are to be \n /// copied. \n /// Bits [1:0]: \n /// 00: Bits [31:0] of the source are copied to bits [31:0] of the /// returned vector. \n /// 01: Bits [63:32] of the source are copied to bits [31:0] of the /// returned vector. \n /// 10: Bits [95:64] of the source are copied to bits [31:0] of the /// returned vector. \n /// 11: Bits [127:96] of the source are copied to bits [31:0] of the /// returned vector. \n /// Bits [3:2]: \n /// 00: Bits [31:0] of the source are copied to bits [63:32] of the /// returned vector. \n /// 01: Bits [63:32] of the source are copied to bits [63:32] of the /// returned vector. \n /// 10: Bits [95:64] of the source are copied to bits [63:32] of the /// returned vector. \n /// 11: Bits [127:96] of the source are copied to bits [63:32] of the /// returned vector. \n /// Bits [5:4]: \n /// 00: Bits [31:0] of the source are copied to bits [95:64] of the /// returned vector. \n /// 01: Bits [63:32] of the source are copied to bits [95:64] of the /// returned vector. \n /// 10: Bits [95:64] of the source are copied to bits [95:64] of the /// returned vector. \n /// 11: Bits [127:96] of the source are copied to bits [95:64] of the /// returned vector. \n /// Bits [7:6]: \n /// 00: Bits [31:qq0] of the source are copied to bits [127:96] of the /// returned vector. \n /// 01: Bits [63:32] of the source are copied to bits [127:96] of the /// returned vector. \n /// 10: Bits [95:64] of the source are copied to bits [127:96] of the /// returned vector. \n /// 11: Bits [127:96] of the source are copied to bits [127:96] of the /// returned vector. \n /// Bits [1:0]: \n /// 00: Bits [159:128] of the source are copied to bits [159:128] of the /// returned vector. \n /// 01: Bits [191:160] of the source are copied to bits [159:128] of the /// returned vector. \n /// 10: Bits [223:192] of the source are copied to bits [159:128] of the /// returned vector. \n /// 11: Bits [255:224] of the source are copied to bits [159:128] of the /// returned vector. \n /// Bits [3:2]: \n /// 00: Bits [159:128] of the source are copied to bits [191:160] of the /// returned vector. \n /// 01: Bits [191:160] of the source are copied to bits [191:160] of the /// returned vector. \n /// 10: Bits [223:192] of the source are copied to bits [191:160] of the /// returned vector. \n /// 11: Bits [255:224] of the source are copied to bits [191:160] of the /// returned vector. \n /// Bits [5:4]: \n /// 00: Bits [159:128] of the source are copied to bits [223:192] of the /// returned vector. \n /// 01: Bits [191:160] of the source are copied to bits [223:192] of the /// returned vector. \n /// 10: Bits [223:192] of the source are copied to bits [223:192] of the /// returned vector. \n /// 11: Bits [255:224] of the source are copied to bits [223:192] of the /// returned vector. \n /// Bits [7:6]: \n /// 00: Bits [159:128] of the source are copied to bits [255:224] of the /// returned vector. \n /// 01: Bits [191:160] of the source are copied to bits [255:224] of the /// returned vector. \n /// 10: Bits [223:192] of the source are copied to bits [255:224] of the /// returned vector. \n /// 11: Bits [255:224] of the source are copied to bits [255:224] of the /// returned vector. /// \returns A 256-bit vector of [8 x float] containing the copied values. #define _mm256_permute_ps(A, C) __extension__ ({ \ (__m256)__builtin_shufflevector((__v8sf)(__m256)(A), \ (__v8sf)_mm256_undefined_ps(), \ 0 + (((C) >> 0) & 0x3), \ 0 + (((C) >> 2) & 0x3), \ 0 + (((C) >> 4) & 0x3), \ 0 + (((C) >> 6) & 0x3), \ 4 + (((C) >> 0) & 0x3), \ 4 + (((C) >> 2) & 0x3), \ 4 + (((C) >> 4) & 0x3), \ 4 + (((C) >> 6) & 0x3)); }) /// \brief Permutes 128-bit data values stored in two 256-bit vectors of /// [4 x double], as specified by the immediate integer operand. /// /// \headerfile /// /// \code /// __m256d _mm256_permute2f128_pd(__m256d V1, __m256d V2, const int M); /// \endcode /// /// This intrinsic corresponds to the VPERM2F128 instruction. /// /// \param V1 /// A 256-bit vector of [4 x double]. /// \param V2 /// A 256-bit vector of [4 x double. /// \param M /// An immediate integer operand specifying how the values are to be /// permuted. \n /// Bits [1:0]: \n /// 00: Bits [127:0] of operand \a V1 are copied to bits [127:0] of the /// destination. \n /// 01: Bits [255:128] of operand \a V1 are copied to bits [127:0] of the /// destination. \n /// 10: Bits [127:0] of operand \a V2 are copied to bits [127:0] of the /// destination. \n /// 11: Bits [255:128] of operand \a V2 are copied to bits [127:0] of the /// destination. \n /// Bits [5:4]: \n /// 00: Bits [127:0] of operand \a V1 are copied to bits [255:128] of the /// destination. \n /// 01: Bits [255:128] of operand \a V1 are copied to bits [255:128] of the /// destination. \n /// 10: Bits [127:0] of operand \a V2 are copied to bits [255:128] of the /// destination. \n /// 11: Bits [255:128] of operand \a V2 are copied to bits [255:128] of the /// destination. /// \returns A 256-bit vector of [4 x double] containing the copied values. #define _mm256_permute2f128_pd(V1, V2, M) __extension__ ({ \ (__m256d)__builtin_ia32_vperm2f128_pd256((__v4df)(__m256d)(V1), \ (__v4df)(__m256d)(V2), (M)); }) /// \brief Permutes 128-bit data values stored in two 256-bit vectors of /// [8 x float], as specified by the immediate integer operand. /// /// \headerfile /// /// \code /// __m256 _mm256_permute2f128_ps(__m256 V1, __m256 V2, const int M); /// \endcode /// /// This intrinsic corresponds to the VPERM2F128 instruction. /// /// \param V1 /// A 256-bit vector of [8 x float]. /// \param V2 /// A 256-bit vector of [8 x float]. /// \param M /// An immediate integer operand specifying how the values are to be /// permuted. \n /// Bits [1:0]: \n /// 00: Bits [127:0] of operand \a V1 are copied to bits [127:0] of the /// destination. \n /// 01: Bits [255:128] of operand \a V1 are copied to bits [127:0] of the /// destination. \n /// 10: Bits [127:0] of operand \a V2 are copied to bits [127:0] of the /// destination. \n /// 11: Bits [255:128] of operand \a V2 are copied to bits [127:0] of the /// destination. \n /// Bits [5:4]: \n /// 00: Bits [127:0] of operand \a V1 are copied to bits [255:128] of the /// destination. \n /// 01: Bits [255:128] of operand \a V1 are copied to bits [255:128] of the /// destination. \n /// 10: Bits [127:0] of operand \a V2 are copied to bits [255:128] of the /// destination. \n /// 11: Bits [255:128] of operand \a V2 are copied to bits [255:128] of the /// destination. /// \returns A 256-bit vector of [8 x float] containing the copied values. #define _mm256_permute2f128_ps(V1, V2, M) __extension__ ({ \ (__m256)__builtin_ia32_vperm2f128_ps256((__v8sf)(__m256)(V1), \ (__v8sf)(__m256)(V2), (M)); }) /// \brief Permutes 128-bit data values stored in two 256-bit integer vectors, /// as specified by the immediate integer operand. /// /// \headerfile /// /// \code /// __m256i _mm256_permute2f128_si256(__m256i V1, __m256i V2, const int M); /// \endcode /// /// This intrinsic corresponds to the VPERM2F128 instruction. /// /// \param V1 /// A 256-bit integer vector. /// \param V2 /// A 256-bit integer vector. /// \param M /// An immediate integer operand specifying how the values are to be copied. /// Bits [1:0]: \n /// 00: Bits [127:0] of operand \a V1 are copied to bits [127:0] of the /// destination. \n /// 01: Bits [255:128] of operand \a V1 are copied to bits [127:0] of the /// destination. \n /// 10: Bits [127:0] of operand \a V2 are copied to bits [127:0] of the /// destination. \n /// 11: Bits [255:128] of operand \a V2 are copied to bits [127:0] of the /// destination. \n /// Bits [5:4]: \n /// 00: Bits [127:0] of operand \a V1 are copied to bits [255:128] of the /// destination. \n /// 01: Bits [255:128] of operand \a V1 are copied to bits [255:128] of the /// destination. \n /// 10: Bits [127:0] of operand \a V2 are copied to bits [255:128] of the /// destination. \n /// 11: Bits [255:128] of operand \a V2 are copied to bits [255:128] of the /// destination. /// \returns A 256-bit integer vector containing the copied values. #define _mm256_permute2f128_si256(V1, V2, M) __extension__ ({ \ (__m256i)__builtin_ia32_vperm2f128_si256((__v8si)(__m256i)(V1), \ (__v8si)(__m256i)(V2), (M)); }) /* Vector Blend */ /// \brief Merges 64-bit double-precision data values stored in either of the /// two 256-bit vectors of [4 x double], as specified by the immediate /// integer operand. /// /// \headerfile /// /// \code /// __m256d _mm256_blend_pd(__m256d V1, __m256d V2, const int M); /// \endcode /// /// This intrinsic corresponds to the VBLENDPD instruction. /// /// \param V1 /// A 256-bit vector of [4 x double]. /// \param V2 /// A 256-bit vector of [4 x double]. /// \param M /// An immediate integer operand, with mask bits [3:0] specifying how the /// values are to be copied. The position of the mask bit corresponds to the /// index of a copied value. When a mask bit is 0, the corresponding 64-bit /// element in operand \a V1 is copied to the same position in the /// destination. When a mask bit is 1, the corresponding 64-bit element in /// operand \a V2 is copied to the same position in the destination. /// \returns A 256-bit vector of [4 x double] containing the copied values. #define _mm256_blend_pd(V1, V2, M) __extension__ ({ \ (__m256d)__builtin_shufflevector((__v4df)(__m256d)(V1), \ (__v4df)(__m256d)(V2), \ (((M) & 0x01) ? 4 : 0), \ (((M) & 0x02) ? 5 : 1), \ (((M) & 0x04) ? 6 : 2), \ (((M) & 0x08) ? 7 : 3)); }) /// \brief Merges 32-bit single-precision data values stored in either of the /// two 256-bit vectors of [8 x float], as specified by the immediate /// integer operand. /// /// \headerfile /// /// \code /// __m256 _mm256_blend_ps(__m256 V1, __m256 V2, const int M); /// \endcode /// /// This intrinsic corresponds to the VBLENDPS instruction. /// /// \param V1 /// A 256-bit vector of [8 x float]. /// \param V2 /// A 256-bit vector of [8 x float]. /// \param M /// An immediate integer operand, with mask bits [7:0] specifying how the /// values are to be copied. The position of the mask bit corresponds to the /// index of a copied value. When a mask bit is 0, the corresponding 32-bit /// element in operand \a V1 is copied to the same position in the /// destination. When a mask bit is 1, the corresponding 32-bit element in /// operand \a V2 is copied to the same position in the destination. /// \returns A 256-bit vector of [8 x float] containing the copied values. #define _mm256_blend_ps(V1, V2, M) __extension__ ({ \ (__m256)__builtin_shufflevector((__v8sf)(__m256)(V1), \ (__v8sf)(__m256)(V2), \ (((M) & 0x01) ? 8 : 0), \ (((M) & 0x02) ? 9 : 1), \ (((M) & 0x04) ? 10 : 2), \ (((M) & 0x08) ? 11 : 3), \ (((M) & 0x10) ? 12 : 4), \ (((M) & 0x20) ? 13 : 5), \ (((M) & 0x40) ? 14 : 6), \ (((M) & 0x80) ? 15 : 7)); }) /// \brief Merges 64-bit double-precision data values stored in either of the /// two 256-bit vectors of [4 x double], as specified by the 256-bit vector /// operand. /// /// \headerfile /// /// This intrinsic corresponds to the VBLENDVPD instruction. /// /// \param __a /// A 256-bit vector of [4 x double]. /// \param __b /// A 256-bit vector of [4 x double]. /// \param __c /// A 256-bit vector operand, with mask bits 255, 191, 127, and 63 specifying /// how the values are to be copied. The position of the mask bit corresponds /// to the most significant bit of a copied value. When a mask bit is 0, the /// corresponding 64-bit element in operand \a __a is copied to the same /// position in the destination. When a mask bit is 1, the corresponding /// 64-bit element in operand \a __b is copied to the same position in the /// destination. /// \returns A 256-bit vector of [4 x double] containing the copied values. static __inline __m256d __DEFAULT_FN_ATTRS _mm256_blendv_pd(__m256d __a, __m256d __b, __m256d __c) { return (__m256d)__builtin_ia32_blendvpd256( (__v4df)__a, (__v4df)__b, (__v4df)__c); } /// \brief Merges 32-bit single-precision data values stored in either of the /// two 256-bit vectors of [8 x float], as specified by the 256-bit vector /// operand. /// /// \headerfile /// /// This intrinsic corresponds to the VBLENDVPS instruction. /// /// \param __a /// A 256-bit vector of [8 x float]. /// \param __b /// A 256-bit vector of [8 x float]. /// \param __c /// A 256-bit vector operand, with mask bits 255, 223, 191, 159, 127, 95, 63, /// and 31 specifying how the values are to be copied. The position of the /// mask bit corresponds to the most significant bit of a copied value. When /// a mask bit is 0, the corresponding 32-bit element in operand \a __a is /// copied to the same position in the destination. When a mask bit is 1, the /// corresponding 32-bit element in operand \a __b is copied to the same /// position in the destination. /// \returns A 256-bit vector of [8 x float] containing the copied values. static __inline __m256 __DEFAULT_FN_ATTRS _mm256_blendv_ps(__m256 __a, __m256 __b, __m256 __c) { return (__m256)__builtin_ia32_blendvps256( (__v8sf)__a, (__v8sf)__b, (__v8sf)__c); } /* Vector Dot Product */ /// \brief Computes two dot products in parallel, using the lower and upper /// halves of two [8 x float] vectors as input to the two computations, and /// returning the two dot products in the lower and upper halves of the /// [8 x float] result. /// /// The immediate integer operand controls which input elements will /// contribute to the dot product, and where the final results are returned. /// In general, for each dot product, the four corresponding elements of the /// input vectors are multiplied; the first two and second two products are /// summed, then the two sums are added to form the final result. /// /// \headerfile /// /// \code /// __m256 _mm256_dp_ps(__m256 V1, __m256 V2, const int M); /// \endcode /// /// This intrinsic corresponds to the VDPPS instruction. /// /// \param V1 /// A vector of [8 x float] values, treated as two [4 x float] vectors. /// \param V2 /// A vector of [8 x float] values, treated as two [4 x float] vectors. /// \param M /// An immediate integer argument. Bits [7:4] determine which elements of /// the input vectors are used, with bit [4] corresponding to the lowest /// element and bit [7] corresponding to the highest element of each [4 x /// float] subvector. If a bit is set, the corresponding elements from the /// two input vectors are used as an input for dot product; otherwise that /// input is treated as zero. Bits [3:0] determine which elements of the /// result will receive a copy of the final dot product, with bit [0] /// corresponding to the lowest element and bit [3] corresponding to the /// highest element of each [4 x float] subvector. If a bit is set, the dot /// product is returned in the corresponding element; otherwise that element /// is set to zero. The bitmask is applied in the same way to each of the /// two parallel dot product computations. /// \returns A 256-bit vector of [8 x float] containing the two dot products. #define _mm256_dp_ps(V1, V2, M) __extension__ ({ \ (__m256)__builtin_ia32_dpps256((__v8sf)(__m256)(V1), \ (__v8sf)(__m256)(V2), (M)); }) /* Vector shuffle */ /// \brief Selects 8 float values from the 256-bit operands of [8 x float], as /// specified by the immediate value operand. /// /// The four selected elements in each operand are copied to the destination /// according to the bits specified in the immediate operand. The selected /// elements from the first 256-bit operand are copied to bits [63:0] and /// bits [191:128] of the destination, and the selected elements from the /// second 256-bit operand are copied to bits [127:64] and bits [255:192] of /// the destination. For example, if bits [7:0] of the immediate operand /// contain a value of 0xFF, the 256-bit destination vector would contain the /// following values: b[7], b[7], a[7], a[7], b[3], b[3], a[3], a[3]. /// /// \headerfile /// /// \code /// __m256 _mm256_shuffle_ps(__m256 a, __m256 b, const int mask); /// \endcode /// /// This intrinsic corresponds to the VSHUFPS instruction. /// /// \param a /// A 256-bit vector of [8 x float]. The four selected elements in this /// operand are copied to bits [63:0] and bits [191:128] in the destination, /// according to the bits specified in the immediate operand. /// \param b /// A 256-bit vector of [8 x float]. The four selected elements in this /// operand are copied to bits [127:64] and bits [255:192] in the /// destination, according to the bits specified in the immediate operand. /// \param mask /// An immediate value containing an 8-bit value specifying which elements to /// copy from \a a and \a b \n. /// Bits [3:0] specify the values copied from operand \a a. \n /// Bits [7:4] specify the values copied from operand \a b. \n /// The destinations within the 256-bit destination are assigned values as /// follows, according to the bit value assignments described below: \n /// Bits [1:0] are used to assign values to bits [31:0] and [159:128] in the /// destination. \n /// Bits [3:2] are used to assign values to bits [63:32] and [191:160] in the /// destination. \n /// Bits [5:4] are used to assign values to bits [95:64] and [223:192] in the /// destination. \n /// Bits [7:6] are used to assign values to bits [127:96] and [255:224] in /// the destination. \n /// Bit value assignments: \n /// 00: Bits [31:0] and [159:128] are copied from the selected operand. \n /// 01: Bits [63:32] and [191:160] are copied from the selected operand. \n /// 10: Bits [95:64] and [223:192] are copied from the selected operand. \n /// 11: Bits [127:96] and [255:224] are copied from the selected operand. /// \returns A 256-bit vector of [8 x float] containing the shuffled values. #define _mm256_shuffle_ps(a, b, mask) __extension__ ({ \ (__m256)__builtin_shufflevector((__v8sf)(__m256)(a), \ (__v8sf)(__m256)(b), \ 0 + (((mask) >> 0) & 0x3), \ 0 + (((mask) >> 2) & 0x3), \ 8 + (((mask) >> 4) & 0x3), \ 8 + (((mask) >> 6) & 0x3), \ 4 + (((mask) >> 0) & 0x3), \ 4 + (((mask) >> 2) & 0x3), \ 12 + (((mask) >> 4) & 0x3), \ 12 + (((mask) >> 6) & 0x3)); }) /// \brief Selects four double-precision values from the 256-bit operands of /// [4 x double], as specified by the immediate value operand. /// /// The selected elements from the first 256-bit operand are copied to bits /// [63:0] and bits [191:128] in the destination, and the selected elements /// from the second 256-bit operand are copied to bits [127:64] and bits /// [255:192] in the destination. For example, if bits [3:0] of the immediate /// operand contain a value of 0xF, the 256-bit destination vector would /// contain the following values: b[3], a[3], b[1], a[1]. /// /// \headerfile /// /// \code /// __m256d _mm256_shuffle_pd(__m256d a, __m256d b, const int mask); /// \endcode /// /// This intrinsic corresponds to the VSHUFPD instruction. /// /// \param a /// A 256-bit vector of [4 x double]. /// \param b /// A 256-bit vector of [4 x double]. /// \param mask /// An immediate value containing 8-bit values specifying which elements to /// copy from \a a and \a b: \n /// Bit [0]=0: Bits [63:0] are copied from \a a to bits [63:0] of the /// destination. \n /// Bit [0]=1: Bits [127:64] are copied from \a a to bits [63:0] of the /// destination. \n /// Bit [1]=0: Bits [63:0] are copied from \a b to bits [127:64] of the /// destination. \n /// Bit [1]=1: Bits [127:64] are copied from \a b to bits [127:64] of the /// destination. \n /// Bit [2]=0: Bits [191:128] are copied from \a a to bits [191:128] of the /// destination. \n /// Bit [2]=1: Bits [255:192] are copied from \a a to bits [191:128] of the /// destination. \n /// Bit [3]=0: Bits [191:128] are copied from \a b to bits [255:192] of the /// destination. \n /// Bit [3]=1: Bits [255:192] are copied from \a b to bits [255:192] of the /// destination. /// \returns A 256-bit vector of [4 x double] containing the shuffled values. #define _mm256_shuffle_pd(a, b, mask) __extension__ ({ \ (__m256d)__builtin_shufflevector((__v4df)(__m256d)(a), \ (__v4df)(__m256d)(b), \ 0 + (((mask) >> 0) & 0x1), \ 4 + (((mask) >> 1) & 0x1), \ 2 + (((mask) >> 2) & 0x1), \ 6 + (((mask) >> 3) & 0x1)); }) /* Compare */ #define _CMP_EQ_OQ 0x00 /* Equal (ordered, non-signaling) */ #define _CMP_LT_OS 0x01 /* Less-than (ordered, signaling) */ #define _CMP_LE_OS 0x02 /* Less-than-or-equal (ordered, signaling) */ #define _CMP_UNORD_Q 0x03 /* Unordered (non-signaling) */ #define _CMP_NEQ_UQ 0x04 /* Not-equal (unordered, non-signaling) */ #define _CMP_NLT_US 0x05 /* Not-less-than (unordered, signaling) */ #define _CMP_NLE_US 0x06 /* Not-less-than-or-equal (unordered, signaling) */ #define _CMP_ORD_Q 0x07 /* Ordered (non-signaling) */ #define _CMP_EQ_UQ 0x08 /* Equal (unordered, non-signaling) */ #define _CMP_NGE_US 0x09 /* Not-greater-than-or-equal (unordered, signaling) */ #define _CMP_NGT_US 0x0a /* Not-greater-than (unordered, signaling) */ #define _CMP_FALSE_OQ 0x0b /* False (ordered, non-signaling) */ #define _CMP_NEQ_OQ 0x0c /* Not-equal (ordered, non-signaling) */ #define _CMP_GE_OS 0x0d /* Greater-than-or-equal (ordered, signaling) */ #define _CMP_GT_OS 0x0e /* Greater-than (ordered, signaling) */ #define _CMP_TRUE_UQ 0x0f /* True (unordered, non-signaling) */ #define _CMP_EQ_OS 0x10 /* Equal (ordered, signaling) */ #define _CMP_LT_OQ 0x11 /* Less-than (ordered, non-signaling) */ #define _CMP_LE_OQ 0x12 /* Less-than-or-equal (ordered, non-signaling) */ #define _CMP_UNORD_S 0x13 /* Unordered (signaling) */ #define _CMP_NEQ_US 0x14 /* Not-equal (unordered, signaling) */ #define _CMP_NLT_UQ 0x15 /* Not-less-than (unordered, non-signaling) */ #define _CMP_NLE_UQ 0x16 /* Not-less-than-or-equal (unordered, non-signaling) */ #define _CMP_ORD_S 0x17 /* Ordered (signaling) */ #define _CMP_EQ_US 0x18 /* Equal (unordered, signaling) */ #define _CMP_NGE_UQ 0x19 /* Not-greater-than-or-equal (unordered, non-signaling) */ #define _CMP_NGT_UQ 0x1a /* Not-greater-than (unordered, non-signaling) */ #define _CMP_FALSE_OS 0x1b /* False (ordered, signaling) */ #define _CMP_NEQ_OS 0x1c /* Not-equal (ordered, signaling) */ #define _CMP_GE_OQ 0x1d /* Greater-than-or-equal (ordered, non-signaling) */ #define _CMP_GT_OQ 0x1e /* Greater-than (ordered, non-signaling) */ #define _CMP_TRUE_US 0x1f /* True (unordered, signaling) */ /// \brief Compares each of the corresponding double-precision values of two /// 128-bit vectors of [2 x double], using the operation specified by the /// immediate integer operand. /// /// Returns a [2 x double] vector consisting of two doubles corresponding to /// the two comparison results: zero if the comparison is false, and all 1's /// if the comparison is true. /// /// \headerfile /// /// \code /// __m128d _mm_cmp_pd(__m128d a, __m128d b, const int c); /// \endcode /// /// This intrinsic corresponds to the VCMPPD instruction. /// /// \param a /// A 128-bit vector of [2 x double]. /// \param b /// A 128-bit vector of [2 x double]. /// \param c /// An immediate integer operand, with bits [4:0] specifying which comparison /// operation to use: \n /// 0x00 : Equal (ordered, non-signaling) /// 0x01 : Less-than (ordered, signaling) /// 0x02 : Less-than-or-equal (ordered, signaling) /// 0x03 : Unordered (non-signaling) /// 0x04 : Not-equal (unordered, non-signaling) /// 0x05 : Not-less-than (unordered, signaling) /// 0x06 : Not-less-than-or-equal (unordered, signaling) /// 0x07 : Ordered (non-signaling) /// 0x08 : Equal (unordered, non-signaling) /// 0x09 : Not-greater-than-or-equal (unordered, signaling) /// 0x0a : Not-greater-than (unordered, signaling) /// 0x0b : False (ordered, non-signaling) /// 0x0c : Not-equal (ordered, non-signaling) /// 0x0d : Greater-than-or-equal (ordered, signaling) /// 0x0e : Greater-than (ordered, signaling) /// 0x0f : True (unordered, non-signaling) /// 0x10 : Equal (ordered, signaling) /// 0x11 : Less-than (ordered, non-signaling) /// 0x12 : Less-than-or-equal (ordered, non-signaling) /// 0x13 : Unordered (signaling) /// 0x14 : Not-equal (unordered, signaling) /// 0x15 : Not-less-than (unordered, non-signaling) /// 0x16 : Not-less-than-or-equal (unordered, non-signaling) /// 0x17 : Ordered (signaling) /// 0x18 : Equal (unordered, signaling) /// 0x19 : Not-greater-than-or-equal (unordered, non-signaling) /// 0x1a : Not-greater-than (unordered, non-signaling) /// 0x1b : False (ordered, signaling) /// 0x1c : Not-equal (ordered, signaling) /// 0x1d : Greater-than-or-equal (ordered, non-signaling) /// 0x1e : Greater-than (ordered, non-signaling) /// 0x1f : True (unordered, signaling) /// \returns A 128-bit vector of [2 x double] containing the comparison results. #define _mm_cmp_pd(a, b, c) __extension__ ({ \ (__m128d)__builtin_ia32_cmppd((__v2df)(__m128d)(a), \ (__v2df)(__m128d)(b), (c)); }) /// \brief Compares each of the corresponding values of two 128-bit vectors of /// [4 x float], using the operation specified by the immediate integer /// operand. /// /// Returns a [4 x float] vector consisting of four floats corresponding to /// the four comparison results: zero if the comparison is false, and all 1's /// if the comparison is true. /// /// \headerfile /// /// \code /// __m128 _mm_cmp_ps(__m128 a, __m128 b, const int c); /// \endcode /// /// This intrinsic corresponds to the VCMPPS instruction. /// /// \param a /// A 128-bit vector of [4 x float]. /// \param b /// A 128-bit vector of [4 x float]. /// \param c /// An immediate integer operand, with bits [4:0] specifying which comparison /// operation to use: \n /// 0x00 : Equal (ordered, non-signaling) /// 0x01 : Less-than (ordered, signaling) /// 0x02 : Less-than-or-equal (ordered, signaling) /// 0x03 : Unordered (non-signaling) /// 0x04 : Not-equal (unordered, non-signaling) /// 0x05 : Not-less-than (unordered, signaling) /// 0x06 : Not-less-than-or-equal (unordered, signaling) /// 0x07 : Ordered (non-signaling) /// 0x08 : Equal (unordered, non-signaling) /// 0x09 : Not-greater-than-or-equal (unordered, signaling) /// 0x0a : Not-greater-than (unordered, signaling) /// 0x0b : False (ordered, non-signaling) /// 0x0c : Not-equal (ordered, non-signaling) /// 0x0d : Greater-than-or-equal (ordered, signaling) /// 0x0e : Greater-than (ordered, signaling) /// 0x0f : True (unordered, non-signaling) /// 0x10 : Equal (ordered, signaling) /// 0x11 : Less-than (ordered, non-signaling) /// 0x12 : Less-than-or-equal (ordered, non-signaling) /// 0x13 : Unordered (signaling) /// 0x14 : Not-equal (unordered, signaling) /// 0x15 : Not-less-than (unordered, non-signaling) /// 0x16 : Not-less-than-or-equal (unordered, non-signaling) /// 0x17 : Ordered (signaling) /// 0x18 : Equal (unordered, signaling) /// 0x19 : Not-greater-than-or-equal (unordered, non-signaling) /// 0x1a : Not-greater-than (unordered, non-signaling) /// 0x1b : False (ordered, signaling) /// 0x1c : Not-equal (ordered, signaling) /// 0x1d : Greater-than-or-equal (ordered, non-signaling) /// 0x1e : Greater-than (ordered, non-signaling) /// 0x1f : True (unordered, signaling) /// \returns A 128-bit vector of [4 x float] containing the comparison results. #define _mm_cmp_ps(a, b, c) __extension__ ({ \ (__m128)__builtin_ia32_cmpps((__v4sf)(__m128)(a), \ (__v4sf)(__m128)(b), (c)); }) /// \brief Compares each of the corresponding double-precision values of two /// 256-bit vectors of [4 x double], using the operation specified by the /// immediate integer operand. /// /// Returns a [4 x double] vector consisting of four doubles corresponding to /// the four comparison results: zero if the comparison is false, and all 1's /// if the comparison is true. /// /// \headerfile /// /// \code /// __m256d _mm256_cmp_pd(__m256d a, __m256d b, const int c); /// \endcode /// /// This intrinsic corresponds to the VCMPPD instruction. /// /// \param a /// A 256-bit vector of [4 x double]. /// \param b /// A 256-bit vector of [4 x double]. /// \param c /// An immediate integer operand, with bits [4:0] specifying which comparison /// operation to use: \n /// 0x00 : Equal (ordered, non-signaling) /// 0x01 : Less-than (ordered, signaling) /// 0x02 : Less-than-or-equal (ordered, signaling) /// 0x03 : Unordered (non-signaling) /// 0x04 : Not-equal (unordered, non-signaling) /// 0x05 : Not-less-than (unordered, signaling) /// 0x06 : Not-less-than-or-equal (unordered, signaling) /// 0x07 : Ordered (non-signaling) /// 0x08 : Equal (unordered, non-signaling) /// 0x09 : Not-greater-than-or-equal (unordered, signaling) /// 0x0a : Not-greater-than (unordered, signaling) /// 0x0b : False (ordered, non-signaling) /// 0x0c : Not-equal (ordered, non-signaling) /// 0x0d : Greater-than-or-equal (ordered, signaling) /// 0x0e : Greater-than (ordered, signaling) /// 0x0f : True (unordered, non-signaling) /// 0x10 : Equal (ordered, signaling) /// 0x11 : Less-than (ordered, non-signaling) /// 0x12 : Less-than-or-equal (ordered, non-signaling) /// 0x13 : Unordered (signaling) /// 0x14 : Not-equal (unordered, signaling) /// 0x15 : Not-less-than (unordered, non-signaling) /// 0x16 : Not-less-than-or-equal (unordered, non-signaling) /// 0x17 : Ordered (signaling) /// 0x18 : Equal (unordered, signaling) /// 0x19 : Not-greater-than-or-equal (unordered, non-signaling) /// 0x1a : Not-greater-than (unordered, non-signaling) /// 0x1b : False (ordered, signaling) /// 0x1c : Not-equal (ordered, signaling) /// 0x1d : Greater-than-or-equal (ordered, non-signaling) /// 0x1e : Greater-than (ordered, non-signaling) /// 0x1f : True (unordered, signaling) /// \returns A 256-bit vector of [4 x double] containing the comparison results. #define _mm256_cmp_pd(a, b, c) __extension__ ({ \ (__m256d)__builtin_ia32_cmppd256((__v4df)(__m256d)(a), \ (__v4df)(__m256d)(b), (c)); }) /// \brief Compares each of the corresponding values of two 256-bit vectors of /// [8 x float], using the operation specified by the immediate integer /// operand. /// /// Returns a [8 x float] vector consisting of eight floats corresponding to /// the eight comparison results: zero if the comparison is false, and all /// 1's if the comparison is true. /// /// \headerfile /// /// \code /// __m256 _mm256_cmp_ps(__m256 a, __m256 b, const int c); /// \endcode /// /// This intrinsic corresponds to the VCMPPS instruction. /// /// \param a /// A 256-bit vector of [8 x float]. /// \param b /// A 256-bit vector of [8 x float]. /// \param c /// An immediate integer operand, with bits [4:0] specifying which comparison /// operation to use: \n /// 0x00 : Equal (ordered, non-signaling) /// 0x01 : Less-than (ordered, signaling) /// 0x02 : Less-than-or-equal (ordered, signaling) /// 0x03 : Unordered (non-signaling) /// 0x04 : Not-equal (unordered, non-signaling) /// 0x05 : Not-less-than (unordered, signaling) /// 0x06 : Not-less-than-or-equal (unordered, signaling) /// 0x07 : Ordered (non-signaling) /// 0x08 : Equal (unordered, non-signaling) /// 0x09 : Not-greater-than-or-equal (unordered, signaling) /// 0x0a : Not-greater-than (unordered, signaling) /// 0x0b : False (ordered, non-signaling) /// 0x0c : Not-equal (ordered, non-signaling) /// 0x0d : Greater-than-or-equal (ordered, signaling) /// 0x0e : Greater-than (ordered, signaling) /// 0x0f : True (unordered, non-signaling) /// 0x10 : Equal (ordered, signaling) /// 0x11 : Less-than (ordered, non-signaling) /// 0x12 : Less-than-or-equal (ordered, non-signaling) /// 0x13 : Unordered (signaling) /// 0x14 : Not-equal (unordered, signaling) /// 0x15 : Not-less-than (unordered, non-signaling) /// 0x16 : Not-less-than-or-equal (unordered, non-signaling) /// 0x17 : Ordered (signaling) /// 0x18 : Equal (unordered, signaling) /// 0x19 : Not-greater-than-or-equal (unordered, non-signaling) /// 0x1a : Not-greater-than (unordered, non-signaling) /// 0x1b : False (ordered, signaling) /// 0x1c : Not-equal (ordered, signaling) /// 0x1d : Greater-than-or-equal (ordered, non-signaling) /// 0x1e : Greater-than (ordered, non-signaling) /// 0x1f : True (unordered, signaling) /// \returns A 256-bit vector of [8 x float] containing the comparison results. #define _mm256_cmp_ps(a, b, c) __extension__ ({ \ (__m256)__builtin_ia32_cmpps256((__v8sf)(__m256)(a), \ (__v8sf)(__m256)(b), (c)); }) /// \brief Compares each of the corresponding scalar double-precision values of /// two 128-bit vectors of [2 x double], using the operation specified by the /// immediate integer operand. /// /// If the result is true, all 64 bits of the destination vector are set; /// otherwise they are cleared. /// /// \headerfile /// /// \code /// __m128d _mm_cmp_sd(__m128d a, __m128d b, const int c); /// \endcode /// /// This intrinsic corresponds to the VCMPSD instruction. /// /// \param a /// A 128-bit vector of [2 x double]. /// \param b /// A 128-bit vector of [2 x double]. /// \param c /// An immediate integer operand, with bits [4:0] specifying which comparison /// operation to use: \n /// 0x00 : Equal (ordered, non-signaling) /// 0x01 : Less-than (ordered, signaling) /// 0x02 : Less-than-or-equal (ordered, signaling) /// 0x03 : Unordered (non-signaling) /// 0x04 : Not-equal (unordered, non-signaling) /// 0x05 : Not-less-than (unordered, signaling) /// 0x06 : Not-less-than-or-equal (unordered, signaling) /// 0x07 : Ordered (non-signaling) /// 0x08 : Equal (unordered, non-signaling) /// 0x09 : Not-greater-than-or-equal (unordered, signaling) /// 0x0a : Not-greater-than (unordered, signaling) /// 0x0b : False (ordered, non-signaling) /// 0x0c : Not-equal (ordered, non-signaling) /// 0x0d : Greater-than-or-equal (ordered, signaling) /// 0x0e : Greater-than (ordered, signaling) /// 0x0f : True (unordered, non-signaling) /// 0x10 : Equal (ordered, signaling) /// 0x11 : Less-than (ordered, non-signaling) /// 0x12 : Less-than-or-equal (ordered, non-signaling) /// 0x13 : Unordered (signaling) /// 0x14 : Not-equal (unordered, signaling) /// 0x15 : Not-less-than (unordered, non-signaling) /// 0x16 : Not-less-than-or-equal (unordered, non-signaling) /// 0x17 : Ordered (signaling) /// 0x18 : Equal (unordered, signaling) /// 0x19 : Not-greater-than-or-equal (unordered, non-signaling) /// 0x1a : Not-greater-than (unordered, non-signaling) /// 0x1b : False (ordered, signaling) /// 0x1c : Not-equal (ordered, signaling) /// 0x1d : Greater-than-or-equal (ordered, non-signaling) /// 0x1e : Greater-than (ordered, non-signaling) /// 0x1f : True (unordered, signaling) /// \returns A 128-bit vector of [2 x double] containing the comparison results. #define _mm_cmp_sd(a, b, c) __extension__ ({ \ (__m128d)__builtin_ia32_cmpsd((__v2df)(__m128d)(a), \ (__v2df)(__m128d)(b), (c)); }) /// \brief Compares each of the corresponding scalar values of two 128-bit /// vectors of [4 x float], using the operation specified by the immediate /// integer operand. /// /// If the result is true, all 32 bits of the destination vector are set; /// otherwise they are cleared. /// /// \headerfile /// /// \code /// __m128 _mm_cmp_ss(__m128 a, __m128 b, const int c); /// \endcode /// /// This intrinsic corresponds to the VCMPSS instruction. /// /// \param a /// A 128-bit vector of [4 x float]. /// \param b /// A 128-bit vector of [4 x float]. /// \param c /// An immediate integer operand, with bits [4:0] specifying which comparison /// operation to use: \n /// 0x00 : Equal (ordered, non-signaling) /// 0x01 : Less-than (ordered, signaling) /// 0x02 : Less-than-or-equal (ordered, signaling) /// 0x03 : Unordered (non-signaling) /// 0x04 : Not-equal (unordered, non-signaling) /// 0x05 : Not-less-than (unordered, signaling) /// 0x06 : Not-less-than-or-equal (unordered, signaling) /// 0x07 : Ordered (non-signaling) /// 0x08 : Equal (unordered, non-signaling) /// 0x09 : Not-greater-than-or-equal (unordered, signaling) /// 0x0a : Not-greater-than (unordered, signaling) /// 0x0b : False (ordered, non-signaling) /// 0x0c : Not-equal (ordered, non-signaling) /// 0x0d : Greater-than-or-equal (ordered, signaling) /// 0x0e : Greater-than (ordered, signaling) /// 0x0f : True (unordered, non-signaling) /// 0x10 : Equal (ordered, signaling) /// 0x11 : Less-than (ordered, non-signaling) /// 0x12 : Less-than-or-equal (ordered, non-signaling) /// 0x13 : Unordered (signaling) /// 0x14 : Not-equal (unordered, signaling) /// 0x15 : Not-less-than (unordered, non-signaling) /// 0x16 : Not-less-than-or-equal (unordered, non-signaling) /// 0x17 : Ordered (signaling) /// 0x18 : Equal (unordered, signaling) /// 0x19 : Not-greater-than-or-equal (unordered, non-signaling) /// 0x1a : Not-greater-than (unordered, non-signaling) /// 0x1b : False (ordered, signaling) /// 0x1c : Not-equal (ordered, signaling) /// 0x1d : Greater-than-or-equal (ordered, non-signaling) /// 0x1e : Greater-than (ordered, non-signaling) /// 0x1f : True (unordered, signaling) /// \returns A 128-bit vector of [4 x float] containing the comparison results. #define _mm_cmp_ss(a, b, c) __extension__ ({ \ (__m128)__builtin_ia32_cmpss((__v4sf)(__m128)(a), \ (__v4sf)(__m128)(b), (c)); }) /// \brief Takes a [8 x i32] vector and returns the vector element value /// indexed by the immediate constant operand. /// /// \headerfile /// /// This intrinsic corresponds to the VEXTRACTF128+COMPOSITE /// instruction. /// /// \param __a /// A 256-bit vector of [8 x i32]. /// \param __imm /// An immediate integer operand with bits [2:0] determining which vector /// element is extracted and returned. /// \returns A 32-bit integer containing the extracted 32 bits of extended /// packed data. static __inline int __DEFAULT_FN_ATTRS _mm256_extract_epi32(__m256i __a, const int __imm) { __v8si __b = (__v8si)__a; return __b[__imm & 7]; } /// \brief Takes a [16 x i16] vector and returns the vector element value /// indexed by the immediate constant operand. /// /// \headerfile /// /// This intrinsic corresponds to the VEXTRACTF128+COMPOSITE /// instruction. /// /// \param __a /// A 256-bit integer vector of [16 x i16]. /// \param __imm /// An immediate integer operand with bits [3:0] determining which vector /// element is extracted and returned. /// \returns A 32-bit integer containing the extracted 16 bits of zero extended /// packed data. static __inline int __DEFAULT_FN_ATTRS _mm256_extract_epi16(__m256i __a, const int __imm) { __v16hi __b = (__v16hi)__a; return (unsigned short)__b[__imm & 15]; } /// \brief Takes a [32 x i8] vector and returns the vector element value /// indexed by the immediate constant operand. /// /// \headerfile /// /// This intrinsic corresponds to the VEXTRACTF128+COMPOSITE /// instruction. /// /// \param __a /// A 256-bit integer vector of [32 x i8]. /// \param __imm /// An immediate integer operand with bits [4:0] determining which vector /// element is extracted and returned. /// \returns A 32-bit integer containing the extracted 8 bits of zero extended /// packed data. static __inline int __DEFAULT_FN_ATTRS _mm256_extract_epi8(__m256i __a, const int __imm) { __v32qi __b = (__v32qi)__a; return (unsigned char)__b[__imm & 31]; } #ifdef __x86_64__ /// \brief Takes a [4 x i64] vector and returns the vector element value /// indexed by the immediate constant operand. /// /// \headerfile /// /// This intrinsic corresponds to the VEXTRACTF128+COMPOSITE /// instruction. /// /// \param __a /// A 256-bit integer vector of [4 x i64]. /// \param __imm /// An immediate integer operand with bits [1:0] determining which vector /// element is extracted and returned. /// \returns A 64-bit integer containing the extracted 64 bits of extended /// packed data. static __inline long long __DEFAULT_FN_ATTRS _mm256_extract_epi64(__m256i __a, const int __imm) { __v4di __b = (__v4di)__a; return __b[__imm & 3]; } #endif # 2092 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avxintrin.h" 3 /// \brief Takes a [8 x i32] vector and replaces the vector element value /// indexed by the immediate constant operand by a new value. Returns the /// modified vector. /// /// \headerfile /// /// This intrinsic corresponds to the VINSERTF128+COMPOSITE /// instruction. /// /// \param __a /// A vector of [8 x i32] to be used by the insert operation. /// \param __b /// An integer value. The replacement value for the insert operation. /// \param __imm /// An immediate integer specifying the index of the vector element to be /// replaced. /// \returns A copy of vector \a __a, after replacing its element indexed by /// \a __imm with \a __b. static __inline __m256i __DEFAULT_FN_ATTRS _mm256_insert_epi32(__m256i __a, int __b, int const __imm) { __v8si __c = (__v8si)__a; __c[__imm & 7] = __b; return (__m256i)__c; } /// \brief Takes a [16 x i16] vector and replaces the vector element value /// indexed by the immediate constant operand with a new value. Returns the /// modified vector. /// /// \headerfile /// /// This intrinsic corresponds to the VINSERTF128+COMPOSITE /// instruction. /// /// \param __a /// A vector of [16 x i16] to be used by the insert operation. /// \param __b /// An i16 integer value. The replacement value for the insert operation. /// \param __imm /// An immediate integer specifying the index of the vector element to be /// replaced. /// \returns A copy of vector \a __a, after replacing its element indexed by /// \a __imm with \a __b. static __inline __m256i __DEFAULT_FN_ATTRS _mm256_insert_epi16(__m256i __a, int __b, int const __imm) { __v16hi __c = (__v16hi)__a; __c[__imm & 15] = __b; return (__m256i)__c; } /// \brief Takes a [32 x i8] vector and replaces the vector element value /// indexed by the immediate constant operand with a new value. Returns the /// modified vector. /// /// \headerfile /// /// This intrinsic corresponds to the VINSERTF128+COMPOSITE /// instruction. /// /// \param __a /// A vector of [32 x i8] to be used by the insert operation. /// \param __b /// An i8 integer value. The replacement value for the insert operation. /// \param __imm /// An immediate integer specifying the index of the vector element to be /// replaced. /// \returns A copy of vector \a __a, after replacing its element indexed by /// \a __imm with \a __b. static __inline __m256i __DEFAULT_FN_ATTRS _mm256_insert_epi8(__m256i __a, int __b, int const __imm) { __v32qi __c = (__v32qi)__a; __c[__imm & 31] = __b; return (__m256i)__c; } #ifdef __x86_64__ /// \brief Takes a [4 x i64] vector and replaces the vector element value /// indexed by the immediate constant operand with a new value. Returns the /// modified vector. /// /// \headerfile /// /// This intrinsic corresponds to the VINSERTF128+COMPOSITE /// instruction. /// /// \param __a /// A vector of [4 x i64] to be used by the insert operation. /// \param __b /// A 64-bit integer value. The replacement value for the insert operation. /// \param __imm /// An immediate integer specifying the index of the vector element to be /// replaced. /// \returns A copy of vector \a __a, after replacing its element indexed by /// \a __imm with \a __b. static __inline __m256i __DEFAULT_FN_ATTRS _mm256_insert_epi64(__m256i __a, long long __b, int const __imm) { __v4di __c = (__v4di)__a; __c[__imm & 3] = __b; return (__m256i)__c; } #endif # 2199 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avxintrin.h" 3 /* Conversion */ /// \brief Converts a vector of [4 x i32] into a vector of [4 x double]. /// /// \headerfile /// /// This intrinsic corresponds to the VCVTDQ2PD instruction. /// /// \param __a /// A 128-bit integer vector of [4 x i32]. /// \returns A 256-bit vector of [4 x double] containing the converted values. static __inline __m256d __DEFAULT_FN_ATTRS _mm256_cvtepi32_pd(__m128i __a) { return (__m256d)__builtin_convertvector((__v4si)__a, __v4df); } /// \brief Converts a vector of [8 x i32] into a vector of [8 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VCVTDQ2PS instruction. /// /// \param __a /// A 256-bit integer vector. /// \returns A 256-bit vector of [8 x float] containing the converted values. static __inline __m256 __DEFAULT_FN_ATTRS _mm256_cvtepi32_ps(__m256i __a) { return (__m256)__builtin_ia32_cvtdq2ps256((__v8si) __a); } /// \brief Converts a 256-bit vector of [4 x double] into a 128-bit vector of /// [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VCVTPD2PS instruction. /// /// \param __a /// A 256-bit vector of [4 x double]. /// \returns A 128-bit vector of [4 x float] containing the converted values. static __inline __m128 __DEFAULT_FN_ATTRS _mm256_cvtpd_ps(__m256d __a) { return (__m128)__builtin_ia32_cvtpd2ps256((__v4df) __a); } /// \brief Converts a vector of [8 x float] into a vector of [8 x i32]. /// /// \headerfile /// /// This intrinsic corresponds to the VCVTPS2DQ instruction. /// /// \param __a /// A 256-bit vector of [8 x float]. /// \returns A 256-bit integer vector containing the converted values. static __inline __m256i __DEFAULT_FN_ATTRS _mm256_cvtps_epi32(__m256 __a) { return (__m256i)__builtin_ia32_cvtps2dq256((__v8sf) __a); } /// \brief Converts a 128-bit vector of [4 x float] into a 256-bit vector of [4 /// x double]. /// /// \headerfile /// /// This intrinsic corresponds to the VCVTPS2PD instruction. /// /// \param __a /// A 128-bit vector of [4 x float]. /// \returns A 256-bit vector of [4 x double] containing the converted values. static __inline __m256d __DEFAULT_FN_ATTRS _mm256_cvtps_pd(__m128 __a) { return (__m256d)__builtin_convertvector((__v4sf)__a, __v4df); } /// \brief Converts a 256-bit vector of [4 x double] into a 128-bit vector of [4 /// x i32], truncating the result by rounding towards zero when it is /// inexact. /// /// \headerfile /// /// This intrinsic corresponds to the VCVTTPD2DQ instruction. /// /// \param __a /// A 256-bit vector of [4 x double]. /// \returns A 128-bit integer vector containing the converted values. static __inline __m128i __DEFAULT_FN_ATTRS _mm256_cvttpd_epi32(__m256d __a) { return (__m128i)__builtin_ia32_cvttpd2dq256((__v4df) __a); } /// \brief Converts a 256-bit vector of [4 x double] into a 128-bit vector of [4 /// x i32]. When a conversion is inexact, the value returned is rounded /// according to the rounding control bits in the MXCSR register. /// /// \headerfile /// /// This intrinsic corresponds to the VCVTPD2DQ instruction. /// /// \param __a /// A 256-bit vector of [4 x double]. /// \returns A 128-bit integer vector containing the converted values. static __inline __m128i __DEFAULT_FN_ATTRS _mm256_cvtpd_epi32(__m256d __a) { return (__m128i)__builtin_ia32_cvtpd2dq256((__v4df) __a); } /// \brief Converts a vector of [8 x float] into a vector of [8 x i32], /// truncating the result by rounding towards zero when it is inexact. /// /// \headerfile /// /// This intrinsic corresponds to the VCVTTPS2DQ instruction. /// /// \param __a /// A 256-bit vector of [8 x float]. /// \returns A 256-bit integer vector containing the converted values. static __inline __m256i __DEFAULT_FN_ATTRS _mm256_cvttps_epi32(__m256 __a) { return (__m256i)__builtin_ia32_cvttps2dq256((__v8sf) __a); } /// \brief Returns the first element of the input vector of [4 x double]. /// /// \headerfile /// /// This intrinsic is a utility function and does not correspond to a specific /// instruction. /// /// \param __a /// A 256-bit vector of [4 x double]. /// \returns A 64 bit double containing the first element of the input vector. static __inline double __DEFAULT_FN_ATTRS _mm256_cvtsd_f64(__m256d __a) { return __a[0]; } /// \brief Returns the first element of the input vector of [8 x i32]. /// /// \headerfile /// /// This intrinsic is a utility function and does not correspond to a specific /// instruction. /// /// \param __a /// A 256-bit vector of [8 x i32]. /// \returns A 32 bit integer containing the first element of the input vector. static __inline int __DEFAULT_FN_ATTRS _mm256_cvtsi256_si32(__m256i __a) { __v8si __b = (__v8si)__a; return __b[0]; } /// \brief Returns the first element of the input vector of [8 x float]. /// /// \headerfile /// /// This intrinsic is a utility function and does not correspond to a specific /// instruction. /// /// \param __a /// A 256-bit vector of [8 x float]. /// \returns A 32 bit float containing the first element of the input vector. static __inline float __DEFAULT_FN_ATTRS _mm256_cvtss_f32(__m256 __a) { return __a[0]; } /* Vector replicate */ /// \brief Moves and duplicates high-order (odd-indexed) values from a 256-bit /// vector of [8 x float] to float values in a 256-bit vector of /// [8 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVSHDUP instruction. /// /// \param __a /// A 256-bit vector of [8 x float]. \n /// Bits [255:224] of \a __a are written to bits [255:224] and [223:192] of /// the return value. \n /// Bits [191:160] of \a __a are written to bits [191:160] and [159:128] of /// the return value. \n /// Bits [127:96] of \a __a are written to bits [127:96] and [95:64] of the /// return value. \n /// Bits [63:32] of \a __a are written to bits [63:32] and [31:0] of the /// return value. /// \returns A 256-bit vector of [8 x float] containing the moved and duplicated /// values. static __inline __m256 __DEFAULT_FN_ATTRS _mm256_movehdup_ps(__m256 __a) { return __builtin_shufflevector((__v8sf)__a, (__v8sf)__a, 1, 1, 3, 3, 5, 5, 7, 7); } /// \brief Moves and duplicates low-order (even-indexed) values from a 256-bit /// vector of [8 x float] to float values in a 256-bit vector of [8 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVSLDUP instruction. /// /// \param __a /// A 256-bit vector of [8 x float]. \n /// Bits [223:192] of \a __a are written to bits [255:224] and [223:192] of /// the return value. \n /// Bits [159:128] of \a __a are written to bits [191:160] and [159:128] of /// the return value. \n /// Bits [95:64] of \a __a are written to bits [127:96] and [95:64] of the /// return value. \n /// Bits [31:0] of \a __a are written to bits [63:32] and [31:0] of the /// return value. /// \returns A 256-bit vector of [8 x float] containing the moved and duplicated /// values. static __inline __m256 __DEFAULT_FN_ATTRS _mm256_moveldup_ps(__m256 __a) { return __builtin_shufflevector((__v8sf)__a, (__v8sf)__a, 0, 0, 2, 2, 4, 4, 6, 6); } /// \brief Moves and duplicates double-precision floating point values from a /// 256-bit vector of [4 x double] to double-precision values in a 256-bit /// vector of [4 x double]. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVDDUP instruction. /// /// \param __a /// A 256-bit vector of [4 x double]. \n /// Bits [63:0] of \a __a are written to bits [127:64] and [63:0] of the /// return value. \n /// Bits [191:128] of \a __a are written to bits [255:192] and [191:128] of /// the return value. /// \returns A 256-bit vector of [4 x double] containing the moved and /// duplicated values. static __inline __m256d __DEFAULT_FN_ATTRS _mm256_movedup_pd(__m256d __a) { return __builtin_shufflevector((__v4df)__a, (__v4df)__a, 0, 0, 2, 2); } /* Unpack and Interleave */ /// \brief Unpacks the odd-indexed vector elements from two 256-bit vectors of /// [4 x double] and interleaves them into a 256-bit vector of [4 x double]. /// /// \headerfile /// /// This intrinsic corresponds to the VUNPCKHPD instruction. /// /// \param __a /// A 256-bit floating-point vector of [4 x double]. \n /// Bits [127:64] are written to bits [63:0] of the return value. \n /// Bits [255:192] are written to bits [191:128] of the return value. \n /// \param __b /// A 256-bit floating-point vector of [4 x double]. \n /// Bits [127:64] are written to bits [127:64] of the return value. \n /// Bits [255:192] are written to bits [255:192] of the return value. \n /// \returns A 256-bit vector of [4 x double] containing the interleaved values. static __inline __m256d __DEFAULT_FN_ATTRS _mm256_unpackhi_pd(__m256d __a, __m256d __b) { return __builtin_shufflevector((__v4df)__a, (__v4df)__b, 1, 5, 1+2, 5+2); } /// \brief Unpacks the even-indexed vector elements from two 256-bit vectors of /// [4 x double] and interleaves them into a 256-bit vector of [4 x double]. /// /// \headerfile /// /// This intrinsic corresponds to the VUNPCKLPD instruction. /// /// \param __a /// A 256-bit floating-point vector of [4 x double]. \n /// Bits [63:0] are written to bits [63:0] of the return value. \n /// Bits [191:128] are written to bits [191:128] of the return value. /// \param __b /// A 256-bit floating-point vector of [4 x double]. \n /// Bits [63:0] are written to bits [127:64] of the return value. \n /// Bits [191:128] are written to bits [255:192] of the return value. \n /// \returns A 256-bit vector of [4 x double] containing the interleaved values. static __inline __m256d __DEFAULT_FN_ATTRS _mm256_unpacklo_pd(__m256d __a, __m256d __b) { return __builtin_shufflevector((__v4df)__a, (__v4df)__b, 0, 4, 0+2, 4+2); } /// \brief Unpacks the 32-bit vector elements 2, 3, 6 and 7 from each of the /// two 256-bit vectors of [8 x float] and interleaves them into a 256-bit /// vector of [8 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VUNPCKHPS instruction. /// /// \param __a /// A 256-bit vector of [8 x float]. \n /// Bits [95:64] are written to bits [31:0] of the return value. \n /// Bits [127:96] are written to bits [95:64] of the return value. \n /// Bits [223:192] are written to bits [159:128] of the return value. \n /// Bits [255:224] are written to bits [223:192] of the return value. /// \param __b /// A 256-bit vector of [8 x float]. \n /// Bits [95:64] are written to bits [63:32] of the return value. \n /// Bits [127:96] are written to bits [127:96] of the return value. \n /// Bits [223:192] are written to bits [191:160] of the return value. \n /// Bits [255:224] are written to bits [255:224] of the return value. /// \returns A 256-bit vector of [8 x float] containing the interleaved values. static __inline __m256 __DEFAULT_FN_ATTRS _mm256_unpackhi_ps(__m256 __a, __m256 __b) { return __builtin_shufflevector((__v8sf)__a, (__v8sf)__b, 2, 10, 2+1, 10+1, 6, 14, 6+1, 14+1); } /// \brief Unpacks the 32-bit vector elements 0, 1, 4 and 5 from each of the /// two 256-bit vectors of [8 x float] and interleaves them into a 256-bit /// vector of [8 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VUNPCKLPS instruction. /// /// \param __a /// A 256-bit vector of [8 x float]. \n /// Bits [31:0] are written to bits [31:0] of the return value. \n /// Bits [63:32] are written to bits [95:64] of the return value. \n /// Bits [159:128] are written to bits [159:128] of the return value. \n /// Bits [191:160] are written to bits [223:192] of the return value. /// \param __b /// A 256-bit vector of [8 x float]. \n /// Bits [31:0] are written to bits [63:32] of the return value. \n /// Bits [63:32] are written to bits [127:96] of the return value. \n /// Bits [159:128] are written to bits [191:160] of the return value. \n /// Bits [191:160] are written to bits [255:224] of the return value. /// \returns A 256-bit vector of [8 x float] containing the interleaved values. static __inline __m256 __DEFAULT_FN_ATTRS _mm256_unpacklo_ps(__m256 __a, __m256 __b) { return __builtin_shufflevector((__v8sf)__a, (__v8sf)__b, 0, 8, 0+1, 8+1, 4, 12, 4+1, 12+1); } /* Bit Test */ /// \brief Given two 128-bit floating-point vectors of [2 x double], perform an /// element-by-element comparison of the double-precision element in the /// first source vector and the corresponding element in the second source /// vector. /// /// The EFLAGS register is updated as follows: \n /// If there is at least one pair of double-precision elements where the /// sign-bits of both elements are 1, the ZF flag is set to 0. Otherwise the /// ZF flag is set to 1. \n /// If there is at least one pair of double-precision elements where the /// sign-bit of the first element is 0 and the sign-bit of the second element /// is 1, the CF flag is set to 0. Otherwise the CF flag is set to 1. \n /// This intrinsic returns the value of the ZF flag. /// /// \headerfile /// /// This intrinsic corresponds to the VTESTPD instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. /// \param __b /// A 128-bit vector of [2 x double]. /// \returns the ZF flag in the EFLAGS register. static __inline int __DEFAULT_FN_ATTRS _mm_testz_pd(__m128d __a, __m128d __b) { return __builtin_ia32_vtestzpd((__v2df)__a, (__v2df)__b); } /// \brief Given two 128-bit floating-point vectors of [2 x double], perform an /// element-by-element comparison of the double-precision element in the /// first source vector and the corresponding element in the second source /// vector. /// /// The EFLAGS register is updated as follows: \n /// If there is at least one pair of double-precision elements where the /// sign-bits of both elements are 1, the ZF flag is set to 0. Otherwise the /// ZF flag is set to 1. \n /// If there is at least one pair of double-precision elements where the /// sign-bit of the first element is 0 and the sign-bit of the second element /// is 1, the CF flag is set to 0. Otherwise the CF flag is set to 1. \n /// This intrinsic returns the value of the CF flag. /// /// \headerfile /// /// This intrinsic corresponds to the VTESTPD instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. /// \param __b /// A 128-bit vector of [2 x double]. /// \returns the CF flag in the EFLAGS register. static __inline int __DEFAULT_FN_ATTRS _mm_testc_pd(__m128d __a, __m128d __b) { return __builtin_ia32_vtestcpd((__v2df)__a, (__v2df)__b); } /// \brief Given two 128-bit floating-point vectors of [2 x double], perform an /// element-by-element comparison of the double-precision element in the /// first source vector and the corresponding element in the second source /// vector. /// /// The EFLAGS register is updated as follows: \n /// If there is at least one pair of double-precision elements where the /// sign-bits of both elements are 1, the ZF flag is set to 0. Otherwise the /// ZF flag is set to 1. \n /// If there is at least one pair of double-precision elements where the /// sign-bit of the first element is 0 and the sign-bit of the second element /// is 1, the CF flag is set to 0. Otherwise the CF flag is set to 1. \n /// This intrinsic returns 1 if both the ZF and CF flags are set to 0, /// otherwise it returns 0. /// /// \headerfile /// /// This intrinsic corresponds to the VTESTPD instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. /// \param __b /// A 128-bit vector of [2 x double]. /// \returns 1 if both the ZF and CF flags are set to 0, otherwise returns 0. static __inline int __DEFAULT_FN_ATTRS _mm_testnzc_pd(__m128d __a, __m128d __b) { return __builtin_ia32_vtestnzcpd((__v2df)__a, (__v2df)__b); } /// \brief Given two 128-bit floating-point vectors of [4 x float], perform an /// element-by-element comparison of the single-precision element in the /// first source vector and the corresponding element in the second source /// vector. /// /// The EFLAGS register is updated as follows: \n /// If there is at least one pair of single-precision elements where the /// sign-bits of both elements are 1, the ZF flag is set to 0. Otherwise the /// ZF flag is set to 1. \n /// If there is at least one pair of single-precision elements where the /// sign-bit of the first element is 0 and the sign-bit of the second element /// is 1, the CF flag is set to 0. Otherwise the CF flag is set to 1. \n /// This intrinsic returns the value of the ZF flag. /// /// \headerfile /// /// This intrinsic corresponds to the VTESTPS instruction. /// /// \param __a /// A 128-bit vector of [4 x float]. /// \param __b /// A 128-bit vector of [4 x float]. /// \returns the ZF flag. static __inline int __DEFAULT_FN_ATTRS _mm_testz_ps(__m128 __a, __m128 __b) { return __builtin_ia32_vtestzps((__v4sf)__a, (__v4sf)__b); } /// \brief Given two 128-bit floating-point vectors of [4 x float], perform an /// element-by-element comparison of the single-precision element in the /// first source vector and the corresponding element in the second source /// vector. /// /// The EFLAGS register is updated as follows: \n /// If there is at least one pair of single-precision elements where the /// sign-bits of both elements are 1, the ZF flag is set to 0. Otherwise the /// ZF flag is set to 1. \n /// If there is at least one pair of single-precision elements where the /// sign-bit of the first element is 0 and the sign-bit of the second element /// is 1, the CF flag is set to 0. Otherwise the CF flag is set to 1. \n /// This intrinsic returns the value of the CF flag. /// /// \headerfile /// /// This intrinsic corresponds to the VTESTPS instruction. /// /// \param __a /// A 128-bit vector of [4 x float]. /// \param __b /// A 128-bit vector of [4 x float]. /// \returns the CF flag. static __inline int __DEFAULT_FN_ATTRS _mm_testc_ps(__m128 __a, __m128 __b) { return __builtin_ia32_vtestcps((__v4sf)__a, (__v4sf)__b); } /// \brief Given two 128-bit floating-point vectors of [4 x float], perform an /// element-by-element comparison of the single-precision element in the /// first source vector and the corresponding element in the second source /// vector. /// /// The EFLAGS register is updated as follows: \n /// If there is at least one pair of single-precision elements where the /// sign-bits of both elements are 1, the ZF flag is set to 0. Otherwise the /// ZF flag is set to 1. \n /// If there is at least one pair of single-precision elements where the /// sign-bit of the first element is 0 and the sign-bit of the second element /// is 1, the CF flag is set to 0. Otherwise the CF flag is set to 1. \n /// This intrinsic returns 1 if both the ZF and CF flags are set to 0, /// otherwise it returns 0. /// /// \headerfile /// /// This intrinsic corresponds to the VTESTPS instruction. /// /// \param __a /// A 128-bit vector of [4 x float]. /// \param __b /// A 128-bit vector of [4 x float]. /// \returns 1 if both the ZF and CF flags are set to 0, otherwise returns 0. static __inline int __DEFAULT_FN_ATTRS _mm_testnzc_ps(__m128 __a, __m128 __b) { return __builtin_ia32_vtestnzcps((__v4sf)__a, (__v4sf)__b); } /// \brief Given two 256-bit floating-point vectors of [4 x double], perform an /// element-by-element comparison of the double-precision elements in the /// first source vector and the corresponding elements in the second source /// vector. /// /// The EFLAGS register is updated as follows: \n /// If there is at least one pair of double-precision elements where the /// sign-bits of both elements are 1, the ZF flag is set to 0. Otherwise the /// ZF flag is set to 1. \n /// If there is at least one pair of double-precision elements where the /// sign-bit of the first element is 0 and the sign-bit of the second element /// is 1, the CF flag is set to 0. Otherwise the CF flag is set to 1. \n /// This intrinsic returns the value of the ZF flag. /// /// \headerfile /// /// This intrinsic corresponds to the VTESTPD instruction. /// /// \param __a /// A 256-bit vector of [4 x double]. /// \param __b /// A 256-bit vector of [4 x double]. /// \returns the ZF flag. static __inline int __DEFAULT_FN_ATTRS _mm256_testz_pd(__m256d __a, __m256d __b) { return __builtin_ia32_vtestzpd256((__v4df)__a, (__v4df)__b); } /// \brief Given two 256-bit floating-point vectors of [4 x double], perform an /// element-by-element comparison of the double-precision elements in the /// first source vector and the corresponding elements in the second source /// vector. /// /// The EFLAGS register is updated as follows: \n /// If there is at least one pair of double-precision elements where the /// sign-bits of both elements are 1, the ZF flag is set to 0. Otherwise the /// ZF flag is set to 1. \n /// If there is at least one pair of double-precision elements where the /// sign-bit of the first element is 0 and the sign-bit of the second element /// is 1, the CF flag is set to 0. Otherwise the CF flag is set to 1. \n /// This intrinsic returns the value of the CF flag. /// /// \headerfile /// /// This intrinsic corresponds to the VTESTPD instruction. /// /// \param __a /// A 256-bit vector of [4 x double]. /// \param __b /// A 256-bit vector of [4 x double]. /// \returns the CF flag. static __inline int __DEFAULT_FN_ATTRS _mm256_testc_pd(__m256d __a, __m256d __b) { return __builtin_ia32_vtestcpd256((__v4df)__a, (__v4df)__b); } /// \brief Given two 256-bit floating-point vectors of [4 x double], perform an /// element-by-element comparison of the double-precision elements in the /// first source vector and the corresponding elements in the second source /// vector. /// /// The EFLAGS register is updated as follows: \n /// If there is at least one pair of double-precision elements where the /// sign-bits of both elements are 1, the ZF flag is set to 0. Otherwise the /// ZF flag is set to 1. \n /// If there is at least one pair of double-precision elements where the /// sign-bit of the first element is 0 and the sign-bit of the second element /// is 1, the CF flag is set to 0. Otherwise the CF flag is set to 1. \n /// This intrinsic returns 1 if both the ZF and CF flags are set to 0, /// otherwise it returns 0. /// /// \headerfile /// /// This intrinsic corresponds to the VTESTPD instruction. /// /// \param __a /// A 256-bit vector of [4 x double]. /// \param __b /// A 256-bit vector of [4 x double]. /// \returns 1 if both the ZF and CF flags are set to 0, otherwise returns 0. static __inline int __DEFAULT_FN_ATTRS _mm256_testnzc_pd(__m256d __a, __m256d __b) { return __builtin_ia32_vtestnzcpd256((__v4df)__a, (__v4df)__b); } /// \brief Given two 256-bit floating-point vectors of [8 x float], perform an /// element-by-element comparison of the single-precision element in the /// first source vector and the corresponding element in the second source /// vector. /// /// The EFLAGS register is updated as follows: \n /// If there is at least one pair of single-precision elements where the /// sign-bits of both elements are 1, the ZF flag is set to 0. Otherwise the /// ZF flag is set to 1. \n /// If there is at least one pair of single-precision elements where the /// sign-bit of the first element is 0 and the sign-bit of the second element /// is 1, the CF flag is set to 0. Otherwise the CF flag is set to 1. \n /// This intrinsic returns the value of the ZF flag. /// /// \headerfile /// /// This intrinsic corresponds to the VTESTPS instruction. /// /// \param __a /// A 256-bit vector of [8 x float]. /// \param __b /// A 256-bit vector of [8 x float]. /// \returns the ZF flag. static __inline int __DEFAULT_FN_ATTRS _mm256_testz_ps(__m256 __a, __m256 __b) { return __builtin_ia32_vtestzps256((__v8sf)__a, (__v8sf)__b); } /// \brief Given two 256-bit floating-point vectors of [8 x float], perform an /// element-by-element comparison of the single-precision element in the /// first source vector and the corresponding element in the second source /// vector. /// /// The EFLAGS register is updated as follows: \n /// If there is at least one pair of single-precision elements where the /// sign-bits of both elements are 1, the ZF flag is set to 0. Otherwise the /// ZF flag is set to 1. \n /// If there is at least one pair of single-precision elements where the /// sign-bit of the first element is 0 and the sign-bit of the second element /// is 1, the CF flag is set to 0. Otherwise the CF flag is set to 1. \n /// This intrinsic returns the value of the CF flag. /// /// \headerfile /// /// This intrinsic corresponds to the VTESTPS instruction. /// /// \param __a /// A 256-bit vector of [8 x float]. /// \param __b /// A 256-bit vector of [8 x float]. /// \returns the CF flag. static __inline int __DEFAULT_FN_ATTRS _mm256_testc_ps(__m256 __a, __m256 __b) { return __builtin_ia32_vtestcps256((__v8sf)__a, (__v8sf)__b); } /// \brief Given two 256-bit floating-point vectors of [8 x float], perform an /// element-by-element comparison of the single-precision elements in the /// first source vector and the corresponding elements in the second source /// vector. /// /// The EFLAGS register is updated as follows: \n /// If there is at least one pair of single-precision elements where the /// sign-bits of both elements are 1, the ZF flag is set to 0. Otherwise the /// ZF flag is set to 1. \n /// If there is at least one pair of single-precision elements where the /// sign-bit of the first element is 0 and the sign-bit of the second element /// is 1, the CF flag is set to 0. Otherwise the CF flag is set to 1. \n /// This intrinsic returns 1 if both the ZF and CF flags are set to 0, /// otherwise it returns 0. /// /// \headerfile /// /// This intrinsic corresponds to the VTESTPS instruction. /// /// \param __a /// A 256-bit vector of [8 x float]. /// \param __b /// A 256-bit vector of [8 x float]. /// \returns 1 if both the ZF and CF flags are set to 0, otherwise returns 0. static __inline int __DEFAULT_FN_ATTRS _mm256_testnzc_ps(__m256 __a, __m256 __b) { return __builtin_ia32_vtestnzcps256((__v8sf)__a, (__v8sf)__b); } /// \brief Given two 256-bit integer vectors, perform a bit-by-bit comparison /// of the two source vectors. /// /// The EFLAGS register is updated as follows: \n /// If there is at least one pair of bits where both bits are 1, the ZF flag /// is set to 0. Otherwise the ZF flag is set to 1. \n /// If there is at least one pair of bits where the bit from the first source /// vector is 0 and the bit from the second source vector is 1, the CF flag /// is set to 0. Otherwise the CF flag is set to 1. \n /// This intrinsic returns the value of the ZF flag. /// /// \headerfile /// /// This intrinsic corresponds to the VPTEST instruction. /// /// \param __a /// A 256-bit integer vector. /// \param __b /// A 256-bit integer vector. /// \returns the ZF flag. static __inline int __DEFAULT_FN_ATTRS _mm256_testz_si256(__m256i __a, __m256i __b) { return __builtin_ia32_ptestz256((__v4di)__a, (__v4di)__b); } /// \brief Given two 256-bit integer vectors, perform a bit-by-bit comparison /// of the two source vectors. /// /// The EFLAGS register is updated as follows: \n /// If there is at least one pair of bits where both bits are 1, the ZF flag /// is set to 0. Otherwise the ZF flag is set to 1. \n /// If there is at least one pair of bits where the bit from the first source /// vector is 0 and the bit from the second source vector is 1, the CF flag /// is set to 0. Otherwise the CF flag is set to 1. \n /// This intrinsic returns the value of the CF flag. /// /// \headerfile /// /// This intrinsic corresponds to the VPTEST instruction. /// /// \param __a /// A 256-bit integer vector. /// \param __b /// A 256-bit integer vector. /// \returns the CF flag. static __inline int __DEFAULT_FN_ATTRS _mm256_testc_si256(__m256i __a, __m256i __b) { return __builtin_ia32_ptestc256((__v4di)__a, (__v4di)__b); } /// \brief Given two 256-bit integer vectors, perform a bit-by-bit comparison /// of the two source vectors. /// /// The EFLAGS register is updated as follows: \n /// If there is at least one pair of bits where both bits are 1, the ZF flag /// is set to 0. Otherwise the ZF flag is set to 1. \n /// If there is at least one pair of bits where the bit from the first source /// vector is 0 and the bit from the second source vector is 1, the CF flag /// is set to 0. Otherwise the CF flag is set to 1. \n /// This intrinsic returns 1 if both the ZF and CF flags are set to 0, /// otherwise it returns 0. /// /// \headerfile /// /// This intrinsic corresponds to the VPTEST instruction. /// /// \param __a /// A 256-bit integer vector. /// \param __b /// A 256-bit integer vector. /// \returns 1 if both the ZF and CF flags are set to 0, otherwise returns 0. static __inline int __DEFAULT_FN_ATTRS _mm256_testnzc_si256(__m256i __a, __m256i __b) { return __builtin_ia32_ptestnzc256((__v4di)__a, (__v4di)__b); } /* Vector extract sign mask */ /// \brief Extracts the sign bits of double-precision floating point elements /// in a 256-bit vector of [4 x double] and writes them to the lower order /// bits of the return value. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVMSKPD instruction. /// /// \param __a /// A 256-bit vector of [4 x double] containing the double-precision /// floating point values with sign bits to be extracted. /// \returns The sign bits from the operand, written to bits [3:0]. static __inline int __DEFAULT_FN_ATTRS _mm256_movemask_pd(__m256d __a) { return __builtin_ia32_movmskpd256((__v4df)__a); } /// \brief Extracts the sign bits of double-precision floating point elements /// in a 256-bit vector of [8 x float] and writes them to the lower order /// bits of the return value. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVMSKPS instruction. /// /// \param __a /// A 256-bit vector of [8 x float] containing the double-precision floating /// point values with sign bits to be extracted. /// \returns The sign bits from the operand, written to bits [7:0]. static __inline int __DEFAULT_FN_ATTRS _mm256_movemask_ps(__m256 __a) { return __builtin_ia32_movmskps256((__v8sf)__a); } /* Vector __zero */ /// \brief Zeroes the contents of all XMM or YMM registers. /// /// \headerfile /// /// This intrinsic corresponds to the VZEROALL instruction. static __inline void __DEFAULT_FN_ATTRS _mm256_zeroall(void) { __builtin_ia32_vzeroall(); } /// \brief Zeroes the upper 128 bits (bits 255:128) of all YMM registers. /// /// \headerfile /// /// This intrinsic corresponds to the VZEROUPPER instruction. static __inline void __DEFAULT_FN_ATTRS _mm256_zeroupper(void) { __builtin_ia32_vzeroupper(); } /* Vector load with broadcast */ /// \brief Loads a scalar single-precision floating point value from the /// specified address pointed to by \a __a and broadcasts it to the elements /// of a [4 x float] vector. /// /// \headerfile /// /// This intrinsic corresponds to the VBROADCASTSS instruction. /// /// \param __a /// The single-precision floating point value to be broadcast. /// \returns A 128-bit vector of [4 x float] whose 32-bit elements are set /// equal to the broadcast value. static __inline __m128 __DEFAULT_FN_ATTRS _mm_broadcast_ss(float const *__a) { float __f = *__a; return (__m128)(__v4sf){ __f, __f, __f, __f }; } /// \brief Loads a scalar double-precision floating point value from the /// specified address pointed to by \a __a and broadcasts it to the elements /// of a [4 x double] vector. /// /// \headerfile /// /// This intrinsic corresponds to the VBROADCASTSD instruction. /// /// \param __a /// The double-precision floating point value to be broadcast. /// \returns A 256-bit vector of [4 x double] whose 64-bit elements are set /// equal to the broadcast value. static __inline __m256d __DEFAULT_FN_ATTRS _mm256_broadcast_sd(double const *__a) { double __d = *__a; return (__m256d)(__v4df){ __d, __d, __d, __d }; } /// \brief Loads a scalar single-precision floating point value from the /// specified address pointed to by \a __a and broadcasts it to the elements /// of a [8 x float] vector. /// /// \headerfile /// /// This intrinsic corresponds to the VBROADCASTSS instruction. /// /// \param __a /// The single-precision floating point value to be broadcast. /// \returns A 256-bit vector of [8 x float] whose 32-bit elements are set /// equal to the broadcast value. static __inline __m256 __DEFAULT_FN_ATTRS _mm256_broadcast_ss(float const *__a) { float __f = *__a; return (__m256)(__v8sf){ __f, __f, __f, __f, __f, __f, __f, __f }; } /// \brief Loads the data from a 128-bit vector of [2 x double] from the /// specified address pointed to by \a __a and broadcasts it to 128-bit /// elements in a 256-bit vector of [4 x double]. /// /// \headerfile /// /// This intrinsic corresponds to the VBROADCASTF128 instruction. /// /// \param __a /// The 128-bit vector of [2 x double] to be broadcast. /// \returns A 256-bit vector of [4 x double] whose 128-bit elements are set /// equal to the broadcast value. static __inline __m256d __DEFAULT_FN_ATTRS _mm256_broadcast_pd(__m128d const *__a) { return (__m256d)__builtin_ia32_vbroadcastf128_pd256((__v2df const *)__a); } /// \brief Loads the data from a 128-bit vector of [4 x float] from the /// specified address pointed to by \a __a and broadcasts it to 128-bit /// elements in a 256-bit vector of [8 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VBROADCASTF128 instruction. /// /// \param __a /// The 128-bit vector of [4 x float] to be broadcast. /// \returns A 256-bit vector of [8 x float] whose 128-bit elements are set /// equal to the broadcast value. static __inline __m256 __DEFAULT_FN_ATTRS _mm256_broadcast_ps(__m128 const *__a) { return (__m256)__builtin_ia32_vbroadcastf128_ps256((__v4sf const *)__a); } /* SIMD load ops */ /// \brief Loads 4 double-precision floating point values from a 32-byte aligned /// memory location pointed to by \a __p into a vector of [4 x double]. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVAPD instruction. /// /// \param __p /// A 32-byte aligned pointer to a memory location containing /// double-precision floating point values. /// \returns A 256-bit vector of [4 x double] containing the moved values. static __inline __m256d __DEFAULT_FN_ATTRS _mm256_load_pd(double const *__p) { return *(__m256d *)__p; } /// \brief Loads 8 single-precision floating point values from a 32-byte aligned /// memory location pointed to by \a __p into a vector of [8 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVAPS instruction. /// /// \param __p /// A 32-byte aligned pointer to a memory location containing float values. /// \returns A 256-bit vector of [8 x float] containing the moved values. static __inline __m256 __DEFAULT_FN_ATTRS _mm256_load_ps(float const *__p) { return *(__m256 *)__p; } /// \brief Loads 4 double-precision floating point values from an unaligned /// memory location pointed to by \a __p into a vector of [4 x double]. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVUPD instruction. /// /// \param __p /// A pointer to a memory location containing double-precision floating /// point values. /// \returns A 256-bit vector of [4 x double] containing the moved values. static __inline __m256d __DEFAULT_FN_ATTRS _mm256_loadu_pd(double const *__p) { struct __loadu_pd { __m256d __v; } __attribute__((__packed__, __may_alias__)); return ((struct __loadu_pd*)__p)->__v; } /// \brief Loads 8 single-precision floating point values from an unaligned /// memory location pointed to by \a __p into a vector of [8 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVUPS instruction. /// /// \param __p /// A pointer to a memory location containing single-precision floating /// point values. /// \returns A 256-bit vector of [8 x float] containing the moved values. static __inline __m256 __DEFAULT_FN_ATTRS _mm256_loadu_ps(float const *__p) { struct __loadu_ps { __m256 __v; } __attribute__((__packed__, __may_alias__)); return ((struct __loadu_ps*)__p)->__v; } /// \brief Loads 256 bits of integer data from a 32-byte aligned memory /// location pointed to by \a __p into elements of a 256-bit integer vector. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVDQA instruction. /// /// \param __p /// A 32-byte aligned pointer to a 256-bit integer vector containing integer /// values. /// \returns A 256-bit integer vector containing the moved values. static __inline __m256i __DEFAULT_FN_ATTRS _mm256_load_si256(__m256i const *__p) { return *__p; } /// \brief Loads 256 bits of integer data from an unaligned memory location /// pointed to by \a __p into a 256-bit integer vector. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVDQU instruction. /// /// \param __p /// A pointer to a 256-bit integer vector containing integer values. /// \returns A 256-bit integer vector containing the moved values. static __inline __m256i __DEFAULT_FN_ATTRS _mm256_loadu_si256(__m256i const *__p) { struct __loadu_si256 { __m256i __v; } __attribute__((__packed__, __may_alias__)); return ((struct __loadu_si256*)__p)->__v; } /// \brief Loads 256 bits of integer data from an unaligned memory location /// pointed to by \a __p into a 256-bit integer vector. This intrinsic may /// perform better than \c _mm256_loadu_si256 when the data crosses a cache /// line boundary. /// /// \headerfile /// /// This intrinsic corresponds to the VLDDQU instruction. /// /// \param __p /// A pointer to a 256-bit integer vector containing integer values. /// \returns A 256-bit integer vector containing the moved values. static __inline __m256i __DEFAULT_FN_ATTRS _mm256_lddqu_si256(__m256i const *__p) { return (__m256i)__builtin_ia32_lddqu256((char const *)__p); } /* SIMD store ops */ /// \brief Stores double-precision floating point values from a 256-bit vector /// of [4 x double] to a 32-byte aligned memory location pointed to by /// \a __p. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVAPD instruction. /// /// \param __p /// A 32-byte aligned pointer to a memory location that will receive the /// double-precision floaing point values. /// \param __a /// A 256-bit vector of [4 x double] containing the values to be moved. static __inline void __DEFAULT_FN_ATTRS _mm256_store_pd(double *__p, __m256d __a) { *(__m256d *)__p = __a; } /// \brief Stores single-precision floating point values from a 256-bit vector /// of [8 x float] to a 32-byte aligned memory location pointed to by \a __p. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVAPS instruction. /// /// \param __p /// A 32-byte aligned pointer to a memory location that will receive the /// float values. /// \param __a /// A 256-bit vector of [8 x float] containing the values to be moved. static __inline void __DEFAULT_FN_ATTRS _mm256_store_ps(float *__p, __m256 __a) { *(__m256 *)__p = __a; } /// \brief Stores double-precision floating point values from a 256-bit vector /// of [4 x double] to an unaligned memory location pointed to by \a __p. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVUPD instruction. /// /// \param __p /// A pointer to a memory location that will receive the double-precision /// floating point values. /// \param __a /// A 256-bit vector of [4 x double] containing the values to be moved. static __inline void __DEFAULT_FN_ATTRS _mm256_storeu_pd(double *__p, __m256d __a) { struct __storeu_pd { __m256d __v; } __attribute__((__packed__, __may_alias__)); ((struct __storeu_pd*)__p)->__v = __a; } /// \brief Stores single-precision floating point values from a 256-bit vector /// of [8 x float] to an unaligned memory location pointed to by \a __p. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVUPS instruction. /// /// \param __p /// A pointer to a memory location that will receive the float values. /// \param __a /// A 256-bit vector of [8 x float] containing the values to be moved. static __inline void __DEFAULT_FN_ATTRS _mm256_storeu_ps(float *__p, __m256 __a) { struct __storeu_ps { __m256 __v; } __attribute__((__packed__, __may_alias__)); ((struct __storeu_ps*)__p)->__v = __a; } /// \brief Stores integer values from a 256-bit integer vector to a 32-byte /// aligned memory location pointed to by \a __p. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVDQA instruction. /// /// \param __p /// A 32-byte aligned pointer to a memory location that will receive the /// integer values. /// \param __a /// A 256-bit integer vector containing the values to be moved. static __inline void __DEFAULT_FN_ATTRS _mm256_store_si256(__m256i *__p, __m256i __a) { *__p = __a; } /// \brief Stores integer values from a 256-bit integer vector to an unaligned /// memory location pointed to by \a __p. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVDQU instruction. /// /// \param __p /// A pointer to a memory location that will receive the integer values. /// \param __a /// A 256-bit integer vector containing the values to be moved. static __inline void __DEFAULT_FN_ATTRS _mm256_storeu_si256(__m256i *__p, __m256i __a) { struct __storeu_si256 { __m256i __v; } __attribute__((__packed__, __may_alias__)); ((struct __storeu_si256*)__p)->__v = __a; } /* Conditional load ops */ /// \brief Conditionally loads double-precision floating point elements from a /// memory location pointed to by \a __p into a 128-bit vector of /// [2 x double], depending on the mask bits associated with each data /// element. /// /// \headerfile /// /// This intrinsic corresponds to the VMASKMOVPD instruction. /// /// \param __p /// A pointer to a memory location that contains the double-precision /// floating point values. /// \param __m /// A 128-bit integer vector containing the mask. The most significant bit of /// each data element represents the mask bits. If a mask bit is zero, the /// corresponding value in the memory location is not loaded and the /// corresponding field in the return value is set to zero. /// \returns A 128-bit vector of [2 x double] containing the loaded values. static __inline __m128d __DEFAULT_FN_ATTRS _mm_maskload_pd(double const *__p, __m128i __m) { return (__m128d)__builtin_ia32_maskloadpd((const __v2df *)__p, (__v2di)__m); } /// \brief Conditionally loads double-precision floating point elements from a /// memory location pointed to by \a __p into a 256-bit vector of /// [4 x double], depending on the mask bits associated with each data /// element. /// /// \headerfile /// /// This intrinsic corresponds to the VMASKMOVPD instruction. /// /// \param __p /// A pointer to a memory location that contains the double-precision /// floating point values. /// \param __m /// A 256-bit integer vector of [4 x quadword] containing the mask. The most /// significant bit of each quadword element represents the mask bits. If a /// mask bit is zero, the corresponding value in the memory location is not /// loaded and the corresponding field in the return value is set to zero. /// \returns A 256-bit vector of [4 x double] containing the loaded values. static __inline __m256d __DEFAULT_FN_ATTRS _mm256_maskload_pd(double const *__p, __m256i __m) { return (__m256d)__builtin_ia32_maskloadpd256((const __v4df *)__p, (__v4di)__m); } /// \brief Conditionally loads single-precision floating point elements from a /// memory location pointed to by \a __p into a 128-bit vector of /// [4 x float], depending on the mask bits associated with each data /// element. /// /// \headerfile /// /// This intrinsic corresponds to the VMASKMOVPS instruction. /// /// \param __p /// A pointer to a memory location that contains the single-precision /// floating point values. /// \param __m /// A 128-bit integer vector containing the mask. The most significant bit of /// each data element represents the mask bits. If a mask bit is zero, the /// corresponding value in the memory location is not loaded and the /// corresponding field in the return value is set to zero. /// \returns A 128-bit vector of [4 x float] containing the loaded values. static __inline __m128 __DEFAULT_FN_ATTRS _mm_maskload_ps(float const *__p, __m128i __m) { return (__m128)__builtin_ia32_maskloadps((const __v4sf *)__p, (__v4si)__m); } /// \brief Conditionally loads single-precision floating point elements from a /// memory location pointed to by \a __p into a 256-bit vector of /// [8 x float], depending on the mask bits associated with each data /// element. /// /// \headerfile /// /// This intrinsic corresponds to the VMASKMOVPS instruction. /// /// \param __p /// A pointer to a memory location that contains the single-precision /// floating point values. /// \param __m /// A 256-bit integer vector of [8 x dword] containing the mask. The most /// significant bit of each dword element represents the mask bits. If a mask /// bit is zero, the corresponding value in the memory location is not loaded /// and the corresponding field in the return value is set to zero. /// \returns A 256-bit vector of [8 x float] containing the loaded values. static __inline __m256 __DEFAULT_FN_ATTRS _mm256_maskload_ps(float const *__p, __m256i __m) { return (__m256)__builtin_ia32_maskloadps256((const __v8sf *)__p, (__v8si)__m); } /* Conditional store ops */ /// \brief Moves single-precision floating point values from a 256-bit vector /// of [8 x float] to a memory location pointed to by \a __p, according to /// the specified mask. /// /// \headerfile /// /// This intrinsic corresponds to the VMASKMOVPS instruction. /// /// \param __p /// A pointer to a memory location that will receive the float values. /// \param __m /// A 256-bit integer vector of [8 x dword] containing the mask. The most /// significant bit of each dword element in the mask vector represents the /// mask bits. If a mask bit is zero, the corresponding value from vector /// \a __a is not stored and the corresponding field in the memory location /// pointed to by \a __p is not changed. /// \param __a /// A 256-bit vector of [8 x float] containing the values to be stored. static __inline void __DEFAULT_FN_ATTRS _mm256_maskstore_ps(float *__p, __m256i __m, __m256 __a) { __builtin_ia32_maskstoreps256((__v8sf *)__p, (__v8si)__m, (__v8sf)__a); } /// \brief Moves double-precision values from a 128-bit vector of [2 x double] /// to a memory location pointed to by \a __p, according to the specified /// mask. /// /// \headerfile /// /// This intrinsic corresponds to the VMASKMOVPD instruction. /// /// \param __p /// A pointer to a memory location that will receive the float values. /// \param __m /// A 128-bit integer vector containing the mask. The most significant bit of /// each field in the mask vector represents the mask bits. If a mask bit is /// zero, the corresponding value from vector \a __a is not stored and the /// corresponding field in the memory location pointed to by \a __p is not /// changed. /// \param __a /// A 128-bit vector of [2 x double] containing the values to be stored. static __inline void __DEFAULT_FN_ATTRS _mm_maskstore_pd(double *__p, __m128i __m, __m128d __a) { __builtin_ia32_maskstorepd((__v2df *)__p, (__v2di)__m, (__v2df)__a); } /// \brief Moves double-precision values from a 256-bit vector of [4 x double] /// to a memory location pointed to by \a __p, according to the specified /// mask. /// /// \headerfile /// /// This intrinsic corresponds to the VMASKMOVPD instruction. /// /// \param __p /// A pointer to a memory location that will receive the float values. /// \param __m /// A 256-bit integer vector of [4 x quadword] containing the mask. The most /// significant bit of each quadword element in the mask vector represents /// the mask bits. If a mask bit is zero, the corresponding value from vector /// __a is not stored and the corresponding field in the memory location /// pointed to by \a __p is not changed. /// \param __a /// A 256-bit vector of [4 x double] containing the values to be stored. static __inline void __DEFAULT_FN_ATTRS _mm256_maskstore_pd(double *__p, __m256i __m, __m256d __a) { __builtin_ia32_maskstorepd256((__v4df *)__p, (__v4di)__m, (__v4df)__a); } /// \brief Moves single-precision floating point values from a 128-bit vector /// of [4 x float] to a memory location pointed to by \a __p, according to /// the specified mask. /// /// \headerfile /// /// This intrinsic corresponds to the VMASKMOVPS instruction. /// /// \param __p /// A pointer to a memory location that will receive the float values. /// \param __m /// A 128-bit integer vector containing the mask. The most significant bit of /// each field in the mask vector represents the mask bits. If a mask bit is /// zero, the corresponding value from vector __a is not stored and the /// corresponding field in the memory location pointed to by \a __p is not /// changed. /// \param __a /// A 128-bit vector of [4 x float] containing the values to be stored. static __inline void __DEFAULT_FN_ATTRS _mm_maskstore_ps(float *__p, __m128i __m, __m128 __a) { __builtin_ia32_maskstoreps((__v4sf *)__p, (__v4si)__m, (__v4sf)__a); } /* Cacheability support ops */ /// \brief Moves integer data from a 256-bit integer vector to a 32-byte /// aligned memory location. To minimize caching, the data is flagged as /// non-temporal (unlikely to be used again soon). /// /// \headerfile /// /// This intrinsic corresponds to the VMOVNTDQ instruction. /// /// \param __a /// A pointer to a 32-byte aligned memory location that will receive the /// integer values. /// \param __b /// A 256-bit integer vector containing the values to be moved. static __inline void __DEFAULT_FN_ATTRS _mm256_stream_si256(__m256i *__a, __m256i __b) { typedef __v4di __v4di_aligned __attribute__((aligned(32))); __builtin_nontemporal_store((__v4di_aligned)__b, (__v4di_aligned*)__a); } /// \brief Moves double-precision values from a 256-bit vector of [4 x double] /// to a 32-byte aligned memory location. To minimize caching, the data is /// flagged as non-temporal (unlikely to be used again soon). /// /// \headerfile /// /// This intrinsic corresponds to the VMOVNTPD instruction. /// /// \param __a /// A pointer to a 32-byte aligned memory location that will receive the /// double-precision floating-point values. /// \param __b /// A 256-bit vector of [4 x double] containing the values to be moved. static __inline void __DEFAULT_FN_ATTRS _mm256_stream_pd(double *__a, __m256d __b) { typedef __v4df __v4df_aligned __attribute__((aligned(32))); __builtin_nontemporal_store((__v4df_aligned)__b, (__v4df_aligned*)__a); } /// \brief Moves single-precision floating point values from a 256-bit vector /// of [8 x float] to a 32-byte aligned memory location. To minimize /// caching, the data is flagged as non-temporal (unlikely to be used again /// soon). /// /// \headerfile /// /// This intrinsic corresponds to the VMOVNTPS instruction. /// /// \param __p /// A pointer to a 32-byte aligned memory location that will receive the /// single-precision floating point values. /// \param __a /// A 256-bit vector of [8 x float] containing the values to be moved. static __inline void __DEFAULT_FN_ATTRS _mm256_stream_ps(float *__p, __m256 __a) { typedef __v8sf __v8sf_aligned __attribute__((aligned(32))); __builtin_nontemporal_store((__v8sf_aligned)__a, (__v8sf_aligned*)__p); } /* Create vectors */ /// \brief Create a 256-bit vector of [4 x double] with undefined values. /// /// \headerfile /// /// This intrinsic has no corresponding instruction. /// /// \returns A 256-bit vector of [4 x double] containing undefined values. static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_undefined_pd(void) { return (__m256d)__builtin_ia32_undef256(); } /// \brief Create a 256-bit vector of [8 x float] with undefined values. /// /// \headerfile /// /// This intrinsic has no corresponding instruction. /// /// \returns A 256-bit vector of [8 x float] containing undefined values. static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_undefined_ps(void) { return (__m256)__builtin_ia32_undef256(); } /// \brief Create a 256-bit integer vector with undefined values. /// /// \headerfile /// /// This intrinsic has no corresponding instruction. /// /// \returns A 256-bit integer vector containing undefined values. static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_undefined_si256(void) { return (__m256i)__builtin_ia32_undef256(); } /// \brief Constructs a 256-bit floating-point vector of [4 x double] /// initialized with the specified double-precision floating-point values. /// /// \headerfile /// /// This intrinsic corresponds to the VUNPCKLPD+VINSERTF128 /// instruction. /// /// \param __a /// A double-precision floating-point value used to initialize bits [255:192] /// of the result. /// \param __b /// A double-precision floating-point value used to initialize bits [191:128] /// of the result. /// \param __c /// A double-precision floating-point value used to initialize bits [127:64] /// of the result. /// \param __d /// A double-precision floating-point value used to initialize bits [63:0] /// of the result. /// \returns An initialized 256-bit floating-point vector of [4 x double]. static __inline __m256d __DEFAULT_FN_ATTRS _mm256_set_pd(double __a, double __b, double __c, double __d) { return (__m256d){ __d, __c, __b, __a }; } /// \brief Constructs a 256-bit floating-point vector of [8 x float] initialized /// with the specified single-precision floating-point values. /// /// \headerfile /// /// This intrinsic is a utility function and does not correspond to a specific /// instruction. /// /// \param __a /// A single-precision floating-point value used to initialize bits [255:224] /// of the result. /// \param __b /// A single-precision floating-point value used to initialize bits [223:192] /// of the result. /// \param __c /// A single-precision floating-point value used to initialize bits [191:160] /// of the result. /// \param __d /// A single-precision floating-point value used to initialize bits [159:128] /// of the result. /// \param __e /// A single-precision floating-point value used to initialize bits [127:96] /// of the result. /// \param __f /// A single-precision floating-point value used to initialize bits [95:64] /// of the result. /// \param __g /// A single-precision floating-point value used to initialize bits [63:32] /// of the result. /// \param __h /// A single-precision floating-point value used to initialize bits [31:0] /// of the result. /// \returns An initialized 256-bit floating-point vector of [8 x float]. static __inline __m256 __DEFAULT_FN_ATTRS _mm256_set_ps(float __a, float __b, float __c, float __d, float __e, float __f, float __g, float __h) { return (__m256){ __h, __g, __f, __e, __d, __c, __b, __a }; } /// \brief Constructs a 256-bit integer vector initialized with the specified /// 32-bit integral values. /// /// \headerfile /// /// This intrinsic is a utility function and does not correspond to a specific /// instruction. /// /// \param __i0 /// A 32-bit integral value used to initialize bits [255:224] of the result. /// \param __i1 /// A 32-bit integral value used to initialize bits [223:192] of the result. /// \param __i2 /// A 32-bit integral value used to initialize bits [191:160] of the result. /// \param __i3 /// A 32-bit integral value used to initialize bits [159:128] of the result. /// \param __i4 /// A 32-bit integral value used to initialize bits [127:96] of the result. /// \param __i5 /// A 32-bit integral value used to initialize bits [95:64] of the result. /// \param __i6 /// A 32-bit integral value used to initialize bits [63:32] of the result. /// \param __i7 /// A 32-bit integral value used to initialize bits [31:0] of the result. /// \returns An initialized 256-bit integer vector. static __inline __m256i __DEFAULT_FN_ATTRS _mm256_set_epi32(int __i0, int __i1, int __i2, int __i3, int __i4, int __i5, int __i6, int __i7) { return (__m256i)(__v8si){ __i7, __i6, __i5, __i4, __i3, __i2, __i1, __i0 }; } /// \brief Constructs a 256-bit integer vector initialized with the specified /// 16-bit integral values. /// /// \headerfile /// /// This intrinsic is a utility function and does not correspond to a specific /// instruction. /// /// \param __w15 /// A 16-bit integral value used to initialize bits [255:240] of the result. /// \param __w14 /// A 16-bit integral value used to initialize bits [239:224] of the result. /// \param __w13 /// A 16-bit integral value used to initialize bits [223:208] of the result. /// \param __w12 /// A 16-bit integral value used to initialize bits [207:192] of the result. /// \param __w11 /// A 16-bit integral value used to initialize bits [191:176] of the result. /// \param __w10 /// A 16-bit integral value used to initialize bits [175:160] of the result. /// \param __w09 /// A 16-bit integral value used to initialize bits [159:144] of the result. /// \param __w08 /// A 16-bit integral value used to initialize bits [143:128] of the result. /// \param __w07 /// A 16-bit integral value used to initialize bits [127:112] of the result. /// \param __w06 /// A 16-bit integral value used to initialize bits [111:96] of the result. /// \param __w05 /// A 16-bit integral value used to initialize bits [95:80] of the result. /// \param __w04 /// A 16-bit integral value used to initialize bits [79:64] of the result. /// \param __w03 /// A 16-bit integral value used to initialize bits [63:48] of the result. /// \param __w02 /// A 16-bit integral value used to initialize bits [47:32] of the result. /// \param __w01 /// A 16-bit integral value used to initialize bits [31:16] of the result. /// \param __w00 /// A 16-bit integral value used to initialize bits [15:0] of the result. /// \returns An initialized 256-bit integer vector. static __inline __m256i __DEFAULT_FN_ATTRS _mm256_set_epi16(short __w15, short __w14, short __w13, short __w12, short __w11, short __w10, short __w09, short __w08, short __w07, short __w06, short __w05, short __w04, short __w03, short __w02, short __w01, short __w00) { return (__m256i)(__v16hi){ __w00, __w01, __w02, __w03, __w04, __w05, __w06, __w07, __w08, __w09, __w10, __w11, __w12, __w13, __w14, __w15 }; } /// \brief Constructs a 256-bit integer vector initialized with the specified /// 8-bit integral values. /// /// \headerfile /// /// This intrinsic is a utility function and does not correspond to a specific /// instruction. /// /// \param __b31 /// An 8-bit integral value used to initialize bits [255:248] of the result. /// \param __b30 /// An 8-bit integral value used to initialize bits [247:240] of the result. /// \param __b29 /// An 8-bit integral value used to initialize bits [239:232] of the result. /// \param __b28 /// An 8-bit integral value used to initialize bits [231:224] of the result. /// \param __b27 /// An 8-bit integral value used to initialize bits [223:216] of the result. /// \param __b26 /// An 8-bit integral value used to initialize bits [215:208] of the result. /// \param __b25 /// An 8-bit integral value used to initialize bits [207:200] of the result. /// \param __b24 /// An 8-bit integral value used to initialize bits [199:192] of the result. /// \param __b23 /// An 8-bit integral value used to initialize bits [191:184] of the result. /// \param __b22 /// An 8-bit integral value used to initialize bits [183:176] of the result. /// \param __b21 /// An 8-bit integral value used to initialize bits [175:168] of the result. /// \param __b20 /// An 8-bit integral value used to initialize bits [167:160] of the result. /// \param __b19 /// An 8-bit integral value used to initialize bits [159:152] of the result. /// \param __b18 /// An 8-bit integral value used to initialize bits [151:144] of the result. /// \param __b17 /// An 8-bit integral value used to initialize bits [143:136] of the result. /// \param __b16 /// An 8-bit integral value used to initialize bits [135:128] of the result. /// \param __b15 /// An 8-bit integral value used to initialize bits [127:120] of the result. /// \param __b14 /// An 8-bit integral value used to initialize bits [119:112] of the result. /// \param __b13 /// An 8-bit integral value used to initialize bits [111:104] of the result. /// \param __b12 /// An 8-bit integral value used to initialize bits [103:96] of the result. /// \param __b11 /// An 8-bit integral value used to initialize bits [95:88] of the result. /// \param __b10 /// An 8-bit integral value used to initialize bits [87:80] of the result. /// \param __b09 /// An 8-bit integral value used to initialize bits [79:72] of the result. /// \param __b08 /// An 8-bit integral value used to initialize bits [71:64] of the result. /// \param __b07 /// An 8-bit integral value used to initialize bits [63:56] of the result. /// \param __b06 /// An 8-bit integral value used to initialize bits [55:48] of the result. /// \param __b05 /// An 8-bit integral value used to initialize bits [47:40] of the result. /// \param __b04 /// An 8-bit integral value used to initialize bits [39:32] of the result. /// \param __b03 /// An 8-bit integral value used to initialize bits [31:24] of the result. /// \param __b02 /// An 8-bit integral value used to initialize bits [23:16] of the result. /// \param __b01 /// An 8-bit integral value used to initialize bits [15:8] of the result. /// \param __b00 /// An 8-bit integral value used to initialize bits [7:0] of the result. /// \returns An initialized 256-bit integer vector. static __inline __m256i __DEFAULT_FN_ATTRS _mm256_set_epi8(char __b31, char __b30, char __b29, char __b28, char __b27, char __b26, char __b25, char __b24, char __b23, char __b22, char __b21, char __b20, char __b19, char __b18, char __b17, char __b16, char __b15, char __b14, char __b13, char __b12, char __b11, char __b10, char __b09, char __b08, char __b07, char __b06, char __b05, char __b04, char __b03, char __b02, char __b01, char __b00) { return (__m256i)(__v32qi){ __b00, __b01, __b02, __b03, __b04, __b05, __b06, __b07, __b08, __b09, __b10, __b11, __b12, __b13, __b14, __b15, __b16, __b17, __b18, __b19, __b20, __b21, __b22, __b23, __b24, __b25, __b26, __b27, __b28, __b29, __b30, __b31 }; } /// \brief Constructs a 256-bit integer vector initialized with the specified /// 64-bit integral values. /// /// \headerfile /// /// This intrinsic corresponds to the VPUNPCKLQDQ+VINSERTF128 /// instruction. /// /// \param __a /// A 64-bit integral value used to initialize bits [255:192] of the result. /// \param __b /// A 64-bit integral value used to initialize bits [191:128] of the result. /// \param __c /// A 64-bit integral value used to initialize bits [127:64] of the result. /// \param __d /// A 64-bit integral value used to initialize bits [63:0] of the result. /// \returns An initialized 256-bit integer vector. static __inline __m256i __DEFAULT_FN_ATTRS _mm256_set_epi64x(long long __a, long long __b, long long __c, long long __d) { return (__m256i)(__v4di){ __d, __c, __b, __a }; } /* Create vectors with elements in reverse order */ /// \brief Constructs a 256-bit floating-point vector of [4 x double], /// initialized in reverse order with the specified double-precision /// floating-point values. /// /// \headerfile /// /// This intrinsic corresponds to the VUNPCKLPD+VINSERTF128 /// instruction. /// /// \param __a /// A double-precision floating-point value used to initialize bits [63:0] /// of the result. /// \param __b /// A double-precision floating-point value used to initialize bits [127:64] /// of the result. /// \param __c /// A double-precision floating-point value used to initialize bits [191:128] /// of the result. /// \param __d /// A double-precision floating-point value used to initialize bits [255:192] /// of the result. /// \returns An initialized 256-bit floating-point vector of [4 x double]. static __inline __m256d __DEFAULT_FN_ATTRS _mm256_setr_pd(double __a, double __b, double __c, double __d) { return (__m256d){ __a, __b, __c, __d }; } /// \brief Constructs a 256-bit floating-point vector of [8 x float], /// initialized in reverse order with the specified single-precision /// float-point values. /// /// \headerfile /// /// This intrinsic is a utility function and does not correspond to a specific /// instruction. /// /// \param __a /// A single-precision floating-point value used to initialize bits [31:0] /// of the result. /// \param __b /// A single-precision floating-point value used to initialize bits [63:32] /// of the result. /// \param __c /// A single-precision floating-point value used to initialize bits [95:64] /// of the result. /// \param __d /// A single-precision floating-point value used to initialize bits [127:96] /// of the result. /// \param __e /// A single-precision floating-point value used to initialize bits [159:128] /// of the result. /// \param __f /// A single-precision floating-point value used to initialize bits [191:160] /// of the result. /// \param __g /// A single-precision floating-point value used to initialize bits [223:192] /// of the result. /// \param __h /// A single-precision floating-point value used to initialize bits [255:224] /// of the result. /// \returns An initialized 256-bit floating-point vector of [8 x float]. static __inline __m256 __DEFAULT_FN_ATTRS _mm256_setr_ps(float __a, float __b, float __c, float __d, float __e, float __f, float __g, float __h) { return (__m256){ __a, __b, __c, __d, __e, __f, __g, __h }; } /// \brief Constructs a 256-bit integer vector, initialized in reverse order /// with the specified 32-bit integral values. /// /// \headerfile /// /// This intrinsic is a utility function and does not correspond to a specific /// instruction. /// /// \param __i0 /// A 32-bit integral value used to initialize bits [31:0] of the result. /// \param __i1 /// A 32-bit integral value used to initialize bits [63:32] of the result. /// \param __i2 /// A 32-bit integral value used to initialize bits [95:64] of the result. /// \param __i3 /// A 32-bit integral value used to initialize bits [127:96] of the result. /// \param __i4 /// A 32-bit integral value used to initialize bits [159:128] of the result. /// \param __i5 /// A 32-bit integral value used to initialize bits [191:160] of the result. /// \param __i6 /// A 32-bit integral value used to initialize bits [223:192] of the result. /// \param __i7 /// A 32-bit integral value used to initialize bits [255:224] of the result. /// \returns An initialized 256-bit integer vector. static __inline __m256i __DEFAULT_FN_ATTRS _mm256_setr_epi32(int __i0, int __i1, int __i2, int __i3, int __i4, int __i5, int __i6, int __i7) { return (__m256i)(__v8si){ __i0, __i1, __i2, __i3, __i4, __i5, __i6, __i7 }; } /// \brief Constructs a 256-bit integer vector, initialized in reverse order /// with the specified 16-bit integral values. /// /// \headerfile /// /// This intrinsic is a utility function and does not correspond to a specific /// instruction. /// /// \param __w15 /// A 16-bit integral value used to initialize bits [15:0] of the result. /// \param __w14 /// A 16-bit integral value used to initialize bits [31:16] of the result. /// \param __w13 /// A 16-bit integral value used to initialize bits [47:32] of the result. /// \param __w12 /// A 16-bit integral value used to initialize bits [63:48] of the result. /// \param __w11 /// A 16-bit integral value used to initialize bits [79:64] of the result. /// \param __w10 /// A 16-bit integral value used to initialize bits [95:80] of the result. /// \param __w09 /// A 16-bit integral value used to initialize bits [111:96] of the result. /// \param __w08 /// A 16-bit integral value used to initialize bits [127:112] of the result. /// \param __w07 /// A 16-bit integral value used to initialize bits [143:128] of the result. /// \param __w06 /// A 16-bit integral value used to initialize bits [159:144] of the result. /// \param __w05 /// A 16-bit integral value used to initialize bits [175:160] of the result. /// \param __w04 /// A 16-bit integral value used to initialize bits [191:176] of the result. /// \param __w03 /// A 16-bit integral value used to initialize bits [207:192] of the result. /// \param __w02 /// A 16-bit integral value used to initialize bits [223:208] of the result. /// \param __w01 /// A 16-bit integral value used to initialize bits [239:224] of the result. /// \param __w00 /// A 16-bit integral value used to initialize bits [255:240] of the result. /// \returns An initialized 256-bit integer vector. static __inline __m256i __DEFAULT_FN_ATTRS _mm256_setr_epi16(short __w15, short __w14, short __w13, short __w12, short __w11, short __w10, short __w09, short __w08, short __w07, short __w06, short __w05, short __w04, short __w03, short __w02, short __w01, short __w00) { return (__m256i)(__v16hi){ __w15, __w14, __w13, __w12, __w11, __w10, __w09, __w08, __w07, __w06, __w05, __w04, __w03, __w02, __w01, __w00 }; } /// \brief Constructs a 256-bit integer vector, initialized in reverse order /// with the specified 8-bit integral values. /// /// \headerfile /// /// This intrinsic is a utility function and does not correspond to a specific /// instruction. /// /// \param __b31 /// An 8-bit integral value used to initialize bits [7:0] of the result. /// \param __b30 /// An 8-bit integral value used to initialize bits [15:8] of the result. /// \param __b29 /// An 8-bit integral value used to initialize bits [23:16] of the result. /// \param __b28 /// An 8-bit integral value used to initialize bits [31:24] of the result. /// \param __b27 /// An 8-bit integral value used to initialize bits [39:32] of the result. /// \param __b26 /// An 8-bit integral value used to initialize bits [47:40] of the result. /// \param __b25 /// An 8-bit integral value used to initialize bits [55:48] of the result. /// \param __b24 /// An 8-bit integral value used to initialize bits [63:56] of the result. /// \param __b23 /// An 8-bit integral value used to initialize bits [71:64] of the result. /// \param __b22 /// An 8-bit integral value used to initialize bits [79:72] of the result. /// \param __b21 /// An 8-bit integral value used to initialize bits [87:80] of the result. /// \param __b20 /// An 8-bit integral value used to initialize bits [95:88] of the result. /// \param __b19 /// An 8-bit integral value used to initialize bits [103:96] of the result. /// \param __b18 /// An 8-bit integral value used to initialize bits [111:104] of the result. /// \param __b17 /// An 8-bit integral value used to initialize bits [119:112] of the result. /// \param __b16 /// An 8-bit integral value used to initialize bits [127:120] of the result. /// \param __b15 /// An 8-bit integral value used to initialize bits [135:128] of the result. /// \param __b14 /// An 8-bit integral value used to initialize bits [143:136] of the result. /// \param __b13 /// An 8-bit integral value used to initialize bits [151:144] of the result. /// \param __b12 /// An 8-bit integral value used to initialize bits [159:152] of the result. /// \param __b11 /// An 8-bit integral value used to initialize bits [167:160] of the result. /// \param __b10 /// An 8-bit integral value used to initialize bits [175:168] of the result. /// \param __b09 /// An 8-bit integral value used to initialize bits [183:176] of the result. /// \param __b08 /// An 8-bit integral value used to initialize bits [191:184] of the result. /// \param __b07 /// An 8-bit integral value used to initialize bits [199:192] of the result. /// \param __b06 /// An 8-bit integral value used to initialize bits [207:200] of the result. /// \param __b05 /// An 8-bit integral value used to initialize bits [215:208] of the result. /// \param __b04 /// An 8-bit integral value used to initialize bits [223:216] of the result. /// \param __b03 /// An 8-bit integral value used to initialize bits [231:224] of the result. /// \param __b02 /// An 8-bit integral value used to initialize bits [239:232] of the result. /// \param __b01 /// An 8-bit integral value used to initialize bits [247:240] of the result. /// \param __b00 /// An 8-bit integral value used to initialize bits [255:248] of the result. /// \returns An initialized 256-bit integer vector. static __inline __m256i __DEFAULT_FN_ATTRS _mm256_setr_epi8(char __b31, char __b30, char __b29, char __b28, char __b27, char __b26, char __b25, char __b24, char __b23, char __b22, char __b21, char __b20, char __b19, char __b18, char __b17, char __b16, char __b15, char __b14, char __b13, char __b12, char __b11, char __b10, char __b09, char __b08, char __b07, char __b06, char __b05, char __b04, char __b03, char __b02, char __b01, char __b00) { return (__m256i)(__v32qi){ __b31, __b30, __b29, __b28, __b27, __b26, __b25, __b24, __b23, __b22, __b21, __b20, __b19, __b18, __b17, __b16, __b15, __b14, __b13, __b12, __b11, __b10, __b09, __b08, __b07, __b06, __b05, __b04, __b03, __b02, __b01, __b00 }; } /// \brief Constructs a 256-bit integer vector, initialized in reverse order /// with the specified 64-bit integral values. /// /// \headerfile /// /// This intrinsic corresponds to the VPUNPCKLQDQ+VINSERTF128 /// instruction. /// /// \param __a /// A 64-bit integral value used to initialize bits [63:0] of the result. /// \param __b /// A 64-bit integral value used to initialize bits [127:64] of the result. /// \param __c /// A 64-bit integral value used to initialize bits [191:128] of the result. /// \param __d /// A 64-bit integral value used to initialize bits [255:192] of the result. /// \returns An initialized 256-bit integer vector. static __inline __m256i __DEFAULT_FN_ATTRS _mm256_setr_epi64x(long long __a, long long __b, long long __c, long long __d) { return (__m256i)(__v4di){ __a, __b, __c, __d }; } /* Create vectors with repeated elements */ /// \brief Constructs a 256-bit floating-point vector of [4 x double], with each /// of the four double-precision floating-point vector elements set to the /// specified double-precision floating-point value. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVDDUP+VINSERTF128 instruction. /// /// \param __w /// A double-precision floating-point value used to initialize each vector /// element of the result. /// \returns An initialized 256-bit floating-point vector of [4 x double]. static __inline __m256d __DEFAULT_FN_ATTRS _mm256_set1_pd(double __w) { return (__m256d){ __w, __w, __w, __w }; } /// \brief Constructs a 256-bit floating-point vector of [8 x float], with each /// of the eight single-precision floating-point vector elements set to the /// specified single-precision floating-point value. /// /// \headerfile /// /// This intrinsic corresponds to the VPERMILPS+VINSERTF128 /// instruction. /// /// \param __w /// A single-precision floating-point value used to initialize each vector /// element of the result. /// \returns An initialized 256-bit floating-point vector of [8 x float]. static __inline __m256 __DEFAULT_FN_ATTRS _mm256_set1_ps(float __w) { return (__m256){ __w, __w, __w, __w, __w, __w, __w, __w }; } /// \brief Constructs a 256-bit integer vector of [8 x i32], with each of the /// 32-bit integral vector elements set to the specified 32-bit integral /// value. /// /// \headerfile /// /// This intrinsic corresponds to the VPERMILPS+VINSERTF128 /// instruction. /// /// \param __i /// A 32-bit integral value used to initialize each vector element of the /// result. /// \returns An initialized 256-bit integer vector of [8 x i32]. static __inline __m256i __DEFAULT_FN_ATTRS _mm256_set1_epi32(int __i) { return (__m256i)(__v8si){ __i, __i, __i, __i, __i, __i, __i, __i }; } /// \brief Constructs a 256-bit integer vector of [16 x i16], with each of the /// 16-bit integral vector elements set to the specified 16-bit integral /// value. /// /// \headerfile /// /// This intrinsic corresponds to the VPSHUFB+VINSERTF128 instruction. /// /// \param __w /// A 16-bit integral value used to initialize each vector element of the /// result. /// \returns An initialized 256-bit integer vector of [16 x i16]. static __inline __m256i __DEFAULT_FN_ATTRS _mm256_set1_epi16(short __w) { return (__m256i)(__v16hi){ __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w }; } /// \brief Constructs a 256-bit integer vector of [32 x i8], with each of the /// 8-bit integral vector elements set to the specified 8-bit integral value. /// /// \headerfile /// /// This intrinsic corresponds to the VPSHUFB+VINSERTF128 instruction. /// /// \param __b /// An 8-bit integral value used to initialize each vector element of the /// result. /// \returns An initialized 256-bit integer vector of [32 x i8]. static __inline __m256i __DEFAULT_FN_ATTRS _mm256_set1_epi8(char __b) { return (__m256i)(__v32qi){ __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b, __b }; } /// \brief Constructs a 256-bit integer vector of [4 x i64], with each of the /// 64-bit integral vector elements set to the specified 64-bit integral /// value. /// /// \headerfile /// /// This intrinsic corresponds to the VMOVDDUP+VINSERTF128 instruction. /// /// \param __q /// A 64-bit integral value used to initialize each vector element of the /// result. /// \returns An initialized 256-bit integer vector of [4 x i64]. static __inline __m256i __DEFAULT_FN_ATTRS _mm256_set1_epi64x(long long __q) { return (__m256i)(__v4di){ __q, __q, __q, __q }; } /* Create __zeroed vectors */ /// \brief Constructs a 256-bit floating-point vector of [4 x double] with all /// vector elements initialized to zero. /// /// \headerfile /// /// This intrinsic corresponds to the VXORPS instruction. /// /// \returns A 256-bit vector of [4 x double] with all elements set to zero. static __inline __m256d __DEFAULT_FN_ATTRS _mm256_setzero_pd(void) { return (__m256d){ 0, 0, 0, 0 }; } /// \brief Constructs a 256-bit floating-point vector of [8 x float] with all /// vector elements initialized to zero. /// /// \headerfile /// /// This intrinsic corresponds to the VXORPS instruction. /// /// \returns A 256-bit vector of [8 x float] with all elements set to zero. static __inline __m256 __DEFAULT_FN_ATTRS _mm256_setzero_ps(void) { return (__m256){ 0, 0, 0, 0, 0, 0, 0, 0 }; } /// \brief Constructs a 256-bit integer vector initialized to zero. /// /// \headerfile /// /// This intrinsic corresponds to the VXORPS instruction. /// /// \returns A 256-bit integer vector initialized to zero. static __inline __m256i __DEFAULT_FN_ATTRS _mm256_setzero_si256(void) { return (__m256i){ 0LL, 0LL, 0LL, 0LL }; } /* Cast between vector types */ /// \brief Casts a 256-bit floating-point vector of [4 x double] into a 256-bit /// floating-point vector of [8 x float]. /// /// \headerfile /// /// This intrinsic has no corresponding instruction. /// /// \param __a /// A 256-bit floating-point vector of [4 x double]. /// \returns A 256-bit floating-point vector of [8 x float] containing the same /// bitwise pattern as the parameter. static __inline __m256 __DEFAULT_FN_ATTRS _mm256_castpd_ps(__m256d __a) { return (__m256)__a; } /// \brief Casts a 256-bit floating-point vector of [4 x double] into a 256-bit /// integer vector. /// /// \headerfile /// /// This intrinsic has no corresponding instruction. /// /// \param __a /// A 256-bit floating-point vector of [4 x double]. /// \returns A 256-bit integer vector containing the same bitwise pattern as the /// parameter. static __inline __m256i __DEFAULT_FN_ATTRS _mm256_castpd_si256(__m256d __a) { return (__m256i)__a; } /// \brief Casts a 256-bit floating-point vector of [8 x float] into a 256-bit /// floating-point vector of [4 x double]. /// /// \headerfile /// /// This intrinsic has no corresponding instruction. /// /// \param __a /// A 256-bit floating-point vector of [8 x float]. /// \returns A 256-bit floating-point vector of [4 x double] containing the same /// bitwise pattern as the parameter. static __inline __m256d __DEFAULT_FN_ATTRS _mm256_castps_pd(__m256 __a) { return (__m256d)__a; } /// \brief Casts a 256-bit floating-point vector of [8 x float] into a 256-bit /// integer vector. /// /// \headerfile /// /// This intrinsic has no corresponding instruction. /// /// \param __a /// A 256-bit floating-point vector of [8 x float]. /// \returns A 256-bit integer vector containing the same bitwise pattern as the /// parameter. static __inline __m256i __DEFAULT_FN_ATTRS _mm256_castps_si256(__m256 __a) { return (__m256i)__a; } /// \brief Casts a 256-bit integer vector into a 256-bit floating-point vector /// of [8 x float]. /// /// \headerfile /// /// This intrinsic has no corresponding instruction. /// /// \param __a /// A 256-bit integer vector. /// \returns A 256-bit floating-point vector of [8 x float] containing the same /// bitwise pattern as the parameter. static __inline __m256 __DEFAULT_FN_ATTRS _mm256_castsi256_ps(__m256i __a) { return (__m256)__a; } /// \brief Casts a 256-bit integer vector into a 256-bit floating-point vector /// of [4 x double]. /// /// \headerfile /// /// This intrinsic has no corresponding instruction. /// /// \param __a /// A 256-bit integer vector. /// \returns A 256-bit floating-point vector of [4 x double] containing the same /// bitwise pattern as the parameter. static __inline __m256d __DEFAULT_FN_ATTRS _mm256_castsi256_pd(__m256i __a) { return (__m256d)__a; } /// \brief Returns the lower 128 bits of a 256-bit floating-point vector of /// [4 x double] as a 128-bit floating-point vector of [2 x double]. /// /// \headerfile /// /// This intrinsic has no corresponding instruction. /// /// \param __a /// A 256-bit floating-point vector of [4 x double]. /// \returns A 128-bit floating-point vector of [2 x double] containing the /// lower 128 bits of the parameter. static __inline __m128d __DEFAULT_FN_ATTRS _mm256_castpd256_pd128(__m256d __a) { return __builtin_shufflevector((__v4df)__a, (__v4df)__a, 0, 1); } /// \brief Returns the lower 128 bits of a 256-bit floating-point vector of /// [8 x float] as a 128-bit floating-point vector of [4 x float]. /// /// \headerfile /// /// This intrinsic has no corresponding instruction. /// /// \param __a /// A 256-bit floating-point vector of [8 x float]. /// \returns A 128-bit floating-point vector of [4 x float] containing the /// lower 128 bits of the parameter. static __inline __m128 __DEFAULT_FN_ATTRS _mm256_castps256_ps128(__m256 __a) { return __builtin_shufflevector((__v8sf)__a, (__v8sf)__a, 0, 1, 2, 3); } /// \brief Truncates a 256-bit integer vector into a 128-bit integer vector. /// /// \headerfile /// /// This intrinsic has no corresponding instruction. /// /// \param __a /// A 256-bit integer vector. /// \returns A 128-bit integer vector containing the lower 128 bits of the /// parameter. static __inline __m128i __DEFAULT_FN_ATTRS _mm256_castsi256_si128(__m256i __a) { return __builtin_shufflevector((__v4di)__a, (__v4di)__a, 0, 1); } /// \brief Constructs a 256-bit floating-point vector of [4 x double] from a /// 128-bit floating-point vector of [2 x double]. /// /// The lower 128 bits contain the value of the source vector. The contents /// of the upper 128 bits are undefined. /// /// \headerfile /// /// This intrinsic has no corresponding instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. /// \returns A 256-bit floating-point vector of [4 x double]. The lower 128 bits /// contain the value of the parameter. The contents of the upper 128 bits /// are undefined. static __inline __m256d __DEFAULT_FN_ATTRS _mm256_castpd128_pd256(__m128d __a) { return __builtin_shufflevector((__v2df)__a, (__v2df)__a, 0, 1, -1, -1); } /// \brief Constructs a 256-bit floating-point vector of [8 x float] from a /// 128-bit floating-point vector of [4 x float]. /// /// The lower 128 bits contain the value of the source vector. The contents /// of the upper 128 bits are undefined. /// /// \headerfile /// /// This intrinsic has no corresponding instruction. /// /// \param __a /// A 128-bit vector of [4 x float]. /// \returns A 256-bit floating-point vector of [8 x float]. The lower 128 bits /// contain the value of the parameter. The contents of the upper 128 bits /// are undefined. static __inline __m256 __DEFAULT_FN_ATTRS _mm256_castps128_ps256(__m128 __a) { return __builtin_shufflevector((__v4sf)__a, (__v4sf)__a, 0, 1, 2, 3, -1, -1, -1, -1); } /// \brief Constructs a 256-bit integer vector from a 128-bit integer vector. /// /// The lower 128 bits contain the value of the source vector. The contents /// of the upper 128 bits are undefined. /// /// \headerfile /// /// This intrinsic has no corresponding instruction. /// /// \param __a /// A 128-bit integer vector. /// \returns A 256-bit integer vector. The lower 128 bits contain the value of /// the parameter. The contents of the upper 128 bits are undefined. static __inline __m256i __DEFAULT_FN_ATTRS _mm256_castsi128_si256(__m128i __a) { return __builtin_shufflevector((__v2di)__a, (__v2di)__a, 0, 1, -1, -1); } /// \brief Constructs a 256-bit floating-point vector of [4 x double] from a /// 128-bit floating-point vector of [2 x double]. The lower 128 bits /// contain the value of the source vector. The upper 128 bits are set /// to zero. /// /// \headerfile /// /// This intrinsic has no corresponding instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. /// \returns A 256-bit floating-point vector of [4 x double]. The lower 128 bits /// contain the value of the parameter. The upper 128 bits are set to zero. static __inline __m256d __DEFAULT_FN_ATTRS _mm256_zextpd128_pd256(__m128d __a) { return __builtin_shufflevector((__v2df)__a, (__v2df)_mm_setzero_pd(), 0, 1, 2, 3); } /// \brief Constructs a 256-bit floating-point vector of [8 x float] from a /// 128-bit floating-point vector of [4 x float]. The lower 128 bits contain /// the value of the source vector. The upper 128 bits are set to zero. /// /// \headerfile /// /// This intrinsic has no corresponding instruction. /// /// \param __a /// A 128-bit vector of [4 x float]. /// \returns A 256-bit floating-point vector of [8 x float]. The lower 128 bits /// contain the value of the parameter. The upper 128 bits are set to zero. static __inline __m256 __DEFAULT_FN_ATTRS _mm256_zextps128_ps256(__m128 __a) { return __builtin_shufflevector((__v4sf)__a, (__v4sf)_mm_setzero_ps(), 0, 1, 2, 3, 4, 5, 6, 7); } /// \brief Constructs a 256-bit integer vector from a 128-bit integer vector. /// The lower 128 bits contain the value of the source vector. The upper /// 128 bits are set to zero. /// /// \headerfile /// /// This intrinsic has no corresponding instruction. /// /// \param __a /// A 128-bit integer vector. /// \returns A 256-bit integer vector. The lower 128 bits contain the value of /// the parameter. The upper 128 bits are set to zero. static __inline __m256i __DEFAULT_FN_ATTRS _mm256_zextsi128_si256(__m128i __a) { return __builtin_shufflevector((__v2di)__a, (__v2di)_mm_setzero_si128(), 0, 1, 2, 3); } /* Vector insert. We use macros rather than inlines because we only want to accept invocations where the immediate M is a constant expression. */ /// \brief Constructs a new 256-bit vector of [8 x float] by first duplicating /// a 256-bit vector of [8 x float] given in the first parameter, and then /// replacing either the upper or the lower 128 bits with the contents of a /// 128-bit vector of [4 x float] in the second parameter. /// /// The immediate integer parameter determines between the upper or the lower /// 128 bits. /// /// \headerfile /// /// \code /// __m256 _mm256_insertf128_ps(__m256 V1, __m128 V2, const int M); /// \endcode /// /// This intrinsic corresponds to the VINSERTF128 instruction. /// /// \param V1 /// A 256-bit vector of [8 x float]. This vector is copied to the result /// first, and then either the upper or the lower 128 bits of the result will /// be replaced by the contents of \a V2. /// \param V2 /// A 128-bit vector of [4 x float]. The contents of this parameter are /// written to either the upper or the lower 128 bits of the result depending /// on the value of parameter \a M. /// \param M /// An immediate integer. The least significant bit determines how the values /// from the two parameters are interleaved: \n /// If bit [0] of \a M is 0, \a V2 are copied to bits [127:0] of the result, /// and bits [255:128] of \a V1 are copied to bits [255:128] of the /// result. \n /// If bit [0] of \a M is 1, \a V2 are copied to bits [255:128] of the /// result, and bits [127:0] of \a V1 are copied to bits [127:0] of the /// result. /// \returns A 256-bit vector of [8 x float] containing the interleaved values. #define _mm256_insertf128_ps(V1, V2, M) __extension__ ({ \ (__m256)__builtin_shufflevector( \ (__v8sf)(__m256)(V1), \ (__v8sf)_mm256_castps128_ps256((__m128)(V2)), \ (((M) & 1) ? 0 : 8), \ (((M) & 1) ? 1 : 9), \ (((M) & 1) ? 2 : 10), \ (((M) & 1) ? 3 : 11), \ (((M) & 1) ? 8 : 4), \ (((M) & 1) ? 9 : 5), \ (((M) & 1) ? 10 : 6), \ (((M) & 1) ? 11 : 7) );}) /// \brief Constructs a new 256-bit vector of [4 x double] by first duplicating /// a 256-bit vector of [4 x double] given in the first parameter, and then /// replacing either the upper or the lower 128 bits with the contents of a /// 128-bit vector of [2 x double] in the second parameter. /// /// The immediate integer parameter determines between the upper or the lower /// 128 bits. /// /// \headerfile /// /// \code /// __m256d _mm256_insertf128_pd(__m256d V1, __m128d V2, const int M); /// \endcode /// /// This intrinsic corresponds to the VINSERTF128 instruction. /// /// \param V1 /// A 256-bit vector of [4 x double]. This vector is copied to the result /// first, and then either the upper or the lower 128 bits of the result will /// be replaced by the contents of \a V2. /// \param V2 /// A 128-bit vector of [2 x double]. The contents of this parameter are /// written to either the upper or the lower 128 bits of the result depending /// on the value of parameter \a M. /// \param M /// An immediate integer. The least significant bit determines how the values /// from the two parameters are interleaved: \n /// If bit [0] of \a M is 0, \a V2 are copied to bits [127:0] of the result, /// and bits [255:128] of \a V1 are copied to bits [255:128] of the /// result. \n /// If bit [0] of \a M is 1, \a V2 are copied to bits [255:128] of the /// result, and bits [127:0] of \a V1 are copied to bits [127:0] of the /// result. /// \returns A 256-bit vector of [4 x double] containing the interleaved values. #define _mm256_insertf128_pd(V1, V2, M) __extension__ ({ \ (__m256d)__builtin_shufflevector( \ (__v4df)(__m256d)(V1), \ (__v4df)_mm256_castpd128_pd256((__m128d)(V2)), \ (((M) & 1) ? 0 : 4), \ (((M) & 1) ? 1 : 5), \ (((M) & 1) ? 4 : 2), \ (((M) & 1) ? 5 : 3) );}) /// \brief Constructs a new 256-bit integer vector by first duplicating a /// 256-bit integer vector given in the first parameter, and then replacing /// either the upper or the lower 128 bits with the contents of a 128-bit /// integer vector in the second parameter. /// /// The immediate integer parameter determines between the upper or the lower /// 128 bits. /// /// \headerfile /// /// \code /// __m256i _mm256_insertf128_si256(__m256i V1, __m128i V2, const int M); /// \endcode /// /// This intrinsic corresponds to the VINSERTF128 instruction. /// /// \param V1 /// A 256-bit integer vector. This vector is copied to the result first, and /// then either the upper or the lower 128 bits of the result will be /// replaced by the contents of \a V2. /// \param V2 /// A 128-bit integer vector. The contents of this parameter are written to /// either the upper or the lower 128 bits of the result depending on the /// value of parameter \a M. /// \param M /// An immediate integer. The least significant bit determines how the values /// from the two parameters are interleaved: \n /// If bit [0] of \a M is 0, \a V2 are copied to bits [127:0] of the result, /// and bits [255:128] of \a V1 are copied to bits [255:128] of the /// result. \n /// If bit [0] of \a M is 1, \a V2 are copied to bits [255:128] of the /// result, and bits [127:0] of \a V1 are copied to bits [127:0] of the /// result. /// \returns A 256-bit integer vector containing the interleaved values. #define _mm256_insertf128_si256(V1, V2, M) __extension__ ({ \ (__m256i)__builtin_shufflevector( \ (__v4di)(__m256i)(V1), \ (__v4di)_mm256_castsi128_si256((__m128i)(V2)), \ (((M) & 1) ? 0 : 4), \ (((M) & 1) ? 1 : 5), \ (((M) & 1) ? 4 : 2), \ (((M) & 1) ? 5 : 3) );}) /* Vector extract. We use macros rather than inlines because we only want to accept invocations where the immediate M is a constant expression. */ /// \brief Extracts either the upper or the lower 128 bits from a 256-bit vector /// of [8 x float], as determined by the immediate integer parameter, and /// returns the extracted bits as a 128-bit vector of [4 x float]. /// /// \headerfile /// /// \code /// __m128 _mm256_extractf128_ps(__m256 V, const int M); /// \endcode /// /// This intrinsic corresponds to the VEXTRACTF128 instruction. /// /// \param V /// A 256-bit vector of [8 x float]. /// \param M /// An immediate integer. The least significant bit determines which bits are /// extracted from the first parameter: \n /// If bit [0] of \a M is 0, bits [127:0] of \a V are copied to the /// result. \n /// If bit [0] of \a M is 1, bits [255:128] of \a V are copied to the result. /// \returns A 128-bit vector of [4 x float] containing the extracted bits. #define _mm256_extractf128_ps(V, M) __extension__ ({ \ (__m128)__builtin_shufflevector( \ (__v8sf)(__m256)(V), \ (__v8sf)(_mm256_undefined_ps()), \ (((M) & 1) ? 4 : 0), \ (((M) & 1) ? 5 : 1), \ (((M) & 1) ? 6 : 2), \ (((M) & 1) ? 7 : 3) );}) /// \brief Extracts either the upper or the lower 128 bits from a 256-bit vector /// of [4 x double], as determined by the immediate integer parameter, and /// returns the extracted bits as a 128-bit vector of [2 x double]. /// /// \headerfile /// /// \code /// __m128d _mm256_extractf128_pd(__m256d V, const int M); /// \endcode /// /// This intrinsic corresponds to the VEXTRACTF128 instruction. /// /// \param V /// A 256-bit vector of [4 x double]. /// \param M /// An immediate integer. The least significant bit determines which bits are /// extracted from the first parameter: \n /// If bit [0] of \a M is 0, bits [127:0] of \a V are copied to the /// result. \n /// If bit [0] of \a M is 1, bits [255:128] of \a V are copied to the result. /// \returns A 128-bit vector of [2 x double] containing the extracted bits. #define _mm256_extractf128_pd(V, M) __extension__ ({ \ (__m128d)__builtin_shufflevector( \ (__v4df)(__m256d)(V), \ (__v4df)(_mm256_undefined_pd()), \ (((M) & 1) ? 2 : 0), \ (((M) & 1) ? 3 : 1) );}) /// \brief Extracts either the upper or the lower 128 bits from a 256-bit /// integer vector, as determined by the immediate integer parameter, and /// returns the extracted bits as a 128-bit integer vector. /// /// \headerfile /// /// \code /// __m128i _mm256_extractf128_si256(__m256i V, const int M); /// \endcode /// /// This intrinsic corresponds to the VEXTRACTF128 instruction. /// /// \param V /// A 256-bit integer vector. /// \param M /// An immediate integer. The least significant bit determines which bits are /// extracted from the first parameter: \n /// If bit [0] of \a M is 0, bits [127:0] of \a V are copied to the /// result. \n /// If bit [0] of \a M is 1, bits [255:128] of \a V are copied to the result. /// \returns A 128-bit integer vector containing the extracted bits. #define _mm256_extractf128_si256(V, M) __extension__ ({ \ (__m128i)__builtin_shufflevector( \ (__v4di)(__m256i)(V), \ (__v4di)(_mm256_undefined_si256()), \ (((M) & 1) ? 2 : 0), \ (((M) & 1) ? 3 : 1) );}) /* SIMD load ops (unaligned) */ /// \brief Loads two 128-bit floating-point vectors of [4 x float] from /// unaligned memory locations and constructs a 256-bit floating-point vector /// of [8 x float] by concatenating the two 128-bit vectors. /// /// \headerfile /// /// This intrinsic corresponds to load instructions followed by the /// VINSERTF128 instruction. /// /// \param __addr_hi /// A pointer to a 128-bit memory location containing 4 consecutive /// single-precision floating-point values. These values are to be copied to /// bits[255:128] of the result. The address of the memory location does not /// have to be aligned. /// \param __addr_lo /// A pointer to a 128-bit memory location containing 4 consecutive /// single-precision floating-point values. These values are to be copied to /// bits[127:0] of the result. The address of the memory location does not /// have to be aligned. /// \returns A 256-bit floating-point vector of [8 x float] containing the /// concatenated result. static __inline __m256 __DEFAULT_FN_ATTRS _mm256_loadu2_m128(float const *__addr_hi, float const *__addr_lo) { __m256 __v256 = _mm256_castps128_ps256(_mm_loadu_ps(__addr_lo)); return _mm256_insertf128_ps(__v256, _mm_loadu_ps(__addr_hi), 1); } /// \brief Loads two 128-bit floating-point vectors of [2 x double] from /// unaligned memory locations and constructs a 256-bit floating-point vector /// of [4 x double] by concatenating the two 128-bit vectors. /// /// \headerfile /// /// This intrinsic corresponds to load instructions followed by the /// VINSERTF128 instruction. /// /// \param __addr_hi /// A pointer to a 128-bit memory location containing two consecutive /// double-precision floating-point values. These values are to be copied to /// bits[255:128] of the result. The address of the memory location does not /// have to be aligned. /// \param __addr_lo /// A pointer to a 128-bit memory location containing two consecutive /// double-precision floating-point values. These values are to be copied to /// bits[127:0] of the result. The address of the memory location does not /// have to be aligned. /// \returns A 256-bit floating-point vector of [4 x double] containing the /// concatenated result. static __inline __m256d __DEFAULT_FN_ATTRS _mm256_loadu2_m128d(double const *__addr_hi, double const *__addr_lo) { __m256d __v256 = _mm256_castpd128_pd256(_mm_loadu_pd(__addr_lo)); return _mm256_insertf128_pd(__v256, _mm_loadu_pd(__addr_hi), 1); } /// \brief Loads two 128-bit integer vectors from unaligned memory locations and /// constructs a 256-bit integer vector by concatenating the two 128-bit /// vectors. /// /// \headerfile /// /// This intrinsic corresponds to load instructions followed by the /// VINSERTF128 instruction. /// /// \param __addr_hi /// A pointer to a 128-bit memory location containing a 128-bit integer /// vector. This vector is to be copied to bits[255:128] of the result. The /// address of the memory location does not have to be aligned. /// \param __addr_lo /// A pointer to a 128-bit memory location containing a 128-bit integer /// vector. This vector is to be copied to bits[127:0] of the result. The /// address of the memory location does not have to be aligned. /// \returns A 256-bit integer vector containing the concatenated result. static __inline __m256i __DEFAULT_FN_ATTRS _mm256_loadu2_m128i(__m128i const *__addr_hi, __m128i const *__addr_lo) { __m256i __v256 = _mm256_castsi128_si256(_mm_loadu_si128(__addr_lo)); return _mm256_insertf128_si256(__v256, _mm_loadu_si128(__addr_hi), 1); } /* SIMD store ops (unaligned) */ /// \brief Stores the upper and lower 128 bits of a 256-bit floating-point /// vector of [8 x float] into two different unaligned memory locations. /// /// \headerfile /// /// This intrinsic corresponds to the VEXTRACTF128 instruction and the /// store instructions. /// /// \param __addr_hi /// A pointer to a 128-bit memory location. Bits[255:128] of \a __a are to be /// copied to this memory location. The address of this memory location does /// not have to be aligned. /// \param __addr_lo /// A pointer to a 128-bit memory location. Bits[127:0] of \a __a are to be /// copied to this memory location. The address of this memory location does /// not have to be aligned. /// \param __a /// A 256-bit floating-point vector of [8 x float]. static __inline void __DEFAULT_FN_ATTRS _mm256_storeu2_m128(float *__addr_hi, float *__addr_lo, __m256 __a) { __m128 __v128; __v128 = _mm256_castps256_ps128(__a); _mm_storeu_ps(__addr_lo, __v128); __v128 = _mm256_extractf128_ps(__a, 1); _mm_storeu_ps(__addr_hi, __v128); } /// \brief Stores the upper and lower 128 bits of a 256-bit floating-point /// vector of [4 x double] into two different unaligned memory locations. /// /// \headerfile /// /// This intrinsic corresponds to the VEXTRACTF128 instruction and the /// store instructions. /// /// \param __addr_hi /// A pointer to a 128-bit memory location. Bits[255:128] of \a __a are to be /// copied to this memory location. The address of this memory location does /// not have to be aligned. /// \param __addr_lo /// A pointer to a 128-bit memory location. Bits[127:0] of \a __a are to be /// copied to this memory location. The address of this memory location does /// not have to be aligned. /// \param __a /// A 256-bit floating-point vector of [4 x double]. static __inline void __DEFAULT_FN_ATTRS _mm256_storeu2_m128d(double *__addr_hi, double *__addr_lo, __m256d __a) { __m128d __v128; __v128 = _mm256_castpd256_pd128(__a); _mm_storeu_pd(__addr_lo, __v128); __v128 = _mm256_extractf128_pd(__a, 1); _mm_storeu_pd(__addr_hi, __v128); } /// \brief Stores the upper and lower 128 bits of a 256-bit integer vector into /// two different unaligned memory locations. /// /// \headerfile /// /// This intrinsic corresponds to the VEXTRACTF128 instruction and the /// store instructions. /// /// \param __addr_hi /// A pointer to a 128-bit memory location. Bits[255:128] of \a __a are to be /// copied to this memory location. The address of this memory location does /// not have to be aligned. /// \param __addr_lo /// A pointer to a 128-bit memory location. Bits[127:0] of \a __a are to be /// copied to this memory location. The address of this memory location does /// not have to be aligned. /// \param __a /// A 256-bit integer vector. static __inline void __DEFAULT_FN_ATTRS _mm256_storeu2_m128i(__m128i *__addr_hi, __m128i *__addr_lo, __m256i __a) { __m128i __v128; __v128 = _mm256_castsi256_si128(__a); _mm_storeu_si128(__addr_lo, __v128); __v128 = _mm256_extractf128_si256(__a, 1); _mm_storeu_si128(__addr_hi, __v128); } /// \brief Constructs a 256-bit floating-point vector of [8 x float] by /// concatenating two 128-bit floating-point vectors of [4 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VINSERTF128 instruction. /// /// \param __hi /// A 128-bit floating-point vector of [4 x float] to be copied to the upper /// 128 bits of the result. /// \param __lo /// A 128-bit floating-point vector of [4 x float] to be copied to the lower /// 128 bits of the result. /// \returns A 256-bit floating-point vector of [8 x float] containing the /// concatenated result. static __inline __m256 __DEFAULT_FN_ATTRS _mm256_set_m128 (__m128 __hi, __m128 __lo) { return (__m256) __builtin_shufflevector((__v4sf)__lo, (__v4sf)__hi, 0, 1, 2, 3, 4, 5, 6, 7); } /// \brief Constructs a 256-bit floating-point vector of [4 x double] by /// concatenating two 128-bit floating-point vectors of [2 x double]. /// /// \headerfile /// /// This intrinsic corresponds to the VINSERTF128 instruction. /// /// \param __hi /// A 128-bit floating-point vector of [2 x double] to be copied to the upper /// 128 bits of the result. /// \param __lo /// A 128-bit floating-point vector of [2 x double] to be copied to the lower /// 128 bits of the result. /// \returns A 256-bit floating-point vector of [4 x double] containing the /// concatenated result. static __inline __m256d __DEFAULT_FN_ATTRS _mm256_set_m128d (__m128d __hi, __m128d __lo) { return (__m256d)_mm256_set_m128((__m128)__hi, (__m128)__lo); } /// \brief Constructs a 256-bit integer vector by concatenating two 128-bit /// integer vectors. /// /// \headerfile /// /// This intrinsic corresponds to the VINSERTF128 instruction. /// /// \param __hi /// A 128-bit integer vector to be copied to the upper 128 bits of the /// result. /// \param __lo /// A 128-bit integer vector to be copied to the lower 128 bits of the /// result. /// \returns A 256-bit integer vector containing the concatenated result. static __inline __m256i __DEFAULT_FN_ATTRS _mm256_set_m128i (__m128i __hi, __m128i __lo) { return (__m256i)_mm256_set_m128((__m128)__hi, (__m128)__lo); } /// \brief Constructs a 256-bit floating-point vector of [8 x float] by /// concatenating two 128-bit floating-point vectors of [4 x float]. This is /// similar to _mm256_set_m128, but the order of the input parameters is /// swapped. /// /// \headerfile /// /// This intrinsic corresponds to the VINSERTF128 instruction. /// /// \param __lo /// A 128-bit floating-point vector of [4 x float] to be copied to the lower /// 128 bits of the result. /// \param __hi /// A 128-bit floating-point vector of [4 x float] to be copied to the upper /// 128 bits of the result. /// \returns A 256-bit floating-point vector of [8 x float] containing the /// concatenated result. static __inline __m256 __DEFAULT_FN_ATTRS _mm256_setr_m128 (__m128 __lo, __m128 __hi) { return _mm256_set_m128(__hi, __lo); } /// \brief Constructs a 256-bit floating-point vector of [4 x double] by /// concatenating two 128-bit floating-point vectors of [2 x double]. This is /// similar to _mm256_set_m128d, but the order of the input parameters is /// swapped. /// /// \headerfile /// /// This intrinsic corresponds to the VINSERTF128 instruction. /// /// \param __lo /// A 128-bit floating-point vector of [2 x double] to be copied to the lower /// 128 bits of the result. /// \param __hi /// A 128-bit floating-point vector of [2 x double] to be copied to the upper /// 128 bits of the result. /// \returns A 256-bit floating-point vector of [4 x double] containing the /// concatenated result. static __inline __m256d __DEFAULT_FN_ATTRS _mm256_setr_m128d (__m128d __lo, __m128d __hi) { return (__m256d)_mm256_set_m128((__m128)__hi, (__m128)__lo); } /// \brief Constructs a 256-bit integer vector by concatenating two 128-bit /// integer vectors. This is similar to _mm256_set_m128i, but the order of /// the input parameters is swapped. /// /// \headerfile /// /// This intrinsic corresponds to the VINSERTF128 instruction. /// /// \param __lo /// A 128-bit integer vector to be copied to the lower 128 bits of the /// result. /// \param __hi /// A 128-bit integer vector to be copied to the upper 128 bits of the /// result. /// \returns A 256-bit integer vector containing the concatenated result. static __inline __m256i __DEFAULT_FN_ATTRS _mm256_setr_m128i (__m128i __lo, __m128i __hi) { return (__m256i)_mm256_set_m128((__m128)__hi, (__m128)__lo); } #undef __DEFAULT_FN_ATTRS #endif /* __AVXINTRIN_H */ # 5163 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avxintrin.h" 3 # 67 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 2 3 #endif # 68 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || defined(__AVX2__) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 70 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx2intrin.h" 1 3 /*===---- avx2intrin.h - AVX2 intrinsics -----------------------------------=== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __IMMINTRIN_H #error "Never use directly; include instead." #endif # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx2intrin.h" 3 #ifndef __AVX2INTRIN_H #define __AVX2INTRIN_H /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("avx2"))) /* SSE4 Multiple Packed Sums of Absolute Difference. */ #define _mm256_mpsadbw_epu8(X, Y, M) \ (__m256i)__builtin_ia32_mpsadbw256((__v32qi)(__m256i)(X), \ (__v32qi)(__m256i)(Y), (int)(M)) static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_abs_epi8(__m256i __a) { return (__m256i)__builtin_ia32_pabsb256((__v32qi)__a); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_abs_epi16(__m256i __a) { return (__m256i)__builtin_ia32_pabsw256((__v16hi)__a); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_abs_epi32(__m256i __a) { return (__m256i)__builtin_ia32_pabsd256((__v8si)__a); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_packs_epi16(__m256i __a, __m256i __b) { return (__m256i)__builtin_ia32_packsswb256((__v16hi)__a, (__v16hi)__b); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_packs_epi32(__m256i __a, __m256i __b) { return (__m256i)__builtin_ia32_packssdw256((__v8si)__a, (__v8si)__b); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_packus_epi16(__m256i __a, __m256i __b) { return (__m256i)__builtin_ia32_packuswb256((__v16hi)__a, (__v16hi)__b); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_packus_epi32(__m256i __V1, __m256i __V2) { return (__m256i) __builtin_ia32_packusdw256((__v8si)__V1, (__v8si)__V2); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_add_epi8(__m256i __a, __m256i __b) { return (__m256i)((__v32qu)__a + (__v32qu)__b); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_add_epi16(__m256i __a, __m256i __b) { return (__m256i)((__v16hu)__a + (__v16hu)__b); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_add_epi32(__m256i __a, __m256i __b) { return (__m256i)((__v8su)__a + (__v8su)__b); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_add_epi64(__m256i __a, __m256i __b) { return (__m256i)((__v4du)__a + (__v4du)__b); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_adds_epi8(__m256i __a, __m256i __b) { return (__m256i)__builtin_ia32_paddsb256((__v32qi)__a, (__v32qi)__b); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_adds_epi16(__m256i __a, __m256i __b) { return (__m256i)__builtin_ia32_paddsw256((__v16hi)__a, (__v16hi)__b); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_adds_epu8(__m256i __a, __m256i __b) { return (__m256i)__builtin_ia32_paddusb256((__v32qi)__a, (__v32qi)__b); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_adds_epu16(__m256i __a, __m256i __b) { return (__m256i)__builtin_ia32_paddusw256((__v16hi)__a, (__v16hi)__b); } #define _mm256_alignr_epi8(a, b, n) __extension__ ({ \ (__m256i)__builtin_ia32_palignr256((__v32qi)(__m256i)(a), \ (__v32qi)(__m256i)(b), (n)); }) static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_and_si256(__m256i __a, __m256i __b) { return (__m256i)((__v4du)__a & (__v4du)__b); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_andnot_si256(__m256i __a, __m256i __b) { return (__m256i)(~(__v4du)__a & (__v4du)__b); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_avg_epu8(__m256i __a, __m256i __b) { typedef unsigned short __v32hu __attribute__((__vector_size__(64))); return (__m256i)__builtin_convertvector( ((__builtin_convertvector((__v32qu)__a, __v32hu) + __builtin_convertvector((__v32qu)__b, __v32hu)) + 1) >> 1, __v32qu); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_avg_epu16(__m256i __a, __m256i __b) { typedef unsigned int __v16su __attribute__((__vector_size__(64))); return (__m256i)__builtin_convertvector( ((__builtin_convertvector((__v16hu)__a, __v16su) + __builtin_convertvector((__v16hu)__b, __v16su)) + 1) >> 1, __v16hu); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_blendv_epi8(__m256i __V1, __m256i __V2, __m256i __M) { return (__m256i)__builtin_ia32_pblendvb256((__v32qi)__V1, (__v32qi)__V2, (__v32qi)__M); } #define _mm256_blend_epi16(V1, V2, M) __extension__ ({ \ (__m256i)__builtin_shufflevector((__v16hi)(__m256i)(V1), \ (__v16hi)(__m256i)(V2), \ (((M) & 0x01) ? 16 : 0), \ (((M) & 0x02) ? 17 : 1), \ (((M) & 0x04) ? 18 : 2), \ (((M) & 0x08) ? 19 : 3), \ (((M) & 0x10) ? 20 : 4), \ (((M) & 0x20) ? 21 : 5), \ (((M) & 0x40) ? 22 : 6), \ (((M) & 0x80) ? 23 : 7), \ (((M) & 0x01) ? 24 : 8), \ (((M) & 0x02) ? 25 : 9), \ (((M) & 0x04) ? 26 : 10), \ (((M) & 0x08) ? 27 : 11), \ (((M) & 0x10) ? 28 : 12), \ (((M) & 0x20) ? 29 : 13), \ (((M) & 0x40) ? 30 : 14), \ (((M) & 0x80) ? 31 : 15)); }) static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_cmpeq_epi8(__m256i __a, __m256i __b) { return (__m256i)((__v32qi)__a == (__v32qi)__b); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_cmpeq_epi16(__m256i __a, __m256i __b) { return (__m256i)((__v16hi)__a == (__v16hi)__b); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_cmpeq_epi32(__m256i __a, __m256i __b) { return (__m256i)((__v8si)__a == (__v8si)__b); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_cmpeq_epi64(__m256i __a, __m256i __b) { return (__m256i)((__v4di)__a == (__v4di)__b); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_cmpgt_epi8(__m256i __a, __m256i __b) { /* This function always performs a signed comparison, but __v32qi is a char which may be signed or unsigned, so use __v32qs. */ return (__m256i)((__v32qs)__a > (__v32qs)__b); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_cmpgt_epi16(__m256i __a, __m256i __b) { return (__m256i)((__v16hi)__a > (__v16hi)__b); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_cmpgt_epi32(__m256i __a, __m256i __b) { return (__m256i)((__v8si)__a > (__v8si)__b); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_cmpgt_epi64(__m256i __a, __m256i __b) { return (__m256i)((__v4di)__a > (__v4di)__b); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_hadd_epi16(__m256i __a, __m256i __b) { return (__m256i)__builtin_ia32_phaddw256((__v16hi)__a, (__v16hi)__b); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_hadd_epi32(__m256i __a, __m256i __b) { return (__m256i)__builtin_ia32_phaddd256((__v8si)__a, (__v8si)__b); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_hadds_epi16(__m256i __a, __m256i __b) { return (__m256i)__builtin_ia32_phaddsw256((__v16hi)__a, (__v16hi)__b); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_hsub_epi16(__m256i __a, __m256i __b) { return (__m256i)__builtin_ia32_phsubw256((__v16hi)__a, (__v16hi)__b); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_hsub_epi32(__m256i __a, __m256i __b) { return (__m256i)__builtin_ia32_phsubd256((__v8si)__a, (__v8si)__b); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_hsubs_epi16(__m256i __a, __m256i __b) { return (__m256i)__builtin_ia32_phsubsw256((__v16hi)__a, (__v16hi)__b); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maddubs_epi16(__m256i __a, __m256i __b) { return (__m256i)__builtin_ia32_pmaddubsw256((__v32qi)__a, (__v32qi)__b); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_madd_epi16(__m256i __a, __m256i __b) { return (__m256i)__builtin_ia32_pmaddwd256((__v16hi)__a, (__v16hi)__b); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_max_epi8(__m256i __a, __m256i __b) { return (__m256i)__builtin_ia32_pmaxsb256((__v32qi)__a, (__v32qi)__b); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_max_epi16(__m256i __a, __m256i __b) { return (__m256i)__builtin_ia32_pmaxsw256((__v16hi)__a, (__v16hi)__b); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_max_epi32(__m256i __a, __m256i __b) { return (__m256i)__builtin_ia32_pmaxsd256((__v8si)__a, (__v8si)__b); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_max_epu8(__m256i __a, __m256i __b) { return (__m256i)__builtin_ia32_pmaxub256((__v32qi)__a, (__v32qi)__b); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_max_epu16(__m256i __a, __m256i __b) { return (__m256i)__builtin_ia32_pmaxuw256((__v16hi)__a, (__v16hi)__b); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_max_epu32(__m256i __a, __m256i __b) { return (__m256i)__builtin_ia32_pmaxud256((__v8si)__a, (__v8si)__b); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_min_epi8(__m256i __a, __m256i __b) { return (__m256i)__builtin_ia32_pminsb256((__v32qi)__a, (__v32qi)__b); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_min_epi16(__m256i __a, __m256i __b) { return (__m256i)__builtin_ia32_pminsw256((__v16hi)__a, (__v16hi)__b); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_min_epi32(__m256i __a, __m256i __b) { return (__m256i)__builtin_ia32_pminsd256((__v8si)__a, (__v8si)__b); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_min_epu8(__m256i __a, __m256i __b) { return (__m256i)__builtin_ia32_pminub256((__v32qi)__a, (__v32qi)__b); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_min_epu16(__m256i __a, __m256i __b) { return (__m256i)__builtin_ia32_pminuw256 ((__v16hi)__a, (__v16hi)__b); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_min_epu32(__m256i __a, __m256i __b) { return (__m256i)__builtin_ia32_pminud256((__v8si)__a, (__v8si)__b); } static __inline__ int __DEFAULT_FN_ATTRS _mm256_movemask_epi8(__m256i __a) { return __builtin_ia32_pmovmskb256((__v32qi)__a); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_cvtepi8_epi16(__m128i __V) { /* This function always performs a signed extension, but __v16qi is a char which may be signed or unsigned, so use __v16qs. */ return (__m256i)__builtin_convertvector((__v16qs)__V, __v16hi); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_cvtepi8_epi32(__m128i __V) { /* This function always performs a signed extension, but __v16qi is a char which may be signed or unsigned, so use __v16qs. */ return (__m256i)__builtin_convertvector(__builtin_shufflevector((__v16qs)__V, (__v16qs)__V, 0, 1, 2, 3, 4, 5, 6, 7), __v8si); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_cvtepi8_epi64(__m128i __V) { /* This function always performs a signed extension, but __v16qi is a char which may be signed or unsigned, so use __v16qs. */ return (__m256i)__builtin_convertvector(__builtin_shufflevector((__v16qs)__V, (__v16qs)__V, 0, 1, 2, 3), __v4di); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_cvtepi16_epi32(__m128i __V) { return (__m256i)__builtin_convertvector((__v8hi)__V, __v8si); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_cvtepi16_epi64(__m128i __V) { return (__m256i)__builtin_convertvector(__builtin_shufflevector((__v8hi)__V, (__v8hi)__V, 0, 1, 2, 3), __v4di); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_cvtepi32_epi64(__m128i __V) { return (__m256i)__builtin_convertvector((__v4si)__V, __v4di); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_cvtepu8_epi16(__m128i __V) { return (__m256i)__builtin_convertvector((__v16qu)__V, __v16hi); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_cvtepu8_epi32(__m128i __V) { return (__m256i)__builtin_convertvector(__builtin_shufflevector((__v16qu)__V, (__v16qu)__V, 0, 1, 2, 3, 4, 5, 6, 7), __v8si); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_cvtepu8_epi64(__m128i __V) { return (__m256i)__builtin_convertvector(__builtin_shufflevector((__v16qu)__V, (__v16qu)__V, 0, 1, 2, 3), __v4di); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_cvtepu16_epi32(__m128i __V) { return (__m256i)__builtin_convertvector((__v8hu)__V, __v8si); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_cvtepu16_epi64(__m128i __V) { return (__m256i)__builtin_convertvector(__builtin_shufflevector((__v8hu)__V, (__v8hu)__V, 0, 1, 2, 3), __v4di); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_cvtepu32_epi64(__m128i __V) { return (__m256i)__builtin_convertvector((__v4su)__V, __v4di); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mul_epi32(__m256i __a, __m256i __b) { return (__m256i)__builtin_ia32_pmuldq256((__v8si)__a, (__v8si)__b); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mulhrs_epi16(__m256i __a, __m256i __b) { return (__m256i)__builtin_ia32_pmulhrsw256((__v16hi)__a, (__v16hi)__b); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mulhi_epu16(__m256i __a, __m256i __b) { return (__m256i)__builtin_ia32_pmulhuw256((__v16hi)__a, (__v16hi)__b); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mulhi_epi16(__m256i __a, __m256i __b) { return (__m256i)__builtin_ia32_pmulhw256((__v16hi)__a, (__v16hi)__b); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mullo_epi16(__m256i __a, __m256i __b) { return (__m256i)((__v16hu)__a * (__v16hu)__b); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mullo_epi32 (__m256i __a, __m256i __b) { return (__m256i)((__v8su)__a * (__v8su)__b); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mul_epu32(__m256i __a, __m256i __b) { return __builtin_ia32_pmuludq256((__v8si)__a, (__v8si)__b); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_or_si256(__m256i __a, __m256i __b) { return (__m256i)((__v4du)__a | (__v4du)__b); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_sad_epu8(__m256i __a, __m256i __b) { return __builtin_ia32_psadbw256((__v32qi)__a, (__v32qi)__b); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_shuffle_epi8(__m256i __a, __m256i __b) { return (__m256i)__builtin_ia32_pshufb256((__v32qi)__a, (__v32qi)__b); } #define _mm256_shuffle_epi32(a, imm) __extension__ ({ \ (__m256i)__builtin_shufflevector((__v8si)(__m256i)(a), \ (__v8si)_mm256_undefined_si256(), \ 0 + (((imm) >> 0) & 0x3), \ 0 + (((imm) >> 2) & 0x3), \ 0 + (((imm) >> 4) & 0x3), \ 0 + (((imm) >> 6) & 0x3), \ 4 + (((imm) >> 0) & 0x3), \ 4 + (((imm) >> 2) & 0x3), \ 4 + (((imm) >> 4) & 0x3), \ 4 + (((imm) >> 6) & 0x3)); }) #define _mm256_shufflehi_epi16(a, imm) __extension__ ({ \ (__m256i)__builtin_shufflevector((__v16hi)(__m256i)(a), \ (__v16hi)_mm256_undefined_si256(), \ 0, 1, 2, 3, \ 4 + (((imm) >> 0) & 0x3), \ 4 + (((imm) >> 2) & 0x3), \ 4 + (((imm) >> 4) & 0x3), \ 4 + (((imm) >> 6) & 0x3), \ 8, 9, 10, 11, \ 12 + (((imm) >> 0) & 0x3), \ 12 + (((imm) >> 2) & 0x3), \ 12 + (((imm) >> 4) & 0x3), \ 12 + (((imm) >> 6) & 0x3)); }) #define _mm256_shufflelo_epi16(a, imm) __extension__ ({ \ (__m256i)__builtin_shufflevector((__v16hi)(__m256i)(a), \ (__v16hi)_mm256_undefined_si256(), \ 0 + (((imm) >> 0) & 0x3), \ 0 + (((imm) >> 2) & 0x3), \ 0 + (((imm) >> 4) & 0x3), \ 0 + (((imm) >> 6) & 0x3), \ 4, 5, 6, 7, \ 8 + (((imm) >> 0) & 0x3), \ 8 + (((imm) >> 2) & 0x3), \ 8 + (((imm) >> 4) & 0x3), \ 8 + (((imm) >> 6) & 0x3), \ 12, 13, 14, 15); }) static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_sign_epi8(__m256i __a, __m256i __b) { return (__m256i)__builtin_ia32_psignb256((__v32qi)__a, (__v32qi)__b); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_sign_epi16(__m256i __a, __m256i __b) { return (__m256i)__builtin_ia32_psignw256((__v16hi)__a, (__v16hi)__b); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_sign_epi32(__m256i __a, __m256i __b) { return (__m256i)__builtin_ia32_psignd256((__v8si)__a, (__v8si)__b); } #define _mm256_slli_si256(a, imm) __extension__ ({ \ (__m256i)__builtin_shufflevector( \ (__v32qi)_mm256_setzero_si256(), \ (__v32qi)(__m256i)(a), \ ((char)(imm)&0xF0) ? 0 : ((char)(imm)>0x0 ? 16 : 32) - (char)(imm), \ ((char)(imm)&0xF0) ? 1 : ((char)(imm)>0x1 ? 17 : 33) - (char)(imm), \ ((char)(imm)&0xF0) ? 2 : ((char)(imm)>0x2 ? 18 : 34) - (char)(imm), \ ((char)(imm)&0xF0) ? 3 : ((char)(imm)>0x3 ? 19 : 35) - (char)(imm), \ ((char)(imm)&0xF0) ? 4 : ((char)(imm)>0x4 ? 20 : 36) - (char)(imm), \ ((char)(imm)&0xF0) ? 5 : ((char)(imm)>0x5 ? 21 : 37) - (char)(imm), \ ((char)(imm)&0xF0) ? 6 : ((char)(imm)>0x6 ? 22 : 38) - (char)(imm), \ ((char)(imm)&0xF0) ? 7 : ((char)(imm)>0x7 ? 23 : 39) - (char)(imm), \ ((char)(imm)&0xF0) ? 8 : ((char)(imm)>0x8 ? 24 : 40) - (char)(imm), \ ((char)(imm)&0xF0) ? 9 : ((char)(imm)>0x9 ? 25 : 41) - (char)(imm), \ ((char)(imm)&0xF0) ? 10 : ((char)(imm)>0xA ? 26 : 42) - (char)(imm), \ ((char)(imm)&0xF0) ? 11 : ((char)(imm)>0xB ? 27 : 43) - (char)(imm), \ ((char)(imm)&0xF0) ? 12 : ((char)(imm)>0xC ? 28 : 44) - (char)(imm), \ ((char)(imm)&0xF0) ? 13 : ((char)(imm)>0xD ? 29 : 45) - (char)(imm), \ ((char)(imm)&0xF0) ? 14 : ((char)(imm)>0xE ? 30 : 46) - (char)(imm), \ ((char)(imm)&0xF0) ? 15 : ((char)(imm)>0xF ? 31 : 47) - (char)(imm), \ ((char)(imm)&0xF0) ? 16 : ((char)(imm)>0x0 ? 32 : 48) - (char)(imm), \ ((char)(imm)&0xF0) ? 17 : ((char)(imm)>0x1 ? 33 : 49) - (char)(imm), \ ((char)(imm)&0xF0) ? 18 : ((char)(imm)>0x2 ? 34 : 50) - (char)(imm), \ ((char)(imm)&0xF0) ? 19 : ((char)(imm)>0x3 ? 35 : 51) - (char)(imm), \ ((char)(imm)&0xF0) ? 20 : ((char)(imm)>0x4 ? 36 : 52) - (char)(imm), \ ((char)(imm)&0xF0) ? 21 : ((char)(imm)>0x5 ? 37 : 53) - (char)(imm), \ ((char)(imm)&0xF0) ? 22 : ((char)(imm)>0x6 ? 38 : 54) - (char)(imm), \ ((char)(imm)&0xF0) ? 23 : ((char)(imm)>0x7 ? 39 : 55) - (char)(imm), \ ((char)(imm)&0xF0) ? 24 : ((char)(imm)>0x8 ? 40 : 56) - (char)(imm), \ ((char)(imm)&0xF0) ? 25 : ((char)(imm)>0x9 ? 41 : 57) - (char)(imm), \ ((char)(imm)&0xF0) ? 26 : ((char)(imm)>0xA ? 42 : 58) - (char)(imm), \ ((char)(imm)&0xF0) ? 27 : ((char)(imm)>0xB ? 43 : 59) - (char)(imm), \ ((char)(imm)&0xF0) ? 28 : ((char)(imm)>0xC ? 44 : 60) - (char)(imm), \ ((char)(imm)&0xF0) ? 29 : ((char)(imm)>0xD ? 45 : 61) - (char)(imm), \ ((char)(imm)&0xF0) ? 30 : ((char)(imm)>0xE ? 46 : 62) - (char)(imm), \ ((char)(imm)&0xF0) ? 31 : ((char)(imm)>0xF ? 47 : 63) - (char)(imm)); }) #define _mm256_bslli_epi128(a, count) _mm256_slli_si256((a), (count)) static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_slli_epi16(__m256i __a, int __count) { return (__m256i)__builtin_ia32_psllwi256((__v16hi)__a, __count); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_sll_epi16(__m256i __a, __m128i __count) { return (__m256i)__builtin_ia32_psllw256((__v16hi)__a, (__v8hi)__count); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_slli_epi32(__m256i __a, int __count) { return (__m256i)__builtin_ia32_pslldi256((__v8si)__a, __count); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_sll_epi32(__m256i __a, __m128i __count) { return (__m256i)__builtin_ia32_pslld256((__v8si)__a, (__v4si)__count); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_slli_epi64(__m256i __a, int __count) { return __builtin_ia32_psllqi256((__v4di)__a, __count); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_sll_epi64(__m256i __a, __m128i __count) { return __builtin_ia32_psllq256((__v4di)__a, __count); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_srai_epi16(__m256i __a, int __count) { return (__m256i)__builtin_ia32_psrawi256((__v16hi)__a, __count); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_sra_epi16(__m256i __a, __m128i __count) { return (__m256i)__builtin_ia32_psraw256((__v16hi)__a, (__v8hi)__count); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_srai_epi32(__m256i __a, int __count) { return (__m256i)__builtin_ia32_psradi256((__v8si)__a, __count); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_sra_epi32(__m256i __a, __m128i __count) { return (__m256i)__builtin_ia32_psrad256((__v8si)__a, (__v4si)__count); } #define _mm256_srli_si256(a, imm) __extension__ ({ \ (__m256i)__builtin_shufflevector( \ (__v32qi)(__m256i)(a), \ (__v32qi)_mm256_setzero_si256(), \ ((char)(imm)&0xF0) ? 32 : (char)(imm) + ((char)(imm)>0xF ? 16 : 0), \ ((char)(imm)&0xF0) ? 33 : (char)(imm) + ((char)(imm)>0xE ? 17 : 1), \ ((char)(imm)&0xF0) ? 34 : (char)(imm) + ((char)(imm)>0xD ? 18 : 2), \ ((char)(imm)&0xF0) ? 35 : (char)(imm) + ((char)(imm)>0xC ? 19 : 3), \ ((char)(imm)&0xF0) ? 36 : (char)(imm) + ((char)(imm)>0xB ? 20 : 4), \ ((char)(imm)&0xF0) ? 37 : (char)(imm) + ((char)(imm)>0xA ? 21 : 5), \ ((char)(imm)&0xF0) ? 38 : (char)(imm) + ((char)(imm)>0x9 ? 22 : 6), \ ((char)(imm)&0xF0) ? 39 : (char)(imm) + ((char)(imm)>0x8 ? 23 : 7), \ ((char)(imm)&0xF0) ? 40 : (char)(imm) + ((char)(imm)>0x7 ? 24 : 8), \ ((char)(imm)&0xF0) ? 41 : (char)(imm) + ((char)(imm)>0x6 ? 25 : 9), \ ((char)(imm)&0xF0) ? 42 : (char)(imm) + ((char)(imm)>0x5 ? 26 : 10), \ ((char)(imm)&0xF0) ? 43 : (char)(imm) + ((char)(imm)>0x4 ? 27 : 11), \ ((char)(imm)&0xF0) ? 44 : (char)(imm) + ((char)(imm)>0x3 ? 28 : 12), \ ((char)(imm)&0xF0) ? 45 : (char)(imm) + ((char)(imm)>0x2 ? 29 : 13), \ ((char)(imm)&0xF0) ? 46 : (char)(imm) + ((char)(imm)>0x1 ? 30 : 14), \ ((char)(imm)&0xF0) ? 47 : (char)(imm) + ((char)(imm)>0x0 ? 31 : 15), \ ((char)(imm)&0xF0) ? 48 : (char)(imm) + ((char)(imm)>0xF ? 32 : 16), \ ((char)(imm)&0xF0) ? 49 : (char)(imm) + ((char)(imm)>0xE ? 33 : 17), \ ((char)(imm)&0xF0) ? 50 : (char)(imm) + ((char)(imm)>0xD ? 34 : 18), \ ((char)(imm)&0xF0) ? 51 : (char)(imm) + ((char)(imm)>0xC ? 35 : 19), \ ((char)(imm)&0xF0) ? 52 : (char)(imm) + ((char)(imm)>0xB ? 36 : 20), \ ((char)(imm)&0xF0) ? 53 : (char)(imm) + ((char)(imm)>0xA ? 37 : 21), \ ((char)(imm)&0xF0) ? 54 : (char)(imm) + ((char)(imm)>0x9 ? 38 : 22), \ ((char)(imm)&0xF0) ? 55 : (char)(imm) + ((char)(imm)>0x8 ? 39 : 23), \ ((char)(imm)&0xF0) ? 56 : (char)(imm) + ((char)(imm)>0x7 ? 40 : 24), \ ((char)(imm)&0xF0) ? 57 : (char)(imm) + ((char)(imm)>0x6 ? 41 : 25), \ ((char)(imm)&0xF0) ? 58 : (char)(imm) + ((char)(imm)>0x5 ? 42 : 26), \ ((char)(imm)&0xF0) ? 59 : (char)(imm) + ((char)(imm)>0x4 ? 43 : 27), \ ((char)(imm)&0xF0) ? 60 : (char)(imm) + ((char)(imm)>0x3 ? 44 : 28), \ ((char)(imm)&0xF0) ? 61 : (char)(imm) + ((char)(imm)>0x2 ? 45 : 29), \ ((char)(imm)&0xF0) ? 62 : (char)(imm) + ((char)(imm)>0x1 ? 46 : 30), \ ((char)(imm)&0xF0) ? 63 : (char)(imm) + ((char)(imm)>0x0 ? 47 : 31)); }) #define _mm256_bsrli_epi128(a, count) _mm256_srli_si256((a), (count)) static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_srli_epi16(__m256i __a, int __count) { return (__m256i)__builtin_ia32_psrlwi256((__v16hi)__a, __count); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_srl_epi16(__m256i __a, __m128i __count) { return (__m256i)__builtin_ia32_psrlw256((__v16hi)__a, (__v8hi)__count); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_srli_epi32(__m256i __a, int __count) { return (__m256i)__builtin_ia32_psrldi256((__v8si)__a, __count); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_srl_epi32(__m256i __a, __m128i __count) { return (__m256i)__builtin_ia32_psrld256((__v8si)__a, (__v4si)__count); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_srli_epi64(__m256i __a, int __count) { return __builtin_ia32_psrlqi256((__v4di)__a, __count); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_srl_epi64(__m256i __a, __m128i __count) { return __builtin_ia32_psrlq256((__v4di)__a, __count); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_sub_epi8(__m256i __a, __m256i __b) { return (__m256i)((__v32qu)__a - (__v32qu)__b); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_sub_epi16(__m256i __a, __m256i __b) { return (__m256i)((__v16hu)__a - (__v16hu)__b); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_sub_epi32(__m256i __a, __m256i __b) { return (__m256i)((__v8su)__a - (__v8su)__b); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_sub_epi64(__m256i __a, __m256i __b) { return (__m256i)((__v4du)__a - (__v4du)__b); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_subs_epi8(__m256i __a, __m256i __b) { return (__m256i)__builtin_ia32_psubsb256((__v32qi)__a, (__v32qi)__b); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_subs_epi16(__m256i __a, __m256i __b) { return (__m256i)__builtin_ia32_psubsw256((__v16hi)__a, (__v16hi)__b); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_subs_epu8(__m256i __a, __m256i __b) { return (__m256i)__builtin_ia32_psubusb256((__v32qi)__a, (__v32qi)__b); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_subs_epu16(__m256i __a, __m256i __b) { return (__m256i)__builtin_ia32_psubusw256((__v16hi)__a, (__v16hi)__b); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_unpackhi_epi8(__m256i __a, __m256i __b) { return (__m256i)__builtin_shufflevector((__v32qi)__a, (__v32qi)__b, 8, 32+8, 9, 32+9, 10, 32+10, 11, 32+11, 12, 32+12, 13, 32+13, 14, 32+14, 15, 32+15, 24, 32+24, 25, 32+25, 26, 32+26, 27, 32+27, 28, 32+28, 29, 32+29, 30, 32+30, 31, 32+31); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_unpackhi_epi16(__m256i __a, __m256i __b) { return (__m256i)__builtin_shufflevector((__v16hi)__a, (__v16hi)__b, 4, 16+4, 5, 16+5, 6, 16+6, 7, 16+7, 12, 16+12, 13, 16+13, 14, 16+14, 15, 16+15); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_unpackhi_epi32(__m256i __a, __m256i __b) { return (__m256i)__builtin_shufflevector((__v8si)__a, (__v8si)__b, 2, 8+2, 3, 8+3, 6, 8+6, 7, 8+7); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_unpackhi_epi64(__m256i __a, __m256i __b) { return (__m256i)__builtin_shufflevector((__v4di)__a, (__v4di)__b, 1, 4+1, 3, 4+3); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_unpacklo_epi8(__m256i __a, __m256i __b) { return (__m256i)__builtin_shufflevector((__v32qi)__a, (__v32qi)__b, 0, 32+0, 1, 32+1, 2, 32+2, 3, 32+3, 4, 32+4, 5, 32+5, 6, 32+6, 7, 32+7, 16, 32+16, 17, 32+17, 18, 32+18, 19, 32+19, 20, 32+20, 21, 32+21, 22, 32+22, 23, 32+23); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_unpacklo_epi16(__m256i __a, __m256i __b) { return (__m256i)__builtin_shufflevector((__v16hi)__a, (__v16hi)__b, 0, 16+0, 1, 16+1, 2, 16+2, 3, 16+3, 8, 16+8, 9, 16+9, 10, 16+10, 11, 16+11); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_unpacklo_epi32(__m256i __a, __m256i __b) { return (__m256i)__builtin_shufflevector((__v8si)__a, (__v8si)__b, 0, 8+0, 1, 8+1, 4, 8+4, 5, 8+5); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_unpacklo_epi64(__m256i __a, __m256i __b) { return (__m256i)__builtin_shufflevector((__v4di)__a, (__v4di)__b, 0, 4+0, 2, 4+2); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_xor_si256(__m256i __a, __m256i __b) { return (__m256i)((__v4du)__a ^ (__v4du)__b); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_stream_load_si256(__m256i const *__V) { typedef __v4di __v4di_aligned __attribute__((aligned(32))); return (__m256i)__builtin_nontemporal_load((const __v4di_aligned *)__V); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_broadcastss_ps(__m128 __X) { return (__m128)__builtin_shufflevector((__v4sf)__X, (__v4sf)__X, 0, 0, 0, 0); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_broadcastsd_pd(__m128d __a) { return __builtin_shufflevector((__v2df)__a, (__v2df)__a, 0, 0); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_broadcastss_ps(__m128 __X) { return (__m256)__builtin_shufflevector((__v4sf)__X, (__v4sf)__X, 0, 0, 0, 0, 0, 0, 0, 0); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_broadcastsd_pd(__m128d __X) { return (__m256d)__builtin_shufflevector((__v2df)__X, (__v2df)__X, 0, 0, 0, 0); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_broadcastsi128_si256(__m128i __X) { return (__m256i)__builtin_shufflevector((__v2di)__X, (__v2di)__X, 0, 1, 0, 1); } #define _mm_blend_epi32(V1, V2, M) __extension__ ({ \ (__m128i)__builtin_shufflevector((__v4si)(__m128i)(V1), \ (__v4si)(__m128i)(V2), \ (((M) & 0x01) ? 4 : 0), \ (((M) & 0x02) ? 5 : 1), \ (((M) & 0x04) ? 6 : 2), \ (((M) & 0x08) ? 7 : 3)); }) #define _mm256_blend_epi32(V1, V2, M) __extension__ ({ \ (__m256i)__builtin_shufflevector((__v8si)(__m256i)(V1), \ (__v8si)(__m256i)(V2), \ (((M) & 0x01) ? 8 : 0), \ (((M) & 0x02) ? 9 : 1), \ (((M) & 0x04) ? 10 : 2), \ (((M) & 0x08) ? 11 : 3), \ (((M) & 0x10) ? 12 : 4), \ (((M) & 0x20) ? 13 : 5), \ (((M) & 0x40) ? 14 : 6), \ (((M) & 0x80) ? 15 : 7)); }) static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_broadcastb_epi8(__m128i __X) { return (__m256i)__builtin_shufflevector((__v16qi)__X, (__v16qi)__X, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_broadcastw_epi16(__m128i __X) { return (__m256i)__builtin_shufflevector((__v8hi)__X, (__v8hi)__X, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_broadcastd_epi32(__m128i __X) { return (__m256i)__builtin_shufflevector((__v4si)__X, (__v4si)__X, 0, 0, 0, 0, 0, 0, 0, 0); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_broadcastq_epi64(__m128i __X) { return (__m256i)__builtin_shufflevector((__v2di)__X, (__v2di)__X, 0, 0, 0, 0); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_broadcastb_epi8(__m128i __X) { return (__m128i)__builtin_shufflevector((__v16qi)__X, (__v16qi)__X, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_broadcastw_epi16(__m128i __X) { return (__m128i)__builtin_shufflevector((__v8hi)__X, (__v8hi)__X, 0, 0, 0, 0, 0, 0, 0, 0); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_broadcastd_epi32(__m128i __X) { return (__m128i)__builtin_shufflevector((__v4si)__X, (__v4si)__X, 0, 0, 0, 0); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_broadcastq_epi64(__m128i __X) { return (__m128i)__builtin_shufflevector((__v2di)__X, (__v2di)__X, 0, 0); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_permutevar8x32_epi32(__m256i __a, __m256i __b) { return (__m256i)__builtin_ia32_permvarsi256((__v8si)__a, (__v8si)__b); } #define _mm256_permute4x64_pd(V, M) __extension__ ({ \ (__m256d)__builtin_shufflevector((__v4df)(__m256d)(V), \ (__v4df)_mm256_undefined_pd(), \ ((M) >> 0) & 0x3, \ ((M) >> 2) & 0x3, \ ((M) >> 4) & 0x3, \ ((M) >> 6) & 0x3); }) static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_permutevar8x32_ps(__m256 __a, __m256i __b) { return (__m256)__builtin_ia32_permvarsf256((__v8sf)__a, (__v8si)__b); } #define _mm256_permute4x64_epi64(V, M) __extension__ ({ \ (__m256i)__builtin_shufflevector((__v4di)(__m256i)(V), \ (__v4di)_mm256_undefined_si256(), \ ((M) >> 0) & 0x3, \ ((M) >> 2) & 0x3, \ ((M) >> 4) & 0x3, \ ((M) >> 6) & 0x3); }) #define _mm256_permute2x128_si256(V1, V2, M) __extension__ ({ \ (__m256i)__builtin_ia32_permti256((__m256i)(V1), (__m256i)(V2), (M)); }) #define _mm256_extracti128_si256(V, M) __extension__ ({ \ (__m128i)__builtin_shufflevector((__v4di)(__m256i)(V), \ (__v4di)_mm256_undefined_si256(), \ (((M) & 1) ? 2 : 0), \ (((M) & 1) ? 3 : 1) ); }) #define _mm256_inserti128_si256(V1, V2, M) __extension__ ({ \ (__m256i)__builtin_shufflevector((__v4di)(__m256i)(V1), \ (__v4di)_mm256_castsi128_si256((__m128i)(V2)), \ (((M) & 1) ? 0 : 4), \ (((M) & 1) ? 1 : 5), \ (((M) & 1) ? 4 : 2), \ (((M) & 1) ? 5 : 3) ); }) static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskload_epi32(int const *__X, __m256i __M) { return (__m256i)__builtin_ia32_maskloadd256((const __v8si *)__X, (__v8si)__M); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskload_epi64(long long const *__X, __m256i __M) { return (__m256i)__builtin_ia32_maskloadq256((const __v4di *)__X, (__v4di)__M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskload_epi32(int const *__X, __m128i __M) { return (__m128i)__builtin_ia32_maskloadd((const __v4si *)__X, (__v4si)__M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskload_epi64(long long const *__X, __m128i __M) { return (__m128i)__builtin_ia32_maskloadq((const __v2di *)__X, (__v2di)__M); } static __inline__ void __DEFAULT_FN_ATTRS _mm256_maskstore_epi32(int *__X, __m256i __M, __m256i __Y) { __builtin_ia32_maskstored256((__v8si *)__X, (__v8si)__M, (__v8si)__Y); } static __inline__ void __DEFAULT_FN_ATTRS _mm256_maskstore_epi64(long long *__X, __m256i __M, __m256i __Y) { __builtin_ia32_maskstoreq256((__v4di *)__X, (__v4di)__M, (__v4di)__Y); } static __inline__ void __DEFAULT_FN_ATTRS _mm_maskstore_epi32(int *__X, __m128i __M, __m128i __Y) { __builtin_ia32_maskstored((__v4si *)__X, (__v4si)__M, (__v4si)__Y); } static __inline__ void __DEFAULT_FN_ATTRS _mm_maskstore_epi64(long long *__X, __m128i __M, __m128i __Y) { __builtin_ia32_maskstoreq(( __v2di *)__X, (__v2di)__M, (__v2di)__Y); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_sllv_epi32(__m256i __X, __m256i __Y) { return (__m256i)__builtin_ia32_psllv8si((__v8si)__X, (__v8si)__Y); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sllv_epi32(__m128i __X, __m128i __Y) { return (__m128i)__builtin_ia32_psllv4si((__v4si)__X, (__v4si)__Y); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_sllv_epi64(__m256i __X, __m256i __Y) { return (__m256i)__builtin_ia32_psllv4di((__v4di)__X, (__v4di)__Y); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sllv_epi64(__m128i __X, __m128i __Y) { return (__m128i)__builtin_ia32_psllv2di((__v2di)__X, (__v2di)__Y); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_srav_epi32(__m256i __X, __m256i __Y) { return (__m256i)__builtin_ia32_psrav8si((__v8si)__X, (__v8si)__Y); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_srav_epi32(__m128i __X, __m128i __Y) { return (__m128i)__builtin_ia32_psrav4si((__v4si)__X, (__v4si)__Y); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_srlv_epi32(__m256i __X, __m256i __Y) { return (__m256i)__builtin_ia32_psrlv8si((__v8si)__X, (__v8si)__Y); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_srlv_epi32(__m128i __X, __m128i __Y) { return (__m128i)__builtin_ia32_psrlv4si((__v4si)__X, (__v4si)__Y); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_srlv_epi64(__m256i __X, __m256i __Y) { return (__m256i)__builtin_ia32_psrlv4di((__v4di)__X, (__v4di)__Y); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_srlv_epi64(__m128i __X, __m128i __Y) { return (__m128i)__builtin_ia32_psrlv2di((__v2di)__X, (__v2di)__Y); } #define _mm_mask_i32gather_pd(a, m, i, mask, s) __extension__ ({ \ (__m128d)__builtin_ia32_gatherd_pd((__v2df)(__m128i)(a), \ (double const *)(m), \ (__v4si)(__m128i)(i), \ (__v2df)(__m128d)(mask), (s)); }) #define _mm256_mask_i32gather_pd(a, m, i, mask, s) __extension__ ({ \ (__m256d)__builtin_ia32_gatherd_pd256((__v4df)(__m256d)(a), \ (double const *)(m), \ (__v4si)(__m128i)(i), \ (__v4df)(__m256d)(mask), (s)); }) #define _mm_mask_i64gather_pd(a, m, i, mask, s) __extension__ ({ \ (__m128d)__builtin_ia32_gatherq_pd((__v2df)(__m128d)(a), \ (double const *)(m), \ (__v2di)(__m128i)(i), \ (__v2df)(__m128d)(mask), (s)); }) #define _mm256_mask_i64gather_pd(a, m, i, mask, s) __extension__ ({ \ (__m256d)__builtin_ia32_gatherq_pd256((__v4df)(__m256d)(a), \ (double const *)(m), \ (__v4di)(__m256i)(i), \ (__v4df)(__m256d)(mask), (s)); }) #define _mm_mask_i32gather_ps(a, m, i, mask, s) __extension__ ({ \ (__m128)__builtin_ia32_gatherd_ps((__v4sf)(__m128)(a), \ (float const *)(m), \ (__v4si)(__m128i)(i), \ (__v4sf)(__m128)(mask), (s)); }) #define _mm256_mask_i32gather_ps(a, m, i, mask, s) __extension__ ({ \ (__m256)__builtin_ia32_gatherd_ps256((__v8sf)(__m256)(a), \ (float const *)(m), \ (__v8si)(__m256i)(i), \ (__v8sf)(__m256)(mask), (s)); }) #define _mm_mask_i64gather_ps(a, m, i, mask, s) __extension__ ({ \ (__m128)__builtin_ia32_gatherq_ps((__v4sf)(__m128)(a), \ (float const *)(m), \ (__v2di)(__m128i)(i), \ (__v4sf)(__m128)(mask), (s)); }) #define _mm256_mask_i64gather_ps(a, m, i, mask, s) __extension__ ({ \ (__m128)__builtin_ia32_gatherq_ps256((__v4sf)(__m128)(a), \ (float const *)(m), \ (__v4di)(__m256i)(i), \ (__v4sf)(__m128)(mask), (s)); }) #define _mm_mask_i32gather_epi32(a, m, i, mask, s) __extension__ ({ \ (__m128i)__builtin_ia32_gatherd_d((__v4si)(__m128i)(a), \ (int const *)(m), \ (__v4si)(__m128i)(i), \ (__v4si)(__m128i)(mask), (s)); }) #define _mm256_mask_i32gather_epi32(a, m, i, mask, s) __extension__ ({ \ (__m256i)__builtin_ia32_gatherd_d256((__v8si)(__m256i)(a), \ (int const *)(m), \ (__v8si)(__m256i)(i), \ (__v8si)(__m256i)(mask), (s)); }) #define _mm_mask_i64gather_epi32(a, m, i, mask, s) __extension__ ({ \ (__m128i)__builtin_ia32_gatherq_d((__v4si)(__m128i)(a), \ (int const *)(m), \ (__v2di)(__m128i)(i), \ (__v4si)(__m128i)(mask), (s)); }) #define _mm256_mask_i64gather_epi32(a, m, i, mask, s) __extension__ ({ \ (__m128i)__builtin_ia32_gatherq_d256((__v4si)(__m128i)(a), \ (int const *)(m), \ (__v4di)(__m256i)(i), \ (__v4si)(__m128i)(mask), (s)); }) #define _mm_mask_i32gather_epi64(a, m, i, mask, s) __extension__ ({ \ (__m128i)__builtin_ia32_gatherd_q((__v2di)(__m128i)(a), \ (long long const *)(m), \ (__v4si)(__m128i)(i), \ (__v2di)(__m128i)(mask), (s)); }) #define _mm256_mask_i32gather_epi64(a, m, i, mask, s) __extension__ ({ \ (__m256i)__builtin_ia32_gatherd_q256((__v4di)(__m256i)(a), \ (long long const *)(m), \ (__v4si)(__m128i)(i), \ (__v4di)(__m256i)(mask), (s)); }) #define _mm_mask_i64gather_epi64(a, m, i, mask, s) __extension__ ({ \ (__m128i)__builtin_ia32_gatherq_q((__v2di)(__m128i)(a), \ (long long const *)(m), \ (__v2di)(__m128i)(i), \ (__v2di)(__m128i)(mask), (s)); }) #define _mm256_mask_i64gather_epi64(a, m, i, mask, s) __extension__ ({ \ (__m256i)__builtin_ia32_gatherq_q256((__v4di)(__m256i)(a), \ (long long const *)(m), \ (__v4di)(__m256i)(i), \ (__v4di)(__m256i)(mask), (s)); }) #define _mm_i32gather_pd(m, i, s) __extension__ ({ \ (__m128d)__builtin_ia32_gatherd_pd((__v2df)_mm_undefined_pd(), \ (double const *)(m), \ (__v4si)(__m128i)(i), \ (__v2df)_mm_cmpeq_pd(_mm_setzero_pd(), \ _mm_setzero_pd()), \ (s)); }) #define _mm256_i32gather_pd(m, i, s) __extension__ ({ \ (__m256d)__builtin_ia32_gatherd_pd256((__v4df)_mm256_undefined_pd(), \ (double const *)(m), \ (__v4si)(__m128i)(i), \ (__v4df)_mm256_cmp_pd(_mm256_setzero_pd(), \ _mm256_setzero_pd(), \ _CMP_EQ_OQ), \ (s)); }) #define _mm_i64gather_pd(m, i, s) __extension__ ({ \ (__m128d)__builtin_ia32_gatherq_pd((__v2df)_mm_undefined_pd(), \ (double const *)(m), \ (__v2di)(__m128i)(i), \ (__v2df)_mm_cmpeq_pd(_mm_setzero_pd(), \ _mm_setzero_pd()), \ (s)); }) #define _mm256_i64gather_pd(m, i, s) __extension__ ({ \ (__m256d)__builtin_ia32_gatherq_pd256((__v4df)_mm256_undefined_pd(), \ (double const *)(m), \ (__v4di)(__m256i)(i), \ (__v4df)_mm256_cmp_pd(_mm256_setzero_pd(), \ _mm256_setzero_pd(), \ _CMP_EQ_OQ), \ (s)); }) #define _mm_i32gather_ps(m, i, s) __extension__ ({ \ (__m128)__builtin_ia32_gatherd_ps((__v4sf)_mm_undefined_ps(), \ (float const *)(m), \ (__v4si)(__m128i)(i), \ (__v4sf)_mm_cmpeq_ps(_mm_setzero_ps(), \ _mm_setzero_ps()), \ (s)); }) #define _mm256_i32gather_ps(m, i, s) __extension__ ({ \ (__m256)__builtin_ia32_gatherd_ps256((__v8sf)_mm256_undefined_ps(), \ (float const *)(m), \ (__v8si)(__m256i)(i), \ (__v8sf)_mm256_cmp_ps(_mm256_setzero_ps(), \ _mm256_setzero_ps(), \ _CMP_EQ_OQ), \ (s)); }) #define _mm_i64gather_ps(m, i, s) __extension__ ({ \ (__m128)__builtin_ia32_gatherq_ps((__v4sf)_mm_undefined_ps(), \ (float const *)(m), \ (__v2di)(__m128i)(i), \ (__v4sf)_mm_cmpeq_ps(_mm_setzero_ps(), \ _mm_setzero_ps()), \ (s)); }) #define _mm256_i64gather_ps(m, i, s) __extension__ ({ \ (__m128)__builtin_ia32_gatherq_ps256((__v4sf)_mm_undefined_ps(), \ (float const *)(m), \ (__v4di)(__m256i)(i), \ (__v4sf)_mm_cmpeq_ps(_mm_setzero_ps(), \ _mm_setzero_ps()), \ (s)); }) #define _mm_i32gather_epi32(m, i, s) __extension__ ({ \ (__m128i)__builtin_ia32_gatherd_d((__v4si)_mm_undefined_si128(), \ (int const *)(m), (__v4si)(__m128i)(i), \ (__v4si)_mm_set1_epi32(-1), (s)); }) #define _mm256_i32gather_epi32(m, i, s) __extension__ ({ \ (__m256i)__builtin_ia32_gatherd_d256((__v8si)_mm256_undefined_si256(), \ (int const *)(m), (__v8si)(__m256i)(i), \ (__v8si)_mm256_set1_epi32(-1), (s)); }) #define _mm_i64gather_epi32(m, i, s) __extension__ ({ \ (__m128i)__builtin_ia32_gatherq_d((__v4si)_mm_undefined_si128(), \ (int const *)(m), (__v2di)(__m128i)(i), \ (__v4si)_mm_set1_epi32(-1), (s)); }) #define _mm256_i64gather_epi32(m, i, s) __extension__ ({ \ (__m128i)__builtin_ia32_gatherq_d256((__v4si)_mm_undefined_si128(), \ (int const *)(m), (__v4di)(__m256i)(i), \ (__v4si)_mm_set1_epi32(-1), (s)); }) #define _mm_i32gather_epi64(m, i, s) __extension__ ({ \ (__m128i)__builtin_ia32_gatherd_q((__v2di)_mm_undefined_si128(), \ (long long const *)(m), \ (__v4si)(__m128i)(i), \ (__v2di)_mm_set1_epi64x(-1), (s)); }) #define _mm256_i32gather_epi64(m, i, s) __extension__ ({ \ (__m256i)__builtin_ia32_gatherd_q256((__v4di)_mm256_undefined_si256(), \ (long long const *)(m), \ (__v4si)(__m128i)(i), \ (__v4di)_mm256_set1_epi64x(-1), (s)); }) #define _mm_i64gather_epi64(m, i, s) __extension__ ({ \ (__m128i)__builtin_ia32_gatherq_q((__v2di)_mm_undefined_si128(), \ (long long const *)(m), \ (__v2di)(__m128i)(i), \ (__v2di)_mm_set1_epi64x(-1), (s)); }) #define _mm256_i64gather_epi64(m, i, s) __extension__ ({ \ (__m256i)__builtin_ia32_gatherq_q256((__v4di)_mm256_undefined_si256(), \ (long long const *)(m), \ (__v4di)(__m256i)(i), \ (__v4di)_mm256_set1_epi64x(-1), (s)); }) #undef __DEFAULT_FN_ATTRS #endif /* __AVX2INTRIN_H */ # 1309 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx2intrin.h" 3 # 71 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 2 3 /* The 256-bit versions of functions in f16cintrin.h. Intel documents these as being in immintrin.h, and they depend on typedefs from avxintrin.h. */ /// \brief Converts a 256-bit vector of [8 x float] into a 128-bit vector /// containing 16-bit half-precision float values. /// /// \headerfile /// /// \code /// __m128i _mm256_cvtps_ph(__m256 a, const int imm); /// \endcode /// /// This intrinsic corresponds to the VCVTPS2PH instruction. /// /// \param a /// A 256-bit vector containing 32-bit single-precision float values to be /// converted to 16-bit half-precision float values. /// \param imm /// An immediate value controlling rounding using bits [2:0]: \n /// 000: Nearest \n /// 001: Down \n /// 010: Up \n /// 011: Truncate \n /// 1XX: Use MXCSR.RC for rounding /// \returns A 128-bit vector containing the converted 16-bit half-precision /// float values. #define _mm256_cvtps_ph(a, imm) __extension__ ({ \ (__m128i)__builtin_ia32_vcvtps2ph256((__v8sf)(__m256)(a), (imm)); }) /// \brief Converts a 128-bit vector containing 16-bit half-precision float /// values into a 256-bit vector of [8 x float]. /// /// \headerfile /// /// This intrinsic corresponds to the VCVTPH2PS instruction. /// /// \param __a /// A 128-bit vector containing 16-bit half-precision float values to be /// converted to 32-bit single-precision float values. /// \returns A vector of [8 x float] containing the converted 32-bit /// single-precision float values. static __inline __m256 __attribute__((__always_inline__, __nodebug__, __target__("f16c"))) _mm256_cvtph_ps(__m128i __a) { return (__m256)__builtin_ia32_vcvtph2ps256((__v8hi)__a); } #endif /* __AVX2__ */ # 120 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || defined(__VPCLMULQDQ__) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 122 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/vpclmulqdqintrin.h" 1 3 /*===------------ vpclmulqdqintrin.h - VPCLMULQDQ intrinsics ---------------=== * * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __IMMINTRIN_H #error "Never use directly; include instead." #endif # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/vpclmulqdqintrin.h" 3 #ifndef __VPCLMULQDQINTRIN_H #define __VPCLMULQDQINTRIN_H #define _mm256_clmulepi64_epi128(A, B, I) __extension__ ({ \ (__m256i)__builtin_ia32_pclmulqdq256((__v4di)(__m256i)(A), \ (__v4di)(__m256i)(B), \ (char)(I)); }) #define _mm512_clmulepi64_epi128(A, B, I) __extension__ ({ \ (__m512i)__builtin_ia32_pclmulqdq512((__v8di)(__m512i)(A), \ (__v8di)(__m512i)(B), \ (char)(I)); }) #endif // __VPCLMULQDQINTRIN_H # 42 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/vpclmulqdqintrin.h" 3 # 123 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 2 3 #endif # 124 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || defined(__BMI__) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 126 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/bmiintrin.h" 1 3 /*===---- bmiintrin.h - BMI intrinsics -------------------------------------=== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #if !defined __X86INTRIN_H && !defined __IMMINTRIN_H #error "Never use directly; include instead." #endif # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/bmiintrin.h" 3 #ifndef __BMIINTRIN_H #define __BMIINTRIN_H #define _tzcnt_u16(a) (__tzcnt_u16((a))) #define _andn_u32(a, b) (__andn_u32((a), (b))) /* _bextr_u32 != __bextr_u32 */ #define _blsi_u32(a) (__blsi_u32((a))) #define _blsmsk_u32(a) (__blsmsk_u32((a))) #define _blsr_u32(a) (__blsr_u32((a))) #define _tzcnt_u32(a) (__tzcnt_u32((a))) /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("bmi"))) /* Allow using the tzcnt intrinsics even for non-BMI targets. Since the TZCNT instruction behaves as BSF on non-BMI targets, there is code that expects to use it as a potentially faster version of BSF. */ #define __RELAXED_FN_ATTRS __attribute__((__always_inline__, __nodebug__)) /// \brief Counts the number of trailing zero bits in the operand. /// /// \headerfile /// /// This intrinsic corresponds to the TZCNT instruction. /// /// \param __X /// An unsigned 16-bit integer whose trailing zeros are to be counted. /// \returns An unsigned 16-bit integer containing the number of trailing zero /// bits in the operand. static __inline__ unsigned short __RELAXED_FN_ATTRS __tzcnt_u16(unsigned short __X) { return __X ? __builtin_ctzs(__X) : 16; } /// \brief Performs a bitwise AND of the second operand with the one's /// complement of the first operand. /// /// \headerfile /// /// This intrinsic corresponds to the ANDN instruction. /// /// \param __X /// An unsigned integer containing one of the operands. /// \param __Y /// An unsigned integer containing one of the operands. /// \returns An unsigned integer containing the bitwise AND of the second /// operand with the one's complement of the first operand. static __inline__ unsigned int __DEFAULT_FN_ATTRS __andn_u32(unsigned int __X, unsigned int __Y) { return ~__X & __Y; } /* AMD-specified, double-leading-underscore version of BEXTR */ /// \brief Extracts the specified bits from the first operand and returns them /// in the least significant bits of the result. /// /// \headerfile /// /// This intrinsic corresponds to the BEXTR instruction. /// /// \param __X /// An unsigned integer whose bits are to be extracted. /// \param __Y /// An unsigned integer used to specify which bits are extracted. Bits [7:0] /// specify the index of the least significant bit. Bits [15:8] specify the /// number of bits to be extracted. /// \returns An unsigned integer whose least significant bits contain the /// extracted bits. static __inline__ unsigned int __DEFAULT_FN_ATTRS __bextr_u32(unsigned int __X, unsigned int __Y) { return __builtin_ia32_bextr_u32(__X, __Y); } /* Intel-specified, single-leading-underscore version of BEXTR */ /// \brief Extracts the specified bits from the first operand and returns them /// in the least significant bits of the result. /// /// \headerfile /// /// This intrinsic corresponds to the BEXTR instruction. /// /// \param __X /// An unsigned integer whose bits are to be extracted. /// \param __Y /// An unsigned integer used to specify the index of the least significant /// bit for the bits to be extracted. Bits [7:0] specify the index. /// \param __Z /// An unsigned integer used to specify the number of bits to be extracted. /// Bits [7:0] specify the number of bits. /// \returns An unsigned integer whose least significant bits contain the /// extracted bits. static __inline__ unsigned int __DEFAULT_FN_ATTRS _bextr_u32(unsigned int __X, unsigned int __Y, unsigned int __Z) { return __builtin_ia32_bextr_u32 (__X, ((__Y & 0xff) | ((__Z & 0xff) << 8))); } /// \brief Clears all bits in the source except for the least significant bit /// containing a value of 1 and returns the result. /// /// \headerfile /// /// This intrinsic corresponds to the BLSI instruction. /// /// \param __X /// An unsigned integer whose bits are to be cleared. /// \returns An unsigned integer containing the result of clearing the bits from /// the source operand. static __inline__ unsigned int __DEFAULT_FN_ATTRS __blsi_u32(unsigned int __X) { return __X & -__X; } /// \brief Creates a mask whose bits are set to 1, using bit 0 up to and /// including the least significant bit that is set to 1 in the source /// operand and returns the result. /// /// \headerfile /// /// This intrinsic corresponds to the BLSMSK instruction. /// /// \param __X /// An unsigned integer used to create the mask. /// \returns An unsigned integer containing the newly created mask. static __inline__ unsigned int __DEFAULT_FN_ATTRS __blsmsk_u32(unsigned int __X) { return __X ^ (__X - 1); } /// \brief Clears the least significant bit that is set to 1 in the source /// operand and returns the result. /// /// \headerfile /// /// This intrinsic corresponds to the BLSR instruction. /// /// \param __X /// An unsigned integer containing the operand to be cleared. /// \returns An unsigned integer containing the result of clearing the source /// operand. static __inline__ unsigned int __DEFAULT_FN_ATTRS __blsr_u32(unsigned int __X) { return __X & (__X - 1); } /// \brief Counts the number of trailing zero bits in the operand. /// /// \headerfile /// /// This intrinsic corresponds to the TZCNT instruction. /// /// \param __X /// An unsigned 32-bit integer whose trailing zeros are to be counted. /// \returns An unsigned 32-bit integer containing the number of trailing zero /// bits in the operand. static __inline__ unsigned int __RELAXED_FN_ATTRS __tzcnt_u32(unsigned int __X) { return __X ? __builtin_ctz(__X) : 32; } /// \brief Counts the number of trailing zero bits in the operand. /// /// \headerfile /// /// This intrinsic corresponds to the TZCNT instruction. /// /// \param __X /// An unsigned 32-bit integer whose trailing zeros are to be counted. /// \returns An 32-bit integer containing the number of trailing zero bits in /// the operand. static __inline__ int __RELAXED_FN_ATTRS _mm_tzcnt_32(unsigned int __X) { return __X ? __builtin_ctz(__X) : 32; } #ifdef __x86_64__ #define _andn_u64(a, b) (__andn_u64((a), (b))) /* _bextr_u64 != __bextr_u64 */ #define _blsi_u64(a) (__blsi_u64((a))) #define _blsmsk_u64(a) (__blsmsk_u64((a))) #define _blsr_u64(a) (__blsr_u64((a))) #define _tzcnt_u64(a) (__tzcnt_u64((a))) /// \brief Performs a bitwise AND of the second operand with the one's /// complement of the first operand. /// /// \headerfile /// /// This intrinsic corresponds to the ANDN instruction. /// /// \param __X /// An unsigned 64-bit integer containing one of the operands. /// \param __Y /// An unsigned 64-bit integer containing one of the operands. /// \returns An unsigned 64-bit integer containing the bitwise AND of the second /// operand with the one's complement of the first operand. static __inline__ unsigned long long __DEFAULT_FN_ATTRS __andn_u64 (unsigned long long __X, unsigned long long __Y) { return ~__X & __Y; } /* AMD-specified, double-leading-underscore version of BEXTR */ /// \brief Extracts the specified bits from the first operand and returns them /// in the least significant bits of the result. /// /// \headerfile /// /// This intrinsic corresponds to the BEXTR instruction. /// /// \param __X /// An unsigned 64-bit integer whose bits are to be extracted. /// \param __Y /// An unsigned 64-bit integer used to specify which bits are extracted. Bits /// [7:0] specify the index of the least significant bit. Bits [15:8] specify /// the number of bits to be extracted. /// \returns An unsigned 64-bit integer whose least significant bits contain the /// extracted bits. static __inline__ unsigned long long __DEFAULT_FN_ATTRS __bextr_u64(unsigned long long __X, unsigned long long __Y) { return __builtin_ia32_bextr_u64(__X, __Y); } /* Intel-specified, single-leading-underscore version of BEXTR */ /// \brief Extracts the specified bits from the first operand and returns them /// in the least significant bits of the result. /// /// \headerfile /// /// This intrinsic corresponds to the BEXTR instruction. /// /// \param __X /// An unsigned 64-bit integer whose bits are to be extracted. /// \param __Y /// An unsigned integer used to specify the index of the least significant /// bit for the bits to be extracted. Bits [7:0] specify the index. /// \param __Z /// An unsigned integer used to specify the number of bits to be extracted. /// Bits [7:0] specify the number of bits. /// \returns An unsigned 64-bit integer whose least significant bits contain the /// extracted bits. static __inline__ unsigned long long __DEFAULT_FN_ATTRS _bextr_u64(unsigned long long __X, unsigned int __Y, unsigned int __Z) { return __builtin_ia32_bextr_u64 (__X, ((__Y & 0xff) | ((__Z & 0xff) << 8))); } /// \brief Clears all bits in the source except for the least significant bit /// containing a value of 1 and returns the result. /// /// \headerfile /// /// This intrinsic corresponds to the BLSI instruction. /// /// \param __X /// An unsigned 64-bit integer whose bits are to be cleared. /// \returns An unsigned 64-bit integer containing the result of clearing the /// bits from the source operand. static __inline__ unsigned long long __DEFAULT_FN_ATTRS __blsi_u64(unsigned long long __X) { return __X & -__X; } /// \brief Creates a mask whose bits are set to 1, using bit 0 up to and /// including the least significant bit that is set to 1 in the source /// operand and returns the result. /// /// \headerfile /// /// This intrinsic corresponds to the BLSMSK instruction. /// /// \param __X /// An unsigned 64-bit integer used to create the mask. /// \returns An unsigned 64-bit integer containing the newly created mask. static __inline__ unsigned long long __DEFAULT_FN_ATTRS __blsmsk_u64(unsigned long long __X) { return __X ^ (__X - 1); } /// \brief Clears the least significant bit that is set to 1 in the source /// operand and returns the result. /// /// \headerfile /// /// This intrinsic corresponds to the BLSR instruction. /// /// \param __X /// An unsigned 64-bit integer containing the operand to be cleared. /// \returns An unsigned 64-bit integer containing the result of clearing the /// source operand. static __inline__ unsigned long long __DEFAULT_FN_ATTRS __blsr_u64(unsigned long long __X) { return __X & (__X - 1); } /// \brief Counts the number of trailing zero bits in the operand. /// /// \headerfile /// /// This intrinsic corresponds to the TZCNT instruction. /// /// \param __X /// An unsigned 64-bit integer whose trailing zeros are to be counted. /// \returns An unsigned 64-bit integer containing the number of trailing zero /// bits in the operand. static __inline__ unsigned long long __RELAXED_FN_ATTRS __tzcnt_u64(unsigned long long __X) { return __X ? __builtin_ctzll(__X) : 64; } /// \brief Counts the number of trailing zero bits in the operand. /// /// \headerfile /// /// This intrinsic corresponds to the TZCNT instruction. /// /// \param __X /// An unsigned 64-bit integer whose trailing zeros are to be counted. /// \returns An 64-bit integer containing the number of trailing zero bits in /// the operand. static __inline__ long long __RELAXED_FN_ATTRS _mm_tzcnt_64(unsigned long long __X) { return __X ? __builtin_ctzll(__X) : 64; } #endif /* __x86_64__ */ # 378 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/bmiintrin.h" 3 #undef __DEFAULT_FN_ATTRS #undef __RELAXED_FN_ATTRS #endif /* __BMIINTRIN_H */ # 383 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/bmiintrin.h" 3 # 127 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 2 3 #endif # 128 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || defined(__BMI2__) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 130 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/bmi2intrin.h" 1 3 /*===---- bmi2intrin.h - BMI2 intrinsics -----------------------------------=== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #if !defined __X86INTRIN_H && !defined __IMMINTRIN_H #error "Never use directly; include instead." #endif # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/bmi2intrin.h" 3 #ifndef __BMI2INTRIN_H #define __BMI2INTRIN_H /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("bmi2"))) static __inline__ unsigned int __DEFAULT_FN_ATTRS _bzhi_u32(unsigned int __X, unsigned int __Y) { return __builtin_ia32_bzhi_si(__X, __Y); } static __inline__ unsigned int __DEFAULT_FN_ATTRS _pdep_u32(unsigned int __X, unsigned int __Y) { return __builtin_ia32_pdep_si(__X, __Y); } static __inline__ unsigned int __DEFAULT_FN_ATTRS _pext_u32(unsigned int __X, unsigned int __Y) { return __builtin_ia32_pext_si(__X, __Y); } #ifdef __x86_64__ static __inline__ unsigned long long __DEFAULT_FN_ATTRS _bzhi_u64(unsigned long long __X, unsigned long long __Y) { return __builtin_ia32_bzhi_di(__X, __Y); } static __inline__ unsigned long long __DEFAULT_FN_ATTRS _pdep_u64(unsigned long long __X, unsigned long long __Y) { return __builtin_ia32_pdep_di(__X, __Y); } static __inline__ unsigned long long __DEFAULT_FN_ATTRS _pext_u64(unsigned long long __X, unsigned long long __Y) { return __builtin_ia32_pext_di(__X, __Y); } static __inline__ unsigned long long __DEFAULT_FN_ATTRS _mulx_u64 (unsigned long long __X, unsigned long long __Y, unsigned long long *__P) { unsigned __int128 __res = (unsigned __int128) __X * __Y; *__P = (unsigned long long) (__res >> 64); return (unsigned long long) __res; } #else /* !__x86_64__ */ # 82 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/bmi2intrin.h" 3 static __inline__ unsigned int __DEFAULT_FN_ATTRS _mulx_u32 (unsigned int __X, unsigned int __Y, unsigned int *__P) { unsigned long long __res = (unsigned long long) __X * __Y; *__P = (unsigned int) (__res >> 32); return (unsigned int) __res; } #endif /* !__x86_64__ */ # 92 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/bmi2intrin.h" 3 #undef __DEFAULT_FN_ATTRS #endif /* __BMI2INTRIN_H */ # 96 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/bmi2intrin.h" 3 # 131 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 2 3 #endif # 132 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || defined(__LZCNT__) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 134 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/lzcntintrin.h" 1 3 /*===---- lzcntintrin.h - LZCNT intrinsics ---------------------------------=== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #if !defined __X86INTRIN_H && !defined __IMMINTRIN_H #error "Never use directly; include instead." #endif # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/lzcntintrin.h" 3 #ifndef __LZCNTINTRIN_H #define __LZCNTINTRIN_H /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("lzcnt"))) /// \brief Counts the number of leading zero bits in the operand. /// /// \headerfile /// /// This intrinsic corresponds to the \c LZCNT instruction. /// /// \param __X /// An unsigned 16-bit integer whose leading zeros are to be counted. /// \returns An unsigned 16-bit integer containing the number of leading zero /// bits in the operand. static __inline__ unsigned short __DEFAULT_FN_ATTRS __lzcnt16(unsigned short __X) { return __X ? __builtin_clzs(__X) : 16; } /// \brief Counts the number of leading zero bits in the operand. /// /// \headerfile /// /// This intrinsic corresponds to the \c LZCNT instruction. /// /// \param __X /// An unsigned 32-bit integer whose leading zeros are to be counted. /// \returns An unsigned 32-bit integer containing the number of leading zero /// bits in the operand. static __inline__ unsigned int __DEFAULT_FN_ATTRS __lzcnt32(unsigned int __X) { return __X ? __builtin_clz(__X) : 32; } /// \brief Counts the number of leading zero bits in the operand. /// /// \headerfile /// /// This intrinsic corresponds to the \c LZCNT instruction. /// /// \param __X /// An unsigned 32-bit integer whose leading zeros are to be counted. /// \returns An unsigned 32-bit integer containing the number of leading zero /// bits in the operand. static __inline__ unsigned int __DEFAULT_FN_ATTRS _lzcnt_u32(unsigned int __X) { return __X ? __builtin_clz(__X) : 32; } #ifdef __x86_64__ /// \brief Counts the number of leading zero bits in the operand. /// /// \headerfile /// /// This intrinsic corresponds to the \c LZCNT instruction. /// /// \param __X /// An unsigned 64-bit integer whose leading zeros are to be counted. /// \returns An unsigned 64-bit integer containing the number of leading zero /// bits in the operand. static __inline__ unsigned long long __DEFAULT_FN_ATTRS __lzcnt64(unsigned long long __X) { return __X ? __builtin_clzll(__X) : 64; } /// \brief Counts the number of leading zero bits in the operand. /// /// \headerfile /// /// This intrinsic corresponds to the \c LZCNT instruction. /// /// \param __X /// An unsigned 64-bit integer whose leading zeros are to be counted. /// \returns An unsigned 64-bit integer containing the number of leading zero /// bits in the operand. static __inline__ unsigned long long __DEFAULT_FN_ATTRS _lzcnt_u64(unsigned long long __X) { return __X ? __builtin_clzll(__X) : 64; } #endif # 115 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/lzcntintrin.h" 3 #undef __DEFAULT_FN_ATTRS #endif /* __LZCNTINTRIN_H */ # 119 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/lzcntintrin.h" 3 # 135 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 2 3 #endif # 136 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || defined(__FMA__) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 138 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/fmaintrin.h" 1 3 /*===---- fma4intrin.h - FMA4 intrinsics -----------------------------------=== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __IMMINTRIN_H #error "Never use directly; include instead." #endif # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/fmaintrin.h" 3 #ifndef __FMAINTRIN_H #define __FMAINTRIN_H /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("fma"))) static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_fmadd_ps(__m128 __A, __m128 __B, __m128 __C) { return (__m128)__builtin_ia32_vfmaddps((__v4sf)__A, (__v4sf)__B, (__v4sf)__C); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_fmadd_pd(__m128d __A, __m128d __B, __m128d __C) { return (__m128d)__builtin_ia32_vfmaddpd((__v2df)__A, (__v2df)__B, (__v2df)__C); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_fmadd_ss(__m128 __A, __m128 __B, __m128 __C) { return (__m128)__builtin_ia32_vfmaddss3((__v4sf)__A, (__v4sf)__B, (__v4sf)__C); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_fmadd_sd(__m128d __A, __m128d __B, __m128d __C) { return (__m128d)__builtin_ia32_vfmaddsd3((__v2df)__A, (__v2df)__B, (__v2df)__C); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_fmsub_ps(__m128 __A, __m128 __B, __m128 __C) { return (__m128)__builtin_ia32_vfmaddps((__v4sf)__A, (__v4sf)__B, -(__v4sf)__C); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_fmsub_pd(__m128d __A, __m128d __B, __m128d __C) { return (__m128d)__builtin_ia32_vfmaddpd((__v2df)__A, (__v2df)__B, -(__v2df)__C); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_fmsub_ss(__m128 __A, __m128 __B, __m128 __C) { return (__m128)__builtin_ia32_vfmaddss3((__v4sf)__A, (__v4sf)__B, -(__v4sf)__C); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_fmsub_sd(__m128d __A, __m128d __B, __m128d __C) { return (__m128d)__builtin_ia32_vfmaddsd3((__v2df)__A, (__v2df)__B, -(__v2df)__C); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_fnmadd_ps(__m128 __A, __m128 __B, __m128 __C) { return (__m128)__builtin_ia32_vfmaddps(-(__v4sf)__A, (__v4sf)__B, (__v4sf)__C); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_fnmadd_pd(__m128d __A, __m128d __B, __m128d __C) { return (__m128d)__builtin_ia32_vfmaddpd(-(__v2df)__A, (__v2df)__B, (__v2df)__C); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_fnmadd_ss(__m128 __A, __m128 __B, __m128 __C) { return (__m128)__builtin_ia32_vfmaddss3((__v4sf)__A, -(__v4sf)__B, (__v4sf)__C); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_fnmadd_sd(__m128d __A, __m128d __B, __m128d __C) { return (__m128d)__builtin_ia32_vfmaddsd3((__v2df)__A, -(__v2df)__B, (__v2df)__C); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_fnmsub_ps(__m128 __A, __m128 __B, __m128 __C) { return (__m128)__builtin_ia32_vfmaddps(-(__v4sf)__A, (__v4sf)__B, -(__v4sf)__C); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_fnmsub_pd(__m128d __A, __m128d __B, __m128d __C) { return (__m128d)__builtin_ia32_vfmaddpd(-(__v2df)__A, (__v2df)__B, -(__v2df)__C); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_fnmsub_ss(__m128 __A, __m128 __B, __m128 __C) { return (__m128)__builtin_ia32_vfmaddss3((__v4sf)__A, -(__v4sf)__B, -(__v4sf)__C); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_fnmsub_sd(__m128d __A, __m128d __B, __m128d __C) { return (__m128d)__builtin_ia32_vfmaddsd3((__v2df)__A, -(__v2df)__B, -(__v2df)__C); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_fmaddsub_ps(__m128 __A, __m128 __B, __m128 __C) { return (__m128)__builtin_ia32_vfmaddsubps((__v4sf)__A, (__v4sf)__B, (__v4sf)__C); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_fmaddsub_pd(__m128d __A, __m128d __B, __m128d __C) { return (__m128d)__builtin_ia32_vfmaddsubpd((__v2df)__A, (__v2df)__B, (__v2df)__C); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_fmsubadd_ps(__m128 __A, __m128 __B, __m128 __C) { return (__m128)__builtin_ia32_vfmaddsubps((__v4sf)__A, (__v4sf)__B, -(__v4sf)__C); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_fmsubadd_pd(__m128d __A, __m128d __B, __m128d __C) { return (__m128d)__builtin_ia32_vfmaddsubpd((__v2df)__A, (__v2df)__B, -(__v2df)__C); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_fmadd_ps(__m256 __A, __m256 __B, __m256 __C) { return (__m256)__builtin_ia32_vfmaddps256((__v8sf)__A, (__v8sf)__B, (__v8sf)__C); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_fmadd_pd(__m256d __A, __m256d __B, __m256d __C) { return (__m256d)__builtin_ia32_vfmaddpd256((__v4df)__A, (__v4df)__B, (__v4df)__C); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_fmsub_ps(__m256 __A, __m256 __B, __m256 __C) { return (__m256)__builtin_ia32_vfmaddps256((__v8sf)__A, (__v8sf)__B, -(__v8sf)__C); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_fmsub_pd(__m256d __A, __m256d __B, __m256d __C) { return (__m256d)__builtin_ia32_vfmaddpd256((__v4df)__A, (__v4df)__B, -(__v4df)__C); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_fnmadd_ps(__m256 __A, __m256 __B, __m256 __C) { return (__m256)__builtin_ia32_vfmaddps256(-(__v8sf)__A, (__v8sf)__B, (__v8sf)__C); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_fnmadd_pd(__m256d __A, __m256d __B, __m256d __C) { return (__m256d)__builtin_ia32_vfmaddpd256(-(__v4df)__A, (__v4df)__B, (__v4df)__C); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_fnmsub_ps(__m256 __A, __m256 __B, __m256 __C) { return (__m256)__builtin_ia32_vfmaddps256(-(__v8sf)__A, (__v8sf)__B, -(__v8sf)__C); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_fnmsub_pd(__m256d __A, __m256d __B, __m256d __C) { return (__m256d)__builtin_ia32_vfmaddpd256(-(__v4df)__A, (__v4df)__B, -(__v4df)__C); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_fmaddsub_ps(__m256 __A, __m256 __B, __m256 __C) { return (__m256)__builtin_ia32_vfmaddsubps256((__v8sf)__A, (__v8sf)__B, (__v8sf)__C); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_fmaddsub_pd(__m256d __A, __m256d __B, __m256d __C) { return (__m256d)__builtin_ia32_vfmaddsubpd256((__v4df)__A, (__v4df)__B, (__v4df)__C); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_fmsubadd_ps(__m256 __A, __m256 __B, __m256 __C) { return (__m256)__builtin_ia32_vfmaddsubps256((__v8sf)__A, (__v8sf)__B, -(__v8sf)__C); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_fmsubadd_pd(__m256d __A, __m256d __B, __m256d __C) { return (__m256d)__builtin_ia32_vfmaddsubpd256((__v4df)__A, (__v4df)__B, -(__v4df)__C); } #undef __DEFAULT_FN_ATTRS #endif /* __FMAINTRIN_H */ # 229 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/fmaintrin.h" 3 # 139 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 2 3 #endif # 140 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || defined(__AVX512F__) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 142 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512fintrin.h" 1 3 /*===---- avx512fintrin.h - AVX512F intrinsics -----------------------------=== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __IMMINTRIN_H #error "Never use directly; include instead." #endif # 26 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512fintrin.h" 3 #ifndef __AVX512FINTRIN_H #define __AVX512FINTRIN_H typedef char __v64qi __attribute__((__vector_size__(64))); typedef short __v32hi __attribute__((__vector_size__(64))); typedef double __v8df __attribute__((__vector_size__(64))); typedef float __v16sf __attribute__((__vector_size__(64))); typedef long long __v8di __attribute__((__vector_size__(64))); typedef int __v16si __attribute__((__vector_size__(64))); /* Unsigned types */ typedef unsigned char __v64qu __attribute__((__vector_size__(64))); typedef unsigned short __v32hu __attribute__((__vector_size__(64))); typedef unsigned long long __v8du __attribute__((__vector_size__(64))); typedef unsigned int __v16su __attribute__((__vector_size__(64))); typedef float __m512 __attribute__((__vector_size__(64))); typedef double __m512d __attribute__((__vector_size__(64))); typedef long long __m512i __attribute__((__vector_size__(64))); typedef unsigned char __mmask8; typedef unsigned short __mmask16; /* Rounding mode macros. */ #define _MM_FROUND_TO_NEAREST_INT 0x00 #define _MM_FROUND_TO_NEG_INF 0x01 #define _MM_FROUND_TO_POS_INF 0x02 #define _MM_FROUND_TO_ZERO 0x03 #define _MM_FROUND_CUR_DIRECTION 0x04 /* Constants for integer comparison predicates */ typedef enum { _MM_CMPINT_EQ, /* Equal */ _MM_CMPINT_LT, /* Less than */ _MM_CMPINT_LE, /* Less than or Equal */ _MM_CMPINT_UNUSED, _MM_CMPINT_NE, /* Not Equal */ _MM_CMPINT_NLT, /* Not Less than */ #define _MM_CMPINT_GE _MM_CMPINT_NLT /* Greater than or Equal */ _MM_CMPINT_NLE /* Not Less than or Equal */ #define _MM_CMPINT_GT _MM_CMPINT_NLE /* Greater than */ } _MM_CMPINT_ENUM; typedef enum { _MM_PERM_AAAA = 0x00, _MM_PERM_AAAB = 0x01, _MM_PERM_AAAC = 0x02, _MM_PERM_AAAD = 0x03, _MM_PERM_AABA = 0x04, _MM_PERM_AABB = 0x05, _MM_PERM_AABC = 0x06, _MM_PERM_AABD = 0x07, _MM_PERM_AACA = 0x08, _MM_PERM_AACB = 0x09, _MM_PERM_AACC = 0x0A, _MM_PERM_AACD = 0x0B, _MM_PERM_AADA = 0x0C, _MM_PERM_AADB = 0x0D, _MM_PERM_AADC = 0x0E, _MM_PERM_AADD = 0x0F, _MM_PERM_ABAA = 0x10, _MM_PERM_ABAB = 0x11, _MM_PERM_ABAC = 0x12, _MM_PERM_ABAD = 0x13, _MM_PERM_ABBA = 0x14, _MM_PERM_ABBB = 0x15, _MM_PERM_ABBC = 0x16, _MM_PERM_ABBD = 0x17, _MM_PERM_ABCA = 0x18, _MM_PERM_ABCB = 0x19, _MM_PERM_ABCC = 0x1A, _MM_PERM_ABCD = 0x1B, _MM_PERM_ABDA = 0x1C, _MM_PERM_ABDB = 0x1D, _MM_PERM_ABDC = 0x1E, _MM_PERM_ABDD = 0x1F, _MM_PERM_ACAA = 0x20, _MM_PERM_ACAB = 0x21, _MM_PERM_ACAC = 0x22, _MM_PERM_ACAD = 0x23, _MM_PERM_ACBA = 0x24, _MM_PERM_ACBB = 0x25, _MM_PERM_ACBC = 0x26, _MM_PERM_ACBD = 0x27, _MM_PERM_ACCA = 0x28, _MM_PERM_ACCB = 0x29, _MM_PERM_ACCC = 0x2A, _MM_PERM_ACCD = 0x2B, _MM_PERM_ACDA = 0x2C, _MM_PERM_ACDB = 0x2D, _MM_PERM_ACDC = 0x2E, _MM_PERM_ACDD = 0x2F, _MM_PERM_ADAA = 0x30, _MM_PERM_ADAB = 0x31, _MM_PERM_ADAC = 0x32, _MM_PERM_ADAD = 0x33, _MM_PERM_ADBA = 0x34, _MM_PERM_ADBB = 0x35, _MM_PERM_ADBC = 0x36, _MM_PERM_ADBD = 0x37, _MM_PERM_ADCA = 0x38, _MM_PERM_ADCB = 0x39, _MM_PERM_ADCC = 0x3A, _MM_PERM_ADCD = 0x3B, _MM_PERM_ADDA = 0x3C, _MM_PERM_ADDB = 0x3D, _MM_PERM_ADDC = 0x3E, _MM_PERM_ADDD = 0x3F, _MM_PERM_BAAA = 0x40, _MM_PERM_BAAB = 0x41, _MM_PERM_BAAC = 0x42, _MM_PERM_BAAD = 0x43, _MM_PERM_BABA = 0x44, _MM_PERM_BABB = 0x45, _MM_PERM_BABC = 0x46, _MM_PERM_BABD = 0x47, _MM_PERM_BACA = 0x48, _MM_PERM_BACB = 0x49, _MM_PERM_BACC = 0x4A, _MM_PERM_BACD = 0x4B, _MM_PERM_BADA = 0x4C, _MM_PERM_BADB = 0x4D, _MM_PERM_BADC = 0x4E, _MM_PERM_BADD = 0x4F, _MM_PERM_BBAA = 0x50, _MM_PERM_BBAB = 0x51, _MM_PERM_BBAC = 0x52, _MM_PERM_BBAD = 0x53, _MM_PERM_BBBA = 0x54, _MM_PERM_BBBB = 0x55, _MM_PERM_BBBC = 0x56, _MM_PERM_BBBD = 0x57, _MM_PERM_BBCA = 0x58, _MM_PERM_BBCB = 0x59, _MM_PERM_BBCC = 0x5A, _MM_PERM_BBCD = 0x5B, _MM_PERM_BBDA = 0x5C, _MM_PERM_BBDB = 0x5D, _MM_PERM_BBDC = 0x5E, _MM_PERM_BBDD = 0x5F, _MM_PERM_BCAA = 0x60, _MM_PERM_BCAB = 0x61, _MM_PERM_BCAC = 0x62, _MM_PERM_BCAD = 0x63, _MM_PERM_BCBA = 0x64, _MM_PERM_BCBB = 0x65, _MM_PERM_BCBC = 0x66, _MM_PERM_BCBD = 0x67, _MM_PERM_BCCA = 0x68, _MM_PERM_BCCB = 0x69, _MM_PERM_BCCC = 0x6A, _MM_PERM_BCCD = 0x6B, _MM_PERM_BCDA = 0x6C, _MM_PERM_BCDB = 0x6D, _MM_PERM_BCDC = 0x6E, _MM_PERM_BCDD = 0x6F, _MM_PERM_BDAA = 0x70, _MM_PERM_BDAB = 0x71, _MM_PERM_BDAC = 0x72, _MM_PERM_BDAD = 0x73, _MM_PERM_BDBA = 0x74, _MM_PERM_BDBB = 0x75, _MM_PERM_BDBC = 0x76, _MM_PERM_BDBD = 0x77, _MM_PERM_BDCA = 0x78, _MM_PERM_BDCB = 0x79, _MM_PERM_BDCC = 0x7A, _MM_PERM_BDCD = 0x7B, _MM_PERM_BDDA = 0x7C, _MM_PERM_BDDB = 0x7D, _MM_PERM_BDDC = 0x7E, _MM_PERM_BDDD = 0x7F, _MM_PERM_CAAA = 0x80, _MM_PERM_CAAB = 0x81, _MM_PERM_CAAC = 0x82, _MM_PERM_CAAD = 0x83, _MM_PERM_CABA = 0x84, _MM_PERM_CABB = 0x85, _MM_PERM_CABC = 0x86, _MM_PERM_CABD = 0x87, _MM_PERM_CACA = 0x88, _MM_PERM_CACB = 0x89, _MM_PERM_CACC = 0x8A, _MM_PERM_CACD = 0x8B, _MM_PERM_CADA = 0x8C, _MM_PERM_CADB = 0x8D, _MM_PERM_CADC = 0x8E, _MM_PERM_CADD = 0x8F, _MM_PERM_CBAA = 0x90, _MM_PERM_CBAB = 0x91, _MM_PERM_CBAC = 0x92, _MM_PERM_CBAD = 0x93, _MM_PERM_CBBA = 0x94, _MM_PERM_CBBB = 0x95, _MM_PERM_CBBC = 0x96, _MM_PERM_CBBD = 0x97, _MM_PERM_CBCA = 0x98, _MM_PERM_CBCB = 0x99, _MM_PERM_CBCC = 0x9A, _MM_PERM_CBCD = 0x9B, _MM_PERM_CBDA = 0x9C, _MM_PERM_CBDB = 0x9D, _MM_PERM_CBDC = 0x9E, _MM_PERM_CBDD = 0x9F, _MM_PERM_CCAA = 0xA0, _MM_PERM_CCAB = 0xA1, _MM_PERM_CCAC = 0xA2, _MM_PERM_CCAD = 0xA3, _MM_PERM_CCBA = 0xA4, _MM_PERM_CCBB = 0xA5, _MM_PERM_CCBC = 0xA6, _MM_PERM_CCBD = 0xA7, _MM_PERM_CCCA = 0xA8, _MM_PERM_CCCB = 0xA9, _MM_PERM_CCCC = 0xAA, _MM_PERM_CCCD = 0xAB, _MM_PERM_CCDA = 0xAC, _MM_PERM_CCDB = 0xAD, _MM_PERM_CCDC = 0xAE, _MM_PERM_CCDD = 0xAF, _MM_PERM_CDAA = 0xB0, _MM_PERM_CDAB = 0xB1, _MM_PERM_CDAC = 0xB2, _MM_PERM_CDAD = 0xB3, _MM_PERM_CDBA = 0xB4, _MM_PERM_CDBB = 0xB5, _MM_PERM_CDBC = 0xB6, _MM_PERM_CDBD = 0xB7, _MM_PERM_CDCA = 0xB8, _MM_PERM_CDCB = 0xB9, _MM_PERM_CDCC = 0xBA, _MM_PERM_CDCD = 0xBB, _MM_PERM_CDDA = 0xBC, _MM_PERM_CDDB = 0xBD, _MM_PERM_CDDC = 0xBE, _MM_PERM_CDDD = 0xBF, _MM_PERM_DAAA = 0xC0, _MM_PERM_DAAB = 0xC1, _MM_PERM_DAAC = 0xC2, _MM_PERM_DAAD = 0xC3, _MM_PERM_DABA = 0xC4, _MM_PERM_DABB = 0xC5, _MM_PERM_DABC = 0xC6, _MM_PERM_DABD = 0xC7, _MM_PERM_DACA = 0xC8, _MM_PERM_DACB = 0xC9, _MM_PERM_DACC = 0xCA, _MM_PERM_DACD = 0xCB, _MM_PERM_DADA = 0xCC, _MM_PERM_DADB = 0xCD, _MM_PERM_DADC = 0xCE, _MM_PERM_DADD = 0xCF, _MM_PERM_DBAA = 0xD0, _MM_PERM_DBAB = 0xD1, _MM_PERM_DBAC = 0xD2, _MM_PERM_DBAD = 0xD3, _MM_PERM_DBBA = 0xD4, _MM_PERM_DBBB = 0xD5, _MM_PERM_DBBC = 0xD6, _MM_PERM_DBBD = 0xD7, _MM_PERM_DBCA = 0xD8, _MM_PERM_DBCB = 0xD9, _MM_PERM_DBCC = 0xDA, _MM_PERM_DBCD = 0xDB, _MM_PERM_DBDA = 0xDC, _MM_PERM_DBDB = 0xDD, _MM_PERM_DBDC = 0xDE, _MM_PERM_DBDD = 0xDF, _MM_PERM_DCAA = 0xE0, _MM_PERM_DCAB = 0xE1, _MM_PERM_DCAC = 0xE2, _MM_PERM_DCAD = 0xE3, _MM_PERM_DCBA = 0xE4, _MM_PERM_DCBB = 0xE5, _MM_PERM_DCBC = 0xE6, _MM_PERM_DCBD = 0xE7, _MM_PERM_DCCA = 0xE8, _MM_PERM_DCCB = 0xE9, _MM_PERM_DCCC = 0xEA, _MM_PERM_DCCD = 0xEB, _MM_PERM_DCDA = 0xEC, _MM_PERM_DCDB = 0xED, _MM_PERM_DCDC = 0xEE, _MM_PERM_DCDD = 0xEF, _MM_PERM_DDAA = 0xF0, _MM_PERM_DDAB = 0xF1, _MM_PERM_DDAC = 0xF2, _MM_PERM_DDAD = 0xF3, _MM_PERM_DDBA = 0xF4, _MM_PERM_DDBB = 0xF5, _MM_PERM_DDBC = 0xF6, _MM_PERM_DDBD = 0xF7, _MM_PERM_DDCA = 0xF8, _MM_PERM_DDCB = 0xF9, _MM_PERM_DDCC = 0xFA, _MM_PERM_DDCD = 0xFB, _MM_PERM_DDDA = 0xFC, _MM_PERM_DDDB = 0xFD, _MM_PERM_DDDC = 0xFE, _MM_PERM_DDDD = 0xFF } _MM_PERM_ENUM; typedef enum { _MM_MANT_NORM_1_2, /* interval [1, 2) */ _MM_MANT_NORM_p5_2, /* interval [0.5, 2) */ _MM_MANT_NORM_p5_1, /* interval [0.5, 1) */ _MM_MANT_NORM_p75_1p5 /* interval [0.75, 1.5) */ } _MM_MANTISSA_NORM_ENUM; typedef enum { _MM_MANT_SIGN_src, /* sign = sign(SRC) */ _MM_MANT_SIGN_zero, /* sign = 0 */ _MM_MANT_SIGN_nan /* DEST = NaN if sign(SRC) = 1 */ } _MM_MANTISSA_SIGN_ENUM; /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("avx512f"))) /* Create vectors with repeated elements */ static __inline __m512i __DEFAULT_FN_ATTRS _mm512_setzero_si512(void) { return (__m512i)(__v8di){ 0, 0, 0, 0, 0, 0, 0, 0 }; } #define _mm512_setzero_epi32 _mm512_setzero_si512 static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_undefined_pd(void) { return (__m512d)__builtin_ia32_undef512(); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_undefined(void) { return (__m512)__builtin_ia32_undef512(); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_undefined_ps(void) { return (__m512)__builtin_ia32_undef512(); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_undefined_epi32(void) { return (__m512i)__builtin_ia32_undef512(); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_broadcastd_epi32 (__m128i __A) { return (__m512i)__builtin_shufflevector((__v4si) __A, (__v4si)_mm_undefined_si128(), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_broadcastd_epi32 (__m512i __O, __mmask16 __M, __m128i __A) { return (__m512i)__builtin_ia32_selectd_512(__M, (__v16si) _mm512_broadcastd_epi32(__A), (__v16si) __O); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_broadcastd_epi32 (__mmask16 __M, __m128i __A) { return (__m512i)__builtin_ia32_selectd_512(__M, (__v16si) _mm512_broadcastd_epi32(__A), (__v16si) _mm512_setzero_si512()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_broadcastq_epi64 (__m128i __A) { return (__m512i)__builtin_shufflevector((__v2di) __A, (__v2di) _mm_undefined_si128(), 0, 0, 0, 0, 0, 0, 0, 0); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_broadcastq_epi64 (__m512i __O, __mmask8 __M, __m128i __A) { return (__m512i)__builtin_ia32_selectq_512(__M, (__v8di) _mm512_broadcastq_epi64(__A), (__v8di) __O); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_broadcastq_epi64 (__mmask8 __M, __m128i __A) { return (__m512i)__builtin_ia32_selectq_512(__M, (__v8di) _mm512_broadcastq_epi64(__A), (__v8di) _mm512_setzero_si512()); } static __inline __m512 __DEFAULT_FN_ATTRS _mm512_setzero_ps(void) { return (__m512){ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; } #define _mm512_setzero _mm512_setzero_ps static __inline __m512d __DEFAULT_FN_ATTRS _mm512_setzero_pd(void) { return (__m512d){ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; } static __inline __m512 __DEFAULT_FN_ATTRS _mm512_set1_ps(float __w) { return (__m512){ __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w }; } static __inline __m512d __DEFAULT_FN_ATTRS _mm512_set1_pd(double __w) { return (__m512d){ __w, __w, __w, __w, __w, __w, __w, __w }; } static __inline __m512i __DEFAULT_FN_ATTRS _mm512_set1_epi8(char __w) { return (__m512i)(__v64qi){ __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w }; } static __inline __m512i __DEFAULT_FN_ATTRS _mm512_set1_epi16(short __w) { return (__m512i)(__v32hi){ __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w, __w }; } static __inline __m512i __DEFAULT_FN_ATTRS _mm512_set1_epi32(int __s) { return (__m512i)(__v16si){ __s, __s, __s, __s, __s, __s, __s, __s, __s, __s, __s, __s, __s, __s, __s, __s }; } static __inline __m512i __DEFAULT_FN_ATTRS _mm512_maskz_set1_epi32(__mmask16 __M, int __A) { return (__m512i)__builtin_ia32_selectd_512(__M, (__v16si)_mm512_set1_epi32(__A), (__v16si)_mm512_setzero_si512()); } static __inline __m512i __DEFAULT_FN_ATTRS _mm512_set1_epi64(long long __d) { return (__m512i)(__v8di){ __d, __d, __d, __d, __d, __d, __d, __d }; } #ifdef __x86_64__ static __inline __m512i __DEFAULT_FN_ATTRS _mm512_maskz_set1_epi64(__mmask8 __M, long long __A) { return (__m512i)__builtin_ia32_selectq_512(__M, (__v8di)_mm512_set1_epi64(__A), (__v8di)_mm512_setzero_si512()); } #endif # 342 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512fintrin.h" 3 static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_broadcastss_ps(__m128 __A) { return (__m512)__builtin_shufflevector((__v4sf) __A, (__v4sf)_mm_undefined_ps(), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } static __inline __m512i __DEFAULT_FN_ATTRS _mm512_set4_epi32 (int __A, int __B, int __C, int __D) { return (__m512i)(__v16si) { __D, __C, __B, __A, __D, __C, __B, __A, __D, __C, __B, __A, __D, __C, __B, __A }; } static __inline __m512i __DEFAULT_FN_ATTRS _mm512_set4_epi64 (long long __A, long long __B, long long __C, long long __D) { return (__m512i) (__v8di) { __D, __C, __B, __A, __D, __C, __B, __A }; } static __inline __m512d __DEFAULT_FN_ATTRS _mm512_set4_pd (double __A, double __B, double __C, double __D) { return (__m512d) { __D, __C, __B, __A, __D, __C, __B, __A }; } static __inline __m512 __DEFAULT_FN_ATTRS _mm512_set4_ps (float __A, float __B, float __C, float __D) { return (__m512) { __D, __C, __B, __A, __D, __C, __B, __A, __D, __C, __B, __A, __D, __C, __B, __A }; } #define _mm512_setr4_epi32(e0,e1,e2,e3) \ _mm512_set4_epi32((e3),(e2),(e1),(e0)) #define _mm512_setr4_epi64(e0,e1,e2,e3) \ _mm512_set4_epi64((e3),(e2),(e1),(e0)) #define _mm512_setr4_pd(e0,e1,e2,e3) \ _mm512_set4_pd((e3),(e2),(e1),(e0)) #define _mm512_setr4_ps(e0,e1,e2,e3) \ _mm512_set4_ps((e3),(e2),(e1),(e0)) static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_broadcastsd_pd(__m128d __A) { return (__m512d)__builtin_shufflevector((__v2df) __A, (__v2df) _mm_undefined_pd(), 0, 0, 0, 0, 0, 0, 0, 0); } /* Cast between vector types */ static __inline __m512d __DEFAULT_FN_ATTRS _mm512_castpd256_pd512(__m256d __a) { return __builtin_shufflevector(__a, __a, 0, 1, 2, 3, -1, -1, -1, -1); } static __inline __m512 __DEFAULT_FN_ATTRS _mm512_castps256_ps512(__m256 __a) { return __builtin_shufflevector(__a, __a, 0, 1, 2, 3, 4, 5, 6, 7, -1, -1, -1, -1, -1, -1, -1, -1); } static __inline __m128d __DEFAULT_FN_ATTRS _mm512_castpd512_pd128(__m512d __a) { return __builtin_shufflevector(__a, __a, 0, 1); } static __inline __m256d __DEFAULT_FN_ATTRS _mm512_castpd512_pd256 (__m512d __A) { return __builtin_shufflevector(__A, __A, 0, 1, 2, 3); } static __inline __m128 __DEFAULT_FN_ATTRS _mm512_castps512_ps128(__m512 __a) { return __builtin_shufflevector(__a, __a, 0, 1, 2, 3); } static __inline __m256 __DEFAULT_FN_ATTRS _mm512_castps512_ps256 (__m512 __A) { return __builtin_shufflevector(__A, __A, 0, 1, 2, 3, 4, 5, 6, 7); } static __inline __m512 __DEFAULT_FN_ATTRS _mm512_castpd_ps (__m512d __A) { return (__m512) (__A); } static __inline __m512i __DEFAULT_FN_ATTRS _mm512_castpd_si512 (__m512d __A) { return (__m512i) (__A); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_castpd128_pd512 (__m128d __A) { return __builtin_shufflevector( __A, __A, 0, 1, -1, -1, -1, -1, -1, -1); } static __inline __m512d __DEFAULT_FN_ATTRS _mm512_castps_pd (__m512 __A) { return (__m512d) (__A); } static __inline __m512i __DEFAULT_FN_ATTRS _mm512_castps_si512 (__m512 __A) { return (__m512i) (__A); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_castps128_ps512 (__m128 __A) { return __builtin_shufflevector( __A, __A, 0, 1, 2, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_castsi128_si512 (__m128i __A) { return __builtin_shufflevector( __A, __A, 0, 1, -1, -1, -1, -1, -1, -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_castsi256_si512 (__m256i __A) { return __builtin_shufflevector( __A, __A, 0, 1, 2, 3, -1, -1, -1, -1); } static __inline __m512 __DEFAULT_FN_ATTRS _mm512_castsi512_ps (__m512i __A) { return (__m512) (__A); } static __inline __m512d __DEFAULT_FN_ATTRS _mm512_castsi512_pd (__m512i __A) { return (__m512d) (__A); } static __inline __m128i __DEFAULT_FN_ATTRS _mm512_castsi512_si128 (__m512i __A) { return (__m128i)__builtin_shufflevector(__A, __A , 0, 1); } static __inline __m256i __DEFAULT_FN_ATTRS _mm512_castsi512_si256 (__m512i __A) { return (__m256i)__builtin_shufflevector(__A, __A , 0, 1, 2, 3); } static __inline__ __mmask16 __DEFAULT_FN_ATTRS _mm512_int2mask(int __a) { return (__mmask16)__a; } static __inline__ int __DEFAULT_FN_ATTRS _mm512_mask2int(__mmask16 __a) { return (int)__a; } /// \brief Constructs a 512-bit floating-point vector of [8 x double] from a /// 128-bit floating-point vector of [2 x double]. The lower 128 bits /// contain the value of the source vector. The upper 384 bits are set /// to zero. /// /// \headerfile /// /// This intrinsic has no corresponding instruction. /// /// \param __a /// A 128-bit vector of [2 x double]. /// \returns A 512-bit floating-point vector of [8 x double]. The lower 128 bits /// contain the value of the parameter. The upper 384 bits are set to zero. static __inline __m512d __DEFAULT_FN_ATTRS _mm512_zextpd128_pd512(__m128d __a) { return __builtin_shufflevector((__v2df)__a, (__v2df)_mm_setzero_pd(), 0, 1, 2, 3, 2, 3, 2, 3); } /// \brief Constructs a 512-bit floating-point vector of [8 x double] from a /// 256-bit floating-point vector of [4 x double]. The lower 256 bits /// contain the value of the source vector. The upper 256 bits are set /// to zero. /// /// \headerfile /// /// This intrinsic has no corresponding instruction. /// /// \param __a /// A 256-bit vector of [4 x double]. /// \returns A 512-bit floating-point vector of [8 x double]. The lower 256 bits /// contain the value of the parameter. The upper 256 bits are set to zero. static __inline __m512d __DEFAULT_FN_ATTRS _mm512_zextpd256_pd512(__m256d __a) { return __builtin_shufflevector((__v4df)__a, (__v4df)_mm256_setzero_pd(), 0, 1, 2, 3, 4, 5, 6, 7); } /// \brief Constructs a 512-bit floating-point vector of [16 x float] from a /// 128-bit floating-point vector of [4 x float]. The lower 128 bits contain /// the value of the source vector. The upper 384 bits are set to zero. /// /// \headerfile /// /// This intrinsic has no corresponding instruction. /// /// \param __a /// A 128-bit vector of [4 x float]. /// \returns A 512-bit floating-point vector of [16 x float]. The lower 128 bits /// contain the value of the parameter. The upper 384 bits are set to zero. static __inline __m512 __DEFAULT_FN_ATTRS _mm512_zextps128_ps512(__m128 __a) { return __builtin_shufflevector((__v4sf)__a, (__v4sf)_mm_setzero_ps(), 0, 1, 2, 3, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7); } /// \brief Constructs a 512-bit floating-point vector of [16 x float] from a /// 256-bit floating-point vector of [8 x float]. The lower 256 bits contain /// the value of the source vector. The upper 256 bits are set to zero. /// /// \headerfile /// /// This intrinsic has no corresponding instruction. /// /// \param __a /// A 256-bit vector of [8 x float]. /// \returns A 512-bit floating-point vector of [16 x float]. The lower 256 bits /// contain the value of the parameter. The upper 256 bits are set to zero. static __inline __m512 __DEFAULT_FN_ATTRS _mm512_zextps256_ps512(__m256 __a) { return __builtin_shufflevector((__v8sf)__a, (__v8sf)_mm256_setzero_ps(), 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); } /// \brief Constructs a 512-bit integer vector from a 128-bit integer vector. /// The lower 128 bits contain the value of the source vector. The upper /// 384 bits are set to zero. /// /// \headerfile /// /// This intrinsic has no corresponding instruction. /// /// \param __a /// A 128-bit integer vector. /// \returns A 512-bit integer vector. The lower 128 bits contain the value of /// the parameter. The upper 384 bits are set to zero. static __inline __m512i __DEFAULT_FN_ATTRS _mm512_zextsi128_si512(__m128i __a) { return __builtin_shufflevector((__v2di)__a, (__v2di)_mm_setzero_si128(), 0, 1, 2, 3, 2, 3, 2, 3); } /// \brief Constructs a 512-bit integer vector from a 256-bit integer vector. /// The lower 256 bits contain the value of the source vector. The upper /// 256 bits are set to zero. /// /// \headerfile /// /// This intrinsic has no corresponding instruction. /// /// \param __a /// A 256-bit integer vector. /// \returns A 512-bit integer vector. The lower 256 bits contain the value of /// the parameter. The upper 256 bits are set to zero. static __inline __m512i __DEFAULT_FN_ATTRS _mm512_zextsi256_si512(__m256i __a) { return __builtin_shufflevector((__v4di)__a, (__v4di)_mm256_setzero_si256(), 0, 1, 2, 3, 4, 5, 6, 7); } /* Bitwise operators */ static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_and_epi32(__m512i __a, __m512i __b) { return (__m512i)((__v16su)__a & (__v16su)__b); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_and_epi32(__m512i __src, __mmask16 __k, __m512i __a, __m512i __b) { return (__m512i)__builtin_ia32_selectd_512((__mmask16)__k, (__v16si) _mm512_and_epi32(__a, __b), (__v16si) __src); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_and_epi32(__mmask16 __k, __m512i __a, __m512i __b) { return (__m512i) _mm512_mask_and_epi32(_mm512_setzero_si512 (), __k, __a, __b); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_and_epi64(__m512i __a, __m512i __b) { return (__m512i)((__v8du)__a & (__v8du)__b); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_and_epi64(__m512i __src, __mmask8 __k, __m512i __a, __m512i __b) { return (__m512i) __builtin_ia32_selectq_512 ((__mmask8) __k, (__v8di) _mm512_and_epi64(__a, __b), (__v8di) __src); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_and_epi64(__mmask8 __k, __m512i __a, __m512i __b) { return (__m512i) _mm512_mask_and_epi64(_mm512_setzero_si512 (), __k, __a, __b); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_andnot_si512 (__m512i __A, __m512i __B) { return (__m512i)(~(__v8du)(__A) & (__v8du)__B); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_andnot_epi32 (__m512i __A, __m512i __B) { return (__m512i)(~(__v16su)(__A) & (__v16su)__B); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_andnot_epi32(__m512i __W, __mmask16 __U, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U, (__v16si)_mm512_andnot_epi32(__A, __B), (__v16si)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_andnot_epi32(__mmask16 __U, __m512i __A, __m512i __B) { return (__m512i)_mm512_mask_andnot_epi32(_mm512_setzero_si512(), __U, __A, __B); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_andnot_epi64(__m512i __A, __m512i __B) { return (__m512i)(~(__v8du)(__A) & (__v8du)__B); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_andnot_epi64(__m512i __W, __mmask8 __U, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U, (__v8di)_mm512_andnot_epi64(__A, __B), (__v8di)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_andnot_epi64(__mmask8 __U, __m512i __A, __m512i __B) { return (__m512i)_mm512_mask_andnot_epi64(_mm512_setzero_si512(), __U, __A, __B); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_or_epi32(__m512i __a, __m512i __b) { return (__m512i)((__v16su)__a | (__v16su)__b); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_or_epi32(__m512i __src, __mmask16 __k, __m512i __a, __m512i __b) { return (__m512i)__builtin_ia32_selectd_512((__mmask16)__k, (__v16si)_mm512_or_epi32(__a, __b), (__v16si)__src); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_or_epi32(__mmask16 __k, __m512i __a, __m512i __b) { return (__m512i)_mm512_mask_or_epi32(_mm512_setzero_si512(), __k, __a, __b); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_or_epi64(__m512i __a, __m512i __b) { return (__m512i)((__v8du)__a | (__v8du)__b); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_or_epi64(__m512i __src, __mmask8 __k, __m512i __a, __m512i __b) { return (__m512i)__builtin_ia32_selectq_512((__mmask8)__k, (__v8di)_mm512_or_epi64(__a, __b), (__v8di)__src); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_or_epi64(__mmask8 __k, __m512i __a, __m512i __b) { return (__m512i)_mm512_mask_or_epi64(_mm512_setzero_si512(), __k, __a, __b); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_xor_epi32(__m512i __a, __m512i __b) { return (__m512i)((__v16su)__a ^ (__v16su)__b); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_xor_epi32(__m512i __src, __mmask16 __k, __m512i __a, __m512i __b) { return (__m512i)__builtin_ia32_selectd_512((__mmask16)__k, (__v16si)_mm512_xor_epi32(__a, __b), (__v16si)__src); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_xor_epi32(__mmask16 __k, __m512i __a, __m512i __b) { return (__m512i)_mm512_mask_xor_epi32(_mm512_setzero_si512(), __k, __a, __b); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_xor_epi64(__m512i __a, __m512i __b) { return (__m512i)((__v8du)__a ^ (__v8du)__b); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_xor_epi64(__m512i __src, __mmask8 __k, __m512i __a, __m512i __b) { return (__m512i)__builtin_ia32_selectq_512((__mmask8)__k, (__v8di)_mm512_xor_epi64(__a, __b), (__v8di)__src); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_xor_epi64(__mmask8 __k, __m512i __a, __m512i __b) { return (__m512i)_mm512_mask_xor_epi64(_mm512_setzero_si512(), __k, __a, __b); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_and_si512(__m512i __a, __m512i __b) { return (__m512i)((__v8du)__a & (__v8du)__b); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_or_si512(__m512i __a, __m512i __b) { return (__m512i)((__v8du)__a | (__v8du)__b); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_xor_si512(__m512i __a, __m512i __b) { return (__m512i)((__v8du)__a ^ (__v8du)__b); } /* Arithmetic */ static __inline __m512d __DEFAULT_FN_ATTRS _mm512_add_pd(__m512d __a, __m512d __b) { return (__m512d)((__v8df)__a + (__v8df)__b); } static __inline __m512 __DEFAULT_FN_ATTRS _mm512_add_ps(__m512 __a, __m512 __b) { return (__m512)((__v16sf)__a + (__v16sf)__b); } static __inline __m512d __DEFAULT_FN_ATTRS _mm512_mul_pd(__m512d __a, __m512d __b) { return (__m512d)((__v8df)__a * (__v8df)__b); } static __inline __m512 __DEFAULT_FN_ATTRS _mm512_mul_ps(__m512 __a, __m512 __b) { return (__m512)((__v16sf)__a * (__v16sf)__b); } static __inline __m512d __DEFAULT_FN_ATTRS _mm512_sub_pd(__m512d __a, __m512d __b) { return (__m512d)((__v8df)__a - (__v8df)__b); } static __inline __m512 __DEFAULT_FN_ATTRS _mm512_sub_ps(__m512 __a, __m512 __b) { return (__m512)((__v16sf)__a - (__v16sf)__b); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_add_epi64 (__m512i __A, __m512i __B) { return (__m512i) ((__v8du) __A + (__v8du) __B); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_add_epi64(__m512i __W, __mmask8 __U, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U, (__v8di)_mm512_add_epi64(__A, __B), (__v8di)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_add_epi64(__mmask8 __U, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U, (__v8di)_mm512_add_epi64(__A, __B), (__v8di)_mm512_setzero_si512()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_sub_epi64 (__m512i __A, __m512i __B) { return (__m512i) ((__v8du) __A - (__v8du) __B); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_sub_epi64(__m512i __W, __mmask8 __U, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U, (__v8di)_mm512_sub_epi64(__A, __B), (__v8di)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_sub_epi64(__mmask8 __U, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U, (__v8di)_mm512_sub_epi64(__A, __B), (__v8di)_mm512_setzero_si512()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_add_epi32 (__m512i __A, __m512i __B) { return (__m512i) ((__v16su) __A + (__v16su) __B); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_add_epi32(__m512i __W, __mmask16 __U, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U, (__v16si)_mm512_add_epi32(__A, __B), (__v16si)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_add_epi32 (__mmask16 __U, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U, (__v16si)_mm512_add_epi32(__A, __B), (__v16si)_mm512_setzero_si512()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_sub_epi32 (__m512i __A, __m512i __B) { return (__m512i) ((__v16su) __A - (__v16su) __B); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_sub_epi32(__m512i __W, __mmask16 __U, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U, (__v16si)_mm512_sub_epi32(__A, __B), (__v16si)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_sub_epi32(__mmask16 __U, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U, (__v16si)_mm512_sub_epi32(__A, __B), (__v16si)_mm512_setzero_si512()); } #define _mm512_mask_max_round_pd(W, U, A, B, R) __extension__ ({ \ (__m512d)__builtin_ia32_maxpd512_mask((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), \ (__v8df)(__m512d)(W), (__mmask8)(U), \ (int)(R)); }) #define _mm512_maskz_max_round_pd(U, A, B, R) __extension__ ({ \ (__m512d)__builtin_ia32_maxpd512_mask((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), \ (__v8df)_mm512_setzero_pd(), \ (__mmask8)(U), (int)(R)); }) #define _mm512_max_round_pd(A, B, R) __extension__ ({ \ (__m512d)__builtin_ia32_maxpd512_mask((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), \ (__v8df)_mm512_undefined_pd(), \ (__mmask8)-1, (int)(R)); }) static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_max_pd(__m512d __A, __m512d __B) { return (__m512d) __builtin_ia32_maxpd512_mask ((__v8df) __A, (__v8df) __B, (__v8df) _mm512_setzero_pd (), (__mmask8) -1, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_mask_max_pd (__m512d __W, __mmask8 __U, __m512d __A, __m512d __B) { return (__m512d) __builtin_ia32_maxpd512_mask ((__v8df) __A, (__v8df) __B, (__v8df) __W, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_maskz_max_pd (__mmask8 __U, __m512d __A, __m512d __B) { return (__m512d) __builtin_ia32_maxpd512_mask ((__v8df) __A, (__v8df) __B, (__v8df) _mm512_setzero_pd (), (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm512_mask_max_round_ps(W, U, A, B, R) __extension__ ({ \ (__m512)__builtin_ia32_maxps512_mask((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), \ (__v16sf)(__m512)(W), (__mmask16)(U), \ (int)(R)); }) #define _mm512_maskz_max_round_ps(U, A, B, R) __extension__ ({ \ (__m512)__builtin_ia32_maxps512_mask((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), \ (__v16sf)_mm512_setzero_ps(), \ (__mmask16)(U), (int)(R)); }) #define _mm512_max_round_ps(A, B, R) __extension__ ({ \ (__m512)__builtin_ia32_maxps512_mask((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), \ (__v16sf)_mm512_undefined_ps(), \ (__mmask16)-1, (int)(R)); }) static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_max_ps(__m512 __A, __m512 __B) { return (__m512) __builtin_ia32_maxps512_mask ((__v16sf) __A, (__v16sf) __B, (__v16sf) _mm512_setzero_ps (), (__mmask16) -1, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_mask_max_ps (__m512 __W, __mmask16 __U, __m512 __A, __m512 __B) { return (__m512) __builtin_ia32_maxps512_mask ((__v16sf) __A, (__v16sf) __B, (__v16sf) __W, (__mmask16) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_maskz_max_ps (__mmask16 __U, __m512 __A, __m512 __B) { return (__m512) __builtin_ia32_maxps512_mask ((__v16sf) __A, (__v16sf) __B, (__v16sf) _mm512_setzero_ps (), (__mmask16) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask_max_ss(__m128 __W, __mmask8 __U,__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_maxss_round_mask ((__v4sf) __A, (__v4sf) __B, (__v4sf) __W, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maskz_max_ss(__mmask8 __U,__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_maxss_round_mask ((__v4sf) __A, (__v4sf) __B, (__v4sf) _mm_setzero_ps (), (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm_max_round_ss(A, B, R) __extension__ ({ \ (__m128)__builtin_ia32_maxss_round_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4sf)_mm_setzero_ps(), \ (__mmask8)-1, (int)(R)); }) #define _mm_mask_max_round_ss(W, U, A, B, R) __extension__ ({ \ (__m128)__builtin_ia32_maxss_round_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4sf)(__m128)(W), (__mmask8)(U), \ (int)(R)); }) #define _mm_maskz_max_round_ss(U, A, B, R) __extension__ ({ \ (__m128)__builtin_ia32_maxss_round_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4sf)_mm_setzero_ps(), \ (__mmask8)(U), (int)(R)); }) static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask_max_sd(__m128d __W, __mmask8 __U,__m128d __A, __m128d __B) { return (__m128d) __builtin_ia32_maxsd_round_mask ((__v2df) __A, (__v2df) __B, (__v2df) __W, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_maskz_max_sd(__mmask8 __U,__m128d __A, __m128d __B) { return (__m128d) __builtin_ia32_maxsd_round_mask ((__v2df) __A, (__v2df) __B, (__v2df) _mm_setzero_pd (), (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm_max_round_sd(A, B, R) __extension__ ({ \ (__m128d)__builtin_ia32_maxsd_round_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)_mm_setzero_pd(), \ (__mmask8)-1, (int)(R)); }) #define _mm_mask_max_round_sd(W, U, A, B, R) __extension__ ({ \ (__m128d)__builtin_ia32_maxsd_round_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)(__m128d)(W), \ (__mmask8)(U), (int)(R)); }) #define _mm_maskz_max_round_sd(U, A, B, R) __extension__ ({ \ (__m128d)__builtin_ia32_maxsd_round_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)_mm_setzero_pd(), \ (__mmask8)(U), (int)(R)); }) static __inline __m512i __DEFAULT_FN_ATTRS _mm512_max_epi32(__m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pmaxsd512_mask ((__v16si) __A, (__v16si) __B, (__v16si) _mm512_setzero_si512 (), (__mmask16) -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_max_epi32 (__m512i __W, __mmask16 __M, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pmaxsd512_mask ((__v16si) __A, (__v16si) __B, (__v16si) __W, __M); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_max_epi32 (__mmask16 __M, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pmaxsd512_mask ((__v16si) __A, (__v16si) __B, (__v16si) _mm512_setzero_si512 (), __M); } static __inline __m512i __DEFAULT_FN_ATTRS _mm512_max_epu32(__m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pmaxud512_mask ((__v16si) __A, (__v16si) __B, (__v16si) _mm512_setzero_si512 (), (__mmask16) -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_max_epu32 (__m512i __W, __mmask16 __M, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pmaxud512_mask ((__v16si) __A, (__v16si) __B, (__v16si) __W, __M); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_max_epu32 (__mmask16 __M, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pmaxud512_mask ((__v16si) __A, (__v16si) __B, (__v16si) _mm512_setzero_si512 (), __M); } static __inline __m512i __DEFAULT_FN_ATTRS _mm512_max_epi64(__m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pmaxsq512_mask ((__v8di) __A, (__v8di) __B, (__v8di) _mm512_setzero_si512 (), (__mmask8) -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_max_epi64 (__m512i __W, __mmask8 __M, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pmaxsq512_mask ((__v8di) __A, (__v8di) __B, (__v8di) __W, __M); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_max_epi64 (__mmask8 __M, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pmaxsq512_mask ((__v8di) __A, (__v8di) __B, (__v8di) _mm512_setzero_si512 (), __M); } static __inline __m512i __DEFAULT_FN_ATTRS _mm512_max_epu64(__m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pmaxuq512_mask ((__v8di) __A, (__v8di) __B, (__v8di) _mm512_setzero_si512 (), (__mmask8) -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_max_epu64 (__m512i __W, __mmask8 __M, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pmaxuq512_mask ((__v8di) __A, (__v8di) __B, (__v8di) __W, __M); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_max_epu64 (__mmask8 __M, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pmaxuq512_mask ((__v8di) __A, (__v8di) __B, (__v8di) _mm512_setzero_si512 (), __M); } #define _mm512_mask_min_round_pd(W, U, A, B, R) __extension__ ({ \ (__m512d)__builtin_ia32_minpd512_mask((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), \ (__v8df)(__m512d)(W), (__mmask8)(U), \ (int)(R)); }) #define _mm512_maskz_min_round_pd(U, A, B, R) __extension__ ({ \ (__m512d)__builtin_ia32_minpd512_mask((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), \ (__v8df)_mm512_setzero_pd(), \ (__mmask8)(U), (int)(R)); }) #define _mm512_min_round_pd(A, B, R) __extension__ ({ \ (__m512d)__builtin_ia32_minpd512_mask((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), \ (__v8df)_mm512_undefined_pd(), \ (__mmask8)-1, (int)(R)); }) static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_min_pd(__m512d __A, __m512d __B) { return (__m512d) __builtin_ia32_minpd512_mask ((__v8df) __A, (__v8df) __B, (__v8df) _mm512_setzero_pd (), (__mmask8) -1, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_mask_min_pd (__m512d __W, __mmask8 __U, __m512d __A, __m512d __B) { return (__m512d) __builtin_ia32_minpd512_mask ((__v8df) __A, (__v8df) __B, (__v8df) __W, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm512_mask_min_round_ps(W, U, A, B, R) __extension__ ({ \ (__m512)__builtin_ia32_minps512_mask((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), \ (__v16sf)(__m512)(W), (__mmask16)(U), \ (int)(R)); }) #define _mm512_maskz_min_round_ps(U, A, B, R) __extension__ ({ \ (__m512)__builtin_ia32_minps512_mask((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), \ (__v16sf)_mm512_setzero_ps(), \ (__mmask16)(U), (int)(R)); }) #define _mm512_min_round_ps(A, B, R) __extension__ ({ \ (__m512)__builtin_ia32_minps512_mask((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), \ (__v16sf)_mm512_undefined_ps(), \ (__mmask16)-1, (int)(R)); }) static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_maskz_min_pd (__mmask8 __U, __m512d __A, __m512d __B) { return (__m512d) __builtin_ia32_minpd512_mask ((__v8df) __A, (__v8df) __B, (__v8df) _mm512_setzero_pd (), (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_min_ps(__m512 __A, __m512 __B) { return (__m512) __builtin_ia32_minps512_mask ((__v16sf) __A, (__v16sf) __B, (__v16sf) _mm512_setzero_ps (), (__mmask16) -1, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_mask_min_ps (__m512 __W, __mmask16 __U, __m512 __A, __m512 __B) { return (__m512) __builtin_ia32_minps512_mask ((__v16sf) __A, (__v16sf) __B, (__v16sf) __W, (__mmask16) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_maskz_min_ps (__mmask16 __U, __m512 __A, __m512 __B) { return (__m512) __builtin_ia32_minps512_mask ((__v16sf) __A, (__v16sf) __B, (__v16sf) _mm512_setzero_ps (), (__mmask16) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask_min_ss(__m128 __W, __mmask8 __U,__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_minss_round_mask ((__v4sf) __A, (__v4sf) __B, (__v4sf) __W, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maskz_min_ss(__mmask8 __U,__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_minss_round_mask ((__v4sf) __A, (__v4sf) __B, (__v4sf) _mm_setzero_ps (), (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm_min_round_ss(A, B, R) __extension__ ({ \ (__m128)__builtin_ia32_minss_round_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4sf)_mm_setzero_ps(), \ (__mmask8)-1, (int)(R)); }) #define _mm_mask_min_round_ss(W, U, A, B, R) __extension__ ({ \ (__m128)__builtin_ia32_minss_round_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4sf)(__m128)(W), (__mmask8)(U), \ (int)(R)); }) #define _mm_maskz_min_round_ss(U, A, B, R) __extension__ ({ \ (__m128)__builtin_ia32_minss_round_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4sf)_mm_setzero_ps(), \ (__mmask8)(U), (int)(R)); }) static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask_min_sd(__m128d __W, __mmask8 __U,__m128d __A, __m128d __B) { return (__m128d) __builtin_ia32_minsd_round_mask ((__v2df) __A, (__v2df) __B, (__v2df) __W, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_maskz_min_sd(__mmask8 __U,__m128d __A, __m128d __B) { return (__m128d) __builtin_ia32_minsd_round_mask ((__v2df) __A, (__v2df) __B, (__v2df) _mm_setzero_pd (), (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm_min_round_sd(A, B, R) __extension__ ({ \ (__m128d)__builtin_ia32_minsd_round_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)_mm_setzero_pd(), \ (__mmask8)-1, (int)(R)); }) #define _mm_mask_min_round_sd(W, U, A, B, R) __extension__ ({ \ (__m128d)__builtin_ia32_minsd_round_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)(__m128d)(W), \ (__mmask8)(U), (int)(R)); }) #define _mm_maskz_min_round_sd(U, A, B, R) __extension__ ({ \ (__m128d)__builtin_ia32_minsd_round_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)_mm_setzero_pd(), \ (__mmask8)(U), (int)(R)); }) static __inline __m512i __DEFAULT_FN_ATTRS _mm512_min_epi32(__m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pminsd512_mask ((__v16si) __A, (__v16si) __B, (__v16si) _mm512_setzero_si512 (), (__mmask16) -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_min_epi32 (__m512i __W, __mmask16 __M, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pminsd512_mask ((__v16si) __A, (__v16si) __B, (__v16si) __W, __M); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_min_epi32 (__mmask16 __M, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pminsd512_mask ((__v16si) __A, (__v16si) __B, (__v16si) _mm512_setzero_si512 (), __M); } static __inline __m512i __DEFAULT_FN_ATTRS _mm512_min_epu32(__m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pminud512_mask ((__v16si) __A, (__v16si) __B, (__v16si) _mm512_setzero_si512 (), (__mmask16) -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_min_epu32 (__m512i __W, __mmask16 __M, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pminud512_mask ((__v16si) __A, (__v16si) __B, (__v16si) __W, __M); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_min_epu32 (__mmask16 __M, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pminud512_mask ((__v16si) __A, (__v16si) __B, (__v16si) _mm512_setzero_si512 (), __M); } static __inline __m512i __DEFAULT_FN_ATTRS _mm512_min_epi64(__m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pminsq512_mask ((__v8di) __A, (__v8di) __B, (__v8di) _mm512_setzero_si512 (), (__mmask8) -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_min_epi64 (__m512i __W, __mmask8 __M, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pminsq512_mask ((__v8di) __A, (__v8di) __B, (__v8di) __W, __M); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_min_epi64 (__mmask8 __M, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pminsq512_mask ((__v8di) __A, (__v8di) __B, (__v8di) _mm512_setzero_si512 (), __M); } static __inline __m512i __DEFAULT_FN_ATTRS _mm512_min_epu64(__m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pminuq512_mask ((__v8di) __A, (__v8di) __B, (__v8di) _mm512_setzero_si512 (), (__mmask8) -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_min_epu64 (__m512i __W, __mmask8 __M, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pminuq512_mask ((__v8di) __A, (__v8di) __B, (__v8di) __W, __M); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_min_epu64 (__mmask8 __M, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pminuq512_mask ((__v8di) __A, (__v8di) __B, (__v8di) _mm512_setzero_si512 (), __M); } static __inline __m512i __DEFAULT_FN_ATTRS _mm512_mul_epi32(__m512i __X, __m512i __Y) { return (__m512i)__builtin_ia32_pmuldq512((__v16si)__X, (__v16si) __Y); } static __inline __m512i __DEFAULT_FN_ATTRS _mm512_mask_mul_epi32(__m512i __W, __mmask8 __M, __m512i __X, __m512i __Y) { return (__m512i)__builtin_ia32_selectq_512((__mmask8)__M, (__v8di)_mm512_mul_epi32(__X, __Y), (__v8di)__W); } static __inline __m512i __DEFAULT_FN_ATTRS _mm512_maskz_mul_epi32(__mmask8 __M, __m512i __X, __m512i __Y) { return (__m512i)__builtin_ia32_selectq_512((__mmask8)__M, (__v8di)_mm512_mul_epi32(__X, __Y), (__v8di)_mm512_setzero_si512 ()); } static __inline __m512i __DEFAULT_FN_ATTRS _mm512_mul_epu32(__m512i __X, __m512i __Y) { return (__m512i)__builtin_ia32_pmuludq512((__v16si)__X, (__v16si)__Y); } static __inline __m512i __DEFAULT_FN_ATTRS _mm512_mask_mul_epu32(__m512i __W, __mmask8 __M, __m512i __X, __m512i __Y) { return (__m512i)__builtin_ia32_selectq_512((__mmask8)__M, (__v8di)_mm512_mul_epu32(__X, __Y), (__v8di)__W); } static __inline __m512i __DEFAULT_FN_ATTRS _mm512_maskz_mul_epu32(__mmask8 __M, __m512i __X, __m512i __Y) { return (__m512i)__builtin_ia32_selectq_512((__mmask8)__M, (__v8di)_mm512_mul_epu32(__X, __Y), (__v8di)_mm512_setzero_si512 ()); } static __inline __m512i __DEFAULT_FN_ATTRS _mm512_mullo_epi32 (__m512i __A, __m512i __B) { return (__m512i) ((__v16su) __A * (__v16su) __B); } static __inline __m512i __DEFAULT_FN_ATTRS _mm512_maskz_mullo_epi32(__mmask16 __M, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectd_512((__mmask16)__M, (__v16si)_mm512_mullo_epi32(__A, __B), (__v16si)_mm512_setzero_si512()); } static __inline __m512i __DEFAULT_FN_ATTRS _mm512_mask_mullo_epi32(__m512i __W, __mmask16 __M, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectd_512((__mmask16)__M, (__v16si)_mm512_mullo_epi32(__A, __B), (__v16si)__W); } #define _mm512_mask_sqrt_round_pd(W, U, A, R) __extension__ ({ \ (__m512d)__builtin_ia32_sqrtpd512_mask((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(W), (__mmask8)(U), \ (int)(R)); }) #define _mm512_maskz_sqrt_round_pd(U, A, R) __extension__ ({ \ (__m512d)__builtin_ia32_sqrtpd512_mask((__v8df)(__m512d)(A), \ (__v8df)_mm512_setzero_pd(), \ (__mmask8)(U), (int)(R)); }) #define _mm512_sqrt_round_pd(A, R) __extension__ ({ \ (__m512d)__builtin_ia32_sqrtpd512_mask((__v8df)(__m512d)(A), \ (__v8df)_mm512_undefined_pd(), \ (__mmask8)-1, (int)(R)); }) static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_sqrt_pd(__m512d __a) { return (__m512d)__builtin_ia32_sqrtpd512_mask((__v8df)__a, (__v8df) _mm512_setzero_pd (), (__mmask8) -1, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_mask_sqrt_pd (__m512d __W, __mmask8 __U, __m512d __A) { return (__m512d) __builtin_ia32_sqrtpd512_mask ((__v8df) __A, (__v8df) __W, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_maskz_sqrt_pd (__mmask8 __U, __m512d __A) { return (__m512d) __builtin_ia32_sqrtpd512_mask ((__v8df) __A, (__v8df) _mm512_setzero_pd (), (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm512_mask_sqrt_round_ps(W, U, A, R) __extension__ ({ \ (__m512)__builtin_ia32_sqrtps512_mask((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(W), (__mmask16)(U), \ (int)(R)); }) #define _mm512_maskz_sqrt_round_ps(U, A, R) __extension__ ({ \ (__m512)__builtin_ia32_sqrtps512_mask((__v16sf)(__m512)(A), \ (__v16sf)_mm512_setzero_ps(), \ (__mmask16)(U), (int)(R)); }) #define _mm512_sqrt_round_ps(A, R) __extension__ ({ \ (__m512)__builtin_ia32_sqrtps512_mask((__v16sf)(__m512)(A), \ (__v16sf)_mm512_undefined_ps(), \ (__mmask16)-1, (int)(R)); }) static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_sqrt_ps(__m512 __a) { return (__m512)__builtin_ia32_sqrtps512_mask((__v16sf)__a, (__v16sf) _mm512_setzero_ps (), (__mmask16) -1, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_mask_sqrt_ps(__m512 __W, __mmask16 __U, __m512 __A) { return (__m512)__builtin_ia32_sqrtps512_mask((__v16sf)__A, (__v16sf) __W, (__mmask16) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_maskz_sqrt_ps( __mmask16 __U, __m512 __A) { return (__m512)__builtin_ia32_sqrtps512_mask((__v16sf)__A, (__v16sf) _mm512_setzero_ps (), (__mmask16) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_rsqrt14_pd(__m512d __A) { return (__m512d) __builtin_ia32_rsqrt14pd512_mask ((__v8df) __A, (__v8df) _mm512_setzero_pd (), (__mmask8) -1);} static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_mask_rsqrt14_pd (__m512d __W, __mmask8 __U, __m512d __A) { return (__m512d) __builtin_ia32_rsqrt14pd512_mask ((__v8df) __A, (__v8df) __W, (__mmask8) __U); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_maskz_rsqrt14_pd (__mmask8 __U, __m512d __A) { return (__m512d) __builtin_ia32_rsqrt14pd512_mask ((__v8df) __A, (__v8df) _mm512_setzero_pd (), (__mmask8) __U); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_rsqrt14_ps(__m512 __A) { return (__m512) __builtin_ia32_rsqrt14ps512_mask ((__v16sf) __A, (__v16sf) _mm512_setzero_ps (), (__mmask16) -1); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_mask_rsqrt14_ps (__m512 __W, __mmask16 __U, __m512 __A) { return (__m512) __builtin_ia32_rsqrt14ps512_mask ((__v16sf) __A, (__v16sf) __W, (__mmask16) __U); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_maskz_rsqrt14_ps (__mmask16 __U, __m512 __A) { return (__m512) __builtin_ia32_rsqrt14ps512_mask ((__v16sf) __A, (__v16sf) _mm512_setzero_ps (), (__mmask16) __U); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_rsqrt14_ss(__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_rsqrt14ss_mask ((__v4sf) __A, (__v4sf) __B, (__v4sf) _mm_setzero_ps (), (__mmask8) -1); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask_rsqrt14_ss (__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) { return (__m128) __builtin_ia32_rsqrt14ss_mask ((__v4sf) __A, (__v4sf) __B, (__v4sf) __W, (__mmask8) __U); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maskz_rsqrt14_ss (__mmask8 __U, __m128 __A, __m128 __B) { return (__m128) __builtin_ia32_rsqrt14ss_mask ((__v4sf) __A, (__v4sf) __B, (__v4sf) _mm_setzero_ps (), (__mmask8) __U); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_rsqrt14_sd(__m128d __A, __m128d __B) { return (__m128d) __builtin_ia32_rsqrt14sd_mask ((__v2df) __A, (__v2df) __B, (__v2df) _mm_setzero_pd (), (__mmask8) -1); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask_rsqrt14_sd (__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) { return (__m128d) __builtin_ia32_rsqrt14sd_mask ( (__v2df) __A, (__v2df) __B, (__v2df) __W, (__mmask8) __U); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_maskz_rsqrt14_sd (__mmask8 __U, __m128d __A, __m128d __B) { return (__m128d) __builtin_ia32_rsqrt14sd_mask ( (__v2df) __A, (__v2df) __B, (__v2df) _mm_setzero_pd (), (__mmask8) __U); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_rcp14_pd(__m512d __A) { return (__m512d) __builtin_ia32_rcp14pd512_mask ((__v8df) __A, (__v8df) _mm512_setzero_pd (), (__mmask8) -1); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_mask_rcp14_pd (__m512d __W, __mmask8 __U, __m512d __A) { return (__m512d) __builtin_ia32_rcp14pd512_mask ((__v8df) __A, (__v8df) __W, (__mmask8) __U); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_maskz_rcp14_pd (__mmask8 __U, __m512d __A) { return (__m512d) __builtin_ia32_rcp14pd512_mask ((__v8df) __A, (__v8df) _mm512_setzero_pd (), (__mmask8) __U); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_rcp14_ps(__m512 __A) { return (__m512) __builtin_ia32_rcp14ps512_mask ((__v16sf) __A, (__v16sf) _mm512_setzero_ps (), (__mmask16) -1); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_mask_rcp14_ps (__m512 __W, __mmask16 __U, __m512 __A) { return (__m512) __builtin_ia32_rcp14ps512_mask ((__v16sf) __A, (__v16sf) __W, (__mmask16) __U); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_maskz_rcp14_ps (__mmask16 __U, __m512 __A) { return (__m512) __builtin_ia32_rcp14ps512_mask ((__v16sf) __A, (__v16sf) _mm512_setzero_ps (), (__mmask16) __U); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_rcp14_ss(__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_rcp14ss_mask ((__v4sf) __A, (__v4sf) __B, (__v4sf) _mm_setzero_ps (), (__mmask8) -1); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask_rcp14_ss (__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) { return (__m128) __builtin_ia32_rcp14ss_mask ((__v4sf) __A, (__v4sf) __B, (__v4sf) __W, (__mmask8) __U); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maskz_rcp14_ss (__mmask8 __U, __m128 __A, __m128 __B) { return (__m128) __builtin_ia32_rcp14ss_mask ((__v4sf) __A, (__v4sf) __B, (__v4sf) _mm_setzero_ps (), (__mmask8) __U); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_rcp14_sd(__m128d __A, __m128d __B) { return (__m128d) __builtin_ia32_rcp14sd_mask ((__v2df) __A, (__v2df) __B, (__v2df) _mm_setzero_pd (), (__mmask8) -1); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask_rcp14_sd (__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) { return (__m128d) __builtin_ia32_rcp14sd_mask ( (__v2df) __A, (__v2df) __B, (__v2df) __W, (__mmask8) __U); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_maskz_rcp14_sd (__mmask8 __U, __m128d __A, __m128d __B) { return (__m128d) __builtin_ia32_rcp14sd_mask ( (__v2df) __A, (__v2df) __B, (__v2df) _mm_setzero_pd (), (__mmask8) __U); } static __inline __m512 __DEFAULT_FN_ATTRS _mm512_floor_ps(__m512 __A) { return (__m512) __builtin_ia32_rndscaleps_mask ((__v16sf) __A, _MM_FROUND_FLOOR, (__v16sf) __A, -1, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_mask_floor_ps (__m512 __W, __mmask16 __U, __m512 __A) { return (__m512) __builtin_ia32_rndscaleps_mask ((__v16sf) __A, _MM_FROUND_FLOOR, (__v16sf) __W, __U, _MM_FROUND_CUR_DIRECTION); } static __inline __m512d __DEFAULT_FN_ATTRS _mm512_floor_pd(__m512d __A) { return (__m512d) __builtin_ia32_rndscalepd_mask ((__v8df) __A, _MM_FROUND_FLOOR, (__v8df) __A, -1, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_mask_floor_pd (__m512d __W, __mmask8 __U, __m512d __A) { return (__m512d) __builtin_ia32_rndscalepd_mask ((__v8df) __A, _MM_FROUND_FLOOR, (__v8df) __W, __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_mask_ceil_ps (__m512 __W, __mmask16 __U, __m512 __A) { return (__m512) __builtin_ia32_rndscaleps_mask ((__v16sf) __A, _MM_FROUND_CEIL, (__v16sf) __W, __U, _MM_FROUND_CUR_DIRECTION); } static __inline __m512 __DEFAULT_FN_ATTRS _mm512_ceil_ps(__m512 __A) { return (__m512) __builtin_ia32_rndscaleps_mask ((__v16sf) __A, _MM_FROUND_CEIL, (__v16sf) __A, -1, _MM_FROUND_CUR_DIRECTION); } static __inline __m512d __DEFAULT_FN_ATTRS _mm512_ceil_pd(__m512d __A) { return (__m512d) __builtin_ia32_rndscalepd_mask ((__v8df) __A, _MM_FROUND_CEIL, (__v8df) __A, -1, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_mask_ceil_pd (__m512d __W, __mmask8 __U, __m512d __A) { return (__m512d) __builtin_ia32_rndscalepd_mask ((__v8df) __A, _MM_FROUND_CEIL, (__v8df) __W, __U, _MM_FROUND_CUR_DIRECTION); } static __inline __m512i __DEFAULT_FN_ATTRS _mm512_abs_epi64(__m512i __A) { return (__m512i) __builtin_ia32_pabsq512_mask ((__v8di) __A, (__v8di) _mm512_setzero_si512 (), (__mmask8) -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_abs_epi64 (__m512i __W, __mmask8 __U, __m512i __A) { return (__m512i) __builtin_ia32_pabsq512_mask ((__v8di) __A, (__v8di) __W, (__mmask8) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_abs_epi64 (__mmask8 __U, __m512i __A) { return (__m512i) __builtin_ia32_pabsq512_mask ((__v8di) __A, (__v8di) _mm512_setzero_si512 (), (__mmask8) __U); } static __inline __m512i __DEFAULT_FN_ATTRS _mm512_abs_epi32(__m512i __A) { return (__m512i) __builtin_ia32_pabsd512_mask ((__v16si) __A, (__v16si) _mm512_setzero_si512 (), (__mmask16) -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_abs_epi32 (__m512i __W, __mmask16 __U, __m512i __A) { return (__m512i) __builtin_ia32_pabsd512_mask ((__v16si) __A, (__v16si) __W, (__mmask16) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_abs_epi32 (__mmask16 __U, __m512i __A) { return (__m512i) __builtin_ia32_pabsd512_mask ((__v16si) __A, (__v16si) _mm512_setzero_si512 (), (__mmask16) __U); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask_add_ss(__m128 __W, __mmask8 __U,__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_addss_round_mask ((__v4sf) __A, (__v4sf) __B, (__v4sf) __W, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maskz_add_ss(__mmask8 __U,__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_addss_round_mask ((__v4sf) __A, (__v4sf) __B, (__v4sf) _mm_setzero_ps (), (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm_add_round_ss(A, B, R) __extension__ ({ \ (__m128)__builtin_ia32_addss_round_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4sf)_mm_setzero_ps(), \ (__mmask8)-1, (int)(R)); }) #define _mm_mask_add_round_ss(W, U, A, B, R) __extension__ ({ \ (__m128)__builtin_ia32_addss_round_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4sf)(__m128)(W), (__mmask8)(U), \ (int)(R)); }) #define _mm_maskz_add_round_ss(U, A, B, R) __extension__ ({ \ (__m128)__builtin_ia32_addss_round_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4sf)_mm_setzero_ps(), \ (__mmask8)(U), (int)(R)); }) static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask_add_sd(__m128d __W, __mmask8 __U,__m128d __A, __m128d __B) { return (__m128d) __builtin_ia32_addsd_round_mask ((__v2df) __A, (__v2df) __B, (__v2df) __W, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_maskz_add_sd(__mmask8 __U,__m128d __A, __m128d __B) { return (__m128d) __builtin_ia32_addsd_round_mask ((__v2df) __A, (__v2df) __B, (__v2df) _mm_setzero_pd (), (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm_add_round_sd(A, B, R) __extension__ ({ \ (__m128d)__builtin_ia32_addsd_round_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)_mm_setzero_pd(), \ (__mmask8)-1, (int)(R)); }) #define _mm_mask_add_round_sd(W, U, A, B, R) __extension__ ({ \ (__m128d)__builtin_ia32_addsd_round_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)(__m128d)(W), \ (__mmask8)(U), (int)(R)); }) #define _mm_maskz_add_round_sd(U, A, B, R) __extension__ ({ \ (__m128d)__builtin_ia32_addsd_round_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)_mm_setzero_pd(), \ (__mmask8)(U), (int)(R)); }) static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_mask_add_pd(__m512d __W, __mmask8 __U, __m512d __A, __m512d __B) { return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U, (__v8df)_mm512_add_pd(__A, __B), (__v8df)__W); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_maskz_add_pd(__mmask8 __U, __m512d __A, __m512d __B) { return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U, (__v8df)_mm512_add_pd(__A, __B), (__v8df)_mm512_setzero_pd()); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_mask_add_ps(__m512 __W, __mmask16 __U, __m512 __A, __m512 __B) { return (__m512)__builtin_ia32_selectps_512((__mmask16)__U, (__v16sf)_mm512_add_ps(__A, __B), (__v16sf)__W); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_maskz_add_ps(__mmask16 __U, __m512 __A, __m512 __B) { return (__m512)__builtin_ia32_selectps_512((__mmask16)__U, (__v16sf)_mm512_add_ps(__A, __B), (__v16sf)_mm512_setzero_ps()); } #define _mm512_add_round_pd(A, B, R) __extension__ ({ \ (__m512d)__builtin_ia32_addpd512_mask((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), \ (__v8df)_mm512_setzero_pd(), \ (__mmask8)-1, (int)(R)); }) #define _mm512_mask_add_round_pd(W, U, A, B, R) __extension__ ({ \ (__m512d)__builtin_ia32_addpd512_mask((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), \ (__v8df)(__m512d)(W), (__mmask8)(U), \ (int)(R)); }) #define _mm512_maskz_add_round_pd(U, A, B, R) __extension__ ({ \ (__m512d)__builtin_ia32_addpd512_mask((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), \ (__v8df)_mm512_setzero_pd(), \ (__mmask8)(U), (int)(R)); }) #define _mm512_add_round_ps(A, B, R) __extension__ ({ \ (__m512)__builtin_ia32_addps512_mask((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), \ (__v16sf)_mm512_setzero_ps(), \ (__mmask16)-1, (int)(R)); }) #define _mm512_mask_add_round_ps(W, U, A, B, R) __extension__ ({ \ (__m512)__builtin_ia32_addps512_mask((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), \ (__v16sf)(__m512)(W), (__mmask16)(U), \ (int)(R)); }) #define _mm512_maskz_add_round_ps(U, A, B, R) __extension__ ({ \ (__m512)__builtin_ia32_addps512_mask((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), \ (__v16sf)_mm512_setzero_ps(), \ (__mmask16)(U), (int)(R)); }) static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask_sub_ss(__m128 __W, __mmask8 __U,__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_subss_round_mask ((__v4sf) __A, (__v4sf) __B, (__v4sf) __W, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maskz_sub_ss(__mmask8 __U,__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_subss_round_mask ((__v4sf) __A, (__v4sf) __B, (__v4sf) _mm_setzero_ps (), (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm_sub_round_ss(A, B, R) __extension__ ({ \ (__m128)__builtin_ia32_subss_round_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4sf)_mm_setzero_ps(), \ (__mmask8)-1, (int)(R)); }) #define _mm_mask_sub_round_ss(W, U, A, B, R) __extension__ ({ \ (__m128)__builtin_ia32_subss_round_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4sf)(__m128)(W), (__mmask8)(U), \ (int)(R)); }) #define _mm_maskz_sub_round_ss(U, A, B, R) __extension__ ({ \ (__m128)__builtin_ia32_subss_round_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4sf)_mm_setzero_ps(), \ (__mmask8)(U), (int)(R)); }) static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask_sub_sd(__m128d __W, __mmask8 __U,__m128d __A, __m128d __B) { return (__m128d) __builtin_ia32_subsd_round_mask ((__v2df) __A, (__v2df) __B, (__v2df) __W, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_maskz_sub_sd(__mmask8 __U,__m128d __A, __m128d __B) { return (__m128d) __builtin_ia32_subsd_round_mask ((__v2df) __A, (__v2df) __B, (__v2df) _mm_setzero_pd (), (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm_sub_round_sd(A, B, R) __extension__ ({ \ (__m128d)__builtin_ia32_subsd_round_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)_mm_setzero_pd(), \ (__mmask8)-1, (int)(R)); }) #define _mm_mask_sub_round_sd(W, U, A, B, R) __extension__ ({ \ (__m128d)__builtin_ia32_subsd_round_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)(__m128d)(W), \ (__mmask8)(U), (int)(R)); }) #define _mm_maskz_sub_round_sd(U, A, B, R) __extension__ ({ \ (__m128d)__builtin_ia32_subsd_round_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)_mm_setzero_pd(), \ (__mmask8)(U), (int)(R)); }) static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_mask_sub_pd(__m512d __W, __mmask8 __U, __m512d __A, __m512d __B) { return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U, (__v8df)_mm512_sub_pd(__A, __B), (__v8df)__W); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_maskz_sub_pd(__mmask8 __U, __m512d __A, __m512d __B) { return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U, (__v8df)_mm512_sub_pd(__A, __B), (__v8df)_mm512_setzero_pd()); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_mask_sub_ps(__m512 __W, __mmask16 __U, __m512 __A, __m512 __B) { return (__m512)__builtin_ia32_selectps_512((__mmask16)__U, (__v16sf)_mm512_sub_ps(__A, __B), (__v16sf)__W); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_maskz_sub_ps(__mmask16 __U, __m512 __A, __m512 __B) { return (__m512)__builtin_ia32_selectps_512((__mmask16)__U, (__v16sf)_mm512_sub_ps(__A, __B), (__v16sf)_mm512_setzero_ps()); } #define _mm512_sub_round_pd(A, B, R) __extension__ ({ \ (__m512d)__builtin_ia32_subpd512_mask((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), \ (__v8df)_mm512_setzero_pd(), \ (__mmask8)-1, (int)(R)); }) #define _mm512_mask_sub_round_pd(W, U, A, B, R) __extension__ ({ \ (__m512d)__builtin_ia32_subpd512_mask((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), \ (__v8df)(__m512d)(W), (__mmask8)(U), \ (int)(R)); }) #define _mm512_maskz_sub_round_pd(U, A, B, R) __extension__ ({ \ (__m512d)__builtin_ia32_subpd512_mask((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), \ (__v8df)_mm512_setzero_pd(), \ (__mmask8)(U), (int)(R)); }) #define _mm512_sub_round_ps(A, B, R) __extension__ ({ \ (__m512)__builtin_ia32_subps512_mask((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), \ (__v16sf)_mm512_setzero_ps(), \ (__mmask16)-1, (int)(R)); }) #define _mm512_mask_sub_round_ps(W, U, A, B, R) __extension__ ({ \ (__m512)__builtin_ia32_subps512_mask((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), \ (__v16sf)(__m512)(W), (__mmask16)(U), \ (int)(R)); }); #define _mm512_maskz_sub_round_ps(U, A, B, R) __extension__ ({ \ (__m512)__builtin_ia32_subps512_mask((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), \ (__v16sf)_mm512_setzero_ps(), \ (__mmask16)(U), (int)(R)); }); static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask_mul_ss(__m128 __W, __mmask8 __U,__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_mulss_round_mask ((__v4sf) __A, (__v4sf) __B, (__v4sf) __W, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maskz_mul_ss(__mmask8 __U,__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_mulss_round_mask ((__v4sf) __A, (__v4sf) __B, (__v4sf) _mm_setzero_ps (), (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm_mul_round_ss(A, B, R) __extension__ ({ \ (__m128)__builtin_ia32_mulss_round_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4sf)_mm_setzero_ps(), \ (__mmask8)-1, (int)(R)); }) #define _mm_mask_mul_round_ss(W, U, A, B, R) __extension__ ({ \ (__m128)__builtin_ia32_mulss_round_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4sf)(__m128)(W), (__mmask8)(U), \ (int)(R)); }) #define _mm_maskz_mul_round_ss(U, A, B, R) __extension__ ({ \ (__m128)__builtin_ia32_mulss_round_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4sf)_mm_setzero_ps(), \ (__mmask8)(U), (int)(R)); }) static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask_mul_sd(__m128d __W, __mmask8 __U,__m128d __A, __m128d __B) { return (__m128d) __builtin_ia32_mulsd_round_mask ((__v2df) __A, (__v2df) __B, (__v2df) __W, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_maskz_mul_sd(__mmask8 __U,__m128d __A, __m128d __B) { return (__m128d) __builtin_ia32_mulsd_round_mask ((__v2df) __A, (__v2df) __B, (__v2df) _mm_setzero_pd (), (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm_mul_round_sd(A, B, R) __extension__ ({ \ (__m128d)__builtin_ia32_mulsd_round_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)_mm_setzero_pd(), \ (__mmask8)-1, (int)(R)); }) #define _mm_mask_mul_round_sd(W, U, A, B, R) __extension__ ({ \ (__m128d)__builtin_ia32_mulsd_round_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)(__m128d)(W), \ (__mmask8)(U), (int)(R)); }) #define _mm_maskz_mul_round_sd(U, A, B, R) __extension__ ({ \ (__m128d)__builtin_ia32_mulsd_round_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)_mm_setzero_pd(), \ (__mmask8)(U), (int)(R)); }) static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_mask_mul_pd(__m512d __W, __mmask8 __U, __m512d __A, __m512d __B) { return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U, (__v8df)_mm512_mul_pd(__A, __B), (__v8df)__W); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_maskz_mul_pd(__mmask8 __U, __m512d __A, __m512d __B) { return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U, (__v8df)_mm512_mul_pd(__A, __B), (__v8df)_mm512_setzero_pd()); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_mask_mul_ps(__m512 __W, __mmask16 __U, __m512 __A, __m512 __B) { return (__m512)__builtin_ia32_selectps_512((__mmask16)__U, (__v16sf)_mm512_mul_ps(__A, __B), (__v16sf)__W); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_maskz_mul_ps(__mmask16 __U, __m512 __A, __m512 __B) { return (__m512)__builtin_ia32_selectps_512((__mmask16)__U, (__v16sf)_mm512_mul_ps(__A, __B), (__v16sf)_mm512_setzero_ps()); } #define _mm512_mul_round_pd(A, B, R) __extension__ ({ \ (__m512d)__builtin_ia32_mulpd512_mask((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), \ (__v8df)_mm512_setzero_pd(), \ (__mmask8)-1, (int)(R)); }) #define _mm512_mask_mul_round_pd(W, U, A, B, R) __extension__ ({ \ (__m512d)__builtin_ia32_mulpd512_mask((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), \ (__v8df)(__m512d)(W), (__mmask8)(U), \ (int)(R)); }) #define _mm512_maskz_mul_round_pd(U, A, B, R) __extension__ ({ \ (__m512d)__builtin_ia32_mulpd512_mask((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), \ (__v8df)_mm512_setzero_pd(), \ (__mmask8)(U), (int)(R)); }) #define _mm512_mul_round_ps(A, B, R) __extension__ ({ \ (__m512)__builtin_ia32_mulps512_mask((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), \ (__v16sf)_mm512_setzero_ps(), \ (__mmask16)-1, (int)(R)); }) #define _mm512_mask_mul_round_ps(W, U, A, B, R) __extension__ ({ \ (__m512)__builtin_ia32_mulps512_mask((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), \ (__v16sf)(__m512)(W), (__mmask16)(U), \ (int)(R)); }); #define _mm512_maskz_mul_round_ps(U, A, B, R) __extension__ ({ \ (__m512)__builtin_ia32_mulps512_mask((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), \ (__v16sf)_mm512_setzero_ps(), \ (__mmask16)(U), (int)(R)); }); static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask_div_ss(__m128 __W, __mmask8 __U,__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_divss_round_mask ((__v4sf) __A, (__v4sf) __B, (__v4sf) __W, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maskz_div_ss(__mmask8 __U,__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_divss_round_mask ((__v4sf) __A, (__v4sf) __B, (__v4sf) _mm_setzero_ps (), (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm_div_round_ss(A, B, R) __extension__ ({ \ (__m128)__builtin_ia32_divss_round_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4sf)_mm_setzero_ps(), \ (__mmask8)-1, (int)(R)); }) #define _mm_mask_div_round_ss(W, U, A, B, R) __extension__ ({ \ (__m128)__builtin_ia32_divss_round_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4sf)(__m128)(W), (__mmask8)(U), \ (int)(R)); }) #define _mm_maskz_div_round_ss(U, A, B, R) __extension__ ({ \ (__m128)__builtin_ia32_divss_round_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4sf)_mm_setzero_ps(), \ (__mmask8)(U), (int)(R)); }) static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask_div_sd(__m128d __W, __mmask8 __U,__m128d __A, __m128d __B) { return (__m128d) __builtin_ia32_divsd_round_mask ((__v2df) __A, (__v2df) __B, (__v2df) __W, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_maskz_div_sd(__mmask8 __U,__m128d __A, __m128d __B) { return (__m128d) __builtin_ia32_divsd_round_mask ((__v2df) __A, (__v2df) __B, (__v2df) _mm_setzero_pd (), (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm_div_round_sd(A, B, R) __extension__ ({ \ (__m128d)__builtin_ia32_divsd_round_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)_mm_setzero_pd(), \ (__mmask8)-1, (int)(R)); }) #define _mm_mask_div_round_sd(W, U, A, B, R) __extension__ ({ \ (__m128d)__builtin_ia32_divsd_round_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)(__m128d)(W), \ (__mmask8)(U), (int)(R)); }) #define _mm_maskz_div_round_sd(U, A, B, R) __extension__ ({ \ (__m128d)__builtin_ia32_divsd_round_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)_mm_setzero_pd(), \ (__mmask8)(U), (int)(R)); }) static __inline __m512d __DEFAULT_FN_ATTRS _mm512_div_pd(__m512d __a, __m512d __b) { return (__m512d)((__v8df)__a/(__v8df)__b); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_mask_div_pd(__m512d __W, __mmask8 __U, __m512d __A, __m512d __B) { return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U, (__v8df)_mm512_div_pd(__A, __B), (__v8df)__W); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_maskz_div_pd(__mmask8 __U, __m512d __A, __m512d __B) { return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U, (__v8df)_mm512_div_pd(__A, __B), (__v8df)_mm512_setzero_pd()); } static __inline __m512 __DEFAULT_FN_ATTRS _mm512_div_ps(__m512 __a, __m512 __b) { return (__m512)((__v16sf)__a/(__v16sf)__b); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_mask_div_ps(__m512 __W, __mmask16 __U, __m512 __A, __m512 __B) { return (__m512)__builtin_ia32_selectps_512((__mmask16)__U, (__v16sf)_mm512_div_ps(__A, __B), (__v16sf)__W); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_maskz_div_ps(__mmask16 __U, __m512 __A, __m512 __B) { return (__m512)__builtin_ia32_selectps_512((__mmask16)__U, (__v16sf)_mm512_div_ps(__A, __B), (__v16sf)_mm512_setzero_ps()); } #define _mm512_div_round_pd(A, B, R) __extension__ ({ \ (__m512d)__builtin_ia32_divpd512_mask((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), \ (__v8df)_mm512_setzero_pd(), \ (__mmask8)-1, (int)(R)); }) #define _mm512_mask_div_round_pd(W, U, A, B, R) __extension__ ({ \ (__m512d)__builtin_ia32_divpd512_mask((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), \ (__v8df)(__m512d)(W), (__mmask8)(U), \ (int)(R)); }) #define _mm512_maskz_div_round_pd(U, A, B, R) __extension__ ({ \ (__m512d)__builtin_ia32_divpd512_mask((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), \ (__v8df)_mm512_setzero_pd(), \ (__mmask8)(U), (int)(R)); }) #define _mm512_div_round_ps(A, B, R) __extension__ ({ \ (__m512)__builtin_ia32_divps512_mask((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), \ (__v16sf)_mm512_setzero_ps(), \ (__mmask16)-1, (int)(R)); }) #define _mm512_mask_div_round_ps(W, U, A, B, R) __extension__ ({ \ (__m512)__builtin_ia32_divps512_mask((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), \ (__v16sf)(__m512)(W), (__mmask16)(U), \ (int)(R)); }); #define _mm512_maskz_div_round_ps(U, A, B, R) __extension__ ({ \ (__m512)__builtin_ia32_divps512_mask((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), \ (__v16sf)_mm512_setzero_ps(), \ (__mmask16)(U), (int)(R)); }); #define _mm512_roundscale_ps(A, B) __extension__ ({ \ (__m512)__builtin_ia32_rndscaleps_mask((__v16sf)(__m512)(A), (int)(B), \ (__v16sf)(__m512)(A), (__mmask16)-1, \ _MM_FROUND_CUR_DIRECTION); }) #define _mm512_mask_roundscale_ps(A, B, C, imm) __extension__ ({\ (__m512)__builtin_ia32_rndscaleps_mask((__v16sf)(__m512)(C), (int)(imm), \ (__v16sf)(__m512)(A), (__mmask16)(B), \ _MM_FROUND_CUR_DIRECTION); }) #define _mm512_maskz_roundscale_ps(A, B, imm) __extension__ ({\ (__m512)__builtin_ia32_rndscaleps_mask((__v16sf)(__m512)(B), (int)(imm), \ (__v16sf)_mm512_setzero_ps(), \ (__mmask16)(A), \ _MM_FROUND_CUR_DIRECTION); }) #define _mm512_mask_roundscale_round_ps(A, B, C, imm, R) __extension__ ({ \ (__m512)__builtin_ia32_rndscaleps_mask((__v16sf)(__m512)(C), (int)(imm), \ (__v16sf)(__m512)(A), (__mmask16)(B), \ (int)(R)); }) #define _mm512_maskz_roundscale_round_ps(A, B, imm, R) __extension__ ({ \ (__m512)__builtin_ia32_rndscaleps_mask((__v16sf)(__m512)(B), (int)(imm), \ (__v16sf)_mm512_setzero_ps(), \ (__mmask16)(A), (int)(R)); }) #define _mm512_roundscale_round_ps(A, imm, R) __extension__ ({ \ (__m512)__builtin_ia32_rndscaleps_mask((__v16sf)(__m512)(A), (int)(imm), \ (__v16sf)_mm512_undefined_ps(), \ (__mmask16)-1, (int)(R)); }) #define _mm512_roundscale_pd(A, B) __extension__ ({ \ (__m512d)__builtin_ia32_rndscalepd_mask((__v8df)(__m512d)(A), (int)(B), \ (__v8df)(__m512d)(A), (__mmask8)-1, \ _MM_FROUND_CUR_DIRECTION); }) #define _mm512_mask_roundscale_pd(A, B, C, imm) __extension__ ({\ (__m512d)__builtin_ia32_rndscalepd_mask((__v8df)(__m512d)(C), (int)(imm), \ (__v8df)(__m512d)(A), (__mmask8)(B), \ _MM_FROUND_CUR_DIRECTION); }) #define _mm512_maskz_roundscale_pd(A, B, imm) __extension__ ({\ (__m512d)__builtin_ia32_rndscalepd_mask((__v8df)(__m512d)(B), (int)(imm), \ (__v8df)_mm512_setzero_pd(), \ (__mmask8)(A), \ _MM_FROUND_CUR_DIRECTION); }) #define _mm512_mask_roundscale_round_pd(A, B, C, imm, R) __extension__ ({ \ (__m512d)__builtin_ia32_rndscalepd_mask((__v8df)(__m512d)(C), (int)(imm), \ (__v8df)(__m512d)(A), (__mmask8)(B), \ (int)(R)); }) #define _mm512_maskz_roundscale_round_pd(A, B, imm, R) __extension__ ({ \ (__m512d)__builtin_ia32_rndscalepd_mask((__v8df)(__m512d)(B), (int)(imm), \ (__v8df)_mm512_setzero_pd(), \ (__mmask8)(A), (int)(R)); }) #define _mm512_roundscale_round_pd(A, imm, R) __extension__ ({ \ (__m512d)__builtin_ia32_rndscalepd_mask((__v8df)(__m512d)(A), (int)(imm), \ (__v8df)_mm512_undefined_pd(), \ (__mmask8)-1, (int)(R)); }) #define _mm512_fmadd_round_pd(A, B, C, R) __extension__ ({ \ (__m512d)__builtin_ia32_vfmaddpd512_mask((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), \ (__v8df)(__m512d)(C), (__mmask8)-1, \ (int)(R)); }) #define _mm512_mask_fmadd_round_pd(A, U, B, C, R) __extension__ ({ \ (__m512d)__builtin_ia32_vfmaddpd512_mask((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), \ (__v8df)(__m512d)(C), \ (__mmask8)(U), (int)(R)); }) #define _mm512_mask3_fmadd_round_pd(A, B, C, U, R) __extension__ ({ \ (__m512d)__builtin_ia32_vfmaddpd512_mask3((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), \ (__v8df)(__m512d)(C), \ (__mmask8)(U), (int)(R)); }) #define _mm512_maskz_fmadd_round_pd(U, A, B, C, R) __extension__ ({ \ (__m512d)__builtin_ia32_vfmaddpd512_maskz((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), \ (__v8df)(__m512d)(C), \ (__mmask8)(U), (int)(R)); }) #define _mm512_fmsub_round_pd(A, B, C, R) __extension__ ({ \ (__m512d)__builtin_ia32_vfmaddpd512_mask((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), \ -(__v8df)(__m512d)(C), \ (__mmask8)-1, (int)(R)); }) #define _mm512_mask_fmsub_round_pd(A, U, B, C, R) __extension__ ({ \ (__m512d)__builtin_ia32_vfmaddpd512_mask((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), \ -(__v8df)(__m512d)(C), \ (__mmask8)(U), (int)(R)); }) #define _mm512_maskz_fmsub_round_pd(U, A, B, C, R) __extension__ ({ \ (__m512d)__builtin_ia32_vfmaddpd512_maskz((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), \ -(__v8df)(__m512d)(C), \ (__mmask8)(U), (int)(R)); }) #define _mm512_fnmadd_round_pd(A, B, C, R) __extension__ ({ \ (__m512d)__builtin_ia32_vfmaddpd512_mask(-(__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), \ (__v8df)(__m512d)(C), (__mmask8)-1, \ (int)(R)); }) #define _mm512_mask3_fnmadd_round_pd(A, B, C, U, R) __extension__ ({ \ (__m512d)__builtin_ia32_vfmaddpd512_mask3(-(__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), \ (__v8df)(__m512d)(C), \ (__mmask8)(U), (int)(R)); }) #define _mm512_maskz_fnmadd_round_pd(U, A, B, C, R) __extension__ ({ \ (__m512d)__builtin_ia32_vfmaddpd512_maskz(-(__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), \ (__v8df)(__m512d)(C), \ (__mmask8)(U), (int)(R)); }) #define _mm512_fnmsub_round_pd(A, B, C, R) __extension__ ({ \ (__m512d)__builtin_ia32_vfmaddpd512_mask(-(__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), \ -(__v8df)(__m512d)(C), \ (__mmask8)-1, (int)(R)); }) #define _mm512_maskz_fnmsub_round_pd(U, A, B, C, R) __extension__ ({ \ (__m512d)__builtin_ia32_vfmaddpd512_maskz(-(__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), \ -(__v8df)(__m512d)(C), \ (__mmask8)(U), (int)(R)); }) static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_fmadd_pd(__m512d __A, __m512d __B, __m512d __C) { return (__m512d) __builtin_ia32_vfmaddpd512_mask ((__v8df) __A, (__v8df) __B, (__v8df) __C, (__mmask8) -1, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_mask_fmadd_pd(__m512d __A, __mmask8 __U, __m512d __B, __m512d __C) { return (__m512d) __builtin_ia32_vfmaddpd512_mask ((__v8df) __A, (__v8df) __B, (__v8df) __C, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_mask3_fmadd_pd(__m512d __A, __m512d __B, __m512d __C, __mmask8 __U) { return (__m512d) __builtin_ia32_vfmaddpd512_mask3 ((__v8df) __A, (__v8df) __B, (__v8df) __C, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_maskz_fmadd_pd(__mmask8 __U, __m512d __A, __m512d __B, __m512d __C) { return (__m512d) __builtin_ia32_vfmaddpd512_maskz ((__v8df) __A, (__v8df) __B, (__v8df) __C, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_fmsub_pd(__m512d __A, __m512d __B, __m512d __C) { return (__m512d) __builtin_ia32_vfmaddpd512_mask ((__v8df) __A, (__v8df) __B, -(__v8df) __C, (__mmask8) -1, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_mask_fmsub_pd(__m512d __A, __mmask8 __U, __m512d __B, __m512d __C) { return (__m512d) __builtin_ia32_vfmaddpd512_mask ((__v8df) __A, (__v8df) __B, -(__v8df) __C, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_maskz_fmsub_pd(__mmask8 __U, __m512d __A, __m512d __B, __m512d __C) { return (__m512d) __builtin_ia32_vfmaddpd512_maskz ((__v8df) __A, (__v8df) __B, -(__v8df) __C, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_fnmadd_pd(__m512d __A, __m512d __B, __m512d __C) { return (__m512d) __builtin_ia32_vfmaddpd512_mask (-(__v8df) __A, (__v8df) __B, (__v8df) __C, (__mmask8) -1, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_mask3_fnmadd_pd(__m512d __A, __m512d __B, __m512d __C, __mmask8 __U) { return (__m512d) __builtin_ia32_vfmaddpd512_mask3 (-(__v8df) __A, (__v8df) __B, (__v8df) __C, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_maskz_fnmadd_pd(__mmask8 __U, __m512d __A, __m512d __B, __m512d __C) { return (__m512d) __builtin_ia32_vfmaddpd512_maskz (-(__v8df) __A, (__v8df) __B, (__v8df) __C, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_fnmsub_pd(__m512d __A, __m512d __B, __m512d __C) { return (__m512d) __builtin_ia32_vfmaddpd512_mask (-(__v8df) __A, (__v8df) __B, -(__v8df) __C, (__mmask8) -1, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_maskz_fnmsub_pd(__mmask8 __U, __m512d __A, __m512d __B, __m512d __C) { return (__m512d) __builtin_ia32_vfmaddpd512_maskz (-(__v8df) __A, (__v8df) __B, -(__v8df) __C, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm512_fmadd_round_ps(A, B, C, R) __extension__ ({ \ (__m512)__builtin_ia32_vfmaddps512_mask((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), \ (__v16sf)(__m512)(C), (__mmask16)-1, \ (int)(R)); }) #define _mm512_mask_fmadd_round_ps(A, U, B, C, R) __extension__ ({ \ (__m512)__builtin_ia32_vfmaddps512_mask((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), \ (__v16sf)(__m512)(C), \ (__mmask16)(U), (int)(R)); }) #define _mm512_mask3_fmadd_round_ps(A, B, C, U, R) __extension__ ({ \ (__m512)__builtin_ia32_vfmaddps512_mask3((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), \ (__v16sf)(__m512)(C), \ (__mmask16)(U), (int)(R)); }) #define _mm512_maskz_fmadd_round_ps(U, A, B, C, R) __extension__ ({ \ (__m512)__builtin_ia32_vfmaddps512_maskz((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), \ (__v16sf)(__m512)(C), \ (__mmask16)(U), (int)(R)); }) #define _mm512_fmsub_round_ps(A, B, C, R) __extension__ ({ \ (__m512)__builtin_ia32_vfmaddps512_mask((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), \ -(__v16sf)(__m512)(C), \ (__mmask16)-1, (int)(R)); }) #define _mm512_mask_fmsub_round_ps(A, U, B, C, R) __extension__ ({ \ (__m512)__builtin_ia32_vfmaddps512_mask((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), \ -(__v16sf)(__m512)(C), \ (__mmask16)(U), (int)(R)); }) #define _mm512_maskz_fmsub_round_ps(U, A, B, C, R) __extension__ ({ \ (__m512)__builtin_ia32_vfmaddps512_maskz((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), \ -(__v16sf)(__m512)(C), \ (__mmask16)(U), (int)(R)); }) #define _mm512_fnmadd_round_ps(A, B, C, R) __extension__ ({ \ (__m512)__builtin_ia32_vfmaddps512_mask(-(__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), \ (__v16sf)(__m512)(C), (__mmask16)-1, \ (int)(R)); }) #define _mm512_mask3_fnmadd_round_ps(A, B, C, U, R) __extension__ ({ \ (__m512)__builtin_ia32_vfmaddps512_mask3(-(__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), \ (__v16sf)(__m512)(C), \ (__mmask16)(U), (int)(R)); }) #define _mm512_maskz_fnmadd_round_ps(U, A, B, C, R) __extension__ ({ \ (__m512)__builtin_ia32_vfmaddps512_maskz(-(__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), \ (__v16sf)(__m512)(C), \ (__mmask16)(U), (int)(R)); }) #define _mm512_fnmsub_round_ps(A, B, C, R) __extension__ ({ \ (__m512)__builtin_ia32_vfmaddps512_mask(-(__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), \ -(__v16sf)(__m512)(C), \ (__mmask16)-1, (int)(R)); }) #define _mm512_maskz_fnmsub_round_ps(U, A, B, C, R) __extension__ ({ \ (__m512)__builtin_ia32_vfmaddps512_maskz(-(__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), \ -(__v16sf)(__m512)(C), \ (__mmask16)(U), (int)(R)); }) static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_fmadd_ps(__m512 __A, __m512 __B, __m512 __C) { return (__m512) __builtin_ia32_vfmaddps512_mask ((__v16sf) __A, (__v16sf) __B, (__v16sf) __C, (__mmask16) -1, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_mask_fmadd_ps(__m512 __A, __mmask16 __U, __m512 __B, __m512 __C) { return (__m512) __builtin_ia32_vfmaddps512_mask ((__v16sf) __A, (__v16sf) __B, (__v16sf) __C, (__mmask16) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_mask3_fmadd_ps(__m512 __A, __m512 __B, __m512 __C, __mmask16 __U) { return (__m512) __builtin_ia32_vfmaddps512_mask3 ((__v16sf) __A, (__v16sf) __B, (__v16sf) __C, (__mmask16) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_maskz_fmadd_ps(__mmask16 __U, __m512 __A, __m512 __B, __m512 __C) { return (__m512) __builtin_ia32_vfmaddps512_maskz ((__v16sf) __A, (__v16sf) __B, (__v16sf) __C, (__mmask16) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_fmsub_ps(__m512 __A, __m512 __B, __m512 __C) { return (__m512) __builtin_ia32_vfmaddps512_mask ((__v16sf) __A, (__v16sf) __B, -(__v16sf) __C, (__mmask16) -1, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_mask_fmsub_ps(__m512 __A, __mmask16 __U, __m512 __B, __m512 __C) { return (__m512) __builtin_ia32_vfmaddps512_mask ((__v16sf) __A, (__v16sf) __B, -(__v16sf) __C, (__mmask16) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_maskz_fmsub_ps(__mmask16 __U, __m512 __A, __m512 __B, __m512 __C) { return (__m512) __builtin_ia32_vfmaddps512_maskz ((__v16sf) __A, (__v16sf) __B, -(__v16sf) __C, (__mmask16) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_fnmadd_ps(__m512 __A, __m512 __B, __m512 __C) { return (__m512) __builtin_ia32_vfmaddps512_mask (-(__v16sf) __A, (__v16sf) __B, (__v16sf) __C, (__mmask16) -1, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_mask3_fnmadd_ps(__m512 __A, __m512 __B, __m512 __C, __mmask16 __U) { return (__m512) __builtin_ia32_vfmaddps512_mask3 (-(__v16sf) __A, (__v16sf) __B, (__v16sf) __C, (__mmask16) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_maskz_fnmadd_ps(__mmask16 __U, __m512 __A, __m512 __B, __m512 __C) { return (__m512) __builtin_ia32_vfmaddps512_maskz (-(__v16sf) __A, (__v16sf) __B, (__v16sf) __C, (__mmask16) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_fnmsub_ps(__m512 __A, __m512 __B, __m512 __C) { return (__m512) __builtin_ia32_vfmaddps512_mask (-(__v16sf) __A, (__v16sf) __B, -(__v16sf) __C, (__mmask16) -1, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_maskz_fnmsub_ps(__mmask16 __U, __m512 __A, __m512 __B, __m512 __C) { return (__m512) __builtin_ia32_vfmaddps512_maskz (-(__v16sf) __A, (__v16sf) __B, -(__v16sf) __C, (__mmask16) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm512_fmaddsub_round_pd(A, B, C, R) __extension__ ({ \ (__m512d)__builtin_ia32_vfmaddsubpd512_mask((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), \ (__v8df)(__m512d)(C), \ (__mmask8)-1, (int)(R)); }) #define _mm512_mask_fmaddsub_round_pd(A, U, B, C, R) __extension__ ({ \ (__m512d)__builtin_ia32_vfmaddsubpd512_mask((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), \ (__v8df)(__m512d)(C), \ (__mmask8)(U), (int)(R)); }) #define _mm512_mask3_fmaddsub_round_pd(A, B, C, U, R) __extension__ ({ \ (__m512d)__builtin_ia32_vfmaddsubpd512_mask3((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), \ (__v8df)(__m512d)(C), \ (__mmask8)(U), (int)(R)); }) #define _mm512_maskz_fmaddsub_round_pd(U, A, B, C, R) __extension__ ({ \ (__m512d)__builtin_ia32_vfmaddsubpd512_maskz((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), \ (__v8df)(__m512d)(C), \ (__mmask8)(U), (int)(R)); }) #define _mm512_fmsubadd_round_pd(A, B, C, R) __extension__ ({ \ (__m512d)__builtin_ia32_vfmaddsubpd512_mask((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), \ -(__v8df)(__m512d)(C), \ (__mmask8)-1, (int)(R)); }) #define _mm512_mask_fmsubadd_round_pd(A, U, B, C, R) __extension__ ({ \ (__m512d)__builtin_ia32_vfmaddsubpd512_mask((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), \ -(__v8df)(__m512d)(C), \ (__mmask8)(U), (int)(R)); }) #define _mm512_maskz_fmsubadd_round_pd(U, A, B, C, R) __extension__ ({ \ (__m512d)__builtin_ia32_vfmaddsubpd512_maskz((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), \ -(__v8df)(__m512d)(C), \ (__mmask8)(U), (int)(R)); }) static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_fmaddsub_pd(__m512d __A, __m512d __B, __m512d __C) { return (__m512d) __builtin_ia32_vfmaddsubpd512_mask ((__v8df) __A, (__v8df) __B, (__v8df) __C, (__mmask8) -1, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_mask_fmaddsub_pd(__m512d __A, __mmask8 __U, __m512d __B, __m512d __C) { return (__m512d) __builtin_ia32_vfmaddsubpd512_mask ((__v8df) __A, (__v8df) __B, (__v8df) __C, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_mask3_fmaddsub_pd(__m512d __A, __m512d __B, __m512d __C, __mmask8 __U) { return (__m512d) __builtin_ia32_vfmaddsubpd512_mask3 ((__v8df) __A, (__v8df) __B, (__v8df) __C, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_maskz_fmaddsub_pd(__mmask8 __U, __m512d __A, __m512d __B, __m512d __C) { return (__m512d) __builtin_ia32_vfmaddsubpd512_maskz ((__v8df) __A, (__v8df) __B, (__v8df) __C, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_fmsubadd_pd(__m512d __A, __m512d __B, __m512d __C) { return (__m512d) __builtin_ia32_vfmaddsubpd512_mask ((__v8df) __A, (__v8df) __B, -(__v8df) __C, (__mmask8) -1, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_mask_fmsubadd_pd(__m512d __A, __mmask8 __U, __m512d __B, __m512d __C) { return (__m512d) __builtin_ia32_vfmaddsubpd512_mask ((__v8df) __A, (__v8df) __B, -(__v8df) __C, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_maskz_fmsubadd_pd(__mmask8 __U, __m512d __A, __m512d __B, __m512d __C) { return (__m512d) __builtin_ia32_vfmaddsubpd512_maskz ((__v8df) __A, (__v8df) __B, -(__v8df) __C, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm512_fmaddsub_round_ps(A, B, C, R) __extension__ ({ \ (__m512)__builtin_ia32_vfmaddsubps512_mask((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), \ (__v16sf)(__m512)(C), \ (__mmask16)-1, (int)(R)); }) #define _mm512_mask_fmaddsub_round_ps(A, U, B, C, R) __extension__ ({ \ (__m512)__builtin_ia32_vfmaddsubps512_mask((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), \ (__v16sf)(__m512)(C), \ (__mmask16)(U), (int)(R)); }) #define _mm512_mask3_fmaddsub_round_ps(A, B, C, U, R) __extension__ ({ \ (__m512)__builtin_ia32_vfmaddsubps512_mask3((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), \ (__v16sf)(__m512)(C), \ (__mmask16)(U), (int)(R)); }) #define _mm512_maskz_fmaddsub_round_ps(U, A, B, C, R) __extension__ ({ \ (__m512)__builtin_ia32_vfmaddsubps512_maskz((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), \ (__v16sf)(__m512)(C), \ (__mmask16)(U), (int)(R)); }) #define _mm512_fmsubadd_round_ps(A, B, C, R) __extension__ ({ \ (__m512)__builtin_ia32_vfmaddsubps512_mask((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), \ -(__v16sf)(__m512)(C), \ (__mmask16)-1, (int)(R)); }) #define _mm512_mask_fmsubadd_round_ps(A, U, B, C, R) __extension__ ({ \ (__m512)__builtin_ia32_vfmaddsubps512_mask((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), \ -(__v16sf)(__m512)(C), \ (__mmask16)(U), (int)(R)); }) #define _mm512_maskz_fmsubadd_round_ps(U, A, B, C, R) __extension__ ({ \ (__m512)__builtin_ia32_vfmaddsubps512_maskz((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), \ -(__v16sf)(__m512)(C), \ (__mmask16)(U), (int)(R)); }) static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_fmaddsub_ps(__m512 __A, __m512 __B, __m512 __C) { return (__m512) __builtin_ia32_vfmaddsubps512_mask ((__v16sf) __A, (__v16sf) __B, (__v16sf) __C, (__mmask16) -1, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_mask_fmaddsub_ps(__m512 __A, __mmask16 __U, __m512 __B, __m512 __C) { return (__m512) __builtin_ia32_vfmaddsubps512_mask ((__v16sf) __A, (__v16sf) __B, (__v16sf) __C, (__mmask16) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_mask3_fmaddsub_ps(__m512 __A, __m512 __B, __m512 __C, __mmask16 __U) { return (__m512) __builtin_ia32_vfmaddsubps512_mask3 ((__v16sf) __A, (__v16sf) __B, (__v16sf) __C, (__mmask16) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_maskz_fmaddsub_ps(__mmask16 __U, __m512 __A, __m512 __B, __m512 __C) { return (__m512) __builtin_ia32_vfmaddsubps512_maskz ((__v16sf) __A, (__v16sf) __B, (__v16sf) __C, (__mmask16) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_fmsubadd_ps(__m512 __A, __m512 __B, __m512 __C) { return (__m512) __builtin_ia32_vfmaddsubps512_mask ((__v16sf) __A, (__v16sf) __B, -(__v16sf) __C, (__mmask16) -1, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_mask_fmsubadd_ps(__m512 __A, __mmask16 __U, __m512 __B, __m512 __C) { return (__m512) __builtin_ia32_vfmaddsubps512_mask ((__v16sf) __A, (__v16sf) __B, -(__v16sf) __C, (__mmask16) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_maskz_fmsubadd_ps(__mmask16 __U, __m512 __A, __m512 __B, __m512 __C) { return (__m512) __builtin_ia32_vfmaddsubps512_maskz ((__v16sf) __A, (__v16sf) __B, -(__v16sf) __C, (__mmask16) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm512_mask3_fmsub_round_pd(A, B, C, U, R) __extension__ ({ \ (__m512d)__builtin_ia32_vfmsubpd512_mask3((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), \ (__v8df)(__m512d)(C), \ (__mmask8)(U), (int)(R)); }) static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_mask3_fmsub_pd(__m512d __A, __m512d __B, __m512d __C, __mmask8 __U) { return (__m512d) __builtin_ia32_vfmsubpd512_mask3 ((__v8df) __A, (__v8df) __B, (__v8df) __C, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm512_mask3_fmsub_round_ps(A, B, C, U, R) __extension__ ({ \ (__m512)__builtin_ia32_vfmsubps512_mask3((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), \ (__v16sf)(__m512)(C), \ (__mmask16)(U), (int)(R)); }) static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_mask3_fmsub_ps(__m512 __A, __m512 __B, __m512 __C, __mmask16 __U) { return (__m512) __builtin_ia32_vfmsubps512_mask3 ((__v16sf) __A, (__v16sf) __B, (__v16sf) __C, (__mmask16) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm512_mask3_fmsubadd_round_pd(A, B, C, U, R) __extension__ ({ \ (__m512d)__builtin_ia32_vfmsubaddpd512_mask3((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), \ (__v8df)(__m512d)(C), \ (__mmask8)(U), (int)(R)); }) static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_mask3_fmsubadd_pd(__m512d __A, __m512d __B, __m512d __C, __mmask8 __U) { return (__m512d) __builtin_ia32_vfmsubaddpd512_mask3 ((__v8df) __A, (__v8df) __B, (__v8df) __C, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm512_mask3_fmsubadd_round_ps(A, B, C, U, R) __extension__ ({ \ (__m512)__builtin_ia32_vfmsubaddps512_mask3((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), \ (__v16sf)(__m512)(C), \ (__mmask16)(U), (int)(R)); }) static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_mask3_fmsubadd_ps(__m512 __A, __m512 __B, __m512 __C, __mmask16 __U) { return (__m512) __builtin_ia32_vfmsubaddps512_mask3 ((__v16sf) __A, (__v16sf) __B, (__v16sf) __C, (__mmask16) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm512_mask_fnmadd_round_pd(A, U, B, C, R) __extension__ ({ \ (__m512d)__builtin_ia32_vfnmaddpd512_mask((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), \ (__v8df)(__m512d)(C), \ (__mmask8)(U), (int)(R)); }) static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_mask_fnmadd_pd(__m512d __A, __mmask8 __U, __m512d __B, __m512d __C) { return (__m512d) __builtin_ia32_vfnmaddpd512_mask ((__v8df) __A, (__v8df) __B, (__v8df) __C, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm512_mask_fnmadd_round_ps(A, U, B, C, R) __extension__ ({ \ (__m512)__builtin_ia32_vfnmaddps512_mask((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), \ (__v16sf)(__m512)(C), \ (__mmask16)(U), (int)(R)); }) static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_mask_fnmadd_ps(__m512 __A, __mmask16 __U, __m512 __B, __m512 __C) { return (__m512) __builtin_ia32_vfnmaddps512_mask ((__v16sf) __A, (__v16sf) __B, (__v16sf) __C, (__mmask16) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm512_mask_fnmsub_round_pd(A, U, B, C, R) __extension__ ({ \ (__m512d)__builtin_ia32_vfnmsubpd512_mask((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), \ (__v8df)(__m512d)(C), \ (__mmask8)(U), (int)(R)); }) #define _mm512_mask3_fnmsub_round_pd(A, B, C, U, R) __extension__ ({ \ (__m512d)__builtin_ia32_vfnmsubpd512_mask3((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), \ (__v8df)(__m512d)(C), \ (__mmask8)(U), (int)(R)); }) static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_mask_fnmsub_pd(__m512d __A, __mmask8 __U, __m512d __B, __m512d __C) { return (__m512d) __builtin_ia32_vfnmsubpd512_mask ((__v8df) __A, (__v8df) __B, (__v8df) __C, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_mask3_fnmsub_pd(__m512d __A, __m512d __B, __m512d __C, __mmask8 __U) { return (__m512d) __builtin_ia32_vfnmsubpd512_mask3 ((__v8df) __A, (__v8df) __B, (__v8df) __C, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm512_mask_fnmsub_round_ps(A, U, B, C, R) __extension__ ({ \ (__m512)__builtin_ia32_vfnmsubps512_mask((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), \ (__v16sf)(__m512)(C), \ (__mmask16)(U), (int)(R)); }) #define _mm512_mask3_fnmsub_round_ps(A, B, C, U, R) __extension__ ({ \ (__m512)__builtin_ia32_vfnmsubps512_mask3((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), \ (__v16sf)(__m512)(C), \ (__mmask16)(U), (int)(R)); }) static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_mask_fnmsub_ps(__m512 __A, __mmask16 __U, __m512 __B, __m512 __C) { return (__m512) __builtin_ia32_vfnmsubps512_mask ((__v16sf) __A, (__v16sf) __B, (__v16sf) __C, (__mmask16) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_mask3_fnmsub_ps(__m512 __A, __m512 __B, __m512 __C, __mmask16 __U) { return (__m512) __builtin_ia32_vfnmsubps512_mask3 ((__v16sf) __A, (__v16sf) __B, (__v16sf) __C, (__mmask16) __U, _MM_FROUND_CUR_DIRECTION); } /* Vector permutations */ static __inline __m512i __DEFAULT_FN_ATTRS _mm512_permutex2var_epi32(__m512i __A, __m512i __I, __m512i __B) { return (__m512i) __builtin_ia32_vpermt2vard512_mask ((__v16si) __I /* idx */ , (__v16si) __A, (__v16si) __B, (__mmask16) -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_permutex2var_epi32 (__m512i __A, __mmask16 __U, __m512i __I, __m512i __B) { return (__m512i) __builtin_ia32_vpermt2vard512_mask ((__v16si) __I /* idx */ , (__v16si) __A, (__v16si) __B, (__mmask16) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_permutex2var_epi32 (__mmask16 __U, __m512i __A, __m512i __I, __m512i __B) { return (__m512i) __builtin_ia32_vpermt2vard512_maskz ((__v16si) __I /* idx */ , (__v16si) __A, (__v16si) __B, (__mmask16) __U); } static __inline __m512i __DEFAULT_FN_ATTRS _mm512_permutex2var_epi64(__m512i __A, __m512i __I, __m512i __B) { return (__m512i) __builtin_ia32_vpermt2varq512_mask ((__v8di) __I /* idx */ , (__v8di) __A, (__v8di) __B, (__mmask8) -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_permutex2var_epi64 (__m512i __A, __mmask8 __U, __m512i __I, __m512i __B) { return (__m512i) __builtin_ia32_vpermt2varq512_mask ((__v8di) __I /* idx */ , (__v8di) __A, (__v8di) __B, (__mmask8) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_permutex2var_epi64 (__mmask8 __U, __m512i __A, __m512i __I, __m512i __B) { return (__m512i) __builtin_ia32_vpermt2varq512_maskz ((__v8di) __I /* idx */ , (__v8di) __A, (__v8di) __B, (__mmask8) __U); } #define _mm512_alignr_epi64(A, B, I) __extension__ ({ \ (__m512i)__builtin_shufflevector((__v8di)(__m512i)(B), \ (__v8di)(__m512i)(A), \ ((int)(I) & 0x7) + 0, \ ((int)(I) & 0x7) + 1, \ ((int)(I) & 0x7) + 2, \ ((int)(I) & 0x7) + 3, \ ((int)(I) & 0x7) + 4, \ ((int)(I) & 0x7) + 5, \ ((int)(I) & 0x7) + 6, \ ((int)(I) & 0x7) + 7); }) #define _mm512_mask_alignr_epi64(W, U, A, B, imm) __extension__({\ (__m512i)__builtin_ia32_selectq_512((__mmask8)(U), \ (__v8di)_mm512_alignr_epi64((A), (B), (imm)), \ (__v8di)(__m512i)(W)); }) #define _mm512_maskz_alignr_epi64(U, A, B, imm) __extension__({\ (__m512i)__builtin_ia32_selectq_512((__mmask8)(U), \ (__v8di)_mm512_alignr_epi64((A), (B), (imm)), \ (__v8di)_mm512_setzero_si512()); }) #define _mm512_alignr_epi32(A, B, I) __extension__ ({ \ (__m512i)__builtin_shufflevector((__v16si)(__m512i)(B), \ (__v16si)(__m512i)(A), \ ((int)(I) & 0xf) + 0, \ ((int)(I) & 0xf) + 1, \ ((int)(I) & 0xf) + 2, \ ((int)(I) & 0xf) + 3, \ ((int)(I) & 0xf) + 4, \ ((int)(I) & 0xf) + 5, \ ((int)(I) & 0xf) + 6, \ ((int)(I) & 0xf) + 7, \ ((int)(I) & 0xf) + 8, \ ((int)(I) & 0xf) + 9, \ ((int)(I) & 0xf) + 10, \ ((int)(I) & 0xf) + 11, \ ((int)(I) & 0xf) + 12, \ ((int)(I) & 0xf) + 13, \ ((int)(I) & 0xf) + 14, \ ((int)(I) & 0xf) + 15); }) #define _mm512_mask_alignr_epi32(W, U, A, B, imm) __extension__ ({\ (__m512i)__builtin_ia32_selectd_512((__mmask16)(U), \ (__v16si)_mm512_alignr_epi32((A), (B), (imm)), \ (__v16si)(__m512i)(W)); }) #define _mm512_maskz_alignr_epi32(U, A, B, imm) __extension__({\ (__m512i)__builtin_ia32_selectd_512((__mmask16)(U), \ (__v16si)_mm512_alignr_epi32((A), (B), (imm)), \ (__v16si)_mm512_setzero_si512()); }) /* Vector Extract */ #define _mm512_extractf64x4_pd(A, I) __extension__ ({ \ (__m256d)__builtin_shufflevector((__v8df)(__m512d)(A), \ (__v8df)_mm512_undefined_pd(), \ ((I) & 1) ? 4 : 0, \ ((I) & 1) ? 5 : 1, \ ((I) & 1) ? 6 : 2, \ ((I) & 1) ? 7 : 3); }) #define _mm512_mask_extractf64x4_pd(W, U, A, imm) __extension__ ({\ (__m256d)__builtin_ia32_selectpd_256((__mmask8)(U), \ (__v4df)_mm512_extractf64x4_pd((A), (imm)), \ (__v4df)(W)); }) #define _mm512_maskz_extractf64x4_pd(U, A, imm) __extension__ ({\ (__m256d)__builtin_ia32_selectpd_256((__mmask8)(U), \ (__v4df)_mm512_extractf64x4_pd((A), (imm)), \ (__v4df)_mm256_setzero_pd()); }) #define _mm512_extractf32x4_ps(A, I) __extension__ ({ \ (__m128)__builtin_shufflevector((__v16sf)(__m512)(A), \ (__v16sf)_mm512_undefined_ps(), \ 0 + ((I) & 0x3) * 4, \ 1 + ((I) & 0x3) * 4, \ 2 + ((I) & 0x3) * 4, \ 3 + ((I) & 0x3) * 4); }) #define _mm512_mask_extractf32x4_ps(W, U, A, imm) __extension__ ({\ (__m128)__builtin_ia32_selectps_128((__mmask8)(U), \ (__v4sf)_mm512_extractf32x4_ps((A), (imm)), \ (__v4sf)(W)); }) #define _mm512_maskz_extractf32x4_ps(U, A, imm) __extension__ ({\ (__m128)__builtin_ia32_selectps_128((__mmask8)(U), \ (__v4sf)_mm512_extractf32x4_ps((A), (imm)), \ (__v4sf)_mm_setzero_ps()); }) /* Vector Blend */ static __inline __m512d __DEFAULT_FN_ATTRS _mm512_mask_blend_pd(__mmask8 __U, __m512d __A, __m512d __W) { return (__m512d) __builtin_ia32_selectpd_512 ((__mmask8) __U, (__v8df) __W, (__v8df) __A); } static __inline __m512 __DEFAULT_FN_ATTRS _mm512_mask_blend_ps(__mmask16 __U, __m512 __A, __m512 __W) { return (__m512) __builtin_ia32_selectps_512 ((__mmask16) __U, (__v16sf) __W, (__v16sf) __A); } static __inline __m512i __DEFAULT_FN_ATTRS _mm512_mask_blend_epi64(__mmask8 __U, __m512i __A, __m512i __W) { return (__m512i) __builtin_ia32_selectq_512 ((__mmask8) __U, (__v8di) __W, (__v8di) __A); } static __inline __m512i __DEFAULT_FN_ATTRS _mm512_mask_blend_epi32(__mmask16 __U, __m512i __A, __m512i __W) { return (__m512i) __builtin_ia32_selectd_512 ((__mmask16) __U, (__v16si) __W, (__v16si) __A); } /* Compare */ #define _mm512_cmp_round_ps_mask(A, B, P, R) __extension__ ({ \ (__mmask16)__builtin_ia32_cmpps512_mask((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), (int)(P), \ (__mmask16)-1, (int)(R)); }) #define _mm512_mask_cmp_round_ps_mask(U, A, B, P, R) __extension__ ({ \ (__mmask16)__builtin_ia32_cmpps512_mask((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), (int)(P), \ (__mmask16)(U), (int)(R)); }) #define _mm512_cmp_ps_mask(A, B, P) \ _mm512_cmp_round_ps_mask((A), (B), (P), _MM_FROUND_CUR_DIRECTION) #define _mm512_mask_cmp_ps_mask(U, A, B, P) \ _mm512_mask_cmp_round_ps_mask((U), (A), (B), (P), _MM_FROUND_CUR_DIRECTION) #define _mm512_cmpeq_ps_mask(A, B) \ _mm512_cmp_ps_mask((A), (B), _CMP_EQ_OQ) #define _mm512_mask_cmpeq_ps_mask(k, A, B) \ _mm512_mask_cmp_ps_mask((k), (A), (B), _CMP_EQ_OQ) #define _mm512_cmplt_ps_mask(A, B) \ _mm512_cmp_ps_mask((A), (B), _CMP_LT_OS) #define _mm512_mask_cmplt_ps_mask(k, A, B) \ _mm512_mask_cmp_ps_mask((k), (A), (B), _CMP_LT_OS) #define _mm512_cmple_ps_mask(A, B) \ _mm512_cmp_ps_mask((A), (B), _CMP_LE_OS) #define _mm512_mask_cmple_ps_mask(k, A, B) \ _mm512_mask_cmp_ps_mask((k), (A), (B), _CMP_LE_OS) #define _mm512_cmpunord_ps_mask(A, B) \ _mm512_cmp_ps_mask((A), (B), _CMP_UNORD_Q) #define _mm512_mask_cmpunord_ps_mask(k, A, B) \ _mm512_mask_cmp_ps_mask((k), (A), (B), _CMP_UNORD_Q) #define _mm512_cmpneq_ps_mask(A, B) \ _mm512_cmp_ps_mask((A), (B), _CMP_NEQ_UQ) #define _mm512_mask_cmpneq_ps_mask(k, A, B) \ _mm512_mask_cmp_ps_mask((k), (A), (B), _CMP_NEQ_UQ) #define _mm512_cmpnlt_ps_mask(A, B) \ _mm512_cmp_ps_mask((A), (B), _CMP_NLT_US) #define _mm512_mask_cmpnlt_ps_mask(k, A, B) \ _mm512_mask_cmp_ps_mask((k), (A), (B), _CMP_NLT_US) #define _mm512_cmpnle_ps_mask(A, B) \ _mm512_cmp_ps_mask((A), (B), _CMP_NLE_US) #define _mm512_mask_cmpnle_ps_mask(k, A, B) \ _mm512_mask_cmp_ps_mask((k), (A), (B), _CMP_NLE_US) #define _mm512_cmpord_ps_mask(A, B) \ _mm512_cmp_ps_mask((A), (B), _CMP_ORD_Q) #define _mm512_mask_cmpord_ps_mask(k, A, B) \ _mm512_mask_cmp_ps_mask((k), (A), (B), _CMP_ORD_Q) #define _mm512_cmp_round_pd_mask(A, B, P, R) __extension__ ({ \ (__mmask8)__builtin_ia32_cmppd512_mask((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), (int)(P), \ (__mmask8)-1, (int)(R)); }) #define _mm512_mask_cmp_round_pd_mask(U, A, B, P, R) __extension__ ({ \ (__mmask8)__builtin_ia32_cmppd512_mask((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), (int)(P), \ (__mmask8)(U), (int)(R)); }) #define _mm512_cmp_pd_mask(A, B, P) \ _mm512_cmp_round_pd_mask((A), (B), (P), _MM_FROUND_CUR_DIRECTION) #define _mm512_mask_cmp_pd_mask(U, A, B, P) \ _mm512_mask_cmp_round_pd_mask((U), (A), (B), (P), _MM_FROUND_CUR_DIRECTION) #define _mm512_cmpeq_pd_mask(A, B) \ _mm512_cmp_pd_mask((A), (B), _CMP_EQ_OQ) #define _mm512_mask_cmpeq_pd_mask(k, A, B) \ _mm512_mask_cmp_pd_mask((k), (A), (B), _CMP_EQ_OQ) #define _mm512_cmplt_pd_mask(A, B) \ _mm512_cmp_pd_mask((A), (B), _CMP_LT_OS) #define _mm512_mask_cmplt_pd_mask(k, A, B) \ _mm512_mask_cmp_pd_mask((k), (A), (B), _CMP_LT_OS) #define _mm512_cmple_pd_mask(A, B) \ _mm512_cmp_pd_mask((A), (B), _CMP_LE_OS) #define _mm512_mask_cmple_pd_mask(k, A, B) \ _mm512_mask_cmp_pd_mask((k), (A), (B), _CMP_LE_OS) #define _mm512_cmpunord_pd_mask(A, B) \ _mm512_cmp_pd_mask((A), (B), _CMP_UNORD_Q) #define _mm512_mask_cmpunord_pd_mask(k, A, B) \ _mm512_mask_cmp_pd_mask((k), (A), (B), _CMP_UNORD_Q) #define _mm512_cmpneq_pd_mask(A, B) \ _mm512_cmp_pd_mask((A), (B), _CMP_NEQ_UQ) #define _mm512_mask_cmpneq_pd_mask(k, A, B) \ _mm512_mask_cmp_pd_mask((k), (A), (B), _CMP_NEQ_UQ) #define _mm512_cmpnlt_pd_mask(A, B) \ _mm512_cmp_pd_mask((A), (B), _CMP_NLT_US) #define _mm512_mask_cmpnlt_pd_mask(k, A, B) \ _mm512_mask_cmp_pd_mask((k), (A), (B), _CMP_NLT_US) #define _mm512_cmpnle_pd_mask(A, B) \ _mm512_cmp_pd_mask((A), (B), _CMP_NLE_US) #define _mm512_mask_cmpnle_pd_mask(k, A, B) \ _mm512_mask_cmp_pd_mask((k), (A), (B), _CMP_NLE_US) #define _mm512_cmpord_pd_mask(A, B) \ _mm512_cmp_pd_mask((A), (B), _CMP_ORD_Q) #define _mm512_mask_cmpord_pd_mask(k, A, B) \ _mm512_mask_cmp_pd_mask((k), (A), (B), _CMP_ORD_Q) /* Conversion */ #define _mm512_cvtt_roundps_epu32(A, R) __extension__ ({ \ (__m512i)__builtin_ia32_cvttps2udq512_mask((__v16sf)(__m512)(A), \ (__v16si)_mm512_undefined_epi32(), \ (__mmask16)-1, (int)(R)); }) #define _mm512_mask_cvtt_roundps_epu32(W, U, A, R) __extension__ ({ \ (__m512i)__builtin_ia32_cvttps2udq512_mask((__v16sf)(__m512)(A), \ (__v16si)(__m512i)(W), \ (__mmask16)(U), (int)(R)); }) #define _mm512_maskz_cvtt_roundps_epu32(U, A, R) __extension__ ({ \ (__m512i)__builtin_ia32_cvttps2udq512_mask((__v16sf)(__m512)(A), \ (__v16si)_mm512_setzero_si512(), \ (__mmask16)(U), (int)(R)); }) static __inline __m512i __DEFAULT_FN_ATTRS _mm512_cvttps_epu32(__m512 __A) { return (__m512i) __builtin_ia32_cvttps2udq512_mask ((__v16sf) __A, (__v16si) _mm512_setzero_si512 (), (__mmask16) -1, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_cvttps_epu32 (__m512i __W, __mmask16 __U, __m512 __A) { return (__m512i) __builtin_ia32_cvttps2udq512_mask ((__v16sf) __A, (__v16si) __W, (__mmask16) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_cvttps_epu32 (__mmask16 __U, __m512 __A) { return (__m512i) __builtin_ia32_cvttps2udq512_mask ((__v16sf) __A, (__v16si) _mm512_setzero_si512 (), (__mmask16) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm512_cvt_roundepi32_ps(A, R) __extension__ ({ \ (__m512)__builtin_ia32_cvtdq2ps512_mask((__v16si)(__m512i)(A), \ (__v16sf)_mm512_setzero_ps(), \ (__mmask16)-1, (int)(R)); }) #define _mm512_mask_cvt_roundepi32_ps(W, U, A, R) __extension__ ({ \ (__m512)__builtin_ia32_cvtdq2ps512_mask((__v16si)(__m512i)(A), \ (__v16sf)(__m512)(W), \ (__mmask16)(U), (int)(R)); }) #define _mm512_maskz_cvt_roundepi32_ps(U, A, R) __extension__ ({ \ (__m512)__builtin_ia32_cvtdq2ps512_mask((__v16si)(__m512i)(A), \ (__v16sf)_mm512_setzero_ps(), \ (__mmask16)(U), (int)(R)); }) #define _mm512_cvt_roundepu32_ps(A, R) __extension__ ({ \ (__m512)__builtin_ia32_cvtudq2ps512_mask((__v16si)(__m512i)(A), \ (__v16sf)_mm512_setzero_ps(), \ (__mmask16)-1, (int)(R)); }) #define _mm512_mask_cvt_roundepu32_ps(W, U, A, R) __extension__ ({ \ (__m512)__builtin_ia32_cvtudq2ps512_mask((__v16si)(__m512i)(A), \ (__v16sf)(__m512)(W), \ (__mmask16)(U), (int)(R)); }) #define _mm512_maskz_cvt_roundepu32_ps(U, A, R) __extension__ ({ \ (__m512)__builtin_ia32_cvtudq2ps512_mask((__v16si)(__m512i)(A), \ (__v16sf)_mm512_setzero_ps(), \ (__mmask16)(U), (int)(R)); }) static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_cvtepu32_ps (__m512i __A) { return (__m512) __builtin_ia32_cvtudq2ps512_mask ((__v16si) __A, (__v16sf) _mm512_undefined_ps (), (__mmask16) -1, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_mask_cvtepu32_ps (__m512 __W, __mmask16 __U, __m512i __A) { return (__m512) __builtin_ia32_cvtudq2ps512_mask ((__v16si) __A, (__v16sf) __W, (__mmask16) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_maskz_cvtepu32_ps (__mmask16 __U, __m512i __A) { return (__m512) __builtin_ia32_cvtudq2ps512_mask ((__v16si) __A, (__v16sf) _mm512_setzero_ps (), (__mmask16) __U, _MM_FROUND_CUR_DIRECTION); } static __inline __m512d __DEFAULT_FN_ATTRS _mm512_cvtepi32_pd(__m256i __A) { return (__m512d)__builtin_convertvector((__v8si)__A, __v8df); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_mask_cvtepi32_pd (__m512d __W, __mmask8 __U, __m256i __A) { return (__m512d)__builtin_ia32_selectpd_512((__mmask8) __U, (__v8df)_mm512_cvtepi32_pd(__A), (__v8df)__W); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_maskz_cvtepi32_pd (__mmask8 __U, __m256i __A) { return (__m512d)__builtin_ia32_selectpd_512((__mmask8) __U, (__v8df)_mm512_cvtepi32_pd(__A), (__v8df)_mm512_setzero_pd()); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_cvtepi32lo_pd(__m512i __A) { return (__m512d) _mm512_cvtepi32_pd(_mm512_castsi512_si256(__A)); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_mask_cvtepi32lo_pd(__m512d __W, __mmask8 __U,__m512i __A) { return (__m512d) _mm512_mask_cvtepi32_pd(__W, __U, _mm512_castsi512_si256(__A)); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_cvtepi32_ps (__m512i __A) { return (__m512) __builtin_ia32_cvtdq2ps512_mask ((__v16si) __A, (__v16sf) _mm512_undefined_ps (), (__mmask16) -1, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_mask_cvtepi32_ps (__m512 __W, __mmask16 __U, __m512i __A) { return (__m512) __builtin_ia32_cvtdq2ps512_mask ((__v16si) __A, (__v16sf) __W, (__mmask16) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_maskz_cvtepi32_ps (__mmask16 __U, __m512i __A) { return (__m512) __builtin_ia32_cvtdq2ps512_mask ((__v16si) __A, (__v16sf) _mm512_setzero_ps (), (__mmask16) __U, _MM_FROUND_CUR_DIRECTION); } static __inline __m512d __DEFAULT_FN_ATTRS _mm512_cvtepu32_pd(__m256i __A) { return (__m512d)__builtin_convertvector((__v8su)__A, __v8df); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_mask_cvtepu32_pd (__m512d __W, __mmask8 __U, __m256i __A) { return (__m512d)__builtin_ia32_selectpd_512((__mmask8) __U, (__v8df)_mm512_cvtepu32_pd(__A), (__v8df)__W); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_maskz_cvtepu32_pd (__mmask8 __U, __m256i __A) { return (__m512d)__builtin_ia32_selectpd_512((__mmask8) __U, (__v8df)_mm512_cvtepu32_pd(__A), (__v8df)_mm512_setzero_pd()); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_cvtepu32lo_pd(__m512i __A) { return (__m512d) _mm512_cvtepu32_pd(_mm512_castsi512_si256(__A)); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_mask_cvtepu32lo_pd(__m512d __W, __mmask8 __U,__m512i __A) { return (__m512d) _mm512_mask_cvtepu32_pd(__W, __U, _mm512_castsi512_si256(__A)); } #define _mm512_cvt_roundpd_ps(A, R) __extension__ ({ \ (__m256)__builtin_ia32_cvtpd2ps512_mask((__v8df)(__m512d)(A), \ (__v8sf)_mm256_setzero_ps(), \ (__mmask8)-1, (int)(R)); }) #define _mm512_mask_cvt_roundpd_ps(W, U, A, R) __extension__ ({ \ (__m256)__builtin_ia32_cvtpd2ps512_mask((__v8df)(__m512d)(A), \ (__v8sf)(__m256)(W), (__mmask8)(U), \ (int)(R)); }) #define _mm512_maskz_cvt_roundpd_ps(U, A, R) __extension__ ({ \ (__m256)__builtin_ia32_cvtpd2ps512_mask((__v8df)(__m512d)(A), \ (__v8sf)_mm256_setzero_ps(), \ (__mmask8)(U), (int)(R)); }) static __inline__ __m256 __DEFAULT_FN_ATTRS _mm512_cvtpd_ps (__m512d __A) { return (__m256) __builtin_ia32_cvtpd2ps512_mask ((__v8df) __A, (__v8sf) _mm256_undefined_ps (), (__mmask8) -1, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm512_mask_cvtpd_ps (__m256 __W, __mmask8 __U, __m512d __A) { return (__m256) __builtin_ia32_cvtpd2ps512_mask ((__v8df) __A, (__v8sf) __W, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm512_maskz_cvtpd_ps (__mmask8 __U, __m512d __A) { return (__m256) __builtin_ia32_cvtpd2ps512_mask ((__v8df) __A, (__v8sf) _mm256_setzero_ps (), (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_cvtpd_pslo (__m512d __A) { return (__m512) __builtin_shufflevector((__v8sf) _mm512_cvtpd_ps(__A), (__v8sf) _mm256_setzero_ps (), 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_mask_cvtpd_pslo (__m512 __W, __mmask8 __U,__m512d __A) { return (__m512) __builtin_shufflevector ( (__v8sf) _mm512_mask_cvtpd_ps (_mm512_castps512_ps256(__W), __U, __A), (__v8sf) _mm256_setzero_ps (), 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); } #define _mm512_cvt_roundps_ph(A, I) __extension__ ({ \ (__m256i)__builtin_ia32_vcvtps2ph512_mask((__v16sf)(__m512)(A), (int)(I), \ (__v16hi)_mm256_undefined_si256(), \ (__mmask16)-1); }) #define _mm512_mask_cvt_roundps_ph(U, W, A, I) __extension__ ({ \ (__m256i)__builtin_ia32_vcvtps2ph512_mask((__v16sf)(__m512)(A), (int)(I), \ (__v16hi)(__m256i)(U), \ (__mmask16)(W)); }) #define _mm512_maskz_cvt_roundps_ph(W, A, I) __extension__ ({ \ (__m256i)__builtin_ia32_vcvtps2ph512_mask((__v16sf)(__m512)(A), (int)(I), \ (__v16hi)_mm256_setzero_si256(), \ (__mmask16)(W)); }) #define _mm512_cvtps_ph(A, I) __extension__ ({ \ (__m256i)__builtin_ia32_vcvtps2ph512_mask((__v16sf)(__m512)(A), (int)(I), \ (__v16hi)_mm256_setzero_si256(), \ (__mmask16)-1); }) #define _mm512_mask_cvtps_ph(U, W, A, I) __extension__ ({ \ (__m256i)__builtin_ia32_vcvtps2ph512_mask((__v16sf)(__m512)(A), (int)(I), \ (__v16hi)(__m256i)(U), \ (__mmask16)(W)); }) #define _mm512_maskz_cvtps_ph(W, A, I) __extension__ ({\ (__m256i)__builtin_ia32_vcvtps2ph512_mask((__v16sf)(__m512)(A), (int)(I), \ (__v16hi)_mm256_setzero_si256(), \ (__mmask16)(W)); }) #define _mm512_cvt_roundph_ps(A, R) __extension__ ({ \ (__m512)__builtin_ia32_vcvtph2ps512_mask((__v16hi)(__m256i)(A), \ (__v16sf)_mm512_undefined_ps(), \ (__mmask16)-1, (int)(R)); }) #define _mm512_mask_cvt_roundph_ps(W, U, A, R) __extension__ ({ \ (__m512)__builtin_ia32_vcvtph2ps512_mask((__v16hi)(__m256i)(A), \ (__v16sf)(__m512)(W), \ (__mmask16)(U), (int)(R)); }) #define _mm512_maskz_cvt_roundph_ps(U, A, R) __extension__ ({ \ (__m512)__builtin_ia32_vcvtph2ps512_mask((__v16hi)(__m256i)(A), \ (__v16sf)_mm512_setzero_ps(), \ (__mmask16)(U), (int)(R)); }) static __inline __m512 __DEFAULT_FN_ATTRS _mm512_cvtph_ps(__m256i __A) { return (__m512) __builtin_ia32_vcvtph2ps512_mask ((__v16hi) __A, (__v16sf) _mm512_setzero_ps (), (__mmask16) -1, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_mask_cvtph_ps (__m512 __W, __mmask16 __U, __m256i __A) { return (__m512) __builtin_ia32_vcvtph2ps512_mask ((__v16hi) __A, (__v16sf) __W, (__mmask16) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_maskz_cvtph_ps (__mmask16 __U, __m256i __A) { return (__m512) __builtin_ia32_vcvtph2ps512_mask ((__v16hi) __A, (__v16sf) _mm512_setzero_ps (), (__mmask16) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm512_cvtt_roundpd_epi32(A, R) __extension__ ({ \ (__m256i)__builtin_ia32_cvttpd2dq512_mask((__v8df)(__m512d)(A), \ (__v8si)_mm256_setzero_si256(), \ (__mmask8)-1, (int)(R)); }) #define _mm512_mask_cvtt_roundpd_epi32(W, U, A, R) __extension__ ({ \ (__m256i)__builtin_ia32_cvttpd2dq512_mask((__v8df)(__m512d)(A), \ (__v8si)(__m256i)(W), \ (__mmask8)(U), (int)(R)); }) #define _mm512_maskz_cvtt_roundpd_epi32(U, A, R) __extension__ ({ \ (__m256i)__builtin_ia32_cvttpd2dq512_mask((__v8df)(__m512d)(A), \ (__v8si)_mm256_setzero_si256(), \ (__mmask8)(U), (int)(R)); }) static __inline __m256i __DEFAULT_FN_ATTRS _mm512_cvttpd_epi32(__m512d __a) { return (__m256i)__builtin_ia32_cvttpd2dq512_mask((__v8df) __a, (__v8si)_mm256_setzero_si256(), (__mmask8) -1, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm512_mask_cvttpd_epi32 (__m256i __W, __mmask8 __U, __m512d __A) { return (__m256i) __builtin_ia32_cvttpd2dq512_mask ((__v8df) __A, (__v8si) __W, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm512_maskz_cvttpd_epi32 (__mmask8 __U, __m512d __A) { return (__m256i) __builtin_ia32_cvttpd2dq512_mask ((__v8df) __A, (__v8si) _mm256_setzero_si256 (), (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm512_cvtt_roundps_epi32(A, R) __extension__ ({ \ (__m512i)__builtin_ia32_cvttps2dq512_mask((__v16sf)(__m512)(A), \ (__v16si)_mm512_setzero_si512(), \ (__mmask16)-1, (int)(R)); }) #define _mm512_mask_cvtt_roundps_epi32(W, U, A, R) __extension__ ({ \ (__m512i)__builtin_ia32_cvttps2dq512_mask((__v16sf)(__m512)(A), \ (__v16si)(__m512i)(W), \ (__mmask16)(U), (int)(R)); }) #define _mm512_maskz_cvtt_roundps_epi32(U, A, R) __extension__ ({ \ (__m512i)__builtin_ia32_cvttps2dq512_mask((__v16sf)(__m512)(A), \ (__v16si)_mm512_setzero_si512(), \ (__mmask16)(U), (int)(R)); }) static __inline __m512i __DEFAULT_FN_ATTRS _mm512_cvttps_epi32(__m512 __a) { return (__m512i) __builtin_ia32_cvttps2dq512_mask((__v16sf) __a, (__v16si) _mm512_setzero_si512 (), (__mmask16) -1, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_cvttps_epi32 (__m512i __W, __mmask16 __U, __m512 __A) { return (__m512i) __builtin_ia32_cvttps2dq512_mask ((__v16sf) __A, (__v16si) __W, (__mmask16) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_cvttps_epi32 (__mmask16 __U, __m512 __A) { return (__m512i) __builtin_ia32_cvttps2dq512_mask ((__v16sf) __A, (__v16si) _mm512_setzero_si512 (), (__mmask16) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm512_cvt_roundps_epi32(A, R) __extension__ ({ \ (__m512i)__builtin_ia32_cvtps2dq512_mask((__v16sf)(__m512)(A), \ (__v16si)_mm512_setzero_si512(), \ (__mmask16)-1, (int)(R)); }) #define _mm512_mask_cvt_roundps_epi32(W, U, A, R) __extension__ ({ \ (__m512i)__builtin_ia32_cvtps2dq512_mask((__v16sf)(__m512)(A), \ (__v16si)(__m512i)(W), \ (__mmask16)(U), (int)(R)); }) #define _mm512_maskz_cvt_roundps_epi32(U, A, R) __extension__ ({ \ (__m512i)__builtin_ia32_cvtps2dq512_mask((__v16sf)(__m512)(A), \ (__v16si)_mm512_setzero_si512(), \ (__mmask16)(U), (int)(R)); }) static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_cvtps_epi32 (__m512 __A) { return (__m512i) __builtin_ia32_cvtps2dq512_mask ((__v16sf) __A, (__v16si) _mm512_undefined_epi32 (), (__mmask16) -1, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_cvtps_epi32 (__m512i __W, __mmask16 __U, __m512 __A) { return (__m512i) __builtin_ia32_cvtps2dq512_mask ((__v16sf) __A, (__v16si) __W, (__mmask16) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_cvtps_epi32 (__mmask16 __U, __m512 __A) { return (__m512i) __builtin_ia32_cvtps2dq512_mask ((__v16sf) __A, (__v16si) _mm512_setzero_si512 (), (__mmask16) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm512_cvt_roundpd_epi32(A, R) __extension__ ({ \ (__m256i)__builtin_ia32_cvtpd2dq512_mask((__v8df)(__m512d)(A), \ (__v8si)_mm256_setzero_si256(), \ (__mmask8)-1, (int)(R)); }) #define _mm512_mask_cvt_roundpd_epi32(W, U, A, R) __extension__ ({ \ (__m256i)__builtin_ia32_cvtpd2dq512_mask((__v8df)(__m512d)(A), \ (__v8si)(__m256i)(W), \ (__mmask8)(U), (int)(R)); }) #define _mm512_maskz_cvt_roundpd_epi32(U, A, R) __extension__ ({ \ (__m256i)__builtin_ia32_cvtpd2dq512_mask((__v8df)(__m512d)(A), \ (__v8si)_mm256_setzero_si256(), \ (__mmask8)(U), (int)(R)); }) static __inline__ __m256i __DEFAULT_FN_ATTRS _mm512_cvtpd_epi32 (__m512d __A) { return (__m256i) __builtin_ia32_cvtpd2dq512_mask ((__v8df) __A, (__v8si) _mm256_undefined_si256 (), (__mmask8) -1, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm512_mask_cvtpd_epi32 (__m256i __W, __mmask8 __U, __m512d __A) { return (__m256i) __builtin_ia32_cvtpd2dq512_mask ((__v8df) __A, (__v8si) __W, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm512_maskz_cvtpd_epi32 (__mmask8 __U, __m512d __A) { return (__m256i) __builtin_ia32_cvtpd2dq512_mask ((__v8df) __A, (__v8si) _mm256_setzero_si256 (), (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm512_cvt_roundps_epu32(A, R) __extension__ ({ \ (__m512i)__builtin_ia32_cvtps2udq512_mask((__v16sf)(__m512)(A), \ (__v16si)_mm512_setzero_si512(), \ (__mmask16)-1, (int)(R)); }) #define _mm512_mask_cvt_roundps_epu32(W, U, A, R) __extension__ ({ \ (__m512i)__builtin_ia32_cvtps2udq512_mask((__v16sf)(__m512)(A), \ (__v16si)(__m512i)(W), \ (__mmask16)(U), (int)(R)); }) #define _mm512_maskz_cvt_roundps_epu32(U, A, R) __extension__ ({ \ (__m512i)__builtin_ia32_cvtps2udq512_mask((__v16sf)(__m512)(A), \ (__v16si)_mm512_setzero_si512(), \ (__mmask16)(U), (int)(R)); }) static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_cvtps_epu32 ( __m512 __A) { return (__m512i) __builtin_ia32_cvtps2udq512_mask ((__v16sf) __A,\ (__v16si)\ _mm512_undefined_epi32 (),\ (__mmask16) -1,\ _MM_FROUND_CUR_DIRECTION);\ } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_cvtps_epu32 (__m512i __W, __mmask16 __U, __m512 __A) { return (__m512i) __builtin_ia32_cvtps2udq512_mask ((__v16sf) __A, (__v16si) __W, (__mmask16) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_cvtps_epu32 ( __mmask16 __U, __m512 __A) { return (__m512i) __builtin_ia32_cvtps2udq512_mask ((__v16sf) __A, (__v16si) _mm512_setzero_si512 (), (__mmask16) __U , _MM_FROUND_CUR_DIRECTION); } #define _mm512_cvt_roundpd_epu32(A, R) __extension__ ({ \ (__m256i)__builtin_ia32_cvtpd2udq512_mask((__v8df)(__m512d)(A), \ (__v8si)_mm256_setzero_si256(), \ (__mmask8)-1, (int)(R)); }) #define _mm512_mask_cvt_roundpd_epu32(W, U, A, R) __extension__ ({ \ (__m256i)__builtin_ia32_cvtpd2udq512_mask((__v8df)(__m512d)(A), \ (__v8si)(W), \ (__mmask8)(U), (int)(R)); }) #define _mm512_maskz_cvt_roundpd_epu32(U, A, R) __extension__ ({ \ (__m256i)__builtin_ia32_cvtpd2udq512_mask((__v8df)(__m512d)(A), \ (__v8si)_mm256_setzero_si256(), \ (__mmask8)(U), (int)(R)); }) static __inline__ __m256i __DEFAULT_FN_ATTRS _mm512_cvtpd_epu32 (__m512d __A) { return (__m256i) __builtin_ia32_cvtpd2udq512_mask ((__v8df) __A, (__v8si) _mm256_undefined_si256 (), (__mmask8) -1, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm512_mask_cvtpd_epu32 (__m256i __W, __mmask8 __U, __m512d __A) { return (__m256i) __builtin_ia32_cvtpd2udq512_mask ((__v8df) __A, (__v8si) __W, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm512_maskz_cvtpd_epu32 (__mmask8 __U, __m512d __A) { return (__m256i) __builtin_ia32_cvtpd2udq512_mask ((__v8df) __A, (__v8si) _mm256_setzero_si256 (), (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ double __DEFAULT_FN_ATTRS _mm512_cvtsd_f64(__m512d __a) { return __a[0]; } static __inline__ float __DEFAULT_FN_ATTRS _mm512_cvtss_f32(__m512 __a) { return __a[0]; } /* Unpack and Interleave */ static __inline __m512d __DEFAULT_FN_ATTRS _mm512_unpackhi_pd(__m512d __a, __m512d __b) { return (__m512d)__builtin_shufflevector((__v8df)__a, (__v8df)__b, 1, 9, 1+2, 9+2, 1+4, 9+4, 1+6, 9+6); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_mask_unpackhi_pd(__m512d __W, __mmask8 __U, __m512d __A, __m512d __B) { return (__m512d)__builtin_ia32_selectpd_512((__mmask8) __U, (__v8df)_mm512_unpackhi_pd(__A, __B), (__v8df)__W); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_maskz_unpackhi_pd(__mmask8 __U, __m512d __A, __m512d __B) { return (__m512d)__builtin_ia32_selectpd_512((__mmask8) __U, (__v8df)_mm512_unpackhi_pd(__A, __B), (__v8df)_mm512_setzero_pd()); } static __inline __m512d __DEFAULT_FN_ATTRS _mm512_unpacklo_pd(__m512d __a, __m512d __b) { return (__m512d)__builtin_shufflevector((__v8df)__a, (__v8df)__b, 0, 8, 0+2, 8+2, 0+4, 8+4, 0+6, 8+6); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_mask_unpacklo_pd(__m512d __W, __mmask8 __U, __m512d __A, __m512d __B) { return (__m512d)__builtin_ia32_selectpd_512((__mmask8) __U, (__v8df)_mm512_unpacklo_pd(__A, __B), (__v8df)__W); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_maskz_unpacklo_pd (__mmask8 __U, __m512d __A, __m512d __B) { return (__m512d)__builtin_ia32_selectpd_512((__mmask8) __U, (__v8df)_mm512_unpacklo_pd(__A, __B), (__v8df)_mm512_setzero_pd()); } static __inline __m512 __DEFAULT_FN_ATTRS _mm512_unpackhi_ps(__m512 __a, __m512 __b) { return (__m512)__builtin_shufflevector((__v16sf)__a, (__v16sf)__b, 2, 18, 3, 19, 2+4, 18+4, 3+4, 19+4, 2+8, 18+8, 3+8, 19+8, 2+12, 18+12, 3+12, 19+12); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_mask_unpackhi_ps(__m512 __W, __mmask16 __U, __m512 __A, __m512 __B) { return (__m512)__builtin_ia32_selectps_512((__mmask16) __U, (__v16sf)_mm512_unpackhi_ps(__A, __B), (__v16sf)__W); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_maskz_unpackhi_ps (__mmask16 __U, __m512 __A, __m512 __B) { return (__m512)__builtin_ia32_selectps_512((__mmask16) __U, (__v16sf)_mm512_unpackhi_ps(__A, __B), (__v16sf)_mm512_setzero_ps()); } static __inline __m512 __DEFAULT_FN_ATTRS _mm512_unpacklo_ps(__m512 __a, __m512 __b) { return (__m512)__builtin_shufflevector((__v16sf)__a, (__v16sf)__b, 0, 16, 1, 17, 0+4, 16+4, 1+4, 17+4, 0+8, 16+8, 1+8, 17+8, 0+12, 16+12, 1+12, 17+12); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_mask_unpacklo_ps(__m512 __W, __mmask16 __U, __m512 __A, __m512 __B) { return (__m512)__builtin_ia32_selectps_512((__mmask16) __U, (__v16sf)_mm512_unpacklo_ps(__A, __B), (__v16sf)__W); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_maskz_unpacklo_ps (__mmask16 __U, __m512 __A, __m512 __B) { return (__m512)__builtin_ia32_selectps_512((__mmask16) __U, (__v16sf)_mm512_unpacklo_ps(__A, __B), (__v16sf)_mm512_setzero_ps()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_unpackhi_epi32(__m512i __A, __m512i __B) { return (__m512i)__builtin_shufflevector((__v16si)__A, (__v16si)__B, 2, 18, 3, 19, 2+4, 18+4, 3+4, 19+4, 2+8, 18+8, 3+8, 19+8, 2+12, 18+12, 3+12, 19+12); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_unpackhi_epi32(__m512i __W, __mmask16 __U, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectd_512((__mmask16) __U, (__v16si)_mm512_unpackhi_epi32(__A, __B), (__v16si)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_unpackhi_epi32(__mmask16 __U, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectd_512((__mmask16) __U, (__v16si)_mm512_unpackhi_epi32(__A, __B), (__v16si)_mm512_setzero_si512()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_unpacklo_epi32(__m512i __A, __m512i __B) { return (__m512i)__builtin_shufflevector((__v16si)__A, (__v16si)__B, 0, 16, 1, 17, 0+4, 16+4, 1+4, 17+4, 0+8, 16+8, 1+8, 17+8, 0+12, 16+12, 1+12, 17+12); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_unpacklo_epi32(__m512i __W, __mmask16 __U, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectd_512((__mmask16) __U, (__v16si)_mm512_unpacklo_epi32(__A, __B), (__v16si)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_unpacklo_epi32(__mmask16 __U, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectd_512((__mmask16) __U, (__v16si)_mm512_unpacklo_epi32(__A, __B), (__v16si)_mm512_setzero_si512()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_unpackhi_epi64(__m512i __A, __m512i __B) { return (__m512i)__builtin_shufflevector((__v8di)__A, (__v8di)__B, 1, 9, 1+2, 9+2, 1+4, 9+4, 1+6, 9+6); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_unpackhi_epi64(__m512i __W, __mmask8 __U, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectq_512((__mmask8) __U, (__v8di)_mm512_unpackhi_epi64(__A, __B), (__v8di)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_unpackhi_epi64(__mmask8 __U, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectq_512((__mmask8) __U, (__v8di)_mm512_unpackhi_epi64(__A, __B), (__v8di)_mm512_setzero_si512()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_unpacklo_epi64 (__m512i __A, __m512i __B) { return (__m512i)__builtin_shufflevector((__v8di)__A, (__v8di)__B, 0, 8, 0+2, 8+2, 0+4, 8+4, 0+6, 8+6); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_unpacklo_epi64 (__m512i __W, __mmask8 __U, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectq_512((__mmask8) __U, (__v8di)_mm512_unpacklo_epi64(__A, __B), (__v8di)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_unpacklo_epi64 (__mmask8 __U, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectq_512((__mmask8) __U, (__v8di)_mm512_unpacklo_epi64(__A, __B), (__v8di)_mm512_setzero_si512()); } /* SIMD load ops */ static __inline __m512i __DEFAULT_FN_ATTRS _mm512_loadu_si512 (void const *__P) { return (__m512i) __builtin_ia32_loaddqusi512_mask ((const int *) __P, (__v16si) _mm512_setzero_si512 (), (__mmask16) -1); } static __inline __m512i __DEFAULT_FN_ATTRS _mm512_mask_loadu_epi32 (__m512i __W, __mmask16 __U, void const *__P) { return (__m512i) __builtin_ia32_loaddqusi512_mask ((const int *) __P, (__v16si) __W, (__mmask16) __U); } static __inline __m512i __DEFAULT_FN_ATTRS _mm512_maskz_loadu_epi32(__mmask16 __U, void const *__P) { return (__m512i) __builtin_ia32_loaddqusi512_mask ((const int *)__P, (__v16si) _mm512_setzero_si512 (), (__mmask16) __U); } static __inline __m512i __DEFAULT_FN_ATTRS _mm512_mask_loadu_epi64 (__m512i __W, __mmask8 __U, void const *__P) { return (__m512i) __builtin_ia32_loaddqudi512_mask ((const long long *) __P, (__v8di) __W, (__mmask8) __U); } static __inline __m512i __DEFAULT_FN_ATTRS _mm512_maskz_loadu_epi64(__mmask8 __U, void const *__P) { return (__m512i) __builtin_ia32_loaddqudi512_mask ((const long long *)__P, (__v8di) _mm512_setzero_si512 (), (__mmask8) __U); } static __inline __m512 __DEFAULT_FN_ATTRS _mm512_mask_loadu_ps (__m512 __W, __mmask16 __U, void const *__P) { return (__m512) __builtin_ia32_loadups512_mask ((const float *) __P, (__v16sf) __W, (__mmask16) __U); } static __inline __m512 __DEFAULT_FN_ATTRS _mm512_maskz_loadu_ps(__mmask16 __U, void const *__P) { return (__m512) __builtin_ia32_loadups512_mask ((const float *)__P, (__v16sf) _mm512_setzero_ps (), (__mmask16) __U); } static __inline __m512d __DEFAULT_FN_ATTRS _mm512_mask_loadu_pd (__m512d __W, __mmask8 __U, void const *__P) { return (__m512d) __builtin_ia32_loadupd512_mask ((const double *) __P, (__v8df) __W, (__mmask8) __U); } static __inline __m512d __DEFAULT_FN_ATTRS _mm512_maskz_loadu_pd(__mmask8 __U, void const *__P) { return (__m512d) __builtin_ia32_loadupd512_mask ((const double *)__P, (__v8df) _mm512_setzero_pd (), (__mmask8) __U); } static __inline __m512d __DEFAULT_FN_ATTRS _mm512_loadu_pd(void const *__p) { struct __loadu_pd { __m512d __v; } __attribute__((__packed__, __may_alias__)); return ((struct __loadu_pd*)__p)->__v; } static __inline __m512 __DEFAULT_FN_ATTRS _mm512_loadu_ps(void const *__p) { struct __loadu_ps { __m512 __v; } __attribute__((__packed__, __may_alias__)); return ((struct __loadu_ps*)__p)->__v; } static __inline __m512 __DEFAULT_FN_ATTRS _mm512_load_ps(void const *__p) { return (__m512) __builtin_ia32_loadaps512_mask ((const __v16sf *)__p, (__v16sf) _mm512_setzero_ps (), (__mmask16) -1); } static __inline __m512 __DEFAULT_FN_ATTRS _mm512_mask_load_ps (__m512 __W, __mmask16 __U, void const *__P) { return (__m512) __builtin_ia32_loadaps512_mask ((const __v16sf *) __P, (__v16sf) __W, (__mmask16) __U); } static __inline __m512 __DEFAULT_FN_ATTRS _mm512_maskz_load_ps(__mmask16 __U, void const *__P) { return (__m512) __builtin_ia32_loadaps512_mask ((const __v16sf *)__P, (__v16sf) _mm512_setzero_ps (), (__mmask16) __U); } static __inline __m512d __DEFAULT_FN_ATTRS _mm512_load_pd(void const *__p) { return (__m512d) __builtin_ia32_loadapd512_mask ((const __v8df *)__p, (__v8df) _mm512_setzero_pd (), (__mmask8) -1); } static __inline __m512d __DEFAULT_FN_ATTRS _mm512_mask_load_pd (__m512d __W, __mmask8 __U, void const *__P) { return (__m512d) __builtin_ia32_loadapd512_mask ((const __v8df *) __P, (__v8df) __W, (__mmask8) __U); } static __inline __m512d __DEFAULT_FN_ATTRS _mm512_maskz_load_pd(__mmask8 __U, void const *__P) { return (__m512d) __builtin_ia32_loadapd512_mask ((const __v8df *)__P, (__v8df) _mm512_setzero_pd (), (__mmask8) __U); } static __inline __m512i __DEFAULT_FN_ATTRS _mm512_load_si512 (void const *__P) { return *(__m512i *) __P; } static __inline __m512i __DEFAULT_FN_ATTRS _mm512_load_epi32 (void const *__P) { return *(__m512i *) __P; } static __inline __m512i __DEFAULT_FN_ATTRS _mm512_load_epi64 (void const *__P) { return *(__m512i *) __P; } /* SIMD store ops */ static __inline void __DEFAULT_FN_ATTRS _mm512_mask_storeu_epi64(void *__P, __mmask8 __U, __m512i __A) { __builtin_ia32_storedqudi512_mask ((long long *)__P, (__v8di) __A, (__mmask8) __U); } static __inline void __DEFAULT_FN_ATTRS _mm512_storeu_si512 (void *__P, __m512i __A) { __builtin_ia32_storedqusi512_mask ((int *) __P, (__v16si) __A, (__mmask16) -1); } static __inline void __DEFAULT_FN_ATTRS _mm512_mask_storeu_epi32(void *__P, __mmask16 __U, __m512i __A) { __builtin_ia32_storedqusi512_mask ((int *)__P, (__v16si) __A, (__mmask16) __U); } static __inline void __DEFAULT_FN_ATTRS _mm512_mask_storeu_pd(void *__P, __mmask8 __U, __m512d __A) { __builtin_ia32_storeupd512_mask ((double *)__P, (__v8df) __A, (__mmask8) __U); } static __inline void __DEFAULT_FN_ATTRS _mm512_storeu_pd(void *__P, __m512d __A) { __builtin_ia32_storeupd512_mask((double *)__P, (__v8df)__A, (__mmask8)-1); } static __inline void __DEFAULT_FN_ATTRS _mm512_mask_storeu_ps(void *__P, __mmask16 __U, __m512 __A) { __builtin_ia32_storeups512_mask ((float *)__P, (__v16sf) __A, (__mmask16) __U); } static __inline void __DEFAULT_FN_ATTRS _mm512_storeu_ps(void *__P, __m512 __A) { __builtin_ia32_storeups512_mask((float *)__P, (__v16sf)__A, (__mmask16)-1); } static __inline void __DEFAULT_FN_ATTRS _mm512_mask_store_pd(void *__P, __mmask8 __U, __m512d __A) { __builtin_ia32_storeapd512_mask ((__v8df *)__P, (__v8df) __A, (__mmask8) __U); } static __inline void __DEFAULT_FN_ATTRS _mm512_store_pd(void *__P, __m512d __A) { *(__m512d*)__P = __A; } static __inline void __DEFAULT_FN_ATTRS _mm512_mask_store_ps(void *__P, __mmask16 __U, __m512 __A) { __builtin_ia32_storeaps512_mask ((__v16sf *)__P, (__v16sf) __A, (__mmask16) __U); } static __inline void __DEFAULT_FN_ATTRS _mm512_store_ps(void *__P, __m512 __A) { *(__m512*)__P = __A; } static __inline void __DEFAULT_FN_ATTRS _mm512_store_si512 (void *__P, __m512i __A) { *(__m512i *) __P = __A; } static __inline void __DEFAULT_FN_ATTRS _mm512_store_epi32 (void *__P, __m512i __A) { *(__m512i *) __P = __A; } static __inline void __DEFAULT_FN_ATTRS _mm512_store_epi64 (void *__P, __m512i __A) { *(__m512i *) __P = __A; } /* Mask ops */ static __inline __mmask16 __DEFAULT_FN_ATTRS _mm512_knot(__mmask16 __M) { return __builtin_ia32_knothi(__M); } /* Integer compare */ #define _mm512_cmpeq_epi32_mask(A, B) \ _mm512_cmp_epi32_mask((A), (B), _MM_CMPINT_EQ) #define _mm512_mask_cmpeq_epi32_mask(k, A, B) \ _mm512_mask_cmp_epi32_mask((k), (A), (B), _MM_CMPINT_EQ) #define _mm512_cmpge_epi32_mask(A, B) \ _mm512_cmp_epi32_mask((A), (B), _MM_CMPINT_GE) #define _mm512_mask_cmpge_epi32_mask(k, A, B) \ _mm512_mask_cmp_epi32_mask((k), (A), (B), _MM_CMPINT_GE) #define _mm512_cmpgt_epi32_mask(A, B) \ _mm512_cmp_epi32_mask((A), (B), _MM_CMPINT_GT) #define _mm512_mask_cmpgt_epi32_mask(k, A, B) \ _mm512_mask_cmp_epi32_mask((k), (A), (B), _MM_CMPINT_GT) #define _mm512_cmple_epi32_mask(A, B) \ _mm512_cmp_epi32_mask((A), (B), _MM_CMPINT_LE) #define _mm512_mask_cmple_epi32_mask(k, A, B) \ _mm512_mask_cmp_epi32_mask((k), (A), (B), _MM_CMPINT_LE) #define _mm512_cmplt_epi32_mask(A, B) \ _mm512_cmp_epi32_mask((A), (B), _MM_CMPINT_LT) #define _mm512_mask_cmplt_epi32_mask(k, A, B) \ _mm512_mask_cmp_epi32_mask((k), (A), (B), _MM_CMPINT_LT) #define _mm512_cmpneq_epi32_mask(A, B) \ _mm512_cmp_epi32_mask((A), (B), _MM_CMPINT_NE) #define _mm512_mask_cmpneq_epi32_mask(k, A, B) \ _mm512_mask_cmp_epi32_mask((k), (A), (B), _MM_CMPINT_NE) #define _mm512_cmpeq_epu32_mask(A, B) \ _mm512_cmp_epu32_mask((A), (B), _MM_CMPINT_EQ) #define _mm512_mask_cmpeq_epu32_mask(k, A, B) \ _mm512_mask_cmp_epu32_mask((k), (A), (B), _MM_CMPINT_EQ) #define _mm512_cmpge_epu32_mask(A, B) \ _mm512_cmp_epu32_mask((A), (B), _MM_CMPINT_GE) #define _mm512_mask_cmpge_epu32_mask(k, A, B) \ _mm512_mask_cmp_epu32_mask((k), (A), (B), _MM_CMPINT_GE) #define _mm512_cmpgt_epu32_mask(A, B) \ _mm512_cmp_epu32_mask((A), (B), _MM_CMPINT_GT) #define _mm512_mask_cmpgt_epu32_mask(k, A, B) \ _mm512_mask_cmp_epu32_mask((k), (A), (B), _MM_CMPINT_GT) #define _mm512_cmple_epu32_mask(A, B) \ _mm512_cmp_epu32_mask((A), (B), _MM_CMPINT_LE) #define _mm512_mask_cmple_epu32_mask(k, A, B) \ _mm512_mask_cmp_epu32_mask((k), (A), (B), _MM_CMPINT_LE) #define _mm512_cmplt_epu32_mask(A, B) \ _mm512_cmp_epu32_mask((A), (B), _MM_CMPINT_LT) #define _mm512_mask_cmplt_epu32_mask(k, A, B) \ _mm512_mask_cmp_epu32_mask((k), (A), (B), _MM_CMPINT_LT) #define _mm512_cmpneq_epu32_mask(A, B) \ _mm512_cmp_epu32_mask((A), (B), _MM_CMPINT_NE) #define _mm512_mask_cmpneq_epu32_mask(k, A, B) \ _mm512_mask_cmp_epu32_mask((k), (A), (B), _MM_CMPINT_NE) #define _mm512_cmpeq_epi64_mask(A, B) \ _mm512_cmp_epi64_mask((A), (B), _MM_CMPINT_EQ) #define _mm512_mask_cmpeq_epi64_mask(k, A, B) \ _mm512_mask_cmp_epi64_mask((k), (A), (B), _MM_CMPINT_EQ) #define _mm512_cmpge_epi64_mask(A, B) \ _mm512_cmp_epi64_mask((A), (B), _MM_CMPINT_GE) #define _mm512_mask_cmpge_epi64_mask(k, A, B) \ _mm512_mask_cmp_epi64_mask((k), (A), (B), _MM_CMPINT_GE) #define _mm512_cmpgt_epi64_mask(A, B) \ _mm512_cmp_epi64_mask((A), (B), _MM_CMPINT_GT) #define _mm512_mask_cmpgt_epi64_mask(k, A, B) \ _mm512_mask_cmp_epi64_mask((k), (A), (B), _MM_CMPINT_GT) #define _mm512_cmple_epi64_mask(A, B) \ _mm512_cmp_epi64_mask((A), (B), _MM_CMPINT_LE) #define _mm512_mask_cmple_epi64_mask(k, A, B) \ _mm512_mask_cmp_epi64_mask((k), (A), (B), _MM_CMPINT_LE) #define _mm512_cmplt_epi64_mask(A, B) \ _mm512_cmp_epi64_mask((A), (B), _MM_CMPINT_LT) #define _mm512_mask_cmplt_epi64_mask(k, A, B) \ _mm512_mask_cmp_epi64_mask((k), (A), (B), _MM_CMPINT_LT) #define _mm512_cmpneq_epi64_mask(A, B) \ _mm512_cmp_epi64_mask((A), (B), _MM_CMPINT_NE) #define _mm512_mask_cmpneq_epi64_mask(k, A, B) \ _mm512_mask_cmp_epi64_mask((k), (A), (B), _MM_CMPINT_NE) #define _mm512_cmpeq_epu64_mask(A, B) \ _mm512_cmp_epu64_mask((A), (B), _MM_CMPINT_EQ) #define _mm512_mask_cmpeq_epu64_mask(k, A, B) \ _mm512_mask_cmp_epu64_mask((k), (A), (B), _MM_CMPINT_EQ) #define _mm512_cmpge_epu64_mask(A, B) \ _mm512_cmp_epu64_mask((A), (B), _MM_CMPINT_GE) #define _mm512_mask_cmpge_epu64_mask(k, A, B) \ _mm512_mask_cmp_epu64_mask((k), (A), (B), _MM_CMPINT_GE) #define _mm512_cmpgt_epu64_mask(A, B) \ _mm512_cmp_epu64_mask((A), (B), _MM_CMPINT_GT) #define _mm512_mask_cmpgt_epu64_mask(k, A, B) \ _mm512_mask_cmp_epu64_mask((k), (A), (B), _MM_CMPINT_GT) #define _mm512_cmple_epu64_mask(A, B) \ _mm512_cmp_epu64_mask((A), (B), _MM_CMPINT_LE) #define _mm512_mask_cmple_epu64_mask(k, A, B) \ _mm512_mask_cmp_epu64_mask((k), (A), (B), _MM_CMPINT_LE) #define _mm512_cmplt_epu64_mask(A, B) \ _mm512_cmp_epu64_mask((A), (B), _MM_CMPINT_LT) #define _mm512_mask_cmplt_epu64_mask(k, A, B) \ _mm512_mask_cmp_epu64_mask((k), (A), (B), _MM_CMPINT_LT) #define _mm512_cmpneq_epu64_mask(A, B) \ _mm512_cmp_epu64_mask((A), (B), _MM_CMPINT_NE) #define _mm512_mask_cmpneq_epu64_mask(k, A, B) \ _mm512_mask_cmp_epu64_mask((k), (A), (B), _MM_CMPINT_NE) static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_cvtepi8_epi32(__m128i __A) { /* This function always performs a signed extension, but __v16qi is a char which may be signed or unsigned, so use __v16qs. */ return (__m512i)__builtin_convertvector((__v16qs)__A, __v16si); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_cvtepi8_epi32(__m512i __W, __mmask16 __U, __m128i __A) { return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U, (__v16si)_mm512_cvtepi8_epi32(__A), (__v16si)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_cvtepi8_epi32(__mmask16 __U, __m128i __A) { return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U, (__v16si)_mm512_cvtepi8_epi32(__A), (__v16si)_mm512_setzero_si512()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_cvtepi8_epi64(__m128i __A) { /* This function always performs a signed extension, but __v16qi is a char which may be signed or unsigned, so use __v16qs. */ return (__m512i)__builtin_convertvector(__builtin_shufflevector((__v16qs)__A, (__v16qs)__A, 0, 1, 2, 3, 4, 5, 6, 7), __v8di); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_cvtepi8_epi64(__m512i __W, __mmask8 __U, __m128i __A) { return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U, (__v8di)_mm512_cvtepi8_epi64(__A), (__v8di)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_cvtepi8_epi64(__mmask8 __U, __m128i __A) { return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U, (__v8di)_mm512_cvtepi8_epi64(__A), (__v8di)_mm512_setzero_si512 ()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_cvtepi32_epi64(__m256i __X) { return (__m512i)__builtin_convertvector((__v8si)__X, __v8di); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_cvtepi32_epi64(__m512i __W, __mmask8 __U, __m256i __X) { return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U, (__v8di)_mm512_cvtepi32_epi64(__X), (__v8di)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_cvtepi32_epi64(__mmask8 __U, __m256i __X) { return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U, (__v8di)_mm512_cvtepi32_epi64(__X), (__v8di)_mm512_setzero_si512()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_cvtepi16_epi32(__m256i __A) { return (__m512i)__builtin_convertvector((__v16hi)__A, __v16si); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_cvtepi16_epi32(__m512i __W, __mmask16 __U, __m256i __A) { return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U, (__v16si)_mm512_cvtepi16_epi32(__A), (__v16si)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_cvtepi16_epi32(__mmask16 __U, __m256i __A) { return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U, (__v16si)_mm512_cvtepi16_epi32(__A), (__v16si)_mm512_setzero_si512 ()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_cvtepi16_epi64(__m128i __A) { return (__m512i)__builtin_convertvector((__v8hi)__A, __v8di); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_cvtepi16_epi64(__m512i __W, __mmask8 __U, __m128i __A) { return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U, (__v8di)_mm512_cvtepi16_epi64(__A), (__v8di)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_cvtepi16_epi64(__mmask8 __U, __m128i __A) { return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U, (__v8di)_mm512_cvtepi16_epi64(__A), (__v8di)_mm512_setzero_si512()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_cvtepu8_epi32(__m128i __A) { return (__m512i)__builtin_convertvector((__v16qu)__A, __v16si); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_cvtepu8_epi32(__m512i __W, __mmask16 __U, __m128i __A) { return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U, (__v16si)_mm512_cvtepu8_epi32(__A), (__v16si)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_cvtepu8_epi32(__mmask16 __U, __m128i __A) { return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U, (__v16si)_mm512_cvtepu8_epi32(__A), (__v16si)_mm512_setzero_si512()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_cvtepu8_epi64(__m128i __A) { return (__m512i)__builtin_convertvector(__builtin_shufflevector((__v16qu)__A, (__v16qu)__A, 0, 1, 2, 3, 4, 5, 6, 7), __v8di); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_cvtepu8_epi64(__m512i __W, __mmask8 __U, __m128i __A) { return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U, (__v8di)_mm512_cvtepu8_epi64(__A), (__v8di)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_cvtepu8_epi64(__mmask8 __U, __m128i __A) { return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U, (__v8di)_mm512_cvtepu8_epi64(__A), (__v8di)_mm512_setzero_si512()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_cvtepu32_epi64(__m256i __X) { return (__m512i)__builtin_convertvector((__v8su)__X, __v8di); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_cvtepu32_epi64(__m512i __W, __mmask8 __U, __m256i __X) { return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U, (__v8di)_mm512_cvtepu32_epi64(__X), (__v8di)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_cvtepu32_epi64(__mmask8 __U, __m256i __X) { return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U, (__v8di)_mm512_cvtepu32_epi64(__X), (__v8di)_mm512_setzero_si512()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_cvtepu16_epi32(__m256i __A) { return (__m512i)__builtin_convertvector((__v16hu)__A, __v16si); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_cvtepu16_epi32(__m512i __W, __mmask16 __U, __m256i __A) { return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U, (__v16si)_mm512_cvtepu16_epi32(__A), (__v16si)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_cvtepu16_epi32(__mmask16 __U, __m256i __A) { return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U, (__v16si)_mm512_cvtepu16_epi32(__A), (__v16si)_mm512_setzero_si512()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_cvtepu16_epi64(__m128i __A) { return (__m512i)__builtin_convertvector((__v8hu)__A, __v8di); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_cvtepu16_epi64(__m512i __W, __mmask8 __U, __m128i __A) { return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U, (__v8di)_mm512_cvtepu16_epi64(__A), (__v8di)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_cvtepu16_epi64(__mmask8 __U, __m128i __A) { return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U, (__v8di)_mm512_cvtepu16_epi64(__A), (__v8di)_mm512_setzero_si512()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_rorv_epi32 (__m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_prorvd512_mask ((__v16si) __A, (__v16si) __B, (__v16si) _mm512_setzero_si512 (), (__mmask16) -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_rorv_epi32 (__m512i __W, __mmask16 __U, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_prorvd512_mask ((__v16si) __A, (__v16si) __B, (__v16si) __W, (__mmask16) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_rorv_epi32 (__mmask16 __U, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_prorvd512_mask ((__v16si) __A, (__v16si) __B, (__v16si) _mm512_setzero_si512 (), (__mmask16) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_rorv_epi64 (__m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_prorvq512_mask ((__v8di) __A, (__v8di) __B, (__v8di) _mm512_setzero_si512 (), (__mmask8) -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_rorv_epi64 (__m512i __W, __mmask8 __U, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_prorvq512_mask ((__v8di) __A, (__v8di) __B, (__v8di) __W, (__mmask8) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_rorv_epi64 (__mmask8 __U, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_prorvq512_mask ((__v8di) __A, (__v8di) __B, (__v8di) _mm512_setzero_si512 (), (__mmask8) __U); } #define _mm512_cmp_epi32_mask(a, b, p) __extension__ ({ \ (__mmask16)__builtin_ia32_cmpd512_mask((__v16si)(__m512i)(a), \ (__v16si)(__m512i)(b), (int)(p), \ (__mmask16)-1); }) #define _mm512_cmp_epu32_mask(a, b, p) __extension__ ({ \ (__mmask16)__builtin_ia32_ucmpd512_mask((__v16si)(__m512i)(a), \ (__v16si)(__m512i)(b), (int)(p), \ (__mmask16)-1); }) #define _mm512_cmp_epi64_mask(a, b, p) __extension__ ({ \ (__mmask8)__builtin_ia32_cmpq512_mask((__v8di)(__m512i)(a), \ (__v8di)(__m512i)(b), (int)(p), \ (__mmask8)-1); }) #define _mm512_cmp_epu64_mask(a, b, p) __extension__ ({ \ (__mmask8)__builtin_ia32_ucmpq512_mask((__v8di)(__m512i)(a), \ (__v8di)(__m512i)(b), (int)(p), \ (__mmask8)-1); }) #define _mm512_mask_cmp_epi32_mask(m, a, b, p) __extension__ ({ \ (__mmask16)__builtin_ia32_cmpd512_mask((__v16si)(__m512i)(a), \ (__v16si)(__m512i)(b), (int)(p), \ (__mmask16)(m)); }) #define _mm512_mask_cmp_epu32_mask(m, a, b, p) __extension__ ({ \ (__mmask16)__builtin_ia32_ucmpd512_mask((__v16si)(__m512i)(a), \ (__v16si)(__m512i)(b), (int)(p), \ (__mmask16)(m)); }) #define _mm512_mask_cmp_epi64_mask(m, a, b, p) __extension__ ({ \ (__mmask8)__builtin_ia32_cmpq512_mask((__v8di)(__m512i)(a), \ (__v8di)(__m512i)(b), (int)(p), \ (__mmask8)(m)); }) #define _mm512_mask_cmp_epu64_mask(m, a, b, p) __extension__ ({ \ (__mmask8)__builtin_ia32_ucmpq512_mask((__v8di)(__m512i)(a), \ (__v8di)(__m512i)(b), (int)(p), \ (__mmask8)(m)); }) #define _mm512_rol_epi32(a, b) __extension__ ({ \ (__m512i)__builtin_ia32_prold512_mask((__v16si)(__m512i)(a), (int)(b), \ (__v16si)_mm512_setzero_si512(), \ (__mmask16)-1); }) #define _mm512_mask_rol_epi32(W, U, a, b) __extension__ ({ \ (__m512i)__builtin_ia32_prold512_mask((__v16si)(__m512i)(a), (int)(b), \ (__v16si)(__m512i)(W), \ (__mmask16)(U)); }) #define _mm512_maskz_rol_epi32(U, a, b) __extension__ ({ \ (__m512i)__builtin_ia32_prold512_mask((__v16si)(__m512i)(a), (int)(b), \ (__v16si)_mm512_setzero_si512(), \ (__mmask16)(U)); }) #define _mm512_rol_epi64(a, b) __extension__ ({ \ (__m512i)__builtin_ia32_prolq512_mask((__v8di)(__m512i)(a), (int)(b), \ (__v8di)_mm512_setzero_si512(), \ (__mmask8)-1); }) #define _mm512_mask_rol_epi64(W, U, a, b) __extension__ ({ \ (__m512i)__builtin_ia32_prolq512_mask((__v8di)(__m512i)(a), (int)(b), \ (__v8di)(__m512i)(W), (__mmask8)(U)); }) #define _mm512_maskz_rol_epi64(U, a, b) __extension__ ({ \ (__m512i)__builtin_ia32_prolq512_mask((__v8di)(__m512i)(a), (int)(b), \ (__v8di)_mm512_setzero_si512(), \ (__mmask8)(U)); }) static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_rolv_epi32 (__m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_prolvd512_mask ((__v16si) __A, (__v16si) __B, (__v16si) _mm512_setzero_si512 (), (__mmask16) -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_rolv_epi32 (__m512i __W, __mmask16 __U, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_prolvd512_mask ((__v16si) __A, (__v16si) __B, (__v16si) __W, (__mmask16) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_rolv_epi32 (__mmask16 __U, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_prolvd512_mask ((__v16si) __A, (__v16si) __B, (__v16si) _mm512_setzero_si512 (), (__mmask16) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_rolv_epi64 (__m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_prolvq512_mask ((__v8di) __A, (__v8di) __B, (__v8di) _mm512_setzero_si512 (), (__mmask8) -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_rolv_epi64 (__m512i __W, __mmask8 __U, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_prolvq512_mask ((__v8di) __A, (__v8di) __B, (__v8di) __W, (__mmask8) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_rolv_epi64 (__mmask8 __U, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_prolvq512_mask ((__v8di) __A, (__v8di) __B, (__v8di) _mm512_setzero_si512 (), (__mmask8) __U); } #define _mm512_ror_epi32(A, B) __extension__ ({ \ (__m512i)__builtin_ia32_prord512_mask((__v16si)(__m512i)(A), (int)(B), \ (__v16si)_mm512_setzero_si512(), \ (__mmask16)-1); }) #define _mm512_mask_ror_epi32(W, U, A, B) __extension__ ({ \ (__m512i)__builtin_ia32_prord512_mask((__v16si)(__m512i)(A), (int)(B), \ (__v16si)(__m512i)(W), \ (__mmask16)(U)); }) #define _mm512_maskz_ror_epi32(U, A, B) __extension__ ({ \ (__m512i)__builtin_ia32_prord512_mask((__v16si)(__m512i)(A), (int)(B), \ (__v16si)_mm512_setzero_si512(), \ (__mmask16)(U)); }) #define _mm512_ror_epi64(A, B) __extension__ ({ \ (__m512i)__builtin_ia32_prorq512_mask((__v8di)(__m512i)(A), (int)(B), \ (__v8di)_mm512_setzero_si512(), \ (__mmask8)-1); }) #define _mm512_mask_ror_epi64(W, U, A, B) __extension__ ({ \ (__m512i)__builtin_ia32_prorq512_mask((__v8di)(__m512i)(A), (int)(B), \ (__v8di)(__m512i)(W), (__mmask8)(U)); }) #define _mm512_maskz_ror_epi64(U, A, B) __extension__ ({ \ (__m512i)__builtin_ia32_prorq512_mask((__v8di)(__m512i)(A), (int)(B), \ (__v8di)_mm512_setzero_si512(), \ (__mmask8)(U)); }) static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_slli_epi32(__m512i __A, int __B) { return (__m512i)__builtin_ia32_pslldi512((__v16si)__A, __B); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_slli_epi32(__m512i __W, __mmask16 __U, __m512i __A, int __B) { return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U, (__v16si)_mm512_slli_epi32(__A, __B), (__v16si)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_slli_epi32(__mmask16 __U, __m512i __A, int __B) { return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U, (__v16si)_mm512_slli_epi32(__A, __B), (__v16si)_mm512_setzero_si512()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_slli_epi64(__m512i __A, int __B) { return (__m512i)__builtin_ia32_psllqi512((__v8di)__A, __B); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_slli_epi64(__m512i __W, __mmask8 __U, __m512i __A, int __B) { return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U, (__v8di)_mm512_slli_epi64(__A, __B), (__v8di)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_slli_epi64(__mmask8 __U, __m512i __A, int __B) { return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U, (__v8di)_mm512_slli_epi64(__A, __B), (__v8di)_mm512_setzero_si512()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_srli_epi32(__m512i __A, int __B) { return (__m512i)__builtin_ia32_psrldi512((__v16si)__A, __B); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_srli_epi32(__m512i __W, __mmask16 __U, __m512i __A, int __B) { return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U, (__v16si)_mm512_srli_epi32(__A, __B), (__v16si)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_srli_epi32(__mmask16 __U, __m512i __A, int __B) { return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U, (__v16si)_mm512_srli_epi32(__A, __B), (__v16si)_mm512_setzero_si512()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_srli_epi64(__m512i __A, int __B) { return (__m512i)__builtin_ia32_psrlqi512((__v8di)__A, __B); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_srli_epi64(__m512i __W, __mmask8 __U, __m512i __A, int __B) { return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U, (__v8di)_mm512_srli_epi64(__A, __B), (__v8di)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_srli_epi64(__mmask8 __U, __m512i __A, int __B) { return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U, (__v8di)_mm512_srli_epi64(__A, __B), (__v8di)_mm512_setzero_si512()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_load_epi32 (__m512i __W, __mmask16 __U, void const *__P) { return (__m512i) __builtin_ia32_movdqa32load512_mask ((const __v16si *) __P, (__v16si) __W, (__mmask16) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_load_epi32 (__mmask16 __U, void const *__P) { return (__m512i) __builtin_ia32_movdqa32load512_mask ((const __v16si *) __P, (__v16si) _mm512_setzero_si512 (), (__mmask16) __U); } static __inline__ void __DEFAULT_FN_ATTRS _mm512_mask_store_epi32 (void *__P, __mmask16 __U, __m512i __A) { __builtin_ia32_movdqa32store512_mask ((__v16si *) __P, (__v16si) __A, (__mmask16) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_mov_epi32 (__m512i __W, __mmask16 __U, __m512i __A) { return (__m512i) __builtin_ia32_selectd_512 ((__mmask16) __U, (__v16si) __A, (__v16si) __W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_mov_epi32 (__mmask16 __U, __m512i __A) { return (__m512i) __builtin_ia32_selectd_512 ((__mmask16) __U, (__v16si) __A, (__v16si) _mm512_setzero_si512 ()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_mov_epi64 (__m512i __W, __mmask8 __U, __m512i __A) { return (__m512i) __builtin_ia32_selectq_512 ((__mmask8) __U, (__v8di) __A, (__v8di) __W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_mov_epi64 (__mmask8 __U, __m512i __A) { return (__m512i) __builtin_ia32_selectq_512 ((__mmask8) __U, (__v8di) __A, (__v8di) _mm512_setzero_si512 ()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_load_epi64 (__m512i __W, __mmask8 __U, void const *__P) { return (__m512i) __builtin_ia32_movdqa64load512_mask ((const __v8di *) __P, (__v8di) __W, (__mmask8) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_load_epi64 (__mmask8 __U, void const *__P) { return (__m512i) __builtin_ia32_movdqa64load512_mask ((const __v8di *) __P, (__v8di) _mm512_setzero_si512 (), (__mmask8) __U); } static __inline__ void __DEFAULT_FN_ATTRS _mm512_mask_store_epi64 (void *__P, __mmask8 __U, __m512i __A) { __builtin_ia32_movdqa64store512_mask ((__v8di *) __P, (__v8di) __A, (__mmask8) __U); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_movedup_pd (__m512d __A) { return (__m512d)__builtin_shufflevector((__v8df)__A, (__v8df)__A, 0, 0, 2, 2, 4, 4, 6, 6); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_mask_movedup_pd (__m512d __W, __mmask8 __U, __m512d __A) { return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U, (__v8df)_mm512_movedup_pd(__A), (__v8df)__W); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_maskz_movedup_pd (__mmask8 __U, __m512d __A) { return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U, (__v8df)_mm512_movedup_pd(__A), (__v8df)_mm512_setzero_pd()); } #define _mm512_fixupimm_round_pd(A, B, C, imm, R) __extension__ ({ \ (__m512d)__builtin_ia32_fixupimmpd512_mask((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), \ (__v8di)(__m512i)(C), (int)(imm), \ (__mmask8)-1, (int)(R)); }) #define _mm512_mask_fixupimm_round_pd(A, U, B, C, imm, R) __extension__ ({ \ (__m512d)__builtin_ia32_fixupimmpd512_mask((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), \ (__v8di)(__m512i)(C), (int)(imm), \ (__mmask8)(U), (int)(R)); }) #define _mm512_fixupimm_pd(A, B, C, imm) __extension__ ({ \ (__m512d)__builtin_ia32_fixupimmpd512_mask((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), \ (__v8di)(__m512i)(C), (int)(imm), \ (__mmask8)-1, \ _MM_FROUND_CUR_DIRECTION); }) #define _mm512_mask_fixupimm_pd(A, U, B, C, imm) __extension__ ({ \ (__m512d)__builtin_ia32_fixupimmpd512_mask((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), \ (__v8di)(__m512i)(C), (int)(imm), \ (__mmask8)(U), \ _MM_FROUND_CUR_DIRECTION); }) #define _mm512_maskz_fixupimm_round_pd(U, A, B, C, imm, R) __extension__ ({ \ (__m512d)__builtin_ia32_fixupimmpd512_maskz((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), \ (__v8di)(__m512i)(C), \ (int)(imm), (__mmask8)(U), \ (int)(R)); }) #define _mm512_maskz_fixupimm_pd(U, A, B, C, imm) __extension__ ({ \ (__m512d)__builtin_ia32_fixupimmpd512_maskz((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), \ (__v8di)(__m512i)(C), \ (int)(imm), (__mmask8)(U), \ _MM_FROUND_CUR_DIRECTION); }) #define _mm512_fixupimm_round_ps(A, B, C, imm, R) __extension__ ({ \ (__m512)__builtin_ia32_fixupimmps512_mask((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), \ (__v16si)(__m512i)(C), (int)(imm), \ (__mmask16)-1, (int)(R)); }) #define _mm512_mask_fixupimm_round_ps(A, U, B, C, imm, R) __extension__ ({ \ (__m512)__builtin_ia32_fixupimmps512_mask((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), \ (__v16si)(__m512i)(C), (int)(imm), \ (__mmask16)(U), (int)(R)); }) #define _mm512_fixupimm_ps(A, B, C, imm) __extension__ ({ \ (__m512)__builtin_ia32_fixupimmps512_mask((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), \ (__v16si)(__m512i)(C), (int)(imm), \ (__mmask16)-1, \ _MM_FROUND_CUR_DIRECTION); }) #define _mm512_mask_fixupimm_ps(A, U, B, C, imm) __extension__ ({ \ (__m512)__builtin_ia32_fixupimmps512_mask((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), \ (__v16si)(__m512i)(C), (int)(imm), \ (__mmask16)(U), \ _MM_FROUND_CUR_DIRECTION); }) #define _mm512_maskz_fixupimm_round_ps(U, A, B, C, imm, R) __extension__ ({ \ (__m512)__builtin_ia32_fixupimmps512_maskz((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), \ (__v16si)(__m512i)(C), \ (int)(imm), (__mmask16)(U), \ (int)(R)); }) #define _mm512_maskz_fixupimm_ps(U, A, B, C, imm) __extension__ ({ \ (__m512)__builtin_ia32_fixupimmps512_maskz((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), \ (__v16si)(__m512i)(C), \ (int)(imm), (__mmask16)(U), \ _MM_FROUND_CUR_DIRECTION); }) #define _mm_fixupimm_round_sd(A, B, C, imm, R) __extension__ ({ \ (__m128d)__builtin_ia32_fixupimmsd_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2di)(__m128i)(C), (int)(imm), \ (__mmask8)-1, (int)(R)); }) #define _mm_mask_fixupimm_round_sd(A, U, B, C, imm, R) __extension__ ({ \ (__m128d)__builtin_ia32_fixupimmsd_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2di)(__m128i)(C), (int)(imm), \ (__mmask8)(U), (int)(R)); }) #define _mm_fixupimm_sd(A, B, C, imm) __extension__ ({ \ (__m128d)__builtin_ia32_fixupimmsd_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2di)(__m128i)(C), (int)(imm), \ (__mmask8)-1, \ _MM_FROUND_CUR_DIRECTION); }) #define _mm_mask_fixupimm_sd(A, U, B, C, imm) __extension__ ({ \ (__m128d)__builtin_ia32_fixupimmsd_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2di)(__m128i)(C), (int)(imm), \ (__mmask8)(U), \ _MM_FROUND_CUR_DIRECTION); }) #define _mm_maskz_fixupimm_round_sd(U, A, B, C, imm, R) __extension__ ({ \ (__m128d)__builtin_ia32_fixupimmsd_maskz((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2di)(__m128i)(C), (int)(imm), \ (__mmask8)(U), (int)(R)); }) #define _mm_maskz_fixupimm_sd(U, A, B, C, imm) __extension__ ({ \ (__m128d)__builtin_ia32_fixupimmsd_maskz((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2di)(__m128i)(C), (int)(imm), \ (__mmask8)(U), \ _MM_FROUND_CUR_DIRECTION); }) #define _mm_fixupimm_round_ss(A, B, C, imm, R) __extension__ ({ \ (__m128)__builtin_ia32_fixupimmss_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4si)(__m128i)(C), (int)(imm), \ (__mmask8)-1, (int)(R)); }) #define _mm_mask_fixupimm_round_ss(A, U, B, C, imm, R) __extension__ ({ \ (__m128)__builtin_ia32_fixupimmss_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4si)(__m128i)(C), (int)(imm), \ (__mmask8)(U), (int)(R)); }) #define _mm_fixupimm_ss(A, B, C, imm) __extension__ ({ \ (__m128)__builtin_ia32_fixupimmss_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4si)(__m128i)(C), (int)(imm), \ (__mmask8)-1, \ _MM_FROUND_CUR_DIRECTION); }) #define _mm_mask_fixupimm_ss(A, U, B, C, imm) __extension__ ({ \ (__m128)__builtin_ia32_fixupimmss_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4si)(__m128i)(C), (int)(imm), \ (__mmask8)(U), \ _MM_FROUND_CUR_DIRECTION); }) #define _mm_maskz_fixupimm_round_ss(U, A, B, C, imm, R) __extension__ ({ \ (__m128)__builtin_ia32_fixupimmss_maskz((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4si)(__m128i)(C), (int)(imm), \ (__mmask8)(U), (int)(R)); }) #define _mm_maskz_fixupimm_ss(U, A, B, C, imm) __extension__ ({ \ (__m128)__builtin_ia32_fixupimmss_maskz((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4si)(__m128i)(C), (int)(imm), \ (__mmask8)(U), \ _MM_FROUND_CUR_DIRECTION); }) #define _mm_getexp_round_sd(A, B, R) __extension__ ({ \ (__m128d)__builtin_ia32_getexpsd128_round_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)_mm_setzero_pd(), \ (__mmask8)-1, (int)(R)); }) static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_getexp_sd (__m128d __A, __m128d __B) { return (__m128d) __builtin_ia32_getexpsd128_round_mask ((__v2df) __A, (__v2df) __B, (__v2df) _mm_setzero_pd(), (__mmask8) -1, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask_getexp_sd (__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) { return (__m128d) __builtin_ia32_getexpsd128_round_mask ( (__v2df) __A, (__v2df) __B, (__v2df) __W, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm_mask_getexp_round_sd(W, U, A, B, R) __extension__ ({\ (__m128d)__builtin_ia32_getexpsd128_round_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)(__m128d)(W), \ (__mmask8)(U), (int)(R)); }) static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_maskz_getexp_sd (__mmask8 __U, __m128d __A, __m128d __B) { return (__m128d) __builtin_ia32_getexpsd128_round_mask ( (__v2df) __A, (__v2df) __B, (__v2df) _mm_setzero_pd (), (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm_maskz_getexp_round_sd(U, A, B, R) __extension__ ({\ (__m128d)__builtin_ia32_getexpsd128_round_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)_mm_setzero_pd(), \ (__mmask8)(U), (int)(R)); }) #define _mm_getexp_round_ss(A, B, R) __extension__ ({ \ (__m128)__builtin_ia32_getexpss128_round_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4sf)_mm_setzero_ps(), \ (__mmask8)-1, (int)(R)); }) static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_getexp_ss (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_getexpss128_round_mask ((__v4sf) __A, (__v4sf) __B, (__v4sf) _mm_setzero_ps(), (__mmask8) -1, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask_getexp_ss (__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) { return (__m128) __builtin_ia32_getexpss128_round_mask ((__v4sf) __A, (__v4sf) __B, (__v4sf) __W, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm_mask_getexp_round_ss(W, U, A, B, R) __extension__ ({\ (__m128)__builtin_ia32_getexpss128_round_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4sf)(__m128)(W), \ (__mmask8)(U), (int)(R)); }) static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maskz_getexp_ss (__mmask8 __U, __m128 __A, __m128 __B) { return (__m128) __builtin_ia32_getexpss128_round_mask ((__v4sf) __A, (__v4sf) __B, (__v4sf) _mm_setzero_pd (), (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm_maskz_getexp_round_ss(U, A, B, R) __extension__ ({\ (__m128)__builtin_ia32_getexpss128_round_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4sf)_mm_setzero_ps(), \ (__mmask8)(U), (int)(R)); }) #define _mm_getmant_round_sd(A, B, C, D, R) __extension__ ({ \ (__m128d)__builtin_ia32_getmantsd_round_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (int)(((D)<<2) | (C)), \ (__v2df)_mm_setzero_pd(), \ (__mmask8)-1, (int)(R)); }) #define _mm_getmant_sd(A, B, C, D) __extension__ ({ \ (__m128d)__builtin_ia32_getmantsd_round_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (int)(((D)<<2) | (C)), \ (__v2df)_mm_setzero_pd(), \ (__mmask8)-1, \ _MM_FROUND_CUR_DIRECTION); }) #define _mm_mask_getmant_sd(W, U, A, B, C, D) __extension__ ({\ (__m128d)__builtin_ia32_getmantsd_round_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (int)(((D)<<2) | (C)), \ (__v2df)(__m128d)(W), \ (__mmask8)(U), \ _MM_FROUND_CUR_DIRECTION); }) #define _mm_mask_getmant_round_sd(W, U, A, B, C, D, R)({\ (__m128d)__builtin_ia32_getmantsd_round_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (int)(((D)<<2) | (C)), \ (__v2df)(__m128d)(W), \ (__mmask8)(U), (int)(R)); }) #define _mm_maskz_getmant_sd(U, A, B, C, D) __extension__ ({\ (__m128d)__builtin_ia32_getmantsd_round_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (int)(((D)<<2) | (C)), \ (__v2df)_mm_setzero_pd(), \ (__mmask8)(U), \ _MM_FROUND_CUR_DIRECTION); }) #define _mm_maskz_getmant_round_sd(U, A, B, C, D, R) __extension__ ({\ (__m128d)__builtin_ia32_getmantsd_round_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (int)(((D)<<2) | (C)), \ (__v2df)_mm_setzero_pd(), \ (__mmask8)(U), (int)(R)); }) #define _mm_getmant_round_ss(A, B, C, D, R) __extension__ ({ \ (__m128)__builtin_ia32_getmantss_round_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (int)(((D)<<2) | (C)), \ (__v4sf)_mm_setzero_ps(), \ (__mmask8)-1, (int)(R)); }) #define _mm_getmant_ss(A, B, C, D) __extension__ ({ \ (__m128)__builtin_ia32_getmantss_round_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (int)(((D)<<2) | (C)), \ (__v4sf)_mm_setzero_ps(), \ (__mmask8)-1, \ _MM_FROUND_CUR_DIRECTION); }) #define _mm_mask_getmant_ss(W, U, A, B, C, D) __extension__ ({\ (__m128)__builtin_ia32_getmantss_round_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (int)(((D)<<2) | (C)), \ (__v4sf)(__m128)(W), \ (__mmask8)(U), \ _MM_FROUND_CUR_DIRECTION); }) #define _mm_mask_getmant_round_ss(W, U, A, B, C, D, R)({\ (__m128)__builtin_ia32_getmantss_round_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (int)(((D)<<2) | (C)), \ (__v4sf)(__m128)(W), \ (__mmask8)(U), (int)(R)); }) #define _mm_maskz_getmant_ss(U, A, B, C, D) __extension__ ({\ (__m128)__builtin_ia32_getmantss_round_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (int)(((D)<<2) | (C)), \ (__v4sf)_mm_setzero_pd(), \ (__mmask8)(U), \ _MM_FROUND_CUR_DIRECTION); }) #define _mm_maskz_getmant_round_ss(U, A, B, C, D, R) __extension__ ({\ (__m128)__builtin_ia32_getmantss_round_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (int)(((D)<<2) | (C)), \ (__v4sf)_mm_setzero_ps(), \ (__mmask8)(U), (int)(R)); }) static __inline__ __mmask16 __DEFAULT_FN_ATTRS _mm512_kmov (__mmask16 __A) { return __A; } #define _mm_comi_round_sd(A, B, P, R) __extension__ ({\ (int)__builtin_ia32_vcomisd((__v2df)(__m128d)(A), (__v2df)(__m128d)(B), \ (int)(P), (int)(R)); }) #define _mm_comi_round_ss(A, B, P, R) __extension__ ({\ (int)__builtin_ia32_vcomiss((__v4sf)(__m128)(A), (__v4sf)(__m128)(B), \ (int)(P), (int)(R)); }) #ifdef __x86_64__ #define _mm_cvt_roundsd_si64(A, R) __extension__ ({ \ (long long)__builtin_ia32_vcvtsd2si64((__v2df)(__m128d)(A), (int)(R)); }) #endif # 5901 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512fintrin.h" 3 static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask2_permutex2var_epi32 (__m512i __A, __m512i __I, __mmask16 __U, __m512i __B) { return (__m512i) __builtin_ia32_vpermi2vard512_mask ((__v16si) __A, (__v16si) __I /* idx */ , (__v16si) __B, (__mmask16) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_sll_epi32(__m512i __A, __m128i __B) { return (__m512i)__builtin_ia32_pslld512((__v16si) __A, (__v4si)__B); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_sll_epi32(__m512i __W, __mmask16 __U, __m512i __A, __m128i __B) { return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U, (__v16si)_mm512_sll_epi32(__A, __B), (__v16si)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_sll_epi32(__mmask16 __U, __m512i __A, __m128i __B) { return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U, (__v16si)_mm512_sll_epi32(__A, __B), (__v16si)_mm512_setzero_si512()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_sll_epi64(__m512i __A, __m128i __B) { return (__m512i)__builtin_ia32_psllq512((__v8di)__A, (__v2di)__B); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_sll_epi64(__m512i __W, __mmask8 __U, __m512i __A, __m128i __B) { return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U, (__v8di)_mm512_sll_epi64(__A, __B), (__v8di)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_sll_epi64(__mmask8 __U, __m512i __A, __m128i __B) { return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U, (__v8di)_mm512_sll_epi64(__A, __B), (__v8di)_mm512_setzero_si512()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_sllv_epi32(__m512i __X, __m512i __Y) { return (__m512i)__builtin_ia32_psllv16si((__v16si)__X, (__v16si)__Y); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_sllv_epi32(__m512i __W, __mmask16 __U, __m512i __X, __m512i __Y) { return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U, (__v16si)_mm512_sllv_epi32(__X, __Y), (__v16si)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_sllv_epi32(__mmask16 __U, __m512i __X, __m512i __Y) { return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U, (__v16si)_mm512_sllv_epi32(__X, __Y), (__v16si)_mm512_setzero_si512()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_sllv_epi64(__m512i __X, __m512i __Y) { return (__m512i)__builtin_ia32_psllv8di((__v8di)__X, (__v8di)__Y); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_sllv_epi64(__m512i __W, __mmask8 __U, __m512i __X, __m512i __Y) { return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U, (__v8di)_mm512_sllv_epi64(__X, __Y), (__v8di)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_sllv_epi64(__mmask8 __U, __m512i __X, __m512i __Y) { return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U, (__v8di)_mm512_sllv_epi64(__X, __Y), (__v8di)_mm512_setzero_si512()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_sra_epi32(__m512i __A, __m128i __B) { return (__m512i)__builtin_ia32_psrad512((__v16si) __A, (__v4si)__B); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_sra_epi32(__m512i __W, __mmask16 __U, __m512i __A, __m128i __B) { return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U, (__v16si)_mm512_sra_epi32(__A, __B), (__v16si)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_sra_epi32(__mmask16 __U, __m512i __A, __m128i __B) { return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U, (__v16si)_mm512_sra_epi32(__A, __B), (__v16si)_mm512_setzero_si512()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_sra_epi64(__m512i __A, __m128i __B) { return (__m512i)__builtin_ia32_psraq512((__v8di)__A, (__v2di)__B); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_sra_epi64(__m512i __W, __mmask8 __U, __m512i __A, __m128i __B) { return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U, (__v8di)_mm512_sra_epi64(__A, __B), (__v8di)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_sra_epi64(__mmask8 __U, __m512i __A, __m128i __B) { return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U, (__v8di)_mm512_sra_epi64(__A, __B), (__v8di)_mm512_setzero_si512()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_srav_epi32(__m512i __X, __m512i __Y) { return (__m512i)__builtin_ia32_psrav16si((__v16si)__X, (__v16si)__Y); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_srav_epi32(__m512i __W, __mmask16 __U, __m512i __X, __m512i __Y) { return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U, (__v16si)_mm512_srav_epi32(__X, __Y), (__v16si)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_srav_epi32(__mmask16 __U, __m512i __X, __m512i __Y) { return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U, (__v16si)_mm512_srav_epi32(__X, __Y), (__v16si)_mm512_setzero_si512()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_srav_epi64(__m512i __X, __m512i __Y) { return (__m512i)__builtin_ia32_psrav8di((__v8di)__X, (__v8di)__Y); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_srav_epi64(__m512i __W, __mmask8 __U, __m512i __X, __m512i __Y) { return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U, (__v8di)_mm512_srav_epi64(__X, __Y), (__v8di)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_srav_epi64(__mmask8 __U, __m512i __X, __m512i __Y) { return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U, (__v8di)_mm512_srav_epi64(__X, __Y), (__v8di)_mm512_setzero_si512()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_srl_epi32(__m512i __A, __m128i __B) { return (__m512i)__builtin_ia32_psrld512((__v16si) __A, (__v4si)__B); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_srl_epi32(__m512i __W, __mmask16 __U, __m512i __A, __m128i __B) { return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U, (__v16si)_mm512_srl_epi32(__A, __B), (__v16si)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_srl_epi32(__mmask16 __U, __m512i __A, __m128i __B) { return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U, (__v16si)_mm512_srl_epi32(__A, __B), (__v16si)_mm512_setzero_si512()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_srl_epi64(__m512i __A, __m128i __B) { return (__m512i)__builtin_ia32_psrlq512((__v8di)__A, (__v2di)__B); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_srl_epi64(__m512i __W, __mmask8 __U, __m512i __A, __m128i __B) { return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U, (__v8di)_mm512_srl_epi64(__A, __B), (__v8di)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_srl_epi64(__mmask8 __U, __m512i __A, __m128i __B) { return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U, (__v8di)_mm512_srl_epi64(__A, __B), (__v8di)_mm512_setzero_si512()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_srlv_epi32(__m512i __X, __m512i __Y) { return (__m512i)__builtin_ia32_psrlv16si((__v16si)__X, (__v16si)__Y); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_srlv_epi32(__m512i __W, __mmask16 __U, __m512i __X, __m512i __Y) { return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U, (__v16si)_mm512_srlv_epi32(__X, __Y), (__v16si)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_srlv_epi32(__mmask16 __U, __m512i __X, __m512i __Y) { return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U, (__v16si)_mm512_srlv_epi32(__X, __Y), (__v16si)_mm512_setzero_si512()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_srlv_epi64 (__m512i __X, __m512i __Y) { return (__m512i)__builtin_ia32_psrlv8di((__v8di)__X, (__v8di)__Y); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_srlv_epi64(__m512i __W, __mmask8 __U, __m512i __X, __m512i __Y) { return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U, (__v8di)_mm512_srlv_epi64(__X, __Y), (__v8di)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_srlv_epi64(__mmask8 __U, __m512i __X, __m512i __Y) { return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U, (__v8di)_mm512_srlv_epi64(__X, __Y), (__v8di)_mm512_setzero_si512()); } #define _mm512_ternarylogic_epi32(A, B, C, imm) __extension__ ({ \ (__m512i)__builtin_ia32_pternlogd512_mask((__v16si)(__m512i)(A), \ (__v16si)(__m512i)(B), \ (__v16si)(__m512i)(C), (int)(imm), \ (__mmask16)-1); }) #define _mm512_mask_ternarylogic_epi32(A, U, B, C, imm) __extension__ ({ \ (__m512i)__builtin_ia32_pternlogd512_mask((__v16si)(__m512i)(A), \ (__v16si)(__m512i)(B), \ (__v16si)(__m512i)(C), (int)(imm), \ (__mmask16)(U)); }) #define _mm512_maskz_ternarylogic_epi32(U, A, B, C, imm) __extension__ ({ \ (__m512i)__builtin_ia32_pternlogd512_maskz((__v16si)(__m512i)(A), \ (__v16si)(__m512i)(B), \ (__v16si)(__m512i)(C), \ (int)(imm), (__mmask16)(U)); }) #define _mm512_ternarylogic_epi64(A, B, C, imm) __extension__ ({ \ (__m512i)__builtin_ia32_pternlogq512_mask((__v8di)(__m512i)(A), \ (__v8di)(__m512i)(B), \ (__v8di)(__m512i)(C), (int)(imm), \ (__mmask8)-1); }) #define _mm512_mask_ternarylogic_epi64(A, U, B, C, imm) __extension__ ({ \ (__m512i)__builtin_ia32_pternlogq512_mask((__v8di)(__m512i)(A), \ (__v8di)(__m512i)(B), \ (__v8di)(__m512i)(C), (int)(imm), \ (__mmask8)(U)); }) #define _mm512_maskz_ternarylogic_epi64(U, A, B, C, imm) __extension__ ({ \ (__m512i)__builtin_ia32_pternlogq512_maskz((__v8di)(__m512i)(A), \ (__v8di)(__m512i)(B), \ (__v8di)(__m512i)(C), (int)(imm), \ (__mmask8)(U)); }) #ifdef __x86_64__ #define _mm_cvt_roundsd_i64(A, R) __extension__ ({ \ (long long)__builtin_ia32_vcvtsd2si64((__v2df)(__m128d)(A), (int)(R)); }) #endif # 6217 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512fintrin.h" 3 #define _mm_cvt_roundsd_si32(A, R) __extension__ ({ \ (int)__builtin_ia32_vcvtsd2si32((__v2df)(__m128d)(A), (int)(R)); }) #define _mm_cvt_roundsd_i32(A, R) __extension__ ({ \ (int)__builtin_ia32_vcvtsd2si32((__v2df)(__m128d)(A), (int)(R)); }) #define _mm_cvt_roundsd_u32(A, R) __extension__ ({ \ (unsigned int)__builtin_ia32_vcvtsd2usi32((__v2df)(__m128d)(A), (int)(R)); }) static __inline__ unsigned __DEFAULT_FN_ATTRS _mm_cvtsd_u32 (__m128d __A) { return (unsigned) __builtin_ia32_vcvtsd2usi32 ((__v2df) __A, _MM_FROUND_CUR_DIRECTION); } #ifdef __x86_64__ #define _mm_cvt_roundsd_u64(A, R) __extension__ ({ \ (unsigned long long)__builtin_ia32_vcvtsd2usi64((__v2df)(__m128d)(A), \ (int)(R)); }) static __inline__ unsigned long long __DEFAULT_FN_ATTRS _mm_cvtsd_u64 (__m128d __A) { return (unsigned long long) __builtin_ia32_vcvtsd2usi64 ((__v2df) __A, _MM_FROUND_CUR_DIRECTION); } #endif # 6247 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512fintrin.h" 3 #define _mm_cvt_roundss_si32(A, R) __extension__ ({ \ (int)__builtin_ia32_vcvtss2si32((__v4sf)(__m128)(A), (int)(R)); }) #define _mm_cvt_roundss_i32(A, R) __extension__ ({ \ (int)__builtin_ia32_vcvtss2si32((__v4sf)(__m128)(A), (int)(R)); }) #ifdef __x86_64__ #define _mm_cvt_roundss_si64(A, R) __extension__ ({ \ (long long)__builtin_ia32_vcvtss2si64((__v4sf)(__m128)(A), (int)(R)); }) #define _mm_cvt_roundss_i64(A, R) __extension__ ({ \ (long long)__builtin_ia32_vcvtss2si64((__v4sf)(__m128)(A), (int)(R)); }) #endif # 6261 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512fintrin.h" 3 #define _mm_cvt_roundss_u32(A, R) __extension__ ({ \ (unsigned int)__builtin_ia32_vcvtss2usi32((__v4sf)(__m128)(A), (int)(R)); }) static __inline__ unsigned __DEFAULT_FN_ATTRS _mm_cvtss_u32 (__m128 __A) { return (unsigned) __builtin_ia32_vcvtss2usi32 ((__v4sf) __A, _MM_FROUND_CUR_DIRECTION); } #ifdef __x86_64__ #define _mm_cvt_roundss_u64(A, R) __extension__ ({ \ (unsigned long long)__builtin_ia32_vcvtss2usi64((__v4sf)(__m128)(A), \ (int)(R)); }) static __inline__ unsigned long long __DEFAULT_FN_ATTRS _mm_cvtss_u64 (__m128 __A) { return (unsigned long long) __builtin_ia32_vcvtss2usi64 ((__v4sf) __A, _MM_FROUND_CUR_DIRECTION); } #endif # 6285 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512fintrin.h" 3 #define _mm_cvtt_roundsd_i32(A, R) __extension__ ({ \ (int)__builtin_ia32_vcvttsd2si32((__v2df)(__m128d)(A), (int)(R)); }) #define _mm_cvtt_roundsd_si32(A, R) __extension__ ({ \ (int)__builtin_ia32_vcvttsd2si32((__v2df)(__m128d)(A), (int)(R)); }) static __inline__ int __DEFAULT_FN_ATTRS _mm_cvttsd_i32 (__m128d __A) { return (int) __builtin_ia32_vcvttsd2si32 ((__v2df) __A, _MM_FROUND_CUR_DIRECTION); } #ifdef __x86_64__ #define _mm_cvtt_roundsd_si64(A, R) __extension__ ({ \ (long long)__builtin_ia32_vcvttsd2si64((__v2df)(__m128d)(A), (int)(R)); }) #define _mm_cvtt_roundsd_i64(A, R) __extension__ ({ \ (long long)__builtin_ia32_vcvttsd2si64((__v2df)(__m128d)(A), (int)(R)); }) static __inline__ long long __DEFAULT_FN_ATTRS _mm_cvttsd_i64 (__m128d __A) { return (long long) __builtin_ia32_vcvttsd2si64 ((__v2df) __A, _MM_FROUND_CUR_DIRECTION); } #endif # 6313 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512fintrin.h" 3 #define _mm_cvtt_roundsd_u32(A, R) __extension__ ({ \ (unsigned int)__builtin_ia32_vcvttsd2usi32((__v2df)(__m128d)(A), (int)(R)); }) static __inline__ unsigned __DEFAULT_FN_ATTRS _mm_cvttsd_u32 (__m128d __A) { return (unsigned) __builtin_ia32_vcvttsd2usi32 ((__v2df) __A, _MM_FROUND_CUR_DIRECTION); } #ifdef __x86_64__ #define _mm_cvtt_roundsd_u64(A, R) __extension__ ({ \ (unsigned long long)__builtin_ia32_vcvttsd2usi64((__v2df)(__m128d)(A), \ (int)(R)); }) static __inline__ unsigned long long __DEFAULT_FN_ATTRS _mm_cvttsd_u64 (__m128d __A) { return (unsigned long long) __builtin_ia32_vcvttsd2usi64 ((__v2df) __A, _MM_FROUND_CUR_DIRECTION); } #endif # 6337 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512fintrin.h" 3 #define _mm_cvtt_roundss_i32(A, R) __extension__ ({ \ (int)__builtin_ia32_vcvttss2si32((__v4sf)(__m128)(A), (int)(R)); }) #define _mm_cvtt_roundss_si32(A, R) __extension__ ({ \ (int)__builtin_ia32_vcvttss2si32((__v4sf)(__m128)(A), (int)(R)); }) static __inline__ int __DEFAULT_FN_ATTRS _mm_cvttss_i32 (__m128 __A) { return (int) __builtin_ia32_vcvttss2si32 ((__v4sf) __A, _MM_FROUND_CUR_DIRECTION); } #ifdef __x86_64__ #define _mm_cvtt_roundss_i64(A, R) __extension__ ({ \ (long long)__builtin_ia32_vcvttss2si64((__v4sf)(__m128)(A), (int)(R)); }) #define _mm_cvtt_roundss_si64(A, R) __extension__ ({ \ (long long)__builtin_ia32_vcvttss2si64((__v4sf)(__m128)(A), (int)(R)); }) static __inline__ long long __DEFAULT_FN_ATTRS _mm_cvttss_i64 (__m128 __A) { return (long long) __builtin_ia32_vcvttss2si64 ((__v4sf) __A, _MM_FROUND_CUR_DIRECTION); } #endif # 6365 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512fintrin.h" 3 #define _mm_cvtt_roundss_u32(A, R) __extension__ ({ \ (unsigned int)__builtin_ia32_vcvttss2usi32((__v4sf)(__m128)(A), (int)(R)); }) static __inline__ unsigned __DEFAULT_FN_ATTRS _mm_cvttss_u32 (__m128 __A) { return (unsigned) __builtin_ia32_vcvttss2usi32 ((__v4sf) __A, _MM_FROUND_CUR_DIRECTION); } #ifdef __x86_64__ #define _mm_cvtt_roundss_u64(A, R) __extension__ ({ \ (unsigned long long)__builtin_ia32_vcvttss2usi64((__v4sf)(__m128)(A), \ (int)(R)); }) static __inline__ unsigned long long __DEFAULT_FN_ATTRS _mm_cvttss_u64 (__m128 __A) { return (unsigned long long) __builtin_ia32_vcvttss2usi64 ((__v4sf) __A, _MM_FROUND_CUR_DIRECTION); } #endif # 6389 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512fintrin.h" 3 static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_mask2_permutex2var_pd (__m512d __A, __m512i __I, __mmask8 __U, __m512d __B) { return (__m512d) __builtin_ia32_vpermi2varpd512_mask ((__v8df) __A, (__v8di) __I /* idx */ , (__v8df) __B, (__mmask8) __U); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_mask2_permutex2var_ps (__m512 __A, __m512i __I, __mmask16 __U, __m512 __B) { return (__m512) __builtin_ia32_vpermi2varps512_mask ((__v16sf) __A, (__v16si) __I /* idx */ , (__v16sf) __B, (__mmask16) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask2_permutex2var_epi64 (__m512i __A, __m512i __I, __mmask8 __U, __m512i __B) { return (__m512i) __builtin_ia32_vpermi2varq512_mask ((__v8di) __A, (__v8di) __I /* idx */ , (__v8di) __B, (__mmask8) __U); } #define _mm512_permute_pd(X, C) __extension__ ({ \ (__m512d)__builtin_shufflevector((__v8df)(__m512d)(X), \ (__v8df)_mm512_undefined_pd(), \ 0 + (((C) >> 0) & 0x1), \ 0 + (((C) >> 1) & 0x1), \ 2 + (((C) >> 2) & 0x1), \ 2 + (((C) >> 3) & 0x1), \ 4 + (((C) >> 4) & 0x1), \ 4 + (((C) >> 5) & 0x1), \ 6 + (((C) >> 6) & 0x1), \ 6 + (((C) >> 7) & 0x1)); }) #define _mm512_mask_permute_pd(W, U, X, C) __extension__ ({ \ (__m512d)__builtin_ia32_selectpd_512((__mmask8)(U), \ (__v8df)_mm512_permute_pd((X), (C)), \ (__v8df)(__m512d)(W)); }) #define _mm512_maskz_permute_pd(U, X, C) __extension__ ({ \ (__m512d)__builtin_ia32_selectpd_512((__mmask8)(U), \ (__v8df)_mm512_permute_pd((X), (C)), \ (__v8df)_mm512_setzero_pd()); }) #define _mm512_permute_ps(X, C) __extension__ ({ \ (__m512)__builtin_shufflevector((__v16sf)(__m512)(X), \ (__v16sf)_mm512_undefined_ps(), \ 0 + (((C) >> 0) & 0x3), \ 0 + (((C) >> 2) & 0x3), \ 0 + (((C) >> 4) & 0x3), \ 0 + (((C) >> 6) & 0x3), \ 4 + (((C) >> 0) & 0x3), \ 4 + (((C) >> 2) & 0x3), \ 4 + (((C) >> 4) & 0x3), \ 4 + (((C) >> 6) & 0x3), \ 8 + (((C) >> 0) & 0x3), \ 8 + (((C) >> 2) & 0x3), \ 8 + (((C) >> 4) & 0x3), \ 8 + (((C) >> 6) & 0x3), \ 12 + (((C) >> 0) & 0x3), \ 12 + (((C) >> 2) & 0x3), \ 12 + (((C) >> 4) & 0x3), \ 12 + (((C) >> 6) & 0x3)); }) #define _mm512_mask_permute_ps(W, U, X, C) __extension__ ({ \ (__m512)__builtin_ia32_selectps_512((__mmask16)(U), \ (__v16sf)_mm512_permute_ps((X), (C)), \ (__v16sf)(__m512)(W)); }) #define _mm512_maskz_permute_ps(U, X, C) __extension__ ({ \ (__m512)__builtin_ia32_selectps_512((__mmask16)(U), \ (__v16sf)_mm512_permute_ps((X), (C)), \ (__v16sf)_mm512_setzero_ps()); }) static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_permutevar_pd(__m512d __A, __m512i __C) { return (__m512d)__builtin_ia32_vpermilvarpd512((__v8df)__A, (__v8di)__C); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_mask_permutevar_pd(__m512d __W, __mmask8 __U, __m512d __A, __m512i __C) { return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U, (__v8df)_mm512_permutevar_pd(__A, __C), (__v8df)__W); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_maskz_permutevar_pd(__mmask8 __U, __m512d __A, __m512i __C) { return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U, (__v8df)_mm512_permutevar_pd(__A, __C), (__v8df)_mm512_setzero_pd()); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_permutevar_ps(__m512 __A, __m512i __C) { return (__m512)__builtin_ia32_vpermilvarps512((__v16sf)__A, (__v16si)__C); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_mask_permutevar_ps(__m512 __W, __mmask16 __U, __m512 __A, __m512i __C) { return (__m512)__builtin_ia32_selectps_512((__mmask16)__U, (__v16sf)_mm512_permutevar_ps(__A, __C), (__v16sf)__W); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_maskz_permutevar_ps(__mmask16 __U, __m512 __A, __m512i __C) { return (__m512)__builtin_ia32_selectps_512((__mmask16)__U, (__v16sf)_mm512_permutevar_ps(__A, __C), (__v16sf)_mm512_setzero_ps()); } static __inline __m512d __DEFAULT_FN_ATTRS _mm512_permutex2var_pd(__m512d __A, __m512i __I, __m512d __B) { return (__m512d) __builtin_ia32_vpermt2varpd512_mask ((__v8di) __I /* idx */ , (__v8df) __A, (__v8df) __B, (__mmask8) -1); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_mask_permutex2var_pd (__m512d __A, __mmask8 __U, __m512i __I, __m512d __B) { return (__m512d) __builtin_ia32_vpermt2varpd512_mask ((__v8di) __I /* idx */ , (__v8df) __A, (__v8df) __B, (__mmask8) __U); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_maskz_permutex2var_pd (__mmask8 __U, __m512d __A, __m512i __I, __m512d __B) { return (__m512d) __builtin_ia32_vpermt2varpd512_maskz ((__v8di) __I /* idx */ , (__v8df) __A, (__v8df) __B, (__mmask8) __U); } static __inline __m512 __DEFAULT_FN_ATTRS _mm512_permutex2var_ps(__m512 __A, __m512i __I, __m512 __B) { return (__m512) __builtin_ia32_vpermt2varps512_mask ((__v16si) __I /* idx */ , (__v16sf) __A, (__v16sf) __B, (__mmask16) -1); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_mask_permutex2var_ps (__m512 __A, __mmask16 __U, __m512i __I, __m512 __B) { return (__m512) __builtin_ia32_vpermt2varps512_mask ((__v16si) __I /* idx */ , (__v16sf) __A, (__v16sf) __B, (__mmask16) __U); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_maskz_permutex2var_ps (__mmask16 __U, __m512 __A, __m512i __I, __m512 __B) { return (__m512) __builtin_ia32_vpermt2varps512_maskz ((__v16si) __I /* idx */ , (__v16sf) __A, (__v16sf) __B, (__mmask16) __U); } #define _mm512_cvtt_roundpd_epu32(A, R) __extension__ ({ \ (__m256i)__builtin_ia32_cvttpd2udq512_mask((__v8df)(__m512d)(A), \ (__v8si)_mm256_undefined_si256(), \ (__mmask8)-1, (int)(R)); }) #define _mm512_mask_cvtt_roundpd_epu32(W, U, A, R) __extension__ ({ \ (__m256i)__builtin_ia32_cvttpd2udq512_mask((__v8df)(__m512d)(A), \ (__v8si)(__m256i)(W), \ (__mmask8)(U), (int)(R)); }) #define _mm512_maskz_cvtt_roundpd_epu32(U, A, R) __extension__ ({ \ (__m256i)__builtin_ia32_cvttpd2udq512_mask((__v8df)(__m512d)(A), \ (__v8si)_mm256_setzero_si256(), \ (__mmask8)(U), (int)(R)); }) static __inline__ __m256i __DEFAULT_FN_ATTRS _mm512_cvttpd_epu32 (__m512d __A) { return (__m256i) __builtin_ia32_cvttpd2udq512_mask ((__v8df) __A, (__v8si) _mm256_undefined_si256 (), (__mmask8) -1, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm512_mask_cvttpd_epu32 (__m256i __W, __mmask8 __U, __m512d __A) { return (__m256i) __builtin_ia32_cvttpd2udq512_mask ((__v8df) __A, (__v8si) __W, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm512_maskz_cvttpd_epu32 (__mmask8 __U, __m512d __A) { return (__m256i) __builtin_ia32_cvttpd2udq512_mask ((__v8df) __A, (__v8si) _mm256_setzero_si256 (), (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm_roundscale_round_sd(A, B, imm, R) __extension__ ({ \ (__m128d)__builtin_ia32_rndscalesd_round_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)_mm_setzero_pd(), \ (__mmask8)-1, (int)(imm), \ (int)(R)); }) #define _mm_roundscale_sd(A, B, imm) __extension__ ({ \ (__m128d)__builtin_ia32_rndscalesd_round_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)_mm_setzero_pd(), \ (__mmask8)-1, (int)(imm), \ _MM_FROUND_CUR_DIRECTION); }) #define _mm_mask_roundscale_sd(W, U, A, B, imm) __extension__ ({ \ (__m128d)__builtin_ia32_rndscalesd_round_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)(__m128d)(W), \ (__mmask8)(U), (int)(imm), \ _MM_FROUND_CUR_DIRECTION); }) #define _mm_mask_roundscale_round_sd(W, U, A, B, I, R) __extension__ ({ \ (__m128d)__builtin_ia32_rndscalesd_round_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)(__m128d)(W), \ (__mmask8)(U), (int)(I), \ (int)(R)); }) #define _mm_maskz_roundscale_sd(U, A, B, I) __extension__ ({ \ (__m128d)__builtin_ia32_rndscalesd_round_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)_mm_setzero_pd(), \ (__mmask8)(U), (int)(I), \ _MM_FROUND_CUR_DIRECTION); }) #define _mm_maskz_roundscale_round_sd(U, A, B, I, R) __extension__ ({ \ (__m128d)__builtin_ia32_rndscalesd_round_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)_mm_setzero_pd(), \ (__mmask8)(U), (int)(I), \ (int)(R)); }) #define _mm_roundscale_round_ss(A, B, imm, R) __extension__ ({ \ (__m128)__builtin_ia32_rndscaless_round_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4sf)_mm_setzero_ps(), \ (__mmask8)-1, (int)(imm), \ (int)(R)); }) #define _mm_roundscale_ss(A, B, imm) __extension__ ({ \ (__m128)__builtin_ia32_rndscaless_round_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4sf)_mm_setzero_ps(), \ (__mmask8)-1, (int)(imm), \ _MM_FROUND_CUR_DIRECTION); }) #define _mm_mask_roundscale_ss(W, U, A, B, I) __extension__ ({ \ (__m128)__builtin_ia32_rndscaless_round_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4sf)(__m128)(W), \ (__mmask8)(U), (int)(I), \ _MM_FROUND_CUR_DIRECTION); }) #define _mm_mask_roundscale_round_ss(W, U, A, B, I, R) __extension__ ({ \ (__m128)__builtin_ia32_rndscaless_round_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4sf)(__m128)(W), \ (__mmask8)(U), (int)(I), \ (int)(R)); }) #define _mm_maskz_roundscale_ss(U, A, B, I) __extension__ ({ \ (__m128)__builtin_ia32_rndscaless_round_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4sf)_mm_setzero_ps(), \ (__mmask8)(U), (int)(I), \ _MM_FROUND_CUR_DIRECTION); }) #define _mm_maskz_roundscale_round_ss(U, A, B, I, R) __extension__ ({ \ (__m128)__builtin_ia32_rndscaless_round_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4sf)_mm_setzero_ps(), \ (__mmask8)(U), (int)(I), \ (int)(R)); }) #define _mm512_scalef_round_pd(A, B, R) __extension__ ({ \ (__m512d)__builtin_ia32_scalefpd512_mask((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), \ (__v8df)_mm512_undefined_pd(), \ (__mmask8)-1, (int)(R)); }) #define _mm512_mask_scalef_round_pd(W, U, A, B, R) __extension__ ({ \ (__m512d)__builtin_ia32_scalefpd512_mask((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), \ (__v8df)(__m512d)(W), \ (__mmask8)(U), (int)(R)); }) #define _mm512_maskz_scalef_round_pd(U, A, B, R) __extension__ ({ \ (__m512d)__builtin_ia32_scalefpd512_mask((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), \ (__v8df)_mm512_setzero_pd(), \ (__mmask8)(U), (int)(R)); }) static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_scalef_pd (__m512d __A, __m512d __B) { return (__m512d) __builtin_ia32_scalefpd512_mask ((__v8df) __A, (__v8df) __B, (__v8df) _mm512_undefined_pd (), (__mmask8) -1, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_mask_scalef_pd (__m512d __W, __mmask8 __U, __m512d __A, __m512d __B) { return (__m512d) __builtin_ia32_scalefpd512_mask ((__v8df) __A, (__v8df) __B, (__v8df) __W, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_maskz_scalef_pd (__mmask8 __U, __m512d __A, __m512d __B) { return (__m512d) __builtin_ia32_scalefpd512_mask ((__v8df) __A, (__v8df) __B, (__v8df) _mm512_setzero_pd (), (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm512_scalef_round_ps(A, B, R) __extension__ ({ \ (__m512)__builtin_ia32_scalefps512_mask((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), \ (__v16sf)_mm512_undefined_ps(), \ (__mmask16)-1, (int)(R)); }) #define _mm512_mask_scalef_round_ps(W, U, A, B, R) __extension__ ({ \ (__m512)__builtin_ia32_scalefps512_mask((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), \ (__v16sf)(__m512)(W), \ (__mmask16)(U), (int)(R)); }) #define _mm512_maskz_scalef_round_ps(U, A, B, R) __extension__ ({ \ (__m512)__builtin_ia32_scalefps512_mask((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), \ (__v16sf)_mm512_setzero_ps(), \ (__mmask16)(U), (int)(R)); }) static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_scalef_ps (__m512 __A, __m512 __B) { return (__m512) __builtin_ia32_scalefps512_mask ((__v16sf) __A, (__v16sf) __B, (__v16sf) _mm512_undefined_ps (), (__mmask16) -1, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_mask_scalef_ps (__m512 __W, __mmask16 __U, __m512 __A, __m512 __B) { return (__m512) __builtin_ia32_scalefps512_mask ((__v16sf) __A, (__v16sf) __B, (__v16sf) __W, (__mmask16) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_maskz_scalef_ps (__mmask16 __U, __m512 __A, __m512 __B) { return (__m512) __builtin_ia32_scalefps512_mask ((__v16sf) __A, (__v16sf) __B, (__v16sf) _mm512_setzero_ps (), (__mmask16) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm_scalef_round_sd(A, B, R) __extension__ ({ \ (__m128d)__builtin_ia32_scalefsd_round_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)_mm_setzero_pd(), \ (__mmask8)-1, (int)(R)); }) static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_scalef_sd (__m128d __A, __m128d __B) { return (__m128d) __builtin_ia32_scalefsd_round_mask ((__v2df) __A, (__v2df)( __B), (__v2df) _mm_setzero_pd(), (__mmask8) -1, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask_scalef_sd (__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) { return (__m128d) __builtin_ia32_scalefsd_round_mask ( (__v2df) __A, (__v2df) __B, (__v2df) __W, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm_mask_scalef_round_sd(W, U, A, B, R) __extension__ ({ \ (__m128d)__builtin_ia32_scalefsd_round_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)(__m128d)(W), \ (__mmask8)(U), (int)(R)); }) static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_maskz_scalef_sd (__mmask8 __U, __m128d __A, __m128d __B) { return (__m128d) __builtin_ia32_scalefsd_round_mask ( (__v2df) __A, (__v2df) __B, (__v2df) _mm_setzero_pd (), (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm_maskz_scalef_round_sd(U, A, B, R) __extension__ ({ \ (__m128d)__builtin_ia32_scalefsd_round_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)_mm_setzero_pd(), \ (__mmask8)(U), (int)(R)); }) #define _mm_scalef_round_ss(A, B, R) __extension__ ({ \ (__m128)__builtin_ia32_scalefss_round_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4sf)_mm_setzero_ps(), \ (__mmask8)-1, (int)(R)); }) static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_scalef_ss (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_scalefss_round_mask ((__v4sf) __A, (__v4sf)( __B), (__v4sf) _mm_setzero_ps(), (__mmask8) -1, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask_scalef_ss (__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) { return (__m128) __builtin_ia32_scalefss_round_mask ( (__v4sf) __A, (__v4sf) __B, (__v4sf) __W, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm_mask_scalef_round_ss(W, U, A, B, R) __extension__ ({ \ (__m128)__builtin_ia32_scalefss_round_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4sf)(__m128)(W), \ (__mmask8)(U), (int)(R)); }) static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maskz_scalef_ss (__mmask8 __U, __m128 __A, __m128 __B) { return (__m128) __builtin_ia32_scalefss_round_mask ( (__v4sf) __A, (__v4sf) __B, (__v4sf) _mm_setzero_ps (), (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm_maskz_scalef_round_ss(U, A, B, R) __extension__ ({ \ (__m128)__builtin_ia32_scalefss_round_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4sf)_mm_setzero_ps(), \ (__mmask8)(U), \ _MM_FROUND_CUR_DIRECTION); }) static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_srai_epi32(__m512i __A, int __B) { return (__m512i)__builtin_ia32_psradi512((__v16si)__A, __B); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_srai_epi32(__m512i __W, __mmask16 __U, __m512i __A, int __B) { return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U, \ (__v16si)_mm512_srai_epi32(__A, __B), \ (__v16si)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_srai_epi32(__mmask16 __U, __m512i __A, int __B) { return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U, \ (__v16si)_mm512_srai_epi32(__A, __B), \ (__v16si)_mm512_setzero_si512()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_srai_epi64(__m512i __A, int __B) { return (__m512i)__builtin_ia32_psraqi512((__v8di)__A, __B); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_srai_epi64(__m512i __W, __mmask8 __U, __m512i __A, int __B) { return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U, \ (__v8di)_mm512_srai_epi64(__A, __B), \ (__v8di)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_srai_epi64(__mmask8 __U, __m512i __A, int __B) { return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U, \ (__v8di)_mm512_srai_epi64(__A, __B), \ (__v8di)_mm512_setzero_si512()); } #define _mm512_shuffle_f32x4(A, B, imm) __extension__ ({ \ (__m512)__builtin_shufflevector((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), \ 0 + ((((imm) >> 0) & 0x3) * 4), \ 1 + ((((imm) >> 0) & 0x3) * 4), \ 2 + ((((imm) >> 0) & 0x3) * 4), \ 3 + ((((imm) >> 0) & 0x3) * 4), \ 0 + ((((imm) >> 2) & 0x3) * 4), \ 1 + ((((imm) >> 2) & 0x3) * 4), \ 2 + ((((imm) >> 2) & 0x3) * 4), \ 3 + ((((imm) >> 2) & 0x3) * 4), \ 16 + ((((imm) >> 4) & 0x3) * 4), \ 17 + ((((imm) >> 4) & 0x3) * 4), \ 18 + ((((imm) >> 4) & 0x3) * 4), \ 19 + ((((imm) >> 4) & 0x3) * 4), \ 16 + ((((imm) >> 6) & 0x3) * 4), \ 17 + ((((imm) >> 6) & 0x3) * 4), \ 18 + ((((imm) >> 6) & 0x3) * 4), \ 19 + ((((imm) >> 6) & 0x3) * 4)); }) #define _mm512_mask_shuffle_f32x4(W, U, A, B, imm) __extension__ ({ \ (__m512)__builtin_ia32_selectps_512((__mmask16)(U), \ (__v16sf)_mm512_shuffle_f32x4((A), (B), (imm)), \ (__v16sf)(__m512)(W)); }) #define _mm512_maskz_shuffle_f32x4(U, A, B, imm) __extension__ ({ \ (__m512)__builtin_ia32_selectps_512((__mmask16)(U), \ (__v16sf)_mm512_shuffle_f32x4((A), (B), (imm)), \ (__v16sf)_mm512_setzero_ps()); }) #define _mm512_shuffle_f64x2(A, B, imm) __extension__ ({ \ (__m512d)__builtin_shufflevector((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), \ 0 + ((((imm) >> 0) & 0x3) * 2), \ 1 + ((((imm) >> 0) & 0x3) * 2), \ 0 + ((((imm) >> 2) & 0x3) * 2), \ 1 + ((((imm) >> 2) & 0x3) * 2), \ 8 + ((((imm) >> 4) & 0x3) * 2), \ 9 + ((((imm) >> 4) & 0x3) * 2), \ 8 + ((((imm) >> 6) & 0x3) * 2), \ 9 + ((((imm) >> 6) & 0x3) * 2)); }) #define _mm512_mask_shuffle_f64x2(W, U, A, B, imm) __extension__ ({ \ (__m512d)__builtin_ia32_selectpd_512((__mmask8)(U), \ (__v8df)_mm512_shuffle_f64x2((A), (B), (imm)), \ (__v8df)(__m512d)(W)); }) #define _mm512_maskz_shuffle_f64x2(U, A, B, imm) __extension__ ({ \ (__m512d)__builtin_ia32_selectpd_512((__mmask8)(U), \ (__v8df)_mm512_shuffle_f64x2((A), (B), (imm)), \ (__v8df)_mm512_setzero_pd()); }) #define _mm512_shuffle_i32x4(A, B, imm) __extension__ ({ \ (__m512i)__builtin_shufflevector((__v8di)(__m512i)(A), \ (__v8di)(__m512i)(B), \ 0 + ((((imm) >> 0) & 0x3) * 2), \ 1 + ((((imm) >> 0) & 0x3) * 2), \ 0 + ((((imm) >> 2) & 0x3) * 2), \ 1 + ((((imm) >> 2) & 0x3) * 2), \ 8 + ((((imm) >> 4) & 0x3) * 2), \ 9 + ((((imm) >> 4) & 0x3) * 2), \ 8 + ((((imm) >> 6) & 0x3) * 2), \ 9 + ((((imm) >> 6) & 0x3) * 2)); }) #define _mm512_mask_shuffle_i32x4(W, U, A, B, imm) __extension__ ({ \ (__m512i)__builtin_ia32_selectd_512((__mmask16)(U), \ (__v16si)_mm512_shuffle_i32x4((A), (B), (imm)), \ (__v16si)(__m512i)(W)); }) #define _mm512_maskz_shuffle_i32x4(U, A, B, imm) __extension__ ({ \ (__m512i)__builtin_ia32_selectd_512((__mmask16)(U), \ (__v16si)_mm512_shuffle_i32x4((A), (B), (imm)), \ (__v16si)_mm512_setzero_si512()); }) #define _mm512_shuffle_i64x2(A, B, imm) __extension__ ({ \ (__m512i)__builtin_shufflevector((__v8di)(__m512i)(A), \ (__v8di)(__m512i)(B), \ 0 + ((((imm) >> 0) & 0x3) * 2), \ 1 + ((((imm) >> 0) & 0x3) * 2), \ 0 + ((((imm) >> 2) & 0x3) * 2), \ 1 + ((((imm) >> 2) & 0x3) * 2), \ 8 + ((((imm) >> 4) & 0x3) * 2), \ 9 + ((((imm) >> 4) & 0x3) * 2), \ 8 + ((((imm) >> 6) & 0x3) * 2), \ 9 + ((((imm) >> 6) & 0x3) * 2)); }) #define _mm512_mask_shuffle_i64x2(W, U, A, B, imm) __extension__ ({ \ (__m512i)__builtin_ia32_selectq_512((__mmask8)(U), \ (__v8di)_mm512_shuffle_i64x2((A), (B), (imm)), \ (__v8di)(__m512i)(W)); }) #define _mm512_maskz_shuffle_i64x2(U, A, B, imm) __extension__ ({ \ (__m512i)__builtin_ia32_selectq_512((__mmask8)(U), \ (__v8di)_mm512_shuffle_i64x2((A), (B), (imm)), \ (__v8di)_mm512_setzero_si512()); }) #define _mm512_shuffle_pd(A, B, M) __extension__ ({ \ (__m512d)__builtin_shufflevector((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), \ 0 + (((M) >> 0) & 0x1), \ 8 + (((M) >> 1) & 0x1), \ 2 + (((M) >> 2) & 0x1), \ 10 + (((M) >> 3) & 0x1), \ 4 + (((M) >> 4) & 0x1), \ 12 + (((M) >> 5) & 0x1), \ 6 + (((M) >> 6) & 0x1), \ 14 + (((M) >> 7) & 0x1)); }) #define _mm512_mask_shuffle_pd(W, U, A, B, M) __extension__ ({ \ (__m512d)__builtin_ia32_selectpd_512((__mmask8)(U), \ (__v8df)_mm512_shuffle_pd((A), (B), (M)), \ (__v8df)(__m512d)(W)); }) #define _mm512_maskz_shuffle_pd(U, A, B, M) __extension__ ({ \ (__m512d)__builtin_ia32_selectpd_512((__mmask8)(U), \ (__v8df)_mm512_shuffle_pd((A), (B), (M)), \ (__v8df)_mm512_setzero_pd()); }) #define _mm512_shuffle_ps(A, B, M) __extension__ ({ \ (__m512d)__builtin_shufflevector((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), \ 0 + (((M) >> 0) & 0x3), \ 0 + (((M) >> 2) & 0x3), \ 16 + (((M) >> 4) & 0x3), \ 16 + (((M) >> 6) & 0x3), \ 4 + (((M) >> 0) & 0x3), \ 4 + (((M) >> 2) & 0x3), \ 20 + (((M) >> 4) & 0x3), \ 20 + (((M) >> 6) & 0x3), \ 8 + (((M) >> 0) & 0x3), \ 8 + (((M) >> 2) & 0x3), \ 24 + (((M) >> 4) & 0x3), \ 24 + (((M) >> 6) & 0x3), \ 12 + (((M) >> 0) & 0x3), \ 12 + (((M) >> 2) & 0x3), \ 28 + (((M) >> 4) & 0x3), \ 28 + (((M) >> 6) & 0x3)); }) #define _mm512_mask_shuffle_ps(W, U, A, B, M) __extension__ ({ \ (__m512)__builtin_ia32_selectps_512((__mmask16)(U), \ (__v16sf)_mm512_shuffle_ps((A), (B), (M)), \ (__v16sf)(__m512)(W)); }) #define _mm512_maskz_shuffle_ps(U, A, B, M) __extension__ ({ \ (__m512)__builtin_ia32_selectps_512((__mmask16)(U), \ (__v16sf)_mm512_shuffle_ps((A), (B), (M)), \ (__v16sf)_mm512_setzero_ps()); }) #define _mm_sqrt_round_sd(A, B, R) __extension__ ({ \ (__m128d)__builtin_ia32_sqrtsd_round_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)_mm_setzero_pd(), \ (__mmask8)-1, (int)(R)); }) static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask_sqrt_sd (__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) { return (__m128d) __builtin_ia32_sqrtsd_round_mask ( (__v2df) __A, (__v2df) __B, (__v2df) __W, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm_mask_sqrt_round_sd(W, U, A, B, R) __extension__ ({ \ (__m128d)__builtin_ia32_sqrtsd_round_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)(__m128d)(W), \ (__mmask8)(U), (int)(R)); }) static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_maskz_sqrt_sd (__mmask8 __U, __m128d __A, __m128d __B) { return (__m128d) __builtin_ia32_sqrtsd_round_mask ( (__v2df) __A, (__v2df) __B, (__v2df) _mm_setzero_pd (), (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm_maskz_sqrt_round_sd(U, A, B, R) __extension__ ({ \ (__m128d)__builtin_ia32_sqrtsd_round_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)_mm_setzero_pd(), \ (__mmask8)(U), (int)(R)); }) #define _mm_sqrt_round_ss(A, B, R) __extension__ ({ \ (__m128)__builtin_ia32_sqrtss_round_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4sf)_mm_setzero_ps(), \ (__mmask8)-1, (int)(R)); }) static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask_sqrt_ss (__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) { return (__m128) __builtin_ia32_sqrtss_round_mask ( (__v4sf) __A, (__v4sf) __B, (__v4sf) __W, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm_mask_sqrt_round_ss(W, U, A, B, R) __extension__ ({ \ (__m128)__builtin_ia32_sqrtss_round_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4sf)(__m128)(W), (__mmask8)(U), \ (int)(R)); }) static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maskz_sqrt_ss (__mmask8 __U, __m128 __A, __m128 __B) { return (__m128) __builtin_ia32_sqrtss_round_mask ( (__v4sf) __A, (__v4sf) __B, (__v4sf) _mm_setzero_ps (), (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm_maskz_sqrt_round_ss(U, A, B, R) __extension__ ({ \ (__m128)__builtin_ia32_sqrtss_round_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4sf)_mm_setzero_ps(), \ (__mmask8)(U), (int)(R)); }) static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_broadcast_f32x4(__m128 __A) { return (__m512)__builtin_shufflevector((__v4sf)__A, (__v4sf)__A, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_mask_broadcast_f32x4(__m512 __O, __mmask16 __M, __m128 __A) { return (__m512)__builtin_ia32_selectps_512((__mmask16)__M, (__v16sf)_mm512_broadcast_f32x4(__A), (__v16sf)__O); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_maskz_broadcast_f32x4(__mmask16 __M, __m128 __A) { return (__m512)__builtin_ia32_selectps_512((__mmask16)__M, (__v16sf)_mm512_broadcast_f32x4(__A), (__v16sf)_mm512_setzero_ps()); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_broadcast_f64x4(__m256d __A) { return (__m512d)__builtin_shufflevector((__v4df)__A, (__v4df)__A, 0, 1, 2, 3, 0, 1, 2, 3); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_mask_broadcast_f64x4(__m512d __O, __mmask8 __M, __m256d __A) { return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__M, (__v8df)_mm512_broadcast_f64x4(__A), (__v8df)__O); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_maskz_broadcast_f64x4(__mmask8 __M, __m256d __A) { return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__M, (__v8df)_mm512_broadcast_f64x4(__A), (__v8df)_mm512_setzero_pd()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_broadcast_i32x4(__m128i __A) { return (__m512i)__builtin_shufflevector((__v4si)__A, (__v4si)__A, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_broadcast_i32x4(__m512i __O, __mmask16 __M, __m128i __A) { return (__m512i)__builtin_ia32_selectd_512((__mmask16)__M, (__v16si)_mm512_broadcast_i32x4(__A), (__v16si)__O); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_broadcast_i32x4(__mmask16 __M, __m128i __A) { return (__m512i)__builtin_ia32_selectd_512((__mmask16)__M, (__v16si)_mm512_broadcast_i32x4(__A), (__v16si)_mm512_setzero_si512()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_broadcast_i64x4(__m256i __A) { return (__m512i)__builtin_shufflevector((__v4di)__A, (__v4di)__A, 0, 1, 2, 3, 0, 1, 2, 3); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_broadcast_i64x4(__m512i __O, __mmask8 __M, __m256i __A) { return (__m512i)__builtin_ia32_selectq_512((__mmask8)__M, (__v8di)_mm512_broadcast_i64x4(__A), (__v8di)__O); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_broadcast_i64x4(__mmask8 __M, __m256i __A) { return (__m512i)__builtin_ia32_selectq_512((__mmask8)__M, (__v8di)_mm512_broadcast_i64x4(__A), (__v8di)_mm512_setzero_si512()); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_mask_broadcastsd_pd (__m512d __O, __mmask8 __M, __m128d __A) { return (__m512d)__builtin_ia32_selectpd_512(__M, (__v8df) _mm512_broadcastsd_pd(__A), (__v8df) __O); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_maskz_broadcastsd_pd (__mmask8 __M, __m128d __A) { return (__m512d)__builtin_ia32_selectpd_512(__M, (__v8df) _mm512_broadcastsd_pd(__A), (__v8df) _mm512_setzero_pd()); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_mask_broadcastss_ps (__m512 __O, __mmask16 __M, __m128 __A) { return (__m512)__builtin_ia32_selectps_512(__M, (__v16sf) _mm512_broadcastss_ps(__A), (__v16sf) __O); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_maskz_broadcastss_ps (__mmask16 __M, __m128 __A) { return (__m512)__builtin_ia32_selectps_512(__M, (__v16sf) _mm512_broadcastss_ps(__A), (__v16sf) _mm512_setzero_ps()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm512_cvtsepi32_epi8 (__m512i __A) { return (__m128i) __builtin_ia32_pmovsdb512_mask ((__v16si) __A, (__v16qi) _mm_undefined_si128 (), (__mmask16) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm512_mask_cvtsepi32_epi8 (__m128i __O, __mmask16 __M, __m512i __A) { return (__m128i) __builtin_ia32_pmovsdb512_mask ((__v16si) __A, (__v16qi) __O, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm512_maskz_cvtsepi32_epi8 (__mmask16 __M, __m512i __A) { return (__m128i) __builtin_ia32_pmovsdb512_mask ((__v16si) __A, (__v16qi) _mm_setzero_si128 (), __M); } static __inline__ void __DEFAULT_FN_ATTRS _mm512_mask_cvtsepi32_storeu_epi8 (void * __P, __mmask16 __M, __m512i __A) { __builtin_ia32_pmovsdb512mem_mask ((__v16qi *) __P, (__v16si) __A, __M); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm512_cvtsepi32_epi16 (__m512i __A) { return (__m256i) __builtin_ia32_pmovsdw512_mask ((__v16si) __A, (__v16hi) _mm256_undefined_si256 (), (__mmask16) -1); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm512_mask_cvtsepi32_epi16 (__m256i __O, __mmask16 __M, __m512i __A) { return (__m256i) __builtin_ia32_pmovsdw512_mask ((__v16si) __A, (__v16hi) __O, __M); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm512_maskz_cvtsepi32_epi16 (__mmask16 __M, __m512i __A) { return (__m256i) __builtin_ia32_pmovsdw512_mask ((__v16si) __A, (__v16hi) _mm256_setzero_si256 (), __M); } static __inline__ void __DEFAULT_FN_ATTRS _mm512_mask_cvtsepi32_storeu_epi16 (void *__P, __mmask16 __M, __m512i __A) { __builtin_ia32_pmovsdw512mem_mask ((__v16hi*) __P, (__v16si) __A, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm512_cvtsepi64_epi8 (__m512i __A) { return (__m128i) __builtin_ia32_pmovsqb512_mask ((__v8di) __A, (__v16qi) _mm_undefined_si128 (), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm512_mask_cvtsepi64_epi8 (__m128i __O, __mmask8 __M, __m512i __A) { return (__m128i) __builtin_ia32_pmovsqb512_mask ((__v8di) __A, (__v16qi) __O, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm512_maskz_cvtsepi64_epi8 (__mmask8 __M, __m512i __A) { return (__m128i) __builtin_ia32_pmovsqb512_mask ((__v8di) __A, (__v16qi) _mm_setzero_si128 (), __M); } static __inline__ void __DEFAULT_FN_ATTRS _mm512_mask_cvtsepi64_storeu_epi8 (void * __P, __mmask8 __M, __m512i __A) { __builtin_ia32_pmovsqb512mem_mask ((__v16qi *) __P, (__v8di) __A, __M); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm512_cvtsepi64_epi32 (__m512i __A) { return (__m256i) __builtin_ia32_pmovsqd512_mask ((__v8di) __A, (__v8si) _mm256_undefined_si256 (), (__mmask8) -1); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm512_mask_cvtsepi64_epi32 (__m256i __O, __mmask8 __M, __m512i __A) { return (__m256i) __builtin_ia32_pmovsqd512_mask ((__v8di) __A, (__v8si) __O, __M); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm512_maskz_cvtsepi64_epi32 (__mmask8 __M, __m512i __A) { return (__m256i) __builtin_ia32_pmovsqd512_mask ((__v8di) __A, (__v8si) _mm256_setzero_si256 (), __M); } static __inline__ void __DEFAULT_FN_ATTRS _mm512_mask_cvtsepi64_storeu_epi32 (void *__P, __mmask8 __M, __m512i __A) { __builtin_ia32_pmovsqd512mem_mask ((__v8si *) __P, (__v8di) __A, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm512_cvtsepi64_epi16 (__m512i __A) { return (__m128i) __builtin_ia32_pmovsqw512_mask ((__v8di) __A, (__v8hi) _mm_undefined_si128 (), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm512_mask_cvtsepi64_epi16 (__m128i __O, __mmask8 __M, __m512i __A) { return (__m128i) __builtin_ia32_pmovsqw512_mask ((__v8di) __A, (__v8hi) __O, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm512_maskz_cvtsepi64_epi16 (__mmask8 __M, __m512i __A) { return (__m128i) __builtin_ia32_pmovsqw512_mask ((__v8di) __A, (__v8hi) _mm_setzero_si128 (), __M); } static __inline__ void __DEFAULT_FN_ATTRS _mm512_mask_cvtsepi64_storeu_epi16 (void * __P, __mmask8 __M, __m512i __A) { __builtin_ia32_pmovsqw512mem_mask ((__v8hi *) __P, (__v8di) __A, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm512_cvtusepi32_epi8 (__m512i __A) { return (__m128i) __builtin_ia32_pmovusdb512_mask ((__v16si) __A, (__v16qi) _mm_undefined_si128 (), (__mmask16) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm512_mask_cvtusepi32_epi8 (__m128i __O, __mmask16 __M, __m512i __A) { return (__m128i) __builtin_ia32_pmovusdb512_mask ((__v16si) __A, (__v16qi) __O, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm512_maskz_cvtusepi32_epi8 (__mmask16 __M, __m512i __A) { return (__m128i) __builtin_ia32_pmovusdb512_mask ((__v16si) __A, (__v16qi) _mm_setzero_si128 (), __M); } static __inline__ void __DEFAULT_FN_ATTRS _mm512_mask_cvtusepi32_storeu_epi8 (void * __P, __mmask16 __M, __m512i __A) { __builtin_ia32_pmovusdb512mem_mask ((__v16qi *) __P, (__v16si) __A, __M); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm512_cvtusepi32_epi16 (__m512i __A) { return (__m256i) __builtin_ia32_pmovusdw512_mask ((__v16si) __A, (__v16hi) _mm256_undefined_si256 (), (__mmask16) -1); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm512_mask_cvtusepi32_epi16 (__m256i __O, __mmask16 __M, __m512i __A) { return (__m256i) __builtin_ia32_pmovusdw512_mask ((__v16si) __A, (__v16hi) __O, __M); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm512_maskz_cvtusepi32_epi16 (__mmask16 __M, __m512i __A) { return (__m256i) __builtin_ia32_pmovusdw512_mask ((__v16si) __A, (__v16hi) _mm256_setzero_si256 (), __M); } static __inline__ void __DEFAULT_FN_ATTRS _mm512_mask_cvtusepi32_storeu_epi16 (void *__P, __mmask16 __M, __m512i __A) { __builtin_ia32_pmovusdw512mem_mask ((__v16hi*) __P, (__v16si) __A, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm512_cvtusepi64_epi8 (__m512i __A) { return (__m128i) __builtin_ia32_pmovusqb512_mask ((__v8di) __A, (__v16qi) _mm_undefined_si128 (), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm512_mask_cvtusepi64_epi8 (__m128i __O, __mmask8 __M, __m512i __A) { return (__m128i) __builtin_ia32_pmovusqb512_mask ((__v8di) __A, (__v16qi) __O, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm512_maskz_cvtusepi64_epi8 (__mmask8 __M, __m512i __A) { return (__m128i) __builtin_ia32_pmovusqb512_mask ((__v8di) __A, (__v16qi) _mm_setzero_si128 (), __M); } static __inline__ void __DEFAULT_FN_ATTRS _mm512_mask_cvtusepi64_storeu_epi8 (void * __P, __mmask8 __M, __m512i __A) { __builtin_ia32_pmovusqb512mem_mask ((__v16qi *) __P, (__v8di) __A, __M); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm512_cvtusepi64_epi32 (__m512i __A) { return (__m256i) __builtin_ia32_pmovusqd512_mask ((__v8di) __A, (__v8si) _mm256_undefined_si256 (), (__mmask8) -1); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm512_mask_cvtusepi64_epi32 (__m256i __O, __mmask8 __M, __m512i __A) { return (__m256i) __builtin_ia32_pmovusqd512_mask ((__v8di) __A, (__v8si) __O, __M); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm512_maskz_cvtusepi64_epi32 (__mmask8 __M, __m512i __A) { return (__m256i) __builtin_ia32_pmovusqd512_mask ((__v8di) __A, (__v8si) _mm256_setzero_si256 (), __M); } static __inline__ void __DEFAULT_FN_ATTRS _mm512_mask_cvtusepi64_storeu_epi32 (void* __P, __mmask8 __M, __m512i __A) { __builtin_ia32_pmovusqd512mem_mask ((__v8si*) __P, (__v8di) __A, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm512_cvtusepi64_epi16 (__m512i __A) { return (__m128i) __builtin_ia32_pmovusqw512_mask ((__v8di) __A, (__v8hi) _mm_undefined_si128 (), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm512_mask_cvtusepi64_epi16 (__m128i __O, __mmask8 __M, __m512i __A) { return (__m128i) __builtin_ia32_pmovusqw512_mask ((__v8di) __A, (__v8hi) __O, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm512_maskz_cvtusepi64_epi16 (__mmask8 __M, __m512i __A) { return (__m128i) __builtin_ia32_pmovusqw512_mask ((__v8di) __A, (__v8hi) _mm_setzero_si128 (), __M); } static __inline__ void __DEFAULT_FN_ATTRS _mm512_mask_cvtusepi64_storeu_epi16 (void *__P, __mmask8 __M, __m512i __A) { __builtin_ia32_pmovusqw512mem_mask ((__v8hi*) __P, (__v8di) __A, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm512_cvtepi32_epi8 (__m512i __A) { return (__m128i) __builtin_ia32_pmovdb512_mask ((__v16si) __A, (__v16qi) _mm_undefined_si128 (), (__mmask16) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm512_mask_cvtepi32_epi8 (__m128i __O, __mmask16 __M, __m512i __A) { return (__m128i) __builtin_ia32_pmovdb512_mask ((__v16si) __A, (__v16qi) __O, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm512_maskz_cvtepi32_epi8 (__mmask16 __M, __m512i __A) { return (__m128i) __builtin_ia32_pmovdb512_mask ((__v16si) __A, (__v16qi) _mm_setzero_si128 (), __M); } static __inline__ void __DEFAULT_FN_ATTRS _mm512_mask_cvtepi32_storeu_epi8 (void * __P, __mmask16 __M, __m512i __A) { __builtin_ia32_pmovdb512mem_mask ((__v16qi *) __P, (__v16si) __A, __M); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm512_cvtepi32_epi16 (__m512i __A) { return (__m256i) __builtin_ia32_pmovdw512_mask ((__v16si) __A, (__v16hi) _mm256_undefined_si256 (), (__mmask16) -1); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm512_mask_cvtepi32_epi16 (__m256i __O, __mmask16 __M, __m512i __A) { return (__m256i) __builtin_ia32_pmovdw512_mask ((__v16si) __A, (__v16hi) __O, __M); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm512_maskz_cvtepi32_epi16 (__mmask16 __M, __m512i __A) { return (__m256i) __builtin_ia32_pmovdw512_mask ((__v16si) __A, (__v16hi) _mm256_setzero_si256 (), __M); } static __inline__ void __DEFAULT_FN_ATTRS _mm512_mask_cvtepi32_storeu_epi16 (void * __P, __mmask16 __M, __m512i __A) { __builtin_ia32_pmovdw512mem_mask ((__v16hi *) __P, (__v16si) __A, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm512_cvtepi64_epi8 (__m512i __A) { return (__m128i) __builtin_ia32_pmovqb512_mask ((__v8di) __A, (__v16qi) _mm_undefined_si128 (), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm512_mask_cvtepi64_epi8 (__m128i __O, __mmask8 __M, __m512i __A) { return (__m128i) __builtin_ia32_pmovqb512_mask ((__v8di) __A, (__v16qi) __O, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm512_maskz_cvtepi64_epi8 (__mmask8 __M, __m512i __A) { return (__m128i) __builtin_ia32_pmovqb512_mask ((__v8di) __A, (__v16qi) _mm_setzero_si128 (), __M); } static __inline__ void __DEFAULT_FN_ATTRS _mm512_mask_cvtepi64_storeu_epi8 (void * __P, __mmask8 __M, __m512i __A) { __builtin_ia32_pmovqb512mem_mask ((__v16qi *) __P, (__v8di) __A, __M); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm512_cvtepi64_epi32 (__m512i __A) { return (__m256i) __builtin_ia32_pmovqd512_mask ((__v8di) __A, (__v8si) _mm256_undefined_si256 (), (__mmask8) -1); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm512_mask_cvtepi64_epi32 (__m256i __O, __mmask8 __M, __m512i __A) { return (__m256i) __builtin_ia32_pmovqd512_mask ((__v8di) __A, (__v8si) __O, __M); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm512_maskz_cvtepi64_epi32 (__mmask8 __M, __m512i __A) { return (__m256i) __builtin_ia32_pmovqd512_mask ((__v8di) __A, (__v8si) _mm256_setzero_si256 (), __M); } static __inline__ void __DEFAULT_FN_ATTRS _mm512_mask_cvtepi64_storeu_epi32 (void* __P, __mmask8 __M, __m512i __A) { __builtin_ia32_pmovqd512mem_mask ((__v8si *) __P, (__v8di) __A, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm512_cvtepi64_epi16 (__m512i __A) { return (__m128i) __builtin_ia32_pmovqw512_mask ((__v8di) __A, (__v8hi) _mm_undefined_si128 (), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm512_mask_cvtepi64_epi16 (__m128i __O, __mmask8 __M, __m512i __A) { return (__m128i) __builtin_ia32_pmovqw512_mask ((__v8di) __A, (__v8hi) __O, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm512_maskz_cvtepi64_epi16 (__mmask8 __M, __m512i __A) { return (__m128i) __builtin_ia32_pmovqw512_mask ((__v8di) __A, (__v8hi) _mm_setzero_si128 (), __M); } static __inline__ void __DEFAULT_FN_ATTRS _mm512_mask_cvtepi64_storeu_epi16 (void *__P, __mmask8 __M, __m512i __A) { __builtin_ia32_pmovqw512mem_mask ((__v8hi *) __P, (__v8di) __A, __M); } #define _mm512_extracti32x4_epi32(A, imm) __extension__ ({ \ (__m128i)__builtin_shufflevector((__v16si)(__m512i)(A), \ (__v16si)_mm512_undefined_epi32(), \ 0 + ((imm) & 0x3) * 4, \ 1 + ((imm) & 0x3) * 4, \ 2 + ((imm) & 0x3) * 4, \ 3 + ((imm) & 0x3) * 4); }) #define _mm512_mask_extracti32x4_epi32(W, U, A, imm) __extension__ ({ \ (__m128i)__builtin_ia32_selectd_128((__mmask8)(U), \ (__v4si)_mm512_extracti32x4_epi32((A), (imm)), \ (__v4si)(W)); }) #define _mm512_maskz_extracti32x4_epi32(U, A, imm) __extension__ ({ \ (__m128i)__builtin_ia32_selectd_128((__mmask8)(U), \ (__v4si)_mm512_extracti32x4_epi32((A), (imm)), \ (__v4si)_mm_setzero_si128()); }) #define _mm512_extracti64x4_epi64(A, imm) __extension__ ({ \ (__m256i)__builtin_shufflevector((__v8di)(__m512i)(A), \ (__v8di)_mm512_undefined_epi32(), \ ((imm) & 1) ? 4 : 0, \ ((imm) & 1) ? 5 : 1, \ ((imm) & 1) ? 6 : 2, \ ((imm) & 1) ? 7 : 3); }) #define _mm512_mask_extracti64x4_epi64(W, U, A, imm) __extension__ ({ \ (__m256i)__builtin_ia32_selectq_256((__mmask8)(U), \ (__v4di)_mm512_extracti64x4_epi64((A), (imm)), \ (__v4di)(W)); }) #define _mm512_maskz_extracti64x4_epi64(U, A, imm) __extension__ ({ \ (__m256i)__builtin_ia32_selectq_256((__mmask8)(U), \ (__v4di)_mm512_extracti64x4_epi64((A), (imm)), \ (__v4di)_mm256_setzero_si256()); }) #define _mm512_insertf64x4(A, B, imm) __extension__ ({ \ (__m512d)__builtin_shufflevector((__v8df)(__m512d)(A), \ (__v8df)_mm512_castpd256_pd512((__m256d)(B)), \ ((imm) & 0x1) ? 0 : 8, \ ((imm) & 0x1) ? 1 : 9, \ ((imm) & 0x1) ? 2 : 10, \ ((imm) & 0x1) ? 3 : 11, \ ((imm) & 0x1) ? 8 : 4, \ ((imm) & 0x1) ? 9 : 5, \ ((imm) & 0x1) ? 10 : 6, \ ((imm) & 0x1) ? 11 : 7); }) #define _mm512_mask_insertf64x4(W, U, A, B, imm) __extension__ ({ \ (__m512d)__builtin_ia32_selectpd_512((__mmask8)(U), \ (__v8df)_mm512_insertf64x4((A), (B), (imm)), \ (__v8df)(W)); }) #define _mm512_maskz_insertf64x4(U, A, B, imm) __extension__ ({ \ (__m512d)__builtin_ia32_selectpd_512((__mmask8)(U), \ (__v8df)_mm512_insertf64x4((A), (B), (imm)), \ (__v8df)_mm512_setzero_pd()); }) #define _mm512_inserti64x4(A, B, imm) __extension__ ({ \ (__m512i)__builtin_shufflevector((__v8di)(__m512i)(A), \ (__v8di)_mm512_castsi256_si512((__m256i)(B)), \ ((imm) & 0x1) ? 0 : 8, \ ((imm) & 0x1) ? 1 : 9, \ ((imm) & 0x1) ? 2 : 10, \ ((imm) & 0x1) ? 3 : 11, \ ((imm) & 0x1) ? 8 : 4, \ ((imm) & 0x1) ? 9 : 5, \ ((imm) & 0x1) ? 10 : 6, \ ((imm) & 0x1) ? 11 : 7); }) #define _mm512_mask_inserti64x4(W, U, A, B, imm) __extension__ ({ \ (__m512i)__builtin_ia32_selectq_512((__mmask8)(U), \ (__v8di)_mm512_inserti64x4((A), (B), (imm)), \ (__v8di)(W)); }) #define _mm512_maskz_inserti64x4(U, A, B, imm) __extension__ ({ \ (__m512i)__builtin_ia32_selectq_512((__mmask8)(U), \ (__v8di)_mm512_inserti64x4((A), (B), (imm)), \ (__v8di)_mm512_setzero_si512()); }) #define _mm512_insertf32x4(A, B, imm) __extension__ ({ \ (__m512)__builtin_shufflevector((__v16sf)(__m512)(A), \ (__v16sf)_mm512_castps128_ps512((__m128)(B)),\ (((imm) & 0x3) == 0) ? 16 : 0, \ (((imm) & 0x3) == 0) ? 17 : 1, \ (((imm) & 0x3) == 0) ? 18 : 2, \ (((imm) & 0x3) == 0) ? 19 : 3, \ (((imm) & 0x3) == 1) ? 16 : 4, \ (((imm) & 0x3) == 1) ? 17 : 5, \ (((imm) & 0x3) == 1) ? 18 : 6, \ (((imm) & 0x3) == 1) ? 19 : 7, \ (((imm) & 0x3) == 2) ? 16 : 8, \ (((imm) & 0x3) == 2) ? 17 : 9, \ (((imm) & 0x3) == 2) ? 18 : 10, \ (((imm) & 0x3) == 2) ? 19 : 11, \ (((imm) & 0x3) == 3) ? 16 : 12, \ (((imm) & 0x3) == 3) ? 17 : 13, \ (((imm) & 0x3) == 3) ? 18 : 14, \ (((imm) & 0x3) == 3) ? 19 : 15); }) #define _mm512_mask_insertf32x4(W, U, A, B, imm) __extension__ ({ \ (__m512)__builtin_ia32_selectps_512((__mmask16)(U), \ (__v16sf)_mm512_insertf32x4((A), (B), (imm)), \ (__v16sf)(W)); }) #define _mm512_maskz_insertf32x4(U, A, B, imm) __extension__ ({ \ (__m512)__builtin_ia32_selectps_512((__mmask16)(U), \ (__v16sf)_mm512_insertf32x4((A), (B), (imm)), \ (__v16sf)_mm512_setzero_ps()); }) #define _mm512_inserti32x4(A, B, imm) __extension__ ({ \ (__m512i)__builtin_shufflevector((__v16si)(__m512i)(A), \ (__v16si)_mm512_castsi128_si512((__m128i)(B)),\ (((imm) & 0x3) == 0) ? 16 : 0, \ (((imm) & 0x3) == 0) ? 17 : 1, \ (((imm) & 0x3) == 0) ? 18 : 2, \ (((imm) & 0x3) == 0) ? 19 : 3, \ (((imm) & 0x3) == 1) ? 16 : 4, \ (((imm) & 0x3) == 1) ? 17 : 5, \ (((imm) & 0x3) == 1) ? 18 : 6, \ (((imm) & 0x3) == 1) ? 19 : 7, \ (((imm) & 0x3) == 2) ? 16 : 8, \ (((imm) & 0x3) == 2) ? 17 : 9, \ (((imm) & 0x3) == 2) ? 18 : 10, \ (((imm) & 0x3) == 2) ? 19 : 11, \ (((imm) & 0x3) == 3) ? 16 : 12, \ (((imm) & 0x3) == 3) ? 17 : 13, \ (((imm) & 0x3) == 3) ? 18 : 14, \ (((imm) & 0x3) == 3) ? 19 : 15); }) #define _mm512_mask_inserti32x4(W, U, A, B, imm) __extension__ ({ \ (__m512i)__builtin_ia32_selectd_512((__mmask16)(U), \ (__v16si)_mm512_inserti32x4((A), (B), (imm)), \ (__v16si)(W)); }) #define _mm512_maskz_inserti32x4(U, A, B, imm) __extension__ ({ \ (__m512i)__builtin_ia32_selectd_512((__mmask16)(U), \ (__v16si)_mm512_inserti32x4((A), (B), (imm)), \ (__v16si)_mm512_setzero_si512()); }) #define _mm512_getmant_round_pd(A, B, C, R) __extension__ ({ \ (__m512d)__builtin_ia32_getmantpd512_mask((__v8df)(__m512d)(A), \ (int)(((C)<<2) | (B)), \ (__v8df)_mm512_undefined_pd(), \ (__mmask8)-1, (int)(R)); }) #define _mm512_mask_getmant_round_pd(W, U, A, B, C, R) __extension__ ({ \ (__m512d)__builtin_ia32_getmantpd512_mask((__v8df)(__m512d)(A), \ (int)(((C)<<2) | (B)), \ (__v8df)(__m512d)(W), \ (__mmask8)(U), (int)(R)); }) #define _mm512_maskz_getmant_round_pd(U, A, B, C, R) __extension__ ({ \ (__m512d)__builtin_ia32_getmantpd512_mask((__v8df)(__m512d)(A), \ (int)(((C)<<2) | (B)), \ (__v8df)_mm512_setzero_pd(), \ (__mmask8)(U), (int)(R)); }) #define _mm512_getmant_pd(A, B, C) __extension__ ({ \ (__m512d)__builtin_ia32_getmantpd512_mask((__v8df)(__m512d)(A), \ (int)(((C)<<2) | (B)), \ (__v8df)_mm512_setzero_pd(), \ (__mmask8)-1, \ _MM_FROUND_CUR_DIRECTION); }) #define _mm512_mask_getmant_pd(W, U, A, B, C) __extension__ ({ \ (__m512d)__builtin_ia32_getmantpd512_mask((__v8df)(__m512d)(A), \ (int)(((C)<<2) | (B)), \ (__v8df)(__m512d)(W), \ (__mmask8)(U), \ _MM_FROUND_CUR_DIRECTION); }) #define _mm512_maskz_getmant_pd(U, A, B, C) __extension__ ({ \ (__m512d)__builtin_ia32_getmantpd512_mask((__v8df)(__m512d)(A), \ (int)(((C)<<2) | (B)), \ (__v8df)_mm512_setzero_pd(), \ (__mmask8)(U), \ _MM_FROUND_CUR_DIRECTION); }) #define _mm512_getmant_round_ps(A, B, C, R) __extension__ ({ \ (__m512)__builtin_ia32_getmantps512_mask((__v16sf)(__m512)(A), \ (int)(((C)<<2) | (B)), \ (__v16sf)_mm512_undefined_ps(), \ (__mmask16)-1, (int)(R)); }) #define _mm512_mask_getmant_round_ps(W, U, A, B, C, R) __extension__ ({ \ (__m512)__builtin_ia32_getmantps512_mask((__v16sf)(__m512)(A), \ (int)(((C)<<2) | (B)), \ (__v16sf)(__m512)(W), \ (__mmask16)(U), (int)(R)); }) #define _mm512_maskz_getmant_round_ps(U, A, B, C, R) __extension__ ({ \ (__m512)__builtin_ia32_getmantps512_mask((__v16sf)(__m512)(A), \ (int)(((C)<<2) | (B)), \ (__v16sf)_mm512_setzero_ps(), \ (__mmask16)(U), (int)(R)); }) #define _mm512_getmant_ps(A, B, C) __extension__ ({ \ (__m512)__builtin_ia32_getmantps512_mask((__v16sf)(__m512)(A), \ (int)(((C)<<2)|(B)), \ (__v16sf)_mm512_undefined_ps(), \ (__mmask16)-1, \ _MM_FROUND_CUR_DIRECTION); }) #define _mm512_mask_getmant_ps(W, U, A, B, C) __extension__ ({ \ (__m512)__builtin_ia32_getmantps512_mask((__v16sf)(__m512)(A), \ (int)(((C)<<2)|(B)), \ (__v16sf)(__m512)(W), \ (__mmask16)(U), \ _MM_FROUND_CUR_DIRECTION); }) #define _mm512_maskz_getmant_ps(U, A, B, C) __extension__ ({ \ (__m512)__builtin_ia32_getmantps512_mask((__v16sf)(__m512)(A), \ (int)(((C)<<2)|(B)), \ (__v16sf)_mm512_setzero_ps(), \ (__mmask16)(U), \ _MM_FROUND_CUR_DIRECTION); }) #define _mm512_getexp_round_pd(A, R) __extension__ ({ \ (__m512d)__builtin_ia32_getexppd512_mask((__v8df)(__m512d)(A), \ (__v8df)_mm512_undefined_pd(), \ (__mmask8)-1, (int)(R)); }) #define _mm512_mask_getexp_round_pd(W, U, A, R) __extension__ ({ \ (__m512d)__builtin_ia32_getexppd512_mask((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(W), \ (__mmask8)(U), (int)(R)); }) #define _mm512_maskz_getexp_round_pd(U, A, R) __extension__ ({ \ (__m512d)__builtin_ia32_getexppd512_mask((__v8df)(__m512d)(A), \ (__v8df)_mm512_setzero_pd(), \ (__mmask8)(U), (int)(R)); }) static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_getexp_pd (__m512d __A) { return (__m512d) __builtin_ia32_getexppd512_mask ((__v8df) __A, (__v8df) _mm512_undefined_pd (), (__mmask8) -1, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_mask_getexp_pd (__m512d __W, __mmask8 __U, __m512d __A) { return (__m512d) __builtin_ia32_getexppd512_mask ((__v8df) __A, (__v8df) __W, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_maskz_getexp_pd (__mmask8 __U, __m512d __A) { return (__m512d) __builtin_ia32_getexppd512_mask ((__v8df) __A, (__v8df) _mm512_setzero_pd (), (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm512_getexp_round_ps(A, R) __extension__ ({ \ (__m512)__builtin_ia32_getexpps512_mask((__v16sf)(__m512)(A), \ (__v16sf)_mm512_undefined_ps(), \ (__mmask16)-1, (int)(R)); }) #define _mm512_mask_getexp_round_ps(W, U, A, R) __extension__ ({ \ (__m512)__builtin_ia32_getexpps512_mask((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(W), \ (__mmask16)(U), (int)(R)); }) #define _mm512_maskz_getexp_round_ps(U, A, R) __extension__ ({ \ (__m512)__builtin_ia32_getexpps512_mask((__v16sf)(__m512)(A), \ (__v16sf)_mm512_setzero_ps(), \ (__mmask16)(U), (int)(R)); }) static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_getexp_ps (__m512 __A) { return (__m512) __builtin_ia32_getexpps512_mask ((__v16sf) __A, (__v16sf) _mm512_undefined_ps (), (__mmask16) -1, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_mask_getexp_ps (__m512 __W, __mmask16 __U, __m512 __A) { return (__m512) __builtin_ia32_getexpps512_mask ((__v16sf) __A, (__v16sf) __W, (__mmask16) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_maskz_getexp_ps (__mmask16 __U, __m512 __A) { return (__m512) __builtin_ia32_getexpps512_mask ((__v16sf) __A, (__v16sf) _mm512_setzero_ps (), (__mmask16) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm512_i64gather_ps(index, addr, scale) __extension__ ({ \ (__m256)__builtin_ia32_gatherdiv16sf((__v8sf)_mm256_undefined_ps(), \ (float const *)(addr), \ (__v8di)(__m512i)(index), (__mmask8)-1, \ (int)(scale)); }) #define _mm512_mask_i64gather_ps(v1_old, mask, index, addr, scale) __extension__({\ (__m256)__builtin_ia32_gatherdiv16sf((__v8sf)(__m256)(v1_old),\ (float const *)(addr), \ (__v8di)(__m512i)(index), \ (__mmask8)(mask), (int)(scale)); }) #define _mm512_i64gather_epi32(index, addr, scale) __extension__ ({\ (__m256i)__builtin_ia32_gatherdiv16si((__v8si)_mm256_undefined_ps(), \ (int const *)(addr), \ (__v8di)(__m512i)(index), \ (__mmask8)-1, (int)(scale)); }) #define _mm512_mask_i64gather_epi32(v1_old, mask, index, addr, scale) __extension__ ({\ (__m256i)__builtin_ia32_gatherdiv16si((__v8si)(__m256i)(v1_old), \ (int const *)(addr), \ (__v8di)(__m512i)(index), \ (__mmask8)(mask), (int)(scale)); }) #define _mm512_i64gather_pd(index, addr, scale) __extension__ ({\ (__m512d)__builtin_ia32_gatherdiv8df((__v8df)_mm512_undefined_pd(), \ (double const *)(addr), \ (__v8di)(__m512i)(index), (__mmask8)-1, \ (int)(scale)); }) #define _mm512_mask_i64gather_pd(v1_old, mask, index, addr, scale) __extension__ ({\ (__m512d)__builtin_ia32_gatherdiv8df((__v8df)(__m512d)(v1_old), \ (double const *)(addr), \ (__v8di)(__m512i)(index), \ (__mmask8)(mask), (int)(scale)); }) #define _mm512_i64gather_epi64(index, addr, scale) __extension__ ({\ (__m512i)__builtin_ia32_gatherdiv8di((__v8di)_mm512_undefined_pd(), \ (long long const *)(addr), \ (__v8di)(__m512i)(index), (__mmask8)-1, \ (int)(scale)); }) #define _mm512_mask_i64gather_epi64(v1_old, mask, index, addr, scale) __extension__ ({\ (__m512i)__builtin_ia32_gatherdiv8di((__v8di)(__m512i)(v1_old), \ (long long const *)(addr), \ (__v8di)(__m512i)(index), \ (__mmask8)(mask), (int)(scale)); }) #define _mm512_i32gather_ps(index, addr, scale) __extension__ ({\ (__m512)__builtin_ia32_gathersiv16sf((__v16sf)_mm512_undefined_ps(), \ (float const *)(addr), \ (__v16sf)(__m512)(index), \ (__mmask16)-1, (int)(scale)); }) #define _mm512_mask_i32gather_ps(v1_old, mask, index, addr, scale) __extension__ ({\ (__m512)__builtin_ia32_gathersiv16sf((__v16sf)(__m512)(v1_old), \ (float const *)(addr), \ (__v16sf)(__m512)(index), \ (__mmask16)(mask), (int)(scale)); }) #define _mm512_i32gather_epi32(index, addr, scale) __extension__ ({\ (__m512i)__builtin_ia32_gathersiv16si((__v16si)_mm512_undefined_epi32(), \ (int const *)(addr), \ (__v16si)(__m512i)(index), \ (__mmask16)-1, (int)(scale)); }) #define _mm512_mask_i32gather_epi32(v1_old, mask, index, addr, scale) __extension__ ({\ (__m512i)__builtin_ia32_gathersiv16si((__v16si)(__m512i)(v1_old), \ (int const *)(addr), \ (__v16si)(__m512i)(index), \ (__mmask16)(mask), (int)(scale)); }) #define _mm512_i32gather_pd(index, addr, scale) __extension__ ({\ (__m512d)__builtin_ia32_gathersiv8df((__v8df)_mm512_undefined_pd(), \ (double const *)(addr), \ (__v8si)(__m256i)(index), (__mmask8)-1, \ (int)(scale)); }) #define _mm512_mask_i32gather_pd(v1_old, mask, index, addr, scale) __extension__ ({\ (__m512d)__builtin_ia32_gathersiv8df((__v8df)(__m512d)(v1_old), \ (double const *)(addr), \ (__v8si)(__m256i)(index), \ (__mmask8)(mask), (int)(scale)); }) #define _mm512_i32gather_epi64(index, addr, scale) __extension__ ({\ (__m512i)__builtin_ia32_gathersiv8di((__v8di)_mm512_undefined_epi32(), \ (long long const *)(addr), \ (__v8si)(__m256i)(index), (__mmask8)-1, \ (int)(scale)); }) #define _mm512_mask_i32gather_epi64(v1_old, mask, index, addr, scale) __extension__ ({\ (__m512i)__builtin_ia32_gathersiv8di((__v8di)(__m512i)(v1_old), \ (long long const *)(addr), \ (__v8si)(__m256i)(index), \ (__mmask8)(mask), (int)(scale)); }) #define _mm512_i64scatter_ps(addr, index, v1, scale) __extension__ ({\ __builtin_ia32_scatterdiv16sf((float *)(addr), (__mmask8)-1, \ (__v8di)(__m512i)(index), \ (__v8sf)(__m256)(v1), (int)(scale)); }) #define _mm512_mask_i64scatter_ps(addr, mask, index, v1, scale) __extension__ ({\ __builtin_ia32_scatterdiv16sf((float *)(addr), (__mmask8)(mask), \ (__v8di)(__m512i)(index), \ (__v8sf)(__m256)(v1), (int)(scale)); }) #define _mm512_i64scatter_epi32(addr, index, v1, scale) __extension__ ({\ __builtin_ia32_scatterdiv16si((int *)(addr), (__mmask8)-1, \ (__v8di)(__m512i)(index), \ (__v8si)(__m256i)(v1), (int)(scale)); }) #define _mm512_mask_i64scatter_epi32(addr, mask, index, v1, scale) __extension__ ({\ __builtin_ia32_scatterdiv16si((int *)(addr), (__mmask8)(mask), \ (__v8di)(__m512i)(index), \ (__v8si)(__m256i)(v1), (int)(scale)); }) #define _mm512_i64scatter_pd(addr, index, v1, scale) __extension__ ({\ __builtin_ia32_scatterdiv8df((double *)(addr), (__mmask8)-1, \ (__v8di)(__m512i)(index), \ (__v8df)(__m512d)(v1), (int)(scale)); }) #define _mm512_mask_i64scatter_pd(addr, mask, index, v1, scale) __extension__ ({\ __builtin_ia32_scatterdiv8df((double *)(addr), (__mmask8)(mask), \ (__v8di)(__m512i)(index), \ (__v8df)(__m512d)(v1), (int)(scale)); }) #define _mm512_i64scatter_epi64(addr, index, v1, scale) __extension__ ({\ __builtin_ia32_scatterdiv8di((long long *)(addr), (__mmask8)-1, \ (__v8di)(__m512i)(index), \ (__v8di)(__m512i)(v1), (int)(scale)); }) #define _mm512_mask_i64scatter_epi64(addr, mask, index, v1, scale) __extension__ ({\ __builtin_ia32_scatterdiv8di((long long *)(addr), (__mmask8)(mask), \ (__v8di)(__m512i)(index), \ (__v8di)(__m512i)(v1), (int)(scale)); }) #define _mm512_i32scatter_ps(addr, index, v1, scale) __extension__ ({\ __builtin_ia32_scattersiv16sf((float *)(addr), (__mmask16)-1, \ (__v16si)(__m512i)(index), \ (__v16sf)(__m512)(v1), (int)(scale)); }) #define _mm512_mask_i32scatter_ps(addr, mask, index, v1, scale) __extension__ ({\ __builtin_ia32_scattersiv16sf((float *)(addr), (__mmask16)(mask), \ (__v16si)(__m512i)(index), \ (__v16sf)(__m512)(v1), (int)(scale)); }) #define _mm512_i32scatter_epi32(addr, index, v1, scale) __extension__ ({\ __builtin_ia32_scattersiv16si((int *)(addr), (__mmask16)-1, \ (__v16si)(__m512i)(index), \ (__v16si)(__m512i)(v1), (int)(scale)); }) #define _mm512_mask_i32scatter_epi32(addr, mask, index, v1, scale) __extension__ ({\ __builtin_ia32_scattersiv16si((int *)(addr), (__mmask16)(mask), \ (__v16si)(__m512i)(index), \ (__v16si)(__m512i)(v1), (int)(scale)); }) #define _mm512_i32scatter_pd(addr, index, v1, scale) __extension__ ({\ __builtin_ia32_scattersiv8df((double *)(addr), (__mmask8)-1, \ (__v8si)(__m256i)(index), \ (__v8df)(__m512d)(v1), (int)(scale)); }) #define _mm512_mask_i32scatter_pd(addr, mask, index, v1, scale) __extension__ ({\ __builtin_ia32_scattersiv8df((double *)(addr), (__mmask8)(mask), \ (__v8si)(__m256i)(index), \ (__v8df)(__m512d)(v1), (int)(scale)); }) #define _mm512_i32scatter_epi64(addr, index, v1, scale) __extension__ ({\ __builtin_ia32_scattersiv8di((long long *)(addr), (__mmask8)-1, \ (__v8si)(__m256i)(index), \ (__v8di)(__m512i)(v1), (int)(scale)); }) #define _mm512_mask_i32scatter_epi64(addr, mask, index, v1, scale) __extension__ ({\ __builtin_ia32_scattersiv8di((long long *)(addr), (__mmask8)(mask), \ (__v8si)(__m256i)(index), \ (__v8di)(__m512i)(v1), (int)(scale)); }) static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask_fmadd_ss (__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) { return (__m128) __builtin_ia32_vfmaddss3_mask ((__v4sf) __W, (__v4sf) __A, (__v4sf) __B, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm_mask_fmadd_round_ss(W, U, A, B, R) __extension__({\ (__m128)__builtin_ia32_vfmaddss3_mask((__v4sf)(__m128)(W), \ (__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), (__mmask8)(U), \ (int)(R)); }) static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maskz_fmadd_ss (__mmask8 __U, __m128 __A, __m128 __B, __m128 __C) { return (__m128) __builtin_ia32_vfmaddss3_maskz ((__v4sf) __A, (__v4sf) __B, (__v4sf) __C, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm_maskz_fmadd_round_ss(U, A, B, C, R) __extension__ ({\ (__m128)__builtin_ia32_vfmaddss3_maskz((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4sf)(__m128)(C), (__mmask8)(U), \ _MM_FROUND_CUR_DIRECTION); }) static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask3_fmadd_ss (__m128 __W, __m128 __X, __m128 __Y, __mmask8 __U) { return (__m128) __builtin_ia32_vfmaddss3_mask3 ((__v4sf) __W, (__v4sf) __X, (__v4sf) __Y, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm_mask3_fmadd_round_ss(W, X, Y, U, R) __extension__ ({\ (__m128)__builtin_ia32_vfmaddss3_mask3((__v4sf)(__m128)(W), \ (__v4sf)(__m128)(X), \ (__v4sf)(__m128)(Y), (__mmask8)(U), \ (int)(R)); }) static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask_fmsub_ss (__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) { return (__m128) __builtin_ia32_vfmaddss3_mask ((__v4sf) __W, (__v4sf) __A, -(__v4sf) __B, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm_mask_fmsub_round_ss(W, U, A, B, R) __extension__ ({\ (__m128)__builtin_ia32_vfmaddss3_mask((__v4sf)(__m128)(W), \ (__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), (__mmask8)(U), \ (int)(R)); }) static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maskz_fmsub_ss (__mmask8 __U, __m128 __A, __m128 __B, __m128 __C) { return (__m128) __builtin_ia32_vfmaddss3_maskz ((__v4sf) __A, (__v4sf) __B, -(__v4sf) __C, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm_maskz_fmsub_round_ss(U, A, B, C, R) __extension__ ({\ (__m128)__builtin_ia32_vfmaddss3_maskz((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ -(__v4sf)(__m128)(C), (__mmask8)(U), \ (int)(R)); }) static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask3_fmsub_ss (__m128 __W, __m128 __X, __m128 __Y, __mmask8 __U) { return (__m128) __builtin_ia32_vfmsubss3_mask3 ((__v4sf) __W, (__v4sf) __X, (__v4sf) __Y, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm_mask3_fmsub_round_ss(W, X, Y, U, R) __extension__ ({\ (__m128)__builtin_ia32_vfmsubss3_mask3((__v4sf)(__m128)(W), \ (__v4sf)(__m128)(X), \ (__v4sf)(__m128)(Y), (__mmask8)(U), \ (int)(R)); }) static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask_fnmadd_ss (__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) { return (__m128) __builtin_ia32_vfmaddss3_mask ((__v4sf) __W, -(__v4sf) __A, (__v4sf) __B, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm_mask_fnmadd_round_ss(W, U, A, B, R) __extension__ ({\ (__m128)__builtin_ia32_vfmaddss3_mask((__v4sf)(__m128)(W), \ -(__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), (__mmask8)(U), \ (int)(R)); }) static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maskz_fnmadd_ss (__mmask8 __U, __m128 __A, __m128 __B, __m128 __C) { return (__m128) __builtin_ia32_vfmaddss3_maskz (-(__v4sf) __A, (__v4sf) __B, (__v4sf) __C, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm_maskz_fnmadd_round_ss(U, A, B, C, R) __extension__ ({\ (__m128)__builtin_ia32_vfmaddss3_maskz(-(__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4sf)(__m128)(C), (__mmask8)(U), \ (int)(R)); }) static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask3_fnmadd_ss (__m128 __W, __m128 __X, __m128 __Y, __mmask8 __U) { return (__m128) __builtin_ia32_vfmaddss3_mask3 (-(__v4sf) __W, (__v4sf) __X, (__v4sf) __Y, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm_mask3_fnmadd_round_ss(W, X, Y, U, R) __extension__({\ (__m128)__builtin_ia32_vfmaddss3_mask3(-(__v4sf)(__m128)(W), \ (__v4sf)(__m128)(X), \ (__v4sf)(__m128)(Y), (__mmask8)(U), \ (int)(R)); }) static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask_fnmsub_ss (__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) { return (__m128) __builtin_ia32_vfmaddss3_mask ((__v4sf) __W, -(__v4sf) __A, -(__v4sf) __B, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm_mask_fnmsub_round_ss(W, U, A, B, R) __extension__ ({\ (__m128)__builtin_ia32_vfmaddss3_mask((__v4sf)(__m128)(W), \ -(__v4sf)(__m128)(A), \ -(__v4sf)(__m128)(B), (__mmask8)(U), \ (int)(R)); }) static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maskz_fnmsub_ss (__mmask8 __U, __m128 __A, __m128 __B, __m128 __C) { return (__m128) __builtin_ia32_vfmaddss3_maskz (-(__v4sf) __A, (__v4sf) __B, -(__v4sf) __C, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm_maskz_fnmsub_round_ss(U, A, B, C, R) __extension__ ({\ (__m128)__builtin_ia32_vfmaddss3_maskz(-(__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ -(__v4sf)(__m128)(C), (__mmask8)(U), \ _MM_FROUND_CUR_DIRECTION); }) static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask3_fnmsub_ss (__m128 __W, __m128 __X, __m128 __Y, __mmask8 __U) { return (__m128) __builtin_ia32_vfnmsubss3_mask3 ((__v4sf) __W, (__v4sf) __X, (__v4sf) __Y, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm_mask3_fnmsub_round_ss(W, X, Y, U, R) __extension__({\ (__m128)__builtin_ia32_vfnmsubss3_mask3((__v4sf)(__m128)(W), \ (__v4sf)(__m128)(X), \ (__v4sf)(__m128)(Y), (__mmask8)(U), \ (int)(R)); }) static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask_fmadd_sd (__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) { return (__m128d) __builtin_ia32_vfmaddsd3_mask ( (__v2df) __W, (__v2df) __A, (__v2df) __B, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm_mask_fmadd_round_sd(W, U, A, B, R) __extension__({\ (__m128d)__builtin_ia32_vfmaddsd3_mask((__v2df)(__m128d)(W), \ (__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), (__mmask8)(U), \ (int)(R)); }) static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_maskz_fmadd_sd (__mmask8 __U, __m128d __A, __m128d __B, __m128d __C) { return (__m128d) __builtin_ia32_vfmaddsd3_maskz ( (__v2df) __A, (__v2df) __B, (__v2df) __C, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm_maskz_fmadd_round_sd(U, A, B, C, R) __extension__ ({\ (__m128d)__builtin_ia32_vfmaddsd3_maskz((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)(__m128d)(C), (__mmask8)(U), \ _MM_FROUND_CUR_DIRECTION); }) static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask3_fmadd_sd (__m128d __W, __m128d __X, __m128d __Y, __mmask8 __U) { return (__m128d) __builtin_ia32_vfmaddsd3_mask3 ((__v2df) __W, (__v2df) __X, (__v2df) __Y, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm_mask3_fmadd_round_sd(W, X, Y, U, R) __extension__ ({\ (__m128d)__builtin_ia32_vfmaddsd3_mask3((__v2df)(__m128d)(W), \ (__v2df)(__m128d)(X), \ (__v2df)(__m128d)(Y), (__mmask8)(U), \ (int)(R)); }) static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask_fmsub_sd (__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) { return (__m128d) __builtin_ia32_vfmaddsd3_mask ( (__v2df) __W, (__v2df) __A, -(__v2df) __B, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm_mask_fmsub_round_sd(W, U, A, B, R) __extension__ ({\ (__m128d)__builtin_ia32_vfmaddsd3_mask((__v2df)(__m128d)(W), \ (__v2df)(__m128d)(A), \ -(__v2df)(__m128d)(B), (__mmask8)(U), \ (int)(R)); }) static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_maskz_fmsub_sd (__mmask8 __U, __m128d __A, __m128d __B, __m128d __C) { return (__m128d) __builtin_ia32_vfmaddsd3_maskz ( (__v2df) __A, (__v2df) __B, -(__v2df) __C, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm_maskz_fmsub_round_sd(U, A, B, C, R) __extension__ ({\ (__m128d)__builtin_ia32_vfmaddsd3_maskz((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ -(__v2df)(__m128d)(C), \ (__mmask8)(U), (int)(R)); }) static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask3_fmsub_sd (__m128d __W, __m128d __X, __m128d __Y, __mmask8 __U) { return (__m128d) __builtin_ia32_vfmsubsd3_mask3 ((__v2df) __W, (__v2df) __X, (__v2df) __Y, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm_mask3_fmsub_round_sd(W, X, Y, U, R) __extension__ ({\ (__m128d)__builtin_ia32_vfmsubsd3_mask3((__v2df)(__m128d)(W), \ (__v2df)(__m128d)(X), \ (__v2df)(__m128d)(Y), \ (__mmask8)(U), (int)(R)); }) static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask_fnmadd_sd (__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) { return (__m128d) __builtin_ia32_vfmaddsd3_mask ( (__v2df) __W, -(__v2df) __A, (__v2df) __B, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm_mask_fnmadd_round_sd(W, U, A, B, R) __extension__ ({\ (__m128d)__builtin_ia32_vfmaddsd3_mask((__v2df)(__m128d)(W), \ -(__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), (__mmask8)(U), \ (int)(R)); }) static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_maskz_fnmadd_sd (__mmask8 __U, __m128d __A, __m128d __B, __m128d __C) { return (__m128d) __builtin_ia32_vfmaddsd3_maskz ( -(__v2df) __A, (__v2df) __B, (__v2df) __C, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm_maskz_fnmadd_round_sd(U, A, B, C, R) __extension__ ({\ (__m128d)__builtin_ia32_vfmaddsd3_maskz(-(__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)(__m128d)(C), (__mmask8)(U), \ (int)(R)); }) static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask3_fnmadd_sd (__m128d __W, __m128d __X, __m128d __Y, __mmask8 __U) { return (__m128d) __builtin_ia32_vfmaddsd3_mask3 (-(__v2df) __W, (__v2df) __X, (__v2df) __Y, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm_mask3_fnmadd_round_sd(W, X, Y, U, R) __extension__({\ (__m128d)__builtin_ia32_vfmaddsd3_mask3(-(__v2df)(__m128d)(W), \ (__v2df)(__m128d)(X), \ (__v2df)(__m128d)(Y), (__mmask8)(U), \ (int)(R)); }) static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask_fnmsub_sd (__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) { return (__m128d) __builtin_ia32_vfmaddsd3_mask ( (__v2df) __W, -(__v2df) __A, -(__v2df) __B, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm_mask_fnmsub_round_sd(W, U, A, B, R) __extension__ ({\ (__m128d)__builtin_ia32_vfmaddsd3_mask((__v2df)(__m128d)(W), \ -(__v2df)(__m128d)(A), \ -(__v2df)(__m128d)(B), (__mmask8)(U), \ (int)(R)); }) static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_maskz_fnmsub_sd (__mmask8 __U, __m128d __A, __m128d __B, __m128d __C) { return (__m128d) __builtin_ia32_vfmaddsd3_maskz ( -(__v2df) __A, (__v2df) __B, -(__v2df) __C, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm_maskz_fnmsub_round_sd(U, A, B, C, R) __extension__ ({\ (__m128d)__builtin_ia32_vfmaddsd3_maskz(-(__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ -(__v2df)(__m128d)(C), \ (__mmask8)(U), \ _MM_FROUND_CUR_DIRECTION); }) static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask3_fnmsub_sd (__m128d __W, __m128d __X, __m128d __Y, __mmask8 __U) { return (__m128d) __builtin_ia32_vfnmsubsd3_mask3 ((__v2df) (__W), (__v2df) __X, (__v2df) (__Y), (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm_mask3_fnmsub_round_sd(W, X, Y, U, R) __extension__({\ (__m128d)__builtin_ia32_vfnmsubsd3_mask3((__v2df)(__m128d)(W), \ (__v2df)(__m128d)(X), \ (__v2df)(__m128d)(Y), \ (__mmask8)(U), (int)(R)); }) #define _mm512_permutex_pd(X, C) __extension__ ({ \ (__m512d)__builtin_shufflevector((__v8df)(__m512d)(X), \ (__v8df)_mm512_undefined_pd(), \ 0 + (((C) >> 0) & 0x3), \ 0 + (((C) >> 2) & 0x3), \ 0 + (((C) >> 4) & 0x3), \ 0 + (((C) >> 6) & 0x3), \ 4 + (((C) >> 0) & 0x3), \ 4 + (((C) >> 2) & 0x3), \ 4 + (((C) >> 4) & 0x3), \ 4 + (((C) >> 6) & 0x3)); }) #define _mm512_mask_permutex_pd(W, U, X, C) __extension__ ({ \ (__m512d)__builtin_ia32_selectpd_512((__mmask8)(U), \ (__v8df)_mm512_permutex_pd((X), (C)), \ (__v8df)(__m512d)(W)); }) #define _mm512_maskz_permutex_pd(U, X, C) __extension__ ({ \ (__m512d)__builtin_ia32_selectpd_512((__mmask8)(U), \ (__v8df)_mm512_permutex_pd((X), (C)), \ (__v8df)_mm512_setzero_pd()); }) #define _mm512_permutex_epi64(X, C) __extension__ ({ \ (__m512i)__builtin_shufflevector((__v8di)(__m512i)(X), \ (__v8di)_mm512_undefined_epi32(), \ 0 + (((C) >> 0) & 0x3), \ 0 + (((C) >> 2) & 0x3), \ 0 + (((C) >> 4) & 0x3), \ 0 + (((C) >> 6) & 0x3), \ 4 + (((C) >> 0) & 0x3), \ 4 + (((C) >> 2) & 0x3), \ 4 + (((C) >> 4) & 0x3), \ 4 + (((C) >> 6) & 0x3)); }) #define _mm512_mask_permutex_epi64(W, U, X, C) __extension__ ({ \ (__m512i)__builtin_ia32_selectq_512((__mmask8)(U), \ (__v8di)_mm512_permutex_epi64((X), (C)), \ (__v8di)(__m512i)(W)); }) #define _mm512_maskz_permutex_epi64(U, X, C) __extension__ ({ \ (__m512i)__builtin_ia32_selectq_512((__mmask8)(U), \ (__v8di)_mm512_permutex_epi64((X), (C)), \ (__v8di)_mm512_setzero_si512()); }) static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_permutexvar_pd (__m512i __X, __m512d __Y) { return (__m512d) __builtin_ia32_permvardf512_mask ((__v8df) __Y, (__v8di) __X, (__v8df) _mm512_undefined_pd (), (__mmask8) -1); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_mask_permutexvar_pd (__m512d __W, __mmask8 __U, __m512i __X, __m512d __Y) { return (__m512d) __builtin_ia32_permvardf512_mask ((__v8df) __Y, (__v8di) __X, (__v8df) __W, (__mmask8) __U); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_maskz_permutexvar_pd (__mmask8 __U, __m512i __X, __m512d __Y) { return (__m512d) __builtin_ia32_permvardf512_mask ((__v8df) __Y, (__v8di) __X, (__v8df) _mm512_setzero_pd (), (__mmask8) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_permutexvar_epi64 (__mmask8 __M, __m512i __X, __m512i __Y) { return (__m512i) __builtin_ia32_permvardi512_mask ((__v8di) __Y, (__v8di) __X, (__v8di) _mm512_setzero_si512 (), __M); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_permutexvar_epi64 (__m512i __X, __m512i __Y) { return (__m512i) __builtin_ia32_permvardi512_mask ((__v8di) __Y, (__v8di) __X, (__v8di) _mm512_undefined_epi32 (), (__mmask8) -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_permutexvar_epi64 (__m512i __W, __mmask8 __M, __m512i __X, __m512i __Y) { return (__m512i) __builtin_ia32_permvardi512_mask ((__v8di) __Y, (__v8di) __X, (__v8di) __W, __M); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_permutexvar_ps (__m512i __X, __m512 __Y) { return (__m512) __builtin_ia32_permvarsf512_mask ((__v16sf) __Y, (__v16si) __X, (__v16sf) _mm512_undefined_ps (), (__mmask16) -1); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_mask_permutexvar_ps (__m512 __W, __mmask16 __U, __m512i __X, __m512 __Y) { return (__m512) __builtin_ia32_permvarsf512_mask ((__v16sf) __Y, (__v16si) __X, (__v16sf) __W, (__mmask16) __U); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_maskz_permutexvar_ps (__mmask16 __U, __m512i __X, __m512 __Y) { return (__m512) __builtin_ia32_permvarsf512_mask ((__v16sf) __Y, (__v16si) __X, (__v16sf) _mm512_setzero_ps (), (__mmask16) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_permutexvar_epi32 (__mmask16 __M, __m512i __X, __m512i __Y) { return (__m512i) __builtin_ia32_permvarsi512_mask ((__v16si) __Y, (__v16si) __X, (__v16si) _mm512_setzero_si512 (), __M); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_permutexvar_epi32 (__m512i __X, __m512i __Y) { return (__m512i) __builtin_ia32_permvarsi512_mask ((__v16si) __Y, (__v16si) __X, (__v16si) _mm512_undefined_epi32 (), (__mmask16) -1); } #define _mm512_permutevar_epi32 _mm512_permutexvar_epi32 static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_permutexvar_epi32 (__m512i __W, __mmask16 __M, __m512i __X, __m512i __Y) { return (__m512i) __builtin_ia32_permvarsi512_mask ((__v16si) __Y, (__v16si) __X, (__v16si) __W, __M); } #define _mm512_mask_permutevar_epi32 _mm512_mask_permutexvar_epi32 static __inline__ __mmask16 __DEFAULT_FN_ATTRS _mm512_kand (__mmask16 __A, __mmask16 __B) { return (__mmask16) __builtin_ia32_kandhi ((__mmask16) __A, (__mmask16) __B); } static __inline__ __mmask16 __DEFAULT_FN_ATTRS _mm512_kandn (__mmask16 __A, __mmask16 __B) { return (__mmask16) __builtin_ia32_kandnhi ((__mmask16) __A, (__mmask16) __B); } static __inline__ __mmask16 __DEFAULT_FN_ATTRS _mm512_kor (__mmask16 __A, __mmask16 __B) { return (__mmask16) __builtin_ia32_korhi ((__mmask16) __A, (__mmask16) __B); } static __inline__ int __DEFAULT_FN_ATTRS _mm512_kortestc (__mmask16 __A, __mmask16 __B) { return __builtin_ia32_kortestchi ((__mmask16) __A, (__mmask16) __B); } static __inline__ int __DEFAULT_FN_ATTRS _mm512_kortestz (__mmask16 __A, __mmask16 __B) { return __builtin_ia32_kortestzhi ((__mmask16) __A, (__mmask16) __B); } static __inline__ __mmask16 __DEFAULT_FN_ATTRS _mm512_kunpackb (__mmask16 __A, __mmask16 __B) { return (__mmask16) __builtin_ia32_kunpckhi ((__mmask16) __A, (__mmask16) __B); } static __inline__ __mmask16 __DEFAULT_FN_ATTRS _mm512_kxnor (__mmask16 __A, __mmask16 __B) { return (__mmask16) __builtin_ia32_kxnorhi ((__mmask16) __A, (__mmask16) __B); } static __inline__ __mmask16 __DEFAULT_FN_ATTRS _mm512_kxor (__mmask16 __A, __mmask16 __B) { return (__mmask16) __builtin_ia32_kxorhi ((__mmask16) __A, (__mmask16) __B); } static __inline__ void __DEFAULT_FN_ATTRS _mm512_stream_si512 (__m512i * __P, __m512i __A) { typedef __v8di __v8di_aligned __attribute__((aligned(64))); __builtin_nontemporal_store((__v8di_aligned)__A, (__v8di_aligned*)__P); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_stream_load_si512 (void const *__P) { typedef __v8di __v8di_aligned __attribute__((aligned(64))); return (__m512i) __builtin_nontemporal_load((const __v8di_aligned *)__P); } static __inline__ void __DEFAULT_FN_ATTRS _mm512_stream_pd (double *__P, __m512d __A) { typedef __v8df __v8df_aligned __attribute__((aligned(64))); __builtin_nontemporal_store((__v8df_aligned)__A, (__v8df_aligned*)__P); } static __inline__ void __DEFAULT_FN_ATTRS _mm512_stream_ps (float *__P, __m512 __A) { typedef __v16sf __v16sf_aligned __attribute__((aligned(64))); __builtin_nontemporal_store((__v16sf_aligned)__A, (__v16sf_aligned*)__P); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_mask_compress_pd (__m512d __W, __mmask8 __U, __m512d __A) { return (__m512d) __builtin_ia32_compressdf512_mask ((__v8df) __A, (__v8df) __W, (__mmask8) __U); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_maskz_compress_pd (__mmask8 __U, __m512d __A) { return (__m512d) __builtin_ia32_compressdf512_mask ((__v8df) __A, (__v8df) _mm512_setzero_pd (), (__mmask8) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_compress_epi64 (__m512i __W, __mmask8 __U, __m512i __A) { return (__m512i) __builtin_ia32_compressdi512_mask ((__v8di) __A, (__v8di) __W, (__mmask8) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_compress_epi64 (__mmask8 __U, __m512i __A) { return (__m512i) __builtin_ia32_compressdi512_mask ((__v8di) __A, (__v8di) _mm512_setzero_si512 (), (__mmask8) __U); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_mask_compress_ps (__m512 __W, __mmask16 __U, __m512 __A) { return (__m512) __builtin_ia32_compresssf512_mask ((__v16sf) __A, (__v16sf) __W, (__mmask16) __U); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_maskz_compress_ps (__mmask16 __U, __m512 __A) { return (__m512) __builtin_ia32_compresssf512_mask ((__v16sf) __A, (__v16sf) _mm512_setzero_ps (), (__mmask16) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_compress_epi32 (__m512i __W, __mmask16 __U, __m512i __A) { return (__m512i) __builtin_ia32_compresssi512_mask ((__v16si) __A, (__v16si) __W, (__mmask16) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_compress_epi32 (__mmask16 __U, __m512i __A) { return (__m512i) __builtin_ia32_compresssi512_mask ((__v16si) __A, (__v16si) _mm512_setzero_si512 (), (__mmask16) __U); } #define _mm_cmp_round_ss_mask(X, Y, P, R) __extension__ ({ \ (__mmask8)__builtin_ia32_cmpss_mask((__v4sf)(__m128)(X), \ (__v4sf)(__m128)(Y), (int)(P), \ (__mmask8)-1, (int)(R)); }) #define _mm_mask_cmp_round_ss_mask(M, X, Y, P, R) __extension__ ({ \ (__mmask8)__builtin_ia32_cmpss_mask((__v4sf)(__m128)(X), \ (__v4sf)(__m128)(Y), (int)(P), \ (__mmask8)(M), (int)(R)); }) #define _mm_cmp_ss_mask(X, Y, P) __extension__ ({ \ (__mmask8)__builtin_ia32_cmpss_mask((__v4sf)(__m128)(X), \ (__v4sf)(__m128)(Y), (int)(P), \ (__mmask8)-1, \ _MM_FROUND_CUR_DIRECTION); }) #define _mm_mask_cmp_ss_mask(M, X, Y, P) __extension__ ({ \ (__mmask8)__builtin_ia32_cmpss_mask((__v4sf)(__m128)(X), \ (__v4sf)(__m128)(Y), (int)(P), \ (__mmask8)(M), \ _MM_FROUND_CUR_DIRECTION); }) #define _mm_cmp_round_sd_mask(X, Y, P, R) __extension__ ({ \ (__mmask8)__builtin_ia32_cmpsd_mask((__v2df)(__m128d)(X), \ (__v2df)(__m128d)(Y), (int)(P), \ (__mmask8)-1, (int)(R)); }) #define _mm_mask_cmp_round_sd_mask(M, X, Y, P, R) __extension__ ({ \ (__mmask8)__builtin_ia32_cmpsd_mask((__v2df)(__m128d)(X), \ (__v2df)(__m128d)(Y), (int)(P), \ (__mmask8)(M), (int)(R)); }) #define _mm_cmp_sd_mask(X, Y, P) __extension__ ({ \ (__mmask8)__builtin_ia32_cmpsd_mask((__v2df)(__m128d)(X), \ (__v2df)(__m128d)(Y), (int)(P), \ (__mmask8)-1, \ _MM_FROUND_CUR_DIRECTION); }) #define _mm_mask_cmp_sd_mask(M, X, Y, P) __extension__ ({ \ (__mmask8)__builtin_ia32_cmpsd_mask((__v2df)(__m128d)(X), \ (__v2df)(__m128d)(Y), (int)(P), \ (__mmask8)(M), \ _MM_FROUND_CUR_DIRECTION); }) /* Bit Test */ static __inline __mmask16 __DEFAULT_FN_ATTRS _mm512_test_epi32_mask (__m512i __A, __m512i __B) { return _mm512_cmpneq_epi32_mask (_mm512_and_epi32(__A, __B), _mm512_setzero_epi32()); } static __inline__ __mmask16 __DEFAULT_FN_ATTRS _mm512_mask_test_epi32_mask (__mmask16 __U, __m512i __A, __m512i __B) { return _mm512_mask_cmpneq_epi32_mask (__U, _mm512_and_epi32 (__A, __B), _mm512_setzero_epi32()); } static __inline __mmask8 __DEFAULT_FN_ATTRS _mm512_test_epi64_mask (__m512i __A, __m512i __B) { return _mm512_cmpneq_epi64_mask (_mm512_and_epi32 (__A, __B), _mm512_setzero_epi32()); } static __inline__ __mmask8 __DEFAULT_FN_ATTRS _mm512_mask_test_epi64_mask (__mmask8 __U, __m512i __A, __m512i __B) { return _mm512_mask_cmpneq_epi64_mask (__U, _mm512_and_epi32 (__A, __B), _mm512_setzero_epi32()); } static __inline__ __mmask16 __DEFAULT_FN_ATTRS _mm512_testn_epi32_mask (__m512i __A, __m512i __B) { return _mm512_cmpeq_epi32_mask (_mm512_and_epi32 (__A, __B), _mm512_setzero_epi32()); } static __inline__ __mmask16 __DEFAULT_FN_ATTRS _mm512_mask_testn_epi32_mask (__mmask16 __U, __m512i __A, __m512i __B) { return _mm512_mask_cmpeq_epi32_mask (__U, _mm512_and_epi32 (__A, __B), _mm512_setzero_epi32()); } static __inline__ __mmask8 __DEFAULT_FN_ATTRS _mm512_testn_epi64_mask (__m512i __A, __m512i __B) { return _mm512_cmpeq_epi64_mask (_mm512_and_epi32 (__A, __B), _mm512_setzero_epi32()); } static __inline__ __mmask8 __DEFAULT_FN_ATTRS _mm512_mask_testn_epi64_mask (__mmask8 __U, __m512i __A, __m512i __B) { return _mm512_mask_cmpeq_epi64_mask (__U, _mm512_and_epi32 (__A, __B), _mm512_setzero_epi32()); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_movehdup_ps (__m512 __A) { return (__m512)__builtin_shufflevector((__v16sf)__A, (__v16sf)__A, 1, 1, 3, 3, 5, 5, 7, 7, 9, 9, 11, 11, 13, 13, 15, 15); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_mask_movehdup_ps (__m512 __W, __mmask16 __U, __m512 __A) { return (__m512)__builtin_ia32_selectps_512((__mmask16)__U, (__v16sf)_mm512_movehdup_ps(__A), (__v16sf)__W); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_maskz_movehdup_ps (__mmask16 __U, __m512 __A) { return (__m512)__builtin_ia32_selectps_512((__mmask16)__U, (__v16sf)_mm512_movehdup_ps(__A), (__v16sf)_mm512_setzero_ps()); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_moveldup_ps (__m512 __A) { return (__m512)__builtin_shufflevector((__v16sf)__A, (__v16sf)__A, 0, 0, 2, 2, 4, 4, 6, 6, 8, 8, 10, 10, 12, 12, 14, 14); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_mask_moveldup_ps (__m512 __W, __mmask16 __U, __m512 __A) { return (__m512)__builtin_ia32_selectps_512((__mmask16)__U, (__v16sf)_mm512_moveldup_ps(__A), (__v16sf)__W); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_maskz_moveldup_ps (__mmask16 __U, __m512 __A) { return (__m512)__builtin_ia32_selectps_512((__mmask16)__U, (__v16sf)_mm512_moveldup_ps(__A), (__v16sf)_mm512_setzero_ps()); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask_move_ss (__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) { __m128 res = __A; res[0] = (__U & 1) ? __B[0] : __W[0]; return res; } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maskz_move_ss (__mmask8 __U, __m128 __A, __m128 __B) { __m128 res = __A; res[0] = (__U & 1) ? __B[0] : 0; return res; } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask_move_sd (__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) { __m128d res = __A; res[0] = (__U & 1) ? __B[0] : __W[0]; return res; } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_maskz_move_sd (__mmask8 __U, __m128d __A, __m128d __B) { __m128d res = __A; res[0] = (__U & 1) ? __B[0] : 0; return res; } static __inline__ void __DEFAULT_FN_ATTRS _mm_mask_store_ss (float * __W, __mmask8 __U, __m128 __A) { __builtin_ia32_storess128_mask ((__v16sf *)__W, (__v16sf) _mm512_castps128_ps512(__A), (__mmask16) __U & (__mmask16)1); } static __inline__ void __DEFAULT_FN_ATTRS _mm_mask_store_sd (double * __W, __mmask8 __U, __m128d __A) { __builtin_ia32_storesd128_mask ((__v8df *)__W, (__v8df) _mm512_castpd128_pd512(__A), (__mmask8) __U & 1); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask_load_ss (__m128 __W, __mmask8 __U, const float* __A) { __m128 src = (__v4sf) __builtin_shufflevector((__v4sf) __W, (__v4sf) {0.0, 0.0, 0.0, 0.0}, 0, 4, 4, 4); return (__m128) __builtin_shufflevector( __builtin_ia32_loadss128_mask ((__v16sf *) __A, (__v16sf) _mm512_castps128_ps512(src), (__mmask16) __U & 1), _mm512_undefined_ps(), 0, 1, 2, 3); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maskz_load_ss (__mmask8 __U, const float* __A) { return (__m128) __builtin_shufflevector( __builtin_ia32_loadss128_mask ((__v16sf *) __A, (__v16sf) _mm512_setzero_ps(), (__mmask16) __U & 1), _mm512_undefined_ps(), 0, 1, 2, 3); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask_load_sd (__m128d __W, __mmask8 __U, const double* __A) { __m128d src = (__v2df) __builtin_shufflevector((__v2df) __W, (__v2df) {0.0, 0.0}, 0, 2); return (__m128d) __builtin_shufflevector( __builtin_ia32_loadsd128_mask ((__v8df *) __A, (__v8df) _mm512_castpd128_pd512(src), (__mmask8) __U & 1), _mm512_undefined_pd(), 0, 1); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_maskz_load_sd (__mmask8 __U, const double* __A) { return (__m128d) __builtin_shufflevector( __builtin_ia32_loadsd128_mask ((__v8df *) __A, (__v8df) _mm512_setzero_pd(), (__mmask8) __U & 1), _mm512_undefined_pd(), 0, 1); } #define _mm512_shuffle_epi32(A, I) __extension__ ({ \ (__m512i)__builtin_shufflevector((__v16si)(__m512i)(A), \ (__v16si)_mm512_undefined_epi32(), \ 0 + (((I) >> 0) & 0x3), \ 0 + (((I) >> 2) & 0x3), \ 0 + (((I) >> 4) & 0x3), \ 0 + (((I) >> 6) & 0x3), \ 4 + (((I) >> 0) & 0x3), \ 4 + (((I) >> 2) & 0x3), \ 4 + (((I) >> 4) & 0x3), \ 4 + (((I) >> 6) & 0x3), \ 8 + (((I) >> 0) & 0x3), \ 8 + (((I) >> 2) & 0x3), \ 8 + (((I) >> 4) & 0x3), \ 8 + (((I) >> 6) & 0x3), \ 12 + (((I) >> 0) & 0x3), \ 12 + (((I) >> 2) & 0x3), \ 12 + (((I) >> 4) & 0x3), \ 12 + (((I) >> 6) & 0x3)); }) #define _mm512_mask_shuffle_epi32(W, U, A, I) __extension__ ({ \ (__m512i)__builtin_ia32_selectd_512((__mmask16)(U), \ (__v16si)_mm512_shuffle_epi32((A), (I)), \ (__v16si)(__m512i)(W)); }) #define _mm512_maskz_shuffle_epi32(U, A, I) __extension__ ({ \ (__m512i)__builtin_ia32_selectd_512((__mmask16)(U), \ (__v16si)_mm512_shuffle_epi32((A), (I)), \ (__v16si)_mm512_setzero_si512()); }) static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_mask_expand_pd (__m512d __W, __mmask8 __U, __m512d __A) { return (__m512d) __builtin_ia32_expanddf512_mask ((__v8df) __A, (__v8df) __W, (__mmask8) __U); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_maskz_expand_pd (__mmask8 __U, __m512d __A) { return (__m512d) __builtin_ia32_expanddf512_mask ((__v8df) __A, (__v8df) _mm512_setzero_pd (), (__mmask8) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_expand_epi64 (__m512i __W, __mmask8 __U, __m512i __A) { return (__m512i) __builtin_ia32_expanddi512_mask ((__v8di) __A, (__v8di) __W, (__mmask8) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_expand_epi64 ( __mmask8 __U, __m512i __A) { return (__m512i) __builtin_ia32_expanddi512_mask ((__v8di) __A, (__v8di) _mm512_setzero_pd (), (__mmask8) __U); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_mask_expandloadu_pd(__m512d __W, __mmask8 __U, void const *__P) { return (__m512d) __builtin_ia32_expandloaddf512_mask ((const __v8df *)__P, (__v8df) __W, (__mmask8) __U); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_maskz_expandloadu_pd(__mmask8 __U, void const *__P) { return (__m512d) __builtin_ia32_expandloaddf512_mask ((const __v8df *)__P, (__v8df) _mm512_setzero_pd(), (__mmask8) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_expandloadu_epi64(__m512i __W, __mmask8 __U, void const *__P) { return (__m512i) __builtin_ia32_expandloaddi512_mask ((const __v8di *)__P, (__v8di) __W, (__mmask8) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_expandloadu_epi64(__mmask8 __U, void const *__P) { return (__m512i) __builtin_ia32_expandloaddi512_mask ((const __v8di *)__P, (__v8di) _mm512_setzero_pd(), (__mmask8) __U); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_mask_expandloadu_ps(__m512 __W, __mmask16 __U, void const *__P) { return (__m512) __builtin_ia32_expandloadsf512_mask ((const __v16sf *)__P, (__v16sf) __W, (__mmask16) __U); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_maskz_expandloadu_ps(__mmask16 __U, void const *__P) { return (__m512) __builtin_ia32_expandloadsf512_mask ((const __v16sf *)__P, (__v16sf) _mm512_setzero_ps(), (__mmask16) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_expandloadu_epi32(__m512i __W, __mmask16 __U, void const *__P) { return (__m512i) __builtin_ia32_expandloadsi512_mask ((const __v16si *)__P, (__v16si) __W, (__mmask16) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_expandloadu_epi32(__mmask16 __U, void const *__P) { return (__m512i) __builtin_ia32_expandloadsi512_mask ((const __v16si *)__P, (__v16si) _mm512_setzero_ps(), (__mmask16) __U); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_mask_expand_ps (__m512 __W, __mmask16 __U, __m512 __A) { return (__m512) __builtin_ia32_expandsf512_mask ((__v16sf) __A, (__v16sf) __W, (__mmask16) __U); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_maskz_expand_ps (__mmask16 __U, __m512 __A) { return (__m512) __builtin_ia32_expandsf512_mask ((__v16sf) __A, (__v16sf) _mm512_setzero_ps(), (__mmask16) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_expand_epi32 (__m512i __W, __mmask16 __U, __m512i __A) { return (__m512i) __builtin_ia32_expandsi512_mask ((__v16si) __A, (__v16si) __W, (__mmask16) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_expand_epi32 (__mmask16 __U, __m512i __A) { return (__m512i) __builtin_ia32_expandsi512_mask ((__v16si) __A, (__v16si) _mm512_setzero_ps(), (__mmask16) __U); } #define _mm512_cvt_roundps_pd(A, R) __extension__ ({ \ (__m512d)__builtin_ia32_cvtps2pd512_mask((__v8sf)(__m256)(A), \ (__v8df)_mm512_undefined_pd(), \ (__mmask8)-1, (int)(R)); }) #define _mm512_mask_cvt_roundps_pd(W, U, A, R) __extension__ ({ \ (__m512d)__builtin_ia32_cvtps2pd512_mask((__v8sf)(__m256)(A), \ (__v8df)(__m512d)(W), \ (__mmask8)(U), (int)(R)); }) #define _mm512_maskz_cvt_roundps_pd(U, A, R) __extension__ ({ \ (__m512d)__builtin_ia32_cvtps2pd512_mask((__v8sf)(__m256)(A), \ (__v8df)_mm512_setzero_pd(), \ (__mmask8)(U), (int)(R)); }) static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_cvtps_pd (__m256 __A) { return (__m512d) __builtin_ia32_cvtps2pd512_mask ((__v8sf) __A, (__v8df) _mm512_undefined_pd (), (__mmask8) -1, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_mask_cvtps_pd (__m512d __W, __mmask8 __U, __m256 __A) { return (__m512d) __builtin_ia32_cvtps2pd512_mask ((__v8sf) __A, (__v8df) __W, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_maskz_cvtps_pd (__mmask8 __U, __m256 __A) { return (__m512d) __builtin_ia32_cvtps2pd512_mask ((__v8sf) __A, (__v8df) _mm512_setzero_pd (), (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_cvtpslo_pd (__m512 __A) { return (__m512) _mm512_cvtps_pd(_mm512_castps512_ps256(__A)); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_mask_cvtpslo_pd (__m512d __W, __mmask8 __U, __m512 __A) { return (__m512) _mm512_mask_cvtps_pd(__W, __U, _mm512_castps512_ps256(__A)); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_mask_mov_pd (__m512d __W, __mmask8 __U, __m512d __A) { return (__m512d) __builtin_ia32_selectpd_512 ((__mmask8) __U, (__v8df) __A, (__v8df) __W); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_maskz_mov_pd (__mmask8 __U, __m512d __A) { return (__m512d) __builtin_ia32_selectpd_512 ((__mmask8) __U, (__v8df) __A, (__v8df) _mm512_setzero_pd ()); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_mask_mov_ps (__m512 __W, __mmask16 __U, __m512 __A) { return (__m512) __builtin_ia32_selectps_512 ((__mmask16) __U, (__v16sf) __A, (__v16sf) __W); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_maskz_mov_ps (__mmask16 __U, __m512 __A) { return (__m512) __builtin_ia32_selectps_512 ((__mmask16) __U, (__v16sf) __A, (__v16sf) _mm512_setzero_ps ()); } static __inline__ void __DEFAULT_FN_ATTRS _mm512_mask_compressstoreu_pd (void *__P, __mmask8 __U, __m512d __A) { __builtin_ia32_compressstoredf512_mask ((__v8df *) __P, (__v8df) __A, (__mmask8) __U); } static __inline__ void __DEFAULT_FN_ATTRS _mm512_mask_compressstoreu_epi64 (void *__P, __mmask8 __U, __m512i __A) { __builtin_ia32_compressstoredi512_mask ((__v8di *) __P, (__v8di) __A, (__mmask8) __U); } static __inline__ void __DEFAULT_FN_ATTRS _mm512_mask_compressstoreu_ps (void *__P, __mmask16 __U, __m512 __A) { __builtin_ia32_compressstoresf512_mask ((__v16sf *) __P, (__v16sf) __A, (__mmask16) __U); } static __inline__ void __DEFAULT_FN_ATTRS _mm512_mask_compressstoreu_epi32 (void *__P, __mmask16 __U, __m512i __A) { __builtin_ia32_compressstoresi512_mask ((__v16si *) __P, (__v16si) __A, (__mmask16) __U); } #define _mm_cvt_roundsd_ss(A, B, R) __extension__ ({ \ (__m128)__builtin_ia32_cvtsd2ss_round_mask((__v4sf)(__m128)(A), \ (__v2df)(__m128d)(B), \ (__v4sf)_mm_undefined_ps(), \ (__mmask8)-1, (int)(R)); }) #define _mm_mask_cvt_roundsd_ss(W, U, A, B, R) __extension__ ({ \ (__m128)__builtin_ia32_cvtsd2ss_round_mask((__v4sf)(__m128)(A), \ (__v2df)(__m128d)(B), \ (__v4sf)(__m128)(W), \ (__mmask8)(U), (int)(R)); }) #define _mm_maskz_cvt_roundsd_ss(U, A, B, R) __extension__ ({ \ (__m128)__builtin_ia32_cvtsd2ss_round_mask((__v4sf)(__m128)(A), \ (__v2df)(__m128d)(B), \ (__v4sf)_mm_setzero_ps(), \ (__mmask8)(U), (int)(R)); }) static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask_cvtsd_ss (__m128 __W, __mmask8 __U, __m128 __A, __m128d __B) { return __builtin_ia32_cvtsd2ss_round_mask ((__v4sf)(__A), (__v2df)(__B), (__v4sf)(__W), (__mmask8)(__U), _MM_FROUND_CUR_DIRECTION); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maskz_cvtsd_ss (__mmask8 __U, __m128 __A, __m128d __B) { return __builtin_ia32_cvtsd2ss_round_mask ((__v4sf)(__A), (__v2df)(__B), (__v4sf)_mm_setzero_ps(), (__mmask8)(__U), _MM_FROUND_CUR_DIRECTION); } #define _mm_cvtss_i32 _mm_cvtss_si32 #define _mm_cvtsd_i32 _mm_cvtsd_si32 #define _mm_cvti32_sd _mm_cvtsi32_sd #define _mm_cvti32_ss _mm_cvtsi32_ss #ifdef __x86_64__ #define _mm_cvtss_i64 _mm_cvtss_si64 #define _mm_cvtsd_i64 _mm_cvtsd_si64 #define _mm_cvti64_sd _mm_cvtsi64_sd #define _mm_cvti64_ss _mm_cvtsi64_ss #endif # 9464 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512fintrin.h" 3 #ifdef __x86_64__ #define _mm_cvt_roundi64_sd(A, B, R) __extension__ ({ \ (__m128d)__builtin_ia32_cvtsi2sd64((__v2df)(__m128d)(A), (long long)(B), \ (int)(R)); }) #define _mm_cvt_roundsi64_sd(A, B, R) __extension__ ({ \ (__m128d)__builtin_ia32_cvtsi2sd64((__v2df)(__m128d)(A), (long long)(B), \ (int)(R)); }) #endif # 9474 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512fintrin.h" 3 #define _mm_cvt_roundsi32_ss(A, B, R) __extension__ ({ \ (__m128)__builtin_ia32_cvtsi2ss32((__v4sf)(__m128)(A), (int)(B), (int)(R)); }) #define _mm_cvt_roundi32_ss(A, B, R) __extension__ ({ \ (__m128)__builtin_ia32_cvtsi2ss32((__v4sf)(__m128)(A), (int)(B), (int)(R)); }) #ifdef __x86_64__ #define _mm_cvt_roundsi64_ss(A, B, R) __extension__ ({ \ (__m128)__builtin_ia32_cvtsi2ss64((__v4sf)(__m128)(A), (long long)(B), \ (int)(R)); }) #define _mm_cvt_roundi64_ss(A, B, R) __extension__ ({ \ (__m128)__builtin_ia32_cvtsi2ss64((__v4sf)(__m128)(A), (long long)(B), \ (int)(R)); }) #endif # 9490 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512fintrin.h" 3 #define _mm_cvt_roundss_sd(A, B, R) __extension__ ({ \ (__m128d)__builtin_ia32_cvtss2sd_round_mask((__v2df)(__m128d)(A), \ (__v4sf)(__m128)(B), \ (__v2df)_mm_undefined_pd(), \ (__mmask8)-1, (int)(R)); }) #define _mm_mask_cvt_roundss_sd(W, U, A, B, R) __extension__ ({ \ (__m128d)__builtin_ia32_cvtss2sd_round_mask((__v2df)(__m128d)(A), \ (__v4sf)(__m128)(B), \ (__v2df)(__m128d)(W), \ (__mmask8)(U), (int)(R)); }) #define _mm_maskz_cvt_roundss_sd(U, A, B, R) __extension__ ({ \ (__m128d)__builtin_ia32_cvtss2sd_round_mask((__v2df)(__m128d)(A), \ (__v4sf)(__m128)(B), \ (__v2df)_mm_setzero_pd(), \ (__mmask8)(U), (int)(R)); }) static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask_cvtss_sd (__m128d __W, __mmask8 __U, __m128d __A, __m128 __B) { return __builtin_ia32_cvtss2sd_round_mask((__v2df)(__A), (__v4sf)(__B), (__v2df)(__W), (__mmask8)(__U), _MM_FROUND_CUR_DIRECTION); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_maskz_cvtss_sd (__mmask8 __U, __m128d __A, __m128 __B) { return __builtin_ia32_cvtss2sd_round_mask((__v2df)(__A), (__v4sf)(__B), (__v2df)_mm_setzero_pd(), (__mmask8)(__U), _MM_FROUND_CUR_DIRECTION); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cvtu32_sd (__m128d __A, unsigned __B) { return (__m128d) __builtin_ia32_cvtusi2sd32 ((__v2df) __A, __B); } #ifdef __x86_64__ #define _mm_cvt_roundu64_sd(A, B, R) __extension__ ({ \ (__m128d)__builtin_ia32_cvtusi2sd64((__v2df)(__m128d)(A), \ (unsigned long long)(B), (int)(R)); }) static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cvtu64_sd (__m128d __A, unsigned long long __B) { return (__m128d) __builtin_ia32_cvtusi2sd64 ((__v2df) __A, __B, _MM_FROUND_CUR_DIRECTION); } #endif # 9545 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512fintrin.h" 3 #define _mm_cvt_roundu32_ss(A, B, R) __extension__ ({ \ (__m128)__builtin_ia32_cvtusi2ss32((__v4sf)(__m128)(A), (unsigned int)(B), \ (int)(R)); }) static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cvtu32_ss (__m128 __A, unsigned __B) { return (__m128) __builtin_ia32_cvtusi2ss32 ((__v4sf) __A, __B, _MM_FROUND_CUR_DIRECTION); } #ifdef __x86_64__ #define _mm_cvt_roundu64_ss(A, B, R) __extension__ ({ \ (__m128)__builtin_ia32_cvtusi2ss64((__v4sf)(__m128)(A), \ (unsigned long long)(B), (int)(R)); }) static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cvtu64_ss (__m128 __A, unsigned long long __B) { return (__m128) __builtin_ia32_cvtusi2ss64 ((__v4sf) __A, __B, _MM_FROUND_CUR_DIRECTION); } #endif # 9569 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512fintrin.h" 3 static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_set1_epi32 (__m512i __O, __mmask16 __M, int __A) { return (__m512i) __builtin_ia32_selectd_512(__M, (__v16si) _mm512_set1_epi32(__A), (__v16si) __O); } #ifdef __x86_64__ static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_set1_epi64 (__m512i __O, __mmask8 __M, long long __A) { return (__m512i) __builtin_ia32_selectq_512(__M, (__v8di) _mm512_set1_epi64(__A), (__v8di) __O); } #endif # 9587 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512fintrin.h" 3 static __inline __m512i __DEFAULT_FN_ATTRS _mm512_set_epi8 (char __e63, char __e62, char __e61, char __e60, char __e59, char __e58, char __e57, char __e56, char __e55, char __e54, char __e53, char __e52, char __e51, char __e50, char __e49, char __e48, char __e47, char __e46, char __e45, char __e44, char __e43, char __e42, char __e41, char __e40, char __e39, char __e38, char __e37, char __e36, char __e35, char __e34, char __e33, char __e32, char __e31, char __e30, char __e29, char __e28, char __e27, char __e26, char __e25, char __e24, char __e23, char __e22, char __e21, char __e20, char __e19, char __e18, char __e17, char __e16, char __e15, char __e14, char __e13, char __e12, char __e11, char __e10, char __e9, char __e8, char __e7, char __e6, char __e5, char __e4, char __e3, char __e2, char __e1, char __e0) { return __extension__ (__m512i)(__v64qi) {__e0, __e1, __e2, __e3, __e4, __e5, __e6, __e7, __e8, __e9, __e10, __e11, __e12, __e13, __e14, __e15, __e16, __e17, __e18, __e19, __e20, __e21, __e22, __e23, __e24, __e25, __e26, __e27, __e28, __e29, __e30, __e31, __e32, __e33, __e34, __e35, __e36, __e37, __e38, __e39, __e40, __e41, __e42, __e43, __e44, __e45, __e46, __e47, __e48, __e49, __e50, __e51, __e52, __e53, __e54, __e55, __e56, __e57, __e58, __e59, __e60, __e61, __e62, __e63}; } static __inline __m512i __DEFAULT_FN_ATTRS _mm512_set_epi16(short __e31, short __e30, short __e29, short __e28, short __e27, short __e26, short __e25, short __e24, short __e23, short __e22, short __e21, short __e20, short __e19, short __e18, short __e17, short __e16, short __e15, short __e14, short __e13, short __e12, short __e11, short __e10, short __e9, short __e8, short __e7, short __e6, short __e5, short __e4, short __e3, short __e2, short __e1, short __e0) { return __extension__ (__m512i)(__v32hi) {__e0, __e1, __e2, __e3, __e4, __e5, __e6, __e7, __e8, __e9, __e10, __e11, __e12, __e13, __e14, __e15, __e16, __e17, __e18, __e19, __e20, __e21, __e22, __e23, __e24, __e25, __e26, __e27, __e28, __e29, __e30, __e31 }; } static __inline __m512i __DEFAULT_FN_ATTRS _mm512_set_epi32 (int __A, int __B, int __C, int __D, int __E, int __F, int __G, int __H, int __I, int __J, int __K, int __L, int __M, int __N, int __O, int __P) { return __extension__ (__m512i)(__v16si) { __P, __O, __N, __M, __L, __K, __J, __I, __H, __G, __F, __E, __D, __C, __B, __A }; } #define _mm512_setr_epi32(e0,e1,e2,e3,e4,e5,e6,e7, \ e8,e9,e10,e11,e12,e13,e14,e15) \ _mm512_set_epi32((e15),(e14),(e13),(e12),(e11),(e10),(e9),(e8),(e7),(e6), \ (e5),(e4),(e3),(e2),(e1),(e0)) static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_set_epi64 (long long __A, long long __B, long long __C, long long __D, long long __E, long long __F, long long __G, long long __H) { return __extension__ (__m512i) (__v8di) { __H, __G, __F, __E, __D, __C, __B, __A }; } #define _mm512_setr_epi64(e0,e1,e2,e3,e4,e5,e6,e7) \ _mm512_set_epi64((e7),(e6),(e5),(e4),(e3),(e2),(e1),(e0)) static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_set_pd (double __A, double __B, double __C, double __D, double __E, double __F, double __G, double __H) { return __extension__ (__m512d) { __H, __G, __F, __E, __D, __C, __B, __A }; } #define _mm512_setr_pd(e0,e1,e2,e3,e4,e5,e6,e7) \ _mm512_set_pd((e7),(e6),(e5),(e4),(e3),(e2),(e1),(e0)) static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_set_ps (float __A, float __B, float __C, float __D, float __E, float __F, float __G, float __H, float __I, float __J, float __K, float __L, float __M, float __N, float __O, float __P) { return __extension__ (__m512) { __P, __O, __N, __M, __L, __K, __J, __I, __H, __G, __F, __E, __D, __C, __B, __A }; } #define _mm512_setr_ps(e0,e1,e2,e3,e4,e5,e6,e7,e8,e9,e10,e11,e12,e13,e14,e15) \ _mm512_set_ps((e15),(e14),(e13),(e12),(e11),(e10),(e9),(e8),(e7),(e6),(e5), \ (e4),(e3),(e2),(e1),(e0)) static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_abs_ps(__m512 __A) { return (__m512)_mm512_and_epi32(_mm512_set1_epi32(0x7FFFFFFF),(__m512i)__A) ; } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_mask_abs_ps(__m512 __W, __mmask16 __K, __m512 __A) { return (__m512)_mm512_mask_and_epi32((__m512i)__W, __K, _mm512_set1_epi32(0x7FFFFFFF),(__m512i)__A) ; } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_abs_pd(__m512d __A) { return (__m512d)_mm512_and_epi64(_mm512_set1_epi64(0x7FFFFFFFFFFFFFFF),(__v8di)__A) ; } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_mask_abs_pd(__m512d __W, __mmask8 __K, __m512d __A) { return (__m512d)_mm512_mask_and_epi64((__v8di)__W, __K, _mm512_set1_epi64(0x7FFFFFFFFFFFFFFF),(__v8di)__A); } // Vector-reduction arithmetic accepts vectors as inputs and produces scalars as // outputs. This class of vector operation forms the basis of many scientific // computations. In vector-reduction arithmetic, the evaluation off is // independent of the order of the input elements of V. // Used bisection method. At each step, we partition the vector with previous // step in half, and the operation is performed on its two halves. // This takes log2(n) steps where n is the number of elements in the vector. // Vec512 - Vector with size 512. // Operator - Can be one of following: +,*,&,| // T2 - Can get 'i' for int and 'f' for float. // T1 - Can get 'i' for int and 'd' for double. #define _mm512_reduce_operator_64bit(Vec512, Operator, T2, T1) \ __extension__({ \ __m256##T1 Vec256 = __builtin_shufflevector( \ (__v8d##T2)Vec512, \ (__v8d##T2)Vec512, \ 0, 1, 2, 3) \ Operator \ __builtin_shufflevector( \ (__v8d##T2)Vec512, \ (__v8d##T2)Vec512, \ 4, 5, 6, 7); \ __m128##T1 Vec128 = __builtin_shufflevector( \ (__v4d##T2)Vec256, \ (__v4d##T2)Vec256, \ 0, 1) \ Operator \ __builtin_shufflevector( \ (__v4d##T2)Vec256, \ (__v4d##T2)Vec256, \ 2, 3); \ Vec128 = __builtin_shufflevector((__v2d##T2)Vec128, \ (__v2d##T2)Vec128, 0, -1) \ Operator \ __builtin_shufflevector((__v2d##T2)Vec128, \ (__v2d##T2)Vec128, 1, -1); \ return Vec128[0]; \ }) static __inline__ long long __DEFAULT_FN_ATTRS _mm512_reduce_add_epi64(__m512i __W) { _mm512_reduce_operator_64bit(__W, +, i, i); } static __inline__ long long __DEFAULT_FN_ATTRS _mm512_reduce_mul_epi64(__m512i __W) { _mm512_reduce_operator_64bit(__W, *, i, i); } static __inline__ long long __DEFAULT_FN_ATTRS _mm512_reduce_and_epi64(__m512i __W) { _mm512_reduce_operator_64bit(__W, &, i, i); } static __inline__ long long __DEFAULT_FN_ATTRS _mm512_reduce_or_epi64(__m512i __W) { _mm512_reduce_operator_64bit(__W, |, i, i); } static __inline__ double __DEFAULT_FN_ATTRS _mm512_reduce_add_pd(__m512d __W) { _mm512_reduce_operator_64bit(__W, +, f, d); } static __inline__ double __DEFAULT_FN_ATTRS _mm512_reduce_mul_pd(__m512d __W) { _mm512_reduce_operator_64bit(__W, *, f, d); } // Vec512 - Vector with size 512. // Vec512Neutral - All vector elements set to the identity element. // Identity element: {+,0},{*,1},{&,0xFFFFFFFFFFFFFFFF},{|,0} // Operator - Can be one of following: +,*,&,| // Mask - Intrinsic Mask // T2 - Can get 'i' for int and 'f' for float. // T1 - Can get 'i' for int and 'd' for packed double-precision. // T3 - Can be Pd for packed double or q for q-word. #define _mm512_mask_reduce_operator_64bit(Vec512, Vec512Neutral, Operator, \ Mask, T2, T1, T3) \ __extension__({ \ Vec512 = __builtin_ia32_select##T3##_512( \ (__mmask8)Mask, \ (__v8d##T2)Vec512, \ (__v8d##T2)Vec512Neutral); \ _mm512_reduce_operator_64bit(Vec512, Operator, T2, T1); \ }) static __inline__ long long __DEFAULT_FN_ATTRS _mm512_mask_reduce_add_epi64(__mmask8 __M, __m512i __W) { _mm512_mask_reduce_operator_64bit(__W, _mm512_set1_epi64(0), +, __M, i, i, q); } static __inline__ long long __DEFAULT_FN_ATTRS _mm512_mask_reduce_mul_epi64(__mmask8 __M, __m512i __W) { _mm512_mask_reduce_operator_64bit(__W, _mm512_set1_epi64(1), *, __M, i, i, q); } static __inline__ long long __DEFAULT_FN_ATTRS _mm512_mask_reduce_and_epi64(__mmask8 __M, __m512i __W) { _mm512_mask_reduce_operator_64bit(__W, _mm512_set1_epi64(0xFFFFFFFFFFFFFFFF), &, __M, i, i, q); } static __inline__ long long __DEFAULT_FN_ATTRS _mm512_mask_reduce_or_epi64(__mmask8 __M, __m512i __W) { _mm512_mask_reduce_operator_64bit(__W, _mm512_set1_epi64(0), |, __M, i, i, q); } static __inline__ double __DEFAULT_FN_ATTRS _mm512_mask_reduce_add_pd(__mmask8 __M, __m512d __W) { _mm512_mask_reduce_operator_64bit(__W, _mm512_set1_pd(0), +, __M, f, d, pd); } static __inline__ double __DEFAULT_FN_ATTRS _mm512_mask_reduce_mul_pd(__mmask8 __M, __m512d __W) { _mm512_mask_reduce_operator_64bit(__W, _mm512_set1_pd(1), *, __M, f, d, pd); } // Vec512 - Vector with size 512. // Operator - Can be one of following: +,*,&,| // T2 - Can get 'i' for int and ' ' for packed single. // T1 - Can get 'i' for int and 'f' for float. #define _mm512_reduce_operator_32bit(Vec512, Operator, T2, T1) __extension__({ \ __m256##T1 Vec256 = \ (__m256##T1)(__builtin_shufflevector( \ (__v16s##T2)Vec512, \ (__v16s##T2)Vec512, \ 0, 1, 2, 3, 4, 5, 6, 7) \ Operator \ __builtin_shufflevector( \ (__v16s##T2)Vec512, \ (__v16s##T2)Vec512, \ 8, 9, 10, 11, 12, 13, 14, 15)); \ __m128##T1 Vec128 = \ (__m128##T1)(__builtin_shufflevector( \ (__v8s##T2)Vec256, \ (__v8s##T2)Vec256, \ 0, 1, 2, 3) \ Operator \ __builtin_shufflevector( \ (__v8s##T2)Vec256, \ (__v8s##T2)Vec256, \ 4, 5, 6, 7)); \ Vec128 = (__m128##T1)(__builtin_shufflevector( \ (__v4s##T2)Vec128, \ (__v4s##T2)Vec128, \ 0, 1, -1, -1) \ Operator \ __builtin_shufflevector( \ (__v4s##T2)Vec128, \ (__v4s##T2)Vec128, \ 2, 3, -1, -1)); \ Vec128 = (__m128##T1)(__builtin_shufflevector( \ (__v4s##T2)Vec128, \ (__v4s##T2)Vec128, \ 0, -1, -1, -1) \ Operator \ __builtin_shufflevector( \ (__v4s##T2)Vec128, \ (__v4s##T2)Vec128, \ 1, -1, -1, -1)); \ return Vec128[0]; \ }) static __inline__ int __DEFAULT_FN_ATTRS _mm512_reduce_add_epi32(__m512i __W) { _mm512_reduce_operator_32bit(__W, +, i, i); } static __inline__ int __DEFAULT_FN_ATTRS _mm512_reduce_mul_epi32(__m512i __W) { _mm512_reduce_operator_32bit(__W, *, i, i); } static __inline__ int __DEFAULT_FN_ATTRS _mm512_reduce_and_epi32(__m512i __W) { _mm512_reduce_operator_32bit(__W, &, i, i); } static __inline__ int __DEFAULT_FN_ATTRS _mm512_reduce_or_epi32(__m512i __W) { _mm512_reduce_operator_32bit(__W, |, i, i); } static __inline__ float __DEFAULT_FN_ATTRS _mm512_reduce_add_ps(__m512 __W) { _mm512_reduce_operator_32bit(__W, +, f, ); } static __inline__ float __DEFAULT_FN_ATTRS _mm512_reduce_mul_ps(__m512 __W) { _mm512_reduce_operator_32bit(__W, *, f, ); } // Vec512 - Vector with size 512. // Vec512Neutral - All vector elements set to the identity element. // Identity element: {+,0},{*,1},{&,0xFFFFFFFF},{|,0} // Operator - Can be one of following: +,*,&,| // Mask - Intrinsic Mask // T2 - Can get 'i' for int and 'f' for float. // T1 - Can get 'i' for int and 'd' for double. // T3 - Can be Ps for packed single or d for d-word. #define _mm512_mask_reduce_operator_32bit(Vec512, Vec512Neutral, Operator, \ Mask, T2, T1, T3) \ __extension__({ \ Vec512 = (__m512##T1)__builtin_ia32_select##T3##_512( \ (__mmask16)Mask, \ (__v16s##T2)Vec512, \ (__v16s##T2)Vec512Neutral); \ _mm512_reduce_operator_32bit(Vec512, Operator, T2, T1); \ }) static __inline__ int __DEFAULT_FN_ATTRS _mm512_mask_reduce_add_epi32( __mmask16 __M, __m512i __W) { _mm512_mask_reduce_operator_32bit(__W, _mm512_set1_epi32(0), +, __M, i, i, d); } static __inline__ int __DEFAULT_FN_ATTRS _mm512_mask_reduce_mul_epi32( __mmask16 __M, __m512i __W) { _mm512_mask_reduce_operator_32bit(__W, _mm512_set1_epi32(1), *, __M, i, i, d); } static __inline__ int __DEFAULT_FN_ATTRS _mm512_mask_reduce_and_epi32( __mmask16 __M, __m512i __W) { _mm512_mask_reduce_operator_32bit(__W, _mm512_set1_epi32(0xFFFFFFFF), &, __M, i, i, d); } static __inline__ int __DEFAULT_FN_ATTRS _mm512_mask_reduce_or_epi32(__mmask16 __M, __m512i __W) { _mm512_mask_reduce_operator_32bit(__W, _mm512_set1_epi32(0), |, __M, i, i, d); } static __inline__ float __DEFAULT_FN_ATTRS _mm512_mask_reduce_add_ps(__mmask16 __M, __m512 __W) { _mm512_mask_reduce_operator_32bit(__W, _mm512_set1_ps(0), +, __M, f, , ps); } static __inline__ float __DEFAULT_FN_ATTRS _mm512_mask_reduce_mul_ps(__mmask16 __M, __m512 __W) { _mm512_mask_reduce_operator_32bit(__W, _mm512_set1_ps(1), *, __M, f, , ps); } // Used bisection method. At each step, we partition the vector with previous // step in half, and the operation is performed on its two halves. // This takes log2(n) steps where n is the number of elements in the vector. // This macro uses only intrinsics from the AVX512F feature. // Vec512 - Vector with size of 512. // IntrinName - Can be one of following: {max|min}_{epi64|epu64|pd} for example: // __mm512_max_epi64 // T1 - Can get 'i' for int and 'd' for double.[__m512{i|d}] // T2 - Can get 'i' for int and 'f' for float. [__v8d{i|f}] #define _mm512_reduce_maxMin_64bit(Vec512, IntrinName, T1, T2) __extension__({ \ Vec512 = _mm512_##IntrinName( \ (__m512##T1)__builtin_shufflevector( \ (__v8d##T2)Vec512, \ (__v8d##T2)Vec512, \ 0, 1, 2, 3, -1, -1, -1, -1), \ (__m512##T1)__builtin_shufflevector( \ (__v8d##T2)Vec512, \ (__v8d##T2)Vec512, \ 4, 5, 6, 7, -1, -1, -1, -1)); \ Vec512 = _mm512_##IntrinName( \ (__m512##T1)__builtin_shufflevector( \ (__v8d##T2)Vec512, \ (__v8d##T2)Vec512, \ 0, 1, -1, -1, -1, -1, -1, -1),\ (__m512##T1)__builtin_shufflevector( \ (__v8d##T2)Vec512, \ (__v8d##T2)Vec512, \ 2, 3, -1, -1, -1, -1, -1, \ -1)); \ Vec512 = _mm512_##IntrinName( \ (__m512##T1)__builtin_shufflevector( \ (__v8d##T2)Vec512, \ (__v8d##T2)Vec512, \ 0, -1, -1, -1, -1, -1, -1, -1),\ (__m512##T1)__builtin_shufflevector( \ (__v8d##T2)Vec512, \ (__v8d##T2)Vec512, \ 1, -1, -1, -1, -1, -1, -1, -1))\ ; \ return Vec512[0]; \ }) static __inline__ long long __DEFAULT_FN_ATTRS _mm512_reduce_max_epi64(__m512i __V) { _mm512_reduce_maxMin_64bit(__V, max_epi64, i, i); } static __inline__ unsigned long long __DEFAULT_FN_ATTRS _mm512_reduce_max_epu64(__m512i __V) { _mm512_reduce_maxMin_64bit(__V, max_epu64, i, i); } static __inline__ double __DEFAULT_FN_ATTRS _mm512_reduce_max_pd(__m512d __V) { _mm512_reduce_maxMin_64bit(__V, max_pd, d, f); } static __inline__ long long __DEFAULT_FN_ATTRS _mm512_reduce_min_epi64 (__m512i __V) { _mm512_reduce_maxMin_64bit(__V, min_epi64, i, i); } static __inline__ unsigned long long __DEFAULT_FN_ATTRS _mm512_reduce_min_epu64(__m512i __V) { _mm512_reduce_maxMin_64bit(__V, min_epu64, i, i); } static __inline__ double __DEFAULT_FN_ATTRS _mm512_reduce_min_pd(__m512d __V) { _mm512_reduce_maxMin_64bit(__V, min_pd, d, f); } // Vec512 - Vector with size 512. // Vec512Neutral - A 512 length vector with elements set to the identity element // Identity element: {max_epi,0x8000000000000000} // {max_epu,0x0000000000000000} // {max_pd, 0xFFF0000000000000} // {min_epi,0x7FFFFFFFFFFFFFFF} // {min_epu,0xFFFFFFFFFFFFFFFF} // {min_pd, 0x7FF0000000000000} // // IntrinName - Can be one of following: {max|min}_{epi64|epu64|pd} for example: // __mm512_max_epi64 // T1 - Can get 'i' for int and 'd' for double.[__m512{i|d}] // T2 - Can get 'i' for int and 'f' for float. [__v8d{i|f}] // T3 - Can get 'q' q word and 'pd' for packed double. // [__builtin_ia32_select{q|pd}_512] // Mask - Intrinsic Mask #define _mm512_mask_reduce_maxMin_64bit(Vec512, Vec512Neutral, IntrinName, T1, \ T2, T3, Mask) \ __extension__({ \ Vec512 = (__m512##T1)__builtin_ia32_select##T3##_512( \ (__mmask8)Mask, \ (__v8d##T2)Vec512, \ (__v8d##T2)Vec512Neutral); \ _mm512_reduce_maxMin_64bit(Vec512, IntrinName, T1, T2); \ }) static __inline__ long long __DEFAULT_FN_ATTRS _mm512_mask_reduce_max_epi64(__mmask8 __M, __m512i __V) { _mm512_mask_reduce_maxMin_64bit(__V, _mm512_set1_epi64(0x8000000000000000), max_epi64, i, i, q, __M); } static __inline__ unsigned long long __DEFAULT_FN_ATTRS _mm512_mask_reduce_max_epu64(__mmask8 __M, __m512i __V) { _mm512_mask_reduce_maxMin_64bit(__V, _mm512_set1_epi64(0x0000000000000000), max_epu64, i, i, q, __M); } static __inline__ double __DEFAULT_FN_ATTRS _mm512_mask_reduce_max_pd(__mmask8 __M, __m512d __V) { _mm512_mask_reduce_maxMin_64bit(__V, -_mm512_set1_pd(__builtin_inf()), max_pd, d, f, pd, __M); } static __inline__ long long __DEFAULT_FN_ATTRS _mm512_mask_reduce_min_epi64(__mmask8 __M, __m512i __V) { _mm512_mask_reduce_maxMin_64bit(__V, _mm512_set1_epi64(0x7FFFFFFFFFFFFFFF), min_epi64, i, i, q, __M); } static __inline__ unsigned long long __DEFAULT_FN_ATTRS _mm512_mask_reduce_min_epu64(__mmask8 __M, __m512i __V) { _mm512_mask_reduce_maxMin_64bit(__V, _mm512_set1_epi64(0xFFFFFFFFFFFFFFFF), min_epu64, i, i, q, __M); } static __inline__ double __DEFAULT_FN_ATTRS _mm512_mask_reduce_min_pd(__mmask8 __M, __m512d __V) { _mm512_mask_reduce_maxMin_64bit(__V, _mm512_set1_pd(__builtin_inf()), min_pd, d, f, pd, __M); } // Vec512 - Vector with size 512. // IntrinName - Can be one of following: {max|min}_{epi32|epu32|ps} for example: // __mm512_max_epi32 // T1 - Can get 'i' for int and ' ' .[__m512{i|}] // T2 - Can get 'i' for int and 'f' for float.[__v16s{i|f}] #define _mm512_reduce_maxMin_32bit(Vec512, IntrinName, T1, T2) __extension__({ \ Vec512 = _mm512_##IntrinName( \ (__m512##T1)__builtin_shufflevector( \ (__v16s##T2)Vec512, \ (__v16s##T2)Vec512, \ 0, 1, 2, 3, 4, 5, 6, 7, \ -1, -1, -1, -1, -1, -1, -1, -1), \ (__m512##T1)__builtin_shufflevector( \ (__v16s##T2)Vec512, \ (__v16s##T2)Vec512, \ 8, 9, 10, 11, 12, 13, 14, 15, \ -1, -1, -1, -1, -1, -1, -1, -1)); \ Vec512 = _mm512_##IntrinName( \ (__m512##T1)__builtin_shufflevector( \ (__v16s##T2)Vec512, \ (__v16s##T2)Vec512, \ 0, 1, 2, 3, -1, -1, -1, -1, \ -1, -1, -1, -1, -1, -1, -1, -1), \ (__m512##T1)__builtin_shufflevector( \ (__v16s##T2)Vec512, \ (__v16s##T2)Vec512, \ 4, 5, 6, 7, -1, -1, -1, -1, \ -1, -1, -1, -1, -1, -1, -1, -1)); \ Vec512 = _mm512_##IntrinName( \ (__m512##T1)__builtin_shufflevector( \ (__v16s##T2)Vec512, \ (__v16s##T2)Vec512, \ 0, 1, -1, -1, -1, -1, -1, -1, \ -1, -1, -1, -1, -1, -1, -1, -1), \ (__m512##T1)__builtin_shufflevector( \ (__v16s##T2)Vec512, \ (__v16s##T2)Vec512, \ 2, 3, -1, -1, -1, -1, -1, -1, \ -1, -1, -1, -1, -1, -1, -1, -1)); \ Vec512 = _mm512_##IntrinName( \ (__m512##T1)__builtin_shufflevector( \ (__v16s##T2)Vec512, \ (__v16s##T2)Vec512, \ 0, -1, -1, -1, -1, -1, -1, -1, \ -1, -1, -1, -1, -1, -1, -1, -1), \ (__m512##T1)__builtin_shufflevector( \ (__v16s##T2)Vec512, \ (__v16s##T2)Vec512, \ 1, -1, -1, -1, -1, -1, -1, -1, \ -1, -1, -1, -1, -1, -1, -1, -1)); \ return Vec512[0]; \ }) static __inline__ int __DEFAULT_FN_ATTRS _mm512_reduce_max_epi32(__m512i a) { _mm512_reduce_maxMin_32bit(a, max_epi32, i, i); } static __inline__ unsigned int __DEFAULT_FN_ATTRS _mm512_reduce_max_epu32(__m512i a) { _mm512_reduce_maxMin_32bit(a, max_epu32, i, i); } static __inline__ float __DEFAULT_FN_ATTRS _mm512_reduce_max_ps(__m512 a) { _mm512_reduce_maxMin_32bit(a, max_ps, , f); } static __inline__ int __DEFAULT_FN_ATTRS _mm512_reduce_min_epi32(__m512i a) { _mm512_reduce_maxMin_32bit(a, min_epi32, i, i); } static __inline__ unsigned int __DEFAULT_FN_ATTRS _mm512_reduce_min_epu32(__m512i a) { _mm512_reduce_maxMin_32bit(a, min_epu32, i, i); } static __inline__ float __DEFAULT_FN_ATTRS _mm512_reduce_min_ps(__m512 a) { _mm512_reduce_maxMin_32bit(a, min_ps, , f); } // Vec512 - Vector with size 512. // Vec512Neutral - A 512 length vector with elements set to the identity element // Identity element: {max_epi,0x80000000} // {max_epu,0x00000000} // {max_ps, 0xFF800000} // {min_epi,0x7FFFFFFF} // {min_epu,0xFFFFFFFF} // {min_ps, 0x7F800000} // // IntrinName - Can be one of following: {max|min}_{epi32|epu32|ps} for example: // __mm512_max_epi32 // T1 - Can get 'i' for int and ' ' .[__m512{i|}] // T2 - Can get 'i' for int and 'f' for float.[__v16s{i|f}] // T3 - Can get 'q' q word and 'pd' for packed double. // [__builtin_ia32_select{q|pd}_512] // Mask - Intrinsic Mask #define _mm512_mask_reduce_maxMin_32bit(Vec512, Vec512Neutral, IntrinName, T1, \ T2, T3, Mask) \ __extension__({ \ Vec512 = (__m512##T1)__builtin_ia32_select##T3##_512( \ (__mmask16)Mask, \ (__v16s##T2)Vec512, \ (__v16s##T2)Vec512Neutral); \ _mm512_reduce_maxMin_32bit(Vec512, IntrinName, T1, T2); \ }) static __inline__ int __DEFAULT_FN_ATTRS _mm512_mask_reduce_max_epi32(__mmask16 __M, __m512i __V) { _mm512_mask_reduce_maxMin_32bit(__V, _mm512_set1_epi32(0x80000000), max_epi32, i, i, d, __M); } static __inline__ unsigned int __DEFAULT_FN_ATTRS _mm512_mask_reduce_max_epu32(__mmask16 __M, __m512i __V) { _mm512_mask_reduce_maxMin_32bit(__V, _mm512_set1_epi32(0x00000000), max_epu32, i, i, d, __M); } static __inline__ float __DEFAULT_FN_ATTRS _mm512_mask_reduce_max_ps(__mmask16 __M, __m512 __V) { _mm512_mask_reduce_maxMin_32bit(__V,-_mm512_set1_ps(__builtin_inff()), max_ps, , f, ps, __M); } static __inline__ int __DEFAULT_FN_ATTRS _mm512_mask_reduce_min_epi32(__mmask16 __M, __m512i __V) { _mm512_mask_reduce_maxMin_32bit(__V, _mm512_set1_epi32(0x7FFFFFFF), min_epi32, i, i, d, __M); } static __inline__ unsigned int __DEFAULT_FN_ATTRS _mm512_mask_reduce_min_epu32(__mmask16 __M, __m512i __V) { _mm512_mask_reduce_maxMin_32bit(__V, _mm512_set1_epi32(0xFFFFFFFF), min_epu32, i, i, d, __M); } static __inline__ float __DEFAULT_FN_ATTRS _mm512_mask_reduce_min_ps(__mmask16 __M, __m512 __V) { _mm512_mask_reduce_maxMin_32bit(__V, _mm512_set1_ps(__builtin_inff()), min_ps, , f, ps, __M); } #undef __DEFAULT_FN_ATTRS #endif // __AVX512FINTRIN_H # 10234 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512fintrin.h" 3 # 143 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 2 3 #endif # 144 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || defined(__AVX512VL__) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 146 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512vlintrin.h" 1 3 /*===---- avx512vlintrin.h - AVX512VL intrinsics ---------------------------=== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __IMMINTRIN_H #error "Never use directly; include instead." #endif # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512vlintrin.h" 3 #ifndef __AVX512VLINTRIN_H #define __AVX512VLINTRIN_H #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("avx512vl"))) /* Doesn't require avx512vl, used in avx512dqintrin.h */ static __inline __m128i __attribute__((__always_inline__, __nodebug__, __target__("avx512f"))) _mm_setzero_di(void) { return (__m128i)(__v2di){ 0LL, 0LL}; } /* Integer compare */ #define _mm_cmpeq_epi32_mask(A, B) \ _mm_cmp_epi32_mask((A), (B), _MM_CMPINT_EQ) #define _mm_mask_cmpeq_epi32_mask(k, A, B) \ _mm_mask_cmp_epi32_mask((k), (A), (B), _MM_CMPINT_EQ) #define _mm_cmpge_epi32_mask(A, B) \ _mm_cmp_epi32_mask((A), (B), _MM_CMPINT_GE) #define _mm_mask_cmpge_epi32_mask(k, A, B) \ _mm_mask_cmp_epi32_mask((k), (A), (B), _MM_CMPINT_GE) #define _mm_cmpgt_epi32_mask(A, B) \ _mm_cmp_epi32_mask((A), (B), _MM_CMPINT_GT) #define _mm_mask_cmpgt_epi32_mask(k, A, B) \ _mm_mask_cmp_epi32_mask((k), (A), (B), _MM_CMPINT_GT) #define _mm_cmple_epi32_mask(A, B) \ _mm_cmp_epi32_mask((A), (B), _MM_CMPINT_LE) #define _mm_mask_cmple_epi32_mask(k, A, B) \ _mm_mask_cmp_epi32_mask((k), (A), (B), _MM_CMPINT_LE) #define _mm_cmplt_epi32_mask(A, B) \ _mm_cmp_epi32_mask((A), (B), _MM_CMPINT_LT) #define _mm_mask_cmplt_epi32_mask(k, A, B) \ _mm_mask_cmp_epi32_mask((k), (A), (B), _MM_CMPINT_LT) #define _mm_cmpneq_epi32_mask(A, B) \ _mm_cmp_epi32_mask((A), (B), _MM_CMPINT_NE) #define _mm_mask_cmpneq_epi32_mask(k, A, B) \ _mm_mask_cmp_epi32_mask((k), (A), (B), _MM_CMPINT_NE) #define _mm256_cmpeq_epi32_mask(A, B) \ _mm256_cmp_epi32_mask((A), (B), _MM_CMPINT_EQ) #define _mm256_mask_cmpeq_epi32_mask(k, A, B) \ _mm256_mask_cmp_epi32_mask((k), (A), (B), _MM_CMPINT_EQ) #define _mm256_cmpge_epi32_mask(A, B) \ _mm256_cmp_epi32_mask((A), (B), _MM_CMPINT_GE) #define _mm256_mask_cmpge_epi32_mask(k, A, B) \ _mm256_mask_cmp_epi32_mask((k), (A), (B), _MM_CMPINT_GE) #define _mm256_cmpgt_epi32_mask(A, B) \ _mm256_cmp_epi32_mask((A), (B), _MM_CMPINT_GT) #define _mm256_mask_cmpgt_epi32_mask(k, A, B) \ _mm256_mask_cmp_epi32_mask((k), (A), (B), _MM_CMPINT_GT) #define _mm256_cmple_epi32_mask(A, B) \ _mm256_cmp_epi32_mask((A), (B), _MM_CMPINT_LE) #define _mm256_mask_cmple_epi32_mask(k, A, B) \ _mm256_mask_cmp_epi32_mask((k), (A), (B), _MM_CMPINT_LE) #define _mm256_cmplt_epi32_mask(A, B) \ _mm256_cmp_epi32_mask((A), (B), _MM_CMPINT_LT) #define _mm256_mask_cmplt_epi32_mask(k, A, B) \ _mm256_mask_cmp_epi32_mask((k), (A), (B), _MM_CMPINT_LT) #define _mm256_cmpneq_epi32_mask(A, B) \ _mm256_cmp_epi32_mask((A), (B), _MM_CMPINT_NE) #define _mm256_mask_cmpneq_epi32_mask(k, A, B) \ _mm256_mask_cmp_epi32_mask((k), (A), (B), _MM_CMPINT_NE) #define _mm_cmpeq_epu32_mask(A, B) \ _mm_cmp_epu32_mask((A), (B), _MM_CMPINT_EQ) #define _mm_mask_cmpeq_epu32_mask(k, A, B) \ _mm_mask_cmp_epu32_mask((k), (A), (B), _MM_CMPINT_EQ) #define _mm_cmpge_epu32_mask(A, B) \ _mm_cmp_epu32_mask((A), (B), _MM_CMPINT_GE) #define _mm_mask_cmpge_epu32_mask(k, A, B) \ _mm_mask_cmp_epu32_mask((k), (A), (B), _MM_CMPINT_GE) #define _mm_cmpgt_epu32_mask(A, B) \ _mm_cmp_epu32_mask((A), (B), _MM_CMPINT_GT) #define _mm_mask_cmpgt_epu32_mask(k, A, B) \ _mm_mask_cmp_epu32_mask((k), (A), (B), _MM_CMPINT_GT) #define _mm_cmple_epu32_mask(A, B) \ _mm_cmp_epu32_mask((A), (B), _MM_CMPINT_LE) #define _mm_mask_cmple_epu32_mask(k, A, B) \ _mm_mask_cmp_epu32_mask((k), (A), (B), _MM_CMPINT_LE) #define _mm_cmplt_epu32_mask(A, B) \ _mm_cmp_epu32_mask((A), (B), _MM_CMPINT_LT) #define _mm_mask_cmplt_epu32_mask(k, A, B) \ _mm_mask_cmp_epu32_mask((k), (A), (B), _MM_CMPINT_LT) #define _mm_cmpneq_epu32_mask(A, B) \ _mm_cmp_epu32_mask((A), (B), _MM_CMPINT_NE) #define _mm_mask_cmpneq_epu32_mask(k, A, B) \ _mm_mask_cmp_epu32_mask((k), (A), (B), _MM_CMPINT_NE) #define _mm256_cmpeq_epu32_mask(A, B) \ _mm256_cmp_epu32_mask((A), (B), _MM_CMPINT_EQ) #define _mm256_mask_cmpeq_epu32_mask(k, A, B) \ _mm256_mask_cmp_epu32_mask((k), (A), (B), _MM_CMPINT_EQ) #define _mm256_cmpge_epu32_mask(A, B) \ _mm256_cmp_epu32_mask((A), (B), _MM_CMPINT_GE) #define _mm256_mask_cmpge_epu32_mask(k, A, B) \ _mm256_mask_cmp_epu32_mask((k), (A), (B), _MM_CMPINT_GE) #define _mm256_cmpgt_epu32_mask(A, B) \ _mm256_cmp_epu32_mask((A), (B), _MM_CMPINT_GT) #define _mm256_mask_cmpgt_epu32_mask(k, A, B) \ _mm256_mask_cmp_epu32_mask((k), (A), (B), _MM_CMPINT_GT) #define _mm256_cmple_epu32_mask(A, B) \ _mm256_cmp_epu32_mask((A), (B), _MM_CMPINT_LE) #define _mm256_mask_cmple_epu32_mask(k, A, B) \ _mm256_mask_cmp_epu32_mask((k), (A), (B), _MM_CMPINT_LE) #define _mm256_cmplt_epu32_mask(A, B) \ _mm256_cmp_epu32_mask((A), (B), _MM_CMPINT_LT) #define _mm256_mask_cmplt_epu32_mask(k, A, B) \ _mm256_mask_cmp_epu32_mask((k), (A), (B), _MM_CMPINT_LT) #define _mm256_cmpneq_epu32_mask(A, B) \ _mm256_cmp_epu32_mask((A), (B), _MM_CMPINT_NE) #define _mm256_mask_cmpneq_epu32_mask(k, A, B) \ _mm256_mask_cmp_epu32_mask((k), (A), (B), _MM_CMPINT_NE) #define _mm_cmpeq_epi64_mask(A, B) \ _mm_cmp_epi64_mask((A), (B), _MM_CMPINT_EQ) #define _mm_mask_cmpeq_epi64_mask(k, A, B) \ _mm_mask_cmp_epi64_mask((k), (A), (B), _MM_CMPINT_EQ) #define _mm_cmpge_epi64_mask(A, B) \ _mm_cmp_epi64_mask((A), (B), _MM_CMPINT_GE) #define _mm_mask_cmpge_epi64_mask(k, A, B) \ _mm_mask_cmp_epi64_mask((k), (A), (B), _MM_CMPINT_GE) #define _mm_cmpgt_epi64_mask(A, B) \ _mm_cmp_epi64_mask((A), (B), _MM_CMPINT_GT) #define _mm_mask_cmpgt_epi64_mask(k, A, B) \ _mm_mask_cmp_epi64_mask((k), (A), (B), _MM_CMPINT_GT) #define _mm_cmple_epi64_mask(A, B) \ _mm_cmp_epi64_mask((A), (B), _MM_CMPINT_LE) #define _mm_mask_cmple_epi64_mask(k, A, B) \ _mm_mask_cmp_epi64_mask((k), (A), (B), _MM_CMPINT_LE) #define _mm_cmplt_epi64_mask(A, B) \ _mm_cmp_epi64_mask((A), (B), _MM_CMPINT_LT) #define _mm_mask_cmplt_epi64_mask(k, A, B) \ _mm_mask_cmp_epi64_mask((k), (A), (B), _MM_CMPINT_LT) #define _mm_cmpneq_epi64_mask(A, B) \ _mm_cmp_epi64_mask((A), (B), _MM_CMPINT_NE) #define _mm_mask_cmpneq_epi64_mask(k, A, B) \ _mm_mask_cmp_epi64_mask((k), (A), (B), _MM_CMPINT_NE) #define _mm256_cmpeq_epi64_mask(A, B) \ _mm256_cmp_epi64_mask((A), (B), _MM_CMPINT_EQ) #define _mm256_mask_cmpeq_epi64_mask(k, A, B) \ _mm256_mask_cmp_epi64_mask((k), (A), (B), _MM_CMPINT_EQ) #define _mm256_cmpge_epi64_mask(A, B) \ _mm256_cmp_epi64_mask((A), (B), _MM_CMPINT_GE) #define _mm256_mask_cmpge_epi64_mask(k, A, B) \ _mm256_mask_cmp_epi64_mask((k), (A), (B), _MM_CMPINT_GE) #define _mm256_cmpgt_epi64_mask(A, B) \ _mm256_cmp_epi64_mask((A), (B), _MM_CMPINT_GT) #define _mm256_mask_cmpgt_epi64_mask(k, A, B) \ _mm256_mask_cmp_epi64_mask((k), (A), (B), _MM_CMPINT_GT) #define _mm256_cmple_epi64_mask(A, B) \ _mm256_cmp_epi64_mask((A), (B), _MM_CMPINT_LE) #define _mm256_mask_cmple_epi64_mask(k, A, B) \ _mm256_mask_cmp_epi64_mask((k), (A), (B), _MM_CMPINT_LE) #define _mm256_cmplt_epi64_mask(A, B) \ _mm256_cmp_epi64_mask((A), (B), _MM_CMPINT_LT) #define _mm256_mask_cmplt_epi64_mask(k, A, B) \ _mm256_mask_cmp_epi64_mask((k), (A), (B), _MM_CMPINT_LT) #define _mm256_cmpneq_epi64_mask(A, B) \ _mm256_cmp_epi64_mask((A), (B), _MM_CMPINT_NE) #define _mm256_mask_cmpneq_epi64_mask(k, A, B) \ _mm256_mask_cmp_epi64_mask((k), (A), (B), _MM_CMPINT_NE) #define _mm_cmpeq_epu64_mask(A, B) \ _mm_cmp_epu64_mask((A), (B), _MM_CMPINT_EQ) #define _mm_mask_cmpeq_epu64_mask(k, A, B) \ _mm_mask_cmp_epu64_mask((k), (A), (B), _MM_CMPINT_EQ) #define _mm_cmpge_epu64_mask(A, B) \ _mm_cmp_epu64_mask((A), (B), _MM_CMPINT_GE) #define _mm_mask_cmpge_epu64_mask(k, A, B) \ _mm_mask_cmp_epu64_mask((k), (A), (B), _MM_CMPINT_GE) #define _mm_cmpgt_epu64_mask(A, B) \ _mm_cmp_epu64_mask((A), (B), _MM_CMPINT_GT) #define _mm_mask_cmpgt_epu64_mask(k, A, B) \ _mm_mask_cmp_epu64_mask((k), (A), (B), _MM_CMPINT_GT) #define _mm_cmple_epu64_mask(A, B) \ _mm_cmp_epu64_mask((A), (B), _MM_CMPINT_LE) #define _mm_mask_cmple_epu64_mask(k, A, B) \ _mm_mask_cmp_epu64_mask((k), (A), (B), _MM_CMPINT_LE) #define _mm_cmplt_epu64_mask(A, B) \ _mm_cmp_epu64_mask((A), (B), _MM_CMPINT_LT) #define _mm_mask_cmplt_epu64_mask(k, A, B) \ _mm_mask_cmp_epu64_mask((k), (A), (B), _MM_CMPINT_LT) #define _mm_cmpneq_epu64_mask(A, B) \ _mm_cmp_epu64_mask((A), (B), _MM_CMPINT_NE) #define _mm_mask_cmpneq_epu64_mask(k, A, B) \ _mm_mask_cmp_epu64_mask((k), (A), (B), _MM_CMPINT_NE) #define _mm256_cmpeq_epu64_mask(A, B) \ _mm256_cmp_epu64_mask((A), (B), _MM_CMPINT_EQ) #define _mm256_mask_cmpeq_epu64_mask(k, A, B) \ _mm256_mask_cmp_epu64_mask((k), (A), (B), _MM_CMPINT_EQ) #define _mm256_cmpge_epu64_mask(A, B) \ _mm256_cmp_epu64_mask((A), (B), _MM_CMPINT_GE) #define _mm256_mask_cmpge_epu64_mask(k, A, B) \ _mm256_mask_cmp_epu64_mask((k), (A), (B), _MM_CMPINT_GE) #define _mm256_cmpgt_epu64_mask(A, B) \ _mm256_cmp_epu64_mask((A), (B), _MM_CMPINT_GT) #define _mm256_mask_cmpgt_epu64_mask(k, A, B) \ _mm256_mask_cmp_epu64_mask((k), (A), (B), _MM_CMPINT_GT) #define _mm256_cmple_epu64_mask(A, B) \ _mm256_cmp_epu64_mask((A), (B), _MM_CMPINT_LE) #define _mm256_mask_cmple_epu64_mask(k, A, B) \ _mm256_mask_cmp_epu64_mask((k), (A), (B), _MM_CMPINT_LE) #define _mm256_cmplt_epu64_mask(A, B) \ _mm256_cmp_epu64_mask((A), (B), _MM_CMPINT_LT) #define _mm256_mask_cmplt_epu64_mask(k, A, B) \ _mm256_mask_cmp_epu64_mask((k), (A), (B), _MM_CMPINT_LT) #define _mm256_cmpneq_epu64_mask(A, B) \ _mm256_cmp_epu64_mask((A), (B), _MM_CMPINT_NE) #define _mm256_mask_cmpneq_epu64_mask(k, A, B) \ _mm256_mask_cmp_epu64_mask((k), (A), (B), _MM_CMPINT_NE) static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_add_epi32(__m256i __W, __mmask8 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U, (__v8si)_mm256_add_epi32(__A, __B), (__v8si)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_add_epi32(__mmask8 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U, (__v8si)_mm256_add_epi32(__A, __B), (__v8si)_mm256_setzero_si256()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_add_epi64(__m256i __W, __mmask8 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U, (__v4di)_mm256_add_epi64(__A, __B), (__v4di)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_add_epi64(__mmask8 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U, (__v4di)_mm256_add_epi64(__A, __B), (__v4di)_mm256_setzero_si256()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_sub_epi32(__m256i __W, __mmask8 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U, (__v8si)_mm256_sub_epi32(__A, __B), (__v8si)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_sub_epi32(__mmask8 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U, (__v8si)_mm256_sub_epi32(__A, __B), (__v8si)_mm256_setzero_si256()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_sub_epi64(__m256i __W, __mmask8 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U, (__v4di)_mm256_sub_epi64(__A, __B), (__v4di)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_sub_epi64(__mmask8 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U, (__v4di)_mm256_sub_epi64(__A, __B), (__v4di)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_add_epi32(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U, (__v4si)_mm_add_epi32(__A, __B), (__v4si)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_add_epi32(__mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U, (__v4si)_mm_add_epi32(__A, __B), (__v4si)_mm_setzero_si128()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_add_epi64(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U, (__v2di)_mm_add_epi64(__A, __B), (__v2di)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_add_epi64(__mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U, (__v2di)_mm_add_epi64(__A, __B), (__v2di)_mm_setzero_si128()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_sub_epi32(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U, (__v4si)_mm_sub_epi32(__A, __B), (__v4si)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_sub_epi32(__mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U, (__v4si)_mm_sub_epi32(__A, __B), (__v4si)_mm_setzero_si128()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_sub_epi64(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U, (__v2di)_mm_sub_epi64(__A, __B), (__v2di)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_sub_epi64(__mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U, (__v2di)_mm_sub_epi64(__A, __B), (__v2di)_mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_mul_epi32(__m256i __W, __mmask8 __M, __m256i __X, __m256i __Y) { return (__m256i)__builtin_ia32_selectq_256((__mmask8)__M, (__v4di)_mm256_mul_epi32(__X, __Y), (__v4di)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_mul_epi32(__mmask8 __M, __m256i __X, __m256i __Y) { return (__m256i)__builtin_ia32_selectq_256((__mmask8)__M, (__v4di)_mm256_mul_epi32(__X, __Y), (__v4di)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_mul_epi32(__m128i __W, __mmask8 __M, __m128i __X, __m128i __Y) { return (__m128i)__builtin_ia32_selectq_128((__mmask8)__M, (__v2di)_mm_mul_epi32(__X, __Y), (__v2di)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_mul_epi32(__mmask8 __M, __m128i __X, __m128i __Y) { return (__m128i)__builtin_ia32_selectq_128((__mmask8)__M, (__v2di)_mm_mul_epi32(__X, __Y), (__v2di)_mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_mul_epu32(__m256i __W, __mmask8 __M, __m256i __X, __m256i __Y) { return (__m256i)__builtin_ia32_selectq_256((__mmask8)__M, (__v4di)_mm256_mul_epu32(__X, __Y), (__v4di)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_mul_epu32(__mmask8 __M, __m256i __X, __m256i __Y) { return (__m256i)__builtin_ia32_selectq_256((__mmask8)__M, (__v4di)_mm256_mul_epu32(__X, __Y), (__v4di)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_mul_epu32(__m128i __W, __mmask8 __M, __m128i __X, __m128i __Y) { return (__m128i)__builtin_ia32_selectq_128((__mmask8)__M, (__v2di)_mm_mul_epu32(__X, __Y), (__v2di)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_mul_epu32(__mmask8 __M, __m128i __X, __m128i __Y) { return (__m128i)__builtin_ia32_selectq_128((__mmask8)__M, (__v2di)_mm_mul_epu32(__X, __Y), (__v2di)_mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_mullo_epi32(__mmask8 __M, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__M, (__v8si)_mm256_mullo_epi32(__A, __B), (__v8si)_mm256_setzero_si256()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_mullo_epi32(__m256i __W, __mmask8 __M, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__M, (__v8si)_mm256_mullo_epi32(__A, __B), (__v8si)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_mullo_epi32(__mmask8 __M, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__M, (__v4si)_mm_mullo_epi32(__A, __B), (__v4si)_mm_setzero_si128()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_mullo_epi32(__m128i __W, __mmask8 __M, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__M, (__v4si)_mm_mullo_epi32(__A, __B), (__v4si)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_and_epi32(__m256i __W, __mmask8 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U, (__v8si)_mm256_and_si256(__A, __B), (__v8si)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_and_epi32(__mmask8 __U, __m256i __A, __m256i __B) { return (__m256i)_mm256_mask_and_epi32(_mm256_setzero_si256(), __U, __A, __B); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_and_epi32(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U, (__v4si)_mm_and_si128(__A, __B), (__v4si)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_and_epi32(__mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)_mm_mask_and_epi32(_mm_setzero_si128(), __U, __A, __B); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_andnot_epi32(__m256i __W, __mmask8 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U, (__v8si)_mm256_andnot_si256(__A, __B), (__v8si)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_andnot_epi32(__mmask8 __U, __m256i __A, __m256i __B) { return (__m256i)_mm256_mask_andnot_epi32(_mm256_setzero_si256(), __U, __A, __B); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_andnot_epi32(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U, (__v4si)_mm_andnot_si128(__A, __B), (__v4si)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_andnot_epi32 (__mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)_mm_mask_andnot_epi32(_mm_setzero_si128(), __U, __A, __B); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_or_epi32 (__m256i __W, __mmask8 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U, (__v8si)_mm256_or_si256(__A, __B), (__v8si)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_or_epi32(__mmask8 __U, __m256i __A, __m256i __B) { return (__m256i)_mm256_mask_or_epi32(_mm256_setzero_si256(), __U, __A, __B); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_or_epi32(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U, (__v4si)_mm_or_si128(__A, __B), (__v4si)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_or_epi32(__mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)_mm_mask_or_epi32(_mm_setzero_si128(), __U, __A, __B); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_xor_epi32(__m256i __W, __mmask8 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U, (__v8si)_mm256_xor_si256(__A, __B), (__v8si)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_xor_epi32(__mmask8 __U, __m256i __A, __m256i __B) { return (__m256i)_mm256_mask_xor_epi32(_mm256_setzero_si256(), __U, __A, __B); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_xor_epi32(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U, (__v4si)_mm_xor_si128(__A, __B), (__v4si)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_xor_epi32(__mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)_mm_mask_xor_epi32(_mm_setzero_si128(), __U, __A, __B); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_and_epi64(__m256i __W, __mmask8 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U, (__v4di)_mm256_and_si256(__A, __B), (__v4di)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_and_epi64(__mmask8 __U, __m256i __A, __m256i __B) { return (__m256i)_mm256_mask_and_epi64(_mm256_setzero_si256(), __U, __A, __B); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_and_epi64(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U, (__v2di)_mm_and_si128(__A, __B), (__v2di)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_and_epi64(__mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)_mm_mask_and_epi64(_mm_setzero_si128(), __U, __A, __B); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_andnot_epi64(__m256i __W, __mmask8 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U, (__v4di)_mm256_andnot_si256(__A, __B), (__v4di)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_andnot_epi64(__mmask8 __U, __m256i __A, __m256i __B) { return (__m256i)_mm256_mask_andnot_epi64(_mm256_setzero_si256(), __U, __A, __B); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_andnot_epi64(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U, (__v2di)_mm_andnot_si128(__A, __B), (__v2di)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_andnot_epi64(__mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)_mm_mask_andnot_epi64(_mm_setzero_si128(), __U, __A, __B); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_or_epi64(__m256i __W, __mmask8 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U, (__v4di)_mm256_or_si256(__A, __B), (__v4di)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_or_epi64(__mmask8 __U, __m256i __A, __m256i __B) { return (__m256i)_mm256_mask_or_epi64(_mm256_setzero_si256(), __U, __A, __B); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_or_epi64(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U, (__v2di)_mm_or_si128(__A, __B), (__v2di)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_or_epi64(__mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)_mm_mask_or_epi64(_mm_setzero_si128(), __U, __A, __B); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_xor_epi64(__m256i __W, __mmask8 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U, (__v4di)_mm256_xor_si256(__A, __B), (__v4di)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_xor_epi64(__mmask8 __U, __m256i __A, __m256i __B) { return (__m256i)_mm256_mask_xor_epi64(_mm256_setzero_si256(), __U, __A, __B); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_xor_epi64(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U, (__v2di)_mm_xor_si128(__A, __B), (__v2di)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_xor_epi64(__mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)_mm_mask_xor_epi64(_mm_setzero_si128(), __U, __A, __B); } #define _mm_cmp_epi32_mask(a, b, p) __extension__ ({ \ (__mmask8)__builtin_ia32_cmpd128_mask((__v4si)(__m128i)(a), \ (__v4si)(__m128i)(b), (int)(p), \ (__mmask8)-1); }) #define _mm_mask_cmp_epi32_mask(m, a, b, p) __extension__ ({ \ (__mmask8)__builtin_ia32_cmpd128_mask((__v4si)(__m128i)(a), \ (__v4si)(__m128i)(b), (int)(p), \ (__mmask8)(m)); }) #define _mm_cmp_epu32_mask(a, b, p) __extension__ ({ \ (__mmask8)__builtin_ia32_ucmpd128_mask((__v4si)(__m128i)(a), \ (__v4si)(__m128i)(b), (int)(p), \ (__mmask8)-1); }) #define _mm_mask_cmp_epu32_mask(m, a, b, p) __extension__ ({ \ (__mmask8)__builtin_ia32_ucmpd128_mask((__v4si)(__m128i)(a), \ (__v4si)(__m128i)(b), (int)(p), \ (__mmask8)(m)); }) #define _mm256_cmp_epi32_mask(a, b, p) __extension__ ({ \ (__mmask8)__builtin_ia32_cmpd256_mask((__v8si)(__m256i)(a), \ (__v8si)(__m256i)(b), (int)(p), \ (__mmask8)-1); }) #define _mm256_mask_cmp_epi32_mask(m, a, b, p) __extension__ ({ \ (__mmask8)__builtin_ia32_cmpd256_mask((__v8si)(__m256i)(a), \ (__v8si)(__m256i)(b), (int)(p), \ (__mmask8)(m)); }) #define _mm256_cmp_epu32_mask(a, b, p) __extension__ ({ \ (__mmask8)__builtin_ia32_ucmpd256_mask((__v8si)(__m256i)(a), \ (__v8si)(__m256i)(b), (int)(p), \ (__mmask8)-1); }) #define _mm256_mask_cmp_epu32_mask(m, a, b, p) __extension__ ({ \ (__mmask8)__builtin_ia32_ucmpd256_mask((__v8si)(__m256i)(a), \ (__v8si)(__m256i)(b), (int)(p), \ (__mmask8)(m)); }) #define _mm_cmp_epi64_mask(a, b, p) __extension__ ({ \ (__mmask8)__builtin_ia32_cmpq128_mask((__v2di)(__m128i)(a), \ (__v2di)(__m128i)(b), (int)(p), \ (__mmask8)-1); }) #define _mm_mask_cmp_epi64_mask(m, a, b, p) __extension__ ({ \ (__mmask8)__builtin_ia32_cmpq128_mask((__v2di)(__m128i)(a), \ (__v2di)(__m128i)(b), (int)(p), \ (__mmask8)(m)); }) #define _mm_cmp_epu64_mask(a, b, p) __extension__ ({ \ (__mmask8)__builtin_ia32_ucmpq128_mask((__v2di)(__m128i)(a), \ (__v2di)(__m128i)(b), (int)(p), \ (__mmask8)-1); }) #define _mm_mask_cmp_epu64_mask(m, a, b, p) __extension__ ({ \ (__mmask8)__builtin_ia32_ucmpq128_mask((__v2di)(__m128i)(a), \ (__v2di)(__m128i)(b), (int)(p), \ (__mmask8)(m)); }) #define _mm256_cmp_epi64_mask(a, b, p) __extension__ ({ \ (__mmask8)__builtin_ia32_cmpq256_mask((__v4di)(__m256i)(a), \ (__v4di)(__m256i)(b), (int)(p), \ (__mmask8)-1); }) #define _mm256_mask_cmp_epi64_mask(m, a, b, p) __extension__ ({ \ (__mmask8)__builtin_ia32_cmpq256_mask((__v4di)(__m256i)(a), \ (__v4di)(__m256i)(b), (int)(p), \ (__mmask8)(m)); }) #define _mm256_cmp_epu64_mask(a, b, p) __extension__ ({ \ (__mmask8)__builtin_ia32_ucmpq256_mask((__v4di)(__m256i)(a), \ (__v4di)(__m256i)(b), (int)(p), \ (__mmask8)-1); }) #define _mm256_mask_cmp_epu64_mask(m, a, b, p) __extension__ ({ \ (__mmask8)__builtin_ia32_ucmpq256_mask((__v4di)(__m256i)(a), \ (__v4di)(__m256i)(b), (int)(p), \ (__mmask8)(m)); }) #define _mm256_cmp_ps_mask(a, b, p) __extension__ ({ \ (__mmask8)__builtin_ia32_cmpps256_mask((__v8sf)(__m256)(a), \ (__v8sf)(__m256)(b), (int)(p), \ (__mmask8)-1); }) #define _mm256_mask_cmp_ps_mask(m, a, b, p) __extension__ ({ \ (__mmask8)__builtin_ia32_cmpps256_mask((__v8sf)(__m256)(a), \ (__v8sf)(__m256)(b), (int)(p), \ (__mmask8)(m)); }) #define _mm256_cmp_pd_mask(a, b, p) __extension__ ({ \ (__mmask8)__builtin_ia32_cmppd256_mask((__v4df)(__m256d)(a), \ (__v4df)(__m256d)(b), (int)(p), \ (__mmask8)-1); }) #define _mm256_mask_cmp_pd_mask(m, a, b, p) __extension__ ({ \ (__mmask8)__builtin_ia32_cmppd256_mask((__v4df)(__m256d)(a), \ (__v4df)(__m256d)(b), (int)(p), \ (__mmask8)(m)); }) #define _mm_cmp_ps_mask(a, b, p) __extension__ ({ \ (__mmask8)__builtin_ia32_cmpps128_mask((__v4sf)(__m128)(a), \ (__v4sf)(__m128)(b), (int)(p), \ (__mmask8)-1); }) #define _mm_mask_cmp_ps_mask(m, a, b, p) __extension__ ({ \ (__mmask8)__builtin_ia32_cmpps128_mask((__v4sf)(__m128)(a), \ (__v4sf)(__m128)(b), (int)(p), \ (__mmask8)(m)); }) #define _mm_cmp_pd_mask(a, b, p) __extension__ ({ \ (__mmask8)__builtin_ia32_cmppd128_mask((__v2df)(__m128d)(a), \ (__v2df)(__m128d)(b), (int)(p), \ (__mmask8)-1); }) #define _mm_mask_cmp_pd_mask(m, a, b, p) __extension__ ({ \ (__mmask8)__builtin_ia32_cmppd128_mask((__v2df)(__m128d)(a), \ (__v2df)(__m128d)(b), (int)(p), \ (__mmask8)(m)); }) static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask_fmadd_pd(__m128d __A, __mmask8 __U, __m128d __B, __m128d __C) { return (__m128d) __builtin_ia32_vfmaddpd128_mask ((__v2df) __A, (__v2df) __B, (__v2df) __C, (__mmask8) __U); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask3_fmadd_pd(__m128d __A, __m128d __B, __m128d __C, __mmask8 __U) { return (__m128d) __builtin_ia32_vfmaddpd128_mask3 ((__v2df) __A, (__v2df) __B, (__v2df) __C, (__mmask8) __U); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_maskz_fmadd_pd(__mmask8 __U, __m128d __A, __m128d __B, __m128d __C) { return (__m128d) __builtin_ia32_vfmaddpd128_maskz ((__v2df) __A, (__v2df) __B, (__v2df) __C, (__mmask8) __U); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask_fmsub_pd(__m128d __A, __mmask8 __U, __m128d __B, __m128d __C) { return (__m128d) __builtin_ia32_vfmaddpd128_mask ((__v2df) __A, (__v2df) __B, -(__v2df) __C, (__mmask8) __U); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_maskz_fmsub_pd(__mmask8 __U, __m128d __A, __m128d __B, __m128d __C) { return (__m128d) __builtin_ia32_vfmaddpd128_maskz ((__v2df) __A, (__v2df) __B, -(__v2df) __C, (__mmask8) __U); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask3_fnmadd_pd(__m128d __A, __m128d __B, __m128d __C, __mmask8 __U) { return (__m128d) __builtin_ia32_vfmaddpd128_mask3 (-(__v2df) __A, (__v2df) __B, (__v2df) __C, (__mmask8) __U); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_maskz_fnmadd_pd(__mmask8 __U, __m128d __A, __m128d __B, __m128d __C) { return (__m128d) __builtin_ia32_vfmaddpd128_maskz (-(__v2df) __A, (__v2df) __B, (__v2df) __C, (__mmask8) __U); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_maskz_fnmsub_pd(__mmask8 __U, __m128d __A, __m128d __B, __m128d __C) { return (__m128d) __builtin_ia32_vfmaddpd128_maskz (-(__v2df) __A, (__v2df) __B, -(__v2df) __C, (__mmask8) __U); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_mask_fmadd_pd(__m256d __A, __mmask8 __U, __m256d __B, __m256d __C) { return (__m256d) __builtin_ia32_vfmaddpd256_mask ((__v4df) __A, (__v4df) __B, (__v4df) __C, (__mmask8) __U); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_mask3_fmadd_pd(__m256d __A, __m256d __B, __m256d __C, __mmask8 __U) { return (__m256d) __builtin_ia32_vfmaddpd256_mask3 ((__v4df) __A, (__v4df) __B, (__v4df) __C, (__mmask8) __U); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_maskz_fmadd_pd(__mmask8 __U, __m256d __A, __m256d __B, __m256d __C) { return (__m256d) __builtin_ia32_vfmaddpd256_maskz ((__v4df) __A, (__v4df) __B, (__v4df) __C, (__mmask8) __U); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_mask_fmsub_pd(__m256d __A, __mmask8 __U, __m256d __B, __m256d __C) { return (__m256d) __builtin_ia32_vfmaddpd256_mask ((__v4df) __A, (__v4df) __B, -(__v4df) __C, (__mmask8) __U); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_maskz_fmsub_pd(__mmask8 __U, __m256d __A, __m256d __B, __m256d __C) { return (__m256d) __builtin_ia32_vfmaddpd256_maskz ((__v4df) __A, (__v4df) __B, -(__v4df) __C, (__mmask8) __U); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_mask3_fnmadd_pd(__m256d __A, __m256d __B, __m256d __C, __mmask8 __U) { return (__m256d) __builtin_ia32_vfmaddpd256_mask3 (-(__v4df) __A, (__v4df) __B, (__v4df) __C, (__mmask8) __U); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_maskz_fnmadd_pd(__mmask8 __U, __m256d __A, __m256d __B, __m256d __C) { return (__m256d) __builtin_ia32_vfmaddpd256_maskz (-(__v4df) __A, (__v4df) __B, (__v4df) __C, (__mmask8) __U); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_maskz_fnmsub_pd(__mmask8 __U, __m256d __A, __m256d __B, __m256d __C) { return (__m256d) __builtin_ia32_vfmaddpd256_maskz (-(__v4df) __A, (__v4df) __B, -(__v4df) __C, (__mmask8) __U); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask_fmadd_ps(__m128 __A, __mmask8 __U, __m128 __B, __m128 __C) { return (__m128) __builtin_ia32_vfmaddps128_mask ((__v4sf) __A, (__v4sf) __B, (__v4sf) __C, (__mmask8) __U); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask3_fmadd_ps(__m128 __A, __m128 __B, __m128 __C, __mmask8 __U) { return (__m128) __builtin_ia32_vfmaddps128_mask3 ((__v4sf) __A, (__v4sf) __B, (__v4sf) __C, (__mmask8) __U); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maskz_fmadd_ps(__mmask8 __U, __m128 __A, __m128 __B, __m128 __C) { return (__m128) __builtin_ia32_vfmaddps128_maskz ((__v4sf) __A, (__v4sf) __B, (__v4sf) __C, (__mmask8) __U); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask_fmsub_ps(__m128 __A, __mmask8 __U, __m128 __B, __m128 __C) { return (__m128) __builtin_ia32_vfmaddps128_mask ((__v4sf) __A, (__v4sf) __B, -(__v4sf) __C, (__mmask8) __U); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maskz_fmsub_ps(__mmask8 __U, __m128 __A, __m128 __B, __m128 __C) { return (__m128) __builtin_ia32_vfmaddps128_maskz ((__v4sf) __A, (__v4sf) __B, -(__v4sf) __C, (__mmask8) __U); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask3_fnmadd_ps(__m128 __A, __m128 __B, __m128 __C, __mmask8 __U) { return (__m128) __builtin_ia32_vfmaddps128_mask3 (-(__v4sf) __A, (__v4sf) __B, (__v4sf) __C, (__mmask8) __U); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maskz_fnmadd_ps(__mmask8 __U, __m128 __A, __m128 __B, __m128 __C) { return (__m128) __builtin_ia32_vfmaddps128_maskz (-(__v4sf) __A, (__v4sf) __B, (__v4sf) __C, (__mmask8) __U); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maskz_fnmsub_ps(__mmask8 __U, __m128 __A, __m128 __B, __m128 __C) { return (__m128) __builtin_ia32_vfmaddps128_maskz (-(__v4sf) __A, (__v4sf) __B, -(__v4sf) __C, (__mmask8) __U); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_mask_fmadd_ps(__m256 __A, __mmask8 __U, __m256 __B, __m256 __C) { return (__m256) __builtin_ia32_vfmaddps256_mask ((__v8sf) __A, (__v8sf) __B, (__v8sf) __C, (__mmask8) __U); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_mask3_fmadd_ps(__m256 __A, __m256 __B, __m256 __C, __mmask8 __U) { return (__m256) __builtin_ia32_vfmaddps256_mask3 ((__v8sf) __A, (__v8sf) __B, (__v8sf) __C, (__mmask8) __U); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_maskz_fmadd_ps(__mmask8 __U, __m256 __A, __m256 __B, __m256 __C) { return (__m256) __builtin_ia32_vfmaddps256_maskz ((__v8sf) __A, (__v8sf) __B, (__v8sf) __C, (__mmask8) __U); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_mask_fmsub_ps(__m256 __A, __mmask8 __U, __m256 __B, __m256 __C) { return (__m256) __builtin_ia32_vfmaddps256_mask ((__v8sf) __A, (__v8sf) __B, -(__v8sf) __C, (__mmask8) __U); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_maskz_fmsub_ps(__mmask8 __U, __m256 __A, __m256 __B, __m256 __C) { return (__m256) __builtin_ia32_vfmaddps256_maskz ((__v8sf) __A, (__v8sf) __B, -(__v8sf) __C, (__mmask8) __U); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_mask3_fnmadd_ps(__m256 __A, __m256 __B, __m256 __C, __mmask8 __U) { return (__m256) __builtin_ia32_vfmaddps256_mask3 (-(__v8sf) __A, (__v8sf) __B, (__v8sf) __C, (__mmask8) __U); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_maskz_fnmadd_ps(__mmask8 __U, __m256 __A, __m256 __B, __m256 __C) { return (__m256) __builtin_ia32_vfmaddps256_maskz (-(__v8sf) __A, (__v8sf) __B, (__v8sf) __C, (__mmask8) __U); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_maskz_fnmsub_ps(__mmask8 __U, __m256 __A, __m256 __B, __m256 __C) { return (__m256) __builtin_ia32_vfmaddps256_maskz (-(__v8sf) __A, (__v8sf) __B, -(__v8sf) __C, (__mmask8) __U); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask_fmaddsub_pd(__m128d __A, __mmask8 __U, __m128d __B, __m128d __C) { return (__m128d) __builtin_ia32_vfmaddsubpd128_mask ((__v2df) __A, (__v2df) __B, (__v2df) __C, (__mmask8) __U); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask3_fmaddsub_pd(__m128d __A, __m128d __B, __m128d __C, __mmask8 __U) { return (__m128d) __builtin_ia32_vfmaddsubpd128_mask3 ((__v2df) __A, (__v2df) __B, (__v2df) __C, (__mmask8) __U); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_maskz_fmaddsub_pd(__mmask8 __U, __m128d __A, __m128d __B, __m128d __C) { return (__m128d) __builtin_ia32_vfmaddsubpd128_maskz ((__v2df) __A, (__v2df) __B, (__v2df) __C, (__mmask8) __U); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask_fmsubadd_pd(__m128d __A, __mmask8 __U, __m128d __B, __m128d __C) { return (__m128d) __builtin_ia32_vfmaddsubpd128_mask ((__v2df) __A, (__v2df) __B, -(__v2df) __C, (__mmask8) __U); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_maskz_fmsubadd_pd(__mmask8 __U, __m128d __A, __m128d __B, __m128d __C) { return (__m128d) __builtin_ia32_vfmaddsubpd128_maskz ((__v2df) __A, (__v2df) __B, -(__v2df) __C, (__mmask8) __U); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_mask_fmaddsub_pd(__m256d __A, __mmask8 __U, __m256d __B, __m256d __C) { return (__m256d) __builtin_ia32_vfmaddsubpd256_mask ((__v4df) __A, (__v4df) __B, (__v4df) __C, (__mmask8) __U); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_mask3_fmaddsub_pd(__m256d __A, __m256d __B, __m256d __C, __mmask8 __U) { return (__m256d) __builtin_ia32_vfmaddsubpd256_mask3 ((__v4df) __A, (__v4df) __B, (__v4df) __C, (__mmask8) __U); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_maskz_fmaddsub_pd(__mmask8 __U, __m256d __A, __m256d __B, __m256d __C) { return (__m256d) __builtin_ia32_vfmaddsubpd256_maskz ((__v4df) __A, (__v4df) __B, (__v4df) __C, (__mmask8) __U); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_mask_fmsubadd_pd(__m256d __A, __mmask8 __U, __m256d __B, __m256d __C) { return (__m256d) __builtin_ia32_vfmaddsubpd256_mask ((__v4df) __A, (__v4df) __B, -(__v4df) __C, (__mmask8) __U); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_maskz_fmsubadd_pd(__mmask8 __U, __m256d __A, __m256d __B, __m256d __C) { return (__m256d) __builtin_ia32_vfmaddsubpd256_maskz ((__v4df) __A, (__v4df) __B, -(__v4df) __C, (__mmask8) __U); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask_fmaddsub_ps(__m128 __A, __mmask8 __U, __m128 __B, __m128 __C) { return (__m128) __builtin_ia32_vfmaddsubps128_mask ((__v4sf) __A, (__v4sf) __B, (__v4sf) __C, (__mmask8) __U); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask3_fmaddsub_ps(__m128 __A, __m128 __B, __m128 __C, __mmask8 __U) { return (__m128) __builtin_ia32_vfmaddsubps128_mask3 ((__v4sf) __A, (__v4sf) __B, (__v4sf) __C, (__mmask8) __U); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maskz_fmaddsub_ps(__mmask8 __U, __m128 __A, __m128 __B, __m128 __C) { return (__m128) __builtin_ia32_vfmaddsubps128_maskz ((__v4sf) __A, (__v4sf) __B, (__v4sf) __C, (__mmask8) __U); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask_fmsubadd_ps(__m128 __A, __mmask8 __U, __m128 __B, __m128 __C) { return (__m128) __builtin_ia32_vfmaddsubps128_mask ((__v4sf) __A, (__v4sf) __B, -(__v4sf) __C, (__mmask8) __U); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maskz_fmsubadd_ps(__mmask8 __U, __m128 __A, __m128 __B, __m128 __C) { return (__m128) __builtin_ia32_vfmaddsubps128_maskz ((__v4sf) __A, (__v4sf) __B, -(__v4sf) __C, (__mmask8) __U); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_mask_fmaddsub_ps(__m256 __A, __mmask8 __U, __m256 __B, __m256 __C) { return (__m256) __builtin_ia32_vfmaddsubps256_mask ((__v8sf) __A, (__v8sf) __B, (__v8sf) __C, (__mmask8) __U); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_mask3_fmaddsub_ps(__m256 __A, __m256 __B, __m256 __C, __mmask8 __U) { return (__m256) __builtin_ia32_vfmaddsubps256_mask3 ((__v8sf) __A, (__v8sf) __B, (__v8sf) __C, (__mmask8) __U); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_maskz_fmaddsub_ps(__mmask8 __U, __m256 __A, __m256 __B, __m256 __C) { return (__m256) __builtin_ia32_vfmaddsubps256_maskz ((__v8sf) __A, (__v8sf) __B, (__v8sf) __C, (__mmask8) __U); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_mask_fmsubadd_ps(__m256 __A, __mmask8 __U, __m256 __B, __m256 __C) { return (__m256) __builtin_ia32_vfmaddsubps256_mask ((__v8sf) __A, (__v8sf) __B, -(__v8sf) __C, (__mmask8) __U); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_maskz_fmsubadd_ps(__mmask8 __U, __m256 __A, __m256 __B, __m256 __C) { return (__m256) __builtin_ia32_vfmaddsubps256_maskz ((__v8sf) __A, (__v8sf) __B, -(__v8sf) __C, (__mmask8) __U); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask3_fmsub_pd(__m128d __A, __m128d __B, __m128d __C, __mmask8 __U) { return (__m128d) __builtin_ia32_vfmsubpd128_mask3 ((__v2df) __A, (__v2df) __B, (__v2df) __C, (__mmask8) __U); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_mask3_fmsub_pd(__m256d __A, __m256d __B, __m256d __C, __mmask8 __U) { return (__m256d) __builtin_ia32_vfmsubpd256_mask3 ((__v4df) __A, (__v4df) __B, (__v4df) __C, (__mmask8) __U); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask3_fmsub_ps(__m128 __A, __m128 __B, __m128 __C, __mmask8 __U) { return (__m128) __builtin_ia32_vfmsubps128_mask3 ((__v4sf) __A, (__v4sf) __B, (__v4sf) __C, (__mmask8) __U); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_mask3_fmsub_ps(__m256 __A, __m256 __B, __m256 __C, __mmask8 __U) { return (__m256) __builtin_ia32_vfmsubps256_mask3 ((__v8sf) __A, (__v8sf) __B, (__v8sf) __C, (__mmask8) __U); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask3_fmsubadd_pd(__m128d __A, __m128d __B, __m128d __C, __mmask8 __U) { return (__m128d) __builtin_ia32_vfmsubaddpd128_mask3 ((__v2df) __A, (__v2df) __B, (__v2df) __C, (__mmask8) __U); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_mask3_fmsubadd_pd(__m256d __A, __m256d __B, __m256d __C, __mmask8 __U) { return (__m256d) __builtin_ia32_vfmsubaddpd256_mask3 ((__v4df) __A, (__v4df) __B, (__v4df) __C, (__mmask8) __U); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask3_fmsubadd_ps(__m128 __A, __m128 __B, __m128 __C, __mmask8 __U) { return (__m128) __builtin_ia32_vfmsubaddps128_mask3 ((__v4sf) __A, (__v4sf) __B, (__v4sf) __C, (__mmask8) __U); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_mask3_fmsubadd_ps(__m256 __A, __m256 __B, __m256 __C, __mmask8 __U) { return (__m256) __builtin_ia32_vfmsubaddps256_mask3 ((__v8sf) __A, (__v8sf) __B, (__v8sf) __C, (__mmask8) __U); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask_fnmadd_pd(__m128d __A, __mmask8 __U, __m128d __B, __m128d __C) { return (__m128d) __builtin_ia32_vfnmaddpd128_mask ((__v2df) __A, (__v2df) __B, (__v2df) __C, (__mmask8) __U); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_mask_fnmadd_pd(__m256d __A, __mmask8 __U, __m256d __B, __m256d __C) { return (__m256d) __builtin_ia32_vfnmaddpd256_mask ((__v4df) __A, (__v4df) __B, (__v4df) __C, (__mmask8) __U); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask_fnmadd_ps(__m128 __A, __mmask8 __U, __m128 __B, __m128 __C) { return (__m128) __builtin_ia32_vfnmaddps128_mask ((__v4sf) __A, (__v4sf) __B, (__v4sf) __C, (__mmask8) __U); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_mask_fnmadd_ps(__m256 __A, __mmask8 __U, __m256 __B, __m256 __C) { return (__m256) __builtin_ia32_vfnmaddps256_mask ((__v8sf) __A, (__v8sf) __B, (__v8sf) __C, (__mmask8) __U); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask_fnmsub_pd(__m128d __A, __mmask8 __U, __m128d __B, __m128d __C) { return (__m128d) __builtin_ia32_vfnmsubpd128_mask ((__v2df) __A, (__v2df) __B, (__v2df) __C, (__mmask8) __U); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask3_fnmsub_pd(__m128d __A, __m128d __B, __m128d __C, __mmask8 __U) { return (__m128d) __builtin_ia32_vfnmsubpd128_mask3 ((__v2df) __A, (__v2df) __B, (__v2df) __C, (__mmask8) __U); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_mask_fnmsub_pd(__m256d __A, __mmask8 __U, __m256d __B, __m256d __C) { return (__m256d) __builtin_ia32_vfnmsubpd256_mask ((__v4df) __A, (__v4df) __B, (__v4df) __C, (__mmask8) __U); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_mask3_fnmsub_pd(__m256d __A, __m256d __B, __m256d __C, __mmask8 __U) { return (__m256d) __builtin_ia32_vfnmsubpd256_mask3 ((__v4df) __A, (__v4df) __B, (__v4df) __C, (__mmask8) __U); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask_fnmsub_ps(__m128 __A, __mmask8 __U, __m128 __B, __m128 __C) { return (__m128) __builtin_ia32_vfnmsubps128_mask ((__v4sf) __A, (__v4sf) __B, (__v4sf) __C, (__mmask8) __U); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask3_fnmsub_ps(__m128 __A, __m128 __B, __m128 __C, __mmask8 __U) { return (__m128) __builtin_ia32_vfnmsubps128_mask3 ((__v4sf) __A, (__v4sf) __B, (__v4sf) __C, (__mmask8) __U); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_mask_fnmsub_ps(__m256 __A, __mmask8 __U, __m256 __B, __m256 __C) { return (__m256) __builtin_ia32_vfnmsubps256_mask ((__v8sf) __A, (__v8sf) __B, (__v8sf) __C, (__mmask8) __U); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_mask3_fnmsub_ps(__m256 __A, __m256 __B, __m256 __C, __mmask8 __U) { return (__m256) __builtin_ia32_vfnmsubps256_mask3 ((__v8sf) __A, (__v8sf) __B, (__v8sf) __C, (__mmask8) __U); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask_add_pd(__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U, (__v2df)_mm_add_pd(__A, __B), (__v2df)__W); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_maskz_add_pd(__mmask8 __U, __m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U, (__v2df)_mm_add_pd(__A, __B), (__v2df)_mm_setzero_pd()); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_mask_add_pd(__m256d __W, __mmask8 __U, __m256d __A, __m256d __B) { return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U, (__v4df)_mm256_add_pd(__A, __B), (__v4df)__W); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_maskz_add_pd(__mmask8 __U, __m256d __A, __m256d __B) { return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U, (__v4df)_mm256_add_pd(__A, __B), (__v4df)_mm256_setzero_pd()); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask_add_ps(__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) { return (__m128)__builtin_ia32_selectps_128((__mmask8)__U, (__v4sf)_mm_add_ps(__A, __B), (__v4sf)__W); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maskz_add_ps(__mmask8 __U, __m128 __A, __m128 __B) { return (__m128)__builtin_ia32_selectps_128((__mmask8)__U, (__v4sf)_mm_add_ps(__A, __B), (__v4sf)_mm_setzero_ps()); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_mask_add_ps(__m256 __W, __mmask8 __U, __m256 __A, __m256 __B) { return (__m256)__builtin_ia32_selectps_256((__mmask8)__U, (__v8sf)_mm256_add_ps(__A, __B), (__v8sf)__W); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_maskz_add_ps(__mmask8 __U, __m256 __A, __m256 __B) { return (__m256)__builtin_ia32_selectps_256((__mmask8)__U, (__v8sf)_mm256_add_ps(__A, __B), (__v8sf)_mm256_setzero_ps()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_blend_epi32 (__mmask8 __U, __m128i __A, __m128i __W) { return (__m128i) __builtin_ia32_selectd_128 ((__mmask8) __U, (__v4si) __W, (__v4si) __A); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_blend_epi32 (__mmask8 __U, __m256i __A, __m256i __W) { return (__m256i) __builtin_ia32_selectd_256 ((__mmask8) __U, (__v8si) __W, (__v8si) __A); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask_blend_pd (__mmask8 __U, __m128d __A, __m128d __W) { return (__m128d) __builtin_ia32_selectpd_128 ((__mmask8) __U, (__v2df) __W, (__v2df) __A); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_mask_blend_pd (__mmask8 __U, __m256d __A, __m256d __W) { return (__m256d) __builtin_ia32_selectpd_256 ((__mmask8) __U, (__v4df) __W, (__v4df) __A); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask_blend_ps (__mmask8 __U, __m128 __A, __m128 __W) { return (__m128) __builtin_ia32_selectps_128 ((__mmask8) __U, (__v4sf) __W, (__v4sf) __A); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_mask_blend_ps (__mmask8 __U, __m256 __A, __m256 __W) { return (__m256) __builtin_ia32_selectps_256 ((__mmask8) __U, (__v8sf) __W, (__v8sf) __A); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_blend_epi64 (__mmask8 __U, __m128i __A, __m128i __W) { return (__m128i) __builtin_ia32_selectq_128 ((__mmask8) __U, (__v2di) __W, (__v2di) __A); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_blend_epi64 (__mmask8 __U, __m256i __A, __m256i __W) { return (__m256i) __builtin_ia32_selectq_256 ((__mmask8) __U, (__v4di) __W, (__v4di) __A); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask_compress_pd (__m128d __W, __mmask8 __U, __m128d __A) { return (__m128d) __builtin_ia32_compressdf128_mask ((__v2df) __A, (__v2df) __W, (__mmask8) __U); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_maskz_compress_pd (__mmask8 __U, __m128d __A) { return (__m128d) __builtin_ia32_compressdf128_mask ((__v2df) __A, (__v2df) _mm_setzero_pd (), (__mmask8) __U); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_mask_compress_pd (__m256d __W, __mmask8 __U, __m256d __A) { return (__m256d) __builtin_ia32_compressdf256_mask ((__v4df) __A, (__v4df) __W, (__mmask8) __U); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_maskz_compress_pd (__mmask8 __U, __m256d __A) { return (__m256d) __builtin_ia32_compressdf256_mask ((__v4df) __A, (__v4df) _mm256_setzero_pd (), (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_compress_epi64 (__m128i __W, __mmask8 __U, __m128i __A) { return (__m128i) __builtin_ia32_compressdi128_mask ((__v2di) __A, (__v2di) __W, (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_compress_epi64 (__mmask8 __U, __m128i __A) { return (__m128i) __builtin_ia32_compressdi128_mask ((__v2di) __A, (__v2di) _mm_setzero_si128 (), (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_compress_epi64 (__m256i __W, __mmask8 __U, __m256i __A) { return (__m256i) __builtin_ia32_compressdi256_mask ((__v4di) __A, (__v4di) __W, (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_compress_epi64 (__mmask8 __U, __m256i __A) { return (__m256i) __builtin_ia32_compressdi256_mask ((__v4di) __A, (__v4di) _mm256_setzero_si256 (), (__mmask8) __U); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask_compress_ps (__m128 __W, __mmask8 __U, __m128 __A) { return (__m128) __builtin_ia32_compresssf128_mask ((__v4sf) __A, (__v4sf) __W, (__mmask8) __U); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maskz_compress_ps (__mmask8 __U, __m128 __A) { return (__m128) __builtin_ia32_compresssf128_mask ((__v4sf) __A, (__v4sf) _mm_setzero_ps (), (__mmask8) __U); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_mask_compress_ps (__m256 __W, __mmask8 __U, __m256 __A) { return (__m256) __builtin_ia32_compresssf256_mask ((__v8sf) __A, (__v8sf) __W, (__mmask8) __U); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_maskz_compress_ps (__mmask8 __U, __m256 __A) { return (__m256) __builtin_ia32_compresssf256_mask ((__v8sf) __A, (__v8sf) _mm256_setzero_ps (), (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_compress_epi32 (__m128i __W, __mmask8 __U, __m128i __A) { return (__m128i) __builtin_ia32_compresssi128_mask ((__v4si) __A, (__v4si) __W, (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_compress_epi32 (__mmask8 __U, __m128i __A) { return (__m128i) __builtin_ia32_compresssi128_mask ((__v4si) __A, (__v4si) _mm_setzero_si128 (), (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_compress_epi32 (__m256i __W, __mmask8 __U, __m256i __A) { return (__m256i) __builtin_ia32_compresssi256_mask ((__v8si) __A, (__v8si) __W, (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_compress_epi32 (__mmask8 __U, __m256i __A) { return (__m256i) __builtin_ia32_compresssi256_mask ((__v8si) __A, (__v8si) _mm256_setzero_si256 (), (__mmask8) __U); } static __inline__ void __DEFAULT_FN_ATTRS _mm_mask_compressstoreu_pd (void *__P, __mmask8 __U, __m128d __A) { __builtin_ia32_compressstoredf128_mask ((__v2df *) __P, (__v2df) __A, (__mmask8) __U); } static __inline__ void __DEFAULT_FN_ATTRS _mm256_mask_compressstoreu_pd (void *__P, __mmask8 __U, __m256d __A) { __builtin_ia32_compressstoredf256_mask ((__v4df *) __P, (__v4df) __A, (__mmask8) __U); } static __inline__ void __DEFAULT_FN_ATTRS _mm_mask_compressstoreu_epi64 (void *__P, __mmask8 __U, __m128i __A) { __builtin_ia32_compressstoredi128_mask ((__v2di *) __P, (__v2di) __A, (__mmask8) __U); } static __inline__ void __DEFAULT_FN_ATTRS _mm256_mask_compressstoreu_epi64 (void *__P, __mmask8 __U, __m256i __A) { __builtin_ia32_compressstoredi256_mask ((__v4di *) __P, (__v4di) __A, (__mmask8) __U); } static __inline__ void __DEFAULT_FN_ATTRS _mm_mask_compressstoreu_ps (void *__P, __mmask8 __U, __m128 __A) { __builtin_ia32_compressstoresf128_mask ((__v4sf *) __P, (__v4sf) __A, (__mmask8) __U); } static __inline__ void __DEFAULT_FN_ATTRS _mm256_mask_compressstoreu_ps (void *__P, __mmask8 __U, __m256 __A) { __builtin_ia32_compressstoresf256_mask ((__v8sf *) __P, (__v8sf) __A, (__mmask8) __U); } static __inline__ void __DEFAULT_FN_ATTRS _mm_mask_compressstoreu_epi32 (void *__P, __mmask8 __U, __m128i __A) { __builtin_ia32_compressstoresi128_mask ((__v4si *) __P, (__v4si) __A, (__mmask8) __U); } static __inline__ void __DEFAULT_FN_ATTRS _mm256_mask_compressstoreu_epi32 (void *__P, __mmask8 __U, __m256i __A) { __builtin_ia32_compressstoresi256_mask ((__v8si *) __P, (__v8si) __A, (__mmask8) __U); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask_cvtepi32_pd (__m128d __W, __mmask8 __U, __m128i __A) { return (__m128d)__builtin_ia32_selectpd_128((__mmask8) __U, (__v2df)_mm_cvtepi32_pd(__A), (__v2df)__W); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_maskz_cvtepi32_pd (__mmask8 __U, __m128i __A) { return (__m128d)__builtin_ia32_selectpd_128((__mmask8) __U, (__v2df)_mm_cvtepi32_pd(__A), (__v2df)_mm_setzero_pd()); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_mask_cvtepi32_pd (__m256d __W, __mmask8 __U, __m128i __A) { return (__m256d)__builtin_ia32_selectpd_256((__mmask8) __U, (__v4df)_mm256_cvtepi32_pd(__A), (__v4df)__W); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_maskz_cvtepi32_pd (__mmask8 __U, __m128i __A) { return (__m256d)__builtin_ia32_selectpd_256((__mmask8) __U, (__v4df)_mm256_cvtepi32_pd(__A), (__v4df)_mm256_setzero_pd()); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask_cvtepi32_ps (__m128 __W, __mmask8 __U, __m128i __A) { return (__m128) __builtin_ia32_cvtdq2ps128_mask ((__v4si) __A, (__v4sf) __W, (__mmask8) __U); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maskz_cvtepi32_ps (__mmask16 __U, __m128i __A) { return (__m128) __builtin_ia32_cvtdq2ps128_mask ((__v4si) __A, (__v4sf) _mm_setzero_ps (), (__mmask8) __U); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_mask_cvtepi32_ps (__m256 __W, __mmask8 __U, __m256i __A) { return (__m256) __builtin_ia32_cvtdq2ps256_mask ((__v8si) __A, (__v8sf) __W, (__mmask8) __U); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_maskz_cvtepi32_ps (__mmask16 __U, __m256i __A) { return (__m256) __builtin_ia32_cvtdq2ps256_mask ((__v8si) __A, (__v8sf) _mm256_setzero_ps (), (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_cvtpd_epi32 (__m128i __W, __mmask8 __U, __m128d __A) { return (__m128i) __builtin_ia32_cvtpd2dq128_mask ((__v2df) __A, (__v4si) __W, (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_cvtpd_epi32 (__mmask8 __U, __m128d __A) { return (__m128i) __builtin_ia32_cvtpd2dq128_mask ((__v2df) __A, (__v4si) _mm_setzero_si128 (), (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_mask_cvtpd_epi32 (__m128i __W, __mmask8 __U, __m256d __A) { return (__m128i) __builtin_ia32_cvtpd2dq256_mask ((__v4df) __A, (__v4si) __W, (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_maskz_cvtpd_epi32 (__mmask8 __U, __m256d __A) { return (__m128i) __builtin_ia32_cvtpd2dq256_mask ((__v4df) __A, (__v4si) _mm_setzero_si128 (), (__mmask8) __U); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask_cvtpd_ps (__m128 __W, __mmask8 __U, __m128d __A) { return (__m128) __builtin_ia32_cvtpd2ps_mask ((__v2df) __A, (__v4sf) __W, (__mmask8) __U); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maskz_cvtpd_ps (__mmask8 __U, __m128d __A) { return (__m128) __builtin_ia32_cvtpd2ps_mask ((__v2df) __A, (__v4sf) _mm_setzero_ps (), (__mmask8) __U); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm256_mask_cvtpd_ps (__m128 __W, __mmask8 __U, __m256d __A) { return (__m128) __builtin_ia32_cvtpd2ps256_mask ((__v4df) __A, (__v4sf) __W, (__mmask8) __U); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm256_maskz_cvtpd_ps (__mmask8 __U, __m256d __A) { return (__m128) __builtin_ia32_cvtpd2ps256_mask ((__v4df) __A, (__v4sf) _mm_setzero_ps (), (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtpd_epu32 (__m128d __A) { return (__m128i) __builtin_ia32_cvtpd2udq128_mask ((__v2df) __A, (__v4si) _mm_setzero_si128 (), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_cvtpd_epu32 (__m128i __W, __mmask8 __U, __m128d __A) { return (__m128i) __builtin_ia32_cvtpd2udq128_mask ((__v2df) __A, (__v4si) __W, (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_cvtpd_epu32 (__mmask8 __U, __m128d __A) { return (__m128i) __builtin_ia32_cvtpd2udq128_mask ((__v2df) __A, (__v4si) _mm_setzero_si128 (), (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_cvtpd_epu32 (__m256d __A) { return (__m128i) __builtin_ia32_cvtpd2udq256_mask ((__v4df) __A, (__v4si) _mm_setzero_si128 (), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_mask_cvtpd_epu32 (__m128i __W, __mmask8 __U, __m256d __A) { return (__m128i) __builtin_ia32_cvtpd2udq256_mask ((__v4df) __A, (__v4si) __W, (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_maskz_cvtpd_epu32 (__mmask8 __U, __m256d __A) { return (__m128i) __builtin_ia32_cvtpd2udq256_mask ((__v4df) __A, (__v4si) _mm_setzero_si128 (), (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_cvtps_epi32 (__m128i __W, __mmask8 __U, __m128 __A) { return (__m128i) __builtin_ia32_cvtps2dq128_mask ((__v4sf) __A, (__v4si) __W, (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_cvtps_epi32 (__mmask8 __U, __m128 __A) { return (__m128i) __builtin_ia32_cvtps2dq128_mask ((__v4sf) __A, (__v4si) _mm_setzero_si128 (), (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_cvtps_epi32 (__m256i __W, __mmask8 __U, __m256 __A) { return (__m256i) __builtin_ia32_cvtps2dq256_mask ((__v8sf) __A, (__v8si) __W, (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_cvtps_epi32 (__mmask8 __U, __m256 __A) { return (__m256i) __builtin_ia32_cvtps2dq256_mask ((__v8sf) __A, (__v8si) _mm256_setzero_si256 (), (__mmask8) __U); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask_cvtps_pd (__m128d __W, __mmask8 __U, __m128 __A) { return (__m128d) __builtin_ia32_cvtps2pd128_mask ((__v4sf) __A, (__v2df) __W, (__mmask8) __U); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_maskz_cvtps_pd (__mmask8 __U, __m128 __A) { return (__m128d) __builtin_ia32_cvtps2pd128_mask ((__v4sf) __A, (__v2df) _mm_setzero_pd (), (__mmask8) __U); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_mask_cvtps_pd (__m256d __W, __mmask8 __U, __m128 __A) { return (__m256d) __builtin_ia32_cvtps2pd256_mask ((__v4sf) __A, (__v4df) __W, (__mmask8) __U); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_maskz_cvtps_pd (__mmask8 __U, __m128 __A) { return (__m256d) __builtin_ia32_cvtps2pd256_mask ((__v4sf) __A, (__v4df) _mm256_setzero_pd (), (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtps_epu32 (__m128 __A) { return (__m128i) __builtin_ia32_cvtps2udq128_mask ((__v4sf) __A, (__v4si) _mm_setzero_si128 (), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_cvtps_epu32 (__m128i __W, __mmask8 __U, __m128 __A) { return (__m128i) __builtin_ia32_cvtps2udq128_mask ((__v4sf) __A, (__v4si) __W, (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_cvtps_epu32 (__mmask8 __U, __m128 __A) { return (__m128i) __builtin_ia32_cvtps2udq128_mask ((__v4sf) __A, (__v4si) _mm_setzero_si128 (), (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_cvtps_epu32 (__m256 __A) { return (__m256i) __builtin_ia32_cvtps2udq256_mask ((__v8sf) __A, (__v8si) _mm256_setzero_si256 (), (__mmask8) -1); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_cvtps_epu32 (__m256i __W, __mmask8 __U, __m256 __A) { return (__m256i) __builtin_ia32_cvtps2udq256_mask ((__v8sf) __A, (__v8si) __W, (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_cvtps_epu32 (__mmask8 __U, __m256 __A) { return (__m256i) __builtin_ia32_cvtps2udq256_mask ((__v8sf) __A, (__v8si) _mm256_setzero_si256 (), (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_cvttpd_epi32 (__m128i __W, __mmask8 __U, __m128d __A) { return (__m128i) __builtin_ia32_cvttpd2dq128_mask ((__v2df) __A, (__v4si) __W, (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_cvttpd_epi32 (__mmask8 __U, __m128d __A) { return (__m128i) __builtin_ia32_cvttpd2dq128_mask ((__v2df) __A, (__v4si) _mm_setzero_si128 (), (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_mask_cvttpd_epi32 (__m128i __W, __mmask8 __U, __m256d __A) { return (__m128i) __builtin_ia32_cvttpd2dq256_mask ((__v4df) __A, (__v4si) __W, (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_maskz_cvttpd_epi32 (__mmask8 __U, __m256d __A) { return (__m128i) __builtin_ia32_cvttpd2dq256_mask ((__v4df) __A, (__v4si) _mm_setzero_si128 (), (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvttpd_epu32 (__m128d __A) { return (__m128i) __builtin_ia32_cvttpd2udq128_mask ((__v2df) __A, (__v4si) _mm_setzero_si128 (), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_cvttpd_epu32 (__m128i __W, __mmask8 __U, __m128d __A) { return (__m128i) __builtin_ia32_cvttpd2udq128_mask ((__v2df) __A, (__v4si) __W, (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_cvttpd_epu32 (__mmask8 __U, __m128d __A) { return (__m128i) __builtin_ia32_cvttpd2udq128_mask ((__v2df) __A, (__v4si) _mm_setzero_si128 (), (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_cvttpd_epu32 (__m256d __A) { return (__m128i) __builtin_ia32_cvttpd2udq256_mask ((__v4df) __A, (__v4si) _mm_setzero_si128 (), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_mask_cvttpd_epu32 (__m128i __W, __mmask8 __U, __m256d __A) { return (__m128i) __builtin_ia32_cvttpd2udq256_mask ((__v4df) __A, (__v4si) __W, (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_maskz_cvttpd_epu32 (__mmask8 __U, __m256d __A) { return (__m128i) __builtin_ia32_cvttpd2udq256_mask ((__v4df) __A, (__v4si) _mm_setzero_si128 (), (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_cvttps_epi32 (__m128i __W, __mmask8 __U, __m128 __A) { return (__m128i) __builtin_ia32_cvttps2dq128_mask ((__v4sf) __A, (__v4si) __W, (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_cvttps_epi32 (__mmask8 __U, __m128 __A) { return (__m128i) __builtin_ia32_cvttps2dq128_mask ((__v4sf) __A, (__v4si) _mm_setzero_si128 (), (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_cvttps_epi32 (__m256i __W, __mmask8 __U, __m256 __A) { return (__m256i) __builtin_ia32_cvttps2dq256_mask ((__v8sf) __A, (__v8si) __W, (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_cvttps_epi32 (__mmask8 __U, __m256 __A) { return (__m256i) __builtin_ia32_cvttps2dq256_mask ((__v8sf) __A, (__v8si) _mm256_setzero_si256 (), (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvttps_epu32 (__m128 __A) { return (__m128i) __builtin_ia32_cvttps2udq128_mask ((__v4sf) __A, (__v4si) _mm_setzero_si128 (), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_cvttps_epu32 (__m128i __W, __mmask8 __U, __m128 __A) { return (__m128i) __builtin_ia32_cvttps2udq128_mask ((__v4sf) __A, (__v4si) __W, (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_cvttps_epu32 (__mmask8 __U, __m128 __A) { return (__m128i) __builtin_ia32_cvttps2udq128_mask ((__v4sf) __A, (__v4si) _mm_setzero_si128 (), (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_cvttps_epu32 (__m256 __A) { return (__m256i) __builtin_ia32_cvttps2udq256_mask ((__v8sf) __A, (__v8si) _mm256_setzero_si256 (), (__mmask8) -1); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_cvttps_epu32 (__m256i __W, __mmask8 __U, __m256 __A) { return (__m256i) __builtin_ia32_cvttps2udq256_mask ((__v8sf) __A, (__v8si) __W, (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_cvttps_epu32 (__mmask8 __U, __m256 __A) { return (__m256i) __builtin_ia32_cvttps2udq256_mask ((__v8sf) __A, (__v8si) _mm256_setzero_si256 (), (__mmask8) __U); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cvtepu32_pd (__m128i __A) { return (__m128d) __builtin_convertvector( __builtin_shufflevector((__v4su)__A, (__v4su)__A, 0, 1), __v2df); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask_cvtepu32_pd (__m128d __W, __mmask8 __U, __m128i __A) { return (__m128d)__builtin_ia32_selectpd_128((__mmask8) __U, (__v2df)_mm_cvtepu32_pd(__A), (__v2df)__W); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_maskz_cvtepu32_pd (__mmask8 __U, __m128i __A) { return (__m128d)__builtin_ia32_selectpd_128((__mmask8) __U, (__v2df)_mm_cvtepu32_pd(__A), (__v2df)_mm_setzero_pd()); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_cvtepu32_pd (__m128i __A) { return (__m256d)__builtin_convertvector((__v4su)__A, __v4df); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_mask_cvtepu32_pd (__m256d __W, __mmask8 __U, __m128i __A) { return (__m256d)__builtin_ia32_selectpd_256((__mmask8) __U, (__v4df)_mm256_cvtepu32_pd(__A), (__v4df)__W); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_maskz_cvtepu32_pd (__mmask8 __U, __m128i __A) { return (__m256d)__builtin_ia32_selectpd_256((__mmask8) __U, (__v4df)_mm256_cvtepu32_pd(__A), (__v4df)_mm256_setzero_pd()); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cvtepu32_ps (__m128i __A) { return (__m128) __builtin_ia32_cvtudq2ps128_mask ((__v4si) __A, (__v4sf) _mm_setzero_ps (), (__mmask8) -1); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask_cvtepu32_ps (__m128 __W, __mmask8 __U, __m128i __A) { return (__m128) __builtin_ia32_cvtudq2ps128_mask ((__v4si) __A, (__v4sf) __W, (__mmask8) __U); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maskz_cvtepu32_ps (__mmask8 __U, __m128i __A) { return (__m128) __builtin_ia32_cvtudq2ps128_mask ((__v4si) __A, (__v4sf) _mm_setzero_ps (), (__mmask8) __U); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_cvtepu32_ps (__m256i __A) { return (__m256) __builtin_ia32_cvtudq2ps256_mask ((__v8si) __A, (__v8sf) _mm256_setzero_ps (), (__mmask8) -1); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_mask_cvtepu32_ps (__m256 __W, __mmask8 __U, __m256i __A) { return (__m256) __builtin_ia32_cvtudq2ps256_mask ((__v8si) __A, (__v8sf) __W, (__mmask8) __U); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_maskz_cvtepu32_ps (__mmask8 __U, __m256i __A) { return (__m256) __builtin_ia32_cvtudq2ps256_mask ((__v8si) __A, (__v8sf) _mm256_setzero_ps (), (__mmask8) __U); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask_div_pd(__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U, (__v2df)_mm_div_pd(__A, __B), (__v2df)__W); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_maskz_div_pd(__mmask8 __U, __m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U, (__v2df)_mm_div_pd(__A, __B), (__v2df)_mm_setzero_pd()); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_mask_div_pd(__m256d __W, __mmask8 __U, __m256d __A, __m256d __B) { return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U, (__v4df)_mm256_div_pd(__A, __B), (__v4df)__W); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_maskz_div_pd(__mmask8 __U, __m256d __A, __m256d __B) { return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U, (__v4df)_mm256_div_pd(__A, __B), (__v4df)_mm256_setzero_pd()); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask_div_ps(__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) { return (__m128)__builtin_ia32_selectps_128((__mmask8)__U, (__v4sf)_mm_div_ps(__A, __B), (__v4sf)__W); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maskz_div_ps(__mmask8 __U, __m128 __A, __m128 __B) { return (__m128)__builtin_ia32_selectps_128((__mmask8)__U, (__v4sf)_mm_div_ps(__A, __B), (__v4sf)_mm_setzero_ps()); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_mask_div_ps(__m256 __W, __mmask8 __U, __m256 __A, __m256 __B) { return (__m256)__builtin_ia32_selectps_256((__mmask8)__U, (__v8sf)_mm256_div_ps(__A, __B), (__v8sf)__W); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_maskz_div_ps(__mmask8 __U, __m256 __A, __m256 __B) { return (__m256)__builtin_ia32_selectps_256((__mmask8)__U, (__v8sf)_mm256_div_ps(__A, __B), (__v8sf)_mm256_setzero_ps()); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask_expand_pd (__m128d __W, __mmask8 __U, __m128d __A) { return (__m128d) __builtin_ia32_expanddf128_mask ((__v2df) __A, (__v2df) __W, (__mmask8) __U); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_maskz_expand_pd (__mmask8 __U, __m128d __A) { return (__m128d) __builtin_ia32_expanddf128_mask ((__v2df) __A, (__v2df) _mm_setzero_pd (), (__mmask8) __U); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_mask_expand_pd (__m256d __W, __mmask8 __U, __m256d __A) { return (__m256d) __builtin_ia32_expanddf256_mask ((__v4df) __A, (__v4df) __W, (__mmask8) __U); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_maskz_expand_pd (__mmask8 __U, __m256d __A) { return (__m256d) __builtin_ia32_expanddf256_mask ((__v4df) __A, (__v4df) _mm256_setzero_pd (), (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_expand_epi64 (__m128i __W, __mmask8 __U, __m128i __A) { return (__m128i) __builtin_ia32_expanddi128_mask ((__v2di) __A, (__v2di) __W, (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_expand_epi64 (__mmask8 __U, __m128i __A) { return (__m128i) __builtin_ia32_expanddi128_mask ((__v2di) __A, (__v2di) _mm_setzero_si128 (), (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_expand_epi64 (__m256i __W, __mmask8 __U, __m256i __A) { return (__m256i) __builtin_ia32_expanddi256_mask ((__v4di) __A, (__v4di) __W, (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_expand_epi64 (__mmask8 __U, __m256i __A) { return (__m256i) __builtin_ia32_expanddi256_mask ((__v4di) __A, (__v4di) _mm256_setzero_si256 (), (__mmask8) __U); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask_expandloadu_pd (__m128d __W, __mmask8 __U, void const *__P) { return (__m128d) __builtin_ia32_expandloaddf128_mask ((__v2df *) __P, (__v2df) __W, (__mmask8) __U); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_maskz_expandloadu_pd (__mmask8 __U, void const *__P) { return (__m128d) __builtin_ia32_expandloaddf128_mask ((__v2df *) __P, (__v2df) _mm_setzero_pd (), (__mmask8) __U); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_mask_expandloadu_pd (__m256d __W, __mmask8 __U, void const *__P) { return (__m256d) __builtin_ia32_expandloaddf256_mask ((__v4df *) __P, (__v4df) __W, (__mmask8) __U); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_maskz_expandloadu_pd (__mmask8 __U, void const *__P) { return (__m256d) __builtin_ia32_expandloaddf256_mask ((__v4df *) __P, (__v4df) _mm256_setzero_pd (), (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_expandloadu_epi64 (__m128i __W, __mmask8 __U, void const *__P) { return (__m128i) __builtin_ia32_expandloaddi128_mask ((__v2di *) __P, (__v2di) __W, (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_expandloadu_epi64 (__mmask8 __U, void const *__P) { return (__m128i) __builtin_ia32_expandloaddi128_mask ((__v2di *) __P, (__v2di) _mm_setzero_si128 (), (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_expandloadu_epi64 (__m256i __W, __mmask8 __U, void const *__P) { return (__m256i) __builtin_ia32_expandloaddi256_mask ((__v4di *) __P, (__v4di) __W, (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_expandloadu_epi64 (__mmask8 __U, void const *__P) { return (__m256i) __builtin_ia32_expandloaddi256_mask ((__v4di *) __P, (__v4di) _mm256_setzero_si256 (), (__mmask8) __U); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask_expandloadu_ps (__m128 __W, __mmask8 __U, void const *__P) { return (__m128) __builtin_ia32_expandloadsf128_mask ((__v4sf *) __P, (__v4sf) __W, (__mmask8) __U); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maskz_expandloadu_ps (__mmask8 __U, void const *__P) { return (__m128) __builtin_ia32_expandloadsf128_mask ((__v4sf *) __P, (__v4sf) _mm_setzero_ps (), (__mmask8) __U); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_mask_expandloadu_ps (__m256 __W, __mmask8 __U, void const *__P) { return (__m256) __builtin_ia32_expandloadsf256_mask ((__v8sf *) __P, (__v8sf) __W, (__mmask8) __U); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_maskz_expandloadu_ps (__mmask8 __U, void const *__P) { return (__m256) __builtin_ia32_expandloadsf256_mask ((__v8sf *) __P, (__v8sf) _mm256_setzero_ps (), (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_expandloadu_epi32 (__m128i __W, __mmask8 __U, void const *__P) { return (__m128i) __builtin_ia32_expandloadsi128_mask ((__v4si *) __P, (__v4si) __W, (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_expandloadu_epi32 (__mmask8 __U, void const *__P) { return (__m128i) __builtin_ia32_expandloadsi128_mask ((__v4si *) __P, (__v4si) _mm_setzero_si128 (), (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_expandloadu_epi32 (__m256i __W, __mmask8 __U, void const *__P) { return (__m256i) __builtin_ia32_expandloadsi256_mask ((__v8si *) __P, (__v8si) __W, (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_expandloadu_epi32 (__mmask8 __U, void const *__P) { return (__m256i) __builtin_ia32_expandloadsi256_mask ((__v8si *) __P, (__v8si) _mm256_setzero_si256 (), (__mmask8) __U); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask_expand_ps (__m128 __W, __mmask8 __U, __m128 __A) { return (__m128) __builtin_ia32_expandsf128_mask ((__v4sf) __A, (__v4sf) __W, (__mmask8) __U); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maskz_expand_ps (__mmask8 __U, __m128 __A) { return (__m128) __builtin_ia32_expandsf128_mask ((__v4sf) __A, (__v4sf) _mm_setzero_ps (), (__mmask8) __U); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_mask_expand_ps (__m256 __W, __mmask8 __U, __m256 __A) { return (__m256) __builtin_ia32_expandsf256_mask ((__v8sf) __A, (__v8sf) __W, (__mmask8) __U); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_maskz_expand_ps (__mmask8 __U, __m256 __A) { return (__m256) __builtin_ia32_expandsf256_mask ((__v8sf) __A, (__v8sf) _mm256_setzero_ps (), (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_expand_epi32 (__m128i __W, __mmask8 __U, __m128i __A) { return (__m128i) __builtin_ia32_expandsi128_mask ((__v4si) __A, (__v4si) __W, (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_expand_epi32 (__mmask8 __U, __m128i __A) { return (__m128i) __builtin_ia32_expandsi128_mask ((__v4si) __A, (__v4si) _mm_setzero_si128 (), (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_expand_epi32 (__m256i __W, __mmask8 __U, __m256i __A) { return (__m256i) __builtin_ia32_expandsi256_mask ((__v8si) __A, (__v8si) __W, (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_expand_epi32 (__mmask8 __U, __m256i __A) { return (__m256i) __builtin_ia32_expandsi256_mask ((__v8si) __A, (__v8si) _mm256_setzero_si256 (), (__mmask8) __U); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_getexp_pd (__m128d __A) { return (__m128d) __builtin_ia32_getexppd128_mask ((__v2df) __A, (__v2df) _mm_setzero_pd (), (__mmask8) -1); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask_getexp_pd (__m128d __W, __mmask8 __U, __m128d __A) { return (__m128d) __builtin_ia32_getexppd128_mask ((__v2df) __A, (__v2df) __W, (__mmask8) __U); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_maskz_getexp_pd (__mmask8 __U, __m128d __A) { return (__m128d) __builtin_ia32_getexppd128_mask ((__v2df) __A, (__v2df) _mm_setzero_pd (), (__mmask8) __U); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_getexp_pd (__m256d __A) { return (__m256d) __builtin_ia32_getexppd256_mask ((__v4df) __A, (__v4df) _mm256_setzero_pd (), (__mmask8) -1); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_mask_getexp_pd (__m256d __W, __mmask8 __U, __m256d __A) { return (__m256d) __builtin_ia32_getexppd256_mask ((__v4df) __A, (__v4df) __W, (__mmask8) __U); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_maskz_getexp_pd (__mmask8 __U, __m256d __A) { return (__m256d) __builtin_ia32_getexppd256_mask ((__v4df) __A, (__v4df) _mm256_setzero_pd (), (__mmask8) __U); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_getexp_ps (__m128 __A) { return (__m128) __builtin_ia32_getexpps128_mask ((__v4sf) __A, (__v4sf) _mm_setzero_ps (), (__mmask8) -1); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask_getexp_ps (__m128 __W, __mmask8 __U, __m128 __A) { return (__m128) __builtin_ia32_getexpps128_mask ((__v4sf) __A, (__v4sf) __W, (__mmask8) __U); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maskz_getexp_ps (__mmask8 __U, __m128 __A) { return (__m128) __builtin_ia32_getexpps128_mask ((__v4sf) __A, (__v4sf) _mm_setzero_ps (), (__mmask8) __U); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_getexp_ps (__m256 __A) { return (__m256) __builtin_ia32_getexpps256_mask ((__v8sf) __A, (__v8sf) _mm256_setzero_ps (), (__mmask8) -1); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_mask_getexp_ps (__m256 __W, __mmask8 __U, __m256 __A) { return (__m256) __builtin_ia32_getexpps256_mask ((__v8sf) __A, (__v8sf) __W, (__mmask8) __U); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_maskz_getexp_ps (__mmask8 __U, __m256 __A) { return (__m256) __builtin_ia32_getexpps256_mask ((__v8sf) __A, (__v8sf) _mm256_setzero_ps (), (__mmask8) __U); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask_max_pd(__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U, (__v2df)_mm_max_pd(__A, __B), (__v2df)__W); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_maskz_max_pd(__mmask8 __U, __m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U, (__v2df)_mm_max_pd(__A, __B), (__v2df)_mm_setzero_pd()); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_mask_max_pd(__m256d __W, __mmask8 __U, __m256d __A, __m256d __B) { return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U, (__v4df)_mm256_max_pd(__A, __B), (__v4df)__W); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_maskz_max_pd(__mmask8 __U, __m256d __A, __m256d __B) { return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U, (__v4df)_mm256_max_pd(__A, __B), (__v4df)_mm256_setzero_pd()); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask_max_ps(__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) { return (__m128)__builtin_ia32_selectps_128((__mmask8)__U, (__v4sf)_mm_max_ps(__A, __B), (__v4sf)__W); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maskz_max_ps(__mmask8 __U, __m128 __A, __m128 __B) { return (__m128)__builtin_ia32_selectps_128((__mmask8)__U, (__v4sf)_mm_max_ps(__A, __B), (__v4sf)_mm_setzero_ps()); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_mask_max_ps(__m256 __W, __mmask8 __U, __m256 __A, __m256 __B) { return (__m256)__builtin_ia32_selectps_256((__mmask8)__U, (__v8sf)_mm256_max_ps(__A, __B), (__v8sf)__W); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_maskz_max_ps(__mmask8 __U, __m256 __A, __m256 __B) { return (__m256)__builtin_ia32_selectps_256((__mmask8)__U, (__v8sf)_mm256_max_ps(__A, __B), (__v8sf)_mm256_setzero_ps()); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask_min_pd(__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U, (__v2df)_mm_min_pd(__A, __B), (__v2df)__W); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_maskz_min_pd(__mmask8 __U, __m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U, (__v2df)_mm_min_pd(__A, __B), (__v2df)_mm_setzero_pd()); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_mask_min_pd(__m256d __W, __mmask8 __U, __m256d __A, __m256d __B) { return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U, (__v4df)_mm256_min_pd(__A, __B), (__v4df)__W); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_maskz_min_pd(__mmask8 __U, __m256d __A, __m256d __B) { return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U, (__v4df)_mm256_min_pd(__A, __B), (__v4df)_mm256_setzero_pd()); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask_min_ps(__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) { return (__m128)__builtin_ia32_selectps_128((__mmask8)__U, (__v4sf)_mm_min_ps(__A, __B), (__v4sf)__W); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maskz_min_ps(__mmask8 __U, __m128 __A, __m128 __B) { return (__m128)__builtin_ia32_selectps_128((__mmask8)__U, (__v4sf)_mm_min_ps(__A, __B), (__v4sf)_mm_setzero_ps()); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_mask_min_ps(__m256 __W, __mmask8 __U, __m256 __A, __m256 __B) { return (__m256)__builtin_ia32_selectps_256((__mmask8)__U, (__v8sf)_mm256_min_ps(__A, __B), (__v8sf)__W); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_maskz_min_ps(__mmask8 __U, __m256 __A, __m256 __B) { return (__m256)__builtin_ia32_selectps_256((__mmask8)__U, (__v8sf)_mm256_min_ps(__A, __B), (__v8sf)_mm256_setzero_ps()); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask_mul_pd(__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U, (__v2df)_mm_mul_pd(__A, __B), (__v2df)__W); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_maskz_mul_pd(__mmask8 __U, __m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U, (__v2df)_mm_mul_pd(__A, __B), (__v2df)_mm_setzero_pd()); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_mask_mul_pd(__m256d __W, __mmask8 __U, __m256d __A, __m256d __B) { return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U, (__v4df)_mm256_mul_pd(__A, __B), (__v4df)__W); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_maskz_mul_pd(__mmask8 __U, __m256d __A, __m256d __B) { return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U, (__v4df)_mm256_mul_pd(__A, __B), (__v4df)_mm256_setzero_pd()); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask_mul_ps(__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) { return (__m128)__builtin_ia32_selectps_128((__mmask8)__U, (__v4sf)_mm_mul_ps(__A, __B), (__v4sf)__W); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maskz_mul_ps(__mmask8 __U, __m128 __A, __m128 __B) { return (__m128)__builtin_ia32_selectps_128((__mmask8)__U, (__v4sf)_mm_mul_ps(__A, __B), (__v4sf)_mm_setzero_ps()); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_mask_mul_ps(__m256 __W, __mmask8 __U, __m256 __A, __m256 __B) { return (__m256)__builtin_ia32_selectps_256((__mmask8)__U, (__v8sf)_mm256_mul_ps(__A, __B), (__v8sf)__W); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_maskz_mul_ps(__mmask8 __U, __m256 __A, __m256 __B) { return (__m256)__builtin_ia32_selectps_256((__mmask8)__U, (__v8sf)_mm256_mul_ps(__A, __B), (__v8sf)_mm256_setzero_ps()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_abs_epi32(__m128i __W, __mmask8 __U, __m128i __A) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U, (__v4si)_mm_abs_epi32(__A), (__v4si)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_abs_epi32(__mmask8 __U, __m128i __A) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U, (__v4si)_mm_abs_epi32(__A), (__v4si)_mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_abs_epi32(__m256i __W, __mmask8 __U, __m256i __A) { return (__m256i)__builtin_ia32_selectd_256((__mmask16)__U, (__v8si)_mm256_abs_epi32(__A), (__v8si)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_abs_epi32(__mmask8 __U, __m256i __A) { return (__m256i)__builtin_ia32_selectd_256((__mmask16)__U, (__v8si)_mm256_abs_epi32(__A), (__v8si)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_abs_epi64 (__m128i __A) { return (__m128i) __builtin_ia32_pabsq128_mask ((__v2di) __A, (__v2di) _mm_setzero_si128 (), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_abs_epi64 (__m128i __W, __mmask8 __U, __m128i __A) { return (__m128i) __builtin_ia32_pabsq128_mask ((__v2di) __A, (__v2di) __W, (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_abs_epi64 (__mmask8 __U, __m128i __A) { return (__m128i) __builtin_ia32_pabsq128_mask ((__v2di) __A, (__v2di) _mm_setzero_si128 (), (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_abs_epi64 (__m256i __A) { return (__m256i) __builtin_ia32_pabsq256_mask ((__v4di) __A, (__v4di) _mm256_setzero_si256 (), (__mmask8) -1); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_abs_epi64 (__m256i __W, __mmask8 __U, __m256i __A) { return (__m256i) __builtin_ia32_pabsq256_mask ((__v4di) __A, (__v4di) __W, (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_abs_epi64 (__mmask8 __U, __m256i __A) { return (__m256i) __builtin_ia32_pabsq256_mask ((__v4di) __A, (__v4di) _mm256_setzero_si256 (), (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_max_epi32(__mmask8 __M, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__M, (__v4si)_mm_max_epi32(__A, __B), (__v4si)_mm_setzero_si128()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_max_epi32(__m128i __W, __mmask8 __M, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__M, (__v4si)_mm_max_epi32(__A, __B), (__v4si)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_max_epi32(__mmask8 __M, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__M, (__v8si)_mm256_max_epi32(__A, __B), (__v8si)_mm256_setzero_si256()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_max_epi32(__m256i __W, __mmask8 __M, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__M, (__v8si)_mm256_max_epi32(__A, __B), (__v8si)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_max_epi64 (__mmask8 __M, __m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_pmaxsq128_mask ((__v2di) __A, (__v2di) __B, (__v2di) _mm_setzero_si128 (), __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_max_epi64 (__m128i __W, __mmask8 __M, __m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_pmaxsq128_mask ((__v2di) __A, (__v2di) __B, (__v2di) __W, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_max_epi64 (__m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_pmaxsq128_mask ((__v2di) __A, (__v2di) __B, (__v2di) _mm_setzero_si128 (), (__mmask8) -1); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_max_epi64 (__mmask8 __M, __m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_pmaxsq256_mask ((__v4di) __A, (__v4di) __B, (__v4di) _mm256_setzero_si256 (), __M); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_max_epi64 (__m256i __W, __mmask8 __M, __m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_pmaxsq256_mask ((__v4di) __A, (__v4di) __B, (__v4di) __W, __M); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_max_epi64 (__m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_pmaxsq256_mask ((__v4di) __A, (__v4di) __B, (__v4di) _mm256_setzero_si256 (), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_max_epu32(__mmask8 __M, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__M, (__v4si)_mm_max_epu32(__A, __B), (__v4si)_mm_setzero_si128()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_max_epu32(__m128i __W, __mmask8 __M, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__M, (__v4si)_mm_max_epu32(__A, __B), (__v4si)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_max_epu32(__mmask8 __M, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__M, (__v8si)_mm256_max_epu32(__A, __B), (__v8si)_mm256_setzero_si256()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_max_epu32(__m256i __W, __mmask8 __M, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__M, (__v8si)_mm256_max_epu32(__A, __B), (__v8si)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_max_epu64 (__mmask8 __M, __m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_pmaxuq128_mask ((__v2di) __A, (__v2di) __B, (__v2di) _mm_setzero_si128 (), __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_max_epu64 (__m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_pmaxuq128_mask ((__v2di) __A, (__v2di) __B, (__v2di) _mm_setzero_si128 (), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_max_epu64 (__m128i __W, __mmask8 __M, __m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_pmaxuq128_mask ((__v2di) __A, (__v2di) __B, (__v2di) __W, __M); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_max_epu64 (__mmask8 __M, __m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_pmaxuq256_mask ((__v4di) __A, (__v4di) __B, (__v4di) _mm256_setzero_si256 (), __M); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_max_epu64 (__m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_pmaxuq256_mask ((__v4di) __A, (__v4di) __B, (__v4di) _mm256_setzero_si256 (), (__mmask8) -1); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_max_epu64 (__m256i __W, __mmask8 __M, __m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_pmaxuq256_mask ((__v4di) __A, (__v4di) __B, (__v4di) __W, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_min_epi32(__mmask8 __M, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__M, (__v4si)_mm_min_epi32(__A, __B), (__v4si)_mm_setzero_si128()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_min_epi32(__m128i __W, __mmask8 __M, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__M, (__v4si)_mm_min_epi32(__A, __B), (__v4si)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_min_epi32(__mmask8 __M, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__M, (__v8si)_mm256_min_epi32(__A, __B), (__v8si)_mm256_setzero_si256()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_min_epi32(__m256i __W, __mmask8 __M, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__M, (__v8si)_mm256_min_epi32(__A, __B), (__v8si)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_min_epi64 (__m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_pminsq128_mask ((__v2di) __A, (__v2di) __B, (__v2di) _mm_setzero_si128 (), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_min_epi64 (__m128i __W, __mmask8 __M, __m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_pminsq128_mask ((__v2di) __A, (__v2di) __B, (__v2di) __W, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_min_epi64 (__mmask8 __M, __m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_pminsq128_mask ((__v2di) __A, (__v2di) __B, (__v2di) _mm_setzero_si128 (), __M); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_min_epi64 (__m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_pminsq256_mask ((__v4di) __A, (__v4di) __B, (__v4di) _mm256_setzero_si256 (), (__mmask8) -1); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_min_epi64 (__m256i __W, __mmask8 __M, __m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_pminsq256_mask ((__v4di) __A, (__v4di) __B, (__v4di) __W, __M); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_min_epi64 (__mmask8 __M, __m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_pminsq256_mask ((__v4di) __A, (__v4di) __B, (__v4di) _mm256_setzero_si256 (), __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_min_epu32(__mmask8 __M, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__M, (__v4si)_mm_min_epu32(__A, __B), (__v4si)_mm_setzero_si128()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_min_epu32(__m128i __W, __mmask8 __M, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__M, (__v4si)_mm_min_epu32(__A, __B), (__v4si)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_min_epu32(__mmask8 __M, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__M, (__v8si)_mm256_min_epu32(__A, __B), (__v8si)_mm256_setzero_si256()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_min_epu32(__m256i __W, __mmask8 __M, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__M, (__v8si)_mm256_min_epu32(__A, __B), (__v8si)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_min_epu64 (__m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_pminuq128_mask ((__v2di) __A, (__v2di) __B, (__v2di) _mm_setzero_si128 (), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_min_epu64 (__m128i __W, __mmask8 __M, __m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_pminuq128_mask ((__v2di) __A, (__v2di) __B, (__v2di) __W, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_min_epu64 (__mmask8 __M, __m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_pminuq128_mask ((__v2di) __A, (__v2di) __B, (__v2di) _mm_setzero_si128 (), __M); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_min_epu64 (__m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_pminuq256_mask ((__v4di) __A, (__v4di) __B, (__v4di) _mm256_setzero_si256 (), (__mmask8) -1); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_min_epu64 (__m256i __W, __mmask8 __M, __m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_pminuq256_mask ((__v4di) __A, (__v4di) __B, (__v4di) __W, __M); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_min_epu64 (__mmask8 __M, __m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_pminuq256_mask ((__v4di) __A, (__v4di) __B, (__v4di) _mm256_setzero_si256 (), __M); } #define _mm_roundscale_pd(A, imm) __extension__ ({ \ (__m128d)__builtin_ia32_rndscalepd_128_mask((__v2df)(__m128d)(A), \ (int)(imm), \ (__v2df)_mm_setzero_pd(), \ (__mmask8)-1); }) #define _mm_mask_roundscale_pd(W, U, A, imm) __extension__ ({ \ (__m128d)__builtin_ia32_rndscalepd_128_mask((__v2df)(__m128d)(A), \ (int)(imm), \ (__v2df)(__m128d)(W), \ (__mmask8)(U)); }) #define _mm_maskz_roundscale_pd(U, A, imm) __extension__ ({ \ (__m128d)__builtin_ia32_rndscalepd_128_mask((__v2df)(__m128d)(A), \ (int)(imm), \ (__v2df)_mm_setzero_pd(), \ (__mmask8)(U)); }) #define _mm256_roundscale_pd(A, imm) __extension__ ({ \ (__m256d)__builtin_ia32_rndscalepd_256_mask((__v4df)(__m256d)(A), \ (int)(imm), \ (__v4df)_mm256_setzero_pd(), \ (__mmask8)-1); }) #define _mm256_mask_roundscale_pd(W, U, A, imm) __extension__ ({ \ (__m256d)__builtin_ia32_rndscalepd_256_mask((__v4df)(__m256d)(A), \ (int)(imm), \ (__v4df)(__m256d)(W), \ (__mmask8)(U)); }) #define _mm256_maskz_roundscale_pd(U, A, imm) __extension__ ({ \ (__m256d)__builtin_ia32_rndscalepd_256_mask((__v4df)(__m256d)(A), \ (int)(imm), \ (__v4df)_mm256_setzero_pd(), \ (__mmask8)(U)); }) #define _mm_roundscale_ps(A, imm) __extension__ ({ \ (__m128)__builtin_ia32_rndscaleps_128_mask((__v4sf)(__m128)(A), (int)(imm), \ (__v4sf)_mm_setzero_ps(), \ (__mmask8)-1); }) #define _mm_mask_roundscale_ps(W, U, A, imm) __extension__ ({ \ (__m128)__builtin_ia32_rndscaleps_128_mask((__v4sf)(__m128)(A), (int)(imm), \ (__v4sf)(__m128)(W), \ (__mmask8)(U)); }) #define _mm_maskz_roundscale_ps(U, A, imm) __extension__ ({ \ (__m128)__builtin_ia32_rndscaleps_128_mask((__v4sf)(__m128)(A), (int)(imm), \ (__v4sf)_mm_setzero_ps(), \ (__mmask8)(U)); }) #define _mm256_roundscale_ps(A, imm) __extension__ ({ \ (__m256)__builtin_ia32_rndscaleps_256_mask((__v8sf)(__m256)(A), (int)(imm), \ (__v8sf)_mm256_setzero_ps(), \ (__mmask8)-1); }) #define _mm256_mask_roundscale_ps(W, U, A, imm) __extension__ ({ \ (__m256)__builtin_ia32_rndscaleps_256_mask((__v8sf)(__m256)(A), (int)(imm), \ (__v8sf)(__m256)(W), \ (__mmask8)(U)); }) #define _mm256_maskz_roundscale_ps(U, A, imm) __extension__ ({ \ (__m256)__builtin_ia32_rndscaleps_256_mask((__v8sf)(__m256)(A), (int)(imm), \ (__v8sf)_mm256_setzero_ps(), \ (__mmask8)(U)); }) static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_scalef_pd (__m128d __A, __m128d __B) { return (__m128d) __builtin_ia32_scalefpd128_mask ((__v2df) __A, (__v2df) __B, (__v2df) _mm_setzero_pd (), (__mmask8) -1); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask_scalef_pd (__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) { return (__m128d) __builtin_ia32_scalefpd128_mask ((__v2df) __A, (__v2df) __B, (__v2df) __W, (__mmask8) __U); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_maskz_scalef_pd (__mmask8 __U, __m128d __A, __m128d __B) { return (__m128d) __builtin_ia32_scalefpd128_mask ((__v2df) __A, (__v2df) __B, (__v2df) _mm_setzero_pd (), (__mmask8) __U); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_scalef_pd (__m256d __A, __m256d __B) { return (__m256d) __builtin_ia32_scalefpd256_mask ((__v4df) __A, (__v4df) __B, (__v4df) _mm256_setzero_pd (), (__mmask8) -1); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_mask_scalef_pd (__m256d __W, __mmask8 __U, __m256d __A, __m256d __B) { return (__m256d) __builtin_ia32_scalefpd256_mask ((__v4df) __A, (__v4df) __B, (__v4df) __W, (__mmask8) __U); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_maskz_scalef_pd (__mmask8 __U, __m256d __A, __m256d __B) { return (__m256d) __builtin_ia32_scalefpd256_mask ((__v4df) __A, (__v4df) __B, (__v4df) _mm256_setzero_pd (), (__mmask8) __U); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_scalef_ps (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_scalefps128_mask ((__v4sf) __A, (__v4sf) __B, (__v4sf) _mm_setzero_ps (), (__mmask8) -1); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask_scalef_ps (__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) { return (__m128) __builtin_ia32_scalefps128_mask ((__v4sf) __A, (__v4sf) __B, (__v4sf) __W, (__mmask8) __U); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maskz_scalef_ps (__mmask8 __U, __m128 __A, __m128 __B) { return (__m128) __builtin_ia32_scalefps128_mask ((__v4sf) __A, (__v4sf) __B, (__v4sf) _mm_setzero_ps (), (__mmask8) __U); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_scalef_ps (__m256 __A, __m256 __B) { return (__m256) __builtin_ia32_scalefps256_mask ((__v8sf) __A, (__v8sf) __B, (__v8sf) _mm256_setzero_ps (), (__mmask8) -1); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_mask_scalef_ps (__m256 __W, __mmask8 __U, __m256 __A, __m256 __B) { return (__m256) __builtin_ia32_scalefps256_mask ((__v8sf) __A, (__v8sf) __B, (__v8sf) __W, (__mmask8) __U); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_maskz_scalef_ps (__mmask8 __U, __m256 __A, __m256 __B) { return (__m256) __builtin_ia32_scalefps256_mask ((__v8sf) __A, (__v8sf) __B, (__v8sf) _mm256_setzero_ps (), (__mmask8) __U); } #define _mm_i64scatter_pd(addr, index, v1, scale) __extension__ ({ \ __builtin_ia32_scatterdiv2df((double *)(addr), (__mmask8)-1, \ (__v2di)(__m128i)(index), \ (__v2df)(__m128d)(v1), (int)(scale)); }) #define _mm_mask_i64scatter_pd(addr, mask, index, v1, scale) __extension__ ({ \ __builtin_ia32_scatterdiv2df((double *)(addr), (__mmask8)(mask), \ (__v2di)(__m128i)(index), \ (__v2df)(__m128d)(v1), (int)(scale)); }) #define _mm_i64scatter_epi64(addr, index, v1, scale) __extension__ ({ \ __builtin_ia32_scatterdiv2di((long long *)(addr), (__mmask8)-1, \ (__v2di)(__m128i)(index), \ (__v2di)(__m128i)(v1), (int)(scale)); }) #define _mm_mask_i64scatter_epi64(addr, mask, index, v1, scale) __extension__ ({ \ __builtin_ia32_scatterdiv2di((long long *)(addr), (__mmask8)(mask), \ (__v2di)(__m128i)(index), \ (__v2di)(__m128i)(v1), (int)(scale)); }) #define _mm256_i64scatter_pd(addr, index, v1, scale) __extension__ ({ \ __builtin_ia32_scatterdiv4df((double *)(addr), (__mmask8)-1, \ (__v4di)(__m256i)(index), \ (__v4df)(__m256d)(v1), (int)(scale)); }) #define _mm256_mask_i64scatter_pd(addr, mask, index, v1, scale) __extension__ ({ \ __builtin_ia32_scatterdiv4df((double *)(addr), (__mmask8)(mask), \ (__v4di)(__m256i)(index), \ (__v4df)(__m256d)(v1), (int)(scale)); }) #define _mm256_i64scatter_epi64(addr, index, v1, scale) __extension__ ({ \ __builtin_ia32_scatterdiv4di((long long *)(addr), (__mmask8)-1, \ (__v4di)(__m256i)(index), \ (__v4di)(__m256i)(v1), (int)(scale)); }) #define _mm256_mask_i64scatter_epi64(addr, mask, index, v1, scale) __extension__ ({ \ __builtin_ia32_scatterdiv4di((long long *)(addr), (__mmask8)(mask), \ (__v4di)(__m256i)(index), \ (__v4di)(__m256i)(v1), (int)(scale)); }) #define _mm_i64scatter_ps(addr, index, v1, scale) __extension__ ({ \ __builtin_ia32_scatterdiv4sf((float *)(addr), (__mmask8)-1, \ (__v2di)(__m128i)(index), (__v4sf)(__m128)(v1), \ (int)(scale)); }) #define _mm_mask_i64scatter_ps(addr, mask, index, v1, scale) __extension__ ({ \ __builtin_ia32_scatterdiv4sf((float *)(addr), (__mmask8)(mask), \ (__v2di)(__m128i)(index), (__v4sf)(__m128)(v1), \ (int)(scale)); }) #define _mm_i64scatter_epi32(addr, index, v1, scale) __extension__ ({ \ __builtin_ia32_scatterdiv4si((int *)(addr), (__mmask8)-1, \ (__v2di)(__m128i)(index), \ (__v4si)(__m128i)(v1), (int)(scale)); }) #define _mm_mask_i64scatter_epi32(addr, mask, index, v1, scale) __extension__ ({ \ __builtin_ia32_scatterdiv4si((int *)(addr), (__mmask8)(mask), \ (__v2di)(__m128i)(index), \ (__v4si)(__m128i)(v1), (int)(scale)); }) #define _mm256_i64scatter_ps(addr, index, v1, scale) __extension__ ({ \ __builtin_ia32_scatterdiv8sf((float *)(addr), (__mmask8)-1, \ (__v4di)(__m256i)(index), (__v4sf)(__m128)(v1), \ (int)(scale)); }) #define _mm256_mask_i64scatter_ps(addr, mask, index, v1, scale) __extension__ ({ \ __builtin_ia32_scatterdiv8sf((float *)(addr), (__mmask8)(mask), \ (__v4di)(__m256i)(index), (__v4sf)(__m128)(v1), \ (int)(scale)); }) #define _mm256_i64scatter_epi32(addr, index, v1, scale) __extension__ ({ \ __builtin_ia32_scatterdiv8si((int *)(addr), (__mmask8)-1, \ (__v4di)(__m256i)(index), \ (__v4si)(__m128i)(v1), (int)(scale)); }) #define _mm256_mask_i64scatter_epi32(addr, mask, index, v1, scale) __extension__ ({ \ __builtin_ia32_scatterdiv8si((int *)(addr), (__mmask8)(mask), \ (__v4di)(__m256i)(index), \ (__v4si)(__m128i)(v1), (int)(scale)); }) #define _mm_i32scatter_pd(addr, index, v1, scale) __extension__ ({ \ __builtin_ia32_scattersiv2df((double *)(addr), (__mmask8)-1, \ (__v4si)(__m128i)(index), \ (__v2df)(__m128d)(v1), (int)(scale)); }) #define _mm_mask_i32scatter_pd(addr, mask, index, v1, scale) __extension__ ({ \ __builtin_ia32_scattersiv2df((double *)(addr), (__mmask8)(mask), \ (__v4si)(__m128i)(index), \ (__v2df)(__m128d)(v1), (int)(scale)); }) #define _mm_i32scatter_epi64(addr, index, v1, scale) __extension__ ({ \ __builtin_ia32_scattersiv2di((long long *)(addr), (__mmask8)-1, \ (__v4si)(__m128i)(index), \ (__v2di)(__m128i)(v1), (int)(scale)); }) #define _mm_mask_i32scatter_epi64(addr, mask, index, v1, scale) __extension__ ({ \ __builtin_ia32_scattersiv2di((long long *)(addr), (__mmask8)(mask), \ (__v4si)(__m128i)(index), \ (__v2di)(__m128i)(v1), (int)(scale)); }) #define _mm256_i32scatter_pd(addr, index, v1, scale) __extension__ ({ \ __builtin_ia32_scattersiv4df((double *)(addr), (__mmask8)-1, \ (__v4si)(__m128i)(index), \ (__v4df)(__m256d)(v1), (int)(scale)); }) #define _mm256_mask_i32scatter_pd(addr, mask, index, v1, scale) __extension__ ({ \ __builtin_ia32_scattersiv4df((double *)(addr), (__mmask8)(mask), \ (__v4si)(__m128i)(index), \ (__v4df)(__m256d)(v1), (int)(scale)); }) #define _mm256_i32scatter_epi64(addr, index, v1, scale) __extension__ ({ \ __builtin_ia32_scattersiv4di((long long *)(addr), (__mmask8)-1, \ (__v4si)(__m128i)(index), \ (__v4di)(__m256i)(v1), (int)(scale)); }) #define _mm256_mask_i32scatter_epi64(addr, mask, index, v1, scale) __extension__ ({ \ __builtin_ia32_scattersiv4di((long long *)(addr), (__mmask8)(mask), \ (__v4si)(__m128i)(index), \ (__v4di)(__m256i)(v1), (int)(scale)); }) #define _mm_i32scatter_ps(addr, index, v1, scale) __extension__ ({ \ __builtin_ia32_scattersiv4sf((float *)(addr), (__mmask8)-1, \ (__v4si)(__m128i)(index), (__v4sf)(__m128)(v1), \ (int)(scale)); }) #define _mm_mask_i32scatter_ps(addr, mask, index, v1, scale) __extension__ ({ \ __builtin_ia32_scattersiv4sf((float *)(addr), (__mmask8)(mask), \ (__v4si)(__m128i)(index), (__v4sf)(__m128)(v1), \ (int)(scale)); }) #define _mm_i32scatter_epi32(addr, index, v1, scale) __extension__ ({ \ __builtin_ia32_scattersiv4si((int *)(addr), (__mmask8)-1, \ (__v4si)(__m128i)(index), \ (__v4si)(__m128i)(v1), (int)(scale)); }) #define _mm_mask_i32scatter_epi32(addr, mask, index, v1, scale) __extension__ ({ \ __builtin_ia32_scattersiv4si((int *)(addr), (__mmask8)(mask), \ (__v4si)(__m128i)(index), \ (__v4si)(__m128i)(v1), (int)(scale)); }) #define _mm256_i32scatter_ps(addr, index, v1, scale) __extension__ ({ \ __builtin_ia32_scattersiv8sf((float *)(addr), (__mmask8)-1, \ (__v8si)(__m256i)(index), (__v8sf)(__m256)(v1), \ (int)(scale)); }) #define _mm256_mask_i32scatter_ps(addr, mask, index, v1, scale) __extension__ ({ \ __builtin_ia32_scattersiv8sf((float *)(addr), (__mmask8)(mask), \ (__v8si)(__m256i)(index), (__v8sf)(__m256)(v1), \ (int)(scale)); }) #define _mm256_i32scatter_epi32(addr, index, v1, scale) __extension__ ({ \ __builtin_ia32_scattersiv8si((int *)(addr), (__mmask8)-1, \ (__v8si)(__m256i)(index), \ (__v8si)(__m256i)(v1), (int)(scale)); }) #define _mm256_mask_i32scatter_epi32(addr, mask, index, v1, scale) __extension__ ({ \ __builtin_ia32_scattersiv8si((int *)(addr), (__mmask8)(mask), \ (__v8si)(__m256i)(index), \ (__v8si)(__m256i)(v1), (int)(scale)); }) static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask_sqrt_pd(__m128d __W, __mmask8 __U, __m128d __A) { return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U, (__v2df)_mm_sqrt_pd(__A), (__v2df)__W); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_maskz_sqrt_pd(__mmask8 __U, __m128d __A) { return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U, (__v2df)_mm_sqrt_pd(__A), (__v2df)_mm_setzero_pd()); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_mask_sqrt_pd(__m256d __W, __mmask8 __U, __m256d __A) { return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U, (__v4df)_mm256_sqrt_pd(__A), (__v4df)__W); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_maskz_sqrt_pd(__mmask8 __U, __m256d __A) { return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U, (__v4df)_mm256_sqrt_pd(__A), (__v4df)_mm256_setzero_pd()); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask_sqrt_ps(__m128 __W, __mmask8 __U, __m128 __A) { return (__m128)__builtin_ia32_selectps_128((__mmask8)__U, (__v4sf)_mm_sqrt_ps(__A), (__v4sf)__W); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maskz_sqrt_ps(__mmask8 __U, __m128 __A) { return (__m128)__builtin_ia32_selectps_128((__mmask8)__U, (__v4sf)_mm_sqrt_ps(__A), (__v4sf)_mm_setzero_pd()); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_mask_sqrt_ps(__m256 __W, __mmask8 __U, __m256 __A) { return (__m256)__builtin_ia32_selectps_256((__mmask8)__U, (__v8sf)_mm256_sqrt_ps(__A), (__v8sf)__W); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_maskz_sqrt_ps(__mmask8 __U, __m256 __A) { return (__m256)__builtin_ia32_selectps_256((__mmask8)__U, (__v8sf)_mm256_sqrt_ps(__A), (__v8sf)_mm256_setzero_ps()); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask_sub_pd(__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U, (__v2df)_mm_sub_pd(__A, __B), (__v2df)__W); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_maskz_sub_pd(__mmask8 __U, __m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U, (__v2df)_mm_sub_pd(__A, __B), (__v2df)_mm_setzero_pd()); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_mask_sub_pd(__m256d __W, __mmask8 __U, __m256d __A, __m256d __B) { return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U, (__v4df)_mm256_sub_pd(__A, __B), (__v4df)__W); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_maskz_sub_pd(__mmask8 __U, __m256d __A, __m256d __B) { return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U, (__v4df)_mm256_sub_pd(__A, __B), (__v4df)_mm256_setzero_pd()); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask_sub_ps(__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) { return (__m128)__builtin_ia32_selectps_128((__mmask8)__U, (__v4sf)_mm_sub_ps(__A, __B), (__v4sf)__W); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maskz_sub_ps(__mmask8 __U, __m128 __A, __m128 __B) { return (__m128)__builtin_ia32_selectps_128((__mmask8)__U, (__v4sf)_mm_sub_ps(__A, __B), (__v4sf)_mm_setzero_ps()); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_mask_sub_ps(__m256 __W, __mmask8 __U, __m256 __A, __m256 __B) { return (__m256)__builtin_ia32_selectps_256((__mmask8)__U, (__v8sf)_mm256_sub_ps(__A, __B), (__v8sf)__W); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_maskz_sub_ps(__mmask8 __U, __m256 __A, __m256 __B) { return (__m256)__builtin_ia32_selectps_256((__mmask8)__U, (__v8sf)_mm256_sub_ps(__A, __B), (__v8sf)_mm256_setzero_ps()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask2_permutex2var_epi32 (__m128i __A, __m128i __I, __mmask8 __U, __m128i __B) { return (__m128i) __builtin_ia32_vpermi2vard128_mask ((__v4si) __A, (__v4si) __I /* idx */ , (__v4si) __B, (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask2_permutex2var_epi32 (__m256i __A, __m256i __I, __mmask8 __U, __m256i __B) { return (__m256i) __builtin_ia32_vpermi2vard256_mask ((__v8si) __A, (__v8si) __I /* idx */ , (__v8si) __B, (__mmask8) __U); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask2_permutex2var_pd (__m128d __A, __m128i __I, __mmask8 __U, __m128d __B) { return (__m128d) __builtin_ia32_vpermi2varpd128_mask ((__v2df) __A, (__v2di) __I /* idx */ , (__v2df) __B, (__mmask8) __U); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_mask2_permutex2var_pd (__m256d __A, __m256i __I, __mmask8 __U, __m256d __B) { return (__m256d) __builtin_ia32_vpermi2varpd256_mask ((__v4df) __A, (__v4di) __I /* idx */ , (__v4df) __B, (__mmask8) __U); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask2_permutex2var_ps (__m128 __A, __m128i __I, __mmask8 __U, __m128 __B) { return (__m128) __builtin_ia32_vpermi2varps128_mask ((__v4sf) __A, (__v4si) __I /* idx */ , (__v4sf) __B, (__mmask8) __U); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_mask2_permutex2var_ps (__m256 __A, __m256i __I, __mmask8 __U, __m256 __B) { return (__m256) __builtin_ia32_vpermi2varps256_mask ((__v8sf) __A, (__v8si) __I /* idx */ , (__v8sf) __B, (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask2_permutex2var_epi64 (__m128i __A, __m128i __I, __mmask8 __U, __m128i __B) { return (__m128i) __builtin_ia32_vpermi2varq128_mask ((__v2di) __A, (__v2di) __I /* idx */ , (__v2di) __B, (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask2_permutex2var_epi64 (__m256i __A, __m256i __I, __mmask8 __U, __m256i __B) { return (__m256i) __builtin_ia32_vpermi2varq256_mask ((__v4di) __A, (__v4di) __I /* idx */ , (__v4di) __B, (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_permutex2var_epi32 (__m128i __A, __m128i __I, __m128i __B) { return (__m128i) __builtin_ia32_vpermt2vard128_mask ((__v4si) __I /* idx */ , (__v4si) __A, (__v4si) __B, (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_permutex2var_epi32 (__m128i __A, __mmask8 __U, __m128i __I, __m128i __B) { return (__m128i) __builtin_ia32_vpermt2vard128_mask ((__v4si) __I /* idx */ , (__v4si) __A, (__v4si) __B, (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_permutex2var_epi32 (__mmask8 __U, __m128i __A, __m128i __I, __m128i __B) { return (__m128i) __builtin_ia32_vpermt2vard128_maskz ((__v4si) __I /* idx */ , (__v4si) __A, (__v4si) __B, (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_permutex2var_epi32 (__m256i __A, __m256i __I, __m256i __B) { return (__m256i) __builtin_ia32_vpermt2vard256_mask ((__v8si) __I /* idx */ , (__v8si) __A, (__v8si) __B, (__mmask8) -1); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_permutex2var_epi32 (__m256i __A, __mmask8 __U, __m256i __I, __m256i __B) { return (__m256i) __builtin_ia32_vpermt2vard256_mask ((__v8si) __I /* idx */ , (__v8si) __A, (__v8si) __B, (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_permutex2var_epi32 (__mmask8 __U, __m256i __A, __m256i __I, __m256i __B) { return (__m256i) __builtin_ia32_vpermt2vard256_maskz ((__v8si) __I /* idx */ , (__v8si) __A, (__v8si) __B, (__mmask8) __U); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_permutex2var_pd (__m128d __A, __m128i __I, __m128d __B) { return (__m128d) __builtin_ia32_vpermt2varpd128_mask ((__v2di) __I /* idx */ , (__v2df) __A, (__v2df) __B, (__mmask8) - 1); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask_permutex2var_pd (__m128d __A, __mmask8 __U, __m128i __I, __m128d __B) { return (__m128d) __builtin_ia32_vpermt2varpd128_mask ((__v2di) __I /* idx */ , (__v2df) __A, (__v2df) __B, (__mmask8) __U); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_maskz_permutex2var_pd (__mmask8 __U, __m128d __A, __m128i __I, __m128d __B) { return (__m128d) __builtin_ia32_vpermt2varpd128_maskz ((__v2di) __I /* idx */ , (__v2df) __A, (__v2df) __B, (__mmask8) __U); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_permutex2var_pd (__m256d __A, __m256i __I, __m256d __B) { return (__m256d) __builtin_ia32_vpermt2varpd256_mask ((__v4di) __I /* idx */ , (__v4df) __A, (__v4df) __B, (__mmask8) - 1); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_mask_permutex2var_pd (__m256d __A, __mmask8 __U, __m256i __I, __m256d __B) { return (__m256d) __builtin_ia32_vpermt2varpd256_mask ((__v4di) __I /* idx */ , (__v4df) __A, (__v4df) __B, (__mmask8) __U); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_maskz_permutex2var_pd (__mmask8 __U, __m256d __A, __m256i __I, __m256d __B) { return (__m256d) __builtin_ia32_vpermt2varpd256_maskz ((__v4di) __I /* idx */ , (__v4df) __A, (__v4df) __B, (__mmask8) __U); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_permutex2var_ps (__m128 __A, __m128i __I, __m128 __B) { return (__m128) __builtin_ia32_vpermt2varps128_mask ((__v4si) __I /* idx */ , (__v4sf) __A, (__v4sf) __B, (__mmask8) -1); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask_permutex2var_ps (__m128 __A, __mmask8 __U, __m128i __I, __m128 __B) { return (__m128) __builtin_ia32_vpermt2varps128_mask ((__v4si) __I /* idx */ , (__v4sf) __A, (__v4sf) __B, (__mmask8) __U); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maskz_permutex2var_ps (__mmask8 __U, __m128 __A, __m128i __I, __m128 __B) { return (__m128) __builtin_ia32_vpermt2varps128_maskz ((__v4si) __I /* idx */ , (__v4sf) __A, (__v4sf) __B, (__mmask8) __U); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_permutex2var_ps (__m256 __A, __m256i __I, __m256 __B) { return (__m256) __builtin_ia32_vpermt2varps256_mask ((__v8si) __I /* idx */ , (__v8sf) __A, (__v8sf) __B, (__mmask8) -1); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_mask_permutex2var_ps (__m256 __A, __mmask8 __U, __m256i __I, __m256 __B) { return (__m256) __builtin_ia32_vpermt2varps256_mask ((__v8si) __I /* idx */ , (__v8sf) __A, (__v8sf) __B, (__mmask8) __U); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_maskz_permutex2var_ps (__mmask8 __U, __m256 __A, __m256i __I, __m256 __B) { return (__m256) __builtin_ia32_vpermt2varps256_maskz ((__v8si) __I /* idx */ , (__v8sf) __A, (__v8sf) __B, (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_permutex2var_epi64 (__m128i __A, __m128i __I, __m128i __B) { return (__m128i) __builtin_ia32_vpermt2varq128_mask ((__v2di) __I /* idx */ , (__v2di) __A, (__v2di) __B, (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_permutex2var_epi64 (__m128i __A, __mmask8 __U, __m128i __I, __m128i __B) { return (__m128i) __builtin_ia32_vpermt2varq128_mask ((__v2di) __I /* idx */ , (__v2di) __A, (__v2di) __B, (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_permutex2var_epi64 (__mmask8 __U, __m128i __A, __m128i __I, __m128i __B) { return (__m128i) __builtin_ia32_vpermt2varq128_maskz ((__v2di) __I /* idx */ , (__v2di) __A, (__v2di) __B, (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_permutex2var_epi64 (__m256i __A, __m256i __I, __m256i __B) { return (__m256i) __builtin_ia32_vpermt2varq256_mask ((__v4di) __I /* idx */ , (__v4di) __A, (__v4di) __B, (__mmask8) -1); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_permutex2var_epi64 (__m256i __A, __mmask8 __U, __m256i __I, __m256i __B) { return (__m256i) __builtin_ia32_vpermt2varq256_mask ((__v4di) __I /* idx */ , (__v4di) __A, (__v4di) __B, (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_permutex2var_epi64 (__mmask8 __U, __m256i __A, __m256i __I, __m256i __B) { return (__m256i) __builtin_ia32_vpermt2varq256_maskz ((__v4di) __I /* idx */ , (__v4di) __A, (__v4di) __B, (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_cvtepi8_epi32(__m128i __W, __mmask8 __U, __m128i __A) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U, (__v4si)_mm_cvtepi8_epi32(__A), (__v4si)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_cvtepi8_epi32(__mmask8 __U, __m128i __A) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U, (__v4si)_mm_cvtepi8_epi32(__A), (__v4si)_mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_cvtepi8_epi32 (__m256i __W, __mmask8 __U, __m128i __A) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U, (__v8si)_mm256_cvtepi8_epi32(__A), (__v8si)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_cvtepi8_epi32 (__mmask8 __U, __m128i __A) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U, (__v8si)_mm256_cvtepi8_epi32(__A), (__v8si)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_cvtepi8_epi64(__m128i __W, __mmask8 __U, __m128i __A) { return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U, (__v2di)_mm_cvtepi8_epi64(__A), (__v2di)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_cvtepi8_epi64(__mmask8 __U, __m128i __A) { return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U, (__v2di)_mm_cvtepi8_epi64(__A), (__v2di)_mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_cvtepi8_epi64(__m256i __W, __mmask8 __U, __m128i __A) { return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U, (__v4di)_mm256_cvtepi8_epi64(__A), (__v4di)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_cvtepi8_epi64(__mmask8 __U, __m128i __A) { return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U, (__v4di)_mm256_cvtepi8_epi64(__A), (__v4di)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_cvtepi32_epi64(__m128i __W, __mmask8 __U, __m128i __X) { return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U, (__v2di)_mm_cvtepi32_epi64(__X), (__v2di)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_cvtepi32_epi64(__mmask8 __U, __m128i __X) { return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U, (__v2di)_mm_cvtepi32_epi64(__X), (__v2di)_mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_cvtepi32_epi64(__m256i __W, __mmask8 __U, __m128i __X) { return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U, (__v4di)_mm256_cvtepi32_epi64(__X), (__v4di)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_cvtepi32_epi64(__mmask8 __U, __m128i __X) { return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U, (__v4di)_mm256_cvtepi32_epi64(__X), (__v4di)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_cvtepi16_epi32(__m128i __W, __mmask8 __U, __m128i __A) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U, (__v4si)_mm_cvtepi16_epi32(__A), (__v4si)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_cvtepi16_epi32(__mmask8 __U, __m128i __A) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U, (__v4si)_mm_cvtepi16_epi32(__A), (__v4si)_mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_cvtepi16_epi32(__m256i __W, __mmask8 __U, __m128i __A) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U, (__v8si)_mm256_cvtepi16_epi32(__A), (__v8si)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_cvtepi16_epi32 (__mmask8 __U, __m128i __A) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U, (__v8si)_mm256_cvtepi16_epi32(__A), (__v8si)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_cvtepi16_epi64(__m128i __W, __mmask8 __U, __m128i __A) { return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U, (__v2di)_mm_cvtepi16_epi64(__A), (__v2di)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_cvtepi16_epi64(__mmask8 __U, __m128i __A) { return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U, (__v2di)_mm_cvtepi16_epi64(__A), (__v2di)_mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_cvtepi16_epi64(__m256i __W, __mmask8 __U, __m128i __A) { return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U, (__v4di)_mm256_cvtepi16_epi64(__A), (__v4di)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_cvtepi16_epi64(__mmask8 __U, __m128i __A) { return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U, (__v4di)_mm256_cvtepi16_epi64(__A), (__v4di)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_cvtepu8_epi32(__m128i __W, __mmask8 __U, __m128i __A) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U, (__v4si)_mm_cvtepu8_epi32(__A), (__v4si)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_cvtepu8_epi32(__mmask8 __U, __m128i __A) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U, (__v4si)_mm_cvtepu8_epi32(__A), (__v4si)_mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_cvtepu8_epi32(__m256i __W, __mmask8 __U, __m128i __A) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U, (__v8si)_mm256_cvtepu8_epi32(__A), (__v8si)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_cvtepu8_epi32(__mmask8 __U, __m128i __A) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U, (__v8si)_mm256_cvtepu8_epi32(__A), (__v8si)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_cvtepu8_epi64(__m128i __W, __mmask8 __U, __m128i __A) { return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U, (__v2di)_mm_cvtepu8_epi64(__A), (__v2di)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_cvtepu8_epi64(__mmask8 __U, __m128i __A) { return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U, (__v2di)_mm_cvtepu8_epi64(__A), (__v2di)_mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_cvtepu8_epi64(__m256i __W, __mmask8 __U, __m128i __A) { return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U, (__v4di)_mm256_cvtepu8_epi64(__A), (__v4di)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_cvtepu8_epi64 (__mmask8 __U, __m128i __A) { return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U, (__v4di)_mm256_cvtepu8_epi64(__A), (__v4di)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_cvtepu32_epi64(__m128i __W, __mmask8 __U, __m128i __X) { return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U, (__v2di)_mm_cvtepu32_epi64(__X), (__v2di)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_cvtepu32_epi64(__mmask8 __U, __m128i __X) { return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U, (__v2di)_mm_cvtepu32_epi64(__X), (__v2di)_mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_cvtepu32_epi64(__m256i __W, __mmask8 __U, __m128i __X) { return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U, (__v4di)_mm256_cvtepu32_epi64(__X), (__v4di)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_cvtepu32_epi64(__mmask8 __U, __m128i __X) { return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U, (__v4di)_mm256_cvtepu32_epi64(__X), (__v4di)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_cvtepu16_epi32(__m128i __W, __mmask8 __U, __m128i __A) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U, (__v4si)_mm_cvtepu16_epi32(__A), (__v4si)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_cvtepu16_epi32(__mmask8 __U, __m128i __A) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U, (__v4si)_mm_cvtepu16_epi32(__A), (__v4si)_mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_cvtepu16_epi32(__m256i __W, __mmask8 __U, __m128i __A) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U, (__v8si)_mm256_cvtepu16_epi32(__A), (__v8si)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_cvtepu16_epi32(__mmask8 __U, __m128i __A) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U, (__v8si)_mm256_cvtepu16_epi32(__A), (__v8si)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_cvtepu16_epi64(__m128i __W, __mmask8 __U, __m128i __A) { return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U, (__v2di)_mm_cvtepu16_epi64(__A), (__v2di)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_cvtepu16_epi64(__mmask8 __U, __m128i __A) { return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U, (__v2di)_mm_cvtepu16_epi64(__A), (__v2di)_mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_cvtepu16_epi64(__m256i __W, __mmask8 __U, __m128i __A) { return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U, (__v4di)_mm256_cvtepu16_epi64(__A), (__v4di)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_cvtepu16_epi64(__mmask8 __U, __m128i __A) { return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U, (__v4di)_mm256_cvtepu16_epi64(__A), (__v4di)_mm256_setzero_si256()); } #define _mm_rol_epi32(a, b) __extension__ ({\ (__m128i)__builtin_ia32_prold128_mask((__v4si)(__m128i)(a), (int)(b), \ (__v4si)_mm_setzero_si128(), \ (__mmask8)-1); }) #define _mm_mask_rol_epi32(w, u, a, b) __extension__ ({\ (__m128i)__builtin_ia32_prold128_mask((__v4si)(__m128i)(a), (int)(b), \ (__v4si)(__m128i)(w), (__mmask8)(u)); }) #define _mm_maskz_rol_epi32(u, a, b) __extension__ ({\ (__m128i)__builtin_ia32_prold128_mask((__v4si)(__m128i)(a), (int)(b), \ (__v4si)_mm_setzero_si128(), \ (__mmask8)(u)); }) #define _mm256_rol_epi32(a, b) __extension__ ({\ (__m256i)__builtin_ia32_prold256_mask((__v8si)(__m256i)(a), (int)(b), \ (__v8si)_mm256_setzero_si256(), \ (__mmask8)-1); }) #define _mm256_mask_rol_epi32(w, u, a, b) __extension__ ({\ (__m256i)__builtin_ia32_prold256_mask((__v8si)(__m256i)(a), (int)(b), \ (__v8si)(__m256i)(w), (__mmask8)(u)); }) #define _mm256_maskz_rol_epi32(u, a, b) __extension__ ({\ (__m256i)__builtin_ia32_prold256_mask((__v8si)(__m256i)(a), (int)(b), \ (__v8si)_mm256_setzero_si256(), \ (__mmask8)(u)); }) #define _mm_rol_epi64(a, b) __extension__ ({\ (__m128i)__builtin_ia32_prolq128_mask((__v2di)(__m128i)(a), (int)(b), \ (__v2di)_mm_setzero_di(), \ (__mmask8)-1); }) #define _mm_mask_rol_epi64(w, u, a, b) __extension__ ({\ (__m128i)__builtin_ia32_prolq128_mask((__v2di)(__m128i)(a), (int)(b), \ (__v2di)(__m128i)(w), (__mmask8)(u)); }) #define _mm_maskz_rol_epi64(u, a, b) __extension__ ({\ (__m128i)__builtin_ia32_prolq128_mask((__v2di)(__m128i)(a), (int)(b), \ (__v2di)_mm_setzero_di(), \ (__mmask8)(u)); }) #define _mm256_rol_epi64(a, b) __extension__ ({\ (__m256i)__builtin_ia32_prolq256_mask((__v4di)(__m256i)(a), (int)(b), \ (__v4di)_mm256_setzero_si256(), \ (__mmask8)-1); }) #define _mm256_mask_rol_epi64(w, u, a, b) __extension__ ({\ (__m256i)__builtin_ia32_prolq256_mask((__v4di)(__m256i)(a), (int)(b), \ (__v4di)(__m256i)(w), (__mmask8)(u)); }) #define _mm256_maskz_rol_epi64(u, a, b) __extension__ ({\ (__m256i)__builtin_ia32_prolq256_mask((__v4di)(__m256i)(a), (int)(b), \ (__v4di)_mm256_setzero_si256(), \ (__mmask8)(u)); }) static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_rolv_epi32 (__m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_prolvd128_mask ((__v4si) __A, (__v4si) __B, (__v4si) _mm_setzero_si128 (), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_rolv_epi32 (__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_prolvd128_mask ((__v4si) __A, (__v4si) __B, (__v4si) __W, (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_rolv_epi32 (__mmask8 __U, __m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_prolvd128_mask ((__v4si) __A, (__v4si) __B, (__v4si) _mm_setzero_si128 (), (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_rolv_epi32 (__m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_prolvd256_mask ((__v8si) __A, (__v8si) __B, (__v8si) _mm256_setzero_si256 (), (__mmask8) -1); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_rolv_epi32 (__m256i __W, __mmask8 __U, __m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_prolvd256_mask ((__v8si) __A, (__v8si) __B, (__v8si) __W, (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_rolv_epi32 (__mmask8 __U, __m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_prolvd256_mask ((__v8si) __A, (__v8si) __B, (__v8si) _mm256_setzero_si256 (), (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_rolv_epi64 (__m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_prolvq128_mask ((__v2di) __A, (__v2di) __B, (__v2di) _mm_setzero_di (), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_rolv_epi64 (__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_prolvq128_mask ((__v2di) __A, (__v2di) __B, (__v2di) __W, (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_rolv_epi64 (__mmask8 __U, __m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_prolvq128_mask ((__v2di) __A, (__v2di) __B, (__v2di) _mm_setzero_di (), (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_rolv_epi64 (__m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_prolvq256_mask ((__v4di) __A, (__v4di) __B, (__v4di) _mm256_setzero_si256 (), (__mmask8) -1); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_rolv_epi64 (__m256i __W, __mmask8 __U, __m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_prolvq256_mask ((__v4di) __A, (__v4di) __B, (__v4di) __W, (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_rolv_epi64 (__mmask8 __U, __m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_prolvq256_mask ((__v4di) __A, (__v4di) __B, (__v4di) _mm256_setzero_si256 (), (__mmask8) __U); } #define _mm_ror_epi32(A, B) __extension__ ({ \ (__m128i)__builtin_ia32_prord128_mask((__v4si)(__m128i)(A), (int)(B), \ (__v4si)_mm_setzero_si128(), \ (__mmask8)-1); }) #define _mm_mask_ror_epi32(W, U, A, B) __extension__ ({ \ (__m128i)__builtin_ia32_prord128_mask((__v4si)(__m128i)(A), (int)(B), \ (__v4si)(__m128i)(W), (__mmask8)(U)); }) #define _mm_maskz_ror_epi32(U, A, B) __extension__ ({ \ (__m128i)__builtin_ia32_prord128_mask((__v4si)(__m128i)(A), (int)(B), \ (__v4si)_mm_setzero_si128(), \ (__mmask8)(U)); }) #define _mm256_ror_epi32(A, B) __extension__ ({ \ (__m256i)__builtin_ia32_prord256_mask((__v8si)(__m256i)(A), (int)(B), \ (__v8si)_mm256_setzero_si256(), \ (__mmask8)-1); }) #define _mm256_mask_ror_epi32(W, U, A, B) __extension__ ({ \ (__m256i)__builtin_ia32_prord256_mask((__v8si)(__m256i)(A), (int)(B), \ (__v8si)(__m256i)(W), (__mmask8)(U)); }) #define _mm256_maskz_ror_epi32(U, A, B) __extension__ ({ \ (__m256i)__builtin_ia32_prord256_mask((__v8si)(__m256i)(A), (int)(B), \ (__v8si)_mm256_setzero_si256(), \ (__mmask8)(U)); }) #define _mm_ror_epi64(A, B) __extension__ ({ \ (__m128i)__builtin_ia32_prorq128_mask((__v2di)(__m128i)(A), (int)(B), \ (__v2di)_mm_setzero_di(), \ (__mmask8)-1); }) #define _mm_mask_ror_epi64(W, U, A, B) __extension__ ({ \ (__m128i)__builtin_ia32_prorq128_mask((__v2di)(__m128i)(A), (int)(B), \ (__v2di)(__m128i)(W), (__mmask8)(U)); }) #define _mm_maskz_ror_epi64(U, A, B) __extension__ ({ \ (__m128i)__builtin_ia32_prorq128_mask((__v2di)(__m128i)(A), (int)(B), \ (__v2di)_mm_setzero_di(), \ (__mmask8)(U)); }) #define _mm256_ror_epi64(A, B) __extension__ ({ \ (__m256i)__builtin_ia32_prorq256_mask((__v4di)(__m256i)(A), (int)(B), \ (__v4di)_mm256_setzero_si256(), \ (__mmask8)-1); }) #define _mm256_mask_ror_epi64(W, U, A, B) __extension__ ({ \ (__m256i)__builtin_ia32_prorq256_mask((__v4di)(__m256i)(A), (int)(B), \ (__v4di)(__m256i)(W), (__mmask8)(U)); }) #define _mm256_maskz_ror_epi64(U, A, B) __extension__ ({ \ (__m256i)__builtin_ia32_prorq256_mask((__v4di)(__m256i)(A), (int)(B), \ (__v4di)_mm256_setzero_si256(), \ (__mmask8)(U)); }) static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_sll_epi32(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U, (__v4si)_mm_sll_epi32(__A, __B), (__v4si)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_sll_epi32(__mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U, (__v4si)_mm_sll_epi32(__A, __B), (__v4si)_mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_sll_epi32(__m256i __W, __mmask8 __U, __m256i __A, __m128i __B) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U, (__v8si)_mm256_sll_epi32(__A, __B), (__v8si)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_sll_epi32(__mmask8 __U, __m256i __A, __m128i __B) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U, (__v8si)_mm256_sll_epi32(__A, __B), (__v8si)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_slli_epi32(__m128i __W, __mmask8 __U, __m128i __A, int __B) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U, (__v4si)_mm_slli_epi32(__A, __B), (__v4si)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_slli_epi32(__mmask8 __U, __m128i __A, int __B) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U, (__v4si)_mm_slli_epi32(__A, __B), (__v4si)_mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_slli_epi32(__m256i __W, __mmask8 __U, __m256i __A, int __B) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U, (__v8si)_mm256_slli_epi32(__A, __B), (__v8si)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_slli_epi32(__mmask8 __U, __m256i __A, int __B) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U, (__v8si)_mm256_slli_epi32(__A, __B), (__v8si)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_sll_epi64(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U, (__v2di)_mm_sll_epi64(__A, __B), (__v2di)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_sll_epi64(__mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U, (__v2di)_mm_sll_epi64(__A, __B), (__v2di)_mm_setzero_di()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_sll_epi64(__m256i __W, __mmask8 __U, __m256i __A, __m128i __B) { return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U, (__v4di)_mm256_sll_epi64(__A, __B), (__v4di)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_sll_epi64(__mmask8 __U, __m256i __A, __m128i __B) { return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U, (__v4di)_mm256_sll_epi64(__A, __B), (__v4di)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_slli_epi64(__m128i __W, __mmask8 __U, __m128i __A, int __B) { return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U, (__v2di)_mm_slli_epi64(__A, __B), (__v2di)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_slli_epi64(__mmask8 __U, __m128i __A, int __B) { return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U, (__v2di)_mm_slli_epi64(__A, __B), (__v2di)_mm_setzero_di()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_slli_epi64(__m256i __W, __mmask8 __U, __m256i __A, int __B) { return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U, (__v4di)_mm256_slli_epi64(__A, __B), (__v4di)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_slli_epi64(__mmask8 __U, __m256i __A, int __B) { return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U, (__v4di)_mm256_slli_epi64(__A, __B), (__v4di)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_rorv_epi32 (__m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_prorvd128_mask ((__v4si) __A, (__v4si) __B, (__v4si) _mm_setzero_si128 (), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_rorv_epi32 (__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_prorvd128_mask ((__v4si) __A, (__v4si) __B, (__v4si) __W, (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_rorv_epi32 (__mmask8 __U, __m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_prorvd128_mask ((__v4si) __A, (__v4si) __B, (__v4si) _mm_setzero_si128 (), (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_rorv_epi32 (__m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_prorvd256_mask ((__v8si) __A, (__v8si) __B, (__v8si) _mm256_setzero_si256 (), (__mmask8) -1); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_rorv_epi32 (__m256i __W, __mmask8 __U, __m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_prorvd256_mask ((__v8si) __A, (__v8si) __B, (__v8si) __W, (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_rorv_epi32 (__mmask8 __U, __m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_prorvd256_mask ((__v8si) __A, (__v8si) __B, (__v8si) _mm256_setzero_si256 (), (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_rorv_epi64 (__m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_prorvq128_mask ((__v2di) __A, (__v2di) __B, (__v2di) _mm_setzero_di (), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_rorv_epi64 (__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_prorvq128_mask ((__v2di) __A, (__v2di) __B, (__v2di) __W, (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_rorv_epi64 (__mmask8 __U, __m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_prorvq128_mask ((__v2di) __A, (__v2di) __B, (__v2di) _mm_setzero_di (), (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_rorv_epi64 (__m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_prorvq256_mask ((__v4di) __A, (__v4di) __B, (__v4di) _mm256_setzero_si256 (), (__mmask8) -1); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_rorv_epi64 (__m256i __W, __mmask8 __U, __m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_prorvq256_mask ((__v4di) __A, (__v4di) __B, (__v4di) __W, (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_rorv_epi64 (__mmask8 __U, __m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_prorvq256_mask ((__v4di) __A, (__v4di) __B, (__v4di) _mm256_setzero_si256 (), (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_sllv_epi64(__m128i __W, __mmask8 __U, __m128i __X, __m128i __Y) { return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U, (__v2di)_mm_sllv_epi64(__X, __Y), (__v2di)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_sllv_epi64(__mmask8 __U, __m128i __X, __m128i __Y) { return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U, (__v2di)_mm_sllv_epi64(__X, __Y), (__v2di)_mm_setzero_di()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_sllv_epi64(__m256i __W, __mmask8 __U, __m256i __X, __m256i __Y) { return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U, (__v4di)_mm256_sllv_epi64(__X, __Y), (__v4di)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_sllv_epi64(__mmask8 __U, __m256i __X, __m256i __Y) { return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U, (__v4di)_mm256_sllv_epi64(__X, __Y), (__v4di)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_sllv_epi32(__m128i __W, __mmask8 __U, __m128i __X, __m128i __Y) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U, (__v4si)_mm_sllv_epi32(__X, __Y), (__v4si)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_sllv_epi32(__mmask8 __U, __m128i __X, __m128i __Y) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U, (__v4si)_mm_sllv_epi32(__X, __Y), (__v4si)_mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_sllv_epi32(__m256i __W, __mmask8 __U, __m256i __X, __m256i __Y) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U, (__v8si)_mm256_sllv_epi32(__X, __Y), (__v8si)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_sllv_epi32(__mmask8 __U, __m256i __X, __m256i __Y) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U, (__v8si)_mm256_sllv_epi32(__X, __Y), (__v8si)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_srlv_epi64(__m128i __W, __mmask8 __U, __m128i __X, __m128i __Y) { return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U, (__v2di)_mm_srlv_epi64(__X, __Y), (__v2di)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_srlv_epi64(__mmask8 __U, __m128i __X, __m128i __Y) { return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U, (__v2di)_mm_srlv_epi64(__X, __Y), (__v2di)_mm_setzero_di()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_srlv_epi64(__m256i __W, __mmask8 __U, __m256i __X, __m256i __Y) { return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U, (__v4di)_mm256_srlv_epi64(__X, __Y), (__v4di)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_srlv_epi64(__mmask8 __U, __m256i __X, __m256i __Y) { return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U, (__v4di)_mm256_srlv_epi64(__X, __Y), (__v4di)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_srlv_epi32(__m128i __W, __mmask8 __U, __m128i __X, __m128i __Y) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U, (__v4si)_mm_srlv_epi32(__X, __Y), (__v4si)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_srlv_epi32(__mmask8 __U, __m128i __X, __m128i __Y) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U, (__v4si)_mm_srlv_epi32(__X, __Y), (__v4si)_mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_srlv_epi32(__m256i __W, __mmask8 __U, __m256i __X, __m256i __Y) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U, (__v8si)_mm256_srlv_epi32(__X, __Y), (__v8si)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_srlv_epi32(__mmask8 __U, __m256i __X, __m256i __Y) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U, (__v8si)_mm256_srlv_epi32(__X, __Y), (__v8si)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_srl_epi32(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U, (__v4si)_mm_srl_epi32(__A, __B), (__v4si)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_srl_epi32(__mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U, (__v4si)_mm_srl_epi32(__A, __B), (__v4si)_mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_srl_epi32(__m256i __W, __mmask8 __U, __m256i __A, __m128i __B) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U, (__v8si)_mm256_srl_epi32(__A, __B), (__v8si)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_srl_epi32(__mmask8 __U, __m256i __A, __m128i __B) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U, (__v8si)_mm256_srl_epi32(__A, __B), (__v8si)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_srli_epi32(__m128i __W, __mmask8 __U, __m128i __A, int __B) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U, (__v4si)_mm_srli_epi32(__A, __B), (__v4si)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_srli_epi32(__mmask8 __U, __m128i __A, int __B) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U, (__v4si)_mm_srli_epi32(__A, __B), (__v4si)_mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_srli_epi32(__m256i __W, __mmask8 __U, __m256i __A, int __B) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U, (__v8si)_mm256_srli_epi32(__A, __B), (__v8si)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_srli_epi32(__mmask8 __U, __m256i __A, int __B) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U, (__v8si)_mm256_srli_epi32(__A, __B), (__v8si)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_srl_epi64(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U, (__v2di)_mm_srl_epi64(__A, __B), (__v2di)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_srl_epi64(__mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U, (__v2di)_mm_srl_epi64(__A, __B), (__v2di)_mm_setzero_di()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_srl_epi64(__m256i __W, __mmask8 __U, __m256i __A, __m128i __B) { return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U, (__v4di)_mm256_srl_epi64(__A, __B), (__v4di)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_srl_epi64(__mmask8 __U, __m256i __A, __m128i __B) { return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U, (__v4di)_mm256_srl_epi64(__A, __B), (__v4di)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_srli_epi64(__m128i __W, __mmask8 __U, __m128i __A, int __B) { return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U, (__v2di)_mm_srli_epi64(__A, __B), (__v2di)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_srli_epi64(__mmask8 __U, __m128i __A, int __B) { return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U, (__v2di)_mm_srli_epi64(__A, __B), (__v2di)_mm_setzero_di()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_srli_epi64(__m256i __W, __mmask8 __U, __m256i __A, int __B) { return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U, (__v4di)_mm256_srli_epi64(__A, __B), (__v4di)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_srli_epi64(__mmask8 __U, __m256i __A, int __B) { return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U, (__v4di)_mm256_srli_epi64(__A, __B), (__v4di)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_srav_epi32(__m128i __W, __mmask8 __U, __m128i __X, __m128i __Y) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U, (__v4si)_mm_srav_epi32(__X, __Y), (__v4si)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_srav_epi32(__mmask8 __U, __m128i __X, __m128i __Y) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U, (__v4si)_mm_srav_epi32(__X, __Y), (__v4si)_mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_srav_epi32(__m256i __W, __mmask8 __U, __m256i __X, __m256i __Y) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U, (__v8si)_mm256_srav_epi32(__X, __Y), (__v8si)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_srav_epi32(__mmask8 __U, __m256i __X, __m256i __Y) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U, (__v8si)_mm256_srav_epi32(__X, __Y), (__v8si)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_srav_epi64(__m128i __X, __m128i __Y) { return (__m128i)__builtin_ia32_psravq128((__v2di)__X, (__v2di)__Y); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_srav_epi64(__m128i __W, __mmask8 __U, __m128i __X, __m128i __Y) { return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U, (__v2di)_mm_srav_epi64(__X, __Y), (__v2di)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_srav_epi64(__mmask8 __U, __m128i __X, __m128i __Y) { return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U, (__v2di)_mm_srav_epi64(__X, __Y), (__v2di)_mm_setzero_di()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_srav_epi64(__m256i __X, __m256i __Y) { return (__m256i)__builtin_ia32_psravq256((__v4di)__X, (__v4di) __Y); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_srav_epi64(__m256i __W, __mmask8 __U, __m256i __X, __m256i __Y) { return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U, (__v4di)_mm256_srav_epi64(__X, __Y), (__v4di)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_srav_epi64 (__mmask8 __U, __m256i __X, __m256i __Y) { return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U, (__v4di)_mm256_srav_epi64(__X, __Y), (__v4di)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_mov_epi32 (__m128i __W, __mmask8 __U, __m128i __A) { return (__m128i) __builtin_ia32_selectd_128 ((__mmask8) __U, (__v4si) __A, (__v4si) __W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_mov_epi32 (__mmask8 __U, __m128i __A) { return (__m128i) __builtin_ia32_selectd_128 ((__mmask8) __U, (__v4si) __A, (__v4si) _mm_setzero_si128 ()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_mov_epi32 (__m256i __W, __mmask8 __U, __m256i __A) { return (__m256i) __builtin_ia32_selectd_256 ((__mmask8) __U, (__v8si) __A, (__v8si) __W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_mov_epi32 (__mmask8 __U, __m256i __A) { return (__m256i) __builtin_ia32_selectd_256 ((__mmask8) __U, (__v8si) __A, (__v8si) _mm256_setzero_si256 ()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_load_epi32 (__m128i __W, __mmask8 __U, void const *__P) { return (__m128i) __builtin_ia32_movdqa32load128_mask ((__v4si *) __P, (__v4si) __W, (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_load_epi32 (__mmask8 __U, void const *__P) { return (__m128i) __builtin_ia32_movdqa32load128_mask ((__v4si *) __P, (__v4si) _mm_setzero_si128 (), (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_load_epi32 (__m256i __W, __mmask8 __U, void const *__P) { return (__m256i) __builtin_ia32_movdqa32load256_mask ((__v8si *) __P, (__v8si) __W, (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_load_epi32 (__mmask8 __U, void const *__P) { return (__m256i) __builtin_ia32_movdqa32load256_mask ((__v8si *) __P, (__v8si) _mm256_setzero_si256 (), (__mmask8) __U); } static __inline__ void __DEFAULT_FN_ATTRS _mm_mask_store_epi32 (void *__P, __mmask8 __U, __m128i __A) { __builtin_ia32_movdqa32store128_mask ((__v4si *) __P, (__v4si) __A, (__mmask8) __U); } static __inline__ void __DEFAULT_FN_ATTRS _mm256_mask_store_epi32 (void *__P, __mmask8 __U, __m256i __A) { __builtin_ia32_movdqa32store256_mask ((__v8si *) __P, (__v8si) __A, (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_mov_epi64 (__m128i __W, __mmask8 __U, __m128i __A) { return (__m128i) __builtin_ia32_selectq_128 ((__mmask8) __U, (__v2di) __A, (__v2di) __W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_mov_epi64 (__mmask8 __U, __m128i __A) { return (__m128i) __builtin_ia32_selectq_128 ((__mmask8) __U, (__v2di) __A, (__v2di) _mm_setzero_di ()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_mov_epi64 (__m256i __W, __mmask8 __U, __m256i __A) { return (__m256i) __builtin_ia32_selectq_256 ((__mmask8) __U, (__v4di) __A, (__v4di) __W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_mov_epi64 (__mmask8 __U, __m256i __A) { return (__m256i) __builtin_ia32_selectq_256 ((__mmask8) __U, (__v4di) __A, (__v4di) _mm256_setzero_si256 ()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_load_epi64 (__m128i __W, __mmask8 __U, void const *__P) { return (__m128i) __builtin_ia32_movdqa64load128_mask ((__v2di *) __P, (__v2di) __W, (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_load_epi64 (__mmask8 __U, void const *__P) { return (__m128i) __builtin_ia32_movdqa64load128_mask ((__v2di *) __P, (__v2di) _mm_setzero_di (), (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_load_epi64 (__m256i __W, __mmask8 __U, void const *__P) { return (__m256i) __builtin_ia32_movdqa64load256_mask ((__v4di *) __P, (__v4di) __W, (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_load_epi64 (__mmask8 __U, void const *__P) { return (__m256i) __builtin_ia32_movdqa64load256_mask ((__v4di *) __P, (__v4di) _mm256_setzero_si256 (), (__mmask8) __U); } static __inline__ void __DEFAULT_FN_ATTRS _mm_mask_store_epi64 (void *__P, __mmask8 __U, __m128i __A) { __builtin_ia32_movdqa64store128_mask ((__v2di *) __P, (__v2di) __A, (__mmask8) __U); } static __inline__ void __DEFAULT_FN_ATTRS _mm256_mask_store_epi64 (void *__P, __mmask8 __U, __m256i __A) { __builtin_ia32_movdqa64store256_mask ((__v4di *) __P, (__v4di) __A, (__mmask8) __U); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask_movedup_pd (__m128d __W, __mmask8 __U, __m128d __A) { return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U, (__v2df)_mm_movedup_pd(__A), (__v2df)__W); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_maskz_movedup_pd (__mmask8 __U, __m128d __A) { return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U, (__v2df)_mm_movedup_pd(__A), (__v2df)_mm_setzero_pd()); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_mask_movedup_pd (__m256d __W, __mmask8 __U, __m256d __A) { return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U, (__v4df)_mm256_movedup_pd(__A), (__v4df)__W); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_maskz_movedup_pd (__mmask8 __U, __m256d __A) { return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U, (__v4df)_mm256_movedup_pd(__A), (__v4df)_mm256_setzero_pd()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_set1_epi32(__m128i __O, __mmask8 __M, int __A) { return (__m128i)__builtin_ia32_selectd_128(__M, (__v4si) _mm_set1_epi32(__A), (__v4si)__O); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_set1_epi32( __mmask8 __M, int __A) { return (__m128i)__builtin_ia32_selectd_128(__M, (__v4si) _mm_set1_epi32(__A), (__v4si)_mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_set1_epi32(__m256i __O, __mmask8 __M, int __A) { return (__m256i)__builtin_ia32_selectd_256(__M, (__v8si) _mm256_set1_epi32(__A), (__v8si)__O); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_set1_epi32( __mmask8 __M, int __A) { return (__m256i)__builtin_ia32_selectd_256(__M, (__v8si) _mm256_set1_epi32(__A), (__v8si)_mm256_setzero_si256()); } #ifdef __x86_64__ static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_set1_epi64 (__m128i __O, __mmask8 __M, long long __A) { return (__m128i) __builtin_ia32_selectq_128(__M, (__v2di) _mm_set1_epi64x(__A), (__v2di) __O); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_set1_epi64 (__mmask8 __M, long long __A) { return (__m128i) __builtin_ia32_selectq_128(__M, (__v2di) _mm_set1_epi64x(__A), (__v2di) _mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_set1_epi64 (__m256i __O, __mmask8 __M, long long __A) { return (__m256i) __builtin_ia32_selectq_256(__M, (__v4di) _mm256_set1_epi64x(__A), (__v4di) __O) ; } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_set1_epi64 (__mmask8 __M, long long __A) { return (__m256i) __builtin_ia32_selectq_256(__M, (__v4di) _mm256_set1_epi64x(__A), (__v4di) _mm256_setzero_si256()); } #endif # 5416 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512vlintrin.h" 3 #define _mm_fixupimm_pd(A, B, C, imm) __extension__ ({ \ (__m128d)__builtin_ia32_fixupimmpd128_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2di)(__m128i)(C), (int)(imm), \ (__mmask8)-1); }) #define _mm_mask_fixupimm_pd(A, U, B, C, imm) __extension__ ({ \ (__m128d)__builtin_ia32_fixupimmpd128_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2di)(__m128i)(C), (int)(imm), \ (__mmask8)(U)); }) #define _mm_maskz_fixupimm_pd(U, A, B, C, imm) __extension__ ({ \ (__m128d)__builtin_ia32_fixupimmpd128_maskz((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2di)(__m128i)(C), \ (int)(imm), (__mmask8)(U)); }) #define _mm256_fixupimm_pd(A, B, C, imm) __extension__ ({ \ (__m256d)__builtin_ia32_fixupimmpd256_mask((__v4df)(__m256d)(A), \ (__v4df)(__m256d)(B), \ (__v4di)(__m256i)(C), (int)(imm), \ (__mmask8)-1); }) #define _mm256_mask_fixupimm_pd(A, U, B, C, imm) __extension__ ({ \ (__m256d)__builtin_ia32_fixupimmpd256_mask((__v4df)(__m256d)(A), \ (__v4df)(__m256d)(B), \ (__v4di)(__m256i)(C), (int)(imm), \ (__mmask8)(U)); }) #define _mm256_maskz_fixupimm_pd(U, A, B, C, imm) __extension__ ({ \ (__m256d)__builtin_ia32_fixupimmpd256_maskz((__v4df)(__m256d)(A), \ (__v4df)(__m256d)(B), \ (__v4di)(__m256i)(C), \ (int)(imm), (__mmask8)(U)); }) #define _mm_fixupimm_ps(A, B, C, imm) __extension__ ({ \ (__m128)__builtin_ia32_fixupimmps128_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4si)(__m128i)(C), (int)(imm), \ (__mmask8)-1); }) #define _mm_mask_fixupimm_ps(A, U, B, C, imm) __extension__ ({ \ (__m128)__builtin_ia32_fixupimmps128_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4si)(__m128i)(C), (int)(imm), \ (__mmask8)(U)); }) #define _mm_maskz_fixupimm_ps(U, A, B, C, imm) __extension__ ({ \ (__m128)__builtin_ia32_fixupimmps128_maskz((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4si)(__m128i)(C), (int)(imm), \ (__mmask8)(U)); }) #define _mm256_fixupimm_ps(A, B, C, imm) __extension__ ({ \ (__m256)__builtin_ia32_fixupimmps256_mask((__v8sf)(__m256)(A), \ (__v8sf)(__m256)(B), \ (__v8si)(__m256i)(C), (int)(imm), \ (__mmask8)-1); }) #define _mm256_mask_fixupimm_ps(A, U, B, C, imm) __extension__ ({ \ (__m256)__builtin_ia32_fixupimmps256_mask((__v8sf)(__m256)(A), \ (__v8sf)(__m256)(B), \ (__v8si)(__m256i)(C), (int)(imm), \ (__mmask8)(U)); }) #define _mm256_maskz_fixupimm_ps(U, A, B, C, imm) __extension__ ({ \ (__m256)__builtin_ia32_fixupimmps256_maskz((__v8sf)(__m256)(A), \ (__v8sf)(__m256)(B), \ (__v8si)(__m256i)(C), (int)(imm), \ (__mmask8)(U)); }) static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask_load_pd (__m128d __W, __mmask8 __U, void const *__P) { return (__m128d) __builtin_ia32_loadapd128_mask ((__v2df *) __P, (__v2df) __W, (__mmask8) __U); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_maskz_load_pd (__mmask8 __U, void const *__P) { return (__m128d) __builtin_ia32_loadapd128_mask ((__v2df *) __P, (__v2df) _mm_setzero_pd (), (__mmask8) __U); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_mask_load_pd (__m256d __W, __mmask8 __U, void const *__P) { return (__m256d) __builtin_ia32_loadapd256_mask ((__v4df *) __P, (__v4df) __W, (__mmask8) __U); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_maskz_load_pd (__mmask8 __U, void const *__P) { return (__m256d) __builtin_ia32_loadapd256_mask ((__v4df *) __P, (__v4df) _mm256_setzero_pd (), (__mmask8) __U); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask_load_ps (__m128 __W, __mmask8 __U, void const *__P) { return (__m128) __builtin_ia32_loadaps128_mask ((__v4sf *) __P, (__v4sf) __W, (__mmask8) __U); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maskz_load_ps (__mmask8 __U, void const *__P) { return (__m128) __builtin_ia32_loadaps128_mask ((__v4sf *) __P, (__v4sf) _mm_setzero_ps (), (__mmask8) __U); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_mask_load_ps (__m256 __W, __mmask8 __U, void const *__P) { return (__m256) __builtin_ia32_loadaps256_mask ((__v8sf *) __P, (__v8sf) __W, (__mmask8) __U); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_maskz_load_ps (__mmask8 __U, void const *__P) { return (__m256) __builtin_ia32_loadaps256_mask ((__v8sf *) __P, (__v8sf) _mm256_setzero_ps (), (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_loadu_epi64 (__m128i __W, __mmask8 __U, void const *__P) { return (__m128i) __builtin_ia32_loaddqudi128_mask ((__v2di *) __P, (__v2di) __W, (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_loadu_epi64 (__mmask8 __U, void const *__P) { return (__m128i) __builtin_ia32_loaddqudi128_mask ((__v2di *) __P, (__v2di) _mm_setzero_si128 (), (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_loadu_epi64 (__m256i __W, __mmask8 __U, void const *__P) { return (__m256i) __builtin_ia32_loaddqudi256_mask ((__v4di *) __P, (__v4di) __W, (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_loadu_epi64 (__mmask8 __U, void const *__P) { return (__m256i) __builtin_ia32_loaddqudi256_mask ((__v4di *) __P, (__v4di) _mm256_setzero_si256 (), (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_loadu_epi32 (__m128i __W, __mmask8 __U, void const *__P) { return (__m128i) __builtin_ia32_loaddqusi128_mask ((__v4si *) __P, (__v4si) __W, (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_loadu_epi32 (__mmask8 __U, void const *__P) { return (__m128i) __builtin_ia32_loaddqusi128_mask ((__v4si *) __P, (__v4si) _mm_setzero_si128 (), (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_loadu_epi32 (__m256i __W, __mmask8 __U, void const *__P) { return (__m256i) __builtin_ia32_loaddqusi256_mask ((__v8si *) __P, (__v8si) __W, (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_loadu_epi32 (__mmask8 __U, void const *__P) { return (__m256i) __builtin_ia32_loaddqusi256_mask ((__v8si *) __P, (__v8si) _mm256_setzero_si256 (), (__mmask8) __U); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask_loadu_pd (__m128d __W, __mmask8 __U, void const *__P) { return (__m128d) __builtin_ia32_loadupd128_mask ((__v2df *) __P, (__v2df) __W, (__mmask8) __U); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_maskz_loadu_pd (__mmask8 __U, void const *__P) { return (__m128d) __builtin_ia32_loadupd128_mask ((__v2df *) __P, (__v2df) _mm_setzero_pd (), (__mmask8) __U); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_mask_loadu_pd (__m256d __W, __mmask8 __U, void const *__P) { return (__m256d) __builtin_ia32_loadupd256_mask ((__v4df *) __P, (__v4df) __W, (__mmask8) __U); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_maskz_loadu_pd (__mmask8 __U, void const *__P) { return (__m256d) __builtin_ia32_loadupd256_mask ((__v4df *) __P, (__v4df) _mm256_setzero_pd (), (__mmask8) __U); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask_loadu_ps (__m128 __W, __mmask8 __U, void const *__P) { return (__m128) __builtin_ia32_loadups128_mask ((__v4sf *) __P, (__v4sf) __W, (__mmask8) __U); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maskz_loadu_ps (__mmask8 __U, void const *__P) { return (__m128) __builtin_ia32_loadups128_mask ((__v4sf *) __P, (__v4sf) _mm_setzero_ps (), (__mmask8) __U); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_mask_loadu_ps (__m256 __W, __mmask8 __U, void const *__P) { return (__m256) __builtin_ia32_loadups256_mask ((__v8sf *) __P, (__v8sf) __W, (__mmask8) __U); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_maskz_loadu_ps (__mmask8 __U, void const *__P) { return (__m256) __builtin_ia32_loadups256_mask ((__v8sf *) __P, (__v8sf) _mm256_setzero_ps (), (__mmask8) __U); } static __inline__ void __DEFAULT_FN_ATTRS _mm_mask_store_pd (void *__P, __mmask8 __U, __m128d __A) { __builtin_ia32_storeapd128_mask ((__v2df *) __P, (__v2df) __A, (__mmask8) __U); } static __inline__ void __DEFAULT_FN_ATTRS _mm256_mask_store_pd (void *__P, __mmask8 __U, __m256d __A) { __builtin_ia32_storeapd256_mask ((__v4df *) __P, (__v4df) __A, (__mmask8) __U); } static __inline__ void __DEFAULT_FN_ATTRS _mm_mask_store_ps (void *__P, __mmask8 __U, __m128 __A) { __builtin_ia32_storeaps128_mask ((__v4sf *) __P, (__v4sf) __A, (__mmask8) __U); } static __inline__ void __DEFAULT_FN_ATTRS _mm256_mask_store_ps (void *__P, __mmask8 __U, __m256 __A) { __builtin_ia32_storeaps256_mask ((__v8sf *) __P, (__v8sf) __A, (__mmask8) __U); } static __inline__ void __DEFAULT_FN_ATTRS _mm_mask_storeu_epi64 (void *__P, __mmask8 __U, __m128i __A) { __builtin_ia32_storedqudi128_mask ((__v2di *) __P, (__v2di) __A, (__mmask8) __U); } static __inline__ void __DEFAULT_FN_ATTRS _mm256_mask_storeu_epi64 (void *__P, __mmask8 __U, __m256i __A) { __builtin_ia32_storedqudi256_mask ((__v4di *) __P, (__v4di) __A, (__mmask8) __U); } static __inline__ void __DEFAULT_FN_ATTRS _mm_mask_storeu_epi32 (void *__P, __mmask8 __U, __m128i __A) { __builtin_ia32_storedqusi128_mask ((__v4si *) __P, (__v4si) __A, (__mmask8) __U); } static __inline__ void __DEFAULT_FN_ATTRS _mm256_mask_storeu_epi32 (void *__P, __mmask8 __U, __m256i __A) { __builtin_ia32_storedqusi256_mask ((__v8si *) __P, (__v8si) __A, (__mmask8) __U); } static __inline__ void __DEFAULT_FN_ATTRS _mm_mask_storeu_pd (void *__P, __mmask8 __U, __m128d __A) { __builtin_ia32_storeupd128_mask ((__v2df *) __P, (__v2df) __A, (__mmask8) __U); } static __inline__ void __DEFAULT_FN_ATTRS _mm256_mask_storeu_pd (void *__P, __mmask8 __U, __m256d __A) { __builtin_ia32_storeupd256_mask ((__v4df *) __P, (__v4df) __A, (__mmask8) __U); } static __inline__ void __DEFAULT_FN_ATTRS _mm_mask_storeu_ps (void *__P, __mmask8 __U, __m128 __A) { __builtin_ia32_storeups128_mask ((__v4sf *) __P, (__v4sf) __A, (__mmask8) __U); } static __inline__ void __DEFAULT_FN_ATTRS _mm256_mask_storeu_ps (void *__P, __mmask8 __U, __m256 __A) { __builtin_ia32_storeups256_mask ((__v8sf *) __P, (__v8sf) __A, (__mmask8) __U); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask_unpackhi_pd(__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U, (__v2df)_mm_unpackhi_pd(__A, __B), (__v2df)__W); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_maskz_unpackhi_pd(__mmask8 __U, __m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U, (__v2df)_mm_unpackhi_pd(__A, __B), (__v2df)_mm_setzero_pd()); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_mask_unpackhi_pd(__m256d __W, __mmask8 __U, __m256d __A, __m256d __B) { return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U, (__v4df)_mm256_unpackhi_pd(__A, __B), (__v4df)__W); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_maskz_unpackhi_pd(__mmask8 __U, __m256d __A, __m256d __B) { return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U, (__v4df)_mm256_unpackhi_pd(__A, __B), (__v4df)_mm256_setzero_pd()); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask_unpackhi_ps(__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) { return (__m128)__builtin_ia32_selectps_128((__mmask8)__U, (__v4sf)_mm_unpackhi_ps(__A, __B), (__v4sf)__W); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maskz_unpackhi_ps(__mmask8 __U, __m128 __A, __m128 __B) { return (__m128)__builtin_ia32_selectps_128((__mmask8)__U, (__v4sf)_mm_unpackhi_ps(__A, __B), (__v4sf)_mm_setzero_ps()); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_mask_unpackhi_ps(__m256 __W, __mmask8 __U, __m256 __A, __m256 __B) { return (__m256)__builtin_ia32_selectps_256((__mmask8)__U, (__v8sf)_mm256_unpackhi_ps(__A, __B), (__v8sf)__W); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_maskz_unpackhi_ps(__mmask8 __U, __m256 __A, __m256 __B) { return (__m256)__builtin_ia32_selectps_256((__mmask8)__U, (__v8sf)_mm256_unpackhi_ps(__A, __B), (__v8sf)_mm256_setzero_ps()); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask_unpacklo_pd(__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U, (__v2df)_mm_unpacklo_pd(__A, __B), (__v2df)__W); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_maskz_unpacklo_pd(__mmask8 __U, __m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U, (__v2df)_mm_unpacklo_pd(__A, __B), (__v2df)_mm_setzero_pd()); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_mask_unpacklo_pd(__m256d __W, __mmask8 __U, __m256d __A, __m256d __B) { return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U, (__v4df)_mm256_unpacklo_pd(__A, __B), (__v4df)__W); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_maskz_unpacklo_pd(__mmask8 __U, __m256d __A, __m256d __B) { return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U, (__v4df)_mm256_unpacklo_pd(__A, __B), (__v4df)_mm256_setzero_pd()); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask_unpacklo_ps(__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) { return (__m128)__builtin_ia32_selectps_128((__mmask8)__U, (__v4sf)_mm_unpacklo_ps(__A, __B), (__v4sf)__W); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maskz_unpacklo_ps(__mmask8 __U, __m128 __A, __m128 __B) { return (__m128)__builtin_ia32_selectps_128((__mmask8)__U, (__v4sf)_mm_unpacklo_ps(__A, __B), (__v4sf)_mm_setzero_ps()); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_mask_unpacklo_ps(__m256 __W, __mmask8 __U, __m256 __A, __m256 __B) { return (__m256)__builtin_ia32_selectps_256((__mmask8)__U, (__v8sf)_mm256_unpacklo_ps(__A, __B), (__v8sf)__W); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_maskz_unpacklo_ps(__mmask8 __U, __m256 __A, __m256 __B) { return (__m256)__builtin_ia32_selectps_256((__mmask8)__U, (__v8sf)_mm256_unpacklo_ps(__A, __B), (__v8sf)_mm256_setzero_ps()); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_rcp14_pd (__m128d __A) { return (__m128d) __builtin_ia32_rcp14pd128_mask ((__v2df) __A, (__v2df) _mm_setzero_pd (), (__mmask8) -1); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask_rcp14_pd (__m128d __W, __mmask8 __U, __m128d __A) { return (__m128d) __builtin_ia32_rcp14pd128_mask ((__v2df) __A, (__v2df) __W, (__mmask8) __U); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_maskz_rcp14_pd (__mmask8 __U, __m128d __A) { return (__m128d) __builtin_ia32_rcp14pd128_mask ((__v2df) __A, (__v2df) _mm_setzero_pd (), (__mmask8) __U); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_rcp14_pd (__m256d __A) { return (__m256d) __builtin_ia32_rcp14pd256_mask ((__v4df) __A, (__v4df) _mm256_setzero_pd (), (__mmask8) -1); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_mask_rcp14_pd (__m256d __W, __mmask8 __U, __m256d __A) { return (__m256d) __builtin_ia32_rcp14pd256_mask ((__v4df) __A, (__v4df) __W, (__mmask8) __U); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_maskz_rcp14_pd (__mmask8 __U, __m256d __A) { return (__m256d) __builtin_ia32_rcp14pd256_mask ((__v4df) __A, (__v4df) _mm256_setzero_pd (), (__mmask8) __U); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_rcp14_ps (__m128 __A) { return (__m128) __builtin_ia32_rcp14ps128_mask ((__v4sf) __A, (__v4sf) _mm_setzero_ps (), (__mmask8) -1); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask_rcp14_ps (__m128 __W, __mmask8 __U, __m128 __A) { return (__m128) __builtin_ia32_rcp14ps128_mask ((__v4sf) __A, (__v4sf) __W, (__mmask8) __U); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maskz_rcp14_ps (__mmask8 __U, __m128 __A) { return (__m128) __builtin_ia32_rcp14ps128_mask ((__v4sf) __A, (__v4sf) _mm_setzero_ps (), (__mmask8) __U); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_rcp14_ps (__m256 __A) { return (__m256) __builtin_ia32_rcp14ps256_mask ((__v8sf) __A, (__v8sf) _mm256_setzero_ps (), (__mmask8) -1); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_mask_rcp14_ps (__m256 __W, __mmask8 __U, __m256 __A) { return (__m256) __builtin_ia32_rcp14ps256_mask ((__v8sf) __A, (__v8sf) __W, (__mmask8) __U); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_maskz_rcp14_ps (__mmask8 __U, __m256 __A) { return (__m256) __builtin_ia32_rcp14ps256_mask ((__v8sf) __A, (__v8sf) _mm256_setzero_ps (), (__mmask8) __U); } #define _mm_mask_permute_pd(W, U, X, C) __extension__ ({ \ (__m128d)__builtin_ia32_selectpd_128((__mmask8)(U), \ (__v2df)_mm_permute_pd((X), (C)), \ (__v2df)(__m128d)(W)); }) #define _mm_maskz_permute_pd(U, X, C) __extension__ ({ \ (__m128d)__builtin_ia32_selectpd_128((__mmask8)(U), \ (__v2df)_mm_permute_pd((X), (C)), \ (__v2df)_mm_setzero_pd()); }) #define _mm256_mask_permute_pd(W, U, X, C) __extension__ ({ \ (__m256d)__builtin_ia32_selectpd_256((__mmask8)(U), \ (__v4df)_mm256_permute_pd((X), (C)), \ (__v4df)(__m256d)(W)); }) #define _mm256_maskz_permute_pd(U, X, C) __extension__ ({ \ (__m256d)__builtin_ia32_selectpd_256((__mmask8)(U), \ (__v4df)_mm256_permute_pd((X), (C)), \ (__v4df)_mm256_setzero_pd()); }) #define _mm_mask_permute_ps(W, U, X, C) __extension__ ({ \ (__m128)__builtin_ia32_selectps_128((__mmask8)(U), \ (__v4sf)_mm_permute_ps((X), (C)), \ (__v4sf)(__m128)(W)); }) #define _mm_maskz_permute_ps(U, X, C) __extension__ ({ \ (__m128)__builtin_ia32_selectps_128((__mmask8)(U), \ (__v4sf)_mm_permute_ps((X), (C)), \ (__v4sf)_mm_setzero_ps()); }) #define _mm256_mask_permute_ps(W, U, X, C) __extension__ ({ \ (__m256)__builtin_ia32_selectps_256((__mmask8)(U), \ (__v8sf)_mm256_permute_ps((X), (C)), \ (__v8sf)(__m256)(W)); }) #define _mm256_maskz_permute_ps(U, X, C) __extension__ ({ \ (__m256)__builtin_ia32_selectps_256((__mmask8)(U), \ (__v8sf)_mm256_permute_ps((X), (C)), \ (__v8sf)_mm256_setzero_ps()); }) static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask_permutevar_pd(__m128d __W, __mmask8 __U, __m128d __A, __m128i __C) { return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U, (__v2df)_mm_permutevar_pd(__A, __C), (__v2df)__W); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_maskz_permutevar_pd(__mmask8 __U, __m128d __A, __m128i __C) { return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U, (__v2df)_mm_permutevar_pd(__A, __C), (__v2df)_mm_setzero_pd()); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_mask_permutevar_pd(__m256d __W, __mmask8 __U, __m256d __A, __m256i __C) { return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U, (__v4df)_mm256_permutevar_pd(__A, __C), (__v4df)__W); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_maskz_permutevar_pd(__mmask8 __U, __m256d __A, __m256i __C) { return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U, (__v4df)_mm256_permutevar_pd(__A, __C), (__v4df)_mm256_setzero_pd()); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask_permutevar_ps(__m128 __W, __mmask8 __U, __m128 __A, __m128i __C) { return (__m128)__builtin_ia32_selectps_128((__mmask8)__U, (__v4sf)_mm_permutevar_ps(__A, __C), (__v4sf)__W); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maskz_permutevar_ps(__mmask8 __U, __m128 __A, __m128i __C) { return (__m128)__builtin_ia32_selectps_128((__mmask8)__U, (__v4sf)_mm_permutevar_ps(__A, __C), (__v4sf)_mm_setzero_ps()); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_mask_permutevar_ps(__m256 __W, __mmask8 __U, __m256 __A, __m256i __C) { return (__m256)__builtin_ia32_selectps_256((__mmask8)__U, (__v8sf)_mm256_permutevar_ps(__A, __C), (__v8sf)__W); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_maskz_permutevar_ps(__mmask8 __U, __m256 __A, __m256i __C) { return (__m256)__builtin_ia32_selectps_256((__mmask8)__U, (__v8sf)_mm256_permutevar_ps(__A, __C), (__v8sf)_mm256_setzero_ps()); } static __inline__ __mmask8 __DEFAULT_FN_ATTRS _mm_test_epi32_mask (__m128i __A, __m128i __B) { return _mm_cmpneq_epi32_mask (_mm_and_si128 (__A, __B), _mm_setzero_di()); } static __inline__ __mmask8 __DEFAULT_FN_ATTRS _mm_mask_test_epi32_mask (__mmask8 __U, __m128i __A, __m128i __B) { return _mm_mask_cmpneq_epi32_mask (__U, _mm_and_si128 (__A, __B), _mm_setzero_di()); } static __inline__ __mmask8 __DEFAULT_FN_ATTRS _mm256_test_epi32_mask (__m256i __A, __m256i __B) { return _mm256_cmpneq_epi32_mask (_mm256_and_si256 (__A, __B), _mm256_setzero_si256()); } static __inline__ __mmask8 __DEFAULT_FN_ATTRS _mm256_mask_test_epi32_mask (__mmask8 __U, __m256i __A, __m256i __B) { return _mm256_mask_cmpneq_epi32_mask (__U, _mm256_and_si256 (__A, __B), _mm256_setzero_si256()); } static __inline__ __mmask8 __DEFAULT_FN_ATTRS _mm_test_epi64_mask (__m128i __A, __m128i __B) { return _mm_cmpneq_epi64_mask (_mm_and_si128 (__A, __B), _mm_setzero_di()); } static __inline__ __mmask8 __DEFAULT_FN_ATTRS _mm_mask_test_epi64_mask (__mmask8 __U, __m128i __A, __m128i __B) { return _mm_mask_cmpneq_epi64_mask (__U, _mm_and_si128 (__A, __B), _mm_setzero_di()); } static __inline__ __mmask8 __DEFAULT_FN_ATTRS _mm256_test_epi64_mask (__m256i __A, __m256i __B) { return _mm256_cmpneq_epi64_mask (_mm256_and_si256 (__A, __B), _mm256_setzero_si256()); } static __inline__ __mmask8 __DEFAULT_FN_ATTRS _mm256_mask_test_epi64_mask (__mmask8 __U, __m256i __A, __m256i __B) { return _mm256_mask_cmpneq_epi64_mask (__U, _mm256_and_si256 (__A, __B), _mm256_setzero_si256()); } static __inline__ __mmask8 __DEFAULT_FN_ATTRS _mm_testn_epi32_mask (__m128i __A, __m128i __B) { return _mm_cmpeq_epi32_mask (_mm_and_si128 (__A, __B), _mm_setzero_di()); } static __inline__ __mmask8 __DEFAULT_FN_ATTRS _mm_mask_testn_epi32_mask (__mmask8 __U, __m128i __A, __m128i __B) { return _mm_mask_cmpeq_epi32_mask (__U, _mm_and_si128 (__A, __B), _mm_setzero_di()); } static __inline__ __mmask8 __DEFAULT_FN_ATTRS _mm256_testn_epi32_mask (__m256i __A, __m256i __B) { return _mm256_cmpeq_epi32_mask (_mm256_and_si256 (__A, __B), _mm256_setzero_si256()); } static __inline__ __mmask8 __DEFAULT_FN_ATTRS _mm256_mask_testn_epi32_mask (__mmask8 __U, __m256i __A, __m256i __B) { return _mm256_mask_cmpeq_epi32_mask (__U, _mm256_and_si256 (__A, __B), _mm256_setzero_si256()); } static __inline__ __mmask8 __DEFAULT_FN_ATTRS _mm_testn_epi64_mask (__m128i __A, __m128i __B) { return _mm_cmpeq_epi64_mask (_mm_and_si128 (__A, __B), _mm_setzero_di()); } static __inline__ __mmask8 __DEFAULT_FN_ATTRS _mm_mask_testn_epi64_mask (__mmask8 __U, __m128i __A, __m128i __B) { return _mm_mask_cmpeq_epi64_mask (__U, _mm_and_si128 (__A, __B), _mm_setzero_di()); } static __inline__ __mmask8 __DEFAULT_FN_ATTRS _mm256_testn_epi64_mask (__m256i __A, __m256i __B) { return _mm256_cmpeq_epi64_mask (_mm256_and_si256 (__A, __B), _mm256_setzero_si256()); } static __inline__ __mmask8 __DEFAULT_FN_ATTRS _mm256_mask_testn_epi64_mask (__mmask8 __U, __m256i __A, __m256i __B) { return _mm256_mask_cmpeq_epi64_mask (__U, _mm256_and_si256 (__A, __B), _mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_unpackhi_epi32(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U, (__v4si)_mm_unpackhi_epi32(__A, __B), (__v4si)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_unpackhi_epi32(__mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U, (__v4si)_mm_unpackhi_epi32(__A, __B), (__v4si)_mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_unpackhi_epi32(__m256i __W, __mmask8 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U, (__v8si)_mm256_unpackhi_epi32(__A, __B), (__v8si)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_unpackhi_epi32(__mmask8 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U, (__v8si)_mm256_unpackhi_epi32(__A, __B), (__v8si)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_unpackhi_epi64(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U, (__v2di)_mm_unpackhi_epi64(__A, __B), (__v2di)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_unpackhi_epi64(__mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U, (__v2di)_mm_unpackhi_epi64(__A, __B), (__v2di)_mm_setzero_di()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_unpackhi_epi64(__m256i __W, __mmask8 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U, (__v4di)_mm256_unpackhi_epi64(__A, __B), (__v4di)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_unpackhi_epi64(__mmask8 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U, (__v4di)_mm256_unpackhi_epi64(__A, __B), (__v4di)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_unpacklo_epi32(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U, (__v4si)_mm_unpacklo_epi32(__A, __B), (__v4si)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_unpacklo_epi32(__mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U, (__v4si)_mm_unpacklo_epi32(__A, __B), (__v4si)_mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_unpacklo_epi32(__m256i __W, __mmask8 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U, (__v8si)_mm256_unpacklo_epi32(__A, __B), (__v8si)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_unpacklo_epi32(__mmask8 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U, (__v8si)_mm256_unpacklo_epi32(__A, __B), (__v8si)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_unpacklo_epi64(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U, (__v2di)_mm_unpacklo_epi64(__A, __B), (__v2di)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_unpacklo_epi64(__mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U, (__v2di)_mm_unpacklo_epi64(__A, __B), (__v2di)_mm_setzero_di()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_unpacklo_epi64(__m256i __W, __mmask8 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U, (__v4di)_mm256_unpacklo_epi64(__A, __B), (__v4di)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_unpacklo_epi64(__mmask8 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U, (__v4di)_mm256_unpacklo_epi64(__A, __B), (__v4di)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_sra_epi32(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U, (__v4si)_mm_sra_epi32(__A, __B), (__v4si)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_sra_epi32(__mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U, (__v4si)_mm_sra_epi32(__A, __B), (__v4si)_mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_sra_epi32(__m256i __W, __mmask8 __U, __m256i __A, __m128i __B) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U, (__v8si)_mm256_sra_epi32(__A, __B), (__v8si)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_sra_epi32(__mmask8 __U, __m256i __A, __m128i __B) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U, (__v8si)_mm256_sra_epi32(__A, __B), (__v8si)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_srai_epi32(__m128i __W, __mmask8 __U, __m128i __A, int __B) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U, (__v4si)_mm_srai_epi32(__A, __B), (__v4si)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_srai_epi32(__mmask8 __U, __m128i __A, int __B) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U, (__v4si)_mm_srai_epi32(__A, __B), (__v4si)_mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_srai_epi32(__m256i __W, __mmask8 __U, __m256i __A, int __B) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U, (__v8si)_mm256_srai_epi32(__A, __B), (__v8si)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_srai_epi32(__mmask8 __U, __m256i __A, int __B) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U, (__v8si)_mm256_srai_epi32(__A, __B), (__v8si)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sra_epi64(__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_psraq128((__v2di)__A, (__v2di)__B); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_sra_epi64(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U, \ (__v2di)_mm_sra_epi64(__A, __B), \ (__v2di)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_sra_epi64(__mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U, \ (__v2di)_mm_sra_epi64(__A, __B), \ (__v2di)_mm_setzero_di()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_sra_epi64(__m256i __A, __m128i __B) { return (__m256i)__builtin_ia32_psraq256((__v4di) __A, (__v2di) __B); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_sra_epi64(__m256i __W, __mmask8 __U, __m256i __A, __m128i __B) { return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U, \ (__v4di)_mm256_sra_epi64(__A, __B), \ (__v4di)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_sra_epi64(__mmask8 __U, __m256i __A, __m128i __B) { return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U, \ (__v4di)_mm256_sra_epi64(__A, __B), \ (__v4di)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_srai_epi64(__m128i __A, int __imm) { return (__m128i)__builtin_ia32_psraqi128((__v2di)__A, __imm); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_srai_epi64(__m128i __W, __mmask8 __U, __m128i __A, int __imm) { return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U, \ (__v2di)_mm_srai_epi64(__A, __imm), \ (__v2di)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_srai_epi64(__mmask8 __U, __m128i __A, int __imm) { return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U, \ (__v2di)_mm_srai_epi64(__A, __imm), \ (__v2di)_mm_setzero_di()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_srai_epi64(__m256i __A, int __imm) { return (__m256i)__builtin_ia32_psraqi256((__v4di)__A, __imm); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_srai_epi64(__m256i __W, __mmask8 __U, __m256i __A, int __imm) { return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U, \ (__v4di)_mm256_srai_epi64(__A, __imm), \ (__v4di)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_srai_epi64(__mmask8 __U, __m256i __A, int __imm) { return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U, \ (__v4di)_mm256_srai_epi64(__A, __imm), \ (__v4di)_mm256_setzero_si256()); } #define _mm_ternarylogic_epi32(A, B, C, imm) __extension__ ({ \ (__m128i)__builtin_ia32_pternlogd128_mask((__v4si)(__m128i)(A), \ (__v4si)(__m128i)(B), \ (__v4si)(__m128i)(C), (int)(imm), \ (__mmask8)-1); }) #define _mm_mask_ternarylogic_epi32(A, U, B, C, imm) __extension__ ({ \ (__m128i)__builtin_ia32_pternlogd128_mask((__v4si)(__m128i)(A), \ (__v4si)(__m128i)(B), \ (__v4si)(__m128i)(C), (int)(imm), \ (__mmask8)(U)); }) #define _mm_maskz_ternarylogic_epi32(U, A, B, C, imm) __extension__ ({ \ (__m128i)__builtin_ia32_pternlogd128_maskz((__v4si)(__m128i)(A), \ (__v4si)(__m128i)(B), \ (__v4si)(__m128i)(C), (int)(imm), \ (__mmask8)(U)); }) #define _mm256_ternarylogic_epi32(A, B, C, imm) __extension__ ({ \ (__m256i)__builtin_ia32_pternlogd256_mask((__v8si)(__m256i)(A), \ (__v8si)(__m256i)(B), \ (__v8si)(__m256i)(C), (int)(imm), \ (__mmask8)-1); }) #define _mm256_mask_ternarylogic_epi32(A, U, B, C, imm) __extension__ ({ \ (__m256i)__builtin_ia32_pternlogd256_mask((__v8si)(__m256i)(A), \ (__v8si)(__m256i)(B), \ (__v8si)(__m256i)(C), (int)(imm), \ (__mmask8)(U)); }) #define _mm256_maskz_ternarylogic_epi32(U, A, B, C, imm) __extension__ ({ \ (__m256i)__builtin_ia32_pternlogd256_maskz((__v8si)(__m256i)(A), \ (__v8si)(__m256i)(B), \ (__v8si)(__m256i)(C), (int)(imm), \ (__mmask8)(U)); }) #define _mm_ternarylogic_epi64(A, B, C, imm) __extension__ ({ \ (__m128i)__builtin_ia32_pternlogq128_mask((__v2di)(__m128i)(A), \ (__v2di)(__m128i)(B), \ (__v2di)(__m128i)(C), (int)(imm), \ (__mmask8)-1); }) #define _mm_mask_ternarylogic_epi64(A, U, B, C, imm) __extension__ ({ \ (__m128i)__builtin_ia32_pternlogq128_mask((__v2di)(__m128i)(A), \ (__v2di)(__m128i)(B), \ (__v2di)(__m128i)(C), (int)(imm), \ (__mmask8)(U)); }) #define _mm_maskz_ternarylogic_epi64(U, A, B, C, imm) __extension__ ({ \ (__m128i)__builtin_ia32_pternlogq128_maskz((__v2di)(__m128i)(A), \ (__v2di)(__m128i)(B), \ (__v2di)(__m128i)(C), (int)(imm), \ (__mmask8)(U)); }) #define _mm256_ternarylogic_epi64(A, B, C, imm) __extension__ ({ \ (__m256i)__builtin_ia32_pternlogq256_mask((__v4di)(__m256i)(A), \ (__v4di)(__m256i)(B), \ (__v4di)(__m256i)(C), (int)(imm), \ (__mmask8)-1); }) #define _mm256_mask_ternarylogic_epi64(A, U, B, C, imm) __extension__ ({ \ (__m256i)__builtin_ia32_pternlogq256_mask((__v4di)(__m256i)(A), \ (__v4di)(__m256i)(B), \ (__v4di)(__m256i)(C), (int)(imm), \ (__mmask8)(U)); }) #define _mm256_maskz_ternarylogic_epi64(U, A, B, C, imm) __extension__ ({ \ (__m256i)__builtin_ia32_pternlogq256_maskz((__v4di)(__m256i)(A), \ (__v4di)(__m256i)(B), \ (__v4di)(__m256i)(C), (int)(imm), \ (__mmask8)(U)); }) #define _mm256_shuffle_f32x4(A, B, imm) __extension__ ({ \ (__m256)__builtin_shufflevector((__v8sf)(__m256)(A), \ (__v8sf)(__m256)(B), \ 0 + ((((imm) >> 0) & 0x1) * 4), \ 1 + ((((imm) >> 0) & 0x1) * 4), \ 2 + ((((imm) >> 0) & 0x1) * 4), \ 3 + ((((imm) >> 0) & 0x1) * 4), \ 8 + ((((imm) >> 1) & 0x1) * 4), \ 9 + ((((imm) >> 1) & 0x1) * 4), \ 10 + ((((imm) >> 1) & 0x1) * 4), \ 11 + ((((imm) >> 1) & 0x1) * 4)); }) #define _mm256_mask_shuffle_f32x4(W, U, A, B, imm) __extension__ ({ \ (__m256)__builtin_ia32_selectps_256((__mmask8)(U), \ (__v8sf)_mm256_shuffle_f32x4((A), (B), (imm)), \ (__v8sf)(__m256)(W)); }) #define _mm256_maskz_shuffle_f32x4(U, A, B, imm) __extension__ ({ \ (__m256)__builtin_ia32_selectps_256((__mmask8)(U), \ (__v8sf)_mm256_shuffle_f32x4((A), (B), (imm)), \ (__v8sf)_mm256_setzero_ps()); }) #define _mm256_shuffle_f64x2(A, B, imm) __extension__ ({ \ (__m256d)__builtin_shufflevector((__v4df)(__m256d)(A), \ (__v4df)(__m256d)(B), \ 0 + ((((imm) >> 0) & 0x1) * 2), \ 1 + ((((imm) >> 0) & 0x1) * 2), \ 4 + ((((imm) >> 1) & 0x1) * 2), \ 5 + ((((imm) >> 1) & 0x1) * 2)); }) #define _mm256_mask_shuffle_f64x2(W, U, A, B, imm) __extension__ ({ \ (__m256d)__builtin_ia32_selectpd_256((__mmask8)(U), \ (__v4df)_mm256_shuffle_f64x2((A), (B), (imm)), \ (__v4df)(__m256)(W)); }) #define _mm256_maskz_shuffle_f64x2(U, A, B, imm) __extension__ ({ \ (__m256d)__builtin_ia32_selectpd_256((__mmask8)(U), \ (__v4df)_mm256_shuffle_f64x2((A), (B), (imm)), \ (__v4df)_mm256_setzero_pd()); }) #define _mm256_shuffle_i32x4(A, B, imm) __extension__ ({ \ (__m256i)__builtin_shufflevector((__v4di)(__m256i)(A), \ (__v4di)(__m256i)(B), \ 0 + ((((imm) >> 0) & 0x1) * 2), \ 1 + ((((imm) >> 0) & 0x1) * 2), \ 4 + ((((imm) >> 1) & 0x1) * 2), \ 5 + ((((imm) >> 1) & 0x1) * 2)); }) #define _mm256_mask_shuffle_i32x4(W, U, A, B, imm) __extension__ ({ \ (__m256i)__builtin_ia32_selectd_256((__mmask8)(U), \ (__v8si)_mm256_shuffle_i32x4((A), (B), (imm)), \ (__v8si)(__m256)(W)); }) #define _mm256_maskz_shuffle_i32x4(U, A, B, imm) __extension__ ({ \ (__m256i)__builtin_ia32_selectd_256((__mmask8)(U), \ (__v8si)_mm256_shuffle_i32x4((A), (B), (imm)), \ (__v8si)_mm256_setzero_si256()); }) #define _mm256_shuffle_i64x2(A, B, imm) __extension__ ({ \ (__m256i)__builtin_shufflevector((__v4di)(__m256i)(A), \ (__v4di)(__m256i)(B), \ 0 + ((((imm) >> 0) & 0x1) * 2), \ 1 + ((((imm) >> 0) & 0x1) * 2), \ 4 + ((((imm) >> 1) & 0x1) * 2), \ 5 + ((((imm) >> 1) & 0x1) * 2)); }) #define _mm256_mask_shuffle_i64x2(W, U, A, B, imm) __extension__ ({ \ (__m256i)__builtin_ia32_selectq_256((__mmask8)(U), \ (__v4di)_mm256_shuffle_i64x2((A), (B), (imm)), \ (__v4di)(__m256)(W)); }) #define _mm256_maskz_shuffle_i64x2(U, A, B, imm) __extension__ ({ \ (__m256i)__builtin_ia32_selectq_256((__mmask8)(U), \ (__v4di)_mm256_shuffle_i64x2((A), (B), (imm)), \ (__v4di)_mm256_setzero_si256()); }) #define _mm_mask_shuffle_pd(W, U, A, B, M) __extension__ ({ \ (__m128d)__builtin_ia32_selectpd_128((__mmask8)(U), \ (__v2df)_mm_shuffle_pd((A), (B), (M)), \ (__v2df)(__m128d)(W)); }) #define _mm_maskz_shuffle_pd(U, A, B, M) __extension__ ({ \ (__m128d)__builtin_ia32_selectpd_128((__mmask8)(U), \ (__v2df)_mm_shuffle_pd((A), (B), (M)), \ (__v2df)_mm_setzero_pd()); }) #define _mm256_mask_shuffle_pd(W, U, A, B, M) __extension__ ({ \ (__m256d)__builtin_ia32_selectpd_256((__mmask8)(U), \ (__v4df)_mm256_shuffle_pd((A), (B), (M)), \ (__v4df)(__m256d)(W)); }) #define _mm256_maskz_shuffle_pd(U, A, B, M) __extension__ ({ \ (__m256d)__builtin_ia32_selectpd_256((__mmask8)(U), \ (__v4df)_mm256_shuffle_pd((A), (B), (M)), \ (__v4df)_mm256_setzero_pd()); }) #define _mm_mask_shuffle_ps(W, U, A, B, M) __extension__ ({ \ (__m128)__builtin_ia32_selectps_128((__mmask8)(U), \ (__v4sf)_mm_shuffle_ps((A), (B), (M)), \ (__v4sf)(__m128)(W)); }) #define _mm_maskz_shuffle_ps(U, A, B, M) __extension__ ({ \ (__m128)__builtin_ia32_selectps_128((__mmask8)(U), \ (__v4sf)_mm_shuffle_ps((A), (B), (M)), \ (__v4sf)_mm_setzero_ps()); }) #define _mm256_mask_shuffle_ps(W, U, A, B, M) __extension__ ({ \ (__m256)__builtin_ia32_selectps_256((__mmask8)(U), \ (__v8sf)_mm256_shuffle_ps((A), (B), (M)), \ (__v8sf)(__m256)(W)); }) #define _mm256_maskz_shuffle_ps(U, A, B, M) __extension__ ({ \ (__m256)__builtin_ia32_selectps_256((__mmask8)(U), \ (__v8sf)_mm256_shuffle_ps((A), (B), (M)), \ (__v8sf)_mm256_setzero_ps()); }) static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_rsqrt14_pd (__m128d __A) { return (__m128d) __builtin_ia32_rsqrt14pd128_mask ((__v2df) __A, (__v2df) _mm_setzero_pd (), (__mmask8) -1); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask_rsqrt14_pd (__m128d __W, __mmask8 __U, __m128d __A) { return (__m128d) __builtin_ia32_rsqrt14pd128_mask ((__v2df) __A, (__v2df) __W, (__mmask8) __U); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_maskz_rsqrt14_pd (__mmask8 __U, __m128d __A) { return (__m128d) __builtin_ia32_rsqrt14pd128_mask ((__v2df) __A, (__v2df) _mm_setzero_pd (), (__mmask8) __U); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_rsqrt14_pd (__m256d __A) { return (__m256d) __builtin_ia32_rsqrt14pd256_mask ((__v4df) __A, (__v4df) _mm256_setzero_pd (), (__mmask8) -1); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_mask_rsqrt14_pd (__m256d __W, __mmask8 __U, __m256d __A) { return (__m256d) __builtin_ia32_rsqrt14pd256_mask ((__v4df) __A, (__v4df) __W, (__mmask8) __U); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_maskz_rsqrt14_pd (__mmask8 __U, __m256d __A) { return (__m256d) __builtin_ia32_rsqrt14pd256_mask ((__v4df) __A, (__v4df) _mm256_setzero_pd (), (__mmask8) __U); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_rsqrt14_ps (__m128 __A) { return (__m128) __builtin_ia32_rsqrt14ps128_mask ((__v4sf) __A, (__v4sf) _mm_setzero_ps (), (__mmask8) -1); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask_rsqrt14_ps (__m128 __W, __mmask8 __U, __m128 __A) { return (__m128) __builtin_ia32_rsqrt14ps128_mask ((__v4sf) __A, (__v4sf) __W, (__mmask8) __U); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maskz_rsqrt14_ps (__mmask8 __U, __m128 __A) { return (__m128) __builtin_ia32_rsqrt14ps128_mask ((__v4sf) __A, (__v4sf) _mm_setzero_ps (), (__mmask8) __U); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_rsqrt14_ps (__m256 __A) { return (__m256) __builtin_ia32_rsqrt14ps256_mask ((__v8sf) __A, (__v8sf) _mm256_setzero_ps (), (__mmask8) -1); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_mask_rsqrt14_ps (__m256 __W, __mmask8 __U, __m256 __A) { return (__m256) __builtin_ia32_rsqrt14ps256_mask ((__v8sf) __A, (__v8sf) __W, (__mmask8) __U); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_maskz_rsqrt14_ps (__mmask8 __U, __m256 __A) { return (__m256) __builtin_ia32_rsqrt14ps256_mask ((__v8sf) __A, (__v8sf) _mm256_setzero_ps (), (__mmask8) __U); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_broadcast_f32x4(__m128 __A) { return (__m256)__builtin_shufflevector((__v4sf)__A, (__v4sf)__A, 0, 1, 2, 3, 0, 1, 2, 3); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_mask_broadcast_f32x4(__m256 __O, __mmask8 __M, __m128 __A) { return (__m256)__builtin_ia32_selectps_256((__mmask8)__M, (__v8sf)_mm256_broadcast_f32x4(__A), (__v8sf)__O); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_maskz_broadcast_f32x4 (__mmask8 __M, __m128 __A) { return (__m256)__builtin_ia32_selectps_256((__mmask8)__M, (__v8sf)_mm256_broadcast_f32x4(__A), (__v8sf)_mm256_setzero_ps()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_broadcast_i32x4(__m128i __A) { return (__m256i)__builtin_shufflevector((__v4si)__A, (__v4si)__A, 0, 1, 2, 3, 0, 1, 2, 3); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_broadcast_i32x4(__m256i __O, __mmask8 __M, __m128i __A) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__M, (__v8si)_mm256_broadcast_i32x4(__A), (__v8si)__O); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_broadcast_i32x4(__mmask8 __M, __m128i __A) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__M, (__v8si)_mm256_broadcast_i32x4(__A), (__v8si)_mm256_setzero_si256()); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_mask_broadcastsd_pd (__m256d __O, __mmask8 __M, __m128d __A) { return (__m256d)__builtin_ia32_selectpd_256(__M, (__v4df) _mm256_broadcastsd_pd(__A), (__v4df) __O); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_maskz_broadcastsd_pd (__mmask8 __M, __m128d __A) { return (__m256d)__builtin_ia32_selectpd_256(__M, (__v4df) _mm256_broadcastsd_pd(__A), (__v4df) _mm256_setzero_pd()); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask_broadcastss_ps (__m128 __O, __mmask8 __M, __m128 __A) { return (__m128)__builtin_ia32_selectps_128(__M, (__v4sf) _mm_broadcastss_ps(__A), (__v4sf) __O); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maskz_broadcastss_ps (__mmask8 __M, __m128 __A) { return (__m128)__builtin_ia32_selectps_128(__M, (__v4sf) _mm_broadcastss_ps(__A), (__v4sf) _mm_setzero_ps()); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_mask_broadcastss_ps (__m256 __O, __mmask8 __M, __m128 __A) { return (__m256)__builtin_ia32_selectps_256(__M, (__v8sf) _mm256_broadcastss_ps(__A), (__v8sf) __O); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_maskz_broadcastss_ps (__mmask8 __M, __m128 __A) { return (__m256)__builtin_ia32_selectps_256(__M, (__v8sf) _mm256_broadcastss_ps(__A), (__v8sf) _mm256_setzero_ps()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_broadcastd_epi32 (__m128i __O, __mmask8 __M, __m128i __A) { return (__m128i)__builtin_ia32_selectd_128(__M, (__v4si) _mm_broadcastd_epi32(__A), (__v4si) __O); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_broadcastd_epi32 (__mmask8 __M, __m128i __A) { return (__m128i)__builtin_ia32_selectd_128(__M, (__v4si) _mm_broadcastd_epi32(__A), (__v4si) _mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_broadcastd_epi32 (__m256i __O, __mmask8 __M, __m128i __A) { return (__m256i)__builtin_ia32_selectd_256(__M, (__v8si) _mm256_broadcastd_epi32(__A), (__v8si) __O); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_broadcastd_epi32 (__mmask8 __M, __m128i __A) { return (__m256i)__builtin_ia32_selectd_256(__M, (__v8si) _mm256_broadcastd_epi32(__A), (__v8si) _mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_broadcastq_epi64 (__m128i __O, __mmask8 __M, __m128i __A) { return (__m128i)__builtin_ia32_selectq_128(__M, (__v2di) _mm_broadcastq_epi64(__A), (__v2di) __O); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_broadcastq_epi64 (__mmask8 __M, __m128i __A) { return (__m128i)__builtin_ia32_selectq_128(__M, (__v2di) _mm_broadcastq_epi64(__A), (__v2di) _mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_broadcastq_epi64 (__m256i __O, __mmask8 __M, __m128i __A) { return (__m256i)__builtin_ia32_selectq_256(__M, (__v4di) _mm256_broadcastq_epi64(__A), (__v4di) __O); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_broadcastq_epi64 (__mmask8 __M, __m128i __A) { return (__m256i)__builtin_ia32_selectq_256(__M, (__v4di) _mm256_broadcastq_epi64(__A), (__v4di) _mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtsepi32_epi8 (__m128i __A) { return (__m128i) __builtin_ia32_pmovsdb128_mask ((__v4si) __A, (__v16qi)_mm_undefined_si128(), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_cvtsepi32_epi8 (__m128i __O, __mmask8 __M, __m128i __A) { return (__m128i) __builtin_ia32_pmovsdb128_mask ((__v4si) __A, (__v16qi) __O, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_cvtsepi32_epi8 (__mmask8 __M, __m128i __A) { return (__m128i) __builtin_ia32_pmovsdb128_mask ((__v4si) __A, (__v16qi) _mm_setzero_si128 (), __M); } static __inline__ void __DEFAULT_FN_ATTRS _mm_mask_cvtsepi32_storeu_epi8 (void * __P, __mmask8 __M, __m128i __A) { __builtin_ia32_pmovsdb128mem_mask ((__v16qi *) __P, (__v4si) __A, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_cvtsepi32_epi8 (__m256i __A) { return (__m128i) __builtin_ia32_pmovsdb256_mask ((__v8si) __A, (__v16qi)_mm_undefined_si128(), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_mask_cvtsepi32_epi8 (__m128i __O, __mmask8 __M, __m256i __A) { return (__m128i) __builtin_ia32_pmovsdb256_mask ((__v8si) __A, (__v16qi) __O, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_maskz_cvtsepi32_epi8 (__mmask8 __M, __m256i __A) { return (__m128i) __builtin_ia32_pmovsdb256_mask ((__v8si) __A, (__v16qi) _mm_setzero_si128 (), __M); } static __inline__ void __DEFAULT_FN_ATTRS _mm256_mask_cvtsepi32_storeu_epi8 (void * __P, __mmask8 __M, __m256i __A) { __builtin_ia32_pmovsdb256mem_mask ((__v16qi *) __P, (__v8si) __A, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtsepi32_epi16 (__m128i __A) { return (__m128i) __builtin_ia32_pmovsdw128_mask ((__v4si) __A, (__v8hi)_mm_setzero_si128 (), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_cvtsepi32_epi16 (__m128i __O, __mmask8 __M, __m128i __A) { return (__m128i) __builtin_ia32_pmovsdw128_mask ((__v4si) __A, (__v8hi)__O, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_cvtsepi32_epi16 (__mmask8 __M, __m128i __A) { return (__m128i) __builtin_ia32_pmovsdw128_mask ((__v4si) __A, (__v8hi) _mm_setzero_si128 (), __M); } static __inline__ void __DEFAULT_FN_ATTRS _mm_mask_cvtsepi32_storeu_epi16 (void * __P, __mmask8 __M, __m128i __A) { __builtin_ia32_pmovsdw128mem_mask ((__v8hi *) __P, (__v4si) __A, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_cvtsepi32_epi16 (__m256i __A) { return (__m128i) __builtin_ia32_pmovsdw256_mask ((__v8si) __A, (__v8hi)_mm_undefined_si128(), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_mask_cvtsepi32_epi16 (__m128i __O, __mmask8 __M, __m256i __A) { return (__m128i) __builtin_ia32_pmovsdw256_mask ((__v8si) __A, (__v8hi) __O, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_maskz_cvtsepi32_epi16 (__mmask8 __M, __m256i __A) { return (__m128i) __builtin_ia32_pmovsdw256_mask ((__v8si) __A, (__v8hi) _mm_setzero_si128 (), __M); } static __inline__ void __DEFAULT_FN_ATTRS _mm256_mask_cvtsepi32_storeu_epi16 (void * __P, __mmask8 __M, __m256i __A) { __builtin_ia32_pmovsdw256mem_mask ((__v8hi *) __P, (__v8si) __A, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtsepi64_epi8 (__m128i __A) { return (__m128i) __builtin_ia32_pmovsqb128_mask ((__v2di) __A, (__v16qi)_mm_undefined_si128(), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_cvtsepi64_epi8 (__m128i __O, __mmask8 __M, __m128i __A) { return (__m128i) __builtin_ia32_pmovsqb128_mask ((__v2di) __A, (__v16qi) __O, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_cvtsepi64_epi8 (__mmask8 __M, __m128i __A) { return (__m128i) __builtin_ia32_pmovsqb128_mask ((__v2di) __A, (__v16qi) _mm_setzero_si128 (), __M); } static __inline__ void __DEFAULT_FN_ATTRS _mm_mask_cvtsepi64_storeu_epi8 (void * __P, __mmask8 __M, __m128i __A) { __builtin_ia32_pmovsqb128mem_mask ((__v16qi *) __P, (__v2di) __A, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_cvtsepi64_epi8 (__m256i __A) { return (__m128i) __builtin_ia32_pmovsqb256_mask ((__v4di) __A, (__v16qi)_mm_undefined_si128(), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_mask_cvtsepi64_epi8 (__m128i __O, __mmask8 __M, __m256i __A) { return (__m128i) __builtin_ia32_pmovsqb256_mask ((__v4di) __A, (__v16qi) __O, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_maskz_cvtsepi64_epi8 (__mmask8 __M, __m256i __A) { return (__m128i) __builtin_ia32_pmovsqb256_mask ((__v4di) __A, (__v16qi) _mm_setzero_si128 (), __M); } static __inline__ void __DEFAULT_FN_ATTRS _mm256_mask_cvtsepi64_storeu_epi8 (void * __P, __mmask8 __M, __m256i __A) { __builtin_ia32_pmovsqb256mem_mask ((__v16qi *) __P, (__v4di) __A, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtsepi64_epi32 (__m128i __A) { return (__m128i) __builtin_ia32_pmovsqd128_mask ((__v2di) __A, (__v4si)_mm_undefined_si128(), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_cvtsepi64_epi32 (__m128i __O, __mmask8 __M, __m128i __A) { return (__m128i) __builtin_ia32_pmovsqd128_mask ((__v2di) __A, (__v4si) __O, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_cvtsepi64_epi32 (__mmask8 __M, __m128i __A) { return (__m128i) __builtin_ia32_pmovsqd128_mask ((__v2di) __A, (__v4si) _mm_setzero_si128 (), __M); } static __inline__ void __DEFAULT_FN_ATTRS _mm_mask_cvtsepi64_storeu_epi32 (void * __P, __mmask8 __M, __m128i __A) { __builtin_ia32_pmovsqd128mem_mask ((__v4si *) __P, (__v2di) __A, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_cvtsepi64_epi32 (__m256i __A) { return (__m128i) __builtin_ia32_pmovsqd256_mask ((__v4di) __A, (__v4si)_mm_undefined_si128(), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_mask_cvtsepi64_epi32 (__m128i __O, __mmask8 __M, __m256i __A) { return (__m128i) __builtin_ia32_pmovsqd256_mask ((__v4di) __A, (__v4si)__O, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_maskz_cvtsepi64_epi32 (__mmask8 __M, __m256i __A) { return (__m128i) __builtin_ia32_pmovsqd256_mask ((__v4di) __A, (__v4si) _mm_setzero_si128 (), __M); } static __inline__ void __DEFAULT_FN_ATTRS _mm256_mask_cvtsepi64_storeu_epi32 (void * __P, __mmask8 __M, __m256i __A) { __builtin_ia32_pmovsqd256mem_mask ((__v4si *) __P, (__v4di) __A, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtsepi64_epi16 (__m128i __A) { return (__m128i) __builtin_ia32_pmovsqw128_mask ((__v2di) __A, (__v8hi)_mm_undefined_si128(), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_cvtsepi64_epi16 (__m128i __O, __mmask8 __M, __m128i __A) { return (__m128i) __builtin_ia32_pmovsqw128_mask ((__v2di) __A, (__v8hi) __O, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_cvtsepi64_epi16 (__mmask8 __M, __m128i __A) { return (__m128i) __builtin_ia32_pmovsqw128_mask ((__v2di) __A, (__v8hi) _mm_setzero_si128 (), __M); } static __inline__ void __DEFAULT_FN_ATTRS _mm_mask_cvtsepi64_storeu_epi16 (void * __P, __mmask8 __M, __m128i __A) { __builtin_ia32_pmovsqw128mem_mask ((__v8hi *) __P, (__v2di) __A, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_cvtsepi64_epi16 (__m256i __A) { return (__m128i) __builtin_ia32_pmovsqw256_mask ((__v4di) __A, (__v8hi)_mm_undefined_si128(), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_mask_cvtsepi64_epi16 (__m128i __O, __mmask8 __M, __m256i __A) { return (__m128i) __builtin_ia32_pmovsqw256_mask ((__v4di) __A, (__v8hi) __O, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_maskz_cvtsepi64_epi16 (__mmask8 __M, __m256i __A) { return (__m128i) __builtin_ia32_pmovsqw256_mask ((__v4di) __A, (__v8hi) _mm_setzero_si128 (), __M); } static __inline__ void __DEFAULT_FN_ATTRS _mm256_mask_cvtsepi64_storeu_epi16 (void * __P, __mmask8 __M, __m256i __A) { __builtin_ia32_pmovsqw256mem_mask ((__v8hi *) __P, (__v4di) __A, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtusepi32_epi8 (__m128i __A) { return (__m128i) __builtin_ia32_pmovusdb128_mask ((__v4si) __A, (__v16qi)_mm_undefined_si128(), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_cvtusepi32_epi8 (__m128i __O, __mmask8 __M, __m128i __A) { return (__m128i) __builtin_ia32_pmovusdb128_mask ((__v4si) __A, (__v16qi) __O, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_cvtusepi32_epi8 (__mmask8 __M, __m128i __A) { return (__m128i) __builtin_ia32_pmovusdb128_mask ((__v4si) __A, (__v16qi) _mm_setzero_si128 (), __M); } static __inline__ void __DEFAULT_FN_ATTRS _mm_mask_cvtusepi32_storeu_epi8 (void * __P, __mmask8 __M, __m128i __A) { __builtin_ia32_pmovusdb128mem_mask ((__v16qi *) __P, (__v4si) __A, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_cvtusepi32_epi8 (__m256i __A) { return (__m128i) __builtin_ia32_pmovusdb256_mask ((__v8si) __A, (__v16qi)_mm_undefined_si128(), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_mask_cvtusepi32_epi8 (__m128i __O, __mmask8 __M, __m256i __A) { return (__m128i) __builtin_ia32_pmovusdb256_mask ((__v8si) __A, (__v16qi) __O, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_maskz_cvtusepi32_epi8 (__mmask8 __M, __m256i __A) { return (__m128i) __builtin_ia32_pmovusdb256_mask ((__v8si) __A, (__v16qi) _mm_setzero_si128 (), __M); } static __inline__ void __DEFAULT_FN_ATTRS _mm256_mask_cvtusepi32_storeu_epi8 (void * __P, __mmask8 __M, __m256i __A) { __builtin_ia32_pmovusdb256mem_mask ((__v16qi*) __P, (__v8si) __A, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtusepi32_epi16 (__m128i __A) { return (__m128i) __builtin_ia32_pmovusdw128_mask ((__v4si) __A, (__v8hi)_mm_undefined_si128(), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_cvtusepi32_epi16 (__m128i __O, __mmask8 __M, __m128i __A) { return (__m128i) __builtin_ia32_pmovusdw128_mask ((__v4si) __A, (__v8hi) __O, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_cvtusepi32_epi16 (__mmask8 __M, __m128i __A) { return (__m128i) __builtin_ia32_pmovusdw128_mask ((__v4si) __A, (__v8hi) _mm_setzero_si128 (), __M); } static __inline__ void __DEFAULT_FN_ATTRS _mm_mask_cvtusepi32_storeu_epi16 (void * __P, __mmask8 __M, __m128i __A) { __builtin_ia32_pmovusdw128mem_mask ((__v8hi *) __P, (__v4si) __A, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_cvtusepi32_epi16 (__m256i __A) { return (__m128i) __builtin_ia32_pmovusdw256_mask ((__v8si) __A, (__v8hi) _mm_undefined_si128(), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_mask_cvtusepi32_epi16 (__m128i __O, __mmask8 __M, __m256i __A) { return (__m128i) __builtin_ia32_pmovusdw256_mask ((__v8si) __A, (__v8hi) __O, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_maskz_cvtusepi32_epi16 (__mmask8 __M, __m256i __A) { return (__m128i) __builtin_ia32_pmovusdw256_mask ((__v8si) __A, (__v8hi) _mm_setzero_si128 (), __M); } static __inline__ void __DEFAULT_FN_ATTRS _mm256_mask_cvtusepi32_storeu_epi16 (void * __P, __mmask8 __M, __m256i __A) { __builtin_ia32_pmovusdw256mem_mask ((__v8hi *) __P, (__v8si) __A, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtusepi64_epi8 (__m128i __A) { return (__m128i) __builtin_ia32_pmovusqb128_mask ((__v2di) __A, (__v16qi)_mm_undefined_si128(), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_cvtusepi64_epi8 (__m128i __O, __mmask8 __M, __m128i __A) { return (__m128i) __builtin_ia32_pmovusqb128_mask ((__v2di) __A, (__v16qi) __O, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_cvtusepi64_epi8 (__mmask8 __M, __m128i __A) { return (__m128i) __builtin_ia32_pmovusqb128_mask ((__v2di) __A, (__v16qi) _mm_setzero_si128 (), __M); } static __inline__ void __DEFAULT_FN_ATTRS _mm_mask_cvtusepi64_storeu_epi8 (void * __P, __mmask8 __M, __m128i __A) { __builtin_ia32_pmovusqb128mem_mask ((__v16qi *) __P, (__v2di) __A, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_cvtusepi64_epi8 (__m256i __A) { return (__m128i) __builtin_ia32_pmovusqb256_mask ((__v4di) __A, (__v16qi)_mm_undefined_si128(), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_mask_cvtusepi64_epi8 (__m128i __O, __mmask8 __M, __m256i __A) { return (__m128i) __builtin_ia32_pmovusqb256_mask ((__v4di) __A, (__v16qi) __O, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_maskz_cvtusepi64_epi8 (__mmask8 __M, __m256i __A) { return (__m128i) __builtin_ia32_pmovusqb256_mask ((__v4di) __A, (__v16qi) _mm_setzero_si128 (), __M); } static __inline__ void __DEFAULT_FN_ATTRS _mm256_mask_cvtusepi64_storeu_epi8 (void * __P, __mmask8 __M, __m256i __A) { __builtin_ia32_pmovusqb256mem_mask ((__v16qi *) __P, (__v4di) __A, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtusepi64_epi32 (__m128i __A) { return (__m128i) __builtin_ia32_pmovusqd128_mask ((__v2di) __A, (__v4si)_mm_undefined_si128(), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_cvtusepi64_epi32 (__m128i __O, __mmask8 __M, __m128i __A) { return (__m128i) __builtin_ia32_pmovusqd128_mask ((__v2di) __A, (__v4si) __O, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_cvtusepi64_epi32 (__mmask8 __M, __m128i __A) { return (__m128i) __builtin_ia32_pmovusqd128_mask ((__v2di) __A, (__v4si) _mm_setzero_si128 (), __M); } static __inline__ void __DEFAULT_FN_ATTRS _mm_mask_cvtusepi64_storeu_epi32 (void * __P, __mmask8 __M, __m128i __A) { __builtin_ia32_pmovusqd128mem_mask ((__v4si *) __P, (__v2di) __A, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_cvtusepi64_epi32 (__m256i __A) { return (__m128i) __builtin_ia32_pmovusqd256_mask ((__v4di) __A, (__v4si)_mm_undefined_si128(), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_mask_cvtusepi64_epi32 (__m128i __O, __mmask8 __M, __m256i __A) { return (__m128i) __builtin_ia32_pmovusqd256_mask ((__v4di) __A, (__v4si) __O, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_maskz_cvtusepi64_epi32 (__mmask8 __M, __m256i __A) { return (__m128i) __builtin_ia32_pmovusqd256_mask ((__v4di) __A, (__v4si) _mm_setzero_si128 (), __M); } static __inline__ void __DEFAULT_FN_ATTRS _mm256_mask_cvtusepi64_storeu_epi32 (void * __P, __mmask8 __M, __m256i __A) { __builtin_ia32_pmovusqd256mem_mask ((__v4si *) __P, (__v4di) __A, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtusepi64_epi16 (__m128i __A) { return (__m128i) __builtin_ia32_pmovusqw128_mask ((__v2di) __A, (__v8hi)_mm_undefined_si128(), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_cvtusepi64_epi16 (__m128i __O, __mmask8 __M, __m128i __A) { return (__m128i) __builtin_ia32_pmovusqw128_mask ((__v2di) __A, (__v8hi) __O, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_cvtusepi64_epi16 (__mmask8 __M, __m128i __A) { return (__m128i) __builtin_ia32_pmovusqw128_mask ((__v2di) __A, (__v8hi) _mm_setzero_si128 (), __M); } static __inline__ void __DEFAULT_FN_ATTRS _mm_mask_cvtusepi64_storeu_epi16 (void * __P, __mmask8 __M, __m128i __A) { __builtin_ia32_pmovusqw128mem_mask ((__v8hi *) __P, (__v2di) __A, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_cvtusepi64_epi16 (__m256i __A) { return (__m128i) __builtin_ia32_pmovusqw256_mask ((__v4di) __A, (__v8hi)_mm_undefined_si128(), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_mask_cvtusepi64_epi16 (__m128i __O, __mmask8 __M, __m256i __A) { return (__m128i) __builtin_ia32_pmovusqw256_mask ((__v4di) __A, (__v8hi) __O, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_maskz_cvtusepi64_epi16 (__mmask8 __M, __m256i __A) { return (__m128i) __builtin_ia32_pmovusqw256_mask ((__v4di) __A, (__v8hi) _mm_setzero_si128 (), __M); } static __inline__ void __DEFAULT_FN_ATTRS _mm256_mask_cvtusepi64_storeu_epi16 (void * __P, __mmask8 __M, __m256i __A) { return __builtin_ia32_pmovusqw256mem_mask ((__v8hi *) __P, (__v4di) __A, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtepi32_epi8 (__m128i __A) { return (__m128i) __builtin_ia32_pmovdb128_mask ((__v4si) __A, (__v16qi)_mm_undefined_si128(), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_cvtepi32_epi8 (__m128i __O, __mmask8 __M, __m128i __A) { return (__m128i) __builtin_ia32_pmovdb128_mask ((__v4si) __A, (__v16qi) __O, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_cvtepi32_epi8 (__mmask8 __M, __m128i __A) { return (__m128i) __builtin_ia32_pmovdb128_mask ((__v4si) __A, (__v16qi) _mm_setzero_si128 (), __M); } static __inline__ void __DEFAULT_FN_ATTRS _mm_mask_cvtepi32_storeu_epi8 (void * __P, __mmask8 __M, __m128i __A) { __builtin_ia32_pmovdb128mem_mask ((__v16qi *) __P, (__v4si) __A, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_cvtepi32_epi8 (__m256i __A) { return (__m128i) __builtin_ia32_pmovdb256_mask ((__v8si) __A, (__v16qi)_mm_undefined_si128(), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_mask_cvtepi32_epi8 (__m128i __O, __mmask8 __M, __m256i __A) { return (__m128i) __builtin_ia32_pmovdb256_mask ((__v8si) __A, (__v16qi) __O, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_maskz_cvtepi32_epi8 (__mmask8 __M, __m256i __A) { return (__m128i) __builtin_ia32_pmovdb256_mask ((__v8si) __A, (__v16qi) _mm_setzero_si128 (), __M); } static __inline__ void __DEFAULT_FN_ATTRS _mm256_mask_cvtepi32_storeu_epi8 (void * __P, __mmask8 __M, __m256i __A) { __builtin_ia32_pmovdb256mem_mask ((__v16qi *) __P, (__v8si) __A, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtepi32_epi16 (__m128i __A) { return (__m128i) __builtin_ia32_pmovdw128_mask ((__v4si) __A, (__v8hi) _mm_setzero_si128 (), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_cvtepi32_epi16 (__m128i __O, __mmask8 __M, __m128i __A) { return (__m128i) __builtin_ia32_pmovdw128_mask ((__v4si) __A, (__v8hi) __O, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_cvtepi32_epi16 (__mmask8 __M, __m128i __A) { return (__m128i) __builtin_ia32_pmovdw128_mask ((__v4si) __A, (__v8hi) _mm_setzero_si128 (), __M); } static __inline__ void __DEFAULT_FN_ATTRS _mm_mask_cvtepi32_storeu_epi16 (void * __P, __mmask8 __M, __m128i __A) { __builtin_ia32_pmovdw128mem_mask ((__v8hi *) __P, (__v4si) __A, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_cvtepi32_epi16 (__m256i __A) { return (__m128i) __builtin_ia32_pmovdw256_mask ((__v8si) __A, (__v8hi)_mm_setzero_si128 (), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_mask_cvtepi32_epi16 (__m128i __O, __mmask8 __M, __m256i __A) { return (__m128i) __builtin_ia32_pmovdw256_mask ((__v8si) __A, (__v8hi) __O, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_maskz_cvtepi32_epi16 (__mmask8 __M, __m256i __A) { return (__m128i) __builtin_ia32_pmovdw256_mask ((__v8si) __A, (__v8hi) _mm_setzero_si128 (), __M); } static __inline__ void __DEFAULT_FN_ATTRS _mm256_mask_cvtepi32_storeu_epi16 (void * __P, __mmask8 __M, __m256i __A) { __builtin_ia32_pmovdw256mem_mask ((__v8hi *) __P, (__v8si) __A, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtepi64_epi8 (__m128i __A) { return (__m128i) __builtin_ia32_pmovqb128_mask ((__v2di) __A, (__v16qi) _mm_undefined_si128(), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_cvtepi64_epi8 (__m128i __O, __mmask8 __M, __m128i __A) { return (__m128i) __builtin_ia32_pmovqb128_mask ((__v2di) __A, (__v16qi) __O, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_cvtepi64_epi8 (__mmask8 __M, __m128i __A) { return (__m128i) __builtin_ia32_pmovqb128_mask ((__v2di) __A, (__v16qi) _mm_setzero_si128 (), __M); } static __inline__ void __DEFAULT_FN_ATTRS _mm_mask_cvtepi64_storeu_epi8 (void * __P, __mmask8 __M, __m128i __A) { __builtin_ia32_pmovqb128mem_mask ((__v16qi *) __P, (__v2di) __A, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_cvtepi64_epi8 (__m256i __A) { return (__m128i) __builtin_ia32_pmovqb256_mask ((__v4di) __A, (__v16qi) _mm_undefined_si128(), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_mask_cvtepi64_epi8 (__m128i __O, __mmask8 __M, __m256i __A) { return (__m128i) __builtin_ia32_pmovqb256_mask ((__v4di) __A, (__v16qi) __O, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_maskz_cvtepi64_epi8 (__mmask8 __M, __m256i __A) { return (__m128i) __builtin_ia32_pmovqb256_mask ((__v4di) __A, (__v16qi) _mm_setzero_si128 (), __M); } static __inline__ void __DEFAULT_FN_ATTRS _mm256_mask_cvtepi64_storeu_epi8 (void * __P, __mmask8 __M, __m256i __A) { __builtin_ia32_pmovqb256mem_mask ((__v16qi *) __P, (__v4di) __A, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtepi64_epi32 (__m128i __A) { return (__m128i) __builtin_ia32_pmovqd128_mask ((__v2di) __A, (__v4si)_mm_undefined_si128(), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_cvtepi64_epi32 (__m128i __O, __mmask8 __M, __m128i __A) { return (__m128i) __builtin_ia32_pmovqd128_mask ((__v2di) __A, (__v4si) __O, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_cvtepi64_epi32 (__mmask8 __M, __m128i __A) { return (__m128i) __builtin_ia32_pmovqd128_mask ((__v2di) __A, (__v4si) _mm_setzero_si128 (), __M); } static __inline__ void __DEFAULT_FN_ATTRS _mm_mask_cvtepi64_storeu_epi32 (void * __P, __mmask8 __M, __m128i __A) { __builtin_ia32_pmovqd128mem_mask ((__v4si *) __P, (__v2di) __A, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_cvtepi64_epi32 (__m256i __A) { return (__m128i) __builtin_ia32_pmovqd256_mask ((__v4di) __A, (__v4si) _mm_undefined_si128(), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_mask_cvtepi64_epi32 (__m128i __O, __mmask8 __M, __m256i __A) { return (__m128i) __builtin_ia32_pmovqd256_mask ((__v4di) __A, (__v4si) __O, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_maskz_cvtepi64_epi32 (__mmask8 __M, __m256i __A) { return (__m128i) __builtin_ia32_pmovqd256_mask ((__v4di) __A, (__v4si) _mm_setzero_si128 (), __M); } static __inline__ void __DEFAULT_FN_ATTRS _mm256_mask_cvtepi64_storeu_epi32 (void * __P, __mmask8 __M, __m256i __A) { __builtin_ia32_pmovqd256mem_mask ((__v4si *) __P, (__v4di) __A, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtepi64_epi16 (__m128i __A) { return (__m128i) __builtin_ia32_pmovqw128_mask ((__v2di) __A, (__v8hi) _mm_undefined_si128(), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_cvtepi64_epi16 (__m128i __O, __mmask8 __M, __m128i __A) { return (__m128i) __builtin_ia32_pmovqw128_mask ((__v2di) __A, (__v8hi)__O, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_cvtepi64_epi16 (__mmask8 __M, __m128i __A) { return (__m128i) __builtin_ia32_pmovqw128_mask ((__v2di) __A, (__v8hi) _mm_setzero_si128 (), __M); } static __inline__ void __DEFAULT_FN_ATTRS _mm_mask_cvtepi64_storeu_epi16 (void * __P, __mmask8 __M, __m128i __A) { __builtin_ia32_pmovqw128mem_mask ((__v8hi *) __P, (__v2di) __A, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_cvtepi64_epi16 (__m256i __A) { return (__m128i) __builtin_ia32_pmovqw256_mask ((__v4di) __A, (__v8hi)_mm_undefined_si128(), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_mask_cvtepi64_epi16 (__m128i __O, __mmask8 __M, __m256i __A) { return (__m128i) __builtin_ia32_pmovqw256_mask ((__v4di) __A, (__v8hi) __O, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_maskz_cvtepi64_epi16 (__mmask8 __M, __m256i __A) { return (__m128i) __builtin_ia32_pmovqw256_mask ((__v4di) __A, (__v8hi) _mm_setzero_si128 (), __M); } static __inline__ void __DEFAULT_FN_ATTRS _mm256_mask_cvtepi64_storeu_epi16 (void * __P, __mmask8 __M, __m256i __A) { __builtin_ia32_pmovqw256mem_mask ((__v8hi *) __P, (__v4di) __A, __M); } #define _mm256_extractf32x4_ps(A, imm) __extension__ ({ \ (__m128)__builtin_shufflevector((__v8sf)(__m256)(A), \ (__v8sf)_mm256_undefined_ps(), \ ((imm) & 1) ? 4 : 0, \ ((imm) & 1) ? 5 : 1, \ ((imm) & 1) ? 6 : 2, \ ((imm) & 1) ? 7 : 3); }) #define _mm256_mask_extractf32x4_ps(W, U, A, imm) __extension__ ({ \ (__m128)__builtin_ia32_selectps_128((__mmask8)(U), \ (__v4sf)_mm256_extractf32x4_ps((A), (imm)), \ (__v4sf)(W)); }) #define _mm256_maskz_extractf32x4_ps(U, A, imm) __extension__ ({ \ (__m128)__builtin_ia32_selectps_128((__mmask8)(U), \ (__v4sf)_mm256_extractf32x4_ps((A), (imm)), \ (__v4sf)_mm_setzero_ps()); }) #define _mm256_extracti32x4_epi32(A, imm) __extension__ ({ \ (__m128i)__builtin_shufflevector((__v8si)(__m256)(A), \ (__v8si)_mm256_undefined_si256(), \ ((imm) & 1) ? 4 : 0, \ ((imm) & 1) ? 5 : 1, \ ((imm) & 1) ? 6 : 2, \ ((imm) & 1) ? 7 : 3); }) #define _mm256_mask_extracti32x4_epi32(W, U, A, imm) __extension__ ({ \ (__m128i)__builtin_ia32_selectd_128((__mmask8)(U), \ (__v4si)_mm256_extracti32x4_epi32((A), (imm)), \ (__v4si)(W)); }) #define _mm256_maskz_extracti32x4_epi32(U, A, imm) __extension__ ({ \ (__m128i)__builtin_ia32_selectd_128((__mmask8)(U), \ (__v4si)_mm256_extracti32x4_epi32((A), (imm)), \ (__v4si)_mm_setzero_si128()); }) #define _mm256_insertf32x4(A, B, imm) __extension__ ({ \ (__m256)__builtin_shufflevector((__v8sf)(A), \ (__v8sf)_mm256_castps128_ps256((__m128)(B)), \ ((imm) & 0x1) ? 0 : 8, \ ((imm) & 0x1) ? 1 : 9, \ ((imm) & 0x1) ? 2 : 10, \ ((imm) & 0x1) ? 3 : 11, \ ((imm) & 0x1) ? 8 : 4, \ ((imm) & 0x1) ? 9 : 5, \ ((imm) & 0x1) ? 10 : 6, \ ((imm) & 0x1) ? 11 : 7); }) #define _mm256_mask_insertf32x4(W, U, A, B, imm) __extension__ ({ \ (__m256)__builtin_ia32_selectps_256((__mmask8)(U), \ (__v8sf)_mm256_insertf32x4((A), (B), (imm)), \ (__v8sf)(W)); }) #define _mm256_maskz_insertf32x4(U, A, B, imm) __extension__ ({ \ (__m256)__builtin_ia32_selectps_256((__mmask8)(U), \ (__v8sf)_mm256_insertf32x4((A), (B), (imm)), \ (__v8sf)_mm256_setzero_ps()); }) #define _mm256_inserti32x4(A, B, imm) __extension__ ({ \ (__m256i)__builtin_shufflevector((__v8si)(A), \ (__v8si)_mm256_castsi128_si256((__m128i)(B)), \ ((imm) & 0x1) ? 0 : 8, \ ((imm) & 0x1) ? 1 : 9, \ ((imm) & 0x1) ? 2 : 10, \ ((imm) & 0x1) ? 3 : 11, \ ((imm) & 0x1) ? 8 : 4, \ ((imm) & 0x1) ? 9 : 5, \ ((imm) & 0x1) ? 10 : 6, \ ((imm) & 0x1) ? 11 : 7); }) #define _mm256_mask_inserti32x4(W, U, A, B, imm) __extension__ ({ \ (__m256i)__builtin_ia32_selectd_256((__mmask8)(U), \ (__v8si)_mm256_inserti32x4((A), (B), (imm)), \ (__v8si)(W)); }) #define _mm256_maskz_inserti32x4(U, A, B, imm) __extension__ ({ \ (__m256i)__builtin_ia32_selectd_256((__mmask8)(U), \ (__v8si)_mm256_inserti32x4((A), (B), (imm)), \ (__v8si)_mm256_setzero_si256()); }) #define _mm_getmant_pd(A, B, C) __extension__({\ (__m128d)__builtin_ia32_getmantpd128_mask((__v2df)(__m128d)(A), \ (int)(((C)<<2) | (B)), \ (__v2df)_mm_setzero_pd(), \ (__mmask8)-1); }) #define _mm_mask_getmant_pd(W, U, A, B, C) __extension__({\ (__m128d)__builtin_ia32_getmantpd128_mask((__v2df)(__m128d)(A), \ (int)(((C)<<2) | (B)), \ (__v2df)(__m128d)(W), \ (__mmask8)(U)); }) #define _mm_maskz_getmant_pd(U, A, B, C) __extension__({\ (__m128d)__builtin_ia32_getmantpd128_mask((__v2df)(__m128d)(A), \ (int)(((C)<<2) | (B)), \ (__v2df)_mm_setzero_pd(), \ (__mmask8)(U)); }) #define _mm256_getmant_pd(A, B, C) __extension__ ({ \ (__m256d)__builtin_ia32_getmantpd256_mask((__v4df)(__m256d)(A), \ (int)(((C)<<2) | (B)), \ (__v4df)_mm256_setzero_pd(), \ (__mmask8)-1); }) #define _mm256_mask_getmant_pd(W, U, A, B, C) __extension__ ({ \ (__m256d)__builtin_ia32_getmantpd256_mask((__v4df)(__m256d)(A), \ (int)(((C)<<2) | (B)), \ (__v4df)(__m256d)(W), \ (__mmask8)(U)); }) #define _mm256_maskz_getmant_pd(U, A, B, C) __extension__ ({ \ (__m256d)__builtin_ia32_getmantpd256_mask((__v4df)(__m256d)(A), \ (int)(((C)<<2) | (B)), \ (__v4df)_mm256_setzero_pd(), \ (__mmask8)(U)); }) #define _mm_getmant_ps(A, B, C) __extension__ ({ \ (__m128)__builtin_ia32_getmantps128_mask((__v4sf)(__m128)(A), \ (int)(((C)<<2) | (B)), \ (__v4sf)_mm_setzero_ps(), \ (__mmask8)-1); }) #define _mm_mask_getmant_ps(W, U, A, B, C) __extension__ ({ \ (__m128)__builtin_ia32_getmantps128_mask((__v4sf)(__m128)(A), \ (int)(((C)<<2) | (B)), \ (__v4sf)(__m128)(W), \ (__mmask8)(U)); }) #define _mm_maskz_getmant_ps(U, A, B, C) __extension__ ({ \ (__m128)__builtin_ia32_getmantps128_mask((__v4sf)(__m128)(A), \ (int)(((C)<<2) | (B)), \ (__v4sf)_mm_setzero_ps(), \ (__mmask8)(U)); }) #define _mm256_getmant_ps(A, B, C) __extension__ ({ \ (__m256)__builtin_ia32_getmantps256_mask((__v8sf)(__m256)(A), \ (int)(((C)<<2) | (B)), \ (__v8sf)_mm256_setzero_ps(), \ (__mmask8)-1); }) #define _mm256_mask_getmant_ps(W, U, A, B, C) __extension__ ({ \ (__m256)__builtin_ia32_getmantps256_mask((__v8sf)(__m256)(A), \ (int)(((C)<<2) | (B)), \ (__v8sf)(__m256)(W), \ (__mmask8)(U)); }) #define _mm256_maskz_getmant_ps(U, A, B, C) __extension__ ({ \ (__m256)__builtin_ia32_getmantps256_mask((__v8sf)(__m256)(A), \ (int)(((C)<<2) | (B)), \ (__v8sf)_mm256_setzero_ps(), \ (__mmask8)(U)); }) #define _mm_mmask_i64gather_pd(v1_old, mask, index, addr, scale) __extension__ ({\ (__m128d)__builtin_ia32_gather3div2df((__v2df)(__m128d)(v1_old), \ (double const *)(addr), \ (__v2di)(__m128i)(index), \ (__mmask8)(mask), (int)(scale)); }) #define _mm_mmask_i64gather_epi64(v1_old, mask, index, addr, scale) __extension__ ({\ (__m128i)__builtin_ia32_gather3div2di((__v2di)(__m128i)(v1_old), \ (long long const *)(addr), \ (__v2di)(__m128i)(index), \ (__mmask8)(mask), (int)(scale)); }) #define _mm256_mmask_i64gather_pd(v1_old, mask, index, addr, scale) __extension__ ({\ (__m256d)__builtin_ia32_gather3div4df((__v4df)(__m256d)(v1_old), \ (double const *)(addr), \ (__v4di)(__m256i)(index), \ (__mmask8)(mask), (int)(scale)); }) #define _mm256_mmask_i64gather_epi64(v1_old, mask, index, addr, scale) __extension__ ({\ (__m256i)__builtin_ia32_gather3div4di((__v4di)(__m256i)(v1_old), \ (long long const *)(addr), \ (__v4di)(__m256i)(index), \ (__mmask8)(mask), (int)(scale)); }) #define _mm_mmask_i64gather_ps(v1_old, mask, index, addr, scale) __extension__ ({\ (__m128)__builtin_ia32_gather3div4sf((__v4sf)(__m128)(v1_old), \ (float const *)(addr), \ (__v2di)(__m128i)(index), \ (__mmask8)(mask), (int)(scale)); }) #define _mm_mmask_i64gather_epi32(v1_old, mask, index, addr, scale) __extension__ ({\ (__m128i)__builtin_ia32_gather3div4si((__v4si)(__m128i)(v1_old), \ (int const *)(addr), \ (__v2di)(__m128i)(index), \ (__mmask8)(mask), (int)(scale)); }) #define _mm256_mmask_i64gather_ps(v1_old, mask, index, addr, scale) __extension__ ({\ (__m128)__builtin_ia32_gather3div8sf((__v4sf)(__m128)(v1_old), \ (float const *)(addr), \ (__v4di)(__m256i)(index), \ (__mmask8)(mask), (int)(scale)); }) #define _mm256_mmask_i64gather_epi32(v1_old, mask, index, addr, scale) __extension__ ({\ (__m128i)__builtin_ia32_gather3div8si((__v4si)(__m128i)(v1_old), \ (int const *)(addr), \ (__v4di)(__m256i)(index), \ (__mmask8)(mask), (int)(scale)); }) #define _mm_mmask_i32gather_pd(v1_old, mask, index, addr, scale) __extension__ ({\ (__m128d)__builtin_ia32_gather3siv2df((__v2df)(__m128d)(v1_old), \ (double const *)(addr), \ (__v4si)(__m128i)(index), \ (__mmask8)(mask), (int)(scale)); }) #define _mm_mmask_i32gather_epi64(v1_old, mask, index, addr, scale) __extension__ ({\ (__m128i)__builtin_ia32_gather3siv2di((__v2di)(__m128i)(v1_old), \ (long long const *)(addr), \ (__v4si)(__m128i)(index), \ (__mmask8)(mask), (int)(scale)); }) #define _mm256_mmask_i32gather_pd(v1_old, mask, index, addr, scale) __extension__ ({\ (__m256d)__builtin_ia32_gather3siv4df((__v4df)(__m256d)(v1_old), \ (double const *)(addr), \ (__v4si)(__m128i)(index), \ (__mmask8)(mask), (int)(scale)); }) #define _mm256_mmask_i32gather_epi64(v1_old, mask, index, addr, scale) __extension__ ({\ (__m256i)__builtin_ia32_gather3siv4di((__v4di)(__m256i)(v1_old), \ (long long const *)(addr), \ (__v4si)(__m128i)(index), \ (__mmask8)(mask), (int)(scale)); }) #define _mm_mmask_i32gather_ps(v1_old, mask, index, addr, scale) __extension__ ({\ (__m128)__builtin_ia32_gather3siv4sf((__v4sf)(__m128)(v1_old), \ (float const *)(addr), \ (__v4si)(__m128i)(index), \ (__mmask8)(mask), (int)(scale)); }) #define _mm_mmask_i32gather_epi32(v1_old, mask, index, addr, scale) __extension__ ({\ (__m128i)__builtin_ia32_gather3siv4si((__v4si)(__m128i)(v1_old), \ (int const *)(addr), \ (__v4si)(__m128i)(index), \ (__mmask8)(mask), (int)(scale)); }) #define _mm256_mmask_i32gather_ps(v1_old, mask, index, addr, scale) __extension__ ({\ (__m256)__builtin_ia32_gather3siv8sf((__v8sf)(__m256)(v1_old), \ (float const *)(addr), \ (__v8si)(__m256i)(index), \ (__mmask8)(mask), (int)(scale)); }) #define _mm256_mmask_i32gather_epi32(v1_old, mask, index, addr, scale) __extension__ ({\ (__m256i)__builtin_ia32_gather3siv8si((__v8si)(__m256i)(v1_old), \ (int const *)(addr), \ (__v8si)(__m256i)(index), \ (__mmask8)(mask), (int)(scale)); }) #define _mm256_permutex_pd(X, C) __extension__ ({ \ (__m256d)__builtin_shufflevector((__v4df)(__m256d)(X), \ (__v4df)_mm256_undefined_pd(), \ ((C) >> 0) & 0x3, ((C) >> 2) & 0x3, \ ((C) >> 4) & 0x3, ((C) >> 6) & 0x3); }) #define _mm256_mask_permutex_pd(W, U, X, C) __extension__ ({ \ (__m256d)__builtin_ia32_selectpd_256((__mmask8)(U), \ (__v4df)_mm256_permutex_pd((X), (C)), \ (__v4df)(__m256d)(W)); }) #define _mm256_maskz_permutex_pd(U, X, C) __extension__ ({ \ (__m256d)__builtin_ia32_selectpd_256((__mmask8)(U), \ (__v4df)_mm256_permutex_pd((X), (C)), \ (__v4df)_mm256_setzero_pd()); }) #define _mm256_permutex_epi64(X, C) __extension__ ({ \ (__m256i)__builtin_shufflevector((__v4di)(__m256i)(X), \ (__v4di)_mm256_undefined_si256(), \ ((C) >> 0) & 0x3, ((C) >> 2) & 0x3, \ ((C) >> 4) & 0x3, ((C) >> 6) & 0x3); }) #define _mm256_mask_permutex_epi64(W, U, X, C) __extension__ ({ \ (__m256i)__builtin_ia32_selectq_256((__mmask8)(U), \ (__v4di)_mm256_permutex_epi64((X), (C)), \ (__v4di)(__m256i)(W)); }) #define _mm256_maskz_permutex_epi64(U, X, C) __extension__ ({ \ (__m256i)__builtin_ia32_selectq_256((__mmask8)(U), \ (__v4di)_mm256_permutex_epi64((X), (C)), \ (__v4di)_mm256_setzero_si256()); }) static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_permutexvar_pd (__m256i __X, __m256d __Y) { return (__m256d) __builtin_ia32_permvardf256_mask ((__v4df) __Y, (__v4di) __X, (__v4df) _mm256_undefined_si256 (), (__mmask8) -1); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_mask_permutexvar_pd (__m256d __W, __mmask8 __U, __m256i __X, __m256d __Y) { return (__m256d) __builtin_ia32_permvardf256_mask ((__v4df) __Y, (__v4di) __X, (__v4df) __W, (__mmask8) __U); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_maskz_permutexvar_pd (__mmask8 __U, __m256i __X, __m256d __Y) { return (__m256d) __builtin_ia32_permvardf256_mask ((__v4df) __Y, (__v4di) __X, (__v4df) _mm256_setzero_pd (), (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_permutexvar_epi64 (__mmask8 __M, __m256i __X, __m256i __Y) { return (__m256i) __builtin_ia32_permvardi256_mask ((__v4di) __Y, (__v4di) __X, (__v4di) _mm256_setzero_si256 (), (__mmask8) __M); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_permutexvar_epi64 ( __m256i __X, __m256i __Y) { return (__m256i) __builtin_ia32_permvardi256_mask ((__v4di) __Y, (__v4di) __X, (__v4di) _mm256_undefined_si256 (), (__mmask8) -1); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_permutexvar_epi64 (__m256i __W, __mmask8 __M, __m256i __X, __m256i __Y) { return (__m256i) __builtin_ia32_permvardi256_mask ((__v4di) __Y, (__v4di) __X, (__v4di) __W, __M); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_mask_permutexvar_ps (__m256 __W, __mmask8 __U, __m256i __X, __m256 __Y) { return (__m256) __builtin_ia32_permvarsf256_mask ((__v8sf) __Y, (__v8si) __X, (__v8sf) __W, (__mmask8) __U); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_maskz_permutexvar_ps (__mmask8 __U, __m256i __X, __m256 __Y) { return (__m256) __builtin_ia32_permvarsf256_mask ((__v8sf) __Y, (__v8si) __X, (__v8sf) _mm256_setzero_ps (), (__mmask8) __U); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_permutexvar_ps (__m256i __X, __m256 __Y) { return (__m256) __builtin_ia32_permvarsf256_mask ((__v8sf) __Y, (__v8si) __X, (__v8sf) _mm256_undefined_si256 (), (__mmask8) -1); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_permutexvar_epi32 (__mmask8 __M, __m256i __X, __m256i __Y) { return (__m256i) __builtin_ia32_permvarsi256_mask ((__v8si) __Y, (__v8si) __X, (__v8si) _mm256_setzero_si256 (), __M); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_permutexvar_epi32 (__m256i __W, __mmask8 __M, __m256i __X, __m256i __Y) { return (__m256i) __builtin_ia32_permvarsi256_mask ((__v8si) __Y, (__v8si) __X, (__v8si) __W, (__mmask8) __M); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_permutexvar_epi32 (__m256i __X, __m256i __Y) { return (__m256i) __builtin_ia32_permvarsi256_mask ((__v8si) __Y, (__v8si) __X, (__v8si) _mm256_undefined_si256(), (__mmask8) -1); } #define _mm_alignr_epi32(A, B, imm) __extension__ ({ \ (__m128i)__builtin_shufflevector((__v4si)(__m128i)(B), \ (__v4si)(__m128i)(A), \ ((int)(imm) & 0x3) + 0, \ ((int)(imm) & 0x3) + 1, \ ((int)(imm) & 0x3) + 2, \ ((int)(imm) & 0x3) + 3); }) #define _mm_mask_alignr_epi32(W, U, A, B, imm) __extension__ ({ \ (__m128i)__builtin_ia32_selectd_128((__mmask8)(U), \ (__v4si)_mm_alignr_epi32((A), (B), (imm)), \ (__v4si)(__m128i)(W)); }) #define _mm_maskz_alignr_epi32(U, A, B, imm) __extension__ ({ \ (__m128i)__builtin_ia32_selectd_128((__mmask8)(U), \ (__v4si)_mm_alignr_epi32((A), (B), (imm)), \ (__v4si)_mm_setzero_si128()); }) #define _mm256_alignr_epi32(A, B, imm) __extension__ ({ \ (__m256i)__builtin_shufflevector((__v8si)(__m256i)(B), \ (__v8si)(__m256i)(A), \ ((int)(imm) & 0x7) + 0, \ ((int)(imm) & 0x7) + 1, \ ((int)(imm) & 0x7) + 2, \ ((int)(imm) & 0x7) + 3, \ ((int)(imm) & 0x7) + 4, \ ((int)(imm) & 0x7) + 5, \ ((int)(imm) & 0x7) + 6, \ ((int)(imm) & 0x7) + 7); }) #define _mm256_mask_alignr_epi32(W, U, A, B, imm) __extension__ ({ \ (__m256i)__builtin_ia32_selectd_256((__mmask8)(U), \ (__v8si)_mm256_alignr_epi32((A), (B), (imm)), \ (__v8si)(__m256i)(W)); }) #define _mm256_maskz_alignr_epi32(U, A, B, imm) __extension__ ({ \ (__m256i)__builtin_ia32_selectd_256((__mmask8)(U), \ (__v8si)_mm256_alignr_epi32((A), (B), (imm)), \ (__v8si)_mm256_setzero_si256()); }) #define _mm_alignr_epi64(A, B, imm) __extension__ ({ \ (__m128i)__builtin_shufflevector((__v2di)(__m128i)(B), \ (__v2di)(__m128i)(A), \ ((int)(imm) & 0x1) + 0, \ ((int)(imm) & 0x1) + 1); }) #define _mm_mask_alignr_epi64(W, U, A, B, imm) __extension__ ({ \ (__m128i)__builtin_ia32_selectq_128((__mmask8)(U), \ (__v2di)_mm_alignr_epi64((A), (B), (imm)), \ (__v2di)(__m128i)(W)); }) #define _mm_maskz_alignr_epi64(U, A, B, imm) __extension__ ({ \ (__m128i)__builtin_ia32_selectq_128((__mmask8)(U), \ (__v2di)_mm_alignr_epi64((A), (B), (imm)), \ (__v2di)_mm_setzero_di()); }) #define _mm256_alignr_epi64(A, B, imm) __extension__ ({ \ (__m256i)__builtin_shufflevector((__v4di)(__m256i)(B), \ (__v4di)(__m256i)(A), \ ((int)(imm) & 0x3) + 0, \ ((int)(imm) & 0x3) + 1, \ ((int)(imm) & 0x3) + 2, \ ((int)(imm) & 0x3) + 3); }) #define _mm256_mask_alignr_epi64(W, U, A, B, imm) __extension__ ({ \ (__m256i)__builtin_ia32_selectq_256((__mmask8)(U), \ (__v4di)_mm256_alignr_epi64((A), (B), (imm)), \ (__v4di)(__m256i)(W)); }) #define _mm256_maskz_alignr_epi64(U, A, B, imm) __extension__ ({ \ (__m256i)__builtin_ia32_selectq_256((__mmask8)(U), \ (__v4di)_mm256_alignr_epi64((A), (B), (imm)), \ (__v4di)_mm256_setzero_si256()); }) static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask_movehdup_ps (__m128 __W, __mmask8 __U, __m128 __A) { return (__m128)__builtin_ia32_selectps_128((__mmask8)__U, (__v4sf)_mm_movehdup_ps(__A), (__v4sf)__W); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maskz_movehdup_ps (__mmask8 __U, __m128 __A) { return (__m128)__builtin_ia32_selectps_128((__mmask8)__U, (__v4sf)_mm_movehdup_ps(__A), (__v4sf)_mm_setzero_ps()); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_mask_movehdup_ps (__m256 __W, __mmask8 __U, __m256 __A) { return (__m256)__builtin_ia32_selectps_256((__mmask8)__U, (__v8sf)_mm256_movehdup_ps(__A), (__v8sf)__W); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_maskz_movehdup_ps (__mmask8 __U, __m256 __A) { return (__m256)__builtin_ia32_selectps_256((__mmask8)__U, (__v8sf)_mm256_movehdup_ps(__A), (__v8sf)_mm256_setzero_ps()); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask_moveldup_ps (__m128 __W, __mmask8 __U, __m128 __A) { return (__m128)__builtin_ia32_selectps_128((__mmask8)__U, (__v4sf)_mm_moveldup_ps(__A), (__v4sf)__W); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maskz_moveldup_ps (__mmask8 __U, __m128 __A) { return (__m128)__builtin_ia32_selectps_128((__mmask8)__U, (__v4sf)_mm_moveldup_ps(__A), (__v4sf)_mm_setzero_ps()); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_mask_moveldup_ps (__m256 __W, __mmask8 __U, __m256 __A) { return (__m256)__builtin_ia32_selectps_256((__mmask8)__U, (__v8sf)_mm256_moveldup_ps(__A), (__v8sf)__W); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_maskz_moveldup_ps (__mmask8 __U, __m256 __A) { return (__m256)__builtin_ia32_selectps_256((__mmask8)__U, (__v8sf)_mm256_moveldup_ps(__A), (__v8sf)_mm256_setzero_ps()); } #define _mm256_mask_shuffle_epi32(W, U, A, I) __extension__({\ (__m256i)__builtin_ia32_selectd_256((__mmask8)(U), \ (__v8si)_mm256_shuffle_epi32((A), (I)), \ (__v8si)(__m256i)(W)); }) #define _mm256_maskz_shuffle_epi32(U, A, I) __extension__({\ (__m256i)__builtin_ia32_selectd_256((__mmask8)(U), \ (__v8si)_mm256_shuffle_epi32((A), (I)), \ (__v8si)_mm256_setzero_si256()); }) #define _mm_mask_shuffle_epi32(W, U, A, I) __extension__({\ (__m128i)__builtin_ia32_selectd_128((__mmask8)(U), \ (__v4si)_mm_shuffle_epi32((A), (I)), \ (__v4si)(__m128i)(W)); }) #define _mm_maskz_shuffle_epi32(U, A, I) __extension__({\ (__m128i)__builtin_ia32_selectd_128((__mmask8)(U), \ (__v4si)_mm_shuffle_epi32((A), (I)), \ (__v4si)_mm_setzero_si128()); }) static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask_mov_pd (__m128d __W, __mmask8 __U, __m128d __A) { return (__m128d) __builtin_ia32_selectpd_128 ((__mmask8) __U, (__v2df) __A, (__v2df) __W); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_maskz_mov_pd (__mmask8 __U, __m128d __A) { return (__m128d) __builtin_ia32_selectpd_128 ((__mmask8) __U, (__v2df) __A, (__v2df) _mm_setzero_pd ()); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_mask_mov_pd (__m256d __W, __mmask8 __U, __m256d __A) { return (__m256d) __builtin_ia32_selectpd_256 ((__mmask8) __U, (__v4df) __A, (__v4df) __W); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_maskz_mov_pd (__mmask8 __U, __m256d __A) { return (__m256d) __builtin_ia32_selectpd_256 ((__mmask8) __U, (__v4df) __A, (__v4df) _mm256_setzero_pd ()); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask_mov_ps (__m128 __W, __mmask8 __U, __m128 __A) { return (__m128) __builtin_ia32_selectps_128 ((__mmask8) __U, (__v4sf) __A, (__v4sf) __W); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maskz_mov_ps (__mmask8 __U, __m128 __A) { return (__m128) __builtin_ia32_selectps_128 ((__mmask8) __U, (__v4sf) __A, (__v4sf) _mm_setzero_ps ()); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_mask_mov_ps (__m256 __W, __mmask8 __U, __m256 __A) { return (__m256) __builtin_ia32_selectps_256 ((__mmask8) __U, (__v8sf) __A, (__v8sf) __W); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_maskz_mov_ps (__mmask8 __U, __m256 __A) { return (__m256) __builtin_ia32_selectps_256 ((__mmask8) __U, (__v8sf) __A, (__v8sf) _mm256_setzero_ps ()); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask_cvtph_ps (__m128 __W, __mmask8 __U, __m128i __A) { return (__m128) __builtin_ia32_vcvtph2ps_mask ((__v8hi) __A, (__v4sf) __W, (__mmask8) __U); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maskz_cvtph_ps (__mmask8 __U, __m128i __A) { return (__m128) __builtin_ia32_vcvtph2ps_mask ((__v8hi) __A, (__v4sf) _mm_setzero_ps (), (__mmask8) __U); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_mask_cvtph_ps (__m256 __W, __mmask8 __U, __m128i __A) { return (__m256) __builtin_ia32_vcvtph2ps256_mask ((__v8hi) __A, (__v8sf) __W, (__mmask8) __U); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_maskz_cvtph_ps (__mmask8 __U, __m128i __A) { return (__m256) __builtin_ia32_vcvtph2ps256_mask ((__v8hi) __A, (__v8sf) _mm256_setzero_ps (), (__mmask8) __U); } static __inline __m128i __DEFAULT_FN_ATTRS _mm_mask_cvtps_ph (__m128i __W, __mmask8 __U, __m128 __A) { return (__m128i) __builtin_ia32_vcvtps2ph_mask ((__v4sf) __A, _MM_FROUND_CUR_DIRECTION, (__v8hi) __W, (__mmask8) __U); } static __inline __m128i __DEFAULT_FN_ATTRS _mm_maskz_cvtps_ph (__mmask8 __U, __m128 __A) { return (__m128i) __builtin_ia32_vcvtps2ph_mask ((__v4sf) __A, _MM_FROUND_CUR_DIRECTION, (__v8hi) _mm_setzero_si128 (), (__mmask8) __U); } #define _mm_mask_cvt_roundps_ph(W, U, A, I) __extension__ ({ \ (__m128i)__builtin_ia32_vcvtps2ph_mask((__v4sf)(__m128)(A), (int)(I), \ (__v8hi)(__m128i)(W), \ (__mmask8)(U)); }) #define _mm_maskz_cvt_roundps_ph(U, A, I) __extension__ ({ \ (__m128i)__builtin_ia32_vcvtps2ph_mask((__v4sf)(__m128)(A), (int)(I), \ (__v8hi)_mm_setzero_si128(), \ (__mmask8)(U)); }) static __inline __m128i __DEFAULT_FN_ATTRS _mm256_mask_cvtps_ph (__m128i __W, __mmask8 __U, __m256 __A) { return (__m128i) __builtin_ia32_vcvtps2ph256_mask ((__v8sf) __A, _MM_FROUND_CUR_DIRECTION, (__v8hi) __W, (__mmask8) __U); } static __inline __m128i __DEFAULT_FN_ATTRS _mm256_maskz_cvtps_ph ( __mmask8 __U, __m256 __A) { return (__m128i) __builtin_ia32_vcvtps2ph256_mask ((__v8sf) __A, _MM_FROUND_CUR_DIRECTION, (__v8hi) _mm_setzero_si128(), (__mmask8) __U); } #define _mm256_mask_cvt_roundps_ph(W, U, A, I) __extension__ ({ \ (__m128i)__builtin_ia32_vcvtps2ph256_mask((__v8sf)(__m256)(A), (int)(I), \ (__v8hi)(__m128i)(W), \ (__mmask8)(U)); }) #define _mm256_maskz_cvt_roundps_ph(U, A, I) __extension__ ({ \ (__m128i)__builtin_ia32_vcvtps2ph256_mask((__v8sf)(__m256)(A), (int)(I), \ (__v8hi)_mm_setzero_si128(), \ (__mmask8)(U)); }) #undef __DEFAULT_FN_ATTRS #endif /* __AVX512VLINTRIN_H */ # 8548 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512vlintrin.h" 3 # 147 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 2 3 #endif # 148 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || defined(__AVX512BW__) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 150 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512bwintrin.h" 1 3 /*===------------- avx512bwintrin.h - AVX512BW intrinsics ------------------=== * * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __IMMINTRIN_H #error "Never use directly; include instead." #endif # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512bwintrin.h" 3 #ifndef __AVX512BWINTRIN_H #define __AVX512BWINTRIN_H typedef unsigned int __mmask32; typedef unsigned long long __mmask64; /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("avx512bw"))) static __inline __m512i __DEFAULT_FN_ATTRS _mm512_setzero_qi(void) { return (__m512i)(__v64qi){ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; } static __inline __m512i __DEFAULT_FN_ATTRS _mm512_setzero_hi(void) { return (__m512i)(__v32hi){ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; } /* Integer compare */ #define _mm512_cmp_epi8_mask(a, b, p) __extension__ ({ \ (__mmask64)__builtin_ia32_cmpb512_mask((__v64qi)(__m512i)(a), \ (__v64qi)(__m512i)(b), (int)(p), \ (__mmask64)-1); }) #define _mm512_mask_cmp_epi8_mask(m, a, b, p) __extension__ ({ \ (__mmask64)__builtin_ia32_cmpb512_mask((__v64qi)(__m512i)(a), \ (__v64qi)(__m512i)(b), (int)(p), \ (__mmask64)(m)); }) #define _mm512_cmp_epu8_mask(a, b, p) __extension__ ({ \ (__mmask64)__builtin_ia32_ucmpb512_mask((__v64qi)(__m512i)(a), \ (__v64qi)(__m512i)(b), (int)(p), \ (__mmask64)-1); }) #define _mm512_mask_cmp_epu8_mask(m, a, b, p) __extension__ ({ \ (__mmask64)__builtin_ia32_ucmpb512_mask((__v64qi)(__m512i)(a), \ (__v64qi)(__m512i)(b), (int)(p), \ (__mmask64)(m)); }) #define _mm512_cmp_epi16_mask(a, b, p) __extension__ ({ \ (__mmask32)__builtin_ia32_cmpw512_mask((__v32hi)(__m512i)(a), \ (__v32hi)(__m512i)(b), (int)(p), \ (__mmask32)-1); }) #define _mm512_mask_cmp_epi16_mask(m, a, b, p) __extension__ ({ \ (__mmask32)__builtin_ia32_cmpw512_mask((__v32hi)(__m512i)(a), \ (__v32hi)(__m512i)(b), (int)(p), \ (__mmask32)(m)); }) #define _mm512_cmp_epu16_mask(a, b, p) __extension__ ({ \ (__mmask32)__builtin_ia32_ucmpw512_mask((__v32hi)(__m512i)(a), \ (__v32hi)(__m512i)(b), (int)(p), \ (__mmask32)-1); }) #define _mm512_mask_cmp_epu16_mask(m, a, b, p) __extension__ ({ \ (__mmask32)__builtin_ia32_ucmpw512_mask((__v32hi)(__m512i)(a), \ (__v32hi)(__m512i)(b), (int)(p), \ (__mmask32)(m)); }) #define _mm512_cmpeq_epi8_mask(A, B) \ _mm512_cmp_epi8_mask((A), (B), _MM_CMPINT_EQ) #define _mm512_mask_cmpeq_epi8_mask(k, A, B) \ _mm512_mask_cmp_epi8_mask((k), (A), (B), _MM_CMPINT_EQ) #define _mm512_cmpge_epi8_mask(A, B) \ _mm512_cmp_epi8_mask((A), (B), _MM_CMPINT_GE) #define _mm512_mask_cmpge_epi8_mask(k, A, B) \ _mm512_mask_cmp_epi8_mask((k), (A), (B), _MM_CMPINT_GE) #define _mm512_cmpgt_epi8_mask(A, B) \ _mm512_cmp_epi8_mask((A), (B), _MM_CMPINT_GT) #define _mm512_mask_cmpgt_epi8_mask(k, A, B) \ _mm512_mask_cmp_epi8_mask((k), (A), (B), _MM_CMPINT_GT) #define _mm512_cmple_epi8_mask(A, B) \ _mm512_cmp_epi8_mask((A), (B), _MM_CMPINT_LE) #define _mm512_mask_cmple_epi8_mask(k, A, B) \ _mm512_mask_cmp_epi8_mask((k), (A), (B), _MM_CMPINT_LE) #define _mm512_cmplt_epi8_mask(A, B) \ _mm512_cmp_epi8_mask((A), (B), _MM_CMPINT_LT) #define _mm512_mask_cmplt_epi8_mask(k, A, B) \ _mm512_mask_cmp_epi8_mask((k), (A), (B), _MM_CMPINT_LT) #define _mm512_cmpneq_epi8_mask(A, B) \ _mm512_cmp_epi8_mask((A), (B), _MM_CMPINT_NE) #define _mm512_mask_cmpneq_epi8_mask(k, A, B) \ _mm512_mask_cmp_epi8_mask((k), (A), (B), _MM_CMPINT_NE) #define _mm512_cmpeq_epu8_mask(A, B) \ _mm512_cmp_epu8_mask((A), (B), _MM_CMPINT_EQ) #define _mm512_mask_cmpeq_epu8_mask(k, A, B) \ _mm512_mask_cmp_epu8_mask((k), (A), (B), _MM_CMPINT_EQ) #define _mm512_cmpge_epu8_mask(A, B) \ _mm512_cmp_epu8_mask((A), (B), _MM_CMPINT_GE) #define _mm512_mask_cmpge_epu8_mask(k, A, B) \ _mm512_mask_cmp_epu8_mask((k), (A), (B), _MM_CMPINT_GE) #define _mm512_cmpgt_epu8_mask(A, B) \ _mm512_cmp_epu8_mask((A), (B), _MM_CMPINT_GT) #define _mm512_mask_cmpgt_epu8_mask(k, A, B) \ _mm512_mask_cmp_epu8_mask((k), (A), (B), _MM_CMPINT_GT) #define _mm512_cmple_epu8_mask(A, B) \ _mm512_cmp_epu8_mask((A), (B), _MM_CMPINT_LE) #define _mm512_mask_cmple_epu8_mask(k, A, B) \ _mm512_mask_cmp_epu8_mask((k), (A), (B), _MM_CMPINT_LE) #define _mm512_cmplt_epu8_mask(A, B) \ _mm512_cmp_epu8_mask((A), (B), _MM_CMPINT_LT) #define _mm512_mask_cmplt_epu8_mask(k, A, B) \ _mm512_mask_cmp_epu8_mask((k), (A), (B), _MM_CMPINT_LT) #define _mm512_cmpneq_epu8_mask(A, B) \ _mm512_cmp_epu8_mask((A), (B), _MM_CMPINT_NE) #define _mm512_mask_cmpneq_epu8_mask(k, A, B) \ _mm512_mask_cmp_epu8_mask((k), (A), (B), _MM_CMPINT_NE) #define _mm512_cmpeq_epi16_mask(A, B) \ _mm512_cmp_epi16_mask((A), (B), _MM_CMPINT_EQ) #define _mm512_mask_cmpeq_epi16_mask(k, A, B) \ _mm512_mask_cmp_epi16_mask((k), (A), (B), _MM_CMPINT_EQ) #define _mm512_cmpge_epi16_mask(A, B) \ _mm512_cmp_epi16_mask((A), (B), _MM_CMPINT_GE) #define _mm512_mask_cmpge_epi16_mask(k, A, B) \ _mm512_mask_cmp_epi16_mask((k), (A), (B), _MM_CMPINT_GE) #define _mm512_cmpgt_epi16_mask(A, B) \ _mm512_cmp_epi16_mask((A), (B), _MM_CMPINT_GT) #define _mm512_mask_cmpgt_epi16_mask(k, A, B) \ _mm512_mask_cmp_epi16_mask((k), (A), (B), _MM_CMPINT_GT) #define _mm512_cmple_epi16_mask(A, B) \ _mm512_cmp_epi16_mask((A), (B), _MM_CMPINT_LE) #define _mm512_mask_cmple_epi16_mask(k, A, B) \ _mm512_mask_cmp_epi16_mask((k), (A), (B), _MM_CMPINT_LE) #define _mm512_cmplt_epi16_mask(A, B) \ _mm512_cmp_epi16_mask((A), (B), _MM_CMPINT_LT) #define _mm512_mask_cmplt_epi16_mask(k, A, B) \ _mm512_mask_cmp_epi16_mask((k), (A), (B), _MM_CMPINT_LT) #define _mm512_cmpneq_epi16_mask(A, B) \ _mm512_cmp_epi16_mask((A), (B), _MM_CMPINT_NE) #define _mm512_mask_cmpneq_epi16_mask(k, A, B) \ _mm512_mask_cmp_epi16_mask((k), (A), (B), _MM_CMPINT_NE) #define _mm512_cmpeq_epu16_mask(A, B) \ _mm512_cmp_epu16_mask((A), (B), _MM_CMPINT_EQ) #define _mm512_mask_cmpeq_epu16_mask(k, A, B) \ _mm512_mask_cmp_epu16_mask((k), (A), (B), _MM_CMPINT_EQ) #define _mm512_cmpge_epu16_mask(A, B) \ _mm512_cmp_epu16_mask((A), (B), _MM_CMPINT_GE) #define _mm512_mask_cmpge_epu16_mask(k, A, B) \ _mm512_mask_cmp_epu16_mask((k), (A), (B), _MM_CMPINT_GE) #define _mm512_cmpgt_epu16_mask(A, B) \ _mm512_cmp_epu16_mask((A), (B), _MM_CMPINT_GT) #define _mm512_mask_cmpgt_epu16_mask(k, A, B) \ _mm512_mask_cmp_epu16_mask((k), (A), (B), _MM_CMPINT_GT) #define _mm512_cmple_epu16_mask(A, B) \ _mm512_cmp_epu16_mask((A), (B), _MM_CMPINT_LE) #define _mm512_mask_cmple_epu16_mask(k, A, B) \ _mm512_mask_cmp_epu16_mask((k), (A), (B), _MM_CMPINT_LE) #define _mm512_cmplt_epu16_mask(A, B) \ _mm512_cmp_epu16_mask((A), (B), _MM_CMPINT_LT) #define _mm512_mask_cmplt_epu16_mask(k, A, B) \ _mm512_mask_cmp_epu16_mask((k), (A), (B), _MM_CMPINT_LT) #define _mm512_cmpneq_epu16_mask(A, B) \ _mm512_cmp_epu16_mask((A), (B), _MM_CMPINT_NE) #define _mm512_mask_cmpneq_epu16_mask(k, A, B) \ _mm512_mask_cmp_epu16_mask((k), (A), (B), _MM_CMPINT_NE) static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_add_epi8 (__m512i __A, __m512i __B) { return (__m512i) ((__v64qu) __A + (__v64qu) __B); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_add_epi8(__m512i __W, __mmask64 __U, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U, (__v64qi)_mm512_add_epi8(__A, __B), (__v64qi)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_add_epi8(__mmask64 __U, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U, (__v64qi)_mm512_add_epi8(__A, __B), (__v64qi)_mm512_setzero_qi()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_sub_epi8 (__m512i __A, __m512i __B) { return (__m512i) ((__v64qu) __A - (__v64qu) __B); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_sub_epi8(__m512i __W, __mmask64 __U, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U, (__v64qi)_mm512_sub_epi8(__A, __B), (__v64qi)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_sub_epi8(__mmask64 __U, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U, (__v64qi)_mm512_sub_epi8(__A, __B), (__v64qi)_mm512_setzero_qi()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_add_epi16 (__m512i __A, __m512i __B) { return (__m512i) ((__v32hu) __A + (__v32hu) __B); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_add_epi16(__m512i __W, __mmask32 __U, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U, (__v32hi)_mm512_add_epi16(__A, __B), (__v32hi)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_add_epi16(__mmask32 __U, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U, (__v32hi)_mm512_add_epi16(__A, __B), (__v32hi)_mm512_setzero_hi()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_sub_epi16 (__m512i __A, __m512i __B) { return (__m512i) ((__v32hu) __A - (__v32hu) __B); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_sub_epi16(__m512i __W, __mmask32 __U, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U, (__v32hi)_mm512_sub_epi16(__A, __B), (__v32hi)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_sub_epi16(__mmask32 __U, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U, (__v32hi)_mm512_sub_epi16(__A, __B), (__v32hi)_mm512_setzero_hi()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mullo_epi16 (__m512i __A, __m512i __B) { return (__m512i) ((__v32hu) __A * (__v32hu) __B); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_mullo_epi16(__m512i __W, __mmask32 __U, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U, (__v32hi)_mm512_mullo_epi16(__A, __B), (__v32hi)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_mullo_epi16(__mmask32 __U, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U, (__v32hi)_mm512_mullo_epi16(__A, __B), (__v32hi)_mm512_setzero_hi()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_blend_epi8 (__mmask64 __U, __m512i __A, __m512i __W) { return (__m512i) __builtin_ia32_selectb_512 ((__mmask64) __U, (__v64qi) __W, (__v64qi) __A); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_blend_epi16 (__mmask32 __U, __m512i __A, __m512i __W) { return (__m512i) __builtin_ia32_selectw_512 ((__mmask32) __U, (__v32hi) __W, (__v32hi) __A); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_abs_epi8 (__m512i __A) { return (__m512i) __builtin_ia32_pabsb512_mask ((__v64qi) __A, (__v64qi) _mm512_setzero_qi(), (__mmask64) -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_abs_epi8 (__m512i __W, __mmask64 __U, __m512i __A) { return (__m512i) __builtin_ia32_pabsb512_mask ((__v64qi) __A, (__v64qi) __W, (__mmask64) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_abs_epi8 (__mmask64 __U, __m512i __A) { return (__m512i) __builtin_ia32_pabsb512_mask ((__v64qi) __A, (__v64qi) _mm512_setzero_qi(), (__mmask64) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_abs_epi16 (__m512i __A) { return (__m512i) __builtin_ia32_pabsw512_mask ((__v32hi) __A, (__v32hi) _mm512_setzero_hi(), (__mmask32) -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_abs_epi16 (__m512i __W, __mmask32 __U, __m512i __A) { return (__m512i) __builtin_ia32_pabsw512_mask ((__v32hi) __A, (__v32hi) __W, (__mmask32) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_abs_epi16 (__mmask32 __U, __m512i __A) { return (__m512i) __builtin_ia32_pabsw512_mask ((__v32hi) __A, (__v32hi) _mm512_setzero_hi(), (__mmask32) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_packs_epi32(__m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_packssdw512((__v16si)__A, (__v16si)__B); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_packs_epi32(__mmask32 __M, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectw_512((__mmask32)__M, (__v32hi)_mm512_packs_epi32(__A, __B), (__v32hi)_mm512_setzero_hi()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_packs_epi32(__m512i __W, __mmask32 __M, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectw_512((__mmask32)__M, (__v32hi)_mm512_packs_epi32(__A, __B), (__v32hi)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_packs_epi16(__m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_packsswb512((__v32hi)__A, (__v32hi) __B); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_packs_epi16(__m512i __W, __mmask64 __M, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectb_512((__mmask64)__M, (__v64qi)_mm512_packs_epi16(__A, __B), (__v64qi)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_packs_epi16(__mmask64 __M, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectb_512((__mmask64)__M, (__v64qi)_mm512_packs_epi16(__A, __B), (__v64qi)_mm512_setzero_qi()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_packus_epi32(__m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_packusdw512((__v16si) __A, (__v16si) __B); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_packus_epi32(__mmask32 __M, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectw_512((__mmask32)__M, (__v32hi)_mm512_packus_epi32(__A, __B), (__v32hi)_mm512_setzero_hi()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_packus_epi32(__m512i __W, __mmask32 __M, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectw_512((__mmask32)__M, (__v32hi)_mm512_packus_epi32(__A, __B), (__v32hi)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_packus_epi16(__m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_packuswb512((__v32hi) __A, (__v32hi) __B); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_packus_epi16(__m512i __W, __mmask64 __M, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectb_512((__mmask64)__M, (__v64qi)_mm512_packus_epi16(__A, __B), (__v64qi)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_packus_epi16(__mmask64 __M, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectb_512((__mmask64)__M, (__v64qi)_mm512_packus_epi16(__A, __B), (__v64qi)_mm512_setzero_qi()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_adds_epi8 (__m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_paddsb512_mask ((__v64qi) __A, (__v64qi) __B, (__v64qi) _mm512_setzero_qi(), (__mmask64) -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_adds_epi8 (__m512i __W, __mmask64 __U, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_paddsb512_mask ((__v64qi) __A, (__v64qi) __B, (__v64qi) __W, (__mmask64) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_adds_epi8 (__mmask64 __U, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_paddsb512_mask ((__v64qi) __A, (__v64qi) __B, (__v64qi) _mm512_setzero_qi(), (__mmask64) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_adds_epi16 (__m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_paddsw512_mask ((__v32hi) __A, (__v32hi) __B, (__v32hi) _mm512_setzero_hi(), (__mmask32) -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_adds_epi16 (__m512i __W, __mmask32 __U, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_paddsw512_mask ((__v32hi) __A, (__v32hi) __B, (__v32hi) __W, (__mmask32) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_adds_epi16 (__mmask32 __U, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_paddsw512_mask ((__v32hi) __A, (__v32hi) __B, (__v32hi) _mm512_setzero_hi(), (__mmask32) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_adds_epu8 (__m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_paddusb512_mask ((__v64qi) __A, (__v64qi) __B, (__v64qi) _mm512_setzero_qi(), (__mmask64) -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_adds_epu8 (__m512i __W, __mmask64 __U, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_paddusb512_mask ((__v64qi) __A, (__v64qi) __B, (__v64qi) __W, (__mmask64) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_adds_epu8 (__mmask64 __U, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_paddusb512_mask ((__v64qi) __A, (__v64qi) __B, (__v64qi) _mm512_setzero_qi(), (__mmask64) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_adds_epu16 (__m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_paddusw512_mask ((__v32hi) __A, (__v32hi) __B, (__v32hi) _mm512_setzero_hi(), (__mmask32) -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_adds_epu16 (__m512i __W, __mmask32 __U, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_paddusw512_mask ((__v32hi) __A, (__v32hi) __B, (__v32hi) __W, (__mmask32) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_adds_epu16 (__mmask32 __U, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_paddusw512_mask ((__v32hi) __A, (__v32hi) __B, (__v32hi) _mm512_setzero_hi(), (__mmask32) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_avg_epu8 (__m512i __A, __m512i __B) { typedef unsigned short __v64hu __attribute__((__vector_size__(128))); return (__m512i)__builtin_convertvector( ((__builtin_convertvector((__v64qu) __A, __v64hu) + __builtin_convertvector((__v64qu) __B, __v64hu)) + 1) >> 1, __v64qu); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_avg_epu8 (__m512i __W, __mmask64 __U, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U, (__v64qi)_mm512_avg_epu8(__A, __B), (__v64qi)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_avg_epu8 (__mmask64 __U, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U, (__v64qi)_mm512_avg_epu8(__A, __B), (__v64qi)_mm512_setzero_qi()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_avg_epu16 (__m512i __A, __m512i __B) { typedef unsigned int __v32su __attribute__((__vector_size__(128))); return (__m512i)__builtin_convertvector( ((__builtin_convertvector((__v32hu) __A, __v32su) + __builtin_convertvector((__v32hu) __B, __v32su)) + 1) >> 1, __v32hu); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_avg_epu16 (__m512i __W, __mmask32 __U, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U, (__v32hi)_mm512_avg_epu16(__A, __B), (__v32hi)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_avg_epu16 (__mmask32 __U, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U, (__v32hi)_mm512_avg_epu16(__A, __B), (__v32hi) _mm512_setzero_hi()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_max_epi8 (__m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pmaxsb512_mask ((__v64qi) __A, (__v64qi) __B, (__v64qi) _mm512_setzero_qi(), (__mmask64) -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_max_epi8 (__mmask64 __M, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pmaxsb512_mask ((__v64qi) __A, (__v64qi) __B, (__v64qi) _mm512_setzero_qi(), (__mmask64) __M); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_max_epi8 (__m512i __W, __mmask64 __M, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pmaxsb512_mask ((__v64qi) __A, (__v64qi) __B, (__v64qi) __W, (__mmask64) __M); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_max_epi16 (__m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pmaxsw512_mask ((__v32hi) __A, (__v32hi) __B, (__v32hi) _mm512_setzero_hi(), (__mmask32) -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_max_epi16 (__mmask32 __M, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pmaxsw512_mask ((__v32hi) __A, (__v32hi) __B, (__v32hi) _mm512_setzero_hi(), (__mmask32) __M); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_max_epi16 (__m512i __W, __mmask32 __M, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pmaxsw512_mask ((__v32hi) __A, (__v32hi) __B, (__v32hi) __W, (__mmask32) __M); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_max_epu8 (__m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pmaxub512_mask ((__v64qi) __A, (__v64qi) __B, (__v64qi) _mm512_setzero_qi(), (__mmask64) -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_max_epu8 (__mmask64 __M, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pmaxub512_mask ((__v64qi) __A, (__v64qi) __B, (__v64qi) _mm512_setzero_qi(), (__mmask64) __M); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_max_epu8 (__m512i __W, __mmask64 __M, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pmaxub512_mask ((__v64qi) __A, (__v64qi) __B, (__v64qi) __W, (__mmask64) __M); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_max_epu16 (__m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pmaxuw512_mask ((__v32hi) __A, (__v32hi) __B, (__v32hi) _mm512_setzero_hi(), (__mmask32) -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_max_epu16 (__mmask32 __M, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pmaxuw512_mask ((__v32hi) __A, (__v32hi) __B, (__v32hi) _mm512_setzero_hi(), (__mmask32) __M); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_max_epu16 (__m512i __W, __mmask32 __M, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pmaxuw512_mask ((__v32hi) __A, (__v32hi) __B, (__v32hi) __W, (__mmask32) __M); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_min_epi8 (__m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pminsb512_mask ((__v64qi) __A, (__v64qi) __B, (__v64qi) _mm512_setzero_qi(), (__mmask64) -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_min_epi8 (__mmask64 __M, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pminsb512_mask ((__v64qi) __A, (__v64qi) __B, (__v64qi) _mm512_setzero_qi(), (__mmask64) __M); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_min_epi8 (__m512i __W, __mmask64 __M, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pminsb512_mask ((__v64qi) __A, (__v64qi) __B, (__v64qi) __W, (__mmask64) __M); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_min_epi16 (__m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pminsw512_mask ((__v32hi) __A, (__v32hi) __B, (__v32hi) _mm512_setzero_hi(), (__mmask32) -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_min_epi16 (__mmask32 __M, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pminsw512_mask ((__v32hi) __A, (__v32hi) __B, (__v32hi) _mm512_setzero_hi(), (__mmask32) __M); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_min_epi16 (__m512i __W, __mmask32 __M, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pminsw512_mask ((__v32hi) __A, (__v32hi) __B, (__v32hi) __W, (__mmask32) __M); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_min_epu8 (__m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pminub512_mask ((__v64qi) __A, (__v64qi) __B, (__v64qi) _mm512_setzero_qi(), (__mmask64) -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_min_epu8 (__mmask64 __M, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pminub512_mask ((__v64qi) __A, (__v64qi) __B, (__v64qi) _mm512_setzero_qi(), (__mmask64) __M); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_min_epu8 (__m512i __W, __mmask64 __M, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pminub512_mask ((__v64qi) __A, (__v64qi) __B, (__v64qi) __W, (__mmask64) __M); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_min_epu16 (__m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pminuw512_mask ((__v32hi) __A, (__v32hi) __B, (__v32hi) _mm512_setzero_hi(), (__mmask32) -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_min_epu16 (__mmask32 __M, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pminuw512_mask ((__v32hi) __A, (__v32hi) __B, (__v32hi) _mm512_setzero_hi(), (__mmask32) __M); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_min_epu16 (__m512i __W, __mmask32 __M, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pminuw512_mask ((__v32hi) __A, (__v32hi) __B, (__v32hi) __W, (__mmask32) __M); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_shuffle_epi8(__m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_pshufb512((__v64qi)__A,(__v64qi)__B); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_shuffle_epi8(__m512i __W, __mmask64 __U, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U, (__v64qi)_mm512_shuffle_epi8(__A, __B), (__v64qi)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_shuffle_epi8(__mmask64 __U, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U, (__v64qi)_mm512_shuffle_epi8(__A, __B), (__v64qi)_mm512_setzero_qi()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_subs_epi8 (__m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_psubsb512_mask ((__v64qi) __A, (__v64qi) __B, (__v64qi) _mm512_setzero_qi(), (__mmask64) -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_subs_epi8 (__m512i __W, __mmask64 __U, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_psubsb512_mask ((__v64qi) __A, (__v64qi) __B, (__v64qi) __W, (__mmask64) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_subs_epi8 (__mmask64 __U, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_psubsb512_mask ((__v64qi) __A, (__v64qi) __B, (__v64qi) _mm512_setzero_qi(), (__mmask64) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_subs_epi16 (__m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_psubsw512_mask ((__v32hi) __A, (__v32hi) __B, (__v32hi) _mm512_setzero_hi(), (__mmask32) -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_subs_epi16 (__m512i __W, __mmask32 __U, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_psubsw512_mask ((__v32hi) __A, (__v32hi) __B, (__v32hi) __W, (__mmask32) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_subs_epi16 (__mmask32 __U, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_psubsw512_mask ((__v32hi) __A, (__v32hi) __B, (__v32hi) _mm512_setzero_hi(), (__mmask32) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_subs_epu8 (__m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_psubusb512_mask ((__v64qi) __A, (__v64qi) __B, (__v64qi) _mm512_setzero_qi(), (__mmask64) -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_subs_epu8 (__m512i __W, __mmask64 __U, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_psubusb512_mask ((__v64qi) __A, (__v64qi) __B, (__v64qi) __W, (__mmask64) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_subs_epu8 (__mmask64 __U, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_psubusb512_mask ((__v64qi) __A, (__v64qi) __B, (__v64qi) _mm512_setzero_qi(), (__mmask64) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_subs_epu16 (__m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_psubusw512_mask ((__v32hi) __A, (__v32hi) __B, (__v32hi) _mm512_setzero_hi(), (__mmask32) -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_subs_epu16 (__m512i __W, __mmask32 __U, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_psubusw512_mask ((__v32hi) __A, (__v32hi) __B, (__v32hi) __W, (__mmask32) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_subs_epu16 (__mmask32 __U, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_psubusw512_mask ((__v32hi) __A, (__v32hi) __B, (__v32hi) _mm512_setzero_hi(), (__mmask32) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask2_permutex2var_epi16 (__m512i __A, __m512i __I, __mmask32 __U, __m512i __B) { return (__m512i) __builtin_ia32_vpermi2varhi512_mask ((__v32hi) __A, (__v32hi) __I /* idx */ , (__v32hi) __B, (__mmask32) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_permutex2var_epi16 (__m512i __A, __m512i __I, __m512i __B) { return (__m512i) __builtin_ia32_vpermt2varhi512_mask ((__v32hi) __I /* idx */, (__v32hi) __A, (__v32hi) __B, (__mmask32) -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_permutex2var_epi16 (__m512i __A, __mmask32 __U, __m512i __I, __m512i __B) { return (__m512i) __builtin_ia32_vpermt2varhi512_mask ((__v32hi) __I /* idx */, (__v32hi) __A, (__v32hi) __B, (__mmask32) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_permutex2var_epi16 (__mmask32 __U, __m512i __A, __m512i __I, __m512i __B) { return (__m512i) __builtin_ia32_vpermt2varhi512_maskz ((__v32hi) __I /* idx */ , (__v32hi) __A, (__v32hi) __B, (__mmask32) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mulhrs_epi16 (__m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pmulhrsw512_mask ((__v32hi) __A, (__v32hi) __B, (__v32hi) _mm512_setzero_hi(), (__mmask32) -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_mulhrs_epi16 (__m512i __W, __mmask32 __U, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pmulhrsw512_mask ((__v32hi) __A, (__v32hi) __B, (__v32hi) __W, (__mmask32) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_mulhrs_epi16 (__mmask32 __U, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pmulhrsw512_mask ((__v32hi) __A, (__v32hi) __B, (__v32hi) _mm512_setzero_hi(), (__mmask32) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mulhi_epi16 (__m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pmulhw512_mask ((__v32hi) __A, (__v32hi) __B, (__v32hi) _mm512_setzero_hi(), (__mmask32) -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_mulhi_epi16 (__m512i __W, __mmask32 __U, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pmulhw512_mask ((__v32hi) __A, (__v32hi) __B, (__v32hi) __W, (__mmask32) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_mulhi_epi16 (__mmask32 __U, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pmulhw512_mask ((__v32hi) __A, (__v32hi) __B, (__v32hi) _mm512_setzero_hi(), (__mmask32) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mulhi_epu16 (__m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pmulhuw512_mask ((__v32hi) __A, (__v32hi) __B, (__v32hi) _mm512_setzero_hi(), (__mmask32) -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_mulhi_epu16 (__m512i __W, __mmask32 __U, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pmulhuw512_mask ((__v32hi) __A, (__v32hi) __B, (__v32hi) __W, (__mmask32) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_mulhi_epu16 (__mmask32 __U, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pmulhuw512_mask ((__v32hi) __A, (__v32hi) __B, (__v32hi) _mm512_setzero_hi(), (__mmask32) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maddubs_epi16 (__m512i __X, __m512i __Y) { return (__m512i) __builtin_ia32_pmaddubsw512_mask ((__v64qi) __X, (__v64qi) __Y, (__v32hi) _mm512_setzero_hi(), (__mmask32) -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_maddubs_epi16 (__m512i __W, __mmask32 __U, __m512i __X, __m512i __Y) { return (__m512i) __builtin_ia32_pmaddubsw512_mask ((__v64qi) __X, (__v64qi) __Y, (__v32hi) __W, (__mmask32) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_maddubs_epi16 (__mmask32 __U, __m512i __X, __m512i __Y) { return (__m512i) __builtin_ia32_pmaddubsw512_mask ((__v64qi) __X, (__v64qi) __Y, (__v32hi) _mm512_setzero_hi(), (__mmask32) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_madd_epi16 (__m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pmaddwd512_mask ((__v32hi) __A, (__v32hi) __B, (__v16si) _mm512_setzero_si512(), (__mmask16) -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_madd_epi16 (__m512i __W, __mmask16 __U, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pmaddwd512_mask ((__v32hi) __A, (__v32hi) __B, (__v16si) __W, (__mmask16) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_madd_epi16 (__mmask16 __U, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_pmaddwd512_mask ((__v32hi) __A, (__v32hi) __B, (__v16si) _mm512_setzero_si512(), (__mmask16) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm512_cvtsepi16_epi8 (__m512i __A) { return (__m256i) __builtin_ia32_pmovswb512_mask ((__v32hi) __A, (__v32qi)_mm256_setzero_si256(), (__mmask32) -1); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm512_mask_cvtsepi16_epi8 (__m256i __O, __mmask32 __M, __m512i __A) { return (__m256i) __builtin_ia32_pmovswb512_mask ((__v32hi) __A, (__v32qi)__O, __M); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm512_maskz_cvtsepi16_epi8 (__mmask32 __M, __m512i __A) { return (__m256i) __builtin_ia32_pmovswb512_mask ((__v32hi) __A, (__v32qi) _mm256_setzero_si256(), __M); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm512_cvtusepi16_epi8 (__m512i __A) { return (__m256i) __builtin_ia32_pmovuswb512_mask ((__v32hi) __A, (__v32qi) _mm256_setzero_si256(), (__mmask32) -1); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm512_mask_cvtusepi16_epi8 (__m256i __O, __mmask32 __M, __m512i __A) { return (__m256i) __builtin_ia32_pmovuswb512_mask ((__v32hi) __A, (__v32qi) __O, __M); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm512_maskz_cvtusepi16_epi8 (__mmask32 __M, __m512i __A) { return (__m256i) __builtin_ia32_pmovuswb512_mask ((__v32hi) __A, (__v32qi) _mm256_setzero_si256(), __M); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm512_cvtepi16_epi8 (__m512i __A) { return (__m256i) __builtin_ia32_pmovwb512_mask ((__v32hi) __A, (__v32qi) _mm256_setzero_si256(), (__mmask32) -1); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm512_mask_cvtepi16_epi8 (__m256i __O, __mmask32 __M, __m512i __A) { return (__m256i) __builtin_ia32_pmovwb512_mask ((__v32hi) __A, (__v32qi) __O, __M); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm512_maskz_cvtepi16_epi8 (__mmask32 __M, __m512i __A) { return (__m256i) __builtin_ia32_pmovwb512_mask ((__v32hi) __A, (__v32qi) _mm256_setzero_si256(), __M); } static __inline__ void __DEFAULT_FN_ATTRS _mm512_mask_cvtepi16_storeu_epi8 (void * __P, __mmask32 __M, __m512i __A) { __builtin_ia32_pmovwb512mem_mask ((__v32qi *) __P, (__v32hi) __A, __M); } static __inline__ void __DEFAULT_FN_ATTRS _mm512_mask_cvtsepi16_storeu_epi8 (void * __P, __mmask32 __M, __m512i __A) { __builtin_ia32_pmovswb512mem_mask ((__v32qi *) __P, (__v32hi) __A, __M); } static __inline__ void __DEFAULT_FN_ATTRS _mm512_mask_cvtusepi16_storeu_epi8 (void * __P, __mmask32 __M, __m512i __A) { __builtin_ia32_pmovuswb512mem_mask ((__v32qi *) __P, (__v32hi) __A, __M); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_unpackhi_epi8(__m512i __A, __m512i __B) { return (__m512i)__builtin_shufflevector((__v64qi)__A, (__v64qi)__B, 8, 64+8, 9, 64+9, 10, 64+10, 11, 64+11, 12, 64+12, 13, 64+13, 14, 64+14, 15, 64+15, 24, 64+24, 25, 64+25, 26, 64+26, 27, 64+27, 28, 64+28, 29, 64+29, 30, 64+30, 31, 64+31, 40, 64+40, 41, 64+41, 42, 64+42, 43, 64+43, 44, 64+44, 45, 64+45, 46, 64+46, 47, 64+47, 56, 64+56, 57, 64+57, 58, 64+58, 59, 64+59, 60, 64+60, 61, 64+61, 62, 64+62, 63, 64+63); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_unpackhi_epi8(__m512i __W, __mmask64 __U, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U, (__v64qi)_mm512_unpackhi_epi8(__A, __B), (__v64qi)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_unpackhi_epi8(__mmask64 __U, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U, (__v64qi)_mm512_unpackhi_epi8(__A, __B), (__v64qi)_mm512_setzero_qi()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_unpackhi_epi16(__m512i __A, __m512i __B) { return (__m512i)__builtin_shufflevector((__v32hi)__A, (__v32hi)__B, 4, 32+4, 5, 32+5, 6, 32+6, 7, 32+7, 12, 32+12, 13, 32+13, 14, 32+14, 15, 32+15, 20, 32+20, 21, 32+21, 22, 32+22, 23, 32+23, 28, 32+28, 29, 32+29, 30, 32+30, 31, 32+31); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_unpackhi_epi16(__m512i __W, __mmask32 __U, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U, (__v32hi)_mm512_unpackhi_epi16(__A, __B), (__v32hi)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_unpackhi_epi16(__mmask32 __U, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U, (__v32hi)_mm512_unpackhi_epi16(__A, __B), (__v32hi)_mm512_setzero_hi()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_unpacklo_epi8(__m512i __A, __m512i __B) { return (__m512i)__builtin_shufflevector((__v64qi)__A, (__v64qi)__B, 0, 64+0, 1, 64+1, 2, 64+2, 3, 64+3, 4, 64+4, 5, 64+5, 6, 64+6, 7, 64+7, 16, 64+16, 17, 64+17, 18, 64+18, 19, 64+19, 20, 64+20, 21, 64+21, 22, 64+22, 23, 64+23, 32, 64+32, 33, 64+33, 34, 64+34, 35, 64+35, 36, 64+36, 37, 64+37, 38, 64+38, 39, 64+39, 48, 64+48, 49, 64+49, 50, 64+50, 51, 64+51, 52, 64+52, 53, 64+53, 54, 64+54, 55, 64+55); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_unpacklo_epi8(__m512i __W, __mmask64 __U, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U, (__v64qi)_mm512_unpacklo_epi8(__A, __B), (__v64qi)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_unpacklo_epi8(__mmask64 __U, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectb_512((__mmask64)__U, (__v64qi)_mm512_unpacklo_epi8(__A, __B), (__v64qi)_mm512_setzero_qi()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_unpacklo_epi16(__m512i __A, __m512i __B) { return (__m512i)__builtin_shufflevector((__v32hi)__A, (__v32hi)__B, 0, 32+0, 1, 32+1, 2, 32+2, 3, 32+3, 8, 32+8, 9, 32+9, 10, 32+10, 11, 32+11, 16, 32+16, 17, 32+17, 18, 32+18, 19, 32+19, 24, 32+24, 25, 32+25, 26, 32+26, 27, 32+27); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_unpacklo_epi16(__m512i __W, __mmask32 __U, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U, (__v32hi)_mm512_unpacklo_epi16(__A, __B), (__v32hi)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_unpacklo_epi16(__mmask32 __U, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U, (__v32hi)_mm512_unpacklo_epi16(__A, __B), (__v32hi)_mm512_setzero_hi()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_cvtepi8_epi16(__m256i __A) { /* This function always performs a signed extension, but __v32qi is a char which may be signed or unsigned, so use __v32qs. */ return (__m512i)__builtin_convertvector((__v32qs)__A, __v32hi); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_cvtepi8_epi16(__m512i __W, __mmask32 __U, __m256i __A) { return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U, (__v32hi)_mm512_cvtepi8_epi16(__A), (__v32hi)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_cvtepi8_epi16(__mmask32 __U, __m256i __A) { return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U, (__v32hi)_mm512_cvtepi8_epi16(__A), (__v32hi)_mm512_setzero_hi()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_cvtepu8_epi16(__m256i __A) { return (__m512i)__builtin_convertvector((__v32qu)__A, __v32hi); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_cvtepu8_epi16(__m512i __W, __mmask32 __U, __m256i __A) { return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U, (__v32hi)_mm512_cvtepu8_epi16(__A), (__v32hi)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_cvtepu8_epi16(__mmask32 __U, __m256i __A) { return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U, (__v32hi)_mm512_cvtepu8_epi16(__A), (__v32hi)_mm512_setzero_hi()); } #define _mm512_shufflehi_epi16(A, imm) __extension__ ({ \ (__m512i)__builtin_shufflevector((__v32hi)(__m512i)(A), \ (__v32hi)_mm512_undefined_epi32(), \ 0, 1, 2, 3, \ 4 + (((imm) >> 0) & 0x3), \ 4 + (((imm) >> 2) & 0x3), \ 4 + (((imm) >> 4) & 0x3), \ 4 + (((imm) >> 6) & 0x3), \ 8, 9, 10, 11, \ 12 + (((imm) >> 0) & 0x3), \ 12 + (((imm) >> 2) & 0x3), \ 12 + (((imm) >> 4) & 0x3), \ 12 + (((imm) >> 6) & 0x3), \ 16, 17, 18, 19, \ 20 + (((imm) >> 0) & 0x3), \ 20 + (((imm) >> 2) & 0x3), \ 20 + (((imm) >> 4) & 0x3), \ 20 + (((imm) >> 6) & 0x3), \ 24, 25, 26, 27, \ 28 + (((imm) >> 0) & 0x3), \ 28 + (((imm) >> 2) & 0x3), \ 28 + (((imm) >> 4) & 0x3), \ 28 + (((imm) >> 6) & 0x3)); }) #define _mm512_mask_shufflehi_epi16(W, U, A, imm) __extension__ ({ \ (__m512i)__builtin_ia32_selectw_512((__mmask32)(U), \ (__v32hi)_mm512_shufflehi_epi16((A), \ (imm)), \ (__v32hi)(__m512i)(W)); }) #define _mm512_maskz_shufflehi_epi16(U, A, imm) __extension__ ({ \ (__m512i)__builtin_ia32_selectw_512((__mmask32)(U), \ (__v32hi)_mm512_shufflehi_epi16((A), \ (imm)), \ (__v32hi)_mm512_setzero_hi()); }) #define _mm512_shufflelo_epi16(A, imm) __extension__ ({ \ (__m512i)__builtin_shufflevector((__v32hi)(__m512i)(A), \ (__v32hi)_mm512_undefined_epi32(), \ 0 + (((imm) >> 0) & 0x3), \ 0 + (((imm) >> 2) & 0x3), \ 0 + (((imm) >> 4) & 0x3), \ 0 + (((imm) >> 6) & 0x3), \ 4, 5, 6, 7, \ 8 + (((imm) >> 0) & 0x3), \ 8 + (((imm) >> 2) & 0x3), \ 8 + (((imm) >> 4) & 0x3), \ 8 + (((imm) >> 6) & 0x3), \ 12, 13, 14, 15, \ 16 + (((imm) >> 0) & 0x3), \ 16 + (((imm) >> 2) & 0x3), \ 16 + (((imm) >> 4) & 0x3), \ 16 + (((imm) >> 6) & 0x3), \ 20, 21, 22, 23, \ 24 + (((imm) >> 0) & 0x3), \ 24 + (((imm) >> 2) & 0x3), \ 24 + (((imm) >> 4) & 0x3), \ 24 + (((imm) >> 6) & 0x3), \ 28, 29, 30, 31); }) #define _mm512_mask_shufflelo_epi16(W, U, A, imm) __extension__ ({ \ (__m512i)__builtin_ia32_selectw_512((__mmask32)(U), \ (__v32hi)_mm512_shufflelo_epi16((A), \ (imm)), \ (__v32hi)(__m512i)(W)); }) #define _mm512_maskz_shufflelo_epi16(U, A, imm) __extension__ ({ \ (__m512i)__builtin_ia32_selectw_512((__mmask32)(U), \ (__v32hi)_mm512_shufflelo_epi16((A), \ (imm)), \ (__v32hi)_mm512_setzero_hi()); }) static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_sllv_epi16(__m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_psllv32hi((__v32hi) __A, (__v32hi) __B); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_sllv_epi16 (__m512i __W, __mmask32 __U, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U, (__v32hi)_mm512_sllv_epi16(__A, __B), (__v32hi)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_sllv_epi16(__mmask32 __U, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U, (__v32hi)_mm512_sllv_epi16(__A, __B), (__v32hi)_mm512_setzero_hi()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_sll_epi16(__m512i __A, __m128i __B) { return (__m512i)__builtin_ia32_psllw512((__v32hi) __A, (__v8hi) __B); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_sll_epi16(__m512i __W, __mmask32 __U, __m512i __A, __m128i __B) { return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U, (__v32hi)_mm512_sll_epi16(__A, __B), (__v32hi)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_sll_epi16(__mmask32 __U, __m512i __A, __m128i __B) { return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U, (__v32hi)_mm512_sll_epi16(__A, __B), (__v32hi)_mm512_setzero_hi()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_slli_epi16(__m512i __A, int __B) { return (__m512i)__builtin_ia32_psllwi512((__v32hi)__A, __B); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_slli_epi16(__m512i __W, __mmask32 __U, __m512i __A, int __B) { return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U, (__v32hi)_mm512_slli_epi16(__A, __B), (__v32hi)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_slli_epi16(__mmask32 __U, __m512i __A, int __B) { return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U, (__v32hi)_mm512_slli_epi16(__A, __B), (__v32hi)_mm512_setzero_hi()); } #define _mm512_bslli_epi128(a, imm) __extension__ ({ \ (__m512i)__builtin_shufflevector( \ (__v64qi)_mm512_setzero_si512(), \ (__v64qi)(__m512i)(a), \ ((char)(imm)&0xF0) ? 0 : ((char)(imm)>0x0 ? 16 : 64) - (char)(imm), \ ((char)(imm)&0xF0) ? 1 : ((char)(imm)>0x1 ? 17 : 65) - (char)(imm), \ ((char)(imm)&0xF0) ? 2 : ((char)(imm)>0x2 ? 18 : 66) - (char)(imm), \ ((char)(imm)&0xF0) ? 3 : ((char)(imm)>0x3 ? 19 : 67) - (char)(imm), \ ((char)(imm)&0xF0) ? 4 : ((char)(imm)>0x4 ? 20 : 68) - (char)(imm), \ ((char)(imm)&0xF0) ? 5 : ((char)(imm)>0x5 ? 21 : 69) - (char)(imm), \ ((char)(imm)&0xF0) ? 6 : ((char)(imm)>0x6 ? 22 : 70) - (char)(imm), \ ((char)(imm)&0xF0) ? 7 : ((char)(imm)>0x7 ? 23 : 71) - (char)(imm), \ ((char)(imm)&0xF0) ? 8 : ((char)(imm)>0x8 ? 24 : 72) - (char)(imm), \ ((char)(imm)&0xF0) ? 9 : ((char)(imm)>0x9 ? 25 : 73) - (char)(imm), \ ((char)(imm)&0xF0) ? 10 : ((char)(imm)>0xA ? 26 : 74) - (char)(imm), \ ((char)(imm)&0xF0) ? 11 : ((char)(imm)>0xB ? 27 : 75) - (char)(imm), \ ((char)(imm)&0xF0) ? 12 : ((char)(imm)>0xC ? 28 : 76) - (char)(imm), \ ((char)(imm)&0xF0) ? 13 : ((char)(imm)>0xD ? 29 : 77) - (char)(imm), \ ((char)(imm)&0xF0) ? 14 : ((char)(imm)>0xE ? 30 : 78) - (char)(imm), \ ((char)(imm)&0xF0) ? 15 : ((char)(imm)>0xF ? 31 : 79) - (char)(imm), \ ((char)(imm)&0xF0) ? 16 : ((char)(imm)>0x0 ? 32 : 80) - (char)(imm), \ ((char)(imm)&0xF0) ? 17 : ((char)(imm)>0x1 ? 33 : 81) - (char)(imm), \ ((char)(imm)&0xF0) ? 18 : ((char)(imm)>0x2 ? 34 : 82) - (char)(imm), \ ((char)(imm)&0xF0) ? 19 : ((char)(imm)>0x3 ? 35 : 83) - (char)(imm), \ ((char)(imm)&0xF0) ? 20 : ((char)(imm)>0x4 ? 36 : 84) - (char)(imm), \ ((char)(imm)&0xF0) ? 21 : ((char)(imm)>0x5 ? 37 : 85) - (char)(imm), \ ((char)(imm)&0xF0) ? 22 : ((char)(imm)>0x6 ? 38 : 86) - (char)(imm), \ ((char)(imm)&0xF0) ? 23 : ((char)(imm)>0x7 ? 39 : 87) - (char)(imm), \ ((char)(imm)&0xF0) ? 24 : ((char)(imm)>0x8 ? 40 : 88) - (char)(imm), \ ((char)(imm)&0xF0) ? 25 : ((char)(imm)>0x9 ? 41 : 89) - (char)(imm), \ ((char)(imm)&0xF0) ? 26 : ((char)(imm)>0xA ? 42 : 90) - (char)(imm), \ ((char)(imm)&0xF0) ? 27 : ((char)(imm)>0xB ? 43 : 91) - (char)(imm), \ ((char)(imm)&0xF0) ? 28 : ((char)(imm)>0xC ? 44 : 92) - (char)(imm), \ ((char)(imm)&0xF0) ? 29 : ((char)(imm)>0xD ? 45 : 93) - (char)(imm), \ ((char)(imm)&0xF0) ? 30 : ((char)(imm)>0xE ? 46 : 94) - (char)(imm), \ ((char)(imm)&0xF0) ? 31 : ((char)(imm)>0xF ? 47 : 95) - (char)(imm), \ ((char)(imm)&0xF0) ? 32 : ((char)(imm)>0x0 ? 48 : 96) - (char)(imm), \ ((char)(imm)&0xF0) ? 33 : ((char)(imm)>0x1 ? 49 : 97) - (char)(imm), \ ((char)(imm)&0xF0) ? 34 : ((char)(imm)>0x2 ? 50 : 98) - (char)(imm), \ ((char)(imm)&0xF0) ? 35 : ((char)(imm)>0x3 ? 51 : 99) - (char)(imm), \ ((char)(imm)&0xF0) ? 36 : ((char)(imm)>0x4 ? 52 : 100) - (char)(imm), \ ((char)(imm)&0xF0) ? 37 : ((char)(imm)>0x5 ? 53 : 101) - (char)(imm), \ ((char)(imm)&0xF0) ? 38 : ((char)(imm)>0x6 ? 54 : 102) - (char)(imm), \ ((char)(imm)&0xF0) ? 39 : ((char)(imm)>0x7 ? 55 : 103) - (char)(imm), \ ((char)(imm)&0xF0) ? 40 : ((char)(imm)>0x8 ? 56 : 104) - (char)(imm), \ ((char)(imm)&0xF0) ? 41 : ((char)(imm)>0x9 ? 57 : 105) - (char)(imm), \ ((char)(imm)&0xF0) ? 42 : ((char)(imm)>0xA ? 58 : 106) - (char)(imm), \ ((char)(imm)&0xF0) ? 43 : ((char)(imm)>0xB ? 59 : 107) - (char)(imm), \ ((char)(imm)&0xF0) ? 44 : ((char)(imm)>0xC ? 60 : 108) - (char)(imm), \ ((char)(imm)&0xF0) ? 45 : ((char)(imm)>0xD ? 61 : 109) - (char)(imm), \ ((char)(imm)&0xF0) ? 46 : ((char)(imm)>0xE ? 62 : 110) - (char)(imm), \ ((char)(imm)&0xF0) ? 47 : ((char)(imm)>0xF ? 63 : 111) - (char)(imm), \ ((char)(imm)&0xF0) ? 48 : ((char)(imm)>0x0 ? 64 : 112) - (char)(imm), \ ((char)(imm)&0xF0) ? 49 : ((char)(imm)>0x1 ? 65 : 113) - (char)(imm), \ ((char)(imm)&0xF0) ? 50 : ((char)(imm)>0x2 ? 66 : 114) - (char)(imm), \ ((char)(imm)&0xF0) ? 51 : ((char)(imm)>0x3 ? 67 : 115) - (char)(imm), \ ((char)(imm)&0xF0) ? 52 : ((char)(imm)>0x4 ? 68 : 116) - (char)(imm), \ ((char)(imm)&0xF0) ? 53 : ((char)(imm)>0x5 ? 69 : 117) - (char)(imm), \ ((char)(imm)&0xF0) ? 54 : ((char)(imm)>0x6 ? 70 : 118) - (char)(imm), \ ((char)(imm)&0xF0) ? 55 : ((char)(imm)>0x7 ? 71 : 119) - (char)(imm), \ ((char)(imm)&0xF0) ? 56 : ((char)(imm)>0x8 ? 72 : 120) - (char)(imm), \ ((char)(imm)&0xF0) ? 57 : ((char)(imm)>0x9 ? 73 : 121) - (char)(imm), \ ((char)(imm)&0xF0) ? 58 : ((char)(imm)>0xA ? 74 : 122) - (char)(imm), \ ((char)(imm)&0xF0) ? 59 : ((char)(imm)>0xB ? 75 : 123) - (char)(imm), \ ((char)(imm)&0xF0) ? 60 : ((char)(imm)>0xC ? 76 : 124) - (char)(imm), \ ((char)(imm)&0xF0) ? 61 : ((char)(imm)>0xD ? 77 : 125) - (char)(imm), \ ((char)(imm)&0xF0) ? 62 : ((char)(imm)>0xE ? 78 : 126) - (char)(imm), \ ((char)(imm)&0xF0) ? 63 : ((char)(imm)>0xF ? 79 : 127) - (char)(imm)); }) static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_srlv_epi16(__m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_psrlv32hi((__v32hi)__A, (__v32hi)__B); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_srlv_epi16(__m512i __W, __mmask32 __U, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U, (__v32hi)_mm512_srlv_epi16(__A, __B), (__v32hi)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_srlv_epi16(__mmask32 __U, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U, (__v32hi)_mm512_srlv_epi16(__A, __B), (__v32hi)_mm512_setzero_hi()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_srav_epi16(__m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_psrav32hi((__v32hi)__A, (__v32hi)__B); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_srav_epi16(__m512i __W, __mmask32 __U, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U, (__v32hi)_mm512_srav_epi16(__A, __B), (__v32hi)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_srav_epi16(__mmask32 __U, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U, (__v32hi)_mm512_srav_epi16(__A, __B), (__v32hi)_mm512_setzero_hi()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_sra_epi16(__m512i __A, __m128i __B) { return (__m512i)__builtin_ia32_psraw512((__v32hi) __A, (__v8hi) __B); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_sra_epi16(__m512i __W, __mmask32 __U, __m512i __A, __m128i __B) { return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U, (__v32hi)_mm512_sra_epi16(__A, __B), (__v32hi)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_sra_epi16(__mmask32 __U, __m512i __A, __m128i __B) { return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U, (__v32hi)_mm512_sra_epi16(__A, __B), (__v32hi)_mm512_setzero_hi()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_srai_epi16(__m512i __A, int __B) { return (__m512i)__builtin_ia32_psrawi512((__v32hi)__A, __B); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_srai_epi16(__m512i __W, __mmask32 __U, __m512i __A, int __B) { return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U, (__v32hi)_mm512_srai_epi16(__A, __B), (__v32hi)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_srai_epi16(__mmask32 __U, __m512i __A, int __B) { return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U, (__v32hi)_mm512_srai_epi16(__A, __B), (__v32hi)_mm512_setzero_hi()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_srl_epi16(__m512i __A, __m128i __B) { return (__m512i)__builtin_ia32_psrlw512((__v32hi) __A, (__v8hi) __B); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_srl_epi16(__m512i __W, __mmask32 __U, __m512i __A, __m128i __B) { return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U, (__v32hi)_mm512_srl_epi16(__A, __B), (__v32hi)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_srl_epi16(__mmask32 __U, __m512i __A, __m128i __B) { return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U, (__v32hi)_mm512_srl_epi16(__A, __B), (__v32hi)_mm512_setzero_hi()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_srli_epi16(__m512i __A, int __B) { return (__m512i)__builtin_ia32_psrlwi512((__v32hi)__A, __B); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_srli_epi16(__m512i __W, __mmask32 __U, __m512i __A, int __B) { return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U, (__v32hi)_mm512_srli_epi16(__A, __B), (__v32hi)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_srli_epi16(__mmask32 __U, __m512i __A, int __B) { return (__m512i)__builtin_ia32_selectw_512((__mmask32)__U, (__v32hi)_mm512_srli_epi16(__A, __B), (__v32hi)_mm512_setzero_hi()); } #define _mm512_bsrli_epi128(a, imm) __extension__ ({ \ (__m512i)__builtin_shufflevector( \ (__v64qi)(__m512i)(a), \ (__v64qi)_mm512_setzero_si512(), \ ((char)(imm)&0xF0) ? 64 : (char)(imm) + ((char)(imm)>0xF ? 48 : 0), \ ((char)(imm)&0xF0) ? 65 : (char)(imm) + ((char)(imm)>0xE ? 49 : 1), \ ((char)(imm)&0xF0) ? 66 : (char)(imm) + ((char)(imm)>0xD ? 50 : 2), \ ((char)(imm)&0xF0) ? 67 : (char)(imm) + ((char)(imm)>0xC ? 51 : 3), \ ((char)(imm)&0xF0) ? 68 : (char)(imm) + ((char)(imm)>0xB ? 52 : 4), \ ((char)(imm)&0xF0) ? 69 : (char)(imm) + ((char)(imm)>0xA ? 53 : 5), \ ((char)(imm)&0xF0) ? 70 : (char)(imm) + ((char)(imm)>0x9 ? 54 : 6), \ ((char)(imm)&0xF0) ? 71 : (char)(imm) + ((char)(imm)>0x8 ? 55 : 7), \ ((char)(imm)&0xF0) ? 72 : (char)(imm) + ((char)(imm)>0x7 ? 56 : 8), \ ((char)(imm)&0xF0) ? 73 : (char)(imm) + ((char)(imm)>0x6 ? 57 : 9), \ ((char)(imm)&0xF0) ? 74 : (char)(imm) + ((char)(imm)>0x5 ? 58 : 10), \ ((char)(imm)&0xF0) ? 75 : (char)(imm) + ((char)(imm)>0x4 ? 59 : 11), \ ((char)(imm)&0xF0) ? 76 : (char)(imm) + ((char)(imm)>0x3 ? 60 : 12), \ ((char)(imm)&0xF0) ? 77 : (char)(imm) + ((char)(imm)>0x2 ? 61 : 13), \ ((char)(imm)&0xF0) ? 78 : (char)(imm) + ((char)(imm)>0x1 ? 62 : 14), \ ((char)(imm)&0xF0) ? 79 : (char)(imm) + ((char)(imm)>0x0 ? 63 : 15), \ ((char)(imm)&0xF0) ? 80 : (char)(imm) + ((char)(imm)>0xF ? 64 : 16), \ ((char)(imm)&0xF0) ? 81 : (char)(imm) + ((char)(imm)>0xE ? 65 : 17), \ ((char)(imm)&0xF0) ? 82 : (char)(imm) + ((char)(imm)>0xD ? 66 : 18), \ ((char)(imm)&0xF0) ? 83 : (char)(imm) + ((char)(imm)>0xC ? 67 : 19), \ ((char)(imm)&0xF0) ? 84 : (char)(imm) + ((char)(imm)>0xB ? 68 : 20), \ ((char)(imm)&0xF0) ? 85 : (char)(imm) + ((char)(imm)>0xA ? 69 : 21), \ ((char)(imm)&0xF0) ? 86 : (char)(imm) + ((char)(imm)>0x9 ? 70 : 22), \ ((char)(imm)&0xF0) ? 87 : (char)(imm) + ((char)(imm)>0x8 ? 71 : 23), \ ((char)(imm)&0xF0) ? 88 : (char)(imm) + ((char)(imm)>0x7 ? 72 : 24), \ ((char)(imm)&0xF0) ? 89 : (char)(imm) + ((char)(imm)>0x6 ? 73 : 25), \ ((char)(imm)&0xF0) ? 90 : (char)(imm) + ((char)(imm)>0x5 ? 74 : 26), \ ((char)(imm)&0xF0) ? 91 : (char)(imm) + ((char)(imm)>0x4 ? 75 : 27), \ ((char)(imm)&0xF0) ? 92 : (char)(imm) + ((char)(imm)>0x3 ? 76 : 28), \ ((char)(imm)&0xF0) ? 93 : (char)(imm) + ((char)(imm)>0x2 ? 77 : 29), \ ((char)(imm)&0xF0) ? 94 : (char)(imm) + ((char)(imm)>0x1 ? 78 : 30), \ ((char)(imm)&0xF0) ? 95 : (char)(imm) + ((char)(imm)>0x0 ? 79 : 31), \ ((char)(imm)&0xF0) ? 96 : (char)(imm) + ((char)(imm)>0xF ? 80 : 32), \ ((char)(imm)&0xF0) ? 97 : (char)(imm) + ((char)(imm)>0xE ? 81 : 33), \ ((char)(imm)&0xF0) ? 98 : (char)(imm) + ((char)(imm)>0xD ? 82 : 34), \ ((char)(imm)&0xF0) ? 99 : (char)(imm) + ((char)(imm)>0xC ? 83 : 35), \ ((char)(imm)&0xF0) ? 100 : (char)(imm) + ((char)(imm)>0xB ? 84 : 36), \ ((char)(imm)&0xF0) ? 101 : (char)(imm) + ((char)(imm)>0xA ? 85 : 37), \ ((char)(imm)&0xF0) ? 102 : (char)(imm) + ((char)(imm)>0x9 ? 86 : 38), \ ((char)(imm)&0xF0) ? 103 : (char)(imm) + ((char)(imm)>0x8 ? 87 : 39), \ ((char)(imm)&0xF0) ? 104 : (char)(imm) + ((char)(imm)>0x7 ? 88 : 40), \ ((char)(imm)&0xF0) ? 105 : (char)(imm) + ((char)(imm)>0x6 ? 89 : 41), \ ((char)(imm)&0xF0) ? 106 : (char)(imm) + ((char)(imm)>0x5 ? 90 : 42), \ ((char)(imm)&0xF0) ? 107 : (char)(imm) + ((char)(imm)>0x4 ? 91 : 43), \ ((char)(imm)&0xF0) ? 108 : (char)(imm) + ((char)(imm)>0x3 ? 92 : 44), \ ((char)(imm)&0xF0) ? 109 : (char)(imm) + ((char)(imm)>0x2 ? 93 : 45), \ ((char)(imm)&0xF0) ? 110 : (char)(imm) + ((char)(imm)>0x1 ? 94 : 46), \ ((char)(imm)&0xF0) ? 111 : (char)(imm) + ((char)(imm)>0x0 ? 95 : 47), \ ((char)(imm)&0xF0) ? 112 : (char)(imm) + ((char)(imm)>0xF ? 96 : 48), \ ((char)(imm)&0xF0) ? 113 : (char)(imm) + ((char)(imm)>0xE ? 97 : 49), \ ((char)(imm)&0xF0) ? 114 : (char)(imm) + ((char)(imm)>0xD ? 98 : 50), \ ((char)(imm)&0xF0) ? 115 : (char)(imm) + ((char)(imm)>0xC ? 99 : 51), \ ((char)(imm)&0xF0) ? 116 : (char)(imm) + ((char)(imm)>0xB ? 100 : 52), \ ((char)(imm)&0xF0) ? 117 : (char)(imm) + ((char)(imm)>0xA ? 101 : 53), \ ((char)(imm)&0xF0) ? 118 : (char)(imm) + ((char)(imm)>0x9 ? 102 : 54), \ ((char)(imm)&0xF0) ? 119 : (char)(imm) + ((char)(imm)>0x8 ? 103 : 55), \ ((char)(imm)&0xF0) ? 120 : (char)(imm) + ((char)(imm)>0x7 ? 104 : 56), \ ((char)(imm)&0xF0) ? 121 : (char)(imm) + ((char)(imm)>0x6 ? 105 : 57), \ ((char)(imm)&0xF0) ? 122 : (char)(imm) + ((char)(imm)>0x5 ? 106 : 58), \ ((char)(imm)&0xF0) ? 123 : (char)(imm) + ((char)(imm)>0x4 ? 107 : 59), \ ((char)(imm)&0xF0) ? 124 : (char)(imm) + ((char)(imm)>0x3 ? 108 : 60), \ ((char)(imm)&0xF0) ? 125 : (char)(imm) + ((char)(imm)>0x2 ? 109 : 61), \ ((char)(imm)&0xF0) ? 126 : (char)(imm) + ((char)(imm)>0x1 ? 110 : 62), \ ((char)(imm)&0xF0) ? 127 : (char)(imm) + ((char)(imm)>0x0 ? 111 : 63)); }) static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_mov_epi16 (__m512i __W, __mmask32 __U, __m512i __A) { return (__m512i) __builtin_ia32_selectw_512 ((__mmask32) __U, (__v32hi) __A, (__v32hi) __W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_mov_epi16 (__mmask32 __U, __m512i __A) { return (__m512i) __builtin_ia32_selectw_512 ((__mmask32) __U, (__v32hi) __A, (__v32hi) _mm512_setzero_hi ()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_mov_epi8 (__m512i __W, __mmask64 __U, __m512i __A) { return (__m512i) __builtin_ia32_selectb_512 ((__mmask64) __U, (__v64qi) __A, (__v64qi) __W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_mov_epi8 (__mmask64 __U, __m512i __A) { return (__m512i) __builtin_ia32_selectb_512 ((__mmask64) __U, (__v64qi) __A, (__v64qi) _mm512_setzero_hi ()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_set1_epi8 (__m512i __O, __mmask64 __M, char __A) { return (__m512i) __builtin_ia32_selectb_512(__M, (__v64qi)_mm512_set1_epi8(__A), (__v64qi) __O); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_set1_epi8 (__mmask64 __M, char __A) { return (__m512i) __builtin_ia32_selectb_512(__M, (__v64qi) _mm512_set1_epi8(__A), (__v64qi) _mm512_setzero_si512()); } static __inline__ __mmask64 __DEFAULT_FN_ATTRS _mm512_kunpackd (__mmask64 __A, __mmask64 __B) { return (__mmask64) __builtin_ia32_kunpckdi ((__mmask64) __A, (__mmask64) __B); } static __inline__ __mmask32 __DEFAULT_FN_ATTRS _mm512_kunpackw (__mmask32 __A, __mmask32 __B) { return (__mmask32) __builtin_ia32_kunpcksi ((__mmask32) __A, (__mmask32) __B); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_loadu_epi16 (__m512i __W, __mmask32 __U, void const *__P) { return (__m512i) __builtin_ia32_loaddquhi512_mask ((__v32hi *) __P, (__v32hi) __W, (__mmask32) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_loadu_epi16 (__mmask32 __U, void const *__P) { return (__m512i) __builtin_ia32_loaddquhi512_mask ((__v32hi *) __P, (__v32hi) _mm512_setzero_hi (), (__mmask32) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_loadu_epi8 (__m512i __W, __mmask64 __U, void const *__P) { return (__m512i) __builtin_ia32_loaddquqi512_mask ((__v64qi *) __P, (__v64qi) __W, (__mmask64) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_loadu_epi8 (__mmask64 __U, void const *__P) { return (__m512i) __builtin_ia32_loaddquqi512_mask ((__v64qi *) __P, (__v64qi) _mm512_setzero_hi (), (__mmask64) __U); } static __inline__ void __DEFAULT_FN_ATTRS _mm512_mask_storeu_epi16 (void *__P, __mmask32 __U, __m512i __A) { __builtin_ia32_storedquhi512_mask ((__v32hi *) __P, (__v32hi) __A, (__mmask32) __U); } static __inline__ void __DEFAULT_FN_ATTRS _mm512_mask_storeu_epi8 (void *__P, __mmask64 __U, __m512i __A) { __builtin_ia32_storedquqi512_mask ((__v64qi *) __P, (__v64qi) __A, (__mmask64) __U); } static __inline__ __mmask64 __DEFAULT_FN_ATTRS _mm512_test_epi8_mask (__m512i __A, __m512i __B) { return _mm512_cmpneq_epi8_mask (_mm512_and_epi32 (__A, __B), _mm512_setzero_qi()); } static __inline__ __mmask64 __DEFAULT_FN_ATTRS _mm512_mask_test_epi8_mask (__mmask64 __U, __m512i __A, __m512i __B) { return _mm512_mask_cmpneq_epi8_mask (__U, _mm512_and_epi32 (__A, __B), _mm512_setzero_qi()); } static __inline__ __mmask32 __DEFAULT_FN_ATTRS _mm512_test_epi16_mask (__m512i __A, __m512i __B) { return _mm512_cmpneq_epi16_mask (_mm512_and_epi32 (__A, __B), _mm512_setzero_qi()); } static __inline__ __mmask32 __DEFAULT_FN_ATTRS _mm512_mask_test_epi16_mask (__mmask32 __U, __m512i __A, __m512i __B) { return _mm512_mask_cmpneq_epi16_mask (__U, _mm512_and_epi32 (__A, __B), _mm512_setzero_qi()); } static __inline__ __mmask64 __DEFAULT_FN_ATTRS _mm512_testn_epi8_mask (__m512i __A, __m512i __B) { return _mm512_cmpeq_epi8_mask (_mm512_and_epi32 (__A, __B), _mm512_setzero_qi()); } static __inline__ __mmask64 __DEFAULT_FN_ATTRS _mm512_mask_testn_epi8_mask (__mmask64 __U, __m512i __A, __m512i __B) { return _mm512_mask_cmpeq_epi8_mask (__U, _mm512_and_epi32 (__A, __B), _mm512_setzero_qi()); } static __inline__ __mmask32 __DEFAULT_FN_ATTRS _mm512_testn_epi16_mask (__m512i __A, __m512i __B) { return _mm512_cmpeq_epi16_mask (_mm512_and_epi32 (__A, __B), _mm512_setzero_qi()); } static __inline__ __mmask32 __DEFAULT_FN_ATTRS _mm512_mask_testn_epi16_mask (__mmask32 __U, __m512i __A, __m512i __B) { return _mm512_mask_cmpeq_epi16_mask (__U, _mm512_and_epi32 (__A, __B), _mm512_setzero_qi()); } static __inline__ __mmask64 __DEFAULT_FN_ATTRS _mm512_movepi8_mask (__m512i __A) { return (__mmask64) __builtin_ia32_cvtb2mask512 ((__v64qi) __A); } static __inline__ __mmask32 __DEFAULT_FN_ATTRS _mm512_movepi16_mask (__m512i __A) { return (__mmask32) __builtin_ia32_cvtw2mask512 ((__v32hi) __A); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_movm_epi8 (__mmask64 __A) { return (__m512i) __builtin_ia32_cvtmask2b512 (__A); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_movm_epi16 (__mmask32 __A) { return (__m512i) __builtin_ia32_cvtmask2w512 (__A); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_broadcastb_epi8 (__m128i __A) { return (__m512i)__builtin_shufflevector((__v16qi) __A, (__v16qi)_mm_undefined_si128(), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_broadcastb_epi8 (__m512i __O, __mmask64 __M, __m128i __A) { return (__m512i)__builtin_ia32_selectb_512(__M, (__v64qi) _mm512_broadcastb_epi8(__A), (__v64qi) __O); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_broadcastb_epi8 (__mmask64 __M, __m128i __A) { return (__m512i)__builtin_ia32_selectb_512(__M, (__v64qi) _mm512_broadcastb_epi8(__A), (__v64qi) _mm512_setzero_si512()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_set1_epi16 (__m512i __O, __mmask32 __M, short __A) { return (__m512i) __builtin_ia32_selectw_512(__M, (__v32hi) _mm512_set1_epi16(__A), (__v32hi) __O); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_set1_epi16 (__mmask32 __M, short __A) { return (__m512i) __builtin_ia32_selectw_512(__M, (__v32hi) _mm512_set1_epi16(__A), (__v32hi) _mm512_setzero_si512()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_broadcastw_epi16 (__m128i __A) { return (__m512i)__builtin_shufflevector((__v8hi) __A, (__v8hi)_mm_undefined_si128(), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_broadcastw_epi16 (__m512i __O, __mmask32 __M, __m128i __A) { return (__m512i)__builtin_ia32_selectw_512(__M, (__v32hi) _mm512_broadcastw_epi16(__A), (__v32hi) __O); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_broadcastw_epi16 (__mmask32 __M, __m128i __A) { return (__m512i)__builtin_ia32_selectw_512(__M, (__v32hi) _mm512_broadcastw_epi16(__A), (__v32hi) _mm512_setzero_si512()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_permutexvar_epi16 (__m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_permvarhi512_mask ((__v32hi) __B, (__v32hi) __A, (__v32hi) _mm512_undefined_epi32 (), (__mmask32) -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_permutexvar_epi16 (__mmask32 __M, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_permvarhi512_mask ((__v32hi) __B, (__v32hi) __A, (__v32hi) _mm512_setzero_hi(), (__mmask32) __M); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_permutexvar_epi16 (__m512i __W, __mmask32 __M, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_permvarhi512_mask ((__v32hi) __B, (__v32hi) __A, (__v32hi) __W, (__mmask32) __M); } #define _mm512_alignr_epi8(A, B, N) __extension__ ({\ (__m512i)__builtin_ia32_palignr512_mask((__v64qi)(__m512i)(A), \ (__v64qi)(__m512i)(B), (int)(N), \ (__v64qi)_mm512_undefined_pd(), \ (__mmask64)-1); }) #define _mm512_mask_alignr_epi8(W, U, A, B, N) __extension__({\ (__m512i)__builtin_ia32_palignr512_mask((__v64qi)(__m512i)(A), \ (__v64qi)(__m512i)(B), (int)(N), \ (__v64qi)(__m512i)(W), \ (__mmask64)(U)); }) #define _mm512_maskz_alignr_epi8(U, A, B, N) __extension__({\ (__m512i)__builtin_ia32_palignr512_mask((__v64qi)(__m512i)(A), \ (__v64qi)(__m512i)(B), (int)(N), \ (__v64qi)_mm512_setzero_si512(), \ (__mmask64)(U)); }) #define _mm512_dbsad_epu8(A, B, imm) __extension__ ({\ (__m512i)__builtin_ia32_dbpsadbw512_mask((__v64qi)(__m512i)(A), \ (__v64qi)(__m512i)(B), (int)(imm), \ (__v32hi)_mm512_undefined_epi32(), \ (__mmask32)-1); }) #define _mm512_mask_dbsad_epu8(W, U, A, B, imm) ({\ (__m512i)__builtin_ia32_dbpsadbw512_mask((__v64qi)(__m512i)(A), \ (__v64qi)(__m512i)(B), (int)(imm), \ (__v32hi)(__m512i)(W), \ (__mmask32)(U)); }) #define _mm512_maskz_dbsad_epu8(U, A, B, imm) ({\ (__m512i)__builtin_ia32_dbpsadbw512_mask((__v64qi)(__m512i)(A), \ (__v64qi)(__m512i)(B), (int)(imm), \ (__v32hi)_mm512_setzero_hi(), \ (__mmask32)(U)); }) static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_sad_epu8 (__m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_psadbw512 ((__v64qi) __A, (__v64qi) __B); } #undef __DEFAULT_FN_ATTRS #endif # 2141 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512bwintrin.h" 3 # 151 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 2 3 #endif # 152 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || defined(__AVX512BITALG__) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 154 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512bitalgintrin.h" 1 3 /*===------------- avx512bitalgintrin.h - BITALG intrinsics ------------------=== * * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __IMMINTRIN_H #error "Never use directly; include instead." #endif # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512bitalgintrin.h" 3 #ifndef __AVX512BITALGINTRIN_H #define __AVX512BITALGINTRIN_H /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("avx512bitalg"))) static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_popcnt_epi16(__m512i __A) { return (__m512i) __builtin_ia32_vpopcntw_512((__v32hi) __A); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_popcnt_epi16(__m512i __A, __mmask32 __U, __m512i __B) { return (__m512i) __builtin_ia32_selectw_512((__mmask32) __U, (__v32hi) _mm512_popcnt_epi16(__B), (__v32hi) __A); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_popcnt_epi16(__mmask32 __U, __m512i __B) { return _mm512_mask_popcnt_epi16((__m512i) _mm512_setzero_hi(), __U, __B); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_popcnt_epi8(__m512i __A) { return (__m512i) __builtin_ia32_vpopcntb_512((__v64qi) __A); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_popcnt_epi8(__m512i __A, __mmask64 __U, __m512i __B) { return (__m512i) __builtin_ia32_selectb_512((__mmask64) __U, (__v64qi) _mm512_popcnt_epi8(__B), (__v64qi) __A); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_popcnt_epi8(__mmask64 __U, __m512i __B) { return _mm512_mask_popcnt_epi8((__m512i) _mm512_setzero_qi(), __U, __B); } static __inline__ __mmask64 __DEFAULT_FN_ATTRS _mm512_mask_bitshuffle_epi64_mask(__mmask64 __U, __m512i __A, __m512i __B) { return (__mmask64) __builtin_ia32_vpshufbitqmb512_mask((__v64qi) __A, (__v64qi) __B, __U); } static __inline__ __mmask64 __DEFAULT_FN_ATTRS _mm512_bitshuffle_epi64_mask(__m512i __A, __m512i __B) { return _mm512_mask_bitshuffle_epi64_mask((__mmask64) -1, __A, __B); } #undef __DEFAULT_FN_ATTRS #endif # 98 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512bitalgintrin.h" 3 # 155 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 2 3 #endif # 156 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || defined(__AVX512CD__) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 158 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512cdintrin.h" 1 3 /*===------------- avx512cdintrin.h - AVX512CD intrinsics ------------------=== * * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __IMMINTRIN_H #error "Never use directly; include instead." #endif # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512cdintrin.h" 3 #ifndef __AVX512CDINTRIN_H #define __AVX512CDINTRIN_H /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("avx512cd"))) static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_conflict_epi64 (__m512i __A) { return (__m512i) __builtin_ia32_vpconflictdi_512_mask ((__v8di) __A, (__v8di) _mm512_setzero_si512 (), (__mmask8) -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_conflict_epi64 (__m512i __W, __mmask8 __U, __m512i __A) { return (__m512i) __builtin_ia32_vpconflictdi_512_mask ((__v8di) __A, (__v8di) __W, (__mmask8) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_conflict_epi64 (__mmask8 __U, __m512i __A) { return (__m512i) __builtin_ia32_vpconflictdi_512_mask ((__v8di) __A, (__v8di) _mm512_setzero_si512 (), (__mmask8) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_conflict_epi32 (__m512i __A) { return (__m512i) __builtin_ia32_vpconflictsi_512_mask ((__v16si) __A, (__v16si) _mm512_setzero_si512 (), (__mmask16) -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_conflict_epi32 (__m512i __W, __mmask16 __U, __m512i __A) { return (__m512i) __builtin_ia32_vpconflictsi_512_mask ((__v16si) __A, (__v16si) __W, (__mmask16) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_conflict_epi32 (__mmask16 __U, __m512i __A) { return (__m512i) __builtin_ia32_vpconflictsi_512_mask ((__v16si) __A, (__v16si) _mm512_setzero_si512 (), (__mmask16) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_lzcnt_epi32 (__m512i __A) { return (__m512i) __builtin_ia32_vplzcntd_512_mask ((__v16si) __A, (__v16si) _mm512_setzero_si512 (), (__mmask16) -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_lzcnt_epi32 (__m512i __W, __mmask16 __U, __m512i __A) { return (__m512i) __builtin_ia32_vplzcntd_512_mask ((__v16si) __A, (__v16si) __W, (__mmask16) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_lzcnt_epi32 (__mmask16 __U, __m512i __A) { return (__m512i) __builtin_ia32_vplzcntd_512_mask ((__v16si) __A, (__v16si) _mm512_setzero_si512 (), (__mmask16) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_lzcnt_epi64 (__m512i __A) { return (__m512i) __builtin_ia32_vplzcntq_512_mask ((__v8di) __A, (__v8di) _mm512_setzero_si512 (), (__mmask8) -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_lzcnt_epi64 (__m512i __W, __mmask8 __U, __m512i __A) { return (__m512i) __builtin_ia32_vplzcntq_512_mask ((__v8di) __A, (__v8di) __W, (__mmask8) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_lzcnt_epi64 (__mmask8 __U, __m512i __A) { return (__m512i) __builtin_ia32_vplzcntq_512_mask ((__v8di) __A, (__v8di) _mm512_setzero_si512 (), (__mmask8) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_broadcastmb_epi64 (__mmask8 __A) { return (__m512i) _mm512_set1_epi64((long long) __A); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_broadcastmw_epi32 (__mmask16 __A) { return (__m512i) _mm512_set1_epi32((int) __A); } #undef __DEFAULT_FN_ATTRS #endif # 146 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512cdintrin.h" 3 # 159 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 2 3 #endif # 160 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || defined(__AVX512VPOPCNTDQ__) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 162 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512vpopcntdqintrin.h" 1 3 /*===------------- avx512vpopcntdqintrin.h - AVX512VPOPCNTDQ intrinsics *------------------=== * * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __IMMINTRIN_H #error \ "Never use directly; include instead." #endif # 29 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512vpopcntdqintrin.h" 3 #ifndef __AVX512VPOPCNTDQINTRIN_H #define __AVX512VPOPCNTDQINTRIN_H /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS \ __attribute__((__always_inline__, __nodebug__, __target__("avx512vpopcntd" \ "q"))) static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_popcnt_epi64(__m512i __A) { return (__m512i)__builtin_ia32_vpopcntq_512((__v8di)__A); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_popcnt_epi64(__m512i __W, __mmask8 __U, __m512i __A) { return (__m512i)__builtin_ia32_selectq_512( (__mmask8)__U, (__v8di)_mm512_popcnt_epi64(__A), (__v8di)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_popcnt_epi64(__mmask8 __U, __m512i __A) { return _mm512_mask_popcnt_epi64((__m512i)_mm512_setzero_si512(), __U, __A); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_popcnt_epi32(__m512i __A) { return (__m512i)__builtin_ia32_vpopcntd_512((__v16si)__A); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_popcnt_epi32(__m512i __W, __mmask16 __U, __m512i __A) { return (__m512i)__builtin_ia32_selectd_512( (__mmask16)__U, (__v16si)_mm512_popcnt_epi32(__A), (__v16si)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_popcnt_epi32(__mmask16 __U, __m512i __A) { return _mm512_mask_popcnt_epi32((__m512i)_mm512_setzero_si512(), __U, __A); } #undef __DEFAULT_FN_ATTRS #endif # 71 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512vpopcntdqintrin.h" 3 # 163 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 2 3 #endif # 164 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || \ (defined(__AVX512VL__) && defined(__AVX512VPOPCNTDQ__)) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 167 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512vpopcntdqvlintrin.h" 1 3 /*===------------- avx512vpopcntdqintrin.h - AVX512VPOPCNTDQ intrinsics *------------------=== * * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __IMMINTRIN_H #error \ "Never use directly; include instead." #endif # 29 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512vpopcntdqvlintrin.h" 3 #ifndef __AVX512VPOPCNTDQVLINTRIN_H #define __AVX512VPOPCNTDQVLINTRIN_H /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS \ __attribute__((__always_inline__, __nodebug__, __target__("avx512vpopcntdq,avx512vl"))) static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_popcnt_epi64(__m128i __A) { return (__m128i)__builtin_ia32_vpopcntq_128((__v2di)__A); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_popcnt_epi64(__m128i __W, __mmask8 __U, __m128i __A) { return (__m128i)__builtin_ia32_selectq_128( (__mmask8)__U, (__v2di)_mm_popcnt_epi64(__A), (__v2di)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_popcnt_epi64(__mmask8 __U, __m128i __A) { return _mm_mask_popcnt_epi64((__m128i)_mm_setzero_si128(), __U, __A); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_popcnt_epi32(__m128i __A) { return (__m128i)__builtin_ia32_vpopcntd_128((__v4si)__A); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_popcnt_epi32(__m128i __W, __mmask8 __U, __m128i __A) { return (__m128i)__builtin_ia32_selectd_128( (__mmask8)__U, (__v4si)_mm_popcnt_epi32(__A), (__v4si)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_popcnt_epi32(__mmask8 __U, __m128i __A) { return _mm_mask_popcnt_epi32((__m128i)_mm_setzero_si128(), __U, __A); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_popcnt_epi64(__m256i __A) { return (__m256i)__builtin_ia32_vpopcntq_256((__v4di)__A); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_popcnt_epi64(__m256i __W, __mmask8 __U, __m256i __A) { return (__m256i)__builtin_ia32_selectq_256( (__mmask8)__U, (__v4di)_mm256_popcnt_epi64(__A), (__v4di)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_popcnt_epi64(__mmask8 __U, __m256i __A) { return _mm256_mask_popcnt_epi64((__m256i)_mm256_setzero_si256(), __U, __A); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_popcnt_epi32(__m256i __A) { return (__m256i)__builtin_ia32_vpopcntd_256((__v8si)__A); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_popcnt_epi32(__m256i __W, __mmask8 __U, __m256i __A) { return (__m256i)__builtin_ia32_selectd_256( (__mmask8)__U, (__v8si)_mm256_popcnt_epi32(__A), (__v8si)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_popcnt_epi32(__mmask8 __U, __m256i __A) { return _mm256_mask_popcnt_epi32((__m256i)_mm256_setzero_si256(), __U, __A); } #undef __DEFAULT_FN_ATTRS #endif # 100 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512vpopcntdqvlintrin.h" 3 # 168 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 2 3 #endif # 169 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || defined(__AVX512VNNI__) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 171 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512vnniintrin.h" 1 3 /*===------------- avx512vnniintrin.h - VNNI intrinsics ------------------=== * * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __IMMINTRIN_H #error "Never use directly; include instead." #endif # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512vnniintrin.h" 3 #ifndef __AVX512VNNIINTRIN_H #define __AVX512VNNIINTRIN_H /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("avx512vnni"))) static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_dpbusd_epi32(__m512i __S, __mmask16 __U, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_vpdpbusd512_mask ((__v16si) __S, (__v16si) __A, (__v16si) __B, (__mmask16) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_dpbusd_epi32(__mmask16 __U, __m512i __S, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_vpdpbusd512_maskz ((__v16si) __S, (__v16si) __A, (__v16si) __B, (__mmask16) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_dpbusd_epi32(__m512i __S, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_vpdpbusd512_mask ((__v16si) __S, (__v16si) __A, (__v16si) __B, (__mmask16) -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_dpbusds_epi32(__m512i __S, __mmask16 __U, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_vpdpbusds512_mask ((__v16si) __S, (__v16si) __A, (__v16si) __B, (__mmask16) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_dpbusds_epi32(__mmask16 __U, __m512i __S, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_vpdpbusds512_maskz ((__v16si) __S, (__v16si) __A, (__v16si) __B, (__mmask16) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_dpbusds_epi32(__m512i __S, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_vpdpbusds512_mask ((__v16si) __S, (__v16si) __A, (__v16si) __B, (__mmask16) -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_dpwssd_epi32(__m512i __S, __mmask16 __U, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_vpdpwssd512_mask ((__v16si) __S, (__v16si) __A, (__v16si) __B, (__mmask16) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_dpwssd_epi32(__mmask16 __U, __m512i __S, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_vpdpwssd512_maskz ((__v16si) __S, (__v16si) __A, (__v16si) __B, (__mmask16) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_dpwssd_epi32(__m512i __S, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_vpdpwssd512_mask ((__v16si) __S, (__v16si) __A, (__v16si) __B, (__mmask16) -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_dpwssds_epi32(__m512i __S, __mmask16 __U, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_vpdpwssds512_mask ((__v16si) __S, (__v16si) __A, (__v16si) __B, (__mmask16) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_dpwssds_epi32(__mmask16 __U, __m512i __S, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_vpdpwssds512_maskz ((__v16si) __S, (__v16si) __A, (__v16si) __B, (__mmask16) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_dpwssds_epi32(__m512i __S, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_vpdpwssds512_mask ((__v16si) __S, (__v16si) __A, (__v16si) __B, (__mmask16) -1); } #undef __DEFAULT_FN_ATTRS #endif # 147 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512vnniintrin.h" 3 # 172 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 2 3 #endif # 173 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || \ (defined(__AVX512VL__) && defined(__AVX512VNNI__)) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 176 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512vlvnniintrin.h" 1 3 /*===------------- avx512vlvnniintrin.h - VNNI intrinsics ------------------=== * * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __IMMINTRIN_H #error "Never use directly; include instead." #endif # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512vlvnniintrin.h" 3 #ifndef __AVX512VLVNNIINTRIN_H #define __AVX512VLVNNIINTRIN_H /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("avx512vl,avx512vnni"))) static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_dpbusd_epi32(__m256i __S, __mmask8 __U, __m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_vpdpbusd256_mask ((__v8si) __S, (__v8si) __A, (__v8si) __B, (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_dpbusd_epi32(__mmask8 __U, __m256i __S, __m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_vpdpbusd256_maskz ((__v8si) __S, (__v8si) __A, (__v8si) __B, (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_dpbusd_epi32(__m256i __S, __m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_vpdpbusd256_mask ((__v8si) __S, (__v8si) __A, (__v8si) __B, (__mmask8) -1); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_dpbusds_epi32(__m256i __S, __mmask8 __U, __m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_vpdpbusds256_mask ((__v8si) __S, (__v8si) __A, (__v8si) __B, (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_dpbusds_epi32(__mmask8 __U, __m256i __S, __m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_vpdpbusds256_maskz ((__v8si) __S, (__v8si) __A, (__v8si) __B, (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_dpbusds_epi32(__m256i __S, __m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_vpdpbusds256_mask ((__v8si) __S, (__v8si) __A, (__v8si) __B, (__mmask8) -1); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_dpwssd_epi32(__m256i __S, __mmask8 __U, __m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_vpdpwssd256_mask ((__v8si) __S, (__v8si) __A, (__v8si) __B, (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_dpwssd_epi32(__mmask8 __U, __m256i __S, __m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_vpdpwssd256_maskz ((__v8si) __S, (__v8si) __A, (__v8si) __B, (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_dpwssd_epi32(__m256i __S, __m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_vpdpwssd256_mask ((__v8si) __S, (__v8si) __A, (__v8si) __B, (__mmask8) -1); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_dpwssds_epi32(__m256i __S, __mmask8 __U, __m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_vpdpwssds256_mask ((__v8si) __S, (__v8si) __A, (__v8si) __B, (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_dpwssds_epi32(__mmask8 __U, __m256i __S, __m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_vpdpwssds256_maskz ((__v8si) __S, (__v8si) __A, (__v8si) __B, (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_dpwssds_epi32(__m256i __S, __m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_vpdpwssds256_mask ((__v8si) __S, (__v8si) __A, (__v8si) __B, (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm128_mask_dpbusd_epi32(__m128i __S, __mmask8 __U, __m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_vpdpbusd128_mask ((__v4si) __S, (__v4si) __A, (__v4si) __B, (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm128_maskz_dpbusd_epi32(__mmask8 __U, __m128i __S, __m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_vpdpbusd128_maskz ((__v4si) __S, (__v4si) __A, (__v4si) __B, (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm128_dpbusd_epi32(__m128i __S, __m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_vpdpbusd128_mask ((__v4si) __S, (__v4si) __A, (__v4si) __B, (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm128_mask_dpbusds_epi32(__m128i __S, __mmask8 __U, __m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_vpdpbusds128_mask ((__v4si) __S, (__v4si) __A, (__v4si) __B, (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm128_maskz_dpbusds_epi32(__mmask8 __U, __m128i __S, __m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_vpdpbusds128_maskz ((__v4si) __S, (__v4si) __A, (__v4si) __B, (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm128_dpbusds_epi32(__m128i __S, __m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_vpdpbusds128_mask ((__v4si) __S, (__v4si) __A, (__v4si) __B, (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm128_mask_dpwssd_epi32(__m128i __S, __mmask8 __U, __m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_vpdpwssd128_mask ((__v4si) __S, (__v4si) __A, (__v4si) __B, (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm128_maskz_dpwssd_epi32(__mmask8 __U, __m128i __S, __m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_vpdpwssd128_maskz ((__v4si) __S, (__v4si) __A, (__v4si) __B, (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm128_dpwssd_epi32(__m128i __S, __m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_vpdpwssd128_mask ((__v4si) __S, (__v4si) __A, (__v4si) __B, (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm128_mask_dpwssds_epi32(__m128i __S, __mmask8 __U, __m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_vpdpwssds128_mask ((__v4si) __S, (__v4si) __A, (__v4si) __B, (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm128_maskz_dpwssds_epi32(__mmask8 __U, __m128i __S, __m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_vpdpwssds128_maskz ((__v4si) __S, (__v4si) __A, (__v4si) __B, (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm128_dpwssds_epi32(__m128i __S, __m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_vpdpwssds128_mask ((__v4si) __S, (__v4si) __A, (__v4si) __B, (__mmask8) -1); } #undef __DEFAULT_FN_ATTRS #endif # 255 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512vlvnniintrin.h" 3 # 177 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 2 3 #endif # 178 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || defined(__AVX512DQ__) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 180 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512dqintrin.h" 1 3 /*===---- avx512dqintrin.h - AVX512DQ intrinsics ---------------------------=== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __IMMINTRIN_H #error "Never use directly; include instead." #endif # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512dqintrin.h" 3 #ifndef __AVX512DQINTRIN_H #define __AVX512DQINTRIN_H /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("avx512dq"))) static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mullo_epi64 (__m512i __A, __m512i __B) { return (__m512i) ((__v8du) __A * (__v8du) __B); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_mullo_epi64(__m512i __W, __mmask8 __U, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U, (__v8di)_mm512_mullo_epi64(__A, __B), (__v8di)__W); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_mullo_epi64(__mmask8 __U, __m512i __A, __m512i __B) { return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U, (__v8di)_mm512_mullo_epi64(__A, __B), (__v8di)_mm512_setzero_si512()); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_xor_pd(__m512d __A, __m512d __B) { return (__m512d)((__v8du)__A ^ (__v8du)__B); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_mask_xor_pd(__m512d __W, __mmask8 __U, __m512d __A, __m512d __B) { return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U, (__v8df)_mm512_xor_pd(__A, __B), (__v8df)__W); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_maskz_xor_pd(__mmask8 __U, __m512d __A, __m512d __B) { return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U, (__v8df)_mm512_xor_pd(__A, __B), (__v8df)_mm512_setzero_pd()); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_xor_ps (__m512 __A, __m512 __B) { return (__m512)((__v16su)__A ^ (__v16su)__B); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_mask_xor_ps(__m512 __W, __mmask16 __U, __m512 __A, __m512 __B) { return (__m512)__builtin_ia32_selectps_512((__mmask16)__U, (__v16sf)_mm512_xor_ps(__A, __B), (__v16sf)__W); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_maskz_xor_ps(__mmask16 __U, __m512 __A, __m512 __B) { return (__m512)__builtin_ia32_selectps_512((__mmask16)__U, (__v16sf)_mm512_xor_ps(__A, __B), (__v16sf)_mm512_setzero_ps()); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_or_pd(__m512d __A, __m512d __B) { return (__m512d)((__v8du)__A | (__v8du)__B); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_mask_or_pd(__m512d __W, __mmask8 __U, __m512d __A, __m512d __B) { return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U, (__v8df)_mm512_or_pd(__A, __B), (__v8df)__W); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_maskz_or_pd(__mmask8 __U, __m512d __A, __m512d __B) { return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U, (__v8df)_mm512_or_pd(__A, __B), (__v8df)_mm512_setzero_pd()); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_or_ps(__m512 __A, __m512 __B) { return (__m512)((__v16su)__A | (__v16su)__B); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_mask_or_ps(__m512 __W, __mmask16 __U, __m512 __A, __m512 __B) { return (__m512)__builtin_ia32_selectps_512((__mmask16)__U, (__v16sf)_mm512_or_ps(__A, __B), (__v16sf)__W); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_maskz_or_ps(__mmask16 __U, __m512 __A, __m512 __B) { return (__m512)__builtin_ia32_selectps_512((__mmask16)__U, (__v16sf)_mm512_or_ps(__A, __B), (__v16sf)_mm512_setzero_ps()); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_and_pd(__m512d __A, __m512d __B) { return (__m512d)((__v8du)__A & (__v8du)__B); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_mask_and_pd(__m512d __W, __mmask8 __U, __m512d __A, __m512d __B) { return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U, (__v8df)_mm512_and_pd(__A, __B), (__v8df)__W); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_maskz_and_pd(__mmask8 __U, __m512d __A, __m512d __B) { return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U, (__v8df)_mm512_and_pd(__A, __B), (__v8df)_mm512_setzero_pd()); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_and_ps(__m512 __A, __m512 __B) { return (__m512)((__v16su)__A & (__v16su)__B); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_mask_and_ps(__m512 __W, __mmask16 __U, __m512 __A, __m512 __B) { return (__m512)__builtin_ia32_selectps_512((__mmask16)__U, (__v16sf)_mm512_and_ps(__A, __B), (__v16sf)__W); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_maskz_and_ps(__mmask16 __U, __m512 __A, __m512 __B) { return (__m512)__builtin_ia32_selectps_512((__mmask16)__U, (__v16sf)_mm512_and_ps(__A, __B), (__v16sf)_mm512_setzero_ps()); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_andnot_pd(__m512d __A, __m512d __B) { return (__m512d)(~(__v8du)__A & (__v8du)__B); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_mask_andnot_pd(__m512d __W, __mmask8 __U, __m512d __A, __m512d __B) { return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U, (__v8df)_mm512_andnot_pd(__A, __B), (__v8df)__W); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_maskz_andnot_pd(__mmask8 __U, __m512d __A, __m512d __B) { return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__U, (__v8df)_mm512_andnot_pd(__A, __B), (__v8df)_mm512_setzero_pd()); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_andnot_ps(__m512 __A, __m512 __B) { return (__m512)(~(__v16su)__A & (__v16su)__B); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_mask_andnot_ps(__m512 __W, __mmask16 __U, __m512 __A, __m512 __B) { return (__m512)__builtin_ia32_selectps_512((__mmask16)__U, (__v16sf)_mm512_andnot_ps(__A, __B), (__v16sf)__W); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_maskz_andnot_ps(__mmask16 __U, __m512 __A, __m512 __B) { return (__m512)__builtin_ia32_selectps_512((__mmask16)__U, (__v16sf)_mm512_andnot_ps(__A, __B), (__v16sf)_mm512_setzero_ps()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_cvtpd_epi64 (__m512d __A) { return (__m512i) __builtin_ia32_cvtpd2qq512_mask ((__v8df) __A, (__v8di) _mm512_setzero_si512(), (__mmask8) -1, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_cvtpd_epi64 (__m512i __W, __mmask8 __U, __m512d __A) { return (__m512i) __builtin_ia32_cvtpd2qq512_mask ((__v8df) __A, (__v8di) __W, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_cvtpd_epi64 (__mmask8 __U, __m512d __A) { return (__m512i) __builtin_ia32_cvtpd2qq512_mask ((__v8df) __A, (__v8di) _mm512_setzero_si512(), (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm512_cvt_roundpd_epi64(A, R) __extension__ ({ \ (__m512i)__builtin_ia32_cvtpd2qq512_mask((__v8df)(__m512d)(A), \ (__v8di)_mm512_setzero_si512(), \ (__mmask8)-1, (int)(R)); }) #define _mm512_mask_cvt_roundpd_epi64(W, U, A, R) __extension__ ({ \ (__m512i)__builtin_ia32_cvtpd2qq512_mask((__v8df)(__m512d)(A), \ (__v8di)(__m512i)(W), \ (__mmask8)(U), (int)(R)); }) #define _mm512_maskz_cvt_roundpd_epi64(U, A, R) __extension__ ({ \ (__m512i)__builtin_ia32_cvtpd2qq512_mask((__v8df)(__m512d)(A), \ (__v8di)_mm512_setzero_si512(), \ (__mmask8)(U), (int)(R)); }) static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_cvtpd_epu64 (__m512d __A) { return (__m512i) __builtin_ia32_cvtpd2uqq512_mask ((__v8df) __A, (__v8di) _mm512_setzero_si512(), (__mmask8) -1, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_cvtpd_epu64 (__m512i __W, __mmask8 __U, __m512d __A) { return (__m512i) __builtin_ia32_cvtpd2uqq512_mask ((__v8df) __A, (__v8di) __W, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_cvtpd_epu64 (__mmask8 __U, __m512d __A) { return (__m512i) __builtin_ia32_cvtpd2uqq512_mask ((__v8df) __A, (__v8di) _mm512_setzero_si512(), (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm512_cvt_roundpd_epu64(A, R) __extension__ ({ \ (__m512i)__builtin_ia32_cvtpd2uqq512_mask((__v8df)(__m512d)(A), \ (__v8di)_mm512_setzero_si512(), \ (__mmask8)-1, (int)(R)); }) #define _mm512_mask_cvt_roundpd_epu64(W, U, A, R) __extension__ ({ \ (__m512i)__builtin_ia32_cvtpd2uqq512_mask((__v8df)(__m512d)(A), \ (__v8di)(__m512i)(W), \ (__mmask8)(U), (int)(R)); }) #define _mm512_maskz_cvt_roundpd_epu64(U, A, R) __extension__ ({ \ (__m512i)__builtin_ia32_cvtpd2uqq512_mask((__v8df)(__m512d)(A), \ (__v8di)_mm512_setzero_si512(), \ (__mmask8)(U), (int)(R)); }) static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_cvtps_epi64 (__m256 __A) { return (__m512i) __builtin_ia32_cvtps2qq512_mask ((__v8sf) __A, (__v8di) _mm512_setzero_si512(), (__mmask8) -1, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_cvtps_epi64 (__m512i __W, __mmask8 __U, __m256 __A) { return (__m512i) __builtin_ia32_cvtps2qq512_mask ((__v8sf) __A, (__v8di) __W, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_cvtps_epi64 (__mmask8 __U, __m256 __A) { return (__m512i) __builtin_ia32_cvtps2qq512_mask ((__v8sf) __A, (__v8di) _mm512_setzero_si512(), (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm512_cvt_roundps_epi64(A, R) __extension__ ({ \ (__m512i)__builtin_ia32_cvtps2qq512_mask((__v8sf)(__m256)(A), \ (__v8di)_mm512_setzero_si512(), \ (__mmask8)-1, (int)(R)); }) #define _mm512_mask_cvt_roundps_epi64(W, U, A, R) __extension__ ({ \ (__m512i)__builtin_ia32_cvtps2qq512_mask((__v8sf)(__m256)(A), \ (__v8di)(__m512i)(W), \ (__mmask8)(U), (int)(R)); }) #define _mm512_maskz_cvt_roundps_epi64(U, A, R) __extension__ ({ \ (__m512i)__builtin_ia32_cvtps2qq512_mask((__v8sf)(__m256)(A), \ (__v8di)_mm512_setzero_si512(), \ (__mmask8)(U), (int)(R)); }) static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_cvtps_epu64 (__m256 __A) { return (__m512i) __builtin_ia32_cvtps2uqq512_mask ((__v8sf) __A, (__v8di) _mm512_setzero_si512(), (__mmask8) -1, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_cvtps_epu64 (__m512i __W, __mmask8 __U, __m256 __A) { return (__m512i) __builtin_ia32_cvtps2uqq512_mask ((__v8sf) __A, (__v8di) __W, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_cvtps_epu64 (__mmask8 __U, __m256 __A) { return (__m512i) __builtin_ia32_cvtps2uqq512_mask ((__v8sf) __A, (__v8di) _mm512_setzero_si512(), (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm512_cvt_roundps_epu64(A, R) __extension__ ({ \ (__m512i)__builtin_ia32_cvtps2uqq512_mask((__v8sf)(__m256)(A), \ (__v8di)_mm512_setzero_si512(), \ (__mmask8)-1, (int)(R)); }) #define _mm512_mask_cvt_roundps_epu64(W, U, A, R) __extension__ ({ \ (__m512i)__builtin_ia32_cvtps2uqq512_mask((__v8sf)(__m256)(A), \ (__v8di)(__m512i)(W), \ (__mmask8)(U), (int)(R)); }) #define _mm512_maskz_cvt_roundps_epu64(U, A, R) __extension__ ({ \ (__m512i)__builtin_ia32_cvtps2uqq512_mask((__v8sf)(__m256)(A), \ (__v8di)_mm512_setzero_si512(), \ (__mmask8)(U), (int)(R)); }) static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_cvtepi64_pd (__m512i __A) { return (__m512d) __builtin_ia32_cvtqq2pd512_mask ((__v8di) __A, (__v8df) _mm512_setzero_pd(), (__mmask8) -1, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_mask_cvtepi64_pd (__m512d __W, __mmask8 __U, __m512i __A) { return (__m512d) __builtin_ia32_cvtqq2pd512_mask ((__v8di) __A, (__v8df) __W, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_maskz_cvtepi64_pd (__mmask8 __U, __m512i __A) { return (__m512d) __builtin_ia32_cvtqq2pd512_mask ((__v8di) __A, (__v8df) _mm512_setzero_pd(), (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm512_cvt_roundepi64_pd(A, R) __extension__ ({ \ (__m512d)__builtin_ia32_cvtqq2pd512_mask((__v8di)(__m512i)(A), \ (__v8df)_mm512_setzero_pd(), \ (__mmask8)-1, (int)(R)); }) #define _mm512_mask_cvt_roundepi64_pd(W, U, A, R) __extension__ ({ \ (__m512d)__builtin_ia32_cvtqq2pd512_mask((__v8di)(__m512i)(A), \ (__v8df)(__m512d)(W), \ (__mmask8)(U), (int)(R)); }) #define _mm512_maskz_cvt_roundepi64_pd(U, A, R) __extension__ ({ \ (__m512d)__builtin_ia32_cvtqq2pd512_mask((__v8di)(__m512i)(A), \ (__v8df)_mm512_setzero_pd(), \ (__mmask8)(U), (int)(R)); }) static __inline__ __m256 __DEFAULT_FN_ATTRS _mm512_cvtepi64_ps (__m512i __A) { return (__m256) __builtin_ia32_cvtqq2ps512_mask ((__v8di) __A, (__v8sf) _mm256_setzero_ps(), (__mmask8) -1, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm512_mask_cvtepi64_ps (__m256 __W, __mmask8 __U, __m512i __A) { return (__m256) __builtin_ia32_cvtqq2ps512_mask ((__v8di) __A, (__v8sf) __W, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm512_maskz_cvtepi64_ps (__mmask8 __U, __m512i __A) { return (__m256) __builtin_ia32_cvtqq2ps512_mask ((__v8di) __A, (__v8sf) _mm256_setzero_ps(), (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm512_cvt_roundepi64_ps(A, R) __extension__ ({ \ (__m256)__builtin_ia32_cvtqq2ps512_mask((__v8di)(__m512i)(A), \ (__v8sf)_mm256_setzero_ps(), \ (__mmask8)-1, (int)(R)); }) #define _mm512_mask_cvt_roundepi64_ps(W, U, A, R) __extension__ ({ \ (__m256)__builtin_ia32_cvtqq2ps512_mask((__v8di)(__m512i)(A), \ (__v8sf)(__m256)(W), (__mmask8)(U), \ (int)(R)); }) #define _mm512_maskz_cvt_roundepi64_ps(U, A, R) __extension__ ({ \ (__m256)__builtin_ia32_cvtqq2ps512_mask((__v8di)(__m512i)(A), \ (__v8sf)_mm256_setzero_ps(), \ (__mmask8)(U), (int)(R)); }) static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_cvttpd_epi64 (__m512d __A) { return (__m512i) __builtin_ia32_cvttpd2qq512_mask ((__v8df) __A, (__v8di) _mm512_setzero_si512(), (__mmask8) -1, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_cvttpd_epi64 (__m512i __W, __mmask8 __U, __m512d __A) { return (__m512i) __builtin_ia32_cvttpd2qq512_mask ((__v8df) __A, (__v8di) __W, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_cvttpd_epi64 (__mmask8 __U, __m512d __A) { return (__m512i) __builtin_ia32_cvttpd2qq512_mask ((__v8df) __A, (__v8di) _mm512_setzero_si512(), (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm512_cvtt_roundpd_epi64(A, R) __extension__ ({ \ (__m512i)__builtin_ia32_cvttpd2qq512_mask((__v8df)(__m512d)(A), \ (__v8di)_mm512_setzero_si512(), \ (__mmask8)-1, (int)(R)); }) #define _mm512_mask_cvtt_roundpd_epi64(W, U, A, R) __extension__ ({ \ (__m512i)__builtin_ia32_cvttpd2qq512_mask((__v8df)(__m512d)(A), \ (__v8di)(__m512i)(W), \ (__mmask8)(U), (int)(R)); }) #define _mm512_maskz_cvtt_roundpd_epi64(U, A, R) __extension__ ({ \ (__m512i)__builtin_ia32_cvttpd2qq512_mask((__v8df)(__m512d)(A), \ (__v8di)_mm512_setzero_si512(), \ (__mmask8)(U), (int)(R)); }) static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_cvttpd_epu64 (__m512d __A) { return (__m512i) __builtin_ia32_cvttpd2uqq512_mask ((__v8df) __A, (__v8di) _mm512_setzero_si512(), (__mmask8) -1, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_cvttpd_epu64 (__m512i __W, __mmask8 __U, __m512d __A) { return (__m512i) __builtin_ia32_cvttpd2uqq512_mask ((__v8df) __A, (__v8di) __W, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_cvttpd_epu64 (__mmask8 __U, __m512d __A) { return (__m512i) __builtin_ia32_cvttpd2uqq512_mask ((__v8df) __A, (__v8di) _mm512_setzero_si512(), (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm512_cvtt_roundpd_epu64(A, R) __extension__ ({ \ (__m512i)__builtin_ia32_cvttpd2uqq512_mask((__v8df)(__m512d)(A), \ (__v8di)_mm512_setzero_si512(), \ (__mmask8)-1, (int)(R)); }) #define _mm512_mask_cvtt_roundpd_epu64(W, U, A, R) __extension__ ({ \ (__m512i)__builtin_ia32_cvttpd2uqq512_mask((__v8df)(__m512d)(A), \ (__v8di)(__m512i)(W), \ (__mmask8)(U), (int)(R)); }) #define _mm512_maskz_cvtt_roundpd_epu64(U, A, R) __extension__ ({ \ (__m512i)__builtin_ia32_cvttpd2uqq512_mask((__v8df)(__m512d)(A), \ (__v8di)_mm512_setzero_si512(), \ (__mmask8)(U), (int)(R)); }) static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_cvttps_epi64 (__m256 __A) { return (__m512i) __builtin_ia32_cvttps2qq512_mask ((__v8sf) __A, (__v8di) _mm512_setzero_si512(), (__mmask8) -1, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_cvttps_epi64 (__m512i __W, __mmask8 __U, __m256 __A) { return (__m512i) __builtin_ia32_cvttps2qq512_mask ((__v8sf) __A, (__v8di) __W, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_cvttps_epi64 (__mmask8 __U, __m256 __A) { return (__m512i) __builtin_ia32_cvttps2qq512_mask ((__v8sf) __A, (__v8di) _mm512_setzero_si512(), (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm512_cvtt_roundps_epi64(A, R) __extension__ ({ \ (__m512i)__builtin_ia32_cvttps2qq512_mask((__v8sf)(__m256)(A), \ (__v8di)_mm512_setzero_si512(), \ (__mmask8)-1, (int)(R)); }) #define _mm512_mask_cvtt_roundps_epi64(W, U, A, R) __extension__ ({ \ (__m512i)__builtin_ia32_cvttps2qq512_mask((__v8sf)(__m256)(A), \ (__v8di)(__m512i)(W), \ (__mmask8)(U), (int)(R)); }) #define _mm512_maskz_cvtt_roundps_epi64(U, A, R) __extension__ ({ \ (__m512i)__builtin_ia32_cvttps2qq512_mask((__v8sf)(__m256)(A), \ (__v8di)_mm512_setzero_si512(), \ (__mmask8)(U), (int)(R)); }) static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_cvttps_epu64 (__m256 __A) { return (__m512i) __builtin_ia32_cvttps2uqq512_mask ((__v8sf) __A, (__v8di) _mm512_setzero_si512(), (__mmask8) -1, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_cvttps_epu64 (__m512i __W, __mmask8 __U, __m256 __A) { return (__m512i) __builtin_ia32_cvttps2uqq512_mask ((__v8sf) __A, (__v8di) __W, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_cvttps_epu64 (__mmask8 __U, __m256 __A) { return (__m512i) __builtin_ia32_cvttps2uqq512_mask ((__v8sf) __A, (__v8di) _mm512_setzero_si512(), (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm512_cvtt_roundps_epu64(A, R) __extension__ ({ \ (__m512i)__builtin_ia32_cvttps2uqq512_mask((__v8sf)(__m256)(A), \ (__v8di)_mm512_setzero_si512(), \ (__mmask8)-1, (int)(R)); }) #define _mm512_mask_cvtt_roundps_epu64(W, U, A, R) __extension__ ({ \ (__m512i)__builtin_ia32_cvttps2uqq512_mask((__v8sf)(__m256)(A), \ (__v8di)(__m512i)(W), \ (__mmask8)(U), (int)(R)); }) #define _mm512_maskz_cvtt_roundps_epu64(U, A, R) __extension__ ({ \ (__m512i)__builtin_ia32_cvttps2uqq512_mask((__v8sf)(__m256)(A), \ (__v8di)_mm512_setzero_si512(), \ (__mmask8)(U), (int)(R)); }) static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_cvtepu64_pd (__m512i __A) { return (__m512d) __builtin_ia32_cvtuqq2pd512_mask ((__v8di) __A, (__v8df) _mm512_setzero_pd(), (__mmask8) -1, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_mask_cvtepu64_pd (__m512d __W, __mmask8 __U, __m512i __A) { return (__m512d) __builtin_ia32_cvtuqq2pd512_mask ((__v8di) __A, (__v8df) __W, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_maskz_cvtepu64_pd (__mmask8 __U, __m512i __A) { return (__m512d) __builtin_ia32_cvtuqq2pd512_mask ((__v8di) __A, (__v8df) _mm512_setzero_pd(), (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm512_cvt_roundepu64_pd(A, R) __extension__ ({ \ (__m512d)__builtin_ia32_cvtuqq2pd512_mask((__v8di)(__m512i)(A), \ (__v8df)_mm512_setzero_pd(), \ (__mmask8)-1, (int)(R)); }) #define _mm512_mask_cvt_roundepu64_pd(W, U, A, R) __extension__ ({ \ (__m512d)__builtin_ia32_cvtuqq2pd512_mask((__v8di)(__m512i)(A), \ (__v8df)(__m512d)(W), \ (__mmask8)(U), (int)(R)); }) #define _mm512_maskz_cvt_roundepu64_pd(U, A, R) __extension__ ({ \ (__m512d)__builtin_ia32_cvtuqq2pd512_mask((__v8di)(__m512i)(A), \ (__v8df)_mm512_setzero_pd(), \ (__mmask8)(U), (int)(R)); }) static __inline__ __m256 __DEFAULT_FN_ATTRS _mm512_cvtepu64_ps (__m512i __A) { return (__m256) __builtin_ia32_cvtuqq2ps512_mask ((__v8di) __A, (__v8sf) _mm256_setzero_ps(), (__mmask8) -1, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm512_mask_cvtepu64_ps (__m256 __W, __mmask8 __U, __m512i __A) { return (__m256) __builtin_ia32_cvtuqq2ps512_mask ((__v8di) __A, (__v8sf) __W, (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm512_maskz_cvtepu64_ps (__mmask8 __U, __m512i __A) { return (__m256) __builtin_ia32_cvtuqq2ps512_mask ((__v8di) __A, (__v8sf) _mm256_setzero_ps(), (__mmask8) __U, _MM_FROUND_CUR_DIRECTION); } #define _mm512_cvt_roundepu64_ps(A, R) __extension__ ({ \ (__m256)__builtin_ia32_cvtuqq2ps512_mask((__v8di)(__m512i)(A), \ (__v8sf)_mm256_setzero_ps(), \ (__mmask8)-1, (int)(R)); }) #define _mm512_mask_cvt_roundepu64_ps(W, U, A, R) __extension__ ({ \ (__m256)__builtin_ia32_cvtuqq2ps512_mask((__v8di)(__m512i)(A), \ (__v8sf)(__m256)(W), (__mmask8)(U), \ (int)(R)); }) #define _mm512_maskz_cvt_roundepu64_ps(U, A, R) __extension__ ({ \ (__m256)__builtin_ia32_cvtuqq2ps512_mask((__v8di)(__m512i)(A), \ (__v8sf)_mm256_setzero_ps(), \ (__mmask8)(U), (int)(R)); }) #define _mm512_range_pd(A, B, C) __extension__ ({ \ (__m512d)__builtin_ia32_rangepd512_mask((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), (int)(C), \ (__v8df)_mm512_setzero_pd(), \ (__mmask8)-1, \ _MM_FROUND_CUR_DIRECTION); }) #define _mm512_mask_range_pd(W, U, A, B, C) __extension__ ({ \ (__m512d)__builtin_ia32_rangepd512_mask((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), (int)(C), \ (__v8df)(__m512d)(W), (__mmask8)(U), \ _MM_FROUND_CUR_DIRECTION); }) #define _mm512_maskz_range_pd(U, A, B, C) __extension__ ({ \ (__m512d)__builtin_ia32_rangepd512_mask((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), (int)(C), \ (__v8df)_mm512_setzero_pd(), \ (__mmask8)(U), \ _MM_FROUND_CUR_DIRECTION); }) #define _mm512_range_round_pd(A, B, C, R) __extension__ ({ \ (__m512d)__builtin_ia32_rangepd512_mask((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), (int)(C), \ (__v8df)_mm512_setzero_pd(), \ (__mmask8)-1, (int)(R)); }) #define _mm512_mask_range_round_pd(W, U, A, B, C, R) __extension__ ({ \ (__m512d)__builtin_ia32_rangepd512_mask((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), (int)(C), \ (__v8df)(__m512d)(W), (__mmask8)(U), \ (int)(R)); }) #define _mm512_maskz_range_round_pd(U, A, B, C, R) __extension__ ({ \ (__m512d)__builtin_ia32_rangepd512_mask((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), (int)(C), \ (__v8df)_mm512_setzero_pd(), \ (__mmask8)(U), (int)(R)); }) #define _mm512_range_ps(A, B, C) __extension__ ({ \ (__m512)__builtin_ia32_rangeps512_mask((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), (int)(C), \ (__v16sf)_mm512_setzero_ps(), \ (__mmask16)-1, \ _MM_FROUND_CUR_DIRECTION); }) #define _mm512_mask_range_ps(W, U, A, B, C) __extension__ ({ \ (__m512)__builtin_ia32_rangeps512_mask((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), (int)(C), \ (__v16sf)(__m512)(W), (__mmask16)(U), \ _MM_FROUND_CUR_DIRECTION); }) #define _mm512_maskz_range_ps(U, A, B, C) __extension__ ({ \ (__m512)__builtin_ia32_rangeps512_mask((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), (int)(C), \ (__v16sf)_mm512_setzero_ps(), \ (__mmask16)(U), \ _MM_FROUND_CUR_DIRECTION); }) #define _mm512_range_round_ps(A, B, C, R) __extension__ ({ \ (__m512)__builtin_ia32_rangeps512_mask((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), (int)(C), \ (__v16sf)_mm512_setzero_ps(), \ (__mmask16)-1, (int)(R)); }) #define _mm512_mask_range_round_ps(W, U, A, B, C, R) __extension__ ({ \ (__m512)__builtin_ia32_rangeps512_mask((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), (int)(C), \ (__v16sf)(__m512)(W), (__mmask16)(U), \ (int)(R)); }) #define _mm512_maskz_range_round_ps(U, A, B, C, R) __extension__ ({ \ (__m512)__builtin_ia32_rangeps512_mask((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(B), (int)(C), \ (__v16sf)_mm512_setzero_ps(), \ (__mmask16)(U), (int)(R)); }) #define _mm_range_round_ss(A, B, C, R) __extension__ ({ \ (__m128)__builtin_ia32_rangess128_round_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4sf)_mm_setzero_ps(), \ (__mmask8) -1, (int)(C),\ (int)(R)); }) #define _mm_range_ss(A ,B , C) _mm_range_round_ss(A, B, C ,_MM_FROUND_CUR_DIRECTION) #define _mm_mask_range_round_ss(W, U, A, B, C, R) __extension__ ({ \ (__m128)__builtin_ia32_rangess128_round_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4sf)(__m128)(W),\ (__mmask8)(U), (int)(C),\ (int)(R)); }) #define _mm_mask_range_ss(W , U, A, B, C) _mm_mask_range_round_ss(W, U, A, B, C , _MM_FROUND_CUR_DIRECTION) #define _mm_maskz_range_round_ss(U, A, B, C, R) __extension__ ({ \ (__m128)__builtin_ia32_rangess128_round_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4sf)_mm_setzero_ps(), \ (__mmask8)(U), (int)(C),\ (int)(R)); }) #define _mm_maskz_range_ss(U, A ,B , C) _mm_maskz_range_round_ss(U, A, B, C ,_MM_FROUND_CUR_DIRECTION) #define _mm_range_round_sd(A, B, C, R) __extension__ ({ \ (__m128d)__builtin_ia32_rangesd128_round_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)_mm_setzero_pd(), \ (__mmask8) -1, (int)(C),\ (int)(R)); }) #define _mm_range_sd(A ,B , C) _mm_range_round_sd(A, B, C ,_MM_FROUND_CUR_DIRECTION) #define _mm_mask_range_round_sd(W, U, A, B, C, R) __extension__ ({ \ (__m128d)__builtin_ia32_rangesd128_round_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)(__m128d)(W),\ (__mmask8)(U), (int)(C),\ (int)(R)); }) #define _mm_mask_range_sd(W, U, A, B, C) _mm_mask_range_round_sd(W, U, A, B, C ,_MM_FROUND_CUR_DIRECTION) #define _mm_maskz_range_round_sd(U, A, B, C, R) __extension__ ({ \ (__m128d)__builtin_ia32_rangesd128_round_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)_mm_setzero_pd(), \ (__mmask8)(U), (int)(C),\ (int)(R)); }) #define _mm_maskz_range_sd(U, A, B, C) _mm_maskz_range_round_sd(U, A, B, C ,_MM_FROUND_CUR_DIRECTION) #define _mm512_reduce_pd(A, B) __extension__ ({ \ (__m512d)__builtin_ia32_reducepd512_mask((__v8df)(__m512d)(A), (int)(B), \ (__v8df)_mm512_setzero_pd(), \ (__mmask8)-1, \ _MM_FROUND_CUR_DIRECTION); }) #define _mm512_mask_reduce_pd(W, U, A, B) __extension__ ({ \ (__m512d)__builtin_ia32_reducepd512_mask((__v8df)(__m512d)(A), (int)(B), \ (__v8df)(__m512d)(W), \ (__mmask8)(U), \ _MM_FROUND_CUR_DIRECTION); }) #define _mm512_maskz_reduce_pd(U, A, B) __extension__ ({ \ (__m512d)__builtin_ia32_reducepd512_mask((__v8df)(__m512d)(A), (int)(B), \ (__v8df)_mm512_setzero_pd(), \ (__mmask8)(U), \ _MM_FROUND_CUR_DIRECTION); }) #define _mm512_reduce_ps(A, B) __extension__ ({ \ (__m512)__builtin_ia32_reduceps512_mask((__v16sf)(__m512)(A), (int)(B), \ (__v16sf)_mm512_setzero_ps(), \ (__mmask16)-1, \ _MM_FROUND_CUR_DIRECTION); }) #define _mm512_mask_reduce_ps(W, U, A, B) __extension__ ({ \ (__m512)__builtin_ia32_reduceps512_mask((__v16sf)(__m512)(A), (int)(B), \ (__v16sf)(__m512)(W), \ (__mmask16)(U), \ _MM_FROUND_CUR_DIRECTION); }) #define _mm512_maskz_reduce_ps(U, A, B) __extension__ ({ \ (__m512)__builtin_ia32_reduceps512_mask((__v16sf)(__m512)(A), (int)(B), \ (__v16sf)_mm512_setzero_ps(), \ (__mmask16)(U), \ _MM_FROUND_CUR_DIRECTION); }) #define _mm512_reduce_round_pd(A, B, R) __extension__ ({\ (__m512d)__builtin_ia32_reducepd512_mask((__v8df)(__m512d)(A), (int)(B), \ (__v8df)_mm512_setzero_pd(), \ (__mmask8)-1, (int)(R)); }) #define _mm512_mask_reduce_round_pd(W, U, A, B, R) __extension__ ({\ (__m512d)__builtin_ia32_reducepd512_mask((__v8df)(__m512d)(A), (int)(B), \ (__v8df)(__m512d)(W), \ (__mmask8)(U), (int)(R)); }) #define _mm512_maskz_reduce_round_pd(U, A, B, R) __extension__ ({\ (__m512d)__builtin_ia32_reducepd512_mask((__v8df)(__m512d)(A), (int)(B), \ (__v8df)_mm512_setzero_pd(), \ (__mmask8)(U), (int)(R)); }) #define _mm512_reduce_round_ps(A, B, R) __extension__ ({\ (__m512)__builtin_ia32_reduceps512_mask((__v16sf)(__m512)(A), (int)(B), \ (__v16sf)_mm512_setzero_ps(), \ (__mmask16)-1, (int)(R)); }) #define _mm512_mask_reduce_round_ps(W, U, A, B, R) __extension__ ({\ (__m512)__builtin_ia32_reduceps512_mask((__v16sf)(__m512)(A), (int)(B), \ (__v16sf)(__m512)(W), \ (__mmask16)(U), (int)(R)); }) #define _mm512_maskz_reduce_round_ps(U, A, B, R) __extension__ ({\ (__m512)__builtin_ia32_reduceps512_mask((__v16sf)(__m512)(A), (int)(B), \ (__v16sf)_mm512_setzero_ps(), \ (__mmask16)(U), (int)(R)); }) #define _mm_reduce_ss(A, B, C) __extension__ ({ \ (__m128)__builtin_ia32_reducess_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4sf)_mm_setzero_ps(), (__mmask8)-1, \ (int)(C), _MM_FROUND_CUR_DIRECTION); }) #define _mm_mask_reduce_ss(W, U, A, B, C) __extension__ ({ \ (__m128)__builtin_ia32_reducess_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4sf)(__m128)(W), (__mmask8)(U), \ (int)(C), _MM_FROUND_CUR_DIRECTION); }) #define _mm_maskz_reduce_ss(U, A, B, C) __extension__ ({ \ (__m128)__builtin_ia32_reducess_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4sf)_mm_setzero_ps(), \ (__mmask8)(U), (int)(C), \ _MM_FROUND_CUR_DIRECTION); }) #define _mm_reduce_round_ss(A, B, C, R) __extension__ ({ \ (__m128)__builtin_ia32_reducess_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4sf)_mm_setzero_ps(), (__mmask8)-1, \ (int)(C), (int)(R)); }) #define _mm_mask_reduce_round_ss(W, U, A, B, C, R) __extension__ ({ \ (__m128)__builtin_ia32_reducess_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4sf)(__m128)(W), (__mmask8)(U), \ (int)(C), (int)(R)); }) #define _mm_maskz_reduce_round_ss(U, A, B, C, R) __extension__ ({ \ (__m128)__builtin_ia32_reducess_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4sf)_mm_setzero_ps(), \ (__mmask8)(U), (int)(C), (int)(R)); }) #define _mm_reduce_sd(A, B, C) __extension__ ({ \ (__m128d)__builtin_ia32_reducesd_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)_mm_setzero_pd(), \ (__mmask8)-1, (int)(C), \ _MM_FROUND_CUR_DIRECTION); }) #define _mm_mask_reduce_sd(W, U, A, B, C) __extension__ ({ \ (__m128d)__builtin_ia32_reducesd_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)(__m128d)(W), (__mmask8)(U), \ (int)(C), _MM_FROUND_CUR_DIRECTION); }) #define _mm_maskz_reduce_sd(U, A, B, C) __extension__ ({ \ (__m128d)__builtin_ia32_reducesd_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)_mm_setzero_pd(), \ (__mmask8)(U), (int)(C), \ _MM_FROUND_CUR_DIRECTION); }) #define _mm_reduce_round_sd(A, B, C, R) __extension__ ({ \ (__m128d)__builtin_ia32_reducesd_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)_mm_setzero_pd(), \ (__mmask8)-1, (int)(C), (int)(R)); }) #define _mm_mask_reduce_round_sd(W, U, A, B, C, R) __extension__ ({ \ (__m128d)__builtin_ia32_reducesd_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)(__m128d)(W), (__mmask8)(U), \ (int)(C), (int)(R)); }) #define _mm_maskz_reduce_round_sd(U, A, B, C, R) __extension__ ({ \ (__m128d)__builtin_ia32_reducesd_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)_mm_setzero_pd(), \ (__mmask8)(U), (int)(C), (int)(R)); }) static __inline__ __mmask16 __DEFAULT_FN_ATTRS _mm512_movepi32_mask (__m512i __A) { return (__mmask16) __builtin_ia32_cvtd2mask512 ((__v16si) __A); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_movm_epi32 (__mmask16 __A) { return (__m512i) __builtin_ia32_cvtmask2d512 (__A); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_movm_epi64 (__mmask8 __A) { return (__m512i) __builtin_ia32_cvtmask2q512 (__A); } static __inline__ __mmask8 __DEFAULT_FN_ATTRS _mm512_movepi64_mask (__m512i __A) { return (__mmask8) __builtin_ia32_cvtq2mask512 ((__v8di) __A); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_broadcast_f32x2 (__m128 __A) { return (__m512)__builtin_shufflevector((__v4sf)__A, (__v4sf)_mm_undefined_ps(), 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_mask_broadcast_f32x2 (__m512 __O, __mmask16 __M, __m128 __A) { return (__m512)__builtin_ia32_selectps_512((__mmask16)__M, (__v16sf)_mm512_broadcast_f32x2(__A), (__v16sf)__O); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_maskz_broadcast_f32x2 (__mmask16 __M, __m128 __A) { return (__m512)__builtin_ia32_selectps_512((__mmask16)__M, (__v16sf)_mm512_broadcast_f32x2(__A), (__v16sf)_mm512_setzero_ps()); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_broadcast_f32x8(__m256 __A) { return (__m512)__builtin_shufflevector((__v8sf)__A, (__v8sf)__A, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_mask_broadcast_f32x8(__m512 __O, __mmask16 __M, __m256 __A) { return (__m512)__builtin_ia32_selectps_512((__mmask8)__M, (__v16sf)_mm512_broadcast_f32x8(__A), (__v16sf)__O); } static __inline__ __m512 __DEFAULT_FN_ATTRS _mm512_maskz_broadcast_f32x8(__mmask16 __M, __m256 __A) { return (__m512)__builtin_ia32_selectps_512((__mmask8)__M, (__v16sf)_mm512_broadcast_f32x8(__A), (__v16sf)_mm512_setzero_ps()); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_broadcast_f64x2(__m128d __A) { return (__m512d)__builtin_shufflevector((__v2df)__A, (__v2df)__A, 0, 1, 0, 1, 0, 1, 0, 1); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_mask_broadcast_f64x2(__m512d __O, __mmask8 __M, __m128d __A) { return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__M, (__v8df)_mm512_broadcast_f64x2(__A), (__v8df)__O); } static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_maskz_broadcast_f64x2(__mmask8 __M, __m128d __A) { return (__m512d)__builtin_ia32_selectpd_512((__mmask8)__M, (__v8df)_mm512_broadcast_f64x2(__A), (__v8df)_mm512_setzero_pd()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_broadcast_i32x2 (__m128i __A) { return (__m512i)__builtin_shufflevector((__v4si)__A, (__v4si)_mm_undefined_si128(), 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_broadcast_i32x2 (__m512i __O, __mmask16 __M, __m128i __A) { return (__m512i)__builtin_ia32_selectd_512((__mmask16)__M, (__v16si)_mm512_broadcast_i32x2(__A), (__v16si)__O); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_broadcast_i32x2 (__mmask16 __M, __m128i __A) { return (__m512i)__builtin_ia32_selectd_512((__mmask16)__M, (__v16si)_mm512_broadcast_i32x2(__A), (__v16si)_mm512_setzero_si512()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_broadcast_i32x8(__m256i __A) { return (__m512i)__builtin_shufflevector((__v8si)__A, (__v8si)__A, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_broadcast_i32x8(__m512i __O, __mmask16 __M, __m256i __A) { return (__m512i)__builtin_ia32_selectd_512((__mmask8)__M, (__v16si)_mm512_broadcast_i32x8(__A), (__v16si)__O); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_broadcast_i32x8(__mmask16 __M, __m256i __A) { return (__m512i)__builtin_ia32_selectd_512((__mmask8)__M, (__v16si)_mm512_broadcast_i32x8(__A), (__v16si)_mm512_setzero_si512()); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_broadcast_i64x2(__m128i __A) { return (__m512i)__builtin_shufflevector((__v2di)__A, (__v2di)__A, 0, 1, 0, 1, 0, 1, 0, 1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_broadcast_i64x2(__m512i __O, __mmask8 __M, __m128i __A) { return (__m512i)__builtin_ia32_selectq_512((__mmask8)__M, (__v8di)_mm512_broadcast_i64x2(__A), (__v8di)__O); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_broadcast_i64x2(__mmask8 __M, __m128i __A) { return (__m512i)__builtin_ia32_selectq_512((__mmask8)__M, (__v8di)_mm512_broadcast_i64x2(__A), (__v8di)_mm512_setzero_si512()); } #define _mm512_extractf32x8_ps(A, imm) __extension__ ({ \ (__m256)__builtin_shufflevector((__v16sf)(__m512)(A), \ (__v16sf)_mm512_undefined_ps(), \ ((imm) & 1) ? 8 : 0, \ ((imm) & 1) ? 9 : 1, \ ((imm) & 1) ? 10 : 2, \ ((imm) & 1) ? 11 : 3, \ ((imm) & 1) ? 12 : 4, \ ((imm) & 1) ? 13 : 5, \ ((imm) & 1) ? 14 : 6, \ ((imm) & 1) ? 15 : 7); }) #define _mm512_mask_extractf32x8_ps(W, U, A, imm) __extension__ ({ \ (__m256)__builtin_ia32_selectps_256((__mmask8)(U), \ (__v8sf)_mm512_extractf32x8_ps((A), (imm)), \ (__v8sf)(W)); }) #define _mm512_maskz_extractf32x8_ps(U, A, imm) __extension__ ({ \ (__m256)__builtin_ia32_selectps_256((__mmask8)(U), \ (__v8sf)_mm512_extractf32x8_ps((A), (imm)), \ (__v8sf)_mm256_setzero_ps()); }) #define _mm512_extractf64x2_pd(A, imm) __extension__ ({ \ (__m128d)__builtin_shufflevector((__v8df)(__m512d)(A), \ (__v8df)_mm512_undefined_pd(), \ 0 + ((imm) & 0x3) * 2, \ 1 + ((imm) & 0x3) * 2); }) #define _mm512_mask_extractf64x2_pd(W, U, A, imm) __extension__ ({ \ (__m128d)__builtin_ia32_selectpd_128((__mmask8)(U), \ (__v2df)_mm512_extractf64x2_pd((A), (imm)), \ (__v2df)(W)); }) #define _mm512_maskz_extractf64x2_pd(U, A, imm) __extension__ ({ \ (__m128d)__builtin_ia32_selectpd_128((__mmask8)(U), \ (__v2df)_mm512_extractf64x2_pd((A), (imm)), \ (__v2df)_mm_setzero_pd()); }) #define _mm512_extracti32x8_epi32(A, imm) __extension__ ({ \ (__m256i)__builtin_shufflevector((__v16si)(__m512i)(A), \ (__v16si)_mm512_undefined_epi32(), \ ((imm) & 1) ? 8 : 0, \ ((imm) & 1) ? 9 : 1, \ ((imm) & 1) ? 10 : 2, \ ((imm) & 1) ? 11 : 3, \ ((imm) & 1) ? 12 : 4, \ ((imm) & 1) ? 13 : 5, \ ((imm) & 1) ? 14 : 6, \ ((imm) & 1) ? 15 : 7); }) #define _mm512_mask_extracti32x8_epi32(W, U, A, imm) __extension__ ({ \ (__m256i)__builtin_ia32_selectd_256((__mmask8)(U), \ (__v8si)_mm512_extracti32x8_epi32((A), (imm)), \ (__v8si)(W)); }) #define _mm512_maskz_extracti32x8_epi32(U, A, imm) __extension__ ({ \ (__m256i)__builtin_ia32_selectd_256((__mmask8)(U), \ (__v8si)_mm512_extracti32x8_epi32((A), (imm)), \ (__v8si)_mm256_setzero_si256()); }) #define _mm512_extracti64x2_epi64(A, imm) __extension__ ({ \ (__m128i)__builtin_shufflevector((__v8di)(__m512i)(A), \ (__v8di)_mm512_undefined_epi32(), \ 0 + ((imm) & 0x3) * 2, \ 1 + ((imm) & 0x3) * 2); }) #define _mm512_mask_extracti64x2_epi64(W, U, A, imm) __extension__ ({ \ (__m128d)__builtin_ia32_selectq_128((__mmask8)(U), \ (__v2di)_mm512_extracti64x2_epi64((A), (imm)), \ (__v2di)(W)); }) #define _mm512_maskz_extracti64x2_epi64(U, A, imm) __extension__ ({ \ (__m128d)__builtin_ia32_selectq_128((__mmask8)(U), \ (__v2di)_mm512_extracti64x2_epi64((A), (imm)), \ (__v2di)_mm_setzero_di()); }) #define _mm512_insertf32x8(A, B, imm) __extension__ ({ \ (__m512)__builtin_shufflevector((__v16sf)(__m512)(A), \ (__v16sf)_mm512_castps256_ps512((__m256)(B)),\ ((imm) & 0x1) ? 0 : 16, \ ((imm) & 0x1) ? 1 : 17, \ ((imm) & 0x1) ? 2 : 18, \ ((imm) & 0x1) ? 3 : 19, \ ((imm) & 0x1) ? 4 : 20, \ ((imm) & 0x1) ? 5 : 21, \ ((imm) & 0x1) ? 6 : 22, \ ((imm) & 0x1) ? 7 : 23, \ ((imm) & 0x1) ? 16 : 8, \ ((imm) & 0x1) ? 17 : 9, \ ((imm) & 0x1) ? 18 : 10, \ ((imm) & 0x1) ? 19 : 11, \ ((imm) & 0x1) ? 20 : 12, \ ((imm) & 0x1) ? 21 : 13, \ ((imm) & 0x1) ? 22 : 14, \ ((imm) & 0x1) ? 23 : 15); }) #define _mm512_mask_insertf32x8(W, U, A, B, imm) __extension__ ({ \ (__m512)__builtin_ia32_selectps_512((__mmask16)(U), \ (__v16sf)_mm512_insertf32x8((A), (B), (imm)), \ (__v16sf)(W)); }) #define _mm512_maskz_insertf32x8(U, A, B, imm) __extension__ ({ \ (__m512)__builtin_ia32_selectps_512((__mmask16)(U), \ (__v16sf)_mm512_insertf32x8((A), (B), (imm)), \ (__v16sf)_mm512_setzero_ps()); }) #define _mm512_insertf64x2(A, B, imm) __extension__ ({ \ (__m512d)__builtin_shufflevector((__v8df)(__m512d)(A), \ (__v8df)_mm512_castpd128_pd512((__m128d)(B)),\ (((imm) & 0x3) == 0) ? 8 : 0, \ (((imm) & 0x3) == 0) ? 9 : 1, \ (((imm) & 0x3) == 1) ? 8 : 2, \ (((imm) & 0x3) == 1) ? 9 : 3, \ (((imm) & 0x3) == 2) ? 8 : 4, \ (((imm) & 0x3) == 2) ? 9 : 5, \ (((imm) & 0x3) == 3) ? 8 : 6, \ (((imm) & 0x3) == 3) ? 9 : 7); }) #define _mm512_mask_insertf64x2(W, U, A, B, imm) __extension__ ({ \ (__m512d)__builtin_ia32_selectpd_512((__mmask8)(U), \ (__v8df)_mm512_insertf64x2((A), (B), (imm)), \ (__v8df)(W)); }) #define _mm512_maskz_insertf64x2(U, A, B, imm) __extension__ ({ \ (__m512d)__builtin_ia32_selectpd_512((__mmask8)(U), \ (__v8df)_mm512_insertf64x2((A), (B), (imm)), \ (__v8df)_mm512_setzero_pd()); }) #define _mm512_inserti32x8(A, B, imm) __extension__ ({ \ (__m512i)__builtin_shufflevector((__v16si)(__m512i)(A), \ (__v16si)_mm512_castsi256_si512((__m256i)(B)),\ ((imm) & 0x1) ? 0 : 16, \ ((imm) & 0x1) ? 1 : 17, \ ((imm) & 0x1) ? 2 : 18, \ ((imm) & 0x1) ? 3 : 19, \ ((imm) & 0x1) ? 4 : 20, \ ((imm) & 0x1) ? 5 : 21, \ ((imm) & 0x1) ? 6 : 22, \ ((imm) & 0x1) ? 7 : 23, \ ((imm) & 0x1) ? 16 : 8, \ ((imm) & 0x1) ? 17 : 9, \ ((imm) & 0x1) ? 18 : 10, \ ((imm) & 0x1) ? 19 : 11, \ ((imm) & 0x1) ? 20 : 12, \ ((imm) & 0x1) ? 21 : 13, \ ((imm) & 0x1) ? 22 : 14, \ ((imm) & 0x1) ? 23 : 15); }) #define _mm512_mask_inserti32x8(W, U, A, B, imm) __extension__ ({ \ (__m512i)__builtin_ia32_selectd_512((__mmask16)(U), \ (__v16si)_mm512_inserti32x8((A), (B), (imm)), \ (__v16si)(W)); }) #define _mm512_maskz_inserti32x8(U, A, B, imm) __extension__ ({ \ (__m512i)__builtin_ia32_selectd_512((__mmask16)(U), \ (__v16si)_mm512_inserti32x8((A), (B), (imm)), \ (__v16si)_mm512_setzero_si512()); }) #define _mm512_inserti64x2(A, B, imm) __extension__ ({ \ (__m512i)__builtin_shufflevector((__v8di)(__m512i)(A), \ (__v8di)_mm512_castsi128_si512((__m128i)(B)),\ (((imm) & 0x3) == 0) ? 8 : 0, \ (((imm) & 0x3) == 0) ? 9 : 1, \ (((imm) & 0x3) == 1) ? 8 : 2, \ (((imm) & 0x3) == 1) ? 9 : 3, \ (((imm) & 0x3) == 2) ? 8 : 4, \ (((imm) & 0x3) == 2) ? 9 : 5, \ (((imm) & 0x3) == 3) ? 8 : 6, \ (((imm) & 0x3) == 3) ? 9 : 7); }) #define _mm512_mask_inserti64x2(W, U, A, B, imm) __extension__ ({ \ (__m512i)__builtin_ia32_selectq_512((__mmask8)(U), \ (__v8di)_mm512_inserti64x2((A), (B), (imm)), \ (__v8di)(W)); }) #define _mm512_maskz_inserti64x2(U, A, B, imm) __extension__ ({ \ (__m512i)__builtin_ia32_selectq_512((__mmask8)(U), \ (__v8di)_mm512_inserti64x2((A), (B), (imm)), \ (__v8di)_mm512_setzero_si512()); }) #define _mm512_mask_fpclass_ps_mask(U, A, imm) __extension__ ({ \ (__mmask16)__builtin_ia32_fpclassps512_mask((__v16sf)(__m512)(A), \ (int)(imm), (__mmask16)(U)); }) #define _mm512_fpclass_ps_mask(A, imm) __extension__ ({ \ (__mmask16)__builtin_ia32_fpclassps512_mask((__v16sf)(__m512)(A), \ (int)(imm), (__mmask16)-1); }) #define _mm512_mask_fpclass_pd_mask(U, A, imm) __extension__ ({ \ (__mmask8)__builtin_ia32_fpclasspd512_mask((__v8df)(__m512d)(A), (int)(imm), \ (__mmask8)(U)); }) #define _mm512_fpclass_pd_mask(A, imm) __extension__ ({ \ (__mmask8)__builtin_ia32_fpclasspd512_mask((__v8df)(__m512d)(A), (int)(imm), \ (__mmask8)-1); }) #define _mm_fpclass_sd_mask(A, imm) __extension__ ({ \ (__mmask8)__builtin_ia32_fpclasssd_mask((__v2df)(__m128d)(A), (int)(imm), \ (__mmask8)-1); }) #define _mm_mask_fpclass_sd_mask(U, A, imm) __extension__ ({ \ (__mmask8)__builtin_ia32_fpclasssd_mask((__v2df)(__m128d)(A), (int)(imm), \ (__mmask8)(U)); }) #define _mm_fpclass_ss_mask(A, imm) __extension__ ({ \ (__mmask8)__builtin_ia32_fpclassss_mask((__v4sf)(__m128)(A), (int)(imm), \ (__mmask8)-1); }) #define _mm_mask_fpclass_ss_mask(U, A, imm) __extension__ ({ \ (__mmask8)__builtin_ia32_fpclassss_mask((__v4sf)(__m128)(A), (int)(imm), \ (__mmask8)(U)); }) #undef __DEFAULT_FN_ATTRS #endif # 1332 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512dqintrin.h" 3 # 181 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 2 3 #endif # 182 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || \ (defined(__AVX512VL__) && defined(__AVX512BITALG__)) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 185 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512vlbitalgintrin.h" 1 3 /*===------------- avx512vlbitalgintrin.h - BITALG intrinsics ------------------=== * * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __IMMINTRIN_H #error "Never use directly; include instead." #endif # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512vlbitalgintrin.h" 3 #ifndef __AVX512VLBITALGINTRIN_H #define __AVX512VLBITALGINTRIN_H /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("avx512vl,avx512bitalg"))) static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_popcnt_epi16(__m256i __A) { return (__m256i) __builtin_ia32_vpopcntw_256((__v16hi) __A); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_popcnt_epi16(__m256i __A, __mmask16 __U, __m256i __B) { return (__m256i) __builtin_ia32_selectw_256((__mmask16) __U, (__v16hi) _mm256_popcnt_epi16(__B), (__v16hi) __A); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_popcnt_epi16(__mmask16 __U, __m256i __B) { return _mm256_mask_popcnt_epi16((__m256i) _mm256_setzero_si256(), __U, __B); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm128_popcnt_epi16(__m128i __A) { return (__m128i) __builtin_ia32_vpopcntw_128((__v8hi) __A); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm128_mask_popcnt_epi16(__m128i __A, __mmask8 __U, __m128i __B) { return (__m128i) __builtin_ia32_selectw_128((__mmask8) __U, (__v8hi) _mm128_popcnt_epi16(__B), (__v8hi) __A); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm128_maskz_popcnt_epi16(__mmask8 __U, __m128i __B) { return _mm128_mask_popcnt_epi16((__m128i) _mm_setzero_si128(), __U, __B); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_popcnt_epi8(__m256i __A) { return (__m256i) __builtin_ia32_vpopcntb_256((__v32qi) __A); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_popcnt_epi8(__m256i __A, __mmask32 __U, __m256i __B) { return (__m256i) __builtin_ia32_selectb_256((__mmask32) __U, (__v32qi) _mm256_popcnt_epi8(__B), (__v32qi) __A); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_popcnt_epi8(__mmask32 __U, __m256i __B) { return _mm256_mask_popcnt_epi8((__m256i) _mm256_setzero_si256(), __U, __B); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm128_popcnt_epi8(__m128i __A) { return (__m128i) __builtin_ia32_vpopcntb_128((__v16qi) __A); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm128_mask_popcnt_epi8(__m128i __A, __mmask16 __U, __m128i __B) { return (__m128i) __builtin_ia32_selectb_128((__mmask16) __U, (__v16qi) _mm128_popcnt_epi8(__B), (__v16qi) __A); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm128_maskz_popcnt_epi8(__mmask16 __U, __m128i __B) { return _mm128_mask_popcnt_epi8((__m128i) _mm_setzero_si128(), __U, __B); } static __inline__ __mmask32 __DEFAULT_FN_ATTRS _mm256_mask_bitshuffle_epi32_mask(__mmask32 __U, __m256i __A, __m256i __B) { return (__mmask32) __builtin_ia32_vpshufbitqmb256_mask((__v32qi) __A, (__v32qi) __B, __U); } static __inline__ __mmask32 __DEFAULT_FN_ATTRS _mm256_bitshuffle_epi32_mask(__m256i __A, __m256i __B) { return _mm256_mask_bitshuffle_epi32_mask((__mmask32) -1, __A, __B); } static __inline__ __mmask16 __DEFAULT_FN_ATTRS _mm128_mask_bitshuffle_epi16_mask(__mmask16 __U, __m128i __A, __m128i __B) { return (__mmask16) __builtin_ia32_vpshufbitqmb128_mask((__v16qi) __A, (__v16qi) __B, __U); } static __inline__ __mmask16 __DEFAULT_FN_ATTRS _mm128_bitshuffle_epi16_mask(__m128i __A, __m128i __B) { return _mm128_mask_bitshuffle_epi16_mask((__mmask16) -1, __A, __B); } #undef __DEFAULT_FN_ATTRS #endif # 158 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512vlbitalgintrin.h" 3 # 186 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 2 3 #endif # 187 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || \ (defined(__AVX512VL__) && defined(__AVX512BW__)) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 190 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512vlbwintrin.h" 1 3 /*===---- avx512vlbwintrin.h - AVX512VL and AVX512BW intrinsics ------------=== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __IMMINTRIN_H #error "Never use directly; include instead." #endif # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512vlbwintrin.h" 3 #ifndef __AVX512VLBWINTRIN_H #define __AVX512VLBWINTRIN_H /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("avx512vl,avx512bw"))) static __inline __m128i __DEFAULT_FN_ATTRS _mm_setzero_hi(void){ return (__m128i)(__v8hi){ 0, 0, 0, 0, 0, 0, 0, 0 }; } /* Integer compare */ #define _mm_cmp_epi8_mask(a, b, p) __extension__ ({ \ (__mmask16)__builtin_ia32_cmpb128_mask((__v16qi)(__m128i)(a), \ (__v16qi)(__m128i)(b), (int)(p), \ (__mmask16)-1); }) #define _mm_mask_cmp_epi8_mask(m, a, b, p) __extension__ ({ \ (__mmask16)__builtin_ia32_cmpb128_mask((__v16qi)(__m128i)(a), \ (__v16qi)(__m128i)(b), (int)(p), \ (__mmask16)(m)); }) #define _mm_cmp_epu8_mask(a, b, p) __extension__ ({ \ (__mmask16)__builtin_ia32_ucmpb128_mask((__v16qi)(__m128i)(a), \ (__v16qi)(__m128i)(b), (int)(p), \ (__mmask16)-1); }) #define _mm_mask_cmp_epu8_mask(m, a, b, p) __extension__ ({ \ (__mmask16)__builtin_ia32_ucmpb128_mask((__v16qi)(__m128i)(a), \ (__v16qi)(__m128i)(b), (int)(p), \ (__mmask16)(m)); }) #define _mm256_cmp_epi8_mask(a, b, p) __extension__ ({ \ (__mmask32)__builtin_ia32_cmpb256_mask((__v32qi)(__m256i)(a), \ (__v32qi)(__m256i)(b), (int)(p), \ (__mmask32)-1); }) #define _mm256_mask_cmp_epi8_mask(m, a, b, p) __extension__ ({ \ (__mmask32)__builtin_ia32_cmpb256_mask((__v32qi)(__m256i)(a), \ (__v32qi)(__m256i)(b), (int)(p), \ (__mmask32)(m)); }) #define _mm256_cmp_epu8_mask(a, b, p) __extension__ ({ \ (__mmask32)__builtin_ia32_ucmpb256_mask((__v32qi)(__m256i)(a), \ (__v32qi)(__m256i)(b), (int)(p), \ (__mmask32)-1); }) #define _mm256_mask_cmp_epu8_mask(m, a, b, p) __extension__ ({ \ (__mmask32)__builtin_ia32_ucmpb256_mask((__v32qi)(__m256i)(a), \ (__v32qi)(__m256i)(b), (int)(p), \ (__mmask32)(m)); }) #define _mm_cmp_epi16_mask(a, b, p) __extension__ ({ \ (__mmask8)__builtin_ia32_cmpw128_mask((__v8hi)(__m128i)(a), \ (__v8hi)(__m128i)(b), (int)(p), \ (__mmask8)-1); }) #define _mm_mask_cmp_epi16_mask(m, a, b, p) __extension__ ({ \ (__mmask8)__builtin_ia32_cmpw128_mask((__v8hi)(__m128i)(a), \ (__v8hi)(__m128i)(b), (int)(p), \ (__mmask8)(m)); }) #define _mm_cmp_epu16_mask(a, b, p) __extension__ ({ \ (__mmask8)__builtin_ia32_ucmpw128_mask((__v8hi)(__m128i)(a), \ (__v8hi)(__m128i)(b), (int)(p), \ (__mmask8)-1); }) #define _mm_mask_cmp_epu16_mask(m, a, b, p) __extension__ ({ \ (__mmask8)__builtin_ia32_ucmpw128_mask((__v8hi)(__m128i)(a), \ (__v8hi)(__m128i)(b), (int)(p), \ (__mmask8)(m)); }) #define _mm256_cmp_epi16_mask(a, b, p) __extension__ ({ \ (__mmask16)__builtin_ia32_cmpw256_mask((__v16hi)(__m256i)(a), \ (__v16hi)(__m256i)(b), (int)(p), \ (__mmask16)-1); }) #define _mm256_mask_cmp_epi16_mask(m, a, b, p) __extension__ ({ \ (__mmask16)__builtin_ia32_cmpw256_mask((__v16hi)(__m256i)(a), \ (__v16hi)(__m256i)(b), (int)(p), \ (__mmask16)(m)); }) #define _mm256_cmp_epu16_mask(a, b, p) __extension__ ({ \ (__mmask16)__builtin_ia32_ucmpw256_mask((__v16hi)(__m256i)(a), \ (__v16hi)(__m256i)(b), (int)(p), \ (__mmask16)-1); }) #define _mm256_mask_cmp_epu16_mask(m, a, b, p) __extension__ ({ \ (__mmask16)__builtin_ia32_ucmpw256_mask((__v16hi)(__m256i)(a), \ (__v16hi)(__m256i)(b), (int)(p), \ (__mmask16)(m)); }) #define _mm_cmpeq_epi8_mask(A, B) \ _mm_cmp_epi8_mask((A), (B), _MM_CMPINT_EQ) #define _mm_mask_cmpeq_epi8_mask(k, A, B) \ _mm_mask_cmp_epi8_mask((k), (A), (B), _MM_CMPINT_EQ) #define _mm_cmpge_epi8_mask(A, B) \ _mm_cmp_epi8_mask((A), (B), _MM_CMPINT_GE) #define _mm_mask_cmpge_epi8_mask(k, A, B) \ _mm_mask_cmp_epi8_mask((k), (A), (B), _MM_CMPINT_GE) #define _mm_cmpgt_epi8_mask(A, B) \ _mm_cmp_epi8_mask((A), (B), _MM_CMPINT_GT) #define _mm_mask_cmpgt_epi8_mask(k, A, B) \ _mm_mask_cmp_epi8_mask((k), (A), (B), _MM_CMPINT_GT) #define _mm_cmple_epi8_mask(A, B) \ _mm_cmp_epi8_mask((A), (B), _MM_CMPINT_LE) #define _mm_mask_cmple_epi8_mask(k, A, B) \ _mm_mask_cmp_epi8_mask((k), (A), (B), _MM_CMPINT_LE) #define _mm_cmplt_epi8_mask(A, B) \ _mm_cmp_epi8_mask((A), (B), _MM_CMPINT_LT) #define _mm_mask_cmplt_epi8_mask(k, A, B) \ _mm_mask_cmp_epi8_mask((k), (A), (B), _MM_CMPINT_LT) #define _mm_cmpneq_epi8_mask(A, B) \ _mm_cmp_epi8_mask((A), (B), _MM_CMPINT_NE) #define _mm_mask_cmpneq_epi8_mask(k, A, B) \ _mm_mask_cmp_epi8_mask((k), (A), (B), _MM_CMPINT_NE) #define _mm256_cmpeq_epi8_mask(A, B) \ _mm256_cmp_epi8_mask((A), (B), _MM_CMPINT_EQ) #define _mm256_mask_cmpeq_epi8_mask(k, A, B) \ _mm256_mask_cmp_epi8_mask((k), (A), (B), _MM_CMPINT_EQ) #define _mm256_cmpge_epi8_mask(A, B) \ _mm256_cmp_epi8_mask((A), (B), _MM_CMPINT_GE) #define _mm256_mask_cmpge_epi8_mask(k, A, B) \ _mm256_mask_cmp_epi8_mask((k), (A), (B), _MM_CMPINT_GE) #define _mm256_cmpgt_epi8_mask(A, B) \ _mm256_cmp_epi8_mask((A), (B), _MM_CMPINT_GT) #define _mm256_mask_cmpgt_epi8_mask(k, A, B) \ _mm256_mask_cmp_epi8_mask((k), (A), (B), _MM_CMPINT_GT) #define _mm256_cmple_epi8_mask(A, B) \ _mm256_cmp_epi8_mask((A), (B), _MM_CMPINT_LE) #define _mm256_mask_cmple_epi8_mask(k, A, B) \ _mm256_mask_cmp_epi8_mask((k), (A), (B), _MM_CMPINT_LE) #define _mm256_cmplt_epi8_mask(A, B) \ _mm256_cmp_epi8_mask((A), (B), _MM_CMPINT_LT) #define _mm256_mask_cmplt_epi8_mask(k, A, B) \ _mm256_mask_cmp_epi8_mask((k), (A), (B), _MM_CMPINT_LT) #define _mm256_cmpneq_epi8_mask(A, B) \ _mm256_cmp_epi8_mask((A), (B), _MM_CMPINT_NE) #define _mm256_mask_cmpneq_epi8_mask(k, A, B) \ _mm256_mask_cmp_epi8_mask((k), (A), (B), _MM_CMPINT_NE) #define _mm_cmpeq_epu8_mask(A, B) \ _mm_cmp_epu8_mask((A), (B), _MM_CMPINT_EQ) #define _mm_mask_cmpeq_epu8_mask(k, A, B) \ _mm_mask_cmp_epu8_mask((k), (A), (B), _MM_CMPINT_EQ) #define _mm_cmpge_epu8_mask(A, B) \ _mm_cmp_epu8_mask((A), (B), _MM_CMPINT_GE) #define _mm_mask_cmpge_epu8_mask(k, A, B) \ _mm_mask_cmp_epu8_mask((k), (A), (B), _MM_CMPINT_GE) #define _mm_cmpgt_epu8_mask(A, B) \ _mm_cmp_epu8_mask((A), (B), _MM_CMPINT_GT) #define _mm_mask_cmpgt_epu8_mask(k, A, B) \ _mm_mask_cmp_epu8_mask((k), (A), (B), _MM_CMPINT_GT) #define _mm_cmple_epu8_mask(A, B) \ _mm_cmp_epu8_mask((A), (B), _MM_CMPINT_LE) #define _mm_mask_cmple_epu8_mask(k, A, B) \ _mm_mask_cmp_epu8_mask((k), (A), (B), _MM_CMPINT_LE) #define _mm_cmplt_epu8_mask(A, B) \ _mm_cmp_epu8_mask((A), (B), _MM_CMPINT_LT) #define _mm_mask_cmplt_epu8_mask(k, A, B) \ _mm_mask_cmp_epu8_mask((k), (A), (B), _MM_CMPINT_LT) #define _mm_cmpneq_epu8_mask(A, B) \ _mm_cmp_epu8_mask((A), (B), _MM_CMPINT_NE) #define _mm_mask_cmpneq_epu8_mask(k, A, B) \ _mm_mask_cmp_epu8_mask((k), (A), (B), _MM_CMPINT_NE) #define _mm256_cmpeq_epu8_mask(A, B) \ _mm256_cmp_epu8_mask((A), (B), _MM_CMPINT_EQ) #define _mm256_mask_cmpeq_epu8_mask(k, A, B) \ _mm256_mask_cmp_epu8_mask((k), (A), (B), _MM_CMPINT_EQ) #define _mm256_cmpge_epu8_mask(A, B) \ _mm256_cmp_epu8_mask((A), (B), _MM_CMPINT_GE) #define _mm256_mask_cmpge_epu8_mask(k, A, B) \ _mm256_mask_cmp_epu8_mask((k), (A), (B), _MM_CMPINT_GE) #define _mm256_cmpgt_epu8_mask(A, B) \ _mm256_cmp_epu8_mask((A), (B), _MM_CMPINT_GT) #define _mm256_mask_cmpgt_epu8_mask(k, A, B) \ _mm256_mask_cmp_epu8_mask((k), (A), (B), _MM_CMPINT_GT) #define _mm256_cmple_epu8_mask(A, B) \ _mm256_cmp_epu8_mask((A), (B), _MM_CMPINT_LE) #define _mm256_mask_cmple_epu8_mask(k, A, B) \ _mm256_mask_cmp_epu8_mask((k), (A), (B), _MM_CMPINT_LE) #define _mm256_cmplt_epu8_mask(A, B) \ _mm256_cmp_epu8_mask((A), (B), _MM_CMPINT_LT) #define _mm256_mask_cmplt_epu8_mask(k, A, B) \ _mm256_mask_cmp_epu8_mask((k), (A), (B), _MM_CMPINT_LT) #define _mm256_cmpneq_epu8_mask(A, B) \ _mm256_cmp_epu8_mask((A), (B), _MM_CMPINT_NE) #define _mm256_mask_cmpneq_epu8_mask(k, A, B) \ _mm256_mask_cmp_epu8_mask((k), (A), (B), _MM_CMPINT_NE) #define _mm_cmpeq_epi16_mask(A, B) \ _mm_cmp_epi16_mask((A), (B), _MM_CMPINT_EQ) #define _mm_mask_cmpeq_epi16_mask(k, A, B) \ _mm_mask_cmp_epi16_mask((k), (A), (B), _MM_CMPINT_EQ) #define _mm_cmpge_epi16_mask(A, B) \ _mm_cmp_epi16_mask((A), (B), _MM_CMPINT_GE) #define _mm_mask_cmpge_epi16_mask(k, A, B) \ _mm_mask_cmp_epi16_mask((k), (A), (B), _MM_CMPINT_GE) #define _mm_cmpgt_epi16_mask(A, B) \ _mm_cmp_epi16_mask((A), (B), _MM_CMPINT_GT) #define _mm_mask_cmpgt_epi16_mask(k, A, B) \ _mm_mask_cmp_epi16_mask((k), (A), (B), _MM_CMPINT_GT) #define _mm_cmple_epi16_mask(A, B) \ _mm_cmp_epi16_mask((A), (B), _MM_CMPINT_LE) #define _mm_mask_cmple_epi16_mask(k, A, B) \ _mm_mask_cmp_epi16_mask((k), (A), (B), _MM_CMPINT_LE) #define _mm_cmplt_epi16_mask(A, B) \ _mm_cmp_epi16_mask((A), (B), _MM_CMPINT_LT) #define _mm_mask_cmplt_epi16_mask(k, A, B) \ _mm_mask_cmp_epi16_mask((k), (A), (B), _MM_CMPINT_LT) #define _mm_cmpneq_epi16_mask(A, B) \ _mm_cmp_epi16_mask((A), (B), _MM_CMPINT_NE) #define _mm_mask_cmpneq_epi16_mask(k, A, B) \ _mm_mask_cmp_epi16_mask((k), (A), (B), _MM_CMPINT_NE) #define _mm256_cmpeq_epi16_mask(A, B) \ _mm256_cmp_epi16_mask((A), (B), _MM_CMPINT_EQ) #define _mm256_mask_cmpeq_epi16_mask(k, A, B) \ _mm256_mask_cmp_epi16_mask((k), (A), (B), _MM_CMPINT_EQ) #define _mm256_cmpge_epi16_mask(A, B) \ _mm256_cmp_epi16_mask((A), (B), _MM_CMPINT_GE) #define _mm256_mask_cmpge_epi16_mask(k, A, B) \ _mm256_mask_cmp_epi16_mask((k), (A), (B), _MM_CMPINT_GE) #define _mm256_cmpgt_epi16_mask(A, B) \ _mm256_cmp_epi16_mask((A), (B), _MM_CMPINT_GT) #define _mm256_mask_cmpgt_epi16_mask(k, A, B) \ _mm256_mask_cmp_epi16_mask((k), (A), (B), _MM_CMPINT_GT) #define _mm256_cmple_epi16_mask(A, B) \ _mm256_cmp_epi16_mask((A), (B), _MM_CMPINT_LE) #define _mm256_mask_cmple_epi16_mask(k, A, B) \ _mm256_mask_cmp_epi16_mask((k), (A), (B), _MM_CMPINT_LE) #define _mm256_cmplt_epi16_mask(A, B) \ _mm256_cmp_epi16_mask((A), (B), _MM_CMPINT_LT) #define _mm256_mask_cmplt_epi16_mask(k, A, B) \ _mm256_mask_cmp_epi16_mask((k), (A), (B), _MM_CMPINT_LT) #define _mm256_cmpneq_epi16_mask(A, B) \ _mm256_cmp_epi16_mask((A), (B), _MM_CMPINT_NE) #define _mm256_mask_cmpneq_epi16_mask(k, A, B) \ _mm256_mask_cmp_epi16_mask((k), (A), (B), _MM_CMPINT_NE) #define _mm_cmpeq_epu16_mask(A, B) \ _mm_cmp_epu16_mask((A), (B), _MM_CMPINT_EQ) #define _mm_mask_cmpeq_epu16_mask(k, A, B) \ _mm_mask_cmp_epu16_mask((k), (A), (B), _MM_CMPINT_EQ) #define _mm_cmpge_epu16_mask(A, B) \ _mm_cmp_epu16_mask((A), (B), _MM_CMPINT_GE) #define _mm_mask_cmpge_epu16_mask(k, A, B) \ _mm_mask_cmp_epu16_mask((k), (A), (B), _MM_CMPINT_GE) #define _mm_cmpgt_epu16_mask(A, B) \ _mm_cmp_epu16_mask((A), (B), _MM_CMPINT_GT) #define _mm_mask_cmpgt_epu16_mask(k, A, B) \ _mm_mask_cmp_epu16_mask((k), (A), (B), _MM_CMPINT_GT) #define _mm_cmple_epu16_mask(A, B) \ _mm_cmp_epu16_mask((A), (B), _MM_CMPINT_LE) #define _mm_mask_cmple_epu16_mask(k, A, B) \ _mm_mask_cmp_epu16_mask((k), (A), (B), _MM_CMPINT_LE) #define _mm_cmplt_epu16_mask(A, B) \ _mm_cmp_epu16_mask((A), (B), _MM_CMPINT_LT) #define _mm_mask_cmplt_epu16_mask(k, A, B) \ _mm_mask_cmp_epu16_mask((k), (A), (B), _MM_CMPINT_LT) #define _mm_cmpneq_epu16_mask(A, B) \ _mm_cmp_epu16_mask((A), (B), _MM_CMPINT_NE) #define _mm_mask_cmpneq_epu16_mask(k, A, B) \ _mm_mask_cmp_epu16_mask((k), (A), (B), _MM_CMPINT_NE) #define _mm256_cmpeq_epu16_mask(A, B) \ _mm256_cmp_epu16_mask((A), (B), _MM_CMPINT_EQ) #define _mm256_mask_cmpeq_epu16_mask(k, A, B) \ _mm256_mask_cmp_epu16_mask((k), (A), (B), _MM_CMPINT_EQ) #define _mm256_cmpge_epu16_mask(A, B) \ _mm256_cmp_epu16_mask((A), (B), _MM_CMPINT_GE) #define _mm256_mask_cmpge_epu16_mask(k, A, B) \ _mm256_mask_cmp_epu16_mask((k), (A), (B), _MM_CMPINT_GE) #define _mm256_cmpgt_epu16_mask(A, B) \ _mm256_cmp_epu16_mask((A), (B), _MM_CMPINT_GT) #define _mm256_mask_cmpgt_epu16_mask(k, A, B) \ _mm256_mask_cmp_epu16_mask((k), (A), (B), _MM_CMPINT_GT) #define _mm256_cmple_epu16_mask(A, B) \ _mm256_cmp_epu16_mask((A), (B), _MM_CMPINT_LE) #define _mm256_mask_cmple_epu16_mask(k, A, B) \ _mm256_mask_cmp_epu16_mask((k), (A), (B), _MM_CMPINT_LE) #define _mm256_cmplt_epu16_mask(A, B) \ _mm256_cmp_epu16_mask((A), (B), _MM_CMPINT_LT) #define _mm256_mask_cmplt_epu16_mask(k, A, B) \ _mm256_mask_cmp_epu16_mask((k), (A), (B), _MM_CMPINT_LT) #define _mm256_cmpneq_epu16_mask(A, B) \ _mm256_cmp_epu16_mask((A), (B), _MM_CMPINT_NE) #define _mm256_mask_cmpneq_epu16_mask(k, A, B) \ _mm256_mask_cmp_epu16_mask((k), (A), (B), _MM_CMPINT_NE) static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_add_epi8(__m256i __W, __mmask32 __U, __m256i __A, __m256i __B){ return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U, (__v32qi)_mm256_add_epi8(__A, __B), (__v32qi)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_add_epi8(__mmask32 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U, (__v32qi)_mm256_add_epi8(__A, __B), (__v32qi)_mm256_setzero_si256()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_add_epi16(__m256i __W, __mmask16 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U, (__v16hi)_mm256_add_epi16(__A, __B), (__v16hi)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_add_epi16(__mmask16 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U, (__v16hi)_mm256_add_epi16(__A, __B), (__v16hi)_mm256_setzero_si256()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_sub_epi8(__m256i __W, __mmask32 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U, (__v32qi)_mm256_sub_epi8(__A, __B), (__v32qi)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_sub_epi8(__mmask32 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U, (__v32qi)_mm256_sub_epi8(__A, __B), (__v32qi)_mm256_setzero_si256()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_sub_epi16(__m256i __W, __mmask16 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U, (__v16hi)_mm256_sub_epi16(__A, __B), (__v16hi)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_sub_epi16(__mmask16 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U, (__v16hi)_mm256_sub_epi16(__A, __B), (__v16hi)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_add_epi8(__m128i __W, __mmask16 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U, (__v16qi)_mm_add_epi8(__A, __B), (__v16qi)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_add_epi8(__mmask16 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U, (__v16qi)_mm_add_epi8(__A, __B), (__v16qi)_mm_setzero_si128()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_add_epi16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U, (__v8hi)_mm_add_epi16(__A, __B), (__v8hi)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_add_epi16(__mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U, (__v8hi)_mm_add_epi16(__A, __B), (__v8hi)_mm_setzero_si128()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_sub_epi8(__m128i __W, __mmask16 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U, (__v16qi)_mm_sub_epi8(__A, __B), (__v16qi)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_sub_epi8(__mmask16 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U, (__v16qi)_mm_sub_epi8(__A, __B), (__v16qi)_mm_setzero_si128()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_sub_epi16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U, (__v8hi)_mm_sub_epi16(__A, __B), (__v8hi)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_sub_epi16(__mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U, (__v8hi)_mm_sub_epi16(__A, __B), (__v8hi)_mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_mullo_epi16(__m256i __W, __mmask16 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U, (__v16hi)_mm256_mullo_epi16(__A, __B), (__v16hi)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_mullo_epi16(__mmask16 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U, (__v16hi)_mm256_mullo_epi16(__A, __B), (__v16hi)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_mullo_epi16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U, (__v8hi)_mm_mullo_epi16(__A, __B), (__v8hi)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_mullo_epi16(__mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U, (__v8hi)_mm_mullo_epi16(__A, __B), (__v8hi)_mm_setzero_si128()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_blend_epi8 (__mmask16 __U, __m128i __A, __m128i __W) { return (__m128i) __builtin_ia32_selectb_128 ((__mmask16) __U, (__v16qi) __W, (__v16qi) __A); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_blend_epi8 (__mmask32 __U, __m256i __A, __m256i __W) { return (__m256i) __builtin_ia32_selectb_256 ((__mmask32) __U, (__v32qi) __W, (__v32qi) __A); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_blend_epi16 (__mmask8 __U, __m128i __A, __m128i __W) { return (__m128i) __builtin_ia32_selectw_128 ((__mmask8) __U, (__v8hi) __W, (__v8hi) __A); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_blend_epi16 (__mmask16 __U, __m256i __A, __m256i __W) { return (__m256i) __builtin_ia32_selectw_256 ((__mmask16) __U, (__v16hi) __W, (__v16hi) __A); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_abs_epi8(__m128i __W, __mmask16 __U, __m128i __A) { return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U, (__v16qi)_mm_abs_epi8(__A), (__v16qi)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_abs_epi8(__mmask16 __U, __m128i __A) { return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U, (__v16qi)_mm_abs_epi8(__A), (__v16qi)_mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_abs_epi8(__m256i __W, __mmask32 __U, __m256i __A) { return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U, (__v32qi)_mm256_abs_epi8(__A), (__v32qi)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_abs_epi8 (__mmask32 __U, __m256i __A) { return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U, (__v32qi)_mm256_abs_epi8(__A), (__v32qi)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_abs_epi16(__m128i __W, __mmask8 __U, __m128i __A) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U, (__v8hi)_mm_abs_epi16(__A), (__v8hi)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_abs_epi16(__mmask8 __U, __m128i __A) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U, (__v8hi)_mm_abs_epi16(__A), (__v8hi)_mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_abs_epi16(__m256i __W, __mmask16 __U, __m256i __A) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U, (__v16hi)_mm256_abs_epi16(__A), (__v16hi)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_abs_epi16(__mmask16 __U, __m256i __A) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U, (__v16hi)_mm256_abs_epi16(__A), (__v16hi)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_packs_epi32(__mmask8 __M, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__M, (__v8hi)_mm_packs_epi32(__A, __B), (__v8hi)_mm_setzero_si128()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_packs_epi32(__m128i __W, __mmask16 __M, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__M, (__v8hi)_mm_packs_epi32(__A, __B), (__v8hi)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_packs_epi32(__mmask16 __M, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__M, (__v16hi)_mm256_packs_epi32(__A, __B), (__v16hi)_mm256_setzero_si256()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_packs_epi32(__m256i __W, __mmask16 __M, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__M, (__v16hi)_mm256_packs_epi32(__A, __B), (__v16hi)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_packs_epi16(__mmask16 __M, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectb_128((__mmask16)__M, (__v16qi)_mm_packs_epi16(__A, __B), (__v16qi)_mm_setzero_si128()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_packs_epi16(__m128i __W, __mmask16 __M, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectb_128((__mmask16)__M, (__v16qi)_mm_packs_epi16(__A, __B), (__v16qi)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_packs_epi16(__mmask32 __M, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectb_256((__mmask32)__M, (__v32qi)_mm256_packs_epi16(__A, __B), (__v32qi)_mm256_setzero_si256()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_packs_epi16(__m256i __W, __mmask32 __M, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectb_256((__mmask32)__M, (__v32qi)_mm256_packs_epi16(__A, __B), (__v32qi)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_packus_epi32(__mmask8 __M, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__M, (__v8hi)_mm_packus_epi32(__A, __B), (__v8hi)_mm_setzero_si128()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_packus_epi32(__m128i __W, __mmask16 __M, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__M, (__v8hi)_mm_packus_epi32(__A, __B), (__v8hi)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_packus_epi32(__mmask16 __M, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__M, (__v16hi)_mm256_packus_epi32(__A, __B), (__v16hi)_mm256_setzero_si256()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_packus_epi32(__m256i __W, __mmask16 __M, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__M, (__v16hi)_mm256_packus_epi32(__A, __B), (__v16hi)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_packus_epi16(__mmask16 __M, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectb_128((__mmask16)__M, (__v16qi)_mm_packus_epi16(__A, __B), (__v16qi)_mm_setzero_si128()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_packus_epi16(__m128i __W, __mmask16 __M, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectb_128((__mmask16)__M, (__v16qi)_mm_packus_epi16(__A, __B), (__v16qi)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_packus_epi16(__mmask32 __M, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectb_256((__mmask32)__M, (__v32qi)_mm256_packus_epi16(__A, __B), (__v32qi)_mm256_setzero_si256()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_packus_epi16(__m256i __W, __mmask32 __M, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectb_256((__mmask32)__M, (__v32qi)_mm256_packus_epi16(__A, __B), (__v32qi)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_adds_epi8(__m128i __W, __mmask16 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U, (__v16qi)_mm_adds_epi8(__A, __B), (__v16qi)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_adds_epi8(__mmask16 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U, (__v16qi)_mm_adds_epi8(__A, __B), (__v16qi)_mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_adds_epi8(__m256i __W, __mmask32 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U, (__v32qi)_mm256_adds_epi8(__A, __B), (__v32qi)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_adds_epi8(__mmask32 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U, (__v32qi)_mm256_adds_epi8(__A, __B), (__v32qi)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_adds_epi16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U, (__v8hi)_mm_adds_epi16(__A, __B), (__v8hi)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_adds_epi16(__mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U, (__v8hi)_mm_adds_epi16(__A, __B), (__v8hi)_mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_adds_epi16(__m256i __W, __mmask16 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U, (__v16hi)_mm256_adds_epi16(__A, __B), (__v16hi)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_adds_epi16(__mmask16 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U, (__v16hi)_mm256_adds_epi16(__A, __B), (__v16hi)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_adds_epu8(__m128i __W, __mmask16 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U, (__v16qi)_mm_adds_epu8(__A, __B), (__v16qi)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_adds_epu8(__mmask16 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U, (__v16qi)_mm_adds_epu8(__A, __B), (__v16qi)_mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_adds_epu8(__m256i __W, __mmask32 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U, (__v32qi)_mm256_adds_epu8(__A, __B), (__v32qi)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_adds_epu8(__mmask32 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U, (__v32qi)_mm256_adds_epu8(__A, __B), (__v32qi)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_adds_epu16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U, (__v8hi)_mm_adds_epu16(__A, __B), (__v8hi)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_adds_epu16(__mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U, (__v8hi)_mm_adds_epu16(__A, __B), (__v8hi)_mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_adds_epu16(__m256i __W, __mmask16 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U, (__v16hi)_mm256_adds_epu16(__A, __B), (__v16hi)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_adds_epu16(__mmask16 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U, (__v16hi)_mm256_adds_epu16(__A, __B), (__v16hi)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_avg_epu8(__m128i __W, __mmask16 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U, (__v16qi)_mm_avg_epu8(__A, __B), (__v16qi)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_avg_epu8(__mmask16 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U, (__v16qi)_mm_avg_epu8(__A, __B), (__v16qi)_mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_avg_epu8(__m256i __W, __mmask32 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U, (__v32qi)_mm256_avg_epu8(__A, __B), (__v32qi)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_avg_epu8(__mmask32 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U, (__v32qi)_mm256_avg_epu8(__A, __B), (__v32qi)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_avg_epu16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U, (__v8hi)_mm_avg_epu16(__A, __B), (__v8hi)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_avg_epu16(__mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U, (__v8hi)_mm_avg_epu16(__A, __B), (__v8hi)_mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_avg_epu16(__m256i __W, __mmask16 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U, (__v16hi)_mm256_avg_epu16(__A, __B), (__v16hi)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_avg_epu16(__mmask16 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U, (__v16hi)_mm256_avg_epu16(__A, __B), (__v16hi)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_max_epi8(__mmask16 __M, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectb_128((__mmask16)__M, (__v16qi)_mm_max_epi8(__A, __B), (__v16qi)_mm_setzero_si128()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_max_epi8(__m128i __W, __mmask16 __M, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectb_128((__mmask16)__M, (__v16qi)_mm_max_epi8(__A, __B), (__v16qi)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_max_epi8(__mmask32 __M, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectb_256((__mmask32)__M, (__v32qi)_mm256_max_epi8(__A, __B), (__v32qi)_mm256_setzero_si256()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_max_epi8(__m256i __W, __mmask32 __M, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectb_256((__mmask32)__M, (__v32qi)_mm256_max_epi8(__A, __B), (__v32qi)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_max_epi16(__mmask8 __M, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__M, (__v8hi)_mm_max_epi16(__A, __B), (__v8hi)_mm_setzero_si128()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_max_epi16(__m128i __W, __mmask8 __M, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__M, (__v8hi)_mm_max_epi16(__A, __B), (__v8hi)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_max_epi16(__mmask16 __M, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__M, (__v16hi)_mm256_max_epi16(__A, __B), (__v16hi)_mm256_setzero_si256()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_max_epi16(__m256i __W, __mmask16 __M, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__M, (__v16hi)_mm256_max_epi16(__A, __B), (__v16hi)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_max_epu8(__mmask16 __M, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectb_128((__mmask16)__M, (__v16qi)_mm_max_epu8(__A, __B), (__v16qi)_mm_setzero_si128()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_max_epu8(__m128i __W, __mmask16 __M, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectb_128((__mmask16)__M, (__v16qi)_mm_max_epu8(__A, __B), (__v16qi)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_max_epu8 (__mmask32 __M, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectb_256((__mmask32)__M, (__v32qi)_mm256_max_epu8(__A, __B), (__v32qi)_mm256_setzero_si256()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_max_epu8(__m256i __W, __mmask32 __M, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectb_256((__mmask32)__M, (__v32qi)_mm256_max_epu8(__A, __B), (__v32qi)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_max_epu16(__mmask8 __M, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__M, (__v8hi)_mm_max_epu16(__A, __B), (__v8hi)_mm_setzero_si128()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_max_epu16(__m128i __W, __mmask8 __M, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__M, (__v8hi)_mm_max_epu16(__A, __B), (__v8hi)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_max_epu16(__mmask16 __M, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__M, (__v16hi)_mm256_max_epu16(__A, __B), (__v16hi)_mm256_setzero_si256()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_max_epu16(__m256i __W, __mmask16 __M, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__M, (__v16hi)_mm256_max_epu16(__A, __B), (__v16hi)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_min_epi8(__mmask16 __M, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectb_128((__mmask16)__M, (__v16qi)_mm_min_epi8(__A, __B), (__v16qi)_mm_setzero_si128()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_min_epi8(__m128i __W, __mmask16 __M, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectb_128((__mmask16)__M, (__v16qi)_mm_min_epi8(__A, __B), (__v16qi)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_min_epi8(__mmask32 __M, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectb_256((__mmask32)__M, (__v32qi)_mm256_min_epi8(__A, __B), (__v32qi)_mm256_setzero_si256()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_min_epi8(__m256i __W, __mmask32 __M, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectb_256((__mmask32)__M, (__v32qi)_mm256_min_epi8(__A, __B), (__v32qi)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_min_epi16(__mmask8 __M, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__M, (__v8hi)_mm_min_epi16(__A, __B), (__v8hi)_mm_setzero_si128()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_min_epi16(__m128i __W, __mmask8 __M, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__M, (__v8hi)_mm_min_epi16(__A, __B), (__v8hi)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_min_epi16(__mmask16 __M, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__M, (__v16hi)_mm256_min_epi16(__A, __B), (__v16hi)_mm256_setzero_si256()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_min_epi16(__m256i __W, __mmask16 __M, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__M, (__v16hi)_mm256_min_epi16(__A, __B), (__v16hi)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_min_epu8(__mmask16 __M, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectb_128((__mmask16)__M, (__v16qi)_mm_min_epu8(__A, __B), (__v16qi)_mm_setzero_si128()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_min_epu8(__m128i __W, __mmask16 __M, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectb_128((__mmask16)__M, (__v16qi)_mm_min_epu8(__A, __B), (__v16qi)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_min_epu8 (__mmask32 __M, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectb_256((__mmask32)__M, (__v32qi)_mm256_min_epu8(__A, __B), (__v32qi)_mm256_setzero_si256()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_min_epu8(__m256i __W, __mmask32 __M, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectb_256((__mmask32)__M, (__v32qi)_mm256_min_epu8(__A, __B), (__v32qi)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_min_epu16(__mmask8 __M, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__M, (__v8hi)_mm_min_epu16(__A, __B), (__v8hi)_mm_setzero_si128()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_min_epu16(__m128i __W, __mmask8 __M, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__M, (__v8hi)_mm_min_epu16(__A, __B), (__v8hi)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_min_epu16(__mmask16 __M, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__M, (__v16hi)_mm256_min_epu16(__A, __B), (__v16hi)_mm256_setzero_si256()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_min_epu16(__m256i __W, __mmask16 __M, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__M, (__v16hi)_mm256_min_epu16(__A, __B), (__v16hi)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_shuffle_epi8(__m128i __W, __mmask16 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U, (__v16qi)_mm_shuffle_epi8(__A, __B), (__v16qi)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_shuffle_epi8(__mmask16 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U, (__v16qi)_mm_shuffle_epi8(__A, __B), (__v16qi)_mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_shuffle_epi8(__m256i __W, __mmask32 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U, (__v32qi)_mm256_shuffle_epi8(__A, __B), (__v32qi)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_shuffle_epi8(__mmask32 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U, (__v32qi)_mm256_shuffle_epi8(__A, __B), (__v32qi)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_subs_epi8(__m128i __W, __mmask16 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U, (__v16qi)_mm_subs_epi8(__A, __B), (__v16qi)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_subs_epi8(__mmask16 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U, (__v16qi)_mm_subs_epi8(__A, __B), (__v16qi)_mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_subs_epi8(__m256i __W, __mmask32 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U, (__v32qi)_mm256_subs_epi8(__A, __B), (__v32qi)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_subs_epi8(__mmask32 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U, (__v32qi)_mm256_subs_epi8(__A, __B), (__v32qi)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_subs_epi16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U, (__v8hi)_mm_subs_epi16(__A, __B), (__v8hi)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_subs_epi16(__mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U, (__v8hi)_mm_subs_epi16(__A, __B), (__v8hi)_mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_subs_epi16(__m256i __W, __mmask16 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U, (__v16hi)_mm256_subs_epi16(__A, __B), (__v16hi)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_subs_epi16(__mmask16 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U, (__v16hi)_mm256_subs_epi16(__A, __B), (__v16hi)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_subs_epu8(__m128i __W, __mmask16 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U, (__v16qi)_mm_subs_epu8(__A, __B), (__v16qi)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_subs_epu8(__mmask16 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U, (__v16qi)_mm_subs_epu8(__A, __B), (__v16qi)_mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_subs_epu8(__m256i __W, __mmask32 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U, (__v32qi)_mm256_subs_epu8(__A, __B), (__v32qi)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_subs_epu8(__mmask32 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U, (__v32qi)_mm256_subs_epu8(__A, __B), (__v32qi)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_subs_epu16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U, (__v8hi)_mm_subs_epu16(__A, __B), (__v8hi)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_subs_epu16(__mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U, (__v8hi)_mm_subs_epu16(__A, __B), (__v8hi)_mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_subs_epu16(__m256i __W, __mmask16 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U, (__v16hi)_mm256_subs_epu16(__A, __B), (__v16hi)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_subs_epu16(__mmask16 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U, (__v16hi)_mm256_subs_epu16(__A, __B), (__v16hi)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask2_permutex2var_epi16 (__m128i __A, __m128i __I, __mmask8 __U, __m128i __B) { return (__m128i) __builtin_ia32_vpermi2varhi128_mask ((__v8hi) __A, (__v8hi) __I /* idx */ , (__v8hi) __B, (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask2_permutex2var_epi16 (__m256i __A, __m256i __I, __mmask16 __U, __m256i __B) { return (__m256i) __builtin_ia32_vpermi2varhi256_mask ((__v16hi) __A, (__v16hi) __I /* idx */ , (__v16hi) __B, (__mmask16) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_permutex2var_epi16 (__m128i __A, __m128i __I, __m128i __B) { return (__m128i) __builtin_ia32_vpermt2varhi128_mask ((__v8hi) __I/* idx */, (__v8hi) __A, (__v8hi) __B, (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_permutex2var_epi16 (__m128i __A, __mmask8 __U, __m128i __I, __m128i __B) { return (__m128i) __builtin_ia32_vpermt2varhi128_mask ((__v8hi) __I/* idx */, (__v8hi) __A, (__v8hi) __B, (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_permutex2var_epi16 (__mmask8 __U, __m128i __A, __m128i __I, __m128i __B) { return (__m128i) __builtin_ia32_vpermt2varhi128_maskz ((__v8hi) __I/* idx */, (__v8hi) __A, (__v8hi) __B, (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_permutex2var_epi16 (__m256i __A, __m256i __I, __m256i __B) { return (__m256i) __builtin_ia32_vpermt2varhi256_mask ((__v16hi) __I/* idx */, (__v16hi) __A, (__v16hi) __B, (__mmask16) -1); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_permutex2var_epi16 (__m256i __A, __mmask16 __U, __m256i __I, __m256i __B) { return (__m256i) __builtin_ia32_vpermt2varhi256_mask ((__v16hi) __I/* idx */, (__v16hi) __A, (__v16hi) __B, (__mmask16) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_permutex2var_epi16 (__mmask16 __U, __m256i __A, __m256i __I, __m256i __B) { return (__m256i) __builtin_ia32_vpermt2varhi256_maskz ((__v16hi) __I/* idx */, (__v16hi) __A, (__v16hi) __B, (__mmask16) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_maddubs_epi16(__m128i __W, __mmask8 __U, __m128i __X, __m128i __Y) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U, (__v8hi)_mm_maddubs_epi16(__X, __Y), (__v8hi)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_maddubs_epi16(__mmask8 __U, __m128i __X, __m128i __Y) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U, (__v8hi)_mm_maddubs_epi16(__X, __Y), (__v8hi)_mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_maddubs_epi16(__m256i __W, __mmask16 __U, __m256i __X, __m256i __Y) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U, (__v16hi)_mm256_maddubs_epi16(__X, __Y), (__v16hi)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_maddubs_epi16(__mmask16 __U, __m256i __X, __m256i __Y) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U, (__v16hi)_mm256_maddubs_epi16(__X, __Y), (__v16hi)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_madd_epi16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U, (__v4si)_mm_madd_epi16(__A, __B), (__v4si)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_madd_epi16(__mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U, (__v4si)_mm_madd_epi16(__A, __B), (__v4si)_mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_madd_epi16(__m256i __W, __mmask8 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U, (__v8si)_mm256_madd_epi16(__A, __B), (__v8si)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_madd_epi16(__mmask8 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U, (__v8si)_mm256_madd_epi16(__A, __B), (__v8si)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtsepi16_epi8 (__m128i __A) { return (__m128i) __builtin_ia32_pmovswb128_mask ((__v8hi) __A, (__v16qi) _mm_setzero_si128(), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_cvtsepi16_epi8 (__m128i __O, __mmask8 __M, __m128i __A) { return (__m128i) __builtin_ia32_pmovswb128_mask ((__v8hi) __A, (__v16qi) __O, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_cvtsepi16_epi8 (__mmask8 __M, __m128i __A) { return (__m128i) __builtin_ia32_pmovswb128_mask ((__v8hi) __A, (__v16qi) _mm_setzero_si128(), __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_cvtsepi16_epi8 (__m256i __A) { return (__m128i) __builtin_ia32_pmovswb256_mask ((__v16hi) __A, (__v16qi) _mm_setzero_si128(), (__mmask16) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_mask_cvtsepi16_epi8 (__m128i __O, __mmask16 __M, __m256i __A) { return (__m128i) __builtin_ia32_pmovswb256_mask ((__v16hi) __A, (__v16qi) __O, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_maskz_cvtsepi16_epi8 (__mmask16 __M, __m256i __A) { return (__m128i) __builtin_ia32_pmovswb256_mask ((__v16hi) __A, (__v16qi) _mm_setzero_si128(), __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtusepi16_epi8 (__m128i __A) { return (__m128i) __builtin_ia32_pmovuswb128_mask ((__v8hi) __A, (__v16qi) _mm_setzero_si128(), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_cvtusepi16_epi8 (__m128i __O, __mmask8 __M, __m128i __A) { return (__m128i) __builtin_ia32_pmovuswb128_mask ((__v8hi) __A, (__v16qi) __O, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_cvtusepi16_epi8 (__mmask8 __M, __m128i __A) { return (__m128i) __builtin_ia32_pmovuswb128_mask ((__v8hi) __A, (__v16qi) _mm_setzero_si128(), __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_cvtusepi16_epi8 (__m256i __A) { return (__m128i) __builtin_ia32_pmovuswb256_mask ((__v16hi) __A, (__v16qi) _mm_setzero_si128(), (__mmask16) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_mask_cvtusepi16_epi8 (__m128i __O, __mmask16 __M, __m256i __A) { return (__m128i) __builtin_ia32_pmovuswb256_mask ((__v16hi) __A, (__v16qi) __O, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_maskz_cvtusepi16_epi8 (__mmask16 __M, __m256i __A) { return (__m128i) __builtin_ia32_pmovuswb256_mask ((__v16hi) __A, (__v16qi) _mm_setzero_si128(), __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtepi16_epi8 (__m128i __A) { return (__m128i) __builtin_ia32_pmovwb128_mask ((__v8hi) __A, (__v16qi) _mm_setzero_si128(), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_cvtepi16_epi8 (__m128i __O, __mmask8 __M, __m128i __A) { return (__m128i) __builtin_ia32_pmovwb128_mask ((__v8hi) __A, (__v16qi) __O, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_cvtepi16_epi8 (__mmask8 __M, __m128i __A) { return (__m128i) __builtin_ia32_pmovwb128_mask ((__v8hi) __A, (__v16qi) _mm_setzero_si128(), __M); } static __inline__ void __DEFAULT_FN_ATTRS _mm_mask_cvtepi16_storeu_epi8 (void * __P, __mmask8 __M, __m128i __A) { __builtin_ia32_pmovwb128mem_mask ((__v16qi *) __P, (__v8hi) __A, __M); } static __inline__ void __DEFAULT_FN_ATTRS _mm_mask_cvtsepi16_storeu_epi8 (void * __P, __mmask8 __M, __m128i __A) { __builtin_ia32_pmovswb128mem_mask ((__v16qi *) __P, (__v8hi) __A, __M); } static __inline__ void __DEFAULT_FN_ATTRS _mm_mask_cvtusepi16_storeu_epi8 (void * __P, __mmask8 __M, __m128i __A) { __builtin_ia32_pmovuswb128mem_mask ((__v16qi *) __P, (__v8hi) __A, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_cvtepi16_epi8 (__m256i __A) { return (__m128i) __builtin_ia32_pmovwb256_mask ((__v16hi) __A, (__v16qi) _mm_setzero_si128(), (__mmask16) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_mask_cvtepi16_epi8 (__m128i __O, __mmask16 __M, __m256i __A) { return (__m128i) __builtin_ia32_pmovwb256_mask ((__v16hi) __A, (__v16qi) __O, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm256_maskz_cvtepi16_epi8 (__mmask16 __M, __m256i __A) { return (__m128i) __builtin_ia32_pmovwb256_mask ((__v16hi) __A, (__v16qi) _mm_setzero_si128(), __M); } static __inline__ void __DEFAULT_FN_ATTRS _mm256_mask_cvtepi16_storeu_epi8 (void * __P, __mmask16 __M, __m256i __A) { __builtin_ia32_pmovwb256mem_mask ((__v16qi *) __P, (__v16hi) __A, __M); } static __inline__ void __DEFAULT_FN_ATTRS _mm256_mask_cvtsepi16_storeu_epi8 (void * __P, __mmask16 __M, __m256i __A) { __builtin_ia32_pmovswb256mem_mask ((__v16qi *) __P, (__v16hi) __A, __M); } static __inline__ void __DEFAULT_FN_ATTRS _mm256_mask_cvtusepi16_storeu_epi8 (void * __P, __mmask8 __M, __m256i __A) { __builtin_ia32_pmovuswb256mem_mask ((__v16qi*) __P, (__v16hi) __A, __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_mulhrs_epi16(__m128i __W, __mmask8 __U, __m128i __X, __m128i __Y) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U, (__v8hi)_mm_mulhrs_epi16(__X, __Y), (__v8hi)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_mulhrs_epi16(__mmask8 __U, __m128i __X, __m128i __Y) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U, (__v8hi)_mm_mulhrs_epi16(__X, __Y), (__v8hi)_mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_mulhrs_epi16(__m256i __W, __mmask16 __U, __m256i __X, __m256i __Y) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U, (__v16hi)_mm256_mulhrs_epi16(__X, __Y), (__v16hi)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_mulhrs_epi16(__mmask16 __U, __m256i __X, __m256i __Y) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U, (__v16hi)_mm256_mulhrs_epi16(__X, __Y), (__v16hi)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_mulhi_epu16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U, (__v8hi)_mm_mulhi_epu16(__A, __B), (__v8hi)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_mulhi_epu16(__mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U, (__v8hi)_mm_mulhi_epu16(__A, __B), (__v8hi)_mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_mulhi_epu16(__m256i __W, __mmask16 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U, (__v16hi)_mm256_mulhi_epu16(__A, __B), (__v16hi)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_mulhi_epu16(__mmask16 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U, (__v16hi)_mm256_mulhi_epu16(__A, __B), (__v16hi)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_mulhi_epi16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U, (__v8hi)_mm_mulhi_epi16(__A, __B), (__v8hi)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_mulhi_epi16(__mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U, (__v8hi)_mm_mulhi_epi16(__A, __B), (__v8hi)_mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_mulhi_epi16(__m256i __W, __mmask16 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U, (__v16hi)_mm256_mulhi_epi16(__A, __B), (__v16hi)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_mulhi_epi16(__mmask16 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U, (__v16hi)_mm256_mulhi_epi16(__A, __B), (__v16hi)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_unpackhi_epi8(__m128i __W, __mmask16 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U, (__v16qi)_mm_unpackhi_epi8(__A, __B), (__v16qi)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_unpackhi_epi8(__mmask16 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U, (__v16qi)_mm_unpackhi_epi8(__A, __B), (__v16qi)_mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_unpackhi_epi8(__m256i __W, __mmask32 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U, (__v32qi)_mm256_unpackhi_epi8(__A, __B), (__v32qi)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_unpackhi_epi8(__mmask32 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U, (__v32qi)_mm256_unpackhi_epi8(__A, __B), (__v32qi)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_unpackhi_epi16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U, (__v8hi)_mm_unpackhi_epi16(__A, __B), (__v8hi)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_unpackhi_epi16(__mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U, (__v8hi)_mm_unpackhi_epi16(__A, __B), (__v8hi) _mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_unpackhi_epi16(__m256i __W, __mmask16 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U, (__v16hi)_mm256_unpackhi_epi16(__A, __B), (__v16hi)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_unpackhi_epi16(__mmask16 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U, (__v16hi)_mm256_unpackhi_epi16(__A, __B), (__v16hi)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_unpacklo_epi8(__m128i __W, __mmask16 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U, (__v16qi)_mm_unpacklo_epi8(__A, __B), (__v16qi)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_unpacklo_epi8(__mmask16 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectb_128((__mmask16)__U, (__v16qi)_mm_unpacklo_epi8(__A, __B), (__v16qi)_mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_unpacklo_epi8(__m256i __W, __mmask32 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U, (__v32qi)_mm256_unpacklo_epi8(__A, __B), (__v32qi)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_unpacklo_epi8(__mmask32 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectb_256((__mmask32)__U, (__v32qi)_mm256_unpacklo_epi8(__A, __B), (__v32qi)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_unpacklo_epi16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U, (__v8hi)_mm_unpacklo_epi16(__A, __B), (__v8hi)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_unpacklo_epi16(__mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U, (__v8hi)_mm_unpacklo_epi16(__A, __B), (__v8hi) _mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_unpacklo_epi16(__m256i __W, __mmask16 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U, (__v16hi)_mm256_unpacklo_epi16(__A, __B), (__v16hi)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_unpacklo_epi16(__mmask16 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U, (__v16hi)_mm256_unpacklo_epi16(__A, __B), (__v16hi)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_cvtepi8_epi16(__m128i __W, __mmask8 __U, __m128i __A) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U, (__v8hi)_mm_cvtepi8_epi16(__A), (__v8hi)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_cvtepi8_epi16(__mmask8 __U, __m128i __A) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U, (__v8hi)_mm_cvtepi8_epi16(__A), (__v8hi)_mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_cvtepi8_epi16(__m256i __W, __mmask16 __U, __m128i __A) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U, (__v16hi)_mm256_cvtepi8_epi16(__A), (__v16hi)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_cvtepi8_epi16(__mmask16 __U, __m128i __A) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U, (__v16hi)_mm256_cvtepi8_epi16(__A), (__v16hi)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_cvtepu8_epi16(__m128i __W, __mmask8 __U, __m128i __A) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U, (__v8hi)_mm_cvtepu8_epi16(__A), (__v8hi)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_cvtepu8_epi16(__mmask8 __U, __m128i __A) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U, (__v8hi)_mm_cvtepu8_epi16(__A), (__v8hi)_mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_cvtepu8_epi16(__m256i __W, __mmask16 __U, __m128i __A) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U, (__v16hi)_mm256_cvtepu8_epi16(__A), (__v16hi)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_cvtepu8_epi16 (__mmask16 __U, __m128i __A) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U, (__v16hi)_mm256_cvtepu8_epi16(__A), (__v16hi)_mm256_setzero_si256()); } #define _mm_mask_shufflehi_epi16(W, U, A, imm) __extension__ ({ \ (__m128i)__builtin_ia32_selectw_128((__mmask8)(U), \ (__v8hi)_mm_shufflehi_epi16((A), (imm)), \ (__v8hi)(__m128i)(W)); }) #define _mm_maskz_shufflehi_epi16(U, A, imm) __extension__ ({ \ (__m128i)__builtin_ia32_selectw_128((__mmask8)(U), \ (__v8hi)_mm_shufflehi_epi16((A), (imm)), \ (__v8hi)_mm_setzero_hi()); }) #define _mm256_mask_shufflehi_epi16(W, U, A, imm) __extension__ ({ \ (__m256i)__builtin_ia32_selectw_256((__mmask16)(U), \ (__v16hi)_mm256_shufflehi_epi16((A), (imm)), \ (__v16hi)(__m256i)(W)); }) #define _mm256_maskz_shufflehi_epi16(U, A, imm) __extension__ ({ \ (__m256i)__builtin_ia32_selectw_256((__mmask16)(U), \ (__v16hi)_mm256_shufflehi_epi16((A), (imm)), \ (__v16hi)_mm256_setzero_si256()); }) #define _mm_mask_shufflelo_epi16(W, U, A, imm) __extension__ ({ \ (__m128i)__builtin_ia32_selectw_128((__mmask8)(U), \ (__v8hi)_mm_shufflelo_epi16((A), (imm)), \ (__v8hi)(__m128i)(W)); }) #define _mm_maskz_shufflelo_epi16(U, A, imm) __extension__ ({ \ (__m128i)__builtin_ia32_selectw_128((__mmask8)(U), \ (__v8hi)_mm_shufflelo_epi16((A), (imm)), \ (__v8hi)_mm_setzero_hi()); }) #define _mm256_mask_shufflelo_epi16(W, U, A, imm) __extension__ ({ \ (__m256i)__builtin_ia32_selectw_256((__mmask16)(U), \ (__v16hi)_mm256_shufflelo_epi16((A), \ (imm)), \ (__v16hi)(__m256i)(W)); }) #define _mm256_maskz_shufflelo_epi16(U, A, imm) __extension__ ({ \ (__m256i)__builtin_ia32_selectw_256((__mmask16)(U), \ (__v16hi)_mm256_shufflelo_epi16((A), \ (imm)), \ (__v16hi)_mm256_setzero_si256()); }) static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_sllv_epi16(__m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_psllv16hi((__v16hi)__A, (__v16hi)__B); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_sllv_epi16(__m256i __W, __mmask16 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U, (__v16hi)_mm256_sllv_epi16(__A, __B), (__v16hi)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_sllv_epi16(__mmask16 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U, (__v16hi)_mm256_sllv_epi16(__A, __B), (__v16hi)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sllv_epi16(__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_psllv8hi((__v8hi)__A, (__v8hi)__B); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_sllv_epi16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U, (__v8hi)_mm_sllv_epi16(__A, __B), (__v8hi)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_sllv_epi16(__mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U, (__v8hi)_mm_sllv_epi16(__A, __B), (__v8hi)_mm_setzero_si128()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_sll_epi16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U, (__v8hi)_mm_sll_epi16(__A, __B), (__v8hi)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_sll_epi16 (__mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U, (__v8hi)_mm_sll_epi16(__A, __B), (__v8hi)_mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_sll_epi16(__m256i __W, __mmask16 __U, __m256i __A, __m128i __B) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U, (__v16hi)_mm256_sll_epi16(__A, __B), (__v16hi)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_sll_epi16(__mmask16 __U, __m256i __A, __m128i __B) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U, (__v16hi)_mm256_sll_epi16(__A, __B), (__v16hi)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_slli_epi16(__m128i __W, __mmask8 __U, __m128i __A, int __B) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U, (__v8hi)_mm_slli_epi16(__A, __B), (__v8hi)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_slli_epi16 (__mmask8 __U, __m128i __A, int __B) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U, (__v8hi)_mm_slli_epi16(__A, __B), (__v8hi)_mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_slli_epi16(__m256i __W, __mmask16 __U, __m256i __A, int __B) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U, (__v16hi)_mm256_slli_epi16(__A, __B), (__v16hi)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_slli_epi16(__mmask16 __U, __m256i __A, int __B) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U, (__v16hi)_mm256_slli_epi16(__A, __B), (__v16hi)_mm256_setzero_si256()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_srlv_epi16(__m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_psrlv16hi((__v16hi)__A, (__v16hi)__B); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_srlv_epi16(__m256i __W, __mmask16 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U, (__v16hi)_mm256_srlv_epi16(__A, __B), (__v16hi)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_srlv_epi16(__mmask16 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U, (__v16hi)_mm256_srlv_epi16(__A, __B), (__v16hi)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_srlv_epi16(__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_psrlv8hi((__v8hi)__A, (__v8hi)__B); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_srlv_epi16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U, (__v8hi)_mm_srlv_epi16(__A, __B), (__v8hi)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_srlv_epi16(__mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U, (__v8hi)_mm_srlv_epi16(__A, __B), (__v8hi)_mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_srav_epi16(__m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_psrav16hi((__v16hi)__A, (__v16hi)__B); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_srav_epi16(__m256i __W, __mmask16 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U, (__v16hi)_mm256_srav_epi16(__A, __B), (__v16hi)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_srav_epi16(__mmask16 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U, (__v16hi)_mm256_srav_epi16(__A, __B), (__v16hi)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_srav_epi16(__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_psrav8hi((__v8hi)__A, (__v8hi)__B); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_srav_epi16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U, (__v8hi)_mm_srav_epi16(__A, __B), (__v8hi)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_srav_epi16(__mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U, (__v8hi)_mm_srav_epi16(__A, __B), (__v8hi)_mm_setzero_si128()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_sra_epi16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U, (__v8hi)_mm_sra_epi16(__A, __B), (__v8hi)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_sra_epi16(__mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U, (__v8hi)_mm_sra_epi16(__A, __B), (__v8hi)_mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_sra_epi16(__m256i __W, __mmask16 __U, __m256i __A, __m128i __B) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U, (__v16hi)_mm256_sra_epi16(__A, __B), (__v16hi)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_sra_epi16(__mmask16 __U, __m256i __A, __m128i __B) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U, (__v16hi)_mm256_sra_epi16(__A, __B), (__v16hi)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_srai_epi16(__m128i __W, __mmask8 __U, __m128i __A, int __B) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U, (__v8hi)_mm_srai_epi16(__A, __B), (__v8hi)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_srai_epi16(__mmask8 __U, __m128i __A, int __B) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U, (__v8hi)_mm_srai_epi16(__A, __B), (__v8hi)_mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_srai_epi16(__m256i __W, __mmask16 __U, __m256i __A, int __B) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U, (__v16hi)_mm256_srai_epi16(__A, __B), (__v16hi)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_srai_epi16(__mmask16 __U, __m256i __A, int __B) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U, (__v16hi)_mm256_srai_epi16(__A, __B), (__v16hi)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_srl_epi16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U, (__v8hi)_mm_srl_epi16(__A, __B), (__v8hi)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_srl_epi16 (__mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U, (__v8hi)_mm_srl_epi16(__A, __B), (__v8hi)_mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_srl_epi16(__m256i __W, __mmask16 __U, __m256i __A, __m128i __B) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U, (__v16hi)_mm256_srl_epi16(__A, __B), (__v16hi)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_srl_epi16(__mmask16 __U, __m256i __A, __m128i __B) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U, (__v16hi)_mm256_srl_epi16(__A, __B), (__v16hi)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_srli_epi16(__m128i __W, __mmask8 __U, __m128i __A, int __B) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U, (__v8hi)_mm_srli_epi16(__A, __B), (__v8hi)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_srli_epi16 (__mmask8 __U, __m128i __A, int __B) { return (__m128i)__builtin_ia32_selectw_128((__mmask8)__U, (__v8hi)_mm_srli_epi16(__A, __B), (__v8hi)_mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_srli_epi16(__m256i __W, __mmask16 __U, __m256i __A, int __B) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U, (__v16hi)_mm256_srli_epi16(__A, __B), (__v16hi)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_srli_epi16(__mmask16 __U, __m256i __A, int __B) { return (__m256i)__builtin_ia32_selectw_256((__mmask16)__U, (__v16hi)_mm256_srli_epi16(__A, __B), (__v16hi)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_mov_epi16 (__m128i __W, __mmask8 __U, __m128i __A) { return (__m128i) __builtin_ia32_selectw_128 ((__mmask8) __U, (__v8hi) __A, (__v8hi) __W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_mov_epi16 (__mmask8 __U, __m128i __A) { return (__m128i) __builtin_ia32_selectw_128 ((__mmask8) __U, (__v8hi) __A, (__v8hi) _mm_setzero_hi ()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_mov_epi16 (__m256i __W, __mmask16 __U, __m256i __A) { return (__m256i) __builtin_ia32_selectw_256 ((__mmask16) __U, (__v16hi) __A, (__v16hi) __W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_mov_epi16 (__mmask16 __U, __m256i __A) { return (__m256i) __builtin_ia32_selectw_256 ((__mmask16) __U, (__v16hi) __A, (__v16hi) _mm256_setzero_si256 ()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_mov_epi8 (__m128i __W, __mmask16 __U, __m128i __A) { return (__m128i) __builtin_ia32_selectb_128 ((__mmask16) __U, (__v16qi) __A, (__v16qi) __W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_mov_epi8 (__mmask16 __U, __m128i __A) { return (__m128i) __builtin_ia32_selectb_128 ((__mmask16) __U, (__v16qi) __A, (__v16qi) _mm_setzero_hi ()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_mov_epi8 (__m256i __W, __mmask32 __U, __m256i __A) { return (__m256i) __builtin_ia32_selectb_256 ((__mmask32) __U, (__v32qi) __A, (__v32qi) __W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_mov_epi8 (__mmask32 __U, __m256i __A) { return (__m256i) __builtin_ia32_selectb_256 ((__mmask32) __U, (__v32qi) __A, (__v32qi) _mm256_setzero_si256 ()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_set1_epi8 (__m128i __O, __mmask16 __M, char __A) { return (__m128i) __builtin_ia32_selectb_128(__M, (__v16qi) _mm_set1_epi8(__A), (__v16qi) __O); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_set1_epi8 (__mmask16 __M, char __A) { return (__m128i) __builtin_ia32_selectb_128(__M, (__v16qi) _mm_set1_epi8(__A), (__v16qi) _mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_set1_epi8 (__m256i __O, __mmask32 __M, char __A) { return (__m256i) __builtin_ia32_selectb_256(__M, (__v32qi) _mm256_set1_epi8(__A), (__v32qi) __O); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_set1_epi8 (__mmask32 __M, char __A) { return (__m256i) __builtin_ia32_selectb_256(__M, (__v32qi) _mm256_set1_epi8(__A), (__v32qi) _mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_loadu_epi16 (__m128i __W, __mmask8 __U, void const *__P) { return (__m128i) __builtin_ia32_loaddquhi128_mask ((__v8hi *) __P, (__v8hi) __W, (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_loadu_epi16 (__mmask8 __U, void const *__P) { return (__m128i) __builtin_ia32_loaddquhi128_mask ((__v8hi *) __P, (__v8hi) _mm_setzero_hi (), (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_loadu_epi16 (__m256i __W, __mmask16 __U, void const *__P) { return (__m256i) __builtin_ia32_loaddquhi256_mask ((__v16hi *) __P, (__v16hi) __W, (__mmask16) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_loadu_epi16 (__mmask16 __U, void const *__P) { return (__m256i) __builtin_ia32_loaddquhi256_mask ((__v16hi *) __P, (__v16hi) _mm256_setzero_si256 (), (__mmask16) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_loadu_epi8 (__m128i __W, __mmask16 __U, void const *__P) { return (__m128i) __builtin_ia32_loaddquqi128_mask ((__v16qi *) __P, (__v16qi) __W, (__mmask16) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_loadu_epi8 (__mmask16 __U, void const *__P) { return (__m128i) __builtin_ia32_loaddquqi128_mask ((__v16qi *) __P, (__v16qi) _mm_setzero_si128 (), (__mmask16) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_loadu_epi8 (__m256i __W, __mmask32 __U, void const *__P) { return (__m256i) __builtin_ia32_loaddquqi256_mask ((__v32qi *) __P, (__v32qi) __W, (__mmask32) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_loadu_epi8 (__mmask32 __U, void const *__P) { return (__m256i) __builtin_ia32_loaddquqi256_mask ((__v32qi *) __P, (__v32qi) _mm256_setzero_si256 (), (__mmask32) __U); } static __inline__ void __DEFAULT_FN_ATTRS _mm_mask_storeu_epi16 (void *__P, __mmask8 __U, __m128i __A) { __builtin_ia32_storedquhi128_mask ((__v8hi *) __P, (__v8hi) __A, (__mmask8) __U); } static __inline__ void __DEFAULT_FN_ATTRS _mm256_mask_storeu_epi16 (void *__P, __mmask16 __U, __m256i __A) { __builtin_ia32_storedquhi256_mask ((__v16hi *) __P, (__v16hi) __A, (__mmask16) __U); } static __inline__ void __DEFAULT_FN_ATTRS _mm_mask_storeu_epi8 (void *__P, __mmask16 __U, __m128i __A) { __builtin_ia32_storedquqi128_mask ((__v16qi *) __P, (__v16qi) __A, (__mmask16) __U); } static __inline__ void __DEFAULT_FN_ATTRS _mm256_mask_storeu_epi8 (void *__P, __mmask32 __U, __m256i __A) { __builtin_ia32_storedquqi256_mask ((__v32qi *) __P, (__v32qi) __A, (__mmask32) __U); } static __inline__ __mmask16 __DEFAULT_FN_ATTRS _mm_test_epi8_mask (__m128i __A, __m128i __B) { return _mm_cmpneq_epi8_mask (_mm_and_si128(__A, __B), _mm_setzero_hi()); } static __inline__ __mmask16 __DEFAULT_FN_ATTRS _mm_mask_test_epi8_mask (__mmask16 __U, __m128i __A, __m128i __B) { return _mm_mask_cmpneq_epi8_mask (__U, _mm_and_si128 (__A, __B), _mm_setzero_hi()); } static __inline__ __mmask32 __DEFAULT_FN_ATTRS _mm256_test_epi8_mask (__m256i __A, __m256i __B) { return _mm256_cmpneq_epi8_mask (_mm256_and_si256(__A, __B), _mm256_setzero_si256()); } static __inline__ __mmask32 __DEFAULT_FN_ATTRS _mm256_mask_test_epi8_mask (__mmask32 __U, __m256i __A, __m256i __B) { return _mm256_mask_cmpneq_epi8_mask (__U, _mm256_and_si256(__A, __B), _mm256_setzero_si256()); } static __inline__ __mmask8 __DEFAULT_FN_ATTRS _mm_test_epi16_mask (__m128i __A, __m128i __B) { return _mm_cmpneq_epi16_mask (_mm_and_si128 (__A, __B), _mm_setzero_hi()); } static __inline__ __mmask8 __DEFAULT_FN_ATTRS _mm_mask_test_epi16_mask (__mmask8 __U, __m128i __A, __m128i __B) { return _mm_mask_cmpneq_epi16_mask (__U, _mm_and_si128 (__A, __B), _mm_setzero_hi()); } static __inline__ __mmask16 __DEFAULT_FN_ATTRS _mm256_test_epi16_mask (__m256i __A, __m256i __B) { return _mm256_cmpneq_epi16_mask (_mm256_and_si256 (__A, __B), _mm256_setzero_si256 ()); } static __inline__ __mmask16 __DEFAULT_FN_ATTRS _mm256_mask_test_epi16_mask (__mmask16 __U, __m256i __A, __m256i __B) { return _mm256_mask_cmpneq_epi16_mask (__U, _mm256_and_si256(__A, __B), _mm256_setzero_si256()); } static __inline__ __mmask16 __DEFAULT_FN_ATTRS _mm_testn_epi8_mask (__m128i __A, __m128i __B) { return _mm_cmpeq_epi8_mask (_mm_and_si128 (__A, __B), _mm_setzero_hi()); } static __inline__ __mmask16 __DEFAULT_FN_ATTRS _mm_mask_testn_epi8_mask (__mmask16 __U, __m128i __A, __m128i __B) { return _mm_mask_cmpeq_epi8_mask (__U, _mm_and_si128 (__A, __B), _mm_setzero_hi()); } static __inline__ __mmask32 __DEFAULT_FN_ATTRS _mm256_testn_epi8_mask (__m256i __A, __m256i __B) { return _mm256_cmpeq_epi8_mask (_mm256_and_si256 (__A, __B), _mm256_setzero_si256()); } static __inline__ __mmask32 __DEFAULT_FN_ATTRS _mm256_mask_testn_epi8_mask (__mmask32 __U, __m256i __A, __m256i __B) { return _mm256_mask_cmpeq_epi8_mask (__U, _mm256_and_si256 (__A, __B), _mm256_setzero_si256()); } static __inline__ __mmask8 __DEFAULT_FN_ATTRS _mm_testn_epi16_mask (__m128i __A, __m128i __B) { return _mm_cmpeq_epi16_mask (_mm_and_si128 (__A, __B), _mm_setzero_hi()); } static __inline__ __mmask8 __DEFAULT_FN_ATTRS _mm_mask_testn_epi16_mask (__mmask8 __U, __m128i __A, __m128i __B) { return _mm_mask_cmpeq_epi16_mask (__U, _mm_and_si128(__A, __B), _mm_setzero_hi()); } static __inline__ __mmask16 __DEFAULT_FN_ATTRS _mm256_testn_epi16_mask (__m256i __A, __m256i __B) { return _mm256_cmpeq_epi16_mask (_mm256_and_si256(__A, __B), _mm256_setzero_si256()); } static __inline__ __mmask16 __DEFAULT_FN_ATTRS _mm256_mask_testn_epi16_mask (__mmask16 __U, __m256i __A, __m256i __B) { return _mm256_mask_cmpeq_epi16_mask (__U, _mm256_and_si256 (__A, __B), _mm256_setzero_si256()); } static __inline__ __mmask16 __DEFAULT_FN_ATTRS _mm_movepi8_mask (__m128i __A) { return (__mmask16) __builtin_ia32_cvtb2mask128 ((__v16qi) __A); } static __inline__ __mmask32 __DEFAULT_FN_ATTRS _mm256_movepi8_mask (__m256i __A) { return (__mmask32) __builtin_ia32_cvtb2mask256 ((__v32qi) __A); } static __inline__ __mmask8 __DEFAULT_FN_ATTRS _mm_movepi16_mask (__m128i __A) { return (__mmask8) __builtin_ia32_cvtw2mask128 ((__v8hi) __A); } static __inline__ __mmask16 __DEFAULT_FN_ATTRS _mm256_movepi16_mask (__m256i __A) { return (__mmask16) __builtin_ia32_cvtw2mask256 ((__v16hi) __A); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_movm_epi8 (__mmask16 __A) { return (__m128i) __builtin_ia32_cvtmask2b128 (__A); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_movm_epi8 (__mmask32 __A) { return (__m256i) __builtin_ia32_cvtmask2b256 (__A); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_movm_epi16 (__mmask8 __A) { return (__m128i) __builtin_ia32_cvtmask2w128 (__A); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_movm_epi16 (__mmask16 __A) { return (__m256i) __builtin_ia32_cvtmask2w256 (__A); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_broadcastb_epi8 (__m128i __O, __mmask16 __M, __m128i __A) { return (__m128i)__builtin_ia32_selectb_128(__M, (__v16qi) _mm_broadcastb_epi8(__A), (__v16qi) __O); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_broadcastb_epi8 (__mmask16 __M, __m128i __A) { return (__m128i)__builtin_ia32_selectb_128(__M, (__v16qi) _mm_broadcastb_epi8(__A), (__v16qi) _mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_broadcastb_epi8 (__m256i __O, __mmask32 __M, __m128i __A) { return (__m256i)__builtin_ia32_selectb_256(__M, (__v32qi) _mm256_broadcastb_epi8(__A), (__v32qi) __O); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_broadcastb_epi8 (__mmask32 __M, __m128i __A) { return (__m256i)__builtin_ia32_selectb_256(__M, (__v32qi) _mm256_broadcastb_epi8(__A), (__v32qi) _mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_broadcastw_epi16 (__m128i __O, __mmask8 __M, __m128i __A) { return (__m128i)__builtin_ia32_selectw_128(__M, (__v8hi) _mm_broadcastw_epi16(__A), (__v8hi) __O); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_broadcastw_epi16 (__mmask8 __M, __m128i __A) { return (__m128i)__builtin_ia32_selectw_128(__M, (__v8hi) _mm_broadcastw_epi16(__A), (__v8hi) _mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_broadcastw_epi16 (__m256i __O, __mmask16 __M, __m128i __A) { return (__m256i)__builtin_ia32_selectw_256(__M, (__v16hi) _mm256_broadcastw_epi16(__A), (__v16hi) __O); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_broadcastw_epi16 (__mmask16 __M, __m128i __A) { return (__m256i)__builtin_ia32_selectw_256(__M, (__v16hi) _mm256_broadcastw_epi16(__A), (__v16hi) _mm256_setzero_si256()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_set1_epi16 (__m256i __O, __mmask16 __M, short __A) { return (__m256i) __builtin_ia32_selectw_256 (__M, (__v16hi) _mm256_set1_epi16(__A), (__v16hi) __O); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_set1_epi16 (__mmask16 __M, short __A) { return (__m256i) __builtin_ia32_selectw_256(__M, (__v16hi)_mm256_set1_epi16(__A), (__v16hi) _mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_set1_epi16 (__m128i __O, __mmask8 __M, short __A) { return (__m128i) __builtin_ia32_selectw_128(__M, (__v8hi) _mm_set1_epi16(__A), (__v8hi) __O); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_set1_epi16 (__mmask8 __M, short __A) { return (__m128i) __builtin_ia32_selectw_128(__M, (__v8hi) _mm_set1_epi16(__A), (__v8hi) _mm_setzero_si128()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_permutexvar_epi16 (__m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_permvarhi128_mask ((__v8hi) __B, (__v8hi) __A, (__v8hi) _mm_undefined_si128 (), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_permutexvar_epi16 (__mmask8 __M, __m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_permvarhi128_mask ((__v8hi) __B, (__v8hi) __A, (__v8hi) _mm_setzero_si128 (), (__mmask8) __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_permutexvar_epi16 (__m128i __W, __mmask8 __M, __m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_permvarhi128_mask ((__v8hi) __B, (__v8hi) __A, (__v8hi) __W, (__mmask8) __M); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_permutexvar_epi16 (__m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_permvarhi256_mask ((__v16hi) __B, (__v16hi) __A, (__v16hi) _mm256_undefined_si256 (), (__mmask16) -1); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_permutexvar_epi16 (__mmask16 __M, __m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_permvarhi256_mask ((__v16hi) __B, (__v16hi) __A, (__v16hi) _mm256_setzero_si256 (), (__mmask16) __M); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_permutexvar_epi16 (__m256i __W, __mmask16 __M, __m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_permvarhi256_mask ((__v16hi) __B, (__v16hi) __A, (__v16hi) __W, (__mmask16) __M); } #define _mm_mask_alignr_epi8(W, U, A, B, N) __extension__ ({ \ (__m128i)__builtin_ia32_selectb_128((__mmask16)(U), \ (__v16qi)_mm_alignr_epi8((A), (B), (int)(N)), \ (__v16qi)(__m128i)(W)); }) #define _mm_maskz_alignr_epi8(U, A, B, N) __extension__ ({ \ (__m128i)__builtin_ia32_selectb_128((__mmask16)(U), \ (__v16qi)_mm_alignr_epi8((A), (B), (int)(N)), \ (__v16qi)_mm_setzero_si128()); }) #define _mm256_mask_alignr_epi8(W, U, A, B, N) __extension__ ({ \ (__m256i)__builtin_ia32_selectb_256((__mmask32)(U), \ (__v32qi)_mm256_alignr_epi8((A), (B), (int)(N)), \ (__v32qi)(__m256i)(W)); }) #define _mm256_maskz_alignr_epi8(U, A, B, N) __extension__ ({ \ (__m256i)__builtin_ia32_selectb_256((__mmask32)(U), \ (__v32qi)_mm256_alignr_epi8((A), (B), (int)(N)), \ (__v32qi)_mm256_setzero_si256()); }) #define _mm_dbsad_epu8(A, B, imm) __extension__ ({ \ (__m128i)__builtin_ia32_dbpsadbw128_mask((__v16qi)(__m128i)(A), \ (__v16qi)(__m128i)(B), (int)(imm), \ (__v8hi)_mm_setzero_hi(), \ (__mmask8)-1); }) #define _mm_mask_dbsad_epu8(W, U, A, B, imm) __extension__ ({ \ (__m128i)__builtin_ia32_dbpsadbw128_mask((__v16qi)(__m128i)(A), \ (__v16qi)(__m128i)(B), (int)(imm), \ (__v8hi)(__m128i)(W), \ (__mmask8)(U)); }) #define _mm_maskz_dbsad_epu8(U, A, B, imm) __extension__ ({ \ (__m128i)__builtin_ia32_dbpsadbw128_mask((__v16qi)(__m128i)(A), \ (__v16qi)(__m128i)(B), (int)(imm), \ (__v8hi)_mm_setzero_si128(), \ (__mmask8)(U)); }) #define _mm256_dbsad_epu8(A, B, imm) __extension__ ({ \ (__m256i)__builtin_ia32_dbpsadbw256_mask((__v32qi)(__m256i)(A), \ (__v32qi)(__m256i)(B), (int)(imm), \ (__v16hi)_mm256_setzero_si256(), \ (__mmask16)-1); }) #define _mm256_mask_dbsad_epu8(W, U, A, B, imm) __extension__ ({ \ (__m256i)__builtin_ia32_dbpsadbw256_mask((__v32qi)(__m256i)(A), \ (__v32qi)(__m256i)(B), (int)(imm), \ (__v16hi)(__m256i)(W), \ (__mmask16)(U)); }) #define _mm256_maskz_dbsad_epu8(U, A, B, imm) __extension__ ({ \ (__m256i)__builtin_ia32_dbpsadbw256_mask((__v32qi)(__m256i)(A), \ (__v32qi)(__m256i)(B), (int)(imm), \ (__v16hi)_mm256_setzero_si256(), \ (__mmask16)(U)); }) #undef __DEFAULT_FN_ATTRS #endif /* __AVX512VLBWINTRIN_H */ # 2782 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512vlbwintrin.h" 3 # 191 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 2 3 #endif # 192 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || \ (defined(__AVX512VL__) && defined(__AVX512CD__)) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 195 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512vlcdintrin.h" 1 3 /*===---- avx512vlcdintrin.h - AVX512VL and AVX512CD intrinsics ---------------------------=== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __IMMINTRIN_H #error "Never use directly; include instead." #endif # 26 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512vlcdintrin.h" 3 #ifndef __AVX512VLCDINTRIN_H #define __AVX512VLCDINTRIN_H /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("avx512vl,avx512cd"))) static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_broadcastmb_epi64 (__mmask8 __A) { return (__m128i) _mm_set1_epi64x((long long) __A); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_broadcastmb_epi64 (__mmask8 __A) { return (__m256i) _mm256_set1_epi64x((long long)__A); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_broadcastmw_epi32 (__mmask16 __A) { return (__m128i) _mm_set1_epi32((int)__A); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_broadcastmw_epi32 (__mmask16 __A) { return (__m256i) _mm256_set1_epi32((int)__A); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_conflict_epi64 (__m128i __A) { return (__m128i) __builtin_ia32_vpconflictdi_128_mask ((__v2di) __A, (__v2di) _mm_undefined_si128 (), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_conflict_epi64 (__m128i __W, __mmask8 __U, __m128i __A) { return (__m128i) __builtin_ia32_vpconflictdi_128_mask ((__v2di) __A, (__v2di) __W, (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_conflict_epi64 (__mmask8 __U, __m128i __A) { return (__m128i) __builtin_ia32_vpconflictdi_128_mask ((__v2di) __A, (__v2di) _mm_setzero_di (), (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_conflict_epi64 (__m256i __A) { return (__m256i) __builtin_ia32_vpconflictdi_256_mask ((__v4di) __A, (__v4di) _mm256_undefined_si256 (), (__mmask8) -1); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_conflict_epi64 (__m256i __W, __mmask8 __U, __m256i __A) { return (__m256i) __builtin_ia32_vpconflictdi_256_mask ((__v4di) __A, (__v4di) __W, (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_conflict_epi64 (__mmask8 __U, __m256i __A) { return (__m256i) __builtin_ia32_vpconflictdi_256_mask ((__v4di) __A, (__v4di) _mm256_setzero_si256 (), (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_conflict_epi32 (__m128i __A) { return (__m128i) __builtin_ia32_vpconflictsi_128_mask ((__v4si) __A, (__v4si) _mm_undefined_si128 (), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_conflict_epi32 (__m128i __W, __mmask8 __U, __m128i __A) { return (__m128i) __builtin_ia32_vpconflictsi_128_mask ((__v4si) __A, (__v4si) __W, (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_conflict_epi32 (__mmask8 __U, __m128i __A) { return (__m128i) __builtin_ia32_vpconflictsi_128_mask ((__v4si) __A, (__v4si) _mm_setzero_si128 (), (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_conflict_epi32 (__m256i __A) { return (__m256i) __builtin_ia32_vpconflictsi_256_mask ((__v8si) __A, (__v8si) _mm256_undefined_si256 (), (__mmask8) -1); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_conflict_epi32 (__m256i __W, __mmask8 __U, __m256i __A) { return (__m256i) __builtin_ia32_vpconflictsi_256_mask ((__v8si) __A, (__v8si) __W, (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_conflict_epi32 (__mmask8 __U, __m256i __A) { return (__m256i) __builtin_ia32_vpconflictsi_256_mask ((__v8si) __A, (__v8si) _mm256_setzero_si256 (), (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_lzcnt_epi32 (__m128i __A) { return (__m128i) __builtin_ia32_vplzcntd_128_mask ((__v4si) __A, (__v4si) _mm_setzero_si128 (), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_lzcnt_epi32 (__m128i __W, __mmask8 __U, __m128i __A) { return (__m128i) __builtin_ia32_vplzcntd_128_mask ((__v4si) __A, (__v4si) __W, (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_lzcnt_epi32 (__mmask8 __U, __m128i __A) { return (__m128i) __builtin_ia32_vplzcntd_128_mask ((__v4si) __A, (__v4si) _mm_setzero_si128 (), (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_lzcnt_epi32 (__m256i __A) { return (__m256i) __builtin_ia32_vplzcntd_256_mask ((__v8si) __A, (__v8si) _mm256_setzero_si256 (), (__mmask8) -1); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_lzcnt_epi32 (__m256i __W, __mmask8 __U, __m256i __A) { return (__m256i) __builtin_ia32_vplzcntd_256_mask ((__v8si) __A, (__v8si) __W, (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_lzcnt_epi32 (__mmask8 __U, __m256i __A) { return (__m256i) __builtin_ia32_vplzcntd_256_mask ((__v8si) __A, (__v8si) _mm256_setzero_si256 (), (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_lzcnt_epi64 (__m128i __A) { return (__m128i) __builtin_ia32_vplzcntq_128_mask ((__v2di) __A, (__v2di) _mm_setzero_di (), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_lzcnt_epi64 (__m128i __W, __mmask8 __U, __m128i __A) { return (__m128i) __builtin_ia32_vplzcntq_128_mask ((__v2di) __A, (__v2di) __W, (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_lzcnt_epi64 (__mmask8 __U, __m128i __A) { return (__m128i) __builtin_ia32_vplzcntq_128_mask ((__v2di) __A, (__v2di) _mm_setzero_di (), (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_lzcnt_epi64 (__m256i __A) { return (__m256i) __builtin_ia32_vplzcntq_256_mask ((__v4di) __A, (__v4di) _mm256_setzero_si256 (), (__mmask8) -1); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_lzcnt_epi64 (__m256i __W, __mmask8 __U, __m256i __A) { return (__m256i) __builtin_ia32_vplzcntq_256_mask ((__v4di) __A, (__v4di) __W, (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_lzcnt_epi64 (__mmask8 __U, __m256i __A) { return (__m256i) __builtin_ia32_vplzcntq_256_mask ((__v4di) __A, (__v4di) _mm256_setzero_si256 (), (__mmask8) __U); } #undef __DEFAULT_FN_ATTRS #endif /* __AVX512VLCDINTRIN_H */ # 264 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512vlcdintrin.h" 3 # 196 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 2 3 #endif # 197 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || \ (defined(__AVX512VL__) && defined(__AVX512DQ__)) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 200 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512vldqintrin.h" 1 3 /*===---- avx512vldqintrin.h - AVX512VL and AVX512DQ intrinsics ------------=== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __IMMINTRIN_H #error "Never use directly; include instead." #endif # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512vldqintrin.h" 3 #ifndef __AVX512VLDQINTRIN_H #define __AVX512VLDQINTRIN_H /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("avx512vl,avx512dq"))) static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mullo_epi64 (__m256i __A, __m256i __B) { return (__m256i) ((__v4du) __A * (__v4du) __B); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_mullo_epi64(__m256i __W, __mmask8 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U, (__v4di)_mm256_mullo_epi64(__A, __B), (__v4di)__W); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_mullo_epi64(__mmask8 __U, __m256i __A, __m256i __B) { return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U, (__v4di)_mm256_mullo_epi64(__A, __B), (__v4di)_mm256_setzero_si256()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mullo_epi64 (__m128i __A, __m128i __B) { return (__m128i) ((__v2du) __A * (__v2du) __B); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_mullo_epi64(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U, (__v2di)_mm_mullo_epi64(__A, __B), (__v2di)__W); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_mullo_epi64(__mmask8 __U, __m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U, (__v2di)_mm_mullo_epi64(__A, __B), (__v2di)_mm_setzero_si128()); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_mask_andnot_pd(__m256d __W, __mmask8 __U, __m256d __A, __m256d __B) { return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U, (__v4df)_mm256_andnot_pd(__A, __B), (__v4df)__W); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_maskz_andnot_pd(__mmask8 __U, __m256d __A, __m256d __B) { return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U, (__v4df)_mm256_andnot_pd(__A, __B), (__v4df)_mm256_setzero_pd()); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask_andnot_pd(__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U, (__v2df)_mm_andnot_pd(__A, __B), (__v2df)__W); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_maskz_andnot_pd(__mmask8 __U, __m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U, (__v2df)_mm_andnot_pd(__A, __B), (__v2df)_mm_setzero_pd()); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_mask_andnot_ps(__m256 __W, __mmask8 __U, __m256 __A, __m256 __B) { return (__m256)__builtin_ia32_selectps_256((__mmask8)__U, (__v8sf)_mm256_andnot_ps(__A, __B), (__v8sf)__W); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_maskz_andnot_ps(__mmask8 __U, __m256 __A, __m256 __B) { return (__m256)__builtin_ia32_selectps_256((__mmask8)__U, (__v8sf)_mm256_andnot_ps(__A, __B), (__v8sf)_mm256_setzero_ps()); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask_andnot_ps(__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) { return (__m128)__builtin_ia32_selectps_128((__mmask8)__U, (__v4sf)_mm_andnot_ps(__A, __B), (__v4sf)__W); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maskz_andnot_ps(__mmask8 __U, __m128 __A, __m128 __B) { return (__m128)__builtin_ia32_selectps_128((__mmask8)__U, (__v4sf)_mm_andnot_ps(__A, __B), (__v4sf)_mm_setzero_ps()); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_mask_and_pd(__m256d __W, __mmask8 __U, __m256d __A, __m256d __B) { return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U, (__v4df)_mm256_and_pd(__A, __B), (__v4df)__W); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_maskz_and_pd(__mmask8 __U, __m256d __A, __m256d __B) { return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U, (__v4df)_mm256_and_pd(__A, __B), (__v4df)_mm256_setzero_pd()); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask_and_pd(__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U, (__v2df)_mm_and_pd(__A, __B), (__v2df)__W); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_maskz_and_pd(__mmask8 __U, __m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U, (__v2df)_mm_and_pd(__A, __B), (__v2df)_mm_setzero_pd()); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_mask_and_ps(__m256 __W, __mmask8 __U, __m256 __A, __m256 __B) { return (__m256)__builtin_ia32_selectps_256((__mmask8)__U, (__v8sf)_mm256_and_ps(__A, __B), (__v8sf)__W); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_maskz_and_ps(__mmask8 __U, __m256 __A, __m256 __B) { return (__m256)__builtin_ia32_selectps_256((__mmask8)__U, (__v8sf)_mm256_and_ps(__A, __B), (__v8sf)_mm256_setzero_ps()); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask_and_ps(__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) { return (__m128)__builtin_ia32_selectps_128((__mmask8)__U, (__v4sf)_mm_and_ps(__A, __B), (__v4sf)__W); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maskz_and_ps(__mmask8 __U, __m128 __A, __m128 __B) { return (__m128)__builtin_ia32_selectps_128((__mmask8)__U, (__v4sf)_mm_and_ps(__A, __B), (__v4sf)_mm_setzero_ps()); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_mask_xor_pd(__m256d __W, __mmask8 __U, __m256d __A, __m256d __B) { return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U, (__v4df)_mm256_xor_pd(__A, __B), (__v4df)__W); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_maskz_xor_pd(__mmask8 __U, __m256d __A, __m256d __B) { return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U, (__v4df)_mm256_xor_pd(__A, __B), (__v4df)_mm256_setzero_pd()); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask_xor_pd(__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U, (__v2df)_mm_xor_pd(__A, __B), (__v2df)__W); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_maskz_xor_pd (__mmask8 __U, __m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U, (__v2df)_mm_xor_pd(__A, __B), (__v2df)_mm_setzero_pd()); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_mask_xor_ps(__m256 __W, __mmask8 __U, __m256 __A, __m256 __B) { return (__m256)__builtin_ia32_selectps_256((__mmask8)__U, (__v8sf)_mm256_xor_ps(__A, __B), (__v8sf)__W); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_maskz_xor_ps(__mmask8 __U, __m256 __A, __m256 __B) { return (__m256)__builtin_ia32_selectps_256((__mmask8)__U, (__v8sf)_mm256_xor_ps(__A, __B), (__v8sf)_mm256_setzero_ps()); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask_xor_ps(__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) { return (__m128)__builtin_ia32_selectps_128((__mmask8)__U, (__v4sf)_mm_xor_ps(__A, __B), (__v4sf)__W); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maskz_xor_ps(__mmask8 __U, __m128 __A, __m128 __B) { return (__m128)__builtin_ia32_selectps_128((__mmask8)__U, (__v4sf)_mm_xor_ps(__A, __B), (__v4sf)_mm_setzero_ps()); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_mask_or_pd(__m256d __W, __mmask8 __U, __m256d __A, __m256d __B) { return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U, (__v4df)_mm256_or_pd(__A, __B), (__v4df)__W); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_maskz_or_pd(__mmask8 __U, __m256d __A, __m256d __B) { return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U, (__v4df)_mm256_or_pd(__A, __B), (__v4df)_mm256_setzero_pd()); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask_or_pd(__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U, (__v2df)_mm_or_pd(__A, __B), (__v2df)__W); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_maskz_or_pd(__mmask8 __U, __m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U, (__v2df)_mm_or_pd(__A, __B), (__v2df)_mm_setzero_pd()); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_mask_or_ps(__m256 __W, __mmask8 __U, __m256 __A, __m256 __B) { return (__m256)__builtin_ia32_selectps_256((__mmask8)__U, (__v8sf)_mm256_or_ps(__A, __B), (__v8sf)__W); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_maskz_or_ps(__mmask8 __U, __m256 __A, __m256 __B) { return (__m256)__builtin_ia32_selectps_256((__mmask8)__U, (__v8sf)_mm256_or_ps(__A, __B), (__v8sf)_mm256_setzero_ps()); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask_or_ps(__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) { return (__m128)__builtin_ia32_selectps_128((__mmask8)__U, (__v4sf)_mm_or_ps(__A, __B), (__v4sf)__W); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maskz_or_ps(__mmask8 __U, __m128 __A, __m128 __B) { return (__m128)__builtin_ia32_selectps_128((__mmask8)__U, (__v4sf)_mm_or_ps(__A, __B), (__v4sf)_mm_setzero_ps()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtpd_epi64 (__m128d __A) { return (__m128i) __builtin_ia32_cvtpd2qq128_mask ((__v2df) __A, (__v2di) _mm_setzero_si128(), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_cvtpd_epi64 (__m128i __W, __mmask8 __U, __m128d __A) { return (__m128i) __builtin_ia32_cvtpd2qq128_mask ((__v2df) __A, (__v2di) __W, (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_cvtpd_epi64 (__mmask8 __U, __m128d __A) { return (__m128i) __builtin_ia32_cvtpd2qq128_mask ((__v2df) __A, (__v2di) _mm_setzero_si128(), (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_cvtpd_epi64 (__m256d __A) { return (__m256i) __builtin_ia32_cvtpd2qq256_mask ((__v4df) __A, (__v4di) _mm256_setzero_si256(), (__mmask8) -1); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_cvtpd_epi64 (__m256i __W, __mmask8 __U, __m256d __A) { return (__m256i) __builtin_ia32_cvtpd2qq256_mask ((__v4df) __A, (__v4di) __W, (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_cvtpd_epi64 (__mmask8 __U, __m256d __A) { return (__m256i) __builtin_ia32_cvtpd2qq256_mask ((__v4df) __A, (__v4di) _mm256_setzero_si256(), (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtpd_epu64 (__m128d __A) { return (__m128i) __builtin_ia32_cvtpd2uqq128_mask ((__v2df) __A, (__v2di) _mm_setzero_si128(), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_cvtpd_epu64 (__m128i __W, __mmask8 __U, __m128d __A) { return (__m128i) __builtin_ia32_cvtpd2uqq128_mask ((__v2df) __A, (__v2di) __W, (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_cvtpd_epu64 (__mmask8 __U, __m128d __A) { return (__m128i) __builtin_ia32_cvtpd2uqq128_mask ((__v2df) __A, (__v2di) _mm_setzero_si128(), (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_cvtpd_epu64 (__m256d __A) { return (__m256i) __builtin_ia32_cvtpd2uqq256_mask ((__v4df) __A, (__v4di) _mm256_setzero_si256(), (__mmask8) -1); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_cvtpd_epu64 (__m256i __W, __mmask8 __U, __m256d __A) { return (__m256i) __builtin_ia32_cvtpd2uqq256_mask ((__v4df) __A, (__v4di) __W, (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_cvtpd_epu64 (__mmask8 __U, __m256d __A) { return (__m256i) __builtin_ia32_cvtpd2uqq256_mask ((__v4df) __A, (__v4di) _mm256_setzero_si256(), (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtps_epi64 (__m128 __A) { return (__m128i) __builtin_ia32_cvtps2qq128_mask ((__v4sf) __A, (__v2di) _mm_setzero_si128(), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_cvtps_epi64 (__m128i __W, __mmask8 __U, __m128 __A) { return (__m128i) __builtin_ia32_cvtps2qq128_mask ((__v4sf) __A, (__v2di) __W, (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_cvtps_epi64 (__mmask8 __U, __m128 __A) { return (__m128i) __builtin_ia32_cvtps2qq128_mask ((__v4sf) __A, (__v2di) _mm_setzero_si128(), (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_cvtps_epi64 (__m128 __A) { return (__m256i) __builtin_ia32_cvtps2qq256_mask ((__v4sf) __A, (__v4di) _mm256_setzero_si256(), (__mmask8) -1); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_cvtps_epi64 (__m256i __W, __mmask8 __U, __m128 __A) { return (__m256i) __builtin_ia32_cvtps2qq256_mask ((__v4sf) __A, (__v4di) __W, (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_cvtps_epi64 (__mmask8 __U, __m128 __A) { return (__m256i) __builtin_ia32_cvtps2qq256_mask ((__v4sf) __A, (__v4di) _mm256_setzero_si256(), (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvtps_epu64 (__m128 __A) { return (__m128i) __builtin_ia32_cvtps2uqq128_mask ((__v4sf) __A, (__v2di) _mm_setzero_si128(), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_cvtps_epu64 (__m128i __W, __mmask8 __U, __m128 __A) { return (__m128i) __builtin_ia32_cvtps2uqq128_mask ((__v4sf) __A, (__v2di) __W, (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_cvtps_epu64 (__mmask8 __U, __m128 __A) { return (__m128i) __builtin_ia32_cvtps2uqq128_mask ((__v4sf) __A, (__v2di) _mm_setzero_si128(), (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_cvtps_epu64 (__m128 __A) { return (__m256i) __builtin_ia32_cvtps2uqq256_mask ((__v4sf) __A, (__v4di) _mm256_setzero_si256(), (__mmask8) -1); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_cvtps_epu64 (__m256i __W, __mmask8 __U, __m128 __A) { return (__m256i) __builtin_ia32_cvtps2uqq256_mask ((__v4sf) __A, (__v4di) __W, (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_cvtps_epu64 (__mmask8 __U, __m128 __A) { return (__m256i) __builtin_ia32_cvtps2uqq256_mask ((__v4sf) __A, (__v4di) _mm256_setzero_si256(), (__mmask8) __U); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cvtepi64_pd (__m128i __A) { return (__m128d) __builtin_ia32_cvtqq2pd128_mask ((__v2di) __A, (__v2df) _mm_setzero_pd(), (__mmask8) -1); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask_cvtepi64_pd (__m128d __W, __mmask8 __U, __m128i __A) { return (__m128d) __builtin_ia32_cvtqq2pd128_mask ((__v2di) __A, (__v2df) __W, (__mmask8) __U); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_maskz_cvtepi64_pd (__mmask8 __U, __m128i __A) { return (__m128d) __builtin_ia32_cvtqq2pd128_mask ((__v2di) __A, (__v2df) _mm_setzero_pd(), (__mmask8) __U); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_cvtepi64_pd (__m256i __A) { return (__m256d) __builtin_ia32_cvtqq2pd256_mask ((__v4di) __A, (__v4df) _mm256_setzero_pd(), (__mmask8) -1); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_mask_cvtepi64_pd (__m256d __W, __mmask8 __U, __m256i __A) { return (__m256d) __builtin_ia32_cvtqq2pd256_mask ((__v4di) __A, (__v4df) __W, (__mmask8) __U); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_maskz_cvtepi64_pd (__mmask8 __U, __m256i __A) { return (__m256d) __builtin_ia32_cvtqq2pd256_mask ((__v4di) __A, (__v4df) _mm256_setzero_pd(), (__mmask8) __U); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cvtepi64_ps (__m128i __A) { return (__m128) __builtin_ia32_cvtqq2ps128_mask ((__v2di) __A, (__v4sf) _mm_setzero_ps(), (__mmask8) -1); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask_cvtepi64_ps (__m128 __W, __mmask8 __U, __m128i __A) { return (__m128) __builtin_ia32_cvtqq2ps128_mask ((__v2di) __A, (__v4sf) __W, (__mmask8) __U); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maskz_cvtepi64_ps (__mmask8 __U, __m128i __A) { return (__m128) __builtin_ia32_cvtqq2ps128_mask ((__v2di) __A, (__v4sf) _mm_setzero_ps(), (__mmask8) __U); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm256_cvtepi64_ps (__m256i __A) { return (__m128) __builtin_ia32_cvtqq2ps256_mask ((__v4di) __A, (__v4sf) _mm_setzero_ps(), (__mmask8) -1); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm256_mask_cvtepi64_ps (__m128 __W, __mmask8 __U, __m256i __A) { return (__m128) __builtin_ia32_cvtqq2ps256_mask ((__v4di) __A, (__v4sf) __W, (__mmask8) __U); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm256_maskz_cvtepi64_ps (__mmask8 __U, __m256i __A) { return (__m128) __builtin_ia32_cvtqq2ps256_mask ((__v4di) __A, (__v4sf) _mm_setzero_ps(), (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvttpd_epi64 (__m128d __A) { return (__m128i) __builtin_ia32_cvttpd2qq128_mask ((__v2df) __A, (__v2di) _mm_setzero_si128(), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_cvttpd_epi64 (__m128i __W, __mmask8 __U, __m128d __A) { return (__m128i) __builtin_ia32_cvttpd2qq128_mask ((__v2df) __A, (__v2di) __W, (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_cvttpd_epi64 (__mmask8 __U, __m128d __A) { return (__m128i) __builtin_ia32_cvttpd2qq128_mask ((__v2df) __A, (__v2di) _mm_setzero_si128(), (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_cvttpd_epi64 (__m256d __A) { return (__m256i) __builtin_ia32_cvttpd2qq256_mask ((__v4df) __A, (__v4di) _mm256_setzero_si256(), (__mmask8) -1); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_cvttpd_epi64 (__m256i __W, __mmask8 __U, __m256d __A) { return (__m256i) __builtin_ia32_cvttpd2qq256_mask ((__v4df) __A, (__v4di) __W, (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_cvttpd_epi64 (__mmask8 __U, __m256d __A) { return (__m256i) __builtin_ia32_cvttpd2qq256_mask ((__v4df) __A, (__v4di) _mm256_setzero_si256(), (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvttpd_epu64 (__m128d __A) { return (__m128i) __builtin_ia32_cvttpd2uqq128_mask ((__v2df) __A, (__v2di) _mm_setzero_si128(), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_cvttpd_epu64 (__m128i __W, __mmask8 __U, __m128d __A) { return (__m128i) __builtin_ia32_cvttpd2uqq128_mask ((__v2df) __A, (__v2di) __W, (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_cvttpd_epu64 (__mmask8 __U, __m128d __A) { return (__m128i) __builtin_ia32_cvttpd2uqq128_mask ((__v2df) __A, (__v2di) _mm_setzero_si128(), (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_cvttpd_epu64 (__m256d __A) { return (__m256i) __builtin_ia32_cvttpd2uqq256_mask ((__v4df) __A, (__v4di) _mm256_setzero_si256(), (__mmask8) -1); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_cvttpd_epu64 (__m256i __W, __mmask8 __U, __m256d __A) { return (__m256i) __builtin_ia32_cvttpd2uqq256_mask ((__v4df) __A, (__v4di) __W, (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_cvttpd_epu64 (__mmask8 __U, __m256d __A) { return (__m256i) __builtin_ia32_cvttpd2uqq256_mask ((__v4df) __A, (__v4di) _mm256_setzero_si256(), (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvttps_epi64 (__m128 __A) { return (__m128i) __builtin_ia32_cvttps2qq128_mask ((__v4sf) __A, (__v2di) _mm_setzero_si128(), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_cvttps_epi64 (__m128i __W, __mmask8 __U, __m128 __A) { return (__m128i) __builtin_ia32_cvttps2qq128_mask ((__v4sf) __A, (__v2di) __W, (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_cvttps_epi64 (__mmask8 __U, __m128 __A) { return (__m128i) __builtin_ia32_cvttps2qq128_mask ((__v4sf) __A, (__v2di) _mm_setzero_si128(), (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_cvttps_epi64 (__m128 __A) { return (__m256i) __builtin_ia32_cvttps2qq256_mask ((__v4sf) __A, (__v4di) _mm256_setzero_si256(), (__mmask8) -1); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_cvttps_epi64 (__m256i __W, __mmask8 __U, __m128 __A) { return (__m256i) __builtin_ia32_cvttps2qq256_mask ((__v4sf) __A, (__v4di) __W, (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_cvttps_epi64 (__mmask8 __U, __m128 __A) { return (__m256i) __builtin_ia32_cvttps2qq256_mask ((__v4sf) __A, (__v4di) _mm256_setzero_si256(), (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cvttps_epu64 (__m128 __A) { return (__m128i) __builtin_ia32_cvttps2uqq128_mask ((__v4sf) __A, (__v2di) _mm_setzero_si128(), (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_cvttps_epu64 (__m128i __W, __mmask8 __U, __m128 __A) { return (__m128i) __builtin_ia32_cvttps2uqq128_mask ((__v4sf) __A, (__v2di) __W, (__mmask8) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_cvttps_epu64 (__mmask8 __U, __m128 __A) { return (__m128i) __builtin_ia32_cvttps2uqq128_mask ((__v4sf) __A, (__v2di) _mm_setzero_si128(), (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_cvttps_epu64 (__m128 __A) { return (__m256i) __builtin_ia32_cvttps2uqq256_mask ((__v4sf) __A, (__v4di) _mm256_setzero_si256(), (__mmask8) -1); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_cvttps_epu64 (__m256i __W, __mmask8 __U, __m128 __A) { return (__m256i) __builtin_ia32_cvttps2uqq256_mask ((__v4sf) __A, (__v4di) __W, (__mmask8) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_cvttps_epu64 (__mmask8 __U, __m128 __A) { return (__m256i) __builtin_ia32_cvttps2uqq256_mask ((__v4sf) __A, (__v4di) _mm256_setzero_si256(), (__mmask8) __U); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_cvtepu64_pd (__m128i __A) { return (__m128d) __builtin_ia32_cvtuqq2pd128_mask ((__v2di) __A, (__v2df) _mm_setzero_pd(), (__mmask8) -1); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_mask_cvtepu64_pd (__m128d __W, __mmask8 __U, __m128i __A) { return (__m128d) __builtin_ia32_cvtuqq2pd128_mask ((__v2di) __A, (__v2df) __W, (__mmask8) __U); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_maskz_cvtepu64_pd (__mmask8 __U, __m128i __A) { return (__m128d) __builtin_ia32_cvtuqq2pd128_mask ((__v2di) __A, (__v2df) _mm_setzero_pd(), (__mmask8) __U); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_cvtepu64_pd (__m256i __A) { return (__m256d) __builtin_ia32_cvtuqq2pd256_mask ((__v4di) __A, (__v4df) _mm256_setzero_pd(), (__mmask8) -1); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_mask_cvtepu64_pd (__m256d __W, __mmask8 __U, __m256i __A) { return (__m256d) __builtin_ia32_cvtuqq2pd256_mask ((__v4di) __A, (__v4df) __W, (__mmask8) __U); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_maskz_cvtepu64_pd (__mmask8 __U, __m256i __A) { return (__m256d) __builtin_ia32_cvtuqq2pd256_mask ((__v4di) __A, (__v4df) _mm256_setzero_pd(), (__mmask8) __U); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_cvtepu64_ps (__m128i __A) { return (__m128) __builtin_ia32_cvtuqq2ps128_mask ((__v2di) __A, (__v4sf) _mm_setzero_ps(), (__mmask8) -1); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_mask_cvtepu64_ps (__m128 __W, __mmask8 __U, __m128i __A) { return (__m128) __builtin_ia32_cvtuqq2ps128_mask ((__v2di) __A, (__v4sf) __W, (__mmask8) __U); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maskz_cvtepu64_ps (__mmask8 __U, __m128i __A) { return (__m128) __builtin_ia32_cvtuqq2ps128_mask ((__v2di) __A, (__v4sf) _mm_setzero_ps(), (__mmask8) __U); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm256_cvtepu64_ps (__m256i __A) { return (__m128) __builtin_ia32_cvtuqq2ps256_mask ((__v4di) __A, (__v4sf) _mm_setzero_ps(), (__mmask8) -1); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm256_mask_cvtepu64_ps (__m128 __W, __mmask8 __U, __m256i __A) { return (__m128) __builtin_ia32_cvtuqq2ps256_mask ((__v4di) __A, (__v4sf) __W, (__mmask8) __U); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm256_maskz_cvtepu64_ps (__mmask8 __U, __m256i __A) { return (__m128) __builtin_ia32_cvtuqq2ps256_mask ((__v4di) __A, (__v4sf) _mm_setzero_ps(), (__mmask8) __U); } #define _mm_range_pd(A, B, C) __extension__ ({ \ (__m128d)__builtin_ia32_rangepd128_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), (int)(C), \ (__v2df)_mm_setzero_pd(), \ (__mmask8)-1); }) #define _mm_mask_range_pd(W, U, A, B, C) __extension__ ({ \ (__m128d)__builtin_ia32_rangepd128_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), (int)(C), \ (__v2df)(__m128d)(W), \ (__mmask8)(U)); }) #define _mm_maskz_range_pd(U, A, B, C) __extension__ ({ \ (__m128d)__builtin_ia32_rangepd128_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), (int)(C), \ (__v2df)_mm_setzero_pd(), \ (__mmask8)(U)); }) #define _mm256_range_pd(A, B, C) __extension__ ({ \ (__m256d)__builtin_ia32_rangepd256_mask((__v4df)(__m256d)(A), \ (__v4df)(__m256d)(B), (int)(C), \ (__v4df)_mm256_setzero_pd(), \ (__mmask8)-1); }) #define _mm256_mask_range_pd(W, U, A, B, C) __extension__ ({ \ (__m256d)__builtin_ia32_rangepd256_mask((__v4df)(__m256d)(A), \ (__v4df)(__m256d)(B), (int)(C), \ (__v4df)(__m256d)(W), \ (__mmask8)(U)); }) #define _mm256_maskz_range_pd(U, A, B, C) __extension__ ({ \ (__m256d)__builtin_ia32_rangepd256_mask((__v4df)(__m256d)(A), \ (__v4df)(__m256d)(B), (int)(C), \ (__v4df)_mm256_setzero_pd(), \ (__mmask8)(U)); }) #define _mm_range_ps(A, B, C) __extension__ ({ \ (__m128)__builtin_ia32_rangeps128_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), (int)(C), \ (__v4sf)_mm_setzero_ps(), \ (__mmask8)-1); }) #define _mm_mask_range_ps(W, U, A, B, C) __extension__ ({ \ (__m128)__builtin_ia32_rangeps128_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), (int)(C), \ (__v4sf)(__m128)(W), (__mmask8)(U)); }) #define _mm_maskz_range_ps(U, A, B, C) __extension__ ({ \ (__m128)__builtin_ia32_rangeps128_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), (int)(C), \ (__v4sf)_mm_setzero_ps(), \ (__mmask8)(U)); }) #define _mm256_range_ps(A, B, C) __extension__ ({ \ (__m256)__builtin_ia32_rangeps256_mask((__v8sf)(__m256)(A), \ (__v8sf)(__m256)(B), (int)(C), \ (__v8sf)_mm256_setzero_ps(), \ (__mmask8)-1); }) #define _mm256_mask_range_ps(W, U, A, B, C) __extension__ ({ \ (__m256)__builtin_ia32_rangeps256_mask((__v8sf)(__m256)(A), \ (__v8sf)(__m256)(B), (int)(C), \ (__v8sf)(__m256)(W), (__mmask8)(U)); }) #define _mm256_maskz_range_ps(U, A, B, C) __extension__ ({ \ (__m256)__builtin_ia32_rangeps256_mask((__v8sf)(__m256)(A), \ (__v8sf)(__m256)(B), (int)(C), \ (__v8sf)_mm256_setzero_ps(), \ (__mmask8)(U)); }) #define _mm_reduce_pd(A, B) __extension__ ({ \ (__m128d)__builtin_ia32_reducepd128_mask((__v2df)(__m128d)(A), (int)(B), \ (__v2df)_mm_setzero_pd(), \ (__mmask8)-1); }) #define _mm_mask_reduce_pd(W, U, A, B) __extension__ ({ \ (__m128d)__builtin_ia32_reducepd128_mask((__v2df)(__m128d)(A), (int)(B), \ (__v2df)(__m128d)(W), \ (__mmask8)(U)); }) #define _mm_maskz_reduce_pd(U, A, B) __extension__ ({ \ (__m128d)__builtin_ia32_reducepd128_mask((__v2df)(__m128d)(A), (int)(B), \ (__v2df)_mm_setzero_pd(), \ (__mmask8)(U)); }) #define _mm256_reduce_pd(A, B) __extension__ ({ \ (__m256d)__builtin_ia32_reducepd256_mask((__v4df)(__m256d)(A), (int)(B), \ (__v4df)_mm256_setzero_pd(), \ (__mmask8)-1); }) #define _mm256_mask_reduce_pd(W, U, A, B) __extension__ ({ \ (__m256d)__builtin_ia32_reducepd256_mask((__v4df)(__m256d)(A), (int)(B), \ (__v4df)(__m256d)(W), \ (__mmask8)(U)); }) #define _mm256_maskz_reduce_pd(U, A, B) __extension__ ({ \ (__m256d)__builtin_ia32_reducepd256_mask((__v4df)(__m256d)(A), (int)(B), \ (__v4df)_mm256_setzero_pd(), \ (__mmask8)(U)); }) #define _mm_reduce_ps(A, B) __extension__ ({ \ (__m128)__builtin_ia32_reduceps128_mask((__v4sf)(__m128)(A), (int)(B), \ (__v4sf)_mm_setzero_ps(), \ (__mmask8)-1); }) #define _mm_mask_reduce_ps(W, U, A, B) __extension__ ({ \ (__m128)__builtin_ia32_reduceps128_mask((__v4sf)(__m128)(A), (int)(B), \ (__v4sf)(__m128)(W), \ (__mmask8)(U)); }) #define _mm_maskz_reduce_ps(U, A, B) __extension__ ({ \ (__m128)__builtin_ia32_reduceps128_mask((__v4sf)(__m128)(A), (int)(B), \ (__v4sf)_mm_setzero_ps(), \ (__mmask8)(U)); }) #define _mm256_reduce_ps(A, B) __extension__ ({ \ (__m256)__builtin_ia32_reduceps256_mask((__v8sf)(__m256)(A), (int)(B), \ (__v8sf)_mm256_setzero_ps(), \ (__mmask8)-1); }) #define _mm256_mask_reduce_ps(W, U, A, B) __extension__ ({ \ (__m256)__builtin_ia32_reduceps256_mask((__v8sf)(__m256)(A), (int)(B), \ (__v8sf)(__m256)(W), \ (__mmask8)(U)); }) #define _mm256_maskz_reduce_ps(U, A, B) __extension__ ({ \ (__m256)__builtin_ia32_reduceps256_mask((__v8sf)(__m256)(A), (int)(B), \ (__v8sf)_mm256_setzero_ps(), \ (__mmask8)(U)); }) static __inline__ __mmask8 __DEFAULT_FN_ATTRS _mm_movepi32_mask (__m128i __A) { return (__mmask8) __builtin_ia32_cvtd2mask128 ((__v4si) __A); } static __inline__ __mmask8 __DEFAULT_FN_ATTRS _mm256_movepi32_mask (__m256i __A) { return (__mmask8) __builtin_ia32_cvtd2mask256 ((__v8si) __A); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_movm_epi32 (__mmask8 __A) { return (__m128i) __builtin_ia32_cvtmask2d128 (__A); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_movm_epi32 (__mmask8 __A) { return (__m256i) __builtin_ia32_cvtmask2d256 (__A); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_movm_epi64 (__mmask8 __A) { return (__m128i) __builtin_ia32_cvtmask2q128 (__A); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_movm_epi64 (__mmask8 __A) { return (__m256i) __builtin_ia32_cvtmask2q256 (__A); } static __inline__ __mmask8 __DEFAULT_FN_ATTRS _mm_movepi64_mask (__m128i __A) { return (__mmask8) __builtin_ia32_cvtq2mask128 ((__v2di) __A); } static __inline__ __mmask8 __DEFAULT_FN_ATTRS _mm256_movepi64_mask (__m256i __A) { return (__mmask8) __builtin_ia32_cvtq2mask256 ((__v4di) __A); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_broadcast_f32x2 (__m128 __A) { return (__m256)__builtin_shufflevector((__v4sf)__A, (__v4sf)_mm_undefined_ps(), 0, 1, 0, 1, 0, 1, 0, 1); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_mask_broadcast_f32x2 (__m256 __O, __mmask8 __M, __m128 __A) { return (__m256)__builtin_ia32_selectps_256((__mmask8)__M, (__v8sf)_mm256_broadcast_f32x2(__A), (__v8sf)__O); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_maskz_broadcast_f32x2 (__mmask8 __M, __m128 __A) { return (__m256)__builtin_ia32_selectps_256((__mmask8)__M, (__v8sf)_mm256_broadcast_f32x2(__A), (__v8sf)_mm256_setzero_ps()); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_broadcast_f64x2(__m128d __A) { return (__m256d)__builtin_shufflevector((__v2df)__A, (__v2df)__A, 0, 1, 0, 1); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_mask_broadcast_f64x2(__m256d __O, __mmask8 __M, __m128d __A) { return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__M, (__v4df)_mm256_broadcast_f64x2(__A), (__v4df)__O); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_maskz_broadcast_f64x2 (__mmask8 __M, __m128d __A) { return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__M, (__v4df)_mm256_broadcast_f64x2(__A), (__v4df)_mm256_setzero_pd()); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_broadcast_i32x2 (__m128i __A) { return (__m128i)__builtin_shufflevector((__v4si)__A, (__v4si)_mm_undefined_si128(), 0, 1, 0, 1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_broadcast_i32x2 (__m128i __O, __mmask8 __M, __m128i __A) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__M, (__v4si)_mm_broadcast_i32x2(__A), (__v4si)__O); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_broadcast_i32x2 (__mmask8 __M, __m128i __A) { return (__m128i)__builtin_ia32_selectd_128((__mmask8)__M, (__v4si)_mm_broadcast_i32x2(__A), (__v4si)_mm_setzero_si128()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_broadcast_i32x2 (__m128i __A) { return (__m256i)__builtin_shufflevector((__v4si)__A, (__v4si)_mm_undefined_si128(), 0, 1, 0, 1, 0, 1, 0, 1); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_broadcast_i32x2 (__m256i __O, __mmask8 __M, __m128i __A) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__M, (__v8si)_mm256_broadcast_i32x2(__A), (__v8si)__O); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_broadcast_i32x2 (__mmask8 __M, __m128i __A) { return (__m256i)__builtin_ia32_selectd_256((__mmask8)__M, (__v8si)_mm256_broadcast_i32x2(__A), (__v8si)_mm256_setzero_si256()); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_broadcast_i64x2(__m128i __A) { return (__m256i)__builtin_shufflevector((__v2di)__A, (__v2di)__A, 0, 1, 0, 1); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_broadcast_i64x2(__m256i __O, __mmask8 __M, __m128i __A) { return (__m256i)__builtin_ia32_selectq_256((__mmask8)__M, (__v4di)_mm256_broadcast_i64x2(__A), (__v4di)__O); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_broadcast_i64x2 (__mmask8 __M, __m128i __A) { return (__m256i)__builtin_ia32_selectq_256((__mmask8)__M, (__v4di)_mm256_broadcast_i64x2(__A), (__v4di)_mm256_setzero_si256()); } #define _mm256_extractf64x2_pd(A, imm) __extension__ ({ \ (__m128d)__builtin_shufflevector((__v4df)(__m256d)(A), \ (__v4df)_mm256_undefined_pd(), \ ((imm) & 1) ? 2 : 0, \ ((imm) & 1) ? 3 : 1); }) #define _mm256_mask_extractf64x2_pd(W, U, A, imm) __extension__ ({ \ (__m128d)__builtin_ia32_selectpd_128((__mmask8)(U), \ (__v2df)_mm256_extractf64x2_pd((A), (imm)), \ (__v2df)(W)); }) #define _mm256_maskz_extractf64x2_pd(U, A, imm) __extension__ ({ \ (__m128d)__builtin_ia32_selectpd_128((__mmask8)(U), \ (__v2df)_mm256_extractf64x2_pd((A), (imm)), \ (__v2df)_mm_setzero_pd()); }) #define _mm256_extracti64x2_epi64(A, imm) __extension__ ({ \ (__m128i)__builtin_shufflevector((__v4di)(__m256i)(A), \ (__v4di)_mm256_undefined_si256(), \ ((imm) & 1) ? 2 : 0, \ ((imm) & 1) ? 3 : 1); }) #define _mm256_mask_extracti64x2_epi64(W, U, A, imm) __extension__ ({ \ (__m128i)__builtin_ia32_selectq_128((__mmask8)(U), \ (__v2di)_mm256_extracti64x2_epi64((A), (imm)), \ (__v2di)(W)); }) #define _mm256_maskz_extracti64x2_epi64(U, A, imm) __extension__ ({ \ (__m128i)__builtin_ia32_selectq_128((__mmask8)(U), \ (__v2di)_mm256_extracti64x2_epi64((A), (imm)), \ (__v2di)_mm_setzero_di()); }) #define _mm256_insertf64x2(A, B, imm) __extension__ ({ \ (__m256d)__builtin_shufflevector((__v4df)(A), \ (__v4df)_mm256_castpd128_pd256((__m128d)(B)), \ ((imm) & 0x1) ? 0 : 4, \ ((imm) & 0x1) ? 1 : 5, \ ((imm) & 0x1) ? 4 : 2, \ ((imm) & 0x1) ? 5 : 3); }) #define _mm256_mask_insertf64x2(W, U, A, B, imm) __extension__ ({ \ (__m256d)__builtin_ia32_selectpd_256((__mmask8)(U), \ (__v4df)_mm256_insertf64x2((A), (B), (imm)), \ (__v4df)(W)); }) #define _mm256_maskz_insertf64x2(U, A, B, imm) __extension__ ({ \ (__m256d)__builtin_ia32_selectpd_256((__mmask8)(U), \ (__v4df)_mm256_insertf64x2((A), (B), (imm)), \ (__v4df)_mm256_setzero_pd()); }) #define _mm256_inserti64x2(A, B, imm) __extension__ ({ \ (__m256i)__builtin_shufflevector((__v4di)(A), \ (__v4di)_mm256_castsi128_si256((__m128i)(B)), \ ((imm) & 0x1) ? 0 : 4, \ ((imm) & 0x1) ? 1 : 5, \ ((imm) & 0x1) ? 4 : 2, \ ((imm) & 0x1) ? 5 : 3); }) #define _mm256_mask_inserti64x2(W, U, A, B, imm) __extension__ ({ \ (__m256i)__builtin_ia32_selectq_256((__mmask8)(U), \ (__v4di)_mm256_inserti64x2((A), (B), (imm)), \ (__v4di)(W)); }) #define _mm256_maskz_inserti64x2(U, A, B, imm) __extension__ ({ \ (__m256i)__builtin_ia32_selectq_256((__mmask8)(U), \ (__v4di)_mm256_inserti64x2((A), (B), (imm)), \ (__v4di)_mm256_setzero_si256()); }) #define _mm_mask_fpclass_pd_mask(U, A, imm) __extension__ ({ \ (__mmask8)__builtin_ia32_fpclasspd128_mask((__v2df)(__m128d)(A), (int)(imm), \ (__mmask8)(U)); }) #define _mm_fpclass_pd_mask(A, imm) __extension__ ({ \ (__mmask8)__builtin_ia32_fpclasspd128_mask((__v2df)(__m128d)(A), (int)(imm), \ (__mmask8)-1); }) #define _mm256_mask_fpclass_pd_mask(U, A, imm) __extension__ ({ \ (__mmask8)__builtin_ia32_fpclasspd256_mask((__v4df)(__m256d)(A), (int)(imm), \ (__mmask8)(U)); }) #define _mm256_fpclass_pd_mask(A, imm) __extension__ ({ \ (__mmask8)__builtin_ia32_fpclasspd256_mask((__v4df)(__m256d)(A), (int)(imm), \ (__mmask8)-1); }) #define _mm_mask_fpclass_ps_mask(U, A, imm) __extension__ ({ \ (__mmask8)__builtin_ia32_fpclassps128_mask((__v4sf)(__m128)(A), (int)(imm), \ (__mmask8)(U)); }) #define _mm_fpclass_ps_mask(A, imm) __extension__ ({ \ (__mmask8)__builtin_ia32_fpclassps128_mask((__v4sf)(__m128)(A), (int)(imm), \ (__mmask8)-1); }) #define _mm256_mask_fpclass_ps_mask(U, A, imm) __extension__ ({ \ (__mmask8)__builtin_ia32_fpclassps256_mask((__v8sf)(__m256)(A), (int)(imm), \ (__mmask8)(U)); }) #define _mm256_fpclass_ps_mask(A, imm) __extension__ ({ \ (__mmask8)__builtin_ia32_fpclassps256_mask((__v8sf)(__m256)(A), (int)(imm), \ (__mmask8)-1); }) #undef __DEFAULT_FN_ATTRS #endif # 1199 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512vldqintrin.h" 3 # 201 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 2 3 #endif # 202 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || defined(__AVX512ER__) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 204 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512erintrin.h" 1 3 /*===---- avx512erintrin.h - AVX512ER intrinsics ---------------------------=== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __IMMINTRIN_H #error "Never use directly; include instead." #endif # 26 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512erintrin.h" 3 #ifndef __AVX512ERINTRIN_H #define __AVX512ERINTRIN_H // exp2a23 #define _mm512_exp2a23_round_pd(A, R) __extension__ ({ \ (__m512d)__builtin_ia32_exp2pd_mask((__v8df)(__m512d)(A), \ (__v8df)_mm512_setzero_pd(), \ (__mmask8)-1, (int)(R)); }) #define _mm512_mask_exp2a23_round_pd(S, M, A, R) __extension__ ({ \ (__m512d)__builtin_ia32_exp2pd_mask((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(S), (__mmask8)(M), \ (int)(R)); }) #define _mm512_maskz_exp2a23_round_pd(M, A, R) __extension__ ({ \ (__m512d)__builtin_ia32_exp2pd_mask((__v8df)(__m512d)(A), \ (__v8df)_mm512_setzero_pd(), \ (__mmask8)(M), (int)(R)); }) #define _mm512_exp2a23_pd(A) \ _mm512_exp2a23_round_pd((A), _MM_FROUND_CUR_DIRECTION) #define _mm512_mask_exp2a23_pd(S, M, A) \ _mm512_mask_exp2a23_round_pd((S), (M), (A), _MM_FROUND_CUR_DIRECTION) #define _mm512_maskz_exp2a23_pd(M, A) \ _mm512_maskz_exp2a23_round_pd((M), (A), _MM_FROUND_CUR_DIRECTION) #define _mm512_exp2a23_round_ps(A, R) __extension__ ({ \ (__m512)__builtin_ia32_exp2ps_mask((__v16sf)(__m512)(A), \ (__v16sf)_mm512_setzero_ps(), \ (__mmask16)-1, (int)(R)); }) #define _mm512_mask_exp2a23_round_ps(S, M, A, R) __extension__ ({ \ (__m512)__builtin_ia32_exp2ps_mask((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(S), (__mmask16)(M), \ (int)(R)); }) #define _mm512_maskz_exp2a23_round_ps(M, A, R) __extension__ ({ \ (__m512)__builtin_ia32_exp2ps_mask((__v16sf)(__m512)(A), \ (__v16sf)_mm512_setzero_ps(), \ (__mmask16)(M), (int)(R)); }) #define _mm512_exp2a23_ps(A) \ _mm512_exp2a23_round_ps((A), _MM_FROUND_CUR_DIRECTION) #define _mm512_mask_exp2a23_ps(S, M, A) \ _mm512_mask_exp2a23_round_ps((S), (M), (A), _MM_FROUND_CUR_DIRECTION) #define _mm512_maskz_exp2a23_ps(M, A) \ _mm512_maskz_exp2a23_round_ps((M), (A), _MM_FROUND_CUR_DIRECTION) // rsqrt28 #define _mm512_rsqrt28_round_pd(A, R) __extension__ ({ \ (__m512d)__builtin_ia32_rsqrt28pd_mask((__v8df)(__m512d)(A), \ (__v8df)_mm512_setzero_pd(), \ (__mmask8)-1, (int)(R)); }) #define _mm512_mask_rsqrt28_round_pd(S, M, A, R) __extension__ ({ \ (__m512d)__builtin_ia32_rsqrt28pd_mask((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(S), (__mmask8)(M), \ (int)(R)); }) #define _mm512_maskz_rsqrt28_round_pd(M, A, R) __extension__ ({ \ (__m512d)__builtin_ia32_rsqrt28pd_mask((__v8df)(__m512d)(A), \ (__v8df)_mm512_setzero_pd(), \ (__mmask8)(M), (int)(R)); }) #define _mm512_rsqrt28_pd(A) \ _mm512_rsqrt28_round_pd((A), _MM_FROUND_CUR_DIRECTION) #define _mm512_mask_rsqrt28_pd(S, M, A) \ _mm512_mask_rsqrt28_round_pd((S), (M), (A), _MM_FROUND_CUR_DIRECTION) #define _mm512_maskz_rsqrt28_pd(M, A) \ _mm512_maskz_rsqrt28_round_pd((M), (A), _MM_FROUND_CUR_DIRECTION) #define _mm512_rsqrt28_round_ps(A, R) __extension__ ({ \ (__m512)__builtin_ia32_rsqrt28ps_mask((__v16sf)(__m512)(A), \ (__v16sf)_mm512_setzero_ps(), \ (__mmask16)-1, (int)(R)); }) #define _mm512_mask_rsqrt28_round_ps(S, M, A, R) __extension__ ({ \ (__m512)__builtin_ia32_rsqrt28ps_mask((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(S), (__mmask16)(M), \ (int)(R)); }) #define _mm512_maskz_rsqrt28_round_ps(M, A, R) __extension__ ({ \ (__m512)__builtin_ia32_rsqrt28ps_mask((__v16sf)(__m512)(A), \ (__v16sf)_mm512_setzero_ps(), \ (__mmask16)(M), (int)(R)); }) #define _mm512_rsqrt28_ps(A) \ _mm512_rsqrt28_round_ps((A), _MM_FROUND_CUR_DIRECTION) #define _mm512_mask_rsqrt28_ps(S, M, A) \ _mm512_mask_rsqrt28_round_ps((S), (M), A, _MM_FROUND_CUR_DIRECTION) #define _mm512_maskz_rsqrt28_ps(M, A) \ _mm512_maskz_rsqrt28_round_ps((M), (A), _MM_FROUND_CUR_DIRECTION) #define _mm_rsqrt28_round_ss(A, B, R) __extension__ ({ \ (__m128)__builtin_ia32_rsqrt28ss_round_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4sf)_mm_setzero_ps(), \ (__mmask8)-1, (int)(R)); }) #define _mm_mask_rsqrt28_round_ss(S, M, A, B, R) __extension__ ({ \ (__m128)__builtin_ia32_rsqrt28ss_round_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4sf)(__m128)(S), \ (__mmask8)(M), (int)(R)); }) #define _mm_maskz_rsqrt28_round_ss(M, A, B, R) __extension__ ({ \ (__m128)__builtin_ia32_rsqrt28ss_round_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4sf)_mm_setzero_ps(), \ (__mmask8)(M), (int)(R)); }) #define _mm_rsqrt28_ss(A, B) \ _mm_rsqrt28_round_ss((A), (B), _MM_FROUND_CUR_DIRECTION) #define _mm_mask_rsqrt28_ss(S, M, A, B) \ _mm_mask_rsqrt28_round_ss((S), (M), (A), (B), _MM_FROUND_CUR_DIRECTION) #define _mm_maskz_rsqrt28_ss(M, A, B) \ _mm_maskz_rsqrt28_round_ss((M), (A), (B), _MM_FROUND_CUR_DIRECTION) #define _mm_rsqrt28_round_sd(A, B, R) __extension__ ({ \ (__m128d)__builtin_ia32_rsqrt28sd_round_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)_mm_setzero_pd(), \ (__mmask8)-1, (int)(R)); }) #define _mm_mask_rsqrt28_round_sd(S, M, A, B, R) __extension__ ({ \ (__m128d)__builtin_ia32_rsqrt28sd_round_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)(__m128d)(S), \ (__mmask8)(M), (int)(R)); }) #define _mm_maskz_rsqrt28_round_sd(M, A, B, R) __extension__ ({ \ (__m128d)__builtin_ia32_rsqrt28sd_round_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)_mm_setzero_pd(), \ (__mmask8)(M), (int)(R)); }) #define _mm_rsqrt28_sd(A, B) \ _mm_rsqrt28_round_sd((A), (B), _MM_FROUND_CUR_DIRECTION) #define _mm_mask_rsqrt28_sd(S, M, A, B) \ _mm_mask_rsqrt28_round_sd((S), (M), (A), (B), _MM_FROUND_CUR_DIRECTION) #define _mm_maskz_rsqrt28_sd(M, A, B) \ _mm_maskz_rsqrt28_round_sd((M), (A), (B), _MM_FROUND_CUR_DIRECTION) // rcp28 #define _mm512_rcp28_round_pd(A, R) __extension__ ({ \ (__m512d)__builtin_ia32_rcp28pd_mask((__v8df)(__m512d)(A), \ (__v8df)_mm512_setzero_pd(), \ (__mmask8)-1, (int)(R)); }) #define _mm512_mask_rcp28_round_pd(S, M, A, R) __extension__ ({ \ (__m512d)__builtin_ia32_rcp28pd_mask((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(S), (__mmask8)(M), \ (int)(R)); }) #define _mm512_maskz_rcp28_round_pd(M, A, R) __extension__ ({ \ (__m512d)__builtin_ia32_rcp28pd_mask((__v8df)(__m512d)(A), \ (__v8df)_mm512_setzero_pd(), \ (__mmask8)(M), (int)(R)); }) #define _mm512_rcp28_pd(A) \ _mm512_rcp28_round_pd((A), _MM_FROUND_CUR_DIRECTION) #define _mm512_mask_rcp28_pd(S, M, A) \ _mm512_mask_rcp28_round_pd((S), (M), (A), _MM_FROUND_CUR_DIRECTION) #define _mm512_maskz_rcp28_pd(M, A) \ _mm512_maskz_rcp28_round_pd((M), (A), _MM_FROUND_CUR_DIRECTION) #define _mm512_rcp28_round_ps(A, R) __extension__ ({ \ (__m512)__builtin_ia32_rcp28ps_mask((__v16sf)(__m512)(A), \ (__v16sf)_mm512_setzero_ps(), \ (__mmask16)-1, (int)(R)); }) #define _mm512_mask_rcp28_round_ps(S, M, A, R) __extension__ ({ \ (__m512)__builtin_ia32_rcp28ps_mask((__v16sf)(__m512)(A), \ (__v16sf)(__m512)(S), (__mmask16)(M), \ (int)(R)); }) #define _mm512_maskz_rcp28_round_ps(M, A, R) __extension__ ({ \ (__m512)__builtin_ia32_rcp28ps_mask((__v16sf)(__m512)(A), \ (__v16sf)_mm512_setzero_ps(), \ (__mmask16)(M), (int)(R)); }) #define _mm512_rcp28_ps(A) \ _mm512_rcp28_round_ps((A), _MM_FROUND_CUR_DIRECTION) #define _mm512_mask_rcp28_ps(S, M, A) \ _mm512_mask_rcp28_round_ps((S), (M), (A), _MM_FROUND_CUR_DIRECTION) #define _mm512_maskz_rcp28_ps(M, A) \ _mm512_maskz_rcp28_round_ps((M), (A), _MM_FROUND_CUR_DIRECTION) #define _mm_rcp28_round_ss(A, B, R) __extension__ ({ \ (__m128)__builtin_ia32_rcp28ss_round_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4sf)_mm_setzero_ps(), \ (__mmask8)-1, (int)(R)); }) #define _mm_mask_rcp28_round_ss(S, M, A, B, R) __extension__ ({ \ (__m128)__builtin_ia32_rcp28ss_round_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4sf)(__m128)(S), \ (__mmask8)(M), (int)(R)); }) #define _mm_maskz_rcp28_round_ss(M, A, B, R) __extension__ ({ \ (__m128)__builtin_ia32_rcp28ss_round_mask((__v4sf)(__m128)(A), \ (__v4sf)(__m128)(B), \ (__v4sf)_mm_setzero_ps(), \ (__mmask8)(M), (int)(R)); }) #define _mm_rcp28_ss(A, B) \ _mm_rcp28_round_ss((A), (B), _MM_FROUND_CUR_DIRECTION) #define _mm_mask_rcp28_ss(S, M, A, B) \ _mm_mask_rcp28_round_ss((S), (M), (A), (B), _MM_FROUND_CUR_DIRECTION) #define _mm_maskz_rcp28_ss(M, A, B) \ _mm_maskz_rcp28_round_ss((M), (A), (B), _MM_FROUND_CUR_DIRECTION) #define _mm_rcp28_round_sd(A, B, R) __extension__ ({ \ (__m128d)__builtin_ia32_rcp28sd_round_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)_mm_setzero_pd(), \ (__mmask8)-1, (int)(R)); }) #define _mm_mask_rcp28_round_sd(S, M, A, B, R) __extension__ ({ \ (__m128d)__builtin_ia32_rcp28sd_round_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)(__m128d)(S), \ (__mmask8)(M), (int)(R)); }) #define _mm_maskz_rcp28_round_sd(M, A, B, R) __extension__ ({ \ (__m128d)__builtin_ia32_rcp28sd_round_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)_mm_setzero_pd(), \ (__mmask8)(M), (int)(R)); }) #define _mm_rcp28_sd(A, B) \ _mm_rcp28_round_sd((A), (B), _MM_FROUND_CUR_DIRECTION) #define _mm_mask_rcp28_sd(S, M, A, B) \ _mm_mask_rcp28_round_sd((S), (M), (A), (B), _MM_FROUND_CUR_DIRECTION) #define _mm_maskz_rcp28_sd(M, A, B) \ _mm_maskz_rcp28_round_sd((M), (A), (B), _MM_FROUND_CUR_DIRECTION) #endif // __AVX512ERINTRIN_H # 286 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512erintrin.h" 3 # 205 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 2 3 #endif # 206 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || defined(__AVX512IFMA__) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 208 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512ifmaintrin.h" 1 3 /*===------------- avx512ifmaintrin.h - IFMA intrinsics ------------------=== * * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __IMMINTRIN_H #error "Never use directly; include instead." #endif # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512ifmaintrin.h" 3 #ifndef __IFMAINTRIN_H #define __IFMAINTRIN_H /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("avx512ifma"))) static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_madd52hi_epu64 (__m512i __X, __m512i __Y, __m512i __Z) { return (__m512i) __builtin_ia32_vpmadd52huq512_mask ((__v8di) __X, (__v8di) __Y, (__v8di) __Z, (__mmask8) -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_madd52hi_epu64 (__m512i __W, __mmask8 __M, __m512i __X, __m512i __Y) { return (__m512i) __builtin_ia32_vpmadd52huq512_mask ((__v8di) __W, (__v8di) __X, (__v8di) __Y, (__mmask8) __M); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_madd52hi_epu64 (__mmask8 __M, __m512i __X, __m512i __Y, __m512i __Z) { return (__m512i) __builtin_ia32_vpmadd52huq512_maskz ((__v8di) __X, (__v8di) __Y, (__v8di) __Z, (__mmask8) __M); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_madd52lo_epu64 (__m512i __X, __m512i __Y, __m512i __Z) { return (__m512i) __builtin_ia32_vpmadd52luq512_mask ((__v8di) __X, (__v8di) __Y, (__v8di) __Z, (__mmask8) -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_madd52lo_epu64 (__m512i __W, __mmask8 __M, __m512i __X, __m512i __Y) { return (__m512i) __builtin_ia32_vpmadd52luq512_mask ((__v8di) __W, (__v8di) __X, (__v8di) __Y, (__mmask8) __M); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_madd52lo_epu64 (__mmask8 __M, __m512i __X, __m512i __Y, __m512i __Z) { return (__m512i) __builtin_ia32_vpmadd52luq512_maskz ((__v8di) __X, (__v8di) __Y, (__v8di) __Z, (__mmask8) __M); } #undef __DEFAULT_FN_ATTRS #endif # 93 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512ifmaintrin.h" 3 # 209 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 2 3 #endif # 210 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || \ (defined(__AVX512IFMA__) && defined(__AVX512VL__)) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 213 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512ifmavlintrin.h" 1 3 /*===------------- avx512ifmavlintrin.h - IFMA intrinsics ------------------=== * * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __IMMINTRIN_H #error "Never use directly; include instead." #endif # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512ifmavlintrin.h" 3 #ifndef __IFMAVLINTRIN_H #define __IFMAVLINTRIN_H /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("avx512ifma,avx512vl"))) static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_madd52hi_epu64 (__m128i __X, __m128i __Y, __m128i __Z) { return (__m128i) __builtin_ia32_vpmadd52huq128_mask ((__v2di) __X, (__v2di) __Y, (__v2di) __Z, (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_madd52hi_epu64 (__m128i __W, __mmask8 __M, __m128i __X, __m128i __Y) { return (__m128i) __builtin_ia32_vpmadd52huq128_mask ((__v2di) __W, (__v2di) __X, (__v2di) __Y, (__mmask8) __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_madd52hi_epu64 (__mmask8 __M, __m128i __X, __m128i __Y, __m128i __Z) { return (__m128i) __builtin_ia32_vpmadd52huq128_maskz ((__v2di) __X, (__v2di) __Y, (__v2di) __Z, (__mmask8) __M); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_madd52hi_epu64 (__m256i __X, __m256i __Y, __m256i __Z) { return (__m256i) __builtin_ia32_vpmadd52huq256_mask ((__v4di) __X, (__v4di) __Y, (__v4di) __Z, (__mmask8) -1); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_madd52hi_epu64 (__m256i __W, __mmask8 __M, __m256i __X, __m256i __Y) { return (__m256i) __builtin_ia32_vpmadd52huq256_mask ((__v4di) __W, (__v4di) __X, (__v4di) __Y, (__mmask8) __M); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_madd52hi_epu64 (__mmask8 __M, __m256i __X, __m256i __Y, __m256i __Z) { return (__m256i) __builtin_ia32_vpmadd52huq256_maskz ((__v4di) __X, (__v4di) __Y, (__v4di) __Z, (__mmask8) __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_madd52lo_epu64 (__m128i __X, __m128i __Y, __m128i __Z) { return (__m128i) __builtin_ia32_vpmadd52luq128_mask ((__v2di) __X, (__v2di) __Y, (__v2di) __Z, (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_madd52lo_epu64 (__m128i __W, __mmask8 __M, __m128i __X, __m128i __Y) { return (__m128i) __builtin_ia32_vpmadd52luq128_mask ((__v2di) __W, (__v2di) __X, (__v2di) __Y, (__mmask8) __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_madd52lo_epu64 (__mmask8 __M, __m128i __X, __m128i __Y, __m128i __Z) { return (__m128i) __builtin_ia32_vpmadd52luq128_maskz ((__v2di) __X, (__v2di) __Y, (__v2di) __Z, (__mmask8) __M); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_madd52lo_epu64 (__m256i __X, __m256i __Y, __m256i __Z) { return (__m256i) __builtin_ia32_vpmadd52luq256_mask ((__v4di) __X, (__v4di) __Y, (__v4di) __Z, (__mmask8) -1); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_madd52lo_epu64 (__m256i __W, __mmask8 __M, __m256i __X, __m256i __Y) { return (__m256i) __builtin_ia32_vpmadd52luq256_mask ((__v4di) __W, (__v4di) __X, (__v4di) __Y, (__mmask8) __M); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_madd52lo_epu64 (__mmask8 __M, __m256i __X, __m256i __Y, __m256i __Z) { return (__m256i) __builtin_ia32_vpmadd52luq256_maskz ((__v4di) __X, (__v4di) __Y, (__v4di) __Z, (__mmask8) __M); } #undef __DEFAULT_FN_ATTRS #endif # 150 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512ifmavlintrin.h" 3 # 214 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 2 3 #endif # 215 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || defined(__AVX512VBMI__) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 217 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512vbmiintrin.h" 1 3 /*===------------- avx512vbmiintrin.h - VBMI intrinsics ------------------=== * * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __IMMINTRIN_H #error "Never use directly; include instead." #endif # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512vbmiintrin.h" 3 #ifndef __VBMIINTRIN_H #define __VBMIINTRIN_H /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("avx512vbmi"))) static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask2_permutex2var_epi8 (__m512i __A, __m512i __I, __mmask64 __U, __m512i __B) { return (__m512i) __builtin_ia32_vpermi2varqi512_mask ((__v64qi) __A, (__v64qi) __I /* idx */ , (__v64qi) __B, (__mmask64) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_permutex2var_epi8 (__m512i __A, __m512i __I, __m512i __B) { return (__m512i) __builtin_ia32_vpermt2varqi512_mask ((__v64qi) __I /* idx */ , (__v64qi) __A, (__v64qi) __B, (__mmask64) -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_permutex2var_epi8 (__m512i __A, __mmask64 __U, __m512i __I, __m512i __B) { return (__m512i) __builtin_ia32_vpermt2varqi512_mask ((__v64qi) __I /* idx */ , (__v64qi) __A, (__v64qi) __B, (__mmask64) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_permutex2var_epi8 (__mmask64 __U, __m512i __A, __m512i __I, __m512i __B) { return (__m512i) __builtin_ia32_vpermt2varqi512_maskz ((__v64qi) __I /* idx */ , (__v64qi) __A, (__v64qi) __B, (__mmask64) __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_permutexvar_epi8 (__m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_permvarqi512_mask ((__v64qi) __B, (__v64qi) __A, (__v64qi) _mm512_undefined_epi32 (), (__mmask64) -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_permutexvar_epi8 (__mmask64 __M, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_permvarqi512_mask ((__v64qi) __B, (__v64qi) __A, (__v64qi) _mm512_setzero_si512(), (__mmask64) __M); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_permutexvar_epi8 (__m512i __W, __mmask64 __M, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_permvarqi512_mask ((__v64qi) __B, (__v64qi) __A, (__v64qi) __W, (__mmask64) __M); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_multishift_epi64_epi8 (__m512i __W, __mmask64 __M, __m512i __X, __m512i __Y) { return (__m512i) __builtin_ia32_vpmultishiftqb512_mask ((__v64qi) __X, (__v64qi) __Y, (__v64qi) __W, (__mmask64) __M); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_multishift_epi64_epi8 (__mmask64 __M, __m512i __X, __m512i __Y) { return (__m512i) __builtin_ia32_vpmultishiftqb512_mask ((__v64qi) __X, (__v64qi) __Y, (__v64qi) _mm512_setzero_si512 (), (__mmask64) __M); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_multishift_epi64_epi8 (__m512i __X, __m512i __Y) { return (__m512i) __builtin_ia32_vpmultishiftqb512_mask ((__v64qi) __X, (__v64qi) __Y, (__v64qi) _mm512_undefined_epi32 (), (__mmask64) -1); } #undef __DEFAULT_FN_ATTRS #endif # 138 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512vbmiintrin.h" 3 # 218 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 2 3 #endif # 219 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || \ (defined(__AVX512VBMI__) && defined(__AVX512VL__)) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 222 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512vbmivlintrin.h" 1 3 /*===------------- avx512vbmivlintrin.h - VBMI intrinsics ------------------=== * * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __IMMINTRIN_H #error "Never use directly; include instead." #endif # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512vbmivlintrin.h" 3 #ifndef __VBMIVLINTRIN_H #define __VBMIVLINTRIN_H /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("avx512vbmi,avx512vl"))) static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask2_permutex2var_epi8 (__m128i __A, __m128i __I, __mmask16 __U, __m128i __B) { return (__m128i) __builtin_ia32_vpermi2varqi128_mask ((__v16qi) __A, (__v16qi) __I /* idx */ , (__v16qi) __B, (__mmask16) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask2_permutex2var_epi8 (__m256i __A, __m256i __I, __mmask32 __U, __m256i __B) { return (__m256i) __builtin_ia32_vpermi2varqi256_mask ((__v32qi) __A, (__v32qi) __I /* idx */ , (__v32qi) __B, (__mmask32) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_permutex2var_epi8 (__m128i __A, __m128i __I, __m128i __B) { return (__m128i) __builtin_ia32_vpermt2varqi128_mask ((__v16qi) __I /* idx */ , (__v16qi) __A, (__v16qi) __B, (__mmask16) - 1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_permutex2var_epi8 (__m128i __A, __mmask16 __U, __m128i __I, __m128i __B) { return (__m128i) __builtin_ia32_vpermt2varqi128_mask ((__v16qi) __I /* idx */ , (__v16qi) __A, (__v16qi) __B, (__mmask16) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_permutex2var_epi8 (__mmask16 __U, __m128i __A, __m128i __I, __m128i __B) { return (__m128i) __builtin_ia32_vpermt2varqi128_maskz ((__v16qi) __I /* idx */ , (__v16qi) __A, (__v16qi) __B, (__mmask16) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_permutex2var_epi8 (__m256i __A, __m256i __I, __m256i __B) { return (__m256i) __builtin_ia32_vpermt2varqi256_mask ((__v32qi) __I /* idx */ , (__v32qi) __A, (__v32qi) __B, (__mmask32) - 1); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_permutex2var_epi8 (__m256i __A, __mmask32 __U, __m256i __I, __m256i __B) { return (__m256i) __builtin_ia32_vpermt2varqi256_mask ((__v32qi) __I /* idx */ , (__v32qi) __A, (__v32qi) __B, (__mmask32) __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_permutex2var_epi8 (__mmask32 __U, __m256i __A, __m256i __I, __m256i __B) { return (__m256i) __builtin_ia32_vpermt2varqi256_maskz ((__v32qi) __I /* idx */ , (__v32qi) __A, (__v32qi) __B, (__mmask32) __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_permutexvar_epi8 (__m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_permvarqi128_mask ((__v16qi) __B, (__v16qi) __A, (__v16qi) _mm_undefined_si128 (), (__mmask16) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_permutexvar_epi8 (__mmask16 __M, __m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_permvarqi128_mask ((__v16qi) __B, (__v16qi) __A, (__v16qi) _mm_setzero_si128 (), (__mmask16) __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_permutexvar_epi8 (__m128i __W, __mmask16 __M, __m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_permvarqi128_mask ((__v16qi) __B, (__v16qi) __A, (__v16qi) __W, (__mmask16) __M); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_permutexvar_epi8 (__m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_permvarqi256_mask ((__v32qi) __B, (__v32qi) __A, (__v32qi) _mm256_undefined_si256 (), (__mmask32) -1); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_permutexvar_epi8 (__mmask32 __M, __m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_permvarqi256_mask ((__v32qi) __B, (__v32qi) __A, (__v32qi) _mm256_setzero_si256 (), (__mmask32) __M); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_permutexvar_epi8 (__m256i __W, __mmask32 __M, __m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_permvarqi256_mask ((__v32qi) __B, (__v32qi) __A, (__v32qi) __W, (__mmask32) __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_mask_multishift_epi64_epi8 (__m128i __W, __mmask16 __M, __m128i __X, __m128i __Y) { return (__m128i) __builtin_ia32_vpmultishiftqb128_mask ((__v16qi) __X, (__v16qi) __Y, (__v16qi) __W, (__mmask16) __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maskz_multishift_epi64_epi8 (__mmask16 __M, __m128i __X, __m128i __Y) { return (__m128i) __builtin_ia32_vpmultishiftqb128_mask ((__v16qi) __X, (__v16qi) __Y, (__v16qi) _mm_setzero_si128 (), (__mmask16) __M); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_multishift_epi64_epi8 (__m128i __X, __m128i __Y) { return (__m128i) __builtin_ia32_vpmultishiftqb128_mask ((__v16qi) __X, (__v16qi) __Y, (__v16qi) _mm_undefined_si128 (), (__mmask16) -1); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_multishift_epi64_epi8 (__m256i __W, __mmask32 __M, __m256i __X, __m256i __Y) { return (__m256i) __builtin_ia32_vpmultishiftqb256_mask ((__v32qi) __X, (__v32qi) __Y, (__v32qi) __W, (__mmask32) __M); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_multishift_epi64_epi8 (__mmask32 __M, __m256i __X, __m256i __Y) { return (__m256i) __builtin_ia32_vpmultishiftqb256_mask ((__v32qi) __X, (__v32qi) __Y, (__v32qi) _mm256_setzero_si256 (), (__mmask32) __M); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_multishift_epi64_epi8 (__m256i __X, __m256i __Y) { return (__m256i) __builtin_ia32_vpmultishiftqb256_mask ((__v32qi) __X, (__v32qi) __Y, (__v32qi) _mm256_undefined_si256 (), (__mmask32) -1); } #undef __DEFAULT_FN_ATTRS #endif # 248 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512vbmivlintrin.h" 3 # 223 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 2 3 #endif # 224 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || defined(__AVX512VBMI2__) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 226 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512vbmi2intrin.h" 1 3 /*===------------- avx512vbmi2intrin.h - VBMI2 intrinsics ------------------=== * * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __IMMINTRIN_H #error "Never use directly; include instead." #endif # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512vbmi2intrin.h" 3 #ifndef __AVX512VBMI2INTRIN_H #define __AVX512VBMI2INTRIN_H /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("avx512vbmi2"))) static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_compress_epi16(__m512i __S, __mmask32 __U, __m512i __D) { return (__m512i) __builtin_ia32_compresshi512_mask ((__v32hi) __D, (__v32hi) __S, __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_compress_epi16(__mmask32 __U, __m512i __D) { return (__m512i) __builtin_ia32_compresshi512_mask ((__v32hi) __D, (__v32hi) _mm512_setzero_hi(), __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_compress_epi8(__m512i __S, __mmask64 __U, __m512i __D) { return (__m512i) __builtin_ia32_compressqi512_mask ((__v64qi) __D, (__v64qi) __S, __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_compress_epi8(__mmask64 __U, __m512i __D) { return (__m512i) __builtin_ia32_compressqi512_mask ((__v64qi) __D, (__v64qi) _mm512_setzero_qi(), __U); } static __inline__ void __DEFAULT_FN_ATTRS _mm512_mask_compressstoreu_epi16(void *__P, __mmask32 __U, __m512i __D) { __builtin_ia32_compressstorehi512_mask ((__v32hi *) __P, (__v32hi) __D, __U); } static __inline__ void __DEFAULT_FN_ATTRS _mm512_mask_compressstoreu_epi8(void *__P, __mmask64 __U, __m512i __D) { __builtin_ia32_compressstoreqi512_mask ((__v64qi *) __P, (__v64qi) __D, __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_expand_epi16(__m512i __S, __mmask32 __U, __m512i __D) { return (__m512i) __builtin_ia32_expandhi512_mask ((__v32hi) __D, (__v32hi) __S, __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_expand_epi16(__mmask32 __U, __m512i __D) { return (__m512i) __builtin_ia32_expandhi512_mask ((__v32hi) __D, (__v32hi) _mm512_setzero_hi(), __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_expand_epi8(__m512i __S, __mmask64 __U, __m512i __D) { return (__m512i) __builtin_ia32_expandqi512_mask ((__v64qi) __D, (__v64qi) __S, __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_expand_epi8(__mmask64 __U, __m512i __D) { return (__m512i) __builtin_ia32_expandqi512_mask ((__v64qi) __D, (__v64qi) _mm512_setzero_qi(), __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_expandloadu_epi16(__m512i __S, __mmask32 __U, void const *__P) { return (__m512i) __builtin_ia32_expandloadhi512_mask ((const __v32hi *)__P, (__v32hi) __S, __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_expandloadu_epi16(__mmask32 __U, void const *__P) { return (__m512i) __builtin_ia32_expandloadhi512_mask ((const __v32hi *)__P, (__v32hi) _mm512_setzero_hi(), __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_expandloadu_epi8(__m512i __S, __mmask64 __U, void const *__P) { return (__m512i) __builtin_ia32_expandloadqi512_mask ((const __v64qi *)__P, (__v64qi) __S, __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_expandloadu_epi8(__mmask64 __U, void const *__P) { return (__m512i) __builtin_ia32_expandloadqi512_mask ((const __v64qi *)__P, (__v64qi) _mm512_setzero_qi(), __U); } #define _mm512_mask_shldi_epi64(S, U, A, B, I) __extension__ ({ \ (__m512i)__builtin_ia32_vpshldq512_mask((__v8di)(A), \ (__v8di)(B), \ (int)(I), \ (__v8di)(S), \ (__mmask8)(U)); }) #define _mm512_maskz_shldi_epi64(U, A, B, I) \ _mm512_mask_shldi_epi64(_mm512_setzero_hi(), (U), (A), (B), (I)) #define _mm512_shldi_epi64(A, B, I) \ _mm512_mask_shldi_epi64(_mm512_undefined(), (__mmask8)(-1), (A), (B), (I)) #define _mm512_mask_shldi_epi32(S, U, A, B, I) __extension__ ({ \ (__m512i)__builtin_ia32_vpshldd512_mask((__v16si)(A), \ (__v16si)(B), \ (int)(I), \ (__v16si)(S), \ (__mmask16)(U)); }) #define _mm512_maskz_shldi_epi32(U, A, B, I) \ _mm512_mask_shldi_epi32(_mm512_setzero_hi(), (U), (A), (B), (I)) #define _mm512_shldi_epi32(A, B, I) \ _mm512_mask_shldi_epi32(_mm512_undefined(), (__mmask16)(-1), (A), (B), (I)) #define _mm512_mask_shldi_epi16(S, U, A, B, I) __extension__ ({ \ (__m512i)__builtin_ia32_vpshldw512_mask((__v32hi)(A), \ (__v32hi)(B), \ (int)(I), \ (__v32hi)(S), \ (__mmask32)(U)); }) #define _mm512_maskz_shldi_epi16(U, A, B, I) \ _mm512_mask_shldi_epi16(_mm512_setzero_hi(), (U), (A), (B), (I)) #define _mm512_shldi_epi16(A, B, I) \ _mm512_mask_shldi_epi16(_mm512_undefined(), (__mmask32)(-1), (A), (B), (I)) #define _mm512_mask_shrdi_epi64(S, U, A, B, I) __extension__ ({ \ (__m512i)__builtin_ia32_vpshrdq512_mask((__v8di)(A), \ (__v8di)(B), \ (int)(I), \ (__v8di)(S), \ (__mmask8)(U)); }) #define _mm512_maskz_shrdi_epi64(U, A, B, I) \ _mm512_mask_shrdi_epi64(_mm512_setzero_hi(), (U), (A), (B), (I)) #define _mm512_shrdi_epi64(A, B, I) \ _mm512_mask_shrdi_epi64(_mm512_undefined(), (__mmask8)(-1), (A), (B), (I)) #define _mm512_mask_shrdi_epi32(S, U, A, B, I) __extension__ ({ \ (__m512i)__builtin_ia32_vpshrdd512_mask((__v16si)(A), \ (__v16si)(B), \ (int)(I), \ (__v16si)(S), \ (__mmask16)(U)); }) #define _mm512_maskz_shrdi_epi32(U, A, B, I) \ _mm512_mask_shrdi_epi32(_mm512_setzero_hi(), (U), (A), (B), (I)) #define _mm512_shrdi_epi32(A, B, I) \ _mm512_mask_shrdi_epi32(_mm512_undefined(), (__mmask16)(-1), (A), (B), (I)) #define _mm512_mask_shrdi_epi16(S, U, A, B, I) __extension__ ({ \ (__m512i)__builtin_ia32_vpshrdw512_mask((__v32hi)(A), \ (__v32hi)(B), \ (int)(I), \ (__v32hi)(S), \ (__mmask32)(U)); }) #define _mm512_maskz_shrdi_epi16(U, A, B, I) \ _mm512_mask_shrdi_epi16(_mm512_setzero_hi(), (U), (A), (B), (I)) #define _mm512_shrdi_epi16(A, B, I) \ _mm512_mask_shrdi_epi16(_mm512_undefined(), (__mmask32)(-1), (A), (B), (I)) static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_shldv_epi64(__m512i __S, __mmask8 __U, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_vpshldvq512_mask ((__v8di) __S, (__v8di) __A, (__v8di) __B, __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_shldv_epi64(__mmask8 __U, __m512i __S, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_vpshldvq512_maskz ((__v8di) __S, (__v8di) __A, (__v8di) __B, __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_shldv_epi64(__m512i __S, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_vpshldvq512_mask ((__v8di) __S, (__v8di) __A, (__v8di) __B, (__mmask8) -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_shldv_epi32(__m512i __S, __mmask16 __U, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_vpshldvd512_mask ((__v16si) __S, (__v16si) __A, (__v16si) __B, __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_shldv_epi32(__mmask16 __U, __m512i __S, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_vpshldvd512_maskz ((__v16si) __S, (__v16si) __A, (__v16si) __B, __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_shldv_epi32(__m512i __S, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_vpshldvd512_mask ((__v16si) __S, (__v16si) __A, (__v16si) __B, (__mmask16) -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_shldv_epi16(__m512i __S, __mmask32 __U, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_vpshldvw512_mask ((__v32hi) __S, (__v32hi) __A, (__v32hi) __B, __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_shldv_epi16(__mmask32 __U, __m512i __S, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_vpshldvw512_maskz ((__v32hi) __S, (__v32hi) __A, (__v32hi) __B, __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_shldv_epi16(__m512i __S, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_vpshldvw512_mask ((__v32hi) __S, (__v32hi) __A, (__v32hi) __B, (__mmask32) -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_shrdv_epi64(__m512i __S, __mmask8 __U, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_vpshrdvq512_mask ((__v8di) __S, (__v8di) __A, (__v8di) __B, __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_shrdv_epi64(__mmask8 __U, __m512i __S, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_vpshrdvq512_maskz ((__v8di) __S, (__v8di) __A, (__v8di) __B, __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_shrdv_epi64(__m512i __S, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_vpshrdvq512_mask ((__v8di) __S, (__v8di) __A, (__v8di) __B, (__mmask8) -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_shrdv_epi32(__m512i __S, __mmask16 __U, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_vpshrdvd512_mask ((__v16si) __S, (__v16si) __A, (__v16si) __B, __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_shrdv_epi32(__mmask16 __U, __m512i __S, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_vpshrdvd512_maskz ((__v16si) __S, (__v16si) __A, (__v16si) __B, __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_shrdv_epi32(__m512i __S, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_vpshrdvd512_mask ((__v16si) __S, (__v16si) __A, (__v16si) __B, (__mmask16) -1); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_mask_shrdv_epi16(__m512i __S, __mmask32 __U, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_vpshrdvw512_mask ((__v32hi) __S, (__v32hi) __A, (__v32hi) __B, __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_shrdv_epi16(__mmask32 __U, __m512i __S, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_vpshrdvw512_maskz ((__v32hi) __S, (__v32hi) __A, (__v32hi) __B, __U); } static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_shrdv_epi16(__m512i __S, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_vpshrdvw512_mask ((__v32hi) __S, (__v32hi) __A, (__v32hi) __B, (__mmask32) -1); } #undef __DEFAULT_FN_ATTRS #endif # 391 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512vbmi2intrin.h" 3 # 227 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 2 3 #endif # 228 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || \ (defined(__AVX512VBMI2__) && defined(__AVX512VL__)) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 231 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512vlvbmi2intrin.h" 1 3 /*===------------- avx512vlvbmi2intrin.h - VBMI2 intrinsics -----------------=== * * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __IMMINTRIN_H #error "Never use directly; include instead." #endif # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512vlvbmi2intrin.h" 3 #ifndef __AVX512VLVBMI2INTRIN_H #define __AVX512VLVBMI2INTRIN_H /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("avx512vl,avx512vbmi2"))) static __inline __m128i __DEFAULT_FN_ATTRS _mm128_setzero_hi(void) { return (__m128i)(__v8hi){ 0, 0, 0, 0, 0, 0, 0, 0 }; } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm128_mask_compress_epi16(__m128i __S, __mmask8 __U, __m128i __D) { return (__m128i) __builtin_ia32_compresshi128_mask ((__v8hi) __D, (__v8hi) __S, __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm128_maskz_compress_epi16(__mmask8 __U, __m128i __D) { return (__m128i) __builtin_ia32_compresshi128_mask ((__v8hi) __D, (__v8hi) _mm128_setzero_hi(), __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm128_mask_compress_epi8(__m128i __S, __mmask16 __U, __m128i __D) { return (__m128i) __builtin_ia32_compressqi128_mask ((__v16qi) __D, (__v16qi) __S, __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm128_maskz_compress_epi8(__mmask16 __U, __m128i __D) { return (__m128i) __builtin_ia32_compressqi128_mask ((__v16qi) __D, (__v16qi) _mm128_setzero_hi(), __U); } static __inline__ void __DEFAULT_FN_ATTRS _mm128_mask_compressstoreu_epi16(void *__P, __mmask8 __U, __m128i __D) { __builtin_ia32_compressstorehi128_mask ((__v8hi *) __P, (__v8hi) __D, __U); } static __inline__ void __DEFAULT_FN_ATTRS _mm128_mask_compressstoreu_epi8(void *__P, __mmask16 __U, __m128i __D) { __builtin_ia32_compressstoreqi128_mask ((__v16qi *) __P, (__v16qi) __D, __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm128_mask_expand_epi16(__m128i __S, __mmask8 __U, __m128i __D) { return (__m128i) __builtin_ia32_expandhi128_mask ((__v8hi) __D, (__v8hi) __S, __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm128_maskz_expand_epi16(__mmask8 __U, __m128i __D) { return (__m128i) __builtin_ia32_expandhi128_mask ((__v8hi) __D, (__v8hi) _mm128_setzero_hi(), __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm128_mask_expand_epi8(__m128i __S, __mmask16 __U, __m128i __D) { return (__m128i) __builtin_ia32_expandqi128_mask ((__v16qi) __D, (__v16qi) __S, __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm128_maskz_expand_epi8(__mmask16 __U, __m128i __D) { return (__m128i) __builtin_ia32_expandqi128_mask ((__v16qi) __D, (__v16qi) _mm128_setzero_hi(), __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm128_mask_expandloadu_epi16(__m128i __S, __mmask8 __U, void const *__P) { return (__m128i) __builtin_ia32_expandloadhi128_mask ((const __v8hi *)__P, (__v8hi) __S, __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm128_maskz_expandloadu_epi16(__mmask8 __U, void const *__P) { return (__m128i) __builtin_ia32_expandloadhi128_mask ((const __v8hi *)__P, (__v8hi) _mm128_setzero_hi(), __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm128_mask_expandloadu_epi8(__m128i __S, __mmask16 __U, void const *__P) { return (__m128i) __builtin_ia32_expandloadqi128_mask ((const __v16qi *)__P, (__v16qi) __S, __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm128_maskz_expandloadu_epi8(__mmask16 __U, void const *__P) { return (__m128i) __builtin_ia32_expandloadqi128_mask ((const __v16qi *)__P, (__v16qi) _mm128_setzero_hi(), __U); } static __inline __m256i __DEFAULT_FN_ATTRS _mm256_setzero_hi(void) { return (__m256i)(__v16hi){ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_compress_epi16(__m256i __S, __mmask16 __U, __m256i __D) { return (__m256i) __builtin_ia32_compresshi256_mask ((__v16hi) __D, (__v16hi) __S, __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_compress_epi16(__mmask16 __U, __m256i __D) { return (__m256i) __builtin_ia32_compresshi256_mask ((__v16hi) __D, (__v16hi) _mm256_setzero_hi(), __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_compress_epi8(__m256i __S, __mmask32 __U, __m256i __D) { return (__m256i) __builtin_ia32_compressqi256_mask ((__v32qi) __D, (__v32qi) __S, __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_compress_epi8(__mmask32 __U, __m256i __D) { return (__m256i) __builtin_ia32_compressqi256_mask ((__v32qi) __D, (__v32qi) _mm256_setzero_hi(), __U); } static __inline__ void __DEFAULT_FN_ATTRS _mm256_mask_compressstoreu_epi16(void *__P, __mmask16 __U, __m256i __D) { __builtin_ia32_compressstorehi256_mask ((__v16hi *) __P, (__v16hi) __D, __U); } static __inline__ void __DEFAULT_FN_ATTRS _mm256_mask_compressstoreu_epi8(void *__P, __mmask32 __U, __m256i __D) { __builtin_ia32_compressstoreqi256_mask ((__v32qi *) __P, (__v32qi) __D, __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_expand_epi16(__m256i __S, __mmask16 __U, __m256i __D) { return (__m256i) __builtin_ia32_expandhi256_mask ((__v16hi) __D, (__v16hi) __S, __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_expand_epi16(__mmask16 __U, __m256i __D) { return (__m256i) __builtin_ia32_expandhi256_mask ((__v16hi) __D, (__v16hi) _mm256_setzero_hi(), __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_expand_epi8(__m256i __S, __mmask32 __U, __m256i __D) { return (__m256i) __builtin_ia32_expandqi256_mask ((__v32qi) __D, (__v32qi) __S, __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_expand_epi8(__mmask32 __U, __m256i __D) { return (__m256i) __builtin_ia32_expandqi256_mask ((__v32qi) __D, (__v32qi) _mm256_setzero_hi(), __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_expandloadu_epi16(__m256i __S, __mmask16 __U, void const *__P) { return (__m256i) __builtin_ia32_expandloadhi256_mask ((const __v16hi *)__P, (__v16hi) __S, __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_expandloadu_epi16(__mmask16 __U, void const *__P) { return (__m256i) __builtin_ia32_expandloadhi256_mask ((const __v16hi *)__P, (__v16hi) _mm256_setzero_hi(), __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_expandloadu_epi8(__m256i __S, __mmask32 __U, void const *__P) { return (__m256i) __builtin_ia32_expandloadqi256_mask ((const __v32qi *)__P, (__v32qi) __S, __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_expandloadu_epi8(__mmask32 __U, void const *__P) { return (__m256i) __builtin_ia32_expandloadqi256_mask ((const __v32qi *)__P, (__v32qi) _mm256_setzero_hi(), __U); } #define _mm256_mask_shldi_epi64(S, U, A, B, I) __extension__ ({ \ (__m256i)__builtin_ia32_vpshldq256_mask((__v4di)(A), \ (__v4di)(B), \ (int)(I), \ (__v4di)(S), \ (__mmask8)(U)); }) #define _mm256_maskz_shldi_epi64(U, A, B, I) \ _mm256_mask_shldi_epi64(_mm256_setzero_hi(), (U), (A), (B), (I)) #define _mm256_shldi_epi64(A, B, I) \ _mm256_mask_shldi_epi64(_mm256_undefined_si256(), (__mmask8)(-1), (A), (B), (I)) #define _mm128_mask_shldi_epi64(S, U, A, B, I) __extension__ ({ \ (__m128i)__builtin_ia32_vpshldq128_mask((__v2di)(A), \ (__v2di)(B), \ (int)(I), \ (__v2di)(S), \ (__mmask8)(U)); }) #define _mm128_maskz_shldi_epi64(U, A, B, I) \ _mm128_mask_shldi_epi64(_mm128_setzero_hi(), (U), (A), (B), (I)) #define _mm128_shldi_epi64(A, B, I) \ _mm128_mask_shldi_epi64(_mm_undefined_si128(), (__mmask8)(-1), (A), (B), (I)) #define _mm256_mask_shldi_epi32(S, U, A, B, I) __extension__ ({ \ (__m256i)__builtin_ia32_vpshldd256_mask((__v8si)(A), \ (__v8si)(B), \ (int)(I), \ (__v8si)(S), \ (__mmask8)(U)); }) #define _mm256_maskz_shldi_epi32(U, A, B, I) \ _mm256_mask_shldi_epi32(_mm256_setzero_hi(), (U), (A), (B), (I)) #define _mm256_shldi_epi32(A, B, I) \ _mm256_mask_shldi_epi32(_mm256_undefined_si256(), (__mmask8)(-1), (A), (B), (I)) #define _mm128_mask_shldi_epi32(S, U, A, B, I) __extension__ ({ \ (__m128i)__builtin_ia32_vpshldd128_mask((__v4si)(A), \ (__v4si)(B), \ (int)(I), \ (__v4si)(S), \ (__mmask8)(U)); }) #define _mm128_maskz_shldi_epi32(U, A, B, I) \ _mm128_mask_shldi_epi32(_mm128_setzero_hi(), (U), (A), (B), (I)) #define _mm128_shldi_epi32(A, B, I) \ _mm128_mask_shldi_epi32(_mm_undefined_si128(), (__mmask8)(-1), (A), (B), (I)) #define _mm256_mask_shldi_epi16(S, U, A, B, I) __extension__ ({ \ (__m256i)__builtin_ia32_vpshldw256_mask((__v16hi)(A), \ (__v16hi)(B), \ (int)(I), \ (__v16hi)(S), \ (__mmask16)(U)); }) #define _mm256_maskz_shldi_epi16(U, A, B, I) \ _mm256_mask_shldi_epi16(_mm256_setzero_hi(), (U), (A), (B), (I)) #define _mm256_shldi_epi16(A, B, I) \ _mm256_mask_shldi_epi16(_mm256_undefined_si256(), (__mmask8)(-1), (A), (B), (I)) #define _mm128_mask_shldi_epi16(S, U, A, B, I) __extension__ ({ \ (__m128i)__builtin_ia32_vpshldw128_mask((__v8hi)(A), \ (__v8hi)(B), \ (int)(I), \ (__v8hi)(S), \ (__mmask8)(U)); }) #define _mm128_maskz_shldi_epi16(U, A, B, I) \ _mm128_mask_shldi_epi16(_mm128_setzero_hi(), (U), (A), (B), (I)) #define _mm128_shldi_epi16(A, B, I) \ _mm128_mask_shldi_epi16(_mm_undefined_si128(), (__mmask8)(-1), (A), (B), (I)) #define _mm256_mask_shrdi_epi64(S, U, A, B, I) __extension__ ({ \ (__m256i)__builtin_ia32_vpshrdq256_mask((__v4di)(A), \ (__v4di)(B), \ (int)(I), \ (__v4di)(S), \ (__mmask8)(U)); }) #define _mm256_maskz_shrdi_epi64(U, A, B, I) \ _mm256_mask_shrdi_epi64(_mm256_setzero_hi(), (U), (A), (B), (I)) #define _mm256_shrdi_epi64(A, B, I) \ _mm256_mask_shrdi_epi64(_mm256_undefined_si256(), (__mmask8)(-1), (A), (B), (I)) #define _mm128_mask_shrdi_epi64(S, U, A, B, I) __extension__ ({ \ (__m128i)__builtin_ia32_vpshrdq128_mask((__v2di)(A), \ (__v2di)(B), \ (int)(I), \ (__v2di)(S), \ (__mmask8)(U)); }) #define _mm128_maskz_shrdi_epi64(U, A, B, I) \ _mm128_mask_shrdi_epi64(_mm128_setzero_hi(), (U), (A), (B), (I)) #define _mm128_shrdi_epi64(A, B, I) \ _mm128_mask_shrdi_epi64(_mm_undefined_si128(), (__mmask8)(-1), (A), (B), (I)) #define _mm256_mask_shrdi_epi32(S, U, A, B, I) __extension__ ({ \ (__m256i)__builtin_ia32_vpshrdd256_mask((__v8si)(A), \ (__v8si)(B), \ (int)(I), \ (__v8si)(S), \ (__mmask8)(U)); }) #define _mm256_maskz_shrdi_epi32(U, A, B, I) \ _mm256_mask_shrdi_epi32(_mm256_setzero_hi(), (U), (A), (B), (I)) #define _mm256_shrdi_epi32(A, B, I) \ _mm256_mask_shrdi_epi32(_mm256_undefined_si256(), (__mmask8)(-1), (A), (B), (I)) #define _mm128_mask_shrdi_epi32(S, U, A, B, I) __extension__ ({ \ (__m128i)__builtin_ia32_vpshrdd128_mask((__v4si)(A), \ (__v4si)(B), \ (int)(I), \ (__v4si)(S), \ (__mmask8)(U)); }) #define _mm128_maskz_shrdi_epi32(U, A, B, I) \ _mm128_mask_shrdi_epi32(_mm128_setzero_hi(), (U), (A), (B), (I)) #define _mm128_shrdi_epi32(A, B, I) \ _mm128_mask_shrdi_epi32(_mm_undefined_si128(), (__mmask8)(-1), (A), (B), (I)) #define _mm256_mask_shrdi_epi16(S, U, A, B, I) __extension__ ({ \ (__m256i)__builtin_ia32_vpshrdw256_mask((__v16hi)(A), \ (__v16hi)(B), \ (int)(I), \ (__v16hi)(S), \ (__mmask16)(U)); }) #define _mm256_maskz_shrdi_epi16(U, A, B, I) \ _mm256_mask_shrdi_epi16(_mm256_setzero_hi(), (U), (A), (B), (I)) #define _mm256_shrdi_epi16(A, B, I) \ _mm256_mask_shrdi_epi16(_mm256_undefined_si256(), (__mmask8)(-1), (A), (B), (I)) #define _mm128_mask_shrdi_epi16(S, U, A, B, I) __extension__ ({ \ (__m128i)__builtin_ia32_vpshrdw128_mask((__v8hi)(A), \ (__v8hi)(B), \ (int)(I), \ (__v8hi)(S), \ (__mmask8)(U)); }) #define _mm128_maskz_shrdi_epi16(U, A, B, I) \ _mm128_mask_shrdi_epi16(_mm128_setzero_hi(), (U), (A), (B), (I)) #define _mm128_shrdi_epi16(A, B, I) \ _mm128_mask_shrdi_epi16(_mm_undefined_si128(), (__mmask8)(-1), (A), (B), (I)) static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_shldv_epi64(__m256i __S, __mmask8 __U, __m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_vpshldvq256_mask ((__v4di) __S, (__v4di) __A, (__v4di) __B, __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_shldv_epi64(__mmask8 __U, __m256i __S, __m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_vpshldvq256_maskz ((__v4di) __S, (__v4di) __A, (__v4di) __B, __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_shldv_epi64(__m256i __S, __m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_vpshldvq256_mask ((__v4di) __S, (__v4di) __A, (__v4di) __B, (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm128_mask_shldv_epi64(__m128i __S, __mmask8 __U, __m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_vpshldvq128_mask ((__v2di) __S, (__v2di) __A, (__v2di) __B, __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm128_maskz_shldv_epi64(__mmask8 __U, __m128i __S, __m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_vpshldvq128_maskz ((__v2di) __S, (__v2di) __A, (__v2di) __B, __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm128_shldv_epi64(__m128i __S, __m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_vpshldvq128_mask ((__v2di) __S, (__v2di) __A, (__v2di) __B, (__mmask8) -1); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_shldv_epi32(__m256i __S, __mmask8 __U, __m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_vpshldvd256_mask ((__v8si) __S, (__v8si) __A, (__v8si) __B, __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_shldv_epi32(__mmask8 __U, __m256i __S, __m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_vpshldvd256_maskz ((__v8si) __S, (__v8si) __A, (__v8si) __B, __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_shldv_epi32(__m256i __S, __m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_vpshldvd256_mask ((__v8si) __S, (__v8si) __A, (__v8si) __B, (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm128_mask_shldv_epi32(__m128i __S, __mmask8 __U, __m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_vpshldvd128_mask ((__v4si) __S, (__v4si) __A, (__v4si) __B, __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm128_maskz_shldv_epi32(__mmask8 __U, __m128i __S, __m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_vpshldvd128_maskz ((__v4si) __S, (__v4si) __A, (__v4si) __B, __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm128_shldv_epi32(__m128i __S, __m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_vpshldvd128_mask ((__v4si) __S, (__v4si) __A, (__v4si) __B, (__mmask8) -1); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_shldv_epi16(__m256i __S, __mmask16 __U, __m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_vpshldvw256_mask ((__v16hi) __S, (__v16hi) __A, (__v16hi) __B, __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_shldv_epi16(__mmask16 __U, __m256i __S, __m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_vpshldvw256_maskz ((__v16hi) __S, (__v16hi) __A, (__v16hi) __B, __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_shldv_epi16(__m256i __S, __m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_vpshldvw256_mask ((__v16hi) __S, (__v16hi) __A, (__v16hi) __B, (__mmask16) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm128_mask_shldv_epi16(__m128i __S, __mmask8 __U, __m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_vpshldvw128_mask ((__v8hi) __S, (__v8hi) __A, (__v8hi) __B, __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm128_maskz_shldv_epi16(__mmask8 __U, __m128i __S, __m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_vpshldvw128_maskz ((__v8hi) __S, (__v8hi) __A, (__v8hi) __B, __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm128_shldv_epi16(__m128i __S, __m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_vpshldvw128_mask ((__v8hi) __S, (__v8hi) __A, (__v8hi) __B, (__mmask8) -1); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_shrdv_epi64(__m256i __S, __mmask8 __U, __m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_vpshrdvq256_mask ((__v4di) __S, (__v4di) __A, (__v4di) __B, __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_shrdv_epi64(__mmask8 __U, __m256i __S, __m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_vpshrdvq256_maskz ((__v4di) __S, (__v4di) __A, (__v4di) __B, __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_shrdv_epi64(__m256i __S, __m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_vpshrdvq256_mask ((__v4di) __S, (__v4di) __A, (__v4di) __B, (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm128_mask_shrdv_epi64(__m128i __S, __mmask8 __U, __m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_vpshrdvq128_mask ((__v2di) __S, (__v2di) __A, (__v2di) __B, __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm128_maskz_shrdv_epi64(__mmask8 __U, __m128i __S, __m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_vpshrdvq128_maskz ((__v2di) __S, (__v2di) __A, (__v2di) __B, __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm128_shrdv_epi64(__m128i __S, __m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_vpshrdvq128_mask ((__v2di) __S, (__v2di) __A, (__v2di) __B, (__mmask8) -1); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_shrdv_epi32(__m256i __S, __mmask8 __U, __m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_vpshrdvd256_mask ((__v8si) __S, (__v8si) __A, (__v8si) __B, __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_shrdv_epi32(__mmask8 __U, __m256i __S, __m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_vpshrdvd256_maskz ((__v8si) __S, (__v8si) __A, (__v8si) __B, __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_shrdv_epi32(__m256i __S, __m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_vpshrdvd256_mask ((__v8si) __S, (__v8si) __A, (__v8si) __B, (__mmask8) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm128_mask_shrdv_epi32(__m128i __S, __mmask8 __U, __m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_vpshrdvd128_mask ((__v4si) __S, (__v4si) __A, (__v4si) __B, __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm128_maskz_shrdv_epi32(__mmask8 __U, __m128i __S, __m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_vpshrdvd128_maskz ((__v4si) __S, (__v4si) __A, (__v4si) __B, __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm128_shrdv_epi32(__m128i __S, __m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_vpshrdvd128_mask ((__v4si) __S, (__v4si) __A, (__v4si) __B, (__mmask8) -1); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_mask_shrdv_epi16(__m256i __S, __mmask16 __U, __m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_vpshrdvw256_mask ((__v16hi) __S, (__v16hi) __A, (__v16hi) __B, __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_maskz_shrdv_epi16(__mmask16 __U, __m256i __S, __m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_vpshrdvw256_maskz ((__v16hi) __S, (__v16hi) __A, (__v16hi) __B, __U); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_shrdv_epi16(__m256i __S, __m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_vpshrdvw256_mask ((__v16hi) __S, (__v16hi) __A, (__v16hi) __B, (__mmask16) -1); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm128_mask_shrdv_epi16(__m128i __S, __mmask8 __U, __m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_vpshrdvw128_mask ((__v8hi) __S, (__v8hi) __A, (__v8hi) __B, __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm128_maskz_shrdv_epi16(__mmask8 __U, __m128i __S, __m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_vpshrdvw128_maskz ((__v8hi) __S, (__v8hi) __A, (__v8hi) __B, __U); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm128_shrdv_epi16(__m128i __S, __m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_vpshrdvw128_mask ((__v8hi) __S, (__v8hi) __A, (__v8hi) __B, (__mmask8) -1); } #undef __DEFAULT_FN_ATTRS #endif # 749 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512vlvbmi2intrin.h" 3 # 232 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 2 3 #endif # 233 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || defined(__AVX512PF__) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 235 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512pfintrin.h" 1 3 /*===------------- avx512pfintrin.h - PF intrinsics ------------------=== * * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __IMMINTRIN_H #error "Never use directly; include instead." #endif # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512pfintrin.h" 3 #ifndef __AVX512PFINTRIN_H #define __AVX512PFINTRIN_H /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("avx512pf"))) #define _mm512_mask_prefetch_i32gather_pd(index, mask, addr, scale, hint) __extension__ ({\ __builtin_ia32_gatherpfdpd((__mmask8)(mask), (__v8si)(__m256i)(index), \ (long long const *)(addr), (int)(scale), \ (int)(hint)); }) #define _mm512_prefetch_i32gather_pd(index, addr, scale, hint) __extension__ ({\ __builtin_ia32_gatherpfdpd((__mmask8) -1, (__v8si)(__m256i)(index), \ (long long const *)(addr), (int)(scale), \ (int)(hint)); }) #define _mm512_mask_prefetch_i32gather_ps(index, mask, addr, scale, hint) ({\ __builtin_ia32_gatherpfdps((__mmask16)(mask), \ (__v16si)(__m512i)(index), (int const *)(addr), \ (int)(scale), (int)(hint)); }) #define _mm512_prefetch_i32gather_ps(index, addr, scale, hint) ({\ __builtin_ia32_gatherpfdps((__mmask16) -1, \ (__v16si)(__m512i)(index), (int const *)(addr), \ (int)(scale), (int)(hint)); }) #define _mm512_mask_prefetch_i64gather_pd(index, mask, addr, scale, hint) __extension__ ({\ __builtin_ia32_gatherpfqpd((__mmask8)(mask), (__v8di)(__m512i)(index), \ (long long const *)(addr), (int)(scale), \ (int)(hint)); }) #define _mm512_prefetch_i64gather_pd(index, addr, scale, hint) __extension__ ({\ __builtin_ia32_gatherpfqpd((__mmask8) -1, (__v8di)(__m512i)(index), \ (long long const *)(addr), (int)(scale), \ (int)(hint)); }) #define _mm512_mask_prefetch_i64gather_ps(index, mask, addr, scale, hint) ({\ __builtin_ia32_gatherpfqps((__mmask8)(mask), (__v8di)(__m512i)(index), \ (int const *)(addr), (int)(scale), (int)(hint)); }) #define _mm512_prefetch_i64gather_ps(index, addr, scale, hint) ({\ __builtin_ia32_gatherpfqps((__mmask8) -1, (__v8di)(__m512i)(index), \ (int const *)(addr), (int)(scale), (int)(hint)); }) #define _mm512_prefetch_i32scatter_pd(addr, index, scale, hint) __extension__ ({\ __builtin_ia32_scatterpfdpd((__mmask8)-1, (__v8si)(__m256i)(index), \ (long long *)(addr), (int)(scale), \ (int)(hint)); }) #define _mm512_mask_prefetch_i32scatter_pd(addr, mask, index, scale, hint) __extension__ ({\ __builtin_ia32_scatterpfdpd((__mmask8)(mask), (__v8si)(__m256i)(index), \ (long long *)(addr), (int)(scale), \ (int)(hint)); }) #define _mm512_prefetch_i32scatter_ps(addr, index, scale, hint) __extension__ ({\ __builtin_ia32_scatterpfdps((__mmask16)-1, (__v16si)(__m512i)(index), \ (int *)(addr), (int)(scale), (int)(hint)); }) #define _mm512_mask_prefetch_i32scatter_ps(addr, mask, index, scale, hint) __extension__ ({\ __builtin_ia32_scatterpfdps((__mmask16)(mask), \ (__v16si)(__m512i)(index), (int *)(addr), \ (int)(scale), (int)(hint)); }) #define _mm512_prefetch_i64scatter_pd(addr, index, scale, hint) __extension__ ({\ __builtin_ia32_scatterpfqpd((__mmask8)-1, (__v8di)(__m512i)(index), \ (long long *)(addr), (int)(scale), \ (int)(hint)); }) #define _mm512_mask_prefetch_i64scatter_pd(addr, mask, index, scale, hint) __extension__ ({\ __builtin_ia32_scatterpfqpd((__mmask8)(mask), (__v8di)(__m512i)(index), \ (long long *)(addr), (int)(scale), \ (int)(hint)); }) #define _mm512_prefetch_i64scatter_ps(addr, index, scale, hint) __extension__ ({\ __builtin_ia32_scatterpfqps((__mmask8)-1, (__v8di)(__m512i)(index), \ (int *)(addr), (int)(scale), (int)(hint)); }) #define _mm512_mask_prefetch_i64scatter_ps(addr, mask, index, scale, hint) __extension__ ({\ __builtin_ia32_scatterpfqps((__mmask8)(mask), (__v8di)(__m512i)(index), \ (int *)(addr), (int)(scale), (int)(hint)); }) #undef __DEFAULT_FN_ATTRS #endif # 112 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/avx512pfintrin.h" 3 # 236 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 2 3 #endif # 237 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || defined(__PKU__) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 239 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/pkuintrin.h" 1 3 /*===------------- pkuintrin.h - PKU intrinsics ------------------=== * * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __IMMINTRIN_H #error "Never use directly; include instead." #endif # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/pkuintrin.h" 3 #ifndef __PKUINTRIN_H #define __PKUINTRIN_H /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("pku"))) static __inline__ unsigned int __DEFAULT_FN_ATTRS _rdpkru_u32(void) { return __builtin_ia32_rdpkru(); } static __inline__ void __DEFAULT_FN_ATTRS _wrpkru(unsigned int __val) { return __builtin_ia32_wrpkru(__val); } #undef __DEFAULT_FN_ATTRS #endif # 49 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/pkuintrin.h" 3 # 240 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 2 3 #endif # 241 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || defined(__VAES__) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 243 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/vaesintrin.h" 1 3 /*===------------------ vaesintrin.h - VAES intrinsics ---------------------=== * * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __IMMINTRIN_H #error "Never use directly; include instead." #endif # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/vaesintrin.h" 3 #ifndef __VAESINTRIN_H #define __VAESINTRIN_H /* Default attributes for YMM forms. */ #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("vaes"))) /* Default attributes for ZMM forms. */ #define __DEFAULT_FN_ATTRS_F __attribute__((__always_inline__, __nodebug__, __target__("avx512f,vaes"))) static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_aesenc_epi128(__m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_aesenc256((__v4di) __A, (__v4di) __B); } static __inline__ __m512i __DEFAULT_FN_ATTRS_F _mm512_aesenc_epi128(__m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_aesenc512((__v8di) __A, (__v8di) __B); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_aesdec_epi128(__m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_aesdec256((__v4di) __A, (__v4di) __B); } static __inline__ __m512i __DEFAULT_FN_ATTRS_F _mm512_aesdec_epi128(__m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_aesdec512((__v8di) __A, (__v8di) __B); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_aesenclast_epi128(__m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_aesenclast256((__v4di) __A, (__v4di) __B); } static __inline__ __m512i __DEFAULT_FN_ATTRS_F _mm512_aesenclast_epi128(__m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_aesenclast512((__v8di) __A, (__v8di) __B); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_aesdeclast_epi128(__m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_aesdeclast256((__v4di) __A, (__v4di) __B); } static __inline__ __m512i __DEFAULT_FN_ATTRS_F _mm512_aesdeclast_epi128(__m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_aesdeclast512((__v8di) __A, (__v8di) __B); } #undef __DEFAULT_FN_ATTRS #undef __DEFAULT_FN_ATTRS_F #endif # 99 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/vaesintrin.h" 3 # 244 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 2 3 #endif # 245 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || defined(__GFNI__) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 247 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/gfniintrin.h" 1 3 /*===----------------- gfniintrin.h - GFNI intrinsics ----------------------=== * * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __IMMINTRIN_H #error "Never use directly; include instead." #endif # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/gfniintrin.h" 3 #ifndef __GFNIINTRIN_H #define __GFNIINTRIN_H #define _mm_gf2p8affineinv_epi64_epi8(A, B, I) __extension__ ({ \ (__m128i)__builtin_ia32_vgf2p8affineinvqb_v16qi((__v16qi)(__m128i)(A), \ (__v16qi)(__m128i)(B), \ (char)(I)); }) #define _mm_mask_gf2p8affineinv_epi64_epi8(S, U, A, B, I) __extension__ ({ \ (__m128i)__builtin_ia32_selectb_128((__mmask16)(U), \ (__v16qi)_mm_gf2p8affineinv_epi64_epi8(A, B, I), \ (__v16qi)(__m128i)(S)); }) #define _mm_maskz_gf2p8affineinv_epi64_epi8(U, A, B, I) __extension__ ({ \ (__m128i)_mm_mask_gf2p8affineinv_epi64_epi8((__m128i)_mm_setzero_si128(), \ U, A, B, I); }) #define _mm256_gf2p8affineinv_epi64_epi8(A, B, I) __extension__ ({ \ (__m256i)__builtin_ia32_vgf2p8affineinvqb_v32qi((__v32qi)(__m256i)(A), \ (__v32qi)(__m256i)(B), \ (char)(I)); }) #define _mm256_mask_gf2p8affineinv_epi64_epi8(S, U, A, B, I) __extension__ ({ \ (__m256i)__builtin_ia32_selectb_256((__mmask32)(U), \ (__v32qi)_mm256_gf2p8affineinv_epi64_epi8(A, B, I), \ (__v32qi)(__m256i)(S)); }) #define _mm256_maskz_gf2p8affineinv_epi64_epi8(U, A, B, I) __extension__ ({ \ (__m256i)_mm256_mask_gf2p8affineinv_epi64_epi8((__m256i)_mm256_setzero_si256(), \ U, A, B, I); }) #define _mm512_gf2p8affineinv_epi64_epi8(A, B, I) __extension__ ({ \ (__m512i)__builtin_ia32_vgf2p8affineinvqb_v64qi((__v64qi)(__m512i)(A), \ (__v64qi)(__m512i)(B), \ (char)(I)); }) #define _mm512_mask_gf2p8affineinv_epi64_epi8(S, U, A, B, I) __extension__ ({ \ (__m512i)__builtin_ia32_selectb_512((__mmask64)(U), \ (__v64qi)_mm512_gf2p8affineinv_epi64_epi8(A, B, I), \ (__v64qi)(__m512i)(S)); }) #define _mm512_maskz_gf2p8affineinv_epi64_epi8(U, A, B, I) __extension__ ({ \ (__m512i)_mm512_mask_gf2p8affineinv_epi64_epi8((__m512i)_mm512_setzero_qi(), \ U, A, B, I); }) #define _mm_gf2p8affine_epi64_epi8(A, B, I) __extension__ ({ \ (__m128i)__builtin_ia32_vgf2p8affineqb_v16qi((__v16qi)(__m128i)(A), \ (__v16qi)(__m128i)(B), \ (char)(I)); }) #define _mm_mask_gf2p8affine_epi64_epi8(S, U, A, B, I) __extension__ ({ \ (__m128i)__builtin_ia32_selectb_128((__mmask16)(U), \ (__v16qi)_mm_gf2p8affine_epi64_epi8(A, B, I), \ (__v16qi)(__m128i)(S)); }) #define _mm_maskz_gf2p8affine_epi64_epi8(U, A, B, I) __extension__ ({ \ (__m128i)_mm_mask_gf2p8affine_epi64_epi8((__m128i)_mm_setzero_si128(), \ U, A, B, I); }) #define _mm256_gf2p8affine_epi64_epi8(A, B, I) __extension__ ({ \ (__m256i)__builtin_ia32_vgf2p8affineqb_v32qi((__v32qi)(__m256i)(A), \ (__v32qi)(__m256i)(B), \ (char)(I)); }) #define _mm256_mask_gf2p8affine_epi64_epi8(S, U, A, B, I) __extension__ ({ \ (__m256i)__builtin_ia32_selectb_256((__mmask32)(U), \ (__v32qi)_mm256_gf2p8affine_epi64_epi8(A, B, I), \ (__v32qi)(__m256i)(S)); }) #define _mm256_maskz_gf2p8affine_epi64_epi8(U, A, B, I) __extension__ ({ \ (__m256i)_mm256_mask_gf2p8affine_epi64_epi8((__m256i)_mm256_setzero_si256(), \ U, A, B, I); }) #define _mm512_gf2p8affine_epi64_epi8(A, B, I) __extension__ ({ \ (__m512i)__builtin_ia32_vgf2p8affineqb_v64qi((__v64qi)(__m512i)(A), \ (__v64qi)(__m512i)(B), \ (char)(I)); }) #define _mm512_mask_gf2p8affine_epi64_epi8(S, U, A, B, I) __extension__ ({ \ (__m512i)__builtin_ia32_selectb_512((__mmask64)(U), \ (__v64qi)_mm512_gf2p8affine_epi64_epi8(A, B, I), \ (__v64qi)(__m512i)(S)); }) #define _mm512_maskz_gf2p8affine_epi64_epi8(U, A, B, I) __extension__ ({ \ (__m512i)_mm512_mask_gf2p8affine_epi64_epi8((__m512i)_mm512_setzero_qi(), \ U, A, B, I); }) /* Default attributes for simple form (no masking). */ #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("gfni"))) /* Default attributes for ZMM forms. */ #define __DEFAULT_FN_ATTRS_F __attribute__((__always_inline__, __nodebug__, __target__("avx512bw,gfni"))) /* Default attributes for VLX forms. */ #define __DEFAULT_FN_ATTRS_VL __attribute__((__always_inline__, __nodebug__, __target__("avx512bw,avx512vl,gfni"))) static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_gf2p8mul_epi8(__m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_vgf2p8mulb_v16qi((__v16qi) __A, (__v16qi) __B); } static __inline__ __m128i __DEFAULT_FN_ATTRS_VL _mm_mask_gf2p8mul_epi8(__m128i __S, __mmask16 __U, __m128i __A, __m128i __B) { return (__m128i) __builtin_ia32_selectb_128(__U, (__v16qi) _mm_gf2p8mul_epi8(__A, __B), (__v16qi) __S); } static __inline__ __m128i __DEFAULT_FN_ATTRS_VL _mm_maskz_gf2p8mul_epi8(__mmask16 __U, __m128i __A, __m128i __B) { return _mm_mask_gf2p8mul_epi8((__m128i)_mm_setzero_si128(), __U, __A, __B); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_gf2p8mul_epi8(__m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_vgf2p8mulb_v32qi((__v32qi) __A, (__v32qi) __B); } static __inline__ __m256i __DEFAULT_FN_ATTRS_VL _mm256_mask_gf2p8mul_epi8(__m256i __S, __mmask32 __U, __m256i __A, __m256i __B) { return (__m256i) __builtin_ia32_selectb_256(__U, (__v32qi) _mm256_gf2p8mul_epi8(__A, __B), (__v32qi) __S); } static __inline__ __m256i __DEFAULT_FN_ATTRS_VL _mm256_maskz_gf2p8mul_epi8(__mmask32 __U, __m256i __A, __m256i __B) { return _mm256_mask_gf2p8mul_epi8((__m256i)_mm256_setzero_si256(), __U, __A, __B); } static __inline__ __m512i __DEFAULT_FN_ATTRS_F _mm512_gf2p8mul_epi8(__m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_vgf2p8mulb_v64qi((__v64qi) __A, (__v64qi) __B); } static __inline__ __m512i __DEFAULT_FN_ATTRS_F _mm512_mask_gf2p8mul_epi8(__m512i __S, __mmask64 __U, __m512i __A, __m512i __B) { return (__m512i) __builtin_ia32_selectb_512(__U, (__v64qi) _mm512_gf2p8mul_epi8(__A, __B), (__v64qi) __S); } static __inline__ __m512i __DEFAULT_FN_ATTRS_F _mm512_maskz_gf2p8mul_epi8(__mmask64 __U, __m512i __A, __m512i __B) { return _mm512_mask_gf2p8mul_epi8((__m512i)_mm512_setzero_qi(), __U, __A, __B); } #undef __DEFAULT_FN_ATTRS #undef __DEFAULT_FN_ATTRS_F #undef __DEFAULT_FN_ATTRS_VL #endif // __GFNIINTRIN_H # 202 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/gfniintrin.h" 3 # 248 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 2 3 #endif # 249 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || defined(__RDRND__) static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("rdrnd"))) _rdrand16_step(unsigned short *__p) { return __builtin_ia32_rdrand16_step(__p); } static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("rdrnd"))) _rdrand32_step(unsigned int *__p) { return __builtin_ia32_rdrand32_step(__p); } #ifdef __x86_64__ static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("rdrnd"))) _rdrand64_step(unsigned long long *__p) { return __builtin_ia32_rdrand64_step(__p); } #endif # 270 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 #endif /* __RDRND__ */ # 271 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 /* __bit_scan_forward */ static __inline__ int __attribute__((__always_inline__, __nodebug__)) _bit_scan_forward(int __A) { return __builtin_ctz(__A); } /* __bit_scan_reverse */ static __inline__ int __attribute__((__always_inline__, __nodebug__)) _bit_scan_reverse(int __A) { return 31 - __builtin_clz(__A); } #if !defined(_MSC_VER) || __has_feature(modules) || defined(__FSGSBASE__) #ifdef __x86_64__ static __inline__ unsigned int __attribute__((__always_inline__, __nodebug__, __target__("fsgsbase"))) _readfsbase_u32(void) { return __builtin_ia32_rdfsbase32(); } static __inline__ unsigned long long __attribute__((__always_inline__, __nodebug__, __target__("fsgsbase"))) _readfsbase_u64(void) { return __builtin_ia32_rdfsbase64(); } static __inline__ unsigned int __attribute__((__always_inline__, __nodebug__, __target__("fsgsbase"))) _readgsbase_u32(void) { return __builtin_ia32_rdgsbase32(); } static __inline__ unsigned long long __attribute__((__always_inline__, __nodebug__, __target__("fsgsbase"))) _readgsbase_u64(void) { return __builtin_ia32_rdgsbase64(); } static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("fsgsbase"))) _writefsbase_u32(unsigned int __V) { return __builtin_ia32_wrfsbase32(__V); } static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("fsgsbase"))) _writefsbase_u64(unsigned long long __V) { return __builtin_ia32_wrfsbase64(__V); } static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("fsgsbase"))) _writegsbase_u32(unsigned int __V) { return __builtin_ia32_wrgsbase32(__V); } static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("fsgsbase"))) _writegsbase_u64(unsigned long long __V) { return __builtin_ia32_wrgsbase64(__V); } #endif # 335 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 #endif /* __FSGSBASE__ */ # 336 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || defined(__RTM__) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 338 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/rtmintrin.h" 1 3 /*===---- rtmintrin.h - RTM intrinsics -------------------------------------=== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __IMMINTRIN_H #error "Never use directly; include instead." #endif # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/rtmintrin.h" 3 #ifndef __RTMINTRIN_H #define __RTMINTRIN_H #define _XBEGIN_STARTED (~0u) #define _XABORT_EXPLICIT (1 << 0) #define _XABORT_RETRY (1 << 1) #define _XABORT_CONFLICT (1 << 2) #define _XABORT_CAPACITY (1 << 3) #define _XABORT_DEBUG (1 << 4) #define _XABORT_NESTED (1 << 5) #define _XABORT_CODE(x) (((x) >> 24) & 0xFF) /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("rtm"))) static __inline__ unsigned int __DEFAULT_FN_ATTRS _xbegin(void) { return __builtin_ia32_xbegin(); } static __inline__ void __DEFAULT_FN_ATTRS _xend(void) { __builtin_ia32_xend(); } #define _xabort(imm) __builtin_ia32_xabort((imm)) #undef __DEFAULT_FN_ATTRS #endif /* __RTMINTRIN_H */ # 60 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/rtmintrin.h" 3 # 339 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 2 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 339 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xtestintrin.h" 1 3 /*===---- xtestintrin.h - XTEST intrinsic ---------------------------------=== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __IMMINTRIN_H #error "Never use directly; include instead." #endif # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xtestintrin.h" 3 #ifndef __XTESTINTRIN_H #define __XTESTINTRIN_H /* xtest returns non-zero if the instruction is executed within an RTM or active * HLE region. */ /* FIXME: This can be an either or for RTM/HLE. Deal with this when HLE is * supported. */ static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("rtm"))) _xtest(void) { return __builtin_ia32_xtest(); } #endif # 42 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xtestintrin.h" 3 # 340 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 2 3 #endif # 341 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || defined(__SHA__) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 343 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/shaintrin.h" 1 3 /*===---- shaintrin.h - SHA intrinsics -------------------------------------=== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __IMMINTRIN_H #error "Never use directly; include instead." #endif # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/shaintrin.h" 3 #ifndef __SHAINTRIN_H #define __SHAINTRIN_H /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("sha"))) #define _mm_sha1rnds4_epu32(V1, V2, M) __extension__ ({ \ __builtin_ia32_sha1rnds4((__v4si)(__m128i)(V1), (__v4si)(__m128i)(V2), (M)); }) static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sha1nexte_epu32(__m128i __X, __m128i __Y) { return (__m128i)__builtin_ia32_sha1nexte((__v4si)__X, (__v4si)__Y); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sha1msg1_epu32(__m128i __X, __m128i __Y) { return (__m128i)__builtin_ia32_sha1msg1((__v4si)__X, (__v4si)__Y); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sha1msg2_epu32(__m128i __X, __m128i __Y) { return (__m128i)__builtin_ia32_sha1msg2((__v4si)__X, (__v4si)__Y); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sha256rnds2_epu32(__m128i __X, __m128i __Y, __m128i __Z) { return (__m128i)__builtin_ia32_sha256rnds2((__v4si)__X, (__v4si)__Y, (__v4si)__Z); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sha256msg1_epu32(__m128i __X, __m128i __Y) { return (__m128i)__builtin_ia32_sha256msg1((__v4si)__X, (__v4si)__Y); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sha256msg2_epu32(__m128i __X, __m128i __Y) { return (__m128i)__builtin_ia32_sha256msg2((__v4si)__X, (__v4si)__Y); } #undef __DEFAULT_FN_ATTRS #endif /* __SHAINTRIN_H */ # 76 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/shaintrin.h" 3 # 344 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 2 3 #endif # 345 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || defined(__FXSR__) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 347 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/fxsrintrin.h" 1 3 /*===---- fxsrintrin.h - FXSR intrinsic ------------------------------------=== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __IMMINTRIN_H #error "Never use directly; include instead." #endif # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/fxsrintrin.h" 3 #ifndef __FXSRINTRIN_H #define __FXSRINTRIN_H #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("fxsr"))) /// \brief Saves the XMM, MMX, MXCSR and x87 FPU registers into a 512-byte /// memory region pointed to by the input parameter \a __p. /// /// \headerfile /// /// This intrinsic corresponds to the FXSAVE instruction. /// /// \param __p /// A pointer to a 512-byte memory region. The beginning of this memory /// region should be aligned on a 16-byte boundary. static __inline__ void __DEFAULT_FN_ATTRS _fxsave(void *__p) { return __builtin_ia32_fxsave(__p); } /// \brief Restores the XMM, MMX, MXCSR and x87 FPU registers from the 512-byte /// memory region pointed to by the input parameter \a __p. The contents of /// this memory region should have been written to by a previous \c _fxsave /// or \c _fxsave64 intrinsic. /// /// \headerfile /// /// This intrinsic corresponds to the FXRSTOR instruction. /// /// \param __p /// A pointer to a 512-byte memory region. The beginning of this memory /// region should be aligned on a 16-byte boundary. static __inline__ void __DEFAULT_FN_ATTRS _fxrstor(void *__p) { return __builtin_ia32_fxrstor(__p); } #ifdef __x86_64__ /// \brief Saves the XMM, MMX, MXCSR and x87 FPU registers into a 512-byte /// memory region pointed to by the input parameter \a __p. /// /// \headerfile /// /// This intrinsic corresponds to the FXSAVE64 instruction. /// /// \param __p /// A pointer to a 512-byte memory region. The beginning of this memory /// region should be aligned on a 16-byte boundary. static __inline__ void __DEFAULT_FN_ATTRS _fxsave64(void *__p) { return __builtin_ia32_fxsave64(__p); } /// \brief Restores the XMM, MMX, MXCSR and x87 FPU registers from the 512-byte /// memory region pointed to by the input parameter \a __p. The contents of /// this memory region should have been written to by a previous \c _fxsave /// or \c _fxsave64 intrinsic. /// /// \headerfile /// /// This intrinsic corresponds to the FXRSTOR64 instruction. /// /// \param __p /// A pointer to a 512-byte memory region. The beginning of this memory /// region should be aligned on a 16-byte boundary. static __inline__ void __DEFAULT_FN_ATTRS _fxrstor64(void *__p) { return __builtin_ia32_fxrstor64(__p); } #endif # 102 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/fxsrintrin.h" 3 #undef __DEFAULT_FN_ATTRS #endif # 106 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/fxsrintrin.h" 3 # 348 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 2 3 #endif # 349 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || defined(__XSAVE__) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 351 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xsaveintrin.h" 1 3 /*===---- xsaveintrin.h - XSAVE intrinsic ------------------------------------=== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __IMMINTRIN_H #error "Never use directly; include instead." #endif # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xsaveintrin.h" 3 #ifndef __XSAVEINTRIN_H #define __XSAVEINTRIN_H /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("xsave"))) static __inline__ void __DEFAULT_FN_ATTRS _xsave(void *__p, unsigned long long __m) { return __builtin_ia32_xsave(__p, __m); } static __inline__ void __DEFAULT_FN_ATTRS _xrstor(void *__p, unsigned long long __m) { return __builtin_ia32_xrstor(__p, __m); } #ifdef __x86_64__ static __inline__ void __DEFAULT_FN_ATTRS _xsave64(void *__p, unsigned long long __m) { return __builtin_ia32_xsave64(__p, __m); } static __inline__ void __DEFAULT_FN_ATTRS _xrstor64(void *__p, unsigned long long __m) { return __builtin_ia32_xrstor64(__p, __m); } #endif # 55 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xsaveintrin.h" 3 #undef __DEFAULT_FN_ATTRS #endif # 59 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xsaveintrin.h" 3 # 352 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 2 3 #endif # 353 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || defined(__XSAVEOPT__) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 355 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xsaveoptintrin.h" 1 3 /*===---- xsaveoptintrin.h - XSAVEOPT intrinsic ------------------------------------=== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __IMMINTRIN_H #error "Never use directly; include instead." #endif # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xsaveoptintrin.h" 3 #ifndef __XSAVEOPTINTRIN_H #define __XSAVEOPTINTRIN_H /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("xsaveopt"))) static __inline__ void __DEFAULT_FN_ATTRS _xsaveopt(void *__p, unsigned long long __m) { return __builtin_ia32_xsaveopt(__p, __m); } #ifdef __x86_64__ static __inline__ void __DEFAULT_FN_ATTRS _xsaveopt64(void *__p, unsigned long long __m) { return __builtin_ia32_xsaveopt64(__p, __m); } #endif # 45 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xsaveoptintrin.h" 3 #undef __DEFAULT_FN_ATTRS #endif # 49 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xsaveoptintrin.h" 3 # 356 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 2 3 #endif # 357 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || defined(__XSAVEC__) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 359 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xsavecintrin.h" 1 3 /*===---- xsavecintrin.h - XSAVEC intrinsic ------------------------------------=== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __IMMINTRIN_H #error "Never use directly; include instead." #endif # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xsavecintrin.h" 3 #ifndef __XSAVECINTRIN_H #define __XSAVECINTRIN_H /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("xsavec"))) static __inline__ void __DEFAULT_FN_ATTRS _xsavec(void *__p, unsigned long long __m) { __builtin_ia32_xsavec(__p, __m); } #ifdef __x86_64__ static __inline__ void __DEFAULT_FN_ATTRS _xsavec64(void *__p, unsigned long long __m) { __builtin_ia32_xsavec64(__p, __m); } #endif # 45 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xsavecintrin.h" 3 #undef __DEFAULT_FN_ATTRS #endif # 49 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xsavecintrin.h" 3 # 360 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 2 3 #endif # 361 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || defined(__XSAVES__) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 363 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xsavesintrin.h" 1 3 /*===---- xsavesintrin.h - XSAVES intrinsic ------------------------------------=== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __IMMINTRIN_H #error "Never use directly; include instead." #endif # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xsavesintrin.h" 3 #ifndef __XSAVESINTRIN_H #define __XSAVESINTRIN_H /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("xsaves"))) static __inline__ void __DEFAULT_FN_ATTRS _xsaves(void *__p, unsigned long long __m) { __builtin_ia32_xsaves(__p, __m); } static __inline__ void __DEFAULT_FN_ATTRS _xrstors(void *__p, unsigned long long __m) { __builtin_ia32_xrstors(__p, __m); } #ifdef __x86_64__ static __inline__ void __DEFAULT_FN_ATTRS _xrstors64(void *__p, unsigned long long __m) { __builtin_ia32_xrstors64(__p, __m); } static __inline__ void __DEFAULT_FN_ATTRS _xsaves64(void *__p, unsigned long long __m) { __builtin_ia32_xsaves64(__p, __m); } #endif # 55 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xsavesintrin.h" 3 #undef __DEFAULT_FN_ATTRS #endif # 59 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xsavesintrin.h" 3 # 364 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 2 3 #endif # 365 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || defined(__SHSTK__) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 367 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cetintrin.h" 1 3 /*===---- cetintrin.h - CET intrinsic ------------------------------------=== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __IMMINTRIN_H #error "Never use directly; include instead." #endif # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cetintrin.h" 3 #ifndef __CETINTRIN_H #define __CETINTRIN_H /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS \ __attribute__((__always_inline__, __nodebug__, __target__("shstk"))) static __inline__ void __DEFAULT_FN_ATTRS _incsspd(int __a) { __builtin_ia32_incsspd(__a); } #ifdef __x86_64__ static __inline__ void __DEFAULT_FN_ATTRS _incsspq(unsigned long long __a) { __builtin_ia32_incsspq(__a); } #endif /* __x86_64__ */ # 44 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cetintrin.h" 3 static __inline__ unsigned int __DEFAULT_FN_ATTRS _rdsspd(unsigned int __a) { return __builtin_ia32_rdsspd(__a); } #ifdef __x86_64__ static __inline__ unsigned long long __DEFAULT_FN_ATTRS _rdsspq(unsigned long long __a) { return __builtin_ia32_rdsspq(__a); } #endif /* __x86_64__ */ # 54 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cetintrin.h" 3 static __inline__ void __DEFAULT_FN_ATTRS _saveprevssp() { __builtin_ia32_saveprevssp(); } static __inline__ void __DEFAULT_FN_ATTRS _rstorssp(void * __p) { __builtin_ia32_rstorssp(__p); } static __inline__ void __DEFAULT_FN_ATTRS _wrssd(unsigned int __a, void * __p) { __builtin_ia32_wrssd(__a, __p); } #ifdef __x86_64__ static __inline__ void __DEFAULT_FN_ATTRS _wrssq(unsigned long long __a, void * __p) { __builtin_ia32_wrssq(__a, __p); } #endif /* __x86_64__ */ # 72 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cetintrin.h" 3 static __inline__ void __DEFAULT_FN_ATTRS _wrussd(unsigned int __a, void * __p) { __builtin_ia32_wrussd(__a, __p); } #ifdef __x86_64__ static __inline__ void __DEFAULT_FN_ATTRS _wrussq(unsigned long long __a, void * __p) { __builtin_ia32_wrussq(__a, __p); } #endif /* __x86_64__ */ # 82 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cetintrin.h" 3 static __inline__ void __DEFAULT_FN_ATTRS _setssbsy() { __builtin_ia32_setssbsy(); } static __inline__ void __DEFAULT_FN_ATTRS _clrssbsy(void * __p) { __builtin_ia32_clrssbsy(__p); } #undef __DEFAULT_FN_ATTRS #endif /* __CETINTRIN_H */ # 94 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cetintrin.h" 3 # 368 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 2 3 #endif # 369 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 /* Some intrinsics inside adxintrin.h are available only on processors with ADX, * whereas others are also available at all times. */ #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 372 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/adxintrin.h" 1 3 /*===---- adxintrin.h - ADX intrinsics -------------------------------------=== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __IMMINTRIN_H #error "Never use directly; include instead." #endif # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/adxintrin.h" 3 #ifndef __ADXINTRIN_H #define __ADXINTRIN_H /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__)) /* Intrinsics that are available only if __ADX__ defined */ static __inline unsigned char __attribute__((__always_inline__, __nodebug__, __target__("adx"))) _addcarryx_u32(unsigned char __cf, unsigned int __x, unsigned int __y, unsigned int *__p) { return __builtin_ia32_addcarryx_u32(__cf, __x, __y, __p); } #ifdef __x86_64__ static __inline unsigned char __attribute__((__always_inline__, __nodebug__, __target__("adx"))) _addcarryx_u64(unsigned char __cf, unsigned long long __x, unsigned long long __y, unsigned long long *__p) { return __builtin_ia32_addcarryx_u64(__cf, __x, __y, __p); } #endif # 50 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/adxintrin.h" 3 /* Intrinsics that are also available if __ADX__ undefined */ static __inline unsigned char __DEFAULT_FN_ATTRS _addcarry_u32(unsigned char __cf, unsigned int __x, unsigned int __y, unsigned int *__p) { return __builtin_ia32_addcarry_u32(__cf, __x, __y, __p); } #ifdef __x86_64__ static __inline unsigned char __DEFAULT_FN_ATTRS _addcarry_u64(unsigned char __cf, unsigned long long __x, unsigned long long __y, unsigned long long *__p) { return __builtin_ia32_addcarry_u64(__cf, __x, __y, __p); } #endif # 67 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/adxintrin.h" 3 static __inline unsigned char __DEFAULT_FN_ATTRS _subborrow_u32(unsigned char __cf, unsigned int __x, unsigned int __y, unsigned int *__p) { return __builtin_ia32_subborrow_u32(__cf, __x, __y, __p); } #ifdef __x86_64__ static __inline unsigned char __DEFAULT_FN_ATTRS _subborrow_u64(unsigned char __cf, unsigned long long __x, unsigned long long __y, unsigned long long *__p) { return __builtin_ia32_subborrow_u64(__cf, __x, __y, __p); } #endif # 83 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/adxintrin.h" 3 #undef __DEFAULT_FN_ATTRS #endif /* __ADXINTRIN_H */ # 87 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/adxintrin.h" 3 # 373 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 2 3 #endif /* __IMMINTRIN_H */ # 375 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/immintrin.h" 3 # 30 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/x86intrin.h" 2 3 #if !defined(_MSC_VER) || __has_feature(modules) || defined(__3dNOW__) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 32 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/x86intrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/mm3dnow.h" 1 3 /*===---- mm3dnow.h - 3DNow! intrinsics ------------------------------------=== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef _MM3DNOW_H_INCLUDED #define _MM3DNOW_H_INCLUDED #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/mm3dnow.h" 3 # 28 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/mm3dnow.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 28 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/mm3dnow.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/prfchwintrin.h" 1 3 /*===---- prfchwintrin.h - PREFETCHW intrinsic -----------------------------=== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #if !defined(__X86INTRIN_H) && !defined(_MM3DNOW_H_INCLUDED) #error "Never use directly; include or instead." #endif # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/prfchwintrin.h" 3 #ifndef __PRFCHWINTRIN_H #define __PRFCHWINTRIN_H #if defined(__PRFCHW__) || defined(__3dNOW__) /// \brief Loads a memory sequence containing the specified memory address into /// all data cache levels. The cache-coherency state is set to exclusive. /// Data can be read from and written to the cache line without additional /// delay. /// /// \headerfile /// /// This intrinsic corresponds to the \c PREFETCHT0 instruction. /// /// \param __P /// A pointer specifying the memory address to be prefetched. static __inline__ void __attribute__((__always_inline__, __nodebug__)) _m_prefetch(void *__P) { __builtin_prefetch (__P, 0, 3 /* _MM_HINT_T0 */); } /// \brief Loads a memory sequence containing the specified memory address into /// the L1 data cache and sets the cache-coherency to modified. This /// provides a hint to the processor that the cache line will be modified. /// It is intended for use when the cache line will be written to shortly /// after the prefetch is performed. /// /// Note that the effect of this intrinsic is dependent on the processor /// implementation. /// /// \headerfile /// /// This intrinsic corresponds to the \c PREFETCHW instruction. /// /// \param __P /// A pointer specifying the memory address to be prefetched. static __inline__ void __attribute__((__always_inline__, __nodebug__)) _m_prefetchw(void *__P) { __builtin_prefetch (__P, 1, 3 /* _MM_HINT_T0 */); } #endif # 70 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/prfchwintrin.h" 3 #endif /* __PRFCHWINTRIN_H */ # 72 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/prfchwintrin.h" 3 # 29 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/mm3dnow.h" 2 3 typedef float __v2sf __attribute__((__vector_size__(8))); /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("3dnow"))) static __inline__ void __DEFAULT_FN_ATTRS _m_femms(void) { __builtin_ia32_femms(); } static __inline__ __m64 __DEFAULT_FN_ATTRS _m_pavgusb(__m64 __m1, __m64 __m2) { return (__m64)__builtin_ia32_pavgusb((__v8qi)__m1, (__v8qi)__m2); } static __inline__ __m64 __DEFAULT_FN_ATTRS _m_pf2id(__m64 __m) { return (__m64)__builtin_ia32_pf2id((__v2sf)__m); } static __inline__ __m64 __DEFAULT_FN_ATTRS _m_pfacc(__m64 __m1, __m64 __m2) { return (__m64)__builtin_ia32_pfacc((__v2sf)__m1, (__v2sf)__m2); } static __inline__ __m64 __DEFAULT_FN_ATTRS _m_pfadd(__m64 __m1, __m64 __m2) { return (__m64)__builtin_ia32_pfadd((__v2sf)__m1, (__v2sf)__m2); } static __inline__ __m64 __DEFAULT_FN_ATTRS _m_pfcmpeq(__m64 __m1, __m64 __m2) { return (__m64)__builtin_ia32_pfcmpeq((__v2sf)__m1, (__v2sf)__m2); } static __inline__ __m64 __DEFAULT_FN_ATTRS _m_pfcmpge(__m64 __m1, __m64 __m2) { return (__m64)__builtin_ia32_pfcmpge((__v2sf)__m1, (__v2sf)__m2); } static __inline__ __m64 __DEFAULT_FN_ATTRS _m_pfcmpgt(__m64 __m1, __m64 __m2) { return (__m64)__builtin_ia32_pfcmpgt((__v2sf)__m1, (__v2sf)__m2); } static __inline__ __m64 __DEFAULT_FN_ATTRS _m_pfmax(__m64 __m1, __m64 __m2) { return (__m64)__builtin_ia32_pfmax((__v2sf)__m1, (__v2sf)__m2); } static __inline__ __m64 __DEFAULT_FN_ATTRS _m_pfmin(__m64 __m1, __m64 __m2) { return (__m64)__builtin_ia32_pfmin((__v2sf)__m1, (__v2sf)__m2); } static __inline__ __m64 __DEFAULT_FN_ATTRS _m_pfmul(__m64 __m1, __m64 __m2) { return (__m64)__builtin_ia32_pfmul((__v2sf)__m1, (__v2sf)__m2); } static __inline__ __m64 __DEFAULT_FN_ATTRS _m_pfrcp(__m64 __m) { return (__m64)__builtin_ia32_pfrcp((__v2sf)__m); } static __inline__ __m64 __DEFAULT_FN_ATTRS _m_pfrcpit1(__m64 __m1, __m64 __m2) { return (__m64)__builtin_ia32_pfrcpit1((__v2sf)__m1, (__v2sf)__m2); } static __inline__ __m64 __DEFAULT_FN_ATTRS _m_pfrcpit2(__m64 __m1, __m64 __m2) { return (__m64)__builtin_ia32_pfrcpit2((__v2sf)__m1, (__v2sf)__m2); } static __inline__ __m64 __DEFAULT_FN_ATTRS _m_pfrsqrt(__m64 __m) { return (__m64)__builtin_ia32_pfrsqrt((__v2sf)__m); } static __inline__ __m64 __DEFAULT_FN_ATTRS _m_pfrsqrtit1(__m64 __m1, __m64 __m2) { return (__m64)__builtin_ia32_pfrsqit1((__v2sf)__m1, (__v2sf)__m2); } static __inline__ __m64 __DEFAULT_FN_ATTRS _m_pfsub(__m64 __m1, __m64 __m2) { return (__m64)__builtin_ia32_pfsub((__v2sf)__m1, (__v2sf)__m2); } static __inline__ __m64 __DEFAULT_FN_ATTRS _m_pfsubr(__m64 __m1, __m64 __m2) { return (__m64)__builtin_ia32_pfsubr((__v2sf)__m1, (__v2sf)__m2); } static __inline__ __m64 __DEFAULT_FN_ATTRS _m_pi2fd(__m64 __m) { return (__m64)__builtin_ia32_pi2fd((__v2si)__m); } static __inline__ __m64 __DEFAULT_FN_ATTRS _m_pmulhrw(__m64 __m1, __m64 __m2) { return (__m64)__builtin_ia32_pmulhrw((__v4hi)__m1, (__v4hi)__m2); } /* Handle the 3dnowa instructions here. */ #undef __DEFAULT_FN_ATTRS #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("3dnowa"))) static __inline__ __m64 __DEFAULT_FN_ATTRS _m_pf2iw(__m64 __m) { return (__m64)__builtin_ia32_pf2iw((__v2sf)__m); } static __inline__ __m64 __DEFAULT_FN_ATTRS _m_pfnacc(__m64 __m1, __m64 __m2) { return (__m64)__builtin_ia32_pfnacc((__v2sf)__m1, (__v2sf)__m2); } static __inline__ __m64 __DEFAULT_FN_ATTRS _m_pfpnacc(__m64 __m1, __m64 __m2) { return (__m64)__builtin_ia32_pfpnacc((__v2sf)__m1, (__v2sf)__m2); } static __inline__ __m64 __DEFAULT_FN_ATTRS _m_pi2fw(__m64 __m) { return (__m64)__builtin_ia32_pi2fw((__v2si)__m); } static __inline__ __m64 __DEFAULT_FN_ATTRS _m_pswapdsf(__m64 __m) { return (__m64)__builtin_ia32_pswapdsf((__v2sf)__m); } static __inline__ __m64 __DEFAULT_FN_ATTRS _m_pswapdsi(__m64 __m) { return (__m64)__builtin_ia32_pswapdsi((__v2si)__m); } #undef __DEFAULT_FN_ATTRS #endif # 172 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/mm3dnow.h" 3 # 33 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/x86intrin.h" 2 3 #endif # 34 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/x86intrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || defined(__BMI__) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 36 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/x86intrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/bmiintrin.h" 1 3 /*===---- bmiintrin.h - BMI intrinsics -------------------------------------=== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #if !defined __X86INTRIN_H && !defined __IMMINTRIN_H #error "Never use directly; include instead." #endif # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/bmiintrin.h" 3 #ifndef __BMIINTRIN_H #define __BMIINTRIN_H #define _tzcnt_u16(a) (__tzcnt_u16((a))) #define _andn_u32(a, b) (__andn_u32((a), (b))) /* _bextr_u32 != __bextr_u32 */ #define _blsi_u32(a) (__blsi_u32((a))) #define _blsmsk_u32(a) (__blsmsk_u32((a))) #define _blsr_u32(a) (__blsr_u32((a))) #define _tzcnt_u32(a) (__tzcnt_u32((a))) /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("bmi"))) /* Allow using the tzcnt intrinsics even for non-BMI targets. Since the TZCNT instruction behaves as BSF on non-BMI targets, there is code that expects to use it as a potentially faster version of BSF. */ #define __RELAXED_FN_ATTRS __attribute__((__always_inline__, __nodebug__)) /// \brief Counts the number of trailing zero bits in the operand. /// /// \headerfile /// /// This intrinsic corresponds to the TZCNT instruction. /// /// \param __X /// An unsigned 16-bit integer whose trailing zeros are to be counted. /// \returns An unsigned 16-bit integer containing the number of trailing zero /// bits in the operand. static __inline__ unsigned short __RELAXED_FN_ATTRS __tzcnt_u16(unsigned short __X) { return __X ? __builtin_ctzs(__X) : 16; } /// \brief Performs a bitwise AND of the second operand with the one's /// complement of the first operand. /// /// \headerfile /// /// This intrinsic corresponds to the ANDN instruction. /// /// \param __X /// An unsigned integer containing one of the operands. /// \param __Y /// An unsigned integer containing one of the operands. /// \returns An unsigned integer containing the bitwise AND of the second /// operand with the one's complement of the first operand. static __inline__ unsigned int __DEFAULT_FN_ATTRS __andn_u32(unsigned int __X, unsigned int __Y) { return ~__X & __Y; } /* AMD-specified, double-leading-underscore version of BEXTR */ /// \brief Extracts the specified bits from the first operand and returns them /// in the least significant bits of the result. /// /// \headerfile /// /// This intrinsic corresponds to the BEXTR instruction. /// /// \param __X /// An unsigned integer whose bits are to be extracted. /// \param __Y /// An unsigned integer used to specify which bits are extracted. Bits [7:0] /// specify the index of the least significant bit. Bits [15:8] specify the /// number of bits to be extracted. /// \returns An unsigned integer whose least significant bits contain the /// extracted bits. static __inline__ unsigned int __DEFAULT_FN_ATTRS __bextr_u32(unsigned int __X, unsigned int __Y) { return __builtin_ia32_bextr_u32(__X, __Y); } /* Intel-specified, single-leading-underscore version of BEXTR */ /// \brief Extracts the specified bits from the first operand and returns them /// in the least significant bits of the result. /// /// \headerfile /// /// This intrinsic corresponds to the BEXTR instruction. /// /// \param __X /// An unsigned integer whose bits are to be extracted. /// \param __Y /// An unsigned integer used to specify the index of the least significant /// bit for the bits to be extracted. Bits [7:0] specify the index. /// \param __Z /// An unsigned integer used to specify the number of bits to be extracted. /// Bits [7:0] specify the number of bits. /// \returns An unsigned integer whose least significant bits contain the /// extracted bits. static __inline__ unsigned int __DEFAULT_FN_ATTRS _bextr_u32(unsigned int __X, unsigned int __Y, unsigned int __Z) { return __builtin_ia32_bextr_u32 (__X, ((__Y & 0xff) | ((__Z & 0xff) << 8))); } /// \brief Clears all bits in the source except for the least significant bit /// containing a value of 1 and returns the result. /// /// \headerfile /// /// This intrinsic corresponds to the BLSI instruction. /// /// \param __X /// An unsigned integer whose bits are to be cleared. /// \returns An unsigned integer containing the result of clearing the bits from /// the source operand. static __inline__ unsigned int __DEFAULT_FN_ATTRS __blsi_u32(unsigned int __X) { return __X & -__X; } /// \brief Creates a mask whose bits are set to 1, using bit 0 up to and /// including the least significant bit that is set to 1 in the source /// operand and returns the result. /// /// \headerfile /// /// This intrinsic corresponds to the BLSMSK instruction. /// /// \param __X /// An unsigned integer used to create the mask. /// \returns An unsigned integer containing the newly created mask. static __inline__ unsigned int __DEFAULT_FN_ATTRS __blsmsk_u32(unsigned int __X) { return __X ^ (__X - 1); } /// \brief Clears the least significant bit that is set to 1 in the source /// operand and returns the result. /// /// \headerfile /// /// This intrinsic corresponds to the BLSR instruction. /// /// \param __X /// An unsigned integer containing the operand to be cleared. /// \returns An unsigned integer containing the result of clearing the source /// operand. static __inline__ unsigned int __DEFAULT_FN_ATTRS __blsr_u32(unsigned int __X) { return __X & (__X - 1); } /// \brief Counts the number of trailing zero bits in the operand. /// /// \headerfile /// /// This intrinsic corresponds to the TZCNT instruction. /// /// \param __X /// An unsigned 32-bit integer whose trailing zeros are to be counted. /// \returns An unsigned 32-bit integer containing the number of trailing zero /// bits in the operand. static __inline__ unsigned int __RELAXED_FN_ATTRS __tzcnt_u32(unsigned int __X) { return __X ? __builtin_ctz(__X) : 32; } /// \brief Counts the number of trailing zero bits in the operand. /// /// \headerfile /// /// This intrinsic corresponds to the TZCNT instruction. /// /// \param __X /// An unsigned 32-bit integer whose trailing zeros are to be counted. /// \returns An 32-bit integer containing the number of trailing zero bits in /// the operand. static __inline__ int __RELAXED_FN_ATTRS _mm_tzcnt_32(unsigned int __X) { return __X ? __builtin_ctz(__X) : 32; } #ifdef __x86_64__ #define _andn_u64(a, b) (__andn_u64((a), (b))) /* _bextr_u64 != __bextr_u64 */ #define _blsi_u64(a) (__blsi_u64((a))) #define _blsmsk_u64(a) (__blsmsk_u64((a))) #define _blsr_u64(a) (__blsr_u64((a))) #define _tzcnt_u64(a) (__tzcnt_u64((a))) /// \brief Performs a bitwise AND of the second operand with the one's /// complement of the first operand. /// /// \headerfile /// /// This intrinsic corresponds to the ANDN instruction. /// /// \param __X /// An unsigned 64-bit integer containing one of the operands. /// \param __Y /// An unsigned 64-bit integer containing one of the operands. /// \returns An unsigned 64-bit integer containing the bitwise AND of the second /// operand with the one's complement of the first operand. static __inline__ unsigned long long __DEFAULT_FN_ATTRS __andn_u64 (unsigned long long __X, unsigned long long __Y) { return ~__X & __Y; } /* AMD-specified, double-leading-underscore version of BEXTR */ /// \brief Extracts the specified bits from the first operand and returns them /// in the least significant bits of the result. /// /// \headerfile /// /// This intrinsic corresponds to the BEXTR instruction. /// /// \param __X /// An unsigned 64-bit integer whose bits are to be extracted. /// \param __Y /// An unsigned 64-bit integer used to specify which bits are extracted. Bits /// [7:0] specify the index of the least significant bit. Bits [15:8] specify /// the number of bits to be extracted. /// \returns An unsigned 64-bit integer whose least significant bits contain the /// extracted bits. static __inline__ unsigned long long __DEFAULT_FN_ATTRS __bextr_u64(unsigned long long __X, unsigned long long __Y) { return __builtin_ia32_bextr_u64(__X, __Y); } /* Intel-specified, single-leading-underscore version of BEXTR */ /// \brief Extracts the specified bits from the first operand and returns them /// in the least significant bits of the result. /// /// \headerfile /// /// This intrinsic corresponds to the BEXTR instruction. /// /// \param __X /// An unsigned 64-bit integer whose bits are to be extracted. /// \param __Y /// An unsigned integer used to specify the index of the least significant /// bit for the bits to be extracted. Bits [7:0] specify the index. /// \param __Z /// An unsigned integer used to specify the number of bits to be extracted. /// Bits [7:0] specify the number of bits. /// \returns An unsigned 64-bit integer whose least significant bits contain the /// extracted bits. static __inline__ unsigned long long __DEFAULT_FN_ATTRS _bextr_u64(unsigned long long __X, unsigned int __Y, unsigned int __Z) { return __builtin_ia32_bextr_u64 (__X, ((__Y & 0xff) | ((__Z & 0xff) << 8))); } /// \brief Clears all bits in the source except for the least significant bit /// containing a value of 1 and returns the result. /// /// \headerfile /// /// This intrinsic corresponds to the BLSI instruction. /// /// \param __X /// An unsigned 64-bit integer whose bits are to be cleared. /// \returns An unsigned 64-bit integer containing the result of clearing the /// bits from the source operand. static __inline__ unsigned long long __DEFAULT_FN_ATTRS __blsi_u64(unsigned long long __X) { return __X & -__X; } /// \brief Creates a mask whose bits are set to 1, using bit 0 up to and /// including the least significant bit that is set to 1 in the source /// operand and returns the result. /// /// \headerfile /// /// This intrinsic corresponds to the BLSMSK instruction. /// /// \param __X /// An unsigned 64-bit integer used to create the mask. /// \returns An unsigned 64-bit integer containing the newly created mask. static __inline__ unsigned long long __DEFAULT_FN_ATTRS __blsmsk_u64(unsigned long long __X) { return __X ^ (__X - 1); } /// \brief Clears the least significant bit that is set to 1 in the source /// operand and returns the result. /// /// \headerfile /// /// This intrinsic corresponds to the BLSR instruction. /// /// \param __X /// An unsigned 64-bit integer containing the operand to be cleared. /// \returns An unsigned 64-bit integer containing the result of clearing the /// source operand. static __inline__ unsigned long long __DEFAULT_FN_ATTRS __blsr_u64(unsigned long long __X) { return __X & (__X - 1); } /// \brief Counts the number of trailing zero bits in the operand. /// /// \headerfile /// /// This intrinsic corresponds to the TZCNT instruction. /// /// \param __X /// An unsigned 64-bit integer whose trailing zeros are to be counted. /// \returns An unsigned 64-bit integer containing the number of trailing zero /// bits in the operand. static __inline__ unsigned long long __RELAXED_FN_ATTRS __tzcnt_u64(unsigned long long __X) { return __X ? __builtin_ctzll(__X) : 64; } /// \brief Counts the number of trailing zero bits in the operand. /// /// \headerfile /// /// This intrinsic corresponds to the TZCNT instruction. /// /// \param __X /// An unsigned 64-bit integer whose trailing zeros are to be counted. /// \returns An 64-bit integer containing the number of trailing zero bits in /// the operand. static __inline__ long long __RELAXED_FN_ATTRS _mm_tzcnt_64(unsigned long long __X) { return __X ? __builtin_ctzll(__X) : 64; } #endif /* __x86_64__ */ # 378 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/bmiintrin.h" 3 #undef __DEFAULT_FN_ATTRS #undef __RELAXED_FN_ATTRS #endif /* __BMIINTRIN_H */ # 383 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/bmiintrin.h" 3 # 37 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/x86intrin.h" 2 3 #endif # 38 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/x86intrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || defined(__BMI2__) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 40 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/x86intrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/bmi2intrin.h" 1 3 /*===---- bmi2intrin.h - BMI2 intrinsics -----------------------------------=== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #if !defined __X86INTRIN_H && !defined __IMMINTRIN_H #error "Never use directly; include instead." #endif # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/bmi2intrin.h" 3 #ifndef __BMI2INTRIN_H #define __BMI2INTRIN_H /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("bmi2"))) static __inline__ unsigned int __DEFAULT_FN_ATTRS _bzhi_u32(unsigned int __X, unsigned int __Y) { return __builtin_ia32_bzhi_si(__X, __Y); } static __inline__ unsigned int __DEFAULT_FN_ATTRS _pdep_u32(unsigned int __X, unsigned int __Y) { return __builtin_ia32_pdep_si(__X, __Y); } static __inline__ unsigned int __DEFAULT_FN_ATTRS _pext_u32(unsigned int __X, unsigned int __Y) { return __builtin_ia32_pext_si(__X, __Y); } #ifdef __x86_64__ static __inline__ unsigned long long __DEFAULT_FN_ATTRS _bzhi_u64(unsigned long long __X, unsigned long long __Y) { return __builtin_ia32_bzhi_di(__X, __Y); } static __inline__ unsigned long long __DEFAULT_FN_ATTRS _pdep_u64(unsigned long long __X, unsigned long long __Y) { return __builtin_ia32_pdep_di(__X, __Y); } static __inline__ unsigned long long __DEFAULT_FN_ATTRS _pext_u64(unsigned long long __X, unsigned long long __Y) { return __builtin_ia32_pext_di(__X, __Y); } static __inline__ unsigned long long __DEFAULT_FN_ATTRS _mulx_u64 (unsigned long long __X, unsigned long long __Y, unsigned long long *__P) { unsigned __int128 __res = (unsigned __int128) __X * __Y; *__P = (unsigned long long) (__res >> 64); return (unsigned long long) __res; } #else /* !__x86_64__ */ # 82 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/bmi2intrin.h" 3 static __inline__ unsigned int __DEFAULT_FN_ATTRS _mulx_u32 (unsigned int __X, unsigned int __Y, unsigned int *__P) { unsigned long long __res = (unsigned long long) __X * __Y; *__P = (unsigned int) (__res >> 32); return (unsigned int) __res; } #endif /* !__x86_64__ */ # 92 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/bmi2intrin.h" 3 #undef __DEFAULT_FN_ATTRS #endif /* __BMI2INTRIN_H */ # 96 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/bmi2intrin.h" 3 # 41 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/x86intrin.h" 2 3 #endif # 42 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/x86intrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || defined(__LZCNT__) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 44 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/x86intrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/lzcntintrin.h" 1 3 /*===---- lzcntintrin.h - LZCNT intrinsics ---------------------------------=== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #if !defined __X86INTRIN_H && !defined __IMMINTRIN_H #error "Never use directly; include instead." #endif # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/lzcntintrin.h" 3 #ifndef __LZCNTINTRIN_H #define __LZCNTINTRIN_H /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("lzcnt"))) /// \brief Counts the number of leading zero bits in the operand. /// /// \headerfile /// /// This intrinsic corresponds to the \c LZCNT instruction. /// /// \param __X /// An unsigned 16-bit integer whose leading zeros are to be counted. /// \returns An unsigned 16-bit integer containing the number of leading zero /// bits in the operand. static __inline__ unsigned short __DEFAULT_FN_ATTRS __lzcnt16(unsigned short __X) { return __X ? __builtin_clzs(__X) : 16; } /// \brief Counts the number of leading zero bits in the operand. /// /// \headerfile /// /// This intrinsic corresponds to the \c LZCNT instruction. /// /// \param __X /// An unsigned 32-bit integer whose leading zeros are to be counted. /// \returns An unsigned 32-bit integer containing the number of leading zero /// bits in the operand. static __inline__ unsigned int __DEFAULT_FN_ATTRS __lzcnt32(unsigned int __X) { return __X ? __builtin_clz(__X) : 32; } /// \brief Counts the number of leading zero bits in the operand. /// /// \headerfile /// /// This intrinsic corresponds to the \c LZCNT instruction. /// /// \param __X /// An unsigned 32-bit integer whose leading zeros are to be counted. /// \returns An unsigned 32-bit integer containing the number of leading zero /// bits in the operand. static __inline__ unsigned int __DEFAULT_FN_ATTRS _lzcnt_u32(unsigned int __X) { return __X ? __builtin_clz(__X) : 32; } #ifdef __x86_64__ /// \brief Counts the number of leading zero bits in the operand. /// /// \headerfile /// /// This intrinsic corresponds to the \c LZCNT instruction. /// /// \param __X /// An unsigned 64-bit integer whose leading zeros are to be counted. /// \returns An unsigned 64-bit integer containing the number of leading zero /// bits in the operand. static __inline__ unsigned long long __DEFAULT_FN_ATTRS __lzcnt64(unsigned long long __X) { return __X ? __builtin_clzll(__X) : 64; } /// \brief Counts the number of leading zero bits in the operand. /// /// \headerfile /// /// This intrinsic corresponds to the \c LZCNT instruction. /// /// \param __X /// An unsigned 64-bit integer whose leading zeros are to be counted. /// \returns An unsigned 64-bit integer containing the number of leading zero /// bits in the operand. static __inline__ unsigned long long __DEFAULT_FN_ATTRS _lzcnt_u64(unsigned long long __X) { return __X ? __builtin_clzll(__X) : 64; } #endif # 115 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/lzcntintrin.h" 3 #undef __DEFAULT_FN_ATTRS #endif /* __LZCNTINTRIN_H */ # 119 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/lzcntintrin.h" 3 # 45 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/x86intrin.h" 2 3 #endif # 46 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/x86intrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || defined(__POPCNT__) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 48 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/x86intrin.h" 3 # 49 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/x86intrin.h" 3 #endif # 50 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/x86intrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || defined(__RDSEED__) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 52 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/x86intrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/rdseedintrin.h" 1 3 /*===---- rdseedintrin.h - RDSEED intrinsics -------------------------------=== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __X86INTRIN_H #error "Never use directly; include instead." #endif # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/rdseedintrin.h" 3 #ifndef __RDSEEDINTRIN_H #define __RDSEEDINTRIN_H /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("rdseed"))) static __inline__ int __DEFAULT_FN_ATTRS _rdseed16_step(unsigned short *__p) { return __builtin_ia32_rdseed16_step(__p); } static __inline__ int __DEFAULT_FN_ATTRS _rdseed32_step(unsigned int *__p) { return __builtin_ia32_rdseed32_step(__p); } #ifdef __x86_64__ static __inline__ int __DEFAULT_FN_ATTRS _rdseed64_step(unsigned long long *__p) { return __builtin_ia32_rdseed64_step(__p); } #endif # 53 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/rdseedintrin.h" 3 #undef __DEFAULT_FN_ATTRS #endif /* __RDSEEDINTRIN_H */ # 57 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/rdseedintrin.h" 3 # 53 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/x86intrin.h" 2 3 #endif # 54 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/x86intrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || defined(__PRFCHW__) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 56 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/x86intrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/prfchwintrin.h" 1 3 /*===---- prfchwintrin.h - PREFETCHW intrinsic -----------------------------=== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #if !defined(__X86INTRIN_H) && !defined(_MM3DNOW_H_INCLUDED) #error "Never use directly; include or instead." #endif # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/prfchwintrin.h" 3 #ifndef __PRFCHWINTRIN_H #define __PRFCHWINTRIN_H #if defined(__PRFCHW__) || defined(__3dNOW__) /// \brief Loads a memory sequence containing the specified memory address into /// all data cache levels. The cache-coherency state is set to exclusive. /// Data can be read from and written to the cache line without additional /// delay. /// /// \headerfile /// /// This intrinsic corresponds to the \c PREFETCHT0 instruction. /// /// \param __P /// A pointer specifying the memory address to be prefetched. static __inline__ void __attribute__((__always_inline__, __nodebug__)) _m_prefetch(void *__P) { __builtin_prefetch (__P, 0, 3 /* _MM_HINT_T0 */); } /// \brief Loads a memory sequence containing the specified memory address into /// the L1 data cache and sets the cache-coherency to modified. This /// provides a hint to the processor that the cache line will be modified. /// It is intended for use when the cache line will be written to shortly /// after the prefetch is performed. /// /// Note that the effect of this intrinsic is dependent on the processor /// implementation. /// /// \headerfile /// /// This intrinsic corresponds to the \c PREFETCHW instruction. /// /// \param __P /// A pointer specifying the memory address to be prefetched. static __inline__ void __attribute__((__always_inline__, __nodebug__)) _m_prefetchw(void *__P) { __builtin_prefetch (__P, 1, 3 /* _MM_HINT_T0 */); } #endif # 70 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/prfchwintrin.h" 3 #endif /* __PRFCHWINTRIN_H */ # 72 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/prfchwintrin.h" 3 # 57 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/x86intrin.h" 2 3 #endif # 58 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/x86intrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || defined(__SSE4A__) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 60 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/x86intrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/ammintrin.h" 1 3 /*===---- ammintrin.h - SSE4a intrinsics -----------------------------------=== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __AMMINTRIN_H #define __AMMINTRIN_H #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/ammintrin.h" 3 # 28 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/ammintrin.h" 3 /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("sse4a"))) /// \brief Extracts the specified bits from the lower 64 bits of the 128-bit /// integer vector operand at the index \a idx and of the length \a len. /// /// \headerfile /// /// \code /// __m128i _mm_extracti_si64(__m128i x, const int len, const int idx); /// \endcode /// /// This intrinsic corresponds to the EXTRQ instruction. /// /// \param x /// The value from which bits are extracted. /// \param len /// Bits [5:0] specify the length; the other bits are ignored. If bits [5:0] /// are zero, the length is interpreted as 64. /// \param idx /// Bits [5:0] specify the index of the least significant bit; the other /// bits are ignored. If the sum of the index and length is greater than 64, /// the result is undefined. If the length and index are both zero, bits /// [63:0] of parameter \a x are extracted. If the length is zero but the /// index is non-zero, the result is undefined. /// \returns A 128-bit integer vector whose lower 64 bits contain the bits /// extracted from the source operand. #define _mm_extracti_si64(x, len, idx) \ ((__m128i)__builtin_ia32_extrqi((__v2di)(__m128i)(x), \ (char)(len), (char)(idx))) /// \brief Extracts the specified bits from the lower 64 bits of the 128-bit /// integer vector operand at the index and of the length specified by /// \a __y. /// /// \headerfile /// /// This intrinsic corresponds to the EXTRQ instruction. /// /// \param __x /// The value from which bits are extracted. /// \param __y /// Specifies the index of the least significant bit at [13:8] and the /// length at [5:0]; all other bits are ignored. If bits [5:0] are zero, the /// length is interpreted as 64. If the sum of the index and length is /// greater than 64, the result is undefined. If the length and index are /// both zero, bits [63:0] of parameter \a __x are extracted. If the length /// is zero but the index is non-zero, the result is undefined. /// \returns A 128-bit vector whose lower 64 bits contain the bits extracted /// from the source operand. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_extract_si64(__m128i __x, __m128i __y) { return (__m128i)__builtin_ia32_extrq((__v2di)__x, (__v16qi)__y); } /// \brief Inserts bits of a specified length from the source integer vector /// \a y into the lower 64 bits of the destination integer vector \a x at /// the index \a idx and of the length \a len. /// /// \headerfile /// /// \code /// __m128i _mm_inserti_si64(__m128i x, __m128i y, const int len, /// const int idx); /// \endcode /// /// This intrinsic corresponds to the INSERTQ instruction. /// /// \param x /// The destination operand where bits will be inserted. The inserted bits /// are defined by the length \a len and by the index \a idx specifying the /// least significant bit. /// \param y /// The source operand containing the bits to be extracted. The extracted /// bits are the least significant bits of operand \a y of length \a len. /// \param len /// Bits [5:0] specify the length; the other bits are ignored. If bits [5:0] /// are zero, the length is interpreted as 64. /// \param idx /// Bits [5:0] specify the index of the least significant bit; the other /// bits are ignored. If the sum of the index and length is greater than 64, /// the result is undefined. If the length and index are both zero, bits /// [63:0] of parameter \a y are inserted into parameter \a x. If the length /// is zero but the index is non-zero, the result is undefined. /// \returns A 128-bit integer vector containing the original lower 64-bits of /// destination operand \a x with the specified bitfields replaced by the /// lower bits of source operand \a y. The upper 64 bits of the return value /// are undefined. #define _mm_inserti_si64(x, y, len, idx) \ ((__m128i)__builtin_ia32_insertqi((__v2di)(__m128i)(x), \ (__v2di)(__m128i)(y), \ (char)(len), (char)(idx))) /// \brief Inserts bits of a specified length from the source integer vector /// \a __y into the lower 64 bits of the destination integer vector \a __x /// at the index and of the length specified by \a __y. /// /// \headerfile /// /// This intrinsic corresponds to the INSERTQ instruction. /// /// \param __x /// The destination operand where bits will be inserted. The inserted bits /// are defined by the length and by the index of the least significant bit /// specified by operand \a __y. /// \param __y /// The source operand containing the bits to be extracted. The extracted /// bits are the least significant bits of operand \a __y with length /// specified by bits [69:64]. These are inserted into the destination at the /// index specified by bits [77:72]; all other bits are ignored. If bits /// [69:64] are zero, the length is interpreted as 64. If the sum of the /// index and length is greater than 64, the result is undefined. If the /// length and index are both zero, bits [63:0] of parameter \a __y are /// inserted into parameter \a __x. If the length is zero but the index is /// non-zero, the result is undefined. /// \returns A 128-bit integer vector containing the original lower 64-bits of /// destination operand \a __x with the specified bitfields replaced by the /// lower bits of source operand \a __y. The upper 64 bits of the return /// value are undefined. static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_insert_si64(__m128i __x, __m128i __y) { return (__m128i)__builtin_ia32_insertq((__v2di)__x, (__v2di)__y); } /// \brief Stores a 64-bit double-precision value in a 64-bit memory location. /// To minimize caching, the data is flagged as non-temporal (unlikely to be /// used again soon). /// /// \headerfile /// /// This intrinsic corresponds to the MOVNTSD instruction. /// /// \param __p /// The 64-bit memory location used to store the register value. /// \param __a /// The 64-bit double-precision floating-point register value to be stored. static __inline__ void __DEFAULT_FN_ATTRS _mm_stream_sd(double *__p, __m128d __a) { __builtin_ia32_movntsd(__p, (__v2df)__a); } /// \brief Stores a 32-bit single-precision floating-point value in a 32-bit /// memory location. To minimize caching, the data is flagged as /// non-temporal (unlikely to be used again soon). /// /// \headerfile /// /// This intrinsic corresponds to the MOVNTSS instruction. /// /// \param __p /// The 32-bit memory location used to store the register value. /// \param __a /// The 32-bit single-precision floating-point register value to be stored. static __inline__ void __DEFAULT_FN_ATTRS _mm_stream_ss(float *__p, __m128 __a) { __builtin_ia32_movntss(__p, (__v4sf)__a); } #undef __DEFAULT_FN_ATTRS #endif /* __AMMINTRIN_H */ # 194 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/ammintrin.h" 3 # 61 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/x86intrin.h" 2 3 #endif # 62 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/x86intrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || defined(__FMA4__) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 64 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/x86intrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/fma4intrin.h" 1 3 /*===---- fma4intrin.h - FMA4 intrinsics -----------------------------------=== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __X86INTRIN_H #error "Never use directly; include instead." #endif # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/fma4intrin.h" 3 #ifndef __FMA4INTRIN_H #define __FMA4INTRIN_H #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 31 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/fma4intrin.h" 3 # 32 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/fma4intrin.h" 3 /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("fma4"))) static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_macc_ps(__m128 __A, __m128 __B, __m128 __C) { return (__m128)__builtin_ia32_vfmaddps((__v4sf)__A, (__v4sf)__B, (__v4sf)__C); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_macc_pd(__m128d __A, __m128d __B, __m128d __C) { return (__m128d)__builtin_ia32_vfmaddpd((__v2df)__A, (__v2df)__B, (__v2df)__C); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_macc_ss(__m128 __A, __m128 __B, __m128 __C) { return (__m128)__builtin_ia32_vfmaddss((__v4sf)__A, (__v4sf)__B, (__v4sf)__C); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_macc_sd(__m128d __A, __m128d __B, __m128d __C) { return (__m128d)__builtin_ia32_vfmaddsd((__v2df)__A, (__v2df)__B, (__v2df)__C); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_msub_ps(__m128 __A, __m128 __B, __m128 __C) { return (__m128)__builtin_ia32_vfmaddps((__v4sf)__A, (__v4sf)__B, -(__v4sf)__C); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_msub_pd(__m128d __A, __m128d __B, __m128d __C) { return (__m128d)__builtin_ia32_vfmaddpd((__v2df)__A, (__v2df)__B, -(__v2df)__C); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_msub_ss(__m128 __A, __m128 __B, __m128 __C) { return (__m128)__builtin_ia32_vfmaddss((__v4sf)__A, (__v4sf)__B, -(__v4sf)__C); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_msub_sd(__m128d __A, __m128d __B, __m128d __C) { return (__m128d)__builtin_ia32_vfmaddsd((__v2df)__A, (__v2df)__B, -(__v2df)__C); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_nmacc_ps(__m128 __A, __m128 __B, __m128 __C) { return (__m128)__builtin_ia32_vfmaddps(-(__v4sf)__A, (__v4sf)__B, (__v4sf)__C); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_nmacc_pd(__m128d __A, __m128d __B, __m128d __C) { return (__m128d)__builtin_ia32_vfmaddpd(-(__v2df)__A, (__v2df)__B, (__v2df)__C); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_nmacc_ss(__m128 __A, __m128 __B, __m128 __C) { return (__m128)__builtin_ia32_vfmaddss(-(__v4sf)__A, (__v4sf)__B, (__v4sf)__C); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_nmacc_sd(__m128d __A, __m128d __B, __m128d __C) { return (__m128d)__builtin_ia32_vfmaddsd(-(__v2df)__A, (__v2df)__B, (__v2df)__C); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_nmsub_ps(__m128 __A, __m128 __B, __m128 __C) { return (__m128)__builtin_ia32_vfmaddps(-(__v4sf)__A, (__v4sf)__B, -(__v4sf)__C); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_nmsub_pd(__m128d __A, __m128d __B, __m128d __C) { return (__m128d)__builtin_ia32_vfmaddpd(-(__v2df)__A, (__v2df)__B, -(__v2df)__C); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_nmsub_ss(__m128 __A, __m128 __B, __m128 __C) { return (__m128)__builtin_ia32_vfmaddss(-(__v4sf)__A, (__v4sf)__B, -(__v4sf)__C); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_nmsub_sd(__m128d __A, __m128d __B, __m128d __C) { return (__m128d)__builtin_ia32_vfmaddsd(-(__v2df)__A, (__v2df)__B, -(__v2df)__C); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maddsub_ps(__m128 __A, __m128 __B, __m128 __C) { return (__m128)__builtin_ia32_vfmaddsubps((__v4sf)__A, (__v4sf)__B, (__v4sf)__C); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_maddsub_pd(__m128d __A, __m128d __B, __m128d __C) { return (__m128d)__builtin_ia32_vfmaddsubpd((__v2df)__A, (__v2df)__B, (__v2df)__C); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_msubadd_ps(__m128 __A, __m128 __B, __m128 __C) { return (__m128)__builtin_ia32_vfmaddsubps((__v4sf)__A, (__v4sf)__B, -(__v4sf)__C); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_msubadd_pd(__m128d __A, __m128d __B, __m128d __C) { return (__m128d)__builtin_ia32_vfmaddsubpd((__v2df)__A, (__v2df)__B, -(__v2df)__C); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_macc_ps(__m256 __A, __m256 __B, __m256 __C) { return (__m256)__builtin_ia32_vfmaddps256((__v8sf)__A, (__v8sf)__B, (__v8sf)__C); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_macc_pd(__m256d __A, __m256d __B, __m256d __C) { return (__m256d)__builtin_ia32_vfmaddpd256((__v4df)__A, (__v4df)__B, (__v4df)__C); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_msub_ps(__m256 __A, __m256 __B, __m256 __C) { return (__m256)__builtin_ia32_vfmaddps256((__v8sf)__A, (__v8sf)__B, -(__v8sf)__C); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_msub_pd(__m256d __A, __m256d __B, __m256d __C) { return (__m256d)__builtin_ia32_vfmaddpd256((__v4df)__A, (__v4df)__B, -(__v4df)__C); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_nmacc_ps(__m256 __A, __m256 __B, __m256 __C) { return (__m256)__builtin_ia32_vfmaddps256(-(__v8sf)__A, (__v8sf)__B, (__v8sf)__C); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_nmacc_pd(__m256d __A, __m256d __B, __m256d __C) { return (__m256d)__builtin_ia32_vfmaddpd256(-(__v4df)__A, (__v4df)__B, (__v4df)__C); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_nmsub_ps(__m256 __A, __m256 __B, __m256 __C) { return (__m256)__builtin_ia32_vfmaddps256(-(__v8sf)__A, (__v8sf)__B, -(__v8sf)__C); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_nmsub_pd(__m256d __A, __m256d __B, __m256d __C) { return (__m256d)__builtin_ia32_vfmaddpd256(-(__v4df)__A, (__v4df)__B, -(__v4df)__C); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_maddsub_ps(__m256 __A, __m256 __B, __m256 __C) { return (__m256)__builtin_ia32_vfmaddsubps256((__v8sf)__A, (__v8sf)__B, (__v8sf)__C); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_maddsub_pd(__m256d __A, __m256d __B, __m256d __C) { return (__m256d)__builtin_ia32_vfmaddsubpd256((__v4df)__A, (__v4df)__B, (__v4df)__C); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_msubadd_ps(__m256 __A, __m256 __B, __m256 __C) { return (__m256)__builtin_ia32_vfmaddsubps256((__v8sf)__A, (__v8sf)__B, -(__v8sf)__C); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_msubadd_pd(__m256d __A, __m256d __B, __m256d __C) { return (__m256d)__builtin_ia32_vfmaddsubpd256((__v4df)__A, (__v4df)__B, -(__v4df)__C); } #undef __DEFAULT_FN_ATTRS #endif /* __FMA4INTRIN_H */ # 231 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/fma4intrin.h" 3 # 65 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/x86intrin.h" 2 3 #endif # 66 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/x86intrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || defined(__XOP__) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 68 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/x86intrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xopintrin.h" 1 3 /*===---- xopintrin.h - XOP intrinsics -------------------------------------=== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __X86INTRIN_H #error "Never use directly; include instead." #endif # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xopintrin.h" 3 #ifndef __XOPINTRIN_H #define __XOPINTRIN_H #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 31 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xopintrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/fma4intrin.h" 1 3 /*===---- fma4intrin.h - FMA4 intrinsics -----------------------------------=== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __X86INTRIN_H #error "Never use directly; include instead." #endif # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/fma4intrin.h" 3 #ifndef __FMA4INTRIN_H #define __FMA4INTRIN_H #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 31 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/fma4intrin.h" 3 # 32 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/fma4intrin.h" 3 /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("fma4"))) static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_macc_ps(__m128 __A, __m128 __B, __m128 __C) { return (__m128)__builtin_ia32_vfmaddps((__v4sf)__A, (__v4sf)__B, (__v4sf)__C); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_macc_pd(__m128d __A, __m128d __B, __m128d __C) { return (__m128d)__builtin_ia32_vfmaddpd((__v2df)__A, (__v2df)__B, (__v2df)__C); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_macc_ss(__m128 __A, __m128 __B, __m128 __C) { return (__m128)__builtin_ia32_vfmaddss((__v4sf)__A, (__v4sf)__B, (__v4sf)__C); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_macc_sd(__m128d __A, __m128d __B, __m128d __C) { return (__m128d)__builtin_ia32_vfmaddsd((__v2df)__A, (__v2df)__B, (__v2df)__C); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_msub_ps(__m128 __A, __m128 __B, __m128 __C) { return (__m128)__builtin_ia32_vfmaddps((__v4sf)__A, (__v4sf)__B, -(__v4sf)__C); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_msub_pd(__m128d __A, __m128d __B, __m128d __C) { return (__m128d)__builtin_ia32_vfmaddpd((__v2df)__A, (__v2df)__B, -(__v2df)__C); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_msub_ss(__m128 __A, __m128 __B, __m128 __C) { return (__m128)__builtin_ia32_vfmaddss((__v4sf)__A, (__v4sf)__B, -(__v4sf)__C); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_msub_sd(__m128d __A, __m128d __B, __m128d __C) { return (__m128d)__builtin_ia32_vfmaddsd((__v2df)__A, (__v2df)__B, -(__v2df)__C); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_nmacc_ps(__m128 __A, __m128 __B, __m128 __C) { return (__m128)__builtin_ia32_vfmaddps(-(__v4sf)__A, (__v4sf)__B, (__v4sf)__C); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_nmacc_pd(__m128d __A, __m128d __B, __m128d __C) { return (__m128d)__builtin_ia32_vfmaddpd(-(__v2df)__A, (__v2df)__B, (__v2df)__C); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_nmacc_ss(__m128 __A, __m128 __B, __m128 __C) { return (__m128)__builtin_ia32_vfmaddss(-(__v4sf)__A, (__v4sf)__B, (__v4sf)__C); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_nmacc_sd(__m128d __A, __m128d __B, __m128d __C) { return (__m128d)__builtin_ia32_vfmaddsd(-(__v2df)__A, (__v2df)__B, (__v2df)__C); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_nmsub_ps(__m128 __A, __m128 __B, __m128 __C) { return (__m128)__builtin_ia32_vfmaddps(-(__v4sf)__A, (__v4sf)__B, -(__v4sf)__C); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_nmsub_pd(__m128d __A, __m128d __B, __m128d __C) { return (__m128d)__builtin_ia32_vfmaddpd(-(__v2df)__A, (__v2df)__B, -(__v2df)__C); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_nmsub_ss(__m128 __A, __m128 __B, __m128 __C) { return (__m128)__builtin_ia32_vfmaddss(-(__v4sf)__A, (__v4sf)__B, -(__v4sf)__C); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_nmsub_sd(__m128d __A, __m128d __B, __m128d __C) { return (__m128d)__builtin_ia32_vfmaddsd(-(__v2df)__A, (__v2df)__B, -(__v2df)__C); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_maddsub_ps(__m128 __A, __m128 __B, __m128 __C) { return (__m128)__builtin_ia32_vfmaddsubps((__v4sf)__A, (__v4sf)__B, (__v4sf)__C); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_maddsub_pd(__m128d __A, __m128d __B, __m128d __C) { return (__m128d)__builtin_ia32_vfmaddsubpd((__v2df)__A, (__v2df)__B, (__v2df)__C); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_msubadd_ps(__m128 __A, __m128 __B, __m128 __C) { return (__m128)__builtin_ia32_vfmaddsubps((__v4sf)__A, (__v4sf)__B, -(__v4sf)__C); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_msubadd_pd(__m128d __A, __m128d __B, __m128d __C) { return (__m128d)__builtin_ia32_vfmaddsubpd((__v2df)__A, (__v2df)__B, -(__v2df)__C); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_macc_ps(__m256 __A, __m256 __B, __m256 __C) { return (__m256)__builtin_ia32_vfmaddps256((__v8sf)__A, (__v8sf)__B, (__v8sf)__C); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_macc_pd(__m256d __A, __m256d __B, __m256d __C) { return (__m256d)__builtin_ia32_vfmaddpd256((__v4df)__A, (__v4df)__B, (__v4df)__C); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_msub_ps(__m256 __A, __m256 __B, __m256 __C) { return (__m256)__builtin_ia32_vfmaddps256((__v8sf)__A, (__v8sf)__B, -(__v8sf)__C); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_msub_pd(__m256d __A, __m256d __B, __m256d __C) { return (__m256d)__builtin_ia32_vfmaddpd256((__v4df)__A, (__v4df)__B, -(__v4df)__C); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_nmacc_ps(__m256 __A, __m256 __B, __m256 __C) { return (__m256)__builtin_ia32_vfmaddps256(-(__v8sf)__A, (__v8sf)__B, (__v8sf)__C); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_nmacc_pd(__m256d __A, __m256d __B, __m256d __C) { return (__m256d)__builtin_ia32_vfmaddpd256(-(__v4df)__A, (__v4df)__B, (__v4df)__C); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_nmsub_ps(__m256 __A, __m256 __B, __m256 __C) { return (__m256)__builtin_ia32_vfmaddps256(-(__v8sf)__A, (__v8sf)__B, -(__v8sf)__C); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_nmsub_pd(__m256d __A, __m256d __B, __m256d __C) { return (__m256d)__builtin_ia32_vfmaddpd256(-(__v4df)__A, (__v4df)__B, -(__v4df)__C); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_maddsub_ps(__m256 __A, __m256 __B, __m256 __C) { return (__m256)__builtin_ia32_vfmaddsubps256((__v8sf)__A, (__v8sf)__B, (__v8sf)__C); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_maddsub_pd(__m256d __A, __m256d __B, __m256d __C) { return (__m256d)__builtin_ia32_vfmaddsubpd256((__v4df)__A, (__v4df)__B, (__v4df)__C); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_msubadd_ps(__m256 __A, __m256 __B, __m256 __C) { return (__m256)__builtin_ia32_vfmaddsubps256((__v8sf)__A, (__v8sf)__B, -(__v8sf)__C); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_msubadd_pd(__m256d __A, __m256d __B, __m256d __C) { return (__m256d)__builtin_ia32_vfmaddsubpd256((__v4df)__A, (__v4df)__B, -(__v4df)__C); } #undef __DEFAULT_FN_ATTRS #endif /* __FMA4INTRIN_H */ # 231 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/fma4intrin.h" 3 # 32 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xopintrin.h" 2 3 /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("xop"))) static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maccs_epi16(__m128i __A, __m128i __B, __m128i __C) { return (__m128i)__builtin_ia32_vpmacssww((__v8hi)__A, (__v8hi)__B, (__v8hi)__C); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_macc_epi16(__m128i __A, __m128i __B, __m128i __C) { return (__m128i)__builtin_ia32_vpmacsww((__v8hi)__A, (__v8hi)__B, (__v8hi)__C); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maccsd_epi16(__m128i __A, __m128i __B, __m128i __C) { return (__m128i)__builtin_ia32_vpmacsswd((__v8hi)__A, (__v8hi)__B, (__v4si)__C); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maccd_epi16(__m128i __A, __m128i __B, __m128i __C) { return (__m128i)__builtin_ia32_vpmacswd((__v8hi)__A, (__v8hi)__B, (__v4si)__C); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maccs_epi32(__m128i __A, __m128i __B, __m128i __C) { return (__m128i)__builtin_ia32_vpmacssdd((__v4si)__A, (__v4si)__B, (__v4si)__C); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_macc_epi32(__m128i __A, __m128i __B, __m128i __C) { return (__m128i)__builtin_ia32_vpmacsdd((__v4si)__A, (__v4si)__B, (__v4si)__C); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maccslo_epi32(__m128i __A, __m128i __B, __m128i __C) { return (__m128i)__builtin_ia32_vpmacssdql((__v4si)__A, (__v4si)__B, (__v2di)__C); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_macclo_epi32(__m128i __A, __m128i __B, __m128i __C) { return (__m128i)__builtin_ia32_vpmacsdql((__v4si)__A, (__v4si)__B, (__v2di)__C); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maccshi_epi32(__m128i __A, __m128i __B, __m128i __C) { return (__m128i)__builtin_ia32_vpmacssdqh((__v4si)__A, (__v4si)__B, (__v2di)__C); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_macchi_epi32(__m128i __A, __m128i __B, __m128i __C) { return (__m128i)__builtin_ia32_vpmacsdqh((__v4si)__A, (__v4si)__B, (__v2di)__C); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maddsd_epi16(__m128i __A, __m128i __B, __m128i __C) { return (__m128i)__builtin_ia32_vpmadcsswd((__v8hi)__A, (__v8hi)__B, (__v4si)__C); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_maddd_epi16(__m128i __A, __m128i __B, __m128i __C) { return (__m128i)__builtin_ia32_vpmadcswd((__v8hi)__A, (__v8hi)__B, (__v4si)__C); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_haddw_epi8(__m128i __A) { return (__m128i)__builtin_ia32_vphaddbw((__v16qi)__A); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_haddd_epi8(__m128i __A) { return (__m128i)__builtin_ia32_vphaddbd((__v16qi)__A); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_haddq_epi8(__m128i __A) { return (__m128i)__builtin_ia32_vphaddbq((__v16qi)__A); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_haddd_epi16(__m128i __A) { return (__m128i)__builtin_ia32_vphaddwd((__v8hi)__A); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_haddq_epi16(__m128i __A) { return (__m128i)__builtin_ia32_vphaddwq((__v8hi)__A); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_haddq_epi32(__m128i __A) { return (__m128i)__builtin_ia32_vphadddq((__v4si)__A); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_haddw_epu8(__m128i __A) { return (__m128i)__builtin_ia32_vphaddubw((__v16qi)__A); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_haddd_epu8(__m128i __A) { return (__m128i)__builtin_ia32_vphaddubd((__v16qi)__A); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_haddq_epu8(__m128i __A) { return (__m128i)__builtin_ia32_vphaddubq((__v16qi)__A); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_haddd_epu16(__m128i __A) { return (__m128i)__builtin_ia32_vphadduwd((__v8hi)__A); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_haddq_epu16(__m128i __A) { return (__m128i)__builtin_ia32_vphadduwq((__v8hi)__A); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_haddq_epu32(__m128i __A) { return (__m128i)__builtin_ia32_vphaddudq((__v4si)__A); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_hsubw_epi8(__m128i __A) { return (__m128i)__builtin_ia32_vphsubbw((__v16qi)__A); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_hsubd_epi16(__m128i __A) { return (__m128i)__builtin_ia32_vphsubwd((__v8hi)__A); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_hsubq_epi32(__m128i __A) { return (__m128i)__builtin_ia32_vphsubdq((__v4si)__A); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_cmov_si128(__m128i __A, __m128i __B, __m128i __C) { return (__m128i)(((__v2du)__A & (__v2du)__C) | ((__v2du)__B & ~(__v2du)__C)); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_cmov_si256(__m256i __A, __m256i __B, __m256i __C) { return (__m256i)(((__v4du)__A & (__v4du)__C) | ((__v4du)__B & ~(__v4du)__C)); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_perm_epi8(__m128i __A, __m128i __B, __m128i __C) { return (__m128i)__builtin_ia32_vpperm((__v16qi)__A, (__v16qi)__B, (__v16qi)__C); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_rot_epi8(__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_vprotb((__v16qi)__A, (__v16qi)__B); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_rot_epi16(__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_vprotw((__v8hi)__A, (__v8hi)__B); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_rot_epi32(__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_vprotd((__v4si)__A, (__v4si)__B); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_rot_epi64(__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_vprotq((__v2di)__A, (__v2di)__B); } #define _mm_roti_epi8(A, N) __extension__ ({ \ (__m128i)__builtin_ia32_vprotbi((__v16qi)(__m128i)(A), (N)); }) #define _mm_roti_epi16(A, N) __extension__ ({ \ (__m128i)__builtin_ia32_vprotwi((__v8hi)(__m128i)(A), (N)); }) #define _mm_roti_epi32(A, N) __extension__ ({ \ (__m128i)__builtin_ia32_vprotdi((__v4si)(__m128i)(A), (N)); }) #define _mm_roti_epi64(A, N) __extension__ ({ \ (__m128i)__builtin_ia32_vprotqi((__v2di)(__m128i)(A), (N)); }) static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_shl_epi8(__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_vpshlb((__v16qi)__A, (__v16qi)__B); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_shl_epi16(__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_vpshlw((__v8hi)__A, (__v8hi)__B); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_shl_epi32(__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_vpshld((__v4si)__A, (__v4si)__B); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_shl_epi64(__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_vpshlq((__v2di)__A, (__v2di)__B); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sha_epi8(__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_vpshab((__v16qi)__A, (__v16qi)__B); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sha_epi16(__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_vpshaw((__v8hi)__A, (__v8hi)__B); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sha_epi32(__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_vpshad((__v4si)__A, (__v4si)__B); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_sha_epi64(__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_vpshaq((__v2di)__A, (__v2di)__B); } #define _mm_com_epu8(A, B, N) __extension__ ({ \ (__m128i)__builtin_ia32_vpcomub((__v16qi)(__m128i)(A), \ (__v16qi)(__m128i)(B), (N)); }) #define _mm_com_epu16(A, B, N) __extension__ ({ \ (__m128i)__builtin_ia32_vpcomuw((__v8hi)(__m128i)(A), \ (__v8hi)(__m128i)(B), (N)); }) #define _mm_com_epu32(A, B, N) __extension__ ({ \ (__m128i)__builtin_ia32_vpcomud((__v4si)(__m128i)(A), \ (__v4si)(__m128i)(B), (N)); }) #define _mm_com_epu64(A, B, N) __extension__ ({ \ (__m128i)__builtin_ia32_vpcomuq((__v2di)(__m128i)(A), \ (__v2di)(__m128i)(B), (N)); }) #define _mm_com_epi8(A, B, N) __extension__ ({ \ (__m128i)__builtin_ia32_vpcomb((__v16qi)(__m128i)(A), \ (__v16qi)(__m128i)(B), (N)); }) #define _mm_com_epi16(A, B, N) __extension__ ({ \ (__m128i)__builtin_ia32_vpcomw((__v8hi)(__m128i)(A), \ (__v8hi)(__m128i)(B), (N)); }) #define _mm_com_epi32(A, B, N) __extension__ ({ \ (__m128i)__builtin_ia32_vpcomd((__v4si)(__m128i)(A), \ (__v4si)(__m128i)(B), (N)); }) #define _mm_com_epi64(A, B, N) __extension__ ({ \ (__m128i)__builtin_ia32_vpcomq((__v2di)(__m128i)(A), \ (__v2di)(__m128i)(B), (N)); }) #define _MM_PCOMCTRL_LT 0 #define _MM_PCOMCTRL_LE 1 #define _MM_PCOMCTRL_GT 2 #define _MM_PCOMCTRL_GE 3 #define _MM_PCOMCTRL_EQ 4 #define _MM_PCOMCTRL_NEQ 5 #define _MM_PCOMCTRL_FALSE 6 #define _MM_PCOMCTRL_TRUE 7 static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comlt_epu8(__m128i __A, __m128i __B) { return _mm_com_epu8(__A, __B, _MM_PCOMCTRL_LT); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comle_epu8(__m128i __A, __m128i __B) { return _mm_com_epu8(__A, __B, _MM_PCOMCTRL_LE); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comgt_epu8(__m128i __A, __m128i __B) { return _mm_com_epu8(__A, __B, _MM_PCOMCTRL_GT); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comge_epu8(__m128i __A, __m128i __B) { return _mm_com_epu8(__A, __B, _MM_PCOMCTRL_GE); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comeq_epu8(__m128i __A, __m128i __B) { return _mm_com_epu8(__A, __B, _MM_PCOMCTRL_EQ); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comneq_epu8(__m128i __A, __m128i __B) { return _mm_com_epu8(__A, __B, _MM_PCOMCTRL_NEQ); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comfalse_epu8(__m128i __A, __m128i __B) { return _mm_com_epu8(__A, __B, _MM_PCOMCTRL_FALSE); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comtrue_epu8(__m128i __A, __m128i __B) { return _mm_com_epu8(__A, __B, _MM_PCOMCTRL_TRUE); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comlt_epu16(__m128i __A, __m128i __B) { return _mm_com_epu16(__A, __B, _MM_PCOMCTRL_LT); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comle_epu16(__m128i __A, __m128i __B) { return _mm_com_epu16(__A, __B, _MM_PCOMCTRL_LE); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comgt_epu16(__m128i __A, __m128i __B) { return _mm_com_epu16(__A, __B, _MM_PCOMCTRL_GT); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comge_epu16(__m128i __A, __m128i __B) { return _mm_com_epu16(__A, __B, _MM_PCOMCTRL_GE); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comeq_epu16(__m128i __A, __m128i __B) { return _mm_com_epu16(__A, __B, _MM_PCOMCTRL_EQ); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comneq_epu16(__m128i __A, __m128i __B) { return _mm_com_epu16(__A, __B, _MM_PCOMCTRL_NEQ); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comfalse_epu16(__m128i __A, __m128i __B) { return _mm_com_epu16(__A, __B, _MM_PCOMCTRL_FALSE); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comtrue_epu16(__m128i __A, __m128i __B) { return _mm_com_epu16(__A, __B, _MM_PCOMCTRL_TRUE); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comlt_epu32(__m128i __A, __m128i __B) { return _mm_com_epu32(__A, __B, _MM_PCOMCTRL_LT); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comle_epu32(__m128i __A, __m128i __B) { return _mm_com_epu32(__A, __B, _MM_PCOMCTRL_LE); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comgt_epu32(__m128i __A, __m128i __B) { return _mm_com_epu32(__A, __B, _MM_PCOMCTRL_GT); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comge_epu32(__m128i __A, __m128i __B) { return _mm_com_epu32(__A, __B, _MM_PCOMCTRL_GE); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comeq_epu32(__m128i __A, __m128i __B) { return _mm_com_epu32(__A, __B, _MM_PCOMCTRL_EQ); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comneq_epu32(__m128i __A, __m128i __B) { return _mm_com_epu32(__A, __B, _MM_PCOMCTRL_NEQ); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comfalse_epu32(__m128i __A, __m128i __B) { return _mm_com_epu32(__A, __B, _MM_PCOMCTRL_FALSE); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comtrue_epu32(__m128i __A, __m128i __B) { return _mm_com_epu32(__A, __B, _MM_PCOMCTRL_TRUE); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comlt_epu64(__m128i __A, __m128i __B) { return _mm_com_epu64(__A, __B, _MM_PCOMCTRL_LT); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comle_epu64(__m128i __A, __m128i __B) { return _mm_com_epu64(__A, __B, _MM_PCOMCTRL_LE); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comgt_epu64(__m128i __A, __m128i __B) { return _mm_com_epu64(__A, __B, _MM_PCOMCTRL_GT); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comge_epu64(__m128i __A, __m128i __B) { return _mm_com_epu64(__A, __B, _MM_PCOMCTRL_GE); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comeq_epu64(__m128i __A, __m128i __B) { return _mm_com_epu64(__A, __B, _MM_PCOMCTRL_EQ); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comneq_epu64(__m128i __A, __m128i __B) { return _mm_com_epu64(__A, __B, _MM_PCOMCTRL_NEQ); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comfalse_epu64(__m128i __A, __m128i __B) { return _mm_com_epu64(__A, __B, _MM_PCOMCTRL_FALSE); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comtrue_epu64(__m128i __A, __m128i __B) { return _mm_com_epu64(__A, __B, _MM_PCOMCTRL_TRUE); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comlt_epi8(__m128i __A, __m128i __B) { return _mm_com_epi8(__A, __B, _MM_PCOMCTRL_LT); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comle_epi8(__m128i __A, __m128i __B) { return _mm_com_epi8(__A, __B, _MM_PCOMCTRL_LE); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comgt_epi8(__m128i __A, __m128i __B) { return _mm_com_epi8(__A, __B, _MM_PCOMCTRL_GT); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comge_epi8(__m128i __A, __m128i __B) { return _mm_com_epi8(__A, __B, _MM_PCOMCTRL_GE); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comeq_epi8(__m128i __A, __m128i __B) { return _mm_com_epi8(__A, __B, _MM_PCOMCTRL_EQ); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comneq_epi8(__m128i __A, __m128i __B) { return _mm_com_epi8(__A, __B, _MM_PCOMCTRL_NEQ); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comfalse_epi8(__m128i __A, __m128i __B) { return _mm_com_epi8(__A, __B, _MM_PCOMCTRL_FALSE); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comtrue_epi8(__m128i __A, __m128i __B) { return _mm_com_epi8(__A, __B, _MM_PCOMCTRL_TRUE); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comlt_epi16(__m128i __A, __m128i __B) { return _mm_com_epi16(__A, __B, _MM_PCOMCTRL_LT); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comle_epi16(__m128i __A, __m128i __B) { return _mm_com_epi16(__A, __B, _MM_PCOMCTRL_LE); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comgt_epi16(__m128i __A, __m128i __B) { return _mm_com_epi16(__A, __B, _MM_PCOMCTRL_GT); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comge_epi16(__m128i __A, __m128i __B) { return _mm_com_epi16(__A, __B, _MM_PCOMCTRL_GE); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comeq_epi16(__m128i __A, __m128i __B) { return _mm_com_epi16(__A, __B, _MM_PCOMCTRL_EQ); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comneq_epi16(__m128i __A, __m128i __B) { return _mm_com_epi16(__A, __B, _MM_PCOMCTRL_NEQ); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comfalse_epi16(__m128i __A, __m128i __B) { return _mm_com_epi16(__A, __B, _MM_PCOMCTRL_FALSE); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comtrue_epi16(__m128i __A, __m128i __B) { return _mm_com_epi16(__A, __B, _MM_PCOMCTRL_TRUE); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comlt_epi32(__m128i __A, __m128i __B) { return _mm_com_epi32(__A, __B, _MM_PCOMCTRL_LT); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comle_epi32(__m128i __A, __m128i __B) { return _mm_com_epi32(__A, __B, _MM_PCOMCTRL_LE); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comgt_epi32(__m128i __A, __m128i __B) { return _mm_com_epi32(__A, __B, _MM_PCOMCTRL_GT); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comge_epi32(__m128i __A, __m128i __B) { return _mm_com_epi32(__A, __B, _MM_PCOMCTRL_GE); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comeq_epi32(__m128i __A, __m128i __B) { return _mm_com_epi32(__A, __B, _MM_PCOMCTRL_EQ); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comneq_epi32(__m128i __A, __m128i __B) { return _mm_com_epi32(__A, __B, _MM_PCOMCTRL_NEQ); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comfalse_epi32(__m128i __A, __m128i __B) { return _mm_com_epi32(__A, __B, _MM_PCOMCTRL_FALSE); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comtrue_epi32(__m128i __A, __m128i __B) { return _mm_com_epi32(__A, __B, _MM_PCOMCTRL_TRUE); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comlt_epi64(__m128i __A, __m128i __B) { return _mm_com_epi64(__A, __B, _MM_PCOMCTRL_LT); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comle_epi64(__m128i __A, __m128i __B) { return _mm_com_epi64(__A, __B, _MM_PCOMCTRL_LE); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comgt_epi64(__m128i __A, __m128i __B) { return _mm_com_epi64(__A, __B, _MM_PCOMCTRL_GT); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comge_epi64(__m128i __A, __m128i __B) { return _mm_com_epi64(__A, __B, _MM_PCOMCTRL_GE); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comeq_epi64(__m128i __A, __m128i __B) { return _mm_com_epi64(__A, __B, _MM_PCOMCTRL_EQ); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comneq_epi64(__m128i __A, __m128i __B) { return _mm_com_epi64(__A, __B, _MM_PCOMCTRL_NEQ); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comfalse_epi64(__m128i __A, __m128i __B) { return _mm_com_epi64(__A, __B, _MM_PCOMCTRL_FALSE); } static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_comtrue_epi64(__m128i __A, __m128i __B) { return _mm_com_epi64(__A, __B, _MM_PCOMCTRL_TRUE); } #define _mm_permute2_pd(X, Y, C, I) __extension__ ({ \ (__m128d)__builtin_ia32_vpermil2pd((__v2df)(__m128d)(X), \ (__v2df)(__m128d)(Y), \ (__v2di)(__m128i)(C), (I)); }) #define _mm256_permute2_pd(X, Y, C, I) __extension__ ({ \ (__m256d)__builtin_ia32_vpermil2pd256((__v4df)(__m256d)(X), \ (__v4df)(__m256d)(Y), \ (__v4di)(__m256i)(C), (I)); }) #define _mm_permute2_ps(X, Y, C, I) __extension__ ({ \ (__m128)__builtin_ia32_vpermil2ps((__v4sf)(__m128)(X), (__v4sf)(__m128)(Y), \ (__v4si)(__m128i)(C), (I)); }) #define _mm256_permute2_ps(X, Y, C, I) __extension__ ({ \ (__m256)__builtin_ia32_vpermil2ps256((__v8sf)(__m256)(X), \ (__v8sf)(__m256)(Y), \ (__v8si)(__m256i)(C), (I)); }) static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_frcz_ss(__m128 __A) { return (__m128)__builtin_ia32_vfrczss((__v4sf)__A); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_frcz_sd(__m128d __A) { return (__m128d)__builtin_ia32_vfrczsd((__v2df)__A); } static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_frcz_ps(__m128 __A) { return (__m128)__builtin_ia32_vfrczps((__v4sf)__A); } static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_frcz_pd(__m128d __A) { return (__m128d)__builtin_ia32_vfrczpd((__v2df)__A); } static __inline__ __m256 __DEFAULT_FN_ATTRS _mm256_frcz_ps(__m256 __A) { return (__m256)__builtin_ia32_vfrczps256((__v8sf)__A); } static __inline__ __m256d __DEFAULT_FN_ATTRS _mm256_frcz_pd(__m256d __A) { return (__m256d)__builtin_ia32_vfrczpd256((__v4df)__A); } #undef __DEFAULT_FN_ATTRS #endif /* __XOPINTRIN_H */ # 783 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/xopintrin.h" 3 # 69 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/x86intrin.h" 2 3 #endif # 70 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/x86intrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || defined(__TBM__) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 72 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/x86intrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/tbmintrin.h" 1 3 /*===---- tbmintrin.h - TBM intrinsics -------------------------------------=== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __X86INTRIN_H #error "Never use directly; include instead." #endif # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/tbmintrin.h" 3 #ifndef __TBMINTRIN_H #define __TBMINTRIN_H /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("tbm"))) #define __bextri_u32(a, b) \ ((unsigned int)__builtin_ia32_bextri_u32((unsigned int)(a), \ (unsigned int)(b))) static __inline__ unsigned int __DEFAULT_FN_ATTRS __blcfill_u32(unsigned int __a) { return __a & (__a + 1); } static __inline__ unsigned int __DEFAULT_FN_ATTRS __blci_u32(unsigned int __a) { return __a | ~(__a + 1); } static __inline__ unsigned int __DEFAULT_FN_ATTRS __blcic_u32(unsigned int __a) { return ~__a & (__a + 1); } static __inline__ unsigned int __DEFAULT_FN_ATTRS __blcmsk_u32(unsigned int __a) { return __a ^ (__a + 1); } static __inline__ unsigned int __DEFAULT_FN_ATTRS __blcs_u32(unsigned int __a) { return __a | (__a + 1); } static __inline__ unsigned int __DEFAULT_FN_ATTRS __blsfill_u32(unsigned int __a) { return __a | (__a - 1); } static __inline__ unsigned int __DEFAULT_FN_ATTRS __blsic_u32(unsigned int __a) { return ~__a | (__a - 1); } static __inline__ unsigned int __DEFAULT_FN_ATTRS __t1mskc_u32(unsigned int __a) { return ~__a | (__a + 1); } static __inline__ unsigned int __DEFAULT_FN_ATTRS __tzmsk_u32(unsigned int __a) { return ~__a & (__a - 1); } #ifdef __x86_64__ #define __bextri_u64(a, b) \ ((unsigned long long)__builtin_ia32_bextri_u64((unsigned long long)(a), \ (unsigned long long)(b))) static __inline__ unsigned long long __DEFAULT_FN_ATTRS __blcfill_u64(unsigned long long __a) { return __a & (__a + 1); } static __inline__ unsigned long long __DEFAULT_FN_ATTRS __blci_u64(unsigned long long __a) { return __a | ~(__a + 1); } static __inline__ unsigned long long __DEFAULT_FN_ATTRS __blcic_u64(unsigned long long __a) { return ~__a & (__a + 1); } static __inline__ unsigned long long __DEFAULT_FN_ATTRS __blcmsk_u64(unsigned long long __a) { return __a ^ (__a + 1); } static __inline__ unsigned long long __DEFAULT_FN_ATTRS __blcs_u64(unsigned long long __a) { return __a | (__a + 1); } static __inline__ unsigned long long __DEFAULT_FN_ATTRS __blsfill_u64(unsigned long long __a) { return __a | (__a - 1); } static __inline__ unsigned long long __DEFAULT_FN_ATTRS __blsic_u64(unsigned long long __a) { return ~__a | (__a - 1); } static __inline__ unsigned long long __DEFAULT_FN_ATTRS __t1mskc_u64(unsigned long long __a) { return ~__a | (__a + 1); } static __inline__ unsigned long long __DEFAULT_FN_ATTRS __tzmsk_u64(unsigned long long __a) { return ~__a & (__a - 1); } #endif # 151 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/tbmintrin.h" 3 #undef __DEFAULT_FN_ATTRS #endif /* __TBMINTRIN_H */ # 155 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/tbmintrin.h" 3 # 73 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/x86intrin.h" 2 3 #endif # 74 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/x86intrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || defined(__LWP__) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 76 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/x86intrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/lwpintrin.h" 1 3 /*===---- lwpintrin.h - LWP intrinsics -------------------------------------=== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __X86INTRIN_H #error "Never use directly; include instead." #endif # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/lwpintrin.h" 3 #ifndef __LWPINTRIN_H #define __LWPINTRIN_H /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("lwp"))) /// \brief Parses the LWPCB at the specified address and enables /// profiling if valid. /// /// \headerfile /// /// This intrinsic corresponds to the LLWPCB instruction. /// /// \param __addr /// Address to the new Lightweight Profiling Control Block (LWPCB). If the /// LWPCB is valid, writes the address into the LWP_CBADDR MSR and enables /// Lightweight Profiling. static __inline__ void __DEFAULT_FN_ATTRS __llwpcb (void *__addr) { __builtin_ia32_llwpcb(__addr); } /// \brief Flushes the LWP state to memory and returns the address of the LWPCB. /// /// \headerfile /// /// This intrinsic corresponds to the SLWPCB instruction. /// /// \return /// Address to the current Lightweight Profiling Control Block (LWPCB). /// If LWP is not currently enabled, returns NULL. static __inline__ void* __DEFAULT_FN_ATTRS __slwpcb () { return __builtin_ia32_slwpcb(); } /// \brief Inserts programmed event record into the LWP event ring buffer /// and advances the ring buffer pointer. /// /// \headerfile /// /// This intrinsic corresponds to the LWPINS instruction. /// /// \param DATA2 /// A 32-bit value is zero-extended and inserted into the 64-bit Data2 field. /// \param DATA1 /// A 32-bit value is inserted into the 32-bit Data1 field. /// \param FLAGS /// A 32-bit immediate value is inserted into the 32-bit Flags field. /// \returns If the ring buffer is full and LWP is running in Synchronized Mode, /// the event record overwrites the last record in the buffer, the MissedEvents /// counter in the LWPCB is incremented, the head pointer is not advanced, and /// 1 is returned. Otherwise 0 is returned. #define __lwpins32(DATA2, DATA1, FLAGS) \ (__builtin_ia32_lwpins32((unsigned int) (DATA2), (unsigned int) (DATA1), \ (unsigned int) (FLAGS))) /// \brief Decrements the LWP programmed value sample event counter. If the result is /// negative, inserts an event record into the LWP event ring buffer in memory /// and advances the ring buffer pointer. /// /// \headerfile /// /// This intrinsic corresponds to the LWPVAL instruction. /// /// \param DATA2 /// A 32-bit value is zero-extended and inserted into the 64-bit Data2 field. /// \param DATA1 /// A 32-bit value is inserted into the 32-bit Data1 field. /// \param FLAGS /// A 32-bit immediate value is inserted into the 32-bit Flags field. #define __lwpval32(DATA2, DATA1, FLAGS) \ (__builtin_ia32_lwpval32((unsigned int) (DATA2), (unsigned int) (DATA1), \ (unsigned int) (FLAGS))) #ifdef __x86_64__ /// \brief Inserts programmed event record into the LWP event ring buffer /// and advances the ring buffer pointer. /// /// \headerfile /// /// This intrinsic corresponds to the LWPINS instruction. /// /// \param DATA2 /// A 64-bit value is inserted into the 64-bit Data2 field. /// \param DATA1 /// A 32-bit value is inserted into the 32-bit Data1 field. /// \param FLAGS /// A 32-bit immediate value is inserted into the 32-bit Flags field. /// \returns If the ring buffer is full and LWP is running in Synchronized Mode, /// the event record overwrites the last record in the buffer, the MissedEvents /// counter in the LWPCB is incremented, the head pointer is not advanced, and /// 1 is returned. Otherwise 0 is returned. #define __lwpins64(DATA2, DATA1, FLAGS) \ (__builtin_ia32_lwpins64((unsigned long long) (DATA2), (unsigned int) (DATA1), \ (unsigned int) (FLAGS))) /// \brief Decrements the LWP programmed value sample event counter. If the result is /// negative, inserts an event record into the LWP event ring buffer in memory /// and advances the ring buffer pointer. /// /// \headerfile /// /// This intrinsic corresponds to the LWPVAL instruction. /// /// \param DATA2 /// A 64-bit value is and inserted into the 64-bit Data2 field. /// \param DATA1 /// A 32-bit value is inserted into the 32-bit Data1 field. /// \param FLAGS /// A 32-bit immediate value is inserted into the 32-bit Flags field. #define __lwpval64(DATA2, DATA1, FLAGS) \ (__builtin_ia32_lwpval64((unsigned long long) (DATA2), (unsigned int) (DATA1), \ (unsigned int) (FLAGS))) #endif # 147 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/lwpintrin.h" 3 #undef __DEFAULT_FN_ATTRS #endif /* __LWPINTRIN_H */ # 151 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/lwpintrin.h" 3 # 77 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/x86intrin.h" 2 3 #endif # 78 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/x86intrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || defined(__F16C__) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 80 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/x86intrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/f16cintrin.h" 1 3 /*===---- f16cintrin.h - F16C intrinsics -----------------------------------=== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #if !defined __X86INTRIN_H && !defined __EMMINTRIN_H && !defined __IMMINTRIN_H #error "Never use directly; include instead." #endif # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/f16cintrin.h" 3 #ifndef __F16CINTRIN_H #define __F16CINTRIN_H /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS \ __attribute__((__always_inline__, __nodebug__, __target__("f16c"))) /// \brief Converts a 16-bit half-precision float value into a 32-bit float /// value. /// /// \headerfile /// /// This intrinsic corresponds to the VCVTPH2PS instruction. /// /// \param __a /// A 16-bit half-precision float value. /// \returns The converted 32-bit float value. static __inline float __DEFAULT_FN_ATTRS _cvtsh_ss(unsigned short __a) { __v8hi v = {(short)__a, 0, 0, 0, 0, 0, 0, 0}; __v4sf r = __builtin_ia32_vcvtph2ps(v); return r[0]; } /// \brief Converts a 32-bit single-precision float value to a 16-bit /// half-precision float value. /// /// \headerfile /// /// \code /// unsigned short _cvtss_sh(float a, const int imm); /// \endcode /// /// This intrinsic corresponds to the VCVTPS2PH instruction. /// /// \param a /// A 32-bit single-precision float value to be converted to a 16-bit /// half-precision float value. /// \param imm /// An immediate value controlling rounding using bits [2:0]: \n /// 000: Nearest \n /// 001: Down \n /// 010: Up \n /// 011: Truncate \n /// 1XX: Use MXCSR.RC for rounding /// \returns The converted 16-bit half-precision float value. #define _cvtss_sh(a, imm) __extension__ ({ \ (unsigned short)(((__v8hi)__builtin_ia32_vcvtps2ph((__v4sf){a, 0, 0, 0}, \ (imm)))[0]); }) /// \brief Converts a 128-bit vector containing 32-bit float values into a /// 128-bit vector containing 16-bit half-precision float values. /// /// \headerfile /// /// \code /// __m128i _mm_cvtps_ph(__m128 a, const int imm); /// \endcode /// /// This intrinsic corresponds to the VCVTPS2PH instruction. /// /// \param a /// A 128-bit vector containing 32-bit float values. /// \param imm /// An immediate value controlling rounding using bits [2:0]: \n /// 000: Nearest \n /// 001: Down \n /// 010: Up \n /// 011: Truncate \n /// 1XX: Use MXCSR.RC for rounding /// \returns A 128-bit vector containing converted 16-bit half-precision float /// values. The lower 64 bits are used to store the converted 16-bit /// half-precision floating-point values. #define _mm_cvtps_ph(a, imm) __extension__ ({ \ (__m128i)__builtin_ia32_vcvtps2ph((__v4sf)(__m128)(a), (imm)); }) /// \brief Converts a 128-bit vector containing 16-bit half-precision float /// values into a 128-bit vector containing 32-bit float values. /// /// \headerfile /// /// This intrinsic corresponds to the VCVTPH2PS instruction. /// /// \param __a /// A 128-bit vector containing 16-bit half-precision float values. The lower /// 64 bits are used in the conversion. /// \returns A 128-bit vector of [4 x float] containing converted float values. static __inline __m128 __DEFAULT_FN_ATTRS _mm_cvtph_ps(__m128i __a) { return (__m128)__builtin_ia32_vcvtph2ps((__v8hi)__a); } #undef __DEFAULT_FN_ATTRS #endif /* __F16CINTRIN_H */ # 125 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/f16cintrin.h" 3 # 81 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/x86intrin.h" 2 3 #endif # 82 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/x86intrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || defined(__MWAITX__) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 84 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/x86intrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/mwaitxintrin.h" 1 3 /*===---- mwaitxintrin.h - MONITORX/MWAITX intrinsics ----------------------=== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __X86INTRIN_H #error "Never use directly; include instead." #endif # 27 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/mwaitxintrin.h" 3 #ifndef _MWAITXINTRIN_H #define _MWAITXINTRIN_H /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("mwaitx"))) static __inline__ void __DEFAULT_FN_ATTRS _mm_monitorx(void const * __p, unsigned __extensions, unsigned __hints) { __builtin_ia32_monitorx((void *)__p, __extensions, __hints); } static __inline__ void __DEFAULT_FN_ATTRS _mm_mwaitx(unsigned __extensions, unsigned __hints, unsigned __clock) { __builtin_ia32_mwaitx(__extensions, __hints, __clock); } #undef __DEFAULT_FN_ATTRS #endif /* _MWAITXINTRIN_H */ # 48 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/mwaitxintrin.h" 3 # 85 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/x86intrin.h" 2 3 #endif # 86 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/x86intrin.h" 3 #if !defined(_MSC_VER) || __has_feature(modules) || defined(__CLZERO__) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 88 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/x86intrin.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/clzerointrin.h" 1 3 /*===----------------------- clzerointrin.h - CLZERO ----------------------=== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __X86INTRIN_H #error "Never use directly; include instead." #endif # 26 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/clzerointrin.h" 3 #ifndef _CLZEROINTRIN_H #define _CLZEROINTRIN_H /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS \ __attribute__((__always_inline__, __nodebug__, __target__("clzero"))) /// \brief Loads the cache line address and zero's out the cacheline /// /// \headerfile /// /// This intrinsic corresponds to the CLZERO instruction. /// /// \param __line /// A pointer to a cacheline which needs to be zeroed out. static __inline__ void __DEFAULT_FN_ATTRS _mm_clzero (void * __line) { __builtin_ia32_clzero ((void *)__line); } #undef __DEFAULT_FN_ATTRS #endif /* _CLZEROINTRIN_H */ # 51 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/clzerointrin.h" 3 # 89 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/x86intrin.h" 2 3 #endif # 90 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/x86intrin.h" 3 #endif /* __X86INTRIN_H */ # 92 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/x86intrin.h" 3 # 34 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/opt_random.h" 2 3 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 37 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/opt_random.h" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION #ifdef __SSE3__ template<> template void normal_distribution:: __generate(typename normal_distribution::result_type* __f, typename normal_distribution::result_type* __t, _UniformRandomNumberGenerator& __urng, const param_type& __param) { typedef uint64_t __uctype; if (__f == __t) return; if (_M_saved_available) { _M_saved_available = false; *__f++ = _M_saved * __param.stddev() + __param.mean(); if (__f == __t) return; } constexpr uint64_t __maskval = 0xfffffffffffffull; static const __m128i __mask = _mm_set1_epi64x(__maskval); static const __m128i __two = _mm_set1_epi64x(0x4000000000000000ull); static const __m128d __three = _mm_set1_pd(3.0); const __m128d __av = _mm_set1_pd(__param.mean()); const __uctype __urngmin = __urng.min(); const __uctype __urngmax = __urng.max(); const __uctype __urngrange = __urngmax - __urngmin; const __uctype __uerngrange = __urngrange + 1; while (__f + 1 < __t) { double __le; __m128d __x; do { union { __m128i __i; __m128d __d; } __v; if (__urngrange > __maskval) { if (__detail::_Power_of_2(__uerngrange)) __v.__i = _mm_and_si128(_mm_set_epi64x(__urng(), __urng()), __mask); else { const __uctype __uerange = __maskval + 1; const __uctype __scaling = __urngrange / __uerange; const __uctype __past = __uerange * __scaling; uint64_t __v1; do __v1 = __uctype(__urng()) - __urngmin; while (__v1 >= __past); __v1 /= __scaling; uint64_t __v2; do __v2 = __uctype(__urng()) - __urngmin; while (__v2 >= __past); __v2 /= __scaling; __v.__i = _mm_set_epi64x(__v1, __v2); } } else if (__urngrange == __maskval) __v.__i = _mm_set_epi64x(__urng(), __urng()); else if ((__urngrange + 2) * __urngrange >= __maskval && __detail::_Power_of_2(__uerngrange)) { uint64_t __v1 = __urng() * __uerngrange + __urng(); uint64_t __v2 = __urng() * __uerngrange + __urng(); __v.__i = _mm_and_si128(_mm_set_epi64x(__v1, __v2), __mask); } else { size_t __nrng = 2; __uctype __high = __maskval / __uerngrange / __uerngrange; while (__high > __uerngrange) { ++__nrng; __high /= __uerngrange; } const __uctype __highrange = __high + 1; const __uctype __scaling = __urngrange / __highrange; const __uctype __past = __highrange * __scaling; __uctype __tmp; uint64_t __v1; do { do __tmp = __uctype(__urng()) - __urngmin; while (__tmp >= __past); __v1 = __tmp / __scaling; for (size_t __cnt = 0; __cnt < __nrng; ++__cnt) { __tmp = __v1; __v1 *= __uerngrange; __v1 += __uctype(__urng()) - __urngmin; } } while (__v1 > __maskval || __v1 < __tmp); uint64_t __v2; do { do __tmp = __uctype(__urng()) - __urngmin; while (__tmp >= __past); __v2 = __tmp / __scaling; for (size_t __cnt = 0; __cnt < __nrng; ++__cnt) { __tmp = __v2; __v2 *= __uerngrange; __v2 += __uctype(__urng()) - __urngmin; } } while (__v2 > __maskval || __v2 < __tmp); __v.__i = _mm_set_epi64x(__v1, __v2); } __v.__i = _mm_or_si128(__v.__i, __two); __x = _mm_sub_pd(__v.__d, __three); __m128d __m = _mm_mul_pd(__x, __x); __le = _mm_cvtsd_f64(_mm_hadd_pd (__m, __m)); } while (__le == 0.0 || __le >= 1.0); double __mult = (std::sqrt(-2.0 * std::log(__le) / __le) * __param.stddev()); __x = _mm_add_pd(_mm_mul_pd(__x, _mm_set1_pd(__mult)), __av); _mm_storeu_pd(__f, __x); __f += 2; } if (__f != __t) { result_type __x, __y, __r2; __detail::_Adaptor<_UniformRandomNumberGenerator, result_type> __aurng(__urng); do { __x = result_type(2.0) * __aurng() - 1.0; __y = result_type(2.0) * __aurng() - 1.0; __r2 = __x * __x + __y * __y; } while (__r2 > 1.0 || __r2 == 0.0); const result_type __mult = std::sqrt(-2 * std::log(__r2) / __r2); _M_saved = __x * __mult; _M_saved_available = true; *__f = __y * __mult * __param.stddev() + __param.mean(); } } #endif # 213 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/opt_random.h" 3 _GLIBCXX_END_NAMESPACE_VERSION } // namespace #endif // _BITS_OPT_RANDOM_H # 220 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/opt_random.h" 3 # 51 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/random" 2 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 51 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/random" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/random.tcc" 1 3 // random number generation (out of line) -*- C++ -*- // Copyright (C) 2009-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file bits/random.tcc * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{random} */ #ifndef _RANDOM_TCC #define _RANDOM_TCC 1 #if 0 /* expanded by -frewrite-includes */ #include // std::accumulate and std::partial_sum #endif /* expanded by -frewrite-includes */ # 33 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/random.tcc" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/numeric" 1 3 // -*- C++ -*- // Copyright (C) 2001-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /* * * Copyright (c) 1994 * Hewlett-Packard Company * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Hewlett-Packard Company makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. * * * Copyright (c) 1996,1997 * Silicon Graphics Computer Systems, Inc. * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Silicon Graphics makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. */ /** @file include/numeric * This is a Standard C++ Library header. */ #ifndef _GLIBCXX_NUMERIC #define _GLIBCXX_NUMERIC 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 59 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/numeric" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 60 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/numeric" 3 # 61 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/numeric" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 61 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/numeric" 3 # 62 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/numeric" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 62 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/numeric" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_numeric.h" 1 3 // Numeric functions implementation -*- C++ -*- // Copyright (C) 2001-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /* * * Copyright (c) 1994 * Hewlett-Packard Company * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Hewlett-Packard Company makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. * * * Copyright (c) 1996,1997 * Silicon Graphics Computer Systems, Inc. * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Silicon Graphics makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. */ /** @file bits/stl_numeric.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{numeric} */ #ifndef _STL_NUMERIC_H #define _STL_NUMERIC_H 1 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 59 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_numeric.h" 3 # 60 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_numeric.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 60 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_numeric.h" 3 # 61 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_numeric.h" 3 #if 0 /* expanded by -frewrite-includes */ #include // For _GLIBCXX_MOVE #endif /* expanded by -frewrite-includes */ # 61 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_numeric.h" 3 # 62 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_numeric.h" 3 #if __cplusplus >= 201103L namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION /** * @brief Create a range of sequentially increasing values. * * For each element in the range @p [first,last) assigns @p value and * increments @p value as if by @p ++value. * * @param __first Start of range. * @param __last End of range. * @param __value Starting value. * @return Nothing. */ template void iota(_ForwardIterator __first, _ForwardIterator __last, _Tp __value) { // concept requirements __glibcxx_function_requires(_Mutable_ForwardIteratorConcept< _ForwardIterator>) __glibcxx_function_requires(_ConvertibleConcept<_Tp, typename iterator_traits<_ForwardIterator>::value_type>) __glibcxx_requires_valid_range(__first, __last); for (; __first != __last; ++__first) { *__first = __value; ++__value; } } _GLIBCXX_END_NAMESPACE_VERSION } // namespace std #endif # 102 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_numeric.h" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_ALGO /** * @brief Accumulate values in a range. * * Accumulates the values in the range [first,last) using operator+(). The * initial value is @a init. The values are processed in order. * * @param __first Start of range. * @param __last End of range. * @param __init Starting value to add other values to. * @return The final sum. */ template inline _Tp accumulate(_InputIterator __first, _InputIterator __last, _Tp __init) { // concept requirements __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) __glibcxx_requires_valid_range(__first, __last); for (; __first != __last; ++__first) __init = __init + *__first; return __init; } /** * @brief Accumulate values in a range with operation. * * Accumulates the values in the range [first,last) using the function * object @p __binary_op. The initial value is @p __init. The values are * processed in order. * * @param __first Start of range. * @param __last End of range. * @param __init Starting value to add other values to. * @param __binary_op Function object to accumulate with. * @return The final sum. */ template inline _Tp accumulate(_InputIterator __first, _InputIterator __last, _Tp __init, _BinaryOperation __binary_op) { // concept requirements __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) __glibcxx_requires_valid_range(__first, __last); for (; __first != __last; ++__first) __init = __binary_op(__init, *__first); return __init; } /** * @brief Compute inner product of two ranges. * * Starting with an initial value of @p __init, multiplies successive * elements from the two ranges and adds each product into the accumulated * value using operator+(). The values in the ranges are processed in * order. * * @param __first1 Start of range 1. * @param __last1 End of range 1. * @param __first2 Start of range 2. * @param __init Starting value to add other values to. * @return The final inner product. */ template inline _Tp inner_product(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _Tp __init) { // concept requirements __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>) __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>) __glibcxx_requires_valid_range(__first1, __last1); for (; __first1 != __last1; ++__first1, ++__first2) __init = __init + (*__first1 * *__first2); return __init; } /** * @brief Compute inner product of two ranges. * * Starting with an initial value of @p __init, applies @p __binary_op2 to * successive elements from the two ranges and accumulates each result into * the accumulated value using @p __binary_op1. The values in the ranges are * processed in order. * * @param __first1 Start of range 1. * @param __last1 End of range 1. * @param __first2 Start of range 2. * @param __init Starting value to add other values to. * @param __binary_op1 Function object to accumulate with. * @param __binary_op2 Function object to apply to pairs of input values. * @return The final inner product. */ template inline _Tp inner_product(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _Tp __init, _BinaryOperation1 __binary_op1, _BinaryOperation2 __binary_op2) { // concept requirements __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>) __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>) __glibcxx_requires_valid_range(__first1, __last1); for (; __first1 != __last1; ++__first1, ++__first2) __init = __binary_op1(__init, __binary_op2(*__first1, *__first2)); return __init; } /** * @brief Return list of partial sums * * Accumulates the values in the range [first,last) using the @c + operator. * As each successive input value is added into the total, that partial sum * is written to @p __result. Therefore, the first value in @p __result is * the first value of the input, the second value in @p __result is the sum * of the first and second input values, and so on. * * @param __first Start of input range. * @param __last End of input range. * @param __result Output sum. * @return Iterator pointing just beyond the values written to __result. */ template _OutputIterator partial_sum(_InputIterator __first, _InputIterator __last, _OutputIterator __result) { typedef typename iterator_traits<_InputIterator>::value_type _ValueType; // concept requirements __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, _ValueType>) __glibcxx_requires_valid_range(__first, __last); if (__first == __last) return __result; _ValueType __value = *__first; *__result = __value; while (++__first != __last) { __value = __value + *__first; *++__result = __value; } return ++__result; } /** * @brief Return list of partial sums * * Accumulates the values in the range [first,last) using @p __binary_op. * As each successive input value is added into the total, that partial sum * is written to @p __result. Therefore, the first value in @p __result is * the first value of the input, the second value in @p __result is the sum * of the first and second input values, and so on. * * @param __first Start of input range. * @param __last End of input range. * @param __result Output sum. * @param __binary_op Function object. * @return Iterator pointing just beyond the values written to __result. */ template _OutputIterator partial_sum(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _BinaryOperation __binary_op) { typedef typename iterator_traits<_InputIterator>::value_type _ValueType; // concept requirements __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, _ValueType>) __glibcxx_requires_valid_range(__first, __last); if (__first == __last) return __result; _ValueType __value = *__first; *__result = __value; while (++__first != __last) { __value = __binary_op(__value, *__first); *++__result = __value; } return ++__result; } /** * @brief Return differences between adjacent values. * * Computes the difference between adjacent values in the range * [first,last) using operator-() and writes the result to @p __result. * * @param __first Start of input range. * @param __last End of input range. * @param __result Output sums. * @return Iterator pointing just beyond the values written to result. * * _GLIBCXX_RESOLVE_LIB_DEFECTS * DR 539. partial_sum and adjacent_difference should mention requirements */ template _OutputIterator adjacent_difference(_InputIterator __first, _InputIterator __last, _OutputIterator __result) { typedef typename iterator_traits<_InputIterator>::value_type _ValueType; // concept requirements __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, _ValueType>) __glibcxx_requires_valid_range(__first, __last); if (__first == __last) return __result; _ValueType __value = *__first; *__result = __value; while (++__first != __last) { _ValueType __tmp = *__first; *++__result = __tmp - __value; __value = _GLIBCXX_MOVE(__tmp); } return ++__result; } /** * @brief Return differences between adjacent values. * * Computes the difference between adjacent values in the range * [__first,__last) using the function object @p __binary_op and writes the * result to @p __result. * * @param __first Start of input range. * @param __last End of input range. * @param __result Output sum. * @param __binary_op Function object. * @return Iterator pointing just beyond the values written to result. * * _GLIBCXX_RESOLVE_LIB_DEFECTS * DR 539. partial_sum and adjacent_difference should mention requirements */ template _OutputIterator adjacent_difference(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _BinaryOperation __binary_op) { typedef typename iterator_traits<_InputIterator>::value_type _ValueType; // concept requirements __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, _ValueType>) __glibcxx_requires_valid_range(__first, __last); if (__first == __last) return __result; _ValueType __value = *__first; *__result = __value; while (++__first != __last) { _ValueType __tmp = *__first; *++__result = __binary_op(__tmp, __value); __value = _GLIBCXX_MOVE(__tmp); } return ++__result; } _GLIBCXX_END_NAMESPACE_ALGO } // namespace std #endif /* _STL_NUMERIC_H */ # 388 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_numeric.h" 3 # 63 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/numeric" 2 3 #ifdef _GLIBCXX_PARALLEL #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 65 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/numeric" 3 # 66 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/numeric" 3 #endif # 67 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/numeric" 3 /** * @defgroup numerics Numerics * * Components for performing numeric operations. Includes support for * for complex number types, random number generation, numeric * (n-at-a-time) arrays, generalized numeric algorithms, and special * math functions. */ #endif /* _GLIBCXX_NUMERIC */ # 78 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/numeric" 3 # 34 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/random.tcc" 2 3 namespace std _GLIBCXX_VISIBILITY(default) { /* * (Further) implementation-space details. */ namespace __detail { _GLIBCXX_BEGIN_NAMESPACE_VERSION // General case for x = (ax + c) mod m -- use Schrage's algorithm // to avoid integer overflow. // // Preconditions: a > 0, m > 0. // // Note: only works correctly for __m % __a < __m / __a. template _Tp _Mod<_Tp, __m, __a, __c, false, true>:: __calc(_Tp __x) { if (__a == 1) __x %= __m; else { static const _Tp __q = __m / __a; static const _Tp __r = __m % __a; _Tp __t1 = __a * (__x % __q); _Tp __t2 = __r * (__x / __q); if (__t1 >= __t2) __x = __t1 - __t2; else __x = __m - __t2 + __t1; } if (__c != 0) { const _Tp __d = __m - __x; if (__d > __c) __x += __c; else __x = __c - __d; } return __x; } template _OutputIterator __normalize(_InputIterator __first, _InputIterator __last, _OutputIterator __result, const _Tp& __factor) { for (; __first != __last; ++__first, ++__result) *__result = *__first / __factor; return __result; } _GLIBCXX_END_NAMESPACE_VERSION } // namespace __detail _GLIBCXX_BEGIN_NAMESPACE_VERSION template constexpr _UIntType linear_congruential_engine<_UIntType, __a, __c, __m>::multiplier; template constexpr _UIntType linear_congruential_engine<_UIntType, __a, __c, __m>::increment; template constexpr _UIntType linear_congruential_engine<_UIntType, __a, __c, __m>::modulus; template constexpr _UIntType linear_congruential_engine<_UIntType, __a, __c, __m>::default_seed; /** * Seeds the LCR with integral value @p __s, adjusted so that the * ring identity is never a member of the convergence set. */ template void linear_congruential_engine<_UIntType, __a, __c, __m>:: seed(result_type __s) { if ((__detail::__mod<_UIntType, __m>(__c) == 0) && (__detail::__mod<_UIntType, __m>(__s) == 0)) _M_x = 1; else _M_x = __detail::__mod<_UIntType, __m>(__s); } /** * Seeds the LCR engine with a value generated by @p __q. */ template template typename std::enable_if::value>::type linear_congruential_engine<_UIntType, __a, __c, __m>:: seed(_Sseq& __q) { const _UIntType __k0 = __m == 0 ? std::numeric_limits<_UIntType>::digits : std::__lg(__m); const _UIntType __k = (__k0 + 31) / 32; uint_least32_t __arr[__k + 3]; __q.generate(__arr + 0, __arr + __k + 3); _UIntType __factor = 1u; _UIntType __sum = 0u; for (size_t __j = 0; __j < __k; ++__j) { __sum += __arr[__j + 3] * __factor; __factor *= __detail::_Shift<_UIntType, 32>::__value; } seed(__sum); } template std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>& __os, const linear_congruential_engine<_UIntType, __a, __c, __m>& __lcr) { typedef std::basic_ostream<_CharT, _Traits> __ostream_type; typedef typename __ostream_type::ios_base __ios_base; const typename __ios_base::fmtflags __flags = __os.flags(); const _CharT __fill = __os.fill(); __os.flags(__ios_base::dec | __ios_base::fixed | __ios_base::left); __os.fill(__os.widen(' ')); __os << __lcr._M_x; __os.flags(__flags); __os.fill(__fill); return __os; } template std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>& __is, linear_congruential_engine<_UIntType, __a, __c, __m>& __lcr) { typedef std::basic_istream<_CharT, _Traits> __istream_type; typedef typename __istream_type::ios_base __ios_base; const typename __ios_base::fmtflags __flags = __is.flags(); __is.flags(__ios_base::dec); __is >> __lcr._M_x; __is.flags(__flags); return __is; } template constexpr size_t mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::word_size; template constexpr size_t mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::state_size; template constexpr size_t mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::shift_size; template constexpr size_t mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::mask_bits; template constexpr _UIntType mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::xor_mask; template constexpr size_t mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::tempering_u; template constexpr _UIntType mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::tempering_d; template constexpr size_t mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::tempering_s; template constexpr _UIntType mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::tempering_b; template constexpr size_t mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::tempering_t; template constexpr _UIntType mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::tempering_c; template constexpr size_t mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::tempering_l; template constexpr _UIntType mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>:: initialization_multiplier; template constexpr _UIntType mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::default_seed; template void mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>:: seed(result_type __sd) { _M_x[0] = __detail::__mod<_UIntType, __detail::_Shift<_UIntType, __w>::__value>(__sd); for (size_t __i = 1; __i < state_size; ++__i) { _UIntType __x = _M_x[__i - 1]; __x ^= __x >> (__w - 2); __x *= __f; __x += __detail::__mod<_UIntType, __n>(__i); _M_x[__i] = __detail::__mod<_UIntType, __detail::_Shift<_UIntType, __w>::__value>(__x); } _M_p = state_size; } template template typename std::enable_if::value>::type mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>:: seed(_Sseq& __q) { const _UIntType __upper_mask = (~_UIntType()) << __r; const size_t __k = (__w + 31) / 32; uint_least32_t __arr[__n * __k]; __q.generate(__arr + 0, __arr + __n * __k); bool __zero = true; for (size_t __i = 0; __i < state_size; ++__i) { _UIntType __factor = 1u; _UIntType __sum = 0u; for (size_t __j = 0; __j < __k; ++__j) { __sum += __arr[__k * __i + __j] * __factor; __factor *= __detail::_Shift<_UIntType, 32>::__value; } _M_x[__i] = __detail::__mod<_UIntType, __detail::_Shift<_UIntType, __w>::__value>(__sum); if (__zero) { if (__i == 0) { if ((_M_x[0] & __upper_mask) != 0u) __zero = false; } else if (_M_x[__i] != 0u) __zero = false; } } if (__zero) _M_x[0] = __detail::_Shift<_UIntType, __w - 1>::__value; _M_p = state_size; } template void mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>:: _M_gen_rand(void) { const _UIntType __upper_mask = (~_UIntType()) << __r; const _UIntType __lower_mask = ~__upper_mask; for (size_t __k = 0; __k < (__n - __m); ++__k) { _UIntType __y = ((_M_x[__k] & __upper_mask) | (_M_x[__k + 1] & __lower_mask)); _M_x[__k] = (_M_x[__k + __m] ^ (__y >> 1) ^ ((__y & 0x01) ? __a : 0)); } for (size_t __k = (__n - __m); __k < (__n - 1); ++__k) { _UIntType __y = ((_M_x[__k] & __upper_mask) | (_M_x[__k + 1] & __lower_mask)); _M_x[__k] = (_M_x[__k + (__m - __n)] ^ (__y >> 1) ^ ((__y & 0x01) ? __a : 0)); } _UIntType __y = ((_M_x[__n - 1] & __upper_mask) | (_M_x[0] & __lower_mask)); _M_x[__n - 1] = (_M_x[__m - 1] ^ (__y >> 1) ^ ((__y & 0x01) ? __a : 0)); _M_p = 0; } template void mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>:: discard(unsigned long long __z) { while (__z > state_size - _M_p) { __z -= state_size - _M_p; _M_gen_rand(); } _M_p += __z; } template typename mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::result_type mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>:: operator()() { // Reload the vector - cost is O(n) amortized over n calls. if (_M_p >= state_size) _M_gen_rand(); // Calculate o(x(i)). result_type __z = _M_x[_M_p++]; __z ^= (__z >> __u) & __d; __z ^= (__z << __s) & __b; __z ^= (__z << __t) & __c; __z ^= (__z >> __l); return __z; } template std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>& __os, const mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>& __x) { typedef std::basic_ostream<_CharT, _Traits> __ostream_type; typedef typename __ostream_type::ios_base __ios_base; const typename __ios_base::fmtflags __flags = __os.flags(); const _CharT __fill = __os.fill(); const _CharT __space = __os.widen(' '); __os.flags(__ios_base::dec | __ios_base::fixed | __ios_base::left); __os.fill(__space); for (size_t __i = 0; __i < __n; ++__i) __os << __x._M_x[__i] << __space; __os << __x._M_p; __os.flags(__flags); __os.fill(__fill); return __os; } template std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>& __is, mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>& __x) { typedef std::basic_istream<_CharT, _Traits> __istream_type; typedef typename __istream_type::ios_base __ios_base; const typename __ios_base::fmtflags __flags = __is.flags(); __is.flags(__ios_base::dec | __ios_base::skipws); for (size_t __i = 0; __i < __n; ++__i) __is >> __x._M_x[__i]; __is >> __x._M_p; __is.flags(__flags); return __is; } template constexpr size_t subtract_with_carry_engine<_UIntType, __w, __s, __r>::word_size; template constexpr size_t subtract_with_carry_engine<_UIntType, __w, __s, __r>::short_lag; template constexpr size_t subtract_with_carry_engine<_UIntType, __w, __s, __r>::long_lag; template constexpr _UIntType subtract_with_carry_engine<_UIntType, __w, __s, __r>::default_seed; template void subtract_with_carry_engine<_UIntType, __w, __s, __r>:: seed(result_type __value) { std::linear_congruential_engine __lcg(__value == 0u ? default_seed : __value); const size_t __n = (__w + 31) / 32; for (size_t __i = 0; __i < long_lag; ++__i) { _UIntType __sum = 0u; _UIntType __factor = 1u; for (size_t __j = 0; __j < __n; ++__j) { __sum += __detail::__mod::__value> (__lcg()) * __factor; __factor *= __detail::_Shift<_UIntType, 32>::__value; } _M_x[__i] = __detail::__mod<_UIntType, __detail::_Shift<_UIntType, __w>::__value>(__sum); } _M_carry = (_M_x[long_lag - 1] == 0) ? 1 : 0; _M_p = 0; } template template typename std::enable_if::value>::type subtract_with_carry_engine<_UIntType, __w, __s, __r>:: seed(_Sseq& __q) { const size_t __k = (__w + 31) / 32; uint_least32_t __arr[__r * __k]; __q.generate(__arr + 0, __arr + __r * __k); for (size_t __i = 0; __i < long_lag; ++__i) { _UIntType __sum = 0u; _UIntType __factor = 1u; for (size_t __j = 0; __j < __k; ++__j) { __sum += __arr[__k * __i + __j] * __factor; __factor *= __detail::_Shift<_UIntType, 32>::__value; } _M_x[__i] = __detail::__mod<_UIntType, __detail::_Shift<_UIntType, __w>::__value>(__sum); } _M_carry = (_M_x[long_lag - 1] == 0) ? 1 : 0; _M_p = 0; } template typename subtract_with_carry_engine<_UIntType, __w, __s, __r>:: result_type subtract_with_carry_engine<_UIntType, __w, __s, __r>:: operator()() { // Derive short lag index from current index. long __ps = _M_p - short_lag; if (__ps < 0) __ps += long_lag; // Calculate new x(i) without overflow or division. // NB: Thanks to the requirements for _UIntType, _M_x[_M_p] + _M_carry // cannot overflow. _UIntType __xi; if (_M_x[__ps] >= _M_x[_M_p] + _M_carry) { __xi = _M_x[__ps] - _M_x[_M_p] - _M_carry; _M_carry = 0; } else { __xi = (__detail::_Shift<_UIntType, __w>::__value - _M_x[_M_p] - _M_carry + _M_x[__ps]); _M_carry = 1; } _M_x[_M_p] = __xi; // Adjust current index to loop around in ring buffer. if (++_M_p >= long_lag) _M_p = 0; return __xi; } template std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>& __os, const subtract_with_carry_engine<_UIntType, __w, __s, __r>& __x) { typedef std::basic_ostream<_CharT, _Traits> __ostream_type; typedef typename __ostream_type::ios_base __ios_base; const typename __ios_base::fmtflags __flags = __os.flags(); const _CharT __fill = __os.fill(); const _CharT __space = __os.widen(' '); __os.flags(__ios_base::dec | __ios_base::fixed | __ios_base::left); __os.fill(__space); for (size_t __i = 0; __i < __r; ++__i) __os << __x._M_x[__i] << __space; __os << __x._M_carry << __space << __x._M_p; __os.flags(__flags); __os.fill(__fill); return __os; } template std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>& __is, subtract_with_carry_engine<_UIntType, __w, __s, __r>& __x) { typedef std::basic_ostream<_CharT, _Traits> __istream_type; typedef typename __istream_type::ios_base __ios_base; const typename __ios_base::fmtflags __flags = __is.flags(); __is.flags(__ios_base::dec | __ios_base::skipws); for (size_t __i = 0; __i < __r; ++__i) __is >> __x._M_x[__i]; __is >> __x._M_carry; __is >> __x._M_p; __is.flags(__flags); return __is; } template constexpr size_t discard_block_engine<_RandomNumberEngine, __p, __r>::block_size; template constexpr size_t discard_block_engine<_RandomNumberEngine, __p, __r>::used_block; template typename discard_block_engine<_RandomNumberEngine, __p, __r>::result_type discard_block_engine<_RandomNumberEngine, __p, __r>:: operator()() { if (_M_n >= used_block) { _M_b.discard(block_size - _M_n); _M_n = 0; } ++_M_n; return _M_b(); } template std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>& __os, const discard_block_engine<_RandomNumberEngine, __p, __r>& __x) { typedef std::basic_ostream<_CharT, _Traits> __ostream_type; typedef typename __ostream_type::ios_base __ios_base; const typename __ios_base::fmtflags __flags = __os.flags(); const _CharT __fill = __os.fill(); const _CharT __space = __os.widen(' '); __os.flags(__ios_base::dec | __ios_base::fixed | __ios_base::left); __os.fill(__space); __os << __x.base() << __space << __x._M_n; __os.flags(__flags); __os.fill(__fill); return __os; } template std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>& __is, discard_block_engine<_RandomNumberEngine, __p, __r>& __x) { typedef std::basic_istream<_CharT, _Traits> __istream_type; typedef typename __istream_type::ios_base __ios_base; const typename __ios_base::fmtflags __flags = __is.flags(); __is.flags(__ios_base::dec | __ios_base::skipws); __is >> __x._M_b >> __x._M_n; __is.flags(__flags); return __is; } template typename independent_bits_engine<_RandomNumberEngine, __w, _UIntType>:: result_type independent_bits_engine<_RandomNumberEngine, __w, _UIntType>:: operator()() { typedef typename _RandomNumberEngine::result_type _Eresult_type; const _Eresult_type __r = (_M_b.max() - _M_b.min() < std::numeric_limits<_Eresult_type>::max() ? _M_b.max() - _M_b.min() + 1 : 0); const unsigned __edig = std::numeric_limits<_Eresult_type>::digits; const unsigned __m = __r ? std::__lg(__r) : __edig; typedef typename std::common_type<_Eresult_type, result_type>::type __ctype; const unsigned __cdig = std::numeric_limits<__ctype>::digits; unsigned __n, __n0; __ctype __s0, __s1, __y0, __y1; for (size_t __i = 0; __i < 2; ++__i) { __n = (__w + __m - 1) / __m + __i; __n0 = __n - __w % __n; const unsigned __w0 = __w / __n; // __w0 <= __m __s0 = 0; __s1 = 0; if (__w0 < __cdig) { __s0 = __ctype(1) << __w0; __s1 = __s0 << 1; } __y0 = 0; __y1 = 0; if (__r) { __y0 = __s0 * (__r / __s0); if (__s1) __y1 = __s1 * (__r / __s1); if (__r - __y0 <= __y0 / __n) break; } else break; } result_type __sum = 0; for (size_t __k = 0; __k < __n0; ++__k) { __ctype __u; do __u = _M_b() - _M_b.min(); while (__y0 && __u >= __y0); __sum = __s0 * __sum + (__s0 ? __u % __s0 : __u); } for (size_t __k = __n0; __k < __n; ++__k) { __ctype __u; do __u = _M_b() - _M_b.min(); while (__y1 && __u >= __y1); __sum = __s1 * __sum + (__s1 ? __u % __s1 : __u); } return __sum; } template constexpr size_t shuffle_order_engine<_RandomNumberEngine, __k>::table_size; template typename shuffle_order_engine<_RandomNumberEngine, __k>::result_type shuffle_order_engine<_RandomNumberEngine, __k>:: operator()() { size_t __j = __k * ((_M_y - _M_b.min()) / (_M_b.max() - _M_b.min() + 1.0L)); _M_y = _M_v[__j]; _M_v[__j] = _M_b(); return _M_y; } template std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>& __os, const shuffle_order_engine<_RandomNumberEngine, __k>& __x) { typedef std::basic_ostream<_CharT, _Traits> __ostream_type; typedef typename __ostream_type::ios_base __ios_base; const typename __ios_base::fmtflags __flags = __os.flags(); const _CharT __fill = __os.fill(); const _CharT __space = __os.widen(' '); __os.flags(__ios_base::dec | __ios_base::fixed | __ios_base::left); __os.fill(__space); __os << __x.base(); for (size_t __i = 0; __i < __k; ++__i) __os << __space << __x._M_v[__i]; __os << __space << __x._M_y; __os.flags(__flags); __os.fill(__fill); return __os; } template std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>& __is, shuffle_order_engine<_RandomNumberEngine, __k>& __x) { typedef std::basic_istream<_CharT, _Traits> __istream_type; typedef typename __istream_type::ios_base __ios_base; const typename __ios_base::fmtflags __flags = __is.flags(); __is.flags(__ios_base::dec | __ios_base::skipws); __is >> __x._M_b; for (size_t __i = 0; __i < __k; ++__i) __is >> __x._M_v[__i]; __is >> __x._M_y; __is.flags(__flags); return __is; } template std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>& __os, const uniform_int_distribution<_IntType>& __x) { typedef std::basic_ostream<_CharT, _Traits> __ostream_type; typedef typename __ostream_type::ios_base __ios_base; const typename __ios_base::fmtflags __flags = __os.flags(); const _CharT __fill = __os.fill(); const _CharT __space = __os.widen(' '); __os.flags(__ios_base::scientific | __ios_base::left); __os.fill(__space); __os << __x.a() << __space << __x.b(); __os.flags(__flags); __os.fill(__fill); return __os; } template std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>& __is, uniform_int_distribution<_IntType>& __x) { typedef std::basic_istream<_CharT, _Traits> __istream_type; typedef typename __istream_type::ios_base __ios_base; const typename __ios_base::fmtflags __flags = __is.flags(); __is.flags(__ios_base::dec | __ios_base::skipws); _IntType __a, __b; __is >> __a >> __b; __x.param(typename uniform_int_distribution<_IntType>:: param_type(__a, __b)); __is.flags(__flags); return __is; } template template void uniform_real_distribution<_RealType>:: __generate_impl(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const param_type& __p) { __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) __detail::_Adaptor<_UniformRandomNumberGenerator, result_type> __aurng(__urng); auto __range = __p.b() - __p.a(); while (__f != __t) *__f++ = __aurng() * __range + __p.a(); } template std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>& __os, const uniform_real_distribution<_RealType>& __x) { typedef std::basic_ostream<_CharT, _Traits> __ostream_type; typedef typename __ostream_type::ios_base __ios_base; const typename __ios_base::fmtflags __flags = __os.flags(); const _CharT __fill = __os.fill(); const std::streamsize __precision = __os.precision(); const _CharT __space = __os.widen(' '); __os.flags(__ios_base::scientific | __ios_base::left); __os.fill(__space); __os.precision(std::numeric_limits<_RealType>::max_digits10); __os << __x.a() << __space << __x.b(); __os.flags(__flags); __os.fill(__fill); __os.precision(__precision); return __os; } template std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>& __is, uniform_real_distribution<_RealType>& __x) { typedef std::basic_istream<_CharT, _Traits> __istream_type; typedef typename __istream_type::ios_base __ios_base; const typename __ios_base::fmtflags __flags = __is.flags(); __is.flags(__ios_base::skipws); _RealType __a, __b; __is >> __a >> __b; __x.param(typename uniform_real_distribution<_RealType>:: param_type(__a, __b)); __is.flags(__flags); return __is; } template void std::bernoulli_distribution:: __generate_impl(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const param_type& __p) { __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) __detail::_Adaptor<_UniformRandomNumberGenerator, double> __aurng(__urng); auto __limit = __p.p() * (__aurng.max() - __aurng.min()); while (__f != __t) *__f++ = (__aurng() - __aurng.min()) < __limit; } template std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>& __os, const bernoulli_distribution& __x) { typedef std::basic_ostream<_CharT, _Traits> __ostream_type; typedef typename __ostream_type::ios_base __ios_base; const typename __ios_base::fmtflags __flags = __os.flags(); const _CharT __fill = __os.fill(); const std::streamsize __precision = __os.precision(); __os.flags(__ios_base::scientific | __ios_base::left); __os.fill(__os.widen(' ')); __os.precision(std::numeric_limits::max_digits10); __os << __x.p(); __os.flags(__flags); __os.fill(__fill); __os.precision(__precision); return __os; } template template typename geometric_distribution<_IntType>::result_type geometric_distribution<_IntType>:: operator()(_UniformRandomNumberGenerator& __urng, const param_type& __param) { // About the epsilon thing see this thread: // http://gcc.gnu.org/ml/gcc-patches/2006-10/msg00971.html const double __naf = (1 - std::numeric_limits::epsilon()) / 2; // The largest _RealType convertible to _IntType. const double __thr = std::numeric_limits<_IntType>::max() + __naf; __detail::_Adaptor<_UniformRandomNumberGenerator, double> __aurng(__urng); double __cand; do __cand = std::floor(std::log(1.0 - __aurng()) / __param._M_log_1_p); while (__cand >= __thr); return result_type(__cand + __naf); } template template void geometric_distribution<_IntType>:: __generate_impl(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const param_type& __param) { __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) // About the epsilon thing see this thread: // http://gcc.gnu.org/ml/gcc-patches/2006-10/msg00971.html const double __naf = (1 - std::numeric_limits::epsilon()) / 2; // The largest _RealType convertible to _IntType. const double __thr = std::numeric_limits<_IntType>::max() + __naf; __detail::_Adaptor<_UniformRandomNumberGenerator, double> __aurng(__urng); while (__f != __t) { double __cand; do __cand = std::floor(std::log(1.0 - __aurng()) / __param._M_log_1_p); while (__cand >= __thr); *__f++ = __cand + __naf; } } template std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>& __os, const geometric_distribution<_IntType>& __x) { typedef std::basic_ostream<_CharT, _Traits> __ostream_type; typedef typename __ostream_type::ios_base __ios_base; const typename __ios_base::fmtflags __flags = __os.flags(); const _CharT __fill = __os.fill(); const std::streamsize __precision = __os.precision(); __os.flags(__ios_base::scientific | __ios_base::left); __os.fill(__os.widen(' ')); __os.precision(std::numeric_limits::max_digits10); __os << __x.p(); __os.flags(__flags); __os.fill(__fill); __os.precision(__precision); return __os; } template std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>& __is, geometric_distribution<_IntType>& __x) { typedef std::basic_istream<_CharT, _Traits> __istream_type; typedef typename __istream_type::ios_base __ios_base; const typename __ios_base::fmtflags __flags = __is.flags(); __is.flags(__ios_base::skipws); double __p; __is >> __p; __x.param(typename geometric_distribution<_IntType>::param_type(__p)); __is.flags(__flags); return __is; } // This is Leger's algorithm, also in Devroye, Ch. X, Example 1.5. template template typename negative_binomial_distribution<_IntType>::result_type negative_binomial_distribution<_IntType>:: operator()(_UniformRandomNumberGenerator& __urng) { const double __y = _M_gd(__urng); // XXX Is the constructor too slow? std::poisson_distribution __poisson(__y); return __poisson(__urng); } template template typename negative_binomial_distribution<_IntType>::result_type negative_binomial_distribution<_IntType>:: operator()(_UniformRandomNumberGenerator& __urng, const param_type& __p) { typedef typename std::gamma_distribution::param_type param_type; const double __y = _M_gd(__urng, param_type(__p.k(), (1.0 - __p.p()) / __p.p())); std::poisson_distribution __poisson(__y); return __poisson(__urng); } template template void negative_binomial_distribution<_IntType>:: __generate_impl(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng) { __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) while (__f != __t) { const double __y = _M_gd(__urng); // XXX Is the constructor too slow? std::poisson_distribution __poisson(__y); *__f++ = __poisson(__urng); } } template template void negative_binomial_distribution<_IntType>:: __generate_impl(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const param_type& __p) { __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) typename std::gamma_distribution::param_type __p2(__p.k(), (1.0 - __p.p()) / __p.p()); while (__f != __t) { const double __y = _M_gd(__urng, __p2); std::poisson_distribution __poisson(__y); *__f++ = __poisson(__urng); } } template std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>& __os, const negative_binomial_distribution<_IntType>& __x) { typedef std::basic_ostream<_CharT, _Traits> __ostream_type; typedef typename __ostream_type::ios_base __ios_base; const typename __ios_base::fmtflags __flags = __os.flags(); const _CharT __fill = __os.fill(); const std::streamsize __precision = __os.precision(); const _CharT __space = __os.widen(' '); __os.flags(__ios_base::scientific | __ios_base::left); __os.fill(__os.widen(' ')); __os.precision(std::numeric_limits::max_digits10); __os << __x.k() << __space << __x.p() << __space << __x._M_gd; __os.flags(__flags); __os.fill(__fill); __os.precision(__precision); return __os; } template std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>& __is, negative_binomial_distribution<_IntType>& __x) { typedef std::basic_istream<_CharT, _Traits> __istream_type; typedef typename __istream_type::ios_base __ios_base; const typename __ios_base::fmtflags __flags = __is.flags(); __is.flags(__ios_base::skipws); _IntType __k; double __p; __is >> __k >> __p >> __x._M_gd; __x.param(typename negative_binomial_distribution<_IntType>:: param_type(__k, __p)); __is.flags(__flags); return __is; } template void poisson_distribution<_IntType>::param_type:: _M_initialize() { #if _GLIBCXX_USE_C99_MATH_TR1 if (_M_mean >= 12) { const double __m = std::floor(_M_mean); _M_lm_thr = std::log(_M_mean); _M_lfm = std::lgamma(__m + 1); _M_sm = std::sqrt(__m); const double __pi_4 = 0.7853981633974483096156608458198757L; const double __dx = std::sqrt(2 * __m * std::log(32 * __m / __pi_4)); _M_d = std::round(std::max(6.0, std::min(__m, __dx))); const double __cx = 2 * __m + _M_d; _M_scx = std::sqrt(__cx / 2); _M_1cx = 1 / __cx; _M_c2b = std::sqrt(__pi_4 * __cx) * std::exp(_M_1cx); _M_cb = 2 * __cx * std::exp(-_M_d * _M_1cx * (1 + _M_d / 2)) / _M_d; } else #endif # 1267 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/random.tcc" 3 _M_lm_thr = std::exp(-_M_mean); } /** * A rejection algorithm when mean >= 12 and a simple method based * upon the multiplication of uniform random variates otherwise. * NB: The former is available only if _GLIBCXX_USE_C99_MATH_TR1 * is defined. * * Reference: * Devroye, L. Non-Uniform Random Variates Generation. Springer-Verlag, * New York, 1986, Ch. X, Sects. 3.3 & 3.4 (+ Errata!). */ template template typename poisson_distribution<_IntType>::result_type poisson_distribution<_IntType>:: operator()(_UniformRandomNumberGenerator& __urng, const param_type& __param) { __detail::_Adaptor<_UniformRandomNumberGenerator, double> __aurng(__urng); #if _GLIBCXX_USE_C99_MATH_TR1 if (__param.mean() >= 12) { double __x; // See comments above... const double __naf = (1 - std::numeric_limits::epsilon()) / 2; const double __thr = std::numeric_limits<_IntType>::max() + __naf; const double __m = std::floor(__param.mean()); // sqrt(pi / 2) const double __spi_2 = 1.2533141373155002512078826424055226L; const double __c1 = __param._M_sm * __spi_2; const double __c2 = __param._M_c2b + __c1; const double __c3 = __c2 + 1; const double __c4 = __c3 + 1; // e^(1 / 78) const double __e178 = 1.0129030479320018583185514777512983L; const double __c5 = __c4 + __e178; const double __c = __param._M_cb + __c5; const double __2cx = 2 * (2 * __m + __param._M_d); bool __reject = true; do { const double __u = __c * __aurng(); const double __e = -std::log(1.0 - __aurng()); double __w = 0.0; if (__u <= __c1) { const double __n = _M_nd(__urng); const double __y = -std::abs(__n) * __param._M_sm - 1; __x = std::floor(__y); __w = -__n * __n / 2; if (__x < -__m) continue; } else if (__u <= __c2) { const double __n = _M_nd(__urng); const double __y = 1 + std::abs(__n) * __param._M_scx; __x = std::ceil(__y); __w = __y * (2 - __y) * __param._M_1cx; if (__x > __param._M_d) continue; } else if (__u <= __c3) // NB: This case not in the book, nor in the Errata, // but should be ok... __x = -1; else if (__u <= __c4) __x = 0; else if (__u <= __c5) __x = 1; else { const double __v = -std::log(1.0 - __aurng()); const double __y = __param._M_d + __v * __2cx / __param._M_d; __x = std::ceil(__y); __w = -__param._M_d * __param._M_1cx * (1 + __y / 2); } __reject = (__w - __e - __x * __param._M_lm_thr > __param._M_lfm - std::lgamma(__x + __m + 1)); __reject |= __x + __m >= __thr; } while (__reject); return result_type(__x + __m + __naf); } else #endif # 1367 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/random.tcc" 3 { _IntType __x = 0; double __prod = 1.0; do { __prod *= __aurng(); __x += 1; } while (__prod > __param._M_lm_thr); return __x - 1; } } template template void poisson_distribution<_IntType>:: __generate_impl(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const param_type& __param) { __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) // We could duplicate everything from operator()... while (__f != __t) *__f++ = this->operator()(__urng, __param); } template std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>& __os, const poisson_distribution<_IntType>& __x) { typedef std::basic_ostream<_CharT, _Traits> __ostream_type; typedef typename __ostream_type::ios_base __ios_base; const typename __ios_base::fmtflags __flags = __os.flags(); const _CharT __fill = __os.fill(); const std::streamsize __precision = __os.precision(); const _CharT __space = __os.widen(' '); __os.flags(__ios_base::scientific | __ios_base::left); __os.fill(__space); __os.precision(std::numeric_limits::max_digits10); __os << __x.mean() << __space << __x._M_nd; __os.flags(__flags); __os.fill(__fill); __os.precision(__precision); return __os; } template std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>& __is, poisson_distribution<_IntType>& __x) { typedef std::basic_istream<_CharT, _Traits> __istream_type; typedef typename __istream_type::ios_base __ios_base; const typename __ios_base::fmtflags __flags = __is.flags(); __is.flags(__ios_base::skipws); double __mean; __is >> __mean >> __x._M_nd; __x.param(typename poisson_distribution<_IntType>::param_type(__mean)); __is.flags(__flags); return __is; } template void binomial_distribution<_IntType>::param_type:: _M_initialize() { const double __p12 = _M_p <= 0.5 ? _M_p : 1.0 - _M_p; _M_easy = true; #if _GLIBCXX_USE_C99_MATH_TR1 if (_M_t * __p12 >= 8) { _M_easy = false; const double __np = std::floor(_M_t * __p12); const double __pa = __np / _M_t; const double __1p = 1 - __pa; const double __pi_4 = 0.7853981633974483096156608458198757L; const double __d1x = std::sqrt(__np * __1p * std::log(32 * __np / (81 * __pi_4 * __1p))); _M_d1 = std::round(std::max(1.0, __d1x)); const double __d2x = std::sqrt(__np * __1p * std::log(32 * _M_t * __1p / (__pi_4 * __pa))); _M_d2 = std::round(std::max(1.0, __d2x)); // sqrt(pi / 2) const double __spi_2 = 1.2533141373155002512078826424055226L; _M_s1 = std::sqrt(__np * __1p) * (1 + _M_d1 / (4 * __np)); _M_s2 = std::sqrt(__np * __1p) * (1 + _M_d2 / (4 * _M_t * __1p)); _M_c = 2 * _M_d1 / __np; _M_a1 = std::exp(_M_c) * _M_s1 * __spi_2; const double __a12 = _M_a1 + _M_s2 * __spi_2; const double __s1s = _M_s1 * _M_s1; _M_a123 = __a12 + (std::exp(_M_d1 / (_M_t * __1p)) * 2 * __s1s / _M_d1 * std::exp(-_M_d1 * _M_d1 / (2 * __s1s))); const double __s2s = _M_s2 * _M_s2; _M_s = (_M_a123 + 2 * __s2s / _M_d2 * std::exp(-_M_d2 * _M_d2 / (2 * __s2s))); _M_lf = (std::lgamma(__np + 1) + std::lgamma(_M_t - __np + 1)); _M_lp1p = std::log(__pa / __1p); _M_q = -std::log(1 - (__p12 - __pa) / __1p); } else #endif # 1492 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/random.tcc" 3 _M_q = -std::log(1 - __p12); } template template typename binomial_distribution<_IntType>::result_type binomial_distribution<_IntType>:: _M_waiting(_UniformRandomNumberGenerator& __urng, _IntType __t, double __q) { _IntType __x = 0; double __sum = 0.0; __detail::_Adaptor<_UniformRandomNumberGenerator, double> __aurng(__urng); do { if (__t == __x) return __x; const double __e = -std::log(1.0 - __aurng()); __sum += __e / (__t - __x); __x += 1; } while (__sum <= __q); return __x - 1; } /** * A rejection algorithm when t * p >= 8 and a simple waiting time * method - the second in the referenced book - otherwise. * NB: The former is available only if _GLIBCXX_USE_C99_MATH_TR1 * is defined. * * Reference: * Devroye, L. Non-Uniform Random Variates Generation. Springer-Verlag, * New York, 1986, Ch. X, Sect. 4 (+ Errata!). */ template template typename binomial_distribution<_IntType>::result_type binomial_distribution<_IntType>:: operator()(_UniformRandomNumberGenerator& __urng, const param_type& __param) { result_type __ret; const _IntType __t = __param.t(); const double __p = __param.p(); const double __p12 = __p <= 0.5 ? __p : 1.0 - __p; __detail::_Adaptor<_UniformRandomNumberGenerator, double> __aurng(__urng); #if _GLIBCXX_USE_C99_MATH_TR1 if (!__param._M_easy) { double __x; // See comments above... const double __naf = (1 - std::numeric_limits::epsilon()) / 2; const double __thr = std::numeric_limits<_IntType>::max() + __naf; const double __np = std::floor(__t * __p12); // sqrt(pi / 2) const double __spi_2 = 1.2533141373155002512078826424055226L; const double __a1 = __param._M_a1; const double __a12 = __a1 + __param._M_s2 * __spi_2; const double __a123 = __param._M_a123; const double __s1s = __param._M_s1 * __param._M_s1; const double __s2s = __param._M_s2 * __param._M_s2; bool __reject; do { const double __u = __param._M_s * __aurng(); double __v; if (__u <= __a1) { const double __n = _M_nd(__urng); const double __y = __param._M_s1 * std::abs(__n); __reject = __y >= __param._M_d1; if (!__reject) { const double __e = -std::log(1.0 - __aurng()); __x = std::floor(__y); __v = -__e - __n * __n / 2 + __param._M_c; } } else if (__u <= __a12) { const double __n = _M_nd(__urng); const double __y = __param._M_s2 * std::abs(__n); __reject = __y >= __param._M_d2; if (!__reject) { const double __e = -std::log(1.0 - __aurng()); __x = std::floor(-__y); __v = -__e - __n * __n / 2; } } else if (__u <= __a123) { const double __e1 = -std::log(1.0 - __aurng()); const double __e2 = -std::log(1.0 - __aurng()); const double __y = __param._M_d1 + 2 * __s1s * __e1 / __param._M_d1; __x = std::floor(__y); __v = (-__e2 + __param._M_d1 * (1 / (__t - __np) -__y / (2 * __s1s))); __reject = false; } else { const double __e1 = -std::log(1.0 - __aurng()); const double __e2 = -std::log(1.0 - __aurng()); const double __y = __param._M_d2 + 2 * __s2s * __e1 / __param._M_d2; __x = std::floor(-__y); __v = -__e2 - __param._M_d2 * __y / (2 * __s2s); __reject = false; } __reject = __reject || __x < -__np || __x > __t - __np; if (!__reject) { const double __lfx = std::lgamma(__np + __x + 1) + std::lgamma(__t - (__np + __x) + 1); __reject = __v > __param._M_lf - __lfx + __x * __param._M_lp1p; } __reject |= __x + __np >= __thr; } while (__reject); __x += __np + __naf; const _IntType __z = _M_waiting(__urng, __t - _IntType(__x), __param._M_q); __ret = _IntType(__x) + __z; } else #endif # 1642 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/random.tcc" 3 __ret = _M_waiting(__urng, __t, __param._M_q); if (__p12 != __p) __ret = __t - __ret; return __ret; } template template void binomial_distribution<_IntType>:: __generate_impl(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const param_type& __param) { __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) // We could duplicate everything from operator()... while (__f != __t) *__f++ = this->operator()(__urng, __param); } template std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>& __os, const binomial_distribution<_IntType>& __x) { typedef std::basic_ostream<_CharT, _Traits> __ostream_type; typedef typename __ostream_type::ios_base __ios_base; const typename __ios_base::fmtflags __flags = __os.flags(); const _CharT __fill = __os.fill(); const std::streamsize __precision = __os.precision(); const _CharT __space = __os.widen(' '); __os.flags(__ios_base::scientific | __ios_base::left); __os.fill(__space); __os.precision(std::numeric_limits::max_digits10); __os << __x.t() << __space << __x.p() << __space << __x._M_nd; __os.flags(__flags); __os.fill(__fill); __os.precision(__precision); return __os; } template std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>& __is, binomial_distribution<_IntType>& __x) { typedef std::basic_istream<_CharT, _Traits> __istream_type; typedef typename __istream_type::ios_base __ios_base; const typename __ios_base::fmtflags __flags = __is.flags(); __is.flags(__ios_base::dec | __ios_base::skipws); _IntType __t; double __p; __is >> __t >> __p >> __x._M_nd; __x.param(typename binomial_distribution<_IntType>:: param_type(__t, __p)); __is.flags(__flags); return __is; } template template void std::exponential_distribution<_RealType>:: __generate_impl(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const param_type& __p) { __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) __detail::_Adaptor<_UniformRandomNumberGenerator, result_type> __aurng(__urng); while (__f != __t) *__f++ = -std::log(result_type(1) - __aurng()) / __p.lambda(); } template std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>& __os, const exponential_distribution<_RealType>& __x) { typedef std::basic_ostream<_CharT, _Traits> __ostream_type; typedef typename __ostream_type::ios_base __ios_base; const typename __ios_base::fmtflags __flags = __os.flags(); const _CharT __fill = __os.fill(); const std::streamsize __precision = __os.precision(); __os.flags(__ios_base::scientific | __ios_base::left); __os.fill(__os.widen(' ')); __os.precision(std::numeric_limits<_RealType>::max_digits10); __os << __x.lambda(); __os.flags(__flags); __os.fill(__fill); __os.precision(__precision); return __os; } template std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>& __is, exponential_distribution<_RealType>& __x) { typedef std::basic_istream<_CharT, _Traits> __istream_type; typedef typename __istream_type::ios_base __ios_base; const typename __ios_base::fmtflags __flags = __is.flags(); __is.flags(__ios_base::dec | __ios_base::skipws); _RealType __lambda; __is >> __lambda; __x.param(typename exponential_distribution<_RealType>:: param_type(__lambda)); __is.flags(__flags); return __is; } /** * Polar method due to Marsaglia. * * Devroye, L. Non-Uniform Random Variates Generation. Springer-Verlag, * New York, 1986, Ch. V, Sect. 4.4. */ template template typename normal_distribution<_RealType>::result_type normal_distribution<_RealType>:: operator()(_UniformRandomNumberGenerator& __urng, const param_type& __param) { result_type __ret; __detail::_Adaptor<_UniformRandomNumberGenerator, result_type> __aurng(__urng); if (_M_saved_available) { _M_saved_available = false; __ret = _M_saved; } else { result_type __x, __y, __r2; do { __x = result_type(2.0) * __aurng() - 1.0; __y = result_type(2.0) * __aurng() - 1.0; __r2 = __x * __x + __y * __y; } while (__r2 > 1.0 || __r2 == 0.0); const result_type __mult = std::sqrt(-2 * std::log(__r2) / __r2); _M_saved = __x * __mult; _M_saved_available = true; __ret = __y * __mult; } __ret = __ret * __param.stddev() + __param.mean(); return __ret; } template template void normal_distribution<_RealType>:: __generate_impl(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const param_type& __param) { __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) if (__f == __t) return; if (_M_saved_available) { _M_saved_available = false; *__f++ = _M_saved * __param.stddev() + __param.mean(); if (__f == __t) return; } __detail::_Adaptor<_UniformRandomNumberGenerator, result_type> __aurng(__urng); while (__f + 1 < __t) { result_type __x, __y, __r2; do { __x = result_type(2.0) * __aurng() - 1.0; __y = result_type(2.0) * __aurng() - 1.0; __r2 = __x * __x + __y * __y; } while (__r2 > 1.0 || __r2 == 0.0); const result_type __mult = std::sqrt(-2 * std::log(__r2) / __r2); *__f++ = __y * __mult * __param.stddev() + __param.mean(); *__f++ = __x * __mult * __param.stddev() + __param.mean(); } if (__f != __t) { result_type __x, __y, __r2; do { __x = result_type(2.0) * __aurng() - 1.0; __y = result_type(2.0) * __aurng() - 1.0; __r2 = __x * __x + __y * __y; } while (__r2 > 1.0 || __r2 == 0.0); const result_type __mult = std::sqrt(-2 * std::log(__r2) / __r2); _M_saved = __x * __mult; _M_saved_available = true; *__f = __y * __mult * __param.stddev() + __param.mean(); } } template bool operator==(const std::normal_distribution<_RealType>& __d1, const std::normal_distribution<_RealType>& __d2) { if (__d1._M_param == __d2._M_param && __d1._M_saved_available == __d2._M_saved_available) { if (__d1._M_saved_available && __d1._M_saved == __d2._M_saved) return true; else if(!__d1._M_saved_available) return true; else return false; } else return false; } template std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>& __os, const normal_distribution<_RealType>& __x) { typedef std::basic_ostream<_CharT, _Traits> __ostream_type; typedef typename __ostream_type::ios_base __ios_base; const typename __ios_base::fmtflags __flags = __os.flags(); const _CharT __fill = __os.fill(); const std::streamsize __precision = __os.precision(); const _CharT __space = __os.widen(' '); __os.flags(__ios_base::scientific | __ios_base::left); __os.fill(__space); __os.precision(std::numeric_limits<_RealType>::max_digits10); __os << __x.mean() << __space << __x.stddev() << __space << __x._M_saved_available; if (__x._M_saved_available) __os << __space << __x._M_saved; __os.flags(__flags); __os.fill(__fill); __os.precision(__precision); return __os; } template std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>& __is, normal_distribution<_RealType>& __x) { typedef std::basic_istream<_CharT, _Traits> __istream_type; typedef typename __istream_type::ios_base __ios_base; const typename __ios_base::fmtflags __flags = __is.flags(); __is.flags(__ios_base::dec | __ios_base::skipws); double __mean, __stddev; __is >> __mean >> __stddev >> __x._M_saved_available; if (__x._M_saved_available) __is >> __x._M_saved; __x.param(typename normal_distribution<_RealType>:: param_type(__mean, __stddev)); __is.flags(__flags); return __is; } template template void lognormal_distribution<_RealType>:: __generate_impl(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const param_type& __p) { __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) while (__f != __t) *__f++ = std::exp(__p.s() * _M_nd(__urng) + __p.m()); } template std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>& __os, const lognormal_distribution<_RealType>& __x) { typedef std::basic_ostream<_CharT, _Traits> __ostream_type; typedef typename __ostream_type::ios_base __ios_base; const typename __ios_base::fmtflags __flags = __os.flags(); const _CharT __fill = __os.fill(); const std::streamsize __precision = __os.precision(); const _CharT __space = __os.widen(' '); __os.flags(__ios_base::scientific | __ios_base::left); __os.fill(__space); __os.precision(std::numeric_limits<_RealType>::max_digits10); __os << __x.m() << __space << __x.s() << __space << __x._M_nd; __os.flags(__flags); __os.fill(__fill); __os.precision(__precision); return __os; } template std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>& __is, lognormal_distribution<_RealType>& __x) { typedef std::basic_istream<_CharT, _Traits> __istream_type; typedef typename __istream_type::ios_base __ios_base; const typename __ios_base::fmtflags __flags = __is.flags(); __is.flags(__ios_base::dec | __ios_base::skipws); _RealType __m, __s; __is >> __m >> __s >> __x._M_nd; __x.param(typename lognormal_distribution<_RealType>:: param_type(__m, __s)); __is.flags(__flags); return __is; } template template void std::chi_squared_distribution<_RealType>:: __generate_impl(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng) { __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) while (__f != __t) *__f++ = 2 * _M_gd(__urng); } template template void std::chi_squared_distribution<_RealType>:: __generate_impl(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const typename std::gamma_distribution::param_type& __p) { __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) while (__f != __t) *__f++ = 2 * _M_gd(__urng, __p); } template std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>& __os, const chi_squared_distribution<_RealType>& __x) { typedef std::basic_ostream<_CharT, _Traits> __ostream_type; typedef typename __ostream_type::ios_base __ios_base; const typename __ios_base::fmtflags __flags = __os.flags(); const _CharT __fill = __os.fill(); const std::streamsize __precision = __os.precision(); const _CharT __space = __os.widen(' '); __os.flags(__ios_base::scientific | __ios_base::left); __os.fill(__space); __os.precision(std::numeric_limits<_RealType>::max_digits10); __os << __x.n() << __space << __x._M_gd; __os.flags(__flags); __os.fill(__fill); __os.precision(__precision); return __os; } template std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>& __is, chi_squared_distribution<_RealType>& __x) { typedef std::basic_istream<_CharT, _Traits> __istream_type; typedef typename __istream_type::ios_base __ios_base; const typename __ios_base::fmtflags __flags = __is.flags(); __is.flags(__ios_base::dec | __ios_base::skipws); _RealType __n; __is >> __n >> __x._M_gd; __x.param(typename chi_squared_distribution<_RealType>:: param_type(__n)); __is.flags(__flags); return __is; } template template typename cauchy_distribution<_RealType>::result_type cauchy_distribution<_RealType>:: operator()(_UniformRandomNumberGenerator& __urng, const param_type& __p) { __detail::_Adaptor<_UniformRandomNumberGenerator, result_type> __aurng(__urng); _RealType __u; do __u = __aurng(); while (__u == 0.5); const _RealType __pi = 3.1415926535897932384626433832795029L; return __p.a() + __p.b() * std::tan(__pi * __u); } template template void cauchy_distribution<_RealType>:: __generate_impl(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const param_type& __p) { __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) const _RealType __pi = 3.1415926535897932384626433832795029L; __detail::_Adaptor<_UniformRandomNumberGenerator, result_type> __aurng(__urng); while (__f != __t) { _RealType __u; do __u = __aurng(); while (__u == 0.5); *__f++ = __p.a() + __p.b() * std::tan(__pi * __u); } } template std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>& __os, const cauchy_distribution<_RealType>& __x) { typedef std::basic_ostream<_CharT, _Traits> __ostream_type; typedef typename __ostream_type::ios_base __ios_base; const typename __ios_base::fmtflags __flags = __os.flags(); const _CharT __fill = __os.fill(); const std::streamsize __precision = __os.precision(); const _CharT __space = __os.widen(' '); __os.flags(__ios_base::scientific | __ios_base::left); __os.fill(__space); __os.precision(std::numeric_limits<_RealType>::max_digits10); __os << __x.a() << __space << __x.b(); __os.flags(__flags); __os.fill(__fill); __os.precision(__precision); return __os; } template std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>& __is, cauchy_distribution<_RealType>& __x) { typedef std::basic_istream<_CharT, _Traits> __istream_type; typedef typename __istream_type::ios_base __ios_base; const typename __ios_base::fmtflags __flags = __is.flags(); __is.flags(__ios_base::dec | __ios_base::skipws); _RealType __a, __b; __is >> __a >> __b; __x.param(typename cauchy_distribution<_RealType>:: param_type(__a, __b)); __is.flags(__flags); return __is; } template template void std::fisher_f_distribution<_RealType>:: __generate_impl(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng) { __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) while (__f != __t) *__f++ = ((_M_gd_x(__urng) * n()) / (_M_gd_y(__urng) * m())); } template template void std::fisher_f_distribution<_RealType>:: __generate_impl(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const param_type& __p) { __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) typedef typename std::gamma_distribution::param_type param_type; param_type __p1(__p.m() / 2); param_type __p2(__p.n() / 2); while (__f != __t) *__f++ = ((_M_gd_x(__urng, __p1) * n()) / (_M_gd_y(__urng, __p2) * m())); } template std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>& __os, const fisher_f_distribution<_RealType>& __x) { typedef std::basic_ostream<_CharT, _Traits> __ostream_type; typedef typename __ostream_type::ios_base __ios_base; const typename __ios_base::fmtflags __flags = __os.flags(); const _CharT __fill = __os.fill(); const std::streamsize __precision = __os.precision(); const _CharT __space = __os.widen(' '); __os.flags(__ios_base::scientific | __ios_base::left); __os.fill(__space); __os.precision(std::numeric_limits<_RealType>::max_digits10); __os << __x.m() << __space << __x.n() << __space << __x._M_gd_x << __space << __x._M_gd_y; __os.flags(__flags); __os.fill(__fill); __os.precision(__precision); return __os; } template std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>& __is, fisher_f_distribution<_RealType>& __x) { typedef std::basic_istream<_CharT, _Traits> __istream_type; typedef typename __istream_type::ios_base __ios_base; const typename __ios_base::fmtflags __flags = __is.flags(); __is.flags(__ios_base::dec | __ios_base::skipws); _RealType __m, __n; __is >> __m >> __n >> __x._M_gd_x >> __x._M_gd_y; __x.param(typename fisher_f_distribution<_RealType>:: param_type(__m, __n)); __is.flags(__flags); return __is; } template template void std::student_t_distribution<_RealType>:: __generate_impl(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng) { __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) while (__f != __t) *__f++ = _M_nd(__urng) * std::sqrt(n() / _M_gd(__urng)); } template template void std::student_t_distribution<_RealType>:: __generate_impl(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const param_type& __p) { __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) typename std::gamma_distribution::param_type __p2(__p.n() / 2, 2); while (__f != __t) *__f++ = _M_nd(__urng) * std::sqrt(__p.n() / _M_gd(__urng, __p2)); } template std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>& __os, const student_t_distribution<_RealType>& __x) { typedef std::basic_ostream<_CharT, _Traits> __ostream_type; typedef typename __ostream_type::ios_base __ios_base; const typename __ios_base::fmtflags __flags = __os.flags(); const _CharT __fill = __os.fill(); const std::streamsize __precision = __os.precision(); const _CharT __space = __os.widen(' '); __os.flags(__ios_base::scientific | __ios_base::left); __os.fill(__space); __os.precision(std::numeric_limits<_RealType>::max_digits10); __os << __x.n() << __space << __x._M_nd << __space << __x._M_gd; __os.flags(__flags); __os.fill(__fill); __os.precision(__precision); return __os; } template std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>& __is, student_t_distribution<_RealType>& __x) { typedef std::basic_istream<_CharT, _Traits> __istream_type; typedef typename __istream_type::ios_base __ios_base; const typename __ios_base::fmtflags __flags = __is.flags(); __is.flags(__ios_base::dec | __ios_base::skipws); _RealType __n; __is >> __n >> __x._M_nd >> __x._M_gd; __x.param(typename student_t_distribution<_RealType>::param_type(__n)); __is.flags(__flags); return __is; } template void gamma_distribution<_RealType>::param_type:: _M_initialize() { _M_malpha = _M_alpha < 1.0 ? _M_alpha + _RealType(1.0) : _M_alpha; const _RealType __a1 = _M_malpha - _RealType(1.0) / _RealType(3.0); _M_a2 = _RealType(1.0) / std::sqrt(_RealType(9.0) * __a1); } /** * Marsaglia, G. and Tsang, W. W. * "A Simple Method for Generating Gamma Variables" * ACM Transactions on Mathematical Software, 26, 3, 363-372, 2000. */ template template typename gamma_distribution<_RealType>::result_type gamma_distribution<_RealType>:: operator()(_UniformRandomNumberGenerator& __urng, const param_type& __param) { __detail::_Adaptor<_UniformRandomNumberGenerator, result_type> __aurng(__urng); result_type __u, __v, __n; const result_type __a1 = (__param._M_malpha - _RealType(1.0) / _RealType(3.0)); do { do { __n = _M_nd(__urng); __v = result_type(1.0) + __param._M_a2 * __n; } while (__v <= 0.0); __v = __v * __v * __v; __u = __aurng(); } while (__u > result_type(1.0) - 0.331 * __n * __n * __n * __n && (std::log(__u) > (0.5 * __n * __n + __a1 * (1.0 - __v + std::log(__v))))); if (__param.alpha() == __param._M_malpha) return __a1 * __v * __param.beta(); else { do __u = __aurng(); while (__u == 0.0); return (std::pow(__u, result_type(1.0) / __param.alpha()) * __a1 * __v * __param.beta()); } } template template void gamma_distribution<_RealType>:: __generate_impl(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const param_type& __param) { __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) __detail::_Adaptor<_UniformRandomNumberGenerator, result_type> __aurng(__urng); result_type __u, __v, __n; const result_type __a1 = (__param._M_malpha - _RealType(1.0) / _RealType(3.0)); if (__param.alpha() == __param._M_malpha) while (__f != __t) { do { do { __n = _M_nd(__urng); __v = result_type(1.0) + __param._M_a2 * __n; } while (__v <= 0.0); __v = __v * __v * __v; __u = __aurng(); } while (__u > result_type(1.0) - 0.331 * __n * __n * __n * __n && (std::log(__u) > (0.5 * __n * __n + __a1 * (1.0 - __v + std::log(__v))))); *__f++ = __a1 * __v * __param.beta(); } else while (__f != __t) { do { do { __n = _M_nd(__urng); __v = result_type(1.0) + __param._M_a2 * __n; } while (__v <= 0.0); __v = __v * __v * __v; __u = __aurng(); } while (__u > result_type(1.0) - 0.331 * __n * __n * __n * __n && (std::log(__u) > (0.5 * __n * __n + __a1 * (1.0 - __v + std::log(__v))))); do __u = __aurng(); while (__u == 0.0); *__f++ = (std::pow(__u, result_type(1.0) / __param.alpha()) * __a1 * __v * __param.beta()); } } template std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>& __os, const gamma_distribution<_RealType>& __x) { typedef std::basic_ostream<_CharT, _Traits> __ostream_type; typedef typename __ostream_type::ios_base __ios_base; const typename __ios_base::fmtflags __flags = __os.flags(); const _CharT __fill = __os.fill(); const std::streamsize __precision = __os.precision(); const _CharT __space = __os.widen(' '); __os.flags(__ios_base::scientific | __ios_base::left); __os.fill(__space); __os.precision(std::numeric_limits<_RealType>::max_digits10); __os << __x.alpha() << __space << __x.beta() << __space << __x._M_nd; __os.flags(__flags); __os.fill(__fill); __os.precision(__precision); return __os; } template std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>& __is, gamma_distribution<_RealType>& __x) { typedef std::basic_istream<_CharT, _Traits> __istream_type; typedef typename __istream_type::ios_base __ios_base; const typename __ios_base::fmtflags __flags = __is.flags(); __is.flags(__ios_base::dec | __ios_base::skipws); _RealType __alpha_val, __beta_val; __is >> __alpha_val >> __beta_val >> __x._M_nd; __x.param(typename gamma_distribution<_RealType>:: param_type(__alpha_val, __beta_val)); __is.flags(__flags); return __is; } template template typename weibull_distribution<_RealType>::result_type weibull_distribution<_RealType>:: operator()(_UniformRandomNumberGenerator& __urng, const param_type& __p) { __detail::_Adaptor<_UniformRandomNumberGenerator, result_type> __aurng(__urng); return __p.b() * std::pow(-std::log(result_type(1) - __aurng()), result_type(1) / __p.a()); } template template void weibull_distribution<_RealType>:: __generate_impl(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const param_type& __p) { __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) __detail::_Adaptor<_UniformRandomNumberGenerator, result_type> __aurng(__urng); auto __inv_a = result_type(1) / __p.a(); while (__f != __t) *__f++ = __p.b() * std::pow(-std::log(result_type(1) - __aurng()), __inv_a); } template std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>& __os, const weibull_distribution<_RealType>& __x) { typedef std::basic_ostream<_CharT, _Traits> __ostream_type; typedef typename __ostream_type::ios_base __ios_base; const typename __ios_base::fmtflags __flags = __os.flags(); const _CharT __fill = __os.fill(); const std::streamsize __precision = __os.precision(); const _CharT __space = __os.widen(' '); __os.flags(__ios_base::scientific | __ios_base::left); __os.fill(__space); __os.precision(std::numeric_limits<_RealType>::max_digits10); __os << __x.a() << __space << __x.b(); __os.flags(__flags); __os.fill(__fill); __os.precision(__precision); return __os; } template std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>& __is, weibull_distribution<_RealType>& __x) { typedef std::basic_istream<_CharT, _Traits> __istream_type; typedef typename __istream_type::ios_base __ios_base; const typename __ios_base::fmtflags __flags = __is.flags(); __is.flags(__ios_base::dec | __ios_base::skipws); _RealType __a, __b; __is >> __a >> __b; __x.param(typename weibull_distribution<_RealType>:: param_type(__a, __b)); __is.flags(__flags); return __is; } template template typename extreme_value_distribution<_RealType>::result_type extreme_value_distribution<_RealType>:: operator()(_UniformRandomNumberGenerator& __urng, const param_type& __p) { __detail::_Adaptor<_UniformRandomNumberGenerator, result_type> __aurng(__urng); return __p.a() - __p.b() * std::log(-std::log(result_type(1) - __aurng())); } template template void extreme_value_distribution<_RealType>:: __generate_impl(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const param_type& __p) { __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) __detail::_Adaptor<_UniformRandomNumberGenerator, result_type> __aurng(__urng); while (__f != __t) *__f++ = __p.a() - __p.b() * std::log(-std::log(result_type(1) - __aurng())); } template std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>& __os, const extreme_value_distribution<_RealType>& __x) { typedef std::basic_ostream<_CharT, _Traits> __ostream_type; typedef typename __ostream_type::ios_base __ios_base; const typename __ios_base::fmtflags __flags = __os.flags(); const _CharT __fill = __os.fill(); const std::streamsize __precision = __os.precision(); const _CharT __space = __os.widen(' '); __os.flags(__ios_base::scientific | __ios_base::left); __os.fill(__space); __os.precision(std::numeric_limits<_RealType>::max_digits10); __os << __x.a() << __space << __x.b(); __os.flags(__flags); __os.fill(__fill); __os.precision(__precision); return __os; } template std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>& __is, extreme_value_distribution<_RealType>& __x) { typedef std::basic_istream<_CharT, _Traits> __istream_type; typedef typename __istream_type::ios_base __ios_base; const typename __ios_base::fmtflags __flags = __is.flags(); __is.flags(__ios_base::dec | __ios_base::skipws); _RealType __a, __b; __is >> __a >> __b; __x.param(typename extreme_value_distribution<_RealType>:: param_type(__a, __b)); __is.flags(__flags); return __is; } template void discrete_distribution<_IntType>::param_type:: _M_initialize() { if (_M_prob.size() < 2) { _M_prob.clear(); return; } const double __sum = std::accumulate(_M_prob.begin(), _M_prob.end(), 0.0); // Now normalize the probabilites. __detail::__normalize(_M_prob.begin(), _M_prob.end(), _M_prob.begin(), __sum); // Accumulate partial sums. _M_cp.reserve(_M_prob.size()); std::partial_sum(_M_prob.begin(), _M_prob.end(), std::back_inserter(_M_cp)); // Make sure the last cumulative probability is one. _M_cp[_M_cp.size() - 1] = 1.0; } template template discrete_distribution<_IntType>::param_type:: param_type(size_t __nw, double __xmin, double __xmax, _Func __fw) : _M_prob(), _M_cp() { const size_t __n = __nw == 0 ? 1 : __nw; const double __delta = (__xmax - __xmin) / __n; _M_prob.reserve(__n); for (size_t __k = 0; __k < __nw; ++__k) _M_prob.push_back(__fw(__xmin + __k * __delta + 0.5 * __delta)); _M_initialize(); } template template typename discrete_distribution<_IntType>::result_type discrete_distribution<_IntType>:: operator()(_UniformRandomNumberGenerator& __urng, const param_type& __param) { if (__param._M_cp.empty()) return result_type(0); __detail::_Adaptor<_UniformRandomNumberGenerator, double> __aurng(__urng); const double __p = __aurng(); auto __pos = std::lower_bound(__param._M_cp.begin(), __param._M_cp.end(), __p); return __pos - __param._M_cp.begin(); } template template void discrete_distribution<_IntType>:: __generate_impl(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const param_type& __param) { __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) if (__param._M_cp.empty()) { while (__f != __t) *__f++ = result_type(0); return; } __detail::_Adaptor<_UniformRandomNumberGenerator, double> __aurng(__urng); while (__f != __t) { const double __p = __aurng(); auto __pos = std::lower_bound(__param._M_cp.begin(), __param._M_cp.end(), __p); *__f++ = __pos - __param._M_cp.begin(); } } template std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>& __os, const discrete_distribution<_IntType>& __x) { typedef std::basic_ostream<_CharT, _Traits> __ostream_type; typedef typename __ostream_type::ios_base __ios_base; const typename __ios_base::fmtflags __flags = __os.flags(); const _CharT __fill = __os.fill(); const std::streamsize __precision = __os.precision(); const _CharT __space = __os.widen(' '); __os.flags(__ios_base::scientific | __ios_base::left); __os.fill(__space); __os.precision(std::numeric_limits::max_digits10); std::vector __prob = __x.probabilities(); __os << __prob.size(); for (auto __dit = __prob.begin(); __dit != __prob.end(); ++__dit) __os << __space << *__dit; __os.flags(__flags); __os.fill(__fill); __os.precision(__precision); return __os; } template std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>& __is, discrete_distribution<_IntType>& __x) { typedef std::basic_istream<_CharT, _Traits> __istream_type; typedef typename __istream_type::ios_base __ios_base; const typename __ios_base::fmtflags __flags = __is.flags(); __is.flags(__ios_base::dec | __ios_base::skipws); size_t __n; __is >> __n; std::vector __prob_vec; __prob_vec.reserve(__n); for (; __n != 0; --__n) { double __prob; __is >> __prob; __prob_vec.push_back(__prob); } __x.param(typename discrete_distribution<_IntType>:: param_type(__prob_vec.begin(), __prob_vec.end())); __is.flags(__flags); return __is; } template void piecewise_constant_distribution<_RealType>::param_type:: _M_initialize() { if (_M_int.size() < 2 || (_M_int.size() == 2 && _M_int[0] == _RealType(0) && _M_int[1] == _RealType(1))) { _M_int.clear(); _M_den.clear(); return; } const double __sum = std::accumulate(_M_den.begin(), _M_den.end(), 0.0); __detail::__normalize(_M_den.begin(), _M_den.end(), _M_den.begin(), __sum); _M_cp.reserve(_M_den.size()); std::partial_sum(_M_den.begin(), _M_den.end(), std::back_inserter(_M_cp)); // Make sure the last cumulative probability is one. _M_cp[_M_cp.size() - 1] = 1.0; for (size_t __k = 0; __k < _M_den.size(); ++__k) _M_den[__k] /= _M_int[__k + 1] - _M_int[__k]; } template template piecewise_constant_distribution<_RealType>::param_type:: param_type(_InputIteratorB __bbegin, _InputIteratorB __bend, _InputIteratorW __wbegin) : _M_int(), _M_den(), _M_cp() { if (__bbegin != __bend) { for (;;) { _M_int.push_back(*__bbegin); ++__bbegin; if (__bbegin == __bend) break; _M_den.push_back(*__wbegin); ++__wbegin; } } _M_initialize(); } template template piecewise_constant_distribution<_RealType>::param_type:: param_type(initializer_list<_RealType> __bl, _Func __fw) : _M_int(), _M_den(), _M_cp() { _M_int.reserve(__bl.size()); for (auto __biter = __bl.begin(); __biter != __bl.end(); ++__biter) _M_int.push_back(*__biter); _M_den.reserve(_M_int.size() - 1); for (size_t __k = 0; __k < _M_int.size() - 1; ++__k) _M_den.push_back(__fw(0.5 * (_M_int[__k + 1] + _M_int[__k]))); _M_initialize(); } template template piecewise_constant_distribution<_RealType>::param_type:: param_type(size_t __nw, _RealType __xmin, _RealType __xmax, _Func __fw) : _M_int(), _M_den(), _M_cp() { const size_t __n = __nw == 0 ? 1 : __nw; const _RealType __delta = (__xmax - __xmin) / __n; _M_int.reserve(__n + 1); for (size_t __k = 0; __k <= __nw; ++__k) _M_int.push_back(__xmin + __k * __delta); _M_den.reserve(__n); for (size_t __k = 0; __k < __nw; ++__k) _M_den.push_back(__fw(_M_int[__k] + 0.5 * __delta)); _M_initialize(); } template template typename piecewise_constant_distribution<_RealType>::result_type piecewise_constant_distribution<_RealType>:: operator()(_UniformRandomNumberGenerator& __urng, const param_type& __param) { __detail::_Adaptor<_UniformRandomNumberGenerator, double> __aurng(__urng); const double __p = __aurng(); if (__param._M_cp.empty()) return __p; auto __pos = std::lower_bound(__param._M_cp.begin(), __param._M_cp.end(), __p); const size_t __i = __pos - __param._M_cp.begin(); const double __pref = __i > 0 ? __param._M_cp[__i - 1] : 0.0; return __param._M_int[__i] + (__p - __pref) / __param._M_den[__i]; } template template void piecewise_constant_distribution<_RealType>:: __generate_impl(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const param_type& __param) { __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) __detail::_Adaptor<_UniformRandomNumberGenerator, double> __aurng(__urng); if (__param._M_cp.empty()) { while (__f != __t) *__f++ = __aurng(); return; } while (__f != __t) { const double __p = __aurng(); auto __pos = std::lower_bound(__param._M_cp.begin(), __param._M_cp.end(), __p); const size_t __i = __pos - __param._M_cp.begin(); const double __pref = __i > 0 ? __param._M_cp[__i - 1] : 0.0; *__f++ = (__param._M_int[__i] + (__p - __pref) / __param._M_den[__i]); } } template std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>& __os, const piecewise_constant_distribution<_RealType>& __x) { typedef std::basic_ostream<_CharT, _Traits> __ostream_type; typedef typename __ostream_type::ios_base __ios_base; const typename __ios_base::fmtflags __flags = __os.flags(); const _CharT __fill = __os.fill(); const std::streamsize __precision = __os.precision(); const _CharT __space = __os.widen(' '); __os.flags(__ios_base::scientific | __ios_base::left); __os.fill(__space); __os.precision(std::numeric_limits<_RealType>::max_digits10); std::vector<_RealType> __int = __x.intervals(); __os << __int.size() - 1; for (auto __xit = __int.begin(); __xit != __int.end(); ++__xit) __os << __space << *__xit; std::vector __den = __x.densities(); for (auto __dit = __den.begin(); __dit != __den.end(); ++__dit) __os << __space << *__dit; __os.flags(__flags); __os.fill(__fill); __os.precision(__precision); return __os; } template std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>& __is, piecewise_constant_distribution<_RealType>& __x) { typedef std::basic_istream<_CharT, _Traits> __istream_type; typedef typename __istream_type::ios_base __ios_base; const typename __ios_base::fmtflags __flags = __is.flags(); __is.flags(__ios_base::dec | __ios_base::skipws); size_t __n; __is >> __n; std::vector<_RealType> __int_vec; __int_vec.reserve(__n + 1); for (size_t __i = 0; __i <= __n; ++__i) { _RealType __int; __is >> __int; __int_vec.push_back(__int); } std::vector __den_vec; __den_vec.reserve(__n); for (size_t __i = 0; __i < __n; ++__i) { double __den; __is >> __den; __den_vec.push_back(__den); } __x.param(typename piecewise_constant_distribution<_RealType>:: param_type(__int_vec.begin(), __int_vec.end(), __den_vec.begin())); __is.flags(__flags); return __is; } template void piecewise_linear_distribution<_RealType>::param_type:: _M_initialize() { if (_M_int.size() < 2 || (_M_int.size() == 2 && _M_int[0] == _RealType(0) && _M_int[1] == _RealType(1) && _M_den[0] == _M_den[1])) { _M_int.clear(); _M_den.clear(); return; } double __sum = 0.0; _M_cp.reserve(_M_int.size() - 1); _M_m.reserve(_M_int.size() - 1); for (size_t __k = 0; __k < _M_int.size() - 1; ++__k) { const _RealType __delta = _M_int[__k + 1] - _M_int[__k]; __sum += 0.5 * (_M_den[__k + 1] + _M_den[__k]) * __delta; _M_cp.push_back(__sum); _M_m.push_back((_M_den[__k + 1] - _M_den[__k]) / __delta); } // Now normalize the densities... __detail::__normalize(_M_den.begin(), _M_den.end(), _M_den.begin(), __sum); // ... and partial sums... __detail::__normalize(_M_cp.begin(), _M_cp.end(), _M_cp.begin(), __sum); // ... and slopes. __detail::__normalize(_M_m.begin(), _M_m.end(), _M_m.begin(), __sum); // Make sure the last cumulative probablility is one. _M_cp[_M_cp.size() - 1] = 1.0; } template template piecewise_linear_distribution<_RealType>::param_type:: param_type(_InputIteratorB __bbegin, _InputIteratorB __bend, _InputIteratorW __wbegin) : _M_int(), _M_den(), _M_cp(), _M_m() { for (; __bbegin != __bend; ++__bbegin, ++__wbegin) { _M_int.push_back(*__bbegin); _M_den.push_back(*__wbegin); } _M_initialize(); } template template piecewise_linear_distribution<_RealType>::param_type:: param_type(initializer_list<_RealType> __bl, _Func __fw) : _M_int(), _M_den(), _M_cp(), _M_m() { _M_int.reserve(__bl.size()); _M_den.reserve(__bl.size()); for (auto __biter = __bl.begin(); __biter != __bl.end(); ++__biter) { _M_int.push_back(*__biter); _M_den.push_back(__fw(*__biter)); } _M_initialize(); } template template piecewise_linear_distribution<_RealType>::param_type:: param_type(size_t __nw, _RealType __xmin, _RealType __xmax, _Func __fw) : _M_int(), _M_den(), _M_cp(), _M_m() { const size_t __n = __nw == 0 ? 1 : __nw; const _RealType __delta = (__xmax - __xmin) / __n; _M_int.reserve(__n + 1); _M_den.reserve(__n + 1); for (size_t __k = 0; __k <= __nw; ++__k) { _M_int.push_back(__xmin + __k * __delta); _M_den.push_back(__fw(_M_int[__k] + __delta)); } _M_initialize(); } template template typename piecewise_linear_distribution<_RealType>::result_type piecewise_linear_distribution<_RealType>:: operator()(_UniformRandomNumberGenerator& __urng, const param_type& __param) { __detail::_Adaptor<_UniformRandomNumberGenerator, double> __aurng(__urng); const double __p = __aurng(); if (__param._M_cp.empty()) return __p; auto __pos = std::lower_bound(__param._M_cp.begin(), __param._M_cp.end(), __p); const size_t __i = __pos - __param._M_cp.begin(); const double __pref = __i > 0 ? __param._M_cp[__i - 1] : 0.0; const double __a = 0.5 * __param._M_m[__i]; const double __b = __param._M_den[__i]; const double __cm = __p - __pref; _RealType __x = __param._M_int[__i]; if (__a == 0) __x += __cm / __b; else { const double __d = __b * __b + 4.0 * __a * __cm; __x += 0.5 * (std::sqrt(__d) - __b) / __a; } return __x; } template template void piecewise_linear_distribution<_RealType>:: __generate_impl(_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator& __urng, const param_type& __param) { __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) // We could duplicate everything from operator()... while (__f != __t) *__f++ = this->operator()(__urng, __param); } template std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>& __os, const piecewise_linear_distribution<_RealType>& __x) { typedef std::basic_ostream<_CharT, _Traits> __ostream_type; typedef typename __ostream_type::ios_base __ios_base; const typename __ios_base::fmtflags __flags = __os.flags(); const _CharT __fill = __os.fill(); const std::streamsize __precision = __os.precision(); const _CharT __space = __os.widen(' '); __os.flags(__ios_base::scientific | __ios_base::left); __os.fill(__space); __os.precision(std::numeric_limits<_RealType>::max_digits10); std::vector<_RealType> __int = __x.intervals(); __os << __int.size() - 1; for (auto __xit = __int.begin(); __xit != __int.end(); ++__xit) __os << __space << *__xit; std::vector __den = __x.densities(); for (auto __dit = __den.begin(); __dit != __den.end(); ++__dit) __os << __space << *__dit; __os.flags(__flags); __os.fill(__fill); __os.precision(__precision); return __os; } template std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>& __is, piecewise_linear_distribution<_RealType>& __x) { typedef std::basic_istream<_CharT, _Traits> __istream_type; typedef typename __istream_type::ios_base __ios_base; const typename __ios_base::fmtflags __flags = __is.flags(); __is.flags(__ios_base::dec | __ios_base::skipws); size_t __n; __is >> __n; std::vector<_RealType> __int_vec; __int_vec.reserve(__n + 1); for (size_t __i = 0; __i <= __n; ++__i) { _RealType __int; __is >> __int; __int_vec.push_back(__int); } std::vector __den_vec; __den_vec.reserve(__n + 1); for (size_t __i = 0; __i <= __n; ++__i) { double __den; __is >> __den; __den_vec.push_back(__den); } __x.param(typename piecewise_linear_distribution<_RealType>:: param_type(__int_vec.begin(), __int_vec.end(), __den_vec.begin())); __is.flags(__flags); return __is; } template seed_seq::seed_seq(std::initializer_list<_IntType> __il) { for (auto __iter = __il.begin(); __iter != __il.end(); ++__iter) _M_v.push_back(__detail::__mod::__value>(*__iter)); } template seed_seq::seed_seq(_InputIterator __begin, _InputIterator __end) { for (_InputIterator __iter = __begin; __iter != __end; ++__iter) _M_v.push_back(__detail::__mod::__value>(*__iter)); } template void seed_seq::generate(_RandomAccessIterator __begin, _RandomAccessIterator __end) { typedef typename iterator_traits<_RandomAccessIterator>::value_type _Type; if (__begin == __end) return; std::fill(__begin, __end, _Type(0x8b8b8b8bu)); const size_t __n = __end - __begin; const size_t __s = _M_v.size(); const size_t __t = (__n >= 623) ? 11 : (__n >= 68) ? 7 : (__n >= 39) ? 5 : (__n >= 7) ? 3 : (__n - 1) / 2; const size_t __p = (__n - __t) / 2; const size_t __q = __p + __t; const size_t __m = std::max(size_t(__s + 1), __n); for (size_t __k = 0; __k < __m; ++__k) { _Type __arg = (__begin[__k % __n] ^ __begin[(__k + __p) % __n] ^ __begin[(__k - 1) % __n]); _Type __r1 = __arg ^ (__arg >> 27); __r1 = __detail::__mod<_Type, __detail::_Shift<_Type, 32>::__value>(1664525u * __r1); _Type __r2 = __r1; if (__k == 0) __r2 += __s; else if (__k <= __s) __r2 += __k % __n + _M_v[__k - 1]; else __r2 += __k % __n; __r2 = __detail::__mod<_Type, __detail::_Shift<_Type, 32>::__value>(__r2); __begin[(__k + __p) % __n] += __r1; __begin[(__k + __q) % __n] += __r2; __begin[__k % __n] = __r2; } for (size_t __k = __m; __k < __m + __n; ++__k) { _Type __arg = (__begin[__k % __n] + __begin[(__k + __p) % __n] + __begin[(__k - 1) % __n]); _Type __r3 = __arg ^ (__arg >> 27); __r3 = __detail::__mod<_Type, __detail::_Shift<_Type, 32>::__value>(1566083941u * __r3); _Type __r4 = __r3 - __k % __n; __r4 = __detail::__mod<_Type, __detail::_Shift<_Type, 32>::__value>(__r4); __begin[(__k + __p) % __n] ^= __r3; __begin[(__k + __q) % __n] ^= __r4; __begin[__k % __n] = __r4; } } template _RealType generate_canonical(_UniformRandomNumberGenerator& __urng) { static_assert(std::is_floating_point<_RealType>::value, "template argument not a floating point type"); const size_t __b = std::min(static_cast(std::numeric_limits<_RealType>::digits), __bits); const long double __r = static_cast(__urng.max()) - static_cast(__urng.min()) + 1.0L; const size_t __log2r = std::log(__r) / std::log(2.0L); size_t __k = std::max(1UL, (__b + __log2r - 1UL) / __log2r); _RealType __sum = _RealType(0); _RealType __tmp = _RealType(1); for (; __k != 0; --__k) { __sum += _RealType(__urng() - __urng.min()) * __tmp; __tmp *= __r; } return __sum / __tmp; } _GLIBCXX_END_NAMESPACE_VERSION } // namespace #endif # 3338 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/random.tcc" 3 # 52 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/random" 2 3 #endif // _GLIBCXX_USE_C99_STDINT_TR1 # 54 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/random" 3 #endif // C++11 # 56 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/random" 3 #endif // _GLIBCXX_RANDOM # 58 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/random" 3 # 12 "test2.cpp" 2 #if 0 /* expanded by -frewrite-includes */ #include "Graph.hpp" #endif /* expanded by -frewrite-includes */ # 12 "test2.cpp" # 1 "./Graph.hpp" 1 #ifndef GRAPH_HPP #define GRAPH_HPP #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 4 "./Graph.hpp" # 5 "./Graph.hpp" #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 5 "./Graph.hpp" # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/queue" 1 3 // -*- C++ -*- // Copyright (C) 2001-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /* * * Copyright (c) 1994 * Hewlett-Packard Company * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Hewlett-Packard Company makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. * * * Copyright (c) 1996,1997 * Silicon Graphics Computer Systems, Inc. * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Silicon Graphics makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. */ /** @file include/queue * This is a Standard C++ Library header. */ #ifndef _GLIBCXX_QUEUE #define _GLIBCXX_QUEUE 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 59 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/queue" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 60 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/queue" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/deque" 1 3 // -*- C++ -*- // Copyright (C) 2001-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /* * * Copyright (c) 1994 * Hewlett-Packard Company * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Hewlett-Packard Company makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. * * * Copyright (c) 1997 * Silicon Graphics Computer Systems, Inc. * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Silicon Graphics makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. */ /** @file include/deque * This is a Standard C++ Library header. */ #ifndef _GLIBCXX_DEQUE #define _GLIBCXX_DEQUE 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 59 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/deque" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 60 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/deque" 3 # 61 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/deque" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 61 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/deque" 3 # 62 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/deque" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 62 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/deque" 3 # 63 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/deque" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 63 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/deque" 3 # 64 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/deque" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 64 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/deque" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_deque.h" 1 3 // Deque implementation -*- C++ -*- // Copyright (C) 2001-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /* * * Copyright (c) 1994 * Hewlett-Packard Company * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Hewlett-Packard Company makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. * * * Copyright (c) 1997 * Silicon Graphics Computer Systems, Inc. * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Silicon Graphics makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. */ /** @file bits/stl_deque.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{deque} */ #ifndef _STL_DEQUE_H #define _STL_DEQUE_H 1 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 59 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_deque.h" 3 # 60 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_deque.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 60 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_deque.h" 3 # 61 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_deque.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 61 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_deque.h" 3 # 62 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_deque.h" 3 #if __cplusplus >= 201103L #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 63 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_deque.h" 3 # 64 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_deque.h" 3 #endif # 65 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_deque.h" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_CONTAINER /** * @brief This function controls the size of memory nodes. * @param __size The size of an element. * @return The number (not byte size) of elements per node. * * This function started off as a compiler kludge from SGI, but * seems to be a useful wrapper around a repeated constant * expression. The @b 512 is tunable (and no other code needs to * change), but no investigation has been done since inheriting the * SGI code. Touch _GLIBCXX_DEQUE_BUF_SIZE only if you know what * you are doing, however: changing it breaks the binary * compatibility!! */ #ifndef _GLIBCXX_DEQUE_BUF_SIZE #define _GLIBCXX_DEQUE_BUF_SIZE 512 #endif # 87 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_deque.h" 3 _GLIBCXX_CONSTEXPR inline size_t __deque_buf_size(size_t __size) { return (__size < _GLIBCXX_DEQUE_BUF_SIZE ? size_t(_GLIBCXX_DEQUE_BUF_SIZE / __size) : size_t(1)); } /** * @brief A deque::iterator. * * Quite a bit of intelligence here. Much of the functionality of * deque is actually passed off to this class. A deque holds two * of these internally, marking its valid range. Access to * elements is done as offsets of either of those two, relying on * operator overloading in this class. * * All the functions are op overloads except for _M_set_node. */ template struct _Deque_iterator { #if __cplusplus < 201103L typedef _Deque_iterator<_Tp, _Tp&, _Tp*> iterator; typedef _Deque_iterator<_Tp, const _Tp&, const _Tp*> const_iterator; typedef _Tp* _Elt_pointer; typedef _Tp** _Map_pointer; #else # 114 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_deque.h" 3 private: template using __ptr_to = typename pointer_traits<_Ptr>::template rebind<_Up>; template using __iter = _Deque_iterator<_Tp, _CvTp&, __ptr_to<_CvTp>>; public: typedef __iter<_Tp> iterator; typedef __iter const_iterator; typedef __ptr_to<_Tp> _Elt_pointer; typedef __ptr_to<_Elt_pointer> _Map_pointer; #endif # 125 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_deque.h" 3 static size_t _S_buffer_size() _GLIBCXX_NOEXCEPT { return __deque_buf_size(sizeof(_Tp)); } typedef std::random_access_iterator_tag iterator_category; typedef _Tp value_type; typedef _Ptr pointer; typedef _Ref reference; typedef size_t size_type; typedef ptrdiff_t difference_type; typedef _Deque_iterator _Self; _Elt_pointer _M_cur; _Elt_pointer _M_first; _Elt_pointer _M_last; _Map_pointer _M_node; _Deque_iterator(_Elt_pointer __x, _Map_pointer __y) _GLIBCXX_NOEXCEPT : _M_cur(__x), _M_first(*__y), _M_last(*__y + _S_buffer_size()), _M_node(__y) { } _Deque_iterator() _GLIBCXX_NOEXCEPT : _M_cur(), _M_first(), _M_last(), _M_node() { } _Deque_iterator(const iterator& __x) _GLIBCXX_NOEXCEPT : _M_cur(__x._M_cur), _M_first(__x._M_first), _M_last(__x._M_last), _M_node(__x._M_node) { } iterator _M_const_cast() const _GLIBCXX_NOEXCEPT { return iterator(_M_cur, _M_node); } reference operator*() const _GLIBCXX_NOEXCEPT { return *_M_cur; } pointer operator->() const _GLIBCXX_NOEXCEPT { return _M_cur; } _Self& operator++() _GLIBCXX_NOEXCEPT { ++_M_cur; if (_M_cur == _M_last) { _M_set_node(_M_node + 1); _M_cur = _M_first; } return *this; } _Self operator++(int) _GLIBCXX_NOEXCEPT { _Self __tmp = *this; ++*this; return __tmp; } _Self& operator--() _GLIBCXX_NOEXCEPT { if (_M_cur == _M_first) { _M_set_node(_M_node - 1); _M_cur = _M_last; } --_M_cur; return *this; } _Self operator--(int) _GLIBCXX_NOEXCEPT { _Self __tmp = *this; --*this; return __tmp; } _Self& operator+=(difference_type __n) _GLIBCXX_NOEXCEPT { const difference_type __offset = __n + (_M_cur - _M_first); if (__offset >= 0 && __offset < difference_type(_S_buffer_size())) _M_cur += __n; else { const difference_type __node_offset = __offset > 0 ? __offset / difference_type(_S_buffer_size()) : -difference_type((-__offset - 1) / _S_buffer_size()) - 1; _M_set_node(_M_node + __node_offset); _M_cur = _M_first + (__offset - __node_offset * difference_type(_S_buffer_size())); } return *this; } _Self operator+(difference_type __n) const _GLIBCXX_NOEXCEPT { _Self __tmp = *this; return __tmp += __n; } _Self& operator-=(difference_type __n) _GLIBCXX_NOEXCEPT { return *this += -__n; } _Self operator-(difference_type __n) const _GLIBCXX_NOEXCEPT { _Self __tmp = *this; return __tmp -= __n; } reference operator[](difference_type __n) const _GLIBCXX_NOEXCEPT { return *(*this + __n); } /** * Prepares to traverse new_node. Sets everything except * _M_cur, which should therefore be set by the caller * immediately afterwards, based on _M_first and _M_last. */ void _M_set_node(_Map_pointer __new_node) _GLIBCXX_NOEXCEPT { _M_node = __new_node; _M_first = *__new_node; _M_last = _M_first + difference_type(_S_buffer_size()); } }; // Note: we also provide overloads whose operands are of the same type in // order to avoid ambiguous overload resolution when std::rel_ops operators // are in scope (for additional details, see libstdc++/3628) template inline bool operator==(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x, const _Deque_iterator<_Tp, _Ref, _Ptr>& __y) _GLIBCXX_NOEXCEPT { return __x._M_cur == __y._M_cur; } template inline bool operator==(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x, const _Deque_iterator<_Tp, _RefR, _PtrR>& __y) _GLIBCXX_NOEXCEPT { return __x._M_cur == __y._M_cur; } template inline bool operator!=(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x, const _Deque_iterator<_Tp, _Ref, _Ptr>& __y) _GLIBCXX_NOEXCEPT { return !(__x == __y); } template inline bool operator!=(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x, const _Deque_iterator<_Tp, _RefR, _PtrR>& __y) _GLIBCXX_NOEXCEPT { return !(__x == __y); } template inline bool operator<(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x, const _Deque_iterator<_Tp, _Ref, _Ptr>& __y) _GLIBCXX_NOEXCEPT { return (__x._M_node == __y._M_node) ? (__x._M_cur < __y._M_cur) : (__x._M_node < __y._M_node); } template inline bool operator<(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x, const _Deque_iterator<_Tp, _RefR, _PtrR>& __y) _GLIBCXX_NOEXCEPT { return (__x._M_node == __y._M_node) ? (__x._M_cur < __y._M_cur) : (__x._M_node < __y._M_node); } template inline bool operator>(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x, const _Deque_iterator<_Tp, _Ref, _Ptr>& __y) _GLIBCXX_NOEXCEPT { return __y < __x; } template inline bool operator>(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x, const _Deque_iterator<_Tp, _RefR, _PtrR>& __y) _GLIBCXX_NOEXCEPT { return __y < __x; } template inline bool operator<=(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x, const _Deque_iterator<_Tp, _Ref, _Ptr>& __y) _GLIBCXX_NOEXCEPT { return !(__y < __x); } template inline bool operator<=(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x, const _Deque_iterator<_Tp, _RefR, _PtrR>& __y) _GLIBCXX_NOEXCEPT { return !(__y < __x); } template inline bool operator>=(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x, const _Deque_iterator<_Tp, _Ref, _Ptr>& __y) _GLIBCXX_NOEXCEPT { return !(__x < __y); } template inline bool operator>=(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x, const _Deque_iterator<_Tp, _RefR, _PtrR>& __y) _GLIBCXX_NOEXCEPT { return !(__x < __y); } // _GLIBCXX_RESOLVE_LIB_DEFECTS // According to the resolution of DR179 not only the various comparison // operators but also operator- must accept mixed iterator/const_iterator // parameters. template inline typename _Deque_iterator<_Tp, _Ref, _Ptr>::difference_type operator-(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x, const _Deque_iterator<_Tp, _Ref, _Ptr>& __y) _GLIBCXX_NOEXCEPT { return typename _Deque_iterator<_Tp, _Ref, _Ptr>::difference_type (_Deque_iterator<_Tp, _Ref, _Ptr>::_S_buffer_size()) * (__x._M_node - __y._M_node - 1) + (__x._M_cur - __x._M_first) + (__y._M_last - __y._M_cur); } template inline typename _Deque_iterator<_Tp, _RefL, _PtrL>::difference_type operator-(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x, const _Deque_iterator<_Tp, _RefR, _PtrR>& __y) _GLIBCXX_NOEXCEPT { return typename _Deque_iterator<_Tp, _RefL, _PtrL>::difference_type (_Deque_iterator<_Tp, _RefL, _PtrL>::_S_buffer_size()) * (__x._M_node - __y._M_node - 1) + (__x._M_cur - __x._M_first) + (__y._M_last - __y._M_cur); } template inline _Deque_iterator<_Tp, _Ref, _Ptr> operator+(ptrdiff_t __n, const _Deque_iterator<_Tp, _Ref, _Ptr>& __x) _GLIBCXX_NOEXCEPT { return __x + __n; } template void fill(const _Deque_iterator<_Tp, _Tp&, _Tp*>&, const _Deque_iterator<_Tp, _Tp&, _Tp*>&, const _Tp&); template _Deque_iterator<_Tp, _Tp&, _Tp*> copy(_Deque_iterator<_Tp, const _Tp&, const _Tp*>, _Deque_iterator<_Tp, const _Tp&, const _Tp*>, _Deque_iterator<_Tp, _Tp&, _Tp*>); template inline _Deque_iterator<_Tp, _Tp&, _Tp*> copy(_Deque_iterator<_Tp, _Tp&, _Tp*> __first, _Deque_iterator<_Tp, _Tp&, _Tp*> __last, _Deque_iterator<_Tp, _Tp&, _Tp*> __result) { return std::copy(_Deque_iterator<_Tp, const _Tp&, const _Tp*>(__first), _Deque_iterator<_Tp, const _Tp&, const _Tp*>(__last), __result); } template _Deque_iterator<_Tp, _Tp&, _Tp*> copy_backward(_Deque_iterator<_Tp, const _Tp&, const _Tp*>, _Deque_iterator<_Tp, const _Tp&, const _Tp*>, _Deque_iterator<_Tp, _Tp&, _Tp*>); template inline _Deque_iterator<_Tp, _Tp&, _Tp*> copy_backward(_Deque_iterator<_Tp, _Tp&, _Tp*> __first, _Deque_iterator<_Tp, _Tp&, _Tp*> __last, _Deque_iterator<_Tp, _Tp&, _Tp*> __result) { return std::copy_backward(_Deque_iterator<_Tp, const _Tp&, const _Tp*>(__first), _Deque_iterator<_Tp, const _Tp&, const _Tp*>(__last), __result); } #if __cplusplus >= 201103L template _Deque_iterator<_Tp, _Tp&, _Tp*> move(_Deque_iterator<_Tp, const _Tp&, const _Tp*>, _Deque_iterator<_Tp, const _Tp&, const _Tp*>, _Deque_iterator<_Tp, _Tp&, _Tp*>); template inline _Deque_iterator<_Tp, _Tp&, _Tp*> move(_Deque_iterator<_Tp, _Tp&, _Tp*> __first, _Deque_iterator<_Tp, _Tp&, _Tp*> __last, _Deque_iterator<_Tp, _Tp&, _Tp*> __result) { return std::move(_Deque_iterator<_Tp, const _Tp&, const _Tp*>(__first), _Deque_iterator<_Tp, const _Tp&, const _Tp*>(__last), __result); } template _Deque_iterator<_Tp, _Tp&, _Tp*> move_backward(_Deque_iterator<_Tp, const _Tp&, const _Tp*>, _Deque_iterator<_Tp, const _Tp&, const _Tp*>, _Deque_iterator<_Tp, _Tp&, _Tp*>); template inline _Deque_iterator<_Tp, _Tp&, _Tp*> move_backward(_Deque_iterator<_Tp, _Tp&, _Tp*> __first, _Deque_iterator<_Tp, _Tp&, _Tp*> __last, _Deque_iterator<_Tp, _Tp&, _Tp*> __result) { return std::move_backward(_Deque_iterator<_Tp, const _Tp&, const _Tp*>(__first), _Deque_iterator<_Tp, const _Tp&, const _Tp*>(__last), __result); } #endif # 446 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_deque.h" 3 /** * Deque base class. This class provides the unified face for %deque's * allocation. This class's constructor and destructor allocate and * deallocate (but do not initialize) storage. This makes %exception * safety easier. * * Nothing in this class ever constructs or destroys an actual Tp element. * (Deque handles that itself.) Only/All memory management is performed * here. */ template class _Deque_base { protected: typedef typename __gnu_cxx::__alloc_traits<_Alloc>::template rebind<_Tp>::other _Tp_alloc_type; typedef __gnu_cxx::__alloc_traits<_Tp_alloc_type> _Alloc_traits; #if __cplusplus < 201103L typedef _Tp* _Ptr; typedef const _Tp* _Ptr_const; #else # 469 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_deque.h" 3 typedef typename _Alloc_traits::pointer _Ptr; typedef typename _Alloc_traits::const_pointer _Ptr_const; #endif # 472 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_deque.h" 3 typedef typename _Alloc_traits::template rebind<_Ptr>::other _Map_alloc_type; typedef __gnu_cxx::__alloc_traits<_Map_alloc_type> _Map_alloc_traits; public: typedef _Alloc allocator_type; typedef typename _Alloc_traits::size_type size_type; allocator_type get_allocator() const _GLIBCXX_NOEXCEPT { return allocator_type(_M_get_Tp_allocator()); } typedef _Deque_iterator<_Tp, _Tp&, _Ptr> iterator; typedef _Deque_iterator<_Tp, const _Tp&, _Ptr_const> const_iterator; _Deque_base() : _M_impl() { _M_initialize_map(0); } _Deque_base(size_t __num_elements) : _M_impl() { _M_initialize_map(__num_elements); } _Deque_base(const allocator_type& __a, size_t __num_elements) : _M_impl(__a) { _M_initialize_map(__num_elements); } _Deque_base(const allocator_type& __a) : _M_impl(__a) { /* Caller must initialize map. */ } #if __cplusplus >= 201103L _Deque_base(_Deque_base&& __x, false_type) : _M_impl(__x._M_move_impl()) { } _Deque_base(_Deque_base&& __x, true_type) : _M_impl(std::move(__x._M_get_Tp_allocator())) { _M_initialize_map(0); if (__x._M_impl._M_map) this->_M_impl._M_swap_data(__x._M_impl); } _Deque_base(_Deque_base&& __x) : _Deque_base(std::move(__x), __gnu_cxx::__allocator_always_compares_equal<_Alloc>{}) { } _Deque_base(_Deque_base&& __x, const allocator_type& __a, size_type __n) : _M_impl(__a) { if (__x.get_allocator() == __a) { if (__x._M_impl._M_map) { _M_initialize_map(0); this->_M_impl._M_swap_data(__x._M_impl); } } else { _M_initialize_map(__n); } } #endif # 539 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_deque.h" 3 ~_Deque_base() _GLIBCXX_NOEXCEPT; protected: typedef typename iterator::_Map_pointer _Map_pointer; //This struct encapsulates the implementation of the std::deque //standard container and at the same time makes use of the EBO //for empty allocators. struct _Deque_impl : public _Tp_alloc_type { _Map_pointer _M_map; size_t _M_map_size; iterator _M_start; iterator _M_finish; _Deque_impl() : _Tp_alloc_type(), _M_map(), _M_map_size(0), _M_start(), _M_finish() { } _Deque_impl(const _Tp_alloc_type& __a) _GLIBCXX_NOEXCEPT : _Tp_alloc_type(__a), _M_map(), _M_map_size(0), _M_start(), _M_finish() { } #if __cplusplus >= 201103L _Deque_impl(_Deque_impl&&) = default; _Deque_impl(_Tp_alloc_type&& __a) noexcept : _Tp_alloc_type(std::move(__a)), _M_map(), _M_map_size(0), _M_start(), _M_finish() { } #endif # 574 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_deque.h" 3 void _M_swap_data(_Deque_impl& __x) _GLIBCXX_NOEXCEPT { using std::swap; swap(this->_M_start, __x._M_start); swap(this->_M_finish, __x._M_finish); swap(this->_M_map, __x._M_map); swap(this->_M_map_size, __x._M_map_size); } }; _Tp_alloc_type& _M_get_Tp_allocator() _GLIBCXX_NOEXCEPT { return *static_cast<_Tp_alloc_type*>(&this->_M_impl); } const _Tp_alloc_type& _M_get_Tp_allocator() const _GLIBCXX_NOEXCEPT { return *static_cast(&this->_M_impl); } _Map_alloc_type _M_get_map_allocator() const _GLIBCXX_NOEXCEPT { return _Map_alloc_type(_M_get_Tp_allocator()); } _Ptr _M_allocate_node() { typedef __gnu_cxx::__alloc_traits<_Tp_alloc_type> _Traits; return _Traits::allocate(_M_impl, __deque_buf_size(sizeof(_Tp))); } void _M_deallocate_node(_Ptr __p) _GLIBCXX_NOEXCEPT { typedef __gnu_cxx::__alloc_traits<_Tp_alloc_type> _Traits; _Traits::deallocate(_M_impl, __p, __deque_buf_size(sizeof(_Tp))); } _Map_pointer _M_allocate_map(size_t __n) { _Map_alloc_type __map_alloc = _M_get_map_allocator(); return _Map_alloc_traits::allocate(__map_alloc, __n); } void _M_deallocate_map(_Map_pointer __p, size_t __n) _GLIBCXX_NOEXCEPT { _Map_alloc_type __map_alloc = _M_get_map_allocator(); _Map_alloc_traits::deallocate(__map_alloc, __p, __n); } protected: void _M_initialize_map(size_t); void _M_create_nodes(_Map_pointer __nstart, _Map_pointer __nfinish); void _M_destroy_nodes(_Map_pointer __nstart, _Map_pointer __nfinish) _GLIBCXX_NOEXCEPT; enum { _S_initial_map_size = 8 }; _Deque_impl _M_impl; #if __cplusplus >= 201103L private: _Deque_impl _M_move_impl() { if (!_M_impl._M_map) return std::move(_M_impl); // Create a copy of the current allocator. _Tp_alloc_type __alloc{_M_get_Tp_allocator()}; // Put that copy in a moved-from state. _Tp_alloc_type __sink __attribute((__unused__)) {std::move(__alloc)}; // Create an empty map that allocates using the moved-from allocator. _Deque_base __empty{__alloc}; __empty._M_initialize_map(0); // Now safe to modify current allocator and perform non-throwing swaps. _Deque_impl __ret{std::move(_M_get_Tp_allocator())}; _M_impl._M_swap_data(__ret); _M_impl._M_swap_data(__empty._M_impl); return __ret; } #endif # 656 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_deque.h" 3 }; template _Deque_base<_Tp, _Alloc>:: ~_Deque_base() _GLIBCXX_NOEXCEPT { if (this->_M_impl._M_map) { _M_destroy_nodes(this->_M_impl._M_start._M_node, this->_M_impl._M_finish._M_node + 1); _M_deallocate_map(this->_M_impl._M_map, this->_M_impl._M_map_size); } } /** * @brief Layout storage. * @param __num_elements The count of T's for which to allocate space * at first. * @return Nothing. * * The initial underlying memory layout is a bit complicated... */ template void _Deque_base<_Tp, _Alloc>:: _M_initialize_map(size_t __num_elements) { const size_t __num_nodes = (__num_elements/ __deque_buf_size(sizeof(_Tp)) + 1); this->_M_impl._M_map_size = std::max((size_t) _S_initial_map_size, size_t(__num_nodes + 2)); this->_M_impl._M_map = _M_allocate_map(this->_M_impl._M_map_size); // For "small" maps (needing less than _M_map_size nodes), allocation // starts in the middle elements and grows outwards. So nstart may be // the beginning of _M_map, but for small maps it may be as far in as // _M_map+3. _Map_pointer __nstart = (this->_M_impl._M_map + (this->_M_impl._M_map_size - __num_nodes) / 2); _Map_pointer __nfinish = __nstart + __num_nodes; __try { _M_create_nodes(__nstart, __nfinish); } __catch(...) { _M_deallocate_map(this->_M_impl._M_map, this->_M_impl._M_map_size); this->_M_impl._M_map = _Map_pointer(); this->_M_impl._M_map_size = 0; __throw_exception_again; } this->_M_impl._M_start._M_set_node(__nstart); this->_M_impl._M_finish._M_set_node(__nfinish - 1); this->_M_impl._M_start._M_cur = _M_impl._M_start._M_first; this->_M_impl._M_finish._M_cur = (this->_M_impl._M_finish._M_first + __num_elements % __deque_buf_size(sizeof(_Tp))); } template void _Deque_base<_Tp, _Alloc>:: _M_create_nodes(_Map_pointer __nstart, _Map_pointer __nfinish) { _Map_pointer __cur; __try { for (__cur = __nstart; __cur < __nfinish; ++__cur) *__cur = this->_M_allocate_node(); } __catch(...) { _M_destroy_nodes(__nstart, __cur); __throw_exception_again; } } template void _Deque_base<_Tp, _Alloc>:: _M_destroy_nodes(_Map_pointer __nstart, _Map_pointer __nfinish) _GLIBCXX_NOEXCEPT { for (_Map_pointer __n = __nstart; __n < __nfinish; ++__n) _M_deallocate_node(*__n); } /** * @brief A standard container using fixed-size memory allocation and * constant-time manipulation of elements at either end. * * @ingroup sequences * * @tparam _Tp Type of element. * @tparam _Alloc Allocator type, defaults to allocator<_Tp>. * * Meets the requirements of a container, a * reversible container, and a * sequence, including the * optional sequence requirements. * * In previous HP/SGI versions of deque, there was an extra template * parameter so users could control the node size. This extension turned * out to violate the C++ standard (it can be detected using template * template parameters), and it was removed. * * Here's how a deque manages memory. Each deque has 4 members: * * - Tp** _M_map * - size_t _M_map_size * - iterator _M_start, _M_finish * * map_size is at least 8. %map is an array of map_size * pointers-to-@a nodes. (The name %map has nothing to do with the * std::map class, and @b nodes should not be confused with * std::list's usage of @a node.) * * A @a node has no specific type name as such, but it is referred * to as @a node in this file. It is a simple array-of-Tp. If Tp * is very large, there will be one Tp element per node (i.e., an * @a array of one). For non-huge Tp's, node size is inversely * related to Tp size: the larger the Tp, the fewer Tp's will fit * in a node. The goal here is to keep the total size of a node * relatively small and constant over different Tp's, to improve * allocator efficiency. * * Not every pointer in the %map array will point to a node. If * the initial number of elements in the deque is small, the * /middle/ %map pointers will be valid, and the ones at the edges * will be unused. This same situation will arise as the %map * grows: available %map pointers, if any, will be on the ends. As * new nodes are created, only a subset of the %map's pointers need * to be copied @a outward. * * Class invariants: * - For any nonsingular iterator i: * - i.node points to a member of the %map array. (Yes, you read that * correctly: i.node does not actually point to a node.) The member of * the %map array is what actually points to the node. * - i.first == *(i.node) (This points to the node (first Tp element).) * - i.last == i.first + node_size * - i.cur is a pointer in the range [i.first, i.last). NOTE: * the implication of this is that i.cur is always a dereferenceable * pointer, even if i is a past-the-end iterator. * - Start and Finish are always nonsingular iterators. NOTE: this * means that an empty deque must have one node, a deque with > class deque : protected _Deque_base<_Tp, _Alloc> { // concept requirements typedef typename _Alloc::value_type _Alloc_value_type; __glibcxx_class_requires(_Tp, _SGIAssignableConcept) __glibcxx_class_requires2(_Tp, _Alloc_value_type, _SameTypeConcept) typedef _Deque_base<_Tp, _Alloc> _Base; typedef typename _Base::_Tp_alloc_type _Tp_alloc_type; typedef typename _Base::_Alloc_traits _Alloc_traits; typedef typename _Base::_Map_pointer _Map_pointer; public: typedef _Tp value_type; typedef typename _Alloc_traits::pointer pointer; typedef typename _Alloc_traits::const_pointer const_pointer; typedef typename _Alloc_traits::reference reference; typedef typename _Alloc_traits::const_reference const_reference; typedef typename _Base::iterator iterator; typedef typename _Base::const_iterator const_iterator; typedef std::reverse_iterator const_reverse_iterator; typedef std::reverse_iterator reverse_iterator; typedef size_t size_type; typedef ptrdiff_t difference_type; typedef _Alloc allocator_type; protected: static size_t _S_buffer_size() _GLIBCXX_NOEXCEPT { return __deque_buf_size(sizeof(_Tp)); } // Functions controlling memory layout, and nothing else. using _Base::_M_initialize_map; using _Base::_M_create_nodes; using _Base::_M_destroy_nodes; using _Base::_M_allocate_node; using _Base::_M_deallocate_node; using _Base::_M_allocate_map; using _Base::_M_deallocate_map; using _Base::_M_get_Tp_allocator; /** * A total of four data members accumulated down the hierarchy. * May be accessed via _M_impl.* */ using _Base::_M_impl; public: // [23.2.1.1] construct/copy/destroy // (assign() and get_allocator() are also listed in this section) /** * @brief Creates a %deque with no elements. */ deque() : _Base() { } /** * @brief Creates a %deque with no elements. * @param __a An allocator object. */ explicit deque(const allocator_type& __a) : _Base(__a, 0) { } #if __cplusplus >= 201103L /** * @brief Creates a %deque with default constructed elements. * @param __n The number of elements to initially create. * * This constructor fills the %deque with @a n default * constructed elements. */ explicit deque(size_type __n, const allocator_type& __a = allocator_type()) : _Base(__a, __n) { _M_default_initialize(); } /** * @brief Creates a %deque with copies of an exemplar element. * @param __n The number of elements to initially create. * @param __value An element to copy. * @param __a An allocator. * * This constructor fills the %deque with @a __n copies of @a __value. */ deque(size_type __n, const value_type& __value, const allocator_type& __a = allocator_type()) : _Base(__a, __n) { _M_fill_initialize(__value); } #else # 919 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_deque.h" 3 /** * @brief Creates a %deque with copies of an exemplar element. * @param __n The number of elements to initially create. * @param __value An element to copy. * @param __a An allocator. * * This constructor fills the %deque with @a __n copies of @a __value. */ explicit deque(size_type __n, const value_type& __value = value_type(), const allocator_type& __a = allocator_type()) : _Base(__a, __n) { _M_fill_initialize(__value); } #endif # 933 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_deque.h" 3 /** * @brief %Deque copy constructor. * @param __x A %deque of identical element and allocator types. * * The newly-created %deque uses a copy of the allocation object used * by @a __x. */ deque(const deque& __x) : _Base(_Alloc_traits::_S_select_on_copy(__x._M_get_Tp_allocator()), __x.size()) { std::__uninitialized_copy_a(__x.begin(), __x.end(), this->_M_impl._M_start, _M_get_Tp_allocator()); } #if __cplusplus >= 201103L /** * @brief %Deque move constructor. * @param __x A %deque of identical element and allocator types. * * The newly-created %deque contains the exact contents of @a __x. * The contents of @a __x are a valid, but unspecified %deque. */ deque(deque&& __x) : _Base(std::move(__x)) { } /// Copy constructor with alternative allocator deque(const deque& __x, const allocator_type& __a) : _Base(__a, __x.size()) { std::__uninitialized_copy_a(__x.begin(), __x.end(), this->_M_impl._M_start, _M_get_Tp_allocator()); } /// Move constructor with alternative allocator deque(deque&& __x, const allocator_type& __a) : _Base(std::move(__x), __a, __x.size()) { if (__x.get_allocator() != __a) { std::__uninitialized_move_a(__x.begin(), __x.end(), this->_M_impl._M_start, _M_get_Tp_allocator()); __x.clear(); } } /** * @brief Builds a %deque from an initializer list. * @param __l An initializer_list. * @param __a An allocator object. * * Create a %deque consisting of copies of the elements in the * initializer_list @a __l. * * This will call the element type's copy constructor N times * (where N is __l.size()) and do no memory reallocation. */ deque(initializer_list __l, const allocator_type& __a = allocator_type()) : _Base(__a) { _M_range_initialize(__l.begin(), __l.end(), random_access_iterator_tag()); } #endif # 998 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_deque.h" 3 /** * @brief Builds a %deque from a range. * @param __first An input iterator. * @param __last An input iterator. * @param __a An allocator object. * * Create a %deque consisting of copies of the elements from [__first, * __last). * * If the iterators are forward, bidirectional, or random-access, then * this will call the elements' copy constructor N times (where N is * distance(__first,__last)) and do no memory reallocation. But if only * input iterators are used, then this will do at most 2N calls to the * copy constructor, and logN memory reallocations. */ #if __cplusplus >= 201103L template> deque(_InputIterator __first, _InputIterator __last, const allocator_type& __a = allocator_type()) : _Base(__a) { _M_initialize_dispatch(__first, __last, __false_type()); } #else # 1022 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_deque.h" 3 template deque(_InputIterator __first, _InputIterator __last, const allocator_type& __a = allocator_type()) : _Base(__a) { // Check whether it's an integral type. If so, it's not an iterator. typedef typename std::__is_integer<_InputIterator>::__type _Integral; _M_initialize_dispatch(__first, __last, _Integral()); } #endif # 1032 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_deque.h" 3 /** * The dtor only erases the elements, and note that if the elements * themselves are pointers, the pointed-to memory is not touched in any * way. Managing the pointer is the user's responsibility. */ ~deque() { _M_destroy_data(begin(), end(), _M_get_Tp_allocator()); } /** * @brief %Deque assignment operator. * @param __x A %deque of identical element and allocator types. * * All the elements of @a x are copied, but unlike the copy constructor, * the allocator object is not copied. */ deque& operator=(const deque& __x); #if __cplusplus >= 201103L /** * @brief %Deque move assignment operator. * @param __x A %deque of identical element and allocator types. * * The contents of @a __x are moved into this deque (without copying, * if the allocators permit it). * @a __x is a valid, but unspecified %deque. */ deque& operator=(deque&& __x) noexcept(_Alloc_traits::_S_always_equal()) { constexpr bool __always_equal = _Alloc_traits::_S_always_equal(); _M_move_assign1(std::move(__x), integral_constant()); return *this; } /** * @brief Assigns an initializer list to a %deque. * @param __l An initializer_list. * * This function fills a %deque with copies of the elements in the * initializer_list @a __l. * * Note that the assignment completely changes the %deque and that the * resulting %deque's size is the same as the number of elements * assigned. Old data may be lost. */ deque& operator=(initializer_list __l) { this->assign(__l.begin(), __l.end()); return *this; } #endif # 1087 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_deque.h" 3 /** * @brief Assigns a given value to a %deque. * @param __n Number of elements to be assigned. * @param __val Value to be assigned. * * This function fills a %deque with @a n copies of the given * value. Note that the assignment completely changes the * %deque and that the resulting %deque's size is the same as * the number of elements assigned. Old data may be lost. */ void assign(size_type __n, const value_type& __val) { _M_fill_assign(__n, __val); } /** * @brief Assigns a range to a %deque. * @param __first An input iterator. * @param __last An input iterator. * * This function fills a %deque with copies of the elements in the * range [__first,__last). * * Note that the assignment completely changes the %deque and that the * resulting %deque's size is the same as the number of elements * assigned. Old data may be lost. */ #if __cplusplus >= 201103L template> void assign(_InputIterator __first, _InputIterator __last) { _M_assign_dispatch(__first, __last, __false_type()); } #else # 1121 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_deque.h" 3 template void assign(_InputIterator __first, _InputIterator __last) { typedef typename std::__is_integer<_InputIterator>::__type _Integral; _M_assign_dispatch(__first, __last, _Integral()); } #endif # 1129 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_deque.h" 3 #if __cplusplus >= 201103L /** * @brief Assigns an initializer list to a %deque. * @param __l An initializer_list. * * This function fills a %deque with copies of the elements in the * initializer_list @a __l. * * Note that the assignment completely changes the %deque and that the * resulting %deque's size is the same as the number of elements * assigned. Old data may be lost. */ void assign(initializer_list __l) { this->assign(__l.begin(), __l.end()); } #endif # 1146 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_deque.h" 3 /// Get a copy of the memory allocation object. allocator_type get_allocator() const _GLIBCXX_NOEXCEPT { return _Base::get_allocator(); } // iterators /** * Returns a read/write iterator that points to the first element in the * %deque. Iteration is done in ordinary element order. */ iterator begin() _GLIBCXX_NOEXCEPT { return this->_M_impl._M_start; } /** * Returns a read-only (constant) iterator that points to the first * element in the %deque. Iteration is done in ordinary element order. */ const_iterator begin() const _GLIBCXX_NOEXCEPT { return this->_M_impl._M_start; } /** * Returns a read/write iterator that points one past the last * element in the %deque. Iteration is done in ordinary * element order. */ iterator end() _GLIBCXX_NOEXCEPT { return this->_M_impl._M_finish; } /** * Returns a read-only (constant) iterator that points one past * the last element in the %deque. Iteration is done in * ordinary element order. */ const_iterator end() const _GLIBCXX_NOEXCEPT { return this->_M_impl._M_finish; } /** * Returns a read/write reverse iterator that points to the * last element in the %deque. Iteration is done in reverse * element order. */ reverse_iterator rbegin() _GLIBCXX_NOEXCEPT { return reverse_iterator(this->_M_impl._M_finish); } /** * Returns a read-only (constant) reverse iterator that points * to the last element in the %deque. Iteration is done in * reverse element order. */ const_reverse_iterator rbegin() const _GLIBCXX_NOEXCEPT { return const_reverse_iterator(this->_M_impl._M_finish); } /** * Returns a read/write reverse iterator that points to one * before the first element in the %deque. Iteration is done * in reverse element order. */ reverse_iterator rend() _GLIBCXX_NOEXCEPT { return reverse_iterator(this->_M_impl._M_start); } /** * Returns a read-only (constant) reverse iterator that points * to one before the first element in the %deque. Iteration is * done in reverse element order. */ const_reverse_iterator rend() const _GLIBCXX_NOEXCEPT { return const_reverse_iterator(this->_M_impl._M_start); } #if __cplusplus >= 201103L /** * Returns a read-only (constant) iterator that points to the first * element in the %deque. Iteration is done in ordinary element order. */ const_iterator cbegin() const noexcept { return this->_M_impl._M_start; } /** * Returns a read-only (constant) iterator that points one past * the last element in the %deque. Iteration is done in * ordinary element order. */ const_iterator cend() const noexcept { return this->_M_impl._M_finish; } /** * Returns a read-only (constant) reverse iterator that points * to the last element in the %deque. Iteration is done in * reverse element order. */ const_reverse_iterator crbegin() const noexcept { return const_reverse_iterator(this->_M_impl._M_finish); } /** * Returns a read-only (constant) reverse iterator that points * to one before the first element in the %deque. Iteration is * done in reverse element order. */ const_reverse_iterator crend() const noexcept { return const_reverse_iterator(this->_M_impl._M_start); } #endif # 1259 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_deque.h" 3 // [23.2.1.2] capacity /** Returns the number of elements in the %deque. */ size_type size() const _GLIBCXX_NOEXCEPT { return this->_M_impl._M_finish - this->_M_impl._M_start; } /** Returns the size() of the largest possible %deque. */ size_type max_size() const _GLIBCXX_NOEXCEPT { return _Alloc_traits::max_size(_M_get_Tp_allocator()); } #if __cplusplus >= 201103L /** * @brief Resizes the %deque to the specified number of elements. * @param __new_size Number of elements the %deque should contain. * * This function will %resize the %deque to the specified * number of elements. If the number is smaller than the * %deque's current size the %deque is truncated, otherwise * default constructed elements are appended. */ void resize(size_type __new_size) { const size_type __len = size(); if (__new_size > __len) _M_default_append(__new_size - __len); else if (__new_size < __len) _M_erase_at_end(this->_M_impl._M_start + difference_type(__new_size)); } /** * @brief Resizes the %deque to the specified number of elements. * @param __new_size Number of elements the %deque should contain. * @param __x Data with which new elements should be populated. * * This function will %resize the %deque to the specified * number of elements. If the number is smaller than the * %deque's current size the %deque is truncated, otherwise the * %deque is extended and new elements are populated with given * data. */ void resize(size_type __new_size, const value_type& __x) { const size_type __len = size(); if (__new_size > __len) insert(this->_M_impl._M_finish, __new_size - __len, __x); else if (__new_size < __len) _M_erase_at_end(this->_M_impl._M_start + difference_type(__new_size)); } #else # 1314 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_deque.h" 3 /** * @brief Resizes the %deque to the specified number of elements. * @param __new_size Number of elements the %deque should contain. * @param __x Data with which new elements should be populated. * * This function will %resize the %deque to the specified * number of elements. If the number is smaller than the * %deque's current size the %deque is truncated, otherwise the * %deque is extended and new elements are populated with given * data. */ void resize(size_type __new_size, value_type __x = value_type()) { const size_type __len = size(); if (__new_size > __len) insert(this->_M_impl._M_finish, __new_size - __len, __x); else if (__new_size < __len) _M_erase_at_end(this->_M_impl._M_start + difference_type(__new_size)); } #endif # 1336 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_deque.h" 3 #if __cplusplus >= 201103L /** A non-binding request to reduce memory use. */ void shrink_to_fit() noexcept { _M_shrink_to_fit(); } #endif # 1343 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_deque.h" 3 /** * Returns true if the %deque is empty. (Thus begin() would * equal end().) */ bool empty() const _GLIBCXX_NOEXCEPT { return this->_M_impl._M_finish == this->_M_impl._M_start; } // element access /** * @brief Subscript access to the data contained in the %deque. * @param __n The index of the element for which data should be * accessed. * @return Read/write reference to data. * * This operator allows for easy, array-style, data access. * Note that data access with this operator is unchecked and * out_of_range lookups are not defined. (For checked lookups * see at().) */ reference operator[](size_type __n) _GLIBCXX_NOEXCEPT { return this->_M_impl._M_start[difference_type(__n)]; } /** * @brief Subscript access to the data contained in the %deque. * @param __n The index of the element for which data should be * accessed. * @return Read-only (constant) reference to data. * * This operator allows for easy, array-style, data access. * Note that data access with this operator is unchecked and * out_of_range lookups are not defined. (For checked lookups * see at().) */ const_reference operator[](size_type __n) const _GLIBCXX_NOEXCEPT { return this->_M_impl._M_start[difference_type(__n)]; } protected: /// Safety check used only from at(). void _M_range_check(size_type __n) const { if (__n >= this->size()) __throw_out_of_range_fmt(__N("deque::_M_range_check: __n " "(which is %zu)>= this->size() " "(which is %zu)"), __n, this->size()); } public: /** * @brief Provides access to the data contained in the %deque. * @param __n The index of the element for which data should be * accessed. * @return Read/write reference to data. * @throw std::out_of_range If @a __n is an invalid index. * * This function provides for safer data access. The parameter * is first checked that it is in the range of the deque. The * function throws out_of_range if the check fails. */ reference at(size_type __n) { _M_range_check(__n); return (*this)[__n]; } /** * @brief Provides access to the data contained in the %deque. * @param __n The index of the element for which data should be * accessed. * @return Read-only (constant) reference to data. * @throw std::out_of_range If @a __n is an invalid index. * * This function provides for safer data access. The parameter is first * checked that it is in the range of the deque. The function throws * out_of_range if the check fails. */ const_reference at(size_type __n) const { _M_range_check(__n); return (*this)[__n]; } /** * Returns a read/write reference to the data at the first * element of the %deque. */ reference front() _GLIBCXX_NOEXCEPT { return *begin(); } /** * Returns a read-only (constant) reference to the data at the first * element of the %deque. */ const_reference front() const _GLIBCXX_NOEXCEPT { return *begin(); } /** * Returns a read/write reference to the data at the last element of the * %deque. */ reference back() _GLIBCXX_NOEXCEPT { iterator __tmp = end(); --__tmp; return *__tmp; } /** * Returns a read-only (constant) reference to the data at the last * element of the %deque. */ const_reference back() const _GLIBCXX_NOEXCEPT { const_iterator __tmp = end(); --__tmp; return *__tmp; } // [23.2.1.2] modifiers /** * @brief Add data to the front of the %deque. * @param __x Data to be added. * * This is a typical stack operation. The function creates an * element at the front of the %deque and assigns the given * data to it. Due to the nature of a %deque this operation * can be done in constant time. */ void push_front(const value_type& __x) { if (this->_M_impl._M_start._M_cur != this->_M_impl._M_start._M_first) { _Alloc_traits::construct(this->_M_impl, this->_M_impl._M_start._M_cur - 1, __x); --this->_M_impl._M_start._M_cur; } else _M_push_front_aux(__x); } #if __cplusplus >= 201103L void push_front(value_type&& __x) { emplace_front(std::move(__x)); } template void emplace_front(_Args&&... __args); #endif # 1505 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_deque.h" 3 /** * @brief Add data to the end of the %deque. * @param __x Data to be added. * * This is a typical stack operation. The function creates an * element at the end of the %deque and assigns the given data * to it. Due to the nature of a %deque this operation can be * done in constant time. */ void push_back(const value_type& __x) { if (this->_M_impl._M_finish._M_cur != this->_M_impl._M_finish._M_last - 1) { _Alloc_traits::construct(this->_M_impl, this->_M_impl._M_finish._M_cur, __x); ++this->_M_impl._M_finish._M_cur; } else _M_push_back_aux(__x); } #if __cplusplus >= 201103L void push_back(value_type&& __x) { emplace_back(std::move(__x)); } template void emplace_back(_Args&&... __args); #endif # 1538 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_deque.h" 3 /** * @brief Removes first element. * * This is a typical stack operation. It shrinks the %deque by one. * * Note that no data is returned, and if the first element's data is * needed, it should be retrieved before pop_front() is called. */ void pop_front() _GLIBCXX_NOEXCEPT { if (this->_M_impl._M_start._M_cur != this->_M_impl._M_start._M_last - 1) { _Alloc_traits::destroy(this->_M_impl, this->_M_impl._M_start._M_cur); ++this->_M_impl._M_start._M_cur; } else _M_pop_front_aux(); } /** * @brief Removes last element. * * This is a typical stack operation. It shrinks the %deque by one. * * Note that no data is returned, and if the last element's data is * needed, it should be retrieved before pop_back() is called. */ void pop_back() _GLIBCXX_NOEXCEPT { if (this->_M_impl._M_finish._M_cur != this->_M_impl._M_finish._M_first) { --this->_M_impl._M_finish._M_cur; _Alloc_traits::destroy(this->_M_impl, this->_M_impl._M_finish._M_cur); } else _M_pop_back_aux(); } #if __cplusplus >= 201103L /** * @brief Inserts an object in %deque before specified iterator. * @param __position A const_iterator into the %deque. * @param __args Arguments. * @return An iterator that points to the inserted data. * * This function will insert an object of type T constructed * with T(std::forward(args)...) before the specified location. */ template iterator emplace(const_iterator __position, _Args&&... __args); /** * @brief Inserts given value into %deque before specified iterator. * @param __position A const_iterator into the %deque. * @param __x Data to be inserted. * @return An iterator that points to the inserted data. * * This function will insert a copy of the given value before the * specified location. */ iterator insert(const_iterator __position, const value_type& __x); #else # 1609 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_deque.h" 3 /** * @brief Inserts given value into %deque before specified iterator. * @param __position An iterator into the %deque. * @param __x Data to be inserted. * @return An iterator that points to the inserted data. * * This function will insert a copy of the given value before the * specified location. */ iterator insert(iterator __position, const value_type& __x); #endif # 1621 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_deque.h" 3 #if __cplusplus >= 201103L /** * @brief Inserts given rvalue into %deque before specified iterator. * @param __position A const_iterator into the %deque. * @param __x Data to be inserted. * @return An iterator that points to the inserted data. * * This function will insert a copy of the given rvalue before the * specified location. */ iterator insert(const_iterator __position, value_type&& __x) { return emplace(__position, std::move(__x)); } /** * @brief Inserts an initializer list into the %deque. * @param __p An iterator into the %deque. * @param __l An initializer_list. * * This function will insert copies of the data in the * initializer_list @a __l into the %deque before the location * specified by @a __p. This is known as list insert. */ iterator insert(const_iterator __p, initializer_list __l) { return this->insert(__p, __l.begin(), __l.end()); } #endif # 1649 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_deque.h" 3 #if __cplusplus >= 201103L /** * @brief Inserts a number of copies of given data into the %deque. * @param __position A const_iterator into the %deque. * @param __n Number of elements to be inserted. * @param __x Data to be inserted. * @return An iterator that points to the inserted data. * * This function will insert a specified number of copies of the given * data before the location specified by @a __position. */ iterator insert(const_iterator __position, size_type __n, const value_type& __x) { difference_type __offset = __position - cbegin(); _M_fill_insert(__position._M_const_cast(), __n, __x); return begin() + __offset; } #else # 1669 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_deque.h" 3 /** * @brief Inserts a number of copies of given data into the %deque. * @param __position An iterator into the %deque. * @param __n Number of elements to be inserted. * @param __x Data to be inserted. * * This function will insert a specified number of copies of the given * data before the location specified by @a __position. */ void insert(iterator __position, size_type __n, const value_type& __x) { _M_fill_insert(__position, __n, __x); } #endif # 1682 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_deque.h" 3 #if __cplusplus >= 201103L /** * @brief Inserts a range into the %deque. * @param __position A const_iterator into the %deque. * @param __first An input iterator. * @param __last An input iterator. * @return An iterator that points to the inserted data. * * This function will insert copies of the data in the range * [__first,__last) into the %deque before the location specified * by @a __position. This is known as range insert. */ template> iterator insert(const_iterator __position, _InputIterator __first, _InputIterator __last) { difference_type __offset = __position - cbegin(); _M_insert_dispatch(__position._M_const_cast(), __first, __last, __false_type()); return begin() + __offset; } #else # 1707 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_deque.h" 3 /** * @brief Inserts a range into the %deque. * @param __position An iterator into the %deque. * @param __first An input iterator. * @param __last An input iterator. * * This function will insert copies of the data in the range * [__first,__last) into the %deque before the location specified * by @a __position. This is known as range insert. */ template void insert(iterator __position, _InputIterator __first, _InputIterator __last) { // Check whether it's an integral type. If so, it's not an iterator. typedef typename std::__is_integer<_InputIterator>::__type _Integral; _M_insert_dispatch(__position, __first, __last, _Integral()); } #endif # 1727 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_deque.h" 3 /** * @brief Remove element at given position. * @param __position Iterator pointing to element to be erased. * @return An iterator pointing to the next element (or end()). * * This function will erase the element at the given position and thus * shorten the %deque by one. * * The user is cautioned that * this function only erases the element, and that if the element is * itself a pointer, the pointed-to memory is not touched in any way. * Managing the pointer is the user's responsibility. */ iterator #if __cplusplus >= 201103L erase(const_iterator __position) #else # 1745 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_deque.h" 3 erase(iterator __position) #endif # 1747 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_deque.h" 3 { return _M_erase(__position._M_const_cast()); } /** * @brief Remove a range of elements. * @param __first Iterator pointing to the first element to be erased. * @param __last Iterator pointing to one past the last element to be * erased. * @return An iterator pointing to the element pointed to by @a last * prior to erasing (or end()). * * This function will erase the elements in the range * [__first,__last) and shorten the %deque accordingly. * * The user is cautioned that * this function only erases the elements, and that if the elements * themselves are pointers, the pointed-to memory is not touched in any * way. Managing the pointer is the user's responsibility. */ iterator #if __cplusplus >= 201103L erase(const_iterator __first, const_iterator __last) #else # 1769 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_deque.h" 3 erase(iterator __first, iterator __last) #endif # 1771 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_deque.h" 3 { return _M_erase(__first._M_const_cast(), __last._M_const_cast()); } /** * @brief Swaps data with another %deque. * @param __x A %deque of the same element and allocator types. * * This exchanges the elements between two deques in constant time. * (Four pointers, so it should be quite fast.) * Note that the global std::swap() function is specialized such that * std::swap(d1,d2) will feed to this function. */ void swap(deque& __x) #if __cplusplus >= 201103L noexcept(_Alloc_traits::_S_nothrow_swap()) #endif # 1787 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_deque.h" 3 { _M_impl._M_swap_data(__x._M_impl); _Alloc_traits::_S_on_swap(_M_get_Tp_allocator(), __x._M_get_Tp_allocator()); } /** * Erases all the elements. Note that this function only erases the * elements, and that if the elements themselves are pointers, the * pointed-to memory is not touched in any way. Managing the pointer is * the user's responsibility. */ void clear() _GLIBCXX_NOEXCEPT { _M_erase_at_end(begin()); } protected: // Internal constructor functions follow. // called by the range constructor to implement [23.1.1]/9 // _GLIBCXX_RESOLVE_LIB_DEFECTS // 438. Ambiguity in the "do the right thing" clause template void _M_initialize_dispatch(_Integer __n, _Integer __x, __true_type) { _M_initialize_map(static_cast(__n)); _M_fill_initialize(__x); } // called by the range constructor to implement [23.1.1]/9 template void _M_initialize_dispatch(_InputIterator __first, _InputIterator __last, __false_type) { typedef typename std::iterator_traits<_InputIterator>:: iterator_category _IterCategory; _M_range_initialize(__first, __last, _IterCategory()); } // called by the second initialize_dispatch above //@{ /** * @brief Fills the deque with whatever is in [first,last). * @param __first An input iterator. * @param __last An input iterator. * @return Nothing. * * If the iterators are actually forward iterators (or better), then the * memory layout can be done all at once. Else we move forward using * push_back on each value from the iterator. */ template void _M_range_initialize(_InputIterator __first, _InputIterator __last, std::input_iterator_tag); // called by the second initialize_dispatch above template void _M_range_initialize(_ForwardIterator __first, _ForwardIterator __last, std::forward_iterator_tag); //@} /** * @brief Fills the %deque with copies of value. * @param __value Initial value. * @return Nothing. * @pre _M_start and _M_finish have already been initialized, * but none of the %deque's elements have yet been constructed. * * This function is called only when the user provides an explicit size * (with or without an explicit exemplar value). */ void _M_fill_initialize(const value_type& __value); #if __cplusplus >= 201103L // called by deque(n). void _M_default_initialize(); #endif # 1871 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_deque.h" 3 // Internal assign functions follow. The *_aux functions do the actual // assignment work for the range versions. // called by the range assign to implement [23.1.1]/9 // _GLIBCXX_RESOLVE_LIB_DEFECTS // 438. Ambiguity in the "do the right thing" clause template void _M_assign_dispatch(_Integer __n, _Integer __val, __true_type) { _M_fill_assign(__n, __val); } // called by the range assign to implement [23.1.1]/9 template void _M_assign_dispatch(_InputIterator __first, _InputIterator __last, __false_type) { typedef typename std::iterator_traits<_InputIterator>:: iterator_category _IterCategory; _M_assign_aux(__first, __last, _IterCategory()); } // called by the second assign_dispatch above template void _M_assign_aux(_InputIterator __first, _InputIterator __last, std::input_iterator_tag); // called by the second assign_dispatch above template void _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last, std::forward_iterator_tag) { const size_type __len = std::distance(__first, __last); if (__len > size()) { _ForwardIterator __mid = __first; std::advance(__mid, size()); std::copy(__first, __mid, begin()); insert(end(), __mid, __last); } else _M_erase_at_end(std::copy(__first, __last, begin())); } // Called by assign(n,t), and the range assign when it turns out // to be the same thing. void _M_fill_assign(size_type __n, const value_type& __val) { if (__n > size()) { std::fill(begin(), end(), __val); insert(end(), __n - size(), __val); } else { _M_erase_at_end(begin() + difference_type(__n)); std::fill(begin(), end(), __val); } } //@{ /// Helper functions for push_* and pop_*. #if __cplusplus < 201103L void _M_push_back_aux(const value_type&); void _M_push_front_aux(const value_type&); #else # 1943 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_deque.h" 3 template void _M_push_back_aux(_Args&&... __args); template void _M_push_front_aux(_Args&&... __args); #endif # 1949 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_deque.h" 3 void _M_pop_back_aux(); void _M_pop_front_aux(); //@} // Internal insert functions follow. The *_aux functions do the actual // insertion work when all shortcuts fail. // called by the range insert to implement [23.1.1]/9 // _GLIBCXX_RESOLVE_LIB_DEFECTS // 438. Ambiguity in the "do the right thing" clause template void _M_insert_dispatch(iterator __pos, _Integer __n, _Integer __x, __true_type) { _M_fill_insert(__pos, __n, __x); } // called by the range insert to implement [23.1.1]/9 template void _M_insert_dispatch(iterator __pos, _InputIterator __first, _InputIterator __last, __false_type) { typedef typename std::iterator_traits<_InputIterator>:: iterator_category _IterCategory; _M_range_insert_aux(__pos, __first, __last, _IterCategory()); } // called by the second insert_dispatch above template void _M_range_insert_aux(iterator __pos, _InputIterator __first, _InputIterator __last, std::input_iterator_tag); // called by the second insert_dispatch above template void _M_range_insert_aux(iterator __pos, _ForwardIterator __first, _ForwardIterator __last, std::forward_iterator_tag); // Called by insert(p,n,x), and the range insert when it turns out to be // the same thing. Can use fill functions in optimal situations, // otherwise passes off to insert_aux(p,n,x). void _M_fill_insert(iterator __pos, size_type __n, const value_type& __x); // called by insert(p,x) #if __cplusplus < 201103L iterator _M_insert_aux(iterator __pos, const value_type& __x); #else # 2003 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_deque.h" 3 template iterator _M_insert_aux(iterator __pos, _Args&&... __args); #endif # 2007 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_deque.h" 3 // called by insert(p,n,x) via fill_insert void _M_insert_aux(iterator __pos, size_type __n, const value_type& __x); // called by range_insert_aux for forward iterators template void _M_insert_aux(iterator __pos, _ForwardIterator __first, _ForwardIterator __last, size_type __n); // Internal erase functions follow. void _M_destroy_data_aux(iterator __first, iterator __last); // Called by ~deque(). // NB: Doesn't deallocate the nodes. template void _M_destroy_data(iterator __first, iterator __last, const _Alloc1&) { _M_destroy_data_aux(__first, __last); } void _M_destroy_data(iterator __first, iterator __last, const std::allocator<_Tp>&) { if (!__has_trivial_destructor(value_type)) _M_destroy_data_aux(__first, __last); } // Called by erase(q1, q2). void _M_erase_at_begin(iterator __pos) { _M_destroy_data(begin(), __pos, _M_get_Tp_allocator()); _M_destroy_nodes(this->_M_impl._M_start._M_node, __pos._M_node); this->_M_impl._M_start = __pos; } // Called by erase(q1, q2), resize(), clear(), _M_assign_aux, // _M_fill_assign, operator=. void _M_erase_at_end(iterator __pos) { _M_destroy_data(__pos, end(), _M_get_Tp_allocator()); _M_destroy_nodes(__pos._M_node + 1, this->_M_impl._M_finish._M_node + 1); this->_M_impl._M_finish = __pos; } iterator _M_erase(iterator __pos); iterator _M_erase(iterator __first, iterator __last); #if __cplusplus >= 201103L // Called by resize(sz). void _M_default_append(size_type __n); bool _M_shrink_to_fit(); #endif # 2074 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_deque.h" 3 //@{ /// Memory-handling helpers for the previous internal insert functions. iterator _M_reserve_elements_at_front(size_type __n) { const size_type __vacancies = this->_M_impl._M_start._M_cur - this->_M_impl._M_start._M_first; if (__n > __vacancies) _M_new_elements_at_front(__n - __vacancies); return this->_M_impl._M_start - difference_type(__n); } iterator _M_reserve_elements_at_back(size_type __n) { const size_type __vacancies = (this->_M_impl._M_finish._M_last - this->_M_impl._M_finish._M_cur) - 1; if (__n > __vacancies) _M_new_elements_at_back(__n - __vacancies); return this->_M_impl._M_finish + difference_type(__n); } void _M_new_elements_at_front(size_type __new_elements); void _M_new_elements_at_back(size_type __new_elements); //@} //@{ /** * @brief Memory-handling helpers for the major %map. * * Makes sure the _M_map has space for new nodes. Does not * actually add the nodes. Can invalidate _M_map pointers. * (And consequently, %deque iterators.) */ void _M_reserve_map_at_back(size_type __nodes_to_add = 1) { if (__nodes_to_add + 1 > this->_M_impl._M_map_size - (this->_M_impl._M_finish._M_node - this->_M_impl._M_map)) _M_reallocate_map(__nodes_to_add, false); } void _M_reserve_map_at_front(size_type __nodes_to_add = 1) { if (__nodes_to_add > size_type(this->_M_impl._M_start._M_node - this->_M_impl._M_map)) _M_reallocate_map(__nodes_to_add, true); } void _M_reallocate_map(size_type __nodes_to_add, bool __add_at_front); //@} #if __cplusplus >= 201103L // Constant-time, nothrow move assignment when source object's memory // can be moved because the allocators are equal. void _M_move_assign1(deque&& __x, /* always equal: */ true_type) noexcept { this->_M_impl._M_swap_data(__x._M_impl); __x.clear(); std::__alloc_on_move(_M_get_Tp_allocator(), __x._M_get_Tp_allocator()); } void _M_move_assign1(deque&& __x, /* always equal: */ false_type) { constexpr bool __move_storage = _Alloc_traits::_S_propagate_on_move_assign(); _M_move_assign2(std::move(__x), integral_constant()); } // Destroy all elements and deallocate all memory, then replace // with elements created from __args. template void _M_replace_map(_Args&&... __args) { // Create new data first, so if allocation fails there are no effects. deque __newobj(std::forward<_Args>(__args)...); // Free existing storage using existing allocator. clear(); _M_deallocate_node(*begin()._M_node); // one node left after clear() _M_deallocate_map(this->_M_impl._M_map, this->_M_impl._M_map_size); this->_M_impl._M_map = nullptr; this->_M_impl._M_map_size = 0; // Take ownership of replacement memory. this->_M_impl._M_swap_data(__newobj._M_impl); } // Do move assignment when the allocator propagates. void _M_move_assign2(deque&& __x, /* propagate: */ true_type) { // Make a copy of the original allocator state. auto __alloc = __x._M_get_Tp_allocator(); // The allocator propagates so storage can be moved from __x, // leaving __x in a valid empty state with a moved-from allocator. _M_replace_map(std::move(__x)); // Move the corresponding allocator state too. _M_get_Tp_allocator() = std::move(__alloc); } // Do move assignment when it may not be possible to move source // object's memory, resulting in a linear-time operation. void _M_move_assign2(deque&& __x, /* propagate: */ false_type) { if (__x._M_get_Tp_allocator() == this->_M_get_Tp_allocator()) { // The allocators are equal so storage can be moved from __x, // leaving __x in a valid empty state with its current allocator. _M_replace_map(std::move(__x), __x.get_allocator()); } else { // The rvalue's allocator cannot be moved and is not equal, // so we need to individually move each element. this->assign(std::__make_move_if_noexcept_iterator(__x.begin()), std::__make_move_if_noexcept_iterator(__x.end())); __x.clear(); } } #endif # 2205 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_deque.h" 3 }; /** * @brief Deque equality comparison. * @param __x A %deque. * @param __y A %deque of the same type as @a __x. * @return True iff the size and elements of the deques are equal. * * This is an equivalence relation. It is linear in the size of the * deques. Deques are considered equivalent if their sizes are equal, * and if corresponding elements compare equal. */ template inline bool operator==(const deque<_Tp, _Alloc>& __x, const deque<_Tp, _Alloc>& __y) { return __x.size() == __y.size() && std::equal(__x.begin(), __x.end(), __y.begin()); } /** * @brief Deque ordering relation. * @param __x A %deque. * @param __y A %deque of the same type as @a __x. * @return True iff @a x is lexicographically less than @a __y. * * This is a total ordering relation. It is linear in the size of the * deques. The elements must be comparable with @c <. * * See std::lexicographical_compare() for how the determination is made. */ template inline bool operator<(const deque<_Tp, _Alloc>& __x, const deque<_Tp, _Alloc>& __y) { return std::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end()); } /// Based on operator== template inline bool operator!=(const deque<_Tp, _Alloc>& __x, const deque<_Tp, _Alloc>& __y) { return !(__x == __y); } /// Based on operator< template inline bool operator>(const deque<_Tp, _Alloc>& __x, const deque<_Tp, _Alloc>& __y) { return __y < __x; } /// Based on operator< template inline bool operator<=(const deque<_Tp, _Alloc>& __x, const deque<_Tp, _Alloc>& __y) { return !(__y < __x); } /// Based on operator< template inline bool operator>=(const deque<_Tp, _Alloc>& __x, const deque<_Tp, _Alloc>& __y) { return !(__x < __y); } /// See std::deque::swap(). template inline void swap(deque<_Tp,_Alloc>& __x, deque<_Tp,_Alloc>& __y) { __x.swap(__y); } #undef _GLIBCXX_DEQUE_BUF_SIZE _GLIBCXX_END_NAMESPACE_CONTAINER } // namespace std #endif /* _STL_DEQUE_H */ # 2283 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_deque.h" 3 # 65 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/deque" 2 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 65 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/deque" 3 # 66 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/deque" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 66 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/deque" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/deque.tcc" 1 3 // Deque implementation (out of line) -*- C++ -*- // Copyright (C) 2001-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /* * * Copyright (c) 1994 * Hewlett-Packard Company * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Hewlett-Packard Company makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. * * * Copyright (c) 1997 * Silicon Graphics Computer Systems, Inc. * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Silicon Graphics makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. */ /** @file bits/deque.tcc * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{deque} */ #ifndef _DEQUE_TCC #define _DEQUE_TCC 1 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_CONTAINER #if __cplusplus >= 201103L template void deque<_Tp, _Alloc>:: _M_default_initialize() { _Map_pointer __cur; __try { for (__cur = this->_M_impl._M_start._M_node; __cur < this->_M_impl._M_finish._M_node; ++__cur) std::__uninitialized_default_a(*__cur, *__cur + _S_buffer_size(), _M_get_Tp_allocator()); std::__uninitialized_default_a(this->_M_impl._M_finish._M_first, this->_M_impl._M_finish._M_cur, _M_get_Tp_allocator()); } __catch(...) { std::_Destroy(this->_M_impl._M_start, iterator(*__cur, __cur), _M_get_Tp_allocator()); __throw_exception_again; } } #endif # 89 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/deque.tcc" 3 template deque<_Tp, _Alloc>& deque<_Tp, _Alloc>:: operator=(const deque& __x) { if (&__x != this) { #if __cplusplus >= 201103L if (_Alloc_traits::_S_propagate_on_copy_assign()) { if (!_Alloc_traits::_S_always_equal() && _M_get_Tp_allocator() != __x._M_get_Tp_allocator()) { // Replacement allocator cannot free existing storage, // so deallocate everything and take copy of __x's data. _M_replace_map(__x, __x.get_allocator()); std::__alloc_on_copy(_M_get_Tp_allocator(), __x._M_get_Tp_allocator()); return *this; } std::__alloc_on_copy(_M_get_Tp_allocator(), __x._M_get_Tp_allocator()); } #endif # 114 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/deque.tcc" 3 const size_type __len = size(); if (__len >= __x.size()) _M_erase_at_end(std::copy(__x.begin(), __x.end(), this->_M_impl._M_start)); else { const_iterator __mid = __x.begin() + difference_type(__len); std::copy(__x.begin(), __mid, this->_M_impl._M_start); insert(this->_M_impl._M_finish, __mid, __x.end()); } } return *this; } #if __cplusplus >= 201103L template template void deque<_Tp, _Alloc>:: emplace_front(_Args&&... __args) { if (this->_M_impl._M_start._M_cur != this->_M_impl._M_start._M_first) { _Alloc_traits::construct(this->_M_impl, this->_M_impl._M_start._M_cur - 1, std::forward<_Args>(__args)...); --this->_M_impl._M_start._M_cur; } else _M_push_front_aux(std::forward<_Args>(__args)...); } template template void deque<_Tp, _Alloc>:: emplace_back(_Args&&... __args) { if (this->_M_impl._M_finish._M_cur != this->_M_impl._M_finish._M_last - 1) { _Alloc_traits::construct(this->_M_impl, this->_M_impl._M_finish._M_cur, std::forward<_Args>(__args)...); ++this->_M_impl._M_finish._M_cur; } else _M_push_back_aux(std::forward<_Args>(__args)...); } #endif # 164 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/deque.tcc" 3 #if __cplusplus >= 201103L template template typename deque<_Tp, _Alloc>::iterator deque<_Tp, _Alloc>:: emplace(const_iterator __position, _Args&&... __args) { if (__position._M_cur == this->_M_impl._M_start._M_cur) { emplace_front(std::forward<_Args>(__args)...); return this->_M_impl._M_start; } else if (__position._M_cur == this->_M_impl._M_finish._M_cur) { emplace_back(std::forward<_Args>(__args)...); iterator __tmp = this->_M_impl._M_finish; --__tmp; return __tmp; } else return _M_insert_aux(__position._M_const_cast(), std::forward<_Args>(__args)...); } #endif # 189 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/deque.tcc" 3 template typename deque<_Tp, _Alloc>::iterator deque<_Tp, _Alloc>:: #if __cplusplus >= 201103L insert(const_iterator __position, const value_type& __x) #else # 196 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/deque.tcc" 3 insert(iterator __position, const value_type& __x) #endif # 198 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/deque.tcc" 3 { if (__position._M_cur == this->_M_impl._M_start._M_cur) { push_front(__x); return this->_M_impl._M_start; } else if (__position._M_cur == this->_M_impl._M_finish._M_cur) { push_back(__x); iterator __tmp = this->_M_impl._M_finish; --__tmp; return __tmp; } else return _M_insert_aux(__position._M_const_cast(), __x); } template typename deque<_Tp, _Alloc>::iterator deque<_Tp, _Alloc>:: _M_erase(iterator __position) { iterator __next = __position; ++__next; const difference_type __index = __position - begin(); if (static_cast(__index) < (size() >> 1)) { if (__position != begin()) _GLIBCXX_MOVE_BACKWARD3(begin(), __position, __next); pop_front(); } else { if (__next != end()) _GLIBCXX_MOVE3(__next, end(), __position); pop_back(); } return begin() + __index; } template typename deque<_Tp, _Alloc>::iterator deque<_Tp, _Alloc>:: _M_erase(iterator __first, iterator __last) { if (__first == __last) return __first; else if (__first == begin() && __last == end()) { clear(); return end(); } else { const difference_type __n = __last - __first; const difference_type __elems_before = __first - begin(); if (static_cast(__elems_before) <= (size() - __n) / 2) { if (__first != begin()) _GLIBCXX_MOVE_BACKWARD3(begin(), __first, __last); _M_erase_at_begin(begin() + __n); } else { if (__last != end()) _GLIBCXX_MOVE3(__last, end(), __first); _M_erase_at_end(end() - __n); } return begin() + __elems_before; } } template template void deque<_Tp, _Alloc>:: _M_assign_aux(_InputIterator __first, _InputIterator __last, std::input_iterator_tag) { iterator __cur = begin(); for (; __first != __last && __cur != end(); ++__cur, ++__first) *__cur = *__first; if (__first == __last) _M_erase_at_end(__cur); else insert(end(), __first, __last); } template void deque<_Tp, _Alloc>:: _M_fill_insert(iterator __pos, size_type __n, const value_type& __x) { if (__pos._M_cur == this->_M_impl._M_start._M_cur) { iterator __new_start = _M_reserve_elements_at_front(__n); __try { std::__uninitialized_fill_a(__new_start, this->_M_impl._M_start, __x, _M_get_Tp_allocator()); this->_M_impl._M_start = __new_start; } __catch(...) { _M_destroy_nodes(__new_start._M_node, this->_M_impl._M_start._M_node); __throw_exception_again; } } else if (__pos._M_cur == this->_M_impl._M_finish._M_cur) { iterator __new_finish = _M_reserve_elements_at_back(__n); __try { std::__uninitialized_fill_a(this->_M_impl._M_finish, __new_finish, __x, _M_get_Tp_allocator()); this->_M_impl._M_finish = __new_finish; } __catch(...) { _M_destroy_nodes(this->_M_impl._M_finish._M_node + 1, __new_finish._M_node + 1); __throw_exception_again; } } else _M_insert_aux(__pos, __n, __x); } #if __cplusplus >= 201103L template void deque<_Tp, _Alloc>:: _M_default_append(size_type __n) { if (__n) { iterator __new_finish = _M_reserve_elements_at_back(__n); __try { std::__uninitialized_default_a(this->_M_impl._M_finish, __new_finish, _M_get_Tp_allocator()); this->_M_impl._M_finish = __new_finish; } __catch(...) { _M_destroy_nodes(this->_M_impl._M_finish._M_node + 1, __new_finish._M_node + 1); __throw_exception_again; } } } template bool deque<_Tp, _Alloc>:: _M_shrink_to_fit() { const difference_type __front_capacity = (this->_M_impl._M_start._M_cur - this->_M_impl._M_start._M_first); if (__front_capacity == 0) return false; const difference_type __back_capacity = (this->_M_impl._M_finish._M_last - this->_M_impl._M_finish._M_cur); if (__front_capacity + __back_capacity < _S_buffer_size()) return false; return std::__shrink_to_fit_aux::_S_do_it(*this); } #endif # 371 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/deque.tcc" 3 template void deque<_Tp, _Alloc>:: _M_fill_initialize(const value_type& __value) { _Map_pointer __cur; __try { for (__cur = this->_M_impl._M_start._M_node; __cur < this->_M_impl._M_finish._M_node; ++__cur) std::__uninitialized_fill_a(*__cur, *__cur + _S_buffer_size(), __value, _M_get_Tp_allocator()); std::__uninitialized_fill_a(this->_M_impl._M_finish._M_first, this->_M_impl._M_finish._M_cur, __value, _M_get_Tp_allocator()); } __catch(...) { std::_Destroy(this->_M_impl._M_start, iterator(*__cur, __cur), _M_get_Tp_allocator()); __throw_exception_again; } } template template void deque<_Tp, _Alloc>:: _M_range_initialize(_InputIterator __first, _InputIterator __last, std::input_iterator_tag) { this->_M_initialize_map(0); __try { for (; __first != __last; ++__first) #if __cplusplus >= 201103L emplace_back(*__first); #else # 411 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/deque.tcc" 3 push_back(*__first); #endif # 413 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/deque.tcc" 3 } __catch(...) { clear(); __throw_exception_again; } } template template void deque<_Tp, _Alloc>:: _M_range_initialize(_ForwardIterator __first, _ForwardIterator __last, std::forward_iterator_tag) { const size_type __n = std::distance(__first, __last); this->_M_initialize_map(__n); _Map_pointer __cur_node; __try { for (__cur_node = this->_M_impl._M_start._M_node; __cur_node < this->_M_impl._M_finish._M_node; ++__cur_node) { _ForwardIterator __mid = __first; std::advance(__mid, _S_buffer_size()); std::__uninitialized_copy_a(__first, __mid, *__cur_node, _M_get_Tp_allocator()); __first = __mid; } std::__uninitialized_copy_a(__first, __last, this->_M_impl._M_finish._M_first, _M_get_Tp_allocator()); } __catch(...) { std::_Destroy(this->_M_impl._M_start, iterator(*__cur_node, __cur_node), _M_get_Tp_allocator()); __throw_exception_again; } } // Called only if _M_impl._M_finish._M_cur == _M_impl._M_finish._M_last - 1. template #if __cplusplus >= 201103L template void deque<_Tp, _Alloc>:: _M_push_back_aux(_Args&&... __args) #else # 465 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/deque.tcc" 3 void deque<_Tp, _Alloc>:: _M_push_back_aux(const value_type& __t) #endif # 469 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/deque.tcc" 3 { _M_reserve_map_at_back(); *(this->_M_impl._M_finish._M_node + 1) = this->_M_allocate_node(); __try { #if __cplusplus >= 201103L _Alloc_traits::construct(this->_M_impl, this->_M_impl._M_finish._M_cur, std::forward<_Args>(__args)...); #else # 479 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/deque.tcc" 3 this->_M_impl.construct(this->_M_impl._M_finish._M_cur, __t); #endif # 481 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/deque.tcc" 3 this->_M_impl._M_finish._M_set_node(this->_M_impl._M_finish._M_node + 1); this->_M_impl._M_finish._M_cur = this->_M_impl._M_finish._M_first; } __catch(...) { _M_deallocate_node(*(this->_M_impl._M_finish._M_node + 1)); __throw_exception_again; } } // Called only if _M_impl._M_start._M_cur == _M_impl._M_start._M_first. template #if __cplusplus >= 201103L template void deque<_Tp, _Alloc>:: _M_push_front_aux(_Args&&... __args) #else # 500 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/deque.tcc" 3 void deque<_Tp, _Alloc>:: _M_push_front_aux(const value_type& __t) #endif # 504 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/deque.tcc" 3 { _M_reserve_map_at_front(); *(this->_M_impl._M_start._M_node - 1) = this->_M_allocate_node(); __try { this->_M_impl._M_start._M_set_node(this->_M_impl._M_start._M_node - 1); this->_M_impl._M_start._M_cur = this->_M_impl._M_start._M_last - 1; #if __cplusplus >= 201103L _Alloc_traits::construct(this->_M_impl, this->_M_impl._M_start._M_cur, std::forward<_Args>(__args)...); #else # 517 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/deque.tcc" 3 this->_M_impl.construct(this->_M_impl._M_start._M_cur, __t); #endif # 519 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/deque.tcc" 3 } __catch(...) { ++this->_M_impl._M_start; _M_deallocate_node(*(this->_M_impl._M_start._M_node - 1)); __throw_exception_again; } } // Called only if _M_impl._M_finish._M_cur == _M_impl._M_finish._M_first. template void deque<_Tp, _Alloc>:: _M_pop_back_aux() { _M_deallocate_node(this->_M_impl._M_finish._M_first); this->_M_impl._M_finish._M_set_node(this->_M_impl._M_finish._M_node - 1); this->_M_impl._M_finish._M_cur = this->_M_impl._M_finish._M_last - 1; _Alloc_traits::destroy(_M_get_Tp_allocator(), this->_M_impl._M_finish._M_cur); } // Called only if _M_impl._M_start._M_cur == _M_impl._M_start._M_last - 1. // Note that if the deque has at least one element (a precondition for this // member function), and if // _M_impl._M_start._M_cur == _M_impl._M_start._M_last, // then the deque must have at least two nodes. template void deque<_Tp, _Alloc>:: _M_pop_front_aux() { _Alloc_traits::destroy(_M_get_Tp_allocator(), this->_M_impl._M_start._M_cur); _M_deallocate_node(this->_M_impl._M_start._M_first); this->_M_impl._M_start._M_set_node(this->_M_impl._M_start._M_node + 1); this->_M_impl._M_start._M_cur = this->_M_impl._M_start._M_first; } template template void deque<_Tp, _Alloc>:: _M_range_insert_aux(iterator __pos, _InputIterator __first, _InputIterator __last, std::input_iterator_tag) { std::copy(__first, __last, std::inserter(*this, __pos)); } template template void deque<_Tp, _Alloc>:: _M_range_insert_aux(iterator __pos, _ForwardIterator __first, _ForwardIterator __last, std::forward_iterator_tag) { const size_type __n = std::distance(__first, __last); if (__pos._M_cur == this->_M_impl._M_start._M_cur) { iterator __new_start = _M_reserve_elements_at_front(__n); __try { std::__uninitialized_copy_a(__first, __last, __new_start, _M_get_Tp_allocator()); this->_M_impl._M_start = __new_start; } __catch(...) { _M_destroy_nodes(__new_start._M_node, this->_M_impl._M_start._M_node); __throw_exception_again; } } else if (__pos._M_cur == this->_M_impl._M_finish._M_cur) { iterator __new_finish = _M_reserve_elements_at_back(__n); __try { std::__uninitialized_copy_a(__first, __last, this->_M_impl._M_finish, _M_get_Tp_allocator()); this->_M_impl._M_finish = __new_finish; } __catch(...) { _M_destroy_nodes(this->_M_impl._M_finish._M_node + 1, __new_finish._M_node + 1); __throw_exception_again; } } else _M_insert_aux(__pos, __first, __last, __n); } template #if __cplusplus >= 201103L template typename deque<_Tp, _Alloc>::iterator deque<_Tp, _Alloc>:: _M_insert_aux(iterator __pos, _Args&&... __args) { value_type __x_copy(std::forward<_Args>(__args)...); // XXX copy #else # 620 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/deque.tcc" 3 typename deque<_Tp, _Alloc>::iterator deque<_Tp, _Alloc>:: _M_insert_aux(iterator __pos, const value_type& __x) { value_type __x_copy = __x; // XXX copy #endif # 626 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/deque.tcc" 3 difference_type __index = __pos - this->_M_impl._M_start; if (static_cast(__index) < size() / 2) { push_front(_GLIBCXX_MOVE(front())); iterator __front1 = this->_M_impl._M_start; ++__front1; iterator __front2 = __front1; ++__front2; __pos = this->_M_impl._M_start + __index; iterator __pos1 = __pos; ++__pos1; _GLIBCXX_MOVE3(__front2, __pos1, __front1); } else { push_back(_GLIBCXX_MOVE(back())); iterator __back1 = this->_M_impl._M_finish; --__back1; iterator __back2 = __back1; --__back2; __pos = this->_M_impl._M_start + __index; _GLIBCXX_MOVE_BACKWARD3(__pos, __back2, __back1); } *__pos = _GLIBCXX_MOVE(__x_copy); return __pos; } template void deque<_Tp, _Alloc>:: _M_insert_aux(iterator __pos, size_type __n, const value_type& __x) { const difference_type __elems_before = __pos - this->_M_impl._M_start; const size_type __length = this->size(); value_type __x_copy = __x; if (__elems_before < difference_type(__length / 2)) { iterator __new_start = _M_reserve_elements_at_front(__n); iterator __old_start = this->_M_impl._M_start; __pos = this->_M_impl._M_start + __elems_before; __try { if (__elems_before >= difference_type(__n)) { iterator __start_n = (this->_M_impl._M_start + difference_type(__n)); std::__uninitialized_move_a(this->_M_impl._M_start, __start_n, __new_start, _M_get_Tp_allocator()); this->_M_impl._M_start = __new_start; _GLIBCXX_MOVE3(__start_n, __pos, __old_start); std::fill(__pos - difference_type(__n), __pos, __x_copy); } else { std::__uninitialized_move_fill(this->_M_impl._M_start, __pos, __new_start, this->_M_impl._M_start, __x_copy, _M_get_Tp_allocator()); this->_M_impl._M_start = __new_start; std::fill(__old_start, __pos, __x_copy); } } __catch(...) { _M_destroy_nodes(__new_start._M_node, this->_M_impl._M_start._M_node); __throw_exception_again; } } else { iterator __new_finish = _M_reserve_elements_at_back(__n); iterator __old_finish = this->_M_impl._M_finish; const difference_type __elems_after = difference_type(__length) - __elems_before; __pos = this->_M_impl._M_finish - __elems_after; __try { if (__elems_after > difference_type(__n)) { iterator __finish_n = (this->_M_impl._M_finish - difference_type(__n)); std::__uninitialized_move_a(__finish_n, this->_M_impl._M_finish, this->_M_impl._M_finish, _M_get_Tp_allocator()); this->_M_impl._M_finish = __new_finish; _GLIBCXX_MOVE_BACKWARD3(__pos, __finish_n, __old_finish); std::fill(__pos, __pos + difference_type(__n), __x_copy); } else { std::__uninitialized_fill_move(this->_M_impl._M_finish, __pos + difference_type(__n), __x_copy, __pos, this->_M_impl._M_finish, _M_get_Tp_allocator()); this->_M_impl._M_finish = __new_finish; std::fill(__pos, __old_finish, __x_copy); } } __catch(...) { _M_destroy_nodes(this->_M_impl._M_finish._M_node + 1, __new_finish._M_node + 1); __throw_exception_again; } } } template template void deque<_Tp, _Alloc>:: _M_insert_aux(iterator __pos, _ForwardIterator __first, _ForwardIterator __last, size_type __n) { const difference_type __elemsbefore = __pos - this->_M_impl._M_start; const size_type __length = size(); if (static_cast(__elemsbefore) < __length / 2) { iterator __new_start = _M_reserve_elements_at_front(__n); iterator __old_start = this->_M_impl._M_start; __pos = this->_M_impl._M_start + __elemsbefore; __try { if (__elemsbefore >= difference_type(__n)) { iterator __start_n = (this->_M_impl._M_start + difference_type(__n)); std::__uninitialized_move_a(this->_M_impl._M_start, __start_n, __new_start, _M_get_Tp_allocator()); this->_M_impl._M_start = __new_start; _GLIBCXX_MOVE3(__start_n, __pos, __old_start); std::copy(__first, __last, __pos - difference_type(__n)); } else { _ForwardIterator __mid = __first; std::advance(__mid, difference_type(__n) - __elemsbefore); std::__uninitialized_move_copy(this->_M_impl._M_start, __pos, __first, __mid, __new_start, _M_get_Tp_allocator()); this->_M_impl._M_start = __new_start; std::copy(__mid, __last, __old_start); } } __catch(...) { _M_destroy_nodes(__new_start._M_node, this->_M_impl._M_start._M_node); __throw_exception_again; } } else { iterator __new_finish = _M_reserve_elements_at_back(__n); iterator __old_finish = this->_M_impl._M_finish; const difference_type __elemsafter = difference_type(__length) - __elemsbefore; __pos = this->_M_impl._M_finish - __elemsafter; __try { if (__elemsafter > difference_type(__n)) { iterator __finish_n = (this->_M_impl._M_finish - difference_type(__n)); std::__uninitialized_move_a(__finish_n, this->_M_impl._M_finish, this->_M_impl._M_finish, _M_get_Tp_allocator()); this->_M_impl._M_finish = __new_finish; _GLIBCXX_MOVE_BACKWARD3(__pos, __finish_n, __old_finish); std::copy(__first, __last, __pos); } else { _ForwardIterator __mid = __first; std::advance(__mid, __elemsafter); std::__uninitialized_copy_move(__mid, __last, __pos, this->_M_impl._M_finish, this->_M_impl._M_finish, _M_get_Tp_allocator()); this->_M_impl._M_finish = __new_finish; std::copy(__first, __mid, __pos); } } __catch(...) { _M_destroy_nodes(this->_M_impl._M_finish._M_node + 1, __new_finish._M_node + 1); __throw_exception_again; } } } template void deque<_Tp, _Alloc>:: _M_destroy_data_aux(iterator __first, iterator __last) { for (_Map_pointer __node = __first._M_node + 1; __node < __last._M_node; ++__node) std::_Destroy(*__node, *__node + _S_buffer_size(), _M_get_Tp_allocator()); if (__first._M_node != __last._M_node) { std::_Destroy(__first._M_cur, __first._M_last, _M_get_Tp_allocator()); std::_Destroy(__last._M_first, __last._M_cur, _M_get_Tp_allocator()); } else std::_Destroy(__first._M_cur, __last._M_cur, _M_get_Tp_allocator()); } template void deque<_Tp, _Alloc>:: _M_new_elements_at_front(size_type __new_elems) { if (this->max_size() - this->size() < __new_elems) __throw_length_error(__N("deque::_M_new_elements_at_front")); const size_type __new_nodes = ((__new_elems + _S_buffer_size() - 1) / _S_buffer_size()); _M_reserve_map_at_front(__new_nodes); size_type __i; __try { for (__i = 1; __i <= __new_nodes; ++__i) *(this->_M_impl._M_start._M_node - __i) = this->_M_allocate_node(); } __catch(...) { for (size_type __j = 1; __j < __i; ++__j) _M_deallocate_node(*(this->_M_impl._M_start._M_node - __j)); __throw_exception_again; } } template void deque<_Tp, _Alloc>:: _M_new_elements_at_back(size_type __new_elems) { if (this->max_size() - this->size() < __new_elems) __throw_length_error(__N("deque::_M_new_elements_at_back")); const size_type __new_nodes = ((__new_elems + _S_buffer_size() - 1) / _S_buffer_size()); _M_reserve_map_at_back(__new_nodes); size_type __i; __try { for (__i = 1; __i <= __new_nodes; ++__i) *(this->_M_impl._M_finish._M_node + __i) = this->_M_allocate_node(); } __catch(...) { for (size_type __j = 1; __j < __i; ++__j) _M_deallocate_node(*(this->_M_impl._M_finish._M_node + __j)); __throw_exception_again; } } template void deque<_Tp, _Alloc>:: _M_reallocate_map(size_type __nodes_to_add, bool __add_at_front) { const size_type __old_num_nodes = this->_M_impl._M_finish._M_node - this->_M_impl._M_start._M_node + 1; const size_type __new_num_nodes = __old_num_nodes + __nodes_to_add; _Map_pointer __new_nstart; if (this->_M_impl._M_map_size > 2 * __new_num_nodes) { __new_nstart = this->_M_impl._M_map + (this->_M_impl._M_map_size - __new_num_nodes) / 2 + (__add_at_front ? __nodes_to_add : 0); if (__new_nstart < this->_M_impl._M_start._M_node) std::copy(this->_M_impl._M_start._M_node, this->_M_impl._M_finish._M_node + 1, __new_nstart); else std::copy_backward(this->_M_impl._M_start._M_node, this->_M_impl._M_finish._M_node + 1, __new_nstart + __old_num_nodes); } else { size_type __new_map_size = this->_M_impl._M_map_size + std::max(this->_M_impl._M_map_size, __nodes_to_add) + 2; _Map_pointer __new_map = this->_M_allocate_map(__new_map_size); __new_nstart = __new_map + (__new_map_size - __new_num_nodes) / 2 + (__add_at_front ? __nodes_to_add : 0); std::copy(this->_M_impl._M_start._M_node, this->_M_impl._M_finish._M_node + 1, __new_nstart); _M_deallocate_map(this->_M_impl._M_map, this->_M_impl._M_map_size); this->_M_impl._M_map = __new_map; this->_M_impl._M_map_size = __new_map_size; } this->_M_impl._M_start._M_set_node(__new_nstart); this->_M_impl._M_finish._M_set_node(__new_nstart + __old_num_nodes - 1); } // Overload for deque::iterators, exploiting the "segmented-iterator // optimization". template void fill(const _Deque_iterator<_Tp, _Tp&, _Tp*>& __first, const _Deque_iterator<_Tp, _Tp&, _Tp*>& __last, const _Tp& __value) { typedef typename _Deque_iterator<_Tp, _Tp&, _Tp*>::_Self _Self; for (typename _Self::_Map_pointer __node = __first._M_node + 1; __node < __last._M_node; ++__node) std::fill(*__node, *__node + _Self::_S_buffer_size(), __value); if (__first._M_node != __last._M_node) { std::fill(__first._M_cur, __first._M_last, __value); std::fill(__last._M_first, __last._M_cur, __value); } else std::fill(__first._M_cur, __last._M_cur, __value); } template _Deque_iterator<_Tp, _Tp&, _Tp*> copy(_Deque_iterator<_Tp, const _Tp&, const _Tp*> __first, _Deque_iterator<_Tp, const _Tp&, const _Tp*> __last, _Deque_iterator<_Tp, _Tp&, _Tp*> __result) { typedef typename _Deque_iterator<_Tp, _Tp&, _Tp*>::_Self _Self; typedef typename _Self::difference_type difference_type; difference_type __len = __last - __first; while (__len > 0) { const difference_type __clen = std::min(__len, std::min(__first._M_last - __first._M_cur, __result._M_last - __result._M_cur)); std::copy(__first._M_cur, __first._M_cur + __clen, __result._M_cur); __first += __clen; __result += __clen; __len -= __clen; } return __result; } template _Deque_iterator<_Tp, _Tp&, _Tp*> copy_backward(_Deque_iterator<_Tp, const _Tp&, const _Tp*> __first, _Deque_iterator<_Tp, const _Tp&, const _Tp*> __last, _Deque_iterator<_Tp, _Tp&, _Tp*> __result) { typedef typename _Deque_iterator<_Tp, _Tp&, _Tp*>::_Self _Self; typedef typename _Self::difference_type difference_type; difference_type __len = __last - __first; while (__len > 0) { difference_type __llen = __last._M_cur - __last._M_first; _Tp* __lend = __last._M_cur; difference_type __rlen = __result._M_cur - __result._M_first; _Tp* __rend = __result._M_cur; if (!__llen) { __llen = _Self::_S_buffer_size(); __lend = *(__last._M_node - 1) + __llen; } if (!__rlen) { __rlen = _Self::_S_buffer_size(); __rend = *(__result._M_node - 1) + __rlen; } const difference_type __clen = std::min(__len, std::min(__llen, __rlen)); std::copy_backward(__lend - __clen, __lend, __rend); __last -= __clen; __result -= __clen; __len -= __clen; } return __result; } #if __cplusplus >= 201103L template _Deque_iterator<_Tp, _Tp&, _Tp*> move(_Deque_iterator<_Tp, const _Tp&, const _Tp*> __first, _Deque_iterator<_Tp, const _Tp&, const _Tp*> __last, _Deque_iterator<_Tp, _Tp&, _Tp*> __result) { typedef typename _Deque_iterator<_Tp, _Tp&, _Tp*>::_Self _Self; typedef typename _Self::difference_type difference_type; difference_type __len = __last - __first; while (__len > 0) { const difference_type __clen = std::min(__len, std::min(__first._M_last - __first._M_cur, __result._M_last - __result._M_cur)); std::move(__first._M_cur, __first._M_cur + __clen, __result._M_cur); __first += __clen; __result += __clen; __len -= __clen; } return __result; } template _Deque_iterator<_Tp, _Tp&, _Tp*> move_backward(_Deque_iterator<_Tp, const _Tp&, const _Tp*> __first, _Deque_iterator<_Tp, const _Tp&, const _Tp*> __last, _Deque_iterator<_Tp, _Tp&, _Tp*> __result) { typedef typename _Deque_iterator<_Tp, _Tp&, _Tp*>::_Self _Self; typedef typename _Self::difference_type difference_type; difference_type __len = __last - __first; while (__len > 0) { difference_type __llen = __last._M_cur - __last._M_first; _Tp* __lend = __last._M_cur; difference_type __rlen = __result._M_cur - __result._M_first; _Tp* __rend = __result._M_cur; if (!__llen) { __llen = _Self::_S_buffer_size(); __lend = *(__last._M_node - 1) + __llen; } if (!__rlen) { __rlen = _Self::_S_buffer_size(); __rend = *(__result._M_node - 1) + __rlen; } const difference_type __clen = std::min(__len, std::min(__llen, __rlen)); std::move_backward(__lend - __clen, __lend, __rend); __last -= __clen; __result -= __clen; __len -= __clen; } return __result; } #endif # 1092 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/deque.tcc" 3 _GLIBCXX_END_NAMESPACE_CONTAINER } // namespace std #endif # 1097 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/deque.tcc" 3 # 67 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/deque" 2 3 #ifdef _GLIBCXX_DEBUG #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 69 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/deque" 3 # 70 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/deque" 3 #endif # 71 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/deque" 3 #ifdef _GLIBCXX_PROFILE #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 73 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/deque" 3 # 74 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/deque" 3 #endif # 75 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/deque" 3 #endif /* _GLIBCXX_DEQUE */ # 77 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/deque" 3 # 61 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/queue" 2 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 61 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/queue" 3 # 62 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/queue" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 62 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/queue" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_heap.h" 1 3 // Heap implementation -*- C++ -*- // Copyright (C) 2001-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /* * * Copyright (c) 1994 * Hewlett-Packard Company * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Hewlett-Packard Company makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. * * Copyright (c) 1997 * Silicon Graphics Computer Systems, Inc. * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Silicon Graphics makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. */ /** @file bits/stl_heap.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{queue} */ #ifndef _STL_HEAP_H #define _STL_HEAP_H 1 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 58 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_heap.h" 3 # 59 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_heap.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 59 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_heap.h" 3 # 60 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_heap.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 60 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_heap.h" 3 # 61 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_heap.h" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION /** * @defgroup heap_algorithms Heap * @ingroup sorting_algorithms */ template _Distance __is_heap_until(_RandomAccessIterator __first, _Distance __n, _Compare __comp) { _Distance __parent = 0; for (_Distance __child = 1; __child < __n; ++__child) { if (__comp(__first + __parent, __first + __child)) return __child; if ((__child & 1) == 0) ++__parent; } return __n; } // __is_heap, a predicate testing whether or not a range is a heap. // This function is an extension, not part of the C++ standard. template inline bool __is_heap(_RandomAccessIterator __first, _Distance __n) { return std::__is_heap_until(__first, __n, __gnu_cxx::__ops::__iter_less_iter()) == __n; } template inline bool __is_heap(_RandomAccessIterator __first, _Compare __comp, _Distance __n) { return std::__is_heap_until(__first, __n, __gnu_cxx::__ops::__iter_comp_iter(__comp)) == __n; } template inline bool __is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) { return std::__is_heap(__first, std::distance(__first, __last)); } template inline bool __is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) { return std::__is_heap(__first, __comp, std::distance(__first, __last)); } // Heap-manipulation functions: push_heap, pop_heap, make_heap, sort_heap, // + is_heap and is_heap_until in C++0x. template void __push_heap(_RandomAccessIterator __first, _Distance __holeIndex, _Distance __topIndex, _Tp __value, _Compare __comp) { _Distance __parent = (__holeIndex - 1) / 2; while (__holeIndex > __topIndex && __comp(__first + __parent, __value)) { *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first + __parent)); __holeIndex = __parent; __parent = (__holeIndex - 1) / 2; } *(__first + __holeIndex) = _GLIBCXX_MOVE(__value); } /** * @brief Push an element onto a heap. * @param __first Start of heap. * @param __last End of heap + element. * @ingroup heap_algorithms * * This operation pushes the element at last-1 onto the valid heap * over the range [__first,__last-1). After completion, * [__first,__last) is a valid heap. */ template inline void push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) { typedef typename iterator_traits<_RandomAccessIterator>::value_type _ValueType; typedef typename iterator_traits<_RandomAccessIterator>::difference_type _DistanceType; // concept requirements __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept< _RandomAccessIterator>) __glibcxx_function_requires(_LessThanComparableConcept<_ValueType>) __glibcxx_requires_valid_range(__first, __last); __glibcxx_requires_heap(__first, __last - 1); _ValueType __value = _GLIBCXX_MOVE(*(__last - 1)); std::__push_heap(__first, _DistanceType((__last - __first) - 1), _DistanceType(0), _GLIBCXX_MOVE(__value), __gnu_cxx::__ops::__iter_less_val()); } /** * @brief Push an element onto a heap using comparison functor. * @param __first Start of heap. * @param __last End of heap + element. * @param __comp Comparison functor. * @ingroup heap_algorithms * * This operation pushes the element at __last-1 onto the valid * heap over the range [__first,__last-1). After completion, * [__first,__last) is a valid heap. Compare operations are * performed using comp. */ template inline void push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) { typedef typename iterator_traits<_RandomAccessIterator>::value_type _ValueType; typedef typename iterator_traits<_RandomAccessIterator>::difference_type _DistanceType; // concept requirements __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept< _RandomAccessIterator>) __glibcxx_requires_valid_range(__first, __last); __glibcxx_requires_heap_pred(__first, __last - 1, __comp); _ValueType __value = _GLIBCXX_MOVE(*(__last - 1)); std::__push_heap(__first, _DistanceType((__last - __first) - 1), _DistanceType(0), _GLIBCXX_MOVE(__value), __gnu_cxx::__ops::__iter_comp_val(__comp)); } template void __adjust_heap(_RandomAccessIterator __first, _Distance __holeIndex, _Distance __len, _Tp __value, _Compare __comp) { const _Distance __topIndex = __holeIndex; _Distance __secondChild = __holeIndex; while (__secondChild < (__len - 1) / 2) { __secondChild = 2 * (__secondChild + 1); if (__comp(__first + __secondChild, __first + (__secondChild - 1))) __secondChild--; *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first + __secondChild)); __holeIndex = __secondChild; } if ((__len & 1) == 0 && __secondChild == (__len - 2) / 2) { __secondChild = 2 * (__secondChild + 1); *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first + (__secondChild - 1))); __holeIndex = __secondChild - 1; } std::__push_heap(__first, __holeIndex, __topIndex, _GLIBCXX_MOVE(__value), __gnu_cxx::__ops::__iter_comp_val(__comp)); } template inline void __pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _RandomAccessIterator __result, _Compare __comp) { typedef typename iterator_traits<_RandomAccessIterator>::value_type _ValueType; typedef typename iterator_traits<_RandomAccessIterator>::difference_type _DistanceType; _ValueType __value = _GLIBCXX_MOVE(*__result); *__result = _GLIBCXX_MOVE(*__first); std::__adjust_heap(__first, _DistanceType(0), _DistanceType(__last - __first), _GLIBCXX_MOVE(__value), __comp); } /** * @brief Pop an element off a heap. * @param __first Start of heap. * @param __last End of heap. * @pre [__first, __last) is a valid, non-empty range. * @ingroup heap_algorithms * * This operation pops the top of the heap. The elements __first * and __last-1 are swapped and [__first,__last-1) is made into a * heap. */ template inline void pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) { typedef typename iterator_traits<_RandomAccessIterator>::value_type _ValueType; // concept requirements __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept< _RandomAccessIterator>) __glibcxx_function_requires(_LessThanComparableConcept<_ValueType>) __glibcxx_requires_non_empty_range(__first, __last); __glibcxx_requires_valid_range(__first, __last); __glibcxx_requires_heap(__first, __last); if (__last - __first > 1) { --__last; std::__pop_heap(__first, __last, __last, __gnu_cxx::__ops::__iter_less_iter()); } } /** * @brief Pop an element off a heap using comparison functor. * @param __first Start of heap. * @param __last End of heap. * @param __comp Comparison functor to use. * @ingroup heap_algorithms * * This operation pops the top of the heap. The elements __first * and __last-1 are swapped and [__first,__last-1) is made into a * heap. Comparisons are made using comp. */ template inline void pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) { // concept requirements __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept< _RandomAccessIterator>) __glibcxx_requires_valid_range(__first, __last); __glibcxx_requires_non_empty_range(__first, __last); __glibcxx_requires_heap_pred(__first, __last, __comp); if (__last - __first > 1) { --__last; std::__pop_heap(__first, __last, __last, __gnu_cxx::__ops::__iter_comp_iter(__comp)); } } template void __make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) { typedef typename iterator_traits<_RandomAccessIterator>::value_type _ValueType; typedef typename iterator_traits<_RandomAccessIterator>::difference_type _DistanceType; if (__last - __first < 2) return; const _DistanceType __len = __last - __first; _DistanceType __parent = (__len - 2) / 2; while (true) { _ValueType __value = _GLIBCXX_MOVE(*(__first + __parent)); std::__adjust_heap(__first, __parent, __len, _GLIBCXX_MOVE(__value), __comp); if (__parent == 0) return; __parent--; } } /** * @brief Construct a heap over a range. * @param __first Start of heap. * @param __last End of heap. * @ingroup heap_algorithms * * This operation makes the elements in [__first,__last) into a heap. */ template inline void make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) { // concept requirements __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept< _RandomAccessIterator>) __glibcxx_function_requires(_LessThanComparableConcept< typename iterator_traits<_RandomAccessIterator>::value_type>) __glibcxx_requires_valid_range(__first, __last); std::__make_heap(__first, __last, __gnu_cxx::__ops::__iter_less_iter()); } /** * @brief Construct a heap over a range using comparison functor. * @param __first Start of heap. * @param __last End of heap. * @param __comp Comparison functor to use. * @ingroup heap_algorithms * * This operation makes the elements in [__first,__last) into a heap. * Comparisons are made using __comp. */ template inline void make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) { // concept requirements __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept< _RandomAccessIterator>) __glibcxx_requires_valid_range(__first, __last); std::__make_heap(__first, __last, __gnu_cxx::__ops::__iter_comp_iter(__comp)); } template void __sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) { while (__last - __first > 1) { --__last; std::__pop_heap(__first, __last, __last, __comp); } } /** * @brief Sort a heap. * @param __first Start of heap. * @param __last End of heap. * @ingroup heap_algorithms * * This operation sorts the valid heap in the range [__first,__last). */ template inline void sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) { // concept requirements __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept< _RandomAccessIterator>) __glibcxx_function_requires(_LessThanComparableConcept< typename iterator_traits<_RandomAccessIterator>::value_type>) __glibcxx_requires_valid_range(__first, __last); __glibcxx_requires_heap(__first, __last); std::__sort_heap(__first, __last, __gnu_cxx::__ops::__iter_less_iter()); } /** * @brief Sort a heap using comparison functor. * @param __first Start of heap. * @param __last End of heap. * @param __comp Comparison functor to use. * @ingroup heap_algorithms * * This operation sorts the valid heap in the range [__first,__last). * Comparisons are made using __comp. */ template inline void sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) { // concept requirements __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept< _RandomAccessIterator>) __glibcxx_requires_valid_range(__first, __last); __glibcxx_requires_heap_pred(__first, __last, __comp); std::__sort_heap(__first, __last, __gnu_cxx::__ops::__iter_comp_iter(__comp)); } #if __cplusplus >= 201103L /** * @brief Search the end of a heap. * @param __first Start of range. * @param __last End of range. * @return An iterator pointing to the first element not in the heap. * @ingroup heap_algorithms * * This operation returns the last iterator i in [__first, __last) for which * the range [__first, i) is a heap. */ template inline _RandomAccessIterator is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last) { // concept requirements __glibcxx_function_requires(_RandomAccessIteratorConcept< _RandomAccessIterator>) __glibcxx_function_requires(_LessThanComparableConcept< typename iterator_traits<_RandomAccessIterator>::value_type>) __glibcxx_requires_valid_range(__first, __last); return __first + std::__is_heap_until(__first, std::distance(__first, __last), __gnu_cxx::__ops::__iter_less_iter()); } /** * @brief Search the end of a heap using comparison functor. * @param __first Start of range. * @param __last End of range. * @param __comp Comparison functor to use. * @return An iterator pointing to the first element not in the heap. * @ingroup heap_algorithms * * This operation returns the last iterator i in [__first, __last) for which * the range [__first, i) is a heap. Comparisons are made using __comp. */ template inline _RandomAccessIterator is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) { // concept requirements __glibcxx_function_requires(_RandomAccessIteratorConcept< _RandomAccessIterator>) __glibcxx_requires_valid_range(__first, __last); return __first + std::__is_heap_until(__first, std::distance(__first, __last), __gnu_cxx::__ops::__iter_comp_iter(__comp)); } /** * @brief Determines whether a range is a heap. * @param __first Start of range. * @param __last End of range. * @return True if range is a heap, false otherwise. * @ingroup heap_algorithms */ template inline bool is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) { return std::is_heap_until(__first, __last) == __last; } /** * @brief Determines whether a range is a heap using comparison functor. * @param __first Start of range. * @param __last End of range. * @param __comp Comparison functor to use. * @return True if range is a heap, false otherwise. * @ingroup heap_algorithms */ template inline bool is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) { return std::is_heap_until(__first, __last, __comp) == __last; } #endif # 528 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_heap.h" 3 _GLIBCXX_END_NAMESPACE_VERSION } // namespace #endif /* _STL_HEAP_H */ # 533 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_heap.h" 3 # 63 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/queue" 2 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 63 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/queue" 3 # 64 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/queue" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 64 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/queue" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_queue.h" 1 3 // Queue implementation -*- C++ -*- // Copyright (C) 2001-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /* * * Copyright (c) 1994 * Hewlett-Packard Company * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Hewlett-Packard Company makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. * * * Copyright (c) 1996,1997 * Silicon Graphics Computer Systems, Inc. * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Silicon Graphics makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. */ /** @file bits/stl_queue.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{queue} */ #ifndef _STL_QUEUE_H #define _STL_QUEUE_H 1 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 59 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_queue.h" 3 # 60 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_queue.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 60 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_queue.h" 3 # 61 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_queue.h" 3 #if __cplusplus >= 201103L #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 62 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_queue.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/uses_allocator.h" 1 3 // Uses-allocator Construction -*- C++ -*- // Copyright (C) 2010-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . #ifndef _USES_ALLOCATOR_H #define _USES_ALLOCATOR_H 1 #if __cplusplus < 201103L #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 29 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/uses_allocator.h" 3 # 30 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/uses_allocator.h" 3 #else # 31 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/uses_allocator.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 32 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/uses_allocator.h" 3 # 33 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/uses_allocator.h" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION /// [allocator.tag] struct allocator_arg_t { }; constexpr allocator_arg_t allocator_arg = allocator_arg_t(); template> struct __uses_allocator_helper : false_type { }; template struct __uses_allocator_helper<_Tp, _Alloc, __void_t> : is_convertible<_Alloc, typename _Tp::allocator_type>::type { }; /// [allocator.uses.trait] template struct uses_allocator : __uses_allocator_helper<_Tp, _Alloc>::type { }; struct __uses_alloc_base { }; struct __uses_alloc0 : __uses_alloc_base { struct _Sink { void operator=(const void*) { } } _M_a; }; template struct __uses_alloc1 : __uses_alloc_base { const _Alloc* _M_a; }; template struct __uses_alloc2 : __uses_alloc_base { const _Alloc* _M_a; }; template struct __uses_alloc; template struct __uses_alloc : conditional< is_constructible<_Tp, allocator_arg_t, _Alloc, _Args...>::value, __uses_alloc1<_Alloc>, __uses_alloc2<_Alloc>>::type { }; template struct __uses_alloc : __uses_alloc0 { }; template using __uses_alloc_t = __uses_alloc::value, _Tp, _Alloc, _Args...>; template inline __uses_alloc_t<_Tp, _Alloc, _Args...> __use_alloc(const _Alloc& __a) { __uses_alloc_t<_Tp, _Alloc, _Args...> __ret; __ret._M_a = &__a; return __ret; } _GLIBCXX_END_NAMESPACE_VERSION } // namespace std #endif # 104 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/uses_allocator.h" 3 #endif # 105 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/uses_allocator.h" 3 # 63 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_queue.h" 2 3 #endif # 64 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_queue.h" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION /** * @brief A standard container giving FIFO behavior. * * @ingroup sequences * * @tparam _Tp Type of element. * @tparam _Sequence Type of underlying sequence, defaults to deque<_Tp>. * * Meets many of the requirements of a * container, * but does not define anything to do with iterators. Very few of the * other standard container interfaces are defined. * * This is not a true container, but an @e adaptor. It holds another * container, and provides a wrapper interface to that container. The * wrapper is what enforces strict first-in-first-out %queue behavior. * * The second template parameter defines the type of the underlying * sequence/container. It defaults to std::deque, but it can be any type * that supports @c front, @c back, @c push_back, and @c pop_front, * such as std::list or an appropriate user-defined type. * * Members not found in @a normal containers are @c container_type, * which is a typedef for the second Sequence parameter, and @c push and * @c pop, which are standard %queue/FIFO operations. */ template > class queue { // concept requirements typedef typename _Sequence::value_type _Sequence_value_type; __glibcxx_class_requires(_Tp, _SGIAssignableConcept) __glibcxx_class_requires(_Sequence, _FrontInsertionSequenceConcept) __glibcxx_class_requires(_Sequence, _BackInsertionSequenceConcept) __glibcxx_class_requires2(_Tp, _Sequence_value_type, _SameTypeConcept) template friend bool operator==(const queue<_Tp1, _Seq1>&, const queue<_Tp1, _Seq1>&); template friend bool operator<(const queue<_Tp1, _Seq1>&, const queue<_Tp1, _Seq1>&); public: typedef typename _Sequence::value_type value_type; typedef typename _Sequence::reference reference; typedef typename _Sequence::const_reference const_reference; typedef typename _Sequence::size_type size_type; typedef _Sequence container_type; protected: /** * 'c' is the underlying container. Maintainers wondering why * this isn't uglified as per style guidelines should note that * this name is specified in the standard, [23.2.3.1]. (Why? * Presumably for the same reason that it's protected instead * of private: to allow derivation. But none of the other * containers allow for derivation. Odd.) */ _Sequence c; public: /** * @brief Default constructor creates no elements. */ #if __cplusplus < 201103L explicit queue(const _Sequence& __c = _Sequence()) : c(__c) { } #else # 140 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_queue.h" 3 explicit queue(const _Sequence& __c) : c(__c) { } explicit queue(_Sequence&& __c = _Sequence()) : c(std::move(__c)) { } #endif # 148 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_queue.h" 3 /** * Returns true if the %queue is empty. */ bool empty() const { return c.empty(); } /** Returns the number of elements in the %queue. */ size_type size() const { return c.size(); } /** * Returns a read/write reference to the data at the first * element of the %queue. */ reference front() { __glibcxx_requires_nonempty(); return c.front(); } /** * Returns a read-only (constant) reference to the data at the first * element of the %queue. */ const_reference front() const { __glibcxx_requires_nonempty(); return c.front(); } /** * Returns a read/write reference to the data at the last * element of the %queue. */ reference back() { __glibcxx_requires_nonempty(); return c.back(); } /** * Returns a read-only (constant) reference to the data at the last * element of the %queue. */ const_reference back() const { __glibcxx_requires_nonempty(); return c.back(); } /** * @brief Add data to the end of the %queue. * @param __x Data to be added. * * This is a typical %queue operation. The function creates an * element at the end of the %queue and assigns the given data * to it. The time complexity of the operation depends on the * underlying sequence. */ void push(const value_type& __x) { c.push_back(__x); } #if __cplusplus >= 201103L void push(value_type&& __x) { c.push_back(std::move(__x)); } template void emplace(_Args&&... __args) { c.emplace_back(std::forward<_Args>(__args)...); } #endif # 228 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_queue.h" 3 /** * @brief Removes first element. * * This is a typical %queue operation. It shrinks the %queue by one. * The time complexity of the operation depends on the underlying * sequence. * * Note that no data is returned, and if the first element's * data is needed, it should be retrieved before pop() is * called. */ void pop() { __glibcxx_requires_nonempty(); c.pop_front(); } #if __cplusplus >= 201103L void swap(queue& __q) noexcept(noexcept(swap(c, __q.c))) { using std::swap; swap(c, __q.c); } #endif # 256 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_queue.h" 3 }; /** * @brief Queue equality comparison. * @param __x A %queue. * @param __y A %queue of the same type as @a __x. * @return True iff the size and elements of the queues are equal. * * This is an equivalence relation. Complexity and semantics depend on the * underlying sequence type, but the expected rules are: this relation is * linear in the size of the sequences, and queues are considered equivalent * if their sequences compare equal. */ template inline bool operator==(const queue<_Tp, _Seq>& __x, const queue<_Tp, _Seq>& __y) { return __x.c == __y.c; } /** * @brief Queue ordering relation. * @param __x A %queue. * @param __y A %queue of the same type as @a x. * @return True iff @a __x is lexicographically less than @a __y. * * This is an total ordering relation. Complexity and semantics * depend on the underlying sequence type, but the expected rules * are: this relation is linear in the size of the sequences, the * elements must be comparable with @c <, and * std::lexicographical_compare() is usually used to make the * determination. */ template inline bool operator<(const queue<_Tp, _Seq>& __x, const queue<_Tp, _Seq>& __y) { return __x.c < __y.c; } /// Based on operator== template inline bool operator!=(const queue<_Tp, _Seq>& __x, const queue<_Tp, _Seq>& __y) { return !(__x == __y); } /// Based on operator< template inline bool operator>(const queue<_Tp, _Seq>& __x, const queue<_Tp, _Seq>& __y) { return __y < __x; } /// Based on operator< template inline bool operator<=(const queue<_Tp, _Seq>& __x, const queue<_Tp, _Seq>& __y) { return !(__y < __x); } /// Based on operator< template inline bool operator>=(const queue<_Tp, _Seq>& __x, const queue<_Tp, _Seq>& __y) { return !(__x < __y); } #if __cplusplus >= 201103L template inline void swap(queue<_Tp, _Seq>& __x, queue<_Tp, _Seq>& __y) noexcept(noexcept(__x.swap(__y))) { __x.swap(__y); } template struct uses_allocator, _Alloc> : public uses_allocator<_Seq, _Alloc>::type { }; #endif # 327 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_queue.h" 3 /** * @brief A standard container automatically sorting its contents. * * @ingroup sequences * * @tparam _Tp Type of element. * @tparam _Sequence Type of underlying sequence, defaults to vector<_Tp>. * @tparam _Compare Comparison function object type, defaults to * less<_Sequence::value_type>. * * This is not a true container, but an @e adaptor. It holds * another container, and provides a wrapper interface to that * container. The wrapper is what enforces priority-based sorting * and %queue behavior. Very few of the standard container/sequence * interface requirements are met (e.g., iterators). * * The second template parameter defines the type of the underlying * sequence/container. It defaults to std::vector, but it can be * any type that supports @c front(), @c push_back, @c pop_back, * and random-access iterators, such as std::deque or an * appropriate user-defined type. * * The third template parameter supplies the means of making * priority comparisons. It defaults to @c less but * can be anything defining a strict weak ordering. * * Members not found in @a normal containers are @c container_type, * which is a typedef for the second Sequence parameter, and @c * push, @c pop, and @c top, which are standard %queue operations. * * @note No equality/comparison operators are provided for * %priority_queue. * * @note Sorting of the elements takes place as they are added to, * and removed from, the %priority_queue using the * %priority_queue's member functions. If you access the elements * by other means, and change their data such that the sorting * order would be different, the %priority_queue will not re-sort * the elements for you. (How could it know to do so?) */ template, typename _Compare = less > class priority_queue { // concept requirements typedef typename _Sequence::value_type _Sequence_value_type; __glibcxx_class_requires(_Tp, _SGIAssignableConcept) __glibcxx_class_requires(_Sequence, _SequenceConcept) __glibcxx_class_requires(_Sequence, _RandomAccessContainerConcept) __glibcxx_class_requires2(_Tp, _Sequence_value_type, _SameTypeConcept) __glibcxx_class_requires4(_Compare, bool, _Tp, _Tp, _BinaryFunctionConcept) public: typedef typename _Sequence::value_type value_type; typedef typename _Sequence::reference reference; typedef typename _Sequence::const_reference const_reference; typedef typename _Sequence::size_type size_type; typedef _Sequence container_type; protected: // See queue::c for notes on these names. _Sequence c; _Compare comp; public: /** * @brief Default constructor creates no elements. */ #if __cplusplus < 201103L explicit priority_queue(const _Compare& __x = _Compare(), const _Sequence& __s = _Sequence()) : c(__s), comp(__x) { std::make_heap(c.begin(), c.end(), comp); } #else # 404 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_queue.h" 3 explicit priority_queue(const _Compare& __x, const _Sequence& __s) : c(__s), comp(__x) { std::make_heap(c.begin(), c.end(), comp); } explicit priority_queue(const _Compare& __x = _Compare(), _Sequence&& __s = _Sequence()) : c(std::move(__s)), comp(__x) { std::make_heap(c.begin(), c.end(), comp); } #endif # 416 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_queue.h" 3 /** * @brief Builds a %queue from a range. * @param __first An input iterator. * @param __last An input iterator. * @param __x A comparison functor describing a strict weak ordering. * @param __s An initial sequence with which to start. * * Begins by copying @a __s, inserting a copy of the elements * from @a [first,last) into the copy of @a __s, then ordering * the copy according to @a __x. * * For more information on function objects, see the * documentation on @link functors functor base * classes@endlink. */ #if __cplusplus < 201103L template priority_queue(_InputIterator __first, _InputIterator __last, const _Compare& __x = _Compare(), const _Sequence& __s = _Sequence()) : c(__s), comp(__x) { __glibcxx_requires_valid_range(__first, __last); c.insert(c.end(), __first, __last); std::make_heap(c.begin(), c.end(), comp); } #else # 444 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_queue.h" 3 template priority_queue(_InputIterator __first, _InputIterator __last, const _Compare& __x, const _Sequence& __s) : c(__s), comp(__x) { __glibcxx_requires_valid_range(__first, __last); c.insert(c.end(), __first, __last); std::make_heap(c.begin(), c.end(), comp); } template priority_queue(_InputIterator __first, _InputIterator __last, const _Compare& __x = _Compare(), _Sequence&& __s = _Sequence()) : c(std::move(__s)), comp(__x) { __glibcxx_requires_valid_range(__first, __last); c.insert(c.end(), __first, __last); std::make_heap(c.begin(), c.end(), comp); } #endif # 466 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_queue.h" 3 /** * Returns true if the %queue is empty. */ bool empty() const { return c.empty(); } /** Returns the number of elements in the %queue. */ size_type size() const { return c.size(); } /** * Returns a read-only (constant) reference to the data at the first * element of the %queue. */ const_reference top() const { __glibcxx_requires_nonempty(); return c.front(); } /** * @brief Add data to the %queue. * @param __x Data to be added. * * This is a typical %queue operation. * The time complexity of the operation depends on the underlying * sequence. */ void push(const value_type& __x) { c.push_back(__x); std::push_heap(c.begin(), c.end(), comp); } #if __cplusplus >= 201103L void push(value_type&& __x) { c.push_back(std::move(__x)); std::push_heap(c.begin(), c.end(), comp); } template void emplace(_Args&&... __args) { c.emplace_back(std::forward<_Args>(__args)...); std::push_heap(c.begin(), c.end(), comp); } #endif # 521 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_queue.h" 3 /** * @brief Removes first element. * * This is a typical %queue operation. It shrinks the %queue * by one. The time complexity of the operation depends on the * underlying sequence. * * Note that no data is returned, and if the first element's * data is needed, it should be retrieved before pop() is * called. */ void pop() { __glibcxx_requires_nonempty(); std::pop_heap(c.begin(), c.end(), comp); c.pop_back(); } #if __cplusplus >= 201103L void swap(priority_queue& __pq) noexcept(noexcept(swap(c, __pq.c)) && noexcept(swap(comp, __pq.comp))) { using std::swap; swap(c, __pq.c); swap(comp, __pq.comp); } #endif # 551 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_queue.h" 3 }; // No equality/comparison operators are provided for priority_queue. #if __cplusplus >= 201103L template inline void swap(priority_queue<_Tp, _Sequence, _Compare>& __x, priority_queue<_Tp, _Sequence, _Compare>& __y) noexcept(noexcept(__x.swap(__y))) { __x.swap(__y); } template struct uses_allocator, _Alloc> : public uses_allocator<_Sequence, _Alloc>::type { }; #endif # 568 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_queue.h" 3 _GLIBCXX_END_NAMESPACE_VERSION } // namespace #endif /* _STL_QUEUE_H */ # 573 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_queue.h" 3 # 65 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/queue" 2 3 #endif /* _GLIBCXX_QUEUE */ # 67 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/queue" 3 # 6 "./Graph.hpp" 2 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 6 "./Graph.hpp" # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/algorithm" 1 3 // -*- C++ -*- // Copyright (C) 2001-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /* * * Copyright (c) 1994 * Hewlett-Packard Company * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Hewlett-Packard Company makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. * * * Copyright (c) 1996,1997 * Silicon Graphics Computer Systems, Inc. * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Silicon Graphics makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. */ /** @file include/algorithm * This is a Standard C++ Library header. */ #ifndef _GLIBCXX_ALGORITHM #define _GLIBCXX_ALGORITHM 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 59 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/algorithm" 3 #if 0 /* expanded by -frewrite-includes */ #include // UK-300. #endif /* expanded by -frewrite-includes */ # 60 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/algorithm" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/utility" 1 3 // -*- C++ -*- // Copyright (C) 2001-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /* * * Copyright (c) 1994 * Hewlett-Packard Company * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Hewlett-Packard Company makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. * * * Copyright (c) 1996,1997 * Silicon Graphics Computer Systems, Inc. * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Silicon Graphics makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. */ /** @file include/utility * This is a Standard C++ Library header. */ #ifndef _GLIBCXX_UTILITY #define _GLIBCXX_UTILITY 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 59 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/utility" 3 /** * @defgroup utilities Utilities * * Components deemed generally useful. Includes pair, tuple, * forward/move helpers, ratio, function object, metaprogramming and * type traits, time, date, and memory functions. */ #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 68 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/utility" 3 # 69 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/utility" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 69 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/utility" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_relops.h" 1 3 // std::rel_ops implementation -*- C++ -*- // Copyright (C) 2001-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the, 2009 Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /* * * Copyright (c) 1994 * Hewlett-Packard Company * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Hewlett-Packard Company makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. * * Copyright (c) 1996,1997 * Silicon Graphics * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Silicon Graphics makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. * */ /** @file bits/stl_relops.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{utility} * * Inclusion of this file has been removed from * all of the other STL headers for safety reasons, except std_utility.h. * For more information, see the thread of about twenty messages starting * with http://gcc.gnu.org/ml/libstdc++/2001-01/msg00223.html, or * http://gcc.gnu.org/onlinedocs/libstdc++/faq.html#faq.ambiguous_overloads * * Short summary: the rel_ops operators should be avoided for the present. */ #ifndef _STL_RELOPS_H #define _STL_RELOPS_H 1 namespace std _GLIBCXX_VISIBILITY(default) { namespace rel_ops { _GLIBCXX_BEGIN_NAMESPACE_VERSION /** @namespace std::rel_ops * @brief The generated relational operators are sequestered here. */ /** * @brief Defines @c != for arbitrary types, in terms of @c ==. * @param __x A thing. * @param __y Another thing. * @return __x != __y * * This function uses @c == to determine its result. */ template inline bool operator!=(const _Tp& __x, const _Tp& __y) { return !(__x == __y); } /** * @brief Defines @c > for arbitrary types, in terms of @c <. * @param __x A thing. * @param __y Another thing. * @return __x > __y * * This function uses @c < to determine its result. */ template inline bool operator>(const _Tp& __x, const _Tp& __y) { return __y < __x; } /** * @brief Defines @c <= for arbitrary types, in terms of @c <. * @param __x A thing. * @param __y Another thing. * @return __x <= __y * * This function uses @c < to determine its result. */ template inline bool operator<=(const _Tp& __x, const _Tp& __y) { return !(__y < __x); } /** * @brief Defines @c >= for arbitrary types, in terms of @c <. * @param __x A thing. * @param __y Another thing. * @return __x >= __y * * This function uses @c < to determine its result. */ template inline bool operator>=(const _Tp& __x, const _Tp& __y) { return !(__x < __y); } _GLIBCXX_END_NAMESPACE_VERSION } // namespace rel_ops } // namespace std #endif /* _STL_RELOPS_H */ # 135 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_relops.h" 3 # 70 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/utility" 2 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 70 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/utility" 3 # 71 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/utility" 3 #if __cplusplus >= 201103L #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 74 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/utility" 3 # 75 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/utility" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 75 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/utility" 3 # 76 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/utility" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION template class tuple_size; template class tuple_element; // Various functions which give std::pair a tuple-like interface. /// Partial specialization for std::pair template struct tuple_size> : public integral_constant { }; /// Partial specialization for std::pair template struct tuple_element<0, std::pair<_Tp1, _Tp2>> { typedef _Tp1 type; }; /// Partial specialization for std::pair template struct tuple_element<1, std::pair<_Tp1, _Tp2>> { typedef _Tp2 type; }; template struct __pair_get; template<> struct __pair_get<0> { template static constexpr _Tp1& __get(std::pair<_Tp1, _Tp2>& __pair) noexcept { return __pair.first; } template static constexpr _Tp1&& __move_get(std::pair<_Tp1, _Tp2>&& __pair) noexcept { return std::forward<_Tp1>(__pair.first); } template static constexpr const _Tp1& __const_get(const std::pair<_Tp1, _Tp2>& __pair) noexcept { return __pair.first; } }; template<> struct __pair_get<1> { template static constexpr _Tp2& __get(std::pair<_Tp1, _Tp2>& __pair) noexcept { return __pair.second; } template static constexpr _Tp2&& __move_get(std::pair<_Tp1, _Tp2>&& __pair) noexcept { return std::forward<_Tp2>(__pair.second); } template static constexpr const _Tp2& __const_get(const std::pair<_Tp1, _Tp2>& __pair) noexcept { return __pair.second; } }; template constexpr typename tuple_element<_Int, std::pair<_Tp1, _Tp2>>::type& get(std::pair<_Tp1, _Tp2>& __in) noexcept { return __pair_get<_Int>::__get(__in); } template constexpr typename tuple_element<_Int, std::pair<_Tp1, _Tp2>>::type&& get(std::pair<_Tp1, _Tp2>&& __in) noexcept { return __pair_get<_Int>::__move_get(std::move(__in)); } template constexpr const typename tuple_element<_Int, std::pair<_Tp1, _Tp2>>::type& get(const std::pair<_Tp1, _Tp2>& __in) noexcept { return __pair_get<_Int>::__const_get(__in); } #if __cplusplus > 201103L #define __cpp_lib_tuples_by_type 201304 template constexpr _Tp& get(pair<_Tp, _Up>& __p) noexcept { return __p.first; } template constexpr const _Tp& get(const pair<_Tp, _Up>& __p) noexcept { return __p.first; } template constexpr _Tp&& get(pair<_Tp, _Up>&& __p) noexcept { return std::move(__p.first); } template constexpr _Tp& get(pair<_Up, _Tp>& __p) noexcept { return __p.second; } template constexpr const _Tp& get(const pair<_Up, _Tp>& __p) noexcept { return __p.second; } template constexpr _Tp&& get(pair<_Up, _Tp>&& __p) noexcept { return std::move(__p.second); } #define __cpp_lib_exchange_function 201304 /// Assign @p __new_val to @p __obj and return its previous value. template inline _Tp exchange(_Tp& __obj, _Up&& __new_val) { return std::__exchange(__obj, std::forward<_Up>(__new_val)); } #endif # 202 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/utility" 3 // Stores a tuple of indices. Used by tuple and pair, and by bind() to // extract the elements in a tuple. template struct _Index_tuple { typedef _Index_tuple<_Indexes..., sizeof...(_Indexes)> __next; }; // Builds an _Index_tuple<0, 1, 2, ..., _Num-1>. template struct _Build_index_tuple { typedef typename _Build_index_tuple<_Num - 1>::__type::__next __type; }; template<> struct _Build_index_tuple<0> { typedef _Index_tuple<> __type; }; #if __cplusplus > 201103L #define __cpp_lib_integer_sequence 201304 /// Class template integer_sequence template struct integer_sequence { typedef _Tp value_type; static constexpr size_t size() { return sizeof...(_Idx); } }; template::__type> struct _Make_integer_sequence; template struct _Make_integer_sequence<_Tp, _Num, _Index_tuple<_Idx...>> { static_assert( _Num >= 0, "Cannot make integer sequence of negative length" ); typedef integer_sequence<_Tp, static_cast<_Tp>(_Idx)...> __type; }; /// Alias template make_integer_sequence template using make_integer_sequence = typename _Make_integer_sequence<_Tp, _Num>::__type; /// Alias template index_sequence template using index_sequence = integer_sequence; /// Alias template make_index_sequence template using make_index_sequence = make_integer_sequence; /// Alias template index_sequence_for template using index_sequence_for = make_index_sequence; #endif # 266 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/utility" 3 _GLIBCXX_END_NAMESPACE_VERSION } // namespace #endif # 271 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/utility" 3 #endif /* _GLIBCXX_UTILITY */ # 273 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/utility" 3 # 61 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/algorithm" 2 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 61 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/algorithm" 3 # 62 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/algorithm" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 62 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/algorithm" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algo.h" 1 3 // Algorithm implementation -*- C++ -*- // Copyright (C) 2001-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /* * * Copyright (c) 1994 * Hewlett-Packard Company * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Hewlett-Packard Company makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. * * * Copyright (c) 1996 * Silicon Graphics Computer Systems, Inc. * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Silicon Graphics makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. */ /** @file bits/stl_algo.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{algorithm} */ #ifndef _STL_ALGO_H #define _STL_ALGO_H 1 #if 0 /* expanded by -frewrite-includes */ #include // for rand #endif /* expanded by -frewrite-includes */ # 59 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algo.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 1 3 // -*- C++ -*- forwarding header. // Copyright (C) 1997-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file include/cstdlib * This is a Standard C++ Library file. You should @c \#include this file * in your programs, rather than any of the @a *.h implementation files. * * This is the C++ version of the Standard C Library header @c stdlib.h, * and its contents are (mostly) the same as that header, but are all * contained in the namespace @c std (except for names which are defined * as macros in C). */ // // ISO C++ 14882: 20.4.6 C library // #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #ifndef _GLIBCXX_CSTDLIB #define _GLIBCXX_CSTDLIB 1 #if !_GLIBCXX_HOSTED // The C standard does not require a freestanding implementation to // provide . However, the C++ standard does still require // -- but only the functionality mentioned in // [lib.support.start.term]. #define EXIT_SUCCESS 0 #define EXIT_FAILURE 1 namespace std { extern "C" void abort(void) throw () _GLIBCXX_NORETURN; extern "C" int atexit(void (*)(void)) throw (); extern "C" void exit(int) throw () _GLIBCXX_NORETURN; #if __cplusplus >= 201103L # ifdef _GLIBCXX_HAVE_AT_QUICK_EXIT extern "C" int at_quick_exit(void (*)(void)) throw (); # endif # 64 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 # ifdef _GLIBCXX_HAVE_QUICK_EXIT extern "C" void quick_exit(int) throw() _GLIBCXX_NORETURN; # endif # 67 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #endif # 68 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 } // namespace std #else # 71 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 72 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 # 73 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 // Get rid of those macros defined in in lieu of real functions. #undef abort #undef abs #undef atexit #if __cplusplus >= 201103L # ifdef _GLIBCXX_HAVE_AT_QUICK_EXIT # undef at_quick_exit # endif # 82 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #endif # 83 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #undef atof #undef atoi #undef atol #undef bsearch #undef calloc #undef div #undef exit #undef free #undef getenv #undef labs #undef ldiv #undef malloc #undef mblen #undef mbstowcs #undef mbtowc #undef qsort #if __cplusplus >= 201103L # ifdef _GLIBCXX_HAVE_QUICK_EXIT # undef quick_exit # endif # 103 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #endif # 104 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #undef rand #undef realloc #undef srand #undef strtod #undef strtol #undef strtoul #undef system #undef wcstombs #undef wctomb namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION using ::div_t; using ::ldiv_t; using ::abort; using ::abs; using ::atexit; #if __cplusplus >= 201103L # ifdef _GLIBCXX_HAVE_AT_QUICK_EXIT using ::at_quick_exit; # endif # 128 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #endif # 129 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 using ::atof; using ::atoi; using ::atol; using ::bsearch; using ::calloc; using ::div; using ::exit; using ::free; using ::getenv; using ::labs; using ::ldiv; using ::malloc; #ifdef _GLIBCXX_HAVE_MBSTATE_T using ::mblen; using ::mbstowcs; using ::mbtowc; #endif // _GLIBCXX_HAVE_MBSTATE_T # 146 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 using ::qsort; #if __cplusplus >= 201103L # ifdef _GLIBCXX_HAVE_QUICK_EXIT using ::quick_exit; # endif # 151 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #endif # 152 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 using ::rand; using ::realloc; using ::srand; using ::strtod; using ::strtol; using ::strtoul; using ::system; #ifdef _GLIBCXX_USE_WCHAR_T using ::wcstombs; using ::wctomb; #endif // _GLIBCXX_USE_WCHAR_T # 163 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #ifndef __CORRECT_ISO_CPP_STDLIB_H_PROTO inline long abs(long __i) { return __builtin_labs(__i); } inline ldiv_t div(long __i, long __j) { return ldiv(__i, __j); } #endif # 171 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #ifdef _GLIBCXX_USE_LONG_LONG inline long long abs(long long __x) { return __builtin_llabs (__x); } #endif # 176 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #if defined(__GLIBCXX_TYPE_INT_N_0) inline __GLIBCXX_TYPE_INT_N_0 abs(__GLIBCXX_TYPE_INT_N_0 __x) { return __x >= 0 ? __x : -__x; } #endif # 181 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #if defined(__GLIBCXX_TYPE_INT_N_1) inline __GLIBCXX_TYPE_INT_N_1 abs(__GLIBCXX_TYPE_INT_N_1 __x) { return __x >= 0 ? __x : -__x; } #endif # 185 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #if defined(__GLIBCXX_TYPE_INT_N_2) inline __GLIBCXX_TYPE_INT_N_2 abs(__GLIBCXX_TYPE_INT_N_2 __x) { return __x >= 0 ? __x : -__x; } #endif # 189 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #if defined(__GLIBCXX_TYPE_INT_N_3) inline __GLIBCXX_TYPE_INT_N_3 abs(__GLIBCXX_TYPE_INT_N_3 __x) { return __x >= 0 ? __x : -__x; } #endif # 193 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 _GLIBCXX_END_NAMESPACE_VERSION } // namespace #if _GLIBCXX_USE_C99 #undef _Exit #undef llabs #undef lldiv #undef atoll #undef strtoll #undef strtoull #undef strtof #undef strtold namespace __gnu_cxx _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC using ::lldiv_t; #endif # 216 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC extern "C" void (_Exit)(int) throw () _GLIBCXX_NORETURN; #endif # 219 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #if !_GLIBCXX_USE_C99_DYNAMIC using ::_Exit; #endif # 222 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC using ::llabs; inline lldiv_t div(long long __n, long long __d) { lldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; } using ::lldiv; #endif # 232 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #if _GLIBCXX_USE_C99_LONG_LONG_CHECK || _GLIBCXX_USE_C99_LONG_LONG_DYNAMIC extern "C" long long int (atoll)(const char *) throw (); extern "C" long long int (strtoll)(const char * __restrict, char ** __restrict, int) throw (); extern "C" unsigned long long int (strtoull)(const char * __restrict, char ** __restrict, int) throw (); #endif # 240 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC using ::atoll; using ::strtoll; using ::strtoull; #endif # 245 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 using ::strtof; using ::strtold; _GLIBCXX_END_NAMESPACE_VERSION } // namespace __gnu_cxx namespace std { #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC using ::__gnu_cxx::lldiv_t; #endif # 256 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 using ::__gnu_cxx::_Exit; #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC using ::__gnu_cxx::llabs; using ::__gnu_cxx::div; using ::__gnu_cxx::lldiv; #endif # 262 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 using ::__gnu_cxx::atoll; using ::__gnu_cxx::strtof; using ::__gnu_cxx::strtoll; using ::__gnu_cxx::strtoull; using ::__gnu_cxx::strtold; } // namespace std #endif // _GLIBCXX_USE_C99 # 270 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #endif // !_GLIBCXX_HOSTED # 272 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 #endif # 274 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdlib" 3 # 60 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algo.h" 2 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 60 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algo.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/algorithmfwd.h" 1 3 // Forward declarations -*- C++ -*- // Copyright (C) 2007-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file bits/algorithmfwd.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{algorithm} */ #ifndef _GLIBCXX_ALGORITHMFWD_H #define _GLIBCXX_ALGORITHMFWD_H 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 34 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/algorithmfwd.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 35 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/algorithmfwd.h" 3 # 36 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/algorithmfwd.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 36 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/algorithmfwd.h" 3 # 37 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/algorithmfwd.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 37 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/algorithmfwd.h" 3 # 38 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/algorithmfwd.h" 3 #if __cplusplus >= 201103L #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/algorithmfwd.h" 3 # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/algorithmfwd.h" 3 #endif # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/algorithmfwd.h" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION /* adjacent_find all_of (C++0x) any_of (C++0x) binary_search copy copy_backward copy_if (C++0x) copy_n (C++0x) count count_if equal equal_range fill fill_n find find_end find_first_of find_if find_if_not (C++0x) for_each generate generate_n includes inplace_merge is_heap (C++0x) is_heap_until (C++0x) is_partitioned (C++0x) is_sorted (C++0x) is_sorted_until (C++0x) iter_swap lexicographical_compare lower_bound make_heap max max_element merge min min_element minmax (C++0x) minmax_element (C++0x) mismatch next_permutation none_of (C++0x) nth_element partial_sort partial_sort_copy partition partition_copy (C++0x) partition_point (C++0x) pop_heap prev_permutation push_heap random_shuffle remove remove_copy remove_copy_if remove_if replace replace_copy replace_copy_if replace_if reverse reverse_copy rotate rotate_copy search search_n set_difference set_intersection set_symmetric_difference set_union shuffle (C++0x) sort sort_heap stable_partition stable_sort swap swap_ranges transform unique unique_copy upper_bound */ /** * @defgroup algorithms Algorithms * * Components for performing algorithmic operations. Includes * non-modifying sequence, modifying (mutating) sequence, sorting, * searching, merge, partition, heap, set, minima, maxima, and * permutation operations. */ /** * @defgroup mutating_algorithms Mutating * @ingroup algorithms */ /** * @defgroup non_mutating_algorithms Non-Mutating * @ingroup algorithms */ /** * @defgroup sorting_algorithms Sorting * @ingroup algorithms */ /** * @defgroup set_algorithms Set Operation * @ingroup sorting_algorithms * * These algorithms are common set operations performed on sequences * that are already sorted. The number of comparisons will be * linear. */ /** * @defgroup binary_search_algorithms Binary Search * @ingroup sorting_algorithms * * These algorithms are variations of a classic binary search, and * all assume that the sequence being searched is already sorted. * * The number of comparisons will be logarithmic (and as few as * possible). The number of steps through the sequence will be * logarithmic for random-access iterators (e.g., pointers), and * linear otherwise. * * The LWG has passed Defect Report 270, which notes: The * proposed resolution reinterprets binary search. Instead of * thinking about searching for a value in a sorted range, we view * that as an important special case of a more general algorithm: * searching for the partition point in a partitioned range. We * also add a guarantee that the old wording did not: we ensure that * the upper bound is no earlier than the lower bound, that the pair * returned by equal_range is a valid range, and that the first part * of that pair is the lower bound. * * The actual effect of the first sentence is that a comparison * functor passed by the user doesn't necessarily need to induce a * strict weak ordering relation. Rather, it partitions the range. */ // adjacent_find #if __cplusplus >= 201103L template bool all_of(_IIter, _IIter, _Predicate); template bool any_of(_IIter, _IIter, _Predicate); #endif # 202 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/algorithmfwd.h" 3 template bool binary_search(_FIter, _FIter, const _Tp&); template bool binary_search(_FIter, _FIter, const _Tp&, _Compare); template _OIter copy(_IIter, _IIter, _OIter); template _BIter2 copy_backward(_BIter1, _BIter1, _BIter2); #if __cplusplus >= 201103L template _OIter copy_if(_IIter, _IIter, _OIter, _Predicate); template _OIter copy_n(_IIter, _Size, _OIter); #endif # 228 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/algorithmfwd.h" 3 // count // count_if template pair<_FIter, _FIter> equal_range(_FIter, _FIter, const _Tp&); template pair<_FIter, _FIter> equal_range(_FIter, _FIter, const _Tp&, _Compare); template void fill(_FIter, _FIter, const _Tp&); template _OIter fill_n(_OIter, _Size, const _Tp&); // find template _FIter1 find_end(_FIter1, _FIter1, _FIter2, _FIter2); template _FIter1 find_end(_FIter1, _FIter1, _FIter2, _FIter2, _BinaryPredicate); // find_first_of // find_if #if __cplusplus >= 201103L template _IIter find_if_not(_IIter, _IIter, _Predicate); #endif # 266 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/algorithmfwd.h" 3 // for_each // generate // generate_n template bool includes(_IIter1, _IIter1, _IIter2, _IIter2); template bool includes(_IIter1, _IIter1, _IIter2, _IIter2, _Compare); template void inplace_merge(_BIter, _BIter, _BIter); template void inplace_merge(_BIter, _BIter, _BIter, _Compare); #if __cplusplus >= 201103L template bool is_heap(_RAIter, _RAIter); template bool is_heap(_RAIter, _RAIter, _Compare); template _RAIter is_heap_until(_RAIter, _RAIter); template _RAIter is_heap_until(_RAIter, _RAIter, _Compare); template bool is_partitioned(_IIter, _IIter, _Predicate); template bool is_permutation(_FIter1, _FIter1, _FIter2); template bool is_permutation(_FIter1, _FIter1, _FIter2, _BinaryPredicate); template bool is_sorted(_FIter, _FIter); template bool is_sorted(_FIter, _FIter, _Compare); template _FIter is_sorted_until(_FIter, _FIter); template _FIter is_sorted_until(_FIter, _FIter, _Compare); #endif # 333 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/algorithmfwd.h" 3 template void iter_swap(_FIter1, _FIter2); template _FIter lower_bound(_FIter, _FIter, const _Tp&); template _FIter lower_bound(_FIter, _FIter, const _Tp&, _Compare); template void make_heap(_RAIter, _RAIter); template void make_heap(_RAIter, _RAIter, _Compare); template _GLIBCXX14_CONSTEXPR const _Tp& max(const _Tp&, const _Tp&); template _GLIBCXX14_CONSTEXPR const _Tp& max(const _Tp&, const _Tp&, _Compare); // max_element // merge template _GLIBCXX14_CONSTEXPR const _Tp& min(const _Tp&, const _Tp&); template _GLIBCXX14_CONSTEXPR const _Tp& min(const _Tp&, const _Tp&, _Compare); // min_element #if __cplusplus >= 201103L template _GLIBCXX14_CONSTEXPR pair minmax(const _Tp&, const _Tp&); template _GLIBCXX14_CONSTEXPR pair minmax(const _Tp&, const _Tp&, _Compare); template _GLIBCXX14_CONSTEXPR pair<_FIter, _FIter> minmax_element(_FIter, _FIter); template _GLIBCXX14_CONSTEXPR pair<_FIter, _FIter> minmax_element(_FIter, _FIter, _Compare); template _GLIBCXX14_CONSTEXPR _Tp min(initializer_list<_Tp>); template _GLIBCXX14_CONSTEXPR _Tp min(initializer_list<_Tp>, _Compare); template _GLIBCXX14_CONSTEXPR _Tp max(initializer_list<_Tp>); template _GLIBCXX14_CONSTEXPR _Tp max(initializer_list<_Tp>, _Compare); template _GLIBCXX14_CONSTEXPR pair<_Tp, _Tp> minmax(initializer_list<_Tp>); template _GLIBCXX14_CONSTEXPR pair<_Tp, _Tp> minmax(initializer_list<_Tp>, _Compare); #endif # 430 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/algorithmfwd.h" 3 // mismatch template bool next_permutation(_BIter, _BIter); template bool next_permutation(_BIter, _BIter, _Compare); #if __cplusplus >= 201103L template bool none_of(_IIter, _IIter, _Predicate); #endif # 446 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/algorithmfwd.h" 3 // nth_element // partial_sort template _RAIter partial_sort_copy(_IIter, _IIter, _RAIter, _RAIter); template _RAIter partial_sort_copy(_IIter, _IIter, _RAIter, _RAIter, _Compare); // partition #if __cplusplus >= 201103L template pair<_OIter1, _OIter2> partition_copy(_IIter, _IIter, _OIter1, _OIter2, _Predicate); template _FIter partition_point(_FIter, _FIter, _Predicate); #endif # 470 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/algorithmfwd.h" 3 template void pop_heap(_RAIter, _RAIter); template void pop_heap(_RAIter, _RAIter, _Compare); template bool prev_permutation(_BIter, _BIter); template bool prev_permutation(_BIter, _BIter, _Compare); template void push_heap(_RAIter, _RAIter); template void push_heap(_RAIter, _RAIter, _Compare); // random_shuffle template _FIter remove(_FIter, _FIter, const _Tp&); template _FIter remove_if(_FIter, _FIter, _Predicate); template _OIter remove_copy(_IIter, _IIter, _OIter, const _Tp&); template _OIter remove_copy_if(_IIter, _IIter, _OIter, _Predicate); // replace template _OIter replace_copy(_IIter, _IIter, _OIter, const _Tp&, const _Tp&); template _OIter replace_copy_if(_Iter, _Iter, _OIter, _Predicate, const _Tp&); // replace_if template void reverse(_BIter, _BIter); template _OIter reverse_copy(_BIter, _BIter, _OIter); inline namespace _V2 { template _FIter rotate(_FIter, _FIter, _FIter); } template _OIter rotate_copy(_FIter, _FIter, _FIter, _OIter); // search // search_n // set_difference // set_intersection // set_symmetric_difference // set_union #if (__cplusplus >= 201103L) && defined(_GLIBCXX_USE_C99_STDINT_TR1) template void shuffle(_RAIter, _RAIter, _UGenerator&&); #endif # 556 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/algorithmfwd.h" 3 template void sort_heap(_RAIter, _RAIter); template void sort_heap(_RAIter, _RAIter, _Compare); template _BIter stable_partition(_BIter, _BIter, _Predicate); template void swap(_Tp&, _Tp&) #if __cplusplus >= 201103L noexcept(__and_, is_nothrow_move_assignable<_Tp>>::value) #endif # 576 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/algorithmfwd.h" 3 ; template void swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm]) #if __cplusplus >= 201103L noexcept(noexcept(swap(*__a, *__b))) #endif # 584 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/algorithmfwd.h" 3 ; template _FIter2 swap_ranges(_FIter1, _FIter1, _FIter2); // transform template _FIter unique(_FIter, _FIter); template _FIter unique(_FIter, _FIter, _BinaryPredicate); // unique_copy template _FIter upper_bound(_FIter, _FIter, const _Tp&); template _FIter upper_bound(_FIter, _FIter, const _Tp&, _Compare); _GLIBCXX_END_NAMESPACE_VERSION _GLIBCXX_BEGIN_NAMESPACE_ALGO template _FIter adjacent_find(_FIter, _FIter); template _FIter adjacent_find(_FIter, _FIter, _BinaryPredicate); template typename iterator_traits<_IIter>::difference_type count(_IIter, _IIter, const _Tp&); template typename iterator_traits<_IIter>::difference_type count_if(_IIter, _IIter, _Predicate); template bool equal(_IIter1, _IIter1, _IIter2); template bool equal(_IIter1, _IIter1, _IIter2, _BinaryPredicate); template _IIter find(_IIter, _IIter, const _Tp&); template _FIter1 find_first_of(_FIter1, _FIter1, _FIter2, _FIter2); template _FIter1 find_first_of(_FIter1, _FIter1, _FIter2, _FIter2, _BinaryPredicate); template _IIter find_if(_IIter, _IIter, _Predicate); template _Funct for_each(_IIter, _IIter, _Funct); template void generate(_FIter, _FIter, _Generator); template _OIter generate_n(_OIter, _Size, _Generator); template bool lexicographical_compare(_IIter1, _IIter1, _IIter2, _IIter2); template bool lexicographical_compare(_IIter1, _IIter1, _IIter2, _IIter2, _Compare); template _GLIBCXX14_CONSTEXPR _FIter max_element(_FIter, _FIter); template _GLIBCXX14_CONSTEXPR _FIter max_element(_FIter, _FIter, _Compare); template _OIter merge(_IIter1, _IIter1, _IIter2, _IIter2, _OIter); template _OIter merge(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare); template _GLIBCXX14_CONSTEXPR _FIter min_element(_FIter, _FIter); template _GLIBCXX14_CONSTEXPR _FIter min_element(_FIter, _FIter, _Compare); template pair<_IIter1, _IIter2> mismatch(_IIter1, _IIter1, _IIter2); template pair<_IIter1, _IIter2> mismatch(_IIter1, _IIter1, _IIter2, _BinaryPredicate); template void nth_element(_RAIter, _RAIter, _RAIter); template void nth_element(_RAIter, _RAIter, _RAIter, _Compare); template void partial_sort(_RAIter, _RAIter, _RAIter); template void partial_sort(_RAIter, _RAIter, _RAIter, _Compare); template _BIter partition(_BIter, _BIter, _Predicate); template void random_shuffle(_RAIter, _RAIter); template void random_shuffle(_RAIter, _RAIter, #if __cplusplus >= 201103L _Generator&&); #else # 741 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/algorithmfwd.h" 3 _Generator&); #endif # 743 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/algorithmfwd.h" 3 template void replace(_FIter, _FIter, const _Tp&, const _Tp&); template void replace_if(_FIter, _FIter, _Predicate, const _Tp&); template _FIter1 search(_FIter1, _FIter1, _FIter2, _FIter2); template _FIter1 search(_FIter1, _FIter1, _FIter2, _FIter2, _BinaryPredicate); template _FIter search_n(_FIter, _FIter, _Size, const _Tp&); template _FIter search_n(_FIter, _FIter, _Size, const _Tp&, _BinaryPredicate); template _OIter set_difference(_IIter1, _IIter1, _IIter2, _IIter2, _OIter); template _OIter set_difference(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare); template _OIter set_intersection(_IIter1, _IIter1, _IIter2, _IIter2, _OIter); template _OIter set_intersection(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare); template _OIter set_symmetric_difference(_IIter1, _IIter1, _IIter2, _IIter2, _OIter); template _OIter set_symmetric_difference(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare); template _OIter set_union(_IIter1, _IIter1, _IIter2, _IIter2, _OIter); template _OIter set_union(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare); template void sort(_RAIter, _RAIter); template void sort(_RAIter, _RAIter, _Compare); template void stable_sort(_RAIter, _RAIter); template void stable_sort(_RAIter, _RAIter, _Compare); template _OIter transform(_IIter, _IIter, _OIter, _UnaryOperation); template _OIter transform(_IIter1, _IIter1, _IIter2, _OIter, _BinaryOperation); template _OIter unique_copy(_IIter, _IIter, _OIter); template _OIter unique_copy(_IIter, _IIter, _OIter, _BinaryPredicate); _GLIBCXX_END_NAMESPACE_ALGO } // namespace std #ifdef _GLIBCXX_PARALLEL #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 843 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/algorithmfwd.h" 3 # 844 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/algorithmfwd.h" 3 #endif # 845 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/algorithmfwd.h" 3 #endif # 847 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/algorithmfwd.h" 3 # 61 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algo.h" 2 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 61 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algo.h" 3 # 62 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algo.h" 3 #if 0 /* expanded by -frewrite-includes */ #include // for _Temporary_buffer #endif /* expanded by -frewrite-includes */ # 62 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algo.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tempbuf.h" 1 3 // Temporary buffer implementation -*- C++ -*- // Copyright (C) 2001-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /* * * Copyright (c) 1994 * Hewlett-Packard Company * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Hewlett-Packard Company makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. * * * Copyright (c) 1996,1997 * Silicon Graphics Computer Systems, Inc. * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Silicon Graphics makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. */ /** @file bits/stl_tempbuf.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{memory} */ #ifndef _STL_TEMPBUF_H #define _STL_TEMPBUF_H 1 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 59 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tempbuf.h" 3 # 60 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tempbuf.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 60 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tempbuf.h" 3 # 61 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tempbuf.h" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION /** * @brief Allocates a temporary buffer. * @param __len The number of objects of type Tp. * @return See full description. * * Reinventing the wheel, but this time with prettier spokes! * * This function tries to obtain storage for @c __len adjacent Tp * objects. The objects themselves are not constructed, of course. * A pair<> is returned containing the buffer s address and * capacity (in the units of sizeof(_Tp)), or a pair of 0 values if * no storage can be obtained. Note that the capacity obtained * may be less than that requested if the memory is unavailable; * you should compare len with the .second return value. * * Provides the nothrow exception guarantee. */ template pair<_Tp*, ptrdiff_t> get_temporary_buffer(ptrdiff_t __len) _GLIBCXX_NOEXCEPT { const ptrdiff_t __max = __gnu_cxx::__numeric_traits::__max / sizeof(_Tp); if (__len > __max) __len = __max; while (__len > 0) { _Tp* __tmp = static_cast<_Tp*>(::operator new(__len * sizeof(_Tp), std::nothrow)); if (__tmp != 0) return std::pair<_Tp*, ptrdiff_t>(__tmp, __len); __len /= 2; } return std::pair<_Tp*, ptrdiff_t>(static_cast<_Tp*>(0), 0); } /** * @brief The companion to get_temporary_buffer(). * @param __p A buffer previously allocated by get_temporary_buffer. * @return None. * * Frees the memory pointed to by __p. */ template inline void return_temporary_buffer(_Tp* __p) { ::operator delete(__p, std::nothrow); } /** * This class is used in two places: stl_algo.h and ext/memory, * where it is wrapped as the temporary_buffer class. See * temporary_buffer docs for more notes. */ template class _Temporary_buffer { // concept requirements __glibcxx_class_requires(_ForwardIterator, _ForwardIteratorConcept) public: typedef _Tp value_type; typedef value_type* pointer; typedef pointer iterator; typedef ptrdiff_t size_type; protected: size_type _M_original_len; size_type _M_len; pointer _M_buffer; public: /// As per Table mumble. size_type size() const { return _M_len; } /// Returns the size requested by the constructor; may be >size(). size_type requested_size() const { return _M_original_len; } /// As per Table mumble. iterator begin() { return _M_buffer; } /// As per Table mumble. iterator end() { return _M_buffer + _M_len; } /** * Constructs a temporary buffer of a size somewhere between * zero and the size of the given range. */ _Temporary_buffer(_ForwardIterator __first, _ForwardIterator __last); ~_Temporary_buffer() { std::_Destroy(_M_buffer, _M_buffer + _M_len); std::return_temporary_buffer(_M_buffer); } private: // Disable copy constructor and assignment operator. _Temporary_buffer(const _Temporary_buffer&); void operator=(const _Temporary_buffer&); }; template struct __uninitialized_construct_buf_dispatch { template static void __ucr(_Pointer __first, _Pointer __last, _ForwardIterator __seed) { if(__first == __last) return; _Pointer __cur = __first; __try { std::_Construct(std::__addressof(*__first), _GLIBCXX_MOVE(*__seed)); _Pointer __prev = __cur; ++__cur; for(; __cur != __last; ++__cur, ++__prev) std::_Construct(std::__addressof(*__cur), _GLIBCXX_MOVE(*__prev)); *__seed = _GLIBCXX_MOVE(*__prev); } __catch(...) { std::_Destroy(__first, __cur); __throw_exception_again; } } }; template<> struct __uninitialized_construct_buf_dispatch { template static void __ucr(_Pointer, _Pointer, _ForwardIterator) { } }; // Constructs objects in the range [first, last). // Note that while these new objects will take valid values, // their exact value is not defined. In particular they may // be 'moved from'. // // While *__seed may be altered during this algorithm, it will have // the same value when the algorithm finishes, unless one of the // constructions throws. // // Requirements: _Pointer::value_type(_Tp&&) is valid. template inline void __uninitialized_construct_buf(_Pointer __first, _Pointer __last, _ForwardIterator __seed) { typedef typename std::iterator_traits<_Pointer>::value_type _ValueType; std::__uninitialized_construct_buf_dispatch< __has_trivial_constructor(_ValueType)>:: __ucr(__first, __last, __seed); } template _Temporary_buffer<_ForwardIterator, _Tp>:: _Temporary_buffer(_ForwardIterator __first, _ForwardIterator __last) : _M_original_len(std::distance(__first, __last)), _M_len(0), _M_buffer(0) { __try { std::pair __p(std::get_temporary_buffer< value_type>(_M_original_len)); _M_buffer = __p.first; _M_len = __p.second; if (_M_buffer) std::__uninitialized_construct_buf(_M_buffer, _M_buffer + _M_len, __first); } __catch(...) { std::return_temporary_buffer(_M_buffer); _M_buffer = 0; _M_len = 0; __throw_exception_again; } } _GLIBCXX_END_NAMESPACE_VERSION } // namespace #endif /* _STL_TEMPBUF_H */ # 271 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_tempbuf.h" 3 # 63 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algo.h" 2 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 63 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algo.h" 3 # 64 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algo.h" 3 #if __cplusplus >= 201103L #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 66 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algo.h" 3 # 67 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algo.h" 3 #endif # 68 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algo.h" 3 // See concept_check.h for the __glibcxx_*_requires macros. namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION /// Swaps the median value of *__a, *__b and *__c under __comp to *__result template void __move_median_to_first(_Iterator __result,_Iterator __a, _Iterator __b, _Iterator __c, _Compare __comp) { if (__comp(__a, __b)) { if (__comp(__b, __c)) std::iter_swap(__result, __b); else if (__comp(__a, __c)) std::iter_swap(__result, __c); else std::iter_swap(__result, __a); } else if (__comp(__a, __c)) std::iter_swap(__result, __a); else if (__comp(__b, __c)) std::iter_swap(__result, __c); else std::iter_swap(__result, __b); } /// This is an overload used by find algos for the Input Iterator case. template inline _InputIterator __find_if(_InputIterator __first, _InputIterator __last, _Predicate __pred, input_iterator_tag) { while (__first != __last && !__pred(__first)) ++__first; return __first; } /// This is an overload used by find algos for the RAI case. template _RandomAccessIterator __find_if(_RandomAccessIterator __first, _RandomAccessIterator __last, _Predicate __pred, random_access_iterator_tag) { typename iterator_traits<_RandomAccessIterator>::difference_type __trip_count = (__last - __first) >> 2; for (; __trip_count > 0; --__trip_count) { if (__pred(__first)) return __first; ++__first; if (__pred(__first)) return __first; ++__first; if (__pred(__first)) return __first; ++__first; if (__pred(__first)) return __first; ++__first; } switch (__last - __first) { case 3: if (__pred(__first)) return __first; ++__first; case 2: if (__pred(__first)) return __first; ++__first; case 1: if (__pred(__first)) return __first; ++__first; case 0: default: return __last; } } template inline _Iterator __find_if(_Iterator __first, _Iterator __last, _Predicate __pred) { return __find_if(__first, __last, __pred, std::__iterator_category(__first)); } /// Provided for stable_partition to use. template inline _InputIterator __find_if_not(_InputIterator __first, _InputIterator __last, _Predicate __pred) { return std::__find_if(__first, __last, __gnu_cxx::__ops::__negate(__pred), std::__iterator_category(__first)); } /// Like find_if_not(), but uses and updates a count of the /// remaining range length instead of comparing against an end /// iterator. template _InputIterator __find_if_not_n(_InputIterator __first, _Distance& __len, _Predicate __pred) { for (; __len; --__len, ++__first) if (!__pred(__first)) break; return __first; } // set_difference // set_intersection // set_symmetric_difference // set_union // for_each // find // find_if // find_first_of // adjacent_find // count // count_if // search template _ForwardIterator1 __search(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __predicate) { // Test for empty ranges if (__first1 == __last1 || __first2 == __last2) return __first1; // Test for a pattern of length 1. _ForwardIterator2 __p1(__first2); if (++__p1 == __last2) return std::__find_if(__first1, __last1, __gnu_cxx::__ops::__iter_comp_iter(__predicate, __first2)); // General case. _ForwardIterator2 __p; _ForwardIterator1 __current = __first1; for (;;) { __first1 = std::__find_if(__first1, __last1, __gnu_cxx::__ops::__iter_comp_iter(__predicate, __first2)); if (__first1 == __last1) return __last1; __p = __p1; __current = __first1; if (++__current == __last1) return __last1; while (__predicate(__current, __p)) { if (++__p == __last2) return __first1; if (++__current == __last1) return __last1; } ++__first1; } return __first1; } // search_n /** * This is an helper function for search_n overloaded for forward iterators. */ template _ForwardIterator __search_n_aux(_ForwardIterator __first, _ForwardIterator __last, _Integer __count, _UnaryPredicate __unary_pred, std::forward_iterator_tag) { __first = std::__find_if(__first, __last, __unary_pred); while (__first != __last) { typename iterator_traits<_ForwardIterator>::difference_type __n = __count; _ForwardIterator __i = __first; ++__i; while (__i != __last && __n != 1 && __unary_pred(__i)) { ++__i; --__n; } if (__n == 1) return __first; if (__i == __last) return __last; __first = std::__find_if(++__i, __last, __unary_pred); } return __last; } /** * This is an helper function for search_n overloaded for random access * iterators. */ template _RandomAccessIter __search_n_aux(_RandomAccessIter __first, _RandomAccessIter __last, _Integer __count, _UnaryPredicate __unary_pred, std::random_access_iterator_tag) { typedef typename std::iterator_traits<_RandomAccessIter>::difference_type _DistanceType; _DistanceType __tailSize = __last - __first; _DistanceType __remainder = __count; while (__remainder <= __tailSize) // the main loop... { __first += __remainder; __tailSize -= __remainder; // __first here is always pointing to one past the last element of // next possible match. _RandomAccessIter __backTrack = __first; while (__unary_pred(--__backTrack)) { if (--__remainder == 0) return (__first - __count); // Success } __remainder = __count + 1 - (__first - __backTrack); } return __last; // Failure } template _ForwardIterator __search_n(_ForwardIterator __first, _ForwardIterator __last, _Integer __count, _UnaryPredicate __unary_pred) { if (__count <= 0) return __first; if (__count == 1) return std::__find_if(__first, __last, __unary_pred); return std::__search_n_aux(__first, __last, __count, __unary_pred, std::__iterator_category(__first)); } // find_end for forward iterators. template _ForwardIterator1 __find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2, forward_iterator_tag, forward_iterator_tag, _BinaryPredicate __comp) { if (__first2 == __last2) return __last1; _ForwardIterator1 __result = __last1; while (1) { _ForwardIterator1 __new_result = std::__search(__first1, __last1, __first2, __last2, __comp); if (__new_result == __last1) return __result; else { __result = __new_result; __first1 = __new_result; ++__first1; } } } // find_end for bidirectional iterators (much faster). template _BidirectionalIterator1 __find_end(_BidirectionalIterator1 __first1, _BidirectionalIterator1 __last1, _BidirectionalIterator2 __first2, _BidirectionalIterator2 __last2, bidirectional_iterator_tag, bidirectional_iterator_tag, _BinaryPredicate __comp) { // concept requirements __glibcxx_function_requires(_BidirectionalIteratorConcept< _BidirectionalIterator1>) __glibcxx_function_requires(_BidirectionalIteratorConcept< _BidirectionalIterator2>) typedef reverse_iterator<_BidirectionalIterator1> _RevIterator1; typedef reverse_iterator<_BidirectionalIterator2> _RevIterator2; _RevIterator1 __rlast1(__first1); _RevIterator2 __rlast2(__first2); _RevIterator1 __rresult = std::__search(_RevIterator1(__last1), __rlast1, _RevIterator2(__last2), __rlast2, __comp); if (__rresult == __rlast1) return __last1; else { _BidirectionalIterator1 __result = __rresult.base(); std::advance(__result, -std::distance(__first2, __last2)); return __result; } } /** * @brief Find last matching subsequence in a sequence. * @ingroup non_mutating_algorithms * @param __first1 Start of range to search. * @param __last1 End of range to search. * @param __first2 Start of sequence to match. * @param __last2 End of sequence to match. * @return The last iterator @c i in the range * @p [__first1,__last1-(__last2-__first2)) such that @c *(i+N) == * @p *(__first2+N) for each @c N in the range @p * [0,__last2-__first2), or @p __last1 if no such iterator exists. * * Searches the range @p [__first1,__last1) for a sub-sequence that * compares equal value-by-value with the sequence given by @p * [__first2,__last2) and returns an iterator to the __first * element of the sub-sequence, or @p __last1 if the sub-sequence * is not found. The sub-sequence will be the last such * subsequence contained in [__first1,__last1). * * Because the sub-sequence must lie completely within the range @p * [__first1,__last1) it must start at a position less than @p * __last1-(__last2-__first2) where @p __last2-__first2 is the * length of the sub-sequence. This means that the returned * iterator @c i will be in the range @p * [__first1,__last1-(__last2-__first2)) */ template inline _ForwardIterator1 find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2) { // concept requirements __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator1>) __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator2>) __glibcxx_function_requires(_EqualOpConcept< typename iterator_traits<_ForwardIterator1>::value_type, typename iterator_traits<_ForwardIterator2>::value_type>) __glibcxx_requires_valid_range(__first1, __last1); __glibcxx_requires_valid_range(__first2, __last2); return std::__find_end(__first1, __last1, __first2, __last2, std::__iterator_category(__first1), std::__iterator_category(__first2), __gnu_cxx::__ops::__iter_equal_to_iter()); } /** * @brief Find last matching subsequence in a sequence using a predicate. * @ingroup non_mutating_algorithms * @param __first1 Start of range to search. * @param __last1 End of range to search. * @param __first2 Start of sequence to match. * @param __last2 End of sequence to match. * @param __comp The predicate to use. * @return The last iterator @c i in the range @p * [__first1,__last1-(__last2-__first2)) such that @c * predicate(*(i+N), @p (__first2+N)) is true for each @c N in the * range @p [0,__last2-__first2), or @p __last1 if no such iterator * exists. * * Searches the range @p [__first1,__last1) for a sub-sequence that * compares equal value-by-value with the sequence given by @p * [__first2,__last2) using comp as a predicate and returns an * iterator to the first element of the sub-sequence, or @p __last1 * if the sub-sequence is not found. The sub-sequence will be the * last such subsequence contained in [__first,__last1). * * Because the sub-sequence must lie completely within the range @p * [__first1,__last1) it must start at a position less than @p * __last1-(__last2-__first2) where @p __last2-__first2 is the * length of the sub-sequence. This means that the returned * iterator @c i will be in the range @p * [__first1,__last1-(__last2-__first2)) */ template inline _ForwardIterator1 find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __comp) { // concept requirements __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator1>) __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator2>) __glibcxx_function_requires(_BinaryPredicateConcept<_BinaryPredicate, typename iterator_traits<_ForwardIterator1>::value_type, typename iterator_traits<_ForwardIterator2>::value_type>) __glibcxx_requires_valid_range(__first1, __last1); __glibcxx_requires_valid_range(__first2, __last2); return std::__find_end(__first1, __last1, __first2, __last2, std::__iterator_category(__first1), std::__iterator_category(__first2), __gnu_cxx::__ops::__iter_comp_iter(__comp)); } #if __cplusplus >= 201103L /** * @brief Checks that a predicate is true for all the elements * of a sequence. * @ingroup non_mutating_algorithms * @param __first An input iterator. * @param __last An input iterator. * @param __pred A predicate. * @return True if the check is true, false otherwise. * * Returns true if @p __pred is true for each element in the range * @p [__first,__last), and false otherwise. */ template inline bool all_of(_InputIterator __first, _InputIterator __last, _Predicate __pred) { return __last == std::find_if_not(__first, __last, __pred); } /** * @brief Checks that a predicate is false for all the elements * of a sequence. * @ingroup non_mutating_algorithms * @param __first An input iterator. * @param __last An input iterator. * @param __pred A predicate. * @return True if the check is true, false otherwise. * * Returns true if @p __pred is false for each element in the range * @p [__first,__last), and false otherwise. */ template inline bool none_of(_InputIterator __first, _InputIterator __last, _Predicate __pred) { return __last == _GLIBCXX_STD_A::find_if(__first, __last, __pred); } /** * @brief Checks that a predicate is false for at least an element * of a sequence. * @ingroup non_mutating_algorithms * @param __first An input iterator. * @param __last An input iterator. * @param __pred A predicate. * @return True if the check is true, false otherwise. * * Returns true if an element exists in the range @p * [__first,__last) such that @p __pred is true, and false * otherwise. */ template inline bool any_of(_InputIterator __first, _InputIterator __last, _Predicate __pred) { return !std::none_of(__first, __last, __pred); } /** * @brief Find the first element in a sequence for which a * predicate is false. * @ingroup non_mutating_algorithms * @param __first An input iterator. * @param __last An input iterator. * @param __pred A predicate. * @return The first iterator @c i in the range @p [__first,__last) * such that @p __pred(*i) is false, or @p __last if no such iterator exists. */ template inline _InputIterator find_if_not(_InputIterator __first, _InputIterator __last, _Predicate __pred) { // concept requirements __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) __glibcxx_function_requires(_UnaryPredicateConcept<_Predicate, typename iterator_traits<_InputIterator>::value_type>) __glibcxx_requires_valid_range(__first, __last); return std::__find_if_not(__first, __last, __gnu_cxx::__ops::__pred_iter(__pred)); } /** * @brief Checks whether the sequence is partitioned. * @ingroup mutating_algorithms * @param __first An input iterator. * @param __last An input iterator. * @param __pred A predicate. * @return True if the range @p [__first,__last) is partioned by @p __pred, * i.e. if all elements that satisfy @p __pred appear before those that * do not. */ template inline bool is_partitioned(_InputIterator __first, _InputIterator __last, _Predicate __pred) { __first = std::find_if_not(__first, __last, __pred); return std::none_of(__first, __last, __pred); } /** * @brief Find the partition point of a partitioned range. * @ingroup mutating_algorithms * @param __first An iterator. * @param __last Another iterator. * @param __pred A predicate. * @return An iterator @p mid such that @p all_of(__first, mid, __pred) * and @p none_of(mid, __last, __pred) are both true. */ template _ForwardIterator partition_point(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) { // concept requirements __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) __glibcxx_function_requires(_UnaryPredicateConcept<_Predicate, typename iterator_traits<_ForwardIterator>::value_type>) // A specific debug-mode test will be necessary... __glibcxx_requires_valid_range(__first, __last); typedef typename iterator_traits<_ForwardIterator>::difference_type _DistanceType; _DistanceType __len = std::distance(__first, __last); _DistanceType __half; _ForwardIterator __middle; while (__len > 0) { __half = __len >> 1; __middle = __first; std::advance(__middle, __half); if (__pred(*__middle)) { __first = __middle; ++__first; __len = __len - __half - 1; } else __len = __half; } return __first; } #endif # 635 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algo.h" 3 template _OutputIterator __remove_copy_if(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _Predicate __pred) { for (; __first != __last; ++__first) if (!__pred(__first)) { *__result = *__first; ++__result; } return __result; } /** * @brief Copy a sequence, removing elements of a given value. * @ingroup mutating_algorithms * @param __first An input iterator. * @param __last An input iterator. * @param __result An output iterator. * @param __value The value to be removed. * @return An iterator designating the end of the resulting sequence. * * Copies each element in the range @p [__first,__last) not equal * to @p __value to the range beginning at @p __result. * remove_copy() is stable, so the relative order of elements that * are copied is unchanged. */ template inline _OutputIterator remove_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result, const _Tp& __value) { // concept requirements __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, typename iterator_traits<_InputIterator>::value_type>) __glibcxx_function_requires(_EqualOpConcept< typename iterator_traits<_InputIterator>::value_type, _Tp>) __glibcxx_requires_valid_range(__first, __last); return std::__remove_copy_if(__first, __last, __result, __gnu_cxx::__ops::__iter_equals_val(__value)); } /** * @brief Copy a sequence, removing elements for which a predicate is true. * @ingroup mutating_algorithms * @param __first An input iterator. * @param __last An input iterator. * @param __result An output iterator. * @param __pred A predicate. * @return An iterator designating the end of the resulting sequence. * * Copies each element in the range @p [__first,__last) for which * @p __pred returns false to the range beginning at @p __result. * * remove_copy_if() is stable, so the relative order of elements that are * copied is unchanged. */ template inline _OutputIterator remove_copy_if(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _Predicate __pred) { // concept requirements __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, typename iterator_traits<_InputIterator>::value_type>) __glibcxx_function_requires(_UnaryPredicateConcept<_Predicate, typename iterator_traits<_InputIterator>::value_type>) __glibcxx_requires_valid_range(__first, __last); return std::__remove_copy_if(__first, __last, __result, __gnu_cxx::__ops::__pred_iter(__pred)); } #if __cplusplus >= 201103L /** * @brief Copy the elements of a sequence for which a predicate is true. * @ingroup mutating_algorithms * @param __first An input iterator. * @param __last An input iterator. * @param __result An output iterator. * @param __pred A predicate. * @return An iterator designating the end of the resulting sequence. * * Copies each element in the range @p [__first,__last) for which * @p __pred returns true to the range beginning at @p __result. * * copy_if() is stable, so the relative order of elements that are * copied is unchanged. */ template _OutputIterator copy_if(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _Predicate __pred) { // concept requirements __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, typename iterator_traits<_InputIterator>::value_type>) __glibcxx_function_requires(_UnaryPredicateConcept<_Predicate, typename iterator_traits<_InputIterator>::value_type>) __glibcxx_requires_valid_range(__first, __last); for (; __first != __last; ++__first) if (__pred(*__first)) { *__result = *__first; ++__result; } return __result; } template _OutputIterator __copy_n(_InputIterator __first, _Size __n, _OutputIterator __result, input_iterator_tag) { if (__n > 0) { while (true) { *__result = *__first; ++__result; if (--__n > 0) ++__first; else break; } } return __result; } template inline _OutputIterator __copy_n(_RandomAccessIterator __first, _Size __n, _OutputIterator __result, random_access_iterator_tag) { return std::copy(__first, __first + __n, __result); } /** * @brief Copies the range [first,first+n) into [result,result+n). * @ingroup mutating_algorithms * @param __first An input iterator. * @param __n The number of elements to copy. * @param __result An output iterator. * @return result+n. * * This inline function will boil down to a call to @c memmove whenever * possible. Failing that, if random access iterators are passed, then the * loop count will be known (and therefore a candidate for compiler * optimizations such as unrolling). */ template inline _OutputIterator copy_n(_InputIterator __first, _Size __n, _OutputIterator __result) { // concept requirements __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, typename iterator_traits<_InputIterator>::value_type>) return std::__copy_n(__first, __n, __result, std::__iterator_category(__first)); } /** * @brief Copy the elements of a sequence to separate output sequences * depending on the truth value of a predicate. * @ingroup mutating_algorithms * @param __first An input iterator. * @param __last An input iterator. * @param __out_true An output iterator. * @param __out_false An output iterator. * @param __pred A predicate. * @return A pair designating the ends of the resulting sequences. * * Copies each element in the range @p [__first,__last) for which * @p __pred returns true to the range beginning at @p out_true * and each element for which @p __pred returns false to @p __out_false. */ template pair<_OutputIterator1, _OutputIterator2> partition_copy(_InputIterator __first, _InputIterator __last, _OutputIterator1 __out_true, _OutputIterator2 __out_false, _Predicate __pred) { // concept requirements __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator1, typename iterator_traits<_InputIterator>::value_type>) __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator2, typename iterator_traits<_InputIterator>::value_type>) __glibcxx_function_requires(_UnaryPredicateConcept<_Predicate, typename iterator_traits<_InputIterator>::value_type>) __glibcxx_requires_valid_range(__first, __last); for (; __first != __last; ++__first) if (__pred(*__first)) { *__out_true = *__first; ++__out_true; } else { *__out_false = *__first; ++__out_false; } return pair<_OutputIterator1, _OutputIterator2>(__out_true, __out_false); } #endif # 854 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algo.h" 3 template _ForwardIterator __remove_if(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) { __first = std::__find_if(__first, __last, __pred); if (__first == __last) return __first; _ForwardIterator __result = __first; ++__first; for (; __first != __last; ++__first) if (!__pred(__first)) { *__result = _GLIBCXX_MOVE(*__first); ++__result; } return __result; } /** * @brief Remove elements from a sequence. * @ingroup mutating_algorithms * @param __first An input iterator. * @param __last An input iterator. * @param __value The value to be removed. * @return An iterator designating the end of the resulting sequence. * * All elements equal to @p __value are removed from the range * @p [__first,__last). * * remove() is stable, so the relative order of elements that are * not removed is unchanged. * * Elements between the end of the resulting sequence and @p __last * are still present, but their value is unspecified. */ template inline _ForwardIterator remove(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) { // concept requirements __glibcxx_function_requires(_Mutable_ForwardIteratorConcept< _ForwardIterator>) __glibcxx_function_requires(_EqualOpConcept< typename iterator_traits<_ForwardIterator>::value_type, _Tp>) __glibcxx_requires_valid_range(__first, __last); return std::__remove_if(__first, __last, __gnu_cxx::__ops::__iter_equals_val(__value)); } /** * @brief Remove elements from a sequence using a predicate. * @ingroup mutating_algorithms * @param __first A forward iterator. * @param __last A forward iterator. * @param __pred A predicate. * @return An iterator designating the end of the resulting sequence. * * All elements for which @p __pred returns true are removed from the range * @p [__first,__last). * * remove_if() is stable, so the relative order of elements that are * not removed is unchanged. * * Elements between the end of the resulting sequence and @p __last * are still present, but their value is unspecified. */ template inline _ForwardIterator remove_if(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) { // concept requirements __glibcxx_function_requires(_Mutable_ForwardIteratorConcept< _ForwardIterator>) __glibcxx_function_requires(_UnaryPredicateConcept<_Predicate, typename iterator_traits<_ForwardIterator>::value_type>) __glibcxx_requires_valid_range(__first, __last); return std::__remove_if(__first, __last, __gnu_cxx::__ops::__pred_iter(__pred)); } template _ForwardIterator __adjacent_find(_ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __binary_pred) { if (__first == __last) return __last; _ForwardIterator __next = __first; while (++__next != __last) { if (__binary_pred(__first, __next)) return __first; __first = __next; } return __last; } template _ForwardIterator __unique(_ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __binary_pred) { // Skip the beginning, if already unique. __first = std::__adjacent_find(__first, __last, __binary_pred); if (__first == __last) return __last; // Do the real copy work. _ForwardIterator __dest = __first; ++__first; while (++__first != __last) if (!__binary_pred(__dest, __first)) *++__dest = _GLIBCXX_MOVE(*__first); return ++__dest; } /** * @brief Remove consecutive duplicate values from a sequence. * @ingroup mutating_algorithms * @param __first A forward iterator. * @param __last A forward iterator. * @return An iterator designating the end of the resulting sequence. * * Removes all but the first element from each group of consecutive * values that compare equal. * unique() is stable, so the relative order of elements that are * not removed is unchanged. * Elements between the end of the resulting sequence and @p __last * are still present, but their value is unspecified. */ template inline _ForwardIterator unique(_ForwardIterator __first, _ForwardIterator __last) { // concept requirements __glibcxx_function_requires(_Mutable_ForwardIteratorConcept< _ForwardIterator>) __glibcxx_function_requires(_EqualityComparableConcept< typename iterator_traits<_ForwardIterator>::value_type>) __glibcxx_requires_valid_range(__first, __last); return std::__unique(__first, __last, __gnu_cxx::__ops::__iter_equal_to_iter()); } /** * @brief Remove consecutive values from a sequence using a predicate. * @ingroup mutating_algorithms * @param __first A forward iterator. * @param __last A forward iterator. * @param __binary_pred A binary predicate. * @return An iterator designating the end of the resulting sequence. * * Removes all but the first element from each group of consecutive * values for which @p __binary_pred returns true. * unique() is stable, so the relative order of elements that are * not removed is unchanged. * Elements between the end of the resulting sequence and @p __last * are still present, but their value is unspecified. */ template inline _ForwardIterator unique(_ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __binary_pred) { // concept requirements __glibcxx_function_requires(_Mutable_ForwardIteratorConcept< _ForwardIterator>) __glibcxx_function_requires(_BinaryPredicateConcept<_BinaryPredicate, typename iterator_traits<_ForwardIterator>::value_type, typename iterator_traits<_ForwardIterator>::value_type>) __glibcxx_requires_valid_range(__first, __last); return std::__unique(__first, __last, __gnu_cxx::__ops::__iter_comp_iter(__binary_pred)); } /** * This is an uglified * unique_copy(_InputIterator, _InputIterator, _OutputIterator, * _BinaryPredicate) * overloaded for forward iterators and output iterator as result. */ template _OutputIterator __unique_copy(_ForwardIterator __first, _ForwardIterator __last, _OutputIterator __result, _BinaryPredicate __binary_pred, forward_iterator_tag, output_iterator_tag) { // concept requirements -- iterators already checked __glibcxx_function_requires(_BinaryPredicateConcept<_BinaryPredicate, typename iterator_traits<_ForwardIterator>::value_type, typename iterator_traits<_ForwardIterator>::value_type>) _ForwardIterator __next = __first; *__result = *__first; while (++__next != __last) if (!__binary_pred(__first, __next)) { __first = __next; *++__result = *__first; } return ++__result; } /** * This is an uglified * unique_copy(_InputIterator, _InputIterator, _OutputIterator, * _BinaryPredicate) * overloaded for input iterators and output iterator as result. */ template _OutputIterator __unique_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _BinaryPredicate __binary_pred, input_iterator_tag, output_iterator_tag) { // concept requirements -- iterators already checked __glibcxx_function_requires(_BinaryPredicateConcept<_BinaryPredicate, typename iterator_traits<_InputIterator>::value_type, typename iterator_traits<_InputIterator>::value_type>) typename iterator_traits<_InputIterator>::value_type __value = *__first; __decltype(__gnu_cxx::__ops::__iter_comp_val(__binary_pred)) __rebound_pred = __gnu_cxx::__ops::__iter_comp_val(__binary_pred); *__result = __value; while (++__first != __last) if (!__rebound_pred(__first, __value)) { __value = *__first; *++__result = __value; } return ++__result; } /** * This is an uglified * unique_copy(_InputIterator, _InputIterator, _OutputIterator, * _BinaryPredicate) * overloaded for input iterators and forward iterator as result. */ template _ForwardIterator __unique_copy(_InputIterator __first, _InputIterator __last, _ForwardIterator __result, _BinaryPredicate __binary_pred, input_iterator_tag, forward_iterator_tag) { // concept requirements -- iterators already checked __glibcxx_function_requires(_BinaryPredicateConcept<_BinaryPredicate, typename iterator_traits<_ForwardIterator>::value_type, typename iterator_traits<_InputIterator>::value_type>) *__result = *__first; while (++__first != __last) if (!__binary_pred(__result, __first)) *++__result = *__first; return ++__result; } /** * This is an uglified reverse(_BidirectionalIterator, * _BidirectionalIterator) * overloaded for bidirectional iterators. */ template void __reverse(_BidirectionalIterator __first, _BidirectionalIterator __last, bidirectional_iterator_tag) { while (true) if (__first == __last || __first == --__last) return; else { std::iter_swap(__first, __last); ++__first; } } /** * This is an uglified reverse(_BidirectionalIterator, * _BidirectionalIterator) * overloaded for random access iterators. */ template void __reverse(_RandomAccessIterator __first, _RandomAccessIterator __last, random_access_iterator_tag) { if (__first == __last) return; --__last; while (__first < __last) { std::iter_swap(__first, __last); ++__first; --__last; } } /** * @brief Reverse a sequence. * @ingroup mutating_algorithms * @param __first A bidirectional iterator. * @param __last A bidirectional iterator. * @return reverse() returns no value. * * Reverses the order of the elements in the range @p [__first,__last), * so that the first element becomes the last etc. * For every @c i such that @p 0<=i<=(__last-__first)/2), @p reverse() * swaps @p *(__first+i) and @p *(__last-(i+1)) */ template inline void reverse(_BidirectionalIterator __first, _BidirectionalIterator __last) { // concept requirements __glibcxx_function_requires(_Mutable_BidirectionalIteratorConcept< _BidirectionalIterator>) __glibcxx_requires_valid_range(__first, __last); std::__reverse(__first, __last, std::__iterator_category(__first)); } /** * @brief Copy a sequence, reversing its elements. * @ingroup mutating_algorithms * @param __first A bidirectional iterator. * @param __last A bidirectional iterator. * @param __result An output iterator. * @return An iterator designating the end of the resulting sequence. * * Copies the elements in the range @p [__first,__last) to the * range @p [__result,__result+(__last-__first)) such that the * order of the elements is reversed. For every @c i such that @p * 0<=i<=(__last-__first), @p reverse_copy() performs the * assignment @p *(__result+(__last-__first)-1-i) = *(__first+i). * The ranges @p [__first,__last) and @p * [__result,__result+(__last-__first)) must not overlap. */ template _OutputIterator reverse_copy(_BidirectionalIterator __first, _BidirectionalIterator __last, _OutputIterator __result) { // concept requirements __glibcxx_function_requires(_BidirectionalIteratorConcept< _BidirectionalIterator>) __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, typename iterator_traits<_BidirectionalIterator>::value_type>) __glibcxx_requires_valid_range(__first, __last); while (__first != __last) { --__last; *__result = *__last; ++__result; } return __result; } /** * This is a helper function for the rotate algorithm specialized on RAIs. * It returns the greatest common divisor of two integer values. */ template _EuclideanRingElement __gcd(_EuclideanRingElement __m, _EuclideanRingElement __n) { while (__n != 0) { _EuclideanRingElement __t = __m % __n; __m = __n; __n = __t; } return __m; } inline namespace _V2 { /// This is a helper function for the rotate algorithm. template _ForwardIterator __rotate(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last, forward_iterator_tag) { if (__first == __middle) return __last; else if (__last == __middle) return __first; _ForwardIterator __first2 = __middle; do { std::iter_swap(__first, __first2); ++__first; ++__first2; if (__first == __middle) __middle = __first2; } while (__first2 != __last); _ForwardIterator __ret = __first; __first2 = __middle; while (__first2 != __last) { std::iter_swap(__first, __first2); ++__first; ++__first2; if (__first == __middle) __middle = __first2; else if (__first2 == __last) __first2 = __middle; } return __ret; } /// This is a helper function for the rotate algorithm. template _BidirectionalIterator __rotate(_BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last, bidirectional_iterator_tag) { // concept requirements __glibcxx_function_requires(_Mutable_BidirectionalIteratorConcept< _BidirectionalIterator>) if (__first == __middle) return __last; else if (__last == __middle) return __first; std::__reverse(__first, __middle, bidirectional_iterator_tag()); std::__reverse(__middle, __last, bidirectional_iterator_tag()); while (__first != __middle && __middle != __last) { std::iter_swap(__first, --__last); ++__first; } if (__first == __middle) { std::__reverse(__middle, __last, bidirectional_iterator_tag()); return __last; } else { std::__reverse(__first, __middle, bidirectional_iterator_tag()); return __first; } } /// This is a helper function for the rotate algorithm. template _RandomAccessIterator __rotate(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last, random_access_iterator_tag) { // concept requirements __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept< _RandomAccessIterator>) if (__first == __middle) return __last; else if (__last == __middle) return __first; typedef typename iterator_traits<_RandomAccessIterator>::difference_type _Distance; typedef typename iterator_traits<_RandomAccessIterator>::value_type _ValueType; _Distance __n = __last - __first; _Distance __k = __middle - __first; if (__k == __n - __k) { std::swap_ranges(__first, __middle, __middle); return __middle; } _RandomAccessIterator __p = __first; _RandomAccessIterator __ret = __first + (__last - __middle); for (;;) { if (__k < __n - __k) { if (__is_pod(_ValueType) && __k == 1) { _ValueType __t = _GLIBCXX_MOVE(*__p); _GLIBCXX_MOVE3(__p + 1, __p + __n, __p); *(__p + __n - 1) = _GLIBCXX_MOVE(__t); return __ret; } _RandomAccessIterator __q = __p + __k; for (_Distance __i = 0; __i < __n - __k; ++ __i) { std::iter_swap(__p, __q); ++__p; ++__q; } __n %= __k; if (__n == 0) return __ret; std::swap(__n, __k); __k = __n - __k; } else { __k = __n - __k; if (__is_pod(_ValueType) && __k == 1) { _ValueType __t = _GLIBCXX_MOVE(*(__p + __n - 1)); _GLIBCXX_MOVE_BACKWARD3(__p, __p + __n - 1, __p + __n); *__p = _GLIBCXX_MOVE(__t); return __ret; } _RandomAccessIterator __q = __p + __n; __p = __q - __k; for (_Distance __i = 0; __i < __n - __k; ++ __i) { --__p; --__q; std::iter_swap(__p, __q); } __n %= __k; if (__n == 0) return __ret; std::swap(__n, __k); } } } // _GLIBCXX_RESOLVE_LIB_DEFECTS // DR 488. rotate throws away useful information /** * @brief Rotate the elements of a sequence. * @ingroup mutating_algorithms * @param __first A forward iterator. * @param __middle A forward iterator. * @param __last A forward iterator. * @return first + (last - middle). * * Rotates the elements of the range @p [__first,__last) by * @p (__middle - __first) positions so that the element at @p __middle * is moved to @p __first, the element at @p __middle+1 is moved to * @p __first+1 and so on for each element in the range * @p [__first,__last). * * This effectively swaps the ranges @p [__first,__middle) and * @p [__middle,__last). * * Performs * @p *(__first+(n+(__last-__middle))%(__last-__first))=*(__first+n) * for each @p n in the range @p [0,__last-__first). */ template inline _ForwardIterator rotate(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last) { // concept requirements __glibcxx_function_requires(_Mutable_ForwardIteratorConcept< _ForwardIterator>) __glibcxx_requires_valid_range(__first, __middle); __glibcxx_requires_valid_range(__middle, __last); return std::__rotate(__first, __middle, __last, std::__iterator_category(__first)); } } // namespace _V2 /** * @brief Copy a sequence, rotating its elements. * @ingroup mutating_algorithms * @param __first A forward iterator. * @param __middle A forward iterator. * @param __last A forward iterator. * @param __result An output iterator. * @return An iterator designating the end of the resulting sequence. * * Copies the elements of the range @p [__first,__last) to the * range beginning at @result, rotating the copied elements by * @p (__middle-__first) positions so that the element at @p __middle * is moved to @p __result, the element at @p __middle+1 is moved * to @p __result+1 and so on for each element in the range @p * [__first,__last). * * Performs * @p *(__result+(n+(__last-__middle))%(__last-__first))=*(__first+n) * for each @p n in the range @p [0,__last-__first). */ template inline _OutputIterator rotate_copy(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last, _OutputIterator __result) { // concept requirements __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, typename iterator_traits<_ForwardIterator>::value_type>) __glibcxx_requires_valid_range(__first, __middle); __glibcxx_requires_valid_range(__middle, __last); return std::copy(__first, __middle, std::copy(__middle, __last, __result)); } /// This is a helper function... template _ForwardIterator __partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred, forward_iterator_tag) { if (__first == __last) return __first; while (__pred(*__first)) if (++__first == __last) return __first; _ForwardIterator __next = __first; while (++__next != __last) if (__pred(*__next)) { std::iter_swap(__first, __next); ++__first; } return __first; } /// This is a helper function... template _BidirectionalIterator __partition(_BidirectionalIterator __first, _BidirectionalIterator __last, _Predicate __pred, bidirectional_iterator_tag) { while (true) { while (true) if (__first == __last) return __first; else if (__pred(*__first)) ++__first; else break; --__last; while (true) if (__first == __last) return __first; else if (!bool(__pred(*__last))) --__last; else break; std::iter_swap(__first, __last); ++__first; } } // partition /// This is a helper function... /// Requires __first != __last and !__pred(__first) /// and __len == distance(__first, __last). /// /// !__pred(__first) allows us to guarantee that we don't /// move-assign an element onto itself. template _ForwardIterator __stable_partition_adaptive(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred, _Distance __len, _Pointer __buffer, _Distance __buffer_size) { if (__len == 1) return __first; if (__len <= __buffer_size) { _ForwardIterator __result1 = __first; _Pointer __result2 = __buffer; // The precondition guarantees that !__pred(__first), so // move that element to the buffer before starting the loop. // This ensures that we only call __pred once per element. *__result2 = _GLIBCXX_MOVE(*__first); ++__result2; ++__first; for (; __first != __last; ++__first) if (__pred(__first)) { *__result1 = _GLIBCXX_MOVE(*__first); ++__result1; } else { *__result2 = _GLIBCXX_MOVE(*__first); ++__result2; } _GLIBCXX_MOVE3(__buffer, __result2, __result1); return __result1; } _ForwardIterator __middle = __first; std::advance(__middle, __len / 2); _ForwardIterator __left_split = std::__stable_partition_adaptive(__first, __middle, __pred, __len / 2, __buffer, __buffer_size); // Advance past true-predicate values to satisfy this // function's preconditions. _Distance __right_len = __len - __len / 2; _ForwardIterator __right_split = std::__find_if_not_n(__middle, __right_len, __pred); if (__right_len) __right_split = std::__stable_partition_adaptive(__right_split, __last, __pred, __right_len, __buffer, __buffer_size); std::rotate(__left_split, __middle, __right_split); std::advance(__left_split, std::distance(__middle, __right_split)); return __left_split; } template _ForwardIterator __stable_partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) { __first = std::__find_if_not(__first, __last, __pred); if (__first == __last) return __first; typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType; typedef typename iterator_traits<_ForwardIterator>::difference_type _DistanceType; _Temporary_buffer<_ForwardIterator, _ValueType> __buf(__first, __last); return std::__stable_partition_adaptive(__first, __last, __pred, _DistanceType(__buf.requested_size()), __buf.begin(), _DistanceType(__buf.size())); } /** * @brief Move elements for which a predicate is true to the beginning * of a sequence, preserving relative ordering. * @ingroup mutating_algorithms * @param __first A forward iterator. * @param __last A forward iterator. * @param __pred A predicate functor. * @return An iterator @p middle such that @p __pred(i) is true for each * iterator @p i in the range @p [first,middle) and false for each @p i * in the range @p [middle,last). * * Performs the same function as @p partition() with the additional * guarantee that the relative ordering of elements in each group is * preserved, so any two elements @p x and @p y in the range * @p [__first,__last) such that @p __pred(x)==__pred(y) will have the same * relative ordering after calling @p stable_partition(). */ template inline _ForwardIterator stable_partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) { // concept requirements __glibcxx_function_requires(_Mutable_ForwardIteratorConcept< _ForwardIterator>) __glibcxx_function_requires(_UnaryPredicateConcept<_Predicate, typename iterator_traits<_ForwardIterator>::value_type>) __glibcxx_requires_valid_range(__first, __last); return std::__stable_partition(__first, __last, __gnu_cxx::__ops::__pred_iter(__pred)); } /// This is a helper function for the sort routines. template void __heap_select(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last, _Compare __comp) { std::__make_heap(__first, __middle, __comp); for (_RandomAccessIterator __i = __middle; __i < __last; ++__i) if (__comp(__i, __first)) std::__pop_heap(__first, __middle, __i, __comp); } // partial_sort template _RandomAccessIterator __partial_sort_copy(_InputIterator __first, _InputIterator __last, _RandomAccessIterator __result_first, _RandomAccessIterator __result_last, _Compare __comp) { typedef typename iterator_traits<_InputIterator>::value_type _InputValueType; typedef iterator_traits<_RandomAccessIterator> _RItTraits; typedef typename _RItTraits::difference_type _DistanceType; if (__result_first == __result_last) return __result_last; _RandomAccessIterator __result_real_last = __result_first; while (__first != __last && __result_real_last != __result_last) { *__result_real_last = *__first; ++__result_real_last; ++__first; } std::__make_heap(__result_first, __result_real_last, __comp); while (__first != __last) { if (__comp(__first, __result_first)) std::__adjust_heap(__result_first, _DistanceType(0), _DistanceType(__result_real_last - __result_first), _InputValueType(*__first), __comp); ++__first; } std::__sort_heap(__result_first, __result_real_last, __comp); return __result_real_last; } /** * @brief Copy the smallest elements of a sequence. * @ingroup sorting_algorithms * @param __first An iterator. * @param __last Another iterator. * @param __result_first A random-access iterator. * @param __result_last Another random-access iterator. * @return An iterator indicating the end of the resulting sequence. * * Copies and sorts the smallest N values from the range @p [__first,__last) * to the range beginning at @p __result_first, where the number of * elements to be copied, @p N, is the smaller of @p (__last-__first) and * @p (__result_last-__result_first). * After the sort if @e i and @e j are iterators in the range * @p [__result_first,__result_first+N) such that i precedes j then * *j<*i is false. * The value returned is @p __result_first+N. */ template inline _RandomAccessIterator partial_sort_copy(_InputIterator __first, _InputIterator __last, _RandomAccessIterator __result_first, _RandomAccessIterator __result_last) { typedef typename iterator_traits<_InputIterator>::value_type _InputValueType; typedef typename iterator_traits<_RandomAccessIterator>::value_type _OutputValueType; typedef typename iterator_traits<_RandomAccessIterator>::difference_type _DistanceType; // concept requirements __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) __glibcxx_function_requires(_ConvertibleConcept<_InputValueType, _OutputValueType>) __glibcxx_function_requires(_LessThanOpConcept<_InputValueType, _OutputValueType>) __glibcxx_function_requires(_LessThanComparableConcept<_OutputValueType>) __glibcxx_requires_valid_range(__first, __last); __glibcxx_requires_valid_range(__result_first, __result_last); return std::__partial_sort_copy(__first, __last, __result_first, __result_last, __gnu_cxx::__ops::__iter_less_iter()); } /** * @brief Copy the smallest elements of a sequence using a predicate for * comparison. * @ingroup sorting_algorithms * @param __first An input iterator. * @param __last Another input iterator. * @param __result_first A random-access iterator. * @param __result_last Another random-access iterator. * @param __comp A comparison functor. * @return An iterator indicating the end of the resulting sequence. * * Copies and sorts the smallest N values from the range @p [__first,__last) * to the range beginning at @p result_first, where the number of * elements to be copied, @p N, is the smaller of @p (__last-__first) and * @p (__result_last-__result_first). * After the sort if @e i and @e j are iterators in the range * @p [__result_first,__result_first+N) such that i precedes j then * @p __comp(*j,*i) is false. * The value returned is @p __result_first+N. */ template inline _RandomAccessIterator partial_sort_copy(_InputIterator __first, _InputIterator __last, _RandomAccessIterator __result_first, _RandomAccessIterator __result_last, _Compare __comp) { typedef typename iterator_traits<_InputIterator>::value_type _InputValueType; typedef typename iterator_traits<_RandomAccessIterator>::value_type _OutputValueType; typedef typename iterator_traits<_RandomAccessIterator>::difference_type _DistanceType; // concept requirements __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept< _RandomAccessIterator>) __glibcxx_function_requires(_ConvertibleConcept<_InputValueType, _OutputValueType>) __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, _InputValueType, _OutputValueType>) __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, _OutputValueType, _OutputValueType>) __glibcxx_requires_valid_range(__first, __last); __glibcxx_requires_valid_range(__result_first, __result_last); return std::__partial_sort_copy(__first, __last, __result_first, __result_last, __gnu_cxx::__ops::__iter_comp_iter(__comp)); } /// This is a helper function for the sort routine. template void __unguarded_linear_insert(_RandomAccessIterator __last, _Compare __comp) { typename iterator_traits<_RandomAccessIterator>::value_type __val = _GLIBCXX_MOVE(*__last); _RandomAccessIterator __next = __last; --__next; while (__comp(__val, __next)) { *__last = _GLIBCXX_MOVE(*__next); __last = __next; --__next; } *__last = _GLIBCXX_MOVE(__val); } /// This is a helper function for the sort routine. template void __insertion_sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) { if (__first == __last) return; for (_RandomAccessIterator __i = __first + 1; __i != __last; ++__i) { if (__comp(__i, __first)) { typename iterator_traits<_RandomAccessIterator>::value_type __val = _GLIBCXX_MOVE(*__i); _GLIBCXX_MOVE_BACKWARD3(__first, __i, __i + 1); *__first = _GLIBCXX_MOVE(__val); } else std::__unguarded_linear_insert(__i, __gnu_cxx::__ops::__val_comp_iter(__comp)); } } /// This is a helper function for the sort routine. template inline void __unguarded_insertion_sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) { for (_RandomAccessIterator __i = __first; __i != __last; ++__i) std::__unguarded_linear_insert(__i, __gnu_cxx::__ops::__val_comp_iter(__comp)); } /** * @doctodo * This controls some aspect of the sort routines. */ enum { _S_threshold = 16 }; /// This is a helper function for the sort routine. template void __final_insertion_sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) { if (__last - __first > int(_S_threshold)) { std::__insertion_sort(__first, __first + int(_S_threshold), __comp); std::__unguarded_insertion_sort(__first + int(_S_threshold), __last, __comp); } else std::__insertion_sort(__first, __last, __comp); } /// This is a helper function... template _RandomAccessIterator __unguarded_partition(_RandomAccessIterator __first, _RandomAccessIterator __last, _RandomAccessIterator __pivot, _Compare __comp) { while (true) { while (__comp(__first, __pivot)) ++__first; --__last; while (__comp(__pivot, __last)) --__last; if (!(__first < __last)) return __first; std::iter_swap(__first, __last); ++__first; } } /// This is a helper function... template inline _RandomAccessIterator __unguarded_partition_pivot(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) { _RandomAccessIterator __mid = __first + (__last - __first) / 2; std::__move_median_to_first(__first, __first + 1, __mid, __last - 1, __comp); return std::__unguarded_partition(__first + 1, __last, __first, __comp); } template inline void __partial_sort(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last, _Compare __comp) { std::__heap_select(__first, __middle, __last, __comp); std::__sort_heap(__first, __middle, __comp); } /// This is a helper function for the sort routine. template void __introsort_loop(_RandomAccessIterator __first, _RandomAccessIterator __last, _Size __depth_limit, _Compare __comp) { while (__last - __first > int(_S_threshold)) { if (__depth_limit == 0) { std::__partial_sort(__first, __last, __last, __comp); return; } --__depth_limit; _RandomAccessIterator __cut = std::__unguarded_partition_pivot(__first, __last, __comp); std::__introsort_loop(__cut, __last, __depth_limit, __comp); __last = __cut; } } // sort template inline void __sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) { if (__first != __last) { std::__introsort_loop(__first, __last, std::__lg(__last - __first) * 2, __comp); std::__final_insertion_sort(__first, __last, __comp); } } template void __introselect(_RandomAccessIterator __first, _RandomAccessIterator __nth, _RandomAccessIterator __last, _Size __depth_limit, _Compare __comp) { while (__last - __first > 3) { if (__depth_limit == 0) { std::__heap_select(__first, __nth + 1, __last, __comp); // Place the nth largest element in its final position. std::iter_swap(__first, __nth); return; } --__depth_limit; _RandomAccessIterator __cut = std::__unguarded_partition_pivot(__first, __last, __comp); if (__cut <= __nth) __first = __cut; else __last = __cut; } std::__insertion_sort(__first, __last, __comp); } // nth_element // lower_bound moved to stl_algobase.h /** * @brief Finds the first position in which @p __val could be inserted * without changing the ordering. * @ingroup binary_search_algorithms * @param __first An iterator. * @param __last Another iterator. * @param __val The search term. * @param __comp A functor to use for comparisons. * @return An iterator pointing to the first element not less * than @p __val, or end() if every element is less * than @p __val. * @ingroup binary_search_algorithms * * The comparison function should have the same effects on ordering as * the function used for the initial sort. */ template inline _ForwardIterator lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __val, _Compare __comp) { typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType; // concept requirements __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, _ValueType, _Tp>) __glibcxx_requires_partitioned_lower_pred(__first, __last, __val, __comp); return std::__lower_bound(__first, __last, __val, __gnu_cxx::__ops::__iter_comp_val(__comp)); } template _ForwardIterator __upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __val, _Compare __comp) { typedef typename iterator_traits<_ForwardIterator>::difference_type _DistanceType; _DistanceType __len = std::distance(__first, __last); while (__len > 0) { _DistanceType __half = __len >> 1; _ForwardIterator __middle = __first; std::advance(__middle, __half); if (__comp(__val, __middle)) __len = __half; else { __first = __middle; ++__first; __len = __len - __half - 1; } } return __first; } /** * @brief Finds the last position in which @p __val could be inserted * without changing the ordering. * @ingroup binary_search_algorithms * @param __first An iterator. * @param __last Another iterator. * @param __val The search term. * @return An iterator pointing to the first element greater than @p __val, * or end() if no elements are greater than @p __val. * @ingroup binary_search_algorithms */ template inline _ForwardIterator upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __val) { typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType; // concept requirements __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) __glibcxx_function_requires(_LessThanOpConcept<_Tp, _ValueType>) __glibcxx_requires_partitioned_upper(__first, __last, __val); return std::__upper_bound(__first, __last, __val, __gnu_cxx::__ops::__val_less_iter()); } /** * @brief Finds the last position in which @p __val could be inserted * without changing the ordering. * @ingroup binary_search_algorithms * @param __first An iterator. * @param __last Another iterator. * @param __val The search term. * @param __comp A functor to use for comparisons. * @return An iterator pointing to the first element greater than @p __val, * or end() if no elements are greater than @p __val. * @ingroup binary_search_algorithms * * The comparison function should have the same effects on ordering as * the function used for the initial sort. */ template inline _ForwardIterator upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __val, _Compare __comp) { typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType; // concept requirements __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, _Tp, _ValueType>) __glibcxx_requires_partitioned_upper_pred(__first, __last, __val, __comp); return std::__upper_bound(__first, __last, __val, __gnu_cxx::__ops::__val_comp_iter(__comp)); } template pair<_ForwardIterator, _ForwardIterator> __equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __val, _CompareItTp __comp_it_val, _CompareTpIt __comp_val_it) { typedef typename iterator_traits<_ForwardIterator>::difference_type _DistanceType; _DistanceType __len = std::distance(__first, __last); while (__len > 0) { _DistanceType __half = __len >> 1; _ForwardIterator __middle = __first; std::advance(__middle, __half); if (__comp_it_val(__middle, __val)) { __first = __middle; ++__first; __len = __len - __half - 1; } else if (__comp_val_it(__val, __middle)) __len = __half; else { _ForwardIterator __left = std::__lower_bound(__first, __middle, __val, __comp_it_val); std::advance(__first, __len); _ForwardIterator __right = std::__upper_bound(++__middle, __first, __val, __comp_val_it); return pair<_ForwardIterator, _ForwardIterator>(__left, __right); } } return pair<_ForwardIterator, _ForwardIterator>(__first, __first); } /** * @brief Finds the largest subrange in which @p __val could be inserted * at any place in it without changing the ordering. * @ingroup binary_search_algorithms * @param __first An iterator. * @param __last Another iterator. * @param __val The search term. * @return An pair of iterators defining the subrange. * @ingroup binary_search_algorithms * * This is equivalent to * @code * std::make_pair(lower_bound(__first, __last, __val), * upper_bound(__first, __last, __val)) * @endcode * but does not actually call those functions. */ template inline pair<_ForwardIterator, _ForwardIterator> equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __val) { typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType; // concept requirements __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) __glibcxx_function_requires(_LessThanOpConcept<_ValueType, _Tp>) __glibcxx_function_requires(_LessThanOpConcept<_Tp, _ValueType>) __glibcxx_requires_partitioned_lower(__first, __last, __val); __glibcxx_requires_partitioned_upper(__first, __last, __val); return std::__equal_range(__first, __last, __val, __gnu_cxx::__ops::__iter_less_val(), __gnu_cxx::__ops::__val_less_iter()); } /** * @brief Finds the largest subrange in which @p __val could be inserted * at any place in it without changing the ordering. * @param __first An iterator. * @param __last Another iterator. * @param __val The search term. * @param __comp A functor to use for comparisons. * @return An pair of iterators defining the subrange. * @ingroup binary_search_algorithms * * This is equivalent to * @code * std::make_pair(lower_bound(__first, __last, __val, __comp), * upper_bound(__first, __last, __val, __comp)) * @endcode * but does not actually call those functions. */ template inline pair<_ForwardIterator, _ForwardIterator> equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __val, _Compare __comp) { typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType; // concept requirements __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, _ValueType, _Tp>) __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, _Tp, _ValueType>) __glibcxx_requires_partitioned_lower_pred(__first, __last, __val, __comp); __glibcxx_requires_partitioned_upper_pred(__first, __last, __val, __comp); return std::__equal_range(__first, __last, __val, __gnu_cxx::__ops::__iter_comp_val(__comp), __gnu_cxx::__ops::__val_comp_iter(__comp)); } /** * @brief Determines whether an element exists in a range. * @ingroup binary_search_algorithms * @param __first An iterator. * @param __last Another iterator. * @param __val The search term. * @return True if @p __val (or its equivalent) is in [@p * __first,@p __last ]. * * Note that this does not actually return an iterator to @p __val. For * that, use std::find or a container's specialized find member functions. */ template bool binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __val) { typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType; // concept requirements __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) __glibcxx_function_requires(_LessThanOpConcept<_Tp, _ValueType>) __glibcxx_requires_partitioned_lower(__first, __last, __val); __glibcxx_requires_partitioned_upper(__first, __last, __val); _ForwardIterator __i = std::__lower_bound(__first, __last, __val, __gnu_cxx::__ops::__iter_less_val()); return __i != __last && !(__val < *__i); } /** * @brief Determines whether an element exists in a range. * @ingroup binary_search_algorithms * @param __first An iterator. * @param __last Another iterator. * @param __val The search term. * @param __comp A functor to use for comparisons. * @return True if @p __val (or its equivalent) is in @p [__first,__last]. * * Note that this does not actually return an iterator to @p __val. For * that, use std::find or a container's specialized find member functions. * * The comparison function should have the same effects on ordering as * the function used for the initial sort. */ template bool binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __val, _Compare __comp) { typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType; // concept requirements __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, _Tp, _ValueType>) __glibcxx_requires_partitioned_lower_pred(__first, __last, __val, __comp); __glibcxx_requires_partitioned_upper_pred(__first, __last, __val, __comp); _ForwardIterator __i = std::__lower_bound(__first, __last, __val, __gnu_cxx::__ops::__iter_comp_val(__comp)); return __i != __last && !bool(__comp(__val, *__i)); } // merge /// This is a helper function for the __merge_adaptive routines. template void __move_merge_adaptive(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp) { while (__first1 != __last1 && __first2 != __last2) { if (__comp(__first2, __first1)) { *__result = _GLIBCXX_MOVE(*__first2); ++__first2; } else { *__result = _GLIBCXX_MOVE(*__first1); ++__first1; } ++__result; } if (__first1 != __last1) _GLIBCXX_MOVE3(__first1, __last1, __result); } /// This is a helper function for the __merge_adaptive routines. template void __move_merge_adaptive_backward(_BidirectionalIterator1 __first1, _BidirectionalIterator1 __last1, _BidirectionalIterator2 __first2, _BidirectionalIterator2 __last2, _BidirectionalIterator3 __result, _Compare __comp) { if (__first1 == __last1) { _GLIBCXX_MOVE_BACKWARD3(__first2, __last2, __result); return; } else if (__first2 == __last2) return; --__last1; --__last2; while (true) { if (__comp(__last2, __last1)) { *--__result = _GLIBCXX_MOVE(*__last1); if (__first1 == __last1) { _GLIBCXX_MOVE_BACKWARD3(__first2, ++__last2, __result); return; } --__last1; } else { *--__result = _GLIBCXX_MOVE(*__last2); if (__first2 == __last2) return; --__last2; } } } /// This is a helper function for the merge routines. template _BidirectionalIterator1 __rotate_adaptive(_BidirectionalIterator1 __first, _BidirectionalIterator1 __middle, _BidirectionalIterator1 __last, _Distance __len1, _Distance __len2, _BidirectionalIterator2 __buffer, _Distance __buffer_size) { _BidirectionalIterator2 __buffer_end; if (__len1 > __len2 && __len2 <= __buffer_size) { if (__len2) { __buffer_end = _GLIBCXX_MOVE3(__middle, __last, __buffer); _GLIBCXX_MOVE_BACKWARD3(__first, __middle, __last); return _GLIBCXX_MOVE3(__buffer, __buffer_end, __first); } else return __first; } else if (__len1 <= __buffer_size) { if (__len1) { __buffer_end = _GLIBCXX_MOVE3(__first, __middle, __buffer); _GLIBCXX_MOVE3(__middle, __last, __first); return _GLIBCXX_MOVE_BACKWARD3(__buffer, __buffer_end, __last); } else return __last; } else { std::rotate(__first, __middle, __last); std::advance(__first, std::distance(__middle, __last)); return __first; } } /// This is a helper function for the merge routines. template void __merge_adaptive(_BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last, _Distance __len1, _Distance __len2, _Pointer __buffer, _Distance __buffer_size, _Compare __comp) { if (__len1 <= __len2 && __len1 <= __buffer_size) { _Pointer __buffer_end = _GLIBCXX_MOVE3(__first, __middle, __buffer); std::__move_merge_adaptive(__buffer, __buffer_end, __middle, __last, __first, __comp); } else if (__len2 <= __buffer_size) { _Pointer __buffer_end = _GLIBCXX_MOVE3(__middle, __last, __buffer); std::__move_merge_adaptive_backward(__first, __middle, __buffer, __buffer_end, __last, __comp); } else { _BidirectionalIterator __first_cut = __first; _BidirectionalIterator __second_cut = __middle; _Distance __len11 = 0; _Distance __len22 = 0; if (__len1 > __len2) { __len11 = __len1 / 2; std::advance(__first_cut, __len11); __second_cut = std::__lower_bound(__middle, __last, *__first_cut, __gnu_cxx::__ops::__iter_comp_val(__comp)); __len22 = std::distance(__middle, __second_cut); } else { __len22 = __len2 / 2; std::advance(__second_cut, __len22); __first_cut = std::__upper_bound(__first, __middle, *__second_cut, __gnu_cxx::__ops::__val_comp_iter(__comp)); __len11 = std::distance(__first, __first_cut); } _BidirectionalIterator __new_middle = std::__rotate_adaptive(__first_cut, __middle, __second_cut, __len1 - __len11, __len22, __buffer, __buffer_size); std::__merge_adaptive(__first, __first_cut, __new_middle, __len11, __len22, __buffer, __buffer_size, __comp); std::__merge_adaptive(__new_middle, __second_cut, __last, __len1 - __len11, __len2 - __len22, __buffer, __buffer_size, __comp); } } /// This is a helper function for the merge routines. template void __merge_without_buffer(_BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last, _Distance __len1, _Distance __len2, _Compare __comp) { if (__len1 == 0 || __len2 == 0) return; if (__len1 + __len2 == 2) { if (__comp(__middle, __first)) std::iter_swap(__first, __middle); return; } _BidirectionalIterator __first_cut = __first; _BidirectionalIterator __second_cut = __middle; _Distance __len11 = 0; _Distance __len22 = 0; if (__len1 > __len2) { __len11 = __len1 / 2; std::advance(__first_cut, __len11); __second_cut = std::__lower_bound(__middle, __last, *__first_cut, __gnu_cxx::__ops::__iter_comp_val(__comp)); __len22 = std::distance(__middle, __second_cut); } else { __len22 = __len2 / 2; std::advance(__second_cut, __len22); __first_cut = std::__upper_bound(__first, __middle, *__second_cut, __gnu_cxx::__ops::__val_comp_iter(__comp)); __len11 = std::distance(__first, __first_cut); } std::rotate(__first_cut, __middle, __second_cut); _BidirectionalIterator __new_middle = __first_cut; std::advance(__new_middle, std::distance(__middle, __second_cut)); std::__merge_without_buffer(__first, __first_cut, __new_middle, __len11, __len22, __comp); std::__merge_without_buffer(__new_middle, __second_cut, __last, __len1 - __len11, __len2 - __len22, __comp); } template void __inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last, _Compare __comp) { typedef typename iterator_traits<_BidirectionalIterator>::value_type _ValueType; typedef typename iterator_traits<_BidirectionalIterator>::difference_type _DistanceType; if (__first == __middle || __middle == __last) return; const _DistanceType __len1 = std::distance(__first, __middle); const _DistanceType __len2 = std::distance(__middle, __last); typedef _Temporary_buffer<_BidirectionalIterator, _ValueType> _TmpBuf; _TmpBuf __buf(__first, __last); if (__buf.begin() == 0) std::__merge_without_buffer (__first, __middle, __last, __len1, __len2, __comp); else std::__merge_adaptive (__first, __middle, __last, __len1, __len2, __buf.begin(), _DistanceType(__buf.size()), __comp); } /** * @brief Merges two sorted ranges in place. * @ingroup sorting_algorithms * @param __first An iterator. * @param __middle Another iterator. * @param __last Another iterator. * @return Nothing. * * Merges two sorted and consecutive ranges, [__first,__middle) and * [__middle,__last), and puts the result in [__first,__last). The * output will be sorted. The sort is @e stable, that is, for * equivalent elements in the two ranges, elements from the first * range will always come before elements from the second. * * If enough additional memory is available, this takes (__last-__first)-1 * comparisons. Otherwise an NlogN algorithm is used, where N is * distance(__first,__last). */ template inline void inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last) { // concept requirements __glibcxx_function_requires(_Mutable_BidirectionalIteratorConcept< _BidirectionalIterator>) __glibcxx_function_requires(_LessThanComparableConcept< typename iterator_traits<_BidirectionalIterator>::value_type>) __glibcxx_requires_sorted(__first, __middle); __glibcxx_requires_sorted(__middle, __last); std::__inplace_merge(__first, __middle, __last, __gnu_cxx::__ops::__iter_less_iter()); } /** * @brief Merges two sorted ranges in place. * @ingroup sorting_algorithms * @param __first An iterator. * @param __middle Another iterator. * @param __last Another iterator. * @param __comp A functor to use for comparisons. * @return Nothing. * * Merges two sorted and consecutive ranges, [__first,__middle) and * [middle,last), and puts the result in [__first,__last). The output will * be sorted. The sort is @e stable, that is, for equivalent * elements in the two ranges, elements from the first range will always * come before elements from the second. * * If enough additional memory is available, this takes (__last-__first)-1 * comparisons. Otherwise an NlogN algorithm is used, where N is * distance(__first,__last). * * The comparison function should have the same effects on ordering as * the function used for the initial sort. */ template inline void inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last, _Compare __comp) { // concept requirements __glibcxx_function_requires(_Mutable_BidirectionalIteratorConcept< _BidirectionalIterator>) __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, typename iterator_traits<_BidirectionalIterator>::value_type, typename iterator_traits<_BidirectionalIterator>::value_type>) __glibcxx_requires_sorted_pred(__first, __middle, __comp); __glibcxx_requires_sorted_pred(__middle, __last, __comp); std::__inplace_merge(__first, __middle, __last, __gnu_cxx::__ops::__iter_comp_iter(__comp)); } /// This is a helper function for the __merge_sort_loop routines. template _OutputIterator __move_merge(_InputIterator __first1, _InputIterator __last1, _InputIterator __first2, _InputIterator __last2, _OutputIterator __result, _Compare __comp) { while (__first1 != __last1 && __first2 != __last2) { if (__comp(__first2, __first1)) { *__result = _GLIBCXX_MOVE(*__first2); ++__first2; } else { *__result = _GLIBCXX_MOVE(*__first1); ++__first1; } ++__result; } return _GLIBCXX_MOVE3(__first2, __last2, _GLIBCXX_MOVE3(__first1, __last1, __result)); } template void __merge_sort_loop(_RandomAccessIterator1 __first, _RandomAccessIterator1 __last, _RandomAccessIterator2 __result, _Distance __step_size, _Compare __comp) { const _Distance __two_step = 2 * __step_size; while (__last - __first >= __two_step) { __result = std::__move_merge(__first, __first + __step_size, __first + __step_size, __first + __two_step, __result, __comp); __first += __two_step; } __step_size = std::min(_Distance(__last - __first), __step_size); std::__move_merge(__first, __first + __step_size, __first + __step_size, __last, __result, __comp); } template void __chunk_insertion_sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Distance __chunk_size, _Compare __comp) { while (__last - __first >= __chunk_size) { std::__insertion_sort(__first, __first + __chunk_size, __comp); __first += __chunk_size; } std::__insertion_sort(__first, __last, __comp); } enum { _S_chunk_size = 7 }; template void __merge_sort_with_buffer(_RandomAccessIterator __first, _RandomAccessIterator __last, _Pointer __buffer, _Compare __comp) { typedef typename iterator_traits<_RandomAccessIterator>::difference_type _Distance; const _Distance __len = __last - __first; const _Pointer __buffer_last = __buffer + __len; _Distance __step_size = _S_chunk_size; std::__chunk_insertion_sort(__first, __last, __step_size, __comp); while (__step_size < __len) { std::__merge_sort_loop(__first, __last, __buffer, __step_size, __comp); __step_size *= 2; std::__merge_sort_loop(__buffer, __buffer_last, __first, __step_size, __comp); __step_size *= 2; } } template void __stable_sort_adaptive(_RandomAccessIterator __first, _RandomAccessIterator __last, _Pointer __buffer, _Distance __buffer_size, _Compare __comp) { const _Distance __len = (__last - __first + 1) / 2; const _RandomAccessIterator __middle = __first + __len; if (__len > __buffer_size) { std::__stable_sort_adaptive(__first, __middle, __buffer, __buffer_size, __comp); std::__stable_sort_adaptive(__middle, __last, __buffer, __buffer_size, __comp); } else { std::__merge_sort_with_buffer(__first, __middle, __buffer, __comp); std::__merge_sort_with_buffer(__middle, __last, __buffer, __comp); } std::__merge_adaptive(__first, __middle, __last, _Distance(__middle - __first), _Distance(__last - __middle), __buffer, __buffer_size, __comp); } /// This is a helper function for the stable sorting routines. template void __inplace_stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) { if (__last - __first < 15) { std::__insertion_sort(__first, __last, __comp); return; } _RandomAccessIterator __middle = __first + (__last - __first) / 2; std::__inplace_stable_sort(__first, __middle, __comp); std::__inplace_stable_sort(__middle, __last, __comp); std::__merge_without_buffer(__first, __middle, __last, __middle - __first, __last - __middle, __comp); } // stable_sort // Set algorithms: includes, set_union, set_intersection, set_difference, // set_symmetric_difference. All of these algorithms have the precondition // that their input ranges are sorted and the postcondition that their output // ranges are sorted. template bool __includes(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _Compare __comp) { while (__first1 != __last1 && __first2 != __last2) if (__comp(__first2, __first1)) return false; else if (__comp(__first1, __first2)) ++__first1; else ++__first1, ++__first2; return __first2 == __last2; } /** * @brief Determines whether all elements of a sequence exists in a range. * @param __first1 Start of search range. * @param __last1 End of search range. * @param __first2 Start of sequence * @param __last2 End of sequence. * @return True if each element in [__first2,__last2) is contained in order * within [__first1,__last1). False otherwise. * @ingroup set_algorithms * * This operation expects both [__first1,__last1) and * [__first2,__last2) to be sorted. Searches for the presence of * each element in [__first2,__last2) within [__first1,__last1). * The iterators over each range only move forward, so this is a * linear algorithm. If an element in [__first2,__last2) is not * found before the search iterator reaches @p __last2, false is * returned. */ template inline bool includes(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2) { // concept requirements __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>) __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>) __glibcxx_function_requires(_LessThanOpConcept< typename iterator_traits<_InputIterator1>::value_type, typename iterator_traits<_InputIterator2>::value_type>) __glibcxx_function_requires(_LessThanOpConcept< typename iterator_traits<_InputIterator2>::value_type, typename iterator_traits<_InputIterator1>::value_type>) __glibcxx_requires_sorted_set(__first1, __last1, __first2); __glibcxx_requires_sorted_set(__first2, __last2, __first1); return std::__includes(__first1, __last1, __first2, __last2, __gnu_cxx::__ops::__iter_less_iter()); } /** * @brief Determines whether all elements of a sequence exists in a range * using comparison. * @ingroup set_algorithms * @param __first1 Start of search range. * @param __last1 End of search range. * @param __first2 Start of sequence * @param __last2 End of sequence. * @param __comp Comparison function to use. * @return True if each element in [__first2,__last2) is contained * in order within [__first1,__last1) according to comp. False * otherwise. @ingroup set_algorithms * * This operation expects both [__first1,__last1) and * [__first2,__last2) to be sorted. Searches for the presence of * each element in [__first2,__last2) within [__first1,__last1), * using comp to decide. The iterators over each range only move * forward, so this is a linear algorithm. If an element in * [__first2,__last2) is not found before the search iterator * reaches @p __last2, false is returned. */ template inline bool includes(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _Compare __comp) { // concept requirements __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>) __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>) __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, typename iterator_traits<_InputIterator1>::value_type, typename iterator_traits<_InputIterator2>::value_type>) __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, typename iterator_traits<_InputIterator2>::value_type, typename iterator_traits<_InputIterator1>::value_type>) __glibcxx_requires_sorted_set_pred(__first1, __last1, __first2, __comp); __glibcxx_requires_sorted_set_pred(__first2, __last2, __first1, __comp); return std::__includes(__first1, __last1, __first2, __last2, __gnu_cxx::__ops::__iter_comp_iter(__comp)); } // nth_element // merge // set_difference // set_intersection // set_union // stable_sort // set_symmetric_difference // min_element // max_element template bool __next_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp) { if (__first == __last) return false; _BidirectionalIterator __i = __first; ++__i; if (__i == __last) return false; __i = __last; --__i; for(;;) { _BidirectionalIterator __ii = __i; --__i; if (__comp(__i, __ii)) { _BidirectionalIterator __j = __last; while (!__comp(__i, --__j)) {} std::iter_swap(__i, __j); std::__reverse(__ii, __last, std::__iterator_category(__first)); return true; } if (__i == __first) { std::__reverse(__first, __last, std::__iterator_category(__first)); return false; } } } /** * @brief Permute range into the next @e dictionary ordering. * @ingroup sorting_algorithms * @param __first Start of range. * @param __last End of range. * @return False if wrapped to first permutation, true otherwise. * * Treats all permutations of the range as a set of @e dictionary sorted * sequences. Permutes the current sequence into the next one of this set. * Returns true if there are more sequences to generate. If the sequence * is the largest of the set, the smallest is generated and false returned. */ template inline bool next_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last) { // concept requirements __glibcxx_function_requires(_BidirectionalIteratorConcept< _BidirectionalIterator>) __glibcxx_function_requires(_LessThanComparableConcept< typename iterator_traits<_BidirectionalIterator>::value_type>) __glibcxx_requires_valid_range(__first, __last); return std::__next_permutation (__first, __last, __gnu_cxx::__ops::__iter_less_iter()); } /** * @brief Permute range into the next @e dictionary ordering using * comparison functor. * @ingroup sorting_algorithms * @param __first Start of range. * @param __last End of range. * @param __comp A comparison functor. * @return False if wrapped to first permutation, true otherwise. * * Treats all permutations of the range [__first,__last) as a set of * @e dictionary sorted sequences ordered by @p __comp. Permutes the current * sequence into the next one of this set. Returns true if there are more * sequences to generate. If the sequence is the largest of the set, the * smallest is generated and false returned. */ template inline bool next_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp) { // concept requirements __glibcxx_function_requires(_BidirectionalIteratorConcept< _BidirectionalIterator>) __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, typename iterator_traits<_BidirectionalIterator>::value_type, typename iterator_traits<_BidirectionalIterator>::value_type>) __glibcxx_requires_valid_range(__first, __last); return std::__next_permutation (__first, __last, __gnu_cxx::__ops::__iter_comp_iter(__comp)); } template bool __prev_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp) { if (__first == __last) return false; _BidirectionalIterator __i = __first; ++__i; if (__i == __last) return false; __i = __last; --__i; for(;;) { _BidirectionalIterator __ii = __i; --__i; if (__comp(__ii, __i)) { _BidirectionalIterator __j = __last; while (!__comp(--__j, __i)) {} std::iter_swap(__i, __j); std::__reverse(__ii, __last, std::__iterator_category(__first)); return true; } if (__i == __first) { std::__reverse(__first, __last, std::__iterator_category(__first)); return false; } } } /** * @brief Permute range into the previous @e dictionary ordering. * @ingroup sorting_algorithms * @param __first Start of range. * @param __last End of range. * @return False if wrapped to last permutation, true otherwise. * * Treats all permutations of the range as a set of @e dictionary sorted * sequences. Permutes the current sequence into the previous one of this * set. Returns true if there are more sequences to generate. If the * sequence is the smallest of the set, the largest is generated and false * returned. */ template inline bool prev_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last) { // concept requirements __glibcxx_function_requires(_BidirectionalIteratorConcept< _BidirectionalIterator>) __glibcxx_function_requires(_LessThanComparableConcept< typename iterator_traits<_BidirectionalIterator>::value_type>) __glibcxx_requires_valid_range(__first, __last); return std::__prev_permutation(__first, __last, __gnu_cxx::__ops::__iter_less_iter()); } /** * @brief Permute range into the previous @e dictionary ordering using * comparison functor. * @ingroup sorting_algorithms * @param __first Start of range. * @param __last End of range. * @param __comp A comparison functor. * @return False if wrapped to last permutation, true otherwise. * * Treats all permutations of the range [__first,__last) as a set of * @e dictionary sorted sequences ordered by @p __comp. Permutes the current * sequence into the previous one of this set. Returns true if there are * more sequences to generate. If the sequence is the smallest of the set, * the largest is generated and false returned. */ template inline bool prev_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp) { // concept requirements __glibcxx_function_requires(_BidirectionalIteratorConcept< _BidirectionalIterator>) __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, typename iterator_traits<_BidirectionalIterator>::value_type, typename iterator_traits<_BidirectionalIterator>::value_type>) __glibcxx_requires_valid_range(__first, __last); return std::__prev_permutation(__first, __last, __gnu_cxx::__ops::__iter_comp_iter(__comp)); } // replace // replace_if template _OutputIterator __replace_copy_if(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _Predicate __pred, const _Tp& __new_value) { for (; __first != __last; ++__first, ++__result) if (__pred(__first)) *__result = __new_value; else *__result = *__first; return __result; } /** * @brief Copy a sequence, replacing each element of one value with another * value. * @param __first An input iterator. * @param __last An input iterator. * @param __result An output iterator. * @param __old_value The value to be replaced. * @param __new_value The replacement value. * @return The end of the output sequence, @p result+(last-first). * * Copies each element in the input range @p [__first,__last) to the * output range @p [__result,__result+(__last-__first)) replacing elements * equal to @p __old_value with @p __new_value. */ template inline _OutputIterator replace_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result, const _Tp& __old_value, const _Tp& __new_value) { // concept requirements __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, typename iterator_traits<_InputIterator>::value_type>) __glibcxx_function_requires(_EqualOpConcept< typename iterator_traits<_InputIterator>::value_type, _Tp>) __glibcxx_requires_valid_range(__first, __last); return std::__replace_copy_if(__first, __last, __result, __gnu_cxx::__ops::__iter_equals_val(__old_value), __new_value); } /** * @brief Copy a sequence, replacing each value for which a predicate * returns true with another value. * @ingroup mutating_algorithms * @param __first An input iterator. * @param __last An input iterator. * @param __result An output iterator. * @param __pred A predicate. * @param __new_value The replacement value. * @return The end of the output sequence, @p __result+(__last-__first). * * Copies each element in the range @p [__first,__last) to the range * @p [__result,__result+(__last-__first)) replacing elements for which * @p __pred returns true with @p __new_value. */ template inline _OutputIterator replace_copy_if(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _Predicate __pred, const _Tp& __new_value) { // concept requirements __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, typename iterator_traits<_InputIterator>::value_type>) __glibcxx_function_requires(_UnaryPredicateConcept<_Predicate, typename iterator_traits<_InputIterator>::value_type>) __glibcxx_requires_valid_range(__first, __last); return std::__replace_copy_if(__first, __last, __result, __gnu_cxx::__ops::__pred_iter(__pred), __new_value); } template typename iterator_traits<_InputIterator>::difference_type __count_if(_InputIterator __first, _InputIterator __last, _Predicate __pred) { typename iterator_traits<_InputIterator>::difference_type __n = 0; for (; __first != __last; ++__first) if (__pred(__first)) ++__n; return __n; } #if __cplusplus >= 201103L /** * @brief Determines whether the elements of a sequence are sorted. * @ingroup sorting_algorithms * @param __first An iterator. * @param __last Another iterator. * @return True if the elements are sorted, false otherwise. */ template inline bool is_sorted(_ForwardIterator __first, _ForwardIterator __last) { return std::is_sorted_until(__first, __last) == __last; } /** * @brief Determines whether the elements of a sequence are sorted * according to a comparison functor. * @ingroup sorting_algorithms * @param __first An iterator. * @param __last Another iterator. * @param __comp A comparison functor. * @return True if the elements are sorted, false otherwise. */ template inline bool is_sorted(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp) { return std::is_sorted_until(__first, __last, __comp) == __last; } template _ForwardIterator __is_sorted_until(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp) { if (__first == __last) return __last; _ForwardIterator __next = __first; for (++__next; __next != __last; __first = __next, ++__next) if (__comp(__next, __first)) return __next; return __next; } /** * @brief Determines the end of a sorted sequence. * @ingroup sorting_algorithms * @param __first An iterator. * @param __last Another iterator. * @return An iterator pointing to the last iterator i in [__first, __last) * for which the range [__first, i) is sorted. */ template inline _ForwardIterator is_sorted_until(_ForwardIterator __first, _ForwardIterator __last) { // concept requirements __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) __glibcxx_function_requires(_LessThanComparableConcept< typename iterator_traits<_ForwardIterator>::value_type>) __glibcxx_requires_valid_range(__first, __last); return std::__is_sorted_until(__first, __last, __gnu_cxx::__ops::__iter_less_iter()); } /** * @brief Determines the end of a sorted sequence using comparison functor. * @ingroup sorting_algorithms * @param __first An iterator. * @param __last Another iterator. * @param __comp A comparison functor. * @return An iterator pointing to the last iterator i in [__first, __last) * for which the range [__first, i) is sorted. */ template inline _ForwardIterator is_sorted_until(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp) { // concept requirements __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, typename iterator_traits<_ForwardIterator>::value_type, typename iterator_traits<_ForwardIterator>::value_type>) __glibcxx_requires_valid_range(__first, __last); return std::__is_sorted_until(__first, __last, __gnu_cxx::__ops::__iter_comp_iter(__comp)); } /** * @brief Determines min and max at once as an ordered pair. * @ingroup sorting_algorithms * @param __a A thing of arbitrary type. * @param __b Another thing of arbitrary type. * @return A pair(__b, __a) if __b is smaller than __a, pair(__a, * __b) otherwise. */ template _GLIBCXX14_CONSTEXPR inline pair minmax(const _Tp& __a, const _Tp& __b) { // concept requirements __glibcxx_function_requires(_LessThanComparableConcept<_Tp>) return __b < __a ? pair(__b, __a) : pair(__a, __b); } /** * @brief Determines min and max at once as an ordered pair. * @ingroup sorting_algorithms * @param __a A thing of arbitrary type. * @param __b Another thing of arbitrary type. * @param __comp A @link comparison_functors comparison functor @endlink. * @return A pair(__b, __a) if __b is smaller than __a, pair(__a, * __b) otherwise. */ template _GLIBCXX14_CONSTEXPR inline pair minmax(const _Tp& __a, const _Tp& __b, _Compare __comp) { return __comp(__b, __a) ? pair(__b, __a) : pair(__a, __b); } template _GLIBCXX14_CONSTEXPR pair<_ForwardIterator, _ForwardIterator> __minmax_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp) { _ForwardIterator __next = __first; if (__first == __last || ++__next == __last) return std::make_pair(__first, __first); _ForwardIterator __min{}, __max{}; if (__comp(__next, __first)) { __min = __next; __max = __first; } else { __min = __first; __max = __next; } __first = __next; ++__first; while (__first != __last) { __next = __first; if (++__next == __last) { if (__comp(__first, __min)) __min = __first; else if (!__comp(__first, __max)) __max = __first; break; } if (__comp(__next, __first)) { if (__comp(__next, __min)) __min = __next; if (!__comp(__first, __max)) __max = __first; } else { if (__comp(__first, __min)) __min = __first; if (!__comp(__next, __max)) __max = __next; } __first = __next; ++__first; } return std::make_pair(__min, __max); } /** * @brief Return a pair of iterators pointing to the minimum and maximum * elements in a range. * @ingroup sorting_algorithms * @param __first Start of range. * @param __last End of range. * @return make_pair(m, M), where m is the first iterator i in * [__first, __last) such that no other element in the range is * smaller, and where M is the last iterator i in [__first, __last) * such that no other element in the range is larger. */ template _GLIBCXX14_CONSTEXPR inline pair<_ForwardIterator, _ForwardIterator> minmax_element(_ForwardIterator __first, _ForwardIterator __last) { // concept requirements __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) __glibcxx_function_requires(_LessThanComparableConcept< typename iterator_traits<_ForwardIterator>::value_type>) __glibcxx_requires_valid_range(__first, __last); return std::__minmax_element(__first, __last, __gnu_cxx::__ops::__iter_less_iter()); } /** * @brief Return a pair of iterators pointing to the minimum and maximum * elements in a range. * @ingroup sorting_algorithms * @param __first Start of range. * @param __last End of range. * @param __comp Comparison functor. * @return make_pair(m, M), where m is the first iterator i in * [__first, __last) such that no other element in the range is * smaller, and where M is the last iterator i in [__first, __last) * such that no other element in the range is larger. */ template _GLIBCXX14_CONSTEXPR inline pair<_ForwardIterator, _ForwardIterator> minmax_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp) { // concept requirements __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, typename iterator_traits<_ForwardIterator>::value_type, typename iterator_traits<_ForwardIterator>::value_type>) __glibcxx_requires_valid_range(__first, __last); return std::__minmax_element(__first, __last, __gnu_cxx::__ops::__iter_comp_iter(__comp)); } // N2722 + DR 915. template _GLIBCXX14_CONSTEXPR inline _Tp min(initializer_list<_Tp> __l) { return *std::min_element(__l.begin(), __l.end()); } template _GLIBCXX14_CONSTEXPR inline _Tp min(initializer_list<_Tp> __l, _Compare __comp) { return *std::min_element(__l.begin(), __l.end(), __comp); } template _GLIBCXX14_CONSTEXPR inline _Tp max(initializer_list<_Tp> __l) { return *std::max_element(__l.begin(), __l.end()); } template _GLIBCXX14_CONSTEXPR inline _Tp max(initializer_list<_Tp> __l, _Compare __comp) { return *std::max_element(__l.begin(), __l.end(), __comp); } template _GLIBCXX14_CONSTEXPR inline pair<_Tp, _Tp> minmax(initializer_list<_Tp> __l) { pair __p = std::minmax_element(__l.begin(), __l.end()); return std::make_pair(*__p.first, *__p.second); } template _GLIBCXX14_CONSTEXPR inline pair<_Tp, _Tp> minmax(initializer_list<_Tp> __l, _Compare __comp) { pair __p = std::minmax_element(__l.begin(), __l.end(), __comp); return std::make_pair(*__p.first, *__p.second); } template bool __is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _BinaryPredicate __pred) { // Efficiently compare identical prefixes: O(N) if sequences // have the same elements in the same order. for (; __first1 != __last1; ++__first1, ++__first2) if (!__pred(__first1, __first2)) break; if (__first1 == __last1) return true; // Establish __last2 assuming equal ranges by iterating over the // rest of the list. _ForwardIterator2 __last2 = __first2; std::advance(__last2, std::distance(__first1, __last1)); for (_ForwardIterator1 __scan = __first1; __scan != __last1; ++__scan) { if (__scan != std::__find_if(__first1, __scan, __gnu_cxx::__ops::__iter_comp_iter(__pred, __scan))) continue; // We've seen this one before. auto __matches = std::__count_if(__first2, __last2, __gnu_cxx::__ops::__iter_comp_iter(__pred, __scan)); if (0 == __matches || std::__count_if(__scan, __last1, __gnu_cxx::__ops::__iter_comp_iter(__pred, __scan)) != __matches) return false; } return true; } /** * @brief Checks whether a permutation of the second sequence is equal * to the first sequence. * @ingroup non_mutating_algorithms * @param __first1 Start of first range. * @param __last1 End of first range. * @param __first2 Start of second range. * @return true if there exists a permutation of the elements in the range * [__first2, __first2 + (__last1 - __first1)), beginning with * ForwardIterator2 begin, such that equal(__first1, __last1, begin) * returns true; otherwise, returns false. */ template inline bool is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2) { // concept requirements __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator1>) __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator2>) __glibcxx_function_requires(_EqualOpConcept< typename iterator_traits<_ForwardIterator1>::value_type, typename iterator_traits<_ForwardIterator2>::value_type>) __glibcxx_requires_valid_range(__first1, __last1); return std::__is_permutation(__first1, __last1, __first2, __gnu_cxx::__ops::__iter_equal_to_iter()); } /** * @brief Checks whether a permutation of the second sequence is equal * to the first sequence. * @ingroup non_mutating_algorithms * @param __first1 Start of first range. * @param __last1 End of first range. * @param __first2 Start of second range. * @param __pred A binary predicate. * @return true if there exists a permutation of the elements in * the range [__first2, __first2 + (__last1 - __first1)), * beginning with ForwardIterator2 begin, such that * equal(__first1, __last1, __begin, __pred) returns true; * otherwise, returns false. */ template inline bool is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _BinaryPredicate __pred) { // concept requirements __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator1>) __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator2>) __glibcxx_function_requires(_BinaryPredicateConcept<_BinaryPredicate, typename iterator_traits<_ForwardIterator1>::value_type, typename iterator_traits<_ForwardIterator2>::value_type>) __glibcxx_requires_valid_range(__first1, __last1); return std::__is_permutation(__first1, __last1, __first2, __gnu_cxx::__ops::__iter_comp_iter(__pred)); } #if __cplusplus > 201103L template bool __is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred) { using _Cat1 = typename iterator_traits<_ForwardIterator1>::iterator_category; using _Cat2 = typename iterator_traits<_ForwardIterator2>::iterator_category; using _It1_is_RA = is_same<_Cat1, random_access_iterator_tag>; using _It2_is_RA = is_same<_Cat2, random_access_iterator_tag>; constexpr bool __ra_iters = _It1_is_RA() && _It2_is_RA(); if (__ra_iters) { auto __d1 = std::distance(__first1, __last1); auto __d2 = std::distance(__first2, __last2); if (__d1 != __d2) return false; } // Efficiently compare identical prefixes: O(N) if sequences // have the same elements in the same order. for (; __first1 != __last1 && __first2 != __last2; ++__first1, ++__first2) if (!__pred(__first1, __first2)) break; if (__ra_iters) { if (__first1 == __last1) return true; } else { auto __d1 = std::distance(__first1, __last1); auto __d2 = std::distance(__first2, __last2); if (__d1 == 0 && __d2 == 0) return true; if (__d1 != __d2) return false; } for (_ForwardIterator1 __scan = __first1; __scan != __last1; ++__scan) { if (__scan != std::__find_if(__first1, __scan, __gnu_cxx::__ops::__iter_comp_iter(__pred, __scan))) continue; // We've seen this one before. auto __matches = std::__count_if(__first2, __last2, __gnu_cxx::__ops::__iter_comp_iter(__pred, __scan)); if (0 == __matches || std::__count_if(__scan, __last1, __gnu_cxx::__ops::__iter_comp_iter(__pred, __scan)) != __matches) return false; } return true; } /** * @brief Checks whether a permutaion of the second sequence is equal * to the first sequence. * @ingroup non_mutating_algorithms * @param __first1 Start of first range. * @param __last1 End of first range. * @param __first2 Start of second range. * @param __last2 End of first range. * @return true if there exists a permutation of the elements in the range * [__first2, __last2), beginning with ForwardIterator2 begin, * such that equal(__first1, __last1, begin) returns true; * otherwise, returns false. */ template inline bool is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2) { __glibcxx_requires_valid_range(__first1, __last1); __glibcxx_requires_valid_range(__first2, __last2); return std::__is_permutation(__first1, __last1, __first2, __last2, __gnu_cxx::__ops::__iter_equal_to_iter()); } /** * @brief Checks whether a permutation of the second sequence is equal * to the first sequence. * @ingroup non_mutating_algorithms * @param __first1 Start of first range. * @param __last1 End of first range. * @param __first2 Start of second range. * @param __last2 End of first range. * @param __pred A binary predicate. * @return true if there exists a permutation of the elements in the range * [__first2, __last2), beginning with ForwardIterator2 begin, * such that equal(__first1, __last1, __begin, __pred) returns true; * otherwise, returns false. */ template inline bool is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred) { __glibcxx_requires_valid_range(__first1, __last1); __glibcxx_requires_valid_range(__first2, __last2); return std::__is_permutation(__first1, __last1, __first2, __last2, __gnu_cxx::__ops::__iter_comp_iter(__pred)); } #endif # 3700 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algo.h" 3 #ifdef _GLIBCXX_USE_C99_STDINT_TR1 /** * @brief Shuffle the elements of a sequence using a uniform random * number generator. * @ingroup mutating_algorithms * @param __first A forward iterator. * @param __last A forward iterator. * @param __g A UniformRandomNumberGenerator (26.5.1.3). * @return Nothing. * * Reorders the elements in the range @p [__first,__last) using @p __g to * provide random numbers. */ template void shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last, _UniformRandomNumberGenerator&& __g) { // concept requirements __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept< _RandomAccessIterator>) __glibcxx_requires_valid_range(__first, __last); if (__first == __last) return; typedef typename iterator_traits<_RandomAccessIterator>::difference_type _DistanceType; typedef typename std::make_unsigned<_DistanceType>::type __ud_type; typedef typename std::uniform_int_distribution<__ud_type> __distr_type; typedef typename __distr_type::param_type __p_type; __distr_type __d; for (_RandomAccessIterator __i = __first + 1; __i != __last; ++__i) std::iter_swap(__i, __first + __d(__g, __p_type(0, __i - __first))); } #endif # 3740 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algo.h" 3 #endif // C++11 # 3742 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algo.h" 3 _GLIBCXX_END_NAMESPACE_VERSION _GLIBCXX_BEGIN_NAMESPACE_ALGO /** * @brief Apply a function to every element of a sequence. * @ingroup non_mutating_algorithms * @param __first An input iterator. * @param __last An input iterator. * @param __f A unary function object. * @return @p __f (std::move(@p __f) in C++0x). * * Applies the function object @p __f to each element in the range * @p [first,last). @p __f must not modify the order of the sequence. * If @p __f has a return value it is ignored. */ template _Function for_each(_InputIterator __first, _InputIterator __last, _Function __f) { // concept requirements __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) __glibcxx_requires_valid_range(__first, __last); for (; __first != __last; ++__first) __f(*__first); return _GLIBCXX_MOVE(__f); } /** * @brief Find the first occurrence of a value in a sequence. * @ingroup non_mutating_algorithms * @param __first An input iterator. * @param __last An input iterator. * @param __val The value to find. * @return The first iterator @c i in the range @p [__first,__last) * such that @c *i == @p __val, or @p __last if no such iterator exists. */ template inline _InputIterator find(_InputIterator __first, _InputIterator __last, const _Tp& __val) { // concept requirements __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) __glibcxx_function_requires(_EqualOpConcept< typename iterator_traits<_InputIterator>::value_type, _Tp>) __glibcxx_requires_valid_range(__first, __last); return std::__find_if(__first, __last, __gnu_cxx::__ops::__iter_equals_val(__val)); } /** * @brief Find the first element in a sequence for which a * predicate is true. * @ingroup non_mutating_algorithms * @param __first An input iterator. * @param __last An input iterator. * @param __pred A predicate. * @return The first iterator @c i in the range @p [__first,__last) * such that @p __pred(*i) is true, or @p __last if no such iterator exists. */ template inline _InputIterator find_if(_InputIterator __first, _InputIterator __last, _Predicate __pred) { // concept requirements __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) __glibcxx_function_requires(_UnaryPredicateConcept<_Predicate, typename iterator_traits<_InputIterator>::value_type>) __glibcxx_requires_valid_range(__first, __last); return std::__find_if(__first, __last, __gnu_cxx::__ops::__pred_iter(__pred)); } /** * @brief Find element from a set in a sequence. * @ingroup non_mutating_algorithms * @param __first1 Start of range to search. * @param __last1 End of range to search. * @param __first2 Start of match candidates. * @param __last2 End of match candidates. * @return The first iterator @c i in the range * @p [__first1,__last1) such that @c *i == @p *(i2) such that i2 is an * iterator in [__first2,__last2), or @p __last1 if no such iterator exists. * * Searches the range @p [__first1,__last1) for an element that is * equal to some element in the range [__first2,__last2). If * found, returns an iterator in the range [__first1,__last1), * otherwise returns @p __last1. */ template _InputIterator find_first_of(_InputIterator __first1, _InputIterator __last1, _ForwardIterator __first2, _ForwardIterator __last2) { // concept requirements __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) __glibcxx_function_requires(_EqualOpConcept< typename iterator_traits<_InputIterator>::value_type, typename iterator_traits<_ForwardIterator>::value_type>) __glibcxx_requires_valid_range(__first1, __last1); __glibcxx_requires_valid_range(__first2, __last2); for (; __first1 != __last1; ++__first1) for (_ForwardIterator __iter = __first2; __iter != __last2; ++__iter) if (*__first1 == *__iter) return __first1; return __last1; } /** * @brief Find element from a set in a sequence using a predicate. * @ingroup non_mutating_algorithms * @param __first1 Start of range to search. * @param __last1 End of range to search. * @param __first2 Start of match candidates. * @param __last2 End of match candidates. * @param __comp Predicate to use. * @return The first iterator @c i in the range * @p [__first1,__last1) such that @c comp(*i, @p *(i2)) is true * and i2 is an iterator in [__first2,__last2), or @p __last1 if no * such iterator exists. * * Searches the range @p [__first1,__last1) for an element that is * equal to some element in the range [__first2,__last2). If * found, returns an iterator in the range [__first1,__last1), * otherwise returns @p __last1. */ template _InputIterator find_first_of(_InputIterator __first1, _InputIterator __last1, _ForwardIterator __first2, _ForwardIterator __last2, _BinaryPredicate __comp) { // concept requirements __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) __glibcxx_function_requires(_BinaryPredicateConcept<_BinaryPredicate, typename iterator_traits<_InputIterator>::value_type, typename iterator_traits<_ForwardIterator>::value_type>) __glibcxx_requires_valid_range(__first1, __last1); __glibcxx_requires_valid_range(__first2, __last2); for (; __first1 != __last1; ++__first1) for (_ForwardIterator __iter = __first2; __iter != __last2; ++__iter) if (__comp(*__first1, *__iter)) return __first1; return __last1; } /** * @brief Find two adjacent values in a sequence that are equal. * @ingroup non_mutating_algorithms * @param __first A forward iterator. * @param __last A forward iterator. * @return The first iterator @c i such that @c i and @c i+1 are both * valid iterators in @p [__first,__last) and such that @c *i == @c *(i+1), * or @p __last if no such iterator exists. */ template inline _ForwardIterator adjacent_find(_ForwardIterator __first, _ForwardIterator __last) { // concept requirements __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) __glibcxx_function_requires(_EqualityComparableConcept< typename iterator_traits<_ForwardIterator>::value_type>) __glibcxx_requires_valid_range(__first, __last); return std::__adjacent_find(__first, __last, __gnu_cxx::__ops::__iter_equal_to_iter()); } /** * @brief Find two adjacent values in a sequence using a predicate. * @ingroup non_mutating_algorithms * @param __first A forward iterator. * @param __last A forward iterator. * @param __binary_pred A binary predicate. * @return The first iterator @c i such that @c i and @c i+1 are both * valid iterators in @p [__first,__last) and such that * @p __binary_pred(*i,*(i+1)) is true, or @p __last if no such iterator * exists. */ template inline _ForwardIterator adjacent_find(_ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __binary_pred) { // concept requirements __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) __glibcxx_function_requires(_BinaryPredicateConcept<_BinaryPredicate, typename iterator_traits<_ForwardIterator>::value_type, typename iterator_traits<_ForwardIterator>::value_type>) __glibcxx_requires_valid_range(__first, __last); return std::__adjacent_find(__first, __last, __gnu_cxx::__ops::__iter_comp_iter(__binary_pred)); } /** * @brief Count the number of copies of a value in a sequence. * @ingroup non_mutating_algorithms * @param __first An input iterator. * @param __last An input iterator. * @param __value The value to be counted. * @return The number of iterators @c i in the range @p [__first,__last) * for which @c *i == @p __value */ template inline typename iterator_traits<_InputIterator>::difference_type count(_InputIterator __first, _InputIterator __last, const _Tp& __value) { // concept requirements __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) __glibcxx_function_requires(_EqualOpConcept< typename iterator_traits<_InputIterator>::value_type, _Tp>) __glibcxx_requires_valid_range(__first, __last); return std::__count_if(__first, __last, __gnu_cxx::__ops::__iter_equals_val(__value)); } /** * @brief Count the elements of a sequence for which a predicate is true. * @ingroup non_mutating_algorithms * @param __first An input iterator. * @param __last An input iterator. * @param __pred A predicate. * @return The number of iterators @c i in the range @p [__first,__last) * for which @p __pred(*i) is true. */ template inline typename iterator_traits<_InputIterator>::difference_type count_if(_InputIterator __first, _InputIterator __last, _Predicate __pred) { // concept requirements __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) __glibcxx_function_requires(_UnaryPredicateConcept<_Predicate, typename iterator_traits<_InputIterator>::value_type>) __glibcxx_requires_valid_range(__first, __last); return std::__count_if(__first, __last, __gnu_cxx::__ops::__pred_iter(__pred)); } /** * @brief Search a sequence for a matching sub-sequence. * @ingroup non_mutating_algorithms * @param __first1 A forward iterator. * @param __last1 A forward iterator. * @param __first2 A forward iterator. * @param __last2 A forward iterator. * @return The first iterator @c i in the range @p * [__first1,__last1-(__last2-__first2)) such that @c *(i+N) == @p * *(__first2+N) for each @c N in the range @p * [0,__last2-__first2), or @p __last1 if no such iterator exists. * * Searches the range @p [__first1,__last1) for a sub-sequence that * compares equal value-by-value with the sequence given by @p * [__first2,__last2) and returns an iterator to the first element * of the sub-sequence, or @p __last1 if the sub-sequence is not * found. * * Because the sub-sequence must lie completely within the range @p * [__first1,__last1) it must start at a position less than @p * __last1-(__last2-__first2) where @p __last2-__first2 is the * length of the sub-sequence. * * This means that the returned iterator @c i will be in the range * @p [__first1,__last1-(__last2-__first2)) */ template inline _ForwardIterator1 search(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2) { // concept requirements __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator1>) __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator2>) __glibcxx_function_requires(_EqualOpConcept< typename iterator_traits<_ForwardIterator1>::value_type, typename iterator_traits<_ForwardIterator2>::value_type>) __glibcxx_requires_valid_range(__first1, __last1); __glibcxx_requires_valid_range(__first2, __last2); return std::__search(__first1, __last1, __first2, __last2, __gnu_cxx::__ops::__iter_equal_to_iter()); } /** * @brief Search a sequence for a matching sub-sequence using a predicate. * @ingroup non_mutating_algorithms * @param __first1 A forward iterator. * @param __last1 A forward iterator. * @param __first2 A forward iterator. * @param __last2 A forward iterator. * @param __predicate A binary predicate. * @return The first iterator @c i in the range * @p [__first1,__last1-(__last2-__first2)) such that * @p __predicate(*(i+N),*(__first2+N)) is true for each @c N in the range * @p [0,__last2-__first2), or @p __last1 if no such iterator exists. * * Searches the range @p [__first1,__last1) for a sub-sequence that * compares equal value-by-value with the sequence given by @p * [__first2,__last2), using @p __predicate to determine equality, * and returns an iterator to the first element of the * sub-sequence, or @p __last1 if no such iterator exists. * * @see search(_ForwardIter1, _ForwardIter1, _ForwardIter2, _ForwardIter2) */ template inline _ForwardIterator1 search(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __predicate) { // concept requirements __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator1>) __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator2>) __glibcxx_function_requires(_BinaryPredicateConcept<_BinaryPredicate, typename iterator_traits<_ForwardIterator1>::value_type, typename iterator_traits<_ForwardIterator2>::value_type>) __glibcxx_requires_valid_range(__first1, __last1); __glibcxx_requires_valid_range(__first2, __last2); return std::__search(__first1, __last1, __first2, __last2, __gnu_cxx::__ops::__iter_comp_iter(__predicate)); } /** * @brief Search a sequence for a number of consecutive values. * @ingroup non_mutating_algorithms * @param __first A forward iterator. * @param __last A forward iterator. * @param __count The number of consecutive values. * @param __val The value to find. * @return The first iterator @c i in the range @p * [__first,__last-__count) such that @c *(i+N) == @p __val for * each @c N in the range @p [0,__count), or @p __last if no such * iterator exists. * * Searches the range @p [__first,__last) for @p count consecutive elements * equal to @p __val. */ template inline _ForwardIterator search_n(_ForwardIterator __first, _ForwardIterator __last, _Integer __count, const _Tp& __val) { // concept requirements __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) __glibcxx_function_requires(_EqualOpConcept< typename iterator_traits<_ForwardIterator>::value_type, _Tp>) __glibcxx_requires_valid_range(__first, __last); return std::__search_n(__first, __last, __count, __gnu_cxx::__ops::__iter_equals_val(__val)); } /** * @brief Search a sequence for a number of consecutive values using a * predicate. * @ingroup non_mutating_algorithms * @param __first A forward iterator. * @param __last A forward iterator. * @param __count The number of consecutive values. * @param __val The value to find. * @param __binary_pred A binary predicate. * @return The first iterator @c i in the range @p * [__first,__last-__count) such that @p * __binary_pred(*(i+N),__val) is true for each @c N in the range * @p [0,__count), or @p __last if no such iterator exists. * * Searches the range @p [__first,__last) for @p __count * consecutive elements for which the predicate returns true. */ template inline _ForwardIterator search_n(_ForwardIterator __first, _ForwardIterator __last, _Integer __count, const _Tp& __val, _BinaryPredicate __binary_pred) { // concept requirements __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) __glibcxx_function_requires(_BinaryPredicateConcept<_BinaryPredicate, typename iterator_traits<_ForwardIterator>::value_type, _Tp>) __glibcxx_requires_valid_range(__first, __last); return std::__search_n(__first, __last, __count, __gnu_cxx::__ops::__iter_comp_val(__binary_pred, __val)); } /** * @brief Perform an operation on a sequence. * @ingroup mutating_algorithms * @param __first An input iterator. * @param __last An input iterator. * @param __result An output iterator. * @param __unary_op A unary operator. * @return An output iterator equal to @p __result+(__last-__first). * * Applies the operator to each element in the input range and assigns * the results to successive elements of the output sequence. * Evaluates @p *(__result+N)=unary_op(*(__first+N)) for each @c N in the * range @p [0,__last-__first). * * @p unary_op must not alter its argument. */ template _OutputIterator transform(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _UnaryOperation __unary_op) { // concept requirements __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, // "the type returned by a _UnaryOperation" __typeof__(__unary_op(*__first))>) __glibcxx_requires_valid_range(__first, __last); for (; __first != __last; ++__first, ++__result) *__result = __unary_op(*__first); return __result; } /** * @brief Perform an operation on corresponding elements of two sequences. * @ingroup mutating_algorithms * @param __first1 An input iterator. * @param __last1 An input iterator. * @param __first2 An input iterator. * @param __result An output iterator. * @param __binary_op A binary operator. * @return An output iterator equal to @p result+(last-first). * * Applies the operator to the corresponding elements in the two * input ranges and assigns the results to successive elements of the * output sequence. * Evaluates @p * *(__result+N)=__binary_op(*(__first1+N),*(__first2+N)) for each * @c N in the range @p [0,__last1-__first1). * * @p binary_op must not alter either of its arguments. */ template _OutputIterator transform(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _OutputIterator __result, _BinaryOperation __binary_op) { // concept requirements __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>) __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>) __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, // "the type returned by a _BinaryOperation" __typeof__(__binary_op(*__first1,*__first2))>) __glibcxx_requires_valid_range(__first1, __last1); for (; __first1 != __last1; ++__first1, ++__first2, ++__result) *__result = __binary_op(*__first1, *__first2); return __result; } /** * @brief Replace each occurrence of one value in a sequence with another * value. * @ingroup mutating_algorithms * @param __first A forward iterator. * @param __last A forward iterator. * @param __old_value The value to be replaced. * @param __new_value The replacement value. * @return replace() returns no value. * * For each iterator @c i in the range @p [__first,__last) if @c *i == * @p __old_value then the assignment @c *i = @p __new_value is performed. */ template void replace(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __old_value, const _Tp& __new_value) { // concept requirements __glibcxx_function_requires(_Mutable_ForwardIteratorConcept< _ForwardIterator>) __glibcxx_function_requires(_EqualOpConcept< typename iterator_traits<_ForwardIterator>::value_type, _Tp>) __glibcxx_function_requires(_ConvertibleConcept<_Tp, typename iterator_traits<_ForwardIterator>::value_type>) __glibcxx_requires_valid_range(__first, __last); for (; __first != __last; ++__first) if (*__first == __old_value) *__first = __new_value; } /** * @brief Replace each value in a sequence for which a predicate returns * true with another value. * @ingroup mutating_algorithms * @param __first A forward iterator. * @param __last A forward iterator. * @param __pred A predicate. * @param __new_value The replacement value. * @return replace_if() returns no value. * * For each iterator @c i in the range @p [__first,__last) if @p __pred(*i) * is true then the assignment @c *i = @p __new_value is performed. */ template void replace_if(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred, const _Tp& __new_value) { // concept requirements __glibcxx_function_requires(_Mutable_ForwardIteratorConcept< _ForwardIterator>) __glibcxx_function_requires(_ConvertibleConcept<_Tp, typename iterator_traits<_ForwardIterator>::value_type>) __glibcxx_function_requires(_UnaryPredicateConcept<_Predicate, typename iterator_traits<_ForwardIterator>::value_type>) __glibcxx_requires_valid_range(__first, __last); for (; __first != __last; ++__first) if (__pred(*__first)) *__first = __new_value; } /** * @brief Assign the result of a function object to each value in a * sequence. * @ingroup mutating_algorithms * @param __first A forward iterator. * @param __last A forward iterator. * @param __gen A function object taking no arguments and returning * std::iterator_traits<_ForwardIterator>::value_type * @return generate() returns no value. * * Performs the assignment @c *i = @p __gen() for each @c i in the range * @p [__first,__last). */ template void generate(_ForwardIterator __first, _ForwardIterator __last, _Generator __gen) { // concept requirements __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) __glibcxx_function_requires(_GeneratorConcept<_Generator, typename iterator_traits<_ForwardIterator>::value_type>) __glibcxx_requires_valid_range(__first, __last); for (; __first != __last; ++__first) *__first = __gen(); } /** * @brief Assign the result of a function object to each value in a * sequence. * @ingroup mutating_algorithms * @param __first A forward iterator. * @param __n The length of the sequence. * @param __gen A function object taking no arguments and returning * std::iterator_traits<_ForwardIterator>::value_type * @return The end of the sequence, @p __first+__n * * Performs the assignment @c *i = @p __gen() for each @c i in the range * @p [__first,__first+__n). * * _GLIBCXX_RESOLVE_LIB_DEFECTS * DR 865. More algorithms that throw away information */ template _OutputIterator generate_n(_OutputIterator __first, _Size __n, _Generator __gen) { // concept requirements __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, // "the type returned by a _Generator" __typeof__(__gen())>) for (__decltype(__n + 0) __niter = __n; __niter > 0; --__niter, ++__first) *__first = __gen(); return __first; } /** * @brief Copy a sequence, removing consecutive duplicate values. * @ingroup mutating_algorithms * @param __first An input iterator. * @param __last An input iterator. * @param __result An output iterator. * @return An iterator designating the end of the resulting sequence. * * Copies each element in the range @p [__first,__last) to the range * beginning at @p __result, except that only the first element is copied * from groups of consecutive elements that compare equal. * unique_copy() is stable, so the relative order of elements that are * copied is unchanged. * * _GLIBCXX_RESOLVE_LIB_DEFECTS * DR 241. Does unique_copy() require CopyConstructible and Assignable? * * _GLIBCXX_RESOLVE_LIB_DEFECTS * DR 538. 241 again: Does unique_copy() require CopyConstructible and * Assignable? */ template inline _OutputIterator unique_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result) { // concept requirements __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, typename iterator_traits<_InputIterator>::value_type>) __glibcxx_function_requires(_EqualityComparableConcept< typename iterator_traits<_InputIterator>::value_type>) __glibcxx_requires_valid_range(__first, __last); if (__first == __last) return __result; return std::__unique_copy(__first, __last, __result, __gnu_cxx::__ops::__iter_equal_to_iter(), std::__iterator_category(__first), std::__iterator_category(__result)); } /** * @brief Copy a sequence, removing consecutive values using a predicate. * @ingroup mutating_algorithms * @param __first An input iterator. * @param __last An input iterator. * @param __result An output iterator. * @param __binary_pred A binary predicate. * @return An iterator designating the end of the resulting sequence. * * Copies each element in the range @p [__first,__last) to the range * beginning at @p __result, except that only the first element is copied * from groups of consecutive elements for which @p __binary_pred returns * true. * unique_copy() is stable, so the relative order of elements that are * copied is unchanged. * * _GLIBCXX_RESOLVE_LIB_DEFECTS * DR 241. Does unique_copy() require CopyConstructible and Assignable? */ template inline _OutputIterator unique_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _BinaryPredicate __binary_pred) { // concept requirements -- predicates checked later __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, typename iterator_traits<_InputIterator>::value_type>) __glibcxx_requires_valid_range(__first, __last); if (__first == __last) return __result; return std::__unique_copy(__first, __last, __result, __gnu_cxx::__ops::__iter_comp_iter(__binary_pred), std::__iterator_category(__first), std::__iterator_category(__result)); } /** * @brief Randomly shuffle the elements of a sequence. * @ingroup mutating_algorithms * @param __first A forward iterator. * @param __last A forward iterator. * @return Nothing. * * Reorder the elements in the range @p [__first,__last) using a random * distribution, so that every possible ordering of the sequence is * equally likely. */ template inline void random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last) { // concept requirements __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept< _RandomAccessIterator>) __glibcxx_requires_valid_range(__first, __last); if (__first != __last) for (_RandomAccessIterator __i = __first + 1; __i != __last; ++__i) { // XXX rand() % N is not uniformly distributed _RandomAccessIterator __j = __first + std::rand() % ((__i - __first) + 1); if (__i != __j) std::iter_swap(__i, __j); } } /** * @brief Shuffle the elements of a sequence using a random number * generator. * @ingroup mutating_algorithms * @param __first A forward iterator. * @param __last A forward iterator. * @param __rand The RNG functor or function. * @return Nothing. * * Reorders the elements in the range @p [__first,__last) using @p __rand to * provide a random distribution. Calling @p __rand(N) for a positive * integer @p N should return a randomly chosen integer from the * range [0,N). */ template void random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last, #if __cplusplus >= 201103L _RandomNumberGenerator&& __rand) #else # 4474 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algo.h" 3 _RandomNumberGenerator& __rand) #endif # 4476 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algo.h" 3 { // concept requirements __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept< _RandomAccessIterator>) __glibcxx_requires_valid_range(__first, __last); if (__first == __last) return; for (_RandomAccessIterator __i = __first + 1; __i != __last; ++__i) { _RandomAccessIterator __j = __first + __rand((__i - __first) + 1); if (__i != __j) std::iter_swap(__i, __j); } } /** * @brief Move elements for which a predicate is true to the beginning * of a sequence. * @ingroup mutating_algorithms * @param __first A forward iterator. * @param __last A forward iterator. * @param __pred A predicate functor. * @return An iterator @p middle such that @p __pred(i) is true for each * iterator @p i in the range @p [__first,middle) and false for each @p i * in the range @p [middle,__last). * * @p __pred must not modify its operand. @p partition() does not preserve * the relative ordering of elements in each group, use * @p stable_partition() if this is needed. */ template inline _ForwardIterator partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) { // concept requirements __glibcxx_function_requires(_Mutable_ForwardIteratorConcept< _ForwardIterator>) __glibcxx_function_requires(_UnaryPredicateConcept<_Predicate, typename iterator_traits<_ForwardIterator>::value_type>) __glibcxx_requires_valid_range(__first, __last); return std::__partition(__first, __last, __pred, std::__iterator_category(__first)); } /** * @brief Sort the smallest elements of a sequence. * @ingroup sorting_algorithms * @param __first An iterator. * @param __middle Another iterator. * @param __last Another iterator. * @return Nothing. * * Sorts the smallest @p (__middle-__first) elements in the range * @p [first,last) and moves them to the range @p [__first,__middle). The * order of the remaining elements in the range @p [__middle,__last) is * undefined. * After the sort if @e i and @e j are iterators in the range * @p [__first,__middle) such that i precedes j and @e k is an iterator in * the range @p [__middle,__last) then *j<*i and *k<*i are both false. */ template inline void partial_sort(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last) { // concept requirements __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept< _RandomAccessIterator>) __glibcxx_function_requires(_LessThanComparableConcept< typename iterator_traits<_RandomAccessIterator>::value_type>) __glibcxx_requires_valid_range(__first, __middle); __glibcxx_requires_valid_range(__middle, __last); std::__partial_sort(__first, __middle, __last, __gnu_cxx::__ops::__iter_less_iter()); } /** * @brief Sort the smallest elements of a sequence using a predicate * for comparison. * @ingroup sorting_algorithms * @param __first An iterator. * @param __middle Another iterator. * @param __last Another iterator. * @param __comp A comparison functor. * @return Nothing. * * Sorts the smallest @p (__middle-__first) elements in the range * @p [__first,__last) and moves them to the range @p [__first,__middle). The * order of the remaining elements in the range @p [__middle,__last) is * undefined. * After the sort if @e i and @e j are iterators in the range * @p [__first,__middle) such that i precedes j and @e k is an iterator in * the range @p [__middle,__last) then @p *__comp(j,*i) and @p __comp(*k,*i) * are both false. */ template inline void partial_sort(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last, _Compare __comp) { // concept requirements __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept< _RandomAccessIterator>) __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, typename iterator_traits<_RandomAccessIterator>::value_type, typename iterator_traits<_RandomAccessIterator>::value_type>) __glibcxx_requires_valid_range(__first, __middle); __glibcxx_requires_valid_range(__middle, __last); std::__partial_sort(__first, __middle, __last, __gnu_cxx::__ops::__iter_comp_iter(__comp)); } /** * @brief Sort a sequence just enough to find a particular position. * @ingroup sorting_algorithms * @param __first An iterator. * @param __nth Another iterator. * @param __last Another iterator. * @return Nothing. * * Rearranges the elements in the range @p [__first,__last) so that @p *__nth * is the same element that would have been in that position had the * whole sequence been sorted. The elements either side of @p *__nth are * not completely sorted, but for any iterator @e i in the range * @p [__first,__nth) and any iterator @e j in the range @p [__nth,__last) it * holds that *j < *i is false. */ template inline void nth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth, _RandomAccessIterator __last) { // concept requirements __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept< _RandomAccessIterator>) __glibcxx_function_requires(_LessThanComparableConcept< typename iterator_traits<_RandomAccessIterator>::value_type>) __glibcxx_requires_valid_range(__first, __nth); __glibcxx_requires_valid_range(__nth, __last); if (__first == __last || __nth == __last) return; std::__introselect(__first, __nth, __last, std::__lg(__last - __first) * 2, __gnu_cxx::__ops::__iter_less_iter()); } /** * @brief Sort a sequence just enough to find a particular position * using a predicate for comparison. * @ingroup sorting_algorithms * @param __first An iterator. * @param __nth Another iterator. * @param __last Another iterator. * @param __comp A comparison functor. * @return Nothing. * * Rearranges the elements in the range @p [__first,__last) so that @p *__nth * is the same element that would have been in that position had the * whole sequence been sorted. The elements either side of @p *__nth are * not completely sorted, but for any iterator @e i in the range * @p [__first,__nth) and any iterator @e j in the range @p [__nth,__last) it * holds that @p __comp(*j,*i) is false. */ template inline void nth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth, _RandomAccessIterator __last, _Compare __comp) { // concept requirements __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept< _RandomAccessIterator>) __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, typename iterator_traits<_RandomAccessIterator>::value_type, typename iterator_traits<_RandomAccessIterator>::value_type>) __glibcxx_requires_valid_range(__first, __nth); __glibcxx_requires_valid_range(__nth, __last); if (__first == __last || __nth == __last) return; std::__introselect(__first, __nth, __last, std::__lg(__last - __first) * 2, __gnu_cxx::__ops::__iter_comp_iter(__comp)); } /** * @brief Sort the elements of a sequence. * @ingroup sorting_algorithms * @param __first An iterator. * @param __last Another iterator. * @return Nothing. * * Sorts the elements in the range @p [__first,__last) in ascending order, * such that for each iterator @e i in the range @p [__first,__last-1), * *(i+1)<*i is false. * * The relative ordering of equivalent elements is not preserved, use * @p stable_sort() if this is needed. */ template inline void sort(_RandomAccessIterator __first, _RandomAccessIterator __last) { // concept requirements __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept< _RandomAccessIterator>) __glibcxx_function_requires(_LessThanComparableConcept< typename iterator_traits<_RandomAccessIterator>::value_type>) __glibcxx_requires_valid_range(__first, __last); std::__sort(__first, __last, __gnu_cxx::__ops::__iter_less_iter()); } /** * @brief Sort the elements of a sequence using a predicate for comparison. * @ingroup sorting_algorithms * @param __first An iterator. * @param __last Another iterator. * @param __comp A comparison functor. * @return Nothing. * * Sorts the elements in the range @p [__first,__last) in ascending order, * such that @p __comp(*(i+1),*i) is false for every iterator @e i in the * range @p [__first,__last-1). * * The relative ordering of equivalent elements is not preserved, use * @p stable_sort() if this is needed. */ template inline void sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) { // concept requirements __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept< _RandomAccessIterator>) __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, typename iterator_traits<_RandomAccessIterator>::value_type, typename iterator_traits<_RandomAccessIterator>::value_type>) __glibcxx_requires_valid_range(__first, __last); std::__sort(__first, __last, __gnu_cxx::__ops::__iter_comp_iter(__comp)); } template _OutputIterator __merge(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp) { while (__first1 != __last1 && __first2 != __last2) { if (__comp(__first2, __first1)) { *__result = *__first2; ++__first2; } else { *__result = *__first1; ++__first1; } ++__result; } return std::copy(__first2, __last2, std::copy(__first1, __last1, __result)); } /** * @brief Merges two sorted ranges. * @ingroup sorting_algorithms * @param __first1 An iterator. * @param __first2 Another iterator. * @param __last1 Another iterator. * @param __last2 Another iterator. * @param __result An iterator pointing to the end of the merged range. * @return An iterator pointing to the first element not less * than @e val. * * Merges the ranges @p [__first1,__last1) and @p [__first2,__last2) into * the sorted range @p [__result, __result + (__last1-__first1) + * (__last2-__first2)). Both input ranges must be sorted, and the * output range must not overlap with either of the input ranges. * The sort is @e stable, that is, for equivalent elements in the * two ranges, elements from the first range will always come * before elements from the second. */ template inline _OutputIterator merge(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result) { // concept requirements __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>) __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>) __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, typename iterator_traits<_InputIterator1>::value_type>) __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, typename iterator_traits<_InputIterator2>::value_type>) __glibcxx_function_requires(_LessThanOpConcept< typename iterator_traits<_InputIterator2>::value_type, typename iterator_traits<_InputIterator1>::value_type>) __glibcxx_requires_sorted_set(__first1, __last1, __first2); __glibcxx_requires_sorted_set(__first2, __last2, __first1); return _GLIBCXX_STD_A::__merge(__first1, __last1, __first2, __last2, __result, __gnu_cxx::__ops::__iter_less_iter()); } /** * @brief Merges two sorted ranges. * @ingroup sorting_algorithms * @param __first1 An iterator. * @param __first2 Another iterator. * @param __last1 Another iterator. * @param __last2 Another iterator. * @param __result An iterator pointing to the end of the merged range. * @param __comp A functor to use for comparisons. * @return An iterator pointing to the first element "not less * than" @e val. * * Merges the ranges @p [__first1,__last1) and @p [__first2,__last2) into * the sorted range @p [__result, __result + (__last1-__first1) + * (__last2-__first2)). Both input ranges must be sorted, and the * output range must not overlap with either of the input ranges. * The sort is @e stable, that is, for equivalent elements in the * two ranges, elements from the first range will always come * before elements from the second. * * The comparison function should have the same effects on ordering as * the function used for the initial sort. */ template inline _OutputIterator merge(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp) { // concept requirements __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>) __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>) __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, typename iterator_traits<_InputIterator1>::value_type>) __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, typename iterator_traits<_InputIterator2>::value_type>) __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, typename iterator_traits<_InputIterator2>::value_type, typename iterator_traits<_InputIterator1>::value_type>) __glibcxx_requires_sorted_set_pred(__first1, __last1, __first2, __comp); __glibcxx_requires_sorted_set_pred(__first2, __last2, __first1, __comp); return _GLIBCXX_STD_A::__merge(__first1, __last1, __first2, __last2, __result, __gnu_cxx::__ops::__iter_comp_iter(__comp)); } template inline void __stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) { typedef typename iterator_traits<_RandomAccessIterator>::value_type _ValueType; typedef typename iterator_traits<_RandomAccessIterator>::difference_type _DistanceType; typedef _Temporary_buffer<_RandomAccessIterator, _ValueType> _TmpBuf; _TmpBuf __buf(__first, __last); if (__buf.begin() == 0) std::__inplace_stable_sort(__first, __last, __comp); else std::__stable_sort_adaptive(__first, __last, __buf.begin(), _DistanceType(__buf.size()), __comp); } /** * @brief Sort the elements of a sequence, preserving the relative order * of equivalent elements. * @ingroup sorting_algorithms * @param __first An iterator. * @param __last Another iterator. * @return Nothing. * * Sorts the elements in the range @p [__first,__last) in ascending order, * such that for each iterator @p i in the range @p [__first,__last-1), * @p *(i+1)<*i is false. * * The relative ordering of equivalent elements is preserved, so any two * elements @p x and @p y in the range @p [__first,__last) such that * @p x inline void stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last) { // concept requirements __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept< _RandomAccessIterator>) __glibcxx_function_requires(_LessThanComparableConcept< typename iterator_traits<_RandomAccessIterator>::value_type>) __glibcxx_requires_valid_range(__first, __last); _GLIBCXX_STD_A::__stable_sort(__first, __last, __gnu_cxx::__ops::__iter_less_iter()); } /** * @brief Sort the elements of a sequence using a predicate for comparison, * preserving the relative order of equivalent elements. * @ingroup sorting_algorithms * @param __first An iterator. * @param __last Another iterator. * @param __comp A comparison functor. * @return Nothing. * * Sorts the elements in the range @p [__first,__last) in ascending order, * such that for each iterator @p i in the range @p [__first,__last-1), * @p __comp(*(i+1),*i) is false. * * The relative ordering of equivalent elements is preserved, so any two * elements @p x and @p y in the range @p [__first,__last) such that * @p __comp(x,y) is false and @p __comp(y,x) is false will have the same * relative ordering after calling @p stable_sort(). */ template inline void stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) { // concept requirements __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept< _RandomAccessIterator>) __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, typename iterator_traits<_RandomAccessIterator>::value_type, typename iterator_traits<_RandomAccessIterator>::value_type>) __glibcxx_requires_valid_range(__first, __last); _GLIBCXX_STD_A::__stable_sort(__first, __last, __gnu_cxx::__ops::__iter_comp_iter(__comp)); } template _OutputIterator __set_union(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp) { while (__first1 != __last1 && __first2 != __last2) { if (__comp(__first1, __first2)) { *__result = *__first1; ++__first1; } else if (__comp(__first2, __first1)) { *__result = *__first2; ++__first2; } else { *__result = *__first1; ++__first1; ++__first2; } ++__result; } return std::copy(__first2, __last2, std::copy(__first1, __last1, __result)); } /** * @brief Return the union of two sorted ranges. * @ingroup set_algorithms * @param __first1 Start of first range. * @param __last1 End of first range. * @param __first2 Start of second range. * @param __last2 End of second range. * @return End of the output range. * @ingroup set_algorithms * * This operation iterates over both ranges, copying elements present in * each range in order to the output range. Iterators increment for each * range. When the current element of one range is less than the other, * that element is copied and the iterator advanced. If an element is * contained in both ranges, the element from the first range is copied and * both ranges advance. The output range may not overlap either input * range. */ template inline _OutputIterator set_union(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result) { // concept requirements __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>) __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>) __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, typename iterator_traits<_InputIterator1>::value_type>) __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, typename iterator_traits<_InputIterator2>::value_type>) __glibcxx_function_requires(_LessThanOpConcept< typename iterator_traits<_InputIterator1>::value_type, typename iterator_traits<_InputIterator2>::value_type>) __glibcxx_function_requires(_LessThanOpConcept< typename iterator_traits<_InputIterator2>::value_type, typename iterator_traits<_InputIterator1>::value_type>) __glibcxx_requires_sorted_set(__first1, __last1, __first2); __glibcxx_requires_sorted_set(__first2, __last2, __first1); return _GLIBCXX_STD_A::__set_union(__first1, __last1, __first2, __last2, __result, __gnu_cxx::__ops::__iter_less_iter()); } /** * @brief Return the union of two sorted ranges using a comparison functor. * @ingroup set_algorithms * @param __first1 Start of first range. * @param __last1 End of first range. * @param __first2 Start of second range. * @param __last2 End of second range. * @param __comp The comparison functor. * @return End of the output range. * @ingroup set_algorithms * * This operation iterates over both ranges, copying elements present in * each range in order to the output range. Iterators increment for each * range. When the current element of one range is less than the other * according to @p __comp, that element is copied and the iterator advanced. * If an equivalent element according to @p __comp is contained in both * ranges, the element from the first range is copied and both ranges * advance. The output range may not overlap either input range. */ template inline _OutputIterator set_union(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp) { // concept requirements __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>) __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>) __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, typename iterator_traits<_InputIterator1>::value_type>) __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, typename iterator_traits<_InputIterator2>::value_type>) __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, typename iterator_traits<_InputIterator1>::value_type, typename iterator_traits<_InputIterator2>::value_type>) __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, typename iterator_traits<_InputIterator2>::value_type, typename iterator_traits<_InputIterator1>::value_type>) __glibcxx_requires_sorted_set_pred(__first1, __last1, __first2, __comp); __glibcxx_requires_sorted_set_pred(__first2, __last2, __first1, __comp); return _GLIBCXX_STD_A::__set_union(__first1, __last1, __first2, __last2, __result, __gnu_cxx::__ops::__iter_comp_iter(__comp)); } template _OutputIterator __set_intersection(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp) { while (__first1 != __last1 && __first2 != __last2) if (__comp(__first1, __first2)) ++__first1; else if (__comp(__first2, __first1)) ++__first2; else { *__result = *__first1; ++__first1; ++__first2; ++__result; } return __result; } /** * @brief Return the intersection of two sorted ranges. * @ingroup set_algorithms * @param __first1 Start of first range. * @param __last1 End of first range. * @param __first2 Start of second range. * @param __last2 End of second range. * @return End of the output range. * @ingroup set_algorithms * * This operation iterates over both ranges, copying elements present in * both ranges in order to the output range. Iterators increment for each * range. When the current element of one range is less than the other, * that iterator advances. If an element is contained in both ranges, the * element from the first range is copied and both ranges advance. The * output range may not overlap either input range. */ template inline _OutputIterator set_intersection(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result) { // concept requirements __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>) __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>) __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, typename iterator_traits<_InputIterator1>::value_type>) __glibcxx_function_requires(_LessThanOpConcept< typename iterator_traits<_InputIterator1>::value_type, typename iterator_traits<_InputIterator2>::value_type>) __glibcxx_function_requires(_LessThanOpConcept< typename iterator_traits<_InputIterator2>::value_type, typename iterator_traits<_InputIterator1>::value_type>) __glibcxx_requires_sorted_set(__first1, __last1, __first2); __glibcxx_requires_sorted_set(__first2, __last2, __first1); return _GLIBCXX_STD_A::__set_intersection(__first1, __last1, __first2, __last2, __result, __gnu_cxx::__ops::__iter_less_iter()); } /** * @brief Return the intersection of two sorted ranges using comparison * functor. * @ingroup set_algorithms * @param __first1 Start of first range. * @param __last1 End of first range. * @param __first2 Start of second range. * @param __last2 End of second range. * @param __comp The comparison functor. * @return End of the output range. * @ingroup set_algorithms * * This operation iterates over both ranges, copying elements present in * both ranges in order to the output range. Iterators increment for each * range. When the current element of one range is less than the other * according to @p __comp, that iterator advances. If an element is * contained in both ranges according to @p __comp, the element from the * first range is copied and both ranges advance. The output range may not * overlap either input range. */ template inline _OutputIterator set_intersection(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp) { // concept requirements __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>) __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>) __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, typename iterator_traits<_InputIterator1>::value_type>) __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, typename iterator_traits<_InputIterator1>::value_type, typename iterator_traits<_InputIterator2>::value_type>) __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, typename iterator_traits<_InputIterator2>::value_type, typename iterator_traits<_InputIterator1>::value_type>) __glibcxx_requires_sorted_set_pred(__first1, __last1, __first2, __comp); __glibcxx_requires_sorted_set_pred(__first2, __last2, __first1, __comp); return _GLIBCXX_STD_A::__set_intersection(__first1, __last1, __first2, __last2, __result, __gnu_cxx::__ops::__iter_comp_iter(__comp)); } template _OutputIterator __set_difference(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp) { while (__first1 != __last1 && __first2 != __last2) if (__comp(__first1, __first2)) { *__result = *__first1; ++__first1; ++__result; } else if (__comp(__first2, __first1)) ++__first2; else { ++__first1; ++__first2; } return std::copy(__first1, __last1, __result); } /** * @brief Return the difference of two sorted ranges. * @ingroup set_algorithms * @param __first1 Start of first range. * @param __last1 End of first range. * @param __first2 Start of second range. * @param __last2 End of second range. * @return End of the output range. * @ingroup set_algorithms * * This operation iterates over both ranges, copying elements present in * the first range but not the second in order to the output range. * Iterators increment for each range. When the current element of the * first range is less than the second, that element is copied and the * iterator advances. If the current element of the second range is less, * the iterator advances, but no element is copied. If an element is * contained in both ranges, no elements are copied and both ranges * advance. The output range may not overlap either input range. */ template inline _OutputIterator set_difference(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result) { // concept requirements __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>) __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>) __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, typename iterator_traits<_InputIterator1>::value_type>) __glibcxx_function_requires(_LessThanOpConcept< typename iterator_traits<_InputIterator1>::value_type, typename iterator_traits<_InputIterator2>::value_type>) __glibcxx_function_requires(_LessThanOpConcept< typename iterator_traits<_InputIterator2>::value_type, typename iterator_traits<_InputIterator1>::value_type>) __glibcxx_requires_sorted_set(__first1, __last1, __first2); __glibcxx_requires_sorted_set(__first2, __last2, __first1); return _GLIBCXX_STD_A::__set_difference(__first1, __last1, __first2, __last2, __result, __gnu_cxx::__ops::__iter_less_iter()); } /** * @brief Return the difference of two sorted ranges using comparison * functor. * @ingroup set_algorithms * @param __first1 Start of first range. * @param __last1 End of first range. * @param __first2 Start of second range. * @param __last2 End of second range. * @param __comp The comparison functor. * @return End of the output range. * @ingroup set_algorithms * * This operation iterates over both ranges, copying elements present in * the first range but not the second in order to the output range. * Iterators increment for each range. When the current element of the * first range is less than the second according to @p __comp, that element * is copied and the iterator advances. If the current element of the * second range is less, no element is copied and the iterator advances. * If an element is contained in both ranges according to @p __comp, no * elements are copied and both ranges advance. The output range may not * overlap either input range. */ template inline _OutputIterator set_difference(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp) { // concept requirements __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>) __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>) __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, typename iterator_traits<_InputIterator1>::value_type>) __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, typename iterator_traits<_InputIterator1>::value_type, typename iterator_traits<_InputIterator2>::value_type>) __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, typename iterator_traits<_InputIterator2>::value_type, typename iterator_traits<_InputIterator1>::value_type>) __glibcxx_requires_sorted_set_pred(__first1, __last1, __first2, __comp); __glibcxx_requires_sorted_set_pred(__first2, __last2, __first1, __comp); return _GLIBCXX_STD_A::__set_difference(__first1, __last1, __first2, __last2, __result, __gnu_cxx::__ops::__iter_comp_iter(__comp)); } template _OutputIterator __set_symmetric_difference(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp) { while (__first1 != __last1 && __first2 != __last2) if (__comp(__first1, __first2)) { *__result = *__first1; ++__first1; ++__result; } else if (__comp(__first2, __first1)) { *__result = *__first2; ++__first2; ++__result; } else { ++__first1; ++__first2; } return std::copy(__first2, __last2, std::copy(__first1, __last1, __result)); } /** * @brief Return the symmetric difference of two sorted ranges. * @ingroup set_algorithms * @param __first1 Start of first range. * @param __last1 End of first range. * @param __first2 Start of second range. * @param __last2 End of second range. * @return End of the output range. * @ingroup set_algorithms * * This operation iterates over both ranges, copying elements present in * one range but not the other in order to the output range. Iterators * increment for each range. When the current element of one range is less * than the other, that element is copied and the iterator advances. If an * element is contained in both ranges, no elements are copied and both * ranges advance. The output range may not overlap either input range. */ template inline _OutputIterator set_symmetric_difference(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result) { // concept requirements __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>) __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>) __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, typename iterator_traits<_InputIterator1>::value_type>) __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, typename iterator_traits<_InputIterator2>::value_type>) __glibcxx_function_requires(_LessThanOpConcept< typename iterator_traits<_InputIterator1>::value_type, typename iterator_traits<_InputIterator2>::value_type>) __glibcxx_function_requires(_LessThanOpConcept< typename iterator_traits<_InputIterator2>::value_type, typename iterator_traits<_InputIterator1>::value_type>) __glibcxx_requires_sorted_set(__first1, __last1, __first2); __glibcxx_requires_sorted_set(__first2, __last2, __first1); return _GLIBCXX_STD_A::__set_symmetric_difference(__first1, __last1, __first2, __last2, __result, __gnu_cxx::__ops::__iter_less_iter()); } /** * @brief Return the symmetric difference of two sorted ranges using * comparison functor. * @ingroup set_algorithms * @param __first1 Start of first range. * @param __last1 End of first range. * @param __first2 Start of second range. * @param __last2 End of second range. * @param __comp The comparison functor. * @return End of the output range. * @ingroup set_algorithms * * This operation iterates over both ranges, copying elements present in * one range but not the other in order to the output range. Iterators * increment for each range. When the current element of one range is less * than the other according to @p comp, that element is copied and the * iterator advances. If an element is contained in both ranges according * to @p __comp, no elements are copied and both ranges advance. The output * range may not overlap either input range. */ template inline _OutputIterator set_symmetric_difference(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp) { // concept requirements __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>) __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>) __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, typename iterator_traits<_InputIterator1>::value_type>) __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, typename iterator_traits<_InputIterator2>::value_type>) __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, typename iterator_traits<_InputIterator1>::value_type, typename iterator_traits<_InputIterator2>::value_type>) __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, typename iterator_traits<_InputIterator2>::value_type, typename iterator_traits<_InputIterator1>::value_type>) __glibcxx_requires_sorted_set_pred(__first1, __last1, __first2, __comp); __glibcxx_requires_sorted_set_pred(__first2, __last2, __first1, __comp); return _GLIBCXX_STD_A::__set_symmetric_difference(__first1, __last1, __first2, __last2, __result, __gnu_cxx::__ops::__iter_comp_iter(__comp)); } template _GLIBCXX14_CONSTEXPR _ForwardIterator __min_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp) { if (__first == __last) return __first; _ForwardIterator __result = __first; while (++__first != __last) if (__comp(__first, __result)) __result = __first; return __result; } /** * @brief Return the minimum element in a range. * @ingroup sorting_algorithms * @param __first Start of range. * @param __last End of range. * @return Iterator referencing the first instance of the smallest value. */ template _GLIBCXX14_CONSTEXPR _ForwardIterator inline min_element(_ForwardIterator __first, _ForwardIterator __last) { // concept requirements __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) __glibcxx_function_requires(_LessThanComparableConcept< typename iterator_traits<_ForwardIterator>::value_type>) __glibcxx_requires_valid_range(__first, __last); return _GLIBCXX_STD_A::__min_element(__first, __last, __gnu_cxx::__ops::__iter_less_iter()); } /** * @brief Return the minimum element in a range using comparison functor. * @ingroup sorting_algorithms * @param __first Start of range. * @param __last End of range. * @param __comp Comparison functor. * @return Iterator referencing the first instance of the smallest value * according to __comp. */ template _GLIBCXX14_CONSTEXPR inline _ForwardIterator min_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp) { // concept requirements __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, typename iterator_traits<_ForwardIterator>::value_type, typename iterator_traits<_ForwardIterator>::value_type>) __glibcxx_requires_valid_range(__first, __last); return _GLIBCXX_STD_A::__min_element(__first, __last, __gnu_cxx::__ops::__iter_comp_iter(__comp)); } template _GLIBCXX14_CONSTEXPR _ForwardIterator __max_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp) { if (__first == __last) return __first; _ForwardIterator __result = __first; while (++__first != __last) if (__comp(__result, __first)) __result = __first; return __result; } /** * @brief Return the maximum element in a range. * @ingroup sorting_algorithms * @param __first Start of range. * @param __last End of range. * @return Iterator referencing the first instance of the largest value. */ template _GLIBCXX14_CONSTEXPR inline _ForwardIterator max_element(_ForwardIterator __first, _ForwardIterator __last) { // concept requirements __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) __glibcxx_function_requires(_LessThanComparableConcept< typename iterator_traits<_ForwardIterator>::value_type>) __glibcxx_requires_valid_range(__first, __last); return _GLIBCXX_STD_A::__max_element(__first, __last, __gnu_cxx::__ops::__iter_less_iter()); } /** * @brief Return the maximum element in a range using comparison functor. * @ingroup sorting_algorithms * @param __first Start of range. * @param __last End of range. * @param __comp Comparison functor. * @return Iterator referencing the first instance of the largest value * according to __comp. */ template _GLIBCXX14_CONSTEXPR inline _ForwardIterator max_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp) { // concept requirements __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, typename iterator_traits<_ForwardIterator>::value_type, typename iterator_traits<_ForwardIterator>::value_type>) __glibcxx_requires_valid_range(__first, __last); return _GLIBCXX_STD_A::__max_element(__first, __last, __gnu_cxx::__ops::__iter_comp_iter(__comp)); } _GLIBCXX_END_NAMESPACE_ALGO } // namespace std #endif /* _STL_ALGO_H */ # 5547 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/stl_algo.h" 3 # 63 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/algorithm" 2 3 #ifdef _GLIBCXX_PARALLEL #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 65 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/algorithm" 3 # 66 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/algorithm" 3 #endif # 67 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/algorithm" 3 #endif /* _GLIBCXX_ALGORITHM */ # 69 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/algorithm" 3 # 7 "./Graph.hpp" 2 using namespace std; class Graph { public: virtual ~Graph() = 0; // no data virtual uint64_t get_n() = 0; virtual uint32_t find_value(uint32_t src, uint32_t dest) = 0; virtual vector sparse_matrix_vector_multiplication(std::vector const &v) = 0; virtual void print_graph() = 0; virtual void add_node() = 0; virtual void add_edge(uint32_t src, uint32_t dest, uint32_t value) = 0; virtual void add_edge_update(uint32_t src, uint32_t dest, uint32_t value) = 0; virtual uint64_t get_size() = 0; virtual vector pagerank(std::vector const &node_values) = 0; virtual vector > get_edges() = 0; // takes in start node, returns vector of distances (length n) // max_int if not connected virtual vector bfs(uint32_t start_node) = 0; virtual void convert(Graph* g) = 0; // virtual vector find_neighbors(uint32_t v) = 0; }; // needed so the correct destructor is called when using base pointer Graph::~Graph() { } #endif # 38 "./Graph.hpp" # 13 "test2.cpp" 2 #if 0 /* expanded by -frewrite-includes */ #include "AdjacencyMatrix.cpp" #endif /* expanded by -frewrite-includes */ # 13 "test2.cpp" # 1 "./AdjacencyMatrix.cpp" 1 /* * adjacency matrix */ #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 5 "./AdjacencyMatrix.cpp" # 6 "./AdjacencyMatrix.cpp" #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 6 "./AdjacencyMatrix.cpp" # 7 "./AdjacencyMatrix.cpp" #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 7 "./AdjacencyMatrix.cpp" # 8 "./AdjacencyMatrix.cpp" #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 8 "./AdjacencyMatrix.cpp" # 9 "./AdjacencyMatrix.cpp" #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 9 "./AdjacencyMatrix.cpp" # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstring" 1 3 // -*- C++ -*- forwarding header. // Copyright (C) 1997-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file cstring * This is a Standard C++ Library file. You should @c \#include this file * in your programs, rather than any of the @a *.h implementation files. * * This is the C++ version of the Standard C Library header @c string.h, * and its contents are (mostly) the same as that header, but are all * contained in the namespace @c std (except for names which are defined * as macros in C). */ // // ISO C++ 14882: 20.4.6 C library // #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstring" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstring" 3 # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstring" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstring" 3 # 1 "/usr/include/string.h" 1 3 4 /* Copyright (C) 1991-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard: 7.21 String handling */ #ifndef _STRING_H #define _STRING_H 1 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 25 "/usr/include/string.h" 3 4 # 26 "/usr/include/string.h" 3 4 __BEGIN_DECLS /* Get size_t and NULL from . */ #define __need_size_t #define __need_NULL #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 32 "/usr/include/string.h" 3 4 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 1 3 4 /*===---- stddef.h - Basic type definitions --------------------------------=== * * Copyright (c) 2008 Eli Friedman * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #if !defined(__STDDEF_H) || defined(__need_ptrdiff_t) || \ defined(__need_size_t) || defined(__need_wchar_t) || \ defined(__need_NULL) || defined(__need_wint_t) #if !defined(__need_ptrdiff_t) && !defined(__need_size_t) && \ !defined(__need_wchar_t) && !defined(__need_NULL) && \ !defined(__need_wint_t) /* Always define miscellaneous pieces when modules are available. */ #if !__has_feature(modules) #define __STDDEF_H #endif # 37 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #define __need_ptrdiff_t #define __need_size_t #define __need_wchar_t #define __need_NULL #define __need_STDDEF_H_misc /* __need_wint_t is intentionally not defined here. */ #endif # 44 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_ptrdiff_t) #if !defined(_PTRDIFF_T) || __has_feature(modules) /* Always define ptrdiff_t when modules are available. */ #if !__has_feature(modules) #define _PTRDIFF_T #endif # 51 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 typedef __PTRDIFF_TYPE__ ptrdiff_t; #endif # 53 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #undef __need_ptrdiff_t #endif /* defined(__need_ptrdiff_t) */ # 55 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_size_t) #if !defined(_SIZE_T) || __has_feature(modules) /* Always define size_t when modules are available. */ #if !__has_feature(modules) #define _SIZE_T #endif # 62 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 typedef __SIZE_TYPE__ size_t; #endif # 64 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #undef __need_size_t #endif /*defined(__need_size_t) */ # 66 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_STDDEF_H_misc) /* ISO9899:2011 7.20 (C11 Annex K): Define rsize_t if __STDC_WANT_LIB_EXT1__ is * enabled. */ #if (defined(__STDC_WANT_LIB_EXT1__) && __STDC_WANT_LIB_EXT1__ >= 1 && \ !defined(_RSIZE_T)) || __has_feature(modules) /* Always define rsize_t when modules are available. */ #if !__has_feature(modules) #define _RSIZE_T #endif # 76 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 typedef __SIZE_TYPE__ rsize_t; #endif # 78 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif /* defined(__need_STDDEF_H_misc) */ # 79 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_wchar_t) #ifndef __cplusplus /* Always define wchar_t when modules are available. */ #if !defined(_WCHAR_T) || __has_feature(modules) #if !__has_feature(modules) #define _WCHAR_T #if defined(_MSC_EXTENSIONS) #define _WCHAR_T_DEFINED #endif # 89 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif # 90 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 typedef __WCHAR_TYPE__ wchar_t; #endif # 92 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif # 93 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #undef __need_wchar_t #endif /* defined(__need_wchar_t) */ # 95 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_NULL) #undef NULL #ifdef __cplusplus # if !defined(__MINGW32__) && !defined(_MSC_VER) # define NULL __null # else # 102 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 # define NULL 0 # endif # 104 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #else # 105 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 # define NULL ((void*)0) #endif # 107 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #ifdef __cplusplus #if defined(_MSC_EXTENSIONS) && defined(_NATIVE_NULLPTR_SUPPORTED) namespace std { typedef decltype(nullptr) nullptr_t; } using ::std::nullptr_t; #endif # 112 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif # 113 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #undef __need_NULL #endif /* defined(__need_NULL) */ # 115 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_STDDEF_H_misc) #if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L #if 0 /* expanded by -frewrite-includes */ #include "__stddef_max_align_t.h" #endif /* expanded by -frewrite-includes */ # 118 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 # 119 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif # 120 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #define offsetof(t, d) __builtin_offsetof(t, d) #undef __need_STDDEF_H_misc #endif /* defined(__need_STDDEF_H_misc) */ # 123 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 /* Some C libraries expect to see a wint_t here. Others (notably MinGW) will use __WINT_TYPE__ directly; accommodate both by requiring __need_wint_t */ #if defined(__need_wint_t) /* Always define wint_t when modules are available. */ #if !defined(_WINT_T) || __has_feature(modules) #if !__has_feature(modules) #define _WINT_T #endif # 132 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 typedef __WINT_TYPE__ wint_t; #endif # 134 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #undef __need_wint_t #endif /* __need_wint_t */ # 136 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif # 138 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 # 33 "/usr/include/string.h" 2 3 4 /* Provide correct C++ prototypes, and indicate this to the caller. This requires a compatible C++ standard library. As a heuristic, we provide these when the compiler indicates full conformance with C++98 or later, and for older GCC versions that are known to provide a compatible libstdc++. */ #if defined __cplusplus && (__cplusplus >= 199711L || __GNUC_PREREQ (4, 4)) # define __CORRECT_ISO_CPP_STRING_H_PROTO #endif # 42 "/usr/include/string.h" 3 4 __BEGIN_NAMESPACE_STD /* Copy N bytes of SRC to DEST. */ extern void *memcpy (void *__restrict __dest, const void *__restrict __src, size_t __n) __THROW __nonnull ((1, 2)); /* Copy N bytes of SRC to DEST, guaranteeing correct behavior for overlapping strings. */ extern void *memmove (void *__dest, const void *__src, size_t __n) __THROW __nonnull ((1, 2)); __END_NAMESPACE_STD /* Copy no more than N bytes of SRC to DEST, stopping when C is found. Return the position in DEST one byte past where C was copied, or NULL if C was not found in the first N bytes of SRC. */ #if defined __USE_SVID || defined __USE_BSD || defined __USE_XOPEN extern void *memccpy (void *__restrict __dest, const void *__restrict __src, int __c, size_t __n) __THROW __nonnull ((1, 2)); #endif /* SVID. */ # 62 "/usr/include/string.h" 3 4 __BEGIN_NAMESPACE_STD /* Set N bytes of S to C. */ extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1)); /* Compare N bytes of S1 and S2. */ extern int memcmp (const void *__s1, const void *__s2, size_t __n) __THROW __attribute_pure__ __nonnull ((1, 2)); /* Search N bytes of S for C. */ #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" { extern void *memchr (void *__s, int __c, size_t __n) __THROW __asm ("memchr") __attribute_pure__ __nonnull ((1)); extern const void *memchr (const void *__s, int __c, size_t __n) __THROW __asm ("memchr") __attribute_pure__ __nonnull ((1)); # ifdef __OPTIMIZE__ __extern_always_inline void * memchr (void *__s, int __c, size_t __n) __THROW { return __builtin_memchr (__s, __c, __n); } __extern_always_inline const void * memchr (const void *__s, int __c, size_t __n) __THROW { return __builtin_memchr (__s, __c, __n); } # endif # 94 "/usr/include/string.h" 3 4 } #else # 96 "/usr/include/string.h" 3 4 extern void *memchr (const void *__s, int __c, size_t __n) __THROW __attribute_pure__ __nonnull ((1)); #endif # 99 "/usr/include/string.h" 3 4 __END_NAMESPACE_STD #ifdef __USE_GNU /* Search in S for C. This is similar to `memchr' but there is no length limit. */ # ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" void *rawmemchr (void *__s, int __c) __THROW __asm ("rawmemchr") __attribute_pure__ __nonnull ((1)); extern "C++" const void *rawmemchr (const void *__s, int __c) __THROW __asm ("rawmemchr") __attribute_pure__ __nonnull ((1)); # else # 110 "/usr/include/string.h" 3 4 extern void *rawmemchr (const void *__s, int __c) __THROW __attribute_pure__ __nonnull ((1)); # endif # 113 "/usr/include/string.h" 3 4 /* Search N bytes of S for the final occurrence of C. */ # ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" void *memrchr (void *__s, int __c, size_t __n) __THROW __asm ("memrchr") __attribute_pure__ __nonnull ((1)); extern "C++" const void *memrchr (const void *__s, int __c, size_t __n) __THROW __asm ("memrchr") __attribute_pure__ __nonnull ((1)); # else # 121 "/usr/include/string.h" 3 4 extern void *memrchr (const void *__s, int __c, size_t __n) __THROW __attribute_pure__ __nonnull ((1)); # endif # 124 "/usr/include/string.h" 3 4 #endif # 125 "/usr/include/string.h" 3 4 __BEGIN_NAMESPACE_STD /* Copy SRC to DEST. */ extern char *strcpy (char *__restrict __dest, const char *__restrict __src) __THROW __nonnull ((1, 2)); /* Copy no more than N characters of SRC to DEST. */ extern char *strncpy (char *__restrict __dest, const char *__restrict __src, size_t __n) __THROW __nonnull ((1, 2)); /* Append SRC onto DEST. */ extern char *strcat (char *__restrict __dest, const char *__restrict __src) __THROW __nonnull ((1, 2)); /* Append no more than N characters from SRC onto DEST. */ extern char *strncat (char *__restrict __dest, const char *__restrict __src, size_t __n) __THROW __nonnull ((1, 2)); /* Compare S1 and S2. */ extern int strcmp (const char *__s1, const char *__s2) __THROW __attribute_pure__ __nonnull ((1, 2)); /* Compare N characters of S1 and S2. */ extern int strncmp (const char *__s1, const char *__s2, size_t __n) __THROW __attribute_pure__ __nonnull ((1, 2)); /* Compare the collated forms of S1 and S2. */ extern int strcoll (const char *__s1, const char *__s2) __THROW __attribute_pure__ __nonnull ((1, 2)); /* Put a transformation of SRC into no more than N bytes of DEST. */ extern size_t strxfrm (char *__restrict __dest, const char *__restrict __src, size_t __n) __THROW __nonnull ((2)); __END_NAMESPACE_STD #ifdef __USE_XOPEN2K8 /* The following functions are equivalent to the both above but they take the locale they use for the collation as an extra argument. This is not standardsized but something like will come. */ #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 163 "/usr/include/string.h" 3 4 # 164 "/usr/include/string.h" 3 4 /* Compare the collated forms of S1 and S2 using rules from L. */ extern int strcoll_l (const char *__s1, const char *__s2, __locale_t __l) __THROW __attribute_pure__ __nonnull ((1, 2, 3)); /* Put a transformation of SRC into no more than N bytes of DEST. */ extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n, __locale_t __l) __THROW __nonnull ((2, 4)); #endif # 172 "/usr/include/string.h" 3 4 #if defined __USE_SVID || defined __USE_BSD || defined __USE_XOPEN_EXTENDED \ || defined __USE_XOPEN2K8 /* Duplicate S, returning an identical malloc'd string. */ extern char *strdup (const char *__s) __THROW __attribute_malloc__ __nonnull ((1)); #endif # 179 "/usr/include/string.h" 3 4 /* Return a malloc'd copy of at most N bytes of STRING. The resultant string is terminated even if no null terminator appears before STRING[N]. */ #if defined __USE_XOPEN2K8 extern char *strndup (const char *__string, size_t __n) __THROW __attribute_malloc__ __nonnull ((1)); #endif # 187 "/usr/include/string.h" 3 4 #if defined __USE_GNU && defined __GNUC__ /* Duplicate S, returning an identical alloca'd string. */ # define strdupa(s) \ (__extension__ \ ({ \ const char *__old = (s); \ size_t __len = strlen (__old) + 1; \ char *__new = (char *) __builtin_alloca (__len); \ (char *) memcpy (__new, __old, __len); \ })) /* Return an alloca'd copy of at most N bytes of string. */ # define strndupa(s, n) \ (__extension__ \ ({ \ const char *__old = (s); \ size_t __len = strnlen (__old, (n)); \ char *__new = (char *) __builtin_alloca (__len + 1); \ __new[__len] = '\0'; \ (char *) memcpy (__new, __old, __len); \ })) #endif # 210 "/usr/include/string.h" 3 4 __BEGIN_NAMESPACE_STD /* Find the first occurrence of C in S. */ #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" { extern char *strchr (char *__s, int __c) __THROW __asm ("strchr") __attribute_pure__ __nonnull ((1)); extern const char *strchr (const char *__s, int __c) __THROW __asm ("strchr") __attribute_pure__ __nonnull ((1)); # ifdef __OPTIMIZE__ __extern_always_inline char * strchr (char *__s, int __c) __THROW { return __builtin_strchr (__s, __c); } __extern_always_inline const char * strchr (const char *__s, int __c) __THROW { return __builtin_strchr (__s, __c); } # endif # 234 "/usr/include/string.h" 3 4 } #else # 236 "/usr/include/string.h" 3 4 extern char *strchr (const char *__s, int __c) __THROW __attribute_pure__ __nonnull ((1)); #endif # 239 "/usr/include/string.h" 3 4 /* Find the last occurrence of C in S. */ #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" { extern char *strrchr (char *__s, int __c) __THROW __asm ("strrchr") __attribute_pure__ __nonnull ((1)); extern const char *strrchr (const char *__s, int __c) __THROW __asm ("strrchr") __attribute_pure__ __nonnull ((1)); # ifdef __OPTIMIZE__ __extern_always_inline char * strrchr (char *__s, int __c) __THROW { return __builtin_strrchr (__s, __c); } __extern_always_inline const char * strrchr (const char *__s, int __c) __THROW { return __builtin_strrchr (__s, __c); } # endif # 261 "/usr/include/string.h" 3 4 } #else # 263 "/usr/include/string.h" 3 4 extern char *strrchr (const char *__s, int __c) __THROW __attribute_pure__ __nonnull ((1)); #endif # 266 "/usr/include/string.h" 3 4 __END_NAMESPACE_STD #ifdef __USE_GNU /* This function is similar to `strchr'. But it returns a pointer to the closing NUL byte in case C is not found in S. */ # ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" char *strchrnul (char *__s, int __c) __THROW __asm ("strchrnul") __attribute_pure__ __nonnull ((1)); extern "C++" const char *strchrnul (const char *__s, int __c) __THROW __asm ("strchrnul") __attribute_pure__ __nonnull ((1)); # else # 277 "/usr/include/string.h" 3 4 extern char *strchrnul (const char *__s, int __c) __THROW __attribute_pure__ __nonnull ((1)); # endif # 280 "/usr/include/string.h" 3 4 #endif # 281 "/usr/include/string.h" 3 4 __BEGIN_NAMESPACE_STD /* Return the length of the initial segment of S which consists entirely of characters not in REJECT. */ extern size_t strcspn (const char *__s, const char *__reject) __THROW __attribute_pure__ __nonnull ((1, 2)); /* Return the length of the initial segment of S which consists entirely of characters in ACCEPT. */ extern size_t strspn (const char *__s, const char *__accept) __THROW __attribute_pure__ __nonnull ((1, 2)); /* Find the first occurrence in S of any character in ACCEPT. */ #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" { extern char *strpbrk (char *__s, const char *__accept) __THROW __asm ("strpbrk") __attribute_pure__ __nonnull ((1, 2)); extern const char *strpbrk (const char *__s, const char *__accept) __THROW __asm ("strpbrk") __attribute_pure__ __nonnull ((1, 2)); # ifdef __OPTIMIZE__ __extern_always_inline char * strpbrk (char *__s, const char *__accept) __THROW { return __builtin_strpbrk (__s, __accept); } __extern_always_inline const char * strpbrk (const char *__s, const char *__accept) __THROW { return __builtin_strpbrk (__s, __accept); } # endif # 313 "/usr/include/string.h" 3 4 } #else # 315 "/usr/include/string.h" 3 4 extern char *strpbrk (const char *__s, const char *__accept) __THROW __attribute_pure__ __nonnull ((1, 2)); #endif # 318 "/usr/include/string.h" 3 4 /* Find the first occurrence of NEEDLE in HAYSTACK. */ #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" { extern char *strstr (char *__haystack, const char *__needle) __THROW __asm ("strstr") __attribute_pure__ __nonnull ((1, 2)); extern const char *strstr (const char *__haystack, const char *__needle) __THROW __asm ("strstr") __attribute_pure__ __nonnull ((1, 2)); # ifdef __OPTIMIZE__ __extern_always_inline char * strstr (char *__haystack, const char *__needle) __THROW { return __builtin_strstr (__haystack, __needle); } __extern_always_inline const char * strstr (const char *__haystack, const char *__needle) __THROW { return __builtin_strstr (__haystack, __needle); } # endif # 340 "/usr/include/string.h" 3 4 } #else # 342 "/usr/include/string.h" 3 4 extern char *strstr (const char *__haystack, const char *__needle) __THROW __attribute_pure__ __nonnull ((1, 2)); #endif # 345 "/usr/include/string.h" 3 4 /* Divide S into tokens separated by characters in DELIM. */ extern char *strtok (char *__restrict __s, const char *__restrict __delim) __THROW __nonnull ((2)); __END_NAMESPACE_STD /* Divide S into tokens separated by characters in DELIM. Information passed between calls are stored in SAVE_PTR. */ extern char *__strtok_r (char *__restrict __s, const char *__restrict __delim, char **__restrict __save_ptr) __THROW __nonnull ((2, 3)); #if defined __USE_POSIX || defined __USE_MISC extern char *strtok_r (char *__restrict __s, const char *__restrict __delim, char **__restrict __save_ptr) __THROW __nonnull ((2, 3)); #endif # 363 "/usr/include/string.h" 3 4 #ifdef __USE_GNU /* Similar to `strstr' but this function ignores the case of both strings. */ # ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" char *strcasestr (char *__haystack, const char *__needle) __THROW __asm ("strcasestr") __attribute_pure__ __nonnull ((1, 2)); extern "C++" const char *strcasestr (const char *__haystack, const char *__needle) __THROW __asm ("strcasestr") __attribute_pure__ __nonnull ((1, 2)); # else # 373 "/usr/include/string.h" 3 4 extern char *strcasestr (const char *__haystack, const char *__needle) __THROW __attribute_pure__ __nonnull ((1, 2)); # endif # 376 "/usr/include/string.h" 3 4 #endif # 377 "/usr/include/string.h" 3 4 #ifdef __USE_GNU /* Find the first occurrence of NEEDLE in HAYSTACK. NEEDLE is NEEDLELEN bytes long; HAYSTACK is HAYSTACKLEN bytes long. */ extern void *memmem (const void *__haystack, size_t __haystacklen, const void *__needle, size_t __needlelen) __THROW __attribute_pure__ __nonnull ((1, 3)); /* Copy N bytes of SRC to DEST, return pointer to bytes after the last written byte. */ extern void *__mempcpy (void *__restrict __dest, const void *__restrict __src, size_t __n) __THROW __nonnull ((1, 2)); extern void *mempcpy (void *__restrict __dest, const void *__restrict __src, size_t __n) __THROW __nonnull ((1, 2)); #endif # 395 "/usr/include/string.h" 3 4 __BEGIN_NAMESPACE_STD /* Return the length of S. */ extern size_t strlen (const char *__s) __THROW __attribute_pure__ __nonnull ((1)); __END_NAMESPACE_STD #ifdef __USE_XOPEN2K8 /* Find the length of STRING, but scan at most MAXLEN characters. If no '\0' terminator is found in that many characters, return MAXLEN. */ extern size_t strnlen (const char *__string, size_t __maxlen) __THROW __attribute_pure__ __nonnull ((1)); #endif # 409 "/usr/include/string.h" 3 4 __BEGIN_NAMESPACE_STD /* Return a string describing the meaning of the `errno' code in ERRNUM. */ extern char *strerror (int __errnum) __THROW; __END_NAMESPACE_STD #if defined __USE_XOPEN2K || defined __USE_MISC /* Reentrant version of `strerror'. There are 2 flavors of `strerror_r', GNU which returns the string and may or may not use the supplied temporary buffer and POSIX one which fills the string into the buffer. To use the POSIX version, -D_XOPEN_SOURCE=600 or -D_POSIX_C_SOURCE=200112L without -D_GNU_SOURCE is needed, otherwise the GNU version is preferred. */ # if defined __USE_XOPEN2K && !defined __USE_GNU /* Fill BUF with a string describing the meaning of the `errno' code in ERRNUM. */ # ifdef __REDIRECT_NTH extern int __REDIRECT_NTH (strerror_r, (int __errnum, char *__buf, size_t __buflen), __xpg_strerror_r) __nonnull ((2)); # else # 431 "/usr/include/string.h" 3 4 extern int __xpg_strerror_r (int __errnum, char *__buf, size_t __buflen) __THROW __nonnull ((2)); # define strerror_r __xpg_strerror_r # endif # 435 "/usr/include/string.h" 3 4 # else # 436 "/usr/include/string.h" 3 4 /* If a temporary buffer is required, at most BUFLEN bytes of BUF will be used. */ extern char *strerror_r (int __errnum, char *__buf, size_t __buflen) __THROW __nonnull ((2)) __wur; # endif # 441 "/usr/include/string.h" 3 4 #endif # 442 "/usr/include/string.h" 3 4 #ifdef __USE_XOPEN2K8 /* Translate error number to string according to the locale L. */ extern char *strerror_l (int __errnum, __locale_t __l) __THROW; #endif # 447 "/usr/include/string.h" 3 4 /* We define this function always since `bzero' is sometimes needed when the namespace rules does not allow this. */ extern void __bzero (void *__s, size_t __n) __THROW __nonnull ((1)); #ifdef __USE_BSD /* Copy N bytes of SRC to DEST (like memmove, but args reversed). */ extern void bcopy (const void *__src, void *__dest, size_t __n) __THROW __nonnull ((1, 2)); /* Set N bytes of S to 0. */ extern void bzero (void *__s, size_t __n) __THROW __nonnull ((1)); /* Compare N bytes of S1 and S2 (same as memcmp). */ extern int bcmp (const void *__s1, const void *__s2, size_t __n) __THROW __attribute_pure__ __nonnull ((1, 2)); /* Find the first occurrence of C in S (same as strchr). */ # ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" { extern char *index (char *__s, int __c) __THROW __asm ("index") __attribute_pure__ __nonnull ((1)); extern const char *index (const char *__s, int __c) __THROW __asm ("index") __attribute_pure__ __nonnull ((1)); # if defined __OPTIMIZE__ && !defined __CORRECT_ISO_CPP_STRINGS_H_PROTO __extern_always_inline char * index (char *__s, int __c) __THROW { return __builtin_index (__s, __c); } __extern_always_inline const char * index (const char *__s, int __c) __THROW { return __builtin_index (__s, __c); } # endif # 487 "/usr/include/string.h" 3 4 } # else # 489 "/usr/include/string.h" 3 4 extern char *index (const char *__s, int __c) __THROW __attribute_pure__ __nonnull ((1)); # endif # 492 "/usr/include/string.h" 3 4 /* Find the last occurrence of C in S (same as strrchr). */ # ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" { extern char *rindex (char *__s, int __c) __THROW __asm ("rindex") __attribute_pure__ __nonnull ((1)); extern const char *rindex (const char *__s, int __c) __THROW __asm ("rindex") __attribute_pure__ __nonnull ((1)); # if defined __OPTIMIZE__ && !defined __CORRECT_ISO_CPP_STRINGS_H_PROTO __extern_always_inline char * rindex (char *__s, int __c) __THROW { return __builtin_rindex (__s, __c); } __extern_always_inline const char * rindex (const char *__s, int __c) __THROW { return __builtin_rindex (__s, __c); } #endif # 515 "/usr/include/string.h" 3 4 } # else # 517 "/usr/include/string.h" 3 4 extern char *rindex (const char *__s, int __c) __THROW __attribute_pure__ __nonnull ((1)); # endif # 520 "/usr/include/string.h" 3 4 /* Return the position of the first bit set in I, or 0 if none are set. The least-significant bit is position 1, the most-significant 32. */ extern int ffs (int __i) __THROW __attribute__ ((__const__)); /* The following two functions are non-standard but necessary for non-32 bit platforms. */ # ifdef __USE_GNU extern int ffsl (long int __l) __THROW __attribute__ ((__const__)); __extension__ extern int ffsll (long long int __ll) __THROW __attribute__ ((__const__)); # endif # 532 "/usr/include/string.h" 3 4 /* Compare S1 and S2, ignoring case. */ extern int strcasecmp (const char *__s1, const char *__s2) __THROW __attribute_pure__ __nonnull ((1, 2)); /* Compare no more than N chars of S1 and S2, ignoring case. */ extern int strncasecmp (const char *__s1, const char *__s2, size_t __n) __THROW __attribute_pure__ __nonnull ((1, 2)); #endif /* Use BSD. */ # 541 "/usr/include/string.h" 3 4 #ifdef __USE_GNU /* Again versions of a few functions which use the given locale instead of the global one. */ extern int strcasecmp_l (const char *__s1, const char *__s2, __locale_t __loc) __THROW __attribute_pure__ __nonnull ((1, 2, 3)); extern int strncasecmp_l (const char *__s1, const char *__s2, size_t __n, __locale_t __loc) __THROW __attribute_pure__ __nonnull ((1, 2, 4)); #endif # 553 "/usr/include/string.h" 3 4 #ifdef __USE_BSD /* Return the next DELIM-delimited token from *STRINGP, terminating it with a '\0', and update *STRINGP to point past it. */ extern char *strsep (char **__restrict __stringp, const char *__restrict __delim) __THROW __nonnull ((1, 2)); #endif # 561 "/usr/include/string.h" 3 4 #ifdef __USE_XOPEN2K8 /* Return a string describing the meaning of the signal number in SIG. */ extern char *strsignal (int __sig) __THROW; /* Copy SRC to DEST, returning the address of the terminating '\0' in DEST. */ extern char *__stpcpy (char *__restrict __dest, const char *__restrict __src) __THROW __nonnull ((1, 2)); extern char *stpcpy (char *__restrict __dest, const char *__restrict __src) __THROW __nonnull ((1, 2)); /* Copy no more than N characters of SRC to DEST, returning the address of the last character written into DEST. */ extern char *__stpncpy (char *__restrict __dest, const char *__restrict __src, size_t __n) __THROW __nonnull ((1, 2)); extern char *stpncpy (char *__restrict __dest, const char *__restrict __src, size_t __n) __THROW __nonnull ((1, 2)); #endif # 581 "/usr/include/string.h" 3 4 #ifdef __USE_GNU /* Compare S1 and S2 as strings holding name & indices/version numbers. */ extern int strverscmp (const char *__s1, const char *__s2) __THROW __attribute_pure__ __nonnull ((1, 2)); /* Sautee STRING briskly. */ extern char *strfry (char *__string) __THROW __nonnull ((1)); /* Frobnicate N bytes of S. */ extern void *memfrob (void *__s, size_t __n) __THROW __nonnull ((1)); # ifndef basename /* Return the file name within directory of FILENAME. We don't declare the function if the `basename' macro is available (defined in ) which makes the XPG version of this function available. */ # ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" char *basename (char *__filename) __THROW __asm ("basename") __nonnull ((1)); extern "C++" const char *basename (const char *__filename) __THROW __asm ("basename") __nonnull ((1)); # else # 604 "/usr/include/string.h" 3 4 extern char *basename (const char *__filename) __THROW __nonnull ((1)); # endif # 606 "/usr/include/string.h" 3 4 # endif # 607 "/usr/include/string.h" 3 4 #endif # 608 "/usr/include/string.h" 3 4 #if defined __GNUC__ && __GNUC__ >= 2 # if defined __OPTIMIZE__ && !defined __OPTIMIZE_SIZE__ \ && !defined __NO_INLINE__ && !defined __cplusplus /* When using GNU CC we provide some optimized versions of selected functions from this header. There are two kinds of optimizations: - machine-dependent optimizations, most probably using inline assembler code; these might be quite expensive since the code size can increase significantly. These optimizations are not used unless the symbol __USE_STRING_INLINES is defined before including this header. - machine-independent optimizations which do not increase the code size significantly and which optimize mainly situations where one or more arguments are compile-time constants. These optimizations are used always when the compiler is taught to optimize. One can inhibit all optimizations by defining __NO_STRING_INLINES. */ /* Get the machine-dependent optimizations (if any). */ #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 632 "/usr/include/string.h" 3 4 # 633 "/usr/include/string.h" 3 4 /* These are generic optimizations which do not add too much inline code. */ #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 635 "/usr/include/string.h" 3 4 # 636 "/usr/include/string.h" 3 4 # endif # 637 "/usr/include/string.h" 3 4 # if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function /* Functions with security checks. */ #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 640 "/usr/include/string.h" 3 4 # 641 "/usr/include/string.h" 3 4 # endif # 642 "/usr/include/string.h" 3 4 #endif # 643 "/usr/include/string.h" 3 4 __END_DECLS #endif /* string.h */ # 647 "/usr/include/string.h" 3 4 # 43 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstring" 2 3 #ifndef _GLIBCXX_CSTRING #define _GLIBCXX_CSTRING 1 // Get rid of those macros defined in in lieu of real functions. #undef memchr #undef memcmp #undef memcpy #undef memmove #undef memset #undef strcat #undef strchr #undef strcmp #undef strcoll #undef strcpy #undef strcspn #undef strerror #undef strlen #undef strncat #undef strncmp #undef strncpy #undef strpbrk #undef strrchr #undef strspn #undef strstr #undef strtok #undef strxfrm namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION using ::memchr; using ::memcmp; using ::memcpy; using ::memmove; using ::memset; using ::strcat; using ::strcmp; using ::strcoll; using ::strcpy; using ::strcspn; using ::strerror; using ::strlen; using ::strncat; using ::strncmp; using ::strncpy; using ::strspn; using ::strtok; using ::strxfrm; using ::strchr; using ::strpbrk; using ::strrchr; using ::strstr; #ifndef __CORRECT_ISO_CPP_STRING_H_PROTO inline void* memchr(void* __s, int __c, size_t __n) { return __builtin_memchr(__s, __c, __n); } inline char* strchr(char* __s, int __n) { return __builtin_strchr(__s, __n); } inline char* strpbrk(char* __s1, const char* __s2) { return __builtin_strpbrk(__s1, __s2); } inline char* strrchr(char* __s, int __n) { return __builtin_strrchr(__s, __n); } inline char* strstr(char* __s1, const char* __s2) { return __builtin_strstr(__s1, __s2); } #endif # 119 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstring" 3 _GLIBCXX_END_NAMESPACE_VERSION } // namespace #endif # 124 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstring" 3 # 10 "./AdjacencyMatrix.cpp" 2 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 10 "./AdjacencyMatrix.cpp" # 1 "/usr/include/assert.h" 1 3 4 /* Copyright (C) 1991-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard: 7.2 Diagnostics */ #ifdef _ASSERT_H # undef _ASSERT_H # undef assert # undef __ASSERT_VOID_CAST # ifdef __USE_GNU # undef assert_perror # endif # 31 "/usr/include/assert.h" 3 4 #endif /* assert.h */ # 33 "/usr/include/assert.h" 3 4 #define _ASSERT_H 1 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 35 "/usr/include/assert.h" 3 4 # 36 "/usr/include/assert.h" 3 4 #if defined __cplusplus && __GNUC_PREREQ (2,95) # define __ASSERT_VOID_CAST static_cast #else # 40 "/usr/include/assert.h" 3 4 # define __ASSERT_VOID_CAST (void) #endif # 42 "/usr/include/assert.h" 3 4 /* void assert (int expression); If NDEBUG is defined, do nothing. If not, and EXPRESSION is zero, print an error message and abort. */ #ifdef NDEBUG # define assert(expr) (__ASSERT_VOID_CAST (0)) /* void assert_perror (int errnum); If NDEBUG is defined, do nothing. If not, and ERRNUM is not zero, print an error message with the error text for ERRNUM and abort. (This is a GNU extension.) */ # ifdef __USE_GNU # define assert_perror(errnum) (__ASSERT_VOID_CAST (0)) # endif # 61 "/usr/include/assert.h" 3 4 #else /* Not NDEBUG. */ # 63 "/usr/include/assert.h" 3 4 #ifndef _ASSERT_H_DECLS #define _ASSERT_H_DECLS __BEGIN_DECLS /* This prints an "Assertion failed" message and aborts. */ extern void __assert_fail (const char *__assertion, const char *__file, unsigned int __line, const char *__function) __THROW __attribute__ ((__noreturn__)); /* Likewise, but prints the error text for ERRNUM. */ extern void __assert_perror_fail (int __errnum, const char *__file, unsigned int __line, const char *__function) __THROW __attribute__ ((__noreturn__)); /* The following is not at all used here but needed for standard compliance. */ extern void __assert (const char *__assertion, const char *__file, int __line) __THROW __attribute__ ((__noreturn__)); __END_DECLS #endif /* Not _ASSERT_H_DECLS */ # 87 "/usr/include/assert.h" 3 4 # define assert(expr) \ ((expr) \ ? __ASSERT_VOID_CAST (0) \ : __assert_fail (__STRING(expr), __FILE__, __LINE__, __ASSERT_FUNCTION)) # ifdef __USE_GNU # define assert_perror(errnum) \ (!(errnum) \ ? __ASSERT_VOID_CAST (0) \ : __assert_perror_fail ((errnum), __FILE__, __LINE__, __ASSERT_FUNCTION)) # endif # 99 "/usr/include/assert.h" 3 4 /* Version 2.4 and later of GCC define a magical variable `__PRETTY_FUNCTION__' which contains the name of the function currently being defined. This is broken in G++ before version 2.6. C9x has a similar variable called __func__, but prefer the GCC one since it demangles C++ function names. */ # if defined __cplusplus ? __GNUC_PREREQ (2, 6) : __GNUC_PREREQ (2, 4) # define __ASSERT_FUNCTION __PRETTY_FUNCTION__ # else # 108 "/usr/include/assert.h" 3 4 # if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L # define __ASSERT_FUNCTION __func__ # else # 111 "/usr/include/assert.h" 3 4 # define __ASSERT_FUNCTION ((const char *) 0) # endif # 113 "/usr/include/assert.h" 3 4 # endif # 114 "/usr/include/assert.h" 3 4 #endif /* NDEBUG. */ # 116 "/usr/include/assert.h" 3 4 #if defined __USE_ISOC11 && !defined __cplusplus /* Static assertion. Requires support in the compiler. */ # undef static_assert # define static_assert _Static_assert #endif # 123 "/usr/include/assert.h" 3 4 # 11 "./AdjacencyMatrix.cpp" 2 #if 0 /* expanded by -frewrite-includes */ #include "Graph.hpp" #endif /* expanded by -frewrite-includes */ # 13 "./AdjacencyMatrix.cpp" # 14 "./AdjacencyMatrix.cpp" class AdjacencyMatrix : public Graph { public: // data members uint64_t n; // num vertices uint32_t* values; vector num_neighbors; // function headings AdjacencyMatrix(uint32_t init_n); ~AdjacencyMatrix(); uint64_t get_size(); uint64_t get_n(); uint32_t find_value(uint32_t src, uint32_t dest); vector sparse_matrix_vector_multiplication(std::vector const &v); void print_graph(); void add_node(); void add_edge(uint32_t src, uint32_t dest, uint32_t value); void add_edge_update(uint32_t src, uint32_t dest, uint32_t value); // vector find_neighbors(uint32_t v); void convert(Graph* g); // convert a graph representation to this graph reprsentation vector pagerank(std::vector const &node_values); vector bfs(uint32_t start_node); vector > get_edges() { printf("get_edges not implemented for AdjacencyMatrix\n"); exit(1); } }; vector AdjacencyMatrix::bfs(uint32_t start_node) { uint64_t n = get_n(); vector out (n, UINT32_MAX); queue next; // qzueue next.push(start_node); out[start_node] = 0; while(next.size() > 0) { uint32_t active = next.front(); next.pop(); assert(out[active] != UINT32_MAX); for(uint32_t i = 0; i < n; i++) { if(find_value(active, i) != 0 && out[i] == UINT32_MAX) { next.push(i); out[i] = out[active] + 1; } } } return out; } vector AdjacencyMatrix::pagerank(std::vector const &node_values) { vector output(n, 0); for(uint32_t i = 0; i < n; i++) { float contrib = (node_values[i] / num_neighbors[i]); for(uint32_t j = 0; j < n; j++) { if(find_value(i, j) != 0) { output[j] += contrib; } } } return output; } uint64_t AdjacencyMatrix::get_n() { return n; } void AdjacencyMatrix::convert(Graph* g) { n = g->get_n(); values = (uint32_t*) realloc(values, n * n * sizeof(uint32_t)); for(uint32_t i = 0; i < n; i ++) { for(uint32_t j = 0; j < n; j++) { // find_value returns 0 if not found. add_edge(i, j, g->find_value(i, j)); } } } uint64_t AdjacencyMatrix::get_size() { return n * n * sizeof(*values) + num_neighbors.capacity()*sizeof(uint32_t); } // find value of (src, dest) uint32_t AdjacencyMatrix::find_value(uint32_t src, uint32_t dest) { return values[src*n + dest]; } void AdjacencyMatrix::add_node() { uint64_t new_size = (n+1) * (n+1); uint32_t* new_graph = (uint32_t*)malloc(sizeof(uint32_t) * new_size); /// printf("n: %d\n", n); // clear the new graph memset(new_graph, 0, sizeof(uint32_t) * new_size); // copy old graph into new graph for(uint32_t i = 0; i < n; i++) { for(uint32_t j = 0; j < n; j++) { new_graph[i * ( n + 1 ) + j] = values[i * n + j]; } } // update graph with new rep if(values != NULL) { free(values); } values = new_graph; n++; num_neighbors.push_back(0); } // src, dest < N void AdjacencyMatrix::add_edge(uint32_t src, uint32_t dest, uint32_t value) { values[src*n + dest] = value; num_neighbors[src]++; } void AdjacencyMatrix::add_edge_update(uint32_t src, uint32_t dest, uint32_t value) { if (values[src*n + dest] == 0) { num_neighbors[src]++; } values[src*n + dest] = value; } void AdjacencyMatrix::print_graph() { for(uint32_t i = 0; i < n; i++) { for(uint32_t j = 0; j < n; j++) { printf("%03d ", values[i*n + j]); } printf("\n"); } } // constructor AdjacencyMatrix::AdjacencyMatrix(uint32_t init_n) { n = (uint64_t) init_n; uint64_t new_size = n * n; //printf("new_size: %lu\n", new_size); values = (uint32_t*)malloc(sizeof(uint32_t) * new_size); assert(values != NULL); memset(values, 0, sizeof(uint32_t) * new_size); for (uint32_t i = 0; i < init_n; i++) { num_neighbors.push_back(0); } } AdjacencyMatrix::~AdjacencyMatrix() { free(values); } /* // find all neighbors of a vertex v std::vector AdjacencyMatrix::find_neighbors(uint32_t v) { std::vector result; for(int i = 0; i < n; i++) { if(values[v*n + i] != 0) { result.push_back(i); } } return result; } */ std::vector AdjacencyMatrix::sparse_matrix_vector_multiplication(std::vector const &v) { std::vector result; for(uint32_t i = 0; i < n; i++) { uint32_t temp = 0; for(uint32_t j = 0; j < n; j++) { temp += values[i*n + j] * v[j]; } result.push_back(temp); } return result; } /* int main() { // graph_t g; // setup(&g); AdjacencyMatrix g = AdjacencyMatrix(5); while (1) { uint32_t src, dest, value; scanf("%d %d %d", &src, &dest, &value); // printf("src:%d, dst: %d, val:%d\n", src, dest, value); g.add_edge(src, dest, value); g.print_graph(); std::vector temp; temp.push_back(10); temp.push_back(1); temp.push_back(0); temp.push_back(0); temp.push_back(10); std::vector res = g.sparse_matrix_vector_multiplication(temp); for(int i = 0; i < 5; i++) { printf("%d ", res[i]); } printf("\n"); } } */ # 14 "test2.cpp" 2 #if 0 /* expanded by -frewrite-includes */ #include "OFM.cpp" #endif /* expanded by -frewrite-includes */ # 14 "test2.cpp" # 1 "./OFM.cpp" 1 #if 0 /* expanded by -frewrite-includes */ #include "Graph.hpp" #endif /* expanded by -frewrite-includes */ # 1 "./OFM.cpp" # 2 "./OFM.cpp" #if 0 /* expanded by -frewrite-includes */ #include "helpers.h" #endif /* expanded by -frewrite-includes */ # 2 "./OFM.cpp" # 1 "./helpers.h" 1 #ifndef HELPERS_H #define HELPERS_H // find index of first 1-bit (least significant bit) static inline int bsf_word(int word) { int result; __asm__ volatile("bsf %1, %0" : "=r"(result) : "r"(word)); return result; } static inline int bsr_word(int word) { int result; __asm__ volatile("bsr %1, %0" : "=r"(result) : "r"(word)); return result; } typedef struct _pair_int { int x; // length in array int y; // depth } pair_int; typedef struct _pair_double { double x; double y; } pair_double; int isPowerOfTwo (int x) { return ((x != 0) && !(x & (x - 1))); } // same as find_leaf, but does it for any level in the tree // index: index in array // len: length of sub-level. int find_node(int index, int len) { return (index/len)*len; } #endif # 41 "./helpers.h" # 3 "./OFM.cpp" 2 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 3 "./OFM.cpp" # 4 "./OFM.cpp" #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 4 "./OFM.cpp" # 1 "/usr/include/assert.h" 1 3 4 /* Copyright (C) 1991-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard: 7.2 Diagnostics */ #ifdef _ASSERT_H # undef _ASSERT_H # undef assert # undef __ASSERT_VOID_CAST # ifdef __USE_GNU # undef assert_perror # endif # 31 "/usr/include/assert.h" 3 4 #endif /* assert.h */ # 33 "/usr/include/assert.h" 3 4 #define _ASSERT_H 1 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 35 "/usr/include/assert.h" 3 4 # 36 "/usr/include/assert.h" 3 4 #if defined __cplusplus && __GNUC_PREREQ (2,95) # define __ASSERT_VOID_CAST static_cast #else # 40 "/usr/include/assert.h" 3 4 # define __ASSERT_VOID_CAST (void) #endif # 42 "/usr/include/assert.h" 3 4 /* void assert (int expression); If NDEBUG is defined, do nothing. If not, and EXPRESSION is zero, print an error message and abort. */ #ifdef NDEBUG # define assert(expr) (__ASSERT_VOID_CAST (0)) /* void assert_perror (int errnum); If NDEBUG is defined, do nothing. If not, and ERRNUM is not zero, print an error message with the error text for ERRNUM and abort. (This is a GNU extension.) */ # ifdef __USE_GNU # define assert_perror(errnum) (__ASSERT_VOID_CAST (0)) # endif # 61 "/usr/include/assert.h" 3 4 #else /* Not NDEBUG. */ # 63 "/usr/include/assert.h" 3 4 #ifndef _ASSERT_H_DECLS #define _ASSERT_H_DECLS __BEGIN_DECLS /* This prints an "Assertion failed" message and aborts. */ extern void __assert_fail (const char *__assertion, const char *__file, unsigned int __line, const char *__function) __THROW __attribute__ ((__noreturn__)); /* Likewise, but prints the error text for ERRNUM. */ extern void __assert_perror_fail (int __errnum, const char *__file, unsigned int __line, const char *__function) __THROW __attribute__ ((__noreturn__)); /* The following is not at all used here but needed for standard compliance. */ extern void __assert (const char *__assertion, const char *__file, int __line) __THROW __attribute__ ((__noreturn__)); __END_DECLS #endif /* Not _ASSERT_H_DECLS */ # 87 "/usr/include/assert.h" 3 4 # define assert(expr) \ ((expr) \ ? __ASSERT_VOID_CAST (0) \ : __assert_fail (__STRING(expr), __FILE__, __LINE__, __ASSERT_FUNCTION)) # ifdef __USE_GNU # define assert_perror(errnum) \ (!(errnum) \ ? __ASSERT_VOID_CAST (0) \ : __assert_perror_fail ((errnum), __FILE__, __LINE__, __ASSERT_FUNCTION)) # endif # 99 "/usr/include/assert.h" 3 4 /* Version 2.4 and later of GCC define a magical variable `__PRETTY_FUNCTION__' which contains the name of the function currently being defined. This is broken in G++ before version 2.6. C9x has a similar variable called __func__, but prefer the GCC one since it demangles C++ function names. */ # if defined __cplusplus ? __GNUC_PREREQ (2, 6) : __GNUC_PREREQ (2, 4) # define __ASSERT_FUNCTION __PRETTY_FUNCTION__ # else # 108 "/usr/include/assert.h" 3 4 # if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L # define __ASSERT_FUNCTION __func__ # else # 111 "/usr/include/assert.h" 3 4 # define __ASSERT_FUNCTION ((const char *) 0) # endif # 113 "/usr/include/assert.h" 3 4 # endif # 114 "/usr/include/assert.h" 3 4 #endif /* NDEBUG. */ # 116 "/usr/include/assert.h" 3 4 #if defined __USE_ISOC11 && !defined __cplusplus /* Static assertion. Requires support in the compiler. */ # undef static_assert # define static_assert _Static_assert #endif # 123 "/usr/include/assert.h" 3 4 # 5 "./OFM.cpp" 2 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 5 "./OFM.cpp" # 6 "./OFM.cpp" #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 6 "./OFM.cpp" # 7 "./OFM.cpp" #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 7 "./OFM.cpp" # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/tuple" 1 3 // -*- C++ -*- // Copyright (C) 2007-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file include/tuple * This is a Standard C++ Library header. */ #ifndef _GLIBCXX_TUPLE #define _GLIBCXX_TUPLE 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 33 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/tuple" 3 #if __cplusplus < 201103L #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 35 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/tuple" 3 # 36 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/tuple" 3 #else # 37 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/tuple" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 38 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/tuple" 3 # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/tuple" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/tuple" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/array" 1 3 // -*- C++ -*- // Copyright (C) 2007-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file include/array * This is a Standard C++ Library header. */ #ifndef _GLIBCXX_ARRAY #define _GLIBCXX_ARRAY 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 33 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/array" 3 #if __cplusplus < 201103L #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 35 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/array" 3 # 36 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/array" 3 #else # 37 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/array" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 38 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/array" 3 # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/array" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/array" 3 # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/array" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/array" 3 # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/array" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_CONTAINER template struct __array_traits { typedef _Tp _Type[_Nm]; static constexpr _Tp& _S_ref(const _Type& __t, std::size_t __n) noexcept { return const_cast<_Tp&>(__t[__n]); } static constexpr _Tp* _S_ptr(const _Type& __t) noexcept { return const_cast<_Tp*>(__t); } }; template struct __array_traits<_Tp, 0> { struct _Type { }; static constexpr _Tp& _S_ref(const _Type&, std::size_t) noexcept { return *static_cast<_Tp*>(nullptr); } static constexpr _Tp* _S_ptr(const _Type&) noexcept { return nullptr; } }; /** * @brief A standard container for storing a fixed size sequence of elements. * * @ingroup sequences * * Meets the requirements of a container, a * reversible container, and a * sequence. * * Sets support random access iterators. * * @tparam Tp Type of element. Required to be a complete type. * @tparam N Number of elements. */ template struct array { typedef _Tp value_type; typedef value_type* pointer; typedef const value_type* const_pointer; typedef value_type& reference; typedef const value_type& const_reference; typedef value_type* iterator; typedef const value_type* const_iterator; typedef std::size_t size_type; typedef std::ptrdiff_t difference_type; typedef std::reverse_iterator reverse_iterator; typedef std::reverse_iterator const_reverse_iterator; // Support for zero-sized arrays mandatory. typedef _GLIBCXX_STD_C::__array_traits<_Tp, _Nm> _AT_Type; typename _AT_Type::_Type _M_elems; // No explicit construct/copy/destroy for aggregate type. // DR 776. void fill(const value_type& __u) { std::fill_n(begin(), size(), __u); } void swap(array& __other) noexcept(noexcept(swap(std::declval<_Tp&>(), std::declval<_Tp&>()))) { std::swap_ranges(begin(), end(), __other.begin()); } // Iterators. iterator begin() noexcept { return iterator(data()); } const_iterator begin() const noexcept { return const_iterator(data()); } iterator end() noexcept { return iterator(data() + _Nm); } const_iterator end() const noexcept { return const_iterator(data() + _Nm); } reverse_iterator rbegin() noexcept { return reverse_iterator(end()); } const_reverse_iterator rbegin() const noexcept { return const_reverse_iterator(end()); } reverse_iterator rend() noexcept { return reverse_iterator(begin()); } const_reverse_iterator rend() const noexcept { return const_reverse_iterator(begin()); } const_iterator cbegin() const noexcept { return const_iterator(data()); } const_iterator cend() const noexcept { return const_iterator(data() + _Nm); } const_reverse_iterator crbegin() const noexcept { return const_reverse_iterator(end()); } const_reverse_iterator crend() const noexcept { return const_reverse_iterator(begin()); } // Capacity. constexpr size_type size() const noexcept { return _Nm; } constexpr size_type max_size() const noexcept { return _Nm; } constexpr bool empty() const noexcept { return size() == 0; } // Element access. reference operator[](size_type __n) noexcept { return _AT_Type::_S_ref(_M_elems, __n); } constexpr const_reference operator[](size_type __n) const noexcept { return _AT_Type::_S_ref(_M_elems, __n); } reference at(size_type __n) { if (__n >= _Nm) std::__throw_out_of_range_fmt(__N("array::at: __n (which is %zu) " ">= _Nm (which is %zu)"), __n, _Nm); return _AT_Type::_S_ref(_M_elems, __n); } constexpr const_reference at(size_type __n) const { // Result of conditional expression must be an lvalue so use // boolean ? lvalue : (throw-expr, lvalue) return __n < _Nm ? _AT_Type::_S_ref(_M_elems, __n) : (std::__throw_out_of_range_fmt(__N("array::at: __n (which is %zu) " ">= _Nm (which is %zu)"), __n, _Nm), _AT_Type::_S_ref(_M_elems, 0)); } reference front() noexcept { return *begin(); } constexpr const_reference front() const noexcept { return _AT_Type::_S_ref(_M_elems, 0); } reference back() noexcept { return _Nm ? *(end() - 1) : *end(); } constexpr const_reference back() const noexcept { return _Nm ? _AT_Type::_S_ref(_M_elems, _Nm - 1) : _AT_Type::_S_ref(_M_elems, 0); } pointer data() noexcept { return _AT_Type::_S_ptr(_M_elems); } const_pointer data() const noexcept { return _AT_Type::_S_ptr(_M_elems); } }; // Array comparisons. template inline bool operator==(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two) { return std::equal(__one.begin(), __one.end(), __two.begin()); } template inline bool operator!=(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two) { return !(__one == __two); } template inline bool operator<(const array<_Tp, _Nm>& __a, const array<_Tp, _Nm>& __b) { return std::lexicographical_compare(__a.begin(), __a.end(), __b.begin(), __b.end()); } template inline bool operator>(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two) { return __two < __one; } template inline bool operator<=(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two) { return !(__one > __two); } template inline bool operator>=(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two) { return !(__one < __two); } // Specialized algorithms. template inline void swap(array<_Tp, _Nm>& __one, array<_Tp, _Nm>& __two) noexcept(noexcept(__one.swap(__two))) { __one.swap(__two); } template constexpr _Tp& get(array<_Tp, _Nm>& __arr) noexcept { static_assert(_Int < _Nm, "index is out of bounds"); return _GLIBCXX_STD_C::__array_traits<_Tp, _Nm>:: _S_ref(__arr._M_elems, _Int); } template constexpr _Tp&& get(array<_Tp, _Nm>&& __arr) noexcept { static_assert(_Int < _Nm, "index is out of bounds"); return std::move(_GLIBCXX_STD_C::get<_Int>(__arr)); } template constexpr const _Tp& get(const array<_Tp, _Nm>& __arr) noexcept { static_assert(_Int < _Nm, "index is out of bounds"); return _GLIBCXX_STD_C::__array_traits<_Tp, _Nm>:: _S_ref(__arr._M_elems, _Int); } _GLIBCXX_END_NAMESPACE_CONTAINER } // namespace std namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION // Tuple interface to class template array. /// tuple_size template class tuple_size; /// Partial specialization for std::array template struct tuple_size<_GLIBCXX_STD_C::array<_Tp, _Nm>> : public integral_constant { }; /// tuple_element template class tuple_element; /// Partial specialization for std::array template struct tuple_element<_Int, _GLIBCXX_STD_C::array<_Tp, _Nm>> { static_assert(_Int < _Nm, "index is out of bounds"); typedef _Tp type; }; _GLIBCXX_END_NAMESPACE_VERSION } // namespace std #ifdef _GLIBCXX_DEBUG #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 338 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/array" 3 # 339 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/array" 3 #endif # 340 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/array" 3 #ifdef _GLIBCXX_PROFILE #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 342 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/array" 3 # 343 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/array" 3 #endif # 344 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/array" 3 #endif // C++11 # 346 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/array" 3 #endif // _GLIBCXX_ARRAY # 348 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/array" 3 # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/tuple" 2 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/tuple" 3 # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/tuple" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION /** * @addtogroup utilities * @{ */ template struct _Head_base; template struct _Head_base<_Idx, _Head, true> : public _Head { constexpr _Head_base() : _Head() { } constexpr _Head_base(const _Head& __h) : _Head(__h) { } constexpr _Head_base(const _Head_base&) = default; constexpr _Head_base(_Head_base&&) = default; template constexpr _Head_base(_UHead&& __h) : _Head(std::forward<_UHead>(__h)) { } _Head_base(allocator_arg_t, __uses_alloc0) : _Head() { } template _Head_base(allocator_arg_t, __uses_alloc1<_Alloc> __a) : _Head(allocator_arg, *__a._M_a) { } template _Head_base(allocator_arg_t, __uses_alloc2<_Alloc> __a) : _Head(*__a._M_a) { } template _Head_base(__uses_alloc0, _UHead&& __uhead) : _Head(std::forward<_UHead>(__uhead)) { } template _Head_base(__uses_alloc1<_Alloc> __a, _UHead&& __uhead) : _Head(allocator_arg, *__a._M_a, std::forward<_UHead>(__uhead)) { } template _Head_base(__uses_alloc2<_Alloc> __a, _UHead&& __uhead) : _Head(std::forward<_UHead>(__uhead), *__a._M_a) { } static constexpr _Head& _M_head(_Head_base& __b) noexcept { return __b; } static constexpr const _Head& _M_head(const _Head_base& __b) noexcept { return __b; } }; template struct _Head_base<_Idx, _Head, false> { constexpr _Head_base() : _M_head_impl() { } constexpr _Head_base(const _Head& __h) : _M_head_impl(__h) { } constexpr _Head_base(const _Head_base&) = default; constexpr _Head_base(_Head_base&&) = default; template constexpr _Head_base(_UHead&& __h) : _M_head_impl(std::forward<_UHead>(__h)) { } _Head_base(allocator_arg_t, __uses_alloc0) : _M_head_impl() { } template _Head_base(allocator_arg_t, __uses_alloc1<_Alloc> __a) : _M_head_impl(allocator_arg, *__a._M_a) { } template _Head_base(allocator_arg_t, __uses_alloc2<_Alloc> __a) : _M_head_impl(*__a._M_a) { } template _Head_base(__uses_alloc0, _UHead&& __uhead) : _M_head_impl(std::forward<_UHead>(__uhead)) { } template _Head_base(__uses_alloc1<_Alloc> __a, _UHead&& __uhead) : _M_head_impl(allocator_arg, *__a._M_a, std::forward<_UHead>(__uhead)) { } template _Head_base(__uses_alloc2<_Alloc> __a, _UHead&& __uhead) : _M_head_impl(std::forward<_UHead>(__uhead), *__a._M_a) { } static constexpr _Head& _M_head(_Head_base& __b) noexcept { return __b._M_head_impl; } static constexpr const _Head& _M_head(const _Head_base& __b) noexcept { return __b._M_head_impl; } _Head _M_head_impl; }; /** * Contains the actual implementation of the @c tuple template, stored * as a recursive inheritance hierarchy from the first element (most * derived class) to the last (least derived class). The @c Idx * parameter gives the 0-based index of the element stored at this * point in the hierarchy; we use it to implement a constant-time * get() operation. */ template struct _Tuple_impl; template struct __is_empty_non_tuple : is_empty<_Tp> { }; // Using EBO for elements that are tuples causes ambiguous base errors. template struct __is_empty_non_tuple> : false_type { }; // Use the Empty Base-class Optimization for empty, non-final types. template using __empty_not_final = typename conditional<__is_final(_Tp), false_type, __is_empty_non_tuple<_Tp>>::type; /** * Recursive tuple implementation. Here we store the @c Head element * and derive from a @c Tuple_impl containing the remaining elements * (which contains the @c Tail). */ template struct _Tuple_impl<_Idx, _Head, _Tail...> : public _Tuple_impl<_Idx + 1, _Tail...>, private _Head_base<_Idx, _Head, __empty_not_final<_Head>::value> { template friend class _Tuple_impl; typedef _Tuple_impl<_Idx + 1, _Tail...> _Inherited; typedef _Head_base<_Idx, _Head, __empty_not_final<_Head>::value> _Base; static constexpr _Head& _M_head(_Tuple_impl& __t) noexcept { return _Base::_M_head(__t); } static constexpr const _Head& _M_head(const _Tuple_impl& __t) noexcept { return _Base::_M_head(__t); } static constexpr _Inherited& _M_tail(_Tuple_impl& __t) noexcept { return __t; } static constexpr const _Inherited& _M_tail(const _Tuple_impl& __t) noexcept { return __t; } constexpr _Tuple_impl() : _Inherited(), _Base() { } explicit constexpr _Tuple_impl(const _Head& __head, const _Tail&... __tail) : _Inherited(__tail...), _Base(__head) { } template::type> explicit constexpr _Tuple_impl(_UHead&& __head, _UTail&&... __tail) : _Inherited(std::forward<_UTail>(__tail)...), _Base(std::forward<_UHead>(__head)) { } constexpr _Tuple_impl(const _Tuple_impl&) = default; constexpr _Tuple_impl(_Tuple_impl&& __in) noexcept(__and_, is_nothrow_move_constructible<_Inherited>>::value) : _Inherited(std::move(_M_tail(__in))), _Base(std::forward<_Head>(_M_head(__in))) { } template constexpr _Tuple_impl(const _Tuple_impl<_Idx, _UElements...>& __in) : _Inherited(_Tuple_impl<_Idx, _UElements...>::_M_tail(__in)), _Base(_Tuple_impl<_Idx, _UElements...>::_M_head(__in)) { } template constexpr _Tuple_impl(_Tuple_impl<_Idx, _UHead, _UTails...>&& __in) : _Inherited(std::move (_Tuple_impl<_Idx, _UHead, _UTails...>::_M_tail(__in))), _Base(std::forward<_UHead> (_Tuple_impl<_Idx, _UHead, _UTails...>::_M_head(__in))) { } template _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a) : _Inherited(__tag, __a), _Base(__tag, __use_alloc<_Head>(__a)) { } template _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a, const _Head& __head, const _Tail&... __tail) : _Inherited(__tag, __a, __tail...), _Base(__use_alloc<_Head, _Alloc, _Head>(__a), __head) { } template::type> _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a, _UHead&& __head, _UTail&&... __tail) : _Inherited(__tag, __a, std::forward<_UTail>(__tail)...), _Base(__use_alloc<_Head, _Alloc, _UHead>(__a), std::forward<_UHead>(__head)) { } template _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a, const _Tuple_impl& __in) : _Inherited(__tag, __a, _M_tail(__in)), _Base(__use_alloc<_Head, _Alloc, _Head>(__a), _M_head(__in)) { } template _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a, _Tuple_impl&& __in) : _Inherited(__tag, __a, std::move(_M_tail(__in))), _Base(__use_alloc<_Head, _Alloc, _Head>(__a), std::forward<_Head>(_M_head(__in))) { } template _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a, const _Tuple_impl<_Idx, _UElements...>& __in) : _Inherited(__tag, __a, _Tuple_impl<_Idx, _UElements...>::_M_tail(__in)), _Base(__use_alloc<_Head, _Alloc, _Head>(__a), _Tuple_impl<_Idx, _UElements...>::_M_head(__in)) { } template _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a, _Tuple_impl<_Idx, _UHead, _UTails...>&& __in) : _Inherited(__tag, __a, std::move (_Tuple_impl<_Idx, _UHead, _UTails...>::_M_tail(__in))), _Base(__use_alloc<_Head, _Alloc, _UHead>(__a), std::forward<_UHead> (_Tuple_impl<_Idx, _UHead, _UTails...>::_M_head(__in))) { } _Tuple_impl& operator=(const _Tuple_impl& __in) { _M_head(*this) = _M_head(__in); _M_tail(*this) = _M_tail(__in); return *this; } _Tuple_impl& operator=(_Tuple_impl&& __in) noexcept(__and_, is_nothrow_move_assignable<_Inherited>>::value) { _M_head(*this) = std::forward<_Head>(_M_head(__in)); _M_tail(*this) = std::move(_M_tail(__in)); return *this; } template _Tuple_impl& operator=(const _Tuple_impl<_Idx, _UElements...>& __in) { _M_head(*this) = _Tuple_impl<_Idx, _UElements...>::_M_head(__in); _M_tail(*this) = _Tuple_impl<_Idx, _UElements...>::_M_tail(__in); return *this; } template _Tuple_impl& operator=(_Tuple_impl<_Idx, _UHead, _UTails...>&& __in) { _M_head(*this) = std::forward<_UHead> (_Tuple_impl<_Idx, _UHead, _UTails...>::_M_head(__in)); _M_tail(*this) = std::move (_Tuple_impl<_Idx, _UHead, _UTails...>::_M_tail(__in)); return *this; } protected: void _M_swap(_Tuple_impl& __in) noexcept(noexcept(swap(std::declval<_Head&>(), std::declval<_Head&>())) && noexcept(_M_tail(__in)._M_swap(_M_tail(__in)))) { using std::swap; swap(_M_head(*this), _M_head(__in)); _Inherited::_M_swap(_M_tail(__in)); } }; // Basis case of inheritance recursion. template struct _Tuple_impl<_Idx, _Head> : private _Head_base<_Idx, _Head, __empty_not_final<_Head>::value> { template friend class _Tuple_impl; typedef _Head_base<_Idx, _Head, __empty_not_final<_Head>::value> _Base; static constexpr _Head& _M_head(_Tuple_impl& __t) noexcept { return _Base::_M_head(__t); } static constexpr const _Head& _M_head(const _Tuple_impl& __t) noexcept { return _Base::_M_head(__t); } constexpr _Tuple_impl() : _Base() { } explicit constexpr _Tuple_impl(const _Head& __head) : _Base(__head) { } template explicit constexpr _Tuple_impl(_UHead&& __head) : _Base(std::forward<_UHead>(__head)) { } constexpr _Tuple_impl(const _Tuple_impl&) = default; constexpr _Tuple_impl(_Tuple_impl&& __in) noexcept(is_nothrow_move_constructible<_Head>::value) : _Base(std::forward<_Head>(_M_head(__in))) { } template constexpr _Tuple_impl(const _Tuple_impl<_Idx, _UHead>& __in) : _Base(_Tuple_impl<_Idx, _UHead>::_M_head(__in)) { } template constexpr _Tuple_impl(_Tuple_impl<_Idx, _UHead>&& __in) : _Base(std::forward<_UHead>(_Tuple_impl<_Idx, _UHead>::_M_head(__in))) { } template _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a) : _Base(__tag, __use_alloc<_Head>(__a)) { } template _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a, const _Head& __head) : _Base(__use_alloc<_Head, _Alloc, _Head>(__a), __head) { } template _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a, _UHead&& __head) : _Base(__use_alloc<_Head, _Alloc, _UHead>(__a), std::forward<_UHead>(__head)) { } template _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a, const _Tuple_impl& __in) : _Base(__use_alloc<_Head, _Alloc, _Head>(__a), _M_head(__in)) { } template _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a, _Tuple_impl&& __in) : _Base(__use_alloc<_Head, _Alloc, _Head>(__a), std::forward<_Head>(_M_head(__in))) { } template _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a, const _Tuple_impl<_Idx, _UHead>& __in) : _Base(__use_alloc<_Head, _Alloc, _Head>(__a), _Tuple_impl<_Idx, _UHead>::_M_head(__in)) { } template _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a, _Tuple_impl<_Idx, _UHead>&& __in) : _Base(__use_alloc<_Head, _Alloc, _UHead>(__a), std::forward<_UHead>(_Tuple_impl<_Idx, _UHead>::_M_head(__in))) { } _Tuple_impl& operator=(const _Tuple_impl& __in) { _M_head(*this) = _M_head(__in); return *this; } _Tuple_impl& operator=(_Tuple_impl&& __in) noexcept(is_nothrow_move_assignable<_Head>::value) { _M_head(*this) = std::forward<_Head>(_M_head(__in)); return *this; } template _Tuple_impl& operator=(const _Tuple_impl<_Idx, _UHead>& __in) { _M_head(*this) = _Tuple_impl<_Idx, _UHead>::_M_head(__in); return *this; } template _Tuple_impl& operator=(_Tuple_impl<_Idx, _UHead>&& __in) { _M_head(*this) = std::forward<_UHead>(_Tuple_impl<_Idx, _UHead>::_M_head(__in)); return *this; } protected: void _M_swap(_Tuple_impl& __in) noexcept(noexcept(swap(std::declval<_Head&>(), std::declval<_Head&>()))) { using std::swap; swap(_M_head(*this), _M_head(__in)); } }; /// Primary class template, tuple template class tuple : public _Tuple_impl<0, _Elements...> { typedef _Tuple_impl<0, _Elements...> _Inherited; public: constexpr tuple() : _Inherited() { } explicit constexpr tuple(const _Elements&... __elements) : _Inherited(__elements...) { } template...>::value>::type> explicit constexpr tuple(_UElements&&... __elements) : _Inherited(std::forward<_UElements>(__elements)...) { } constexpr tuple(const tuple&) = default; constexpr tuple(tuple&&) = default; template...>::value>::type> constexpr tuple(const tuple<_UElements...>& __in) : _Inherited(static_cast&>(__in)) { } template...>::value>::type> constexpr tuple(tuple<_UElements...>&& __in) : _Inherited(static_cast<_Tuple_impl<0, _UElements...>&&>(__in)) { } // Allocator-extended constructors. template tuple(allocator_arg_t __tag, const _Alloc& __a) : _Inherited(__tag, __a) { } template tuple(allocator_arg_t __tag, const _Alloc& __a, const _Elements&... __elements) : _Inherited(__tag, __a, __elements...) { } template::type> tuple(allocator_arg_t __tag, const _Alloc& __a, _UElements&&... __elements) : _Inherited(__tag, __a, std::forward<_UElements>(__elements)...) { } template tuple(allocator_arg_t __tag, const _Alloc& __a, const tuple& __in) : _Inherited(__tag, __a, static_cast(__in)) { } template tuple(allocator_arg_t __tag, const _Alloc& __a, tuple&& __in) : _Inherited(__tag, __a, static_cast<_Inherited&&>(__in)) { } template::type> tuple(allocator_arg_t __tag, const _Alloc& __a, const tuple<_UElements...>& __in) : _Inherited(__tag, __a, static_cast&>(__in)) { } template::type> tuple(allocator_arg_t __tag, const _Alloc& __a, tuple<_UElements...>&& __in) : _Inherited(__tag, __a, static_cast<_Tuple_impl<0, _UElements...>&&>(__in)) { } tuple& operator=(const tuple& __in) { static_cast<_Inherited&>(*this) = __in; return *this; } tuple& operator=(tuple&& __in) noexcept(is_nothrow_move_assignable<_Inherited>::value) { static_cast<_Inherited&>(*this) = std::move(__in); return *this; } template::type> tuple& operator=(const tuple<_UElements...>& __in) { static_cast<_Inherited&>(*this) = __in; return *this; } template::type> tuple& operator=(tuple<_UElements...>&& __in) { static_cast<_Inherited&>(*this) = std::move(__in); return *this; } void swap(tuple& __in) noexcept(noexcept(__in._M_swap(__in))) { _Inherited::_M_swap(__in); } }; // Explicit specialization, zero-element tuple. template<> class tuple<> { public: void swap(tuple&) noexcept { /* no-op */ } }; /// Partial specialization, 2-element tuple. /// Includes construction and assignment from a pair. template class tuple<_T1, _T2> : public _Tuple_impl<0, _T1, _T2> { typedef _Tuple_impl<0, _T1, _T2> _Inherited; public: constexpr tuple() : _Inherited() { } explicit constexpr tuple(const _T1& __a1, const _T2& __a2) : _Inherited(__a1, __a2) { } template, is_convertible<_U2, _T2>>::value>::type> explicit constexpr tuple(_U1&& __a1, _U2&& __a2) : _Inherited(std::forward<_U1>(__a1), std::forward<_U2>(__a2)) { } constexpr tuple(const tuple&) = default; constexpr tuple(tuple&&) = default; template, is_convertible>::value>::type> constexpr tuple(const tuple<_U1, _U2>& __in) : _Inherited(static_cast&>(__in)) { } template, is_convertible<_U2, _T2>>::value>::type> constexpr tuple(tuple<_U1, _U2>&& __in) : _Inherited(static_cast<_Tuple_impl<0, _U1, _U2>&&>(__in)) { } template, is_convertible>::value>::type> constexpr tuple(const pair<_U1, _U2>& __in) : _Inherited(__in.first, __in.second) { } template, is_convertible<_U2, _T2>>::value>::type> constexpr tuple(pair<_U1, _U2>&& __in) : _Inherited(std::forward<_U1>(__in.first), std::forward<_U2>(__in.second)) { } // Allocator-extended constructors. template tuple(allocator_arg_t __tag, const _Alloc& __a) : _Inherited(__tag, __a) { } template tuple(allocator_arg_t __tag, const _Alloc& __a, const _T1& __a1, const _T2& __a2) : _Inherited(__tag, __a, __a1, __a2) { } template tuple(allocator_arg_t __tag, const _Alloc& __a, _U1&& __a1, _U2&& __a2) : _Inherited(__tag, __a, std::forward<_U1>(__a1), std::forward<_U2>(__a2)) { } template tuple(allocator_arg_t __tag, const _Alloc& __a, const tuple& __in) : _Inherited(__tag, __a, static_cast(__in)) { } template tuple(allocator_arg_t __tag, const _Alloc& __a, tuple&& __in) : _Inherited(__tag, __a, static_cast<_Inherited&&>(__in)) { } template tuple(allocator_arg_t __tag, const _Alloc& __a, const tuple<_U1, _U2>& __in) : _Inherited(__tag, __a, static_cast&>(__in)) { } template tuple(allocator_arg_t __tag, const _Alloc& __a, tuple<_U1, _U2>&& __in) : _Inherited(__tag, __a, static_cast<_Tuple_impl<0, _U1, _U2>&&>(__in)) { } template tuple(allocator_arg_t __tag, const _Alloc& __a, const pair<_U1, _U2>& __in) : _Inherited(__tag, __a, __in.first, __in.second) { } template tuple(allocator_arg_t __tag, const _Alloc& __a, pair<_U1, _U2>&& __in) : _Inherited(__tag, __a, std::forward<_U1>(__in.first), std::forward<_U2>(__in.second)) { } tuple& operator=(const tuple& __in) { static_cast<_Inherited&>(*this) = __in; return *this; } tuple& operator=(tuple&& __in) noexcept(is_nothrow_move_assignable<_Inherited>::value) { static_cast<_Inherited&>(*this) = std::move(__in); return *this; } template tuple& operator=(const tuple<_U1, _U2>& __in) { static_cast<_Inherited&>(*this) = __in; return *this; } template tuple& operator=(tuple<_U1, _U2>&& __in) { static_cast<_Inherited&>(*this) = std::move(__in); return *this; } template tuple& operator=(const pair<_U1, _U2>& __in) { this->_M_head(*this) = __in.first; this->_M_tail(*this)._M_head(*this) = __in.second; return *this; } template tuple& operator=(pair<_U1, _U2>&& __in) { this->_M_head(*this) = std::forward<_U1>(__in.first); this->_M_tail(*this)._M_head(*this) = std::forward<_U2>(__in.second); return *this; } void swap(tuple& __in) noexcept(noexcept(__in._M_swap(__in))) { _Inherited::_M_swap(__in); } }; /// Gives the type of the ith element of a given tuple type. template struct tuple_element; /** * Recursive case for tuple_element: strip off the first element in * the tuple and retrieve the (i-1)th element of the remaining tuple. */ template struct tuple_element<__i, tuple<_Head, _Tail...> > : tuple_element<__i - 1, tuple<_Tail...> > { }; /** * Basis case for tuple_element: The first element is the one we're seeking. */ template struct tuple_element<0, tuple<_Head, _Tail...> > { typedef _Head type; }; // Duplicate of C++14's tuple_element_t for internal use in C++11 mode template using __tuple_element_t = typename tuple_element<__i, _Tp>::type; template struct tuple_element<__i, const _Tp> { typedef typename add_const<__tuple_element_t<__i, _Tp>>::type type; }; template struct tuple_element<__i, volatile _Tp> { typedef typename add_volatile<__tuple_element_t<__i, _Tp>>::type type; }; template struct tuple_element<__i, const volatile _Tp> { typedef typename add_cv<__tuple_element_t<__i, _Tp>>::type type; }; #if __cplusplus > 201103L #define __cpp_lib_tuple_element_t 201402 template using tuple_element_t = typename tuple_element<__i, _Tp>::type; #endif # 795 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/tuple" 3 /// Finds the size of a given tuple type. template struct tuple_size; // _GLIBCXX_RESOLVE_LIB_DEFECTS // 2313. tuple_size should always derive from integral_constant template struct tuple_size : integral_constant::value> { }; template struct tuple_size : integral_constant::value> { }; template struct tuple_size : integral_constant::value> { }; /// class tuple_size template struct tuple_size> : public integral_constant { }; template constexpr _Head& __get_helper(_Tuple_impl<__i, _Head, _Tail...>& __t) noexcept { return _Tuple_impl<__i, _Head, _Tail...>::_M_head(__t); } template constexpr const _Head& __get_helper(const _Tuple_impl<__i, _Head, _Tail...>& __t) noexcept { return _Tuple_impl<__i, _Head, _Tail...>::_M_head(__t); } /// Return a reference to the ith element of a tuple. template constexpr __tuple_element_t<__i, tuple<_Elements...>>& get(tuple<_Elements...>& __t) noexcept { return std::__get_helper<__i>(__t); } /// Return a const reference to the ith element of a const tuple. template constexpr const __tuple_element_t<__i, tuple<_Elements...>>& get(const tuple<_Elements...>& __t) noexcept { return std::__get_helper<__i>(__t); } /// Return an rvalue reference to the ith element of a tuple rvalue. template constexpr __tuple_element_t<__i, tuple<_Elements...>>&& get(tuple<_Elements...>&& __t) noexcept { typedef __tuple_element_t<__i, tuple<_Elements...>> __element_type; return std::forward<__element_type&&>(std::get<__i>(__t)); } #if __cplusplus > 201103L #define __cpp_lib_tuples_by_type 201304 template constexpr _Head& __get_helper2(_Tuple_impl<__i, _Head, _Tail...>& __t) noexcept { return _Tuple_impl<__i, _Head, _Tail...>::_M_head(__t); } template constexpr const _Head& __get_helper2(const _Tuple_impl<__i, _Head, _Tail...>& __t) noexcept { return _Tuple_impl<__i, _Head, _Tail...>::_M_head(__t); } /// Return a reference to the unique element of type _Tp of a tuple. template constexpr _Tp& get(tuple<_Types...>& __t) noexcept { return std::__get_helper2<_Tp>(__t); } /// Return a reference to the unique element of type _Tp of a tuple rvalue. template constexpr _Tp&& get(tuple<_Types...>&& __t) noexcept { return std::forward<_Tp&&>(std::__get_helper2<_Tp>(__t)); } /// Return a const reference to the unique element of type _Tp of a tuple. template constexpr const _Tp& get(const tuple<_Types...>& __t) noexcept { return std::__get_helper2<_Tp>(__t); } #endif # 882 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/tuple" 3 // This class performs the comparison operations on tuples template struct __tuple_compare { static constexpr bool __eq(const _Tp& __t, const _Up& __u) { return bool(std::get<__i>(__t) == std::get<__i>(__u)) && __tuple_compare<_Tp, _Up, __i + 1, __size>::__eq(__t, __u); } static constexpr bool __less(const _Tp& __t, const _Up& __u) { return bool(std::get<__i>(__t) < std::get<__i>(__u)) || (!bool(std::get<__i>(__u) < std::get<__i>(__t)) && __tuple_compare<_Tp, _Up, __i + 1, __size>::__less(__t, __u)); } }; template struct __tuple_compare<_Tp, _Up, __size, __size> { static constexpr bool __eq(const _Tp&, const _Up&) { return true; } static constexpr bool __less(const _Tp&, const _Up&) { return false; } }; template constexpr bool operator==(const tuple<_TElements...>& __t, const tuple<_UElements...>& __u) { static_assert(sizeof...(_TElements) == sizeof...(_UElements), "tuple objects can only be compared if they have equal sizes."); using __compare = __tuple_compare, tuple<_UElements...>, 0, sizeof...(_TElements)>; return __compare::__eq(__t, __u); } template constexpr bool operator<(const tuple<_TElements...>& __t, const tuple<_UElements...>& __u) { static_assert(sizeof...(_TElements) == sizeof...(_UElements), "tuple objects can only be compared if they have equal sizes."); using __compare = __tuple_compare, tuple<_UElements...>, 0, sizeof...(_TElements)>; return __compare::__less(__t, __u); } template constexpr bool operator!=(const tuple<_TElements...>& __t, const tuple<_UElements...>& __u) { return !(__t == __u); } template constexpr bool operator>(const tuple<_TElements...>& __t, const tuple<_UElements...>& __u) { return __u < __t; } template constexpr bool operator<=(const tuple<_TElements...>& __t, const tuple<_UElements...>& __u) { return !(__u < __t); } template constexpr bool operator>=(const tuple<_TElements...>& __t, const tuple<_UElements...>& __u) { return !(__t < __u); } // NB: DR 705. template constexpr tuple::__type...> make_tuple(_Elements&&... __args) { typedef tuple::__type...> __result_type; return __result_type(std::forward<_Elements>(__args)...); } template tuple<_Elements&&...> forward_as_tuple(_Elements&&... __args) noexcept { return tuple<_Elements&&...>(std::forward<_Elements>(__args)...); } template struct __is_tuple_like_impl : false_type { }; template struct __is_tuple_like_impl> : true_type { }; template struct __is_tuple_like_impl> : true_type { }; template struct __is_tuple_like_impl> : true_type { }; // Internal type trait that allows us to sfinae-protect tuple_cat. template struct __is_tuple_like : public __is_tuple_like_impl::type>::type>::type { }; template struct __make_tuple_impl; template struct __make_tuple_impl<_Idx, tuple<_Tp...>, _Tuple, _Nm> : __make_tuple_impl<_Idx + 1, tuple<_Tp..., __tuple_element_t<_Idx, _Tuple>>, _Tuple, _Nm> { }; template struct __make_tuple_impl<_Nm, tuple<_Tp...>, _Tuple, _Nm> { typedef tuple<_Tp...> __type; }; template struct __do_make_tuple : __make_tuple_impl<0, tuple<>, _Tuple, std::tuple_size<_Tuple>::value> { }; // Returns the std::tuple equivalent of a tuple-like type. template struct __make_tuple : public __do_make_tuple::type>::type> { }; // Combines several std::tuple's into a single one. template struct __combine_tuples; template<> struct __combine_tuples<> { typedef tuple<> __type; }; template struct __combine_tuples> { typedef tuple<_Ts...> __type; }; template struct __combine_tuples, tuple<_T2s...>, _Rem...> { typedef typename __combine_tuples, _Rem...>::__type __type; }; // Computes the result type of tuple_cat given a set of tuple-like types. template struct __tuple_cat_result { typedef typename __combine_tuples ::__type...>::__type __type; }; // Helper to determine the index set for the first tuple-like // type of a given set. template struct __make_1st_indices; template<> struct __make_1st_indices<> { typedef std::_Index_tuple<> __type; }; template struct __make_1st_indices<_Tp, _Tpls...> { typedef typename std::_Build_index_tuple::type>::value>::__type __type; }; // Performs the actual concatenation by step-wise expanding tuple-like // objects into the elements, which are finally forwarded into the // result tuple. template struct __tuple_concater; template struct __tuple_concater<_Ret, std::_Index_tuple<_Is...>, _Tp, _Tpls...> { template static constexpr _Ret _S_do(_Tp&& __tp, _Tpls&&... __tps, _Us&&... __us) { typedef typename __make_1st_indices<_Tpls...>::__type __idx; typedef __tuple_concater<_Ret, __idx, _Tpls...> __next; return __next::_S_do(std::forward<_Tpls>(__tps)..., std::forward<_Us>(__us)..., std::get<_Is>(std::forward<_Tp>(__tp))...); } }; template struct __tuple_concater<_Ret, std::_Index_tuple<>> { template static constexpr _Ret _S_do(_Us&&... __us) { return _Ret(std::forward<_Us>(__us)...); } }; /// tuple_cat template...>::value>::type> constexpr auto tuple_cat(_Tpls&&... __tpls) -> typename __tuple_cat_result<_Tpls...>::__type { typedef typename __tuple_cat_result<_Tpls...>::__type __ret; typedef typename __make_1st_indices<_Tpls...>::__type __idx; typedef __tuple_concater<__ret, __idx, _Tpls...> __concater; return __concater::_S_do(std::forward<_Tpls>(__tpls)...); } /// tie template inline tuple<_Elements&...> tie(_Elements&... __args) noexcept { return tuple<_Elements&...>(__args...); } /// swap template inline void swap(tuple<_Elements...>& __x, tuple<_Elements...>& __y) noexcept(noexcept(__x.swap(__y))) { __x.swap(__y); } // A class (and instance) which can be used in 'tie' when an element // of a tuple is not required struct _Swallow_assign { template const _Swallow_assign& operator=(const _Tp&) const { return *this; } }; const _Swallow_assign ignore{}; /// Partial specialization for tuples template struct uses_allocator, _Alloc> : true_type { }; // See stl_pair.h... template template inline pair<_T1, _T2>:: pair(piecewise_construct_t, tuple<_Args1...> __first, tuple<_Args2...> __second) : pair(__first, __second, typename _Build_index_tuple::__type(), typename _Build_index_tuple::__type()) { } template template inline pair<_T1, _T2>:: pair(tuple<_Args1...>& __tuple1, tuple<_Args2...>& __tuple2, _Index_tuple<_Indexes1...>, _Index_tuple<_Indexes2...>) : first(std::forward<_Args1>(std::get<_Indexes1>(__tuple1))...), second(std::forward<_Args2>(std::get<_Indexes2>(__tuple2))...) { } /// @} _GLIBCXX_END_NAMESPACE_VERSION } // namespace std #endif // C++11 # 1181 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/tuple" 3 #endif // _GLIBCXX_TUPLE # 1183 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/tuple" 3 # 8 "./OFM.cpp" 2 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 8 "./OFM.cpp" # 9 "./OFM.cpp" #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 9 "./OFM.cpp" # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/fstream" 1 3 // File based streams -*- C++ -*- // Copyright (C) 1997-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file include/fstream * This is a Standard C++ Library header. */ // // ISO C++ 14882: 27.8 File-based streams // #ifndef _GLIBCXX_FSTREAM #define _GLIBCXX_FSTREAM 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 37 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/fstream" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 38 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/fstream" 3 # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/fstream" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/fstream" 3 # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/fstream" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/fstream" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/codecvt.h" 1 3 // Locale support (codecvt) -*- C++ -*- // Copyright (C) 2000-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file bits/codecvt.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{locale} */ // // ISO C++ 14882: 22.2.1.5 Template class codecvt // // Written by Benjamin Kosnik #ifndef _CODECVT_H #define _CODECVT_H 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/codecvt.h" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION /// Empty base class for codecvt facet [22.2.1.5]. class codecvt_base { public: enum result { ok, partial, error, noconv }; }; /** * @brief Common base for codecvt functions. * * This template class provides implementations of the public functions * that forward to the protected virtual functions. * * This template also provides abstract stubs for the protected virtual * functions. */ template class __codecvt_abstract_base : public locale::facet, public codecvt_base { public: // Types: typedef codecvt_base::result result; typedef _InternT intern_type; typedef _ExternT extern_type; typedef _StateT state_type; // 22.2.1.5.1 codecvt members /** * @brief Convert from internal to external character set. * * Converts input string of intern_type to output string of * extern_type. This is analogous to wcsrtombs. It does this by * calling codecvt::do_out. * * The source and destination character sets are determined by the * facet's locale, internal and external types. * * The characters in [from,from_end) are converted and written to * [to,to_end). from_next and to_next are set to point to the * character following the last successfully converted character, * respectively. If the result needed no conversion, from_next and * to_next are not affected. * * The @a state argument should be initialized if the input is at the * beginning and carried from a previous call if continuing * conversion. There are no guarantees about how @a state is used. * * The result returned is a member of codecvt_base::result. If * all the input is converted, returns codecvt_base::ok. If no * conversion is necessary, returns codecvt_base::noconv. If * the input ends early or there is insufficient space in the * output, returns codecvt_base::partial. Otherwise the * conversion failed and codecvt_base::error is returned. * * @param __state Persistent conversion state data. * @param __from Start of input. * @param __from_end End of input. * @param __from_next Returns start of unconverted data. * @param __to Start of output buffer. * @param __to_end End of output buffer. * @param __to_next Returns start of unused output area. * @return codecvt_base::result. */ result out(state_type& __state, const intern_type* __from, const intern_type* __from_end, const intern_type*& __from_next, extern_type* __to, extern_type* __to_end, extern_type*& __to_next) const { return this->do_out(__state, __from, __from_end, __from_next, __to, __to_end, __to_next); } /** * @brief Reset conversion state. * * Writes characters to output that would restore @a state to initial * conditions. The idea is that if a partial conversion occurs, then * the converting the characters written by this function would leave * the state in initial conditions, rather than partial conversion * state. It does this by calling codecvt::do_unshift(). * * For example, if 4 external characters always converted to 1 internal * character, and input to in() had 6 external characters with state * saved, this function would write two characters to the output and * set the state to initialized conditions. * * The source and destination character sets are determined by the * facet's locale, internal and external types. * * The result returned is a member of codecvt_base::result. If the * state could be reset and data written, returns codecvt_base::ok. If * no conversion is necessary, returns codecvt_base::noconv. If the * output has insufficient space, returns codecvt_base::partial. * Otherwise the reset failed and codecvt_base::error is returned. * * @param __state Persistent conversion state data. * @param __to Start of output buffer. * @param __to_end End of output buffer. * @param __to_next Returns start of unused output area. * @return codecvt_base::result. */ result unshift(state_type& __state, extern_type* __to, extern_type* __to_end, extern_type*& __to_next) const { return this->do_unshift(__state, __to,__to_end,__to_next); } /** * @brief Convert from external to internal character set. * * Converts input string of extern_type to output string of * intern_type. This is analogous to mbsrtowcs. It does this by * calling codecvt::do_in. * * The source and destination character sets are determined by the * facet's locale, internal and external types. * * The characters in [from,from_end) are converted and written to * [to,to_end). from_next and to_next are set to point to the * character following the last successfully converted character, * respectively. If the result needed no conversion, from_next and * to_next are not affected. * * The @a state argument should be initialized if the input is at the * beginning and carried from a previous call if continuing * conversion. There are no guarantees about how @a state is used. * * The result returned is a member of codecvt_base::result. If * all the input is converted, returns codecvt_base::ok. If no * conversion is necessary, returns codecvt_base::noconv. If * the input ends early or there is insufficient space in the * output, returns codecvt_base::partial. Otherwise the * conversion failed and codecvt_base::error is returned. * * @param __state Persistent conversion state data. * @param __from Start of input. * @param __from_end End of input. * @param __from_next Returns start of unconverted data. * @param __to Start of output buffer. * @param __to_end End of output buffer. * @param __to_next Returns start of unused output area. * @return codecvt_base::result. */ result in(state_type& __state, const extern_type* __from, const extern_type* __from_end, const extern_type*& __from_next, intern_type* __to, intern_type* __to_end, intern_type*& __to_next) const { return this->do_in(__state, __from, __from_end, __from_next, __to, __to_end, __to_next); } int encoding() const throw() { return this->do_encoding(); } bool always_noconv() const throw() { return this->do_always_noconv(); } int length(state_type& __state, const extern_type* __from, const extern_type* __end, size_t __max) const { return this->do_length(__state, __from, __end, __max); } int max_length() const throw() { return this->do_max_length(); } protected: explicit __codecvt_abstract_base(size_t __refs = 0) : locale::facet(__refs) { } virtual ~__codecvt_abstract_base() { } /** * @brief Convert from internal to external character set. * * Converts input string of intern_type to output string of * extern_type. This function is a hook for derived classes to change * the value returned. @see out for more information. */ virtual result do_out(state_type& __state, const intern_type* __from, const intern_type* __from_end, const intern_type*& __from_next, extern_type* __to, extern_type* __to_end, extern_type*& __to_next) const = 0; virtual result do_unshift(state_type& __state, extern_type* __to, extern_type* __to_end, extern_type*& __to_next) const = 0; virtual result do_in(state_type& __state, const extern_type* __from, const extern_type* __from_end, const extern_type*& __from_next, intern_type* __to, intern_type* __to_end, intern_type*& __to_next) const = 0; virtual int do_encoding() const throw() = 0; virtual bool do_always_noconv() const throw() = 0; virtual int do_length(state_type&, const extern_type* __from, const extern_type* __end, size_t __max) const = 0; virtual int do_max_length() const throw() = 0; }; /** * @brief Primary class template codecvt. * @ingroup locales * * NB: Generic, mostly useless implementation. * */ template class codecvt : public __codecvt_abstract_base<_InternT, _ExternT, _StateT> { public: // Types: typedef codecvt_base::result result; typedef _InternT intern_type; typedef _ExternT extern_type; typedef _StateT state_type; protected: __c_locale _M_c_locale_codecvt; public: static locale::id id; explicit codecvt(size_t __refs = 0) : __codecvt_abstract_base<_InternT, _ExternT, _StateT> (__refs), _M_c_locale_codecvt(0) { } explicit codecvt(__c_locale __cloc, size_t __refs = 0); protected: virtual ~codecvt() { } virtual result do_out(state_type& __state, const intern_type* __from, const intern_type* __from_end, const intern_type*& __from_next, extern_type* __to, extern_type* __to_end, extern_type*& __to_next) const; virtual result do_unshift(state_type& __state, extern_type* __to, extern_type* __to_end, extern_type*& __to_next) const; virtual result do_in(state_type& __state, const extern_type* __from, const extern_type* __from_end, const extern_type*& __from_next, intern_type* __to, intern_type* __to_end, intern_type*& __to_next) const; virtual int do_encoding() const throw(); virtual bool do_always_noconv() const throw(); virtual int do_length(state_type&, const extern_type* __from, const extern_type* __end, size_t __max) const; virtual int do_max_length() const throw(); }; template locale::id codecvt<_InternT, _ExternT, _StateT>::id; /// class codecvt specialization. template<> class codecvt : public __codecvt_abstract_base { friend class messages; public: // Types: typedef char intern_type; typedef char extern_type; typedef mbstate_t state_type; protected: __c_locale _M_c_locale_codecvt; public: static locale::id id; explicit codecvt(size_t __refs = 0); explicit codecvt(__c_locale __cloc, size_t __refs = 0); protected: virtual ~codecvt(); virtual result do_out(state_type& __state, const intern_type* __from, const intern_type* __from_end, const intern_type*& __from_next, extern_type* __to, extern_type* __to_end, extern_type*& __to_next) const; virtual result do_unshift(state_type& __state, extern_type* __to, extern_type* __to_end, extern_type*& __to_next) const; virtual result do_in(state_type& __state, const extern_type* __from, const extern_type* __from_end, const extern_type*& __from_next, intern_type* __to, intern_type* __to_end, intern_type*& __to_next) const; virtual int do_encoding() const throw(); virtual bool do_always_noconv() const throw(); virtual int do_length(state_type&, const extern_type* __from, const extern_type* __end, size_t __max) const; virtual int do_max_length() const throw(); }; #ifdef _GLIBCXX_USE_WCHAR_T /** @brief Class codecvt specialization. * * Converts between narrow and wide characters in the native character set */ template<> class codecvt : public __codecvt_abstract_base { friend class messages; public: // Types: typedef wchar_t intern_type; typedef char extern_type; typedef mbstate_t state_type; protected: __c_locale _M_c_locale_codecvt; public: static locale::id id; explicit codecvt(size_t __refs = 0); explicit codecvt(__c_locale __cloc, size_t __refs = 0); protected: virtual ~codecvt(); virtual result do_out(state_type& __state, const intern_type* __from, const intern_type* __from_end, const intern_type*& __from_next, extern_type* __to, extern_type* __to_end, extern_type*& __to_next) const; virtual result do_unshift(state_type& __state, extern_type* __to, extern_type* __to_end, extern_type*& __to_next) const; virtual result do_in(state_type& __state, const extern_type* __from, const extern_type* __from_end, const extern_type*& __from_next, intern_type* __to, intern_type* __to_end, intern_type*& __to_next) const; virtual int do_encoding() const throw(); virtual bool do_always_noconv() const throw(); virtual int do_length(state_type&, const extern_type* __from, const extern_type* __end, size_t __max) const; virtual int do_max_length() const throw(); }; #endif //_GLIBCXX_USE_WCHAR_T # 460 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/codecvt.h" 3 #if __cplusplus >= 201103L #ifdef _GLIBCXX_USE_C99_STDINT_TR1 /** @brief Class codecvt specialization. * * Converts between UTF-16 and UTF-8. */ template<> class codecvt : public __codecvt_abstract_base { public: // Types: typedef char16_t intern_type; typedef char extern_type; typedef mbstate_t state_type; public: static locale::id id; explicit codecvt(size_t __refs = 0) : __codecvt_abstract_base(__refs) { } protected: virtual ~codecvt(); virtual result do_out(state_type& __state, const intern_type* __from, const intern_type* __from_end, const intern_type*& __from_next, extern_type* __to, extern_type* __to_end, extern_type*& __to_next) const; virtual result do_unshift(state_type& __state, extern_type* __to, extern_type* __to_end, extern_type*& __to_next) const; virtual result do_in(state_type& __state, const extern_type* __from, const extern_type* __from_end, const extern_type*& __from_next, intern_type* __to, intern_type* __to_end, intern_type*& __to_next) const; virtual int do_encoding() const throw(); virtual bool do_always_noconv() const throw(); virtual int do_length(state_type&, const extern_type* __from, const extern_type* __end, size_t __max) const; virtual int do_max_length() const throw(); }; /** @brief Class codecvt specialization. * * Converts between UTF-32 and UTF-8. */ template<> class codecvt : public __codecvt_abstract_base { public: // Types: typedef char32_t intern_type; typedef char extern_type; typedef mbstate_t state_type; public: static locale::id id; explicit codecvt(size_t __refs = 0) : __codecvt_abstract_base(__refs) { } protected: virtual ~codecvt(); virtual result do_out(state_type& __state, const intern_type* __from, const intern_type* __from_end, const intern_type*& __from_next, extern_type* __to, extern_type* __to_end, extern_type*& __to_next) const; virtual result do_unshift(state_type& __state, extern_type* __to, extern_type* __to_end, extern_type*& __to_next) const; virtual result do_in(state_type& __state, const extern_type* __from, const extern_type* __from_end, const extern_type*& __from_next, intern_type* __to, intern_type* __to_end, intern_type*& __to_next) const; virtual int do_encoding() const throw(); virtual bool do_always_noconv() const throw(); virtual int do_length(state_type&, const extern_type* __from, const extern_type* __end, size_t __max) const; virtual int do_max_length() const throw(); }; #endif // _GLIBCXX_USE_C99_STDINT_TR1 # 578 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/codecvt.h" 3 #endif // C++11 # 579 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/codecvt.h" 3 /// class codecvt_byname [22.2.1.6]. template class codecvt_byname : public codecvt<_InternT, _ExternT, _StateT> { public: explicit codecvt_byname(const char* __s, size_t __refs = 0) : codecvt<_InternT, _ExternT, _StateT>(__refs) { if (__builtin_strcmp(__s, "C") != 0 && __builtin_strcmp(__s, "POSIX") != 0) { this->_S_destroy_c_locale(this->_M_c_locale_codecvt); this->_S_create_c_locale(this->_M_c_locale_codecvt, __s); } } #if __cplusplus >= 201103L explicit codecvt_byname(const string& __s, size_t __refs = 0) : codecvt_byname(__s.c_str(), __refs) { } #endif # 602 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/codecvt.h" 3 protected: virtual ~codecvt_byname() { } }; #if __cplusplus >= 201103L && defined(_GLIBCXX_USE_C99_STDINT_TR1) template<> class codecvt_byname : public codecvt { public: explicit codecvt_byname(const char* __s, size_t __refs = 0) : codecvt(__refs) { } explicit codecvt_byname(const string& __s, size_t __refs = 0) : codecvt_byname(__s.c_str(), __refs) { } protected: virtual ~codecvt_byname() { } }; template<> class codecvt_byname : public codecvt { public: explicit codecvt_byname(const char* __s, size_t __refs = 0) : codecvt(__refs) { } explicit codecvt_byname(const string& __s, size_t __refs = 0) : codecvt_byname(__s.c_str(), __refs) { } protected: virtual ~codecvt_byname() { } }; #endif # 645 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/codecvt.h" 3 // Inhibit implicit instantiations for required instantiations, // which are defined via explicit instantiations elsewhere. #if _GLIBCXX_EXTERN_TEMPLATE extern template class codecvt_byname; extern template const codecvt& use_facet >(const locale&); extern template bool has_facet >(const locale&); #ifdef _GLIBCXX_USE_WCHAR_T extern template class codecvt_byname; extern template const codecvt& use_facet >(const locale&); extern template bool has_facet >(const locale&); #endif # 670 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/codecvt.h" 3 #if __cplusplus >= 201103L && defined(_GLIBCXX_USE_C99_STDINT_TR1) extern template class codecvt_byname; extern template class codecvt_byname; #endif # 675 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/codecvt.h" 3 #endif # 677 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/codecvt.h" 3 _GLIBCXX_END_NAMESPACE_VERSION } // namespace std #endif // _CODECVT_H # 682 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/codecvt.h" 3 # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/fstream" 2 3 #if 0 /* expanded by -frewrite-includes */ #include // For BUFSIZ #endif /* expanded by -frewrite-includes */ # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/fstream" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdio" 1 3 // -*- C++ -*- forwarding header. // Copyright (C) 1997-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file include/cstdio * This is a Standard C++ Library file. You should @c \#include this file * in your programs, rather than any of the @a *.h implementation files. * * This is the C++ version of the Standard C Library header @c stdio.h, * and its contents are (mostly) the same as that header, but are all * contained in the namespace @c std (except for names which are defined * as macros in C). */ // // ISO C++ 14882: 27.8.2 C Library files // #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdio" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdio" 3 # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdio" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdio" 3 # 43 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdio" 3 #ifndef _GLIBCXX_CSTDIO #define _GLIBCXX_CSTDIO 1 #ifndef _GLIBCXX_HAVE_GETS extern "C" char* gets (char* __s) __attribute__((__deprecated__)); #endif # 50 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdio" 3 // Get rid of those macros defined in in lieu of real functions. #undef clearerr #undef fclose #undef feof #undef ferror #undef fflush #undef fgetc #undef fgetpos #undef fgets #undef fopen #undef fprintf #undef fputc #undef fputs #undef fread #undef freopen #undef fscanf #undef fseek #undef fsetpos #undef ftell #undef fwrite #undef getc #undef getchar #if __cplusplus <= 201103L # undef gets #endif # 76 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdio" 3 #undef perror #undef printf #undef putc #undef putchar #undef puts #undef remove #undef rename #undef rewind #undef scanf #undef setbuf #undef setvbuf #undef sprintf #undef sscanf #undef tmpfile #undef tmpnam #undef ungetc #undef vfprintf #undef vprintf #undef vsprintf namespace std { using ::FILE; using ::fpos_t; using ::clearerr; using ::fclose; using ::feof; using ::ferror; using ::fflush; using ::fgetc; using ::fgetpos; using ::fgets; using ::fopen; using ::fprintf; using ::fputc; using ::fputs; using ::fread; using ::freopen; using ::fscanf; using ::fseek; using ::fsetpos; using ::ftell; using ::fwrite; using ::getc; using ::getchar; #if __cplusplus <= 201103L // LWG 2249 using ::gets; #endif # 126 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdio" 3 using ::perror; using ::printf; using ::putc; using ::putchar; using ::puts; using ::remove; using ::rename; using ::rewind; using ::scanf; using ::setbuf; using ::setvbuf; using ::sprintf; using ::sscanf; using ::tmpfile; #if _GLIBCXX_USE_TMPNAM using ::tmpnam; #endif # 143 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdio" 3 using ::ungetc; using ::vfprintf; using ::vprintf; using ::vsprintf; } // namespace #if _GLIBCXX_USE_C99 #undef snprintf #undef vfscanf #undef vscanf #undef vsnprintf #undef vsscanf namespace __gnu_cxx { #if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC extern "C" int (snprintf)(char * __restrict, std::size_t, const char * __restrict, ...) throw (); extern "C" int (vfscanf)(FILE * __restrict, const char * __restrict, __gnuc_va_list); extern "C" int (vscanf)(const char * __restrict, __gnuc_va_list); extern "C" int (vsnprintf)(char * __restrict, std::size_t, const char * __restrict, __gnuc_va_list) throw (); extern "C" int (vsscanf)(const char * __restrict, const char * __restrict, __gnuc_va_list) throw (); #endif # 173 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdio" 3 #if !_GLIBCXX_USE_C99_DYNAMIC using ::snprintf; using ::vfscanf; using ::vscanf; using ::vsnprintf; using ::vsscanf; #endif # 181 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdio" 3 } // namespace __gnu_cxx namespace std { using ::__gnu_cxx::snprintf; using ::__gnu_cxx::vfscanf; using ::__gnu_cxx::vscanf; using ::__gnu_cxx::vsnprintf; using ::__gnu_cxx::vsscanf; } // namespace std #endif // _GLIBCXX_USE_C99 # 193 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdio" 3 #endif # 195 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdio" 3 # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/fstream" 2 3 #if 0 /* expanded by -frewrite-includes */ #include // For __basic_file, __c_lock #endif /* expanded by -frewrite-includes */ # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/fstream" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/basic_file.h" 1 3 // Wrapper of C-language FILE struct -*- C++ -*- // Copyright (C) 2000-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . // // ISO C++ 14882: 27.8 File-based streams // /** @file bits/basic_file.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{ios} */ #ifndef _GLIBCXX_BASIC_FILE_STDIO_H #define _GLIBCXX_BASIC_FILE_STDIO_H 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 38 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/basic_file.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/basic_file.h" 3 # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/basic_file.h" 3 #if 0 /* expanded by -frewrite-includes */ #include // for __c_lock and __c_file #endif /* expanded by -frewrite-includes */ # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/basic_file.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++io.h" 1 3 // Underlying io library details -*- C++ -*- // Copyright (C) 2000-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file bits/c++io.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{ios} */ // c_io_stdio.h - Defines for using "C" stdio.h #ifndef _GLIBCXX_CXX_IO_H #define _GLIBCXX_CXX_IO_H 1 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 35 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++io.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdio" 1 3 // -*- C++ -*- forwarding header. // Copyright (C) 1997-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file include/cstdio * This is a Standard C++ Library file. You should @c \#include this file * in your programs, rather than any of the @a *.h implementation files. * * This is the C++ version of the Standard C Library header @c stdio.h, * and its contents are (mostly) the same as that header, but are all * contained in the namespace @c std (except for names which are defined * as macros in C). */ // // ISO C++ 14882: 27.8.2 C Library files // #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdio" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdio" 3 # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdio" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdio" 3 # 43 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdio" 3 #ifndef _GLIBCXX_CSTDIO #define _GLIBCXX_CSTDIO 1 #ifndef _GLIBCXX_HAVE_GETS extern "C" char* gets (char* __s) __attribute__((__deprecated__)); #endif # 50 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdio" 3 // Get rid of those macros defined in in lieu of real functions. #undef clearerr #undef fclose #undef feof #undef ferror #undef fflush #undef fgetc #undef fgetpos #undef fgets #undef fopen #undef fprintf #undef fputc #undef fputs #undef fread #undef freopen #undef fscanf #undef fseek #undef fsetpos #undef ftell #undef fwrite #undef getc #undef getchar #if __cplusplus <= 201103L # undef gets #endif # 76 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdio" 3 #undef perror #undef printf #undef putc #undef putchar #undef puts #undef remove #undef rename #undef rewind #undef scanf #undef setbuf #undef setvbuf #undef sprintf #undef sscanf #undef tmpfile #undef tmpnam #undef ungetc #undef vfprintf #undef vprintf #undef vsprintf namespace std { using ::FILE; using ::fpos_t; using ::clearerr; using ::fclose; using ::feof; using ::ferror; using ::fflush; using ::fgetc; using ::fgetpos; using ::fgets; using ::fopen; using ::fprintf; using ::fputc; using ::fputs; using ::fread; using ::freopen; using ::fscanf; using ::fseek; using ::fsetpos; using ::ftell; using ::fwrite; using ::getc; using ::getchar; #if __cplusplus <= 201103L // LWG 2249 using ::gets; #endif # 126 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdio" 3 using ::perror; using ::printf; using ::putc; using ::putchar; using ::puts; using ::remove; using ::rename; using ::rewind; using ::scanf; using ::setbuf; using ::setvbuf; using ::sprintf; using ::sscanf; using ::tmpfile; #if _GLIBCXX_USE_TMPNAM using ::tmpnam; #endif # 143 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdio" 3 using ::ungetc; using ::vfprintf; using ::vprintf; using ::vsprintf; } // namespace #if _GLIBCXX_USE_C99 #undef snprintf #undef vfscanf #undef vscanf #undef vsnprintf #undef vsscanf namespace __gnu_cxx { #if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC extern "C" int (snprintf)(char * __restrict, std::size_t, const char * __restrict, ...) throw (); extern "C" int (vfscanf)(FILE * __restrict, const char * __restrict, __gnuc_va_list); extern "C" int (vscanf)(const char * __restrict, __gnuc_va_list); extern "C" int (vsnprintf)(char * __restrict, std::size_t, const char * __restrict, __gnuc_va_list) throw (); extern "C" int (vsscanf)(const char * __restrict, const char * __restrict, __gnuc_va_list) throw (); #endif # 173 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdio" 3 #if !_GLIBCXX_USE_C99_DYNAMIC using ::snprintf; using ::vfscanf; using ::vscanf; using ::vsnprintf; using ::vsscanf; #endif # 181 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdio" 3 } // namespace __gnu_cxx namespace std { using ::__gnu_cxx::snprintf; using ::__gnu_cxx::vfscanf; using ::__gnu_cxx::vscanf; using ::__gnu_cxx::vsnprintf; using ::__gnu_cxx::vsscanf; } // namespace std #endif // _GLIBCXX_USE_C99 # 193 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdio" 3 #endif # 195 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstdio" 3 # 36 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++io.h" 2 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 36 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++io.h" 3 # 37 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++io.h" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION typedef __gthread_mutex_t __c_lock; // for basic_file.h typedef FILE __c_file; _GLIBCXX_END_NAMESPACE_VERSION } // namespace #endif # 51 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/c++io.h" 3 # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/basic_file.h" 2 3 #if 0 /* expanded by -frewrite-includes */ #include // for swap #endif /* expanded by -frewrite-includes */ # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/basic_file.h" 3 # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/basic_file.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/basic_file.h" 3 # 43 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/basic_file.h" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION // Generic declaration. template class __basic_file; // Specialization. template<> class __basic_file { // Underlying data source/sink. __c_file* _M_cfile; // True iff we opened _M_cfile, and thus must close it ourselves. bool _M_cfile_created; public: __basic_file(__c_lock* __lock = 0) throw (); #if __cplusplus >= 201103L __basic_file(__basic_file&& __rv, __c_lock* __lock = 0) noexcept : _M_cfile(__rv._M_cfile), _M_cfile_created(__rv._M_cfile_created) { __rv._M_cfile = nullptr; __rv._M_cfile_created = false; } __basic_file& operator=(const __basic_file&) = delete; __basic_file& operator=(__basic_file&&) = delete; void swap(__basic_file& __f) noexcept { std::swap(_M_cfile, __f._M_cfile); std::swap(_M_cfile_created, __f._M_cfile_created); } #endif # 83 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/basic_file.h" 3 __basic_file* open(const char* __name, ios_base::openmode __mode, int __prot = 0664); __basic_file* sys_open(__c_file* __file, ios_base::openmode); __basic_file* sys_open(int __fd, ios_base::openmode __mode) throw (); __basic_file* close(); _GLIBCXX_PURE bool is_open() const throw (); _GLIBCXX_PURE int fd() throw (); _GLIBCXX_PURE __c_file* file() throw (); ~__basic_file(); streamsize xsputn(const char* __s, streamsize __n); streamsize xsputn_2(const char* __s1, streamsize __n1, const char* __s2, streamsize __n2); streamsize xsgetn(char* __s, streamsize __n); streamoff seekoff(streamoff __off, ios_base::seekdir __way) throw (); int sync(); streamsize showmanyc(); }; _GLIBCXX_END_NAMESPACE_VERSION } // namespace #endif # 131 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/basic_file.h" 3 # 43 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/fstream" 2 3 #if __cplusplus >= 201103L #if 0 /* expanded by -frewrite-includes */ #include // For std::string overloads. #endif /* expanded by -frewrite-includes */ # 44 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/fstream" 3 # 45 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/fstream" 3 #endif # 46 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/fstream" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION // [27.8.1.1] template class basic_filebuf /** * @brief The actual work of input and output (for files). * @ingroup io * * @tparam _CharT Type of character stream. * @tparam _Traits Traits for character type, defaults to * char_traits<_CharT>. * * This class associates both its input and output sequence with an * external disk file, and maintains a joint file position for both * sequences. Many of its semantics are described in terms of similar * behavior in the Standard C Library's @c FILE streams. * * Requirements on traits_type, specific to this class: * - traits_type::pos_type must be fpos * - traits_type::off_type must be streamoff * - traits_type::state_type must be Assignable and DefaultConstructible, * - traits_type::state_type() must be the initial state for codecvt. */ template class basic_filebuf : public basic_streambuf<_CharT, _Traits> { #if __cplusplus >= 201103L template using __chk_state = __and_, is_copy_constructible<_Tp>, is_default_constructible<_Tp>>; static_assert(__chk_state::value, "state_type must be CopyAssignable, CopyConstructible" " and DefaultConstructible"); static_assert(is_same>::value, "pos_type must be fpos"); #endif # 88 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/fstream" 3 public: // Types: typedef _CharT char_type; typedef _Traits traits_type; typedef typename traits_type::int_type int_type; typedef typename traits_type::pos_type pos_type; typedef typename traits_type::off_type off_type; typedef basic_streambuf __streambuf_type; typedef basic_filebuf __filebuf_type; typedef __basic_file __file_type; typedef typename traits_type::state_type __state_type; typedef codecvt __codecvt_type; friend class ios_base; // For sync_with_stdio. protected: // Data Members: // MT lock inherited from libio or other low-level io library. __c_lock _M_lock; // External buffer. __file_type _M_file; /// Place to stash in || out || in | out settings for current filebuf. ios_base::openmode _M_mode; // Beginning state type for codecvt. __state_type _M_state_beg; // During output, the state that corresponds to pptr(), // during input, the state that corresponds to egptr() and // _M_ext_next. __state_type _M_state_cur; // Not used for output. During input, the state that corresponds // to eback() and _M_ext_buf. __state_type _M_state_last; /// Pointer to the beginning of internal buffer. char_type* _M_buf; /** * Actual size of internal buffer. This number is equal to the size * of the put area + 1 position, reserved for the overflow char of * a full area. */ size_t _M_buf_size; // Set iff _M_buf is allocated memory from _M_allocate_internal_buffer. bool _M_buf_allocated; /** * _M_reading == false && _M_writing == false for @b uncommitted mode; * _M_reading == true for @b read mode; * _M_writing == true for @b write mode; * * NB: _M_reading == true && _M_writing == true is unused. */ bool _M_reading; bool _M_writing; //@{ /** * Necessary bits for putback buffer management. * * @note pbacks of over one character are not currently supported. */ char_type _M_pback; char_type* _M_pback_cur_save; char_type* _M_pback_end_save; bool _M_pback_init; //@} // Cached codecvt facet. const __codecvt_type* _M_codecvt; /** * Buffer for external characters. Used for input when * codecvt::always_noconv() == false. When valid, this corresponds * to eback(). */ char* _M_ext_buf; /** * Size of buffer held by _M_ext_buf. */ streamsize _M_ext_buf_size; /** * Pointers into the buffer held by _M_ext_buf that delimit a * subsequence of bytes that have been read but not yet converted. * When valid, _M_ext_next corresponds to egptr(). */ const char* _M_ext_next; char* _M_ext_end; /** * Initializes pback buffers, and moves normal buffers to safety. * Assumptions: * _M_in_cur has already been moved back */ void _M_create_pback() { if (!_M_pback_init) { _M_pback_cur_save = this->gptr(); _M_pback_end_save = this->egptr(); this->setg(&_M_pback, &_M_pback, &_M_pback + 1); _M_pback_init = true; } } /** * Deactivates pback buffer contents, and restores normal buffer. * Assumptions: * The pback buffer has only moved forward. */ void _M_destroy_pback() throw() { if (_M_pback_init) { // Length _M_in_cur moved in the pback buffer. _M_pback_cur_save += this->gptr() != this->eback(); this->setg(_M_buf, _M_pback_cur_save, _M_pback_end_save); _M_pback_init = false; } } public: // Constructors/destructor: /** * @brief Does not open any files. * * The default constructor initializes the parent class using its * own default ctor. */ basic_filebuf(); #if __cplusplus >= 201103L basic_filebuf(const basic_filebuf&) = delete; basic_filebuf(basic_filebuf&&); #endif # 233 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/fstream" 3 /** * @brief The destructor closes the file first. */ virtual ~basic_filebuf() { this->close(); } #if __cplusplus >= 201103L basic_filebuf& operator=(const basic_filebuf&) = delete; basic_filebuf& operator=(basic_filebuf&&); void swap(basic_filebuf&); #endif # 246 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/fstream" 3 // Members: /** * @brief Returns true if the external file is open. */ bool is_open() const throw() { return _M_file.is_open(); } /** * @brief Opens an external file. * @param __s The name of the file. * @param __mode The open mode flags. * @return @c this on success, NULL on failure * * If a file is already open, this function immediately fails. * Otherwise it tries to open the file named @a __s using the flags * given in @a __mode. * * Table 92, adapted here, gives the relation between openmode * combinations and the equivalent @c fopen() flags. * (NB: lines app, in|out|app, in|app, binary|app, binary|in|out|app, * and binary|in|app per DR 596) *
       *  +---------------------------------------------------------+
       *  | ios_base Flag combination            stdio equivalent   |
       *  |binary  in  out  trunc  app                              |
       *  +---------------------------------------------------------+
       *  |             +                        w                  |
       *  |             +           +            a                  |
       *  |                         +            a                  |
       *  |             +     +                  w                  |
       *  |         +                            r                  |
       *  |         +   +                        r+                 |
       *  |         +   +     +                  w+                 |
       *  |         +   +           +            a+                 |
       *  |         +               +            a+                 |
       *  +---------------------------------------------------------+
       *  |   +         +                        wb                 |
       *  |   +         +           +            ab                 |
       *  |   +                     +            ab                 |
       *  |   +         +     +                  wb                 |
       *  |   +     +                            rb                 |
       *  |   +     +   +                        r+b                |
       *  |   +     +   +     +                  w+b                |
       *  |   +     +   +           +            a+b                |
       *  |   +     +               +            a+b                |
       *  +---------------------------------------------------------+
       *  
*/ __filebuf_type* open(const char* __s, ios_base::openmode __mode); #if __cplusplus >= 201103L /** * @brief Opens an external file. * @param __s The name of the file. * @param __mode The open mode flags. * @return @c this on success, NULL on failure */ __filebuf_type* open(const std::string& __s, ios_base::openmode __mode) { return open(__s.c_str(), __mode); } #endif # 310 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/fstream" 3 /** * @brief Closes the currently associated file. * @return @c this on success, NULL on failure * * If no file is currently open, this function immediately fails. * * If a put buffer area exists, @c overflow(eof) is * called to flush all the characters. The file is then * closed. * * If any operations fail, this function also fails. */ __filebuf_type* close(); protected: void _M_allocate_internal_buffer(); void _M_destroy_internal_buffer() throw(); // [27.8.1.4] overridden virtual functions virtual streamsize showmanyc(); // Stroustrup, 1998, p. 628 // underflow() and uflow() functions are called to get the next // character from the real input source when the buffer is empty. // Buffered input uses underflow() virtual int_type underflow(); virtual int_type pbackfail(int_type __c = _Traits::eof()); // Stroustrup, 1998, p 648 // The overflow() function is called to transfer characters to the // real output destination when the buffer is full. A call to // overflow(c) outputs the contents of the buffer plus the // character c. // 27.5.2.4.5 // Consume some sequence of the characters in the pending sequence. virtual int_type overflow(int_type __c = _Traits::eof()); // Convert internal byte sequence to external, char-based // sequence via codecvt. bool _M_convert_to_external(char_type*, streamsize); /** * @brief Manipulates the buffer. * @param __s Pointer to a buffer area. * @param __n Size of @a __s. * @return @c this * * If no file has been opened, and both @a __s and @a __n are zero, then * the stream becomes unbuffered. Otherwise, @c __s is used as a * buffer; see * https://gcc.gnu.org/onlinedocs/libstdc++/manual/streambufs.html#io.streambuf.buffering * for more. */ virtual __streambuf_type* setbuf(char_type* __s, streamsize __n); virtual pos_type seekoff(off_type __off, ios_base::seekdir __way, ios_base::openmode __mode = ios_base::in | ios_base::out); virtual pos_type seekpos(pos_type __pos, ios_base::openmode __mode = ios_base::in | ios_base::out); // Common code for seekoff, seekpos, and overflow pos_type _M_seek(off_type __off, ios_base::seekdir __way, __state_type __state); int _M_get_ext_pos(__state_type &__state); virtual int sync(); virtual void imbue(const locale& __loc); virtual streamsize xsgetn(char_type* __s, streamsize __n); virtual streamsize xsputn(const char_type* __s, streamsize __n); // Flushes output buffer, then writes unshift sequence. bool _M_terminate_output(); /** * This function sets the pointers of the internal buffer, both get * and put areas. Typically: * * __off == egptr() - eback() upon underflow/uflow (@b read mode); * __off == 0 upon overflow (@b write mode); * __off == -1 upon open, setbuf, seekoff/pos (@b uncommitted mode). * * NB: epptr() - pbase() == _M_buf_size - 1, since _M_buf_size * reflects the actual allocated memory and the last cell is reserved * for the overflow char of a full put area. */ void _M_set_buffer(streamsize __off) { const bool __testin = _M_mode & ios_base::in; const bool __testout = (_M_mode & ios_base::out || _M_mode & ios_base::app); if (__testin && __off > 0) this->setg(_M_buf, _M_buf, _M_buf + __off); else this->setg(_M_buf, _M_buf, _M_buf); if (__testout && __off == 0 && _M_buf_size > 1 ) this->setp(_M_buf, _M_buf + _M_buf_size - 1); else this->setp(0, 0); } }; // [27.8.1.5] Template class basic_ifstream /** * @brief Controlling input for files. * @ingroup io * * @tparam _CharT Type of character stream. * @tparam _Traits Traits for character type, defaults to * char_traits<_CharT>. * * This class supports reading from named files, using the inherited * functions from std::basic_istream. To control the associated * sequence, an instance of std::basic_filebuf is used, which this page * refers to as @c sb. */ template class basic_ifstream : public basic_istream<_CharT, _Traits> { public: // Types: typedef _CharT char_type; typedef _Traits traits_type; typedef typename traits_type::int_type int_type; typedef typename traits_type::pos_type pos_type; typedef typename traits_type::off_type off_type; // Non-standard types: typedef basic_filebuf __filebuf_type; typedef basic_istream __istream_type; private: __filebuf_type _M_filebuf; public: // Constructors/Destructors: /** * @brief Default constructor. * * Initializes @c sb using its default constructor, and passes * @c &sb to the base class initializer. Does not open any files * (you haven't given it a filename to open). */ basic_ifstream() : __istream_type(), _M_filebuf() { this->init(&_M_filebuf); } /** * @brief Create an input file stream. * @param __s Null terminated string specifying the filename. * @param __mode Open file in specified mode (see std::ios_base). * * @c ios_base::in is automatically included in @a __mode. * * Tip: When using std::string to hold the filename, you must use * .c_str() before passing it to this constructor. */ explicit basic_ifstream(const char* __s, ios_base::openmode __mode = ios_base::in) : __istream_type(), _M_filebuf() { this->init(&_M_filebuf); this->open(__s, __mode); } #if __cplusplus >= 201103L /** * @brief Create an input file stream. * @param __s std::string specifying the filename. * @param __mode Open file in specified mode (see std::ios_base). * * @c ios_base::in is automatically included in @a __mode. */ explicit basic_ifstream(const std::string& __s, ios_base::openmode __mode = ios_base::in) : __istream_type(), _M_filebuf() { this->init(&_M_filebuf); this->open(__s, __mode); } basic_ifstream(const basic_ifstream&) = delete; basic_ifstream(basic_ifstream&& __rhs) : __istream_type(std::move(__rhs)), _M_filebuf(std::move(__rhs._M_filebuf)) { __istream_type::set_rdbuf(&_M_filebuf); } #endif # 526 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/fstream" 3 /** * @brief The destructor does nothing. * * The file is closed by the filebuf object, not the formatting * stream. */ ~basic_ifstream() { } #if __cplusplus >= 201103L // 27.8.3.2 Assign and swap: basic_ifstream& operator=(const basic_ifstream&) = delete; basic_ifstream& operator=(basic_ifstream&& __rhs) { __istream_type::operator=(std::move(__rhs)); _M_filebuf = std::move(__rhs._M_filebuf); return *this; } void swap(basic_ifstream& __rhs) { __istream_type::swap(__rhs); _M_filebuf.swap(__rhs._M_filebuf); } #endif # 557 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/fstream" 3 // Members: /** * @brief Accessing the underlying buffer. * @return The current basic_filebuf buffer. * * This hides both signatures of std::basic_ios::rdbuf(). */ __filebuf_type* rdbuf() const { return const_cast<__filebuf_type*>(&_M_filebuf); } /** * @brief Wrapper to test for an open file. * @return @c rdbuf()->is_open() */ bool is_open() { return _M_filebuf.is_open(); } // _GLIBCXX_RESOLVE_LIB_DEFECTS // 365. Lack of const-qualification in clause 27 bool is_open() const { return _M_filebuf.is_open(); } /** * @brief Opens an external file. * @param __s The name of the file. * @param __mode The open mode flags. * * Calls @c std::basic_filebuf::open(s,__mode|in). If that function * fails, @c failbit is set in the stream's error state. * * Tip: When using std::string to hold the filename, you must use * .c_str() before passing it to this constructor. */ void open(const char* __s, ios_base::openmode __mode = ios_base::in) { if (!_M_filebuf.open(__s, __mode | ios_base::in)) this->setstate(ios_base::failbit); else // _GLIBCXX_RESOLVE_LIB_DEFECTS // 409. Closing an fstream should clear error state this->clear(); } #if __cplusplus >= 201103L /** * @brief Opens an external file. * @param __s The name of the file. * @param __mode The open mode flags. * * Calls @c std::basic_filebuf::open(__s,__mode|in). If that function * fails, @c failbit is set in the stream's error state. */ void open(const std::string& __s, ios_base::openmode __mode = ios_base::in) { if (!_M_filebuf.open(__s, __mode | ios_base::in)) this->setstate(ios_base::failbit); else // _GLIBCXX_RESOLVE_LIB_DEFECTS // 409. Closing an fstream should clear error state this->clear(); } #endif # 625 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/fstream" 3 /** * @brief Close the file. * * Calls @c std::basic_filebuf::close(). If that function * fails, @c failbit is set in the stream's error state. */ void close() { if (!_M_filebuf.close()) this->setstate(ios_base::failbit); } }; // [27.8.1.8] Template class basic_ofstream /** * @brief Controlling output for files. * @ingroup io * * @tparam _CharT Type of character stream. * @tparam _Traits Traits for character type, defaults to * char_traits<_CharT>. * * This class supports reading from named files, using the inherited * functions from std::basic_ostream. To control the associated * sequence, an instance of std::basic_filebuf is used, which this page * refers to as @c sb. */ template class basic_ofstream : public basic_ostream<_CharT,_Traits> { public: // Types: typedef _CharT char_type; typedef _Traits traits_type; typedef typename traits_type::int_type int_type; typedef typename traits_type::pos_type pos_type; typedef typename traits_type::off_type off_type; // Non-standard types: typedef basic_filebuf __filebuf_type; typedef basic_ostream __ostream_type; private: __filebuf_type _M_filebuf; public: // Constructors: /** * @brief Default constructor. * * Initializes @c sb using its default constructor, and passes * @c &sb to the base class initializer. Does not open any files * (you haven't given it a filename to open). */ basic_ofstream(): __ostream_type(), _M_filebuf() { this->init(&_M_filebuf); } /** * @brief Create an output file stream. * @param __s Null terminated string specifying the filename. * @param __mode Open file in specified mode (see std::ios_base). * * @c ios_base::out | @c ios_base::trunc is automatically included in * @a __mode. * * Tip: When using std::string to hold the filename, you must use * .c_str() before passing it to this constructor. */ explicit basic_ofstream(const char* __s, ios_base::openmode __mode = ios_base::out|ios_base::trunc) : __ostream_type(), _M_filebuf() { this->init(&_M_filebuf); this->open(__s, __mode); } #if __cplusplus >= 201103L /** * @brief Create an output file stream. * @param __s std::string specifying the filename. * @param __mode Open file in specified mode (see std::ios_base). * * @c ios_base::out | @c ios_base::trunc is automatically included in * @a __mode. */ explicit basic_ofstream(const std::string& __s, ios_base::openmode __mode = ios_base::out|ios_base::trunc) : __ostream_type(), _M_filebuf() { this->init(&_M_filebuf); this->open(__s, __mode); } basic_ofstream(const basic_ofstream&) = delete; basic_ofstream(basic_ofstream&& __rhs) : __ostream_type(std::move(__rhs)), _M_filebuf(std::move(__rhs._M_filebuf)) { __ostream_type::set_rdbuf(&_M_filebuf); } #endif # 730 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/fstream" 3 /** * @brief The destructor does nothing. * * The file is closed by the filebuf object, not the formatting * stream. */ ~basic_ofstream() { } #if __cplusplus >= 201103L // 27.8.3.2 Assign and swap: basic_ofstream& operator=(const basic_ofstream&) = delete; basic_ofstream& operator=(basic_ofstream&& __rhs) { __ostream_type::operator=(std::move(__rhs)); _M_filebuf = std::move(__rhs._M_filebuf); return *this; } void swap(basic_ofstream& __rhs) { __ostream_type::swap(__rhs); _M_filebuf.swap(__rhs._M_filebuf); } #endif # 761 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/fstream" 3 // Members: /** * @brief Accessing the underlying buffer. * @return The current basic_filebuf buffer. * * This hides both signatures of std::basic_ios::rdbuf(). */ __filebuf_type* rdbuf() const { return const_cast<__filebuf_type*>(&_M_filebuf); } /** * @brief Wrapper to test for an open file. * @return @c rdbuf()->is_open() */ bool is_open() { return _M_filebuf.is_open(); } // _GLIBCXX_RESOLVE_LIB_DEFECTS // 365. Lack of const-qualification in clause 27 bool is_open() const { return _M_filebuf.is_open(); } /** * @brief Opens an external file. * @param __s The name of the file. * @param __mode The open mode flags. * * Calls @c std::basic_filebuf::open(__s,__mode|out|trunc). If that * function fails, @c failbit is set in the stream's error state. * * Tip: When using std::string to hold the filename, you must use * .c_str() before passing it to this constructor. */ void open(const char* __s, ios_base::openmode __mode = ios_base::out | ios_base::trunc) { if (!_M_filebuf.open(__s, __mode | ios_base::out)) this->setstate(ios_base::failbit); else // _GLIBCXX_RESOLVE_LIB_DEFECTS // 409. Closing an fstream should clear error state this->clear(); } #if __cplusplus >= 201103L /** * @brief Opens an external file. * @param __s The name of the file. * @param __mode The open mode flags. * * Calls @c std::basic_filebuf::open(s,mode|out|trunc). If that * function fails, @c failbit is set in the stream's error state. */ void open(const std::string& __s, ios_base::openmode __mode = ios_base::out | ios_base::trunc) { if (!_M_filebuf.open(__s, __mode | ios_base::out)) this->setstate(ios_base::failbit); else // _GLIBCXX_RESOLVE_LIB_DEFECTS // 409. Closing an fstream should clear error state this->clear(); } #endif # 831 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/fstream" 3 /** * @brief Close the file. * * Calls @c std::basic_filebuf::close(). If that function * fails, @c failbit is set in the stream's error state. */ void close() { if (!_M_filebuf.close()) this->setstate(ios_base::failbit); } }; // [27.8.1.11] Template class basic_fstream /** * @brief Controlling input and output for files. * @ingroup io * * @tparam _CharT Type of character stream. * @tparam _Traits Traits for character type, defaults to * char_traits<_CharT>. * * This class supports reading from and writing to named files, using * the inherited functions from std::basic_iostream. To control the * associated sequence, an instance of std::basic_filebuf is used, which * this page refers to as @c sb. */ template class basic_fstream : public basic_iostream<_CharT, _Traits> { public: // Types: typedef _CharT char_type; typedef _Traits traits_type; typedef typename traits_type::int_type int_type; typedef typename traits_type::pos_type pos_type; typedef typename traits_type::off_type off_type; // Non-standard types: typedef basic_filebuf __filebuf_type; typedef basic_ios __ios_type; typedef basic_iostream __iostream_type; private: __filebuf_type _M_filebuf; public: // Constructors/destructor: /** * @brief Default constructor. * * Initializes @c sb using its default constructor, and passes * @c &sb to the base class initializer. Does not open any files * (you haven't given it a filename to open). */ basic_fstream() : __iostream_type(), _M_filebuf() { this->init(&_M_filebuf); } /** * @brief Create an input/output file stream. * @param __s Null terminated string specifying the filename. * @param __mode Open file in specified mode (see std::ios_base). * * Tip: When using std::string to hold the filename, you must use * .c_str() before passing it to this constructor. */ explicit basic_fstream(const char* __s, ios_base::openmode __mode = ios_base::in | ios_base::out) : __iostream_type(0), _M_filebuf() { this->init(&_M_filebuf); this->open(__s, __mode); } #if __cplusplus >= 201103L /** * @brief Create an input/output file stream. * @param __s Null terminated string specifying the filename. * @param __mode Open file in specified mode (see std::ios_base). */ explicit basic_fstream(const std::string& __s, ios_base::openmode __mode = ios_base::in | ios_base::out) : __iostream_type(0), _M_filebuf() { this->init(&_M_filebuf); this->open(__s, __mode); } basic_fstream(const basic_fstream&) = delete; basic_fstream(basic_fstream&& __rhs) : __iostream_type(std::move(__rhs)), _M_filebuf(std::move(__rhs._M_filebuf)) { __iostream_type::set_rdbuf(&_M_filebuf); } #endif # 932 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/fstream" 3 /** * @brief The destructor does nothing. * * The file is closed by the filebuf object, not the formatting * stream. */ ~basic_fstream() { } #if __cplusplus >= 201103L // 27.8.3.2 Assign and swap: basic_fstream& operator=(const basic_fstream&) = delete; basic_fstream& operator=(basic_fstream&& __rhs) { __iostream_type::operator=(std::move(__rhs)); _M_filebuf = std::move(__rhs._M_filebuf); return *this; } void swap(basic_fstream& __rhs) { __iostream_type::swap(__rhs); _M_filebuf.swap(__rhs._M_filebuf); } #endif # 963 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/fstream" 3 // Members: /** * @brief Accessing the underlying buffer. * @return The current basic_filebuf buffer. * * This hides both signatures of std::basic_ios::rdbuf(). */ __filebuf_type* rdbuf() const { return const_cast<__filebuf_type*>(&_M_filebuf); } /** * @brief Wrapper to test for an open file. * @return @c rdbuf()->is_open() */ bool is_open() { return _M_filebuf.is_open(); } // _GLIBCXX_RESOLVE_LIB_DEFECTS // 365. Lack of const-qualification in clause 27 bool is_open() const { return _M_filebuf.is_open(); } /** * @brief Opens an external file. * @param __s The name of the file. * @param __mode The open mode flags. * * Calls @c std::basic_filebuf::open(__s,__mode). If that * function fails, @c failbit is set in the stream's error state. * * Tip: When using std::string to hold the filename, you must use * .c_str() before passing it to this constructor. */ void open(const char* __s, ios_base::openmode __mode = ios_base::in | ios_base::out) { if (!_M_filebuf.open(__s, __mode)) this->setstate(ios_base::failbit); else // _GLIBCXX_RESOLVE_LIB_DEFECTS // 409. Closing an fstream should clear error state this->clear(); } #if __cplusplus >= 201103L /** * @brief Opens an external file. * @param __s The name of the file. * @param __mode The open mode flags. * * Calls @c std::basic_filebuf::open(__s,__mode). If that * function fails, @c failbit is set in the stream's error state. */ void open(const std::string& __s, ios_base::openmode __mode = ios_base::in | ios_base::out) { if (!_M_filebuf.open(__s, __mode)) this->setstate(ios_base::failbit); else // _GLIBCXX_RESOLVE_LIB_DEFECTS // 409. Closing an fstream should clear error state this->clear(); } #endif # 1033 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/fstream" 3 /** * @brief Close the file. * * Calls @c std::basic_filebuf::close(). If that function * fails, @c failbit is set in the stream's error state. */ void close() { if (!_M_filebuf.close()) this->setstate(ios_base::failbit); } }; #if __cplusplus >= 201103L /// Swap specialization for filebufs. template inline void swap(basic_filebuf<_CharT, _Traits>& __x, basic_filebuf<_CharT, _Traits>& __y) { __x.swap(__y); } /// Swap specialization for ifstreams. template inline void swap(basic_ifstream<_CharT, _Traits>& __x, basic_ifstream<_CharT, _Traits>& __y) { __x.swap(__y); } /// Swap specialization for ofstreams. template inline void swap(basic_ofstream<_CharT, _Traits>& __x, basic_ofstream<_CharT, _Traits>& __y) { __x.swap(__y); } /// Swap specialization for fstreams. template inline void swap(basic_fstream<_CharT, _Traits>& __x, basic_fstream<_CharT, _Traits>& __y) { __x.swap(__y); } #endif # 1077 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/fstream" 3 _GLIBCXX_END_NAMESPACE_VERSION } // namespace #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 1081 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/fstream" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/fstream.tcc" 1 3 // File based streams -*- C++ -*- // Copyright (C) 1997-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file bits/fstream.tcc * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{fstream} */ // // ISO C++ 14882: 27.8 File-based streams // #ifndef _FSTREAM_TCC #define _FSTREAM_TCC 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 38 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/fstream.tcc" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/fstream.tcc" 3 # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/fstream.tcc" 3 #if 0 /* expanded by -frewrite-includes */ #include // for swap #endif /* expanded by -frewrite-includes */ # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/fstream.tcc" 3 # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/fstream.tcc" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION template void basic_filebuf<_CharT, _Traits>:: _M_allocate_internal_buffer() { // Allocate internal buffer only if one doesn't already exist // (either allocated or provided by the user via setbuf). if (!_M_buf_allocated && !_M_buf) { _M_buf = new char_type[_M_buf_size]; _M_buf_allocated = true; } } template void basic_filebuf<_CharT, _Traits>:: _M_destroy_internal_buffer() throw() { if (_M_buf_allocated) { delete [] _M_buf; _M_buf = 0; _M_buf_allocated = false; } delete [] _M_ext_buf; _M_ext_buf = 0; _M_ext_buf_size = 0; _M_ext_next = 0; _M_ext_end = 0; } template basic_filebuf<_CharT, _Traits>:: basic_filebuf() : __streambuf_type(), _M_lock(), _M_file(&_M_lock), _M_mode(ios_base::openmode(0)), _M_state_beg(), _M_state_cur(), _M_state_last(), _M_buf(0), _M_buf_size(BUFSIZ), _M_buf_allocated(false), _M_reading(false), _M_writing(false), _M_pback(), _M_pback_cur_save(0), _M_pback_end_save(0), _M_pback_init(false), _M_codecvt(0), _M_ext_buf(0), _M_ext_buf_size(0), _M_ext_next(0), _M_ext_end(0) { if (has_facet<__codecvt_type>(this->_M_buf_locale)) _M_codecvt = &use_facet<__codecvt_type>(this->_M_buf_locale); } #if __cplusplus >= 201103L template basic_filebuf<_CharT, _Traits>:: basic_filebuf(basic_filebuf&& __rhs) : __streambuf_type(__rhs), _M_lock(), _M_file(std::move(__rhs._M_file), &_M_lock), _M_mode(std::__exchange(__rhs._M_mode, ios_base::openmode(0))), _M_state_beg(std::move(__rhs._M_state_beg)), _M_state_cur(std::move(__rhs._M_state_cur)), _M_state_last(std::move(__rhs._M_state_last)), _M_buf(std::__exchange(__rhs._M_buf, nullptr)), _M_buf_size(std::__exchange(__rhs._M_buf_size, 1)), _M_buf_allocated(std::__exchange(__rhs._M_buf_allocated, false)), _M_reading(std::__exchange(__rhs._M_reading, false)), _M_writing(std::__exchange(__rhs._M_writing, false)), _M_pback(__rhs._M_pback), _M_pback_cur_save(std::__exchange(__rhs._M_pback_cur_save, nullptr)), _M_pback_end_save(std::__exchange(__rhs._M_pback_end_save, nullptr)), _M_pback_init(std::__exchange(__rhs._M_pback_init, false)), _M_codecvt(__rhs._M_codecvt), _M_ext_buf(std::__exchange(__rhs._M_ext_buf, nullptr)), _M_ext_buf_size(std::__exchange(__rhs._M_ext_buf_size, 0)), _M_ext_next(std::__exchange(__rhs._M_ext_next, nullptr)), _M_ext_end(std::__exchange(__rhs._M_ext_end, nullptr)) { __rhs._M_set_buffer(-1); __rhs._M_state_last = __rhs._M_state_cur = __rhs._M_state_beg; } template basic_filebuf<_CharT, _Traits>& basic_filebuf<_CharT, _Traits>:: operator=(basic_filebuf&& __rhs) { this->close(); __streambuf_type::operator=(__rhs); _M_file.swap(__rhs._M_file); _M_mode = std::__exchange(__rhs._M_mode, ios_base::openmode(0)); _M_state_beg = std::move(__rhs._M_state_beg); _M_state_cur = std::move(__rhs._M_state_cur); _M_state_last = std::move(__rhs._M_state_last); _M_buf = std::__exchange(__rhs._M_buf, nullptr); _M_buf_size = std::__exchange(__rhs._M_buf_size, 1); _M_buf_allocated = std::__exchange(__rhs._M_buf_allocated, false); _M_ext_buf = std::__exchange(__rhs._M_ext_buf, nullptr); _M_ext_buf_size = std::__exchange(__rhs._M_ext_buf_size, 0); _M_ext_next = std::__exchange(__rhs._M_ext_next, nullptr); _M_ext_end = std::__exchange(__rhs._M_ext_end, nullptr); _M_reading = std::__exchange(__rhs._M_reading, false); _M_writing = std::__exchange(__rhs._M_writing, false); _M_pback_cur_save = std::__exchange(__rhs._M_pback_cur_save, nullptr); _M_pback_end_save = std::__exchange(__rhs._M_pback_end_save, nullptr); _M_pback_init = std::__exchange(__rhs._M_pback_init, false); __rhs._M_set_buffer(-1); __rhs._M_state_last = __rhs._M_state_cur = __rhs._M_state_beg; return *this; } template void basic_filebuf<_CharT, _Traits>:: swap(basic_filebuf& __rhs) { __streambuf_type::swap(__rhs); _M_file.swap(__rhs._M_file); std::swap(_M_mode, __rhs._M_mode); std::swap(_M_state_beg, __rhs._M_state_beg); std::swap(_M_state_cur, __rhs._M_state_cur); std::swap(_M_state_last, __rhs._M_state_last); std::swap(_M_buf, __rhs._M_buf); std::swap(_M_buf_size, __rhs._M_buf_size); std::swap(_M_buf_allocated, __rhs._M_buf_allocated); std::swap(_M_ext_buf, __rhs._M_ext_buf); std::swap(_M_ext_buf_size, __rhs._M_ext_buf_size); std::swap(_M_ext_next, __rhs._M_ext_next); std::swap(_M_ext_end, __rhs._M_ext_end); std::swap(_M_reading, __rhs._M_reading); std::swap(_M_writing, __rhs._M_writing); std::swap(_M_pback_cur_save, __rhs._M_pback_cur_save); std::swap(_M_pback_end_save, __rhs._M_pback_end_save); std::swap(_M_pback_init, __rhs._M_pback_init); } #endif # 175 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/fstream.tcc" 3 template typename basic_filebuf<_CharT, _Traits>::__filebuf_type* basic_filebuf<_CharT, _Traits>:: open(const char* __s, ios_base::openmode __mode) { __filebuf_type *__ret = 0; if (!this->is_open()) { _M_file.open(__s, __mode); if (this->is_open()) { _M_allocate_internal_buffer(); _M_mode = __mode; // Setup initial buffer to 'uncommitted' mode. _M_reading = false; _M_writing = false; _M_set_buffer(-1); // Reset to initial state. _M_state_last = _M_state_cur = _M_state_beg; // 27.8.1.3,4 if ((__mode & ios_base::ate) && this->seekoff(0, ios_base::end, __mode) == pos_type(off_type(-1))) this->close(); else __ret = this; } } return __ret; } template typename basic_filebuf<_CharT, _Traits>::__filebuf_type* basic_filebuf<_CharT, _Traits>:: close() { if (!this->is_open()) return 0; bool __testfail = false; { // NB: Do this here so that re-opened filebufs will be cool... struct __close_sentry { basic_filebuf *__fb; __close_sentry (basic_filebuf *__fbi): __fb(__fbi) { } ~__close_sentry () { __fb->_M_mode = ios_base::openmode(0); __fb->_M_pback_init = false; __fb->_M_destroy_internal_buffer(); __fb->_M_reading = false; __fb->_M_writing = false; __fb->_M_set_buffer(-1); __fb->_M_state_last = __fb->_M_state_cur = __fb->_M_state_beg; } } __cs (this); __try { if (!_M_terminate_output()) __testfail = true; } __catch(__cxxabiv1::__forced_unwind&) { _M_file.close(); __throw_exception_again; } __catch(...) { __testfail = true; } } if (!_M_file.close()) __testfail = true; if (__testfail) return 0; else return this; } template streamsize basic_filebuf<_CharT, _Traits>:: showmanyc() { streamsize __ret = -1; const bool __testin = _M_mode & ios_base::in; if (__testin && this->is_open()) { // For a stateful encoding (-1) the pending sequence might be just // shift and unshift prefixes with no actual character. __ret = this->egptr() - this->gptr(); #if _GLIBCXX_HAVE_DOS_BASED_FILESYSTEM // About this workaround, see libstdc++/20806. const bool __testbinary = _M_mode & ios_base::binary; if (__check_facet(_M_codecvt).encoding() >= 0 && __testbinary) #else # 279 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/fstream.tcc" 3 if (__check_facet(_M_codecvt).encoding() >= 0) #endif # 281 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/fstream.tcc" 3 __ret += _M_file.showmanyc() / _M_codecvt->max_length(); } return __ret; } template typename basic_filebuf<_CharT, _Traits>::int_type basic_filebuf<_CharT, _Traits>:: underflow() { int_type __ret = traits_type::eof(); const bool __testin = _M_mode & ios_base::in; if (__testin) { if (_M_writing) { if (overflow() == traits_type::eof()) return __ret; _M_set_buffer(-1); _M_writing = false; } // Check for pback madness, and if so switch back to the // normal buffers and jet outta here before expensive // fileops happen... _M_destroy_pback(); if (this->gptr() < this->egptr()) return traits_type::to_int_type(*this->gptr()); // Get and convert input sequence. const size_t __buflen = _M_buf_size > 1 ? _M_buf_size - 1 : 1; // Will be set to true if ::read() returns 0 indicating EOF. bool __got_eof = false; // Number of internal characters produced. streamsize __ilen = 0; codecvt_base::result __r = codecvt_base::ok; if (__check_facet(_M_codecvt).always_noconv()) { __ilen = _M_file.xsgetn(reinterpret_cast(this->eback()), __buflen); if (__ilen == 0) __got_eof = true; } else { // Worst-case number of external bytes. // XXX Not done encoding() == -1. const int __enc = _M_codecvt->encoding(); streamsize __blen; // Minimum buffer size. streamsize __rlen; // Number of chars to read. if (__enc > 0) __blen = __rlen = __buflen * __enc; else { __blen = __buflen + _M_codecvt->max_length() - 1; __rlen = __buflen; } const streamsize __remainder = _M_ext_end - _M_ext_next; __rlen = __rlen > __remainder ? __rlen - __remainder : 0; // An imbue in 'read' mode implies first converting the external // chars already present. if (_M_reading && this->egptr() == this->eback() && __remainder) __rlen = 0; // Allocate buffer if necessary and move unconverted // bytes to front. if (_M_ext_buf_size < __blen) { char* __buf = new char[__blen]; if (__remainder) __builtin_memcpy(__buf, _M_ext_next, __remainder); delete [] _M_ext_buf; _M_ext_buf = __buf; _M_ext_buf_size = __blen; } else if (__remainder) __builtin_memmove(_M_ext_buf, _M_ext_next, __remainder); _M_ext_next = _M_ext_buf; _M_ext_end = _M_ext_buf + __remainder; _M_state_last = _M_state_cur; do { if (__rlen > 0) { // Sanity check! // This may fail if the return value of // codecvt::max_length() is bogus. if (_M_ext_end - _M_ext_buf + __rlen > _M_ext_buf_size) { __throw_ios_failure(__N("basic_filebuf::underflow " "codecvt::max_length() " "is not valid")); } streamsize __elen = _M_file.xsgetn(_M_ext_end, __rlen); if (__elen == 0) __got_eof = true; else if (__elen == -1) break; _M_ext_end += __elen; } char_type* __iend = this->eback(); if (_M_ext_next < _M_ext_end) __r = _M_codecvt->in(_M_state_cur, _M_ext_next, _M_ext_end, _M_ext_next, this->eback(), this->eback() + __buflen, __iend); if (__r == codecvt_base::noconv) { size_t __avail = _M_ext_end - _M_ext_buf; __ilen = std::min(__avail, __buflen); traits_type::copy(this->eback(), reinterpret_cast (_M_ext_buf), __ilen); _M_ext_next = _M_ext_buf + __ilen; } else __ilen = __iend - this->eback(); // _M_codecvt->in may return error while __ilen > 0: this is // ok, and actually occurs in case of mixed encodings (e.g., // XML files). if (__r == codecvt_base::error) break; __rlen = 1; } while (__ilen == 0 && !__got_eof); } if (__ilen > 0) { _M_set_buffer(__ilen); _M_reading = true; __ret = traits_type::to_int_type(*this->gptr()); } else if (__got_eof) { // If the actual end of file is reached, set 'uncommitted' // mode, thus allowing an immediate write without an // intervening seek. _M_set_buffer(-1); _M_reading = false; // However, reaching it while looping on partial means that // the file has got an incomplete character. if (__r == codecvt_base::partial) __throw_ios_failure(__N("basic_filebuf::underflow " "incomplete character in file")); } else if (__r == codecvt_base::error) __throw_ios_failure(__N("basic_filebuf::underflow " "invalid byte sequence in file")); else __throw_ios_failure(__N("basic_filebuf::underflow " "error reading the file")); } return __ret; } template typename basic_filebuf<_CharT, _Traits>::int_type basic_filebuf<_CharT, _Traits>:: pbackfail(int_type __i) { int_type __ret = traits_type::eof(); const bool __testin = _M_mode & ios_base::in; if (__testin) { if (_M_writing) { if (overflow() == traits_type::eof()) return __ret; _M_set_buffer(-1); _M_writing = false; } // Remember whether the pback buffer is active, otherwise below // we may try to store in it a second char (libstdc++/9761). const bool __testpb = _M_pback_init; const bool __testeof = traits_type::eq_int_type(__i, __ret); int_type __tmp; if (this->eback() < this->gptr()) { this->gbump(-1); __tmp = traits_type::to_int_type(*this->gptr()); } else if (this->seekoff(-1, ios_base::cur) != pos_type(off_type(-1))) { __tmp = this->underflow(); if (traits_type::eq_int_type(__tmp, __ret)) return __ret; } else { // At the beginning of the buffer, need to make a // putback position available. But the seek may fail // (f.i., at the beginning of a file, see // libstdc++/9439) and in that case we return // traits_type::eof(). return __ret; } // Try to put back __i into input sequence in one of three ways. // Order these tests done in is unspecified by the standard. if (!__testeof && traits_type::eq_int_type(__i, __tmp)) __ret = __i; else if (__testeof) __ret = traits_type::not_eof(__i); else if (!__testpb) { _M_create_pback(); _M_reading = true; *this->gptr() = traits_type::to_char_type(__i); __ret = __i; } } return __ret; } template typename basic_filebuf<_CharT, _Traits>::int_type basic_filebuf<_CharT, _Traits>:: overflow(int_type __c) { int_type __ret = traits_type::eof(); const bool __testeof = traits_type::eq_int_type(__c, __ret); const bool __testout = (_M_mode & ios_base::out || _M_mode & ios_base::app); if (__testout) { if (_M_reading) { _M_destroy_pback(); const int __gptr_off = _M_get_ext_pos(_M_state_last); if (_M_seek(__gptr_off, ios_base::cur, _M_state_last) == pos_type(off_type(-1))) return __ret; } if (this->pbase() < this->pptr()) { // If appropriate, append the overflow char. if (!__testeof) { *this->pptr() = traits_type::to_char_type(__c); this->pbump(1); } // Convert pending sequence to external representation, // and output. if (_M_convert_to_external(this->pbase(), this->pptr() - this->pbase())) { _M_set_buffer(0); __ret = traits_type::not_eof(__c); } } else if (_M_buf_size > 1) { // Overflow in 'uncommitted' mode: set _M_writing, set // the buffer to the initial 'write' mode, and put __c // into the buffer. _M_set_buffer(0); _M_writing = true; if (!__testeof) { *this->pptr() = traits_type::to_char_type(__c); this->pbump(1); } __ret = traits_type::not_eof(__c); } else { // Unbuffered. char_type __conv = traits_type::to_char_type(__c); if (__testeof || _M_convert_to_external(&__conv, 1)) { _M_writing = true; __ret = traits_type::not_eof(__c); } } } return __ret; } template bool basic_filebuf<_CharT, _Traits>:: _M_convert_to_external(_CharT* __ibuf, streamsize __ilen) { // Sizes of external and pending output. streamsize __elen; streamsize __plen; if (__check_facet(_M_codecvt).always_noconv()) { __elen = _M_file.xsputn(reinterpret_cast(__ibuf), __ilen); __plen = __ilen; } else { // Worst-case number of external bytes needed. // XXX Not done encoding() == -1. streamsize __blen = __ilen * _M_codecvt->max_length(); char* __buf = static_cast(__builtin_alloca(__blen)); char* __bend; const char_type* __iend; codecvt_base::result __r; __r = _M_codecvt->out(_M_state_cur, __ibuf, __ibuf + __ilen, __iend, __buf, __buf + __blen, __bend); if (__r == codecvt_base::ok || __r == codecvt_base::partial) __blen = __bend - __buf; else if (__r == codecvt_base::noconv) { // Same as the always_noconv case above. __buf = reinterpret_cast(__ibuf); __blen = __ilen; } else __throw_ios_failure(__N("basic_filebuf::_M_convert_to_external " "conversion error")); __elen = _M_file.xsputn(__buf, __blen); __plen = __blen; // Try once more for partial conversions. if (__r == codecvt_base::partial && __elen == __plen) { const char_type* __iresume = __iend; streamsize __rlen = this->pptr() - __iend; __r = _M_codecvt->out(_M_state_cur, __iresume, __iresume + __rlen, __iend, __buf, __buf + __blen, __bend); if (__r != codecvt_base::error) { __rlen = __bend - __buf; __elen = _M_file.xsputn(__buf, __rlen); __plen = __rlen; } else __throw_ios_failure(__N("basic_filebuf::_M_convert_to_external " "conversion error")); } } return __elen == __plen; } template streamsize basic_filebuf<_CharT, _Traits>:: xsgetn(_CharT* __s, streamsize __n) { // Clear out pback buffer before going on to the real deal... streamsize __ret = 0; if (_M_pback_init) { if (__n > 0 && this->gptr() == this->eback()) { *__s++ = *this->gptr(); // emulate non-underflowing sbumpc this->gbump(1); __ret = 1; --__n; } _M_destroy_pback(); } else if (_M_writing) { if (overflow() == traits_type::eof()) return __ret; _M_set_buffer(-1); _M_writing = false; } // Optimization in the always_noconv() case, to be generalized in the // future: when __n > __buflen we read directly instead of using the // buffer repeatedly. const bool __testin = _M_mode & ios_base::in; const streamsize __buflen = _M_buf_size > 1 ? _M_buf_size - 1 : 1; if (__n > __buflen && __check_facet(_M_codecvt).always_noconv() && __testin) { // First, copy the chars already present in the buffer. const streamsize __avail = this->egptr() - this->gptr(); if (__avail != 0) { traits_type::copy(__s, this->gptr(), __avail); __s += __avail; this->setg(this->eback(), this->gptr() + __avail, this->egptr()); __ret += __avail; __n -= __avail; } // Need to loop in case of short reads (relatively common // with pipes). streamsize __len; for (;;) { __len = _M_file.xsgetn(reinterpret_cast(__s), __n); if (__len == -1) __throw_ios_failure(__N("basic_filebuf::xsgetn " "error reading the file")); if (__len == 0) break; __n -= __len; __ret += __len; if (__n == 0) break; __s += __len; } if (__n == 0) { _M_set_buffer(0); _M_reading = true; } else if (__len == 0) { // If end of file is reached, set 'uncommitted' // mode, thus allowing an immediate write without // an intervening seek. _M_set_buffer(-1); _M_reading = false; } } else __ret += __streambuf_type::xsgetn(__s, __n); return __ret; } template streamsize basic_filebuf<_CharT, _Traits>:: xsputn(const _CharT* __s, streamsize __n) { streamsize __ret = 0; // Optimization in the always_noconv() case, to be generalized in the // future: when __n is sufficiently large we write directly instead of // using the buffer. const bool __testout = (_M_mode & ios_base::out || _M_mode & ios_base::app); if (__check_facet(_M_codecvt).always_noconv() && __testout && !_M_reading) { // Measurement would reveal the best choice. const streamsize __chunk = 1ul << 10; streamsize __bufavail = this->epptr() - this->pptr(); // Don't mistake 'uncommitted' mode buffered with unbuffered. if (!_M_writing && _M_buf_size > 1) __bufavail = _M_buf_size - 1; const streamsize __limit = std::min(__chunk, __bufavail); if (__n >= __limit) { const streamsize __buffill = this->pptr() - this->pbase(); const char* __buf = reinterpret_cast(this->pbase()); __ret = _M_file.xsputn_2(__buf, __buffill, reinterpret_cast(__s), __n); if (__ret == __buffill + __n) { _M_set_buffer(0); _M_writing = true; } if (__ret > __buffill) __ret -= __buffill; else __ret = 0; } else __ret = __streambuf_type::xsputn(__s, __n); } else __ret = __streambuf_type::xsputn(__s, __n); return __ret; } template typename basic_filebuf<_CharT, _Traits>::__streambuf_type* basic_filebuf<_CharT, _Traits>:: setbuf(char_type* __s, streamsize __n) { if (!this->is_open()) { if (__s == 0 && __n == 0) _M_buf_size = 1; else if (__s && __n > 0) { // This is implementation-defined behavior, and assumes that // an external char_type array of length __n exists and has // been pre-allocated. If this is not the case, things will // quickly blow up. When __n > 1, __n - 1 positions will be // used for the get area, __n - 1 for the put area and 1 // position to host the overflow char of a full put area. // When __n == 1, 1 position will be used for the get area // and 0 for the put area, as in the unbuffered case above. _M_buf = __s; _M_buf_size = __n; } } return this; } // According to 27.8.1.4 p11 - 13, seekoff should ignore the last // argument (of type openmode). template typename basic_filebuf<_CharT, _Traits>::pos_type basic_filebuf<_CharT, _Traits>:: seekoff(off_type __off, ios_base::seekdir __way, ios_base::openmode) { int __width = 0; if (_M_codecvt) __width = _M_codecvt->encoding(); if (__width < 0) __width = 0; pos_type __ret = pos_type(off_type(-1)); const bool __testfail = __off != 0 && __width <= 0; if (this->is_open() && !__testfail) { // tellg and tellp queries do not affect any state, unless // ! always_noconv and the put sequence is not empty. // In that case, determining the position requires converting the // put sequence. That doesn't use ext_buf, so requires a flush. bool __no_movement = __way == ios_base::cur && __off == 0 && (!_M_writing || _M_codecvt->always_noconv()); // Ditch any pback buffers to avoid confusion. if (!__no_movement) _M_destroy_pback(); // Correct state at destination. Note that this is the correct // state for the current position during output, because // codecvt::unshift() returns the state to the initial state. // This is also the correct state at the end of the file because // an unshift sequence should have been written at the end. __state_type __state = _M_state_beg; off_type __computed_off = __off * __width; if (_M_reading && __way == ios_base::cur) { __state = _M_state_last; __computed_off += _M_get_ext_pos(__state); } if (!__no_movement) __ret = _M_seek(__computed_off, __way, __state); else { if (_M_writing) __computed_off = this->pptr() - this->pbase(); off_type __file_off = _M_file.seekoff(0, ios_base::cur); if (__file_off != off_type(-1)) { __ret = __file_off + __computed_off; __ret.state(__state); } } } return __ret; } // _GLIBCXX_RESOLVE_LIB_DEFECTS // 171. Strange seekpos() semantics due to joint position // According to the resolution of DR 171, seekpos should ignore the last // argument (of type openmode). template typename basic_filebuf<_CharT, _Traits>::pos_type basic_filebuf<_CharT, _Traits>:: seekpos(pos_type __pos, ios_base::openmode) { pos_type __ret = pos_type(off_type(-1)); if (this->is_open()) { // Ditch any pback buffers to avoid confusion. _M_destroy_pback(); __ret = _M_seek(off_type(__pos), ios_base::beg, __pos.state()); } return __ret; } template typename basic_filebuf<_CharT, _Traits>::pos_type basic_filebuf<_CharT, _Traits>:: _M_seek(off_type __off, ios_base::seekdir __way, __state_type __state) { pos_type __ret = pos_type(off_type(-1)); if (_M_terminate_output()) { off_type __file_off = _M_file.seekoff(__off, __way); if (__file_off != off_type(-1)) { _M_reading = false; _M_writing = false; _M_ext_next = _M_ext_end = _M_ext_buf; _M_set_buffer(-1); _M_state_cur = __state; __ret = __file_off; __ret.state(_M_state_cur); } } return __ret; } // Returns the distance from the end of the ext buffer to the point // corresponding to gptr(). This is a negative value. Updates __state // from eback() correspondence to gptr(). template int basic_filebuf<_CharT, _Traits>:: _M_get_ext_pos(__state_type& __state) { if (_M_codecvt->always_noconv()) return this->gptr() - this->egptr(); else { // Calculate offset from _M_ext_buf that corresponds to // gptr(). Precondition: __state == _M_state_last, which // corresponds to eback(). const int __gptr_off = _M_codecvt->length(__state, _M_ext_buf, _M_ext_next, this->gptr() - this->eback()); return _M_ext_buf + __gptr_off - _M_ext_end; } } template bool basic_filebuf<_CharT, _Traits>:: _M_terminate_output() { // Part one: update the output sequence. bool __testvalid = true; if (this->pbase() < this->pptr()) { const int_type __tmp = this->overflow(); if (traits_type::eq_int_type(__tmp, traits_type::eof())) __testvalid = false; } // Part two: output unshift sequence. if (_M_writing && !__check_facet(_M_codecvt).always_noconv() && __testvalid) { // Note: this value is arbitrary, since there is no way to // get the length of the unshift sequence from codecvt, // without calling unshift. const size_t __blen = 128; char __buf[__blen]; codecvt_base::result __r; streamsize __ilen = 0; do { char* __next; __r = _M_codecvt->unshift(_M_state_cur, __buf, __buf + __blen, __next); if (__r == codecvt_base::error) __testvalid = false; else if (__r == codecvt_base::ok || __r == codecvt_base::partial) { __ilen = __next - __buf; if (__ilen > 0) { const streamsize __elen = _M_file.xsputn(__buf, __ilen); if (__elen != __ilen) __testvalid = false; } } } while (__r == codecvt_base::partial && __ilen > 0 && __testvalid); if (__testvalid) { // This second call to overflow() is required by the standard, // but it's not clear why it's needed, since the output buffer // should be empty by this point (it should have been emptied // in the first call to overflow()). const int_type __tmp = this->overflow(); if (traits_type::eq_int_type(__tmp, traits_type::eof())) __testvalid = false; } } return __testvalid; } template int basic_filebuf<_CharT, _Traits>:: sync() { // Make sure that the internal buffer resyncs its idea of // the file position with the external file. int __ret = 0; if (this->pbase() < this->pptr()) { const int_type __tmp = this->overflow(); if (traits_type::eq_int_type(__tmp, traits_type::eof())) __ret = -1; } return __ret; } template void basic_filebuf<_CharT, _Traits>:: imbue(const locale& __loc) { bool __testvalid = true; const __codecvt_type* _M_codecvt_tmp = 0; if (__builtin_expect(has_facet<__codecvt_type>(__loc), true)) _M_codecvt_tmp = &use_facet<__codecvt_type>(__loc); if (this->is_open()) { // encoding() == -1 is ok only at the beginning. if ((_M_reading || _M_writing) && __check_facet(_M_codecvt).encoding() == -1) __testvalid = false; else { if (_M_reading) { if (__check_facet(_M_codecvt).always_noconv()) { if (_M_codecvt_tmp && !__check_facet(_M_codecvt_tmp).always_noconv()) __testvalid = this->seekoff(0, ios_base::cur, _M_mode) != pos_type(off_type(-1)); } else { // External position corresponding to gptr(). _M_ext_next = _M_ext_buf + _M_codecvt->length(_M_state_last, _M_ext_buf, _M_ext_next, this->gptr() - this->eback()); const streamsize __remainder = _M_ext_end - _M_ext_next; if (__remainder) __builtin_memmove(_M_ext_buf, _M_ext_next, __remainder); _M_ext_next = _M_ext_buf; _M_ext_end = _M_ext_buf + __remainder; _M_set_buffer(-1); _M_state_last = _M_state_cur = _M_state_beg; } } else if (_M_writing && (__testvalid = _M_terminate_output())) _M_set_buffer(-1); } } if (__testvalid) _M_codecvt = _M_codecvt_tmp; else _M_codecvt = 0; } // Inhibit implicit instantiations for required instantiations, // which are defined via explicit instantiations elsewhere. #if _GLIBCXX_EXTERN_TEMPLATE extern template class basic_filebuf; extern template class basic_ifstream; extern template class basic_ofstream; extern template class basic_fstream; #ifdef _GLIBCXX_USE_WCHAR_T extern template class basic_filebuf; extern template class basic_ifstream; extern template class basic_ofstream; extern template class basic_fstream; #endif # 1064 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/fstream.tcc" 3 #endif # 1065 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/fstream.tcc" 3 _GLIBCXX_END_NAMESPACE_VERSION } // namespace std #endif # 1070 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/fstream.tcc" 3 # 1082 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/fstream" 2 3 #endif /* _GLIBCXX_FSTREAM */ # 1084 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/fstream" 3 # 10 "./OFM.cpp" 2 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 10 "./OFM.cpp" # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/sstream" 1 3 // String based streams -*- C++ -*- // Copyright (C) 1997-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file include/sstream * This is a Standard C++ Library header. */ // // ISO C++ 14882: 27.7 String-based streams // #ifndef _GLIBCXX_SSTREAM #define _GLIBCXX_SSTREAM 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 37 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/sstream" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 38 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/sstream" 3 # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/sstream" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/sstream" 3 # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/sstream" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION _GLIBCXX_BEGIN_NAMESPACE_CXX11 // [27.7.1] template class basic_stringbuf /** * @brief The actual work of input and output (for std::string). * @ingroup io * * @tparam _CharT Type of character stream. * @tparam _Traits Traits for character type, defaults to * char_traits<_CharT>. * @tparam _Alloc Allocator type, defaults to allocator<_CharT>. * * This class associates either or both of its input and output sequences * with a sequence of characters, which can be initialized from, or made * available as, a @c std::basic_string. (Paraphrased from [27.7.1]/1.) * * For this class, open modes (of type @c ios_base::openmode) have * @c in set if the input sequence can be read, and @c out set if the * output sequence can be written. */ template class basic_stringbuf : public basic_streambuf<_CharT, _Traits> { struct __xfer_bufptrs; public: // Types: typedef _CharT char_type; typedef _Traits traits_type; // _GLIBCXX_RESOLVE_LIB_DEFECTS // 251. basic_stringbuf missing allocator_type typedef _Alloc allocator_type; typedef typename traits_type::int_type int_type; typedef typename traits_type::pos_type pos_type; typedef typename traits_type::off_type off_type; typedef basic_streambuf __streambuf_type; typedef basic_string __string_type; typedef typename __string_type::size_type __size_type; protected: /// Place to stash in || out || in | out settings for current stringbuf. ios_base::openmode _M_mode; // Data Members: __string_type _M_string; public: // Constructors: /** * @brief Starts with an empty string buffer. * @param __mode Whether the buffer can read, or write, or both. * * The default constructor initializes the parent class using its * own default ctor. */ explicit basic_stringbuf(ios_base::openmode __mode = ios_base::in | ios_base::out) : __streambuf_type(), _M_mode(__mode), _M_string() { } /** * @brief Starts with an existing string buffer. * @param __str A string to copy as a starting buffer. * @param __mode Whether the buffer can read, or write, or both. * * This constructor initializes the parent class using its * own default ctor. */ explicit basic_stringbuf(const __string_type& __str, ios_base::openmode __mode = ios_base::in | ios_base::out) : __streambuf_type(), _M_mode(), _M_string(__str.data(), __str.size()) { _M_stringbuf_init(__mode); } #if __cplusplus >= 201103L basic_stringbuf(const basic_stringbuf&) = delete; basic_stringbuf(basic_stringbuf&& __rhs) : basic_stringbuf(std::move(__rhs), __xfer_bufptrs(__rhs, this)) { __rhs._M_sync(const_cast(__rhs._M_string.data()), 0, 0); } // 27.8.2.2 Assign and swap: basic_stringbuf& operator=(const basic_stringbuf&) = delete; basic_stringbuf& operator=(basic_stringbuf&& __rhs) { __xfer_bufptrs __st{__rhs, this}; const __streambuf_type& __base = __rhs; __streambuf_type::operator=(__base); this->pubimbue(__rhs.getloc()); _M_mode = __rhs._M_mode; _M_string = std::move(__rhs._M_string); __rhs._M_sync(const_cast(__rhs._M_string.data()), 0, 0); return *this; } void swap(basic_stringbuf& __rhs) { __xfer_bufptrs __l_st{*this, std::__addressof(__rhs)}; __xfer_bufptrs __r_st{__rhs, this}; __streambuf_type& __base = __rhs; __streambuf_type::swap(__base); __rhs.pubimbue(this->pubimbue(__rhs.getloc())); std::swap(_M_mode, __rhs._M_mode); std::swap(_M_string, __rhs._M_string); } #endif # 155 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/sstream" 3 // Get and set: /** * @brief Copying out the string buffer. * @return A copy of one of the underlying sequences. * * If the buffer is only created in input mode, the underlying * character sequence is equal to the input sequence; otherwise, it * is equal to the output sequence. [27.7.1.2]/1 */ __string_type str() const { __string_type __ret; if (this->pptr()) { // The current egptr() may not be the actual string end. if (this->pptr() > this->egptr()) __ret = __string_type(this->pbase(), this->pptr()); else __ret = __string_type(this->pbase(), this->egptr()); } else __ret = _M_string; return __ret; } /** * @brief Setting a new buffer. * @param __s The string to use as a new sequence. * * Deallocates any previous stored sequence, then copies @a s to * use as a new one. */ void str(const __string_type& __s) { // Cannot use _M_string = __s, since v3 strings are COW // (not always true now but assign() always works). _M_string.assign(__s.data(), __s.size()); _M_stringbuf_init(_M_mode); } protected: // Common initialization code goes here. void _M_stringbuf_init(ios_base::openmode __mode) { _M_mode = __mode; __size_type __len = 0; if (_M_mode & (ios_base::ate | ios_base::app)) __len = _M_string.size(); _M_sync(const_cast(_M_string.data()), 0, __len); } virtual streamsize showmanyc() { streamsize __ret = -1; if (_M_mode & ios_base::in) { _M_update_egptr(); __ret = this->egptr() - this->gptr(); } return __ret; } virtual int_type underflow(); virtual int_type pbackfail(int_type __c = traits_type::eof()); virtual int_type overflow(int_type __c = traits_type::eof()); /** * @brief Manipulates the buffer. * @param __s Pointer to a buffer area. * @param __n Size of @a __s. * @return @c this * * If no buffer has already been created, and both @a __s and @a __n are * non-zero, then @c __s is used as a buffer; see * https://gcc.gnu.org/onlinedocs/libstdc++/manual/streambufs.html#io.streambuf.buffering * for more. */ virtual __streambuf_type* setbuf(char_type* __s, streamsize __n) { if (__s && __n >= 0) { // This is implementation-defined behavior, and assumes // that an external char_type array of length __n exists // and has been pre-allocated. If this is not the case, // things will quickly blow up. // Step 1: Destroy the current internal array. _M_string.clear(); // Step 2: Use the external array. _M_sync(__s, __n, 0); } return this; } virtual pos_type seekoff(off_type __off, ios_base::seekdir __way, ios_base::openmode __mode = ios_base::in | ios_base::out); virtual pos_type seekpos(pos_type __sp, ios_base::openmode __mode = ios_base::in | ios_base::out); // Internal function for correctly updating the internal buffer // for a particular _M_string, due to initialization or re-sizing // of an existing _M_string. void _M_sync(char_type* __base, __size_type __i, __size_type __o); // Internal function for correctly updating egptr() to the actual // string end. void _M_update_egptr() { const bool __testin = _M_mode & ios_base::in; if (this->pptr() && this->pptr() > this->egptr()) { if (__testin) this->setg(this->eback(), this->gptr(), this->pptr()); else this->setg(this->pptr(), this->pptr(), this->pptr()); } } // Works around the issue with pbump, part of the protected // interface of basic_streambuf, taking just an int. void _M_pbump(char_type* __pbeg, char_type* __pend, off_type __off); private: #if __cplusplus >= 201103L #if _GLIBCXX_USE_CXX11_ABI // This type captures the state of the gptr / pptr pointers as offsets // so they can be restored in another object after moving the string. struct __xfer_bufptrs { __xfer_bufptrs(const basic_stringbuf& __from, basic_stringbuf* __to) : _M_to{__to}, _M_goff{-1, -1, -1}, _M_poff{-1, -1, -1} { const _CharT* __str = __from._M_string.data(); if (__from.eback()) { _M_goff[0] = __from.eback() - __str; _M_goff[1] = __from.gptr() - __str; _M_goff[2] = __from.egptr() - __str; } if (__from.pbase()) { _M_poff[0] = __from.pbase() - __str; _M_poff[1] = __from.pptr() - __from.pbase(); _M_poff[2] = __from.epptr() - __str; } } ~__xfer_bufptrs() { char_type* __str = const_cast(_M_to->_M_string.data()); if (_M_goff[0] != -1) _M_to->setg(__str+_M_goff[0], __str+_M_goff[1], __str+_M_goff[2]); if (_M_poff[0] != -1) _M_to->_M_pbump(__str+_M_poff[0], __str+_M_poff[2], _M_poff[1]); } basic_stringbuf* _M_to; off_type _M_goff[3]; off_type _M_poff[3]; }; #else # 334 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/sstream" 3 // This type does nothing when using Copy-On-Write strings. struct __xfer_bufptrs { __xfer_bufptrs(const basic_stringbuf&, basic_stringbuf*) { } }; #endif # 340 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/sstream" 3 // The move constructor initializes an __xfer_bufptrs temporary then // delegates to this constructor to performs moves during its lifetime. basic_stringbuf(basic_stringbuf&& __rhs, __xfer_bufptrs&&) : __streambuf_type(static_cast(__rhs)), _M_mode(__rhs._M_mode), _M_string(std::move(__rhs._M_string)) { } #endif # 348 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/sstream" 3 }; // [27.7.2] Template class basic_istringstream /** * @brief Controlling input for std::string. * @ingroup io * * @tparam _CharT Type of character stream. * @tparam _Traits Traits for character type, defaults to * char_traits<_CharT>. * @tparam _Alloc Allocator type, defaults to allocator<_CharT>. * * This class supports reading from objects of type std::basic_string, * using the inherited functions from std::basic_istream. To control * the associated sequence, an instance of std::basic_stringbuf is used, * which this page refers to as @c sb. */ template class basic_istringstream : public basic_istream<_CharT, _Traits> { public: // Types: typedef _CharT char_type; typedef _Traits traits_type; // _GLIBCXX_RESOLVE_LIB_DEFECTS // 251. basic_stringbuf missing allocator_type typedef _Alloc allocator_type; typedef typename traits_type::int_type int_type; typedef typename traits_type::pos_type pos_type; typedef typename traits_type::off_type off_type; // Non-standard types: typedef basic_string<_CharT, _Traits, _Alloc> __string_type; typedef basic_stringbuf<_CharT, _Traits, _Alloc> __stringbuf_type; typedef basic_istream __istream_type; private: __stringbuf_type _M_stringbuf; public: // Constructors: /** * @brief Default constructor starts with an empty string buffer. * @param __mode Whether the buffer can read, or write, or both. * * @c ios_base::in is automatically included in @a __mode. * * Initializes @c sb using @c __mode|in, and passes @c &sb to the base * class initializer. Does not allocate any buffer. * * That's a lie. We initialize the base class with NULL, because the * string class does its own memory management. */ explicit basic_istringstream(ios_base::openmode __mode = ios_base::in) : __istream_type(), _M_stringbuf(__mode | ios_base::in) { this->init(&_M_stringbuf); } /** * @brief Starts with an existing string buffer. * @param __str A string to copy as a starting buffer. * @param __mode Whether the buffer can read, or write, or both. * * @c ios_base::in is automatically included in @a mode. * * Initializes @c sb using @a str and @c mode|in, and passes @c &sb * to the base class initializer. * * That's a lie. We initialize the base class with NULL, because the * string class does its own memory management. */ explicit basic_istringstream(const __string_type& __str, ios_base::openmode __mode = ios_base::in) : __istream_type(), _M_stringbuf(__str, __mode | ios_base::in) { this->init(&_M_stringbuf); } /** * @brief The destructor does nothing. * * The buffer is deallocated by the stringbuf object, not the * formatting stream. */ ~basic_istringstream() { } #if __cplusplus >= 201103L basic_istringstream(const basic_istringstream&) = delete; basic_istringstream(basic_istringstream&& __rhs) : __istream_type(std::move(__rhs)), _M_stringbuf(std::move(__rhs._M_stringbuf)) { __istream_type::set_rdbuf(&_M_stringbuf); } // 27.8.3.2 Assign and swap: basic_istringstream& operator=(const basic_istringstream&) = delete; basic_istringstream& operator=(basic_istringstream&& __rhs) { __istream_type::operator=(std::move(__rhs)); _M_stringbuf = std::move(__rhs._M_stringbuf); return *this; } void swap(basic_istringstream& __rhs) { __istream_type::swap(__rhs); _M_stringbuf.swap(__rhs._M_stringbuf); } #endif # 463 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/sstream" 3 // Members: /** * @brief Accessing the underlying buffer. * @return The current basic_stringbuf buffer. * * This hides both signatures of std::basic_ios::rdbuf(). */ __stringbuf_type* rdbuf() const { return const_cast<__stringbuf_type*>(&_M_stringbuf); } /** * @brief Copying out the string buffer. * @return @c rdbuf()->str() */ __string_type str() const { return _M_stringbuf.str(); } /** * @brief Setting a new buffer. * @param __s The string to use as a new sequence. * * Calls @c rdbuf()->str(s). */ void str(const __string_type& __s) { _M_stringbuf.str(__s); } }; // [27.7.3] Template class basic_ostringstream /** * @brief Controlling output for std::string. * @ingroup io * * @tparam _CharT Type of character stream. * @tparam _Traits Traits for character type, defaults to * char_traits<_CharT>. * @tparam _Alloc Allocator type, defaults to allocator<_CharT>. * * This class supports writing to objects of type std::basic_string, * using the inherited functions from std::basic_ostream. To control * the associated sequence, an instance of std::basic_stringbuf is used, * which this page refers to as @c sb. */ template class basic_ostringstream : public basic_ostream<_CharT, _Traits> { public: // Types: typedef _CharT char_type; typedef _Traits traits_type; // _GLIBCXX_RESOLVE_LIB_DEFECTS // 251. basic_stringbuf missing allocator_type typedef _Alloc allocator_type; typedef typename traits_type::int_type int_type; typedef typename traits_type::pos_type pos_type; typedef typename traits_type::off_type off_type; // Non-standard types: typedef basic_string<_CharT, _Traits, _Alloc> __string_type; typedef basic_stringbuf<_CharT, _Traits, _Alloc> __stringbuf_type; typedef basic_ostream __ostream_type; private: __stringbuf_type _M_stringbuf; public: // Constructors/destructor: /** * @brief Default constructor starts with an empty string buffer. * @param __mode Whether the buffer can read, or write, or both. * * @c ios_base::out is automatically included in @a mode. * * Initializes @c sb using @c mode|out, and passes @c &sb to the base * class initializer. Does not allocate any buffer. * * That's a lie. We initialize the base class with NULL, because the * string class does its own memory management. */ explicit basic_ostringstream(ios_base::openmode __mode = ios_base::out) : __ostream_type(), _M_stringbuf(__mode | ios_base::out) { this->init(&_M_stringbuf); } /** * @brief Starts with an existing string buffer. * @param __str A string to copy as a starting buffer. * @param __mode Whether the buffer can read, or write, or both. * * @c ios_base::out is automatically included in @a mode. * * Initializes @c sb using @a str and @c mode|out, and passes @c &sb * to the base class initializer. * * That's a lie. We initialize the base class with NULL, because the * string class does its own memory management. */ explicit basic_ostringstream(const __string_type& __str, ios_base::openmode __mode = ios_base::out) : __ostream_type(), _M_stringbuf(__str, __mode | ios_base::out) { this->init(&_M_stringbuf); } /** * @brief The destructor does nothing. * * The buffer is deallocated by the stringbuf object, not the * formatting stream. */ ~basic_ostringstream() { } #if __cplusplus >= 201103L basic_ostringstream(const basic_ostringstream&) = delete; basic_ostringstream(basic_ostringstream&& __rhs) : __ostream_type(std::move(__rhs)), _M_stringbuf(std::move(__rhs._M_stringbuf)) { __ostream_type::set_rdbuf(&_M_stringbuf); } // 27.8.3.2 Assign and swap: basic_ostringstream& operator=(const basic_ostringstream&) = delete; basic_ostringstream& operator=(basic_ostringstream&& __rhs) { __ostream_type::operator=(std::move(__rhs)); _M_stringbuf = std::move(__rhs._M_stringbuf); return *this; } void swap(basic_ostringstream& __rhs) { __ostream_type::swap(__rhs); _M_stringbuf.swap(__rhs._M_stringbuf); } #endif # 607 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/sstream" 3 // Members: /** * @brief Accessing the underlying buffer. * @return The current basic_stringbuf buffer. * * This hides both signatures of std::basic_ios::rdbuf(). */ __stringbuf_type* rdbuf() const { return const_cast<__stringbuf_type*>(&_M_stringbuf); } /** * @brief Copying out the string buffer. * @return @c rdbuf()->str() */ __string_type str() const { return _M_stringbuf.str(); } /** * @brief Setting a new buffer. * @param __s The string to use as a new sequence. * * Calls @c rdbuf()->str(s). */ void str(const __string_type& __s) { _M_stringbuf.str(__s); } }; // [27.7.4] Template class basic_stringstream /** * @brief Controlling input and output for std::string. * @ingroup io * * @tparam _CharT Type of character stream. * @tparam _Traits Traits for character type, defaults to * char_traits<_CharT>. * @tparam _Alloc Allocator type, defaults to allocator<_CharT>. * * This class supports reading from and writing to objects of type * std::basic_string, using the inherited functions from * std::basic_iostream. To control the associated sequence, an instance * of std::basic_stringbuf is used, which this page refers to as @c sb. */ template class basic_stringstream : public basic_iostream<_CharT, _Traits> { public: // Types: typedef _CharT char_type; typedef _Traits traits_type; // _GLIBCXX_RESOLVE_LIB_DEFECTS // 251. basic_stringbuf missing allocator_type typedef _Alloc allocator_type; typedef typename traits_type::int_type int_type; typedef typename traits_type::pos_type pos_type; typedef typename traits_type::off_type off_type; // Non-standard Types: typedef basic_string<_CharT, _Traits, _Alloc> __string_type; typedef basic_stringbuf<_CharT, _Traits, _Alloc> __stringbuf_type; typedef basic_iostream __iostream_type; private: __stringbuf_type _M_stringbuf; public: // Constructors/destructors /** * @brief Default constructor starts with an empty string buffer. * @param __m Whether the buffer can read, or write, or both. * * Initializes @c sb using the mode from @c __m, and passes @c * &sb to the base class initializer. Does not allocate any * buffer. * * That's a lie. We initialize the base class with NULL, because the * string class does its own memory management. */ explicit basic_stringstream(ios_base::openmode __m = ios_base::out | ios_base::in) : __iostream_type(), _M_stringbuf(__m) { this->init(&_M_stringbuf); } /** * @brief Starts with an existing string buffer. * @param __str A string to copy as a starting buffer. * @param __m Whether the buffer can read, or write, or both. * * Initializes @c sb using @a __str and @c __m, and passes @c &sb * to the base class initializer. * * That's a lie. We initialize the base class with NULL, because the * string class does its own memory management. */ explicit basic_stringstream(const __string_type& __str, ios_base::openmode __m = ios_base::out | ios_base::in) : __iostream_type(), _M_stringbuf(__str, __m) { this->init(&_M_stringbuf); } /** * @brief The destructor does nothing. * * The buffer is deallocated by the stringbuf object, not the * formatting stream. */ ~basic_stringstream() { } #if __cplusplus >= 201103L basic_stringstream(const basic_stringstream&) = delete; basic_stringstream(basic_stringstream&& __rhs) : __iostream_type(std::move(__rhs)), _M_stringbuf(std::move(__rhs._M_stringbuf)) { __iostream_type::set_rdbuf(&_M_stringbuf); } // 27.8.3.2 Assign and swap: basic_stringstream& operator=(const basic_stringstream&) = delete; basic_stringstream& operator=(basic_stringstream&& __rhs) { __iostream_type::operator=(std::move(__rhs)); _M_stringbuf = std::move(__rhs._M_stringbuf); return *this; } void swap(basic_stringstream& __rhs) { __iostream_type::swap(__rhs); _M_stringbuf.swap(__rhs._M_stringbuf); } #endif # 748 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/sstream" 3 // Members: /** * @brief Accessing the underlying buffer. * @return The current basic_stringbuf buffer. * * This hides both signatures of std::basic_ios::rdbuf(). */ __stringbuf_type* rdbuf() const { return const_cast<__stringbuf_type*>(&_M_stringbuf); } /** * @brief Copying out the string buffer. * @return @c rdbuf()->str() */ __string_type str() const { return _M_stringbuf.str(); } /** * @brief Setting a new buffer. * @param __s The string to use as a new sequence. * * Calls @c rdbuf()->str(s). */ void str(const __string_type& __s) { _M_stringbuf.str(__s); } }; #if __cplusplus >= 201103L /// Swap specialization for stringbufs. template inline void swap(basic_stringbuf<_CharT, _Traits, _Allocator>& __x, basic_stringbuf<_CharT, _Traits, _Allocator>& __y) { __x.swap(__y); } /// Swap specialization for istringstreams. template inline void swap(basic_istringstream<_CharT, _Traits, _Allocator>& __x, basic_istringstream<_CharT, _Traits, _Allocator>& __y) { __x.swap(__y); } /// Swap specialization for ostringstreams. template inline void swap(basic_ostringstream<_CharT, _Traits, _Allocator>& __x, basic_ostringstream<_CharT, _Traits, _Allocator>& __y) { __x.swap(__y); } /// Swap specialization for stringstreams. template inline void swap(basic_stringstream<_CharT, _Traits, _Allocator>& __x, basic_stringstream<_CharT, _Traits, _Allocator>& __y) { __x.swap(__y); } #endif # 808 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/sstream" 3 _GLIBCXX_END_NAMESPACE_CXX11 _GLIBCXX_END_NAMESPACE_VERSION } // namespace #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 813 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/sstream" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/sstream.tcc" 1 3 // String based streams -*- C++ -*- // Copyright (C) 1997-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file bits/sstream.tcc * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{sstream} */ // // ISO C++ 14882: 27.7 String-based streams // #ifndef _SSTREAM_TCC #define _SSTREAM_TCC 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 38 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/sstream.tcc" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION template typename basic_stringbuf<_CharT, _Traits, _Alloc>::int_type basic_stringbuf<_CharT, _Traits, _Alloc>:: pbackfail(int_type __c) { int_type __ret = traits_type::eof(); if (this->eback() < this->gptr()) { // Try to put back __c into input sequence in one of three ways. // Order these tests done in is unspecified by the standard. const bool __testeof = traits_type::eq_int_type(__c, __ret); if (!__testeof) { const bool __testeq = traits_type::eq(traits_type:: to_char_type(__c), this->gptr()[-1]); const bool __testout = this->_M_mode & ios_base::out; if (__testeq || __testout) { this->gbump(-1); if (!__testeq) *this->gptr() = traits_type::to_char_type(__c); __ret = __c; } } else { this->gbump(-1); __ret = traits_type::not_eof(__c); } } return __ret; } template typename basic_stringbuf<_CharT, _Traits, _Alloc>::int_type basic_stringbuf<_CharT, _Traits, _Alloc>:: overflow(int_type __c) { const bool __testout = this->_M_mode & ios_base::out; if (__builtin_expect(!__testout, false)) return traits_type::eof(); const bool __testeof = traits_type::eq_int_type(__c, traits_type::eof()); if (__builtin_expect(__testeof, false)) return traits_type::not_eof(__c); const __size_type __capacity = _M_string.capacity(); const __size_type __max_size = _M_string.max_size(); const bool __testput = this->pptr() < this->epptr(); if (__builtin_expect(!__testput && __capacity == __max_size, false)) return traits_type::eof(); // Try to append __c into output sequence in one of two ways. // Order these tests done in is unspecified by the standard. const char_type __conv = traits_type::to_char_type(__c); if (!__testput) { // NB: Start ostringstream buffers at 512 chars. This is an // experimental value (pronounced "arbitrary" in some of the // hipper English-speaking countries), and can be changed to // suit particular needs. // // _GLIBCXX_RESOLVE_LIB_DEFECTS // 169. Bad efficiency of overflow() mandated // 432. stringbuf::overflow() makes only one write position // available const __size_type __opt_len = std::max(__size_type(2 * __capacity), __size_type(512)); const __size_type __len = std::min(__opt_len, __max_size); __string_type __tmp; __tmp.reserve(__len); if (this->pbase()) __tmp.assign(this->pbase(), this->epptr() - this->pbase()); __tmp.push_back(__conv); _M_string.swap(__tmp); _M_sync(const_cast(_M_string.data()), this->gptr() - this->eback(), this->pptr() - this->pbase()); } else *this->pptr() = __conv; this->pbump(1); return __c; } template typename basic_stringbuf<_CharT, _Traits, _Alloc>::int_type basic_stringbuf<_CharT, _Traits, _Alloc>:: underflow() { int_type __ret = traits_type::eof(); const bool __testin = this->_M_mode & ios_base::in; if (__testin) { // Update egptr() to match the actual string end. _M_update_egptr(); if (this->gptr() < this->egptr()) __ret = traits_type::to_int_type(*this->gptr()); } return __ret; } template typename basic_stringbuf<_CharT, _Traits, _Alloc>::pos_type basic_stringbuf<_CharT, _Traits, _Alloc>:: seekoff(off_type __off, ios_base::seekdir __way, ios_base::openmode __mode) { pos_type __ret = pos_type(off_type(-1)); bool __testin = (ios_base::in & this->_M_mode & __mode) != 0; bool __testout = (ios_base::out & this->_M_mode & __mode) != 0; const bool __testboth = __testin && __testout && __way != ios_base::cur; __testin &= !(__mode & ios_base::out); __testout &= !(__mode & ios_base::in); // _GLIBCXX_RESOLVE_LIB_DEFECTS // 453. basic_stringbuf::seekoff need not always fail for an empty stream. const char_type* __beg = __testin ? this->eback() : this->pbase(); if ((__beg || !__off) && (__testin || __testout || __testboth)) { _M_update_egptr(); off_type __newoffi = __off; off_type __newoffo = __newoffi; if (__way == ios_base::cur) { __newoffi += this->gptr() - __beg; __newoffo += this->pptr() - __beg; } else if (__way == ios_base::end) __newoffo = __newoffi += this->egptr() - __beg; if ((__testin || __testboth) && __newoffi >= 0 && this->egptr() - __beg >= __newoffi) { this->setg(this->eback(), this->eback() + __newoffi, this->egptr()); __ret = pos_type(__newoffi); } if ((__testout || __testboth) && __newoffo >= 0 && this->egptr() - __beg >= __newoffo) { _M_pbump(this->pbase(), this->epptr(), __newoffo); __ret = pos_type(__newoffo); } } return __ret; } template typename basic_stringbuf<_CharT, _Traits, _Alloc>::pos_type basic_stringbuf<_CharT, _Traits, _Alloc>:: seekpos(pos_type __sp, ios_base::openmode __mode) { pos_type __ret = pos_type(off_type(-1)); const bool __testin = (ios_base::in & this->_M_mode & __mode) != 0; const bool __testout = (ios_base::out & this->_M_mode & __mode) != 0; const char_type* __beg = __testin ? this->eback() : this->pbase(); if ((__beg || !off_type(__sp)) && (__testin || __testout)) { _M_update_egptr(); const off_type __pos(__sp); const bool __testpos = (0 <= __pos && __pos <= this->egptr() - __beg); if (__testpos) { if (__testin) this->setg(this->eback(), this->eback() + __pos, this->egptr()); if (__testout) _M_pbump(this->pbase(), this->epptr(), __pos); __ret = __sp; } } return __ret; } template void basic_stringbuf<_CharT, _Traits, _Alloc>:: _M_sync(char_type* __base, __size_type __i, __size_type __o) { const bool __testin = _M_mode & ios_base::in; const bool __testout = _M_mode & ios_base::out; char_type* __endg = __base + _M_string.size(); char_type* __endp = __base + _M_string.capacity(); if (__base != _M_string.data()) { // setbuf: __i == size of buffer area (_M_string.size() == 0). __endg += __i; __i = 0; __endp = __endg; } if (__testin) this->setg(__base, __base + __i, __endg); if (__testout) { _M_pbump(__base, __endp, __o); // egptr() always tracks the string end. When !__testin, // for the correct functioning of the streambuf inlines // the other get area pointers are identical. if (!__testin) this->setg(__endg, __endg, __endg); } } template void basic_stringbuf<_CharT, _Traits, _Alloc>:: _M_pbump(char_type* __pbeg, char_type* __pend, off_type __off) { this->setp(__pbeg, __pend); while (__off > __gnu_cxx::__numeric_traits::__max) { this->pbump(__gnu_cxx::__numeric_traits::__max); __off -= __gnu_cxx::__numeric_traits::__max; } this->pbump(__off); } // Inhibit implicit instantiations for required instantiations, // which are defined via explicit instantiations elsewhere. #if _GLIBCXX_EXTERN_TEMPLATE extern template class basic_stringbuf; extern template class basic_istringstream; extern template class basic_ostringstream; extern template class basic_stringstream; #ifdef _GLIBCXX_USE_WCHAR_T extern template class basic_stringbuf; extern template class basic_istringstream; extern template class basic_ostringstream; extern template class basic_stringstream; #endif # 283 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/sstream.tcc" 3 #endif # 284 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/sstream.tcc" 3 _GLIBCXX_END_NAMESPACE_VERSION } // namespace std #endif # 289 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/sstream.tcc" 3 # 814 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/sstream" 2 3 #endif /* _GLIBCXX_SSTREAM */ # 816 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/sstream" 3 # 11 "./OFM.cpp" 2 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 11 "./OFM.cpp" # 12 "./OFM.cpp" #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 12 "./OFM.cpp" # 13 "./OFM.cpp" #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 13 "./OFM.cpp" # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/cilk.h" 1 3 /* cilk.h -*-C++-*- * * @copyright * Copyright (C) 2010-2013, Intel Corporation * All rights reserved. * * @copyright * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * Neither the name of Intel Corporation nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * @copyright * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ /** @file cilk.h * * @brief Provides convenient aliases for the Cilk language keywords. * * @details * Since Cilk is a nonstandard extension to both C and C++, the Cilk * language keywords all begin with “`_Cilk_`”, which guarantees that they * will not conflict with user-defined identifiers in properly written * programs, so that “standard” C and C++ programs can safely be * compiled a Cilk-enabled C or C++ compiler. * * However, this means that the keywords _look_ like something grafted on to * the base language. Therefore, you can include this header: * * #include "cilk/cilk.h" * * and then write the Cilk keywords with a “`cilk_`” prefix instead of * “`_Cilk_`”. * * @ingroup language */ /** @defgroup language Language Keywords * Definitions having to do with the Cilk language. * @{ */ #ifndef cilk_spawn # define cilk_spawn _Cilk_spawn ///< Spawn a task that can execute in parallel. # define cilk_sync _Cilk_sync ///< Wait for spawned tasks to complete. # define cilk_for _Cilk_for ///< Execute iterations of a for loop in parallel. #endif # 70 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/cilk.h" 3 /// @} # 14 "./OFM.cpp" 2 #if 0 /* expanded by -frewrite-includes */ #include "Lock.cpp" #endif /* expanded by -frewrite-includes */ # 14 "./OFM.cpp" # 1 "./Lock.cpp" 1 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 1 "./Lock.cpp" # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/atomic" 1 3 // -*- C++ -*- header. // Copyright (C) 2008-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file include/atomic * This is a Standard C++ Library header. */ // Based on "C++ Atomic Types and Operations" by Hans Boehm and Lawrence Crowl. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2427.html #ifndef _GLIBCXX_ATOMIC #define _GLIBCXX_ATOMIC 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 36 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/atomic" 3 #if __cplusplus < 201103L #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 38 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/atomic" 3 # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/atomic" 3 #else # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/atomic" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/atomic" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/atomic_base.h" 1 3 // -*- C++ -*- header. // Copyright (C) 2008-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file bits/atomic_base.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{atomic} */ #ifndef _GLIBCXX_ATOMIC_BASE_H #define _GLIBCXX_ATOMIC_BASE_H 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 34 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/atomic_base.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 35 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/atomic_base.h" 3 # 36 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/atomic_base.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 36 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/atomic_base.h" 3 # 37 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/atomic_base.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 37 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/atomic_base.h" 3 # 38 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/atomic_base.h" 3 #ifndef _GLIBCXX_ALWAYS_INLINE #define _GLIBCXX_ALWAYS_INLINE inline __attribute__((__always_inline__)) #endif # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/atomic_base.h" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION /** * @defgroup atomics Atomics * * Components for performing atomic operations. * @{ */ /// Enumeration for memory_order typedef enum memory_order { memory_order_relaxed, memory_order_consume, memory_order_acquire, memory_order_release, memory_order_acq_rel, memory_order_seq_cst } memory_order; enum __memory_order_modifier { __memory_order_mask = 0x0ffff, __memory_order_modifier_mask = 0xffff0000, __memory_order_hle_acquire = 0x10000, __memory_order_hle_release = 0x20000 }; constexpr memory_order operator|(memory_order __m, __memory_order_modifier __mod) { return memory_order(__m | int(__mod)); } constexpr memory_order operator&(memory_order __m, __memory_order_modifier __mod) { return memory_order(__m & int(__mod)); } // Drop release ordering as per [atomics.types.operations.req]/21 constexpr memory_order __cmpexch_failure_order2(memory_order __m) noexcept { return __m == memory_order_acq_rel ? memory_order_acquire : __m == memory_order_release ? memory_order_relaxed : __m; } constexpr memory_order __cmpexch_failure_order(memory_order __m) noexcept { return memory_order(__cmpexch_failure_order2(__m & __memory_order_mask) | (__m & __memory_order_modifier_mask)); } _GLIBCXX_ALWAYS_INLINE void atomic_thread_fence(memory_order __m) noexcept { __atomic_thread_fence(__m); } _GLIBCXX_ALWAYS_INLINE void atomic_signal_fence(memory_order __m) noexcept { __atomic_signal_fence(__m); } /// kill_dependency template inline _Tp kill_dependency(_Tp __y) noexcept { _Tp __ret(__y); return __ret; } // Base types for atomics. template struct __atomic_base; #define ATOMIC_VAR_INIT(_VI) { _VI } template struct atomic; template struct atomic<_Tp*>; /* The target's "set" value for test-and-set may not be exactly 1. */ #if __GCC_ATOMIC_TEST_AND_SET_TRUEVAL == 1 typedef bool __atomic_flag_data_type; #else # 135 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/atomic_base.h" 3 typedef unsigned char __atomic_flag_data_type; #endif # 137 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/atomic_base.h" 3 /** * @brief Base type for atomic_flag. * * Base type is POD with data, allowing atomic_flag to derive from * it and meet the standard layout type requirement. In addition to * compatibility with a C interface, this allows different * implementations of atomic_flag to use the same atomic operation * functions, via a standard conversion to the __atomic_flag_base * argument. */ _GLIBCXX_BEGIN_EXTERN_C struct __atomic_flag_base { __atomic_flag_data_type _M_i; }; _GLIBCXX_END_EXTERN_C #define ATOMIC_FLAG_INIT { 0 } /// atomic_flag struct atomic_flag : public __atomic_flag_base { atomic_flag() noexcept = default; ~atomic_flag() noexcept = default; atomic_flag(const atomic_flag&) = delete; atomic_flag& operator=(const atomic_flag&) = delete; atomic_flag& operator=(const atomic_flag&) volatile = delete; // Conversion to ATOMIC_FLAG_INIT. constexpr atomic_flag(bool __i) noexcept : __atomic_flag_base{ _S_init(__i) } { } _GLIBCXX_ALWAYS_INLINE bool test_and_set(memory_order __m = memory_order_seq_cst) noexcept { return __atomic_test_and_set (&_M_i, __m); } _GLIBCXX_ALWAYS_INLINE bool test_and_set(memory_order __m = memory_order_seq_cst) volatile noexcept { return __atomic_test_and_set (&_M_i, __m); } _GLIBCXX_ALWAYS_INLINE void clear(memory_order __m = memory_order_seq_cst) noexcept { memory_order __b = __m & __memory_order_mask; __glibcxx_assert(__b != memory_order_consume); __glibcxx_assert(__b != memory_order_acquire); __glibcxx_assert(__b != memory_order_acq_rel); __atomic_clear (&_M_i, __m); } _GLIBCXX_ALWAYS_INLINE void clear(memory_order __m = memory_order_seq_cst) volatile noexcept { memory_order __b = __m & __memory_order_mask; __glibcxx_assert(__b != memory_order_consume); __glibcxx_assert(__b != memory_order_acquire); __glibcxx_assert(__b != memory_order_acq_rel); __atomic_clear (&_M_i, __m); } private: static constexpr __atomic_flag_data_type _S_init(bool __i) { return __i ? __GCC_ATOMIC_TEST_AND_SET_TRUEVAL : 0; } }; /// Base class for atomic integrals. // // For each of the integral types, define atomic_[integral type] struct // // atomic_bool bool // atomic_char char // atomic_schar signed char // atomic_uchar unsigned char // atomic_short short // atomic_ushort unsigned short // atomic_int int // atomic_uint unsigned int // atomic_long long // atomic_ulong unsigned long // atomic_llong long long // atomic_ullong unsigned long long // atomic_char16_t char16_t // atomic_char32_t char32_t // atomic_wchar_t wchar_t // // NB: Assuming _ITp is an integral scalar type that is 1, 2, 4, or // 8 bytes, since that is what GCC built-in functions for atomic // memory access expect. template struct __atomic_base { private: typedef _ITp __int_type; static constexpr int _S_alignment = sizeof(_ITp) > alignof(_ITp) ? sizeof(_ITp) : alignof(_ITp); alignas(_S_alignment) __int_type _M_i; public: __atomic_base() noexcept = default; ~__atomic_base() noexcept = default; __atomic_base(const __atomic_base&) = delete; __atomic_base& operator=(const __atomic_base&) = delete; __atomic_base& operator=(const __atomic_base&) volatile = delete; // Requires __int_type convertible to _M_i. constexpr __atomic_base(__int_type __i) noexcept : _M_i (__i) { } operator __int_type() const noexcept { return load(); } operator __int_type() const volatile noexcept { return load(); } __int_type operator=(__int_type __i) noexcept { store(__i); return __i; } __int_type operator=(__int_type __i) volatile noexcept { store(__i); return __i; } __int_type operator++(int) noexcept { return fetch_add(1); } __int_type operator++(int) volatile noexcept { return fetch_add(1); } __int_type operator--(int) noexcept { return fetch_sub(1); } __int_type operator--(int) volatile noexcept { return fetch_sub(1); } __int_type operator++() noexcept { return __atomic_add_fetch(&_M_i, 1, memory_order_seq_cst); } __int_type operator++() volatile noexcept { return __atomic_add_fetch(&_M_i, 1, memory_order_seq_cst); } __int_type operator--() noexcept { return __atomic_sub_fetch(&_M_i, 1, memory_order_seq_cst); } __int_type operator--() volatile noexcept { return __atomic_sub_fetch(&_M_i, 1, memory_order_seq_cst); } __int_type operator+=(__int_type __i) noexcept { return __atomic_add_fetch(&_M_i, __i, memory_order_seq_cst); } __int_type operator+=(__int_type __i) volatile noexcept { return __atomic_add_fetch(&_M_i, __i, memory_order_seq_cst); } __int_type operator-=(__int_type __i) noexcept { return __atomic_sub_fetch(&_M_i, __i, memory_order_seq_cst); } __int_type operator-=(__int_type __i) volatile noexcept { return __atomic_sub_fetch(&_M_i, __i, memory_order_seq_cst); } __int_type operator&=(__int_type __i) noexcept { return __atomic_and_fetch(&_M_i, __i, memory_order_seq_cst); } __int_type operator&=(__int_type __i) volatile noexcept { return __atomic_and_fetch(&_M_i, __i, memory_order_seq_cst); } __int_type operator|=(__int_type __i) noexcept { return __atomic_or_fetch(&_M_i, __i, memory_order_seq_cst); } __int_type operator|=(__int_type __i) volatile noexcept { return __atomic_or_fetch(&_M_i, __i, memory_order_seq_cst); } __int_type operator^=(__int_type __i) noexcept { return __atomic_xor_fetch(&_M_i, __i, memory_order_seq_cst); } __int_type operator^=(__int_type __i) volatile noexcept { return __atomic_xor_fetch(&_M_i, __i, memory_order_seq_cst); } bool is_lock_free() const noexcept { // Use a fake, minimally aligned pointer. return __atomic_is_lock_free(sizeof(_M_i), reinterpret_cast(-__alignof(_M_i))); } bool is_lock_free() const volatile noexcept { // Use a fake, minimally aligned pointer. return __atomic_is_lock_free(sizeof(_M_i), reinterpret_cast(-__alignof(_M_i))); } _GLIBCXX_ALWAYS_INLINE void store(__int_type __i, memory_order __m = memory_order_seq_cst) noexcept { memory_order __b = __m & __memory_order_mask; __glibcxx_assert(__b != memory_order_acquire); __glibcxx_assert(__b != memory_order_acq_rel); __glibcxx_assert(__b != memory_order_consume); __atomic_store_n(&_M_i, __i, __m); } _GLIBCXX_ALWAYS_INLINE void store(__int_type __i, memory_order __m = memory_order_seq_cst) volatile noexcept { memory_order __b = __m & __memory_order_mask; __glibcxx_assert(__b != memory_order_acquire); __glibcxx_assert(__b != memory_order_acq_rel); __glibcxx_assert(__b != memory_order_consume); __atomic_store_n(&_M_i, __i, __m); } _GLIBCXX_ALWAYS_INLINE __int_type load(memory_order __m = memory_order_seq_cst) const noexcept { memory_order __b = __m & __memory_order_mask; __glibcxx_assert(__b != memory_order_release); __glibcxx_assert(__b != memory_order_acq_rel); return __atomic_load_n(&_M_i, __m); } _GLIBCXX_ALWAYS_INLINE __int_type load(memory_order __m = memory_order_seq_cst) const volatile noexcept { memory_order __b = __m & __memory_order_mask; __glibcxx_assert(__b != memory_order_release); __glibcxx_assert(__b != memory_order_acq_rel); return __atomic_load_n(&_M_i, __m); } _GLIBCXX_ALWAYS_INLINE __int_type exchange(__int_type __i, memory_order __m = memory_order_seq_cst) noexcept { return __atomic_exchange_n(&_M_i, __i, __m); } _GLIBCXX_ALWAYS_INLINE __int_type exchange(__int_type __i, memory_order __m = memory_order_seq_cst) volatile noexcept { return __atomic_exchange_n(&_M_i, __i, __m); } _GLIBCXX_ALWAYS_INLINE bool compare_exchange_weak(__int_type& __i1, __int_type __i2, memory_order __m1, memory_order __m2) noexcept { memory_order __b2 = __m2 & __memory_order_mask; memory_order __b1 = __m1 & __memory_order_mask; __glibcxx_assert(__b2 != memory_order_release); __glibcxx_assert(__b2 != memory_order_acq_rel); __glibcxx_assert(__b2 <= __b1); return __atomic_compare_exchange_n(&_M_i, &__i1, __i2, 1, __m1, __m2); } _GLIBCXX_ALWAYS_INLINE bool compare_exchange_weak(__int_type& __i1, __int_type __i2, memory_order __m1, memory_order __m2) volatile noexcept { memory_order __b2 = __m2 & __memory_order_mask; memory_order __b1 = __m1 & __memory_order_mask; __glibcxx_assert(__b2 != memory_order_release); __glibcxx_assert(__b2 != memory_order_acq_rel); __glibcxx_assert(__b2 <= __b1); return __atomic_compare_exchange_n(&_M_i, &__i1, __i2, 1, __m1, __m2); } _GLIBCXX_ALWAYS_INLINE bool compare_exchange_weak(__int_type& __i1, __int_type __i2, memory_order __m = memory_order_seq_cst) noexcept { return compare_exchange_weak(__i1, __i2, __m, __cmpexch_failure_order(__m)); } _GLIBCXX_ALWAYS_INLINE bool compare_exchange_weak(__int_type& __i1, __int_type __i2, memory_order __m = memory_order_seq_cst) volatile noexcept { return compare_exchange_weak(__i1, __i2, __m, __cmpexch_failure_order(__m)); } _GLIBCXX_ALWAYS_INLINE bool compare_exchange_strong(__int_type& __i1, __int_type __i2, memory_order __m1, memory_order __m2) noexcept { memory_order __b2 = __m2 & __memory_order_mask; memory_order __b1 = __m1 & __memory_order_mask; __glibcxx_assert(__b2 != memory_order_release); __glibcxx_assert(__b2 != memory_order_acq_rel); __glibcxx_assert(__b2 <= __b1); return __atomic_compare_exchange_n(&_M_i, &__i1, __i2, 0, __m1, __m2); } _GLIBCXX_ALWAYS_INLINE bool compare_exchange_strong(__int_type& __i1, __int_type __i2, memory_order __m1, memory_order __m2) volatile noexcept { memory_order __b2 = __m2 & __memory_order_mask; memory_order __b1 = __m1 & __memory_order_mask; __glibcxx_assert(__b2 != memory_order_release); __glibcxx_assert(__b2 != memory_order_acq_rel); __glibcxx_assert(__b2 <= __b1); return __atomic_compare_exchange_n(&_M_i, &__i1, __i2, 0, __m1, __m2); } _GLIBCXX_ALWAYS_INLINE bool compare_exchange_strong(__int_type& __i1, __int_type __i2, memory_order __m = memory_order_seq_cst) noexcept { return compare_exchange_strong(__i1, __i2, __m, __cmpexch_failure_order(__m)); } _GLIBCXX_ALWAYS_INLINE bool compare_exchange_strong(__int_type& __i1, __int_type __i2, memory_order __m = memory_order_seq_cst) volatile noexcept { return compare_exchange_strong(__i1, __i2, __m, __cmpexch_failure_order(__m)); } _GLIBCXX_ALWAYS_INLINE __int_type fetch_add(__int_type __i, memory_order __m = memory_order_seq_cst) noexcept { return __atomic_fetch_add(&_M_i, __i, __m); } _GLIBCXX_ALWAYS_INLINE __int_type fetch_add(__int_type __i, memory_order __m = memory_order_seq_cst) volatile noexcept { return __atomic_fetch_add(&_M_i, __i, __m); } _GLIBCXX_ALWAYS_INLINE __int_type fetch_sub(__int_type __i, memory_order __m = memory_order_seq_cst) noexcept { return __atomic_fetch_sub(&_M_i, __i, __m); } _GLIBCXX_ALWAYS_INLINE __int_type fetch_sub(__int_type __i, memory_order __m = memory_order_seq_cst) volatile noexcept { return __atomic_fetch_sub(&_M_i, __i, __m); } _GLIBCXX_ALWAYS_INLINE __int_type fetch_and(__int_type __i, memory_order __m = memory_order_seq_cst) noexcept { return __atomic_fetch_and(&_M_i, __i, __m); } _GLIBCXX_ALWAYS_INLINE __int_type fetch_and(__int_type __i, memory_order __m = memory_order_seq_cst) volatile noexcept { return __atomic_fetch_and(&_M_i, __i, __m); } _GLIBCXX_ALWAYS_INLINE __int_type fetch_or(__int_type __i, memory_order __m = memory_order_seq_cst) noexcept { return __atomic_fetch_or(&_M_i, __i, __m); } _GLIBCXX_ALWAYS_INLINE __int_type fetch_or(__int_type __i, memory_order __m = memory_order_seq_cst) volatile noexcept { return __atomic_fetch_or(&_M_i, __i, __m); } _GLIBCXX_ALWAYS_INLINE __int_type fetch_xor(__int_type __i, memory_order __m = memory_order_seq_cst) noexcept { return __atomic_fetch_xor(&_M_i, __i, __m); } _GLIBCXX_ALWAYS_INLINE __int_type fetch_xor(__int_type __i, memory_order __m = memory_order_seq_cst) volatile noexcept { return __atomic_fetch_xor(&_M_i, __i, __m); } }; /// Partial specialization for pointer types. template struct __atomic_base<_PTp*> { private: typedef _PTp* __pointer_type; __pointer_type _M_p; // Factored out to facilitate explicit specialization. constexpr ptrdiff_t _M_type_size(ptrdiff_t __d) const { return __d * sizeof(_PTp); } constexpr ptrdiff_t _M_type_size(ptrdiff_t __d) const volatile { return __d * sizeof(_PTp); } public: __atomic_base() noexcept = default; ~__atomic_base() noexcept = default; __atomic_base(const __atomic_base&) = delete; __atomic_base& operator=(const __atomic_base&) = delete; __atomic_base& operator=(const __atomic_base&) volatile = delete; // Requires __pointer_type convertible to _M_p. constexpr __atomic_base(__pointer_type __p) noexcept : _M_p (__p) { } operator __pointer_type() const noexcept { return load(); } operator __pointer_type() const volatile noexcept { return load(); } __pointer_type operator=(__pointer_type __p) noexcept { store(__p); return __p; } __pointer_type operator=(__pointer_type __p) volatile noexcept { store(__p); return __p; } __pointer_type operator++(int) noexcept { return fetch_add(1); } __pointer_type operator++(int) volatile noexcept { return fetch_add(1); } __pointer_type operator--(int) noexcept { return fetch_sub(1); } __pointer_type operator--(int) volatile noexcept { return fetch_sub(1); } __pointer_type operator++() noexcept { return __atomic_add_fetch(&_M_p, _M_type_size(1), memory_order_seq_cst); } __pointer_type operator++() volatile noexcept { return __atomic_add_fetch(&_M_p, _M_type_size(1), memory_order_seq_cst); } __pointer_type operator--() noexcept { return __atomic_sub_fetch(&_M_p, _M_type_size(1), memory_order_seq_cst); } __pointer_type operator--() volatile noexcept { return __atomic_sub_fetch(&_M_p, _M_type_size(1), memory_order_seq_cst); } __pointer_type operator+=(ptrdiff_t __d) noexcept { return __atomic_add_fetch(&_M_p, _M_type_size(__d), memory_order_seq_cst); } __pointer_type operator+=(ptrdiff_t __d) volatile noexcept { return __atomic_add_fetch(&_M_p, _M_type_size(__d), memory_order_seq_cst); } __pointer_type operator-=(ptrdiff_t __d) noexcept { return __atomic_sub_fetch(&_M_p, _M_type_size(__d), memory_order_seq_cst); } __pointer_type operator-=(ptrdiff_t __d) volatile noexcept { return __atomic_sub_fetch(&_M_p, _M_type_size(__d), memory_order_seq_cst); } bool is_lock_free() const noexcept { // Produce a fake, minimally aligned pointer. return __atomic_is_lock_free(sizeof(_M_p), reinterpret_cast(-__alignof(_M_p))); } bool is_lock_free() const volatile noexcept { // Produce a fake, minimally aligned pointer. return __atomic_is_lock_free(sizeof(_M_p), reinterpret_cast(-__alignof(_M_p))); } _GLIBCXX_ALWAYS_INLINE void store(__pointer_type __p, memory_order __m = memory_order_seq_cst) noexcept { memory_order __b = __m & __memory_order_mask; __glibcxx_assert(__b != memory_order_acquire); __glibcxx_assert(__b != memory_order_acq_rel); __glibcxx_assert(__b != memory_order_consume); __atomic_store_n(&_M_p, __p, __m); } _GLIBCXX_ALWAYS_INLINE void store(__pointer_type __p, memory_order __m = memory_order_seq_cst) volatile noexcept { memory_order __b = __m & __memory_order_mask; __glibcxx_assert(__b != memory_order_acquire); __glibcxx_assert(__b != memory_order_acq_rel); __glibcxx_assert(__b != memory_order_consume); __atomic_store_n(&_M_p, __p, __m); } _GLIBCXX_ALWAYS_INLINE __pointer_type load(memory_order __m = memory_order_seq_cst) const noexcept { memory_order __b = __m & __memory_order_mask; __glibcxx_assert(__b != memory_order_release); __glibcxx_assert(__b != memory_order_acq_rel); return __atomic_load_n(&_M_p, __m); } _GLIBCXX_ALWAYS_INLINE __pointer_type load(memory_order __m = memory_order_seq_cst) const volatile noexcept { memory_order __b = __m & __memory_order_mask; __glibcxx_assert(__b != memory_order_release); __glibcxx_assert(__b != memory_order_acq_rel); return __atomic_load_n(&_M_p, __m); } _GLIBCXX_ALWAYS_INLINE __pointer_type exchange(__pointer_type __p, memory_order __m = memory_order_seq_cst) noexcept { return __atomic_exchange_n(&_M_p, __p, __m); } _GLIBCXX_ALWAYS_INLINE __pointer_type exchange(__pointer_type __p, memory_order __m = memory_order_seq_cst) volatile noexcept { return __atomic_exchange_n(&_M_p, __p, __m); } _GLIBCXX_ALWAYS_INLINE bool compare_exchange_strong(__pointer_type& __p1, __pointer_type __p2, memory_order __m1, memory_order __m2) noexcept { memory_order __b2 = __m2 & __memory_order_mask; memory_order __b1 = __m1 & __memory_order_mask; __glibcxx_assert(__b2 != memory_order_release); __glibcxx_assert(__b2 != memory_order_acq_rel); __glibcxx_assert(__b2 <= __b1); return __atomic_compare_exchange_n(&_M_p, &__p1, __p2, 0, __m1, __m2); } _GLIBCXX_ALWAYS_INLINE bool compare_exchange_strong(__pointer_type& __p1, __pointer_type __p2, memory_order __m1, memory_order __m2) volatile noexcept { memory_order __b2 = __m2 & __memory_order_mask; memory_order __b1 = __m1 & __memory_order_mask; __glibcxx_assert(__b2 != memory_order_release); __glibcxx_assert(__b2 != memory_order_acq_rel); __glibcxx_assert(__b2 <= __b1); return __atomic_compare_exchange_n(&_M_p, &__p1, __p2, 0, __m1, __m2); } _GLIBCXX_ALWAYS_INLINE __pointer_type fetch_add(ptrdiff_t __d, memory_order __m = memory_order_seq_cst) noexcept { return __atomic_fetch_add(&_M_p, _M_type_size(__d), __m); } _GLIBCXX_ALWAYS_INLINE __pointer_type fetch_add(ptrdiff_t __d, memory_order __m = memory_order_seq_cst) volatile noexcept { return __atomic_fetch_add(&_M_p, _M_type_size(__d), __m); } _GLIBCXX_ALWAYS_INLINE __pointer_type fetch_sub(ptrdiff_t __d, memory_order __m = memory_order_seq_cst) noexcept { return __atomic_fetch_sub(&_M_p, _M_type_size(__d), __m); } _GLIBCXX_ALWAYS_INLINE __pointer_type fetch_sub(ptrdiff_t __d, memory_order __m = memory_order_seq_cst) volatile noexcept { return __atomic_fetch_sub(&_M_p, _M_type_size(__d), __m); } }; // @} group atomics _GLIBCXX_END_NAMESPACE_VERSION } // namespace std #endif # 797 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/atomic_base.h" 3 # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/atomic" 2 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION /** * @addtogroup atomics * @{ */ template struct atomic; /// atomic // NB: No operators or fetch-operations for this type. template<> struct atomic { private: __atomic_base _M_base; public: atomic() noexcept = default; ~atomic() noexcept = default; atomic(const atomic&) = delete; atomic& operator=(const atomic&) = delete; atomic& operator=(const atomic&) volatile = delete; constexpr atomic(bool __i) noexcept : _M_base(__i) { } bool operator=(bool __i) noexcept { return _M_base.operator=(__i); } bool operator=(bool __i) volatile noexcept { return _M_base.operator=(__i); } operator bool() const noexcept { return _M_base.load(); } operator bool() const volatile noexcept { return _M_base.load(); } bool is_lock_free() const noexcept { return _M_base.is_lock_free(); } bool is_lock_free() const volatile noexcept { return _M_base.is_lock_free(); } void store(bool __i, memory_order __m = memory_order_seq_cst) noexcept { _M_base.store(__i, __m); } void store(bool __i, memory_order __m = memory_order_seq_cst) volatile noexcept { _M_base.store(__i, __m); } bool load(memory_order __m = memory_order_seq_cst) const noexcept { return _M_base.load(__m); } bool load(memory_order __m = memory_order_seq_cst) const volatile noexcept { return _M_base.load(__m); } bool exchange(bool __i, memory_order __m = memory_order_seq_cst) noexcept { return _M_base.exchange(__i, __m); } bool exchange(bool __i, memory_order __m = memory_order_seq_cst) volatile noexcept { return _M_base.exchange(__i, __m); } bool compare_exchange_weak(bool& __i1, bool __i2, memory_order __m1, memory_order __m2) noexcept { return _M_base.compare_exchange_weak(__i1, __i2, __m1, __m2); } bool compare_exchange_weak(bool& __i1, bool __i2, memory_order __m1, memory_order __m2) volatile noexcept { return _M_base.compare_exchange_weak(__i1, __i2, __m1, __m2); } bool compare_exchange_weak(bool& __i1, bool __i2, memory_order __m = memory_order_seq_cst) noexcept { return _M_base.compare_exchange_weak(__i1, __i2, __m); } bool compare_exchange_weak(bool& __i1, bool __i2, memory_order __m = memory_order_seq_cst) volatile noexcept { return _M_base.compare_exchange_weak(__i1, __i2, __m); } bool compare_exchange_strong(bool& __i1, bool __i2, memory_order __m1, memory_order __m2) noexcept { return _M_base.compare_exchange_strong(__i1, __i2, __m1, __m2); } bool compare_exchange_strong(bool& __i1, bool __i2, memory_order __m1, memory_order __m2) volatile noexcept { return _M_base.compare_exchange_strong(__i1, __i2, __m1, __m2); } bool compare_exchange_strong(bool& __i1, bool __i2, memory_order __m = memory_order_seq_cst) noexcept { return _M_base.compare_exchange_strong(__i1, __i2, __m); } bool compare_exchange_strong(bool& __i1, bool __i2, memory_order __m = memory_order_seq_cst) volatile noexcept { return _M_base.compare_exchange_strong(__i1, __i2, __m); } }; /** * @brief Generic atomic type, primary class template. * * @tparam _Tp Type to be made atomic, must be trivally copyable. */ template struct atomic { private: // Align 1/2/4/8/16-byte types to at least their size. static constexpr int _S_min_alignment = (sizeof(_Tp) & (sizeof(_Tp) - 1)) || sizeof(_Tp) > 16 ? 0 : sizeof(_Tp); static constexpr int _S_alignment = _S_min_alignment > alignof(_Tp) ? _S_min_alignment : alignof(_Tp); alignas(_S_alignment) _Tp _M_i; static_assert(__is_trivially_copyable(_Tp), "std::atomic requires a trivially copyable type"); static_assert(sizeof(_Tp) > 0, "Incomplete or zero-sized types are not supported"); public: atomic() noexcept = default; ~atomic() noexcept = default; atomic(const atomic&) = delete; atomic& operator=(const atomic&) = delete; atomic& operator=(const atomic&) volatile = delete; constexpr atomic(_Tp __i) noexcept : _M_i(__i) { } operator _Tp() const noexcept { return load(); } operator _Tp() const volatile noexcept { return load(); } _Tp operator=(_Tp __i) noexcept { store(__i); return __i; } _Tp operator=(_Tp __i) volatile noexcept { store(__i); return __i; } bool is_lock_free() const noexcept { // Produce a fake, minimally aligned pointer. return __atomic_is_lock_free(sizeof(_M_i), reinterpret_cast(-__alignof(_M_i))); } bool is_lock_free() const volatile noexcept { // Produce a fake, minimally aligned pointer. return __atomic_is_lock_free(sizeof(_M_i), reinterpret_cast(-__alignof(_M_i))); } void store(_Tp __i, memory_order __m = memory_order_seq_cst) noexcept { __atomic_store(&_M_i, &__i, __m); } void store(_Tp __i, memory_order __m = memory_order_seq_cst) volatile noexcept { __atomic_store(&_M_i, &__i, __m); } _Tp load(memory_order __m = memory_order_seq_cst) const noexcept { _Tp tmp; __atomic_load(&_M_i, &tmp, __m); return tmp; } _Tp load(memory_order __m = memory_order_seq_cst) const volatile noexcept { _Tp tmp; __atomic_load(&_M_i, &tmp, __m); return tmp; } _Tp exchange(_Tp __i, memory_order __m = memory_order_seq_cst) noexcept { _Tp tmp; __atomic_exchange(&_M_i, &__i, &tmp, __m); return tmp; } _Tp exchange(_Tp __i, memory_order __m = memory_order_seq_cst) volatile noexcept { _Tp tmp; __atomic_exchange(&_M_i, &__i, &tmp, __m); return tmp; } bool compare_exchange_weak(_Tp& __e, _Tp __i, memory_order __s, memory_order __f) noexcept { return __atomic_compare_exchange(&_M_i, &__e, &__i, true, __s, __f); } bool compare_exchange_weak(_Tp& __e, _Tp __i, memory_order __s, memory_order __f) volatile noexcept { return __atomic_compare_exchange(&_M_i, &__e, &__i, true, __s, __f); } bool compare_exchange_weak(_Tp& __e, _Tp __i, memory_order __m = memory_order_seq_cst) noexcept { return compare_exchange_weak(__e, __i, __m, __cmpexch_failure_order(__m)); } bool compare_exchange_weak(_Tp& __e, _Tp __i, memory_order __m = memory_order_seq_cst) volatile noexcept { return compare_exchange_weak(__e, __i, __m, __cmpexch_failure_order(__m)); } bool compare_exchange_strong(_Tp& __e, _Tp __i, memory_order __s, memory_order __f) noexcept { return __atomic_compare_exchange(&_M_i, &__e, &__i, false, __s, __f); } bool compare_exchange_strong(_Tp& __e, _Tp __i, memory_order __s, memory_order __f) volatile noexcept { return __atomic_compare_exchange(&_M_i, &__e, &__i, false, __s, __f); } bool compare_exchange_strong(_Tp& __e, _Tp __i, memory_order __m = memory_order_seq_cst) noexcept { return compare_exchange_strong(__e, __i, __m, __cmpexch_failure_order(__m)); } bool compare_exchange_strong(_Tp& __e, _Tp __i, memory_order __m = memory_order_seq_cst) volatile noexcept { return compare_exchange_strong(__e, __i, __m, __cmpexch_failure_order(__m)); } }; /// Partial specialization for pointer types. template struct atomic<_Tp*> { typedef _Tp* __pointer_type; typedef __atomic_base<_Tp*> __base_type; __base_type _M_b; atomic() noexcept = default; ~atomic() noexcept = default; atomic(const atomic&) = delete; atomic& operator=(const atomic&) = delete; atomic& operator=(const atomic&) volatile = delete; constexpr atomic(__pointer_type __p) noexcept : _M_b(__p) { } operator __pointer_type() const noexcept { return __pointer_type(_M_b); } operator __pointer_type() const volatile noexcept { return __pointer_type(_M_b); } __pointer_type operator=(__pointer_type __p) noexcept { return _M_b.operator=(__p); } __pointer_type operator=(__pointer_type __p) volatile noexcept { return _M_b.operator=(__p); } __pointer_type operator++(int) noexcept { return _M_b++; } __pointer_type operator++(int) volatile noexcept { return _M_b++; } __pointer_type operator--(int) noexcept { return _M_b--; } __pointer_type operator--(int) volatile noexcept { return _M_b--; } __pointer_type operator++() noexcept { return ++_M_b; } __pointer_type operator++() volatile noexcept { return ++_M_b; } __pointer_type operator--() noexcept { return --_M_b; } __pointer_type operator--() volatile noexcept { return --_M_b; } __pointer_type operator+=(ptrdiff_t __d) noexcept { return _M_b.operator+=(__d); } __pointer_type operator+=(ptrdiff_t __d) volatile noexcept { return _M_b.operator+=(__d); } __pointer_type operator-=(ptrdiff_t __d) noexcept { return _M_b.operator-=(__d); } __pointer_type operator-=(ptrdiff_t __d) volatile noexcept { return _M_b.operator-=(__d); } bool is_lock_free() const noexcept { return _M_b.is_lock_free(); } bool is_lock_free() const volatile noexcept { return _M_b.is_lock_free(); } void store(__pointer_type __p, memory_order __m = memory_order_seq_cst) noexcept { return _M_b.store(__p, __m); } void store(__pointer_type __p, memory_order __m = memory_order_seq_cst) volatile noexcept { return _M_b.store(__p, __m); } __pointer_type load(memory_order __m = memory_order_seq_cst) const noexcept { return _M_b.load(__m); } __pointer_type load(memory_order __m = memory_order_seq_cst) const volatile noexcept { return _M_b.load(__m); } __pointer_type exchange(__pointer_type __p, memory_order __m = memory_order_seq_cst) noexcept { return _M_b.exchange(__p, __m); } __pointer_type exchange(__pointer_type __p, memory_order __m = memory_order_seq_cst) volatile noexcept { return _M_b.exchange(__p, __m); } bool compare_exchange_weak(__pointer_type& __p1, __pointer_type __p2, memory_order __m1, memory_order __m2) noexcept { return _M_b.compare_exchange_strong(__p1, __p2, __m1, __m2); } bool compare_exchange_weak(__pointer_type& __p1, __pointer_type __p2, memory_order __m1, memory_order __m2) volatile noexcept { return _M_b.compare_exchange_strong(__p1, __p2, __m1, __m2); } bool compare_exchange_weak(__pointer_type& __p1, __pointer_type __p2, memory_order __m = memory_order_seq_cst) noexcept { return compare_exchange_weak(__p1, __p2, __m, __cmpexch_failure_order(__m)); } bool compare_exchange_weak(__pointer_type& __p1, __pointer_type __p2, memory_order __m = memory_order_seq_cst) volatile noexcept { return compare_exchange_weak(__p1, __p2, __m, __cmpexch_failure_order(__m)); } bool compare_exchange_strong(__pointer_type& __p1, __pointer_type __p2, memory_order __m1, memory_order __m2) noexcept { return _M_b.compare_exchange_strong(__p1, __p2, __m1, __m2); } bool compare_exchange_strong(__pointer_type& __p1, __pointer_type __p2, memory_order __m1, memory_order __m2) volatile noexcept { return _M_b.compare_exchange_strong(__p1, __p2, __m1, __m2); } bool compare_exchange_strong(__pointer_type& __p1, __pointer_type __p2, memory_order __m = memory_order_seq_cst) noexcept { return _M_b.compare_exchange_strong(__p1, __p2, __m, __cmpexch_failure_order(__m)); } bool compare_exchange_strong(__pointer_type& __p1, __pointer_type __p2, memory_order __m = memory_order_seq_cst) volatile noexcept { return _M_b.compare_exchange_strong(__p1, __p2, __m, __cmpexch_failure_order(__m)); } __pointer_type fetch_add(ptrdiff_t __d, memory_order __m = memory_order_seq_cst) noexcept { return _M_b.fetch_add(__d, __m); } __pointer_type fetch_add(ptrdiff_t __d, memory_order __m = memory_order_seq_cst) volatile noexcept { return _M_b.fetch_add(__d, __m); } __pointer_type fetch_sub(ptrdiff_t __d, memory_order __m = memory_order_seq_cst) noexcept { return _M_b.fetch_sub(__d, __m); } __pointer_type fetch_sub(ptrdiff_t __d, memory_order __m = memory_order_seq_cst) volatile noexcept { return _M_b.fetch_sub(__d, __m); } }; /// Explicit specialization for char. template<> struct atomic : __atomic_base { typedef char __integral_type; typedef __atomic_base __base_type; atomic() noexcept = default; ~atomic() noexcept = default; atomic(const atomic&) = delete; atomic& operator=(const atomic&) = delete; atomic& operator=(const atomic&) volatile = delete; constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { } using __base_type::operator __integral_type; using __base_type::operator=; }; /// Explicit specialization for signed char. template<> struct atomic : __atomic_base { typedef signed char __integral_type; typedef __atomic_base __base_type; atomic() noexcept= default; ~atomic() noexcept = default; atomic(const atomic&) = delete; atomic& operator=(const atomic&) = delete; atomic& operator=(const atomic&) volatile = delete; constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { } using __base_type::operator __integral_type; using __base_type::operator=; }; /// Explicit specialization for unsigned char. template<> struct atomic : __atomic_base { typedef unsigned char __integral_type; typedef __atomic_base __base_type; atomic() noexcept= default; ~atomic() noexcept = default; atomic(const atomic&) = delete; atomic& operator=(const atomic&) = delete; atomic& operator=(const atomic&) volatile = delete; constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { } using __base_type::operator __integral_type; using __base_type::operator=; }; /// Explicit specialization for short. template<> struct atomic : __atomic_base { typedef short __integral_type; typedef __atomic_base __base_type; atomic() noexcept = default; ~atomic() noexcept = default; atomic(const atomic&) = delete; atomic& operator=(const atomic&) = delete; atomic& operator=(const atomic&) volatile = delete; constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { } using __base_type::operator __integral_type; using __base_type::operator=; }; /// Explicit specialization for unsigned short. template<> struct atomic : __atomic_base { typedef unsigned short __integral_type; typedef __atomic_base __base_type; atomic() noexcept = default; ~atomic() noexcept = default; atomic(const atomic&) = delete; atomic& operator=(const atomic&) = delete; atomic& operator=(const atomic&) volatile = delete; constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { } using __base_type::operator __integral_type; using __base_type::operator=; }; /// Explicit specialization for int. template<> struct atomic : __atomic_base { typedef int __integral_type; typedef __atomic_base __base_type; atomic() noexcept = default; ~atomic() noexcept = default; atomic(const atomic&) = delete; atomic& operator=(const atomic&) = delete; atomic& operator=(const atomic&) volatile = delete; constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { } using __base_type::operator __integral_type; using __base_type::operator=; }; /// Explicit specialization for unsigned int. template<> struct atomic : __atomic_base { typedef unsigned int __integral_type; typedef __atomic_base __base_type; atomic() noexcept = default; ~atomic() noexcept = default; atomic(const atomic&) = delete; atomic& operator=(const atomic&) = delete; atomic& operator=(const atomic&) volatile = delete; constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { } using __base_type::operator __integral_type; using __base_type::operator=; }; /// Explicit specialization for long. template<> struct atomic : __atomic_base { typedef long __integral_type; typedef __atomic_base __base_type; atomic() noexcept = default; ~atomic() noexcept = default; atomic(const atomic&) = delete; atomic& operator=(const atomic&) = delete; atomic& operator=(const atomic&) volatile = delete; constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { } using __base_type::operator __integral_type; using __base_type::operator=; }; /// Explicit specialization for unsigned long. template<> struct atomic : __atomic_base { typedef unsigned long __integral_type; typedef __atomic_base __base_type; atomic() noexcept = default; ~atomic() noexcept = default; atomic(const atomic&) = delete; atomic& operator=(const atomic&) = delete; atomic& operator=(const atomic&) volatile = delete; constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { } using __base_type::operator __integral_type; using __base_type::operator=; }; /// Explicit specialization for long long. template<> struct atomic : __atomic_base { typedef long long __integral_type; typedef __atomic_base __base_type; atomic() noexcept = default; ~atomic() noexcept = default; atomic(const atomic&) = delete; atomic& operator=(const atomic&) = delete; atomic& operator=(const atomic&) volatile = delete; constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { } using __base_type::operator __integral_type; using __base_type::operator=; }; /// Explicit specialization for unsigned long long. template<> struct atomic : __atomic_base { typedef unsigned long long __integral_type; typedef __atomic_base __base_type; atomic() noexcept = default; ~atomic() noexcept = default; atomic(const atomic&) = delete; atomic& operator=(const atomic&) = delete; atomic& operator=(const atomic&) volatile = delete; constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { } using __base_type::operator __integral_type; using __base_type::operator=; }; /// Explicit specialization for wchar_t. template<> struct atomic : __atomic_base { typedef wchar_t __integral_type; typedef __atomic_base __base_type; atomic() noexcept = default; ~atomic() noexcept = default; atomic(const atomic&) = delete; atomic& operator=(const atomic&) = delete; atomic& operator=(const atomic&) volatile = delete; constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { } using __base_type::operator __integral_type; using __base_type::operator=; }; /// Explicit specialization for char16_t. template<> struct atomic : __atomic_base { typedef char16_t __integral_type; typedef __atomic_base __base_type; atomic() noexcept = default; ~atomic() noexcept = default; atomic(const atomic&) = delete; atomic& operator=(const atomic&) = delete; atomic& operator=(const atomic&) volatile = delete; constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { } using __base_type::operator __integral_type; using __base_type::operator=; }; /// Explicit specialization for char32_t. template<> struct atomic : __atomic_base { typedef char32_t __integral_type; typedef __atomic_base __base_type; atomic() noexcept = default; ~atomic() noexcept = default; atomic(const atomic&) = delete; atomic& operator=(const atomic&) = delete; atomic& operator=(const atomic&) volatile = delete; constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { } using __base_type::operator __integral_type; using __base_type::operator=; }; /// atomic_bool typedef atomic atomic_bool; /// atomic_char typedef atomic atomic_char; /// atomic_schar typedef atomic atomic_schar; /// atomic_uchar typedef atomic atomic_uchar; /// atomic_short typedef atomic atomic_short; /// atomic_ushort typedef atomic atomic_ushort; /// atomic_int typedef atomic atomic_int; /// atomic_uint typedef atomic atomic_uint; /// atomic_long typedef atomic atomic_long; /// atomic_ulong typedef atomic atomic_ulong; /// atomic_llong typedef atomic atomic_llong; /// atomic_ullong typedef atomic atomic_ullong; /// atomic_wchar_t typedef atomic atomic_wchar_t; /// atomic_char16_t typedef atomic atomic_char16_t; /// atomic_char32_t typedef atomic atomic_char32_t; /// atomic_int_least8_t typedef atomic atomic_int_least8_t; /// atomic_uint_least8_t typedef atomic atomic_uint_least8_t; /// atomic_int_least16_t typedef atomic atomic_int_least16_t; /// atomic_uint_least16_t typedef atomic atomic_uint_least16_t; /// atomic_int_least32_t typedef atomic atomic_int_least32_t; /// atomic_uint_least32_t typedef atomic atomic_uint_least32_t; /// atomic_int_least64_t typedef atomic atomic_int_least64_t; /// atomic_uint_least64_t typedef atomic atomic_uint_least64_t; /// atomic_int_fast8_t typedef atomic atomic_int_fast8_t; /// atomic_uint_fast8_t typedef atomic atomic_uint_fast8_t; /// atomic_int_fast16_t typedef atomic atomic_int_fast16_t; /// atomic_uint_fast16_t typedef atomic atomic_uint_fast16_t; /// atomic_int_fast32_t typedef atomic atomic_int_fast32_t; /// atomic_uint_fast32_t typedef atomic atomic_uint_fast32_t; /// atomic_int_fast64_t typedef atomic atomic_int_fast64_t; /// atomic_uint_fast64_t typedef atomic atomic_uint_fast64_t; /// atomic_intptr_t typedef atomic atomic_intptr_t; /// atomic_uintptr_t typedef atomic atomic_uintptr_t; /// atomic_size_t typedef atomic atomic_size_t; /// atomic_intmax_t typedef atomic atomic_intmax_t; /// atomic_uintmax_t typedef atomic atomic_uintmax_t; /// atomic_ptrdiff_t typedef atomic atomic_ptrdiff_t; // Function definitions, atomic_flag operations. inline bool atomic_flag_test_and_set_explicit(atomic_flag* __a, memory_order __m) noexcept { return __a->test_and_set(__m); } inline bool atomic_flag_test_and_set_explicit(volatile atomic_flag* __a, memory_order __m) noexcept { return __a->test_and_set(__m); } inline void atomic_flag_clear_explicit(atomic_flag* __a, memory_order __m) noexcept { __a->clear(__m); } inline void atomic_flag_clear_explicit(volatile atomic_flag* __a, memory_order __m) noexcept { __a->clear(__m); } inline bool atomic_flag_test_and_set(atomic_flag* __a) noexcept { return atomic_flag_test_and_set_explicit(__a, memory_order_seq_cst); } inline bool atomic_flag_test_and_set(volatile atomic_flag* __a) noexcept { return atomic_flag_test_and_set_explicit(__a, memory_order_seq_cst); } inline void atomic_flag_clear(atomic_flag* __a) noexcept { atomic_flag_clear_explicit(__a, memory_order_seq_cst); } inline void atomic_flag_clear(volatile atomic_flag* __a) noexcept { atomic_flag_clear_explicit(__a, memory_order_seq_cst); } // Function templates generally applicable to atomic types. template inline bool atomic_is_lock_free(const atomic<_ITp>* __a) noexcept { return __a->is_lock_free(); } template inline bool atomic_is_lock_free(const volatile atomic<_ITp>* __a) noexcept { return __a->is_lock_free(); } template inline void atomic_init(atomic<_ITp>* __a, _ITp __i) noexcept { __a->store(__i, memory_order_relaxed); } template inline void atomic_init(volatile atomic<_ITp>* __a, _ITp __i) noexcept { __a->store(__i, memory_order_relaxed); } template inline void atomic_store_explicit(atomic<_ITp>* __a, _ITp __i, memory_order __m) noexcept { __a->store(__i, __m); } template inline void atomic_store_explicit(volatile atomic<_ITp>* __a, _ITp __i, memory_order __m) noexcept { __a->store(__i, __m); } template inline _ITp atomic_load_explicit(const atomic<_ITp>* __a, memory_order __m) noexcept { return __a->load(__m); } template inline _ITp atomic_load_explicit(const volatile atomic<_ITp>* __a, memory_order __m) noexcept { return __a->load(__m); } template inline _ITp atomic_exchange_explicit(atomic<_ITp>* __a, _ITp __i, memory_order __m) noexcept { return __a->exchange(__i, __m); } template inline _ITp atomic_exchange_explicit(volatile atomic<_ITp>* __a, _ITp __i, memory_order __m) noexcept { return __a->exchange(__i, __m); } template inline bool atomic_compare_exchange_weak_explicit(atomic<_ITp>* __a, _ITp* __i1, _ITp __i2, memory_order __m1, memory_order __m2) noexcept { return __a->compare_exchange_weak(*__i1, __i2, __m1, __m2); } template inline bool atomic_compare_exchange_weak_explicit(volatile atomic<_ITp>* __a, _ITp* __i1, _ITp __i2, memory_order __m1, memory_order __m2) noexcept { return __a->compare_exchange_weak(*__i1, __i2, __m1, __m2); } template inline bool atomic_compare_exchange_strong_explicit(atomic<_ITp>* __a, _ITp* __i1, _ITp __i2, memory_order __m1, memory_order __m2) noexcept { return __a->compare_exchange_strong(*__i1, __i2, __m1, __m2); } template inline bool atomic_compare_exchange_strong_explicit(volatile atomic<_ITp>* __a, _ITp* __i1, _ITp __i2, memory_order __m1, memory_order __m2) noexcept { return __a->compare_exchange_strong(*__i1, __i2, __m1, __m2); } template inline void atomic_store(atomic<_ITp>* __a, _ITp __i) noexcept { atomic_store_explicit(__a, __i, memory_order_seq_cst); } template inline void atomic_store(volatile atomic<_ITp>* __a, _ITp __i) noexcept { atomic_store_explicit(__a, __i, memory_order_seq_cst); } template inline _ITp atomic_load(const atomic<_ITp>* __a) noexcept { return atomic_load_explicit(__a, memory_order_seq_cst); } template inline _ITp atomic_load(const volatile atomic<_ITp>* __a) noexcept { return atomic_load_explicit(__a, memory_order_seq_cst); } template inline _ITp atomic_exchange(atomic<_ITp>* __a, _ITp __i) noexcept { return atomic_exchange_explicit(__a, __i, memory_order_seq_cst); } template inline _ITp atomic_exchange(volatile atomic<_ITp>* __a, _ITp __i) noexcept { return atomic_exchange_explicit(__a, __i, memory_order_seq_cst); } template inline bool atomic_compare_exchange_weak(atomic<_ITp>* __a, _ITp* __i1, _ITp __i2) noexcept { return atomic_compare_exchange_weak_explicit(__a, __i1, __i2, memory_order_seq_cst, memory_order_seq_cst); } template inline bool atomic_compare_exchange_weak(volatile atomic<_ITp>* __a, _ITp* __i1, _ITp __i2) noexcept { return atomic_compare_exchange_weak_explicit(__a, __i1, __i2, memory_order_seq_cst, memory_order_seq_cst); } template inline bool atomic_compare_exchange_strong(atomic<_ITp>* __a, _ITp* __i1, _ITp __i2) noexcept { return atomic_compare_exchange_strong_explicit(__a, __i1, __i2, memory_order_seq_cst, memory_order_seq_cst); } template inline bool atomic_compare_exchange_strong(volatile atomic<_ITp>* __a, _ITp* __i1, _ITp __i2) noexcept { return atomic_compare_exchange_strong_explicit(__a, __i1, __i2, memory_order_seq_cst, memory_order_seq_cst); } // Function templates for atomic_integral operations only, using // __atomic_base. Template argument should be constricted to // intergral types as specified in the standard, excluding address // types. template inline _ITp atomic_fetch_add_explicit(__atomic_base<_ITp>* __a, _ITp __i, memory_order __m) noexcept { return __a->fetch_add(__i, __m); } template inline _ITp atomic_fetch_add_explicit(volatile __atomic_base<_ITp>* __a, _ITp __i, memory_order __m) noexcept { return __a->fetch_add(__i, __m); } template inline _ITp atomic_fetch_sub_explicit(__atomic_base<_ITp>* __a, _ITp __i, memory_order __m) noexcept { return __a->fetch_sub(__i, __m); } template inline _ITp atomic_fetch_sub_explicit(volatile __atomic_base<_ITp>* __a, _ITp __i, memory_order __m) noexcept { return __a->fetch_sub(__i, __m); } template inline _ITp atomic_fetch_and_explicit(__atomic_base<_ITp>* __a, _ITp __i, memory_order __m) noexcept { return __a->fetch_and(__i, __m); } template inline _ITp atomic_fetch_and_explicit(volatile __atomic_base<_ITp>* __a, _ITp __i, memory_order __m) noexcept { return __a->fetch_and(__i, __m); } template inline _ITp atomic_fetch_or_explicit(__atomic_base<_ITp>* __a, _ITp __i, memory_order __m) noexcept { return __a->fetch_or(__i, __m); } template inline _ITp atomic_fetch_or_explicit(volatile __atomic_base<_ITp>* __a, _ITp __i, memory_order __m) noexcept { return __a->fetch_or(__i, __m); } template inline _ITp atomic_fetch_xor_explicit(__atomic_base<_ITp>* __a, _ITp __i, memory_order __m) noexcept { return __a->fetch_xor(__i, __m); } template inline _ITp atomic_fetch_xor_explicit(volatile __atomic_base<_ITp>* __a, _ITp __i, memory_order __m) noexcept { return __a->fetch_xor(__i, __m); } template inline _ITp atomic_fetch_add(__atomic_base<_ITp>* __a, _ITp __i) noexcept { return atomic_fetch_add_explicit(__a, __i, memory_order_seq_cst); } template inline _ITp atomic_fetch_add(volatile __atomic_base<_ITp>* __a, _ITp __i) noexcept { return atomic_fetch_add_explicit(__a, __i, memory_order_seq_cst); } template inline _ITp atomic_fetch_sub(__atomic_base<_ITp>* __a, _ITp __i) noexcept { return atomic_fetch_sub_explicit(__a, __i, memory_order_seq_cst); } template inline _ITp atomic_fetch_sub(volatile __atomic_base<_ITp>* __a, _ITp __i) noexcept { return atomic_fetch_sub_explicit(__a, __i, memory_order_seq_cst); } template inline _ITp atomic_fetch_and(__atomic_base<_ITp>* __a, _ITp __i) noexcept { return atomic_fetch_and_explicit(__a, __i, memory_order_seq_cst); } template inline _ITp atomic_fetch_and(volatile __atomic_base<_ITp>* __a, _ITp __i) noexcept { return atomic_fetch_and_explicit(__a, __i, memory_order_seq_cst); } template inline _ITp atomic_fetch_or(__atomic_base<_ITp>* __a, _ITp __i) noexcept { return atomic_fetch_or_explicit(__a, __i, memory_order_seq_cst); } template inline _ITp atomic_fetch_or(volatile __atomic_base<_ITp>* __a, _ITp __i) noexcept { return atomic_fetch_or_explicit(__a, __i, memory_order_seq_cst); } template inline _ITp atomic_fetch_xor(__atomic_base<_ITp>* __a, _ITp __i) noexcept { return atomic_fetch_xor_explicit(__a, __i, memory_order_seq_cst); } template inline _ITp atomic_fetch_xor(volatile __atomic_base<_ITp>* __a, _ITp __i) noexcept { return atomic_fetch_xor_explicit(__a, __i, memory_order_seq_cst); } // Partial specializations for pointers. template inline _ITp* atomic_fetch_add_explicit(atomic<_ITp*>* __a, ptrdiff_t __d, memory_order __m) noexcept { return __a->fetch_add(__d, __m); } template inline _ITp* atomic_fetch_add_explicit(volatile atomic<_ITp*>* __a, ptrdiff_t __d, memory_order __m) noexcept { return __a->fetch_add(__d, __m); } template inline _ITp* atomic_fetch_add(volatile atomic<_ITp*>* __a, ptrdiff_t __d) noexcept { return __a->fetch_add(__d); } template inline _ITp* atomic_fetch_add(atomic<_ITp*>* __a, ptrdiff_t __d) noexcept { return __a->fetch_add(__d); } template inline _ITp* atomic_fetch_sub_explicit(volatile atomic<_ITp*>* __a, ptrdiff_t __d, memory_order __m) noexcept { return __a->fetch_sub(__d, __m); } template inline _ITp* atomic_fetch_sub_explicit(atomic<_ITp*>* __a, ptrdiff_t __d, memory_order __m) noexcept { return __a->fetch_sub(__d, __m); } template inline _ITp* atomic_fetch_sub(volatile atomic<_ITp*>* __a, ptrdiff_t __d) noexcept { return __a->fetch_sub(__d); } template inline _ITp* atomic_fetch_sub(atomic<_ITp*>* __a, ptrdiff_t __d) noexcept { return __a->fetch_sub(__d); } // @} group atomics _GLIBCXX_END_NAMESPACE_VERSION } // namespace #endif // C++11 # 1251 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/atomic" 3 #endif // _GLIBCXX_ATOMIC # 1253 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/atomic" 3 # 2 "./Lock.cpp" 2 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 2 "./Lock.cpp" # 1 "/usr/include/unistd.h" 1 3 4 /* Copyright (C) 1991-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * POSIX Standard: 2.10 Symbolic Constants */ #ifndef _UNISTD_H #define _UNISTD_H 1 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 25 "/usr/include/unistd.h" 3 4 # 26 "/usr/include/unistd.h" 3 4 __BEGIN_DECLS /* These may be used to determine what facilities are present at compile time. Their values can be obtained at run time from `sysconf'. */ #ifdef __USE_XOPEN2K8 /* POSIX Standard approved as ISO/IEC 9945-1 as of September 2008. */ # define _POSIX_VERSION 200809L #elif defined __USE_XOPEN2K # 36 "/usr/include/unistd.h" 3 4 /* POSIX Standard approved as ISO/IEC 9945-1 as of December 2001. */ # define _POSIX_VERSION 200112L #elif defined __USE_POSIX199506 # 39 "/usr/include/unistd.h" 3 4 /* POSIX Standard approved as ISO/IEC 9945-1 as of June 1995. */ # define _POSIX_VERSION 199506L #elif defined __USE_POSIX199309 # 42 "/usr/include/unistd.h" 3 4 /* POSIX Standard approved as ISO/IEC 9945-1 as of September 1993. */ # define _POSIX_VERSION 199309L #else # 45 "/usr/include/unistd.h" 3 4 /* POSIX Standard approved as ISO/IEC 9945-1 as of September 1990. */ # define _POSIX_VERSION 199009L #endif # 48 "/usr/include/unistd.h" 3 4 /* These are not #ifdef __USE_POSIX2 because they are in the theoretically application-owned namespace. */ #ifdef __USE_XOPEN2K8 # define __POSIX2_THIS_VERSION 200809L /* The utilities on GNU systems also correspond to this version. */ #elif defined __USE_XOPEN2K # 56 "/usr/include/unistd.h" 3 4 /* The utilities on GNU systems also correspond to this version. */ # define __POSIX2_THIS_VERSION 200112L #elif defined __USE_POSIX199506 # 59 "/usr/include/unistd.h" 3 4 /* The utilities on GNU systems also correspond to this version. */ # define __POSIX2_THIS_VERSION 199506L #else # 62 "/usr/include/unistd.h" 3 4 /* The utilities on GNU systems also correspond to this version. */ # define __POSIX2_THIS_VERSION 199209L #endif # 65 "/usr/include/unistd.h" 3 4 /* The utilities on GNU systems also correspond to this version. */ #define _POSIX2_VERSION __POSIX2_THIS_VERSION /* If defined, the implementation supports the C Language Bindings Option. */ #define _POSIX2_C_BIND __POSIX2_THIS_VERSION /* If defined, the implementation supports the C Language Development Utilities Option. */ #define _POSIX2_C_DEV __POSIX2_THIS_VERSION /* If defined, the implementation supports the Software Development Utilities Option. */ #define _POSIX2_SW_DEV __POSIX2_THIS_VERSION /* If defined, the implementation supports the creation of locales with the localedef utility. */ #define _POSIX2_LOCALEDEF __POSIX2_THIS_VERSION /* X/Open version number to which the library conforms. It is selectable. */ #ifdef __USE_XOPEN2K8 # define _XOPEN_VERSION 700 #elif defined __USE_XOPEN2K # 89 "/usr/include/unistd.h" 3 4 # define _XOPEN_VERSION 600 #elif defined __USE_UNIX98 # 91 "/usr/include/unistd.h" 3 4 # define _XOPEN_VERSION 500 #else # 93 "/usr/include/unistd.h" 3 4 # define _XOPEN_VERSION 4 #endif # 95 "/usr/include/unistd.h" 3 4 /* Commands and utilities from XPG4 are available. */ #define _XOPEN_XCU_VERSION 4 /* We are compatible with the old published standards as well. */ #define _XOPEN_XPG2 1 #define _XOPEN_XPG3 1 #define _XOPEN_XPG4 1 /* The X/Open Unix extensions are available. */ #define _XOPEN_UNIX 1 /* Encryption is present. */ #define _XOPEN_CRYPT 1 /* The enhanced internationalization capabilities according to XPG4.2 are present. */ #define _XOPEN_ENH_I18N 1 /* The legacy interfaces are also available. */ #define _XOPEN_LEGACY 1 /* Get values of POSIX options: If these symbols are defined, the corresponding features are always available. If not, they may be available sometimes. The current values can be obtained with `sysconf'. _POSIX_JOB_CONTROL Job control is supported. _POSIX_SAVED_IDS Processes have a saved set-user-ID and a saved set-group-ID. _POSIX_REALTIME_SIGNALS Real-time, queued signals are supported. _POSIX_PRIORITY_SCHEDULING Priority scheduling is supported. _POSIX_TIMERS POSIX.4 clocks and timers are supported. _POSIX_ASYNCHRONOUS_IO Asynchronous I/O is supported. _POSIX_PRIORITIZED_IO Prioritized asynchronous I/O is supported. _POSIX_SYNCHRONIZED_IO Synchronizing file data is supported. _POSIX_FSYNC The fsync function is present. _POSIX_MAPPED_FILES Mapping of files to memory is supported. _POSIX_MEMLOCK Locking of all memory is supported. _POSIX_MEMLOCK_RANGE Locking of ranges of memory is supported. _POSIX_MEMORY_PROTECTION Setting of memory protections is supported. _POSIX_MESSAGE_PASSING POSIX.4 message queues are supported. _POSIX_SEMAPHORES POSIX.4 counting semaphores are supported. _POSIX_SHARED_MEMORY_OBJECTS POSIX.4 shared memory objects are supported. _POSIX_THREADS POSIX.1c pthreads are supported. _POSIX_THREAD_ATTR_STACKADDR Thread stack address attribute option supported. _POSIX_THREAD_ATTR_STACKSIZE Thread stack size attribute option supported. _POSIX_THREAD_SAFE_FUNCTIONS Thread-safe functions are supported. _POSIX_THREAD_PRIORITY_SCHEDULING POSIX.1c thread execution scheduling supported. _POSIX_THREAD_PRIO_INHERIT Thread priority inheritance option supported. _POSIX_THREAD_PRIO_PROTECT Thread priority protection option supported. _POSIX_THREAD_PROCESS_SHARED Process-shared synchronization supported. _POSIX_PII Protocol-independent interfaces are supported. _POSIX_PII_XTI XTI protocol-indep. interfaces are supported. _POSIX_PII_SOCKET Socket protocol-indep. interfaces are supported. _POSIX_PII_INTERNET Internet family of protocols supported. _POSIX_PII_INTERNET_STREAM Connection-mode Internet protocol supported. _POSIX_PII_INTERNET_DGRAM Connectionless Internet protocol supported. _POSIX_PII_OSI ISO/OSI family of protocols supported. _POSIX_PII_OSI_COTS Connection-mode ISO/OSI service supported. _POSIX_PII_OSI_CLTS Connectionless ISO/OSI service supported. _POSIX_POLL Implementation supports `poll' function. _POSIX_SELECT Implementation supports `select' and `pselect'. _XOPEN_REALTIME X/Open realtime support is available. _XOPEN_REALTIME_THREADS X/Open realtime thread support is available. _XOPEN_SHM Shared memory interface according to XPG4.2. _XBS5_ILP32_OFF32 Implementation provides environment with 32-bit int, long, pointer, and off_t types. _XBS5_ILP32_OFFBIG Implementation provides environment with 32-bit int, long, and pointer and off_t with at least 64 bits. _XBS5_LP64_OFF64 Implementation provides environment with 32-bit int, and 64-bit long, pointer, and off_t types. _XBS5_LPBIG_OFFBIG Implementation provides environment with at least 32 bits int and long, pointer, and off_t with at least 64 bits. If any of these symbols is defined as -1, the corresponding option is not true for any file. If any is defined as other than -1, the corresponding option is true for all files. If a symbol is not defined at all, the value for a specific file can be obtained from `pathconf' and `fpathconf'. _POSIX_CHOWN_RESTRICTED Only the super user can use `chown' to change the owner of a file. `chown' can only be used to change the group ID of a file to a group of which the calling process is a member. _POSIX_NO_TRUNC Pathname components longer than NAME_MAX generate an error. _POSIX_VDISABLE If defined, if the value of an element of the `c_cc' member of `struct termios' is _POSIX_VDISABLE, no character will have the effect associated with that element. _POSIX_SYNC_IO Synchronous I/O may be performed. _POSIX_ASYNC_IO Asynchronous I/O may be performed. _POSIX_PRIO_IO Prioritized Asynchronous I/O may be performed. Support for the Large File Support interface is not generally available. If it is available the following constants are defined to one. _LFS64_LARGEFILE Low-level I/O supports large files. _LFS64_STDIO Standard I/O supports large files. */ #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 202 "/usr/include/unistd.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/posix_opt.h" 1 3 4 /* Define POSIX options for Linux. Copyright (C) 1996-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; see the file COPYING.LIB. If not, see . */ #ifndef _BITS_POSIX_OPT_H #define _BITS_POSIX_OPT_H 1 /* Job control is supported. */ #define _POSIX_JOB_CONTROL 1 /* Processes have a saved set-user-ID and a saved set-group-ID. */ #define _POSIX_SAVED_IDS 1 /* Priority scheduling is supported. */ #define _POSIX_PRIORITY_SCHEDULING 200809L /* Synchronizing file data is supported. */ #define _POSIX_SYNCHRONIZED_IO 200809L /* The fsync function is present. */ #define _POSIX_FSYNC 200809L /* Mapping of files to memory is supported. */ #define _POSIX_MAPPED_FILES 200809L /* Locking of all memory is supported. */ #define _POSIX_MEMLOCK 200809L /* Locking of ranges of memory is supported. */ #define _POSIX_MEMLOCK_RANGE 200809L /* Setting of memory protections is supported. */ #define _POSIX_MEMORY_PROTECTION 200809L /* Some filesystems allow all users to change file ownership. */ #define _POSIX_CHOWN_RESTRICTED 0 /* `c_cc' member of 'struct termios' structure can be disabled by using the value _POSIX_VDISABLE. */ #define _POSIX_VDISABLE '\0' /* Filenames are not silently truncated. */ #define _POSIX_NO_TRUNC 1 /* X/Open realtime support is available. */ #define _XOPEN_REALTIME 1 /* X/Open thread realtime support is available. */ #define _XOPEN_REALTIME_THREADS 1 /* XPG4.2 shared memory is supported. */ #define _XOPEN_SHM 1 /* Tell we have POSIX threads. */ #define _POSIX_THREADS 200809L /* We have the reentrant functions described in POSIX. */ #define _POSIX_REENTRANT_FUNCTIONS 1 #define _POSIX_THREAD_SAFE_FUNCTIONS 200809L /* We provide priority scheduling for threads. */ #define _POSIX_THREAD_PRIORITY_SCHEDULING 200809L /* We support user-defined stack sizes. */ #define _POSIX_THREAD_ATTR_STACKSIZE 200809L /* We support user-defined stacks. */ #define _POSIX_THREAD_ATTR_STACKADDR 200809L /* We support priority inheritence. */ #define _POSIX_THREAD_PRIO_INHERIT 200809L /* We support priority protection, though only for non-robust mutexes. */ #define _POSIX_THREAD_PRIO_PROTECT 200809L #ifdef __USE_XOPEN2K8 /* We support priority inheritence for robust mutexes. */ # define _POSIX_THREAD_ROBUST_PRIO_INHERIT 200809L /* We do not support priority protection for robust mutexes. */ # define _POSIX_THREAD_ROBUST_PRIO_PROTECT -1 #endif # 98 "/usr/include/x86_64-linux-gnu/bits/posix_opt.h" 3 4 /* We support POSIX.1b semaphores. */ #define _POSIX_SEMAPHORES 200809L /* Real-time signals are supported. */ #define _POSIX_REALTIME_SIGNALS 200809L /* We support asynchronous I/O. */ #define _POSIX_ASYNCHRONOUS_IO 200809L #define _POSIX_ASYNC_IO 1 /* Alternative name for Unix98. */ #define _LFS_ASYNCHRONOUS_IO 1 /* Support for prioritization is also available. */ #define _POSIX_PRIORITIZED_IO 200809L /* The LFS support in asynchronous I/O is also available. */ #define _LFS64_ASYNCHRONOUS_IO 1 /* The rest of the LFS is also available. */ #define _LFS_LARGEFILE 1 #define _LFS64_LARGEFILE 1 #define _LFS64_STDIO 1 /* POSIX shared memory objects are implemented. */ #define _POSIX_SHARED_MEMORY_OBJECTS 200809L /* CPU-time clocks support needs to be checked at runtime. */ #define _POSIX_CPUTIME 0 /* Clock support in threads must be also checked at runtime. */ #define _POSIX_THREAD_CPUTIME 0 /* GNU libc provides regular expression handling. */ #define _POSIX_REGEXP 1 /* Reader/Writer locks are available. */ #define _POSIX_READER_WRITER_LOCKS 200809L /* We have a POSIX shell. */ #define _POSIX_SHELL 1 /* We support the Timeouts option. */ #define _POSIX_TIMEOUTS 200809L /* We support spinlocks. */ #define _POSIX_SPIN_LOCKS 200809L /* The `spawn' function family is supported. */ #define _POSIX_SPAWN 200809L /* We have POSIX timers. */ #define _POSIX_TIMERS 200809L /* The barrier functions are available. */ #define _POSIX_BARRIERS 200809L /* POSIX message queues are available. */ #define _POSIX_MESSAGE_PASSING 200809L /* Thread process-shared synchronization is supported. */ #define _POSIX_THREAD_PROCESS_SHARED 200809L /* The monotonic clock might be available. */ #define _POSIX_MONOTONIC_CLOCK 0 /* The clock selection interfaces are available. */ #define _POSIX_CLOCK_SELECTION 200809L /* Advisory information interfaces are available. */ #define _POSIX_ADVISORY_INFO 200809L /* IPv6 support is available. */ #define _POSIX_IPV6 200809L /* Raw socket support is available. */ #define _POSIX_RAW_SOCKETS 200809L /* We have at least one terminal. */ #define _POSIX2_CHAR_TERM 200809L /* Neither process nor thread sporadic server interfaces is available. */ #define _POSIX_SPORADIC_SERVER -1 #define _POSIX_THREAD_SPORADIC_SERVER -1 /* trace.h is not available. */ #define _POSIX_TRACE -1 #define _POSIX_TRACE_EVENT_FILTER -1 #define _POSIX_TRACE_INHERIT -1 #define _POSIX_TRACE_LOG -1 /* Typed memory objects are not available. */ #define _POSIX_TYPED_MEMORY_OBJECTS -1 #endif /* bits/posix_opt.h */ # 192 "/usr/include/x86_64-linux-gnu/bits/posix_opt.h" 3 4 # 203 "/usr/include/unistd.h" 2 3 4 /* Get the environment definitions from Unix98. */ #if defined __USE_UNIX98 || defined __USE_XOPEN2K #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 206 "/usr/include/unistd.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/environments.h" 1 3 4 /* Copyright (C) 1999-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _UNISTD_H # error "Never include this file directly. Use instead" #endif # 21 "/usr/include/x86_64-linux-gnu/bits/environments.h" 3 4 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 22 "/usr/include/x86_64-linux-gnu/bits/environments.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4 /* Determine the wordsize from the preprocessor defines. */ #if defined __x86_64__ && !defined __ILP32__ # define __WORDSIZE 64 #else # 6 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 3 4 # define __WORDSIZE 32 #endif # 8 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 3 4 #ifdef __x86_64__ # define __WORDSIZE_TIME64_COMPAT32 1 /* Both x86-64 and x32 use the 64-bit system call interface. */ # define __SYSCALL_WORDSIZE 64 #endif # 14 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 3 4 # 23 "/usr/include/x86_64-linux-gnu/bits/environments.h" 2 3 4 /* This header should define the following symbols under the described situations. A value `1' means that the model is always supported, `-1' means it is never supported. Undefined means it cannot be statically decided. _POSIX_V7_ILP32_OFF32 32bit int, long, pointers, and off_t type _POSIX_V7_ILP32_OFFBIG 32bit int, long, and pointers and larger off_t type _POSIX_V7_LP64_OFF32 64bit long and pointers and 32bit off_t type _POSIX_V7_LPBIG_OFFBIG 64bit long and pointers and large off_t type The macros _POSIX_V6_ILP32_OFF32, _POSIX_V6_ILP32_OFFBIG, _POSIX_V6_LP64_OFF32, _POSIX_V6_LPBIG_OFFBIG, _XBS5_ILP32_OFF32, _XBS5_ILP32_OFFBIG, _XBS5_LP64_OFF32, and _XBS5_LPBIG_OFFBIG were used in previous versions of the Unix standard and are available only for compatibility. */ #if __WORDSIZE == 64 /* Environments with 32-bit wide pointers are optionally provided. Therefore following macros aren't defined: # undef _POSIX_V7_ILP32_OFF32 # undef _POSIX_V7_ILP32_OFFBIG # undef _POSIX_V6_ILP32_OFF32 # undef _POSIX_V6_ILP32_OFFBIG # undef _XBS5_ILP32_OFF32 # undef _XBS5_ILP32_OFFBIG and users need to check at runtime. */ /* We also have no use (for now) for an environment with bigger pointers and offsets. */ # define _POSIX_V7_LPBIG_OFFBIG -1 # define _POSIX_V6_LPBIG_OFFBIG -1 # define _XBS5_LPBIG_OFFBIG -1 /* By default we have 64-bit wide `long int', pointers and `off_t'. */ # define _POSIX_V7_LP64_OFF64 1 # define _POSIX_V6_LP64_OFF64 1 # define _XBS5_LP64_OFF64 1 #else /* __WORDSIZE == 32 */ # 66 "/usr/include/x86_64-linux-gnu/bits/environments.h" 3 4 /* We have 32-bit wide `int', `long int' and pointers and all platforms support LFS. -mx32 has 64-bit wide `off_t'. */ # define _POSIX_V7_ILP32_OFFBIG 1 # define _POSIX_V6_ILP32_OFFBIG 1 # define _XBS5_ILP32_OFFBIG 1 # ifndef __x86_64__ /* -m32 has 32-bit wide `off_t'. */ # define _POSIX_V7_ILP32_OFF32 1 # define _POSIX_V6_ILP32_OFF32 1 # define _XBS5_ILP32_OFF32 1 # endif # 79 "/usr/include/x86_64-linux-gnu/bits/environments.h" 3 4 /* We optionally provide an environment with the above size but an 64-bit side `off_t'. Therefore we don't define _POSIX_V7_ILP32_OFFBIG. */ /* Environments with 64-bit wide pointers can be provided, so these macros aren't defined: # undef _POSIX_V7_LP64_OFF64 # undef _POSIX_V7_LPBIG_OFFBIG # undef _POSIX_V6_LP64_OFF64 # undef _POSIX_V6_LPBIG_OFFBIG # undef _XBS5_LP64_OFF64 # undef _XBS5_LPBIG_OFFBIG and sysconf tests for it at runtime. */ #endif /* __WORDSIZE == 32 */ # 94 "/usr/include/x86_64-linux-gnu/bits/environments.h" 3 4 #define __ILP32_OFF32_CFLAGS "-m32" #define __ILP32_OFF32_LDFLAGS "-m32" #if defined __x86_64__ && defined __ILP32__ # define __ILP32_OFFBIG_CFLAGS "-mx32" # define __ILP32_OFFBIG_LDFLAGS "-mx32" #else # 101 "/usr/include/x86_64-linux-gnu/bits/environments.h" 3 4 # define __ILP32_OFFBIG_CFLAGS "-m32 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" # define __ILP32_OFFBIG_LDFLAGS "-m32" #endif # 104 "/usr/include/x86_64-linux-gnu/bits/environments.h" 3 4 #define __LP64_OFF64_CFLAGS "-m64" #define __LP64_OFF64_LDFLAGS "-m64" # 207 "/usr/include/unistd.h" 2 3 4 #endif # 208 "/usr/include/unistd.h" 3 4 /* Standard file descriptors. */ #define STDIN_FILENO 0 /* Standard input. */ #define STDOUT_FILENO 1 /* Standard output. */ #define STDERR_FILENO 2 /* Standard error output. */ /* All functions that are not declared anywhere else. */ #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 217 "/usr/include/unistd.h" 3 4 # 218 "/usr/include/unistd.h" 3 4 #ifndef __ssize_t_defined typedef __ssize_t ssize_t; # define __ssize_t_defined #endif # 223 "/usr/include/unistd.h" 3 4 #define __need_size_t #define __need_NULL #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 226 "/usr/include/unistd.h" 3 4 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 1 3 4 /*===---- stddef.h - Basic type definitions --------------------------------=== * * Copyright (c) 2008 Eli Friedman * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #if !defined(__STDDEF_H) || defined(__need_ptrdiff_t) || \ defined(__need_size_t) || defined(__need_wchar_t) || \ defined(__need_NULL) || defined(__need_wint_t) #if !defined(__need_ptrdiff_t) && !defined(__need_size_t) && \ !defined(__need_wchar_t) && !defined(__need_NULL) && \ !defined(__need_wint_t) /* Always define miscellaneous pieces when modules are available. */ #if !__has_feature(modules) #define __STDDEF_H #endif # 37 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #define __need_ptrdiff_t #define __need_size_t #define __need_wchar_t #define __need_NULL #define __need_STDDEF_H_misc /* __need_wint_t is intentionally not defined here. */ #endif # 44 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_ptrdiff_t) #if !defined(_PTRDIFF_T) || __has_feature(modules) /* Always define ptrdiff_t when modules are available. */ #if !__has_feature(modules) #define _PTRDIFF_T #endif # 51 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 typedef __PTRDIFF_TYPE__ ptrdiff_t; #endif # 53 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #undef __need_ptrdiff_t #endif /* defined(__need_ptrdiff_t) */ # 55 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_size_t) #if !defined(_SIZE_T) || __has_feature(modules) /* Always define size_t when modules are available. */ #if !__has_feature(modules) #define _SIZE_T #endif # 62 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 typedef __SIZE_TYPE__ size_t; #endif # 64 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #undef __need_size_t #endif /*defined(__need_size_t) */ # 66 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_STDDEF_H_misc) /* ISO9899:2011 7.20 (C11 Annex K): Define rsize_t if __STDC_WANT_LIB_EXT1__ is * enabled. */ #if (defined(__STDC_WANT_LIB_EXT1__) && __STDC_WANT_LIB_EXT1__ >= 1 && \ !defined(_RSIZE_T)) || __has_feature(modules) /* Always define rsize_t when modules are available. */ #if !__has_feature(modules) #define _RSIZE_T #endif # 76 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 typedef __SIZE_TYPE__ rsize_t; #endif # 78 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif /* defined(__need_STDDEF_H_misc) */ # 79 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_wchar_t) #ifndef __cplusplus /* Always define wchar_t when modules are available. */ #if !defined(_WCHAR_T) || __has_feature(modules) #if !__has_feature(modules) #define _WCHAR_T #if defined(_MSC_EXTENSIONS) #define _WCHAR_T_DEFINED #endif # 89 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif # 90 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 typedef __WCHAR_TYPE__ wchar_t; #endif # 92 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif # 93 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #undef __need_wchar_t #endif /* defined(__need_wchar_t) */ # 95 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_NULL) #undef NULL #ifdef __cplusplus # if !defined(__MINGW32__) && !defined(_MSC_VER) # define NULL __null # else # 102 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 # define NULL 0 # endif # 104 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #else # 105 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 # define NULL ((void*)0) #endif # 107 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #ifdef __cplusplus #if defined(_MSC_EXTENSIONS) && defined(_NATIVE_NULLPTR_SUPPORTED) namespace std { typedef decltype(nullptr) nullptr_t; } using ::std::nullptr_t; #endif # 112 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif # 113 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #undef __need_NULL #endif /* defined(__need_NULL) */ # 115 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #if defined(__need_STDDEF_H_misc) #if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L #if 0 /* expanded by -frewrite-includes */ #include "__stddef_max_align_t.h" #endif /* expanded by -frewrite-includes */ # 118 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 # 119 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif # 120 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #define offsetof(t, d) __builtin_offsetof(t, d) #undef __need_STDDEF_H_misc #endif /* defined(__need_STDDEF_H_misc) */ # 123 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 /* Some C libraries expect to see a wint_t here. Others (notably MinGW) will use __WINT_TYPE__ directly; accommodate both by requiring __need_wint_t */ #if defined(__need_wint_t) /* Always define wint_t when modules are available. */ #if !defined(_WINT_T) || __has_feature(modules) #if !__has_feature(modules) #define _WINT_T #endif # 132 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 typedef __WINT_TYPE__ wint_t; #endif # 134 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #undef __need_wint_t #endif /* __need_wint_t */ # 136 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 #endif # 138 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 4 # 227 "/usr/include/unistd.h" 2 3 4 #if defined __USE_XOPEN || defined __USE_XOPEN2K /* The Single Unix specification says that some more types are available here. */ # ifndef __gid_t_defined typedef __gid_t gid_t; # define __gid_t_defined # endif # 235 "/usr/include/unistd.h" 3 4 # ifndef __uid_t_defined typedef __uid_t uid_t; # define __uid_t_defined # endif # 240 "/usr/include/unistd.h" 3 4 # ifndef __off_t_defined # ifndef __USE_FILE_OFFSET64 typedef __off_t off_t; # else # 245 "/usr/include/unistd.h" 3 4 typedef __off64_t off_t; # endif # 247 "/usr/include/unistd.h" 3 4 # define __off_t_defined # endif # 249 "/usr/include/unistd.h" 3 4 # if defined __USE_LARGEFILE64 && !defined __off64_t_defined typedef __off64_t off64_t; # define __off64_t_defined # endif # 253 "/usr/include/unistd.h" 3 4 # ifndef __useconds_t_defined typedef __useconds_t useconds_t; # define __useconds_t_defined # endif # 258 "/usr/include/unistd.h" 3 4 # ifndef __pid_t_defined typedef __pid_t pid_t; # define __pid_t_defined # endif # 263 "/usr/include/unistd.h" 3 4 #endif /* X/Open */ # 264 "/usr/include/unistd.h" 3 4 #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K # ifndef __intptr_t_defined typedef __intptr_t intptr_t; # define __intptr_t_defined # endif # 270 "/usr/include/unistd.h" 3 4 #endif # 271 "/usr/include/unistd.h" 3 4 #if defined __USE_BSD || defined __USE_XOPEN # ifndef __socklen_t_defined typedef __socklen_t socklen_t; # define __socklen_t_defined # endif # 277 "/usr/include/unistd.h" 3 4 #endif # 278 "/usr/include/unistd.h" 3 4 /* Values for the second argument to access. These may be OR'd together. */ #define R_OK 4 /* Test for read permission. */ #define W_OK 2 /* Test for write permission. */ #define X_OK 1 /* Test for execute permission. */ #define F_OK 0 /* Test for existence. */ /* Test for access to NAME using the real UID and real GID. */ extern int access (const char *__name, int __type) __THROW __nonnull ((1)); #ifdef __USE_GNU /* Test for access to NAME using the effective UID and GID (as normal file operations use). */ extern int euidaccess (const char *__name, int __type) __THROW __nonnull ((1)); /* An alias for `euidaccess', used by some other systems. */ extern int eaccess (const char *__name, int __type) __THROW __nonnull ((1)); #endif # 299 "/usr/include/unistd.h" 3 4 #ifdef __USE_ATFILE /* Test for access to FILE relative to the directory FD is open on. If AT_EACCESS is set in FLAG, then use effective IDs like `eaccess', otherwise use real IDs like `access'. */ extern int faccessat (int __fd, const char *__file, int __type, int __flag) __THROW __nonnull ((2)) __wur; #endif /* Use GNU. */ # 307 "/usr/include/unistd.h" 3 4 /* Values for the WHENCE argument to lseek. */ #ifndef _STDIO_H /* has the same definitions. */ # define SEEK_SET 0 /* Seek from beginning of file. */ # define SEEK_CUR 1 /* Seek from current position. */ # define SEEK_END 2 /* Seek from end of file. */ # ifdef __USE_GNU # define SEEK_DATA 3 /* Seek to next data. */ # define SEEK_HOLE 4 /* Seek to next hole. */ # endif # 318 "/usr/include/unistd.h" 3 4 #endif # 319 "/usr/include/unistd.h" 3 4 #if defined __USE_BSD && !defined L_SET /* Old BSD names for the same constants; just for compatibility. */ # define L_SET SEEK_SET # define L_INCR SEEK_CUR # define L_XTND SEEK_END #endif # 326 "/usr/include/unistd.h" 3 4 /* Move FD's file position to OFFSET bytes from the beginning of the file (if WHENCE is SEEK_SET), the current position (if WHENCE is SEEK_CUR), or the end of the file (if WHENCE is SEEK_END). Return the new file position. */ #ifndef __USE_FILE_OFFSET64 extern __off_t lseek (int __fd, __off_t __offset, int __whence) __THROW; #else # 336 "/usr/include/unistd.h" 3 4 # ifdef __REDIRECT_NTH extern __off64_t __REDIRECT_NTH (lseek, (int __fd, __off64_t __offset, int __whence), lseek64); # else # 341 "/usr/include/unistd.h" 3 4 # define lseek lseek64 # endif # 343 "/usr/include/unistd.h" 3 4 #endif # 344 "/usr/include/unistd.h" 3 4 #ifdef __USE_LARGEFILE64 extern __off64_t lseek64 (int __fd, __off64_t __offset, int __whence) __THROW; #endif # 348 "/usr/include/unistd.h" 3 4 /* Close the file descriptor FD. This function is a cancellation point and therefore not marked with __THROW. */ extern int close (int __fd); /* Read NBYTES into BUF from FD. Return the number read, -1 for errors or 0 for EOF. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t read (int __fd, void *__buf, size_t __nbytes) __wur; /* Write N bytes of BUF to FD. Return the number written, or -1. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t write (int __fd, const void *__buf, size_t __n) __wur; #if defined __USE_UNIX98 || defined __USE_XOPEN2K8 # ifndef __USE_FILE_OFFSET64 /* Read NBYTES into BUF from FD at the given position OFFSET without changing the file pointer. Return the number read, -1 for errors or 0 for EOF. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t pread (int __fd, void *__buf, size_t __nbytes, __off_t __offset) __wur; /* Write N bytes of BUF to FD at the given position OFFSET without changing the file pointer. Return the number written, or -1. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t pwrite (int __fd, const void *__buf, size_t __n, __off_t __offset) __wur; # else # 387 "/usr/include/unistd.h" 3 4 # ifdef __REDIRECT extern ssize_t __REDIRECT (pread, (int __fd, void *__buf, size_t __nbytes, __off64_t __offset), pread64) __wur; extern ssize_t __REDIRECT (pwrite, (int __fd, const void *__buf, size_t __nbytes, __off64_t __offset), pwrite64) __wur; # else # 395 "/usr/include/unistd.h" 3 4 # define pread pread64 # define pwrite pwrite64 # endif # 398 "/usr/include/unistd.h" 3 4 # endif # 399 "/usr/include/unistd.h" 3 4 # ifdef __USE_LARGEFILE64 /* Read NBYTES into BUF from FD at the given position OFFSET without changing the file pointer. Return the number read, -1 for errors or 0 for EOF. */ extern ssize_t pread64 (int __fd, void *__buf, size_t __nbytes, __off64_t __offset) __wur; /* Write N bytes of BUF to FD at the given position OFFSET without changing the file pointer. Return the number written, or -1. */ extern ssize_t pwrite64 (int __fd, const void *__buf, size_t __n, __off64_t __offset) __wur; # endif # 411 "/usr/include/unistd.h" 3 4 #endif # 412 "/usr/include/unistd.h" 3 4 /* Create a one-way communication channel (pipe). If successful, two file descriptors are stored in PIPEDES; bytes written on PIPEDES[1] can be read from PIPEDES[0]. Returns 0 if successful, -1 if not. */ extern int pipe (int __pipedes[2]) __THROW __wur; #ifdef __USE_GNU /* Same as pipe but apply flags passed in FLAGS to the new file descriptors. */ extern int pipe2 (int __pipedes[2], int __flags) __THROW __wur; #endif # 424 "/usr/include/unistd.h" 3 4 /* Schedule an alarm. In SECONDS seconds, the process will get a SIGALRM. If SECONDS is zero, any currently scheduled alarm will be cancelled. The function returns the number of seconds remaining until the last alarm scheduled would have signaled, or zero if there wasn't one. There is no return value to indicate an error, but you can set `errno' to 0 and check its value after calling `alarm', and this might tell you. The signal may come late due to processor scheduling. */ extern unsigned int alarm (unsigned int __seconds) __THROW; /* Make the process sleep for SECONDS seconds, or until a signal arrives and is not ignored. The function returns the number of seconds less than SECONDS which it actually slept (thus zero if it slept the full time). If a signal handler does a `longjmp' or modifies the handling of the SIGALRM signal while inside `sleep' call, the handling of the SIGALRM signal afterwards is undefined. There is no return value to indicate error, but if `sleep' returns SECONDS, it probably didn't work. This function is a cancellation point and therefore not marked with __THROW. */ extern unsigned int sleep (unsigned int __seconds); #if (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K8) \ || defined __USE_BSD /* Set an alarm to go off (generating a SIGALRM signal) in VALUE microseconds. If INTERVAL is nonzero, when the alarm goes off, the timer is reset to go off every INTERVAL microseconds thereafter. Returns the number of microseconds remaining before the alarm. */ extern __useconds_t ualarm (__useconds_t __value, __useconds_t __interval) __THROW; /* Sleep USECONDS microseconds, or until a signal arrives that is not blocked or ignored. This function is a cancellation point and therefore not marked with __THROW. */ extern int usleep (__useconds_t __useconds); #endif # 462 "/usr/include/unistd.h" 3 4 /* Suspend the process until a signal arrives. This always returns -1 and sets `errno' to EINTR. This function is a cancellation point and therefore not marked with __THROW. */ extern int pause (void); /* Change the owner and group of FILE. */ extern int chown (const char *__file, __uid_t __owner, __gid_t __group) __THROW __nonnull ((1)) __wur; #if defined __USE_BSD || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 /* Change the owner and group of the file that FD is open on. */ extern int fchown (int __fd, __uid_t __owner, __gid_t __group) __THROW __wur; /* Change owner and group of FILE, if it is a symbolic link the ownership of the symbolic link is changed. */ extern int lchown (const char *__file, __uid_t __owner, __gid_t __group) __THROW __nonnull ((1)) __wur; #endif /* Use BSD || X/Open Unix. */ # 487 "/usr/include/unistd.h" 3 4 #ifdef __USE_ATFILE /* Change the owner and group of FILE relative to the directory FD is open on. */ extern int fchownat (int __fd, const char *__file, __uid_t __owner, __gid_t __group, int __flag) __THROW __nonnull ((2)) __wur; #endif /* Use GNU. */ # 495 "/usr/include/unistd.h" 3 4 /* Change the process's working directory to PATH. */ extern int chdir (const char *__path) __THROW __nonnull ((1)) __wur; #if defined __USE_BSD || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 /* Change the process's working directory to the one FD is open on. */ extern int fchdir (int __fd) __THROW __wur; #endif # 503 "/usr/include/unistd.h" 3 4 /* Get the pathname of the current working directory, and put it in SIZE bytes of BUF. Returns NULL if the directory couldn't be determined or SIZE was too small. If successful, returns BUF. In GNU, if BUF is NULL, an array is allocated with `malloc'; the array is SIZE bytes long, unless SIZE == 0, in which case it is as big as necessary. */ extern char *getcwd (char *__buf, size_t __size) __THROW __wur; #ifdef __USE_GNU /* Return a malloc'd string containing the current directory name. If the environment variable `PWD' is set, and its value is correct, that value is used. */ extern char *get_current_dir_name (void) __THROW; #endif # 519 "/usr/include/unistd.h" 3 4 #if (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K8) \ || defined __USE_BSD /* Put the absolute pathname of the current working directory in BUF. If successful, return BUF. If not, put an error message in BUF and return NULL. BUF should be at least PATH_MAX bytes long. */ extern char *getwd (char *__buf) __THROW __nonnull ((1)) __attribute_deprecated__ __wur; #endif # 528 "/usr/include/unistd.h" 3 4 /* Duplicate FD, returning a new file descriptor on the same file. */ extern int dup (int __fd) __THROW __wur; /* Duplicate FD to FD2, closing FD2 and making it open on the same file. */ extern int dup2 (int __fd, int __fd2) __THROW; #ifdef __USE_GNU /* Duplicate FD to FD2, closing FD2 and making it open on the same file while setting flags according to FLAGS. */ extern int dup3 (int __fd, int __fd2, int __flags) __THROW; #endif # 541 "/usr/include/unistd.h" 3 4 /* NULL-terminated array of "NAME=VALUE" environment variables. */ extern char **__environ; #ifdef __USE_GNU extern char **environ; #endif # 547 "/usr/include/unistd.h" 3 4 /* Replace the current process, executing PATH with arguments ARGV and environment ENVP. ARGV and ENVP are terminated by NULL pointers. */ extern int execve (const char *__path, char *const __argv[], char *const __envp[]) __THROW __nonnull ((1, 2)); #ifdef __USE_XOPEN2K8 /* Execute the file FD refers to, overlaying the running program image. ARGV and ENVP are passed to the new program, as for `execve'. */ extern int fexecve (int __fd, char *const __argv[], char *const __envp[]) __THROW __nonnull ((2)); #endif # 560 "/usr/include/unistd.h" 3 4 /* Execute PATH with arguments ARGV and environment from `environ'. */ extern int execv (const char *__path, char *const __argv[]) __THROW __nonnull ((1, 2)); /* Execute PATH with all arguments after PATH until a NULL pointer, and the argument after that for environment. */ extern int execle (const char *__path, const char *__arg, ...) __THROW __nonnull ((1, 2)); /* Execute PATH with all arguments after PATH until a NULL pointer and environment from `environ'. */ extern int execl (const char *__path, const char *__arg, ...) __THROW __nonnull ((1, 2)); /* Execute FILE, searching in the `PATH' environment variable if it contains no slashes, with arguments ARGV and environment from `environ'. */ extern int execvp (const char *__file, char *const __argv[]) __THROW __nonnull ((1, 2)); /* Execute FILE, searching in the `PATH' environment variable if it contains no slashes, with all arguments after FILE until a NULL pointer and environment from `environ'. */ extern int execlp (const char *__file, const char *__arg, ...) __THROW __nonnull ((1, 2)); #ifdef __USE_GNU /* Execute FILE, searching in the `PATH' environment variable if it contains no slashes, with arguments ARGV and environment from `environ'. */ extern int execvpe (const char *__file, char *const __argv[], char *const __envp[]) __THROW __nonnull ((1, 2)); #endif # 594 "/usr/include/unistd.h" 3 4 #if defined __USE_MISC || defined __USE_XOPEN /* Add INC to priority of the current process. */ extern int nice (int __inc) __THROW __wur; #endif # 600 "/usr/include/unistd.h" 3 4 /* Terminate program execution with the low-order 8 bits of STATUS. */ extern void _exit (int __status) __attribute__ ((__noreturn__)); /* Get the `_PC_*' symbols for the NAME argument to `pathconf' and `fpathconf'; the `_SC_*' symbols for the NAME argument to `sysconf'; and the `_CS_*' symbols for the NAME argument to `confstr'. */ #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 609 "/usr/include/unistd.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/confname.h" 1 3 4 /* `sysconf', `pathconf', and `confstr' NAME values. Generic version. Copyright (C) 1993-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _UNISTD_H # error "Never use directly; include instead." #endif # 22 "/usr/include/x86_64-linux-gnu/bits/confname.h" 3 4 /* Values for the NAME argument to `pathconf' and `fpathconf'. */ enum { _PC_LINK_MAX, #define _PC_LINK_MAX _PC_LINK_MAX _PC_MAX_CANON, #define _PC_MAX_CANON _PC_MAX_CANON _PC_MAX_INPUT, #define _PC_MAX_INPUT _PC_MAX_INPUT _PC_NAME_MAX, #define _PC_NAME_MAX _PC_NAME_MAX _PC_PATH_MAX, #define _PC_PATH_MAX _PC_PATH_MAX _PC_PIPE_BUF, #define _PC_PIPE_BUF _PC_PIPE_BUF _PC_CHOWN_RESTRICTED, #define _PC_CHOWN_RESTRICTED _PC_CHOWN_RESTRICTED _PC_NO_TRUNC, #define _PC_NO_TRUNC _PC_NO_TRUNC _PC_VDISABLE, #define _PC_VDISABLE _PC_VDISABLE _PC_SYNC_IO, #define _PC_SYNC_IO _PC_SYNC_IO _PC_ASYNC_IO, #define _PC_ASYNC_IO _PC_ASYNC_IO _PC_PRIO_IO, #define _PC_PRIO_IO _PC_PRIO_IO _PC_SOCK_MAXBUF, #define _PC_SOCK_MAXBUF _PC_SOCK_MAXBUF _PC_FILESIZEBITS, #define _PC_FILESIZEBITS _PC_FILESIZEBITS _PC_REC_INCR_XFER_SIZE, #define _PC_REC_INCR_XFER_SIZE _PC_REC_INCR_XFER_SIZE _PC_REC_MAX_XFER_SIZE, #define _PC_REC_MAX_XFER_SIZE _PC_REC_MAX_XFER_SIZE _PC_REC_MIN_XFER_SIZE, #define _PC_REC_MIN_XFER_SIZE _PC_REC_MIN_XFER_SIZE _PC_REC_XFER_ALIGN, #define _PC_REC_XFER_ALIGN _PC_REC_XFER_ALIGN _PC_ALLOC_SIZE_MIN, #define _PC_ALLOC_SIZE_MIN _PC_ALLOC_SIZE_MIN _PC_SYMLINK_MAX, #define _PC_SYMLINK_MAX _PC_SYMLINK_MAX _PC_2_SYMLINKS #define _PC_2_SYMLINKS _PC_2_SYMLINKS }; /* Values for the argument to `sysconf'. */ enum { _SC_ARG_MAX, #define _SC_ARG_MAX _SC_ARG_MAX _SC_CHILD_MAX, #define _SC_CHILD_MAX _SC_CHILD_MAX _SC_CLK_TCK, #define _SC_CLK_TCK _SC_CLK_TCK _SC_NGROUPS_MAX, #define _SC_NGROUPS_MAX _SC_NGROUPS_MAX _SC_OPEN_MAX, #define _SC_OPEN_MAX _SC_OPEN_MAX _SC_STREAM_MAX, #define _SC_STREAM_MAX _SC_STREAM_MAX _SC_TZNAME_MAX, #define _SC_TZNAME_MAX _SC_TZNAME_MAX _SC_JOB_CONTROL, #define _SC_JOB_CONTROL _SC_JOB_CONTROL _SC_SAVED_IDS, #define _SC_SAVED_IDS _SC_SAVED_IDS _SC_REALTIME_SIGNALS, #define _SC_REALTIME_SIGNALS _SC_REALTIME_SIGNALS _SC_PRIORITY_SCHEDULING, #define _SC_PRIORITY_SCHEDULING _SC_PRIORITY_SCHEDULING _SC_TIMERS, #define _SC_TIMERS _SC_TIMERS _SC_ASYNCHRONOUS_IO, #define _SC_ASYNCHRONOUS_IO _SC_ASYNCHRONOUS_IO _SC_PRIORITIZED_IO, #define _SC_PRIORITIZED_IO _SC_PRIORITIZED_IO _SC_SYNCHRONIZED_IO, #define _SC_SYNCHRONIZED_IO _SC_SYNCHRONIZED_IO _SC_FSYNC, #define _SC_FSYNC _SC_FSYNC _SC_MAPPED_FILES, #define _SC_MAPPED_FILES _SC_MAPPED_FILES _SC_MEMLOCK, #define _SC_MEMLOCK _SC_MEMLOCK _SC_MEMLOCK_RANGE, #define _SC_MEMLOCK_RANGE _SC_MEMLOCK_RANGE _SC_MEMORY_PROTECTION, #define _SC_MEMORY_PROTECTION _SC_MEMORY_PROTECTION _SC_MESSAGE_PASSING, #define _SC_MESSAGE_PASSING _SC_MESSAGE_PASSING _SC_SEMAPHORES, #define _SC_SEMAPHORES _SC_SEMAPHORES _SC_SHARED_MEMORY_OBJECTS, #define _SC_SHARED_MEMORY_OBJECTS _SC_SHARED_MEMORY_OBJECTS _SC_AIO_LISTIO_MAX, #define _SC_AIO_LISTIO_MAX _SC_AIO_LISTIO_MAX _SC_AIO_MAX, #define _SC_AIO_MAX _SC_AIO_MAX _SC_AIO_PRIO_DELTA_MAX, #define _SC_AIO_PRIO_DELTA_MAX _SC_AIO_PRIO_DELTA_MAX _SC_DELAYTIMER_MAX, #define _SC_DELAYTIMER_MAX _SC_DELAYTIMER_MAX _SC_MQ_OPEN_MAX, #define _SC_MQ_OPEN_MAX _SC_MQ_OPEN_MAX _SC_MQ_PRIO_MAX, #define _SC_MQ_PRIO_MAX _SC_MQ_PRIO_MAX _SC_VERSION, #define _SC_VERSION _SC_VERSION _SC_PAGESIZE, #define _SC_PAGESIZE _SC_PAGESIZE #define _SC_PAGE_SIZE _SC_PAGESIZE _SC_RTSIG_MAX, #define _SC_RTSIG_MAX _SC_RTSIG_MAX _SC_SEM_NSEMS_MAX, #define _SC_SEM_NSEMS_MAX _SC_SEM_NSEMS_MAX _SC_SEM_VALUE_MAX, #define _SC_SEM_VALUE_MAX _SC_SEM_VALUE_MAX _SC_SIGQUEUE_MAX, #define _SC_SIGQUEUE_MAX _SC_SIGQUEUE_MAX _SC_TIMER_MAX, #define _SC_TIMER_MAX _SC_TIMER_MAX /* Values for the argument to `sysconf' corresponding to _POSIX2_* symbols. */ _SC_BC_BASE_MAX, #define _SC_BC_BASE_MAX _SC_BC_BASE_MAX _SC_BC_DIM_MAX, #define _SC_BC_DIM_MAX _SC_BC_DIM_MAX _SC_BC_SCALE_MAX, #define _SC_BC_SCALE_MAX _SC_BC_SCALE_MAX _SC_BC_STRING_MAX, #define _SC_BC_STRING_MAX _SC_BC_STRING_MAX _SC_COLL_WEIGHTS_MAX, #define _SC_COLL_WEIGHTS_MAX _SC_COLL_WEIGHTS_MAX _SC_EQUIV_CLASS_MAX, #define _SC_EQUIV_CLASS_MAX _SC_EQUIV_CLASS_MAX _SC_EXPR_NEST_MAX, #define _SC_EXPR_NEST_MAX _SC_EXPR_NEST_MAX _SC_LINE_MAX, #define _SC_LINE_MAX _SC_LINE_MAX _SC_RE_DUP_MAX, #define _SC_RE_DUP_MAX _SC_RE_DUP_MAX _SC_CHARCLASS_NAME_MAX, #define _SC_CHARCLASS_NAME_MAX _SC_CHARCLASS_NAME_MAX _SC_2_VERSION, #define _SC_2_VERSION _SC_2_VERSION _SC_2_C_BIND, #define _SC_2_C_BIND _SC_2_C_BIND _SC_2_C_DEV, #define _SC_2_C_DEV _SC_2_C_DEV _SC_2_FORT_DEV, #define _SC_2_FORT_DEV _SC_2_FORT_DEV _SC_2_FORT_RUN, #define _SC_2_FORT_RUN _SC_2_FORT_RUN _SC_2_SW_DEV, #define _SC_2_SW_DEV _SC_2_SW_DEV _SC_2_LOCALEDEF, #define _SC_2_LOCALEDEF _SC_2_LOCALEDEF _SC_PII, #define _SC_PII _SC_PII _SC_PII_XTI, #define _SC_PII_XTI _SC_PII_XTI _SC_PII_SOCKET, #define _SC_PII_SOCKET _SC_PII_SOCKET _SC_PII_INTERNET, #define _SC_PII_INTERNET _SC_PII_INTERNET _SC_PII_OSI, #define _SC_PII_OSI _SC_PII_OSI _SC_POLL, #define _SC_POLL _SC_POLL _SC_SELECT, #define _SC_SELECT _SC_SELECT _SC_UIO_MAXIOV, #define _SC_UIO_MAXIOV _SC_UIO_MAXIOV _SC_IOV_MAX = _SC_UIO_MAXIOV, #define _SC_IOV_MAX _SC_IOV_MAX _SC_PII_INTERNET_STREAM, #define _SC_PII_INTERNET_STREAM _SC_PII_INTERNET_STREAM _SC_PII_INTERNET_DGRAM, #define _SC_PII_INTERNET_DGRAM _SC_PII_INTERNET_DGRAM _SC_PII_OSI_COTS, #define _SC_PII_OSI_COTS _SC_PII_OSI_COTS _SC_PII_OSI_CLTS, #define _SC_PII_OSI_CLTS _SC_PII_OSI_CLTS _SC_PII_OSI_M, #define _SC_PII_OSI_M _SC_PII_OSI_M _SC_T_IOV_MAX, #define _SC_T_IOV_MAX _SC_T_IOV_MAX /* Values according to POSIX 1003.1c (POSIX threads). */ _SC_THREADS, #define _SC_THREADS _SC_THREADS _SC_THREAD_SAFE_FUNCTIONS, #define _SC_THREAD_SAFE_FUNCTIONS _SC_THREAD_SAFE_FUNCTIONS _SC_GETGR_R_SIZE_MAX, #define _SC_GETGR_R_SIZE_MAX _SC_GETGR_R_SIZE_MAX _SC_GETPW_R_SIZE_MAX, #define _SC_GETPW_R_SIZE_MAX _SC_GETPW_R_SIZE_MAX _SC_LOGIN_NAME_MAX, #define _SC_LOGIN_NAME_MAX _SC_LOGIN_NAME_MAX _SC_TTY_NAME_MAX, #define _SC_TTY_NAME_MAX _SC_TTY_NAME_MAX _SC_THREAD_DESTRUCTOR_ITERATIONS, #define _SC_THREAD_DESTRUCTOR_ITERATIONS _SC_THREAD_DESTRUCTOR_ITERATIONS _SC_THREAD_KEYS_MAX, #define _SC_THREAD_KEYS_MAX _SC_THREAD_KEYS_MAX _SC_THREAD_STACK_MIN, #define _SC_THREAD_STACK_MIN _SC_THREAD_STACK_MIN _SC_THREAD_THREADS_MAX, #define _SC_THREAD_THREADS_MAX _SC_THREAD_THREADS_MAX _SC_THREAD_ATTR_STACKADDR, #define _SC_THREAD_ATTR_STACKADDR _SC_THREAD_ATTR_STACKADDR _SC_THREAD_ATTR_STACKSIZE, #define _SC_THREAD_ATTR_STACKSIZE _SC_THREAD_ATTR_STACKSIZE _SC_THREAD_PRIORITY_SCHEDULING, #define _SC_THREAD_PRIORITY_SCHEDULING _SC_THREAD_PRIORITY_SCHEDULING _SC_THREAD_PRIO_INHERIT, #define _SC_THREAD_PRIO_INHERIT _SC_THREAD_PRIO_INHERIT _SC_THREAD_PRIO_PROTECT, #define _SC_THREAD_PRIO_PROTECT _SC_THREAD_PRIO_PROTECT _SC_THREAD_PROCESS_SHARED, #define _SC_THREAD_PROCESS_SHARED _SC_THREAD_PROCESS_SHARED _SC_NPROCESSORS_CONF, #define _SC_NPROCESSORS_CONF _SC_NPROCESSORS_CONF _SC_NPROCESSORS_ONLN, #define _SC_NPROCESSORS_ONLN _SC_NPROCESSORS_ONLN _SC_PHYS_PAGES, #define _SC_PHYS_PAGES _SC_PHYS_PAGES _SC_AVPHYS_PAGES, #define _SC_AVPHYS_PAGES _SC_AVPHYS_PAGES _SC_ATEXIT_MAX, #define _SC_ATEXIT_MAX _SC_ATEXIT_MAX _SC_PASS_MAX, #define _SC_PASS_MAX _SC_PASS_MAX _SC_XOPEN_VERSION, #define _SC_XOPEN_VERSION _SC_XOPEN_VERSION _SC_XOPEN_XCU_VERSION, #define _SC_XOPEN_XCU_VERSION _SC_XOPEN_XCU_VERSION _SC_XOPEN_UNIX, #define _SC_XOPEN_UNIX _SC_XOPEN_UNIX _SC_XOPEN_CRYPT, #define _SC_XOPEN_CRYPT _SC_XOPEN_CRYPT _SC_XOPEN_ENH_I18N, #define _SC_XOPEN_ENH_I18N _SC_XOPEN_ENH_I18N _SC_XOPEN_SHM, #define _SC_XOPEN_SHM _SC_XOPEN_SHM _SC_2_CHAR_TERM, #define _SC_2_CHAR_TERM _SC_2_CHAR_TERM _SC_2_C_VERSION, #define _SC_2_C_VERSION _SC_2_C_VERSION _SC_2_UPE, #define _SC_2_UPE _SC_2_UPE _SC_XOPEN_XPG2, #define _SC_XOPEN_XPG2 _SC_XOPEN_XPG2 _SC_XOPEN_XPG3, #define _SC_XOPEN_XPG3 _SC_XOPEN_XPG3 _SC_XOPEN_XPG4, #define _SC_XOPEN_XPG4 _SC_XOPEN_XPG4 _SC_CHAR_BIT, #define _SC_CHAR_BIT _SC_CHAR_BIT _SC_CHAR_MAX, #define _SC_CHAR_MAX _SC_CHAR_MAX _SC_CHAR_MIN, #define _SC_CHAR_MIN _SC_CHAR_MIN _SC_INT_MAX, #define _SC_INT_MAX _SC_INT_MAX _SC_INT_MIN, #define _SC_INT_MIN _SC_INT_MIN _SC_LONG_BIT, #define _SC_LONG_BIT _SC_LONG_BIT _SC_WORD_BIT, #define _SC_WORD_BIT _SC_WORD_BIT _SC_MB_LEN_MAX, #define _SC_MB_LEN_MAX _SC_MB_LEN_MAX _SC_NZERO, #define _SC_NZERO _SC_NZERO _SC_SSIZE_MAX, #define _SC_SSIZE_MAX _SC_SSIZE_MAX _SC_SCHAR_MAX, #define _SC_SCHAR_MAX _SC_SCHAR_MAX _SC_SCHAR_MIN, #define _SC_SCHAR_MIN _SC_SCHAR_MIN _SC_SHRT_MAX, #define _SC_SHRT_MAX _SC_SHRT_MAX _SC_SHRT_MIN, #define _SC_SHRT_MIN _SC_SHRT_MIN _SC_UCHAR_MAX, #define _SC_UCHAR_MAX _SC_UCHAR_MAX _SC_UINT_MAX, #define _SC_UINT_MAX _SC_UINT_MAX _SC_ULONG_MAX, #define _SC_ULONG_MAX _SC_ULONG_MAX _SC_USHRT_MAX, #define _SC_USHRT_MAX _SC_USHRT_MAX _SC_NL_ARGMAX, #define _SC_NL_ARGMAX _SC_NL_ARGMAX _SC_NL_LANGMAX, #define _SC_NL_LANGMAX _SC_NL_LANGMAX _SC_NL_MSGMAX, #define _SC_NL_MSGMAX _SC_NL_MSGMAX _SC_NL_NMAX, #define _SC_NL_NMAX _SC_NL_NMAX _SC_NL_SETMAX, #define _SC_NL_SETMAX _SC_NL_SETMAX _SC_NL_TEXTMAX, #define _SC_NL_TEXTMAX _SC_NL_TEXTMAX _SC_XBS5_ILP32_OFF32, #define _SC_XBS5_ILP32_OFF32 _SC_XBS5_ILP32_OFF32 _SC_XBS5_ILP32_OFFBIG, #define _SC_XBS5_ILP32_OFFBIG _SC_XBS5_ILP32_OFFBIG _SC_XBS5_LP64_OFF64, #define _SC_XBS5_LP64_OFF64 _SC_XBS5_LP64_OFF64 _SC_XBS5_LPBIG_OFFBIG, #define _SC_XBS5_LPBIG_OFFBIG _SC_XBS5_LPBIG_OFFBIG _SC_XOPEN_LEGACY, #define _SC_XOPEN_LEGACY _SC_XOPEN_LEGACY _SC_XOPEN_REALTIME, #define _SC_XOPEN_REALTIME _SC_XOPEN_REALTIME _SC_XOPEN_REALTIME_THREADS, #define _SC_XOPEN_REALTIME_THREADS _SC_XOPEN_REALTIME_THREADS _SC_ADVISORY_INFO, #define _SC_ADVISORY_INFO _SC_ADVISORY_INFO _SC_BARRIERS, #define _SC_BARRIERS _SC_BARRIERS _SC_BASE, #define _SC_BASE _SC_BASE _SC_C_LANG_SUPPORT, #define _SC_C_LANG_SUPPORT _SC_C_LANG_SUPPORT _SC_C_LANG_SUPPORT_R, #define _SC_C_LANG_SUPPORT_R _SC_C_LANG_SUPPORT_R _SC_CLOCK_SELECTION, #define _SC_CLOCK_SELECTION _SC_CLOCK_SELECTION _SC_CPUTIME, #define _SC_CPUTIME _SC_CPUTIME _SC_THREAD_CPUTIME, #define _SC_THREAD_CPUTIME _SC_THREAD_CPUTIME _SC_DEVICE_IO, #define _SC_DEVICE_IO _SC_DEVICE_IO _SC_DEVICE_SPECIFIC, #define _SC_DEVICE_SPECIFIC _SC_DEVICE_SPECIFIC _SC_DEVICE_SPECIFIC_R, #define _SC_DEVICE_SPECIFIC_R _SC_DEVICE_SPECIFIC_R _SC_FD_MGMT, #define _SC_FD_MGMT _SC_FD_MGMT _SC_FIFO, #define _SC_FIFO _SC_FIFO _SC_PIPE, #define _SC_PIPE _SC_PIPE _SC_FILE_ATTRIBUTES, #define _SC_FILE_ATTRIBUTES _SC_FILE_ATTRIBUTES _SC_FILE_LOCKING, #define _SC_FILE_LOCKING _SC_FILE_LOCKING _SC_FILE_SYSTEM, #define _SC_FILE_SYSTEM _SC_FILE_SYSTEM _SC_MONOTONIC_CLOCK, #define _SC_MONOTONIC_CLOCK _SC_MONOTONIC_CLOCK _SC_MULTI_PROCESS, #define _SC_MULTI_PROCESS _SC_MULTI_PROCESS _SC_SINGLE_PROCESS, #define _SC_SINGLE_PROCESS _SC_SINGLE_PROCESS _SC_NETWORKING, #define _SC_NETWORKING _SC_NETWORKING _SC_READER_WRITER_LOCKS, #define _SC_READER_WRITER_LOCKS _SC_READER_WRITER_LOCKS _SC_SPIN_LOCKS, #define _SC_SPIN_LOCKS _SC_SPIN_LOCKS _SC_REGEXP, #define _SC_REGEXP _SC_REGEXP _SC_REGEX_VERSION, #define _SC_REGEX_VERSION _SC_REGEX_VERSION _SC_SHELL, #define _SC_SHELL _SC_SHELL _SC_SIGNALS, #define _SC_SIGNALS _SC_SIGNALS _SC_SPAWN, #define _SC_SPAWN _SC_SPAWN _SC_SPORADIC_SERVER, #define _SC_SPORADIC_SERVER _SC_SPORADIC_SERVER _SC_THREAD_SPORADIC_SERVER, #define _SC_THREAD_SPORADIC_SERVER _SC_THREAD_SPORADIC_SERVER _SC_SYSTEM_DATABASE, #define _SC_SYSTEM_DATABASE _SC_SYSTEM_DATABASE _SC_SYSTEM_DATABASE_R, #define _SC_SYSTEM_DATABASE_R _SC_SYSTEM_DATABASE_R _SC_TIMEOUTS, #define _SC_TIMEOUTS _SC_TIMEOUTS _SC_TYPED_MEMORY_OBJECTS, #define _SC_TYPED_MEMORY_OBJECTS _SC_TYPED_MEMORY_OBJECTS _SC_USER_GROUPS, #define _SC_USER_GROUPS _SC_USER_GROUPS _SC_USER_GROUPS_R, #define _SC_USER_GROUPS_R _SC_USER_GROUPS_R _SC_2_PBS, #define _SC_2_PBS _SC_2_PBS _SC_2_PBS_ACCOUNTING, #define _SC_2_PBS_ACCOUNTING _SC_2_PBS_ACCOUNTING _SC_2_PBS_LOCATE, #define _SC_2_PBS_LOCATE _SC_2_PBS_LOCATE _SC_2_PBS_MESSAGE, #define _SC_2_PBS_MESSAGE _SC_2_PBS_MESSAGE _SC_2_PBS_TRACK, #define _SC_2_PBS_TRACK _SC_2_PBS_TRACK _SC_SYMLOOP_MAX, #define _SC_SYMLOOP_MAX _SC_SYMLOOP_MAX _SC_STREAMS, #define _SC_STREAMS _SC_STREAMS _SC_2_PBS_CHECKPOINT, #define _SC_2_PBS_CHECKPOINT _SC_2_PBS_CHECKPOINT _SC_V6_ILP32_OFF32, #define _SC_V6_ILP32_OFF32 _SC_V6_ILP32_OFF32 _SC_V6_ILP32_OFFBIG, #define _SC_V6_ILP32_OFFBIG _SC_V6_ILP32_OFFBIG _SC_V6_LP64_OFF64, #define _SC_V6_LP64_OFF64 _SC_V6_LP64_OFF64 _SC_V6_LPBIG_OFFBIG, #define _SC_V6_LPBIG_OFFBIG _SC_V6_LPBIG_OFFBIG _SC_HOST_NAME_MAX, #define _SC_HOST_NAME_MAX _SC_HOST_NAME_MAX _SC_TRACE, #define _SC_TRACE _SC_TRACE _SC_TRACE_EVENT_FILTER, #define _SC_TRACE_EVENT_FILTER _SC_TRACE_EVENT_FILTER _SC_TRACE_INHERIT, #define _SC_TRACE_INHERIT _SC_TRACE_INHERIT _SC_TRACE_LOG, #define _SC_TRACE_LOG _SC_TRACE_LOG _SC_LEVEL1_ICACHE_SIZE, #define _SC_LEVEL1_ICACHE_SIZE _SC_LEVEL1_ICACHE_SIZE _SC_LEVEL1_ICACHE_ASSOC, #define _SC_LEVEL1_ICACHE_ASSOC _SC_LEVEL1_ICACHE_ASSOC _SC_LEVEL1_ICACHE_LINESIZE, #define _SC_LEVEL1_ICACHE_LINESIZE _SC_LEVEL1_ICACHE_LINESIZE _SC_LEVEL1_DCACHE_SIZE, #define _SC_LEVEL1_DCACHE_SIZE _SC_LEVEL1_DCACHE_SIZE _SC_LEVEL1_DCACHE_ASSOC, #define _SC_LEVEL1_DCACHE_ASSOC _SC_LEVEL1_DCACHE_ASSOC _SC_LEVEL1_DCACHE_LINESIZE, #define _SC_LEVEL1_DCACHE_LINESIZE _SC_LEVEL1_DCACHE_LINESIZE _SC_LEVEL2_CACHE_SIZE, #define _SC_LEVEL2_CACHE_SIZE _SC_LEVEL2_CACHE_SIZE _SC_LEVEL2_CACHE_ASSOC, #define _SC_LEVEL2_CACHE_ASSOC _SC_LEVEL2_CACHE_ASSOC _SC_LEVEL2_CACHE_LINESIZE, #define _SC_LEVEL2_CACHE_LINESIZE _SC_LEVEL2_CACHE_LINESIZE _SC_LEVEL3_CACHE_SIZE, #define _SC_LEVEL3_CACHE_SIZE _SC_LEVEL3_CACHE_SIZE _SC_LEVEL3_CACHE_ASSOC, #define _SC_LEVEL3_CACHE_ASSOC _SC_LEVEL3_CACHE_ASSOC _SC_LEVEL3_CACHE_LINESIZE, #define _SC_LEVEL3_CACHE_LINESIZE _SC_LEVEL3_CACHE_LINESIZE _SC_LEVEL4_CACHE_SIZE, #define _SC_LEVEL4_CACHE_SIZE _SC_LEVEL4_CACHE_SIZE _SC_LEVEL4_CACHE_ASSOC, #define _SC_LEVEL4_CACHE_ASSOC _SC_LEVEL4_CACHE_ASSOC _SC_LEVEL4_CACHE_LINESIZE, #define _SC_LEVEL4_CACHE_LINESIZE _SC_LEVEL4_CACHE_LINESIZE /* Leave room here, maybe we need a few more cache levels some day. */ _SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50, #define _SC_IPV6 _SC_IPV6 _SC_RAW_SOCKETS, #define _SC_RAW_SOCKETS _SC_RAW_SOCKETS _SC_V7_ILP32_OFF32, #define _SC_V7_ILP32_OFF32 _SC_V7_ILP32_OFF32 _SC_V7_ILP32_OFFBIG, #define _SC_V7_ILP32_OFFBIG _SC_V7_ILP32_OFFBIG _SC_V7_LP64_OFF64, #define _SC_V7_LP64_OFF64 _SC_V7_LP64_OFF64 _SC_V7_LPBIG_OFFBIG, #define _SC_V7_LPBIG_OFFBIG _SC_V7_LPBIG_OFFBIG _SC_SS_REPL_MAX, #define _SC_SS_REPL_MAX _SC_SS_REPL_MAX _SC_TRACE_EVENT_NAME_MAX, #define _SC_TRACE_EVENT_NAME_MAX _SC_TRACE_EVENT_NAME_MAX _SC_TRACE_NAME_MAX, #define _SC_TRACE_NAME_MAX _SC_TRACE_NAME_MAX _SC_TRACE_SYS_MAX, #define _SC_TRACE_SYS_MAX _SC_TRACE_SYS_MAX _SC_TRACE_USER_EVENT_MAX, #define _SC_TRACE_USER_EVENT_MAX _SC_TRACE_USER_EVENT_MAX _SC_XOPEN_STREAMS, #define _SC_XOPEN_STREAMS _SC_XOPEN_STREAMS _SC_THREAD_ROBUST_PRIO_INHERIT, #define _SC_THREAD_ROBUST_PRIO_INHERIT _SC_THREAD_ROBUST_PRIO_INHERIT _SC_THREAD_ROBUST_PRIO_PROTECT #define _SC_THREAD_ROBUST_PRIO_PROTECT _SC_THREAD_ROBUST_PRIO_PROTECT }; /* Values for the NAME argument to `confstr'. */ enum { _CS_PATH, /* The default search path. */ #define _CS_PATH _CS_PATH _CS_V6_WIDTH_RESTRICTED_ENVS, #define _CS_V6_WIDTH_RESTRICTED_ENVS _CS_V6_WIDTH_RESTRICTED_ENVS #define _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS _CS_V6_WIDTH_RESTRICTED_ENVS _CS_GNU_LIBC_VERSION, #define _CS_GNU_LIBC_VERSION _CS_GNU_LIBC_VERSION _CS_GNU_LIBPTHREAD_VERSION, #define _CS_GNU_LIBPTHREAD_VERSION _CS_GNU_LIBPTHREAD_VERSION _CS_V5_WIDTH_RESTRICTED_ENVS, #define _CS_V5_WIDTH_RESTRICTED_ENVS _CS_V5_WIDTH_RESTRICTED_ENVS #define _CS_POSIX_V5_WIDTH_RESTRICTED_ENVS _CS_V5_WIDTH_RESTRICTED_ENVS _CS_V7_WIDTH_RESTRICTED_ENVS, #define _CS_V7_WIDTH_RESTRICTED_ENVS _CS_V7_WIDTH_RESTRICTED_ENVS #define _CS_POSIX_V7_WIDTH_RESTRICTED_ENVS _CS_V7_WIDTH_RESTRICTED_ENVS _CS_LFS_CFLAGS = 1000, #define _CS_LFS_CFLAGS _CS_LFS_CFLAGS _CS_LFS_LDFLAGS, #define _CS_LFS_LDFLAGS _CS_LFS_LDFLAGS _CS_LFS_LIBS, #define _CS_LFS_LIBS _CS_LFS_LIBS _CS_LFS_LINTFLAGS, #define _CS_LFS_LINTFLAGS _CS_LFS_LINTFLAGS _CS_LFS64_CFLAGS, #define _CS_LFS64_CFLAGS _CS_LFS64_CFLAGS _CS_LFS64_LDFLAGS, #define _CS_LFS64_LDFLAGS _CS_LFS64_LDFLAGS _CS_LFS64_LIBS, #define _CS_LFS64_LIBS _CS_LFS64_LIBS _CS_LFS64_LINTFLAGS, #define _CS_LFS64_LINTFLAGS _CS_LFS64_LINTFLAGS _CS_XBS5_ILP32_OFF32_CFLAGS = 1100, #define _CS_XBS5_ILP32_OFF32_CFLAGS _CS_XBS5_ILP32_OFF32_CFLAGS _CS_XBS5_ILP32_OFF32_LDFLAGS, #define _CS_XBS5_ILP32_OFF32_LDFLAGS _CS_XBS5_ILP32_OFF32_LDFLAGS _CS_XBS5_ILP32_OFF32_LIBS, #define _CS_XBS5_ILP32_OFF32_LIBS _CS_XBS5_ILP32_OFF32_LIBS _CS_XBS5_ILP32_OFF32_LINTFLAGS, #define _CS_XBS5_ILP32_OFF32_LINTFLAGS _CS_XBS5_ILP32_OFF32_LINTFLAGS _CS_XBS5_ILP32_OFFBIG_CFLAGS, #define _CS_XBS5_ILP32_OFFBIG_CFLAGS _CS_XBS5_ILP32_OFFBIG_CFLAGS _CS_XBS5_ILP32_OFFBIG_LDFLAGS, #define _CS_XBS5_ILP32_OFFBIG_LDFLAGS _CS_XBS5_ILP32_OFFBIG_LDFLAGS _CS_XBS5_ILP32_OFFBIG_LIBS, #define _CS_XBS5_ILP32_OFFBIG_LIBS _CS_XBS5_ILP32_OFFBIG_LIBS _CS_XBS5_ILP32_OFFBIG_LINTFLAGS, #define _CS_XBS5_ILP32_OFFBIG_LINTFLAGS _CS_XBS5_ILP32_OFFBIG_LINTFLAGS _CS_XBS5_LP64_OFF64_CFLAGS, #define _CS_XBS5_LP64_OFF64_CFLAGS _CS_XBS5_LP64_OFF64_CFLAGS _CS_XBS5_LP64_OFF64_LDFLAGS, #define _CS_XBS5_LP64_OFF64_LDFLAGS _CS_XBS5_LP64_OFF64_LDFLAGS _CS_XBS5_LP64_OFF64_LIBS, #define _CS_XBS5_LP64_OFF64_LIBS _CS_XBS5_LP64_OFF64_LIBS _CS_XBS5_LP64_OFF64_LINTFLAGS, #define _CS_XBS5_LP64_OFF64_LINTFLAGS _CS_XBS5_LP64_OFF64_LINTFLAGS _CS_XBS5_LPBIG_OFFBIG_CFLAGS, #define _CS_XBS5_LPBIG_OFFBIG_CFLAGS _CS_XBS5_LPBIG_OFFBIG_CFLAGS _CS_XBS5_LPBIG_OFFBIG_LDFLAGS, #define _CS_XBS5_LPBIG_OFFBIG_LDFLAGS _CS_XBS5_LPBIG_OFFBIG_LDFLAGS _CS_XBS5_LPBIG_OFFBIG_LIBS, #define _CS_XBS5_LPBIG_OFFBIG_LIBS _CS_XBS5_LPBIG_OFFBIG_LIBS _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS, #define _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS _CS_POSIX_V6_ILP32_OFF32_CFLAGS, #define _CS_POSIX_V6_ILP32_OFF32_CFLAGS _CS_POSIX_V6_ILP32_OFF32_CFLAGS _CS_POSIX_V6_ILP32_OFF32_LDFLAGS, #define _CS_POSIX_V6_ILP32_OFF32_LDFLAGS _CS_POSIX_V6_ILP32_OFF32_LDFLAGS _CS_POSIX_V6_ILP32_OFF32_LIBS, #define _CS_POSIX_V6_ILP32_OFF32_LIBS _CS_POSIX_V6_ILP32_OFF32_LIBS _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS, #define _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS, #define _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS, #define _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS _CS_POSIX_V6_ILP32_OFFBIG_LIBS, #define _CS_POSIX_V6_ILP32_OFFBIG_LIBS _CS_POSIX_V6_ILP32_OFFBIG_LIBS _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS, #define _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS _CS_POSIX_V6_LP64_OFF64_CFLAGS, #define _CS_POSIX_V6_LP64_OFF64_CFLAGS _CS_POSIX_V6_LP64_OFF64_CFLAGS _CS_POSIX_V6_LP64_OFF64_LDFLAGS, #define _CS_POSIX_V6_LP64_OFF64_LDFLAGS _CS_POSIX_V6_LP64_OFF64_LDFLAGS _CS_POSIX_V6_LP64_OFF64_LIBS, #define _CS_POSIX_V6_LP64_OFF64_LIBS _CS_POSIX_V6_LP64_OFF64_LIBS _CS_POSIX_V6_LP64_OFF64_LINTFLAGS, #define _CS_POSIX_V6_LP64_OFF64_LINTFLAGS _CS_POSIX_V6_LP64_OFF64_LINTFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS, #define _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS, #define _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_LIBS, #define _CS_POSIX_V6_LPBIG_OFFBIG_LIBS _CS_POSIX_V6_LPBIG_OFFBIG_LIBS _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS, #define _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS _CS_POSIX_V7_ILP32_OFF32_CFLAGS, #define _CS_POSIX_V7_ILP32_OFF32_CFLAGS _CS_POSIX_V7_ILP32_OFF32_CFLAGS _CS_POSIX_V7_ILP32_OFF32_LDFLAGS, #define _CS_POSIX_V7_ILP32_OFF32_LDFLAGS _CS_POSIX_V7_ILP32_OFF32_LDFLAGS _CS_POSIX_V7_ILP32_OFF32_LIBS, #define _CS_POSIX_V7_ILP32_OFF32_LIBS _CS_POSIX_V7_ILP32_OFF32_LIBS _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS, #define _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS, #define _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS, #define _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS _CS_POSIX_V7_ILP32_OFFBIG_LIBS, #define _CS_POSIX_V7_ILP32_OFFBIG_LIBS _CS_POSIX_V7_ILP32_OFFBIG_LIBS _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS, #define _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS _CS_POSIX_V7_LP64_OFF64_CFLAGS, #define _CS_POSIX_V7_LP64_OFF64_CFLAGS _CS_POSIX_V7_LP64_OFF64_CFLAGS _CS_POSIX_V7_LP64_OFF64_LDFLAGS, #define _CS_POSIX_V7_LP64_OFF64_LDFLAGS _CS_POSIX_V7_LP64_OFF64_LDFLAGS _CS_POSIX_V7_LP64_OFF64_LIBS, #define _CS_POSIX_V7_LP64_OFF64_LIBS _CS_POSIX_V7_LP64_OFF64_LIBS _CS_POSIX_V7_LP64_OFF64_LINTFLAGS, #define _CS_POSIX_V7_LP64_OFF64_LINTFLAGS _CS_POSIX_V7_LP64_OFF64_LINTFLAGS _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS, #define _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS, #define _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS _CS_POSIX_V7_LPBIG_OFFBIG_LIBS, #define _CS_POSIX_V7_LPBIG_OFFBIG_LIBS _CS_POSIX_V7_LPBIG_OFFBIG_LIBS _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS, #define _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS _CS_V6_ENV, #define _CS_V6_ENV _CS_V6_ENV _CS_V7_ENV #define _CS_V7_ENV _CS_V7_ENV }; # 610 "/usr/include/unistd.h" 2 3 4 /* Get file-specific configuration information about PATH. */ extern long int pathconf (const char *__path, int __name) __THROW __nonnull ((1)); /* Get file-specific configuration about descriptor FD. */ extern long int fpathconf (int __fd, int __name) __THROW; /* Get the value of the system variable NAME. */ extern long int sysconf (int __name) __THROW; #ifdef __USE_POSIX2 /* Get the value of the string-valued system variable NAME. */ extern size_t confstr (int __name, char *__buf, size_t __len) __THROW; #endif # 625 "/usr/include/unistd.h" 3 4 /* Get the process ID of the calling process. */ extern __pid_t getpid (void) __THROW; /* Get the process ID of the calling process's parent. */ extern __pid_t getppid (void) __THROW; /* Get the process group ID of the calling process. */ extern __pid_t getpgrp (void) __THROW; /* Get the process group ID of process PID. */ extern __pid_t __getpgid (__pid_t __pid) __THROW; #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 extern __pid_t getpgid (__pid_t __pid) __THROW; #endif # 641 "/usr/include/unistd.h" 3 4 /* Set the process group ID of the process matching PID to PGID. If PID is zero, the current process's process group ID is set. If PGID is zero, the process ID of the process is used. */ extern int setpgid (__pid_t __pid, __pid_t __pgid) __THROW; #if defined __USE_SVID || defined __USE_BSD || defined __USE_XOPEN_EXTENDED /* Both System V and BSD have `setpgrp' functions, but with different calling conventions. The BSD function is the same as POSIX.1 `setpgid' (above). The System V function takes no arguments and puts the calling process in its on group like `setpgid (0, 0)'. New programs should always use `setpgid' instead. GNU provides the POSIX.1 function. */ /* Set the process group ID of the calling process to its own PID. This is exactly the same as `setpgid (0, 0)'. */ extern int setpgrp (void) __THROW; #endif /* Use SVID or BSD. */ # 663 "/usr/include/unistd.h" 3 4 /* Create a new session with the calling process as its leader. The process group IDs of the session and the calling process are set to the process ID of the calling process, which is returned. */ extern __pid_t setsid (void) __THROW; #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 /* Return the session ID of the given process. */ extern __pid_t getsid (__pid_t __pid) __THROW; #endif # 673 "/usr/include/unistd.h" 3 4 /* Get the real user ID of the calling process. */ extern __uid_t getuid (void) __THROW; /* Get the effective user ID of the calling process. */ extern __uid_t geteuid (void) __THROW; /* Get the real group ID of the calling process. */ extern __gid_t getgid (void) __THROW; /* Get the effective group ID of the calling process. */ extern __gid_t getegid (void) __THROW; /* If SIZE is zero, return the number of supplementary groups the calling process is in. Otherwise, fill in the group IDs of its supplementary groups in LIST and return the number written. */ extern int getgroups (int __size, __gid_t __list[]) __THROW __wur; #ifdef __USE_GNU /* Return nonzero iff the calling process is in group GID. */ extern int group_member (__gid_t __gid) __THROW; #endif # 695 "/usr/include/unistd.h" 3 4 /* Set the user ID of the calling process to UID. If the calling process is the super-user, set the real and effective user IDs, and the saved set-user-ID to UID; if not, the effective user ID is set to UID. */ extern int setuid (__uid_t __uid) __THROW __wur; #if defined __USE_BSD || defined __USE_XOPEN_EXTENDED /* Set the real user ID of the calling process to RUID, and the effective user ID of the calling process to EUID. */ extern int setreuid (__uid_t __ruid, __uid_t __euid) __THROW __wur; #endif # 707 "/usr/include/unistd.h" 3 4 #if defined __USE_BSD || defined __USE_XOPEN2K /* Set the effective user ID of the calling process to UID. */ extern int seteuid (__uid_t __uid) __THROW __wur; #endif /* Use BSD. */ # 712 "/usr/include/unistd.h" 3 4 /* Set the group ID of the calling process to GID. If the calling process is the super-user, set the real and effective group IDs, and the saved set-group-ID to GID; if not, the effective group ID is set to GID. */ extern int setgid (__gid_t __gid) __THROW __wur; #if defined __USE_BSD || defined __USE_XOPEN_EXTENDED /* Set the real group ID of the calling process to RGID, and the effective group ID of the calling process to EGID. */ extern int setregid (__gid_t __rgid, __gid_t __egid) __THROW __wur; #endif # 724 "/usr/include/unistd.h" 3 4 #if defined __USE_BSD || defined __USE_XOPEN2K /* Set the effective group ID of the calling process to GID. */ extern int setegid (__gid_t __gid) __THROW __wur; #endif /* Use BSD. */ # 729 "/usr/include/unistd.h" 3 4 #ifdef __USE_GNU /* Fetch the real user ID, effective user ID, and saved-set user ID, of the calling process. */ extern int getresuid (__uid_t *__ruid, __uid_t *__euid, __uid_t *__suid) __THROW; /* Fetch the real group ID, effective group ID, and saved-set group ID, of the calling process. */ extern int getresgid (__gid_t *__rgid, __gid_t *__egid, __gid_t *__sgid) __THROW; /* Set the real user ID, effective user ID, and saved-set user ID, of the calling process to RUID, EUID, and SUID, respectively. */ extern int setresuid (__uid_t __ruid, __uid_t __euid, __uid_t __suid) __THROW __wur; /* Set the real group ID, effective group ID, and saved-set group ID, of the calling process to RGID, EGID, and SGID, respectively. */ extern int setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid) __THROW __wur; #endif # 751 "/usr/include/unistd.h" 3 4 /* Clone the calling process, creating an exact copy. Return -1 for errors, 0 to the new process, and the process ID of the new process to the old process. */ extern __pid_t fork (void) __THROWNL; #if (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K8) \ || defined __USE_BSD /* Clone the calling process, but without copying the whole address space. The calling process is suspended until the new process exits or is replaced by a call to `execve'. Return -1 for errors, 0 to the new process, and the process ID of the new process to the old process. */ extern __pid_t vfork (void) __THROW; #endif /* Use BSD or XPG < 7. */ # 766 "/usr/include/unistd.h" 3 4 /* Return the pathname of the terminal FD is open on, or NULL on errors. The returned storage is good only until the next call to this function. */ extern char *ttyname (int __fd) __THROW; /* Store at most BUFLEN characters of the pathname of the terminal FD is open on in BUF. Return 0 on success, otherwise an error number. */ extern int ttyname_r (int __fd, char *__buf, size_t __buflen) __THROW __nonnull ((2)) __wur; /* Return 1 if FD is a valid descriptor associated with a terminal, zero if not. */ extern int isatty (int __fd) __THROW; #if defined __USE_BSD \ || (defined __USE_XOPEN_EXTENDED && !defined __USE_UNIX98) /* Return the index into the active-logins file (utmp) for the controlling terminal. */ extern int ttyslot (void) __THROW; #endif # 787 "/usr/include/unistd.h" 3 4 /* Make a link to FROM named TO. */ extern int link (const char *__from, const char *__to) __THROW __nonnull ((1, 2)) __wur; #ifdef __USE_ATFILE /* Like link but relative paths in TO and FROM are interpreted relative to FROMFD and TOFD respectively. */ extern int linkat (int __fromfd, const char *__from, int __tofd, const char *__to, int __flags) __THROW __nonnull ((2, 4)) __wur; #endif # 800 "/usr/include/unistd.h" 3 4 #if defined __USE_BSD || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K /* Make a symbolic link to FROM named TO. */ extern int symlink (const char *__from, const char *__to) __THROW __nonnull ((1, 2)) __wur; /* Read the contents of the symbolic link PATH into no more than LEN bytes of BUF. The contents are not null-terminated. Returns the number of characters read, or -1 for errors. */ extern ssize_t readlink (const char *__restrict __path, char *__restrict __buf, size_t __len) __THROW __nonnull ((1, 2)) __wur; #endif /* Use BSD. */ # 813 "/usr/include/unistd.h" 3 4 #ifdef __USE_ATFILE /* Like symlink but a relative path in TO is interpreted relative to TOFD. */ extern int symlinkat (const char *__from, int __tofd, const char *__to) __THROW __nonnull ((1, 3)) __wur; /* Like readlink but a relative PATH is interpreted relative to FD. */ extern ssize_t readlinkat (int __fd, const char *__restrict __path, char *__restrict __buf, size_t __len) __THROW __nonnull ((2, 3)) __wur; #endif # 824 "/usr/include/unistd.h" 3 4 /* Remove the link NAME. */ extern int unlink (const char *__name) __THROW __nonnull ((1)); #ifdef __USE_ATFILE /* Remove the link NAME relative to FD. */ extern int unlinkat (int __fd, const char *__name, int __flag) __THROW __nonnull ((2)); #endif # 833 "/usr/include/unistd.h" 3 4 /* Remove the directory PATH. */ extern int rmdir (const char *__path) __THROW __nonnull ((1)); /* Return the foreground process group ID of FD. */ extern __pid_t tcgetpgrp (int __fd) __THROW; /* Set the foreground process group ID of FD set PGRP_ID. */ extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) __THROW; /* Return the login name of the user. This function is a possible cancellation point and therefore not marked with __THROW. */ extern char *getlogin (void); #if defined __USE_REENTRANT || defined __USE_POSIX199506 /* Return at most NAME_LEN characters of the login name of the user in NAME. If it cannot be determined or some other error occurred, return the error code. Otherwise return 0. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int getlogin_r (char *__name, size_t __name_len) __nonnull ((1)); #endif # 859 "/usr/include/unistd.h" 3 4 #ifdef __USE_BSD /* Set the login name returned by `getlogin'. */ extern int setlogin (const char *__name) __THROW __nonnull ((1)); #endif # 864 "/usr/include/unistd.h" 3 4 #ifdef __USE_POSIX2 /* Get definitions and prototypes for functions to process the arguments in ARGV (ARGC of them, minus the program name) for options given in OPTS. */ # define __need_getopt #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 871 "/usr/include/unistd.h" 3 4 # 1 "/usr/include/getopt.h" 1 3 4 /* Declarations for getopt. Copyright (C) 1989-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _GETOPT_H #ifndef __need_getopt # define _GETOPT_H 1 #endif # 24 "/usr/include/getopt.h" 3 4 /* If __GNU_LIBRARY__ is not already defined, either we are being used standalone, or this is the first header included in the source file. If we are being used with glibc, we need to include , but that does not exist if we are standalone. So: if __GNU_LIBRARY__ is not defined, include , which will pull in for us if it's from glibc. (Why ctype.h? It's guaranteed to exist and it doesn't flood the namespace with stuff the way some other headers do.) */ #if !defined __GNU_LIBRARY__ #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 33 "/usr/include/getopt.h" 3 4 # 34 "/usr/include/getopt.h" 3 4 #endif # 35 "/usr/include/getopt.h" 3 4 #ifndef __THROW # ifndef __GNUC_PREREQ # define __GNUC_PREREQ(maj, min) (0) # endif # 40 "/usr/include/getopt.h" 3 4 # if defined __cplusplus && __GNUC_PREREQ (2,8) # define __THROW throw () # else # 43 "/usr/include/getopt.h" 3 4 # define __THROW # endif # 45 "/usr/include/getopt.h" 3 4 #endif # 46 "/usr/include/getopt.h" 3 4 #ifdef __cplusplus extern "C" { #endif # 50 "/usr/include/getopt.h" 3 4 /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ extern char *optarg; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to `getopt'. On entry to `getopt', zero means this is the first call; initialize. When `getopt' returns -1, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ extern int optind; /* Callers store zero here to inhibit the error message `getopt' prints for unrecognized options. */ extern int opterr; /* Set to an option character which was unrecognized. */ extern int optopt; #ifndef __need_getopt /* Describe the long-named options requested by the application. The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector of `struct option' terminated by an element containing a name which is zero. The field `has_arg' is: no_argument (or 0) if the option does not take an argument, required_argument (or 1) if the option requires an argument, optional_argument (or 2) if the option takes an optional argument. If the field `flag' is not NULL, it points to a variable that is set to the value given in the field `val' when the option is found, but left unchanged if the option is not found. To have a long-named option do something other than set an `int' to a compiled-in constant, such as set a value from `optarg', set the option's `flag' field to zero and its `val' field to a nonzero value (the equivalent single-letter option character, if there is one). For long options that have a zero `flag' field, `getopt' returns the contents of the `val' field. */ struct option { const char *name; /* has_arg can't be an enum because some compilers complain about type mismatches in all the code that assumes it is an int. */ int has_arg; int *flag; int val; }; /* Names for the values of the `has_arg' field of `struct option'. */ # define no_argument 0 # define required_argument 1 # define optional_argument 2 #endif /* need getopt */ # 120 "/usr/include/getopt.h" 3 4 /* Get definitions and prototypes for functions to process the arguments in ARGV (ARGC of them, minus the program name) for options given in OPTS. Return the option character from OPTS just read. Return -1 when there are no more options. For unrecognized options, or options missing arguments, `optopt' is set to the option letter, and '?' is returned. The OPTS string is a list of characters which are recognized option letters, optionally followed by colons, specifying that that letter takes an argument, to be placed in `optarg'. If a letter in OPTS is followed by two colons, its argument is optional. This behavior is specific to the GNU `getopt'. The argument `--' causes premature termination of argument scanning, explicitly telling `getopt' that there are no more options. If OPTS begins with `--', then non-option arguments are treated as arguments to the option '\0'. This behavior is specific to the GNU `getopt'. */ #ifdef __GNU_LIBRARY__ /* Many other libraries have conflicting prototypes for getopt, with differences in the consts, in stdlib.h. To avoid compilation errors, only prototype getopt for the GNU C library. */ extern int getopt (int ___argc, char *const *___argv, const char *__shortopts) __THROW; # if defined __need_getopt && defined __USE_POSIX2 \ && !defined __USE_POSIX_IMPLICITLY && !defined __USE_GNU /* The GNU getopt has more functionality than the standard version. The additional functionality can be disable at runtime. This redirection helps to also do this at runtime. */ # ifdef __REDIRECT extern int __REDIRECT_NTH (getopt, (int ___argc, char *const *___argv, const char *__shortopts), __posix_getopt); # else # 163 "/usr/include/getopt.h" 3 4 extern int __posix_getopt (int ___argc, char *const *___argv, const char *__shortopts) __THROW; # define getopt __posix_getopt # endif # 167 "/usr/include/getopt.h" 3 4 # endif # 168 "/usr/include/getopt.h" 3 4 #else /* not __GNU_LIBRARY__ */ # 169 "/usr/include/getopt.h" 3 4 extern int getopt (); #endif /* __GNU_LIBRARY__ */ # 171 "/usr/include/getopt.h" 3 4 #ifndef __need_getopt extern int getopt_long (int ___argc, char *const *___argv, const char *__shortopts, const struct option *__longopts, int *__longind) __THROW; extern int getopt_long_only (int ___argc, char *const *___argv, const char *__shortopts, const struct option *__longopts, int *__longind) __THROW; #endif # 183 "/usr/include/getopt.h" 3 4 #ifdef __cplusplus } #endif # 187 "/usr/include/getopt.h" 3 4 /* Make sure we later can get all the definitions and declarations. */ #undef __need_getopt #endif /* getopt.h */ # 192 "/usr/include/getopt.h" 3 4 # 872 "/usr/include/unistd.h" 2 3 4 #endif # 873 "/usr/include/unistd.h" 3 4 #if defined __USE_BSD || defined __USE_UNIX98 || defined __USE_XOPEN2K /* Put the name of the current host in no more than LEN bytes of NAME. The result is null-terminated if LEN is large enough for the full name and the terminator. */ extern int gethostname (char *__name, size_t __len) __THROW __nonnull ((1)); #endif # 881 "/usr/include/unistd.h" 3 4 #if defined __USE_BSD || (defined __USE_XOPEN && !defined __USE_UNIX98) /* Set the name of the current host to NAME, which is LEN bytes long. This call is restricted to the super-user. */ extern int sethostname (const char *__name, size_t __len) __THROW __nonnull ((1)) __wur; /* Set the current machine's Internet number to ID. This call is restricted to the super-user. */ extern int sethostid (long int __id) __THROW __wur; /* Get and set the NIS (aka YP) domain name, if any. Called just like `gethostname' and `sethostname'. The NIS domain name is usually the empty string when not using NIS. */ extern int getdomainname (char *__name, size_t __len) __THROW __nonnull ((1)) __wur; extern int setdomainname (const char *__name, size_t __len) __THROW __nonnull ((1)) __wur; /* Revoke access permissions to all processes currently communicating with the control terminal, and then send a SIGHUP signal to the process group of the control terminal. */ extern int vhangup (void) __THROW; /* Revoke the access of all descriptors currently open on FILE. */ extern int revoke (const char *__file) __THROW __nonnull ((1)) __wur; /* Enable statistical profiling, writing samples of the PC into at most SIZE bytes of SAMPLE_BUFFER; every processor clock tick while profiling is enabled, the system examines the user PC and increments SAMPLE_BUFFER[((PC - OFFSET) / 2) * SCALE / 65536]. If SCALE is zero, disable profiling. Returns zero on success, -1 on error. */ extern int profil (unsigned short int *__sample_buffer, size_t __size, size_t __offset, unsigned int __scale) __THROW __nonnull ((1)); /* Turn accounting on if NAME is an existing file. The system will then write a record for each process as it terminates, to this file. If NAME is NULL, turn accounting off. This call is restricted to the super-user. */ extern int acct (const char *__name) __THROW; /* Successive calls return the shells listed in `/etc/shells'. */ extern char *getusershell (void) __THROW; extern void endusershell (void) __THROW; /* Discard cached info. */ extern void setusershell (void) __THROW; /* Rewind and re-read the file. */ /* Put the program in the background, and dissociate from the controlling terminal. If NOCHDIR is zero, do `chdir ("/")'. If NOCLOSE is zero, redirects stdin, stdout, and stderr to /dev/null. */ extern int daemon (int __nochdir, int __noclose) __THROW __wur; #endif /* Use BSD || X/Open. */ # 939 "/usr/include/unistd.h" 3 4 #if defined __USE_BSD || (defined __USE_XOPEN && !defined __USE_XOPEN2K) /* Make PATH be the root directory (the starting point for absolute paths). This call is restricted to the super-user. */ extern int chroot (const char *__path) __THROW __nonnull ((1)) __wur; /* Prompt with PROMPT and read a string from the terminal without echoing. Uses /dev/tty if possible; otherwise stderr and stdin. */ extern char *getpass (const char *__prompt) __nonnull ((1)); #endif /* Use BSD || X/Open. */ # 950 "/usr/include/unistd.h" 3 4 /* Make all changes done to FD actually appear on disk. This function is a cancellation point and therefore not marked with __THROW. */ extern int fsync (int __fd); #ifdef __USE_GNU /* Make all changes done to all files on the file system associated with FD actually appear on disk. */ extern int syncfs (int __fd) __THROW; #endif # 964 "/usr/include/unistd.h" 3 4 #if defined __USE_BSD || defined __USE_XOPEN_EXTENDED /* Return identifier for the current host. */ extern long int gethostid (void); /* Make all changes done to all files actually appear on disk. */ extern void sync (void) __THROW; # if defined __USE_BSD || !defined __USE_XOPEN2K /* Return the number of bytes in a page. This is the system's page size, which is not necessarily the same as the hardware page size. */ extern int getpagesize (void) __THROW __attribute__ ((__const__)); /* Return the maximum number of file descriptors the current process could possibly have. */ extern int getdtablesize (void) __THROW; # endif # 985 "/usr/include/unistd.h" 3 4 #endif /* Use BSD || X/Open Unix. */ # 987 "/usr/include/unistd.h" 3 4 #if defined __USE_BSD || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 /* Truncate FILE to LENGTH bytes. */ # ifndef __USE_FILE_OFFSET64 extern int truncate (const char *__file, __off_t __length) __THROW __nonnull ((1)) __wur; # else # 996 "/usr/include/unistd.h" 3 4 # ifdef __REDIRECT_NTH extern int __REDIRECT_NTH (truncate, (const char *__file, __off64_t __length), truncate64) __nonnull ((1)) __wur; # else # 1001 "/usr/include/unistd.h" 3 4 # define truncate truncate64 # endif # 1003 "/usr/include/unistd.h" 3 4 # endif # 1004 "/usr/include/unistd.h" 3 4 # ifdef __USE_LARGEFILE64 extern int truncate64 (const char *__file, __off64_t __length) __THROW __nonnull ((1)) __wur; # endif # 1008 "/usr/include/unistd.h" 3 4 #endif /* Use BSD || X/Open Unix || POSIX 2008. */ # 1010 "/usr/include/unistd.h" 3 4 #if defined __USE_BSD || defined __USE_POSIX199309 \ || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K /* Truncate the file FD is open on to LENGTH bytes. */ # ifndef __USE_FILE_OFFSET64 extern int ftruncate (int __fd, __off_t __length) __THROW __wur; # else # 1018 "/usr/include/unistd.h" 3 4 # ifdef __REDIRECT_NTH extern int __REDIRECT_NTH (ftruncate, (int __fd, __off64_t __length), ftruncate64) __wur; # else # 1022 "/usr/include/unistd.h" 3 4 # define ftruncate ftruncate64 # endif # 1024 "/usr/include/unistd.h" 3 4 # endif # 1025 "/usr/include/unistd.h" 3 4 # ifdef __USE_LARGEFILE64 extern int ftruncate64 (int __fd, __off64_t __length) __THROW __wur; # endif # 1028 "/usr/include/unistd.h" 3 4 #endif /* Use BSD || POSIX.1b || X/Open Unix || XPG6. */ # 1030 "/usr/include/unistd.h" 3 4 #if (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K) \ || defined __USE_MISC /* Set the end of accessible data space (aka "the break") to ADDR. Returns zero on success and -1 for errors (with errno set). */ extern int brk (void *__addr) __THROW __wur; /* Increase or decrease the end of accessible data space by DELTA bytes. If successful, returns the address the previous end of data space (i.e. the beginning of the new space, if DELTA > 0); returns (void *) -1 for errors (with errno set). */ extern void *sbrk (intptr_t __delta) __THROW; #endif # 1045 "/usr/include/unistd.h" 3 4 #ifdef __USE_MISC /* Invoke `system call' number SYSNO, passing it the remaining arguments. This is completely system-dependent, and not often useful. In Unix, `syscall' sets `errno' for all errors and most calls return -1 for errors; in many systems you cannot pass arguments or get return values for all system calls (`pipe', `fork', and `getppid' typically among them). In Mach, all system calls take normal arguments and always return an error code (zero for success). */ extern long int syscall (long int __sysno, ...) __THROW; #endif /* Use misc. */ # 1061 "/usr/include/unistd.h" 3 4 #if (defined __USE_MISC || defined __USE_XOPEN_EXTENDED) && !defined F_LOCK /* NOTE: These declarations also appear in ; be sure to keep both files consistent. Some systems have them there and some here, and some software depends on the macros being defined without including both. */ /* `lockf' is a simpler interface to the locking facilities of `fcntl'. LEN is always relative to the current file position. The CMD argument is one of the following. This function is a cancellation point and therefore not marked with __THROW. */ # define F_ULOCK 0 /* Unlock a previously locked region. */ # define F_LOCK 1 /* Lock a region for exclusive use. */ # define F_TLOCK 2 /* Test and lock a region for exclusive use. */ # define F_TEST 3 /* Test a region for other processes locks. */ # ifndef __USE_FILE_OFFSET64 extern int lockf (int __fd, int __cmd, __off_t __len) __wur; # else # 1083 "/usr/include/unistd.h" 3 4 # ifdef __REDIRECT extern int __REDIRECT (lockf, (int __fd, int __cmd, __off64_t __len), lockf64) __wur; # else # 1087 "/usr/include/unistd.h" 3 4 # define lockf lockf64 # endif # 1089 "/usr/include/unistd.h" 3 4 # endif # 1090 "/usr/include/unistd.h" 3 4 # ifdef __USE_LARGEFILE64 extern int lockf64 (int __fd, int __cmd, __off64_t __len) __wur; # endif # 1093 "/usr/include/unistd.h" 3 4 #endif /* Use misc and F_LOCK not already defined. */ # 1094 "/usr/include/unistd.h" 3 4 #ifdef __USE_GNU /* Evaluate EXPRESSION, and repeat as long as it returns -1 with `errno' set to EINTR. */ # define TEMP_FAILURE_RETRY(expression) \ (__extension__ \ ({ long int __result; \ do __result = (long int) (expression); \ while (__result == -1L && errno == EINTR); \ __result; })) #endif # 1108 "/usr/include/unistd.h" 3 4 #if defined __USE_POSIX199309 || defined __USE_UNIX98 /* Synchronize at least the data part of a file with the underlying media. */ extern int fdatasync (int __fildes); #endif /* Use POSIX199309 */ # 1114 "/usr/include/unistd.h" 3 4 /* XPG4.2 specifies that prototypes for the encryption functions must be defined here. */ #ifdef __USE_XOPEN /* Encrypt at most 8 characters from KEY using salt to perturb DES. */ extern char *crypt (const char *__key, const char *__salt) __THROW __nonnull ((1, 2)); /* Encrypt data in BLOCK in place if EDFLAG is zero; otherwise decrypt block in place. */ extern void encrypt (char *__glibc_block, int __edflag) __THROW __nonnull ((1)); /* Swab pairs bytes in the first N bytes of the area pointed to by FROM and copy the result to TO. The value of TO must not be in the range [FROM - N + 1, FROM - 1]. If N is odd the first byte in FROM is without partner. */ extern void swab (const void *__restrict __from, void *__restrict __to, ssize_t __n) __THROW __nonnull ((1, 2)); #endif # 1136 "/usr/include/unistd.h" 3 4 /* The Single Unix specification demands this prototype to be here. It is also found in . */ #if defined __USE_XOPEN && !defined __USE_XOPEN2K /* Return the name of the controlling terminal. */ extern char *ctermid (char *__s) __THROW; #endif # 1144 "/usr/include/unistd.h" 3 4 /* Define some macros helping to catch buffer overflows. */ #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 1148 "/usr/include/unistd.h" 3 4 # 1149 "/usr/include/unistd.h" 3 4 #endif # 1150 "/usr/include/unistd.h" 3 4 __END_DECLS #endif /* unistd.h */ # 1154 "/usr/include/unistd.h" 3 4 # 3 "./Lock.cpp" 2 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 3 "./Lock.cpp" # 4 "./Lock.cpp" #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 4 "./Lock.cpp" # 5 "./Lock.cpp" #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 5 "./Lock.cpp" # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/cilk_api.h" 1 3 /* cilk_api.h * * @copyright * Copyright (C) 2009-2013, Intel Corporation * All rights reserved. * * @copyright * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * Neither the name of Intel Corporation nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * @copyright * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ /** @file cilk_api.h * * @brief Defines the documented API exposed by the Cilk Plus for use * by applications. * * @ingroup api */ #ifndef INCLUDED_CILK_API_H #define INCLUDED_CILK_API_H /** @defgroup api Runtime API * API to allow user programs to interact with the Cilk runtime. * @{ */ #ifndef CILK_STUB /* Real (non-stub) definitions */ #if ! defined(__cilk) && ! defined(USE_CILK_API) # ifdef _WIN32 # error Cilk API is being used with non-Cilk compiler (or Cilk is disabled) # else # 59 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/cilk_api.h" 3 # warning Cilk API is being used with non-Cilk compiler (or Cilk is disabled) # endif # 61 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/cilk_api.h" 3 #endif # 62 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/cilk_api.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 63 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/cilk_api.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/common.h" 1 3 /** common.h * * @copyright * Copyright (C) 2010-2013, Intel Corporation * All rights reserved. * * @copyright * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * Neither the name of Intel Corporation nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * @copyright * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ /** @file common.h * * @brief Defines common macros and structures used by the Intel Cilk Plus * runtime. * * @ingroup common */ /** @defgroup common Common Definitions * Macro, structure, and class definitions used elsewhere in the runtime. * @{ */ #ifndef INCLUDED_CILK_COMMON #define INCLUDED_CILK_COMMON #ifdef __cplusplus /** Namespace for all Cilk definitions that can be included in user code. */ namespace cilk { /** Namespace for definitions that are primarily intended for use * in other Cilk definitions. */ namespace internal {} } #endif # 64 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/common.h" 3 /** Cilk library version = 1.01 */ #define CILK_LIBRARY_VERSION 102 #ifdef __cplusplus #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 70 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/common.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cassert" 1 3 // -*- C++ -*- forwarding header. // Copyright (C) 1997-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file cassert * This is a Standard C++ Library file. You should @c \#include this file * in your programs, rather than any of the @a *.h implementation files. * * This is the C++ version of the Standard C Library header @c assert.h, * and its contents are (mostly) the same as that header, but are all * contained in the namespace @c std (except for names which are defined * as macros in C). */ // // ISO C++ 14882: 19.2 Assertions // // No include guards on this header... #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cassert" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 43 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cassert" 3 # 1 "/usr/include/assert.h" 1 3 4 /* Copyright (C) 1991-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * ISO C99 Standard: 7.2 Diagnostics */ #ifdef _ASSERT_H # undef _ASSERT_H # undef assert # undef __ASSERT_VOID_CAST # ifdef __USE_GNU # undef assert_perror # endif # 31 "/usr/include/assert.h" 3 4 #endif /* assert.h */ # 33 "/usr/include/assert.h" 3 4 #define _ASSERT_H 1 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 35 "/usr/include/assert.h" 3 4 # 36 "/usr/include/assert.h" 3 4 #if defined __cplusplus && __GNUC_PREREQ (2,95) # define __ASSERT_VOID_CAST static_cast #else # 40 "/usr/include/assert.h" 3 4 # define __ASSERT_VOID_CAST (void) #endif # 42 "/usr/include/assert.h" 3 4 /* void assert (int expression); If NDEBUG is defined, do nothing. If not, and EXPRESSION is zero, print an error message and abort. */ #ifdef NDEBUG # define assert(expr) (__ASSERT_VOID_CAST (0)) /* void assert_perror (int errnum); If NDEBUG is defined, do nothing. If not, and ERRNUM is not zero, print an error message with the error text for ERRNUM and abort. (This is a GNU extension.) */ # ifdef __USE_GNU # define assert_perror(errnum) (__ASSERT_VOID_CAST (0)) # endif # 61 "/usr/include/assert.h" 3 4 #else /* Not NDEBUG. */ # 63 "/usr/include/assert.h" 3 4 #ifndef _ASSERT_H_DECLS #define _ASSERT_H_DECLS __BEGIN_DECLS /* This prints an "Assertion failed" message and aborts. */ extern void __assert_fail (const char *__assertion, const char *__file, unsigned int __line, const char *__function) __THROW __attribute__ ((__noreturn__)); /* Likewise, but prints the error text for ERRNUM. */ extern void __assert_perror_fail (int __errnum, const char *__file, unsigned int __line, const char *__function) __THROW __attribute__ ((__noreturn__)); /* The following is not at all used here but needed for standard compliance. */ extern void __assert (const char *__assertion, const char *__file, int __line) __THROW __attribute__ ((__noreturn__)); __END_DECLS #endif /* Not _ASSERT_H_DECLS */ # 87 "/usr/include/assert.h" 3 4 # define assert(expr) \ ((expr) \ ? __ASSERT_VOID_CAST (0) \ : __assert_fail (__STRING(expr), __FILE__, __LINE__, __ASSERT_FUNCTION)) # ifdef __USE_GNU # define assert_perror(errnum) \ (!(errnum) \ ? __ASSERT_VOID_CAST (0) \ : __assert_perror_fail ((errnum), __FILE__, __LINE__, __ASSERT_FUNCTION)) # endif # 99 "/usr/include/assert.h" 3 4 /* Version 2.4 and later of GCC define a magical variable `__PRETTY_FUNCTION__' which contains the name of the function currently being defined. This is broken in G++ before version 2.6. C9x has a similar variable called __func__, but prefer the GCC one since it demangles C++ function names. */ # if defined __cplusplus ? __GNUC_PREREQ (2, 6) : __GNUC_PREREQ (2, 4) # define __ASSERT_FUNCTION __PRETTY_FUNCTION__ # else # 108 "/usr/include/assert.h" 3 4 # if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L # define __ASSERT_FUNCTION __func__ # else # 111 "/usr/include/assert.h" 3 4 # define __ASSERT_FUNCTION ((const char *) 0) # endif # 113 "/usr/include/assert.h" 3 4 # endif # 114 "/usr/include/assert.h" 3 4 #endif /* NDEBUG. */ # 116 "/usr/include/assert.h" 3 4 #if defined __USE_ISOC11 && !defined __cplusplus /* Static assertion. Requires support in the compiler. */ # undef static_assert # define static_assert _Static_assert #endif # 123 "/usr/include/assert.h" 3 4 # 44 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cassert" 2 3 # 71 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/common.h" 2 3 #else # 72 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/common.h" 3 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 72 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/common.h" 3 # 73 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/common.h" 3 #endif # 74 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/common.h" 3 /** * Prefix standard library function and type names with __STDNS in order to * get correct lookup in both C and C++. */ #ifdef __cplusplus # define __STDNS std:: #else # 82 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/common.h" 3 # define __STDNS #endif # 84 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/common.h" 3 /** * @def CILK_EXPORT * Define export of runtime functions from shared library. * Should be exported only from cilkrts*.dll/cilkrts*.so * @def CILK_EXPORT_DATA * Define export of runtime data from shared library. */ #ifdef _WIN32 # ifdef IN_CILK_RUNTIME # define CILK_EXPORT __declspec(dllexport) # define CILK_EXPORT_DATA __declspec(dllexport) # else # 97 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/common.h" 3 # define CILK_EXPORT __declspec(dllimport) # define CILK_EXPORT_DATA __declspec(dllimport) # endif /* IN_CILK_RUNTIME */ # 100 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/common.h" 3 #elif defined(__CYGWIN__) || defined(__APPLE__) || defined(_DARWIN_C_SOURCE) # 101 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/common.h" 3 # define CILK_EXPORT /* nothing */ # define CILK_EXPORT_DATA /* nothing */ #else /* Unix/gcc */ # 104 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/common.h" 3 # if defined(IN_CILK_RUNTIME) && defined(HAVE_ATTRIBUTE_VISIBILITY) # define CILK_EXPORT __attribute__((visibility("protected"))) # define CILK_EXPORT_DATA __attribute__((visibility("protected"))) # else # 108 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/common.h" 3 # define CILK_EXPORT /* nothing */ # define CILK_EXPORT_DATA /* nothing */ # endif /* IN_CILK_RUNTIME */ # 111 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/common.h" 3 #endif /* Unix/gcc */ # 112 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/common.h" 3 /** * @def __CILKRTS_BEGIN_EXTERN_C * Macro to denote the start of a section in which all names have "C" linkage. * That is, none of the names are to be mangled. * @see __CILKRTS_END_EXTERN_C * @see __CILKRTS_EXTERN_C * * @def __CILKRTS_END_EXTERN_C * Macro to denote the end of a section in which all names have "C" linkage. * That is, none of the names are to be mangled. * @see __CILKRTS_BEGIN_EXTERN_C * @see __CILKRTS_EXTERN_C * * @def __CILKRTS_EXTERN_C * Macro to prefix a single definition which has "C" linkage. * That is, the defined name is not to be mangled. * @see __CILKRTS_BEGIN_EXTERN_C * @see __CILKRTS_END_EXTERN_C */ #ifdef __cplusplus # define __CILKRTS_BEGIN_EXTERN_C extern "C" { # define __CILKRTS_END_EXTERN_C } # define __CILKRTS_EXTERN_C extern "C" #else # 137 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/common.h" 3 # define __CILKRTS_BEGIN_EXTERN_C # define __CILKRTS_END_EXTERN_C # define __CILKRTS_EXTERN_C #endif # 141 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/common.h" 3 /** * OS-independent macro to specify a function which is known to not throw * an exception. */ #ifdef __cplusplus # ifdef _WIN32 # define __CILKRTS_NOTHROW __declspec(nothrow) # else /* Unix/gcc */ # 150 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/common.h" 3 # define __CILKRTS_NOTHROW __attribute__((nothrow)) # endif /* Unix/gcc */ # 152 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/common.h" 3 #else # 153 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/common.h" 3 # define __CILKRTS_NOTHROW /* nothing */ #endif /* __cplusplus */ # 155 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/common.h" 3 /** Cache alignment. (Good enough for most architectures.) */ #define __CILKRTS_CACHE_LINE__ 64 /** * Macro to specify alignment of a data member in a structure. * Because of the way that gcc’s alignment attribute is defined, @a n must * be a numeric literal, not just a compile-time constant expression. */ #ifdef _WIN32 # define CILK_ALIGNAS(n) __declspec(align(n)) #else /* Unix/gcc */ # 168 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/common.h" 3 # define CILK_ALIGNAS(n) __attribute__((__aligned__(n))) #endif # 170 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/common.h" 3 /** * Macro to specify cache-line alignment of a data member in a structure. */ #define __CILKRTS_CACHE_ALIGN CILK_ALIGNAS(__CILKRTS_CACHE_LINE__) /** * Macro to specify a class as being at least as strictly aligned as some * type on Windows. gcc does not provide a way of doing this, so on Unix, * this just specifies the largest natural type alignment. Put the macro * between the `class` keyword and the class name: * * class CILK_ALIGNAS_TYPE(foo) bar { ... }; */ #ifdef _WIN32 # define CILK_ALIGNAS_TYPE(t) __declspec(align(__alignof(t))) #else /* Unix/gcc */ # 187 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/common.h" 3 # define CILK_ALIGNAS_TYPE(t) __attribute__((__aligned__)) #endif # 189 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/common.h" 3 /** * @def CILK_API(RET_TYPE) * A function called explicitly by the programmer. * @def CILK_ABI(RET_TYPE) * A function called by compiler-generated code. * @def CILK_ABI_THROWS(RET_TYPE) * An ABI function that may throw an exception * * Even when these are the same definitions, they should be separate macros so * that they can be easily found in the code. */ #ifdef _WIN32 # define CILK_API(RET_TYPE) CILK_EXPORT RET_TYPE __CILKRTS_NOTHROW __cdecl # define CILK_ABI(RET_TYPE) CILK_EXPORT RET_TYPE __CILKRTS_NOTHROW __cdecl # define CILK_ABI_THROWS(RET_TYPE) CILK_EXPORT RET_TYPE __cdecl #else # 207 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/common.h" 3 # define CILK_API(RET_TYPE) CILK_EXPORT RET_TYPE __CILKRTS_NOTHROW # define CILK_ABI(RET_TYPE) CILK_EXPORT RET_TYPE __CILKRTS_NOTHROW # define CILK_ABI_THROWS(RET_TYPE) CILK_EXPORT RET_TYPE #endif # 211 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/common.h" 3 /** * __CILKRTS_ASSERT should be defined for debugging only, otherwise it * interferes with vectorization. Since NDEBUG is not reliable (it must be * set by the user), we must use a platform-specific detection of debug mode. */ #if defined(_WIN32) && defined(_DEBUG) /* Windows debug */ # define __CILKRTS_ASSERT(e) assert(e) #elif (! defined(_WIN32)) && ! defined(__OPTIMIZE__) # 221 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/common.h" 3 /* Unix non-optimized */ # define __CILKRTS_ASSERT(e) assert(e) #elif defined __cplusplus # 224 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/common.h" 3 /* C++ non-debug */ # define __CILKRTS_ASSERT(e) static_cast(0) #else # 227 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/common.h" 3 /* C non-debug */ # define __CILKRTS_ASSERT(e) ((void) 0) #endif # 230 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/common.h" 3 /** * OS-independent macro to specify a function that should be inlined */ #ifdef __cpluspus // C++ # define __CILKRTS_INLINE inline #elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L # 238 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/common.h" 3 // C99 # define __CILKRTS_INLINE static inline #elif defined(_MSC_VER) # 241 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/common.h" 3 // C89 on Windows # define __CILKRTS_INLINE __inline #else # 244 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/common.h" 3 // C89 on GCC-compatible systems # define __CILKRTS_INLINE extern __inline__ #endif # 247 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/common.h" 3 /** * Functions marked as CILK_EXPORT_AND_INLINE have both * inline versions defined in the Cilk API, as well as * non-inlined versions that are exported (for * compatibility with previous versions that did not * inline the functions). */ #ifdef COMPILING_CILK_API_FUNCTIONS # define CILK_EXPORT_AND_INLINE CILK_EXPORT #else # 258 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/common.h" 3 # define CILK_EXPORT_AND_INLINE __CILKRTS_INLINE #endif # 260 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/common.h" 3 /** * Try to determine if compiler supports rvalue references. */ #if defined(__cplusplus) && !defined(__CILKRTS_RVALUE_REFERENCES) # if __cplusplus >= 201103L // C++11 # define __CILKRTS_RVALUE_REFERENCES 1 # elif defined(__GXX_EXPERIMENTAL_CXX0X__) # 268 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/common.h" 3 # define __CILKRTS_RVALUE_REFERENCES 1 # elif __cplusplus >= 199711L && __cplusplus < 201103L # 270 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/common.h" 3 // Compiler recognizes a language version prior to C++11 # elif __INTEL_COMPILER == 1200 && defined(__STDC_HOSTED__) # 272 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/common.h" 3 // Intel compiler version 12.0 // __cplusplus has a non-standard definition. In the absence of a // proper definition, look for the C++0x macro, __STDC_HOSTED__. # define __CILKRTS_RVALUE_REFERENCES 1 # elif __INTEL_COMPILER > 1200 && defined(CHAR16T) # 277 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/common.h" 3 // Intel compiler version >= 12.1 // __cplusplus has a non-standard definition. In the absence of a // proper definition, look for the Intel macro, CHAR16T # define __CILKRTS_RVALUE_REFERENCES 1 # endif # 282 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/common.h" 3 #endif # 283 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/common.h" 3 /* * Include stdint.h to define the standard integer types. * * Unfortunately Microsoft doesn't provide stdint.h until Visual Studio 2010, * so use our own definitions until those are available */ #if ! defined(_MSC_VER) || (_MSC_VER >= 1600) #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 292 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/common.h" 3 # 293 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/common.h" 3 #else # 294 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/common.h" 3 # ifndef __MS_STDINT_TYPES_DEFINED__ # define __MS_STDINT_TYPES_DEFINED__ typedef signed char int8_t; typedef short int16_t; typedef int int32_t; typedef __int64 int64_t; typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; typedef unsigned __int64 uint64_t; # endif /* __MS_STDINT_TYPES_DEFINED__ */ # 306 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/common.h" 3 #endif /* ! defined(_MSC_VER) || (_MSC_VER >= 1600) */ # 307 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/common.h" 3 /** * @brief Application Binary Interface version of the Cilk runtime library. * * The ABI version is determined by the compiler used. An object file * compiled with a higher ABI version is not compatible with a library that is * compiled with a lower ABI version. An object file compiled with a lower * ABI version, however, can be used with a library compiled with a higher ABI * version unless otherwise stated. */ #ifndef __CILKRTS_ABI_VERSION # ifdef IN_CILK_RUNTIME # define __CILKRTS_ABI_VERSION 1 # elif defined(__INTEL_COMPILER) && (__INTEL_COMPILER <= 1200) # 321 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/common.h" 3 // Intel compilers prior to version 12.1 support only ABI 0 # define __CILKRTS_ABI_VERSION 0 # else # 324 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/common.h" 3 // Non-Intel compiler or Intel compiler after version 12.0. # define __CILKRTS_ABI_VERSION 1 # endif # 327 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/common.h" 3 #endif # 328 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/common.h" 3 // These structs are exported because the inlining of // the internal version of API methods require a worker // structure as parameter. __CILKRTS_BEGIN_EXTERN_C /// Worker struct, exported for inlined API methods /// @ingroup api struct __cilkrts_worker; /// Worker struct, exported for inlined API methods /// @ingroup api typedef struct __cilkrts_worker __cilkrts_worker; /// Worker struct pointer, exported for inlined API methods /// @ingroup api typedef struct __cilkrts_worker *__cilkrts_worker_ptr; /// Fetch the worker out of TLS. CILK_ABI(__cilkrts_worker_ptr) __cilkrts_get_tls_worker(void); /// void *, defined to work around complaints from the compiler /// about using __declspec(nothrow) after the "void *" return type typedef void * __cilkrts_void_ptr; __CILKRTS_END_EXTERN_C #if __CILKRTS_ABI_VERSION >= 1 // Pedigree API is available only for compilers that use ABI version >= 1. /** Pedigree information kept in the worker and stack frame. * @ingroup api */ typedef struct __cilkrts_pedigree { /** Rank at start of spawn helper. Saved rank for spawning functions */ uint64_t rank; /** Link to next in chain */ const struct __cilkrts_pedigree *parent; } __cilkrts_pedigree; #endif // __CILKRTS_ABI_VERSION >= 1 # 372 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/common.h" 3 /// @} #endif /* INCLUDED_CILK_COMMON */ # 376 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/common.h" 3 # 64 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/cilk_api.h" 2 3 #ifdef __cplusplus #if 0 /* expanded by -frewrite-includes */ # include /* Defines size_t */ #endif /* expanded by -frewrite-includes */ # 66 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/cilk_api.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstddef" 1 3 // -*- C++ -*- forwarding header. // Copyright (C) 1997-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file cstddef * This is a Standard C++ Library file. You should @c \#include this file * in your programs, rather than any of the @a *.h implementation files. * * This is the C++ version of the Standard C Library header @c stddef.h, * and its contents are (mostly) the same as that header, but are all * contained in the namespace @c std (except for names which are defined * as macros in C). */ // // ISO C++ 14882: 18.1 Types // #ifndef _GLIBCXX_CSTDDEF #define _GLIBCXX_CSTDDEF 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 43 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstddef" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 44 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstddef" 3 # 45 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstddef" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 45 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstddef" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 1 3 /*===---- stddef.h - Basic type definitions --------------------------------=== * * Copyright (c) 2008 Eli Friedman * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #if !defined(__STDDEF_H) || defined(__need_ptrdiff_t) || \ defined(__need_size_t) || defined(__need_wchar_t) || \ defined(__need_NULL) || defined(__need_wint_t) #if !defined(__need_ptrdiff_t) && !defined(__need_size_t) && \ !defined(__need_wchar_t) && !defined(__need_NULL) && \ !defined(__need_wint_t) /* Always define miscellaneous pieces when modules are available. */ #if !__has_feature(modules) #define __STDDEF_H #endif # 37 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 #define __need_ptrdiff_t #define __need_size_t #define __need_wchar_t #define __need_NULL #define __need_STDDEF_H_misc /* __need_wint_t is intentionally not defined here. */ #endif # 44 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 #if defined(__need_ptrdiff_t) #if !defined(_PTRDIFF_T) || __has_feature(modules) /* Always define ptrdiff_t when modules are available. */ #if !__has_feature(modules) #define _PTRDIFF_T #endif # 51 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 typedef __PTRDIFF_TYPE__ ptrdiff_t; #endif # 53 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 #undef __need_ptrdiff_t #endif /* defined(__need_ptrdiff_t) */ # 55 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 #if defined(__need_size_t) #if !defined(_SIZE_T) || __has_feature(modules) /* Always define size_t when modules are available. */ #if !__has_feature(modules) #define _SIZE_T #endif # 62 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 typedef __SIZE_TYPE__ size_t; #endif # 64 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 #undef __need_size_t #endif /*defined(__need_size_t) */ # 66 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 #if defined(__need_STDDEF_H_misc) /* ISO9899:2011 7.20 (C11 Annex K): Define rsize_t if __STDC_WANT_LIB_EXT1__ is * enabled. */ #if (defined(__STDC_WANT_LIB_EXT1__) && __STDC_WANT_LIB_EXT1__ >= 1 && \ !defined(_RSIZE_T)) || __has_feature(modules) /* Always define rsize_t when modules are available. */ #if !__has_feature(modules) #define _RSIZE_T #endif # 76 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 typedef __SIZE_TYPE__ rsize_t; #endif # 78 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 #endif /* defined(__need_STDDEF_H_misc) */ # 79 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 #if defined(__need_wchar_t) #ifndef __cplusplus /* Always define wchar_t when modules are available. */ #if !defined(_WCHAR_T) || __has_feature(modules) #if !__has_feature(modules) #define _WCHAR_T #if defined(_MSC_EXTENSIONS) #define _WCHAR_T_DEFINED #endif # 89 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 #endif # 90 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 typedef __WCHAR_TYPE__ wchar_t; #endif # 92 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 #endif # 93 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 #undef __need_wchar_t #endif /* defined(__need_wchar_t) */ # 95 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 #if defined(__need_NULL) #undef NULL #ifdef __cplusplus # if !defined(__MINGW32__) && !defined(_MSC_VER) # define NULL __null # else # 102 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 # define NULL 0 # endif # 104 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 #else # 105 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 # define NULL ((void*)0) #endif # 107 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 #ifdef __cplusplus #if defined(_MSC_EXTENSIONS) && defined(_NATIVE_NULLPTR_SUPPORTED) namespace std { typedef decltype(nullptr) nullptr_t; } using ::std::nullptr_t; #endif # 112 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 #endif # 113 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 #undef __need_NULL #endif /* defined(__need_NULL) */ # 115 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 #if defined(__need_STDDEF_H_misc) #if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L #if 0 /* expanded by -frewrite-includes */ #include "__stddef_max_align_t.h" #endif /* expanded by -frewrite-includes */ # 118 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 # 1 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/__stddef_max_align_t.h" 1 3 /*===---- __stddef_max_align_t.h - Definition of max_align_t for modules ---=== * * Copyright (c) 2014 Chandler Carruth * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * *===-----------------------------------------------------------------------=== */ #ifndef __CLANG_MAX_ALIGN_T_DEFINED #define __CLANG_MAX_ALIGN_T_DEFINED #if defined(_MSC_VER) typedef double max_align_t; #elif defined(__APPLE__) # 32 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/__stddef_max_align_t.h" 3 typedef long double max_align_t; #else # 34 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/__stddef_max_align_t.h" 3 // Define 'max_align_t' to match the GCC definition. typedef struct { long long __clang_max_align_nonce1 __attribute__((__aligned__(__alignof__(long long)))); long double __clang_max_align_nonce2 __attribute__((__aligned__(__alignof__(long double)))); } max_align_t; #endif # 42 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/__stddef_max_align_t.h" 3 #endif # 44 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/__stddef_max_align_t.h" 3 # 119 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 2 3 #endif # 120 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 #define offsetof(t, d) __builtin_offsetof(t, d) #undef __need_STDDEF_H_misc #endif /* defined(__need_STDDEF_H_misc) */ # 123 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 /* Some C libraries expect to see a wint_t here. Others (notably MinGW) will use __WINT_TYPE__ directly; accommodate both by requiring __need_wint_t */ #if defined(__need_wint_t) /* Always define wint_t when modules are available. */ #if !defined(_WINT_T) || __has_feature(modules) #if !__has_feature(modules) #define _WINT_T #endif # 132 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 typedef __WINT_TYPE__ wint_t; #endif # 134 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 #undef __need_wint_t #endif /* __need_wint_t */ # 136 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 #endif # 138 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/stddef.h" 3 # 46 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstddef" 2 3 #if __cplusplus >= 201103L namespace std { // We handle size_t, ptrdiff_t, and nullptr_t in c++config.h. using ::max_align_t; } #endif # 54 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstddef" 3 #endif // _GLIBCXX_CSTDDEF # 56 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstddef" 3 # 67 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/cilk_api.h" 2 3 #else # 68 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/cilk_api.h" 3 #if 0 /* expanded by -frewrite-includes */ # include /* Defines size_t */ #endif /* expanded by -frewrite-includes */ # 68 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/cilk_api.h" 3 # 69 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/cilk_api.h" 3 #endif # 70 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/cilk_api.h" 3 #ifdef _WIN32 # ifndef IN_CILK_RUNTIME /* Ensure the library is brought if any of these functions are being called. */ # pragma comment(lib, "cilkrts") # endif # 76 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/cilk_api.h" 3 # ifndef __cplusplus #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 78 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/cilk_api.h" 3 # 79 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/cilk_api.h" 3 # endif # 80 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/cilk_api.h" 3 #endif /* _WIN32 */ # 81 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/cilk_api.h" 3 __CILKRTS_BEGIN_EXTERN_C /** Return values from __cilkrts_set_param() and __cilkrts_set_param_w() */ enum __cilkrts_set_param_status { __CILKRTS_SET_PARAM_SUCCESS = 0, /**< Success - parameter set */ __CILKRTS_SET_PARAM_UNIMP = 1, /**< Unimplemented parameter */ __CILKRTS_SET_PARAM_XRANGE = 2, /**< Parameter value out of range */ __CILKRTS_SET_PARAM_INVALID = 3, /**< Invalid parameter value */ __CILKRTS_SET_PARAM_LATE = 4 /**< Too late to change parameter value */ }; /** Set user controllable runtime parameters * * Call this function to set runtime parameters that control the behavior * of the Cilk scheduler. * * @param param A string specifying the parameter to be set. One of: * - `"nworkers"` * - `"force reduce"` * @param value A string specifying the parameter value. * @returns A value from the @ref __cilkrts_set_param_status * enumeration indicating the result of the operation. * * @par The "nworkers" parameter * * This parameter specifies the number of worker threads to be created by the * Cilk runtime. @a Value must be a string of digits to be parsed by * `strtol()`. * * The number of worker threads is: * 1. the value set with `__cilkrts_set_param("nworkers")`, if it is * positive; otherwise, * 2. the value of the CILK_NWORKERS environment variable, if it is * defined; otherwise * 3. the number of cores available, as reported by the operating system. * * @note * Technically, Cilk distinguishes between the _user thread_ (the thread that * the user code was executing on when the Cilk runtime started), and * _worker threads_ (new threads created by the Cilk runtime to support * Cilk parallelism). `nworkers` actually includes both the user thread and * the worker threads; that is, it is one greater than the number of true * “worker threads”. * * @note * Setting `nworkers = 1` produces serial behavior. Cilk spawns and syncs will * be executed, but with only one worker, continuations will never be stolen, * so all code will execute in serial. * * @warning * The number of worker threads can only be set *before* the runtime has * started. Attempting to set it when the runtime is running will have no * effect, and will return an error code. You can call __cilkrts_end_cilk() * to shut down the runtime to change the number of workers. * * @warning * The default Cilk scheduler behavior is usually pretty good. The ability * to override `nworkers` can be useful for experimentation, but it won’t * usually be necessary for getting good performance. * * @par The "force reduce" parameter * * This parameter controls whether the runtime should allocate a new view * for a reducer for every parallel strand that it is accessed on. (See * @ref pagereducers.) @a Value must be `"1"` or `"true"` to enable the * “force reduce” behavior, or `"0"` or `"false"` to disable it. * * “Force reduce” behavior will also be enabled if * `__cilkrts_set_param("force reduce")` is not called, but the * `CILK_FORCE_REDUCE` environment variable is defined. * * @warning * When this option is enabled, `nworkers` should be set to `1`. Using “force * reduce” with more than one worker may result in runtime errors. * * @warning * Enabling this option can significantly reduce performance. It should * _only_ be used as a debugging tool. */ CILK_API(int) __cilkrts_set_param(const char *param, const char *value); #ifdef _WIN32 /** * Set user controllable parameters using wide strings * * @note This variant of __cilkrts_set_param() is only available * on Windows. * * @copydetails __cilkrts_set_param */ CILK_API(int) __cilkrts_set_param_w(const wchar_t *param, const wchar_t *value); #endif # 175 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/cilk_api.h" 3 /** Shut down and deallocate all Cilk state. The runtime will abort the * application if Cilk is still in use by this thread. Otherwise the runtime * will wait for all other threads using Cilk to exit. */ CILK_API(void) __cilkrts_end_cilk(void); /** Initialize the Cilk data structures and start the runtime. */ CILK_API(void) __cilkrts_init(void); /** Return the runtime `nworkers` parameter. (See the discussion of `nworkers` * in the documentation for __cilkrts_set_param().) */ CILK_API(int) __cilkrts_get_nworkers(void); /** Return the number of thread data structures. * * This function returns the number of data structures that has been allocated * allocated by the runtime to hold information about user and worker threads. * * If you don’t already know what this is good for, then you probably don’t * need it. */ CILK_API(int) __cilkrts_get_total_workers(void); /** What thread is the function running on? * * Return a small integer identifying the current thread. Each worker thread * started by the Cilk runtime library has a unique worker number in the range * `1 .. nworkers - 1`. * * All _user_ threads (threads started by the user, or by other libraries) are * identified as worker number 0. Therefore, the worker number is not unique * across multiple user threads. */ CILK_API(int) __cilkrts_get_worker_number(void); /** Test whether “force reduce” behavior is enabled. * * @return Non-zero if force-reduce mode is on, zero if it is off. */ CILK_API(int) __cilkrts_get_force_reduce(void); /** Interact with tools */ CILK_API(void) __cilkrts_metacall(unsigned int tool, unsigned int code, void *data); #ifdef _WIN32 /// Windows exception description record. typedef struct _EXCEPTION_RECORD _EXCEPTION_RECORD; /** Function signature for Windows exception notification callbacks. */ typedef void (*__cilkrts_pfn_seh_callback)(const _EXCEPTION_RECORD *exception); /** Specify a function to call when a non-C++ exception is caught. * * Cilk Plus parallelism plays nicely with C++ exception handling, but the * Cilk Plus runtime has no way to unwind the stack across a strand boundary * for Microsoft SEH (“Structured Exception Handling”) exceptions. Therefore, * when the runtime catches such an exception, it must abort the application. * * If an SEH callback has been set, the runtime will call it before aborting. * * @param pfn A pointer to a callback function to be called before the * runtime aborts the program because of an SEH exception. */ CILK_API(int) __cilkrts_set_seh_callback(__cilkrts_pfn_seh_callback pfn); #endif /* _WIN32 */ # 246 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/cilk_api.h" 3 #if __CILKRTS_ABI_VERSION >= 1 /* Pedigree API is available only for compilers that use ABI version >= 1. */ /** @name Pedigrees */ //@{ // @cond internal /** Support for __cilkrts_get_pedigree. */ CILK_API(__cilkrts_pedigree) __cilkrts_get_pedigree_internal(__cilkrts_worker *w); /** Support for __cilkrts_bump_worker_rank. */ CILK_API(int) __cilkrts_bump_worker_rank_internal(__cilkrts_worker* w); /// @endcond /** Get the current pedigree, in a linked list representation. * * This routine returns a copy of the last node in the pedigree list. * For example, if the current pedigree (in order) is <1, 2, 3, 4>, * then this method returns a node with rank == 4, and whose parent * field points to the node with rank of 3. In summary, following the * nodes in the chain visits the terms of the pedigree in reverse. * * The returned node is guaranteed to be valid only until the caller * of this routine has returned. */ __CILKRTS_INLINE __cilkrts_pedigree __cilkrts_get_pedigree(void) { return __cilkrts_get_pedigree_internal(__cilkrts_get_tls_worker()); } /** Context used by __cilkrts_get_pedigree_info. * * @deprecated * This data structure is only used by the deprecated * __cilkrts_get_pedigree_info function. * * Callers should initialize the `data` array to NULL and set the `size` * field to `sizeof(__cilkrts_pedigree_context_t)` before the first call * to __cilkrts_get_pedigree_info(), and should not examine or modify it * thereafter. */ typedef struct { __STDNS size_t size; /**< Size of the struct in bytes */ void *data[3]; /**< Opaque context data */ } __cilkrts_pedigree_context_t; /** Get pedigree information. * * @deprecated * Use __cilkrts_get_pedigree() instead. * * This routine allows code to walk up the stack of Cilk frames to gather * the pedigree. * * Initialize the pedigree walk by filling the pedigree context with NULLs * and setting the size field to sizeof(__cilkrts_pedigree_context). * Other than initialization to NULL to start the walk, user coder should * consider the pedigree context data opaque and should not examine or * modify it. * * @returns 0 - Success - birthrank is valid * @returns >0 - End of pedigree walk * @returns -1 - Failure - No worker bound to thread * @returns -2 - Failure - Sanity check failed, * @returns -3 - Failure - Invalid context size * @returns -4 - Failure - Internal error - walked off end of chain of frames */ CILK_API(int) __cilkrts_get_pedigree_info(/* In/Out */ __cilkrts_pedigree_context_t *context, /* Out */ uint64_t *sf_birthrank); /** Get the rank of the currently executing worker. * * @deprecated * Use `__cilkrts_get_pedigree().rank` instead. * * @returns 0 - Success - *rank is valid * @returns <0 - Failure - *rank is not changed */ CILK_EXPORT_AND_INLINE int __cilkrts_get_worker_rank(uint64_t *rank) { *rank = __cilkrts_get_pedigree().rank; return 0; } /** Increment the pedigree rank of the currently executing worker. * * @returns 0 - Success - rank was incremented * @returns-1 - Failure */ CILK_EXPORT_AND_INLINE int __cilkrts_bump_worker_rank(void) { return __cilkrts_bump_worker_rank_internal(__cilkrts_get_tls_worker()); } /** Increment the pedigree rank for a cilk_for loop. * Obsolete. * * @deprecated * This function was provided to allow the user to manipulate the pedigree * rank of a `cilk_for` loop. The compiler now generates code to do that * manipulation automatically, so this function is now unnecessary. It may * be called, but will have no effect. */ CILK_EXPORT_AND_INLINE int __cilkrts_bump_loop_rank(void) { return 0; } //@} #endif /* __CILKRTS_ABI_VERSION >= 1 */ # 373 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/cilk_api.h" 3 __CILKRTS_END_EXTERN_C #else /* CILK_STUB */ # 377 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/cilk_api.h" 3 // Programs compiled with CILK_STUB are not linked with the Cilk runtime // library, so they should not have external references to runtime functions. // Therefore, the functions are replaced with stubs. #ifdef _WIN32 #define __cilkrts_set_param_w(name,value) ((value), 0) #define __cilkrts_set_seh_callback(pfn) (0) #endif # 386 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/cilk_api.h" 3 #define __cilkrts_set_param(name,value) ((value), 0) #define __cilkrts_end_cilk() ((void) 0) #define __cilkrts_init() ((void) 0) #define __cilkrts_get_nworkers() (1) #define __cilkrts_get_total_workers() (1) #define __cilkrts_get_worker_number() (0) #define __cilkrts_get_force_reduce() (0) #define __cilkrts_metacall(tool,code,data) ((tool), (code), (data), 0) #if __CILKRTS_ABI_VERSION >= 1 /* Pedigree stubs */ #define __cilkrts_get_pedigree_info(context, sf_birthrank) (-1) #define __cilkrts_get_worker_rank(rank) (*(rank) = 0) #define __cilkrts_bump_worker_rank() (-1) #define __cilkrts_bump_loop_rank() (-1) /* * A stub method for __cilkrts_get_pedigree. * Returns an empty __cilkrts_pedigree. */ __CILKRTS_INLINE __cilkrts_pedigree __cilkrts_get_pedigree_stub(void) { __cilkrts_pedigree ans; ans.rank = 0; ans.parent = NULL; return ans; } /* Renamed to an actual stub method. */ #define __cilkrts_get_pedigree() __cilkrts_get_pedigree_stub() #endif /* __CILKRTS_ABI_VERSION >= 1 */ # 419 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/cilk_api.h" 3 #endif /* CILK_STUB */ # 421 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/cilk_api.h" 3 //@} #endif /* INCLUDED_CILK_API_H */ # 425 "/efs/tools/tapir-6/build/lib/clang/6.0.0/include/cilk/cilk_api.h" 3 # 6 "./Lock.cpp" 2 #define num_tries 3 //#define debug 1 #ifdef debug #define wait_time 1000 #define dprintf(fmt, args...) fprintf(stderr, fmt, ## args) #else # 13 "./Lock.cpp" #define wait_time 100 #define dprintf(fmt, args...) /* Don't do anything in release builds */ #endif # 16 "./Lock.cpp" typedef enum reasons {GENERAL, REBALANCE, INSERT, DOUBLE} REASONS; class Lock { public: Lock(); REASONS reason; bool i_own_lock()volatile; bool lock(REASONS r = GENERAL)volatile; void unlock(REASONS r = GENERAL)volatile; bool lock_shared()volatile; void unlock_shared()volatile; void del()volatile; void name(char const about[10])volatile; void number(int i)volatile; void make_shared()volatile; void make_exclusive()volatile; void print()volatile; bool check_unlocked()volatile; //private: std::atomic x; #ifdef debug char info[10]; volatile int num = 0; #endif # 41 "./Lock.cpp" }; //IMPORTANT!!!!!!!!! locks need to be initialized as all zeros Lock::Lock() { x = 0; reason = GENERAL; } void Lock::name(char const about[10])volatile{ #ifdef debug for (int i = 0; i < 10; i++) { info[i] = about[i]; } #endif # 55 "./Lock.cpp" } void Lock::del()volatile{ assert(i_own_lock()); x = 0xFFFFFFFFFFFFFFFFUL; name("deleted"); number(-1); } void Lock::number(int i)volatile{ #ifdef debug num = i; #endif # 68 "./Lock.cpp" } // should only be used in sequntial areas bool Lock::check_unlocked() volatile{ return x == 0; } //I'm assuming that this is between 0 and 2^31 uint64_t get_worker_num() { return __cilkrts_get_worker_number() + 1; } void Lock::print() volatile{ #ifdef debug uint64_t worker = x >> 32; uint64_t count = x & 0xFFFFFFFF; printf("Lock %p,%s,%d worker = %lu, called by %lu, count = %lu\n", this, info, num, worker, get_worker_num(), count); #endif # 86 "./Lock.cpp" } // exclusive lock bool Lock::lock(REASONS r)volatile { assert(num_tries > 0); int tries; bool success = false; uint64_t count = x & 0xFFFFFFFF; dprintf("worker %lu is trying to lock %p, %s,%d, with current count %lx\n",get_worker_num(),this,info,num, count); while(!success) { uint64_t lock_owner = x >> 32; bool try_recursive = (lock_owner == get_worker_num()); dprintf("try_recursive = %d, owner = %lu, worker = %lu\n", try_recursive,lock_owner, get_worker_num()); tries = 0; while (tries < num_tries) { if (x == 0xFFFFFFFFFFFFFFFFUL) { return false; } #ifdef debug uint64_t x_val = x; #endif # 109 "./Lock.cpp" uint64_t zero = 0; uint64_t replace_value = (get_worker_num() << 32) | 1; dprintf("x_val = %lx, zero = %lu, replace_value = %lx\n",x_val, zero, replace_value); count = x & 0xFFFFFFFF; dprintf("worker %lu is trying to lock %p, %s,%d, with current count %lx\n",get_worker_num(),this,info,num, count); success = x.compare_exchange_strong(zero, replace_value); uint64_t x_ = x; dprintf("first success = %d, x = %lx\n", success, x_); if (try_recursive && ! success) { dprintf("did recursive\n"); uint64_t check = (lock_owner << 32) | (x & 0xFFFFFFFF); uint64_t check_plus_1 = check + 1; success = x.compare_exchange_strong(check, check_plus_1); dprintf("second success = %d\n", success); } if(!success) { tries++; } else { break; } } // sleep in ms if(!success) { usleep(wait_time); } } if(reason != r && reason != GENERAL) { unlock(reason); dprintf("worker %lu is trying to lock %p, %s,%d, with the wrong reason %d, needed reason %d\n",get_worker_num(),this,info,num, r, reason); usleep(10000); return lock(r); } count = x & 0xFFFFFFFF; #ifdef debug uint64_t x_val = x; #endif # 149 "./Lock.cpp" dprintf("worker %lu locked %p,%s,%d, with current count %lx, x_val = %lx\n",get_worker_num(),this,info,num, count, x_val); // this assert is technically not correct if somebody unlocs it really fast assert(x > 0); return true; } void Lock::unlock(REASONS r) volatile{ #ifdef debug assert(num != -1);; #endif # 161 "./Lock.cpp" assert(num_tries > 0); uint64_t lock_owner = x >> 32; uint64_t owner_shifted = lock_owner << 32; uint64_t count = x & 0xFFFFFFFF; dprintf("worker %lu is trying to unlock %p,%s,%d with current count %lx\n",get_worker_num(),this,info,num, count); assert(lock_owner = get_worker_num()); assert(count > 0); uint64_t zero = 0; uint64_t owner_plus_1 = owner_shifted + 1; reason = r; if (!x.compare_exchange_strong(owner_plus_1, zero)) { bool done = false; while (!done) { count = (x & 0xFFFFFFFF); assert(count > 0); if (count > 1) { uint64_t owner_and_count = owner_shifted | count; uint64_t owner_and_count_minus_1 = owner_shifted | (count-1); done = x.compare_exchange_strong(owner_and_count, owner_and_count_minus_1); } else { zero = 0; done = x.compare_exchange_strong(owner_plus_1, zero); } } } count = x & 0xFFFFFFFF; #ifdef debug uint64_t x_val = x; #endif # 192 "./Lock.cpp" dprintf("worker %lu unlocked %p,%s,%d, with current count %lx, x_val = %lx\n",get_worker_num(),this,info,num, count, x_val); } bool Lock::i_own_lock() volatile{ #ifdef debug assert(num != -1);; #endif # 199 "./Lock.cpp" return (x >> 32) == get_worker_num(); } void Lock::make_shared() volatile{ #ifdef debug assert(num != -1);; #endif # 206 "./Lock.cpp" assert(num_tries > 0); uint64_t lock_owner = x >> 32; uint64_t owner_shifted = lock_owner << 32; uint64_t count = x & 0xFFFFFFFF; assert(count == 1); uint64_t owner_and_count = owner_shifted | 1; uint64_t one = 1; assert(lock_owner = get_worker_num()); bool done = x.compare_exchange_strong(owner_and_count, one); assert(done); } void Lock::make_exclusive() volatile{ #ifdef debug assert(num != -1);; #endif # 222 "./Lock.cpp" assert(num_tries > 0); uint64_t lock_owner = x >> 32; assert(lock_owner == 0); uint64_t owner_shifted = get_worker_num() << 32; uint64_t owner_and_count = owner_shifted | 1; uint64_t one = 1; bool success = false; int tries = 0; while(!success) { uint64_t new_x = x; dprintf("worker %lu is trying to make exclusive %p,%s,%d with current value %lx\n",get_worker_num(),this,info,num, new_x); tries = 0; if (new_x == one) { while (tries < num_tries) { success = x.compare_exchange_strong(one, owner_and_count); if (!success) { tries++; new_x = x; } else { break; } } } usleep(wait_time); } } bool Lock::lock_shared() volatile{ int tries; bool success = false; while(!success) { tries = 0; uint64_t old_x = x; uint64_t lock_owner = x >> 32; dprintf("SHARED worker %lu is trying to grab lock %p,%s,%d with current value %lx\n",get_worker_num(),this,info,num, old_x); if (x == old_x && lock_owner == 0) { while (tries < num_tries) { if (x == 0xFFFFFFFFFFFFFFFFUL) { return false; } success = x.compare_exchange_strong(old_x, old_x + 1); if(!success) { tries++; old_x = x; } else { break; } } } else { #ifdef debug uint64_t new_x = x; #endif # 274 "./Lock.cpp" dprintf("SHARED worker %lu failed to get lock %p with current value %lx\n",get_worker_num(),this, new_x); } // sleep in ms usleep(wait_time); } #ifdef debug uint64_t lock_val = x; #endif # 282 "./Lock.cpp" dprintf("SHARED worker %lu got lock %p with current value %lx\n",get_worker_num(),this, lock_val); return true; } void Lock::unlock_shared() volatile{ #ifdef debug assert(num != -1);; #endif # 290 "./Lock.cpp" assert(num_tries > 0); #ifdef debug uint64_t old_x = x; #endif # 294 "./Lock.cpp" dprintf("SHARED worker %lu is trying to unlock %p,%s,%d with current value %lx\n",get_worker_num(),this,info,num, old_x); assert(x > 0); assert(x < (1UL << 32)); x--; } # 15 "./OFM.cpp" 2 #if 0 /* expanded by -frewrite-includes */ #include "MiniLock.cpp" #endif /* expanded by -frewrite-includes */ # 15 "./OFM.cpp" # 1 "./MiniLock.cpp" 1 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 1 "./MiniLock.cpp" # 2 "./MiniLock.cpp" #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 2 "./MiniLock.cpp" # 3 "./MiniLock.cpp" #define num_tries 3 // small basic recursive lock class MiniLock { public: MiniLock(); void lock(); void unlock(); uint32_t x; }; #define MAX_WORKERS 46 static int primes[MAX_WORKERS] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199}; uint64_t get_worker_num2() { return __cilkrts_get_worker_number() + 1; } uint32_t get_id() { uint32_t worker_num = __cilkrts_get_worker_number(); assert(worker_num < MAX_WORKERS); return primes[worker_num]; } //IMPORTANT!!!!!!!!! locks need to be initialized as all zeros MiniLock::MiniLock() { x = 0; } // exclusive lock void MiniLock::lock() { printf("trying to grab minilock %p, by %d\n", this, get_worker_num2()); assert(num_tries > 0); int tries; bool success = false; while(!success) { tries = 0; while (tries < num_tries) { uint32_t old_val = __sync_fetch_and_add(&x, get_id()); success = ((old_val % get_id()) == 0); if(!success) { __sync_fetch_and_add(&x, -get_id()); tries++; } else { break; } } // sleep in ms if(!success) { usleep(wait_time); } } assert(x > 0); } void MiniLock::unlock() { printf("trying to release minilock %p, by %d\n", this, get_worker_num2()); assert(x > 0); assert(x % get_id() == 0); __sync_fetch_and_add(&x, -get_id()); } # 16 "./OFM.cpp" 2 #define LOCK_LEVEL 5 // potential TODO: explicitly store the implicit tree (index, len) as a struct // potential problem: there's a real graph as well as the implicit one. //TODO order node lock to avoid deadlock typedef struct _node { // beginning and end of the associated region in the edge list uint32_t beginning; // deleted = max int uint32_t end; // end pointer is exclusive uint32_t num_neighbors; // number of edgess with this node as source MiniLock lock; } node_t; // each node has an associated sentinel (max_int, offset) that gets back to its // offset into the node array // UINT32_MAX // // if value == UINT32_MAX, read it as null. typedef struct _edge { uint32_t dest; // destination of this edge in the graph, MAX_INT if this is a // sentinel uint32_t value; } edge_t; typedef union _edgeu { edge_t e; long long int i; } edge_u; typedef struct edge_list { volatile uint32_t N; volatile uint32_t H; volatile uint32_t logN; edge_t volatile * volatile items; // Lock list_lock; volatile uint32_t num_locks; // number of locks in the tree volatile int lock_level; // levels up from leaves // array of locks : one for each node at lock_level Lock volatile * volatile lock_array; volatile double density_limit; } edge_list_t; class OFM : public Graph { public: // data members std::vector nodes; edge_list_t edges; Lock node_lock; // graph_t g; // fun( g,ction headings OFM(uint32_t init_n); ~OFM(); void double_list(); void half_list(); void slide_right(uint32_t index); void redistribute(uint32_t index, uint32_t len); void fix_sentinel_locked(uint32_t node_index, int in); void fix_sentinel_unlocked(uint32_t node_index, int in); void print_array(uint64_t worker_num = 0); uint32_t find_value(uint32_t src, uint32_t dest); vector sparse_matrix_vector_multiplication(std::vector const &v) __attribute__((noinline)); vector sparse_matrix_vector_multiplication_with_hand_vec(std::vector const &v); void print_graph(); void add_node(); void add_edge(uint32_t src, uint32_t dest, uint32_t value); void add_edge_update(uint32_t src, uint32_t dest, uint32_t value); void insert(uint32_t index, edge_t elem, uint32_t src); uint64_t get_size(); uint64_t get_n(); void convert(Graph *g); void add_file3(string filename); vector pagerank(std::vector const &node_values); vector bfs(uint32_t start_node); vector> get_edges(); void clear(); bool check_no_locks(); }; // given index, return the starting index of the leaf it is in int find_leaf(edge_list_t *list, int index) { return (index / list->logN) * list->logN; } // given index, return the starting index of the leaf it is in int find_lock_index(edge_list_t *list, int index) { return (index / (list->logN << list->lock_level)); // * (list->logN << list->lock_level); } void release_locks_in_range(edge_list_t *list, uint32_t index, uint32_t len, REASONS r) { assert(len > 0); uint32_t first_lock = find_lock_index(list, index); uint32_t last_lock = find_lock_index(list, index+len-1); assert(index + len <= list->N); assert(first_lock <= last_lock); assert(last_lock < list->num_locks); // printf("releasing locks %d through %d\n", first_lock, last_lock); for(int i = first_lock; i <= last_lock; i++) { list->lock_array[i].unlock(r); } } void grab_locks_in_range(edge_list_t *list, uint32_t index, uint32_t len, REASONS r) { assert(len > 0); uint32_t first_lock = find_lock_index(list, index); uint32_t last_lock = find_lock_index(list, index+len-1); assert(index + len <= list->N); assert(first_lock <= last_lock); assert(last_lock < list->num_locks); //printf("grabbing locks %d through %d\n", first_lock, last_lock); for(int i = first_lock; i <= last_lock; i++) { list->lock_array[i].lock(r); } } bool OFM::check_no_locks() { bool ret = true; ret = ret && node_lock.check_unlocked(); assert(node_lock.check_unlocked()); // ret = ret && edges.list_lock.check_unlocked(); // assert(edges.list_lock.check_unlocked()); for (int i = 0; i < edges.num_locks; i++) { ret = ret && edges.lock_array[i].check_unlocked(); assert(edges.lock_array[i].check_unlocked()); } return ret; } // null overrides sentinel // e.g. in rebalance, we check if an edge is null // first before copying it into temp, then fix the sentinels. bool is_sentinel(edge_t volatile &e) { return e.dest == UINT32_MAX || e.value == UINT32_MAX; } uint32_t sentinel_index(edge_t volatile &e) { if(e.value == UINT32_MAX) { return 0; } return e.value; } bool is_null(edge_t volatile &e) { return e.value == 0; } uint32_t next_leaf(uint32_t index, int logN) { return (index / logN + 1) * (logN); } void OFM::clear() { int n = 0; grab_locks_in_range(&edges, 0, edges.N, GENERAL); // edges.list_lock.lock(); free((void*)edges.items); edges.N = 2 << bsr_word(n); // printf("%d\n", bsf_word(list->N)); edges.logN = (1 << bsr_word(bsr_word(edges.N) + 1)); edges.H = bsr_word(edges.N / edges.logN); free((void*)edges.lock_array); // edges.list_lock.unlock(); } vector split(string &s, char delim) { std::stringstream ss(s); std::string item; vector result; while (std::getline(ss, item, delim)) { result.push_back(item); } return result; } // for soc- // starting at 1 void OFM::add_file3(string filename) { ifstream myfile(filename.c_str()); string line; if (myfile.is_open()) { while (getline(myfile, line)) { vector elems = split(line, '\t'); int src = atoi(elems[0].c_str()) - 1; while (src >= get_n()) { add_node(); } int dest = atoi(elems[1].c_str()) - 1; while (dest >= get_n()) { add_node(); } add_edge(src, dest, 1); // if (line_num++ > 400000000) { // break; // } } myfile.close(); // return 0; } else { printf("file was not opened\n"); } } // TODO jump to next leaf vector OFM::pagerank(std::vector const &node_values) { node_lock.lock_shared(); // lock node array // edges.list_lock.lock_shared(); uint64_t n = get_n(); vector output(n, 0); float *output_p = output.data(); for (uint32_t i = 0; i < n; i++) { uint32_t start = nodes[i].beginning; int current_lock_index = find_lock_index(&edges, start); edges.lock_array[current_lock_index].lock_shared(); uint32_t end = nodes[i].end; // get neighbors // start at +1 for the sentinel float contrib = (node_values[i] / nodes[i].num_neighbors); uint32_t j = start + 1; while (j < end) { if (!is_null(edges.items[j])) { output_p[edges.items[j].dest] += contrib; j++; } else { j = next_leaf(j, edges.logN); int new_lock_index = find_lock_index(&edges, j); if(new_lock_index > current_lock_index && new_lock_index < edges.num_locks) { edges.lock_array[new_lock_index].lock_shared(); edges.lock_array[current_lock_index].unlock_shared(); current_lock_index = new_lock_index; } } } edges.lock_array[current_lock_index].unlock_shared(); } // edges.list_lock.unlock_shared(); node_lock.unlock_shared(); return output; } // TODO jump to next leaf vector> OFM::get_edges() { // TODO grab locks in the lock list // for now, grabs the global lock node_lock.lock_shared(); // lock node array // edges.list_lock.lock(); uint64_t n = get_n(); vector> output; for (uint32_t i = 0; i < n; i++) { uint32_t start = nodes[i].beginning; uint32_t end = nodes[i].end; for (uint32_t j = start + 1; j < end; j++) { if (!is_null(edges.items[j])) { output.push_back( make_tuple(i, edges.items[j].dest, edges.items[j].value)); } } } // edges.list_lock.unlock(); node_lock.unlock_shared(); // lock node array return output; } // TODO: do real parallel BFS later vector OFM::bfs(uint32_t start_node) { node_lock.lock_shared(); // lock node array // edges.list_lock.lock_shared(); uint64_t n = get_n(); vector out(n, UINT32_MAX); queue next; // qzueue next.push(start_node); out[start_node] = 0; uint32_t index; uint32_t new_lock_index; while (!next.empty()) { uint32_t active = next.front(); next.pop(); assert(out[active] != UINT32_MAX); uint32_t start = nodes[active].beginning; uint32_t end = nodes[active].end; index = find_lock_index(&edges, start); edges.lock_array[index].lock_shared(); // get neighbors // start at +1 for the sentinel uint32_t j = start + 1; while (j < end) { if (!is_null(edges.items[j])) { if (out[edges.items[j].dest] == UINT32_MAX) { next.push((uint32_t)edges.items[j].dest); out[edges.items[j].dest] = out[active] + 1; } j++; } else { j = next_leaf(j, edges.logN); new_lock_index = find_lock_index(&edges, j); if (new_lock_index > index && new_lock_index < edges.num_locks) { edges.lock_array[new_lock_index].lock_shared(); edges.lock_array[index].unlock_shared(); index = new_lock_index; } } } edges.lock_array[index].unlock_shared(); } node_lock.unlock_shared(); // lock node array // edges.list_lock.unlock_shared(); return out; } void OFM::convert(Graph *g) { node_lock.lock_shared(); // lock node array uint32_t n = g->get_n(); free((void*)edges.items); edges.N = 2 << bsr_word(n); // printf("%d\n", bsf_word(list->N)); edges.logN = (1 << bsr_word(bsr_word(edges.N) + 1)); edges.H = bsr_word(edges.N / edges.logN); // printf("N = %d, logN = %d, loglogN = %d, H = %d\n", list->N, list->logN, // list->loglogN, list->H); edges.items = (edge_t *)malloc(edges.N * sizeof(*(edges.items))); for (uint32_t i = 0; i < edges.N; i++) { edges.items[i].value = 0; edges.items[i].dest = 0; } for (uint32_t i = 0; i < n; i++) { add_node(); } cilk_for (uint32_t i = 0; i < n; i++) { cilk_for (uint32_t j = 0; j < n; j++) { // find_value returns 0 if not found. uint32_t value = g->find_value(i, j); if (value != 0) { add_edge(i, j, value); } } } node_lock.unlock_shared(); } uint64_t OFM::get_n() { node_lock.lock_shared(); uint64_t size = nodes.size(); node_lock.unlock_shared(); return size; } uint64_t OFM::get_size() { node_lock.lock_shared(); uint64_t size = nodes.capacity() * sizeof(node_t); size += edges.N * sizeof(edge_t); node_lock.unlock_shared(); return size; } void print_array(edge_list_t *edges) { printf("N = %d, logN = %d\n", edges->N, edges->logN); for (uint32_t i = 0; i < edges->N; i++) { if (is_null(edges->items[i])) { printf("%d-x ", i); } else if (is_sentinel(edges->items[i])) { uint32_t value = edges->items[i].value; if (value == UINT32_MAX) { value = 0; } printf("\n%d-s(%u):(?, ?) ", i, value); } else { printf("%d-(%d, %u) ", i, edges->items[i].dest, edges->items[i].value); } } printf("\n\n"); } void OFM::print_array(uint64_t worker_num) { printf("worker num: %lu, N = %d, logN = %d\n", worker_num, edges.N, edges.logN); for (uint32_t i = 0; i < edges.N; i++) { if (is_null(edges.items[i])) { printf("%d-x ", i); } else if (is_sentinel(edges.items[i])) { uint32_t value = edges.items[i].value; if (value == UINT32_MAX) { value = 0; } printf("\n worker num: %lu, %d-s(%u):(%d, %d)(%d) ", worker_num, i, value, nodes[value].beginning, nodes[value].end, nodes[value].num_neighbors); } else { printf("%d-(%d, %u) ", i, edges.items[i].dest, edges.items[i].value); } } printf("\n\n"); } // TODO jump to next leaf // get density of a node // should already be locked if you are calling get density double get_density(edge_list_t *list, uint32_t index, uint32_t len) { uint32_t full = 0; uint32_t i = index; while (i < index + len) { if (!is_null(list->items[i])) { full++; i++; } else { i = next_leaf(i, list->logN); } } double full_d = (double)full; return full_d / len; } uint32_t get_density_count(edge_list_t *list, uint32_t index, uint32_t len) { uint32_t full = 0; uint32_t i = index; while (i < index + len) { if (!is_null(list->items[i])) { full++; i++; } else { i = next_leaf(i, list->logN); } } return full; } // height of this node in the tree int get_depth(edge_list_t *list, int len) { return bsr_word(list->N / len); } // when adjusting the list size, make sure you're still in the // density bound pair_double density_bound(edge_list_t *list, int depth) { pair_double pair; // between 1/4 and 1/2 // pair.x = 1.0/2.0 - (( .25*depth)/list->H); // between 1/8 and 1/4 pair.x = 1.0 / 4.0 - ((.125 * depth) / list->H); pair.y = 3.0 / 4.0 + ((.25 * depth) / list->H); if (pair.y > list->density_limit) { pair.y = list->density_limit+.001; } return pair; } void OFM::fix_sentinel_locked(uint32_t node_index, int in) { node_lock.lock_shared(); if (node_index > 0) { nodes[node_index - 1].end = in; } nodes[node_index].beginning = in; if (node_index == nodes.size() - 1) { nodes[node_index].end = edges.N - 1; } node_lock.unlock_shared(); } // fix pointer from node to moved sentinel void OFM::fix_sentinel_unlocked(uint32_t node_index, int in) { node_lock.lock_shared(); if (node_index > 0) { nodes[node_index - 1].lock.lock(); nodes[node_index - 1].end = in; } nodes[node_index].lock.lock(); nodes[node_index].beginning = in; if (node_index == nodes.size() - 1) { nodes[node_index].end = edges.N - 1; } if (node_index > 0) { nodes[node_index - 1].lock.unlock(); } nodes[node_index].lock.unlock(); node_lock.unlock_shared(); } // Evenly redistribute elements in the ofm, given a range to look into // index: starting position in ofm structure // len: area to redistribute // should already be locked void OFM::redistribute(uint32_t index, uint32_t len) { // printf("REDISTRIBUTE: \n"); // print_array(); // std::vector space(len); // edge_t *space = (edge_t *)malloc(len * sizeof(*(edges.items))); uint32_t j = 0; // move all items in ofm in the range into // a temp array /* int i = index; while (i < index + len) { if (!is_null(edges.items[i])) { space[j] = edges.items[i]; edges.items[i].value = 0; edges.items[i].dest = 0; i++; j++; } else { i = next_leaf(i, edges.logN); } } */ uint32_t start_node = 0; uint32_t end_node = 0; bool found_sentinel = false; for (uint32_t i = index; i < index + len; i++) { if(is_sentinel(edges.items[i])) { if (!found_sentinel) { if (sentinel_index(edges.items[i]) > 0) { start_node = sentinel_index(edges.items[i]) - 1; } nodes[start_node].lock.lock(); if (sentinel_index(edges.items[i]) > 0) { end_node = sentinel_index(edges.items[i]); nodes[end_node].lock.lock(); } } end_node = sentinel_index(edges.items[i]); if (found_sentinel && end_node > start_node) { nodes[end_node].lock.lock(); } found_sentinel = true; } space[j].dest = edges.items[i].dest; space[j].value = edges.items[i].value; // counting non-null edges j += (!is_null(edges.items[i])); // setting section to null edges.items[i].value = 0; edges.items[i].dest = 0; } uint32_t i = index - 1; // cleanup if you didn't find any sentinels while(!found_sentinel) { if(is_sentinel(edges.items[i])) { found_sentinel = true; start_node = sentinel_index(edges.items[i]); end_node = start_node; nodes[start_node].lock.lock(); break; } i--; } uint32_t num_leaves = len / edges.logN; uint32_t count_per_leaf = j / num_leaves; uint32_t extra = j % num_leaves; uint32_t in = index; uint32_t j2 = 0; for (uint32_t i = 0; i < num_leaves; i++) { uint32_t count_for_leaf = count_per_leaf + (i < extra); for (uint32_t k = 0; k < count_for_leaf; k++) { edges.items[in].dest = space[j2].dest; edges.items[in].value = space[j2].value; if (is_sentinel(space[j2])) { // fixing pointer of node that goes to this sentinel uint32_t node_index = space[j2].value; if (node_index == UINT32_MAX) { node_index = 0; } fix_sentinel_locked(node_index, in); } j2++; in++; } in = index + (edges.logN * (i + 1)); } for(uint32_t i = start_node; i <= end_node; i++) { nodes[i].lock.unlock(); } free(space); } //TODO leaking memory void OFM::double_list() { printf("doubling list by worker %lu\n", get_worker_num()); grab_locks_in_range(&edges, 0, edges.N, DOUBLE); uint32_t new_N = edges.N * 2; edges.logN = (1 << bsr_word(bsr_word(new_N) + 1)); edges.density_limit = ((double) edges.logN - 1)/edges.logN; edges.H = bsr_word(new_N / edges.logN); if (LOCK_LEVEL > edges.H -1) { edges.lock_level = edges.H-1; } else { edges.lock_level = LOCK_LEVEL; } int orig_num_locks = edges.num_locks; edges.num_locks = new_N / (edges.logN << edges.lock_level); Lock* new_lock_array = (Lock*)malloc(edges.num_locks * sizeof(Lock)); memset(new_lock_array, 0, edges.num_locks * sizeof(Lock)); for (int i = 0; i < edges.num_locks ; i++) { new_lock_array[i].name("lockArray"); new_lock_array[i].number(i); } for(int i = 0; i < orig_num_locks; i++) { edges.lock_array[i].del(); } edges.N = new_N; edges.items = (edge_t *)realloc((void*)edges.items, new_N * sizeof(*(edges.items))); for (uint32_t i = new_N / 2; i < edges.N; i++) { edges.items[i].value = 0; // setting second half to null edges.items[i].dest = 0; // setting second half to null } //printf("List doubled: N - %u, logN = %u, H = %u\n", edges.N, edges.logN, edges.H); redistribute(0, edges.N); // edges.list_lock.unlock(); edges.lock_array = new_lock_array; } /* void OFM::half_list() { edges.list_lock.lock(); edges.N /= 2; edges.logN = (1 << bsr_word(bsr_word(edges.N) + 1)); edges.H = bsr_word(edges.N / edges.logN); if (LOCK_LEVEL > edges.H -1) { edges.lock_level = edges.H-1; } else { edges.lock_level = LOCK_LEVEL; } edges.num_locks = edges.N / (edges.logN << edges.lock_level); Lock* new_lock_array = (Lock*)malloc(edges.num_locks * sizeof(Lock)); memset(new_lock_array, 0, edges.num_locks * sizeof(Lock)); for (int i = 0; i < edges.num_locks ; i++) { new_lock_array[i].name("lockArray"); new_lock_array[i].number(i); } free(edges.lock_array); edges.lock_array = new_lock_array; edge_t *new_array = (edge_t *)malloc(edges.N * sizeof(*(edges.items))); uint32_t j = 0; for (uint32_t i = 0; i < edges.N * 2; i++) { if (!is_null(edges.items[i])) { new_array[j++] = edges.items[i]; } } free(edges.items); edges.items = new_array; redistribute(0, edges.N); edges.list_lock.unlock(); } */ // index is the beginning of the sequence that you want to slide right. // notice that slide right does not not null the current spot. // this is ok because we will be putting something in the current index // after sliding everything to the right. void OFM::slide_right(uint32_t index) { // edges.list_lock.lock_shared(); edge_t el; el.dest = edges.items[index].dest; el.value = edges.items[index].value; edges.items[index].dest = 0; edges.items[index].value = 0; int root_lock = find_lock_index(&edges, index); int current_lock = root_lock; edges.lock_array[current_lock].lock(); //printf("start of slide right, original_index: %d, worker number: %lu, current lock index = %d\n", original_index, get_worker_num(), current_lock); // edges.lock_array[current_lock].print(); index++; uint32_t leaf = find_leaf(&edges, index); while (index < edges.N && !is_null(edges.items[index])) { if (find_leaf(&edges, index) != leaf) { print_array(); printf("%u\n", index); } assert(find_leaf(&edges, index) == leaf); edge_t temp; temp.dest = edges.items[index].dest; temp.value = edges.items[index].value; edges.items[index].dest = el.dest; edges.items[index].value = el.value; if (!is_null(el) && is_sentinel(el)) { // fixing pointer of node that goes to this sentinel uint32_t node_index = el.value; if (node_index == UINT32_MAX) { node_index = 0; } fix_sentinel_unlocked(node_index, index); } el = temp; index++; int new_lock_index = find_lock_index(&edges, index); if (new_lock_index >= edges.num_locks){ assert(index < edges.N); } if(new_lock_index > current_lock) { edges.lock_array[new_lock_index].lock(); edges.lock_array[current_lock].unlock(); current_lock = new_lock_index; //printf("current lock = %d\n", current_lock); } } if (!is_null(el) && is_sentinel(el)) { // fixing pointer of node that goes to this sentinel uint32_t node_index = el.value; if (node_index == UINT32_MAX) { node_index = 0; } fix_sentinel_unlocked(node_index, index); } //printf("middle of slide right, original_index: %d, worker number: %lu, current lock = %d\n", original_index, get_worker_num(), current_lock); // TODO There might be an issue with this going of the end sometimes if (index == edges.N) { print_array(); printf("slide off the end on the right, can't happen\n"); exit(0); } // TODO: figure out if we actually need this assert (or a modified version of // it) // assert(find_leaf(&edges, index) <= root_leaf + 1); edges.items[index].dest = el.dest; edges.items[index].value = el.value; //printf("end of slide right, original_index: %d, worker number: %lu\n", original_index, get_worker_num()); if(!edges.lock_array[current_lock].i_own_lock()) { edges.lock_array[current_lock].print(); } assert(edges.lock_array[current_lock].i_own_lock()); // edges.list_lock.unlock_shared(); edges.lock_array[current_lock].unlock(); } // true if e1, e2 are equals bool edge_equals(edge_t e1, edge_t e2) { return e1.dest == e2.dest && e1.value == e2.value; } // return index of the edge elem // takes in edge list and place to start looking uint32_t find_elem_pointer(edge_list_t *list, uint32_t index, edge_t elem) { // printf("index2 = %d\n", index); // TODO: make this not like this // list->list_lock.lock_shared(); edge_t item; item.dest = list->items[index].dest; item.value = list->items[index].value; int root_lock = find_lock_index(list, index); int current_lock = root_lock; list->lock_array[current_lock].lock_shared(); while (!edge_equals(item, elem)) { // printf("index = %d elem dest = %u, elem value = %u item dest %u item // value %u \n", index, elem.dest, elem.value, item.dest, item.value); index++; int new_lock_index = find_lock_index(list, index); if(new_lock_index > current_lock) { list->lock_array[new_lock_index].lock_shared(); list->lock_array[current_lock].unlock_shared(); current_lock = new_lock_index; } item.dest = list->items[index].dest; item.value = list->items[index].value; } list->lock_array[current_lock].unlock_shared(); // list->list_lock.unlock_shared(); return index; } uint32_t find_prev_valid(edge_list_t *list, uint32_t start) { while (is_null(list->items[start])) { start--; } return start; } // important: make sure start, end don't include sentinels // returns the index of the smallest element bigger than you in the range // [start, end) // if no such element is found, returns end (because insert shifts everything to // the right) // assumes we already hold the list_lock and the relevant lock_array locks uint32_t binary_search(edge_list_t *list, edge_t *elem, uint32_t start, uint32_t end) { while (start + 1 < end) { uint32_t mid = (start + end) / 2; //printf("start = %d, end = %d, dest = %d, mid = %d\n", start, end, elem->dest, mid); // printf("start: %d, mid: %d, end: %d\n", start, mid, end); edge_t item; item.dest = list->items[mid].dest; item.value = list->items[mid].value; if (is_null(item)) { // first check the next leaf uint32_t check = next_leaf(mid, list->logN); //TODO deal with check is null if (check > end) { end = mid; continue; } if (is_null(list->items[check])) { uint32_t early_check = find_prev_valid(list, mid); if (early_check < start) { start = mid; continue; } check = early_check; } // printf("check = %d\n", check); uint32_t dest = list->items[check].dest; if (elem->dest == dest) { // cleanup before return return check; } else if (elem->dest < dest) { end = find_prev_valid(list, mid) + 1; } else { if (check == start) { start = check +1; } else { start = check; } // otherwise, searched for item is more than current and we set start } continue; } // if we found it, return if (elem->dest == item.dest) { // cleanup before return return mid; } else if (elem->dest < item.dest) { end = mid; // if the searched for item is less than current item, set end } else { start = mid; // otherwise, searched for item is more than current and we set start } } if (end < start) { start = end; } assert(start >= 0); assert(end < list->N); // handling the case where there is one element left // if you are leq, return start (index where elt is) // otherwise, return end (no element greater than you in the range) // printf("start = %d, end = %d, n = %d\n", start,end, list->N); if (elem->dest <= list->items[start].dest && !is_null(list->items[start])) { end = start; } // cleanup before return return end; } uint32_t OFM::find_value(uint32_t src, uint32_t dest) { node_lock.lock_shared(); edge_t e; e.value = 0; e.dest = dest; //printf("src: %d, dest: %d\n", src, dest); //printf("beginning: %d, end:%d\n", nodes[src].beginning+1, nodes[src].end); //edges.list_lock.lock_shared(); for(int i = find_lock_index(&edges, nodes[src].beginning + 1); i <= find_lock_index(&edges, nodes[src].end); i++) { edges.lock_array[i].lock_shared(); } uint32_t loc = binary_search(&edges, &e, nodes[src].beginning + 1, nodes[src].end); //printf("loc = %d\n",loc); e.dest = edges.items[loc].dest; e.value = edges.items[loc].value; for(int i = find_lock_index(&edges, nodes[src].beginning + 1); i <= find_lock_index(&edges, nodes[src].end); i++) { edges.lock_array[i].unlock_shared(); } // edges.list_lock.unlock_shared(); node_lock.unlock_shared(); // print_array(); // printf("loc: %d\n", loc); if (!is_null(e) && e.dest == dest) { return e.value; } else { return 0; } } // insert elem at index // assumes the lock on index is held by the parent // and releases it when it is done with it void OFM::insert(uint32_t index, edge_t elem, uint32_t src) { assert(edges.lock_array[find_lock_index(&edges, index)].i_own_lock()); printf("index = %d elem dest = %u, elem value = %u \n", index, elem.dest, elem.value); print_array(get_worker_num()); uint32_t orig_n = edges.N; uint32_t node_index = find_leaf(&edges, index); // edges.list_lock.lock_shared(); //printf("got lock %d\n", current_lock_index); //printf("node_index = %d\n", node_index); int level = edges.H; uint32_t len = edges.logN; // always deposit on the left if (is_null(edges.items[index])) { // printf("added to empty\n"); edges.items[index].value = elem.value; edges.items[index].dest = elem.dest; } else { // if the edge already exists in the graph, update its value // do not make another edge // return index of the edge that already exists if (!is_sentinel(elem) && edges.items[index].dest == elem.dest) { edges.items[index].value = elem.value; // edges.list_lock.unlock_shared(); edges.lock_array[find_lock_index(&edges, index)].unlock(); return; } if (index == edges.N - 1) { // when adding to the end double then add edge //allow double to deal with its own locks and try again //TODO make sure two people can't double at the same time if (edges.N == orig_n) { // for (int i = 0; i < lock_count; i++) { // edges.list_lock.unlock_shared(); //} edges.lock_array[find_lock_index(&edges, index)].unlock(DOUBLE); printf("first double due to worker %lu\n", get_worker_num()); double_list(); // for (int i = 0; i < lock_count; i++) { // edges.list_lock.lock_shared(); // } } node_t node = nodes[src]; for(int i = find_lock_index(&edges, nodes[src].beginning + 1); i <= find_lock_index(&edges, nodes[src].end); i++) { edges.lock_array[i].lock(); } uint32_t loc_to_add = binary_search(&edges, &elem, node.beginning + 1, node.end); for(int i = find_lock_index(&edges, node.beginning + 1); i <= find_lock_index(&edges, node.end); i++) { if (i != find_lock_index(&edges, loc_to_add)) { edges.lock_array[i].unlock(); } } // printf("loc_to_add: %d\n", loc_to_add); // printf("src: %d, dest: %d\n", src, dest); // print_array(); insert(loc_to_add, elem, src); // edges.list_lock.unlock_shared(); return; } else { slide_right(index); } // printf("after sliding, index = %d\n", index); // print_array(); edges.items[index].value = elem.value; edges.items[index].dest = elem.dest; // print_array(); } assert(!is_null(edges.items[index])); // print_array(); // printf("node_index2 = %d\n", node_index); double density = get_density(&edges, node_index, len); //printf("density = %f, %d\n", density, density == 1); // spill over into next level up, node is completely full. if (density == 1) { //printf("first rebalence\n"); release_locks_in_range(&edges, node_index, len, REBALANCE); len*=2; level--; node_index = find_node(node_index, len); grab_locks_in_range(&edges, node_index, len, REBALANCE); redistribute(node_index, len); //print_array(); } else { // makes the last slot in a section empty so you can always slide right redistribute(node_index, len); } // printf("node_index3 = %d\n", node_index); // print_array(); // get density of the leaf you are in pair_double density_b = density_bound(&edges, level); uint32_t density_count = get_density_count(&edges, node_index, len); density = ((double)density_count)/len; // printf("density %f, upperbound %f, len = %d, N = %d, logN = %d\n", density, // density_b.y, len, list->N, list->logN); // while density too high, go up the implicit tree // go up to the biggest node above the density bound //printf("node_index = %d, desnsity = %f, density bound = %f\n", node_index, density, density_b.y); while (density >= density_b.y) { //printf("node_index = %d, desnsity = %f, density bound = %f\n", node_index, density, density_b.y); len *= 2; if (len <= edges.N) { release_locks_in_range(&edges, node_index, len / 2, REBALANCE); level--; uint32_t new_node_index = find_node(node_index, len); grab_locks_in_range(&edges, new_node_index, len, REBALANCE); density_count += get_density_count(&edges, new_node_index, len); // to help prevent double doubling by knowing how big it was on the last count orig_n = edges.N; node_index = new_node_index; density_b = density_bound(&edges, level); density = ((double)density_count)/len; } else { // if you reach the root, double the list release_locks_in_range(&edges, node_index, len / 2, DOUBLE); //if (edges.N == orig_n) { // for (int i = 0; i < lock_count; i++) { // edges.list_lock.unlock_shared(); //} //TODO don't double double printf("second double due to worker %lu\n", get_worker_num()); print_array(get_worker_num()); double_list(); // -1 for the lock at the begining of the function // we want to leave with the same number as we entered with //for (int i = 0; i < lock_count-1; i++) { // edges.list_lock.lock_shared(); //} // } /* if(index == 2 && elem.dest == 4 && elem.value == 64) { while(1) { } } */ // search from the beginning because list was doubled return; } // printf("density %f, upperbound %f, len = %d, N = %d, logN = %d\n", // density, density_b.y, len, list->N, list->logN); } if (len > edges.logN) { redistribute(node_index, len); } release_locks_in_range(&edges, node_index, len, GENERAL); // printf("node_index5 = %d\n", node_index); // print_array(); // edges.list_lock.unlock_shared(); return; } #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 1077 "./OFM.cpp" # 1078 "./OFM.cpp" #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 1078 "./OFM.cpp" # 1079 "./OFM.cpp" #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 1079 "./OFM.cpp" # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/iomanip" 1 3 // Standard stream manipulators -*- C++ -*- // Copyright (C) 1997-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file include/iomanip * This is a Standard C++ Library header. */ // // ISO C++ 14882: 27.6.3 Standard manipulators // #ifndef _GLIBCXX_IOMANIP #define _GLIBCXX_IOMANIP 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 37 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/iomanip" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 38 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/iomanip" 3 # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/iomanip" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/iomanip" 3 # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/iomanip" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/iomanip" 3 # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/iomanip" 3 #if __cplusplus >= 201103L #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 43 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/iomanip" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/locale" 1 3 // Locale support -*- C++ -*- // Copyright (C) 1997-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . // // ISO C++ 14882: 22.1 Locales // /** @file include/locale * This is a Standard C++ Library header. */ #ifndef _GLIBCXX_LOCALE #define _GLIBCXX_LOCALE 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 37 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/locale" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 38 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/locale" 3 # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/locale" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/locale" 3 # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/locale" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/locale" 3 # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/locale" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/locale" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets_nonio.h" 1 3 // Locale support -*- C++ -*- // Copyright (C) 2007-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file bits/locale_facets_nonio.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{locale} */ // // ISO C++ 14882: 22.1 Locales // #ifndef _LOCALE_FACETS_NONIO_H #define _LOCALE_FACETS_NONIO_H 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 38 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets_nonio.h" 3 #if 0 /* expanded by -frewrite-includes */ #include // For struct tm #endif /* expanded by -frewrite-includes */ # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets_nonio.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ctime" 1 3 // -*- C++ -*- forwarding header. // Copyright (C) 1997-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file include/ctime * This is a Standard C++ Library file. You should @c \#include this file * in your programs, rather than any of the @a *.h implementation files. * * This is the C++ version of the Standard C Library header @c time.h, * and its contents are (mostly) the same as that header, but are all * contained in the namespace @c std (except for names which are defined * as macros in C). */ // // ISO C++ 14882: 20.5 Date and time // #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ctime" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ctime" 3 # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ctime" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ctime" 3 # 43 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ctime" 3 #ifndef _GLIBCXX_CTIME #define _GLIBCXX_CTIME 1 // Get rid of those macros defined in in lieu of real functions. #undef clock #undef difftime #undef mktime #undef time #undef asctime #undef ctime #undef gmtime #undef localtime #undef strftime namespace std { using ::clock_t; using ::time_t; using ::tm; using ::clock; using ::difftime; using ::mktime; using ::time; using ::asctime; using ::ctime; using ::gmtime; using ::localtime; using ::strftime; } // namespace #endif # 76 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/ctime" 3 # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets_nonio.h" 2 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION /** * @brief Time format ordering data. * @ingroup locales * * This class provides an enum representing different orderings of * time: day, month, and year. */ class time_base { public: enum dateorder { no_order, dmy, mdy, ymd, ydm }; }; template struct __timepunct_cache : public locale::facet { // List of all known timezones, with GMT first. static const _CharT* _S_timezones[14]; const _CharT* _M_date_format; const _CharT* _M_date_era_format; const _CharT* _M_time_format; const _CharT* _M_time_era_format; const _CharT* _M_date_time_format; const _CharT* _M_date_time_era_format; const _CharT* _M_am; const _CharT* _M_pm; const _CharT* _M_am_pm_format; // Day names, starting with "C"'s Sunday. const _CharT* _M_day1; const _CharT* _M_day2; const _CharT* _M_day3; const _CharT* _M_day4; const _CharT* _M_day5; const _CharT* _M_day6; const _CharT* _M_day7; // Abbreviated day names, starting with "C"'s Sun. const _CharT* _M_aday1; const _CharT* _M_aday2; const _CharT* _M_aday3; const _CharT* _M_aday4; const _CharT* _M_aday5; const _CharT* _M_aday6; const _CharT* _M_aday7; // Month names, starting with "C"'s January. const _CharT* _M_month01; const _CharT* _M_month02; const _CharT* _M_month03; const _CharT* _M_month04; const _CharT* _M_month05; const _CharT* _M_month06; const _CharT* _M_month07; const _CharT* _M_month08; const _CharT* _M_month09; const _CharT* _M_month10; const _CharT* _M_month11; const _CharT* _M_month12; // Abbreviated month names, starting with "C"'s Jan. const _CharT* _M_amonth01; const _CharT* _M_amonth02; const _CharT* _M_amonth03; const _CharT* _M_amonth04; const _CharT* _M_amonth05; const _CharT* _M_amonth06; const _CharT* _M_amonth07; const _CharT* _M_amonth08; const _CharT* _M_amonth09; const _CharT* _M_amonth10; const _CharT* _M_amonth11; const _CharT* _M_amonth12; bool _M_allocated; __timepunct_cache(size_t __refs = 0) : facet(__refs), _M_date_format(0), _M_date_era_format(0), _M_time_format(0), _M_time_era_format(0), _M_date_time_format(0), _M_date_time_era_format(0), _M_am(0), _M_pm(0), _M_am_pm_format(0), _M_day1(0), _M_day2(0), _M_day3(0), _M_day4(0), _M_day5(0), _M_day6(0), _M_day7(0), _M_aday1(0), _M_aday2(0), _M_aday3(0), _M_aday4(0), _M_aday5(0), _M_aday6(0), _M_aday7(0), _M_month01(0), _M_month02(0), _M_month03(0), _M_month04(0), _M_month05(0), _M_month06(0), _M_month07(0), _M_month08(0), _M_month09(0), _M_month10(0), _M_month11(0), _M_month12(0), _M_amonth01(0), _M_amonth02(0), _M_amonth03(0), _M_amonth04(0), _M_amonth05(0), _M_amonth06(0), _M_amonth07(0), _M_amonth08(0), _M_amonth09(0), _M_amonth10(0), _M_amonth11(0), _M_amonth12(0), _M_allocated(false) { } ~__timepunct_cache(); private: __timepunct_cache& operator=(const __timepunct_cache&); explicit __timepunct_cache(const __timepunct_cache&); }; template __timepunct_cache<_CharT>::~__timepunct_cache() { if (_M_allocated) { // Unused. } } // Specializations. template<> const char* __timepunct_cache::_S_timezones[14]; #ifdef _GLIBCXX_USE_WCHAR_T template<> const wchar_t* __timepunct_cache::_S_timezones[14]; #endif # 168 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets_nonio.h" 3 // Generic. template const _CharT* __timepunct_cache<_CharT>::_S_timezones[14]; template class __timepunct : public locale::facet { public: // Types: typedef _CharT __char_type; typedef __timepunct_cache<_CharT> __cache_type; protected: __cache_type* _M_data; __c_locale _M_c_locale_timepunct; const char* _M_name_timepunct; public: /// Numpunct facet id. static locale::id id; explicit __timepunct(size_t __refs = 0); explicit __timepunct(__cache_type* __cache, size_t __refs = 0); /** * @brief Internal constructor. Not for general use. * * This is a constructor for use by the library itself to set up new * locales. * * @param __cloc The C locale. * @param __s The name of a locale. * @param refs Passed to the base facet class. */ explicit __timepunct(__c_locale __cloc, const char* __s, size_t __refs = 0); // FIXME: for error checking purposes _M_put should return the return // value of strftime/wcsftime. void _M_put(_CharT* __s, size_t __maxlen, const _CharT* __format, const tm* __tm) const throw (); void _M_date_formats(const _CharT** __date) const { // Always have default first. __date[0] = _M_data->_M_date_format; __date[1] = _M_data->_M_date_era_format; } void _M_time_formats(const _CharT** __time) const { // Always have default first. __time[0] = _M_data->_M_time_format; __time[1] = _M_data->_M_time_era_format; } void _M_date_time_formats(const _CharT** __dt) const { // Always have default first. __dt[0] = _M_data->_M_date_time_format; __dt[1] = _M_data->_M_date_time_era_format; } void _M_am_pm_format(const _CharT* __ampm) const { __ampm = _M_data->_M_am_pm_format; } void _M_am_pm(const _CharT** __ampm) const { __ampm[0] = _M_data->_M_am; __ampm[1] = _M_data->_M_pm; } void _M_days(const _CharT** __days) const { __days[0] = _M_data->_M_day1; __days[1] = _M_data->_M_day2; __days[2] = _M_data->_M_day3; __days[3] = _M_data->_M_day4; __days[4] = _M_data->_M_day5; __days[5] = _M_data->_M_day6; __days[6] = _M_data->_M_day7; } void _M_days_abbreviated(const _CharT** __days) const { __days[0] = _M_data->_M_aday1; __days[1] = _M_data->_M_aday2; __days[2] = _M_data->_M_aday3; __days[3] = _M_data->_M_aday4; __days[4] = _M_data->_M_aday5; __days[5] = _M_data->_M_aday6; __days[6] = _M_data->_M_aday7; } void _M_months(const _CharT** __months) const { __months[0] = _M_data->_M_month01; __months[1] = _M_data->_M_month02; __months[2] = _M_data->_M_month03; __months[3] = _M_data->_M_month04; __months[4] = _M_data->_M_month05; __months[5] = _M_data->_M_month06; __months[6] = _M_data->_M_month07; __months[7] = _M_data->_M_month08; __months[8] = _M_data->_M_month09; __months[9] = _M_data->_M_month10; __months[10] = _M_data->_M_month11; __months[11] = _M_data->_M_month12; } void _M_months_abbreviated(const _CharT** __months) const { __months[0] = _M_data->_M_amonth01; __months[1] = _M_data->_M_amonth02; __months[2] = _M_data->_M_amonth03; __months[3] = _M_data->_M_amonth04; __months[4] = _M_data->_M_amonth05; __months[5] = _M_data->_M_amonth06; __months[6] = _M_data->_M_amonth07; __months[7] = _M_data->_M_amonth08; __months[8] = _M_data->_M_amonth09; __months[9] = _M_data->_M_amonth10; __months[10] = _M_data->_M_amonth11; __months[11] = _M_data->_M_amonth12; } protected: virtual ~__timepunct(); // For use at construction time only. void _M_initialize_timepunct(__c_locale __cloc = 0); }; template locale::id __timepunct<_CharT>::id; // Specializations. template<> void __timepunct::_M_initialize_timepunct(__c_locale __cloc); template<> void __timepunct::_M_put(char*, size_t, const char*, const tm*) const throw (); #ifdef _GLIBCXX_USE_WCHAR_T template<> void __timepunct::_M_initialize_timepunct(__c_locale __cloc); template<> void __timepunct::_M_put(wchar_t*, size_t, const wchar_t*, const tm*) const throw (); #endif # 339 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets_nonio.h" 3 _GLIBCXX_END_NAMESPACE_VERSION } // namespace // Include host and configuration specific timepunct functions. #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 344 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets_nonio.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/time_members.h" 1 3 // std::time_get, std::time_put implementation, GNU version -*- C++ -*- // Copyright (C) 2001-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file bits/time_members.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{locale} */ // // ISO C++ 14882: 22.2.5.1.2 - time_get functions // ISO C++ 14882: 22.2.5.3.2 - time_put functions // // Written by Benjamin Kosnik namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION template __timepunct<_CharT>::__timepunct(size_t __refs) : facet(__refs), _M_data(0), _M_c_locale_timepunct(0), _M_name_timepunct(_S_get_c_name()) { _M_initialize_timepunct(); } template __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(0), _M_name_timepunct(_S_get_c_name()) { _M_initialize_timepunct(); } template __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s, size_t __refs) : facet(__refs), _M_data(0), _M_c_locale_timepunct(0), _M_name_timepunct(0) { if (__builtin_strcmp(__s, _S_get_c_name()) != 0) { const size_t __len = __builtin_strlen(__s) + 1; char* __tmp = new char[__len]; __builtin_memcpy(__tmp, __s, __len); _M_name_timepunct = __tmp; } else _M_name_timepunct = _S_get_c_name(); __try { _M_initialize_timepunct(__cloc); } __catch(...) { if (_M_name_timepunct != _S_get_c_name()) delete [] _M_name_timepunct; __throw_exception_again; } } template __timepunct<_CharT>::~__timepunct() { if (_M_name_timepunct != _S_get_c_name()) delete [] _M_name_timepunct; delete _M_data; _S_destroy_c_locale(_M_c_locale_timepunct); } _GLIBCXX_END_NAMESPACE_VERSION } // namespace # 345 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets_nonio.h" 2 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION _GLIBCXX_BEGIN_NAMESPACE_CXX11 /** * @brief Primary class template time_get. * @ingroup locales * * This facet encapsulates the code to parse and return a date or * time from a string. It is used by the istream numeric * extraction operators. * * The time_get template uses protected virtual functions to provide the * actual results. The public accessors forward the call to the virtual * functions. These virtual functions are hooks for developers to * implement the behavior they require from the time_get facet. */ template class time_get : public locale::facet, public time_base { public: // Types: //@{ /// Public typedefs typedef _CharT char_type; typedef _InIter iter_type; //@} /// Numpunct facet id. static locale::id id; /** * @brief Constructor performs initialization. * * This is the constructor provided by the standard. * * @param __refs Passed to the base facet class. */ explicit time_get(size_t __refs = 0) : facet (__refs) { } /** * @brief Return preferred order of month, day, and year. * * This function returns an enum from time_base::dateorder giving the * preferred ordering if the format @a x given to time_put::put() only * uses month, day, and year. If the format @a x for the associated * locale uses other fields, this function returns * time_base::dateorder::noorder. * * NOTE: The library always returns noorder at the moment. * * @return A member of time_base::dateorder. */ dateorder date_order() const { return this->do_date_order(); } /** * @brief Parse input time string. * * This function parses a time according to the format @a X and puts the * results into a user-supplied struct tm. The result is returned by * calling time_get::do_get_time(). * * If there is a valid time string according to format @a X, @a tm will * be filled in accordingly and the returned iterator will point to the * first character beyond the time string. If an error occurs before * the end, err |= ios_base::failbit. If parsing reads all the * characters, err |= ios_base::eofbit. * * @param __beg Start of string to parse. * @param __end End of string to parse. * @param __io Source of the locale. * @param __err Error flags to set. * @param __tm Pointer to struct tm to fill in. * @return Iterator to first char beyond time string. */ iter_type get_time(iter_type __beg, iter_type __end, ios_base& __io, ios_base::iostate& __err, tm* __tm) const { return this->do_get_time(__beg, __end, __io, __err, __tm); } /** * @brief Parse input date string. * * This function parses a date according to the format @a x and puts the * results into a user-supplied struct tm. The result is returned by * calling time_get::do_get_date(). * * If there is a valid date string according to format @a x, @a tm will * be filled in accordingly and the returned iterator will point to the * first character beyond the date string. If an error occurs before * the end, err |= ios_base::failbit. If parsing reads all the * characters, err |= ios_base::eofbit. * * @param __beg Start of string to parse. * @param __end End of string to parse. * @param __io Source of the locale. * @param __err Error flags to set. * @param __tm Pointer to struct tm to fill in. * @return Iterator to first char beyond date string. */ iter_type get_date(iter_type __beg, iter_type __end, ios_base& __io, ios_base::iostate& __err, tm* __tm) const { return this->do_get_date(__beg, __end, __io, __err, __tm); } /** * @brief Parse input weekday string. * * This function parses a weekday name and puts the results into a * user-supplied struct tm. The result is returned by calling * time_get::do_get_weekday(). * * Parsing starts by parsing an abbreviated weekday name. If a valid * abbreviation is followed by a character that would lead to the full * weekday name, parsing continues until the full name is found or an * error occurs. Otherwise parsing finishes at the end of the * abbreviated name. * * If an error occurs before the end, err |= ios_base::failbit. If * parsing reads all the characters, err |= ios_base::eofbit. * * @param __beg Start of string to parse. * @param __end End of string to parse. * @param __io Source of the locale. * @param __err Error flags to set. * @param __tm Pointer to struct tm to fill in. * @return Iterator to first char beyond weekday name. */ iter_type get_weekday(iter_type __beg, iter_type __end, ios_base& __io, ios_base::iostate& __err, tm* __tm) const { return this->do_get_weekday(__beg, __end, __io, __err, __tm); } /** * @brief Parse input month string. * * This function parses a month name and puts the results into a * user-supplied struct tm. The result is returned by calling * time_get::do_get_monthname(). * * Parsing starts by parsing an abbreviated month name. If a valid * abbreviation is followed by a character that would lead to the full * month name, parsing continues until the full name is found or an * error occurs. Otherwise parsing finishes at the end of the * abbreviated name. * * If an error occurs before the end, err |= ios_base::failbit. If * parsing reads all the characters, err |= * ios_base::eofbit. * * @param __beg Start of string to parse. * @param __end End of string to parse. * @param __io Source of the locale. * @param __err Error flags to set. * @param __tm Pointer to struct tm to fill in. * @return Iterator to first char beyond month name. */ iter_type get_monthname(iter_type __beg, iter_type __end, ios_base& __io, ios_base::iostate& __err, tm* __tm) const { return this->do_get_monthname(__beg, __end, __io, __err, __tm); } /** * @brief Parse input year string. * * This function reads up to 4 characters to parse a year string and * puts the results into a user-supplied struct tm. The result is * returned by calling time_get::do_get_year(). * * 4 consecutive digits are interpreted as a full year. If there are * exactly 2 consecutive digits, the library interprets this as the * number of years since 1900. * * If an error occurs before the end, err |= ios_base::failbit. If * parsing reads all the characters, err |= ios_base::eofbit. * * @param __beg Start of string to parse. * @param __end End of string to parse. * @param __io Source of the locale. * @param __err Error flags to set. * @param __tm Pointer to struct tm to fill in. * @return Iterator to first char beyond year. */ iter_type get_year(iter_type __beg, iter_type __end, ios_base& __io, ios_base::iostate& __err, tm* __tm) const { return this->do_get_year(__beg, __end, __io, __err, __tm); } #if __cplusplus >= 201103L /** * @brief Parse input string according to format. * * This function calls time_get::do_get with the provided * parameters. @see do_get() and get(). * * @param __s Start of string to parse. * @param __end End of string to parse. * @param __io Source of the locale. * @param __err Error flags to set. * @param __tm Pointer to struct tm to fill in. * @param __format Format specifier. * @param __modifier Format modifier. * @return Iterator to first char not parsed. */ inline iter_type get(iter_type __s, iter_type __end, ios_base& __io, ios_base::iostate& __err, tm* __tm, char __format, char __modifier = 0) const { return this->do_get(__s, __end, __io, __err, __tm, __format, __modifier); } /** * @brief Parse input string according to format. * * This function parses the input string according to a * provided format string. It does the inverse of * time_put::put. The format string follows the format * specified for strftime(3)/strptime(3). The actual parsing * is done by time_get::do_get. * * @param __s Start of string to parse. * @param __end End of string to parse. * @param __io Source of the locale. * @param __err Error flags to set. * @param __tm Pointer to struct tm to fill in. * @param __fmt Start of the format string. * @param __fmtend End of the format string. * @return Iterator to first char not parsed. */ iter_type get(iter_type __s, iter_type __end, ios_base& __io, ios_base::iostate& __err, tm* __tm, const char_type* __fmt, const char_type* __fmtend) const; #endif // __cplusplus >= 201103L # 587 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets_nonio.h" 3 protected: /// Destructor. virtual ~time_get() { } /** * @brief Return preferred order of month, day, and year. * * This function returns an enum from time_base::dateorder giving the * preferred ordering if the format @a x given to time_put::put() only * uses month, day, and year. This function is a hook for derived * classes to change the value returned. * * @return A member of time_base::dateorder. */ virtual dateorder do_date_order() const; /** * @brief Parse input time string. * * This function parses a time according to the format @a x and puts the * results into a user-supplied struct tm. This function is a hook for * derived classes to change the value returned. @see get_time() for * details. * * @param __beg Start of string to parse. * @param __end End of string to parse. * @param __io Source of the locale. * @param __err Error flags to set. * @param __tm Pointer to struct tm to fill in. * @return Iterator to first char beyond time string. */ virtual iter_type do_get_time(iter_type __beg, iter_type __end, ios_base& __io, ios_base::iostate& __err, tm* __tm) const; /** * @brief Parse input date string. * * This function parses a date according to the format @a X and puts the * results into a user-supplied struct tm. This function is a hook for * derived classes to change the value returned. @see get_date() for * details. * * @param __beg Start of string to parse. * @param __end End of string to parse. * @param __io Source of the locale. * @param __err Error flags to set. * @param __tm Pointer to struct tm to fill in. * @return Iterator to first char beyond date string. */ virtual iter_type do_get_date(iter_type __beg, iter_type __end, ios_base& __io, ios_base::iostate& __err, tm* __tm) const; /** * @brief Parse input weekday string. * * This function parses a weekday name and puts the results into a * user-supplied struct tm. This function is a hook for derived * classes to change the value returned. @see get_weekday() for * details. * * @param __beg Start of string to parse. * @param __end End of string to parse. * @param __io Source of the locale. * @param __err Error flags to set. * @param __tm Pointer to struct tm to fill in. * @return Iterator to first char beyond weekday name. */ virtual iter_type do_get_weekday(iter_type __beg, iter_type __end, ios_base&, ios_base::iostate& __err, tm* __tm) const; /** * @brief Parse input month string. * * This function parses a month name and puts the results into a * user-supplied struct tm. This function is a hook for derived * classes to change the value returned. @see get_monthname() for * details. * * @param __beg Start of string to parse. * @param __end End of string to parse. * @param __io Source of the locale. * @param __err Error flags to set. * @param __tm Pointer to struct tm to fill in. * @return Iterator to first char beyond month name. */ virtual iter_type do_get_monthname(iter_type __beg, iter_type __end, ios_base&, ios_base::iostate& __err, tm* __tm) const; /** * @brief Parse input year string. * * This function reads up to 4 characters to parse a year string and * puts the results into a user-supplied struct tm. This function is a * hook for derived classes to change the value returned. @see * get_year() for details. * * @param __beg Start of string to parse. * @param __end End of string to parse. * @param __io Source of the locale. * @param __err Error flags to set. * @param __tm Pointer to struct tm to fill in. * @return Iterator to first char beyond year. */ virtual iter_type do_get_year(iter_type __beg, iter_type __end, ios_base& __io, ios_base::iostate& __err, tm* __tm) const; #if __cplusplus >= 201103L /** * @brief Parse input string according to format. * * This function parses the string according to the provided * format and optional modifier. This function is a hook for * derived classes to change the value returned. @see get() * for more details. * * @param __s Start of string to parse. * @param __end End of string to parse. * @param __f Source of the locale. * @param __err Error flags to set. * @param __tm Pointer to struct tm to fill in. * @param __format Format specifier. * @param __modifier Format modifier. * @return Iterator to first char not parsed. */ #if _GLIBCXX_USE_CXX11_ABI virtual #endif # 722 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets_nonio.h" 3 iter_type do_get(iter_type __s, iter_type __end, ios_base& __f, ios_base::iostate& __err, tm* __tm, char __format, char __modifier) const; #endif // __cplusplus >= 201103L # 727 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets_nonio.h" 3 // Extract numeric component of length __len. iter_type _M_extract_num(iter_type __beg, iter_type __end, int& __member, int __min, int __max, size_t __len, ios_base& __io, ios_base::iostate& __err) const; // Extract any unique array of string literals in a const _CharT* array. iter_type _M_extract_name(iter_type __beg, iter_type __end, int& __member, const _CharT** __names, size_t __indexlen, ios_base& __io, ios_base::iostate& __err) const; // Extract day or month name in a const _CharT* array. iter_type _M_extract_wday_or_month(iter_type __beg, iter_type __end, int& __member, const _CharT** __names, size_t __indexlen, ios_base& __io, ios_base::iostate& __err) const; // Extract on a component-by-component basis, via __format argument. iter_type _M_extract_via_format(iter_type __beg, iter_type __end, ios_base& __io, ios_base::iostate& __err, tm* __tm, const _CharT* __format) const; }; template locale::id time_get<_CharT, _InIter>::id; /// class time_get_byname [22.2.5.2]. template class time_get_byname : public time_get<_CharT, _InIter> { public: // Types: typedef _CharT char_type; typedef _InIter iter_type; explicit time_get_byname(const char*, size_t __refs = 0) : time_get<_CharT, _InIter>(__refs) { } #if __cplusplus >= 201103L explicit time_get_byname(const string& __s, size_t __refs = 0) : time_get_byname(__s.c_str(), __refs) { } #endif # 774 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets_nonio.h" 3 protected: virtual ~time_get_byname() { } }; _GLIBCXX_END_NAMESPACE_CXX11 /** * @brief Primary class template time_put. * @ingroup locales * * This facet encapsulates the code to format and output dates and times * according to formats used by strftime(). * * The time_put template uses protected virtual functions to provide the * actual results. The public accessors forward the call to the virtual * functions. These virtual functions are hooks for developers to * implement the behavior they require from the time_put facet. */ template class time_put : public locale::facet { public: // Types: //@{ /// Public typedefs typedef _CharT char_type; typedef _OutIter iter_type; //@} /// Numpunct facet id. static locale::id id; /** * @brief Constructor performs initialization. * * This is the constructor provided by the standard. * * @param __refs Passed to the base facet class. */ explicit time_put(size_t __refs = 0) : facet(__refs) { } /** * @brief Format and output a time or date. * * This function formats the data in struct tm according to the * provided format string. The format string is interpreted as by * strftime(). * * @param __s The stream to write to. * @param __io Source of locale. * @param __fill char_type to use for padding. * @param __tm Struct tm with date and time info to format. * @param __beg Start of format string. * @param __end End of format string. * @return Iterator after writing. */ iter_type put(iter_type __s, ios_base& __io, char_type __fill, const tm* __tm, const _CharT* __beg, const _CharT* __end) const; /** * @brief Format and output a time or date. * * This function formats the data in struct tm according to the * provided format char and optional modifier. The format and modifier * are interpreted as by strftime(). It does so by returning * time_put::do_put(). * * @param __s The stream to write to. * @param __io Source of locale. * @param __fill char_type to use for padding. * @param __tm Struct tm with date and time info to format. * @param __format Format char. * @param __mod Optional modifier char. * @return Iterator after writing. */ iter_type put(iter_type __s, ios_base& __io, char_type __fill, const tm* __tm, char __format, char __mod = 0) const { return this->do_put(__s, __io, __fill, __tm, __format, __mod); } protected: /// Destructor. virtual ~time_put() { } /** * @brief Format and output a time or date. * * This function formats the data in struct tm according to the * provided format char and optional modifier. This function is a hook * for derived classes to change the value returned. @see put() for * more details. * * @param __s The stream to write to. * @param __io Source of locale. * @param __fill char_type to use for padding. * @param __tm Struct tm with date and time info to format. * @param __format Format char. * @param __mod Optional modifier char. * @return Iterator after writing. */ virtual iter_type do_put(iter_type __s, ios_base& __io, char_type __fill, const tm* __tm, char __format, char __mod) const; }; template locale::id time_put<_CharT, _OutIter>::id; /// class time_put_byname [22.2.5.4]. template class time_put_byname : public time_put<_CharT, _OutIter> { public: // Types: typedef _CharT char_type; typedef _OutIter iter_type; explicit time_put_byname(const char*, size_t __refs = 0) : time_put<_CharT, _OutIter>(__refs) { }; #if __cplusplus >= 201103L explicit time_put_byname(const string& __s, size_t __refs = 0) : time_put_byname(__s.c_str(), __refs) { } #endif # 908 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets_nonio.h" 3 protected: virtual ~time_put_byname() { } }; /** * @brief Money format ordering data. * @ingroup locales * * This class contains an ordered array of 4 fields to represent the * pattern for formatting a money amount. Each field may contain one entry * from the part enum. symbol, sign, and value must be present and the * remaining field must contain either none or space. @see * moneypunct::pos_format() and moneypunct::neg_format() for details of how * these fields are interpreted. */ class money_base { public: enum part { none, space, symbol, sign, value }; struct pattern { char field[4]; }; static const pattern _S_default_pattern; enum { _S_minus, _S_zero, _S_end = 11 }; // String literal of acceptable (narrow) input/output, for // money_get/money_put. "-0123456789" static const char* _S_atoms; // Construct and return valid pattern consisting of some combination of: // space none symbol sign value _GLIBCXX_CONST static pattern _S_construct_pattern(char __precedes, char __space, char __posn) throw (); }; template struct __moneypunct_cache : public locale::facet { const char* _M_grouping; size_t _M_grouping_size; bool _M_use_grouping; _CharT _M_decimal_point; _CharT _M_thousands_sep; const _CharT* _M_curr_symbol; size_t _M_curr_symbol_size; const _CharT* _M_positive_sign; size_t _M_positive_sign_size; const _CharT* _M_negative_sign; size_t _M_negative_sign_size; int _M_frac_digits; money_base::pattern _M_pos_format; money_base::pattern _M_neg_format; // A list of valid numeric literals for input and output: in the standard // "C" locale, this is "-0123456789". This array contains the chars after // having been passed through the current locale's ctype<_CharT>.widen(). _CharT _M_atoms[money_base::_S_end]; bool _M_allocated; __moneypunct_cache(size_t __refs = 0) : facet(__refs), _M_grouping(0), _M_grouping_size(0), _M_use_grouping(false), _M_decimal_point(_CharT()), _M_thousands_sep(_CharT()), _M_curr_symbol(0), _M_curr_symbol_size(0), _M_positive_sign(0), _M_positive_sign_size(0), _M_negative_sign(0), _M_negative_sign_size(0), _M_frac_digits(0), _M_pos_format(money_base::pattern()), _M_neg_format(money_base::pattern()), _M_allocated(false) { } ~__moneypunct_cache(); void _M_cache(const locale& __loc); private: __moneypunct_cache& operator=(const __moneypunct_cache&); explicit __moneypunct_cache(const __moneypunct_cache&); }; template __moneypunct_cache<_CharT, _Intl>::~__moneypunct_cache() { if (_M_allocated) { delete [] _M_grouping; delete [] _M_curr_symbol; delete [] _M_positive_sign; delete [] _M_negative_sign; } } _GLIBCXX_BEGIN_NAMESPACE_CXX11 /** * @brief Primary class template moneypunct. * @ingroup locales * * This facet encapsulates the punctuation, grouping and other formatting * features of money amount string representations. */ template class moneypunct : public locale::facet, public money_base { public: // Types: //@{ /// Public typedefs typedef _CharT char_type; typedef basic_string<_CharT> string_type; //@} typedef __moneypunct_cache<_CharT, _Intl> __cache_type; private: __cache_type* _M_data; public: /// This value is provided by the standard, but no reason for its /// existence. static const bool intl = _Intl; /// Numpunct facet id. static locale::id id; /** * @brief Constructor performs initialization. * * This is the constructor provided by the standard. * * @param __refs Passed to the base facet class. */ explicit moneypunct(size_t __refs = 0) : facet(__refs), _M_data(0) { _M_initialize_moneypunct(); } /** * @brief Constructor performs initialization. * * This is an internal constructor. * * @param __cache Cache for optimization. * @param __refs Passed to the base facet class. */ explicit moneypunct(__cache_type* __cache, size_t __refs = 0) : facet(__refs), _M_data(__cache) { _M_initialize_moneypunct(); } /** * @brief Internal constructor. Not for general use. * * This is a constructor for use by the library itself to set up new * locales. * * @param __cloc The C locale. * @param __s The name of a locale. * @param __refs Passed to the base facet class. */ explicit moneypunct(__c_locale __cloc, const char* __s, size_t __refs = 0) : facet(__refs), _M_data(0) { _M_initialize_moneypunct(__cloc, __s); } /** * @brief Return decimal point character. * * This function returns a char_type to use as a decimal point. It * does so by returning returning * moneypunct::do_decimal_point(). * * @return @a char_type representing a decimal point. */ char_type decimal_point() const { return this->do_decimal_point(); } /** * @brief Return thousands separator character. * * This function returns a char_type to use as a thousands * separator. It does so by returning returning * moneypunct::do_thousands_sep(). * * @return char_type representing a thousands separator. */ char_type thousands_sep() const { return this->do_thousands_sep(); } /** * @brief Return grouping specification. * * This function returns a string representing groupings for the * integer part of an amount. Groupings indicate where thousands * separators should be inserted. * * Each char in the return string is interpret as an integer rather * than a character. These numbers represent the number of digits in a * group. The first char in the string represents the number of digits * in the least significant group. If a char is negative, it indicates * an unlimited number of digits for the group. If more chars from the * string are required to group a number, the last char is used * repeatedly. * * For example, if the grouping() returns \003\002 * and is applied to the number 123456789, this corresponds to * 12,34,56,789. Note that if the string was 32, this would * put more than 50 digits into the least significant group if * the character set is ASCII. * * The string is returned by calling * moneypunct::do_grouping(). * * @return string representing grouping specification. */ string grouping() const { return this->do_grouping(); } /** * @brief Return currency symbol string. * * This function returns a string_type to use as a currency symbol. It * does so by returning returning * moneypunct::do_curr_symbol(). * * @return @a string_type representing a currency symbol. */ string_type curr_symbol() const { return this->do_curr_symbol(); } /** * @brief Return positive sign string. * * This function returns a string_type to use as a sign for positive * amounts. It does so by returning returning * moneypunct::do_positive_sign(). * * If the return value contains more than one character, the first * character appears in the position indicated by pos_format() and the * remainder appear at the end of the formatted string. * * @return @a string_type representing a positive sign. */ string_type positive_sign() const { return this->do_positive_sign(); } /** * @brief Return negative sign string. * * This function returns a string_type to use as a sign for negative * amounts. It does so by returning returning * moneypunct::do_negative_sign(). * * If the return value contains more than one character, the first * character appears in the position indicated by neg_format() and the * remainder appear at the end of the formatted string. * * @return @a string_type representing a negative sign. */ string_type negative_sign() const { return this->do_negative_sign(); } /** * @brief Return number of digits in fraction. * * This function returns the exact number of digits that make up the * fractional part of a money amount. It does so by returning * returning moneypunct::do_frac_digits(). * * The fractional part of a money amount is optional. But if it is * present, there must be frac_digits() digits. * * @return Number of digits in amount fraction. */ int frac_digits() const { return this->do_frac_digits(); } //@{ /** * @brief Return pattern for money values. * * This function returns a pattern describing the formatting of a * positive or negative valued money amount. It does so by returning * returning moneypunct::do_pos_format() or * moneypunct::do_neg_format(). * * The pattern has 4 fields describing the ordering of symbol, sign, * value, and none or space. There must be one of each in the pattern. * The none and space enums may not appear in the first field and space * may not appear in the final field. * * The parts of a money string must appear in the order indicated by * the fields of the pattern. The symbol field indicates that the * value of curr_symbol() may be present. The sign field indicates * that the value of positive_sign() or negative_sign() must be * present. The value field indicates that the absolute value of the * money amount is present. none indicates 0 or more whitespace * characters, except at the end, where it permits no whitespace. * space indicates that 1 or more whitespace characters must be * present. * * For example, for the US locale and pos_format() pattern * {symbol,sign,value,none}, curr_symbol() == '$' * positive_sign() == '+', and value 10.01, and * options set to force the symbol, the corresponding string is * $+10.01. * * @return Pattern for money values. */ pattern pos_format() const { return this->do_pos_format(); } pattern neg_format() const { return this->do_neg_format(); } //@} protected: /// Destructor. virtual ~moneypunct(); /** * @brief Return decimal point character. * * Returns a char_type to use as a decimal point. This function is a * hook for derived classes to change the value returned. * * @return @a char_type representing a decimal point. */ virtual char_type do_decimal_point() const { return _M_data->_M_decimal_point; } /** * @brief Return thousands separator character. * * Returns a char_type to use as a thousands separator. This function * is a hook for derived classes to change the value returned. * * @return @a char_type representing a thousands separator. */ virtual char_type do_thousands_sep() const { return _M_data->_M_thousands_sep; } /** * @brief Return grouping specification. * * Returns a string representing groupings for the integer part of a * number. This function is a hook for derived classes to change the * value returned. @see grouping() for details. * * @return String representing grouping specification. */ virtual string do_grouping() const { return _M_data->_M_grouping; } /** * @brief Return currency symbol string. * * This function returns a string_type to use as a currency symbol. * This function is a hook for derived classes to change the value * returned. @see curr_symbol() for details. * * @return @a string_type representing a currency symbol. */ virtual string_type do_curr_symbol() const { return _M_data->_M_curr_symbol; } /** * @brief Return positive sign string. * * This function returns a string_type to use as a sign for positive * amounts. This function is a hook for derived classes to change the * value returned. @see positive_sign() for details. * * @return @a string_type representing a positive sign. */ virtual string_type do_positive_sign() const { return _M_data->_M_positive_sign; } /** * @brief Return negative sign string. * * This function returns a string_type to use as a sign for negative * amounts. This function is a hook for derived classes to change the * value returned. @see negative_sign() for details. * * @return @a string_type representing a negative sign. */ virtual string_type do_negative_sign() const { return _M_data->_M_negative_sign; } /** * @brief Return number of digits in fraction. * * This function returns the exact number of digits that make up the * fractional part of a money amount. This function is a hook for * derived classes to change the value returned. @see frac_digits() * for details. * * @return Number of digits in amount fraction. */ virtual int do_frac_digits() const { return _M_data->_M_frac_digits; } /** * @brief Return pattern for money values. * * This function returns a pattern describing the formatting of a * positive valued money amount. This function is a hook for derived * classes to change the value returned. @see pos_format() for * details. * * @return Pattern for money values. */ virtual pattern do_pos_format() const { return _M_data->_M_pos_format; } /** * @brief Return pattern for money values. * * This function returns a pattern describing the formatting of a * negative valued money amount. This function is a hook for derived * classes to change the value returned. @see neg_format() for * details. * * @return Pattern for money values. */ virtual pattern do_neg_format() const { return _M_data->_M_neg_format; } // For use at construction time only. void _M_initialize_moneypunct(__c_locale __cloc = 0, const char* __name = 0); }; template locale::id moneypunct<_CharT, _Intl>::id; template const bool moneypunct<_CharT, _Intl>::intl; template<> moneypunct::~moneypunct(); template<> moneypunct::~moneypunct(); template<> void moneypunct::_M_initialize_moneypunct(__c_locale, const char*); template<> void moneypunct::_M_initialize_moneypunct(__c_locale, const char*); #ifdef _GLIBCXX_USE_WCHAR_T template<> moneypunct::~moneypunct(); template<> moneypunct::~moneypunct(); template<> void moneypunct::_M_initialize_moneypunct(__c_locale, const char*); template<> void moneypunct::_M_initialize_moneypunct(__c_locale, const char*); #endif # 1409 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets_nonio.h" 3 /// class moneypunct_byname [22.2.6.4]. template class moneypunct_byname : public moneypunct<_CharT, _Intl> { public: typedef _CharT char_type; typedef basic_string<_CharT> string_type; static const bool intl = _Intl; explicit moneypunct_byname(const char* __s, size_t __refs = 0) : moneypunct<_CharT, _Intl>(__refs) { if (__builtin_strcmp(__s, "C") != 0 && __builtin_strcmp(__s, "POSIX") != 0) { __c_locale __tmp; this->_S_create_c_locale(__tmp, __s); this->_M_initialize_moneypunct(__tmp); this->_S_destroy_c_locale(__tmp); } } #if __cplusplus >= 201103L explicit moneypunct_byname(const string& __s, size_t __refs = 0) : moneypunct_byname(__s.c_str(), __refs) { } #endif # 1439 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets_nonio.h" 3 protected: virtual ~moneypunct_byname() { } }; template const bool moneypunct_byname<_CharT, _Intl>::intl; _GLIBCXX_END_NAMESPACE_CXX11 _GLIBCXX_BEGIN_NAMESPACE_LDBL_OR_CXX11 /** * @brief Primary class template money_get. * @ingroup locales * * This facet encapsulates the code to parse and return a monetary * amount from a string. * * The money_get template uses protected virtual functions to * provide the actual results. The public accessors forward the * call to the virtual functions. These virtual functions are * hooks for developers to implement the behavior they require from * the money_get facet. */ template class money_get : public locale::facet { public: // Types: //@{ /// Public typedefs typedef _CharT char_type; typedef _InIter iter_type; typedef basic_string<_CharT> string_type; //@} /// Numpunct facet id. static locale::id id; /** * @brief Constructor performs initialization. * * This is the constructor provided by the standard. * * @param __refs Passed to the base facet class. */ explicit money_get(size_t __refs = 0) : facet(__refs) { } /** * @brief Read and parse a monetary value. * * This function reads characters from @a __s, interprets them as a * monetary value according to moneypunct and ctype facets retrieved * from io.getloc(), and returns the result in @a units as an integral * value moneypunct::frac_digits() * the actual amount. For example, * the string $10.01 in a US locale would store 1001 in @a units. * * Any characters not part of a valid money amount are not consumed. * * If a money value cannot be parsed from the input stream, sets * err=(err|io.failbit). If the stream is consumed before finishing * parsing, sets err=(err|io.failbit|io.eofbit). @a units is * unchanged if parsing fails. * * This function works by returning the result of do_get(). * * @param __s Start of characters to parse. * @param __end End of characters to parse. * @param __intl Parameter to use_facet >. * @param __io Source of facets and io state. * @param __err Error field to set if parsing fails. * @param __units Place to store result of parsing. * @return Iterator referencing first character beyond valid money * amount. */ iter_type get(iter_type __s, iter_type __end, bool __intl, ios_base& __io, ios_base::iostate& __err, long double& __units) const { return this->do_get(__s, __end, __intl, __io, __err, __units); } /** * @brief Read and parse a monetary value. * * This function reads characters from @a __s, interprets them as * a monetary value according to moneypunct and ctype facets * retrieved from io.getloc(), and returns the result in @a * digits. For example, the string $10.01 in a US locale would * store 1001 in @a digits. * * Any characters not part of a valid money amount are not consumed. * * If a money value cannot be parsed from the input stream, sets * err=(err|io.failbit). If the stream is consumed before finishing * parsing, sets err=(err|io.failbit|io.eofbit). * * This function works by returning the result of do_get(). * * @param __s Start of characters to parse. * @param __end End of characters to parse. * @param __intl Parameter to use_facet >. * @param __io Source of facets and io state. * @param __err Error field to set if parsing fails. * @param __digits Place to store result of parsing. * @return Iterator referencing first character beyond valid money * amount. */ iter_type get(iter_type __s, iter_type __end, bool __intl, ios_base& __io, ios_base::iostate& __err, string_type& __digits) const { return this->do_get(__s, __end, __intl, __io, __err, __digits); } protected: /// Destructor. virtual ~money_get() { } /** * @brief Read and parse a monetary value. * * This function reads and parses characters representing a monetary * value. This function is a hook for derived classes to change the * value returned. @see get() for details. */ // XXX GLIBCXX_ABI Deprecated #if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__ \ && _GLIBCXX_USE_CXX11_ABI == 0 virtual iter_type __do_get(iter_type __s, iter_type __end, bool __intl, ios_base& __io, ios_base::iostate& __err, double& __units) const; #else # 1572 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets_nonio.h" 3 virtual iter_type do_get(iter_type __s, iter_type __end, bool __intl, ios_base& __io, ios_base::iostate& __err, long double& __units) const; #endif # 1576 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets_nonio.h" 3 /** * @brief Read and parse a monetary value. * * This function reads and parses characters representing a monetary * value. This function is a hook for derived classes to change the * value returned. @see get() for details. */ virtual iter_type do_get(iter_type __s, iter_type __end, bool __intl, ios_base& __io, ios_base::iostate& __err, string_type& __digits) const; // XXX GLIBCXX_ABI Deprecated #if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__ \ && _GLIBCXX_USE_CXX11_ABI == 0 virtual iter_type do_get(iter_type __s, iter_type __end, bool __intl, ios_base& __io, ios_base::iostate& __err, long double& __units) const; #endif # 1595 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets_nonio.h" 3 template iter_type _M_extract(iter_type __s, iter_type __end, ios_base& __io, ios_base::iostate& __err, string& __digits) const; }; template locale::id money_get<_CharT, _InIter>::id; /** * @brief Primary class template money_put. * @ingroup locales * * This facet encapsulates the code to format and output a monetary * amount. * * The money_put template uses protected virtual functions to * provide the actual results. The public accessors forward the * call to the virtual functions. These virtual functions are * hooks for developers to implement the behavior they require from * the money_put facet. */ template class money_put : public locale::facet { public: //@{ /// Public typedefs typedef _CharT char_type; typedef _OutIter iter_type; typedef basic_string<_CharT> string_type; //@} /// Numpunct facet id. static locale::id id; /** * @brief Constructor performs initialization. * * This is the constructor provided by the standard. * * @param __refs Passed to the base facet class. */ explicit money_put(size_t __refs = 0) : facet(__refs) { } /** * @brief Format and output a monetary value. * * This function formats @a units as a monetary value according to * moneypunct and ctype facets retrieved from io.getloc(), and writes * the resulting characters to @a __s. For example, the value 1001 in a * US locale would write $10.01 to @a __s. * * This function works by returning the result of do_put(). * * @param __s The stream to write to. * @param __intl Parameter to use_facet >. * @param __io Source of facets and io state. * @param __fill char_type to use for padding. * @param __units Place to store result of parsing. * @return Iterator after writing. */ iter_type put(iter_type __s, bool __intl, ios_base& __io, char_type __fill, long double __units) const { return this->do_put(__s, __intl, __io, __fill, __units); } /** * @brief Format and output a monetary value. * * This function formats @a digits as a monetary value * according to moneypunct and ctype facets retrieved from * io.getloc(), and writes the resulting characters to @a __s. * For example, the string 1001 in a US locale * would write $10.01 to @a __s. * * This function works by returning the result of do_put(). * * @param __s The stream to write to. * @param __intl Parameter to use_facet >. * @param __io Source of facets and io state. * @param __fill char_type to use for padding. * @param __digits Place to store result of parsing. * @return Iterator after writing. */ iter_type put(iter_type __s, bool __intl, ios_base& __io, char_type __fill, const string_type& __digits) const { return this->do_put(__s, __intl, __io, __fill, __digits); } protected: /// Destructor. virtual ~money_put() { } /** * @brief Format and output a monetary value. * * This function formats @a units as a monetary value according to * moneypunct and ctype facets retrieved from io.getloc(), and writes * the resulting characters to @a __s. For example, the value 1001 in a * US locale would write $10.01 to @a __s. * * This function is a hook for derived classes to change the value * returned. @see put(). * * @param __s The stream to write to. * @param __intl Parameter to use_facet >. * @param __io Source of facets and io state. * @param __fill char_type to use for padding. * @param __units Place to store result of parsing. * @return Iterator after writing. */ // XXX GLIBCXX_ABI Deprecated #if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__ \ && _GLIBCXX_USE_CXX11_ABI == 0 virtual iter_type __do_put(iter_type __s, bool __intl, ios_base& __io, char_type __fill, double __units) const; #else # 1717 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets_nonio.h" 3 virtual iter_type do_put(iter_type __s, bool __intl, ios_base& __io, char_type __fill, long double __units) const; #endif # 1721 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets_nonio.h" 3 /** * @brief Format and output a monetary value. * * This function formats @a digits as a monetary value * according to moneypunct and ctype facets retrieved from * io.getloc(), and writes the resulting characters to @a __s. * For example, the string 1001 in a US locale * would write $10.01 to @a __s. * * This function is a hook for derived classes to change the value * returned. @see put(). * * @param __s The stream to write to. * @param __intl Parameter to use_facet >. * @param __io Source of facets and io state. * @param __fill char_type to use for padding. * @param __digits Place to store result of parsing. * @return Iterator after writing. */ virtual iter_type do_put(iter_type __s, bool __intl, ios_base& __io, char_type __fill, const string_type& __digits) const; // XXX GLIBCXX_ABI Deprecated #if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__ \ && _GLIBCXX_USE_CXX11_ABI == 0 virtual iter_type do_put(iter_type __s, bool __intl, ios_base& __io, char_type __fill, long double __units) const; #endif # 1752 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets_nonio.h" 3 template iter_type _M_insert(iter_type __s, ios_base& __io, char_type __fill, const string_type& __digits) const; }; template locale::id money_put<_CharT, _OutIter>::id; _GLIBCXX_END_NAMESPACE_LDBL_OR_CXX11 /** * @brief Messages facet base class providing catalog typedef. * @ingroup locales */ struct messages_base { typedef int catalog; }; _GLIBCXX_BEGIN_NAMESPACE_CXX11 /** * @brief Primary class template messages. * @ingroup locales * * This facet encapsulates the code to retrieve messages from * message catalogs. The only thing defined by the standard for this facet * is the interface. All underlying functionality is * implementation-defined. * * This library currently implements 3 versions of the message facet. The * first version (gnu) is a wrapper around gettext, provided by libintl. * The second version (ieee) is a wrapper around catgets. The final * version (default) does no actual translation. These implementations are * only provided for char and wchar_t instantiations. * * The messages template uses protected virtual functions to * provide the actual results. The public accessors forward the * call to the virtual functions. These virtual functions are * hooks for developers to implement the behavior they require from * the messages facet. */ template class messages : public locale::facet, public messages_base { public: // Types: //@{ /// Public typedefs typedef _CharT char_type; typedef basic_string<_CharT> string_type; //@} protected: // Underlying "C" library locale information saved from // initialization, needed by messages_byname as well. __c_locale _M_c_locale_messages; const char* _M_name_messages; public: /// Numpunct facet id. static locale::id id; /** * @brief Constructor performs initialization. * * This is the constructor provided by the standard. * * @param __refs Passed to the base facet class. */ explicit messages(size_t __refs = 0); // Non-standard. /** * @brief Internal constructor. Not for general use. * * This is a constructor for use by the library itself to set up new * locales. * * @param __cloc The C locale. * @param __s The name of a locale. * @param __refs Refcount to pass to the base class. */ explicit messages(__c_locale __cloc, const char* __s, size_t __refs = 0); /* * @brief Open a message catalog. * * This function opens and returns a handle to a message catalog by * returning do_open(__s, __loc). * * @param __s The catalog to open. * @param __loc Locale to use for character set conversions. * @return Handle to the catalog or value < 0 if open fails. */ catalog open(const basic_string& __s, const locale& __loc) const { return this->do_open(__s, __loc); } // Non-standard and unorthodox, yet effective. /* * @brief Open a message catalog. * * This non-standard function opens and returns a handle to a message * catalog by returning do_open(s, loc). The third argument provides a * message catalog root directory for gnu gettext and is ignored * otherwise. * * @param __s The catalog to open. * @param __loc Locale to use for character set conversions. * @param __dir Message catalog root directory. * @return Handle to the catalog or value < 0 if open fails. */ catalog open(const basic_string&, const locale&, const char*) const; /* * @brief Look up a string in a message catalog. * * This function retrieves and returns a message from a catalog by * returning do_get(c, set, msgid, s). * * For gnu, @a __set and @a msgid are ignored. Returns gettext(s). * For default, returns s. For ieee, returns catgets(c,set,msgid,s). * * @param __c The catalog to access. * @param __set Implementation-defined. * @param __msgid Implementation-defined. * @param __s Default return value if retrieval fails. * @return Retrieved message or @a __s if get fails. */ string_type get(catalog __c, int __set, int __msgid, const string_type& __s) const { return this->do_get(__c, __set, __msgid, __s); } /* * @brief Close a message catalog. * * Closes catalog @a c by calling do_close(c). * * @param __c The catalog to close. */ void close(catalog __c) const { return this->do_close(__c); } protected: /// Destructor. virtual ~messages(); /* * @brief Open a message catalog. * * This function opens and returns a handle to a message catalog in an * implementation-defined manner. This function is a hook for derived * classes to change the value returned. * * @param __s The catalog to open. * @param __loc Locale to use for character set conversions. * @return Handle to the opened catalog, value < 0 if open failed. */ virtual catalog do_open(const basic_string&, const locale&) const; /* * @brief Look up a string in a message catalog. * * This function retrieves and returns a message from a catalog in an * implementation-defined manner. This function is a hook for derived * classes to change the value returned. * * For gnu, @a __set and @a __msgid are ignored. Returns gettext(s). * For default, returns s. For ieee, returns catgets(c,set,msgid,s). * * @param __c The catalog to access. * @param __set Implementation-defined. * @param __msgid Implementation-defined. * @param __s Default return value if retrieval fails. * @return Retrieved message or @a __s if get fails. */ virtual string_type do_get(catalog, int, int, const string_type& __dfault) const; /* * @brief Close a message catalog. * * @param __c The catalog to close. */ virtual void do_close(catalog) const; // Returns a locale and codeset-converted string, given a char* message. char* _M_convert_to_char(const string_type& __msg) const { // XXX return reinterpret_cast(const_cast<_CharT*>(__msg.c_str())); } // Returns a locale and codeset-converted string, given a char* message. string_type _M_convert_from_char(char*) const { // XXX return string_type(); } }; template locale::id messages<_CharT>::id; /// Specializations for required instantiations. template<> string messages::do_get(catalog, int, int, const string&) const; #ifdef _GLIBCXX_USE_WCHAR_T template<> wstring messages::do_get(catalog, int, int, const wstring&) const; #endif # 1978 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets_nonio.h" 3 /// class messages_byname [22.2.7.2]. template class messages_byname : public messages<_CharT> { public: typedef _CharT char_type; typedef basic_string<_CharT> string_type; explicit messages_byname(const char* __s, size_t __refs = 0); #if __cplusplus >= 201103L explicit messages_byname(const string& __s, size_t __refs = 0) : messages_byname(__s.c_str(), __refs) { } #endif # 1995 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets_nonio.h" 3 protected: virtual ~messages_byname() { } }; _GLIBCXX_END_NAMESPACE_CXX11 _GLIBCXX_END_NAMESPACE_VERSION } // namespace // Include host and configuration specific messages functions. #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 2008 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets_nonio.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/messages_members.h" 1 3 // std::messages implementation details, GNU version -*- C++ -*- // Copyright (C) 2001-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file bits/messages_members.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{locale} */ // // ISO C++ 14882: 22.2.7.1.2 messages functions // // Written by Benjamin Kosnik #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 36 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/messages_members.h" 3 # 1 "/usr/include/libintl.h" 1 3 4 /* Message catalogs for internationalization. Copyright (C) 1995-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. This file is derived from the file libgettext.h in the GNU gettext package. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _LIBINTL_H #define _LIBINTL_H 1 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 23 "/usr/include/libintl.h" 3 4 # 24 "/usr/include/libintl.h" 3 4 /* We define an additional symbol to signal that we use the GNU implementation of gettext. */ #define __USE_GNU_GETTEXT 1 /* Provide information about the supported file formats. Returns the maximum minor revision number supported for a given major revision. */ #define __GNU_GETTEXT_SUPPORTED_REVISION(major) \ ((major) == 0 ? 1 : -1) __BEGIN_DECLS /* Look up MSGID in the current default message catalog for the current LC_MESSAGES locale. If not found, returns MSGID itself (the default text). */ extern char *gettext (const char *__msgid) __THROW __attribute_format_arg__ (1); /* Look up MSGID in the DOMAINNAME message catalog for the current LC_MESSAGES locale. */ extern char *dgettext (const char *__domainname, const char *__msgid) __THROW __attribute_format_arg__ (2); extern char *__dgettext (const char *__domainname, const char *__msgid) __THROW __attribute_format_arg__ (2); /* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY locale. */ extern char *dcgettext (const char *__domainname, const char *__msgid, int __category) __THROW __attribute_format_arg__ (2); extern char *__dcgettext (const char *__domainname, const char *__msgid, int __category) __THROW __attribute_format_arg__ (2); /* Similar to `gettext' but select the plural form corresponding to the number N. */ extern char *ngettext (const char *__msgid1, const char *__msgid2, unsigned long int __n) __THROW __attribute_format_arg__ (1) __attribute_format_arg__ (2); /* Similar to `dgettext' but select the plural form corresponding to the number N. */ extern char *dngettext (const char *__domainname, const char *__msgid1, const char *__msgid2, unsigned long int __n) __THROW __attribute_format_arg__ (2) __attribute_format_arg__ (3); /* Similar to `dcgettext' but select the plural form corresponding to the number N. */ extern char *dcngettext (const char *__domainname, const char *__msgid1, const char *__msgid2, unsigned long int __n, int __category) __THROW __attribute_format_arg__ (2) __attribute_format_arg__ (3); /* Set the current default message catalog to DOMAINNAME. If DOMAINNAME is null, return the current default. If DOMAINNAME is "", reset to the default of "messages". */ extern char *textdomain (const char *__domainname) __THROW; /* Specify that the DOMAINNAME message catalog will be found in DIRNAME rather than in the system locale data base. */ extern char *bindtextdomain (const char *__domainname, const char *__dirname) __THROW; /* Specify the character encoding in which the messages from the DOMAINNAME message catalog will be returned. */ extern char *bind_textdomain_codeset (const char *__domainname, const char *__codeset) __THROW; /* Optimized version of the function above. */ #if defined __OPTIMIZE__ && !defined __cplusplus /* We need NULL for `gettext'. */ # define __need_NULL #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 100 "/usr/include/libintl.h" 3 4 # 101 "/usr/include/libintl.h" 3 4 /* We need LC_MESSAGES for `dgettext'. */ #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 103 "/usr/include/libintl.h" 3 4 # 104 "/usr/include/libintl.h" 3 4 /* These must be macros. Inlined functions are useless because the `__builtin_constant_p' predicate in dcgettext would always return false. */ # define gettext(msgid) dgettext (NULL, msgid) # define dgettext(domainname, msgid) \ dcgettext (domainname, msgid, LC_MESSAGES) # define ngettext(msgid1, msgid2, n) dngettext (NULL, msgid1, msgid2, n) # define dngettext(domainname, msgid1, msgid2, n) \ dcngettext (domainname, msgid1, msgid2, n, LC_MESSAGES) #endif /* Optimizing. */ # 120 "/usr/include/libintl.h" 3 4 __END_DECLS #endif /* libintl.h */ # 124 "/usr/include/libintl.h" 3 4 # 37 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/messages_members.h" 2 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION // Non-virtual member functions. template messages<_CharT>::messages(size_t __refs) : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), _M_name_messages(_S_get_c_name()) { } template messages<_CharT>::messages(__c_locale __cloc, const char* __s, size_t __refs) : facet(__refs), _M_c_locale_messages(0), _M_name_messages(0) { if (__builtin_strcmp(__s, _S_get_c_name()) != 0) { const size_t __len = __builtin_strlen(__s) + 1; char* __tmp = new char[__len]; __builtin_memcpy(__tmp, __s, __len); _M_name_messages = __tmp; } else _M_name_messages = _S_get_c_name(); // Last to avoid leaking memory if new throws. _M_c_locale_messages = _S_clone_c_locale(__cloc); } template typename messages<_CharT>::catalog messages<_CharT>::open(const basic_string& __s, const locale& __loc, const char* __dir) const { bindtextdomain(__s.c_str(), __dir); return this->do_open(__s, __loc); } // Virtual member functions. template messages<_CharT>::~messages() { if (_M_name_messages != _S_get_c_name()) delete [] _M_name_messages; _S_destroy_c_locale(_M_c_locale_messages); } template typename messages<_CharT>::catalog messages<_CharT>::do_open(const basic_string& __s, const locale&) const { // No error checking is done, assume the catalog exists and can // be used. textdomain(__s.c_str()); return 0; } template void messages<_CharT>::do_close(catalog) const { } // messages_byname template messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs) : messages<_CharT>(__refs) { if (this->_M_name_messages != locale::facet::_S_get_c_name()) { delete [] this->_M_name_messages; if (__builtin_strcmp(__s, locale::facet::_S_get_c_name()) != 0) { const size_t __len = __builtin_strlen(__s) + 1; char* __tmp = new char[__len]; __builtin_memcpy(__tmp, __s, __len); this->_M_name_messages = __tmp; } else this->_M_name_messages = locale::facet::_S_get_c_name(); } if (__builtin_strcmp(__s, "C") != 0 && __builtin_strcmp(__s, "POSIX") != 0) { this->_S_destroy_c_locale(this->_M_c_locale_messages); this->_S_create_c_locale(this->_M_c_locale_messages, __s); } } //Specializations. template<> typename messages::catalog messages::do_open(const basic_string&, const locale&) const; template<> void messages::do_close(catalog) const; #ifdef _GLIBCXX_USE_WCHAR_T template<> typename messages::catalog messages::do_open(const basic_string&, const locale&) const; template<> void messages::do_close(catalog) const; #endif # 149 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/x86_64-linux-gnu/c++/5.4.1/bits/messages_members.h" 3 _GLIBCXX_END_NAMESPACE_VERSION } // namespace # 2009 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets_nonio.h" 2 3 // 22.2.1.5 Template class codecvt #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 2011 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets_nonio.h" 3 # 2012 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets_nonio.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 2013 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets_nonio.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets_nonio.tcc" 1 3 // Locale support -*- C++ -*- // Copyright (C) 2007-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file bits/locale_facets_nonio.tcc * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{locale} */ #ifndef _LOCALE_FACETS_NONIO_TCC #define _LOCALE_FACETS_NONIO_TCC 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 34 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets_nonio.tcc" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION template struct __use_cache<__moneypunct_cache<_CharT, _Intl> > { const __moneypunct_cache<_CharT, _Intl>* operator() (const locale& __loc) const { const size_t __i = moneypunct<_CharT, _Intl>::id._M_id(); const locale::facet** __caches = __loc._M_impl->_M_caches; if (!__caches[__i]) { __moneypunct_cache<_CharT, _Intl>* __tmp = 0; __try { __tmp = new __moneypunct_cache<_CharT, _Intl>; __tmp->_M_cache(__loc); } __catch(...) { delete __tmp; __throw_exception_again; } __loc._M_impl->_M_install_cache(__tmp, __i); } return static_cast< const __moneypunct_cache<_CharT, _Intl>*>(__caches[__i]); } }; template void __moneypunct_cache<_CharT, _Intl>::_M_cache(const locale& __loc) { const moneypunct<_CharT, _Intl>& __mp = use_facet >(__loc); _M_decimal_point = __mp.decimal_point(); _M_thousands_sep = __mp.thousands_sep(); _M_frac_digits = __mp.frac_digits(); char* __grouping = 0; _CharT* __curr_symbol = 0; _CharT* __positive_sign = 0; _CharT* __negative_sign = 0; __try { const string& __g = __mp.grouping(); _M_grouping_size = __g.size(); __grouping = new char[_M_grouping_size]; __g.copy(__grouping, _M_grouping_size); _M_use_grouping = (_M_grouping_size && static_cast(__grouping[0]) > 0 && (__grouping[0] != __gnu_cxx::__numeric_traits::__max)); const basic_string<_CharT>& __cs = __mp.curr_symbol(); _M_curr_symbol_size = __cs.size(); __curr_symbol = new _CharT[_M_curr_symbol_size]; __cs.copy(__curr_symbol, _M_curr_symbol_size); const basic_string<_CharT>& __ps = __mp.positive_sign(); _M_positive_sign_size = __ps.size(); __positive_sign = new _CharT[_M_positive_sign_size]; __ps.copy(__positive_sign, _M_positive_sign_size); const basic_string<_CharT>& __ns = __mp.negative_sign(); _M_negative_sign_size = __ns.size(); __negative_sign = new _CharT[_M_negative_sign_size]; __ns.copy(__negative_sign, _M_negative_sign_size); _M_pos_format = __mp.pos_format(); _M_neg_format = __mp.neg_format(); const ctype<_CharT>& __ct = use_facet >(__loc); __ct.widen(money_base::_S_atoms, money_base::_S_atoms + money_base::_S_end, _M_atoms); _M_grouping = __grouping; _M_curr_symbol = __curr_symbol; _M_positive_sign = __positive_sign; _M_negative_sign = __negative_sign; _M_allocated = true; } __catch(...) { delete [] __grouping; delete [] __curr_symbol; delete [] __positive_sign; delete [] __negative_sign; __throw_exception_again; } } _GLIBCXX_BEGIN_NAMESPACE_LDBL_OR_CXX11 template template _InIter money_get<_CharT, _InIter>:: _M_extract(iter_type __beg, iter_type __end, ios_base& __io, ios_base::iostate& __err, string& __units) const { typedef char_traits<_CharT> __traits_type; typedef typename string_type::size_type size_type; typedef money_base::part part; typedef __moneypunct_cache<_CharT, _Intl> __cache_type; const locale& __loc = __io._M_getloc(); const ctype<_CharT>& __ctype = use_facet >(__loc); __use_cache<__cache_type> __uc; const __cache_type* __lc = __uc(__loc); const char_type* __lit = __lc->_M_atoms; // Deduced sign. bool __negative = false; // Sign size. size_type __sign_size = 0; // True if sign is mandatory. const bool __mandatory_sign = (__lc->_M_positive_sign_size && __lc->_M_negative_sign_size); // String of grouping info from thousands_sep plucked from __units. string __grouping_tmp; if (__lc->_M_use_grouping) __grouping_tmp.reserve(32); // Last position before the decimal point. int __last_pos = 0; // Separator positions, then, possibly, fractional digits. int __n = 0; // If input iterator is in a valid state. bool __testvalid = true; // Flag marking when a decimal point is found. bool __testdecfound = false; // The tentative returned string is stored here. string __res; __res.reserve(32); const char_type* __lit_zero = __lit + money_base::_S_zero; const money_base::pattern __p = __lc->_M_neg_format; for (int __i = 0; __i < 4 && __testvalid; ++__i) { const part __which = static_cast(__p.field[__i]); switch (__which) { case money_base::symbol: // According to 22.2.6.1.2, p2, symbol is required // if (__io.flags() & ios_base::showbase), otherwise // is optional and consumed only if other characters // are needed to complete the format. if (__io.flags() & ios_base::showbase || __sign_size > 1 || __i == 0 || (__i == 1 && (__mandatory_sign || (static_cast(__p.field[0]) == money_base::sign) || (static_cast(__p.field[2]) == money_base::space))) || (__i == 2 && ((static_cast(__p.field[3]) == money_base::value) || (__mandatory_sign && (static_cast(__p.field[3]) == money_base::sign))))) { const size_type __len = __lc->_M_curr_symbol_size; size_type __j = 0; for (; __beg != __end && __j < __len && *__beg == __lc->_M_curr_symbol[__j]; ++__beg, ++__j); if (__j != __len && (__j || __io.flags() & ios_base::showbase)) __testvalid = false; } break; case money_base::sign: // Sign might not exist, or be more than one character long. if (__lc->_M_positive_sign_size && __beg != __end && *__beg == __lc->_M_positive_sign[0]) { __sign_size = __lc->_M_positive_sign_size; ++__beg; } else if (__lc->_M_negative_sign_size && __beg != __end && *__beg == __lc->_M_negative_sign[0]) { __negative = true; __sign_size = __lc->_M_negative_sign_size; ++__beg; } else if (__lc->_M_positive_sign_size && !__lc->_M_negative_sign_size) // "... if no sign is detected, the result is given the sign // that corresponds to the source of the empty string" __negative = true; else if (__mandatory_sign) __testvalid = false; break; case money_base::value: // Extract digits, remove and stash away the // grouping of found thousands separators. for (; __beg != __end; ++__beg) { const char_type __c = *__beg; const char_type* __q = __traits_type::find(__lit_zero, 10, __c); if (__q != 0) { __res += money_base::_S_atoms[__q - __lit]; ++__n; } else if (__c == __lc->_M_decimal_point && !__testdecfound) { if (__lc->_M_frac_digits <= 0) break; __last_pos = __n; __n = 0; __testdecfound = true; } else if (__lc->_M_use_grouping && __c == __lc->_M_thousands_sep && !__testdecfound) { if (__n) { // Mark position for later analysis. __grouping_tmp += static_cast(__n); __n = 0; } else { __testvalid = false; break; } } else break; } if (__res.empty()) __testvalid = false; break; case money_base::space: // At least one space is required. if (__beg != __end && __ctype.is(ctype_base::space, *__beg)) ++__beg; else __testvalid = false; case money_base::none: // Only if not at the end of the pattern. if (__i != 3) for (; __beg != __end && __ctype.is(ctype_base::space, *__beg); ++__beg); break; } } // Need to get the rest of the sign characters, if they exist. if (__sign_size > 1 && __testvalid) { const char_type* __sign = __negative ? __lc->_M_negative_sign : __lc->_M_positive_sign; size_type __i = 1; for (; __beg != __end && __i < __sign_size && *__beg == __sign[__i]; ++__beg, ++__i); if (__i != __sign_size) __testvalid = false; } if (__testvalid) { // Strip leading zeros. if (__res.size() > 1) { const size_type __first = __res.find_first_not_of('0'); const bool __only_zeros = __first == string::npos; if (__first) __res.erase(0, __only_zeros ? __res.size() - 1 : __first); } // 22.2.6.1.2, p4 if (__negative && __res[0] != '0') __res.insert(__res.begin(), '-'); // Test for grouping fidelity. if (__grouping_tmp.size()) { // Add the ending grouping. __grouping_tmp += static_cast(__testdecfound ? __last_pos : __n); if (!std::__verify_grouping(__lc->_M_grouping, __lc->_M_grouping_size, __grouping_tmp)) __err |= ios_base::failbit; } // Iff not enough digits were supplied after the decimal-point. if (__testdecfound && __n != __lc->_M_frac_digits) __testvalid = false; } // Iff valid sequence is not recognized. if (!__testvalid) __err |= ios_base::failbit; else __units.swap(__res); // Iff no more characters are available. if (__beg == __end) __err |= ios_base::eofbit; return __beg; } #if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__ \ && _GLIBCXX_USE_CXX11_ABI == 0 template _InIter money_get<_CharT, _InIter>:: __do_get(iter_type __beg, iter_type __end, bool __intl, ios_base& __io, ios_base::iostate& __err, double& __units) const { string __str; __beg = __intl ? _M_extract(__beg, __end, __io, __err, __str) : _M_extract(__beg, __end, __io, __err, __str); std::__convert_to_v(__str.c_str(), __units, __err, _S_get_c_locale()); return __beg; } #endif # 366 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets_nonio.tcc" 3 template _InIter money_get<_CharT, _InIter>:: do_get(iter_type __beg, iter_type __end, bool __intl, ios_base& __io, ios_base::iostate& __err, long double& __units) const { string __str; __beg = __intl ? _M_extract(__beg, __end, __io, __err, __str) : _M_extract(__beg, __end, __io, __err, __str); std::__convert_to_v(__str.c_str(), __units, __err, _S_get_c_locale()); return __beg; } template _InIter money_get<_CharT, _InIter>:: do_get(iter_type __beg, iter_type __end, bool __intl, ios_base& __io, ios_base::iostate& __err, string_type& __digits) const { typedef typename string::size_type size_type; const locale& __loc = __io._M_getloc(); const ctype<_CharT>& __ctype = use_facet >(__loc); string __str; __beg = __intl ? _M_extract(__beg, __end, __io, __err, __str) : _M_extract(__beg, __end, __io, __err, __str); const size_type __len = __str.size(); if (__len) { __digits.resize(__len); __ctype.widen(__str.data(), __str.data() + __len, &__digits[0]); } return __beg; } template template _OutIter money_put<_CharT, _OutIter>:: _M_insert(iter_type __s, ios_base& __io, char_type __fill, const string_type& __digits) const { typedef typename string_type::size_type size_type; typedef money_base::part part; typedef __moneypunct_cache<_CharT, _Intl> __cache_type; const locale& __loc = __io._M_getloc(); const ctype<_CharT>& __ctype = use_facet >(__loc); __use_cache<__cache_type> __uc; const __cache_type* __lc = __uc(__loc); const char_type* __lit = __lc->_M_atoms; // Determine if negative or positive formats are to be used, and // discard leading negative_sign if it is present. const char_type* __beg = __digits.data(); money_base::pattern __p; const char_type* __sign; size_type __sign_size; if (!(*__beg == __lit[money_base::_S_minus])) { __p = __lc->_M_pos_format; __sign = __lc->_M_positive_sign; __sign_size = __lc->_M_positive_sign_size; } else { __p = __lc->_M_neg_format; __sign = __lc->_M_negative_sign; __sign_size = __lc->_M_negative_sign_size; if (__digits.size()) ++__beg; } // Look for valid numbers in the ctype facet within input digits. size_type __len = __ctype.scan_not(ctype_base::digit, __beg, __beg + __digits.size()) - __beg; if (__len) { // Assume valid input, and attempt to format. // Break down input numbers into base components, as follows: // final_value = grouped units + (decimal point) + (digits) string_type __value; __value.reserve(2 * __len); // Add thousands separators to non-decimal digits, per // grouping rules. long __paddec = __len - __lc->_M_frac_digits; if (__paddec > 0) { if (__lc->_M_frac_digits < 0) __paddec = __len; if (__lc->_M_grouping_size) { __value.assign(2 * __paddec, char_type()); _CharT* __vend = std::__add_grouping(&__value[0], __lc->_M_thousands_sep, __lc->_M_grouping, __lc->_M_grouping_size, __beg, __beg + __paddec); __value.erase(__vend - &__value[0]); } else __value.assign(__beg, __paddec); } // Deal with decimal point, decimal digits. if (__lc->_M_frac_digits > 0) { __value += __lc->_M_decimal_point; if (__paddec >= 0) __value.append(__beg + __paddec, __lc->_M_frac_digits); else { // Have to pad zeros in the decimal position. __value.append(-__paddec, __lit[money_base::_S_zero]); __value.append(__beg, __len); } } // Calculate length of resulting string. const ios_base::fmtflags __f = __io.flags() & ios_base::adjustfield; __len = __value.size() + __sign_size; __len += ((__io.flags() & ios_base::showbase) ? __lc->_M_curr_symbol_size : 0); string_type __res; __res.reserve(2 * __len); const size_type __width = static_cast(__io.width()); const bool __testipad = (__f == ios_base::internal && __len < __width); // Fit formatted digits into the required pattern. for (int __i = 0; __i < 4; ++__i) { const part __which = static_cast(__p.field[__i]); switch (__which) { case money_base::symbol: if (__io.flags() & ios_base::showbase) __res.append(__lc->_M_curr_symbol, __lc->_M_curr_symbol_size); break; case money_base::sign: // Sign might not exist, or be more than one // character long. In that case, add in the rest // below. if (__sign_size) __res += __sign[0]; break; case money_base::value: __res += __value; break; case money_base::space: // At least one space is required, but if internal // formatting is required, an arbitrary number of // fill spaces will be necessary. if (__testipad) __res.append(__width - __len, __fill); else __res += __fill; break; case money_base::none: if (__testipad) __res.append(__width - __len, __fill); break; } } // Special case of multi-part sign parts. if (__sign_size > 1) __res.append(__sign + 1, __sign_size - 1); // Pad, if still necessary. __len = __res.size(); if (__width > __len) { if (__f == ios_base::left) // After. __res.append(__width - __len, __fill); else // Before. __res.insert(0, __width - __len, __fill); __len = __width; } // Write resulting, fully-formatted string to output iterator. __s = std::__write(__s, __res.data(), __len); } __io.width(0); return __s; } #if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__ \ && _GLIBCXX_USE_CXX11_ABI == 0 template _OutIter money_put<_CharT, _OutIter>:: __do_put(iter_type __s, bool __intl, ios_base& __io, char_type __fill, double __units) const { return this->do_put(__s, __intl, __io, __fill, (long double) __units); } #endif # 572 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets_nonio.tcc" 3 template _OutIter money_put<_CharT, _OutIter>:: do_put(iter_type __s, bool __intl, ios_base& __io, char_type __fill, long double __units) const { const locale __loc = __io.getloc(); const ctype<_CharT>& __ctype = use_facet >(__loc); #ifdef _GLIBCXX_USE_C99 // First try a buffer perhaps big enough. int __cs_size = 64; char* __cs = static_cast(__builtin_alloca(__cs_size)); // _GLIBCXX_RESOLVE_LIB_DEFECTS // 328. Bad sprintf format modifier in money_put<>::do_put() int __len = std::__convert_from_v(_S_get_c_locale(), __cs, __cs_size, "%.*Lf", 0, __units); // If the buffer was not large enough, try again with the correct size. if (__len >= __cs_size) { __cs_size = __len + 1; __cs = static_cast(__builtin_alloca(__cs_size)); __len = std::__convert_from_v(_S_get_c_locale(), __cs, __cs_size, "%.*Lf", 0, __units); } #else # 598 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets_nonio.tcc" 3 // max_exponent10 + 1 for the integer part, + 2 for sign and '\0'. const int __cs_size = __gnu_cxx::__numeric_traits::__max_exponent10 + 3; char* __cs = static_cast(__builtin_alloca(__cs_size)); int __len = std::__convert_from_v(_S_get_c_locale(), __cs, 0, "%.*Lf", 0, __units); #endif # 605 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets_nonio.tcc" 3 string_type __digits(__len, char_type()); __ctype.widen(__cs, __cs + __len, &__digits[0]); return __intl ? _M_insert(__s, __io, __fill, __digits) : _M_insert(__s, __io, __fill, __digits); } template _OutIter money_put<_CharT, _OutIter>:: do_put(iter_type __s, bool __intl, ios_base& __io, char_type __fill, const string_type& __digits) const { return __intl ? _M_insert(__s, __io, __fill, __digits) : _M_insert(__s, __io, __fill, __digits); } _GLIBCXX_END_NAMESPACE_LDBL_OR_CXX11 // NB: Not especially useful. Without an ios_base object or some // kind of locale reference, we are left clawing at the air where // the side of the mountain used to be... template time_base::dateorder time_get<_CharT, _InIter>::do_date_order() const { return time_base::no_order; } // Expand a strftime format string and parse it. E.g., do_get_date() may // pass %m/%d/%Y => extracted characters. template _InIter time_get<_CharT, _InIter>:: _M_extract_via_format(iter_type __beg, iter_type __end, ios_base& __io, ios_base::iostate& __err, tm* __tm, const _CharT* __format) const { const locale& __loc = __io._M_getloc(); const __timepunct<_CharT>& __tp = use_facet<__timepunct<_CharT> >(__loc); const ctype<_CharT>& __ctype = use_facet >(__loc); const size_t __len = char_traits<_CharT>::length(__format); ios_base::iostate __tmperr = ios_base::goodbit; size_t __i = 0; for (; __beg != __end && __i < __len && !__tmperr; ++__i) { if (__ctype.narrow(__format[__i], 0) == '%') { // Verify valid formatting code, attempt to extract. char __c = __ctype.narrow(__format[++__i], 0); int __mem = 0; if (__c == 'E' || __c == 'O') __c = __ctype.narrow(__format[++__i], 0); switch (__c) { const char* __cs; _CharT __wcs[10]; case 'a': // Abbreviated weekday name [tm_wday] const char_type* __days1[7]; __tp._M_days_abbreviated(__days1); __beg = _M_extract_name(__beg, __end, __tm->tm_wday, __days1, 7, __io, __tmperr); break; case 'A': // Weekday name [tm_wday]. const char_type* __days2[7]; __tp._M_days(__days2); __beg = _M_extract_name(__beg, __end, __tm->tm_wday, __days2, 7, __io, __tmperr); break; case 'h': case 'b': // Abbreviated month name [tm_mon] const char_type* __months1[12]; __tp._M_months_abbreviated(__months1); __beg = _M_extract_name(__beg, __end, __tm->tm_mon, __months1, 12, __io, __tmperr); break; case 'B': // Month name [tm_mon]. const char_type* __months2[12]; __tp._M_months(__months2); __beg = _M_extract_name(__beg, __end, __tm->tm_mon, __months2, 12, __io, __tmperr); break; case 'c': // Default time and date representation. const char_type* __dt[2]; __tp._M_date_time_formats(__dt); __beg = _M_extract_via_format(__beg, __end, __io, __tmperr, __tm, __dt[0]); break; case 'd': // Day [01, 31]. [tm_mday] __beg = _M_extract_num(__beg, __end, __tm->tm_mday, 1, 31, 2, __io, __tmperr); break; case 'e': // Day [1, 31], with single digits preceded by // space. [tm_mday] if (__ctype.is(ctype_base::space, *__beg)) __beg = _M_extract_num(++__beg, __end, __tm->tm_mday, 1, 9, 1, __io, __tmperr); else __beg = _M_extract_num(__beg, __end, __tm->tm_mday, 10, 31, 2, __io, __tmperr); break; case 'D': // Equivalent to %m/%d/%y.[tm_mon, tm_mday, tm_year] __cs = "%m/%d/%y"; __ctype.widen(__cs, __cs + 9, __wcs); __beg = _M_extract_via_format(__beg, __end, __io, __tmperr, __tm, __wcs); break; case 'H': // Hour [00, 23]. [tm_hour] __beg = _M_extract_num(__beg, __end, __tm->tm_hour, 0, 23, 2, __io, __tmperr); break; case 'I': // Hour [01, 12]. [tm_hour] __beg = _M_extract_num(__beg, __end, __tm->tm_hour, 1, 12, 2, __io, __tmperr); break; case 'm': // Month [01, 12]. [tm_mon] __beg = _M_extract_num(__beg, __end, __mem, 1, 12, 2, __io, __tmperr); if (!__tmperr) __tm->tm_mon = __mem - 1; break; case 'M': // Minute [00, 59]. [tm_min] __beg = _M_extract_num(__beg, __end, __tm->tm_min, 0, 59, 2, __io, __tmperr); break; case 'n': if (__ctype.narrow(*__beg, 0) == '\n') ++__beg; else __tmperr |= ios_base::failbit; break; case 'R': // Equivalent to (%H:%M). __cs = "%H:%M"; __ctype.widen(__cs, __cs + 6, __wcs); __beg = _M_extract_via_format(__beg, __end, __io, __tmperr, __tm, __wcs); break; case 'S': // Seconds. [tm_sec] // [00, 60] in C99 (one leap-second), [00, 61] in C89. #ifdef _GLIBCXX_USE_C99 __beg = _M_extract_num(__beg, __end, __tm->tm_sec, 0, 60, 2, #else # 757 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets_nonio.tcc" 3 __beg = _M_extract_num(__beg, __end, __tm->tm_sec, 0, 61, 2, #endif # 759 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets_nonio.tcc" 3 __io, __tmperr); break; case 't': if (__ctype.narrow(*__beg, 0) == '\t') ++__beg; else __tmperr |= ios_base::failbit; break; case 'T': // Equivalent to (%H:%M:%S). __cs = "%H:%M:%S"; __ctype.widen(__cs, __cs + 9, __wcs); __beg = _M_extract_via_format(__beg, __end, __io, __tmperr, __tm, __wcs); break; case 'x': // Locale's date. const char_type* __dates[2]; __tp._M_date_formats(__dates); __beg = _M_extract_via_format(__beg, __end, __io, __tmperr, __tm, __dates[0]); break; case 'X': // Locale's time. const char_type* __times[2]; __tp._M_time_formats(__times); __beg = _M_extract_via_format(__beg, __end, __io, __tmperr, __tm, __times[0]); break; case 'y': case 'C': // C99 // Two digit year. case 'Y': // Year [1900). // NB: We parse either two digits, implicitly years since // 1900, or 4 digits, full year. In both cases we can // reconstruct [tm_year]. See also libstdc++/26701. __beg = _M_extract_num(__beg, __end, __mem, 0, 9999, 4, __io, __tmperr); if (!__tmperr) __tm->tm_year = __mem < 0 ? __mem + 100 : __mem - 1900; break; case 'Z': // Timezone info. if (__ctype.is(ctype_base::upper, *__beg)) { int __tmp; __beg = _M_extract_name(__beg, __end, __tmp, __timepunct_cache<_CharT>::_S_timezones, 14, __io, __tmperr); // GMT requires special effort. if (__beg != __end && !__tmperr && __tmp == 0 && (*__beg == __ctype.widen('-') || *__beg == __ctype.widen('+'))) { __beg = _M_extract_num(__beg, __end, __tmp, 0, 23, 2, __io, __tmperr); __beg = _M_extract_num(__beg, __end, __tmp, 0, 59, 2, __io, __tmperr); } } else __tmperr |= ios_base::failbit; break; default: // Not recognized. __tmperr |= ios_base::failbit; } } else { // Verify format and input match, extract and discard. if (__format[__i] == *__beg) ++__beg; else __tmperr |= ios_base::failbit; } } if (__tmperr || __i != __len) __err |= ios_base::failbit; return __beg; } template _InIter time_get<_CharT, _InIter>:: _M_extract_num(iter_type __beg, iter_type __end, int& __member, int __min, int __max, size_t __len, ios_base& __io, ios_base::iostate& __err) const { const locale& __loc = __io._M_getloc(); const ctype<_CharT>& __ctype = use_facet >(__loc); // As-is works for __len = 1, 2, 4, the values actually used. int __mult = __len == 2 ? 10 : (__len == 4 ? 1000 : 1); ++__min; size_t __i = 0; int __value = 0; for (; __beg != __end && __i < __len; ++__beg, ++__i) { const char __c = __ctype.narrow(*__beg, '*'); if (__c >= '0' && __c <= '9') { __value = __value * 10 + (__c - '0'); const int __valuec = __value * __mult; if (__valuec > __max || __valuec + __mult < __min) break; __mult /= 10; } else break; } if (__i == __len) __member = __value; // Special encoding for do_get_year, 'y', and 'Y' above. else if (__len == 4 && __i == 2) __member = __value - 100; else __err |= ios_base::failbit; return __beg; } // Assumptions: // All elements in __names are unique. template _InIter time_get<_CharT, _InIter>:: _M_extract_name(iter_type __beg, iter_type __end, int& __member, const _CharT** __names, size_t __indexlen, ios_base& __io, ios_base::iostate& __err) const { typedef char_traits<_CharT> __traits_type; const locale& __loc = __io._M_getloc(); const ctype<_CharT>& __ctype = use_facet >(__loc); int* __matches = static_cast(__builtin_alloca(sizeof(int) * __indexlen)); size_t __nmatches = 0; size_t __pos = 0; bool __testvalid = true; const char_type* __name; // Look for initial matches. // NB: Some of the locale data is in the form of all lowercase // names, and some is in the form of initially-capitalized // names. Look for both. if (__beg != __end) { const char_type __c = *__beg; for (size_t __i1 = 0; __i1 < __indexlen; ++__i1) if (__c == __names[__i1][0] || __c == __ctype.toupper(__names[__i1][0])) __matches[__nmatches++] = __i1; } while (__nmatches > 1) { // Find smallest matching string. size_t __minlen = __traits_type::length(__names[__matches[0]]); for (size_t __i2 = 1; __i2 < __nmatches; ++__i2) __minlen = std::min(__minlen, __traits_type::length(__names[__matches[__i2]])); ++__beg, ++__pos; if (__pos < __minlen && __beg != __end) for (size_t __i3 = 0; __i3 < __nmatches;) { __name = __names[__matches[__i3]]; if (!(__name[__pos] == *__beg)) __matches[__i3] = __matches[--__nmatches]; else ++__i3; } else break; } if (__nmatches == 1) { // Make sure found name is completely extracted. ++__beg, ++__pos; __name = __names[__matches[0]]; const size_t __len = __traits_type::length(__name); while (__pos < __len && __beg != __end && __name[__pos] == *__beg) ++__beg, ++__pos; if (__len == __pos) __member = __matches[0]; else __testvalid = false; } else __testvalid = false; if (!__testvalid) __err |= ios_base::failbit; return __beg; } template _InIter time_get<_CharT, _InIter>:: _M_extract_wday_or_month(iter_type __beg, iter_type __end, int& __member, const _CharT** __names, size_t __indexlen, ios_base& __io, ios_base::iostate& __err) const { typedef char_traits<_CharT> __traits_type; const locale& __loc = __io._M_getloc(); const ctype<_CharT>& __ctype = use_facet >(__loc); int* __matches = static_cast(__builtin_alloca(2 * sizeof(int) * __indexlen)); size_t __nmatches = 0; size_t* __matches_lengths = 0; size_t __pos = 0; if (__beg != __end) { const char_type __c = *__beg; for (size_t __i = 0; __i < 2 * __indexlen; ++__i) if (__c == __names[__i][0] || __c == __ctype.toupper(__names[__i][0])) __matches[__nmatches++] = __i; } if (__nmatches) { ++__beg, ++__pos; __matches_lengths = static_cast(__builtin_alloca(sizeof(size_t) * __nmatches)); for (size_t __i = 0; __i < __nmatches; ++__i) __matches_lengths[__i] = __traits_type::length(__names[__matches[__i]]); } for (; __beg != __end; ++__beg, ++__pos) { size_t __nskipped = 0; const char_type __c = *__beg; for (size_t __i = 0; __i < __nmatches;) { const char_type* __name = __names[__matches[__i]]; if (__pos >= __matches_lengths[__i]) ++__nskipped, ++__i; else if (!(__name[__pos] == __c)) { --__nmatches; __matches[__i] = __matches[__nmatches]; __matches_lengths[__i] = __matches_lengths[__nmatches]; } else ++__i; } if (__nskipped == __nmatches) break; } if ((__nmatches == 1 && __matches_lengths[0] == __pos) || (__nmatches == 2 && (__matches_lengths[0] == __pos || __matches_lengths[1] == __pos))) __member = (__matches[0] >= __indexlen ? __matches[0] - __indexlen : __matches[0]); else __err |= ios_base::failbit; return __beg; } template _InIter time_get<_CharT, _InIter>:: do_get_time(iter_type __beg, iter_type __end, ios_base& __io, ios_base::iostate& __err, tm* __tm) const { const locale& __loc = __io._M_getloc(); const __timepunct<_CharT>& __tp = use_facet<__timepunct<_CharT> >(__loc); const char_type* __times[2]; __tp._M_time_formats(__times); __beg = _M_extract_via_format(__beg, __end, __io, __err, __tm, __times[0]); if (__beg == __end) __err |= ios_base::eofbit; return __beg; } template _InIter time_get<_CharT, _InIter>:: do_get_date(iter_type __beg, iter_type __end, ios_base& __io, ios_base::iostate& __err, tm* __tm) const { const locale& __loc = __io._M_getloc(); const __timepunct<_CharT>& __tp = use_facet<__timepunct<_CharT> >(__loc); const char_type* __dates[2]; __tp._M_date_formats(__dates); __beg = _M_extract_via_format(__beg, __end, __io, __err, __tm, __dates[0]); if (__beg == __end) __err |= ios_base::eofbit; return __beg; } template _InIter time_get<_CharT, _InIter>:: do_get_weekday(iter_type __beg, iter_type __end, ios_base& __io, ios_base::iostate& __err, tm* __tm) const { const locale& __loc = __io._M_getloc(); const __timepunct<_CharT>& __tp = use_facet<__timepunct<_CharT> >(__loc); const ctype<_CharT>& __ctype = use_facet >(__loc); const char_type* __days[14]; __tp._M_days_abbreviated(__days); __tp._M_days(__days + 7); int __tmpwday; ios_base::iostate __tmperr = ios_base::goodbit; __beg = _M_extract_wday_or_month(__beg, __end, __tmpwday, __days, 7, __io, __tmperr); if (!__tmperr) __tm->tm_wday = __tmpwday; else __err |= ios_base::failbit; if (__beg == __end) __err |= ios_base::eofbit; return __beg; } template _InIter time_get<_CharT, _InIter>:: do_get_monthname(iter_type __beg, iter_type __end, ios_base& __io, ios_base::iostate& __err, tm* __tm) const { const locale& __loc = __io._M_getloc(); const __timepunct<_CharT>& __tp = use_facet<__timepunct<_CharT> >(__loc); const ctype<_CharT>& __ctype = use_facet >(__loc); const char_type* __months[24]; __tp._M_months_abbreviated(__months); __tp._M_months(__months + 12); int __tmpmon; ios_base::iostate __tmperr = ios_base::goodbit; __beg = _M_extract_wday_or_month(__beg, __end, __tmpmon, __months, 12, __io, __tmperr); if (!__tmperr) __tm->tm_mon = __tmpmon; else __err |= ios_base::failbit; if (__beg == __end) __err |= ios_base::eofbit; return __beg; } template _InIter time_get<_CharT, _InIter>:: do_get_year(iter_type __beg, iter_type __end, ios_base& __io, ios_base::iostate& __err, tm* __tm) const { const locale& __loc = __io._M_getloc(); const ctype<_CharT>& __ctype = use_facet >(__loc); int __tmpyear; ios_base::iostate __tmperr = ios_base::goodbit; __beg = _M_extract_num(__beg, __end, __tmpyear, 0, 9999, 4, __io, __tmperr); if (!__tmperr) __tm->tm_year = __tmpyear < 0 ? __tmpyear + 100 : __tmpyear - 1900; else __err |= ios_base::failbit; if (__beg == __end) __err |= ios_base::eofbit; return __beg; } #if __cplusplus >= 201103L template inline _InIter time_get<_CharT, _InIter>:: get(iter_type __s, iter_type __end, ios_base& __io, ios_base::iostate& __err, tm* __tm, const char_type* __fmt, const char_type* __fmtend) const { const locale& __loc = __io._M_getloc(); ctype<_CharT> const& __ctype = use_facet >(__loc); __err = ios_base::goodbit; while (__fmt != __fmtend && __err == ios_base::goodbit) { if (__s == __end) { __err = ios_base::eofbit | ios_base::failbit; break; } else if (__ctype.narrow(*__fmt, 0) == '%') { char __format; char __mod = 0; if (++__fmt == __fmtend) { __err = ios_base::failbit; break; } const char __c = __ctype.narrow(*__fmt, 0); if (__c != 'E' && __c != 'O') __format = __c; else if (++__fmt != __fmtend) { __mod = __c; __format = __ctype.narrow(*__fmt, 0); } else { __err = ios_base::failbit; break; } __s = this->do_get(__s, __end, __io, __err, __tm, __format, __mod); ++__fmt; } else if (__ctype.is(ctype_base::space, *__fmt)) { ++__fmt; while (__fmt != __fmtend && __ctype.is(ctype_base::space, *__fmt)) ++__fmt; while (__s != __end && __ctype.is(ctype_base::space, *__s)) ++__s; } // TODO real case-insensitive comparison else if (__ctype.tolower(*__s) == __ctype.tolower(*__fmt) || __ctype.toupper(*__s) == __ctype.toupper(*__fmt)) { ++__s; ++__fmt; } else { __err = ios_base::failbit; break; } } return __s; } template inline _InIter time_get<_CharT, _InIter>:: do_get(iter_type __beg, iter_type __end, ios_base& __io, ios_base::iostate& __err, tm* __tm, char __format, char __mod) const { const locale& __loc = __io._M_getloc(); ctype<_CharT> const& __ctype = use_facet >(__loc); __err = ios_base::goodbit; char_type __fmt[4]; __fmt[0] = __ctype.widen('%'); if (!__mod) { __fmt[1] = __format; __fmt[2] = char_type(); } else { __fmt[1] = __mod; __fmt[2] = __format; __fmt[3] = char_type(); } __beg = _M_extract_via_format(__beg, __end, __io, __err, __tm, __fmt); if (__beg == __end) __err |= ios_base::eofbit; return __beg; } #endif // __cplusplus >= 201103L # 1250 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets_nonio.tcc" 3 template _OutIter time_put<_CharT, _OutIter>:: put(iter_type __s, ios_base& __io, char_type __fill, const tm* __tm, const _CharT* __beg, const _CharT* __end) const { const locale& __loc = __io._M_getloc(); ctype<_CharT> const& __ctype = use_facet >(__loc); for (; __beg != __end; ++__beg) if (__ctype.narrow(*__beg, 0) != '%') { *__s = *__beg; ++__s; } else if (++__beg != __end) { char __format; char __mod = 0; const char __c = __ctype.narrow(*__beg, 0); if (__c != 'E' && __c != 'O') __format = __c; else if (++__beg != __end) { __mod = __c; __format = __ctype.narrow(*__beg, 0); } else break; __s = this->do_put(__s, __io, __fill, __tm, __format, __mod); } else break; return __s; } template _OutIter time_put<_CharT, _OutIter>:: do_put(iter_type __s, ios_base& __io, char_type, const tm* __tm, char __format, char __mod) const { const locale& __loc = __io._M_getloc(); ctype<_CharT> const& __ctype = use_facet >(__loc); __timepunct<_CharT> const& __tp = use_facet<__timepunct<_CharT> >(__loc); // NB: This size is arbitrary. Should this be a data member, // initialized at construction? const size_t __maxlen = 128; char_type __res[__maxlen]; // NB: In IEE 1003.1-200x, and perhaps other locale models, it // is possible that the format character will be longer than one // character. Possibilities include 'E' or 'O' followed by a // format character: if __mod is not the default argument, assume // it's a valid modifier. char_type __fmt[4]; __fmt[0] = __ctype.widen('%'); if (!__mod) { __fmt[1] = __format; __fmt[2] = char_type(); } else { __fmt[1] = __mod; __fmt[2] = __format; __fmt[3] = char_type(); } __tp._M_put(__res, __maxlen, __fmt, __tm); // Write resulting, fully-formatted string to output iterator. return std::__write(__s, __res, char_traits::length(__res)); } // Inhibit implicit instantiations for required instantiations, // which are defined via explicit instantiations elsewhere. #if _GLIBCXX_EXTERN_TEMPLATE extern template class moneypunct; extern template class moneypunct; extern template class moneypunct_byname; extern template class moneypunct_byname; extern template class _GLIBCXX_NAMESPACE_LDBL_OR_CXX11 money_get; extern template class _GLIBCXX_NAMESPACE_LDBL_OR_CXX11 money_put; extern template class __timepunct; extern template class time_put; extern template class time_put_byname; extern template class time_get; extern template class time_get_byname; extern template class messages; extern template class messages_byname; extern template const moneypunct& use_facet >(const locale&); extern template const moneypunct& use_facet >(const locale&); extern template const money_put& use_facet >(const locale&); extern template const money_get& use_facet >(const locale&); extern template const __timepunct& use_facet<__timepunct >(const locale&); extern template const time_put& use_facet >(const locale&); extern template const time_get& use_facet >(const locale&); extern template const messages& use_facet >(const locale&); extern template bool has_facet >(const locale&); extern template bool has_facet >(const locale&); extern template bool has_facet >(const locale&); extern template bool has_facet<__timepunct >(const locale&); extern template bool has_facet >(const locale&); extern template bool has_facet >(const locale&); extern template bool has_facet >(const locale&); #ifdef _GLIBCXX_USE_WCHAR_T extern template class moneypunct; extern template class moneypunct; extern template class moneypunct_byname; extern template class moneypunct_byname; extern template class _GLIBCXX_NAMESPACE_LDBL_OR_CXX11 money_get; extern template class _GLIBCXX_NAMESPACE_LDBL_OR_CXX11 money_put; extern template class __timepunct; extern template class time_put; extern template class time_put_byname; extern template class time_get; extern template class time_get_byname; extern template class messages; extern template class messages_byname; extern template const moneypunct& use_facet >(const locale&); extern template const moneypunct& use_facet >(const locale&); extern template const money_put& use_facet >(const locale&); extern template const money_get& use_facet >(const locale&); extern template const __timepunct& use_facet<__timepunct >(const locale&); extern template const time_put& use_facet >(const locale&); extern template const time_get& use_facet >(const locale&); extern template const messages& use_facet >(const locale&); extern template bool has_facet >(const locale&); extern template bool has_facet >(const locale&); extern template bool has_facet >(const locale&); extern template bool has_facet<__timepunct >(const locale&); extern template bool has_facet >(const locale&); extern template bool has_facet >(const locale&); extern template bool has_facet >(const locale&); #endif # 1479 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets_nonio.tcc" 3 #endif # 1480 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets_nonio.tcc" 3 _GLIBCXX_END_NAMESPACE_VERSION } // namespace std #endif # 1485 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets_nonio.tcc" 3 # 2014 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets_nonio.h" 2 3 #endif # 2016 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_facets_nonio.h" 3 # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/locale" 2 3 #if __cplusplus >= 201103L #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 43 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/locale" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_conv.h" 1 3 // wstring_convert implementation -*- C++ -*- // Copyright (C) 2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file bits/locale_conv.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{locale} */ #ifndef _LOCALE_CONV_H #define _LOCALE_CONV_H 1 #if __cplusplus < 201103L #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 34 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_conv.h" 3 # 35 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_conv.h" 3 #else # 36 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_conv.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 37 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_conv.h" 3 # 38 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_conv.h" 3 #if 0 /* expanded by -frewrite-includes */ #include "stringfwd.h" #endif /* expanded by -frewrite-includes */ # 38 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_conv.h" 3 # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_conv.h" 3 #if 0 /* expanded by -frewrite-includes */ #include "allocator.h" #endif /* expanded by -frewrite-includes */ # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_conv.h" 3 # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_conv.h" 3 #if 0 /* expanded by -frewrite-includes */ #include "codecvt.h" #endif /* expanded by -frewrite-includes */ # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_conv.h" 3 # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_conv.h" 3 #if 0 /* expanded by -frewrite-includes */ #include "unique_ptr.h" #endif /* expanded by -frewrite-includes */ # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_conv.h" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/unique_ptr.h" 1 3 // unique_ptr implementation -*- C++ -*- // Copyright (C) 2008-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file bits/unique_ptr.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{memory} */ #ifndef _UNIQUE_PTR_H #define _UNIQUE_PTR_H 1 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 33 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/unique_ptr.h" 3 # 34 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/unique_ptr.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 34 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/unique_ptr.h" 3 # 35 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/unique_ptr.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 35 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/unique_ptr.h" 3 # 36 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/unique_ptr.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 36 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/unique_ptr.h" 3 # 37 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/unique_ptr.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 37 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/unique_ptr.h" 3 # 38 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/unique_ptr.h" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION /** * @addtogroup pointer_abstractions * @{ */ #if _GLIBCXX_USE_DEPRECATED template class auto_ptr; #endif # 51 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/unique_ptr.h" 3 /// Primary template of default_delete, used by unique_ptr template struct default_delete { /// Default constructor constexpr default_delete() noexcept = default; /** @brief Converting constructor. * * Allows conversion from a deleter for arrays of another type, @p _Up, * only if @p _Up* is convertible to @p _Tp*. */ template::value>::type> default_delete(const default_delete<_Up>&) noexcept { } /// Calls @c delete @p __ptr void operator()(_Tp* __ptr) const { static_assert(!is_void<_Tp>::value, "can't delete pointer to incomplete type"); static_assert(sizeof(_Tp)>0, "can't delete pointer to incomplete type"); delete __ptr; } }; // _GLIBCXX_RESOLVE_LIB_DEFECTS // DR 740 - omit specialization for array objects with a compile time length /// Specialization for arrays, default_delete. template struct default_delete<_Tp[]> { private: template using __remove_cv = typename remove_cv<_Up>::type; // Like is_base_of<_Tp, _Up> but false if unqualified types are the same template using __is_derived_Tp = __and_< is_base_of<_Tp, _Up>, __not_, __remove_cv<_Up>>> >; public: /// Default constructor constexpr default_delete() noexcept = default; /** @brief Converting constructor. * * Allows conversion from a deleter for arrays of another type, such as * a const-qualified version of @p _Tp. * * Conversions from types derived from @c _Tp are not allowed because * it is unsafe to @c delete[] an array of derived types through a * pointer to the base type. */ template::value>::type> default_delete(const default_delete<_Up[]>&) noexcept { } /// Calls @c delete[] @p __ptr void operator()(_Tp* __ptr) const { static_assert(sizeof(_Tp)>0, "can't delete pointer to incomplete type"); delete [] __ptr; } template typename enable_if<__is_derived_Tp<_Up>::value>::type operator()(_Up*) const = delete; }; /// 20.7.1.2 unique_ptr for single objects. template > class unique_ptr { // use SFINAE to determine whether _Del::pointer exists class _Pointer { template static typename _Up::pointer __test(typename _Up::pointer*); template static _Tp* __test(...); typedef typename remove_reference<_Dp>::type _Del; public: typedef decltype(__test<_Del>(0)) type; }; typedef std::tuple __tuple_type; __tuple_type _M_t; public: typedef typename _Pointer::type pointer; typedef _Tp element_type; typedef _Dp deleter_type; // Constructors. /// Default constructor, creates a unique_ptr that owns nothing. constexpr unique_ptr() noexcept : _M_t() { static_assert(!is_pointer::value, "constructed with null function pointer deleter"); } /** Takes ownership of a pointer. * * @param __p A pointer to an object of @c element_type * * The deleter will be value-initialized. */ explicit unique_ptr(pointer __p) noexcept : _M_t(__p, deleter_type()) { static_assert(!is_pointer::value, "constructed with null function pointer deleter"); } /** Takes ownership of a pointer. * * @param __p A pointer to an object of @c element_type * @param __d A reference to a deleter. * * The deleter will be initialized with @p __d */ unique_ptr(pointer __p, typename conditional::value, deleter_type, const deleter_type&>::type __d) noexcept : _M_t(__p, __d) { } /** Takes ownership of a pointer. * * @param __p A pointer to an object of @c element_type * @param __d An rvalue reference to a deleter. * * The deleter will be initialized with @p std::move(__d) */ unique_ptr(pointer __p, typename remove_reference::type&& __d) noexcept : _M_t(std::move(__p), std::move(__d)) { static_assert(!std::is_reference::value, "rvalue deleter bound to reference"); } /// Creates a unique_ptr that owns nothing. constexpr unique_ptr(nullptr_t) noexcept : unique_ptr() { } // Move constructors. /// Move constructor. unique_ptr(unique_ptr&& __u) noexcept : _M_t(__u.release(), std::forward(__u.get_deleter())) { } /** @brief Converting constructor from another type * * Requires that the pointer owned by @p __u is convertible to the * type of pointer owned by this object, @p __u does not own an array, * and @p __u has a compatible deleter type. */ template::pointer, pointer>, __not_>, typename conditional::value, is_same<_Ep, _Dp>, is_convertible<_Ep, _Dp>>::type>> unique_ptr(unique_ptr<_Up, _Ep>&& __u) noexcept : _M_t(__u.release(), std::forward<_Ep>(__u.get_deleter())) { } #if _GLIBCXX_USE_DEPRECATED /// Converting constructor from @c auto_ptr template, is_same<_Dp, default_delete<_Tp>>>> unique_ptr(auto_ptr<_Up>&& __u) noexcept; #endif # 230 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/unique_ptr.h" 3 /// Destructor, invokes the deleter if the stored pointer is not null. ~unique_ptr() noexcept { auto& __ptr = std::get<0>(_M_t); if (__ptr != nullptr) get_deleter()(__ptr); __ptr = pointer(); } // Assignment. /** @brief Move assignment operator. * * @param __u The object to transfer ownership from. * * Invokes the deleter first if this object owns a pointer. */ unique_ptr& operator=(unique_ptr&& __u) noexcept { reset(__u.release()); get_deleter() = std::forward(__u.get_deleter()); return *this; } /** @brief Assignment from another type. * * @param __u The object to transfer ownership from, which owns a * convertible pointer to a non-array object. * * Invokes the deleter first if this object owns a pointer. */ template typename enable_if< __and_< is_convertible::pointer, pointer>, __not_> >::value, unique_ptr&>::type operator=(unique_ptr<_Up, _Ep>&& __u) noexcept { reset(__u.release()); get_deleter() = std::forward<_Ep>(__u.get_deleter()); return *this; } /// Reset the %unique_ptr to empty, invoking the deleter if necessary. unique_ptr& operator=(nullptr_t) noexcept { reset(); return *this; } // Observers. /// Dereference the stored pointer. typename add_lvalue_reference::type operator*() const { _GLIBCXX_DEBUG_ASSERT(get() != pointer()); return *get(); } /// Return the stored pointer. pointer operator->() const noexcept { _GLIBCXX_DEBUG_ASSERT(get() != pointer()); return get(); } /// Return the stored pointer. pointer get() const noexcept { return std::get<0>(_M_t); } /// Return a reference to the stored deleter. deleter_type& get_deleter() noexcept { return std::get<1>(_M_t); } /// Return a reference to the stored deleter. const deleter_type& get_deleter() const noexcept { return std::get<1>(_M_t); } /// Return @c true if the stored pointer is not null. explicit operator bool() const noexcept { return get() == pointer() ? false : true; } // Modifiers. /// Release ownership of any stored pointer. pointer release() noexcept { pointer __p = get(); std::get<0>(_M_t) = pointer(); return __p; } /** @brief Replace the stored pointer. * * @param __p The new pointer to store. * * The deleter will be invoked if a pointer is already owned. */ void reset(pointer __p = pointer()) noexcept { using std::swap; swap(std::get<0>(_M_t), __p); if (__p != pointer()) get_deleter()(__p); } /// Exchange the pointer and deleter with another object. void swap(unique_ptr& __u) noexcept { using std::swap; swap(_M_t, __u._M_t); } // Disable copy from lvalue. unique_ptr(const unique_ptr&) = delete; unique_ptr& operator=(const unique_ptr&) = delete; }; /// 20.7.1.3 unique_ptr for array objects with a runtime length // [unique.ptr.runtime] // _GLIBCXX_RESOLVE_LIB_DEFECTS // DR 740 - omit specialization for array objects with a compile time length template class unique_ptr<_Tp[], _Dp> { // use SFINAE to determine whether _Del::pointer exists class _Pointer { template static typename _Up::pointer __test(typename _Up::pointer*); template static _Tp* __test(...); typedef typename remove_reference<_Dp>::type _Del; public: typedef decltype(__test<_Del>(0)) type; }; typedef std::tuple __tuple_type; __tuple_type _M_t; template using __remove_cv = typename remove_cv<_Up>::type; // like is_base_of<_Tp, _Up> but false if unqualified types are the same template using __is_derived_Tp = __and_< is_base_of<_Tp, _Up>, __not_, __remove_cv<_Up>>> >; template::pointer> using __safe_conversion = __and_< is_convertible<_Up_pointer, _Tp_pointer>, is_array<_Up>, __or_<__not_>, __not_>, __not_<__is_derived_Tp::type>> > >; public: typedef typename _Pointer::type pointer; typedef _Tp element_type; typedef _Dp deleter_type; // Constructors. /// Default constructor, creates a unique_ptr that owns nothing. constexpr unique_ptr() noexcept : _M_t() { static_assert(!std::is_pointer::value, "constructed with null function pointer deleter"); } /** Takes ownership of a pointer. * * @param __p A pointer to an array of @c element_type * * The deleter will be value-initialized. */ explicit unique_ptr(pointer __p) noexcept : _M_t(__p, deleter_type()) { static_assert(!is_pointer::value, "constructed with null function pointer deleter"); } // Disable construction from convertible pointer types. template, is_convertible<_Up*, pointer>, __is_derived_Tp<_Up>>> explicit unique_ptr(_Up* __p) = delete; /** Takes ownership of a pointer. * * @param __p A pointer to an array of @c element_type * @param __d A reference to a deleter. * * The deleter will be initialized with @p __d */ unique_ptr(pointer __p, typename conditional::value, deleter_type, const deleter_type&>::type __d) noexcept : _M_t(__p, __d) { } /** Takes ownership of a pointer. * * @param __p A pointer to an array of @c element_type * @param __d A reference to a deleter. * * The deleter will be initialized with @p std::move(__d) */ unique_ptr(pointer __p, typename remove_reference::type&& __d) noexcept : _M_t(std::move(__p), std::move(__d)) { static_assert(!is_reference::value, "rvalue deleter bound to reference"); } /// Move constructor. unique_ptr(unique_ptr&& __u) noexcept : _M_t(__u.release(), std::forward(__u.get_deleter())) { } /// Creates a unique_ptr that owns nothing. constexpr unique_ptr(nullptr_t) noexcept : unique_ptr() { } template, typename conditional::value, is_same<_Ep, _Dp>, is_convertible<_Ep, _Dp>>::type >> unique_ptr(unique_ptr<_Up, _Ep>&& __u) noexcept : _M_t(__u.release(), std::forward<_Ep>(__u.get_deleter())) { } /// Destructor, invokes the deleter if the stored pointer is not null. ~unique_ptr() { auto& __ptr = std::get<0>(_M_t); if (__ptr != nullptr) get_deleter()(__ptr); __ptr = pointer(); } // Assignment. /** @brief Move assignment operator. * * @param __u The object to transfer ownership from. * * Invokes the deleter first if this object owns a pointer. */ unique_ptr& operator=(unique_ptr&& __u) noexcept { reset(__u.release()); get_deleter() = std::forward(__u.get_deleter()); return *this; } /** @brief Assignment from another type. * * @param __u The object to transfer ownership from, which owns a * convertible pointer to an array object. * * Invokes the deleter first if this object owns a pointer. */ template typename enable_if<__safe_conversion<_Up, _Ep>::value, unique_ptr&>::type operator=(unique_ptr<_Up, _Ep>&& __u) noexcept { reset(__u.release()); get_deleter() = std::forward<_Ep>(__u.get_deleter()); return *this; } /// Reset the %unique_ptr to empty, invoking the deleter if necessary. unique_ptr& operator=(nullptr_t) noexcept { reset(); return *this; } // Observers. /// Access an element of owned array. typename std::add_lvalue_reference::type operator[](size_t __i) const { _GLIBCXX_DEBUG_ASSERT(get() != pointer()); return get()[__i]; } /// Return the stored pointer. pointer get() const noexcept { return std::get<0>(_M_t); } /// Return a reference to the stored deleter. deleter_type& get_deleter() noexcept { return std::get<1>(_M_t); } /// Return a reference to the stored deleter. const deleter_type& get_deleter() const noexcept { return std::get<1>(_M_t); } /// Return @c true if the stored pointer is not null. explicit operator bool() const noexcept { return get() == pointer() ? false : true; } // Modifiers. /// Release ownership of any stored pointer. pointer release() noexcept { pointer __p = get(); std::get<0>(_M_t) = pointer(); return __p; } /** @brief Replace the stored pointer. * * @param __p The new pointer to store. * * The deleter will be invoked if a pointer is already owned. */ void reset(pointer __p = pointer()) noexcept { using std::swap; swap(std::get<0>(_M_t), __p); if (__p != nullptr) get_deleter()(__p); } // Disable resetting from convertible pointer types. template, is_convertible<_Up*, pointer>, __is_derived_Tp<_Up>>> void reset(_Up*) = delete; /// Exchange the pointer and deleter with another object. void swap(unique_ptr& __u) noexcept { using std::swap; swap(_M_t, __u._M_t); } // Disable copy from lvalue. unique_ptr(const unique_ptr&) = delete; unique_ptr& operator=(const unique_ptr&) = delete; // Disable construction from convertible pointer types. template, is_convertible<_Up*, pointer>, __is_derived_Tp<_Up>>> unique_ptr(_Up*, typename conditional::value, deleter_type, const deleter_type&>::type) = delete; // Disable construction from convertible pointer types. template, is_convertible<_Up*, pointer>, __is_derived_Tp<_Up>>> unique_ptr(_Up*, typename remove_reference::type&&) = delete; }; template inline void swap(unique_ptr<_Tp, _Dp>& __x, unique_ptr<_Tp, _Dp>& __y) noexcept { __x.swap(__y); } template inline bool operator==(const unique_ptr<_Tp, _Dp>& __x, const unique_ptr<_Up, _Ep>& __y) { return __x.get() == __y.get(); } template inline bool operator==(const unique_ptr<_Tp, _Dp>& __x, nullptr_t) noexcept { return !__x; } template inline bool operator==(nullptr_t, const unique_ptr<_Tp, _Dp>& __x) noexcept { return !__x; } template inline bool operator!=(const unique_ptr<_Tp, _Dp>& __x, const unique_ptr<_Up, _Ep>& __y) { return __x.get() != __y.get(); } template inline bool operator!=(const unique_ptr<_Tp, _Dp>& __x, nullptr_t) noexcept { return (bool)__x; } template inline bool operator!=(nullptr_t, const unique_ptr<_Tp, _Dp>& __x) noexcept { return (bool)__x; } template inline bool operator<(const unique_ptr<_Tp, _Dp>& __x, const unique_ptr<_Up, _Ep>& __y) { typedef typename std::common_type::pointer, typename unique_ptr<_Up, _Ep>::pointer>::type _CT; return std::less<_CT>()(__x.get(), __y.get()); } template inline bool operator<(const unique_ptr<_Tp, _Dp>& __x, nullptr_t) { return std::less::pointer>()(__x.get(), nullptr); } template inline bool operator<(nullptr_t, const unique_ptr<_Tp, _Dp>& __x) { return std::less::pointer>()(nullptr, __x.get()); } template inline bool operator<=(const unique_ptr<_Tp, _Dp>& __x, const unique_ptr<_Up, _Ep>& __y) { return !(__y < __x); } template inline bool operator<=(const unique_ptr<_Tp, _Dp>& __x, nullptr_t) { return !(nullptr < __x); } template inline bool operator<=(nullptr_t, const unique_ptr<_Tp, _Dp>& __x) { return !(__x < nullptr); } template inline bool operator>(const unique_ptr<_Tp, _Dp>& __x, const unique_ptr<_Up, _Ep>& __y) { return (__y < __x); } template inline bool operator>(const unique_ptr<_Tp, _Dp>& __x, nullptr_t) { return std::less::pointer>()(nullptr, __x.get()); } template inline bool operator>(nullptr_t, const unique_ptr<_Tp, _Dp>& __x) { return std::less::pointer>()(__x.get(), nullptr); } template inline bool operator>=(const unique_ptr<_Tp, _Dp>& __x, const unique_ptr<_Up, _Ep>& __y) { return !(__x < __y); } template inline bool operator>=(const unique_ptr<_Tp, _Dp>& __x, nullptr_t) { return !(__x < nullptr); } template inline bool operator>=(nullptr_t, const unique_ptr<_Tp, _Dp>& __x) { return !(nullptr < __x); } /// std::hash specialization for unique_ptr. template struct hash> : public __hash_base> { size_t operator()(const unique_ptr<_Tp, _Dp>& __u) const noexcept { typedef unique_ptr<_Tp, _Dp> _UP; return std::hash()(__u.get()); } }; #if __cplusplus > 201103L #define __cpp_lib_make_unique 201304 template struct _MakeUniq { typedef unique_ptr<_Tp> __single_object; }; template struct _MakeUniq<_Tp[]> { typedef unique_ptr<_Tp[]> __array; }; template struct _MakeUniq<_Tp[_Bound]> { struct __invalid_type { }; }; /// std::make_unique for single objects template inline typename _MakeUniq<_Tp>::__single_object make_unique(_Args&&... __args) { return unique_ptr<_Tp>(new _Tp(std::forward<_Args>(__args)...)); } /// std::make_unique for arrays of unknown bound template inline typename _MakeUniq<_Tp>::__array make_unique(size_t __num) { return unique_ptr<_Tp>(new remove_extent_t<_Tp>[__num]()); } /// Disable std::make_unique for arrays of known bound template inline typename _MakeUniq<_Tp>::__invalid_type make_unique(_Args&&...) = delete; #endif # 778 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/unique_ptr.h" 3 // @} group pointer_abstractions _GLIBCXX_END_NAMESPACE_VERSION } // namespace #endif /* _UNIQUE_PTR_H */ # 785 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/unique_ptr.h" 3 # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_conv.h" 2 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION /** * @addtogroup locales * @{ */ template bool __do_str_codecvt(const _InChar* __first, const _InChar* __last, _OutStr& __outstr, const _Codecvt& __cvt, _State& __state, size_t& __count, _Fn __fn) { if (__first == __last) { __outstr.clear(); __count = 0; return true; } size_t __outchars = 0; auto __next = __first; const auto __maxlen = __cvt.max_length() + 1; codecvt_base::result __result; do { __outstr.resize(__outstr.size() + (__last - __next) * __maxlen); auto __outnext = &__outstr.front() + __outchars; auto const __outlast = &__outstr.back() + 1; __result = (__cvt.*__fn)(__state, __next, __last, __next, __outnext, __outlast, __outnext); __outchars = __outnext - &__outstr.front(); } while (__result == codecvt_base::partial && __next != __last && (__outstr.size() - __outchars) < __maxlen); if (__result == codecvt_base::error) return false; if (__result == codecvt_base::noconv) { __outstr.assign(__first, __last); __count = __last - __first; } else { __outstr.resize(__outchars); __count = __next - __first; } return true; } // Convert narrow character string to wide. template inline bool __str_codecvt_in(const char* __first, const char* __last, basic_string<_CharT, _Traits, _Alloc>& __outstr, const codecvt<_CharT, char, _State>& __cvt, _State& __state, size_t& __count) { using _Codecvt = codecvt<_CharT, char, _State>; using _ConvFn = codecvt_base::result (_Codecvt::*)(_State&, const char*, const char*, const char*&, _CharT*, _CharT*, _CharT*&) const; _ConvFn __fn = &codecvt<_CharT, char, _State>::in; return __do_str_codecvt(__first, __last, __outstr, __cvt, __state, __count, __fn); } template inline bool __str_codecvt_in(const char* __first, const char* __last, basic_string<_CharT, _Traits, _Alloc>& __outstr, const codecvt<_CharT, char, _State>& __cvt) { _State __state = {}; size_t __n; return __str_codecvt_in(__first, __last, __outstr, __cvt, __state, __n); } // Convert wide character string to narrow. template inline bool __str_codecvt_out(const _CharT* __first, const _CharT* __last, basic_string& __outstr, const codecvt<_CharT, char, _State>& __cvt, _State& __state, size_t& __count) { using _Codecvt = codecvt<_CharT, char, _State>; using _ConvFn = codecvt_base::result (_Codecvt::*)(_State&, const _CharT*, const _CharT*, const _CharT*&, char*, char*, char*&) const; _ConvFn __fn = &codecvt<_CharT, char, _State>::out; return __do_str_codecvt(__first, __last, __outstr, __cvt, __state, __count, __fn); } template inline bool __str_codecvt_out(const _CharT* __first, const _CharT* __last, basic_string& __outstr, const codecvt<_CharT, char, _State>& __cvt) { _State __state = {}; size_t __n; return __str_codecvt_out(__first, __last, __outstr, __cvt, __state, __n); } #ifdef _GLIBCXX_USE_WCHAR_T _GLIBCXX_BEGIN_NAMESPACE_CXX11 /// String conversions template, typename _Byte_alloc = allocator> class wstring_convert { public: typedef basic_string, _Byte_alloc> byte_string; typedef basic_string<_Elem, char_traits<_Elem>, _Wide_alloc> wide_string; typedef typename _Codecvt::state_type state_type; typedef typename wide_string::traits_type::int_type int_type; /** Default constructor. * * @param __pcvt The facet to use for conversions. * * Takes ownership of @p __pcvt and will delete it in the destructor. */ explicit wstring_convert(_Codecvt* __pcvt = new _Codecvt()) : _M_cvt(__pcvt) { if (!_M_cvt) __throw_logic_error("wstring_convert"); } /** Construct with an initial converstion state. * * @param __pcvt The facet to use for conversions. * @param __state Initial conversion state. * * Takes ownership of @p __pcvt and will delete it in the destructor. * The object's conversion state will persist between conversions. */ wstring_convert(_Codecvt* __pcvt, state_type __state) : _M_cvt(__pcvt), _M_state(__state), _M_with_cvtstate(true) { if (!_M_cvt) __throw_logic_error("wstring_convert"); } /** Construct with error strings. * * @param __byte_err A string to return on failed conversions. * @param __wide_err A wide string to return on failed conversions. */ explicit wstring_convert(const byte_string& __byte_err, const wide_string& __wide_err = wide_string()) : _M_cvt(new _Codecvt), _M_byte_err_string(__byte_err), _M_wide_err_string(__wide_err), _M_with_strings(true) { if (!_M_cvt) __throw_logic_error("wstring_convert"); } ~wstring_convert() = default; // _GLIBCXX_RESOLVE_LIB_DEFECTS // 2176. Special members for wstring_convert and wbuffer_convert wstring_convert(const wstring_convert&) = delete; wstring_convert& operator=(const wstring_convert&) = delete; /// @{ Convert from bytes. wide_string from_bytes(char __byte) { char __bytes[2] = { __byte }; return from_bytes(__bytes, __bytes+1); } wide_string from_bytes(const char* __ptr) { return from_bytes(__ptr, __ptr+char_traits::length(__ptr)); } wide_string from_bytes(const byte_string& __str) { auto __ptr = __str.data(); return from_bytes(__ptr, __ptr + __str.size()); } wide_string from_bytes(const char* __first, const char* __last) { if (!_M_with_cvtstate) _M_state = state_type(); wide_string __out{ _M_wide_err_string.get_allocator() }; if (__str_codecvt_in(__first, __last, __out, *_M_cvt, _M_state, _M_count)) return __out; if (_M_with_strings) return _M_wide_err_string; __throw_range_error("wstring_convert::from_bytes"); } /// @} /// @{ Convert to bytes. byte_string to_bytes(_Elem __wchar) { _Elem __wchars[2] = { __wchar }; return to_bytes(__wchars, __wchars+1); } byte_string to_bytes(const _Elem* __ptr) { return to_bytes(__ptr, __ptr+wide_string::traits_type::length(__ptr)); } byte_string to_bytes(const wide_string& __wstr) { auto __ptr = __wstr.data(); return to_bytes(__ptr, __ptr + __wstr.size()); } byte_string to_bytes(const _Elem* __first, const _Elem* __last) { if (!_M_with_cvtstate) _M_state = state_type(); byte_string __out{ _M_byte_err_string.get_allocator() }; if (__str_codecvt_out(__first, __last, __out, *_M_cvt, _M_state, _M_count)) return __out; if (_M_with_strings) return _M_byte_err_string; __throw_range_error("wstring_convert::to_bytes"); } /// @} // _GLIBCXX_RESOLVE_LIB_DEFECTS // 2174. wstring_convert::converted() should be noexcept /// The number of elements successfully converted in the last conversion. size_t converted() const noexcept { return _M_count; } /// The final conversion state of the last conversion. state_type state() const { return _M_state; } private: unique_ptr<_Codecvt> _M_cvt; byte_string _M_byte_err_string; wide_string _M_wide_err_string; state_type _M_state = state_type(); size_t _M_count = 0; bool _M_with_cvtstate = false; bool _M_with_strings = false; }; _GLIBCXX_END_NAMESPACE_CXX11 /// Buffer conversions template> class wbuffer_convert : public basic_streambuf<_Elem, _Tr> { typedef basic_streambuf<_Elem, _Tr> _Wide_streambuf; public: typedef typename _Codecvt::state_type state_type; /** Default constructor. * * @param __bytebuf The underlying byte stream buffer. * @param __pcvt The facet to use for conversions. * @param __state Initial conversion state. * * Takes ownership of @p __pcvt and will delete it in the destructor. */ explicit wbuffer_convert(streambuf* __bytebuf = 0, _Codecvt* __pcvt = new _Codecvt, state_type __state = state_type()) : _M_buf(__bytebuf), _M_cvt(__pcvt), _M_state(__state) { if (!_M_cvt) __throw_logic_error("wbuffer_convert"); _M_always_noconv = _M_cvt->always_noconv(); if (_M_buf) { this->setp(_M_put_area, _M_put_area + _S_buffer_length); this->setg(_M_get_area + _S_putback_length, _M_get_area + _S_putback_length, _M_get_area + _S_putback_length); } } ~wbuffer_convert() = default; // _GLIBCXX_RESOLVE_LIB_DEFECTS // 2176. Special members for wstring_convert and wbuffer_convert wbuffer_convert(const wbuffer_convert&) = delete; wbuffer_convert& operator=(const wbuffer_convert&) = delete; streambuf* rdbuf() const noexcept { return _M_buf; } streambuf* rdbuf(streambuf *__bytebuf) noexcept { auto __prev = _M_buf; _M_buf = __bytebuf; return __prev; } /// The conversion state following the last conversion. state_type state() const noexcept { return _M_state; } protected: int sync() { return _M_buf && _M_conv_put() && _M_buf->pubsync() ? 0 : -1; } typename _Wide_streambuf::int_type overflow(typename _Wide_streambuf::int_type __out) { if (!_M_buf || !_M_conv_put()) return _Tr::eof(); else if (!_Tr::eq_int_type(__out, _Tr::eof())) return this->sputc(__out); return _Tr::not_eof(__out); } typename _Wide_streambuf::int_type underflow() { if (!_M_buf) return _Tr::eof(); if (this->gptr() < this->egptr() || (_M_buf && _M_conv_get())) return _Tr::to_int_type(*this->gptr()); else return _Tr::eof(); } streamsize xsputn(const typename _Wide_streambuf::char_type* __s, streamsize __n) { if (!_M_buf || __n == 0) return 0; streamsize __done = 0; do { auto __nn = std::min(this->epptr() - this->pptr(), __n - __done); _Tr::copy(this->pptr(), __s + __done, __nn); this->pbump(__nn); __done += __nn; } while (__done < __n && _M_conv_put()); return __done; } private: // fill the get area from converted contents of the byte stream buffer bool _M_conv_get() { const streamsize __pb1 = this->gptr() - this->eback(); const streamsize __pb2 = _S_putback_length; const streamsize __npb = std::min(__pb1, __pb2); _Tr::move(_M_get_area + _S_putback_length - __npb, this->gptr() - __npb, __npb); streamsize __nbytes = sizeof(_M_get_buf) - _M_unconv; __nbytes = std::min(__nbytes, _M_buf->in_avail()); if (__nbytes < 1) __nbytes == 1; __nbytes = _M_buf->sgetn(_M_get_buf + _M_unconv, __nbytes); if (__nbytes < 1) return false; __nbytes += _M_unconv; // convert _M_get_buf into _M_get_area _Elem* __outbuf = _M_get_area + _S_putback_length; _Elem* __outnext = __outbuf; const char* __bnext = _M_get_buf; codecvt_base::result __result; if (_M_always_noconv) __result = codecvt_base::noconv; else { _Elem* __outend = _M_get_area + _S_buffer_length; __result = _M_cvt->in(_M_state, __bnext, __bnext + __nbytes, __bnext, __outbuf, __outend, __outnext); } if (__result == codecvt_base::noconv) { // cast is safe because noconv means _Elem is same type as char auto __get_buf = reinterpret_cast(_M_get_buf); _Tr::copy(__outbuf, __get_buf, __nbytes); _M_unconv = 0; return true; } if ((_M_unconv = _M_get_buf + __nbytes - __bnext)) char_traits::move(_M_get_buf, __bnext, _M_unconv); this->setg(__outbuf, __outbuf, __outnext); return __result != codecvt_base::error; } // unused bool _M_put(...) { return false; } bool _M_put(const char* __p, streamsize __n) { if (_M_buf->sputn(__p, __n) < __n) return false; } // convert the put area and write to the byte stream buffer bool _M_conv_put() { _Elem* const __first = this->pbase(); const _Elem* const __last = this->pptr(); const streamsize __pending = __last - __first; if (_M_always_noconv) return _M_put(__first, __pending); char __outbuf[2 * _S_buffer_length]; const _Elem* __next = __first; const _Elem* __start; do { __start = __next; char* __outnext = __outbuf; char* const __outlast = __outbuf + sizeof(__outbuf); auto __result = _M_cvt->out(_M_state, __next, __last, __next, __outnext, __outlast, __outnext); if (__result == codecvt_base::error) return false; else if (__result == codecvt_base::noconv) return _M_put(__next, __pending); if (!_M_put(__outbuf, __outnext - __outbuf)) return false; } while (__next != __last && __next != __start); if (__next != __last) _Tr::move(__first, __next, __last - __next); this->pbump(__first - __next); return __next != __first; } streambuf* _M_buf; unique_ptr<_Codecvt> _M_cvt; state_type _M_state; static const streamsize _S_buffer_length = 32; static const streamsize _S_putback_length = 3; _Elem _M_put_area[_S_buffer_length]; _Elem _M_get_area[_S_buffer_length]; streamsize _M_unconv = 0; char _M_get_buf[_S_buffer_length-_S_putback_length]; bool _M_always_noconv; }; #endif // _GLIBCXX_USE_WCHAR_T # 537 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_conv.h" 3 /// @} group locales _GLIBCXX_END_NAMESPACE_VERSION } // namespace #endif // __cplusplus # 544 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_conv.h" 3 #endif /* _LOCALE_CONV_H */ # 546 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/locale_conv.h" 3 # 44 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/locale" 2 3 #endif # 45 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/locale" 3 #endif /* _GLIBCXX_LOCALE */ # 47 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/locale" 3 # 44 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/iomanip" 2 3 #if __cplusplus > 201103L #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 45 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/iomanip" 3 # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/quoted_string.h" 1 3 // Helpers for quoted stream manipulators -*- C++ -*- // Copyright (C) 2013-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file bits/quoted_string.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{iomanip} */ #ifndef _GLIBCXX_QUOTED_STRING_H #define _GLIBCXX_QUOTED_STRING_H 1 #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 34 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/quoted_string.h" 3 #if __cplusplus < 201103L #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 36 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/quoted_string.h" 3 # 37 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/quoted_string.h" 3 #else # 38 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/quoted_string.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 38 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/quoted_string.h" 3 # 39 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/quoted_string.h" 3 namespace std _GLIBCXX_VISIBILITY(default) { namespace __detail { _GLIBCXX_BEGIN_NAMESPACE_VERSION /** * @brief Struct for delimited strings. */ template struct _Quoted_string { static_assert(is_reference<_String>::value || is_pointer<_String>::value, "String type must be pointer or reference"); _Quoted_string(_String __str, _CharT __del, _CharT __esc) : _M_string(__str), _M_delim{__del}, _M_escape{__esc} { } _Quoted_string& operator=(_Quoted_string&) = delete; _String _M_string; _CharT _M_delim; _CharT _M_escape; }; /** * @brief Inserter for quoted strings. * * _GLIBCXX_RESOLVE_LIB_DEFECTS * DR 2344 quoted()'s interaction with padding is unclear */ template std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>& __os, const _Quoted_string& __str) { std::basic_ostringstream<_CharT, _Traits> __ostr; __ostr << __str._M_delim; for (const _CharT* __c = __str._M_string; *__c; ++__c) { if (*__c == __str._M_delim || *__c == __str._M_escape) __ostr << __str._M_escape; __ostr << *__c; } __ostr << __str._M_delim; return __os << __ostr.str(); } /** * @brief Inserter for quoted strings. * * _GLIBCXX_RESOLVE_LIB_DEFECTS * DR 2344 quoted()'s interaction with padding is unclear */ template std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>& __os, const _Quoted_string<_String, _CharT>& __str) { std::basic_ostringstream<_CharT, _Traits> __ostr; __ostr << __str._M_delim; for (auto& __c : __str._M_string) { if (__c == __str._M_delim || __c == __str._M_escape) __ostr << __str._M_escape; __ostr << __c; } __ostr << __str._M_delim; return __os << __ostr.str(); } /** * @brief Extractor for delimited strings. * The left and right delimiters can be different. */ template std::basic_istream<_CharT, _Traits>& operator>>(std::basic_istream<_CharT, _Traits>& __is, const _Quoted_string&, _CharT>& __str) { _CharT __c; __is >> __c; if (!__is.good()) return __is; if (__c != __str._M_delim) { __is.unget(); __is >> __str._M_string; return __is; } __str._M_string.clear(); std::ios_base::fmtflags __flags = __is.flags(__is.flags() & ~std::ios_base::skipws); do { __is >> __c; if (!__is.good()) break; if (__c == __str._M_escape) { __is >> __c; if (!__is.good()) break; } else if (__c == __str._M_delim) break; __str._M_string += __c; } while (true); __is.setf(__flags); return __is; } _GLIBCXX_END_NAMESPACE_VERSION } // namespace __detail } // namespace std #endif // C++11 # 164 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/quoted_string.h" 3 #endif /* _GLIBCXX_QUOTED_STRING_H */ # 165 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/bits/quoted_string.h" 3 # 46 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/iomanip" 2 3 #endif # 47 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/iomanip" 3 #endif # 48 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/iomanip" 3 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION // [27.6.3] standard manipulators // Also see DR 183. struct _Resetiosflags { ios_base::fmtflags _M_mask; }; /** * @brief Manipulator for @c setf. * @param __mask A format flags mask. * * Sent to a stream object, this manipulator resets the specified flags, * via @e stream.setf(0,__mask). */ inline _Resetiosflags resetiosflags(ios_base::fmtflags __mask) { return { __mask }; } template inline basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, _Resetiosflags __f) { __is.setf(ios_base::fmtflags(0), __f._M_mask); return __is; } template inline basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, _Resetiosflags __f) { __os.setf(ios_base::fmtflags(0), __f._M_mask); return __os; } struct _Setiosflags { ios_base::fmtflags _M_mask; }; /** * @brief Manipulator for @c setf. * @param __mask A format flags mask. * * Sent to a stream object, this manipulator sets the format flags * to @a __mask. */ inline _Setiosflags setiosflags(ios_base::fmtflags __mask) { return { __mask }; } template inline basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, _Setiosflags __f) { __is.setf(__f._M_mask); return __is; } template inline basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, _Setiosflags __f) { __os.setf(__f._M_mask); return __os; } struct _Setbase { int _M_base; }; /** * @brief Manipulator for @c setf. * @param __base A numeric base. * * Sent to a stream object, this manipulator changes the * @c ios_base::basefield flags to @c oct, @c dec, or @c hex when @a base * is 8, 10, or 16, accordingly, and to 0 if @a __base is any other value. */ inline _Setbase setbase(int __base) { return { __base }; } template inline basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, _Setbase __f) { __is.setf(__f._M_base == 8 ? ios_base::oct : __f._M_base == 10 ? ios_base::dec : __f._M_base == 16 ? ios_base::hex : ios_base::fmtflags(0), ios_base::basefield); return __is; } template inline basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, _Setbase __f) { __os.setf(__f._M_base == 8 ? ios_base::oct : __f._M_base == 10 ? ios_base::dec : __f._M_base == 16 ? ios_base::hex : ios_base::fmtflags(0), ios_base::basefield); return __os; } template struct _Setfill { _CharT _M_c; }; /** * @brief Manipulator for @c fill. * @param __c The new fill character. * * Sent to a stream object, this manipulator calls @c fill(__c) for that * object. */ template inline _Setfill<_CharT> setfill(_CharT __c) { return { __c }; } template inline basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, _Setfill<_CharT> __f) { __is.fill(__f._M_c); return __is; } template inline basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, _Setfill<_CharT> __f) { __os.fill(__f._M_c); return __os; } struct _Setprecision { int _M_n; }; /** * @brief Manipulator for @c precision. * @param __n The new precision. * * Sent to a stream object, this manipulator calls @c precision(__n) for * that object. */ inline _Setprecision setprecision(int __n) { return { __n }; } template inline basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, _Setprecision __f) { __is.precision(__f._M_n); return __is; } template inline basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, _Setprecision __f) { __os.precision(__f._M_n); return __os; } struct _Setw { int _M_n; }; /** * @brief Manipulator for @c width. * @param __n The new width. * * Sent to a stream object, this manipulator calls @c width(__n) for * that object. */ inline _Setw setw(int __n) { return { __n }; } template inline basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, _Setw __f) { __is.width(__f._M_n); return __is; } template inline basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, _Setw __f) { __os.width(__f._M_n); return __os; } #if __cplusplus >= 201103L template struct _Get_money { _MoneyT& _M_mon; bool _M_intl; }; /** * @brief Extended manipulator for extracting money. * @param __mon Either long double or a specialization of @c basic_string. * @param __intl A bool indicating whether international format * is to be used. * * Sent to a stream object, this manipulator extracts @a __mon. */ template inline _Get_money<_MoneyT> get_money(_MoneyT& __mon, bool __intl = false) { return { __mon, __intl }; } template basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, _Get_money<_MoneyT> __f) { typename basic_istream<_CharT, _Traits>::sentry __cerb(__is, false); if (__cerb) { ios_base::iostate __err = ios_base::goodbit; __try { typedef istreambuf_iterator<_CharT, _Traits> _Iter; typedef money_get<_CharT, _Iter> _MoneyGet; const _MoneyGet& __mg = use_facet<_MoneyGet>(__is.getloc()); __mg.get(_Iter(__is.rdbuf()), _Iter(), __f._M_intl, __is, __err, __f._M_mon); } __catch(__cxxabiv1::__forced_unwind&) { __is._M_setstate(ios_base::badbit); __throw_exception_again; } __catch(...) { __is._M_setstate(ios_base::badbit); } if (__err) __is.setstate(__err); } return __is; } template struct _Put_money { const _MoneyT& _M_mon; bool _M_intl; }; /** * @brief Extended manipulator for inserting money. * @param __mon Either long double or a specialization of @c basic_string. * @param __intl A bool indicating whether international format * is to be used. * * Sent to a stream object, this manipulator inserts @a __mon. */ template inline _Put_money<_MoneyT> put_money(const _MoneyT& __mon, bool __intl = false) { return { __mon, __intl }; } template basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, _Put_money<_MoneyT> __f) { typename basic_ostream<_CharT, _Traits>::sentry __cerb(__os); if (__cerb) { ios_base::iostate __err = ios_base::goodbit; __try { typedef ostreambuf_iterator<_CharT, _Traits> _Iter; typedef money_put<_CharT, _Iter> _MoneyPut; const _MoneyPut& __mp = use_facet<_MoneyPut>(__os.getloc()); if (__mp.put(_Iter(__os.rdbuf()), __f._M_intl, __os, __os.fill(), __f._M_mon).failed()) __err |= ios_base::badbit; } __catch(__cxxabiv1::__forced_unwind&) { __os._M_setstate(ios_base::badbit); __throw_exception_again; } __catch(...) { __os._M_setstate(ios_base::badbit); } if (__err) __os.setstate(__err); } return __os; } template struct _Put_time { const std::tm* _M_tmb; const _CharT* _M_fmt; }; /** * @brief Extended manipulator for formatting time. * * This manipulator uses time_put::put to format time. * [ext.manip] * * @param __tmb struct tm time data to format. * @param __fmt format string. */ template inline _Put_time<_CharT> put_time(const std::tm* __tmb, const _CharT* __fmt) { return { __tmb, __fmt }; } template basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, _Put_time<_CharT> __f) { typename basic_ostream<_CharT, _Traits>::sentry __cerb(__os); if (__cerb) { ios_base::iostate __err = ios_base::goodbit; __try { typedef ostreambuf_iterator<_CharT, _Traits> _Iter; typedef time_put<_CharT, _Iter> _TimePut; const _CharT* const __fmt_end = __f._M_fmt + _Traits::length(__f._M_fmt); const _TimePut& __mp = use_facet<_TimePut>(__os.getloc()); if (__mp.put(_Iter(__os.rdbuf()), __os, __os.fill(), __f._M_tmb, __f._M_fmt, __fmt_end).failed()) __err |= ios_base::badbit; } __catch(__cxxabiv1::__forced_unwind&) { __os._M_setstate(ios_base::badbit); __throw_exception_again; } __catch(...) { __os._M_setstate(ios_base::badbit); } if (__err) __os.setstate(__err); } return __os; } template struct _Get_time { std::tm* _M_tmb; const _CharT* _M_fmt; }; /** * @brief Extended manipulator for extracting time. * * This manipulator uses time_get::get to extract time. * [ext.manip] * * @param __tmb struct to extract the time data to. * @param __fmt format string. */ template inline _Get_time<_CharT> get_time(std::tm* __tmb, const _CharT* __fmt) { return { __tmb, __fmt }; } template basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, _Get_time<_CharT> __f) { typename basic_istream<_CharT, _Traits>::sentry __cerb(__is, false); if (__cerb) { ios_base::iostate __err = ios_base::goodbit; __try { typedef istreambuf_iterator<_CharT, _Traits> _Iter; typedef time_get<_CharT, _Iter> _TimeGet; const _CharT* const __fmt_end = __f._M_fmt + _Traits::length(__f._M_fmt); const _TimeGet& __mg = use_facet<_TimeGet>(__is.getloc()); __mg.get(_Iter(__is.rdbuf()), _Iter(), __is, __err, __f._M_tmb, __f._M_fmt, __fmt_end); } __catch(__cxxabiv1::__forced_unwind&) { __is._M_setstate(ios_base::badbit); __throw_exception_again; } __catch(...) { __is._M_setstate(ios_base::badbit); } if (__err) __is.setstate(__err); } return __is; } #if __cplusplus > 201103L #define __cpp_lib_quoted_string_io 201304 /** * @brief Manipulator for quoted strings. * @param __string String to quote. * @param __delim Character to quote string with. * @param __escape Escape character to escape itself or quote character. */ template inline auto quoted(const _CharT* __string, _CharT __delim = _CharT('"'), _CharT __escape = _CharT('\\')) { return __detail::_Quoted_string(__string, __delim, __escape); } template inline auto quoted(const basic_string<_CharT, _Traits, _Alloc>& __string, _CharT __delim = _CharT('"'), _CharT __escape = _CharT('\\')) { return __detail::_Quoted_string< const basic_string<_CharT, _Traits, _Alloc>&, _CharT>( __string, __delim, __escape); } template inline auto quoted(basic_string<_CharT, _Traits, _Alloc>& __string, _CharT __delim = _CharT('"'), _CharT __escape = _CharT('\\')) { return __detail::_Quoted_string< basic_string<_CharT, _Traits, _Alloc>&, _CharT>( __string, __delim, __escape); } #endif // __cplusplus > 201103L # 489 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/iomanip" 3 #endif // __cplusplus >= 201103L # 491 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/iomanip" 3 // Inhibit implicit instantiations for required instantiations, // which are defined via explicit instantiations elsewhere. // NB: This syntax is a GNU extension. #if _GLIBCXX_EXTERN_TEMPLATE extern template ostream& operator<<(ostream&, _Setfill); extern template ostream& operator<<(ostream&, _Setiosflags); extern template ostream& operator<<(ostream&, _Resetiosflags); extern template ostream& operator<<(ostream&, _Setbase); extern template ostream& operator<<(ostream&, _Setprecision); extern template ostream& operator<<(ostream&, _Setw); extern template istream& operator>>(istream&, _Setfill); extern template istream& operator>>(istream&, _Setiosflags); extern template istream& operator>>(istream&, _Resetiosflags); extern template istream& operator>>(istream&, _Setbase); extern template istream& operator>>(istream&, _Setprecision); extern template istream& operator>>(istream&, _Setw); #ifdef _GLIBCXX_USE_WCHAR_T extern template wostream& operator<<(wostream&, _Setfill); extern template wostream& operator<<(wostream&, _Setiosflags); extern template wostream& operator<<(wostream&, _Resetiosflags); extern template wostream& operator<<(wostream&, _Setbase); extern template wostream& operator<<(wostream&, _Setprecision); extern template wostream& operator<<(wostream&, _Setw); extern template wistream& operator>>(wistream&, _Setfill); extern template wistream& operator>>(wistream&, _Setiosflags); extern template wistream& operator>>(wistream&, _Resetiosflags); extern template wistream& operator>>(wistream&, _Setbase); extern template wistream& operator>>(wistream&, _Setprecision); extern template wistream& operator>>(wistream&, _Setw); #endif # 523 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/iomanip" 3 #endif # 524 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/iomanip" 3 _GLIBCXX_END_NAMESPACE_VERSION } // namespace #endif /* _GLIBCXX_IOMANIP */ # 529 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/iomanip" 3 # 1080 "./OFM.cpp" 2 template inline void Log(const __m256i & value) { const size_t n = sizeof(__m256i) / sizeof(T); T buffer[n]; _mm256_storeu_si256((__m256i*)buffer, value); for (int i = 0; i < n; i++) std::cout << buffer[i] << " "; printf("\n"); } // TODO jump to next leaf std::vector OFM::sparse_matrix_vector_multiplication(std::vector const &v) { node_lock.lock_shared(); // edges.list_lock.lock_shared(); std::vector result(nodes.size(), 0); int num_vertices = nodes.size(); cilk_for (int i = 0; i < num_vertices; i++) { // printf("i: %d\n", i); // +1 to avoid sentinel uint32_t j = nodes[i].beginning + 1; int current_lock_index = find_lock_index(&edges, j); edges.lock_array[current_lock_index].lock_shared(); while (j < nodes[i].end) { //if (!is_null(edges.items[j])) { result[i] += edges.items[j].value * v[edges.items[j].dest]; j++; int new_lock_index = find_lock_index(&edges, j); if(new_lock_index > current_lock_index) { edges.lock_array[new_lock_index].lock_shared(); edges.lock_array[current_lock_index].unlock_shared(); current_lock_index = new_lock_index; } // } else { // j = next_leaf(j, edges.logN); // } } edges.lock_array[current_lock_index].unlock_shared(); } // edges.list_lock.unlock_shared(); node_lock.unlock_shared(); return result; } //TODO deal with locks std::vector OFM::sparse_matrix_vector_multiplication_with_hand_vec(std::vector const &v) { std::vector result(nodes.size(), 0); uint32_t num_vertices = nodes.size(); // bool vector = false; for (uint32_t i = 0; i < num_vertices; i++) { // printf("i: %d\n", i); // +1 to avoid sentinel uint32_t j = nodes[i].beginning + 1; // __m256i temp_sum = _mm256_setzero_si256(); while (j < nodes[i].end) { // if (!vector || (nodes[i].end - j < 4 || j >= next_leaf(j, edges.logN)-4)) { //if (!is_null(edges.items[j])) { result[i] += edges.items[j].value * v[edges.items[j].dest]; j++; } // } else { // j = next_leaf(j, edges.logN); // } /* } else { __m256i edgegroup = _mm256_loadu_si256((__m256i*) &edges.items[j]); __m256i values_group = _mm256_srli_epi64(edgegroup, 32); __m256i mask = _mm256_setr_epi64x(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF); __m256i dest_group_targets = _mm256_and_si256(edgegroup, mask); __m256i dest_group = _mm256_i32gather_epi32((int*)v.data(), dest_group_targets, sizeof(v[0])); __m256i partial_sums = _mm256_mul_epi32(dest_group, values_group); temp_sum = _mm256_add_epi64(temp_sum, partial_sums); //temp_sums = _mm256_and_si256(temp_sums, mask); __m256i mask2 = _mm256_setr_epi64x(0xFFFFFFFFFFFFFFFFUL, 0xFFFFFFFFFFFFFFFFUL, 0xFFFFFFFFFFFFFFFFUL, 0xFFFFFFFF00000000UL); if (_mm256_testc_si256(mask2, edgegroup)) { j = next_leaf(j, edges.logN); } else { j+=4; } } } if (vector) { result[i] += _mm256_extract_epi32(temp_sum, 0); result[i] += _mm256_extract_epi32(temp_sum, 2); result[i] += _mm256_extract_epi32(temp_sum, 4); result[i] += _mm256_extract_epi32(temp_sum, 6); } */ } return result; } void OFM::print_graph() { uint32_t num_vertices = nodes.size(); for (uint32_t i = 0; i < num_vertices; i++) { // printf("i: %d\n", i); // +1 to avoid sentinel uint32_t matrix_index = 0; for (uint32_t j = nodes[i].beginning + 1; j < nodes[i].end; j++) { if (!is_null(edges.items[j])) { while (matrix_index < edges.items[j].dest) { printf("000 "); matrix_index++; } printf("%03d ", edges.items[j].value); matrix_index++; } } for (uint32_t j = matrix_index; j < num_vertices; j++) { printf("000 "); } printf("\n"); } } // add a node to the graph void OFM::add_node() { node_lock.lock(); node_t node; uint32_t len = nodes.size(); edge_t sentinel; sentinel.dest = UINT32_MAX; // placeholder sentinel.value = len; // back pointer if (len > 0) { node.beginning = nodes[len - 1].end; node.end = node.beginning + 1; } else { node.beginning = 0; node.end = 1; sentinel.value = UINT32_MAX; } // printf("sentinel dest: %u, value: %u\n", sentinel.dest, sentinel.value); node.num_neighbors = 0; nodes.push_back(node); // edges.list_lock.lock_shared(); node_lock.make_shared(); uint32_t loc = node.beginning; while (!edges.lock_array[find_lock_index(&edges, loc)].lock()) { printf("spining in add_node\n"); usleep(10000); } insert(loc, sentinel, nodes.size() - 1); // printf("end of insert reason: %d\n", edges.lock_array[find_lock_index(&edges, loc)].reason); // edges.list_lock.unlock_shared(); node_lock.unlock_shared(); // print_array(); } //TODO deal with the case that multiple threads do the binary search and try and make the same region exclusive void OFM::add_edge(uint32_t src, uint32_t dest, uint32_t value) { // printf("src = %d, dest = %d, val = %d\n", src,dest,value); if (value != 0) { node_lock.lock_shared(); nodes[src].lock.lock(); node_t node = nodes[src]; edge_t e; e.dest = dest; e.value = value; // edges.list_lock.lock_shared(); uint32_t node_begin = node.beginning; uint32_t node_end = node.end; printf("range of worker %lu grabbing locks: begin at %d, end at %d\n", get_worker_num(), find_lock_index(&edges, node_begin + 1), find_lock_index(&edges, node_end)); for(int i = find_lock_index(&edges, node_begin + 1); i <= find_lock_index(&edges, node_end); i++) { if (!edges.lock_array[i].lock()) { printf("spining in add_edge\n"); usleep(10000); node_lock.unlock_shared(); nodes[src].lock.unlock(); add_edge(src,dest,value); return; } printf("grabbing lock %d by worker %lu\n", i, get_worker_num()); } // if(node_begin != nodes[src].beginning || nodes[src].end != node_end) { // for(int i = find_lock_index(&edges, node_begin + 1); i <= find_lock_index(&edges, node_end); i++) { // edges.lock_array[i].unlock(); // } // printf("spining in add_edge\n"); // usleep(10000); // node_lock.unlock_shared(); // nodes[src].lock.unlock(); // add_edge(src,dest,value); // return; // } __sync_fetch_and_add(&nodes[src].num_neighbors,1); // printf("looking in region %u, %u by worker %lu\n", node.beginning + 1, node.end, get_worker_num()); uint32_t loc_to_add = binary_search(&edges, &e, node.beginning + 1, node.end); // print_array(); //printf("loc_to_add: %d by worker %lu\n", loc_to_add, get_worker_num()); // printf("src: %d, dest: %d by worker %lu\n", src, dest, get_worker_num()); // print_array(); printf("range of worker %lu releasing locks: begin at %d, end at %d\n", get_worker_num(), find_lock_index(&edges, node_begin + 1), find_lock_index(&edges, node_end)); for(int i = find_lock_index(&edges, node.beginning + 1); i <= find_lock_index(&edges, node.end); i++) { if (i != find_lock_index(&edges, loc_to_add)) { edges.lock_array[i].unlock(); printf("releasing lock %d by worker %lu\n", i, get_worker_num()); } } uint32_t want_lock = find_lock_index(&edges, loc_to_add); printf("want lock %d by worker %lu\n", want_lock, get_worker_num()); if (!edges.lock_array[find_lock_index(&edges, loc_to_add)].i_own_lock()) { edges.lock_array[find_lock_index(&edges, loc_to_add)].print(); } assert(edges.lock_array[find_lock_index(&edges, loc_to_add)].i_own_lock()); insert(loc_to_add, e, src); printf("done with want lock %d by worker %lu\n", want_lock, get_worker_num()); // edges.list_lock.unlock_shared(); //print_array(); node_lock.unlock_shared(); nodes[src].lock.unlock(); } } //TODO can't set edges to zero void OFM::add_edge_update(uint32_t src, uint32_t dest, uint32_t value) { node_lock.lock_shared(); if (value != 0) { node_t node = nodes[src]; edge_t e; e.dest = dest; e.value = value; // edges.list_lock.lock_shared(); for(int i = find_lock_index(&edges, node.beginning + 1); i <= find_lock_index(&edges, node.end); i++) { if (!edges.lock_array[i].lock()) { printf("spining in add_edge_update\n"); usleep(10000); node_lock.unlock_shared(); __sync_fetch_and_add(&nodes[src].num_neighbors,-1); add_edge(src,dest,value); return; } } uint32_t loc_to_add = binary_search(&edges, &e, node.beginning + 1, node.end); for(int i = find_lock_index(&edges, node.beginning + 1); i <= find_lock_index(&edges, node.end); i++) { if (i != find_lock_index(&edges, loc_to_add)) { edges.lock_array[i].unlock(); } } if (edges.items[loc_to_add].dest == dest && !is_null(edges.items[loc_to_add])) { edges.items[loc_to_add].value = value; edges.lock_array[find_lock_index(&edges, loc_to_add)].unlock(); // edges.list_lock.unlock_shared(); node_lock.unlock_shared(); return; } // printf("loc_to_add: %d\n", loc_to_add); // printf("src: %d, dest: %d\n", src, dest); __sync_fetch_and_add(&nodes[src].num_neighbors,1); // print_array(); insert(loc_to_add, e, src); // edges.list_lock.unlock_shared(); // print_array(); } node_lock.unlock_shared(); } OFM::OFM(uint32_t init_n) { edges.N = 2 << bsr_word(init_n); // printf("%d\n", bsf_word(list->N)); edges.logN = (1 << bsr_word(bsr_word(edges.N) + 1)); edges.density_limit = ((double) edges.logN - 1)/edges.logN; edges.H = bsr_word(edges.N / edges.logN); // printf("N = %d, logN = %d, loglogN = %d, H = %d\n", list->N, list->logN, // list->loglogN, list->H); // locks if (LOCK_LEVEL > edges.H -1) { edges.lock_level = edges.H-1; } else { edges.lock_level = LOCK_LEVEL; } edges.num_locks = edges.N / (edges.logN << edges.lock_level); Lock* lock_array = (Lock*)malloc(edges.num_locks * sizeof(Lock)); memset(lock_array, 0, edges.num_locks * sizeof(Lock)); edges.lock_array = lock_array; for (int i = 0; i < edges.num_locks ; i++) { lock_array[i].name("lockArray"); lock_array[i].number(i); } // edges.list_lock.name("listLock"); node_lock.name("nodeLock"); edges.items = (edge_t *)malloc(edges.N * sizeof(*(edges.items))); cilk_for (uint32_t i = 0; i < edges.N; i++) { edges.items[i].value = 0; edges.items[i].dest = 0; } for (uint32_t i = 0; i < init_n; i++) { add_node(); } } //TODO free lock array OFM::~OFM() { free((void*)edges.items); free((void*)edges.lock_array); } # 15 "test2.cpp" 2 #if 0 /* expanded by -frewrite-includes */ #include "CSR.cpp" #endif /* expanded by -frewrite-includes */ # 15 "test2.cpp" # 1 "./CSR.cpp" 1 /* * adjacency matrix */ #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 5 "./CSR.cpp" # 6 "./CSR.cpp" #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 6 "./CSR.cpp" # 7 "./CSR.cpp" #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 7 "./CSR.cpp" # 8 "./CSR.cpp" #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 8 "./CSR.cpp" # 9 "./CSR.cpp" #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 9 "./CSR.cpp" # 1 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstring" 1 3 // -*- C++ -*- forwarding header. // Copyright (C) 1997-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file cstring * This is a Standard C++ Library file. You should @c \#include this file * in your programs, rather than any of the @a *.h implementation files. * * This is the C++ version of the Standard C Library header @c string.h, * and its contents are (mostly) the same as that header, but are all * contained in the namespace @c std (except for names which are defined * as macros in C). */ // // ISO C++ 14882: 20.4.6 C library // #if 0 /* expanded by -frewrite-includes */ #pragma GCC system_header #endif /* expanded by -frewrite-includes */ # 40 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstring" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 41 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstring" 3 # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstring" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 42 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstring" 3 # 43 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstring" 3 #ifndef _GLIBCXX_CSTRING #define _GLIBCXX_CSTRING 1 // Get rid of those macros defined in in lieu of real functions. #undef memchr #undef memcmp #undef memcpy #undef memmove #undef memset #undef strcat #undef strchr #undef strcmp #undef strcoll #undef strcpy #undef strcspn #undef strerror #undef strlen #undef strncat #undef strncmp #undef strncpy #undef strpbrk #undef strrchr #undef strspn #undef strstr #undef strtok #undef strxfrm namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION using ::memchr; using ::memcmp; using ::memcpy; using ::memmove; using ::memset; using ::strcat; using ::strcmp; using ::strcoll; using ::strcpy; using ::strcspn; using ::strerror; using ::strlen; using ::strncat; using ::strncmp; using ::strncpy; using ::strspn; using ::strtok; using ::strxfrm; using ::strchr; using ::strpbrk; using ::strrchr; using ::strstr; #ifndef __CORRECT_ISO_CPP_STRING_H_PROTO inline void* memchr(void* __s, int __c, size_t __n) { return __builtin_memchr(__s, __c, __n); } inline char* strchr(char* __s, int __n) { return __builtin_strchr(__s, __n); } inline char* strpbrk(char* __s1, const char* __s2) { return __builtin_strpbrk(__s1, __s2); } inline char* strrchr(char* __s, int __n) { return __builtin_strrchr(__s, __n); } inline char* strstr(char* __s1, const char* __s2) { return __builtin_strstr(__s1, __s2); } #endif # 119 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstring" 3 _GLIBCXX_END_NAMESPACE_VERSION } // namespace #endif # 124 "/usr/lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstring" 3 # 10 "./CSR.cpp" 2 #if 0 /* expanded by -frewrite-includes */ #include "Graph.hpp" #endif /* expanded by -frewrite-includes */ # 11 "./CSR.cpp" # 12 "./CSR.cpp" class CSR : public Graph { public: // data members vector nodes; vector edges; vector values; // function headings CSR(uint32_t init_n); ~CSR(); uint64_t get_size(); uint64_t get_size_ideal(); uint64_t get_n(); uint32_t find_value(uint32_t src, uint32_t dest); uint32_t find_value_index(uint32_t src, uint32_t dest); vector sparse_matrix_vector_multiplication(std::vector const &v) __attribute__((noinline)); void print_graph(); void print_arrays(); void add_node(); void add_edge(uint32_t src, uint32_t dest, uint32_t value); void add_edge_update(uint32_t src, uint32_t dest, uint32_t value); void convert(Graph* g); vector pagerank(std::vector const &node_values); vector bfs(uint32_t start_node); void add_file3(string filename); vector > get_edges() { printf("get_edges not implemented for csr\n"); exit(1); } }; vector CSR::bfs(uint32_t start_node) { uint64_t n = get_n(); vector out (n, UINT32_MAX); queue next; // qzueue next.push(start_node); out[start_node] = 0; while(!next.empty()) { uint32_t active = next.front(); next.pop(); assert(out[active] != UINT32_MAX); uint32_t start = nodes[active]; uint32_t end; if(active < n - 1) { end = nodes[active+1]; } else { end = edges.size(); } for(uint32_t j = start; j < end; j++) { if(out[edges[j]] == UINT32_MAX) { next.push(edges[j]); out[edges[j]] = out[active] + 1; } } } return out; } vector CSR::pagerank(std::vector const &node_values) { uint64_t n = get_n(); vector output(n, 0); for(uint32_t i = 0; i < n; i++) { uint32_t start = nodes[i]; uint32_t end; if(i < n - 1) { end = nodes[i+1]; } else { end = edges.size(); } uint32_t num_neighbors = end - start; float contrib = (node_values[i] / num_neighbors); // printf("csr: i: %d, NUM NEIGHBORS: %d\n", i, num_neighbors); for(uint32_t j = start; j < end; j++) { output[edges[j]] += contrib; } } return output; } // for soc- // starting at 1 void CSR::add_file3(string filename) { vector> edges_to_add; ifstream myfile(filename.c_str()); string line; if (myfile.is_open()) { while ( getline (myfile,line) ) { vector elems = split(line, '\t'); int src = atoi(elems[0].c_str())-1; int dest = atoi(elems[1].c_str())-1; edges_to_add.push_back(make_tuple( src, dest, 1 )); // if (line_num++ > 400000000) { // break; // } } myfile.close(); // return 0; } else { printf("file was not opened\n"); } // populate edges sort(edges_to_add.begin(), edges_to_add.end()); uint32_t current_node = 0; for(uint32_t i = 0; i < edges_to_add.size(); i++) { uint32_t src = get<0>(edges_to_add[i]); uint32_t dest = get<1>(edges_to_add[i]); uint32_t val = get<2>(edges_to_add[i]); while (src >= current_node) { add_node(); current_node++; } edges.push_back(dest); values.push_back(val); } } void CSR::convert(Graph* g) { nodes.clear(); edges.clear(); values.clear(); vector > edges_to_add = g->get_edges(); // populate edges sort(edges_to_add.begin(), edges_to_add.end()); uint32_t current_node = 0; for(uint32_t i = 0; i < edges_to_add.size(); i++) { uint32_t src = get<0>(edges_to_add[i]); uint32_t dest = get<1>(edges_to_add[i]); uint32_t val = get<2>(edges_to_add[i]); while (src >= current_node) { add_node(); current_node++; } edges.push_back(dest); values.push_back(val); } } uint64_t CSR::get_n() { return nodes.size(); } uint64_t CSR::get_size() { return (nodes.capacity() + edges.capacity() + values.capacity()) * sizeof(uint32_t); } uint64_t CSR::get_size_ideal() { return (nodes.size() + edges.size() + values.size()) * sizeof(uint32_t); } void CSR::print_arrays() { printf("NODES\n"); for(uint32_t i = 0; i < nodes.size(); i++) { printf("%d ", nodes[i]); } printf("\nEDGES\n"); for(uint32_t i = 0; i < edges.size(); i++) { printf("%d ", edges[i]); } printf("\nVALUES\n"); for(uint32_t i = 0; i < values.size(); i++) { printf("%d ", values[i]); } printf("\n"); } // find value of (src, dest) uint32_t CSR::find_value(uint32_t src, uint32_t dest) { uint32_t end = 0; if (src == nodes.size() - 1) { end = edges.size(); } else { end = nodes[src + 1]; } uint32_t start = nodes[src]; if(nodes[src] == end) { return 0; } if(edges[start] == dest) { return values[start]; } while (start + 1 < end) { uint32_t mid = (start + end) / 2; if (edges[mid] == dest) { return values[mid]; } else if (edges[mid] > dest) { end = mid; } else { start = mid; } } // not found return 0; } uint32_t CSR::find_value_index(uint32_t src, uint32_t dest) { uint32_t end = 0; if (src == nodes.size() - 1) { end = edges.size(); } else { end = nodes[src + 1]; } uint32_t start = nodes[src]; if(nodes[src] == end) { return UINT32_MAX; } if(edges[start] == dest) { return start; } while (start + 1 < end) { uint32_t mid = (start + end) / 2; if (edges[mid] == dest) { return mid; } else if (edges[mid] > dest) { end = mid; } else { start = mid; } } // not found return UINT32_MAX; } void CSR::add_node() { nodes.push_back(edges.size()); } // src, dest < N void CSR::add_edge(uint32_t src, uint32_t dest, uint32_t value) { uint32_t end = 0; if (src == nodes.size() - 1) { end = edges.size(); } else { end = nodes[src + 1]; } uint32_t start = nodes[src]; //printf("start = %d, end = %d\n", start, end); if(edges.size() == 0) { edges.push_back(dest); values.push_back(value); for(uint32_t i = src + 1; i < nodes.size(); i++) { nodes[i]++; } return; } if (dest < edges[start] || start == end) { edges.insert(edges.begin() + start, dest); values.insert(values.begin() + start, value); for(uint32_t i = src + 1; i < nodes.size(); i++) { nodes[i]++; } return; } else if (end == 0 || dest > edges[end - 1]) { edges.insert(edges.begin() + end, dest); values.insert(values.begin() + end, value); for(uint32_t i = src + 1; i < nodes.size(); i++) { nodes[i]++; } return; } // could be optimized by making it a binary search // but it doesn't change the complexity else { for (uint32_t i = start; i < end; i++) { if (edges[i] > dest) { edges.insert(edges.begin() + i, dest); values.insert(values.begin() + i, value); break; } else if (edges[i] == dest) { values[i] = value; return; } } for(uint32_t i = src + 1; i < nodes.size(); i++) { nodes[i]++; } } } void CSR::add_edge_update(uint32_t src, uint32_t dest, uint32_t value) { uint32_t index = find_value_index(src, dest); if (index < UINT32_MAX) { values[index] = value; return; } uint32_t end = 0; if (src == nodes.size() - 1) { end = edges.size(); } else { end = nodes[src + 1]; } uint32_t start = nodes[src]; //printf("start = %d, end = %d\n", start, end); if(edges.size() == 0) { edges.push_back(dest); values.push_back(value); for(uint32_t i = src + 1; i < nodes.size(); i++) { nodes[i]++; } return; } if (dest < edges[start] || start == end) { edges.insert(edges.begin() + start, dest); values.insert(values.begin() + start, value); for(uint32_t i = src + 1; i < nodes.size(); i++) { nodes[i]++; } return; } else if (end == 0 || dest > edges[end - 1]) { edges.insert(edges.begin() + end, dest); values.insert(values.begin() + end, value); for(uint32_t i = src + 1; i < nodes.size(); i++) { nodes[i]++; } return; } // could be optimized by making it a binary search // but it doesn't change the complexity else { for (uint32_t i = start; i < end; i++) { if (edges[i] > dest) { edges.insert(edges.begin() + i, dest); values.insert(values.begin() + i, value); break; } else if (edges[i] == dest) { values[i] = value; return; } } for(uint32_t i = src + 1; i < nodes.size(); i++) { nodes[i]++; } } } void CSR::print_graph() { for(uint32_t i = 0; i < nodes.size(); i++) { vector edgelist(nodes.size(), 0); uint32_t end = 0; if (i == nodes.size() - 1) { end = edges.size(); } else { end = nodes[i + 1]; } uint32_t start = nodes[i]; for(uint32_t j = start; j < end; j++) { edgelist[edges[j]] = values[j]; } for(uint32_t j = 0; j < nodes.size(); j++) { printf("%03d ", edgelist[j]); } printf("\n"); } } // constructor CSR::CSR(uint32_t init_n) { for(uint32_t i = 0; i < init_n; i++) { add_node(); } } CSR::~CSR() { } std::vector CSR::sparse_matrix_vector_multiplication(std::vector const &v) { std::vector result(nodes.size(), 0); for(uint32_t i = 0; i < nodes.size(); i++) { uint32_t end = 0; if (i == nodes.size() - 1) { end = edges.size(); } else { end = nodes[i + 1]; } uint32_t start = nodes[i]; for(uint32_t j = start; j < end; j++) { result[i] += values[j] * v[edges[j]]; } } return result; } /* int main() { // graph_t g; // setup(&g); CSR g = CSR(5); while (1) { uint32_t src, dest, value; scanf("%d %d %d", &src, &dest, &value); // printf("src:%d, dst: %d, val:%d\n", src, dest, value); g.add_edge(src, dest, value); g.print_graph(); std::vector temp; temp.push_back(10); temp.push_back(1); temp.push_back(0); temp.push_back(0); temp.push_back(10); std::vector res = g.sparse_matrix_vector_multiplication(temp); for(int i = 0; i < 5; i++) { printf("%d ", res[i]); } printf("\n"); } } */ # 16 "test2.cpp" 2 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 16 "test2.cpp" # 1 "/usr/include/x86_64-linux-gnu/sys/time.h" 1 3 4 /* Copyright (C) 1991-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #ifndef _SYS_TIME_H #define _SYS_TIME_H 1 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 21 "/usr/include/x86_64-linux-gnu/sys/time.h" 3 4 # 22 "/usr/include/x86_64-linux-gnu/sys/time.h" 3 4 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 23 "/usr/include/x86_64-linux-gnu/sys/time.h" 3 4 # 24 "/usr/include/x86_64-linux-gnu/sys/time.h" 3 4 #define __need_time_t #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 25 "/usr/include/x86_64-linux-gnu/sys/time.h" 3 4 # 26 "/usr/include/x86_64-linux-gnu/sys/time.h" 3 4 #define __need_timeval #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 27 "/usr/include/x86_64-linux-gnu/sys/time.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/time.h" 1 3 4 /* System-dependent timing definitions. Linux version. Copyright (C) 1996-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ /* * Never include this file directly; use instead. */ #if defined __need_timeval || defined __USE_GNU # ifndef _STRUCT_TIMEVAL # define _STRUCT_TIMEVAL 1 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 26 "/usr/include/x86_64-linux-gnu/bits/time.h" 3 4 # 27 "/usr/include/x86_64-linux-gnu/bits/time.h" 3 4 /* A time value that is accurate to the nearest microsecond but also has a range of years. */ struct timeval { __time_t tv_sec; /* Seconds. */ __suseconds_t tv_usec; /* Microseconds. */ }; # endif /* struct timeval */ # 36 "/usr/include/x86_64-linux-gnu/bits/time.h" 3 4 #endif # 37 "/usr/include/x86_64-linux-gnu/bits/time.h" 3 4 #ifndef __need_timeval # ifndef _BITS_TIME_H # define _BITS_TIME_H 1 /* ISO/IEC 9899:1990 7.12.1: The macro `CLOCKS_PER_SEC' is the number per second of the value returned by the `clock' function. */ /* CAE XSH, Issue 4, Version 2: The value of CLOCKS_PER_SEC is required to be 1 million on all XSI-conformant systems. */ # define CLOCKS_PER_SEC 1000000l # if (!defined __STRICT_ANSI__ || defined __USE_POSIX) \ && !defined __USE_XOPEN2K /* Even though CLOCKS_PER_SEC has such a strange value CLK_TCK presents the real value for clock ticks per second for the system. */ #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 54 "/usr/include/x86_64-linux-gnu/bits/time.h" 3 4 # 55 "/usr/include/x86_64-linux-gnu/bits/time.h" 3 4 extern long int __sysconf (int); # define CLK_TCK ((__clock_t) __sysconf (2)) /* 2 is _SC_CLK_TCK */ # endif # 58 "/usr/include/x86_64-linux-gnu/bits/time.h" 3 4 # ifdef __USE_POSIX199309 /* Identifier for system-wide realtime clock. */ # define CLOCK_REALTIME 0 /* Monotonic system-wide clock. */ # define CLOCK_MONOTONIC 1 /* High-resolution timer from the CPU. */ # define CLOCK_PROCESS_CPUTIME_ID 2 /* Thread-specific CPU-time clock. */ # define CLOCK_THREAD_CPUTIME_ID 3 /* Monotonic system-wide clock, not adjusted for frequency scaling. */ # define CLOCK_MONOTONIC_RAW 4 /* Identifier for system-wide realtime clock, updated only on ticks. */ # define CLOCK_REALTIME_COARSE 5 /* Monotonic system-wide clock, updated only on ticks. */ # define CLOCK_MONOTONIC_COARSE 6 /* Monotonic system-wide clock that includes time spent in suspension. */ # define CLOCK_BOOTTIME 7 /* Like CLOCK_REALTIME but also wakes suspended system. */ # define CLOCK_REALTIME_ALARM 8 /* Like CLOCK_BOOTTIME but also wakes suspended system. */ # define CLOCK_BOOTTIME_ALARM 9 /* Flag to indicate time is absolute. */ # define TIMER_ABSTIME 1 # endif # 84 "/usr/include/x86_64-linux-gnu/bits/time.h" 3 4 # ifdef __USE_GNU #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 86 "/usr/include/x86_64-linux-gnu/bits/time.h" 3 4 # 87 "/usr/include/x86_64-linux-gnu/bits/time.h" 3 4 __BEGIN_DECLS /* Tune a POSIX clock. */ extern int clock_adjtime (__clockid_t __clock_id, struct timex *__utx) __THROW; __END_DECLS # endif /* use GNU */ # 95 "/usr/include/x86_64-linux-gnu/bits/time.h" 3 4 # endif /* bits/time.h */ # 97 "/usr/include/x86_64-linux-gnu/bits/time.h" 3 4 #endif # 98 "/usr/include/x86_64-linux-gnu/bits/time.h" 3 4 #undef __need_timeval # 28 "/usr/include/x86_64-linux-gnu/sys/time.h" 2 3 4 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 29 "/usr/include/x86_64-linux-gnu/sys/time.h" 3 4 # 30 "/usr/include/x86_64-linux-gnu/sys/time.h" 3 4 #ifndef __suseconds_t_defined typedef __suseconds_t suseconds_t; # define __suseconds_t_defined #endif # 35 "/usr/include/x86_64-linux-gnu/sys/time.h" 3 4 __BEGIN_DECLS #ifdef __USE_GNU /* Macros for converting between `struct timeval' and `struct timespec'. */ # define TIMEVAL_TO_TIMESPEC(tv, ts) { \ (ts)->tv_sec = (tv)->tv_sec; \ (ts)->tv_nsec = (tv)->tv_usec * 1000; \ } # define TIMESPEC_TO_TIMEVAL(tv, ts) { \ (tv)->tv_sec = (ts)->tv_sec; \ (tv)->tv_usec = (ts)->tv_nsec / 1000; \ } #endif # 50 "/usr/include/x86_64-linux-gnu/sys/time.h" 3 4 #ifdef __USE_BSD /* Structure crudely representing a timezone. This is obsolete and should never be used. */ struct timezone { int tz_minuteswest; /* Minutes west of GMT. */ int tz_dsttime; /* Nonzero if DST is ever in effect. */ }; typedef struct timezone *__restrict __timezone_ptr_t; #else # 63 "/usr/include/x86_64-linux-gnu/sys/time.h" 3 4 typedef void *__restrict __timezone_ptr_t; #endif # 65 "/usr/include/x86_64-linux-gnu/sys/time.h" 3 4 /* Get the current time of day and timezone information, putting it into *TV and *TZ. If TZ is NULL, *TZ is not filled. Returns 0 on success, -1 on errors. NOTE: This form of timezone information is obsolete. Use the functions and variables declared in instead. */ extern int gettimeofday (struct timeval *__restrict __tv, __timezone_ptr_t __tz) __THROW __nonnull ((1)); #ifdef __USE_BSD /* Set the current time of day and timezone information. This call is restricted to the super-user. */ extern int settimeofday (const struct timeval *__tv, const struct timezone *__tz) __THROW; /* Adjust the current time of day by the amount in DELTA. If OLDDELTA is not NULL, it is filled in with the amount of time adjustment remaining to be done from the last `adjtime' call. This call is restricted to the super-user. */ extern int adjtime (const struct timeval *__delta, struct timeval *__olddelta) __THROW; #endif # 88 "/usr/include/x86_64-linux-gnu/sys/time.h" 3 4 /* Values for the first argument to `getitimer' and `setitimer'. */ enum __itimer_which { /* Timers run in real time. */ ITIMER_REAL = 0, #define ITIMER_REAL ITIMER_REAL /* Timers run only when the process is executing. */ ITIMER_VIRTUAL = 1, #define ITIMER_VIRTUAL ITIMER_VIRTUAL /* Timers run when the process is executing and when the system is executing on behalf of the process. */ ITIMER_PROF = 2 #define ITIMER_PROF ITIMER_PROF }; /* Type of the second argument to `getitimer' and the second and third arguments `setitimer'. */ struct itimerval { /* Value to put into `it_value' when the timer expires. */ struct timeval it_interval; /* Time to the next timer expiration. */ struct timeval it_value; }; #if defined __USE_GNU && !defined __cplusplus /* Use the nicer parameter type only in GNU mode and not for C++ since the strict C++ rules prevent the automatic promotion. */ typedef enum __itimer_which __itimer_which_t; #else # 120 "/usr/include/x86_64-linux-gnu/sys/time.h" 3 4 typedef int __itimer_which_t; #endif # 122 "/usr/include/x86_64-linux-gnu/sys/time.h" 3 4 /* Set *VALUE to the current setting of timer WHICH. Return 0 on success, -1 on errors. */ extern int getitimer (__itimer_which_t __which, struct itimerval *__value) __THROW; /* Set the timer WHICH to *NEW. If OLD is not NULL, set *OLD to the old value of timer WHICH. Returns 0 on success, -1 on errors. */ extern int setitimer (__itimer_which_t __which, const struct itimerval *__restrict __new, struct itimerval *__restrict __old) __THROW; /* Change the access time of FILE to TVP[0] and the modification time of FILE to TVP[1]. If TVP is a null pointer, use the current time instead. Returns 0 on success, -1 on errors. */ extern int utimes (const char *__file, const struct timeval __tvp[2]) __THROW __nonnull ((1)); #ifdef __USE_BSD /* Same as `utimes', but does not follow symbolic links. */ extern int lutimes (const char *__file, const struct timeval __tvp[2]) __THROW __nonnull ((1)); /* Same as `utimes', but takes an open file descriptor instead of a name. */ extern int futimes (int __fd, const struct timeval __tvp[2]) __THROW; #endif # 149 "/usr/include/x86_64-linux-gnu/sys/time.h" 3 4 #ifdef __USE_GNU /* Change the access time of FILE relative to FD to TVP[0] and the modification time of FILE to TVP[1]. If TVP is a null pointer, use the current time instead. Returns 0 on success, -1 on errors. */ extern int futimesat (int __fd, const char *__file, const struct timeval __tvp[2]) __THROW; #endif # 157 "/usr/include/x86_64-linux-gnu/sys/time.h" 3 4 #ifdef __USE_BSD /* Convenience macros for operations on timevals. NOTE: `timercmp' does not work for >= or <=. */ # define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec) # define timerclear(tvp) ((tvp)->tv_sec = (tvp)->tv_usec = 0) # define timercmp(a, b, CMP) \ (((a)->tv_sec == (b)->tv_sec) ? \ ((a)->tv_usec CMP (b)->tv_usec) : \ ((a)->tv_sec CMP (b)->tv_sec)) # define timeradd(a, b, result) \ do { \ (result)->tv_sec = (a)->tv_sec + (b)->tv_sec; \ (result)->tv_usec = (a)->tv_usec + (b)->tv_usec; \ if ((result)->tv_usec >= 1000000) \ { \ ++(result)->tv_sec; \ (result)->tv_usec -= 1000000; \ } \ } while (0) # define timersub(a, b, result) \ do { \ (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \ (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \ if ((result)->tv_usec < 0) { \ --(result)->tv_sec; \ (result)->tv_usec += 1000000; \ } \ } while (0) #endif /* BSD */ # 188 "/usr/include/x86_64-linux-gnu/sys/time.h" 3 4 __END_DECLS #endif /* sys/time.h */ # 192 "/usr/include/x86_64-linux-gnu/sys/time.h" 3 4 # 17 "test2.cpp" 2 #define MAXVAL 100 #define batch_size 10 /* static uint32_t x = 123456789; static uint32_t y = 362436069; static uint32_t z = 521288629; static uint32_t w = 88675123; uint32_t xor128(void) { uint32_t t; t = x ^ (x << 11); x = y; y = z; z = w; return w = w ^ (w >> 19) ^ (t ^ (t >> 8)); } void srand() { x = 123456789; y = 362436069; z = 521288629; w = 88675123; } */ uint32_t rand_in_range(uint32_t max) { return rand() % max; } bool compare_matrices(Graph *g1, Graph *g2, int num_nodes) { for(int i = 0; i < num_nodes; i++) { for(int j = 0; j < num_nodes; j++) { if ( g1->find_value(i, j) != g2->find_value(i, j)) { printf("i: %d, j: %d, g1_val: %d, g2_vl: %d\n", i, j, g1->find_value(i, j), g2->find_value(i, j)); if (j+1 < num_nodes) { printf("i: %d, j: %d, g1_val: %d, g2_vl: %d\n", i, j+1, g1->find_value(i, j+1), g2->find_value(i, j+1)); } if (j-1 >=0 ) { printf("i: %d, j: %d, g1_val: %d, g2_vl: %d\n", i, j-1, g1->find_value(i, j-1), g2->find_value(i, j-1)); } return false; } } } return true; } bool verify_pcsr() { srand(0); uint32_t node_counts[4] = {5, 10, 100}; uint32_t edge_counts[4] = {5, 20, 1000}; int trials = 100; for (int a = 0; a < 3; a++) { for (int j = 0; j < trials; j++) { printf("starting trial %d out of %d\n", j, trials); uint32_t num_nodes = node_counts[a]; uint32_t num_edges = edge_counts[a]; AdjacencyMatrix matrix = AdjacencyMatrix(num_nodes); OFM* ofm = new OFM(num_nodes); uint32_t srcs[batch_size] = {0}; uint32_t dests[batch_size] = {0}; uint32_t vals[batch_size] = {0}; for (uint32_t i = 0; i <= num_edges/batch_size; i++) { for(uint32_t b = 0; b < batch_size; b++) { uint32_t src = rand_in_range(num_nodes); uint32_t dest = rand_in_range(num_nodes); while(matrix.find_value(src, dest) != 0) { src = rand_in_range(num_nodes); dest = rand_in_range(num_nodes); } uint32_t val = rand_in_range(MAXVAL)+1; matrix.add_edge(src, dest, val); srcs[b] = src; dests[b] = dest; vals[b] = val; } cilk_for(uint32_t b = 0; b < batch_size; b++) { printf("adding edge %d, %d, %d by worker %d\n",srcs[b], dests[b], vals[b], get_worker_num()); ofm->add_edge(srcs[b], dests[b], vals[b]); ofm->print_array(get_worker_num()); } assert(ofm->check_no_locks()); } if (!compare_matrices(&matrix, ofm, num_nodes)) { printf("iter = %d, ", j); printf("failed in add edges, nodes = %u, edges = %u\n", num_nodes, num_edges); matrix.print_graph(); printf("\n"); ofm->print_graph(); printf("\n"); ofm->print_array(); return false; } for (uint32_t k = 0; k < num_edges*10; k++) { uint32_t src = rand_in_range(num_nodes); uint32_t dest = rand_in_range(num_nodes); uint32_t val = rand_in_range(MAXVAL)+1; //printf("addding edge %d, %d, %d\n",src, dest, val); // matrix.add_edge_update(src, dest, val); // ofm->add_edge_update(src, dest, val); //ofm->print_array(); assert(ofm->check_no_locks()); } if (!compare_matrices(&matrix, ofm, num_nodes)) { printf("iter = %d, ", j); printf("failed in add edges update, nodes = %u, edges = %u\n", num_nodes, num_edges); matrix.print_graph(); printf("\n"); ofm->print_graph(); printf("\n"); ofm->print_array(); return false; } vector test_vector(num_nodes, 0); for(uint32_t i = 0; i < num_nodes; i++) { test_vector[i] = rand_in_range(MAXVAL); } vector r1 = matrix.sparse_matrix_vector_multiplication(test_vector); vector r2 = ofm->sparse_matrix_vector_multiplication(test_vector); assert(ofm->check_no_locks()); if (r1 != r2) { printf("iter = %d, ", j); printf("failed spvm, nodes = %u, edges = %u\n", num_nodes, num_edges); for (auto const& c : r1) { printf("%d ", c); } printf("\n"); for (auto const& c : r2) { printf("%d ", c); } printf("\n"); return false; } int start_node = rand_in_range(num_nodes); vector r3 = matrix.bfs(start_node); vector r4 = ofm->bfs(start_node); assert(ofm->check_no_locks()); if (r3 != r4) { printf("iter = %d, ", j); printf("failed bfs, nodes = %u, edges = %u\n", num_nodes, num_edges); matrix.print_graph(); printf("\n"); ofm->print_graph(); for (auto const& c : r3) { printf("%d ", c); } printf("\n"); for (auto const& c : r4) { printf("%d ", c); } printf("\n"); return false; } vector test_vector2(num_nodes, 0); for(uint32_t i = 0; i < num_nodes; i++) { test_vector2[i] = ((float)rand_in_range(MAXVAL))/ MAXVAL; } vector r5 = matrix.pagerank(test_vector2); vector r6 = ofm->pagerank(test_vector2); assert(ofm->check_no_locks()); if (r5 != r6) { printf("iter = %d, ", j); printf("failed pagerank, nodes = %u, edges = %u\n", num_nodes, num_edges); matrix.print_graph(); printf("\n"); ofm->print_graph(); ofm->print_array(); for (auto const& c : test_vector2) { printf("%f ", c); } printf("\n"); for (auto const& c : r5) { printf("%f ", c); } printf("\n"); for (auto const& c : r6) { printf("%f ", c); } printf("\n"); return false; } } } return true; } bool time_pcsr(uint32_t num_nodes, uint32_t num_edges, int trials) { srand(0); struct timeval start, end; uint32_t duration; for (int j = 0; j < trials; j++) { gettimeofday(&start, NULL); OFM* ofm = new OFM(num_nodes); gettimeofday(&end, NULL); duration = (end.tv_sec-start.tv_sec)*1000000u+(end.tv_usec-start.tv_usec); printf("created structure in %u\n", duration); gettimeofday(&start, NULL); uint32_t srcs[batch_size] = {0}; uint32_t dests[batch_size] = {0}; uint32_t vals[batch_size] = {0}; for (uint32_t k = 0; k <= num_edges/batch_size; k++) { for (int i = 0; i < batch_size; i++) { srcs[i] = rand_in_range(num_nodes); dests[i] = rand_in_range(num_nodes); vals[i] = rand_in_range(MAXVAL)+1; } cilk_for (int i = 0; i < batch_size; i++) { ofm->add_edge_update(srcs[i], dests[i], vals[i]); } } gettimeofday(&end, NULL); duration = (end.tv_sec-start.tv_sec)*1000000u+(end.tv_usec-start.tv_usec); printf("add edge update in in %u\n", duration); vector test_vector(num_nodes, 0); for(uint32_t i = 0; i < num_nodes; i++) { test_vector[i] = rand_in_range(MAXVAL); } gettimeofday(&start, NULL); for (int spvm_iters = 0; spvm_iters < 100; spvm_iters++) { test_vector = ofm->sparse_matrix_vector_multiplication(test_vector); } gettimeofday(&end, NULL); duration = (end.tv_sec-start.tv_sec)*1000000u+(end.tv_usec-start.tv_usec); printf("spvm in in %d\n", duration); printf("spvm[0] = %d\n", test_vector[0]); /* gettimeofday(&start, NULL); int start_node = rand_in_range(num_nodes); for (int bfs_iters = 0; bfs_iters < 100; bfs_iters++) { vector r4 = ofm.bfs(start_node); start_node = r4[0]; } gettimeofday(&end, NULL); duration = (end.tv_sec-start.tv_sec)*1000000u+(end.tv_usec-start.tv_usec); printf("bfs in in %d\n", duration); printf("start_node = %d\n", start_node); vector test_vector2(num_nodes, 0); for(uint32_t i = 0; i < num_nodes; i++) { test_vector2[i] = ((float)rand_in_range(MAXVAL))/ MAXVAL; } gettimeofday(&end, NULL); for (int pr_iters = 0; pr_iters < 100; pr_iters++) { vector test_vector2 = ofm.pagerank(test_vector2); } duration = ( std::clock() - start ) / (double) CLOCKS_PER_SEC; printf("pagerank in in %d\n", duration); printf("pr[0] = %f\n", test_vector2[0]); */ } return true; } bool time_csr(uint32_t num_nodes, uint32_t num_edges, int trials) { srand(0); for (int j = 0; j < trials; j++) { OFM* ofm = new OFM(num_nodes); for (uint32_t k = 0; k < num_edges; k++) { uint32_t src = rand_in_range(num_nodes); uint32_t dest = rand_in_range(num_nodes); uint32_t val = rand_in_range(MAXVAL)+1; ofm->add_edge_update(src, dest, val); } CSR csr = CSR(1); csr.convert(ofm); std::clock_t start; double duration; vector test_vector(num_nodes, 0); for(uint32_t i = 0; i < num_nodes; i++) { test_vector[i] = rand_in_range(MAXVAL); } start = std::clock(); for (int spvm_iters = 0; spvm_iters < 100; spvm_iters++) { test_vector = csr.sparse_matrix_vector_multiplication(test_vector); } duration = ( std::clock() - start ) / (double) CLOCKS_PER_SEC; printf("spvm in in %f\n", duration); printf("spvm[0] = %d\n", test_vector[0]); int start_node = rand_in_range(num_nodes); start = std::clock(); for (int bfs_iters = 0; bfs_iters < 100; bfs_iters++) { vector r4 = csr.bfs(start_node); start_node = r4[0]; } duration = ( std::clock() - start ) / (double) CLOCKS_PER_SEC; printf("bfs in in %f\n", duration); printf("start_node = %d\n", start_node); vector test_vector2(num_nodes, 0); for(uint32_t i = 0; i < num_nodes; i++) { test_vector2[i] = ((float)rand_in_range(MAXVAL))/ MAXVAL; } start = std::clock(); for (int pr_iters = 0; pr_iters < 100; pr_iters++) { vector test_vector2 = csr.pagerank(test_vector2); } duration = ( std::clock() - start ) / (double) CLOCKS_PER_SEC; printf("pagerank in in %f\n", duration); printf("pr[0] = %f\n", test_vector2[0]); } return true; } int main(int argc, char* argv[]) { if (argc == 2){ if (string(argv[1]) == "-v") { if (!verify_pcsr()) { return 0; } else { printf("pcsr verified\n"); } } } printf("PCSR\n"); int trials = 1; uint32_t num_nodes = 100; uint32_t num_edges = 1000; time_pcsr(num_nodes, num_edges, trials); //printf("CSR\n"); //time_csr(num_nodes, num_edges, trials); }